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
paulmathews/nova
nova/api/openstack/compute/versions.py
9
7801
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
skg-net/ansible
test/units/modules/system/interfaces_file/test_interfaces_file.py
20
9479
# (c) 2017, Roman Belyakovsky <ihryamzik () gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any la...
gpl-3.0
Azure/azure-sdk-for-python
sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domain_registration_provider_operations.py
1
5142
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
gauravbose/digital-menu
tests/forms_tests/tests/test_widgets.py
13
74529
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy import datetime from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from django.forms import ( BooleanField, Chec...
bsd-3-clause
peak6/st2
st2common/st2common/validators/api/misc.py
13
1503
# 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
wilvk/ansible
lib/ansible/utils/module_docs_fragments/ec2.py
196
1119
# (c) 2015, Ansible, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
gpl-3.0
GregoryVigoTorres/scrapy
scrapy/spiders/init.py
95
1354
from scrapy.spiders import Spider from scrapy.utils.spider import iterate_spider_output class InitSpider(Spider): """Base Spider with initialization facilities""" def start_requests(self): self._postinit_reqs = super(InitSpider, self).start_requests() return iterate_spider_output(self.init_re...
bsd-3-clause
lum4chi/mygensim
models/qlmodel.py
1
1822
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016 Francesco Lumachi <francesco.lumachi@gmail.com> from __future__ import division from gensim import models, utils import math class QLModel(models.TfidfModel): """ Use of models.TfidfModel as base to build Query Likelihood Model (12.9) appeared i...
gpl-3.0
dragly/conan
conans/client/rest/auth_manager.py
2
8110
''' Collaborate with RestApiClient to make remote anonymous and authenticated calls. Uses user_io to request user's login and password and obtain a token for calling authenticated methods if receives AuthenticationException from RestApiClient. Flow: Directly invoke a REST method in RestApiClient, example: get_co...
mit
barche/k3d
tests/mesh/mesh.modifier.CGALBoolean.cylinders.py
2
1571
#python import k3d import testing document = k3d.new_document() small_cylinder = k3d.plugin.create("PolyCylinder", document) small_cylinder.radius = 2.0 small_cylinder.zmax = 7.5 small_cylinder.zmin = -7.5 small_cylinder.u_segments = 8 big_cylinder = k3d.plugin.create("PolyCylinder", document) big_cylinder.u_segment...
gpl-2.0
cricketclubucd/davisdragons
platform-tools/systrace/catapult/telemetry/telemetry/internal/backends/chrome/oobe.py
4
5080
# 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 functools import partial import logging from telemetry.core import exceptions from telemetry.internal.browser import web_contents import py_utils cl...
mit
jvehent/pelican
pelican/generators.py
8
30732
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import os import six import logging import shutil import fnmatch import calendar from codecs import open from collections import defaultdict from functools import partial from itertools import chain, groupby from operator import attrgette...
agpl-3.0
theflofly/tensorflow
tensorflow/python/debug/lib/session_debug_testlib.py
11
64583
# 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
sloanyang/android_external_webkit
Tools/TestResultServer/model/testfile.py
15
4323
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
gpl-2.0
ibrahimkarahan/Flexget
tests/test_discover.py
11
5577
from __future__ import unicode_literals, division, absolute_import from datetime import datetime, timedelta from flexget.entry import Entry from flexget import plugin from tests import FlexGetBase class SearchPlugin(object): """ Fake search plugin. Result differs depending on config value: `'fail'`: ra...
mit
lightbase/LBConverter
lbconverter/config.py
1
4423
def set_config(): import ConfigParser config = ConfigParser.ConfigParser() config.read('development.ini') global REST_URL global OUTPATH global DEFAULT_OPENOFFICE_PORT global PIDFILE_PATH global LOGFILE_PATH global SUPPORTED_FILES #---------------------# # Configuration...
gpl-2.0
Deren-Liao/google-cloud-visualstudio
tools/find_unused_strings.py
4
2843
#! /usr/bin/env python """Script that lists all files that match the given extension This script takes a directory and will list all of the files recursively filtering by the given extension. """ import argparse import os import sys import xml.etree.ElementTree as ET # Parse for the program. parser = argparse.Argum...
apache-2.0
etherkit/OpenBeacon2
client/macos/venv/lib/python3.8/site-packages/pip/_internal/operations/build/wheel_legacy.py
5
3356
import logging import os.path from pip._internal.cli.spinners import open_spinner from pip._internal.utils.setuptools_build import ( make_setuptools_bdist_wheel_args, ) from pip._internal.utils.subprocess import ( LOG_DIVIDER, call_subprocess, format_command_args, ) from pip._internal.utils.typing impo...
gpl-3.0
CSC-ORG/Dynamic-Dashboard-2015
engine/lib/python2.7/site-packages/django/contrib/redirects/tests.py
112
3358
from django import http from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings, override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models...
mit
jpopelka/fabric8-analytics-worker
alembic/versions/3fd95b3a69f5_bye_reviews.py
3
1476
"""Bye reviews. Revision ID: 3fd95b3a69f5 Revises: 49c27b67936f Create Date: 2016-06-17 06:56:52.333454 """ # revision identifiers, used by Alembic. revision = '3fd95b3a69f5' down_revision = '49c27b67936f' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects...
gpl-3.0
ajohnson23/depot_tools
tests/checkout_test.py
25
10136
#!/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. """Unit tests for checkout.py.""" import logging import os import shutil import sys import unittest from xml.etree import ElementT...
bsd-3-clause
blippy/pyRenamer
src/pyrenamer_pattern_editor.py
2
9950
# -*- coding: utf-8 -*- """ Copyright (C) 2006-2008 Adolfo González Blázquez <code@infinicode.org> 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...
gpl-2.0
ftrain/django-ftrain
kcal/migrations/0002_to_energy_model.py
1
3214
from south.db import db from django.db import models from ftrain.ohlih.models import * class Migration: def forwards(self, orm): # Adding model 'Energy' db.create_table('ohlih_energy', ( ('kcal_is_est', orm['ohlih.energy:kcal_is_est']), ('kcal', orm['ohlih.ene...
bsd-3-clause
georgemarshall/django
tests/gis_tests/test_ptr.py
74
2398
import ctypes from unittest import mock from django.contrib.gis.ptr import CPointerBase from django.test import SimpleTestCase class CPointerBaseTests(SimpleTestCase): def test(self): destructor_mock = mock.Mock() class NullPointerException(Exception): pass class FakeGeom1(...
bsd-3-clause
google/vroom
vroom/__main__.py
4
1977
"""The vroom test runner.""" import os import signal import subprocess import sys import vroom.args import vroom.color import vroom.output import vroom.runner import vroom.vim def main(argv=None): if argv is None: argv = sys.argv try: args = vroom.args.Parse(argv[1:]) except ValueError as e: sys.s...
apache-2.0
Drooids/odoo
openerp/addons/base/ir/ir_actions.py
174
60020
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of...
agpl-3.0
RanadeepPolavarapu/kuma
vendor/packages/translate/convert/test_json2po.py
25
2728
#!/usr/bin/env python from translate.convert import json2po, test_convert from translate.misc import wStringIO from translate.storage import jsonl10n class TestJson2PO: def json2po(self, jsonsource, template=None, filter=None): """helper that converts json source to po source without requiring files""" ...
mpl-2.0
gmarkall/numba
numba/roc/dispatch.py
4
4683
import numpy as np from numba.np.ufunc.deviceufunc import (UFuncMechanism, GenerializedUFunc, GUFuncCallSteps) from numba.roc.hsadrv.driver import dgpu_present import numba.roc.hsadrv.devicearray as devicearray import numba.roc.api as api class HsaUFuncDispatcher(object): "...
bsd-2-clause
jlengrand/Ivolution
ivolution/util/Notifier.py
1
2002
""" .. module:: Notifier :platform: Unix, Windows :synopsis: Implements a simple Observer/Observable pattern for communication between between Facemovie thread and Ivolution GUI .. moduleauthor:: Julien Lengrand-Lambert <jlengrand@gmail.com> """ class Observer(): """ Implements a simple Observer from t...
bsd-3-clause
mpetyx/palmdrop
venv/lib/python2.7/site-packages/cms/plugins/flash/migrations/0001_initial.py
11
3244
# -*- 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 'Flash' db.create_table('cmsplugin_flash', ( ('cmsplugin_ptr', self.gf('django.db...
apache-2.0
jbking/demo-appengine-django-golang
myproject/django/contrib/gis/geos/mutable_list.py
217
10972
# Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved. # Released under the New BSD license. """ This module contains a base type which provides list-style mutations without specific data storage methods. See also http://www.aryehleib.com/MutableLists.html Author: Aryeh Leib Taurog. """ from django.utils.f...
mit
Nispand1492/appengine-try-python-flask
lib/rsa/asn1.py
89
1147
'''ASN.1 definitions. Not all ASN.1-handling code use these definitions, but when it does, they should be here. ''' from pyasn1.type import univ, namedtype, tag class PubKeyHeader(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('oid', univ.ObjectIdentifier()), namedtype....
apache-2.0
edx/edx-platform
lms/djangoapps/course_blocks/transformers/tests/test_user_partitions.py
5
20048
# pylint: disable=attribute-defined-outside-init, protected-access """ Tests for UserPartitionTransformer. """ import string from collections import namedtuple from datetime import datetime from unittest.mock import patch import ddt from common.djangoapps.course_modes.tests.factories import CourseModeFactory from c...
agpl-3.0
LoHChina/nova
tools/db/schema_diff.py
36
8433
#!/usr/bin/env python # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
Baloc/TouSIX-Manager
tousix_manager/Member_Manager/update/UpdateMixin.py
2
2449
# Copyright 2015 Rémy Lapeyrade <remy at lapeyrade dot net> # Copyright 2015 LAAS-CNRS # # # This file is part of TouSIX-Manager. # # TouSIX-Manager 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 Founda...
gpl-3.0
IronLanguages/ironpython3
Tests/test_bool.py
1
4185
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. import unittest from iptest import is_cli, long, run_test class BoolTest(unittest.TestCase): def test_type...
apache-2.0
huanpc/IoT-1
gui/controller/.venv/lib/python3.5/site-packages/pip/_vendor/colorama/win32.py
535
5365
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetCon...
mit
PourroyJean/performance_modelisation
script/data visualisation/venv/lib/python3.6/site-packages/pip/_vendor/colorama/win32.py
535
5365
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. # from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetCon...
gpl-3.0
jbuchbinder/youtube-dl
test/test_update.py
53
1109
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import json from youtube_dl.update import rsa_verify class TestUpdate(unittest.TestCase): def test_rsa_ver...
unlicense
zcoinofficial/zcoin
src/tor/scripts/codegen/makedesc.py
1
10850
#!/usr/bin/python # Copyright 2014-2019, The Tor Project, Inc. # See LICENSE for license information # This is a kludgey python script that uses ctypes and openssl to sign # router descriptors and extrainfo documents and put all the keys in # the right places. There are examples at the end of the file. # I've used t...
mit
zackdever/kafka-python
test/test_consumer_group.py
1
4801
import collections import logging import threading import time import pytest import six from kafka import SimpleClient from kafka.conn import ConnectionStates from kafka.consumer.group import KafkaConsumer from kafka.structs import TopicPartition from test.conftest import version from test.testutil import random_str...
apache-2.0
georgemarshall/django
django/contrib/auth/__init__.py
20
7733
import inspect import re from django.apps import apps as django_apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.middleware.csrf import rotate_token from django.utils.crypto import constant_time_compare from django.utils.module_loading import i...
bsd-3-clause
samabhi/pstHealth
venv/lib/python2.7/site-packages/PIL/McIdasImagePlugin.py
40
1769
# # The Python Imaging Library. # $Id$ # # Basic McIdas support for PIL # # History: # 1997-05-05 fl Created (8-bit images only) # 2009-03-08 fl Added 16/32-bit support. # # Thanks to Richard Jones and Craig Swank for specs and samples. # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1997. # # Se...
mit
paul99/clank
tools/gyp/test/defines-escaping/gyptest-defines-escaping.py
350
4737
#!/usr/bin/env python # Copyright (c) 2010 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. """ Verifies build of an executable with C++ define specified by a gyp define using various special characters such as quotes, commas, etc. ...
bsd-3-clause
kkouer/PcGcs
Lib/rexec.py
228
20148
"""Restricted execution facilities. The class RExec exports methods r_exec(), r_eval(), r_execfile(), and r_import(), which correspond roughly to the built-in operations exec, eval(), execfile() and import, but executing the code in an environment that only exposes those built-in operations that are deemed safe. To t...
gpl-3.0
ledtvavs/repository.ledtv
script.module.liveresolver/lib/liveresolver/modules/control.py
10
5471
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda 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 ...
gpl-3.0
shakalaca/ASUS_ZenFone_A450CG
linux/kernel/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
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/internet/_win32serialport.py
42
4633
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Serial port support for Windows. Requires PySerial and pywin32. """ # system imports import serial from serial import PARITY_NONE, PARITY_EVEN, PARITY_ODD from serial import STOPBITS_ONE, STOPBITS_TWO from serial import FIVEBITS, SIXBITS, SE...
gpl-2.0
cheral/orange3
Orange/widgets/utils/plot/owplot.py
4
69148
''' ################# Plot (``owplot``) ################# .. autoclass:: OrangeWidgets.plot.OWPlot ''' from AnyQt.QtWidgets import \ QGraphicsView, QGraphicsScene, QGraphicsRectItem, QGraphicsTextItem,\ QToolTip, QApplication from AnyQt.QtGui import QPen, QBrush, QColor, QPainter, QTransform, QPolygonF fro...
bsd-2-clause
lgarren/spack
var/spack/repos/builtin/packages/r-packrat/package.py
3
1642
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
dan1/horizon-x509
openstack_dashboard/dashboards/admin/networks/tables.py
9
4497
# Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
coala-analyzer/coala-bears
bears/perl/PerlCriticBear.py
3
1838
from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.DistributionRequirement import ( DistributionRequirement) from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY @linter(executable='perlcritic', output_format='regex', output_regex=r'(?P<message>.+) ...
agpl-3.0
stackforge/python-openstacksdk
openstack/tests/unit/identity/v3/test_role_assignment.py
3
1553
# 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 # distributed under t...
apache-2.0
Antiun/odoomrp-utils
stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py
7
1053
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api class StockWar...
agpl-3.0
Jon-ICS/mraa
examples/python/mcp3004.py
10
1458
#!/usr/bin/env python # Author: Henry Bruce <henry.bruce@intel.com> # Copyright (c) 2016 Intel Corporation. # # 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 #...
mit
lamondlab/sipify
CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py
1
114661
#!/usr/bin/python # # Author: Jashua R. Cloutier (contact via https://bitbucket.org/senex) # Project: http://senexcanis.com/open-source/cppheaderparser/ # # Copyright (C) 2011, Jashua R. Cloutier # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
apache-2.0
nschaetti/EchoTorch
echotorch/nn/ICACell.py
1
2909
# -*- coding: utf-8 -*- # # File : echotorch/nn/ESN.py # Description : An Echo State Network module. # Date : 26th of January, 2018 # # This file is part of EchoTorch. EchoTorch 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 Sof...
gpl-3.0
hehaichi/django-imagemanagement
imageserver/settings.py
1
3326
""" Django settings for imageserver project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ impor...
mit
poulpito/Flexget
flexget/api/plugins/irc.py
4
4254
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from flask import jsonify from flask_restplus import inputs from flexget.api import api, APIResource from flexget.api.app import BadRequest, NotFoundError, success_response...
mit
ChameleonCloud/horizon
openstack_dashboard/dashboards/identity/roles/forms.py
91
1701
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
defionscode/ansible-modules-core
network/nxos/nxos_evpn_vni.py
19
16296
#!/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
open-homeautomation/home-assistant
homeassistant/components/device_tracker/ping.py
5
2962
""" Tracks devices by sending a ICMP ping. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.ping/ device_tracker: - platform: ping count: 2 hosts: host_one: pc.local host_two: 192.168.2.25 """ import logging import sub...
apache-2.0
rzhxeo/youtube-dl
youtube_dl/extractor/nuvid.py
127
2665
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, ) from ..utils import ( parse_duration, unified_strdate, ) class NuvidIE(InfoExtractor): _VALID_URL = r'https?://(?:www|m)\.nuvid\.com/video/(?P<id>[0-9]+)' _TEST = {...
unlicense
cchurch/pywinrm
winrm/tests/test_session.py
4
1370
from winrm import Session def test_run_cmd(protocol_fake): # TODO this test should cover __init__ method s = Session('windows-host', auth=('john.smith', 'secret')) s.protocol = protocol_fake r = s.run_cmd('ipconfig', ['/all']) assert r.status_code == 0 assert 'Windows IP Configuration' in r....
mit
openwisp/netjsonconfig
netjsonconfig/backends/openvpn/openvpn.py
1
5835
from ...schema import X509_FILE_MODE from ..base.backend import BaseBackend from . import converters from .parser import OpenVpnParser, config_suffix, vpn_pattern from .renderer import OpenVpnRenderer from .schema import schema class OpenVpn(BaseBackend): """ OpenVPN 2.x Configuration Backend """ sch...
gpl-3.0
mbauskar/frappe
frappe/utils/oauth.py
3
9622
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.utils import json from frappe import _ from six import string_types class SignupDisabledError(frappe.PermissionError): pass def get_oauth2_providers(...
mit
dcowden/cadquery-freecad-module
CadQuery/Libs/pygments/lexers/smalltalk.py
77
7215
# -*- coding: utf-8 -*- """ pygments.lexers.smalltalk ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Smalltalk and related languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups, defa...
lgpl-3.0
cwyark/v2ex
mapreduce/main.py
20
2423
#!/usr/bin/env python # # Copyright 2010 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 # # Unless required by applicable law o...
bsd-3-clause
kaiweifan/neutron
neutron/plugins/openvswitch/common/config.py
3
3468
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
queenp/wakatime
wakatime/packages/pygments_py3/pygments/styles/vs.py
135
1073
# -*- coding: utf-8 -*- """ pygments.styles.vs ~~~~~~~~~~~~~~~~~~ Simple style with MS Visual Studio colors. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Co...
bsd-3-clause
beagles/neutron_hacking
neutron/plugins/vmware/plugins/service.py
1
81209
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 VMware, 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/lic...
apache-2.0
alimony/django
django/contrib/gis/gdal/driver.py
62
3262
from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi from django.utils.encoding import force_bytes, force_text class Driver(GDALBase): """ Wrap a GDAL/O...
bsd-3-clause
mSenyor/sl4a
python/src/Lib/plat-sunos5/STROPTS.py
66
36365
# Generated by h2py from /usr/include/sys/stropts.h # Included from sys/feature_tests.h # Included from sys/isa_defs.h _CHAR_ALIGNMENT = 1 _SHORT_ALIGNMENT = 2 _INT_ALIGNMENT = 4 _LONG_ALIGNMENT = 8 _LONG_LONG_ALIGNMENT = 8 _DOUBLE_ALIGNMENT = 8 _LONG_DOUBLE_ALIGNMENT = 16 _POINTER_ALIGNMENT = 8 _MAX_ALIGNMENT = 16 _...
apache-2.0
pkariz/nnsearch
nnsearch/approx/Annoy.py
1
6165
from ..baseindex import Index import numpy as np import math from annoy import AnnoyIndex class Annoy(Index): """ AnnoyIndex from annoy package. """ def __init__(self): self.algorithm = "AnnoyIndex" self.idx_to_vector = {} self.valid_types = [np.uint8, np.uint16, np.uint32, np...
gpl-3.0
Ziqi-Li/bknqgis
pandas/pandas/tests/plotting/test_series.py
2
32812
# coding: utf-8 """ Test cases for Series.plot """ import itertools import pytest from datetime import datetime import pandas as pd from pandas import Series, DataFrame, date_range from pandas.compat import range, lrange import pandas.util.testing as tm import numpy as np from numpy.random import randn import pa...
gpl-2.0
hhru/tinydav
test/Mock.py
4
5311
# Mock object for unittests. # Copyright (C) 2009 Manuel Hermann <manuel-hermann@gmx.net> # # This file is part of tinydav. # # tinydav is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 ...
gpl-3.0
cdr-stats/cdr-stats
cdr_stats/voip_billing/views.py
2
10687
# # CDR-Stats License # http://www.cdr-stats.org # # 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/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The Initial Develope...
mpl-2.0
HERA-Team/pyuvdata
pyuvdata/uvbeam/cst_beam.py
1
13336
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Class for reading beam CST files.""" import re import warnings import numpy as np from .uvbeam import UVBeam from .. import utils as uvutils __all__ = ["CSTBeam"] class CSTBeam(UVB...
bsd-2-clause
276361270/sqlalchemy
test/sql/test_query.py
13
94964
from sqlalchemy.testing import eq_, assert_raises_message, assert_raises, \ is_, in_, not_in_ from sqlalchemy import testing from sqlalchemy.testing import fixtures, engines from sqlalchemy import util from sqlalchemy import ( exc, sql, func, select, String, Integer, MetaData, and_, ForeignKey, union, inter...
mit
joaquinlpereyra/ludema
ludema/abstract/actions.py
1
11361
import random from functools import wraps from ludema.abstract.utils import Direction from ludema.exceptions import (PieceIsNotOnATileError, PieceIsNotOnThisBoardError, TileIsEmptyError, NotGrabbableError) class Action: de...
gpl-3.0
promptworks/horizon
openstack_dashboard/dashboards/admin/images/urls.py
46
1407
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
legalsylvain/OpenUpgrade
addons/l10n_in_hr_payroll/report/payslip_report.py
39
3996
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
hayd/pygments.rb
vendor/pygments-main/pygments/plugin.py
135
1862
# -*- coding: utf-8 -*- """ pygments.plugin ~~~~~~~~~~~~~~~ Pygments setuptools plugin interface. The methods defined here also work if setuptools isn't installed but they just return nothing. lexer plugins:: [pygments.lexers] yourlexer = yourmodule:YourLexer formatter pl...
mit
RueLaLa/django-haystack
example_project/regular_app/search_indexes.py
22
1337
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals from regular_app.models import Dog from haystack import indexes # More typical usage involves creating a subclassed `SearchIndex`. This will # provide more control over how data is indexed, generally resulting in b...
bsd-3-clause
twilio/twilio-python
tests/integration/preview/sync/service/sync_list/test_sync_list_item.py
1
10556
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base import serialize from twilio.base.exceptions import TwilioException from twilio.http.response import Response...
mit
lycantropos/cetus
cetus/queries/filters.py
1
2007
from typing import Optional, Tuple, Any from cetus.types import (FiltersType, FilterType) from cetus.utils import join_str from .utils import normalize_value LOGICAL_OPERATORS = {'AND', 'OR'} INCLUSION_OPERATORS = {'IN', 'NOT IN'} RANGE_OPERATORS = {'BETWEEN'} COMPARISON_OPERATORS = {'=', '!...
mit
fengbaicanhe/intellij-community
python/lib/Lib/encodings/iso2022_jp_2.py
816
1061
# # iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
apache-2.0
kingvuplus/EGAMI-B
lib/python/Plugins/Extensions/Volume_adjust/plugin.py
32
22224
# Volume Adjust # 2009 Black_64 # # FIXED SERVICELIST GREENSCREEN BY SCOPE34 (AN) # ADD AC3 SUPPORT BY BLACK_64 from Screens.Screen import Screen from Screens.ChannelSelection import * from Components.ActionMap import HelpableActionMap, ActionMap, NumberActionMap from Components.Sources.List import List from Componen...
gpl-2.0
laiy/Database_Project
third_party/nltk/tokenize/stanford.py
7
3763
# -*- coding: utf-8 -*- # Natural Language Toolkit: Interface to the Stanford Tokenizer # # Copyright (C) 2001-2015 NLTK Project # Author: Steven Xu <xxu@student.unimelb.edu.au> # # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import unicode_literals, print_function import tempfi...
apache-2.0
jcsp/manila
setup.py
225
1028
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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
gangadhar-kadam/nassimlib
webnotes/utils/email_lib/__init__.py
34
1457
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes from webnotes import conf def sendmail_md(recipients, sender=None, msg=None, subject=None): """send markdown email""" import markdown2 sendmail(recipient...
mit
Sorsly/subtle
google-cloud-sdk/lib/surface/kms/keyrings/remove_iam_policy_binding.py
3
1833
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
mit
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.3/django/contrib/gis/gdal/prototypes/srs.py
321
3378
from ctypes import c_char_p, c_int, c_void_p, POINTER from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import \ const_string_output, double_output, int_output, \ srs_output, string_output, void_output ## Shortcut generation for routines with known p...
mit
aleonliao/depot_tools
trychange.py
29
46227
#!/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. """Client-side script to send a try job to the try server. It communicates to the try server by either writting to a svn/git reposi...
bsd-3-clause
janocat/odoo
addons/account/report/account_entries_report.py
223
7809
# -*- 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
mancoast/CPythonPyc_test
fail/323_test_ioctl.py
87
3327
import array import unittest from test.support import run_unittest, import_module, get_attribute import os, struct fcntl = import_module('fcntl') termios = import_module('termios') get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature try: tty = open("/dev/tty", "rb") except IOError: raise ...
gpl-3.0
shubhdev/openedx
lms/djangoapps/licenses/migrations/0001_initial.py
188
8260
# -*- 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 'CourseSoftware' db.create_table('licenses_coursesoftware', ( ('id', self.gf('dja...
agpl-3.0
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/tests/unit/ec2/cloudwatch/test_connection.py
135
3787
#!/usr/bin/env python # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
gorgorom/p2pool-gor-alts
p2pool/bitcoin/stratum.py
191
3756
import random import sys from twisted.internet import protocol, reactor from twisted.python import log from p2pool.bitcoin import data as bitcoin_data, getwork from p2pool.util import expiring_dict, jsonrpc, pack class StratumRPCMiningProvider(object): def __init__(self, wb, other, transport): self.wb =...
gpl-3.0
kawamon/hue
desktop/core/ext-py/Django-1.11.29/django/utils/lru_cache.py
335
7647
try: from functools import lru_cache except ImportError: # backport of Python's 3.3 lru_cache, written by Raymond Hettinger and # licensed under MIT license, from: # <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/> # Should be removed when Django only sup...
apache-2.0