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 |
|---|---|---|---|---|---|
fspaolo/scikit-learn | sklearn/datasets/svmlight_format.py | 2 | 13301 | """This module implements a loader and dumper for the svmlight format
This format is a text-based format, with one sample per line. It does
not store zero valued features hence is suitable for sparse dataset.
The first element of each line can be used to store a target variable to
predict.
This format is used as the... | bsd-3-clause |
jsilhan/dnf | dnf/__init__.py | 5 | 1394 | # __init__.py
# The toplevel DNF package.
#
# Copyright (C) 2012-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This prog... | gpl-2.0 |
GroestlCoin/encompass | gui/qt/console.py | 4 | 10130 | # source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
import sys, os, re
import traceback, platform
from PyQt4 import QtCore
from PyQt4 import QtGui
from chainkey import util
if platform.system() == 'Windows':
MONOSPACE_FONT = 'Lucida Console'
elif platform.syste... | gpl-3.0 |
lsinfo/odoo | openerp-wsgi.py | 363 | 1811 | # WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --... | agpl-3.0 |
whilo/toolz | doc/source/conf.py | 25 | 9229 | # -*- coding: utf-8 -*-
#
# Toolz documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 22 18:06:00 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | bsd-3-clause |
gpu/CLBlast | scripts/database/database/bests.py | 2 | 2360 |
# This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This file follows the
# PEP8 Python style guide and uses a max-width of 120 characters per line.
#
# Author(s):
# Cedric Nugteren <www.cedricnugteren.nl>
import sys
import database.clblast as clblast
def get_best_result... | apache-2.0 |
briancoutinho0905/2dsampling | src/mem/slicc/ast/IfStatementAST.py | 71 | 3124 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
aranjan7/contrail-controller-aranjan | src/config/common/network.py | 19 | 1506 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
from quantumclient.quantum import client
from quantumclient.client import HTTPClient
from quantumclient.common import exceptions
class CommonQuantumClient(object):
def __init__(self, project, user, passwd, api_server_ip):
AUTH_URL = 'ht... | apache-2.0 |
vheon/ycmd | ycmd/handlers.py | 2 | 13157 | # Copyright (C) 2013-2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
#... | gpl-3.0 |
ardi69/pyload-0.4.10 | pyload/plugin/account/FilerNet.py | 1 | 1976 | # -*- coding: utf-8 -*-
import re
import time
from pyload.plugin.Account import Account
class FilerNet(Account):
__name = "FilerNet"
__type = "account"
__version = "0.04"
__description = """Filer.net account plugin"""
__license = "GPLv3"
__authors = [("stickell", "l.stickell@y... | gpl-3.0 |
zorojean/scrapy | tests/test_mail.py | 129 | 2331 | import unittest
from io import BytesIO
from scrapy.mail import MailSender
class MailSenderTest(unittest.TestCase):
def test_send(self):
mailsender = MailSender(debug=True)
mailsender.send(to=['test@scrapy.org'], subject='subject', body='body', _callback=self._catch_mail_sent)
assert self... | bsd-3-clause |
asiviero/brbeerindex | beerindex/spiders/winespider.py | 1 | 8963 | # -*- coding: utf-8 -*-
from scrapy.spiders import Spider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from scrapy.conf import settings
from beerindex.items import WineIndexItem
import logging
import lxml.html
from urlparse import urlparse
import re
class WineSpider(Spider):
name =... | lgpl-2.1 |
wndhydrnt/airflow | tests/macros/test_hive.py | 15 | 1957 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
broferek/ansible | lib/ansible/modules/cloud/openstack/os_image_info.py | 20 | 5933 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
40223204/w16b_test | static/Brython3.1.3-20150514-095342/Lib/test/test_re.py | 718 | 56009 | # FIXME: brython: implement test.support
#from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
# cpython_only
verbose = True
# FIXME: brython: Not used in this module ?
#import io
import re
# FIXME: brython: implement re.Scanner
#from re import Scanner
import sre_constants
import sys... | agpl-3.0 |
jeremiahmarks/dangerzone | scripts/python/turtleRelated/newhex.py | 1 | 4150 | from fvh import MyTurtle
masterHexSet=[]
masterHexList=[]
distanceBetweenLayers=None
points=["sw","se","e","ne","nw","w"]
def drawit(circleXfromCenter,rootHex):
heading=90
rootHex.turt.pu()
rootHex.turt.seth(heading)
rootHex.setDistanceBetweenLayers()
rootHex.turt.fd(distanceBetweenLayers)
newt... | mit |
juga0/dhcpcanon | tests/dhcpcap_leases.py | 3 | 1968 | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab
# Copyright 2016, 2017 juga (juga at riseup dot net), MIT license.
"""."""
from dhcpcanon.dhcpcaplease import DHCPCAPLease
LEASE_INIT = DHCPCAPLease(interface='enp0s25', address='', server_id='',
next_server='', router='', subnet_mask='',
... | mit |
atheed/servo | tests/wpt/css-tests/tools/py/testing/code/test_assertion.py | 160 | 7843 | import pytest, py
def exvalue():
return py.std.sys.exc_info()[1]
def f():
return 2
def test_assert():
try:
assert f() == 3
except AssertionError:
e = exvalue()
s = str(e)
assert s.startswith('assert 2 == 3\n')
def test_assert_within_finally():
excinfo = py.test.r... | mpl-2.0 |
srikantbmandal/ansible | lib/ansible/modules/cloud/openstack/os_ironic_inspect.py | 22 | 6024 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015-2016, Hewlett Packard Enterprise Development Company LP
#
# This module 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
# (... | gpl-3.0 |
jmcbailey/django-cached-hitcount | cached_hitcount/south_migrations/0002_auto__chg_field_hit_added.py | 2 | 2148 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Hit.added'
db.alter_column(u'cached_hitcount_hit', 'ad... | gpl-3.0 |
Darkdadaah/pywikibot-core | tests/wikidataquery_tests.py | 1 | 9750 | # -*- coding: utf-8 -*-
"""Test cases for the WikidataQuery query syntax and API."""
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import os
import time
import pywikibot
import pywikibot.data.wikidataquery as query
from py... | mit |
theflofly/tensorflow | tensorflow/python/ops/list_ops.py | 15 | 12749 | # 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... | apache-2.0 |
pivie/cctools | galaxy/makeflow_gatk_wrapper.py | 9 | 3066 | #!/usr/bin/env cctools_python
# CCTOOLS_PYTHON_VERSION 2.7 2.6
#
#Copyright (C) 2013- The University of Notre Dame
#This software is distributed under the GNU General Public License.
#See the file COPYING for details.
#
# This program implements a way to organize and manage a large number of
# concurrently running GATK... | gpl-2.0 |
gameduell/duell | bin/win/python2.7.9/Lib/distutils/tests/test_build_py.py | 46 | 5064 | """Tests for distutils.command.build_py."""
import os
import sys
import StringIO
import unittest
from distutils.command.build_py import build_py
from distutils.core import Distribution
from distutils.errors import DistutilsFileError
from distutils.tests import support
from test.test_support import run_unittest
cla... | bsd-2-clause |
chippey/gaffer | python/GafferDispatch/Wedge.py | 1 | 5185 | ##########################################################################
#
# Copyright (c) 2015, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
YueLinHo/Subversion | tools/dev/wc-ng/count-progress.py | 7 | 3223 | #!/usr/bin/env python
#
#
# 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
#... | apache-2.0 |
peiyuwang/pants | src/python/pants/reporting/reporter.py | 26 | 3119 | # 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 collections imp... | apache-2.0 |
hieukypc/ERP | openerp/addons/hr_expense/report/hr_expense_report.py | 29 | 2924 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import osv
from openerp.tools.misc import formatLang
from openerp.tools.translate import _
from openerp.report import report_sxw
from openerp.exceptions import UserError
class report_expens... | gpl-3.0 |
aidanhs/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 |
liampauling/betfair | tests/test_scoresresources.py | 2 | 1117 | import unittest
from betfairlightweight import resources
from tests.tools import create_mock_json
class ScoreResourcesTest(unittest.TestCase):
def test_racedetails(self):
mock_response = create_mock_json("tests/resources/racedetails.json")
resource = resources.RaceDetails(**mock_response.json())
... | mit |
oubiwann/metaphone | metaphone/word.py | 1 | 1414 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unicodedata
class Word(object):
"""
"""
def __init__(self, input):
self.original = input
if isinstance(input, bytes):
self.decoded = input.decode('utf-8', 'ignore')
else:
self.decoded = i... | bsd-3-clause |
shootstar/novatest | nova/tests/virt/baremetal/test_utils.py | 16 | 2105 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
# Copyright 2012 Hewlett-Packard Development Company, L.P.
# 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 Lic... | apache-2.0 |
dennisss/sympy | sympy/logic/tests/test_inference.py | 15 | 9755 | """For more tests on satisfiability, see test_dimacs"""
from sympy import symbols, Q
from sympy.logic.boolalg import And, Implies, Equivalent, true, false
from sympy.logic.inference import literal_symbol, \
pl_true, satisfiable, valid, entails, PropKB
from sympy.logic.algorithms.dpll import dpll, dpll_satisfiable... | bsd-3-clause |
botify-labs/moto | tests/test_cloudformation/fixtures/route53_health_check.py | 8 | 1122 | from __future__ import unicode_literals
template = {
"Resources": {
"HostedZone": {
"Type": "AWS::Route53::HostedZone",
"Properties": {
"Name": "my_zone"
}
},
"my_health_check": {
"Type": "AWS::Route53::HealthCheck",
... | apache-2.0 |
FHannes/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/textio.py | 102 | 62691 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must ... | apache-2.0 |
ndp-systemes/odoo-addons | fix_export_rows/fix_export_rows.py | 1 | 6461 | # -*- coding: utf8 -*-
#
# Copyright (C) 2017 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... | agpl-3.0 |
rcarmo/yaki-gae | lib/pygments/formatters/other.py | 363 | 3811 | # -*- coding: utf-8 -*-
"""
pygments.formatters.other
~~~~~~~~~~~~~~~~~~~~~~~~~
Other formatters: NullFormatter, RawTokenFormatter.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments... | mit |
programulya/three.js | utils/exporters/blender/modules/msgpack/__init__.py | 659 | 1385 | # coding: utf-8
from msgpack._version import version
from msgpack.exceptions import *
from collections import namedtuple
class ExtType(namedtuple('ExtType', 'code data')):
"""ExtType represents ext type in msgpack."""
def __new__(cls, code, data):
if not isinstance(code, int):
raise TypeE... | mit |
tbinjiayou/Odoo | openerp/tools/pdf_utils.py | 456 | 3659 | # -*- 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... | agpl-3.0 |
zero-ui/miniblink49 | v8_7_5/testing/gmock/scripts/generator/cpp/keywords.py | 1157 | 2004 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google 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... | gpl-3.0 |
andresriancho/qotd | qotd/qotd.py | 1 | 6626 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Yuen Ho Wong
#
# 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 3 of the License, or
# (at your option) any late... | gpl-3.0 |
ralphwort/chef-repo | build/python-neutronclient/pbr-0.8.2-py2.7.egg/pbr/hooks/files.py | 44 | 3600 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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://... | apache-2.0 |
Semi-global/edx-platform | lms/djangoapps/lms_xblock/migrations/0001_initial.py | 110 | 4883 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'XBlockAsidesConfig'
db.create_table('lms_xblock_xblockasidesconfig', (
('id', se... | agpl-3.0 |
dlazz/ansible | lib/ansible/modules/network/f5/bigip_policy.py | 14 | 36820 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
stevelle/openstack-ansible | playbooks/roles/repo_server/files/openstack-wheel-builder.py | 2 | 12732 | #!/usr/bin/env python
# Copyright 2014, Rackspace US, 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... | apache-2.0 |
gh0std4ncer/doit | tests/test_exceptions.py | 7 | 2565 | from doit import exceptions
class TestInvalidCommand(object):
def test_just_string(self):
exception = exceptions.InvalidCommand('whatever string')
assert 'whatever string' == str(exception)
def test_task_not_found(self):
exception = exceptions.InvalidCommand(not_found='my_task')
... | mit |
Lupino/containerops | component/python/test/mamba/bootstrap.py | 5 | 4405 | #!/usr/bin/env python3
import subprocess
import os
import sys
import glob
import json
import anymarkup
REPO_PATH = 'git-repo'
def git_clone(url):
r = subprocess.run(['git', 'clone', url, REPO_PATH])
if r.returncode == 0:
return True
else:
print("[COUT] Git clone error: Invalid argument ... | apache-2.0 |
dsquareindia/scikit-learn | sklearn/tests/test_cross_validation.py | 79 | 47914 | """Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse import csr_matrix
from scipy import stats
from sklearn.exceptions import ConvergenceWarning
from sklearn.utils.testing import assert_true
from sklearn.utils.t... | bsd-3-clause |
gatieme/AderXCoding | language/python/re/memFI.py | 1 | 2785 | #!/usr/bin/python
# encoding=utf-8
#!coding:utf-8
import re
import sys
import urllib2
import argparse
import commands
import os
import subprocess
if __name__ == "__main__" :
# 测试正则表达式
reload(sys)
sys.setdefaultencoding("utf-8")
if len(sys.argv) > 1: # 如果在程序运行时,传递了命令行参数
# 打... | gpl-2.0 |
gautam1858/tensorflow | tensorflow/python/keras/wrappers/scikit_learn.py | 4 | 12808 | # 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 |
ferrants/ansible-modules-core | utilities/logic/async_wrapper.py | 189 | 6183 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
#
# 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 ... | gpl-3.0 |
steedos/odoo | addons/account_budget/wizard/account_budget_analytic.py | 375 | 2045 | # -*- 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... | agpl-3.0 |
lowfatcomputing/amforth | core/devices/atmega323/device.py | 5 | 1689 | # Partname: ATmega323
# Built using part description XML file version 203
# generated automatically, do not edit
MCUREGS = {
'ADCH': '$25',
'ADCL': '$24',
'ADCSR': '$26',
'ADMUX': '$27',
'ACSR': '$28',
'SFIOR': '$50',
'MCUCR': '$55',
'MCUCSR': '$54',
'OSCCAL': '$51',
'SPH': '$5E',
'SPL': '$5D',
'SPMCR': '$5... | gpl-2.0 |
maftieu/CouchPotatoServer | libs/sqlalchemy/dialects/mssql/adodbapi.py | 18 | 2284 | # mssql/adodbapi.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
"""
The adodbapi dialect is not implemented for 0.6 at this time.
"""
import dateti... | gpl-3.0 |
cartertech/odoo-hr-ng | hr_infraction/wizard/batch.py | 1 | 3336 | #-*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 One Click Software (http://oneclick.solutions)
# and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you ca... | agpl-3.0 |
mtcode/autoscaler | hack/scripts/break_mig.py | 1 | 5500 | #!/usr/bin/env python
# Copyright 2017 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 |
wetneb/django | tests/timezones/tests.py | 10 | 54662 | from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from unittest import skipIf
from xml.dom.minidom import parseString
from django.contrib.auth.models import User
from django.core import serializers
from django.core.urlresolvers import reverse
from django.db.models import Max... | bsd-3-clause |
notthetup/openshift-iojs | bin/iojs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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
#-------------------------------------------------------------------... | apache-2.0 |
mjtamlyn/django | django/contrib/messages/storage/base.py | 18 | 6090 | from django.conf import settings
from django.contrib.messages import constants, utils
from django.utils.encoding import force_text
LEVEL_TAGS = utils.get_level_tags()
class Message:
"""
Represent an actual message that can be stored in any of the supported
storage classes (typically session- or cookie-ba... | bsd-3-clause |
drinkssu/YourVoiceAlarmBackend | lib/werkzeug/contrib/securecookie.py | 318 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | apache-2.0 |
googleads/google-ads-python | google/ads/googleads/v8/enums/types/price_placeholder_field.py | 1 | 2698 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
koyuawsmbrtn/eclock | windows/Python27/Lib/idlelib/idle_test/test_config_name.py | 49 | 2431 | """Unit tests for idlelib.configSectionNameDialog"""
import unittest
from idlelib.idle_test.mock_tk import Var, Mbox
from idlelib import configSectionNameDialog as name_dialog_module
name_dialog = name_dialog_module.GetCfgSectionNameDialog
class Dummy_name_dialog(object):
# Mock for testing the following methods ... | gpl-2.0 |
lambder/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/masm.py | 61 | 2998 | """SCons.Tool.masm
Tool-specific initialization for the Microsoft Assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The S... | apache-2.0 |
roger-zhao/ardupilot-3.5-dev | Tools/ardupilotwaf/mavgen.py | 36 | 3330 | #!/usr/bin/env python
# encoding: utf-8
# (c) Siddharth Bharat Purohit, 3DRobotics Inc.
"""
The **mavgen.py** program is a code generator which creates mavlink header files.
"""
from waflib import Logs, Task, Utils, Node
from waflib.TaskGen import feature, before_method, extension
import os
import os.path
from xml.et... | gpl-3.0 |
GreatFruitOmsk/snakefood | lib/python/snakefood/fallback/collections.py | 3 | 1609 | """
Safe fallback for defaultdict, in order to support 2.4.
"""
## From http://code.activestate.com/recipes/523034/
try:
from collections import defaultdict
except:
class defaultdict(dict):
def __init__(self, default_factory=None, *a, **kw):
if (default_factory is not None and
... | gpl-2.0 |
OaklandPeters/fastnode | fast/test_node.py | 1 | 1831 | """
Unit-tests and examples of syntax and behavior desired for AST-nodes.
"""
import unittest
import operator
import pdb
from .node import denode, FASTNode, NodeInterface
a, b, c = 5, 4, 2
inner = FASTNode(operator.__mul__, b, c)
outer = FASTNode(operator.__add__, a, inner)
# tree = FASTNode(
# operator.__add__,... | mit |
pcmanus/cassandra-dtest | loadmaker_test.py | 2 | 1189 | import time
import loadmaker
from dtest import Tester
class TestLoadmaker(Tester):
def loadmaker_test(self):
cluster = self.cluster
cluster.populate(1).start()
node1 = cluster.nodelist()[0]
time.sleep(.2)
host, port = node1.network_interfaces['thrift']
lm = loadm... | apache-2.0 |
srowen/spark | python/run-tests.py | 15 | 13614 | #!/usr/bin/env python3
#
# 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 "L... | apache-2.0 |
ndaniel/fusioncatcher | bin/generate_1000genomes.py | 1 | 9395 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
It generates the list of candidate fusion genes. This list is hard coded
in here and it is manually curated from:
Greger et al. Tandem RNA Chimeras Contribute to Transcriptome Diversity in
Human Population and Are Associated with Intronic Genetic Variants,
Plos One,... | gpl-3.0 |
pacoqueen/odfpy | contrib/html2odt/shtml2odt.py | 7 | 22876 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2009 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in t... | gpl-2.0 |
michaelgira23/JEREMY | Skype4Py/filetransfer.py | 21 | 3643 | """File transfers.
"""
__docformat__ = 'restructuredtext en'
import os
from utils import *
class FileTransfer(Cached):
"""Represents a file transfer.
"""
_ValidateHandle = int
def __repr__(self):
return Cached.__repr__(self, 'Id')
def _Alter(self, AlterName, Args=None):
return... | bsd-3-clause |
hexcap/dpkt | dpkt/tns.py | 6 | 1079 | # $Id: tns.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Transparent Network Substrate."""
import dpkt
class TNS(dpkt.Packet):
__hdr__ = (
('length', 'H', 0),
('pktsum', 'H', 0),
('type', 'B', 0),
('rsvd', 'B', 0),
('hdrsum', 'H', 0),
('msg', '0s'... | bsd-3-clause |
tedsunnyday/SE-Server | server/lib/requests/packages/charade/hebrewprober.py | 206 | 13642 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reser... | apache-2.0 |
Pankaj-Sakariya/android-source-browsing.platform--external--chromium-trace | trace-viewer/third_party/closure_linter/closure_linter/ecmalintrules.py | 123 | 34907 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
HwisooSo/gemV-update | src/mem/slicc/ast/StatementListAST.py | 91 | 2240 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
icodemachine/Stem | stem/util/lru_cache.py | 7 | 7373 | # Drop in replace for python 3.2's collections.lru_cache, from...
# http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/
#
# ... which is under the MIT license. Stem users should *not* rely upon this
# module. It will be removed when we drop support for python 3.2 and below.
"""
M... | lgpl-3.0 |
alfasin/st2 | st2client/st2client/utils/httpclient.py | 3 | 4996 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
roadmapper/ansible | lib/ansible/module_utils/network/exos/exos.py | 20 | 8830 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
userzimmermann/pytest | testing/test_argcomplete.py | 179 | 3582 | from __future__ import with_statement
import py, pytest
# test for _argcomplete but not specific for any application
def equal_with_bash(prefix, ffc, fc, out=None):
res = ffc(prefix)
res_bash = set(fc(prefix))
retval = set(res) == res_bash
if out:
out.write('equal_with_bash %s %s\n' % (retval,... | mit |
paulmathews/nova | nova/api/openstack/compute/contrib/aggregates.py | 4 | 7879 | # Copyright (c) 2012 Citrix Systems, 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 ... | apache-2.0 |
liaotup/AutoDeployer | Tomcat Server (Git Client)/commanderService/main.py | 1 | 1639 | #! /bin/bash
# -*- coding: utf-8 -*
import urlparse
import os
import comm_log
import tornado.ioloop
import tornado.web
import tornado.options
from tornado.options import define, options
# 监听端口
define("port", default=8978, help="run on the given port", type=int)
# 日志输出
define("log", default=comm_log.get_logging('gohook... | mit |
naziris/HomeSecPi | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | apache-2.0 |
redhat-openstack/rally | tests/unit/common/objects/test_deploy.py | 10 | 9189 | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
munnerz/CouchPotatoServer | couchpotato/core/media/movie/providers/automation/popularmovies.py | 17 | 1465 | from couchpotato import fireEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.media.movie.providers.automation.base import Automation
log = CPLog(__name__)
autoload = 'PopularMovies'
class PopularMovies(Automation):
interval = 1800
url = 'https://s3.amazonaws.com/popular-movies/movies.j... | gpl-3.0 |
mezz64/home-assistant | homeassistant/components/demo/air_quality.py | 21 | 1585 | """Demo platform that offers fake air quality data."""
from homeassistant.components.air_quality import AirQualityEntity
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Air Quality."""
async_add_entities(
[DemoAirQuality("Home", 14, 23, 100), DemoAi... | apache-2.0 |
ArvinPan/pyzmq | zmq/auth/base.py | 7 | 10384 | """Base implementation of 0MQ authentication."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import logging
import zmq
from zmq.utils import z85
from zmq.utils.strtypes import bytes, unicode, b, u
from zmq.error import _check_version
from .certs import load_certificat... | bsd-3-clause |
js0701/chromium-crosswalk | tools/perf/page_sets/polymer.py | 33 | 10354 | # 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 shared_page_state
from telemetry import story
class PolymerPage(page_module.Page):... | bsd-3-clause |
citrix-openstack-build/nova | nova/openstack/common/rootwrap/cmd.py | 13 | 4847 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 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 |
s-store/sstore-soft | third_party/python/boto/cloudfront/identity.py | 47 | 4489 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | gpl-3.0 |
dwadler/QGIS | python/plugins/processing/gui/BatchPanel.py | 3 | 13573 | # -*- coding: utf-8 -*-
"""
***************************************************************************
BatchPanel.py
---------------------
Date : November 2014
Copyright : (C) 2014 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... | gpl-2.0 |
OSSESAC/odoopubarquiluz | addons/note/tests/__init__.py | 159 | 1105 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
mancoast/CPythonPyc_test | cpython/235_test_quopri.py | 24 | 5562 | from test import test_support
import unittest
from cStringIO import StringIO
from quopri import *
ENCSAMPLE = """\
Here's a bunch of special=20
=A1=A2=A3=A4=A5=A6=A7=A8=A9
=AA=AB=AC=AD=AE=AF=B0=B1=B2=B3
=B4=B5=B6=B7=B8=B9=BA=BB=BC=BD=BE
=BF=C0=C1=C2=C3=C4=C5=C6
=C7=C8=C9=CA=CB=CC=CD=CE=CF
=D0=D1=D2=D3=D4=D5=D6=D7
... | gpl-3.0 |
sils1297/PyGithub | github/IssueEvent.py | 74 | 4698 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
jlopp/statoshi | test/functional/rpc_getblockstats.py | 34 | 6874 | #!/usr/bin/env python3
# Copyright (c) 2017-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 getblockstats rpc call
#
from test_framework.test_framework import BitcoinTestFramework
from tes... | mit |
ralphwort/chef-repo | build/pyparsing/examples/scanExamples.py | 6 | 2363 | #
# scanExamples.py
#
# Illustration of using pyparsing's scanString,transformString, and searchString methods
#
# Copyright (c) 2004, 2006 Paul McGuire
#
from pyparsing import Word, alphas, alphanums, Literal, restOfLine, OneOrMore, \
empty, Suppress, replaceWith
# simulate some C++ code
testData = ""... | apache-2.0 |
gmt/portage | pym/portage/tests/ebuild/test_array_fromfile_eof.py | 10 | 1114 | # Copyright 2009-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import array
import tempfile
from portage import _unicode_decode
from portage import _unicode_encode
from portage.tests import TestCase
class ArrayFromfileEofTestCase(TestCase):
def testArrayFromfileEof(self)... | gpl-2.0 |
MihaiMoldovanu/ansible | lib/ansible/module_utils/facts/network/hurd.py | 192 | 3142 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
maxwward/SCOPEBak | askbot/migrations/0092_postize_vote_and_activity.py | 2 | 34359 | # encoding: utf-8
import datetime
import sys
from south.db import db
from south.v2 import DataMigration
from django.db import models
from askbot.migrations import TERM_RED_BOLD, TERM_GREEN, TERM_RESET
from askbot.utils.console import ProgressBar
class Migration(DataMigration):
def forwards(self, orm):
m... | gpl-3.0 |
pedroma-gomezp/Gymkhana_Computer_Networks_II | gymkhana/steps/step5.py | 2 | 2162 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
import socket
from urllib.request import urlopen, Request
from urllib.error import URLError, HTTPError
import threading
from gymkhana.aux.printing_format import green_nd_bold, yellow_nd_bold, colorfill, end_format
from gymkhana.aux.my_variables import uclm_url, uclm_port3, my... | gpl-3.0 |
whitgroves/taskmap | .venvs/python3.6.0/lib/python3.6/site-packages/setuptools/command/build_ext.py | 193 | 13049 | import os
import sys
import itertools
import imp
from distutils.command.build_ext import build_ext as _du_build_ext
from distutils.file_util import copy_file
from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler, get_config_var
from distutils.errors import DistutilsError
from d... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.