content stringlengths 4 20k |
|---|
{
'name': 'Product by supplier info',
'version': '1.0.1',
'category': 'purchase',
'summary': 'Show products grouped by suppliers',
'description': """
Product Supplier Info
==================================================
This module categorizes each product item by supplier.
It allows for users to... |
from __future__ import division
from From_log_To_AOI import read_coor # coordinates_str
from From_log_To_AOI import read_log # filename
from From_log_To_AOI import log_to_AOI # Start_Timestamp, Frame,tl,br,Angle
from From_AOI_To_xml import CreateXml
from From_AOI_To_xml import Generate_DynamicAOI
from From_AOI_To_x... |
#!/usr/bin/python3
"""
This script gets generates three outputs; one CSV file showing containing the log of calls made in the date period. the CSV headers are:
CallSID, CountryCode, NumberCalled, CallPrice, CallDuration
You can import this into excel and use pivot tables to do some analysis.
The second CSV file is a... |
#!/usr/bin/env python
"""
Setuptools bootstrapping installer.
Run this script to install or upgrade setuptools.
"""
import os
import shutil
import sys
import tempfile
import zipfile
import optparse
import subprocess
import platform
import textwrap
import contextlib
import json
import codecs
from distutils import lo... |
"""Test for the autocomplete example."""
from __future__ import absolute_import
import unittest
from nose.plugins.attrib import attr
import apache_beam as beam
from apache_beam.examples.complete import autocomplete
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.util import asser... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class res_users(osv.osv):
_name = 'res.users'
_inherit = 'res.users'
def onchange_person_name(self, cr, uid, ids, first_name, middle_name, surname, mother_name, context=None):
res = {'value':{}}
res['value']['na... |
def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
response.headers.set("Content-Security-Policy", "default-src 'self' 'unsafe-inline'")
respons... |
"""
Base class for all XML-RPC tests
"""
from __future__ import print_function
import collections
import datetime
import inspect
import unittest
import contextlib
import six
from ipatests.util import assert_deepequal, Fuzzy
from ipalib import api, request, errors
from ipapython.version import API_VERSION
# Matches... |
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from astropy import units as u
from astropy.coordinates.matrix_utilities import rotation_matrix, angle_axis
def test_rotation_matrix():
assert_array_equal(rotation_matrix(0*u.deg, 'x'), np.eye(3))
assert_allclose(rotation_matri... |
"""Generate the different steps of the indistinguishability obfuscation
candidate and measure memory and time impact.
Experiment IDs:
0: generate all useful UCs up to a input size of 4
1: Generate BPs for 'small' UCs [(2, 1), (2,2), (3,2), (2,3), (3,3), (4,3)]
2: Generate RBPs for 'small' UCs with three different pr... |
from django.db import models
from django.db.models import Manager
from typing import Text
import zerver.models
def get_deployment_by_domain(domain):
# type: (Text) -> Deployment
return Deployment.objects.get(realms__domain=domain)
class Deployment(models.Model):
realms = models.ManyToManyField(zerver.mod... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import os, sys
# Bunch
from bunch import Bunch
# Sarge
from sarge impo... |
# import pytest
# from bitarray import bitarray
#
# from common.exceptions import LogicError
# from plenum.common.bitmask_helper import BitmaskHelper
#
#
# def test_apply_bitmask(replica):
# """Expected result : [1, 3] [2] (the first returned parameter is a list of valid requests
# ... |
"""Config options available for the Cloudbase-Init setup."""
from oslo_config import cfg
from argus.config import base as conf_base
class CloudbaseInitOptions(conf_base.Options):
"""Config options available for the Cloudbase-Init setup."""
def __init__(self, config):
super(CloudbaseInitOptions, se... |
"""Test for directx_9_18_944_0_partial. These are MEDIUM tests."""
import TestFramework
def TestSConstruct(scons_globals):
"""Test SConstruct file.
Args:
scons_globals: Global variables dict from the SConscript file.
"""
# Get globals from SCons
Environment = scons_globals['Environment']
env = Env... |
"""
For running evaluation_to_member_agent.py without the cogserver
"""
from __future__ import print_function
from pln.examples.backward_chaining.backward_agent import BackwardAgent, check_result
from opencog.atomspace import types, AtomSpace, TruthValue
from opencog.scheme_wrapper import load_scm, scheme_eval, scheme... |
# -*- coding: utf-8 -*-
import codecs
import os
class interval:
def __init__(self,sample_no,xmin,xmax,text):
self.xmin=xmin
self.xmax=xmax
self.text=text
self.sample_no=sample_no
class Textgrid(object):
def __init__(self, path=None):
self.path = path
se... |
from __future__ import print_function
import sys
import os
import glob
import shutil
#-------------------------------------------------------------------------------
def removeFiles(filesList):
existingFilesList = filter(os.path.exists,filesList)
map(os.unlink, existingFilesList)
#------------------------------... |
from collections.abc import Sequence
from typing import Any, Iterable, List, Optional
class RangeSet(Sequence):
def __init__(self, ranges: Iterable[range] = []):
self.__ranges: List[range] = []
for r in ranges:
assert r.step == 1
self.add(r.start, r.stop)
def add(self,... |
"""Errors used on the Python opensocial client libraries."""
__author__ = '<EMAIL> (David Byttow)'
class Error(Exception):
"""Base opensocial.client error type."""
class ConfigError(Error):
"""Raised when the client has not been configured properly."""
class BadResponseError(Error):
"""Raised when the s... |
from __future__ import unicode_literals
from flask import session
from indico.core.db import db
from indico.modules.events.surveys import logger
from indico.modules.events.surveys.models.items import SurveyQuestion, SurveySection, SurveyText
def add_survey_question(section, field_cls, data):
"""Add a question t... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... |
"""
Slow tests for filtering systems
"""
import os
import tempfile
import shutil
from PySide2 import QtCore
from six.moves import range
from . import base
from ..gui import mainWindow
from ..system.lattice import Lattice
def path_to_file(path):
return os.path.join(os.path.dirname(__file__), "..", "..", "testin... |
"""Example code for
Service : CampaignTargetService
Operation: mutate (ADD)
API Reference: https://github.com/yahoojp-marketing/sponsored-search-api-documents/blob/201901/docs/en/api_reference/services/CampaignTargetService.md
Generated by 'api_reference_example_generator.py' using code template 'examples/sample_templ... |
"""The sia integration."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PORT
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from .const import DOMAIN, PLATFORMS
from .hub import SIAHub
async def async_setup_entry(hass... |
from collections import namedtuple
import datetime
import logging
import random
import sys
import hotmodel
ProcessOperation = namedtuple("ProcessOperation", [
"operation",
"act",
])
ProductOperation = namedtuple("ProductOperation", [
"operation",
"tm",
"workplace",
])
class Pr... |
"""Remove Cisco Nexus Monolithic Plugin
Revision ID: 1680e1f0c4dc
Revises: 3c346828361e
Create Date: 2014-08-31 08:58:37.123992
"""
# revision identifiers, used by Alembic.
revision = '1680e1f0c4dc'
down_revision = '3c346828361e'
from alembic import op
import sqlalchemy as sa
def upgrade(active_plugins=None, opti... |
from geopy import Point
from geopy.parsers.iso8601 import parse_iso8601
import sys, re
from xml.etree import ElementTree
class VersionError(Exception):
pass
class Waypoint(Point):
'''
A `Waypoint` is a geopy `Point` with additional waypoint metadata as
defined by the GPX format specification.
'''... |
import ctypes
import numpy
import OpenGL.GL as GL
class MenuItem(object):
pass
class TextButtonItem(MenuItem):
def __init__(self, x, y, h, text):
self.x, self.y, self.h = (x, y, h)
self.text = text
self.selected = False
def draw(self):
pass
class MenuScreen(object):
... |
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.db import model_base
from neutron.db import models_v2
class NetPartition(model_base.BASEV2, models_v2.HasId):
__tablename__ = 'nuage_net_partitions'
name = sa.Column(sa.String(64))
l3dom_tmplt_id = sa.Column(sa.String(36))
l2dom_tmplt_id... |
#!/home/dark/Exile/Git/AutoLavadox/maq_autolavadox/bin/python
#
# The Python Imaging Library
# $Id$
#
from __future__ import print_function
try:
from tkinter import *
except ImportError:
from Tkinter import *
from PIL import Image, ImageTk
import sys
# ------------------------------------------------------... |
import sys
#from tweet_sentiment import *
import json
def hw():
print ('Hello, world!')
def lines(fp):
print (str(len(fp.readlines())))
#print 'Lines in ', fp.name(), ':', str(len(fp.readlines()))
def calcscore(s_str, scores_dic):
twt_score_int = 0
#print s_str
for wd in s_str.split(' '):
... |
'''
FilesystemMonitor.py
Monitors the file system to keep track of files changes.
The idea is that we want to implement a version of this class
that uses the OS native FS monitoring API. Someday, will do this
but this code works well anywhere.
'''
import os
class FilesystemMonitor:
""" Main file monitori... |
#TODO update docstyle
from libraries import Leap
import sys
import logging
import threading
import Queue
import time
logger = logging.getLogger(name='MochaLogger')
class LeapFrames(threading.Thread):
def __init__(self, queueOut, hand):
super(LeapFrames, self).__init__()
logger.info("LeapMotion thread intialize... |
import requests
from PyQt5 import QtWidgets
class Window(QtWidgets.QWidget):
template = "http://127.0.0.1:{port}/pyblish/v0.1{endpoint}"
def __init__(self, port, parent=None):
super(Window, self).__init__(parent)
self.port = port
body = QtWidgets.QWidget()
sidebar = QtWidgets... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: mso_schema_template_external_epg_subnet
short_description: M... |
"""
Tests for sugestion views.
"""
from weblate.trans.models.unitdata import Suggestion
from weblate.trans.tests.test_views import ViewTestCase
class SuggestionsTest(ViewTestCase):
def add_suggestion_1(self):
return self.edit_unit(
'Hello, world!\n',
'Nazdar svete!\n',
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.utils.timezone import utc
from django.conf import settings
import datetime
class Migration(migrations.Migration):
dependencies = [
('votes', '0001_initial'),
]
operations = [
... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import re
def a_valid_tap(tap):
'''Returns True if the tap is valid.'''
regex = re.compile(r'^([\w-]+)/(homebrew-)?([\w-]+)$')
return regex.match(tap)
def already_tapped(mod... |
import setuptools
with open('VERSION.txt', 'r') as f:
version = f.read().strip()
setuptools.setup(
name="odoo8-addons-oca-l10n-spain",
description="Meta package for oca-l10n-spain Odoo addons",
version=version,
install_requires=[
'odoo8-addon-account_balance_reporting',
'odoo8-addo... |
"""This module only works as a central point for importing logging that outputs to stdout
"""
"""
Copyright (c) 2015, Are Hansen - Honeypot Development.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:... |
"""
Unit tests for the frontend code.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import logging
import ga4gh.datamodel as datamodel
import ga4gh.frontend as frontend
import ga4gh.protocol as protocol
import tests.utils as utils
c... |
import six
from os_vif import exception
from os_vif.tests import base
"""Mostly inspired by os-brick's tests."""
class VIFExceptionTestCase(base.TestCase):
def test_default_error_msg(self):
class FakeVIFException(exception.ExceptionBase):
msg_fmt = "default message"
exc = FakeVIFExc... |
"""
Functional tests to test the Bible Manager class and related methods.
"""
from unittest import TestCase
from openlp.core.common import Registry, Settings
from openlp.plugins.bibles.lib import BibleManager, LanguageSelection
from tests.interfaces import MagicMock, patch
from tests.utils.constants import TEST_RESOU... |
from openerp import models, api
from openerp.addons.sale_automatic_workflow.automatic_workflow_job import (
commit
)
class AutomaticWorkflowJob(models.Model):
_inherit = 'automatic.workflow.job'
@api.model
def _reconcile_invoices(self):
invoice_model = self.env['account.invoice']
for ... |
import glob
import docutils.core
import testtools
class TestTitles(testtools.TestCase):
def _get_title(self, section_tree):
section = {
'subtitles': [],
}
for node in section_tree:
if node.tagname == 'title':
section['name'] = node.rawsource
... |
"""
Dot Dash Plot
=============
This example shows how to make a dot-dash plot presented in Edward Tufte's book
Visual Display of Quantitative Information on page 133. This example is based
on https://bl.ocks.org/g3o2/bd4362574137061c243a2994ba648fb8.
"""
# category: scatter plots
import altair as alt
from vega_dataset... |
from itertools import cycle
import bpy
from mathutils import Vector
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode
try:
from mathutils.geometry import delaunay_2d_cdt as bl_delaunay
except ImportError:
print("Sv: The 'Delaunay 2D Cdt' node is not available ... |
"""ConditionalBijector Tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.distributions.python.ops.bijectors.conditional_bijector import ConditionalBijector
from tensorflow.python.framework import dtypes
from tensorflow.python... |
"""
Module implementing a model for zoom values management.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import Qt, QModelIndex, QAbstractTableModel
class ZoomValuesModel(QAbstractTableModel):
"""
Class implementing a model for zoom values management.
"""
def __init__(self, manager,... |
from itertools import chain
from operator import attrgetter
from robot.utils import setter, unic
from .itemlist import ItemList
from .message import Message, Messages
from .modelobject import ModelObject
from .tags import Tags
class Keyword(ModelObject):
"""Base model for single keyword."""
__slots__ = ['_n... |
import threading
import time
import copy
class ClientKeyValueStore(object):
def __init__(self):
self._rlock = threading.Lock()
self._wlock = threading.Lock()
self._cache = {}
#dict : {"key","value","status"} status could be deleted , expired
def write(self, key, value, ttl= -1... |
from boxbranding import getMachineBrand, getMachineName
from twisted.web import client
from twisted.internet import reactor, defer, ssl
class HTTPProgressDownloader(client.HTTPDownloader):
def __init__(self, url, outfile, headers=None):
client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="En... |
from random import shuffle
from collections import OrderedDict
from pydilemma.game_play import *
OUTLAST_THRESHOLD = 70
SURVIVE_THRESHOLD = 50
INITIAL_POPULATION = 50
def predicate(comparable):
def compare(player):
return player.score >= comparable
return compare
outlast = predicate(OUTLAST_THRESHO... |
from Analyser_Merge import Analyser_Merge, Source, CSV, Load, Mapping, Select, Generate
class Analyser_Merge_Hydrant_Point_CH_Lausanne(Analyser_Merge):
def __init__(self, config, logger = None):
self.missing_official = {"item":"8090", "class": 1, "level": 3, "tag": ["merge", "hydrant"], "desc": T_(u"Hydra... |
import os
import os.path as op
from flask import Flask, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.event import listens_for
from jinja2 import Markup
from flask.ext.admin import Admin, form
from flask.ext.admin.form import rules
from flask.ext.admin.contrib import sqla
# Create application... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import pytest
import betamax
import dataset
from scrapy.http import Request, HtmlResponse
from collectors.base import config, helpers
... |
import deform
import colander
from pyramid.view import view_config
from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS
from pontus.default_behavior import Cancel
from pontus.form import FormView
from pontus.schema import Schema
from pontus.widget import RadioChoiceWidget
from novaideo.content.processes... |
from urlparse import urlparse, urlunsplit
from django import forms
from django.contrib import admin
from .models import (Mirror, MirrorProtocol, MirrorUrl, MirrorRsync,
CheckLocation)
class MirrorUrlForm(forms.ModelForm):
class Meta:
model = MirrorUrl
fields = ('url', 'country', 'active'... |
from oslo_log import log as logging
from nova.i18n import _LI
from nova.scheduler import filters
LOG = logging.getLogger(__name__)
class RetryFilter(filters.BaseHostFilter):
"""Filter out nodes that have already been attempted for scheduling
purposes
"""
def host_passes(self, host_state, spec_obj):... |
from pychecker2.TestSupport import WarningTester
from pychecker2 import ClassChecks
class ClassTestCase(WarningTester):
def testClassChecks(self):
self.silent('class A:\n'
' def f(self):\n'
' return 0\n'
'class B(A):\n'
' ... |
"""
WSGI config for tylerlane project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SharedGlossary'
db.create_table(u'cmsplugin_cascade_share... |
import io
from datetime import timedelta
import pytest
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.core.management import call_command
from django.utils import timezone
from django_redis import get_redis_connection
from pytest_factoryboy import register as factory_register
from atmo.cl... |
'''
Created on 19 Feb 2014
@author: Panos
'''
import rpy2.robjects as robjects
from rpy2.robjects.packages import importr
import rpy2.rinterface
from rpy2.rinterface import RRuntimeError
MASS= importr('MASS')
#=============================================== Distribution Fitting =====================================... |
from django.db import models
import datetime
from django.utils import timezone
class Type(models.Model):
name = models.CharField(max_length=255, null=False, unique=True)
comment = models.TextField(blank=True)
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=T... |
from flask import Flask, render_template, session, request
from flask import jsonify
from auth import *
from tasks import *
app = Flask("Cut URL")
template_dir = 'templates'
@app.route("/", methods=["GET"])
# @authorized
def index():
return render_template('index.html')
@app.route('/login', methods=["GET"])
@no... |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
__version__ = '"0.3.0"'
scamurmur3 = Extension(
'scamurmur3',
sources=[
'scamurmur3/scamurmur3.c',
'scamurmur3/murmur3.c',
],
include_dirs=['./scamurmur3'],
define_ma... |
import copy
import itertools
from typing import (
Any,
Callable,
Dict,
FrozenSet,
Hashable,
Iterable,
Iterator,
List,
Sequence,
Tuple,
TypeVar,
)
T = TypeVar("T")
def safe_coerce_to_tuple(value: Any) -> Tuple[Any, ...]:
"""Convert value to a tuple, unless it is a strin... |
from utility import *
import tensorflow as tf
import numpy as np
from PIL import Image
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_integer("MINI_BATCH_SIZE", 16, "size of the mini-batch")
flags.DEFINE_integer("TEST_STEPS", 100, "amount of steps before testing")
flags.DEFINE_string("summaries_dir", "/tmp/NN... |
"""
Tests for items
"""
import sys
import traceback
import unittest
class TestItems(unittest.TestCase):
def setUp(self):
import logging
from PyQt4.QtGui import QApplication, QGraphicsScene, QGraphicsView, \
QPainter
from PyQt4.QtCore import QTimer
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Task 01"""
# Import Python libs
import unittest
# Import user libs
import task_01
class Task01TestCase(unittest.TestCase):
"""Test cases for Task 01"""
def test_elements(self):
"""Tests that ELEMENTS has the correct construction."""
expected... |
import pytest
from plenum.test.helper import view_change_timeout, perf_monitor_disabled
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.view_change_with_delays.helper import \
do_view_change_with_unaligned_prepare_certificates
@pytest.fixture(scope="module")
def tconf... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
try:
import ogr
import osr
except ImportError:
from osgeo import ogr, osr
shp_driver = ogr.GetDriverByName('ESRI Shapefile')
# input SpatialReference
input_srs = osr.SpatialReference()
input_srs.ImportFromEPSG(4326)
# output SpatialReference
out... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from platformcode import config, logger
from core import scrapertools
from core.item import Item
from core import servertools
from core import httptools
host = 'http://kingsizetits.com... |
from __future__ import print_function
# Corner Chess
import random
from pychess.Utils.const import *
from pychess.Utils.Board import Board
class CornerBoard(Board):
variant = CORNERCHESS
def __init__ (self, setup=False, lboard=None):
if setup is True:
Board.__init__(self, setup=self.shuf... |
"""
Django settings for demo project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... |
import re
import tarfile
from io import BytesIO, StringIO
from typing import Dict
from os.path import join, isdir, relpath
from os import walk
from django.template import Context
from django.template import Template
from nextcloudappstore.core.facades import resolve_file_relative_path
from nextcloudappstore.settings.... |
import mock
from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import constants
from neutron_lib.plugins.ml2 import api
from oslo_config import cfg
from neutron.conf.plugins.ml2.drivers.openvswitch import mech_ovs_co... |
import os
import signal
import sys
import traceback
from _pydev_bundle._pydev_calltip_util import get_description
from _pydev_bundle.pydev_imports import _queue
from _pydev_bundle.pydev_stdin import DebugConsoleStdIn
from _pydevd_bundle import pydevd_vars
# ===========================================================... |
from django.core.urlresolvers import reverse
from django import http
from mox3.mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
class QosSpecsTests(test.BaseAdminViewTests):
@test.create_stubs({api.cinder: ('qos_spec_get',), })
def test_manage_q... |
from spack import *
import sys
import shutil
class Graphviz(AutotoolsPackage):
"""Graph Visualization Software"""
homepage = 'http://www.graphviz.org'
url = 'http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz'
version('2.38.0', '5b6a829b2ac94efcd5fa3c223ed6d3ae')
# W... |
from google.net.proto import ProtocolBuffer
import array
import dummy_thread as thread
__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
unusednames=printElemNumber,debug_strs no-special"""
class StringProto(ProtocolBuffer.ProtocolMessage):
has_value_ = 0
value_ = ""
def __init__(sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
External inventory script for Scaleway
====================================
Shamelessly copied from an existing inventory script.
This script generates an inventory that Ansible can understand by making API requests to Scaleway API
Requires some python libraries, en... |
import os
import sys
import socket
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)))
from simple_host_target.definition import OP_HT_DATA_BEGIN, OP_HT_DATA_END,\
... |
#!/usr/bin/env python3
import unittest
from framework import VppTestCase, VppTestRunner
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
class TestSession(VppTestCase):
""" Session Test Case """
@classmethod
def setUpClass(cls):
super(TestSession, cls).setUpClass()
@classmetho... |
from typing import Optional
from pip._internal.models.format_control import FormatControl
class SelectionPreferences:
"""
Encapsulates the candidate selection preferences for downloading
and installing files.
"""
__slots__ = ['allow_yanked', 'allow_all_prereleases', 'format_control',
... |
from django.db import models
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailcore.blocks import CharBlock, RichTextBlock
from wagtail.wagtailadmin.edit_handlers import FieldPanel
class SimplePage(Page):
content = models.TextField()
content_pa... |
from corehq import Domain
from corehq.apps.commtrack.util import get_commtrack_location_id
from corehq.apps.locations.models import Location
from custom.m4change.constants import M4CHANGE_DOMAINS
from lxml import etree as ElementTree
def generator(user, version, last_sync):
if user.domain in M4CHANGE_DOMAINS:
... |
from FileParsers.Parser import Parser
class DpLog(Parser):
def __init__(self, file):
super(DpLog, self).__init__(file)
def metric_naming(self):
import re
stage = ""
denall = re.search(r'.*denall_reuse.*', self.file, re.I)
drcd = re.search(r'.*drcd.*', self.file, re.I)
... |
"""Fully vectorial finite-difference mode solver example."""
import EMpy
import pylab
mat1 = EMpy.materials.IsotropicMaterial(
'SiN',
n0=EMpy.materials.RefractiveIndex(n0_const=1.97))
mat2 = EMpy.materials.IsotropicMaterial(
'Si',
n0=EMpy.materials.RefractiveIndex(n0_const=3.4757))
l1 = EMpy.utils.La... |
from __future__ import unicode_literals
import frappe, json
from frappe.website.website_generator import WebsiteGenerator
from frappe import _
from frappe.utils.file_manager import save_file, remove_file_by_url
class WebForm(WebsiteGenerator):
website = frappe._dict(
template = "templates/generators/web_form.html",... |
#!/usr/bin/env python
"""Bootstrap setuptools installation
To use setuptools in your package's setup.py, include this
file in the same directory and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
To require a specific version of setuptools, set a download
mirror, ... |
from django import template
from django.conf import settings
from cred.icon import get_icon_data
register = template.Library()
@register.simple_tag
def cred_icon(iconname, txtfield=None, imgfield=None, tagid=None):
"""
Generates the HTML used to display an icon. If the icon cannot be found
it reverts to... |
import numpy as np
from functools import partial
from astropy.modeling.models import Ellipse2D
from spectral_cube import SpectralCube
from spectral_cube.lower_dimensional_structures import LowerDimensionalObject
try:
from radio_beam import Beam
_radio_beam_flag = True
except ImportError:
Warning("radio_bea... |
"""
This module is intended to allow easier build time configuration of Kolibri.
This is currently implemented by allowing additional build configuration options to be configured
through environment variables.
In order for these environment variables to propagate through to our docker build environment
we explicitly li... |
"""Gradients for operators defined in data_flow_ops.py."""
from tensorflow.python.framework import ops
from tensorflow.python.framework import types
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import constant_op
from tensorflow.python.ops import data_flow_ops
from tensorflow.python.ops impor... |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.te... |
"""SASLprep stringprep profile.
Normative reference:
- :RFC:`4013`__
"""
from __future__ import absolute_import, division
__docformat__ = "restructuredtext en"
import stringprep
from ..xmppstringprep import Profile, b1_mapping, c12_mapping, nfkc
SASLPREP = Profile(
unassigned = (stringprep.in_table_a1,),
... |
import pytest
from hpe_test_utils import OneViewBaseFactsTest
from oneview_module_loader import FcNetworkFactsModule
ERROR_MSG = 'Fake message error'
PARAMS_GET_ALL = dict(
config='config.json',
name=None
)
PARAMS_GET_BY_NAME = dict(
config='config.json',
name="Test FC Network"
)
PRESENT_NETWORKS =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.