repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
DepthDeluxe/ansible | lib/ansible/modules/cloud/google/gce_snapshot.py | 37 | 7223 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
zadgroup/edx-platform | common/djangoapps/student/management/commands/cert_restriction.py | 256 | 3879 | from django.core.management.base import BaseCommand, CommandError
import os
from optparse import make_option
from student.models import UserProfile
import csv
class Command(BaseCommand):
help = """
Sets or gets certificate restrictions for users
from embargoed countries. (allow_certificate in
userpro... | agpl-3.0 |
mcking49/apache-flask | Python/Lib/test/test_datetime.py | 12 | 134698 | """Test date/time type.
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
from __future__ import division
import sys
import pickle
import cPickle
import unittest
from test import test_support
from datetime import MINYEAR, MAXYEAR
from datetime import timedelta
from datetime import tzinfo
from datetim... | mit |
foreni-packages/golismero | thirdparty_libs/num2words/orderedmapping.py | 10 | 1396 | # Copyright (c) 2003, Taro Ogawa. All Rights Reserved.
# Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved.
# This library 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
# versi... | gpl-2.0 |
yiShanXin/iOSBlogCN | Export.py | 65 | 1482 | __author__ = 'wwxiang'
#coding=utf-8
import os
import re
work = os.getcwd()
resxml = work + os.path.sep + 'blogcn.opml'
workmd = work + os.path.sep + 'README.md'
def handler():
isblock = True
handlerData = []
lineNo = 0
try:
with open(workmd,'rb') as linefs:
lineCout = len(linefs... | gpl-2.0 |
fxfitz/ansible | lib/ansible/modules/network/avi/avi_clusterclouddetails.py | 34 | 3608 | #!/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 |
fxfitz/ansible | lib/ansible/modules/cloud/vmware/vmware_resource_pool_facts.py | 10 | 5711 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# 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_... | gpl-3.0 |
Bysmyyr/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/profiler/monsoon_profiler.py | 24 | 3435 | # Copyright 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.
"""Profiler using data collected from a Monsoon power meter.
http://msoon.com/LabEquipment/PowerMonitor/
Data collected is a namedtuple of (amps, volts), at... | bsd-3-clause |
linuxmcu/ardupilot | Tools/autotest/arduplane.py | 8 | 17370 | # Fly ArduPlane in SITL
from __future__ import print_function
import math
import os
import shutil
import pexpect
from pymavlink import mavutil
from common import *
from pysim import util
# get location of scripts
testdir = os.path.dirname(os.path.realpath(__file__))
HOME_LOCATION = '-35.362938,149.165085,585,354'
... | gpl-3.0 |
fast90/youtube-dl | youtube_dl/extractor/ted.py | 23 | 11386 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import int_or_none
class TEDIE(InfoExtractor):
IE_NAME = 'ted'
_VALID_URL = r'''(?x)
(?P<proto>https?://)
(?P<type>www|embed(?:-ssl)?)(?P<urlmain>\.te... | unlicense |
agriffis/django-allauth | allauth/socialaccount/providers/flickr/tests.py | 5 | 1655 | # -*- coding: utf-8 -*-
from allauth.socialaccount.tests import OAuthTestsMixin
from allauth.tests import MockedResponse, TestCase
from .provider import FlickrProvider
class FlickrTests(OAuthTestsMixin, TestCase):
provider_id = FlickrProvider.id
def get_mocked_response(self):
#
return [
... | mit |
dkerwin/ansible-modules-core | network/openswitch/ops_template.py | 3 | 9305 | #!/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 distribut... | gpl-3.0 |
ElKowak/android_kernel_motorola_msm8610 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
nemesisdesign/django | tests/check_framework/test_model_field_deprecation.py | 183 | 2560 | from django.core import checks
from django.db import models
from django.test import SimpleTestCase
from django.test.utils import isolate_apps
@isolate_apps('check_framework')
class TestDeprecatedField(SimpleTestCase):
def test_default_details(self):
class MyField(models.Field):
system_check_de... | bsd-3-clause |
Wapaul1/ray | python/ray/rllib/ppo/filter.py | 2 | 4871 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class NoFilter(object):
def __init__(self):
pass
def __call__(self, x, update=True):
return np.asarray(x)
def update(self, other):
pass
def copy(s... | apache-2.0 |
zanderle/django | tests/order_with_respect_to/models.py | 138 | 1213 | """
Tests for the order_with_respect_to Meta attribute.
We explicitly declare app_label on these models, because they are reused by
contenttypes_tests. When those tests are run in isolation, these models need
app_label because order_with_respect_to isn't in INSTALLED_APPS.
"""
from django.db import models
from django... | bsd-3-clause |
drmrd/ansible | lib/ansible/modules/network/aci/aci_rest.py | 4 | 13740 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# 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_ve... | gpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/matplotlib/tests/test_transforms.py | 9 | 19984 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange, zip
import unittest
from nose.tools import assert_equal, assert_raises
import numpy.testing as np_test
from numpy.testing import assert_almost_equal
from matplotlib.tr... | mit |
uweschmitt/emzed | libms/WebserviceClients/Metlin.py | 1 | 3159 | import pdb
#encoding:latin-1
import requests
import urllib2
import userConfig
from collections import OrderedDict
from ..DataStructures.Table import Table
class MetlinMatcher(object):
ws_col_names = [ "formula", "mass", "name", "molid"]
ws_col_types = [ str, float, str, int]
ws_col_formats = [ "%s", "%.... | gpl-3.0 |
skarlekar/chehara | chardet/sjisprober.py | 290 | 3774 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
KatiRG/flyingpigeon | flyingpigeon/processes/wps_subset_continents.py | 1 | 5476 | import os
import tarfile
from flyingpigeon.subset import clipping
from flyingpigeon.subset import _CONTINENTS_
from pywps.Process import WPSProcess
from flyingpigeon.log import init_process_logger
import logging
logger = logging.getLogger(__name__)
class subset_continentsProcess(WPSProcess):
def __init__(self)... | apache-2.0 |
aperigault/ansible | lib/ansible/modules/cloud/amazon/aws_config_recorder.py | 12 | 7833 | #!/usr/bin/python
# Copyright: (c) 2018, Aaron Smith <ajsmith10381@gmail.com>
# 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 |
Moliholy/cvmfs-browser | cvmfs_browser/templatetags/cloud_browser_extras.py | 2 | 2925 | """Cloud browser template tags."""
import os
from django import template
from django.template import TemplateSyntaxError, Node
from django.template.defaultfilters import stringfilter
from cvmfs_browser.app_settings import settings
register = template.Library() # pylint: disable=C0103
@register.filter
@stringfilte... | bsd-3-clause |
tmendoza/func | test/test-confmgt_augeas.py | 5 | 10060 | #!/usr/bin/env python
import sys
import func.overlord.client as fc
c = fc.Client("*")
print c.configmgt_augeas.getenv('AUGEAS_ROOT')
def chroottest():
envdict={}
print 'Get the env. variable AUGEAS_ROOT'
for host,envlist in c.confmgt_augeas.getenv('AUGEAS_ROOT').iteritems():
print "Host: "+host
... | gpl-2.0 |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | gpl-3.0 |
collabspot/muninn | lib/requests/packages/urllib3/util/url.py | 304 | 4273 | from collections import namedtuple
from ..exceptions import LocationParseError
class Url(namedtuple('Url', ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'])):
"""
Datastructure for representing an HTTP URL. Used as a return value for
:func:`parse_url`.
"""
slots = ()
def __new... | mit |
alexlo03/ansible | lib/ansible/vars/manager.py | 5 | 30926 | # (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 |
gorjuce/odoo | openerp/tools/test_reports.py | 337 | 13520 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 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 |
pwns4cash/vivisect | envi/memcanvas/__init__.py | 3 | 11738 | '''
The envi.memcanvas module is the home of the base MemoryRenderer object and
MemoryCanvas objects.
'''
import sys
import traceback
import envi
import envi.memory as e_mem
import envi.symstore.resolver as e_resolv
class MemoryRenderer(object):
"""
A top level object for all memory renderers
"""
de... | apache-2.0 |
alvin319/CarnotKE | jyhton/src/templates/gexpose.py | 19 | 24011 | # copyright 2004-2005 Samuele Pedroni
import sys
import os
import re
scriptdir = os.path.dirname(__file__)
import directives
import java_parser
import java_templating
from java_templating import JavaTemplate,jast_make,jast, make_id, make_literal
# Some examples for modif_re
# (one)two -> group 1 = "one"
# ... | apache-2.0 |
karyon/django | tests/aggregation_regress/models.py | 282 | 3288 | # -*- coding: utf-8 -*-
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Mode... | bsd-3-clause |
dthain/cctools | chirp/src/bindings/python3/chirp.binding.py | 1 | 22700 | ## @package ChirpPython
#
# Python Chirp bindings.
#
# The objects and methods provided by this package correspond to the native
# C API in @ref chirp_reli.h and chirp_swig_wrap.h
#
# The SWIG-based Python bindings provide a higher-level interface that
# revolves around:
#
# - @ref Chirp.Client
# - @ref Chirp.Stat
impo... | gpl-2.0 |
windskyer/nova | nova/tests/unit/virt/xenapi/test_xenapi.py | 1 | 177617 | # Copyright (c) 2010 Citrix Systems, 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 applicab... | gpl-2.0 |
SELYIO/iztlaiptv | servers/fooget.py | 43 | 1984 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para fooget
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core import... | gpl-2.0 |
alesax/gdb-kdump | gdb/testsuite/gdb.perf/lib/perftest/reporter.py | 28 | 2122 | # Copyright (C) 2013-2015 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | gpl-2.0 |
RudolfCardinal/crate | crate_anon/nlp_manager/cloud_request_sender.py | 1 | 12012 | #!/usr/bin/env python
"""
crate_anon/nlp_manager/cloud_request_sender.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify
... | gpl-3.0 |
hachard/Cra-Magnet | flask/lib/python3.5/site-packages/openid/__init__.py | 3 | 1370 | #-*- coding: utf-8 -*-
"""
This package is an implementation of the OpenID specification in
Python. It contains code for both server and consumer
implementations. For information on implementing an OpenID consumer,
see the C{L{openid.consumer.consumer}} module. For information on
implementing an OpenID server, see t... | gpl-3.0 |
tchellomello/home-assistant | homeassistant/components/vesync/switch.py | 1 | 3309 | """Support for VeSync switches."""
import logging
from homeassistant.components.switch import SwitchEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .common import VeSyncDevice
from .const import DOMAIN, VS_DISCOVERY, VS_DISPATCHERS, VS_SWITCHES... | apache-2.0 |
tchellomello/home-assistant | homeassistant/components/insteon/config_flow.py | 10 | 11746 | """Test config flow for Insteon."""
import logging
from pyinsteon import async_connect
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_ADDRESS,
CONF_DEVICE,
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
)
from homeassistant.core im... | apache-2.0 |
patrickm/chromium.src | chrome/test/functional/media/media_seek_perf.py | 56 | 4190 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Seek performance testing for <video>.
Calculates the short and long seek times for different video formats on
different network... | bsd-3-clause |
surgebiswas/poker | PokerBots_2017/Johnny/theano/compile/tests/test_modes.py | 7 | 2498 | """
Test compilation modes
"""
import copy
import unittest
import theano
import theano.tensor as T
from theano.compile import Mode, ProfileMode
class T_bunch_of_modes(unittest.TestCase):
def test1(self):
# this is a quick test after the LazyLinker branch merge
# to check that all the current mod... | mit |
openqt/algorithms | projecteuler/pe368-a-kempner-like-series.py | 1 | 1219 | #!/usr/bin/env python
# coding=utf-8
"""368. A Kempner-like series
https://projecteuler.net/problem=368
The **harmonic series** $1 + \dfrac{1}{2} + \dfrac{1}{3} + \dfrac{1}{4} + ...$
is well known to be divergent.
If we however omit from this series every term where the denominator has a 9
in it, the series remarkab... | gpl-3.0 |
mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/example/ssd/dataset/testdb.py | 26 | 2410 | # 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 |
carnell69/kuma | docs/conf.py | 28 | 7934 | # -*- coding: utf-8 -*-
#
# Kuma documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 5 15:41:51 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 co... | mpl-2.0 |
sjlehtin/django | tests/gis_tests/gdal_tests/test_ds.py | 22 | 11535 | import os
import re
from django.contrib.gis.gdal import (
GDAL_VERSION, DataSource, Envelope, GDALException, OGRGeometry,
)
from django.contrib.gis.gdal.field import OFTInteger, OFTReal, OFTString
from django.test import SimpleTestCase
from ..test_data import TEST_DATA, TestDS, get_ds_file
wgs_84_wkt = (
'GE... | bsd-3-clause |
ilpianista/ansible | test/units/modules/system/test_systemd.py | 28 | 1720 |
from units.compat import unittest
from ansible.modules.system.systemd import parse_systemctl_show
class ParseSystemctlShowTestCase(unittest.TestCase):
def test_simple(self):
lines = [
'Type=simple',
'Restart=no',
'Requires=system.slice sysinit.target',
'De... | gpl-3.0 |
FreeOpcUa/python-opcua | opcua/common/instantiate.py | 1 | 5606 | """
Instantiate a new node and its child nodes from a node type.
"""
import logging
from opcua import Node
from opcua import ua
from opcua.common import ua_utils
from opcua.common.copy_node import _rdesc_from_node, _read_and_copy_attrs
logger = logging.getLogger(__name__)
def instantiate(parent, node_type, nodeid=... | lgpl-3.0 |
amurzeau/streamlink-debian | tests/plugins/test_canalplus.py | 2 | 1031 | from streamlink.plugins.canalplus import CanalPlus
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlCanalPlus(PluginCanHandleUrl):
__plugin__ = CanalPlus
should_match = [
"https://www.mycanal.fr/docus-infos/l-info-du-vrai-du-13-12-politique-les-affaires-reprennent/p/1473830",
... | bsd-2-clause |
anselmobd/fo2 | src/estoque/models.py | 1 | 3782 | import datetime
from pprint import pprint
from django.contrib.auth.models import User
from django.db import models
from produto.models import ProdutoItem
class EstoquePermissions(models.Model):
class Meta:
verbose_name = 'Permissões de estoque'
managed = False
permissions = (
... | mit |
norayr/paperbod | bot/bot_token.py | 2 | 3244 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#ver:2014.04.01-1
import diaspy.client as dsc
import MySQLdb as mdb
import hashlib
from datetime import datetime, date, time
import time as tm
import sys
def activBotTokenAPI():
try:
con = mdb.connect('localhost', '**!**', '**!**', '**!**')
except Except... | agpl-3.0 |
maas/maas | src/maasserver/rbac.py | 1 | 15583 | from collections import defaultdict
from functools import partial
import http.client
import threading
from typing import Mapping, Sequence, Union
from urllib.parse import parse_qs, quote, urlparse
import attr
from maasserver.macaroon_auth import (
APIError,
AuthInfo,
get_auth_info,
MacaroonClient,
... | agpl-3.0 |
maas/maas | src/maasserver/models/space.py | 1 | 6013 | # Copyright 2015-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Space objects."""
import datetime
import re
from django.core.exceptions import PermissionDenied, ValidationError
from django.db.models import CharField, Manager, TextFie... | agpl-3.0 |
salomon1184/bite-project | deps/mrtaskman/third_party/gflags/tests/flags_modules_for_testing/module_foo.py | 139 | 5150 | #!/usr/bin/env python
#
# Copyright (c) 2009, 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 ... | apache-2.0 |
marcore/edx-platform | lms/djangoapps/django_comment_client/management/commands/assign_role.py | 251 | 1144 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django_comment_common.models import Role
from django.contrib.auth.models import User
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--remove',
ac... | agpl-3.0 |
Chiil/microhh | schemes/laplbcdir.py | 5 | 3752 | from pylab import *
xsize = 0.5
igc = 3
def geterror(u, uref, n=2):
error = sqrt(sum((uref - u)**2.) / u.size)
return error
def refdata(n):
x = linspace(0.5*xsize/n, xsize-0.5*xsize/n, n)
u = sin(2.*pi*x/xsize)
return x, u
def laplx2nd(x, u):
istart = igc
iend = u.size + igc
dx = xsize / u.s... | gpl-3.0 |
cfelton/myhdl | myhdl/_tristate.py | 4 | 1955 | from __future__ import absolute_import
import warnings
from myhdl._Signal import _Signal, _DelayedSignal
from myhdl._simulator import _siglist
class BusContentionWarning(UserWarning):
pass
warnings.filterwarnings('always', r".*", BusContentionWarning)
def Tristate(val, delay=None):
""" Return a new Trista... | lgpl-2.1 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/lib-tk/SimpleDialog.py | 204 | 3728 | """A simple but flexible modal dialog box."""
from Tkinter import *
class SimpleDialog:
def __init__(self, master,
text='', buttons=[], default=None, cancel=None,
title=None, class_=None):
if class_:
self.root = Toplevel(master, class_=class_)
else:... | gpl-2.0 |
vmware/pyvmomi-community-samples | samples/getvmsbycluster.py | 1 | 4534 | #!/usr/bin/env python
"""
Written by Chris Hupman
Github: https://github.com/chupman/
Example: Get guest info with folder and host placement
"""
import json
from tools import cli, service_instance
data = {}
def get_nics(guest):
nics = {}
for nic in guest.net:
if nic.network: # Only return adapter ... | apache-2.0 |
chipaca/snapcraft | snapcraft/internal/review_tools/errors.py | 3 | 2708 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2019 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope ... | gpl-3.0 |
coreycb/charm-keystone | charmhelpers/contrib/hahelpers/cluster.py | 3 | 11317 | # Copyright 2014-2015 Canonical Limited.
#
# 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 ... | apache-2.0 |
cchamberlain/npm | node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | 3662 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | artistic-2.0 |
ASoftTech/Scons-Tools-Grbd | scons_tools_grbd/Tools/MSBuild/VC/Dll2Lib.py | 1 | 3979 | """
Dll2Lib
This tool will generate a .lib file under windows for a given .dll file
This uses dumpfile to export a list of symbols
dumpbin /exports C:\yourpath\yourlib.dll
The list of symbols is then written to a .def file
The lib command is then used to generate the .lib file from the .def file
... | mit |
kakunbsc/enigma2 | lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py | 13 | 8251 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from Components.Sources.Progress import Prog... | gpl-2.0 |
liliasapurina/python_training | test/test_contacts.py | 1 | 2349 | __author__ = '1'
import re
def test_contacts_on_home_page(app):
address_from_home_page = app.address.get_address_list()[0]
address_from_edit_page = app.address.get_address_info_from_edit_page(0)
assert address_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(address_from_edit_page... | apache-2.0 |
moijes12/oh-mainline | vendor/packages/twisted/twisted/python/test/test_components.py | 18 | 21573 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for Twisted component architecture.
"""
from zope.interface import Interface, implements, Attribute
from twisted.trial import unittest
from twisted.python import components
from twisted.python.components import proxyForInterface
... | agpl-3.0 |
robozman/pymumblegui | pymumble/pymumble_py3/mumble.py | 1 | 24841 | # -*- coding: utf-8 -*-
import threading
import logging
import time
import select
import socket
import ssl
import struct
from .errors import *
from .constants import *
from . import users
from . import channels
from . import blobs
from . import commands
from . import callbacks
from . import tools
from . import soundou... | gpl-3.0 |
evgenybf/pyXLWriter | pyXLWriter/utilites.py | 1 | 4897 | # pyXLWriter: A library for generating Excel Spreadsheets
# Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Publi... | lgpl-2.1 |
wangyongzhuang/im2sents | pycocoevalcap/cider/cider.py | 10 | 1670 | # Filename: cider.py
#
# Description: Describes the class to compute the CIDEr (Consensus-Based Image Description Evaluation) Metric
# by Vedantam, Zitnick, and Parikh (http://arxiv.org/abs/1411.5726)
#
# Creation Date: Sun Feb 8 14:16:54 2015
#
# Authors: Ramakrishna Vedantam <vrama91@vt.edu> and Tsung... | mit |
thaim/ansible | lib/ansible/modules/network/avi/avi_backup.py | 28 | 4122 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | mit |
40223137/cdag7test37 | static/Brython3.1.1-20150328-091302/Lib/_imp.py | 625 | 2115 | """(Extremely) low-level import machinery bits as used by importlib and imp."""
class __loader__(object):pass
def _fix_co_filename(*args,**kw):
raise NotImplementedError("%s:not implemented" % ('_imp.py:_fix_co_filename'))
def acquire_lock(*args,**kw):
"""acquire_lock() -> None Acquires the interpreter's... | gpl-3.0 |
habeanf/Open-Knesset | persons/migrations/0003_add_processed_protocol_part.py | 15 | 11793 | # encoding: 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 'ProcessedProtocolPart'
db.create_table('persons_processedprotocolpart', (
('id... | bsd-3-clause |
ngokevin/zamboni | settings_test.py | 1 | 2958 | import atexit
import os
import tempfile
from mkt.settings import ROOT
_tmpdirs = set()
def _cleanup():
try:
import sys
import shutil
except ImportError:
return
tmp = None
try:
for tmp in _tmpdirs:
shutil.rmtree(tmp)
except Exception, exc:
sys.... | bsd-3-clause |
yfpeng/pengyifan-leetcode | src/main/python/pyleetcode/next_greater_element.py | 1 | 1874 | """
You are given two arrays (without duplicates) nums1 and nums2 where nums1's elements are subset of nums2. Find all the
next greater numbers for nums1's elements in the corresponding places of nums2.
The Next Greater Number of a number x in nums1 is the first greater number to its right in nums2. If it does not exi... | bsd-3-clause |
browseinfo/odoo_saas3_nicolas | addons/point_of_sale/wizard/pos_sales_user_today.py | 7 | 2065 | # -*- 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 |
awkspace/ansible | lib/ansible/modules/network/dellos10/dellos10_command.py | 39 | 7311 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com>
# Copyright: (c) 2017, Dell 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
... | gpl-3.0 |
ProgrammingRobotsStudyGroup/robo_magellan | scripts/kill_switch.py | 1 | 3880 | #!/usr/bin/env python
#
# Copyright 2017 Robot Garden, 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 applicab... | apache-2.0 |
coreynicholson/youtube-dl | youtube_dl/extractor/esri.py | 64 | 2628 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
int_or_none,
parse_filesize,
unified_strdate,
)
class EsriVideoIE(InfoExtractor):
_VALID_URL = r'https?://video\.esri\.com/watch/(?P<id>[0-9]... | unlicense |
rajiteh/taiga-back | tests/integration/test_history.py | 5 | 7543 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
jjdmol/LOFAR | LTA/LTAIngest/dav/qp_xml.py | 2 | 6289 | # pylint: disable-msg=W0311,E1101,E1103,W0201,C0103,W0622,W0402,W0706,R0911,W0613,W0612,R0912,W0141,C0111,C0121
# qp_xml: Quick Parsing for XML
#
# Written by Greg Stein. Public Domain.
# No Copyright, no Rights Reserved, and no Warranties.
#
# This module is maintained by Greg and is available as part of the XML-SIG
... | gpl-3.0 |
dataxu/ansible | test/units/modules/system/test_known_hosts.py | 107 | 3840 | import os
import tempfile
from ansible.compat.tests import unittest
from ansible.module_utils._text import to_bytes
from ansible.modules.system.known_hosts import compute_diff
class KnownHostsDiffTestCase(unittest.TestCase):
def _create_file(self, content):
tmp_file = tempfile.NamedTemporaryFile(prefix... | gpl-3.0 |
jul/dsat | setup.py | 1 | 1616 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import unittest
import sys
import os
sys.path += [ "./dsat" ]
import dsat
#TODO call make text with sphinx (please don't use system) before
#building/install
fcontent = lambda f: open(f).read()
def test():
print "TEST SKIP... | bsd-2-clause |
phtagn/sickbeard_mp4_automator | tmdb_api/tmdb.py | 1 | 14699 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#author:doganaydin
#project:themoviedb
#repository:http://github.com/doganaydin/themoviedb
#license: LGPLv3 http://www.gnu.org/licenses/lgpl.html
"""An interface to the themoviedb.org API"""
__author__ = "doganaydin"
__version__ = "1.0b"
try:
import simplejson
except:
... | mit |
fossfreedom/coverart-browser | coverart_controllers.py | 1 | 28816 | # -*- Mode: python; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*-
#
# Copyright (C) 2012 - fossfreedom
# Copyright (C) 2012 - Agustin Carrasco
#
# 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 Fou... | gpl-3.0 |
amith01994/intellij-community | python/lib/Lib/site-packages/django/conf/locale/fr/formats.py | 232 | 1530 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# 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'
DATETIME_FORMAT = 'j F Y H:i:s'
YEAR_MONTH_F... | apache-2.0 |
DavadDi/flatbuffers | tests/MyGame/MonsterExtra.py | 4 | 10966 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: MyGame
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class MonsterExtra(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(... | apache-2.0 |
YeelerG/scrapy | conftest.py | 30 | 1095 | import glob
import six
import pytest
from twisted import version as twisted_version
def _py_files(folder):
return glob.glob(folder + "/*.py") + glob.glob(folder + "/*/*.py")
collect_ignore = [
# deprecated or moved modules
"scrapy/conf.py",
"scrapy/stats.py",
"scrapy/project.py",
"scrapy/uti... | bsd-3-clause |
Communities-Communications/cc-odoo | addons/account/account_bank.py | 258 | 5481 | # -*- 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 |
dana-i2cat/felix | expedient/src/python/expedient/common/clients/geni.py | 2 | 1929 | import xmlrpclib
"""
author: msune, CarolinaFernandez
Wrapper to create simple clients for GENI-based AMs (e.g. AMsoil).
"""
class SafeTransportWithCert(xmlrpclib.SafeTransport):
"""Helper class to foist the right certificate for the transport class."""
def __init__(self, key_path, cert_path):
xmlrpc... | apache-2.0 |
donkirkby/django | django/conf/locale/fr/formats.py | 504 | 1454 | # -*- 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'
DATETI... | bsd-3-clause |
neo900/skyline | src/horizon/listen.py | 1 | 4999 | import socket
from os import kill, getpid
from Queue import Full
from multiprocessing import Process
from struct import Struct, unpack
from msgpack import unpackb
from cPickle import loads
import logging
import settings
logger = logging.getLogger("HorizonLog")
class Listen(Process):
"""
The listener is resp... | mit |
SteveHNH/ansible | lib/ansible/modules/net_tools/lldp.py | 47 | 2503 | #!/usr/bin/python -tt
#
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['previe... | gpl-3.0 |
2014c2g12/c2g12 | c2wp/wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/runner.py | 195 | 7484 | """Running tests"""
import sys
import time
import warnings
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __ge... | gpl-2.0 |
HiroIshikawa/21playground | flask-rethink/env/lib/python3.5/site-packages/werkzeug/contrib/lint.py | 128 | 12322 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.lint
~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module provides a middleware that performs sanity checks of the WSGI
application. It checks that :pep:`333` is properly implemented and warns
on some common HTTP errors such as non-empty respons... | mit |
guijomatos/SickRage | lib/stevedore/sphinxext.py | 28 | 3543 | # 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... | gpl-3.0 |
bavla/Graph | PsCoresTQ.py | 1 | 2315 | gdir = 'c:/users/batagelj/work/python/graph/graph'
# wdir = 'c:/users/batagelj/work/python/graph/JSON/test'
wdir = 'c:/users/batagelj/work/python/graph/JSON/SN5'
import sys, os, datetime, json
sys.path = [gdir]+sys.path; os.chdir(wdir)
import GraphNew as Graph
import TQ
# fJSON = 'ConnectivityWeighted.json'
# f... | gpl-3.0 |
keithroe/vtkoptix | Filters/Core/Testing/Python/TestFlyingEdges3DWithInterpolation.py | 4 | 2365 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.SetMultiSamples(0)
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWi... | bsd-3-clause |
robweber/maraschino | lib/jinja2/filters.py | 105 | 24409 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import imap, groupby
from jinja2.... | mit |
Karel-van-de-Plassche/bokeh | bokeh/sampledata/tests/test_les_mis.py | 2 | 1973 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
konstruktoid/ansible-upstream | lib/ansible/modules/network/f5/bigip_virtual_server.py | 10 | 97536 | #!/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 |
azumimuo/family-xbmc-addon | plugin.video.androidrepublica/vipracing.py | 21 | 19167 | import math
import urllib, urllib2
import re
def vip_unlockmeta(meta):
d=''
for i in range(0, len(meta)):
if (i % 3 == 0):
d += "%";
else:
d += meta[i];
return urllib.unquote(d);
def get_html(meta,data):
meta_un=vip_unlockmeta(meta)
# print meta_un;
# return
oo=''
x=data
l = len(x)
b = 1024.0
i, j,... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.