content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
class FakeSerial:
def __init__( self, port=None, baudrate = 19200, timeout=1,
bytesize = 8, parity = 'N', stopbits = 1, xonxoff=0,
rtscts = 0):
print("Port is ", port)
self.halfduplex = True
self.name = port
self.port = port
self.timeout = timeout
self.parity = parity
self.baudrate = baudrate
self.bytesize = bytesize
self.stopbits = stopbits
self.xonxoff = xonxoff
self.rtscts = rtscts
self._data = b'0000:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,00\r\n'
if isinstance(self.port, str):
self.port = open(self.port, "wb+")
def close(self):
pass
def flush(self):
self.port.flush()
def write(self, data):
written = self.port.write(data)
return written
def readline(self):
self.halfduplex = not self.halfduplex
if self.halfduplex:
return b"OK\r\n"
return self._data | class Fakeserial:
def __init__(self, port=None, baudrate=19200, timeout=1, bytesize=8, parity='N', stopbits=1, xonxoff=0, rtscts=0):
print('Port is ', port)
self.halfduplex = True
self.name = port
self.port = port
self.timeout = timeout
self.parity = parity
self.baudrate = baudrate
self.bytesize = bytesize
self.stopbits = stopbits
self.xonxoff = xonxoff
self.rtscts = rtscts
self._data = b'0000:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,00\r\n'
if isinstance(self.port, str):
self.port = open(self.port, 'wb+')
def close(self):
pass
def flush(self):
self.port.flush()
def write(self, data):
written = self.port.write(data)
return written
def readline(self):
self.halfduplex = not self.halfduplex
if self.halfduplex:
return b'OK\r\n'
return self._data |
"""
Recipes which illustrate augmentation of ORM SELECT behavior as used by
:meth:`_orm.Session.execute` with :term:`2.0 style` use of
:func:`_sql.select`, as well as the :term:`1.x style` :class:`_orm.Query`
object.
Examples include demonstrations of the :func:`_orm.with_loader_criteria`
option as well as the :meth:`_orm.SessionEvents.do_orm_execute` hook.
As of SQLAlchemy 1.4, the :class:`_orm.Query` construct is unified
with the :class:`_expression.Select` construct, so that these two objects
are mostly the same.
.. autosource::
""" # noqa
| """
Recipes which illustrate augmentation of ORM SELECT behavior as used by
:meth:`_orm.Session.execute` with :term:`2.0 style` use of
:func:`_sql.select`, as well as the :term:`1.x style` :class:`_orm.Query`
object.
Examples include demonstrations of the :func:`_orm.with_loader_criteria`
option as well as the :meth:`_orm.SessionEvents.do_orm_execute` hook.
As of SQLAlchemy 1.4, the :class:`_orm.Query` construct is unified
with the :class:`_expression.Select` construct, so that these two objects
are mostly the same.
.. autosource::
""" |
class CustomException(Exception):
def __init__(self, *args):
if args:
self.message = args[0]
else:
self.message = None
def get_str(self, class_name):
if self.message:
return '{0}, {1} '.format(self.message, class_name)
else:
return '{0} has been raised'.format(class_name)
class CommunicationChannelException(CustomException):
def __str__(self):
return super().get_str('CommunicationChannelException')
class MissingDataException(CustomException):
def __str__(self):
return super().get_str('MissingDataException')
class NoFormsException(CustomException):
def __str__(self):
return super().get_str('NoFormsException')
class NoPeersException(CustomException):
def __str__(self):
return super().get_str('NoPeersException')
class NotExistentEmployeeException(CustomException):
def __str__(self):
return super().get_str('NotExistentEmployeeException')
| class Customexception(Exception):
def __init__(self, *args):
if args:
self.message = args[0]
else:
self.message = None
def get_str(self, class_name):
if self.message:
return '{0}, {1} '.format(self.message, class_name)
else:
return '{0} has been raised'.format(class_name)
class Communicationchannelexception(CustomException):
def __str__(self):
return super().get_str('CommunicationChannelException')
class Missingdataexception(CustomException):
def __str__(self):
return super().get_str('MissingDataException')
class Noformsexception(CustomException):
def __str__(self):
return super().get_str('NoFormsException')
class Nopeersexception(CustomException):
def __str__(self):
return super().get_str('NoPeersException')
class Notexistentemployeeexception(CustomException):
def __str__(self):
return super().get_str('NotExistentEmployeeException') |
# Copyright 2014 Cloudera 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 or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Base identifiers
base_identifiers = [
'add',
'aggregate',
'all',
'alter',
'and',
'api_version',
'as',
'asc',
'avro',
'between',
'bigint',
'binary',
'boolean',
'by',
'cached',
'case',
'cast',
'change',
'char',
'class',
'close_fn',
'column',
'columns',
'comment',
'compute',
'create',
'cross',
'data',
'database',
'databases',
'date',
'datetime',
'decimal',
'delimited',
'desc',
'describe',
'distinct',
'div',
'double',
'drop',
'else',
'end',
'escaped',
'exists',
'explain',
'external',
'false',
'fields',
'fileformat',
'finalize_fn',
'first',
'float',
'format',
'formatted',
'from',
'full',
'function',
'functions',
'group',
'having',
'if',
'in',
'incremental',
'init_fn',
'inner',
'inpath',
'insert',
'int',
'integer',
'intermediate',
'interval',
'into',
'invalidate',
'is',
'join',
'last',
'left',
'like',
'limit',
'lines',
'load',
'location',
'merge_fn',
'metadata',
'not',
'null',
'nulls',
'offset',
'on',
'or',
'order',
'outer',
'overwrite',
'parquet',
'parquetfile',
'partition',
'partitioned',
'partitions',
'prepare_fn',
'produced',
'rcfile',
'real',
'refresh',
'regexp',
'rename',
'replace',
'returns',
'right',
'rlike',
'row',
'schema',
'schemas',
'select',
'semi',
'sequencefile',
'serdeproperties',
'serialize_fn',
'set',
'show',
'smallint',
'stats',
'stored',
'straight_join',
'string',
'symbol',
'table',
'tables',
'tblproperties',
'terminated',
'textfile',
'then',
'timestamp',
'tinyint',
'to',
'true',
'uncached',
'union',
'update_fn',
'use',
'using',
'values',
'view',
'when',
'where',
'with',
]
| base_identifiers = ['add', 'aggregate', 'all', 'alter', 'and', 'api_version', 'as', 'asc', 'avro', 'between', 'bigint', 'binary', 'boolean', 'by', 'cached', 'case', 'cast', 'change', 'char', 'class', 'close_fn', 'column', 'columns', 'comment', 'compute', 'create', 'cross', 'data', 'database', 'databases', 'date', 'datetime', 'decimal', 'delimited', 'desc', 'describe', 'distinct', 'div', 'double', 'drop', 'else', 'end', 'escaped', 'exists', 'explain', 'external', 'false', 'fields', 'fileformat', 'finalize_fn', 'first', 'float', 'format', 'formatted', 'from', 'full', 'function', 'functions', 'group', 'having', 'if', 'in', 'incremental', 'init_fn', 'inner', 'inpath', 'insert', 'int', 'integer', 'intermediate', 'interval', 'into', 'invalidate', 'is', 'join', 'last', 'left', 'like', 'limit', 'lines', 'load', 'location', 'merge_fn', 'metadata', 'not', 'null', 'nulls', 'offset', 'on', 'or', 'order', 'outer', 'overwrite', 'parquet', 'parquetfile', 'partition', 'partitioned', 'partitions', 'prepare_fn', 'produced', 'rcfile', 'real', 'refresh', 'regexp', 'rename', 'replace', 'returns', 'right', 'rlike', 'row', 'schema', 'schemas', 'select', 'semi', 'sequencefile', 'serdeproperties', 'serialize_fn', 'set', 'show', 'smallint', 'stats', 'stored', 'straight_join', 'string', 'symbol', 'table', 'tables', 'tblproperties', 'terminated', 'textfile', 'then', 'timestamp', 'tinyint', 'to', 'true', 'uncached', 'union', 'update_fn', 'use', 'using', 'values', 'view', 'when', 'where', 'with'] |
# -*- coding: utf-8 -*-
"""Top-level package for Grbl Link."""
__author__ = """Darius Montez"""
__email__ = 'darius.montez@gmail.com'
__version__ = '0.1.4'
| """Top-level package for Grbl Link."""
__author__ = 'Darius Montez'
__email__ = 'darius.montez@gmail.com'
__version__ = '0.1.4' |
H = {0: [0], 1: [1, 2, 4, 8], 2: [3, 5, 6, 9, 10], 3: [7, 11]}
M = {0: [0], 1: [1, 2, 4, 8, 16, 32], 2: [3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48],
3: [7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56],
4: [15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58], 5: [31, 47, 55, 59]}
class Solution:
def readBinaryWatch(self, num: int) -> List[str]:
result = []
for i in range(num + 1):
for h in H.get(i, []):
for m in M.get(num - i, []):
result.append('%d:%02d' % (h, m))
return result
| h = {0: [0], 1: [1, 2, 4, 8], 2: [3, 5, 6, 9, 10], 3: [7, 11]}
m = {0: [0], 1: [1, 2, 4, 8, 16, 32], 2: [3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48], 3: [7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56], 4: [15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58], 5: [31, 47, 55, 59]}
class Solution:
def read_binary_watch(self, num: int) -> List[str]:
result = []
for i in range(num + 1):
for h in H.get(i, []):
for m in M.get(num - i, []):
result.append('%d:%02d' % (h, m))
return result |
class SDCMeter(object):
"""Stores the SDCs probabilities"""
def __init__(self):
self.reset()
def updateAcc(self, acc1, acc5):
self.acc1 = acc1
self.acc5 = acc5
def updateGoldenData(self, scoreTensors):
for scores in scoreTensors.cpu().numpy():
self.goldenScoresAll.append(scores)
def updateFaultyData(self, scoreTensors):
for scores in scoreTensors.cpu().numpy():
self.faultyScoresAll.append(scores)
def updateGoldenBatchPred(self, predTensors):
self.goldenPred.append(predTensors)
def updateFaultyBatchPred(self, predTensors):
self.faultyPred.append(predTensors)
def updateGoldenBatchScore(self, scoreTensors):
self.goldenScores.append(scoreTensors)
def updateFaultyBatchScore(self, scoreTensors):
self.faultyScores.append(scoreTensors)
def calculteSDCs(self):
top1Sum = 0
top5Sum = 0
for goldenTensor, faultyTensor in zip(self.goldenPred, self.faultyPred):
correct = goldenTensor.ne(faultyTensor)
top1Sum += correct[:1].view(-1).int().sum(0, keepdim=True)
for goldenRow, faultyRow in zip(goldenTensor.t(), faultyTensor.t()):
if goldenRow[0] not in faultyRow:
top5Sum += 1
# calculate top1 and top5 SDCs by dividing sum to numBatches * batchSize
self.top1SDC = float(top1Sum[0]) / float(len(self.goldenPred) * len(self.goldenPred[0][0]))
self.top5SDC = float(top5Sum) / float(len(self.goldenPred) * len(self.goldenPred[0][0]))
self.top1SDC *= 100
self.top5SDC *= 100
def reset(self):
self.acc1 = 0
self.acc5 = 0
self.top1SDC = 0.0
self.top5SDC = 0.0
self.goldenPred = []
self.faultyPred = []
self.goldenScores = []
self.faultyScores = []
self.goldenScoresAll = []
self.faultyScoresAll = [] | class Sdcmeter(object):
"""Stores the SDCs probabilities"""
def __init__(self):
self.reset()
def update_acc(self, acc1, acc5):
self.acc1 = acc1
self.acc5 = acc5
def update_golden_data(self, scoreTensors):
for scores in scoreTensors.cpu().numpy():
self.goldenScoresAll.append(scores)
def update_faulty_data(self, scoreTensors):
for scores in scoreTensors.cpu().numpy():
self.faultyScoresAll.append(scores)
def update_golden_batch_pred(self, predTensors):
self.goldenPred.append(predTensors)
def update_faulty_batch_pred(self, predTensors):
self.faultyPred.append(predTensors)
def update_golden_batch_score(self, scoreTensors):
self.goldenScores.append(scoreTensors)
def update_faulty_batch_score(self, scoreTensors):
self.faultyScores.append(scoreTensors)
def calculte_sd_cs(self):
top1_sum = 0
top5_sum = 0
for (golden_tensor, faulty_tensor) in zip(self.goldenPred, self.faultyPred):
correct = goldenTensor.ne(faultyTensor)
top1_sum += correct[:1].view(-1).int().sum(0, keepdim=True)
for (golden_row, faulty_row) in zip(goldenTensor.t(), faultyTensor.t()):
if goldenRow[0] not in faultyRow:
top5_sum += 1
self.top1SDC = float(top1Sum[0]) / float(len(self.goldenPred) * len(self.goldenPred[0][0]))
self.top5SDC = float(top5Sum) / float(len(self.goldenPred) * len(self.goldenPred[0][0]))
self.top1SDC *= 100
self.top5SDC *= 100
def reset(self):
self.acc1 = 0
self.acc5 = 0
self.top1SDC = 0.0
self.top5SDC = 0.0
self.goldenPred = []
self.faultyPred = []
self.goldenScores = []
self.faultyScores = []
self.goldenScoresAll = []
self.faultyScoresAll = [] |
yusuke_power = {"Yusuke Urameshi": "Spirit Gun"}
hiei_power = {"Hiei": "Jagan Eye"}
powers = dict()
# Iteration
for dictionary in (yusuke_power, hiei_power):
for key, value in dictionary.items():
powers[key] = value
# Dictionary Comprehension
powers = {key: value for d in (yusuke_power, hiei_power) for key, value in d.items()}
# Copy and update
powers = yusuke_power.copy()
powers.update(hiei_power)
# Dictionary unpacking
powers = {**yusuke_power, **hiei_power}
| yusuke_power = {'Yusuke Urameshi': 'Spirit Gun'}
hiei_power = {'Hiei': 'Jagan Eye'}
powers = dict()
for dictionary in (yusuke_power, hiei_power):
for (key, value) in dictionary.items():
powers[key] = value
powers = {key: value for d in (yusuke_power, hiei_power) for (key, value) in d.items()}
powers = yusuke_power.copy()
powers.update(hiei_power)
powers = {**yusuke_power, **hiei_power} |
SIMPLE_QUEUE = 'simple'
WORK_QUEUE = 'work_queue'
RABBITMQ_HOST = '0.0.0.0'
LOG_EXCHANGE = 'logs'
ROUTING_EXCHANGE = 'direct_exchange'
TOPIC_EXCHANGE = 'topic_exchange'
SEVERITIES = ['err', 'info', 'debug']
FACILITIES = ['kern', 'mail', 'user', 'local0']
| simple_queue = 'simple'
work_queue = 'work_queue'
rabbitmq_host = '0.0.0.0'
log_exchange = 'logs'
routing_exchange = 'direct_exchange'
topic_exchange = 'topic_exchange'
severities = ['err', 'info', 'debug']
facilities = ['kern', 'mail', 'user', 'local0'] |
# triple nested exceptions
passed = 1
def f():
try:
foo()
passed = 0
except:
print("except 1")
try:
bar()
passed = 0
except:
print("except 2")
try:
baz()
passed = 0
except:
print("except 3")
bak()
passed = 0
try:
f()
passed = 0
except:
print("f except")
if (passed):
print("PASS")
else:
print("FAIL")
| passed = 1
def f():
try:
foo()
passed = 0
except:
print('except 1')
try:
bar()
passed = 0
except:
print('except 2')
try:
baz()
passed = 0
except:
print('except 3')
bak()
passed = 0
try:
f()
passed = 0
except:
print('f except')
if passed:
print('PASS')
else:
print('FAIL') |
"""
Take Home Project
1. Write a program for an e-commerce store. The program must accept
at least 10 products on the first run. The storekeeper should be given
the option to Add a product, remove a product, empty the product
catalog and close the program.
2. Create a membership system that allows users to register and login
after registration.
3. Write a budget for the United states of America for any 20 states of
your choice in tabular form with the following columns, index, State,
Allocation, Population, allocation per head\
"""
#================ Number 1==================
"""
1. Write a program for an e-commerce store. The program must accept
at least 10 products on the first run. The storekeeper should be given
the option to Add a product, remove a product, empty the product
catalog and close the program.
Code for Number 1
print("Welcome to Lizzy Autos")
catalog = []
isMoreProduct = "yes"
for i in range(4):
name_of_product = input("Enter Product:\t")
catalog.append(name_of_product)
while isMoreProduct == "yes":
isMoreProduct = input("Do you have more products to add?\t")
isMoreProduct = isMoreProduct.lower()
if isMoreProduct == "yes":
name_of_product = input("Enter Product:\t")
catalog.append(name_of_product)
else:
break
print("\n\nList of Products\n")
while True:
for x in catalog:
print(x)
print("")
print("1. Add a Product")
print("2. Remove a Product")
print("3. Clear The Catalog")
print("4. Quit")
print("")
option = int(input("Choose an Option\t"))
print("")
if option == 1:
name_of_product = input("Enter Product:\t")
catalog.append(name_of_product)
elif option == 2:
product_to_remove = int(input("Enter Product index:\t"))
catalog.pop(product_to_remove - 1)
elif option == 3:
catalog.clear()
elif option == 4:
break
else:
print("Invalid Input")
"""
#================ Number 2==================
"""
2. Create a membership system that allows users to register and login
after registration.
"""
#================Number 3================
"""
3. Write a budget for the United states of America for any 20 states of
your choice in tabular form with the following columns: State,
Allocation, Population, allocation per head\
"""
print("Welcome to the United States Data Center\n")
print("State\tAllocation($)\tPopulation(M)\tAllocation/Head($)\n")
print(f"California\t\t2\t\t3\t{round(2/3,3)}")
| """
Take Home Project
1. Write a program for an e-commerce store. The program must accept
at least 10 products on the first run. The storekeeper should be given
the option to Add a product, remove a product, empty the product
catalog and close the program.
2. Create a membership system that allows users to register and login
after registration.
3. Write a budget for the United states of America for any 20 states of
your choice in tabular form with the following columns, index, State,
Allocation, Population, allocation per head"""
'\n1. Write a program for an e-commerce store. The program must accept\nat least 10 products on the first run. The storekeeper should be given\nthe option to Add a product, remove a product, empty the product\ncatalog and close the program.\n\nCode for Number 1\nprint("Welcome to Lizzy Autos")\ncatalog = []\nisMoreProduct = "yes"\nfor i in range(4):\n name_of_product = input("Enter Product:\t")\n catalog.append(name_of_product)\n\nwhile isMoreProduct == "yes":\n isMoreProduct = input("Do you have more products to add?\t")\n isMoreProduct = isMoreProduct.lower()\n if isMoreProduct == "yes":\n name_of_product = input("Enter Product:\t")\n catalog.append(name_of_product)\n else:\n break\nprint("\n\nList of Products\n")\n\nwhile True:\n for x in catalog:\n print(x)\n print("")\n print("1. Add a Product")\n print("2. Remove a Product")\n print("3. Clear The Catalog")\n print("4. Quit")\n print("")\n option = int(input("Choose an Option\t"))\n print("")\n if option == 1:\n name_of_product = input("Enter Product:\t")\n catalog.append(name_of_product)\n elif option == 2:\n product_to_remove = int(input("Enter Product index:\t"))\n catalog.pop(product_to_remove - 1)\n elif option == 3:\n catalog.clear()\n elif option == 4:\n break\n else:\n print("Invalid Input")\n \n'
'\n2. Create a membership system that allows users to register and login\nafter registration.\n'
'\n3. Write a budget for the United states of America for any 20 states of\nyour choice in tabular form with the following columns: State,\nAllocation, Population, allocation per head'
print('Welcome to the United States Data Center\n')
print('State\tAllocation($)\tPopulation(M)\tAllocation/Head($)\n')
print(f'California\t\t2\t\t3\t{round(2 / 3, 3)}') |
uctable = [ [ 194, 178 ],
[ 194, 179 ],
[ 194, 185 ],
[ 194, 188 ],
[ 194, 189 ],
[ 194, 190 ],
[ 224, 167, 180 ],
[ 224, 167, 181 ],
[ 224, 167, 182 ],
[ 224, 167, 183 ],
[ 224, 167, 184 ],
[ 224, 167, 185 ],
[ 224, 173, 178 ],
[ 224, 173, 179 ],
[ 224, 173, 180 ],
[ 224, 173, 181 ],
[ 224, 173, 182 ],
[ 224, 173, 183 ],
[ 224, 175, 176 ],
[ 224, 175, 177 ],
[ 224, 175, 178 ],
[ 224, 177, 184 ],
[ 224, 177, 185 ],
[ 224, 177, 186 ],
[ 224, 177, 187 ],
[ 224, 177, 188 ],
[ 224, 177, 189 ],
[ 224, 177, 190 ],
[ 224, 181, 176 ],
[ 224, 181, 177 ],
[ 224, 181, 178 ],
[ 224, 181, 179 ],
[ 224, 181, 180 ],
[ 224, 181, 181 ],
[ 224, 188, 170 ],
[ 224, 188, 171 ],
[ 224, 188, 172 ],
[ 224, 188, 173 ],
[ 224, 188, 174 ],
[ 224, 188, 175 ],
[ 224, 188, 176 ],
[ 224, 188, 177 ],
[ 224, 188, 178 ],
[ 224, 188, 179 ],
[ 225, 141, 169 ],
[ 225, 141, 170 ],
[ 225, 141, 171 ],
[ 225, 141, 172 ],
[ 225, 141, 173 ],
[ 225, 141, 174 ],
[ 225, 141, 175 ],
[ 225, 141, 176 ],
[ 225, 141, 177 ],
[ 225, 141, 178 ],
[ 225, 141, 179 ],
[ 225, 141, 180 ],
[ 225, 141, 181 ],
[ 225, 141, 182 ],
[ 225, 141, 183 ],
[ 225, 141, 184 ],
[ 225, 141, 185 ],
[ 225, 141, 186 ],
[ 225, 141, 187 ],
[ 225, 141, 188 ],
[ 225, 159, 176 ],
[ 225, 159, 177 ],
[ 225, 159, 178 ],
[ 225, 159, 179 ],
[ 225, 159, 180 ],
[ 225, 159, 181 ],
[ 225, 159, 182 ],
[ 225, 159, 183 ],
[ 225, 159, 184 ],
[ 225, 159, 185 ],
[ 225, 167, 154 ],
[ 226, 129, 176 ],
[ 226, 129, 180 ],
[ 226, 129, 181 ],
[ 226, 129, 182 ],
[ 226, 129, 183 ],
[ 226, 129, 184 ],
[ 226, 129, 185 ],
[ 226, 130, 128 ],
[ 226, 130, 129 ],
[ 226, 130, 130 ],
[ 226, 130, 131 ],
[ 226, 130, 132 ],
[ 226, 130, 133 ],
[ 226, 130, 134 ],
[ 226, 130, 135 ],
[ 226, 130, 136 ],
[ 226, 130, 137 ],
[ 226, 133, 144 ],
[ 226, 133, 145 ],
[ 226, 133, 146 ],
[ 226, 133, 147 ],
[ 226, 133, 148 ],
[ 226, 133, 149 ],
[ 226, 133, 150 ],
[ 226, 133, 151 ],
[ 226, 133, 152 ],
[ 226, 133, 153 ],
[ 226, 133, 154 ],
[ 226, 133, 155 ],
[ 226, 133, 156 ],
[ 226, 133, 157 ],
[ 226, 133, 158 ],
[ 226, 133, 159 ],
[ 226, 134, 137 ],
[ 226, 145, 160 ],
[ 226, 145, 161 ],
[ 226, 145, 162 ],
[ 226, 145, 163 ],
[ 226, 145, 164 ],
[ 226, 145, 165 ],
[ 226, 145, 166 ],
[ 226, 145, 167 ],
[ 226, 145, 168 ],
[ 226, 145, 169 ],
[ 226, 145, 170 ],
[ 226, 145, 171 ],
[ 226, 145, 172 ],
[ 226, 145, 173 ],
[ 226, 145, 174 ],
[ 226, 145, 175 ],
[ 226, 145, 176 ],
[ 226, 145, 177 ],
[ 226, 145, 178 ],
[ 226, 145, 179 ],
[ 226, 145, 180 ],
[ 226, 145, 181 ],
[ 226, 145, 182 ],
[ 226, 145, 183 ],
[ 226, 145, 184 ],
[ 226, 145, 185 ],
[ 226, 145, 186 ],
[ 226, 145, 187 ],
[ 226, 145, 188 ],
[ 226, 145, 189 ],
[ 226, 145, 190 ],
[ 226, 145, 191 ],
[ 226, 146, 128 ],
[ 226, 146, 129 ],
[ 226, 146, 130 ],
[ 226, 146, 131 ],
[ 226, 146, 132 ],
[ 226, 146, 133 ],
[ 226, 146, 134 ],
[ 226, 146, 135 ],
[ 226, 146, 136 ],
[ 226, 146, 137 ],
[ 226, 146, 138 ],
[ 226, 146, 139 ],
[ 226, 146, 140 ],
[ 226, 146, 141 ],
[ 226, 146, 142 ],
[ 226, 146, 143 ],
[ 226, 146, 144 ],
[ 226, 146, 145 ],
[ 226, 146, 146 ],
[ 226, 146, 147 ],
[ 226, 146, 148 ],
[ 226, 146, 149 ],
[ 226, 146, 150 ],
[ 226, 146, 151 ],
[ 226, 146, 152 ],
[ 226, 146, 153 ],
[ 226, 146, 154 ],
[ 226, 146, 155 ],
[ 226, 147, 170 ],
[ 226, 147, 171 ],
[ 226, 147, 172 ],
[ 226, 147, 173 ],
[ 226, 147, 174 ],
[ 226, 147, 175 ],
[ 226, 147, 176 ],
[ 226, 147, 177 ],
[ 226, 147, 178 ],
[ 226, 147, 179 ],
[ 226, 147, 180 ],
[ 226, 147, 181 ],
[ 226, 147, 182 ],
[ 226, 147, 183 ],
[ 226, 147, 184 ],
[ 226, 147, 185 ],
[ 226, 147, 186 ],
[ 226, 147, 187 ],
[ 226, 147, 188 ],
[ 226, 147, 189 ],
[ 226, 147, 190 ],
[ 226, 147, 191 ],
[ 226, 157, 182 ],
[ 226, 157, 183 ],
[ 226, 157, 184 ],
[ 226, 157, 185 ],
[ 226, 157, 186 ],
[ 226, 157, 187 ],
[ 226, 157, 188 ],
[ 226, 157, 189 ],
[ 226, 157, 190 ],
[ 226, 157, 191 ],
[ 226, 158, 128 ],
[ 226, 158, 129 ],
[ 226, 158, 130 ],
[ 226, 158, 131 ],
[ 226, 158, 132 ],
[ 226, 158, 133 ],
[ 226, 158, 134 ],
[ 226, 158, 135 ],
[ 226, 158, 136 ],
[ 226, 158, 137 ],
[ 226, 158, 138 ],
[ 226, 158, 139 ],
[ 226, 158, 140 ],
[ 226, 158, 141 ],
[ 226, 158, 142 ],
[ 226, 158, 143 ],
[ 226, 158, 144 ],
[ 226, 158, 145 ],
[ 226, 158, 146 ],
[ 226, 158, 147 ],
[ 226, 179, 189 ],
[ 227, 134, 146 ],
[ 227, 134, 147 ],
[ 227, 134, 148 ],
[ 227, 134, 149 ],
[ 227, 136, 160 ],
[ 227, 136, 161 ],
[ 227, 136, 162 ],
[ 227, 136, 163 ],
[ 227, 136, 164 ],
[ 227, 136, 165 ],
[ 227, 136, 166 ],
[ 227, 136, 167 ],
[ 227, 136, 168 ],
[ 227, 136, 169 ],
[ 227, 137, 136 ],
[ 227, 137, 137 ],
[ 227, 137, 138 ],
[ 227, 137, 139 ],
[ 227, 137, 140 ],
[ 227, 137, 141 ],
[ 227, 137, 142 ],
[ 227, 137, 143 ],
[ 227, 137, 145 ],
[ 227, 137, 146 ],
[ 227, 137, 147 ],
[ 227, 137, 148 ],
[ 227, 137, 149 ],
[ 227, 137, 150 ],
[ 227, 137, 151 ],
[ 227, 137, 152 ],
[ 227, 137, 153 ],
[ 227, 137, 154 ],
[ 227, 137, 155 ],
[ 227, 137, 156 ],
[ 227, 137, 157 ],
[ 227, 137, 158 ],
[ 227, 137, 159 ],
[ 227, 138, 128 ],
[ 227, 138, 129 ],
[ 227, 138, 130 ],
[ 227, 138, 131 ],
[ 227, 138, 132 ],
[ 227, 138, 133 ],
[ 227, 138, 134 ],
[ 227, 138, 135 ],
[ 227, 138, 136 ],
[ 227, 138, 137 ],
[ 227, 138, 177 ],
[ 227, 138, 178 ],
[ 227, 138, 179 ],
[ 227, 138, 180 ],
[ 227, 138, 181 ],
[ 227, 138, 182 ],
[ 227, 138, 183 ],
[ 227, 138, 184 ],
[ 227, 138, 185 ],
[ 227, 138, 186 ],
[ 227, 138, 187 ],
[ 227, 138, 188 ],
[ 227, 138, 189 ],
[ 227, 138, 190 ],
[ 227, 138, 191 ],
[ 234, 160, 176 ],
[ 234, 160, 177 ],
[ 234, 160, 178 ],
[ 234, 160, 179 ],
[ 234, 160, 180 ],
[ 234, 160, 181 ],
[ 240, 144, 132, 135 ],
[ 240, 144, 132, 136 ],
[ 240, 144, 132, 137 ],
[ 240, 144, 132, 138 ],
[ 240, 144, 132, 139 ],
[ 240, 144, 132, 140 ],
[ 240, 144, 132, 141 ],
[ 240, 144, 132, 142 ],
[ 240, 144, 132, 143 ],
[ 240, 144, 132, 144 ],
[ 240, 144, 132, 145 ],
[ 240, 144, 132, 146 ],
[ 240, 144, 132, 147 ],
[ 240, 144, 132, 148 ],
[ 240, 144, 132, 149 ],
[ 240, 144, 132, 150 ],
[ 240, 144, 132, 151 ],
[ 240, 144, 132, 152 ],
[ 240, 144, 132, 153 ],
[ 240, 144, 132, 154 ],
[ 240, 144, 132, 155 ],
[ 240, 144, 132, 156 ],
[ 240, 144, 132, 157 ],
[ 240, 144, 132, 158 ],
[ 240, 144, 132, 159 ],
[ 240, 144, 132, 160 ],
[ 240, 144, 132, 161 ],
[ 240, 144, 132, 162 ],
[ 240, 144, 132, 163 ],
[ 240, 144, 132, 164 ],
[ 240, 144, 132, 165 ],
[ 240, 144, 132, 166 ],
[ 240, 144, 132, 167 ],
[ 240, 144, 132, 168 ],
[ 240, 144, 132, 169 ],
[ 240, 144, 132, 170 ],
[ 240, 144, 132, 171 ],
[ 240, 144, 132, 172 ],
[ 240, 144, 132, 173 ],
[ 240, 144, 132, 174 ],
[ 240, 144, 132, 175 ],
[ 240, 144, 132, 176 ],
[ 240, 144, 132, 177 ],
[ 240, 144, 132, 178 ],
[ 240, 144, 132, 179 ],
[ 240, 144, 133, 181 ],
[ 240, 144, 133, 182 ],
[ 240, 144, 133, 183 ],
[ 240, 144, 133, 184 ],
[ 240, 144, 134, 138 ],
[ 240, 144, 134, 139 ],
[ 240, 144, 139, 161 ],
[ 240, 144, 139, 162 ],
[ 240, 144, 139, 163 ],
[ 240, 144, 139, 164 ],
[ 240, 144, 139, 165 ],
[ 240, 144, 139, 166 ],
[ 240, 144, 139, 167 ],
[ 240, 144, 139, 168 ],
[ 240, 144, 139, 169 ],
[ 240, 144, 139, 170 ],
[ 240, 144, 139, 171 ],
[ 240, 144, 139, 172 ],
[ 240, 144, 139, 173 ],
[ 240, 144, 139, 174 ],
[ 240, 144, 139, 175 ],
[ 240, 144, 139, 176 ],
[ 240, 144, 139, 177 ],
[ 240, 144, 139, 178 ],
[ 240, 144, 139, 179 ],
[ 240, 144, 139, 180 ],
[ 240, 144, 139, 181 ],
[ 240, 144, 139, 182 ],
[ 240, 144, 139, 183 ],
[ 240, 144, 139, 184 ],
[ 240, 144, 139, 185 ],
[ 240, 144, 139, 186 ],
[ 240, 144, 139, 187 ],
[ 240, 144, 140, 160 ],
[ 240, 144, 140, 161 ],
[ 240, 144, 140, 162 ],
[ 240, 144, 140, 163 ],
[ 240, 144, 161, 152 ],
[ 240, 144, 161, 153 ],
[ 240, 144, 161, 154 ],
[ 240, 144, 161, 155 ],
[ 240, 144, 161, 156 ],
[ 240, 144, 161, 157 ],
[ 240, 144, 161, 158 ],
[ 240, 144, 161, 159 ],
[ 240, 144, 161, 185 ],
[ 240, 144, 161, 186 ],
[ 240, 144, 161, 187 ],
[ 240, 144, 161, 188 ],
[ 240, 144, 161, 189 ],
[ 240, 144, 161, 190 ],
[ 240, 144, 161, 191 ],
[ 240, 144, 162, 167 ],
[ 240, 144, 162, 168 ],
[ 240, 144, 162, 169 ],
[ 240, 144, 162, 170 ],
[ 240, 144, 162, 171 ],
[ 240, 144, 162, 172 ],
[ 240, 144, 162, 173 ],
[ 240, 144, 162, 174 ],
[ 240, 144, 162, 175 ],
[ 240, 144, 163, 187 ],
[ 240, 144, 163, 188 ],
[ 240, 144, 163, 189 ],
[ 240, 144, 163, 190 ],
[ 240, 144, 163, 191 ],
[ 240, 144, 164, 150 ],
[ 240, 144, 164, 151 ],
[ 240, 144, 164, 152 ],
[ 240, 144, 164, 153 ],
[ 240, 144, 164, 154 ],
[ 240, 144, 164, 155 ],
[ 240, 144, 166, 188 ],
[ 240, 144, 166, 189 ],
[ 240, 144, 167, 128 ],
[ 240, 144, 167, 129 ],
[ 240, 144, 167, 130 ],
[ 240, 144, 167, 131 ],
[ 240, 144, 167, 132 ],
[ 240, 144, 167, 133 ],
[ 240, 144, 167, 134 ],
[ 240, 144, 167, 135 ],
[ 240, 144, 167, 136 ],
[ 240, 144, 167, 137 ],
[ 240, 144, 167, 138 ],
[ 240, 144, 167, 139 ],
[ 240, 144, 167, 140 ],
[ 240, 144, 167, 141 ],
[ 240, 144, 167, 142 ],
[ 240, 144, 167, 143 ],
[ 240, 144, 167, 146 ],
[ 240, 144, 167, 147 ],
[ 240, 144, 167, 148 ],
[ 240, 144, 167, 149 ],
[ 240, 144, 167, 150 ],
[ 240, 144, 167, 151 ],
[ 240, 144, 167, 152 ],
[ 240, 144, 167, 153 ],
[ 240, 144, 167, 154 ],
[ 240, 144, 167, 155 ],
[ 240, 144, 167, 156 ],
[ 240, 144, 167, 157 ],
[ 240, 144, 167, 158 ],
[ 240, 144, 167, 159 ],
[ 240, 144, 167, 160 ],
[ 240, 144, 167, 161 ],
[ 240, 144, 167, 162 ],
[ 240, 144, 167, 163 ],
[ 240, 144, 167, 164 ],
[ 240, 144, 167, 165 ],
[ 240, 144, 167, 166 ],
[ 240, 144, 167, 167 ],
[ 240, 144, 167, 168 ],
[ 240, 144, 167, 169 ],
[ 240, 144, 167, 170 ],
[ 240, 144, 167, 171 ],
[ 240, 144, 167, 172 ],
[ 240, 144, 167, 173 ],
[ 240, 144, 167, 174 ],
[ 240, 144, 167, 175 ],
[ 240, 144, 167, 176 ],
[ 240, 144, 167, 177 ],
[ 240, 144, 167, 178 ],
[ 240, 144, 167, 179 ],
[ 240, 144, 167, 180 ],
[ 240, 144, 167, 181 ],
[ 240, 144, 167, 182 ],
[ 240, 144, 167, 183 ],
[ 240, 144, 167, 184 ],
[ 240, 144, 167, 185 ],
[ 240, 144, 167, 186 ],
[ 240, 144, 167, 187 ],
[ 240, 144, 167, 188 ],
[ 240, 144, 167, 189 ],
[ 240, 144, 167, 190 ],
[ 240, 144, 167, 191 ],
[ 240, 144, 169, 128 ],
[ 240, 144, 169, 129 ],
[ 240, 144, 169, 130 ],
[ 240, 144, 169, 131 ],
[ 240, 144, 169, 132 ],
[ 240, 144, 169, 133 ],
[ 240, 144, 169, 134 ],
[ 240, 144, 169, 135 ],
[ 240, 144, 169, 189 ],
[ 240, 144, 169, 190 ],
[ 240, 144, 170, 157 ],
[ 240, 144, 170, 158 ],
[ 240, 144, 170, 159 ],
[ 240, 144, 171, 171 ],
[ 240, 144, 171, 172 ],
[ 240, 144, 171, 173 ],
[ 240, 144, 171, 174 ],
[ 240, 144, 171, 175 ],
[ 240, 144, 173, 152 ],
[ 240, 144, 173, 153 ],
[ 240, 144, 173, 154 ],
[ 240, 144, 173, 155 ],
[ 240, 144, 173, 156 ],
[ 240, 144, 173, 157 ],
[ 240, 144, 173, 158 ],
[ 240, 144, 173, 159 ],
[ 240, 144, 173, 184 ],
[ 240, 144, 173, 185 ],
[ 240, 144, 173, 186 ],
[ 240, 144, 173, 187 ],
[ 240, 144, 173, 188 ],
[ 240, 144, 173, 189 ],
[ 240, 144, 173, 190 ],
[ 240, 144, 173, 191 ],
[ 240, 144, 174, 169 ],
[ 240, 144, 174, 170 ],
[ 240, 144, 174, 171 ],
[ 240, 144, 174, 172 ],
[ 240, 144, 174, 173 ],
[ 240, 144, 174, 174 ],
[ 240, 144, 174, 175 ],
[ 240, 144, 179, 186 ],
[ 240, 144, 179, 187 ],
[ 240, 144, 179, 188 ],
[ 240, 144, 179, 189 ],
[ 240, 144, 179, 190 ],
[ 240, 144, 179, 191 ],
[ 240, 144, 185, 160 ],
[ 240, 144, 185, 161 ],
[ 240, 144, 185, 162 ],
[ 240, 144, 185, 163 ],
[ 240, 144, 185, 164 ],
[ 240, 144, 185, 165 ],
[ 240, 144, 185, 166 ],
[ 240, 144, 185, 167 ],
[ 240, 144, 185, 168 ],
[ 240, 144, 185, 169 ],
[ 240, 144, 185, 170 ],
[ 240, 144, 185, 171 ],
[ 240, 144, 185, 172 ],
[ 240, 144, 185, 173 ],
[ 240, 144, 185, 174 ],
[ 240, 144, 185, 175 ],
[ 240, 144, 185, 176 ],
[ 240, 144, 185, 177 ],
[ 240, 144, 185, 178 ],
[ 240, 144, 185, 179 ],
[ 240, 144, 185, 180 ],
[ 240, 144, 185, 181 ],
[ 240, 144, 185, 182 ],
[ 240, 144, 185, 183 ],
[ 240, 144, 185, 184 ],
[ 240, 144, 185, 185 ],
[ 240, 144, 185, 186 ],
[ 240, 144, 185, 187 ],
[ 240, 144, 185, 188 ],
[ 240, 144, 185, 189 ],
[ 240, 144, 185, 190 ],
[ 240, 145, 129, 146 ],
[ 240, 145, 129, 147 ],
[ 240, 145, 129, 148 ],
[ 240, 145, 129, 149 ],
[ 240, 145, 129, 150 ],
[ 240, 145, 129, 151 ],
[ 240, 145, 129, 152 ],
[ 240, 145, 129, 153 ],
[ 240, 145, 129, 154 ],
[ 240, 145, 129, 155 ],
[ 240, 145, 129, 156 ],
[ 240, 145, 129, 157 ],
[ 240, 145, 129, 158 ],
[ 240, 145, 129, 159 ],
[ 240, 145, 129, 160 ],
[ 240, 145, 129, 161 ],
[ 240, 145, 129, 162 ],
[ 240, 145, 129, 163 ],
[ 240, 145, 129, 164 ],
[ 240, 145, 129, 165 ],
[ 240, 145, 135, 161 ],
[ 240, 145, 135, 162 ],
[ 240, 145, 135, 163 ],
[ 240, 145, 135, 164 ],
[ 240, 145, 135, 165 ],
[ 240, 145, 135, 166 ],
[ 240, 145, 135, 167 ],
[ 240, 145, 135, 168 ],
[ 240, 145, 135, 169 ],
[ 240, 145, 135, 170 ],
[ 240, 145, 135, 171 ],
[ 240, 145, 135, 172 ],
[ 240, 145, 135, 173 ],
[ 240, 145, 135, 174 ],
[ 240, 145, 135, 175 ],
[ 240, 145, 135, 176 ],
[ 240, 145, 135, 177 ],
[ 240, 145, 135, 178 ],
[ 240, 145, 135, 179 ],
[ 240, 145, 135, 180 ],
[ 240, 145, 156, 186 ],
[ 240, 145, 156, 187 ],
[ 240, 145, 163, 170 ],
[ 240, 145, 163, 171 ],
[ 240, 145, 163, 172 ],
[ 240, 145, 163, 173 ],
[ 240, 145, 163, 174 ],
[ 240, 145, 163, 175 ],
[ 240, 145, 163, 176 ],
[ 240, 145, 163, 177 ],
[ 240, 145, 163, 178 ],
[ 240, 150, 173, 155 ],
[ 240, 150, 173, 156 ],
[ 240, 150, 173, 157 ],
[ 240, 150, 173, 158 ],
[ 240, 150, 173, 159 ],
[ 240, 150, 173, 160 ],
[ 240, 150, 173, 161 ],
[ 240, 157, 141, 160 ],
[ 240, 157, 141, 161 ],
[ 240, 157, 141, 162 ],
[ 240, 157, 141, 163 ],
[ 240, 157, 141, 164 ],
[ 240, 157, 141, 165 ],
[ 240, 157, 141, 166 ],
[ 240, 157, 141, 167 ],
[ 240, 157, 141, 168 ],
[ 240, 157, 141, 169 ],
[ 240, 157, 141, 170 ],
[ 240, 157, 141, 171 ],
[ 240, 157, 141, 172 ],
[ 240, 157, 141, 173 ],
[ 240, 157, 141, 174 ],
[ 240, 157, 141, 175 ],
[ 240, 157, 141, 176 ],
[ 240, 157, 141, 177 ],
[ 240, 158, 163, 135 ],
[ 240, 158, 163, 136 ],
[ 240, 158, 163, 137 ],
[ 240, 158, 163, 138 ],
[ 240, 158, 163, 139 ],
[ 240, 158, 163, 140 ],
[ 240, 158, 163, 141 ],
[ 240, 158, 163, 142 ],
[ 240, 158, 163, 143 ],
[ 240, 159, 132, 128 ],
[ 240, 159, 132, 129 ],
[ 240, 159, 132, 130 ],
[ 240, 159, 132, 131 ],
[ 240, 159, 132, 132 ],
[ 240, 159, 132, 133 ],
[ 240, 159, 132, 134 ],
[ 240, 159, 132, 135 ],
[ 240, 159, 132, 136 ],
[ 240, 159, 132, 137 ],
[ 240, 159, 132, 138 ],
[ 240, 159, 132, 139 ],
[ 240, 159, 132, 140 ] ]
| uctable = [[194, 178], [194, 179], [194, 185], [194, 188], [194, 189], [194, 190], [224, 167, 180], [224, 167, 181], [224, 167, 182], [224, 167, 183], [224, 167, 184], [224, 167, 185], [224, 173, 178], [224, 173, 179], [224, 173, 180], [224, 173, 181], [224, 173, 182], [224, 173, 183], [224, 175, 176], [224, 175, 177], [224, 175, 178], [224, 177, 184], [224, 177, 185], [224, 177, 186], [224, 177, 187], [224, 177, 188], [224, 177, 189], [224, 177, 190], [224, 181, 176], [224, 181, 177], [224, 181, 178], [224, 181, 179], [224, 181, 180], [224, 181, 181], [224, 188, 170], [224, 188, 171], [224, 188, 172], [224, 188, 173], [224, 188, 174], [224, 188, 175], [224, 188, 176], [224, 188, 177], [224, 188, 178], [224, 188, 179], [225, 141, 169], [225, 141, 170], [225, 141, 171], [225, 141, 172], [225, 141, 173], [225, 141, 174], [225, 141, 175], [225, 141, 176], [225, 141, 177], [225, 141, 178], [225, 141, 179], [225, 141, 180], [225, 141, 181], [225, 141, 182], [225, 141, 183], [225, 141, 184], [225, 141, 185], [225, 141, 186], [225, 141, 187], [225, 141, 188], [225, 159, 176], [225, 159, 177], [225, 159, 178], [225, 159, 179], [225, 159, 180], [225, 159, 181], [225, 159, 182], [225, 159, 183], [225, 159, 184], [225, 159, 185], [225, 167, 154], [226, 129, 176], [226, 129, 180], [226, 129, 181], [226, 129, 182], [226, 129, 183], [226, 129, 184], [226, 129, 185], [226, 130, 128], [226, 130, 129], [226, 130, 130], [226, 130, 131], [226, 130, 132], [226, 130, 133], [226, 130, 134], [226, 130, 135], [226, 130, 136], [226, 130, 137], [226, 133, 144], [226, 133, 145], [226, 133, 146], [226, 133, 147], [226, 133, 148], [226, 133, 149], [226, 133, 150], [226, 133, 151], [226, 133, 152], [226, 133, 153], [226, 133, 154], [226, 133, 155], [226, 133, 156], [226, 133, 157], [226, 133, 158], [226, 133, 159], [226, 134, 137], [226, 145, 160], [226, 145, 161], [226, 145, 162], [226, 145, 163], [226, 145, 164], [226, 145, 165], [226, 145, 166], [226, 145, 167], [226, 145, 168], [226, 145, 169], [226, 145, 170], [226, 145, 171], [226, 145, 172], [226, 145, 173], [226, 145, 174], [226, 145, 175], [226, 145, 176], [226, 145, 177], [226, 145, 178], [226, 145, 179], [226, 145, 180], [226, 145, 181], [226, 145, 182], [226, 145, 183], [226, 145, 184], [226, 145, 185], [226, 145, 186], [226, 145, 187], [226, 145, 188], [226, 145, 189], [226, 145, 190], [226, 145, 191], [226, 146, 128], [226, 146, 129], [226, 146, 130], [226, 146, 131], [226, 146, 132], [226, 146, 133], [226, 146, 134], [226, 146, 135], [226, 146, 136], [226, 146, 137], [226, 146, 138], [226, 146, 139], [226, 146, 140], [226, 146, 141], [226, 146, 142], [226, 146, 143], [226, 146, 144], [226, 146, 145], [226, 146, 146], [226, 146, 147], [226, 146, 148], [226, 146, 149], [226, 146, 150], [226, 146, 151], [226, 146, 152], [226, 146, 153], [226, 146, 154], [226, 146, 155], [226, 147, 170], [226, 147, 171], [226, 147, 172], [226, 147, 173], [226, 147, 174], [226, 147, 175], [226, 147, 176], [226, 147, 177], [226, 147, 178], [226, 147, 179], [226, 147, 180], [226, 147, 181], [226, 147, 182], [226, 147, 183], [226, 147, 184], [226, 147, 185], [226, 147, 186], [226, 147, 187], [226, 147, 188], [226, 147, 189], [226, 147, 190], [226, 147, 191], [226, 157, 182], [226, 157, 183], [226, 157, 184], [226, 157, 185], [226, 157, 186], [226, 157, 187], [226, 157, 188], [226, 157, 189], [226, 157, 190], [226, 157, 191], [226, 158, 128], [226, 158, 129], [226, 158, 130], [226, 158, 131], [226, 158, 132], [226, 158, 133], [226, 158, 134], [226, 158, 135], [226, 158, 136], [226, 158, 137], [226, 158, 138], [226, 158, 139], [226, 158, 140], [226, 158, 141], [226, 158, 142], [226, 158, 143], [226, 158, 144], [226, 158, 145], [226, 158, 146], [226, 158, 147], [226, 179, 189], [227, 134, 146], [227, 134, 147], [227, 134, 148], [227, 134, 149], [227, 136, 160], [227, 136, 161], [227, 136, 162], [227, 136, 163], [227, 136, 164], [227, 136, 165], [227, 136, 166], [227, 136, 167], [227, 136, 168], [227, 136, 169], [227, 137, 136], [227, 137, 137], [227, 137, 138], [227, 137, 139], [227, 137, 140], [227, 137, 141], [227, 137, 142], [227, 137, 143], [227, 137, 145], [227, 137, 146], [227, 137, 147], [227, 137, 148], [227, 137, 149], [227, 137, 150], [227, 137, 151], [227, 137, 152], [227, 137, 153], [227, 137, 154], [227, 137, 155], [227, 137, 156], [227, 137, 157], [227, 137, 158], [227, 137, 159], [227, 138, 128], [227, 138, 129], [227, 138, 130], [227, 138, 131], [227, 138, 132], [227, 138, 133], [227, 138, 134], [227, 138, 135], [227, 138, 136], [227, 138, 137], [227, 138, 177], [227, 138, 178], [227, 138, 179], [227, 138, 180], [227, 138, 181], [227, 138, 182], [227, 138, 183], [227, 138, 184], [227, 138, 185], [227, 138, 186], [227, 138, 187], [227, 138, 188], [227, 138, 189], [227, 138, 190], [227, 138, 191], [234, 160, 176], [234, 160, 177], [234, 160, 178], [234, 160, 179], [234, 160, 180], [234, 160, 181], [240, 144, 132, 135], [240, 144, 132, 136], [240, 144, 132, 137], [240, 144, 132, 138], [240, 144, 132, 139], [240, 144, 132, 140], [240, 144, 132, 141], [240, 144, 132, 142], [240, 144, 132, 143], [240, 144, 132, 144], [240, 144, 132, 145], [240, 144, 132, 146], [240, 144, 132, 147], [240, 144, 132, 148], [240, 144, 132, 149], [240, 144, 132, 150], [240, 144, 132, 151], [240, 144, 132, 152], [240, 144, 132, 153], [240, 144, 132, 154], [240, 144, 132, 155], [240, 144, 132, 156], [240, 144, 132, 157], [240, 144, 132, 158], [240, 144, 132, 159], [240, 144, 132, 160], [240, 144, 132, 161], [240, 144, 132, 162], [240, 144, 132, 163], [240, 144, 132, 164], [240, 144, 132, 165], [240, 144, 132, 166], [240, 144, 132, 167], [240, 144, 132, 168], [240, 144, 132, 169], [240, 144, 132, 170], [240, 144, 132, 171], [240, 144, 132, 172], [240, 144, 132, 173], [240, 144, 132, 174], [240, 144, 132, 175], [240, 144, 132, 176], [240, 144, 132, 177], [240, 144, 132, 178], [240, 144, 132, 179], [240, 144, 133, 181], [240, 144, 133, 182], [240, 144, 133, 183], [240, 144, 133, 184], [240, 144, 134, 138], [240, 144, 134, 139], [240, 144, 139, 161], [240, 144, 139, 162], [240, 144, 139, 163], [240, 144, 139, 164], [240, 144, 139, 165], [240, 144, 139, 166], [240, 144, 139, 167], [240, 144, 139, 168], [240, 144, 139, 169], [240, 144, 139, 170], [240, 144, 139, 171], [240, 144, 139, 172], [240, 144, 139, 173], [240, 144, 139, 174], [240, 144, 139, 175], [240, 144, 139, 176], [240, 144, 139, 177], [240, 144, 139, 178], [240, 144, 139, 179], [240, 144, 139, 180], [240, 144, 139, 181], [240, 144, 139, 182], [240, 144, 139, 183], [240, 144, 139, 184], [240, 144, 139, 185], [240, 144, 139, 186], [240, 144, 139, 187], [240, 144, 140, 160], [240, 144, 140, 161], [240, 144, 140, 162], [240, 144, 140, 163], [240, 144, 161, 152], [240, 144, 161, 153], [240, 144, 161, 154], [240, 144, 161, 155], [240, 144, 161, 156], [240, 144, 161, 157], [240, 144, 161, 158], [240, 144, 161, 159], [240, 144, 161, 185], [240, 144, 161, 186], [240, 144, 161, 187], [240, 144, 161, 188], [240, 144, 161, 189], [240, 144, 161, 190], [240, 144, 161, 191], [240, 144, 162, 167], [240, 144, 162, 168], [240, 144, 162, 169], [240, 144, 162, 170], [240, 144, 162, 171], [240, 144, 162, 172], [240, 144, 162, 173], [240, 144, 162, 174], [240, 144, 162, 175], [240, 144, 163, 187], [240, 144, 163, 188], [240, 144, 163, 189], [240, 144, 163, 190], [240, 144, 163, 191], [240, 144, 164, 150], [240, 144, 164, 151], [240, 144, 164, 152], [240, 144, 164, 153], [240, 144, 164, 154], [240, 144, 164, 155], [240, 144, 166, 188], [240, 144, 166, 189], [240, 144, 167, 128], [240, 144, 167, 129], [240, 144, 167, 130], [240, 144, 167, 131], [240, 144, 167, 132], [240, 144, 167, 133], [240, 144, 167, 134], [240, 144, 167, 135], [240, 144, 167, 136], [240, 144, 167, 137], [240, 144, 167, 138], [240, 144, 167, 139], [240, 144, 167, 140], [240, 144, 167, 141], [240, 144, 167, 142], [240, 144, 167, 143], [240, 144, 167, 146], [240, 144, 167, 147], [240, 144, 167, 148], [240, 144, 167, 149], [240, 144, 167, 150], [240, 144, 167, 151], [240, 144, 167, 152], [240, 144, 167, 153], [240, 144, 167, 154], [240, 144, 167, 155], [240, 144, 167, 156], [240, 144, 167, 157], [240, 144, 167, 158], [240, 144, 167, 159], [240, 144, 167, 160], [240, 144, 167, 161], [240, 144, 167, 162], [240, 144, 167, 163], [240, 144, 167, 164], [240, 144, 167, 165], [240, 144, 167, 166], [240, 144, 167, 167], [240, 144, 167, 168], [240, 144, 167, 169], [240, 144, 167, 170], [240, 144, 167, 171], [240, 144, 167, 172], [240, 144, 167, 173], [240, 144, 167, 174], [240, 144, 167, 175], [240, 144, 167, 176], [240, 144, 167, 177], [240, 144, 167, 178], [240, 144, 167, 179], [240, 144, 167, 180], [240, 144, 167, 181], [240, 144, 167, 182], [240, 144, 167, 183], [240, 144, 167, 184], [240, 144, 167, 185], [240, 144, 167, 186], [240, 144, 167, 187], [240, 144, 167, 188], [240, 144, 167, 189], [240, 144, 167, 190], [240, 144, 167, 191], [240, 144, 169, 128], [240, 144, 169, 129], [240, 144, 169, 130], [240, 144, 169, 131], [240, 144, 169, 132], [240, 144, 169, 133], [240, 144, 169, 134], [240, 144, 169, 135], [240, 144, 169, 189], [240, 144, 169, 190], [240, 144, 170, 157], [240, 144, 170, 158], [240, 144, 170, 159], [240, 144, 171, 171], [240, 144, 171, 172], [240, 144, 171, 173], [240, 144, 171, 174], [240, 144, 171, 175], [240, 144, 173, 152], [240, 144, 173, 153], [240, 144, 173, 154], [240, 144, 173, 155], [240, 144, 173, 156], [240, 144, 173, 157], [240, 144, 173, 158], [240, 144, 173, 159], [240, 144, 173, 184], [240, 144, 173, 185], [240, 144, 173, 186], [240, 144, 173, 187], [240, 144, 173, 188], [240, 144, 173, 189], [240, 144, 173, 190], [240, 144, 173, 191], [240, 144, 174, 169], [240, 144, 174, 170], [240, 144, 174, 171], [240, 144, 174, 172], [240, 144, 174, 173], [240, 144, 174, 174], [240, 144, 174, 175], [240, 144, 179, 186], [240, 144, 179, 187], [240, 144, 179, 188], [240, 144, 179, 189], [240, 144, 179, 190], [240, 144, 179, 191], [240, 144, 185, 160], [240, 144, 185, 161], [240, 144, 185, 162], [240, 144, 185, 163], [240, 144, 185, 164], [240, 144, 185, 165], [240, 144, 185, 166], [240, 144, 185, 167], [240, 144, 185, 168], [240, 144, 185, 169], [240, 144, 185, 170], [240, 144, 185, 171], [240, 144, 185, 172], [240, 144, 185, 173], [240, 144, 185, 174], [240, 144, 185, 175], [240, 144, 185, 176], [240, 144, 185, 177], [240, 144, 185, 178], [240, 144, 185, 179], [240, 144, 185, 180], [240, 144, 185, 181], [240, 144, 185, 182], [240, 144, 185, 183], [240, 144, 185, 184], [240, 144, 185, 185], [240, 144, 185, 186], [240, 144, 185, 187], [240, 144, 185, 188], [240, 144, 185, 189], [240, 144, 185, 190], [240, 145, 129, 146], [240, 145, 129, 147], [240, 145, 129, 148], [240, 145, 129, 149], [240, 145, 129, 150], [240, 145, 129, 151], [240, 145, 129, 152], [240, 145, 129, 153], [240, 145, 129, 154], [240, 145, 129, 155], [240, 145, 129, 156], [240, 145, 129, 157], [240, 145, 129, 158], [240, 145, 129, 159], [240, 145, 129, 160], [240, 145, 129, 161], [240, 145, 129, 162], [240, 145, 129, 163], [240, 145, 129, 164], [240, 145, 129, 165], [240, 145, 135, 161], [240, 145, 135, 162], [240, 145, 135, 163], [240, 145, 135, 164], [240, 145, 135, 165], [240, 145, 135, 166], [240, 145, 135, 167], [240, 145, 135, 168], [240, 145, 135, 169], [240, 145, 135, 170], [240, 145, 135, 171], [240, 145, 135, 172], [240, 145, 135, 173], [240, 145, 135, 174], [240, 145, 135, 175], [240, 145, 135, 176], [240, 145, 135, 177], [240, 145, 135, 178], [240, 145, 135, 179], [240, 145, 135, 180], [240, 145, 156, 186], [240, 145, 156, 187], [240, 145, 163, 170], [240, 145, 163, 171], [240, 145, 163, 172], [240, 145, 163, 173], [240, 145, 163, 174], [240, 145, 163, 175], [240, 145, 163, 176], [240, 145, 163, 177], [240, 145, 163, 178], [240, 150, 173, 155], [240, 150, 173, 156], [240, 150, 173, 157], [240, 150, 173, 158], [240, 150, 173, 159], [240, 150, 173, 160], [240, 150, 173, 161], [240, 157, 141, 160], [240, 157, 141, 161], [240, 157, 141, 162], [240, 157, 141, 163], [240, 157, 141, 164], [240, 157, 141, 165], [240, 157, 141, 166], [240, 157, 141, 167], [240, 157, 141, 168], [240, 157, 141, 169], [240, 157, 141, 170], [240, 157, 141, 171], [240, 157, 141, 172], [240, 157, 141, 173], [240, 157, 141, 174], [240, 157, 141, 175], [240, 157, 141, 176], [240, 157, 141, 177], [240, 158, 163, 135], [240, 158, 163, 136], [240, 158, 163, 137], [240, 158, 163, 138], [240, 158, 163, 139], [240, 158, 163, 140], [240, 158, 163, 141], [240, 158, 163, 142], [240, 158, 163, 143], [240, 159, 132, 128], [240, 159, 132, 129], [240, 159, 132, 130], [240, 159, 132, 131], [240, 159, 132, 132], [240, 159, 132, 133], [240, 159, 132, 134], [240, 159, 132, 135], [240, 159, 132, 136], [240, 159, 132, 137], [240, 159, 132, 138], [240, 159, 132, 139], [240, 159, 132, 140]] |
#A
def greeting(x :str) -> str:
return "hello, "+ x
def main():
# input
s = input()
# compute
# output
print(greeting(s))
if __name__ == '__main__':
main()
| def greeting(x: str) -> str:
return 'hello, ' + x
def main():
s = input()
print(greeting(s))
if __name__ == '__main__':
main() |
def test_delete_first__group(app):
app.session.open_home_page()
app.session.login("admin", "secret")
app.group.delete_first_group()
app.session.logout()
| def test_delete_first__group(app):
app.session.open_home_page()
app.session.login('admin', 'secret')
app.group.delete_first_group()
app.session.logout() |
#####count freq of words in text file
word_count= dict()
with open(r'C:/Users/Jen/Downloads/resumes/PracticeCodeM/cantrbry/plrabn12.txt', 'r') as fi:
for line in fi:
words = line.split()
prepared_words = [w.lower() for w in words]
for w in prepared_words:
word_count[w] = 1 if w not in word_count else word_count[w]+1
def most_commmon_words(num=10):
sorted_words = sorted(word_count, key=word_count.get, reverse=True)
return sorted_words[:num]
pprint_here = '\n'.join(most_commmon_words(5))
print(pprint_here)
| word_count = dict()
with open('C:/Users/Jen/Downloads/resumes/PracticeCodeM/cantrbry/plrabn12.txt', 'r') as fi:
for line in fi:
words = line.split()
prepared_words = [w.lower() for w in words]
for w in prepared_words:
word_count[w] = 1 if w not in word_count else word_count[w] + 1
def most_commmon_words(num=10):
sorted_words = sorted(word_count, key=word_count.get, reverse=True)
return sorted_words[:num]
pprint_here = '\n'.join(most_commmon_words(5))
print(pprint_here) |
"""
Writing to a textfile:
1. open the file as either "w" or "a"
(write or append)
2. write the data
"""
with open("hello.txt", "w") as fout:
fout.write("Hello World\n")
with open("/etc/shells", "r") as fin:
with open("hello.txt", "a") as fout:
for line in fin:
fout.write(line)
| """
Writing to a textfile:
1. open the file as either "w" or "a"
(write or append)
2. write the data
"""
with open('hello.txt', 'w') as fout:
fout.write('Hello World\n')
with open('/etc/shells', 'r') as fin:
with open('hello.txt', 'a') as fout:
for line in fin:
fout.write(line) |
# Do not edit. bazel-deps autogenerates this file from dependencies.yaml.
def _jar_artifact_impl(ctx):
jar_name = "%s.jar" % ctx.name
ctx.download(
output=ctx.path("jar/%s" % jar_name),
url=ctx.attr.urls,
sha256=ctx.attr.sha256,
executable=False
)
src_name="%s-sources.jar" % ctx.name
srcjar_attr=""
has_sources = len(ctx.attr.src_urls) != 0
if has_sources:
ctx.download(
output=ctx.path("jar/%s" % src_name),
url=ctx.attr.src_urls,
sha256=ctx.attr.src_sha256,
executable=False
)
srcjar_attr ='\n srcjar = ":%s",' % src_name
build_file_contents = """
package(default_visibility = ['//visibility:public'])
java_import(
name = 'jar',
tags = ['maven_coordinates={artifact}'],
jars = ['{jar_name}'],{srcjar_attr}
)
filegroup(
name = 'file',
srcs = [
'{jar_name}',
'{src_name}'
],
visibility = ['//visibility:public']
)\n""".format(artifact = ctx.attr.artifact, jar_name = jar_name, src_name = src_name, srcjar_attr = srcjar_attr)
ctx.file(ctx.path("jar/BUILD"), build_file_contents, False)
return None
jar_artifact = repository_rule(
attrs = {
"artifact": attr.string(mandatory = True),
"sha256": attr.string(mandatory = True),
"urls": attr.string_list(mandatory = True),
"src_sha256": attr.string(mandatory = False, default=""),
"src_urls": attr.string_list(mandatory = False, default=[]),
},
implementation = _jar_artifact_impl
)
def jar_artifact_callback(hash):
src_urls = []
src_sha256 = ""
source=hash.get("source", None)
if source != None:
src_urls = [source["url"]]
src_sha256 = source["sha256"]
jar_artifact(
artifact = hash["artifact"],
name = hash["name"],
urls = [hash["url"]],
sha256 = hash["sha256"],
src_urls = src_urls,
src_sha256 = src_sha256
)
native.bind(name = hash["bind"], actual = hash["actual"])
def list_dependencies():
return [
{"artifact": "com.google.protobuf:protobuf-java:3.5.1", "lang": "java", "sha1": "8c3492f7662fa1cbf8ca76a0f5eb1146f7725acd", "sha256": "b5e2d91812d183c9f053ffeebcbcda034d4de6679521940a19064714966c2cd4", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.5.1/protobuf-java-3.5.1.jar", "source": {"sha1": "7235a28a13938050e8cd5d9ed5133bebf7a4dca7", "sha256": "3be3115498d543851443bfa725c0c5b28140e363b3b7dec97f4028cd17040fa4", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.5.1/protobuf-java-3.5.1-sources.jar"} , "name": "com_google_protobuf_protobuf_java", "actual": "@com_google_protobuf_protobuf_java//jar", "bind": "jar/com/google/protobuf/protobuf_java"},
{"artifact": "com.lihaoyi:fastparse-utils_2.12:1.0.0", "lang": "java", "sha1": "02900ec8460abec27913f4154b338e61fd482607", "sha256": "fb6cd6484e21459e11fcd45f22f07ad75e3cb29eca0650b39aa388d13c8e7d0a", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.jar", "source": {"sha1": "891f76cff455350adc2f122421b67855f93c8dc3", "sha256": "19e055e9d870f2a2cec5a8e0b892f9afb6e4350ecce315ca519458c4f52f9253", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0-sources.jar"} , "name": "com_lihaoyi_fastparse_utils_2_12", "actual": "@com_lihaoyi_fastparse_utils_2_12//jar", "bind": "jar/com/lihaoyi/fastparse_utils_2_12"},
{"artifact": "com.lihaoyi:fastparse_2.12:1.0.0", "lang": "java", "sha1": "2473a344aa1200fd50b7ff78281188c172f9cfcb", "sha256": "1227a00a26a4ad76ddcfa6eae2416687df7f3c039553d586324b32ba0a528fcc", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.jar", "source": {"sha1": "b1fdfd4c95bdb3f49ec78837be78d657a5ac86c0", "sha256": "290c1e9a4bad4d3724daec48324083fd0d97f51981a3fabbf75e2de1303da5ca", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0-sources.jar"} , "name": "com_lihaoyi_fastparse_2_12", "actual": "@com_lihaoyi_fastparse_2_12//jar", "bind": "jar/com/lihaoyi/fastparse_2_12"},
{"artifact": "com.lihaoyi:sourcecode_2.12:0.1.4", "lang": "java", "sha1": "ef9a771975cb0860f2b42778c5cf1f5d76818979", "sha256": "9a3134484e596205d0acdcccd260e0854346f266cb4d24e1b8a31be54fbaf6d9", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.jar", "source": {"sha1": "ffb135dacaf0d989c260a486c8b86867bcab2e22", "sha256": "c5c53ba31a9f891988f9e21595e8728956be22d9ab9442e140840d0a73be8261", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4-sources.jar"} , "name": "com_lihaoyi_sourcecode_2_12", "actual": "@com_lihaoyi_sourcecode_2_12//jar", "bind": "jar/com/lihaoyi/sourcecode_2_12"},
{"artifact": "com.thesamet.scalapb:lenses_2.12:0.8.0-RC1", "lang": "java", "sha1": "63f6dfbea05fa9793e20368d5b563db9b9444f16", "sha256": "6e061e15fa9f37662d89d1d0a3f4da64c73e3129108b672c792b36bf490ae8e2", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.8.0-RC1/lenses_2.12-0.8.0-RC1.jar", "source": {"sha1": "05b9aeff30f2b2fbc3682eefd05743577769ee4d", "sha256": "cf2899b36193b3fa7b99fd0476aca8453f0c4bd284d37da8a564cfbc69f24244", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.8.0-RC1/lenses_2.12-0.8.0-RC1-sources.jar"} , "name": "com_thesamet_scalapb_lenses_2_12", "actual": "@com_thesamet_scalapb_lenses_2_12//jar", "bind": "jar/com/thesamet/scalapb/lenses_2_12"},
{"artifact": "com.thesamet.scalapb:scalapb-runtime_2.12:0.8.0-RC1", "lang": "java", "sha1": "f9879e234145d4e9e9874509a538f3d64ad205ac", "sha256": "d922c788c8997e2524a39b1f43bac3c859516fc0ae580eab82c0db7e40aef944", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.8.0-RC1/scalapb-runtime_2.12-0.8.0-RC1.jar", "source": {"sha1": "ea3d3cb5b134aef3a22ce41dd99ce4271ac5e6b0", "sha256": "fbc11c3ceffbd1d146c039e40c34fe8aa9b467f15f91668ebfe796c4cd0b91e4", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.8.0-RC1/scalapb-runtime_2.12-0.8.0-RC1-sources.jar"} , "name": "com_thesamet_scalapb_scalapb_runtime_2_12", "actual": "@com_thesamet_scalapb_scalapb_runtime_2_12//jar", "bind": "jar/com/thesamet/scalapb/scalapb_runtime_2_12"},
# duplicates in org.scala-lang:scala-library promoted to 2.12.8
# - com.lihaoyi:fastparse-utils_2.12:1.0.0 wanted version 2.12.3
# - com.lihaoyi:fastparse_2.12:1.0.0 wanted version 2.12.3
# - com.lihaoyi:sourcecode_2.12:0.1.4 wanted version 2.12.2
# - com.thesamet.scalapb:lenses_2.12:0.8.0-RC1 wanted version 2.12.6
# - com.thesamet.scalapb:scalapb-runtime_2.12:0.8.0-RC1 wanted version 2.12.6
# - org.scalameta:common_2.12:4.1.6 wanted version 2.12.8
# - org.scalameta:io_2.12:4.1.6 wanted version 2.12.8
# - org.scalameta:semanticdb-javac_2.12:4.1.6 wanted version 2.12.8
# - org.scalameta:semanticdb_2.12:4.1.6 wanted version 2.12.8
{"artifact": "org.scala-lang:scala-library:2.12.8", "lang": "java", "sha1": "36b234834d8f842cdde963c8591efae6cf413e3f", "sha256": "321fb55685635c931eba4bc0d7668349da3f2c09aee2de93a70566066ff25c28", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scala-lang/scala-library/2.12.8/scala-library-2.12.8.jar", "source": {"sha1": "45ccb865e040cbef5d5620571527831441392f24", "sha256": "11482bcb49b2e47baee89c3b1ae10c6a40b89e2fbb0da2a423e062f444e13492", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scala-lang/scala-library/2.12.8/scala-library-2.12.8-sources.jar"} , "name": "org_scala_lang_scala_library", "actual": "@org_scala_lang_scala_library//jar", "bind": "jar/org/scala_lang/scala_library"},
{"artifact": "org.scalameta:common_2.12:4.1.6", "lang": "java", "sha1": "34c19fe6e9141bb8014453af7706c58844f58468", "sha256": "4bcf81a9734c14e881dd62d3934127b3dbfd8fdb5603cad249a4ec73492af0de", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/common_2.12/4.1.6/common_2.12-4.1.6.jar", "source": {"sha1": "84454c925612885d0ffba8fcbdba4cd7d19e0721", "sha256": "d7f71a0ebd2ec659c19c82974e09da5afd5598aa4bc4c59a624959845ca97c72", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/common_2.12/4.1.6/common_2.12-4.1.6-sources.jar"} , "name": "org_scalameta_common_2_12", "actual": "@org_scalameta_common_2_12//jar", "bind": "jar/org/scalameta/common_2_12"},
{"artifact": "org.scalameta:io_2.12:4.1.6", "lang": "java", "sha1": "b7aa0c103a59aa97fa1d273e56089621526d0d22", "sha256": "296e593460f5f700c01589dc717b35d44d6474d8f30c005bf6e7b13bbc5b9734", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/io_2.12/4.1.6/io_2.12-4.1.6.jar", "source": {"sha1": "f4da2f7b1f9ce2c86281c0fe8473e099e4073c5a", "sha256": "9d3ec1d68f6aed526b3956264f5223db95326608df71511c5b60db31e4e02ab6", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/io_2.12/4.1.6/io_2.12-4.1.6-sources.jar"} , "name": "org_scalameta_io_2_12", "actual": "@org_scalameta_io_2_12//jar", "bind": "jar/org/scalameta/io_2_12"},
{"artifact": "org.scalameta:semanticdb-javac_2.12:4.1.6", "lang": "scala", "sha1": "d16dd9ca4aebaabe6f3887a15a0bc12e26f06e51", "sha256": "74456b658ee596ce56d817ebf1e9cbd0181a04e73596c5ff9c94b9c32d929ef6", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/semanticdb-javac_2.12/4.1.6/semanticdb-javac_2.12-4.1.6.jar", "source": {"sha1": "5383f4da130713de35bed96506fed0800bd8b4be", "sha256": "f2a593828ed76ee00a207a5e748c8b6f71dd464ccce5d64eddacd9b49d03f671", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/semanticdb-javac_2.12/4.1.6/semanticdb-javac_2.12-4.1.6-sources.jar"} , "name": "org_scalameta_semanticdb_javac_2_12", "actual": "@org_scalameta_semanticdb_javac_2_12//jar:file", "bind": "jar/org/scalameta/semanticdb_javac_2_12"},
{"artifact": "org.scalameta:semanticdb_2.12:4.1.6", "lang": "java", "sha1": "38cdb3c7664b86ef54b414b53c4d80cf02a3b508", "sha256": "201fa1f10778e5b9c69ab9d524ca795be4f08e179506ae2ad7a8dcc6efeeb5cb", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/semanticdb_2.12/4.1.6/semanticdb_2.12-4.1.6.jar", "source": {"sha1": "39aaf6f189e7fa185001eff68d0b24d10e54e80c", "sha256": "6d9932d7830516f903ed2ff9cc6bf5af0e99b22b502014469a2b420e92fa596a", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/scalameta/semanticdb_2.12/4.1.6/semanticdb_2.12-4.1.6-sources.jar"} , "name": "org_scalameta_semanticdb_2_12", "actual": "@org_scalameta_semanticdb_2_12//jar", "bind": "jar/org/scalameta/semanticdb_2_12"},
]
def maven_dependencies(callback = jar_artifact_callback):
for hash in list_dependencies():
callback(hash)
| def _jar_artifact_impl(ctx):
jar_name = '%s.jar' % ctx.name
ctx.download(output=ctx.path('jar/%s' % jar_name), url=ctx.attr.urls, sha256=ctx.attr.sha256, executable=False)
src_name = '%s-sources.jar' % ctx.name
srcjar_attr = ''
has_sources = len(ctx.attr.src_urls) != 0
if has_sources:
ctx.download(output=ctx.path('jar/%s' % src_name), url=ctx.attr.src_urls, sha256=ctx.attr.src_sha256, executable=False)
srcjar_attr = '\n srcjar = ":%s",' % src_name
build_file_contents = "\npackage(default_visibility = ['//visibility:public'])\njava_import(\n name = 'jar',\n tags = ['maven_coordinates={artifact}'],\n jars = ['{jar_name}'],{srcjar_attr}\n)\nfilegroup(\n name = 'file',\n srcs = [\n '{jar_name}',\n '{src_name}'\n ],\n visibility = ['//visibility:public']\n)\n".format(artifact=ctx.attr.artifact, jar_name=jar_name, src_name=src_name, srcjar_attr=srcjar_attr)
ctx.file(ctx.path('jar/BUILD'), build_file_contents, False)
return None
jar_artifact = repository_rule(attrs={'artifact': attr.string(mandatory=True), 'sha256': attr.string(mandatory=True), 'urls': attr.string_list(mandatory=True), 'src_sha256': attr.string(mandatory=False, default=''), 'src_urls': attr.string_list(mandatory=False, default=[])}, implementation=_jar_artifact_impl)
def jar_artifact_callback(hash):
src_urls = []
src_sha256 = ''
source = hash.get('source', None)
if source != None:
src_urls = [source['url']]
src_sha256 = source['sha256']
jar_artifact(artifact=hash['artifact'], name=hash['name'], urls=[hash['url']], sha256=hash['sha256'], src_urls=src_urls, src_sha256=src_sha256)
native.bind(name=hash['bind'], actual=hash['actual'])
def list_dependencies():
return [{'artifact': 'com.google.protobuf:protobuf-java:3.5.1', 'lang': 'java', 'sha1': '8c3492f7662fa1cbf8ca76a0f5eb1146f7725acd', 'sha256': 'b5e2d91812d183c9f053ffeebcbcda034d4de6679521940a19064714966c2cd4', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.5.1/protobuf-java-3.5.1.jar', 'source': {'sha1': '7235a28a13938050e8cd5d9ed5133bebf7a4dca7', 'sha256': '3be3115498d543851443bfa725c0c5b28140e363b3b7dec97f4028cd17040fa4', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/google/protobuf/protobuf-java/3.5.1/protobuf-java-3.5.1-sources.jar'}, 'name': 'com_google_protobuf_protobuf_java', 'actual': '@com_google_protobuf_protobuf_java//jar', 'bind': 'jar/com/google/protobuf/protobuf_java'}, {'artifact': 'com.lihaoyi:fastparse-utils_2.12:1.0.0', 'lang': 'java', 'sha1': '02900ec8460abec27913f4154b338e61fd482607', 'sha256': 'fb6cd6484e21459e11fcd45f22f07ad75e3cb29eca0650b39aa388d13c8e7d0a', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0.jar', 'source': {'sha1': '891f76cff455350adc2f122421b67855f93c8dc3', 'sha256': '19e055e9d870f2a2cec5a8e0b892f9afb6e4350ecce315ca519458c4f52f9253', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/lihaoyi/fastparse-utils_2.12/1.0.0/fastparse-utils_2.12-1.0.0-sources.jar'}, 'name': 'com_lihaoyi_fastparse_utils_2_12', 'actual': '@com_lihaoyi_fastparse_utils_2_12//jar', 'bind': 'jar/com/lihaoyi/fastparse_utils_2_12'}, {'artifact': 'com.lihaoyi:fastparse_2.12:1.0.0', 'lang': 'java', 'sha1': '2473a344aa1200fd50b7ff78281188c172f9cfcb', 'sha256': '1227a00a26a4ad76ddcfa6eae2416687df7f3c039553d586324b32ba0a528fcc', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0.jar', 'source': {'sha1': 'b1fdfd4c95bdb3f49ec78837be78d657a5ac86c0', 'sha256': '290c1e9a4bad4d3724daec48324083fd0d97f51981a3fabbf75e2de1303da5ca', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/lihaoyi/fastparse_2.12/1.0.0/fastparse_2.12-1.0.0-sources.jar'}, 'name': 'com_lihaoyi_fastparse_2_12', 'actual': '@com_lihaoyi_fastparse_2_12//jar', 'bind': 'jar/com/lihaoyi/fastparse_2_12'}, {'artifact': 'com.lihaoyi:sourcecode_2.12:0.1.4', 'lang': 'java', 'sha1': 'ef9a771975cb0860f2b42778c5cf1f5d76818979', 'sha256': '9a3134484e596205d0acdcccd260e0854346f266cb4d24e1b8a31be54fbaf6d9', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4.jar', 'source': {'sha1': 'ffb135dacaf0d989c260a486c8b86867bcab2e22', 'sha256': 'c5c53ba31a9f891988f9e21595e8728956be22d9ab9442e140840d0a73be8261', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/lihaoyi/sourcecode_2.12/0.1.4/sourcecode_2.12-0.1.4-sources.jar'}, 'name': 'com_lihaoyi_sourcecode_2_12', 'actual': '@com_lihaoyi_sourcecode_2_12//jar', 'bind': 'jar/com/lihaoyi/sourcecode_2_12'}, {'artifact': 'com.thesamet.scalapb:lenses_2.12:0.8.0-RC1', 'lang': 'java', 'sha1': '63f6dfbea05fa9793e20368d5b563db9b9444f16', 'sha256': '6e061e15fa9f37662d89d1d0a3f4da64c73e3129108b672c792b36bf490ae8e2', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.8.0-RC1/lenses_2.12-0.8.0-RC1.jar', 'source': {'sha1': '05b9aeff30f2b2fbc3682eefd05743577769ee4d', 'sha256': 'cf2899b36193b3fa7b99fd0476aca8453f0c4bd284d37da8a564cfbc69f24244', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/thesamet/scalapb/lenses_2.12/0.8.0-RC1/lenses_2.12-0.8.0-RC1-sources.jar'}, 'name': 'com_thesamet_scalapb_lenses_2_12', 'actual': '@com_thesamet_scalapb_lenses_2_12//jar', 'bind': 'jar/com/thesamet/scalapb/lenses_2_12'}, {'artifact': 'com.thesamet.scalapb:scalapb-runtime_2.12:0.8.0-RC1', 'lang': 'java', 'sha1': 'f9879e234145d4e9e9874509a538f3d64ad205ac', 'sha256': 'd922c788c8997e2524a39b1f43bac3c859516fc0ae580eab82c0db7e40aef944', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.8.0-RC1/scalapb-runtime_2.12-0.8.0-RC1.jar', 'source': {'sha1': 'ea3d3cb5b134aef3a22ce41dd99ce4271ac5e6b0', 'sha256': 'fbc11c3ceffbd1d146c039e40c34fe8aa9b467f15f91668ebfe796c4cd0b91e4', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.12/0.8.0-RC1/scalapb-runtime_2.12-0.8.0-RC1-sources.jar'}, 'name': 'com_thesamet_scalapb_scalapb_runtime_2_12', 'actual': '@com_thesamet_scalapb_scalapb_runtime_2_12//jar', 'bind': 'jar/com/thesamet/scalapb/scalapb_runtime_2_12'}, {'artifact': 'org.scala-lang:scala-library:2.12.8', 'lang': 'java', 'sha1': '36b234834d8f842cdde963c8591efae6cf413e3f', 'sha256': '321fb55685635c931eba4bc0d7668349da3f2c09aee2de93a70566066ff25c28', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scala-lang/scala-library/2.12.8/scala-library-2.12.8.jar', 'source': {'sha1': '45ccb865e040cbef5d5620571527831441392f24', 'sha256': '11482bcb49b2e47baee89c3b1ae10c6a40b89e2fbb0da2a423e062f444e13492', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scala-lang/scala-library/2.12.8/scala-library-2.12.8-sources.jar'}, 'name': 'org_scala_lang_scala_library', 'actual': '@org_scala_lang_scala_library//jar', 'bind': 'jar/org/scala_lang/scala_library'}, {'artifact': 'org.scalameta:common_2.12:4.1.6', 'lang': 'java', 'sha1': '34c19fe6e9141bb8014453af7706c58844f58468', 'sha256': '4bcf81a9734c14e881dd62d3934127b3dbfd8fdb5603cad249a4ec73492af0de', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/common_2.12/4.1.6/common_2.12-4.1.6.jar', 'source': {'sha1': '84454c925612885d0ffba8fcbdba4cd7d19e0721', 'sha256': 'd7f71a0ebd2ec659c19c82974e09da5afd5598aa4bc4c59a624959845ca97c72', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/common_2.12/4.1.6/common_2.12-4.1.6-sources.jar'}, 'name': 'org_scalameta_common_2_12', 'actual': '@org_scalameta_common_2_12//jar', 'bind': 'jar/org/scalameta/common_2_12'}, {'artifact': 'org.scalameta:io_2.12:4.1.6', 'lang': 'java', 'sha1': 'b7aa0c103a59aa97fa1d273e56089621526d0d22', 'sha256': '296e593460f5f700c01589dc717b35d44d6474d8f30c005bf6e7b13bbc5b9734', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/io_2.12/4.1.6/io_2.12-4.1.6.jar', 'source': {'sha1': 'f4da2f7b1f9ce2c86281c0fe8473e099e4073c5a', 'sha256': '9d3ec1d68f6aed526b3956264f5223db95326608df71511c5b60db31e4e02ab6', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/io_2.12/4.1.6/io_2.12-4.1.6-sources.jar'}, 'name': 'org_scalameta_io_2_12', 'actual': '@org_scalameta_io_2_12//jar', 'bind': 'jar/org/scalameta/io_2_12'}, {'artifact': 'org.scalameta:semanticdb-javac_2.12:4.1.6', 'lang': 'scala', 'sha1': 'd16dd9ca4aebaabe6f3887a15a0bc12e26f06e51', 'sha256': '74456b658ee596ce56d817ebf1e9cbd0181a04e73596c5ff9c94b9c32d929ef6', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/semanticdb-javac_2.12/4.1.6/semanticdb-javac_2.12-4.1.6.jar', 'source': {'sha1': '5383f4da130713de35bed96506fed0800bd8b4be', 'sha256': 'f2a593828ed76ee00a207a5e748c8b6f71dd464ccce5d64eddacd9b49d03f671', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/semanticdb-javac_2.12/4.1.6/semanticdb-javac_2.12-4.1.6-sources.jar'}, 'name': 'org_scalameta_semanticdb_javac_2_12', 'actual': '@org_scalameta_semanticdb_javac_2_12//jar:file', 'bind': 'jar/org/scalameta/semanticdb_javac_2_12'}, {'artifact': 'org.scalameta:semanticdb_2.12:4.1.6', 'lang': 'java', 'sha1': '38cdb3c7664b86ef54b414b53c4d80cf02a3b508', 'sha256': '201fa1f10778e5b9c69ab9d524ca795be4f08e179506ae2ad7a8dcc6efeeb5cb', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/semanticdb_2.12/4.1.6/semanticdb_2.12-4.1.6.jar', 'source': {'sha1': '39aaf6f189e7fa185001eff68d0b24d10e54e80c', 'sha256': '6d9932d7830516f903ed2ff9cc6bf5af0e99b22b502014469a2b420e92fa596a', 'repository': 'http://central.maven.org/maven2/', 'url': 'http://central.maven.org/maven2/org/scalameta/semanticdb_2.12/4.1.6/semanticdb_2.12-4.1.6-sources.jar'}, 'name': 'org_scalameta_semanticdb_2_12', 'actual': '@org_scalameta_semanticdb_2_12//jar', 'bind': 'jar/org/scalameta/semanticdb_2_12'}]
def maven_dependencies(callback=jar_artifact_callback):
for hash in list_dependencies():
callback(hash) |
# Copyright 2018 Oinam Romesh Meitei. All Rights Reserved.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not 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 the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
class molog:
filname = ''
def __init__(self):
apple = 0
def set_name(self,string):
molog.filname = string
def initiate(self):
out = open(molog.filname,'w')
out.write(' ******************\n')
out.write(' ***** MOLEPY *****\n')
out.write(' ******************\n')
out.write('\n')
out.close()
def writer(self,str1,*args):
out = open(molog.filname,'a')
out.write(str1.format(*args))
out.close()
| class Molog:
filname = ''
def __init__(self):
apple = 0
def set_name(self, string):
molog.filname = string
def initiate(self):
out = open(molog.filname, 'w')
out.write(' ******************\n')
out.write(' ***** MOLEPY *****\n')
out.write(' ******************\n')
out.write('\n')
out.close()
def writer(self, str1, *args):
out = open(molog.filname, 'a')
out.write(str1.format(*args))
out.close() |
Dev = {
"db_server": "Dbsed4555",
"user": "<db_username>",
"passwd": "<password>",
"driver": "SQL Server",
"port": "1433"
}
Oracle = {
"db_server": "es20-scan01",
"port": "1521",
"user": "<db_username>",
"passwd": "<password>",
"service_name": "cmc1st01svc.uhc.com"
}
Sybase = {
"db_server": "DBSPS0181",
"user": "<db_username>",
"passwd": "<password>",
"driver": "Adaptive Server Enterprise",
"port": "4106"
}
# Test = {
# "db_server": "",
# "user": "",
# "passwd": "my secret password",
# "driver": "SQL Server"
# }
#
# Stage = {
# "db_server": "Dbsed4555",
# "user": "<db_username>",
# "passwd": "<password>",
# "driver": "SQL Server"
# }
#
# Prod = {
# "db_server": "localhost",
# "user": "",
# "passwd": "my secret password",
# "driver": "SQL Server"
# }
| dev = {'db_server': 'Dbsed4555', 'user': '<db_username>', 'passwd': '<password>', 'driver': 'SQL Server', 'port': '1433'}
oracle = {'db_server': 'es20-scan01', 'port': '1521', 'user': '<db_username>', 'passwd': '<password>', 'service_name': 'cmc1st01svc.uhc.com'}
sybase = {'db_server': 'DBSPS0181', 'user': '<db_username>', 'passwd': '<password>', 'driver': 'Adaptive Server Enterprise', 'port': '4106'} |
message_id = {
b"\x00\x00": "init",
b"\x00\x01": "ping",
b"\x00\x02": "pong",
b"\x00\x03": "give nodes",
b"\x00\x04": "take nodes",
b"\x00\x05": "give next headers",
b"\x00\x06": "take the headers",
b"\x00\x07": "give blocks",
b"\x00\x08": "take the blocks",
b"\x00\x09": "give the txos",
b"\x00\x0a": "take the txos",
b"\x00\x0b": "give outputs",
b"\x00\x0c": "take TBM transaction",
b"\x00\x0d": "give TBM transaction",
b"\x00\x0e": "take tip info",
b"\x00\x0f": "find common root",
b"\x00\x10": "find common root response"
}
inv_message_id = {v: k for k, v in message_id.items()}
| message_id = {b'\x00\x00': 'init', b'\x00\x01': 'ping', b'\x00\x02': 'pong', b'\x00\x03': 'give nodes', b'\x00\x04': 'take nodes', b'\x00\x05': 'give next headers', b'\x00\x06': 'take the headers', b'\x00\x07': 'give blocks', b'\x00\x08': 'take the blocks', b'\x00\t': 'give the txos', b'\x00\n': 'take the txos', b'\x00\x0b': 'give outputs', b'\x00\x0c': 'take TBM transaction', b'\x00\r': 'give TBM transaction', b'\x00\x0e': 'take tip info', b'\x00\x0f': 'find common root', b'\x00\x10': 'find common root response'}
inv_message_id = {v: k for (k, v) in message_id.items()} |
def accuracy(y_test, y):
cont = 0
for i in range(len(y)):
if y[i] == y_test[i]:
cont += 1
return cont / float(len(y))
def f_measure(y_test, y, beta=1):
tp = 0.0 # true pos
fp = 0.0 # false pos
tn = 0.0 # true neg
fn = 0.0 # false neg
for i in range(len(y)):
if y_test[i] == 1.0 and y[i] == 1.0:
tp += 1.0
elif y_test[i] == 1.0 and y[i] == 0.0:
fp += 1.0
elif y_test[i] == 0.0 and y[i] == 0.0:
tn += 1.0
elif y_test[i] == 0.0 and y[i] == 1.0:
fn += 1.0
if (tp + fp) != 0.0:
precision = tp / (tp + fp)
else:
precision = 0.0
if (tp + fn) != 0.0:
recall = tp / (tp + fn)
else:
recall = 0.0
if (((beta ** 2.0) * precision) + recall) != 0:
resultado = (1.0 + (beta ** 2.0)) * ((precision * recall) / (((beta ** 2.0) * precision) + recall))
else:
resultado = 0.0
return resultado
| def accuracy(y_test, y):
cont = 0
for i in range(len(y)):
if y[i] == y_test[i]:
cont += 1
return cont / float(len(y))
def f_measure(y_test, y, beta=1):
tp = 0.0
fp = 0.0
tn = 0.0
fn = 0.0
for i in range(len(y)):
if y_test[i] == 1.0 and y[i] == 1.0:
tp += 1.0
elif y_test[i] == 1.0 and y[i] == 0.0:
fp += 1.0
elif y_test[i] == 0.0 and y[i] == 0.0:
tn += 1.0
elif y_test[i] == 0.0 and y[i] == 1.0:
fn += 1.0
if tp + fp != 0.0:
precision = tp / (tp + fp)
else:
precision = 0.0
if tp + fn != 0.0:
recall = tp / (tp + fn)
else:
recall = 0.0
if beta ** 2.0 * precision + recall != 0:
resultado = (1.0 + beta ** 2.0) * (precision * recall / (beta ** 2.0 * precision + recall))
else:
resultado = 0.0
return resultado |
# MIT License
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
#
# applianceCrashHistory : returns and posts all Appliances crash history
def appliance_crash_history(
self,
action: str = None,
):
"""Get appliance crash history. Can optionally send crash reports to
Cloud Portal
.. list-table::
:header-rows: 1
* - Swagger Section
- Method
- Endpoint
* - applianceCrashHistory
- GET
- /gms/applianceCrashHistory
:param action: If this paramter has a value, the appliance crash
reports will be sent to Cloud Portal, defaults to None
:type action: str, optional
:return: Returns True/False based on successful call sending crash
reports to Cloud Portal. If action is None, will return dict of
appliance crash history.
:rtype: bool or dict
"""
if action is not None:
return self._get(
"/gms/applianceCrashHistory?action={}".format(action),
expected_status=[204],
return_type="bool",
)
else:
return self._get("/gms/applianceCrashHistory")
| def appliance_crash_history(self, action: str=None):
"""Get appliance crash history. Can optionally send crash reports to
Cloud Portal
.. list-table::
:header-rows: 1
* - Swagger Section
- Method
- Endpoint
* - applianceCrashHistory
- GET
- /gms/applianceCrashHistory
:param action: If this paramter has a value, the appliance crash
reports will be sent to Cloud Portal, defaults to None
:type action: str, optional
:return: Returns True/False based on successful call sending crash
reports to Cloud Portal. If action is None, will return dict of
appliance crash history.
:rtype: bool or dict
"""
if action is not None:
return self._get('/gms/applianceCrashHistory?action={}'.format(action), expected_status=[204], return_type='bool')
else:
return self._get('/gms/applianceCrashHistory') |
name0_1_1_0_1_0_0 = None
name0_1_1_0_1_0_1 = None
name0_1_1_0_1_0_2 = None
name0_1_1_0_1_0_3 = None
name0_1_1_0_1_0_4 = None | name0_1_1_0_1_0_0 = None
name0_1_1_0_1_0_1 = None
name0_1_1_0_1_0_2 = None
name0_1_1_0_1_0_3 = None
name0_1_1_0_1_0_4 = None |
class HandResponse:
cost = None
han = None
fu = None
fu_details = None
yaku = None
error = None
is_open_hand = False
def __init__(self, cost=None, han=None, fu=None, yaku=None, error=None, fu_details=None, is_open_hand=False):
"""
:param cost: dict
:param han: int
:param fu: int
:param yaku: list
:param error: str
:param fu_details: dict
"""
self.cost = cost
self.han = han
self.fu = fu
self.error = error
self.is_open_hand = is_open_hand # adding this field for yaku reporting
if fu_details:
self.fu_details = sorted(fu_details, key=lambda x: x["fu"], reverse=True)
else:
self.fu_details = None
if yaku:
self.yaku = sorted(yaku, key=lambda x: x.yaku_id)
else:
self.yaku = None
def __str__(self):
if self.error:
return self.error
else:
return "{} han, {} fu".format(self.han, self.fu)
| class Handresponse:
cost = None
han = None
fu = None
fu_details = None
yaku = None
error = None
is_open_hand = False
def __init__(self, cost=None, han=None, fu=None, yaku=None, error=None, fu_details=None, is_open_hand=False):
"""
:param cost: dict
:param han: int
:param fu: int
:param yaku: list
:param error: str
:param fu_details: dict
"""
self.cost = cost
self.han = han
self.fu = fu
self.error = error
self.is_open_hand = is_open_hand
if fu_details:
self.fu_details = sorted(fu_details, key=lambda x: x['fu'], reverse=True)
else:
self.fu_details = None
if yaku:
self.yaku = sorted(yaku, key=lambda x: x.yaku_id)
else:
self.yaku = None
def __str__(self):
if self.error:
return self.error
else:
return '{} han, {} fu'.format(self.han, self.fu) |
'''
- Leetcode problem: 653
- Difficulty: Easy
- Brief problem description:
Given a Binary Search Tree and a target number,
return true if there exist two elements in the BST such
that their sum is equal to the given target.
Example 1:
Input:
5
/ \
3 6
/ \ \
2 4 7
Target = 9
Output: True
Example 2:
Input:
5
/ \
3 6
/ \ \
2 4 7
Target = 28
Output: False
- Solution Summary:
1. Search the tree recursively, maintain a set of targets.
- Used Resources:
--- Bo Zhou
'''
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findTarget(self, root, k):
"""
:type root: TreeNode
:type k: int
:rtype: bool
"""
targets = set()
return self.findTarget2(root, k, targets)
def findTarget2(self, root, k, targets):
if root == None:
return False
elif root.val in targets:
return True
else:
targets.add(k - root.val)
return self.findTarget2(root.left, k, targets) or self.findTarget2(root.right, k, targets)
| """
- Leetcode problem: 653
- Difficulty: Easy
- Brief problem description:
Given a Binary Search Tree and a target number,
return true if there exist two elements in the BST such
that their sum is equal to the given target.
Example 1:
Input:
5
/ 3 6
/ \\ 2 4 7
Target = 9
Output: True
Example 2:
Input:
5
/ 3 6
/ \\ 2 4 7
Target = 28
Output: False
- Solution Summary:
1. Search the tree recursively, maintain a set of targets.
- Used Resources:
--- Bo Zhou
"""
class Solution(object):
def find_target(self, root, k):
"""
:type root: TreeNode
:type k: int
:rtype: bool
"""
targets = set()
return self.findTarget2(root, k, targets)
def find_target2(self, root, k, targets):
if root == None:
return False
elif root.val in targets:
return True
else:
targets.add(k - root.val)
return self.findTarget2(root.left, k, targets) or self.findTarget2(root.right, k, targets) |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isSymmetric(self, root: Optional[TreeNode]) -> bool:
# both does not exist
if not root.left and not root.right:
return True
# one exists - left or right
elif not root.left or not root.right:
return False
# both left and right exists
stack1=[root.left]
output1=[root.left.val]
stack2=[root.right]
output2=[root.right.val]
# append left first
while(stack1):
cur = stack1.pop(0)
if cur.left:
stack1.append(cur.left)
output1.append(cur.left.val)
else:
output1.append(101) # 101 = null
if cur.right:
stack1.append(cur.right)
output1.append(cur.right.val)
else:
output1.append(101)
# append right first
while(stack2):
cur = stack2.pop(0)
if cur.right:
output2.append(cur.right.val)
stack2.append(cur.right)
else:
output2.append(101)
if cur.left:
output2.append(cur.left.val)
stack2.append(cur.left)
else:
output2.append(101)
if output1==output2:
return True
else:
return False
| class Solution:
def is_symmetric(self, root: Optional[TreeNode]) -> bool:
if not root.left and (not root.right):
return True
elif not root.left or not root.right:
return False
stack1 = [root.left]
output1 = [root.left.val]
stack2 = [root.right]
output2 = [root.right.val]
while stack1:
cur = stack1.pop(0)
if cur.left:
stack1.append(cur.left)
output1.append(cur.left.val)
else:
output1.append(101)
if cur.right:
stack1.append(cur.right)
output1.append(cur.right.val)
else:
output1.append(101)
while stack2:
cur = stack2.pop(0)
if cur.right:
output2.append(cur.right.val)
stack2.append(cur.right)
else:
output2.append(101)
if cur.left:
output2.append(cur.left.val)
stack2.append(cur.left)
else:
output2.append(101)
if output1 == output2:
return True
else:
return False |
load("@bazel_gazelle//:deps.bzl", "go_repository")
def go_dependencies():
go_repository(
name = "com_github_aws_aws_sdk_go",
importpath = "github.com/aws/aws-sdk-go",
sum = "h1:3+AsCrxxnhiUQEhWV+j3kEs7aBCIn2qkDjA+elpxYPU=",
version = "v1.33.13",
)
go_repository(
name = "com_github_bazelbuild_remote_apis",
importpath = "github.com/bazelbuild/remote-apis",
patches = ["@com_github_buildbarn_bb_storage//:patches/com_github_bazelbuild_remote_apis/golang.diff"],
sum = "h1:in8ww8rHwdcmLN3J9atiRDvAaYHobXBJzp7uAxlUREU=",
version = "v0.0.0-20201030192148-aa8e718768c2",
)
go_repository(
name = "com_github_beorn7_perks",
importpath = "github.com/beorn7/perks",
sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=",
version = "v1.0.1",
)
go_repository(
name = "com_github_buildbarn_bb_storage",
importpath = "github.com/buildbarn/bb-storage",
sum = "h1:3AAcc2jsQLIZKhJn3NFPX6FLDDpnF9qNEGJhvHmW+4k=",
version = "v0.0.0-20210107084738-1b5cc8edeecb",
)
go_repository(
name = "com_github_golang_mock",
importpath = "github.com/golang/mock",
patches = ["@com_github_buildbarn_bb_storage//:patches/com_github_golang_mock/mocks-for-funcs.diff"],
sum = "h1:YS+8QJ8yKSoB7Qy3WF0DMDFj2TkfASqhc0aNIIxjl6I=",
version = "v1.4.4-0.20200406172829-6d816de489c1",
)
go_repository(
name = "com_github_google_uuid",
importpath = "github.com/google/uuid",
sum = "h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=",
version = "v1.1.1",
)
go_repository(
name = "com_github_go_redis_redis",
importpath = "github.com/go-redis/redis",
sum = "h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o=",
version = "v6.15.8+incompatible",
)
go_repository(
name = "com_github_grpc_ecosystem_go_grpc_prometheus",
importpath = "github.com/grpc-ecosystem/go-grpc-prometheus",
patches = ["@com_github_buildbarn_bb_storage//:patches/com_github_grpc_ecosystem_go_grpc_prometheus/client-metrics-prevent-handled-twice.diff"],
sum = "h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=",
version = "v1.2.0",
)
go_repository(
name = "com_github_lazybeaver_xorshift",
importpath = "github.com/lazybeaver/xorshift",
sum = "h1:TfmftEfB1zJiDTFi3Qw1xlbEbfJPKUhEDC19clfBMb8=",
version = "v0.0.0-20170702203709-ce511d4823dd",
)
go_repository(
name = "com_github_matttproud_golang_protobuf_extensions",
importpath = "github.com/matttproud/golang_protobuf_extensions",
sum = "h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=",
version = "v1.0.1",
)
go_repository(
name = "com_github_prometheus_client_golang",
importpath = "github.com/prometheus/client_golang",
sum = "h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=",
version = "v1.7.1",
)
go_repository(
name = "com_github_cespare_xxhash_v2",
importpath = "github.com/cespare/xxhash/v2",
sum = "h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=",
version = "v2.1.1",
)
go_repository(
name = "com_github_prometheus_client_model",
importpath = "github.com/prometheus/client_model",
sum = "h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=",
version = "v0.2.0",
)
go_repository(
name = "com_github_prometheus_common",
importpath = "github.com/prometheus/common",
sum = "h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=",
version = "v0.10.0",
)
go_repository(
name = "com_github_prometheus_procfs",
importpath = "github.com/prometheus/procfs",
sum = "h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=",
version = "v0.1.3",
)
go_repository(
name = "com_github_stretchr_testify",
importpath = "github.com/stretchr/testify",
sum = "h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=",
version = "v1.6.1",
)
go_repository(
name = "in_gopkg_yaml_v2",
importpath = "gopkg.in/yaml.v2",
sum = "h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=",
version = "v2.3.0",
)
go_repository(
name = "io_opencensus_go_contrib_exporter_prometheus",
importpath = "contrib.go.opencensus.io/exporter/prometheus",
sum = "h1:9PUk0/8V0LGoPqVCrf8fQZJkFGBxudu8jOjQSMwoD6w=",
version = "v0.2.0",
)
go_repository(
name = "io_opencensus_go_contrib_exporter_jaeger",
importpath = "contrib.go.opencensus.io/exporter/jaeger",
sum = "h1:nhTv/Ry3lGmqbJ/JGvCjWxBl5ozRfqo86Ngz59UAlfk=",
version = "v0.2.0",
)
go_repository(
name = "dev_gocloud",
importpath = "gocloud.dev",
sum = "h1:mbEKMfnyPV7W1Rj35R1xXfjszs9dXkwSOq2KoFr25g8=",
version = "v0.20.0",
)
go_repository(
name = "org_golang_google_api",
importpath = "google.golang.org/api",
sum = "h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk=",
version = "v0.29.0",
)
go_repository(
name = "com_github_uber_jaeger_client_go",
importpath = "github.com/uber/jaeger-client-go",
sum = "h1:Q2Pp6v3QYiocMxomCaJuwQGFt7E53bPYqEgug/AoBtY=",
version = "v2.16.0+incompatible",
)
go_repository(
name = "org_golang_x_sync",
importpath = "golang.org/x/sync",
sum = "h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=",
version = "v0.0.0-20200625203802-6e8e738ad208",
)
go_repository(
name = "io_opencensus_go",
importpath = "go.opencensus.io",
sum = "h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=",
version = "v0.22.4",
)
go_repository(
name = "com_google_cloud_go",
importpath = "cloud.google.com/go",
sum = "h1:vtAfVc723K3xKq1BQydk/FyCldnaNFhGhpJxaJzgRMQ=",
version = "v0.58.0",
)
go_repository(
name = "org_golang_x_xerrors",
importpath = "golang.org/x/xerrors",
sum = "h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=",
version = "v0.0.0-20191204190536-9bdfabe68543",
)
go_repository(
name = "com_github_hashicorp_golang_lru",
importpath = "github.com/hashicorp/golang-lru",
sum = "h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=",
version = "v0.5.1",
)
go_repository(
name = "com_github_googleapis_gax_go",
importpath = "github.com/googleapis/gax-go",
sum = "h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww=",
version = "v2.0.2+incompatible",
)
go_repository(
name = "org_golang_x_oauth2",
importpath = "golang.org/x/oauth2",
sum = "h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=",
version = "v0.0.0-20200107190931-bf48bf16ab8d",
)
go_repository(
name = "com_github_google_wire",
build_extra_args = ["--exclude=internal/wire/testdata"],
importpath = "github.com/google/wire",
sum = "h1:kXcsA/rIGzJImVqPdhfnr6q0xsS9gU0515q1EPpJ9fE=",
version = "v0.4.0",
)
go_repository(
name = "com_github_azure_azure_pipeline_go",
importpath = "github.com/Azure/azure-pipeline-go",
sum = "h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY=",
version = "v0.2.2",
)
go_repository(
name = "com_github_azure_azure_storage_blob_go",
importpath = "github.com/Azure/azure-storage-blob-go",
sum = "h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs=",
version = "v0.10.0",
)
go_repository(
name = "com_github_google_go_jsonnet",
importpath = "github.com/google/go-jsonnet",
patches = ["@com_github_buildbarn_bb_storage//:patches/com_github_google_go_jsonnet/astgen.diff"],
sum = "h1:Nb4EEOp+rdeGGyB1rQ5eisgSAqrTnhf9ip+X6lzZbY0=",
version = "v0.16.0",
)
go_repository(
name = "com_github_fatih_color",
importpath = "github.com/fatih/color",
sum = "h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=",
version = "v1.9.0",
)
go_repository(
name = "com_github_gorilla_mux",
importpath = "github.com/gorilla/mux",
sum = "h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=",
version = "v1.7.4",
)
go_repository(
name = "com_github_googleapis_gax_go_v2",
importpath = "github.com/googleapis/gax-go/v2",
sum = "h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=",
version = "v2.0.5",
)
go_repository(
name = "com_github_mattn_go_ieproxy",
importpath = "github.com/mattn/go-ieproxy",
sum = "h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI=",
version = "v0.0.1",
)
go_repository(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable",
importpath = "google.golang.org/grpc",
sum = "h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI=",
version = "v1.31.0",
)
go_repository(
name = "org_golang_x_lint",
importpath = "golang.org/x/lint",
sum = "h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=",
version = "v0.0.0-20200302205851-738671d3881b",
)
go_repository(
name = "co_honnef_go_tools",
importpath = "honnef.co/go/tools",
sum = "h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=",
version = "v0.0.1-2020.1.4",
)
go_repository(
name = "com_github_alecthomas_template",
importpath = "github.com/alecthomas/template",
sum = "h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=",
version = "v0.0.0-20190718012654-fb15b899a751",
)
go_repository(
name = "com_github_alecthomas_units",
importpath = "github.com/alecthomas/units",
sum = "h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E=",
version = "v0.0.0-20190717042225-c3de453c63f4",
)
go_repository(
name = "com_github_azure_azure_amqp_common_go_v3",
importpath = "github.com/Azure/azure-amqp-common-go/v3",
sum = "h1:j9tjcwhypb/jek3raNrwlCIl7iKQYOug7CLpSyBBodc=",
version = "v3.0.0",
)
go_repository(
name = "com_github_azure_azure_sdk_for_go",
importpath = "github.com/Azure/azure-sdk-for-go",
sum = "h1:aFlw3lP7ZHQi4m1kWCpcwYtczhDkGhDoRaMTaxcOf68=",
version = "v37.1.0+incompatible",
)
go_repository(
name = "com_github_azure_azure_service_bus_go",
importpath = "github.com/Azure/azure-service-bus-go",
sum = "h1:w9foWsHoOt1n8R0O58Co/ddrazx5vfDY0g64/6UWyuo=",
version = "v0.10.1",
)
go_repository(
name = "com_github_azure_go_amqp",
importpath = "github.com/Azure/go-amqp",
sum = "h1:/Uyqh30J5JrDFAOERQtEqP0qPWkrNXxr94vRnSa54Ac=",
version = "v0.12.7",
)
go_repository(
name = "com_github_azure_go_autorest_autorest",
importpath = "github.com/Azure/go-autorest/autorest",
sum = "h1:OZEIaBbMdUE/Js+BQKlpO81XlISgipr6yDJ+PSwsgi4=",
version = "v0.9.3",
)
go_repository(
name = "com_github_azure_go_autorest_autorest_adal",
importpath = "github.com/Azure/go-autorest/autorest/adal",
sum = "h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw=",
version = "v0.8.3",
)
go_repository(
name = "com_github_azure_go_autorest_autorest_azure_auth",
importpath = "github.com/Azure/go-autorest/autorest/azure/auth",
sum = "h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk=",
version = "v0.4.2",
)
go_repository(
name = "com_github_azure_go_autorest_autorest_azure_cli",
importpath = "github.com/Azure/go-autorest/autorest/azure/cli",
sum = "h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U=",
version = "v0.3.1",
)
go_repository(
name = "com_github_azure_go_autorest_autorest_date",
importpath = "github.com/Azure/go-autorest/autorest/date",
sum = "h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM=",
version = "v0.2.0",
)
go_repository(
name = "com_github_azure_go_autorest_autorest_mocks",
importpath = "github.com/Azure/go-autorest/autorest/mocks",
sum = "h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc=",
version = "v0.3.0",
)
go_repository(
name = "com_github_azure_go_autorest_autorest_to",
importpath = "github.com/Azure/go-autorest/autorest/to",
sum = "h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8=",
version = "v0.3.0",
)
go_repository(
name = "com_github_azure_go_autorest_autorest_validation",
importpath = "github.com/Azure/go-autorest/autorest/validation",
sum = "h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4=",
version = "v0.2.0",
)
go_repository(
name = "com_github_azure_go_autorest_logger",
importpath = "github.com/Azure/go-autorest/logger",
sum = "h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=",
version = "v0.1.0",
)
go_repository(
name = "com_github_azure_go_autorest_tracing",
importpath = "github.com/Azure/go-autorest/tracing",
sum = "h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=",
version = "v0.5.0",
)
go_repository(
name = "com_github_burntsushi_toml",
importpath = "github.com/BurntSushi/toml",
sum = "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=",
version = "v0.3.1",
)
go_repository(
name = "com_github_burntsushi_xgb",
importpath = "github.com/BurntSushi/xgb",
sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=",
version = "v0.0.0-20160522181843-27f122750802",
)
go_repository(
name = "com_github_census_instrumentation_opencensus_proto",
build_extra_args = ["-exclude=src"],
importpath = "github.com/census-instrumentation/opencensus-proto",
sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=",
version = "v0.2.1",
)
go_repository(
name = "com_github_chzyer_logex",
importpath = "github.com/chzyer/logex",
sum = "h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=",
version = "v1.1.10",
)
go_repository(
name = "com_github_chzyer_readline",
importpath = "github.com/chzyer/readline",
sum = "h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=",
version = "v0.0.0-20180603132655-2972be24d48e",
)
go_repository(
name = "com_github_chzyer_test",
importpath = "github.com/chzyer/test",
sum = "h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=",
version = "v0.0.0-20180213035817-a1ea475d72b1",
)
go_repository(
name = "com_github_client9_misspell",
importpath = "github.com/client9/misspell",
sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=",
version = "v0.3.4",
)
go_repository(
name = "com_github_cncf_udpa_go",
importpath = "github.com/cncf/udpa/go",
sum = "h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=",
version = "v0.0.0-20191209042840-269d4d468f6f",
)
go_repository(
name = "com_github_davecgh_go_spew",
importpath = "github.com/davecgh/go-spew",
sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=",
version = "v1.1.1",
)
go_repository(
name = "com_github_devigned_tab",
importpath = "github.com/devigned/tab",
sum = "h1:3mD6Kb1mUOYeLpJvTVSDwSg5ZsfSxfvxGRTxRsJsITA=",
version = "v0.1.1",
)
go_repository(
name = "com_github_dgrijalva_jwt_go",
importpath = "github.com/dgrijalva/jwt-go",
sum = "h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=",
version = "v3.2.0+incompatible",
)
go_repository(
name = "com_github_dimchansky_utfbom",
importpath = "github.com/dimchansky/utfbom",
sum = "h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4=",
version = "v1.1.0",
)
go_repository(
name = "com_github_envoyproxy_go_control_plane",
importpath = "github.com/envoyproxy/go-control-plane",
sum = "h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=",
version = "v0.9.4",
)
go_repository(
name = "com_github_envoyproxy_protoc_gen_validate",
importpath = "github.com/envoyproxy/protoc-gen-validate",
sum = "h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=",
version = "v0.1.0",
)
go_repository(
name = "com_github_fortytw2_leaktest",
importpath = "github.com/fortytw2/leaktest",
sum = "h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=",
version = "v1.3.0",
)
go_repository(
name = "com_github_fsnotify_fsnotify",
importpath = "github.com/fsnotify/fsnotify",
sum = "h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=",
version = "v1.4.9",
)
go_repository(
name = "com_github_go_gl_glfw",
importpath = "github.com/go-gl/glfw",
sum = "h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=",
version = "v0.0.0-20190409004039-e6da0acd62b1",
)
go_repository(
name = "com_github_go_gl_glfw_v3_3_glfw",
importpath = "github.com/go-gl/glfw/v3.3/glfw",
sum = "h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=",
version = "v0.0.0-20200222043503-6f7a984d4dc4",
)
go_repository(
name = "com_github_go_ini_ini",
importpath = "github.com/go-ini/ini",
sum = "h1:Mujh4R/dH6YL8bxuISne3xX2+qcQ9p0IxKAP6ExWoUo=",
version = "v1.25.4",
)
go_repository(
name = "com_github_go_kit_kit",
importpath = "github.com/go-kit/kit",
sum = "h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=",
version = "v0.9.0",
)
go_repository(
name = "com_github_go_logfmt_logfmt",
importpath = "github.com/go-logfmt/logfmt",
sum = "h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=",
version = "v0.4.0",
)
go_repository(
name = "com_github_go_sql_driver_mysql",
importpath = "github.com/go-sql-driver/mysql",
sum = "h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=",
version = "v1.5.0",
)
go_repository(
name = "com_github_go_stack_stack",
importpath = "github.com/go-stack/stack",
sum = "h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=",
version = "v1.8.0",
)
go_repository(
name = "com_github_gogo_protobuf",
importpath = "github.com/gogo/protobuf",
sum = "h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=",
version = "v1.1.1",
)
go_repository(
name = "com_github_golang_glog",
importpath = "github.com/golang/glog",
sum = "h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=",
version = "v0.0.0-20160126235308-23def4e6c14b",
)
go_repository(
name = "com_github_golang_groupcache",
importpath = "github.com/golang/groupcache",
sum = "h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=",
version = "v0.0.0-20200121045136-8c9f03a8e57e",
)
go_repository(
name = "com_github_golang_protobuf",
importpath = "github.com/golang/protobuf",
sum = "h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=",
version = "v1.4.2",
)
go_repository(
name = "com_github_google_btree",
importpath = "github.com/google/btree",
sum = "h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=",
version = "v1.0.0",
)
go_repository(
name = "com_github_google_go_cmp",
importpath = "github.com/google/go-cmp",
sum = "h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=",
version = "v0.5.1",
)
go_repository(
name = "com_github_google_go_replayers_grpcreplay",
importpath = "github.com/google/go-replayers/grpcreplay",
sum = "h1:eNb1y9rZFmY4ax45uEEECSa8fsxGRU+8Bil52ASAwic=",
version = "v0.1.0",
)
go_repository(
name = "com_github_google_go_replayers_httpreplay",
importpath = "github.com/google/go-replayers/httpreplay",
sum = "h1:AX7FUb4BjrrzNvblr/OlgwrmFiep6soj5K2QSDW7BGk=",
version = "v0.1.0",
)
go_repository(
name = "com_github_google_gofuzz",
importpath = "github.com/google/gofuzz",
sum = "h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=",
version = "v1.0.0",
)
go_repository(
name = "com_github_google_martian",
importpath = "github.com/google/martian",
sum = "h1:xmapqc1AyLoB+ddYT6r04bD9lIjlOqGaREovi0SzFaE=",
version = "v2.1.1-0.20190517191504-25dcb96d9e51+incompatible",
)
go_repository(
name = "com_github_google_pprof",
importpath = "github.com/google/pprof",
sum = "h1:lIC98ZUNah83ky7d9EXktLFe4H7Nwus59dTOLXr8xAI=",
version = "v0.0.0-20200507031123-427632fa3b1c",
)
go_repository(
name = "com_github_google_renameio",
importpath = "github.com/google/renameio",
sum = "h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=",
version = "v0.1.0",
)
go_repository(
name = "com_github_google_subcommands",
importpath = "github.com/google/subcommands",
sum = "h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k=",
version = "v1.0.1",
)
go_repository(
name = "com_github_googlecloudplatform_cloudsql_proxy",
importpath = "github.com/GoogleCloudPlatform/cloudsql-proxy",
sum = "h1:sTOp2Ajiew5XIH92YSdwhYc+bgpUX5j5TKK/Ac8Saw8=",
version = "v0.0.0-20191009163259-e802c2cb94ae",
)
go_repository(
name = "com_github_hpcloud_tail",
importpath = "github.com/hpcloud/tail",
sum = "h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=",
version = "v1.0.0",
)
go_repository(
name = "com_github_ianlancetaylor_demangle",
importpath = "github.com/ianlancetaylor/demangle",
sum = "h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=",
version = "v0.0.0-20181102032728-5e5cf60278f6",
)
go_repository(
name = "com_github_jmespath_go_jmespath",
importpath = "github.com/jmespath/go-jmespath",
sum = "h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=",
version = "v0.3.0",
)
go_repository(
name = "com_github_joho_godotenv",
importpath = "github.com/joho/godotenv",
sum = "h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=",
version = "v1.3.0",
)
go_repository(
name = "com_github_json_iterator_go",
importpath = "github.com/json-iterator/go",
sum = "h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=",
version = "v1.1.10",
)
go_repository(
name = "com_github_jstemmer_go_junit_report",
importpath = "github.com/jstemmer/go-junit-report",
sum = "h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=",
version = "v0.9.1",
)
go_repository(
name = "com_github_julienschmidt_httprouter",
importpath = "github.com/julienschmidt/httprouter",
sum = "h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g=",
version = "v1.2.0",
)
go_repository(
name = "com_github_kisielk_gotool",
importpath = "github.com/kisielk/gotool",
sum = "h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=",
version = "v1.0.0",
)
go_repository(
name = "com_github_konsorten_go_windows_terminal_sequences",
importpath = "github.com/konsorten/go-windows-terminal-sequences",
sum = "h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=",
version = "v1.0.1",
)
go_repository(
name = "com_github_kr_logfmt",
importpath = "github.com/kr/logfmt",
sum = "h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=",
version = "v0.0.0-20140226030751-b84e30acd515",
)
go_repository(
name = "com_github_kr_pretty",
importpath = "github.com/kr/pretty",
sum = "h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=",
version = "v0.1.0",
)
go_repository(
name = "com_github_kr_pty",
importpath = "github.com/kr/pty",
sum = "h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=",
version = "v1.1.1",
)
go_repository(
name = "com_github_kr_text",
importpath = "github.com/kr/text",
sum = "h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=",
version = "v0.1.0",
)
go_repository(
name = "com_github_lib_pq",
importpath = "github.com/lib/pq",
sum = "h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=",
version = "v1.1.1",
)
go_repository(
name = "com_github_mattn_go_colorable",
importpath = "github.com/mattn/go-colorable",
sum = "h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=",
version = "v0.1.4",
)
go_repository(
name = "com_github_mattn_go_isatty",
importpath = "github.com/mattn/go-isatty",
sum = "h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=",
version = "v0.0.11",
)
go_repository(
name = "com_github_mitchellh_go_homedir",
importpath = "github.com/mitchellh/go-homedir",
sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=",
version = "v1.1.0",
)
go_repository(
name = "com_github_mitchellh_mapstructure",
importpath = "github.com/mitchellh/mapstructure",
sum = "h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=",
version = "v1.1.2",
)
go_repository(
name = "com_github_modern_go_concurrent",
importpath = "github.com/modern-go/concurrent",
sum = "h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=",
version = "v0.0.0-20180306012644-bacd9c7ef1dd",
)
go_repository(
name = "com_github_modern_go_reflect2",
importpath = "github.com/modern-go/reflect2",
sum = "h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=",
version = "v1.0.1",
)
go_repository(
name = "com_github_mwitkow_go_conntrack",
importpath = "github.com/mwitkow/go-conntrack",
sum = "h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc=",
version = "v0.0.0-20161129095857-cc309e4a2223",
)
go_repository(
name = "com_github_nxadm_tail",
importpath = "github.com/nxadm/tail",
sum = "h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=",
version = "v1.4.4",
)
go_repository(
name = "com_github_onsi_ginkgo",
importpath = "github.com/onsi/ginkgo",
sum = "h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=",
version = "v1.14.1",
)
go_repository(
name = "com_github_onsi_gomega",
importpath = "github.com/onsi/gomega",
sum = "h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs=",
version = "v1.10.2",
)
go_repository(
name = "com_github_pkg_errors",
importpath = "github.com/pkg/errors",
sum = "h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=",
version = "v0.9.1",
)
go_repository(
name = "com_github_pmezard_go_difflib",
importpath = "github.com/pmezard/go-difflib",
sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=",
version = "v1.0.0",
)
go_repository(
name = "com_github_prometheus_statsd_exporter",
importpath = "github.com/prometheus/statsd_exporter",
sum = "h1:UiwC1L5HkxEPeapXdm2Ye0u1vUJfTj7uwT5yydYpa1E=",
version = "v0.15.0",
)
go_repository(
name = "com_github_rogpeppe_go_internal",
importpath = "github.com/rogpeppe/go-internal",
sum = "h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=",
version = "v1.6.1",
)
go_repository(
name = "com_github_sergi_go_diff",
importpath = "github.com/sergi/go-diff",
sum = "h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=",
version = "v1.1.0",
)
go_repository(
name = "com_github_sirupsen_logrus",
importpath = "github.com/sirupsen/logrus",
sum = "h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=",
version = "v1.4.2",
)
go_repository(
name = "com_github_stretchr_objx",
importpath = "github.com/stretchr/objx",
sum = "h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=",
version = "v0.2.0",
)
go_repository(
name = "com_github_yuin_goldmark",
importpath = "github.com/yuin/goldmark",
sum = "h1:5tjfNdR2ki3yYQ842+eX2sQHeiwpKJ0RnHO4IYOc4V8=",
version = "v1.1.32",
)
go_repository(
name = "com_google_cloud_go_bigquery",
importpath = "cloud.google.com/go/bigquery",
sum = "h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA=",
version = "v1.8.0",
)
go_repository(
name = "com_google_cloud_go_datastore",
importpath = "cloud.google.com/go/datastore",
sum = "h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=",
version = "v1.1.0",
)
go_repository(
name = "com_google_cloud_go_firestore",
importpath = "cloud.google.com/go/firestore",
sum = "h1:zrl+2VJAYC/C6WzEPnkqZIBeHyHFs/UmtzJdXU4Bvmo=",
version = "v1.2.0",
)
go_repository(
name = "com_google_cloud_go_pubsub",
importpath = "cloud.google.com/go/pubsub",
sum = "h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU=",
version = "v1.3.1",
)
go_repository(
name = "com_google_cloud_go_storage",
importpath = "cloud.google.com/go/storage",
sum = "h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=",
version = "v1.10.0",
)
go_repository(
name = "com_shuralyov_dmitri_gpu_mtl",
importpath = "dmitri.shuralyov.com/gpu/mtl",
sum = "h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=",
version = "v0.0.0-20190408044501-666a987793e9",
)
go_repository(
name = "in_gopkg_alecthomas_kingpin_v2",
importpath = "gopkg.in/alecthomas/kingpin.v2",
sum = "h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=",
version = "v2.2.6",
)
go_repository(
name = "in_gopkg_check_v1",
importpath = "gopkg.in/check.v1",
sum = "h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=",
version = "v1.0.0-20190902080502-41f04d3bba15",
)
go_repository(
name = "in_gopkg_errgo_v2",
importpath = "gopkg.in/errgo.v2",
sum = "h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=",
version = "v2.1.0",
)
go_repository(
name = "in_gopkg_fsnotify_v1",
importpath = "gopkg.in/fsnotify.v1",
sum = "h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=",
version = "v1.4.7",
)
go_repository(
name = "in_gopkg_tomb_v1",
importpath = "gopkg.in/tomb.v1",
sum = "h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=",
version = "v1.0.0-20141024135613-dd632973f1e7",
)
go_repository(
name = "in_gopkg_yaml_v3",
importpath = "gopkg.in/yaml.v3",
sum = "h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=",
version = "v3.0.0-20200313102051-9f266ea9e77c",
)
go_repository(
name = "io_opencensus_go_contrib_exporter_aws",
importpath = "contrib.go.opencensus.io/exporter/aws",
sum = "h1:YsbWYxDZkC7x2OxlsDEYvvEXZ3cBI3qBgUK5BqkZvRw=",
version = "v0.0.0-20181029163544-2befc13012d0",
)
go_repository(
name = "io_opencensus_go_contrib_exporter_stackdriver",
importpath = "contrib.go.opencensus.io/exporter/stackdriver",
sum = "h1:ZRVpDigsb+nVI/yps/NLDOYzYjFFmm3OCsBhmYocxR0=",
version = "v0.12.9",
)
go_repository(
name = "io_opencensus_go_contrib_integrations_ocsql",
importpath = "contrib.go.opencensus.io/integrations/ocsql",
sum = "h1:kfg5Yyy1nYUrqzyfW5XX+dzMASky8IJXhtHe0KTYNS4=",
version = "v0.1.4",
)
go_repository(
name = "io_opencensus_go_contrib_resource",
importpath = "contrib.go.opencensus.io/resource",
sum = "h1:4r2CANuYhKGmYWP02+5E94rLRcS/YeD+KlxSrOsMxk0=",
version = "v0.1.1",
)
go_repository(
name = "io_rsc_binaryregexp",
importpath = "rsc.io/binaryregexp",
sum = "h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=",
version = "v0.2.0",
)
go_repository(
name = "io_rsc_quote_v3",
importpath = "rsc.io/quote/v3",
sum = "h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY=",
version = "v3.1.0",
)
go_repository(
name = "io_rsc_sampler",
importpath = "rsc.io/sampler",
sum = "h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=",
version = "v1.3.0",
)
go_repository(
name = "org_bazil_fuse",
importpath = "bazil.org/fuse",
sum = "h1:FNCRpXiquG1aoyqcIWVFmpTSKVcx2bQD38uZZeGtdlw=",
version = "v0.0.0-20180421153158-65cc252bf669",
)
go_repository(
name = "org_golang_google_appengine",
importpath = "google.golang.org/appengine",
sum = "h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=",
version = "v1.6.6",
)
go_repository(
name = "org_golang_google_genproto",
importpath = "google.golang.org/genproto",
sum = "h1:HJaAqDnKreMkv+AQyf1Mcw0jEmL9kKBNL07RDJu1N/k=",
version = "v0.0.0-20200726014623-da3ae01ef02d",
)
go_repository(
name = "org_golang_google_protobuf",
importpath = "google.golang.org/protobuf",
sum = "h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA=",
version = "v1.24.0",
)
go_repository(
name = "org_golang_x_crypto",
importpath = "golang.org/x/crypto",
sum = "h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=",
version = "v0.0.0-20200622213623-75b288015ac9",
)
go_repository(
name = "org_golang_x_exp",
importpath = "golang.org/x/exp",
sum = "h1:5XVKs2rlCg8EFyRcvO8/XFwYxh1oKJO1Q3X5vttIf9c=",
version = "v0.0.0-20200908183739-ae8ad444f925",
)
go_repository(
name = "org_golang_x_image",
importpath = "golang.org/x/image",
sum = "h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=",
version = "v0.0.0-20190802002840-cff245a6509b",
)
go_repository(
name = "org_golang_x_mobile",
importpath = "golang.org/x/mobile",
sum = "h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=",
version = "v0.0.0-20190719004257-d2bd2a29d028",
)
go_repository(
name = "org_golang_x_mod",
importpath = "golang.org/x/mod",
sum = "h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=",
version = "v0.3.1-0.20200828183125-ce943fd02449",
)
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=",
version = "v0.0.0-20200707034311-ab3426394381",
)
go_repository(
name = "org_golang_x_sys",
importpath = "golang.org/x/sys",
sum = "h1:gtF+PUC1CD1a9ocwQHbVNXuTp6RQsAYt6tpi6zjT81Y=",
version = "v0.0.0-20200727154430-2d971f7391a4",
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=",
version = "v0.3.2",
)
go_repository(
name = "org_golang_x_time",
importpath = "golang.org/x/time",
sum = "h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=",
version = "v0.0.0-20191024005414-555d28b269f0",
)
go_repository(
name = "org_golang_x_tools",
importpath = "golang.org/x/tools",
sum = "h1:qKpj8TpV+LEhel7H/fR788J+KvhWZ3o3V6N2fU/iuLU=",
version = "v0.0.0-20200731060945-b5fad4ed8dd6",
)
go_repository(
name = "com_github_opentracing_opentracing_go",
importpath = "github.com/opentracing/opentracing-go",
sum = "h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=",
version = "v1.2.0",
)
go_repository(
name = "com_github_uber_jaeger_lib",
importpath = "github.com/uber/jaeger-lib",
sum = "h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=",
version = "v2.2.0+incompatible",
)
go_repository(
name = "com_github_uber_go_atomic",
importpath = "github.com/uber-go/atomic",
sum = "h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o=",
version = "v1.4.0",
)
go_repository(
name = "com_github_golang_lint",
importpath = "github.com/golang/lint",
sum = "h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA=",
version = "v0.0.0-20180702182130-06c8688daad7",
)
go_repository(
name = "com_github_gordonklaus_ineffassign",
importpath = "github.com/gordonklaus/ineffassign",
sum = "h1:vc7Dmrk4JwS0ZPS6WZvWlwDflgDTA26jItmbSj83nug=",
version = "v0.0.0-20200309095847-7953dde2c7bf",
)
go_repository(
name = "com_github_benbjohnson_clock",
importpath = "github.com/benbjohnson/clock",
sum = "h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg=",
version = "v1.0.3",
)
go_repository(
name = "com_github_datadog_sketches_go",
importpath = "github.com/DataDog/sketches-go",
sum = "h1:qELHH0AWCvf98Yf+CNIJx9vOZOfHFDDzgDRYsnNk/vs=",
version = "v0.0.0-20190923095040-43f19ad77ff7",
)
go_repository(
name = "com_github_dgryski_go_rendezvous",
importpath = "github.com/dgryski/go-rendezvous",
sum = "h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=",
version = "v0.0.0-20200823014737-9f7001d12a5f",
)
go_repository(
name = "com_github_go_redis_redis_v8",
importpath = "github.com/go-redis/redis/v8",
sum = "h1:PC0VsF9sFFd2sko5bu30aEFc8F1TKl6n65o0b8FnCIE=",
version = "v8.0.0",
)
go_repository(
name = "io_opentelemetry_go_otel",
build_file_proto_mode = "disable",
importpath = "go.opentelemetry.io/otel",
sum = "h1:IN2tzQa9Gc4ZVKnTaMbPVcHjvzOdg5n9QfnmlqiET7E=",
version = "v0.11.0",
)
go_repository(
name = "com_github_go_redis_redisext",
importpath = "github.com/go-redis/redisext",
sum = "h1:rgukAuvD0qvfw2CZF9bSEstzBb3WnSgRvHK+hj8Nwp0=",
version = "v0.1.7",
)
go_repository(
name = "cc_mvdan_gofumpt",
importpath = "mvdan.cc/gofumpt",
sum = "h1:QQ9mYdTscaVSaHC8A1wtLkECzvpD/YO2E2GyPvU1D/Y=",
version = "v0.0.0-20201027171050-85d5401eb0f6",
)
go_repository(
name = "com_github_hanwen_go_fuse",
importpath = "github.com/hanwen/go-fuse",
sum = "h1:GxS9Zrn6c35/BnfiVsZVWmsG803xwE7eVRDvcf/BEVc=",
version = "v1.0.0",
)
go_repository(
name = "com_github_hanwen_go_fuse_v2",
importpath = "github.com/hanwen/go-fuse/v2",
patches = [
"@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/daemon_timeout.diff",
"@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/direntrylist-testability.diff",
"@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/fuse-712-for-invalidation.diff",
"@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/notify-testability.diff",
],
sum = "h1:kpV28BKeSyVgZREItBLnaVBvOEwv2PuhNdKetwnvNHo=",
version = "v2.0.3",
)
go_repository(
name = "com_github_kylelemons_godebug",
importpath = "github.com/kylelemons/godebug",
sum = "h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=",
version = "v0.0.0-20170820004349-d65d576e9348",
)
| load('@bazel_gazelle//:deps.bzl', 'go_repository')
def go_dependencies():
go_repository(name='com_github_aws_aws_sdk_go', importpath='github.com/aws/aws-sdk-go', sum='h1:3+AsCrxxnhiUQEhWV+j3kEs7aBCIn2qkDjA+elpxYPU=', version='v1.33.13')
go_repository(name='com_github_bazelbuild_remote_apis', importpath='github.com/bazelbuild/remote-apis', patches=['@com_github_buildbarn_bb_storage//:patches/com_github_bazelbuild_remote_apis/golang.diff'], sum='h1:in8ww8rHwdcmLN3J9atiRDvAaYHobXBJzp7uAxlUREU=', version='v0.0.0-20201030192148-aa8e718768c2')
go_repository(name='com_github_beorn7_perks', importpath='github.com/beorn7/perks', sum='h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=', version='v1.0.1')
go_repository(name='com_github_buildbarn_bb_storage', importpath='github.com/buildbarn/bb-storage', sum='h1:3AAcc2jsQLIZKhJn3NFPX6FLDDpnF9qNEGJhvHmW+4k=', version='v0.0.0-20210107084738-1b5cc8edeecb')
go_repository(name='com_github_golang_mock', importpath='github.com/golang/mock', patches=['@com_github_buildbarn_bb_storage//:patches/com_github_golang_mock/mocks-for-funcs.diff'], sum='h1:YS+8QJ8yKSoB7Qy3WF0DMDFj2TkfASqhc0aNIIxjl6I=', version='v1.4.4-0.20200406172829-6d816de489c1')
go_repository(name='com_github_google_uuid', importpath='github.com/google/uuid', sum='h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=', version='v1.1.1')
go_repository(name='com_github_go_redis_redis', importpath='github.com/go-redis/redis', sum='h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o=', version='v6.15.8+incompatible')
go_repository(name='com_github_grpc_ecosystem_go_grpc_prometheus', importpath='github.com/grpc-ecosystem/go-grpc-prometheus', patches=['@com_github_buildbarn_bb_storage//:patches/com_github_grpc_ecosystem_go_grpc_prometheus/client-metrics-prevent-handled-twice.diff'], sum='h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=', version='v1.2.0')
go_repository(name='com_github_lazybeaver_xorshift', importpath='github.com/lazybeaver/xorshift', sum='h1:TfmftEfB1zJiDTFi3Qw1xlbEbfJPKUhEDC19clfBMb8=', version='v0.0.0-20170702203709-ce511d4823dd')
go_repository(name='com_github_matttproud_golang_protobuf_extensions', importpath='github.com/matttproud/golang_protobuf_extensions', sum='h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=', version='v1.0.1')
go_repository(name='com_github_prometheus_client_golang', importpath='github.com/prometheus/client_golang', sum='h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=', version='v1.7.1')
go_repository(name='com_github_cespare_xxhash_v2', importpath='github.com/cespare/xxhash/v2', sum='h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=', version='v2.1.1')
go_repository(name='com_github_prometheus_client_model', importpath='github.com/prometheus/client_model', sum='h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=', version='v0.2.0')
go_repository(name='com_github_prometheus_common', importpath='github.com/prometheus/common', sum='h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=', version='v0.10.0')
go_repository(name='com_github_prometheus_procfs', importpath='github.com/prometheus/procfs', sum='h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=', version='v0.1.3')
go_repository(name='com_github_stretchr_testify', importpath='github.com/stretchr/testify', sum='h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=', version='v1.6.1')
go_repository(name='in_gopkg_yaml_v2', importpath='gopkg.in/yaml.v2', sum='h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=', version='v2.3.0')
go_repository(name='io_opencensus_go_contrib_exporter_prometheus', importpath='contrib.go.opencensus.io/exporter/prometheus', sum='h1:9PUk0/8V0LGoPqVCrf8fQZJkFGBxudu8jOjQSMwoD6w=', version='v0.2.0')
go_repository(name='io_opencensus_go_contrib_exporter_jaeger', importpath='contrib.go.opencensus.io/exporter/jaeger', sum='h1:nhTv/Ry3lGmqbJ/JGvCjWxBl5ozRfqo86Ngz59UAlfk=', version='v0.2.0')
go_repository(name='dev_gocloud', importpath='gocloud.dev', sum='h1:mbEKMfnyPV7W1Rj35R1xXfjszs9dXkwSOq2KoFr25g8=', version='v0.20.0')
go_repository(name='org_golang_google_api', importpath='google.golang.org/api', sum='h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk=', version='v0.29.0')
go_repository(name='com_github_uber_jaeger_client_go', importpath='github.com/uber/jaeger-client-go', sum='h1:Q2Pp6v3QYiocMxomCaJuwQGFt7E53bPYqEgug/AoBtY=', version='v2.16.0+incompatible')
go_repository(name='org_golang_x_sync', importpath='golang.org/x/sync', sum='h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=', version='v0.0.0-20200625203802-6e8e738ad208')
go_repository(name='io_opencensus_go', importpath='go.opencensus.io', sum='h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=', version='v0.22.4')
go_repository(name='com_google_cloud_go', importpath='cloud.google.com/go', sum='h1:vtAfVc723K3xKq1BQydk/FyCldnaNFhGhpJxaJzgRMQ=', version='v0.58.0')
go_repository(name='org_golang_x_xerrors', importpath='golang.org/x/xerrors', sum='h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=', version='v0.0.0-20191204190536-9bdfabe68543')
go_repository(name='com_github_hashicorp_golang_lru', importpath='github.com/hashicorp/golang-lru', sum='h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=', version='v0.5.1')
go_repository(name='com_github_googleapis_gax_go', importpath='github.com/googleapis/gax-go', sum='h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww=', version='v2.0.2+incompatible')
go_repository(name='org_golang_x_oauth2', importpath='golang.org/x/oauth2', sum='h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=', version='v0.0.0-20200107190931-bf48bf16ab8d')
go_repository(name='com_github_google_wire', build_extra_args=['--exclude=internal/wire/testdata'], importpath='github.com/google/wire', sum='h1:kXcsA/rIGzJImVqPdhfnr6q0xsS9gU0515q1EPpJ9fE=', version='v0.4.0')
go_repository(name='com_github_azure_azure_pipeline_go', importpath='github.com/Azure/azure-pipeline-go', sum='h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY=', version='v0.2.2')
go_repository(name='com_github_azure_azure_storage_blob_go', importpath='github.com/Azure/azure-storage-blob-go', sum='h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs=', version='v0.10.0')
go_repository(name='com_github_google_go_jsonnet', importpath='github.com/google/go-jsonnet', patches=['@com_github_buildbarn_bb_storage//:patches/com_github_google_go_jsonnet/astgen.diff'], sum='h1:Nb4EEOp+rdeGGyB1rQ5eisgSAqrTnhf9ip+X6lzZbY0=', version='v0.16.0')
go_repository(name='com_github_fatih_color', importpath='github.com/fatih/color', sum='h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=', version='v1.9.0')
go_repository(name='com_github_gorilla_mux', importpath='github.com/gorilla/mux', sum='h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=', version='v1.7.4')
go_repository(name='com_github_googleapis_gax_go_v2', importpath='github.com/googleapis/gax-go/v2', sum='h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=', version='v2.0.5')
go_repository(name='com_github_mattn_go_ieproxy', importpath='github.com/mattn/go-ieproxy', sum='h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI=', version='v0.0.1')
go_repository(name='org_golang_google_grpc', build_file_proto_mode='disable', importpath='google.golang.org/grpc', sum='h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI=', version='v1.31.0')
go_repository(name='org_golang_x_lint', importpath='golang.org/x/lint', sum='h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=', version='v0.0.0-20200302205851-738671d3881b')
go_repository(name='co_honnef_go_tools', importpath='honnef.co/go/tools', sum='h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=', version='v0.0.1-2020.1.4')
go_repository(name='com_github_alecthomas_template', importpath='github.com/alecthomas/template', sum='h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=', version='v0.0.0-20190718012654-fb15b899a751')
go_repository(name='com_github_alecthomas_units', importpath='github.com/alecthomas/units', sum='h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E=', version='v0.0.0-20190717042225-c3de453c63f4')
go_repository(name='com_github_azure_azure_amqp_common_go_v3', importpath='github.com/Azure/azure-amqp-common-go/v3', sum='h1:j9tjcwhypb/jek3raNrwlCIl7iKQYOug7CLpSyBBodc=', version='v3.0.0')
go_repository(name='com_github_azure_azure_sdk_for_go', importpath='github.com/Azure/azure-sdk-for-go', sum='h1:aFlw3lP7ZHQi4m1kWCpcwYtczhDkGhDoRaMTaxcOf68=', version='v37.1.0+incompatible')
go_repository(name='com_github_azure_azure_service_bus_go', importpath='github.com/Azure/azure-service-bus-go', sum='h1:w9foWsHoOt1n8R0O58Co/ddrazx5vfDY0g64/6UWyuo=', version='v0.10.1')
go_repository(name='com_github_azure_go_amqp', importpath='github.com/Azure/go-amqp', sum='h1:/Uyqh30J5JrDFAOERQtEqP0qPWkrNXxr94vRnSa54Ac=', version='v0.12.7')
go_repository(name='com_github_azure_go_autorest_autorest', importpath='github.com/Azure/go-autorest/autorest', sum='h1:OZEIaBbMdUE/Js+BQKlpO81XlISgipr6yDJ+PSwsgi4=', version='v0.9.3')
go_repository(name='com_github_azure_go_autorest_autorest_adal', importpath='github.com/Azure/go-autorest/autorest/adal', sum='h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw=', version='v0.8.3')
go_repository(name='com_github_azure_go_autorest_autorest_azure_auth', importpath='github.com/Azure/go-autorest/autorest/azure/auth', sum='h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk=', version='v0.4.2')
go_repository(name='com_github_azure_go_autorest_autorest_azure_cli', importpath='github.com/Azure/go-autorest/autorest/azure/cli', sum='h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U=', version='v0.3.1')
go_repository(name='com_github_azure_go_autorest_autorest_date', importpath='github.com/Azure/go-autorest/autorest/date', sum='h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM=', version='v0.2.0')
go_repository(name='com_github_azure_go_autorest_autorest_mocks', importpath='github.com/Azure/go-autorest/autorest/mocks', sum='h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc=', version='v0.3.0')
go_repository(name='com_github_azure_go_autorest_autorest_to', importpath='github.com/Azure/go-autorest/autorest/to', sum='h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8=', version='v0.3.0')
go_repository(name='com_github_azure_go_autorest_autorest_validation', importpath='github.com/Azure/go-autorest/autorest/validation', sum='h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4=', version='v0.2.0')
go_repository(name='com_github_azure_go_autorest_logger', importpath='github.com/Azure/go-autorest/logger', sum='h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=', version='v0.1.0')
go_repository(name='com_github_azure_go_autorest_tracing', importpath='github.com/Azure/go-autorest/tracing', sum='h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=', version='v0.5.0')
go_repository(name='com_github_burntsushi_toml', importpath='github.com/BurntSushi/toml', sum='h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=', version='v0.3.1')
go_repository(name='com_github_burntsushi_xgb', importpath='github.com/BurntSushi/xgb', sum='h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=', version='v0.0.0-20160522181843-27f122750802')
go_repository(name='com_github_census_instrumentation_opencensus_proto', build_extra_args=['-exclude=src'], importpath='github.com/census-instrumentation/opencensus-proto', sum='h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=', version='v0.2.1')
go_repository(name='com_github_chzyer_logex', importpath='github.com/chzyer/logex', sum='h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=', version='v1.1.10')
go_repository(name='com_github_chzyer_readline', importpath='github.com/chzyer/readline', sum='h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=', version='v0.0.0-20180603132655-2972be24d48e')
go_repository(name='com_github_chzyer_test', importpath='github.com/chzyer/test', sum='h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=', version='v0.0.0-20180213035817-a1ea475d72b1')
go_repository(name='com_github_client9_misspell', importpath='github.com/client9/misspell', sum='h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=', version='v0.3.4')
go_repository(name='com_github_cncf_udpa_go', importpath='github.com/cncf/udpa/go', sum='h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=', version='v0.0.0-20191209042840-269d4d468f6f')
go_repository(name='com_github_davecgh_go_spew', importpath='github.com/davecgh/go-spew', sum='h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=', version='v1.1.1')
go_repository(name='com_github_devigned_tab', importpath='github.com/devigned/tab', sum='h1:3mD6Kb1mUOYeLpJvTVSDwSg5ZsfSxfvxGRTxRsJsITA=', version='v0.1.1')
go_repository(name='com_github_dgrijalva_jwt_go', importpath='github.com/dgrijalva/jwt-go', sum='h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=', version='v3.2.0+incompatible')
go_repository(name='com_github_dimchansky_utfbom', importpath='github.com/dimchansky/utfbom', sum='h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4=', version='v1.1.0')
go_repository(name='com_github_envoyproxy_go_control_plane', importpath='github.com/envoyproxy/go-control-plane', sum='h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=', version='v0.9.4')
go_repository(name='com_github_envoyproxy_protoc_gen_validate', importpath='github.com/envoyproxy/protoc-gen-validate', sum='h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=', version='v0.1.0')
go_repository(name='com_github_fortytw2_leaktest', importpath='github.com/fortytw2/leaktest', sum='h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=', version='v1.3.0')
go_repository(name='com_github_fsnotify_fsnotify', importpath='github.com/fsnotify/fsnotify', sum='h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=', version='v1.4.9')
go_repository(name='com_github_go_gl_glfw', importpath='github.com/go-gl/glfw', sum='h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=', version='v0.0.0-20190409004039-e6da0acd62b1')
go_repository(name='com_github_go_gl_glfw_v3_3_glfw', importpath='github.com/go-gl/glfw/v3.3/glfw', sum='h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=', version='v0.0.0-20200222043503-6f7a984d4dc4')
go_repository(name='com_github_go_ini_ini', importpath='github.com/go-ini/ini', sum='h1:Mujh4R/dH6YL8bxuISne3xX2+qcQ9p0IxKAP6ExWoUo=', version='v1.25.4')
go_repository(name='com_github_go_kit_kit', importpath='github.com/go-kit/kit', sum='h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=', version='v0.9.0')
go_repository(name='com_github_go_logfmt_logfmt', importpath='github.com/go-logfmt/logfmt', sum='h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=', version='v0.4.0')
go_repository(name='com_github_go_sql_driver_mysql', importpath='github.com/go-sql-driver/mysql', sum='h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=', version='v1.5.0')
go_repository(name='com_github_go_stack_stack', importpath='github.com/go-stack/stack', sum='h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=', version='v1.8.0')
go_repository(name='com_github_gogo_protobuf', importpath='github.com/gogo/protobuf', sum='h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=', version='v1.1.1')
go_repository(name='com_github_golang_glog', importpath='github.com/golang/glog', sum='h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=', version='v0.0.0-20160126235308-23def4e6c14b')
go_repository(name='com_github_golang_groupcache', importpath='github.com/golang/groupcache', sum='h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=', version='v0.0.0-20200121045136-8c9f03a8e57e')
go_repository(name='com_github_golang_protobuf', importpath='github.com/golang/protobuf', sum='h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=', version='v1.4.2')
go_repository(name='com_github_google_btree', importpath='github.com/google/btree', sum='h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=', version='v1.0.0')
go_repository(name='com_github_google_go_cmp', importpath='github.com/google/go-cmp', sum='h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=', version='v0.5.1')
go_repository(name='com_github_google_go_replayers_grpcreplay', importpath='github.com/google/go-replayers/grpcreplay', sum='h1:eNb1y9rZFmY4ax45uEEECSa8fsxGRU+8Bil52ASAwic=', version='v0.1.0')
go_repository(name='com_github_google_go_replayers_httpreplay', importpath='github.com/google/go-replayers/httpreplay', sum='h1:AX7FUb4BjrrzNvblr/OlgwrmFiep6soj5K2QSDW7BGk=', version='v0.1.0')
go_repository(name='com_github_google_gofuzz', importpath='github.com/google/gofuzz', sum='h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=', version='v1.0.0')
go_repository(name='com_github_google_martian', importpath='github.com/google/martian', sum='h1:xmapqc1AyLoB+ddYT6r04bD9lIjlOqGaREovi0SzFaE=', version='v2.1.1-0.20190517191504-25dcb96d9e51+incompatible')
go_repository(name='com_github_google_pprof', importpath='github.com/google/pprof', sum='h1:lIC98ZUNah83ky7d9EXktLFe4H7Nwus59dTOLXr8xAI=', version='v0.0.0-20200507031123-427632fa3b1c')
go_repository(name='com_github_google_renameio', importpath='github.com/google/renameio', sum='h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=', version='v0.1.0')
go_repository(name='com_github_google_subcommands', importpath='github.com/google/subcommands', sum='h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k=', version='v1.0.1')
go_repository(name='com_github_googlecloudplatform_cloudsql_proxy', importpath='github.com/GoogleCloudPlatform/cloudsql-proxy', sum='h1:sTOp2Ajiew5XIH92YSdwhYc+bgpUX5j5TKK/Ac8Saw8=', version='v0.0.0-20191009163259-e802c2cb94ae')
go_repository(name='com_github_hpcloud_tail', importpath='github.com/hpcloud/tail', sum='h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=', version='v1.0.0')
go_repository(name='com_github_ianlancetaylor_demangle', importpath='github.com/ianlancetaylor/demangle', sum='h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=', version='v0.0.0-20181102032728-5e5cf60278f6')
go_repository(name='com_github_jmespath_go_jmespath', importpath='github.com/jmespath/go-jmespath', sum='h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=', version='v0.3.0')
go_repository(name='com_github_joho_godotenv', importpath='github.com/joho/godotenv', sum='h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=', version='v1.3.0')
go_repository(name='com_github_json_iterator_go', importpath='github.com/json-iterator/go', sum='h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=', version='v1.1.10')
go_repository(name='com_github_jstemmer_go_junit_report', importpath='github.com/jstemmer/go-junit-report', sum='h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=', version='v0.9.1')
go_repository(name='com_github_julienschmidt_httprouter', importpath='github.com/julienschmidt/httprouter', sum='h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g=', version='v1.2.0')
go_repository(name='com_github_kisielk_gotool', importpath='github.com/kisielk/gotool', sum='h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=', version='v1.0.0')
go_repository(name='com_github_konsorten_go_windows_terminal_sequences', importpath='github.com/konsorten/go-windows-terminal-sequences', sum='h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=', version='v1.0.1')
go_repository(name='com_github_kr_logfmt', importpath='github.com/kr/logfmt', sum='h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=', version='v0.0.0-20140226030751-b84e30acd515')
go_repository(name='com_github_kr_pretty', importpath='github.com/kr/pretty', sum='h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=', version='v0.1.0')
go_repository(name='com_github_kr_pty', importpath='github.com/kr/pty', sum='h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=', version='v1.1.1')
go_repository(name='com_github_kr_text', importpath='github.com/kr/text', sum='h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=', version='v0.1.0')
go_repository(name='com_github_lib_pq', importpath='github.com/lib/pq', sum='h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=', version='v1.1.1')
go_repository(name='com_github_mattn_go_colorable', importpath='github.com/mattn/go-colorable', sum='h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=', version='v0.1.4')
go_repository(name='com_github_mattn_go_isatty', importpath='github.com/mattn/go-isatty', sum='h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=', version='v0.0.11')
go_repository(name='com_github_mitchellh_go_homedir', importpath='github.com/mitchellh/go-homedir', sum='h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=', version='v1.1.0')
go_repository(name='com_github_mitchellh_mapstructure', importpath='github.com/mitchellh/mapstructure', sum='h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=', version='v1.1.2')
go_repository(name='com_github_modern_go_concurrent', importpath='github.com/modern-go/concurrent', sum='h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=', version='v0.0.0-20180306012644-bacd9c7ef1dd')
go_repository(name='com_github_modern_go_reflect2', importpath='github.com/modern-go/reflect2', sum='h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=', version='v1.0.1')
go_repository(name='com_github_mwitkow_go_conntrack', importpath='github.com/mwitkow/go-conntrack', sum='h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc=', version='v0.0.0-20161129095857-cc309e4a2223')
go_repository(name='com_github_nxadm_tail', importpath='github.com/nxadm/tail', sum='h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=', version='v1.4.4')
go_repository(name='com_github_onsi_ginkgo', importpath='github.com/onsi/ginkgo', sum='h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=', version='v1.14.1')
go_repository(name='com_github_onsi_gomega', importpath='github.com/onsi/gomega', sum='h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs=', version='v1.10.2')
go_repository(name='com_github_pkg_errors', importpath='github.com/pkg/errors', sum='h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=', version='v0.9.1')
go_repository(name='com_github_pmezard_go_difflib', importpath='github.com/pmezard/go-difflib', sum='h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=', version='v1.0.0')
go_repository(name='com_github_prometheus_statsd_exporter', importpath='github.com/prometheus/statsd_exporter', sum='h1:UiwC1L5HkxEPeapXdm2Ye0u1vUJfTj7uwT5yydYpa1E=', version='v0.15.0')
go_repository(name='com_github_rogpeppe_go_internal', importpath='github.com/rogpeppe/go-internal', sum='h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=', version='v1.6.1')
go_repository(name='com_github_sergi_go_diff', importpath='github.com/sergi/go-diff', sum='h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=', version='v1.1.0')
go_repository(name='com_github_sirupsen_logrus', importpath='github.com/sirupsen/logrus', sum='h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=', version='v1.4.2')
go_repository(name='com_github_stretchr_objx', importpath='github.com/stretchr/objx', sum='h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=', version='v0.2.0')
go_repository(name='com_github_yuin_goldmark', importpath='github.com/yuin/goldmark', sum='h1:5tjfNdR2ki3yYQ842+eX2sQHeiwpKJ0RnHO4IYOc4V8=', version='v1.1.32')
go_repository(name='com_google_cloud_go_bigquery', importpath='cloud.google.com/go/bigquery', sum='h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA=', version='v1.8.0')
go_repository(name='com_google_cloud_go_datastore', importpath='cloud.google.com/go/datastore', sum='h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=', version='v1.1.0')
go_repository(name='com_google_cloud_go_firestore', importpath='cloud.google.com/go/firestore', sum='h1:zrl+2VJAYC/C6WzEPnkqZIBeHyHFs/UmtzJdXU4Bvmo=', version='v1.2.0')
go_repository(name='com_google_cloud_go_pubsub', importpath='cloud.google.com/go/pubsub', sum='h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU=', version='v1.3.1')
go_repository(name='com_google_cloud_go_storage', importpath='cloud.google.com/go/storage', sum='h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=', version='v1.10.0')
go_repository(name='com_shuralyov_dmitri_gpu_mtl', importpath='dmitri.shuralyov.com/gpu/mtl', sum='h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=', version='v0.0.0-20190408044501-666a987793e9')
go_repository(name='in_gopkg_alecthomas_kingpin_v2', importpath='gopkg.in/alecthomas/kingpin.v2', sum='h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=', version='v2.2.6')
go_repository(name='in_gopkg_check_v1', importpath='gopkg.in/check.v1', sum='h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=', version='v1.0.0-20190902080502-41f04d3bba15')
go_repository(name='in_gopkg_errgo_v2', importpath='gopkg.in/errgo.v2', sum='h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=', version='v2.1.0')
go_repository(name='in_gopkg_fsnotify_v1', importpath='gopkg.in/fsnotify.v1', sum='h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=', version='v1.4.7')
go_repository(name='in_gopkg_tomb_v1', importpath='gopkg.in/tomb.v1', sum='h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=', version='v1.0.0-20141024135613-dd632973f1e7')
go_repository(name='in_gopkg_yaml_v3', importpath='gopkg.in/yaml.v3', sum='h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=', version='v3.0.0-20200313102051-9f266ea9e77c')
go_repository(name='io_opencensus_go_contrib_exporter_aws', importpath='contrib.go.opencensus.io/exporter/aws', sum='h1:YsbWYxDZkC7x2OxlsDEYvvEXZ3cBI3qBgUK5BqkZvRw=', version='v0.0.0-20181029163544-2befc13012d0')
go_repository(name='io_opencensus_go_contrib_exporter_stackdriver', importpath='contrib.go.opencensus.io/exporter/stackdriver', sum='h1:ZRVpDigsb+nVI/yps/NLDOYzYjFFmm3OCsBhmYocxR0=', version='v0.12.9')
go_repository(name='io_opencensus_go_contrib_integrations_ocsql', importpath='contrib.go.opencensus.io/integrations/ocsql', sum='h1:kfg5Yyy1nYUrqzyfW5XX+dzMASky8IJXhtHe0KTYNS4=', version='v0.1.4')
go_repository(name='io_opencensus_go_contrib_resource', importpath='contrib.go.opencensus.io/resource', sum='h1:4r2CANuYhKGmYWP02+5E94rLRcS/YeD+KlxSrOsMxk0=', version='v0.1.1')
go_repository(name='io_rsc_binaryregexp', importpath='rsc.io/binaryregexp', sum='h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=', version='v0.2.0')
go_repository(name='io_rsc_quote_v3', importpath='rsc.io/quote/v3', sum='h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY=', version='v3.1.0')
go_repository(name='io_rsc_sampler', importpath='rsc.io/sampler', sum='h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=', version='v1.3.0')
go_repository(name='org_bazil_fuse', importpath='bazil.org/fuse', sum='h1:FNCRpXiquG1aoyqcIWVFmpTSKVcx2bQD38uZZeGtdlw=', version='v0.0.0-20180421153158-65cc252bf669')
go_repository(name='org_golang_google_appengine', importpath='google.golang.org/appengine', sum='h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=', version='v1.6.6')
go_repository(name='org_golang_google_genproto', importpath='google.golang.org/genproto', sum='h1:HJaAqDnKreMkv+AQyf1Mcw0jEmL9kKBNL07RDJu1N/k=', version='v0.0.0-20200726014623-da3ae01ef02d')
go_repository(name='org_golang_google_protobuf', importpath='google.golang.org/protobuf', sum='h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA=', version='v1.24.0')
go_repository(name='org_golang_x_crypto', importpath='golang.org/x/crypto', sum='h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=', version='v0.0.0-20200622213623-75b288015ac9')
go_repository(name='org_golang_x_exp', importpath='golang.org/x/exp', sum='h1:5XVKs2rlCg8EFyRcvO8/XFwYxh1oKJO1Q3X5vttIf9c=', version='v0.0.0-20200908183739-ae8ad444f925')
go_repository(name='org_golang_x_image', importpath='golang.org/x/image', sum='h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=', version='v0.0.0-20190802002840-cff245a6509b')
go_repository(name='org_golang_x_mobile', importpath='golang.org/x/mobile', sum='h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=', version='v0.0.0-20190719004257-d2bd2a29d028')
go_repository(name='org_golang_x_mod', importpath='golang.org/x/mod', sum='h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=', version='v0.3.1-0.20200828183125-ce943fd02449')
go_repository(name='org_golang_x_net', importpath='golang.org/x/net', sum='h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=', version='v0.0.0-20200707034311-ab3426394381')
go_repository(name='org_golang_x_sys', importpath='golang.org/x/sys', sum='h1:gtF+PUC1CD1a9ocwQHbVNXuTp6RQsAYt6tpi6zjT81Y=', version='v0.0.0-20200727154430-2d971f7391a4')
go_repository(name='org_golang_x_text', importpath='golang.org/x/text', sum='h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=', version='v0.3.2')
go_repository(name='org_golang_x_time', importpath='golang.org/x/time', sum='h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=', version='v0.0.0-20191024005414-555d28b269f0')
go_repository(name='org_golang_x_tools', importpath='golang.org/x/tools', sum='h1:qKpj8TpV+LEhel7H/fR788J+KvhWZ3o3V6N2fU/iuLU=', version='v0.0.0-20200731060945-b5fad4ed8dd6')
go_repository(name='com_github_opentracing_opentracing_go', importpath='github.com/opentracing/opentracing-go', sum='h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=', version='v1.2.0')
go_repository(name='com_github_uber_jaeger_lib', importpath='github.com/uber/jaeger-lib', sum='h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=', version='v2.2.0+incompatible')
go_repository(name='com_github_uber_go_atomic', importpath='github.com/uber-go/atomic', sum='h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o=', version='v1.4.0')
go_repository(name='com_github_golang_lint', importpath='github.com/golang/lint', sum='h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA=', version='v0.0.0-20180702182130-06c8688daad7')
go_repository(name='com_github_gordonklaus_ineffassign', importpath='github.com/gordonklaus/ineffassign', sum='h1:vc7Dmrk4JwS0ZPS6WZvWlwDflgDTA26jItmbSj83nug=', version='v0.0.0-20200309095847-7953dde2c7bf')
go_repository(name='com_github_benbjohnson_clock', importpath='github.com/benbjohnson/clock', sum='h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg=', version='v1.0.3')
go_repository(name='com_github_datadog_sketches_go', importpath='github.com/DataDog/sketches-go', sum='h1:qELHH0AWCvf98Yf+CNIJx9vOZOfHFDDzgDRYsnNk/vs=', version='v0.0.0-20190923095040-43f19ad77ff7')
go_repository(name='com_github_dgryski_go_rendezvous', importpath='github.com/dgryski/go-rendezvous', sum='h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=', version='v0.0.0-20200823014737-9f7001d12a5f')
go_repository(name='com_github_go_redis_redis_v8', importpath='github.com/go-redis/redis/v8', sum='h1:PC0VsF9sFFd2sko5bu30aEFc8F1TKl6n65o0b8FnCIE=', version='v8.0.0')
go_repository(name='io_opentelemetry_go_otel', build_file_proto_mode='disable', importpath='go.opentelemetry.io/otel', sum='h1:IN2tzQa9Gc4ZVKnTaMbPVcHjvzOdg5n9QfnmlqiET7E=', version='v0.11.0')
go_repository(name='com_github_go_redis_redisext', importpath='github.com/go-redis/redisext', sum='h1:rgukAuvD0qvfw2CZF9bSEstzBb3WnSgRvHK+hj8Nwp0=', version='v0.1.7')
go_repository(name='cc_mvdan_gofumpt', importpath='mvdan.cc/gofumpt', sum='h1:QQ9mYdTscaVSaHC8A1wtLkECzvpD/YO2E2GyPvU1D/Y=', version='v0.0.0-20201027171050-85d5401eb0f6')
go_repository(name='com_github_hanwen_go_fuse', importpath='github.com/hanwen/go-fuse', sum='h1:GxS9Zrn6c35/BnfiVsZVWmsG803xwE7eVRDvcf/BEVc=', version='v1.0.0')
go_repository(name='com_github_hanwen_go_fuse_v2', importpath='github.com/hanwen/go-fuse/v2', patches=['@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/daemon_timeout.diff', '@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/direntrylist-testability.diff', '@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/fuse-712-for-invalidation.diff', '@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/notify-testability.diff'], sum='h1:kpV28BKeSyVgZREItBLnaVBvOEwv2PuhNdKetwnvNHo=', version='v2.0.3')
go_repository(name='com_github_kylelemons_godebug', importpath='github.com/kylelemons/godebug', sum='h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=', version='v0.0.0-20170820004349-d65d576e9348') |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
def source():
pass
def sinkA(x):
pass
def sinkB(x):
pass
def sinkC(x):
pass
def sinkD(x):
pass
def split(x):
y = x._params
sinkB(y)
sinkC(y)
sinkD(y)
return x
def wrapper(x):
y = split(x)
sinkA(y)
def issue():
x = source()
wrapper(x)
def splitwrapper(x):
return split(x)
class QueryBase:
def send(self):
pass
class Query(QueryBase):
_params = None
def send(self):
return splitwrapper(self)
def params(self, data):
self._params = data
return self
def log_call(params, response):
sinkA(params)
sinkA(response)
def wrapper2(x: Query):
params = x._params
response = None
try:
response = x.send()
except Exception as ex:
raise ex
log_call(params, response)
def issue2():
taint = source()
query = Query().params(taint)
wrapper2(query)
| def source():
pass
def sink_a(x):
pass
def sink_b(x):
pass
def sink_c(x):
pass
def sink_d(x):
pass
def split(x):
y = x._params
sink_b(y)
sink_c(y)
sink_d(y)
return x
def wrapper(x):
y = split(x)
sink_a(y)
def issue():
x = source()
wrapper(x)
def splitwrapper(x):
return split(x)
class Querybase:
def send(self):
pass
class Query(QueryBase):
_params = None
def send(self):
return splitwrapper(self)
def params(self, data):
self._params = data
return self
def log_call(params, response):
sink_a(params)
sink_a(response)
def wrapper2(x: Query):
params = x._params
response = None
try:
response = x.send()
except Exception as ex:
raise ex
log_call(params, response)
def issue2():
taint = source()
query = query().params(taint)
wrapper2(query) |
x=[11,12,13,14]
y=[50,60,70]
for i in range(1,10,2):
x.append("Item# "+str(i))
for i in x:
print(i)
x.extend(y)
print(x)
x.append(y)
print(x)
x.remove(y)
print(x)
""" this is multiine comment operator...
for i in x:
#if int(i.replace("Item# ",""))%2!=0:
if(isinstance(i,str)==False):
if(i%2==0):
x.remove (i)
"""
print(x) | x = [11, 12, 13, 14]
y = [50, 60, 70]
for i in range(1, 10, 2):
x.append('Item# ' + str(i))
for i in x:
print(i)
x.extend(y)
print(x)
x.append(y)
print(x)
x.remove(y)
print(x)
' this is multiine comment operator...\nfor i in x:\n #if int(i.replace("Item# ",""))%2!=0:\n if(isinstance(i,str)==False):\n if(i%2==0):\n x.remove (i)\n'
print(x) |
# @file motion_sensor.py
# @author marco
# @date 07 Oct 2021
class MotionSensor:
def __init__(self, pin):
self._pin = pin
pinMode(self._pin, INPUT)
def movement_detected(self):
"""Return True if motion has been detected"""
return digitalRead(self._pin) == 1
def value(self):
"""Return value caught by sensor. 1 = movement, 0 = quietness."""
return digitalRead(self._pin)
| class Motionsensor:
def __init__(self, pin):
self._pin = pin
pin_mode(self._pin, INPUT)
def movement_detected(self):
"""Return True if motion has been detected"""
return digital_read(self._pin) == 1
def value(self):
"""Return value caught by sensor. 1 = movement, 0 = quietness."""
return digital_read(self._pin) |
#output comments variables input calculations output constants
def display_output():
print('hello')
def test_config():
return True
| def display_output():
print('hello')
def test_config():
return True |
n = int(input())
f = {}
while n > 1:
i = 2
while True:
if n % i == 0:
if i not in f:
f[i] = 0
f[i] += 1
n = n // i
break
i = i + 1
s = ""
for k, v in f.items():
s += "{}".format(k)
if v != 1:
s += "^{}".format(v)
s += " x "
print(s[:-3]) | n = int(input())
f = {}
while n > 1:
i = 2
while True:
if n % i == 0:
if i not in f:
f[i] = 0
f[i] += 1
n = n // i
break
i = i + 1
s = ''
for (k, v) in f.items():
s += '{}'.format(k)
if v != 1:
s += '^{}'.format(v)
s += ' x '
print(s[:-3]) |
def divisors(x):
divisorList = []
for i in range(1, x+1):
if x%i == 0:
divisorList.append(i)
return divisorList
def main():
while True:
try:
x = int(input("Type a number please:"))
break
except ValueError:
pass
y = divisors(x)
print(y)
if __name__ == "__main__":
main()
| def divisors(x):
divisor_list = []
for i in range(1, x + 1):
if x % i == 0:
divisorList.append(i)
return divisorList
def main():
while True:
try:
x = int(input('Type a number please:'))
break
except ValueError:
pass
y = divisors(x)
print(y)
if __name__ == '__main__':
main() |
# Exercise 8.2
# You can call a method directly on the string, as well as on a variable
# of type string. So here I call count directly on 'banana', with the
# argument 'a' as the letter/substring to count.
print('banana'.count('a'))
# Exercise 8.3
def is_palindrome(s):
# The slice uses the entire string if the start and end are left out.
# So s[::1]==s[0:len(s):1]. And s[::-1] knows you're moving backwards
# (since the last argument to the slice is negative), so it automatically
# starts at the last (rightmost) element of the string.
# Since s[::-1] is the reverse of s, we just have to see if it's equal
# to s. If it is, then s is a palindrome. So we can just return the
# result of that comparison directly
return s==s[::-1]
# Exercise 8.4
# (Possibly) incorrect functions
# This function checks to see if the *first* letter in a string is lowercase.
# If the first letter is uppercase, it exits the function with
# return False
def any_lowercase1(s):
for c in s:
if c.islower():
return True
# Since we have an else clause, we're guaranteed to do either
# the body of the if statement or the body of the else statment.
# Which means this function will be returning (and thus exiting)
# after the first letter, no matter what.
else:
return False
# This time it returns a string
# that reads "True" or "False", instead of a boolean. So if you wanted
# to use it in other code it would probably be useless, since Python
# treats nonempty strings as True. Basically this function returns True
# no matter what.
# False is False, but 'False' is True.
# if('False'): do thing <-- would do the thing
# if(False): do thing <-- would not do the thing
# The other problem is instead of checking characters in the string, it
# just checks the character 'c', which of course is lower case.
# So it will actually never return 'False', and always return 'True'.
def any_lowercase2(s):
for c in s:
if 'c'.islower(): # Should be if c.islower():, no quote
return 'True'
else:
return 'False'
# Getting closer, but now it just tells us whether the *last* character
# in the string is lowercase. Since it doesn't combine new knowledge with any
# previous information, it just sets the flag anew with each character it reads
def any_lowercase3(s):
for c in s:
flag = c.islower()
return flag
# This one works! It initializes the flag to false, since we haven't found
# any lowercase letters yet. Then it uses or, which returns true if
# either of the arguments is true. So once we find a lower case letter,
# flag will stay true for the rest of the program.
def any_lowercase4(s):
flag = False
for c in s:
flag = flag or c.islower()
return flag
# This one determines whether *all* letters are lowercase. The first time
# it encounters a non-lowercase letter, it stops and returns False.
def any_lowercase5(s):
for c in s:
if not c.islower():
return False
return True
# A more efficient version of any_lowercase4, inspired by anylowercase_5.
# For something like a counter, we need to run
# through the whole list. For this, as soon as we find the first lowercase
# letter we're done, because we know there's at least one. So we can return True
# and stop execution of the function as soon as the first lowercase letter
# pops up.
def any_lowercase6(s):
for c in s:
if c.islower():
return True
return False
| print('banana'.count('a'))
def is_palindrome(s):
return s == s[::-1]
def any_lowercase1(s):
for c in s:
if c.islower():
return True
else:
return False
def any_lowercase2(s):
for c in s:
if 'c'.islower():
return 'True'
else:
return 'False'
def any_lowercase3(s):
for c in s:
flag = c.islower()
return flag
def any_lowercase4(s):
flag = False
for c in s:
flag = flag or c.islower()
return flag
def any_lowercase5(s):
for c in s:
if not c.islower():
return False
return True
def any_lowercase6(s):
for c in s:
if c.islower():
return True
return False |
'''
Created on 30 de nov de 2018
@author: filiped
'''
class Base:
def __init__(self):
self.s=""
self.p=0
self.fim="@"
self.pilha = ["z0"]
def le_palavra(self,palavra="@"):
self.p=0
self.s = palavra+"@"
def xp(self,c=""):
print(self.s[self.p]==c, self.s[self.p], c)
return self.s[self.p]==c
def np(self):
self.p+=1
return True
def aceite(self):
return "aceitou: "+str(self.p+1)
def rejeicao(self):
return "rejeitou: "+str(self.p+1)
#------------------------------------------------------------------------------
def topo(self,val):
if val == self.pilha[-1]:
self.pop()
return True
return False
def put(self,val):
print(self.pilha)
self.pilha.append(val)
return True
def pop(self):
print(self.pilha)
return self.pilha.pop(-1)
def esta_vazia(self):
print(self.pilha)
return len(self.pilha) > 0
#------------------------------------------------------------------------------
def verificar(self, func):
if func and self.xp(self.fim):
print(self.aceite())
else:
print(self.rejeicao())
#------------------------------------------------------------------------------
def w(self,val):
print(val)
return True
| """
Created on 30 de nov de 2018
@author: filiped
"""
class Base:
def __init__(self):
self.s = ''
self.p = 0
self.fim = '@'
self.pilha = ['z0']
def le_palavra(self, palavra='@'):
self.p = 0
self.s = palavra + '@'
def xp(self, c=''):
print(self.s[self.p] == c, self.s[self.p], c)
return self.s[self.p] == c
def np(self):
self.p += 1
return True
def aceite(self):
return 'aceitou: ' + str(self.p + 1)
def rejeicao(self):
return 'rejeitou: ' + str(self.p + 1)
def topo(self, val):
if val == self.pilha[-1]:
self.pop()
return True
return False
def put(self, val):
print(self.pilha)
self.pilha.append(val)
return True
def pop(self):
print(self.pilha)
return self.pilha.pop(-1)
def esta_vazia(self):
print(self.pilha)
return len(self.pilha) > 0
def verificar(self, func):
if func and self.xp(self.fim):
print(self.aceite())
else:
print(self.rejeicao())
def w(self, val):
print(val)
return True |
class ConsumptionTax:
def __init__(self, tax_rate):
self.tax_rate = tax_rate
def apply(self, price):
return int((price * self.tax_rate) / 100) + price | class Consumptiontax:
def __init__(self, tax_rate):
self.tax_rate = tax_rate
def apply(self, price):
return int(price * self.tax_rate / 100) + price |
# -*- coding: utf-8 -*-
__author__ = 'gzp'
class Solution:
def maxTurbulenceSize(self, A):
"""
:type A: List[int]
:rtype: int
"""
len_a = len(A)
dp = {0: 1}
i = 1
last_cmp = None
while i < len_a:
if A[i - 1] < A[i] and last_cmp != '<':
dp[i] = dp.get(i - 1, 0) + 1
last_cmp = '<'
elif A[i - 1] > A[i] and last_cmp != '>':
dp[i] = dp.get(i - 1, 0) + 1
last_cmp = '>'
elif A[i - 1] == A[i]:
dp[i] = 1
else:
dp[i] = 2
i += 1
return max(dp.values())
| __author__ = 'gzp'
class Solution:
def max_turbulence_size(self, A):
"""
:type A: List[int]
:rtype: int
"""
len_a = len(A)
dp = {0: 1}
i = 1
last_cmp = None
while i < len_a:
if A[i - 1] < A[i] and last_cmp != '<':
dp[i] = dp.get(i - 1, 0) + 1
last_cmp = '<'
elif A[i - 1] > A[i] and last_cmp != '>':
dp[i] = dp.get(i - 1, 0) + 1
last_cmp = '>'
elif A[i - 1] == A[i]:
dp[i] = 1
else:
dp[i] = 2
i += 1
return max(dp.values()) |
# Nach einer Idee von Kevin Workman
# (https://happycoding.io/examples/p5js/images/image-palette)
WIDTH = 800
HEIGHT = 640
palette = ["#264653", "#2a9d8f", "#e9c46a", "#f4a261", "#e76f51"]
def setup():
global img
size(WIDTH, HEIGHT)
this.surface.setTitle("Image Palette")
img = loadImage("akt.jpg")
image(img, 0, 0)
noLoop()
def draw():
global y, img
for x in range(width/2):
for y in range(height):
img_color = img.get(x, y)
palette_color = get_palette_color(img_color)
set(x + width/2, y, palette_color)
def get_palette_color(img_color):
min_distance = 999999
img_r = red(img_color)
img_g = green(img_color)
img_b = blue(img_color)
for c in palette:
palette_r = red(c)
palette_g = green(c)
palette_b = blue(c)
color_distance = dist(img_r, img_g, img_b,
palette_r, palette_g, palette_b)
if color_distance < min_distance:
target_color = c
min_distance = color_distance
return(target_color)
| width = 800
height = 640
palette = ['#264653', '#2a9d8f', '#e9c46a', '#f4a261', '#e76f51']
def setup():
global img
size(WIDTH, HEIGHT)
this.surface.setTitle('Image Palette')
img = load_image('akt.jpg')
image(img, 0, 0)
no_loop()
def draw():
global y, img
for x in range(width / 2):
for y in range(height):
img_color = img.get(x, y)
palette_color = get_palette_color(img_color)
set(x + width / 2, y, palette_color)
def get_palette_color(img_color):
min_distance = 999999
img_r = red(img_color)
img_g = green(img_color)
img_b = blue(img_color)
for c in palette:
palette_r = red(c)
palette_g = green(c)
palette_b = blue(c)
color_distance = dist(img_r, img_g, img_b, palette_r, palette_g, palette_b)
if color_distance < min_distance:
target_color = c
min_distance = color_distance
return target_color |
def front_and_back_search(lst, item):
rear=0
front=len(lst)-1
u=None
if rear>front:
return False
else:
while rear<=front:
if item==lst[rear] or item==lst[front]:
u=''
return True
elif item!=lst[rear] and item!=lst[front]:
if item > lst[rear]:
rear=rear+1
elif item < lst[front]:
front=front-1
if u==None:
return False
| def front_and_back_search(lst, item):
rear = 0
front = len(lst) - 1
u = None
if rear > front:
return False
else:
while rear <= front:
if item == lst[rear] or item == lst[front]:
u = ''
return True
elif item != lst[rear] and item != lst[front]:
if item > lst[rear]:
rear = rear + 1
elif item < lst[front]:
front = front - 1
if u == None:
return False |
# Darren Keenan 2018-02-27
# Exercise 4 - Project Euler 5
# What is the smallest number divisible by 1 to 20
def divisibleby1to20(n):
for i in range(1, 21):
if n % i != 0:
return False
return True
n = 1
while True:
if divisibleby1to20(n):
break
n += 1
print(n)
# The smallest number divisible by 1 to 20 = 232792560
| def divisibleby1to20(n):
for i in range(1, 21):
if n % i != 0:
return False
return True
n = 1
while True:
if divisibleby1to20(n):
break
n += 1
print(n) |
# Three number sum
def threeSumProblem(arr: list, target: int) :
arr.sort()
result = list()
for i in range(0, len(arr) - 2) :
left = i+1;right=len(arr)-1
while left < right :
curren_sum = arr[i] + arr[left] + arr[right]
if curren_sum == target :
result.append([arr[i], arr[left], arr[right]])
left+=1
right-=1
elif curren_sum < target :
left+=1
else :
right -= 1
return result
if __name__ == '__main__' :
print(threeSumProblem([12,3,1,2,-6,5,-8,6], 0)) | def three_sum_problem(arr: list, target: int):
arr.sort()
result = list()
for i in range(0, len(arr) - 2):
left = i + 1
right = len(arr) - 1
while left < right:
curren_sum = arr[i] + arr[left] + arr[right]
if curren_sum == target:
result.append([arr[i], arr[left], arr[right]])
left += 1
right -= 1
elif curren_sum < target:
left += 1
else:
right -= 1
return result
if __name__ == '__main__':
print(three_sum_problem([12, 3, 1, 2, -6, 5, -8, 6], 0)) |
class animal:
def eat(self):
print("eat")
class mammal(animal):
def walk(self):
print("walk")
class fish(animal):
def swim(self):
print("swim")
moka = mammal()
moka.eat()
moka.walk()
| class Animal:
def eat(self):
print('eat')
class Mammal(animal):
def walk(self):
print('walk')
class Fish(animal):
def swim(self):
print('swim')
moka = mammal()
moka.eat()
moka.walk() |
# Copyright 2018 Cyril Roelandt
#
# Licensed under the 3-clause BSD license. See the LICENSE file.
class InvalidPackageNameError(Exception):
"""Invalid package name or non-existing package."""
def __init__(self, frontend, pkg_name):
self.frontend = frontend
self.pkg_name = pkg_name
def __str__(self):
return (f'The package {self.pkg_name} could not be found by frontend '
f'{self.frontend}')
class InvalidPackageVersionError(Exception):
"""Invalid or non-existing version of a valid package"""
def __init__(self, frontend, pkg_name, version):
self.frontend = frontend
self.pkg_name = pkg_name
self.version = version
def __str__(self):
return (f'Version {self.version} of package {self.pkg_name} '
f'could not be found by frontend {self.frontend}')
class UnhandledFrontendError(Exception):
"""Frontend not supported by backend."""
def __init__(self, backend, frontend):
self.backend = backend
self.frontend = frontend
def __str__(self):
return (f'The {self.backend} backend does not work well with the '
f'{self.frontend} frontend (yet!). Unable to generate a '
f'package definition.')
| class Invalidpackagenameerror(Exception):
"""Invalid package name or non-existing package."""
def __init__(self, frontend, pkg_name):
self.frontend = frontend
self.pkg_name = pkg_name
def __str__(self):
return f'The package {self.pkg_name} could not be found by frontend {self.frontend}'
class Invalidpackageversionerror(Exception):
"""Invalid or non-existing version of a valid package"""
def __init__(self, frontend, pkg_name, version):
self.frontend = frontend
self.pkg_name = pkg_name
self.version = version
def __str__(self):
return f'Version {self.version} of package {self.pkg_name} could not be found by frontend {self.frontend}'
class Unhandledfrontenderror(Exception):
"""Frontend not supported by backend."""
def __init__(self, backend, frontend):
self.backend = backend
self.frontend = frontend
def __str__(self):
return f'The {self.backend} backend does not work well with the {self.frontend} frontend (yet!). Unable to generate a package definition.' |
g1 = 1
def display():
global g1
g1 = 2
print(g1)
print("inside",id(g1))
display()
print(g1)
print("outside",id(g1))
| g1 = 1
def display():
global g1
g1 = 2
print(g1)
print('inside', id(g1))
display()
print(g1)
print('outside', id(g1)) |
showroom = set()
showroom.add('Chevrolet SS')
showroom.add('Mazda Miata')
showroom.add('GMC Yukon XL Denali')
showroom.add('Porsche Cayman')
# print(showroom)
# print (len(showroom))
showroom.update(['Jaguar F-Type', 'Ariel Atom 3'])
# print (showroom)
showroom.remove('GMC Yukon XL Denali')
# print (showroom)
junkyard = set()
junkyard.update([
'Mazda Miata',
'Chevy Caprice',
'Isuzu Trooper',
'Saturn SC2',
'Porsche Cayman'
])
# print(junkyard)
def intersect(showroom, junkyard):
return list(set(showroom) & set(junkyard))
# print(intersect(showroom, junkyard))
showroom = showroom.union(junkyard)
# print(showroom)
showroom.discard('Isuzu Trooper')
print(showroom)
| showroom = set()
showroom.add('Chevrolet SS')
showroom.add('Mazda Miata')
showroom.add('GMC Yukon XL Denali')
showroom.add('Porsche Cayman')
showroom.update(['Jaguar F-Type', 'Ariel Atom 3'])
showroom.remove('GMC Yukon XL Denali')
junkyard = set()
junkyard.update(['Mazda Miata', 'Chevy Caprice', 'Isuzu Trooper', 'Saturn SC2', 'Porsche Cayman'])
def intersect(showroom, junkyard):
return list(set(showroom) & set(junkyard))
showroom = showroom.union(junkyard)
showroom.discard('Isuzu Trooper')
print(showroom) |
class Solution:
def validSquare(self, p1, p2, p3, p4):
"""
:type p1: List[int]
:type p2: List[int]
:type p3: List[int]
:type p4: List[int]
:rtype: bool
"""
def dis(P, Q):
"Return distance between two points."
return sum((p - q) * (p - q) for p, q in zip(P, Q))
d = {dis(P, Q) for P, Q in itertools.combinations((p1, p2, p3, p4), 2)}
return len(d) == 2 and min(d) != 0 and max(d) // min(d) == 2
| class Solution:
def valid_square(self, p1, p2, p3, p4):
"""
:type p1: List[int]
:type p2: List[int]
:type p3: List[int]
:type p4: List[int]
:rtype: bool
"""
def dis(P, Q):
"""Return distance between two points."""
return sum(((p - q) * (p - q) for (p, q) in zip(P, Q)))
d = {dis(P, Q) for (p, q) in itertools.combinations((p1, p2, p3, p4), 2)}
return len(d) == 2 and min(d) != 0 and (max(d) // min(d) == 2) |
"""
From Kapil Sharma's lecture 11 Jun 2020
Given the head of a sll and a value, delete the node with that value.
Return True if successful; False otherwise.
"""
class Node:
def __init__(self, data):
self.data = data
self.next = None
def delete_node_given_value(value, head):
# Edge cases
if head == None or value == None:
return False
if head.data == value:
head.next = None
return True
# Iterate thru sll until find the value or reach the tail
prev = None
curr = head
while curr is not None and curr.data != value:
prev = curr
curr = curr.next
# If reached tail w/o finding the value
if not curr:
return False
# If found value, reassign the next pointer of prev node to skip node with the value
prev.next = curr.next
return True
def print_ll(head):
ll_list = []
curr = head
while curr is not None:
ll_list.append(curr.data)
curr = curr.next
print(ll_list)
return ll_list
node1 = Node(1)
node2 = Node(2)
node3 = Node(3)
node1.next = node2
node2.next = node3
test = delete_node_given_value(2, node1)
print(test) # True
print_ll(node1) # Should be only 1 and 3
node1 = Node(1)
node2 = Node(2)
node3 = Node(3)
node1.next = node2
node2.next = node3
test2 = delete_node_given_value(1, node1)
print(test2) # True
print_ll(node1) # Should just show the 1 because it is not detached from the sll
print_ll(node2) # Now 2 is the head
node1 = Node(1)
node2 = Node(2)
node3 = Node(3)
node1.next = node2
node2.next = node3
test3 = delete_node_given_value(3, node1)
print(test3) # True
print_ll(node1) # Should just show tail is gone
node4 = Node(4)
test4 = delete_node_given_value(4, node1)
print(test4) # Should be False b/c no node with value of 4 exists in sll
| """
From Kapil Sharma's lecture 11 Jun 2020
Given the head of a sll and a value, delete the node with that value.
Return True if successful; False otherwise.
"""
class Node:
def __init__(self, data):
self.data = data
self.next = None
def delete_node_given_value(value, head):
if head == None or value == None:
return False
if head.data == value:
head.next = None
return True
prev = None
curr = head
while curr is not None and curr.data != value:
prev = curr
curr = curr.next
if not curr:
return False
prev.next = curr.next
return True
def print_ll(head):
ll_list = []
curr = head
while curr is not None:
ll_list.append(curr.data)
curr = curr.next
print(ll_list)
return ll_list
node1 = node(1)
node2 = node(2)
node3 = node(3)
node1.next = node2
node2.next = node3
test = delete_node_given_value(2, node1)
print(test)
print_ll(node1)
node1 = node(1)
node2 = node(2)
node3 = node(3)
node1.next = node2
node2.next = node3
test2 = delete_node_given_value(1, node1)
print(test2)
print_ll(node1)
print_ll(node2)
node1 = node(1)
node2 = node(2)
node3 = node(3)
node1.next = node2
node2.next = node3
test3 = delete_node_given_value(3, node1)
print(test3)
print_ll(node1)
node4 = node(4)
test4 = delete_node_given_value(4, node1)
print(test4) |
input = """
8 2 2 3 0 0
8 2 4 5 0 0
8 2 6 7 0 0
6 0 4 0 2 3 4 5 1 1 1 1
0
4 c
3 b
7 f
2 a
6 e
5 d
0
B+
0
B-
1
0
1
"""
output = """
COST 2@1
"""
| input = '\n8 2 2 3 0 0\n8 2 4 5 0 0\n8 2 6 7 0 0\n6 0 4 0 2 3 4 5 1 1 1 1\n0\n4 c\n3 b\n7 f\n2 a\n6 e\n5 d\n0\nB+\n0\nB-\n1\n0\n1\n'
output = '\nCOST 2@1\n' |
TARGET_COL = 'class'
ID_COL = 'id'
N_FOLD = 5
N_CLASS = 3
SEED = 42
| target_col = 'class'
id_col = 'id'
n_fold = 5
n_class = 3
seed = 42 |
#
# PySNMP MIB module ROHC-UNCOMPRESSED-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ROHC-UNCOMPRESSED-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:49:54 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint")
rohcChannelID, rohcContextCID = mibBuilder.importSymbols("ROHC-MIB", "rohcChannelID", "rohcContextCID")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
IpAddress, TimeTicks, Unsigned32, Bits, mib_2, NotificationType, ModuleIdentity, Counter64, ObjectIdentity, iso, MibIdentifier, Gauge32, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "TimeTicks", "Unsigned32", "Bits", "mib-2", "NotificationType", "ModuleIdentity", "Counter64", "ObjectIdentity", "iso", "MibIdentifier", "Gauge32", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
rohcUncmprMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 113))
rohcUncmprMIB.setRevisions(('2004-06-03 00:00',))
if mibBuilder.loadTexts: rohcUncmprMIB.setLastUpdated('200406030000Z')
if mibBuilder.loadTexts: rohcUncmprMIB.setOrganization('IETF Robust Header Compression Working Group')
rohcUncmprObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 113, 1))
rohcUncmprConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 113, 2))
rohcUncmprContextTable = MibTable((1, 3, 6, 1, 2, 1, 113, 1, 1), )
if mibBuilder.loadTexts: rohcUncmprContextTable.setStatus('current')
rohcUncmprContextEntry = MibTableRow((1, 3, 6, 1, 2, 1, 113, 1, 1, 1), ).setIndexNames((0, "ROHC-MIB", "rohcChannelID"), (0, "ROHC-MIB", "rohcContextCID"))
if mibBuilder.loadTexts: rohcUncmprContextEntry.setStatus('current')
rohcUncmprContextState = MibTableColumn((1, 3, 6, 1, 2, 1, 113, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("initAndRefresh", 1), ("normal", 2), ("noContext", 3), ("fullContext", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: rohcUncmprContextState.setStatus('current')
rohcUncmprContextMode = MibTableColumn((1, 3, 6, 1, 2, 1, 113, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("unidirectional", 1), ("bidirectional", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: rohcUncmprContextMode.setStatus('current')
rohcUncmprContextACKs = MibTableColumn((1, 3, 6, 1, 2, 1, 113, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: rohcUncmprContextACKs.setStatus('current')
rohcUncmprCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 113, 2, 1))
rohcUncmprGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 113, 2, 2))
rohcUncmprCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 113, 2, 1, 1)).setObjects(("ROHC-UNCOMPRESSED-MIB", "rohcUncmprContextGroup"), ("ROHC-UNCOMPRESSED-MIB", "rohcUncmprStatisticsGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
rohcUncmprCompliance = rohcUncmprCompliance.setStatus('current')
rohcUncmprContextGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 113, 2, 2, 1)).setObjects(("ROHC-UNCOMPRESSED-MIB", "rohcUncmprContextState"), ("ROHC-UNCOMPRESSED-MIB", "rohcUncmprContextMode"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
rohcUncmprContextGroup = rohcUncmprContextGroup.setStatus('current')
rohcUncmprStatisticsGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 113, 2, 2, 2)).setObjects(("ROHC-UNCOMPRESSED-MIB", "rohcUncmprContextACKs"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
rohcUncmprStatisticsGroup = rohcUncmprStatisticsGroup.setStatus('current')
mibBuilder.exportSymbols("ROHC-UNCOMPRESSED-MIB", rohcUncmprContextState=rohcUncmprContextState, rohcUncmprMIB=rohcUncmprMIB, rohcUncmprConformance=rohcUncmprConformance, rohcUncmprContextEntry=rohcUncmprContextEntry, rohcUncmprContextMode=rohcUncmprContextMode, rohcUncmprStatisticsGroup=rohcUncmprStatisticsGroup, rohcUncmprObjects=rohcUncmprObjects, rohcUncmprContextACKs=rohcUncmprContextACKs, rohcUncmprCompliances=rohcUncmprCompliances, rohcUncmprCompliance=rohcUncmprCompliance, rohcUncmprContextTable=rohcUncmprContextTable, rohcUncmprContextGroup=rohcUncmprContextGroup, rohcUncmprGroups=rohcUncmprGroups, PYSNMP_MODULE_ID=rohcUncmprMIB)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, constraints_intersection, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ValueSizeConstraint')
(rohc_channel_id, rohc_context_cid) = mibBuilder.importSymbols('ROHC-MIB', 'rohcChannelID', 'rohcContextCID')
(notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance')
(ip_address, time_ticks, unsigned32, bits, mib_2, notification_type, module_identity, counter64, object_identity, iso, mib_identifier, gauge32, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'TimeTicks', 'Unsigned32', 'Bits', 'mib-2', 'NotificationType', 'ModuleIdentity', 'Counter64', 'ObjectIdentity', 'iso', 'MibIdentifier', 'Gauge32', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
rohc_uncmpr_mib = module_identity((1, 3, 6, 1, 2, 1, 113))
rohcUncmprMIB.setRevisions(('2004-06-03 00:00',))
if mibBuilder.loadTexts:
rohcUncmprMIB.setLastUpdated('200406030000Z')
if mibBuilder.loadTexts:
rohcUncmprMIB.setOrganization('IETF Robust Header Compression Working Group')
rohc_uncmpr_objects = mib_identifier((1, 3, 6, 1, 2, 1, 113, 1))
rohc_uncmpr_conformance = mib_identifier((1, 3, 6, 1, 2, 1, 113, 2))
rohc_uncmpr_context_table = mib_table((1, 3, 6, 1, 2, 1, 113, 1, 1))
if mibBuilder.loadTexts:
rohcUncmprContextTable.setStatus('current')
rohc_uncmpr_context_entry = mib_table_row((1, 3, 6, 1, 2, 1, 113, 1, 1, 1)).setIndexNames((0, 'ROHC-MIB', 'rohcChannelID'), (0, 'ROHC-MIB', 'rohcContextCID'))
if mibBuilder.loadTexts:
rohcUncmprContextEntry.setStatus('current')
rohc_uncmpr_context_state = mib_table_column((1, 3, 6, 1, 2, 1, 113, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('initAndRefresh', 1), ('normal', 2), ('noContext', 3), ('fullContext', 4)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
rohcUncmprContextState.setStatus('current')
rohc_uncmpr_context_mode = mib_table_column((1, 3, 6, 1, 2, 1, 113, 1, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('unidirectional', 1), ('bidirectional', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
rohcUncmprContextMode.setStatus('current')
rohc_uncmpr_context_ac_ks = mib_table_column((1, 3, 6, 1, 2, 1, 113, 1, 1, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
rohcUncmprContextACKs.setStatus('current')
rohc_uncmpr_compliances = mib_identifier((1, 3, 6, 1, 2, 1, 113, 2, 1))
rohc_uncmpr_groups = mib_identifier((1, 3, 6, 1, 2, 1, 113, 2, 2))
rohc_uncmpr_compliance = module_compliance((1, 3, 6, 1, 2, 1, 113, 2, 1, 1)).setObjects(('ROHC-UNCOMPRESSED-MIB', 'rohcUncmprContextGroup'), ('ROHC-UNCOMPRESSED-MIB', 'rohcUncmprStatisticsGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
rohc_uncmpr_compliance = rohcUncmprCompliance.setStatus('current')
rohc_uncmpr_context_group = object_group((1, 3, 6, 1, 2, 1, 113, 2, 2, 1)).setObjects(('ROHC-UNCOMPRESSED-MIB', 'rohcUncmprContextState'), ('ROHC-UNCOMPRESSED-MIB', 'rohcUncmprContextMode'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
rohc_uncmpr_context_group = rohcUncmprContextGroup.setStatus('current')
rohc_uncmpr_statistics_group = object_group((1, 3, 6, 1, 2, 1, 113, 2, 2, 2)).setObjects(('ROHC-UNCOMPRESSED-MIB', 'rohcUncmprContextACKs'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
rohc_uncmpr_statistics_group = rohcUncmprStatisticsGroup.setStatus('current')
mibBuilder.exportSymbols('ROHC-UNCOMPRESSED-MIB', rohcUncmprContextState=rohcUncmprContextState, rohcUncmprMIB=rohcUncmprMIB, rohcUncmprConformance=rohcUncmprConformance, rohcUncmprContextEntry=rohcUncmprContextEntry, rohcUncmprContextMode=rohcUncmprContextMode, rohcUncmprStatisticsGroup=rohcUncmprStatisticsGroup, rohcUncmprObjects=rohcUncmprObjects, rohcUncmprContextACKs=rohcUncmprContextACKs, rohcUncmprCompliances=rohcUncmprCompliances, rohcUncmprCompliance=rohcUncmprCompliance, rohcUncmprContextTable=rohcUncmprContextTable, rohcUncmprContextGroup=rohcUncmprContextGroup, rohcUncmprGroups=rohcUncmprGroups, PYSNMP_MODULE_ID=rohcUncmprMIB) |
# 11.
print(list(range(1, 10)))
# 12.
print(list(range(100, 20, -5)))
| print(list(range(1, 10)))
print(list(range(100, 20, -5))) |
def A(m, n):
if m == 0:
return n + 1
if m > 0 and n == 0:
return A(m - 1, 1)
if m > 0 and n > 0:
return A(m - 1, A(m, n - 1))
def main() -> None:
print(A(2, 2))
if __name__ == "__main__":
main() | def a(m, n):
if m == 0:
return n + 1
if m > 0 and n == 0:
return a(m - 1, 1)
if m > 0 and n > 0:
return a(m - 1, a(m, n - 1))
def main() -> None:
print(a(2, 2))
if __name__ == '__main__':
main() |
"""Test for W0623, overwriting names in exception handlers."""
__revision__ = ''
class MyError(Exception):
"""Special exception class."""
pass
def some_function():
"""A function."""
try:
{}["a"]
except KeyError as some_function: # W0623
pass
| """Test for W0623, overwriting names in exception handlers."""
__revision__ = ''
class Myerror(Exception):
"""Special exception class."""
pass
def some_function():
"""A function."""
try:
{}['a']
except KeyError as some_function:
pass |
# input -1
n = int(input('input nilai: '))
if n <= 0:
# Menentukan pengecualian & teks yang akan di tampilkan
raise ValueError('nilai n harus bilangan positif')
try:
n = int(input('input nilai: '))
if n <= 0:
# Menentukan pengecualian & teks yang akan di tampilkan
raise ValueError('nilai n harus bilangan positif')
except ValueError as ve:
# Menampilkan teks dari pengecualian yang terjadi
print(ve) | n = int(input('input nilai: '))
if n <= 0:
raise value_error('nilai n harus bilangan positif')
try:
n = int(input('input nilai: '))
if n <= 0:
raise value_error('nilai n harus bilangan positif')
except ValueError as ve:
print(ve) |
#
# PySNMP MIB module CYCLONE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CYCLONE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:34:24 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Counter64, NotificationType, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, IpAddress, Bits, Unsigned32, ObjectIdentity, Integer32, Counter32, Gauge32, ModuleIdentity, MibIdentifier, enterprises = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "NotificationType", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "IpAddress", "Bits", "Unsigned32", "ObjectIdentity", "Integer32", "Counter32", "Gauge32", "ModuleIdentity", "MibIdentifier", "enterprises")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
adaptec = MibIdentifier((1, 3, 6, 1, 4, 1, 795))
storagemanagement = MibIdentifier((1, 3, 6, 1, 4, 1, 795, 2))
cyclone = MibIdentifier((1, 3, 6, 1, 4, 1, 795, 2, 5))
cycTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000))
cycManagerID = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9001), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycManagerID.setStatus('mandatory')
if mibBuilder.loadTexts: cycManagerID.setDescription('ASCII String description of SCSI Manager')
cycHostAdapterID = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9002), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycHostAdapterID.setStatus('mandatory')
if mibBuilder.loadTexts: cycHostAdapterID.setDescription('ASCII String description of Hostadapter')
cycHostAdapterNumber = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9003), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycHostAdapterNumber.setStatus('mandatory')
if mibBuilder.loadTexts: cycHostAdapterNumber.setDescription('The unique Hostadapter Number')
cycVendor = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9004), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycVendor.setStatus('mandatory')
if mibBuilder.loadTexts: cycVendor.setDescription('This indicates the Name of the Vendor')
cycProduct = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9005), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycProduct.setStatus('mandatory')
if mibBuilder.loadTexts: cycProduct.setDescription('This indicates the product information')
cycControllerModel = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9006), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycControllerModel.setStatus('mandatory')
if mibBuilder.loadTexts: cycControllerModel.setDescription('The model of the associated controller e.g ATHENA, VIKING etc')
cycBusNumber = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9007), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycBusNumber.setStatus('mandatory')
if mibBuilder.loadTexts: cycBusNumber.setDescription('The PCI Bus number')
cycChannelNumber = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9008), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycChannelNumber.setStatus('mandatory')
if mibBuilder.loadTexts: cycChannelNumber.setDescription('Channel Number')
cycScsiTargetID = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9009), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycScsiTargetID.setStatus('mandatory')
if mibBuilder.loadTexts: cycScsiTargetID.setDescription('SCSI Target ID')
cycLun = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9010), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycLun.setStatus('mandatory')
if mibBuilder.loadTexts: cycLun.setDescription('The LUN of the device ID')
cycArrayName = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9011), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycArrayName.setStatus('mandatory')
if mibBuilder.loadTexts: cycArrayName.setDescription('Array name')
cycMisCompares = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9012), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycMisCompares.setStatus('mandatory')
if mibBuilder.loadTexts: cycMisCompares.setDescription('The number of miscompares in verify ')
cycDriver = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9013), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycDriver.setStatus('mandatory')
if mibBuilder.loadTexts: cycDriver.setDescription('The Driver version')
cycManager = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9014), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycManager.setStatus('mandatory')
if mibBuilder.loadTexts: cycManager.setDescription('The CI/O Manager version')
cycOldArrayName = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9015), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycOldArrayName.setStatus('mandatory')
if mibBuilder.loadTexts: cycOldArrayName.setDescription('Old Array name')
cycNewArrayName = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9016), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycNewArrayName.setStatus('mandatory')
if mibBuilder.loadTexts: cycNewArrayName.setDescription('Changed Array name')
cycPriority = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9017), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycPriority.setStatus('mandatory')
if mibBuilder.loadTexts: cycPriority.setDescription('The Priority of the operation')
cycSenseInfo = MibScalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9018), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cycSenseInfo.setStatus('mandatory')
if mibBuilder.loadTexts: cycSenseInfo.setDescription('The sense info of the PFA')
sCSISmart1 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,101))
if mibBuilder.loadTexts: sCSISmart1.setDescription('SNMP Agent is up.')
sCSISmart2 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,102))
if mibBuilder.loadTexts: sCSISmart2.setDescription('SNMP Agent is down.')
sCSISmart3 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,107))
if mibBuilder.loadTexts: sCSISmart3.setDescription('Cyclone: duplicate hostadapter ID')
sCSISmart4 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,108)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"), ("CYCLONE-MIB", "cycHostAdapterID"), ("CYCLONE-MIB", "cycManagerID"))
if mibBuilder.loadTexts: sCSISmart4.setDescription('The HostAdapter# %d with HostAdapter Id %s and Manager Id %s is discovered')
sCSISmart5 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,109)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"), ("CYCLONE-MIB", "cycHostAdapterID"), ("CYCLONE-MIB", "cycManagerID"))
if mibBuilder.loadTexts: sCSISmart5.setDescription('The HostAdapter# %d has new HostAdapter Id %s and Manager Id %s')
sCSISmart6 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,110)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"))
if mibBuilder.loadTexts: sCSISmart6.setDescription('The HostAdapter# %d has Failed')
sCSISmart7 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,111)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"))
if mibBuilder.loadTexts: sCSISmart7.setDescription('Host Adapter# %d recovered')
sCSISmart8 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,112)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"), ("CYCLONE-MIB", "cycScsiTargetID"), ("CYCLONE-MIB", "cycLun"))
if mibBuilder.loadTexts: sCSISmart8.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d has failed')
sCSISmart9 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,113)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"), ("CYCLONE-MIB", "cycScsiTargetID"), ("CYCLONE-MIB", "cycLun"), ("CYCLONE-MIB", "cycVendor"), ("CYCLONE-MIB", "cycProduct"))
if mibBuilder.loadTexts: sCSISmart9.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d of vendor %s product %s has discovered')
sCSISmart10 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,114)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"), ("CYCLONE-MIB", "cycScsiTargetID"), ("CYCLONE-MIB", "cycLun"))
if mibBuilder.loadTexts: sCSISmart10.setDescription('The HostAdapter# %d, TargetID %d,Lun# %d has recovered')
sCSISmart11 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,115)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"), ("CYCLONE-MIB", "cycScsiTargetID"), ("CYCLONE-MIB", "cycLun"), ("CYCLONE-MIB", "cycVendor"), ("CYCLONE-MIB", "cycProduct"))
if mibBuilder.loadTexts: sCSISmart11.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d has new Vendor %s and Product %s information')
sCSISmart12 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,116)).setObjects(("CYCLONE-MIB", "cycHostAdapterNumber"), ("CYCLONE-MIB", "cycScsiTargetID"), ("CYCLONE-MIB", "cycLun"), ("CYCLONE-MIB", "cycVendor"), ("CYCLONE-MIB", "cycProduct"), ("CYCLONE-MIB", "cycSenseInfo"))
if mibBuilder.loadTexts: sCSISmart12.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d has Predictive Failure Condition on vendor %s product %s with sense info MSB(sense code), next 8 bits (sense code Qual) next 8 bits (Add sense code Qual) LSB (0000) %d')
sCSISmart13 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,117))
if mibBuilder.loadTexts: sCSISmart13.setDescription('The Aspi database is cleared and therefore all the previous information are not available')
sCSISmart14 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,118))
if mibBuilder.loadTexts: sCSISmart14.setDescription('The Aspi has crashed')
sCSISmart15 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,119))
if mibBuilder.loadTexts: sCSISmart15.setDescription('No memory left for Aspi Operations')
sCSISmart16 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,120))
if mibBuilder.loadTexts: sCSISmart16.setDescription('Unable to open Aspi file for writing, problem exists in server hard disk')
sCSISmart17 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,121))
if mibBuilder.loadTexts: sCSISmart17.setDescription('Unable to open Aspi file, problem exists in server hard disk')
sCSISmart18 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,122))
if mibBuilder.loadTexts: sCSISmart18.setDescription('Aspi device file doesnot exist')
sCSISmart19 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,123))
if mibBuilder.loadTexts: sCSISmart19.setDescription('Aspi: Memory allocation is failing')
sCSISmart20 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,124))
if mibBuilder.loadTexts: sCSISmart20.setDescription('Aspi: unable to read the file server hard disk might have problems')
sCSISmart21 = NotificationType((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0,125))
if mibBuilder.loadTexts: sCSISmart21.setDescription('Aspi: database is corrupted')
mibBuilder.exportSymbols("CYCLONE-MIB", cycSenseInfo=cycSenseInfo, sCSISmart19=sCSISmart19, sCSISmart10=sCSISmart10, cycPriority=cycPriority, cycBusNumber=cycBusNumber, sCSISmart1=sCSISmart1, sCSISmart12=sCSISmart12, cycDriver=cycDriver, sCSISmart13=sCSISmart13, sCSISmart3=sCSISmart3, cyclone=cyclone, sCSISmart21=sCSISmart21, sCSISmart16=sCSISmart16, cycMisCompares=cycMisCompares, cycLun=cycLun, sCSISmart17=sCSISmart17, sCSISmart8=sCSISmart8, cycOldArrayName=cycOldArrayName, cycNewArrayName=cycNewArrayName, cycHostAdapterNumber=cycHostAdapterNumber, sCSISmart4=sCSISmart4, sCSISmart20=sCSISmart20, cycControllerModel=cycControllerModel, sCSISmart14=sCSISmart14, adaptec=adaptec, sCSISmart15=sCSISmart15, cycVendor=cycVendor, cycManager=cycManager, sCSISmart18=sCSISmart18, cycArrayName=cycArrayName, cycScsiTargetID=cycScsiTargetID, cycTraps=cycTraps, sCSISmart7=sCSISmart7, cycHostAdapterID=cycHostAdapterID, cycManagerID=cycManagerID, cycChannelNumber=cycChannelNumber, sCSISmart6=sCSISmart6, sCSISmart9=sCSISmart9, sCSISmart2=sCSISmart2, cycProduct=cycProduct, sCSISmart11=sCSISmart11, storagemanagement=storagemanagement, sCSISmart5=sCSISmart5)
| (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, constraints_intersection, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(counter64, notification_type, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, ip_address, bits, unsigned32, object_identity, integer32, counter32, gauge32, module_identity, mib_identifier, enterprises) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'NotificationType', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'IpAddress', 'Bits', 'Unsigned32', 'ObjectIdentity', 'Integer32', 'Counter32', 'Gauge32', 'ModuleIdentity', 'MibIdentifier', 'enterprises')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
adaptec = mib_identifier((1, 3, 6, 1, 4, 1, 795))
storagemanagement = mib_identifier((1, 3, 6, 1, 4, 1, 795, 2))
cyclone = mib_identifier((1, 3, 6, 1, 4, 1, 795, 2, 5))
cyc_traps = mib_identifier((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000))
cyc_manager_id = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9001), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycManagerID.setStatus('mandatory')
if mibBuilder.loadTexts:
cycManagerID.setDescription('ASCII String description of SCSI Manager')
cyc_host_adapter_id = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9002), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycHostAdapterID.setStatus('mandatory')
if mibBuilder.loadTexts:
cycHostAdapterID.setDescription('ASCII String description of Hostadapter')
cyc_host_adapter_number = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9003), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycHostAdapterNumber.setStatus('mandatory')
if mibBuilder.loadTexts:
cycHostAdapterNumber.setDescription('The unique Hostadapter Number')
cyc_vendor = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9004), display_string().subtype(subtypeSpec=value_size_constraint(1, 8))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycVendor.setStatus('mandatory')
if mibBuilder.loadTexts:
cycVendor.setDescription('This indicates the Name of the Vendor')
cyc_product = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9005), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycProduct.setStatus('mandatory')
if mibBuilder.loadTexts:
cycProduct.setDescription('This indicates the product information')
cyc_controller_model = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9006), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycControllerModel.setStatus('mandatory')
if mibBuilder.loadTexts:
cycControllerModel.setDescription('The model of the associated controller e.g ATHENA, VIKING etc')
cyc_bus_number = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9007), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycBusNumber.setStatus('mandatory')
if mibBuilder.loadTexts:
cycBusNumber.setDescription('The PCI Bus number')
cyc_channel_number = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9008), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycChannelNumber.setStatus('mandatory')
if mibBuilder.loadTexts:
cycChannelNumber.setDescription('Channel Number')
cyc_scsi_target_id = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9009), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycScsiTargetID.setStatus('mandatory')
if mibBuilder.loadTexts:
cycScsiTargetID.setDescription('SCSI Target ID')
cyc_lun = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9010), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycLun.setStatus('mandatory')
if mibBuilder.loadTexts:
cycLun.setDescription('The LUN of the device ID')
cyc_array_name = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9011), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycArrayName.setStatus('mandatory')
if mibBuilder.loadTexts:
cycArrayName.setDescription('Array name')
cyc_mis_compares = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9012), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycMisCompares.setStatus('mandatory')
if mibBuilder.loadTexts:
cycMisCompares.setDescription('The number of miscompares in verify ')
cyc_driver = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9013), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycDriver.setStatus('mandatory')
if mibBuilder.loadTexts:
cycDriver.setDescription('The Driver version')
cyc_manager = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9014), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycManager.setStatus('mandatory')
if mibBuilder.loadTexts:
cycManager.setDescription('The CI/O Manager version')
cyc_old_array_name = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9015), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycOldArrayName.setStatus('mandatory')
if mibBuilder.loadTexts:
cycOldArrayName.setDescription('Old Array name')
cyc_new_array_name = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9016), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycNewArrayName.setStatus('mandatory')
if mibBuilder.loadTexts:
cycNewArrayName.setDescription('Changed Array name')
cyc_priority = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9017), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycPriority.setStatus('mandatory')
if mibBuilder.loadTexts:
cycPriority.setDescription('The Priority of the operation')
cyc_sense_info = mib_scalar((1, 3, 6, 1, 4, 1, 795, 2, 5, 9000, 9018), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cycSenseInfo.setStatus('mandatory')
if mibBuilder.loadTexts:
cycSenseInfo.setDescription('The sense info of the PFA')
s_csi_smart1 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 101))
if mibBuilder.loadTexts:
sCSISmart1.setDescription('SNMP Agent is up.')
s_csi_smart2 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 102))
if mibBuilder.loadTexts:
sCSISmart2.setDescription('SNMP Agent is down.')
s_csi_smart3 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 107))
if mibBuilder.loadTexts:
sCSISmart3.setDescription('Cyclone: duplicate hostadapter ID')
s_csi_smart4 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 108)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'), ('CYCLONE-MIB', 'cycHostAdapterID'), ('CYCLONE-MIB', 'cycManagerID'))
if mibBuilder.loadTexts:
sCSISmart4.setDescription('The HostAdapter# %d with HostAdapter Id %s and Manager Id %s is discovered')
s_csi_smart5 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 109)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'), ('CYCLONE-MIB', 'cycHostAdapterID'), ('CYCLONE-MIB', 'cycManagerID'))
if mibBuilder.loadTexts:
sCSISmart5.setDescription('The HostAdapter# %d has new HostAdapter Id %s and Manager Id %s')
s_csi_smart6 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 110)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'))
if mibBuilder.loadTexts:
sCSISmart6.setDescription('The HostAdapter# %d has Failed')
s_csi_smart7 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 111)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'))
if mibBuilder.loadTexts:
sCSISmart7.setDescription('Host Adapter# %d recovered')
s_csi_smart8 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 112)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'), ('CYCLONE-MIB', 'cycScsiTargetID'), ('CYCLONE-MIB', 'cycLun'))
if mibBuilder.loadTexts:
sCSISmart8.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d has failed')
s_csi_smart9 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 113)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'), ('CYCLONE-MIB', 'cycScsiTargetID'), ('CYCLONE-MIB', 'cycLun'), ('CYCLONE-MIB', 'cycVendor'), ('CYCLONE-MIB', 'cycProduct'))
if mibBuilder.loadTexts:
sCSISmart9.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d of vendor %s product %s has discovered')
s_csi_smart10 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 114)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'), ('CYCLONE-MIB', 'cycScsiTargetID'), ('CYCLONE-MIB', 'cycLun'))
if mibBuilder.loadTexts:
sCSISmart10.setDescription('The HostAdapter# %d, TargetID %d,Lun# %d has recovered')
s_csi_smart11 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 115)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'), ('CYCLONE-MIB', 'cycScsiTargetID'), ('CYCLONE-MIB', 'cycLun'), ('CYCLONE-MIB', 'cycVendor'), ('CYCLONE-MIB', 'cycProduct'))
if mibBuilder.loadTexts:
sCSISmart11.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d has new Vendor %s and Product %s information')
s_csi_smart12 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 116)).setObjects(('CYCLONE-MIB', 'cycHostAdapterNumber'), ('CYCLONE-MIB', 'cycScsiTargetID'), ('CYCLONE-MIB', 'cycLun'), ('CYCLONE-MIB', 'cycVendor'), ('CYCLONE-MIB', 'cycProduct'), ('CYCLONE-MIB', 'cycSenseInfo'))
if mibBuilder.loadTexts:
sCSISmart12.setDescription('The HostAdapter# %d, TargetID %d, Lun# %d has Predictive Failure Condition on vendor %s product %s with sense info MSB(sense code), next 8 bits (sense code Qual) next 8 bits (Add sense code Qual) LSB (0000) %d')
s_csi_smart13 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 117))
if mibBuilder.loadTexts:
sCSISmart13.setDescription('The Aspi database is cleared and therefore all the previous information are not available')
s_csi_smart14 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 118))
if mibBuilder.loadTexts:
sCSISmart14.setDescription('The Aspi has crashed')
s_csi_smart15 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 119))
if mibBuilder.loadTexts:
sCSISmart15.setDescription('No memory left for Aspi Operations')
s_csi_smart16 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 120))
if mibBuilder.loadTexts:
sCSISmart16.setDescription('Unable to open Aspi file for writing, problem exists in server hard disk')
s_csi_smart17 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 121))
if mibBuilder.loadTexts:
sCSISmart17.setDescription('Unable to open Aspi file, problem exists in server hard disk')
s_csi_smart18 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 122))
if mibBuilder.loadTexts:
sCSISmart18.setDescription('Aspi device file doesnot exist')
s_csi_smart19 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 123))
if mibBuilder.loadTexts:
sCSISmart19.setDescription('Aspi: Memory allocation is failing')
s_csi_smart20 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 124))
if mibBuilder.loadTexts:
sCSISmart20.setDescription('Aspi: unable to read the file server hard disk might have problems')
s_csi_smart21 = notification_type((1, 3, 6, 1, 4, 1, 795, 2, 5) + (0, 125))
if mibBuilder.loadTexts:
sCSISmart21.setDescription('Aspi: database is corrupted')
mibBuilder.exportSymbols('CYCLONE-MIB', cycSenseInfo=cycSenseInfo, sCSISmart19=sCSISmart19, sCSISmart10=sCSISmart10, cycPriority=cycPriority, cycBusNumber=cycBusNumber, sCSISmart1=sCSISmart1, sCSISmart12=sCSISmart12, cycDriver=cycDriver, sCSISmart13=sCSISmart13, sCSISmart3=sCSISmart3, cyclone=cyclone, sCSISmart21=sCSISmart21, sCSISmart16=sCSISmart16, cycMisCompares=cycMisCompares, cycLun=cycLun, sCSISmart17=sCSISmart17, sCSISmart8=sCSISmart8, cycOldArrayName=cycOldArrayName, cycNewArrayName=cycNewArrayName, cycHostAdapterNumber=cycHostAdapterNumber, sCSISmart4=sCSISmart4, sCSISmart20=sCSISmart20, cycControllerModel=cycControllerModel, sCSISmart14=sCSISmart14, adaptec=adaptec, sCSISmart15=sCSISmart15, cycVendor=cycVendor, cycManager=cycManager, sCSISmart18=sCSISmart18, cycArrayName=cycArrayName, cycScsiTargetID=cycScsiTargetID, cycTraps=cycTraps, sCSISmart7=sCSISmart7, cycHostAdapterID=cycHostAdapterID, cycManagerID=cycManagerID, cycChannelNumber=cycChannelNumber, sCSISmart6=sCSISmart6, sCSISmart9=sCSISmart9, sCSISmart2=sCSISmart2, cycProduct=cycProduct, sCSISmart11=sCSISmart11, storagemanagement=storagemanagement, sCSISmart5=sCSISmart5) |
def tapcode_to_fingers(tapcode:int):
return '{0:05b}'.format(1)[::-1]
def mouse_data_msg(data: bytearray):
vx = int.from_bytes(data[1:3],"little", signed=True)
vy = int.from_bytes(data[3:5],"little", signed=True)
prox = data[9] == 1
return vx, vy, prox
def air_gesture_data_msg(data: bytearray):
return [data[0]]
def tap_data_msg(data: bytearray):
return [data[0]]
def raw_data_msg(data: bytearray):
'''
raw data is packed into messages with the following structure:
[msg_type (1 bit)][timestamp (31 bit)][payload (12 - 30 bytes)]
* msg type - '0' for imu message
- '1' for accelerometers message
* timestamp - unsigned int, given in milliseconds
* payload - for imu message is 12 bytes
composed by a series of 6 uint16 numbers
representing [g_x, g_y, g_z, xl_x, xl_y, xl_z]
- for accelerometers message is 30 bytes
composed by a series of 15 uint16 numbers
representing [xl_x_thumb , xl_y_thumb, xl_z_thumb,
xl_x_finger, xl_y_finger, xl_z_finger,
...]
'''
L = len(data)
ptr = 0
messages = []
while ptr <= L:
# decode timestamp and message type
ts = int.from_bytes(data[ptr:ptr+4],"little", signed=False)
if ts == 0:
break
ptr += 4
# resolve message type
if ts > raw_data_msg.msg_type_value:
msg = "accl"
ts -= raw_data_msg.msg_type_value
num_of_samples = 15
else:
msg = "imu"
num_of_samples = 6
# parse payload
payload = []
for i in range(num_of_samples):
payload.append(int.from_bytes(data[ptr:ptr+2],"little", signed=True))
ptr += 2
messages.append({"type":msg, "ts":ts, "payload":payload})
return messages
raw_data_msg.msg_type_value = 2**31
| def tapcode_to_fingers(tapcode: int):
return '{0:05b}'.format(1)[::-1]
def mouse_data_msg(data: bytearray):
vx = int.from_bytes(data[1:3], 'little', signed=True)
vy = int.from_bytes(data[3:5], 'little', signed=True)
prox = data[9] == 1
return (vx, vy, prox)
def air_gesture_data_msg(data: bytearray):
return [data[0]]
def tap_data_msg(data: bytearray):
return [data[0]]
def raw_data_msg(data: bytearray):
"""
raw data is packed into messages with the following structure:
[msg_type (1 bit)][timestamp (31 bit)][payload (12 - 30 bytes)]
* msg type - '0' for imu message
- '1' for accelerometers message
* timestamp - unsigned int, given in milliseconds
* payload - for imu message is 12 bytes
composed by a series of 6 uint16 numbers
representing [g_x, g_y, g_z, xl_x, xl_y, xl_z]
- for accelerometers message is 30 bytes
composed by a series of 15 uint16 numbers
representing [xl_x_thumb , xl_y_thumb, xl_z_thumb,
xl_x_finger, xl_y_finger, xl_z_finger,
...]
"""
l = len(data)
ptr = 0
messages = []
while ptr <= L:
ts = int.from_bytes(data[ptr:ptr + 4], 'little', signed=False)
if ts == 0:
break
ptr += 4
if ts > raw_data_msg.msg_type_value:
msg = 'accl'
ts -= raw_data_msg.msg_type_value
num_of_samples = 15
else:
msg = 'imu'
num_of_samples = 6
payload = []
for i in range(num_of_samples):
payload.append(int.from_bytes(data[ptr:ptr + 2], 'little', signed=True))
ptr += 2
messages.append({'type': msg, 'ts': ts, 'payload': payload})
return messages
raw_data_msg.msg_type_value = 2 ** 31 |
# Copyright 2019 The Bazel 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 applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A rule for generating the environment plist
"""
load(
"@build_bazel_rules_apple//apple/internal:rule_factory.bzl",
"rule_factory",
)
load(
"@build_bazel_apple_support//lib:apple_support.bzl",
"apple_support",
)
load(
"@build_bazel_rules_apple//apple/internal:platform_support.bzl",
"platform_support",
)
load(
"@bazel_skylib//lib:dicts.bzl",
"dicts",
)
def _environment_plist(ctx):
# Only need as much platform information as this rule is able to give, for environment plist
# processing.
platform_prerequisites = platform_support.platform_prerequisites(
apple_fragment = ctx.fragments.apple,
config_vars = ctx.var,
device_families = None,
disabled_features = ctx.disabled_features,
explicit_minimum_deployment_os = None,
explicit_minimum_os = None,
features = ctx.features,
objc_fragment = None,
platform_type_string = str(ctx.fragments.apple.single_arch_platform.platform_type),
uses_swift = False,
xcode_path_wrapper = ctx.executable._xcode_path_wrapper,
xcode_version_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig],
)
platform = platform_prerequisites.platform
sdk_version = platform_prerequisites.sdk_version
apple_support.run(
actions = ctx.actions,
apple_fragment = platform_prerequisites.apple_fragment,
arguments = [
"--platform",
platform.name_in_plist.lower() + str(sdk_version),
"--output",
ctx.outputs.plist.path,
],
executable = ctx.executable._environment_plist_tool,
outputs = [ctx.outputs.plist],
xcode_config = platform_prerequisites.xcode_version_config,
)
environment_plist = rule(
attrs = dicts.add(
rule_factory.common_tool_attributes,
{
"_environment_plist_tool": attr.label(
cfg = "exec",
executable = True,
default = Label("@build_bazel_rules_apple//tools/environment_plist"),
),
"platform_type": attr.string(
mandatory = True,
doc = """
The platform for which the plist is being generated
""",
),
},
),
doc = """
This rule generates the plist containing the required variables about the versions the target is
being built for and with. This is used by Apple when submitting to the App Store. This reduces the
amount of duplicative work done generating these plists for the same platforms.
""",
fragments = ["apple"],
outputs = {"plist": "%{name}.plist"},
implementation = _environment_plist,
)
| """
A rule for generating the environment plist
"""
load('@build_bazel_rules_apple//apple/internal:rule_factory.bzl', 'rule_factory')
load('@build_bazel_apple_support//lib:apple_support.bzl', 'apple_support')
load('@build_bazel_rules_apple//apple/internal:platform_support.bzl', 'platform_support')
load('@bazel_skylib//lib:dicts.bzl', 'dicts')
def _environment_plist(ctx):
platform_prerequisites = platform_support.platform_prerequisites(apple_fragment=ctx.fragments.apple, config_vars=ctx.var, device_families=None, disabled_features=ctx.disabled_features, explicit_minimum_deployment_os=None, explicit_minimum_os=None, features=ctx.features, objc_fragment=None, platform_type_string=str(ctx.fragments.apple.single_arch_platform.platform_type), uses_swift=False, xcode_path_wrapper=ctx.executable._xcode_path_wrapper, xcode_version_config=ctx.attr._xcode_config[apple_common.XcodeVersionConfig])
platform = platform_prerequisites.platform
sdk_version = platform_prerequisites.sdk_version
apple_support.run(actions=ctx.actions, apple_fragment=platform_prerequisites.apple_fragment, arguments=['--platform', platform.name_in_plist.lower() + str(sdk_version), '--output', ctx.outputs.plist.path], executable=ctx.executable._environment_plist_tool, outputs=[ctx.outputs.plist], xcode_config=platform_prerequisites.xcode_version_config)
environment_plist = rule(attrs=dicts.add(rule_factory.common_tool_attributes, {'_environment_plist_tool': attr.label(cfg='exec', executable=True, default=label('@build_bazel_rules_apple//tools/environment_plist')), 'platform_type': attr.string(mandatory=True, doc='\nThe platform for which the plist is being generated\n')}), doc='\nThis rule generates the plist containing the required variables about the versions the target is\nbeing built for and with. This is used by Apple when submitting to the App Store. This reduces the\namount of duplicative work done generating these plists for the same platforms.\n', fragments=['apple'], outputs={'plist': '%{name}.plist'}, implementation=_environment_plist) |
class DBConnector:
def save_graph(self, local_graph):
pass
def get_reader_endpoint(self):
pass
def get_writer_endpoint(self):
pass
def disconnect(self):
pass
| class Dbconnector:
def save_graph(self, local_graph):
pass
def get_reader_endpoint(self):
pass
def get_writer_endpoint(self):
pass
def disconnect(self):
pass |
test = {
'name': 'contains?',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
scm> (contains? odds 3) ; True or False
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
scm> (contains? odds 9) ; True or False
True
""",
'hidden': False,
'locked': False
},
{
'code': r"""
scm> (contains? odds 6) ; True or False
False
""",
'hidden': False,
'locked': False
}
],
'scored': True,
'setup': r"""
scm> (load 'hw07)
scm> (define odds (list 3 5 7 9))
""",
'teardown': '',
'type': 'scheme'
}
]
} | test = {'name': 'contains?', 'points': 1, 'suites': [{'cases': [{'code': '\n scm> (contains? odds 3) ; True or False\n True\n ', 'hidden': False, 'locked': False}, {'code': '\n scm> (contains? odds 9) ; True or False\n True\n ', 'hidden': False, 'locked': False}, {'code': '\n scm> (contains? odds 6) ; True or False\n False\n ', 'hidden': False, 'locked': False}], 'scored': True, 'setup': "\n scm> (load 'hw07)\n scm> (define odds (list 3 5 7 9))\n ", 'teardown': '', 'type': 'scheme'}]} |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Const Class
# this is a auto generated file generated by Cheetah
# Libre Office Version: 7.3
# Namespace: com.sun.star.sheet
class DataPilotFieldGroupBy(object):
"""
Const Class
These constants select different types for grouping members of a DataPilot field by date or time.
See Also:
`API DataPilotFieldGroupBy <https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1sheet_1_1DataPilotFieldGroupBy.html>`_
"""
__ooo_ns__: str = 'com.sun.star.sheet'
__ooo_full_ns__: str = 'com.sun.star.sheet.DataPilotFieldGroupBy'
__ooo_type_name__: str = 'const'
SECONDS = 1
"""
Groups all members of a DataPilot field containing a date/time value by their current value for seconds.
Example: The group :02 will contain all members that contain a time with a seconds value of 2, regardless of the date, hours and minutes of the member, e.g. 2002-Jan-03 00:00:02 or 1999-May-02 12:45:02.
"""
MINUTES = 2
"""
Groups all members of a DataPilot field containing a date/time value by their current value for minutes.
Example: The group :02 will contain all members that contain a time with a minutes value of 2, regardless of the date, hours and seconds of the member, e.g. 2002-Jan-03 00:02:00 or 1999-May-02 12:02:45.
"""
HOURS = 4
"""
Groups all members of a DataPilot field containing a date/time value by their current value for hours.
Example: The group 02 will contain all members that contain a time with a hour value of 2, regardless of the date, minutes and seconds of the member, e.g. 2002-Jan-03 02:00:00 or 1999-May-02 02:12:45.
"""
DAYS = 8
"""
Groups all members of a DataPilot field containing a date/time value by their calendar day, or by ranges of days.
Examples:
See descriptions for XDataPilotFieldGrouping.createDateGroup() for more details about day grouping.
"""
MONTHS = 16
"""
Groups all members of a DataPilot field containing a date/time value by their month.
Example: The group Jan will contain all members with a date in the month January, regardless of the year, day, or time of the member, e.g. 2002-Jan-03 00:00:00 or 1999-Jan-02 02:12:45.
"""
QUARTERS = 32
"""
Groups all members of a DataPilot field containing a date/time value by their quarter.
Example: The group Q1 will contain all members with a date in the first quarter of a year (i.e. the months January, February, and march), regardless of the year, day, or time of the member, e.g. 2002-Jan-03 00:00:00 or 1999-Mar-02 02:12:45.
"""
YEARS = 64
"""
Groups all members of a DataPilot field containing a date/time value by their year.
Example: The group 1999 will contain all members with a date in the year 1999, regardless of the month, day, or time of the member, e.g. 1999-Jan-03 00:00:00 or 1999-May-02 02:12:45.
"""
__all__ = ['DataPilotFieldGroupBy']
| class Datapilotfieldgroupby(object):
"""
Const Class
These constants select different types for grouping members of a DataPilot field by date or time.
See Also:
`API DataPilotFieldGroupBy <https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1sheet_1_1DataPilotFieldGroupBy.html>`_
"""
__ooo_ns__: str = 'com.sun.star.sheet'
__ooo_full_ns__: str = 'com.sun.star.sheet.DataPilotFieldGroupBy'
__ooo_type_name__: str = 'const'
seconds = 1
'\n Groups all members of a DataPilot field containing a date/time value by their current value for seconds.\n \n Example: The group :02 will contain all members that contain a time with a seconds value of 2, regardless of the date, hours and minutes of the member, e.g. 2002-Jan-03 00:00:02 or 1999-May-02 12:45:02.\n '
minutes = 2
'\n Groups all members of a DataPilot field containing a date/time value by their current value for minutes.\n \n Example: The group :02 will contain all members that contain a time with a minutes value of 2, regardless of the date, hours and seconds of the member, e.g. 2002-Jan-03 00:02:00 or 1999-May-02 12:02:45.\n '
hours = 4
'\n Groups all members of a DataPilot field containing a date/time value by their current value for hours.\n \n Example: The group 02 will contain all members that contain a time with a hour value of 2, regardless of the date, minutes and seconds of the member, e.g. 2002-Jan-03 02:00:00 or 1999-May-02 02:12:45.\n '
days = 8
'\n Groups all members of a DataPilot field containing a date/time value by their calendar day, or by ranges of days.\n \n Examples:\n \n See descriptions for XDataPilotFieldGrouping.createDateGroup() for more details about day grouping.\n '
months = 16
'\n Groups all members of a DataPilot field containing a date/time value by their month.\n \n Example: The group Jan will contain all members with a date in the month January, regardless of the year, day, or time of the member, e.g. 2002-Jan-03 00:00:00 or 1999-Jan-02 02:12:45.\n '
quarters = 32
'\n Groups all members of a DataPilot field containing a date/time value by their quarter.\n \n Example: The group Q1 will contain all members with a date in the first quarter of a year (i.e. the months January, February, and march), regardless of the year, day, or time of the member, e.g. 2002-Jan-03 00:00:00 or 1999-Mar-02 02:12:45.\n '
years = 64
'\n Groups all members of a DataPilot field containing a date/time value by their year.\n \n Example: The group 1999 will contain all members with a date in the year 1999, regardless of the month, day, or time of the member, e.g. 1999-Jan-03 00:00:00 or 1999-May-02 02:12:45.\n '
__all__ = ['DataPilotFieldGroupBy'] |
input = """
1 2 2 1 3 4
1 3 2 1 2 4
1 4 0 0
1 5 1 0 2
1 6 1 0 5
1 5 1 0 6
0
3 d
2 c
6 b
5 a
0
B+
0
B-
1
0
1
"""
output = """
{d}
{c, a, b}
"""
| input = '\n1 2 2 1 3 4\n1 3 2 1 2 4\n1 4 0 0\n1 5 1 0 2\n1 6 1 0 5\n1 5 1 0 6\n0\n3 d\n2 c\n6 b\n5 a\n0\nB+\n0\nB-\n1\n0\n1\n'
output = '\n{d}\n{c, a, b}\n' |
#! python
# Problem # : 50A
# Created on : 2019-01-14 21:29:26
def Main():
m, n = map(int, input().split(' '))
val = m * n
cnt = int(val / 2)
print(cnt)
if __name__ == '__main__':
Main()
| def main():
(m, n) = map(int, input().split(' '))
val = m * n
cnt = int(val / 2)
print(cnt)
if __name__ == '__main__':
main() |
def organize_data(lines):
max_x = 0
max_y = 0
line_segments = []
# store all of the line segments
for line in lines:
points = line.split(" -> ")
point1 = points[0].split(",")
point2 = points[1].split(",")
x1 = int(point1[0].strip())
y1 = int(point1[1].strip())
x2 = int(point2[0].strip())
y2 = int(point2[1].strip())
line_segments.append([(x1, y1), (x2, y2)])
# keep track of the maximum row and column values
if x1 > max_x: max_x = x1
if y1 > max_y: max_y = y1
if x2 > max_x: max_x = x2
if y2 > max_y: max_y = y2
return line_segments, max_x, max_y
def main():
data = open("day05/input.txt", "r")
lines = [line for line in data]
line_segments, max_x, max_y = organize_data(lines)
# initialize diagram
diagram = []
for y in range(max_y + 1):
diagram.append([])
for x in range(max_x + 1):
diagram[y].append(0)
# fill out diagram
for segment in line_segments:
(x1, y1), (x2, y2) = segment
if x1 == x2:
larger_y = max([y1, y2])
smaller_y = min([y1, y2])
for y in range(smaller_y, larger_y + 1):
diagram[y][x1] += 1
elif y1 == y2:
larger_x = max([x1, x2])
smaller_x = min([x1, x2])
for x in range(smaller_x, larger_x + 1):
diagram[y1][x] += 1
else:
while x1 != x2 and y1 != y2:
diagram[y1][x1] += 1
if x1 > x2:
x1 -= 1
else:
x1 += 1
if y1 > y2:
y1 -= 1
else:
y1 += 1
diagram[y2][x2] += 1
# count the values in the diagram that are >= 2
counter = 0
for row in diagram:
for val in row:
if val >= 2: counter += 1
print(counter)
if __name__ == "__main__":
main() | def organize_data(lines):
max_x = 0
max_y = 0
line_segments = []
for line in lines:
points = line.split(' -> ')
point1 = points[0].split(',')
point2 = points[1].split(',')
x1 = int(point1[0].strip())
y1 = int(point1[1].strip())
x2 = int(point2[0].strip())
y2 = int(point2[1].strip())
line_segments.append([(x1, y1), (x2, y2)])
if x1 > max_x:
max_x = x1
if y1 > max_y:
max_y = y1
if x2 > max_x:
max_x = x2
if y2 > max_y:
max_y = y2
return (line_segments, max_x, max_y)
def main():
data = open('day05/input.txt', 'r')
lines = [line for line in data]
(line_segments, max_x, max_y) = organize_data(lines)
diagram = []
for y in range(max_y + 1):
diagram.append([])
for x in range(max_x + 1):
diagram[y].append(0)
for segment in line_segments:
((x1, y1), (x2, y2)) = segment
if x1 == x2:
larger_y = max([y1, y2])
smaller_y = min([y1, y2])
for y in range(smaller_y, larger_y + 1):
diagram[y][x1] += 1
elif y1 == y2:
larger_x = max([x1, x2])
smaller_x = min([x1, x2])
for x in range(smaller_x, larger_x + 1):
diagram[y1][x] += 1
else:
while x1 != x2 and y1 != y2:
diagram[y1][x1] += 1
if x1 > x2:
x1 -= 1
else:
x1 += 1
if y1 > y2:
y1 -= 1
else:
y1 += 1
diagram[y2][x2] += 1
counter = 0
for row in diagram:
for val in row:
if val >= 2:
counter += 1
print(counter)
if __name__ == '__main__':
main() |
class Config:
def __init__(self, name:str=None, username:str=None, pin:int=2, email:str=None, password:str=None, set_password:bool=False, set_email_notify:bool=False):
self.name = name
self.username = username
self.pin = pin
self.email = email
self.password = password
self.set_password = set_password
self.set_email_notify = set_email_notify | class Config:
def __init__(self, name: str=None, username: str=None, pin: int=2, email: str=None, password: str=None, set_password: bool=False, set_email_notify: bool=False):
self.name = name
self.username = username
self.pin = pin
self.email = email
self.password = password
self.set_password = set_password
self.set_email_notify = set_email_notify |
# https://leetcode.com/problems/longest-increasing-subsequence/
class Solution:
def lengthOfLIS(self, nums: list[int]) -> int:
# Patience sorting-like approach, but keeping track
# only of the topmost element at each stack.
stack_tops = [nums[0]]
for num in nums[1:]:
for idx in range(len(stack_tops)):
if stack_tops[idx] >= num:
stack_tops[idx] = num
break
else:
stack_tops.append(num)
return len(stack_tops)
| class Solution:
def length_of_lis(self, nums: list[int]) -> int:
stack_tops = [nums[0]]
for num in nums[1:]:
for idx in range(len(stack_tops)):
if stack_tops[idx] >= num:
stack_tops[idx] = num
break
else:
stack_tops.append(num)
return len(stack_tops) |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 13:55:35 2020
@author: SethHarden
BINARY SEARCH - ITERATIVE
"""
# Iterative Binary Search Function
# It returns index of x in given array arr if present,
# else returns -1
def binary_search(arr, x):
low = 0
high = len(arr) - 1
mid = 0
while low <= high:
mid = (high + low) // 2
# Check if x is present at mid
if arr[mid] < x:
low = mid + 1
# If x is greater, ignore left half
elif arr[mid] > x:
high = mid - 1
# If x is smaller, ignore right half
else:
return mid
# If we reach here, then the element was not present
return -1
# Test array
arr = [ 2, 3, 4, 10, 40 ]
x = 10
# Function call
result = binary_search(arr, x)
if result != -1:
print("Element is present at index", str(result))
else:
print("Element is not present in array") | """
Created on Wed Dec 30 13:55:35 2020
@author: SethHarden
BINARY SEARCH - ITERATIVE
"""
def binary_search(arr, x):
low = 0
high = len(arr) - 1
mid = 0
while low <= high:
mid = (high + low) // 2
if arr[mid] < x:
low = mid + 1
elif arr[mid] > x:
high = mid - 1
else:
return mid
return -1
arr = [2, 3, 4, 10, 40]
x = 10
result = binary_search(arr, x)
if result != -1:
print('Element is present at index', str(result))
else:
print('Element is not present in array') |
"""
This is the helper module. The attributes of this module
do not interact withy facebook rather help get better
info about the objects fethced from facebook.
"""
D=type( {1:1} )
L=type( [1,2] )
def get_fields(d, s):
if type(d) == D:
for i in d.keys():
if type(d[i]) == L:
print(s+i+"(list)")
else:
print(s+i)
r = len(i)
r = ' '*r
get_fields(d[i], r+s)
elif type(d) == L:
a = d[0]
l = len(a)
for i in a.keys():
if type(a[i]) == L:
print(s+i+"(list)")
else:
print(s+i)
r = len(i)
r = " "*r
get_fields(a[i], r+s)
def fields(d):
return get_fields(d, '')
| """
This is the helper module. The attributes of this module
do not interact withy facebook rather help get better
info about the objects fethced from facebook.
"""
d = type({1: 1})
l = type([1, 2])
def get_fields(d, s):
if type(d) == D:
for i in d.keys():
if type(d[i]) == L:
print(s + i + '(list)')
else:
print(s + i)
r = len(i)
r = ' ' * r
get_fields(d[i], r + s)
elif type(d) == L:
a = d[0]
l = len(a)
for i in a.keys():
if type(a[i]) == L:
print(s + i + '(list)')
else:
print(s + i)
r = len(i)
r = ' ' * r
get_fields(a[i], r + s)
def fields(d):
return get_fields(d, '') |
#
# @lc app=leetcode id=497 lang=python3
#
# [497] Random Point in Non-overlapping Rectangles
#
# @lc code=start
class Solution:
def __init__(self, rects):
"""
:type rects: List[List[int]]
"""
self.rects = rects
self.N = len(rects)
areas = [(x2 - x1 + 1) * (y2 - y1 + 1) for x1, y1, x2, y2 in rects]
self.preSum = [0] * self.N
self.preSum[0] = areas[0]
for i in range(1, self.N):
self.preSum[i] = self.preSum[i - 1] + areas[i]
self.total = self.preSum[-1]
def pickRect(self):
rand = random.randint(0, self.total - 1)
return bisect.bisect_right(self.preSum, rand)
def pickPoint(self, rect):
x1, y1, x2, y2 = rect
x = random.randint(x1, x2)
y = random.randint(y1, y2)
return x, y
def pick(self):
"""
:rtype: List[int]
"""
rectIndex = self.pickRect()
rect = self.rects[rectIndex]
return self.pickPoint(rect)
# Your Solution object will be instantiated and called as such:
# obj = Solution(rects)
# param_1 = obj.pick()
# @lc code=end
| class Solution:
def __init__(self, rects):
"""
:type rects: List[List[int]]
"""
self.rects = rects
self.N = len(rects)
areas = [(x2 - x1 + 1) * (y2 - y1 + 1) for (x1, y1, x2, y2) in rects]
self.preSum = [0] * self.N
self.preSum[0] = areas[0]
for i in range(1, self.N):
self.preSum[i] = self.preSum[i - 1] + areas[i]
self.total = self.preSum[-1]
def pick_rect(self):
rand = random.randint(0, self.total - 1)
return bisect.bisect_right(self.preSum, rand)
def pick_point(self, rect):
(x1, y1, x2, y2) = rect
x = random.randint(x1, x2)
y = random.randint(y1, y2)
return (x, y)
def pick(self):
"""
:rtype: List[int]
"""
rect_index = self.pickRect()
rect = self.rects[rectIndex]
return self.pickPoint(rect) |
{
"targets": [{
"target_name": "binding",
"sources": ["binding.cc"],
"include_dirs": [
"<!(node -e \"require('nan')\")",
"/opt/vc/include",
"/opt/vc/include/interface/vcos/pthreads",
"/opt/vc/include/interface/vmcs_host/linux"
],
"libraries": ["-lbcm_host", "-L/opt/vc/lib"]
}]
}
| {'targets': [{'target_name': 'binding', 'sources': ['binding.cc'], 'include_dirs': ['<!(node -e "require(\'nan\')")', '/opt/vc/include', '/opt/vc/include/interface/vcos/pthreads', '/opt/vc/include/interface/vmcs_host/linux'], 'libraries': ['-lbcm_host', '-L/opt/vc/lib']}]} |
RES_SPA_MASSAGE_PARLOR = [
"spa",
"table",
"shower",
"nuru",
"slide",
"therapy",
"therapist",
"bodyrub",
"sauna",
"gel",
"shiatsu",
"jacuzzi"
]
| res_spa_massage_parlor = ['spa', 'table', 'shower', 'nuru', 'slide', 'therapy', 'therapist', 'bodyrub', 'sauna', 'gel', 'shiatsu', 'jacuzzi'] |
'''function in python
'''
print('=== function in python ===')
def func_args(*args):
print('* function *args')
for x in args:
print(x)
def func_kwargs(**kwargs):
print('* function **kwargs')
print('kwargs[name]', kwargs['name'])
func_args('hainv', '23')
func_kwargs(name="Tobias", lname="Refsnes")
print('=== lambda functions ===') | """function in python
"""
print('=== function in python ===')
def func_args(*args):
print('* function *args')
for x in args:
print(x)
def func_kwargs(**kwargs):
print('* function **kwargs')
print('kwargs[name]', kwargs['name'])
func_args('hainv', '23')
func_kwargs(name='Tobias', lname='Refsnes')
print('=== lambda functions ===') |
# config.py
class Config(object):
num_channels = 256
linear_size = 256
output_size = 4
max_epochs = 10
lr = 0.001
batch_size = 128
seq_len = 300 # 1014 in original paper
dropout_keep = 0.5 | class Config(object):
num_channels = 256
linear_size = 256
output_size = 4
max_epochs = 10
lr = 0.001
batch_size = 128
seq_len = 300
dropout_keep = 0.5 |
arr = input()
for i in range(0, len(arr), 7):
bits = arr[i:i + 7]
result = 0
n = 1
for b in bits[::-1]:
result += n * int(b)
n *= 2
print(result)
| arr = input()
for i in range(0, len(arr), 7):
bits = arr[i:i + 7]
result = 0
n = 1
for b in bits[::-1]:
result += n * int(b)
n *= 2
print(result) |
def test():
# Here we can either check objects created in the solution code, or the
# string value of the solution, available as __solution__. A helper for
# printing formatted messages is available as __msg__. See the testTemplate
# in the meta.json for details.
# If an assertion fails, the message will be displayed
assert 'X' in __solution__, "Make sure you are using 'X' as a variable"
assert 'y' in __solution__, "Make sure you are using 'y' as a variable"
assert X.shape == (25, 8), "The dimensions of X is incorrect. Are you selcting the correct columns?"
assert y.shape == (25,), "The dimensions of y is incorrect. Are you selcting the correct columns?"
assert 'availability' not in X.columns, "Make sure the target is not in X dataframe"
assert sorted(list(X.columns))[0:4] == ['caramel', 'chocolate', 'coconut', 'cookie_wafer_rice'], "The X dataframe includes the incorrect columns. Make sure you are selecting the correct columns"
__msg__.good("Nice work, well done!")
| def test():
assert 'X' in __solution__, "Make sure you are using 'X' as a variable"
assert 'y' in __solution__, "Make sure you are using 'y' as a variable"
assert X.shape == (25, 8), 'The dimensions of X is incorrect. Are you selcting the correct columns?'
assert y.shape == (25,), 'The dimensions of y is incorrect. Are you selcting the correct columns?'
assert 'availability' not in X.columns, 'Make sure the target is not in X dataframe'
assert sorted(list(X.columns))[0:4] == ['caramel', 'chocolate', 'coconut', 'cookie_wafer_rice'], 'The X dataframe includes the incorrect columns. Make sure you are selecting the correct columns'
__msg__.good('Nice work, well done!') |
n = int(input('Enter number of lines:'))
for i in range(1, n +1):
for j in range(1, n+1):
if i == 1 or j == 1 or i == n or j == n:
print("*", end = ' ')
else:
print(' ', end = ' ')
print()
| n = int(input('Enter number of lines:'))
for i in range(1, n + 1):
for j in range(1, n + 1):
if i == 1 or j == 1 or i == n or (j == n):
print('*', end=' ')
else:
print(' ', end=' ')
print() |
##-------------------------------------------------------------------
"""
Given a binary tree and a sum, find all root-to-leaf
paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ / \
7 2 5 1
return
[
[5,4,11,2],
[5,8,4,5]
]
##-------------------------------------------------------------------
"""
def path_sum(root, sum):
if root is None:
return []
res = []
dfs(root, sum, [], res)
return res
def dfs(root, sum, ls, res):
if root.left is None and root.right is None and root.val == sum:
ls.append(root.val)
res.append(ls)
if root.left is not None:
dfs(root.left, sum - root.val, ls + [root.val], res)
if root.right is not None:
dfs(root.right, sum - root.val, ls + [root.val], res)
# DFS with stack
def path_sum2(root, s):
if root is None:
return []
res = []
stack = [(root, [root.val])]
while stack:
node, ls = stack.pop()
if node.left is None and node.right is None and sum(ls) == s:
res.append(ls)
if node.left is not None:
stack.append((node.left, ls + [node.left.val]))
if node.right is not None:
stack.append((node.right, ls + [node.right.val]))
return res
# BFS with queue
def path_sum3(root, sum):
if root is None:
return []
res = []
queue = [(root, root.val, [root.val])]
while queue:
node, val, ls = queue.pop(0) # popleft
if node.left is None and node.right is None and val == sum:
res.append(ls)
if node.left is not None:
queue.append((node.left, val + node.left.val, ls + [node.left.val]))
if node.right is not None:
queue.append((node.right, val + node.right.val, ls + [node.right.val]))
return res
| """
Given a binary tree and a sum, find all root-to-leaf
paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum = 22,
5
/ 4 8
/ / 11 13 4
/ \\ / 7 2 5 1
return
[
[5,4,11,2],
[5,8,4,5]
]
##-------------------------------------------------------------------
"""
def path_sum(root, sum):
if root is None:
return []
res = []
dfs(root, sum, [], res)
return res
def dfs(root, sum, ls, res):
if root.left is None and root.right is None and (root.val == sum):
ls.append(root.val)
res.append(ls)
if root.left is not None:
dfs(root.left, sum - root.val, ls + [root.val], res)
if root.right is not None:
dfs(root.right, sum - root.val, ls + [root.val], res)
def path_sum2(root, s):
if root is None:
return []
res = []
stack = [(root, [root.val])]
while stack:
(node, ls) = stack.pop()
if node.left is None and node.right is None and (sum(ls) == s):
res.append(ls)
if node.left is not None:
stack.append((node.left, ls + [node.left.val]))
if node.right is not None:
stack.append((node.right, ls + [node.right.val]))
return res
def path_sum3(root, sum):
if root is None:
return []
res = []
queue = [(root, root.val, [root.val])]
while queue:
(node, val, ls) = queue.pop(0)
if node.left is None and node.right is None and (val == sum):
res.append(ls)
if node.left is not None:
queue.append((node.left, val + node.left.val, ls + [node.left.val]))
if node.right is not None:
queue.append((node.right, val + node.right.val, ls + [node.right.val]))
return res |
# Get the abuse API key from the site
abuseKey = ''
# Get the hybrid API key from the site
hybridKey = ''
# Get the malshare API key from the site
malshareKey = ''
# Get the urlscan key from the site
urlScanKey = ''
# Get the valhalla key from the site
valhallaKey = ''
# Get the Virustotal API key from the site
vtKey = ''
# Get the Cape Sandbox Token using the sample codes
"""
import requests
data = {'username': '<USER>','password': '<PASSWD>'}
response = requests.post('https://capesandbox.com/apiv2/api-token-auth/', data=data)
print(response.json())
"""
# OR
"""
curl -d "username=<USER>&password=<PASSWD>" https://capesandbox.com/apiv2/api-token-auth/
"""
capeToken = ''
| abuse_key = ''
hybrid_key = ''
malshare_key = ''
url_scan_key = ''
valhalla_key = ''
vt_key = ''
"\nimport requests\ndata = {'username': '<USER>','password': '<PASSWD>'}\nresponse = requests.post('https://capesandbox.com/apiv2/api-token-auth/', data=data)\nprint(response.json()) \n"
'\ncurl -d "username=<USER>&password=<PASSWD>" https://capesandbox.com/apiv2/api-token-auth/\n'
cape_token = '' |
"""Top-level package for DJI Android SDK to Python."""
__author__ = """Carlos Tovar"""
__email__ = 'cartovarc@gmail.com'
__version__ = '0.1.0'
| """Top-level package for DJI Android SDK to Python."""
__author__ = 'Carlos Tovar'
__email__ = 'cartovarc@gmail.com'
__version__ = '0.1.0' |
#import sys
#file = sys.stdin
file = open( r".\data\listcomprehensions.txt" )
data = file.read().strip().split()
#x,y,z,n = input(), input(), input(), input()
x,y,z = map(eval, map(''.join, (zip(data[:3], ['+1']*3))))
n = int(data[3])
print(x,y,z,n)
coords = [[a,b,c] for a in range(x) for b in range(y) for c in range(z) if a+b+c != n]
print(coords)
| file = open('.\\data\\listcomprehensions.txt')
data = file.read().strip().split()
(x, y, z) = map(eval, map(''.join, zip(data[:3], ['+1'] * 3)))
n = int(data[3])
print(x, y, z, n)
coords = [[a, b, c] for a in range(x) for b in range(y) for c in range(z) if a + b + c != n]
print(coords) |
routes_in=(('/forca/(?P<a>.*)','/\g<a>'),)
default_application = 'ForCA' # ordinarily set in base routes.py
default_controller = 'default' # ordinarily set in app-specific routes.py
default_function = 'index' # ordinarily set in app-specific routes.py
routes_out=(('/(?P<a>.*)','/forca/\g<a>'),)
| routes_in = (('/forca/(?P<a>.*)', '/\\g<a>'),)
default_application = 'ForCA'
default_controller = 'default'
default_function = 'index'
routes_out = (('/(?P<a>.*)', '/forca/\\g<a>'),) |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
"""
Init signature:
SissoRegressor(
n_nonzero_coefs=1,
n_features_per_sis_iter=1,
all_l0_combinations=True,
)
Docstring:
A simple implementation of the SISSO algorithm (R. Ouyang, S. Curtarolo,
E. Ahmetcik et al., Phys. Rev. Mater.2, 083802 (2018)) for regression for
workshop tutorials. SISSO is an iterative approach where at each iteration
first SIS (Sure Independence Sreening) and SO (Sparsifying Operator, here l0-regularization)
is applied.
Note that it becomes the orthogonal matching pursuit for n_features_per_sis_iter=1.
This code was copied from:
https://analytics-toolkit.nomad-coe.eu/hub/user-redirect/notebooks/tutorials/compressed_sensing.ipynb
A more efficient fortran implementation can be found on https://github.com/rouyang2017.
The code raises an error for parameters that lead to longer calculation in order
to keep the tutorial servers free.
Parameters
----------
n_nonzero_coefs : int
Number of nonzero coefficients/ max. number of dimension of descriptor.
n_features_per_sis_iter : int
Number of features collected per SIS step.
all_l0_combinations : bool, default True
If True, in the l0 step all combinations out sis_collected features will be checked.
If False, combinations of features of the same SIS iterations will be neglected.
Attributes
----------
coefs: array, [n_features]
(Sparse) coefficient vector of linear model
intercept: int
Intercept/ bias of linear model.
sis_selected_indices : list of arrays, [[n_features_per_sis_iter,], [n_features_per_sis_iter,], ...]
List of indices selected at each SIS iteration.
l0_selected_indices : list of arrays, [[1,], [2,], ...]
List of indices selected at each SIS+L0 iteration.
Methods
-------
fit(D, P) : P: array, [n_sample, n_features]
D: array, [n_sample,]
predict(D[, dim]): D: array, [n_sample,]
dim: int, optional
dim (number of nonzero coefs) specifies that prediction
should be done with result from another step than the last.
print_models(features) : features: list of str [n_features,]
Source:
"""
class SissoRegressor(object):
""" A simple implementation of the SISSO algorithm (R. Ouyang, S. Curtarolo,
E. Ahmetcik et al., Phys. Rev. Mater.2, 083802 (2018)) for regression for
workshop tutorials. SISSO is an iterative approach where at each iteration
first SIS (Sure Independence Sreening) and SO (Sparsifying Operator, here l0-regularization)
is applied.
Note that it becomes the orthogonal matching pursuit for n_features_per_sis_iter=1.
A more efficient fortran implementation can be found on https://github.com/rouyang2017.
The code raises an error for parameters that lead to longer calculation in order
to keep the tutorial servers free.
Parameters
----------
n_nonzero_coefs : int
Number of nonzero coefficients/ max. number of dimension of descriptor.
n_features_per_sis_iter : int
Number of features collected per SIS step.
all_l0_combinations : bool, default True
If True, in the l0 step all combinations out sis_collected features will be checked.
If False, combinations of features of the same SIS iterations will be neglected.
Attributes
----------
coefs: array, [n_features]
(Sparse) coefficient vector of linear model
intercept: int
Intercept/ bias of linear model.
sis_selected_indices : list of arrays, [[n_features_per_sis_iter,], [n_features_per_sis_iter,], ...]
List of indices selected at each SIS iteration.
l0_selected_indices : list of arrays, [[1,], [2,], ...]
List of indices selected at each SIS+L0 iteration.
Methods
-------
fit(D, P) : P: array, [n_sample, n_features]
D: array, [n_sample,]
predict(D[, dim]): D: array, [n_sample,]
dim: int, optional
dim (number of nonzero coefs) specifies that prediction
should be done with result from another step than the last.
print_models(features) : features: list of str [n_features,]
"""
def __init__(self, n_nonzero_coefs=1, n_features_per_sis_iter=1, all_l0_combinations=True):
self.n_nonzero_coefs = n_nonzero_coefs
self.n_features_per_sis_iter = n_features_per_sis_iter
self.all_l0_combinations = all_l0_combinations
def fit(self, D, P):
self._check_params(D.shape[1])
self._initialize_variables()
self.sis_not_selected_indices = np.arange(D.shape[1])
# standardize D and center P
self._set_standardizer(D)
D = self._get_standardized(D)
# center target
P_mean = P.mean()
P_centered = P - P.mean()
for i_iter in range(self.n_nonzero_coefs):
# set residual, in first iteration the target P is used
if i_iter == 0:
Residual = P_centered
else:
Residual = P_centered - self._predict_of_standardized(D)
# sis step: get the indices of the n_features_per_sis_iter
# closest features to the residual/target
indices_n_closest, best_projection_score = self._sis(D, Residual)
self.sis_selected_indices.append( indices_n_closest )
# SA step or L0 step, only if i_iter > 0
if i_iter == 0:
self._coefs_stan, self.curr_selected_indices = best_projection_score/P.size, indices_n_closest[:1]
rmse = np.linalg.norm(P_centered - self._predict_of_standardized(D)) / np.sqrt(P.size)
else:
# perform L0 regularization
self._coefs_stan, self.curr_selected_indices, rmse = self._l0_regularization(D, P_centered, self.sis_selected_indices)
### process and save model outcomes
# transform coefs to coefs of not standardized D
coefs, self.intercept = self._get_notstandardized_coefs(self._coefs_stan, P_mean)
# generate coefs array with zeros except selected indices
# (might be needed for the user)
self.coefs = np.zeros(D.shape[1])
self.coefs[self.curr_selected_indices] = coefs
# append lists of coefs, indices, ...
self._list_of_coefs.append(coefs)
self.list_of_coefs.append(self.coefs)
self.list_of_intercepts.append(self.intercept)
self.l0_selected_indices.append(self.curr_selected_indices)
self.rmses.append(rmse)
def predict(self, D, dim=None):
if dim is None:
dim = self.n_nonzero_coefs
# use only selected indices/features of D
# and add column of ones for the intercept/bias
D_model = D[:, self.l0_selected_indices[dim - 1]]
D_model = np.column_stack((D_model, np.ones(D.shape[0])))
coefs_model = np.append(self._list_of_coefs[dim - 1], self.list_of_intercepts[dim - 1])
return np.dot(D_model, coefs_model)
def print_models(self, features):
string = '%14s %16s\n' %('RMSE', 'Model')
string += "\n".join( [self._get_model_string(features, i_iter) for i_iter in range(self.n_nonzero_coefs)] )
print(string)
def _initialize_variables(self):
# variabels for standardizer
self.scales = 1.
self.means = 0.
# indices selected SIS
self.sis_selected_indices = []
self.sis_not_selected_indices = None
# indices selected by L0 (after each SIS step)
self.l0_selected_indices = []
self.curr_selected_indices = None
# coefs and lists for output
self.coefs = None
self.intercept = None
self.list_of_coefs = []
self._list_of_coefs = []
self.list_of_intercepts = []
self.rmses = []
def _set_standardizer(self, D):
self.means = D.mean(axis=0)
self.scales = D.std(axis=0)
def _get_standardized(self, D):
return (D - self.means) / self.scales
def _l0_regularization(self, D, P, list_of_sis_indices):
square_error_min = np.inner(P, P)
coefs_min, indices_combi_min = None, None
# check each least squares error of combination of each indeces tuple of list_of_sis_indices.
# If self.all_l0_combinations is False, combinations of featuers from the same SIS iteration
# will be neglected
if self.all_l0_combinations:
combinations_generator = combinations(np.concatenate(list_of_sis_indices), len(list_of_sis_indices))
else:
combinations_generator = product(*list_of_sis_indices)
for indices_combi in combinations_generator:
D_ls = D[:, indices_combi]
coefs, square_error, __1, __2 = np.linalg.lstsq(D_ls, P, rcond=-1)
try:
if square_error[0] < square_error_min:
square_error_min = square_error[0]
coefs_min, indices_combi_min = coefs, indices_combi
except:
pass
rmse = np.sqrt(square_error_min / D.shape[0])
return coefs_min, list(indices_combi_min), rmse
def _get_notstandardized_coefs(self, coefs, bias):
""" transform coefs of linear model with standardized input to coefs of non-standardized input"""
coefs_not = coefs / self.scales[self.curr_selected_indices]
bias_not = bias - np.dot(self.means[self.curr_selected_indices] / self.scales[self.curr_selected_indices], coefs)
return coefs_not, bias_not
def _ncr(self, n, r):
""" Binomial coefficient"""
r = min(r, n-r)
if r == 0: return 1
numer = functools.reduce(op.mul, range(n, n-r, -1))
denom = functools.reduce(op.mul, range(1, r+1))
return numer//denom
def _check_params(self, n_columns):
string_out = "n_nonzero_coefs * n_features_per_sis_iter is larger "
string_out += "than the number of columns in your input matrix. "
string_out += "Choose a smaller n_nonzero_coefs or a smaller n_features_per_sis_iter."
if n_columns < self.n_nonzero_coefs * self.n_features_per_sis_iter:
raise ValueError(string_out)
# Shrinkage sisso for tutorials in order to save tutorial server
# cpus from beeing occupied all the time
#n_l0_steps = sum([self.ncr( n_sis*dim, dim ) for dim in range(1, n_nonzero_coefs+1)])
if self.all_l0_combinations:
n_l0_steps = sum([self._ncr(self.n_features_per_sis_iter * dim, dim ) for dim in range(2, self.n_nonzero_coefs+1)])
else:
n_l0_steps = sum([np.product([self.n_features_per_sis_iter]*dim) for dim in range(2, self.n_nonzero_coefs+1)])
upper_limit = 80000
if n_l0_steps > upper_limit:
string_out = "With the given settings in the l0-regularizaton %s combinations of features have to be considered." % n_l0_steps
string_out += "For this tutorial the upper limit is %s. " % upper_limit
string_out += "Choose a smaller n_nonzero_coefs or a smaller n_features_per_sis_iter."
raise ValueError(string_out)
def _predict_of_standardized(self, D):
return np.dot(D[:, self.curr_selected_indices], self._coefs_stan)
def _sis(self, D, P):
# evaluate how close each feature is to the target
# without already selected self.sis_selected_indices
projection_scores = np.dot(P, D[:, self.sis_not_selected_indices])
abs_projection_scores = abs(projection_scores)
# sort the values according to their abs. projection score
# starting from the closest, and get the indices
# of the n_features_per_sis_iter closest
indices_sorted = abs_projection_scores.argsort()[::-1]
indices_n_closest = indices_sorted[: self.n_features_per_sis_iter]
best_projection_score = projection_scores[ indices_n_closest[:1] ]
# transform indices_n_closest according to originial indices system
# of range(D.shape[1]) and delete the selected ones from
# self.sis_not_selected_indices
indices_n_closest_out = self.sis_not_selected_indices[indices_n_closest]
self.sis_not_selected_indices = np.delete(self.sis_not_selected_indices, indices_n_closest)
return indices_n_closest_out, best_projection_score
def _get_model_string(self, features, i_iter):
dimension = i_iter + 1
coefs = np.append(self._list_of_coefs[i_iter], self.list_of_intercepts[i_iter])
selected_features = [features[i] for i in self.l0_selected_indices[i_iter]]
string = '%sD:\t%8f\t' %(dimension, self.rmses[i_iter])
for i_dim in range(dimension+1):
if coefs[i_dim] > 0.:
sign = '+'
c = coefs[i_dim]
else:
sign = '-'
c = abs(coefs[i_dim])
if i_dim < dimension:
string += '%s %.3f %s ' %(sign, c, selected_features[i_dim])
else:
string += '%s %.3f' %(sign, c)
return string
"""
File: /opt/conda/lib/python3.7/site-packages/compressed_sensing/sisso.py
Type: type
Subclasses:
""" | """
Spyder Editor
This is a temporary script file.
"""
'\nInit signature:\nSissoRegressor(\n n_nonzero_coefs=1,\n n_features_per_sis_iter=1,\n all_l0_combinations=True,\n)\nDocstring: \nA simple implementation of the SISSO algorithm (R. Ouyang, S. Curtarolo, \nE. Ahmetcik et al., Phys. Rev. Mater.2, 083802 (2018)) for regression for\nworkshop tutorials. SISSO is an iterative approach where at each iteration\nfirst SIS (Sure Independence Sreening) and SO (Sparsifying Operator, here l0-regularization) \nis applied.\nNote that it becomes the orthogonal matching pursuit for n_features_per_sis_iter=1.\n\nThis code was copied from:\nhttps://analytics-toolkit.nomad-coe.eu/hub/user-redirect/notebooks/tutorials/compressed_sensing.ipynb\nA more efficient fortran implementation can be found on https://github.com/rouyang2017.\n\nThe code raises an error for parameters that lead to longer calculation in order\nto keep the tutorial servers free.\n\nParameters\n----------\nn_nonzero_coefs : int\n Number of nonzero coefficients/ max. number of dimension of descriptor.\n\nn_features_per_sis_iter : int\n Number of features collected per SIS step.\n\nall_l0_combinations : bool, default True\n If True, in the l0 step all combinations out sis_collected features will be checked.\n If False, combinations of features of the same SIS iterations will be neglected.\n\nAttributes\n----------\ncoefs: array, [n_features]\n (Sparse) coefficient vector of linear model\n\nintercept: int\n Intercept/ bias of linear model.\n\nsis_selected_indices : list of arrays, [[n_features_per_sis_iter,], [n_features_per_sis_iter,], ...]\n List of indices selected at each SIS iteration.\n\nl0_selected_indices : list of arrays, [[1,], [2,], ...]\n List of indices selected at each SIS+L0 iteration.\n\nMethods\n-------\nfit(D, P) : P: array, [n_sample, n_features]\n D: array, [n_sample,]\n \npredict(D[, dim]): D: array, [n_sample,]\n dim: int, optional\n dim (number of nonzero coefs) specifies that prediction \n should be done with result from another step than the last.\n\nprint_models(features) : features: list of str [n_features,]\nSource: \n'
class Sissoregressor(object):
""" A simple implementation of the SISSO algorithm (R. Ouyang, S. Curtarolo,
E. Ahmetcik et al., Phys. Rev. Mater.2, 083802 (2018)) for regression for
workshop tutorials. SISSO is an iterative approach where at each iteration
first SIS (Sure Independence Sreening) and SO (Sparsifying Operator, here l0-regularization)
is applied.
Note that it becomes the orthogonal matching pursuit for n_features_per_sis_iter=1.
A more efficient fortran implementation can be found on https://github.com/rouyang2017.
The code raises an error for parameters that lead to longer calculation in order
to keep the tutorial servers free.
Parameters
----------
n_nonzero_coefs : int
Number of nonzero coefficients/ max. number of dimension of descriptor.
n_features_per_sis_iter : int
Number of features collected per SIS step.
all_l0_combinations : bool, default True
If True, in the l0 step all combinations out sis_collected features will be checked.
If False, combinations of features of the same SIS iterations will be neglected.
Attributes
----------
coefs: array, [n_features]
(Sparse) coefficient vector of linear model
intercept: int
Intercept/ bias of linear model.
sis_selected_indices : list of arrays, [[n_features_per_sis_iter,], [n_features_per_sis_iter,], ...]
List of indices selected at each SIS iteration.
l0_selected_indices : list of arrays, [[1,], [2,], ...]
List of indices selected at each SIS+L0 iteration.
Methods
-------
fit(D, P) : P: array, [n_sample, n_features]
D: array, [n_sample,]
predict(D[, dim]): D: array, [n_sample,]
dim: int, optional
dim (number of nonzero coefs) specifies that prediction
should be done with result from another step than the last.
print_models(features) : features: list of str [n_features,]
"""
def __init__(self, n_nonzero_coefs=1, n_features_per_sis_iter=1, all_l0_combinations=True):
self.n_nonzero_coefs = n_nonzero_coefs
self.n_features_per_sis_iter = n_features_per_sis_iter
self.all_l0_combinations = all_l0_combinations
def fit(self, D, P):
self._check_params(D.shape[1])
self._initialize_variables()
self.sis_not_selected_indices = np.arange(D.shape[1])
self._set_standardizer(D)
d = self._get_standardized(D)
p_mean = P.mean()
p_centered = P - P.mean()
for i_iter in range(self.n_nonzero_coefs):
if i_iter == 0:
residual = P_centered
else:
residual = P_centered - self._predict_of_standardized(D)
(indices_n_closest, best_projection_score) = self._sis(D, Residual)
self.sis_selected_indices.append(indices_n_closest)
if i_iter == 0:
(self._coefs_stan, self.curr_selected_indices) = (best_projection_score / P.size, indices_n_closest[:1])
rmse = np.linalg.norm(P_centered - self._predict_of_standardized(D)) / np.sqrt(P.size)
else:
(self._coefs_stan, self.curr_selected_indices, rmse) = self._l0_regularization(D, P_centered, self.sis_selected_indices)
(coefs, self.intercept) = self._get_notstandardized_coefs(self._coefs_stan, P_mean)
self.coefs = np.zeros(D.shape[1])
self.coefs[self.curr_selected_indices] = coefs
self._list_of_coefs.append(coefs)
self.list_of_coefs.append(self.coefs)
self.list_of_intercepts.append(self.intercept)
self.l0_selected_indices.append(self.curr_selected_indices)
self.rmses.append(rmse)
def predict(self, D, dim=None):
if dim is None:
dim = self.n_nonzero_coefs
d_model = D[:, self.l0_selected_indices[dim - 1]]
d_model = np.column_stack((D_model, np.ones(D.shape[0])))
coefs_model = np.append(self._list_of_coefs[dim - 1], self.list_of_intercepts[dim - 1])
return np.dot(D_model, coefs_model)
def print_models(self, features):
string = '%14s %16s\n' % ('RMSE', 'Model')
string += '\n'.join([self._get_model_string(features, i_iter) for i_iter in range(self.n_nonzero_coefs)])
print(string)
def _initialize_variables(self):
self.scales = 1.0
self.means = 0.0
self.sis_selected_indices = []
self.sis_not_selected_indices = None
self.l0_selected_indices = []
self.curr_selected_indices = None
self.coefs = None
self.intercept = None
self.list_of_coefs = []
self._list_of_coefs = []
self.list_of_intercepts = []
self.rmses = []
def _set_standardizer(self, D):
self.means = D.mean(axis=0)
self.scales = D.std(axis=0)
def _get_standardized(self, D):
return (D - self.means) / self.scales
def _l0_regularization(self, D, P, list_of_sis_indices):
square_error_min = np.inner(P, P)
(coefs_min, indices_combi_min) = (None, None)
if self.all_l0_combinations:
combinations_generator = combinations(np.concatenate(list_of_sis_indices), len(list_of_sis_indices))
else:
combinations_generator = product(*list_of_sis_indices)
for indices_combi in combinations_generator:
d_ls = D[:, indices_combi]
(coefs, square_error, __1, __2) = np.linalg.lstsq(D_ls, P, rcond=-1)
try:
if square_error[0] < square_error_min:
square_error_min = square_error[0]
(coefs_min, indices_combi_min) = (coefs, indices_combi)
except:
pass
rmse = np.sqrt(square_error_min / D.shape[0])
return (coefs_min, list(indices_combi_min), rmse)
def _get_notstandardized_coefs(self, coefs, bias):
""" transform coefs of linear model with standardized input to coefs of non-standardized input"""
coefs_not = coefs / self.scales[self.curr_selected_indices]
bias_not = bias - np.dot(self.means[self.curr_selected_indices] / self.scales[self.curr_selected_indices], coefs)
return (coefs_not, bias_not)
def _ncr(self, n, r):
""" Binomial coefficient"""
r = min(r, n - r)
if r == 0:
return 1
numer = functools.reduce(op.mul, range(n, n - r, -1))
denom = functools.reduce(op.mul, range(1, r + 1))
return numer // denom
def _check_params(self, n_columns):
string_out = 'n_nonzero_coefs * n_features_per_sis_iter is larger '
string_out += 'than the number of columns in your input matrix. '
string_out += 'Choose a smaller n_nonzero_coefs or a smaller n_features_per_sis_iter.'
if n_columns < self.n_nonzero_coefs * self.n_features_per_sis_iter:
raise value_error(string_out)
if self.all_l0_combinations:
n_l0_steps = sum([self._ncr(self.n_features_per_sis_iter * dim, dim) for dim in range(2, self.n_nonzero_coefs + 1)])
else:
n_l0_steps = sum([np.product([self.n_features_per_sis_iter] * dim) for dim in range(2, self.n_nonzero_coefs + 1)])
upper_limit = 80000
if n_l0_steps > upper_limit:
string_out = 'With the given settings in the l0-regularizaton %s combinations of features have to be considered.' % n_l0_steps
string_out += 'For this tutorial the upper limit is %s. ' % upper_limit
string_out += 'Choose a smaller n_nonzero_coefs or a smaller n_features_per_sis_iter.'
raise value_error(string_out)
def _predict_of_standardized(self, D):
return np.dot(D[:, self.curr_selected_indices], self._coefs_stan)
def _sis(self, D, P):
projection_scores = np.dot(P, D[:, self.sis_not_selected_indices])
abs_projection_scores = abs(projection_scores)
indices_sorted = abs_projection_scores.argsort()[::-1]
indices_n_closest = indices_sorted[:self.n_features_per_sis_iter]
best_projection_score = projection_scores[indices_n_closest[:1]]
indices_n_closest_out = self.sis_not_selected_indices[indices_n_closest]
self.sis_not_selected_indices = np.delete(self.sis_not_selected_indices, indices_n_closest)
return (indices_n_closest_out, best_projection_score)
def _get_model_string(self, features, i_iter):
dimension = i_iter + 1
coefs = np.append(self._list_of_coefs[i_iter], self.list_of_intercepts[i_iter])
selected_features = [features[i] for i in self.l0_selected_indices[i_iter]]
string = '%sD:\t%8f\t' % (dimension, self.rmses[i_iter])
for i_dim in range(dimension + 1):
if coefs[i_dim] > 0.0:
sign = '+'
c = coefs[i_dim]
else:
sign = '-'
c = abs(coefs[i_dim])
if i_dim < dimension:
string += '%s %.3f %s ' % (sign, c, selected_features[i_dim])
else:
string += '%s %.3f' % (sign, c)
return string
'\nFile: /opt/conda/lib/python3.7/site-packages/compressed_sensing/sisso.py\nType: type\nSubclasses: \n' |
print ("Dit is het FIZZBUZZ spel!")
end = input("""\nWe gaan even na of een getal deelbaar is door 3 OF 5 .\nOf door 3 EN 5.\n
Geef een geheel getal in tussen 1 en 100: """)
# try-except statement:
# if the code inside try fails, the program automatically goes to the except part.
try:
end = int(end) # convert string into number
for num in range(1, end+1):
if num % 3 == 0 and num % 5 == 0:
print ("FIZZBUZZ-3-5")
elif num % 3 == 0:
print ("\tfizz-3")
elif num % 5 == 0:
print ("\t\tbuzz-5")
else:
print(num)
except Exception as e:
print("Sorry. Ik lust alleen HELE getallen!")
| print('Dit is het FIZZBUZZ spel!')
end = input('\nWe gaan even na of een getal deelbaar is door 3 OF 5 .\nOf door 3 EN 5.\n\nGeef een geheel getal in tussen 1 en 100: ')
try:
end = int(end)
for num in range(1, end + 1):
if num % 3 == 0 and num % 5 == 0:
print('FIZZBUZZ-3-5')
elif num % 3 == 0:
print('\tfizz-3')
elif num % 5 == 0:
print('\t\tbuzz-5')
else:
print(num)
except Exception as e:
print('Sorry. Ik lust alleen HELE getallen!') |
"""Define package errors."""
class WeatherbitError(Exception):
"""Define a base error."""
pass
class InvalidApiKey(WeatherbitError):
"""Define an error related to invalid or missing API Key."""
pass
class RequestError(WeatherbitError):
"""Define an error related to invalid requests."""
pass
class ResultError(WeatherbitError):
"""Define an error related to the result returned from a request."""
pass
| """Define package errors."""
class Weatherbiterror(Exception):
"""Define a base error."""
pass
class Invalidapikey(WeatherbitError):
"""Define an error related to invalid or missing API Key."""
pass
class Requesterror(WeatherbitError):
"""Define an error related to invalid requests."""
pass
class Resulterror(WeatherbitError):
"""Define an error related to the result returned from a request."""
pass |
N = int(input())
X = 0
W = 0
Y = 0
Z = 0
for i in range(N):
W = Z + 1
X = W + 1
Y = X + 1
Z = Y + 1
print('{} {} {} PUM'.format(W, X, Y))
| n = int(input())
x = 0
w = 0
y = 0
z = 0
for i in range(N):
w = Z + 1
x = W + 1
y = X + 1
z = Y + 1
print('{} {} {} PUM'.format(W, X, Y)) |
#!/usr/bin/env python3
# Write a program that prints out the position, frame, and letter of the DNA
# Try coding this with a single loop
# Try coding this with nested loops
dna = 'ATGGCCTTT'
'''
for i in range(len(dna)):
frame = 0
print(i, frame, dna[i])
if frame == 2:
frame = 0
else:
frame +=1 #initial attempt - functional but more complicated than necessary
'''
for i in range(len(dna)): #single loop
print(i, i%3, dna[i])
for i in range(0, len(dna), 3): #nested
for j in range(3):
print(i + j, j, dna[i + j])
''''''
"""
python3 24frame.py
0 0 A
1 1 T
2 2 G
3 0 G
4 1 C
5 2 C
6 0 T
7 1 T
8 2 T
"""
| dna = 'ATGGCCTTT'
'\nfor i in range(len(dna)):\n\tframe = 0\n\tprint(i, frame, dna[i])\n\tif frame == 2:\n\t\tframe = 0\n\telse:\n\t\tframe +=1 #initial attempt - functional but more complicated than necessary \n'
for i in range(len(dna)):
print(i, i % 3, dna[i])
for i in range(0, len(dna), 3):
for j in range(3):
print(i + j, j, dna[i + j])
''
'\npython3 24frame.py\n0 0 A\n1 1 T\n2 2 G\n3 0 G\n4 1 C\n5 2 C\n6 0 T\n7 1 T\n8 2 T\n' |
# pylint: disable=missing-function-docstring, missing-module-docstring/
# coding: utf-8
#$ header class Parallel(public, with, openmp)
#$ header method __init__(Parallel, str, str, str [:], str [:], str [:], str [:], str, str [:], str)
#$ header method __del__(Parallel)
#$ header method __enter__(Parallel)
#$ header method __exit__(Parallel, str, str, str)
class Parallel(object):
def __init__(self, num_threads, if_test,
private, firstprivate, shared,
reduction, default,
copyin, proc_bind):
self._num_threads = num_threads
self._if_test = if_test
self._private = private
self._firstprivate = firstprivate
self._shared = shared
self._reduction = reduction
self._default = default
self._copyin = copyin
self._proc_bind = proc_bind
def __del__(self):
pass
def __enter__(self):
pass
def __exit__(self, dtype, value, tb):
pass
x = 0.0
para = Parallel()
with para:
for i in range(10):
x += 2 * i
print('x = ', x)
| class Parallel(object):
def __init__(self, num_threads, if_test, private, firstprivate, shared, reduction, default, copyin, proc_bind):
self._num_threads = num_threads
self._if_test = if_test
self._private = private
self._firstprivate = firstprivate
self._shared = shared
self._reduction = reduction
self._default = default
self._copyin = copyin
self._proc_bind = proc_bind
def __del__(self):
pass
def __enter__(self):
pass
def __exit__(self, dtype, value, tb):
pass
x = 0.0
para = parallel()
with para:
for i in range(10):
x += 2 * i
print('x = ', x) |
class MyMetaClass(type):
def __new__(cls, name, bases, ns):
ns['kw_created_by_metaclass'] = lambda self, arg: arg.upper()
return type.__new__(cls, name, bases, ns)
def method_in_metaclass(cls):
pass
class MetaClassLibrary(metaclass=MyMetaClass):
def greet(self, name):
return 'Hello %s!' % name
| class Mymetaclass(type):
def __new__(cls, name, bases, ns):
ns['kw_created_by_metaclass'] = lambda self, arg: arg.upper()
return type.__new__(cls, name, bases, ns)
def method_in_metaclass(cls):
pass
class Metaclasslibrary(metaclass=MyMetaClass):
def greet(self, name):
return 'Hello %s!' % name |
lower_camel_case = input()
snake_case = ""
for char in lower_camel_case:
if char.isupper():
snake_case += "_" + char.lower()
else:
snake_case += char
print(snake_case)
| lower_camel_case = input()
snake_case = ''
for char in lower_camel_case:
if char.isupper():
snake_case += '_' + char.lower()
else:
snake_case += char
print(snake_case) |
class MIFARE1k(object):
SECTORS = 16
BLOCKSIZE = 4
BLOCKWITH = 16
def __init__(self, uid, data):
self.uid = uid
self.data = data
def __str__(self):
"""
Get a nice printout for debugging and dev.
"""
ret = "Card: "
for i in range(4):
if i > 0:
ret = ret + ":"
ret = ret + format(self.uid[i], '02x').upper()
ret = ret + "\n"
for sector in range(self.SECTORS):
ret = ret + "------------------------Sector " + str(sector)
if sector < 10:
ret = ret + "-"
ret = ret + "------------------------\n"
for b in range(self.BLOCKSIZE):
block = b + self.BLOCKSIZE * sector
ret = ret + "Block " + str(block)
if (block) < 10:
ret = ret + " "
for i in range(self.BLOCKWITH):
pos = i + block * self.BLOCKWITH
he = "0x" + format(self.data[pos], '02x').upper()
ret = ret + " " + he
ret = ret + " "
for i in range(self.BLOCKWITH):
pos = i + block * self.BLOCKWITH
a = "."
if self.data[pos] > 0:
a = chr(self.data[pos])
ret = ret + a
ret = ret + "\n"
return ret
def get_data(self):
"""
Userdata is Sector 1 til 16, and only the first 3 blocks.
"""
ret = []
for sector in range(1, self.SECTORS):
for b in range(self.BLOCKSIZE - 1):
block = b + self.BLOCKSIZE * sector
for i in range(self.BLOCKWITH):
pos = i + block * self.BLOCKWITH
ret.append(self.data[pos])
return ret
def get_messages(self):
"""
give back all data blocks inside a TLV Messageblock:
0x03 0x00-0xFE => 1 byte for message length
0x03 0xFF 0x0000-0xFFFE => 2 bytes for message length
0xFE => Terminator
0x00 => Ignore
0xFD => Proprietary TLV => Ignore / To Implement
"""
ret = []
data = self.get_data()
buf = []
T = 0x00 # Store the current tag field
L = 0x00 # Store the length 1 byte format
L2 = 0x00 # Store the length 3 bytes format, temp value (MSB)
Lc = 0 # current length
for val in data:
if T == 0x03:
if L == 0x00:
L = val
continue
if L == 0xFF:
if L2 == 0x00:
L2 = val << 8
continue
else:
L = L2 + val
L2 = 0x00
continue
# length is set:
if Lc < L:
buf.append(val)
Lc = Lc + 1
continue
if Lc == L:
if not val == 0xFE:
print("Error: Length and Terminator did not fit!")
ret.append(buf)
buf = []
Lc = 0x00
L = 0x00
T = val
continue
T = val # should be 0x00 or 0x03, we only care if it is 0x03 for the next val.
return ret
def __eq__(self, other):
if other == None:
return False
return self.uid == other.uid and self.data == other.data
| class Mifare1K(object):
sectors = 16
blocksize = 4
blockwith = 16
def __init__(self, uid, data):
self.uid = uid
self.data = data
def __str__(self):
"""
Get a nice printout for debugging and dev.
"""
ret = 'Card: '
for i in range(4):
if i > 0:
ret = ret + ':'
ret = ret + format(self.uid[i], '02x').upper()
ret = ret + '\n'
for sector in range(self.SECTORS):
ret = ret + '------------------------Sector ' + str(sector)
if sector < 10:
ret = ret + '-'
ret = ret + '------------------------\n'
for b in range(self.BLOCKSIZE):
block = b + self.BLOCKSIZE * sector
ret = ret + 'Block ' + str(block)
if block < 10:
ret = ret + ' '
for i in range(self.BLOCKWITH):
pos = i + block * self.BLOCKWITH
he = '0x' + format(self.data[pos], '02x').upper()
ret = ret + ' ' + he
ret = ret + ' '
for i in range(self.BLOCKWITH):
pos = i + block * self.BLOCKWITH
a = '.'
if self.data[pos] > 0:
a = chr(self.data[pos])
ret = ret + a
ret = ret + '\n'
return ret
def get_data(self):
"""
Userdata is Sector 1 til 16, and only the first 3 blocks.
"""
ret = []
for sector in range(1, self.SECTORS):
for b in range(self.BLOCKSIZE - 1):
block = b + self.BLOCKSIZE * sector
for i in range(self.BLOCKWITH):
pos = i + block * self.BLOCKWITH
ret.append(self.data[pos])
return ret
def get_messages(self):
"""
give back all data blocks inside a TLV Messageblock:
0x03 0x00-0xFE => 1 byte for message length
0x03 0xFF 0x0000-0xFFFE => 2 bytes for message length
0xFE => Terminator
0x00 => Ignore
0xFD => Proprietary TLV => Ignore / To Implement
"""
ret = []
data = self.get_data()
buf = []
t = 0
l = 0
l2 = 0
lc = 0
for val in data:
if T == 3:
if L == 0:
l = val
continue
if L == 255:
if L2 == 0:
l2 = val << 8
continue
else:
l = L2 + val
l2 = 0
continue
if Lc < L:
buf.append(val)
lc = Lc + 1
continue
if Lc == L:
if not val == 254:
print('Error: Length and Terminator did not fit!')
ret.append(buf)
buf = []
lc = 0
l = 0
t = val
continue
t = val
return ret
def __eq__(self, other):
if other == None:
return False
return self.uid == other.uid and self.data == other.data |
#wap to find the numbers which are divisible by 3
a=int(input('Enter starting range '))
b=int(input('Enter ending range '))
number=int(input('Enter the number whose multiples you want to find in the range '))
print('Numbers which are divisible')
for i in range(a,b+1):
if i%number==0:
print(i,end=' ') | a = int(input('Enter starting range '))
b = int(input('Enter ending range '))
number = int(input('Enter the number whose multiples you want to find in the range '))
print('Numbers which are divisible')
for i in range(a, b + 1):
if i % number == 0:
print(i, end=' ') |
ENTRY_POINT = 'get_closest_vowel'
#[PROMPT]
def get_closest_vowel(word):
"""You are given a word. Your task is to find the closest vowel that stands between
two consonants from the right side of the word (case sensitive).
Vowels in the beginning and ending doesn't count. Return empty string if you didn't
find any vowel met the above condition.
You may assume that the given string contains English letter only.
Example:
get_closest_vowel("yogurt") ==> "u"
get_closest_vowel("FULL") ==> "U"
get_closest_vowel("quick") ==> ""
get_closest_vowel("ab") ==> ""
"""
#[SOLUTION]
if len(word) < 3:
return ""
vowels = {"a", "e", "i", "o", "u", "A", "E", 'O', 'U', 'I'}
for i in range(len(word)-2, 0, -1):
if word[i] in vowels:
if (word[i+1] not in vowels) and (word[i-1] not in vowels):
return word[i]
return ""
#[CHECK]
def check(candidate):
# Check some simple cases
assert candidate("yogurt") == "u"
assert candidate("full") == "u"
assert candidate("easy") == ""
assert candidate("eAsy") == ""
assert candidate("ali") == ""
assert candidate("bad") == "a"
assert candidate("most") == "o"
assert candidate("ab") == ""
assert candidate("ba") == ""
assert candidate("quick") == ""
assert candidate("anime") == "i"
assert candidate("Asia") == ""
assert candidate("anime") == "i"
assert candidate("Above") == "o"
# Check some edge cases that are easy to work out by hand.
assert True
| entry_point = 'get_closest_vowel'
def get_closest_vowel(word):
"""You are given a word. Your task is to find the closest vowel that stands between
two consonants from the right side of the word (case sensitive).
Vowels in the beginning and ending doesn't count. Return empty string if you didn't
find any vowel met the above condition.
You may assume that the given string contains English letter only.
Example:
get_closest_vowel("yogurt") ==> "u"
get_closest_vowel("FULL") ==> "U"
get_closest_vowel("quick") ==> ""
get_closest_vowel("ab") ==> ""
"""
if len(word) < 3:
return ''
vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'O', 'U', 'I'}
for i in range(len(word) - 2, 0, -1):
if word[i] in vowels:
if word[i + 1] not in vowels and word[i - 1] not in vowels:
return word[i]
return ''
def check(candidate):
assert candidate('yogurt') == 'u'
assert candidate('full') == 'u'
assert candidate('easy') == ''
assert candidate('eAsy') == ''
assert candidate('ali') == ''
assert candidate('bad') == 'a'
assert candidate('most') == 'o'
assert candidate('ab') == ''
assert candidate('ba') == ''
assert candidate('quick') == ''
assert candidate('anime') == 'i'
assert candidate('Asia') == ''
assert candidate('anime') == 'i'
assert candidate('Above') == 'o'
assert True |
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
''' 92.22% // 75.79% '''
def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode:
slow = fast = head
{(fast := fast.next) for _ in range(n)}
if fast is None:
return head.next
while fast.next:
fast, slow = fast.next, slow.next
slow.next = slow.next.next
return head
| class Listnode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
""" 92.22% // 75.79% """
def remove_nth_from_end(self, head: ListNode, n: int) -> ListNode:
slow = fast = head
{(fast := fast.next) for _ in range(n)}
if fast is None:
return head.next
while fast.next:
(fast, slow) = (fast.next, slow.next)
slow.next = slow.next.next
return head |
q = int(input())
for _ in range(q):
n, m = map(int, input().split())
d = n // m
a = [0] * 10
for i in range(10):
a[i] = (m + a[i - 1]) % 10
s = sum(a)
print((d // 10) * s + sum(a[: (d % 10)]))
| q = int(input())
for _ in range(q):
(n, m) = map(int, input().split())
d = n // m
a = [0] * 10
for i in range(10):
a[i] = (m + a[i - 1]) % 10
s = sum(a)
print(d // 10 * s + sum(a[:d % 10])) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Pieter Huycke
email: pieter.huycke@ugent.be
GitHub: phuycke
"""
#%%
area = 8080464.3 # area of 48 contiguous states in km^2
volume = 22810 # volume of water in Great lakes in km^3
height = (volume / area) # km^3 / km^2 = m
print('Kilometres water on surface if evenly spread: {0:.5f}'.format(height))
print('Metres water on surface if evenly spread: {0:.5f}'.format(height * 1000))
| """
@author: Pieter Huycke
email: pieter.huycke@ugent.be
GitHub: phuycke
"""
area = 8080464.3
volume = 22810
height = volume / area
print('Kilometres water on surface if evenly spread: {0:.5f}'.format(height))
print('Metres water on surface if evenly spread: {0:.5f}'.format(height * 1000)) |
__author__ = 'shukkkur'
'''
https://codeforces.com/problemset/problem/110/A
'''
i = input()
n = i.count('4') + i.count('7')
s = str(n)
s = s.replace('4', '')
s = s.replace('7', '')
if s == '':
print('YES')
else:
print('NO')
| __author__ = 'shukkkur'
'\nhttps://codeforces.com/problemset/problem/110/A\n'
i = input()
n = i.count('4') + i.count('7')
s = str(n)
s = s.replace('4', '')
s = s.replace('7', '')
if s == '':
print('YES')
else:
print('NO') |
"""
A package of Python modules, used to configure and test IBIS-AMI models.
.. moduleauthor:: David Banas <capn.freako@gmail.com>
Original Author: David Banas <capn.freako@gmail.com>
Original Date: 3 July 2012
Copyright (c) 2012 by David Banas; All rights reserved World wide.
"""
| """
A package of Python modules, used to configure and test IBIS-AMI models.
.. moduleauthor:: David Banas <capn.freako@gmail.com>
Original Author: David Banas <capn.freako@gmail.com>
Original Date: 3 July 2012
Copyright (c) 2012 by David Banas; All rights reserved World wide.
""" |
PYTHON_PLATFORM = "python"
SUPPORTED_PLATFORMS = ((PYTHON_PLATFORM, "Python"),)
LOG_LEVEL_DEBUG = "debug"
LOG_LEVEL_INFO = "info"
LOG_LEVEL_ERROR = "error"
LOG_LEVEL_FATAL = "fatal"
LOG_LEVEL_SAMPLE = "sample"
LOG_LEVEL_WARNING = "warning"
LOG_LEVELS = (
(LOG_LEVEL_DEBUG, "Debug"),
(LOG_LEVEL_INFO, "Info"),
(LOG_LEVEL_ERROR, "Error"),
(LOG_LEVEL_FATAL, "Fatal"),
(LOG_LEVEL_SAMPLE, "Sample"),
(LOG_LEVEL_WARNING, "Warning"),
)
| python_platform = 'python'
supported_platforms = ((PYTHON_PLATFORM, 'Python'),)
log_level_debug = 'debug'
log_level_info = 'info'
log_level_error = 'error'
log_level_fatal = 'fatal'
log_level_sample = 'sample'
log_level_warning = 'warning'
log_levels = ((LOG_LEVEL_DEBUG, 'Debug'), (LOG_LEVEL_INFO, 'Info'), (LOG_LEVEL_ERROR, 'Error'), (LOG_LEVEL_FATAL, 'Fatal'), (LOG_LEVEL_SAMPLE, 'Sample'), (LOG_LEVEL_WARNING, 'Warning')) |
"""
Addition I - Numbers & Strings
"""
# Add the below sets of variables together without causing any Type Errors.
# A)
a = 0
b = 2
print(a + b) # 2
# B)
c = '0'
d = '2'
print(c + d) # '2'
# C)
e = '0'
f = 2
print(int(e) + f) # 2 | """
Addition I - Numbers & Strings
"""
a = 0
b = 2
print(a + b)
c = '0'
d = '2'
print(c + d)
e = '0'
f = 2
print(int(e) + f) |
# Copyright 2017 The Bazel 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 applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Helper functions to expand paths into runfiles
"""
def expand_location_into_runfiles(ctx, path):
"""Expand a path into runfiles if it contains a $(location).
If the path has a location expansion, expand it. Otherwise return as-is.
Args:
ctx: context
path: the path to expand
Returns:
The expanded path or the original path
"""
if path.find("$(location") < 0:
return path
return expand_path_into_runfiles(ctx, path)
def expand_path_into_runfiles(ctx, path):
"""Expand a path into runfiles.
Given a file path that might contain a $(location) label expansion,
provide the path to the file in runfiles.
See https://docs.bazel.build/versions/master/skylark/lib/ctx.html#expand_location
Args:
ctx: context
path: the path to expand
Returns:
The expanded path
"""
targets = ctx.attr.data if hasattr(ctx.attr, "data") else []
expanded = ctx.expand_location(path, targets)
if expanded.startswith("../"):
return expanded[len("../"):]
if expanded.startswith(ctx.bin_dir.path):
expanded = expanded[len(ctx.bin_dir.path + "/"):]
if expanded.startswith(ctx.genfiles_dir.path):
expanded = expanded[len(ctx.genfiles_dir.path + "/"):]
return ctx.workspace_name + "/" + expanded
| """Helper functions to expand paths into runfiles
"""
def expand_location_into_runfiles(ctx, path):
"""Expand a path into runfiles if it contains a $(location).
If the path has a location expansion, expand it. Otherwise return as-is.
Args:
ctx: context
path: the path to expand
Returns:
The expanded path or the original path
"""
if path.find('$(location') < 0:
return path
return expand_path_into_runfiles(ctx, path)
def expand_path_into_runfiles(ctx, path):
"""Expand a path into runfiles.
Given a file path that might contain a $(location) label expansion,
provide the path to the file in runfiles.
See https://docs.bazel.build/versions/master/skylark/lib/ctx.html#expand_location
Args:
ctx: context
path: the path to expand
Returns:
The expanded path
"""
targets = ctx.attr.data if hasattr(ctx.attr, 'data') else []
expanded = ctx.expand_location(path, targets)
if expanded.startswith('../'):
return expanded[len('../'):]
if expanded.startswith(ctx.bin_dir.path):
expanded = expanded[len(ctx.bin_dir.path + '/'):]
if expanded.startswith(ctx.genfiles_dir.path):
expanded = expanded[len(ctx.genfiles_dir.path + '/'):]
return ctx.workspace_name + '/' + expanded |
"""
Illustrates how to embed
`dogpile.cache <https://dogpilecache.readthedocs.io/>`_
functionality within the :class:`.Query` object, allowing full cache control
as well as the ability to pull "lazy loaded" attributes from long term cache.
In this demo, the following techniques are illustrated:
* Using custom subclasses of :class:`.Query`
* Basic technique of circumventing Query to pull from a
custom cache source instead of the database.
* Rudimental caching with dogpile.cache, using "regions" which allow
global control over a fixed set of configurations.
* Using custom :class:`.MapperOption` objects to configure options on
a Query, including the ability to invoke the options
deep within an object graph when lazy loads occur.
E.g.::
# query for Person objects, specifying cache
q = Session.query(Person).options(FromCache("default"))
# specify that each Person's "addresses" collection comes from
# cache too
q = q.options(RelationshipCache(Person.addresses, "default"))
# query
print q.all()
To run, both SQLAlchemy and dogpile.cache must be
installed or on the current PYTHONPATH. The demo will create a local
directory for datafiles, insert initial data, and run. Running the
demo a second time will utilize the cache files already present, and
exactly one SQL statement against two tables will be emitted - the
displayed result however will utilize dozens of lazyloads that all
pull from cache.
The demo scripts themselves, in order of complexity, are run as Python
modules so that relative imports work::
python -m examples.dogpile_caching.helloworld
python -m examples.dogpile_caching.relationship_caching
python -m examples.dogpile_caching.advanced
python -m examples.dogpile_caching.local_session_caching
.. autosource::
:files: environment.py, caching_query.py, model.py, fixture_data.py, \
helloworld.py, relationship_caching.py, advanced.py, \
local_session_caching.py
"""
| """
Illustrates how to embed
`dogpile.cache <https://dogpilecache.readthedocs.io/>`_
functionality within the :class:`.Query` object, allowing full cache control
as well as the ability to pull "lazy loaded" attributes from long term cache.
In this demo, the following techniques are illustrated:
* Using custom subclasses of :class:`.Query`
* Basic technique of circumventing Query to pull from a
custom cache source instead of the database.
* Rudimental caching with dogpile.cache, using "regions" which allow
global control over a fixed set of configurations.
* Using custom :class:`.MapperOption` objects to configure options on
a Query, including the ability to invoke the options
deep within an object graph when lazy loads occur.
E.g.::
# query for Person objects, specifying cache
q = Session.query(Person).options(FromCache("default"))
# specify that each Person's "addresses" collection comes from
# cache too
q = q.options(RelationshipCache(Person.addresses, "default"))
# query
print q.all()
To run, both SQLAlchemy and dogpile.cache must be
installed or on the current PYTHONPATH. The demo will create a local
directory for datafiles, insert initial data, and run. Running the
demo a second time will utilize the cache files already present, and
exactly one SQL statement against two tables will be emitted - the
displayed result however will utilize dozens of lazyloads that all
pull from cache.
The demo scripts themselves, in order of complexity, are run as Python
modules so that relative imports work::
python -m examples.dogpile_caching.helloworld
python -m examples.dogpile_caching.relationship_caching
python -m examples.dogpile_caching.advanced
python -m examples.dogpile_caching.local_session_caching
.. autosource::
:files: environment.py, caching_query.py, model.py, fixture_data.py, helloworld.py, relationship_caching.py, advanced.py, local_session_caching.py
""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.