content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
"""A helper method to register a rule (and optionally a view function)
to the application. The endpoint is automatically prefixed with the
blueprint's name.
"""
if self.url_prefix is not None:
if rule:
rule = "/".join((self.url_prefix.rstrip("/"), rule.lstrip("/")))
else:
rule = self.url_prefix
options.setdefault("subdomain", self.subdomain)
if endpoint is None:
endpoint = _endpoint_from_view_func(view_func)
defaults = self.url_defaults
if "defaults" in options:
defaults = dict(defaults, **options.pop("defaults"))
self.app.add_url_rule(
rule,
f"{self.blueprint.name}.{endpoint}",
view_func,
defaults=defaults,
**options,
)
|
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
"""A helper method to register a rule (and optionally a view function)
to the application. The endpoint is automatically prefixed with the
blueprint's name.
"""
if self.url_prefix is not None:
if rule:
rule = '/'.join((self.url_prefix.rstrip('/'), rule.lstrip('/')))
else:
rule = self.url_prefix
options.setdefault('subdomain', self.subdomain)
if endpoint is None:
endpoint = _endpoint_from_view_func(view_func)
defaults = self.url_defaults
if 'defaults' in options:
defaults = dict(defaults, **options.pop('defaults'))
self.app.add_url_rule(rule, f'{self.blueprint.name}.{endpoint}', view_func, defaults=defaults, **options)
|
class ModelSingleton(object):
# https://stackoverflow.com/a/6798042
_instances = {}
def __new__(class_, *args, **kwargs):
if class_ not in class_._instances:
class_._instances[class_] = super(ModelSingleton, class_).__new__(class_, *args, **kwargs)
return class_._instances[class_]
class SharedModel(ModelSingleton):
shared_model = None
mapper = None # mappers realID <-> innerID updates with new data such as models
|
class Modelsingleton(object):
_instances = {}
def __new__(class_, *args, **kwargs):
if class_ not in class_._instances:
class_._instances[class_] = super(ModelSingleton, class_).__new__(class_, *args, **kwargs)
return class_._instances[class_]
class Sharedmodel(ModelSingleton):
shared_model = None
mapper = None
|
tabuleiro_easy_1 = [
[4, 0, 1, 8, 3, 9, 5, 2, 0],
[3, 0, 9, 2, 7, 5, 1, 4, 6],
[5, 2, 7, 6, 0, 1, 9, 8, 0],
[0, 5, 8, 1, 0, 7, 3, 9, 4],
[0, 7, 3, 9, 8, 4, 2, 5, 0],
[9, 1, 4, 5, 2, 3, 6, 7, 8],
[7, 4, 0, 3, 0, 6, 8, 1, 2],
[8, 0, 6, 4, 1, 2, 7, 3, 5],
[1, 3, 2, 7, 5, 8, 4, 0, 9],
]
tabuleiro_easy_2 = [
[0, 6, 1, 8, 0, 0, 0, 0, 7],
[0, 8, 9, 2, 0, 5, 0, 4, 0],
[0, 0, 0, 0, 4, 0, 9, 0, 3],
[2, 0, 0, 1, 6, 0, 3, 0, 0],
[6, 7, 0, 0, 0, 0, 0, 5, 1],
[0, 0, 4, 0, 2, 3, 0, 0, 8],
[7, 0, 5, 0, 9, 0, 0, 0, 0],
[0, 9, 0, 4, 0, 2, 7, 3, 0],
[1, 0, 0, 0, 0, 8, 4, 6, 0],
]
tabuleiro_med = [
[0, 5, 0, 3, 6, 0, 0, 0, 0],
[2, 8, 0, 7, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 8, 0, 9, 0],
[6, 0, 0, 0, 0, 0, 0, 8, 3],
[0, 0, 4, 0, 0, 0, 2, 0, 0],
[8, 9, 0, 0, 0, 0, 0, 0, 6],
[0, 7, 0, 5, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1, 0, 3, 9],
[0, 0, 0, 0, 4, 3, 0, 6, 0],
]
tabuleiro_hard = [
[0, 7, 0, 0, 0, 0, 0, 9, 0],
[0, 0, 0, 0, 5, 0, 4, 0, 2],
[0, 0, 0, 0, 0, 0, 0, 3, 0],
[6, 0, 0, 0, 1, 3, 2, 0, 0],
[0, 0, 9, 0, 8, 0, 0, 0, 0],
[0, 3, 1, 0, 0, 6, 0, 0, 0],
[4, 6, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 8, 0, 0, 4, 6, 0, 0],
[0, 0, 0, 0, 3, 5, 0, 0, 0],
]
|
tabuleiro_easy_1 = [[4, 0, 1, 8, 3, 9, 5, 2, 0], [3, 0, 9, 2, 7, 5, 1, 4, 6], [5, 2, 7, 6, 0, 1, 9, 8, 0], [0, 5, 8, 1, 0, 7, 3, 9, 4], [0, 7, 3, 9, 8, 4, 2, 5, 0], [9, 1, 4, 5, 2, 3, 6, 7, 8], [7, 4, 0, 3, 0, 6, 8, 1, 2], [8, 0, 6, 4, 1, 2, 7, 3, 5], [1, 3, 2, 7, 5, 8, 4, 0, 9]]
tabuleiro_easy_2 = [[0, 6, 1, 8, 0, 0, 0, 0, 7], [0, 8, 9, 2, 0, 5, 0, 4, 0], [0, 0, 0, 0, 4, 0, 9, 0, 3], [2, 0, 0, 1, 6, 0, 3, 0, 0], [6, 7, 0, 0, 0, 0, 0, 5, 1], [0, 0, 4, 0, 2, 3, 0, 0, 8], [7, 0, 5, 0, 9, 0, 0, 0, 0], [0, 9, 0, 4, 0, 2, 7, 3, 0], [1, 0, 0, 0, 0, 8, 4, 6, 0]]
tabuleiro_med = [[0, 5, 0, 3, 6, 0, 0, 0, 0], [2, 8, 0, 7, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8, 0, 9, 0], [6, 0, 0, 0, 0, 0, 0, 8, 3], [0, 0, 4, 0, 0, 0, 2, 0, 0], [8, 9, 0, 0, 0, 0, 0, 0, 6], [0, 7, 0, 5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 3, 9], [0, 0, 0, 0, 4, 3, 0, 6, 0]]
tabuleiro_hard = [[0, 7, 0, 0, 0, 0, 0, 9, 0], [0, 0, 0, 0, 5, 0, 4, 0, 2], [0, 0, 0, 0, 0, 0, 0, 3, 0], [6, 0, 0, 0, 1, 3, 2, 0, 0], [0, 0, 9, 0, 8, 0, 0, 0, 0], [0, 3, 1, 0, 0, 6, 0, 0, 0], [4, 6, 0, 0, 0, 0, 0, 0, 1], [0, 0, 8, 0, 0, 4, 6, 0, 0], [0, 0, 0, 0, 3, 5, 0, 0, 0]]
|
class Config(object):
def __init__(self, vocab_size, max_length):
self.vocab_size = vocab_size
self.embedding_size = 300
self.hidden_size = 200
self.filters = [3, 4, 5]
self.num_filters = 256
self.num_classes = 10
self.max_length = max_length
self.num_epochs = 20
self.lr = 0.001
self.dropout = 0.5
self.attention = True
|
class Config(object):
def __init__(self, vocab_size, max_length):
self.vocab_size = vocab_size
self.embedding_size = 300
self.hidden_size = 200
self.filters = [3, 4, 5]
self.num_filters = 256
self.num_classes = 10
self.max_length = max_length
self.num_epochs = 20
self.lr = 0.001
self.dropout = 0.5
self.attention = True
|
#Mayor de edad
mayor=int(input("edad: "))
if(mayor >=18):
print("es mator de edad")
else:
print("es menor de edad")
|
mayor = int(input('edad: '))
if mayor >= 18:
print('es mator de edad')
else:
print('es menor de edad')
|
"""Top-level package for Python Boilerplate."""
__author__ = """Nate Solon"""
__email__ = '[email protected]'
__version__ = '0.1.0'
|
"""Top-level package for Python Boilerplate."""
__author__ = 'Nate Solon'
__email__ = '[email protected]'
__version__ = '0.1.0'
|
"""
Good morning! Here's your coding interview problem for today.
This problem was asked by Google.
Given a word W and a string S, find all starting indices in S which are anagrams of W.
For example, given that W is "ab", and S is "abxaba", return 0, 3, and 4.
"""
def verify_string_combos(word, string):
"""
Finds all possible indices of a word in a given string
"""
if type(word) is not str or type(string) is not str:
return None
if len(word) > len(string):
return []
indices = []
def isWordPresent(stringSlice):
tracker = word[:]
for i in range(0, len(word)):
charIndex = tracker.find(stringSlice[i])
if charIndex > -1:
tracker = tracker[:charIndex] + tracker[charIndex + 1:]
else:
break
return True if len(tracker) == 0 else False
for i in range(0, len(string) - len(word) + 1):
if word.find(string[i]) > -1:
if len(string[i:]) >= len(word) and isWordPresent(string[i:]):
indices.append(i)
return indices
|
"""
Good morning! Here's your coding interview problem for today.
This problem was asked by Google.
Given a word W and a string S, find all starting indices in S which are anagrams of W.
For example, given that W is "ab", and S is "abxaba", return 0, 3, and 4.
"""
def verify_string_combos(word, string):
"""
Finds all possible indices of a word in a given string
"""
if type(word) is not str or type(string) is not str:
return None
if len(word) > len(string):
return []
indices = []
def is_word_present(stringSlice):
tracker = word[:]
for i in range(0, len(word)):
char_index = tracker.find(stringSlice[i])
if charIndex > -1:
tracker = tracker[:charIndex] + tracker[charIndex + 1:]
else:
break
return True if len(tracker) == 0 else False
for i in range(0, len(string) - len(word) + 1):
if word.find(string[i]) > -1:
if len(string[i:]) >= len(word) and is_word_present(string[i:]):
indices.append(i)
return indices
|
#!/usr/bin/env python3
# implicit None return
def say_hi():
print("hey there")
# implicit artument return "name"
def yell_name(name='Adrienne'):
"""
this is a doc string
also this function returns the arg by default
"""
print("YO {0} ".format(name.upper()))
# scoping
def add(num1=0, num2=0):
"""
adds the 2 numbers. doy
"""
num1 = num1 + num2 # baaad idea but the scoping allows this
print(num1)
return num1
# named parameter
def madlibs(name, noun="shoes", adj="blue"):
return f"{name} has {adj} {noun}"
say_hi()
yell_name()
print(madlibs('tracie', adj='suede', noun='shoes')) # keyword args out of order, or using normal positional args
# can't do this print(madlibs('tracie', adj='suede', 'shoes')) # once you start keywords, you have to finish
|
def say_hi():
print('hey there')
def yell_name(name='Adrienne'):
"""
this is a doc string
also this function returns the arg by default
"""
print('YO {0} '.format(name.upper()))
def add(num1=0, num2=0):
"""
adds the 2 numbers. doy
"""
num1 = num1 + num2
print(num1)
return num1
def madlibs(name, noun='shoes', adj='blue'):
return f'{name} has {adj} {noun}'
say_hi()
yell_name()
print(madlibs('tracie', adj='suede', noun='shoes'))
|
""" Module for a sudoku Cell with row, column position """
class Cell:
""" A Sudoku cell """
def __init__(self, row: int, column: int):
"""
A Cell at the given row and column
:param row: The 1-indexed row of the cell
:param column: The 1-indexed column of the cell
"""
self.row = row
self.column = column
def __eq__(self, o: object) -> bool:
return isinstance(o, Cell) and self.row == o.row and self.column == o.column
def __hash__(self) -> int:
return hash((self.row, self.column))
def __repr__(self):
return f"r{self.row}c{self.column}"
def is_orthogonal(self, other: 'Cell') -> bool:
return (
self.column == other.column and abs(self.row - other.row) == 1 or
self.row == other.row and abs(self.column - other.column) == 1
)
|
""" Module for a sudoku Cell with row, column position """
class Cell:
""" A Sudoku cell """
def __init__(self, row: int, column: int):
"""
A Cell at the given row and column
:param row: The 1-indexed row of the cell
:param column: The 1-indexed column of the cell
"""
self.row = row
self.column = column
def __eq__(self, o: object) -> bool:
return isinstance(o, Cell) and self.row == o.row and (self.column == o.column)
def __hash__(self) -> int:
return hash((self.row, self.column))
def __repr__(self):
return f'r{self.row}c{self.column}'
def is_orthogonal(self, other: 'Cell') -> bool:
return self.column == other.column and abs(self.row - other.row) == 1 or (self.row == other.row and abs(self.column - other.column) == 1)
|
def getBASIC():
list = []
n = input()
while True:
line = n
if n.endswith('END'):
list.append(line)
return list
else:
list.append(line)
newN = input()
n = newN
|
def get_basic():
list = []
n = input()
while True:
line = n
if n.endswith('END'):
list.append(line)
return list
else:
list.append(line)
new_n = input()
n = newN
|
type_of_flowers = input()
count = int(input())
budget = int(input())
prices = {
"Roses": 5.00,
"Dahlias": 3.80,
"Tulips": 2.80,
"Narcissus": 3.00,
"Gladiolus": 2.50
}
price = count * prices[type_of_flowers]
if type_of_flowers == "Roses" and count > 80:
price -= 0.10 * price
elif type_of_flowers == "Dahlias" and count > 90:
price -= 0.15 * price
elif type_of_flowers == "Tulips" and count > 80:
price -= 0.15 * price
elif type_of_flowers == "Narcissus" and count < 120:
price += 0.15 * price
elif type_of_flowers == "Gladiolus" and count < 80:
price += 0.20 * price
money_left = budget - price
money_needed = price - budget
if money_left >= 0:
print(f"Hey, you have a great garden with {count} {type_of_flowers} and {money_left:.2f} leva left.")
else:
print(f"Not enough money, you need {money_needed:.2f} leva more.")
|
type_of_flowers = input()
count = int(input())
budget = int(input())
prices = {'Roses': 5.0, 'Dahlias': 3.8, 'Tulips': 2.8, 'Narcissus': 3.0, 'Gladiolus': 2.5}
price = count * prices[type_of_flowers]
if type_of_flowers == 'Roses' and count > 80:
price -= 0.1 * price
elif type_of_flowers == 'Dahlias' and count > 90:
price -= 0.15 * price
elif type_of_flowers == 'Tulips' and count > 80:
price -= 0.15 * price
elif type_of_flowers == 'Narcissus' and count < 120:
price += 0.15 * price
elif type_of_flowers == 'Gladiolus' and count < 80:
price += 0.2 * price
money_left = budget - price
money_needed = price - budget
if money_left >= 0:
print(f'Hey, you have a great garden with {count} {type_of_flowers} and {money_left:.2f} leva left.')
else:
print(f'Not enough money, you need {money_needed:.2f} leva more.')
|
#170
# Time: O(n)
# Space: O(n)
# Design and implement a TwoSum class. It should support the following operations: add and find.
#
# add - Add the number to an internal data structure.
# find - Find if there exists any pair of numbers which sum is equal to the value.
#
# For example,
# add(1); add(3); add(5);
# find(4) -> true
# find(7) -> false
class twoSumIII():
def __init__(self):
self.num_count={}
def add(self,val):
if val in self.num_count:
self.num_count[val]+=1
else:
self.num_count[val]=1
def find(self,target):
for num in self.num_count:
if target-num in self.num_count and (target-num!=num or self.num_count[target-num]>1):
return True
return False
|
class Twosumiii:
def __init__(self):
self.num_count = {}
def add(self, val):
if val in self.num_count:
self.num_count[val] += 1
else:
self.num_count[val] = 1
def find(self, target):
for num in self.num_count:
if target - num in self.num_count and (target - num != num or self.num_count[target - num] > 1):
return True
return False
|
def flatten(d: dict, new_d, path=''):
for key, value in d.items():
if not isinstance(value, dict):
new_d[path + key] = value
else:
path += f'{key}.'
return flatten(d[key], new_d, path=path)
return new_d
if __name__ == "__main__":
d = {"foo": 42,
"bar": "qwe",
"buz": {
"one": 1,
"two": 2,
"nested": {
"deep": "blue",
"deeper": {
"song": "my heart",
}
}
}
}
print(flatten(d, {}))
|
def flatten(d: dict, new_d, path=''):
for (key, value) in d.items():
if not isinstance(value, dict):
new_d[path + key] = value
else:
path += f'{key}.'
return flatten(d[key], new_d, path=path)
return new_d
if __name__ == '__main__':
d = {'foo': 42, 'bar': 'qwe', 'buz': {'one': 1, 'two': 2, 'nested': {'deep': 'blue', 'deeper': {'song': 'my heart'}}}}
print(flatten(d, {}))
|
class BotovodException(Exception):
pass
class AgentException(BotovodException):
pass
class AgentNotExistException(BotovodException):
def __init__(self, name: str):
super().__init__(f"Botovod have not '{name}' agent")
self.name = name
class HandlerNotPassed(BotovodException):
def __init__(self):
super().__init__("Handler not passed")
|
class Botovodexception(Exception):
pass
class Agentexception(BotovodException):
pass
class Agentnotexistexception(BotovodException):
def __init__(self, name: str):
super().__init__(f"Botovod have not '{name}' agent")
self.name = name
class Handlernotpassed(BotovodException):
def __init__(self):
super().__init__('Handler not passed')
|
class Solution:
def carPooling(self, trips: List[List[int]], capacity: int) -> bool:
tripOccupancy = [0] * 1002
for trip in trips:
tripOccupancy[trip[1]] += trip[0]
tripOccupancy[trip[2]] -= trip[0]
occupancy = 0
for occupancyDelta in tripOccupancy:
occupancy += occupancyDelta
if occupancy > capacity:
return False
return True
|
class Solution:
def car_pooling(self, trips: List[List[int]], capacity: int) -> bool:
trip_occupancy = [0] * 1002
for trip in trips:
tripOccupancy[trip[1]] += trip[0]
tripOccupancy[trip[2]] -= trip[0]
occupancy = 0
for occupancy_delta in tripOccupancy:
occupancy += occupancyDelta
if occupancy > capacity:
return False
return True
|
class Result:
def __init__(self, value=None, error=None):
self._value = value
self._error = error
def is_ok(self) -> bool:
return self._error is None
def is_error(self) -> bool:
return self._error is not None
@property
def value(self):
return self._value
@property
def error(self):
return self._error
@staticmethod
def make_value(value, state):
return value, state
@staticmethod
def make_error(error, state):
return Result(value=None, error=error), state
|
class Result:
def __init__(self, value=None, error=None):
self._value = value
self._error = error
def is_ok(self) -> bool:
return self._error is None
def is_error(self) -> bool:
return self._error is not None
@property
def value(self):
return self._value
@property
def error(self):
return self._error
@staticmethod
def make_value(value, state):
return (value, state)
@staticmethod
def make_error(error, state):
return (result(value=None, error=error), state)
|
cv_results = cross_validate(
model, X, y, cv=cv,
return_estimator=True, return_train_score=True,
n_jobs=-1,
)
cv_results = pd.DataFrame(cv_results)
|
cv_results = cross_validate(model, X, y, cv=cv, return_estimator=True, return_train_score=True, n_jobs=-1)
cv_results = pd.DataFrame(cv_results)
|
# """
# This is Master's API interface.
# You should not implement it, or speculate about its implementation
# """
#class Master:
# def guess(self, word):
# """
# :type word: str
# :rtype int
# """
class Solution:
def findSecretWord(self, wordlist, master):
n = 0
while n < 6:
count = collections.Counter(w1 for w1, w2 in itertools.permutations(wordlist, 2) if sum(i == j for i, j in zip(w1, w2)) == 0)
guess = min(wordlist, key = lambda w: count[w])
n = master.guess(guess)
wordlist = [w for w in wordlist if sum(i == j for i, j in zip(w, guess)) == n]
|
class Solution:
def find_secret_word(self, wordlist, master):
n = 0
while n < 6:
count = collections.Counter((w1 for (w1, w2) in itertools.permutations(wordlist, 2) if sum((i == j for (i, j) in zip(w1, w2))) == 0))
guess = min(wordlist, key=lambda w: count[w])
n = master.guess(guess)
wordlist = [w for w in wordlist if sum((i == j for (i, j) in zip(w, guess))) == n]
|
class Usercredentials:
'''
class to generate new instances of usercredentials
'''
user_credential_list = [] #empty list for user creddential
def __init__(self,site_name,password):
'''
method to define properties of the object
'''
self.site_name = site_name
self.password = password
def save_credentials(self):
'''
method to save a credential into the user credential list
'''
Usercredentials.user_credential_list.append(self)
def delete_credentials(self):
'''
method to delete saved credential
'''
Usercredentials.user_credential_list.remove(self)
@classmethod
def display_credentials(cls):
return cls.user_credential_list
|
class Usercredentials:
"""
class to generate new instances of usercredentials
"""
user_credential_list = []
def __init__(self, site_name, password):
"""
method to define properties of the object
"""
self.site_name = site_name
self.password = password
def save_credentials(self):
"""
method to save a credential into the user credential list
"""
Usercredentials.user_credential_list.append(self)
def delete_credentials(self):
"""
method to delete saved credential
"""
Usercredentials.user_credential_list.remove(self)
@classmethod
def display_credentials(cls):
return cls.user_credential_list
|
"""Fixed and parsed data for testing"""
SERIES = {
"_links": { "nextepisode": { "href": "http://api.tvmaze.com/episodes/664353"},
"previousepisode": { "href": "http://api.tvmaze.com/episodes/631872"},
"self": { "href": "http://api.tvmaze.com/shows/60"}
},
"externals": { "imdb": "tt0364845", "thetvdb": 72108, "tvrage": 4628},
"genres": ["Drama", "Action", "Crime"],
"id": 60, "image": { "medium": "http://tvmazecdn.com/uploads/images/medium_portrait/34/85849.jpg", "original": "http://tvmazecdn.com/uploads/images/original_untouched/34/85849.jpg" }, "language": "English", "name": "NCIS",
"network": { "country": { "code": "US", "name": "United States",
"timezone": "America/New_York"},
"id": 2,
"name": "CBS"
},
"premiered": "2003-09-23",
"rating": { "average": 8.8},
"runtime": 60,
"schedule": { "days": ["Tuesday"], "time": "20:00"},
"status": "Running",
"summary": """
<p>NCIS (Naval Criminal Investigative Service) is more than
just an action drama. With liberal doses of humor, it\"s a show that focuses
on the sometimes complex and always amusing dynamics of a team forced to work
together in high-stress situations. Leroy Jethro Gibbs, a former Marine
gunnery sergeant, whose skills as an investigator are unmatched, leads this
troupe of colorful personalities. Rounding out the team are Anthony DiNozzo,
an ex-homicide detective whose instincts in the field are unparalleled and
whose quick wit and humorous take on life make him a team favorite; the
youthful and energetic forensic specialist Abby Sciuto, a talented scientist
whose sharp mind matches her Goth style and eclectic tastes; Caitlin Todd, an
ex-Secret Service Agent; and Timothy McGee, an MIT graduate whose brilliance
with computers far overshadows his insecurities in the field; Assisting the
team is medical examiner Dr. Donald "Ducky" Mallard, who knows it all because
he\"s seen it all, and he\"s not afrad to let you know. From murder and
espionage to terrorism and stolen submarines, these special agents travel the
globe to investigate all crimes with Navy or Marine Corps ties.</p>
""",
"type": "Scripted",
"updated": 1460310820,
"url": "http://www.tvmaze.com/shows/60/ncis",
"webChannel": None,
"weight": 11
}
PREV = {
'_links': {'self': {'href': 'http://api.tvmaze.com/episodes/2284'}},
'airdate': '2003-09-23',
'airstamp': '2003-09-23T20:00:00-04:00',
'airtime': '20:00',
'id': 2284,
'image': None,
'name': 'Yankee White',
'number': 1,
'runtime': 60,
'season': 1,
'summary': """
<p>A Marine mysteriously drops dead aboard Air Force
One and jurisdiction problems force Gibbs to share the
investigation with a Secret Service agent.</p>
""" ,
'url': 'http://www.tvmaze.com/episodes/2284/ncis-1x01-yankee-white'
}
NEXT = {
'_links': {'self': {'href': 'http://api.tvmaze.com/episodes/2285'}},
'airdate': '2003-09-30',
'airstamp': '2003-09-30T20:00:00-04:00',
'airtime': '20:00',
'id': 2285,
'image': None,
'name': 'Hung Out to Dry',
'number': 2,
'runtime': 60,
'season': 1,
'summary': """
<p>A Marine dies when his parachute fails and he crashes
through a car during a training exercise, and Gibbs
suspects he was murdered.</p>
""",
'url': 'http://www.tvmaze.com/episodes/2285/ncis-1x02-hung-out-to-dry'
}
mock_data = {"series": SERIES, "previousepisode": PREV, "nextepisode": NEXT}
def mock_get_data(data_name, **kwargs):
"""
Mocks the response JSON from TVMaze.
:param data_name: a string, either series, prev or next
:kwargs: a dictionary that change the mock data dict
:return: a dict, representing the mocked data
"""
data = mock_data[data_name]
if kwargs:
for key in kwargs.keys():
if data.get(key):
data[key] = kwargs[key]
return data
|
"""Fixed and parsed data for testing"""
series = {'_links': {'nextepisode': {'href': 'http://api.tvmaze.com/episodes/664353'}, 'previousepisode': {'href': 'http://api.tvmaze.com/episodes/631872'}, 'self': {'href': 'http://api.tvmaze.com/shows/60'}}, 'externals': {'imdb': 'tt0364845', 'thetvdb': 72108, 'tvrage': 4628}, 'genres': ['Drama', 'Action', 'Crime'], 'id': 60, 'image': {'medium': 'http://tvmazecdn.com/uploads/images/medium_portrait/34/85849.jpg', 'original': 'http://tvmazecdn.com/uploads/images/original_untouched/34/85849.jpg'}, 'language': 'English', 'name': 'NCIS', 'network': {'country': {'code': 'US', 'name': 'United States', 'timezone': 'America/New_York'}, 'id': 2, 'name': 'CBS'}, 'premiered': '2003-09-23', 'rating': {'average': 8.8}, 'runtime': 60, 'schedule': {'days': ['Tuesday'], 'time': '20:00'}, 'status': 'Running', 'summary': '\n <p>NCIS (Naval Criminal Investigative Service) is more than\n just an action drama. With liberal doses of humor, it"s a show that focuses\n on the sometimes complex and always amusing dynamics of a team forced to work\n together in high-stress situations. Leroy Jethro Gibbs, a former Marine\n gunnery sergeant, whose skills as an investigator are unmatched, leads this\n troupe of colorful personalities. Rounding out the team are Anthony DiNozzo,\n an ex-homicide detective whose instincts in the field are unparalleled and\n whose quick wit and humorous take on life make him a team favorite; the\n youthful and energetic forensic specialist Abby Sciuto, a talented scientist\n whose sharp mind matches her Goth style and eclectic tastes; Caitlin Todd, an\n ex-Secret Service Agent; and Timothy McGee, an MIT graduate whose brilliance\n with computers far overshadows his insecurities in the field; Assisting the\n team is medical examiner Dr. Donald "Ducky" Mallard, who knows it all because\n he"s seen it all, and he"s not afrad to let you know. From murder and\n espionage to terrorism and stolen submarines, these special agents travel the\n globe to investigate all crimes with Navy or Marine Corps ties.</p>\n ', 'type': 'Scripted', 'updated': 1460310820, 'url': 'http://www.tvmaze.com/shows/60/ncis', 'webChannel': None, 'weight': 11}
prev = {'_links': {'self': {'href': 'http://api.tvmaze.com/episodes/2284'}}, 'airdate': '2003-09-23', 'airstamp': '2003-09-23T20:00:00-04:00', 'airtime': '20:00', 'id': 2284, 'image': None, 'name': 'Yankee White', 'number': 1, 'runtime': 60, 'season': 1, 'summary': '\n <p>A Marine mysteriously drops dead aboard Air Force\n One and jurisdiction problems force Gibbs to share the\n investigation with a Secret Service agent.</p>\n ', 'url': 'http://www.tvmaze.com/episodes/2284/ncis-1x01-yankee-white'}
next = {'_links': {'self': {'href': 'http://api.tvmaze.com/episodes/2285'}}, 'airdate': '2003-09-30', 'airstamp': '2003-09-30T20:00:00-04:00', 'airtime': '20:00', 'id': 2285, 'image': None, 'name': 'Hung Out to Dry', 'number': 2, 'runtime': 60, 'season': 1, 'summary': '\n <p>A Marine dies when his parachute fails and he crashes\n through a car during a training exercise, and Gibbs\n suspects he was murdered.</p>\n ', 'url': 'http://www.tvmaze.com/episodes/2285/ncis-1x02-hung-out-to-dry'}
mock_data = {'series': SERIES, 'previousepisode': PREV, 'nextepisode': NEXT}
def mock_get_data(data_name, **kwargs):
"""
Mocks the response JSON from TVMaze.
:param data_name: a string, either series, prev or next
:kwargs: a dictionary that change the mock data dict
:return: a dict, representing the mocked data
"""
data = mock_data[data_name]
if kwargs:
for key in kwargs.keys():
if data.get(key):
data[key] = kwargs[key]
return data
|
#!/usr/bin/env python
def clean_links(text):
"""Remove brackets around a wikilink, keeping the label instead of the page
if it exists.
"[[foobar]]" will become "foobar", but "[[foobar|code words]]" will return
"code words".
Args:
text (str): Full text of a Wikipedia article as a single string.
Returns:
str: A copy of the full text with all wikilinks cleaned.
"""
good_char_list = []
next_char = None
skip = 0
for pos,char in enumerate(text):
try:
next_char = text[pos+1]
except IndexError:
next_char = None
# Skip the character
if skip:
skip -= 1
continue
# Otherwise check if we have found a link
if char == '[' and next_char == '[':
skip = 1
# Check if we are in a comment with
pipe_pos = text.find('|', pos)
if pipe_pos == -1:
continue
end_pos = text.find(']]', pos)
if pipe_pos < end_pos:
skip = pipe_pos - pos
elif char == ']' and next_char == ']':
skip = 1
# Otherwise just append the character
else:
good_char_list.append(char)
return ''.join(good_char_list)
|
def clean_links(text):
"""Remove brackets around a wikilink, keeping the label instead of the page
if it exists.
"[[foobar]]" will become "foobar", but "[[foobar|code words]]" will return
"code words".
Args:
text (str): Full text of a Wikipedia article as a single string.
Returns:
str: A copy of the full text with all wikilinks cleaned.
"""
good_char_list = []
next_char = None
skip = 0
for (pos, char) in enumerate(text):
try:
next_char = text[pos + 1]
except IndexError:
next_char = None
if skip:
skip -= 1
continue
if char == '[' and next_char == '[':
skip = 1
pipe_pos = text.find('|', pos)
if pipe_pos == -1:
continue
end_pos = text.find(']]', pos)
if pipe_pos < end_pos:
skip = pipe_pos - pos
elif char == ']' and next_char == ']':
skip = 1
else:
good_char_list.append(char)
return ''.join(good_char_list)
|
def GetParent(node, parent):
if node == parent[node]:
return node
parent[node] = GetParent(parent[node], parent)
return parent[node]
def union(u, v, parent, rank):
u = GetParent(u, parent)
v = GetParent(v, parent)
if rank[u] < rank[v]:
parent[u] = v
elif rank[u] > rank[v]:
parent[v] = u
else:
parent[v] = u
rank[u] += 1
# union
def Kruskal(n, m):
edges = []
for _ in range(m):
x, y, w = map(int, input().split())
edges.append(x, y, w)
edges = sorted(edges, key=lambda x: x[2])
parent = [0]*n
rank = [0]*n
for i in range(n):
parent[i] = i
cost = 0
mst = []
for x, y, w in edges:
if(GetParent(x, parent) != GetParent(y, parent)):
cost += w
mst.append([x, y])
union(x, y, parent, rank)
for i, j in mst:
print(i, '-', j)
return cost
|
def get_parent(node, parent):
if node == parent[node]:
return node
parent[node] = get_parent(parent[node], parent)
return parent[node]
def union(u, v, parent, rank):
u = get_parent(u, parent)
v = get_parent(v, parent)
if rank[u] < rank[v]:
parent[u] = v
elif rank[u] > rank[v]:
parent[v] = u
else:
parent[v] = u
rank[u] += 1
def kruskal(n, m):
edges = []
for _ in range(m):
(x, y, w) = map(int, input().split())
edges.append(x, y, w)
edges = sorted(edges, key=lambda x: x[2])
parent = [0] * n
rank = [0] * n
for i in range(n):
parent[i] = i
cost = 0
mst = []
for (x, y, w) in edges:
if get_parent(x, parent) != get_parent(y, parent):
cost += w
mst.append([x, y])
union(x, y, parent, rank)
for (i, j) in mst:
print(i, '-', j)
return cost
|
#!/usr/bin/env python3
n, *h = map(int, open(0).read().split())
dp = [0] * n
dp[0] = 0
a = abs
for i in range(1, n):
dp[i] = min(dp[i], dp[i-1] + a(h[i] - h[i-1]))
dp[i+1] = min(dp[i+1], dp[i-1] + a(h[i] - h[i-2]))
print(dp[n-1])
|
(n, *h) = map(int, open(0).read().split())
dp = [0] * n
dp[0] = 0
a = abs
for i in range(1, n):
dp[i] = min(dp[i], dp[i - 1] + a(h[i] - h[i - 1]))
dp[i + 1] = min(dp[i + 1], dp[i - 1] + a(h[i] - h[i - 2]))
print(dp[n - 1])
|
"""
In this Bite you complete the divide_numbers function that takes a
numerator and a denominator (the number above and below the line
respectively when doing a division).
First you try to convert them to ints, if that raises a ValueError
you will re-raise it (using raise).
To keep things simple we can expect this function to be called
with int/float/str types only (read the tests why ...)
Getting passed that exception (no early bail out, we're still in
business) you try to divide numerator by denominator returning
its result.
If denominator is 0 though, Python throws another exception.
Figure out which one that is and catch it. In that case return 0.
"""
def divide_numbers(numerator, denominator):
"""For this exercise you can assume numerator and denominator are of type
int/str/float.
Try to convert numerator and denominator to int types, if that raises a
ValueError reraise it. Following do the division and return the result.
However if denominator is 0 catch the corresponding exception Python
throws (cannot divide by 0), and return 0"""
try:
numerator = int(numerator)
denominator = int(denominator)
except ValueError:
raise ValueError
try:
return numerator / denominator
except ZeroDivisionError:
return 0
# Check why this code did't work...
# if int(numerator) and int(denominator):
# try:
# return int(numerator)/int(denominator)
# except ZeroDivisionError:
# return 0
# else:
# raise ValueError
|
"""
In this Bite you complete the divide_numbers function that takes a
numerator and a denominator (the number above and below the line
respectively when doing a division).
First you try to convert them to ints, if that raises a ValueError
you will re-raise it (using raise).
To keep things simple we can expect this function to be called
with int/float/str types only (read the tests why ...)
Getting passed that exception (no early bail out, we're still in
business) you try to divide numerator by denominator returning
its result.
If denominator is 0 though, Python throws another exception.
Figure out which one that is and catch it. In that case return 0.
"""
def divide_numbers(numerator, denominator):
"""For this exercise you can assume numerator and denominator are of type
int/str/float.
Try to convert numerator and denominator to int types, if that raises a
ValueError reraise it. Following do the division and return the result.
However if denominator is 0 catch the corresponding exception Python
throws (cannot divide by 0), and return 0"""
try:
numerator = int(numerator)
denominator = int(denominator)
except ValueError:
raise ValueError
try:
return numerator / denominator
except ZeroDivisionError:
return 0
|
"""
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn't have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
Example:
[[0,1,0,0],
[1,1,1,0],
[0,1,0,0],
[1,1,0,0]]
Answer: 16
Explanation: The perimeter is the 16 yellow stripes in the image below:
"""
class Solution(object):
def islandPerimeter(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
sides = 0
for i in range(len(grid)):
prev = 0
for t in grid[i]:
if t!=prev:
prev = t
sides+=1
if grid[i][len(grid[i])-1]==1:
sides+=1
for i in range(len(grid[0])):
prev = 0
for t in range(len(grid)):
if grid[t][i]!=prev:
prev = grid[t][i]
sides+=1
if grid[len(grid)-1][i]==1:
sides+=1
return sides
|
"""
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn't have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
Example:
[[0,1,0,0],
[1,1,1,0],
[0,1,0,0],
[1,1,0,0]]
Answer: 16
Explanation: The perimeter is the 16 yellow stripes in the image below:
"""
class Solution(object):
def island_perimeter(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
sides = 0
for i in range(len(grid)):
prev = 0
for t in grid[i]:
if t != prev:
prev = t
sides += 1
if grid[i][len(grid[i]) - 1] == 1:
sides += 1
for i in range(len(grid[0])):
prev = 0
for t in range(len(grid)):
if grid[t][i] != prev:
prev = grid[t][i]
sides += 1
if grid[len(grid) - 1][i] == 1:
sides += 1
return sides
|
"""This file defines the unified tensor framework interface required by DeepXDE.
The principles of this interface:
* There should be as few interfaces as possible.
* The interface is used by DeepXDE system so it is more important to have
clean definition rather than convenient usage.
* Default arguments should be avoided.
* Keyword or positional arguments should be avoided.
* Argument type should be easier to understand.
It is recommended the frameworks implement all the interfaces. However, it is
also OK to skip some. The generated backend module has an ``is_enabled`` function
that returns whether the interface is supported by the framework or not.
"""
# For now the backend only has one API
tf = None
|
"""This file defines the unified tensor framework interface required by DeepXDE.
The principles of this interface:
* There should be as few interfaces as possible.
* The interface is used by DeepXDE system so it is more important to have
clean definition rather than convenient usage.
* Default arguments should be avoided.
* Keyword or positional arguments should be avoided.
* Argument type should be easier to understand.
It is recommended the frameworks implement all the interfaces. However, it is
also OK to skip some. The generated backend module has an ``is_enabled`` function
that returns whether the interface is supported by the framework or not.
"""
tf = None
|
# User input
minutes = float(input("Enter the time in minutes: "))
# Program operation
hours = minutes/60
# Computer output
print("The time in hours is: " + str(hours))
|
minutes = float(input('Enter the time in minutes: '))
hours = minutes / 60
print('The time in hours is: ' + str(hours))
|
x = 12
y = 3
print(x > y) # True
x = "12"
y = "3"
print(x > y) # ! False / Why it's false ?
print(x < y) # ! True
# x = 12
# y = "3"
# print(x > y)
x2 = "45"
y2 = "321"
print(x2 > y2) # True
x2 = "45"
y2 = "621"
X2_Length = len(x2)
Y2_Length = len(y2)
print(X2_Length < Y2_Length) # True
print( ord('4') ) # 52
print( ord('5') ) # 53
print( ord('6') ) # 54
print( ord('2') ) # 50
print( ord('1') ) # 49
|
x = 12
y = 3
print(x > y)
x = '12'
y = '3'
print(x > y)
print(x < y)
x2 = '45'
y2 = '321'
print(x2 > y2)
x2 = '45'
y2 = '621'
x2__length = len(x2)
y2__length = len(y2)
print(X2_Length < Y2_Length)
print(ord('4'))
print(ord('5'))
print(ord('6'))
print(ord('2'))
print(ord('1'))
|
'''
For 35 points, answer the following questions.
Create a new folder named file_io and create a new Python file in the
folder. Run this 4 line program. Then look in the folder.
1) What did the program do?
'''
f = open('workfile.txt', 'w')
f.write('Bazarr 10 points\n')
f.write('Iko 3 points')
f.close()
'''Run this short program.
2) What did the program do?
'''
f = open('workfile.txt', 'r')
line = f.readline()
while line:
print(line)
line = f.readline()
f.close()
'''Run this short program.
3) What did the program do?
'''
f = open('value.txt', 'w')
f.write('14')
f.close()
'''Run this short program.
4) What did the program do?
'''
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
print(x*2)
'''Run this short program. Make sure to look at the value.txt file
before and after running this program.
5) What did the program do?
'''
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
x = x*2
f = open('value.txt', 'w')
f.write(str(x))
f.close()
|
"""
For 35 points, answer the following questions.
Create a new folder named file_io and create a new Python file in the
folder. Run this 4 line program. Then look in the folder.
1) What did the program do?
"""
f = open('workfile.txt', 'w')
f.write('Bazarr 10 points\n')
f.write('Iko 3 points')
f.close()
'Run this short program.\n2) What did the program do?\n'
f = open('workfile.txt', 'r')
line = f.readline()
while line:
print(line)
line = f.readline()
f.close()
'Run this short program.\n3) What did the program do?\n'
f = open('value.txt', 'w')
f.write('14')
f.close()
'Run this short program.\n4) What did the program do?\n'
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
print(x * 2)
'Run this short program. Make sure to look at the value.txt file \nbefore and after running this program.\n5) What did the program do?\n'
f = open('value.txt', 'r')
line = f.readline()
f.close()
x = int(line)
x = x * 2
f = open('value.txt', 'w')
f.write(str(x))
f.close()
|
# -*- coding: utf-8 -*-
def main():
n = int(input())
a = [int(input()) for _ in range(n)][::-1]
ans = 0
for i in range(n):
p, q = divmod(a[i], 2)
ans += p
if q == 1:
if (i + 1 <= n - 1) and (a[i + 1] >= 1):
ans += 1
a[i + 1] -= 1
print(ans)
if __name__ == '__main__':
main()
|
def main():
n = int(input())
a = [int(input()) for _ in range(n)][::-1]
ans = 0
for i in range(n):
(p, q) = divmod(a[i], 2)
ans += p
if q == 1:
if i + 1 <= n - 1 and a[i + 1] >= 1:
ans += 1
a[i + 1] -= 1
print(ans)
if __name__ == '__main__':
main()
|
'''
escreva num arquivo texto.txt o conteudo de uma lista de uma vez
'''
arquivo = open('texto.txt', 'a')
frases = list()
frases.append('TreinaWeb \n')
frases.append('Python \n')
frases.append('Arquivos \n')
frases.append('Django \n')
arquivo.writelines(frases)
|
"""
escreva num arquivo texto.txt o conteudo de uma lista de uma vez
"""
arquivo = open('texto.txt', 'a')
frases = list()
frases.append('TreinaWeb \n')
frases.append('Python \n')
frases.append('Arquivos \n')
frases.append('Django \n')
arquivo.writelines(frases)
|
'''Exceptions for my orm'''
class ObjectNotInitializedError(Exception):
pass
class ObjectNotFoundError(Exception):
pass
|
"""Exceptions for my orm"""
class Objectnotinitializederror(Exception):
pass
class Objectnotfounderror(Exception):
pass
|
def download_file(my_socket):
print("[+] Downloading file")
filename = my_socket.receive_data()
my_socket.receive_file(filename)
|
def download_file(my_socket):
print('[+] Downloading file')
filename = my_socket.receive_data()
my_socket.receive_file(filename)
|
def return_for_conditions(obj, raise_ex=False, **kwargs):
"""
Get a function that returns/raises an object and is suitable as a
``side_effect`` for a mock object.
Args:
obj:
The object to return/raise.
raise_ex:
A boolean indicating if the object should be raised instead
of returned.
**kwargs:
The keyword arguments that must be provided to the function
being mocked in order for the provided object to be returned
or raised. As long as the mocked function is called with at
least the arguments provided to this function, the handler
is triggered.
Returns:
A function usable as the side effect of a mocked object.
"""
def handler(**inner_kwargs):
if kwargs.items() <= inner_kwargs.items():
if raise_ex:
raise obj
return obj
return handler
|
def return_for_conditions(obj, raise_ex=False, **kwargs):
"""
Get a function that returns/raises an object and is suitable as a
``side_effect`` for a mock object.
Args:
obj:
The object to return/raise.
raise_ex:
A boolean indicating if the object should be raised instead
of returned.
**kwargs:
The keyword arguments that must be provided to the function
being mocked in order for the provided object to be returned
or raised. As long as the mocked function is called with at
least the arguments provided to this function, the handler
is triggered.
Returns:
A function usable as the side effect of a mocked object.
"""
def handler(**inner_kwargs):
if kwargs.items() <= inner_kwargs.items():
if raise_ex:
raise obj
return obj
return handler
|
#
# @lc app=leetcode id=223 lang=python3
#
# [223] Rectangle Area
#
# @lc code=start
class Solution:
def computeArea(self, A: int, B: int, C: int, D: int, E: int, F: int, G: int, H: int) -> int:
overlap = max(min(C, G) - max(A, E), 0) * max(min(D, H) - max(B, F), 0)
total = (A - C) * (B - D) + (E - G) * (F - H)
return total - overlap
# @lc code=end
# Accepted
# 3082/3082 cases passed(56 ms)
# Your runtime beats 81.4 % of python3 submissions
# Your memory usage beats 100 % of python3 submissions(12.8 MB)
|
class Solution:
def compute_area(self, A: int, B: int, C: int, D: int, E: int, F: int, G: int, H: int) -> int:
overlap = max(min(C, G) - max(A, E), 0) * max(min(D, H) - max(B, F), 0)
total = (A - C) * (B - D) + (E - G) * (F - H)
return total - overlap
|
gameList = [
'Riverraid-v0',
'SpaceInvaders-v0',
'StarGunner-v0',
'Pitfall-v0',
'Centipede-v0'
]
|
game_list = ['Riverraid-v0', 'SpaceInvaders-v0', 'StarGunner-v0', 'Pitfall-v0', 'Centipede-v0']
|
class Solution:
def boxDelivering(self, boxes: List[List[int]], portsCount: int, maxBoxes: int, maxWeight: int) -> int:
n = len(boxes)
# dp[i] := min trips to deliver boxes[0..i) and return to the storage
dp = [0] * (n + 1)
trips = 2
weight = 0
l = 0
for r in range(n):
weight += boxes[r][1]
# current box is different from previous one, need to make one more trip
if r > 0 and boxes[r][0] != boxes[r - 1][0]:
trips += 1
# loading boxes[l] in the previous turn is always no bad than loading it in this turn
while r - l + 1 > maxBoxes or weight > maxWeight or (l < r and dp[l + 1] == dp[l]):
weight -= boxes[l][1]
if boxes[l][0] != boxes[l + 1][0]:
trips -= 1
l += 1
# min trips to deliver boxes[0..r]
# = min trips to deliver boxes[0..l) + trips to deliver boxes[l..r]
dp[r + 1] = dp[l] + trips
return dp[n]
|
class Solution:
def box_delivering(self, boxes: List[List[int]], portsCount: int, maxBoxes: int, maxWeight: int) -> int:
n = len(boxes)
dp = [0] * (n + 1)
trips = 2
weight = 0
l = 0
for r in range(n):
weight += boxes[r][1]
if r > 0 and boxes[r][0] != boxes[r - 1][0]:
trips += 1
while r - l + 1 > maxBoxes or weight > maxWeight or (l < r and dp[l + 1] == dp[l]):
weight -= boxes[l][1]
if boxes[l][0] != boxes[l + 1][0]:
trips -= 1
l += 1
dp[r + 1] = dp[l] + trips
return dp[n]
|
{{AUTO_GENERATED_NOTICE}}
CompilerInfo = provider(fields = ["platform", "bsc", "bsb_helper"])
def _rescript_compiler_impl(ctx):
return [CompilerInfo(
platform = ctx.attr.name,
bsc = ctx.file.bsc,
bsb_helper = ctx.file.bsb_helper,
)]
rescript_compiler = rule(
implementation = _rescript_compiler_impl,
attrs = {
"bsc": attr.label(
allow_single_file = True,
executable = True,
cfg = "exec",
),
"bsb_helper": attr.label(
allow_single_file = True,
executable = True,
cfg = "exec",
),
},
)
RescriptOutputArtifacts = provider(fields = [
"cmi",
"cmj",
"js",
])
RescriptModuleProvider = provider(fields = [
"module_artifacts",
# Includes js_file and all of its transitive deps
"js_depset",
"data_depset",
])
def _perhaps_compile_to_iast(ctx, interface_file, iast_file):
if interface_file == None:
return None
iast_args = ctx.actions.args()
iast_args.add("-bs-v", "{{COMPILER_VERSION}}")
iast_args.add("-bs-ast")
iast_args.add("-o", iast_file)
iast_args.add(interface_file)
ctx.actions.run(
mnemonic = "CompileToiAST",
executable = ctx.attr.compiler[CompilerInfo].bsc,
arguments = [iast_args],
inputs = depset([interface_file]),
outputs = [iast_file],
)
def _compile_to_ast(ctx, src_file, ast_file):
ast_args = ctx.actions.args()
ast_args.add("-bs-v", "{{COMPILER_VERSION}}")
ast_args.add("-bs-ast")
ast_args.add("-o", ast_file)
ast_args.add(src_file)
ctx.actions.run(
mnemonic = "CompileToAST",
executable = ctx.attr.compiler[CompilerInfo].bsc,
arguments = [ast_args],
inputs = depset([src_file]),
outputs = [ast_file],
)
def _unique(l):
set = {}
for item in l:
set[item] = True
return set.keys()
def _join_path(is_windows, items):
parts = [item for item in items if item != ""]
if is_windows:
return "\\".join(parts)
return "/".join(parts)
def _collect_cmi_cmj_and_js_depset(deps):
return depset([], transitive = [depset(item) for item in [[
mod[RescriptModuleProvider].module_artifacts.cmi,
mod[RescriptModuleProvider].module_artifacts.cmj,
mod[RescriptModuleProvider].module_artifacts.js,
] for mod in deps]])
def _get_module_name(src):
return src.basename[:-4]
def _rescript_module_impl(ctx):
ast_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + ".ast"]))
_compile_to_ast(ctx, ctx.file.src, ast_file)
iast_file = None
if ctx.file.interface != None:
iast_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + ".iast"]))
_perhaps_compile_to_iast(ctx, ctx.file.interface, iast_file)
# Generate cmi, cmj, and js artifacts
cmi_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + ".cmi"]))
cmj_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + ".cmj"]))
js_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + ".js"]))
# includes dependencies's artifacts and js_file artifacts in the search paths.
deps_artifacts = _collect_cmi_cmj_and_js_depset(ctx.attr.deps)
dep_module_dirs = _unique([deps_artifact.dirname for deps_artifact in deps_artifacts.to_list()])
# Module without interface
if iast_file == None:
# Generates all targets cmi, cmj and js all at the same time.
cmi_cmj_js_args = ctx.actions.args()
cmi_cmj_js_args.add("-bs-v", "{{COMPILER_VERSION}}")
cmi_cmj_js_args.add("-I", cmi_file.dirname) # include the cmi dir.
for dep_module_dir in dep_module_dirs:
cmi_cmj_js_args.add("-I", dep_module_dir)
cmi_cmj_js_args.add("-o", cmi_file)
cmi_cmj_js_args.add("-o", cmj_file)
cmi_cmj_js_args.add(ast_file)
ctx.actions.run_shell(
mnemonic = "CompileToCmiCmjJs",
tools = [ctx.attr.compiler[CompilerInfo].bsc],
inputs = [ctx.file.src, ast_file] + deps_artifacts.to_list(),
outputs = [cmi_file, cmj_file, js_file],
command = "{} $@ > {}".format(ctx.attr.compiler[CompilerInfo].bsc.path, js_file.path),
arguments = [cmi_cmj_js_args],
)
else: # Module with interface provided.
# Generates cmi separately.
cmi_args = ctx.actions.args()
cmi_args.add("-I", ctx.file.interface.dirname)
for dep_module_dir in dep_module_dirs:
cmi_args.add("-I", dep_module_dir)
cmi_args.add("-o", cmi_file)
cmi_args.add(iast_file)
ctx.actions.run_shell(
mnemonic = "CompileToCmi",
tools = [ctx.attr.compiler[CompilerInfo].bsc],
inputs = [ctx.file.interface, iast_file] + deps_artifacts.to_list(),
outputs = [cmi_file],
command = "{} $@".format(ctx.attr.compiler[CompilerInfo].bsc.path),
arguments = [cmi_args],
)
# Generates cmj and js files
cmi_js_args = ctx.actions.args()
cmi_js_args.add("-bs-read-cmi") # Read the CMI file generated from previous step (from iAST file.)
cmi_js_args.add("-I", cmi_file.dirname) # include the cmi dir.
for dep_module_dir in dep_module_dirs:
cmi_js_args.add("-I", dep_module_dir)
cmi_js_args.add("-o", cmj_file)
cmi_js_args.add(ast_file)
ctx.actions.run_shell(
mnemonic = "CompileToCmjJs",
tools = [ctx.attr.compiler[CompilerInfo].bsc],
inputs = [ctx.file.src, ast_file, cmi_file] + deps_artifacts.to_list(),
outputs = [cmj_file, js_file],
command = "{} $@ > {}".format(ctx.attr.compiler[CompilerInfo].bsc.path, js_file.path),
arguments = [cmi_js_args],
)
module_artifacts = RescriptOutputArtifacts(
cmi = cmi_file,
cmj = cmj_file,
js = js_file,
)
js_files = [js_file]
output_files = [
module_artifacts.js,
module_artifacts.cmj,
module_artifacts.cmi,
]
return [
DefaultInfo(
files = depset(
output_files,
transitive = [dep[RescriptModuleProvider].js_depset for dep in ctx.attr.deps],
),
runfiles = ctx.runfiles(
files = ctx.files.data + [module_artifacts.js],
transitive_files = depset([], transitive = [dep[RescriptModuleProvider].data_depset for dep in ctx.attr.deps]),
),
),
RescriptModuleProvider(
js_depset = depset(js_files, transitive = [dep[RescriptModuleProvider].js_depset for dep in ctx.attr.deps]),
data_depset = depset(ctx.files.data, transitive = [dep[RescriptModuleProvider].data_depset for dep in ctx.attr.deps]),
module_artifacts = module_artifacts,
),
]
_rescript_module = rule(
implementation = _rescript_module_impl,
executable = False,
attrs = {
"compiler": attr.label(
default = Label("@{{REPO_NAME}}//compiler:darwin"),
providers = [CompilerInfo],
),
"is_windows": attr.bool(),
"src": attr.label(
doc = "Rescript source file",
allow_single_file = [".res"],
mandatory = True,
),
"interface": attr.label(
doc = "Rescript interface file",
allow_single_file = [".resi"],
),
"deps": attr.label_list(
doc = "List of dependencies, must be rescript_module targets.",
providers = [RescriptModuleProvider],
),
"data": attr.label_list(
doc = "List of data files to include at runtime (consumed by rescript_binary).",
allow_files = True,
),
},
)
def get_is_windows():
select(
{
"@platforms//os:windows": True,
"//conditions:default": False,
},
)
def get_compiler():
select(
{
"@platforms//os:osx": "@{{REPO_NAME}}//compiler:darwin",
"@platforms//os:windows": "@{{REPO_NAME}}//compiler:windows",
"@platforms//os:linux": "@{{REPO_NAME}}//compiler:linux",
"//conditions:default": None,
},
)
def rescript_module(
name,
src,
interface = None,
deps = [],
data = [],
**kwargs):
"""
Produces a rescript module's artifacts.
"""
_rescript_module(
name = name,
src = src,
interface = interface,
deps = deps,
data = data,
# Private attribute not expected to be provided
is_windows = get_is_windows(),
compiler = get_compiler(),
**kwargs
)
######################################################################################################
def _rescript_binary_impl(ctx):
srcFile = ctx.file.src
ast_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + ".ast"]))
_compile_to_ast(ctx, ctx.file.src, ast_file)
cmi_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + ".cmi"]))
cmj_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + ".cmj"]))
js_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + ".js"]))
deps_artifacts = _collect_cmi_cmj_and_js_depset(ctx.attr.deps)
dep_module_dirs = _unique([deps_artifact.dirname for deps_artifact in deps_artifacts.to_list()])
# Generates all targets cmi, cmj and js all at the same time.
cmi_cmj_js_args = ctx.actions.args()
cmi_cmj_js_args.add("-bs-v", "{{COMPILER_VERSION}}")
cmi_cmj_js_args.add("-I", cmi_file.dirname) # include the cmi dir.
for dep_module_dir in dep_module_dirs:
cmi_cmj_js_args.add("-I", dep_module_dir)
cmi_cmj_js_args.add("-o", cmi_file)
cmi_cmj_js_args.add("-o", cmj_file)
cmi_cmj_js_args.add(ast_file)
ctx.actions.run_shell(
mnemonic = "CompileToCmiCmjJs",
tools = [ctx.attr.compiler[CompilerInfo].bsc],
inputs = [ctx.file.src, ast_file] + deps_artifacts.to_list(),
outputs = [cmi_file, cmj_file, js_file],
command = "{} $@ > {}".format(ctx.attr.compiler[CompilerInfo].bsc.path, js_file.path),
arguments = [cmi_cmj_js_args],
)
return [
DefaultInfo(
executable = js_file,
runfiles = ctx.runfiles(
files = ctx.files.data,
transitive_files = depset(
[],
transitive = [dep[RescriptModuleProvider].data_depset for dep in ctx.attr.deps] + [dep[RescriptModuleProvider].js_depset for dep in ctx.attr.deps],
),
),
),
]
_rescript_binary = rule(
implementation = _rescript_binary_impl,
executable = True,
attrs = {
"compiler": attr.label(
default = Label("@{{REPO_NAME}}//compiler:darwin"),
providers = [CompilerInfo],
),
"is_windows": attr.bool(),
"src": attr.label(
doc = "Rescript source file",
mandatory = True,
allow_single_file = [".res"],
),
"deps": attr.label_list(
doc = "List of dependencies, must be rescript_module targets.",
providers = [RescriptModuleProvider],
),
"data": attr.label_list(
doc = "List of data files to include at runtime.",
allow_files = True,
),
},
)
def rescript_binary(
name,
src,
deps = [],
data = [],
**kwargs):
"""
Produces Js binary artifacts.
"""
_rescript_binary(
name = name,
src = src,
deps = deps,
data = data,
is_windows = get_is_windows(),
compiler = get_compiler(),
**kwargs
)
|
{{AUTO_GENERATED_NOTICE}}
compiler_info = provider(fields=['platform', 'bsc', 'bsb_helper'])
def _rescript_compiler_impl(ctx):
return [compiler_info(platform=ctx.attr.name, bsc=ctx.file.bsc, bsb_helper=ctx.file.bsb_helper)]
rescript_compiler = rule(implementation=_rescript_compiler_impl, attrs={'bsc': attr.label(allow_single_file=True, executable=True, cfg='exec'), 'bsb_helper': attr.label(allow_single_file=True, executable=True, cfg='exec')})
rescript_output_artifacts = provider(fields=['cmi', 'cmj', 'js'])
rescript_module_provider = provider(fields=['module_artifacts', 'js_depset', 'data_depset'])
def _perhaps_compile_to_iast(ctx, interface_file, iast_file):
if interface_file == None:
return None
iast_args = ctx.actions.args()
iast_args.add('-bs-v', '{{COMPILER_VERSION}}')
iast_args.add('-bs-ast')
iast_args.add('-o', iast_file)
iast_args.add(interface_file)
ctx.actions.run(mnemonic='CompileToiAST', executable=ctx.attr.compiler[CompilerInfo].bsc, arguments=[iast_args], inputs=depset([interface_file]), outputs=[iast_file])
def _compile_to_ast(ctx, src_file, ast_file):
ast_args = ctx.actions.args()
ast_args.add('-bs-v', '{{COMPILER_VERSION}}')
ast_args.add('-bs-ast')
ast_args.add('-o', ast_file)
ast_args.add(src_file)
ctx.actions.run(mnemonic='CompileToAST', executable=ctx.attr.compiler[CompilerInfo].bsc, arguments=[ast_args], inputs=depset([src_file]), outputs=[ast_file])
def _unique(l):
set = {}
for item in l:
set[item] = True
return set.keys()
def _join_path(is_windows, items):
parts = [item for item in items if item != '']
if is_windows:
return '\\'.join(parts)
return '/'.join(parts)
def _collect_cmi_cmj_and_js_depset(deps):
return depset([], transitive=[depset(item) for item in [[mod[RescriptModuleProvider].module_artifacts.cmi, mod[RescriptModuleProvider].module_artifacts.cmj, mod[RescriptModuleProvider].module_artifacts.js] for mod in deps]])
def _get_module_name(src):
return src.basename[:-4]
def _rescript_module_impl(ctx):
ast_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + '.ast']))
_compile_to_ast(ctx, ctx.file.src, ast_file)
iast_file = None
if ctx.file.interface != None:
iast_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + '.iast']))
_perhaps_compile_to_iast(ctx, ctx.file.interface, iast_file)
cmi_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + '.cmi']))
cmj_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + '.cmj']))
js_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [_get_module_name(ctx.file.src) + '.js']))
deps_artifacts = _collect_cmi_cmj_and_js_depset(ctx.attr.deps)
dep_module_dirs = _unique([deps_artifact.dirname for deps_artifact in deps_artifacts.to_list()])
if iast_file == None:
cmi_cmj_js_args = ctx.actions.args()
cmi_cmj_js_args.add('-bs-v', '{{COMPILER_VERSION}}')
cmi_cmj_js_args.add('-I', cmi_file.dirname)
for dep_module_dir in dep_module_dirs:
cmi_cmj_js_args.add('-I', dep_module_dir)
cmi_cmj_js_args.add('-o', cmi_file)
cmi_cmj_js_args.add('-o', cmj_file)
cmi_cmj_js_args.add(ast_file)
ctx.actions.run_shell(mnemonic='CompileToCmiCmjJs', tools=[ctx.attr.compiler[CompilerInfo].bsc], inputs=[ctx.file.src, ast_file] + deps_artifacts.to_list(), outputs=[cmi_file, cmj_file, js_file], command='{} $@ > {}'.format(ctx.attr.compiler[CompilerInfo].bsc.path, js_file.path), arguments=[cmi_cmj_js_args])
else:
cmi_args = ctx.actions.args()
cmi_args.add('-I', ctx.file.interface.dirname)
for dep_module_dir in dep_module_dirs:
cmi_args.add('-I', dep_module_dir)
cmi_args.add('-o', cmi_file)
cmi_args.add(iast_file)
ctx.actions.run_shell(mnemonic='CompileToCmi', tools=[ctx.attr.compiler[CompilerInfo].bsc], inputs=[ctx.file.interface, iast_file] + deps_artifacts.to_list(), outputs=[cmi_file], command='{} $@'.format(ctx.attr.compiler[CompilerInfo].bsc.path), arguments=[cmi_args])
cmi_js_args = ctx.actions.args()
cmi_js_args.add('-bs-read-cmi')
cmi_js_args.add('-I', cmi_file.dirname)
for dep_module_dir in dep_module_dirs:
cmi_js_args.add('-I', dep_module_dir)
cmi_js_args.add('-o', cmj_file)
cmi_js_args.add(ast_file)
ctx.actions.run_shell(mnemonic='CompileToCmjJs', tools=[ctx.attr.compiler[CompilerInfo].bsc], inputs=[ctx.file.src, ast_file, cmi_file] + deps_artifacts.to_list(), outputs=[cmj_file, js_file], command='{} $@ > {}'.format(ctx.attr.compiler[CompilerInfo].bsc.path, js_file.path), arguments=[cmi_js_args])
module_artifacts = rescript_output_artifacts(cmi=cmi_file, cmj=cmj_file, js=js_file)
js_files = [js_file]
output_files = [module_artifacts.js, module_artifacts.cmj, module_artifacts.cmi]
return [default_info(files=depset(output_files, transitive=[dep[RescriptModuleProvider].js_depset for dep in ctx.attr.deps]), runfiles=ctx.runfiles(files=ctx.files.data + [module_artifacts.js], transitive_files=depset([], transitive=[dep[RescriptModuleProvider].data_depset for dep in ctx.attr.deps]))), rescript_module_provider(js_depset=depset(js_files, transitive=[dep[RescriptModuleProvider].js_depset for dep in ctx.attr.deps]), data_depset=depset(ctx.files.data, transitive=[dep[RescriptModuleProvider].data_depset for dep in ctx.attr.deps]), module_artifacts=module_artifacts)]
_rescript_module = rule(implementation=_rescript_module_impl, executable=False, attrs={'compiler': attr.label(default=label('@{{REPO_NAME}}//compiler:darwin'), providers=[CompilerInfo]), 'is_windows': attr.bool(), 'src': attr.label(doc='Rescript source file', allow_single_file=['.res'], mandatory=True), 'interface': attr.label(doc='Rescript interface file', allow_single_file=['.resi']), 'deps': attr.label_list(doc='List of dependencies, must be rescript_module targets.', providers=[RescriptModuleProvider]), 'data': attr.label_list(doc='List of data files to include at runtime (consumed by rescript_binary).', allow_files=True)})
def get_is_windows():
select({'@platforms//os:windows': True, '//conditions:default': False})
def get_compiler():
select({'@platforms//os:osx': '@{{REPO_NAME}}//compiler:darwin', '@platforms//os:windows': '@{{REPO_NAME}}//compiler:windows', '@platforms//os:linux': '@{{REPO_NAME}}//compiler:linux', '//conditions:default': None})
def rescript_module(name, src, interface=None, deps=[], data=[], **kwargs):
"""
Produces a rescript module's artifacts.
"""
_rescript_module(name=name, src=src, interface=interface, deps=deps, data=data, is_windows=get_is_windows(), compiler=get_compiler(), **kwargs)
def _rescript_binary_impl(ctx):
src_file = ctx.file.src
ast_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + '.ast']))
_compile_to_ast(ctx, ctx.file.src, ast_file)
cmi_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + '.cmi']))
cmj_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + '.cmj']))
js_file = ctx.actions.declare_file(_join_path(ctx.attr.is_windows, [ctx.label.name + '.js']))
deps_artifacts = _collect_cmi_cmj_and_js_depset(ctx.attr.deps)
dep_module_dirs = _unique([deps_artifact.dirname for deps_artifact in deps_artifacts.to_list()])
cmi_cmj_js_args = ctx.actions.args()
cmi_cmj_js_args.add('-bs-v', '{{COMPILER_VERSION}}')
cmi_cmj_js_args.add('-I', cmi_file.dirname)
for dep_module_dir in dep_module_dirs:
cmi_cmj_js_args.add('-I', dep_module_dir)
cmi_cmj_js_args.add('-o', cmi_file)
cmi_cmj_js_args.add('-o', cmj_file)
cmi_cmj_js_args.add(ast_file)
ctx.actions.run_shell(mnemonic='CompileToCmiCmjJs', tools=[ctx.attr.compiler[CompilerInfo].bsc], inputs=[ctx.file.src, ast_file] + deps_artifacts.to_list(), outputs=[cmi_file, cmj_file, js_file], command='{} $@ > {}'.format(ctx.attr.compiler[CompilerInfo].bsc.path, js_file.path), arguments=[cmi_cmj_js_args])
return [default_info(executable=js_file, runfiles=ctx.runfiles(files=ctx.files.data, transitive_files=depset([], transitive=[dep[RescriptModuleProvider].data_depset for dep in ctx.attr.deps] + [dep[RescriptModuleProvider].js_depset for dep in ctx.attr.deps])))]
_rescript_binary = rule(implementation=_rescript_binary_impl, executable=True, attrs={'compiler': attr.label(default=label('@{{REPO_NAME}}//compiler:darwin'), providers=[CompilerInfo]), 'is_windows': attr.bool(), 'src': attr.label(doc='Rescript source file', mandatory=True, allow_single_file=['.res']), 'deps': attr.label_list(doc='List of dependencies, must be rescript_module targets.', providers=[RescriptModuleProvider]), 'data': attr.label_list(doc='List of data files to include at runtime.', allow_files=True)})
def rescript_binary(name, src, deps=[], data=[], **kwargs):
"""
Produces Js binary artifacts.
"""
_rescript_binary(name=name, src=src, deps=deps, data=data, is_windows=get_is_windows(), compiler=get_compiler(), **kwargs)
|
# https://leetcode.com/explore/featured/card/fun-with-arrays/521/introduction/3238/
class Solution:
def findMaxConsecutiveOnes(self, nums):
left = 0
prev = 0
while left < len(nums):
counter = 0
if nums[left] == 1:
right = left
while right < len(nums):
if nums[right] == 1:
counter += 1
right += 1
else:
break
right += 1
left = right
else:
left += 1
if counter > prev:
prev = counter
return prev
if __name__ == "__main__":
assert Solution().findMaxConsecutiveOnes([0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]) == 6
assert Solution().findMaxConsecutiveOnes([0, 1]) == 1
|
class Solution:
def find_max_consecutive_ones(self, nums):
left = 0
prev = 0
while left < len(nums):
counter = 0
if nums[left] == 1:
right = left
while right < len(nums):
if nums[right] == 1:
counter += 1
right += 1
else:
break
right += 1
left = right
else:
left += 1
if counter > prev:
prev = counter
return prev
if __name__ == '__main__':
assert solution().findMaxConsecutiveOnes([0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]) == 6
assert solution().findMaxConsecutiveOnes([0, 1]) == 1
|
class Solution(object):
def minTimeToVisitAllPoints(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
current_pos, time = points[0], 0
for p in points:
if current_pos[0] != p[0] or current_pos[1] != p[1]:
delta_x = abs(p[0]-current_pos[0])
delta_y = abs(p[1]-current_pos[1])
time += max(delta_x, delta_y)
current_pos = p
return time
s = Solution()
print("Solution 1 : ", s.minTimeToVisitAllPoints([[1, 1], [3, 4], [-1, 0]]))
print("Solution 2 : ", s.minTimeToVisitAllPoints([[3, 2], [-2, 2]]))
|
class Solution(object):
def min_time_to_visit_all_points(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
(current_pos, time) = (points[0], 0)
for p in points:
if current_pos[0] != p[0] or current_pos[1] != p[1]:
delta_x = abs(p[0] - current_pos[0])
delta_y = abs(p[1] - current_pos[1])
time += max(delta_x, delta_y)
current_pos = p
return time
s = solution()
print('Solution 1 : ', s.minTimeToVisitAllPoints([[1, 1], [3, 4], [-1, 0]]))
print('Solution 2 : ', s.minTimeToVisitAllPoints([[3, 2], [-2, 2]]))
|
#
# PySNMP MIB module Nortel-Magellan-Passport-FrameRelayNniTraceMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-FrameRelayNniTraceMIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:17:48 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint")
frNni, frNniIndex = mibBuilder.importSymbols("Nortel-Magellan-Passport-FrameRelayNniMIB", "frNni", "frNniIndex")
Unsigned32, DisplayString, RowPointer, StorageType, RowStatus = mibBuilder.importSymbols("Nortel-Magellan-Passport-StandardTextualConventionsMIB", "Unsigned32", "DisplayString", "RowPointer", "StorageType", "RowStatus")
NonReplicated, AsciiString = mibBuilder.importSymbols("Nortel-Magellan-Passport-TextualConventionsMIB", "NonReplicated", "AsciiString")
passportMIBs, = mibBuilder.importSymbols("Nortel-Magellan-Passport-UsefulDefinitionsMIB", "passportMIBs")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Unsigned32, TimeTicks, Counter32, Counter64, Bits, ObjectIdentity, Gauge32, Integer32, ModuleIdentity, IpAddress, MibIdentifier, NotificationType, iso, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "TimeTicks", "Counter32", "Counter64", "Bits", "ObjectIdentity", "Gauge32", "Integer32", "ModuleIdentity", "IpAddress", "MibIdentifier", "NotificationType", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
frameRelayNniTraceMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106))
frNniTrace = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7))
frNniTraceRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1), )
if mibBuilder.loadTexts: frNniTraceRowStatusTable.setStatus('mandatory')
frNniTraceRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"))
if mibBuilder.loadTexts: frNniTraceRowStatusEntry.setStatus('mandatory')
frNniTraceRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceRowStatus.setStatus('mandatory')
frNniTraceComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceComponentName.setStatus('mandatory')
frNniTraceStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceStorageType.setStatus('mandatory')
frNniTraceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frNniTraceIndex.setStatus('mandatory')
frNniTraceOperationalTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10), )
if mibBuilder.loadTexts: frNniTraceOperationalTable.setStatus('mandatory')
frNniTraceOperationalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"))
if mibBuilder.loadTexts: frNniTraceOperationalEntry.setStatus('mandatory')
frNniTraceReceiverName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 2), AsciiString().subtype(subtypeSpec=ValueSizeConstraint(0, 8))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceReceiverName.setStatus('mandatory')
frNniTraceDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 9999)).clone(60)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceDuration.setStatus('mandatory')
frNniTraceQueueLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(20)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceQueueLimit.setStatus('mandatory')
frNniTraceSession = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 5), RowPointer()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceSession.setStatus('mandatory')
frNniTraceFilter = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2))
frNniTraceFilterRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1), )
if mibBuilder.loadTexts: frNniTraceFilterRowStatusTable.setStatus('mandatory')
frNniTraceFilterRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceFilterIndex"))
if mibBuilder.loadTexts: frNniTraceFilterRowStatusEntry.setStatus('mandatory')
frNniTraceFilterRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceFilterRowStatus.setStatus('mandatory')
frNniTraceFilterComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceFilterComponentName.setStatus('mandatory')
frNniTraceFilterStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: frNniTraceFilterStorageType.setStatus('mandatory')
frNniTraceFilterIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: frNniTraceFilterIndex.setStatus('mandatory')
frNniTraceFilterOperationalTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10), )
if mibBuilder.loadTexts: frNniTraceFilterOperationalTable.setStatus('mandatory')
frNniTraceFilterOperationalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-FrameRelayNniMIB", "frNniIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceIndex"), (0, "Nortel-Magellan-Passport-FrameRelayNniTraceMIB", "frNniTraceFilterIndex"))
if mibBuilder.loadTexts: frNniTraceFilterOperationalEntry.setStatus('mandatory')
frNniTraceFilterTraceType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1).clone(hexValue="e0")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterTraceType.setStatus('mandatory')
frNniTraceFilterTracedDlci = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 1007))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterTracedDlci.setStatus('mandatory')
frNniTraceFilterDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1).clone(hexValue="c0")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterDirection.setStatus('mandatory')
frNniTraceFilterTracedLength = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2000)).clone(2000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: frNniTraceFilterTracedLength.setStatus('mandatory')
frameRelayNniTraceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1))
frameRelayNniTraceGroupBD = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4))
frameRelayNniTraceGroupBD01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2))
frameRelayNniTraceGroupBD01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2, 2))
frameRelayNniTraceCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3))
frameRelayNniTraceCapabilitiesBD = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4))
frameRelayNniTraceCapabilitiesBD01 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2))
frameRelayNniTraceCapabilitiesBD01A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2, 2))
mibBuilder.exportSymbols("Nortel-Magellan-Passport-FrameRelayNniTraceMIB", frNniTraceFilterDirection=frNniTraceFilterDirection, frNniTraceReceiverName=frNniTraceReceiverName, frNniTraceFilterStorageType=frNniTraceFilterStorageType, frNniTraceRowStatusTable=frNniTraceRowStatusTable, frameRelayNniTraceCapabilities=frameRelayNniTraceCapabilities, frNniTraceIndex=frNniTraceIndex, frNniTraceRowStatusEntry=frNniTraceRowStatusEntry, frNniTraceFilterOperationalEntry=frNniTraceFilterOperationalEntry, frNniTraceFilterRowStatusTable=frNniTraceFilterRowStatusTable, frNniTraceFilterTraceType=frNniTraceFilterTraceType, frNniTraceFilterIndex=frNniTraceFilterIndex, frameRelayNniTraceCapabilitiesBD=frameRelayNniTraceCapabilitiesBD, frameRelayNniTraceCapabilitiesBD01A=frameRelayNniTraceCapabilitiesBD01A, frNniTraceFilterRowStatus=frNniTraceFilterRowStatus, frameRelayNniTraceGroup=frameRelayNniTraceGroup, frNniTrace=frNniTrace, frNniTraceComponentName=frNniTraceComponentName, frameRelayNniTraceCapabilitiesBD01=frameRelayNniTraceCapabilitiesBD01, frNniTraceFilterRowStatusEntry=frNniTraceFilterRowStatusEntry, frameRelayNniTraceGroupBD01A=frameRelayNniTraceGroupBD01A, frNniTraceSession=frNniTraceSession, frameRelayNniTraceMIB=frameRelayNniTraceMIB, frNniTraceQueueLimit=frNniTraceQueueLimit, frNniTraceFilterOperationalTable=frNniTraceFilterOperationalTable, frNniTraceOperationalEntry=frNniTraceOperationalEntry, frameRelayNniTraceGroupBD=frameRelayNniTraceGroupBD, frNniTraceFilterTracedLength=frNniTraceFilterTracedLength, frNniTraceOperationalTable=frNniTraceOperationalTable, frameRelayNniTraceGroupBD01=frameRelayNniTraceGroupBD01, frNniTraceFilterComponentName=frNniTraceFilterComponentName, frNniTraceDuration=frNniTraceDuration, frNniTraceStorageType=frNniTraceStorageType, frNniTraceRowStatus=frNniTraceRowStatus, frNniTraceFilter=frNniTraceFilter, frNniTraceFilterTracedDlci=frNniTraceFilterTracedDlci)
|
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, single_value_constraint, constraints_intersection, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueSizeConstraint')
(fr_nni, fr_nni_index) = mibBuilder.importSymbols('Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNni', 'frNniIndex')
(unsigned32, display_string, row_pointer, storage_type, row_status) = mibBuilder.importSymbols('Nortel-Magellan-Passport-StandardTextualConventionsMIB', 'Unsigned32', 'DisplayString', 'RowPointer', 'StorageType', 'RowStatus')
(non_replicated, ascii_string) = mibBuilder.importSymbols('Nortel-Magellan-Passport-TextualConventionsMIB', 'NonReplicated', 'AsciiString')
(passport_mi_bs,) = mibBuilder.importSymbols('Nortel-Magellan-Passport-UsefulDefinitionsMIB', 'passportMIBs')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(unsigned32, time_ticks, counter32, counter64, bits, object_identity, gauge32, integer32, module_identity, ip_address, mib_identifier, notification_type, iso, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'TimeTicks', 'Counter32', 'Counter64', 'Bits', 'ObjectIdentity', 'Gauge32', 'Integer32', 'ModuleIdentity', 'IpAddress', 'MibIdentifier', 'NotificationType', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
frame_relay_nni_trace_mib = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106))
fr_nni_trace = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7))
fr_nni_trace_row_status_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1))
if mibBuilder.loadTexts:
frNniTraceRowStatusTable.setStatus('mandatory')
fr_nni_trace_row_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'))
if mibBuilder.loadTexts:
frNniTraceRowStatusEntry.setStatus('mandatory')
fr_nni_trace_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 1), row_status()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceRowStatus.setStatus('mandatory')
fr_nni_trace_component_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceComponentName.setStatus('mandatory')
fr_nni_trace_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 4), storage_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceStorageType.setStatus('mandatory')
fr_nni_trace_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 1, 1, 10), non_replicated())
if mibBuilder.loadTexts:
frNniTraceIndex.setStatus('mandatory')
fr_nni_trace_operational_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10))
if mibBuilder.loadTexts:
frNniTraceOperationalTable.setStatus('mandatory')
fr_nni_trace_operational_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'))
if mibBuilder.loadTexts:
frNniTraceOperationalEntry.setStatus('mandatory')
fr_nni_trace_receiver_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 2), ascii_string().subtype(subtypeSpec=value_size_constraint(0, 8))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceReceiverName.setStatus('mandatory')
fr_nni_trace_duration = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 9999)).clone(60)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceDuration.setStatus('mandatory')
fr_nni_trace_queue_limit = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 100)).clone(20)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceQueueLimit.setStatus('mandatory')
fr_nni_trace_session = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 10, 1, 5), row_pointer()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceSession.setStatus('mandatory')
fr_nni_trace_filter = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2))
fr_nni_trace_filter_row_status_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1))
if mibBuilder.loadTexts:
frNniTraceFilterRowStatusTable.setStatus('mandatory')
fr_nni_trace_filter_row_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceFilterIndex'))
if mibBuilder.loadTexts:
frNniTraceFilterRowStatusEntry.setStatus('mandatory')
fr_nni_trace_filter_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 1), row_status()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceFilterRowStatus.setStatus('mandatory')
fr_nni_trace_filter_component_name = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceFilterComponentName.setStatus('mandatory')
fr_nni_trace_filter_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 4), storage_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
frNniTraceFilterStorageType.setStatus('mandatory')
fr_nni_trace_filter_index = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 1, 1, 10), non_replicated())
if mibBuilder.loadTexts:
frNniTraceFilterIndex.setStatus('mandatory')
fr_nni_trace_filter_operational_table = mib_table((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10))
if mibBuilder.loadTexts:
frNniTraceFilterOperationalTable.setStatus('mandatory')
fr_nni_trace_filter_operational_entry = mib_table_row((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1)).setIndexNames((0, 'Nortel-Magellan-Passport-FrameRelayNniMIB', 'frNniIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceIndex'), (0, 'Nortel-Magellan-Passport-FrameRelayNniTraceMIB', 'frNniTraceFilterIndex'))
if mibBuilder.loadTexts:
frNniTraceFilterOperationalEntry.setStatus('mandatory')
fr_nni_trace_filter_trace_type = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1).clone(hexValue='e0')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterTraceType.setStatus('mandatory')
fr_nni_trace_filter_traced_dlci = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 1007))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterTracedDlci.setStatus('mandatory')
fr_nni_trace_filter_direction = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1).clone(hexValue='c0')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterDirection.setStatus('mandatory')
fr_nni_trace_filter_traced_length = mib_table_column((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 70, 7, 2, 10, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 2000)).clone(2000)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
frNniTraceFilterTracedLength.setStatus('mandatory')
frame_relay_nni_trace_group = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1))
frame_relay_nni_trace_group_bd = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4))
frame_relay_nni_trace_group_bd01 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2))
frame_relay_nni_trace_group_bd01_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 1, 4, 2, 2))
frame_relay_nni_trace_capabilities = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3))
frame_relay_nni_trace_capabilities_bd = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4))
frame_relay_nni_trace_capabilities_bd01 = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2))
frame_relay_nni_trace_capabilities_bd01_a = mib_identifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 106, 3, 4, 2, 2))
mibBuilder.exportSymbols('Nortel-Magellan-Passport-FrameRelayNniTraceMIB', frNniTraceFilterDirection=frNniTraceFilterDirection, frNniTraceReceiverName=frNniTraceReceiverName, frNniTraceFilterStorageType=frNniTraceFilterStorageType, frNniTraceRowStatusTable=frNniTraceRowStatusTable, frameRelayNniTraceCapabilities=frameRelayNniTraceCapabilities, frNniTraceIndex=frNniTraceIndex, frNniTraceRowStatusEntry=frNniTraceRowStatusEntry, frNniTraceFilterOperationalEntry=frNniTraceFilterOperationalEntry, frNniTraceFilterRowStatusTable=frNniTraceFilterRowStatusTable, frNniTraceFilterTraceType=frNniTraceFilterTraceType, frNniTraceFilterIndex=frNniTraceFilterIndex, frameRelayNniTraceCapabilitiesBD=frameRelayNniTraceCapabilitiesBD, frameRelayNniTraceCapabilitiesBD01A=frameRelayNniTraceCapabilitiesBD01A, frNniTraceFilterRowStatus=frNniTraceFilterRowStatus, frameRelayNniTraceGroup=frameRelayNniTraceGroup, frNniTrace=frNniTrace, frNniTraceComponentName=frNniTraceComponentName, frameRelayNniTraceCapabilitiesBD01=frameRelayNniTraceCapabilitiesBD01, frNniTraceFilterRowStatusEntry=frNniTraceFilterRowStatusEntry, frameRelayNniTraceGroupBD01A=frameRelayNniTraceGroupBD01A, frNniTraceSession=frNniTraceSession, frameRelayNniTraceMIB=frameRelayNniTraceMIB, frNniTraceQueueLimit=frNniTraceQueueLimit, frNniTraceFilterOperationalTable=frNniTraceFilterOperationalTable, frNniTraceOperationalEntry=frNniTraceOperationalEntry, frameRelayNniTraceGroupBD=frameRelayNniTraceGroupBD, frNniTraceFilterTracedLength=frNniTraceFilterTracedLength, frNniTraceOperationalTable=frNniTraceOperationalTable, frameRelayNniTraceGroupBD01=frameRelayNniTraceGroupBD01, frNniTraceFilterComponentName=frNniTraceFilterComponentName, frNniTraceDuration=frNniTraceDuration, frNniTraceStorageType=frNniTraceStorageType, frNniTraceRowStatus=frNniTraceRowStatus, frNniTraceFilter=frNniTraceFilter, frNniTraceFilterTracedDlci=frNniTraceFilterTracedDlci)
|
RSS_PERF_NAME = "rss"
FLT_PERF_NAME = "flt"
CPU_CLOCK_PERF_NAME = "cpu_clock"
TSK_CLOCK_PERF_NAME = "task_clock"
SIZE_PERF_NAME = "file_size"
EXEC_OVER_HEAD_KEY = 'exec'
MEM_USE_OVER_HEAD_KEY = 'mem'
FILE_SIZE_OVER_HEAD_KEY = 'size'
|
rss_perf_name = 'rss'
flt_perf_name = 'flt'
cpu_clock_perf_name = 'cpu_clock'
tsk_clock_perf_name = 'task_clock'
size_perf_name = 'file_size'
exec_over_head_key = 'exec'
mem_use_over_head_key = 'mem'
file_size_over_head_key = 'size'
|
LINE_LEN = 25
while True:
try:
n = int(input())
if n == 0:
break
surface = []
max_len = 0
for i in range(n):
line = str(input())
line = line.strip()
l_space = line.find(' ')
if l_space == -1:
max_len = LINE_LEN
else:
r_space = line.rfind(' ')
cur_len = l_space + LINE_LEN - r_space - 1
if cur_len > max_len:
max_len = cur_len
surface.append(cur_len)
res = sum(map(lambda x: max_len - x, surface))
print(res)
except(EOFError):
break
|
line_len = 25
while True:
try:
n = int(input())
if n == 0:
break
surface = []
max_len = 0
for i in range(n):
line = str(input())
line = line.strip()
l_space = line.find(' ')
if l_space == -1:
max_len = LINE_LEN
else:
r_space = line.rfind(' ')
cur_len = l_space + LINE_LEN - r_space - 1
if cur_len > max_len:
max_len = cur_len
surface.append(cur_len)
res = sum(map(lambda x: max_len - x, surface))
print(res)
except EOFError:
break
|
f = open('rosalind_motif.txt')
a = []
for line in f.readlines():
a.append(line.strip())
dna1, dna2 = a[0], a[1]
f.close()
def find_motif(dna1, dna2):
"""Given: Two DNA strings s and t (each of length at most 1 kbp).
Return: All locations of t as a substring of s."""
k = len(dna2)
indexes = []
for i in range(len(dna1)-k+1):
if dna1[i:i+k] == dna2:
indexes.append(str(i+1))
print(" ".join(indexes))
find_motif(dna1, dna2)
|
f = open('rosalind_motif.txt')
a = []
for line in f.readlines():
a.append(line.strip())
(dna1, dna2) = (a[0], a[1])
f.close()
def find_motif(dna1, dna2):
"""Given: Two DNA strings s and t (each of length at most 1 kbp).
Return: All locations of t as a substring of s."""
k = len(dna2)
indexes = []
for i in range(len(dna1) - k + 1):
if dna1[i:i + k] == dna2:
indexes.append(str(i + 1))
print(' '.join(indexes))
find_motif(dna1, dna2)
|
class Solution:
def findMin(self, nums: List[int]) -> int:
# solution 1
# return min(nums)
# solution 2
left = 0
right = len(nums)-1
while left < right:
mid = int((left + right)/2)
if nums[mid] < nums[right]:
right = mid
elif nums[mid] == nums[right]:
right = right - 1
else:
left = mid+1
return nums[left]
|
class Solution:
def find_min(self, nums: List[int]) -> int:
left = 0
right = len(nums) - 1
while left < right:
mid = int((left + right) / 2)
if nums[mid] < nums[right]:
right = mid
elif nums[mid] == nums[right]:
right = right - 1
else:
left = mid + 1
return nums[left]
|
def cyclicQ(ll):
da_node = ll
sentient = ll
poop = ll
poop = poop.next.next
ll = ll.next
while poop != ll and poop is not None and poop.next is not None:
poop = poop.next.next
ll = ll.next
if poop is None or poop.next is None:
return None
node_in_cycle = ll
while ll.next != node_in_cycle:
ll = ll.next
da_node = da_node.next
da_node = da_node.next
while sentient != da_node:
sentient = sentient.next
da_node = da_node.next
return da_node
|
def cyclic_q(ll):
da_node = ll
sentient = ll
poop = ll
poop = poop.next.next
ll = ll.next
while poop != ll and poop is not None and (poop.next is not None):
poop = poop.next.next
ll = ll.next
if poop is None or poop.next is None:
return None
node_in_cycle = ll
while ll.next != node_in_cycle:
ll = ll.next
da_node = da_node.next
da_node = da_node.next
while sentient != da_node:
sentient = sentient.next
da_node = da_node.next
return da_node
|
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
class Trace:
'''An object that can cause a trace entry'''
def trace(self) -> str:
'''Return a representation of the entry for tracing
This is used by things like the standalone ISS with -v
'''
raise NotImplementedError()
class TracePC(Trace):
def __init__(self, pc: int):
self.pc = pc
def trace(self) -> str:
return "pc = {:#x}".format(self.pc)
|
class Trace:
"""An object that can cause a trace entry"""
def trace(self) -> str:
"""Return a representation of the entry for tracing
This is used by things like the standalone ISS with -v
"""
raise not_implemented_error()
class Tracepc(Trace):
def __init__(self, pc: int):
self.pc = pc
def trace(self) -> str:
return 'pc = {:#x}'.format(self.pc)
|
WAGTAILSEARCH_BACKENDS = {
"default": {"BACKEND": "wagtail.contrib.postgres_search.backend"}
}
|
wagtailsearch_backends = {'default': {'BACKEND': 'wagtail.contrib.postgres_search.backend'}}
|
def key_in_dict_not_empty(key, dictionary):
"""
"""
if key in dictionary:
return is_not_empty(dictionary[key])
return False
def is_empty(value):
"""
"""
if value is None:
return True
return value in ['', [], {}]
def is_not_empty(value):
return not is_empty(value)
def drop_dupplicates_values(values):
seen = set()
seen_add = seen.add
return [x for x in values if not (x in seen or seen_add(x))]
|
def key_in_dict_not_empty(key, dictionary):
"""
"""
if key in dictionary:
return is_not_empty(dictionary[key])
return False
def is_empty(value):
"""
"""
if value is None:
return True
return value in ['', [], {}]
def is_not_empty(value):
return not is_empty(value)
def drop_dupplicates_values(values):
seen = set()
seen_add = seen.add
return [x for x in values if not (x in seen or seen_add(x))]
|
# https://www.codingame.com/training/easy/1d-spreadsheet
def add_dependency(cell, arg_cell, in_deps, out_deps):
if cell not in out_deps: out_deps[cell] = set()
out_deps[cell].add(arg_cell)
if arg_cell not in in_deps: in_deps[arg_cell] = set()
in_deps[arg_cell].add(cell)
def remove_dependency(cell, in_deps, out_deps):
rc = []
if cell not in in_deps: return rc
for o in in_deps[cell]:
if cell in out_deps[o]:
out_deps[o].remove(cell)
if not out_deps[o]:
rc.append(o)
return rc
def evaluate_dependencies(cells, in_deps, out_deps, cell_operations):
ready_cells = set()
evaluated_cells = set()
for cell in out_deps:
if not out_deps[cell]:
ready_cells.add(cell)
while ready_cells:
cell = ready_cells.pop()
evaluated_cells.add(cell)
perform_operation(cell=cell, **cell_operations[cell], cells=cells)
rc = remove_dependency(cell, in_deps, out_deps)
ready_cells.update([o for o in rc if o not in evaluated_cells])
for cell in cells:
print(cell)
def get_arg_val(arg, cells):
if '$' in arg:
return cells[int(arg[1:])]
elif '_' in arg:
return 0
else:
return int(arg)
def perform_operation(cell, operation, arg1, arg2, cells):
val1 = get_arg_val(arg1, cells)
val2 = get_arg_val(arg2, cells)
if operation == 'VALUE':
cells[cell] = val1
elif operation == 'ADD':
cells[cell] = val1 + val2
elif operation == 'SUB':
cells[cell] = val1 - val2
else:
cells[cell] = val1 * val2
def solution():
num_cells = int(input())
in_deps = {}
out_deps = {}
cells = [0] * num_cells
cell_operations = [{} for _ in range(num_cells)]
for cell in range(num_cells):
operation, arg1, arg2 = input().split()
cell_operations[cell] = {
'operation': operation,
'arg1': arg1,
'arg2': arg2
}
if cell not in out_deps: out_deps[cell] = set()
if '$' in arg1: add_dependency(cell, int(arg1[1:]), in_deps, out_deps)
if '$' in arg2: add_dependency(cell, int(arg2[1:]), in_deps, out_deps)
evaluate_dependencies(cells, in_deps, out_deps, cell_operations)
solution()
|
def add_dependency(cell, arg_cell, in_deps, out_deps):
if cell not in out_deps:
out_deps[cell] = set()
out_deps[cell].add(arg_cell)
if arg_cell not in in_deps:
in_deps[arg_cell] = set()
in_deps[arg_cell].add(cell)
def remove_dependency(cell, in_deps, out_deps):
rc = []
if cell not in in_deps:
return rc
for o in in_deps[cell]:
if cell in out_deps[o]:
out_deps[o].remove(cell)
if not out_deps[o]:
rc.append(o)
return rc
def evaluate_dependencies(cells, in_deps, out_deps, cell_operations):
ready_cells = set()
evaluated_cells = set()
for cell in out_deps:
if not out_deps[cell]:
ready_cells.add(cell)
while ready_cells:
cell = ready_cells.pop()
evaluated_cells.add(cell)
perform_operation(cell=cell, **cell_operations[cell], cells=cells)
rc = remove_dependency(cell, in_deps, out_deps)
ready_cells.update([o for o in rc if o not in evaluated_cells])
for cell in cells:
print(cell)
def get_arg_val(arg, cells):
if '$' in arg:
return cells[int(arg[1:])]
elif '_' in arg:
return 0
else:
return int(arg)
def perform_operation(cell, operation, arg1, arg2, cells):
val1 = get_arg_val(arg1, cells)
val2 = get_arg_val(arg2, cells)
if operation == 'VALUE':
cells[cell] = val1
elif operation == 'ADD':
cells[cell] = val1 + val2
elif operation == 'SUB':
cells[cell] = val1 - val2
else:
cells[cell] = val1 * val2
def solution():
num_cells = int(input())
in_deps = {}
out_deps = {}
cells = [0] * num_cells
cell_operations = [{} for _ in range(num_cells)]
for cell in range(num_cells):
(operation, arg1, arg2) = input().split()
cell_operations[cell] = {'operation': operation, 'arg1': arg1, 'arg2': arg2}
if cell not in out_deps:
out_deps[cell] = set()
if '$' in arg1:
add_dependency(cell, int(arg1[1:]), in_deps, out_deps)
if '$' in arg2:
add_dependency(cell, int(arg2[1:]), in_deps, out_deps)
evaluate_dependencies(cells, in_deps, out_deps, cell_operations)
solution()
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Word:
def __init__(self, id, name, image, category=None):
self.id = id
self.name = name
self.image = image
self.category = category
|
class Word:
def __init__(self, id, name, image, category=None):
self.id = id
self.name = name
self.image = image
self.category = category
|
def optimal_order(predecessors_map, weight_map):
vertices = frozenset(predecessors_map.keys())
# print(vertices)
memo_map = {frozenset(): (0, [])}
# print(memo_map)
return optimal_order_helper(predecessors_map, weight_map, vertices, memo_map)
def optimal_order_helper(predecessors_map, weight_map, vertices, memo_map):
if vertices in memo_map:
return memo_map[vertices]
possibilities = []
# koop through my verticies (number reducing by 1 each time)
for v in vertices:
# use DFS to get to either x or v which are the 2 smallest numbers
if any(u in vertices for u in predecessors_map[v]):
continue
sub_obj, sub_order = optimal_order_helper(predecessors_map, weight_map, vertices - frozenset({v}), memo_map)
# x + x*y + x*y*z = x*(1 + y*(1 + z))
possibilities.append((weight_map[v] * (1.0 + sub_obj), [v] + sub_order))
print(possibilities)
best = min(possibilities)
memo_map[vertices] = best
# print(memo_map)
return best
print(optimal_order({'u': [], 'v': ['u'], 'w': [], 'x': ['w']}, {'u': 1.2, 'v': 0.5, 'w': 1.1, 'x': 1.001}))
|
def optimal_order(predecessors_map, weight_map):
vertices = frozenset(predecessors_map.keys())
memo_map = {frozenset(): (0, [])}
return optimal_order_helper(predecessors_map, weight_map, vertices, memo_map)
def optimal_order_helper(predecessors_map, weight_map, vertices, memo_map):
if vertices in memo_map:
return memo_map[vertices]
possibilities = []
for v in vertices:
if any((u in vertices for u in predecessors_map[v])):
continue
(sub_obj, sub_order) = optimal_order_helper(predecessors_map, weight_map, vertices - frozenset({v}), memo_map)
possibilities.append((weight_map[v] * (1.0 + sub_obj), [v] + sub_order))
print(possibilities)
best = min(possibilities)
memo_map[vertices] = best
return best
print(optimal_order({'u': [], 'v': ['u'], 'w': [], 'x': ['w']}, {'u': 1.2, 'v': 0.5, 'w': 1.1, 'x': 1.001}))
|
# Program to implement First Come First Served CPU scheduling algorithm
print("First Come First Served scheduling Algorithm")
print("============================================\n")
headers = ['Processes','Arrival Time','Burst Time','Waiting Time'
,'Turn-Around Time','Completion Time']
# Dictionary to store the output
out = dict()
# Get number of processes from User
N = int(input("Number of processes : "))
a, b = 0, 0
# Get Arrival time and Burst time of N processes
for i in range(0,N):
k = f"P{i+1}"
a = int(input(f"Enter Arrival time of process{i+1} :: "))
b = int(input(f"Enter Burst time of process{i+1} :: "))
out[k] = [a,b]
# storing processes in order of increasing arrival time
out = sorted(out.items(),key=lambda i:i[1][0])
# storing Completion times
for i in range(0,N):
if i == 0:
out[i][1].append(out[i][1][0]+out[i][1][1])
else:
out[i][1].append(out[i-1][1][2]+out[i][1][1])
# storing turn-around times
for i in range(0,N):
out[i][1].append(out[i][1][2]-out[i][1][0])
# storing waiting time
for i in range(0,N):
out[i][1].append(out[i][1][3]-out[i][1][1])
# storing avg waiting time and avg turn around time
avgWaitTime = 0
avgTATime = 0
for i in range(0,N):
avgWaitTime += out[i][1][4]
avgTATime += out[i][1][3]
avgWaitTime /= N
avgTATime /= N
print(f"\n{headers[0]:^15}{headers[1]:^15}{headers[2]:^15}{headers[3]:^15}{headers[4]:^20}{headers[5]:^20}")
for a in out:
print(f"{a[0]:^15}{a[1][0]:^15}{a[1][1]:^15}{a[1][4]:^15}{a[1][3]:^20}{a[1][2]:^20}")
print(f"\nAverage Waiting Time : {avgWaitTime:.2f}\nAverage Turn-Around Time : {avgTATime:.2f}")
|
print('First Come First Served scheduling Algorithm')
print('============================================\n')
headers = ['Processes', 'Arrival Time', 'Burst Time', 'Waiting Time', 'Turn-Around Time', 'Completion Time']
out = dict()
n = int(input('Number of processes : '))
(a, b) = (0, 0)
for i in range(0, N):
k = f'P{i + 1}'
a = int(input(f'Enter Arrival time of process{i + 1} :: '))
b = int(input(f'Enter Burst time of process{i + 1} :: '))
out[k] = [a, b]
out = sorted(out.items(), key=lambda i: i[1][0])
for i in range(0, N):
if i == 0:
out[i][1].append(out[i][1][0] + out[i][1][1])
else:
out[i][1].append(out[i - 1][1][2] + out[i][1][1])
for i in range(0, N):
out[i][1].append(out[i][1][2] - out[i][1][0])
for i in range(0, N):
out[i][1].append(out[i][1][3] - out[i][1][1])
avg_wait_time = 0
avg_ta_time = 0
for i in range(0, N):
avg_wait_time += out[i][1][4]
avg_ta_time += out[i][1][3]
avg_wait_time /= N
avg_ta_time /= N
print(f'\n{headers[0]:^15}{headers[1]:^15}{headers[2]:^15}{headers[3]:^15}{headers[4]:^20}{headers[5]:^20}')
for a in out:
print(f'{a[0]:^15}{a[1][0]:^15}{a[1][1]:^15}{a[1][4]:^15}{a[1][3]:^20}{a[1][2]:^20}')
print(f'\nAverage Waiting Time : {avgWaitTime:.2f}\nAverage Turn-Around Time : {avgTATime:.2f}')
|
# -*- coding: utf-8 -*-
__author__ = 'Sinval Vieira Mendes Neto'
__email__ = '[email protected]'
__version__ = '0.1.0'
|
__author__ = 'Sinval Vieira Mendes Neto'
__email__ = '[email protected]'
__version__ = '0.1.0'
|
# -*- coding: utf-8 -*-
#
# This file is part of the SKATestDevice project
#
#
#
# Distributed under the terms of the none license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """tangods-skatestdevice"""
version = "1.0.0"
version_info = version.split(".")
description = """A generic Test device for testing SKA base class functionalites."""
author = "cam"
author_email = "cam at ska.ac.za"
license = """BSD-3-Clause"""
url = """www.tango-controls.org"""
copyright = """"""
|
"""Release information for Python Package"""
name = 'tangods-skatestdevice'
version = '1.0.0'
version_info = version.split('.')
description = 'A generic Test device for testing SKA base class functionalites.'
author = 'cam'
author_email = 'cam at ska.ac.za'
license = 'BSD-3-Clause'
url = 'www.tango-controls.org'
copyright = ''
|
#--coding:utf-8 --
"""
"""
class cDBSCAN:
"""
The major class of the cDBSCAN algorithm, belong to CAO Yaqiang, CHEN Xingwei.
"""
def __init__(self, mat, eps, minPts):
"""
@param mat: the raw or normalized [pointId,X,Y] data matrix
@type mat : np.array
@param eps: The clustering distance threshold, key parameter in DBSCAN.
@type eps: float
@param minPts: The min point in neighbor to define a core point, key
parameter in DBSCAN.
@type minPts: int
"""
#: build the data in the class for global use
self.eps = eps
self.minPts = minPts
#: cell width, city block distance
self.cw = self.eps
#: build the square index for quick neighbor search
self.buildGrids(mat)
#: get the points for all neighbors
self.buildGridNeighbors()
#: remove noise grids
self.removeNoiseGrids()
#: get the points for all neighbors
self.buildGridNeighbors()
#: get the clusters
self.callClusters()
del self.Gs, self.Gs2, self.ps
def getDist(self, p, q):
"""
Basic function 1, city block distance funciton.
"""
x = self.ps[p]
y = self.ps[q]
d = abs(x[0] - y[0]) + abs(x[1] - y[1])
#euclidean distance ,just in case.
#d = np.sqrt((x[0] - y[0])**2 + (x[1] - y[1])**2)
return d
def getNearbyGrids(self, cell):
"""
Basic funciton 2, 9 grid as searching neghbors, grid width is eps.
"""
x, y = cell[0], cell[1]
#keys = [(x, y),
keys = [(x, y - 1), (x, y + 1), (x - 1, y), (x + 1, y), (x - 1, y - 1),
(x - 1, y + 1), (x + 1, y - 1), (x + 1, y + 1)]
#keys = [(x, y), (x, y - 1), (x, y + 1), (x - 1, y), (x - 1, y - 1),
# (x - 1, y + 1), (x + 1, y), (x + 1, y - 1), (x + 1, y + 1),
# (x, y + 2), (x, y - 2), (x + 1, y + 2), (x + 1, y - 2),
# (x - 1, y + 2), (x - 1, y - 2), (x + 2, y), (x + 2, y + 1),
# (x + 2, y - 1), (x - 2, y), (x - 2, y + 1), (x - 2, y - 1)]
ncells = []
for key in keys:
if key in self.Gs:
ncells.append(key)
return ncells
def buildGrids(self, mat):
"""
Algorithm 1: Construct the grids.
@param mat: the raw or normalized [pointId,X,Y] data matrix
"""
minX, minY = mat[0][1], mat[0][2]
for t in mat:
minX = min([minX, t[1]])
minY = min([minY, t[2]])
Gs = {}
ps = {}
for d in mat:
nx = int((d[1] - minX) / self.cw) + 1
ny = int((d[2] - minY) / self.cw) + 1
Gs.setdefault((nx, ny), [])
Gs[(nx, ny)].append(d[0])
#last elements marks the class, initially -1 as noise
ps[d[0]] = [d[1], d[2], nx, ny, -1]
self.Gs, self.ps = Gs, ps
def buildGridNeighbors(self):
"""
Algorithm 2 : Grid index with all neighbor points.
"""
Gs2 = {}
for cell in self.Gs.keys():
nps = []
nps.extend(self.Gs[cell])
for cellj in self.getNearbyGrids(cell):
nps.extend(self.Gs[cellj])
Gs2[cell] = nps
self.Gs2 = Gs2
def removeNoiseGrids(self):
"""
Algorithm 3: Remove noise grid according to KNN and get the obvious core points and core grids.
"""
#: noise cells without neighbors
tode = set()
#: noise cells with neighbors
tode2 = set()
for cell in self.Gs.keys():
if len(self.Gs2[cell]) < self.minPts:
tode2.add(cell)
#KNN to noise cells with neighbors
for cell in tode2:
cells = self.getNearbyGrids(cell)
ncells = set(cells) & tode2
#all neighbor cells are noise
if len(cells) == len(ncells):
tode.add(cell)
for cell in tode:
for p in self.Gs[cell]:
del self.ps[p]
del self.Gs[cell]
def callClusters(self):
"""
Algorithm 4: Do DBSCAN clustering by go through all points in the sets.
"""
#: clustering id, noise is -2 and unclassified point is -1.
clusterId = 0
for key in self.ps:
if self.ps[key][-1] == -1:
if self.expandCluster(key, clusterId):
clusterId += 1
#remove the noise and unclassified points
labels = {}
cs = {}
for p in self.ps.keys():
c = self.ps[p][-1]
if c == -2:
continue
labels[p] = c
if c not in cs:
cs[c] = []
cs[c].append(p)
for key in cs.keys():
if len(cs[key]) < self.minPts:
for p in cs[key]:
del labels[p]
self.labels = labels
def expandCluster(self, pointKey, clusterId):
"""
Search connection for given point to others.
@param pointKey: the key in self.dataPoints
@type pointKey:
@param clusterId: the cluster id for the current
@type clusterId: int
@return: bool
"""
seeds = self.regionQuery(pointKey)
if len(seeds) < self.minPts:
self.ps[pointKey][-1] = -2
return False
else:
for key in seeds:
self.ps[key][-1] = clusterId
while len(seeds) > 0:
currentP = seeds[0]
result = self.regionQuery(currentP)
if len(result) >= self.minPts:
for key in result:
if self.ps[key][-1] in [-1, -2]:
if self.ps[key][-1] == -1:
seeds.append(key)
self.ps[key][-1] = clusterId
del (seeds[0])
return True
def regionQuery(self, pointKey):
"""
Find the related points to the queried point, city block distance is used.
@param pointKey: the key in self.dataPoints
@type pointKey:
@return: list
"""
p = self.ps[pointKey]
x = p[2]
y = p[3]
#scan square and get nearby points.
result = [pointKey]
for q in self.Gs2[(x, y)]:
if q == pointKey:
continue
if self.getDist(pointKey, q) <= self.eps:
result.append(q)
return result
|
"""
"""
class Cdbscan:
"""
The major class of the cDBSCAN algorithm, belong to CAO Yaqiang, CHEN Xingwei.
"""
def __init__(self, mat, eps, minPts):
"""
@param mat: the raw or normalized [pointId,X,Y] data matrix
@type mat : np.array
@param eps: The clustering distance threshold, key parameter in DBSCAN.
@type eps: float
@param minPts: The min point in neighbor to define a core point, key
parameter in DBSCAN.
@type minPts: int
"""
self.eps = eps
self.minPts = minPts
self.cw = self.eps
self.buildGrids(mat)
self.buildGridNeighbors()
self.removeNoiseGrids()
self.buildGridNeighbors()
self.callClusters()
del self.Gs, self.Gs2, self.ps
def get_dist(self, p, q):
"""
Basic function 1, city block distance funciton.
"""
x = self.ps[p]
y = self.ps[q]
d = abs(x[0] - y[0]) + abs(x[1] - y[1])
return d
def get_nearby_grids(self, cell):
"""
Basic funciton 2, 9 grid as searching neghbors, grid width is eps.
"""
(x, y) = (cell[0], cell[1])
keys = [(x, y - 1), (x, y + 1), (x - 1, y), (x + 1, y), (x - 1, y - 1), (x - 1, y + 1), (x + 1, y - 1), (x + 1, y + 1)]
ncells = []
for key in keys:
if key in self.Gs:
ncells.append(key)
return ncells
def build_grids(self, mat):
"""
Algorithm 1: Construct the grids.
@param mat: the raw or normalized [pointId,X,Y] data matrix
"""
(min_x, min_y) = (mat[0][1], mat[0][2])
for t in mat:
min_x = min([minX, t[1]])
min_y = min([minY, t[2]])
gs = {}
ps = {}
for d in mat:
nx = int((d[1] - minX) / self.cw) + 1
ny = int((d[2] - minY) / self.cw) + 1
Gs.setdefault((nx, ny), [])
Gs[nx, ny].append(d[0])
ps[d[0]] = [d[1], d[2], nx, ny, -1]
(self.Gs, self.ps) = (Gs, ps)
def build_grid_neighbors(self):
"""
Algorithm 2 : Grid index with all neighbor points.
"""
gs2 = {}
for cell in self.Gs.keys():
nps = []
nps.extend(self.Gs[cell])
for cellj in self.getNearbyGrids(cell):
nps.extend(self.Gs[cellj])
Gs2[cell] = nps
self.Gs2 = Gs2
def remove_noise_grids(self):
"""
Algorithm 3: Remove noise grid according to KNN and get the obvious core points and core grids.
"""
tode = set()
tode2 = set()
for cell in self.Gs.keys():
if len(self.Gs2[cell]) < self.minPts:
tode2.add(cell)
for cell in tode2:
cells = self.getNearbyGrids(cell)
ncells = set(cells) & tode2
if len(cells) == len(ncells):
tode.add(cell)
for cell in tode:
for p in self.Gs[cell]:
del self.ps[p]
del self.Gs[cell]
def call_clusters(self):
"""
Algorithm 4: Do DBSCAN clustering by go through all points in the sets.
"""
cluster_id = 0
for key in self.ps:
if self.ps[key][-1] == -1:
if self.expandCluster(key, clusterId):
cluster_id += 1
labels = {}
cs = {}
for p in self.ps.keys():
c = self.ps[p][-1]
if c == -2:
continue
labels[p] = c
if c not in cs:
cs[c] = []
cs[c].append(p)
for key in cs.keys():
if len(cs[key]) < self.minPts:
for p in cs[key]:
del labels[p]
self.labels = labels
def expand_cluster(self, pointKey, clusterId):
"""
Search connection for given point to others.
@param pointKey: the key in self.dataPoints
@type pointKey:
@param clusterId: the cluster id for the current
@type clusterId: int
@return: bool
"""
seeds = self.regionQuery(pointKey)
if len(seeds) < self.minPts:
self.ps[pointKey][-1] = -2
return False
else:
for key in seeds:
self.ps[key][-1] = clusterId
while len(seeds) > 0:
current_p = seeds[0]
result = self.regionQuery(currentP)
if len(result) >= self.minPts:
for key in result:
if self.ps[key][-1] in [-1, -2]:
if self.ps[key][-1] == -1:
seeds.append(key)
self.ps[key][-1] = clusterId
del seeds[0]
return True
def region_query(self, pointKey):
"""
Find the related points to the queried point, city block distance is used.
@param pointKey: the key in self.dataPoints
@type pointKey:
@return: list
"""
p = self.ps[pointKey]
x = p[2]
y = p[3]
result = [pointKey]
for q in self.Gs2[x, y]:
if q == pointKey:
continue
if self.getDist(pointKey, q) <= self.eps:
result.append(q)
return result
|
# Tuples in python
def swap(m, n, k):
temp = m
m = n
n = k
k = temp
return m, n, k
def main():
a = (1, "iPhone 12 Pro Max", 1.8, 1)
print(a)
print(a[1])
print(a.index(1.8))
print(a.count(1))
b = a + (999, 888)
print(b)
m = 1
n = 2
k = 3
m, n, k = swap(m, n, k)
print(m, n, k)
if __name__ == "__main__":
main()
|
def swap(m, n, k):
temp = m
m = n
n = k
k = temp
return (m, n, k)
def main():
a = (1, 'iPhone 12 Pro Max', 1.8, 1)
print(a)
print(a[1])
print(a.index(1.8))
print(a.count(1))
b = a + (999, 888)
print(b)
m = 1
n = 2
k = 3
(m, n, k) = swap(m, n, k)
print(m, n, k)
if __name__ == '__main__':
main()
|
# -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : August 2014
Copyright : (C) 2014-2016 Boundless, http://boundlessgeo.com
***************************************************************************
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""
__author__ = 'Victor Olaya'
__date__ = 'August 2014'
__copyright__ = '(C) 2014-2016 Boundless, http://boundlessgeo.com'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
MASTER = 'master'
HEAD = 'HEAD'
WORK_HEAD = 'WORK_HEAD'
STAGE_HEAD = 'STAGE_HEAD'
RESET_MODE_HARD = "hard"
RESET_MODE_MIXED = "mixed"
RESET_MODE_SOFT = "soft"
NULL_ID = "0" * 40
TYPE_BOOLEAN = "BOOLEAN"
TYPE_BYTE = "BYTE"
TYPE_SHORT = "SHORT"
TYPE_INTEGER = "INTEGER"
TYPE_LONG = "LONG"
TYPE_FLOAT = "FLOAT"
TYPE_DOUBLE = "DOUBLE"
TYPE_POINT = "POINT"
TYPE_LINESTRING = "LINESTRING"
TYPE_POLYGON = "POINT"
TYPE_MULTIPOINT = "MULTIPOINT"
TYPE_MULTILINESTRING = "MULTILINESTRING"
TYPE_MULTIPOLYGON = "MULTIPOLYGON"
TYPE_STRING = "STRING"
GEOMTYPES = [TYPE_MULTIPOINT, TYPE_MULTILINESTRING, TYPE_POLYGON,
TYPE_POINT, TYPE_LINESTRING, TYPE_MULTIPOLYGON]
USER_NAME = "user.name"
USER_EMAIL = "user.email"
STORAGE_OBJECTS = "storage.objects"
MONGODB = "mongodb"
STORAGE_GRAPH = "storage.graph"
STORAGE_STAGING = "storage.staging"
MONGODB_VERSION = "mongodb.version"
OURS = "ours"
THEIRS = "theirs"
ORIGIN = "origin"
|
"""
***************************************************************************
__init__.py
---------------------
Date : August 2014
Copyright : (C) 2014-2016 Boundless, http://boundlessgeo.com
***************************************************************************
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""
__author__ = 'Victor Olaya'
__date__ = 'August 2014'
__copyright__ = '(C) 2014-2016 Boundless, http://boundlessgeo.com'
__revision__ = '$Format:%H$'
master = 'master'
head = 'HEAD'
work_head = 'WORK_HEAD'
stage_head = 'STAGE_HEAD'
reset_mode_hard = 'hard'
reset_mode_mixed = 'mixed'
reset_mode_soft = 'soft'
null_id = '0' * 40
type_boolean = 'BOOLEAN'
type_byte = 'BYTE'
type_short = 'SHORT'
type_integer = 'INTEGER'
type_long = 'LONG'
type_float = 'FLOAT'
type_double = 'DOUBLE'
type_point = 'POINT'
type_linestring = 'LINESTRING'
type_polygon = 'POINT'
type_multipoint = 'MULTIPOINT'
type_multilinestring = 'MULTILINESTRING'
type_multipolygon = 'MULTIPOLYGON'
type_string = 'STRING'
geomtypes = [TYPE_MULTIPOINT, TYPE_MULTILINESTRING, TYPE_POLYGON, TYPE_POINT, TYPE_LINESTRING, TYPE_MULTIPOLYGON]
user_name = 'user.name'
user_email = 'user.email'
storage_objects = 'storage.objects'
mongodb = 'mongodb'
storage_graph = 'storage.graph'
storage_staging = 'storage.staging'
mongodb_version = 'mongodb.version'
ours = 'ours'
theirs = 'theirs'
origin = 'origin'
|
# O programa le um valor em metros e o exibe convertido em centimetros e milimetros
metros = float(input('Entre com a distancia em metros: '))
centimetros = metros * 100
milimetros = metros * 1000
kilometros = metros / 1000.0
print('{} metros e {:.0f} centimetros'.format(metros, centimetros))
print('{} metros e {} milimetros'.format(metros, milimetros))
print('{} metros e {} kilometros'.format(metros, kilometros))
|
metros = float(input('Entre com a distancia em metros: '))
centimetros = metros * 100
milimetros = metros * 1000
kilometros = metros / 1000.0
print('{} metros e {:.0f} centimetros'.format(metros, centimetros))
print('{} metros e {} milimetros'.format(metros, milimetros))
print('{} metros e {} kilometros'.format(metros, kilometros))
|
train_datagen = ImageDataGenerator(rescale=1./255) # rescaling on the fly
# Updated to do image augmentation
train_datagen = ImageDataGenerator(
rescale = 1./255, # recaling
rotation_range = 40, # randomly rotate b/w 0 and 40 degrees
width_shift_range = 0.2, # shifting the images
height_shift_range = 0.2, # Randomly shift b/w 0 to 20 %
shear_range = 0.2, # It will shear the image by specified amounts upto the specified portion of the image
zoom_range = 0.2, # Zoom the image by 20% of random amounts of the image
horizontal_flip = True, # Flip the image/ Mirror image at random
fill_mode = 'nearest' # Fills the pixels that might have been lost in the operations
)
|
train_datagen = image_data_generator(rescale=1.0 / 255)
train_datagen = image_data_generator(rescale=1.0 / 255, rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True, fill_mode='nearest')
|
#!/usr/bin/env python
##
# Print a heading.
#
# @var string text
# @return string
##
def heading(text):
return '-----> ' + text;
##
# Print a single line.
#
# @var string text
# @return string
##
def line(text):
return ' ' + text;
##
# Print a single new line.
#
# @return string
##
def nl():
return line('');
|
def heading(text):
return '-----> ' + text
def line(text):
return ' ' + text
def nl():
return line('')
|
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _create_worker_module_impl(ctx):
output_file = ctx.actions.declare_file(ctx.attr.out_file)
if (len(ctx.files.worker_file) != 1):
fail("Expected a single file but got " + str(ctx.files.worker_file))
cjs = ["--cjs"] if ctx.attr.cjs else []
run_node(
ctx,
executable = "create_worker_module_bin",
inputs = ctx.files.worker_file,
outputs = [output_file],
arguments = cjs + [
ctx.files.worker_file[0].path,
output_file.path,
],
)
return [DefaultInfo(files = depset([output_file]))]
create_worker_module = rule(
implementation = _create_worker_module_impl,
attrs = {
"cjs": attr.bool(
default = False,
doc = "Whether to output commonjs",
),
"create_worker_module_bin": attr.label(
executable = True,
cfg = "exec",
default = Label("@//tfjs-backend-wasm/scripts:create_worker_module_bin"),
doc = "The script that creates the worker module",
),
"out_file": attr.string(
mandatory = True,
doc = "The name for the output file",
),
"worker_file": attr.label(
doc = "The worker file to transform",
allow_files = [".js"],
),
},
doc = """Modify the Emscripten WASM worker script so it can be inlined
...by the tf-backend-wasm bundle.
""",
)
|
load('@build_bazel_rules_nodejs//:providers.bzl', 'run_node')
def _create_worker_module_impl(ctx):
output_file = ctx.actions.declare_file(ctx.attr.out_file)
if len(ctx.files.worker_file) != 1:
fail('Expected a single file but got ' + str(ctx.files.worker_file))
cjs = ['--cjs'] if ctx.attr.cjs else []
run_node(ctx, executable='create_worker_module_bin', inputs=ctx.files.worker_file, outputs=[output_file], arguments=cjs + [ctx.files.worker_file[0].path, output_file.path])
return [default_info(files=depset([output_file]))]
create_worker_module = rule(implementation=_create_worker_module_impl, attrs={'cjs': attr.bool(default=False, doc='Whether to output commonjs'), 'create_worker_module_bin': attr.label(executable=True, cfg='exec', default=label('@//tfjs-backend-wasm/scripts:create_worker_module_bin'), doc='The script that creates the worker module'), 'out_file': attr.string(mandatory=True, doc='The name for the output file'), 'worker_file': attr.label(doc='The worker file to transform', allow_files=['.js'])}, doc='Modify the Emscripten WASM worker script so it can be inlined\n\n ...by the tf-backend-wasm bundle.\n ')
|
"""ANSI color codes for the command line output."""
RESET = u"\u001b[0m"
BLACK = u"\u001b[30m"
RED = u"\u001b[31m"
GREEN = u"\u001b[32m"
YELLOW = u"\u001b[33m"
BLUE = u"\u001b[34m"
MAGENTA = u"\u001b[35m"
CYAN = u"\u001b[36m"
WHITE = u"\u001b[37m"
BRIGHT_BLACK = u"\u001b[30;1m"
BRIGHT_RED = u"\u001b[31;1m"
BRIGHT_GREEN = u"\u001b[32;1m"
BRIGHT_YELLOW = u"\u001b[33;1m"
BRIGHT_BLUE = u"\u001b[34;1m"
BRIGHT_MAGENTA = u"\u001b[35;1m"
BRIGHT_CYAN = u"\u001b[36;1m"
BRIGHT_WHITE = u"\u001b[37;1m"
BACKGROUND_BLACK = u"\u001b[40m"
BACKGROUND_RED = u"\u001b[41m"
BACKGROUND_GREEN = u"\u001b[42m"
BACKGROUND_YELLOW = u"\u001b[43m"
BACKGROUND_BLUE = u"\u001b[44m"
BACKGROUND_MAGENTA = u"\u001b[45m"
BACKGROUND_CYAN = u"\u001b[46m"
BACKGROUND_WHITE = u"\u001b[47m"
BACKGROUND_BRIGHT_BLACK = u"\u001b[40;1m"
BACKGROUND_BRIGHT_RED = u"\u001b[41;1m"
BACKGROUND_BRIGHT_GREEN = u"\u001b[42;1m"
BACKGROUND_BRIGHT_YELLOW = u"\u001b[43;1m"
BACKGROUND_BRIGHT_BLUE = u"\u001b[44;1m"
BACKGROUND_BRIGHT_MAGENTA = u"\u001b[45;1m"
BACKGROUND_BRIGHT_CYAN = u"\u001b[46;1m"
BACKGROUND_BRIGHT_WHITE = u"\u001b[47;1m"
def color_by_id(color_id):
return u"\u001b[38;5;{}m".format(color_id)
def background_color_by_id(color_id):
return u"\u001b[48;5;{}m".format(color_id)
if __name__ == '__main__':
print(BRIGHT_BLACK + "hello world!" + RESET)
print(BRIGHT_RED + "hello world!" + RESET)
print(BRIGHT_GREEN + "hello world!" + RESET)
for i in range(0, 16):
for j in range(0, 16):
code = str(i*16+j)
print(color_by_id(i*16+j) + " " + code.ljust(4), end="")
print(RESET)
for i in range(0, 16):
for j in range(0, 16):
code = str(i*16+j)
print(background_color_by_id(i*16+j) + " " + code.ljust(4), end="")
print(RESET)
|
"""ANSI color codes for the command line output."""
reset = u'\x1b[0m'
black = u'\x1b[30m'
red = u'\x1b[31m'
green = u'\x1b[32m'
yellow = u'\x1b[33m'
blue = u'\x1b[34m'
magenta = u'\x1b[35m'
cyan = u'\x1b[36m'
white = u'\x1b[37m'
bright_black = u'\x1b[30;1m'
bright_red = u'\x1b[31;1m'
bright_green = u'\x1b[32;1m'
bright_yellow = u'\x1b[33;1m'
bright_blue = u'\x1b[34;1m'
bright_magenta = u'\x1b[35;1m'
bright_cyan = u'\x1b[36;1m'
bright_white = u'\x1b[37;1m'
background_black = u'\x1b[40m'
background_red = u'\x1b[41m'
background_green = u'\x1b[42m'
background_yellow = u'\x1b[43m'
background_blue = u'\x1b[44m'
background_magenta = u'\x1b[45m'
background_cyan = u'\x1b[46m'
background_white = u'\x1b[47m'
background_bright_black = u'\x1b[40;1m'
background_bright_red = u'\x1b[41;1m'
background_bright_green = u'\x1b[42;1m'
background_bright_yellow = u'\x1b[43;1m'
background_bright_blue = u'\x1b[44;1m'
background_bright_magenta = u'\x1b[45;1m'
background_bright_cyan = u'\x1b[46;1m'
background_bright_white = u'\x1b[47;1m'
def color_by_id(color_id):
return u'\x1b[38;5;{}m'.format(color_id)
def background_color_by_id(color_id):
return u'\x1b[48;5;{}m'.format(color_id)
if __name__ == '__main__':
print(BRIGHT_BLACK + 'hello world!' + RESET)
print(BRIGHT_RED + 'hello world!' + RESET)
print(BRIGHT_GREEN + 'hello world!' + RESET)
for i in range(0, 16):
for j in range(0, 16):
code = str(i * 16 + j)
print(color_by_id(i * 16 + j) + ' ' + code.ljust(4), end='')
print(RESET)
for i in range(0, 16):
for j in range(0, 16):
code = str(i * 16 + j)
print(background_color_by_id(i * 16 + j) + ' ' + code.ljust(4), end='')
print(RESET)
|
print('Laboratory work 1.1 measurements of the R-load.')
measurements = []
measurements_count = int(input('Enter number of measurements : '))
for cur_measurement_number in range(1, measurements_count+1):
print(f'Enter value for measurement {cur_measurement_number} -> ', end='')
measurement = float(input())
measurements.append(measurement)
print('Results of the measurements: ')
for index, cur_measurement_number in enumerate(measurements):
print (f'({index}): {cur_measurement_number} Ohms')
|
print('Laboratory work 1.1 measurements of the R-load.')
measurements = []
measurements_count = int(input('Enter number of measurements : '))
for cur_measurement_number in range(1, measurements_count + 1):
print(f'Enter value for measurement {cur_measurement_number} -> ', end='')
measurement = float(input())
measurements.append(measurement)
print('Results of the measurements: ')
for (index, cur_measurement_number) in enumerate(measurements):
print(f'({index}): {cur_measurement_number} Ohms')
|
#tests: depend_extra
depend_extra=('pelle',)
def synthesis():
pass
|
depend_extra = ('pelle',)
def synthesis():
pass
|
def _capnp_toolchain_gen_impl(ctx):
ctx.template(
"toolchain/BUILD.bazel",
ctx.attr._build_tpl,
substitutions = {
"{capnp_tool}": str(ctx.attr.capnp_tool),
},
)
capnp_toolchain_gen = repository_rule(
implementation = _capnp_toolchain_gen_impl,
attrs = {
"capnp_tool": attr.label(
allow_single_file = True,
cfg = "host",
executable = True,
),
"_build_tpl": attr.label(
default = "@rules_capnproto//capnp/internal:BUILD.toolchain.tpl",
),
},
doc = "Creates the Capnp toolchain that will be used by all capnp_library targets",
)
|
def _capnp_toolchain_gen_impl(ctx):
ctx.template('toolchain/BUILD.bazel', ctx.attr._build_tpl, substitutions={'{capnp_tool}': str(ctx.attr.capnp_tool)})
capnp_toolchain_gen = repository_rule(implementation=_capnp_toolchain_gen_impl, attrs={'capnp_tool': attr.label(allow_single_file=True, cfg='host', executable=True), '_build_tpl': attr.label(default='@rules_capnproto//capnp/internal:BUILD.toolchain.tpl')}, doc='Creates the Capnp toolchain that will be used by all capnp_library targets')
|
expected_output = {
'steering_entries': {
'sgt': {
2057: {
'entry_last_refresh': '10:32:00',
'entry_state': 'COMPLETE',
'peer_name': 'Unknown-2057',
'peer_sgt': '2057-01',
'policy_rbacl_src_list': {
'entry_status': 'UNKNOWN',
'installed_elements': '0x00000C80',
'installed_peer_policy': {
'peer_policy': '0x7F3ADDAFEA08',
'policy_flag': '0x00400001'
},
'installed_sgt_policy': {
'peer_policy': '0x7F3ADDAFF308',
'policy_flag': '0x41400001'
},
'policy_expires_in': '0:23:59:55',
'policy_refreshes_in': '0:23:59:55',
'received_elements': '0x00000C80',
'received_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
},
'retry_timer': 'not running',
'sgt_policy_last_refresh': '10:32:00 UTC '
'Fri Oct 15 '
'2021',
'sgt_policy_refresh_time_secs': 86400,
'staled_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
}
},
'requested_elements': '0x00001401'
},
3053: {
'entry_last_refresh': '10:30:42',
'entry_state': 'COMPLETE',
'peer_name': 'Unknown-3053',
'peer_sgt': '3053-01',
'policy_rbacl_src_list': {
'entry_status': 'UNKNOWN',
'installed_elements': '0x00000C80',
'installed_peer_policy': {
'peer_policy': '0x7F3ADDAFEC08',
'policy_flag': '0x00400001'
},
'installed_sgt_policy': {
'peer_policy': '0x7F3ADDAFF1B8',
'policy_flag': '0x41400001'
},
'policy_expires_in': '0:23:58:37',
'policy_refreshes_in': '0:23:58:37',
'received_elements': '0x00000C80',
'received_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
},
'retry_timer': 'not running',
'sgt_policy_last_refresh': '10:30:42 UTC '
'Fri Oct 15 '
'2021',
'sgt_policy_refresh_time_secs': 86400,
'staled_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
}
},
'requested_elements': '0x00001401'
},
65521: {
'entry_last_refresh': '00:00:00',
'entry_state': 'FAILURE',
'peer_name': 'Unknown-65521',
'peer_sgt': '65521',
'policy_rbacl_src_list': {
'entry_status': 'UNKNOWN',
'installed_elements': '0x00000000',
'installed_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
},
'received_elements': '0x00000000',
'received_peer_policy': {
'peer_policy': '0x7F3ADDAFEB08',
'policy_flag': '0x00000005'
},
'refresh_timer': 'not running',
'retry_timer': 'running',
'staled_peer_policy': {
'peer_policy': '0x00000000',
'policy_flag': '0x00000000'
}
},
'requested_elements': '0x00000081'
}
}
}
}
|
expected_output = {'steering_entries': {'sgt': {2057: {'entry_last_refresh': '10:32:00', 'entry_state': 'COMPLETE', 'peer_name': 'Unknown-2057', 'peer_sgt': '2057-01', 'policy_rbacl_src_list': {'entry_status': 'UNKNOWN', 'installed_elements': '0x00000C80', 'installed_peer_policy': {'peer_policy': '0x7F3ADDAFEA08', 'policy_flag': '0x00400001'}, 'installed_sgt_policy': {'peer_policy': '0x7F3ADDAFF308', 'policy_flag': '0x41400001'}, 'policy_expires_in': '0:23:59:55', 'policy_refreshes_in': '0:23:59:55', 'received_elements': '0x00000C80', 'received_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}, 'retry_timer': 'not running', 'sgt_policy_last_refresh': '10:32:00 UTC Fri Oct 15 2021', 'sgt_policy_refresh_time_secs': 86400, 'staled_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}}, 'requested_elements': '0x00001401'}, 3053: {'entry_last_refresh': '10:30:42', 'entry_state': 'COMPLETE', 'peer_name': 'Unknown-3053', 'peer_sgt': '3053-01', 'policy_rbacl_src_list': {'entry_status': 'UNKNOWN', 'installed_elements': '0x00000C80', 'installed_peer_policy': {'peer_policy': '0x7F3ADDAFEC08', 'policy_flag': '0x00400001'}, 'installed_sgt_policy': {'peer_policy': '0x7F3ADDAFF1B8', 'policy_flag': '0x41400001'}, 'policy_expires_in': '0:23:58:37', 'policy_refreshes_in': '0:23:58:37', 'received_elements': '0x00000C80', 'received_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}, 'retry_timer': 'not running', 'sgt_policy_last_refresh': '10:30:42 UTC Fri Oct 15 2021', 'sgt_policy_refresh_time_secs': 86400, 'staled_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}}, 'requested_elements': '0x00001401'}, 65521: {'entry_last_refresh': '00:00:00', 'entry_state': 'FAILURE', 'peer_name': 'Unknown-65521', 'peer_sgt': '65521', 'policy_rbacl_src_list': {'entry_status': 'UNKNOWN', 'installed_elements': '0x00000000', 'installed_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}, 'received_elements': '0x00000000', 'received_peer_policy': {'peer_policy': '0x7F3ADDAFEB08', 'policy_flag': '0x00000005'}, 'refresh_timer': 'not running', 'retry_timer': 'running', 'staled_peer_policy': {'peer_policy': '0x00000000', 'policy_flag': '0x00000000'}}, 'requested_elements': '0x00000081'}}}}
|
__author__ = 'Stormpath, Inc.'
__copyright__ = 'Copyright 2012-2014 Stormpath, Inc.'
__version_info__ = ('1', '3', '1')
__version__ = '.'.join(__version_info__)
__short_version__ = '.'.join(__version_info__)
|
__author__ = 'Stormpath, Inc.'
__copyright__ = 'Copyright 2012-2014 Stormpath, Inc.'
__version_info__ = ('1', '3', '1')
__version__ = '.'.join(__version_info__)
__short_version__ = '.'.join(__version_info__)
|
J
# welcoming the user
name = input("What is your name? ")
print("Hello, " + name, "It is time to play hangman!")
print("Start guessing...")
# here we set the secret
word = "secret"
# creates a variable with an empty value
guesses = ''
# determine the number of turns
turns = 10
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
print("_")
failed += 1
if failed == 0:
print("You won!")
break
guess = input("guess a character:")
guesses += guess
if guess not in word:
turns -= 1
print("Wrong")
print("You have", + turns, 'more guesses')
if turns == 0:
print("You lose")
|
J
name = input('What is your name? ')
print('Hello, ' + name, 'It is time to play hangman!')
print('Start guessing...')
word = 'secret'
guesses = ''
turns = 10
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
print('_')
failed += 1
if failed == 0:
print('You won!')
break
guess = input('guess a character:')
guesses += guess
if guess not in word:
turns -= 1
print('Wrong')
print('You have', +turns, 'more guesses')
if turns == 0:
print('You lose')
|
conductores = {
'azambrano': ('Andres Zambrano', 5.6, ('Hyundai', 'Elantra')),
'jojeda': ('Juan Ojeda', 1.1, ('Hyundai', 'Accent')),
# ...
}
def agrega_conductor(conductores, nuevo_conductor):
username, nombre, puntaje, (marca, modelo) = nuevo_conductor
if username in conductores:
return False
conductores[username] = (nombre, puntaje, (marca, modelo))
return True
def elimina_conductor(conductores, username):
if username not in conductores:
return False
del conductores[username]
return True
def ranking(conductores):
r = []
for c in conductores:
r.append((conductores[c][1], conductores[c][0]))
r.sort()
r.reverse()
final = []
for puntaje, nombre in r:
final.append((nombre, puntaje))
return final
|
conductores = {'azambrano': ('Andres Zambrano', 5.6, ('Hyundai', 'Elantra')), 'jojeda': ('Juan Ojeda', 1.1, ('Hyundai', 'Accent'))}
def agrega_conductor(conductores, nuevo_conductor):
(username, nombre, puntaje, (marca, modelo)) = nuevo_conductor
if username in conductores:
return False
conductores[username] = (nombre, puntaje, (marca, modelo))
return True
def elimina_conductor(conductores, username):
if username not in conductores:
return False
del conductores[username]
return True
def ranking(conductores):
r = []
for c in conductores:
r.append((conductores[c][1], conductores[c][0]))
r.sort()
r.reverse()
final = []
for (puntaje, nombre) in r:
final.append((nombre, puntaje))
return final
|
"""
Implement a class for a Least Recently Used (LRU) Cache. The cache should
support inserting key/value paris, retrieving a key's value and retrieving the
most recently active key.
Each of these methods should run in constant time. When a key/value pair is
inserted or a key's value is retrieved, the key in question should become the
most recenty key. Also, the LRUCache class should store a max_size property set
to the size of the cache, which is passed in as an argument during
instantiation. This size represents the maximum numebr of key/value pairs that
the cache can hold at onece. If a key/value pair is added to che cache when it
has reached maximum capcacity, teh least recently used (active) key/value pair
should be evicted from the cache and no loger retrievable. The newly added
key/value pair shuld effectively replace it. Inserting a key/pari with an
already existing key should simply replace the key's value in the cache with
the new value and should not evict a key/value pair if the cache is full.
Attempting to retrieve a value from a key that is not in the cache should
return the None value.
"""
# Do not edit the class below except for the insertKeyValuePair,
# getValueFromKey, and getMostRecentKey methods. Feel free
# to add new properties and methods to the class.
"""
doubly linked list
node class
hash table with nodes
"""
class LRUCache:
def __init__(self, max_size):
self.max_size = max_size or 1
self.lru_dict = {}
self.lru_dll = DoublyLinkedList()
self.cur_size = 0
def update(self, node):
self.lru_dll.setHead(node)
def insertKeyValuePair(self, key, value):
if key in self.lru_dict:
node = self.lru_dict[key]
node.value = value
self.update(node)
return
elif self.cur_size == self.max_size:
self.remove_least_recent()
else:
self.cur_size += 1
node = DoublyLinkedListNode(key, value)
self.lru_dll.setHead(node)
# we know key is not in lru_dict
self.lru_dict[key] = node
def remove_least_recent(self):
if self.cur_size < 1:
return
rem_key = self.lru_dll.tail.key
self.lru_dll.remove_tail()
del self.lru_dict[rem_key]
def getValueFromKey(self, key):
if key not in self.lru_dict:
return None
else:
node = self.lru_dict[key]
self.update(node)
return node.value
def getMostRecentKey(self):
# Write your code here.
return self.lru_dll.head.key
class DoublyLinkedList:
def __init__(self):
self.head = None
self.tail = None
def setHead(self, node):
if node is self.head:
return
self.remove(node)
if self.head is None:
self.head = node
self.tail = node
elif self.head is self.tail:
node.next = self.tail
node.prev = None # not really necessary but for clarity
self.tail.prev = node
self.head = node
else:
self.remove(node)
node.next = self.head.next
self.head.prev = node
self.head = node
def remove_tail(self):
self.remove(self.tail)
def remove(self, node):
if node is self.head:
self.head = self.head.next
if node is self.tail:
self.tail = self.tail.prev
node.remove_bindings()
class DoublyLinkedListNode:
def __init__(self, key, value):
self.key = key
self.value = value
self.prev = None
self.next = None
def remove_bindings(self):
if self.prev:
self.prev.next = self.next
if self.next:
self.next.prev = self.prev
self.next = None
self.prev = None
|
"""
Implement a class for a Least Recently Used (LRU) Cache. The cache should
support inserting key/value paris, retrieving a key's value and retrieving the
most recently active key.
Each of these methods should run in constant time. When a key/value pair is
inserted or a key's value is retrieved, the key in question should become the
most recenty key. Also, the LRUCache class should store a max_size property set
to the size of the cache, which is passed in as an argument during
instantiation. This size represents the maximum numebr of key/value pairs that
the cache can hold at onece. If a key/value pair is added to che cache when it
has reached maximum capcacity, teh least recently used (active) key/value pair
should be evicted from the cache and no loger retrievable. The newly added
key/value pair shuld effectively replace it. Inserting a key/pari with an
already existing key should simply replace the key's value in the cache with
the new value and should not evict a key/value pair if the cache is full.
Attempting to retrieve a value from a key that is not in the cache should
return the None value.
"""
'\ndoubly linked list\nnode class\nhash table with nodes\n'
class Lrucache:
def __init__(self, max_size):
self.max_size = max_size or 1
self.lru_dict = {}
self.lru_dll = doubly_linked_list()
self.cur_size = 0
def update(self, node):
self.lru_dll.setHead(node)
def insert_key_value_pair(self, key, value):
if key in self.lru_dict:
node = self.lru_dict[key]
node.value = value
self.update(node)
return
elif self.cur_size == self.max_size:
self.remove_least_recent()
else:
self.cur_size += 1
node = doubly_linked_list_node(key, value)
self.lru_dll.setHead(node)
self.lru_dict[key] = node
def remove_least_recent(self):
if self.cur_size < 1:
return
rem_key = self.lru_dll.tail.key
self.lru_dll.remove_tail()
del self.lru_dict[rem_key]
def get_value_from_key(self, key):
if key not in self.lru_dict:
return None
else:
node = self.lru_dict[key]
self.update(node)
return node.value
def get_most_recent_key(self):
return self.lru_dll.head.key
class Doublylinkedlist:
def __init__(self):
self.head = None
self.tail = None
def set_head(self, node):
if node is self.head:
return
self.remove(node)
if self.head is None:
self.head = node
self.tail = node
elif self.head is self.tail:
node.next = self.tail
node.prev = None
self.tail.prev = node
self.head = node
else:
self.remove(node)
node.next = self.head.next
self.head.prev = node
self.head = node
def remove_tail(self):
self.remove(self.tail)
def remove(self, node):
if node is self.head:
self.head = self.head.next
if node is self.tail:
self.tail = self.tail.prev
node.remove_bindings()
class Doublylinkedlistnode:
def __init__(self, key, value):
self.key = key
self.value = value
self.prev = None
self.next = None
def remove_bindings(self):
if self.prev:
self.prev.next = self.next
if self.next:
self.next.prev = self.prev
self.next = None
self.prev = None
|
#calculator
def add(n1,n2):
return n1 +n2
def substract(n1,n2):
return n1-n2
def multiply(n1,n2):
return n1 * n2
def devide(n1,n2):
return n1/n2
operator = {
"+": add,
"-": substract,
"*": multiply,
"/": devide,
}
num1 = float(input("Enter number: "))
op_simbol = input("enter + - * / ")
num2 = float(input("Enter number: "))
calc_func = operator[op_simbol]
ans = calc_func(num1,num2)
print(ans)
###########
studen_score = {
"Harry": 10,
"alex" :51,
"bibo": 91,
}
studen_grades = {}
for student in studen_score.keys():
score = studen_score[student]
if score > 90:
studen_grades[student] = "outstanding"
elif score > 50:
studen_grades[student] = "good"
elif score < 15:
studen_grades[student] = "poor"
#print(studen_grades)
travel_log = [
{"spain": {"city": ["malorka","tenerife","lanzarote"]}},
{"bulgaria": {"city": ["sf", "pld"]}}
]
def add_city(country,city):
newdict = {}
newdict[country] = {f"city: {city}"}
travel_log.append(newdict)
add_city("france", ["nice","monte"])
print(travel_log)
####################
name = ""
bid = ""
others = True
bidders = {}
while others is True:
name = input("Name? ")
bid = int(input("Bid? "))
others_bid = input("anyone else? Y or N ").lower()
if others_bid == "n":
others = False
bidders[name] = bid
print(bidders)
biggest = max(bidders.values())
for k,v in bidders.items():
if v == biggest:
name = k
winner = {}
winner[name] = biggest
print("winner is ", winner)
|
def add(n1, n2):
return n1 + n2
def substract(n1, n2):
return n1 - n2
def multiply(n1, n2):
return n1 * n2
def devide(n1, n2):
return n1 / n2
operator = {'+': add, '-': substract, '*': multiply, '/': devide}
num1 = float(input('Enter number: '))
op_simbol = input('enter + - * / ')
num2 = float(input('Enter number: '))
calc_func = operator[op_simbol]
ans = calc_func(num1, num2)
print(ans)
studen_score = {'Harry': 10, 'alex': 51, 'bibo': 91}
studen_grades = {}
for student in studen_score.keys():
score = studen_score[student]
if score > 90:
studen_grades[student] = 'outstanding'
elif score > 50:
studen_grades[student] = 'good'
elif score < 15:
studen_grades[student] = 'poor'
travel_log = [{'spain': {'city': ['malorka', 'tenerife', 'lanzarote']}}, {'bulgaria': {'city': ['sf', 'pld']}}]
def add_city(country, city):
newdict = {}
newdict[country] = {f'city: {city}'}
travel_log.append(newdict)
add_city('france', ['nice', 'monte'])
print(travel_log)
name = ''
bid = ''
others = True
bidders = {}
while others is True:
name = input('Name? ')
bid = int(input('Bid? '))
others_bid = input('anyone else? Y or N ').lower()
if others_bid == 'n':
others = False
bidders[name] = bid
print(bidders)
biggest = max(bidders.values())
for (k, v) in bidders.items():
if v == biggest:
name = k
winner = {}
winner[name] = biggest
print('winner is ', winner)
|
# https://www.codechef.com/problems/SUMPOS
for T in range(int(input())):
l=sorted(list(map(int,input().split())))
print("NO") if(l[2]!=l[1]+l[0]) else print("YES")
|
for t in range(int(input())):
l = sorted(list(map(int, input().split())))
print('NO') if l[2] != l[1] + l[0] else print('YES')
|
class LoggerTemplate():
def __init__(self, *args, **kwargs):
raise NotImplementedError
def update_loss(self, phase, value, step):
raise NotImplementedError
def update_metric(self, phase, metric, value, step):
raise NotImplementedError
|
class Loggertemplate:
def __init__(self, *args, **kwargs):
raise NotImplementedError
def update_loss(self, phase, value, step):
raise NotImplementedError
def update_metric(self, phase, metric, value, step):
raise NotImplementedError
|
var={"car":"volvo", "fruit":"apple"}
print(var["fruit"])
for f in var:
print("key: " + f + " value: " + var[f])
print()
print()
var1={"donut":["chocolate","glazed","sprinkled"]}
print(var1["donut"][0])
print("My favorite donut flavors are:", end= " ")
for f in var1["donut"]:
print(f, end=" ")
print()
print()
#Using the examples above write code to print one value of each JSON structure and a loop to print all values below.
var={"vegetable":"carrot", "fruit":"apple","animal":"cat","day":"Friday"}
print(var["vegetable"])
for f in var:
print("key: " + f + " value: " + var[f])
print()
print()
var1={"animal":["dog","cat","fish","tiger","camel"]}
print(var1["animal"][0])
print("My favorite animals are:", end= " ")
for f in var1["animal"]:
print(f, end=" ")
print()
print()
myvar={"dessert":"ice cream", "exercise":"push ups","eyes":"blue","gender":"male"}
print(myvar["exercise"])
for f in myvar:
print("key: " + f + " value: " + myvar[f])
print()
print()
myvar1={"dessert":["cake","candy","ice cream","pudding","cookies"]}
print(myvar1["dessert"][0])
print("My favorite desserts are:", end= " ")
for f in myvar1["dessert"]:
print(f, end=" ")
|
var = {'car': 'volvo', 'fruit': 'apple'}
print(var['fruit'])
for f in var:
print('key: ' + f + ' value: ' + var[f])
print()
print()
var1 = {'donut': ['chocolate', 'glazed', 'sprinkled']}
print(var1['donut'][0])
print('My favorite donut flavors are:', end=' ')
for f in var1['donut']:
print(f, end=' ')
print()
print()
var = {'vegetable': 'carrot', 'fruit': 'apple', 'animal': 'cat', 'day': 'Friday'}
print(var['vegetable'])
for f in var:
print('key: ' + f + ' value: ' + var[f])
print()
print()
var1 = {'animal': ['dog', 'cat', 'fish', 'tiger', 'camel']}
print(var1['animal'][0])
print('My favorite animals are:', end=' ')
for f in var1['animal']:
print(f, end=' ')
print()
print()
myvar = {'dessert': 'ice cream', 'exercise': 'push ups', 'eyes': 'blue', 'gender': 'male'}
print(myvar['exercise'])
for f in myvar:
print('key: ' + f + ' value: ' + myvar[f])
print()
print()
myvar1 = {'dessert': ['cake', 'candy', 'ice cream', 'pudding', 'cookies']}
print(myvar1['dessert'][0])
print('My favorite desserts are:', end=' ')
for f in myvar1['dessert']:
print(f, end=' ')
|
#Challenge 4: Take a binary tree and reverse it
#I decided to create two classes. One to hold the node, and one to act as the Binary Tree.
#Node class
#Only contains the information for the node. Val is the value of the node, left is the left most value, and right is the right value
class Node:
def __init__(self, val):
self.left = None
self.right = None
self.val = val
#BinaryTree class
class BinaryTree:
#Initialize the tree with a blank root
def __init__(self):
self.root = None
def getRoot(self):
return self.root
#Recursively add node objects
def add(self,val):
if self.root is None:
self.root = Node(val)
else:
self._add(val, self.root)
def _add(self, val, node):
if val < node.val:
if node.left is not None:
self._add(val, node.left)
else:
node.left = Node(val)
else:
if node.right is not None:
self._add(val, node.right)
else:
node.right = Node(val)
#Recursively print each node in the tree
def printTree(self):
if self.root is not None:
self._printTree(self.root)
def _printTree(self, node):
if node is not None:
self._printTree(node.left)
print(node.val)
self._printTree(node.right)
#returns a nested list of each level and the nodes in it
def getTree(self):
currLevel = [self.root]
tree = list()
while currLevel:
lowerLevel = list()
currNodes = list()
for node in currLevel:
currNodes.append(node.val)
if node.left:
lowerLevel.append(node.left)
if node.right:
lowerLevel.append(node.right)
tree.append(currNodes)
#print(currNodes)
currLevel = lowerLevel
return tree
if __name__ == '__main__':
#create sample tree from example
tree = BinaryTree()
tree.add(4)
tree.add(2)
tree.add(7)
tree.add(1)
tree.add(3)
tree.add(6)
tree.add(9)
#getTree returns the tree formatted in nested lists
formattedTree = tree.getTree()
#reverse the levels
for level in formattedTree:
level.reverse()
print(level)
|
class Node:
def __init__(self, val):
self.left = None
self.right = None
self.val = val
class Binarytree:
def __init__(self):
self.root = None
def get_root(self):
return self.root
def add(self, val):
if self.root is None:
self.root = node(val)
else:
self._add(val, self.root)
def _add(self, val, node):
if val < node.val:
if node.left is not None:
self._add(val, node.left)
else:
node.left = node(val)
elif node.right is not None:
self._add(val, node.right)
else:
node.right = node(val)
def print_tree(self):
if self.root is not None:
self._printTree(self.root)
def _print_tree(self, node):
if node is not None:
self._printTree(node.left)
print(node.val)
self._printTree(node.right)
def get_tree(self):
curr_level = [self.root]
tree = list()
while currLevel:
lower_level = list()
curr_nodes = list()
for node in currLevel:
currNodes.append(node.val)
if node.left:
lowerLevel.append(node.left)
if node.right:
lowerLevel.append(node.right)
tree.append(currNodes)
curr_level = lowerLevel
return tree
if __name__ == '__main__':
tree = binary_tree()
tree.add(4)
tree.add(2)
tree.add(7)
tree.add(1)
tree.add(3)
tree.add(6)
tree.add(9)
formatted_tree = tree.getTree()
for level in formattedTree:
level.reverse()
print(level)
|
DAOLIPROXY_VENDOR = "OpenStack Foundation"
DAOLIPROXY_PRODUCT = "DaoliProxy"
DAOLIPROXY_PACKAGE = None # OS distro package version suffix
loaded = False
class VersionInfo(object):
release = "1.el7.centos"
version = "2015.1.21"
def version_string(self):
return self.version
def release_string(self):
return self.release
version_info = VersionInfo()
version_string = version_info.version_string
def vendor_string():
return DAOLIPROXY_VENDOR
def product_string():
return DAOLIPROXY_PRODUCT
def package_string():
return DAOLIPROXY_PACKAGE
def version_string_with_package():
if package_string() is None:
return version_info.version_string()
else:
return "%s-%s" % (version_info.version_string(), package_string())
|
daoliproxy_vendor = 'OpenStack Foundation'
daoliproxy_product = 'DaoliProxy'
daoliproxy_package = None
loaded = False
class Versioninfo(object):
release = '1.el7.centos'
version = '2015.1.21'
def version_string(self):
return self.version
def release_string(self):
return self.release
version_info = version_info()
version_string = version_info.version_string
def vendor_string():
return DAOLIPROXY_VENDOR
def product_string():
return DAOLIPROXY_PRODUCT
def package_string():
return DAOLIPROXY_PACKAGE
def version_string_with_package():
if package_string() is None:
return version_info.version_string()
else:
return '%s-%s' % (version_info.version_string(), package_string())
|
# Space: O(n)
# Time: O(n)
class Solution:
def findUnsortedSubarray(self, nums):
length = len(nums)
if length <= 1: return 0
stack = []
left, right = length - 1, 0
for i in range(length):
while stack and nums[stack[-1]] > nums[i]:
left = min(left, stack.pop())
stack.append(i)
if left == length - 1: return 0
stack = []
for j in range(length - 1, -1, -1):
while stack and nums[stack[-1]] < nums[j]:
right = max(right, stack.pop())
stack.append(j)
return right - left + 1
|
class Solution:
def find_unsorted_subarray(self, nums):
length = len(nums)
if length <= 1:
return 0
stack = []
(left, right) = (length - 1, 0)
for i in range(length):
while stack and nums[stack[-1]] > nums[i]:
left = min(left, stack.pop())
stack.append(i)
if left == length - 1:
return 0
stack = []
for j in range(length - 1, -1, -1):
while stack and nums[stack[-1]] < nums[j]:
right = max(right, stack.pop())
stack.append(j)
return right - left + 1
|
# encoding: utf-8
# module Autodesk.AutoCAD.DatabaseServices
# from D:\Python\ironpython-stubs\release\stubs\Autodesk\AutoCAD\DatabaseServices\__init__.py
# by generator 1.145
# no doc
# no imports
# no functions
# no classes
# variables with complex values
__path__ = [
'D:\\Python\\ironpython-stubs\\release\\stubs\\Autodesk\\AutoCAD\\DatabaseServices',
]
|
__path__ = ['D:\\Python\\ironpython-stubs\\release\\stubs\\Autodesk\\AutoCAD\\DatabaseServices']
|
class InMemoryKVAdapter:
""" Dummy in-memory key-value store to be used as mock for KVAdapter"""
def __init__(self):
self._data = {}
def get_key(self, key):
root, key = self._navigate(key)
return root.get(key, None)
def get_keys(self, key):
root, key = self._navigate(key)
for sub_key in list(root.keys()):
if sub_key.startswith(key):
yield sub_key, root.get(sub_key)
def put_key(self, key, value):
root, key = self._navigate(key)
root[key] = value
def delete_key(self, key, recursive=False):
root, key = self._navigate(key)
for sub_key in list(root.keys()):
if sub_key.startswith(key):
root.pop(sub_key)
def _navigate(self, key):
root = self._data
return root, key
|
class Inmemorykvadapter:
""" Dummy in-memory key-value store to be used as mock for KVAdapter"""
def __init__(self):
self._data = {}
def get_key(self, key):
(root, key) = self._navigate(key)
return root.get(key, None)
def get_keys(self, key):
(root, key) = self._navigate(key)
for sub_key in list(root.keys()):
if sub_key.startswith(key):
yield (sub_key, root.get(sub_key))
def put_key(self, key, value):
(root, key) = self._navigate(key)
root[key] = value
def delete_key(self, key, recursive=False):
(root, key) = self._navigate(key)
for sub_key in list(root.keys()):
if sub_key.startswith(key):
root.pop(sub_key)
def _navigate(self, key):
root = self._data
return (root, key)
|
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 29 15:59:53 2020
@author: Pablo
"""
class Term:
string = ''
lang = ''
score=0
corpus=''
synonyms=[]
iateURL=''
translations = {}
def __init__(self, term, code):
self.string = term
self.lang = code
def get_data(self):
print(self.string+' '+self.lang+' Synonyms: '+''.join(self.synonyms))
print(self.translations)
def getJson(self):
return { 'lang':self.lang}
termino1 = Term('trabajador','es')
termino2 = Term('worker', 'en')
termino1.get_data()
termino2.get_data()
'''
lista=[]
lista.append(termino1)
lista.append(termino2)
print(lista)
# Adding list as value
termino1.translations["de"] = ['sdsssss']
termino1.translations["en"] = ["worker", "laborist"]
print(termino1.translations.get('en'))
termino1.get_data()
termino1.synonyms.append('estatuto trabajadores')
termino1.get_data()
del termino1.synonyms[0]
termino1.getJson()
'''
|
"""
Created on Tue Sep 29 15:59:53 2020
@author: Pablo
"""
class Term:
string = ''
lang = ''
score = 0
corpus = ''
synonyms = []
iate_url = ''
translations = {}
def __init__(self, term, code):
self.string = term
self.lang = code
def get_data(self):
print(self.string + ' ' + self.lang + ' Synonyms: ' + ''.join(self.synonyms))
print(self.translations)
def get_json(self):
return {'lang': self.lang}
termino1 = term('trabajador', 'es')
termino2 = term('worker', 'en')
termino1.get_data()
termino2.get_data()
'\n\nlista=[]\nlista.append(termino1)\nlista.append(termino2)\nprint(lista)\n\n\n # Adding list as value \ntermino1.translations["de"] = [\'sdsssss\'] \ntermino1.translations["en"] = ["worker", "laborist"] \n\nprint(termino1.translations.get(\'en\'))\n\ntermino1.get_data()\n\ntermino1.synonyms.append(\'estatuto trabajadores\')\ntermino1.get_data()\n\n\ndel termino1.synonyms[0]\n\ntermino1.getJson()\n\n'
|
# Basic - Print all integers from 0 to 150.
y = 0
while y <= 150:
print(y)
y = y + 1
# Multiples of Five - Print all the multiples of 5 from 5 to 1,000
x = 5
while x < 1001:
print(x)
x = x + 5
# Counting, the Dojo Way - Print integers 1 to 100. If divisible by 5, print "Coding" instead. If divisible by 10, print "Coding Dojo".
j = 0
txt = "Coding"
while j < 101:
if j % 10 == 0:
print(txt + "Dojo")
elif j % 5 == 0:
print(txt)
else:
print(j)
j += 1
# Whoa. That Sucker's Huge - Add odd integers from 0 to 500,000, and print the final sum.
z = 0
sum = 0
while z < 500000:
if z % 2 != 0:
sum = sum + z
# Countdown by Fours - Print positive numbers starting at 2018, counting down by fours.
count = 2018
while count > 0:
if count % 2 == 0:
print(count)
# Flexible Counter - Set three variables: lowNum, highNum, mult. Starting at lowNum and going through highNum, print only the integers that are a multiple of mult. For example, if lowNum=2, highNum=9, and mult=3, the loop should print 3, 6, 9 (on successive lines)
lowNum = 1
highNum = 99
mult = 3
validNum = 0
while lowNum < highNum:
if lowNum/mult == validNum:
print(lowNum)
lowNum + 1
|
y = 0
while y <= 150:
print(y)
y = y + 1
x = 5
while x < 1001:
print(x)
x = x + 5
j = 0
txt = 'Coding'
while j < 101:
if j % 10 == 0:
print(txt + 'Dojo')
elif j % 5 == 0:
print(txt)
else:
print(j)
j += 1
z = 0
sum = 0
while z < 500000:
if z % 2 != 0:
sum = sum + z
count = 2018
while count > 0:
if count % 2 == 0:
print(count)
low_num = 1
high_num = 99
mult = 3
valid_num = 0
while lowNum < highNum:
if lowNum / mult == validNum:
print(lowNum)
lowNum + 1
|
##write a function that takes a nested list as an argument
##and returns a normal list
##show that the result is equal to flattened_list
nested_list = ['a', [2, 3], [4, 'b', [0, -2, ['c', 'e', '0f']]]]
flattened_list = ['a', 2, 3, 4, 'b', 0, -2, 'c', 'e', '0f']
def flat_list(nest_list):
flat = list()
for elem in nest_list:
if type(elem) is list: # we check if elem is a list
flat += flat_list(elem) # recursive function!
# this is a function that calls
# itself in a loop, until a case is
# simple enough to be processed
# directly!
else:
# if elem is not a list, we append it to 'flat'
flat.append(elem)
return flat
res = flat_list(nested_list)
print(res==flattened_list)
|
nested_list = ['a', [2, 3], [4, 'b', [0, -2, ['c', 'e', '0f']]]]
flattened_list = ['a', 2, 3, 4, 'b', 0, -2, 'c', 'e', '0f']
def flat_list(nest_list):
flat = list()
for elem in nest_list:
if type(elem) is list:
flat += flat_list(elem)
else:
flat.append(elem)
return flat
res = flat_list(nested_list)
print(res == flattened_list)
|
''' Program to count each character's frequency
Example:
Input: banana
Output: a3b1n2
'''
def frequency(input1):
l = list(input1)
x= list(set(l))
x.sort()
result=""
for i in range(0,len(x)):
count=0
for j in range(0,len(l)):
if x[i]==l[j]:
count +=1
result += x[i]+str(count)
print(result)
s = input()
frequency(s)
|
""" Program to count each character's frequency
Example:
Input: banana
Output: a3b1n2
"""
def frequency(input1):
l = list(input1)
x = list(set(l))
x.sort()
result = ''
for i in range(0, len(x)):
count = 0
for j in range(0, len(l)):
if x[i] == l[j]:
count += 1
result += x[i] + str(count)
print(result)
s = input()
frequency(s)
|
class VarDecl:
def __init__(self, name: str, type: str):
self._name = name
self._type = type
def name(self) -> str:
return self._name
def type(self) -> str:
return self._type
|
class Vardecl:
def __init__(self, name: str, type: str):
self._name = name
self._type = type
def name(self) -> str:
return self._name
def type(self) -> str:
return self._type
|
# DROP TABLES
# The following CQL queries drop all the tables from sparkifydb.
song_in_session_table_drop = "DROP TABLE IF EXISTS song_in_session"
artist_in_session_table_drop = "DROP TABLE IF EXISTS artist_in_session"
user_and_song_table_drop = "DROP TABLE IF EXISTS user_and_song"
# CREATE TABLES
# The following CQL queries create tables to sparkifydb.
song_in_session_table_create = ("""
CREATE TABLE IF NOT EXISTS song_in_session (
session_id int, \
item_in_session int, \
artist text, \
song text, \
length float, \
PRIMARY KEY(session_id, item_in_session))
""")
artist_in_session_table_create = ("""
CREATE TABLE IF NOT EXISTS artist_in_session (
user_id int, \
session_id int, \
artist text, \
song text, \
item_in_session int, \
first_name text, \
last_name text, \
PRIMARY KEY((user_id, session_id), item_in_session)
)
""")
user_and_song_table_create = ("""
CREATE TABLE IF NOT EXISTS user_and_song (
song text, \
user_id int, \
first_name text, \
last_name text, \
PRIMARY KEY(song, user_id)
)
""")
# INSERT RECORDS
# The following CQL queries insert data into sparkifydb tables.
song_in_session_insert = ("""
INSERT INTO song_in_session ( session_id, \
item_in_session, \
artist, \
song, \
length)
VALUES (%s, %s, %s, %s, %s)
""")
artist_in_session_insert = ("""
INSERT INTO artist_in_session ( user_id, \
session_id, \
artist, \
song, \
item_in_session, \
first_name, \
last_name)
VALUES (%s, %s, %s, %s, %s, %s, %s)
""")
user_and_song_insert = ("""
INSERT INTO user_and_song ( song, \
user_id, \
first_name, \
last_name)
VALUES (%s, %s, %s, %s)
""")
# FIND QUERIES
# The follwowing queries select data from DB.
#
# Query-1: Give me the artist, song title and song's length
# in the music app history that was heard during sessionId = 338,
# and itemInSession = 4
song_in_session_select = ("""
SELECT artist, song, length
FROM song_in_session \
WHERE session_id = (%s) AND \
item_in_session = (%s)
""")
#
# Query-2: Give me only the following: name of artist,
# song (sorted by itemInSession) and user (first and last name)
# for userid = 10, sessionid = 182
song_in_session_select = ("""
SELECT artist, song, first_name, last_name
FROM song_in_session \
WHERE session_id = (%s) AND \
item_in_session = (%s)
""")
#
# Query-3: Give me every user name (first and last) in my music app
# history who listened to the song 'All Hands Against His Own'
user_and_song_select = ("""
SELECT first_name, last_name
FROM user_and_song \
WHERE song = (%s)
""")
#QUERY LISTS
create_table_queries = [song_in_session_table_create, artist_in_session_table_create, user_and_song_table_create]
drop_table_queries = [song_in_session_table_drop, artist_in_session_table_drop, user_and_song_table_drop]
|
song_in_session_table_drop = 'DROP TABLE IF EXISTS song_in_session'
artist_in_session_table_drop = 'DROP TABLE IF EXISTS artist_in_session'
user_and_song_table_drop = 'DROP TABLE IF EXISTS user_and_song'
song_in_session_table_create = '\n CREATE TABLE IF NOT EXISTS song_in_session (\n session_id int, item_in_session int, artist text, song text, length float, PRIMARY KEY(session_id, item_in_session))\n'
artist_in_session_table_create = '\n CREATE TABLE IF NOT EXISTS artist_in_session (\n user_id int, session_id int, artist text, song text, item_in_session int, first_name text, last_name text, PRIMARY KEY((user_id, session_id), item_in_session)\n )\n'
user_and_song_table_create = '\n CREATE TABLE IF NOT EXISTS user_and_song (\n song text, user_id int, first_name text, last_name text, PRIMARY KEY(song, user_id)\n )\n'
song_in_session_insert = '\n INSERT INTO song_in_session ( session_id, item_in_session, artist, song, length)\n VALUES (%s, %s, %s, %s, %s)\n'
artist_in_session_insert = '\n INSERT INTO artist_in_session ( user_id, session_id, artist, song, item_in_session, first_name, last_name)\n VALUES (%s, %s, %s, %s, %s, %s, %s)\n'
user_and_song_insert = '\n INSERT INTO user_and_song ( song, user_id, first_name, last_name)\n VALUES (%s, %s, %s, %s)\n'
song_in_session_select = '\n SELECT artist, song, length\n FROM song_in_session WHERE session_id = (%s) AND item_in_session = (%s)\n'
song_in_session_select = '\n SELECT artist, song, first_name, last_name\n FROM song_in_session WHERE session_id = (%s) AND item_in_session = (%s)\n'
user_and_song_select = '\n SELECT first_name, last_name\n FROM user_and_song WHERE song = (%s)\n'
create_table_queries = [song_in_session_table_create, artist_in_session_table_create, user_and_song_table_create]
drop_table_queries = [song_in_session_table_drop, artist_in_session_table_drop, user_and_song_table_drop]
|
class DataGridViewCell(DataGridViewElement,ICloneable,IDisposable):
""" Represents an individual cell in a System.Windows.Forms.DataGridView control. """
def AdjustCellBorderStyle(self,dataGridViewAdvancedBorderStyleInput,dataGridViewAdvancedBorderStylePlaceholder,singleVerticalBorderAdded,singleHorizontalBorderAdded,isFirstDisplayedColumn,isFirstDisplayedRow):
"""
AdjustCellBorderStyle(self: DataGridViewCell,dataGridViewAdvancedBorderStyleInput: DataGridViewAdvancedBorderStyle,dataGridViewAdvancedBorderStylePlaceholder: DataGridViewAdvancedBorderStyle,singleVerticalBorderAdded: bool,singleHorizontalBorderAdded: bool,isFirstDisplayedColumn: bool,isFirstDisplayedRow: bool) -> DataGridViewAdvancedBorderStyle
Modifies the input cell border style according to the specified criteria.
dataGridViewAdvancedBorderStyleInput: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that represents the cell
border style to modify.
dataGridViewAdvancedBorderStylePlaceholder: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that is used to store
intermediate changes to the cell border style.
singleVerticalBorderAdded: true to add a vertical border to the cell; otherwise,false.
singleHorizontalBorderAdded: true to add a horizontal border to the cell; otherwise,false.
isFirstDisplayedColumn: true if the hosting cell is in the first visible column; otherwise,false.
isFirstDisplayedRow: true if the hosting cell is in the first visible row; otherwise,false.
Returns: The modified System.Windows.Forms.DataGridViewAdvancedBorderStyle.
"""
pass
def BorderWidths(self,*args):
"""
BorderWidths(self: DataGridViewCell,advancedBorderStyle: DataGridViewAdvancedBorderStyle) -> Rectangle
Returns a System.Drawing.Rectangle that represents the widths of all the cell
margins.
advancedBorderStyle: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that the margins are to
be calculated for.
Returns: A System.Drawing.Rectangle that represents the widths of all the cell margins.
"""
pass
def ClickUnsharesRow(self,*args):
"""
ClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell is clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnClick(System.Windows.Forms.DataGridViewC
ellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def Clone(self):
"""
Clone(self: DataGridViewCell) -> object
Creates an exact copy of this cell.
Returns: An System.Object that represents the cloned
System.Windows.Forms.DataGridViewCell.
"""
pass
def ContentClickUnsharesRow(self,*args):
"""
ContentClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell's content is
clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnContentClick(System.Windows.Forms.DataGr
idViewCellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def ContentDoubleClickUnsharesRow(self,*args):
"""
ContentDoubleClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell's content is
double-clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnContentDoubleClick(System.Windows.Forms.
DataGridViewCellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def CreateAccessibilityInstance(self,*args):
"""
CreateAccessibilityInstance(self: DataGridViewCell) -> AccessibleObject
Creates a new accessible object for the System.Windows.Forms.DataGridViewCell.
Returns: A new System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject
for the System.Windows.Forms.DataGridViewCell.
"""
pass
def DetachEditingControl(self):
"""
DetachEditingControl(self: DataGridViewCell)
Removes the cell's editing control from the System.Windows.Forms.DataGridView.
"""
pass
def Dispose(self):
"""
Dispose(self: DataGridViewCell)
Releases all resources used by the System.Windows.Forms.DataGridViewCell.
"""
pass
def DoubleClickUnsharesRow(self,*args):
"""
DoubleClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell is
double-clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnDoubleClick(System.Windows.Forms.DataGri
dViewCellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def EnterUnsharesRow(self,*args):
"""
EnterUnsharesRow(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool) -> bool
Indicates whether the parent row will be unshared when the focus moves to the
cell.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus to the cell; false if a programmatic
operation moved focus to the cell.
Returns: true if the row will be unshared; otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def GetClipboardContent(self,*args):
"""
GetClipboardContent(self: DataGridViewCell,rowIndex: int,firstCell: bool,lastCell: bool,inFirstRow: bool,inLastRow: bool,format: str) -> object
Retrieves the formatted value of the cell to copy to the
System.Windows.Forms.Clipboard.
rowIndex: The zero-based index of the row containing the cell.
firstCell: true to indicate that the cell is in the first column of the region defined by
the selected cells; otherwise,false.
lastCell: true to indicate that the cell is the last column of the region defined by the
selected cells; otherwise,false.
inFirstRow: true to indicate that the cell is in the first row of the region defined by the
selected cells; otherwise,false.
inLastRow: true to indicate that the cell is in the last row of the region defined by the
selected cells; otherwise,false.
format: The current format string of the cell.
Returns: An System.Object that represents the value of the cell to copy to the
System.Windows.Forms.Clipboard.
"""
pass
def GetContentBounds(self,rowIndex):
"""
GetContentBounds(self: DataGridViewCell,rowIndex: int) -> Rectangle
Returns the bounding rectangle that encloses the cell's content area using a
default System.Drawing.Graphics and cell style currently in effect for the
cell.
rowIndex: The index of the cell's parent row.
Returns: The System.Drawing.Rectangle that bounds the cell's contents.
"""
pass
def GetEditedFormattedValue(self,rowIndex,context):
"""
GetEditedFormattedValue(self: DataGridViewCell,rowIndex: int,context: DataGridViewDataErrorContexts) -> object
Returns the current,formatted value of the cell,regardless of whether the
cell is in edit mode and the value has not been committed.
rowIndex: The row index of the cell.
context: A bitwise combination of System.Windows.Forms.DataGridViewDataErrorContexts
values that specifies the data error context.
Returns: The current,formatted value of the System.Windows.Forms.DataGridViewCell.
"""
pass
def GetErrorIconBounds(self,*args):
"""
GetErrorIconBounds(self: DataGridViewCell,graphics: Graphics,cellStyle: DataGridViewCellStyle,rowIndex: int) -> Rectangle
Returns the bounding rectangle that encloses the cell's error icon,if one is
displayed.
graphics: The graphics context for the cell.
cellStyle: The System.Windows.Forms.DataGridViewCellStyle to be applied to the cell.
rowIndex: The index of the cell's parent row.
Returns: The System.Drawing.Rectangle that bounds the cell's error icon,if one is
displayed; otherwise,System.Drawing.Rectangle.Empty.
"""
pass
def GetErrorText(self,*args):
"""
GetErrorText(self: DataGridViewCell,rowIndex: int) -> str
Returns a string that represents the error for the cell.
rowIndex: The row index of the cell.
Returns: A string that describes the error for the current
System.Windows.Forms.DataGridViewCell.
"""
pass
def GetFormattedValue(self,*args):
"""
GetFormattedValue(self: DataGridViewCell,value: object,rowIndex: int,cellStyle: DataGridViewCellStyle,valueTypeConverter: TypeConverter,formattedValueTypeConverter: TypeConverter,context: DataGridViewDataErrorContexts) -> (object,DataGridViewCellStyle)
Gets the value of the cell as formatted for display.
value: The value to be formatted.
rowIndex: The index of the cell's parent row.
cellStyle: The System.Windows.Forms.DataGridViewCellStyle in effect for the cell.
valueTypeConverter: A System.ComponentModel.TypeConverter associated with the value type that
provides custom conversion to the formatted value type,or null if no such
custom conversion is needed.
formattedValueTypeConverter: A System.ComponentModel.TypeConverter associated with the formatted value type
that provides custom conversion from the value type,or null if no such custom
conversion is needed.
context: A bitwise combination of System.Windows.Forms.DataGridViewDataErrorContexts
values describing the context in which the formatted value is needed.
Returns: The formatted value of the cell or null if the cell does not belong to a
System.Windows.Forms.DataGridView control.
"""
pass
def GetInheritedContextMenuStrip(self,rowIndex):
"""
GetInheritedContextMenuStrip(self: DataGridViewCell,rowIndex: int) -> ContextMenuStrip
Gets the inherited shortcut menu for the current cell.
rowIndex: The row index of the current cell.
Returns: A System.Windows.Forms.ContextMenuStrip if the parent
System.Windows.Forms.DataGridView,System.Windows.Forms.DataGridViewRow,or
System.Windows.Forms.DataGridViewColumn has a
System.Windows.Forms.ContextMenuStrip assigned; otherwise,null.
"""
pass
def GetInheritedState(self,rowIndex):
"""
GetInheritedState(self: DataGridViewCell,rowIndex: int) -> DataGridViewElementStates
Returns a value indicating the current state of the cell as inherited from the
state of its row and column.
rowIndex: The index of the row containing the cell.
Returns: A bitwise combination of System.Windows.Forms.DataGridViewElementStates values
representing the current state of the cell.
"""
pass
def GetInheritedStyle(self,inheritedCellStyle,rowIndex,includeColors):
"""
GetInheritedStyle(self: DataGridViewCell,inheritedCellStyle: DataGridViewCellStyle,rowIndex: int,includeColors: bool) -> DataGridViewCellStyle
Gets the style applied to the cell.
inheritedCellStyle: A System.Windows.Forms.DataGridViewCellStyle to be populated with the inherited
cell style.
rowIndex: The index of the cell's parent row.
includeColors: true to include inherited colors in the returned cell style; otherwise,false.
Returns: A System.Windows.Forms.DataGridViewCellStyle that includes the style settings
of the cell inherited from the cell's parent row,column,and
System.Windows.Forms.DataGridView.
"""
pass
def GetPreferredSize(self,*args):
"""
GetPreferredSize(self: DataGridViewCell,graphics: Graphics,cellStyle: DataGridViewCellStyle,rowIndex: int,constraintSize: Size) -> Size
Calculates the preferred size,in pixels,of the cell.
graphics: The System.Drawing.Graphics used to draw the cell.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell.
rowIndex: The zero-based row index of the cell.
constraintSize: The cell's maximum allowable size.
Returns: A System.Drawing.Size that represents the preferred size,in pixels,of the
cell.
"""
pass
def GetSize(self,*args):
"""
GetSize(self: DataGridViewCell,rowIndex: int) -> Size
Gets the size of the cell.
rowIndex: The index of the cell's parent row.
Returns: A System.Drawing.Size representing the cell's dimensions.
"""
pass
def GetValue(self,*args):
"""
GetValue(self: DataGridViewCell,rowIndex: int) -> object
Gets the value of the cell.
rowIndex: The index of the cell's parent row.
Returns: The value contained in the System.Windows.Forms.DataGridViewCell.
"""
pass
def InitializeEditingControl(self,rowIndex,initialFormattedValue,dataGridViewCellStyle):
"""
InitializeEditingControl(self: DataGridViewCell,rowIndex: int,initialFormattedValue: object,dataGridViewCellStyle: DataGridViewCellStyle)
Initializes the control used to edit the cell.
rowIndex: The zero-based row index of the cell's location.
initialFormattedValue: An System.Object that represents the value displayed by the cell when editing
is started.
dataGridViewCellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell.
"""
pass
def KeyDownUnsharesRow(self,*args):
"""
KeyDownUnsharesRow(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int) -> bool
Indicates whether the parent row is unshared if the user presses a key while
the focus is on the cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def KeyEntersEditMode(self,e):
"""
KeyEntersEditMode(self: DataGridViewCell,e: KeyEventArgs) -> bool
Determines if edit mode should be started based on the given key.
e: A System.Windows.Forms.KeyEventArgs that represents the key that was pressed.
Returns: true if edit mode should be started; otherwise,false. The default is false.
"""
pass
def KeyPressUnsharesRow(self,*args):
"""
KeyPressUnsharesRow(self: DataGridViewCell,e: KeyPressEventArgs,rowIndex: int) -> bool
Indicates whether a row will be unshared if a key is pressed while a cell in
the row has focus.
e: A System.Windows.Forms.KeyPressEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def KeyUpUnsharesRow(self,*args):
"""
KeyUpUnsharesRow(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int) -> bool
Indicates whether the parent row is unshared when the user releases a key while
the focus is on the cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def LeaveUnsharesRow(self,*args):
"""
LeaveUnsharesRow(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool) -> bool
Indicates whether a row will be unshared when the focus leaves a cell in the
row.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus to the cell; false if a programmatic
operation moved focus to the cell.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
@staticmethod
def MeasureTextHeight(graphics,text,font,maxWidth,flags,widthTruncated=None):
"""
MeasureTextHeight(graphics: Graphics,text: str,font: Font,maxWidth: int,flags: TextFormatFlags) -> (int,bool)
Gets the height,in pixels,of the specified text,given the specified
characteristics. Also indicates whether the required width is greater than the
specified maximum width.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxWidth: The maximum width of the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: The height,in pixels,of the text.
MeasureTextHeight(graphics: Graphics,text: str,font: Font,maxWidth: int,flags: TextFormatFlags) -> int
Gets the height,in pixels,of the specified text,given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxWidth: The maximum width of the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: The height,in pixels,of the text.
"""
pass
@staticmethod
def MeasureTextPreferredSize(graphics,text,font,maxRatio,flags):
"""
MeasureTextPreferredSize(graphics: Graphics,text: str,font: Font,maxRatio: Single,flags: TextFormatFlags) -> Size
Gets the ideal height and width of the specified text given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxRatio: The maximum width-to-height ratio of the block of text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: A System.Drawing.Size representing the preferred height and width of the text.
"""
pass
@staticmethod
def MeasureTextSize(graphics,text,font,flags):
"""
MeasureTextSize(graphics: Graphics,text: str,font: Font,flags: TextFormatFlags) -> Size
Gets the height and width of the specified text given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: A System.Drawing.Size representing the height and width of the text.
"""
pass
@staticmethod
def MeasureTextWidth(graphics,text,font,maxHeight,flags):
"""
MeasureTextWidth(graphics: Graphics,text: str,font: Font,maxHeight: int,flags: TextFormatFlags) -> int
Gets the width,in pixels,of the specified text given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxHeight: The maximum height of the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: The width,in pixels,of the text.
"""
pass
def MouseClickUnsharesRow(self,*args):
"""
MouseClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared if the user clicks a mouse button
while the pointer is on a cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def MouseDoubleClickUnsharesRow(self,*args):
"""
MouseDoubleClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared if the user double-clicks a cell in
the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def MouseDownUnsharesRow(self,*args):
"""
MouseDownUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared when the user holds down a mouse
button while the pointer is on a cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def MouseEnterUnsharesRow(self,*args):
"""
MouseEnterUnsharesRow(self: DataGridViewCell,rowIndex: int) -> bool
Indicates whether a row will be unshared when the mouse pointer moves over a
cell in the row.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def MouseLeaveUnsharesRow(self,*args):
"""
MouseLeaveUnsharesRow(self: DataGridViewCell,rowIndex: int) -> bool
Indicates whether a row will be unshared when the mouse pointer leaves the row.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def MouseMoveUnsharesRow(self,*args):
"""
MouseMoveUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared when the mouse pointer moves over a
cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def MouseUpUnsharesRow(self,*args):
"""
MouseUpUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared when the user releases a mouse button
while the pointer is on a cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def OnClick(self,*args):
"""
OnClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell is clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def OnContentClick(self,*args):
"""
OnContentClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell's contents are clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def OnContentDoubleClick(self,*args):
"""
OnContentDoubleClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell's contents are double-clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def OnDataGridViewChanged(self,*args):
"""
OnDataGridViewChanged(self: DataGridViewCell)
Called when the System.Windows.Forms.DataGridViewElement.DataGridView property
of the cell changes.
"""
pass
def OnDoubleClick(self,*args):
"""
OnDoubleClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell is double-clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def OnEnter(self,*args):
"""
OnEnter(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool)
Called when the focus moves to a cell.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus to the cell; false if a programmatic
operation moved focus to the cell.
"""
pass
def OnKeyDown(self,*args):
"""
OnKeyDown(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int)
Called when a character key is pressed while the focus is on a cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
"""
pass
def OnKeyPress(self,*args):
"""
OnKeyPress(self: DataGridViewCell,e: KeyPressEventArgs,rowIndex: int)
Called when a key is pressed while the focus is on a cell.
e: A System.Windows.Forms.KeyPressEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
"""
pass
def OnKeyUp(self,*args):
"""
OnKeyUp(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int)
Called when a character key is released while the focus is on a cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
"""
pass
def OnLeave(self,*args):
"""
OnLeave(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool)
Called when the focus moves from a cell.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus from the cell; false if a programmatic
operation moved focus from the cell.
"""
pass
def OnMouseClick(self,*args):
"""
OnMouseClick(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user clicks a mouse button while the pointer is on a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def OnMouseDoubleClick(self,*args):
"""
OnMouseDoubleClick(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user double-clicks a mouse button while the pointer is on a
cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def OnMouseDown(self,*args):
"""
OnMouseDown(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user holds down a mouse button while the pointer is on a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def OnMouseEnter(self,*args):
"""
OnMouseEnter(self: DataGridViewCell,rowIndex: int)
Called when the mouse pointer moves over a cell.
rowIndex: The index of the cell's parent row.
"""
pass
def OnMouseLeave(self,*args):
"""
OnMouseLeave(self: DataGridViewCell,rowIndex: int)
Called when the mouse pointer leaves the cell.
rowIndex: The index of the cell's parent row.
"""
pass
def OnMouseMove(self,*args):
"""
OnMouseMove(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the mouse pointer moves within a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def OnMouseUp(self,*args):
"""
OnMouseUp(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user releases a mouse button while the pointer is on a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def Paint(self,*args):
"""
Paint(self: DataGridViewCell,graphics: Graphics,clipBounds: Rectangle,cellBounds: Rectangle,rowIndex: int,cellState: DataGridViewElementStates,value: object,formattedValue: object,errorText: str,cellStyle: DataGridViewCellStyle,advancedBorderStyle: DataGridViewAdvancedBorderStyle,paintParts: DataGridViewPaintParts)
Paints the current System.Windows.Forms.DataGridViewCell.
graphics: The System.Drawing.Graphics used to paint the
System.Windows.Forms.DataGridViewCell.
clipBounds: A System.Drawing.Rectangle that represents the area of the
System.Windows.Forms.DataGridView that needs to be repainted.
cellBounds: A System.Drawing.Rectangle that contains the bounds of the
System.Windows.Forms.DataGridViewCell that is being painted.
rowIndex: The row index of the cell that is being painted.
cellState: A bitwise combination of System.Windows.Forms.DataGridViewElementStates values
that specifies the state of the cell.
value: The data of the System.Windows.Forms.DataGridViewCell that is being painted.
formattedValue: The formatted data of the System.Windows.Forms.DataGridViewCell that is being
painted.
errorText: An error message that is associated with the cell.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that contains formatting and style
information about the cell.
advancedBorderStyle: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that contains border
styles for the cell that is being painted.
paintParts: A bitwise combination of the System.Windows.Forms.DataGridViewPaintParts values
that specifies which parts of the cell need to be painted.
"""
pass
def PaintBorder(self,*args):
"""
PaintBorder(self: DataGridViewCell,graphics: Graphics,clipBounds: Rectangle,bounds: Rectangle,cellStyle: DataGridViewCellStyle,advancedBorderStyle: DataGridViewAdvancedBorderStyle)
Paints the border of the current System.Windows.Forms.DataGridViewCell.
graphics: The System.Drawing.Graphics used to paint the border.
clipBounds: A System.Drawing.Rectangle that represents the area of the
System.Windows.Forms.DataGridView that needs to be repainted.
bounds: A System.Drawing.Rectangle that contains the area of the border that is being
painted.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that contains formatting and style
information about the current cell.
advancedBorderStyle: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that contains border
styles of the border that is being painted.
"""
pass
def PaintErrorIcon(self,*args):
"""
PaintErrorIcon(self: DataGridViewCell,graphics: Graphics,clipBounds: Rectangle,cellValueBounds: Rectangle,errorText: str)
Paints the error icon of the current System.Windows.Forms.DataGridViewCell.
graphics: The System.Drawing.Graphics used to paint the border.
clipBounds: A System.Drawing.Rectangle that represents the area of the
System.Windows.Forms.DataGridView that needs to be repainted.
cellValueBounds: The bounding System.Drawing.Rectangle that encloses the cell's content area.
errorText: An error message that is associated with the cell.
"""
pass
def ParseFormattedValue(self,formattedValue,cellStyle,formattedValueTypeConverter,valueTypeConverter):
"""
ParseFormattedValue(self: DataGridViewCell,formattedValue: object,cellStyle: DataGridViewCellStyle,formattedValueTypeConverter: TypeConverter,valueTypeConverter: TypeConverter) -> object
Converts a value formatted for display to an actual cell value.
formattedValue: The display value of the cell.
cellStyle: The System.Windows.Forms.DataGridViewCellStyle in effect for the cell.
formattedValueTypeConverter: A System.ComponentModel.TypeConverter for the display value type,or null to
use the default converter.
valueTypeConverter: A System.ComponentModel.TypeConverter for the cell value type,or null to use
the default converter.
Returns: The cell value.
"""
pass
def PositionEditingControl(self,setLocation,setSize,cellBounds,cellClip,cellStyle,singleVerticalBorderAdded,singleHorizontalBorderAdded,isFirstDisplayedColumn,isFirstDisplayedRow):
"""
PositionEditingControl(self: DataGridViewCell,setLocation: bool,setSize: bool,cellBounds: Rectangle,cellClip: Rectangle,cellStyle: DataGridViewCellStyle,singleVerticalBorderAdded: bool,singleHorizontalBorderAdded: bool,isFirstDisplayedColumn: bool,isFirstDisplayedRow: bool)
Sets the location and size of the editing control hosted by a cell in the
System.Windows.Forms.DataGridView control.
setLocation: true to have the control placed as specified by the other arguments; false to
allow the control to place itself.
setSize: true to specify the size; false to allow the control to size itself.
cellBounds: A System.Drawing.Rectangle that defines the cell bounds.
cellClip: The area that will be used to paint the editing control.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell being edited.
singleVerticalBorderAdded: true to add a vertical border to the cell; otherwise,false.
singleHorizontalBorderAdded: true to add a horizontal border to the cell; otherwise,false.
isFirstDisplayedColumn: true if the hosting cell is in the first visible column; otherwise,false.
isFirstDisplayedRow: true if the hosting cell is in the first visible row; otherwise,false.
"""
pass
def PositionEditingPanel(self,cellBounds,cellClip,cellStyle,singleVerticalBorderAdded,singleHorizontalBorderAdded,isFirstDisplayedColumn,isFirstDisplayedRow):
"""
PositionEditingPanel(self: DataGridViewCell,cellBounds: Rectangle,cellClip: Rectangle,cellStyle: DataGridViewCellStyle,singleVerticalBorderAdded: bool,singleHorizontalBorderAdded: bool,isFirstDisplayedColumn: bool,isFirstDisplayedRow: bool) -> Rectangle
Sets the location and size of the editing panel hosted by the cell,and returns
the normal bounds of the editing control within the editing panel.
cellBounds: A System.Drawing.Rectangle that defines the cell bounds.
cellClip: The area that will be used to paint the editing panel.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell being edited.
singleVerticalBorderAdded: true to add a vertical border to the cell; otherwise,false.
singleHorizontalBorderAdded: true to add a horizontal border to the cell; otherwise,false.
isFirstDisplayedColumn: true if the cell is in the first column currently displayed in the control;
otherwise,false.
isFirstDisplayedRow: true if the cell is in the first row currently displayed in the control;
otherwise,false.
Returns: A System.Drawing.Rectangle that represents the normal bounds of the editing
control within the editing panel.
"""
pass
def RaiseCellClick(self,*args):
"""
RaiseCellClick(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellClick event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def RaiseCellContentClick(self,*args):
"""
RaiseCellContentClick(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellContentClick event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def RaiseCellContentDoubleClick(self,*args):
"""
RaiseCellContentDoubleClick(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellContentDoubleClick event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def RaiseCellValueChanged(self,*args):
"""
RaiseCellValueChanged(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellValueChanged event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def RaiseDataError(self,*args):
"""
RaiseDataError(self: DataGridViewElement,e: DataGridViewDataErrorEventArgs)
Raises the System.Windows.Forms.DataGridView.DataError event.
e: A System.Windows.Forms.DataGridViewDataErrorEventArgs that contains the event
data.
"""
pass
def RaiseMouseWheel(self,*args):
"""
RaiseMouseWheel(self: DataGridViewElement,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseWheel event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def SetValue(self,*args):
"""
SetValue(self: DataGridViewCell,rowIndex: int,value: object) -> bool
Sets the value of the cell.
rowIndex: The index of the cell's parent row.
value: The cell value to set.
Returns: true if the value has been set; otherwise,false.
"""
pass
def ToString(self):
"""
ToString(self: DataGridViewCell) -> str
Returns a string that describes the current object.
Returns: A string that represents the current object.
"""
pass
def __enter__(self,*args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self,*args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __str__(self,*args):
pass
AccessibilityObject=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject assigned to the System.Windows.Forms.DataGridViewCell.
Get: AccessibilityObject(self: DataGridViewCell) -> AccessibleObject
"""
ColumnIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the column index for this cell.
Get: ColumnIndex(self: DataGridViewCell) -> int
"""
ContentBounds=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the bounding rectangle that encloses the cell's content area.
Get: ContentBounds(self: DataGridViewCell) -> Rectangle
"""
ContextMenuStrip=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the shortcut menu associated with the cell.
Get: ContextMenuStrip(self: DataGridViewCell) -> ContextMenuStrip
Set: ContextMenuStrip(self: DataGridViewCell)=value
"""
DefaultNewRowValue=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the default value for a cell in the row for new records.
Get: DefaultNewRowValue(self: DataGridViewCell) -> object
"""
Displayed=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that indicates whether the cell is currently displayed on-screen.
Get: Displayed(self: DataGridViewCell) -> bool
"""
EditedFormattedValue=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the current,formatted value of the cell,regardless of whether the cell is in edit mode and the value has not been committed.
Get: EditedFormattedValue(self: DataGridViewCell) -> object
"""
EditType=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the type of the cell's hosted editing control.
Get: EditType(self: DataGridViewCell) -> Type
"""
ErrorIconBounds=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the bounds of the error icon for the cell.
Get: ErrorIconBounds(self: DataGridViewCell) -> Rectangle
"""
ErrorText=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the text describing an error condition associated with the cell.
Get: ErrorText(self: DataGridViewCell) -> str
Set: ErrorText(self: DataGridViewCell)=value
"""
FormattedValue=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the value of the cell as formatted for display.
Get: FormattedValue(self: DataGridViewCell) -> object
"""
FormattedValueType=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the type of the formatted value associated with the cell.
Get: FormattedValueType(self: DataGridViewCell) -> Type
"""
Frozen=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the cell is frozen.
Get: Frozen(self: DataGridViewCell) -> bool
"""
HasStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the System.Windows.Forms.DataGridViewCell.Style property has been set.
Get: HasStyle(self: DataGridViewCell) -> bool
"""
InheritedState=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the current state of the cell as inherited from the state of its row and column.
Get: InheritedState(self: DataGridViewCell) -> DataGridViewElementStates
"""
InheritedStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the style currently applied to the cell.
Get: InheritedStyle(self: DataGridViewCell) -> DataGridViewCellStyle
"""
IsInEditMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether this cell is currently being edited.
Get: IsInEditMode(self: DataGridViewCell) -> bool
"""
OwningColumn=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the column that contains this cell.
Get: OwningColumn(self: DataGridViewCell) -> DataGridViewColumn
"""
OwningRow=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the row that contains this cell.
Get: OwningRow(self: DataGridViewCell) -> DataGridViewRow
"""
PreferredSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the size,in pixels,of a rectangular area into which the cell can fit.
Get: PreferredSize(self: DataGridViewCell) -> Size
"""
ReadOnly=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the cell's data can be edited.
Get: ReadOnly(self: DataGridViewCell) -> bool
Set: ReadOnly(self: DataGridViewCell)=value
"""
Resizable=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the cell can be resized.
Get: Resizable(self: DataGridViewCell) -> bool
"""
RowIndex=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the index of the cell's parent row.
Get: RowIndex(self: DataGridViewCell) -> int
"""
Selected=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the cell has been selected.
Get: Selected(self: DataGridViewCell) -> bool
Set: Selected(self: DataGridViewCell)=value
"""
Size=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the size of the cell.
Get: Size(self: DataGridViewCell) -> Size
"""
Style=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the style for the cell.
Get: Style(self: DataGridViewCell) -> DataGridViewCellStyle
Set: Style(self: DataGridViewCell)=value
"""
Tag=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the object that contains supplemental data about the cell.
Get: Tag(self: DataGridViewCell) -> object
Set: Tag(self: DataGridViewCell)=value
"""
ToolTipText=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the ToolTip text associated with this cell.
Get: ToolTipText(self: DataGridViewCell) -> str
Set: ToolTipText(self: DataGridViewCell)=value
"""
Value=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the value associated with this cell.
Get: Value(self: DataGridViewCell) -> object
Set: Value(self: DataGridViewCell)=value
"""
ValueType=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the data type of the values in the cell.
Get: ValueType(self: DataGridViewCell) -> Type
Set: ValueType(self: DataGridViewCell)=value
"""
Visible=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the cell is in a row or column that has been hidden.
Get: Visible(self: DataGridViewCell) -> bool
"""
DataGridViewCellAccessibleObject=None
|
class Datagridviewcell(DataGridViewElement, ICloneable, IDisposable):
""" Represents an individual cell in a System.Windows.Forms.DataGridView control. """
def adjust_cell_border_style(self, dataGridViewAdvancedBorderStyleInput, dataGridViewAdvancedBorderStylePlaceholder, singleVerticalBorderAdded, singleHorizontalBorderAdded, isFirstDisplayedColumn, isFirstDisplayedRow):
"""
AdjustCellBorderStyle(self: DataGridViewCell,dataGridViewAdvancedBorderStyleInput: DataGridViewAdvancedBorderStyle,dataGridViewAdvancedBorderStylePlaceholder: DataGridViewAdvancedBorderStyle,singleVerticalBorderAdded: bool,singleHorizontalBorderAdded: bool,isFirstDisplayedColumn: bool,isFirstDisplayedRow: bool) -> DataGridViewAdvancedBorderStyle
Modifies the input cell border style according to the specified criteria.
dataGridViewAdvancedBorderStyleInput: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that represents the cell
border style to modify.
dataGridViewAdvancedBorderStylePlaceholder: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that is used to store
intermediate changes to the cell border style.
singleVerticalBorderAdded: true to add a vertical border to the cell; otherwise,false.
singleHorizontalBorderAdded: true to add a horizontal border to the cell; otherwise,false.
isFirstDisplayedColumn: true if the hosting cell is in the first visible column; otherwise,false.
isFirstDisplayedRow: true if the hosting cell is in the first visible row; otherwise,false.
Returns: The modified System.Windows.Forms.DataGridViewAdvancedBorderStyle.
"""
pass
def border_widths(self, *args):
"""
BorderWidths(self: DataGridViewCell,advancedBorderStyle: DataGridViewAdvancedBorderStyle) -> Rectangle
Returns a System.Drawing.Rectangle that represents the widths of all the cell
margins.
advancedBorderStyle: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that the margins are to
be calculated for.
Returns: A System.Drawing.Rectangle that represents the widths of all the cell margins.
"""
pass
def click_unshares_row(self, *args):
"""
ClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell is clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnClick(System.Windows.Forms.DataGridViewC
ellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def clone(self):
"""
Clone(self: DataGridViewCell) -> object
Creates an exact copy of this cell.
Returns: An System.Object that represents the cloned
System.Windows.Forms.DataGridViewCell.
"""
pass
def content_click_unshares_row(self, *args):
"""
ContentClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell's content is
clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnContentClick(System.Windows.Forms.DataGr
idViewCellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def content_double_click_unshares_row(self, *args):
"""
ContentDoubleClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell's content is
double-clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnContentDoubleClick(System.Windows.Forms.
DataGridViewCellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def create_accessibility_instance(self, *args):
"""
CreateAccessibilityInstance(self: DataGridViewCell) -> AccessibleObject
Creates a new accessible object for the System.Windows.Forms.DataGridViewCell.
Returns: A new System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject
for the System.Windows.Forms.DataGridViewCell.
"""
pass
def detach_editing_control(self):
"""
DetachEditingControl(self: DataGridViewCell)
Removes the cell's editing control from the System.Windows.Forms.DataGridView.
"""
pass
def dispose(self):
"""
Dispose(self: DataGridViewCell)
Releases all resources used by the System.Windows.Forms.DataGridViewCell.
"""
pass
def double_click_unshares_row(self, *args):
"""
DoubleClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellEventArgs) -> bool
Indicates whether the cell's row will be unshared when the cell is
double-clicked.
e: The System.Windows.Forms.DataGridViewCellEventArgs containing the data passed
to the
System.Windows.Forms.DataGridViewCell.OnDoubleClick(System.Windows.Forms.DataGri
dViewCellEventArgs) method.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def enter_unshares_row(self, *args):
"""
EnterUnsharesRow(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool) -> bool
Indicates whether the parent row will be unshared when the focus moves to the
cell.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus to the cell; false if a programmatic
operation moved focus to the cell.
Returns: true if the row will be unshared; otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def get_clipboard_content(self, *args):
"""
GetClipboardContent(self: DataGridViewCell,rowIndex: int,firstCell: bool,lastCell: bool,inFirstRow: bool,inLastRow: bool,format: str) -> object
Retrieves the formatted value of the cell to copy to the
System.Windows.Forms.Clipboard.
rowIndex: The zero-based index of the row containing the cell.
firstCell: true to indicate that the cell is in the first column of the region defined by
the selected cells; otherwise,false.
lastCell: true to indicate that the cell is the last column of the region defined by the
selected cells; otherwise,false.
inFirstRow: true to indicate that the cell is in the first row of the region defined by the
selected cells; otherwise,false.
inLastRow: true to indicate that the cell is in the last row of the region defined by the
selected cells; otherwise,false.
format: The current format string of the cell.
Returns: An System.Object that represents the value of the cell to copy to the
System.Windows.Forms.Clipboard.
"""
pass
def get_content_bounds(self, rowIndex):
"""
GetContentBounds(self: DataGridViewCell,rowIndex: int) -> Rectangle
Returns the bounding rectangle that encloses the cell's content area using a
default System.Drawing.Graphics and cell style currently in effect for the
cell.
rowIndex: The index of the cell's parent row.
Returns: The System.Drawing.Rectangle that bounds the cell's contents.
"""
pass
def get_edited_formatted_value(self, rowIndex, context):
"""
GetEditedFormattedValue(self: DataGridViewCell,rowIndex: int,context: DataGridViewDataErrorContexts) -> object
Returns the current,formatted value of the cell,regardless of whether the
cell is in edit mode and the value has not been committed.
rowIndex: The row index of the cell.
context: A bitwise combination of System.Windows.Forms.DataGridViewDataErrorContexts
values that specifies the data error context.
Returns: The current,formatted value of the System.Windows.Forms.DataGridViewCell.
"""
pass
def get_error_icon_bounds(self, *args):
"""
GetErrorIconBounds(self: DataGridViewCell,graphics: Graphics,cellStyle: DataGridViewCellStyle,rowIndex: int) -> Rectangle
Returns the bounding rectangle that encloses the cell's error icon,if one is
displayed.
graphics: The graphics context for the cell.
cellStyle: The System.Windows.Forms.DataGridViewCellStyle to be applied to the cell.
rowIndex: The index of the cell's parent row.
Returns: The System.Drawing.Rectangle that bounds the cell's error icon,if one is
displayed; otherwise,System.Drawing.Rectangle.Empty.
"""
pass
def get_error_text(self, *args):
"""
GetErrorText(self: DataGridViewCell,rowIndex: int) -> str
Returns a string that represents the error for the cell.
rowIndex: The row index of the cell.
Returns: A string that describes the error for the current
System.Windows.Forms.DataGridViewCell.
"""
pass
def get_formatted_value(self, *args):
"""
GetFormattedValue(self: DataGridViewCell,value: object,rowIndex: int,cellStyle: DataGridViewCellStyle,valueTypeConverter: TypeConverter,formattedValueTypeConverter: TypeConverter,context: DataGridViewDataErrorContexts) -> (object,DataGridViewCellStyle)
Gets the value of the cell as formatted for display.
value: The value to be formatted.
rowIndex: The index of the cell's parent row.
cellStyle: The System.Windows.Forms.DataGridViewCellStyle in effect for the cell.
valueTypeConverter: A System.ComponentModel.TypeConverter associated with the value type that
provides custom conversion to the formatted value type,or null if no such
custom conversion is needed.
formattedValueTypeConverter: A System.ComponentModel.TypeConverter associated with the formatted value type
that provides custom conversion from the value type,or null if no such custom
conversion is needed.
context: A bitwise combination of System.Windows.Forms.DataGridViewDataErrorContexts
values describing the context in which the formatted value is needed.
Returns: The formatted value of the cell or null if the cell does not belong to a
System.Windows.Forms.DataGridView control.
"""
pass
def get_inherited_context_menu_strip(self, rowIndex):
"""
GetInheritedContextMenuStrip(self: DataGridViewCell,rowIndex: int) -> ContextMenuStrip
Gets the inherited shortcut menu for the current cell.
rowIndex: The row index of the current cell.
Returns: A System.Windows.Forms.ContextMenuStrip if the parent
System.Windows.Forms.DataGridView,System.Windows.Forms.DataGridViewRow,or
System.Windows.Forms.DataGridViewColumn has a
System.Windows.Forms.ContextMenuStrip assigned; otherwise,null.
"""
pass
def get_inherited_state(self, rowIndex):
"""
GetInheritedState(self: DataGridViewCell,rowIndex: int) -> DataGridViewElementStates
Returns a value indicating the current state of the cell as inherited from the
state of its row and column.
rowIndex: The index of the row containing the cell.
Returns: A bitwise combination of System.Windows.Forms.DataGridViewElementStates values
representing the current state of the cell.
"""
pass
def get_inherited_style(self, inheritedCellStyle, rowIndex, includeColors):
"""
GetInheritedStyle(self: DataGridViewCell,inheritedCellStyle: DataGridViewCellStyle,rowIndex: int,includeColors: bool) -> DataGridViewCellStyle
Gets the style applied to the cell.
inheritedCellStyle: A System.Windows.Forms.DataGridViewCellStyle to be populated with the inherited
cell style.
rowIndex: The index of the cell's parent row.
includeColors: true to include inherited colors in the returned cell style; otherwise,false.
Returns: A System.Windows.Forms.DataGridViewCellStyle that includes the style settings
of the cell inherited from the cell's parent row,column,and
System.Windows.Forms.DataGridView.
"""
pass
def get_preferred_size(self, *args):
"""
GetPreferredSize(self: DataGridViewCell,graphics: Graphics,cellStyle: DataGridViewCellStyle,rowIndex: int,constraintSize: Size) -> Size
Calculates the preferred size,in pixels,of the cell.
graphics: The System.Drawing.Graphics used to draw the cell.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell.
rowIndex: The zero-based row index of the cell.
constraintSize: The cell's maximum allowable size.
Returns: A System.Drawing.Size that represents the preferred size,in pixels,of the
cell.
"""
pass
def get_size(self, *args):
"""
GetSize(self: DataGridViewCell,rowIndex: int) -> Size
Gets the size of the cell.
rowIndex: The index of the cell's parent row.
Returns: A System.Drawing.Size representing the cell's dimensions.
"""
pass
def get_value(self, *args):
"""
GetValue(self: DataGridViewCell,rowIndex: int) -> object
Gets the value of the cell.
rowIndex: The index of the cell's parent row.
Returns: The value contained in the System.Windows.Forms.DataGridViewCell.
"""
pass
def initialize_editing_control(self, rowIndex, initialFormattedValue, dataGridViewCellStyle):
"""
InitializeEditingControl(self: DataGridViewCell,rowIndex: int,initialFormattedValue: object,dataGridViewCellStyle: DataGridViewCellStyle)
Initializes the control used to edit the cell.
rowIndex: The zero-based row index of the cell's location.
initialFormattedValue: An System.Object that represents the value displayed by the cell when editing
is started.
dataGridViewCellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell.
"""
pass
def key_down_unshares_row(self, *args):
"""
KeyDownUnsharesRow(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int) -> bool
Indicates whether the parent row is unshared if the user presses a key while
the focus is on the cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def key_enters_edit_mode(self, e):
"""
KeyEntersEditMode(self: DataGridViewCell,e: KeyEventArgs) -> bool
Determines if edit mode should be started based on the given key.
e: A System.Windows.Forms.KeyEventArgs that represents the key that was pressed.
Returns: true if edit mode should be started; otherwise,false. The default is false.
"""
pass
def key_press_unshares_row(self, *args):
"""
KeyPressUnsharesRow(self: DataGridViewCell,e: KeyPressEventArgs,rowIndex: int) -> bool
Indicates whether a row will be unshared if a key is pressed while a cell in
the row has focus.
e: A System.Windows.Forms.KeyPressEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def key_up_unshares_row(self, *args):
"""
KeyUpUnsharesRow(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int) -> bool
Indicates whether the parent row is unshared when the user releases a key while
the focus is on the cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def leave_unshares_row(self, *args):
"""
LeaveUnsharesRow(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool) -> bool
Indicates whether a row will be unshared when the focus leaves a cell in the
row.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus to the cell; false if a programmatic
operation moved focus to the cell.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
@staticmethod
def measure_text_height(graphics, text, font, maxWidth, flags, widthTruncated=None):
"""
MeasureTextHeight(graphics: Graphics,text: str,font: Font,maxWidth: int,flags: TextFormatFlags) -> (int,bool)
Gets the height,in pixels,of the specified text,given the specified
characteristics. Also indicates whether the required width is greater than the
specified maximum width.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxWidth: The maximum width of the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: The height,in pixels,of the text.
MeasureTextHeight(graphics: Graphics,text: str,font: Font,maxWidth: int,flags: TextFormatFlags) -> int
Gets the height,in pixels,of the specified text,given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxWidth: The maximum width of the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: The height,in pixels,of the text.
"""
pass
@staticmethod
def measure_text_preferred_size(graphics, text, font, maxRatio, flags):
"""
MeasureTextPreferredSize(graphics: Graphics,text: str,font: Font,maxRatio: Single,flags: TextFormatFlags) -> Size
Gets the ideal height and width of the specified text given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxRatio: The maximum width-to-height ratio of the block of text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: A System.Drawing.Size representing the preferred height and width of the text.
"""
pass
@staticmethod
def measure_text_size(graphics, text, font, flags):
"""
MeasureTextSize(graphics: Graphics,text: str,font: Font,flags: TextFormatFlags) -> Size
Gets the height and width of the specified text given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: A System.Drawing.Size representing the height and width of the text.
"""
pass
@staticmethod
def measure_text_width(graphics, text, font, maxHeight, flags):
"""
MeasureTextWidth(graphics: Graphics,text: str,font: Font,maxHeight: int,flags: TextFormatFlags) -> int
Gets the width,in pixels,of the specified text given the specified
characteristics.
graphics: The System.Drawing.Graphics used to render the text.
text: The text to measure.
font: The System.Drawing.Font applied to the text.
maxHeight: The maximum height of the text.
flags: A bitwise combination of System.Windows.Forms.TextFormatFlags values to apply
to the text.
Returns: The width,in pixels,of the text.
"""
pass
def mouse_click_unshares_row(self, *args):
"""
MouseClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared if the user clicks a mouse button
while the pointer is on a cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def mouse_double_click_unshares_row(self, *args):
"""
MouseDoubleClickUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared if the user double-clicks a cell in
the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def mouse_down_unshares_row(self, *args):
"""
MouseDownUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared when the user holds down a mouse
button while the pointer is on a cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def mouse_enter_unshares_row(self, *args):
"""
MouseEnterUnsharesRow(self: DataGridViewCell,rowIndex: int) -> bool
Indicates whether a row will be unshared when the mouse pointer moves over a
cell in the row.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def mouse_leave_unshares_row(self, *args):
"""
MouseLeaveUnsharesRow(self: DataGridViewCell,rowIndex: int) -> bool
Indicates whether a row will be unshared when the mouse pointer leaves the row.
rowIndex: The index of the cell's parent row.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def mouse_move_unshares_row(self, *args):
"""
MouseMoveUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared when the mouse pointer moves over a
cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def mouse_up_unshares_row(self, *args):
"""
MouseUpUnsharesRow(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs) -> bool
Indicates whether a row will be unshared when the user releases a mouse button
while the pointer is on a cell in the row.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
Returns: true if the row will be unshared,otherwise,false. The base
System.Windows.Forms.DataGridViewCell class always returns false.
"""
pass
def on_click(self, *args):
"""
OnClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell is clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def on_content_click(self, *args):
"""
OnContentClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell's contents are clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def on_content_double_click(self, *args):
"""
OnContentDoubleClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell's contents are double-clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def on_data_grid_view_changed(self, *args):
"""
OnDataGridViewChanged(self: DataGridViewCell)
Called when the System.Windows.Forms.DataGridViewElement.DataGridView property
of the cell changes.
"""
pass
def on_double_click(self, *args):
"""
OnDoubleClick(self: DataGridViewCell,e: DataGridViewCellEventArgs)
Called when the cell is double-clicked.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def on_enter(self, *args):
"""
OnEnter(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool)
Called when the focus moves to a cell.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus to the cell; false if a programmatic
operation moved focus to the cell.
"""
pass
def on_key_down(self, *args):
"""
OnKeyDown(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int)
Called when a character key is pressed while the focus is on a cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
"""
pass
def on_key_press(self, *args):
"""
OnKeyPress(self: DataGridViewCell,e: KeyPressEventArgs,rowIndex: int)
Called when a key is pressed while the focus is on a cell.
e: A System.Windows.Forms.KeyPressEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
"""
pass
def on_key_up(self, *args):
"""
OnKeyUp(self: DataGridViewCell,e: KeyEventArgs,rowIndex: int)
Called when a character key is released while the focus is on a cell.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
rowIndex: The index of the cell's parent row.
"""
pass
def on_leave(self, *args):
"""
OnLeave(self: DataGridViewCell,rowIndex: int,throughMouseClick: bool)
Called when the focus moves from a cell.
rowIndex: The index of the cell's parent row.
throughMouseClick: true if a user action moved focus from the cell; false if a programmatic
operation moved focus from the cell.
"""
pass
def on_mouse_click(self, *args):
"""
OnMouseClick(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user clicks a mouse button while the pointer is on a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def on_mouse_double_click(self, *args):
"""
OnMouseDoubleClick(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user double-clicks a mouse button while the pointer is on a
cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def on_mouse_down(self, *args):
"""
OnMouseDown(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user holds down a mouse button while the pointer is on a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def on_mouse_enter(self, *args):
"""
OnMouseEnter(self: DataGridViewCell,rowIndex: int)
Called when the mouse pointer moves over a cell.
rowIndex: The index of the cell's parent row.
"""
pass
def on_mouse_leave(self, *args):
"""
OnMouseLeave(self: DataGridViewCell,rowIndex: int)
Called when the mouse pointer leaves the cell.
rowIndex: The index of the cell's parent row.
"""
pass
def on_mouse_move(self, *args):
"""
OnMouseMove(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the mouse pointer moves within a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def on_mouse_up(self, *args):
"""
OnMouseUp(self: DataGridViewCell,e: DataGridViewCellMouseEventArgs)
Called when the user releases a mouse button while the pointer is on a cell.
e: A System.Windows.Forms.DataGridViewCellMouseEventArgs that contains the event
data.
"""
pass
def paint(self, *args):
"""
Paint(self: DataGridViewCell,graphics: Graphics,clipBounds: Rectangle,cellBounds: Rectangle,rowIndex: int,cellState: DataGridViewElementStates,value: object,formattedValue: object,errorText: str,cellStyle: DataGridViewCellStyle,advancedBorderStyle: DataGridViewAdvancedBorderStyle,paintParts: DataGridViewPaintParts)
Paints the current System.Windows.Forms.DataGridViewCell.
graphics: The System.Drawing.Graphics used to paint the
System.Windows.Forms.DataGridViewCell.
clipBounds: A System.Drawing.Rectangle that represents the area of the
System.Windows.Forms.DataGridView that needs to be repainted.
cellBounds: A System.Drawing.Rectangle that contains the bounds of the
System.Windows.Forms.DataGridViewCell that is being painted.
rowIndex: The row index of the cell that is being painted.
cellState: A bitwise combination of System.Windows.Forms.DataGridViewElementStates values
that specifies the state of the cell.
value: The data of the System.Windows.Forms.DataGridViewCell that is being painted.
formattedValue: The formatted data of the System.Windows.Forms.DataGridViewCell that is being
painted.
errorText: An error message that is associated with the cell.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that contains formatting and style
information about the cell.
advancedBorderStyle: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that contains border
styles for the cell that is being painted.
paintParts: A bitwise combination of the System.Windows.Forms.DataGridViewPaintParts values
that specifies which parts of the cell need to be painted.
"""
pass
def paint_border(self, *args):
"""
PaintBorder(self: DataGridViewCell,graphics: Graphics,clipBounds: Rectangle,bounds: Rectangle,cellStyle: DataGridViewCellStyle,advancedBorderStyle: DataGridViewAdvancedBorderStyle)
Paints the border of the current System.Windows.Forms.DataGridViewCell.
graphics: The System.Drawing.Graphics used to paint the border.
clipBounds: A System.Drawing.Rectangle that represents the area of the
System.Windows.Forms.DataGridView that needs to be repainted.
bounds: A System.Drawing.Rectangle that contains the area of the border that is being
painted.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that contains formatting and style
information about the current cell.
advancedBorderStyle: A System.Windows.Forms.DataGridViewAdvancedBorderStyle that contains border
styles of the border that is being painted.
"""
pass
def paint_error_icon(self, *args):
"""
PaintErrorIcon(self: DataGridViewCell,graphics: Graphics,clipBounds: Rectangle,cellValueBounds: Rectangle,errorText: str)
Paints the error icon of the current System.Windows.Forms.DataGridViewCell.
graphics: The System.Drawing.Graphics used to paint the border.
clipBounds: A System.Drawing.Rectangle that represents the area of the
System.Windows.Forms.DataGridView that needs to be repainted.
cellValueBounds: The bounding System.Drawing.Rectangle that encloses the cell's content area.
errorText: An error message that is associated with the cell.
"""
pass
def parse_formatted_value(self, formattedValue, cellStyle, formattedValueTypeConverter, valueTypeConverter):
"""
ParseFormattedValue(self: DataGridViewCell,formattedValue: object,cellStyle: DataGridViewCellStyle,formattedValueTypeConverter: TypeConverter,valueTypeConverter: TypeConverter) -> object
Converts a value formatted for display to an actual cell value.
formattedValue: The display value of the cell.
cellStyle: The System.Windows.Forms.DataGridViewCellStyle in effect for the cell.
formattedValueTypeConverter: A System.ComponentModel.TypeConverter for the display value type,or null to
use the default converter.
valueTypeConverter: A System.ComponentModel.TypeConverter for the cell value type,or null to use
the default converter.
Returns: The cell value.
"""
pass
def position_editing_control(self, setLocation, setSize, cellBounds, cellClip, cellStyle, singleVerticalBorderAdded, singleHorizontalBorderAdded, isFirstDisplayedColumn, isFirstDisplayedRow):
"""
PositionEditingControl(self: DataGridViewCell,setLocation: bool,setSize: bool,cellBounds: Rectangle,cellClip: Rectangle,cellStyle: DataGridViewCellStyle,singleVerticalBorderAdded: bool,singleHorizontalBorderAdded: bool,isFirstDisplayedColumn: bool,isFirstDisplayedRow: bool)
Sets the location and size of the editing control hosted by a cell in the
System.Windows.Forms.DataGridView control.
setLocation: true to have the control placed as specified by the other arguments; false to
allow the control to place itself.
setSize: true to specify the size; false to allow the control to size itself.
cellBounds: A System.Drawing.Rectangle that defines the cell bounds.
cellClip: The area that will be used to paint the editing control.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell being edited.
singleVerticalBorderAdded: true to add a vertical border to the cell; otherwise,false.
singleHorizontalBorderAdded: true to add a horizontal border to the cell; otherwise,false.
isFirstDisplayedColumn: true if the hosting cell is in the first visible column; otherwise,false.
isFirstDisplayedRow: true if the hosting cell is in the first visible row; otherwise,false.
"""
pass
def position_editing_panel(self, cellBounds, cellClip, cellStyle, singleVerticalBorderAdded, singleHorizontalBorderAdded, isFirstDisplayedColumn, isFirstDisplayedRow):
"""
PositionEditingPanel(self: DataGridViewCell,cellBounds: Rectangle,cellClip: Rectangle,cellStyle: DataGridViewCellStyle,singleVerticalBorderAdded: bool,singleHorizontalBorderAdded: bool,isFirstDisplayedColumn: bool,isFirstDisplayedRow: bool) -> Rectangle
Sets the location and size of the editing panel hosted by the cell,and returns
the normal bounds of the editing control within the editing panel.
cellBounds: A System.Drawing.Rectangle that defines the cell bounds.
cellClip: The area that will be used to paint the editing panel.
cellStyle: A System.Windows.Forms.DataGridViewCellStyle that represents the style of the
cell being edited.
singleVerticalBorderAdded: true to add a vertical border to the cell; otherwise,false.
singleHorizontalBorderAdded: true to add a horizontal border to the cell; otherwise,false.
isFirstDisplayedColumn: true if the cell is in the first column currently displayed in the control;
otherwise,false.
isFirstDisplayedRow: true if the cell is in the first row currently displayed in the control;
otherwise,false.
Returns: A System.Drawing.Rectangle that represents the normal bounds of the editing
control within the editing panel.
"""
pass
def raise_cell_click(self, *args):
"""
RaiseCellClick(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellClick event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def raise_cell_content_click(self, *args):
"""
RaiseCellContentClick(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellContentClick event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def raise_cell_content_double_click(self, *args):
"""
RaiseCellContentDoubleClick(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellContentDoubleClick event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def raise_cell_value_changed(self, *args):
"""
RaiseCellValueChanged(self: DataGridViewElement,e: DataGridViewCellEventArgs)
Raises the System.Windows.Forms.DataGridView.CellValueChanged event.
e: A System.Windows.Forms.DataGridViewCellEventArgs that contains the event data.
"""
pass
def raise_data_error(self, *args):
"""
RaiseDataError(self: DataGridViewElement,e: DataGridViewDataErrorEventArgs)
Raises the System.Windows.Forms.DataGridView.DataError event.
e: A System.Windows.Forms.DataGridViewDataErrorEventArgs that contains the event
data.
"""
pass
def raise_mouse_wheel(self, *args):
"""
RaiseMouseWheel(self: DataGridViewElement,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseWheel event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def set_value(self, *args):
"""
SetValue(self: DataGridViewCell,rowIndex: int,value: object) -> bool
Sets the value of the cell.
rowIndex: The index of the cell's parent row.
value: The cell value to set.
Returns: true if the value has been set; otherwise,false.
"""
pass
def to_string(self):
"""
ToString(self: DataGridViewCell) -> str
Returns a string that describes the current object.
Returns: A string that represents the current object.
"""
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __str__(self, *args):
pass
accessibility_object = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the System.Windows.Forms.DataGridViewCell.DataGridViewCellAccessibleObject assigned to the System.Windows.Forms.DataGridViewCell.\n\n\n\nGet: AccessibilityObject(self: DataGridViewCell) -> AccessibleObject\n\n\n\n'
column_index = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the column index for this cell.\n\n\n\nGet: ColumnIndex(self: DataGridViewCell) -> int\n\n\n\n'
content_bounds = property(lambda self: object(), lambda self, v: None, lambda self: None)
"Gets the bounding rectangle that encloses the cell's content area.\n\n\n\nGet: ContentBounds(self: DataGridViewCell) -> Rectangle\n\n\n\n"
context_menu_strip = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets the shortcut menu associated with the cell.\n\n\n\nGet: ContextMenuStrip(self: DataGridViewCell) -> ContextMenuStrip\n\n\n\nSet: ContextMenuStrip(self: DataGridViewCell)=value\n\n'
default_new_row_value = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the default value for a cell in the row for new records.\n\n\n\nGet: DefaultNewRowValue(self: DataGridViewCell) -> object\n\n\n\n'
displayed = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value that indicates whether the cell is currently displayed on-screen.\n\n\n\nGet: Displayed(self: DataGridViewCell) -> bool\n\n\n\n'
edited_formatted_value = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the current,formatted value of the cell,regardless of whether the cell is in edit mode and the value has not been committed.\n\n\n\nGet: EditedFormattedValue(self: DataGridViewCell) -> object\n\n\n\n'
edit_type = property(lambda self: object(), lambda self, v: None, lambda self: None)
"Gets the type of the cell's hosted editing control.\n\n\n\nGet: EditType(self: DataGridViewCell) -> Type\n\n\n\n"
error_icon_bounds = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the bounds of the error icon for the cell.\n\n\n\nGet: ErrorIconBounds(self: DataGridViewCell) -> Rectangle\n\n\n\n'
error_text = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets the text describing an error condition associated with the cell.\n\n\n\nGet: ErrorText(self: DataGridViewCell) -> str\n\n\n\nSet: ErrorText(self: DataGridViewCell)=value\n\n'
formatted_value = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the value of the cell as formatted for display.\n\n\n\nGet: FormattedValue(self: DataGridViewCell) -> object\n\n\n\n'
formatted_value_type = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the type of the formatted value associated with the cell.\n\n\n\nGet: FormattedValueType(self: DataGridViewCell) -> Type\n\n\n\n'
frozen = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value indicating whether the cell is frozen.\n\n\n\nGet: Frozen(self: DataGridViewCell) -> bool\n\n\n\n'
has_style = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value indicating whether the System.Windows.Forms.DataGridViewCell.Style property has been set.\n\n\n\nGet: HasStyle(self: DataGridViewCell) -> bool\n\n\n\n'
inherited_state = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the current state of the cell as inherited from the state of its row and column.\n\n\n\nGet: InheritedState(self: DataGridViewCell) -> DataGridViewElementStates\n\n\n\n'
inherited_style = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the style currently applied to the cell.\n\n\n\nGet: InheritedStyle(self: DataGridViewCell) -> DataGridViewCellStyle\n\n\n\n'
is_in_edit_mode = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value indicating whether this cell is currently being edited.\n\n\n\nGet: IsInEditMode(self: DataGridViewCell) -> bool\n\n\n\n'
owning_column = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the column that contains this cell.\n\n\n\nGet: OwningColumn(self: DataGridViewCell) -> DataGridViewColumn\n\n\n\n'
owning_row = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the row that contains this cell.\n\n\n\nGet: OwningRow(self: DataGridViewCell) -> DataGridViewRow\n\n\n\n'
preferred_size = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the size,in pixels,of a rectangular area into which the cell can fit.\n\n\n\nGet: PreferredSize(self: DataGridViewCell) -> Size\n\n\n\n'
read_only = property(lambda self: object(), lambda self, v: None, lambda self: None)
"Gets or sets a value indicating whether the cell's data can be edited.\n\n\n\nGet: ReadOnly(self: DataGridViewCell) -> bool\n\n\n\nSet: ReadOnly(self: DataGridViewCell)=value\n\n"
resizable = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value indicating whether the cell can be resized.\n\n\n\nGet: Resizable(self: DataGridViewCell) -> bool\n\n\n\n'
row_index = property(lambda self: object(), lambda self, v: None, lambda self: None)
"Gets the index of the cell's parent row.\n\n\n\nGet: RowIndex(self: DataGridViewCell) -> int\n\n\n\n"
selected = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets a value indicating whether the cell has been selected.\n\n\n\nGet: Selected(self: DataGridViewCell) -> bool\n\n\n\nSet: Selected(self: DataGridViewCell)=value\n\n'
size = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the size of the cell.\n\n\n\nGet: Size(self: DataGridViewCell) -> Size\n\n\n\n'
style = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets the style for the cell.\n\n\n\nGet: Style(self: DataGridViewCell) -> DataGridViewCellStyle\n\n\n\nSet: Style(self: DataGridViewCell)=value\n\n'
tag = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets the object that contains supplemental data about the cell.\n\n\n\nGet: Tag(self: DataGridViewCell) -> object\n\n\n\nSet: Tag(self: DataGridViewCell)=value\n\n'
tool_tip_text = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets the ToolTip text associated with this cell.\n\n\n\nGet: ToolTipText(self: DataGridViewCell) -> str\n\n\n\nSet: ToolTipText(self: DataGridViewCell)=value\n\n'
value = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets the value associated with this cell.\n\n\n\nGet: Value(self: DataGridViewCell) -> object\n\n\n\nSet: Value(self: DataGridViewCell)=value\n\n'
value_type = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets or sets the data type of the values in the cell.\n\n\n\nGet: ValueType(self: DataGridViewCell) -> Type\n\n\n\nSet: ValueType(self: DataGridViewCell)=value\n\n'
visible = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets a value indicating whether the cell is in a row or column that has been hidden.\n\n\n\nGet: Visible(self: DataGridViewCell) -> bool\n\n\n\n'
data_grid_view_cell_accessible_object = None
|
# Exercise 01.2
# Author: Leonardo Ferreira Santos
arguments = input('Say something: ')
print('Number of characters: ', arguments.__sizeof__() - 25) # "-25" is necessary because this function always implements "25".
print('Reversed: ', arguments[::-1])
|
arguments = input('Say something: ')
print('Number of characters: ', arguments.__sizeof__() - 25)
print('Reversed: ', arguments[::-1])
|
class Matrix:
def __init__(self, *rows):
self.matrix = [row for row in rows]
def __repr__(self):
matrix_repr = ""
for i, row in enumerate(self.matrix):
row_repr = " ".join(f"{n:6.2f}" for n in row[:-1])
row_repr = f"{i}: {row_repr} | {row[-1]:6.2f}"
matrix_repr += f"{row_repr} \n"
return matrix_repr
def scale(self, row, scalar):
self.matrix[row] = [scalar * n for n in self.matrix[row]]
def row_addition(self, source, destination, scalar=1):
s = self.matrix[source]
d = self.matrix[destination]
self.matrix[destination] = [i + scalar * j for i, j in zip(d, s)]
def swap(self, r1, r2):
self.matrix[r1], self.matrix[r2] = self.matrix[r2], self.matrix[r1]
|
class Matrix:
def __init__(self, *rows):
self.matrix = [row for row in rows]
def __repr__(self):
matrix_repr = ''
for (i, row) in enumerate(self.matrix):
row_repr = ' '.join((f'{n:6.2f}' for n in row[:-1]))
row_repr = f'{i}: {row_repr} | {row[-1]:6.2f}'
matrix_repr += f'{row_repr} \n'
return matrix_repr
def scale(self, row, scalar):
self.matrix[row] = [scalar * n for n in self.matrix[row]]
def row_addition(self, source, destination, scalar=1):
s = self.matrix[source]
d = self.matrix[destination]
self.matrix[destination] = [i + scalar * j for (i, j) in zip(d, s)]
def swap(self, r1, r2):
(self.matrix[r1], self.matrix[r2]) = (self.matrix[r2], self.matrix[r1])
|
# C++ | General
multiple_files = True
no_spaces = False
type_name = "Pixel"
# C++ | Names
name_camelCase = True
name_lower = False
# Other
out_filename = "Out.cpp" # Only works when multiple_files is on
multiple_files_extension = ".h"
|
multiple_files = True
no_spaces = False
type_name = 'Pixel'
name_camel_case = True
name_lower = False
out_filename = 'Out.cpp'
multiple_files_extension = '.h'
|
#!/usr/bin/env python
# encoding: utf-8
def run(whatweb, pluginname):
whatweb.recog_from_content(pluginname, "shopex")
|
def run(whatweb, pluginname):
whatweb.recog_from_content(pluginname, 'shopex')
|
#
# PySNMP MIB module CISCO-UNIFIED-COMPUTING-DOMAIN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-UNIFIED-COMPUTING-DOMAIN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:15:25 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)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
CiscoNetworkAddress, CiscoAlarmSeverity, CiscoInetAddressMask, Unsigned64, TimeIntervalSec = mibBuilder.importSymbols("CISCO-TC", "CiscoNetworkAddress", "CiscoAlarmSeverity", "CiscoInetAddressMask", "Unsigned64", "TimeIntervalSec")
CucsManagedObjectId, CucsManagedObjectDn, ciscoUnifiedComputingMIBObjects = mibBuilder.importSymbols("CISCO-UNIFIED-COMPUTING-MIB", "CucsManagedObjectId", "CucsManagedObjectDn", "ciscoUnifiedComputingMIBObjects")
CucsDomainFunctionalState, CucsDomainFeatureType = mibBuilder.importSymbols("CISCO-UNIFIED-COMPUTING-TC-MIB", "CucsDomainFunctionalState", "CucsDomainFeatureType")
InetAddressIPv4, InetAddressIPv6 = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressIPv4", "InetAddressIPv6")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
NotificationType, iso, ModuleIdentity, Counter32, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, IpAddress, TimeTicks, Unsigned32, Integer32, Gauge32, MibIdentifier, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "iso", "ModuleIdentity", "Counter32", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "IpAddress", "TimeTicks", "Unsigned32", "Integer32", "Gauge32", "MibIdentifier", "Counter64")
TimeInterval, RowPointer, TruthValue, DateAndTime, MacAddress, TextualConvention, DisplayString, TimeStamp = mibBuilder.importSymbols("SNMPv2-TC", "TimeInterval", "RowPointer", "TruthValue", "DateAndTime", "MacAddress", "TextualConvention", "DisplayString", "TimeStamp")
cucsDomainObjects = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74))
if mibBuilder.loadTexts: cucsDomainObjects.setLastUpdated('201601180000Z')
if mibBuilder.loadTexts: cucsDomainObjects.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts: cucsDomainObjects.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553 -NETS E-mail: [email protected], [email protected]')
if mibBuilder.loadTexts: cucsDomainObjects.setDescription('MIB representation of the Cisco Unified Computing System DOMAIN management information model package')
cucsDomainEnvironmentFeatureTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1), )
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureTable.setDescription('Cisco UCS domain:EnvironmentFeature managed object table')
cucsDomainEnvironmentFeatureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainEnvironmentFeatureInstanceId"))
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureEntry.setDescription('Entry for the cucsDomainEnvironmentFeatureTable table.')
cucsDomainEnvironmentFeatureInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainEnvironmentFeatureDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureDn.setDescription('Cisco UCS domain:EnvironmentFeature:dn managed object property')
cucsDomainEnvironmentFeatureRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureRn.setDescription('Cisco UCS domain:EnvironmentFeature:rn managed object property')
cucsDomainEnvironmentFeatureFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureFltAggr.setDescription('Cisco UCS domain:EnvironmentFeature:fltAggr managed object property')
cucsDomainEnvironmentFeatureFunctionalState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 5), CucsDomainFunctionalState()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureFunctionalState.setDescription('Cisco UCS domain:EnvironmentFeature:functionalState managed object property')
cucsDomainEnvironmentFeatureName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureName.setDescription('Cisco UCS domain:EnvironmentFeature:name managed object property')
cucsDomainEnvironmentFeatureType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 7), CucsDomainFeatureType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureType.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureType.setDescription('Cisco UCS domain:EnvironmentFeature:type managed object property')
cucsDomainEnvironmentFeatureContTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9), )
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContTable.setDescription('Cisco UCS domain:EnvironmentFeatureCont managed object table')
cucsDomainEnvironmentFeatureContEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainEnvironmentFeatureContInstanceId"))
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContEntry.setDescription('Entry for the cucsDomainEnvironmentFeatureContTable table.')
cucsDomainEnvironmentFeatureContInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainEnvironmentFeatureContDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContDn.setDescription('Cisco UCS domain:EnvironmentFeatureCont:dn managed object property')
cucsDomainEnvironmentFeatureContRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContRn.setDescription('Cisco UCS domain:EnvironmentFeatureCont:rn managed object property')
cucsDomainEnvironmentFeatureContFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentFeatureContFltAggr.setDescription('Cisco UCS domain:EnvironmentFeatureCont:fltAggr managed object property')
cucsDomainEnvironmentParamTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2), )
if mibBuilder.loadTexts: cucsDomainEnvironmentParamTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamTable.setDescription('Cisco UCS domain:EnvironmentParam managed object table')
cucsDomainEnvironmentParamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainEnvironmentParamInstanceId"))
if mibBuilder.loadTexts: cucsDomainEnvironmentParamEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamEntry.setDescription('Entry for the cucsDomainEnvironmentParamTable table.')
cucsDomainEnvironmentParamInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainEnvironmentParamInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainEnvironmentParamDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentParamDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamDn.setDescription('Cisco UCS domain:EnvironmentParam:dn managed object property')
cucsDomainEnvironmentParamRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentParamRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamRn.setDescription('Cisco UCS domain:EnvironmentParam:rn managed object property')
cucsDomainEnvironmentParamFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentParamFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamFltAggr.setDescription('Cisco UCS domain:EnvironmentParam:fltAggr managed object property')
cucsDomainEnvironmentParamName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 5), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentParamName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamName.setDescription('Cisco UCS domain:EnvironmentParam:name managed object property')
cucsDomainEnvironmentParamValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainEnvironmentParamValue.setStatus('current')
if mibBuilder.loadTexts: cucsDomainEnvironmentParamValue.setDescription('Cisco UCS domain:EnvironmentParam:value managed object property')
cucsDomainNetworkFeatureTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3), )
if mibBuilder.loadTexts: cucsDomainNetworkFeatureTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureTable.setDescription('Cisco UCS domain:NetworkFeature managed object table')
cucsDomainNetworkFeatureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainNetworkFeatureInstanceId"))
if mibBuilder.loadTexts: cucsDomainNetworkFeatureEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureEntry.setDescription('Entry for the cucsDomainNetworkFeatureTable table.')
cucsDomainNetworkFeatureInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainNetworkFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainNetworkFeatureDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureDn.setDescription('Cisco UCS domain:NetworkFeature:dn managed object property')
cucsDomainNetworkFeatureRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureRn.setDescription('Cisco UCS domain:NetworkFeature:rn managed object property')
cucsDomainNetworkFeatureFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureFltAggr.setDescription('Cisco UCS domain:NetworkFeature:fltAggr managed object property')
cucsDomainNetworkFeatureFunctionalState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 5), CucsDomainFunctionalState()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureFunctionalState.setDescription('Cisco UCS domain:NetworkFeature:functionalState managed object property')
cucsDomainNetworkFeatureName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureName.setDescription('Cisco UCS domain:NetworkFeature:name managed object property')
cucsDomainNetworkFeatureType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 7), CucsDomainFeatureType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureType.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureType.setDescription('Cisco UCS domain:NetworkFeature:type managed object property')
cucsDomainNetworkFeatureContTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10), )
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContTable.setDescription('Cisco UCS domain:NetworkFeatureCont managed object table')
cucsDomainNetworkFeatureContEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainNetworkFeatureContInstanceId"))
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContEntry.setDescription('Entry for the cucsDomainNetworkFeatureContTable table.')
cucsDomainNetworkFeatureContInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainNetworkFeatureContDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContDn.setDescription('Cisco UCS domain:NetworkFeatureCont:dn managed object property')
cucsDomainNetworkFeatureContRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContRn.setDescription('Cisco UCS domain:NetworkFeatureCont:rn managed object property')
cucsDomainNetworkFeatureContFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkFeatureContFltAggr.setDescription('Cisco UCS domain:NetworkFeatureCont:fltAggr managed object property')
cucsDomainNetworkParamTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4), )
if mibBuilder.loadTexts: cucsDomainNetworkParamTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamTable.setDescription('Cisco UCS domain:NetworkParam managed object table')
cucsDomainNetworkParamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainNetworkParamInstanceId"))
if mibBuilder.loadTexts: cucsDomainNetworkParamEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamEntry.setDescription('Entry for the cucsDomainNetworkParamTable table.')
cucsDomainNetworkParamInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainNetworkParamInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainNetworkParamDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkParamDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamDn.setDescription('Cisco UCS domain:NetworkParam:dn managed object property')
cucsDomainNetworkParamRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkParamRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamRn.setDescription('Cisco UCS domain:NetworkParam:rn managed object property')
cucsDomainNetworkParamFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkParamFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamFltAggr.setDescription('Cisco UCS domain:NetworkParam:fltAggr managed object property')
cucsDomainNetworkParamName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 5), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkParamName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamName.setDescription('Cisco UCS domain:NetworkParam:name managed object property')
cucsDomainNetworkParamValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainNetworkParamValue.setStatus('current')
if mibBuilder.loadTexts: cucsDomainNetworkParamValue.setDescription('Cisco UCS domain:NetworkParam:value managed object property')
cucsDomainServerFeatureTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5), )
if mibBuilder.loadTexts: cucsDomainServerFeatureTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureTable.setDescription('Cisco UCS domain:ServerFeature managed object table')
cucsDomainServerFeatureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainServerFeatureInstanceId"))
if mibBuilder.loadTexts: cucsDomainServerFeatureEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureEntry.setDescription('Entry for the cucsDomainServerFeatureTable table.')
cucsDomainServerFeatureInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainServerFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainServerFeatureDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureDn.setDescription('Cisco UCS domain:ServerFeature:dn managed object property')
cucsDomainServerFeatureRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureRn.setDescription('Cisco UCS domain:ServerFeature:rn managed object property')
cucsDomainServerFeatureFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureFltAggr.setDescription('Cisco UCS domain:ServerFeature:fltAggr managed object property')
cucsDomainServerFeatureFunctionalState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 5), CucsDomainFunctionalState()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureFunctionalState.setDescription('Cisco UCS domain:ServerFeature:functionalState managed object property')
cucsDomainServerFeatureName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureName.setDescription('Cisco UCS domain:ServerFeature:name managed object property')
cucsDomainServerFeatureType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 7), CucsDomainFeatureType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureType.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureType.setDescription('Cisco UCS domain:ServerFeature:type managed object property')
cucsDomainServerFeatureContTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11), )
if mibBuilder.loadTexts: cucsDomainServerFeatureContTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureContTable.setDescription('Cisco UCS domain:ServerFeatureCont managed object table')
cucsDomainServerFeatureContEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainServerFeatureContInstanceId"))
if mibBuilder.loadTexts: cucsDomainServerFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureContEntry.setDescription('Entry for the cucsDomainServerFeatureContTable table.')
cucsDomainServerFeatureContInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainServerFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainServerFeatureContDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureContDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureContDn.setDescription('Cisco UCS domain:ServerFeatureCont:dn managed object property')
cucsDomainServerFeatureContRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureContRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureContRn.setDescription('Cisco UCS domain:ServerFeatureCont:rn managed object property')
cucsDomainServerFeatureContFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerFeatureContFltAggr.setDescription('Cisco UCS domain:ServerFeatureCont:fltAggr managed object property')
cucsDomainServerParamTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6), )
if mibBuilder.loadTexts: cucsDomainServerParamTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamTable.setDescription('Cisco UCS domain:ServerParam managed object table')
cucsDomainServerParamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainServerParamInstanceId"))
if mibBuilder.loadTexts: cucsDomainServerParamEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamEntry.setDescription('Entry for the cucsDomainServerParamTable table.')
cucsDomainServerParamInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainServerParamInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainServerParamDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerParamDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamDn.setDescription('Cisco UCS domain:ServerParam:dn managed object property')
cucsDomainServerParamRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerParamRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamRn.setDescription('Cisco UCS domain:ServerParam:rn managed object property')
cucsDomainServerParamFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerParamFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamFltAggr.setDescription('Cisco UCS domain:ServerParam:fltAggr managed object property')
cucsDomainServerParamName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 5), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerParamName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamName.setDescription('Cisco UCS domain:ServerParam:name managed object property')
cucsDomainServerParamValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainServerParamValue.setStatus('current')
if mibBuilder.loadTexts: cucsDomainServerParamValue.setDescription('Cisco UCS domain:ServerParam:value managed object property')
cucsDomainStorageFeatureTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7), )
if mibBuilder.loadTexts: cucsDomainStorageFeatureTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureTable.setDescription('Cisco UCS domain:StorageFeature managed object table')
cucsDomainStorageFeatureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainStorageFeatureInstanceId"))
if mibBuilder.loadTexts: cucsDomainStorageFeatureEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureEntry.setDescription('Entry for the cucsDomainStorageFeatureTable table.')
cucsDomainStorageFeatureInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainStorageFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainStorageFeatureDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureDn.setDescription('Cisco UCS domain:StorageFeature:dn managed object property')
cucsDomainStorageFeatureRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureRn.setDescription('Cisco UCS domain:StorageFeature:rn managed object property')
cucsDomainStorageFeatureFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureFltAggr.setDescription('Cisco UCS domain:StorageFeature:fltAggr managed object property')
cucsDomainStorageFeatureFunctionalState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 5), CucsDomainFunctionalState()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureFunctionalState.setDescription('Cisco UCS domain:StorageFeature:functionalState managed object property')
cucsDomainStorageFeatureName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureName.setDescription('Cisco UCS domain:StorageFeature:name managed object property')
cucsDomainStorageFeatureType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 7), CucsDomainFeatureType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureType.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureType.setDescription('Cisco UCS domain:StorageFeature:type managed object property')
cucsDomainStorageFeatureContTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12), )
if mibBuilder.loadTexts: cucsDomainStorageFeatureContTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureContTable.setDescription('Cisco UCS domain:StorageFeatureCont managed object table')
cucsDomainStorageFeatureContEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainStorageFeatureContInstanceId"))
if mibBuilder.loadTexts: cucsDomainStorageFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureContEntry.setDescription('Entry for the cucsDomainStorageFeatureContTable table.')
cucsDomainStorageFeatureContInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainStorageFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainStorageFeatureContDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureContDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureContDn.setDescription('Cisco UCS domain:StorageFeatureCont:dn managed object property')
cucsDomainStorageFeatureContRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureContRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureContRn.setDescription('Cisco UCS domain:StorageFeatureCont:rn managed object property')
cucsDomainStorageFeatureContFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageFeatureContFltAggr.setDescription('Cisco UCS domain:StorageFeatureCont:fltAggr managed object property')
cucsDomainStorageParamTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8), )
if mibBuilder.loadTexts: cucsDomainStorageParamTable.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamTable.setDescription('Cisco UCS domain:StorageParam managed object table')
cucsDomainStorageParamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", "cucsDomainStorageParamInstanceId"))
if mibBuilder.loadTexts: cucsDomainStorageParamEntry.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamEntry.setDescription('Entry for the cucsDomainStorageParamTable table.')
cucsDomainStorageParamInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 1), CucsManagedObjectId())
if mibBuilder.loadTexts: cucsDomainStorageParamInstanceId.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamInstanceId.setDescription('Instance identifier of the managed object.')
cucsDomainStorageParamDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageParamDn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamDn.setDescription('Cisco UCS domain:StorageParam:dn managed object property')
cucsDomainStorageParamRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageParamRn.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamRn.setDescription('Cisco UCS domain:StorageParam:rn managed object property')
cucsDomainStorageParamFltAggr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 4), Unsigned64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageParamFltAggr.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamFltAggr.setDescription('Cisco UCS domain:StorageParam:fltAggr managed object property')
cucsDomainStorageParamName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 5), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageParamName.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamName.setDescription('Cisco UCS domain:StorageParam:name managed object property')
cucsDomainStorageParamValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cucsDomainStorageParamValue.setStatus('current')
if mibBuilder.loadTexts: cucsDomainStorageParamValue.setDescription('Cisco UCS domain:StorageParam:value managed object property')
mibBuilder.exportSymbols("CISCO-UNIFIED-COMPUTING-DOMAIN-MIB", cucsDomainServerFeatureContDn=cucsDomainServerFeatureContDn, cucsDomainServerParamValue=cucsDomainServerParamValue, cucsDomainNetworkFeatureContInstanceId=cucsDomainNetworkFeatureContInstanceId, cucsDomainStorageParamTable=cucsDomainStorageParamTable, cucsDomainStorageParamRn=cucsDomainStorageParamRn, cucsDomainNetworkParamDn=cucsDomainNetworkParamDn, cucsDomainEnvironmentParamValue=cucsDomainEnvironmentParamValue, cucsDomainServerParamDn=cucsDomainServerParamDn, cucsDomainStorageFeatureName=cucsDomainStorageFeatureName, cucsDomainEnvironmentFeatureContEntry=cucsDomainEnvironmentFeatureContEntry, cucsDomainServerParamName=cucsDomainServerParamName, cucsDomainServerParamFltAggr=cucsDomainServerParamFltAggr, cucsDomainNetworkFeatureName=cucsDomainNetworkFeatureName, cucsDomainEnvironmentFeatureFunctionalState=cucsDomainEnvironmentFeatureFunctionalState, cucsDomainNetworkParamValue=cucsDomainNetworkParamValue, cucsDomainStorageFeatureContFltAggr=cucsDomainStorageFeatureContFltAggr, cucsDomainStorageFeatureContEntry=cucsDomainStorageFeatureContEntry, cucsDomainStorageParamFltAggr=cucsDomainStorageParamFltAggr, cucsDomainStorageFeatureRn=cucsDomainStorageFeatureRn, cucsDomainNetworkParamFltAggr=cucsDomainNetworkParamFltAggr, cucsDomainEnvironmentParamName=cucsDomainEnvironmentParamName, cucsDomainEnvironmentFeatureEntry=cucsDomainEnvironmentFeatureEntry, cucsDomainNetworkFeatureContEntry=cucsDomainNetworkFeatureContEntry, cucsDomainServerFeatureDn=cucsDomainServerFeatureDn, cucsDomainServerFeatureContEntry=cucsDomainServerFeatureContEntry, cucsDomainEnvironmentFeatureTable=cucsDomainEnvironmentFeatureTable, cucsDomainServerFeatureContInstanceId=cucsDomainServerFeatureContInstanceId, cucsDomainEnvironmentFeatureContRn=cucsDomainEnvironmentFeatureContRn, cucsDomainNetworkParamName=cucsDomainNetworkParamName, cucsDomainStorageParamEntry=cucsDomainStorageParamEntry, cucsDomainNetworkParamEntry=cucsDomainNetworkParamEntry, cucsDomainServerParamEntry=cucsDomainServerParamEntry, cucsDomainNetworkFeatureRn=cucsDomainNetworkFeatureRn, cucsDomainStorageFeatureDn=cucsDomainStorageFeatureDn, cucsDomainNetworkFeatureContFltAggr=cucsDomainNetworkFeatureContFltAggr, cucsDomainStorageFeatureContTable=cucsDomainStorageFeatureContTable, cucsDomainEnvironmentFeatureType=cucsDomainEnvironmentFeatureType, cucsDomainNetworkFeatureContTable=cucsDomainNetworkFeatureContTable, cucsDomainNetworkFeatureDn=cucsDomainNetworkFeatureDn, cucsDomainEnvironmentParamInstanceId=cucsDomainEnvironmentParamInstanceId, cucsDomainNetworkParamInstanceId=cucsDomainNetworkParamInstanceId, cucsDomainEnvironmentParamDn=cucsDomainEnvironmentParamDn, cucsDomainNetworkParamTable=cucsDomainNetworkParamTable, cucsDomainServerFeatureContFltAggr=cucsDomainServerFeatureContFltAggr, cucsDomainStorageFeatureFunctionalState=cucsDomainStorageFeatureFunctionalState, cucsDomainNetworkFeatureContRn=cucsDomainNetworkFeatureContRn, cucsDomainEnvironmentParamFltAggr=cucsDomainEnvironmentParamFltAggr, cucsDomainServerParamInstanceId=cucsDomainServerParamInstanceId, cucsDomainServerFeatureContRn=cucsDomainServerFeatureContRn, cucsDomainServerParamTable=cucsDomainServerParamTable, cucsDomainStorageParamValue=cucsDomainStorageParamValue, cucsDomainNetworkFeatureFltAggr=cucsDomainNetworkFeatureFltAggr, cucsDomainServerFeatureInstanceId=cucsDomainServerFeatureInstanceId, cucsDomainNetworkFeatureEntry=cucsDomainNetworkFeatureEntry, cucsDomainEnvironmentFeatureFltAggr=cucsDomainEnvironmentFeatureFltAggr, cucsDomainEnvironmentFeatureDn=cucsDomainEnvironmentFeatureDn, cucsDomainEnvironmentParamEntry=cucsDomainEnvironmentParamEntry, cucsDomainNetworkFeatureInstanceId=cucsDomainNetworkFeatureInstanceId, cucsDomainNetworkFeatureType=cucsDomainNetworkFeatureType, cucsDomainNetworkFeatureTable=cucsDomainNetworkFeatureTable, cucsDomainEnvironmentFeatureContInstanceId=cucsDomainEnvironmentFeatureContInstanceId, cucsDomainStorageParamInstanceId=cucsDomainStorageParamInstanceId, cucsDomainServerFeatureEntry=cucsDomainServerFeatureEntry, cucsDomainNetworkFeatureContDn=cucsDomainNetworkFeatureContDn, cucsDomainServerFeatureTable=cucsDomainServerFeatureTable, cucsDomainStorageFeatureFltAggr=cucsDomainStorageFeatureFltAggr, cucsDomainServerFeatureRn=cucsDomainServerFeatureRn, cucsDomainEnvironmentParamRn=cucsDomainEnvironmentParamRn, cucsDomainServerFeatureName=cucsDomainServerFeatureName, cucsDomainNetworkParamRn=cucsDomainNetworkParamRn, cucsDomainNetworkFeatureFunctionalState=cucsDomainNetworkFeatureFunctionalState, cucsDomainServerFeatureFunctionalState=cucsDomainServerFeatureFunctionalState, cucsDomainServerParamRn=cucsDomainServerParamRn, cucsDomainEnvironmentFeatureInstanceId=cucsDomainEnvironmentFeatureInstanceId, cucsDomainStorageFeatureContDn=cucsDomainStorageFeatureContDn, PYSNMP_MODULE_ID=cucsDomainObjects, cucsDomainStorageFeatureContRn=cucsDomainStorageFeatureContRn, cucsDomainStorageFeatureContInstanceId=cucsDomainStorageFeatureContInstanceId, cucsDomainEnvironmentFeatureContTable=cucsDomainEnvironmentFeatureContTable, cucsDomainObjects=cucsDomainObjects, cucsDomainStorageFeatureEntry=cucsDomainStorageFeatureEntry, cucsDomainServerFeatureContTable=cucsDomainServerFeatureContTable, cucsDomainEnvironmentFeatureContFltAggr=cucsDomainEnvironmentFeatureContFltAggr, cucsDomainStorageFeatureInstanceId=cucsDomainStorageFeatureInstanceId, cucsDomainEnvironmentFeatureContDn=cucsDomainEnvironmentFeatureContDn, cucsDomainStorageParamName=cucsDomainStorageParamName, cucsDomainServerFeatureType=cucsDomainServerFeatureType, cucsDomainStorageFeatureTable=cucsDomainStorageFeatureTable, cucsDomainEnvironmentFeatureName=cucsDomainEnvironmentFeatureName, cucsDomainEnvironmentFeatureRn=cucsDomainEnvironmentFeatureRn, cucsDomainStorageParamDn=cucsDomainStorageParamDn, cucsDomainEnvironmentParamTable=cucsDomainEnvironmentParamTable, cucsDomainStorageFeatureType=cucsDomainStorageFeatureType, cucsDomainServerFeatureFltAggr=cucsDomainServerFeatureFltAggr)
|
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, value_range_constraint, constraints_union, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'ConstraintsUnion', 'SingleValueConstraint')
(cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt')
(cisco_network_address, cisco_alarm_severity, cisco_inet_address_mask, unsigned64, time_interval_sec) = mibBuilder.importSymbols('CISCO-TC', 'CiscoNetworkAddress', 'CiscoAlarmSeverity', 'CiscoInetAddressMask', 'Unsigned64', 'TimeIntervalSec')
(cucs_managed_object_id, cucs_managed_object_dn, cisco_unified_computing_mib_objects) = mibBuilder.importSymbols('CISCO-UNIFIED-COMPUTING-MIB', 'CucsManagedObjectId', 'CucsManagedObjectDn', 'ciscoUnifiedComputingMIBObjects')
(cucs_domain_functional_state, cucs_domain_feature_type) = mibBuilder.importSymbols('CISCO-UNIFIED-COMPUTING-TC-MIB', 'CucsDomainFunctionalState', 'CucsDomainFeatureType')
(inet_address_i_pv4, inet_address_i_pv6) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressIPv4', 'InetAddressIPv6')
(snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(notification_type, iso, module_identity, counter32, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, ip_address, time_ticks, unsigned32, integer32, gauge32, mib_identifier, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'iso', 'ModuleIdentity', 'Counter32', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'IpAddress', 'TimeTicks', 'Unsigned32', 'Integer32', 'Gauge32', 'MibIdentifier', 'Counter64')
(time_interval, row_pointer, truth_value, date_and_time, mac_address, textual_convention, display_string, time_stamp) = mibBuilder.importSymbols('SNMPv2-TC', 'TimeInterval', 'RowPointer', 'TruthValue', 'DateAndTime', 'MacAddress', 'TextualConvention', 'DisplayString', 'TimeStamp')
cucs_domain_objects = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74))
if mibBuilder.loadTexts:
cucsDomainObjects.setLastUpdated('201601180000Z')
if mibBuilder.loadTexts:
cucsDomainObjects.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts:
cucsDomainObjects.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553 -NETS E-mail: [email protected], [email protected]')
if mibBuilder.loadTexts:
cucsDomainObjects.setDescription('MIB representation of the Cisco Unified Computing System DOMAIN management information model package')
cucs_domain_environment_feature_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1))
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureTable.setDescription('Cisco UCS domain:EnvironmentFeature managed object table')
cucs_domain_environment_feature_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainEnvironmentFeatureInstanceId'))
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureEntry.setDescription('Entry for the cucsDomainEnvironmentFeatureTable table.')
cucs_domain_environment_feature_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_environment_feature_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureDn.setDescription('Cisco UCS domain:EnvironmentFeature:dn managed object property')
cucs_domain_environment_feature_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureRn.setDescription('Cisco UCS domain:EnvironmentFeature:rn managed object property')
cucs_domain_environment_feature_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureFltAggr.setDescription('Cisco UCS domain:EnvironmentFeature:fltAggr managed object property')
cucs_domain_environment_feature_functional_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 5), cucs_domain_functional_state()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureFunctionalState.setDescription('Cisco UCS domain:EnvironmentFeature:functionalState managed object property')
cucs_domain_environment_feature_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureName.setDescription('Cisco UCS domain:EnvironmentFeature:name managed object property')
cucs_domain_environment_feature_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 1, 1, 7), cucs_domain_feature_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureType.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureType.setDescription('Cisco UCS domain:EnvironmentFeature:type managed object property')
cucs_domain_environment_feature_cont_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9))
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContTable.setDescription('Cisco UCS domain:EnvironmentFeatureCont managed object table')
cucs_domain_environment_feature_cont_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainEnvironmentFeatureContInstanceId'))
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContEntry.setDescription('Entry for the cucsDomainEnvironmentFeatureContTable table.')
cucs_domain_environment_feature_cont_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_environment_feature_cont_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContDn.setDescription('Cisco UCS domain:EnvironmentFeatureCont:dn managed object property')
cucs_domain_environment_feature_cont_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContRn.setDescription('Cisco UCS domain:EnvironmentFeatureCont:rn managed object property')
cucs_domain_environment_feature_cont_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 9, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentFeatureContFltAggr.setDescription('Cisco UCS domain:EnvironmentFeatureCont:fltAggr managed object property')
cucs_domain_environment_param_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2))
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamTable.setDescription('Cisco UCS domain:EnvironmentParam managed object table')
cucs_domain_environment_param_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainEnvironmentParamInstanceId'))
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamEntry.setDescription('Entry for the cucsDomainEnvironmentParamTable table.')
cucs_domain_environment_param_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_environment_param_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamDn.setDescription('Cisco UCS domain:EnvironmentParam:dn managed object property')
cucs_domain_environment_param_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamRn.setDescription('Cisco UCS domain:EnvironmentParam:rn managed object property')
cucs_domain_environment_param_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamFltAggr.setDescription('Cisco UCS domain:EnvironmentParam:fltAggr managed object property')
cucs_domain_environment_param_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 5), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamName.setDescription('Cisco UCS domain:EnvironmentParam:name managed object property')
cucs_domain_environment_param_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 2, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamValue.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainEnvironmentParamValue.setDescription('Cisco UCS domain:EnvironmentParam:value managed object property')
cucs_domain_network_feature_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3))
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureTable.setDescription('Cisco UCS domain:NetworkFeature managed object table')
cucs_domain_network_feature_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainNetworkFeatureInstanceId'))
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureEntry.setDescription('Entry for the cucsDomainNetworkFeatureTable table.')
cucs_domain_network_feature_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_network_feature_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureDn.setDescription('Cisco UCS domain:NetworkFeature:dn managed object property')
cucs_domain_network_feature_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureRn.setDescription('Cisco UCS domain:NetworkFeature:rn managed object property')
cucs_domain_network_feature_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureFltAggr.setDescription('Cisco UCS domain:NetworkFeature:fltAggr managed object property')
cucs_domain_network_feature_functional_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 5), cucs_domain_functional_state()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureFunctionalState.setDescription('Cisco UCS domain:NetworkFeature:functionalState managed object property')
cucs_domain_network_feature_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureName.setDescription('Cisco UCS domain:NetworkFeature:name managed object property')
cucs_domain_network_feature_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 3, 1, 7), cucs_domain_feature_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureType.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureType.setDescription('Cisco UCS domain:NetworkFeature:type managed object property')
cucs_domain_network_feature_cont_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10))
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContTable.setDescription('Cisco UCS domain:NetworkFeatureCont managed object table')
cucs_domain_network_feature_cont_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainNetworkFeatureContInstanceId'))
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContEntry.setDescription('Entry for the cucsDomainNetworkFeatureContTable table.')
cucs_domain_network_feature_cont_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_network_feature_cont_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContDn.setDescription('Cisco UCS domain:NetworkFeatureCont:dn managed object property')
cucs_domain_network_feature_cont_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContRn.setDescription('Cisco UCS domain:NetworkFeatureCont:rn managed object property')
cucs_domain_network_feature_cont_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 10, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkFeatureContFltAggr.setDescription('Cisco UCS domain:NetworkFeatureCont:fltAggr managed object property')
cucs_domain_network_param_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4))
if mibBuilder.loadTexts:
cucsDomainNetworkParamTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamTable.setDescription('Cisco UCS domain:NetworkParam managed object table')
cucs_domain_network_param_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainNetworkParamInstanceId'))
if mibBuilder.loadTexts:
cucsDomainNetworkParamEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamEntry.setDescription('Entry for the cucsDomainNetworkParamTable table.')
cucs_domain_network_param_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainNetworkParamInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_network_param_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkParamDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamDn.setDescription('Cisco UCS domain:NetworkParam:dn managed object property')
cucs_domain_network_param_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkParamRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamRn.setDescription('Cisco UCS domain:NetworkParam:rn managed object property')
cucs_domain_network_param_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkParamFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamFltAggr.setDescription('Cisco UCS domain:NetworkParam:fltAggr managed object property')
cucs_domain_network_param_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 5), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkParamName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamName.setDescription('Cisco UCS domain:NetworkParam:name managed object property')
cucs_domain_network_param_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 4, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainNetworkParamValue.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainNetworkParamValue.setDescription('Cisco UCS domain:NetworkParam:value managed object property')
cucs_domain_server_feature_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5))
if mibBuilder.loadTexts:
cucsDomainServerFeatureTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureTable.setDescription('Cisco UCS domain:ServerFeature managed object table')
cucs_domain_server_feature_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainServerFeatureInstanceId'))
if mibBuilder.loadTexts:
cucsDomainServerFeatureEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureEntry.setDescription('Entry for the cucsDomainServerFeatureTable table.')
cucs_domain_server_feature_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainServerFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_server_feature_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureDn.setDescription('Cisco UCS domain:ServerFeature:dn managed object property')
cucs_domain_server_feature_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureRn.setDescription('Cisco UCS domain:ServerFeature:rn managed object property')
cucs_domain_server_feature_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureFltAggr.setDescription('Cisco UCS domain:ServerFeature:fltAggr managed object property')
cucs_domain_server_feature_functional_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 5), cucs_domain_functional_state()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureFunctionalState.setDescription('Cisco UCS domain:ServerFeature:functionalState managed object property')
cucs_domain_server_feature_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureName.setDescription('Cisco UCS domain:ServerFeature:name managed object property')
cucs_domain_server_feature_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 5, 1, 7), cucs_domain_feature_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureType.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureType.setDescription('Cisco UCS domain:ServerFeature:type managed object property')
cucs_domain_server_feature_cont_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11))
if mibBuilder.loadTexts:
cucsDomainServerFeatureContTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContTable.setDescription('Cisco UCS domain:ServerFeatureCont managed object table')
cucs_domain_server_feature_cont_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainServerFeatureContInstanceId'))
if mibBuilder.loadTexts:
cucsDomainServerFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContEntry.setDescription('Entry for the cucsDomainServerFeatureContTable table.')
cucs_domain_server_feature_cont_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainServerFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_server_feature_cont_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContDn.setDescription('Cisco UCS domain:ServerFeatureCont:dn managed object property')
cucs_domain_server_feature_cont_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContRn.setDescription('Cisco UCS domain:ServerFeatureCont:rn managed object property')
cucs_domain_server_feature_cont_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 11, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerFeatureContFltAggr.setDescription('Cisco UCS domain:ServerFeatureCont:fltAggr managed object property')
cucs_domain_server_param_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6))
if mibBuilder.loadTexts:
cucsDomainServerParamTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamTable.setDescription('Cisco UCS domain:ServerParam managed object table')
cucs_domain_server_param_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainServerParamInstanceId'))
if mibBuilder.loadTexts:
cucsDomainServerParamEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamEntry.setDescription('Entry for the cucsDomainServerParamTable table.')
cucs_domain_server_param_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainServerParamInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_server_param_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerParamDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamDn.setDescription('Cisco UCS domain:ServerParam:dn managed object property')
cucs_domain_server_param_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerParamRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamRn.setDescription('Cisco UCS domain:ServerParam:rn managed object property')
cucs_domain_server_param_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerParamFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamFltAggr.setDescription('Cisco UCS domain:ServerParam:fltAggr managed object property')
cucs_domain_server_param_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 5), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerParamName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamName.setDescription('Cisco UCS domain:ServerParam:name managed object property')
cucs_domain_server_param_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 6, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainServerParamValue.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainServerParamValue.setDescription('Cisco UCS domain:ServerParam:value managed object property')
cucs_domain_storage_feature_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7))
if mibBuilder.loadTexts:
cucsDomainStorageFeatureTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureTable.setDescription('Cisco UCS domain:StorageFeature managed object table')
cucs_domain_storage_feature_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainStorageFeatureInstanceId'))
if mibBuilder.loadTexts:
cucsDomainStorageFeatureEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureEntry.setDescription('Entry for the cucsDomainStorageFeatureTable table.')
cucs_domain_storage_feature_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainStorageFeatureInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_storage_feature_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureDn.setDescription('Cisco UCS domain:StorageFeature:dn managed object property')
cucs_domain_storage_feature_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureRn.setDescription('Cisco UCS domain:StorageFeature:rn managed object property')
cucs_domain_storage_feature_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureFltAggr.setDescription('Cisco UCS domain:StorageFeature:fltAggr managed object property')
cucs_domain_storage_feature_functional_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 5), cucs_domain_functional_state()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureFunctionalState.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureFunctionalState.setDescription('Cisco UCS domain:StorageFeature:functionalState managed object property')
cucs_domain_storage_feature_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureName.setDescription('Cisco UCS domain:StorageFeature:name managed object property')
cucs_domain_storage_feature_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 7, 1, 7), cucs_domain_feature_type()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureType.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureType.setDescription('Cisco UCS domain:StorageFeature:type managed object property')
cucs_domain_storage_feature_cont_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12))
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContTable.setDescription('Cisco UCS domain:StorageFeatureCont managed object table')
cucs_domain_storage_feature_cont_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainStorageFeatureContInstanceId'))
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContEntry.setDescription('Entry for the cucsDomainStorageFeatureContTable table.')
cucs_domain_storage_feature_cont_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_storage_feature_cont_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContDn.setDescription('Cisco UCS domain:StorageFeatureCont:dn managed object property')
cucs_domain_storage_feature_cont_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContRn.setDescription('Cisco UCS domain:StorageFeatureCont:rn managed object property')
cucs_domain_storage_feature_cont_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 12, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageFeatureContFltAggr.setDescription('Cisco UCS domain:StorageFeatureCont:fltAggr managed object property')
cucs_domain_storage_param_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8))
if mibBuilder.loadTexts:
cucsDomainStorageParamTable.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamTable.setDescription('Cisco UCS domain:StorageParam managed object table')
cucs_domain_storage_param_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1)).setIndexNames((0, 'CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', 'cucsDomainStorageParamInstanceId'))
if mibBuilder.loadTexts:
cucsDomainStorageParamEntry.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamEntry.setDescription('Entry for the cucsDomainStorageParamTable table.')
cucs_domain_storage_param_instance_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 1), cucs_managed_object_id())
if mibBuilder.loadTexts:
cucsDomainStorageParamInstanceId.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamInstanceId.setDescription('Instance identifier of the managed object.')
cucs_domain_storage_param_dn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 2), cucs_managed_object_dn()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageParamDn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamDn.setDescription('Cisco UCS domain:StorageParam:dn managed object property')
cucs_domain_storage_param_rn = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 3), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageParamRn.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamRn.setDescription('Cisco UCS domain:StorageParam:rn managed object property')
cucs_domain_storage_param_flt_aggr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 4), unsigned64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageParamFltAggr.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamFltAggr.setDescription('Cisco UCS domain:StorageParam:fltAggr managed object property')
cucs_domain_storage_param_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 5), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageParamName.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamName.setDescription('Cisco UCS domain:StorageParam:name managed object property')
cucs_domain_storage_param_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 74, 8, 1, 6), snmp_admin_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cucsDomainStorageParamValue.setStatus('current')
if mibBuilder.loadTexts:
cucsDomainStorageParamValue.setDescription('Cisco UCS domain:StorageParam:value managed object property')
mibBuilder.exportSymbols('CISCO-UNIFIED-COMPUTING-DOMAIN-MIB', cucsDomainServerFeatureContDn=cucsDomainServerFeatureContDn, cucsDomainServerParamValue=cucsDomainServerParamValue, cucsDomainNetworkFeatureContInstanceId=cucsDomainNetworkFeatureContInstanceId, cucsDomainStorageParamTable=cucsDomainStorageParamTable, cucsDomainStorageParamRn=cucsDomainStorageParamRn, cucsDomainNetworkParamDn=cucsDomainNetworkParamDn, cucsDomainEnvironmentParamValue=cucsDomainEnvironmentParamValue, cucsDomainServerParamDn=cucsDomainServerParamDn, cucsDomainStorageFeatureName=cucsDomainStorageFeatureName, cucsDomainEnvironmentFeatureContEntry=cucsDomainEnvironmentFeatureContEntry, cucsDomainServerParamName=cucsDomainServerParamName, cucsDomainServerParamFltAggr=cucsDomainServerParamFltAggr, cucsDomainNetworkFeatureName=cucsDomainNetworkFeatureName, cucsDomainEnvironmentFeatureFunctionalState=cucsDomainEnvironmentFeatureFunctionalState, cucsDomainNetworkParamValue=cucsDomainNetworkParamValue, cucsDomainStorageFeatureContFltAggr=cucsDomainStorageFeatureContFltAggr, cucsDomainStorageFeatureContEntry=cucsDomainStorageFeatureContEntry, cucsDomainStorageParamFltAggr=cucsDomainStorageParamFltAggr, cucsDomainStorageFeatureRn=cucsDomainStorageFeatureRn, cucsDomainNetworkParamFltAggr=cucsDomainNetworkParamFltAggr, cucsDomainEnvironmentParamName=cucsDomainEnvironmentParamName, cucsDomainEnvironmentFeatureEntry=cucsDomainEnvironmentFeatureEntry, cucsDomainNetworkFeatureContEntry=cucsDomainNetworkFeatureContEntry, cucsDomainServerFeatureDn=cucsDomainServerFeatureDn, cucsDomainServerFeatureContEntry=cucsDomainServerFeatureContEntry, cucsDomainEnvironmentFeatureTable=cucsDomainEnvironmentFeatureTable, cucsDomainServerFeatureContInstanceId=cucsDomainServerFeatureContInstanceId, cucsDomainEnvironmentFeatureContRn=cucsDomainEnvironmentFeatureContRn, cucsDomainNetworkParamName=cucsDomainNetworkParamName, cucsDomainStorageParamEntry=cucsDomainStorageParamEntry, cucsDomainNetworkParamEntry=cucsDomainNetworkParamEntry, cucsDomainServerParamEntry=cucsDomainServerParamEntry, cucsDomainNetworkFeatureRn=cucsDomainNetworkFeatureRn, cucsDomainStorageFeatureDn=cucsDomainStorageFeatureDn, cucsDomainNetworkFeatureContFltAggr=cucsDomainNetworkFeatureContFltAggr, cucsDomainStorageFeatureContTable=cucsDomainStorageFeatureContTable, cucsDomainEnvironmentFeatureType=cucsDomainEnvironmentFeatureType, cucsDomainNetworkFeatureContTable=cucsDomainNetworkFeatureContTable, cucsDomainNetworkFeatureDn=cucsDomainNetworkFeatureDn, cucsDomainEnvironmentParamInstanceId=cucsDomainEnvironmentParamInstanceId, cucsDomainNetworkParamInstanceId=cucsDomainNetworkParamInstanceId, cucsDomainEnvironmentParamDn=cucsDomainEnvironmentParamDn, cucsDomainNetworkParamTable=cucsDomainNetworkParamTable, cucsDomainServerFeatureContFltAggr=cucsDomainServerFeatureContFltAggr, cucsDomainStorageFeatureFunctionalState=cucsDomainStorageFeatureFunctionalState, cucsDomainNetworkFeatureContRn=cucsDomainNetworkFeatureContRn, cucsDomainEnvironmentParamFltAggr=cucsDomainEnvironmentParamFltAggr, cucsDomainServerParamInstanceId=cucsDomainServerParamInstanceId, cucsDomainServerFeatureContRn=cucsDomainServerFeatureContRn, cucsDomainServerParamTable=cucsDomainServerParamTable, cucsDomainStorageParamValue=cucsDomainStorageParamValue, cucsDomainNetworkFeatureFltAggr=cucsDomainNetworkFeatureFltAggr, cucsDomainServerFeatureInstanceId=cucsDomainServerFeatureInstanceId, cucsDomainNetworkFeatureEntry=cucsDomainNetworkFeatureEntry, cucsDomainEnvironmentFeatureFltAggr=cucsDomainEnvironmentFeatureFltAggr, cucsDomainEnvironmentFeatureDn=cucsDomainEnvironmentFeatureDn, cucsDomainEnvironmentParamEntry=cucsDomainEnvironmentParamEntry, cucsDomainNetworkFeatureInstanceId=cucsDomainNetworkFeatureInstanceId, cucsDomainNetworkFeatureType=cucsDomainNetworkFeatureType, cucsDomainNetworkFeatureTable=cucsDomainNetworkFeatureTable, cucsDomainEnvironmentFeatureContInstanceId=cucsDomainEnvironmentFeatureContInstanceId, cucsDomainStorageParamInstanceId=cucsDomainStorageParamInstanceId, cucsDomainServerFeatureEntry=cucsDomainServerFeatureEntry, cucsDomainNetworkFeatureContDn=cucsDomainNetworkFeatureContDn, cucsDomainServerFeatureTable=cucsDomainServerFeatureTable, cucsDomainStorageFeatureFltAggr=cucsDomainStorageFeatureFltAggr, cucsDomainServerFeatureRn=cucsDomainServerFeatureRn, cucsDomainEnvironmentParamRn=cucsDomainEnvironmentParamRn, cucsDomainServerFeatureName=cucsDomainServerFeatureName, cucsDomainNetworkParamRn=cucsDomainNetworkParamRn, cucsDomainNetworkFeatureFunctionalState=cucsDomainNetworkFeatureFunctionalState, cucsDomainServerFeatureFunctionalState=cucsDomainServerFeatureFunctionalState, cucsDomainServerParamRn=cucsDomainServerParamRn, cucsDomainEnvironmentFeatureInstanceId=cucsDomainEnvironmentFeatureInstanceId, cucsDomainStorageFeatureContDn=cucsDomainStorageFeatureContDn, PYSNMP_MODULE_ID=cucsDomainObjects, cucsDomainStorageFeatureContRn=cucsDomainStorageFeatureContRn, cucsDomainStorageFeatureContInstanceId=cucsDomainStorageFeatureContInstanceId, cucsDomainEnvironmentFeatureContTable=cucsDomainEnvironmentFeatureContTable, cucsDomainObjects=cucsDomainObjects, cucsDomainStorageFeatureEntry=cucsDomainStorageFeatureEntry, cucsDomainServerFeatureContTable=cucsDomainServerFeatureContTable, cucsDomainEnvironmentFeatureContFltAggr=cucsDomainEnvironmentFeatureContFltAggr, cucsDomainStorageFeatureInstanceId=cucsDomainStorageFeatureInstanceId, cucsDomainEnvironmentFeatureContDn=cucsDomainEnvironmentFeatureContDn, cucsDomainStorageParamName=cucsDomainStorageParamName, cucsDomainServerFeatureType=cucsDomainServerFeatureType, cucsDomainStorageFeatureTable=cucsDomainStorageFeatureTable, cucsDomainEnvironmentFeatureName=cucsDomainEnvironmentFeatureName, cucsDomainEnvironmentFeatureRn=cucsDomainEnvironmentFeatureRn, cucsDomainStorageParamDn=cucsDomainStorageParamDn, cucsDomainEnvironmentParamTable=cucsDomainEnvironmentParamTable, cucsDomainStorageFeatureType=cucsDomainStorageFeatureType, cucsDomainServerFeatureFltAggr=cucsDomainServerFeatureFltAggr)
|
def test_e1():
a: list[i32]
a = [1, 2, 3]
b: list[str]
b = ['1', '2']
a = b
|
def test_e1():
a: list[i32]
a = [1, 2, 3]
b: list[str]
b = ['1', '2']
a = b
|
# TODO(kailys): Doc and create examples
class ConfigOption(object):
"A class representing options for ``Config``."
def __init__(self, name, value_map):
self.name = name
self.value_to_code_map = value_map
self.code_to_value_map = {v: k for k, v in value_map.iteritems()}
self.values = value_map.viewkeys()
self.codes = value_map.viewvalues()
def get_code(self, value):
"""
Returns the code corresponding to the given value or the empty string if it
does not exist.
"""
return self.value_to_code_map.get(value, '')
def get_value(self, code):
"""
Returns the value corresponding to the given code or None if it does not
exist.
"""
return self.code_to_value_map.get(code)
def BoolOption(name, code):
"""
A specialized boolean option which uses the provided character code when the
option is on and an empty string when it is off.
"""
return ConfigOption(name, {True: code, False: ''})
class DuplicateCode(Exception):
pass
class InvalidValue(ValueError):
pass
class ConfigAttribute(object):
def __init__(self, option):
self.option = option
def __get__(self, instance, owner):
if instance is None:
return self
return instance._values.get(self.option.name)
def __set__(self, instance, value):
if value not in self.option.values:
raise InvalidValue(value, self.option.name)
instance._values[self.option.name] = value
class BaseConfig(object):
_options = {}
_options_by_code = {}
all_option_codes = ''
def __init__(self):
self._values = {}
def __repr__(self):
return '%s(%r)' % (type(self).__name__, self._values)
def to_code(self):
"""
Render into character codes.
"""
result = []
for key, value in self._values.iteritems():
result.append(self._options[key].get_code(value))
result.sort()
return "".join(result)
@classmethod
def from_code(cls, code):
"""
Render from character codes.
"""
config = cls()
for char in code:
option = cls._options_by_code.get(char)
if not option:
# do not complain; we sometimes want to make subsets of config codes
continue
config._values[option.name] = option.get_value(char)
return config
def find_duplicate(values):
seen = set()
for value in values:
if value in seen:
return value
seen.add(value)
return None
# argument: a list of ConfigOptions. This will return a class that can configure
# the specified options.
def create_configuration(options, base=BaseConfig):
duplicated_code = find_duplicate(
code for option in options for code in option.codes if code)
if duplicated_code:
raise DuplicateCode(duplicated_code)
options_dict = {option.name: option for option in options}
options_by_code = {
code: option for option in options for code in option.codes if code}
class Config(base):
_options = options_dict
_options_by_code = options_by_code
all_option_codes = ''.join(options_by_code)
for option in options:
setattr(Config, option.name, ConfigAttribute(option))
return Config
|
class Configoption(object):
"""A class representing options for ``Config``."""
def __init__(self, name, value_map):
self.name = name
self.value_to_code_map = value_map
self.code_to_value_map = {v: k for (k, v) in value_map.iteritems()}
self.values = value_map.viewkeys()
self.codes = value_map.viewvalues()
def get_code(self, value):
"""
Returns the code corresponding to the given value or the empty string if it
does not exist.
"""
return self.value_to_code_map.get(value, '')
def get_value(self, code):
"""
Returns the value corresponding to the given code or None if it does not
exist.
"""
return self.code_to_value_map.get(code)
def bool_option(name, code):
"""
A specialized boolean option which uses the provided character code when the
option is on and an empty string when it is off.
"""
return config_option(name, {True: code, False: ''})
class Duplicatecode(Exception):
pass
class Invalidvalue(ValueError):
pass
class Configattribute(object):
def __init__(self, option):
self.option = option
def __get__(self, instance, owner):
if instance is None:
return self
return instance._values.get(self.option.name)
def __set__(self, instance, value):
if value not in self.option.values:
raise invalid_value(value, self.option.name)
instance._values[self.option.name] = value
class Baseconfig(object):
_options = {}
_options_by_code = {}
all_option_codes = ''
def __init__(self):
self._values = {}
def __repr__(self):
return '%s(%r)' % (type(self).__name__, self._values)
def to_code(self):
"""
Render into character codes.
"""
result = []
for (key, value) in self._values.iteritems():
result.append(self._options[key].get_code(value))
result.sort()
return ''.join(result)
@classmethod
def from_code(cls, code):
"""
Render from character codes.
"""
config = cls()
for char in code:
option = cls._options_by_code.get(char)
if not option:
continue
config._values[option.name] = option.get_value(char)
return config
def find_duplicate(values):
seen = set()
for value in values:
if value in seen:
return value
seen.add(value)
return None
def create_configuration(options, base=BaseConfig):
duplicated_code = find_duplicate((code for option in options for code in option.codes if code))
if duplicated_code:
raise duplicate_code(duplicated_code)
options_dict = {option.name: option for option in options}
options_by_code = {code: option for option in options for code in option.codes if code}
class Config(base):
_options = options_dict
_options_by_code = options_by_code
all_option_codes = ''.join(options_by_code)
for option in options:
setattr(Config, option.name, config_attribute(option))
return Config
|
"""
Module: 'crypto' on GPy v1.11
"""
# MCU: (sysname='GPy', nodename='GPy', release='1.20.2.rc7', version='v1.11-6d01270 on 2020-05-04', machine='GPy with ESP32', pybytes='1.4.0')
# Stubber: 1.3.2
class AES:
''
MODE_CBC = 2
MODE_CFB = 3
MODE_CTR = 6
MODE_ECB = 1
SEGMENT_128 = 128
SEGMENT_8 = 8
def generate_rsa_signature():
pass
def getrandbits():
pass
def rsa_decrypt():
pass
def rsa_encrypt():
pass
|
"""
Module: 'crypto' on GPy v1.11
"""
class Aes:
""""""
mode_cbc = 2
mode_cfb = 3
mode_ctr = 6
mode_ecb = 1
segment_128 = 128
segment_8 = 8
def generate_rsa_signature():
pass
def getrandbits():
pass
def rsa_decrypt():
pass
def rsa_encrypt():
pass
|
# -*- coding: utf-8 -*-
{
'name': "Product Minimum Order Quantity",
'summary': """
Specify the minimum order quantity of an item""",
'description': """
This module adds the functionality to control the minimum order quantity in a sales order line. The default number is set to 0. You can change this value under the product form for individual product templates. Each product variant will inherit the templates min order quantity. Get in touch with us through [email protected] if you need more help.
""",
'author': "oGecko Solutions",
'website': "http://www.ogecko.com",
'category': 'Sales Management',
#Change the version every release for apps.
'version': '0.1',
# any module necessary for this one to work correctly
'depends': [
'base','sale'
],
# always loaded
'data': [
'views/product_view.xml',
],
# only loaded in demonstration mode
'demo': [
#'demo/demo.xml',
],
# only loaded in test
'test': [
],
}
|
{'name': 'Product Minimum Order Quantity', 'summary': '\n Specify the minimum order quantity of an item', 'description': '\nThis module adds the functionality to control the minimum order quantity in a sales order line. The default number is set to 0. You can change this value under the product form for individual product templates. Each product variant will inherit the templates min order quantity. Get in touch with us through [email protected] if you need more help.\n ', 'author': 'oGecko Solutions', 'website': 'http://www.ogecko.com', 'category': 'Sales Management', 'version': '0.1', 'depends': ['base', 'sale'], 'data': ['views/product_view.xml'], 'demo': [], 'test': []}
|
"""
goose : honk pig : 0.05 frog : -8 horse : 1 2 foo 3 duck : "quack quack"
"""
def pydict_to_mxdict(d):
res = []
for k,v in d.items():
res.append(k)
res.append(':')
if type(v) in [list, set, tuple]:
for i in v:
res.append(i)
else:
res.append(v)
return res
def test_pydict_to_mxdict():
d = dict(a='b', c=1.2, d=[1, 2, 34])
assert " ".join(pydict_to_mxdict(d)) == 'a : b c : 1.2 d : 1 2 34'
|
"""
goose : honk pig : 0.05 frog : -8 horse : 1 2 foo 3 duck : "quack quack"
"""
def pydict_to_mxdict(d):
res = []
for (k, v) in d.items():
res.append(k)
res.append(':')
if type(v) in [list, set, tuple]:
for i in v:
res.append(i)
else:
res.append(v)
return res
def test_pydict_to_mxdict():
d = dict(a='b', c=1.2, d=[1, 2, 34])
assert ' '.join(pydict_to_mxdict(d)) == 'a : b c : 1.2 d : 1 2 34'
|
def main():
myList = []
choice = 'a'
while choice != 'x':
if choice == 'a' or choice == 'A':
option1(myList)
elif choice == 'b' or choice == 'B':
option2(myList)
elif choice == 'c' or choice == 'C':
option3(myList)
elif choice == 'd' or choice == 'D':
option4(myList)
elif choice == 'x' or choice == 'X':
break
choice = displayMenu()
print ("\nProgram Exiting!\n\n")
def displayMenu():
myChoice = 0
while myChoice not in ["a","b","c","d","e","x","A","B","C","D","E","X"]:
print("""\n\nPlease choose
A. Add a number to the list/array
B. Print the list/array
C. Display and Separate the Odd and Even Numbers.
D. Print the list/array and sort it in reverse order
X. Quit
""")
myChoice = input("Enter option---> ")
if myChoice not in ["a","b","c","d","e","x","A","B","C","D","E","X"]:
print("Invalid option. Please select again.")
return myChoice
# Option A: Add a number to the list/array
def option1(myList):
num = -1
while num < 0:
num = int(input("\n\nEnter a N integer: "))
if num < 0:
print("Invalid value. Please re-enter.")
myList.append(num)
# Option B: Print the list/array
def option2(myList):
print(sorted(myList))
# Option C: Display and Separate the Odd and Even Numbers.
def option3(myList):
even = []
odd = []
for i in myList:
if (i % 2 == 0):
even.append(i)
else:
odd.append(i)
print("Even lists:", even)
print("Odd lists:", odd)
# Option D: Print the list/array and sort it in reverse order
def option4(myList):
print(sorted(myList, reverse=True))
main()
|
def main():
my_list = []
choice = 'a'
while choice != 'x':
if choice == 'a' or choice == 'A':
option1(myList)
elif choice == 'b' or choice == 'B':
option2(myList)
elif choice == 'c' or choice == 'C':
option3(myList)
elif choice == 'd' or choice == 'D':
option4(myList)
elif choice == 'x' or choice == 'X':
break
choice = display_menu()
print('\nProgram Exiting!\n\n')
def display_menu():
my_choice = 0
while myChoice not in ['a', 'b', 'c', 'd', 'e', 'x', 'A', 'B', 'C', 'D', 'E', 'X']:
print('\n\nPlease choose\n A. Add a number to the list/array\n B. Print the list/array\n C. Display and Separate the Odd and Even Numbers.\n D. Print the list/array and sort it in reverse order\n X. Quit\n ')
my_choice = input('Enter option---> ')
if myChoice not in ['a', 'b', 'c', 'd', 'e', 'x', 'A', 'B', 'C', 'D', 'E', 'X']:
print('Invalid option. Please select again.')
return myChoice
def option1(myList):
num = -1
while num < 0:
num = int(input('\n\nEnter a N integer: '))
if num < 0:
print('Invalid value. Please re-enter.')
myList.append(num)
def option2(myList):
print(sorted(myList))
def option3(myList):
even = []
odd = []
for i in myList:
if i % 2 == 0:
even.append(i)
else:
odd.append(i)
print('Even lists:', even)
print('Odd lists:', odd)
def option4(myList):
print(sorted(myList, reverse=True))
main()
|
reslist = [
-3251,
-1625,
0,
1625,
3251,
4876,
6502,
8127,
9752,
11378,
13003,
] # 1625/1626 increments
def fromcomp(val, bits):
if val >> (bits - 1) == 1:
return 0 - (val ^ (2 ** bits - 1)) - 1
else:
return val
filepath = "out.log"
with open(filepath) as fp:
line = fp.readline()
while line:
if line[32:34] == "TX":
tline = line[-37:]
res = int(tline[15:17] + tline[12:14], 16)
if (res & (1 << 15)) != 0:
res = res - (1 << 16)
elif line[32:34] == "RX":
lines = line[40:]
# print " ".join("%s:%s" % (1+i/2, lines[i:i+2]) for i in range(0, len(lines)-2, 2))
if len(lines) == 98:
# print lines
# 33,34 speed little endian
speed = int(lines[66:68] + lines[64:66], 16)
if (speed & (1 << 15)) != 0:
speed = speed - (1 << 16)
speed = speed / 2.8054 / 100
# Bytes 39, 40 is the force on the wheel to compute the power
force = int(lines[78:80] + lines[76:78], 16)
if (force & (1 << 15)) != 0:
force = force - (1 << 16)
# print "force",force
# byte 13 heart rate?
heartrate = int(lines[24:26], 16)
# cadnce 45,46
cadence = int(lines[90:92] + lines[88:90], 16)
# print "cadence", cadence
# if res in reslist: print res, force
if speed > 10:
print("%s,%s" % (res, force)) # , speed, heartrate
line = fp.readline()
|
reslist = [-3251, -1625, 0, 1625, 3251, 4876, 6502, 8127, 9752, 11378, 13003]
def fromcomp(val, bits):
if val >> bits - 1 == 1:
return 0 - (val ^ 2 ** bits - 1) - 1
else:
return val
filepath = 'out.log'
with open(filepath) as fp:
line = fp.readline()
while line:
if line[32:34] == 'TX':
tline = line[-37:]
res = int(tline[15:17] + tline[12:14], 16)
if res & 1 << 15 != 0:
res = res - (1 << 16)
elif line[32:34] == 'RX':
lines = line[40:]
if len(lines) == 98:
speed = int(lines[66:68] + lines[64:66], 16)
if speed & 1 << 15 != 0:
speed = speed - (1 << 16)
speed = speed / 2.8054 / 100
force = int(lines[78:80] + lines[76:78], 16)
if force & 1 << 15 != 0:
force = force - (1 << 16)
heartrate = int(lines[24:26], 16)
cadence = int(lines[90:92] + lines[88:90], 16)
if speed > 10:
print('%s,%s' % (res, force))
line = fp.readline()
|
# fun from StackOverflow :)
def toFixed(numObj, digits=0):
return f"{numObj:.{digits}f}"
# init
a = int(input("Enter a> "))
b = int(input("Enter b> "))
c = int(input("Enter c> "))
d = int(input("Enter d> "))
# calc
f = toFixed((a+b) / (c+d), 2)
# output
print("(a + b) / (c + d) = ", f)
|
def to_fixed(numObj, digits=0):
return f'{numObj:.{digits}f}'
a = int(input('Enter a> '))
b = int(input('Enter b> '))
c = int(input('Enter c> '))
d = int(input('Enter d> '))
f = to_fixed((a + b) / (c + d), 2)
print('(a + b) / (c + d) = ', f)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.