content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
RESOURCES = {
'posts': {
'schema': {
'title': {
'type': 'string',
'minlength': 3,
'maxlength': 30,
'required': True,
'unique': False
},
'body': {
'type': 'string',
'required': True,
'unique': True
},
'published': {
'type': 'boolean',
'default': False
},
'category': {
'type': 'objectid',
'data_relation': {
'resource': 'categories',
'field': '_id',
'embeddable': True
},
'required': True
},
'tags': {
'type': 'list',
'default': [],
'schema': {
'type': 'objectid',
'data_relation': {
'resource': 'tags',
'field': '_id',
'embeddable': True
}
}
}
},
},
'categories': {
'schema': {
'name': {
'type': 'string',
'minlength': 2,
'maxlength': 10,
'required': True,
'unique': True
}
},
'item_title': 'category',
},
'tags': {
'schema': {
'name': {
'type': 'string',
'minlength': 2,
'maxlength': 10,
'required': True,
'unique': True
}
}
}
}
| resources = {'posts': {'schema': {'title': {'type': 'string', 'minlength': 3, 'maxlength': 30, 'required': True, 'unique': False}, 'body': {'type': 'string', 'required': True, 'unique': True}, 'published': {'type': 'boolean', 'default': False}, 'category': {'type': 'objectid', 'data_relation': {'resource': 'categories', 'field': '_id', 'embeddable': True}, 'required': True}, 'tags': {'type': 'list', 'default': [], 'schema': {'type': 'objectid', 'data_relation': {'resource': 'tags', 'field': '_id', 'embeddable': True}}}}}, 'categories': {'schema': {'name': {'type': 'string', 'minlength': 2, 'maxlength': 10, 'required': True, 'unique': True}}, 'item_title': 'category'}, 'tags': {'schema': {'name': {'type': 'string', 'minlength': 2, 'maxlength': 10, 'required': True, 'unique': True}}}} |
pkgname = "python-sphinx-removed-in"
pkgver = "0.2.1"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools"]
checkdepends = ["python-sphinx"]
depends = ["python-sphinx"]
pkgdesc = "Sphinx extension for versionremoved and removed-in directives"
maintainer = "q66 <[email protected]>"
license = "BSD-3-Clause"
url = "https://github.com/MrSenko/sphinx-removed-in"
source = f"$(PYPI_SITE)/s/sphinx-removed-in/sphinx-removed-in-{pkgver}.tar.gz"
sha256 = "0588239cb534cd97b1d3900d0444311c119e45296a9f73f1ea81ea81a2cd3db1"
# dependency of pytest
options = ["!check"]
| pkgname = 'python-sphinx-removed-in'
pkgver = '0.2.1'
pkgrel = 0
build_style = 'python_module'
hostmakedepends = ['python-setuptools']
checkdepends = ['python-sphinx']
depends = ['python-sphinx']
pkgdesc = 'Sphinx extension for versionremoved and removed-in directives'
maintainer = 'q66 <[email protected]>'
license = 'BSD-3-Clause'
url = 'https://github.com/MrSenko/sphinx-removed-in'
source = f'$(PYPI_SITE)/s/sphinx-removed-in/sphinx-removed-in-{pkgver}.tar.gz'
sha256 = '0588239cb534cd97b1d3900d0444311c119e45296a9f73f1ea81ea81a2cd3db1'
options = ['!check'] |
class Solution:
def canPartition(self, nums: List[int]) -> bool:
dp, s = set([0]), sum(nums)
if s&1:
return False
for num in nums:
dp.update([v+num for v in dp if v+num <= s>>1])
return s>>1 in dp
| class Solution:
def can_partition(self, nums: List[int]) -> bool:
(dp, s) = (set([0]), sum(nums))
if s & 1:
return False
for num in nums:
dp.update([v + num for v in dp if v + num <= s >> 1])
return s >> 1 in dp |
class Solution:
def sortLinkedList(self, head: Optional[ListNode]) -> Optional[ListNode]:
prev = head
curr = head.next
while curr:
if curr.val < 0:
prev.next = curr.next
curr.next = head
head = curr
curr = prev.next
else:
prev = curr
curr = curr.next
return head
| class Solution:
def sort_linked_list(self, head: Optional[ListNode]) -> Optional[ListNode]:
prev = head
curr = head.next
while curr:
if curr.val < 0:
prev.next = curr.next
curr.next = head
head = curr
curr = prev.next
else:
prev = curr
curr = curr.next
return head |
class Pessoa: #substantivo
def __init__(self, nome: str, idade: int) -> None:
self.nome = nome #substantivo
self.idade = idade #substantivo
def dirigir(self, veiculo: str) -> None: #verbos
print(f'Dirigindo um(a) {veiculo}')
def cantar(self) -> None: #verbos
print('lalalala')
def apresentar_idade(self) -> int: #verbos
return self.idade
| class Pessoa:
def __init__(self, nome: str, idade: int) -> None:
self.nome = nome
self.idade = idade
def dirigir(self, veiculo: str) -> None:
print(f'Dirigindo um(a) {veiculo}')
def cantar(self) -> None:
print('lalalala')
def apresentar_idade(self) -> int:
return self.idade |
API_GROUPS = {
'authentication': ['/api-auth/', '/api/auth-valimo/',],
'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],
'organization': [
'/api/customers/',
'/api/customer-permissions-log/',
'/api/customer-permissions-reviews/',
'/api/customer-permissions/',
],
'marketplace': [
'/api/marketplace-bookings/',
'/api/marketplace-cart-items/',
'/api/marketplace-categories/',
'/api/marketplace-category-component-usages/',
'/api/marketplace-checklists-categories/',
'/api/marketplace-checklists/',
'/api/marketplace-component-usages/',
'/api/marketplace-offering-files/',
'/api/marketplace-offerings/',
'/api/marketplace-order-items/',
'/api/marketplace-orders/',
'/api/marketplace-plans/',
'/api/marketplace-plugins/',
'/api/marketplace-public-api/',
'/api/marketplace-resource-offerings/',
'/api/marketplace-resources/',
'/api/marketplace-screenshots/',
'/api/marketplace-service-providers/',
],
'reporting': [
'/api/support-feedback-average-report/',
'/api/support-feedback-report/',
],
}
| api_groups = {'authentication': ['/api-auth/', '/api/auth-valimo/'], 'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/'], 'organization': ['/api/customers/', '/api/customer-permissions-log/', '/api/customer-permissions-reviews/', '/api/customer-permissions/'], 'marketplace': ['/api/marketplace-bookings/', '/api/marketplace-cart-items/', '/api/marketplace-categories/', '/api/marketplace-category-component-usages/', '/api/marketplace-checklists-categories/', '/api/marketplace-checklists/', '/api/marketplace-component-usages/', '/api/marketplace-offering-files/', '/api/marketplace-offerings/', '/api/marketplace-order-items/', '/api/marketplace-orders/', '/api/marketplace-plans/', '/api/marketplace-plugins/', '/api/marketplace-public-api/', '/api/marketplace-resource-offerings/', '/api/marketplace-resources/', '/api/marketplace-screenshots/', '/api/marketplace-service-providers/'], 'reporting': ['/api/support-feedback-average-report/', '/api/support-feedback-report/']} |
df = pd.read_csv(DATA)
df = df.sample(frac=1.0)
df.reset_index(drop=True, inplace=True)
result = df.tail(n=10)
| df = pd.read_csv(DATA)
df = df.sample(frac=1.0)
df.reset_index(drop=True, inplace=True)
result = df.tail(n=10) |
def to_binary(number):
binarynumber=""
if (number!=0):
while (number>=1):
if (number %2==0):
binarynumber=binarynumber+"0"
number=number/2
else:
binarynumber=binarynumber+"1"
number=(number-1)/2
else:
binarynumber="0"
return "".join(reversed(binarynumber))
if __name__ == '__main__':
print(to_binary(35))
print("\n")
print(bin(35)) | def to_binary(number):
binarynumber = ''
if number != 0:
while number >= 1:
if number % 2 == 0:
binarynumber = binarynumber + '0'
number = number / 2
else:
binarynumber = binarynumber + '1'
number = (number - 1) / 2
else:
binarynumber = '0'
return ''.join(reversed(binarynumber))
if __name__ == '__main__':
print(to_binary(35))
print('\n')
print(bin(35)) |
x = 5
y = 3
z = x + y
print(x)
print(y)
print(x + y)
print(z)
w = z
print(w) | x = 5
y = 3
z = x + y
print(x)
print(y)
print(x + y)
print(z)
w = z
print(w) |
#Calculadora de tabuada
n = int(input('Deseja ver tabuada de que numero?'))
for c in range(1, 13):
print('{} X {:2}= {} '. format(n, c, n * c))
| n = int(input('Deseja ver tabuada de que numero?'))
for c in range(1, 13):
print('{} X {:2}= {} '.format(n, c, n * c)) |
COLUMNS = [
'tipo_registro',
'nro_pv_matriz',
'vl_total_bruto',
'qtde_cvnsu',
'vl_total_rejeitado',
'vl_total_rotativo',
'vl_total_parcelado_sem_juros',
'vl_total_parcelado_iata',
'vl_total_dolar',
'vl_total_desconto',
'vl_total_liquido',
'vl_total_gorjeta',
'vl_total_tx_embarque',
'qtde_cvnsu_acatados'
] | columns = ['tipo_registro', 'nro_pv_matriz', 'vl_total_bruto', 'qtde_cvnsu', 'vl_total_rejeitado', 'vl_total_rotativo', 'vl_total_parcelado_sem_juros', 'vl_total_parcelado_iata', 'vl_total_dolar', 'vl_total_desconto', 'vl_total_liquido', 'vl_total_gorjeta', 'vl_total_tx_embarque', 'qtde_cvnsu_acatados'] |
# Ask user to enter their country name.
# print out their phone code.
l_country_phone_code = ["China","86","Germany","49","Turkey","90"]
def country_name_to_phone_code_list(country_name):
for index in range(len(l_country_phone_code)):
if l_country_phone_code[index] == country_name:
return l_country_phone_code[index+1]
def country_name_to_phone_code_dict(country_name):
pass
print(country_name_to_phone_code_list("Turkey"))
print(country_name_to_phone_code_list("Germany"))
print(country_name_to_phone_code_list("China")) | l_country_phone_code = ['China', '86', 'Germany', '49', 'Turkey', '90']
def country_name_to_phone_code_list(country_name):
for index in range(len(l_country_phone_code)):
if l_country_phone_code[index] == country_name:
return l_country_phone_code[index + 1]
def country_name_to_phone_code_dict(country_name):
pass
print(country_name_to_phone_code_list('Turkey'))
print(country_name_to_phone_code_list('Germany'))
print(country_name_to_phone_code_list('China')) |
def palavras_repetidas(fileName, word):
file = open(fileName, 'r')
count = 0
for i in file.readlines():
if word in i:
count += 1
print(f'{word} aparece no arquivo {fileName} {count} vez(es).') | def palavras_repetidas(fileName, word):
file = open(fileName, 'r')
count = 0
for i in file.readlines():
if word in i:
count += 1
print(f'{word} aparece no arquivo {fileName} {count} vez(es).') |
n = int(input())
x = 0
for i in range(n):
l = set([j for j in input()])
if "+" in l:
x += 1
else :
x -= 1
print(x)
| n = int(input())
x = 0
for i in range(n):
l = set([j for j in input()])
if '+' in l:
x += 1
else:
x -= 1
print(x) |
client = pymongo.MongoClient("mongodb+srv://usermgs:[email protected]/baseteste?retryWrites=true&w=majority")
db = client.test
| client = pymongo.MongoClient('mongodb+srv://usermgs:[email protected]/baseteste?retryWrites=true&w=majority')
db = client.test |
class Mammal:
x = 10
def walk(self):
print("Walking")
# class Dog:
# def walk(self):
# print("Walking")
# class Cat:
# def walk(self):
# print("Walking")
class Dog(Mammal):
def bark(self):
print("Woof, woof!")
class Cat(Mammal):
pass # Just used here as Python does not like empty classes. Pass just passes...
rover = Dog()
print(rover.x)
rover.bark()
fluffy = Cat()
fluffy.walk()
| class Mammal:
x = 10
def walk(self):
print('Walking')
class Dog(Mammal):
def bark(self):
print('Woof, woof!')
class Cat(Mammal):
pass
rover = dog()
print(rover.x)
rover.bark()
fluffy = cat()
fluffy.walk() |
#
# @lc app=leetcode.cn id=1203 lang=python3
#
# [1203] print-in-order
#
None
# @lc code=end | None |
def check_hgt(h):
if "cm" in h:
return 150 <= int(h.replace("cm","")) <= 193
elif "in" in h:
return 59 <= int(h.replace("in","")) <= 76
else:
return False
def check_hcl(h):
if h[0] != '#' or len(h) != 7:
return False
for x in h[1:]:
if not x in list("abcdef0123456789"):
return False
return True
def check_range(v, low, high):
return low <= int(v) <= high
validation = {
"hgt": check_hgt,
"hcl": check_hcl,
"pid": lambda x: len(x) == 9,
"byr": lambda x: check_range(x, 1920, 2002),
"iyr": lambda x: check_range(x, 2010, 2020),
"eyr": lambda x: check_range(x, 2020, 2030),
"ecl": lambda x: x in ["amb","blu","brn","gry", "grn", "hzl", "oth"],
"cid": lambda x: True
}
def validate_passport(p):
return len(p) == 8 or (len(p) == 7 and not p.get("cid", None))
#with open("test.txt", "rt") as file:
with open("day4.txt", "rt") as file:
valid = 0
valid2 = 0
passport = {}
passport2 = {}
for l in file.read().splitlines():
if l.strip() == "":
valid += validate_passport(passport)
valid2 += validate_passport(passport2)
passport = {}
passport2 = {}
else:
for x in l.strip().split(' '):
p = x.split(":")
passport[p[0]] = p[1]
if (validation[p[0]](p[1])):
passport2[p[0]] = p[1]
valid += validate_passport(passport)
valid2 += validate_passport(passport2)
print (valid)
print (valid2)
| def check_hgt(h):
if 'cm' in h:
return 150 <= int(h.replace('cm', '')) <= 193
elif 'in' in h:
return 59 <= int(h.replace('in', '')) <= 76
else:
return False
def check_hcl(h):
if h[0] != '#' or len(h) != 7:
return False
for x in h[1:]:
if not x in list('abcdef0123456789'):
return False
return True
def check_range(v, low, high):
return low <= int(v) <= high
validation = {'hgt': check_hgt, 'hcl': check_hcl, 'pid': lambda x: len(x) == 9, 'byr': lambda x: check_range(x, 1920, 2002), 'iyr': lambda x: check_range(x, 2010, 2020), 'eyr': lambda x: check_range(x, 2020, 2030), 'ecl': lambda x: x in ['amb', 'blu', 'brn', 'gry', 'grn', 'hzl', 'oth'], 'cid': lambda x: True}
def validate_passport(p):
return len(p) == 8 or (len(p) == 7 and (not p.get('cid', None)))
with open('day4.txt', 'rt') as file:
valid = 0
valid2 = 0
passport = {}
passport2 = {}
for l in file.read().splitlines():
if l.strip() == '':
valid += validate_passport(passport)
valid2 += validate_passport(passport2)
passport = {}
passport2 = {}
else:
for x in l.strip().split(' '):
p = x.split(':')
passport[p[0]] = p[1]
if validation[p[0]](p[1]):
passport2[p[0]] = p[1]
valid += validate_passport(passport)
valid2 += validate_passport(passport2)
print(valid)
print(valid2) |
def test_deploying_contract(client, hex_accounts):
pre_balance = client.get_balance(hex_accounts[1])
client.send_transaction(
_from=hex_accounts[0],
to=hex_accounts[1],
value=1234,
)
post_balance = client.get_balance(hex_accounts[1])
assert post_balance - pre_balance == 1234
| def test_deploying_contract(client, hex_accounts):
pre_balance = client.get_balance(hex_accounts[1])
client.send_transaction(_from=hex_accounts[0], to=hex_accounts[1], value=1234)
post_balance = client.get_balance(hex_accounts[1])
assert post_balance - pre_balance == 1234 |
if __name__ == '__main__':
_, X = input().split()
subjects = list()
for _ in range(int(X)):
subjects.append(map(float, input().split()))
for i in zip(*subjects):
print("{0:.1f}".format(sum(i)/len(i)))
| if __name__ == '__main__':
(_, x) = input().split()
subjects = list()
for _ in range(int(X)):
subjects.append(map(float, input().split()))
for i in zip(*subjects):
print('{0:.1f}'.format(sum(i) / len(i))) |
promt = "Here you can enter"
promt += "a series of toppings>>>"
message = True
while message:
message = input(promt)
if message == "Quit":
print(" I'll add " + message + " to your pizza.")
else:
break
promt = "How old are you?"
promt += "\nEnter 'quit' when you are finished >>>"
while True:
age = input(promt)
if age == "quit":
break
age = int(age)
if age < 3:
print("Your ticket cost is free")
elif age < 13:
print("Your ticket price is 10 $ ")
else:
print("Your ticket price is 15 $")
sandwich_orders = ["hamburger","cheeseburger","veggie burger", "royal"]
finished_sandwiches = []
while sandwich_orders:
sandwich = sandwich_orders.pop()
print("we are working on "+ sandwich + " at the moment")
finished_sandwiches.append(sandwich)
print("\n")
for sandwich in finished_sandwiches:
print("We have made " + sandwich + ", you can take it now")
sandwich_orders = ["pastrami","hamburger","cheeseburger","pastrami","veggie burger", "royal","pastrami"]
finished_sandwiches = []
print("We are sorry, pastrami sandwich ran out of")
while "pastrami" in sandwich_orders:
sandwich_orders.remove("pastrami")
print("\n")
while sandwich_orders:
sandwich = sandwich_orders.pop()
print("Your order "+ sandwich + " will be prepared soon ! ")
finished_sandwiches.append(sandwich)
print("\n")
for sandwich in finished_sandwiches:
print("Your order " + sandwich + " is ready, take it")
#
name_promt = "Whats your name?>>>"
place_promt = "Where would you like to go?>>>"
next_promt = "\nWould you like to go with someone?(yes/no)>>>"
responses = {}
while True:
name = input(name_promt)
place = input(place_promt)
responses[name] = place
other_question = input(next_promt)
if other_question == "yes":
break
print(">>>results<<<")
for name,place in responses.items():
print(name.title() + " would like to go in " + place.title() + ".") | promt = 'Here you can enter'
promt += 'a series of toppings>>>'
message = True
while message:
message = input(promt)
if message == 'Quit':
print(" I'll add " + message + ' to your pizza.')
else:
break
promt = 'How old are you?'
promt += "\nEnter 'quit' when you are finished >>>"
while True:
age = input(promt)
if age == 'quit':
break
age = int(age)
if age < 3:
print('Your ticket cost is free')
elif age < 13:
print('Your ticket price is 10 $ ')
else:
print('Your ticket price is 15 $')
sandwich_orders = ['hamburger', 'cheeseburger', 'veggie burger', 'royal']
finished_sandwiches = []
while sandwich_orders:
sandwich = sandwich_orders.pop()
print('we are working on ' + sandwich + ' at the moment')
finished_sandwiches.append(sandwich)
print('\n')
for sandwich in finished_sandwiches:
print('We have made ' + sandwich + ', you can take it now')
sandwich_orders = ['pastrami', 'hamburger', 'cheeseburger', 'pastrami', 'veggie burger', 'royal', 'pastrami']
finished_sandwiches = []
print('We are sorry, pastrami sandwich ran out of')
while 'pastrami' in sandwich_orders:
sandwich_orders.remove('pastrami')
print('\n')
while sandwich_orders:
sandwich = sandwich_orders.pop()
print('Your order ' + sandwich + ' will be prepared soon ! ')
finished_sandwiches.append(sandwich)
print('\n')
for sandwich in finished_sandwiches:
print('Your order ' + sandwich + ' is ready, take it')
name_promt = 'Whats your name?>>>'
place_promt = 'Where would you like to go?>>>'
next_promt = '\nWould you like to go with someone?(yes/no)>>>'
responses = {}
while True:
name = input(name_promt)
place = input(place_promt)
responses[name] = place
other_question = input(next_promt)
if other_question == 'yes':
break
print('>>>results<<<')
for (name, place) in responses.items():
print(name.title() + ' would like to go in ' + place.title() + '.') |
def foo(a, b):
x = a * b
y = 3
return y
def foo(a, b):
x = __report_assign(7, 8, 3)
x = __report_assign(pos, v, 3)
y = __report_assign(lineno, col, 3)
print("hello world")
foo(3, 2)
report_call(0, 3, foo, (report_eval(3), report_eval(2),))
| def foo(a, b):
x = a * b
y = 3
return y
def foo(a, b):
x = __report_assign(7, 8, 3)
x = __report_assign(pos, v, 3)
y = __report_assign(lineno, col, 3)
print('hello world')
foo(3, 2)
report_call(0, 3, foo, (report_eval(3), report_eval(2))) |
class Solution:
def addBinary(self, a: str, b: str) -> str:
return bin(int(a, 2) + int(b, 2))[2:]
if __name__ == '__main__':
a = "11"
b = "1"
solution = Solution()
result = solution.addBinary(a, b)
print(result)
result1 = int(a, 2)
result2 = int(b, 2)
print(result1)
print(result2)
print(bin(result1 + result2))
print(bin(result1 + result2)[2:])
| class Solution:
def add_binary(self, a: str, b: str) -> str:
return bin(int(a, 2) + int(b, 2))[2:]
if __name__ == '__main__':
a = '11'
b = '1'
solution = solution()
result = solution.addBinary(a, b)
print(result)
result1 = int(a, 2)
result2 = int(b, 2)
print(result1)
print(result2)
print(bin(result1 + result2))
print(bin(result1 + result2)[2:]) |
a=int(input())
b=int(input())
print (a/b)
a=float(a)
b=float(b)
print (a/b) | a = int(input())
b = int(input())
print(a / b)
a = float(a)
b = float(b)
print(a / b) |
def test_Dict():
x: dict[i32, i32]
x = {1: 2, 3: 4}
# x = {1: "2", "3": 4} -> sematic error
y: dict[str, i32]
y = {"a": -1, "b": -2}
z: i32
z = y["a"]
z = y["b"]
z = x[1]
def test_dict_insert():
y: dict[str, i32]
y = {"a": -1, "b": -2}
y["c"] = -3
def test_dict_get():
y: dict[str, i32]
y = {"a": -1, "b": -2}
x: i32
x = y.get("a")
x = y.get("a", 0)
| def test__dict():
x: dict[i32, i32]
x = {1: 2, 3: 4}
y: dict[str, i32]
y = {'a': -1, 'b': -2}
z: i32
z = y['a']
z = y['b']
z = x[1]
def test_dict_insert():
y: dict[str, i32]
y = {'a': -1, 'b': -2}
y['c'] = -3
def test_dict_get():
y: dict[str, i32]
y = {'a': -1, 'b': -2}
x: i32
x = y.get('a')
x = y.get('a', 0) |
states = {'Pending', 'Ready', 'Creating', 'Running', 'Cancelled', 'Error', 'Failed', 'Success'}
complete_states = ('Cancelled', 'Error', 'Failed', 'Success')
valid_state_transitions = {
'Pending': {'Ready'},
'Ready': {'Creating', 'Running', 'Cancelled', 'Error'},
'Creating': {'Ready', 'Running'},
'Running': {'Ready', 'Cancelled', 'Error', 'Failed', 'Success'},
'Cancelled': set(),
'Error': set(),
'Failed': set(),
'Success': set(),
}
tasks = ('input', 'main', 'output')
memory_types = ('lowmem', 'standard', 'highmem')
HTTP_CLIENT_MAX_SIZE = 8 * 1024 * 1024
BATCH_FORMAT_VERSION = 6
STATUS_FORMAT_VERSION = 5
INSTANCE_VERSION = 22
MAX_PERSISTENT_SSD_SIZE_GIB = 64 * 1024
RESERVED_STORAGE_GB_PER_CORE = 5
| states = {'Pending', 'Ready', 'Creating', 'Running', 'Cancelled', 'Error', 'Failed', 'Success'}
complete_states = ('Cancelled', 'Error', 'Failed', 'Success')
valid_state_transitions = {'Pending': {'Ready'}, 'Ready': {'Creating', 'Running', 'Cancelled', 'Error'}, 'Creating': {'Ready', 'Running'}, 'Running': {'Ready', 'Cancelled', 'Error', 'Failed', 'Success'}, 'Cancelled': set(), 'Error': set(), 'Failed': set(), 'Success': set()}
tasks = ('input', 'main', 'output')
memory_types = ('lowmem', 'standard', 'highmem')
http_client_max_size = 8 * 1024 * 1024
batch_format_version = 6
status_format_version = 5
instance_version = 22
max_persistent_ssd_size_gib = 64 * 1024
reserved_storage_gb_per_core = 5 |
def assigned_type_mismatch():
x = 666
x = '666'
return x
def annotation_type_mismatch(x: int = '666'):
return x
def assigned_type_mismatch_between_calls(case):
if case:
x = 666
else:
x = '666'
return x
| def assigned_type_mismatch():
x = 666
x = '666'
return x
def annotation_type_mismatch(x: int='666'):
return x
def assigned_type_mismatch_between_calls(case):
if case:
x = 666
else:
x = '666'
return x |
# https://www.codewars.com/kata/576757b1df89ecf5bd00073b/train/python
def tower_builder(n_floors):
times = 1
space = ((2*n_floors -1) // 2)
tower = []
for _ in range(n_floors):
tower.append((' '*space) + ('*' * times) + (' '*space))
times += 2
space -= 1
return tower
| def tower_builder(n_floors):
times = 1
space = (2 * n_floors - 1) // 2
tower = []
for _ in range(n_floors):
tower.append(' ' * space + '*' * times + ' ' * space)
times += 2
space -= 1
return tower |
#! /usr/bin/env python
# Programs that are runnable.
ns3_runnable_programs = ['build/src/aodv/examples/ns3.27-aodv-debug', 'build/src/bridge/examples/ns3.27-csma-bridge-debug', 'build/src/bridge/examples/ns3.27-csma-bridge-one-hop-debug', 'build/src/buildings/examples/ns3.27-buildings-pathloss-profiler-debug', 'build/src/config-store/examples/ns3.27-config-store-save-debug', 'build/src/core/examples/ns3.27-main-callback-debug', 'build/src/core/examples/ns3.27-sample-simulator-debug', 'build/src/core/examples/ns3.27-main-ptr-debug', 'build/src/core/examples/ns3.27-main-random-variable-debug', 'build/src/core/examples/ns3.27-main-random-variable-stream-debug', 'build/src/core/examples/ns3.27-sample-random-variable-debug', 'build/src/core/examples/ns3.27-sample-random-variable-stream-debug', 'build/src/core/examples/ns3.27-command-line-example-debug', 'build/src/core/examples/ns3.27-hash-example-debug', 'build/src/core/examples/ns3.27-sample-log-time-format-debug', 'build/src/core/examples/ns3.27-test-string-value-formatting-debug', 'build/src/csma/examples/ns3.27-csma-one-subnet-debug', 'build/src/csma/examples/ns3.27-csma-broadcast-debug', 'build/src/csma/examples/ns3.27-csma-packet-socket-debug', 'build/src/csma/examples/ns3.27-csma-multicast-debug', 'build/src/csma/examples/ns3.27-csma-raw-ip-socket-debug', 'build/src/csma/examples/ns3.27-csma-ping-debug', 'build/src/csma-layout/examples/ns3.27-csma-star-debug', 'build/src/dsdv/examples/ns3.27-dsdv-manet-debug', 'build/src/dsr/examples/ns3.27-dsr-debug', 'build/src/energy/examples/ns3.27-li-ion-energy-source-debug', 'build/src/energy/examples/ns3.27-rv-battery-model-test-debug', 'build/src/energy/examples/ns3.27-basic-energy-model-test-debug', 'build/src/fd-net-device/examples/ns3.27-dummy-network-debug', 'build/src/fd-net-device/examples/ns3.27-fd2fd-onoff-debug', 'build/src/internet/examples/ns3.27-main-simple-debug', 'build/src/internet-apps/examples/ns3.27-dhcp-example-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-packet-print-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-phy-test-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-data-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-error-model-plot-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-error-distance-plot-debug', 'build/src/lte/examples/ns3.27-lena-cqi-threshold-debug', 'build/src/lte/examples/ns3.27-lena-dual-stripe-debug', 'build/src/lte/examples/ns3.27-lena-fading-debug', 'build/src/lte/examples/ns3.27-lena-intercell-interference-debug', 'build/src/lte/examples/ns3.27-lena-pathloss-traces-debug', 'build/src/lte/examples/ns3.27-lena-profiling-debug', 'build/src/lte/examples/ns3.27-lena-rem-debug', 'build/src/lte/examples/ns3.27-lena-rem-sector-antenna-debug', 'build/src/lte/examples/ns3.27-lena-rlc-traces-debug', 'build/src/lte/examples/ns3.27-lena-simple-debug', 'build/src/lte/examples/ns3.27-lena-simple-epc-debug', 'build/src/lte/examples/ns3.27-lena-deactivate-bearer-debug', 'build/src/lte/examples/ns3.27-lena-x2-handover-debug', 'build/src/lte/examples/ns3.27-lena-x2-handover-measures-debug', 'build/src/lte/examples/ns3.27-lena-frequency-reuse-debug', 'build/src/lte/examples/ns3.27-lena-distributed-ffr-debug', 'build/src/lte/examples/ns3.27-lena-uplink-power-control-debug', 'build/src/mesh/examples/ns3.27-mesh-debug', 'build/src/mobility/examples/ns3.27-main-grid-topology-debug', 'build/src/mobility/examples/ns3.27-main-random-topology-debug', 'build/src/mobility/examples/ns3.27-main-random-walk-debug', 'build/src/mobility/examples/ns3.27-mobility-trace-example-debug', 'build/src/mobility/examples/ns3.27-ns2-mobility-trace-debug', 'build/src/mobility/examples/ns3.27-bonnmotion-ns2-example-debug', 'build/src/mpi/examples/ns3.27-simple-distributed-debug', 'build/src/mpi/examples/ns3.27-third-distributed-debug', 'build/src/mpi/examples/ns3.27-nms-p2p-nix-distributed-debug', 'build/src/mpi/examples/ns3.27-simple-distributed-empty-node-debug', 'build/src/netanim/examples/ns3.27-dumbbell-animation-debug', 'build/src/netanim/examples/ns3.27-grid-animation-debug', 'build/src/netanim/examples/ns3.27-star-animation-debug', 'build/src/netanim/examples/ns3.27-wireless-animation-debug', 'build/src/netanim/examples/ns3.27-uan-animation-debug', 'build/src/netanim/examples/ns3.27-colors-link-description-debug', 'build/src/netanim/examples/ns3.27-resources-counters-debug', 'build/src/network/examples/ns3.27-main-packet-header-debug', 'build/src/network/examples/ns3.27-main-packet-tag-debug', 'build/src/network/examples/ns3.27-packet-socket-apps-debug', 'build/src/nix-vector-routing/examples/ns3.27-nix-simple-debug', 'build/src/nix-vector-routing/examples/ns3.27-nms-p2p-nix-debug', 'build/src/olsr/examples/ns3.27-simple-point-to-point-olsr-debug', 'build/src/olsr/examples/ns3.27-olsr-hna-debug', 'build/src/point-to-point/examples/ns3.27-main-attribute-value-debug', 'build/src/propagation/examples/ns3.27-main-propagation-loss-debug', 'build/src/propagation/examples/ns3.27-jakes-propagation-model-example-debug', 'build/src/sixlowpan/examples/ns3.27-example-sixlowpan-debug', 'build/src/sixlowpan/examples/ns3.27-example-ping-lr-wpan-debug', 'build/src/spectrum/examples/ns3.27-adhoc-aloha-ideal-phy-debug', 'build/src/spectrum/examples/ns3.27-adhoc-aloha-ideal-phy-matrix-propagation-loss-model-debug', 'build/src/spectrum/examples/ns3.27-adhoc-aloha-ideal-phy-with-microwave-oven-debug', 'build/src/spectrum/examples/ns3.27-tv-trans-example-debug', 'build/src/spectrum/examples/ns3.27-tv-trans-regional-example-debug', 'build/src/stats/examples/ns3.27-gnuplot-example-debug', 'build/src/stats/examples/ns3.27-double-probe-example-debug', 'build/src/stats/examples/ns3.27-time-probe-example-debug', 'build/src/stats/examples/ns3.27-gnuplot-aggregator-example-debug', 'build/src/stats/examples/ns3.27-gnuplot-helper-example-debug', 'build/src/stats/examples/ns3.27-file-aggregator-example-debug', 'build/src/stats/examples/ns3.27-file-helper-example-debug', 'build/src/topology-read/examples/ns3.27-topology-example-sim-debug', 'build/src/traffic-control/examples/ns3.27-red-tests-debug', 'build/src/traffic-control/examples/ns3.27-red-vs-ared-debug', 'build/src/traffic-control/examples/ns3.27-adaptive-red-tests-debug', 'build/src/traffic-control/examples/ns3.27-pfifo-vs-red-debug', 'build/src/traffic-control/examples/ns3.27-codel-vs-pfifo-basic-test-debug', 'build/src/traffic-control/examples/ns3.27-codel-vs-pfifo-asymmetric-debug', 'build/src/traffic-control/examples/ns3.27-pie-example-debug', 'build/src/uan/examples/ns3.27-uan-cw-example-debug', 'build/src/uan/examples/ns3.27-uan-rc-example-debug', 'build/src/virtual-net-device/examples/ns3.27-virtual-net-device-debug', 'build/src/wave/examples/ns3.27-wave-simple-80211p-debug', 'build/src/wave/examples/ns3.27-wave-simple-device-debug', 'build/src/wave/examples/ns3.27-vanet-routing-compare-debug', 'build/src/wifi/examples/ns3.27-wifi-phy-test-debug', 'build/src/wifi/examples/ns3.27-test-interference-helper-debug', 'build/src/wifi/examples/ns3.27-wifi-manager-example-debug', 'build/src/wimax/examples/ns3.27-wimax-ipv4-debug', 'build/src/wimax/examples/ns3.27-wimax-multicast-debug', 'build/src/wimax/examples/ns3.27-wimax-simple-debug', 'build/examples/energy/ns3.27-energy-model-example-debug', 'build/examples/energy/ns3.27-energy-model-with-harvesting-example-debug', 'build/examples/error-model/ns3.27-simple-error-model-debug', 'build/examples/ipv6/ns3.27-icmpv6-redirect-debug', 'build/examples/ipv6/ns3.27-ping6-debug', 'build/examples/ipv6/ns3.27-radvd-debug', 'build/examples/ipv6/ns3.27-radvd-two-prefix-debug', 'build/examples/ipv6/ns3.27-test-ipv6-debug', 'build/examples/ipv6/ns3.27-fragmentation-ipv6-debug', 'build/examples/ipv6/ns3.27-fragmentation-ipv6-two-MTU-debug', 'build/examples/ipv6/ns3.27-loose-routing-ipv6-debug', 'build/examples/ipv6/ns3.27-wsn-ping6-debug', 'build/examples/matrix-topology/ns3.27-matrix-topology-debug', 'build/examples/naming/ns3.27-object-names-debug', 'build/examples/routing/ns3.27-dynamic-global-routing-debug', 'build/examples/routing/ns3.27-static-routing-slash32-debug', 'build/examples/routing/ns3.27-global-routing-slash32-debug', 'build/examples/routing/ns3.27-global-injection-slash32-debug', 'build/examples/routing/ns3.27-simple-global-routing-debug', 'build/examples/routing/ns3.27-simple-alternate-routing-debug', 'build/examples/routing/ns3.27-mixed-global-routing-debug', 'build/examples/routing/ns3.27-simple-routing-ping6-debug', 'build/examples/routing/ns3.27-manet-routing-compare-debug', 'build/examples/routing/ns3.27-ripng-simple-network-debug', 'build/examples/routing/ns3.27-rip-simple-network-debug', 'build/examples/routing/ns3.27-global-routing-multi-switch-plus-router-debug', 'build/examples/socket/ns3.27-socket-bound-static-routing-debug', 'build/examples/socket/ns3.27-socket-bound-tcp-static-routing-debug', 'build/examples/socket/ns3.27-socket-options-ipv4-debug', 'build/examples/socket/ns3.27-socket-options-ipv6-debug', 'build/examples/stats/ns3.27-wifi-example-sim-debug', 'build/examples/tcp/ns3.27-tcp-large-transfer-debug', 'build/examples/tcp/ns3.27-tcp-nsc-lfn-debug', 'build/examples/tcp/ns3.27-tcp-nsc-zoo-debug', 'build/examples/tcp/ns3.27-tcp-star-server-debug', 'build/examples/tcp/ns3.27-star-debug', 'build/examples/tcp/ns3.27-tcp-bulk-send-debug', 'build/examples/tcp/ns3.27-tcp-pcap-nanosec-example-debug', 'build/examples/tcp/ns3.27-tcp-nsc-comparison-debug', 'build/examples/tcp/ns3.27-tcp-variants-comparison-debug', 'build/examples/traffic-control/ns3.27-traffic-control-debug', 'build/examples/traffic-control/ns3.27-queue-discs-benchmark-debug', 'build/examples/traffic-control/ns3.27-red-vs-fengadaptive-debug', 'build/examples/traffic-control/ns3.27-red-vs-nlred-debug', 'build/examples/tutorial/ns3.27-hello-simulator-debug', 'build/examples/tutorial/ns3.27-first-debug', 'build/examples/tutorial/ns3.27-second-debug', 'build/examples/tutorial/ns3.27-third-debug', 'build/examples/tutorial/ns3.27-fourth-debug', 'build/examples/tutorial/ns3.27-fifth-debug', 'build/examples/tutorial/ns3.27-sixth-debug', 'build/examples/tutorial/ns3.27-seventh-debug', 'build/examples/udp/ns3.27-udp-echo-debug', 'build/examples/udp-client-server/ns3.27-udp-client-server-debug', 'build/examples/udp-client-server/ns3.27-udp-trace-client-server-debug', 'build/examples/wireless/ns3.27-mixed-wired-wireless-debug', 'build/examples/wireless/ns3.27-wifi-adhoc-debug', 'build/examples/wireless/ns3.27-wifi-clear-channel-cmu-debug', 'build/examples/wireless/ns3.27-wifi-ap-debug', 'build/examples/wireless/ns3.27-wifi-wired-bridging-debug', 'build/examples/wireless/ns3.27-multirate-debug', 'build/examples/wireless/ns3.27-wifi-simple-adhoc-debug', 'build/examples/wireless/ns3.27-wifi-simple-adhoc-grid-debug', 'build/examples/wireless/ns3.27-wifi-simple-infra-debug', 'build/examples/wireless/ns3.27-wifi-simple-interference-debug', 'build/examples/wireless/ns3.27-wifi-blockack-debug', 'build/examples/wireless/ns3.27-ofdm-validation-debug', 'build/examples/wireless/ns3.27-ofdm-ht-validation-debug', 'build/examples/wireless/ns3.27-ofdm-vht-validation-debug', 'build/examples/wireless/ns3.27-wifi-hidden-terminal-debug', 'build/examples/wireless/ns3.27-ht-wifi-network-debug', 'build/examples/wireless/ns3.27-vht-wifi-network-debug', 'build/examples/wireless/ns3.27-wifi-timing-attributes-debug', 'build/examples/wireless/ns3.27-wifi-sleep-debug', 'build/examples/wireless/ns3.27-power-adaptation-distance-debug', 'build/examples/wireless/ns3.27-power-adaptation-interference-debug', 'build/examples/wireless/ns3.27-rate-adaptation-distance-debug', 'build/examples/wireless/ns3.27-wifi-aggregation-debug', 'build/examples/wireless/ns3.27-simple-ht-hidden-stations-debug', 'build/examples/wireless/ns3.27-80211n-mimo-debug', 'build/examples/wireless/ns3.27-mixed-network-debug', 'build/examples/wireless/ns3.27-wifi-tcp-debug', 'build/examples/wireless/ns3.27-80211e-txop-debug', 'build/examples/wireless/ns3.27-wifi-spectrum-per-example-debug', 'build/examples/wireless/ns3.27-wifi-spectrum-per-interference-debug', 'build/examples/wireless/ns3.27-wifi-spectrum-saturation-example-debug', 'build/examples/wireless/ns3.27-ofdm-he-validation-debug', 'build/examples/wireless/ns3.27-he-wifi-network-debug', 'build/examples/wireless/ns3.27-wifi-multi-tos-debug', 'build/examples/wireless/ns3.27-wifi-backward-compatibility-debug', 'build/scratch/ns3.27-scratch-simulator-debug', 'build/scratch/subdir/ns3.27-subdir-debug']
# Scripts that are runnable.
ns3_runnable_scripts = ['csma-bridge.py', 'sample-simulator.py', 'wifi-olsr-flowmon.py', 'simple-routing-ping6.py', 'first.py', 'second.py', 'third.py', 'mixed-wired-wireless.py', 'wifi-ap.py']
| ns3_runnable_programs = ['build/src/aodv/examples/ns3.27-aodv-debug', 'build/src/bridge/examples/ns3.27-csma-bridge-debug', 'build/src/bridge/examples/ns3.27-csma-bridge-one-hop-debug', 'build/src/buildings/examples/ns3.27-buildings-pathloss-profiler-debug', 'build/src/config-store/examples/ns3.27-config-store-save-debug', 'build/src/core/examples/ns3.27-main-callback-debug', 'build/src/core/examples/ns3.27-sample-simulator-debug', 'build/src/core/examples/ns3.27-main-ptr-debug', 'build/src/core/examples/ns3.27-main-random-variable-debug', 'build/src/core/examples/ns3.27-main-random-variable-stream-debug', 'build/src/core/examples/ns3.27-sample-random-variable-debug', 'build/src/core/examples/ns3.27-sample-random-variable-stream-debug', 'build/src/core/examples/ns3.27-command-line-example-debug', 'build/src/core/examples/ns3.27-hash-example-debug', 'build/src/core/examples/ns3.27-sample-log-time-format-debug', 'build/src/core/examples/ns3.27-test-string-value-formatting-debug', 'build/src/csma/examples/ns3.27-csma-one-subnet-debug', 'build/src/csma/examples/ns3.27-csma-broadcast-debug', 'build/src/csma/examples/ns3.27-csma-packet-socket-debug', 'build/src/csma/examples/ns3.27-csma-multicast-debug', 'build/src/csma/examples/ns3.27-csma-raw-ip-socket-debug', 'build/src/csma/examples/ns3.27-csma-ping-debug', 'build/src/csma-layout/examples/ns3.27-csma-star-debug', 'build/src/dsdv/examples/ns3.27-dsdv-manet-debug', 'build/src/dsr/examples/ns3.27-dsr-debug', 'build/src/energy/examples/ns3.27-li-ion-energy-source-debug', 'build/src/energy/examples/ns3.27-rv-battery-model-test-debug', 'build/src/energy/examples/ns3.27-basic-energy-model-test-debug', 'build/src/fd-net-device/examples/ns3.27-dummy-network-debug', 'build/src/fd-net-device/examples/ns3.27-fd2fd-onoff-debug', 'build/src/internet/examples/ns3.27-main-simple-debug', 'build/src/internet-apps/examples/ns3.27-dhcp-example-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-packet-print-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-phy-test-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-data-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-error-model-plot-debug', 'build/src/lr-wpan/examples/ns3.27-lr-wpan-error-distance-plot-debug', 'build/src/lte/examples/ns3.27-lena-cqi-threshold-debug', 'build/src/lte/examples/ns3.27-lena-dual-stripe-debug', 'build/src/lte/examples/ns3.27-lena-fading-debug', 'build/src/lte/examples/ns3.27-lena-intercell-interference-debug', 'build/src/lte/examples/ns3.27-lena-pathloss-traces-debug', 'build/src/lte/examples/ns3.27-lena-profiling-debug', 'build/src/lte/examples/ns3.27-lena-rem-debug', 'build/src/lte/examples/ns3.27-lena-rem-sector-antenna-debug', 'build/src/lte/examples/ns3.27-lena-rlc-traces-debug', 'build/src/lte/examples/ns3.27-lena-simple-debug', 'build/src/lte/examples/ns3.27-lena-simple-epc-debug', 'build/src/lte/examples/ns3.27-lena-deactivate-bearer-debug', 'build/src/lte/examples/ns3.27-lena-x2-handover-debug', 'build/src/lte/examples/ns3.27-lena-x2-handover-measures-debug', 'build/src/lte/examples/ns3.27-lena-frequency-reuse-debug', 'build/src/lte/examples/ns3.27-lena-distributed-ffr-debug', 'build/src/lte/examples/ns3.27-lena-uplink-power-control-debug', 'build/src/mesh/examples/ns3.27-mesh-debug', 'build/src/mobility/examples/ns3.27-main-grid-topology-debug', 'build/src/mobility/examples/ns3.27-main-random-topology-debug', 'build/src/mobility/examples/ns3.27-main-random-walk-debug', 'build/src/mobility/examples/ns3.27-mobility-trace-example-debug', 'build/src/mobility/examples/ns3.27-ns2-mobility-trace-debug', 'build/src/mobility/examples/ns3.27-bonnmotion-ns2-example-debug', 'build/src/mpi/examples/ns3.27-simple-distributed-debug', 'build/src/mpi/examples/ns3.27-third-distributed-debug', 'build/src/mpi/examples/ns3.27-nms-p2p-nix-distributed-debug', 'build/src/mpi/examples/ns3.27-simple-distributed-empty-node-debug', 'build/src/netanim/examples/ns3.27-dumbbell-animation-debug', 'build/src/netanim/examples/ns3.27-grid-animation-debug', 'build/src/netanim/examples/ns3.27-star-animation-debug', 'build/src/netanim/examples/ns3.27-wireless-animation-debug', 'build/src/netanim/examples/ns3.27-uan-animation-debug', 'build/src/netanim/examples/ns3.27-colors-link-description-debug', 'build/src/netanim/examples/ns3.27-resources-counters-debug', 'build/src/network/examples/ns3.27-main-packet-header-debug', 'build/src/network/examples/ns3.27-main-packet-tag-debug', 'build/src/network/examples/ns3.27-packet-socket-apps-debug', 'build/src/nix-vector-routing/examples/ns3.27-nix-simple-debug', 'build/src/nix-vector-routing/examples/ns3.27-nms-p2p-nix-debug', 'build/src/olsr/examples/ns3.27-simple-point-to-point-olsr-debug', 'build/src/olsr/examples/ns3.27-olsr-hna-debug', 'build/src/point-to-point/examples/ns3.27-main-attribute-value-debug', 'build/src/propagation/examples/ns3.27-main-propagation-loss-debug', 'build/src/propagation/examples/ns3.27-jakes-propagation-model-example-debug', 'build/src/sixlowpan/examples/ns3.27-example-sixlowpan-debug', 'build/src/sixlowpan/examples/ns3.27-example-ping-lr-wpan-debug', 'build/src/spectrum/examples/ns3.27-adhoc-aloha-ideal-phy-debug', 'build/src/spectrum/examples/ns3.27-adhoc-aloha-ideal-phy-matrix-propagation-loss-model-debug', 'build/src/spectrum/examples/ns3.27-adhoc-aloha-ideal-phy-with-microwave-oven-debug', 'build/src/spectrum/examples/ns3.27-tv-trans-example-debug', 'build/src/spectrum/examples/ns3.27-tv-trans-regional-example-debug', 'build/src/stats/examples/ns3.27-gnuplot-example-debug', 'build/src/stats/examples/ns3.27-double-probe-example-debug', 'build/src/stats/examples/ns3.27-time-probe-example-debug', 'build/src/stats/examples/ns3.27-gnuplot-aggregator-example-debug', 'build/src/stats/examples/ns3.27-gnuplot-helper-example-debug', 'build/src/stats/examples/ns3.27-file-aggregator-example-debug', 'build/src/stats/examples/ns3.27-file-helper-example-debug', 'build/src/topology-read/examples/ns3.27-topology-example-sim-debug', 'build/src/traffic-control/examples/ns3.27-red-tests-debug', 'build/src/traffic-control/examples/ns3.27-red-vs-ared-debug', 'build/src/traffic-control/examples/ns3.27-adaptive-red-tests-debug', 'build/src/traffic-control/examples/ns3.27-pfifo-vs-red-debug', 'build/src/traffic-control/examples/ns3.27-codel-vs-pfifo-basic-test-debug', 'build/src/traffic-control/examples/ns3.27-codel-vs-pfifo-asymmetric-debug', 'build/src/traffic-control/examples/ns3.27-pie-example-debug', 'build/src/uan/examples/ns3.27-uan-cw-example-debug', 'build/src/uan/examples/ns3.27-uan-rc-example-debug', 'build/src/virtual-net-device/examples/ns3.27-virtual-net-device-debug', 'build/src/wave/examples/ns3.27-wave-simple-80211p-debug', 'build/src/wave/examples/ns3.27-wave-simple-device-debug', 'build/src/wave/examples/ns3.27-vanet-routing-compare-debug', 'build/src/wifi/examples/ns3.27-wifi-phy-test-debug', 'build/src/wifi/examples/ns3.27-test-interference-helper-debug', 'build/src/wifi/examples/ns3.27-wifi-manager-example-debug', 'build/src/wimax/examples/ns3.27-wimax-ipv4-debug', 'build/src/wimax/examples/ns3.27-wimax-multicast-debug', 'build/src/wimax/examples/ns3.27-wimax-simple-debug', 'build/examples/energy/ns3.27-energy-model-example-debug', 'build/examples/energy/ns3.27-energy-model-with-harvesting-example-debug', 'build/examples/error-model/ns3.27-simple-error-model-debug', 'build/examples/ipv6/ns3.27-icmpv6-redirect-debug', 'build/examples/ipv6/ns3.27-ping6-debug', 'build/examples/ipv6/ns3.27-radvd-debug', 'build/examples/ipv6/ns3.27-radvd-two-prefix-debug', 'build/examples/ipv6/ns3.27-test-ipv6-debug', 'build/examples/ipv6/ns3.27-fragmentation-ipv6-debug', 'build/examples/ipv6/ns3.27-fragmentation-ipv6-two-MTU-debug', 'build/examples/ipv6/ns3.27-loose-routing-ipv6-debug', 'build/examples/ipv6/ns3.27-wsn-ping6-debug', 'build/examples/matrix-topology/ns3.27-matrix-topology-debug', 'build/examples/naming/ns3.27-object-names-debug', 'build/examples/routing/ns3.27-dynamic-global-routing-debug', 'build/examples/routing/ns3.27-static-routing-slash32-debug', 'build/examples/routing/ns3.27-global-routing-slash32-debug', 'build/examples/routing/ns3.27-global-injection-slash32-debug', 'build/examples/routing/ns3.27-simple-global-routing-debug', 'build/examples/routing/ns3.27-simple-alternate-routing-debug', 'build/examples/routing/ns3.27-mixed-global-routing-debug', 'build/examples/routing/ns3.27-simple-routing-ping6-debug', 'build/examples/routing/ns3.27-manet-routing-compare-debug', 'build/examples/routing/ns3.27-ripng-simple-network-debug', 'build/examples/routing/ns3.27-rip-simple-network-debug', 'build/examples/routing/ns3.27-global-routing-multi-switch-plus-router-debug', 'build/examples/socket/ns3.27-socket-bound-static-routing-debug', 'build/examples/socket/ns3.27-socket-bound-tcp-static-routing-debug', 'build/examples/socket/ns3.27-socket-options-ipv4-debug', 'build/examples/socket/ns3.27-socket-options-ipv6-debug', 'build/examples/stats/ns3.27-wifi-example-sim-debug', 'build/examples/tcp/ns3.27-tcp-large-transfer-debug', 'build/examples/tcp/ns3.27-tcp-nsc-lfn-debug', 'build/examples/tcp/ns3.27-tcp-nsc-zoo-debug', 'build/examples/tcp/ns3.27-tcp-star-server-debug', 'build/examples/tcp/ns3.27-star-debug', 'build/examples/tcp/ns3.27-tcp-bulk-send-debug', 'build/examples/tcp/ns3.27-tcp-pcap-nanosec-example-debug', 'build/examples/tcp/ns3.27-tcp-nsc-comparison-debug', 'build/examples/tcp/ns3.27-tcp-variants-comparison-debug', 'build/examples/traffic-control/ns3.27-traffic-control-debug', 'build/examples/traffic-control/ns3.27-queue-discs-benchmark-debug', 'build/examples/traffic-control/ns3.27-red-vs-fengadaptive-debug', 'build/examples/traffic-control/ns3.27-red-vs-nlred-debug', 'build/examples/tutorial/ns3.27-hello-simulator-debug', 'build/examples/tutorial/ns3.27-first-debug', 'build/examples/tutorial/ns3.27-second-debug', 'build/examples/tutorial/ns3.27-third-debug', 'build/examples/tutorial/ns3.27-fourth-debug', 'build/examples/tutorial/ns3.27-fifth-debug', 'build/examples/tutorial/ns3.27-sixth-debug', 'build/examples/tutorial/ns3.27-seventh-debug', 'build/examples/udp/ns3.27-udp-echo-debug', 'build/examples/udp-client-server/ns3.27-udp-client-server-debug', 'build/examples/udp-client-server/ns3.27-udp-trace-client-server-debug', 'build/examples/wireless/ns3.27-mixed-wired-wireless-debug', 'build/examples/wireless/ns3.27-wifi-adhoc-debug', 'build/examples/wireless/ns3.27-wifi-clear-channel-cmu-debug', 'build/examples/wireless/ns3.27-wifi-ap-debug', 'build/examples/wireless/ns3.27-wifi-wired-bridging-debug', 'build/examples/wireless/ns3.27-multirate-debug', 'build/examples/wireless/ns3.27-wifi-simple-adhoc-debug', 'build/examples/wireless/ns3.27-wifi-simple-adhoc-grid-debug', 'build/examples/wireless/ns3.27-wifi-simple-infra-debug', 'build/examples/wireless/ns3.27-wifi-simple-interference-debug', 'build/examples/wireless/ns3.27-wifi-blockack-debug', 'build/examples/wireless/ns3.27-ofdm-validation-debug', 'build/examples/wireless/ns3.27-ofdm-ht-validation-debug', 'build/examples/wireless/ns3.27-ofdm-vht-validation-debug', 'build/examples/wireless/ns3.27-wifi-hidden-terminal-debug', 'build/examples/wireless/ns3.27-ht-wifi-network-debug', 'build/examples/wireless/ns3.27-vht-wifi-network-debug', 'build/examples/wireless/ns3.27-wifi-timing-attributes-debug', 'build/examples/wireless/ns3.27-wifi-sleep-debug', 'build/examples/wireless/ns3.27-power-adaptation-distance-debug', 'build/examples/wireless/ns3.27-power-adaptation-interference-debug', 'build/examples/wireless/ns3.27-rate-adaptation-distance-debug', 'build/examples/wireless/ns3.27-wifi-aggregation-debug', 'build/examples/wireless/ns3.27-simple-ht-hidden-stations-debug', 'build/examples/wireless/ns3.27-80211n-mimo-debug', 'build/examples/wireless/ns3.27-mixed-network-debug', 'build/examples/wireless/ns3.27-wifi-tcp-debug', 'build/examples/wireless/ns3.27-80211e-txop-debug', 'build/examples/wireless/ns3.27-wifi-spectrum-per-example-debug', 'build/examples/wireless/ns3.27-wifi-spectrum-per-interference-debug', 'build/examples/wireless/ns3.27-wifi-spectrum-saturation-example-debug', 'build/examples/wireless/ns3.27-ofdm-he-validation-debug', 'build/examples/wireless/ns3.27-he-wifi-network-debug', 'build/examples/wireless/ns3.27-wifi-multi-tos-debug', 'build/examples/wireless/ns3.27-wifi-backward-compatibility-debug', 'build/scratch/ns3.27-scratch-simulator-debug', 'build/scratch/subdir/ns3.27-subdir-debug']
ns3_runnable_scripts = ['csma-bridge.py', 'sample-simulator.py', 'wifi-olsr-flowmon.py', 'simple-routing-ping6.py', 'first.py', 'second.py', 'third.py', 'mixed-wired-wireless.py', 'wifi-ap.py'] |
# Arithmetic progression
# A + (A+B) + (A+2B) + (A+3B) + ... + (A+(C-1)B))
def main():
N = int(input("data:\n"))
l = []
for x in range(0,N):
a,b,c = input().split(" ")
a,b,c = int(a),int(b),int(c)
s = 0
for each in range(0,c):
s += a + (b*each)
l.append(s)
print("\nanswer:")
for each in l:
print(each, end=" ")
main()
| def main():
n = int(input('data:\n'))
l = []
for x in range(0, N):
(a, b, c) = input().split(' ')
(a, b, c) = (int(a), int(b), int(c))
s = 0
for each in range(0, c):
s += a + b * each
l.append(s)
print('\nanswer:')
for each in l:
print(each, end=' ')
main() |
col = {
"owid": {
"Notes": "notes",
"Entity": "entity",
"Date": "time",
"Source URL": "src",
"Source label": "src_lb",
"Cumulative total": "tot_n_tests",
"Daily change in cumulative total": "n_tests",
"Cumulative total per thousand": "tot_n_tests_pthab",
"Daily change in cumulative total per thousand": "n_tests_pthab",
"General source label": "source",
"General source URL": "source_url",
"Short description": "source_desc",
"Detailed description": "source_desc_detailed",
}
}
var = {
"owid": {}
}
| col = {'owid': {'Notes': 'notes', 'Entity': 'entity', 'Date': 'time', 'Source URL': 'src', 'Source label': 'src_lb', 'Cumulative total': 'tot_n_tests', 'Daily change in cumulative total': 'n_tests', 'Cumulative total per thousand': 'tot_n_tests_pthab', 'Daily change in cumulative total per thousand': 'n_tests_pthab', 'General source label': 'source', 'General source URL': 'source_url', 'Short description': 'source_desc', 'Detailed description': 'source_desc_detailed'}}
var = {'owid': {}} |
# https://codeforces.com/problemset/problem/1030/A
n = int(input())
o = list(map(int, input().split()))
print('HARD' if o.count(1) != 0 else 'EASY') | n = int(input())
o = list(map(int, input().split()))
print('HARD' if o.count(1) != 0 else 'EASY') |
class Solution:
# @param {integer[]} candidates
# @param {integer} target
# @return {integer[][]}
def combinationSum(self, candidates, target):
candidates.sort()
return self.combsum(candidates, target)
def combsum(self, nums, target):
if target == 0:
return [[]]
if not nums or nums[0] > target or target < 1:
return []
res = []
for i in range(len(nums)):
num = nums[i]
pre = [num]
t = target
while t >= num:
t -= num
subs = self.combsum(nums[i + 1:], t)
for sub in subs:
res.append(pre + sub)
pre += [num]
return res
| class Solution:
def combination_sum(self, candidates, target):
candidates.sort()
return self.combsum(candidates, target)
def combsum(self, nums, target):
if target == 0:
return [[]]
if not nums or nums[0] > target or target < 1:
return []
res = []
for i in range(len(nums)):
num = nums[i]
pre = [num]
t = target
while t >= num:
t -= num
subs = self.combsum(nums[i + 1:], t)
for sub in subs:
res.append(pre + sub)
pre += [num]
return res |
def decimal2base(num, base):
convert_string = "0123456789ABCDEF"
if num < base:
return convert_string[num]
remainder = num % base
num = num // base
return decimal2base(num, base) + convert_string[remainder]
print(decimal2base(1453, 16))
| def decimal2base(num, base):
convert_string = '0123456789ABCDEF'
if num < base:
return convert_string[num]
remainder = num % base
num = num // base
return decimal2base(num, base) + convert_string[remainder]
print(decimal2base(1453, 16)) |
# wykys 2019
def bin_print(byte_array: list, num_in_line: int = 8, space: str = ' | '):
def bin_to_str(byte_array: list) -> str:
return ''.join([
chr(c) if c > 32 and c < 127 else '.' for c in byte_array
])
tmp = ''
for i, byte in enumerate(byte_array):
tmp = ''.join([tmp, f'{byte:02X}'])
if (i+1) % num_in_line:
tmp = ''.join([tmp, ' '])
else:
tmp = ''.join([
tmp,
space,
bin_to_str(byte_array[i-num_in_line+1:i+1]),
'\n'
])
if (i+1) % num_in_line:
tmp = ''.join([
tmp,
' '*(3*(num_in_line - ((i+1) % num_in_line)) - 1),
space,
bin_to_str(byte_array[i - ((i+1) % num_in_line) + 1:]),
'\n'
])
print(tmp)
| def bin_print(byte_array: list, num_in_line: int=8, space: str=' | '):
def bin_to_str(byte_array: list) -> str:
return ''.join([chr(c) if c > 32 and c < 127 else '.' for c in byte_array])
tmp = ''
for (i, byte) in enumerate(byte_array):
tmp = ''.join([tmp, f'{byte:02X}'])
if (i + 1) % num_in_line:
tmp = ''.join([tmp, ' '])
else:
tmp = ''.join([tmp, space, bin_to_str(byte_array[i - num_in_line + 1:i + 1]), '\n'])
if (i + 1) % num_in_line:
tmp = ''.join([tmp, ' ' * (3 * (num_in_line - (i + 1) % num_in_line) - 1), space, bin_to_str(byte_array[i - (i + 1) % num_in_line + 1:]), '\n'])
print(tmp) |
expected_output = {
'environment-information': {
'environment-item': [{
'class': 'Temp',
'name': 'PSM 0',
'status': 'OK',
'temperature': {
'#text': '25 '
'degrees '
'C '
'/ '
'77 '
'degrees '
'F',
'@junos:celsius': '25'
}
}, {
'class': 'Temp',
'name': 'PSM 1',
'status': 'OK',
'temperature': {
'#text': '24 '
'degrees '
'C '
'/ '
'75 '
'degrees '
'F',
'@junos:celsius': '24'
}
}, {
'class': 'Temp',
'name': 'PSM 2',
'status': 'OK',
'temperature': {
'#text': '24 '
'degrees '
'C '
'/ '
'75 '
'degrees '
'F',
'@junos:celsius': '24'
}
}, {
'class': 'Temp',
'name': 'PSM 3',
'status': 'OK',
'temperature': {
'#text': '23 '
'degrees '
'C '
'/ '
'73 '
'degrees '
'F',
'@junos:celsius': '23'
}
}, {
'class': 'Temp',
'name': 'PSM 4',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 5',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 6',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 7',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 8',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 9',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'PSM 10',
'status': 'OK',
'temperature': {
'#text': '30 '
'degrees '
'C '
'/ '
'86 '
'degrees '
'F',
'@junos:celsius': '30'
}
}, {
'class': 'Temp',
'name': 'PSM 11',
'status': 'OK',
'temperature': {
'#text': '30 '
'degrees '
'C '
'/ '
'86 '
'degrees '
'F',
'@junos:celsius': '30'
}
}, {
'class': 'Temp',
'name': 'PSM 12',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 13',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 14',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 15',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 16',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PSM 17',
'status': 'Check'
}, {
'class': 'Temp',
'name': 'PDM 0',
'status': 'OK'
}, {
'class': 'Temp',
'name': 'PDM 1',
'status': 'OK'
}, {
'class': 'Temp',
'name': 'PDM 2',
'status': 'OK'
}, {
'class': 'Temp',
'name': 'PDM 3',
'status': 'OK'
}, {
'class': 'Temp',
'name': 'CB 0 IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '39 '
'degrees '
'C '
'/ '
'102 '
'degrees '
'F',
'@junos:celsius': '39'
}
}, {
'class': 'Temp',
'name': 'CB 0 IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '36 '
'degrees '
'C '
'/ '
'96 '
'degrees '
'F',
'@junos:celsius': '36'
}
}, {
'class': 'Temp',
'name': 'CB 0 IntakeC-Zone0',
'status': 'OK',
'temperature': {
'#text': '51 '
'degrees '
'C '
'/ '
'123 '
'degrees '
'F',
'@junos:celsius': '51'
}
}, {
'class': 'Temp',
'name': 'CB 0 '
'ExhaustA-Zone0',
'status': 'OK',
'temperature': {
'#text': '40 '
'degrees '
'C '
'/ '
'104 '
'degrees '
'F',
'@junos:celsius': '40'
}
}, {
'class': 'Temp',
'name': 'CB 0 '
'ExhaustB-Zone1',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'CB 0 TCBC-Zone0',
'status': 'OK',
'temperature': {
'#text': '45 '
'degrees '
'C '
'/ '
'113 '
'degrees '
'F',
'@junos:celsius': '45'
}
}, {
'class': 'Temp',
'name': 'CB 1 IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'CB 1 IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'CB 1 IntakeC-Zone0',
'status': 'OK',
'temperature': {
'#text': '33 '
'degrees '
'C '
'/ '
'91 '
'degrees '
'F',
'@junos:celsius': '33'
}
}, {
'class': 'Temp',
'name': 'CB 1 '
'ExhaustA-Zone0',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'CB 1 '
'ExhaustB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'CB 1 TCBC-Zone0',
'status': 'OK',
'temperature': {
'#text': '39 '
'degrees '
'C '
'/ '
'102 '
'degrees '
'F',
'@junos:celsius': '39'
}
}, {
'class': 'Temp',
'name': 'SPMB 0 Intake',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'SPMB 1 Intake',
'status': 'OK',
'temperature': {
'#text': '33 '
'degrees '
'C '
'/ '
'91 '
'degrees '
'F',
'@junos:celsius': '33'
}
}, {
'class': 'Temp',
'name': 'Routing Engine 0',
'status': 'OK',
'temperature': {
'#text': '43 '
'degrees '
'C '
'/ '
'109 '
'degrees '
'F',
'@junos:celsius': '43'
}
}, {
'class': 'Temp',
'name': 'Routing Engine 0 '
'CPU',
'status': 'OK',
'temperature': {
'#text': '39 '
'degrees '
'C '
'/ '
'102 '
'degrees '
'F',
'@junos:celsius': '39'
}
}, {
'class': 'Temp',
'name': 'Routing Engine 1',
'status': 'OK',
'temperature': {
'#text': '40 '
'degrees '
'C '
'/ '
'104 '
'degrees '
'F',
'@junos:celsius': '40'
}
}, {
'class': 'Temp',
'name': 'Routing Engine 1 '
'CPU',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'SFB 0 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '37 '
'degrees '
'C '
'/ '
'98 '
'degrees '
'F',
'@junos:celsius': '37'
}
}, {
'class': 'Temp',
'name': 'SFB 0 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '45 '
'degrees '
'C '
'/ '
'113 '
'degrees '
'F',
'@junos:celsius': '45'
}
}, {
'class': 'Temp',
'name': 'SFB 0 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'SFB 0 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 0 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '36 '
'degrees '
'C '
'/ '
'96 '
'degrees '
'F',
'@junos:celsius': '36'
}
}, {
'class': 'Temp',
'name': 'SFB 0 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '63 '
'degrees '
'C '
'/ '
'145 '
'degrees '
'F',
'@junos:celsius': '63'
}
}, {
'class': 'Temp',
'name': 'SFB 0 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '55 '
'degrees '
'C '
'/ '
'131 '
'degrees '
'F',
'@junos:celsius': '55'
}
}, {
'class': 'Temp',
'name': 'SFB 0 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '52 '
'degrees '
'C '
'/ '
'125 '
'degrees '
'F',
'@junos:celsius': '52'
}
}, {
'class': 'Temp',
'name': 'SFB 1 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'SFB 1 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '42 '
'degrees '
'C '
'/ '
'107 '
'degrees '
'F',
'@junos:celsius': '42'
}
}, {
'class': 'Temp',
'name': 'SFB 1 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'SFB 1 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'SFB 1 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 1 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '63 '
'degrees '
'C '
'/ '
'145 '
'degrees '
'F',
'@junos:celsius': '63'
}
}, {
'class': 'Temp',
'name': 'SFB 1 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '53 '
'degrees '
'C '
'/ '
'127 '
'degrees '
'F',
'@junos:celsius': '53'
}
}, {
'class': 'Temp',
'name': 'SFB 1 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '50 '
'degrees '
'C '
'/ '
'122 '
'degrees '
'F',
'@junos:celsius': '50'
}
}, {
'class': 'Temp',
'name': 'SFB 2 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'SFB 2 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '42 '
'degrees '
'C '
'/ '
'107 '
'degrees '
'F',
'@junos:celsius': '42'
}
}, {
'class': 'Temp',
'name': 'SFB 2 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '30 '
'degrees '
'C '
'/ '
'86 '
'degrees '
'F',
'@junos:celsius': '30'
}
}, {
'class': 'Temp',
'name': 'SFB 2 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'SFB 2 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 2 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '60 '
'degrees '
'C '
'/ '
'140 '
'degrees '
'F',
'@junos:celsius': '60'
}
}, {
'class': 'Temp',
'name': 'SFB 2 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '53 '
'degrees '
'C '
'/ '
'127 '
'degrees '
'F',
'@junos:celsius': '53'
}
}, {
'class': 'Temp',
'name': 'SFB 2 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '56 '
'degrees '
'C '
'/ '
'132 '
'degrees '
'F',
'@junos:celsius': '56'
}
}, {
'class': 'Temp',
'name': 'SFB 3 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'SFB 3 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '42 '
'degrees '
'C '
'/ '
'107 '
'degrees '
'F',
'@junos:celsius': '42'
}
}, {
'class': 'Temp',
'name': 'SFB 3 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'SFB 3 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'SFB 3 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 3 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '61 '
'degrees '
'C '
'/ '
'141 '
'degrees '
'F',
'@junos:celsius': '61'
}
}, {
'class': 'Temp',
'name': 'SFB 3 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '53 '
'degrees '
'C '
'/ '
'127 '
'degrees '
'F',
'@junos:celsius': '53'
}
}, {
'class': 'Temp',
'name': 'SFB 3 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '50 '
'degrees '
'C '
'/ '
'122 '
'degrees '
'F',
'@junos:celsius': '50'
}
}, {
'class': 'Temp',
'name': 'SFB 4 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 4 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '42 '
'degrees '
'C '
'/ '
'107 '
'degrees '
'F',
'@junos:celsius': '42'
}
}, {
'class': 'Temp',
'name': 'SFB 4 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'SFB 4 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'SFB 4 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 4 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '64 '
'degrees '
'C '
'/ '
'147 '
'degrees '
'F',
'@junos:celsius': '64'
}
}, {
'class': 'Temp',
'name': 'SFB 4 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '53 '
'degrees '
'C '
'/ '
'127 '
'degrees '
'F',
'@junos:celsius': '53'
}
}, {
'class': 'Temp',
'name': 'SFB 4 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '50 '
'degrees '
'C '
'/ '
'122 '
'degrees '
'F',
'@junos:celsius': '50'
}
}, {
'class': 'Temp',
'name': 'SFB 5 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 5 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '41 '
'degrees '
'C '
'/ '
'105 '
'degrees '
'F',
'@junos:celsius': '41'
}
}, {
'class': 'Temp',
'name': 'SFB 5 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'SFB 5 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '31 '
'degrees '
'C '
'/ '
'87 '
'degrees '
'F',
'@junos:celsius': '31'
}
}, {
'class': 'Temp',
'name': 'SFB 5 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 5 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '63 '
'degrees '
'C '
'/ '
'145 '
'degrees '
'F',
'@junos:celsius': '63'
}
}, {
'class': 'Temp',
'name': 'SFB 5 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '53 '
'degrees '
'C '
'/ '
'127 '
'degrees '
'F',
'@junos:celsius': '53'
}
}, {
'class': 'Temp',
'name': 'SFB 5 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '50 '
'degrees '
'C '
'/ '
'122 '
'degrees '
'F',
'@junos:celsius': '50'
}
}, {
'class': 'Temp',
'name': 'SFB 6 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 6 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '42 '
'degrees '
'C '
'/ '
'107 '
'degrees '
'F',
'@junos:celsius': '42'
}
}, {
'class': 'Temp',
'name': 'SFB 6 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'SFB 6 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'SFB 6 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '34 '
'degrees '
'C '
'/ '
'93 '
'degrees '
'F',
'@junos:celsius': '34'
}
}, {
'class': 'Temp',
'name': 'SFB 6 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '62 '
'degrees '
'C '
'/ '
'143 '
'degrees '
'F',
'@junos:celsius': '62'
}
}, {
'class': 'Temp',
'name': 'SFB 6 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '53 '
'degrees '
'C '
'/ '
'127 '
'degrees '
'F',
'@junos:celsius': '53'
}
}, {
'class': 'Temp',
'name': 'SFB 6 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '49 '
'degrees '
'C '
'/ '
'120 '
'degrees '
'F',
'@junos:celsius': '49'
}
}, {
'class': 'Temp',
'name': 'SFB 7 Intake-Zone0',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'SFB 7 '
'Exhaust-Zone1',
'status': 'OK',
'temperature': {
'#text': '43 '
'degrees '
'C '
'/ '
'109 '
'degrees '
'F',
'@junos:celsius': '43'
}
}, {
'class': 'Temp',
'name': 'SFB 7 '
'IntakeA-Zone0',
'status': 'OK',
'temperature': {
'#text': '31 '
'degrees '
'C '
'/ '
'87 '
'degrees '
'F',
'@junos:celsius': '31'
}
}, {
'class': 'Temp',
'name': 'SFB 7 '
'IntakeB-Zone1',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'SFB 7 '
'Exhaust-Zone0',
'status': 'OK',
'temperature': {
'#text': '35 '
'degrees '
'C '
'/ '
'95 '
'degrees '
'F',
'@junos:celsius': '35'
}
}, {
'class': 'Temp',
'name': 'SFB 7 '
'SFB-XF2-Zone1',
'status': 'OK',
'temperature': {
'#text': '65 '
'degrees '
'C '
'/ '
'149 '
'degrees '
'F',
'@junos:celsius': '65'
}
}, {
'class': 'Temp',
'name': 'SFB 7 '
'SFB-XF1-Zone0',
'status': 'OK',
'temperature': {
'#text': '56 '
'degrees '
'C '
'/ '
'132 '
'degrees '
'F',
'@junos:celsius': '56'
}
}, {
'class': 'Temp',
'name': 'SFB 7 '
'SFB-XF0-Zone0',
'status': 'OK',
'temperature': {
'#text': '52 '
'degrees '
'C '
'/ '
'125 '
'degrees '
'F',
'@junos:celsius': '52'
}
}, {
'class': 'Temp',
'name': 'FPC 0 Intake',
'status': 'OK',
'temperature': {
'#text': '29 '
'degrees '
'C '
'/ '
'84 '
'degrees '
'F',
'@junos:celsius': '29'
}
}, {
'class': 'Temp',
'name': 'FPC 0 Exhaust A',
'status': 'OK',
'temperature': {
'#text': '53 '
'degrees '
'C '
'/ '
'127 '
'degrees '
'F',
'@junos:celsius': '53'
}
}, {
'class': 'Temp',
'name': 'FPC 0 Exhaust B',
'status': 'OK',
'temperature': {
'#text': '54 '
'degrees '
'C '
'/ '
'129 '
'degrees '
'F',
'@junos:celsius': '54'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 0 TSen',
'status': 'OK',
'temperature': {
'#text': '50 '
'degrees '
'C '
'/ '
'122 '
'degrees '
'F',
'@junos:celsius': '50'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 0 Chip',
'status': 'OK',
'temperature': {
'#text': '63 '
'degrees '
'C '
'/ '
'145 '
'degrees '
'F',
'@junos:celsius': '63'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 0 XR2 0 '
'TSen',
'status': 'OK',
'temperature': {
'#text': '50 '
'degrees '
'C '
'/ '
'122 '
'degrees '
'F',
'@junos:celsius': '50'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 0 XR2 0 '
'Chip',
'status': 'OK',
'temperature': {
'#text': '80 '
'degrees '
'C '
'/ '
'176 '
'degrees '
'F',
'@junos:celsius': '80'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 0 XR2 1 '
'TSen',
'status': 'OK',
'temperature': {
'#text': '50 '
'degrees '
'C '
'/ '
'122 '
'degrees '
'F',
'@junos:celsius': '50'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 0 XR2 1 '
'Chip',
'status': 'OK',
'temperature': {
'#text': '80 '
'degrees '
'C '
'/ '
'176 '
'degrees '
'F',
'@junos:celsius': '80'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 1 TSen',
'status': 'OK',
'temperature': {
'#text': '36 '
'degrees '
'C '
'/ '
'96 '
'degrees '
'F',
'@junos:celsius': '36'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 1 Chip',
'status': 'OK',
'temperature': {
'#text': '44 '
'degrees '
'C '
'/ '
'111 '
'degrees '
'F',
'@junos:celsius': '44'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 1 XR2 0 '
'TSen',
'status': 'OK',
'temperature': {
'#text': '36 '
'degrees '
'C '
'/ '
'96 '
'degrees '
'F',
'@junos:celsius': '36'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 1 XR2 0 '
'Chip',
'status': 'OK',
'temperature': {
'#text': '60 '
'degrees '
'C '
'/ '
'140 '
'degrees '
'F',
'@junos:celsius': '60'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 1 XR2 1 '
'TSen',
'status': 'OK',
'temperature': {
'#text': '36 '
'degrees '
'C '
'/ '
'96 '
'degrees '
'F',
'@junos:celsius': '36'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XL 1 XR2 1 '
'Chip',
'status': 'OK',
'temperature': {
'#text': '59 '
'degrees '
'C '
'/ '
'138 '
'degrees '
'F',
'@junos:celsius': '59'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 0 TSen',
'status': 'OK',
'temperature': {
'#text': '52 '
'degrees '
'C '
'/ '
'125 '
'degrees '
'F',
'@junos:celsius': '52'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 0 Chip',
'status': 'OK',
'temperature': {
'#text': '62 '
'degrees '
'C '
'/ '
'143 '
'degrees '
'F',
'@junos:celsius': '62'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 1 TSen',
'status': 'OK',
'temperature': {
'#text': '52 '
'degrees '
'C '
'/ '
'125 '
'degrees '
'F',
'@junos:celsius': '52'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 1 Chip',
'status': 'OK',
'temperature': {
'#text': '57 '
'degrees '
'C '
'/ '
'134 '
'degrees '
'F',
'@junos:celsius': '57'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 2 TSen',
'status': 'OK',
'temperature': {
'#text': '52 '
'degrees '
'C '
'/ '
'125 '
'degrees '
'F',
'@junos:celsius': '52'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 2 Chip',
'status': 'OK',
'temperature': {
'#text': '51 '
'degrees '
'C '
'/ '
'123 '
'degrees '
'F',
'@junos:celsius': '51'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 3 TSen',
'status': 'OK',
'temperature': {
'#text': '52 '
'degrees '
'C '
'/ '
'125 '
'degrees '
'F',
'@junos:celsius': '52'
}
}, {
'class': 'Temp',
'name': 'FPC 0 XM 3 Chip',
'status': 'OK',
'temperature': {
'#text': '45 '
'degrees '
'C '
'/ '
'113 '
'degrees '
'F',
'@junos:celsius': '45'
}
}, {
'class': 'Temp',
'name': 'FPC 0 PCIe Switch '
'TSen',
'status': 'OK',
'temperature': {
'#text': '52 '
'degrees '
'C '
'/ '
'125 '
'degrees '
'F',
'@junos:celsius': '52'
}
}, {
'class': 'Temp',
'name': 'FPC 0 PCIe Switch '
'Chip',
'status': 'OK',
'temperature': {
'#text': '30 '
'degrees '
'C '
'/ '
'86 '
'degrees '
'F',
'@junos:celsius': '30'
}
}, {
'class': 'Temp',
'name': 'FPC 9 Intake',
'status': 'OK',
'temperature': {
'#text': '31 '
'degrees '
'C '
'/ '
'87 '
'degrees '
'F',
'@junos:celsius': '31'
}
}, {
'class': 'Temp',
'name': 'FPC 9 Exhaust A',
'status': 'OK',
'temperature': {
'#text': '48 '
'degrees '
'C '
'/ '
'118 '
'degrees '
'F',
'@junos:celsius': '48'
}
}, {
'class': 'Temp',
'name': 'FPC 9 Exhaust B',
'status': 'OK',
'temperature': {
'#text': '41 '
'degrees '
'C '
'/ '
'105 '
'degrees '
'F',
'@junos:celsius': '41'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 0 TCAM '
'TSen',
'status': 'OK',
'temperature': {
'#text': '46 '
'degrees '
'C '
'/ '
'114 '
'degrees '
'F',
'@junos:celsius': '46'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 0 TCAM '
'Chip',
'status': 'OK',
'temperature': {
'#text': '55 '
'degrees '
'C '
'/ '
'131 '
'degrees '
'F',
'@junos:celsius': '55'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 0 TSen',
'status': 'OK',
'temperature': {
'#text': '46 '
'degrees '
'C '
'/ '
'114 '
'degrees '
'F',
'@junos:celsius': '46'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 0 Chip',
'status': 'OK',
'temperature': {
'#text': '55 '
'degrees '
'C '
'/ '
'131 '
'degrees '
'F',
'@junos:celsius': '55'
}
}, {
'class': 'Temp',
'name': 'FPC 9 MQ 0 TSen',
'status': 'OK',
'temperature': {
'#text': '46 '
'degrees '
'C '
'/ '
'114 '
'degrees '
'F',
'@junos:celsius': '46'
}
}, {
'class': 'Temp',
'name': 'FPC 9 MQ 0 Chip',
'status': 'OK',
'temperature': {
'#text': '57 '
'degrees '
'C '
'/ '
'134 '
'degrees '
'F',
'@junos:celsius': '57'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 1 TCAM '
'TSen',
'status': 'OK',
'temperature': {
'#text': '41 '
'degrees '
'C '
'/ '
'105 '
'degrees '
'F',
'@junos:celsius': '41'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 1 TCAM '
'Chip',
'status': 'OK',
'temperature': {
'#text': '46 '
'degrees '
'C '
'/ '
'114 '
'degrees '
'F',
'@junos:celsius': '46'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 1 TSen',
'status': 'OK',
'temperature': {
'#text': '41 '
'degrees '
'C '
'/ '
'105 '
'degrees '
'F',
'@junos:celsius': '41'
}
}, {
'class': 'Temp',
'name': 'FPC 9 LU 1 Chip',
'status': 'OK',
'temperature': {
'#text': '47 '
'degrees '
'C '
'/ '
'116 '
'degrees '
'F',
'@junos:celsius': '47'
}
}, {
'class': 'Temp',
'name': 'FPC 9 MQ 1 TSen',
'status': 'OK',
'temperature': {
'#text': '41 '
'degrees '
'C '
'/ '
'105 '
'degrees '
'F',
'@junos:celsius': '41'
}
}, {
'class': 'Temp',
'name': 'FPC 9 MQ 1 Chip',
'status': 'OK',
'temperature': {
'#text': '47 '
'degrees '
'C '
'/ '
'116 '
'degrees '
'F',
'@junos:celsius': '47'
}
}, {
'class': 'Temp',
'name': 'ADC 9 Intake',
'status': 'OK',
'temperature': {
'#text': '32 '
'degrees '
'C '
'/ '
'89 '
'degrees '
'F',
'@junos:celsius': '32'
}
}, {
'class': 'Temp',
'name': 'ADC 9 Exhaust',
'status': 'OK',
'temperature': {
'#text': '42 '
'degrees '
'C '
'/ '
'107 '
'degrees '
'F',
'@junos:celsius': '42'
}
}, {
'class': 'Temp',
'name': 'ADC 9 ADC-XF1',
'status': 'OK',
'temperature': {
'#text': '49 '
'degrees '
'C '
'/ '
'120 '
'degrees '
'F',
'@junos:celsius': '49'
}
}, {
'class': 'Temp',
'name': 'ADC 9 ADC-XF0',
'status': 'OK',
'temperature': {
'#text': '59 '
'degrees '
'C '
'/ '
'138 '
'degrees '
'F',
'@junos:celsius': '59'
}
}, {
'class': 'Fans',
'comment': '2760 RPM',
'name': 'Fan Tray 0 Fan 1',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 0 Fan 2',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 0 Fan 3',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 0 Fan 4',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 0 Fan 5',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 0 Fan 6',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 1 Fan 1',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 1 Fan 2',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 1 Fan 3',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 1 Fan 4',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 1 Fan 5',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 1 Fan 6',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 2 Fan 1',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 2 Fan 2',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 2 Fan 3',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 2 Fan 4',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 2 Fan 5',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 2 Fan 6',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 3 Fan 1',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2400 RPM',
'name': 'Fan Tray 3 Fan 2',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 3 Fan 3',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 3 Fan 4',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2640 RPM',
'name': 'Fan Tray 3 Fan 5',
'status': 'OK'
}, {
'class': 'Fans',
'comment': '2520 RPM',
'name': 'Fan Tray 3 Fan 6',
'status': 'OK'
}]
}
}
| expected_output = {'environment-information': {'environment-item': [{'class': 'Temp', 'name': 'PSM 0', 'status': 'OK', 'temperature': {'#text': '25 degrees C / 77 degrees F', '@junos:celsius': '25'}}, {'class': 'Temp', 'name': 'PSM 1', 'status': 'OK', 'temperature': {'#text': '24 degrees C / 75 degrees F', '@junos:celsius': '24'}}, {'class': 'Temp', 'name': 'PSM 2', 'status': 'OK', 'temperature': {'#text': '24 degrees C / 75 degrees F', '@junos:celsius': '24'}}, {'class': 'Temp', 'name': 'PSM 3', 'status': 'OK', 'temperature': {'#text': '23 degrees C / 73 degrees F', '@junos:celsius': '23'}}, {'class': 'Temp', 'name': 'PSM 4', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 5', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 6', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 7', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 8', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 9', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'PSM 10', 'status': 'OK', 'temperature': {'#text': '30 degrees C / 86 degrees F', '@junos:celsius': '30'}}, {'class': 'Temp', 'name': 'PSM 11', 'status': 'OK', 'temperature': {'#text': '30 degrees C / 86 degrees F', '@junos:celsius': '30'}}, {'class': 'Temp', 'name': 'PSM 12', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 13', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 14', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 15', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 16', 'status': 'Check'}, {'class': 'Temp', 'name': 'PSM 17', 'status': 'Check'}, {'class': 'Temp', 'name': 'PDM 0', 'status': 'OK'}, {'class': 'Temp', 'name': 'PDM 1', 'status': 'OK'}, {'class': 'Temp', 'name': 'PDM 2', 'status': 'OK'}, {'class': 'Temp', 'name': 'PDM 3', 'status': 'OK'}, {'class': 'Temp', 'name': 'CB 0 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '39 degrees C / 102 degrees F', '@junos:celsius': '39'}}, {'class': 'Temp', 'name': 'CB 0 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '36 degrees C / 96 degrees F', '@junos:celsius': '36'}}, {'class': 'Temp', 'name': 'CB 0 IntakeC-Zone0', 'status': 'OK', 'temperature': {'#text': '51 degrees C / 123 degrees F', '@junos:celsius': '51'}}, {'class': 'Temp', 'name': 'CB 0 ExhaustA-Zone0', 'status': 'OK', 'temperature': {'#text': '40 degrees C / 104 degrees F', '@junos:celsius': '40'}}, {'class': 'Temp', 'name': 'CB 0 ExhaustB-Zone1', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'CB 0 TCBC-Zone0', 'status': 'OK', 'temperature': {'#text': '45 degrees C / 113 degrees F', '@junos:celsius': '45'}}, {'class': 'Temp', 'name': 'CB 1 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'CB 1 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'CB 1 IntakeC-Zone0', 'status': 'OK', 'temperature': {'#text': '33 degrees C / 91 degrees F', '@junos:celsius': '33'}}, {'class': 'Temp', 'name': 'CB 1 ExhaustA-Zone0', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'CB 1 ExhaustB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'CB 1 TCBC-Zone0', 'status': 'OK', 'temperature': {'#text': '39 degrees C / 102 degrees F', '@junos:celsius': '39'}}, {'class': 'Temp', 'name': 'SPMB 0 Intake', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'SPMB 1 Intake', 'status': 'OK', 'temperature': {'#text': '33 degrees C / 91 degrees F', '@junos:celsius': '33'}}, {'class': 'Temp', 'name': 'Routing Engine 0', 'status': 'OK', 'temperature': {'#text': '43 degrees C / 109 degrees F', '@junos:celsius': '43'}}, {'class': 'Temp', 'name': 'Routing Engine 0 CPU', 'status': 'OK', 'temperature': {'#text': '39 degrees C / 102 degrees F', '@junos:celsius': '39'}}, {'class': 'Temp', 'name': 'Routing Engine 1', 'status': 'OK', 'temperature': {'#text': '40 degrees C / 104 degrees F', '@junos:celsius': '40'}}, {'class': 'Temp', 'name': 'Routing Engine 1 CPU', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'SFB 0 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '37 degrees C / 98 degrees F', '@junos:celsius': '37'}}, {'class': 'Temp', 'name': 'SFB 0 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '45 degrees C / 113 degrees F', '@junos:celsius': '45'}}, {'class': 'Temp', 'name': 'SFB 0 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'SFB 0 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 0 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '36 degrees C / 96 degrees F', '@junos:celsius': '36'}}, {'class': 'Temp', 'name': 'SFB 0 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '63 degrees C / 145 degrees F', '@junos:celsius': '63'}}, {'class': 'Temp', 'name': 'SFB 0 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '55 degrees C / 131 degrees F', '@junos:celsius': '55'}}, {'class': 'Temp', 'name': 'SFB 0 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '52 degrees C / 125 degrees F', '@junos:celsius': '52'}}, {'class': 'Temp', 'name': 'SFB 1 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'SFB 1 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '42 degrees C / 107 degrees F', '@junos:celsius': '42'}}, {'class': 'Temp', 'name': 'SFB 1 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'SFB 1 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'SFB 1 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 1 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '63 degrees C / 145 degrees F', '@junos:celsius': '63'}}, {'class': 'Temp', 'name': 'SFB 1 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '53 degrees C / 127 degrees F', '@junos:celsius': '53'}}, {'class': 'Temp', 'name': 'SFB 1 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '50 degrees C / 122 degrees F', '@junos:celsius': '50'}}, {'class': 'Temp', 'name': 'SFB 2 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'SFB 2 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '42 degrees C / 107 degrees F', '@junos:celsius': '42'}}, {'class': 'Temp', 'name': 'SFB 2 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '30 degrees C / 86 degrees F', '@junos:celsius': '30'}}, {'class': 'Temp', 'name': 'SFB 2 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'SFB 2 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 2 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '60 degrees C / 140 degrees F', '@junos:celsius': '60'}}, {'class': 'Temp', 'name': 'SFB 2 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '53 degrees C / 127 degrees F', '@junos:celsius': '53'}}, {'class': 'Temp', 'name': 'SFB 2 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '56 degrees C / 132 degrees F', '@junos:celsius': '56'}}, {'class': 'Temp', 'name': 'SFB 3 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'SFB 3 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '42 degrees C / 107 degrees F', '@junos:celsius': '42'}}, {'class': 'Temp', 'name': 'SFB 3 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'SFB 3 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'SFB 3 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 3 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '61 degrees C / 141 degrees F', '@junos:celsius': '61'}}, {'class': 'Temp', 'name': 'SFB 3 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '53 degrees C / 127 degrees F', '@junos:celsius': '53'}}, {'class': 'Temp', 'name': 'SFB 3 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '50 degrees C / 122 degrees F', '@junos:celsius': '50'}}, {'class': 'Temp', 'name': 'SFB 4 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 4 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '42 degrees C / 107 degrees F', '@junos:celsius': '42'}}, {'class': 'Temp', 'name': 'SFB 4 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'SFB 4 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'SFB 4 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 4 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '64 degrees C / 147 degrees F', '@junos:celsius': '64'}}, {'class': 'Temp', 'name': 'SFB 4 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '53 degrees C / 127 degrees F', '@junos:celsius': '53'}}, {'class': 'Temp', 'name': 'SFB 4 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '50 degrees C / 122 degrees F', '@junos:celsius': '50'}}, {'class': 'Temp', 'name': 'SFB 5 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 5 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '41 degrees C / 105 degrees F', '@junos:celsius': '41'}}, {'class': 'Temp', 'name': 'SFB 5 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'SFB 5 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '31 degrees C / 87 degrees F', '@junos:celsius': '31'}}, {'class': 'Temp', 'name': 'SFB 5 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 5 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '63 degrees C / 145 degrees F', '@junos:celsius': '63'}}, {'class': 'Temp', 'name': 'SFB 5 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '53 degrees C / 127 degrees F', '@junos:celsius': '53'}}, {'class': 'Temp', 'name': 'SFB 5 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '50 degrees C / 122 degrees F', '@junos:celsius': '50'}}, {'class': 'Temp', 'name': 'SFB 6 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 6 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '42 degrees C / 107 degrees F', '@junos:celsius': '42'}}, {'class': 'Temp', 'name': 'SFB 6 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'SFB 6 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'SFB 6 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '34 degrees C / 93 degrees F', '@junos:celsius': '34'}}, {'class': 'Temp', 'name': 'SFB 6 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '62 degrees C / 143 degrees F', '@junos:celsius': '62'}}, {'class': 'Temp', 'name': 'SFB 6 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '53 degrees C / 127 degrees F', '@junos:celsius': '53'}}, {'class': 'Temp', 'name': 'SFB 6 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '49 degrees C / 120 degrees F', '@junos:celsius': '49'}}, {'class': 'Temp', 'name': 'SFB 7 Intake-Zone0', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'SFB 7 Exhaust-Zone1', 'status': 'OK', 'temperature': {'#text': '43 degrees C / 109 degrees F', '@junos:celsius': '43'}}, {'class': 'Temp', 'name': 'SFB 7 IntakeA-Zone0', 'status': 'OK', 'temperature': {'#text': '31 degrees C / 87 degrees F', '@junos:celsius': '31'}}, {'class': 'Temp', 'name': 'SFB 7 IntakeB-Zone1', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'SFB 7 Exhaust-Zone0', 'status': 'OK', 'temperature': {'#text': '35 degrees C / 95 degrees F', '@junos:celsius': '35'}}, {'class': 'Temp', 'name': 'SFB 7 SFB-XF2-Zone1', 'status': 'OK', 'temperature': {'#text': '65 degrees C / 149 degrees F', '@junos:celsius': '65'}}, {'class': 'Temp', 'name': 'SFB 7 SFB-XF1-Zone0', 'status': 'OK', 'temperature': {'#text': '56 degrees C / 132 degrees F', '@junos:celsius': '56'}}, {'class': 'Temp', 'name': 'SFB 7 SFB-XF0-Zone0', 'status': 'OK', 'temperature': {'#text': '52 degrees C / 125 degrees F', '@junos:celsius': '52'}}, {'class': 'Temp', 'name': 'FPC 0 Intake', 'status': 'OK', 'temperature': {'#text': '29 degrees C / 84 degrees F', '@junos:celsius': '29'}}, {'class': 'Temp', 'name': 'FPC 0 Exhaust A', 'status': 'OK', 'temperature': {'#text': '53 degrees C / 127 degrees F', '@junos:celsius': '53'}}, {'class': 'Temp', 'name': 'FPC 0 Exhaust B', 'status': 'OK', 'temperature': {'#text': '54 degrees C / 129 degrees F', '@junos:celsius': '54'}}, {'class': 'Temp', 'name': 'FPC 0 XL 0 TSen', 'status': 'OK', 'temperature': {'#text': '50 degrees C / 122 degrees F', '@junos:celsius': '50'}}, {'class': 'Temp', 'name': 'FPC 0 XL 0 Chip', 'status': 'OK', 'temperature': {'#text': '63 degrees C / 145 degrees F', '@junos:celsius': '63'}}, {'class': 'Temp', 'name': 'FPC 0 XL 0 XR2 0 TSen', 'status': 'OK', 'temperature': {'#text': '50 degrees C / 122 degrees F', '@junos:celsius': '50'}}, {'class': 'Temp', 'name': 'FPC 0 XL 0 XR2 0 Chip', 'status': 'OK', 'temperature': {'#text': '80 degrees C / 176 degrees F', '@junos:celsius': '80'}}, {'class': 'Temp', 'name': 'FPC 0 XL 0 XR2 1 TSen', 'status': 'OK', 'temperature': {'#text': '50 degrees C / 122 degrees F', '@junos:celsius': '50'}}, {'class': 'Temp', 'name': 'FPC 0 XL 0 XR2 1 Chip', 'status': 'OK', 'temperature': {'#text': '80 degrees C / 176 degrees F', '@junos:celsius': '80'}}, {'class': 'Temp', 'name': 'FPC 0 XL 1 TSen', 'status': 'OK', 'temperature': {'#text': '36 degrees C / 96 degrees F', '@junos:celsius': '36'}}, {'class': 'Temp', 'name': 'FPC 0 XL 1 Chip', 'status': 'OK', 'temperature': {'#text': '44 degrees C / 111 degrees F', '@junos:celsius': '44'}}, {'class': 'Temp', 'name': 'FPC 0 XL 1 XR2 0 TSen', 'status': 'OK', 'temperature': {'#text': '36 degrees C / 96 degrees F', '@junos:celsius': '36'}}, {'class': 'Temp', 'name': 'FPC 0 XL 1 XR2 0 Chip', 'status': 'OK', 'temperature': {'#text': '60 degrees C / 140 degrees F', '@junos:celsius': '60'}}, {'class': 'Temp', 'name': 'FPC 0 XL 1 XR2 1 TSen', 'status': 'OK', 'temperature': {'#text': '36 degrees C / 96 degrees F', '@junos:celsius': '36'}}, {'class': 'Temp', 'name': 'FPC 0 XL 1 XR2 1 Chip', 'status': 'OK', 'temperature': {'#text': '59 degrees C / 138 degrees F', '@junos:celsius': '59'}}, {'class': 'Temp', 'name': 'FPC 0 XM 0 TSen', 'status': 'OK', 'temperature': {'#text': '52 degrees C / 125 degrees F', '@junos:celsius': '52'}}, {'class': 'Temp', 'name': 'FPC 0 XM 0 Chip', 'status': 'OK', 'temperature': {'#text': '62 degrees C / 143 degrees F', '@junos:celsius': '62'}}, {'class': 'Temp', 'name': 'FPC 0 XM 1 TSen', 'status': 'OK', 'temperature': {'#text': '52 degrees C / 125 degrees F', '@junos:celsius': '52'}}, {'class': 'Temp', 'name': 'FPC 0 XM 1 Chip', 'status': 'OK', 'temperature': {'#text': '57 degrees C / 134 degrees F', '@junos:celsius': '57'}}, {'class': 'Temp', 'name': 'FPC 0 XM 2 TSen', 'status': 'OK', 'temperature': {'#text': '52 degrees C / 125 degrees F', '@junos:celsius': '52'}}, {'class': 'Temp', 'name': 'FPC 0 XM 2 Chip', 'status': 'OK', 'temperature': {'#text': '51 degrees C / 123 degrees F', '@junos:celsius': '51'}}, {'class': 'Temp', 'name': 'FPC 0 XM 3 TSen', 'status': 'OK', 'temperature': {'#text': '52 degrees C / 125 degrees F', '@junos:celsius': '52'}}, {'class': 'Temp', 'name': 'FPC 0 XM 3 Chip', 'status': 'OK', 'temperature': {'#text': '45 degrees C / 113 degrees F', '@junos:celsius': '45'}}, {'class': 'Temp', 'name': 'FPC 0 PCIe Switch TSen', 'status': 'OK', 'temperature': {'#text': '52 degrees C / 125 degrees F', '@junos:celsius': '52'}}, {'class': 'Temp', 'name': 'FPC 0 PCIe Switch Chip', 'status': 'OK', 'temperature': {'#text': '30 degrees C / 86 degrees F', '@junos:celsius': '30'}}, {'class': 'Temp', 'name': 'FPC 9 Intake', 'status': 'OK', 'temperature': {'#text': '31 degrees C / 87 degrees F', '@junos:celsius': '31'}}, {'class': 'Temp', 'name': 'FPC 9 Exhaust A', 'status': 'OK', 'temperature': {'#text': '48 degrees C / 118 degrees F', '@junos:celsius': '48'}}, {'class': 'Temp', 'name': 'FPC 9 Exhaust B', 'status': 'OK', 'temperature': {'#text': '41 degrees C / 105 degrees F', '@junos:celsius': '41'}}, {'class': 'Temp', 'name': 'FPC 9 LU 0 TCAM TSen', 'status': 'OK', 'temperature': {'#text': '46 degrees C / 114 degrees F', '@junos:celsius': '46'}}, {'class': 'Temp', 'name': 'FPC 9 LU 0 TCAM Chip', 'status': 'OK', 'temperature': {'#text': '55 degrees C / 131 degrees F', '@junos:celsius': '55'}}, {'class': 'Temp', 'name': 'FPC 9 LU 0 TSen', 'status': 'OK', 'temperature': {'#text': '46 degrees C / 114 degrees F', '@junos:celsius': '46'}}, {'class': 'Temp', 'name': 'FPC 9 LU 0 Chip', 'status': 'OK', 'temperature': {'#text': '55 degrees C / 131 degrees F', '@junos:celsius': '55'}}, {'class': 'Temp', 'name': 'FPC 9 MQ 0 TSen', 'status': 'OK', 'temperature': {'#text': '46 degrees C / 114 degrees F', '@junos:celsius': '46'}}, {'class': 'Temp', 'name': 'FPC 9 MQ 0 Chip', 'status': 'OK', 'temperature': {'#text': '57 degrees C / 134 degrees F', '@junos:celsius': '57'}}, {'class': 'Temp', 'name': 'FPC 9 LU 1 TCAM TSen', 'status': 'OK', 'temperature': {'#text': '41 degrees C / 105 degrees F', '@junos:celsius': '41'}}, {'class': 'Temp', 'name': 'FPC 9 LU 1 TCAM Chip', 'status': 'OK', 'temperature': {'#text': '46 degrees C / 114 degrees F', '@junos:celsius': '46'}}, {'class': 'Temp', 'name': 'FPC 9 LU 1 TSen', 'status': 'OK', 'temperature': {'#text': '41 degrees C / 105 degrees F', '@junos:celsius': '41'}}, {'class': 'Temp', 'name': 'FPC 9 LU 1 Chip', 'status': 'OK', 'temperature': {'#text': '47 degrees C / 116 degrees F', '@junos:celsius': '47'}}, {'class': 'Temp', 'name': 'FPC 9 MQ 1 TSen', 'status': 'OK', 'temperature': {'#text': '41 degrees C / 105 degrees F', '@junos:celsius': '41'}}, {'class': 'Temp', 'name': 'FPC 9 MQ 1 Chip', 'status': 'OK', 'temperature': {'#text': '47 degrees C / 116 degrees F', '@junos:celsius': '47'}}, {'class': 'Temp', 'name': 'ADC 9 Intake', 'status': 'OK', 'temperature': {'#text': '32 degrees C / 89 degrees F', '@junos:celsius': '32'}}, {'class': 'Temp', 'name': 'ADC 9 Exhaust', 'status': 'OK', 'temperature': {'#text': '42 degrees C / 107 degrees F', '@junos:celsius': '42'}}, {'class': 'Temp', 'name': 'ADC 9 ADC-XF1', 'status': 'OK', 'temperature': {'#text': '49 degrees C / 120 degrees F', '@junos:celsius': '49'}}, {'class': 'Temp', 'name': 'ADC 9 ADC-XF0', 'status': 'OK', 'temperature': {'#text': '59 degrees C / 138 degrees F', '@junos:celsius': '59'}}, {'class': 'Fans', 'comment': '2760 RPM', 'name': 'Fan Tray 0 Fan 1', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 0 Fan 2', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 0 Fan 3', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 0 Fan 4', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 0 Fan 5', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 0 Fan 6', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 1 Fan 1', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 1 Fan 2', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 1 Fan 3', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 1 Fan 4', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 1 Fan 5', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 1 Fan 6', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 2 Fan 1', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 2 Fan 2', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 2 Fan 3', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 2 Fan 4', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 2 Fan 5', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 2 Fan 6', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 3 Fan 1', 'status': 'OK'}, {'class': 'Fans', 'comment': '2400 RPM', 'name': 'Fan Tray 3 Fan 2', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 3 Fan 3', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 3 Fan 4', 'status': 'OK'}, {'class': 'Fans', 'comment': '2640 RPM', 'name': 'Fan Tray 3 Fan 5', 'status': 'OK'}, {'class': 'Fans', 'comment': '2520 RPM', 'name': 'Fan Tray 3 Fan 6', 'status': 'OK'}]}} |
# Declan Barr 19 Mar 2018
# Script that contains function sumultiply that takes two integer arguments and
# returns their product. Does this without the * or / operators
def sumultiply(x, y):
sumof = 0
for i in range(1, x+1):
sumof = sumof + y
return sumof
print(sumultiply(11, 13))
print(sumultiply(5, 123))
| def sumultiply(x, y):
sumof = 0
for i in range(1, x + 1):
sumof = sumof + y
return sumof
print(sumultiply(11, 13))
print(sumultiply(5, 123)) |
class Node:
def __init__(self, value, child, parent):
self._value = value
self._child = child
self._parent = parent
def get_value(self):
#Return the value of a node
return self._value
def get_child(self):
#Return the value of a node
return self._child
def get_parent(self):
#Return the parent of a node
return self._parent
def set_value(self, value):
#Change the value of a node
self._value = value
def set_child(self, child):
#Change the value of a node
self._child = child
def set_parent(self, parent):
#Change the parent reference
self._parent = parent | class Node:
def __init__(self, value, child, parent):
self._value = value
self._child = child
self._parent = parent
def get_value(self):
return self._value
def get_child(self):
return self._child
def get_parent(self):
return self._parent
def set_value(self, value):
self._value = value
def set_child(self, child):
self._child = child
def set_parent(self, parent):
self._parent = parent |
def find_sum(arr, s):
curr_sum = arr[0]
start = 0
n = len(arr) - 1
i = 1
while i <= n:
while curr_sum > s and start < i:
curr_sum = curr_sum - arr[start]
start += 1
if curr_sum == s:
return "Found between {} and {}".format(start, i - 1)
curr_sum = curr_sum + arr[i]
i += 1
return "Sum not found"
arr = [15, 2, 4, 8, 9, 5, 10, 23]
print(find_sum(arr, 6))
| def find_sum(arr, s):
curr_sum = arr[0]
start = 0
n = len(arr) - 1
i = 1
while i <= n:
while curr_sum > s and start < i:
curr_sum = curr_sum - arr[start]
start += 1
if curr_sum == s:
return 'Found between {} and {}'.format(start, i - 1)
curr_sum = curr_sum + arr[i]
i += 1
return 'Sum not found'
arr = [15, 2, 4, 8, 9, 5, 10, 23]
print(find_sum(arr, 6)) |
class HoloResponse:
def __init__(self, success, response=None):
self.success = success
if response != None:
self.response = response
| class Holoresponse:
def __init__(self, success, response=None):
self.success = success
if response != None:
self.response = response |
x = float(1)
y = float(2.8)
z = float("3")
w = float("4.2")
print(x)
print(y)
print(z)
print(w)
# Author: Bryan G
| x = float(1)
y = float(2.8)
z = float('3')
w = float('4.2')
print(x)
print(y)
print(z)
print(w) |
def capture_high_res(filename):
return "./camerapi/tmp_large.jpg"
def capture_low_res(filename):
return "./camerapi/tmp_small.jpg"
def init():
return
def deinit():
return
| def capture_high_res(filename):
return './camerapi/tmp_large.jpg'
def capture_low_res(filename):
return './camerapi/tmp_small.jpg'
def init():
return
def deinit():
return |
'''
Constants
---
Constants used in other scripts. These are mostly interpretations of fields
provided in the Face2Gene jsons.
'''
HGVS_ERRORDICT_VERSION = 0
# Bucket name, from where Face2Gene vcf and json files will be downloaded
AWS_BUCKET_NAME = "fdna-pedia-dump"
# caching directory
CACHE_DIR = ".cache"
# tests that count as chromosomal tests, if these are positive, cases will be
# excluded
CHROMOSOMAL_TESTS = [
'CHROMOSOMAL_MICROARRAY',
'FISH',
'KARYOTYPE'
]
# Test result descriptions, that will be counted as positive for our case
# selection criteria
POSITIVE_RESULTS = [
'ABNORMAL',
'ABNORMAL_DIAGNOSTIC',
'DELETION_DUPLICATION',
'VARIANTS_DETECTED'
]
NEGATIVE_RESULTS = [
'NORMAL'
'NORMAL_FEMALE'
'NORMAL_MALE'
'NO_SIGNIFICANT_VARIANTS'
]
# Translation of Face2Gene Mutation notation to HGVS operators
HGVS_OPS = {
'SUBSTITUTION': '>',
'DELETION': 'del',
'DUPLICATION': 'dup',
'INSERTION': 'ins',
'INVERSION': 'inv',
'DELETION_INSERTION': 'delins',
'UNKNOWN': ''
}
# Translation of Description levels in Face2Gene to HGVS sequence types
HGVS_PREFIX = {
'CDNA_LEVEL': 'c',
'PROTEIN_LEVEL': 'p',
'GENOMIC_DNA_LEVEL': 'g',
'UNKNOWN': '',
'RS_NUMBER': ''
}
# blacklist HPO illegal hpo terms
ILLEGAL_HPO = [
'HP:0000006' # autosomal-dominant inheritance
]
CONFIRMED_DIAGNOSIS = [
"MOLECULARLY_DIAGNOSED",
"CLINICALLY_DIAGNOSED",
"CORRECTED_DIAGNOSIS"
]
DIFFERENTIAL_DIAGNOSIS = [
"DIFFERENTIAL_DIAGNOSIS",
]
| """
Constants
---
Constants used in other scripts. These are mostly interpretations of fields
provided in the Face2Gene jsons.
"""
hgvs_errordict_version = 0
aws_bucket_name = 'fdna-pedia-dump'
cache_dir = '.cache'
chromosomal_tests = ['CHROMOSOMAL_MICROARRAY', 'FISH', 'KARYOTYPE']
positive_results = ['ABNORMAL', 'ABNORMAL_DIAGNOSTIC', 'DELETION_DUPLICATION', 'VARIANTS_DETECTED']
negative_results = ['NORMALNORMAL_FEMALENORMAL_MALENO_SIGNIFICANT_VARIANTS']
hgvs_ops = {'SUBSTITUTION': '>', 'DELETION': 'del', 'DUPLICATION': 'dup', 'INSERTION': 'ins', 'INVERSION': 'inv', 'DELETION_INSERTION': 'delins', 'UNKNOWN': ''}
hgvs_prefix = {'CDNA_LEVEL': 'c', 'PROTEIN_LEVEL': 'p', 'GENOMIC_DNA_LEVEL': 'g', 'UNKNOWN': '', 'RS_NUMBER': ''}
illegal_hpo = ['HP:0000006']
confirmed_diagnosis = ['MOLECULARLY_DIAGNOSED', 'CLINICALLY_DIAGNOSED', 'CORRECTED_DIAGNOSIS']
differential_diagnosis = ['DIFFERENTIAL_DIAGNOSIS'] |
def f(x):
return ((2*(x**4))+(3*(x**3))-(6*(x**2))+(5*x)-8)
def reachEnd(previousm,currentm):
if abs(previousm - currentm) <= 10**(-6):
return True
return False
def printFormat(a,b,c,m,count):
print("Step %s" %count)
print("a=%.6f b=%.6f c=%.6f" %(a,b,c))
print("f(a)=%.6f f(b)=%.6f f(c)=%.6f" %(f(a),f(b),f(c)))
print("m=%.6f f(m)=%.6f" %(m,f(m)))
def main(a,b,c):
if (not (a < b and c < b)) or (not(f(a) > f(c) and f(b) > f(c))):
return False
count = 0
previousm = b+1
while True:
if (b - c) >= (c - a):
m = (b+c)/2
if f(m) >= f(c):
b = m
else:
a = c
c = m
else:
m = (a+c)/2
if f(m) >= f(c):
a = m
else:
b = c
c = m
printFormat(a,b,c,m,count)
if reachEnd(previousm,m):
print("Minimum value=%.6f occurring at %.6f" %(f(m),m))
break
previousm = m
count += 1
main(-3,-1,-2.2)
| def f(x):
return 2 * x ** 4 + 3 * x ** 3 - 6 * x ** 2 + 5 * x - 8
def reach_end(previousm, currentm):
if abs(previousm - currentm) <= 10 ** (-6):
return True
return False
def print_format(a, b, c, m, count):
print('Step %s' % count)
print('a=%.6f b=%.6f c=%.6f' % (a, b, c))
print('f(a)=%.6f f(b)=%.6f f(c)=%.6f' % (f(a), f(b), f(c)))
print('m=%.6f f(m)=%.6f' % (m, f(m)))
def main(a, b, c):
if not (a < b and c < b) or not (f(a) > f(c) and f(b) > f(c)):
return False
count = 0
previousm = b + 1
while True:
if b - c >= c - a:
m = (b + c) / 2
if f(m) >= f(c):
b = m
else:
a = c
c = m
else:
m = (a + c) / 2
if f(m) >= f(c):
a = m
else:
b = c
c = m
print_format(a, b, c, m, count)
if reach_end(previousm, m):
print('Minimum value=%.6f occurring at %.6f' % (f(m), m))
break
previousm = m
count += 1
main(-3, -1, -2.2) |
class Solution:
def spiralOrder(self, matrix: List[List[int]]) -> List[int]:
result = []
rows, columns = len(matrix), len(matrix[0])
up = left = 0
right = columns-1
down = rows-1
while len(result) < rows*columns:
for col in range(left, right+1):
result.append(matrix[up][col])
for row in range(up+1, down+1):
result.append(matrix[row][right])
if up != down:
for col in range(right-1, left-1, -1):
result.append(matrix[down][col])
if left != right:
for row in range(down-1, up, -1):
result.append(matrix[row][left])
up += 1
down -= 1
left += 1
right -= 1
return result
| class Solution:
def spiral_order(self, matrix: List[List[int]]) -> List[int]:
result = []
(rows, columns) = (len(matrix), len(matrix[0]))
up = left = 0
right = columns - 1
down = rows - 1
while len(result) < rows * columns:
for col in range(left, right + 1):
result.append(matrix[up][col])
for row in range(up + 1, down + 1):
result.append(matrix[row][right])
if up != down:
for col in range(right - 1, left - 1, -1):
result.append(matrix[down][col])
if left != right:
for row in range(down - 1, up, -1):
result.append(matrix[row][left])
up += 1
down -= 1
left += 1
right -= 1
return result |
class NoProxy:
def get(self, _):
return None
def ban_proxy(self, proxies):
return None
class RateLimitProxy:
def __init__(self, proxies, paths, default=None):
self.proxies = proxies
self.proxy_count = len(proxies)
self.access_counter = {
path: {"limit": paths[path], "count": 0} for path in paths.keys()
}
self.default = {"http": default, "https": default}
def get(self, keyword_arguments):
counter = self.access_counter.get(keyword_arguments["path"])
if counter is not None:
proxy = self.proxies[
(counter["count"] // counter["limit"] - self.proxy_count)
% self.proxy_count
]
counter["count"] += 1
return {"http": proxy, "https": proxy}
return self.default
def ban_proxy(self, proxies):
self.proxies = list(filter(lambda a: a not in [proxies.get("http", ''), proxies.get("https", '')], self.proxies))
return None
| class Noproxy:
def get(self, _):
return None
def ban_proxy(self, proxies):
return None
class Ratelimitproxy:
def __init__(self, proxies, paths, default=None):
self.proxies = proxies
self.proxy_count = len(proxies)
self.access_counter = {path: {'limit': paths[path], 'count': 0} for path in paths.keys()}
self.default = {'http': default, 'https': default}
def get(self, keyword_arguments):
counter = self.access_counter.get(keyword_arguments['path'])
if counter is not None:
proxy = self.proxies[(counter['count'] // counter['limit'] - self.proxy_count) % self.proxy_count]
counter['count'] += 1
return {'http': proxy, 'https': proxy}
return self.default
def ban_proxy(self, proxies):
self.proxies = list(filter(lambda a: a not in [proxies.get('http', ''), proxies.get('https', '')], self.proxies))
return None |
months_json = {
"1": "January",
"2": "February",
"3": "March",
"4": "April",
"5": "May",
"6": "June",
"7": "July",
"8": "August",
"9": "September",
"01": "January",
"02": "February",
"03": "March",
"04": "April",
"05": "May",
"06": "June",
"07": "July",
"08": "August",
"09": "September",
"10": "October",
"11": "November",
"12": "December",
}
month_days = {
"1": 31,
"2": 28,
"3": 31,
"4": 30,
"5": 31,
"6": 30,
"7": 31,
"8": 31,
"9": 30,
"01": 31,
"02": 28,
"03": 31,
"04": 30,
"05": 31,
"06": 30,
"07": 31,
"08": 31,
"09": 30,
"10": 31,
"11": 30,
"12": 31,
}
| months_json = {'1': 'January', '2': 'February', '3': 'March', '4': 'April', '5': 'May', '6': 'June', '7': 'July', '8': 'August', '9': 'September', '01': 'January', '02': 'February', '03': 'March', '04': 'April', '05': 'May', '06': 'June', '07': 'July', '08': 'August', '09': 'September', '10': 'October', '11': 'November', '12': 'December'}
month_days = {'1': 31, '2': 28, '3': 31, '4': 30, '5': 31, '6': 30, '7': 31, '8': 31, '9': 30, '01': 31, '02': 28, '03': 31, '04': 30, '05': 31, '06': 30, '07': 31, '08': 31, '09': 30, '10': 31, '11': 30, '12': 31} |
#coding: utf-8
'''
@Time: 2019/4/25 11:15
@Author: fangyoucai
'''
| """
@Time: 2019/4/25 11:15
@Author: fangyoucai
""" |
__all__ = ['EncryptException', 'DecryptException', 'DefaultKeyNotSet', 'NoValidKeyFound']
class EncryptException(BaseException):
pass
class DecryptException(BaseException):
pass
class DefaultKeyNotSet(EncryptException):
pass
class NoValidKeyFound(DecryptException):
pass
| __all__ = ['EncryptException', 'DecryptException', 'DefaultKeyNotSet', 'NoValidKeyFound']
class Encryptexception(BaseException):
pass
class Decryptexception(BaseException):
pass
class Defaultkeynotset(EncryptException):
pass
class Novalidkeyfound(DecryptException):
pass |
#
# @lc app=leetcode id=86 lang=python3
#
# [86] Partition List
#
# https://leetcode.com/problems/partition-list/description/
#
# algorithms
# Medium (43.12%)
# Likes: 1981
# Dislikes: 384
# Total Accepted: 256.4K
# Total Submissions: 585.7K
# Testcase Example: '[1,4,3,2,5,2]\n3'
#
# Given the head of a linked list and a value x, partition it such that all
# nodes less than x come before nodes greater than or equal to x.
#
# You should preserve the original relative order of the nodes in each of the
# two partitions.
#
#
# Example 1:
#
#
# Input: head = [1,4,3,2,5,2], x = 3
# Output: [1,2,2,4,3,5]
#
#
# Example 2:
#
#
# Input: head = [2,1], x = 2
# Output: [1,2]
#
#
#
# Constraints:
#
#
# The number of nodes in the list is in the range [0, 200].
# -100 <= Node.val <= 100
# -200 <= x <= 200
#
#
#
# @lc code=start
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def partition(self, head: ListNode, x: int) -> ListNode:
if not head:
return head
smaller_dummy = ListNode(0)
greater_dummy = ListNode(0)
smaller = smaller_dummy
greater = greater_dummy
node = head
while node:
if node.val < x:
smaller.next = node
smaller = smaller.next
else:
greater.next = node
greater = greater.next
node = node.next
greater.next = None
smaller.next = greater_dummy.next
return smaller_dummy.next
# @lc code=end
| class Solution:
def partition(self, head: ListNode, x: int) -> ListNode:
if not head:
return head
smaller_dummy = list_node(0)
greater_dummy = list_node(0)
smaller = smaller_dummy
greater = greater_dummy
node = head
while node:
if node.val < x:
smaller.next = node
smaller = smaller.next
else:
greater.next = node
greater = greater.next
node = node.next
greater.next = None
smaller.next = greater_dummy.next
return smaller_dummy.next |
with open("input.txt", "r") as input_file:
input = input_file.read().split("\n")
passwords = list(map(lambda line: [list(map(int, line.split(" ")[0].split("-"))), line.split(" ")[1][0], line.split(" ")[2]], input))
valid = 0
for password in passwords:
count_letter = password[2].count(password[1])
if password[0][0] <= count_letter <= password[0][1]:
valid += 1
print(valid)
| with open('input.txt', 'r') as input_file:
input = input_file.read().split('\n')
passwords = list(map(lambda line: [list(map(int, line.split(' ')[0].split('-'))), line.split(' ')[1][0], line.split(' ')[2]], input))
valid = 0
for password in passwords:
count_letter = password[2].count(password[1])
if password[0][0] <= count_letter <= password[0][1]:
valid += 1
print(valid) |
music = {
'kb': '''
Instrument(Flute)
Piece(Undine, Reinecke)
Piece(Carmen, Bourne)
(Instrument(x) & Piece(w, c) & Era(c, r)) ==> Program(w)
Era(Reinecke, Romantic)
Era(Bourne, Romantic)
''',
'queries': '''
Program(x)
''',
}
life = {
'kb': '''
Musician(x) ==> Stressed(x)
(Student(x) & Text(y)) ==> Stressed(x)
Musician(Heather)
''',
'queries': '''
Stressed(x)
'''
}
Examples = {
'music': music,
'life': life
} | music = {'kb': '\nInstrument(Flute)\nPiece(Undine, Reinecke)\nPiece(Carmen, Bourne)\n\n\n(Instrument(x) & Piece(w, c) & Era(c, r)) ==> Program(w)\nEra(Reinecke, Romantic)\nEra(Bourne, Romantic)\n\n\n ', 'queries': '\n Program(x)\n '}
life = {'kb': '\nMusician(x) ==> Stressed(x)\n(Student(x) & Text(y)) ==> Stressed(x)\n\nMusician(Heather)\n ', 'queries': '\nStressed(x)\n '}
examples = {'music': music, 'life': life} |
myl1 = []
num = int(input("Enter the number of elements: "))
for loop in range(num):
myl1.append(input(f"Enter element at index {loop} : "))
print(myl1)
print(type(myl1))
myt1 = tuple(myl1)
print(myt1)
print(type(myt1))
print("The elements of tuple object are: ")
for loop in myt1:
print(loop) | myl1 = []
num = int(input('Enter the number of elements: '))
for loop in range(num):
myl1.append(input(f'Enter element at index {loop} : '))
print(myl1)
print(type(myl1))
myt1 = tuple(myl1)
print(myt1)
print(type(myt1))
print('The elements of tuple object are: ')
for loop in myt1:
print(loop) |
# Scrapy settings for scraper project
BOT_NAME = 'scraper'
SPIDER_MODULES = ['scraper.spiders']
NEWSPIDER_MODULE = 'scraper.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = 'Googlebot-News'
# Obey robots.txt rules
ROBOTSTXT_OBEY = True
# MONGO URI for accessing MongoDB
MONGO_URI = ""
MONGO_DATABASE = ""
# sqlite database location
SQLITE_DB = ""
# pipelines are disabled by default
ITEM_PIPELINES = {
#'scraper.pipelines.SQLitePipeline': 300,
#'scraper.pipelines.MongoPipeline': 600,
}
| bot_name = 'scraper'
spider_modules = ['scraper.spiders']
newspider_module = 'scraper.spiders'
user_agent = 'Googlebot-News'
robotstxt_obey = True
mongo_uri = ''
mongo_database = ''
sqlite_db = ''
item_pipelines = {} |
## Data Categorisation
'''
1) Whole Number (Ints) - 100, 1000, -450, 999
2) Real Numbers (Floats) - 33.33, 44.01, -1000.033
3) String - "Bangalore", "India", "Raj", "abc123"
4) Boolean - True, False
Variables in python are dynamic in nature
'''
a = 10
print(a)
print(type(a))
a = 10.33
print(a)
print(type(a))
a = 'New Jersey'
print(a)
print(type(a))
| """
1) Whole Number (Ints) - 100, 1000, -450, 999
2) Real Numbers (Floats) - 33.33, 44.01, -1000.033
3) String - "Bangalore", "India", "Raj", "abc123"
4) Boolean - True, False
Variables in python are dynamic in nature
"""
a = 10
print(a)
print(type(a))
a = 10.33
print(a)
print(type(a))
a = 'New Jersey'
print(a)
print(type(a)) |
class RelationType(object):
ONE_TO_MANY = "one_to_many"
ONE_TO_ONE = "one_to_one"
class Relation(object):
def __init__(self, cls):
self.cls = cls
class HasOne(Relation):
def get(self, id):
return self.cls.get(id=id)
class HasMany(Relation):
def get(self, id):
value = []
tokens = id.split(",")
for token in tokens:
value += (self.cls.get(id=token.strip()))
return value
| class Relationtype(object):
one_to_many = 'one_to_many'
one_to_one = 'one_to_one'
class Relation(object):
def __init__(self, cls):
self.cls = cls
class Hasone(Relation):
def get(self, id):
return self.cls.get(id=id)
class Hasmany(Relation):
def get(self, id):
value = []
tokens = id.split(',')
for token in tokens:
value += self.cls.get(id=token.strip())
return value |
description = 'Alphai alias device'
group = 'lowlevel'
devices = dict(
alphai = device('nicos.devices.generic.DeviceAlias'),
)
| description = 'Alphai alias device'
group = 'lowlevel'
devices = dict(alphai=device('nicos.devices.generic.DeviceAlias')) |
{
'targets': [
{
'target_name': 'overlay_window',
'sources': [
'src/lib/addon.c',
'src/lib/napi_helpers.c'
],
'include_dirs': [
'src/lib'
],
'conditions': [
['OS=="win"', {
'defines': [
'WIN32_LEAN_AND_MEAN'
],
'link_settings': {
'libraries': [
'oleacc.lib'
]
},
'sources': [
'src/lib/windows.c',
]
}],
['OS=="linux"', {
'defines': [
'_GNU_SOURCE'
],
'link_settings': {
'libraries': [
'-lxcb', '-lpthread'
]
},
'cflags': ['-std=c99', '-pedantic', '-Wall', '-pthread'],
'sources': [
'src/lib/x11.c',
]
}],
['OS=="mac"', {
'link_settings': {
'libraries': [
'-lpthread', '-framework AppKit', '-framework ApplicationServices'
]
},
'xcode_settings': {
'OTHER_CFLAGS': [
'-fobjc-arc'
]
},
'cflags': ['-std=c99', '-pedantic', '-Wall', '-pthread'],
'sources': [
'src/lib/mac.mm',
'src/lib/mac/OWFullscreenObserver.mm'
]
}]
]
}
]
}
| {'targets': [{'target_name': 'overlay_window', 'sources': ['src/lib/addon.c', 'src/lib/napi_helpers.c'], 'include_dirs': ['src/lib'], 'conditions': [['OS=="win"', {'defines': ['WIN32_LEAN_AND_MEAN'], 'link_settings': {'libraries': ['oleacc.lib']}, 'sources': ['src/lib/windows.c']}], ['OS=="linux"', {'defines': ['_GNU_SOURCE'], 'link_settings': {'libraries': ['-lxcb', '-lpthread']}, 'cflags': ['-std=c99', '-pedantic', '-Wall', '-pthread'], 'sources': ['src/lib/x11.c']}], ['OS=="mac"', {'link_settings': {'libraries': ['-lpthread', '-framework AppKit', '-framework ApplicationServices']}, 'xcode_settings': {'OTHER_CFLAGS': ['-fobjc-arc']}, 'cflags': ['-std=c99', '-pedantic', '-Wall', '-pthread'], 'sources': ['src/lib/mac.mm', 'src/lib/mac/OWFullscreenObserver.mm']}]]}]} |
# ---------------------------------------------------------------------
# Gufo Labs Loader:
# a plugin
# ---------------------------------------------------------------------
# Copyright (C) 2022, Gufo Labs
# ---------------------------------------------------------------------
class APlugin(object):
name = "a"
def get_name(self) -> str:
return self.name
| class Aplugin(object):
name = 'a'
def get_name(self) -> str:
return self.name |
class InvalidProxyType(Exception): pass
class ApiConnectionError(Exception): pass
class ApplicationNotFound(Exception): pass
class SqlmapFailedStart(Exception): pass
class SpiderTestFailure(Exception): pass
class InvalidInputProvided(Exception): pass
class InvalidTamperProvided(Exception): pass
class PortScanTimeOutException(Exception): pass | class Invalidproxytype(Exception):
pass
class Apiconnectionerror(Exception):
pass
class Applicationnotfound(Exception):
pass
class Sqlmapfailedstart(Exception):
pass
class Spidertestfailure(Exception):
pass
class Invalidinputprovided(Exception):
pass
class Invalidtamperprovided(Exception):
pass
class Portscantimeoutexception(Exception):
pass |
test = { 'name': 'q1_3',
'points': 1,
'suites': [ { 'cases': [ {'code': '>>> type(max_estimate) in set([int, np.int32, np.int64])\nTrue', 'hidden': False, 'locked': False},
{'code': '>>> max_estimate in observations.column(0)\nTrue', 'hidden': False, 'locked': False}],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
| test = {'name': 'q1_3', 'points': 1, 'suites': [{'cases': [{'code': '>>> type(max_estimate) in set([int, np.int32, np.int64])\nTrue', 'hidden': False, 'locked': False}, {'code': '>>> max_estimate in observations.column(0)\nTrue', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]} |
TYPES = {"int","float","str","bool","list"}
MATCH_TYPES = {"int": int, "float": float, "str": str, "bool": bool, "list": list}
CONSTRAINTS = {
"is_same_type": lambda x, y: type(x) == type(y),
"int" :{
"min_inc": lambda integer, min: integer >= min,
"min_exc": lambda integer, min: integer > min,
"max_inc": lambda integer, max: integer >= max,
"max_exc": lambda integer, max: integer > max,
"value_in": lambda integer, value_in: integer in value_in,
"value_out": lambda integer, value_out: not integer in value_out
},
"float": {
"min_inc": lambda integer, min: integer >= min,
"min_exc": lambda integer, min: integer > min,
"max_inc": lambda integer, max: integer >= max,
"max_exc": lambda integer, max: integer > max,
"value_in": lambda float_, value_in: float_ in value_in,
"value_out": lambda float_, value_out: not float_ in value_out
},
"str": {
"value_in": lambda string, value_in: string in value_in,
"value_out": lambda string, value_out: not string in value_out
},
"list": {
"equal_len": lambda list_, len_: len(list_) == len_,
"min_len" : lambda list_, min_len: len(list_) >= min_len,
"min_inc": lambda list_, min: all(x >= min for x in list_),
"min_exc": lambda list_, min: all(x > min for x in list_),
"max_inc": lambda list_, max: all(x <= max for x in list_),
"max_exc": lambda list_, max: all(x > max for x in list_)
}
}
CONSTRAINT_CHECKS = {
"int" :{
"min_inc": lambda min: type(min) in [int, float],
"min_exc": lambda min: type(min) in [int, float],
"max_inc": lambda max: type(max) in [int, float],
"max_exc": lambda max: type(max) in [int, float],
"value_in": lambda value_in: all([type(value) == int for value in value_in]),
"value_out": lambda value_out: all([type(value) == int for value in value_out])
},
"float": {
"min_inc": lambda min: type(min) in [int, float],
"min_exc": lambda min: type(min) in [int, float],
"max_inc": lambda max: type(max) in [int, float],
"max_exc": lambda max: type(max) in [int, float],
"value_in": lambda value_in: all([type(value) in [int,float] for value in value_in]),
"value_out": lambda value_out: all([type(value) in [int,float] for value in value_out])
},
"str": {
"value_in": lambda value_in: all([type(value) == str for value in value_in]),
"value_out": lambda value_out: all([type(value) == str for value in value_out])
},
"list": {
"equal_len": lambda len_: type(len_) == int and len_ > 0,
"min_len" : lambda min: type(min) == int and min >= 0,
"min_inc": lambda min: type(min) in [int,float],
"min_exc": lambda min: type(min) in [int,float],
"max_inc": lambda max: type(max) in [int,float],
"max_exc": lambda max: type(max) in [int,float],
}
}
| types = {'int', 'float', 'str', 'bool', 'list'}
match_types = {'int': int, 'float': float, 'str': str, 'bool': bool, 'list': list}
constraints = {'is_same_type': lambda x, y: type(x) == type(y), 'int': {'min_inc': lambda integer, min: integer >= min, 'min_exc': lambda integer, min: integer > min, 'max_inc': lambda integer, max: integer >= max, 'max_exc': lambda integer, max: integer > max, 'value_in': lambda integer, value_in: integer in value_in, 'value_out': lambda integer, value_out: not integer in value_out}, 'float': {'min_inc': lambda integer, min: integer >= min, 'min_exc': lambda integer, min: integer > min, 'max_inc': lambda integer, max: integer >= max, 'max_exc': lambda integer, max: integer > max, 'value_in': lambda float_, value_in: float_ in value_in, 'value_out': lambda float_, value_out: not float_ in value_out}, 'str': {'value_in': lambda string, value_in: string in value_in, 'value_out': lambda string, value_out: not string in value_out}, 'list': {'equal_len': lambda list_, len_: len(list_) == len_, 'min_len': lambda list_, min_len: len(list_) >= min_len, 'min_inc': lambda list_, min: all((x >= min for x in list_)), 'min_exc': lambda list_, min: all((x > min for x in list_)), 'max_inc': lambda list_, max: all((x <= max for x in list_)), 'max_exc': lambda list_, max: all((x > max for x in list_))}}
constraint_checks = {'int': {'min_inc': lambda min: type(min) in [int, float], 'min_exc': lambda min: type(min) in [int, float], 'max_inc': lambda max: type(max) in [int, float], 'max_exc': lambda max: type(max) in [int, float], 'value_in': lambda value_in: all([type(value) == int for value in value_in]), 'value_out': lambda value_out: all([type(value) == int for value in value_out])}, 'float': {'min_inc': lambda min: type(min) in [int, float], 'min_exc': lambda min: type(min) in [int, float], 'max_inc': lambda max: type(max) in [int, float], 'max_exc': lambda max: type(max) in [int, float], 'value_in': lambda value_in: all([type(value) in [int, float] for value in value_in]), 'value_out': lambda value_out: all([type(value) in [int, float] for value in value_out])}, 'str': {'value_in': lambda value_in: all([type(value) == str for value in value_in]), 'value_out': lambda value_out: all([type(value) == str for value in value_out])}, 'list': {'equal_len': lambda len_: type(len_) == int and len_ > 0, 'min_len': lambda min: type(min) == int and min >= 0, 'min_inc': lambda min: type(min) in [int, float], 'min_exc': lambda min: type(min) in [int, float], 'max_inc': lambda max: type(max) in [int, float], 'max_exc': lambda max: type(max) in [int, float]}} |
def main():
video = "NET20070330_thlep_1_2"
file_path = "optical_flow_features_train/" + video
optical_flow_features_train = open(file_path + "/optical_flow_features_train.txt", "r")
clear_of_features_train = open(file_path + "/clear_opt_flow_features_train.txt", "w")
visual_ids = []
for line in optical_flow_features_train:
words = line.rstrip().split(' ')
if len(words) == 2:
if not int(words[1]) in visual_ids:
visual_ids.append(int(words[1]))
print("visual_ids", visual_ids)
optical_flow_features_train.close()
optical_flow_features_train = open(file_path + "/optical_flow_features_train.txt", "r")
for line in optical_flow_features_train:
words = line.rstrip().split(' ')
if len(words) == 2:
frame = int(words[0])
speaker_id = int(words[1])
else:
# every id that each speaker gets during the video
if speaker_id == 0 or speaker_id == 6 or speaker_id == 13 or speaker_id == 15 or speaker_id == 5 or speaker_id == 16 or speaker_id == 4 or speaker_id == 17 or speaker_id == 3 or speaker_id == 18:
clear_of_features_train.write(str(frame) + ' ' + str(speaker_id) + '\n')
for features in words:
clear_of_features_train.write(str(features) + ' ')
clear_of_features_train.write('\n')
optical_flow_features_train.close()
clear_of_features_train.close()
if __name__ == "__main__":
main()
| def main():
video = 'NET20070330_thlep_1_2'
file_path = 'optical_flow_features_train/' + video
optical_flow_features_train = open(file_path + '/optical_flow_features_train.txt', 'r')
clear_of_features_train = open(file_path + '/clear_opt_flow_features_train.txt', 'w')
visual_ids = []
for line in optical_flow_features_train:
words = line.rstrip().split(' ')
if len(words) == 2:
if not int(words[1]) in visual_ids:
visual_ids.append(int(words[1]))
print('visual_ids', visual_ids)
optical_flow_features_train.close()
optical_flow_features_train = open(file_path + '/optical_flow_features_train.txt', 'r')
for line in optical_flow_features_train:
words = line.rstrip().split(' ')
if len(words) == 2:
frame = int(words[0])
speaker_id = int(words[1])
elif speaker_id == 0 or speaker_id == 6 or speaker_id == 13 or (speaker_id == 15) or (speaker_id == 5) or (speaker_id == 16) or (speaker_id == 4) or (speaker_id == 17) or (speaker_id == 3) or (speaker_id == 18):
clear_of_features_train.write(str(frame) + ' ' + str(speaker_id) + '\n')
for features in words:
clear_of_features_train.write(str(features) + ' ')
clear_of_features_train.write('\n')
optical_flow_features_train.close()
clear_of_features_train.close()
if __name__ == '__main__':
main() |
prize_file_1 = open("/Users/MatBook/Downloads/prize3.txt")
List = []
prizes = []
for line in prize_file_1:
List.append(int(line))
first_line = List.pop(0)
for i in List:
print(i)
for j in List:
if i + j == first_line:
prizes.append((i,j))
print (List)
print( "you can have:", prizes)
| prize_file_1 = open('/Users/MatBook/Downloads/prize3.txt')
list = []
prizes = []
for line in prize_file_1:
List.append(int(line))
first_line = List.pop(0)
for i in List:
print(i)
for j in List:
if i + j == first_line:
prizes.append((i, j))
print(List)
print('you can have:', prizes) |
def classfinder(k):
res=1
while res*(res+1)//2<k:
res+=1
return res
# cook your dish here
for t in range(int(input())):
#n=int(input())
n,k=map(int,input().split())
clas=classfinder(k)
i=k-clas*(clas-1)//2
str=""
for z in range(n):
if z==n-clas-1 or z==n-i:
str+="b"
else:
str+="a"
print(str) | def classfinder(k):
res = 1
while res * (res + 1) // 2 < k:
res += 1
return res
for t in range(int(input())):
(n, k) = map(int, input().split())
clas = classfinder(k)
i = k - clas * (clas - 1) // 2
str = ''
for z in range(n):
if z == n - clas - 1 or z == n - i:
str += 'b'
else:
str += 'a'
print(str) |
class Config:
conf = {
"labels": {
"pageTitle": "Weatherman V0.0.1"
},
"db.database": "weatherman",
"db.username": "postgres",
"db.password": "postgres",
"navigation": [
{
"url": "/",
"name": "Home"
},
{
"url": "/cakes",
"name": "Cakes"
},
{
"url": "/mqtt",
"name": "MQTT"
}
]
}
def get_config(self):
return self.conf
def get(self, key):
return self.conf[key]
| class Config:
conf = {'labels': {'pageTitle': 'Weatherman V0.0.1'}, 'db.database': 'weatherman', 'db.username': 'postgres', 'db.password': 'postgres', 'navigation': [{'url': '/', 'name': 'Home'}, {'url': '/cakes', 'name': 'Cakes'}, {'url': '/mqtt', 'name': 'MQTT'}]}
def get_config(self):
return self.conf
def get(self, key):
return self.conf[key] |
def is_leap(year):
leap = False
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
leap = True
else:
leap = False
else:
leap = True
return leap
year = int(input())
print(is_leap(year))
'''
In the Gregorian calendar, three conditions are used to identify leap years:
The year can be evenly divided by 4, is a leap year, unless:
The year can be evenly divided by 100, it is NOT a leap year, unless:
The year is also evenly divisible by 400. Then it is a leap year.
''' | def is_leap(year):
leap = False
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
leap = True
else:
leap = False
else:
leap = True
return leap
year = int(input())
print(is_leap(year))
'\nIn the Gregorian calendar, three conditions are used to identify leap years:\n\n The year can be evenly divided by 4, is a leap year, unless:\n The year can be evenly divided by 100, it is NOT a leap year, unless:\n The year is also evenly divisible by 400. Then it is a leap year.\n\n' |
# -*- coding: utf-8 -*-
class DummyTile:
def __init__(self, pos, label=None):
self.pos = pos
# Label tells adjacent mine count for this tile. Int between 0...8 or None if unknown
self.label = label
self.checked = False
self.marked = False
self.adj_mines = None
self.adj_tiles = 0
self.adj_checked = 0
self.adj_unchecked = None
def set_label(self, label):
self.label = label
self.checked = True
def set_adj_mines(self, count):
self.adj_mines = count
self.checked = True
def set_adj_tiles(self, count):
self.adj_tiles = count
def set_adj_checked(self, count):
self.adj_checked = count
def add_adj_checked(self):
self.adj_checked = self.adj_checked + 1
def set_adj_unchecked(self, count):
self.adj_unchecked = count
def mark(self):
self.marked = True
| class Dummytile:
def __init__(self, pos, label=None):
self.pos = pos
self.label = label
self.checked = False
self.marked = False
self.adj_mines = None
self.adj_tiles = 0
self.adj_checked = 0
self.adj_unchecked = None
def set_label(self, label):
self.label = label
self.checked = True
def set_adj_mines(self, count):
self.adj_mines = count
self.checked = True
def set_adj_tiles(self, count):
self.adj_tiles = count
def set_adj_checked(self, count):
self.adj_checked = count
def add_adj_checked(self):
self.adj_checked = self.adj_checked + 1
def set_adj_unchecked(self, count):
self.adj_unchecked = count
def mark(self):
self.marked = True |
##Write code to switch the order of the winners list so that it is now Z to A. Assign this list to the variable z_winners.
winners = ['Alice Munro', 'Alvin E. Roth', 'Kazuo Ishiguro', 'Malala Yousafzai', 'Rainer Weiss', 'Youyou Tu']
z_winners = winners
z_winners.reverse()
print(z_winners) | winners = ['Alice Munro', 'Alvin E. Roth', 'Kazuo Ishiguro', 'Malala Yousafzai', 'Rainer Weiss', 'Youyou Tu']
z_winners = winners
z_winners.reverse()
print(z_winners) |
class Vector:
#exercise 01
def __init__(self,inputlist):
self._vector = []
_vector = inputlist
#exercise 02
def __str__(self):
return "<" + str(self._vector).strip("[]") + ">"
#exercise 03
def dim(self):
return len(self._vector)
#exercise 04
def get(self,index):
return self._vector[index]
def set(self,index,value):
self._vector[index] = value
def scalar_product(self, scalar):
return [scalar * x for x in self._vector]
#exercise 05
def add(self, other_vector):
if not isinstance(other_vector) == True and type(other_vector) == Vector:
raise TypeError
elif not self.dim() == other_vector.dim():
raise ValueError
else:
return self.scalar_product(other_vector)
#exercise 06
def equals(self,other_vector):
if not self.dim() == other_vector.dim():
return False
elif self == other_vector:
return True
else:
for i in range(self.dim()):
if self._vector[i] != other_vector._vector[i]:
return False
else:
return True
| class Vector:
def __init__(self, inputlist):
self._vector = []
_vector = inputlist
def __str__(self):
return '<' + str(self._vector).strip('[]') + '>'
def dim(self):
return len(self._vector)
def get(self, index):
return self._vector[index]
def set(self, index, value):
self._vector[index] = value
def scalar_product(self, scalar):
return [scalar * x for x in self._vector]
def add(self, other_vector):
if not isinstance(other_vector) == True and type(other_vector) == Vector:
raise TypeError
elif not self.dim() == other_vector.dim():
raise ValueError
else:
return self.scalar_product(other_vector)
def equals(self, other_vector):
if not self.dim() == other_vector.dim():
return False
elif self == other_vector:
return True
else:
for i in range(self.dim()):
if self._vector[i] != other_vector._vector[i]:
return False
else:
return True |
# Protein sequence given
seq = "MPISEPTFFEIF"
# Split the sequence into its component amino acids
seq_list = list(seq)
# Use a set to establish the unique amino acids
unique_amino_acids = set(seq_list)
# Print out the unique amino acids
print(unique_amino_acids)
| seq = 'MPISEPTFFEIF'
seq_list = list(seq)
unique_amino_acids = set(seq_list)
print(unique_amino_acids) |
DEPTH = 16 # the number of filters of the first conv layer of the encoder of the UNet
# Training hyperparameters
BATCHSIZE = 16
EPOCHS = 100
OPTIMIZER = "adam"
| depth = 16
batchsize = 16
epochs = 100
optimizer = 'adam' |
string=input("Enter a string:")
length=len(string)
mid=length//2
rev=-1
for a in range(mid):
if string[a]==string[rev]:
a+=1
rev=-1
else:
print(string,"is a palindrome")
break
else:
print(string,"is not a palindrome")
| string = input('Enter a string:')
length = len(string)
mid = length // 2
rev = -1
for a in range(mid):
if string[a] == string[rev]:
a += 1
rev = -1
else:
print(string, 'is a palindrome')
break
else:
print(string, 'is not a palindrome') |
# Argus was charged with guarding Io, which is not an ordinary cow. Io is quite an explorer, and she wanders off rather frequently, making Argus' life stressful. So the cowherd decided to construct an enclosed pasture for Io.
# There are nnn trees growing along the river, where Argus tends Io. For this problem, the river can be viewed as the OXOXOX axis of the Cartesian coordinate system, and the nnn trees as points with the yyy-coordinate equal 000. There is also another tree growing in the point (0,1)(0, 1)(0,1).
# Argus will tie a rope around three of the trees, creating a triangular pasture. Its exact shape doesn't matter to Io, but its area is crucial to her. There may be many ways for Argus to arrange the fence, but only the ones which result in different areas of the pasture are interesting for Io. Calculate the number of different areas that her pasture may have. Note that the pasture must have nonzero area.
t = int(input())
for i in range(t):
n = int(input())
xs = list(map(int, input().split()))
| t = int(input())
for i in range(t):
n = int(input())
xs = list(map(int, input().split())) |
''' Compute a digest message '''
def answer(digest):
''' solve for m[1] '''
message = []
for i, v in enumerate(digest):
pv = message[i - 1] if i > 0 else 0
m = 0.1
a = 0
while m != int(m):
m = ((256 * a) + (v ^ pv)) / 129.0
a += 1
m = int(m)
message.append(m)
return message
| """ Compute a digest message """
def answer(digest):
""" solve for m[1] """
message = []
for (i, v) in enumerate(digest):
pv = message[i - 1] if i > 0 else 0
m = 0.1
a = 0
while m != int(m):
m = (256 * a + (v ^ pv)) / 129.0
a += 1
m = int(m)
message.append(m)
return message |
# October 27th, 2021
# INFOTC 4320
# Josh Block
# Challenge: Anagram Alogrithm and Big-O
# References: https://bradfieldcs.com/algos/analysis/an-anagram-detection-example/
print("===Anagram Dector===")
print("This program determines if two words are anagrams of each other\n")
first_word = input("Please enter first word: ")
second_word = input("Please enter second word: ")
##def dector(first_word,second_word):
## if len(first_word) != len(second_word):
## return True
##
## first_word = sorted(first_word)
## second_word = sorted(second_word)
##
## if first_word != second_word:
## return False
##
## return True
## pass
def dector(first_word, second_word):
return sorted(first_word) == sorted(second_word)
print(dector(first_word,second_word))
| print('===Anagram Dector===')
print('This program determines if two words are anagrams of each other\n')
first_word = input('Please enter first word: ')
second_word = input('Please enter second word: ')
def dector(first_word, second_word):
return sorted(first_word) == sorted(second_word)
print(dector(first_word, second_word)) |
a=int(input())
b=int(input())
c=int(input())
if(a>b and a>c):
print("number 1 is greatest")
elif(b>a and b>c):
print("number 2 is greatest")
else:
print("number 3 is greatest")
| a = int(input())
b = int(input())
c = int(input())
if a > b and a > c:
print('number 1 is greatest')
elif b > a and b > c:
print('number 2 is greatest')
else:
print('number 3 is greatest') |
def main():
# Create and print a list named fruit.
fruit_list = ["pear", "banana", "apple", "mango"]
print(f"original: {fruit_list}")
fruit_list.reverse()
print(f"Reverse {fruit_list}")
fruit_list.append("Orange")
print(f"Append Orange {fruit_list}")
pos = fruit_list.index("apple")
fruit_list.insert(pos, "cherry")
print(f"insert cherry: {fruit_list}")
fruit_list.remove("banana")
print(f"Remove Banana: {fruit_list}")
last = fruit_list.pop()
print(f"pop {last}: {fruit_list}")
fruit_list.sort()
print(f"Sorted: {fruit_list}")
fruit_list.clear()
print(f"cleared: {fruit_list}")
if __name__ == "__main__":
main() | def main():
fruit_list = ['pear', 'banana', 'apple', 'mango']
print(f'original: {fruit_list}')
fruit_list.reverse()
print(f'Reverse {fruit_list}')
fruit_list.append('Orange')
print(f'Append Orange {fruit_list}')
pos = fruit_list.index('apple')
fruit_list.insert(pos, 'cherry')
print(f'insert cherry: {fruit_list}')
fruit_list.remove('banana')
print(f'Remove Banana: {fruit_list}')
last = fruit_list.pop()
print(f'pop {last}: {fruit_list}')
fruit_list.sort()
print(f'Sorted: {fruit_list}')
fruit_list.clear()
print(f'cleared: {fruit_list}')
if __name__ == '__main__':
main() |
__author__ = "Eric Dose :: New Mexico Mira Project, Albuquerque"
# PyInstaller (__init__.py file should be in place as peer to .py file to run):
# in Windows Command Prompt (E. Dose dev PC):
# cd c:\Dev\prepoint\prepoint
# C:\Programs\Miniconda\Scripts\pyinstaller app.spec
| __author__ = 'Eric Dose :: New Mexico Mira Project, Albuquerque' |
def make_interval(depth, depth_integer_multiplier, num, step_num, start_val):
all_groups_str = "[\n"
for n in range(num):
all_groups_str += "\t["
for d in range(depth):
val = str(start_val * pow(depth_integer_multiplier, d))
if d == depth - 1:
if n == num - 1:
all_groups_str += "%s]\n" % val
else:
all_groups_str += "%s],\n" % val
else:
all_groups_str += "%s, " % val
start_val += step_num
all_groups_str += "]\n"
return all_groups_str
print(make_interval(12, 2, 10, 10, 10))
| def make_interval(depth, depth_integer_multiplier, num, step_num, start_val):
all_groups_str = '[\n'
for n in range(num):
all_groups_str += '\t['
for d in range(depth):
val = str(start_val * pow(depth_integer_multiplier, d))
if d == depth - 1:
if n == num - 1:
all_groups_str += '%s]\n' % val
else:
all_groups_str += '%s],\n' % val
else:
all_groups_str += '%s, ' % val
start_val += step_num
all_groups_str += ']\n'
return all_groups_str
print(make_interval(12, 2, 10, 10, 10)) |
class AFGR:
@staticmethod
def af_to_gr(dict_af):
dict_swap = {}
for keys in dict_af:
dict_swap[keys] = []
for list in dict_af[keys]:
dict_swap[keys].insert(len(dict_swap[keys]), list[0])
dict_swap[keys].insert(len(dict_swap[keys]), list[1])
return dict_swap
@staticmethod
def gr_to_af(dict_gr, estados_aceitacao):
dict_swap = {}
# Adicionando estado final
dict_swap['F'] = []
estados_aceitacao.insert(len(estados_aceitacao), 'F')
for keys in dict_gr:
dict_swap[keys] = []
qtd_elementos = len(dict_gr[keys])
contador = 0
while contador < qtd_elementos:
if contador+1 < len(dict_gr[keys]):
if dict_gr[keys][contador+1].istitle():
dict_swap[keys].insert(len(dict_swap[keys]), [dict_gr[keys][contador], dict_gr[keys][contador+1]])
contador += 2
else:
if AFGR.verifica_estado_final(dict_swap, dict_gr, keys, contador):
dict_swap[keys].insert(len(dict_swap[keys]), [dict_gr[keys][contador], 'F'])
contador += 1
else:
if AFGR.verifica_estado_final(dict_swap, dict_gr, keys, contador):
dict_swap[keys].insert(len(dict_swap[keys]), [dict_gr[keys][contador], 'F'])
contador += 1
# Caso o ultimo elemento seja um nao terminal (NAO FINALIZADO TA REPETIDO O S)
AFGR.verifica_estado_final(dict_swap, dict_gr, keys, contador-2)
return dict_swap
# Verifica os estados finais, tem que ver uma forma melhor no futuro
@staticmethod
def verifica_estado_final(dict_swap, dict_gr, keys, contador):
for estados in dict_swap[keys]:
if estados[0] == dict_gr[keys][contador] and estados[1] != 'F':
estados[1] = 'F'
return False
return True
| class Afgr:
@staticmethod
def af_to_gr(dict_af):
dict_swap = {}
for keys in dict_af:
dict_swap[keys] = []
for list in dict_af[keys]:
dict_swap[keys].insert(len(dict_swap[keys]), list[0])
dict_swap[keys].insert(len(dict_swap[keys]), list[1])
return dict_swap
@staticmethod
def gr_to_af(dict_gr, estados_aceitacao):
dict_swap = {}
dict_swap['F'] = []
estados_aceitacao.insert(len(estados_aceitacao), 'F')
for keys in dict_gr:
dict_swap[keys] = []
qtd_elementos = len(dict_gr[keys])
contador = 0
while contador < qtd_elementos:
if contador + 1 < len(dict_gr[keys]):
if dict_gr[keys][contador + 1].istitle():
dict_swap[keys].insert(len(dict_swap[keys]), [dict_gr[keys][contador], dict_gr[keys][contador + 1]])
contador += 2
else:
if AFGR.verifica_estado_final(dict_swap, dict_gr, keys, contador):
dict_swap[keys].insert(len(dict_swap[keys]), [dict_gr[keys][contador], 'F'])
contador += 1
else:
if AFGR.verifica_estado_final(dict_swap, dict_gr, keys, contador):
dict_swap[keys].insert(len(dict_swap[keys]), [dict_gr[keys][contador], 'F'])
contador += 1
AFGR.verifica_estado_final(dict_swap, dict_gr, keys, contador - 2)
return dict_swap
@staticmethod
def verifica_estado_final(dict_swap, dict_gr, keys, contador):
for estados in dict_swap[keys]:
if estados[0] == dict_gr[keys][contador] and estados[1] != 'F':
estados[1] = 'F'
return False
return True |
animals = ["Gully", "Rhubarb", "Zephyr", "Henry"]
for index, animal in enumerate(animals):
# if index % 2 == 0:
# continue
# print(animal)
print(f"{index+1}.\t{animal}")
| animals = ['Gully', 'Rhubarb', 'Zephyr', 'Henry']
for (index, animal) in enumerate(animals):
print(f'{index + 1}.\t{animal}') |
# Given an integer array arr, count element x such that x + 1 is also in arr.
# If there're duplicates in arr, count them seperately.
# Example 1:
# Input: arr = [1,2,3]
# Output: 2
# Explanation: 1 and 2 are counted cause 2 and 3 are in arr.
# Example 2:
# Input: arr = [1,1,3,3,5,5,7,7]
# Output: 0
# Explanation: No numbers are counted, cause there's no 2, 4, 6, or 8 in arr.
# Example 3:
# Input: arr = [1,3,2,3,5,0]
# Output: 3
# Explanation: 0, 1 and 2 are counted cause 1, 2 and 3 are in arr.
# Example 4:
# Input: arr = [1,1,2,2]
# Output: 2
# Explanation: Two 1s are counted cause 2 is in arr.
def count_elements(arr):
d = {}
for i in arr:
d[i] = 1
count = 0
for num in arr:
num_plus = num + 1
if num_plus in d:
count += 1
return count
print(count_elements([1,1,2,2])) | def count_elements(arr):
d = {}
for i in arr:
d[i] = 1
count = 0
for num in arr:
num_plus = num + 1
if num_plus in d:
count += 1
return count
print(count_elements([1, 1, 2, 2])) |
ES_HOST = 'localhost:9200'
ES_INDEX = 'pending-uberon'
ES_DOC_TYPE = 'anatomy'
API_PREFIX = 'uberon'
API_VERSION = ''
| es_host = 'localhost:9200'
es_index = 'pending-uberon'
es_doc_type = 'anatomy'
api_prefix = 'uberon'
api_version = '' |
class Solution:
def solve(self, nums):
integersDict = {}
for i in range(len(nums)):
try:
integersDict[nums[i]] += 1
except:
integersDict[nums[i]] = 1
for integer in integersDict:
if integersDict[integer] != 3:
return integer
return nums[0]
| class Solution:
def solve(self, nums):
integers_dict = {}
for i in range(len(nums)):
try:
integersDict[nums[i]] += 1
except:
integersDict[nums[i]] = 1
for integer in integersDict:
if integersDict[integer] != 3:
return integer
return nums[0] |
class CharacterRaceList(object):
DEVA = 'DEVA'
DRAGONBORN = 'DRAGONBORN'
DWARF = 'DWARF'
ELADRIN = 'ELADRIN'
ELF = 'ELF'
GITHZERAI = 'GITHZERAI'
GNOME = 'GNOME'
GOLIATH = 'GOLIATH'
HALFELF = 'HALFELF'
HALFLING = 'HALFLING'
HALFORC = 'HALFORC'
HUMAN = 'HUMAN'
MINOTAUR = 'MINOTAUR'
SHARDMIND = 'SHARDMIND'
SHIFTER = 'SHIFTER'
TIEFLING = 'TIEFLING'
WILDEN = 'WILDEN'
class CharacterClassList(object):
ARDENT = 'ARDENT'
AVENGER = 'AVENGER'
BARBARIAN = 'BARBARIAN'
BARD = 'BARD'
BATTLEMIND = 'BATTLEMIND'
CLERIC = 'CLERIC'
DRUID = 'DRUID'
FIGHTER = 'FIGHTER'
INVOKER = 'INVOKER'
MONK = 'MONK'
PALADIN = 'PALADIN'
PSION = 'PSION'
RANGER = 'RANGER'
ROGUE = 'ROGUE'
RUNEPRIEST = 'RUNEPRIEST'
SEEKER = 'SEEKER'
SHAMAN = 'SHAMAN'
SORCERER = 'SORCERER'
WARDEN = 'WARDEN'
WARLOCK = 'WARLOCK'
WARLORD = 'WARLORD'
WIZARD = 'WIZARD'
class CharacterRoleList(object):
CONTROLLER = 'CONTROLLER'
DEFENDER = 'DEFENDER'
LEADER = 'LEADER'
STRIKER = 'STRIKER'
class AlignmentList(object):
GOOD = 'GOOD'
LAWFUL_GOOD = 'LAWFUL_GOOD'
UNALIGNED = 'UNALIGNED'
EVIL = 'EVIL'
CHAOTIC_EVIL = 'CHAOTIC_EVIL'
class DeitiesList(object):
ASMODEUS = AlignmentList.EVIL
AVANDRA = AlignmentList.GOOD
BAHAMUT = AlignmentList.LAWFUL_GOOD
BANE = AlignmentList.EVIL
CORELLON = AlignmentList.UNALIGNED
ERATHIS = AlignmentList.UNALIGNED
GRUUMSH = AlignmentList.CHAOTIC_EVIL
IOUN = AlignmentList.UNALIGNED
KORD = AlignmentList.UNALIGNED
LOLTH = AlignmentList.CHAOTIC_EVIL
MELORA = AlignmentList.UNALIGNED
MORADIN = AlignmentList.LAWFUL_GOOD
PELOR = AlignmentList.GOOD
SEHANINE = AlignmentList.UNALIGNED
THE_RAVEN_QUEEN = AlignmentList.UNALIGNED
TIAMAT = AlignmentList.EVIL
TOROG = AlignmentList.EVIL
VECNA = AlignmentList.EVIL
ZEHIR = AlignmentList.EVIL
class ScriptList(object):
COMMON = 'COMMON'
RELLANIC = 'RELLANIC'
IOKHARIC = 'IOKHARIC'
DAVEK = 'DAVEK'
BARAZHAD = 'BARAZHAD'
SUPERNAL = 'SUPERNAL'
class LanguageList(object):
COMMON = ScriptList.COMMON
DEEP_SPEECH = ScriptList.RELLANIC
DRACONIC = ScriptList.IOKHARIC
DWARVEN = ScriptList.DAVEK
ELVEN = ScriptList.RELLANIC
GIANT = ScriptList.DAVEK
GOBLIN = ScriptList.COMMON
PRIMORDIAL = ScriptList.BARAZHAD
SUPERNA = ScriptList.SUPERNAL
ABYSSAL = ScriptList.BARAZHAD
| class Characterracelist(object):
deva = 'DEVA'
dragonborn = 'DRAGONBORN'
dwarf = 'DWARF'
eladrin = 'ELADRIN'
elf = 'ELF'
githzerai = 'GITHZERAI'
gnome = 'GNOME'
goliath = 'GOLIATH'
halfelf = 'HALFELF'
halfling = 'HALFLING'
halforc = 'HALFORC'
human = 'HUMAN'
minotaur = 'MINOTAUR'
shardmind = 'SHARDMIND'
shifter = 'SHIFTER'
tiefling = 'TIEFLING'
wilden = 'WILDEN'
class Characterclasslist(object):
ardent = 'ARDENT'
avenger = 'AVENGER'
barbarian = 'BARBARIAN'
bard = 'BARD'
battlemind = 'BATTLEMIND'
cleric = 'CLERIC'
druid = 'DRUID'
fighter = 'FIGHTER'
invoker = 'INVOKER'
monk = 'MONK'
paladin = 'PALADIN'
psion = 'PSION'
ranger = 'RANGER'
rogue = 'ROGUE'
runepriest = 'RUNEPRIEST'
seeker = 'SEEKER'
shaman = 'SHAMAN'
sorcerer = 'SORCERER'
warden = 'WARDEN'
warlock = 'WARLOCK'
warlord = 'WARLORD'
wizard = 'WIZARD'
class Characterrolelist(object):
controller = 'CONTROLLER'
defender = 'DEFENDER'
leader = 'LEADER'
striker = 'STRIKER'
class Alignmentlist(object):
good = 'GOOD'
lawful_good = 'LAWFUL_GOOD'
unaligned = 'UNALIGNED'
evil = 'EVIL'
chaotic_evil = 'CHAOTIC_EVIL'
class Deitieslist(object):
asmodeus = AlignmentList.EVIL
avandra = AlignmentList.GOOD
bahamut = AlignmentList.LAWFUL_GOOD
bane = AlignmentList.EVIL
corellon = AlignmentList.UNALIGNED
erathis = AlignmentList.UNALIGNED
gruumsh = AlignmentList.CHAOTIC_EVIL
ioun = AlignmentList.UNALIGNED
kord = AlignmentList.UNALIGNED
lolth = AlignmentList.CHAOTIC_EVIL
melora = AlignmentList.UNALIGNED
moradin = AlignmentList.LAWFUL_GOOD
pelor = AlignmentList.GOOD
sehanine = AlignmentList.UNALIGNED
the_raven_queen = AlignmentList.UNALIGNED
tiamat = AlignmentList.EVIL
torog = AlignmentList.EVIL
vecna = AlignmentList.EVIL
zehir = AlignmentList.EVIL
class Scriptlist(object):
common = 'COMMON'
rellanic = 'RELLANIC'
iokharic = 'IOKHARIC'
davek = 'DAVEK'
barazhad = 'BARAZHAD'
supernal = 'SUPERNAL'
class Languagelist(object):
common = ScriptList.COMMON
deep_speech = ScriptList.RELLANIC
draconic = ScriptList.IOKHARIC
dwarven = ScriptList.DAVEK
elven = ScriptList.RELLANIC
giant = ScriptList.DAVEK
goblin = ScriptList.COMMON
primordial = ScriptList.BARAZHAD
superna = ScriptList.SUPERNAL
abyssal = ScriptList.BARAZHAD |
def inner_stroke(im):
pass
def outer_stroke(im):
pass
| def inner_stroke(im):
pass
def outer_stroke(im):
pass |
a, b, c = map(int, input().split())
h, l = map(int, input().split())
if a <= h and b <= l:
print("S")
elif a <= h and c <= l:
print("S")
elif b <= h and a <= l:
print("S")
elif b <= h and c <= l:
print("S")
elif c <= h and a <= l:
print("S")
elif c <= h and b <= l:
print("S")
else:
print("N") | (a, b, c) = map(int, input().split())
(h, l) = map(int, input().split())
if a <= h and b <= l:
print('S')
elif a <= h and c <= l:
print('S')
elif b <= h and a <= l:
print('S')
elif b <= h and c <= l:
print('S')
elif c <= h and a <= l:
print('S')
elif c <= h and b <= l:
print('S')
else:
print('N') |
def funcao1 (a, b):
mult= a * b
return mult
def funcao2 (a, b):
divi = a / b
return divi
multiplicacao = funcao1(3, 2)
valor = funcao2(multiplicacao, 2)
print(multiplicacao)
print(int(valor))
| def funcao1(a, b):
mult = a * b
return mult
def funcao2(a, b):
divi = a / b
return divi
multiplicacao = funcao1(3, 2)
valor = funcao2(multiplicacao, 2)
print(multiplicacao)
print(int(valor)) |
# Plotting distributions pairwise (1)
# Print the first 5 rows of the DataFrame
print(auto.head())
# Plot the pairwise joint distributions from the DataFrame
sns.pairplot(auto)
# Display the plot
plt.show()
| print(auto.head())
sns.pairplot(auto)
plt.show() |
def log_text(file_path, log):
if not log.endswith('\n'):
log += '\n'
print(log)
with open(file_path, 'a') as f:
f.write(log)
def log_args(file_path, args):
log = f"Args: {args}\n"
log_text(file_path, log)
def log_train_epoch(file_path, epoch, train_loss, train_accuracy):
log = f"epoch: {epoch}, Train loss: {train_loss}, Train accuracy: {train_accuracy}\n"
log_text(file_path, log)
def log_val_epoch(file_path, epoch, val_loss, val_acc):
log = f"epoch: {epoch}, Val loss: {val_loss}, Val accuracy: {val_acc}\n"
log_text(file_path, log)
def log_test_metrics(file_path, precision, recall, f1, accuracy, cm):
log = (f"Precision: {precision}\n"
f"Recall: {recall}\n"
f"F1 score: {f1}\n"
f"Accuracy: {accuracy}\n"
f"Confusion Matrix:\n{cm}\n")
log_text(file_path, log)
def log_target_test_metrics(file_path, target, precision, recall, f1):
log = (f"{target}:\n"
f"\tPrecision: {round(precision, 4)}\n"
f"\tRecall: {round(recall, 4)}\n"
f"\tF1 score: {round(f1, 4)}\n")
log_text(file_path, log)
| def log_text(file_path, log):
if not log.endswith('\n'):
log += '\n'
print(log)
with open(file_path, 'a') as f:
f.write(log)
def log_args(file_path, args):
log = f'Args: {args}\n'
log_text(file_path, log)
def log_train_epoch(file_path, epoch, train_loss, train_accuracy):
log = f'epoch: {epoch}, Train loss: {train_loss}, Train accuracy: {train_accuracy}\n'
log_text(file_path, log)
def log_val_epoch(file_path, epoch, val_loss, val_acc):
log = f'epoch: {epoch}, Val loss: {val_loss}, Val accuracy: {val_acc}\n'
log_text(file_path, log)
def log_test_metrics(file_path, precision, recall, f1, accuracy, cm):
log = f'Precision: {precision}\nRecall: {recall}\nF1 score: {f1}\nAccuracy: {accuracy}\nConfusion Matrix:\n{cm}\n'
log_text(file_path, log)
def log_target_test_metrics(file_path, target, precision, recall, f1):
log = f'{target}:\n\tPrecision: {round(precision, 4)}\n\tRecall: {round(recall, 4)}\n\tF1 score: {round(f1, 4)}\n'
log_text(file_path, log) |
class Node:
def __init__(self, value, next):
self.value = value
self.next = next
class LinkedList:
def __init__(self):
self.head = None
def add(self, value):
self.head = Node(value, self.head)
def remove(self):
to_remove = self.head
self.head = self.head.next
to_remove.next = None
def reverse(self):
head = current = self.head
prev = next = None
while current:
next = current.next
current.next = prev
prev = current
current = next
self.head = prev
self.print()
def print(self):
current = self.head
while current:
print(current.value, end=" ")
print("->", end = " ")
if not current.next:
print(current.next, end ="\n")
current = current.next
if __name__ == "__main__":
ll = LinkedList()
for i in range(10, 1, -1):
ll.add(i)
ll.print()
ll.reverse()
| class Node:
def __init__(self, value, next):
self.value = value
self.next = next
class Linkedlist:
def __init__(self):
self.head = None
def add(self, value):
self.head = node(value, self.head)
def remove(self):
to_remove = self.head
self.head = self.head.next
to_remove.next = None
def reverse(self):
head = current = self.head
prev = next = None
while current:
next = current.next
current.next = prev
prev = current
current = next
self.head = prev
self.print()
def print(self):
current = self.head
while current:
print(current.value, end=' ')
print('->', end=' ')
if not current.next:
print(current.next, end='\n')
current = current.next
if __name__ == '__main__':
ll = linked_list()
for i in range(10, 1, -1):
ll.add(i)
ll.print()
ll.reverse() |
#!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2017 University of California, Davis
#
# See COPYING for license information.
#
# ----------------------------------------------------------------------
#
## @file pylith/problems/__init__.py
##
## @brief Python PyLith crustal dynamics problems module initialization
__all__ = ['EqDeformation',
'Explicit',
'Implicit',
'Problem',
'Solver',
'SolverLinear',
'SolverNonlinear',
'TimeDependent',
'TimeStep',
'TimeStepUniform',
'TimeStepUser',
'TimeStepAdapt',
'ProgressMonitor',
]
# End of file
| __all__ = ['EqDeformation', 'Explicit', 'Implicit', 'Problem', 'Solver', 'SolverLinear', 'SolverNonlinear', 'TimeDependent', 'TimeStep', 'TimeStepUniform', 'TimeStepUser', 'TimeStepAdapt', 'ProgressMonitor'] |
t = int(input())
while (t!=0):
a,b,c = map(int,input().split())
if (a+b+c == 180):
print('YES')
else:
print('NO')
t-=1
| t = int(input())
while t != 0:
(a, b, c) = map(int, input().split())
if a + b + c == 180:
print('YES')
else:
print('NO')
t -= 1 |
# cool.py
def cool_func():
print('cool_func(): Super Cool!')
print('__name__:', __name__)
if __name__ == '__main__':
print('Call it locally')
cool_func()
| def cool_func():
print('cool_func(): Super Cool!')
print('__name__:', __name__)
if __name__ == '__main__':
print('Call it locally')
cool_func() |
class FieldDoesNotExist(Exception):
def __init__(self, **kwargs):
super().__init__(f"{self.__class__.__name__}: {kwargs}")
self.kwargs = kwargs
| class Fielddoesnotexist(Exception):
def __init__(self, **kwargs):
super().__init__(f'{self.__class__.__name__}: {kwargs}')
self.kwargs = kwargs |
#
# PySNMP MIB module Unisphere-Products-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Products-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:26:09 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)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
iso, NotificationType, Counter64, Gauge32, ModuleIdentity, Counter32, IpAddress, Integer32, Unsigned32, TimeTicks, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "NotificationType", "Counter64", "Gauge32", "ModuleIdentity", "Counter32", "IpAddress", "Integer32", "Unsigned32", "TimeTicks", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Bits")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
unisphere, = mibBuilder.importSymbols("Unisphere-SMI", "unisphere")
usProducts = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 1))
usProducts.setRevisions(('2001-12-07 15:36', '2001-10-15 18:29', '2001-03-01 15:27', '2000-05-24 00:00', '1999-12-13 19:36', '1999-11-16 00:00', '1999-09-28 00:00',))
if mibBuilder.loadTexts: usProducts.setLastUpdated('200112071536Z')
if mibBuilder.loadTexts: usProducts.setOrganization('Unisphere Networks, Inc.')
productFamilies = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1))
unisphereProductFamilies = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1))
usErx = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1))
usEdgeRoutingSwitch1400 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 1))
usEdgeRoutingSwitch700 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 2))
usEdgeRoutingSwitch1440 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 3))
usEdgeRoutingSwitch705 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 4))
usMrx = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 2))
usMrxRoutingSwitch16000 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 2, 1))
usMrxRoutingSwitch32000 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 2, 2))
usSmx = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 3))
usServiceMediationSwitch2100 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 3, 1))
usSrx = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 4))
usServiceReadySwitch3000 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 4, 1))
usUmc = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 5))
usUmcSystemManagement = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 5, 1))
oemProductFamilies = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2))
marconiProductFamilies = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1))
usSsx = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1))
usSsx1400 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1, 1))
usSsx700 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1, 2))
usSsx1440 = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1, 3))
mibBuilder.exportSymbols("Unisphere-Products-MIB", usSsx1400=usSsx1400, usErx=usErx, usServiceMediationSwitch2100=usServiceMediationSwitch2100, oemProductFamilies=oemProductFamilies, usServiceReadySwitch3000=usServiceReadySwitch3000, usUmc=usUmc, usSmx=usSmx, usSsx1440=usSsx1440, unisphereProductFamilies=unisphereProductFamilies, usEdgeRoutingSwitch705=usEdgeRoutingSwitch705, usMrxRoutingSwitch16000=usMrxRoutingSwitch16000, usSsx=usSsx, usProducts=usProducts, usEdgeRoutingSwitch700=usEdgeRoutingSwitch700, usSsx700=usSsx700, usUmcSystemManagement=usUmcSystemManagement, marconiProductFamilies=marconiProductFamilies, productFamilies=productFamilies, usEdgeRoutingSwitch1440=usEdgeRoutingSwitch1440, usMrx=usMrx, usMrxRoutingSwitch32000=usMrxRoutingSwitch32000, usEdgeRoutingSwitch1400=usEdgeRoutingSwitch1400, PYSNMP_MODULE_ID=usProducts, usSrx=usSrx)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_size_constraint, value_range_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(iso, notification_type, counter64, gauge32, module_identity, counter32, ip_address, integer32, unsigned32, time_ticks, object_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'NotificationType', 'Counter64', 'Gauge32', 'ModuleIdentity', 'Counter32', 'IpAddress', 'Integer32', 'Unsigned32', 'TimeTicks', 'ObjectIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'Bits')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
(unisphere,) = mibBuilder.importSymbols('Unisphere-SMI', 'unisphere')
us_products = module_identity((1, 3, 6, 1, 4, 1, 4874, 1))
usProducts.setRevisions(('2001-12-07 15:36', '2001-10-15 18:29', '2001-03-01 15:27', '2000-05-24 00:00', '1999-12-13 19:36', '1999-11-16 00:00', '1999-09-28 00:00'))
if mibBuilder.loadTexts:
usProducts.setLastUpdated('200112071536Z')
if mibBuilder.loadTexts:
usProducts.setOrganization('Unisphere Networks, Inc.')
product_families = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1))
unisphere_product_families = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1))
us_erx = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1))
us_edge_routing_switch1400 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 1))
us_edge_routing_switch700 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 2))
us_edge_routing_switch1440 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 3))
us_edge_routing_switch705 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 1, 4))
us_mrx = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 2))
us_mrx_routing_switch16000 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 2, 1))
us_mrx_routing_switch32000 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 2, 2))
us_smx = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 3))
us_service_mediation_switch2100 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 3, 1))
us_srx = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 4))
us_service_ready_switch3000 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 4, 1))
us_umc = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 5))
us_umc_system_management = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 1, 5, 1))
oem_product_families = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2))
marconi_product_families = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1))
us_ssx = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1))
us_ssx1400 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1, 1))
us_ssx700 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1, 2))
us_ssx1440 = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 1, 1, 2, 1, 1, 3))
mibBuilder.exportSymbols('Unisphere-Products-MIB', usSsx1400=usSsx1400, usErx=usErx, usServiceMediationSwitch2100=usServiceMediationSwitch2100, oemProductFamilies=oemProductFamilies, usServiceReadySwitch3000=usServiceReadySwitch3000, usUmc=usUmc, usSmx=usSmx, usSsx1440=usSsx1440, unisphereProductFamilies=unisphereProductFamilies, usEdgeRoutingSwitch705=usEdgeRoutingSwitch705, usMrxRoutingSwitch16000=usMrxRoutingSwitch16000, usSsx=usSsx, usProducts=usProducts, usEdgeRoutingSwitch700=usEdgeRoutingSwitch700, usSsx700=usSsx700, usUmcSystemManagement=usUmcSystemManagement, marconiProductFamilies=marconiProductFamilies, productFamilies=productFamilies, usEdgeRoutingSwitch1440=usEdgeRoutingSwitch1440, usMrx=usMrx, usMrxRoutingSwitch32000=usMrxRoutingSwitch32000, usEdgeRoutingSwitch1400=usEdgeRoutingSwitch1400, PYSNMP_MODULE_ID=usProducts, usSrx=usSrx) |
# Calculate factorial of a number
def factorial(n):
''' Returns the factorial of n.
e.g. factorial(7) = 7x76x5x4x3x2x1 = 5040.
'''
answer = 1
for i in range(1,n+1):
answer = answer * i
return answer
if __name__ == "__main__":
assert factorial(7) == 5040 | def factorial(n):
""" Returns the factorial of n.
e.g. factorial(7) = 7x76x5x4x3x2x1 = 5040.
"""
answer = 1
for i in range(1, n + 1):
answer = answer * i
return answer
if __name__ == '__main__':
assert factorial(7) == 5040 |
line = input().split()
n = int(line[0])
m = int(line[1])
print(str(abs(n-m)))
| line = input().split()
n = int(line[0])
m = int(line[1])
print(str(abs(n - m))) |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"c_imshow": "01_nn_utils.ipynb",
"Flatten": "01_nn_utils.ipynb",
"conv3x3": "01_nn_utils.ipynb",
"get_proto_accuracy": "01_nn_utils.ipynb",
"get_accuracy": "02_maml_pl.ipynb",
"collate_task": "01b_data_loaders_pl.ipynb",
"collate_task_batch": "01b_data_loaders_pl.ipynb",
"get_episode_loader": "01b_data_loaders_pl.ipynb",
"UnlabelledDataset": "01b_data_loaders_pl.ipynb",
"get_cub_default_transform": "01b_data_loaders_pl.ipynb",
"get_simCLR_transform": "01b_data_loaders_pl.ipynb",
"get_omniglot_transform": "01b_data_loaders_pl.ipynb",
"get_custom_transform": "01b_data_loaders_pl.ipynb",
"identity_transform": "01b_data_loaders_pl.ipynb",
"UnlabelledDataModule": "01b_data_loaders_pl.ipynb",
"OmniglotDataModule": "01b_data_loaders_pl.ipynb",
"MiniImagenetDataModule": "01b_data_loaders_pl.ipynb",
"cg": "01c_grad_utils.ipynb",
"cat_list_to_tensor": "01c_grad_utils.ipynb",
"reverse_unroll": "01c_grad_utils.ipynb",
"reverse": "01c_grad_utils.ipynb",
"fixed_point": "01c_grad_utils.ipynb",
"CG": "01c_grad_utils.ipynb",
"CG_normaleq": "01c_grad_utils.ipynb",
"neumann": "01c_grad_utils.ipynb",
"exact": "01c_grad_utils.ipynb",
"grd": "01c_grad_utils.ipynb",
"list_dot": "01c_grad_utils.ipynb",
"jvp": "01c_grad_utils.ipynb",
"get_outer_gradients": "01c_grad_utils.ipynb",
"update_tensor_grads": "01c_grad_utils.ipynb",
"grad_unused_zero": "01c_grad_utils.ipynb",
"DifferentiableOptimizer": "01c_grad_utils.ipynb",
"HeavyBall": "01c_grad_utils.ipynb",
"Momentum": "01c_grad_utils.ipynb",
"GradientDescent": "01c_grad_utils.ipynb",
"gd_step": "01c_grad_utils.ipynb",
"heavy_ball_step": "01c_grad_utils.ipynb",
"torch_momentum_step": "01c_grad_utils.ipynb",
"euclidean_distance": "01d_proto_utils.ipynb",
"cosine_similarity": "01d_proto_utils.ipynb",
"get_num_samples": "01d_proto_utils.ipynb",
"get_prototypes": "01d_proto_utils.ipynb",
"prototypical_loss": "01d_proto_utils.ipynb",
"clusterer": "01d_proto_utils.ipynb",
"cluster_diff_loss": "01d_proto_utils.ipynb",
"CNN_4Layer": "01d_proto_utils.ipynb",
"Encoder": "01d_proto_utils.ipynb",
"Decoder": "01d_proto_utils.ipynb",
"CAE": "01d_proto_utils.ipynb",
"Encoder4L": "01d_proto_utils.ipynb",
"Decoder4L": "01d_proto_utils.ipynb",
"Decoder4L4Mini": "01d_proto_utils.ipynb",
"CAE4L": "01d_proto_utils.ipynb",
"get_images_labels_from_dl": "01d_proto_utils.ipynb",
"logger": "02_maml_pl.ipynb",
"ConvolutionalNeuralNetwork": "02_maml_pl.ipynb",
"MAML": "02_maml_pl.ipynb",
"UMTRA": "02_maml_pl.ipynb",
"cg_solve": "02b_iMAML.ipynb",
"iMAML": "02b_iMAML.ipynb",
"PrototypicalNetwork": "03_protonet_pl.ipynb",
"CactusPrototypicalModel": "03_protonet_pl.ipynb",
"ProtoModule": "03_protonet_pl.ipynb",
"Classifier": "03b_ProtoCLR.ipynb",
"get_train_images": "03b_ProtoCLR.ipynb",
"WandbImageCallback": "03b_ProtoCLR.ipynb",
"TensorBoardImageCallback": "03b_ProtoCLR.ipynb",
"ConfidenceIntervalCallback": "03b_ProtoCLR.ipynb",
"UMAPCallback": "03b_ProtoCLR.ipynb",
"UMAPClusteringCallback": "03b_ProtoCLR.ipynb",
"PCACallback": "03b_ProtoCLR.ipynb",
"ProtoCLR": "03b_ProtoCLR.ipynb",
"Partition": "04_cactus.ipynb",
"CactusTaskDataset": "04_cactus.ipynb",
"get_partitions_kmeans": "04_cactus.ipynb",
"DataOpt": "04_cactus.ipynb",
"LoaderOpt": "04_cactus.ipynb",
"load": "04_cactus.ipynb",
"CactusDataModule": "04_cactus.ipynb"}
modules = ["nn_utils.py",
"pl_dataloaders.py",
"hypergrad.py",
"proto_utils.py",
"maml.py",
"imaml.py",
"protonets.py",
"protoclr.py",
"cactus.py"]
doc_url = "https://ojss.github.io/unsupervised_meta_learning/"
git_url = "https://github.com/ojss/unsupervised_meta_learning/tree/main/"
def custom_doc_links(name): return None
| __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'c_imshow': '01_nn_utils.ipynb', 'Flatten': '01_nn_utils.ipynb', 'conv3x3': '01_nn_utils.ipynb', 'get_proto_accuracy': '01_nn_utils.ipynb', 'get_accuracy': '02_maml_pl.ipynb', 'collate_task': '01b_data_loaders_pl.ipynb', 'collate_task_batch': '01b_data_loaders_pl.ipynb', 'get_episode_loader': '01b_data_loaders_pl.ipynb', 'UnlabelledDataset': '01b_data_loaders_pl.ipynb', 'get_cub_default_transform': '01b_data_loaders_pl.ipynb', 'get_simCLR_transform': '01b_data_loaders_pl.ipynb', 'get_omniglot_transform': '01b_data_loaders_pl.ipynb', 'get_custom_transform': '01b_data_loaders_pl.ipynb', 'identity_transform': '01b_data_loaders_pl.ipynb', 'UnlabelledDataModule': '01b_data_loaders_pl.ipynb', 'OmniglotDataModule': '01b_data_loaders_pl.ipynb', 'MiniImagenetDataModule': '01b_data_loaders_pl.ipynb', 'cg': '01c_grad_utils.ipynb', 'cat_list_to_tensor': '01c_grad_utils.ipynb', 'reverse_unroll': '01c_grad_utils.ipynb', 'reverse': '01c_grad_utils.ipynb', 'fixed_point': '01c_grad_utils.ipynb', 'CG': '01c_grad_utils.ipynb', 'CG_normaleq': '01c_grad_utils.ipynb', 'neumann': '01c_grad_utils.ipynb', 'exact': '01c_grad_utils.ipynb', 'grd': '01c_grad_utils.ipynb', 'list_dot': '01c_grad_utils.ipynb', 'jvp': '01c_grad_utils.ipynb', 'get_outer_gradients': '01c_grad_utils.ipynb', 'update_tensor_grads': '01c_grad_utils.ipynb', 'grad_unused_zero': '01c_grad_utils.ipynb', 'DifferentiableOptimizer': '01c_grad_utils.ipynb', 'HeavyBall': '01c_grad_utils.ipynb', 'Momentum': '01c_grad_utils.ipynb', 'GradientDescent': '01c_grad_utils.ipynb', 'gd_step': '01c_grad_utils.ipynb', 'heavy_ball_step': '01c_grad_utils.ipynb', 'torch_momentum_step': '01c_grad_utils.ipynb', 'euclidean_distance': '01d_proto_utils.ipynb', 'cosine_similarity': '01d_proto_utils.ipynb', 'get_num_samples': '01d_proto_utils.ipynb', 'get_prototypes': '01d_proto_utils.ipynb', 'prototypical_loss': '01d_proto_utils.ipynb', 'clusterer': '01d_proto_utils.ipynb', 'cluster_diff_loss': '01d_proto_utils.ipynb', 'CNN_4Layer': '01d_proto_utils.ipynb', 'Encoder': '01d_proto_utils.ipynb', 'Decoder': '01d_proto_utils.ipynb', 'CAE': '01d_proto_utils.ipynb', 'Encoder4L': '01d_proto_utils.ipynb', 'Decoder4L': '01d_proto_utils.ipynb', 'Decoder4L4Mini': '01d_proto_utils.ipynb', 'CAE4L': '01d_proto_utils.ipynb', 'get_images_labels_from_dl': '01d_proto_utils.ipynb', 'logger': '02_maml_pl.ipynb', 'ConvolutionalNeuralNetwork': '02_maml_pl.ipynb', 'MAML': '02_maml_pl.ipynb', 'UMTRA': '02_maml_pl.ipynb', 'cg_solve': '02b_iMAML.ipynb', 'iMAML': '02b_iMAML.ipynb', 'PrototypicalNetwork': '03_protonet_pl.ipynb', 'CactusPrototypicalModel': '03_protonet_pl.ipynb', 'ProtoModule': '03_protonet_pl.ipynb', 'Classifier': '03b_ProtoCLR.ipynb', 'get_train_images': '03b_ProtoCLR.ipynb', 'WandbImageCallback': '03b_ProtoCLR.ipynb', 'TensorBoardImageCallback': '03b_ProtoCLR.ipynb', 'ConfidenceIntervalCallback': '03b_ProtoCLR.ipynb', 'UMAPCallback': '03b_ProtoCLR.ipynb', 'UMAPClusteringCallback': '03b_ProtoCLR.ipynb', 'PCACallback': '03b_ProtoCLR.ipynb', 'ProtoCLR': '03b_ProtoCLR.ipynb', 'Partition': '04_cactus.ipynb', 'CactusTaskDataset': '04_cactus.ipynb', 'get_partitions_kmeans': '04_cactus.ipynb', 'DataOpt': '04_cactus.ipynb', 'LoaderOpt': '04_cactus.ipynb', 'load': '04_cactus.ipynb', 'CactusDataModule': '04_cactus.ipynb'}
modules = ['nn_utils.py', 'pl_dataloaders.py', 'hypergrad.py', 'proto_utils.py', 'maml.py', 'imaml.py', 'protonets.py', 'protoclr.py', 'cactus.py']
doc_url = 'https://ojss.github.io/unsupervised_meta_learning/'
git_url = 'https://github.com/ojss/unsupervised_meta_learning/tree/main/'
def custom_doc_links(name):
return None |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.