code stringlengths 1 199k |
|---|
from MenuList import MenuList
from Components.ParentalControl import parentalControl, IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET
from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
from Tools.LoadPixmap import L... |
"""
***************************************************************************
ModelerDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**************************************************... |
"""
Django settings for ssbc project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import os
BASE_DIR ... |
import commander.commands as commands
import commander.commands.completion
import commander.commands.result
import commander.commands.exceptions
import re
__commander_module__ = True
class Line:
def __init__(self, line, reg, tabwidth):
self.tabwidth = tabwidth
self.line = line
self.matches = list(reg.finditer(li... |
"""
Croatian-specific classes for parsing and displaying dates.
"""
import re
from ..lib.date import Date
from ._dateparser import DateParser
from ._datedisplay import DateDisplay
from ._datehandler import register_datehandler
class DateParserHR(DateParser):
modifier_to_int = {
'prije' : Date.MOD_BEFORE,... |
"""
assembly_stat
Report assembly file (fasta format) statistics
Created by Tae-Hyuk (Ted) Ahn on 01/15/2014.
Copyright (c) 2013 Tae-Hyuk Ahn (ORNL). Allrights reserved.
"""
import sys, warnings, os, re
from datetime import datetime, date, time
from subprocess import Popen, PIPE, check_call, STDOUT
import getopt
from B... |
import unittest
import mock
import csv
from xcrawler.files.writers.object_writer_csv import ObjectWriterCsv
from xcrawler.compatibility.write_opener.compatible_write_opener import CompatibleWriteOpener
from xcrawler.compatibility.object_converter.compatible_object_converter import CompatibleObjectConverter
from xcrawle... |
"""QGIS Unit tests for core additions
.. note:: 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.
"""
__author__ = 'Denis Rouzaud'... |
import string
__version__ = string.split('$Revision: 1.7 $')[1]
__date__ = string.join(string.split('$Date: 2001/08/10 18:42:33 $')[1:3], ' ')
__author__ = 'Tarn Weisner Burton <twburton@users.sourceforge.net>'
__doc__ = 'http://oss.sgi.com/projects/ogl-sample/registry/ATI/texture_mirror_once.txt'
__api_version__ = 0x0... |
from baseilc import BaseILC
from util import *
class GDML(BaseILC):
""" Responsible for the GDML software installation process. """
def __init__(self, userInput):
BaseILC.__init__(self, userInput, "GDML", "gdml")
self.reqfiles = [ ["lib/libgdml.so", "lib/libgdml.dylib"] ]
self.download.s... |
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from burnman import constants
from burnman.eos import debye
import scipy.integrate
import time
def old_thermal(T, debye_T, n):
if T == 0:
return 0
return 3. * n * constants.gas... |
import cPickle
import os
from test_histotoolsbase import TestHistoToolsBase
from varial import pklio
from varial import analysis
class TestPklio(TestHistoToolsBase):
def setUp(self):
super(TestPklio, self).setUp()
analysis.cwd = self.test_dir
def tearDown(self):
analysis.cwd = ''
... |
from abjad import *
def test_scoretools_Tuplet_set_minimum_denominator_01():
tuplet = Tuplet(Multiplier(3, 5), "c'4 d'8 e'8 f'4 g'2")
tuplet.set_minimum_denominator(8)
assert systemtools.TestManager.compare(
tuplet,
r'''
\tweak #'text #tuplet-number::calc-fraction-text
\times... |
import time
class Timer(object):
def __init__(self, timer_name="", output=False, logger=None):
self._name = timer_name
self._logger = logger
self._output = output
self._end_time = None
self.start()
def start(self):
self._start_time = time.time()
def stop(self)... |
import django
print(django.get_version()) |
from gi.repository import Gtk, Gio
from lollypop.pop_next import NextPopover
from lollypop.pop_queue import QueueWidget
from lollypop.pop_search import SearchPopover
from lollypop.define import Lp, Shuffle
class ToolbarEnd(Gtk.Bin):
"""
Toolbar end
"""
def __init__(self, app):
"""
... |
import bpy
from bl_ui import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_render.RENDER_PT_shading.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_render.RENDER_PT_output.COMPAT_ENGINES.add('... |
DOCUMENTATION = '''
---
module: dnf
version_added: 1.9
short_description: Manages packages with the I(dnf) package manager
description:
- Installs, upgrade, removes, and lists packages and groups with the I(dnf) package manager.
options:
name:
description:
- "Package name, or package specifier with ver... |
"""This demo shows the intersection of the boundary of a unit square
(omega1) with a unit circle (omega2) rotating around the center of the
square.
@todo Change camera perspective/ viewpoint to improve intersection visibility.
"""
from dolfin import *
from numpy import *
if not has_cgal():
print "DOLFIN must be com... |
'''
NFI -- Silensec's Nyuki Forensics Investigator
Copyright (C) 2014 George Nicolaou (george[at]silensec[dot]com)
Silensec Ltd.
This file is part of Nyuki Forensics Investigator (NFI).
NFI is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License ... |
"""
This script evaluates quality of frames infered for data generated using 'randomData.py'.
USAGE: ./evaluateRandom.py original_filename path
"""
import sys
from itertools import izip
class Evaluator:
def parseOriginal(self, ofile):
original = []
for line in open(ofile).xreadlines():
p... |
'''
This file initializes the plugin, making it known to QGIS.
'''
def classFactory(iface):
from qgisconefor import ConeforProcessor
return ConeforProcessor(iface) |
from fnmatch import fnmatch
import os
import sys
from nose.tools import assert_equal
from nose.plugins.skip import SkipTest
try:
import pep8
except ImportError:
HAS_PEP8 = False
else:
HAS_PEP8 = pep8.__version__ > '1.4.5'
import matplotlib
if HAS_PEP8:
class StandardReportWithExclusions(pep8.StandardRep... |
../../../../share/pyshared/DistUpgrade/distinfo.py |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Item",
"_doctype": "Item",
"color": "#f39c12",
"icon": "octicon octicon-package",
"type": "link",
"link": "List/Item"
},
{
"module_name": "Customer",
"_doctype": "Customer",
"color":... |
"""
DIRAC.ResourceStatusSystem package
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$" |
"""
This module is the heart of the upnp support. Device discover, ip discovery
and port mappings are implemented here.
@author: Raphael Slinckx
@author: Anthony Baxter
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
import ... |
"""Setup monoprice6z package."""
from __future__ import absolute_import
import sys
import os
from setuptools import setup, find_packages
sys.path.insert(0, '.')
CURRENT_DIR = os.path.dirname(__file__)
setup(name='monoprice6z',
# version=open(os.path.join(CURRENT_DIR, 'xgboost/VERSION')).read().strip(),
vers... |
"""
Module implementing a dialog to edit channel data.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QDialog, QDialogButtonBox
from .Ui_IrcChannelEditDialog import Ui_IrcChannelEditDialog
class IrcChannelEditDialog(QDialog, Ui_IrcChannelEditDialog):
"""
... |
from __future__ import print_function
from geonode.tests.base import GeoNodeBaseTestSupport
from datetime import datetime, timedelta
import os
import pytz
from xml.etree.ElementTree import fromstring
import json
import xmljson
from decimal import Decimal
from django.core import mail
from django.conf import settings
fro... |
"""Test basic CLI commands"""
import json
from click.testing import CliRunner
from ladybug.cli import viz, config
def test_viz():
runner = CliRunner()
result = runner.invoke(viz)
assert result.exit_code == 0
assert result.output.startswith('vi')
assert result.output.endswith('z!\n')
def test_config(... |
import ConfigParser
import distutils.sysconfig
import os
import os.path
import pwd
import re
import shutil
import sys
class PyTyleConfigParser(ConfigParser.SafeConfigParser):
def getboolean(self, section, option):
if self.get(section, option).lower() == 'yes':
return True
return False
... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = '''
---
module: nxos_vrf
extends_documentation_fragment: nxos
version_added: "2.1"
short_description: Manages global VRF configuration.
description:
- Manages global... |
import time
import x86sets
import x86db
from x86header import *
FLAGS_BASE_INDEX = 5 # Used to reserve the first few flags in the table for manual defined instructions in x86defs.c
mnemonicsIds = {} # mnemonic : offset to mnemonics table of strings.
idsCounter = len("undefined") + 2 # Starts immediately after this one.... |
import logging
import os
from os.path import abspath
from django.utils.functional import lazy
from django.utils.http import urlquote
from pathlib import Path
from .static_media import PIPELINE_CSS, PIPELINE_JS # noqa
ROOT_PATH = Path(__file__).resolve().parents[2]
ROOT = str(ROOT_PATH)
def path(*args):
return absp... |
'''
Storage module to interact with MongoDB.
Provides a MongoStorage helper class with the following
functions:
setup: initialize the Mongo client connection
store: takes in a report dictionary and posts it to
mongo instance. Returns a list of report id's.
get_report: Given a report_id (a sha256 has... |
from django.contrib import admin
from .models import AppWifi
class AppWifiAdmin(admin.ModelAdmin):
readonly_fields = []
list_display = ('boite', 'enabled', 'get_app_dictionary', 'created_date', 'last_activity')
admin.site.register(AppWifi, AppWifiAdmin) |
from __future__ import division, print_function, unicode_literals
import html2text
from odoo import _
from odoo import fields
from odoo.report import report_sxw
from psycopg2.extensions import AsIs
from .report_xlsx_financial_base import ReportXlsxFinancialBase
class ReportXslxFinancialDefault(ReportXlsxFinancialBase):... |
"""A module that encapsulates CKAN Service Provider's model/database.
This module provides a set of public functions that other modules should call
to interact with the database, rather than using sqlalchemy directly.
TODO: Some more refactoring is still needed to have the model completely
encapsulated in this module, ... |
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from base.tests.factories.learning_unit_year import LearningUnitYearFactory
from base.tests.factories.person import PersonFactory
from base.tests.factories.teaching_material import TeachingMaterialFactory
from ... |
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, add_days, date_diff
from frappe import _
from frappe.utils.datautils import UnicodeWriter
from frappe.model.document import Document
class UploadAttendance(Document):
pass
@frappe.whitelist()
def get_template():
if not frappe.has_per... |
from openerp import fields, models
class document(models.Model):
_name = 'stock.document'
name = fields.Char('Name', size=64, required=True)
description = fields.Text('Description')
picking_ids = fields.Many2many(
'stock.picking',
'document_picking_rel',
'picking_id',
'do... |
from .stored_basket import StoredBasket
__all__ = ["StoredBasket"] |
from __future__ import unicode_literals
import abc
from abc import abstractmethod
import six
from django.utils.encoding import force_text
from django.utils.text import camel_case_to_spaces
from jinja2.exceptions import TemplateError
from shuup.apps.provides import get_identifier_to_object_map
from shuup.notify.enums im... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('offer', '0004_auto_20160530_0944'),
]
operations = [
migrations.AddField(
model_name='conditionaloffer',
name='email_domains',
field=models.CharField(max_len... |
"""
"""
import unittest
import os
import numpy as np
from hmtk.seismicity.declusterer.dec_gardner_knopoff import GardnerKnopoffType1
from hmtk.seismicity.declusterer.distance_time_windows import GardnerKnopoffWindow
from hmtk.parsers.catalogue import CsvCatalogueParser
class GardnerKnopoffType1TestCase(unittest.TestCas... |
import os
import sys
lib_path = os.path.abspath('./')
sys.path.insert(0, lib_path)
import unittest
import makerbot_driver
class TestABPProcessor(unittest.TestCase):
def setUp(self):
self.abp = makerbot_driver.GcodeProcessors.AbpProcessor()
def tearDown(self):
self.abp = None
def test_regexs(... |
from collections.abc import (Container, Sized, Iterable, Sequence)
import pytest
from segpy.sorted_frozen_set import SortedFrozenSet
class TestConstruction:
def test_empty(self):
s = SortedFrozenSet()
def test_from_sequence(self):
s = SortedFrozenSet([7, 8, 3, 1])
def test_with_duplicates(se... |
from typing import Optional
from flask import current_app
from eve.flaskapp import Eve
from sams_client import SamsClient
_client: SamsClient = None
def get_sams_client(app: Optional[Eve] = None) -> SamsClient:
global _client
if not _client:
if app is None:
app = current_app
_client ... |
from odoo import _, models
class StockPicking(models.Model):
_inherit = 'stock.picking'
def button_whole_scrap(self):
self.ensure_one()
return {
'name': _('Whole Scrap'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'wiz.stock.picking.scr... |
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 'Account'
db.create_table('billing_account', (
('id', self.gf('django.db.models.fields.AutoField')(primary_k... |
import logging
from superdesk.resource import Resource
from superdesk.services import BaseService
from superdesk.errors import SuperdeskApiError
from flask_babel import _
logger = logging.getLogger(__name__)
class RuleSetsResource(Resource):
schema = {
"name": {
"type": "string",
"iu... |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class CompletedProcessLog(Document):
pass |
"""Handle events that were forwarded from the Segment webhook integration"""
import json
import logging
from dateutil import parser
from django.conf import settings
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.dec... |
from config.config import *
import logging.config
my_logger = logging.getLogger()
my_logger.setLevel("DEBUG")
import os
import re
import codecs
import pandas as pd
from ExergyUtilities.util_inspect import get_self
import ExergyUtilities.util_path as util_path
def second_pass(path_base):
#path_base = r"C:\Users\jon\... |
{
'name': "Private project: followers Only",
'author': "IT-Projects LLC, Ivan Yelizariev",
'license': 'LGPL-3',
'website': "https://yelizariev.github.io",
'category': 'Project',
'version': '1.0.0',
'depends': ['project'],
'installable': False,
'auto_install': False,
} |
from django.db import models
from eav.models import BaseChoice, BaseEntity, BaseSchema, BaseAttribute
class Fruit(BaseEntity):
title = models.CharField(max_length=50)
@classmethod
def get_schemata_for_model(self):
return Schema.objects.all()
def __unicode__(self):
return self.title
class... |
def ati(array):
"""ati(array) -> list
Convert all the elements in the array and return them in a list.
"""
return [int(i) for i in array]
def list_like(data):
"""list_like(data) -> bool
Judge whether the object data is like a list or a tuple.
object data -> the data to judge
... |
"""Test the monitoring of the server heartbeats."""
import sys
import threading
sys.path[0:0] = [""]
from pymongo import monitoring
from pymongo.errors import ConnectionFailure
from pymongo.ismaster import IsMaster
from pymongo.monitor import Monitor
from pymongo.pool import PoolOptions
from test import unittest, clien... |
"""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.
"""
from __future__ import print_function
import argparse
import os
import sys
import msvcrt
parser = argparse.ArgumentParser()
parser.add_argument('-d... |
import os
from os.path import join, dirname, abspath
from topology_lib_scapy import __version__
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.intersphinx',
'sphinxcontrib.plantuml',
'sphinx.ext.graphviz',
'autoapi.sphinx'
]
templ... |
from pyasn1.type import namedtype
from pyasn1.type import tag
from pyasn1.type import univ
from pyasn1_modules import rfc2560
from pyasn1_modules import rfc5652
id_ri_ocsp_response = univ.ObjectIdentifier('1.3.6.1.5.5.7.16.2')
OCSPResponse = rfc2560.OCSPResponse
id_ri_scvp = univ.ObjectIdentifier('1.3.6.1.5.5.7.16.4')
... |
import base64
import json
import logging
import pytest
import requests
import main
from googleapiclient.http import HttpMockSequence
from helpers import readfile
from unittest import mock
class HttpMockSequenceRecorder(HttpMockSequence):
"""Records requests for later use in assertions"""
def __init__(self, iter... |
"""
Utilities that don't go anywhere else.
"""
from __future__ import unicode_literals
import sys
from types import ModuleType
from six import exec_, text_type as unicode, PY3
def safeunicode(o):
"""
Like C{unicode()}, but catches and swallows any raised exceptions.
@param o: An object of some sort.
@re... |
"""
Test conditionally break on a function and inspect its variables.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ConditionalBreakTestCase(TestBase):
mydir = TestBase.compute_mydir(__fil... |
"""The Tailscale integration."""
from __future__ import annotations
from tailscale import Device as TailscaleDevice
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceEntryType... |
import tensorflow as tf
from nets import inception_resnet_v2
from sys import argv
from util import run_model
def main():
"""
You can also run these commands manually to generate the pb file
1. git clone https://github.com/tensorflow/models.git
2. export PYTHONPATH=Path_to_your_model_folder
3. python... |
"""Support for interface with a Sony Bravia TV."""
import ipaddress
import logging
from getmac import get_mac_address
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
SUPPORT_NEXT_TRACK,
SUPPOR... |
"""
Interface definitions paralleling the abstract base classes defined in
:mod:`numbers`.
After this module is imported, the standard library types will declare
that they implement the appropriate interface.
.. versionadded:: 5.0.0
"""
from __future__ import absolute_import
import numbers as abc
from zope.interface.co... |
from __future__ import print_function
import numpy as np
import unittest
import sys
sys.path.append("..")
from op_test import OpTest
import paddle
import paddle.fluid as fluid
from paddle.fluid import core
paddle.enable_static()
SEED = 2021
class TestSoftmax(OpTest):
def setUp(self):
self.set_npu()
... |
"""
:mod:`nova` -- Cloud IaaS Platform
===================================
.. automodule:: nova
:platform: Unix
:synopsis: Infrastructure-as-a-Service Cloud platform.
.. moduleauthor:: Jesse Andrews <jesse@ansolabs.com>
.. moduleauthor:: Devin Carlen <devin.carlen@gmail.com>
.. moduleauthor:: Vishvananda Ishaya <... |
from tempest.lib.services.network import agents_client
from tempest.tests.lib import fake_auth_provider
from tempest.tests.lib.services import base
class TestAgentsClient(base.BaseServiceTest):
FAKE_AGENT_ID = "d32019d3-bc6e-4319-9c1d-6123f4135a88"
FAKE_LIST_DATA = {
"agents": [
{
... |
import os
import subprocess
import unittest
from graphwalker import planning
from graphwalker import halting
from graphwalker import reporting
from graphwalker import execution
from graphwalker import graph
class TestInteraction(unittest.TestCase):
def setUp(self):
here = os.path.normpath(os.path.join(__fil... |
import sys, argparse
from multiprocessing import cpu_count
from subprocess import Popen, PIPE
def main():
parser = argparse.ArgumentParser(description="Sort multiple bam files, use extension .sorted.bam",formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('input',nargs='+',help="Bam file nam... |
from __future__ import absolute_import
import time
import logging
from collections import namedtuple
from itertools import takewhile
import email
import re
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
InvalidHeader,
ProxyError... |
"""Utility functions for use with the mapreduce library."""
__all__ = [
"create_datastore_write_config",
"for_name",
"get_short_name",
"handler_for_name",
"is_generator",
"parse_bool",
"total_seconds",
"try_serialize_handler",
"try_deserialize_handler",
]
import inspect
import pi... |
import os
from pilot.control import data
class StageInClient(object):
def __init__(self, site=None):
super(StageInClient, self).__init__()
# Check validity of specified site
self.site = os.environ.get('VO_ATLAS_AGIS_SITE', site)
if self.site is None:
raise Exception('VO_A... |
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('./'))
extensions = [
'os_api_ref',
'openstackdocstheme'
]
html_theme = 'openstackdocs'
html_theme_options = {
"sidebar_mode": "toc",
}
source_suffix = '.rst'
mast... |
from __future__ import absolute_import
from salttesting import TestCase, expectedFailure
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../')
class SimpleTest(TestCase):
def test_success(self):
assert True
@expectedFailure
def test_fail(self):
assert False
if __name__ =... |
"""
Tests For Compute w/ Cells
"""
import copy
import functools
import inspect
import mock
from oslo_utils.fixture import uuidsentinel as uuids
from oslo_utils import timeutils
from nova import block_device
from nova.cells import manager
from nova.compute import api as compute_api
from nova.compute import cells_api as ... |
from azure import (
WindowsAzureError,
BLOB_SERVICE_HOST_BASE,
DEFAULT_HTTP_TIMEOUT,
DEV_BLOB_HOST,
_ERROR_VALUE_NEGATIVE,
_ERROR_PAGE_BLOB_SIZE_ALIGNMENT,
_convert_class_to_xml,
_dont_fail_not_exist,
_dont_fail_on_exist,
_encode_base64,
_get_request_body,
_get_request_bo... |
try:
# python2
import ConfigParser
except ImportError: # pragma: no cover
# python3
import configparser as ConfigParser
from vent.helpers.errors import ErrorHandler
class Template:
""" Handle parsing templates """
def __init__(self, template=None):
self.config = ConfigParser.RawConfigPa... |
from JumpScale import j
import JumpScale.grid.zdaemon
j.application.start("zdaemonclient")
j.logger.consoleloglevel = 6
client = j.core.zdaemon.getZDaemonClient(addr="127.0.0.1", port=3333, user="root", passwd="1234", ssl=False,category="acategory")
print client.echo("Hello World.")
j.application.stop() |
"""
Tests for Zadara VPSA volume driver
"""
import copy
import httplib
from cinder import exception
from cinder.openstack.common import log as logging
from cinder import test
from cinder.volume import configuration as conf
from cinder.volume.drivers.zadara import zadara_opts
from cinder.volume.drivers.zadara import Zad... |
from __future__ import absolute_import, division, print_function
import errno
import functools
import glob
import os
import os.path
import platform
import subprocess
import sys
from setuptools import Distribution, setup
from setuptools.command.build_ext import build_ext as _build_ext
try:
from setuptools.command.bu... |
"""Functions to retrieve the computer Serial Port list.
Copyright (c) 2017 carlosperate https://github.com/carlosperate/
Licensed under the Apache License, Version 2.0 (the "License"):
http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import unicode_literals, absolute_import, print_function
from serial... |
"""
Created on Feb 16, 2013
@author: alfoa
"""
import sys
import copy
import abc
import json
import itertools
import numpy as np
from BaseClasses.InputDataUser import InputDataUser
from utils import utils,randomUtils,InputData, InputTypes
from BaseClasses import BaseEntity, Assembler
class Sampler(utils.metaclass_inser... |
from calvin.actor.actor import Actor, ActionResult, manage, condition
from calvin.runtime.north.calvin_token import EOSToken, ExceptionToken
class ToString(Actor):
"""
Transform data to JSON-string
Exception tokens will produce "null" as output unless another value is supplied
through the optional 'exce... |
import os
import imghdr
import logging
from http import HTTPStatus
from PIL import Image, TiffImagePlugin
from reportlab.pdfgen import canvas
from mfr.core import extension
from mfr.extensions.pdf import exceptions
from mfr.extensions.pdf.settings import EXPORT_MAX_PAGES
logger = logging.getLogger(__name__)
class PdfEx... |
import os
import posixpath
import re
mime_type_map = {
'.css': 'text/css',
'.js': 'application/javascript',
'.html': 'text/html',
'.map': 'application/json'
}
def guess_mime_type_from_path(path):
return mime_type_map.get(posixpath.splitext(path)[1], 'application/octet-stream')
class StaticContentSou... |
import sys
from pyspark import since, _NoValue
from pyspark.rdd import ignore_unicode_prefix
class RuntimeConfig(object):
"""User-facing configuration API, accessible through `SparkSession.conf`.
Options set here are automatically propagated to the Hadoop configuration during I/O.
"""
def __init__(self,... |
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django_auth_ldap.backend import _LDAPUser
from django.test.client import RequestFactory
from typing import Any, Callable, Dict, Optional, Text
from builtins import object
from oauth2client.cryp... |
from a10sdk.common.A10BaseClass import A10BaseClass
class SamplingEnable(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param counters1: {"enum": ["all", "dev_vip_hits"], "type": "string", "description": "'all': all; 'dev_vip_hits': Number of times the service-ip was selected;... |
"""Manage public proxy to expose containers."""
import click
from docker.errors import DockerException
from stakkr import docker_actions as docker
from stakkr.file_utils import get_dir
class Proxy:
"""Main class that does actions asked by the cli."""
def __init__(self, http_port: int = 80, https_port: int = 443... |
"""Module for testing the add_network command."""
import unittest
if __name__ == "__main__":
import utils
utils.import_depends()
from brokertest import TestBrokerCommand
class TestAddNetwork(TestBrokerCommand):
def testaddnetwork(self):
for network in self.net.all:
command = ["add_networ... |
import ctypes
from PIL import Image
ASCII_CHARS = [' ', '.', ',', ':', ';', '+', '*', '?', '%', '#', '@']
IMAGE_FILE = 'image2ascii.jpg'
CONVERTED_WIDTH = 60
img = Image.open(IMAGE_FILE)
img = img.convert('L')
width, height = img.size
converted_height = height / width * CONVERTED_WIDTH * 0.5
img = img.resize((CONVERTED... |
import os
import json
import re
from scalrctl import click, defaults
__author__ = 'Sergey Babak'
DOCS_HOST = 'https://api-explorer.scalr.com'
EXCLUDES = [
'/{envId}/farm-roles/{farmRoleId}/servers/',
'/{envId}/servers/',
]
DEFAULTS = {
'string': '',
'boolean': True,
'integer': 1,
'number': 1,
... |
from compile_helpers import convert_php_extensions
from compile_helpers import build_php_environment
from compile_helpers import is_web_app
from compile_helpers import find_stand_alone_app_to_run
from compile_helpers import load_binary_index
from compile_helpers import find_all_php_versions
from compile_helpers import ... |
from weakref import WeakKeyDictionary
_lazy_value_cache = WeakKeyDictionary()
def lazy_field(prop):
"""
Decorator which helps in creating lazy properties
"""
@property
def wrapper(self):
if self not in _lazy_value_cache:
_lazy_value_cache[self] = {}
self_cache = _lazy_val... |
"""Contains the logic for `aq add dns_domain`."""
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.aqdb.model import DnsDomain
from aquilon.worker.processes import DSDBRunner
class CommandAddDnsDomain(BrokerCommand):
required_parameters = ["dns_domain"]
def render(self, sess... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.