code stringlengths 1 199k |
|---|
from django.core.management.base import BaseCommand
from ideascube.search.utils import reindex_content
class Command(BaseCommand):
help = 'Reindex all the searchable objects'
def handle(self, *args, **kwargs):
indexed = reindex_content()
for name, count in indexed.items():
if count:
... |
from odoo import api, fields, models
from datetime import datetime
from odoo.addons import decimal_precision as dp
from odoo.tools import float_compare, float_round
UNIT = dp.get_precision('Product Unit of Measure')
class StockWarehouseOrderpoint(models.Model):
_inherit = 'stock.warehouse.orderpoint'
procure_re... |
from . import test_stock_report_quantity_by_location |
"""
RSS/Atom feeds for the forum app.
"""
from django.core.urlresolvers import reverse_lazy
from django.contrib.syndication.views import Feed
from django.utils.feedgenerator import Atom1Feed
from django.utils.translation import ugettext_lazy as _
from .models import (Forum,
ForumThread,
... |
from aiohttp.web import HTTPBadRequest
from aiohttp.web import HTTPFound
from aiohttp.web import HTTPMethodNotAllowed
from aiohttp_babel.middlewares import _
import aiohttp_jinja2
from aiohttp_security import authorized_userid
from molb.auth import require
from molb.views.auth.email_form import EmailForm
from molb.view... |
import sys
import subprocess
print("D FRIENDLY LINKER INVOKED")
linker = "ldc2"
filteredCppLibrary = filter(lambda k: len(k) >= 2 and k[:2] == "-l", sys.argv)
filteredObjectFiles = filter(lambda k: len(k) >= 2 and k[-2:len(k)] == ".o", sys.argv)
passthroughLibraries = []
for iterationCppLibrary in filteredCppLibrary:... |
import account_tax
import account_invoice_tax |
from rest_framework import serializers
from sigma_core.importer import load_ressource
import re
GroupFieldValue = load_ressource("GroupFieldValue")
GroupField = load_ressource("GroupField")
class GroupFieldValueSerializer(serializers.ModelSerializer):
class Meta:
model = GroupFieldValue.model
read_o... |
{
'name': 'ESC/POS Hardware Driver',
'version': '1.0',
'category': 'Hardware Drivers',
'sequence': 6,
'website': 'https://www.odoo.com/page/point-of-sale',
'summary': 'Hardware Driver for ESC/POS Printers and Cashdrawers',
'description': """
ESC/POS Hardware Driver
=======================
Th... |
from odoo import fields, models
class ReportHotelRestaurantStatus(models.Model):
_name = "report.hotel.restaurant.status"
_description = "Reservation By State"
_auto = False
reservation_id = fields.Char('Reservation No', size=64, readonly=True)
nbr = fields.Integer('Reservatioorder_datan', readonly=... |
from django.contrib import admin
from .models import CreditCard
class CreditCardAdmin(admin.ModelAdmin):
exclude = ('credit_no', 'ccv')
readonly_fields = ('id', 'imp_credit_no', 'imp_ccv', 'owner',
'expire_date', 'customer')
def imp_credit_no(self, obj):
return "**** **** ****... |
"""add GroupMember table
Revision ID: 529e38736245
Revises: 27a8d9bcbd1b
Create Date: 2014-12-03 14:34:56.909429
"""
revision = '529e38736245'
down_revision = '27a8d9bcbd1b'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table(... |
from odoo import fields, models
class System(models.Model):
_name = "tmc.system"
_description = "System"
name = fields.Char() |
from .model import Model
from .fields import *
from .validators import * |
"""
The class to support ISO9660 Directory Records.
"""
from __future__ import absolute_import
import bisect
import struct
from pycdlib import dates
from pycdlib import inode
from pycdlib import pycdlibexception
from pycdlib import rockridge
from pycdlib import utils
if False: # pylint: disable=using-constant-test
... |
"""Test of table output."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("End"))
sequence.append(KeyComboAction("<Shift>Right"))
sequence.append(KeyComboAction("Down"))
sequence.append(KeyComboAction("Return"))
sequence.append(utils.StartRecordingAction())
seque... |
import sys
import os.path
import xml.dom.minidom
from getopt import gnu_getopt
from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \
get_docstring, xml_escape, get_deprecated
NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
class Generator(object):
def __init__(self, dom,... |
import os
import signal
import xapi
import image
import xapi.storage.api.volume
from xapi.storage.common import call
from xapi.storage import log
import pickle
import urlparse
blktap2_prefix = "/dev/xen/blktap-2/tapdev"
nbdclient_prefix = "/var/run/blktap-control/nbdclient"
nbdserver_prefix = "/var/run/blktap-control/n... |
import tempfile
import threading
import unittest
from dlg import exceptions
from dlg.manager import constants
from dlg.manager.client import NodeManagerClient, DataIslandManagerClient
from dlg.manager.node_manager import NodeManager
from dlg.manager.rest import NMRestServer, CompositeManagerRestServer
from dlg.restutil... |
"""
This module is meant to contain the lava log filtering functions.
These functions are used to filter out the content of the LAVA log when LAVA
callback is being processed.
Filtering functions should follow some rules:
- Name of the filtering function must start with `filter_`
- It can take only one argument which i... |
from __future__ import absolute_import
import sys
sys.path[:0] = ['../..'] |
from zope.interface import implements, Attribute
from flumotion.inhouse import log
from flumotion.transcoder.admin import interfaces
from flumotion.transcoder.admin.proxy import base
class IWorkerDefinition(interfaces.IAdminInterface):
def getName(self):
pass
def getWorkerContext(self):
pass
cla... |
import pytest
import webtest
from static import u
@pytest.fixture
def _cling():
from static import Cling
return Cling(root="testdata/pub")
@pytest.fixture
def _shock():
from static import Shock, StringMagic, KidMagic, GenshiMagic
magics = (StringMagic(title="String Test"),
KidMagic(title="... |
GL_CLIENT_EXECUTABLE = 'glclient'
GL_COLORMAP_DIR = 'colormaps'
GL_COLORMAP_RAINBOW2 = 'rainbow2'
GL_COLORMAP_HOT = 'hot'
GL_COLORMAP_GREY = 'grey'
GL_COLORMAP_REDHOT = 'redhot'
GL_DEFAULT_COLORMAP = 'colormaps/rainbow2'
GL_PORT = '9999'
import os
import sys
import tempfile
import logging
from PyQt4.Qt import Qt
from P... |
import unittest
import sys
from helper import adjust_filename
from PySide2.QtCore import QObject, QUrl, Slot, QTimer
from PySide2.QtGui import QGuiApplication
from PySide2.QtQml import QQmlIncubationController, VolatileBool
from PySide2.QtQuick import QQuickView
class CustomIncubationController(QObject, QQmlIncubationC... |
from pycp2k.inputsection import InputSection
class _xalpha3(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Section_parameters = None
self.Xa = None
self.Scale_x = None
self._name = "XALPHA"
self._keywords = {'Xa': 'XA', 'Scale_x': 'SCALE_X'}
... |
"""network_appdata
Revision ID: cec2b77ad85e
Revises: 1d3ab26415ec
Create Date: 2021-02-12 10:10:35.646470
"""
import logging
from alembic import op
import sqlalchemy as sa
log = logging.getLogger(__name__)
revision = 'cec2b77ad85e'
down_revision = '1d3ab26415ec'
branch_labels = None
depends_on = None
def upgrade():
... |
from OracleDatabase import OracleDatabase
from time import sleep
from itertools import product
import logging, string
from Tnscmd import Tnscmd
from Constants import *
from Utils import stringToLinePadded
class ServiceNameGuesser (OracleDatabase):
'''
Service Name guesser
'''
def __init__(self, args, serviceNameFil... |
for n in range(2, 100):
for x in range(2, n):
if n % x == 0:
print n, 'equals', x, '*', n/x
break
else:
# loop fell through without finding a factor
print n, 'is a prime number' |
"""
Config for the grok processes to be run
"""
from collectors.etc import yaml_conf
GROK_CONFIG = yaml_conf.load_collector_configuration('grok.yml')['collector']
GROK_EXPORTER_DIR = GROK_CONFIG['grok_exporter_dir']
if 'grok_exporter_debug' in GROK_CONFIG:
GROK_EXPORTER_DEBUG = GROK_CONFIG['grok_exporter_debug']
el... |
import flextls
from OpenSSL import SSL
def convert_version2method(protocol_version):
"""
Convert internal protocol version ID to OpenSSL method.
:param Integer protocol_version: Version ID
:return: OpenSSL method or None if not found
:rtype: OpenSSL method or None
"""
if protocol_version == ... |
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../")))
import time
import mysql.connector as mysql
from lib3.decorator.safe_run import safe_run_wrap
now = int(time.time())
today = int(now+8*3600)/86400*86400-8*3600
dayts = 86400
hourts = 3600
mints = 60
yesterday = today -... |
from __future__ import unicode_literals
from ast import literal_eval
from decimal import Decimal
import re
from weboob.browser.pages import LoggedPage, JsonPage, HTMLPage
from weboob.browser.elements import ItemElement, DictElement, method
from weboob.browser.filters.standard import Date, Eval, CleanText, Field, CleanD... |
from ajenti.com import *
from ajenti.api import *
from ajenti.utils import *
from ajenti.ui import UI
from ajenti import apis
import os
import time
class Daemons(Plugin):
def list_all(self):
r = []
if self.app.config.has_section('daemons'):
for n in self.app.config.options('daemons'):
... |
import socks
import socket
from urllib.request import urlopen
socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 1080)
socket.socket = socks.socksocket
print(urlopen("https://www.google.com").read()) |
import copy
import dolfin
import ffc
import ufl
from exceptions import *
from versions import *
__all__ = \
[
"QForm",
"apply_bcs",
"differentiate_expr",
"enforce_bcs",
"extract_test_and_trial",
"evaluate_expr",
"expand",
"expand_expr",
"expand_linear_solver_parameters",
"form_... |
'''Ethernet protocol decoder
'''
from __future__ import print_function, division
import ripyl
import ripyl.decode as decode
import ripyl.sigproc as sigp
import ripyl.streaming as stream
from ripyl.util.enum import Enum
from ripyl.util.bitops import split_bits, join_bits
from ripyl.manchester import manchester_encode, m... |
from django.urls import path, re_path, include, reverse
from django.utils.translation import gettext_lazy as _
from pytigon_lib.schviews import generic_table_start, gen_tab_action, gen_row_action
from django.views.generic import TemplateView
from . import views
urlpatterns = [
gen_row_action("Scripts", "run", views... |
import serial
import sys
BAUDRATE = 115200
PARITY = True
def configure_serial(serial_port):
return serial.Serial(
port=serial_port,
baudrate=BAUDRATE,
parity=serial.PARITY_EVEN if PARITY else serial.PARITY_NONE,
stopbits=serial.STOPBITS_TWO,
bytesize=serial.EIGHTBITS,
... |
r"""
Plotting module file for the "tictactoe" game. It defines the plotting functions.
Notes
-----
"""
import doctest
import unittest
from matplotlib.patches import Polygon, Rectangle, Wedge
from dstauffman2.games.tictactoe.constants import COLOR, PLAYER, SIZES
def plot_cur_move(ax, move):
r"""
Plots the piece... |
import copy, re
from tools.commons import enum, UsageError, OrderedDict
from tools.metadata import getArguments, getIterators
from tools.patterns import regexPatterns
from machinery.commons import conversionOptions, \
getSymbolAccessStringAndRemainder, \
implement, \
replaceEarlyExits
from symbol import DeclarationT... |
"""
GAVIP Example AVIS: Data Sharing AVI
Django models used by the AVI pipeline
"""
import datetime
from django.db import models
from pipeline.models import AviJob, AviJobRequest
class SharedDataModel(AviJob):
"""
This model is used to store the parameters for the AVI pipeline.
Notice that it contains ident... |
import ethtool
import glob
import os
NET_PATH = '/sys/class/net'
NIC_PATH = '/sys/class/net/*/device'
BRIDGE_PATH = '/sys/class/net/*/bridge'
BONDING_PATH = '/sys/class/net/*/bonding'
WLAN_PATH = '/sys/class/net/*/wireless'
NET_BRPORT = '/sys/class/net/%s/brport'
NET_MASTER = '/sys/class/net/%s/master'
NET_STATE = '/sy... |
from weboob.capabilities.housing import CapHousing, Housing, HousingPhoto
from weboob.tools.backend import Module
from .browser import SeLogerBrowser
__all__ = ['SeLogerModule']
class SeLogerModule(Module, CapHousing):
NAME = 'seloger'
MAINTAINER = u'Romain Bignon'
EMAIL = 'romain@weboob.org'
VERSION = ... |
"Demonstrating function evaluation at arbitrary points."
from __future__ import print_function
from dolfin import *
from numpy import array
mesh = UnitCubeMesh(8, 8, 8);
x = (0.31, 0.32, 0.33)
Vs = FunctionSpace(mesh, "CG", 2)
Vv = VectorFunctionSpace(mesh, "CG", 2)
fs = Expression("sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*... |
import shutil
import os
import hashlib
import psutil
import urllib.request
import tarfile
from getpass import getuser
from os import getenv, mkdir
from os.path import expanduser, dirname, isdir, isfile, islink, \
join, lexists, normpath, realpath, relpath
from subprocess import check_call, check_output, CalledProc... |
import mcl_platform.tasking
from tasking_dsz import *
_fw = mcl_platform.tasking.GetFramework()
if _fw == 'dsz':
RPC_INFO_STATUS = dsz.RPC_INFO_STATUS
RPC_INFO_GET_FILTER = dsz.RPC_INFO_GET_FILTER
RPC_INFO_VALIDATE_FILTER = dsz.RPC_INFO_VALIDATE_FILTER
RPC_INFO_SEND_CONTROL = dsz.RPC_INFO_SEND_CONTROL
e... |
print('Hello and by the way, what\'s your name?')
yourName = input()
print('So you say...what would be your password, if you are in fact the person who belongs here?')
password = input()
if yourName == 'Mary':
print('Hello Mary')
else:
print('Getouttahere')
if password == 'swordfish':
print('Access granted.... |
import eventlet
from eventlet import backdoor
import signal, code, traceback
import threading
DEBUG_BACKDOOR = True
DEBUG_SIGINT = False
debug_locals = {}
if DEBUG_BACKDOOR:
backdoor_th = threading.Thread(target=backdoor.backdoor_server, args=(eventlet.listen(('localhost', 3000)), debug_locals))
backdoor_th.dae... |
from netaddr import *
from datetime import datetime
import blescan
import time
import sys
import bluetooth._bluetooth as bluez
from Kitty import Kitty
from CheckKittys import CheckKittys
from BLESerialScanner import BLESerialScanner
import SendMail
import config
def process(mac, rssi):
found = False
for k in config.k... |
from tempfile import mkstemp
from shutil import move
import glob, os , os.path
def find(name, directory):
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(name):
return (root, file)
def findFiles(name, directory, parent):
foundFiles = []
fo... |
from relier.web.views import AuthenticatedView
from relier.models import Event
from flask import render_template, g, abort, redirect, request
class DeleteEvent(AuthenticatedView):
def get(self, event_id):
if not g.user.is_admin:
abort(403)
if Event.select().where(Event.id == event_id).co... |
""" Unit tests for `weblayer.bootstrap`.
"""
import unittest
try: # pragma: no cover
from mock import Mock
except: # pragma: no cover
pass
class TestInitBootstrapper(unittest.TestCase):
""" Test the logic of `Bootstrap.__init__`.
"""
def make_one(self, *args, **kwargs):
from weblayer.bootstr... |
from somecards import app
if __name__ == '__main__':
app.run(debug=True) |
def name():
alive = 1
while alive == 1:
print("Before you enter the game, please present identification.")
char_name = str(input("Enter your name now: "))
print("Is ", char_name, "your name? If so press 1. If not press 2.")
name_correct = int(input("Is it correct?:"))
if ... |
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'colorlog',
'docker==4.2.2',
'PyYAML',
'python-dateutil',
]
setup_requi... |
import time
import connexion
import anchore_engine.apis
import anchore_engine.common.helpers
import anchore_engine.configuration.localconfig
import anchore_engine.subsys.servicestatus
from anchore_engine.apis.authorization import INTERNAL_SERVICE_ALLOWED, get_authorizer
from anchore_engine.subsys import locking, logger... |
from .test_helper import argv_kiwi_tests
import mock
from mock import patch
from azurectl.account.service import AzureAccount
from azurectl.config.parser import Config
from collections import namedtuple
import azurectl
from pytest import raises
from azurectl.azurectl_exceptions import (
AzureConfigVariableNotFound,... |
from __future__ import unicode_literals
from io import StringIO
from mock import Mock, patch
import pytest
from flaky import flaky
from flaky import _flaky_plugin
from flaky.flaky_pytest_plugin import (
FlakyPlugin,
FlakyCallInfo,
FlakyXdist,
PLUGIN,
pytest_sessionfinish,
)
from flaky.names import F... |
import functools
import random
import eventlet
import netaddr
from neutron_lib import exceptions
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import timeutils
import ryu.app.ofctl.api as ofctl_api
import ryu.exception as ryu_exc
from ryu.lib import ofct... |
from os import listdir
from os.path import isfile, join
import random
import subprocess
def main():
# get random
failCount = 0
receiptDir = "receipts/"
receipts = [ f for f in listdir(receiptDir) if isfile(join(receiptDir, f))]
for i in range(5):
failCount += display_receipt(receiptDir + ran... |
"""Utilities related to layer/model functionality.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.utils.conv_utils import convert_kernel
from tensorflow.pyth... |
import mxnet as mx
import mxnext as X
from mxnext import dwconv, conv, relu6, add, global_avg_pool, sigmoid, to_fp16, to_fp32
from mxnext.backbone.resnet_v1b_helper import resnet_unit
from symbol.builder import Backbone
def _make_divisible(dividend, divisor):
if dividend % divisor == 0:
return dividend
... |
"""This example updates the given client buyer's status."""
import argparse
import os
import pprint
import sys
sys.path.insert(0, os.path.abspath('..'))
from googleapiclient.errors import HttpError
import samples_util
DEFAULT_ACCOUNT_ID = 'ENTER_ACCOUNT_ID_HERE'
DEFAULT_CLIENT_BUYER_ID = 'ENTER_CLIENT_BUYER_ID_HERE'
DE... |
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import Status.ttypes
import beeswaxd.ttypes
import cli_service.ttypes
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
... |
from cheetax.sql import Query
from cheetax.metadata import Column, SourceType, DataType, ExaDatatype, ExaSchemaType
from voluptuous import Schema, Required, All, Any, Range, Optional, ALLOW_EXTRA
from cheetax.logger import GLOBAL_LOGGER as logger
from cheetax.util import normalize_name
from cheetax import __staging_sch... |
from __future__ import print_function
import sys
import os
import tempfile
import subprocess
import random
import string
import glob
import struct
import atexit
import six
import pysam
from six.moves import urllib
from . import cbedtools
from . import settings
from . import filenames
from . import genome_registry
from ... |
import argparse
import datetime
from jflow.config_reader import JFlowConfigReader
def date(datestr):
try:
return datetime.datetime.strptime(datestr, JFlowConfigReader().get_date_format())
except:
raise argparse.ArgumentTypeError("'" + datestr + "' is an invalid date!") |
"""@package dewberry
@brief script that identifies the incorrect CSHORE output
This software is provided free of charge under the New BSD License. Please see
the following license information:
Copyright (c) 2014, Dewberry
All rights reserved.
Redistribution and use in source and binary forms, with or without
modificati... |
import collections
from senlin.common import exception as exc
from senlin.common.i18n import _
class BaseConstraint(collections.abc.Mapping):
KEYS = (
TYPE, CONSTRAINT,
) = (
'type', 'constraint',
)
def __str__(self):
"""Utility method for generating schema docs."""
retur... |
import logging
from cim.common import h
from cim.common import LoggingObject
from cim import CIM
from cim import is_index_page_number_valid
logging.basicConfig(level=logging.DEBUG)
g_logger = logging.getLogger("cim.grapher")
class Grapher(LoggingObject):
def __init__(self, cim):
super(Grapher, self).__init_... |
"""Simple setup script"""
import os
import subprocess
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension
abspath = os.path.dirname(os.path.realpath(__file__))
with open("requirements.txt") as f:
requirements = f.read().splitlines()
print(fin... |
import gnupg
import logging
import tempfile
import time
import urllib2
from ss2config import *
import selfserve.exceptions
logger = logging.getLogger("%s.lib.keys" % LOGGER_NAME)
HTTP_NOT_FOUND = 404
def fetch_key(availid):
try:
return urllib2.urlopen(KEY_FOR_AVAILID_URL % availid).read()
except urllib2.HTTPErr... |
class whrandom:
#
# Initialize an instance.
# Without arguments, initialize from current time.
# With arguments (x, y, z), initialize from them.
#
def __init__(self, x = 0, y = 0, z = 0):
self.seed(x, y, z)
#
# Set the seed from (x, y, z).
... |
import glob
import os
import sys
CR = b'\r'
CRLF = b'\r\n'
LF = b'\n'
def sanitycheck(pattern, allow_utf8 = False, allow_eol = (CRLF, LF), indent = 1):
error_count = 0
for filename in glob.glob(pattern, recursive=True):
if not os.path.isfile(filename):
continue
with open(filename, 'r... |
""" Make reference distribution over the range 1 to 100
Usage:
> cumulative_dist.dat
simeon@RottenApple ld4l-cul-usage>git mv cumulative_dist.dat reference_dist.dat
simeon@RottenApple ld4l-cul-usage>./make_reference_dist.py analysis/harvard_stackscore_distribution.dat > reference_dist.dat
simeon@RottenApple ld4l-cul-u... |
def is_palindrome(str):
if len(str) < 2:
return True
if ((str[0] == str[-1]) and is_palindrome(str[1:-1])):
return True
else:
return False |
import httplib
import copy
import socket
import random
import os
import logging
import threading
import sys
from time import sleep
if not sys.version.startswith('2.4'):
from urlparse import urlparse
else:
# python 2.4
from windmill.tools.urlparse_25 import urlparse
logger = logging.getLogger(__name__)
impor... |
"""The backups api."""
import webob
from webob import exc
from cinder.api import common
from cinder.api import extensions
from cinder.api.openstack import wsgi
from cinder.api.views import backups as backup_views
from cinder.api import xmlutil
from cinder import backup as backupAPI
from cinder import exception
from cin... |
import os
import mox
from nova import context
from nova import db
from nova.network import linux_net
from nova.openstack.common import cfg
from nova.openstack.common import fileutils
from nova.openstack.common import importutils
from nova.openstack.common import log as logging
from nova import test
from nova import uti... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kubern... |
from sublime_plugin import WindowCommand
from ..platformio.compile import Compile
class DeviotCompileSketchCommand(WindowCommand):
def run(self):
Compile() |
servoPin01 = 2
servoPin02 = 3
servoPin03 = 4
servoPin04 = 5
servoPin05 = 6
servoPin06 = 7
servo01Max = 180
servo01Min = 0
servo02Max = 180
servo02Min = 0
servo03Max = 180
servo03Min = 0
servo04Max = 180
servo04Min = 0
servo05Max = 180
servo05Min = 0
servo06Max = 180
servo06Min = 0
comPort = "COM9"
rHandAbrir_keyw = "ab... |
import os
class JVMNotFoundException(RuntimeError):
pass
class JVMFinder(object):
"""
JVM library finder base class
"""
def __init__(self):
"""
Sets up members
"""
# Library file name
self._libfile = "libjvm.so"
# Predefined locations
self._loc... |
"""Package Alias admin handler."""
import httplib
import json
from simian.mac import admin
from simian.mac import common
from simian.mac import models
from simian.mac.common import auth
class PackageAlias(admin.AdminHandler):
"""Handler for /admin/package_alias."""
@admin.AdminHandler.XsrfProtected('manifests_alias... |
import mmcv
import torch
from mmdet.models.dense_heads import GFLHead, LDHead
def test_ld_head_loss():
"""Tests vfnet head loss when truth is empty and non-empty."""
s = 256
img_metas = [{
'img_shape': (s, s, 3),
'scale_factor': 1,
'pad_shape': (s, s, 3)
}]
train_cfg = mmcv.C... |
import os
import six
import sys
import tempfile
from mock import patch, mock
from airflow import configuration as conf
from airflow.configuration import mkdir_p
from airflow.exceptions import AirflowConfigException
if six.PY2:
# Need `assertWarns` back-ported from unittest2
import unittest2 as unittest
else:
... |
import wx
ID_NEW = 1
ID_RENAME = 2
ID_CLEAR = 3
ID_DELETE = 4
class ListBox(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=(350, 220))
panel = wx.Panel(self, -1)
hbox = wx.BoxSizer(wx.HORIZONTAL)
self.listbox = wx.ListBox(panel, -1)
... |
'''
Copyright 2011 SRI International
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... |
from .common import random_str
from rancher import ApiError
from .conftest import wait_for
import time
import pytest
def test_workload_image_change_private_registry(admin_pc):
client = admin_pc.client
registry1_name = random_str()
registries = {'index.docker.io': {
'username': 'testuser',
... |
import mailbox
import os
print('Before:')
mbox = mailbox.Maildir('Example')
mbox.lock()
try:
for message_id, message in mbox.iteritems():
print('{:6} "{}"'.format(message.get_subdir(),
message['subject']))
message.set_subdir('cur')
# Tell the mailbox to updat... |
"""This example gets all proposal line items.
"""
from googleads import ad_manager
def main(client):
# Initialize appropriate service.
proposal_line_item_service = client.GetService(
'ProposalLineItemService', version='v202111')
# Create a statement to select proposal line items.
statement = ad_manager.St... |
__source__ = 'https://leetcode.com/problems/all-oone-data-structure/#/description'
import unittest
class Node(object):
"""
double linked list node
"""
def __init__(self, value, keys):
self.value = value
self.keys = keys
self.prev = None
self.next = None
class LinkedList(o... |
from itertools import ifilter
from cinderclient.v1 import client as cinder_client
from cinderclient import exceptions as cinder_exc
from cloudferrylib.base import storage
from cloudferrylib.os.identity import keystone
from cloudferrylib.os.storage import filters as cinder_filters
from cloudferrylib.utils import filters... |
"""
This bot uses the python library `unirest` which is not a
dependency of Zulip. To use this module, you will have to
install it in your local machine. In your terminal, enter
the following command:
$ sudo pip install unirest --upgrade
Note:
* You might have to use `pip3` if you are using python 3.
* The ... |
"""Example using opt_list with TF1.0."""
from absl import app
from opt_list import tf_opt_list
import tensorflow.compat.v1 as tf
tf.disable_eager_execution()
def main(_):
# Construct tensors representing a batch of data. For this example we use
# random data.
inp = tf.random.normal([512, 2]) / 4.
target = tf.ma... |
"""
Tests for filetolist.py
filetolist.py:
http://www.github.com/samjabrahams/anchorhub/lib/filetolist.py
"""
from anchorhub.lib.filetolist import FileToList
from anchorhub.util.getanchorhubpath import get_anchorhub_path
from anchorhub.compatibility import get_path_separator
def test_file_to_list_basic():
sep = get... |
import subutai
def subutaistart():
subutai.NewConfiguration("Tray Client")
subutai.SetConfigurationDesc("Tray Client", "Tray application is used to connect to your peers via SSH. Along with it a p2p client will be installed")
subutai.SetConfigurationFile("Tray Client", "tray_install_linux")
subutai.NewC... |
from jnpr.junos import Device
from jnpr.junos.cfg.resource import Resource
from jnpr.junos.utils.config import Config
from jinja2 import Template
class JunosDevice():
"""
JunosDevice
Args:
:host: string containing the host to connect to
:username: string containing the username to authentica... |
import logging
import netaddr
from tempest.api.orchestration import base
from tempest import clients
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest import test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class NeutronResourcesTestJSON(base.Bas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.