repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
kontais/EFI-MIPS | ToolKit/cmds/python/Lib/test/skipped/test_mimetypes.py | 15 | 2570 | import mimetypes
import StringIO
import unittest
from sets import Set
from test import test_support
# Tell it we don't know about external files:
mimetypes.knownfiles = []
mimetypes.inited = False
class MimeTypesTestCase(unittest.TestCase):
def setUp(self):
self.db = mimetypes.MimeTypes()
def test_... | bsd-3-clause |
haijieg/SFrame | oss_src/unity/python/sframe/test/test_file_util.py | 6 | 3599 | import os
import unittest
import tempfile
from ..util import file_util as fu
class FileUtilTests(unittest.TestCase):
def setUp(self):
self.local_path = 'tmp/a/b/c'
self.s3_path = 's3://a/b/c'
self.http_path = 'http://a.b.c/d'
self._get_env()
def _get_env(self):
self.run... | bsd-3-clause |
Aegeaner/spark | examples/src/main/python/ml/normalizer_example.py | 123 | 1807 | #
# 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... | apache-2.0 |
m-wichmann/dist_brake | drm.py | 1 | 14505 | #!/usr/bin/env python3
import argparse
import os
import sys
import tempfile
import time
import shutil
import datetime
import json
import threading
import queue
import textwrap
import re
import pathlib
import logging
import drm
from drm.data import HandbrakeConfig, RipConfig, Disc, Fix, Job
import drm.handbrake as han... | mit |
h3biomed/ansible-modules-core | network/dellos6/dellos6_config.py | 44 | 9929 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versi... | gpl-3.0 |
azoft-dev-team/imagrium | env/Lib/json/tests/__init__.py | 145 | 2452 | import os
import sys
import json
import doctest
import unittest
from test import test_support
# import json with and without accelerations
cjson = test_support.import_fresh_module('json', fresh=['_json'])
pyjson = test_support.import_fresh_module('json', blocked=['_json'])
# create two base classes that will be used... | mit |
ivanlyon/exercises | test/test_k_solitaire.py | 1 | 2752 | import io
import unittest
from unittest.mock import patch
from kattis import k_solitaire
###############################################################################
class SampleInput(unittest.TestCase):
'''Problem statement sample inputs and outputs'''
def test_sample_input(self):
'''Run and asse... | mit |
vrk-kpa/ckanext-xroad_integration | ckanext/xroad_integration/tests/xroad_mock/xroad_rest_mock.py | 1 | 1242 | from flask import Flask
import json
from io import open
from datetime import datetime, timedelta
app = Flask(__name__)
def create_app(input_file):
app = Flask(__name__)
mock_data = json.load(open(input_file, 'r', encoding='utf-8'))
@app.route('/getListOfServices/<int:days>')
def getListOfServices(d... | agpl-3.0 |
titimoby/connected | jsserver/node_modules/mosca/node_modules/leveldown/node_modules/prebuild/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 1366 | 120842 | # 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... | mit |
lbybee/kaggle_contests | reverse_gol/simple_reverse_gol.py | 1 | 15661 | from itertools import combinations
import pymc as pm
import numpy as np
import datetime
import csv
# These are helper functions that are called by various functions
# throughout the code
def addBorder(in_array):
"""adds a border of zeros to an array"""
array = np.array(in_array)
shape = array.shape
... | gpl-2.0 |
holmes/intellij-community | plugins/hg4idea/testData/bin/mercurial/scmwindows.py | 94 | 1669 | import os
import osutil
import util
import _winreg
def systemrcpath():
'''return default os-specific hgrc search path'''
rcpath = []
filename = util.executablepath()
# Use mercurial.ini found in directory with hg.exe
progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')
if os.path.i... | apache-2.0 |
CydarLtd/ansible | lib/ansible/modules/network/bigswitch/bigmon_policy.py | 51 | 6930 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to manage Big Monitoring Fabric service chains
# (c) 2016, Ted Elhourani <ted@bigswitch.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 publishe... | gpl-3.0 |
SUSE/lrbd | test/test_acls.py | 2 | 4227 |
from lrbd import Acls, Common, Runtime, entries
from nose.tools import *
import unittest, mock
import re, tempfile
class AclsTestCase(unittest.TestCase):
def setUp(self):
Common.config['iqns'] = [ "iqn.xyz" ]
Common.config['auth'] = [ { "host": "igw1", "authentication": "acls" } ]
Common... | lgpl-2.1 |
Eric-Zhong/odoo | addons/lunch/report/report_lunch_order.py | 341 | 2771 | # -*- 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... | agpl-3.0 |
rombie/contrail-controller | src/config/api-server/vnc_cfg_api_server/tests/test_import_server.py | 1 | 6338 | #
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of job api handler code
"""
import gevent
from enum import Enum
from vnc_api.vnc_api import VncApi
import sys
import time
import base64
class ImportServerStatus(Enum):
INIT = 0
IN_PROGRESS = 1
COMPLE... | apache-2.0 |
soldag/home-assistant | homeassistant/components/insteon/light.py | 7 | 1984 | """Support for Insteon lights via PowerLinc Modem."""
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
DOMAIN as LIGHT_DOMAIN,
SUPPORT_BRIGHTNESS,
LightEntity,
)
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import SIGNAL_ADD_ENTITIES
from .insteon_enti... | apache-2.0 |
jgodwinWX/gefs-plots | htmlbuilder.py | 1 | 8544 | #!/usr/bin/env python
''' Creates GEFS plots for a single location. Plots include high temperature, low temperature,
dewpoint, and precipitation. Program reads in CSV file created by ensemblemeans.py. Will
eventually create some HTML tables.
'''
import calendar
import datetime
import matplotlib
matplotlib.use(... | gpl-3.0 |
zenoss/Community-Zenpacks | ZenPacks.Nova.UCDFileSystemMap/ZenPacks/Nova/UCDFileSystemMap/modeler/plugins/zenoss/snmp/UCDFileSystemMap.py | 3 | 3083 | ###########################################################################
#
# This program is part of Zenoss Core, an open source monitoring platform.
# Copyright (C) 2007, 2009 Zenoss Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License ... | gpl-2.0 |
daniula/python-social-auth | social/backends/mineid.py | 72 | 1257 | from social.backends.oauth import BaseOAuth2
class MineIDOAuth2(BaseOAuth2):
"""MineID OAuth2 authentication backend"""
name = 'mineid'
_AUTHORIZATION_URL = '%(scheme)s://%(host)s/oauth/authorize'
_ACCESS_TOKEN_URL = '%(scheme)s://%(host)s/oauth/access_token'
ACCESS_TOKEN_METHOD = 'POST'
SCOPE... | bsd-3-clause |
lorin/umdinst | test/testcaptureprofilereporter.py | 1 | 2301 | import unittest
import sys
import os
import errno
import commands
from xml.dom import minidom
from umdinst.setup import which
sys.path.append('bin')
from umdinst import wrap
from testsuccessfulcompiledata import getfield, timezonecheck, xmlifystring
from testcapturecompile import programcheck
### Not yet in use
clas... | bsd-3-clause |
redhat-openstack/rally | tests/unit/plugins/openstack/context/quotas/test_quotas.py | 13 | 12292 | # Copyright 2014: Dassault Systemes
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 |
google/containerregistry | client/v2_2/append_.py | 1 | 3602 | # Copyright 2017 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 ag... | apache-2.0 |
CPonty/PyPlant | editor.py | 1 | 10432 | """
PyPlant 1.0
GUI: Seed File Editor
Copyright(c) 2010 Chris Ponticello
s4234549@student.uq.edu.au
DESCRIPTION:
A small GUI application used for creating and editing seed properties.
The 21 parameters are changed through command-line input, buttons and sliders.
Seed files can be created and edited for later use by t... | gpl-2.0 |
jessrosenfield/pants | tests/python/pants_test/tasks/test_reflect.py | 15 | 1459 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.c... | apache-2.0 |
hubert667/AIR | src/python/comparison/AbstractInterleavedComparison.py | 2 | 1088 | # This file is part of Lerot.
#
# Lerot 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 later version.
#
# Lerot is distributed in the hope tha... | gpl-3.0 |
BjoernT/python-openstackclient | openstackclient/volume/client.py | 2 | 2471 | # Copyright 2012-2013 OpenStack, 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 ... | apache-2.0 |
vighneshbirodkar/scikit-image | skimage/filters/thresholding.py | 1 | 24806 | import math
import numpy as np
from scipy import ndimage as ndi
from scipy.ndimage import filters as ndif
from collections import OrderedDict
from ..exposure import histogram
from .._shared.utils import assert_nD, warn
__all__ = ['try_all_threshold',
'threshold_adaptive',
'threshold_otsu',
... | bsd-3-clause |
gsec/eZchat | ez_process/ez_process_base.py | 1 | 5024 | #==============================================================================#
# ez_process_base.py #
#==============================================================================#
#============#
# Includes #
#============#
import os
import types
import ... | gpl-2.0 |
kapadia/rasterio | rasterio/features.py | 2 | 11130 | """Functions for working with features in a raster dataset."""
from __future__ import absolute_import
import logging
import warnings
import numpy as np
import rasterio
from rasterio._features import _shapes, _sieve, _rasterize, _bounds
from rasterio.env import ensure_env
from rasterio.transform import IDENTITY, gua... | bsd-3-clause |
Tatsh-ansible/ansible | lib/ansible/plugins/action/ce.py | 25 | 4673 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
petemounce/ansible-modules-extras | notification/osx_say.py | 161 | 2108 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Michael DeHaan <michael@ansible.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 ... | gpl-3.0 |
samedder/azure-cli | src/command_modules/azure-cli-appservice/azure/cli/command_modules/appservice/custom.py | 1 | 65556 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
pjryan126/solid-start-careers | store/api/glassdoor/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | gpl-2.0 |
yoki/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/obsoletepatches.py | 125 | 2318 | # Copyright (C) 2010 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 th... | bsd-3-clause |
Yawning/obfsproxy-wfpadtools | obfsproxy/transports/scramblesuit/fifobuf.py | 17 | 3237 | """
Provides an interface for a fast FIFO buffer.
The interface implements only 'read()', 'write()' and 'len()'. The
implementation below is a modified version of the code originally written by
Ben Timby: http://ben.timby.com/?p=139
"""
try:
from cStringIO import StringIO
except ImportError:
from StringIO im... | bsd-3-clause |
sachintaware/sublime-wakatime | packages/wakatime/packages/pygments_py2/pygments/formatters/svg.py | 76 | 5840 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | bsd-3-clause |
impowski/servo | components/script/dom/bindings/codegen/parser/tests/test_typedef.py | 154 | 1880 | def WebIDLTest(parser, harness):
parser.parse("""
typedef long mylong;
typedef long? mynullablelong;
interface Foo {
const mylong X = 5;
const mynullablelong Y = 7;
const mynullablelong Z = null;
void foo(mylong arg);
};
""")
results = parser.finish()... | mpl-2.0 |
jroyal/plexpy | plexpy/config.py | 1 | 13229 | import plexpy.logger
import itertools
import os
import re
from configobj import ConfigObj
def bool_int(value):
"""
Casts a config value into a 0 or 1
"""
if isinstance(value, basestring):
if value.lower() in ('', '0', 'false', 'f', 'no', 'n', 'off'):
value = 0
return int(bool(v... | gpl-3.0 |
whodunnit/AK-OnePlusOne-CM | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # 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,... | gpl-2.0 |
idjaw/horizon | openstack_dashboard/dashboards/project/networks/urls.py | 65 | 1987 | # Copyright 2012 NEC Corporation
#
# 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 ag... | apache-2.0 |
uber/pyodbc | tests2/freetdstests.py | 22 | 46182 | #!/usr/bin/python
# -*- coding: latin-1 -*-
usage = """\
usage: %prog [options] connection_string
Unit tests for FreeTDS / SQL Server. To use, pass a connection string as the parameter.
The tests will create and drop tables t1 and t2 as necessary.
These run using the version from the 'build' directory, not the vers... | mit |
electric-cloud/EC-WebSphere | src/main/resources/project/wsadmin_scripts/check_app.py | 1 | 1733 | #
# Copyright 2016 Electric Cloud, 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 agree... | apache-2.0 |
YangChihWei/w16b_test | static/Brython3.1.1-20150328-091302/Lib/external_import.py | 742 | 2985 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
self._module=... | agpl-3.0 |
olivierdalang/stdm | third_party/reportlab/graphics/charts/lineplots.py | 1 | 47988 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/lineplots.py
__version__=''' $Id$ '''
__doc__="""This module defines a very preliminary Line Plot example."""
import string, t... | gpl-2.0 |
zploskey/servo | tests/wpt/update/tree.py | 167 | 6560 | # 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 re
import tempfile
from wptrunner import update as wptupdate
from wptrunner.update.tree import Commit, CommitMe... | mpl-2.0 |
opencontrail-ci-admin/git-repo | subcmds/info.py | 46 | 6021 | #
# Copyright (C) 2012 The Android Open Source Project
#
# 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 la... | apache-2.0 |
benvermaercke/pyqtgraph | pyqtgraph/flowchart/library/Filters.py | 24 | 13203 | # -*- coding: utf-8 -*-
import numpy as np
from ...Qt import QtCore, QtGui
from ..Node import Node
from . import functions
from ... import functions as pgfn
from .common import *
from ...python2_3 import xrange
from ... import PolyLineROI
from ... import Point
from ... import metaarray as metaarray
class Downsample(C... | mit |
realzzt/BitCoin2013 | qa/rpc-tests/nulldummy.py | 1 | 6747 | #!/usr/bin/env python3
# Copyright (c) 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.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
fro... | mit |
asm-products/unsquat-it | lib/postsdb.py | 1 | 16012 | import pymongo
from bson.objectid import ObjectId
import re
import settings
import json
from lib import sanitize
from datetime import datetime
from datetime import date
from datetime import timedelta
from mongoengine import *
from lib.userdb import User
from lib.custom_fields import ImprovedStringField, ImprovedURLFiel... | gpl-3.0 |
openstack/taskflow | taskflow/tests/test_examples.py | 3 | 4946 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! 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... | apache-2.0 |
atuljain/odoo | addons/l10n_be_coda/wizard/__init__.py | 439 | 1098 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
msracver/Deformable-ConvNets | faster_rcnn/function/train_rpn.py | 2 | 5938 | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Yuwen Xiong
# --------------------------------------------------------
# Based on:
# MX-RCNN
# Copyright (c) 2016 by Cont... | mit |
yfu/tools | select-longest-isoforms.py | 1 | 1051 | #!/usr/bin python
# Select the longest isoform for each gene
# Accepts a bed file as input
# Example: gtfToGenePred ~/data/piPipes/common/dm3/dm3.genes.gtf stdout -genePredExt | awk '{ $1=$12; print }' | genePredToBed stdin stdout | python run3-select-longest-isoforms.py | sort -k1,1 -k2,2n > longest_isoform_per_gene.... | gpl-3.0 |
codervince/flashingredlight | env/lib/python2.7/site-packages/bson/__init__.py | 12 | 21524 | # Copyright 2009-2012 10gen, 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 writing,... | mit |
Vagab0nd/SiCKRAGE | lib3/twilio/rest/sync/v1/service/sync_map/sync_map_item.py | 1 | 20699 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | gpl-3.0 |
sserrot/champion_relationships | venv/Lib/site-packages/win32com/demos/excelRTDServer.py | 6 | 15526 | """Excel IRTDServer implementation.
This module is a functional example of how to implement the IRTDServer interface
in python, using the pywin32 extensions. Further details, about this interface
and it can be found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexcl2k2/html/odc_xlrtdfaq.a... | mit |
lele1122/pelican-plugins | html_entity/html_entity.py | 76 | 1310 | """
HTML Entities for reStructured Text
===================================
Allows user to use HTML entities (©, •, etc.) in RST documents.
Usage:
:html_entity:`copy`
:html_entity:`149`
:html_entity:`#149`
"""
from __future__ import unicode_literals
from docutils import nodes, utils
from docutils.parsers.rs... | agpl-3.0 |
leereilly/django-1 | tests/regressiontests/model_forms_regress/tests.py | 6 | 20105 | from __future__ import absolute_import
from datetime import date
from django import forms
from django.core.exceptions import FieldError, ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms.models import (modelform_factory, ModelChoiceField,
fields_for_model, construct_i... | bsd-3-clause |
kfox1111/horizon | horizon/templatetags/branding.py | 88 | 2028 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
CLOUGH/info3180-lab5 | main/lib/flask/helpers.py | 776 | 33793 | # -*- coding: utf-8 -*-
"""
flask.helpers
~~~~~~~~~~~~~
Implements various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pkgutil
import posixpath
import mimetypes
from time import time
from zlib import adler32
from th... | mit |
OptiPop/external_chromium_org | tools/perf/page_sets/intl_ko_th_vi.py | 34 | 1829 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class IntlKoThViPage(page_module.Page):
def __init_... | bsd-3-clause |
stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/integration/states/rabbitmq_vhost.py | 2 | 1363 | # -*- coding: utf-8 -*-
'''
Tests for the rabbitmq state
'''
# Import python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class RabbitVHostTestCase(integration.Mod... | apache-2.0 |
indico/indico | indico/cli/watchman.py | 3 | 5829 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import atexit
import os
import subprocess
import sys
import time
import pywatchman
from flask.helpers imp... | mit |
yb-kim/gemV | tests/configs/realview-o3-dual.py | 10 | 2340 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
Shaswat27/sympy | sympy/core/trace.py | 82 | 6108 | from __future__ import print_function, division
from sympy import Expr, Add, Mul, Pow, sympify, Matrix, Tuple
from sympy.core.compatibility import range
from sympy.utilities import default_sort_key
def _is_scalar(e):
""" Helper method used in Tr"""
# sympify to set proper attributes
e = sympify(e)
i... | bsd-3-clause |
JamesMura/elections | apollo/submissions/__init__.py | 1 | 6906 | from ..core import Service
from .models import Submission, SubmissionComment, SubmissionVersion
from ..locations.models import LocationType
from datetime import datetime
from flask import g
from unidecode import unidecode
import csv
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
cla... | gpl-3.0 |
WafaaT/spark-tk | python/sparktk/frame/constructors/import_csv_raw.py | 12 | 4415 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
macchina-io/macchina.io | platform/JS/V8/v8/tools/turbolizer-perf.py | 12 | 1590 | # Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import json
import re
import argparse
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Tr... | apache-2.0 |
gezb/osmc | package/mediacenter-addon-osmc/src/script.module.elementtree/lib/selftest.py | 22 | 28466 | # $Id: selftest.py 3224 2007-08-27 21:23:39Z fredrik $
# -*- coding: iso-8859-1 -*-
# elementtree selftest program
# this test script uses Python's "doctest" module to check that the
# *test script* works as expected.
# TODO: add more elementtree method tests
# TODO: add xml/html parsing tests
# TODO: etc
import sys... | gpl-2.0 |
nemesiscodex/JukyOS-sugar | extensions/cpsection/datetime/model.py | 1 | 2814 | # Copyright (C) 2007, 2008 One Laptop Per Child
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is di... | gpl-2.0 |
ykaneko/quantum | quantum/plugins/linuxbridge/db/l2network_db_v2.py | 3 | 10016 | # Copyright (c) 2012 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 or agreed to... | apache-2.0 |
malikcjm/qtcreator | tests/system/shared/qtcreator.py | 3 | 11814 | #############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... | lgpl-2.1 |
gavinshaw/py_learning | scrapy-online/spiders/deep_spider.py | 1 | 9155 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.selector import Selector
from scrapy import settings
from scrapy.exceptions import CloseSpider
import os
import re
import chardet
import requests
import logging
import datetime
... | mit |
ido-ran/ran-smart-frame2 | web/server/lib/pyasn1_modules/rfc3281.py | 3 | 9866 | # coding: utf-8
#
# This file is part of pyasn1-modules software.
#
# Created by Stanisław Pitucha with asn1ate tool.
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# An Internet Attribute Certificate Profile for Authorization
#
# ASN.1 source from:
# ht... | mit |
ccalleu/halo-halo | CSipSimple/jni/pjsip/sources/pjsip-apps/src/python/samples/registration.py | 60 | 2047 | # $Id: registration.py 2171 2008-07-24 09:01:33Z bennylp $
#
# SIP account and registration sample. In this sample, the program
# will block to wait until registration is complete
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# This program is free software; you can redistribute it and/or modify
# it ... | gpl-3.0 |
chuan9/chromium-crosswalk | native_client_sdk/src/build_tools/tests/build_artifacts_test.py | 12 | 11804 | #!/usr/bin/env python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import ntpath
import posixpath
import sys
import collections
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspat... | bsd-3-clause |
ianberinger/mailinabox | management/web_update.py | 7 | 9141 | # Creates an nginx configuration file so we serve HTTP/HTTPS on all
# domains for which a mail account has been set up.
########################################################################
import os.path, re, rtyaml
from mailconfig import get_mail_domains
from dns_update import get_custom_dns_config, get_dns_zone... | cc0-1.0 |
fooying/Mobile-Security-Framework-MobSF | DynamicAnalyzer/tools/pyWebProxy/gen_cert.py | 37 | 4662 | #!/usr/bin/env python
'''
owtf is an OWASP+PTES-focused try to unite great tools & facilitate pentesting
Copyright (c) 2013, Abraham Aranguren <name.surname@gmail.com> http://7-a.org
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the f... | gpl-3.0 |
freeitaly/Trading-System | vn.demo/ctpdemo/mdtest.py | 96 | 5287 | # encoding: UTF-8
import sys
from time import sleep
from PyQt4 import QtGui
from vnctpmd import *
#----------------------------------------------------------------------
def print_dict(d):
"""按照键值打印一个字典"""
for key,value in d.items():
print key + ':' + str(value)
#-----------------... | mit |
aps-sids/zulip | api/integrations/codebase/zulip_codebase_config.py | 124 | 2537 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, Inc.
#
# 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
#... | apache-2.0 |
TridevGuha/django | tests/urlpatterns_reverse/views.py | 218 | 1538 | from functools import partial, update_wrapper
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponse
from django.views.generic import RedirectView
def empty_view(request, *args, **kwargs):
return HttpResponse('')
def kw... | bsd-3-clause |
Jeff-Tian/mybnb | Python27/Lib/lib2to3/tests/pytree_idempotency.py | 14 | 2477 | #!/usr/bin/env python
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Main program for testing the infrastructure."""
__author__ = "Guido van Rossum <guido@python.org>"
# Support imports (need to be imported first)
from . import support
# Python impo... | apache-2.0 |
OpenNetworkingFoundation/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_connectivity_protection_role.py | 4 | 1213 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server import util
class TapiConnectivityProtectionRole(Model):
"""NOTE: This class is auto generated b... | apache-2.0 |
skirsdeda/djangocms-blog | djangocms_blog/models.py | 1 | 23353 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import hashlib
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_apphooks_config.managers.parler import AppHookConfigTranslatableManager
from cms.models import CMSPlugin, PlaceholderField
from djang... | bsd-3-clause |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/ToolTip.py | 149 | 2736 | # general purpose 'tooltip' routines - currently unused in idlefork
# (although the 'calltips' extension is partly based on this code)
# may be useful for some purposes in (or almost in ;) the current project scope
# Ideas gleaned from PySol
from Tkinter import *
class ToolTipBase:
def __init__(self, button):
... | gpl-2.0 |
Epirex/android_external_chromium_org | build/android/pylib/instrumentation/test_jar.py | 27 | 8479 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper class for instrumenation test jar."""
import collections
import logging
import os
import pickle
import re
from pylib import cmd_helper
from p... | bsd-3-clause |
ahmed-mahran/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/admin/validation.py | 108 | 23236 | from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.forms.models import BaseModelForm, BaseModelFormSet, _get_foreign_key
from django.contrib.admin.util import get_fields_from_path, NotRelationField
"""
Does basic ModelA... | apache-2.0 |
mja054/swift_plugin | test/unit/obj/test_auditor.py | 5 | 14845 | # Copyright (c) 2010-2011 OpenStack, 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 to ... | apache-2.0 |
isovic/samscripts | src/vcffilter.py | 1 | 8768 | #! /usr/bin/env python
import re;
import os;
import sys;
def extract_region(vcf_file, chrname, start_pos, end_pos):
fp_in = None;
try:
fp_in = open(vcf_file, 'r');
except IOError:
sys.stderr.write('[%s] ERROR: Could not open file "%s" for reading!' % (__name__, vcf_file));
exit(1);
num_accepted = 0;
nu... | mit |
google/openhtf | openhtf/util/units.py | 1 | 253414 | # coding: utf-8
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
# Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache... | apache-2.0 |
PythonSanSebastian/docstamp | docstamp/file_utils.py | 1 | 5624 | # coding=utf-8
# -------------------------------------------------------------------------------
# Author: Alexandre Manhaes Savio <alexsavio@gmail.com>
# Grupo de Inteligencia Computational <www.ehu.es/ccwintco>
# Universidad del Pais Vasco UPV/EHU
#
# 2015, Alexandre Manhaes Savio
# Use this at your own risk!
# -----... | apache-2.0 |
nirs/vdsm | tests/storage/glustervolume_test.py | 2 | 6517 | #
# Copyright 2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | gpl-2.0 |
raccoongang/edx-platform | common/djangoapps/microsite_configuration/tests/backends/test_database.py | 6 | 8266 | """
Test Microsite database backends.
"""
import logging
from mock import patch
from django.conf import settings
from microsite_configuration.backends.base import (
BaseMicrositeBackend,
BaseMicrositeTemplateBackend,
)
from microsite_configuration import microsite
from microsite_configuration.models import (
... | agpl-3.0 |
rbramwell/runbook | src/web/reactionforms/heroku-scale-out/__init__.py | 3 | 1399 | ######################################################################
# Cloud Routes Web Application
# -------------------------------------------------------------------
# Reaction - Forms Class
######################################################################
from wtforms import Form
from wtforms import TextFi... | agpl-3.0 |
chienlieu2017/it_management | project/it_management/__manifest__.py | 1 | 1817 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2009-2017 4Leaf Team
#
##############################################################################
{
'name': 'IT Management Module',
'version': '1.0',
'category': 'IT',
'description... | gpl-3.0 |
sjperkins/tensorflow | tensorflow/contrib/legacy_seq2seq/python/kernel_tests/seq2seq_test.py | 76 | 42915 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
SalesforceEng/LinuxTelemetry | plugins/buddyinfo.py | 1 | 8671 | #!/usr/bin/python
##########################################################################
# Copyright (c) 2015, Salesforce.com, Inc.
# All rights reserved.
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# Redistributions in binary... | bsd-3-clause |
pomegranited/edx-platform | openedx/core/djangoapps/user_api/accounts/api.py | 30 | 19144 | """
Programmatic integration point for User API Accounts sub-application
"""
from django.utils.translation import ugettext as _
from django.db import transaction, IntegrityError
import datetime
from pytz import UTC
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.v... | agpl-3.0 |
DimensionDataCBUSydney/libcloud | libcloud/test/storage/test_s3.py | 10 | 39819 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
tensorflow/tensorflow | tensorflow/python/saved_model/method_name_updater_test.py | 18 | 10472 | # Copyright 2020 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.