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 |
|---|---|---|---|---|---|
mdublin/Brightcove-Dynamic-Ingest-App | ENV/lib/python2.7/site-packages/sqlalchemy/log.py | 14 | 6796 | # sqlalchemy/log.py
# Copyright (C) 2006-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
# Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logging control and... | mit |
munkiat/libcloud | libcloud/test/common/test_cloudstack.py | 45 | 7303 | # 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 |
pgodd/KOS | doc/ksdomain.py | 11 | 8805 | # -*- coding: utf-8 -*-
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.roles import XRefRole
from sphinx.locale import l_, _
from sphinx.domains import Domain, ObjType, Index
from sphinx.directives import ObjectDescription
from sphinx.util.nod... | gpl-3.0 |
teonlamont/mne-python | mne/io/tests/test_raw.py | 2 | 6009 | # Generic tests that all raw classes should run
from os import path as op
import math
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_array_almost_equal,
assert_equal, assert_array_equal)
from mne import concatenate_raws, create_info
from mne.datasets imp... | bsd-3-clause |
palmhold/djinn | djinn/errors.py | 2 | 3285 | # -*- coding: utf-8 -*-
#
# Copyright(c) 2014 palmhold.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... | apache-2.0 |
apdavison/python-neo | neo/test/iotest/test_nsdfio.py | 3 | 8778 | """
Tests of neo.io.NSDFIO
"""
import numpy as np
import quantities as pq
from datetime import datetime
import os
import unittest
from neo.io.nsdfio import HAVE_NSDF, NSDFIO
from neo.test.iotest.common_io_test import BaseTestIO
from neo.core import AnalogSignal, Segment, Block, ChannelIndex
from neo.test.tools impor... | bsd-3-clause |
mrquim/mrquimrepo | plugin.video.playlistLoader/resources/lib/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## 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... | gpl-2.0 |
bunjiboys/security_monkey | security_monkey/watchers/keypair.py | 1 | 4346 | # Copyright 2014 Netflix, 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... | apache-2.0 |
ZhangXinNan/tensorflow | tensorflow/python/training/slot_creator_test.py | 45 | 5256 | # 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 |
zmike/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/benchmark_helper_wsh.py | 451 | 3234 | # Copyright 2013, 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... | mpl-2.0 |
takeshineshiro/nova | nova/db/sqlalchemy/migrate_repo/versions/250_remove_instance_groups_metadata.py | 81 | 1198 | # Copyright 2014 Red Hat, 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 ... | apache-2.0 |
ludwig-n/fchess | old_code.py | 1 | 21297 | # def comet(mvs, pcs, recdepth, maxrecdepth):
# options = []
# curxp = xp_diff(mvs[0][0].color, pcs)
# intro = '// ' + ('-' * (recdepth * 2)) + ' COMET: '
# if DEBUG_OUTPUT:
# print(intro + '{} opts'.format(len(mvs)))
# else:
# print(' ' * recdepth + '*')
# if len(mvs) ==... | gpl-3.0 |
HybridF5/jacket | jacket/compute/block_device.py | 1 | 21039 | # Copyright 2011 Isaku Yamahata <yamahata@valinux co jp>
# 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... | apache-2.0 |
shenlong3030/asv-django-guestbook | django/contrib/gis/utils/geoip.py | 13 | 15172 | """
This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R)
C API (http://www.maxmind.com/app/c). This is an alternative to the GPL
licensed Python GeoIP interface provided by MaxMind.
GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts.
For IP-based geoloca... | bsd-3-clause |
yanheven/keystone | keystone/i18n.py | 22 | 1156 | # Copyright 2014 IBM Corp.
#
# 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, s... | apache-2.0 |
Smarsh/django | django/core/files/move.py | 403 | 2931 | """
Move a file in the safest way possible::
>>> from django.core.files.move import file_move_safe
>>> file_move_safe("/tmp/old_file", "/tmp/new_file")
"""
import os
from django.core.files import locks
try:
from shutil import copystat
except ImportError:
import stat
def copystat(src, dst):
... | bsd-3-clause |
sauloal/PiCastPy | sqlalchemy/engine/__init__.py | 14 | 15527 | # engine/__init__.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL connections, SQL execution and high-level DB-API interface.
The engine pack... | mit |
amboxer21/scrapy | scrapy/utils/signal.py | 18 | 2931 | """Helper functions for working with signals"""
import logging
from twisted.internet.defer import maybeDeferred, DeferredList, Deferred
from twisted.python.failure import Failure
from scrapy.xlib.pydispatch.dispatcher import Any, Anonymous, liveReceivers, \
getAllReceivers, disconnect
from scrapy.xlib.pydispatch... | bsd-3-clause |
OndinaHQ/Tracker | cherrypy/process/win32.py | 93 | 5870 | """Windows service. Requires pywin32."""
import os
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like Ctrl-C)."""
... | gpl-3.0 |
rghe/ansible | lib/ansible/modules/cloud/vmware/vmware_vm_facts.py | 31 | 6619 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, 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
... | gpl-3.0 |
AltSchool/django | tests/template_tests/filter_tests/test_addslashes.py | 473 | 1202 | from django.template.defaultfilters import addslashes
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class AddslashesTests(SimpleTestCase):
@setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'})
... | bsd-3-clause |
crafty78/ansible | lib/ansible/plugins/action/service.py | 16 | 3306 | # (c) 2015, Ansible 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 di... | gpl-3.0 |
thinkopensolutions/tkobr-addons | unported/tko_partner_configuration_menus/__openerp__.py | 2 | 1853 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | agpl-3.0 |
stonek4/iperfparser | parseperf.py | 1 | 1894 | import argparse
import json
from pprint import pprint
def convertToM(number, btype):
if (btype == 'KBytes' or btype == 'Kbits/sec'):
return number/1000
elif (btype == 'Bytes' or btype == 'Bits/sec'):
return number/1000000
else:
return number
def parseIPerf(file_name, json_data):
... | mit |
mobilecosystem/walisph-bootstrap | test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | mit |
Tejeshwarabm/Westwood | examples/wireless/wifi-ap.py | 57 | 5871 | # -*- Mode: Python; -*-
# /*
# * Copyright (c) 2005,2006,2007 INRIA
# * Copyright (c) 2009 INESC Porto
# *
# * 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;
# *
# * This p... | gpl-2.0 |
jeremycline/pulp | server/test/unit/server/db/model/test_repository.py | 14 | 2436 | import unittest
import mock
from pulp.server.db.model.repository import RepoContentUnit
REPOSITORY = 'pulp.server.db.model.repository'
class TestRepoContentUnit(unittest.TestCase):
def setUp(self):
self.unit = RepoContentUnit('repo1', 'unit1', 'rpm')
def test_utc_in_iso8601(self):
# make ... | gpl-2.0 |
tboyce021/home-assistant | tests/components/atag/__init__.py | 9 | 2495 | """Tests for the Atag integration."""
from homeassistant.components.atag import DOMAIN
from homeassistant.const import CONF_EMAIL, CONF_HOST, CONF_PORT, CONTENT_TYPE_JSON
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
from tests.test_util.aiohttp import AiohttpClientMocker
USER... | apache-2.0 |
ikmaak/Printrun | printrun/injectgcode.py | 25 | 1922 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | gpl-3.0 |
eugene1g/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/zipfileset_mock.py | 167 | 2166 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
alexander-ae/sistema-de-cotizacion | quoman/quotes/pdf.py | 1 | 9706 | import os
from io import BytesIO
from django.utils import timezone
from django.template.loader import get_template
from django.template import Context
from django.core.mail import EmailMessage
from django.conf import settings
from reportlab.pdfgen import canvas
from reportlab.platypus import Table
from reportlab.lib.p... | gpl-3.0 |
stdweird/aquilon | lib/python2.6/aquilon/worker/commands/make_aquilon.py | 2 | 1052 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013 Contributor
#
# 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 t... | apache-2.0 |
seawaywen/vim-config | bundle/python-mode/pymode/libs2/rope/contrib/fixsyntax.py | 17 | 6737 | import rope.base.codeanalyze
import rope.base.evaluate
from rope.base import worder, exceptions, utils
from rope.base.codeanalyze import ArrayLinesAdapter, LogicalLineFinder
class FixSyntax(object):
def __init__(self, pycore, code, resource, maxfixes=1):
self.pycore = pycore
self.code = code
... | apache-2.0 |
AutorestCI/azure-sdk-for-python | azure-mgmt-sql/azure/mgmt/sql/models/metric_value.py | 2 | 2022 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Xarthisius/girder | plugins/mongo_search/plugin_tests/search_test.py | 2 | 6228 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a cop... | apache-2.0 |
mortada/tensorflow | tensorflow/contrib/keras/python/keras/datasets/reuters.py | 15 | 4442 | # 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 |
wido/cloudstack | test/integration/component/test_network_offering.py | 6 | 67587 | # 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... | apache-2.0 |
figment/falloutsnip | Vendor/IronPython/Lib/xml/dom/pulldom.py | 322 | 11974 | import xml.sax
import xml.sax.handler
import types
try:
_StringTypes = [types.StringType, types.UnicodeType]
except AttributeError:
_StringTypes = [types.StringType]
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
... | gpl-3.0 |
simbha/mAngE-Gin | lib/Django 1.7/django/contrib/auth/context_processors.py | 514 | 1938 | # PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, app_label):
self.user, self.app_label = user, app_label
def __repr__(self):
return str(self.user.get_all_permissions())
... | mit |
ikropotov/kops | vendor/k8s.io/kubernetes/hack/update_owners.py | 40 | 7464 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/Nexus/Nodes.py | 1 | 5759 | # Copyright 2005-2008 by Frank Kauff & Cymon J. Cox. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
# Nodes.py
#
# Provides functionality of a linked list.
# Each node has one ... | gpl-2.0 |
tinchoss/Python_Android | python/src/Lib/test/test_unittest.py | 51 | 85098 | """Test script for unittest.
By Collin Winter <collinw at gmail.com>
Still need testing:
TestCase.{assert,fail}* methods (some are tested implicitly)
"""
from test import test_support
import unittest
from unittest import TestCase
import types
### Support code
####################################################... | apache-2.0 |
kcpawan/django | django/contrib/admin/views/main.py | 327 | 16684 | import sys
from collections import OrderedDict
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters,
)
from djang... | bsd-3-clause |
yast/yast-python-bindings | examples/CheckBox3.py | 1 | 1854 | # encoding: utf-8
from yast import import_module
import_module('UI')
from yast import *
class CheckBox3Client:
def main(self):
# Build dialog with one check box and buttons to set its state to
# on, off or "don't care" (tri-state).
UI.OpenDialog(
VBox(
CheckBox(Id("cb"), "Forma... | gpl-2.0 |
rcharp/toyota-flask | flask/debughelpers.py | 777 | 3508 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string
class UnexpectedUnicodeError(AssertionEr... | apache-2.0 |
lichuan261/wuand | XX-Net/python27/1.0/lib/dis.py | 270 | 6499 | """Disassembler of Python byte code into mnemonics."""
import sys
import types
from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["dis", "disassemble", "distb", "disco",
"findlinestarts", "findlabels"] + _opcodes_all
del _opcodes_all
_have_code = (types.MethodType, types.FunctionT... | gpl-2.0 |
michaelhkw/incubator-impala | tests/performance/query_executor.py | 1 | 7409 | # 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... | apache-2.0 |
alangwansui/mtl_ordercenter | openerp/addons/report_intrastat/report_intrastat.py | 52 | 5691 | # -*- 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 |
vadimtk/chrome4sdp | styleguide/c++/chromium-cpp/main.py | 90 | 1649 | #!/usr/bin/env python
#
# 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 google.appengine.api import memcache
from google.appengine.api import urlfetch
import webapp2
import base64
"""A simple appengi... | bsd-3-clause |
uclouvain/osis | education_group/ddd/service/read/get_mini_training_service.py | 1 | 1686 | # ############################################################################
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business i... | agpl-3.0 |
fernandog/Sick-Beard | lib/unidecode/x052.py | 253 | 4654 | data = (
'Dao ', # 0x00
'Diao ', # 0x01
'Dao ', # 0x02
'Ren ', # 0x03
'Ren ', # 0x04
'Chuang ', # 0x05
'Fen ', # 0x06
'Qie ', # 0x07
'Yi ', # 0x08
'Ji ', # 0x09
'Kan ', # 0x0a
'Qian ', # 0x0b
'Cun ', # 0x0c
'Chu ', # 0x0d
'Wen ', # 0x0e
'Ji ', # 0x0f
'Dan ', # 0x10
'Xi... | gpl-3.0 |
foss-transportationmodeling/rettina-server | .env/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/tests/test_resources.py | 62 | 24677 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove
from unittest import TestCase, makeSuite; from pkg_resources import *
from setuptools.command.easy_install import get_script_header, is_sh
import os, pkg_resources, sys, StringIO, tempfile, shutil
t... | apache-2.0 |
kiyoto/statsmodels | statsmodels/tsa/vector_ar/tests/test_svar.py | 28 | 2034 | """
Test SVAR estimation
"""
import statsmodels.api as sm
from statsmodels.tsa.vector_ar.svar_model import SVAR
from numpy.testing import assert_almost_equal, assert_equal, assert_allclose
from .results import results_svar
import numpy as np
import numpy.testing as npt
DECIMAL_6 = 6
DECIMAL_5 = 5
DECIMAL_4 = 4
class... | bsd-3-clause |
davipeterlini/routeflow_ha | pox/pox/lib/threadpool.py | 26 | 2952 | # Copyright 2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... | apache-2.0 |
sosey/ginga | ginga/mockw/ImageViewCanvasTypesMock.py | 1 | 2800 | #
# ImageViewCanvasTypesMock.py -- drawing classes for ImageViewCanvas widget
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
# TODO: this line is for backward compati... | bsd-3-clause |
glovebx/odoo | addons/website_sale/models/product.py | 262 | 10108 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
jkoelker/quark | quark/api/extensions/subnets_quark.py | 2 | 1724 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 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-2.0 |
billwanjohi/ansible | lib/ansible/runner/connection_plugins/paramiko_ssh.py | 13 | 13550 | # (c) 2012, 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) any lat... | gpl-3.0 |
kiyukuta/chainer | chainer/function.py | 2 | 25375 | import collections
import traceback
import weakref
import six
import chainer
from chainer import configuration
from chainer import cuda
from chainer.utils import type_check
from chainer import variable
def no_backprop_mode():
"""Make a context manager which disables back-propagation.
In this context, Chain... | mit |
spaceone/pyjs | examples/libtest/ClassTest.py | 6 | 50377 | import sys
from UnitTest import UnitTest, IN_BROWSER
# syntax check
# import a, b, c
if True:
import imports.circ1
from imports import exec_order, imports as IMPORTS
from imports import exec_order as EXEC_ORDER
import I18N
from imports.classes import WithAttribute
import imports.decors # must be in this form
gl... | apache-2.0 |
D4rk4/Neural-Network-Trading-Bot | pyTrader/trading_floor.py | 1 | 4891 | import sys, time
from file_check import *
check_data_files()
from print_trade_info import set_low_balance_msg, print_trade, reset_print_info
from db_access import db_connect, db_exists, output_records_exist, output_init_record, get_last_output_record
from balances import *
from analyst import *
from trader import *
f... | mit |
centwave/jg82ksgvqkuan | django/contrib/gis/geos/prototypes/geom.py | 311 | 4465 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, c_uint, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, PREPGEOM_PTR, GEOS_PREPARE
from django.contrib.gis.geos.prototypes.errcheck import \
check_geom, check_minus_one, check_sized_string, check_string, check_zero
from django.contrib.gis.... | bsd-3-clause |
kensho-technologies/graphql-compiler | graphql_compiler/tests/test_sqlalchemy_extensions.py | 1 | 2928 | # Copyright 2019-present Kensho Technologies, LLC.
import unittest
import sqlalchemy
import sqlalchemy.dialects.mssql as mssql
import sqlalchemy.dialects.postgresql as postgresql
from ..compiler.sqlalchemy_extensions import print_sqlalchemy_query_string
from .test_helpers import compare_sql, get_sqlalchemy_schema_inf... | apache-2.0 |
cwvh/maidfs | maidsim/selectionalgorithm.py | 1 | 1591 | from __future__ import division
class SelectionAlgorithm:
'''
Implements a selective compression algorithm. This algorithm determines
whether a given file should be compressed or not.
This class is designed as a base class; actual selection algorithms should
be implemented as child classes.
... | bsd-2-clause |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/security/security_enums.py | 17 | 9461 | import win32security, ntsecuritycon, winnt
class Enum:
def __init__(self, *const_names):
"""Accepts variable number of constant names that can be found in either
win32security, ntsecuritycon, or winnt."""
for const_name in const_names:
try:
const_val=getattr(... | apache-2.0 |
CaptainThrowback/kernel_htc_m8whl_2.16.651.4 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
oso/pymcda | apps/learn-from-dataset.py | 1 | 5147 | import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/../")
import time
import datetime
from pymcda.electre_tri import MRSort
from pymcda.generate import generate_categories_profiles
from pymcda.pt_sorted import SortedPerformanceTable
from pymcda.types import CriterionValue, CriteriaValues
fr... | gpl-3.0 |
akretion/stock-logistics-workflow | stock_route_sales_team/tests/test_sale_team_route.py | 6 | 2813 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
leki75/ansible | lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py | 71 | 14950 | #!/usr/bin/python
# 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... | gpl-3.0 |
kvesteri/intervals | tests/interval/test_properties.py | 1 | 3829 | from datetime import date, datetime
from decimal import Decimal
from infinity import inf
from pytest import mark
from intervals import (
DateInterval,
DateTimeInterval,
DecimalInterval,
FloatInterval,
IntInterval
)
class TestIntervalProperties(object):
@mark.parametrize(
('interval',... | bsd-3-clause |
danielballan/filestore | filestore/file_writers.py | 2 | 4154 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .handlers_base import HandlerBase
import errno
import six
import logging
import numpy as np
import uuid
import os
import os.path as op
import datetime
import filestore.api as fsc
logger = logging.getLogg... | bsd-3-clause |
cgcgbcbc/django-xadmin | xadmin/__init__.py | 1 | 2296 | from xadmin.sites import AdminSite, site
VERSION = [0,4,4]
class Settings(object):
pass
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
not present. This forces an import on them to register any admin bits they
may want.
"""
from django.conf... | bsd-3-clause |
jianghuaw/nova | nova/objects/floating_ip.py | 3 | 10691 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
lawrence34/python-social-auth | social/backends/open_id.py | 66 | 14306 | import datetime
from calendar import timegm
from jwt import InvalidTokenError, decode as jwt_decode
from openid.consumer.consumer import Consumer, SUCCESS, CANCEL, FAILURE
from openid.consumer.discover import DiscoveryFailure
from openid.extensions import sreg, ax, pape
from social.utils import url_add_parameters
fr... | bsd-3-clause |
fidomason/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/req.py | 328 | 83557 | from email.parser import FeedParser
import os
import imp
import locale
import re
import sys
import shutil
import tempfile
import textwrap
import zipfile
from distutils.util import change_root
from pip.locations import (bin_py, running_under_virtualenv,PIP_DELETE_MARKER_FILENAME,
write_delete... | lgpl-3.0 |
hdinsight/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/de/formats.py | 118 | 1104 | # -*- 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 = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DAT... | apache-2.0 |
ndtran/l10n-switzerland | l10n_ch_account_statement_base_import/parser/g11_file_parser.py | 1 | 8249 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Steve Ferry
#
# This program is free software: you can redistribute it and... | agpl-3.0 |
holly/gistcli | lib/gistcli/argparser.py | 1 | 6704 | #!/usr/bin/env python
# vim:fileencoding=utf-8
from argparse import ArgumentParser, FileType
import time
import warnings
import os, sys, io
import signal
class ArgParser(object):
def __init__(self, description, version):
self.__description = description
self.__version = version
self.... | mit |
SUNET/eduid-idproofing-letter | src/idproofing_letter/app.py | 1 | 1737 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from flask import Flask
from eduid_common.api.logging import init_logging
from eduid_common.api.exceptions import init_exception_handlers
from eduid_userdb import UserDB
from eduid_userdb.proofing import LetterProofingStateDB
from idproofing_letter.ekopos... | bsd-3-clause |
xin3liang/platform_external_chromium_org | third_party/protobuf/python/google/protobuf/internal/containers.py | 224 | 10004 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
malcolmpl/fleetpanel | JumpBridge.py | 1 | 1343 | #!/usr/bin/python
# vim:sw=4:softtabstop=4:expandtab:set fileencoding=ISO8859-2
#
# JumpBridge.py, part of the FleetPanel
#
# Copyright (c) 2008-2009 Pawe³ 'Reef' Polewicz
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution... | mit |
lisa-lab/pylearn2 | doc/conf.py | 2 | 6651 | # -*- coding: utf-8 -*-
#
# pylearn2 documentation build configuration file
# It is based on Theano documentation build
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module impo... | bsd-3-clause |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/_osx_support.py | 16 | 19138 | """Shared OS X support functions."""
import os
import re
import sys
__all__ = [
'compiler_fixup',
'customize_config_vars',
'customize_compiler',
'get_platform_osx',
]
# configuration variables that may contain universal build flags,
# like "-arch" or "-isdkroot", that may need customization for
# the... | apache-2.0 |
Djabbz/wakatime | wakatime/packages/tzlocal3/unix.py | 11 | 3929 |
import os
import re
import pytz3 as pytz
_cache_tz = None
def _tz_from_env(tzenv):
if tzenv[0] == ':':
tzenv = tzenv[1:]
# TZ specifies a file
if os.path.exists(tzenv):
with open(tzenv, 'rb') as tzfile:
return pytz.tzfile.build_tzinfo('local', tzfile)
# TZ specifies a zo... | bsd-3-clause |
QuantConnect/Lean | Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py | 3 | 4028 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen... | apache-2.0 |
Edraak/edraak-platform | lms/djangoapps/courseware/access_utils.py | 13 | 3032 | """
Simple utility functions for computing access.
It allows us to share code between access.py and block transformers.
"""
from datetime import datetime, timedelta
from logging import getLogger
from django.conf import settings
from pytz import UTC
from courseware.access_response import AccessResponse, StartDateErro... | agpl-3.0 |
jbonofre/beam | sdks/python/apache_beam/internal/gcp/json_value_test.py | 7 | 3701 | #
# 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 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/contrib/sites/models.py | 82 | 3951 | from __future__ import unicode_literals
import string
import warnings
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding... | mit |
yousafsyed/casperjs | bin/Lib/encodings/big5hkscs.py | 816 | 1039 | #
# big5hkscs.py: Python Unicode Codec for BIG5HKSCS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_hk, codecs
import _multibytecodec as mbc
codec = _codecs_hk.getcodec('big5hkscs')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.Multib... | mit |
jsirois/pants | src/python/pants/core/goals/typecheck.py | 1 | 6985 | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict, Iterable, Optional, Tuple
from pants.core.goals.style_request import StyleRequest
from ... | apache-2.0 |
DasIch/django | django/contrib/auth/hashers.py | 66 | 17463 | from __future__ import unicode_literals
import base64
import binascii
import hashlib
import importlib
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import receiver
from d... | bsd-3-clause |
cm13-kinzie-port-from-clark/kernel_motorola_msm8992 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
CanalTP/navitia | source/jormungandr/jormungandr/scenarios/helper_classes/tests/__init__.py | 3 | 1257 | # coding=utf-8
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and... | agpl-3.0 |
moylop260/odoo-dev | addons/account/wizard/account_reconcile_partner_process.py | 385 | 5775 | # -*- 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 |
itpcc/FPGA-IA-Journy-game | image2verilog-colorgroup.py | 1 | 4467 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import Tkinter
import tkFileDialog
from PIL import Image
import ImageDraw
import PIL.ImageOps
__DEFAULT_VAR_NAME__ = "var1"
__IS_MARK_CENTER__ = False
__INVERT_COLOR__ = False
def main():
try:
Tkinter.Tk().withdraw() # Close the root window
in_p... | mit |
liyitest/rr | openstack_dashboard/dashboards/admin/hypervisors/views.py | 48 | 2811 | # Copyright 2013 B1 Systems GmbH
#
# 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 |
stars2014/quick-ng | tools/cocos2d-console/toexec/build_console.py | 6 | 7612 | #!/usr/bin/python
# ----------------------------------------------------------------------------
# build_console: Build cocos2d-console into executable binary file with PyInstaller
#
# Author: Bin Zhang
#
# License: MIT
# ----------------------------------------------------------------------------
'''
Build cocos2d-con... | mit |
Xeralux/tensorflow | tensorflow/contrib/nn/python/ops/alpha_dropout.py | 17 | 3427 | # 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... | apache-2.0 |
droark/bitcoin | test/functional/feature_bip68_sequence.py | 2 | 18287 | #!/usr/bin/env python3
# Copyright (c) 2014-2019 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 BIP68 implementation."""
import time
from test_framework.blocktools import create_block, create_... | mit |
frankyrumple/ope | admin_app/gluon/tests/test_template.py | 7 | 6382 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unit tests for gluon.template
"""
import unittest
from fix_path import fix_sys_path
fix_sys_path(__file__)
import template
from template import render
class TestTemplate(unittest.TestCase):
def testRun(self):
self.assertEqual(render(content='{{for ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.