repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
supertylerc/trigger | refs/heads/develop | trigger/packages/tftpy/TftpServer.py | 17 | """This module implements the TFTP Server functionality. Instantiate an
instance of the server, and then run the listen() method to listen for client
requests. Logging is performed via a standard logging object set in
TftpShared."""
import socket, os, time
import select
from TftpShared import *
from TftpPacketTypes im... |
zxtstarry/src | refs/heads/master | trip/test/asg/config.py | 20 | CC = 'mpicc'
CCFLAGS = '-O3 -pedantic -Wunused -Wno-long-long -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DIWAVE_USE_MPI'
CFLAGS = '-std=c99 -Wimplicit'
CXX = 'mpicxx'
|
tejasnikumbh/ThesisCode | refs/heads/master | lib/python2.7/site-packages/numpy/lib/tests/test_function_base.py | 27 | from __future__ import division, absolute_import, print_function
import warnings
import sys
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_raises,
assert_allclose, assert_array_max... |
Koheron/zynq-sdk | refs/heads/master | python/koheron/cli.py | 2 | import click
# --------------------------------------------
# Call koheron-server
# --------------------------------------------
class ConnectionType(object):
def __init__(self, host="", unixsock=""):
self.host = host
@click.group()
@click.option('--host', default='', help='Host ip address', envvar='HOST... |
Nikoala/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ku6.py | 147 | from __future__ import unicode_literals
from .common import InfoExtractor
class Ku6IE(InfoExtractor):
_VALID_URL = r'http://v\.ku6\.com/show/(?P<id>[a-zA-Z0-9\-\_]+)(?:\.)*html'
_TEST = {
'url': 'http://v.ku6.com/show/JG-8yS14xzBr4bCn1pu0xw...html',
'md5': '01203549b9efbb45f4b87d55bdea1ed1',
... |
wang1986one/pyo | refs/heads/master | examples/fft/02_fft_cross.py | 12 | #! /usr/bin/env python
# encoding: utf-8
"""
Performs the cross-synthesis of two sounds.
"""
from pyo import *
s = Server(duplex=0).boot()
snd1 = SfPlayer("../snds/baseballmajeur_m.aif", loop=True).mix(2)
snd2 = FM(carrier=[75,100,125,150], ratio=[.999,.5005], index=20, mul=.4).mix(2)
size = 1024
olaps = 4
fin1 = ... |
analogbyte/ansible-modules-extras | refs/heads/devel | notification/twilio.py | 39 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@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 ... |
Akoten/django-import-export | refs/heads/master | tests/core/tests/__init__.py | 17 | from .test import *
|
mrquim/repository.mrquim | refs/heads/master | repo/plugin.video.castaway/resources/lib/sources/live_tv/lmshows.py | 4 | from __future__ import unicode_literals
from resources.lib.modules import client,control
import re,sys,xbmcgui,os
class info():
def __init__(self):
self.mode = 'lmshows'
self.name = 'LMShows.com'
self.icon = 'lmshows.jpg'
self.paginated = False
self.categorized = False
... |
prophile/bong | refs/heads/master | bong/notify.py | 1 | import subprocess
import sys
def notify(message, sys=sys):
if sys.platform == 'linux':
subprocess.check_call(['notify-send', message])
elif sys.platform == 'darwin':
subprocess.check_call(['terminal-notifier', '-message', message])
else:
print(message)
|
johankaito/fufuka | refs/heads/master | microblog/old-flask/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py | 1730 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... |
webdev1001/ansible | refs/heads/devel | v2/ansible/playbook/playbook_include.py | 2 | # (c) 2012-2014, 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) an... |
stacywsmith/ansible | refs/heads/devel | test/units/module_utils/test_facts.py | 60 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... |
PriceChild/ansible | refs/heads/devel | lib/ansible/inventory/vars_plugins/__init__.py | 145 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
|
newswangerd/ansible | refs/heads/devel | examples/scripts/my_test_info.py | 29 | #!/usr/bin/python
# Copyright: (c) 2020, Your Name <YourName@example.org>
# 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
DOCUMENTATION = r'''
---
module: my_test_info
short_descriptio... |
pkilambi/ceilometer | refs/heads/master | ceilometer/network/services/base.py | 3 | #
# Copyright 2014 Cisco Systems,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 writ... |
gi0baro/weppy-assets | refs/heads/master | weppy_assets/webassets/loaders.py | 1 | """Loaders are helper classes which will read environments and/or
bundles from a source, like a configuration file.
This can be used as an alternative to an imperative setup.
"""
import os, sys
from os import path
import glob, fnmatch
import inspect
import types
from . import six
try:
import yaml
except ImportErr... |
rhattersley/iris | refs/heads/master | lib/iris/io/__init__.py | 4 | # (C) British Crown Copyright 2010 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris 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) any l... |
jaxkodex/odoo | refs/heads/8.0 | addons/stock_landed_costs/stock_landed_costs.py | 77 | # -*- 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... |
Carmezim/tensorflow | refs/heads/master | tensorflow/python/feature_column/feature_column.py | 5 | # 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... |
Bisaha/foundations-homeworks | refs/heads/master | 01/intro.py | 3 | print ("Hello world!")
print ('Hello world!')
#can add notes
print (10)
print(10 + 10)
print("hello" + "world!")
print ("Hello" + str(10))
name = "Mr. Soma"
print ("Hello, " + name)
name = input("What's your name?")
year_of_birth = input("What year were you born?")
age = 2016 - int(year_of_birth)
print ("Hello, "... |
bwrsandman/OpenUpgrade | refs/heads/8.0 | addons/procurement_jit_stock/__openerp__.py | 241 | # -*- 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... |
shinfan/api-client-staging | refs/heads/master | generated/python/gapic-google-cloud-spanner-admin-database-v1/setup.py | 7 | """A setup module for the GAPIC Cloud Spanner Database Admin API library.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import sys
install_requires = [
'google-gax>=0.15.7, <0.16dev',
'oauth2client>=2.0.0, <... |
johnkit/vtk-dev | refs/heads/master | IO/EnSight/Testing/Python/EnSightSelectArrays.py | 20 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRenderWindowInte... |
MartinHjelmare/home-assistant | refs/heads/dev | homeassistant/components/russound_rnet/__init__.py | 36 | """The russound_rnet component."""
|
sovaa/sire | refs/heads/master | sire/shared.py | 1307 | pass
|
jeanlinux/calibre | refs/heads/master | src/calibre/ebooks/oeb/polish/embed.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... |
voytekresearch/neurodsp | refs/heads/master | neurodsp/tests/sim/test_info.py | 1 | """Tests for simulation info functions."""
from pytest import raises
from neurodsp.sim.info import *
###################################################################################################
###################################################################################################
def test_get_si... |
apocalypsebg/odoo | refs/heads/8.0 | addons/gamification/tests/__init__.py | 268 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
bogdandrutu/grpc | refs/heads/master | src/python/grpcio_tests/tests/interop/_secure_interop_test.py | 3 | # 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... |
bansalrajnikant/djime | refs/heads/master | djime/statistics/views.py | 1 | import datetime
from django.contrib.auth.decorators import login_required
from django.http import *
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from djime.statistics.forms import DateSelectionForm
from teams.models import Team
from djime.models import Ti... |
christchron/or-tools | refs/heads/master | examples/python/subset_sum.py | 32 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... |
neilpanchal/iPython-Notebook-Profile | refs/heads/master | profile_neil/ipython_notebook_config.py | 1 | # Configuration file for ipython-notebook.
c = get_config()
#------------------------------------------------------------------------------
# NotebookApp configuration
#------------------------------------------------------------------------------
# NotebookApp will inherit config from: BaseIPythonApplication, Appli... |
JRock007/boxxy | refs/heads/master | dist/Boxxy.app/Contents/Resources/lib/python2.7/numpy/f2py/capi_maps.py | 58 | #!/usr/bin/env python
"""
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 2005/05/06 10:57:33 $
Pearu Peterson... |
alajara/servo | refs/heads/master | tests/wpt/harness/wptrunner/tests/test_update.py | 59 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
import StringIO
import pytest
from .. import metadata, manifestupdate
from mozlog import structuredlog... |
ryfeus/lambda-packs | refs/heads/master | Selenium_PhantomJS/source/pip/vcs/subversion.py | 170 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/utils/baseconv.py | 238 | # Copyright (c) 2010 Guilherme Gondim. All rights reserved.
# Copyright (c) 2009 Simon Willison. All rights reserved.
# Copyright (c) 2002 Drew Perttula. All rights reserved.
#
# License:
# Python Software Foundation License version 2
#
# See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF
# ... |
Niektory/fifengine | refs/heads/master | tests/fife_test/tests/PychanWidgetEventsTest.py | 5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU ... |
BtbN/xbmc | refs/heads/master | tools/EventClients/Clients/PS3 Sixaxis Controller/ps3d.py | 168 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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) ... |
jayceyxc/hue | refs/heads/master | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/commoncrypto/seccertificate.py | 8 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <Security/SecCertificate.h>
"""
TYPES = """
type... |
numenta/nupic | refs/heads/master | src/nupic/swarming/utils.py | 10 | # ----------------------------------------------------------------------
# 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... |
vightel/FloodMapsWorkshop | refs/heads/master | python/ef5_inundation.py | 3 | #
# Processes Flood Inundation Maps from EF5 http://flash.ou.edu/pakistan/
#
import os, sys
from datetime import date
from dateutil.parser import parse
import glob, fnmatch, urllib, math, shutil
from osgeo import gdal
import numpy
import argparse
import config
import json
from browseimage import MakeBrowseImage
fro... |
FireballDWF/cloud-custodian | refs/heads/master | c7n/resources/sqs.py | 3 | # Copyright 2016-2017 Capital One Services, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
heiher/libreoffice-core | refs/heads/mips64-dev | pyuno/qa/pytests/testcollections_XCellRange.py | 4 | #!/usr/bin/env python
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import unittest
import uno
from testcollect... |
shaistaansari/django | refs/heads/master | tests/template_tests/syntax_tests/test_if_equal.py | 368 | from django.test import SimpleTestCase
from ..utils import setup
class IfEqualTagTests(SimpleTestCase):
@setup({'ifequal01': '{% ifequal a b %}yes{% endifequal %}'})
def test_ifequal01(self):
output = self.engine.render_to_string('ifequal01', {'a': 1, 'b': 2})
self.assertEqual(output, '')
... |
ksh/gpitrainingv2 | refs/heads/master | modules/dashboard/course_settings.py | 13 | # 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 by applicable law or ... |
nuagenetworks/vspk-python | refs/heads/master | vspk/v5_0/fetchers/nuvnfcatalogs_fetcher.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... |
crosswalk-project/chromium-crosswalk-efl | refs/heads/efl/crosswalk-10/39.0.2171.19 | components/policy/tools/make_policy_zip.py | 159 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Creates a zip archive with policy template files. The list of input files is
extracted from a grd file with grit. This is to kee... |
switowski/invenio | refs/heads/master | invenio/testsuite/test_ext_crossref.py | 7 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio
# Copyright (C) 2014, 2015 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 ... |
jkyeung/XlsxWriter | refs/heads/master | xlsxwriter/test/comparison/test_chart_column04.py | 1 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... |
slevenhagen/odoo-npg | refs/heads/8.0 | addons/crm/res_partner.py | 71 | # -*- 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... |
M32Media/redash | refs/heads/master | tests/handlers/test_query_snippets.py | 14 | from tests import BaseTestCase
from redash.models import QuerySnippet
class TestQuerySnippetResource(BaseTestCase):
def test_get_snippet(self):
snippet = self.factory.create_query_snippet()
rv = self.make_request('get', '/api/query_snippets/{}'.format(snippet.id))
for field in ('snippet'... |
tumbl3w33d/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_profile_http2.py | 22 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... |
courtarro/gnuradio-wg-grc | refs/heads/master | gr-blocks/python/blocks/qa_vco.py | 54 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/django/utils/translation/template.py | 58 | from __future__ import unicode_literals
import re
import warnings
from django.template.base import (
TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_TEXT, TOKEN_VAR, TRANSLATOR_COMMENT_MARK,
Lexer,
)
from django.utils import six
from django.utils.encoding import force_text
from django.utils.six import StringIO
from . impo... |
hammerlab/mhcflurry | refs/heads/master | mhcflurry/local_parallelism.py | 1 | """
Infrastructure for "local" parallelism, i.e. multiprocess parallelism on one
compute node.
"""
import traceback
import sys
import os
import time
from multiprocessing import Pool, Queue, cpu_count
from six.moves import queue
from multiprocessing.util import Finalize
from pprint import pprint
import random
import n... |
jmcarbo/openerp7 | refs/heads/master | openerp/addons/knowledge/__openerp__.py | 122 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
LeahDresd2/Leah | refs/heads/master | py/openage/convert/__main__.py | 46 | #!/usr/bin/env python3
from . import datafile
from . import mediafile
from .util import set_verbosity
import argparse
def main():
# the convert script has 1 mode:
# mode 0: generate media files
# this requires the aoe installation
# database files as csv will be generated, as well as us... |
tempbottle/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py | 3126 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
jhawkesworth/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/iam.py | 31 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... |
anurag03/integration_tests | refs/heads/master | cfme/tests/infrastructure/test_child_tenant.py | 1 | import fauxfactory
import pytest
from riggerlib import recursive_update
from widgetastic.utils import partial_match
from cfme import test_requirements
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provide... |
rhdedgar/openshift-tools | refs/heads/stg | openshift/installer/vendored/openshift-ansible-3.6.173.0.27/roles/lib_openshift/src/lib/base.py | 8 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-lines
# noqa: E301,E302,E303,T001
class OpenShiftCLIError(Exception):
'''Exception class for openshiftcli'''
pass
ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')]
def locate_oc_binary():
''' Find and return oc binar... |
karan/warehouse | refs/heads/master | tests/unit/accounts/test_core.py | 5 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... |
drousis/pywebdata | refs/heads/master | pywebdata/parameter.py | 1 | import math
from itertools import ifilter
iotypes = {'float': float, 'int': int}
def frange(a, b=None, incr=1.):
if b is None:
b, a = a, 0.
else:
a = float(a)
count = int(math.ceil(b - a)/incr)
return (a + n*incr for n in range(count))
class Output(object):
def __init__(self, iotype, f_parse=None... |
ToAruShiroiNeko/revscoring | refs/heads/master | revscoring/utilities/__init__.py | 4 | """
This module implements a set of utilities for extracting features and
train/testing :class:`revscoring.scorer_models.MLScorerModel` from the
command-line. When the revscoring python package is installed, a `revscoring`
utility should be available from the commandline. Run `revscoring -h` for more
information:
ex... |
plin1112/pysimm | refs/heads/stable | pysimm/models/monomers/dreiding/pe.py | 3 | from pysimm import system, lmps, forcefield
from pysimm.apps.random_walk import random_walk
def monomer():
try:
s = system.read_pubchem_smiles('CC')
except:
import os
s = system.read_mol(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, 'CC.mol'))
f = forcefield.D... |
olasitarska/django | refs/heads/master | django/db/backends/sqlite3/schema.py | 7 | import codecs
import copy
from decimal import Decimal
from django.utils import six
from django.apps.registry import Apps
from django.db.backends.schema import BaseDatabaseSchemaEditor
from django.db.models.fields.related import ManyToManyField
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_delete_tabl... |
suninsky/ReceiptOCR | refs/heads/master | Python/server/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2762 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
jonathonwalz/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/spam8/ham/bacon.py | 298 | data = 'spam8:bacon'
|
CivicTechTO/open-cabinet | refs/heads/master | venv/lib/python2.7/site-packages/static.py | 7 | #!/usr/bin/env python
"""
Copyright (C) 2012 Roman Mohr <roman@fenkhuber.at>
"""
"""static - A stupidly simple WSGI way to serve static (or mixed) content.
(See the docstrings of the various functions and classes.)
Copyright (C) 2006-2009 Luke Arno - http://lukearno.com/
This library is free software; you can redis... |
hristo-vrigazov/Word-sense-disambiguator | refs/heads/master | submit.py | 2 |
### The only things you'll have to edit (unless you're porting this script over to a different language)
### are at the bottom of this file.
import urllib
import urllib2
import hashlib
import random
import email
import email.message
import email.encoders
import StringIO
import sys
import os
""""""""""""""""""""
""... |
JohnTroony/nikola | refs/heads/master | nikola/plugins/command/import_wordpress.py | 1 | # -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/tripleQuotedSubstring.py | 83 | print(""""One two
* <selection>Three</selection>
* Four
* Five""" + suffix) |
richardnpaul/FWL-Website | refs/heads/master | lib/python2.7/site-packages/django/core/servers/fastcgi.py | 241 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... |
AndrewGrossman/django | refs/heads/master | tests/flatpages_tests/test_models.py | 342 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.flatpages.models import FlatPage
from django.test import SimpleTestCase
from django.test.utils import override_script_prefix
class FlatpageModelTests(SimpleTestCase):
def test_get_absolute_url_urlencodes(self):
pf = Fla... |
mpetyx/palmdrop | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/admin/forms.py | 97 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import AuthenticationForm
from django.utils.translation import ugettext_lazy
ERROR_MESSAGE = ugettext_lazy("Please enter the correct %(username)s and password "
"for a ... |
idlead/scikit-learn | refs/heads/master | examples/cluster/plot_kmeans_stability_low_dim_dense.py | 338 | """
============================================================
Empirical evaluation of the impact of k-means initialization
============================================================
Evaluate the ability of k-means initializations strategies to make
the algorithm convergence robust as measured by the relative stan... |
mbareta/edx-platform-ft | refs/heads/open-release/eucalyptus.master | lms/djangoapps/courseware/tests/test_video_mongo.py | 8 | # -*- coding: utf-8 -*-
"""Video xmodule tests in mongo."""
import ddt
import json
from collections import OrderedDict
from path import Path as path
from lxml import etree
from mock import patch, MagicMock, Mock
from nose.plugins.attrib import attr
from django.conf import settings
from django.test import TestCase
fr... |
ayumilong/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-base-address.py | 137 | #!/usr/bin/env python
# Copyright 2013 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.
"""
Make sure the base address setting is extracted properly.
"""
import TestGyp
import re
import sys
if sys.platform == 'win32':
test = Te... |
sfaleron/ConfigNG | refs/heads/master | parser.py | 1 |
"""Direct access is not intended; instead use the toplevel package."""
from __future__ import absolute_import
from __future__ import print_function
from .errors import *
from .configcont import ConfigCont
from minisup import do_string
import os.path as osp
import re
# detects a declaration or assignment
item_r ... |
gabrielleLQX/arm-none-eabi_install | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
pandeyop/rally | refs/heads/master | rally/cmd/commands/verify.py | 2 | # Copyright 2014: Mirantis 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... |
milinbhakta/flaskjinja | refs/heads/master | flask1/Lib/collections/abc.py | 274 | from _collections_abc import *
from _collections_abc import __all__
|
sanyaade-iot/Arduino-1 | refs/heads/esp8266 | arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/connectionpool.py | 184 | # urllib3/connectionpool.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import socket
import errno
from socket import error as SocketError, time... |
girving/tensorflow | refs/heads/master | tensorflow/contrib/linear_optimizer/python/ops/sparse_feature_column.py | 119 | # 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... |
crowning-/dash | refs/heads/master | qa/rpc-tests/mempool_resurrect_test.py | 2 | #!/usr/bin/env python3
# Copyright (c) 2014-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 resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework... |
dmsurti/mayavi | refs/heads/master | examples/mayavi/interactive/mayavi_traits_ui.py | 6 | #!/usr/bin/env python
"""
An example of how to create a UI similar to the complete Mayavi application
inside a Traits UI view.
This does not use Envisage and provides a similar UI as seen in the full
Mayavi application.
This example uses `traitsUI <http://code.enthought.com/projects/traits/>`_
to create a dialog mimi... |
cloudControl/libcloud | refs/heads/trunk | docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py | 51 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
ACCESS_ID = 'your access id'
SECRET_KEY = 'your secret key'
cls = get_driver(Provider.ELB)
driver = cls(key=ACCESS_ID, secret=SECRET_KEY)
driver.ex_create_balancer_listeners(
name='MyLB',
listeners=[[1024, 65533, 'H... |
bblacey/FreeCAD-MacOS-CI | refs/heads/master | src/Tools/generateTemplates/templateModule.py | 31 | #! python
# -*- coding: utf-8 -*-
# (c) 2006 Juergen Riegel
import template, templateModuleApp,templateModuleGui
import generateBase.generateModel_Module
class TemplateModule (template.ModelTemplate):
def Generate(self):
print "generateBase.generateModel_Module.Generate()\n"
App= templa... |
chowooick/kaug | refs/heads/master | setup.py | 191 | from setuptools import setup, find_packages, os
import json
with open('package.json') as packageFile:
version = json.load(packageFile)['version']
setup(
name="jasmine-core",
version=version,
url="http://pivotal.github.io/jasmine/",
author="Pivotal Labs",
author_email="jasmine-js@googlegroups.com... |
Centre-Alt-Rendiment-Esportiu/att | refs/heads/master | src/python/test/classes/ball_detector/Extrapolator.py | 1 | import warnings
import numpy as np
from test.classes.utils.Ball import Ball
LEN_EXTRAPOL = 4
class Extrapolator:
def extrapolate(self, history):
real_balls = list(filter(lambda x: not x.is_extrapolate, history))
# Don't extrapolate if there aren't enough balls to do so
if len(real_balls... |
JakeAi/Dashboard | refs/heads/master | user_guide_src/cilexer/setup.py | 397 | """
Install and setup CodeIgniter highlighting for Pygments.
"""
from setuptools import setup
entry_points = """
[pygments.lexers]
cilexer = cilexer.cilexer:CodeIgniterLexer
"""
setup(
name='pycilexer',
version='0.1',
description=__doc__,
author="EllisLab, Inc.",
packages=['cilexer'],
install... |
dushu1203/chromium.src | refs/heads/nw12 | tools/telemetry/third_party/pyserial/serial/urlhandler/protocol_socket.py | 141 | #! python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# This module implements a simple socket based client.
# It does not support changing any port parameters and will silently ignore any
# requests to do so.
#
# The purpose of this module is that applications using pySerial can ... |
GdZ/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_2/django/contrib/localflavor/pl/pl_voivodeships.py | 544 | """
Polish voivodeship as in http://en.wikipedia.org/wiki/Poland#Administrative_division
"""
from django.utils.translation import ugettext_lazy as _
VOIVODESHIP_CHOICES = (
('lower_silesia', _('Lower Silesia')),
('kuyavia-pomerania', _('Kuyavia-Pomerania')),
('lublin', _('Lublin')),
('lubusz', _('Lubu... |
torchingloom/edx-platform | refs/heads/select/release | lms/djangoapps/instructor/tests/test_enrollment.py | 1 | """
Unit tests for instructor.enrollment methods.
"""
import json
import mock
from abc import ABCMeta
from courseware.models import StudentModule
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from student.tests.factories import UserFactory
from xmodul... |
nelmiux/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/test/test_memoryview.py | 75 | """Unit tests for the memoryview
XXX We need more tests! Some tests are in test_bytes
"""
import unittest
import sys
import gc
import weakref
import array
from test import test_support
import io
class AbstractMemoryTests:
source_bytes = b"abcdef"
@property
def _source(self):
return self.source_... |
RPI-OPENEDX/edx-platform | refs/heads/RPI-DEV | lms/djangoapps/courseware/access.py | 3 | """
This file contains (or should), all access control logic for the courseware.
Ideally, it will be the only place that needs to know about any special settings
like DISABLE_START_DATES.
Note: The access control logic in this file does NOT check for enrollment in
a course. It is expected that higher layers check f... |
fnouama/intellij-community | refs/heads/master | python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/__init__.py | 102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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... |
CDE-UNIBE/qcat | refs/heads/develop | apps/questionnaire/migrations/0018_auto_20170810_1651.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questionnaire', '0017_auto_20170313_1724'),
]
operations = [
migrations.AlterField(
model_name='questionnairetra... |
michaelni/audacity | refs/heads/master | lib-src/libsndfile/programs/test-sndfile-metadata-set.py | 44 | #!/usr/bin/python
# Copyright (C) 2008-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.