content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
|---|---|
"""
solution Adventofcode 2019 day 4 part 1.
https://adventofcode.com/2019/day/4
author: pca
"""
def valid_pw(pw_str: int) -> bool:
has_double = False
if len(pw_str) != 6:
return False
max_digit = 0
prev_digit = -1
for ch in pw_str:
cur_digit = int(ch)
# decreasing
if cur_digit < max_digit:
return False
else:
max_digit = cur_digit
if cur_digit == prev_digit:
has_double = True
prev_digit = cur_digit
return has_double
def main(args=None):
puzzle_input = [int(ch) for ch in '245318-765747'.split('-')]
cnt = 0
for val in range(puzzle_input[0], puzzle_input[1]):
if valid_pw(str(val)):
cnt += 1
print(cnt)
if __name__ == "__main__":
main()
|
"""
solution Adventofcode 2019 day 4 part 1.
https://adventofcode.com/2019/day/4
author: pca
"""
def valid_pw(pw_str: int) -> bool:
has_double = False
if len(pw_str) != 6:
return False
max_digit = 0
prev_digit = -1
for ch in pw_str:
cur_digit = int(ch)
if cur_digit < max_digit:
return False
else:
max_digit = cur_digit
if cur_digit == prev_digit:
has_double = True
prev_digit = cur_digit
return has_double
def main(args=None):
puzzle_input = [int(ch) for ch in '245318-765747'.split('-')]
cnt = 0
for val in range(puzzle_input[0], puzzle_input[1]):
if valid_pw(str(val)):
cnt += 1
print(cnt)
if __name__ == '__main__':
main()
|
#A function to show the list of trait with categorial data
def categorial_trait(dataframe):
numeric, categorial = classifying_column(dataframe)
print('Traits with categorial data : ','\n',categorial, '\n')
print('Total count : ' ,len(categorial) , 'Traits')
|
def categorial_trait(dataframe):
(numeric, categorial) = classifying_column(dataframe)
print('Traits with categorial data : ', '\n', categorial, '\n')
print('Total count : ', len(categorial), 'Traits')
|
ENDC = '\033[0m'
OKGREEN = '\033[92m'
def print_play_my_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print("\033[F"*13)
print(
f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}',
f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}',
f'',
f'p : Pause',
f'l : Play',
f'+ / - : Volume',
f's : Shuffle',
f'n : Next Song',
f'b : Previous Song',
f'x : exit',
f'',
f'',
sep="\n"
)
def print_play_one_song(name_song, artist, total_time, prefix, bar, percent, suffix):
print("\033[F"*13)
print(
f'{name_song} | {artist} | {total_time[:7]}',
f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}',
f'',
f'p : Pause',
f'l : Play',
f'+ : Up Volume',
f'- : Down Volume',
f'r : Add to a playlist',
f'x : exit',
f'',
f'',
f'',
sep="\n"
)
def print_play_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print("\033[F"*13)
print(
f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}',
f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}',
f'',
f'p : Pause',
f'l : Play',
f'+ / - : Volume',
f's : Shuffle',
f'n : Next Song',
f'b : Previous Song',
f'a : Follow this playlist',
f'x : exit',
f'',
sep="\n"
)
|
endc = '\x1b[0m'
okgreen = '\x1b[92m'
def print_play_my_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print('\x1b[F' * 13)
print(f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}', f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}', f'', f'p : Pause', f'l : Play', f'+ / - : Volume', f's : Shuffle', f'n : Next Song', f'b : Previous Song', f'x : exit', f'', f'', sep='\n')
def print_play_one_song(name_song, artist, total_time, prefix, bar, percent, suffix):
print('\x1b[F' * 13)
print(f'{name_song} | {artist} | {total_time[:7]}', f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}', f'', f'p : Pause', f'l : Play', f'+ : Up Volume', f'- : Down Volume', f'r : Add to a playlist', f'x : exit', f'', f'', f'', sep='\n')
def print_play_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print('\x1b[F' * 13)
print(f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}', f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}', f'', f'p : Pause', f'l : Play', f'+ / - : Volume', f's : Shuffle', f'n : Next Song', f'b : Previous Song', f'a : Follow this playlist', f'x : exit', f'', sep='\n')
|
"""
Constants
"""
MONGO_DOCKER_SERVICE = "db"
MONGO_HOST = "192.168.99.100"
MONGO_PORT = 27017
RABBIT_DOCKER_SERVICE = "rabbit"
RABBIT_HOST = "192.168.99.100"
RABBIT_PORT = 5672
|
"""
Constants
"""
mongo_docker_service = 'db'
mongo_host = '192.168.99.100'
mongo_port = 27017
rabbit_docker_service = 'rabbit'
rabbit_host = '192.168.99.100'
rabbit_port = 5672
|
"""
texto = [x for x in input("Input: ") if x in "{}[]()"]
if len(texto) % 2 != 0 or len(texto) == 0:
validacion = False
else:
validacion = True
i = 0
while 0 < len(texto) and validacion == "YES":
if texto[i] in "{[(":
i += 1
else:
if texto[i - 1] + texto[i] in '{}' or \
texto[i - 1] + texto[i] in '[]' or \
texto[i - 1] + texto[i] in '()':
texto = texto[:i - 1] + texto[i + 1:]
i -= 1
else:
validacion = False
print(validacion)
"""
"""
def validacion(texto):
lista = list(texto)
comprobacion = []
contador1 = lista.count('(')
contador2 = lista.count(')')
if contador1 != contador2:
return False
else:
for i in lista:
if i == "(":
comprobacion.append(i)
elif i == ")" and len(comprobacion) > 0:
comprobacion.pop()
if len(comprobacion) == 0:
return True
def main():
ingreso = input("Input: ")
print(validacion(ingreso))
main()
"""
"""
#EL MEJOR
def main():
print(
(
lambda expr, stack: all(
len(stack) == 0 if char is None else
stack.append(char) or True if char in '([{' else
len(stack) > 0 and {'(': ')', '[': ']', '{': '}'}[stack.pop()] == char if char in ')]}' else
True
for char in expr
)
)(
list(input("Input: ")) + [None], []
)
)
main()
"""
#easy
def es_valida(texto):
def validacion(izq,der):
if izq=='[' and der==']':
return True
if izq=='{' and der=='}':
return True
if izq=='(' and der==')':
return True
return False
lista=[]
for i in range(len(texto)):
if texto[i]=='[' or texto[i]=='{' or texto[i]=='(':
lista.append(texto[i])
elif texto[i] == ']' or texto[i] == '}' or texto[i] == ')':
if validacion(lista[-1],texto[i] or len(lista)!=0):
lista.pop()
else:
return False
if len(lista)==0:
return True
else:
return False
def main():
text = input("Input: ")
print(es_valida(text))
main()
|
"""
texto = [x for x in input("Input: ") if x in "{}[]()"]
if len(texto) % 2 != 0 or len(texto) == 0:
validacion = False
else:
validacion = True
i = 0
while 0 < len(texto) and validacion == "YES":
if texto[i] in "{[(":
i += 1
else:
if texto[i - 1] + texto[i] in '{}' or texto[i - 1] + texto[i] in '[]' or texto[i - 1] + texto[i] in '()':
texto = texto[:i - 1] + texto[i + 1:]
i -= 1
else:
validacion = False
print(validacion)
"""
'\ndef validacion(texto):\n lista = list(texto)\n comprobacion = []\n contador1 = lista.count(\'(\')\n contador2 = lista.count(\')\')\n if contador1 != contador2:\n return False\n else:\n for i in lista:\n if i == "(":\n comprobacion.append(i)\n elif i == ")" and len(comprobacion) > 0:\n comprobacion.pop()\n if len(comprobacion) == 0:\n return True\n\ndef main():\n ingreso = input("Input: ")\n print(validacion(ingreso))\n \nmain()\n'
'\n#EL MEJOR\n\ndef main():\n print(\n (\n lambda expr, stack: all(\n len(stack) == 0 if char is None else\n stack.append(char) or True if char in \'([{\' else\n len(stack) > 0 and {\'(\': \')\', \'[\': \']\', \'{\': \'}\'}[stack.pop()] == char if char in \')]}\' else\n True\n for char in expr\n )\n )(\n list(input("Input: ")) + [None], []\n )\n )\n \nmain()\n'
def es_valida(texto):
def validacion(izq, der):
if izq == '[' and der == ']':
return True
if izq == '{' and der == '}':
return True
if izq == '(' and der == ')':
return True
return False
lista = []
for i in range(len(texto)):
if texto[i] == '[' or texto[i] == '{' or texto[i] == '(':
lista.append(texto[i])
elif texto[i] == ']' or texto[i] == '}' or texto[i] == ')':
if validacion(lista[-1], texto[i] or len(lista) != 0):
lista.pop()
else:
return False
if len(lista) == 0:
return True
else:
return False
def main():
text = input('Input: ')
print(es_valida(text))
main()
|
# -*- coding: utf-8 -*-
"""
pyglobi.config
~~~~~~~~~~~~
Configuration used by pyglobi
:copyright: (c) 2019 by Chris Nicholas.
:license: MIT, see LICENSE for more details.
"""
# Base URL's
globi_neo_url = "https://neo4j.globalbioticinteractions.org/db/data/cypher"
eol_url = "https://eol.org/pages"
eol_geo_url = "https://eol.org/data/map_data_dwca"
|
"""
pyglobi.config
~~~~~~~~~~~~
Configuration used by pyglobi
:copyright: (c) 2019 by Chris Nicholas.
:license: MIT, see LICENSE for more details.
"""
globi_neo_url = 'https://neo4j.globalbioticinteractions.org/db/data/cypher'
eol_url = 'https://eol.org/pages'
eol_geo_url = 'https://eol.org/data/map_data_dwca'
|
class Stock():
def __init__(self,code,name,price):
self.code = code
self.name = name
self.price = price
def __str__(self):
return 'code{},name{},price{}'.format(self.code,self.name,self.price)
|
class Stock:
def __init__(self, code, name, price):
self.code = code
self.name = name
self.price = price
def __str__(self):
return 'code{},name{},price{}'.format(self.code, self.name, self.price)
|
"""Convert a Decimal Number to a Binary Number."""
def decimal_to_binary(decimal: int) -> str:
rem , bin , c = 0 , 0 , 0
is_negative = '-' if decimal < 0 else ''
decimal = abs(decimal)
while decimal > 0:
rem = decimal % 2
bin += rem * pow(10 , c)
c += 1
decimal //= 2
return f'{is_negative}0b{bin}'
def decimal_to_binary_v2(decimal: int) ->str:
if not isinstance(decimal , int):
raise TypeError("You must enter integer value")
if decimal == 0:
return '0b0'
is_negative = False
if decimal < 0:
is_negative = True
decimal = -decimal
binary: list[int] = []
while decimal > 0:
binary.insert(0 , decimal % 2)
decimal >>= 1 # or num //= 2
if is_negative:
return '-0b' + ''.join( str(n) for n in binary )
else:
return '0b' + ''.join( str(n) for n in binary )
def binary_recursive(decimal: int) ->str:
if decimal in (0 , 1):
return str(decimal)
div , mod = divmod(decimal , 2)
return binary_recursive(div) + str(mod)
if __name__ == '__main__':
print( decimal_to_binary(-900) )
print( binary_recursive(900) )
print( decimal_to_binary_v2(-900) )
|
"""Convert a Decimal Number to a Binary Number."""
def decimal_to_binary(decimal: int) -> str:
(rem, bin, c) = (0, 0, 0)
is_negative = '-' if decimal < 0 else ''
decimal = abs(decimal)
while decimal > 0:
rem = decimal % 2
bin += rem * pow(10, c)
c += 1
decimal //= 2
return f'{is_negative}0b{bin}'
def decimal_to_binary_v2(decimal: int) -> str:
if not isinstance(decimal, int):
raise type_error('You must enter integer value')
if decimal == 0:
return '0b0'
is_negative = False
if decimal < 0:
is_negative = True
decimal = -decimal
binary: list[int] = []
while decimal > 0:
binary.insert(0, decimal % 2)
decimal >>= 1
if is_negative:
return '-0b' + ''.join((str(n) for n in binary))
else:
return '0b' + ''.join((str(n) for n in binary))
def binary_recursive(decimal: int) -> str:
if decimal in (0, 1):
return str(decimal)
(div, mod) = divmod(decimal, 2)
return binary_recursive(div) + str(mod)
if __name__ == '__main__':
print(decimal_to_binary(-900))
print(binary_recursive(900))
print(decimal_to_binary_v2(-900))
|
line = input().split()
a = int(line[0])
b = int(line[1])
hour = 0
total = a
burned = 0
while(total > 0):
total -= 1
burned += 1
if(burned % b == 0):
total += 1
hour += 1
print(str(hour))
|
line = input().split()
a = int(line[0])
b = int(line[1])
hour = 0
total = a
burned = 0
while total > 0:
total -= 1
burned += 1
if burned % b == 0:
total += 1
hour += 1
print(str(hour))
|
class Solution(object):
def merge(self, intervals):
"""
:type intervals: List[List[int]]
:rtype: List[List[int]]
"""
length = len(intervals)
if length == 0 or not intervals[0]:
return intervals
intervals = sorted(intervals, key=lambda x: x[0])
op = []
tmp = intervals[0]
for i in range(1, length):
if intervals[i][0] > tmp[1]:
op.append(tmp)
tmp = intervals[i]
else:
tmp = [tmp[0], max(tmp[1], intervals[i][1])]
op.append(tmp)
return op
|
class Solution(object):
def merge(self, intervals):
"""
:type intervals: List[List[int]]
:rtype: List[List[int]]
"""
length = len(intervals)
if length == 0 or not intervals[0]:
return intervals
intervals = sorted(intervals, key=lambda x: x[0])
op = []
tmp = intervals[0]
for i in range(1, length):
if intervals[i][0] > tmp[1]:
op.append(tmp)
tmp = intervals[i]
else:
tmp = [tmp[0], max(tmp[1], intervals[i][1])]
op.append(tmp)
return op
|
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
class Export:
def __init__(self, export: dict):
self.id = export.get("id")
self.display_name = export.get("displayName")
self.enabled = export.get("enabled")
self.source = export.get("source")
self.filter = export.get("filter")
self.destinations = export.get("destinations")
self.errors = export.get("errors")
self.status = export.get("status")
self.enrichment = export.get("enrichments")
|
class Export:
def __init__(self, export: dict):
self.id = export.get('id')
self.display_name = export.get('displayName')
self.enabled = export.get('enabled')
self.source = export.get('source')
self.filter = export.get('filter')
self.destinations = export.get('destinations')
self.errors = export.get('errors')
self.status = export.get('status')
self.enrichment = export.get('enrichments')
|
# -*- coding: utf-8 -*-
"""
Resource module
"""
# pylint: disable=too-few-public-methods
class Resource:
"""
Used for representing Conjur resources
"""
def __init__(self, type_:type, name:str):
self.type = type_
self.name = name
def full_id(self):
"""
Method for building the full resource ID in the format 'user:someuser' for example
"""
return f"{self.type}:{self.name}"
def __eq__(self, other):
"""
Method for comparing resources by their values and not by reference
"""
return self.type == other.type and self.name == other.name
def __repr__(self):
return f"'type': '{self.type}', 'name': '{self.name}'"
|
"""
Resource module
"""
class Resource:
"""
Used for representing Conjur resources
"""
def __init__(self, type_: type, name: str):
self.type = type_
self.name = name
def full_id(self):
"""
Method for building the full resource ID in the format 'user:someuser' for example
"""
return f'{self.type}:{self.name}'
def __eq__(self, other):
"""
Method for comparing resources by their values and not by reference
"""
return self.type == other.type and self.name == other.name
def __repr__(self):
return f"'type': '{self.type}', 'name': '{self.name}'"
|
__package__ = 'tkgeom'
__title__ = 'tkgeom'
__description__ = '2D geometry module as an example for the TK workshop'
__copyright__ = '2019, Zs. Elter'
__version__ = '1.0.0'
|
__package__ = 'tkgeom'
__title__ = 'tkgeom'
__description__ = '2D geometry module as an example for the TK workshop'
__copyright__ = '2019, Zs. Elter'
__version__ = '1.0.0'
|
'''
Copyright (c) 2014, Aaron Westendorf All rights reserved.
https://github.com/agoragames/pluto/blob/master/LICENSE.txt
'''
|
"""
Copyright (c) 2014, Aaron Westendorf All rights reserved.
https://github.com/agoragames/pluto/blob/master/LICENSE.txt
"""
|
def id(message):
# Define empty variables
fu_userid = False
rt_userid = False
rf_userid = False
gp_groupid = False
# the 'From User' data
fu_username = message.from_user.username
fu_userid = message.from_user.id
fu_fullname = message.from_user.first_name.encode("utf-8")
# check for 'Replied to' message
if message.reply_to_message:
# the 'Replied To' data
rt_userid = message.reply_to_message.from_user.id
rt_fullname = message.reply_to_message.from_user.first_name.encode("utf-8")
rt_username = message.reply_to_message.from_user.username
if message.reply_to_message.forward_from:
# the 'Replied to, Forwarded' data
rf_userid = message.reply_to_message.forward_from.id
rf_fullname = message.reply_to_message.forward_from.first_name.encode("utf-8")
rf_username = message.reply_to_message.forward_from.username
if "group" in message.chat.type:
# the 'Group' data
gp_groupid = message.chat.id
gp_fullname = message.chat.title.encode("utf-8")
# Send message
text = "<code>Your data:</code> \n- <b>Username:</b> @{0}\n- <b>Full name:</b> {1}\n- <b>UserID:</b> {2}".format(fu_username, fu_fullname, fu_userid)
if rt_userid:
text = text + "\n\n<code>Replied-to-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rt_username, rt_fullname, rt_userid)
if rf_userid:
text = text + "\n\n<code>Replied-to-forwarded-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rf_username, rf_fullname, rf_userid)
if gp_groupid:
text = text + "\n\n<code>Group data:</code> \n- <b>Group's title:</b> {1}\n- <b>Group's ID:</b> {0}".format(gp_groupid, gp_fullname)
bot.send_message(message.chat.id, text, parse_mode="HTML")
class plid:
patterns=["^[/!]id(.*)$"]
|
def id(message):
fu_userid = False
rt_userid = False
rf_userid = False
gp_groupid = False
fu_username = message.from_user.username
fu_userid = message.from_user.id
fu_fullname = message.from_user.first_name.encode('utf-8')
if message.reply_to_message:
rt_userid = message.reply_to_message.from_user.id
rt_fullname = message.reply_to_message.from_user.first_name.encode('utf-8')
rt_username = message.reply_to_message.from_user.username
if message.reply_to_message.forward_from:
rf_userid = message.reply_to_message.forward_from.id
rf_fullname = message.reply_to_message.forward_from.first_name.encode('utf-8')
rf_username = message.reply_to_message.forward_from.username
if 'group' in message.chat.type:
gp_groupid = message.chat.id
gp_fullname = message.chat.title.encode('utf-8')
text = '<code>Your data:</code> \n- <b>Username:</b> @{0}\n- <b>Full name:</b> {1}\n- <b>UserID:</b> {2}'.format(fu_username, fu_fullname, fu_userid)
if rt_userid:
text = text + "\n\n<code>Replied-to-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rt_username, rt_fullname, rt_userid)
if rf_userid:
text = text + "\n\n<code>Replied-to-forwarded-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rf_username, rf_fullname, rf_userid)
if gp_groupid:
text = text + "\n\n<code>Group data:</code> \n- <b>Group's title:</b> {1}\n- <b>Group's ID:</b> {0}".format(gp_groupid, gp_fullname)
bot.send_message(message.chat.id, text, parse_mode='HTML')
class Plid:
patterns = ['^[/!]id(.*)$']
|
txt = "banana"
x = txt.ljust(20)
print(x, "is my favorite fruit.")
|
txt = 'banana'
x = txt.ljust(20)
print(x, 'is my favorite fruit.')
|
class Solution:
def count_l(self, a_list: list):
a, b = a_list
return a*a + b*b
def kClosest(self, points, K):
"""
:type points: List[List[int]]
:type K: int
:rtype: List[List[int]]
"""
m = list()
tmp = dict()
for point in points:
l = self.count_l(point)
if not tmp.get(l):
m.append(l)
tmp[l] = [point]
else:
tmp[l].append(point)
m.sort()
res = []
for x in m:
if len(res) == K:
break
for a in tmp[x]:
res.append(a)
if len(res) == K:
break
return res
if __name__ == '__main__':
s = Solution()
print(s.kClosest(points = [[1,3],[-2,2]], K = 1))
|
class Solution:
def count_l(self, a_list: list):
(a, b) = a_list
return a * a + b * b
def k_closest(self, points, K):
"""
:type points: List[List[int]]
:type K: int
:rtype: List[List[int]]
"""
m = list()
tmp = dict()
for point in points:
l = self.count_l(point)
if not tmp.get(l):
m.append(l)
tmp[l] = [point]
else:
tmp[l].append(point)
m.sort()
res = []
for x in m:
if len(res) == K:
break
for a in tmp[x]:
res.append(a)
if len(res) == K:
break
return res
if __name__ == '__main__':
s = solution()
print(s.kClosest(points=[[1, 3], [-2, 2]], K=1))
|
pkgname = "gnome-menus"
pkgver = "3.36.0"
pkgrel = 0
build_style = "gnu_configure"
configure_args = ["--disable-static"]
make_cmd = "gmake"
hostmakedepends = [
"gmake", "pkgconf", "gobject-introspection", "glib-devel", "gettext-tiny"
]
makedepends = ["libglib-devel"]
pkgdesc = "GNOME menu definitions"
maintainer = "q66 <q66@chimera-linux.org>"
license = "GPL-2.0-or-later AND LGPL-2.0-or-later"
url = "https://gitlab.gnome.org/GNOME/gnome-menus"
source = f"$(GNOME_SITE)/{pkgname}/{pkgver[:-2]}/{pkgname}-{pkgver}.tar.xz"
sha256 = "d9348f38bde956fc32753b28c1cde19c175bfdbf1f4d5b06003b3aa09153bb1f"
@subpackage("gnome-menus-devel")
def _devel(self):
return self.default_devel()
|
pkgname = 'gnome-menus'
pkgver = '3.36.0'
pkgrel = 0
build_style = 'gnu_configure'
configure_args = ['--disable-static']
make_cmd = 'gmake'
hostmakedepends = ['gmake', 'pkgconf', 'gobject-introspection', 'glib-devel', 'gettext-tiny']
makedepends = ['libglib-devel']
pkgdesc = 'GNOME menu definitions'
maintainer = 'q66 <q66@chimera-linux.org>'
license = 'GPL-2.0-or-later AND LGPL-2.0-or-later'
url = 'https://gitlab.gnome.org/GNOME/gnome-menus'
source = f'$(GNOME_SITE)/{pkgname}/{pkgver[:-2]}/{pkgname}-{pkgver}.tar.xz'
sha256 = 'd9348f38bde956fc32753b28c1cde19c175bfdbf1f4d5b06003b3aa09153bb1f'
@subpackage('gnome-menus-devel')
def _devel(self):
return self.default_devel()
|
#!/usr/bin/env python3
class BaseError(Exception):
def __init__(self, message):
self.message = message
class LoggedOutError(BaseError):
def __init__(self):
super(LoggedOutError, self).__init__("User is currently not logged In")
# self.message = "User is currently not logged In"
class LoginExpiredError(BaseError):
def __init__(self):
super(LoginExpiredError, self).__init__("User's logged has expired")
class LoginRevokedError(BaseError):
def __init__(self):
super(LoginRevokedError, self).__init__(
"User's logged access has been revoked")
class InvalidReviewerPositionError(BaseError):
def __init__(self):
message = (
"The position of the reviewer you provided is not "
"allowed to review payment voucher at this review stage"
)
super(InvalidReviewerPositionError, self).__init__(message)
class DeletedReviewerError(BaseError):
def __init__(self):
message = (
"The reviewer you selected has been deleted so they can't be "
"selected as a reviewer for any payment vouchers"
)
super(DeletedReviewerError, self).__init__(message)
class ReviewerNotFoundError(BaseError):
def __init__(self):
message = (
"The reviewer you selected doesn't exist check and try again"
)
super(ReviewerNotFoundError, self).__init__(message)
class InvalidReviewerError(BaseError):
def __init__(self):
message = (
"Reviewer is not authorized to review this payment voucher"
)
super(InvalidReviewerError, self).__init__(message)
class EndPaymentReviewProcessError(BaseError):
def __init__(self):
message = (
"Payment voucher has reach the end of the review process. "
"So you might want to pay or reject the payment"
)
super(EndPaymentReviewProcessError, self).__init__(message)
class InvalidVoucherStageError(BaseError):
def __init__(self, message):
super(InvalidVoucherStageError, self).__init__(message)
class InvalidPayingOfficer(BaseError):
def __init__(self):
super(InvalidPayingOfficer, self).__init__(
'You are not the authorized cashier for this transaction')
|
class Baseerror(Exception):
def __init__(self, message):
self.message = message
class Loggedouterror(BaseError):
def __init__(self):
super(LoggedOutError, self).__init__('User is currently not logged In')
class Loginexpirederror(BaseError):
def __init__(self):
super(LoginExpiredError, self).__init__("User's logged has expired")
class Loginrevokederror(BaseError):
def __init__(self):
super(LoginRevokedError, self).__init__("User's logged access has been revoked")
class Invalidreviewerpositionerror(BaseError):
def __init__(self):
message = 'The position of the reviewer you provided is not allowed to review payment voucher at this review stage'
super(InvalidReviewerPositionError, self).__init__(message)
class Deletedreviewererror(BaseError):
def __init__(self):
message = "The reviewer you selected has been deleted so they can't be selected as a reviewer for any payment vouchers"
super(DeletedReviewerError, self).__init__(message)
class Reviewernotfounderror(BaseError):
def __init__(self):
message = "The reviewer you selected doesn't exist check and try again"
super(ReviewerNotFoundError, self).__init__(message)
class Invalidreviewererror(BaseError):
def __init__(self):
message = 'Reviewer is not authorized to review this payment voucher'
super(InvalidReviewerError, self).__init__(message)
class Endpaymentreviewprocesserror(BaseError):
def __init__(self):
message = 'Payment voucher has reach the end of the review process. So you might want to pay or reject the payment'
super(EndPaymentReviewProcessError, self).__init__(message)
class Invalidvoucherstageerror(BaseError):
def __init__(self, message):
super(InvalidVoucherStageError, self).__init__(message)
class Invalidpayingofficer(BaseError):
def __init__(self):
super(InvalidPayingOfficer, self).__init__('You are not the authorized cashier for this transaction')
|
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Config to train MobileNet."""
MOBILENET_CFG = {
'use_tpu': True,
'train_batch_size': 1024,
'train_steps': 8000000,
'eval_batch_size': 1024,
'iterations_per_loop': 100,
'num_cores': 8,
'eval_total_size': 0,
'train_steps_per_eval': 2000,
'min_eval_interval': 180,
'learning_rate': 0.165,
'depth_multiplier': 1.0,
'optimizer': 'RMS',
'num_classes': 1001,
'use_fused_batchnorm': True,
'moving_average': True,
'learning_rate_decay': 0.94,
'learning_rate_decay_epochs': 3,
'use_logits': True,
'clear_update_collections': True,
'transpose_enabled': False,
'serving_image_size': 224,
'post_quantize': True,
'num_train_images': 1281167,
'num_eval_images': 50000,
}
MOBILENET_RESTRICTIONS = [
]
|
"""Config to train MobileNet."""
mobilenet_cfg = {'use_tpu': True, 'train_batch_size': 1024, 'train_steps': 8000000, 'eval_batch_size': 1024, 'iterations_per_loop': 100, 'num_cores': 8, 'eval_total_size': 0, 'train_steps_per_eval': 2000, 'min_eval_interval': 180, 'learning_rate': 0.165, 'depth_multiplier': 1.0, 'optimizer': 'RMS', 'num_classes': 1001, 'use_fused_batchnorm': True, 'moving_average': True, 'learning_rate_decay': 0.94, 'learning_rate_decay_epochs': 3, 'use_logits': True, 'clear_update_collections': True, 'transpose_enabled': False, 'serving_image_size': 224, 'post_quantize': True, 'num_train_images': 1281167, 'num_eval_images': 50000}
mobilenet_restrictions = []
|
pkgname = "python-py"
pkgver = "1.11.0"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools_scm"]
checkdepends = ["python-pytest"]
depends = ["python"]
pkgdesc = "Python development support library"
maintainer = "q66 <q66@chimera-linux.org>"
license = "MIT"
url = "https://github.com/pytest-dev/py"
source = f"$(PYPI_SITE)/p/py/py-{pkgver}.tar.gz"
sha256 = "51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"
# dependency of pytest
options = ["!check"]
def post_install(self):
self.install_license("LICENSE")
|
pkgname = 'python-py'
pkgver = '1.11.0'
pkgrel = 0
build_style = 'python_module'
hostmakedepends = ['python-setuptools_scm']
checkdepends = ['python-pytest']
depends = ['python']
pkgdesc = 'Python development support library'
maintainer = 'q66 <q66@chimera-linux.org>'
license = 'MIT'
url = 'https://github.com/pytest-dev/py'
source = f'$(PYPI_SITE)/p/py/py-{pkgver}.tar.gz'
sha256 = '51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719'
options = ['!check']
def post_install(self):
self.install_license('LICENSE')
|
test_input = """35
20
15
25
47
40
62
55
65
95
102
117
150
182
127
219
299
277
309
576
"""
def find_number(numbers, preamble_size):
for number_index in range(preamble_size, len(numbers)):
number = numbers[number_index]
breaked = False
start = number_index - preamble_size
for first_number_index in range(start, start + preamble_size):
for second_number_index in range(first_number_index + 1, start + preamble_size):
first = int(numbers[first_number_index])
second = int(numbers[second_number_index])
# print(f"{first} + {second} == {number} {first+second}")
if (first + second == int(number)):
breaked = True
break
if breaked:
break
if not breaked:
print(f"Did not find a pattern for {number}")
return number
def find_number_set(numbers, number_to_find):
found_first_number_index = 0
found_second_number_index = 0
for number_index in range(0, len(numbers)):
breaked = False
start = number_index
for first_number_index in range(start, len(numbers)-1):
total = int(numbers[first_number_index])
for second_number_index in range(first_number_index + 1, len(numbers)):
total += int(numbers[second_number_index])
if total == int(number_to_find):
found_first_number_index = first_number_index
found_second_number_index = second_number_index
#print(f"{total} == {number_to_find}")
breaked = True
break
elif total > int(number_to_find):
breaked = False
break
if breaked:
break
if breaked:
# print(
# f"{found_first_number_index} {found_second_number_index} {number}")
return (found_first_number_index, found_second_number_index)
return (0, 0)
def find_crypt_weakness(input, start_index, end_index):
numbers = []
total = 0
for index in range(start_index, end_index + 1):
total += int(input[index])
numbers.append(int(input[index]))
print(total)
numbers.sort()
return int(numbers[0]) + int(numbers[-1])
number = find_number(test_input.splitlines(), 5)
(start_index, end_index) = find_number_set(test_input.splitlines(), number)
weakness = find_crypt_weakness(test_input.splitlines(), start_index, end_index)
print(weakness)
with open("input.txt", "r") as file:
input = file.readlines()
number = find_number(input, 25)
(start_index, end_index) = find_number_set(input, number)
weakness = find_crypt_weakness(input, start_index, end_index)
print(weakness)
|
test_input = '35\n20\n15\n25\n47\n40\n62\n55\n65\n95\n102\n117\n150\n182\n127\n219\n299\n277\n309\n576\n'
def find_number(numbers, preamble_size):
for number_index in range(preamble_size, len(numbers)):
number = numbers[number_index]
breaked = False
start = number_index - preamble_size
for first_number_index in range(start, start + preamble_size):
for second_number_index in range(first_number_index + 1, start + preamble_size):
first = int(numbers[first_number_index])
second = int(numbers[second_number_index])
if first + second == int(number):
breaked = True
break
if breaked:
break
if not breaked:
print(f'Did not find a pattern for {number}')
return number
def find_number_set(numbers, number_to_find):
found_first_number_index = 0
found_second_number_index = 0
for number_index in range(0, len(numbers)):
breaked = False
start = number_index
for first_number_index in range(start, len(numbers) - 1):
total = int(numbers[first_number_index])
for second_number_index in range(first_number_index + 1, len(numbers)):
total += int(numbers[second_number_index])
if total == int(number_to_find):
found_first_number_index = first_number_index
found_second_number_index = second_number_index
breaked = True
break
elif total > int(number_to_find):
breaked = False
break
if breaked:
break
if breaked:
return (found_first_number_index, found_second_number_index)
return (0, 0)
def find_crypt_weakness(input, start_index, end_index):
numbers = []
total = 0
for index in range(start_index, end_index + 1):
total += int(input[index])
numbers.append(int(input[index]))
print(total)
numbers.sort()
return int(numbers[0]) + int(numbers[-1])
number = find_number(test_input.splitlines(), 5)
(start_index, end_index) = find_number_set(test_input.splitlines(), number)
weakness = find_crypt_weakness(test_input.splitlines(), start_index, end_index)
print(weakness)
with open('input.txt', 'r') as file:
input = file.readlines()
number = find_number(input, 25)
(start_index, end_index) = find_number_set(input, number)
weakness = find_crypt_weakness(input, start_index, end_index)
print(weakness)
|
n = int(input())
nums = list(map(int, input().strip().split()))
print(min(nums) * max(nums))
|
n = int(input())
nums = list(map(int, input().strip().split()))
print(min(nums) * max(nums))
|
line = Line()
line.xValues = [2, 1, 3, 4, 0]
line.yValues = [2, 1, 3, 4, 0]
plot = Plot()
plot.add(line)
plot.save("unordered.png")
|
line = line()
line.xValues = [2, 1, 3, 4, 0]
line.yValues = [2, 1, 3, 4, 0]
plot = plot()
plot.add(line)
plot.save('unordered.png')
|
'''
Created on Oct 31, 2013/.>"
@author: rgeorgi
'''
class TextParser(object):
'''
classdocs
'''
def parse(self):
pass
def __init__(self):
'''
Constructor
'''
class ParserException(Exception):
pass
|
"""
Created on Oct 31, 2013/.>"
@author: rgeorgi
"""
class Textparser(object):
"""
classdocs
"""
def parse(self):
pass
def __init__(self):
"""
Constructor
"""
class Parserexception(Exception):
pass
|
# -*- coding: utf-8 -*-
"""
999. Available Captures for Rook
On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns.
These are given as characters 'R', '.', 'B', and 'p' respectively.
Uppercase characters represent white pieces, and lowercase characters represent black pieces.
The rook moves as in the rules of Chess: it chooses one of four cardinal directions (north, east, west, and south),
then moves in that direction until it chooses to stop, reaches the edge of the board,
or captures an opposite colored pawn by moving to the same square it occupies.
Also, rooks cannot move into the same square as other friendly bishops.
Return the number of pawns the rook can capture in one move.
Note:
board.length == board[i].length == 8
board[i][j] is either 'R', '.', 'B', or 'p'
There is exactly one cell with board[i][j] == 'R'
"""
class Solution:
def numRookCaptures(self, board) -> int:
res = 0
for r_ind, row in enumerate(board):
try:
c_ind = row.index("R")
except ValueError:
continue
# left
cur_c = c_ind - 1
while cur_c >= 0:
if row[cur_c] == ".":
pass
else:
if row[cur_c] == "p":
res += 1
break
cur_c -= 1
# right
cur_c = c_ind + 1
while cur_c <= 7:
if row[cur_c] == ".":
pass
else:
if row[cur_c] == "p":
res += 1
break
cur_c += 1
# up
cur_r = r_ind - 1
while cur_r >= 0:
if board[cur_r][c_ind] == ".":
pass
else:
if board[cur_r][c_ind] == "p":
res += 1
break
cur_r -= 1
# down
cur_r = r_ind + 1
while cur_r <= 7:
if board[cur_r][c_ind] == ".":
pass
else:
if board[cur_r][c_ind] == "p":
res += 1
break
cur_r += 1
return res
|
"""
999. Available Captures for Rook
On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns.
These are given as characters 'R', '.', 'B', and 'p' respectively.
Uppercase characters represent white pieces, and lowercase characters represent black pieces.
The rook moves as in the rules of Chess: it chooses one of four cardinal directions (north, east, west, and south),
then moves in that direction until it chooses to stop, reaches the edge of the board,
or captures an opposite colored pawn by moving to the same square it occupies.
Also, rooks cannot move into the same square as other friendly bishops.
Return the number of pawns the rook can capture in one move.
Note:
board.length == board[i].length == 8
board[i][j] is either 'R', '.', 'B', or 'p'
There is exactly one cell with board[i][j] == 'R'
"""
class Solution:
def num_rook_captures(self, board) -> int:
res = 0
for (r_ind, row) in enumerate(board):
try:
c_ind = row.index('R')
except ValueError:
continue
cur_c = c_ind - 1
while cur_c >= 0:
if row[cur_c] == '.':
pass
else:
if row[cur_c] == 'p':
res += 1
break
cur_c -= 1
cur_c = c_ind + 1
while cur_c <= 7:
if row[cur_c] == '.':
pass
else:
if row[cur_c] == 'p':
res += 1
break
cur_c += 1
cur_r = r_ind - 1
while cur_r >= 0:
if board[cur_r][c_ind] == '.':
pass
else:
if board[cur_r][c_ind] == 'p':
res += 1
break
cur_r -= 1
cur_r = r_ind + 1
while cur_r <= 7:
if board[cur_r][c_ind] == '.':
pass
else:
if board[cur_r][c_ind] == 'p':
res += 1
break
cur_r += 1
return res
|
class UIColors:
"color indices for UI (c64 original) palette"
white = 2
lightgrey = 16
medgrey = 13
darkgrey = 12
black = 1
yellow = 8
red = 3
brightred = 11
|
class Uicolors:
"""color indices for UI (c64 original) palette"""
white = 2
lightgrey = 16
medgrey = 13
darkgrey = 12
black = 1
yellow = 8
red = 3
brightred = 11
|
# Time: O (N ^ 2) | Space: O(N)
def arrayOfProducts(array):
output = []
for i in range(len(array)):
product = 1
for j in range(len(array)):
if i != j:
product = product * array[j]
output.append(product)
return output
# Time: O(N) | Space: O(N)
def arrayOfProductsN(array):
left = [1 for i in range(len(array))]
right = [1 for i in range(len(array))]
output = [1 for i in range(len(array))]
prodL = 1
prodR = 1
idx = len(array) - 1
# Make left product array
for i in range(len(array)):
left[i] = prodL
prodL = prodL * array[i]
# Make right product array
while idx >= 0:
right[idx] = prodR
prodR = prodR * array[idx]
idx -= 1
# Merge
for i in range(len(array)):
output[i] = left[i] * right[i]
return output
|
def array_of_products(array):
output = []
for i in range(len(array)):
product = 1
for j in range(len(array)):
if i != j:
product = product * array[j]
output.append(product)
return output
def array_of_products_n(array):
left = [1 for i in range(len(array))]
right = [1 for i in range(len(array))]
output = [1 for i in range(len(array))]
prod_l = 1
prod_r = 1
idx = len(array) - 1
for i in range(len(array)):
left[i] = prodL
prod_l = prodL * array[i]
while idx >= 0:
right[idx] = prodR
prod_r = prodR * array[idx]
idx -= 1
for i in range(len(array)):
output[i] = left[i] * right[i]
return output
|
# -*- coding = utf-8 -*-
# @Time:2021/2/2821:58
# @Author:Linyu
# @Software:PyCharm
def response(flow):
print(flow.request.url)
print(flow.response.text)
|
def response(flow):
print(flow.request.url)
print(flow.response.text)
|
# example of how to display octal and hexa values
a = 0o25
b = 0x1af
print('Value of a in decimal is ', a)
c = 19
print('19 in octal is %o and in hex is %x' % (c, c))
d = oct(c)
e = hex(c)
print('19 in octal is', d, ' and in hex is ', e)
|
a = 21
b = 431
print('Value of a in decimal is ', a)
c = 19
print('19 in octal is %o and in hex is %x' % (c, c))
d = oct(c)
e = hex(c)
print('19 in octal is', d, ' and in hex is ', e)
|
states_in_order_of_founding = ("Delaware", "Pennsylvania", "New Jersey", "Georgia")
# You use parentheses instead of square brackets.
print(states_in_order_of_founding)
second_state_founded = states_in_order_of_founding[1]
print("The second state founded was " + second_state_founded)
|
states_in_order_of_founding = ('Delaware', 'Pennsylvania', 'New Jersey', 'Georgia')
print(states_in_order_of_founding)
second_state_founded = states_in_order_of_founding[1]
print('The second state founded was ' + second_state_founded)
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
nitram_micro_mono_CP437 = [
0, 0, 0, 0, 0,
10, 0, 4, 17, 14,
10, 0, 0, 14, 17,
27, 31, 31, 14, 4,
0, 0, 0, 0, 0,
0, 4, 10, 4, 14,
4, 14, 14, 4, 14,
0, 14, 14, 14, 0,
0, 0, 0, 0, 0,
0, 4, 10, 4, 0,
0, 0, 0, 0, 0,
30, 28, 31, 21, 7,
5, 13, 31, 12, 4,
20, 22, 31, 6, 4,
15, 10, 10, 10, 5,
21, 14, 27, 14, 21,
4, 12, 28, 12, 4,
4, 6, 7, 6, 4,
4, 14, 4, 14, 4,
10, 10, 10, 0, 10,
12, 11, 10, 10, 10,
0, 0, 0, 0, 0,
0, 0, 0, 31, 31,
0, 0, 0, 0, 0,
4, 14, 21, 4, 4,
4, 4, 21, 14, 4,
4, 8, 31, 8, 4,
4, 2, 31, 2, 4,
0, 2, 2, 30, 0,
0, 14, 14, 14, 0,
4, 14, 31, 0, 0,
0, 0, 31, 14, 4,
0, 0, 0, 0, 0,
4, 4, 4, 0, 4,
10, 10, 0, 0, 0,
10, 31, 10, 31, 10,
31, 5, 31, 20, 31,
17, 8, 4, 2, 17,
6, 9, 22, 9, 22,
8, 4, 0, 0, 0,
8, 4, 4, 4, 8,
2, 4, 4, 4, 2,
21, 14, 31, 14, 21,
0, 4, 14, 4, 0,
0, 0, 0, 4, 2,
0, 0, 14, 0, 0,
0, 0, 0, 0, 2,
8, 4, 4, 4, 2,
14, 25, 21, 19, 14,
4, 6, 4, 4, 14,
14, 8, 14, 2, 14,
14, 8, 12, 8, 14,
2, 2, 10, 14, 8,
14, 2, 14, 8, 14,
6, 2, 14, 10, 14,
14, 8, 12, 8, 8,
14, 10, 14, 10, 14,
14, 10, 14, 8, 14,
0, 4, 0, 4, 0,
0, 4, 0, 4, 2,
8, 4, 2, 4, 8,
0, 14, 0, 14, 0,
2, 4, 8, 4, 2,
14, 17, 12, 0, 4,
14, 9, 5, 1, 14,
6, 9, 17, 31, 17,
7, 9, 15, 17, 15,
14, 17, 1, 17, 14,
15, 25, 17, 17, 15,
31, 1, 15, 1, 31,
31, 1, 15, 1, 1,
14, 1, 25, 17, 14,
9, 17, 31, 17, 17,
14, 4, 4, 4, 14,
12, 8, 8, 10, 14,
9, 5, 3, 5, 9,
1, 1, 1, 1, 15,
17, 27, 21, 17, 17,
17, 19, 21, 25, 17,
14, 25, 17, 17, 14,
7, 9, 7, 1, 1,
14, 17, 17, 25, 30,
7, 9, 7, 5, 9,
30, 1, 14, 16, 15,
31, 4, 4, 4, 4,
9, 17, 17, 17, 14,
10, 10, 10, 10, 4,
9, 17, 21, 21, 10,
17, 10, 4, 10, 17,
17, 10, 4, 4, 4,
31, 8, 4, 2, 31,
12, 4, 4, 4, 12,
2, 4, 4, 4, 8,
6, 4, 4, 4, 6,
4, 10, 0, 0, 0,
0, 0, 0, 0, 14,
4, 8, 0, 0, 0,
6, 9, 17, 31, 17,
7, 9, 15, 17, 15,
14, 17, 1, 17, 14,
15, 25, 17, 17, 15,
31, 1, 15, 1, 31,
31, 1, 15, 1, 1,
14, 1, 25, 17, 14,
9, 17, 31, 17, 17,
14, 4, 4, 4, 14,
12, 8, 8, 10, 14,
18, 10, 6, 10, 18,
1, 1, 1, 1, 15,
17, 27, 21, 17, 17,
17, 19, 21, 25, 17,
14, 25, 17, 17, 14,
7, 9, 7, 1, 1,
14, 17, 17, 25, 30,
7, 9, 7, 5, 9,
30, 1, 14, 16, 15,
31, 4, 4, 4, 4,
9, 17, 17, 17, 14,
10, 10, 10, 10, 4,
9, 17, 21, 21, 10,
17, 10, 4, 10, 17,
17, 10, 4, 4, 4,
31, 8, 4, 2, 31,
12, 4, 2, 4, 12,
4, 4, 4, 4, 4,
6, 4, 8, 4, 6,
10, 5, 0, 0, 0,
0, 4, 10, 10, 14,
0, 0, 0, 0, 0,
10, 0, 10, 10, 14,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
10, 0, 14, 10, 30,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
31, 17, 17, 17, 31,
0, 14, 10, 14, 0,
0, 0, 4, 0, 0,
0, 0, 0, 0, 0,
0, 0, 4, 0, 0,
0, 14, 10, 14, 0,
0, 0, 0, 0, 0,
10, 0, 14, 10, 30,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
10, 0, 14, 10, 14,
0, 0, 0, 0, 0,
3, 25, 11, 9, 11,
28, 23, 21, 21, 29,
0, 3, 1, 1, 1,
10, 0, 14, 10, 14,
10, 0, 10, 10, 14,
0, 0, 0, 0, 31,
0, 0, 0, 0, 0,
0, 0, 0, 0, 31,
0, 0, 0, 0, 0,
0, 0, 0, 0, 31,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
4, 0, 6, 17, 14,
0, 0, 28, 4, 4,
0, 0, 7, 4, 4,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
4, 0, 4, 4, 4,
4, 18, 9, 18, 4,
4, 9, 18, 9, 4,
0, 10, 0, 10, 0,
10, 21, 10, 21, 10,
21, 10, 21, 10, 21,
4, 4, 4, 4, 4,
4, 4, 7, 4, 4,
4, 7, 4, 7, 4,
10, 10, 11, 10, 10,
0, 0, 15, 10, 10,
0, 7, 4, 7, 4,
10, 11, 8, 11, 10,
10, 10, 10, 10, 10,
0, 15, 8, 11, 10,
10, 11, 8, 15, 0,
10, 10, 15, 0, 0,
4, 7, 4, 7, 0,
0, 0, 7, 4, 4,
4, 4, 28, 0, 0,
4, 4, 31, 0, 0,
0, 0, 31, 4, 4,
4, 4, 28, 4, 4,
0, 0, 31, 0, 0,
4, 4, 31, 4, 4,
4, 28, 4, 28, 4,
10, 10, 26, 10, 10,
10, 26, 2, 30, 0,
0, 30, 2, 26, 10,
10, 27, 0, 31, 0,
0, 31, 0, 27, 10,
10, 26, 2, 26, 10,
0, 31, 0, 31, 0,
10, 27, 0, 27, 10,
4, 31, 0, 31, 0,
10, 10, 31, 0, 0,
0, 31, 0, 31, 4,
0, 0, 31, 10, 10,
10, 10, 30, 0, 0,
4, 28, 4, 28, 0,
0, 28, 4, 28, 4,
0, 0, 30, 10, 10,
10, 10, 31, 10, 10,
4, 31, 4, 31, 4,
4, 4, 7, 0, 0,
0, 0, 28, 4, 4,
31, 31, 31, 31, 31,
0, 0, 31, 31, 31,
3, 3, 3, 3, 3,
24, 24, 24, 24, 24,
31, 31, 31, 0, 0,
0, 0, 0, 0, 0,
6, 9, 13, 17, 13,
0, 0, 0, 0, 0,
14, 17, 17, 17, 14,
0, 4, 10, 4, 0,
0, 0, 4, 0, 0,
0, 0, 0, 0, 0,
0, 0, 4, 0, 0,
0, 4, 10, 4, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 14, 31, 14, 0,
16, 14, 10, 14, 1,
12, 2, 14, 2, 12,
6, 9, 9, 9, 9,
14, 0, 14, 0, 14,
4, 14, 4, 0, 14,
2, 4, 8, 4, 14,
8, 4, 2, 4, 14,
8, 20, 4, 4, 4,
4, 4, 4, 5, 2,
4, 0, 14, 0, 4,
10, 5, 0, 10, 5,
4, 14, 4, 0, 0,
0, 14, 14, 14, 0,
0, 0, 4, 0, 0,
24, 8, 11, 10, 4,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0
]
|
nitram_micro_mono_cp437 = [0, 0, 0, 0, 0, 10, 0, 4, 17, 14, 10, 0, 0, 14, 17, 27, 31, 31, 14, 4, 0, 0, 0, 0, 0, 0, 4, 10, 4, 14, 4, 14, 14, 4, 14, 0, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 4, 10, 4, 0, 0, 0, 0, 0, 0, 30, 28, 31, 21, 7, 5, 13, 31, 12, 4, 20, 22, 31, 6, 4, 15, 10, 10, 10, 5, 21, 14, 27, 14, 21, 4, 12, 28, 12, 4, 4, 6, 7, 6, 4, 4, 14, 4, 14, 4, 10, 10, 10, 0, 10, 12, 11, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 31, 31, 0, 0, 0, 0, 0, 4, 14, 21, 4, 4, 4, 4, 21, 14, 4, 4, 8, 31, 8, 4, 4, 2, 31, 2, 4, 0, 2, 2, 30, 0, 0, 14, 14, 14, 0, 4, 14, 31, 0, 0, 0, 0, 31, 14, 4, 0, 0, 0, 0, 0, 4, 4, 4, 0, 4, 10, 10, 0, 0, 0, 10, 31, 10, 31, 10, 31, 5, 31, 20, 31, 17, 8, 4, 2, 17, 6, 9, 22, 9, 22, 8, 4, 0, 0, 0, 8, 4, 4, 4, 8, 2, 4, 4, 4, 2, 21, 14, 31, 14, 21, 0, 4, 14, 4, 0, 0, 0, 0, 4, 2, 0, 0, 14, 0, 0, 0, 0, 0, 0, 2, 8, 4, 4, 4, 2, 14, 25, 21, 19, 14, 4, 6, 4, 4, 14, 14, 8, 14, 2, 14, 14, 8, 12, 8, 14, 2, 2, 10, 14, 8, 14, 2, 14, 8, 14, 6, 2, 14, 10, 14, 14, 8, 12, 8, 8, 14, 10, 14, 10, 14, 14, 10, 14, 8, 14, 0, 4, 0, 4, 0, 0, 4, 0, 4, 2, 8, 4, 2, 4, 8, 0, 14, 0, 14, 0, 2, 4, 8, 4, 2, 14, 17, 12, 0, 4, 14, 9, 5, 1, 14, 6, 9, 17, 31, 17, 7, 9, 15, 17, 15, 14, 17, 1, 17, 14, 15, 25, 17, 17, 15, 31, 1, 15, 1, 31, 31, 1, 15, 1, 1, 14, 1, 25, 17, 14, 9, 17, 31, 17, 17, 14, 4, 4, 4, 14, 12, 8, 8, 10, 14, 9, 5, 3, 5, 9, 1, 1, 1, 1, 15, 17, 27, 21, 17, 17, 17, 19, 21, 25, 17, 14, 25, 17, 17, 14, 7, 9, 7, 1, 1, 14, 17, 17, 25, 30, 7, 9, 7, 5, 9, 30, 1, 14, 16, 15, 31, 4, 4, 4, 4, 9, 17, 17, 17, 14, 10, 10, 10, 10, 4, 9, 17, 21, 21, 10, 17, 10, 4, 10, 17, 17, 10, 4, 4, 4, 31, 8, 4, 2, 31, 12, 4, 4, 4, 12, 2, 4, 4, 4, 8, 6, 4, 4, 4, 6, 4, 10, 0, 0, 0, 0, 0, 0, 0, 14, 4, 8, 0, 0, 0, 6, 9, 17, 31, 17, 7, 9, 15, 17, 15, 14, 17, 1, 17, 14, 15, 25, 17, 17, 15, 31, 1, 15, 1, 31, 31, 1, 15, 1, 1, 14, 1, 25, 17, 14, 9, 17, 31, 17, 17, 14, 4, 4, 4, 14, 12, 8, 8, 10, 14, 18, 10, 6, 10, 18, 1, 1, 1, 1, 15, 17, 27, 21, 17, 17, 17, 19, 21, 25, 17, 14, 25, 17, 17, 14, 7, 9, 7, 1, 1, 14, 17, 17, 25, 30, 7, 9, 7, 5, 9, 30, 1, 14, 16, 15, 31, 4, 4, 4, 4, 9, 17, 17, 17, 14, 10, 10, 10, 10, 4, 9, 17, 21, 21, 10, 17, 10, 4, 10, 17, 17, 10, 4, 4, 4, 31, 8, 4, 2, 31, 12, 4, 2, 4, 12, 4, 4, 4, 4, 4, 6, 4, 8, 4, 6, 10, 5, 0, 0, 0, 0, 4, 10, 10, 14, 0, 0, 0, 0, 0, 10, 0, 10, 10, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 10, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 17, 17, 17, 31, 0, 14, 10, 14, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 14, 10, 14, 0, 0, 0, 0, 0, 0, 10, 0, 14, 10, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 10, 14, 0, 0, 0, 0, 0, 3, 25, 11, 9, 11, 28, 23, 21, 21, 29, 0, 3, 1, 1, 1, 10, 0, 14, 10, 14, 10, 0, 10, 10, 14, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6, 17, 14, 0, 0, 28, 4, 4, 0, 0, 7, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 4, 18, 9, 18, 4, 4, 9, 18, 9, 4, 0, 10, 0, 10, 0, 10, 21, 10, 21, 10, 21, 10, 21, 10, 21, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 7, 4, 7, 4, 10, 10, 11, 10, 10, 0, 0, 15, 10, 10, 0, 7, 4, 7, 4, 10, 11, 8, 11, 10, 10, 10, 10, 10, 10, 0, 15, 8, 11, 10, 10, 11, 8, 15, 0, 10, 10, 15, 0, 0, 4, 7, 4, 7, 0, 0, 0, 7, 4, 4, 4, 4, 28, 0, 0, 4, 4, 31, 0, 0, 0, 0, 31, 4, 4, 4, 4, 28, 4, 4, 0, 0, 31, 0, 0, 4, 4, 31, 4, 4, 4, 28, 4, 28, 4, 10, 10, 26, 10, 10, 10, 26, 2, 30, 0, 0, 30, 2, 26, 10, 10, 27, 0, 31, 0, 0, 31, 0, 27, 10, 10, 26, 2, 26, 10, 0, 31, 0, 31, 0, 10, 27, 0, 27, 10, 4, 31, 0, 31, 0, 10, 10, 31, 0, 0, 0, 31, 0, 31, 4, 0, 0, 31, 10, 10, 10, 10, 30, 0, 0, 4, 28, 4, 28, 0, 0, 28, 4, 28, 4, 0, 0, 30, 10, 10, 10, 10, 31, 10, 10, 4, 31, 4, 31, 4, 4, 4, 7, 0, 0, 0, 0, 28, 4, 4, 31, 31, 31, 31, 31, 0, 0, 31, 31, 31, 3, 3, 3, 3, 3, 24, 24, 24, 24, 24, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 6, 9, 13, 17, 13, 0, 0, 0, 0, 0, 14, 17, 17, 17, 14, 0, 4, 10, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 31, 14, 0, 16, 14, 10, 14, 1, 12, 2, 14, 2, 12, 6, 9, 9, 9, 9, 14, 0, 14, 0, 14, 4, 14, 4, 0, 14, 2, 4, 8, 4, 14, 8, 4, 2, 4, 14, 8, 20, 4, 4, 4, 4, 4, 4, 5, 2, 4, 0, 14, 0, 4, 10, 5, 0, 10, 5, 4, 14, 4, 0, 0, 0, 14, 14, 14, 0, 0, 0, 4, 0, 0, 24, 8, 11, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
def is_same_string(string1, string2):
if len(string1) != len(string2):
return False
else:
for i in range(len(string1)):
if string1[i] != string2[i]:
return False
return True
def reverse_string(string):
gnirts = ''
for i in range(len(string)):
gnirts += string[-1-i]
return gnirts
def is_palindrome(string):
gnirts = reverse_string(string)
return(is_same_string(string, gnirts))
n = 0
for i in range(100, 1000):
for j in range(i, 1000):
if is_palindrome(str(i*j)) and i*j > n:
n = i*j
print(n)
|
def is_same_string(string1, string2):
if len(string1) != len(string2):
return False
else:
for i in range(len(string1)):
if string1[i] != string2[i]:
return False
return True
def reverse_string(string):
gnirts = ''
for i in range(len(string)):
gnirts += string[-1 - i]
return gnirts
def is_palindrome(string):
gnirts = reverse_string(string)
return is_same_string(string, gnirts)
n = 0
for i in range(100, 1000):
for j in range(i, 1000):
if is_palindrome(str(i * j)) and i * j > n:
n = i * j
print(n)
|
class AccessKeyEventArgs(EventArgs):
""" Provides information for access keys events. """
IsMultiple=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that indicates whether other elements are invoked by the key.
Get: IsMultiple(self: AccessKeyEventArgs) -> bool
"""
Key=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the access keys that was pressed.
Get: Key(self: AccessKeyEventArgs) -> str
"""
|
class Accesskeyeventargs(EventArgs):
""" Provides information for access keys events. """
is_multiple = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value that indicates whether other elements are invoked by the key.\n\n\n\nGet: IsMultiple(self: AccessKeyEventArgs) -> bool\n\n\n\n'
key = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the access keys that was pressed.\n\n\n\nGet: Key(self: AccessKeyEventArgs) -> str\n\n\n\n'
|
class PretreatedQuery:
'''
DBpedia resultat
'''
def __init__(self, mentions_list, detected_ne):
'''
Constructor
'''
self.mentions_list=mentions_list
self.detected_ne=detected_ne
|
class Pretreatedquery:
"""
DBpedia resultat
"""
def __init__(self, mentions_list, detected_ne):
"""
Constructor
"""
self.mentions_list = mentions_list
self.detected_ne = detected_ne
|
def even_odd(*args):
if "even" in args:
return list(filter(lambda x: x % 2 == 0, [args[i] for i in range(len(args) - 1)]))
return list(filter(lambda x: x % 2 == 1, [args[i] for i in range(len(args) - 1)]))
# print(even_odd(1, 2, 3, 4, 5, 6, "even"))
# print(even_odd(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "odd"))
|
def even_odd(*args):
if 'even' in args:
return list(filter(lambda x: x % 2 == 0, [args[i] for i in range(len(args) - 1)]))
return list(filter(lambda x: x % 2 == 1, [args[i] for i in range(len(args) - 1)]))
|
# swift_build_support/build_graph.py ----------------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
# ----------------------------------------------------------------------------
#
# This is a simple implementation of an acyclic build graph. We require no
# cycles, so we just perform a reverse post order traversal to get a topological
# ordering. We check during the reverse post order traversal that we do not
# visit any node multiple times.
#
# Nodes are assumed to be a product's class.
#
# ----------------------------------------------------------------------------
def _get_po_ordered_nodes(root, invertedDepMap):
# Then setup our worklist/visited node set.
worklist = [root]
visitedNodes = set([])
# TODO: Can we unify po_ordered_nodes and visitedNodes in some way?
po_ordered_nodes = []
# Until we no longer have nodes to visit...
while not len(worklist) == 0:
# First grab the last element of the worklist. If we have already
# visited this node, just pop it and skip it.
#
# DISCUSSION: Consider the following build graph:
#
# A -> [C, B]
# B -> [C]
#
# In this case, we will most likely get the following worklist
# before actually processing anything:
#
# A, C, B, C
#
# In this case, we want to ignore the initial C pushed onto the
# worklist by visiting A since we will have visited C already due to
# the edge from B -> C.
node = worklist[-1]
if node in visitedNodes:
worklist.pop()
continue
# Then grab the dependents of our node.
deps = invertedDepMap.get(node, set([]))
assert(isinstance(deps, set))
# Then visit those and see if we have not visited any of them. Push
# any such nodes onto the worklist and continue. If we have already
# visited all of our dependents, then we can actually process this
# node.
foundDep = False
for d in deps:
if d not in visitedNodes:
foundDep = True
worklist.append(d)
if foundDep:
continue
# Now process the node by popping it off the worklist, adding it to
# the visited nodes set, and append it to the po_ordered_nodes in
# its final position.
worklist.pop()
visitedNodes.add(node)
po_ordered_nodes.append(node)
return po_ordered_nodes
class BuildDAG(object):
def __init__(self):
self.root = None
# A map from a node to a list of nodes that depend on the given node.
#
# NOTE: This is an inverted dependency map implying that the root will
# be a "final element" of the graph.
self.invertedDepMap = {}
def add_edge(self, pred, succ):
self.invertedDepMap.setdefault(pred, set([succ])) \
.add(succ)
def set_root(self, root):
# Assert that we always only have one root.
assert(self.root is None)
self.root = root
def produce_schedule(self):
# Grab the root and make sure it is not None
root = self.root
assert(root is not None)
# Then perform a post order traversal from root using our inverted
# dependency map to compute a list of our nodes in post order.
#
# NOTE: The index of each node in this list is the post order number of
# the node.
po_ordered_nodes = _get_po_ordered_nodes(root, self.invertedDepMap)
# Ok, we have our post order list. We want to provide our user a reverse
# post order, so we take our array and construct a dictionary of an
# enumeration of the list. This will give us a dictionary mapping our
# product names to their reverse post order number.
rpo_ordered_nodes = list(reversed(po_ordered_nodes))
node_to_rpot_map = dict((y, x) for x, y in enumerate(rpo_ordered_nodes))
# Now before we return our rpo_ordered_nodes and our node_to_rpot_map, lets
# verify that we didn't find any cycles. We can do this by traversing
# our dependency graph in reverse post order and making sure all
# dependencies of each node we visit has a later reverse post order
# number than the node we are checking.
for n, node in enumerate(rpo_ordered_nodes):
for dep in self.invertedDepMap.get(node, []):
if node_to_rpot_map[dep] < n:
print('n: {}. node: {}.'.format(n, node))
print('dep: {}.'.format(dep))
print('inverted dependency map: {}'.format(self.invertedDepMap))
print('rpo ordered nodes: {}'.format(rpo_ordered_nodes))
print('rpo node to rpo number map: {}'.format(node_to_rpot_map))
raise RuntimeError('Found cycle in build graph!')
return (rpo_ordered_nodes, node_to_rpot_map)
def produce_scheduled_build(input_product_classes):
"""For a given a subset input_input_product_classes of
all_input_product_classes, compute a topological ordering of the
input_input_product_classes + topological closures that respects the
dependency graph.
"""
dag = BuildDAG()
worklist = list(input_product_classes)
visited = set(input_product_classes)
# Construct the DAG.
while len(worklist) > 0:
entry = worklist.pop()
deps = entry.get_dependencies()
if len(deps) == 0:
dag.set_root(entry)
for d in deps:
dag.add_edge(d, entry)
if d not in visited:
worklist.append(d)
visited = visited.union(deps)
# Then produce the schedule.
schedule = dag.produce_schedule()
# Finally check that all of our input_product_classes are in the schedule.
if len(set(input_product_classes) - set(schedule[0])) != 0:
raise RuntimeError('Found disconnected graph?!')
return schedule
|
def _get_po_ordered_nodes(root, invertedDepMap):
worklist = [root]
visited_nodes = set([])
po_ordered_nodes = []
while not len(worklist) == 0:
node = worklist[-1]
if node in visitedNodes:
worklist.pop()
continue
deps = invertedDepMap.get(node, set([]))
assert isinstance(deps, set)
found_dep = False
for d in deps:
if d not in visitedNodes:
found_dep = True
worklist.append(d)
if foundDep:
continue
worklist.pop()
visitedNodes.add(node)
po_ordered_nodes.append(node)
return po_ordered_nodes
class Builddag(object):
def __init__(self):
self.root = None
self.invertedDepMap = {}
def add_edge(self, pred, succ):
self.invertedDepMap.setdefault(pred, set([succ])).add(succ)
def set_root(self, root):
assert self.root is None
self.root = root
def produce_schedule(self):
root = self.root
assert root is not None
po_ordered_nodes = _get_po_ordered_nodes(root, self.invertedDepMap)
rpo_ordered_nodes = list(reversed(po_ordered_nodes))
node_to_rpot_map = dict(((y, x) for (x, y) in enumerate(rpo_ordered_nodes)))
for (n, node) in enumerate(rpo_ordered_nodes):
for dep in self.invertedDepMap.get(node, []):
if node_to_rpot_map[dep] < n:
print('n: {}. node: {}.'.format(n, node))
print('dep: {}.'.format(dep))
print('inverted dependency map: {}'.format(self.invertedDepMap))
print('rpo ordered nodes: {}'.format(rpo_ordered_nodes))
print('rpo node to rpo number map: {}'.format(node_to_rpot_map))
raise runtime_error('Found cycle in build graph!')
return (rpo_ordered_nodes, node_to_rpot_map)
def produce_scheduled_build(input_product_classes):
"""For a given a subset input_input_product_classes of
all_input_product_classes, compute a topological ordering of the
input_input_product_classes + topological closures that respects the
dependency graph.
"""
dag = build_dag()
worklist = list(input_product_classes)
visited = set(input_product_classes)
while len(worklist) > 0:
entry = worklist.pop()
deps = entry.get_dependencies()
if len(deps) == 0:
dag.set_root(entry)
for d in deps:
dag.add_edge(d, entry)
if d not in visited:
worklist.append(d)
visited = visited.union(deps)
schedule = dag.produce_schedule()
if len(set(input_product_classes) - set(schedule[0])) != 0:
raise runtime_error('Found disconnected graph?!')
return schedule
|
pkgname = "python-sphinxcontrib-serializinghtml"
pkgver = "1.1.5"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools"]
checkdepends = ["python-sphinx"]
depends = ["python"]
pkgdesc = "Sphinx extension which outputs serialized HTML document"
maintainer = "q66 <q66@chimera-linux.org>"
license = "BSD-2-Clause"
url = "http://sphinx-doc.org"
source = f"$(PYPI_SITE)/s/sphinxcontrib-serializinghtml/sphinxcontrib-serializinghtml-{pkgver}.tar.gz"
sha256 = "aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"
# circular checkdepends
options = ["!check"]
def post_install(self):
self.install_license("LICENSE")
|
pkgname = 'python-sphinxcontrib-serializinghtml'
pkgver = '1.1.5'
pkgrel = 0
build_style = 'python_module'
hostmakedepends = ['python-setuptools']
checkdepends = ['python-sphinx']
depends = ['python']
pkgdesc = 'Sphinx extension which outputs serialized HTML document'
maintainer = 'q66 <q66@chimera-linux.org>'
license = 'BSD-2-Clause'
url = 'http://sphinx-doc.org'
source = f'$(PYPI_SITE)/s/sphinxcontrib-serializinghtml/sphinxcontrib-serializinghtml-{pkgver}.tar.gz'
sha256 = 'aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952'
options = ['!check']
def post_install(self):
self.install_license('LICENSE')
|
"""
MIT License
Copyright (c) 2019 Michael Schmidt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
class BinarySearchTree:
""" A basic binary search tree """
class _node:
""" A basic node object for trees """
def __init__(self, data):
""" Create a node with no children and just a data element
:data: object() Which implements relational <, >, == """
self.left = None
self.right = None
self.data = data
self.height = 1
def pre_order(self):
""" pre-order traversal generator function """
if self.data is not None:
yield self.data
if self.left:
for data in self.left.pre_order():
yield data
if self.right:
for data in self.right.pre_order():
yield data
def in_order(self):
""" in-order traversal generator function """
if self.left:
for data in self.left.in_order():
yield data
if self.data is not None:
yield self.data
if self.right:
for data in self.right.in_order():
yield data
def post_order(self):
""" post-order traversal generator function """
if self.left:
for data in self.left.post_order():
yield data
if self.right:
for data in self.right.post_order():
yield data
if self.data:
yield self.data
def __init__(self, data):
""" construct the root of the tree """
self.root = self._node(data)
self.size = 1
def __iter__(self):
""" return an in-order interator to the tree """
return self.root.in_order()
def __len__(self):
""" return the size of the tree """
return self.size
def find(self, data) -> bool:
""" Search tree to check if `data` is in tree
:data: object() Which implements <, >, ==
:returns: bool True if found, otherwise False """
return self._find(self.root, data)
def insert(self, data):
""" Insert an element into the tree
:data: object() Which implements <, >, == """
self._insert(self.root, data)
self.size += 1
def delete(self, data):
""" Public Method to remove data
:data: object() Which implements <, >, == """
self.root = self._delete(self.root, data)
self.size -= 1
def pre_order(self):
""" Public method which returns a generator for pre-order traversal """
for data in self.root.pre_order():
yield data
def in_order(self):
""" Public method which returns a generator for in-order traversal """
for data in self.root.in_order():
yield data
def post_order(self):
""" Public method which returns a generator for post-order traversal """
for data in self.root.post_order():
yield data
def _find(self, node, data) -> bool:
""" Hidden method for recursive search
:node: _node() root node of subtree
:data: object() which implements <, >, == """
if node:
if data == node.data:
return True
if data < node.data:
return self._find(node.left, data)
return self._find(node.right, data)
return False
def _insert(self, node, data):
""" Hidden method for recursive insert
:node: _node() root node of subtree
:data: object() which implements <, >, == """
if node.data is not None:
if data < node.data:
if node.left is None:
node.left = self._node(data)
else:
self._insert(node.left, data)
elif data > node.data:
if node.right is None:
node.right = self._node(data)
else:
self._insert(node.right, data)
else:
node.data = data
def _delete(self, node, data):
""" Hidden method for recursive _delete
:node: _node() root node of subtree
:data: object() which implements <, >, == """
if node is None:
return node
if data < node.data:
node.left = self._delete(node.left, data)
elif data > node.data:
node.right = self._delete(node.right, data)
else:
if node.left is None:
temp = node.right
node = None
return temp
if node.right is None:
temp = node.left
node = None
return temp
temp = self._get_minvalue_node(node.right)
node.key = temp.key
node.right = self._delete(node.right, temp.key)
return node
def _get_minvalue_node(self, node):
if node is None or node.left is None:
return node
return self._get_minvalue_node(node.left)
def _get_height(self, subtree):
""" Hidden method which returns the nodes height in the tree
:subtree: _node() Root node of a subtree """
if not subtree:
return 0
return subtree.height
class AVLTree(BinarySearchTree):
""" A self-balancing AVL tree """
def __init__(self, data):
""" Construct the root node
:data: object() Which implements relational <, >, == """
super(AVLTree, self).__init__(data)
def insert(self, data):
""" Public method for inserting data
:data: object() Which implements relational <, >, == """
self.root = self._insert(self.root, data)
self.size += 1
def delete(self, data):
""" Public method for recursive delete
Removes element and balances the tree
:data: object Which implements relational <, >, == """
self.root = self._delete(self.root, data)
self.size -= 1
def _insert(self, node, data) -> BinarySearchTree._node:
""" Hidden method for recursive insert
:node: _node() A tree node
:data: object Which implements relational <, >, ==
:returns: _node() a node (ultimately the new root) """
if not node:
return self._node(data)
if data < node.data:
node.left = self._insert(node.left, data)
else:
node.right = self._insert(node.right, data)
node.height = 1 + max(self._get_height(node.left), self._get_height(node.right))
balance = self._get_balance(node)
if balance > 1 and data < node.left.data:
return self._rotate_right(node)
if balance < -1 and data > node.right.data:
return self._rotate_left(node)
if balance > 1 and data > node.left.data:
node.left = self._rotate_left(node.left)
return self._rotate_right(node)
if balance < -1 and data < node.right.data:
node.right = self._rotate_right(node.right)
return self._rotate_left(node)
return node
def _delete(self, node, data):
""" Hidden method for recursive delete
:node: _node() A tree node
:data: object Which implements relational <, >, == """
if not node:
return node
if data < node.data:
node.left = self._delete(node.left, data)
elif data > node.data:
node.right = self._delete(node.right, data)
else:
if node.left is None:
temp = node.right
node = None
return temp
if node.right is None:
temp = node.left
node = None
return temp
temp = self._get_minvalue_node(node.right)
node.data = temp.data
node.right = self._delete(node.right, temp.data)
if node is None:
return node
node.height = 1 + max(self._get_height(node.left), self._get_height(node.right))
balance = self._get_balance(node)
if balance > 1 and self._get_balance(node.left) >= 0:
return self._rotate_right(node)
if balance < -1 and self._get_balance(node.right) <= 0:
return self._rotate_left(node)
if balance > 1 and self._get_balance(node.left) < 0:
node.left = self._rotate_left(node.left)
return self._rotate_right(node)
if balance < -1 and self._get_balance(node.right) > 0:
node.right = self._rotate_right(node.right)
return self._rotate_left(node)
return node
def _rotate_left(self, subtree):
""" Hidden method for left rotations
:subtree: _node() Root node of a subtree """
new_root = subtree.right
left = new_root.left
new_root.left = subtree
subtree.right = left
subtree.height = 1 + max(self._get_height(subtree.left), self._get_height(subtree.right))
new_root.height = 1 + max(self._get_height(new_root.left), self._get_height(new_root.right))
return new_root
def _rotate_right(self, subtree):
""" Hidden method for right rotations
:subtree: _node() Root node of a subtree """
new_root = subtree.left
right = new_root.right
new_root.right = subtree
subtree.left = right
subtree.height = 1 + max(self._get_height(subtree.left), self._get_height(subtree.right))
new_root.height = 1 + max(self._get_height(new_root.left), self._get_height(new_root.right))
return new_root
def _get_balance(self, subtree):
""" Hidden method which determines the tree balance
:subtree: _node() Root node of a subtree """
if not subtree:
return 0
return self._get_height(subtree.left) - self._get_height(subtree.right)
|
"""
MIT License
Copyright (c) 2019 Michael Schmidt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
class Binarysearchtree:
""" A basic binary search tree """
class _Node:
""" A basic node object for trees """
def __init__(self, data):
""" Create a node with no children and just a data element
:data: object() Which implements relational <, >, == """
self.left = None
self.right = None
self.data = data
self.height = 1
def pre_order(self):
""" pre-order traversal generator function """
if self.data is not None:
yield self.data
if self.left:
for data in self.left.pre_order():
yield data
if self.right:
for data in self.right.pre_order():
yield data
def in_order(self):
""" in-order traversal generator function """
if self.left:
for data in self.left.in_order():
yield data
if self.data is not None:
yield self.data
if self.right:
for data in self.right.in_order():
yield data
def post_order(self):
""" post-order traversal generator function """
if self.left:
for data in self.left.post_order():
yield data
if self.right:
for data in self.right.post_order():
yield data
if self.data:
yield self.data
def __init__(self, data):
""" construct the root of the tree """
self.root = self._node(data)
self.size = 1
def __iter__(self):
""" return an in-order interator to the tree """
return self.root.in_order()
def __len__(self):
""" return the size of the tree """
return self.size
def find(self, data) -> bool:
""" Search tree to check if `data` is in tree
:data: object() Which implements <, >, ==
:returns: bool True if found, otherwise False """
return self._find(self.root, data)
def insert(self, data):
""" Insert an element into the tree
:data: object() Which implements <, >, == """
self._insert(self.root, data)
self.size += 1
def delete(self, data):
""" Public Method to remove data
:data: object() Which implements <, >, == """
self.root = self._delete(self.root, data)
self.size -= 1
def pre_order(self):
""" Public method which returns a generator for pre-order traversal """
for data in self.root.pre_order():
yield data
def in_order(self):
""" Public method which returns a generator for in-order traversal """
for data in self.root.in_order():
yield data
def post_order(self):
""" Public method which returns a generator for post-order traversal """
for data in self.root.post_order():
yield data
def _find(self, node, data) -> bool:
""" Hidden method for recursive search
:node: _node() root node of subtree
:data: object() which implements <, >, == """
if node:
if data == node.data:
return True
if data < node.data:
return self._find(node.left, data)
return self._find(node.right, data)
return False
def _insert(self, node, data):
""" Hidden method for recursive insert
:node: _node() root node of subtree
:data: object() which implements <, >, == """
if node.data is not None:
if data < node.data:
if node.left is None:
node.left = self._node(data)
else:
self._insert(node.left, data)
elif data > node.data:
if node.right is None:
node.right = self._node(data)
else:
self._insert(node.right, data)
else:
node.data = data
def _delete(self, node, data):
""" Hidden method for recursive _delete
:node: _node() root node of subtree
:data: object() which implements <, >, == """
if node is None:
return node
if data < node.data:
node.left = self._delete(node.left, data)
elif data > node.data:
node.right = self._delete(node.right, data)
else:
if node.left is None:
temp = node.right
node = None
return temp
if node.right is None:
temp = node.left
node = None
return temp
temp = self._get_minvalue_node(node.right)
node.key = temp.key
node.right = self._delete(node.right, temp.key)
return node
def _get_minvalue_node(self, node):
if node is None or node.left is None:
return node
return self._get_minvalue_node(node.left)
def _get_height(self, subtree):
""" Hidden method which returns the nodes height in the tree
:subtree: _node() Root node of a subtree """
if not subtree:
return 0
return subtree.height
class Avltree(BinarySearchTree):
""" A self-balancing AVL tree """
def __init__(self, data):
""" Construct the root node
:data: object() Which implements relational <, >, == """
super(AVLTree, self).__init__(data)
def insert(self, data):
""" Public method for inserting data
:data: object() Which implements relational <, >, == """
self.root = self._insert(self.root, data)
self.size += 1
def delete(self, data):
""" Public method for recursive delete
Removes element and balances the tree
:data: object Which implements relational <, >, == """
self.root = self._delete(self.root, data)
self.size -= 1
def _insert(self, node, data) -> BinarySearchTree._node:
""" Hidden method for recursive insert
:node: _node() A tree node
:data: object Which implements relational <, >, ==
:returns: _node() a node (ultimately the new root) """
if not node:
return self._node(data)
if data < node.data:
node.left = self._insert(node.left, data)
else:
node.right = self._insert(node.right, data)
node.height = 1 + max(self._get_height(node.left), self._get_height(node.right))
balance = self._get_balance(node)
if balance > 1 and data < node.left.data:
return self._rotate_right(node)
if balance < -1 and data > node.right.data:
return self._rotate_left(node)
if balance > 1 and data > node.left.data:
node.left = self._rotate_left(node.left)
return self._rotate_right(node)
if balance < -1 and data < node.right.data:
node.right = self._rotate_right(node.right)
return self._rotate_left(node)
return node
def _delete(self, node, data):
""" Hidden method for recursive delete
:node: _node() A tree node
:data: object Which implements relational <, >, == """
if not node:
return node
if data < node.data:
node.left = self._delete(node.left, data)
elif data > node.data:
node.right = self._delete(node.right, data)
else:
if node.left is None:
temp = node.right
node = None
return temp
if node.right is None:
temp = node.left
node = None
return temp
temp = self._get_minvalue_node(node.right)
node.data = temp.data
node.right = self._delete(node.right, temp.data)
if node is None:
return node
node.height = 1 + max(self._get_height(node.left), self._get_height(node.right))
balance = self._get_balance(node)
if balance > 1 and self._get_balance(node.left) >= 0:
return self._rotate_right(node)
if balance < -1 and self._get_balance(node.right) <= 0:
return self._rotate_left(node)
if balance > 1 and self._get_balance(node.left) < 0:
node.left = self._rotate_left(node.left)
return self._rotate_right(node)
if balance < -1 and self._get_balance(node.right) > 0:
node.right = self._rotate_right(node.right)
return self._rotate_left(node)
return node
def _rotate_left(self, subtree):
""" Hidden method for left rotations
:subtree: _node() Root node of a subtree """
new_root = subtree.right
left = new_root.left
new_root.left = subtree
subtree.right = left
subtree.height = 1 + max(self._get_height(subtree.left), self._get_height(subtree.right))
new_root.height = 1 + max(self._get_height(new_root.left), self._get_height(new_root.right))
return new_root
def _rotate_right(self, subtree):
""" Hidden method for right rotations
:subtree: _node() Root node of a subtree """
new_root = subtree.left
right = new_root.right
new_root.right = subtree
subtree.left = right
subtree.height = 1 + max(self._get_height(subtree.left), self._get_height(subtree.right))
new_root.height = 1 + max(self._get_height(new_root.left), self._get_height(new_root.right))
return new_root
def _get_balance(self, subtree):
""" Hidden method which determines the tree balance
:subtree: _node() Root node of a subtree """
if not subtree:
return 0
return self._get_height(subtree.left) - self._get_height(subtree.right)
|
class Solution:
def longestValidParentheses(self, s):
"""
:type s: str
:rtype: int
"""
stack = []
index_stack = []
if len(s) <= 1:
return 0
dp = [0] * len(s)
for i in range(len(s)):
if s[i] == '(':
dp[i] = 0
stack.append(s[i])
index_stack.append(i)
continue
if len(stack) == 0:
dp[i] = 0
else:
if i - 1 >= 0:
if s[i - 1] == ')':
dp[i] = 1 + dp[i - 1]
else:
dp[i] = 1
stack = stack[0:-1]
p = index_stack[-1]
if len(index_stack) > 1:
index_stack = index_stack[0:-1]
else:
index_stack = []
if p - 1 >= 0:
dp[i] = dp[i] + dp[p - 1]
# p += 2
return max(dp) * 2
if __name__ == '__main__':
S = Solution()
a = S.longestValidParentheses(")(((((()())()()))()(()))(")
print(a)
|
class Solution:
def longest_valid_parentheses(self, s):
"""
:type s: str
:rtype: int
"""
stack = []
index_stack = []
if len(s) <= 1:
return 0
dp = [0] * len(s)
for i in range(len(s)):
if s[i] == '(':
dp[i] = 0
stack.append(s[i])
index_stack.append(i)
continue
if len(stack) == 0:
dp[i] = 0
else:
if i - 1 >= 0:
if s[i - 1] == ')':
dp[i] = 1 + dp[i - 1]
else:
dp[i] = 1
stack = stack[0:-1]
p = index_stack[-1]
if len(index_stack) > 1:
index_stack = index_stack[0:-1]
else:
index_stack = []
if p - 1 >= 0:
dp[i] = dp[i] + dp[p - 1]
return max(dp) * 2
if __name__ == '__main__':
s = solution()
a = S.longestValidParentheses(')(((((()())()()))()(()))(')
print(a)
|
lis = [1, 2, 3, 4, 2, 6, 7, 8, 9]
without_duplicates = []
ok = True
for i in range(0,len(lis)):
if lis[i] in without_duplicates:
ok = False
break
else:
without_duplicates.append(lis[i])
if ok:
print("There are no duplicates")
else:
print("Things are not ok")
|
lis = [1, 2, 3, 4, 2, 6, 7, 8, 9]
without_duplicates = []
ok = True
for i in range(0, len(lis)):
if lis[i] in without_duplicates:
ok = False
break
else:
without_duplicates.append(lis[i])
if ok:
print('There are no duplicates')
else:
print('Things are not ok')
|
# model settings
model = dict(
type='CenterNet2',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch',
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
start_level=1,
add_extra_convs='on_output', # use P5
num_outs=5,
relu_before_extra_convs=True),
rpn_head=dict(
type='CenterNet2Head',
num_classes=80,
in_channels=256,
stacked_convs=4,
feat_channels=256,
not_norm_reg=True,
dcn_on_last_conv=False,
strides=[8, 16, 32, 64, 128],
regress_ranges=((0, 64), (64, 128), (128, 256), (256, 512), (512,
1e8)),
loss_hm=dict(
type='BinaryFocalLoss',
alpha=0.25,
beta=4,
gamma=2,
weight=0.5,
sigmoid_clamp=1e-4,
ignore_high_fp=0.85),
loss_bbox=dict(type='GIoULoss', reduction='mean', loss_weight=1.0)),
roi_head=dict(
type='CascadeRoIHead',
num_stages=3,
stage_loss_weights=[1, 0.5, 0.25],
mult_proposal_score=True,
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
out_channels=256,
featmap_strides=[8, 16, 32, 64, 128],
finest_scale=112),
bbox_head=[
dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=80,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0., 0., 0., 0.],
target_stds=[0.1, 0.1, 0.2, 0.2]),
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
loss_weight=1.0)),
dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=80,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0., 0., 0., 0.],
target_stds=[0.05, 0.05, 0.1, 0.1]),
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
loss_weight=1.0)),
dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=80,
mult_proposal_score=True,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0., 0., 0., 0.],
target_stds=[0.033, 0.033, 0.067, 0.067]),
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))
]),
# training and testing settings
train_cfg=dict(
rpn=dict(
nms_pre=4000,
score_thr=0.0001,
min_bbox_size=0,
nms=dict(type='nms', iou_threshold=0.9),
max_per_img=2000),
rcnn=[
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.6,
neg_iou_thr=0.6,
min_pos_iou=0.6,
match_low_quality=False,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False),
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.7,
neg_iou_thr=0.7,
min_pos_iou=0.7,
match_low_quality=False,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False),
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.8,
neg_iou_thr=0.8,
min_pos_iou=0.8,
match_low_quality=False,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False)
]),
test_cfg=dict(
rpn=dict(
nms_pre=1000,
score_thr=0.0001,
min_bbox_size=0,
nms=dict(type='nms', iou_threshold=0.9),
max_per_img=256),
rcnn=dict(
score_thr=0.05,
nms=dict(type='nms', iou_threshold=0.7),
max_per_img=100)))
# dataset settings
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Resize',
img_scale=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
(1333, 768), (1333, 800)],
multiscale_mode='value',
keep_ratio=True),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img']),
])
]
data = dict(
samples_per_gpu=2,
workers_per_gpu=2,
train=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_train2017.json',
img_prefix=data_root + 'train2017/',
pipeline=train_pipeline),
val=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline),
test=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline))
evaluation = dict(interval=9000, metric='bbox')
# optimizer
optimizer = dict(type='SGD', lr=0.02 / 8, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# learning policy
lr_config = dict(
policy='step', warmup='linear', warmup_iters=500, step=[60000, 80000])
runner = dict(type='IterBasedRunner', max_iters=90000)
# runtime
checkpoint_config = dict(interval=9000)
# yapf:disable
log_config = dict(
interval=100,
hooks=[
dict(type='TextLoggerHook'),
# dict(type='TensorboardLoggerHook')
])
# yapf:enable
custom_hooks = [dict(type='NumClassCheckHook')]
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
work_dir = 'outputs/CN2R50FPN'
seed = 0
gpu_ids = range(1)
|
model = dict(type='CenterNet2', backbone=dict(type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), neck=dict(type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=1, add_extra_convs='on_output', num_outs=5, relu_before_extra_convs=True), rpn_head=dict(type='CenterNet2Head', num_classes=80, in_channels=256, stacked_convs=4, feat_channels=256, not_norm_reg=True, dcn_on_last_conv=False, strides=[8, 16, 32, 64, 128], regress_ranges=((0, 64), (64, 128), (128, 256), (256, 512), (512, 100000000.0)), loss_hm=dict(type='BinaryFocalLoss', alpha=0.25, beta=4, gamma=2, weight=0.5, sigmoid_clamp=0.0001, ignore_high_fp=0.85), loss_bbox=dict(type='GIoULoss', reduction='mean', loss_weight=1.0)), roi_head=dict(type='CascadeRoIHead', num_stages=3, stage_loss_weights=[1, 0.5, 0.25], mult_proposal_score=True, bbox_roi_extractor=dict(type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0), out_channels=256, featmap_strides=[8, 16, 32, 64, 128], finest_scale=112), bbox_head=[dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=80, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.1, 0.1, 0.2, 0.2]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=80, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.05, 0.05, 0.1, 0.1]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=80, mult_proposal_score=True, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.033, 0.033, 0.067, 0.067]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))]), train_cfg=dict(rpn=dict(nms_pre=4000, score_thr=0.0001, min_bbox_size=0, nms=dict(type='nms', iou_threshold=0.9), max_per_img=2000), rcnn=[dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.6, neg_iou_thr=0.6, min_pos_iou=0.6, match_low_quality=False, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), pos_weight=-1, debug=False), dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.7, min_pos_iou=0.7, match_low_quality=False, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), pos_weight=-1, debug=False), dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.8, neg_iou_thr=0.8, min_pos_iou=0.8, match_low_quality=False, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), pos_weight=-1, debug=False)]), test_cfg=dict(rpn=dict(nms_pre=1000, score_thr=0.0001, min_bbox_size=0, nms=dict(type='nms', iou_threshold=0.9), max_per_img=256), rcnn=dict(score_thr=0.05, nms=dict(type='nms', iou_threshold=0.7), max_per_img=100)))
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict(type='Resize', img_scale=[(1333, 640), (1333, 672), (1333, 704), (1333, 736), (1333, 768), (1333, 800)], multiscale_mode='value', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])]
test_pipeline = [dict(type='LoadImageFromFile'), dict(type='MultiScaleFlipAug', img_scale=(1333, 800), flip=False, transforms=[dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img'])])]
data = dict(samples_per_gpu=2, workers_per_gpu=2, train=dict(type=dataset_type, ann_file=data_root + 'annotations/instances_train2017.json', img_prefix=data_root + 'train2017/', pipeline=train_pipeline), val=dict(type=dataset_type, ann_file=data_root + 'annotations/instances_val2017.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline), test=dict(type=dataset_type, ann_file=data_root + 'annotations/instances_val2017.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline))
evaluation = dict(interval=9000, metric='bbox')
optimizer = dict(type='SGD', lr=0.02 / 8, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
lr_config = dict(policy='step', warmup='linear', warmup_iters=500, step=[60000, 80000])
runner = dict(type='IterBasedRunner', max_iters=90000)
checkpoint_config = dict(interval=9000)
log_config = dict(interval=100, hooks=[dict(type='TextLoggerHook')])
custom_hooks = [dict(type='NumClassCheckHook')]
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
work_dir = 'outputs/CN2R50FPN'
seed = 0
gpu_ids = range(1)
|
""" Constants file for Auth0's seed project
"""
ACCESS_TOKEN_KEY = 'access_token'
API_ID = 'API_ID'
APP_JSON_KEY = 'application/json'
AUTH0_CLIENT_ID = 'uL61M0bVYCd72QwsrvGioOHotcRlqw35'
AUTH0_CLIENT_SECRET = '3dtMdBV5P4jtohyJCtwk0P0HBoOk_hv_oHYzEkYtHCOWjFR59MBBphTPIYf6tucz'
# AUTH0_CALLBACK_URL = 'http://127.0.0.1:5000/callback'
AUTH0_CALLBACK_URL = 'https://sustainable-roi.herokuapp.com/callback'
AUTH0_DOMAIN = 'capextool.auth0.com'
AUTHORIZATION_CODE_KEY = 'authorization_code'
CLIENT_ID_KEY = 'uL61M0bVYCd72QwsrvGioOHotcRlqw35'
CLIENT_SECRET_KEY = '3dtMdBV5P4jtohyJCtwk0P0HBoOk_hv_oHYzEkYtHCOWjFR59MBBphTPIYf6tucz'
CODE_KEY = 'code'
CONTENT_TYPE_KEY = 'content-type'
GRANT_TYPE_KEY = 'grant_type'
PROFILE_KEY = 'profile'
# REDIRECT_URI_KEY = 'http://127.0.0.1:5000/callback'
REDIRECT_URI_KEY = 'https://sustainable-roi.herokuapp.com/callback'
SECRET_KEY = 'ThisIsTheSecretKey'
|
""" Constants file for Auth0's seed project
"""
access_token_key = 'access_token'
api_id = 'API_ID'
app_json_key = 'application/json'
auth0_client_id = 'uL61M0bVYCd72QwsrvGioOHotcRlqw35'
auth0_client_secret = '3dtMdBV5P4jtohyJCtwk0P0HBoOk_hv_oHYzEkYtHCOWjFR59MBBphTPIYf6tucz'
auth0_callback_url = 'https://sustainable-roi.herokuapp.com/callback'
auth0_domain = 'capextool.auth0.com'
authorization_code_key = 'authorization_code'
client_id_key = 'uL61M0bVYCd72QwsrvGioOHotcRlqw35'
client_secret_key = '3dtMdBV5P4jtohyJCtwk0P0HBoOk_hv_oHYzEkYtHCOWjFR59MBBphTPIYf6tucz'
code_key = 'code'
content_type_key = 'content-type'
grant_type_key = 'grant_type'
profile_key = 'profile'
redirect_uri_key = 'https://sustainable-roi.herokuapp.com/callback'
secret_key = 'ThisIsTheSecretKey'
|
# Copyright 2014 0xc0170
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class IARDefinitions():
def get_mcu_definition(self, name):
""" If MCU found, returns its definition dic, error otherwise. """
try:
return self.mcu_def[name]
except KeyError:
raise RuntimeError(
"Mcu was not recognized for IAR. Please check mcu_def dictionary.")
# MCU definitions which are currently supported. Add a new one, define a name as it is
# in IAR, create an empty project for that MCU, open the project file (ewp) in any text
# editor, find out the values of SelectEditMenu, CoreOrChip and FPU if
# it's not disabled (=0)
mcu_def = {
'LPC1768': {
'OGChipSelectEditMenu': {
'state': 'LPC1768 NXP LPC1768',
},
'OGCoreOrChip': {
'state': 1,
}
},
'MKL25Z128xxx4': {
'OGChipSelectEditMenu': {
'state': 'MKL25Z128xxx4 Freescale MKL25Z128xxx4',
},
'OGCoreOrChip': {
'state': 1,
}
},
'STM32F401xB': {
'OGChipSelectEditMenu': {
'state': 'STM32F401xB ST STM32F401xB',
},
'OGCoreOrChip': {
'state': 1,
},
'FPU': {
'state': 5,
},
},
}
iar_settings = {
'Variant': {
'state': 0,
},
'GEndianMode': { # [General Options][Target] Endian mode
'state': 0,
},
'Input variant': {
'version': 0,
'state': 0,
},
'Output variant': {
'state': 1,
},
'GOutputBinary': { # [General Options][Output] Executable or library
'state': 0, # 1 - library, 0 - executable
},
'FPU': {
'version': 2,
'state': 0,
},
'GRuntimeLibSelect': { # [General Options] Use runtime library
'version': 0,
'state': 0, # 0 - none, 1 - normal, 2 - full, 3 - custom
},
'GRuntimeLibSelectSlave': {
'version': 0,
'state': 0,
},
'GeneralEnableMisra': { # [General Options] Enable Misra-C
'state': 0,
},
'GeneralMisraVerbose': { # [General Options] Misra verbose
'state': 0,
},
'OGChipSelectEditMenu': { # [General Options] Select MCU (be aware, tabs are needed in some cases)
'state': 0,
},
'GenLowLevelInterface': { # [General Options] Use semihosting
# [General Options] 0 - none, 1 - semihosting, 2 - IAR breakpoint
'state': 0,
},
'GEndianModeBE': {
'state': 0,
},
'OGBufferedTerminalOutput': { # [General Options] Buffered terminal output
'state': 0,
},
'GenStdoutInterface': { # [General Options] Stdout/err
'state': 0, # [General Options] 0 - semihosting, 1 - SWD
},
'GeneralMisraVer': {
'state': 0,
},
'GFPUCoreSlave': {
'state': 0,
},
'GBECoreSlave': {
'state': 0,
},
'OGUseCmsis': { # [General Options][Lib configuration] Use CMSIS Lib
'state': 0,
},
'OGUseCmsisDspLib': { # [General Options][Lib configuration] Use CMSIS DSP Lib, only valid if CMSIS Lib is selected
'state': 0,
},
'CCPreprocFile': {
'state': 0,
},
'CCPreprocComments': {
'state': 0,
},
'CCPreprocLine': {
'state': 0,
},
'CCListCFile': { # [C/C++ Compiler][Output] Output list file
'state': 0,
},
'CCListCMnemonics': {
'state': 0,
},
'CCListCMessages': {
'state': 0,
},
'CCListAssFile': { # [C/C++ Compiler][Output] Output assembler file
'state': 0,
},
'CCListAssSource': {
'state': 0,
},
'CCEnableRemarks': {
'state': [],
},
'CCDiagSuppress': {
'state': '',
},
'CCDiagRemark': {
'state': '',
},
'CCDiagWarning': {
'state': '',
},
'CCDiagError': {
'state': '',
},
'CCObjPrefix': { # Generate object files for C/C++
'state': 1,
},
'CCAllowList': { # [C/C++ Compiler] Enable transformations (Optimizations)
'version': 1,
# Each bit is for one optimization settings. For example second bit
# is for loop unrolling
'state': 1111111,
},
'CCDebugInfo': { # [C/C++ Compiler] Generate debug information
'state': 1,
},
'IEndianMode': {
'state': 1,
},
'IProcessor': {
'state': 1,
},
'IExtraOptionsCheck': {
'state': 0,
},
'IExtraOptions': {
'state': 0,
},
'CCLangConformance': { # [C/C++ Compiler] Language conformance
# 0 - standard with IAR extensions, 1 - standard, 2 - strict
'state': 0,
},
'CCSignedPlainChar': { # [C/C++ Compiler] Plain char
'state': 1, # 0 - signed, 1 - unsigned
},
'CCRequirePrototypes': { # [C/C++ Compiler] Require prototypes
'state': 0,
},
'CCMultibyteSupport': {
'state': 0,
},
'CCCompilerRuntimeInfo': {
'state': 0,
},
'CCDiagWarnAreErr': {
'state': 0,
},
'IFpuProcessor': {
'state': 0,
},
'OutputFile': {
'state': '',
},
'CCLibConfigHeader': {
'state': 0,
},
'PreInclude': {
'state': 0,
},
'CompilerMisraOverride': {
'state': 0,
},
'CCStdIncCheck': {
'state': 0,
},
'CCCodeSection': {
'state': '.text',
},
'IInterwork2': {
'state': 0,
},
'IProcessorMode2': {
'state': 0,
},
'IInterwork2': {
'state': 0,
},
'CCOptLevel': { # [C/C++ Compiler] Optimization level
'state': 0, # 0 - None, 1 - Low, 2 - Medium , 3 - High
},
'CCOptStrategy': { # [C/C++ Compiler] Valid only for Optimization level High
'version': 0,
'state': 0, # 0 - Balanced, 1 - Size, 2 - Speed
},
'CCOptLevelSlave': {
'state': 0,
},
'CompilerMisraRules98': {
'version': 0,
'state': 0,
},
'CompilerMisraRules04': {
'version': 0,
'state': 0,
},
'CCPosIndRopi': { # [C/C++ Compiler][Code] Code and read-only data
'state': 0,
},
'IccLang': { # [C/C++ Compiler] C/C++ Language selection
'state': 0, # 0 - C, 1- C++, 2 - Auto
},
'CCPosIndNoDynInit': { # [C/C++ Compiler][Code]
'state': 0,
},
'CCPosIndRwpi': { # [C/C++ Compiler][Code] Read write/data
'state': 0,
},
'IccCDialect': { # [C/C++ Compiler] C dialect
'state': 1, # 0 - C89, 1 - C90
},
'IccAllowVLA': { # [C/C++ Compiler] Allow VLA (valid only for C99)
'state': 0,
},
'IccCppDialect': { # [C/C++ Compiler] C++ dialect
'state': 0, # 0 - Embedded C++, 1 - Extended embedded, 2 - C++
},
'IccExceptions': { # [C/C++ Compiler] With exceptions (valid only for C++ dialect 2)
'state': 0,
},
'IccRTTI': { # [C/C++ Compiler] With RTTI (valid only for C++ dialect 2)
'state': 0,
},
'IccStaticDestr': {
'state': 1,
},
'IccCppInlineSemantics': { # [C/C++ Compiler] C++ inline semantic (valid only for C99)
'state': 0,
},
'IccCmsis': {
'state': 1,
},
'IccFloatSemantics': { # [C/C++ Compiler] Floating point semantic
'state': 0, # 0 - strict, 1 - relaxed
},
'AObjPrefix': { # Generate object files for assembly files
'state': 1,
},
'AEndian': {
'state': 0,
},
'ACaseSensitivity': {
'state': 0,
},
'MacroChars': {
'state': 0,
},
'AWarnEnable': {
'state': 0,
},
'AWarnWhat': {
'state': 0,
},
'AWarnOne': {
'state': 0,
},
'AWarnRange1': {
'state': 0,
},
'AWarnRange2': {
'state': 0,
},
'ADebug': { # [Assembler] Generate debug info
'state': 0,
},
'AltRegisterNames': {
'state': 0,
},
'ADefines': { # [Assembler] Preprocessor - Defines
'state': '',
},
'AList': {
'state': 0,
},
'AListHeader': {
'state': 0,
},
'AListing': {
'state': 0,
},
'Includes': {
'state': '',
},
'MacDefs': {
'state': 0,
},
'MacExps': {
'state': 0,
},
'MacExec': {
'state': 0,
},
'OnlyAssed': {
'state': 0,
},
'MultiLine': {
'state': 0,
},
'PageLengthCheck': {
'state': 0,
},
'PageLength': {
'state': 0,
},
'TabSpacing': {
'state': 0,
},
'AXRefDefines': {
'state': 0,
},
'AXRef': {
'state': 0,
},
'AXRefInternal': {
'state': 0,
},
'AXRefDual': {
'state': 0,
},
'AProcessor': {
'state': 0,
},
'AFpuProcessor': {
'state': 0,
},
'AOutputFile': {
'state': 0,
},
'AMultibyteSupport': {
'state': 0,
},
'ALimitErrorsCheck': {
'state': 0,
},
'ALimitErrorsEdit': {
'state': 100,
},
'AIgnoreStdInclude': {
'state': 0,
},
'AUserIncludes': {
'state': '',
},
'AExtraOptionsCheckV2': {
'state': 0,
},
'AExtraOptionsV2': {
'state': 0,
},
'OOCOutputFormat': {
'state': 0,
},
'OCOutputOverride': {
'state': 0,
},
'OOCCommandLineProducer': {
'state': 0,
},
'OOCObjCopyEnable': {
'state': 1,
},
'IlinkOutputFile': {
'state': 0,
},
'IlinkLibIOConfig': {
'state': 0,
},
'XLinkMisraHandler': {
'state': 0,
},
'IlinkInputFileSlave': {
'state': 0,
},
'IlinkDebugInfoEnable': {
'state': 0,
},
'IlinkKeepSymbols': {
'state': 0,
},
'IlinkRawBinaryFile': {
'state': 0,
},
'IlinkRawBinarySymbol': {
'state': 0,
},
'IlinkRawBinarySegment': {
'state': 0,
},
'IlinkRawBinaryAlign': {
'state': 0,
},
'IlinkDefines': {
'state': 0,
},
'IlinkConfigDefines': {
'state': 0,
},
'IlinkMapFile': {
'state': 0,
},
'IlinkLogFile': {
'state': 0,
},
'IlinkLogInitialization': {
'state': 0,
},
'IlinkLogModule': {
'state': 0,
},
'IlinkLogSection': {
'state': 0,
},
'IlinkLogVeneer': {
'state': 0,
},
'IlinkIcfOverride': {
'state': 0,
},
'IlinkEnableRemarks': {
'state': 0,
},
'IlinkSuppressDiags': {
'state': 0,
},
'IlinkTreatAsRem': {
'state': 0,
},
'IlinkTreatAsWarn': {
'state': 0,
},
'IlinkTreatAsErr': {
'state': 0,
},
'IlinkWarningsAreErrors': {
'state': 0,
},
'IlinkUseExtraOptions': {
'state': 0,
},
'IlinkExtraOptions': {
'state': 0,
},
'IlinkLowLevelInterfaceSlave': {
'state': 0,
},
'IlinkAutoLibEnable': {
'state': 0,
},
'IlinkProgramEntryLabelSelect': {
'state': 0,
},
'IlinkProgramEntryLabel': {
'state': 0,
},
}
|
class Iardefinitions:
def get_mcu_definition(self, name):
""" If MCU found, returns its definition dic, error otherwise. """
try:
return self.mcu_def[name]
except KeyError:
raise runtime_error('Mcu was not recognized for IAR. Please check mcu_def dictionary.')
mcu_def = {'LPC1768': {'OGChipSelectEditMenu': {'state': 'LPC1768\tNXP LPC1768'}, 'OGCoreOrChip': {'state': 1}}, 'MKL25Z128xxx4': {'OGChipSelectEditMenu': {'state': 'MKL25Z128xxx4\tFreescale MKL25Z128xxx4'}, 'OGCoreOrChip': {'state': 1}}, 'STM32F401xB': {'OGChipSelectEditMenu': {'state': 'STM32F401xB\tST STM32F401xB'}, 'OGCoreOrChip': {'state': 1}, 'FPU': {'state': 5}}}
iar_settings = {'Variant': {'state': 0}, 'GEndianMode': {'state': 0}, 'Input variant': {'version': 0, 'state': 0}, 'Output variant': {'state': 1}, 'GOutputBinary': {'state': 0}, 'FPU': {'version': 2, 'state': 0}, 'GRuntimeLibSelect': {'version': 0, 'state': 0}, 'GRuntimeLibSelectSlave': {'version': 0, 'state': 0}, 'GeneralEnableMisra': {'state': 0}, 'GeneralMisraVerbose': {'state': 0}, 'OGChipSelectEditMenu': {'state': 0}, 'GenLowLevelInterface': {'state': 0}, 'GEndianModeBE': {'state': 0}, 'OGBufferedTerminalOutput': {'state': 0}, 'GenStdoutInterface': {'state': 0}, 'GeneralMisraVer': {'state': 0}, 'GFPUCoreSlave': {'state': 0}, 'GBECoreSlave': {'state': 0}, 'OGUseCmsis': {'state': 0}, 'OGUseCmsisDspLib': {'state': 0}, 'CCPreprocFile': {'state': 0}, 'CCPreprocComments': {'state': 0}, 'CCPreprocLine': {'state': 0}, 'CCListCFile': {'state': 0}, 'CCListCMnemonics': {'state': 0}, 'CCListCMessages': {'state': 0}, 'CCListAssFile': {'state': 0}, 'CCListAssSource': {'state': 0}, 'CCEnableRemarks': {'state': []}, 'CCDiagSuppress': {'state': ''}, 'CCDiagRemark': {'state': ''}, 'CCDiagWarning': {'state': ''}, 'CCDiagError': {'state': ''}, 'CCObjPrefix': {'state': 1}, 'CCAllowList': {'version': 1, 'state': 1111111}, 'CCDebugInfo': {'state': 1}, 'IEndianMode': {'state': 1}, 'IProcessor': {'state': 1}, 'IExtraOptionsCheck': {'state': 0}, 'IExtraOptions': {'state': 0}, 'CCLangConformance': {'state': 0}, 'CCSignedPlainChar': {'state': 1}, 'CCRequirePrototypes': {'state': 0}, 'CCMultibyteSupport': {'state': 0}, 'CCCompilerRuntimeInfo': {'state': 0}, 'CCDiagWarnAreErr': {'state': 0}, 'IFpuProcessor': {'state': 0}, 'OutputFile': {'state': ''}, 'CCLibConfigHeader': {'state': 0}, 'PreInclude': {'state': 0}, 'CompilerMisraOverride': {'state': 0}, 'CCStdIncCheck': {'state': 0}, 'CCCodeSection': {'state': '.text'}, 'IInterwork2': {'state': 0}, 'IProcessorMode2': {'state': 0}, 'IInterwork2': {'state': 0}, 'CCOptLevel': {'state': 0}, 'CCOptStrategy': {'version': 0, 'state': 0}, 'CCOptLevelSlave': {'state': 0}, 'CompilerMisraRules98': {'version': 0, 'state': 0}, 'CompilerMisraRules04': {'version': 0, 'state': 0}, 'CCPosIndRopi': {'state': 0}, 'IccLang': {'state': 0}, 'CCPosIndNoDynInit': {'state': 0}, 'CCPosIndRwpi': {'state': 0}, 'IccCDialect': {'state': 1}, 'IccAllowVLA': {'state': 0}, 'IccCppDialect': {'state': 0}, 'IccExceptions': {'state': 0}, 'IccRTTI': {'state': 0}, 'IccStaticDestr': {'state': 1}, 'IccCppInlineSemantics': {'state': 0}, 'IccCmsis': {'state': 1}, 'IccFloatSemantics': {'state': 0}, 'AObjPrefix': {'state': 1}, 'AEndian': {'state': 0}, 'ACaseSensitivity': {'state': 0}, 'MacroChars': {'state': 0}, 'AWarnEnable': {'state': 0}, 'AWarnWhat': {'state': 0}, 'AWarnOne': {'state': 0}, 'AWarnRange1': {'state': 0}, 'AWarnRange2': {'state': 0}, 'ADebug': {'state': 0}, 'AltRegisterNames': {'state': 0}, 'ADefines': {'state': ''}, 'AList': {'state': 0}, 'AListHeader': {'state': 0}, 'AListing': {'state': 0}, 'Includes': {'state': ''}, 'MacDefs': {'state': 0}, 'MacExps': {'state': 0}, 'MacExec': {'state': 0}, 'OnlyAssed': {'state': 0}, 'MultiLine': {'state': 0}, 'PageLengthCheck': {'state': 0}, 'PageLength': {'state': 0}, 'TabSpacing': {'state': 0}, 'AXRefDefines': {'state': 0}, 'AXRef': {'state': 0}, 'AXRefInternal': {'state': 0}, 'AXRefDual': {'state': 0}, 'AProcessor': {'state': 0}, 'AFpuProcessor': {'state': 0}, 'AOutputFile': {'state': 0}, 'AMultibyteSupport': {'state': 0}, 'ALimitErrorsCheck': {'state': 0}, 'ALimitErrorsEdit': {'state': 100}, 'AIgnoreStdInclude': {'state': 0}, 'AUserIncludes': {'state': ''}, 'AExtraOptionsCheckV2': {'state': 0}, 'AExtraOptionsV2': {'state': 0}, 'OOCOutputFormat': {'state': 0}, 'OCOutputOverride': {'state': 0}, 'OOCCommandLineProducer': {'state': 0}, 'OOCObjCopyEnable': {'state': 1}, 'IlinkOutputFile': {'state': 0}, 'IlinkLibIOConfig': {'state': 0}, 'XLinkMisraHandler': {'state': 0}, 'IlinkInputFileSlave': {'state': 0}, 'IlinkDebugInfoEnable': {'state': 0}, 'IlinkKeepSymbols': {'state': 0}, 'IlinkRawBinaryFile': {'state': 0}, 'IlinkRawBinarySymbol': {'state': 0}, 'IlinkRawBinarySegment': {'state': 0}, 'IlinkRawBinaryAlign': {'state': 0}, 'IlinkDefines': {'state': 0}, 'IlinkConfigDefines': {'state': 0}, 'IlinkMapFile': {'state': 0}, 'IlinkLogFile': {'state': 0}, 'IlinkLogInitialization': {'state': 0}, 'IlinkLogModule': {'state': 0}, 'IlinkLogSection': {'state': 0}, 'IlinkLogVeneer': {'state': 0}, 'IlinkIcfOverride': {'state': 0}, 'IlinkEnableRemarks': {'state': 0}, 'IlinkSuppressDiags': {'state': 0}, 'IlinkTreatAsRem': {'state': 0}, 'IlinkTreatAsWarn': {'state': 0}, 'IlinkTreatAsErr': {'state': 0}, 'IlinkWarningsAreErrors': {'state': 0}, 'IlinkUseExtraOptions': {'state': 0}, 'IlinkExtraOptions': {'state': 0}, 'IlinkLowLevelInterfaceSlave': {'state': 0}, 'IlinkAutoLibEnable': {'state': 0}, 'IlinkProgramEntryLabelSelect': {'state': 0}, 'IlinkProgramEntryLabel': {'state': 0}}
|
aux = 0
num = int(input("Ingrese un numero entero positivo: "))
opc = int(input("1- Sumatoria, 2-Factorial: "))
if opc == 1:
for x in range(0,num+1):
aux = aux + x
print (aux)
elif opc == 2:
if num == 0:
print("1")
elif num > 0:
aux = 1
for x in range(1,num+1):
aux = aux*x
print (aux)
elif num < 0:
print("Se deberia haber ingresado un numero valido")
|
aux = 0
num = int(input('Ingrese un numero entero positivo: '))
opc = int(input('1- Sumatoria, 2-Factorial: '))
if opc == 1:
for x in range(0, num + 1):
aux = aux + x
print(aux)
elif opc == 2:
if num == 0:
print('1')
elif num > 0:
aux = 1
for x in range(1, num + 1):
aux = aux * x
print(aux)
elif num < 0:
print('Se deberia haber ingresado un numero valido')
|
#Give a single command that computes the sum from Exercise R-1.6,relying
#on Python's comprehension syntax and the built-in sum function
n = int(input('please input an positive integer:'))
result = sum(i**2 for i in range(1,n) if i&1!=0)
print(result)
|
n = int(input('please input an positive integer:'))
result = sum((i ** 2 for i in range(1, n) if i & 1 != 0))
print(result)
|
# coding=utf-8
"""
Exceptions for AVWX package
"""
class AVWXError(Exception):
"""Base AVWX exception"""
class AVWXRequestFailedError(AVWXError):
"""Raised when request failed"""
class StationNotFound(AVWXError):
"""
Raised when a ICAO station isn't found
"""
def __init__(self, icao: str) -> None:
msg = f'ICAO station not found on AVWX server: "{icao}"; you might want to try another one.'
super(StationNotFound, self).__init__(msg)
|
"""
Exceptions for AVWX package
"""
class Avwxerror(Exception):
"""Base AVWX exception"""
class Avwxrequestfailederror(AVWXError):
"""Raised when request failed"""
class Stationnotfound(AVWXError):
"""
Raised when a ICAO station isn't found
"""
def __init__(self, icao: str) -> None:
msg = f'ICAO station not found on AVWX server: "{icao}"; you might want to try another one.'
super(StationNotFound, self).__init__(msg)
|
def twoSum(self, n: List[int], target: int) -> List[int]:
N = len(n)
l = 0
r = N-1
while l<r:
s = n[l] + n[r]
if s == target:
return [l+1,r+1]
elif s < target:
l += 1
else:
r -= 1
|
def two_sum(self, n: List[int], target: int) -> List[int]:
n = len(n)
l = 0
r = N - 1
while l < r:
s = n[l] + n[r]
if s == target:
return [l + 1, r + 1]
elif s < target:
l += 1
else:
r -= 1
|
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
def __bytes2ul(b):
return int.from_bytes(b, byteorder='little', signed=False)
def mmh2(bstr, seed=0xc70f6907, signed=True):
MASK = 2 ** 64 - 1
size = len(bstr)
m = 0xc6a4a7935bd1e995
r = 47
h = seed ^ (size * m & MASK)
end = size & (0xfffffff8)
for pos in range(0, end, 8):
k = __bytes2ul(bstr[pos:pos+8])
k = k * m & MASK
k = k ^ (k >> r)
k = k * m & MASK;
h = h ^ k
h = h * m & MASK
left = size & 0x7
if left >= 7:
h = h ^ (bstr[end+6] << 48)
if left >= 6:
h = h ^ (bstr[end+5] << 40)
if left >= 5:
h = h ^ (bstr[end+4] << 32)
if left >= 4:
h = h ^ (bstr[end+3] << 24)
if left >= 3:
h = h ^ (bstr[end+2] << 16)
if left >= 2:
h = h ^ (bstr[end+1] << 8)
if left >= 1:
h = h ^ bstr[end+0]
h = h * m & MASK
h = h ^ (h >> r)
h = h * m & MASK
h = h ^ (h >> r)
if signed:
h = h | (-(h & 0x8000000000000000))
return h
if __name__ == '__main__':
assert mmh2(b'hello') == 2762169579135187400
assert mmh2(b'World') == -295471233978816215
assert mmh2(b'Hello World') == 2146989006636459346
assert mmh2(b'Hello Wo') == -821961639117166431
|
def __bytes2ul(b):
return int.from_bytes(b, byteorder='little', signed=False)
def mmh2(bstr, seed=3339675911, signed=True):
mask = 2 ** 64 - 1
size = len(bstr)
m = 14313749767032793493
r = 47
h = seed ^ size * m & MASK
end = size & 4294967288
for pos in range(0, end, 8):
k = __bytes2ul(bstr[pos:pos + 8])
k = k * m & MASK
k = k ^ k >> r
k = k * m & MASK
h = h ^ k
h = h * m & MASK
left = size & 7
if left >= 7:
h = h ^ bstr[end + 6] << 48
if left >= 6:
h = h ^ bstr[end + 5] << 40
if left >= 5:
h = h ^ bstr[end + 4] << 32
if left >= 4:
h = h ^ bstr[end + 3] << 24
if left >= 3:
h = h ^ bstr[end + 2] << 16
if left >= 2:
h = h ^ bstr[end + 1] << 8
if left >= 1:
h = h ^ bstr[end + 0]
h = h * m & MASK
h = h ^ h >> r
h = h * m & MASK
h = h ^ h >> r
if signed:
h = h | -(h & 9223372036854775808)
return h
if __name__ == '__main__':
assert mmh2(b'hello') == 2762169579135187400
assert mmh2(b'World') == -295471233978816215
assert mmh2(b'Hello World') == 2146989006636459346
assert mmh2(b'Hello Wo') == -821961639117166431
|
"""
author : Ali Emre SAVAS
Link : https://www.hackerrank.com/challenges/py-check-subset/problem
"""
if __name__ == "__main__":
for _ in range(int(input())):
numberOfA = int(input())
setA = set(map(int, input().split()))
numberOfA = int(input())
setB = set(map(int, input().split()))
print(setA.issubset(setB))
|
"""
author : Ali Emre SAVAS
Link : https://www.hackerrank.com/challenges/py-check-subset/problem
"""
if __name__ == '__main__':
for _ in range(int(input())):
number_of_a = int(input())
set_a = set(map(int, input().split()))
number_of_a = int(input())
set_b = set(map(int, input().split()))
print(setA.issubset(setB))
|
def init(n,m):
state_initial = [n] + [1] * m
state_current = state_initial
state_final = [n] * (m + 1)
return state_initial, state_current, state_final
def valid_transition(currentState, tower_i, tower_j):
k = 0
t = 0
if tower_i == tower_j: # same tower not allowed
return False
for i in range(1,len(currentState)):
if currentState[i]==tower_i:
k = i
if k == 0:
return False
for j in range(1,len(currentState)):
if currentState[j]==tower_j:
t = j
if k > 0 and k < t:
return False
return True
def transition(currentState, tower_i, tower_j):
if valid_transition(currentState, tower_i, tower_j):
for i in range(1, len(currentState)):
if currentState[i] == tower_i:
k = i
currentState[k] = tower_j
return currentState
def is_final_state(currentState, n, m):
if currentState == [n] * (m + 1):
return True
return False
|
def init(n, m):
state_initial = [n] + [1] * m
state_current = state_initial
state_final = [n] * (m + 1)
return (state_initial, state_current, state_final)
def valid_transition(currentState, tower_i, tower_j):
k = 0
t = 0
if tower_i == tower_j:
return False
for i in range(1, len(currentState)):
if currentState[i] == tower_i:
k = i
if k == 0:
return False
for j in range(1, len(currentState)):
if currentState[j] == tower_j:
t = j
if k > 0 and k < t:
return False
return True
def transition(currentState, tower_i, tower_j):
if valid_transition(currentState, tower_i, tower_j):
for i in range(1, len(currentState)):
if currentState[i] == tower_i:
k = i
currentState[k] = tower_j
return currentState
def is_final_state(currentState, n, m):
if currentState == [n] * (m + 1):
return True
return False
|
class Vector:
'''Vector class modeling Vectors'''
def __init__(self,initialise_param):
'''constructor:-create list of num length'''
if isinstance(initialise_param,(Vector,list)):
self._coords=[i for i in initialise_param]
elif isinstance(initialise_param,(int)):
if initialise_param<=0:
raise ValueError("bhai mat kar bhai mat kar chutiye")
else:
self._coords=[0]*initialise_param
def __len__(self):
return len(self._coords)
def __getitem__(self,j):
return self._coords[j]
def __setitem__(self,at_index,val):
self._coords[at_index]=val
def __add__(self,vector):
if len(self)!=len(vector):
raise ValueError("dimension of the vector must be same")
result=Vector(len(self))
for j in range(0,len(self)):
print(j)
print(self[j],vector[j])
result[j]=self[j]+vector[j]
return result
def __eq__(self,vector):
return True if vector == self else False
def __ne__(self,vector):
return not self==vector
def __str__(self):
return "<"+str(self._coords)[1:-1]+">"
def __sub__(self,vec):
if len(self)!=len(vec):
raise ValueError("both must have same dimension")
return
subtracted_vec=Vector(len(self))
for i in range(0,len(vec)):
subtracted_vec[i]=self[i]-vec[i]
return subtracted_vec
def __neg__(self):
neg_vector=Vector(len(self))
for i in range(0,len(self)):
neg_vector[i]=-1*self[i]
return neg_vector
# adding functionality to add list+vector return vector
def __mul__(self,multby_vec):
num=multby_vec
if isinstance(num,(int,float)):
vec=Vector(len(self))
for i in range(0,len(self)):
vec[i]=num*(self[i])
return vec
elif isinstance(multby_vec,list):
if len(self)!=len(multby_vec):
raise ValueError("must be of same length")
else:
dot_product=0
for i in range(0,len(multby_vec)):
dot_product+=multby_vec[i]*self[i]
return dot_product
def __radd__(self,add_list):
if len(self)!= len(add_list):
raise ValueError("must be of same length for valid operation")
new_vec=Vector(len(self))
for i in range(0,len(self)):
new_vec[i]=self[i]+add_list[i]
return new_vec
if __name__ == "__main__":
v1=Vector(3)
v2=Vector(3)
v1[2]=1
v2[1]=34
v3=v1+v2
print(v3)
v4=v3-v1
print("v3 is",v3,"\n v1 is \n",v1,"so the result after subtartion is ",v4)
print("after negating the values",-v4)
##ading list to vector adding functionality
v5=[1,2,3]+v4
print('adding lit to the elements []1,2,3]',v5)
## adding test of multiply operators
v6=v5*[1,2,3]# act as a dot product
print('multipled vector is',v6)
v6=v5*2
print(v6)
#v6=2*v5
print(v6)
# adding test for overriden Counstructors
new_vec=Vector([34,12,344,5])
print(new_vec)
|
class Vector:
"""Vector class modeling Vectors"""
def __init__(self, initialise_param):
"""constructor:-create list of num length"""
if isinstance(initialise_param, (Vector, list)):
self._coords = [i for i in initialise_param]
elif isinstance(initialise_param, int):
if initialise_param <= 0:
raise value_error('bhai mat kar bhai mat kar chutiye')
else:
self._coords = [0] * initialise_param
def __len__(self):
return len(self._coords)
def __getitem__(self, j):
return self._coords[j]
def __setitem__(self, at_index, val):
self._coords[at_index] = val
def __add__(self, vector):
if len(self) != len(vector):
raise value_error('dimension of the vector must be same')
result = vector(len(self))
for j in range(0, len(self)):
print(j)
print(self[j], vector[j])
result[j] = self[j] + vector[j]
return result
def __eq__(self, vector):
return True if vector == self else False
def __ne__(self, vector):
return not self == vector
def __str__(self):
return '<' + str(self._coords)[1:-1] + '>'
def __sub__(self, vec):
if len(self) != len(vec):
raise value_error('both must have same dimension')
return
subtracted_vec = vector(len(self))
for i in range(0, len(vec)):
subtracted_vec[i] = self[i] - vec[i]
return subtracted_vec
def __neg__(self):
neg_vector = vector(len(self))
for i in range(0, len(self)):
neg_vector[i] = -1 * self[i]
return neg_vector
def __mul__(self, multby_vec):
num = multby_vec
if isinstance(num, (int, float)):
vec = vector(len(self))
for i in range(0, len(self)):
vec[i] = num * self[i]
return vec
elif isinstance(multby_vec, list):
if len(self) != len(multby_vec):
raise value_error('must be of same length')
else:
dot_product = 0
for i in range(0, len(multby_vec)):
dot_product += multby_vec[i] * self[i]
return dot_product
def __radd__(self, add_list):
if len(self) != len(add_list):
raise value_error('must be of same length for valid operation')
new_vec = vector(len(self))
for i in range(0, len(self)):
new_vec[i] = self[i] + add_list[i]
return new_vec
if __name__ == '__main__':
v1 = vector(3)
v2 = vector(3)
v1[2] = 1
v2[1] = 34
v3 = v1 + v2
print(v3)
v4 = v3 - v1
print('v3 is', v3, '\n v1 is \n', v1, 'so the result after subtartion is ', v4)
print('after negating the values', -v4)
v5 = [1, 2, 3] + v4
print('adding lit to the elements []1,2,3]', v5)
v6 = v5 * [1, 2, 3]
print('multipled vector is', v6)
v6 = v5 * 2
print(v6)
print(v6)
new_vec = vector([34, 12, 344, 5])
print(new_vec)
|
def createList():
fruitsList = ["apple", "banana", "cherry"]
print("Fruit List : ", fruitsList)
# Iterate the list of fruits
for i in fruitsList:
print("Value : ", i)
# Add to fruits list
fruitsList.append("kiwi")
fruitsList.append("Grape")
fruitsList.append("Orange")
print("After adding furits now list ...")
for fruit in fruitsList:
print("Now Fruit : ", fruit)
# Delete a fruits from List
if fruitsList.__contains__("Grape"):
fruitsList.remove("Grape")
print("Fuits : ", fruitsList)
# Update a fruit, instead of apple, use Green Apple
for fruit in fruitsList:
value = fruit
if value == "apple":
# Find the index of apple
index = fruitsList.index("apple")
print("Index of Apple : ", index)
# Now update apple with Green Apple
fruitsList[index] = "Green Apple"
# finally print the details of the fruit list
print("Show all the updated fruits ...")
for fruit in fruitsList:
print(fruit, end="\t")
print("\n")
# Insert at the beginning of List
fruitsList.insert(0, "Laxman Phal") # Insert at the top
print("Inserted fruits : ", fruitsList)
# Insert at the last
fruitsList.append("Figs") # Insert at the last
print("Inserted at the end : ", fruitsList)
# Get the index in list of fruits
print("All the fruits with their indexes")
for fruit in fruitsList:
fruitIndex = fruitsList.index(fruit)
print(fruit, "<---->", fruitIndex)
#Sort a list
fruitsList.sort();
print("Sorted in Ascending order : ",fruitsList)
print("-------- In descending order ------")
fruitsList.sort(reverse = True)
print("Sorted in Descending order : ", fruitsList)
if __name__ == "__main__":
createList()
|
def create_list():
fruits_list = ['apple', 'banana', 'cherry']
print('Fruit List : ', fruitsList)
for i in fruitsList:
print('Value : ', i)
fruitsList.append('kiwi')
fruitsList.append('Grape')
fruitsList.append('Orange')
print('After adding furits now list ...')
for fruit in fruitsList:
print('Now Fruit : ', fruit)
if fruitsList.__contains__('Grape'):
fruitsList.remove('Grape')
print('Fuits : ', fruitsList)
for fruit in fruitsList:
value = fruit
if value == 'apple':
index = fruitsList.index('apple')
print('Index of Apple : ', index)
fruitsList[index] = 'Green Apple'
print('Show all the updated fruits ...')
for fruit in fruitsList:
print(fruit, end='\t')
print('\n')
fruitsList.insert(0, 'Laxman Phal')
print('Inserted fruits : ', fruitsList)
fruitsList.append('Figs')
print('Inserted at the end : ', fruitsList)
print('All the fruits with their indexes')
for fruit in fruitsList:
fruit_index = fruitsList.index(fruit)
print(fruit, '<---->', fruitIndex)
fruitsList.sort()
print('Sorted in Ascending order : ', fruitsList)
print('-------- In descending order ------')
fruitsList.sort(reverse=True)
print('Sorted in Descending order : ', fruitsList)
if __name__ == '__main__':
create_list()
|
class SlopeGradient:
def __init__(self, rightSteps, downSteps):
self.rightSteps = rightSteps
self.downSteps = downSteps
|
class Slopegradient:
def __init__(self, rightSteps, downSteps):
self.rightSteps = rightSteps
self.downSteps = downSteps
|
S = input()
is_no = False
for s in S:
if S.count(s) != 2:
is_no = True
break
if is_no:
print("No")
else:
print("Yes")
|
s = input()
is_no = False
for s in S:
if S.count(s) != 2:
is_no = True
break
if is_no:
print('No')
else:
print('Yes')
|
class WeekSchedule():
def __init__(self, dates=[], codes=[]):
self.weeknum = 0
self.dates = dates
self.codes = codes
|
class Weekschedule:
def __init__(self, dates=[], codes=[]):
self.weeknum = 0
self.dates = dates
self.codes = codes
|
a=10
print(type(a))
a='Python'
print(type(a))
a=False
print(type(a))
|
a = 10
print(type(a))
a = 'Python'
print(type(a))
a = False
print(type(a))
|
''' Code for training and evaluating Self-Explaining Neural Networks.
Copyright (C) 2018 David Alvarez-Melis <dalvmel@mit.edu>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
'''
|
""" Code for training and evaluating Self-Explaining Neural Networks.
Copyright (C) 2018 David Alvarez-Melis <dalvmel@mit.edu>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
|
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
def image_deps():
container_pull(
name = "python3.7",
digest = "sha256:57c7d7161fdaa79b61f107b8a480c50657d64dca37295d67db2f675abe38b45a",
registry = "index.docker.io",
repository = "library/python",
tag = "3.7.8",
)
|
load('@io_bazel_rules_docker//container:container.bzl', 'container_pull')
def image_deps():
container_pull(name='python3.7', digest='sha256:57c7d7161fdaa79b61f107b8a480c50657d64dca37295d67db2f675abe38b45a', registry='index.docker.io', repository='library/python', tag='3.7.8')
|
#!/usr/bin/python
ADMIN_SCHEMA_FOLDER = "admin/schemas/"
ADMIN_SCHEMA_CHAR_SEPARATOR = "_"
ADD_COIN_METHOD = "addcoin"
GET_COIN_METHOD = "getcoin"
REMOVE_COIN_METHOD = "removecoin"
UPDATE_COIN_METHOD = "updatecoin"
|
admin_schema_folder = 'admin/schemas/'
admin_schema_char_separator = '_'
add_coin_method = 'addcoin'
get_coin_method = 'getcoin'
remove_coin_method = 'removecoin'
update_coin_method = 'updatecoin'
|
class HandledEventArgs(EventArgs):
"""
Provides data for events that can be handled completely in an event handler.
HandledEventArgs()
HandledEventArgs(defaultHandledValue: bool)
"""
@staticmethod
def __new__(self,defaultHandledValue=None):
"""
__new__(cls: type)
__new__(cls: type,defaultHandledValue: bool)
"""
pass
Handled=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing.
Get: Handled(self: HandledEventArgs) -> bool
Set: Handled(self: HandledEventArgs)=value
"""
|
class Handledeventargs(EventArgs):
"""
Provides data for events that can be handled completely in an event handler.
HandledEventArgs()
HandledEventArgs(defaultHandledValue: bool)
"""
@staticmethod
def __new__(self, defaultHandledValue=None):
"""
__new__(cls: type)
__new__(cls: type,defaultHandledValue: bool)
"""
pass
handled = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing.\n\n\n\nGet: Handled(self: HandledEventArgs) -> bool\n\n\n\nSet: Handled(self: HandledEventArgs)=value\n\n'
|
exp_name = 'glean_ffhq_16x'
scale = 16
# model settings
model = dict(
type='GLEAN',
generator=dict(
type='GLEANStyleGANv2',
in_size=64,
out_size=1024,
style_channels=512,
pretrained=dict(
ckpt_path='http://download.openmmlab.com/mmgen/stylegan2/'
'official_weights/stylegan2-ffhq-config-f-official_20210327'
'_171224-bce9310c.pth',
prefix='generator_ema')),
discriminator=dict(
type='StyleGAN2Discriminator',
in_size=1024,
pretrained=dict(
ckpt_path='http://download.openmmlab.com/mmgen/stylegan2/'
'official_weights/stylegan2-ffhq-config-f-official_20210327'
'_171224-bce9310c.pth',
prefix='discriminator')),
pixel_loss=dict(type='MSELoss', loss_weight=1.0, reduction='mean'),
perceptual_loss=dict(
type='PerceptualLoss',
layer_weights={'21': 1.0},
vgg_type='vgg16',
perceptual_weight=1e-2,
style_weight=0,
norm_img=False,
criterion='mse',
pretrained='torchvision://vgg16'),
gan_loss=dict(
type='GANLoss',
gan_type='vanilla',
loss_weight=1e-2,
real_label_val=1.0,
fake_label_val=0),
pretrained=None,
)
# model training and testing settings
train_cfg = None
test_cfg = dict(metrics=['PSNR'], crop_border=0)
# dataset settings
train_dataset_type = 'SRAnnotationDataset'
val_dataset_type = 'SRAnnotationDataset'
train_pipeline = [
dict(type='LoadImageFromFile', io_backend='disk', key='lq'),
dict(type='LoadImageFromFile', io_backend='disk', key='gt'),
dict(type='RescaleToZeroOne', keys=['lq', 'gt']),
dict(
type='Normalize',
keys=['lq', 'gt'],
mean=[0.5, 0.5, 0.5],
std=[0.5, 0.5, 0.5],
to_rgb=True),
dict(
type='Flip', keys=['lq', 'gt'], flip_ratio=0.5,
direction='horizontal'),
dict(type='ImageToTensor', keys=['lq', 'gt']),
dict(type='Collect', keys=['lq', 'gt'], meta_keys=['lq_path', 'gt_path'])
]
test_pipeline = [
dict(type='LoadImageFromFile', io_backend='disk', key='lq'),
dict(type='LoadImageFromFile', io_backend='disk', key='gt'),
dict(type='RescaleToZeroOne', keys=['lq', 'gt']),
dict(
type='Normalize',
keys=['lq', 'gt'],
mean=[0.5, 0.5, 0.5],
std=[0.5, 0.5, 0.5],
to_rgb=True),
dict(type='ImageToTensor', keys=['lq', 'gt']),
dict(type='Collect', keys=['lq', 'gt'], meta_keys=['lq_path', 'gt_path'])
]
data = dict(
workers_per_gpu=8,
train_dataloader=dict(samples_per_gpu=4, drop_last=True), # 2 gpus
val_dataloader=dict(samples_per_gpu=1),
test_dataloader=dict(samples_per_gpu=1),
train=dict(
type='RepeatDataset',
times=1000,
dataset=dict(
type=train_dataset_type,
lq_folder='data/FFHQ/BIx16_down',
gt_folder='data/FFHQ/GT',
ann_file='data/FFHQ/meta_info_FFHQ_GT.txt',
pipeline=train_pipeline,
scale=scale)),
val=dict(
type=val_dataset_type,
lq_folder='data/CelebA-HQ/BIx16_down',
gt_folder='data/CelebA-HQ/GT',
ann_file='data/CelebA-HQ/meta_info_CelebAHQ_val100_GT.txt',
pipeline=test_pipeline,
scale=scale),
test=dict(
type=val_dataset_type,
lq_folder='data/CelebA-HQ/BIx16_down',
gt_folder='data/CelebA-HQ/GT',
ann_file='data/CelebA-HQ/meta_info_CelebAHQ_val100_GT.txt',
pipeline=test_pipeline,
scale=scale))
# optimizer
optimizers = dict(
generator=dict(type='Adam', lr=1e-4, betas=(0.9, 0.99)),
discriminator=dict(type='Adam', lr=1e-4, betas=(0.9, 0.99)))
# learning policy
total_iters = 300000
lr_config = dict(
policy='CosineRestart',
by_epoch=False,
periods=[300000],
restart_weights=[1],
min_lr=1e-7)
checkpoint_config = dict(interval=5000, save_optimizer=True, by_epoch=False)
evaluation = dict(interval=5000, save_image=False, gpu_collect=True)
log_config = dict(
interval=100,
hooks=[
dict(type='TextLoggerHook', by_epoch=False),
# dict(type='TensorboardLoggerHook'),
])
visual_config = None
# runtime settings
dist_params = dict(backend='nccl')
log_level = 'INFO'
work_dir = f'./work_dirs/{exp_name}'
load_from = None
resume_from = None
workflow = [('train', 1)]
find_unused_parameters = True
|
exp_name = 'glean_ffhq_16x'
scale = 16
model = dict(type='GLEAN', generator=dict(type='GLEANStyleGANv2', in_size=64, out_size=1024, style_channels=512, pretrained=dict(ckpt_path='http://download.openmmlab.com/mmgen/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth', prefix='generator_ema')), discriminator=dict(type='StyleGAN2Discriminator', in_size=1024, pretrained=dict(ckpt_path='http://download.openmmlab.com/mmgen/stylegan2/official_weights/stylegan2-ffhq-config-f-official_20210327_171224-bce9310c.pth', prefix='discriminator')), pixel_loss=dict(type='MSELoss', loss_weight=1.0, reduction='mean'), perceptual_loss=dict(type='PerceptualLoss', layer_weights={'21': 1.0}, vgg_type='vgg16', perceptual_weight=0.01, style_weight=0, norm_img=False, criterion='mse', pretrained='torchvision://vgg16'), gan_loss=dict(type='GANLoss', gan_type='vanilla', loss_weight=0.01, real_label_val=1.0, fake_label_val=0), pretrained=None)
train_cfg = None
test_cfg = dict(metrics=['PSNR'], crop_border=0)
train_dataset_type = 'SRAnnotationDataset'
val_dataset_type = 'SRAnnotationDataset'
train_pipeline = [dict(type='LoadImageFromFile', io_backend='disk', key='lq'), dict(type='LoadImageFromFile', io_backend='disk', key='gt'), dict(type='RescaleToZeroOne', keys=['lq', 'gt']), dict(type='Normalize', keys=['lq', 'gt'], mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], to_rgb=True), dict(type='Flip', keys=['lq', 'gt'], flip_ratio=0.5, direction='horizontal'), dict(type='ImageToTensor', keys=['lq', 'gt']), dict(type='Collect', keys=['lq', 'gt'], meta_keys=['lq_path', 'gt_path'])]
test_pipeline = [dict(type='LoadImageFromFile', io_backend='disk', key='lq'), dict(type='LoadImageFromFile', io_backend='disk', key='gt'), dict(type='RescaleToZeroOne', keys=['lq', 'gt']), dict(type='Normalize', keys=['lq', 'gt'], mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], to_rgb=True), dict(type='ImageToTensor', keys=['lq', 'gt']), dict(type='Collect', keys=['lq', 'gt'], meta_keys=['lq_path', 'gt_path'])]
data = dict(workers_per_gpu=8, train_dataloader=dict(samples_per_gpu=4, drop_last=True), val_dataloader=dict(samples_per_gpu=1), test_dataloader=dict(samples_per_gpu=1), train=dict(type='RepeatDataset', times=1000, dataset=dict(type=train_dataset_type, lq_folder='data/FFHQ/BIx16_down', gt_folder='data/FFHQ/GT', ann_file='data/FFHQ/meta_info_FFHQ_GT.txt', pipeline=train_pipeline, scale=scale)), val=dict(type=val_dataset_type, lq_folder='data/CelebA-HQ/BIx16_down', gt_folder='data/CelebA-HQ/GT', ann_file='data/CelebA-HQ/meta_info_CelebAHQ_val100_GT.txt', pipeline=test_pipeline, scale=scale), test=dict(type=val_dataset_type, lq_folder='data/CelebA-HQ/BIx16_down', gt_folder='data/CelebA-HQ/GT', ann_file='data/CelebA-HQ/meta_info_CelebAHQ_val100_GT.txt', pipeline=test_pipeline, scale=scale))
optimizers = dict(generator=dict(type='Adam', lr=0.0001, betas=(0.9, 0.99)), discriminator=dict(type='Adam', lr=0.0001, betas=(0.9, 0.99)))
total_iters = 300000
lr_config = dict(policy='CosineRestart', by_epoch=False, periods=[300000], restart_weights=[1], min_lr=1e-07)
checkpoint_config = dict(interval=5000, save_optimizer=True, by_epoch=False)
evaluation = dict(interval=5000, save_image=False, gpu_collect=True)
log_config = dict(interval=100, hooks=[dict(type='TextLoggerHook', by_epoch=False)])
visual_config = None
dist_params = dict(backend='nccl')
log_level = 'INFO'
work_dir = f'./work_dirs/{exp_name}'
load_from = None
resume_from = None
workflow = [('train', 1)]
find_unused_parameters = True
|
#1 Create countries dictionary
countries = __________________
#2 Print out the capital of egypt
print(__________________)
|
countries = __________________
print(__________________)
|
# -*- coding:utf-8 -*-
__author__ = [
'wufang'
]
|
__author__ = ['wufang']
|
"""Farmer classes.
:author: Someone
:email: someone@pnnl.gov
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
"""
class FarmerOne:
"""This is the first Farmer agent.
:param age: Age of farmer
:type age: int
CLASS ATTRIBUTES:
:param AGE_MIN: Minimum age of a farmer
:type AGE_MIN: int
:param AGE_MAX: Maximum age of a farmer
:type AGE_MAX" int
"""
# minimum and maximum of acceptable farmer ages
AGE_MIN = 0
AGE_MAX = 150
def __init__(self, age):
self._age = age
@property
def age(self):
"""Age of farmer must be between expected age."""
if self._age > FarmerOne.AGE_MAX:
raise ValueError(f"FarmerOne age '{self._age}' is greater than allowable age of '{FarmerOne.AGE_MAX}'")
elif self._age < FarmerOne.AGE_MIN:
raise ValueError(f"FarmerOne age '{self._age}' is less than allowable age of '{FarmerOne.AGE_MIN}'")
else:
return self._age
|
"""Farmer classes.
:author: Someone
:email: someone@pnnl.gov
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
"""
class Farmerone:
"""This is the first Farmer agent.
:param age: Age of farmer
:type age: int
CLASS ATTRIBUTES:
:param AGE_MIN: Minimum age of a farmer
:type AGE_MIN: int
:param AGE_MAX: Maximum age of a farmer
:type AGE_MAX" int
"""
age_min = 0
age_max = 150
def __init__(self, age):
self._age = age
@property
def age(self):
"""Age of farmer must be between expected age."""
if self._age > FarmerOne.AGE_MAX:
raise value_error(f"FarmerOne age '{self._age}' is greater than allowable age of '{FarmerOne.AGE_MAX}'")
elif self._age < FarmerOne.AGE_MIN:
raise value_error(f"FarmerOne age '{self._age}' is less than allowable age of '{FarmerOne.AGE_MIN}'")
else:
return self._age
|
# ------------------------------------------------------------------------------
# Access to the CodeHawk Binary Analyzer Analysis Results
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2020 Kestrel Technology LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ------------------------------------------------------------------------------
"""X86 CPU Register data."""
class AsmRegisterBase(object):
def __init__(self,bd,index,tags,args):
self.bd = bd
self.index = index
self.tags = tags
self.args = args
def is_cpu_register(self): return False
def is_segment_register(self): return False
def is_double_register(self): return False
def is_floating_point_register(self): return False
def is_control_register(self): return False
def is_debug_register(self): return False
def is_mmx_register(self): return False
def is_xmm_register(self): return False
def get_key(self):
return (','.join(self.tags), ','.join([str(x) for x in self.args]))
# ------------------------------------------------------------------------------
# CPURegister
# ------------------------------------------------------------------------------
class CPURegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_cpu_register(self): return True
def __str__(self): return self.tags[1]
# ------------------------------------------------------------------------------
# SegmentRegister
# ------------------------------------------------------------------------------
class SegmentRegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_segment_register(self): return True
def __str__(self): return self.tags[1]
# ------------------------------------------------------------------------------
# DoubleRegister
# ------------------------------------------------------------------------------
class DoubleRegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_double_register(self): return True
def __str__(self): return self.tags[1] + ':' + self.tags[2]
# ------------------------------------------------------------------------------
# FloatingPointRegister
# ------------------------------------------------------------------------------
class FloatingPointRegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_floating_point_register(self): return True
def get_index(self): return self.args[0]
def __str__(self): return 'st(' + str(self.get_index()) + ')'
# ------------------------------------------------------------------------------
# ControlRegister
# ------------------------------------------------------------------------------
class ControlRegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_control_register(self): return True
def get_index(self): return self.args[0]
def __str__(self): return 'CR' + str(self.get_index())
# ------------------------------------------------------------------------------
# DebugRegister
# ------------------------------------------------------------------------------
class DebugRegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_debug_register(self): return True
def get_index(self): return self.args[0]
def __str__(self): return 'DR' + str(self.get_index())
# ------------------------------------------------------------------------------
# MmxRegister
# ------------------------------------------------------------------------------
class MmxRegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_mmx_register(self): return True
def get_index(self): return self.args[0]
def __str__(self): return 'mm(' + str(self.get_index()) + ')'
# ------------------------------------------------------------------------------
# XmmRegister
# ------------------------------------------------------------------------------
class XmmRegister(AsmRegisterBase):
def __init__(self,bd,index,tags,args):
AsmRegisterBase.__init__(self,bd,index,tags,args)
def is_xmm_register(self): return True
def get_index(self): return self.args[0]
def __str__(self): return 'xmm(' + str(self.get_index()) + ')'
|
"""X86 CPU Register data."""
class Asmregisterbase(object):
def __init__(self, bd, index, tags, args):
self.bd = bd
self.index = index
self.tags = tags
self.args = args
def is_cpu_register(self):
return False
def is_segment_register(self):
return False
def is_double_register(self):
return False
def is_floating_point_register(self):
return False
def is_control_register(self):
return False
def is_debug_register(self):
return False
def is_mmx_register(self):
return False
def is_xmm_register(self):
return False
def get_key(self):
return (','.join(self.tags), ','.join([str(x) for x in self.args]))
class Cpuregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_cpu_register(self):
return True
def __str__(self):
return self.tags[1]
class Segmentregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_segment_register(self):
return True
def __str__(self):
return self.tags[1]
class Doubleregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_double_register(self):
return True
def __str__(self):
return self.tags[1] + ':' + self.tags[2]
class Floatingpointregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_floating_point_register(self):
return True
def get_index(self):
return self.args[0]
def __str__(self):
return 'st(' + str(self.get_index()) + ')'
class Controlregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_control_register(self):
return True
def get_index(self):
return self.args[0]
def __str__(self):
return 'CR' + str(self.get_index())
class Debugregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_debug_register(self):
return True
def get_index(self):
return self.args[0]
def __str__(self):
return 'DR' + str(self.get_index())
class Mmxregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_mmx_register(self):
return True
def get_index(self):
return self.args[0]
def __str__(self):
return 'mm(' + str(self.get_index()) + ')'
class Xmmregister(AsmRegisterBase):
def __init__(self, bd, index, tags, args):
AsmRegisterBase.__init__(self, bd, index, tags, args)
def is_xmm_register(self):
return True
def get_index(self):
return self.args[0]
def __str__(self):
return 'xmm(' + str(self.get_index()) + ')'
|
"""hxlm.core.urn
Author: 2021, Emerson Rocha (Etica.AI) <rocha@ieee.org>
License: Public Domain / BSD Zero Clause License
SPDX-License-Identifier: Unlicense OR 0BSD
"""
# __all__ = [
# 'get_entrypoint_type'
# ]
# from hxlm.core.io.util import ( # noqa
# get_entrypoint_type
# )
|
"""hxlm.core.urn
Author: 2021, Emerson Rocha (Etica.AI) <rocha@ieee.org>
License: Public Domain / BSD Zero Clause License
SPDX-License-Identifier: Unlicense OR 0BSD
"""
|
"""
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity
O(n).
For example,
S = "ADOBECODEBANC"
T = "ABC"
Minimum window is "BANC".
Note:
If there is no such window in S that covers all characters in T, return the emtpy string "".
If there are multiple such windows, you are guaranteed that there will always be only one unique minimum window in S.
"""
__author__ = 'Danyang'
class Solution:
def minWindow(self, S, T):
"""
Algorithm:
two pointers
Aggressively enclose the chars until find all T, and then shrink the window as far as possible
:param S: str
:param T: str
:return: str
"""
min_window = [0, 1<<32] # [start, end)
w_chars = [0 for _ in range(256)] # window
T_CHARS = [0 for _ in range(256)] # 256 ascii, static
for char in T:
T_CHARS[ord(char)] += 1 # remain static after construction
appeared_cnt = 0
start_ptr = 0
for end_ptr in xrange(len(S)):
# expand
val = S[end_ptr]
if T_CHARS[ord(val)]>0:
w_chars[ord(val)] += 1
if T_CHARS[ord(val)]>0 and w_chars[ord(val)]<=T_CHARS[ord(val)]:
appeared_cnt += 1 # when to decrease appeared_cnt?
# shrink
if appeared_cnt==len(T): # until find all
# while w_chars[ord(S[start_ptr])]>T_CHARS[ord(S[start_ptr])] or w_chars[ord(S[start_ptr])]<=0:
while w_chars[ord(S[start_ptr])]>T_CHARS[ord(S[start_ptr])] or T_CHARS[ord(S[start_ptr])]<=0:
w_chars[ord(S[start_ptr])] -= 1 # if negative, it doesn't matter
start_ptr += 1
# after shrinking, still valid window
if min_window[1]-min_window[0]>end_ptr-start_ptr+1:
min_window[0], min_window[1] = start_ptr, end_ptr+1
if min_window[1]==1<<32:
return ""
else:
return S[min_window[0]:min_window[1]]
if __name__=="__main__":
assert Solution().minWindow("ADOBECODEBANC", "ABC")=="BANC"
|
"""
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity
O(n).
For example,
S = "ADOBECODEBANC"
T = "ABC"
Minimum window is "BANC".
Note:
If there is no such window in S that covers all characters in T, return the emtpy string "".
If there are multiple such windows, you are guaranteed that there will always be only one unique minimum window in S.
"""
__author__ = 'Danyang'
class Solution:
def min_window(self, S, T):
"""
Algorithm:
two pointers
Aggressively enclose the chars until find all T, and then shrink the window as far as possible
:param S: str
:param T: str
:return: str
"""
min_window = [0, 1 << 32]
w_chars = [0 for _ in range(256)]
t_chars = [0 for _ in range(256)]
for char in T:
T_CHARS[ord(char)] += 1
appeared_cnt = 0
start_ptr = 0
for end_ptr in xrange(len(S)):
val = S[end_ptr]
if T_CHARS[ord(val)] > 0:
w_chars[ord(val)] += 1
if T_CHARS[ord(val)] > 0 and w_chars[ord(val)] <= T_CHARS[ord(val)]:
appeared_cnt += 1
if appeared_cnt == len(T):
while w_chars[ord(S[start_ptr])] > T_CHARS[ord(S[start_ptr])] or T_CHARS[ord(S[start_ptr])] <= 0:
w_chars[ord(S[start_ptr])] -= 1
start_ptr += 1
if min_window[1] - min_window[0] > end_ptr - start_ptr + 1:
(min_window[0], min_window[1]) = (start_ptr, end_ptr + 1)
if min_window[1] == 1 << 32:
return ''
else:
return S[min_window[0]:min_window[1]]
if __name__ == '__main__':
assert solution().minWindow('ADOBECODEBANC', 'ABC') == 'BANC'
|
a = int(input())
b = int(input())
def rectangle_area(a, b):
return '{:.0f}'.format(a * b)
print(rectangle_area(a, b))
|
a = int(input())
b = int(input())
def rectangle_area(a, b):
return '{:.0f}'.format(a * b)
print(rectangle_area(a, b))
|
# -*- coding: utf-8 -*-
"""
KM3NeT Data Definitions v2.0.0-9-gbae3720
https://git.km3net.de/common/km3net-dataformat
"""
# daqdatatypes
data = dict(
DAQSUPERFRAME=101,
DAQSUMMARYFRAME=201,
DAQTIMESLICE=1001,
DAQTIMESLICEL0=1002,
DAQTIMESLICEL1=1003,
DAQTIMESLICEL2=1004,
DAQTIMESLICESN=1005,
DAQSUMMARYSLICE=2001,
DAQEVENT=10001,
)
|
"""
KM3NeT Data Definitions v2.0.0-9-gbae3720
https://git.km3net.de/common/km3net-dataformat
"""
data = dict(DAQSUPERFRAME=101, DAQSUMMARYFRAME=201, DAQTIMESLICE=1001, DAQTIMESLICEL0=1002, DAQTIMESLICEL1=1003, DAQTIMESLICEL2=1004, DAQTIMESLICESN=1005, DAQSUMMARYSLICE=2001, DAQEVENT=10001)
|
class Solution:
def minSteps(self, n: int) -> int:
res, m = 0, 2
while n > 1:
while n % m == 0:
res += m
n //= m
m += 1
return res
|
class Solution:
def min_steps(self, n: int) -> int:
(res, m) = (0, 2)
while n > 1:
while n % m == 0:
res += m
n //= m
m += 1
return res
|
# Example, do not modify!
print(5 / 8)
# Put code below here
5 / 8
print( 7 + 10 )
# Just testing division
print(5 / 8)
# Addition works too.
print(7 + 10)
# Addition and subtraction
print(5 + 5)
print(5 - 5)
# Multiplication and division
print(3 * 5)
print(10 / 2)
# Exponentiation
print(4 ** 2)
# Modulo
print(18 % 7)
# How much is your $100 worth after 7 years?
print( 100 * 1.1 ** 7 )
# Create a variable savings
savings = 100
# Print out savings
print( savings )
# Create a variable savings
savings = 100
# Create a variable factor
factor = 1.10
# Calculate result
result = savings * factor ** 7
# Print out result
print( result )
# Create a variable desc
desc = "compound interest"
# Create a variable profitable
profitable = True
# Several variables to experiment with
savings = 100
factor = 1.1
desc = "compound interest"
# Assign product of factor and savings to year1
year1 = savings * factor
# Print the type of year1
print( type( year1 ) )
# Assign sum of desc and desc to doubledesc
doubledesc = desc + desc
# Print out doubledesc
print( doubledesc )
# Definition of savings and result
savings = 100
result = 100 * 1.10 ** 7
# Fix the printout
print("I started with $" + str(savings) + " and now have $" + str(result) + ". Awesome!")
# Definition of pi_string
pi_string = "3.1415926"
# Convert pi_string into float: pi_float
pi_float = float(pi_string)
|
print(5 / 8)
5 / 8
print(7 + 10)
print(5 / 8)
print(7 + 10)
print(5 + 5)
print(5 - 5)
print(3 * 5)
print(10 / 2)
print(4 ** 2)
print(18 % 7)
print(100 * 1.1 ** 7)
savings = 100
print(savings)
savings = 100
factor = 1.1
result = savings * factor ** 7
print(result)
desc = 'compound interest'
profitable = True
savings = 100
factor = 1.1
desc = 'compound interest'
year1 = savings * factor
print(type(year1))
doubledesc = desc + desc
print(doubledesc)
savings = 100
result = 100 * 1.1 ** 7
print('I started with $' + str(savings) + ' and now have $' + str(result) + '. Awesome!')
pi_string = '3.1415926'
pi_float = float(pi_string)
|
# -*- coding: utf-8 -*-
name = 'smsapi-client'
version = '2.3.0'
lib_info = '%s/%s' % (name, version)
|
name = 'smsapi-client'
version = '2.3.0'
lib_info = '%s/%s' % (name, version)
|
f = open('day6.txt', 'r')
data = f.read()
groups = data.split('\n\n')
answer = 0
for group in groups:
people = group.split('\n')
group_set = set(people[0])
for person in people:
group_set = group_set & set(person)
answer += len(group_set)
print(answer)
|
f = open('day6.txt', 'r')
data = f.read()
groups = data.split('\n\n')
answer = 0
for group in groups:
people = group.split('\n')
group_set = set(people[0])
for person in people:
group_set = group_set & set(person)
answer += len(group_set)
print(answer)
|
#!/bin/python3
def day12(lines):
registers = {'a': 0, 'b': 0, 'c': 1, 'd': 0}
i = 0
k = 0
while i < len(lines):
if k > 0:
i += 1
k -= 1
continue
line = lines[i].strip('\n').split(' ')
print('[%d, %d, %d, %d], %s' % (registers['a'],
registers['b'],
registers['c'],
registers['d'], line))
try:
x = registers[line[1]]
except KeyError:
x = int(line[1])
if line[0] == 'cpy':
registers[line[2]] = registers.get(line[1], x)
elif line[0] == 'inc':
registers[line[1]] += 1
elif line[0] == 'dec':
registers[line[1]] -= 1
elif line[0] == 'jnz' and x != 0:
jump = int(line[2])
if jump < 0:
i = max(i + jump, 0)
continue
else:
k += jump
continue
i += 1
return registers['a']
with open('aoc_day_12_input.txt') as f:
r = f.readlines()
print(day12(r))
|
def day12(lines):
registers = {'a': 0, 'b': 0, 'c': 1, 'd': 0}
i = 0
k = 0
while i < len(lines):
if k > 0:
i += 1
k -= 1
continue
line = lines[i].strip('\n').split(' ')
print('[%d, %d, %d, %d], %s' % (registers['a'], registers['b'], registers['c'], registers['d'], line))
try:
x = registers[line[1]]
except KeyError:
x = int(line[1])
if line[0] == 'cpy':
registers[line[2]] = registers.get(line[1], x)
elif line[0] == 'inc':
registers[line[1]] += 1
elif line[0] == 'dec':
registers[line[1]] -= 1
elif line[0] == 'jnz' and x != 0:
jump = int(line[2])
if jump < 0:
i = max(i + jump, 0)
continue
else:
k += jump
continue
i += 1
return registers['a']
with open('aoc_day_12_input.txt') as f:
r = f.readlines()
print(day12(r))
|
"""Used to make pytest functions available globally"""
# Copyright (c) 2020 zfit
#
#
# def pytest_generate_tests(metafunc):
# if metafunc.config.option.all_jit_levels:
#
# # We're going to duplicate these tests by parametrizing them,
# # which requires that each test has a fixture to accept the parameter.
# # We can add a new fixture like so:
# metafunc.fixturenames.append('tmp_ct')
#
# # Now we parametrize. This is what happens when we do e.g.,
# # @pytest.mark.parametrize('tmp_ct', range(count))
# # def test_foo(): pass
# metafunc.parametrize('tmp_ct', range(2))
|
"""Used to make pytest functions available globally"""
|
mutables_test_text_001 = '''
def function(
param,
):
pass
'''
mutables_test_text_002 = '''
def function(
param=0,
):
pass
'''
mutables_test_text_003 = '''
def function(
param={},
):
pass
'''
mutables_test_text_004 = '''
def function(
param=[],
):
pass
'''
mutables_test_text_005 = '''
def function(
param=tuple(),
):
pass
'''
mutables_test_text_006 = '''
def function(
param=list(),
):
pass
'''
mutables_test_text_007 = '''
def function(
param_one,
param_two,
):
pass
'''
mutables_test_text_008 = '''
def function(
param_one,
param_two=0,
):
pass
'''
mutables_test_text_009 = '''
def function(
param_one,
param_two={},
):
pass
'''
mutables_test_text_010 = '''
def function(
param_one,
param_two=[],
):
pass
'''
mutables_test_text_011 = '''
def function(
param_one,
param_two=list(),
):
pass
'''
mutables_test_text_012 = '''
def function(
param_one,
param_two=tuple(),
):
pass
'''
mutables_test_text_013 = '''
def function(
param_one,
param_two,
param_three,
):
pass
'''
mutables_test_text_014 = '''
def function(
param_one,
param_two,
param_three=0,
):
pass
'''
mutables_test_text_015 = '''
def function(
param_one,
param_two=0,
param_three={},
):
pass
'''
mutables_test_text_016 = '''
def function(
param_one,
param_two=[],
param_three={},
):
pass
'''
mutables_test_text_017 = '''
def function(
param_one={},
param_two=0,
param_three={},
):
pass
'''
mutables_test_text_018 = '''
def function(
param_one=0,
param_two=[],
param_three=0,
):
pass
'''
|
mutables_test_text_001 = '\ndef function(\n param,\n):\n pass\n'
mutables_test_text_002 = '\ndef function(\n param=0,\n):\n pass\n'
mutables_test_text_003 = '\ndef function(\n param={},\n):\n pass\n'
mutables_test_text_004 = '\ndef function(\n param=[],\n):\n pass\n'
mutables_test_text_005 = '\ndef function(\n param=tuple(),\n):\n pass\n'
mutables_test_text_006 = '\ndef function(\n param=list(),\n):\n pass\n'
mutables_test_text_007 = '\ndef function(\n param_one,\n param_two,\n):\n pass\n'
mutables_test_text_008 = '\ndef function(\n param_one,\n param_two=0,\n):\n pass\n'
mutables_test_text_009 = '\ndef function(\n param_one,\n param_two={},\n):\n pass\n'
mutables_test_text_010 = '\ndef function(\n param_one,\n param_two=[],\n):\n pass\n'
mutables_test_text_011 = '\ndef function(\n param_one,\n param_two=list(),\n):\n pass\n'
mutables_test_text_012 = '\ndef function(\n param_one,\n param_two=tuple(),\n):\n pass\n'
mutables_test_text_013 = '\ndef function(\n param_one,\n param_two,\n param_three,\n):\n pass\n'
mutables_test_text_014 = '\ndef function(\n param_one,\n param_two,\n param_three=0,\n):\n pass\n'
mutables_test_text_015 = '\ndef function(\n param_one,\n param_two=0,\n param_three={},\n):\n pass\n'
mutables_test_text_016 = '\ndef function(\n param_one,\n param_two=[],\n param_three={},\n):\n pass\n'
mutables_test_text_017 = '\ndef function(\n param_one={},\n param_two=0,\n param_three={},\n):\n pass\n'
mutables_test_text_018 = '\ndef function(\n param_one=0,\n param_two=[],\n param_three=0,\n):\n pass\n'
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Solution:
def merge(self, nums1, m: int, nums2, n: int) -> None:
"""
Do not return anything, modify nums1 in-place instead.
"""
for i in range(m):
nums1[-1-i] = nums1[m-1-i]
i = 0
j = 0
k = 0
while i < m and j < n:
if nums1[-m+i] < nums2[j]:
nums1[k] = nums1[-m+i]
i += 1
else:
nums1[k] = nums2[j]
j += 1
k += 1
while i < m:
nums1[k] = nums1[-m+i]
i += 1
k += 1
while j < n:
nums1[k] = nums2[j]
j += 1
k += 1
if __name__ == "__main__":
s = Solution()
nums1 = [1, 2, 3, 0, 0, 0]
m = 3
nums2 = [2, 5, 6]
n = 3
s.merge(nums1, m, nums2, n)
print(nums1)
|
class Solution:
def merge(self, nums1, m: int, nums2, n: int) -> None:
"""
Do not return anything, modify nums1 in-place instead.
"""
for i in range(m):
nums1[-1 - i] = nums1[m - 1 - i]
i = 0
j = 0
k = 0
while i < m and j < n:
if nums1[-m + i] < nums2[j]:
nums1[k] = nums1[-m + i]
i += 1
else:
nums1[k] = nums2[j]
j += 1
k += 1
while i < m:
nums1[k] = nums1[-m + i]
i += 1
k += 1
while j < n:
nums1[k] = nums2[j]
j += 1
k += 1
if __name__ == '__main__':
s = solution()
nums1 = [1, 2, 3, 0, 0, 0]
m = 3
nums2 = [2, 5, 6]
n = 3
s.merge(nums1, m, nums2, n)
print(nums1)
|
#
# PySNMP MIB module CISCO-ENTITY-FRU-CONTROL-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ENTITY-FRU-CONTROL-CAPABILITY
# Produced by pysmi-0.3.4 at Wed May 1 11:57:00 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")
ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection")
ciscoAgentCapability, = mibBuilder.importSymbols("CISCO-SMI", "ciscoAgentCapability")
AgentCapabilities, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "AgentCapabilities", "ModuleCompliance", "NotificationGroup")
Integer32, iso, Unsigned32, Bits, ObjectIdentity, Gauge32, ModuleIdentity, TimeTicks, NotificationType, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, MibIdentifier, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "iso", "Unsigned32", "Bits", "ObjectIdentity", "Gauge32", "ModuleIdentity", "TimeTicks", "NotificationType", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "MibIdentifier", "IpAddress")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
ciscoEntityFruControlCapability = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 7, 264))
ciscoEntityFruControlCapability.setRevisions(('2011-09-25 00:00', '2009-12-14 00:00', '2009-07-30 00:00', '2009-03-25 00:00', '2009-03-11 00:00', '2008-10-28 00:00', '2008-03-24 00:00', '2007-09-06 00:00', '2007-08-31 00:00', '2007-07-19 00:00', '2006-06-21 00:00', '2006-04-19 00:00', '2006-03-16 00:00', '2006-01-31 00:00', '2005-07-12 00:00', '2005-03-09 00:00', '2004-09-15 00:00', '2004-01-15 00:00', '2003-09-15 00:00', '2002-03-20 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoEntityFruControlCapability.setRevisionsDescriptions(('Added capabilities ciscoEfcCapV15R0001SYPCat6K.', 'Added capability ciscoEfcCapV15R01TP39XXE', 'Added capabilities for ciscoEfcCapV12R04TP3925E, and ciscoEfcCapV12R04TP3945E', 'Added capabilities for ciscoEfcCapV12R04TP3845nv, ciscoEfcCapV12R04TP3825nv, ciscoEfcCapV12R04TP1941, ciscoEfcCapV12R04TP29XX, ciscoEfcCapV12R04TP3925 and ciscoEfcCapV12R04TP3945', 'The capability statement ciscoEfcCapIOSXRV3R08CRS1 has been added.', 'Added capabilities ciscoEfcCapV12R0233SXIPCat6K.', 'The capability statement ciscoEfcCapIOSXRV3R06CRS1 has been added.', 'Added capabilities ciscoEfcCapabilityV12R05TP32xx for 3200 platform.', 'Added capabilities ciscoEfcCapV12R0233SXHPCat6K.', 'Added capabilities ciscoEfcCapabilityV05R05PMGX8850 for MGX8850 platform.', '- Added capabilities ciscoEfcCapV12R05TP18xx and ciscoEfcCapV12R05TP2801 for IOS 12.4T on platforms 18xx and 2801.', '- Added Agent capabilities ciscoEfcCapACSWV03R000 for Cisco Application Control Engine (ACE).', '- Add VARIATIONs for notifications cefcModuleStatusChange, cefcPowerStatusChange, cefcFRUInserted and cefcFRURemoved in ciscoEfcCapabilityCatOSV08R0101, ciscoEfcCapabilityCatOSV08R0301 and ciscoEfcCapCatOSV08R0501.', '- Added ciscoEfcCapSanOSV21R1MDS9000 for SAN OS 2.1(1) on MDS 9000 series devices. - Added ciscoEfcCapSanOSV30R1MDS9000 for SAN OS 3.0(1) on MDS 9000 series devices.', '- Added ciscoEfcCapCatOSV08R0501.', '- Added capabilities ciscoEfcCapV12R04TP26XX ciscoEfcCapV12R04TP28XX, ciscoEfcCapV12R04TP3725, ciscoEfcCapV12R04TP3745, ciscoEfcCapV12R04TP3825, ciscoEfcCapV12R04TP3845, ciscoEfcCapV12R04TPIAD243X, ciscoEfcCapV12R04TPVG224 for IOS 12.4T on platforms 26xx, 28xx, 37xx, 38xx, IAD243x, VG224', '- Added ciscoEfcCapabilityV12R03P5XXX for IOS 12.3 on Access Server Platforms (AS5350, AS5400 and AS5850).', '- Added ciscoEfcCapV12RO217bSXACat6K. - Added ciscoEfcCapabilityCatOSV08R0301.', '- Added ciscoEfcCapabilityV12R0119ECat6K for IOS 12.1(19E) on Catalyst 6000/6500 and Cisco 7600 series devices. - Added ciscoEfcCapabilityV12RO217SXCat6K for IOS 12.2(17SX) on Catalyst 6000/6500 and Cisco 7600 series devices. - Added ciscoEfcCapabilityCatOSV08R0101 for Cisco CatOS 8.1(1).', 'Initial version of the MIB Module. - The ciscoEntityFruControlCapabilityV2R00 is for MGX8850 and BPX SES platform. - The ciscoEntityFRUControlCapabilityV12R00SGSR is for GSR platform.',))
if mibBuilder.loadTexts: ciscoEntityFruControlCapability.setLastUpdated('201109250000Z')
if mibBuilder.loadTexts: ciscoEntityFruControlCapability.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoEntityFruControlCapability.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-snmp@cisco.com cs-lan-switch-snmp@cisco.com')
if mibBuilder.loadTexts: ciscoEntityFruControlCapability.setDescription('The Agent Capabilities for CISCO-ENTITY-FRU-CONTROL-MIB.')
ciscoEntityFruControlCapabilityV2R00 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 1))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEntityFruControlCapabilityV2R00 = ciscoEntityFruControlCapabilityV2R00.setProductRelease('MGX8850 Release 2.00,\n BPX SES Release 1.00')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEntityFruControlCapabilityV2R00 = ciscoEntityFruControlCapabilityV2R00.setStatus('current')
if mibBuilder.loadTexts: ciscoEntityFruControlCapabilityV2R00.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB Capabilities')
ciscoEntityFRUControlCapabilityV12R00SGSR = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 2))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEntityFRUControlCapabilityV12R00SGSR = ciscoEntityFRUControlCapabilityV12R00SGSR.setProductRelease('Cisco IOS 12.0S for GSR')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEntityFRUControlCapabilityV12R00SGSR = ciscoEntityFRUControlCapabilityV12R00SGSR.setStatus('current')
if mibBuilder.loadTexts: ciscoEntityFRUControlCapabilityV12R00SGSR.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities for GSR platform.')
ciscoEfcCapabilityV12R0119ECat6K = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 3))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12R0119ECat6K = ciscoEfcCapabilityV12R0119ECat6K.setProductRelease('Cisco IOS 12.1(19E) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12R0119ECat6K = ciscoEfcCapabilityV12R0119ECat6K.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapabilityV12R0119ECat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapabilityV12RO217SXCat6K = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 4))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12RO217SXCat6K = ciscoEfcCapabilityV12RO217SXCat6K.setProductRelease('Cisco IOS 12.2(17SX) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12RO217SXCat6K = ciscoEfcCapabilityV12RO217SXCat6K.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapabilityV12RO217SXCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapabilityCatOSV08R0101 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 5))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityCatOSV08R0101 = ciscoEfcCapabilityCatOSV08R0101.setProductRelease('Cisco CatOS 8.1(1).')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityCatOSV08R0101 = ciscoEfcCapabilityCatOSV08R0101.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapabilityCatOSV08R0101.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapV12RO217bSXACat6K = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 6))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12RO217bSXACat6K = ciscoEfcCapV12RO217bSXACat6K.setProductRelease('Cisco IOS 12.2(17b)SXA on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12RO217bSXACat6K = ciscoEfcCapV12RO217bSXACat6K.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12RO217bSXACat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapabilityCatOSV08R0301 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 7))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityCatOSV08R0301 = ciscoEfcCapabilityCatOSV08R0301.setProductRelease('Cisco CatOS 8.3(1) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityCatOSV08R0301 = ciscoEfcCapabilityCatOSV08R0301.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapabilityCatOSV08R0301.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapabilityV12R03P5XXX = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 8))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12R03P5XXX = ciscoEfcCapabilityV12R03P5XXX.setProductRelease('Cisco IOS 12.3 for Access Server Platforms\n AS5350, AS5400 and AS5850.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12R03P5XXX = ciscoEfcCapabilityV12R03P5XXX.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapabilityV12R03P5XXX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapV12R04TP3725 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 9))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3725 = ciscoEfcCapV12R04TP3725.setProductRelease('Cisco IOS 12.4T for c3725 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3725 = ciscoEfcCapV12R04TP3725.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3725.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapV12R04TP3745 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 10))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3745 = ciscoEfcCapV12R04TP3745.setProductRelease('Cisco IOS 12.4T for c3745 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3745 = ciscoEfcCapV12R04TP3745.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3745.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP26XX = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 11))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP26XX = ciscoEfcCapV12R04TP26XX.setProductRelease('Cisco IOS 12.4T for c26xx XM Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP26XX = ciscoEfcCapV12R04TP26XX.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP26XX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TPIAD243X = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 12))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TPIAD243X = ciscoEfcCapV12R04TPIAD243X.setProductRelease('Cisco IOS 12.4T for IAD 243x Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TPIAD243X = ciscoEfcCapV12R04TPIAD243X.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TPIAD243X.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TPVG224 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 13))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TPVG224 = ciscoEfcCapV12R04TPVG224.setProductRelease('Cisco IOS 12.4T for VG224 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TPVG224 = ciscoEfcCapV12R04TPVG224.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TPVG224.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP2691 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 14))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP2691 = ciscoEfcCapV12R04TP2691.setProductRelease('Cisco IOS 12.4T for c2691 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP2691 = ciscoEfcCapV12R04TP2691.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP2691.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP28XX = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 15))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP28XX = ciscoEfcCapV12R04TP28XX.setProductRelease('Cisco IOS 12.4T for c28xx Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP28XX = ciscoEfcCapV12R04TP28XX.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP28XX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP3825 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 16))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3825 = ciscoEfcCapV12R04TP3825.setProductRelease('Cisco IOS 12.4T for c3825 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3825 = ciscoEfcCapV12R04TP3825.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3825.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP3845 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 17))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3845 = ciscoEfcCapV12R04TP3845.setProductRelease('Cisco IOS 12.4T for c3845 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3845 = ciscoEfcCapV12R04TP3845.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3845.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapCatOSV08R0501 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 18))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapCatOSV08R0501 = ciscoEfcCapCatOSV08R0501.setProductRelease('Cisco CatOS 8.5(1) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapCatOSV08R0501 = ciscoEfcCapCatOSV08R0501.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapCatOSV08R0501.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapSanOSV21R1MDS9000 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 19))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapSanOSV21R1MDS9000 = ciscoEfcCapSanOSV21R1MDS9000.setProductRelease('Cisco SanOS 2.1(1) on Cisco MDS 9000 series\n devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapSanOSV21R1MDS9000 = ciscoEfcCapSanOSV21R1MDS9000.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapSanOSV21R1MDS9000.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapSanOSV30R1MDS9000 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 20))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapSanOSV30R1MDS9000 = ciscoEfcCapSanOSV30R1MDS9000.setProductRelease('Cisco SanOS 3.0(1) on Cisco MDS 9000 series\n devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapSanOSV30R1MDS9000 = ciscoEfcCapSanOSV30R1MDS9000.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapSanOSV30R1MDS9000.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapACSWV03R000 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 21))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapACSWV03R000 = ciscoEfcCapACSWV03R000.setProductRelease('ACSW (Application Control Software) 3.0')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapACSWV03R000 = ciscoEfcCapACSWV03R000.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapACSWV03R000.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapV12R05TP18xx = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 22))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R05TP18xx = ciscoEfcCapV12R05TP18xx.setProductRelease('Cisco IOS 12.5T for c18xx Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R05TP18xx = ciscoEfcCapV12R05TP18xx.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R05TP18xx.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R05TP2801 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 23))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R05TP2801 = ciscoEfcCapV12R05TP2801.setProductRelease('Cisco IOS 12.5T for c2801 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R05TP2801 = ciscoEfcCapV12R05TP2801.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R05TP2801.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapabilityV05R05PMGX8850 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 24))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV05R05PMGX8850 = ciscoEfcCapabilityV05R05PMGX8850.setProductRelease('MGX8850 Release 5.5')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV05R05PMGX8850 = ciscoEfcCapabilityV05R05PMGX8850.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapabilityV05R05PMGX8850.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB Capabilities for the following modules of MGX8850: AXSM-XG, MPSM-T3E3-155, MPSM-16-T1E1, PXM1E, PXM45, VXSM and VISM.')
ciscoEfcCapV12R0233SXHPCat6K = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 25))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R0233SXHPCat6K = ciscoEfcCapV12R0233SXHPCat6K.setProductRelease('Cisco IOS 12.2(33)SXH on Catalyst 6000/6500\n series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R0233SXHPCat6K = ciscoEfcCapV12R0233SXHPCat6K.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R0233SXHPCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapabilityV12R05TP32xx = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 26))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12R05TP32xx = ciscoEfcCapabilityV12R05TP32xx.setProductRelease('Cisco IOS 12.5T for Cisco 3200 series routers')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapabilityV12R05TP32xx = ciscoEfcCapabilityV12R05TP32xx.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapabilityV12R05TP32xx.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities for 3220, 3250 and 3270 routers.')
ciscoEfcCapIOSXRV3R06CRS1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 27))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapIOSXRV3R06CRS1 = ciscoEfcCapIOSXRV3R06CRS1.setProductRelease('Cisco IOS-XR Release 3.6 for CRS-1.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapIOSXRV3R06CRS1 = ciscoEfcCapIOSXRV3R06CRS1.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapIOSXRV3R06CRS1.setDescription('Agent capabilities for IOS-XR Release 3.6 for CRS-1.')
ciscoEfcCapV12R0233SXIPCat6K = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 28))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R0233SXIPCat6K = ciscoEfcCapV12R0233SXIPCat6K.setProductRelease('Cisco IOS 12.2(33)SXI on Catalyst 6000/6500\n series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R0233SXIPCat6K = ciscoEfcCapV12R0233SXIPCat6K.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R0233SXIPCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
ciscoEfcCapIOSXRV3R08CRS1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 29))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapIOSXRV3R08CRS1 = ciscoEfcCapIOSXRV3R08CRS1.setProductRelease('Cisco IOS-XR Release 3.8 for CRS-1.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapIOSXRV3R08CRS1 = ciscoEfcCapIOSXRV3R08CRS1.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapIOSXRV3R08CRS1.setDescription('Agent capabilities for IOS-XR Release 3.8 for CRS-1.')
ciscoEfcCapV12R04TP3845nv = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 30))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3845nv = ciscoEfcCapV12R04TP3845nv.setProductRelease('Cisco IOS 12.4(22)YB1 for c3845nv Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3845nv = ciscoEfcCapV12R04TP3845nv.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3845nv.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP3825nv = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 31))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3825nv = ciscoEfcCapV12R04TP3825nv.setProductRelease('Cisco IOS 12.4(22)YB1 for c3825nv Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3825nv = ciscoEfcCapV12R04TP3825nv.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3825nv.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP1941 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 32))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP1941 = ciscoEfcCapV12R04TP1941.setProductRelease('Cisco IOS 12.4T for c1941 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP1941 = ciscoEfcCapV12R04TP1941.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP1941.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP29XX = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 33))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP29XX = ciscoEfcCapV12R04TP29XX.setProductRelease('Cisco IOS 12.4T for c29xx Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP29XX = ciscoEfcCapV12R04TP29XX.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP29XX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP3925 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 34))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3925 = ciscoEfcCapV12R04TP3925.setProductRelease('Cisco IOS 12.4T for c3925 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3925 = ciscoEfcCapV12R04TP3925.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3925.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV12R04TP3945 = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 35))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3945 = ciscoEfcCapV12R04TP3945.setProductRelease('Cisco IOS 12.4T for c3945 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV12R04TP3945 = ciscoEfcCapV12R04TP3945.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV12R04TP3945.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV15R01TP39XXE = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 36))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV15R01TP39XXE = ciscoEfcCapV15R01TP39XXE.setProductRelease('Cisco IOS 15.1T for c3925SPE200/c3925SPE250\n c3945SPE200/c3945SPE250 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV15R01TP39XXE = ciscoEfcCapV15R01TP39XXE.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV15R01TP39XXE.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
ciscoEfcCapV15R0001SYPCat6K = AgentCapabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 37))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV15R0001SYPCat6K = ciscoEfcCapV15R0001SYPCat6K.setProductRelease('Cisco IOS 15.0(1)SY on Catalyst 6000/6500 \n series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoEfcCapV15R0001SYPCat6K = ciscoEfcCapV15R0001SYPCat6K.setStatus('current')
if mibBuilder.loadTexts: ciscoEfcCapV15R0001SYPCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
mibBuilder.exportSymbols("CISCO-ENTITY-FRU-CONTROL-CAPABILITY", ciscoEfcCapV12R04TP3745=ciscoEfcCapV12R04TP3745, ciscoEfcCapV12R04TP3925=ciscoEfcCapV12R04TP3925, ciscoEfcCapV12RO217bSXACat6K=ciscoEfcCapV12RO217bSXACat6K, ciscoEfcCapV12R04TPIAD243X=ciscoEfcCapV12R04TPIAD243X, ciscoEfcCapV12R05TP2801=ciscoEfcCapV12R05TP2801, ciscoEfcCapIOSXRV3R08CRS1=ciscoEfcCapIOSXRV3R08CRS1, PYSNMP_MODULE_ID=ciscoEntityFruControlCapability, ciscoEfcCapabilityV12R0119ECat6K=ciscoEfcCapabilityV12R0119ECat6K, ciscoEfcCapACSWV03R000=ciscoEfcCapACSWV03R000, ciscoEfcCapV12R04TP2691=ciscoEfcCapV12R04TP2691, ciscoEfcCapV12R04TP1941=ciscoEfcCapV12R04TP1941, ciscoEfcCapV12R04TP28XX=ciscoEfcCapV12R04TP28XX, ciscoEfcCapSanOSV21R1MDS9000=ciscoEfcCapSanOSV21R1MDS9000, ciscoEntityFruControlCapability=ciscoEntityFruControlCapability, ciscoEfcCapV15R0001SYPCat6K=ciscoEfcCapV15R0001SYPCat6K, ciscoEfcCapabilityCatOSV08R0101=ciscoEfcCapabilityCatOSV08R0101, ciscoEfcCapV12R04TPVG224=ciscoEfcCapV12R04TPVG224, ciscoEfcCapV12R04TP3845=ciscoEfcCapV12R04TP3845, ciscoEfcCapCatOSV08R0501=ciscoEfcCapCatOSV08R0501, ciscoEfcCapV12R04TP26XX=ciscoEfcCapV12R04TP26XX, ciscoEfcCapabilityV05R05PMGX8850=ciscoEfcCapabilityV05R05PMGX8850, ciscoEfcCapV12R04TP3725=ciscoEfcCapV12R04TP3725, ciscoEfcCapV12R04TP3825=ciscoEfcCapV12R04TP3825, ciscoEntityFRUControlCapabilityV12R00SGSR=ciscoEntityFRUControlCapabilityV12R00SGSR, ciscoEfcCapSanOSV30R1MDS9000=ciscoEfcCapSanOSV30R1MDS9000, ciscoEfcCapV12R0233SXHPCat6K=ciscoEfcCapV12R0233SXHPCat6K, ciscoEfcCapV15R01TP39XXE=ciscoEfcCapV15R01TP39XXE, ciscoEfcCapIOSXRV3R06CRS1=ciscoEfcCapIOSXRV3R06CRS1, ciscoEfcCapV12R05TP18xx=ciscoEfcCapV12R05TP18xx, ciscoEfcCapabilityV12RO217SXCat6K=ciscoEfcCapabilityV12RO217SXCat6K, ciscoEfcCapV12R04TP29XX=ciscoEfcCapV12R04TP29XX, ciscoEfcCapV12R04TP3945=ciscoEfcCapV12R04TP3945, ciscoEfcCapV12R0233SXIPCat6K=ciscoEfcCapV12R0233SXIPCat6K, ciscoEfcCapabilityV12R05TP32xx=ciscoEfcCapabilityV12R05TP32xx, ciscoEfcCapV12R04TP3825nv=ciscoEfcCapV12R04TP3825nv, ciscoEntityFruControlCapabilityV2R00=ciscoEntityFruControlCapabilityV2R00, ciscoEfcCapabilityV12R03P5XXX=ciscoEfcCapabilityV12R03P5XXX, ciscoEfcCapabilityCatOSV08R0301=ciscoEfcCapabilityCatOSV08R0301, ciscoEfcCapV12R04TP3845nv=ciscoEfcCapV12R04TP3845nv)
|
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, single_value_constraint, value_range_constraint, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection')
(cisco_agent_capability,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoAgentCapability')
(agent_capabilities, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'AgentCapabilities', 'ModuleCompliance', 'NotificationGroup')
(integer32, iso, unsigned32, bits, object_identity, gauge32, module_identity, time_ticks, notification_type, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, mib_identifier, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'iso', 'Unsigned32', 'Bits', 'ObjectIdentity', 'Gauge32', 'ModuleIdentity', 'TimeTicks', 'NotificationType', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'MibIdentifier', 'IpAddress')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
cisco_entity_fru_control_capability = module_identity((1, 3, 6, 1, 4, 1, 9, 7, 264))
ciscoEntityFruControlCapability.setRevisions(('2011-09-25 00:00', '2009-12-14 00:00', '2009-07-30 00:00', '2009-03-25 00:00', '2009-03-11 00:00', '2008-10-28 00:00', '2008-03-24 00:00', '2007-09-06 00:00', '2007-08-31 00:00', '2007-07-19 00:00', '2006-06-21 00:00', '2006-04-19 00:00', '2006-03-16 00:00', '2006-01-31 00:00', '2005-07-12 00:00', '2005-03-09 00:00', '2004-09-15 00:00', '2004-01-15 00:00', '2003-09-15 00:00', '2002-03-20 00:00'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
ciscoEntityFruControlCapability.setRevisionsDescriptions(('Added capabilities ciscoEfcCapV15R0001SYPCat6K.', 'Added capability ciscoEfcCapV15R01TP39XXE', 'Added capabilities for ciscoEfcCapV12R04TP3925E, and ciscoEfcCapV12R04TP3945E', 'Added capabilities for ciscoEfcCapV12R04TP3845nv, ciscoEfcCapV12R04TP3825nv, ciscoEfcCapV12R04TP1941, ciscoEfcCapV12R04TP29XX, ciscoEfcCapV12R04TP3925 and ciscoEfcCapV12R04TP3945', 'The capability statement ciscoEfcCapIOSXRV3R08CRS1 has been added.', 'Added capabilities ciscoEfcCapV12R0233SXIPCat6K.', 'The capability statement ciscoEfcCapIOSXRV3R06CRS1 has been added.', 'Added capabilities ciscoEfcCapabilityV12R05TP32xx for 3200 platform.', 'Added capabilities ciscoEfcCapV12R0233SXHPCat6K.', 'Added capabilities ciscoEfcCapabilityV05R05PMGX8850 for MGX8850 platform.', '- Added capabilities ciscoEfcCapV12R05TP18xx and ciscoEfcCapV12R05TP2801 for IOS 12.4T on platforms 18xx and 2801.', '- Added Agent capabilities ciscoEfcCapACSWV03R000 for Cisco Application Control Engine (ACE).', '- Add VARIATIONs for notifications cefcModuleStatusChange, cefcPowerStatusChange, cefcFRUInserted and cefcFRURemoved in ciscoEfcCapabilityCatOSV08R0101, ciscoEfcCapabilityCatOSV08R0301 and ciscoEfcCapCatOSV08R0501.', '- Added ciscoEfcCapSanOSV21R1MDS9000 for SAN OS 2.1(1) on MDS 9000 series devices. - Added ciscoEfcCapSanOSV30R1MDS9000 for SAN OS 3.0(1) on MDS 9000 series devices.', '- Added ciscoEfcCapCatOSV08R0501.', '- Added capabilities ciscoEfcCapV12R04TP26XX ciscoEfcCapV12R04TP28XX, ciscoEfcCapV12R04TP3725, ciscoEfcCapV12R04TP3745, ciscoEfcCapV12R04TP3825, ciscoEfcCapV12R04TP3845, ciscoEfcCapV12R04TPIAD243X, ciscoEfcCapV12R04TPVG224 for IOS 12.4T on platforms 26xx, 28xx, 37xx, 38xx, IAD243x, VG224', '- Added ciscoEfcCapabilityV12R03P5XXX for IOS 12.3 on Access Server Platforms (AS5350, AS5400 and AS5850).', '- Added ciscoEfcCapV12RO217bSXACat6K. - Added ciscoEfcCapabilityCatOSV08R0301.', '- Added ciscoEfcCapabilityV12R0119ECat6K for IOS 12.1(19E) on Catalyst 6000/6500 and Cisco 7600 series devices. - Added ciscoEfcCapabilityV12RO217SXCat6K for IOS 12.2(17SX) on Catalyst 6000/6500 and Cisco 7600 series devices. - Added ciscoEfcCapabilityCatOSV08R0101 for Cisco CatOS 8.1(1).', 'Initial version of the MIB Module. - The ciscoEntityFruControlCapabilityV2R00 is for MGX8850 and BPX SES platform. - The ciscoEntityFRUControlCapabilityV12R00SGSR is for GSR platform.'))
if mibBuilder.loadTexts:
ciscoEntityFruControlCapability.setLastUpdated('201109250000Z')
if mibBuilder.loadTexts:
ciscoEntityFruControlCapability.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts:
ciscoEntityFruControlCapability.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-snmp@cisco.com cs-lan-switch-snmp@cisco.com')
if mibBuilder.loadTexts:
ciscoEntityFruControlCapability.setDescription('The Agent Capabilities for CISCO-ENTITY-FRU-CONTROL-MIB.')
cisco_entity_fru_control_capability_v2_r00 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 1))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_entity_fru_control_capability_v2_r00 = ciscoEntityFruControlCapabilityV2R00.setProductRelease('MGX8850 Release 2.00,\n BPX SES Release 1.00')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_entity_fru_control_capability_v2_r00 = ciscoEntityFruControlCapabilityV2R00.setStatus('current')
if mibBuilder.loadTexts:
ciscoEntityFruControlCapabilityV2R00.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB Capabilities')
cisco_entity_fru_control_capability_v12_r00_sgsr = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 2))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_entity_fru_control_capability_v12_r00_sgsr = ciscoEntityFRUControlCapabilityV12R00SGSR.setProductRelease('Cisco IOS 12.0S for GSR')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_entity_fru_control_capability_v12_r00_sgsr = ciscoEntityFRUControlCapabilityV12R00SGSR.setStatus('current')
if mibBuilder.loadTexts:
ciscoEntityFRUControlCapabilityV12R00SGSR.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities for GSR platform.')
cisco_efc_capability_v12_r0119_e_cat6_k = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 3))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_r0119_e_cat6_k = ciscoEfcCapabilityV12R0119ECat6K.setProductRelease('Cisco IOS 12.1(19E) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_r0119_e_cat6_k = ciscoEfcCapabilityV12R0119ECat6K.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapabilityV12R0119ECat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_capability_v12_ro217_sx_cat6_k = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 4))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_ro217_sx_cat6_k = ciscoEfcCapabilityV12RO217SXCat6K.setProductRelease('Cisco IOS 12.2(17SX) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_ro217_sx_cat6_k = ciscoEfcCapabilityV12RO217SXCat6K.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapabilityV12RO217SXCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_capability_cat_osv08_r0101 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 5))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_cat_osv08_r0101 = ciscoEfcCapabilityCatOSV08R0101.setProductRelease('Cisco CatOS 8.1(1).')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_cat_osv08_r0101 = ciscoEfcCapabilityCatOSV08R0101.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapabilityCatOSV08R0101.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_v12_ro217b_sxa_cat6_k = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 6))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_ro217b_sxa_cat6_k = ciscoEfcCapV12RO217bSXACat6K.setProductRelease('Cisco IOS 12.2(17b)SXA on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_ro217b_sxa_cat6_k = ciscoEfcCapV12RO217bSXACat6K.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12RO217bSXACat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_capability_cat_osv08_r0301 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 7))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_cat_osv08_r0301 = ciscoEfcCapabilityCatOSV08R0301.setProductRelease('Cisco CatOS 8.3(1) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_cat_osv08_r0301 = ciscoEfcCapabilityCatOSV08R0301.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapabilityCatOSV08R0301.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_capability_v12_r03_p5_xxx = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 8))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_r03_p5_xxx = ciscoEfcCapabilityV12R03P5XXX.setProductRelease('Cisco IOS 12.3 for Access Server Platforms\n AS5350, AS5400 and AS5850.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_r03_p5_xxx = ciscoEfcCapabilityV12R03P5XXX.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapabilityV12R03P5XXX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_v12_r04_tp3725 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 9))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3725 = ciscoEfcCapV12R04TP3725.setProductRelease('Cisco IOS 12.4T for c3725 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3725 = ciscoEfcCapV12R04TP3725.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3725.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_v12_r04_tp3745 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 10))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3745 = ciscoEfcCapV12R04TP3745.setProductRelease('Cisco IOS 12.4T for c3745 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3745 = ciscoEfcCapV12R04TP3745.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3745.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp26_xx = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 11))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp26_xx = ciscoEfcCapV12R04TP26XX.setProductRelease('Cisco IOS 12.4T for c26xx XM Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp26_xx = ciscoEfcCapV12R04TP26XX.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP26XX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tpiad243_x = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 12))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tpiad243_x = ciscoEfcCapV12R04TPIAD243X.setProductRelease('Cisco IOS 12.4T for IAD 243x Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tpiad243_x = ciscoEfcCapV12R04TPIAD243X.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TPIAD243X.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tpvg224 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 13))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tpvg224 = ciscoEfcCapV12R04TPVG224.setProductRelease('Cisco IOS 12.4T for VG224 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tpvg224 = ciscoEfcCapV12R04TPVG224.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TPVG224.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp2691 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 14))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp2691 = ciscoEfcCapV12R04TP2691.setProductRelease('Cisco IOS 12.4T for c2691 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp2691 = ciscoEfcCapV12R04TP2691.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP2691.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp28_xx = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 15))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp28_xx = ciscoEfcCapV12R04TP28XX.setProductRelease('Cisco IOS 12.4T for c28xx Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp28_xx = ciscoEfcCapV12R04TP28XX.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP28XX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp3825 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 16))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3825 = ciscoEfcCapV12R04TP3825.setProductRelease('Cisco IOS 12.4T for c3825 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3825 = ciscoEfcCapV12R04TP3825.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3825.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp3845 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 17))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3845 = ciscoEfcCapV12R04TP3845.setProductRelease('Cisco IOS 12.4T for c3845 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3845 = ciscoEfcCapV12R04TP3845.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3845.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_cat_osv08_r0501 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 18))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_cat_osv08_r0501 = ciscoEfcCapCatOSV08R0501.setProductRelease('Cisco CatOS 8.5(1) on Catalyst 6000/6500\n and Cisco 7600 series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_cat_osv08_r0501 = ciscoEfcCapCatOSV08R0501.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapCatOSV08R0501.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_san_osv21_r1_mds9000 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 19))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_san_osv21_r1_mds9000 = ciscoEfcCapSanOSV21R1MDS9000.setProductRelease('Cisco SanOS 2.1(1) on Cisco MDS 9000 series\n devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_san_osv21_r1_mds9000 = ciscoEfcCapSanOSV21R1MDS9000.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapSanOSV21R1MDS9000.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_san_osv30_r1_mds9000 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 20))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_san_osv30_r1_mds9000 = ciscoEfcCapSanOSV30R1MDS9000.setProductRelease('Cisco SanOS 3.0(1) on Cisco MDS 9000 series\n devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_san_osv30_r1_mds9000 = ciscoEfcCapSanOSV30R1MDS9000.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapSanOSV30R1MDS9000.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_acswv03_r000 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 21))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_acswv03_r000 = ciscoEfcCapACSWV03R000.setProductRelease('ACSW (Application Control Software) 3.0')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_acswv03_r000 = ciscoEfcCapACSWV03R000.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapACSWV03R000.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_v12_r05_tp18xx = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 22))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r05_tp18xx = ciscoEfcCapV12R05TP18xx.setProductRelease('Cisco IOS 12.5T for c18xx Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r05_tp18xx = ciscoEfcCapV12R05TP18xx.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R05TP18xx.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r05_tp2801 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 23))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r05_tp2801 = ciscoEfcCapV12R05TP2801.setProductRelease('Cisco IOS 12.5T for c2801 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r05_tp2801 = ciscoEfcCapV12R05TP2801.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R05TP2801.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_capability_v05_r05_pmgx8850 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 24))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v05_r05_pmgx8850 = ciscoEfcCapabilityV05R05PMGX8850.setProductRelease('MGX8850 Release 5.5')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v05_r05_pmgx8850 = ciscoEfcCapabilityV05R05PMGX8850.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapabilityV05R05PMGX8850.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB Capabilities for the following modules of MGX8850: AXSM-XG, MPSM-T3E3-155, MPSM-16-T1E1, PXM1E, PXM45, VXSM and VISM.')
cisco_efc_cap_v12_r0233_sxhp_cat6_k = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 25))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r0233_sxhp_cat6_k = ciscoEfcCapV12R0233SXHPCat6K.setProductRelease('Cisco IOS 12.2(33)SXH on Catalyst 6000/6500\n series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r0233_sxhp_cat6_k = ciscoEfcCapV12R0233SXHPCat6K.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R0233SXHPCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_capability_v12_r05_tp32xx = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 26))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_r05_tp32xx = ciscoEfcCapabilityV12R05TP32xx.setProductRelease('Cisco IOS 12.5T for Cisco 3200 series routers')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_capability_v12_r05_tp32xx = ciscoEfcCapabilityV12R05TP32xx.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapabilityV12R05TP32xx.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities for 3220, 3250 and 3270 routers.')
cisco_efc_cap_iosxrv3_r06_crs1 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 27))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_iosxrv3_r06_crs1 = ciscoEfcCapIOSXRV3R06CRS1.setProductRelease('Cisco IOS-XR Release 3.6 for CRS-1.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_iosxrv3_r06_crs1 = ciscoEfcCapIOSXRV3R06CRS1.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapIOSXRV3R06CRS1.setDescription('Agent capabilities for IOS-XR Release 3.6 for CRS-1.')
cisco_efc_cap_v12_r0233_sxip_cat6_k = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 28))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r0233_sxip_cat6_k = ciscoEfcCapV12R0233SXIPCat6K.setProductRelease('Cisco IOS 12.2(33)SXI on Catalyst 6000/6500\n series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r0233_sxip_cat6_k = ciscoEfcCapV12R0233SXIPCat6K.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R0233SXIPCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
cisco_efc_cap_iosxrv3_r08_crs1 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 29))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_iosxrv3_r08_crs1 = ciscoEfcCapIOSXRV3R08CRS1.setProductRelease('Cisco IOS-XR Release 3.8 for CRS-1.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_iosxrv3_r08_crs1 = ciscoEfcCapIOSXRV3R08CRS1.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapIOSXRV3R08CRS1.setDescription('Agent capabilities for IOS-XR Release 3.8 for CRS-1.')
cisco_efc_cap_v12_r04_tp3845nv = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 30))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3845nv = ciscoEfcCapV12R04TP3845nv.setProductRelease('Cisco IOS 12.4(22)YB1 for c3845nv Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3845nv = ciscoEfcCapV12R04TP3845nv.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3845nv.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp3825nv = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 31))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3825nv = ciscoEfcCapV12R04TP3825nv.setProductRelease('Cisco IOS 12.4(22)YB1 for c3825nv Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3825nv = ciscoEfcCapV12R04TP3825nv.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3825nv.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp1941 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 32))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp1941 = ciscoEfcCapV12R04TP1941.setProductRelease('Cisco IOS 12.4T for c1941 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp1941 = ciscoEfcCapV12R04TP1941.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP1941.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp29_xx = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 33))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp29_xx = ciscoEfcCapV12R04TP29XX.setProductRelease('Cisco IOS 12.4T for c29xx Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp29_xx = ciscoEfcCapV12R04TP29XX.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP29XX.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp3925 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 34))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3925 = ciscoEfcCapV12R04TP3925.setProductRelease('Cisco IOS 12.4T for c3925 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3925 = ciscoEfcCapV12R04TP3925.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3925.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v12_r04_tp3945 = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 35))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3945 = ciscoEfcCapV12R04TP3945.setProductRelease('Cisco IOS 12.4T for c3945 Platform')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v12_r04_tp3945 = ciscoEfcCapV12R04TP3945.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV12R04TP3945.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v15_r01_tp39_xxe = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 36))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v15_r01_tp39_xxe = ciscoEfcCapV15R01TP39XXE.setProductRelease('Cisco IOS 15.1T for c3925SPE200/c3925SPE250\n c3945SPE200/c3945SPE250 Platforms')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v15_r01_tp39_xxe = ciscoEfcCapV15R01TP39XXE.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV15R01TP39XXE.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities')
cisco_efc_cap_v15_r0001_syp_cat6_k = agent_capabilities((1, 3, 6, 1, 4, 1, 9, 7, 264, 37))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v15_r0001_syp_cat6_k = ciscoEfcCapV15R0001SYPCat6K.setProductRelease('Cisco IOS 15.0(1)SY on Catalyst 6000/6500 \n series devices.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_efc_cap_v15_r0001_syp_cat6_k = ciscoEfcCapV15R0001SYPCat6K.setStatus('current')
if mibBuilder.loadTexts:
ciscoEfcCapV15R0001SYPCat6K.setDescription('CISCO-ENTITY-FRU-CONTROL-MIB capabilities.')
mibBuilder.exportSymbols('CISCO-ENTITY-FRU-CONTROL-CAPABILITY', ciscoEfcCapV12R04TP3745=ciscoEfcCapV12R04TP3745, ciscoEfcCapV12R04TP3925=ciscoEfcCapV12R04TP3925, ciscoEfcCapV12RO217bSXACat6K=ciscoEfcCapV12RO217bSXACat6K, ciscoEfcCapV12R04TPIAD243X=ciscoEfcCapV12R04TPIAD243X, ciscoEfcCapV12R05TP2801=ciscoEfcCapV12R05TP2801, ciscoEfcCapIOSXRV3R08CRS1=ciscoEfcCapIOSXRV3R08CRS1, PYSNMP_MODULE_ID=ciscoEntityFruControlCapability, ciscoEfcCapabilityV12R0119ECat6K=ciscoEfcCapabilityV12R0119ECat6K, ciscoEfcCapACSWV03R000=ciscoEfcCapACSWV03R000, ciscoEfcCapV12R04TP2691=ciscoEfcCapV12R04TP2691, ciscoEfcCapV12R04TP1941=ciscoEfcCapV12R04TP1941, ciscoEfcCapV12R04TP28XX=ciscoEfcCapV12R04TP28XX, ciscoEfcCapSanOSV21R1MDS9000=ciscoEfcCapSanOSV21R1MDS9000, ciscoEntityFruControlCapability=ciscoEntityFruControlCapability, ciscoEfcCapV15R0001SYPCat6K=ciscoEfcCapV15R0001SYPCat6K, ciscoEfcCapabilityCatOSV08R0101=ciscoEfcCapabilityCatOSV08R0101, ciscoEfcCapV12R04TPVG224=ciscoEfcCapV12R04TPVG224, ciscoEfcCapV12R04TP3845=ciscoEfcCapV12R04TP3845, ciscoEfcCapCatOSV08R0501=ciscoEfcCapCatOSV08R0501, ciscoEfcCapV12R04TP26XX=ciscoEfcCapV12R04TP26XX, ciscoEfcCapabilityV05R05PMGX8850=ciscoEfcCapabilityV05R05PMGX8850, ciscoEfcCapV12R04TP3725=ciscoEfcCapV12R04TP3725, ciscoEfcCapV12R04TP3825=ciscoEfcCapV12R04TP3825, ciscoEntityFRUControlCapabilityV12R00SGSR=ciscoEntityFRUControlCapabilityV12R00SGSR, ciscoEfcCapSanOSV30R1MDS9000=ciscoEfcCapSanOSV30R1MDS9000, ciscoEfcCapV12R0233SXHPCat6K=ciscoEfcCapV12R0233SXHPCat6K, ciscoEfcCapV15R01TP39XXE=ciscoEfcCapV15R01TP39XXE, ciscoEfcCapIOSXRV3R06CRS1=ciscoEfcCapIOSXRV3R06CRS1, ciscoEfcCapV12R05TP18xx=ciscoEfcCapV12R05TP18xx, ciscoEfcCapabilityV12RO217SXCat6K=ciscoEfcCapabilityV12RO217SXCat6K, ciscoEfcCapV12R04TP29XX=ciscoEfcCapV12R04TP29XX, ciscoEfcCapV12R04TP3945=ciscoEfcCapV12R04TP3945, ciscoEfcCapV12R0233SXIPCat6K=ciscoEfcCapV12R0233SXIPCat6K, ciscoEfcCapabilityV12R05TP32xx=ciscoEfcCapabilityV12R05TP32xx, ciscoEfcCapV12R04TP3825nv=ciscoEfcCapV12R04TP3825nv, ciscoEntityFruControlCapabilityV2R00=ciscoEntityFruControlCapabilityV2R00, ciscoEfcCapabilityV12R03P5XXX=ciscoEfcCapabilityV12R03P5XXX, ciscoEfcCapabilityCatOSV08R0301=ciscoEfcCapabilityCatOSV08R0301, ciscoEfcCapV12R04TP3845nv=ciscoEfcCapV12R04TP3845nv)
|
"""
Eventually we'll probably want to add some decent serialization support.
For now - this is a pass through. Patches accepted :)
"""
class Serializer(object):
def serialize(cls, obj):
return obj
def is_valid(self):
return True
|
"""
Eventually we'll probably want to add some decent serialization support.
For now - this is a pass through. Patches accepted :)
"""
class Serializer(object):
def serialize(cls, obj):
return obj
def is_valid(self):
return True
|
name = "openimageio"
version = "2.0.0"
authors = [
"Larry Gritz"
]
description = \
"""
OpenImageIO is a library for reading and writing images, and a bunch of
related classes, utilities, and applications.
"""
private_build_requires = [
'cmake-3.2.2+',
"boost-1.55",
"gcc-4.8.2+",
"opencolorio-1.0.9",
"ilmbase-2.2",
'openexr-2.2',
'ptex'
]
requires = [
'qt-4.8+<5',
'python-2.7'
]
variants = [
["platform-linux", "arch-x86_64", "os-CentOS-7", "python-2.7"]
]
tools = [
"iconvert",
"idiff",
"igrep",
"iinfo",
"maketx",
"oiiotool"
]
uuid = "openimageio"
def commands():
env.PATH.append("{root}/bin")
env.LD_LIBRARY_PATH.append("{root}/lib")
env.PYTHONPATH.append("{root}/lib/python/site-packages")
if building:
env.CPATH.append('{root}/include')
env.LIBRARY_PATH.append('{root}/lib')
|
name = 'openimageio'
version = '2.0.0'
authors = ['Larry Gritz']
description = '\n OpenImageIO is a library for reading and writing images, and a bunch of\n related classes, utilities, and applications.\n '
private_build_requires = ['cmake-3.2.2+', 'boost-1.55', 'gcc-4.8.2+', 'opencolorio-1.0.9', 'ilmbase-2.2', 'openexr-2.2', 'ptex']
requires = ['qt-4.8+<5', 'python-2.7']
variants = [['platform-linux', 'arch-x86_64', 'os-CentOS-7', 'python-2.7']]
tools = ['iconvert', 'idiff', 'igrep', 'iinfo', 'maketx', 'oiiotool']
uuid = 'openimageio'
def commands():
env.PATH.append('{root}/bin')
env.LD_LIBRARY_PATH.append('{root}/lib')
env.PYTHONPATH.append('{root}/lib/python/site-packages')
if building:
env.CPATH.append('{root}/include')
env.LIBRARY_PATH.append('{root}/lib')
|
"""
57 / 57 test cases passed.
Runtime: 104 ms
Memory Usage: 14.9 MB
"""
class Solution:
def largestTriangleArea(self, points: List[List[int]]) -> float:
def triangleArea(x1, y1, x2, y2, x3, y3):
return abs(x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2) / 2
return max(triangleArea(x1, y1, x2, y2, x3, y3) for (x1, y1), (x2, y2), (x3, y3) in combinations(points, 3))
|
"""
57 / 57 test cases passed.
Runtime: 104 ms
Memory Usage: 14.9 MB
"""
class Solution:
def largest_triangle_area(self, points: List[List[int]]) -> float:
def triangle_area(x1, y1, x2, y2, x3, y3):
return abs(x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2) / 2
return max((triangle_area(x1, y1, x2, y2, x3, y3) for ((x1, y1), (x2, y2), (x3, y3)) in combinations(points, 3)))
|
class User:
user_list = []
def __init__(self,f_name,l_name,password):
"""function that creates user object"""
self.f_name = f_name
self.l_name = l_name
self.password = password
def save_user(self):
"""function that saves users"""
User.user_list.append(self)
def delete_user(self):
"""function that deletes users"""
User.user_list.remove(self)
@classmethod
def display_user(self):
"""function that displays users"""
return User.user_list
@classmethod
def find_user_by_name(cls,name):
"""function that finds users by name"""
for user in cls.user_list:
if user.f_name == name:
return user
@classmethod
def user_exist(cls,f_name):
"""function that checks if users exists"""
for user in cls.user_list:
if user.f_name == f_name:
return True
return False
class Credentials:
def __init__ (self,user_name, credential_name , credential__password):
"""function that creates credentials"""
self.user_name = user_name
self.credential_name =credential_name
self.credential_password =credential__password
list_of_credentials = []
def save_credentials(self):
"""function that saves credentials"""
self.list_of_credentials.append(self)
def delete_credentials(self):
"""function that deletes credentials"""
Credentials.list_of_credentials.remove(self)
@classmethod
def find_by_name(cls, user_name):
"""Method that takes in a name and returns a credential that matches that particular name
Args:
name: account_name that has a password
Returns:
The account_name and it's corresponding PassWord
"""
for credential in cls.list_of_credentials:
if credential.user_name == user_name:
return credential
@classmethod
def credential_exists(cls,name):
"""function that checks if credentials exists"""
for credential in cls.list_of_credentials:
if credential.user_name == name:
return True
@classmethod
def display_all_credentials(cls):
"""function that displays Credentials"""
return cls.list_of_credentials
|
class User:
user_list = []
def __init__(self, f_name, l_name, password):
"""function that creates user object"""
self.f_name = f_name
self.l_name = l_name
self.password = password
def save_user(self):
"""function that saves users"""
User.user_list.append(self)
def delete_user(self):
"""function that deletes users"""
User.user_list.remove(self)
@classmethod
def display_user(self):
"""function that displays users"""
return User.user_list
@classmethod
def find_user_by_name(cls, name):
"""function that finds users by name"""
for user in cls.user_list:
if user.f_name == name:
return user
@classmethod
def user_exist(cls, f_name):
"""function that checks if users exists"""
for user in cls.user_list:
if user.f_name == f_name:
return True
return False
class Credentials:
def __init__(self, user_name, credential_name, credential__password):
"""function that creates credentials"""
self.user_name = user_name
self.credential_name = credential_name
self.credential_password = credential__password
list_of_credentials = []
def save_credentials(self):
"""function that saves credentials"""
self.list_of_credentials.append(self)
def delete_credentials(self):
"""function that deletes credentials"""
Credentials.list_of_credentials.remove(self)
@classmethod
def find_by_name(cls, user_name):
"""Method that takes in a name and returns a credential that matches that particular name
Args:
name: account_name that has a password
Returns:
The account_name and it's corresponding PassWord
"""
for credential in cls.list_of_credentials:
if credential.user_name == user_name:
return credential
@classmethod
def credential_exists(cls, name):
"""function that checks if credentials exists"""
for credential in cls.list_of_credentials:
if credential.user_name == name:
return True
@classmethod
def display_all_credentials(cls):
"""function that displays Credentials"""
return cls.list_of_credentials
|
# validated: 2018-01-14 DV a68a0c3ebf0b libraries/driver/include/ctre/phoenix/MotorControl/Faults.h
__all__ = ['FaultsBase']
class FaultsBase:
fields = []
def __init__(self, bits = 0):
mask = 1
for field in self.fields:
setattr(self, field, bool(bits & mask))
mask <<= 1
def toBitfield(self):
retval = 0
mask = 1
for field in self.fields:
if getattr(self, field):
retval |= mask
mask <<= 1
return retval
def hasAnyFault(self):
return any([getattr(self, field) for field in self.fields])
def __str__(self):
return " ".join(["%s:%s" % (field, int(getattr(self,field))) for field in self.fields])
|
__all__ = ['FaultsBase']
class Faultsbase:
fields = []
def __init__(self, bits=0):
mask = 1
for field in self.fields:
setattr(self, field, bool(bits & mask))
mask <<= 1
def to_bitfield(self):
retval = 0
mask = 1
for field in self.fields:
if getattr(self, field):
retval |= mask
mask <<= 1
return retval
def has_any_fault(self):
return any([getattr(self, field) for field in self.fields])
def __str__(self):
return ' '.join(['%s:%s' % (field, int(getattr(self, field))) for field in self.fields])
|
# Databricks notebook source
HLRIOWYITKFDP
GOQFOEKSZNF
BQRYZYCEYRHRVDKCQSN
BELVHHTEWWKFYTNTWJIIYUQTBHUMOCJNDBBIPBOVCDIKTUPVXZRIUC
AUVGECGGHDZPJPMFEZWDFYYDXYGEMHXRHYXXGEMXTCZOPGPGSRCIQNPHCUONPPCBOWTFOZEYCXCQKKUNDSXSBAKSMWIPUKICUWX
HDCWKJXOZHPPXWBBPLIGLXMBATYPTDTCAACKEEWURDREVIIUPRJXDFNDLSHBZEBMWQOMYFWARMGERQAXVLFREGTYUXPABORSDUP
XPSNALKIEEH
TNRJVKVUADXUMYRVMHWANRYEQXHWTJQWRWKSYUM
JZXPNGKLOBUHKSQBTCTPEDKMXFIBBGGHRJQHBBORPGAUUQJRVXCIPMMFYYLRYN
KGQOIYGOLOQKPGZJQOZBYIDIZHPVDGNQIBWMZKLFVEICEQCZJBCOJNRCFYZBKW
XUCXWMRZSJZGGPFDQVRHQYDXFQAKRUAMZMPYIXPFUWMHCMC
HXYLXLGHGJHSABRRKKPNEFJQTIUKHUWMRZSWZBPACLASFINSC
# COMMAND ----------
MGRAAFOYIJMFRVFOSRGMGFXXEKYADNRPHTYWJOWZMVBJ
PWDILGWYEWDFNEZFZBSMBFRSQHNLFXXJUYMSTDBXBZOLDBSROW
VJZKPBXNXVNNTANWQWAUITCXBBBVPROZOINGKOJBTSWCDOPYBLDTEKAQGMWCUARJGWQY
ZPFVDMMLPYPQAMSJLQQWEDSYPZHXSYKENJIJMLMRAAFISKLL
ROYFOFXVCMBAZZIRVCWXHAWKILJJYAWWISQPHOVCWIGSYJ
# COMMAND ----------
YEGVKOKXNRAKWSMIJGQICYIXPZDXALZLGNOTGYHVESTP
# COMMAND ----------
EUIJSXZYUPDQQFSWCACJADRNZGSJIYRAJ
# COMMAND ----------
UGFQNBEQJETM
PUPRVDQIOHSKMQPCGUNVESHCJHXEIFWUQSSWSEQKNNTNTRKRZMGONRPFCVLHTPHBXYLRHZFAIGHWOLLWFDZNMEUGIWAKGTAVBKZFUAQLEGNUKNDZBMSOQSLCDALHWSQO
IPFRYPASTQSOMGKIAEUMKUMOCUVDHIVXZUOXHYOUQNZOLJSMRJDCMJTPLRHWDOKLBBXNBCTLUSFYRRHZDCASUGABWYSQ
UQAVLZHFFQGREDQGYLLDKMRWGIKJHXTGBIAVZDZSXLFBNERWVEKHOMZAGGXWWNAGGYGIESTGFCNWGZKXZWICBDCWXYQDABJSDCOEN
QWQQEHTLBUKHKBMGSNSJIAIMEXKQBVECIGTODUHRROXAIMVKIQXBBFICPJAVMYVPZVBLSMDBYTFHNAMXNITSIMHFQNBIPYAOLR
GHUYEXMAQAHQFFYPWBUBRHJVKXAFDGVHXBYXPZLLTKQHWXIHIDAPURJUFJRDIIDEMMXOZSSWHLGQRTRFWHJMMDZECZRBCF
G
# COMMAND ----------
HLYXINLAZVEFIXCTTQNFUVRS
# COMMAND ----------
TTXHRRLOCWDLVNKZRCVYWBLCAOTMQCDWHXEUCNSBCOKEM
UYQEGQGRHRAEDNYXMPSRZETETIVYAN
RSINMZPJMBPZSJMEAEZLKHAKSHDWUFVBFAXM
UIDJIHTYSNFGCQEHGBAETBNXDTHDOQXKNHCBPT
KRUNMFOIWPIPZUMRGXYSXJPRPRQBXANWXYYZZVN
# COMMAND ----------
KXOYFKLPJZVZENIQOONHWZLDRJ
# COMMAND ----------
HNJKYFTKQDDCVXTULFGJJLCSTC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RLGCUPKSXQLNRWJPRBRII
ASQHRUROYUSINQWRBDTXJUSOKOBZACFFAWDWEREVAUCLILARUWYHKULERWCTZAUJFQ
FWHFQOMZGEMRZZSCJAZJPTICZZUVORFEERPPQMBACIGCOMTRIWRIEKXVHBFBVDKZTINQNZAJKLBWVJMWO
LRDLGVNCRARLYWVJUQJVOFVESVFVDSP
ELJBIAZHUEZBFFJCEIUZEDYVVGUCSXSTDTSPUCWQHAYKOWBDKDKNXMTNACFLYZGKXBCUAQHKNXNJQZANGZUXRFPZVJZC
JVEUTEBRDFTQAOGHHARDX
OFNHZGSVOQPLGCMIVZKODBVBLQRZK
|
"""!
@brief Colors used by pyclustering library for visualization.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
class color:
"""!
@brief Consists titles of colors that are used by pyclustering for visualization.
"""
@staticmethod
def get_color(sequential_index):
"""!
@brief Returns color using round robin to avoid out of range exception.
@param[in] sequential_index (uint): Index that should be converted to valid color index.
@return (uint) Color from list color.TITLES.
"""
return color.TITLES[sequential_index % len(color.TITLES)]
## List of color titles that are used by pyclustering for visualization.
TITLES = [ 'red', 'blue', 'darkgreen', 'gold', 'violet',
'deepskyblue', 'darkgrey', 'lightsalmon', 'deeppink', 'yellow',
'black', 'mediumspringgreen', 'orange', 'darkviolet', 'darkblue',
'silver', 'lime', 'pink', 'brown', 'bisque',
'dimgray', 'firebrick', 'darksalmon', 'chartreuse', 'skyblue',
'purple', 'fuchsia', 'palegoldenrod', 'coral', 'hotpink',
'gray', 'tan', 'crimson', 'teal', 'olive']
|
"""!
@brief Colors used by pyclustering library for visualization.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
class Color:
"""!
@brief Consists titles of colors that are used by pyclustering for visualization.
"""
@staticmethod
def get_color(sequential_index):
"""!
@brief Returns color using round robin to avoid out of range exception.
@param[in] sequential_index (uint): Index that should be converted to valid color index.
@return (uint) Color from list color.TITLES.
"""
return color.TITLES[sequential_index % len(color.TITLES)]
titles = ['red', 'blue', 'darkgreen', 'gold', 'violet', 'deepskyblue', 'darkgrey', 'lightsalmon', 'deeppink', 'yellow', 'black', 'mediumspringgreen', 'orange', 'darkviolet', 'darkblue', 'silver', 'lime', 'pink', 'brown', 'bisque', 'dimgray', 'firebrick', 'darksalmon', 'chartreuse', 'skyblue', 'purple', 'fuchsia', 'palegoldenrod', 'coral', 'hotpink', 'gray', 'tan', 'crimson', 'teal', 'olive']
|
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
# Function to print the list
def printList(self):
node = self
output = ''
while node is not None:
output += str(node.val)
output += " "
node = node.next
print(output)
# Iterative Solution
@staticmethod
def reverseIteratively(head):
reverse = None
following = head.next
while head:
head.next = reverse
reverse = head
head = following
if following:
following = following.next
if __name__ == '__main__':
testHead = ListNode(4)
node1 = ListNode(3)
testHead.next = node1
node2 = ListNode(2)
node1.next = node2
node3 = ListNode(1)
node2.next = node3
testTail = ListNode(0)
node3.next = testTail
print("Initial list: ")
testHead.printList()
#4 3 2 1 0
testHead.reverseIteratively(testHead)
print("List after reversal: ")
testTail.printList()
#0 1 2 3 4
|
class Listnode(object):
def __init__(self, x):
self.val = x
self.next = None
def print_list(self):
node = self
output = ''
while node is not None:
output += str(node.val)
output += ' '
node = node.next
print(output)
@staticmethod
def reverse_iteratively(head):
reverse = None
following = head.next
while head:
head.next = reverse
reverse = head
head = following
if following:
following = following.next
if __name__ == '__main__':
test_head = list_node(4)
node1 = list_node(3)
testHead.next = node1
node2 = list_node(2)
node1.next = node2
node3 = list_node(1)
node2.next = node3
test_tail = list_node(0)
node3.next = testTail
print('Initial list: ')
testHead.printList()
testHead.reverseIteratively(testHead)
print('List after reversal: ')
testTail.printList()
|
# My Script:
hrs=input('Enter Hours: ')
hrs=float(hrs)
rph=input('Enter your rate per hour: ')
rph=float(rph)
pay=hrs*rph
print('Pay:', pay)
|
hrs = input('Enter Hours: ')
hrs = float(hrs)
rph = input('Enter your rate per hour: ')
rph = float(rph)
pay = hrs * rph
print('Pay:', pay)
|
#!/usr/bin/python
def twosum(list, target):
for i in list:
for j in list:
if i != j and i + j == target:
return True
return False
with open('xmas.txt') as fh:
lines = fh.readlines()
nums = [int(l.strip()) for l in lines]
idx = 25
while(True):
last25 = nums[idx-25:idx]
if twosum(last25, nums[idx]):
idx += 1
else:
break
targetsum = nums[idx]
wstart = 0
wend = 1
while(True):
cursum = sum(nums[wstart:wend+1])
if cursum < targetsum:
wend += 1
elif cursum > targetsum:
wstart += 1
else:
print("%d %d" % (wstart, wend))
window = nums[wstart:wend+1]
print(min(window) + max(window))
break
print(cursum)
|
def twosum(list, target):
for i in list:
for j in list:
if i != j and i + j == target:
return True
return False
with open('xmas.txt') as fh:
lines = fh.readlines()
nums = [int(l.strip()) for l in lines]
idx = 25
while True:
last25 = nums[idx - 25:idx]
if twosum(last25, nums[idx]):
idx += 1
else:
break
targetsum = nums[idx]
wstart = 0
wend = 1
while True:
cursum = sum(nums[wstart:wend + 1])
if cursum < targetsum:
wend += 1
elif cursum > targetsum:
wstart += 1
else:
print('%d %d' % (wstart, wend))
window = nums[wstart:wend + 1]
print(min(window) + max(window))
break
print(cursum)
|
class Solution(object):
def rob(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
if len(nums) <= 2:
return max(nums)
dp = [0] * len(nums)
dp[0] = nums[0]
dp[1] = max(nums[0], nums[1])
for x in range(2, len(nums)):
dp[x] = max(dp[x - 1], nums[x] + dp[x - 2])
return dp[-1]
class Solution(object):
def rob(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
prevMax,currMax = 0, 0
for x in nums:
tmp = currMax
currMax = max(prevMax + x, currMax)
prevMax = tmp
return currMax
|
class Solution(object):
def rob(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
if len(nums) <= 2:
return max(nums)
dp = [0] * len(nums)
dp[0] = nums[0]
dp[1] = max(nums[0], nums[1])
for x in range(2, len(nums)):
dp[x] = max(dp[x - 1], nums[x] + dp[x - 2])
return dp[-1]
class Solution(object):
def rob(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
(prev_max, curr_max) = (0, 0)
for x in nums:
tmp = currMax
curr_max = max(prevMax + x, currMax)
prev_max = tmp
return currMax
|
class Solution:
# Max to Min distance pair, O(n^2) time, O(1) space
def maxDistance(self, colors: List[int]) -> int:
for dist in range(len(colors)-1, 0, -1):
for i in range(len(colors)-dist):
if colors[i] != colors[i+dist]:
return dist
# Max dist from endpoints (Top Voted), O(n) time, O(1) space
def maxDistance(self, A: List[int]) -> int:
i, j = 0, len(A) - 1
while A[0] == A[j]:
j -= 1
while A[-1] == A[i]:
i += 1
return max(len(A) - 1 - i, j)
|
class Solution:
def max_distance(self, colors: List[int]) -> int:
for dist in range(len(colors) - 1, 0, -1):
for i in range(len(colors) - dist):
if colors[i] != colors[i + dist]:
return dist
def max_distance(self, A: List[int]) -> int:
(i, j) = (0, len(A) - 1)
while A[0] == A[j]:
j -= 1
while A[-1] == A[i]:
i += 1
return max(len(A) - 1 - i, j)
|
#Functions
def userFunction(): #Putting Function
print("Hello, User :)")
print("Have a nice day!")
#Calling Function
userFunction()
|
def user_function():
print('Hello, User :)')
print('Have a nice day!')
user_function()
|
"""Define docstring substitutions.
Text to be replaced is specified as a key in the returned dictionary,
with the replacement text defined by the corresponding value.
Special docstring substitutions, as defined by a class's
`_docstring_special_substitutions` method, may be used in the
replacement text, and will be substituted as usual.
Replacement text may not contain other non-special substitutions.
Keys must be `str` or `re.Pattern` objects:
* If a key is a `str` then the corresponding value must be a string.
* If a key is a `re.Pattern` object then the corresponding value must
be a string or a callable, as accepted by the `re.Pattern.sub`
method.
.. versionaddedd:: (cfdm) 1.8.7.0
"""
_docstring_substitution_definitions = {
# ----------------------------------------------------------------
# General susbstitutions (not indent-dependent)
# ----------------------------------------------------------------
"{{repr}}": "",
# ----------------------------------------------------------------
# # Method description susbstitutions (2 levels of indentation)
# ----------------------------------------------------------------
# cached: optional
"{{cached: optional}}": """cached: optional
If any value other than `None` then return *cached*
without selecting any constructs.""",
# todict: `bool`, optional
"{{todict: `bool`, optional}}": """todict: `bool`, optional
If True then return a dictionary of constructs keyed
by their construct identifiers, instead of a
`Constructs` object. This is a faster option.""",
# ----------------------------------------------------------------
# # Method description susbstitutions (3 levels of indentation)
# ----------------------------------------------------------------
# axes int examples
"{{axes int examples}}": """Each axis is identified by its integer position in the
data. Negative integers counting from the last
position are allowed.
*Parameter example:*
``axes=0``
*Parameter example:*
``axes=-1``
*Parameter example:*
``axes=[1, -2]``""",
# default Exception
"{{default Exception}}": """If set to an `Exception` instance then it will be
raised instead.""",
# inplace: `bool`, optional (default True)
"{{inplace: `bool`, optional (default True)}}": """inplace: `bool`, optional:
If False then do not do the operation in-place and
return a new, modified `{{class}}` instance. By
default the operation is in-place and `None` is
returned.""",
# init properties
"{{init properties: `dict`, optional}}": """properties: `dict`, optional
Set descriptive properties. The dictionary keys are
property names, with corresponding values. Ignored if
the *source* parameter is set.
Properties may also be set after initialisation with
the `set_properties` and `set_property` methods.""",
# init data
"{{init data: data_like, optional}}": """data: data_like, optional
Set the data. Ignored if the *source* parameter is
set.
{{data_like}}
The data also may be set after initialisation with the
`set_data` method.""",
# init bounds
"{{init bounds: `Bounds`, optional}}": """bounds: `Bounds`, optional
Set the bounds array. Ignored if the *source*
parameter is set.
The bounds array may also be set after initialisation
with the `set_bounds` method.""",
# init geometry
"{{init geometry: `str`, optional}}": """geometry: `str`, optional
Set the geometry type. Ignored if the *source*
parameter is set.
The geometry type may also be set after initialisation
with the `set_geometry` method.
*Parameter example:*
``geometry='polygon'``""",
# init interior_ring
"{{init interior_ring: `InteriorRing`, optional}}": """interior_ring: `InteriorRing`, optional
Set the interior ring variable. Ignored if the
*source* parameter is set.
The interior ring variable may also be set after
initialisation with the `set_interior_ring` method.""",
# init copy
"{{init copy: `bool`, optional}}": """copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.""",
# init source
"{{init source}}": """Note that if *source* is a `{{class}}` instance then
``{{package}}.{{class}}(source=source)`` is equivalent
to ``source.copy()``.""",
# data_like
"{{data_like}}": """A data_like object is any object that can be converted
to a `Data` object, i.e. `numpy` array_like objects,
`Data` objects, and {{package}} instances that contain
`Data` objects.""",
}
|
"""Define docstring substitutions.
Text to be replaced is specified as a key in the returned dictionary,
with the replacement text defined by the corresponding value.
Special docstring substitutions, as defined by a class's
`_docstring_special_substitutions` method, may be used in the
replacement text, and will be substituted as usual.
Replacement text may not contain other non-special substitutions.
Keys must be `str` or `re.Pattern` objects:
* If a key is a `str` then the corresponding value must be a string.
* If a key is a `re.Pattern` object then the corresponding value must
be a string or a callable, as accepted by the `re.Pattern.sub`
method.
.. versionaddedd:: (cfdm) 1.8.7.0
"""
_docstring_substitution_definitions = {'{{repr}}': '', '{{cached: optional}}': 'cached: optional\n If any value other than `None` then return *cached*\n without selecting any constructs.', '{{todict: `bool`, optional}}': 'todict: `bool`, optional\n If True then return a dictionary of constructs keyed\n by their construct identifiers, instead of a\n `Constructs` object. This is a faster option.', '{{axes int examples}}': 'Each axis is identified by its integer position in the\n data. Negative integers counting from the last\n position are allowed.\n\n *Parameter example:*\n ``axes=0``\n\n *Parameter example:*\n ``axes=-1``\n\n *Parameter example:*\n ``axes=[1, -2]``', '{{default Exception}}': 'If set to an `Exception` instance then it will be\n raised instead.', '{{inplace: `bool`, optional (default True)}}': 'inplace: `bool`, optional:\n If False then do not do the operation in-place and\n return a new, modified `{{class}}` instance. By\n default the operation is in-place and `None` is\n returned.', '{{init properties: `dict`, optional}}': 'properties: `dict`, optional\n Set descriptive properties. The dictionary keys are\n property names, with corresponding values. Ignored if\n the *source* parameter is set.\n\n Properties may also be set after initialisation with\n the `set_properties` and `set_property` methods.', '{{init data: data_like, optional}}': 'data: data_like, optional\n Set the data. Ignored if the *source* parameter is\n set.\n\n {{data_like}}\n\n The data also may be set after initialisation with the\n `set_data` method.', '{{init bounds: `Bounds`, optional}}': 'bounds: `Bounds`, optional\n Set the bounds array. Ignored if the *source*\n parameter is set.\n\n The bounds array may also be set after initialisation\n with the `set_bounds` method.', '{{init geometry: `str`, optional}}': "geometry: `str`, optional\n Set the geometry type. Ignored if the *source*\n parameter is set.\n\n The geometry type may also be set after initialisation\n with the `set_geometry` method.\n\n *Parameter example:*\n ``geometry='polygon'``", '{{init interior_ring: `InteriorRing`, optional}}': 'interior_ring: `InteriorRing`, optional\n Set the interior ring variable. Ignored if the\n *source* parameter is set.\n\n The interior ring variable may also be set after\n initialisation with the `set_interior_ring` method.', '{{init copy: `bool`, optional}}': 'copy: `bool`, optional\n If False then do not deep copy input parameters prior\n to initialisation. By default arguments are deep\n copied.', '{{init source}}': 'Note that if *source* is a `{{class}}` instance then\n ``{{package}}.{{class}}(source=source)`` is equivalent\n to ``source.copy()``.', '{{data_like}}': 'A data_like object is any object that can be converted\n to a `Data` object, i.e. `numpy` array_like objects,\n `Data` objects, and {{package}} instances that contain\n `Data` objects.'}
|
num_of_lines = int(input())
def cold_compress(cum, rs):
N = len(cum)
# exit
if (rs == ""):
output_string = ""
for s in cum:
output_string += str(s) + " "
return output_string
# iteration
if (N >= 2 and cum[N-1] == rs[0]):
cnt = cum[N-2]
cnt += 1
cum[N-2] = cnt
return cold_compress(cum, rs[1:])
else:
cum.append(1)
cum.append(rs[0])
return cold_compress(cum, rs[1:])
for i in range(0, num_of_lines):
print(cold_compress([], input()))
|
num_of_lines = int(input())
def cold_compress(cum, rs):
n = len(cum)
if rs == '':
output_string = ''
for s in cum:
output_string += str(s) + ' '
return output_string
if N >= 2 and cum[N - 1] == rs[0]:
cnt = cum[N - 2]
cnt += 1
cum[N - 2] = cnt
return cold_compress(cum, rs[1:])
else:
cum.append(1)
cum.append(rs[0])
return cold_compress(cum, rs[1:])
for i in range(0, num_of_lines):
print(cold_compress([], input()))
|
# arr = [2, 3, -4, -9, -1, -7, 1, -5, -6]
arr = [0, 0, 0, 0]
def next_p(arr, l, x):
print("px0", x)
while x <= l - 1 and arr[x] < 0:
x += 1
print("px1", x)
print("px2", x)
return x
def next_n(arr, l, x):
print("nx0", x)
while x <= l - 1 and arr[x] >= 0:
x += 1
print("nx1", x)
print("nx2", x)
return x
l = len(arr)
n = next_n(arr, l, 0)
p = next_p(arr, l, 0)
res = []
i = 0
print("a0", i, n, p, l, arr)
while i < l and n < l and p < l:
pos = i % 2 == 0
print("pos", i, pos, n, p)
if pos:
res.append(arr[p])
p += 1
p = next_p(arr, l, p)
else:
res.append(arr[n])
n += 1
n = next_n(arr, l, n)
i += 1
print("a1", i, n, p, l, res)
while i < l and n < l:
if arr[n] < 0:
res.append(arr[n])
n += 1
while i < l and p < l:
if arr[p] >= 0:
res.append(arr[p])
p += 1
print("a2", res)
|
arr = [0, 0, 0, 0]
def next_p(arr, l, x):
print('px0', x)
while x <= l - 1 and arr[x] < 0:
x += 1
print('px1', x)
print('px2', x)
return x
def next_n(arr, l, x):
print('nx0', x)
while x <= l - 1 and arr[x] >= 0:
x += 1
print('nx1', x)
print('nx2', x)
return x
l = len(arr)
n = next_n(arr, l, 0)
p = next_p(arr, l, 0)
res = []
i = 0
print('a0', i, n, p, l, arr)
while i < l and n < l and (p < l):
pos = i % 2 == 0
print('pos', i, pos, n, p)
if pos:
res.append(arr[p])
p += 1
p = next_p(arr, l, p)
else:
res.append(arr[n])
n += 1
n = next_n(arr, l, n)
i += 1
print('a1', i, n, p, l, res)
while i < l and n < l:
if arr[n] < 0:
res.append(arr[n])
n += 1
while i < l and p < l:
if arr[p] >= 0:
res.append(arr[p])
p += 1
print('a2', res)
|
# -*- coding: utf-8 -*-
# OPENID URLS
URL_WELL_KNOWN = "realms/{realm-name}/.well-known/openid-configuration"
URL_TOKEN = "realms/{realm-name}/protocol/openid-connect/token"
URL_USERINFO = "realms/{realm-name}/protocol/openid-connect/userinfo"
URL_LOGOUT = "realms/{realm-name}/protocol/openid-connect/logout"
URL_CERTS = "realms/{realm-name}/protocol/openid-connect/certs"
URL_INTROSPECT = "realms/{realm-name}/protocol/openid-connect/token/introspect"
URL_ENTITLEMENT = "realms/{realm-name}/authz/entitlement/{resource-server-id}"
# ADMIN URLS
URL_ADMIN_USERS = "admin/realms/{realm-name}/users"
URL_ADMIN_USERS_COUNT = "admin/realms/{realm-name}/users/count"
URL_ADMIN_USER = "admin/realms/{realm-name}/users/{id}"
URL_ADMIN_USER_CONSENTS = "admin/realms/{realm-name}/users/{id}/consents"
URL_ADMIN_SEND_UPDATE_ACCOUNT = "admin/realms/{realm-name}/users/{id}/execute-actions-email"
URL_ADMIN_SEND_VERIFY_EMAIL = "admin/realms/{realm-name}/users/{id}/send-verify-email"
URL_ADMIN_RESET_PASSWORD = "admin/realms/{realm-name}/users/{id}/reset-password"
URL_ADMIN_GET_SESSIONS = "admin/realms/{realm-name}/users/{id}/sessions"
URL_ADMIN_USER_CLIENT_ROLES = "admin/realms/{realm-name}/users/{id}/role-mappings/clients/{client-id}"
URL_ADMIN_USER_GROUP = "admin/realms/{realm-name}/users/{id}/groups/{group-id}"
URL_ADMIN_SERVER_INFO = "admin/serverinfo"
URL_ADMIN_GROUPS = "admin/realms/{realm-name}/groups"
URL_ADMIN_GROUP = "admin/realms/{realm-name}/groups/{id}"
URL_ADMIN_GROUP_CHILD = "admin/realms/{realm-name}/groups/{id}/children"
URL_ADMIN_GROUP_PERMISSIONS = "admin/realms/{realm-name}/groups/{id}/management/permissions"
URL_ADMIN_CLIENTS = "admin/realms/{realm-name}/clients"
URL_ADMIN_CLIENT = "admin/realms/{realm-name}/clients/{id}"
URL_ADMIN_CLIENT_ROLES = "admin/realms/{realm-name}/clients/{id}/roles"
URL_ADMIN_CLIENT_ROLE = "admin/realms/{realm-name}/clients/{id}/roles/{role-name}"
URL_ADMIN_REALM_ROLES = "admin/realms/{realm-name}/roles"
URL_ADMIN_USER_STORAGE = "admin/realms/{realm-name}/user-storage/{id}/sync"
|
url_well_known = 'realms/{realm-name}/.well-known/openid-configuration'
url_token = 'realms/{realm-name}/protocol/openid-connect/token'
url_userinfo = 'realms/{realm-name}/protocol/openid-connect/userinfo'
url_logout = 'realms/{realm-name}/protocol/openid-connect/logout'
url_certs = 'realms/{realm-name}/protocol/openid-connect/certs'
url_introspect = 'realms/{realm-name}/protocol/openid-connect/token/introspect'
url_entitlement = 'realms/{realm-name}/authz/entitlement/{resource-server-id}'
url_admin_users = 'admin/realms/{realm-name}/users'
url_admin_users_count = 'admin/realms/{realm-name}/users/count'
url_admin_user = 'admin/realms/{realm-name}/users/{id}'
url_admin_user_consents = 'admin/realms/{realm-name}/users/{id}/consents'
url_admin_send_update_account = 'admin/realms/{realm-name}/users/{id}/execute-actions-email'
url_admin_send_verify_email = 'admin/realms/{realm-name}/users/{id}/send-verify-email'
url_admin_reset_password = 'admin/realms/{realm-name}/users/{id}/reset-password'
url_admin_get_sessions = 'admin/realms/{realm-name}/users/{id}/sessions'
url_admin_user_client_roles = 'admin/realms/{realm-name}/users/{id}/role-mappings/clients/{client-id}'
url_admin_user_group = 'admin/realms/{realm-name}/users/{id}/groups/{group-id}'
url_admin_server_info = 'admin/serverinfo'
url_admin_groups = 'admin/realms/{realm-name}/groups'
url_admin_group = 'admin/realms/{realm-name}/groups/{id}'
url_admin_group_child = 'admin/realms/{realm-name}/groups/{id}/children'
url_admin_group_permissions = 'admin/realms/{realm-name}/groups/{id}/management/permissions'
url_admin_clients = 'admin/realms/{realm-name}/clients'
url_admin_client = 'admin/realms/{realm-name}/clients/{id}'
url_admin_client_roles = 'admin/realms/{realm-name}/clients/{id}/roles'
url_admin_client_role = 'admin/realms/{realm-name}/clients/{id}/roles/{role-name}'
url_admin_realm_roles = 'admin/realms/{realm-name}/roles'
url_admin_user_storage = 'admin/realms/{realm-name}/user-storage/{id}/sync'
|
#DEFAULT ARGS
print('Default Args : ')
def sample(a, b = 0, c = 1) :
print(a, b, c)
sample(10)
sample(10, 20)
sample(10, 20, 30)
#VARIABLE NUMBER OF ARGS
print('VARIABLE NUMBER OF ARGS : ')
def add(a, b, *t) :
s = a + b
for x in t :
s = s + x
return s
print(add(1, 2, 3, 4))
#KEY - WORD ARGS
print('KEY - WORD ARGS : ')
def sample2(j, k, l) :
print(j, k, l)
sample2(j = 'hi', k = 1.5, l = 30)
# VARIABLE NUMBER OF KEY - WORD ARGS
print('VARIABLE NUMBER OF KEY - WORD ARGS : ')
def sample3(**d) :
print(d)
sample3(m = 'Monday')
sample3(m = 'Monday', b = 'Tuesday')
|
print('Default Args : ')
def sample(a, b=0, c=1):
print(a, b, c)
sample(10)
sample(10, 20)
sample(10, 20, 30)
print('VARIABLE NUMBER OF ARGS : ')
def add(a, b, *t):
s = a + b
for x in t:
s = s + x
return s
print(add(1, 2, 3, 4))
print('KEY - WORD ARGS : ')
def sample2(j, k, l):
print(j, k, l)
sample2(j='hi', k=1.5, l=30)
print('VARIABLE NUMBER OF KEY - WORD ARGS : ')
def sample3(**d):
print(d)
sample3(m='Monday')
sample3(m='Monday', b='Tuesday')
|
string = 'b a '
newstring = string[-1::-1]
length = 0
print(newstring)
for i in range(0, len(newstring)):
if newstring[i] == ' ':
if i == 0:
continue
if newstring[i-1] == ' ':
continue
break
length += 1
print(length)
|
string = 'b a '
newstring = string[-1::-1]
length = 0
print(newstring)
for i in range(0, len(newstring)):
if newstring[i] == ' ':
if i == 0:
continue
if newstring[i - 1] == ' ':
continue
break
length += 1
print(length)
|
NEPS_URL = 'https://neps.academy'
ENGLISH_BUTTON = '/html/body/div/div/div/div[2]/div/div/a/div[2]/div'
LOGIN_PAGE_BUTTON = '//*[@id="app"]/div/div/div/div[1]/div/header/div/div/div[3]/div/div/nav/ul/li[6]/button'
EMAIL_INPUT = '/html/body/div/div/div/div[3]/div/div/div/form/div[1]/div/div[1]/div/input'
PASSWORD_INPUT = '/html/body/div/div/div/div[3]/div/div/div/form/div[2]/div/div[1]/div[1]/input'
LOGIN_MODAL_BUTTON = '//*[@id="app"]/div[3]/div/div/div/form/div[3]/button'
|
neps_url = 'https://neps.academy'
english_button = '/html/body/div/div/div/div[2]/div/div/a/div[2]/div'
login_page_button = '//*[@id="app"]/div/div/div/div[1]/div/header/div/div/div[3]/div/div/nav/ul/li[6]/button'
email_input = '/html/body/div/div/div/div[3]/div/div/div/form/div[1]/div/div[1]/div/input'
password_input = '/html/body/div/div/div/div[3]/div/div/div/form/div[2]/div/div[1]/div[1]/input'
login_modal_button = '//*[@id="app"]/div[3]/div/div/div/form/div[3]/button'
|
class Account:
"""Store login information(username and password)."""
def __init__(self, username='', password=''):
"""Store username and password."""
self.username = username
self.password = password
|
class Account:
"""Store login information(username and password)."""
def __init__(self, username='', password=''):
"""Store username and password."""
self.username = username
self.password = password
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.