repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
fontenele/httpie | refs/heads/master | tests/test_downloads.py | 49 | import os
import time
import pytest
from requests.structures import CaseInsensitiveDict
from httpie.compat import urlopen
from httpie.downloads import (
parse_content_range, filename_from_content_disposition, filename_from_url,
get_unique_filename, ContentRangeError, Download,
)
from utils import http, TestEn... |
appcelerator/portal | refs/heads/master | client/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.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
#-------------------------------------------------------------------... |
stackforge/tacker | refs/heads/master | tacker/db/migration/alembic_migrations/versions/9d425296f2c3_add_vnfpkgm_db.py | 2 | # Copyright (C) 2019 NTT DATA
# 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 ... |
xenadevel/xenascriptlibs | refs/heads/master | layer47/python/ResetAllPorts.py | 1 | #!/usr/bin/python
import os, sys, time, getopt
lib_path = os.path.abspath('testutils')
sys.path.append(lib_path)
from TestUtilsL47 import XenaScriptTools
def helptext():
print
print "Usage: ./ResetAllPorts.py options IPaddr [ports]"
print
print " resets specified ports - if no ports are specified,... |
ivandevp/django | refs/heads/master | django/conf/project_template/project_name/urls.py | 244 | """{{ project_name }} URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/{{ docs_version }}/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.ho... |
jumpstarter-io/nova | refs/heads/master | nova/wsgi.py | 7 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
reidlindsay/wins | refs/heads/master | tests/qa_queue.py | 1 | #! /usr/bin/env python
"""
Runs Queue tests.
Revision Info
=============
* $LastChangedBy: mandke $
* $LastChangedDate: 2011-09-28 21:43:47 -0500 (Wed, 28 Sep 2011) $
* $LastChangedRevision: 5169 $
:author: Ketan Mandke <kmandke@mail.utexas.edu>
:copyright:
Copyright 2009 The University of Texas at Austin
... |
padraic-padraic/MPHYSG001_CW1 | refs/heads/master | greengraph/test/test_google_map.py | 1 | from ..google_map import Map
from mock import patch
from nose.tools import assert_equal
from nose.tools import assert_raises
from .colors import colors
import numpy as np
@patch('requests.get')
@patch('matplotlib.image.imread')
def test_map_init(mock_imread,mock_get):
m = Map(10.,10.)
mock_get.assert_called_w... |
espadrine/opera | refs/heads/master | chromium/src/tools/gyp/pylib/gyp/generator/ninja.py | 2 | # Copyright (c) 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.
import copy
import hashlib
import itertools
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
import gyp.common... |
ldirer/scikit-learn | refs/heads/master | examples/cluster/plot_agglomerative_clustering.py | 343 | """
Agglomerative clustering with and without structure
===================================================
This example shows the effect of imposing a connectivity graph to capture
local structure in the data. The graph is simply the graph of 20 nearest
neighbors.
Two consequences of imposing a connectivity can be s... |
ryfeus/lambda-packs | refs/heads/master | Spacy/source2.7/numpy/core/tests/test_mem_overlap.py | 21 | from __future__ import division, absolute_import, print_function
import sys
import itertools
import numpy as np
from numpy.testing import (run_module_suite, assert_, assert_raises, assert_equal,
assert_array_equal, assert_allclose, dec)
from numpy.core.multiarray_tests import solve_diophan... |
ingokegel/intellij-community | refs/heads/master | python/helpers/py2only/docutils/parsers/rst/languages/af.py | 128 | # $Id: af.py 7119 2011-09-02 13:00:23Z milde $
# Author: Jannie Hofmeyr <jhsh@sun.ac.za>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for ... |
HiroIshikawa/21playground | refs/heads/master | flask-sample/hello/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py | 1785 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... |
xuweiliang/Codelibrary | refs/heads/master | openstack_dashboard/dashboards/project/stacks/resource_types/panel.py | 10 | # 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... |
nso95/vitess | refs/heads/master | py/vtdb/tablet3.py | 2 | # Copyright 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.
from itertools import izip
import logging
import re
from net import bsonrpc
from net import gorpc
from vtdb import cursor
from vtdb import dbexceptions
from vtdb imp... |
memex-explorer/memex-explorer | refs/heads/master | source/apps/crawl_space/viz/harvest.py | 2 | from __future__ import division
import os
from blaze import into
import pandas as pd
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, HoverTool
from collections import OrderedDict
from bokeh.embed import components
import subprocess
import shlex
from StringIO import StringIO
GREEN = "#47a8... |
Mariatta/pythondotorg | refs/heads/master | boxes/__init__.py | 12133432 | |
drybjed/debops-playbooks | refs/heads/master | playbooks/library/database/ldap/__init__.py | 12133432 | |
lizardsystem/flooding | refs/heads/master | flooding_lib/tools/approvaltool/migrations/__init__.py | 12133432 | |
NL66278/odoo | refs/heads/8.0 | addons/claim_from_delivery/__openerp__.py | 172 | ##############################################################################
#
# 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 Affero General Public L... |
diox/olympia | refs/heads/master | src/olympia/discovery/admin.py | 4 | from django import forms
from django.contrib import admin
from django.contrib.admin.widgets import ForeignKeyRawIdWidget
from django.utils import translation
from django.utils.html import conditional_escape, format_html
from django.utils.safestring import mark_safe
from django.utils.translation import gettext
from djan... |
javierTerry/odoo | refs/heads/8.0 | addons/l10n_multilang/account.py | 348 | # -*- 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... |
domenicosolazzo/practice-django | refs/heads/master | venv/lib/python2.7/site-packages/django/conf/locale/ca/formats.py | 82 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... |
cfelton/alt.hdl | refs/heads/master | examples/ex4_mathsop/myhdl/construct.py | 1 |
from myhdl import *
ggens = []
gclock = None #Signal(bool(0))
greset = None #ResetSignal(0, active=0, async=True)
def init(clock=None, reset=None):
global ggens,gclock,greset
gclock,greset = clock,reset
ggens = []
return ggens
def end(g=None, dump=False):
global ggens
if dump:
for ... |
slank/ansible | refs/heads/devel | test/units/executor/test_play_iterator.py | 24 | # (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... |
yotchang4s/cafebabepy | refs/heads/develop | src/main/python/lib2to3/fixes/fix_standarderror.py | 203 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for StandardError -> Exception."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixStandarderror(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
... |
tomduijf/home-assistant | refs/heads/master | config/custom_components/example.py | 15 | """
custom_components.example
~~~~~~~~~~~~~~~~~~~~~~~~~
Example component to target an entity_id to:
- turn it on at 7AM in the morning
- turn it on if anyone comes home and it is off
- turn it off if all lights are turned off
- turn it off if all people leave the house
- offer a service to turn it on for 10 seco... |
openhatch/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/test/test_formmethod.py | 18 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for formmethod module.
"""
from twisted.trial import unittest
from twisted.python import formmethod
class ArgumentTestCase(unittest.TestCase):
def argTest(self, argKlass, testPairs, badValues, *args, **kwargs):
arg... |
kosz85/django | refs/heads/master | django/contrib/admindocs/utils.py | 88 | "Misc. utility functions/classes for admin documentation generator."
import re
from email.errors import HeaderParseError
from email.parser import HeaderParser
from django.urls import reverse
from django.utils.encoding import force_bytes
from django.utils.safestring import mark_safe
try:
import docutils.core
... |
ebukoz/thrive | refs/heads/develop | erpnext/healthcare/page/patient_history/__init__.py | 12133432 | |
beck/django | refs/heads/master | tests/i18n/project_dir/app_with_locale/__init__.py | 12133432 | |
gautamkmr/incubator-mxnet | refs/heads/master | example/rcnn/rcnn/core/__init__.py | 12133432 | |
massmutual/scikit-learn | refs/heads/master | examples/cluster/plot_segmentation_toy.py | 258 | """
===========================================
Spectral clustering for image segmentation
===========================================
In this example, an image with connected circles is generated and
spectral clustering is used to separate the circles.
In these settings, the :ref:`spectral_clustering` approach solve... |
jarn0ld/gnuradio | refs/heads/master | gr-digital/python/digital/__init__.py | 54 | # Copyright 2011-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)
# any later version... |
lnawrot/traffic-simulator | refs/heads/master | site_scons/site_tools/qt4/test/qrc/multifiles/sconstest-multifiles-manual.py | 6 | #!/usr/bin/env python
#
# Copyright (c) 2001-2010 The SCons Foundation
#
# 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,... |
nburn42/tensorflow | refs/heads/master | tensorflow/python/data/__init__.py | 3 | # 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... |
TimYi/pybuilder | refs/heads/master | src/integrationtest/python/should_raise_exception_when_project_is_not_valid_tests.py | 7 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... |
JetBrains/intellij-community | refs/heads/master | python/testData/refactoring/inlineFunction/methodOutsideClass/main.after.py | 12 | class MyClass:
def do_stuff(self, x, y):
print(x)
print(y)
return self.for_inline(x, y)
def for_inline(self, a, b):
self.do_something_else()
if a:
print(a)
elif b:
print(b)
else:
print("nothing")
return a, b
... |
mikewiebe-ansible/ansible | refs/heads/devel | contrib/inventory/foreman.py | 10 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>,
# Daniel Lobato Garcia <dlobatog@redhat.com>
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... |
akaihola/django | refs/heads/master | tests/modeltests/custom_pk/fields.py | 93 | import random
import string
from django.db import models
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (self.__class__.__name__, self.value)
def __unicode__(self):
return self.value
def __eq__(self, other):
... |
Squeegee/vidis | refs/heads/master | vidis/admin/regexes.py | 1 | from .. import app, ModelForm
from ..authority import *
from ..models import db, RegexModel
from ..utils import *
from flask import render_template, redirect, url_for, request, flash, abort
from flask.ext.login import login_required, current_user
from sqlalchemy.orm.exc import NoResultFound
from wtforms import Form, St... |
apache/spark | refs/heads/master | examples/src/main/python/ml/min_hash_lsh_example.py | 27 | #
# 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... |
nrc/servo | refs/heads/master | python/mach_bootstrap.py | 8 | # 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/.
from __future__ import print_function, unicode_literals
import os
import platform
import subprocess
import sys
from dis... |
alexcoplan/p2proj | refs/heads/master | src/script/prepare_chorales.py | 1 | # this script reqiures:
# - Python 3
# - Latest music21 (in particular, 8b5d422 where I fix a bug in BWV 348)
# and it should be run from the main src directory
import music21 # type: ignore
import json
import argparse
from collections import Counter # for counting events in a given types domain
from typing import Di... |
ceholden/yatsm | refs/heads/master | yatsm/mapping/__init__.py | 3 | """ Module for making map products from YATSM results
Contains functions used in "map" command line interface script.
"""
from .changes import get_change_date, get_change_num
from .classification import get_classification
from .phenology import get_phenology
from .prediction import get_coefficients, get_prediction
_... |
testiddd/ShaniXBMCWork | refs/heads/master | plugin.video.pitelevision/dirCreator.py | 24 | '''
Created on 6 Mar 2014
@author: home
'''
import urllib,urllib2, HTMLParser;
import sys,xbmcgui,xbmcplugin;
class parseList(object):
def __init__(self, listToParse):
for entry in listToParse:
name=entry["name"];
url=entry["url"];
mode=entry["mode"];
... |
Teamxrtc/webrtc-streaming-node | refs/heads/master | third_party/webrtc/src/chromium/src/tools/gyp/test/rules-rebuild/gyptest-default.py | 345 | #!/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.
"""
Verifies that a rule that generates multiple outputs rebuilds
correctly when the inputs change.
"""
import TestGyp
test = TestGyp.Test... |
asimshankar/tensorflow | refs/heads/master | tensorflow/python/framework/smart_cond.py | 24 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
someorz/spark | refs/heads/master | sql/hive/src/test/resources/data/scripts/dumpdata_script.py | 68 | #
# 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... |
zdary/intellij-community | refs/heads/master | python/testData/codeInsight/controlflow/continue.py | 83 | while foo:
if condition:
continue
print "Hello" |
shoopio/shoop-wintergear-demo | refs/heads/master | wintergear/__init__.py | 1 | # This file is part of Shoop Wintergear Demo.
#
# 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 django.conf import settings
from django.utils.encoding import force_text
from... |
joachimneu/pelican-plugins | refs/heads/master | representative_image/representative_image.py | 32 | from pelican import signals
from pelican.contents import Article, Draft, Page
from pelican.generators import ArticlesGenerator
from bs4 import BeautifulSoup
def images_extraction(instance):
representativeImage = None
if type(instance) in (Article, Draft, Page):
if 'image' in instance.metadata:
... |
willharris/django | refs/heads/master | tests/gis_tests/gdal_tests/test_geom.py | 36 | import json
import unittest
from binascii import b2a_hex
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.utils.six.moves import range
from ..test_data import TestDataMixin
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
if... |
rvs/gpdb | refs/heads/master | src/test/tinc/tinctest/test/folder3_failure/test_folder3_failure.py | 15 | import tinctest
class MockTINCTestCaseForLoaderPass(tinctest.TINCTestCase):
def test_0(self):
pass
def test_1(self):
pass
class MockTINCTestCaseForLoaderFailure(tinctest.TINCTestCase):
def test_0(self):
pass
|
serviceagility/boto | refs/heads/develop | boto/elasticache/layer1.py | 150 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
tornadomeet/ResNet | refs/heads/master | symbol_resnet.py | 2 | '''
Reproducing paper:
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. "Identity Mappings in Deep Residual Networks"
'''
import mxnet as mx
def residual_unit(data, num_filter, stride, dim_match, name, bottle_neck=True, bn_mom=0.9, workspace=512, memonger=False):
"""Return ResNet Unit symbol for building ResNet
... |
DraXus/andaluciapeople | refs/heads/master | simplejson/tests/test_pass3.py | 261 | from unittest import TestCase
import simplejson as json
# from http://json.org/JSON_checker/test/pass3.json
JSON = r'''
{
"JSON Test Pattern pass3": {
"The outermost value": "must be an object or array.",
"In this test": "It is an object."
}
}
'''
class TestPass3(TestCase):
def test_parse... |
shreyans800755/coala | refs/heads/master | tests/collecting/collectors_test_dir/bears/bear1.py | 35 | import multiprocessing
from coalib.bears.Bear import Bear
from coalib.settings.Section import Section
class TestBear(Bear):
def __init__(self):
Bear.__init__(self, Section('settings'), multiprocessing.Queue())
@staticmethod
def kind():
return 'kind'
def origin(self):
return... |
ThomasChiroux/boksh | refs/heads/master | build_scripts/version.py | 1 | # -*- coding: utf-8 -*-
# Author: Douglas Creager <dcreager@dcreager.net>
# This file is placed into the public domain.
# Calculates the current version number. If possible, this is the
# output of “git describe”, modified to conform to the versioning
# scheme that setuptools uses. If “git describe” returns an error
#... |
ryfeus/lambda-packs | refs/heads/master | Tensorflow_OpenCV_Nightly/source/tensorflow/core/framework/graph_pb2.py | 9 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/graph.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf imp... |
Andr3iC/juriscraper | refs/heads/master | opinions/united_states/state/ri_u.py | 2 | """Scraper for the Rhode Island Supreme Court
CourtID: ri
Court Short Name: R.I.
Author: Brian W. Carver
Date created: 2013-08-10
"""
from juriscraper.opinions.united_states.state import ri_p
class Site(ri_p.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
se... |
skapfer/rubber | refs/heads/master | src/latex_modules/lualatex.py | 1 | import rubber.module_interface
class Module (rubber.module_interface.Module):
def __init__ (self, document, opt):
document.program = 'lualatex'
document.engine = 'LuaLaTeX'
document.register_post_processor (old_suffix='.pdf', new_suffix='.pdf')
|
nkgilley/home-assistant | refs/heads/dev | tests/components/apns/test_notify.py | 7 | """The tests for the APNS component."""
import io
import unittest
from apns2.errors import Unregistered
import yaml
import homeassistant.components.apns.notify as apns
import homeassistant.components.notify as notify
from homeassistant.core import State
from homeassistant.setup import setup_component
from tests.asyn... |
DreamerKing/LightweightHtmlWidgets | refs/heads/master | LightweightHtmlWidgets/bin/Release/Ipy.Lib/smtplib.py | 74 | #! /usr/bin/env python
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RC... |
molobrakos/home-assistant | refs/heads/master | tests/components/canary/test_init.py | 12 | """The tests for the Canary component."""
import unittest
from unittest.mock import patch, MagicMock, PropertyMock
import homeassistant.components.canary as canary
from homeassistant import setup
from tests.common import (
get_test_home_assistant)
def mock_device(device_id, name, is_online=True, device_type_name... |
FlintHill/SUAS-Competition | refs/heads/master | env/lib/python3.7/site-packages/setuptools/_vendor/packaging/specifiers.py | 1107 | # 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
import abc
import functools
import itertools
import re
from ._compat impo... |
shajoezhu/server | refs/heads/develop | scripts/bam2sam.py | 12 | """
Convert a BAM file to a small SAM file
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import utils
@utils.Timed()
def main():
tool = utils.AlignmentFileTool(
utils.AlignmentFileConstants.BAM,
utils.AlignmentFileConstants.SAM)
... |
johnmee/plugin.video.catchuptv.au.ten | refs/heads/master | resources/lib/pyamf/adapters/__init__.py | 39 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
The adapter package provides additional functionality for other Python
packages. This includes registering classes, setting up type maps etc.
@since: 0.1.0
"""
import os.path
import glob
from pyamf.util import imports
adapters_registered = Fals... |
tsgit/invenio | refs/heads/prod | modules/bibauthorid/lib/bibauthorid_cluster_set.py | 5 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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... |
cheapjack/MoT | refs/heads/master | mcpi/server.py | 2 | # this file is intended to be edited by the user running the script.
#
# by editing this file you can easily change whether the scripts are run from the local machine
# that is, on the raspberry pi itself
# or from another computer on the network
#
# if you are running the scripts on the raspberry pi, then set address ... |
ahmed-mahran/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/test_discovery_sample/pattern_tests.py | 641 | from unittest import TestCase
class Test(TestCase):
def test_sample(self):
self.assertEqual(1, 1)
|
holachek/ecosense | refs/heads/master | app/requests/packages/charade/utf8prober.py | 205 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
... |
le9i0nx/ansible | refs/heads/devel | lib/ansible/plugins/connection/iocage.py | 25 | # Based on jail.py
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2016, Stephan Lohse <dev-github@ploek.org>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (a... |
yapengsong/ovirt-engine | refs/heads/eayunos-4.2 | packaging/setup/plugins/ovirt-engine-remove/base/network/firewall_manager.py | 8 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 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... |
kingvuplus/ME-TEST1 | refs/heads/master | lib/python/Plugins/SystemPlugins/DiseqcTester/plugin.py | 15 | from Screens.Satconfig import NimSelection
from Screens.Screen import Screen
from Screens.TextBox import TextBox
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.ActionMap import ActionMap, NumberActionMap
from Components.NimManager import nimmanager
from Components.... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/cryptomath.py | 172 | """cryptomath module
This module has basic math/crypto code."""
import os
import math
import base64
import binascii
import sha
from compat import *
# **************************************************************************
# Load Optional Modules
# ****************************************************************... |
ka7eh/django-oscar | refs/heads/master | src/oscar/apps/dashboard/communications/config.py | 58 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class CommunicationsDashboardConfig(AppConfig):
label = 'communications_dashboard'
name = 'oscar.apps.dashboard.communications'
verbose_name = _('Communications dashboard')
|
balloob/home-assistant | refs/heads/dev | tests/components/smartthings/test_lock.py | 15 | """
Test for the SmartThings lock platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import Attribute, Capability
from pysmartthings.device import Status
from homeassistant.components.lock import DOMAIN as LOCK_DO... |
ludwiktrammer/odoo | refs/heads/9.0 | addons/stock_landed_costs/product.py | 42 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
SPLIT_METHOD = [
('equal', 'Equal'),
('by_quantity', 'By Quantity'),
('by_current_cost_price', 'By Current Cost'),
('by_weight', 'By Weight'),
('by_volume', 'By Vo... |
avati/samba | refs/heads/master | buildtools/wafadmin/Node.py | 16 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005 (ita)
"""
Node: filesystem structure, contains lists of nodes
IMPORTANT:
1. Each file/folder is represented by exactly one node.
2. Most would-be class properties are stored in Build: nodes to depend on, signature, flags, ..
unused class members increase th... |
splav/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/py/py/_process/cmdexec.py | 273 | import sys
import subprocess
import py
from subprocess import Popen, PIPE
def cmdexec(cmd):
""" return unicode output of executing 'cmd' in a separate process.
raise cmdexec.Error exeception if the command failed.
the exception will provide an 'err' attribute containing
the error-output from the comma... |
iivvoo/nashvegas | refs/heads/master | nashvegas/admin.py | 14 | from django.contrib import admin
from nashvegas.models import Migration
class MigrationAdmin(admin.ModelAdmin):
list_display = ["migration_label", "date_created", "scm_version"]
list_filter = ["date_created"]
search_fields = ["content", "migration_label"]
admin.site.register(Migration, MigrationAdmin)
|
imaginal/openprocurement.search | refs/heads/master | openprocurement/search/version.py | 2 | # -*- coding: utf-8 -*-
__version_info__ = (0, 8, 1)
__version__ = '.'.join((str(entry) for entry in __version_info__))
|
timoschwarzer/blendworks | refs/heads/master | BlendWorks Server/python/Lib/test/test_uu.py | 107 | """
Tests for uu module.
Nick Mathewson
"""
import unittest
from test import support
import sys, os
import uu
from io import BytesIO
import io
plaintext = b"The smooth-scaled python crept over the sleeping dog\n"
encodedtext = b"""\
M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
(:6YG(&1O9PH """
# ... |
MountainWei/nova | refs/heads/master | nova/tests/unit/fake_loadables/fake_loadable1.py | 95 | # 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 req... |
datalogics/scons | refs/heads/master | test/TEX/PDFLATEXCOMSTR.py | 2 |
#!/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,... |
vvv1559/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/setdiscovery.py | 92 | # setdiscovery.py - improved discovery of common nodeset for mercurial
#
# Copyright 2010 Benoit Boissinot <bboissin@gmail.com>
# and Peter Arrenbrecht <peter@arrenbrecht.ch>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from no... |
Novasoft-India/OperERP-AM-Motors | refs/heads/master | openerp/addons/base/res/ir_property.py | 63 | # -*- 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... |
tobias47n9e/social-core | refs/heads/master | social_core/tests/backends/open_id.py | 4 | # -*- coding: utf-8 -*-
import sys
import requests
from six.moves.html_parser import HTMLParser
from openid import oidutil
from httpretty import HTTPretty
sys.path.insert(0, '..')
from .base import BaseBackendTest
from ..strategy import TestStrategy
from ..models import TestStorage, User, TestUserSocialAuth, \
... |
stscieisenhamer/stginga | refs/heads/master | stginga/plugin_info.py | 1 | """This module contains functions to handle ``stginga`` plugins.
See :ref:`stginga-run`.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ginga.misc.Bunch import Bunch
__all__ = ['load_plugins', 'show_plugin_install_info']
def load_plugins(ginga)... |
Hwesta/advent-of-code | refs/heads/master | aoc2017/day15.py | 1 | #!/usr/bin/env python
"""
--- Day 15: Dueling Generators ---
Here, you encounter a pair of dueling generators. The generators, called generator A and generator B, are trying to agree on a sequence of numbers. However, one of them is malfunctioning, and so the sequences don't always match.
As they do this, a judge wai... |
Big-B702/python-for-android | refs/heads/master | python-modules/twisted/twisted/mail/smtp.py | 49 | # -*- test-case-name: twisted.mail.test.test_smtp -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Simple Mail Transfer Protocol implementation.
"""
import time, re, base64, types, socket, os, random, rfc822
import binascii
from email.base64MIME import encode as encode_base64
... |
novopl/sphinx-refdoc | refs/heads/develop | test/unit/refdoc/rst/test_section.py | 1 | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
from __future__ import absolute_import, unicode_literals
from refdoc import rst
def test_generates_proper_directive():
assert rst.section('test title') == '\n'.join([
'',
'test title',
'==========',
'',
])
def test_c... |
noba3/KoTos | refs/heads/master | addons/script.module.mutagen/lib/mutagen/oggspeex.py | 16 | # Ogg Speex support.
#
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Read and write Ogg Speex comments.
This module handles Speex files wrapped ... |
UITools/saleor | refs/heads/master | saleor/product/migrations/0053_product_seo_description.py | 1 | # Generated by Django 2.0.2 on 2018-03-11 18:54
import html
from django.core.validators import MaxLengthValidator
from django.db import migrations, models
from saleor.core.utils.text import strip_html_and_truncate
def to_seo_friendly(text):
# saleor descriptions are stored as escaped HTML,
# we need to decod... |
astrobayes/BMAD | refs/heads/master | chapter_6/code_6.25.py | 1 | # From: Bayesian Models for Astrophysical Data, Cambridge Univ. Press
# (c) 2017, Joseph M. Hilbe, Rafael S. de Souza and Emille E. O. Ishida
#
# you are kindly asked to include the complete citation if you used this
# material in a publication
# Code 6.25 - Zero-truncated negative binomial model in Python using S... |
fitoria/lorem-ipsum-generator | refs/heads/master | src/.lorem_ipsum_generator_postinstall.py | 8 | #!C:\Program Files\Python25\python.exe
from os.path import abspath
from sys import prefix
from sys import argv
if len(argv) >= 2 and argv[1] == "-install":
create_shortcut(abspath(prefix + '/pythonw.exe'), 'Generates random lorem ipsum text', abspath(get_special_folder_path('CSIDL_COMMON_PROGRAMS') + '/Lorem ... |
nashve/mythbox | refs/heads/master | resources/lib/twisted/twisted/test/test_explorer.py | 81 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for explorer
"""
from twisted.trial import unittest
from twisted.manhole import explorer
import types, string
"""
# Tests:
Get an ObjectLink. Browse ObjectLink.identifier. Is it the same?
Watch Object. Make su... |
FrankBian/kuma | refs/heads/master | vendor/packages/nose/functional_tests/test_multiprocessing/support/concurrent_shared/__init__.py | 8 | counter=[0]
_multiprocess_shared_ = True
def setup_package():
counter[0] += 1
def teardown_package():
counter[0] -= 1
|
Edu-Glez/Bank_sentiment_analysis | refs/heads/master | env/lib/python3.6/site-packages/pip/_vendor/progress/__init__.py | 916 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.