repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jj46/fastdns | fastdns/resolver.py | 1 | 10001 | # -*- coding: utf-8 -*-
"""
resolver.py - A fast multi-threaded DNS resolver using the dnspython library
Examples:
# Importing the library
# from fastdns import resolver
# Resolving many DNS hosts
# >>> from pprint import pprint
# >>> r = resolver.Resolver(domain='cisco.com')
# >>> r.hostnames... | mit |
simonwydooghe/ansible | lib/ansible/modules/network/avi/avi_microservicegroup.py | 28 | 3952 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
go-lab/labmanager | labmanager/rlms/ext/rest.py | 5 | 9234 | # -*-*- encoding: utf-8 -*-*-
#
# gateway4labs is free software: you can redistribute it and/or modify
# it under the terms of the BSD 2-Clause License
# gateway4labs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A P... | bsd-2-clause |
hoangminhitvn/flask | flask/lib/python2.7/site-packages/pip/commands/zip.py | 34 | 15782 | from __future__ import absolute_import
import sys
import re
import fnmatch
import logging
import os
import shutil
import warnings
import zipfile
from pip.utils import display_path, backup_dir, rmtree
from pip.utils.deprecation import RemovedInPip7Warning
from pip.utils.logging import indent_log
from pip.exceptions im... | bsd-3-clause |
googleinterns/smart-content-summary | classifier/preprocess_cola_dataset_for_classifier.py | 1 | 7832 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
palkeo/nebulosa | django_extensions/templatetags/widont.py | 43 | 2034 | import re
from django.template import Library
try:
from django.utils.encoding import force_text
except ImportError:
# Django 1.4 compatibility
from django.utils.encoding import force_unicode as force_text
register = Library()
re_widont = re.compile(r'\s+(\S+\s*)$')
re_widont_html = re.compile(r'([^<>\s])\s... | unlicense |
hexxter/home-assistant | homeassistant/components/climate/nest.py | 2 | 6379 | """
Support for Nest thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.nest/
"""
import logging
import voluptuous as vol
import homeassistant.components.nest as nest
from homeassistant.components.climate import (
STATE_AUTO, STATE_C... | mit |
intersense/stencil-overlapped-tiling-ics | scripts/yaml/constructor.py | 391 | 25145 |
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstructor(object):
yaml_constructors = {}
yaml_multi_constructors =... | mit |
balister/gnuradio | gnuradio-runtime/python/gnuradio/gr/gr_threading_24.py | 94 | 25507 | """Thread module emulating a subset of Java's threading model."""
# This started life as the threading.py module of Python 2.4
# It's been patched to fix a problem with join, where a KeyboardInterrupt
# caused a lock to be left in the acquired state.
import sys as _sys
try:
import thread
except ImportError:
... | gpl-3.0 |
MaximNevrov/neutron | neutron/api/rpc/agentnotifiers/metering_rpc_agent_api.py | 38 | 4380 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.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 applicabl... | apache-2.0 |
RiccardoPecora/MP | Lib/email/feedparser.py | 55 | 21090 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such ... | gpl-3.0 |
shashank19gaurav/tatoeba2 | docs/tatoeba2-django/tatoeba2/tests/conftest.py | 1 | 7611 | from tatoeba2.models import Sentences, SentenceComments, SentencesTranslations, Users, TagsSentences, SentencesSentencesLists, FavoritesUsers, SentenceAnnotations, Contributions, Wall
from datetime import datetime
from tatoeba2.management.commands.deduplicate import Dedup
from django.db import connections
from django.d... | agpl-3.0 |
fluxw42/youtube-dl | youtube_dl/extractor/weiqitv.py | 64 | 1681 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class WeiqiTVIE(InfoExtractor):
IE_DESC = 'WQTV'
_VALID_URL = r'https?://(?:www\.)?weiqitv\.com/index/video_play\?videoId=(?P<id>[A-Za-z0-9]+)'
_TESTS = [{
'url': 'http://www.weiqitv.com/index/video_play?vi... | unlicense |
XiaosongWei/blink-crosswalk | Tools/Scripts/webkitpy/style/checkers/python_unittest.py | 33 | 2675 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
arthurSena/processors | tests/processors/euctr/test_extractor.py | 2 | 4326 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import copy
import datetime
import pytest
import processors.euctr.extractors as extractors
class TestEUCTRExtractors(object):
def test_stub_... | mit |
chrisfilda/edx_platform | lms/djangoapps/instructor/tests/test_hint_manager.py | 31 | 9180 | import json
from django.test.client import Client, RequestFactory
from django.test.utils import override_settings
from mock import patch, MagicMock
from courseware.models import XModuleUserStateSummaryField
from courseware.tests.factories import UserStateSummaryFactory
from courseware.tests.modulestore_config import ... | agpl-3.0 |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/distutils/text_file.py | 136 | 12467 | """text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
import sys, os, io
class TextFile:
"""Provides a file-like object that takes care of all the things you
commonl... | gpl-2.0 |
anthonyfok/frescobaldi | frescobaldi_app/midifile/output.py | 1 | 5282 | # Python midifile package -- parse, load and play MIDI files.
# Copyright (c) 2011 - 2014 by Wilbert Berendsen
#
# 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... | gpl-2.0 |
mattholl/three.js | utils/exporters/maya/plug-ins/threeJsFileTranslator.py | 210 | 16160 | __author__ = 'Sean Griffin'
__version__ = '1.0.0'
__email__ = 'sean@thoughtbot.com'
import sys
import os.path
import json
import shutil
from pymel.core import *
from maya.OpenMaya import *
from maya.OpenMayaMPx import *
kPluginTranslatorTypeName = 'Three.js'
kOptionScript = 'ThreeJsExportScript'
kDefaultOptionsStri... | mit |
terkkila/scikit-learn | benchmarks/bench_lasso.py | 297 | 3305 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... | bsd-3-clause |
tobinjt/Flexget | flexget/plugin.py | 4 | 22382 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.error import HTTPError, URLError
from future.utils import python_2_unicode_compatible
import logging
import os
import re
import time
import pkg_res... | mit |
agry/NGECore2 | scripts/mobiles/corellia/drall_guard.py | 2 | 1581 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
hotpxl/mxnet | python/mxnet/module/module.py | 1 | 30717 | # pylint: disable=too-many-instance-attributes, too-many-arguments, protected-access, too-many-branches
# pylint: disable=too-many-public-methods
"""A `Module` implement the `BaseModule` API by wrapping a `Symbol` and one or
more `Executor` for data parallelization.
"""
import logging
import warnings
from .. import c... | apache-2.0 |
yograterol/flask-bundle-system | setup.py | 1 | 1161 | """
flask-bundle-system
-------------------
Links
`````
* `documentation <http://packages.python.org/flask-bundle-system>`_
* `development version
<http://github.com/yograterol/flask-bundle-system/zipball/master>`_
"""
from setuptools import setup
setup(
name='flask-bundle-system',
version='0.2',
l... | bsd-3-clause |
HydrelioxGitHub/home-assistant | homeassistant/components/proximity/__init__.py | 3 | 9248 | """Support for tracking the proximity of a device."""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICES, CONF_UNIT_OF_MEASUREMENT, CONF_ZONE)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event i... | apache-2.0 |
derekforeman/Wox | PythonHome/Lib/site-packages/pip/commands/zip.py | 393 | 14821 | import sys
import re
import fnmatch
import os
import shutil
import zipfile
from pip.util import display_path, backup_dir, rmtree
from pip.log import logger
from pip.exceptions import InstallationError
from pip.basecommand import Command
class ZipCommand(Command):
"""Zip individual packages."""
name = 'zip'
... | mit |
pamoakoy/invenio | modules/bibknowledge/lib/bibknowledge.py | 2 | 18790 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | gpl-2.0 |
tdtrask/ansible | lib/ansible/plugins/lookup/password.py | 18 | 12098 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, divisio... | gpl-3.0 |
bigpete/pyNES | pynes/examples/movingsprite_translated.py | 28 | 1399 | import pynes
from pynes.game import Game
from pynes.bitbag import *
from pynes.nes_types import *
game = Game()
palette = game.assign('palette',
NesArray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,15,
0x0F, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61,
... | bsd-3-clause |
vrutkovs/atomic-reactor | tests/test_buildimage.py | 3 | 1998 | """
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from glob import glob
import os
from atomic_reactor.buildimage import BuildImageBuilder
from atomic... | bsd-3-clause |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/boto-2.38.0/boto/pyami/startup.py | 153 | 2475 | # Copyright (c) 2006,2007 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... | apache-2.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/Mako-0.7.2/test/test_lexer.py | 2 | 28620 | import unittest
from mako.lexer import Lexer
from mako import exceptions, util
from util import flatten_result, result_lines
from mako.template import Template
import re
from test import TemplateTest, template_base, skip_if, eq_, assert_raises_message
# create fake parsetree classes which are constructed
# exactly as... | apache-2.0 |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/Twisted/twisted/python/systemd.py | 42 | 2784 | # -*- test-case-name: twisted.python.test.test_systemd -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Integration with systemd.
Currently only the minimum APIs necessary for using systemd's socket activation
feature are supported.
"""
__all__ = ['ListenFDs']
from os import getpid
... | gpl-3.0 |
MissingNoIOI/reddit2ebook | reddit2ebook/ebooklib_patched/__init__.py | 4 | 1381 | # This file is part of EbookLib.
# Copyright (c) 2013 Aleksandar Erkalovic <aerkalov@gmail.com>
#
# EbookLib 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 License, or
# (at you... | gpl-3.0 |
miconof/CouchPotatoServer | libs/pyutil/assertutil.py | 106 | 2753 | # Copyright (c) 2003-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
Tests useful in assertion checking, prints out nicely formated messages too.
"""
from humanreadable import hr
def _assert(___cond=False, *___args, **___kwargs):
if ___cond:
return True
... | gpl-3.0 |
xin3liang/platform_external_chromium_org | tools/safely-roll-deps.py | 16 | 5639 | #!/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.
"""Generate a CL to roll a DEPS entry to the specified revision number and post
it to Rietveld so that the CL will land automatically i... | bsd-3-clause |
mjn19172/Savu | savu/data/experiment_collection.py | 1 | 3664 | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | apache-2.0 |
viur-framework/server | render/vi/__init__.py | 1 | 4264 | # -*- coding: utf-8 -*-
from server.render.vi.default import DefaultRender as default
from server.render.vi.user import UserRender as user
from server.render.json.file import FileRender as file
from server.skeleton import Skeleton
from google.appengine.api import app_identity
from server import conf
from server import... | lgpl-3.0 |
mrinalabrol/magik | env/lib/python3.4/site-packages/pip/_vendor/lockfile/pidlockfile.py | 488 | 6221 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | gpl-3.0 |
tvibliani/odoo | openerp/tools/__init__.py | 337 | 1447 | # -*- 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 |
WendellDuncan/or-tools | examples/python/fill_a_pix.py | 5 | 5022 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
AMOboxTV/AMOBox.LegoBuild | script.extendedinfo/resources/lib/LocalDB.py | 1 | 22918 | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
import simplejson as json
import itertools
import KodiJson
from Utils import *
class LocalDB(object):
def __init__(self, *args, **kwargs):
self.movie_imdbs = [... | gpl-2.0 |
jostep/tensorflow | tensorflow/python/kernel_tests/softplus_op_test.py | 82 | 4807 | # 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 |
mark-ignacio/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/profiler_unittest.py | 124 | 5111 | # Copyright (C) 2012 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 ... | bsd-3-clause |
aboood40091/BFLIM-Extractor | build.py | 1 | 1833 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# BFLIM Extractor
# Version v2.3
# Copyright © 2016-2019 AboodXD
# This file is part of BFLIM Extractor.
# BFLIM Extractor 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 ... | gpl-3.0 |
Lyrositor/moul-scripts | Python/system/encodings/mac_cyrillic.py | 593 | 13710 | """ Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | gpl-3.0 |
aaronsw/watchdog | vendor/rdflib-2.4.0/test/store_performace.py | 3 | 3343 | import unittest
from rdflib.Graph import Graph
from rdflib import URIRef
import gc
import itertools
from time import time
from random import random
from tempfile import mkdtemp
def random_uri():
return URIRef("%s" % random())
class StoreTestCase(unittest.TestCase):
"""
Test case for testing store perfo... | agpl-3.0 |
florian-dacosta/OpenUpgrade | addons/hr_timesheet/hr_timesheet.py | 39 | 10037 | # -*- 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 |
rasathus/pigredients | pigredients/ics/hmc5883l.py | 1 | 4135 | import sys
import smbus
import math
from Adafruit_I2C import Adafruit_I2C
_hmc5883l_address = 0x1e
_mode_register = 0x02
_mode_map = { 'continuous' : 0x00,
'single' : 0x01,
'idle' : 0x03}
_configuration_reg_a = 0x00
_configuration_reg_b = 0x01
_read_register = 0x03
class HMC5883L(o... | mit |
AOSP-S4-KK/platform_external_skia | bench/tile_analyze.py | 198 | 12134 | #!/usr/bin/env python
# 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.
""" Analyze per-tile and viewport bench data, and output visualized results.
"""
__author__ = 'bensong@google.com (Ben Chen)'
imp... | bsd-3-clause |
LilithWittmann/froide | froide/publicbody/south_migrations/0017_auto__add_field_foilaw_email_only.py | 6 | 10646 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from froide.helper.auth_migration_util import USER_DB_NAME
APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user'
class Migration(SchemaMigration):
def forwards(self, orm):
... | mit |
treycausey/scikit-learn | sklearn/externals/joblib/test/test_parallel.py | 3 | 9997 | """
Test the parallel module.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2010-2011 Gael Varoquaux
# License: BSD Style, 3 clauses.
import time
import sys
import io
import os
try:
import cPickle as pickle
PickleError = TypeError
except:
import pickle
PickleE... | bsd-3-clause |
trademob/boto | tests/unit/vpc/test_subnet.py | 113 | 5485 | from tests.compat import OrderedDict
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, Subnet
class TestDescribeSubnets(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return b"""
<Describe... | mit |
neteler/QGIS | python/plugins/processing/modeler/CalculatorModelerAlgorithm.py | 10 | 5860 | # -*- coding: utf-8 -*-
"""
***************************************************************************
CalculatorModelerAlgorithm.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************... | gpl-2.0 |
irwinlove/django | tests/m2m_multiple/tests.py | 228 | 2386 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Category
class M2MMultipleTests(TestCase):
def test_multiple(self):
c1, c2, c3, c4 = [
Category.objects.create(name=name)
for name in ["Sports", "N... | bsd-3-clause |
Planigle/planigle | node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | gpl-2.0 |
brianmckenna/sci-wms | wms/migrations/0007_auto_20150424_1604.py | 2 | 1179 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wms', '0006_auto_20150424_1058'),
]
operations = [
migrations.RemoveField(
model_name='style',
name=... | gpl-3.0 |
zstackio/zstack-woodpecker | integrationtest/vm/ha/test_mysql_stop_create_vm.py | 2 | 2011 | '''
Integration Test for creating KVM VM in HA mode with mysql stop on one node.
@author: Quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res... | apache-2.0 |
FRESNA/atlite | atlite/utils.py | 1 | 5135 | # -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2016-2019 The Atlite Authors
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""
General utility functions for internal use.
"""
from .gis import maybe_swap_spatial_dims
import progressbar as pgb
from pathlib import Path
import pandas as pd
import xarray as xr
import t... | gpl-3.0 |
koyuawsmbrtn/eclock | windows/Python27/Lib/site-packages/docutils/parsers/rst/tableparser.py | 112 | 21007 | # $Id: tableparser.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This module defines table parser classes,which parse plaintext-graphic tables
and produce a well-formed data structure suitable for building a CALS tab... | gpl-2.0 |
acsone/acsone-addons | account_analytic_project_id/__init__.py | 1 | 1072 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Stéphane Bidoul
# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... | agpl-3.0 |
rocky/python-xdis | xdis/opcodes/base.py | 1 | 14179 | # (C) Copyright 2017, 2019-2021 by Rocky Bernstein
#
# 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 progr... | gpl-2.0 |
chenc10/Spark-PAF | python/run-tests.py | 4 | 7629 | #!/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 "Li... | apache-2.0 |
akshaynathr/mailman | src/mailman/interfaces/preferences.py | 3 | 2789 | # Copyright (C) 2007-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/astroid/inference.py | 1 | 12104 | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... | gpl-3.0 |
yatto/xteam31 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# 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.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
sternshus/arelle2.7 | svr-2.7/arelle/plugin/TDnetLoader.py | 1 | 9285 | # -*- coding: utf-8 -*-
'''
TDnetLoader is a plug-in to both GUI menu and command line/web service
that loads a TDnet html index file. TDnet is Tokyo Stock Exchange's
Timely Disclosure Network.
(c) Copyright 2014 Mark V Systems Limited, All rights reserved.
'''
from lxml import html
import datetime, re, os
from arel... | apache-2.0 |
jorik041/paramiko | tests/test_sftp_big.py | 25 | 13712 | # Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (a... | lgpl-2.1 |
yuezhonghua/tornado | tornado/test/import_test.py | 124 | 1531 | # flake8: noqa
from __future__ import absolute_import, division, print_function, with_statement
from tornado.test.util import unittest
class ImportTest(unittest.TestCase):
def test_import_everything(self):
# Some of our modules are not otherwise tested. Import them
# all (unless they have externa... | apache-2.0 |
jluissandovalm/smd_lammps | tools/moltemplate/src/nbody_alternate_symmetry/nbody_Impropers_Jcenter.py | 19 | 3134 | from nbody_graph_search import Ugraph
# To find 4-body "improper" interactions,
# (by default, most of the time), we would use this subgraph:
# 0
# * 1st bond connects atoms 1 and 0
# | => 2nd bond connects atoms 1 and 2
# _.*._ ... | gpl-2.0 |
albertomurillo/ansible | test/units/modules/network/f5/test_bigip_gtm_monitor_firepass.py | 38 | 4762 | # -*- 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
bitbandi/all-hash-python | algorithm/x13-hash/setup.py | 1 | 1280 | from setuptools import setup, Extension
x13_hash_module = Extension('x13_hash',
sources = ['x13module.c',
'x13.c',
'../../sph/blake.c',
'../../sph/bmw.c',
... | mit |
ssssam/nightbus | nightbus/tasks.py | 1 | 12497 | # Copyright 2017 Codethink Ltd.
#
# 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 writin... | apache-2.0 |
Nolan330/CS292 | pymavlink/examples/magtest.py | 11 | 3808 | #!/usr/bin/env python
'''
rotate APMs on bench to test magnetometers
'''
import sys, os, time
from math import radians
from pymavlink import mavutil
from optparse import OptionParser
parser = OptionParser("rotate.py [options]")
parser.add_option("--device1", dest="device1", default=None, help="mavlink device1")
p... | lgpl-3.0 |
kuke/models | legacy/ltr/lambda_rank.py | 4 | 1560 | """
LambdaRank is a listwise rank model.
https://papers.nips.cc/paper/2971-learning-to-rank-with-nonsmooth-cost-functions.pdf
"""
import paddle.v2 as paddle
def lambda_rank(input_dim, is_infer=False):
"""
The input data and label for LambdaRank must be sequences.
parameters :
input_dim, one documen... | apache-2.0 |
colinnewell/odoo | addons/website_certification/__openerp__.py | 320 | 1562 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
LimpidTech/buildbot-manager | setup.py | 1 | 1555 | from setuptools import setup, find_packages
import os, sys
# The repository root directory
project_root = os.path.abspath(os.path.dirname(__file__))
# The projects which this project depends upon
dependancies = [
'pyramid',
'buildbot',
'repoze.tm2>=1.0b1',
'WebError',
'pyramid_jinja2',
'zope.i... | mit |
jbarriosc/ACSUFRO | Benchmark/components/src/perftestImpl/ErrTestComponent.py | 4 | 2948 | #*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) Associated Universities Inc., 2002
# (c) European Southern Observatory, 2002
# Copyright by ESO (in the framework of the ALMA collaboration)
# and Cosylab 2002, All rights reserved
#
# This li... | lgpl-2.1 |
pascalchevrel/bedrock | lib/l10n_utils/management/commands/process_ftl.py | 6 | 6296 | # 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 shutil
from subprocess import CalledProcessError
from django.core.management.base import CommandError
from djang... | mpl-2.0 |
stwunsch/gnuradio | gr-fft/python/fft/qa_goertzel.py | 57 | 2049 | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at ... | gpl-3.0 |
barbuza/django | tests/sitemaps_tests/test_https.py | 205 | 3608 | from __future__ import unicode_literals
from datetime import date
from django.test import ignore_warnings, override_settings
from django.utils.deprecation import RemovedInDjango110Warning
from .base import SitemapTestsBase
@override_settings(ROOT_URLCONF='sitemaps_tests.urls.https')
class HTTPSSitemapTests(Sitemap... | bsd-3-clause |
xq262144/hue | desktop/core/ext-py/cx_Oracle-5.2.1/test/uStringVar.py | 3 | 10381 | """Module for testing string variables."""
class TestStringVar(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
self.rawData = []
self.dataByKey = {}
for i in range(1, 11):
stringCol = u"String %d" % i
fixedCharCol = (u"Fixed Char %d" % i).ljust(40)
... | apache-2.0 |
evernym/plenum | plenum/test/checkpoints/test_view_change_after_checkpoint.py | 2 | 4527 | import pytest
from plenum.test.checkpoints.helper import checkRequestCounts
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.test_node import ensureElectionsDone
from plenum.test.view_change.helper import ensure_view_change
from stp_core.loop.eventually import eventually
fro... | apache-2.0 |
takeshineshiro/horizon | openstack_dashboard/dashboards/admin/aggregates/tests.py | 12 | 19957 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
EKT1/valence | valence/bayes.py | 1 | 1505 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import codecs
import re
import pkg_resources
from nltk.classify import NaiveBayesClassifier
space = re.compile('[\'".,!?\\s\\(\\)]+')
cats = ('positiivne', 'negatiivne', 'neutraalne', 'vastuoluline')
classifier = None
corpus_name = pkg_resources.... | gpl-3.0 |
pudo/opennames | opensanctions/crawlers/eu_cor_members.py | 1 | 4495 | from urllib.parse import urljoin
from normality import stringify, collapse_spaces, slugify
from lxml import html
from opensanctions.util import date_formats, DAY
def parse_date(text):
return date_formats(text, [("%d/%m/%Y", DAY)])
def crawl_person(context, name, url):
context.log.debug("Crawling member", na... | mit |
computersalat/ansible | lib/ansible/plugins/callback/__init__.py | 4 | 16578 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
fmcingvale/cherrypy_gae | test/test_httpauth.py | 1 | 5799 | from cherrypy.test import test
test.prefer_parent_path()
import md5, sha
import cherrypy
from cherrypy.lib import httpauth
def setup_server():
class Root:
def index(self):
return "This is public."
index.exposed = True
class DigestProtected:
def index(self):
re... | bsd-3-clause |
smallyear/linuxLearn | salt/salt/returners/sqlite3_return.py | 1 | 7987 | # -*- coding: utf-8 -*-
'''
Insert minion return data into a sqlite3 database
:maintainer: Mickey Malone <mickey.malone@gmail.com>
:maturity: New
:depends: None
:platform: All
Sqlite3 is a serverless database that lives in a single file.
In order to use this returner the database file must exist,
h... | apache-2.0 |
elpaso/QGIS | python/plugins/processing/algs/grass7/ext/r_li_padsd_ascii.py | 45 | 1440 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_padsd_ascii.py
-------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
********************... | gpl-2.0 |
russellthackston/comp-chem-util | myriad/v1/bootstrap-myriad.py | 2 | 2618 | import argparse
import glob
import importlib
import libmyriad
import logging
import myriad
import os
import requests
import shutil
import subprocess
import sys
import time
class Bootstrap:
def __init__(self):
self.server = 'https://raw.githubusercontent.com/russellthackston/comp-chem-util/master/myriad'
self.ver... | mit |
alsrgv/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py | 3 | 32746 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
nthall/pip | pip/_vendor/progress/helpers.py | 521 | 2854 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | mit |
thedep2/CouchPotatoServer | libs/rsa/randnum.py | 194 | 2414 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | gpl-3.0 |
dippatel1994/oppia | scripts/common.py | 30 | 1406 | # Copyright 2014 The Oppia 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 applicable ... | apache-2.0 |
ThiagoGarciaAlves/intellij-community | python/helpers/py2only/docutils/parsers/rst/languages/ca.py | 128 | 4467 | # $Id: ca.py 7119 2011-09-02 13:00:23Z milde $
# Author: Ivan Vilata i Balaguer <ivan@selidor.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# trans... | apache-2.0 |
tsiegleauq/OpenSlides | server/openslides/utils/models.py | 6 | 7291 | import time
from typing import Any, Dict, List, Optional
from django.db import models
from . import logging
from .autoupdate import AutoupdateElement, inform_changed_data, inform_elements
from .rest_api import model_serializer_classes
from .utils import convert_camel_case_to_pseudo_snake_case, get_element_id
logger... | mit |
turbokongen/home-assistant | homeassistant/components/zestimate/sensor.py | 19 | 4377 | """Support for zestimate data from zillow.com."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
import xmltodict
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME
import homeassistant.helpers.c... | apache-2.0 |
tmpgit/intellij-community | python/helpers/docutils/parsers/rst/roles.py | 54 | 13187 | # $Id: roles.py 6121 2009-09-10 12:05:04Z milde $
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Copyright: This module has been placed in the public domain.
"""
This module defines standard interpreted text role functions, a registry for
interpreted text roles, and an API for adding to and retrieving from ... | apache-2.0 |
nycholas/ask-undrgz | src/ask-undrgz/django/contrib/messages/storage/cookie.py | 65 | 5862 | import hmac
from django.conf import settings
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import CompatCookie
from django.utils import simplejson as json
from django.utils.hashcompat import sha_hmac
class MessageEncoder(json.JSON... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.