repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
jopohl/urh
src/urh/util/util.py
convert_bits_to_string
def convert_bits_to_string(bits, output_view_type: int, pad_zeros=False, lsb=False, lsd=False, endianness="big"): """ Convert bit array to string :param endianness: Endianness little or big :param bits: Bit array :param output_view_type: Output view type index 0 = bit, 1=hex, 2=ascii, 3=decimal ...
python
def convert_bits_to_string(bits, output_view_type: int, pad_zeros=False, lsb=False, lsd=False, endianness="big"): """ Convert bit array to string :param endianness: Endianness little or big :param bits: Bit array :param output_view_type: Output view type index 0 = bit, 1=hex, 2=ascii, 3=decimal ...
[ "def", "convert_bits_to_string", "(", "bits", ",", "output_view_type", ":", "int", ",", "pad_zeros", "=", "False", ",", "lsb", "=", "False", ",", "lsd", "=", "False", ",", "endianness", "=", "\"big\"", ")", ":", "bits_str", "=", "\"\"", ".", "join", "(",...
Convert bit array to string :param endianness: Endianness little or big :param bits: Bit array :param output_view_type: Output view type index 0 = bit, 1=hex, 2=ascii, 3=decimal 4=binary coded decimal (bcd) :param pad_zeros: :param lsb: Least Significant Bit -> Reverse bits first :param ls...
[ "Convert", "bit", "array", "to", "string", ":", "param", "endianness", ":", "Endianness", "little", "or", "big", ":", "param", "bits", ":", "Bit", "array", ":", "param", "output_view_type", ":", "Output", "view", "type", "index", "0", "=", "bit", "1", "=...
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/util/util.py#L88-L142
train
Convert a bit array to a string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/signalprocessing/ProtocolAnalyzer.py
ProtocolAnalyzer.__ensure_message_length_multiple
def __ensure_message_length_multiple(bit_data, bit_len: int, pauses, bit_sample_pos, divisor: int): """ In case of ASK modulation, this method tries to use pauses after messages as zero bits so that the bit lengths of messages are divisible by divisor :param bit_data: List of bit arrays ...
python
def __ensure_message_length_multiple(bit_data, bit_len: int, pauses, bit_sample_pos, divisor: int): """ In case of ASK modulation, this method tries to use pauses after messages as zero bits so that the bit lengths of messages are divisible by divisor :param bit_data: List of bit arrays ...
[ "def", "__ensure_message_length_multiple", "(", "bit_data", ",", "bit_len", ":", "int", ",", "pauses", ",", "bit_sample_pos", ",", "divisor", ":", "int", ")", ":", "for", "i", "in", "range", "(", "len", "(", "bit_data", ")", ")", ":", "missing_bits", "=", ...
In case of ASK modulation, this method tries to use pauses after messages as zero bits so that the bit lengths of messages are divisible by divisor :param bit_data: List of bit arrays :param bit_len: Bit length that was used for demodulation :param pauses: List of pauses :param b...
[ "In", "case", "of", "ASK", "modulation", "this", "method", "tries", "to", "use", "pauses", "after", "messages", "as", "zero", "bits", "so", "that", "the", "bit", "lengths", "of", "messages", "are", "divisible", "by", "divisor", ":", "param", "bit_data", ":...
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/signalprocessing/ProtocolAnalyzer.py#L246-L269
train
This method is used to ensure that the bit_len of the message is multiple of the bit_len of the message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/signalprocessing/ProtocolAnalyzer.py
ProtocolAnalyzer.get_samplepos_of_bitseq
def get_samplepos_of_bitseq(self, start_message: int, start_index: int, end_message: int, end_index: int, include_pause: bool): """ Determine on which place (regarding samples) a bit sequence is :rtype: tuple[int,int] """ try: if start_...
python
def get_samplepos_of_bitseq(self, start_message: int, start_index: int, end_message: int, end_index: int, include_pause: bool): """ Determine on which place (regarding samples) a bit sequence is :rtype: tuple[int,int] """ try: if start_...
[ "def", "get_samplepos_of_bitseq", "(", "self", ",", "start_message", ":", "int", ",", "start_index", ":", "int", ",", "end_message", ":", "int", ",", "end_index", ":", "int", ",", "include_pause", ":", "bool", ")", ":", "try", ":", "if", "start_message", "...
Determine on which place (regarding samples) a bit sequence is :rtype: tuple[int,int]
[ "Determine", "on", "which", "place", "(", "regarding", "samples", ")", "a", "bit", "sequence", "is", ":", "rtype", ":", "tuple", "[", "int", "int", "]" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/signalprocessing/ProtocolAnalyzer.py#L349-L374
train
Returns the position of the first bit sequence in the message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/signalprocessing/ProtocolAnalyzer.py
ProtocolAnalyzer.get_bitseq_from_selection
def get_bitseq_from_selection(self, selection_start: int, selection_width: int): """ get start and end index of bit sequence from selected samples :rtype: tuple[int,int,int,int] :return: start_message index, start index, end message index, end index """ start_message, st...
python
def get_bitseq_from_selection(self, selection_start: int, selection_width: int): """ get start and end index of bit sequence from selected samples :rtype: tuple[int,int,int,int] :return: start_message index, start index, end message index, end index """ start_message, st...
[ "def", "get_bitseq_from_selection", "(", "self", ",", "selection_start", ":", "int", ",", "selection_width", ":", "int", ")", ":", "start_message", ",", "start_index", ",", "end_message", ",", "end_index", "=", "-", "1", ",", "-", "1", ",", "-", "1", ",", ...
get start and end index of bit sequence from selected samples :rtype: tuple[int,int,int,int] :return: start_message index, start index, end message index, end index
[ "get", "start", "and", "end", "index", "of", "bit", "sequence", "from", "selected", "samples" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/signalprocessing/ProtocolAnalyzer.py#L376-L414
train
get start and end index of bit sequence from selected samples
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/signalprocessing/ProtocolAnalyzer.py
ProtocolAnalyzer.convert_index
def convert_index(self, index: int, from_view: int, to_view: int, decoded: bool, message_indx=-1) -> tuple: """ Konvertiert einen Index aus der einen Sicht (z.B. Bit) in eine andere (z.B. Hex) :param message_indx: if -1, the message with max length is chosen :return: """ ...
python
def convert_index(self, index: int, from_view: int, to_view: int, decoded: bool, message_indx=-1) -> tuple: """ Konvertiert einen Index aus der einen Sicht (z.B. Bit) in eine andere (z.B. Hex) :param message_indx: if -1, the message with max length is chosen :return: """ ...
[ "def", "convert_index", "(", "self", ",", "index", ":", "int", ",", "from_view", ":", "int", ",", "to_view", ":", "int", ",", "decoded", ":", "bool", ",", "message_indx", "=", "-", "1", ")", "->", "tuple", ":", "if", "len", "(", "self", ".", "messa...
Konvertiert einen Index aus der einen Sicht (z.B. Bit) in eine andere (z.B. Hex) :param message_indx: if -1, the message with max length is chosen :return:
[ "Konvertiert", "einen", "Index", "aus", "der", "einen", "Sicht", "(", "z", ".", "B", ".", "Bit", ")", "in", "eine", "andere", "(", "z", ".", "B", ".", "Hex", ")" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/signalprocessing/ProtocolAnalyzer.py#L439-L455
train
Convert an index into a new version of the current version.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/signalprocessing/ProtocolAnalyzer.py
ProtocolAnalyzer.estimate_frequency_for_one
def estimate_frequency_for_one(self, sample_rate: float, nbits=42) -> float: """ Calculates the frequency of at most nbits logical ones and returns the mean of these frequencies :param nbits: :return: """ return self.__estimate_frequency_for_bit(True, sample_rate, nbits)
python
def estimate_frequency_for_one(self, sample_rate: float, nbits=42) -> float: """ Calculates the frequency of at most nbits logical ones and returns the mean of these frequencies :param nbits: :return: """ return self.__estimate_frequency_for_bit(True, sample_rate, nbits)
[ "def", "estimate_frequency_for_one", "(", "self", ",", "sample_rate", ":", "float", ",", "nbits", "=", "42", ")", "->", "float", ":", "return", "self", ".", "__estimate_frequency_for_bit", "(", "True", ",", "sample_rate", ",", "nbits", ")" ]
Calculates the frequency of at most nbits logical ones and returns the mean of these frequencies :param nbits: :return:
[ "Calculates", "the", "frequency", "of", "at", "most", "nbits", "logical", "ones", "and", "returns", "the", "mean", "of", "these", "frequencies" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/signalprocessing/ProtocolAnalyzer.py#L470-L477
train
Calculates the frequency of at most nbits logical ones and returns the mean of these frequencies.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/signalprocessing/ProtocolAnalyzer.py
ProtocolAnalyzer.estimate_frequency_for_zero
def estimate_frequency_for_zero(self, sample_rate: float, nbits=42) -> float: """ Calculates the frequency of at most nbits logical zeros and returns the mean of these frequencies :param nbits: :return: """ return self.__estimate_frequency_for_bit(False, sample_rate, nbi...
python
def estimate_frequency_for_zero(self, sample_rate: float, nbits=42) -> float: """ Calculates the frequency of at most nbits logical zeros and returns the mean of these frequencies :param nbits: :return: """ return self.__estimate_frequency_for_bit(False, sample_rate, nbi...
[ "def", "estimate_frequency_for_zero", "(", "self", ",", "sample_rate", ":", "float", ",", "nbits", "=", "42", ")", "->", "float", ":", "return", "self", ".", "__estimate_frequency_for_bit", "(", "False", ",", "sample_rate", ",", "nbits", ")" ]
Calculates the frequency of at most nbits logical zeros and returns the mean of these frequencies :param nbits: :return:
[ "Calculates", "the", "frequency", "of", "at", "most", "nbits", "logical", "zeros", "and", "returns", "the", "mean", "of", "these", "frequencies" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/signalprocessing/ProtocolAnalyzer.py#L496-L503
train
Calculates the frequency of at most nbits logical zeros and returns the mean of these frequencies.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/signalprocessing/ProtocolAnalyzer.py
ProtocolAnalyzer.auto_assign_decodings
def auto_assign_decodings(self, decodings): """ :type decodings: list of Encoding """ nrz_decodings = [decoding for decoding in decodings if decoding.is_nrz or decoding.is_nrzi] fallback = nrz_decodings[0] if nrz_decodings else None candidate_decodings = [decoding for dec...
python
def auto_assign_decodings(self, decodings): """ :type decodings: list of Encoding """ nrz_decodings = [decoding for decoding in decodings if decoding.is_nrz or decoding.is_nrzi] fallback = nrz_decodings[0] if nrz_decodings else None candidate_decodings = [decoding for dec...
[ "def", "auto_assign_decodings", "(", "self", ",", "decodings", ")", ":", "nrz_decodings", "=", "[", "decoding", "for", "decoding", "in", "decodings", "if", "decoding", ".", "is_nrz", "or", "decoding", ".", "is_nrzi", "]", "fallback", "=", "nrz_decodings", "[",...
:type decodings: list of Encoding
[ ":", "type", "decodings", ":", "list", "of", "Encoding" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/signalprocessing/ProtocolAnalyzer.py#L718-L737
train
Auto - assigns the decodings to the message objects.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/ui/views/MessageTypeTableView.py
MessageTypeTableView.selection_range
def selection_range(self): """ :rtype: int, int """ selected = self.selectionModel().selection() """:type: QItemSelection """ if selected.isEmpty(): return -1, -1 min_row = min(rng.top() for rng in selected) max_row = max(rng.bottom() for rng...
python
def selection_range(self): """ :rtype: int, int """ selected = self.selectionModel().selection() """:type: QItemSelection """ if selected.isEmpty(): return -1, -1 min_row = min(rng.top() for rng in selected) max_row = max(rng.bottom() for rng...
[ "def", "selection_range", "(", "self", ")", ":", "selected", "=", "self", ".", "selectionModel", "(", ")", ".", "selection", "(", ")", "\"\"\":type: QItemSelection \"\"\"", "if", "selected", ".", "isEmpty", "(", ")", ":", "return", "-", "1", ",", "-", "1",...
:rtype: int, int
[ ":", "rtype", ":", "int", "int" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/ui/views/MessageTypeTableView.py#L33-L46
train
Returns the selection range of the selected items.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
data/release.py
cleanup
def cleanup(): """ Remove all cache directories :return: """ script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__)) script_dir = os.path.realpath(os.path.join(script_dir, "..")) shutil.rmtree(os.path.join(script_dir, "dist"), ignore...
python
def cleanup(): """ Remove all cache directories :return: """ script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__)) script_dir = os.path.realpath(os.path.join(script_dir, "..")) shutil.rmtree(os.path.join(script_dir, "dist"), ignore...
[ "def", "cleanup", "(", ")", ":", "script_dir", "=", "os", ".", "path", ".", "dirname", "(", "__file__", ")", "if", "not", "os", ".", "path", ".", "islink", "(", "__file__", ")", "else", "os", ".", "path", ".", "dirname", "(", "os", ".", "readlink",...
Remove all cache directories :return:
[ "Remove", "all", "cache", "directories", ":", "return", ":" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/data/release.py#L9-L20
train
Remove all cache directories
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/ui/views/TableView.py
TableView.selection_range
def selection_range(self): """ :rtype: int, int, int, int """ selected = self.selectionModel().selection() # type: QItemSelection if self.selection_is_empty: return -1, -1, -1, -1 def range_to_tuple(rng): return rng.row(), rng.column() t...
python
def selection_range(self): """ :rtype: int, int, int, int """ selected = self.selectionModel().selection() # type: QItemSelection if self.selection_is_empty: return -1, -1, -1, -1 def range_to_tuple(rng): return rng.row(), rng.column() t...
[ "def", "selection_range", "(", "self", ")", ":", "selected", "=", "self", ".", "selectionModel", "(", ")", ".", "selection", "(", ")", "# type: QItemSelection", "if", "self", ".", "selection_is_empty", ":", "return", "-", "1", ",", "-", "1", ",", "-", "1...
:rtype: int, int, int, int
[ ":", "rtype", ":", "int", "int", "int", "int" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/ui/views/TableView.py#L106-L120
train
Returns the range of the selected items.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/ainterpretation/AutoInterpretation.py
get_most_frequent_value
def get_most_frequent_value(values: list): """ Return the most frequent value in list. If there is no unique one, return the maximum of the most frequent values :param values: :return: """ if len(values) == 0: return None most_common = Counter(values).most_common() result, ...
python
def get_most_frequent_value(values: list): """ Return the most frequent value in list. If there is no unique one, return the maximum of the most frequent values :param values: :return: """ if len(values) == 0: return None most_common = Counter(values).most_common() result, ...
[ "def", "get_most_frequent_value", "(", "values", ":", "list", ")", ":", "if", "len", "(", "values", ")", "==", "0", ":", "return", "None", "most_common", "=", "Counter", "(", "values", ")", ".", "most_common", "(", ")", "result", ",", "max_count", "=", ...
Return the most frequent value in list. If there is no unique one, return the maximum of the most frequent values :param values: :return:
[ "Return", "the", "most", "frequent", "value", "in", "list", ".", "If", "there", "is", "no", "unique", "one", "return", "the", "maximum", "of", "the", "most", "frequent", "values" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/ainterpretation/AutoInterpretation.py#L28-L47
train
Return the most frequent value in list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/ainterpretation/AutoInterpretation.py
segment_messages_from_magnitudes
def segment_messages_from_magnitudes(magnitudes: np.ndarray, noise_threshold: float): """ Get the list of start, end indices of messages :param magnitudes: Magnitudes of samples :param noise_threshold: Threshold for noise :return: """ return c_auto_interpretation.segment_messages_from_magni...
python
def segment_messages_from_magnitudes(magnitudes: np.ndarray, noise_threshold: float): """ Get the list of start, end indices of messages :param magnitudes: Magnitudes of samples :param noise_threshold: Threshold for noise :return: """ return c_auto_interpretation.segment_messages_from_magni...
[ "def", "segment_messages_from_magnitudes", "(", "magnitudes", ":", "np", ".", "ndarray", ",", "noise_threshold", ":", "float", ")", ":", "return", "c_auto_interpretation", ".", "segment_messages_from_magnitudes", "(", "magnitudes", ",", "noise_threshold", ")" ]
Get the list of start, end indices of messages :param magnitudes: Magnitudes of samples :param noise_threshold: Threshold for noise :return:
[ "Get", "the", "list", "of", "start", "end", "indices", "of", "messages" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/ainterpretation/AutoInterpretation.py#L78-L86
train
Get the list of start end indices of messages in the sequence of magnitudes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/ainterpretation/AutoInterpretation.py
round_plateau_lengths
def round_plateau_lengths(plateau_lengths: list): """ Round plateau lengths to next divisible number of digit count e.g. 99 -> 100, 293 -> 300 :param plateau_lengths: :return: """ # round to n_digits of most common value digit_counts = [len(str(p)) for p in plateau_lengths] n_digits = m...
python
def round_plateau_lengths(plateau_lengths: list): """ Round plateau lengths to next divisible number of digit count e.g. 99 -> 100, 293 -> 300 :param plateau_lengths: :return: """ # round to n_digits of most common value digit_counts = [len(str(p)) for p in plateau_lengths] n_digits = m...
[ "def", "round_plateau_lengths", "(", "plateau_lengths", ":", "list", ")", ":", "# round to n_digits of most common value", "digit_counts", "=", "[", "len", "(", "str", "(", "p", ")", ")", "for", "p", "in", "plateau_lengths", "]", "n_digits", "=", "min", "(", "...
Round plateau lengths to next divisible number of digit count e.g. 99 -> 100, 293 -> 300 :param plateau_lengths: :return:
[ "Round", "plateau", "lengths", "to", "next", "divisible", "number", "of", "digit", "count", "e", ".", "g", ".", "99", "-", ">", "100", "293", "-", ">", "300" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/ainterpretation/AutoInterpretation.py#L293-L306
train
Round plateau lengths to next divisible number of digits e. g. 99 293 293.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/controller/MainController.py
MainController.on_files_dropped_on_group
def on_files_dropped_on_group(self, files, group_id: int): """ :param group_id: :type files: list of QtCore.QUrl """ self.__add_urls_to_group(files, group_id=group_id)
python
def on_files_dropped_on_group(self, files, group_id: int): """ :param group_id: :type files: list of QtCore.QUrl """ self.__add_urls_to_group(files, group_id=group_id)
[ "def", "on_files_dropped_on_group", "(", "self", ",", "files", ",", "group_id", ":", "int", ")", ":", "self", ".", "__add_urls_to_group", "(", "files", ",", "group_id", "=", "group_id", ")" ]
:param group_id: :type files: list of QtCore.QUrl
[ ":", "param", "group_id", ":", ":", "type", "files", ":", "list", "of", "QtCore", ".", "QUrl" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/controller/MainController.py#L799-L804
train
Called when the files list is dropped from a group.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/plugins/PluginManager.py
PluginManager.load_installed_plugins
def load_installed_plugins(self): """ :rtype: list of Plugin """ result = [] plugin_dirs = [d for d in os.listdir(self.plugin_path) if os.path.isdir(os.path.join(self.plugin_path, d))] settings = constants.SETTINGS for d in plugin_dirs: if d == "__pycache__": ...
python
def load_installed_plugins(self): """ :rtype: list of Plugin """ result = [] plugin_dirs = [d for d in os.listdir(self.plugin_path) if os.path.isdir(os.path.join(self.plugin_path, d))] settings = constants.SETTINGS for d in plugin_dirs: if d == "__pycache__": ...
[ "def", "load_installed_plugins", "(", "self", ")", ":", "result", "=", "[", "]", "plugin_dirs", "=", "[", "d", "for", "d", "in", "os", ".", "listdir", "(", "self", ".", "plugin_path", ")", "if", "os", ".", "path", ".", "isdir", "(", "os", ".", "pat...
:rtype: list of Plugin
[ ":", "rtype", ":", "list", "of", "Plugin" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/plugins/PluginManager.py#L18-L38
train
Loads all installed plugins and returns a list of plugins.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/plugins/MessageBreak/MessageBreakAction.py
MessageBreakAction.__get_zero_seq_indexes
def __get_zero_seq_indexes(self, message: str, following_zeros: int): """ :rtype: list[tuple of int] """ result = [] if following_zeros > len(message): return result zero_counter = 0 for i in range(0, len(message)): if message[i] == "0": ...
python
def __get_zero_seq_indexes(self, message: str, following_zeros: int): """ :rtype: list[tuple of int] """ result = [] if following_zeros > len(message): return result zero_counter = 0 for i in range(0, len(message)): if message[i] == "0": ...
[ "def", "__get_zero_seq_indexes", "(", "self", ",", "message", ":", "str", ",", "following_zeros", ":", "int", ")", ":", "result", "=", "[", "]", "if", "following_zeros", ">", "len", "(", "message", ")", ":", "return", "result", "zero_counter", "=", "0", ...
:rtype: list[tuple of int]
[ ":", "rtype", ":", "list", "[", "tuple", "of", "int", "]" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/plugins/MessageBreak/MessageBreakAction.py#L33-L54
train
Returns a list of indexes of the zero sequence in the message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/dev/VirtualDevice.py
VirtualDevice.read_messages
def read_messages(self) -> str: """ returns a string of new device messages separated by newlines :return: """ if self.backend == Backends.grc: errors = self.__dev.read_errors() if "FATAL: " in errors: self.fatal_error_occurred.emit(error...
python
def read_messages(self) -> str: """ returns a string of new device messages separated by newlines :return: """ if self.backend == Backends.grc: errors = self.__dev.read_errors() if "FATAL: " in errors: self.fatal_error_occurred.emit(error...
[ "def", "read_messages", "(", "self", ")", "->", "str", ":", "if", "self", ".", "backend", "==", "Backends", ".", "grc", ":", "errors", "=", "self", ".", "__dev", ".", "read_errors", "(", ")", "if", "\"FATAL: \"", "in", "errors", ":", "self", ".", "fa...
returns a string of new device messages separated by newlines :return:
[ "returns", "a", "string", "of", "new", "device", "messages", "separated", "by", "newlines" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/dev/VirtualDevice.py#L648-L677
train
Reads the new device messages and returns a string of new device messages separated by newlines.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/plugins/Plugin.py
ProtocolPlugin.get_action
def get_action(self, parent, undo_stack: QUndoStack, sel_range, groups, view: int) -> QUndoCommand: """ :type parent: QTableView :type undo_stack: QUndoStack :type groups: list of ProtocolGroups """ raise NotImplementedError("Abstract Method.")
python
def get_action(self, parent, undo_stack: QUndoStack, sel_range, groups, view: int) -> QUndoCommand: """ :type parent: QTableView :type undo_stack: QUndoStack :type groups: list of ProtocolGroups """ raise NotImplementedError("Abstract Method.")
[ "def", "get_action", "(", "self", ",", "parent", ",", "undo_stack", ":", "QUndoStack", ",", "sel_range", ",", "groups", ",", "view", ":", "int", ")", "->", "QUndoCommand", ":", "raise", "NotImplementedError", "(", "\"Abstract Method.\"", ")" ]
:type parent: QTableView :type undo_stack: QUndoStack :type groups: list of ProtocolGroups
[ ":", "type", "parent", ":", "QTableView", ":", "type", "undo_stack", ":", "QUndoStack", ":", "type", "groups", ":", "list", "of", "ProtocolGroups" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/plugins/Plugin.py#L57-L64
train
Get the action for the current node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/util/WSPChecksum.py
WSPChecksum.calculate
def calculate(self, msg: array.array) -> array.array: """ Get the checksum for a WSP message. There are three hashes possible: 1) 4 Bit Checksum - For Switch Telegram (RORG=5 or 6 and STATUS = 0x20 or 0x30) 2) 8 Bit Checksum: STATUS bit 2^7 = 0 3) 8 Bit CRC: STATUS bit 2^7 = 1 ...
python
def calculate(self, msg: array.array) -> array.array: """ Get the checksum for a WSP message. There are three hashes possible: 1) 4 Bit Checksum - For Switch Telegram (RORG=5 or 6 and STATUS = 0x20 or 0x30) 2) 8 Bit Checksum: STATUS bit 2^7 = 0 3) 8 Bit CRC: STATUS bit 2^7 = 1 ...
[ "def", "calculate", "(", "self", ",", "msg", ":", "array", ".", "array", ")", "->", "array", ".", "array", ":", "try", ":", "if", "self", ".", "mode", "==", "self", ".", "ChecksumMode", ".", "auto", ":", "if", "msg", "[", "0", ":", "4", "]", "=...
Get the checksum for a WSP message. There are three hashes possible: 1) 4 Bit Checksum - For Switch Telegram (RORG=5 or 6 and STATUS = 0x20 or 0x30) 2) 8 Bit Checksum: STATUS bit 2^7 = 0 3) 8 Bit CRC: STATUS bit 2^7 = 1 :param msg: the message without Preamble/SOF and EOF. Message start...
[ "Get", "the", "checksum", "for", "a", "WSP", "message", ".", "There", "are", "three", "hashes", "possible", ":", "1", ")", "4", "Bit", "Checksum", "-", "For", "Switch", "Telegram", "(", "RORG", "=", "5", "or", "6", "and", "STATUS", "=", "0x20", "or",...
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/util/WSPChecksum.py#L27-L56
train
Calculates the checksum for a WSP message.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
jopohl/urh
src/urh/models/ProtocolTreeItem.py
ProtocolTreeItem.child
def child(self, number): """ :type number: int :rtype: ProtocolTreeItem """ if number < self.childCount(): return self.__childItems[number] else: return False
python
def child(self, number): """ :type number: int :rtype: ProtocolTreeItem """ if number < self.childCount(): return self.__childItems[number] else: return False
[ "def", "child", "(", "self", ",", "number", ")", ":", "if", "number", "<", "self", ".", "childCount", "(", ")", ":", "return", "self", ".", "__childItems", "[", "number", "]", "else", ":", "return", "False" ]
:type number: int :rtype: ProtocolTreeItem
[ ":", "type", "number", ":", "int", ":", "rtype", ":", "ProtocolTreeItem" ]
2eb33b125c8407964cd1092843cde5010eb88aae
https://github.com/jopohl/urh/blob/2eb33b125c8407964cd1092843cde5010eb88aae/src/urh/models/ProtocolTreeItem.py#L106-L114
train
Returns the child with the given number.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Anorov/cloudflare-scrape
cfscrape/__init__.py
CloudflareScraper.create_scraper
def create_scraper(cls, sess=None, **kwargs): """ Convenience function for creating a ready-to-go CloudflareScraper object. """ scraper = cls(**kwargs) if sess: attrs = ["auth", "cert", "cookies", "headers", "hooks", "params", "proxies", "data"] for attr ...
python
def create_scraper(cls, sess=None, **kwargs): """ Convenience function for creating a ready-to-go CloudflareScraper object. """ scraper = cls(**kwargs) if sess: attrs = ["auth", "cert", "cookies", "headers", "hooks", "params", "proxies", "data"] for attr ...
[ "def", "create_scraper", "(", "cls", ",", "sess", "=", "None", ",", "*", "*", "kwargs", ")", ":", "scraper", "=", "cls", "(", "*", "*", "kwargs", ")", "if", "sess", ":", "attrs", "=", "[", "\"auth\"", ",", "\"cert\"", ",", "\"cookies\"", ",", "\"he...
Convenience function for creating a ready-to-go CloudflareScraper object.
[ "Convenience", "function", "for", "creating", "a", "ready", "-", "to", "-", "go", "CloudflareScraper", "object", "." ]
f35c463a60d175f0252b1e0c8e14a284e9d4daa5
https://github.com/Anorov/cloudflare-scrape/blob/f35c463a60d175f0252b1e0c8e14a284e9d4daa5/cfscrape/__init__.py#L156-L169
train
Create a new instance of the CloudFlareScraper class.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Anorov/cloudflare-scrape
cfscrape/__init__.py
CloudflareScraper.get_cookie_string
def get_cookie_string(cls, url, user_agent=None, **kwargs): """ Convenience function for building a Cookie HTTP header value. """ tokens, user_agent = cls.get_tokens(url, user_agent=user_agent, **kwargs) return "; ".join("=".join(pair) for pair in tokens.items()), user_agent
python
def get_cookie_string(cls, url, user_agent=None, **kwargs): """ Convenience function for building a Cookie HTTP header value. """ tokens, user_agent = cls.get_tokens(url, user_agent=user_agent, **kwargs) return "; ".join("=".join(pair) for pair in tokens.items()), user_agent
[ "def", "get_cookie_string", "(", "cls", ",", "url", ",", "user_agent", "=", "None", ",", "*", "*", "kwargs", ")", ":", "tokens", ",", "user_agent", "=", "cls", ".", "get_tokens", "(", "url", ",", "user_agent", "=", "user_agent", ",", "*", "*", "kwargs"...
Convenience function for building a Cookie HTTP header value.
[ "Convenience", "function", "for", "building", "a", "Cookie", "HTTP", "header", "value", "." ]
f35c463a60d175f0252b1e0c8e14a284e9d4daa5
https://github.com/Anorov/cloudflare-scrape/blob/f35c463a60d175f0252b1e0c8e14a284e9d4daa5/cfscrape/__init__.py#L205-L210
train
Convenience function for building a Cookie HTTP header value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/extreme/extreme_ers_ssh.py
ExtremeErsSSH.save_config
def save_config(self, cmd="save config", confirm=False, confirm_response=""): """Save Config""" return super(ExtremeErsSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="save config", confirm=False, confirm_response=""): """Save Config""" return super(ExtremeErsSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"save config\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "ExtremeErsSSH", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ",...
Save Config
[ "Save", "Config" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/extreme/extreme_ers_ssh.py#L41-L45
train
Save config of the current user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/extreme/extreme_slx_ssh.py
ExtremeSlxSSH.special_login_handler
def special_login_handler(self, delay_factor=1): """Adding a delay after login.""" delay_factor = self.select_delay_factor(delay_factor) self.write_channel(self.RETURN) time.sleep(1 * delay_factor)
python
def special_login_handler(self, delay_factor=1): """Adding a delay after login.""" delay_factor = self.select_delay_factor(delay_factor) self.write_channel(self.RETURN) time.sleep(1 * delay_factor)
[ "def", "special_login_handler", "(", "self", ",", "delay_factor", "=", "1", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", ")", "self", ".", "write_channel", "(", "self", ".", "RETURN", ")", "time", ".", "sleep", "(",...
Adding a delay after login.
[ "Adding", "a", "delay", "after", "login", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/extreme/extreme_slx_ssh.py#L18-L22
train
This is a special login handler.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/extreme/extreme_slx_ssh.py
ExtremeSlxSSH.save_config
def save_config( self, cmd="copy running-config startup-config", confirm=True, confirm_response="y", ): """Save Config for Extreme SLX.""" return super(ExtremeSlxSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config( self, cmd="copy running-config startup-config", confirm=True, confirm_response="y", ): """Save Config for Extreme SLX.""" return super(ExtremeSlxSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"copy running-config startup-config\"", ",", "confirm", "=", "True", ",", "confirm_response", "=", "\"y\"", ",", ")", ":", "return", "super", "(", "ExtremeSlxSSH", ",", "self", ")", ".", "save_config", "(",...
Save Config for Extreme SLX.
[ "Save", "Config", "for", "Extreme", "SLX", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/extreme/extreme_slx_ssh.py#L24-L33
train
Save Config for Extreme SLX.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
examples/use_cases/case16_concurrency/threads_netmiko.py
show_version
def show_version(a_device): """Execute show version command using Netmiko.""" remote_conn = ConnectHandler(**a_device) print() print("#" * 80) print(remote_conn.send_command_expect("show version")) print("#" * 80) print()
python
def show_version(a_device): """Execute show version command using Netmiko.""" remote_conn = ConnectHandler(**a_device) print() print("#" * 80) print(remote_conn.send_command_expect("show version")) print("#" * 80) print()
[ "def", "show_version", "(", "a_device", ")", ":", "remote_conn", "=", "ConnectHandler", "(", "*", "*", "a_device", ")", "print", "(", ")", "print", "(", "\"#\"", "*", "80", ")", "print", "(", "remote_conn", ".", "send_command_expect", "(", "\"show version\""...
Execute show version command using Netmiko.
[ "Execute", "show", "version", "command", "using", "Netmiko", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/examples/use_cases/case16_concurrency/threads_netmiko.py#L8-L15
train
Execute show version command using Netmiko.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
examples/use_cases/case16_concurrency/threads_netmiko.py
main
def main(): """ Use threads and Netmiko to connect to each of the devices. Execute 'show version' on each device. Record the amount of time required to do this. """ start_time = datetime.now() for a_device in devices: my_thread = threading.Thread(target=show_version, args=(a_device,)) ...
python
def main(): """ Use threads and Netmiko to connect to each of the devices. Execute 'show version' on each device. Record the amount of time required to do this. """ start_time = datetime.now() for a_device in devices: my_thread = threading.Thread(target=show_version, args=(a_device,)) ...
[ "def", "main", "(", ")", ":", "start_time", "=", "datetime", ".", "now", "(", ")", "for", "a_device", "in", "devices", ":", "my_thread", "=", "threading", ".", "Thread", "(", "target", "=", "show_version", ",", "args", "=", "(", "a_device", ",", ")", ...
Use threads and Netmiko to connect to each of the devices. Execute 'show version' on each device. Record the amount of time required to do this.
[ "Use", "threads", "and", "Netmiko", "to", "connect", "to", "each", "of", "the", "devices", ".", "Execute", "show", "version", "on", "each", "device", ".", "Record", "the", "amount", "of", "time", "required", "to", "do", "this", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/examples/use_cases/case16_concurrency/threads_netmiko.py#L18-L35
train
Execute show version on each of the devices.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_force10_ssh.py
DellForce10SSH.save_config
def save_config( self, cmd="copy running-configuration startup-configuration", confirm=False, confirm_response="", ): """Saves Config""" return super(DellForce10SSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config( self, cmd="copy running-configuration startup-configuration", confirm=False, confirm_response="", ): """Saves Config""" return super(DellForce10SSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"copy running-configuration startup-configuration\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ",", ")", ":", "return", "super", "(", "DellForce10SSH", ",", "self", ")", ".", "save_...
Saves Config
[ "Saves", "Config" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_force10_ssh.py#L9-L18
train
Saves Config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/citrix/netscaler_ssh.py
NetscalerSSH.session_preparation
def session_preparation(self): """Prepare the session after the connection has been established.""" # 0 will defer to the global delay factor delay_factor = self.select_delay_factor(delay_factor=0) self._test_channel_read() self.set_base_prompt() cmd = "{}set cli mode -pa...
python
def session_preparation(self): """Prepare the session after the connection has been established.""" # 0 will defer to the global delay factor delay_factor = self.select_delay_factor(delay_factor=0) self._test_channel_read() self.set_base_prompt() cmd = "{}set cli mode -pa...
[ "def", "session_preparation", "(", "self", ")", ":", "# 0 will defer to the global delay factor", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", "=", "0", ")", "self", ".", "_test_channel_read", "(", ")", "self", ".", "set_base_prompt", ...
Prepare the session after the connection has been established.
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/citrix/netscaler_ssh.py#L9-L20
train
Prepare the session after the connection has been established.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/citrix/netscaler_ssh.py
NetscalerSSH.strip_prompt
def strip_prompt(self, a_string): """ Strip 'Done' from command output """ output = super(NetscalerSSH, self).strip_prompt(a_string) lines = output.split(self.RESPONSE_RETURN) if "Done" in lines[-1]: return self.RESPONSE_RETURN.join(lines[:-1]) else: retur...
python
def strip_prompt(self, a_string): """ Strip 'Done' from command output """ output = super(NetscalerSSH, self).strip_prompt(a_string) lines = output.split(self.RESPONSE_RETURN) if "Done" in lines[-1]: return self.RESPONSE_RETURN.join(lines[:-1]) else: retur...
[ "def", "strip_prompt", "(", "self", ",", "a_string", ")", ":", "output", "=", "super", "(", "NetscalerSSH", ",", "self", ")", ".", "strip_prompt", "(", "a_string", ")", "lines", "=", "output", ".", "split", "(", "self", ".", "RESPONSE_RETURN", ")", "if",...
Strip 'Done' from command output
[ "Strip", "Done", "from", "command", "output" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/citrix/netscaler_ssh.py#L53-L60
train
Strip Done from command output
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ubiquiti/edge_ssh.py
UbiquitiEdgeSSH.save_config
def save_config(self, cmd="write memory", confirm=False, confirm_response=""): """Saves configuration.""" return super(UbiquitiEdgeSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="write memory", confirm=False, confirm_response=""): """Saves configuration.""" return super(UbiquitiEdgeSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write memory\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "UbiquitiEdgeSSH", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ...
Saves configuration.
[ "Saves", "configuration", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ubiquiti/edge_ssh.py#L43-L47
train
Saves configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
SCPConn.establish_scp_conn
def establish_scp_conn(self): """Establish the secure copy connection.""" ssh_connect_params = self.ssh_ctl_chan._connect_params_dict() self.scp_conn = self.ssh_ctl_chan._build_ssh_client() self.scp_conn.connect(**ssh_connect_params) self.scp_client = scp.SCPClient(self.scp_conn....
python
def establish_scp_conn(self): """Establish the secure copy connection.""" ssh_connect_params = self.ssh_ctl_chan._connect_params_dict() self.scp_conn = self.ssh_ctl_chan._build_ssh_client() self.scp_conn.connect(**ssh_connect_params) self.scp_client = scp.SCPClient(self.scp_conn....
[ "def", "establish_scp_conn", "(", "self", ")", ":", "ssh_connect_params", "=", "self", ".", "ssh_ctl_chan", ".", "_connect_params_dict", "(", ")", "self", ".", "scp_conn", "=", "self", ".", "ssh_ctl_chan", ".", "_build_ssh_client", "(", ")", "self", ".", "scp_...
Establish the secure copy connection.
[ "Establish", "the", "secure", "copy", "connection", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L31-L36
train
Establish the secure copy connection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.remote_space_available
def remote_space_available(self, search_pattern=r"(\d+) \w+ free"): """Return space available on remote device.""" remote_cmd = "dir {}".format(self.file_system) remote_output = self.ssh_ctl_chan.send_command_expect(remote_cmd) match = re.search(search_pattern, remote_output) if ...
python
def remote_space_available(self, search_pattern=r"(\d+) \w+ free"): """Return space available on remote device.""" remote_cmd = "dir {}".format(self.file_system) remote_output = self.ssh_ctl_chan.send_command_expect(remote_cmd) match = re.search(search_pattern, remote_output) if ...
[ "def", "remote_space_available", "(", "self", ",", "search_pattern", "=", "r\"(\\d+) \\w+ free\"", ")", ":", "remote_cmd", "=", "\"dir {}\"", ".", "format", "(", "self", ".", "file_system", ")", "remote_output", "=", "self", ".", "ssh_ctl_chan", ".", "send_command...
Return space available on remote device.
[ "Return", "space", "available", "on", "remote", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L106-L113
train
Return the number of bytes available on remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer._remote_space_available_unix
def _remote_space_available_unix(self, search_pattern=""): """Return space available on *nix system (BSD/Linux).""" self.ssh_ctl_chan._enter_shell() remote_cmd = "/bin/df -k {}".format(self.file_system) remote_output = self.ssh_ctl_chan.send_command( remote_cmd, expect_string...
python
def _remote_space_available_unix(self, search_pattern=""): """Return space available on *nix system (BSD/Linux).""" self.ssh_ctl_chan._enter_shell() remote_cmd = "/bin/df -k {}".format(self.file_system) remote_output = self.ssh_ctl_chan.send_command( remote_cmd, expect_string...
[ "def", "_remote_space_available_unix", "(", "self", ",", "search_pattern", "=", "\"\"", ")", ":", "self", ".", "ssh_ctl_chan", ".", "_enter_shell", "(", ")", "remote_cmd", "=", "\"/bin/df -k {}\"", ".", "format", "(", "self", ".", "file_system", ")", "remote_out...
Return space available on *nix system (BSD/Linux).
[ "Return", "space", "available", "on", "*", "nix", "system", "(", "BSD", "/", "Linux", ")", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L115-L148
train
Return space available on Unix system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.verify_space_available
def verify_space_available(self, search_pattern=r"(\d+) \w+ free"): """Verify sufficient space is available on destination file system (return boolean).""" if self.direction == "put": space_avail = self.remote_space_available(search_pattern=search_pattern) elif self.direction == "get...
python
def verify_space_available(self, search_pattern=r"(\d+) \w+ free"): """Verify sufficient space is available on destination file system (return boolean).""" if self.direction == "put": space_avail = self.remote_space_available(search_pattern=search_pattern) elif self.direction == "get...
[ "def", "verify_space_available", "(", "self", ",", "search_pattern", "=", "r\"(\\d+) \\w+ free\"", ")", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "space_avail", "=", "self", ".", "remote_space_available", "(", "search_pattern", "=", "search_pattern"...
Verify sufficient space is available on destination file system (return boolean).
[ "Verify", "sufficient", "space", "is", "available", "on", "destination", "file", "system", "(", "return", "boolean", ")", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L155-L163
train
Verify sufficient space is available on the destination file system ( return boolean.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer._check_file_exists_unix
def _check_file_exists_unix(self, remote_cmd=""): """Check if the dest_file already exists on the file system (return boolean).""" if self.direction == "put": self.ssh_ctl_chan._enter_shell() remote_cmd = "ls {}".format(self.file_system) remote_out = self.ssh_ctl_chan...
python
def _check_file_exists_unix(self, remote_cmd=""): """Check if the dest_file already exists on the file system (return boolean).""" if self.direction == "put": self.ssh_ctl_chan._enter_shell() remote_cmd = "ls {}".format(self.file_system) remote_out = self.ssh_ctl_chan...
[ "def", "_check_file_exists_unix", "(", "self", ",", "remote_cmd", "=", "\"\"", ")", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "self", ".", "ssh_ctl_chan", ".", "_enter_shell", "(", ")", "remote_cmd", "=", "\"ls {}\"", ".", "format", "(", "...
Check if the dest_file already exists on the file system (return boolean).
[ "Check", "if", "the", "dest_file", "already", "exists", "on", "the", "file", "system", "(", "return", "boolean", ")", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L185-L196
train
Check if the dest_file already exists on the file system ( return boolean.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.remote_file_size
def remote_file_size(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" if remote_file is None: if self.direction == "put": remote_file = self.dest_file elif self.direction == "get": remote_file = self.source_file ...
python
def remote_file_size(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" if remote_file is None: if self.direction == "put": remote_file = self.dest_file elif self.direction == "get": remote_file = self.source_file ...
[ "def", "remote_file_size", "(", "self", ",", "remote_cmd", "=", "\"\"", ",", "remote_file", "=", "None", ")", ":", "if", "remote_file", "is", "None", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "remote_file", "=", "self", ".", "dest_file", ...
Get the file size of the remote file.
[ "Get", "the", "file", "size", "of", "the", "remote", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L198-L222
train
Get the file size of the remote file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer._remote_file_size_unix
def _remote_file_size_unix(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" if remote_file is None: if self.direction == "put": remote_file = self.dest_file elif self.direction == "get": remote_file = self.source_...
python
def _remote_file_size_unix(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" if remote_file is None: if self.direction == "put": remote_file = self.dest_file elif self.direction == "get": remote_file = self.source_...
[ "def", "_remote_file_size_unix", "(", "self", ",", "remote_cmd", "=", "\"\"", ",", "remote_file", "=", "None", ")", ":", "if", "remote_file", "is", "None", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "remote_file", "=", "self", ".", "dest_fi...
Get the file size of the remote file.
[ "Get", "the", "file", "size", "of", "the", "remote", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L224-L253
train
Get the file size of the remote file on Unix system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.file_md5
def file_md5(self, file_name): """Compute MD5 hash of file.""" with open(file_name, "rb") as f: file_contents = f.read() file_hash = hashlib.md5(file_contents).hexdigest() return file_hash
python
def file_md5(self, file_name): """Compute MD5 hash of file.""" with open(file_name, "rb") as f: file_contents = f.read() file_hash = hashlib.md5(file_contents).hexdigest() return file_hash
[ "def", "file_md5", "(", "self", ",", "file_name", ")", ":", "with", "open", "(", "file_name", ",", "\"rb\"", ")", "as", "f", ":", "file_contents", "=", "f", ".", "read", "(", ")", "file_hash", "=", "hashlib", ".", "md5", "(", "file_contents", ")", "....
Compute MD5 hash of file.
[ "Compute", "MD5", "hash", "of", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L255-L260
train
Compute MD5 hash of file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.process_md5
def process_md5(md5_output, pattern=r"=\s+(\S+)"): """ Process the string to retrieve the MD5 hash Output from Cisco IOS (ASA is similar) .MD5 of flash:file_name Done! verify /md5 (flash:file_name) = 410db2a7015eaa42b1fe71f1bf3d59a2 """ match = re.search(pattern,...
python
def process_md5(md5_output, pattern=r"=\s+(\S+)"): """ Process the string to retrieve the MD5 hash Output from Cisco IOS (ASA is similar) .MD5 of flash:file_name Done! verify /md5 (flash:file_name) = 410db2a7015eaa42b1fe71f1bf3d59a2 """ match = re.search(pattern,...
[ "def", "process_md5", "(", "md5_output", ",", "pattern", "=", "r\"=\\s+(\\S+)\"", ")", ":", "match", "=", "re", ".", "search", "(", "pattern", ",", "md5_output", ")", "if", "match", ":", "return", "match", ".", "group", "(", "1", ")", "else", ":", "rai...
Process the string to retrieve the MD5 hash Output from Cisco IOS (ASA is similar) .MD5 of flash:file_name Done! verify /md5 (flash:file_name) = 410db2a7015eaa42b1fe71f1bf3d59a2
[ "Process", "the", "string", "to", "retrieve", "the", "MD5", "hash" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L263-L275
train
Process the output of the MD5 command and return the MD5 hash of the current Cisco IOS entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.compare_md5
def compare_md5(self): """Compare md5 of file on network device to md5 of local file.""" if self.direction == "put": remote_md5 = self.remote_md5() return self.source_md5 == remote_md5 elif self.direction == "get": local_md5 = self.file_md5(self.dest_file) ...
python
def compare_md5(self): """Compare md5 of file on network device to md5 of local file.""" if self.direction == "put": remote_md5 = self.remote_md5() return self.source_md5 == remote_md5 elif self.direction == "get": local_md5 = self.file_md5(self.dest_file) ...
[ "def", "compare_md5", "(", "self", ")", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "remote_md5", "=", "self", ".", "remote_md5", "(", ")", "return", "self", ".", "source_md5", "==", "remote_md5", "elif", "self", ".", "direction", "==", "\...
Compare md5 of file on network device to md5 of local file.
[ "Compare", "md5", "of", "file", "on", "network", "device", "to", "md5", "of", "local", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L277-L284
train
Compare md5 of file on network device to md5 of local file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.transfer_file
def transfer_file(self): """SCP transfer file.""" if self.direction == "put": self.put_file() elif self.direction == "get": self.get_file()
python
def transfer_file(self): """SCP transfer file.""" if self.direction == "put": self.put_file() elif self.direction == "get": self.get_file()
[ "def", "transfer_file", "(", "self", ")", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "self", ".", "put_file", "(", ")", "elif", "self", ".", "direction", "==", "\"get\"", ":", "self", ".", "get_file", "(", ")" ]
SCP transfer file.
[ "SCP", "transfer", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L301-L306
train
SCP transfer file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.put_file
def put_file(self): """SCP copy the file from the local system to the remote device.""" destination = "{}/{}".format(self.file_system, self.dest_file) self.scp_conn.scp_transfer_file(self.source_file, destination) # Must close the SCP connection to get the file written (flush) se...
python
def put_file(self): """SCP copy the file from the local system to the remote device.""" destination = "{}/{}".format(self.file_system, self.dest_file) self.scp_conn.scp_transfer_file(self.source_file, destination) # Must close the SCP connection to get the file written (flush) se...
[ "def", "put_file", "(", "self", ")", ":", "destination", "=", "\"{}/{}\"", ".", "format", "(", "self", ".", "file_system", ",", "self", ".", "dest_file", ")", "self", ".", "scp_conn", ".", "scp_transfer_file", "(", "self", ".", "source_file", ",", "destina...
SCP copy the file from the local system to the remote device.
[ "SCP", "copy", "the", "file", "from", "the", "local", "system", "to", "the", "remote", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L314-L319
train
SCP copy the file from the local system to the remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.enable_scp
def enable_scp(self, cmd=None): """ Enable SCP on remote device. Defaults to Cisco IOS command """ if cmd is None: cmd = ["ip scp server enable"] elif not hasattr(cmd, "__iter__"): cmd = [cmd] self.ssh_ctl_chan.send_config_set(cmd)
python
def enable_scp(self, cmd=None): """ Enable SCP on remote device. Defaults to Cisco IOS command """ if cmd is None: cmd = ["ip scp server enable"] elif not hasattr(cmd, "__iter__"): cmd = [cmd] self.ssh_ctl_chan.send_config_set(cmd)
[ "def", "enable_scp", "(", "self", ",", "cmd", "=", "None", ")", ":", "if", "cmd", "is", "None", ":", "cmd", "=", "[", "\"ip scp server enable\"", "]", "elif", "not", "hasattr", "(", "cmd", ",", "\"__iter__\"", ")", ":", "cmd", "=", "[", "cmd", "]", ...
Enable SCP on remote device. Defaults to Cisco IOS command
[ "Enable", "SCP", "on", "remote", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L325-L335
train
Enable SCP on remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_handler.py
BaseFileTransfer.disable_scp
def disable_scp(self, cmd=None): """ Disable SCP on remote device. Defaults to Cisco IOS command """ if cmd is None: cmd = ["no ip scp server enable"] elif not hasattr(cmd, "__iter__"): cmd = [cmd] self.ssh_ctl_chan.send_config_set(cmd)
python
def disable_scp(self, cmd=None): """ Disable SCP on remote device. Defaults to Cisco IOS command """ if cmd is None: cmd = ["no ip scp server enable"] elif not hasattr(cmd, "__iter__"): cmd = [cmd] self.ssh_ctl_chan.send_config_set(cmd)
[ "def", "disable_scp", "(", "self", ",", "cmd", "=", "None", ")", ":", "if", "cmd", "is", "None", ":", "cmd", "=", "[", "\"no ip scp server enable\"", "]", "elif", "not", "hasattr", "(", "cmd", ",", "\"__iter__\"", ")", ":", "cmd", "=", "[", "cmd", "]...
Disable SCP on remote device. Defaults to Cisco IOS command
[ "Disable", "SCP", "on", "remote", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_handler.py#L337-L347
train
Disable SCP on remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/paloalto/paloalto_panos.py
PaloAltoPanosBase.exit_config_mode
def exit_config_mode(self, exit_config="exit", pattern=r">"): """Exit configuration mode.""" return super(PaloAltoPanosBase, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
python
def exit_config_mode(self, exit_config="exit", pattern=r">"): """Exit configuration mode.""" return super(PaloAltoPanosBase, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
[ "def", "exit_config_mode", "(", "self", ",", "exit_config", "=", "\"exit\"", ",", "pattern", "=", "r\">\"", ")", ":", "return", "super", "(", "PaloAltoPanosBase", ",", "self", ")", ".", "exit_config_mode", "(", "exit_config", "=", "exit_config", ",", "pattern"...
Exit configuration mode.
[ "Exit", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/paloalto/paloalto_panos.py#L51-L55
train
Exit configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/paloalto/paloalto_panos.py
PaloAltoPanosBase.commit
def commit( self, force=False, partial=False, device_and_network=False, policy_and_objects=False, vsys="", no_vsys=False, delay_factor=0.1, ): """ Commit the candidate configuration. Commit the entered configuration. Raise an e...
python
def commit( self, force=False, partial=False, device_and_network=False, policy_and_objects=False, vsys="", no_vsys=False, delay_factor=0.1, ): """ Commit the candidate configuration. Commit the entered configuration. Raise an e...
[ "def", "commit", "(", "self", ",", "force", "=", "False", ",", "partial", "=", "False", ",", "device_and_network", "=", "False", ",", "policy_and_objects", "=", "False", ",", "vsys", "=", "\"\"", ",", "no_vsys", "=", "False", ",", "delay_factor", "=", "0...
Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if the commit fails. Automatically enters configuration mode default: command_string = commit (device_and_network or policy_and_objects or vsys or ...
[ "Commit", "the", "candidate", "configuration", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/paloalto/paloalto_panos.py#L57-L123
train
Commits the current configuration of the candidate.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/paloalto/paloalto_panos.py
PaloAltoPanosBase.strip_command
def strip_command(self, command_string, output): """Strip command_string from output string.""" output_list = output.split(command_string) return self.RESPONSE_RETURN.join(output_list)
python
def strip_command(self, command_string, output): """Strip command_string from output string.""" output_list = output.split(command_string) return self.RESPONSE_RETURN.join(output_list)
[ "def", "strip_command", "(", "self", ",", "command_string", ",", "output", ")", ":", "output_list", "=", "output", ".", "split", "(", "command_string", ")", "return", "self", ".", "RESPONSE_RETURN", ".", "join", "(", "output_list", ")" ]
Strip command_string from output string.
[ "Strip", "command_string", "from", "output", "string", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/paloalto/paloalto_panos.py#L125-L128
train
Strip command_string from output string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/paloalto/paloalto_panos.py
PaloAltoPanosBase.strip_prompt
def strip_prompt(self, a_string): """Strip the trailing router prompt from the output.""" response_list = a_string.split(self.RESPONSE_RETURN) new_response_list = [] for line in response_list: if self.base_prompt not in line: new_response_list.append(line) ...
python
def strip_prompt(self, a_string): """Strip the trailing router prompt from the output.""" response_list = a_string.split(self.RESPONSE_RETURN) new_response_list = [] for line in response_list: if self.base_prompt not in line: new_response_list.append(line) ...
[ "def", "strip_prompt", "(", "self", ",", "a_string", ")", ":", "response_list", "=", "a_string", ".", "split", "(", "self", ".", "RESPONSE_RETURN", ")", "new_response_list", "=", "[", "]", "for", "line", "in", "response_list", ":", "if", "self", ".", "base...
Strip the trailing router prompt from the output.
[ "Strip", "the", "trailing", "router", "prompt", "from", "the", "output", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/paloalto/paloalto_panos.py#L130-L139
train
Strip the trailing router prompt from the output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/paloalto/paloalto_panos.py
PaloAltoPanosBase.strip_context_items
def strip_context_items(self, a_string): """Strip PaloAlto-specific output. PaloAlto will also put a configuration context: [edit] This method removes those lines. """ strings_to_strip = [r"\[edit.*\]"] response_list = a_string.split(self.RESPONSE_RETURN) ...
python
def strip_context_items(self, a_string): """Strip PaloAlto-specific output. PaloAlto will also put a configuration context: [edit] This method removes those lines. """ strings_to_strip = [r"\[edit.*\]"] response_list = a_string.split(self.RESPONSE_RETURN) ...
[ "def", "strip_context_items", "(", "self", ",", "a_string", ")", ":", "strings_to_strip", "=", "[", "r\"\\[edit.*\\]\"", "]", "response_list", "=", "a_string", ".", "split", "(", "self", ".", "RESPONSE_RETURN", ")", "last_line", "=", "response_list", "[", "-", ...
Strip PaloAlto-specific output. PaloAlto will also put a configuration context: [edit] This method removes those lines.
[ "Strip", "PaloAlto", "-", "specific", "output", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/paloalto/paloalto_panos.py#L141-L158
train
Strip PaloAlto - specific output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/paloalto/paloalto_panos.py
PaloAltoPanosBase.send_command
def send_command(self, *args, **kwargs): """Palo Alto requires an extra delay""" kwargs["delay_factor"] = kwargs.get("delay_factor", 2.5) return super(PaloAltoPanosBase, self).send_command(*args, **kwargs)
python
def send_command(self, *args, **kwargs): """Palo Alto requires an extra delay""" kwargs["delay_factor"] = kwargs.get("delay_factor", 2.5) return super(PaloAltoPanosBase, self).send_command(*args, **kwargs)
[ "def", "send_command", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "\"delay_factor\"", "]", "=", "kwargs", ".", "get", "(", "\"delay_factor\"", ",", "2.5", ")", "return", "super", "(", "PaloAltoPanosBase", ",", "self"...
Palo Alto requires an extra delay
[ "Palo", "Alto", "requires", "an", "extra", "delay" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/paloalto/paloalto_panos.py#L164-L167
train
Send a command to Palo Alto.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/paloalto/paloalto_panos.py
PaloAltoPanosBase.cleanup
def cleanup(self): """Gracefully exit the SSH session.""" try: self.exit_config_mode() except Exception: # Always try to send 'exit' regardless of whether exit_config_mode works or not. pass self._session_log_fin = True self.write_channel("exit...
python
def cleanup(self): """Gracefully exit the SSH session.""" try: self.exit_config_mode() except Exception: # Always try to send 'exit' regardless of whether exit_config_mode works or not. pass self._session_log_fin = True self.write_channel("exit...
[ "def", "cleanup", "(", "self", ")", ":", "try", ":", "self", ".", "exit_config_mode", "(", ")", "except", "Exception", ":", "# Always try to send 'exit' regardless of whether exit_config_mode works or not.", "pass", "self", ".", "_session_log_fin", "=", "True", "self", ...
Gracefully exit the SSH session.
[ "Gracefully", "exit", "the", "SSH", "session", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/paloalto/paloalto_panos.py#L169-L177
train
Gracefully exit the SSH session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/coriant/coriant_ssh.py
CoriantSSH.set_base_prompt
def set_base_prompt( self, pri_prompt_terminator=":", alt_prompt_terminator=">", delay_factor=2 ): """Sets self.base_prompt: used as delimiter for stripping of trailing prompt in output.""" super(CoriantSSH, self).set_base_prompt( pri_prompt_terminator=pri_prompt_terminator, ...
python
def set_base_prompt( self, pri_prompt_terminator=":", alt_prompt_terminator=">", delay_factor=2 ): """Sets self.base_prompt: used as delimiter for stripping of trailing prompt in output.""" super(CoriantSSH, self).set_base_prompt( pri_prompt_terminator=pri_prompt_terminator, ...
[ "def", "set_base_prompt", "(", "self", ",", "pri_prompt_terminator", "=", "\":\"", ",", "alt_prompt_terminator", "=", "\">\"", ",", "delay_factor", "=", "2", ")", ":", "super", "(", "CoriantSSH", ",", "self", ")", ".", "set_base_prompt", "(", "pri_prompt_termina...
Sets self.base_prompt: used as delimiter for stripping of trailing prompt in output.
[ "Sets", "self", ".", "base_prompt", ":", "used", "as", "delimiter", "for", "stripping", "of", "trailing", "prompt", "in", "output", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/coriant/coriant_ssh.py#L31-L40
train
Sets self. base_prompt to used as delimiter for stripping of trailing prompt in output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_ios.py
CiscoIosBase.check_config_mode
def check_config_mode(self, check_string=")#", pattern="#"): """ Checks if the device is in configuration mode or not. Cisco IOS devices abbreviate the prompt at 20 chars in config mode """ return super(CiscoIosBase, self).check_config_mode( check_string=check_string...
python
def check_config_mode(self, check_string=")#", pattern="#"): """ Checks if the device is in configuration mode or not. Cisco IOS devices abbreviate the prompt at 20 chars in config mode """ return super(CiscoIosBase, self).check_config_mode( check_string=check_string...
[ "def", "check_config_mode", "(", "self", ",", "check_string", "=", "\")#\"", ",", "pattern", "=", "\"#\"", ")", ":", "return", "super", "(", "CiscoIosBase", ",", "self", ")", ".", "check_config_mode", "(", "check_string", "=", "check_string", ",", "pattern", ...
Checks if the device is in configuration mode or not. Cisco IOS devices abbreviate the prompt at 20 chars in config mode
[ "Checks", "if", "the", "device", "is", "in", "configuration", "mode", "or", "not", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_ios.py#L25-L33
train
Checks if the device is in configuration mode or not.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_ios.py
CiscoIosBase.save_config
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Saves Config Using Copy Run Start""" return super(CiscoIosBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Saves Config Using Copy Run Start""" return super(CiscoIosBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write mem\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "CiscoIosBase", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ",", ...
Saves Config Using Copy Run Start
[ "Saves", "Config", "Using", "Copy", "Run", "Start" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_ios.py#L35-L39
train
Saves Config Using Copy Run Start
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_ios.py
InLineTransfer._tcl_newline_rationalize
def _tcl_newline_rationalize(tcl_string): """ When using put inside a TCL {} section the newline is considered a new TCL statement and causes a missing curly-brace message. Convert "\n" to "\r". TCL will convert the "\r" to a "\n" i.e. you will see a "\n" inside the file on the C...
python
def _tcl_newline_rationalize(tcl_string): """ When using put inside a TCL {} section the newline is considered a new TCL statement and causes a missing curly-brace message. Convert "\n" to "\r". TCL will convert the "\r" to a "\n" i.e. you will see a "\n" inside the file on the C...
[ "def", "_tcl_newline_rationalize", "(", "tcl_string", ")", ":", "NEWLINE", "=", "r\"\\n\"", "CARRIAGE_RETURN", "=", "r\"\\r\"", "tmp_string", "=", "re", ".", "sub", "(", "NEWLINE", ",", "CARRIAGE_RETURN", ",", "tcl_string", ")", "if", "re", ".", "search", "(",...
When using put inside a TCL {} section the newline is considered a new TCL statement and causes a missing curly-brace message. Convert "\n" to "\r". TCL will convert the "\r" to a "\n" i.e. you will see a "\n" inside the file on the Cisco IOS device.
[ "When", "using", "put", "inside", "a", "TCL", "{}", "section", "the", "newline", "is", "considered", "a", "new", "TCL", "statement", "and", "causes", "a", "missing", "curly", "-", "brace", "message", ".", "Convert", "\\", "n", "to", "\\", "r", ".", "TC...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_ios.py#L109-L122
train
Convert a TCL newline to a new TCL entry statement.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_ios.py
InLineTransfer.file_md5
def file_md5(self, file_name): """Compute MD5 hash of file.""" file_contents = self._read_file(file_name) file_contents = file_contents + "\n" # Cisco IOS automatically adds this file_contents = file_contents.encode("UTF-8") return hashlib.md5(file_contents).hexdigest()
python
def file_md5(self, file_name): """Compute MD5 hash of file.""" file_contents = self._read_file(file_name) file_contents = file_contents + "\n" # Cisco IOS automatically adds this file_contents = file_contents.encode("UTF-8") return hashlib.md5(file_contents).hexdigest()
[ "def", "file_md5", "(", "self", ",", "file_name", ")", ":", "file_contents", "=", "self", ".", "_read_file", "(", "file_name", ")", "file_contents", "=", "file_contents", "+", "\"\\n\"", "# Cisco IOS automatically adds this", "file_contents", "=", "file_contents", "...
Compute MD5 hash of file.
[ "Compute", "MD5", "hash", "of", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_ios.py#L167-L172
train
Compute MD5 hash of file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_ios.py
InLineTransfer.config_md5
def config_md5(self, source_config): """Compute MD5 hash of file.""" file_contents = source_config + "\n" # Cisco IOS automatically adds this file_contents = file_contents.encode("UTF-8") return hashlib.md5(file_contents).hexdigest()
python
def config_md5(self, source_config): """Compute MD5 hash of file.""" file_contents = source_config + "\n" # Cisco IOS automatically adds this file_contents = file_contents.encode("UTF-8") return hashlib.md5(file_contents).hexdigest()
[ "def", "config_md5", "(", "self", ",", "source_config", ")", ":", "file_contents", "=", "source_config", "+", "\"\\n\"", "# Cisco IOS automatically adds this", "file_contents", "=", "file_contents", ".", "encode", "(", "\"UTF-8\"", ")", "return", "hashlib", ".", "md...
Compute MD5 hash of file.
[ "Compute", "MD5", "hash", "of", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_ios.py#L174-L178
train
Compute MD5 hash of file contents.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_comware.py
HPComwareBase.session_preparation
def session_preparation(self): """ Prepare the session after the connection has been established. Extra time to read HP banners. """ delay_factor = self.select_delay_factor(delay_factor=0) i = 1 while i <= 4: # Comware can have a banner that prompts yo...
python
def session_preparation(self): """ Prepare the session after the connection has been established. Extra time to read HP banners. """ delay_factor = self.select_delay_factor(delay_factor=0) i = 1 while i <= 4: # Comware can have a banner that prompts yo...
[ "def", "session_preparation", "(", "self", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", "=", "0", ")", "i", "=", "1", "while", "i", "<=", "4", ":", "# Comware can have a banner that prompts you to continue", "# 'Press Y or ...
Prepare the session after the connection has been established. Extra time to read HP banners.
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", ".", "Extra", "time", "to", "read", "HP", "banners", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_comware.py#L8-L30
train
Prepare the session after the connection has been established.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_comware.py
HPComwareBase.exit_config_mode
def exit_config_mode(self, exit_config="return", pattern=r">"): """Exit config mode.""" return super(HPComwareBase, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
python
def exit_config_mode(self, exit_config="return", pattern=r">"): """Exit config mode.""" return super(HPComwareBase, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
[ "def", "exit_config_mode", "(", "self", ",", "exit_config", "=", "\"return\"", ",", "pattern", "=", "r\">\"", ")", ":", "return", "super", "(", "HPComwareBase", ",", "self", ")", ".", "exit_config_mode", "(", "exit_config", "=", "exit_config", ",", "pattern", ...
Exit config mode.
[ "Exit", "config", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_comware.py#L36-L40
train
Exit config mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_comware.py
HPComwareBase.set_base_prompt
def set_base_prompt( self, pri_prompt_terminator=">", alt_prompt_terminator="]", delay_factor=1 ): """ Sets self.base_prompt Used as delimiter for stripping of trailing prompt in output. Should be set to something that is general and applies in multiple contexts. For Comwar...
python
def set_base_prompt( self, pri_prompt_terminator=">", alt_prompt_terminator="]", delay_factor=1 ): """ Sets self.base_prompt Used as delimiter for stripping of trailing prompt in output. Should be set to something that is general and applies in multiple contexts. For Comwar...
[ "def", "set_base_prompt", "(", "self", ",", "pri_prompt_terminator", "=", "\">\"", ",", "alt_prompt_terminator", "=", "\"]\"", ",", "delay_factor", "=", "1", ")", ":", "prompt", "=", "super", "(", "HPComwareBase", ",", "self", ")", ".", "set_base_prompt", "(",...
Sets self.base_prompt Used as delimiter for stripping of trailing prompt in output. Should be set to something that is general and applies in multiple contexts. For Comware this will be the router prompt with < > or [ ] stripped off. This will be set on logging in, but not when enteri...
[ "Sets", "self", ".", "base_prompt" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_comware.py#L46-L69
train
Sets self. base_prompt to the prompt that will be used for the router prompt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_comware.py
HPComwareBase.save_config
def save_config(self, cmd="save force", confirm=False, confirm_response=""): """Save Config.""" return super(HPComwareBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="save force", confirm=False, confirm_response=""): """Save Config.""" return super(HPComwareBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"save force\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "HPComwareBase", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ","...
Save Config.
[ "Save", "Config", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_comware.py#L83-L87
train
Save config.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/snmp_autodetect.py
SNMPDetect._get_snmpv3
def _get_snmpv3(self, oid): """ Try to send an SNMP GET operation using SNMPv3 for the specified OID. Parameters ---------- oid : str The SNMP OID that you want to get. Returns ------- string : str The string as part of the value ...
python
def _get_snmpv3(self, oid): """ Try to send an SNMP GET operation using SNMPv3 for the specified OID. Parameters ---------- oid : str The SNMP OID that you want to get. Returns ------- string : str The string as part of the value ...
[ "def", "_get_snmpv3", "(", "self", ",", "oid", ")", ":", "snmp_target", "=", "(", "self", ".", "hostname", ",", "self", ".", "snmp_port", ")", "cmd_gen", "=", "cmdgen", ".", "CommandGenerator", "(", ")", "(", "error_detected", ",", "error_status", ",", "...
Try to send an SNMP GET operation using SNMPv3 for the specified OID. Parameters ---------- oid : str The SNMP OID that you want to get. Returns ------- string : str The string as part of the value from the OID you are trying to retrieve.
[ "Try", "to", "send", "an", "SNMP", "GET", "operation", "using", "SNMPv3", "for", "the", "specified", "OID", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/snmp_autodetect.py#L233-L266
train
Send a SNMP GET operation using SNMPv3.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/snmp_autodetect.py
SNMPDetect._get_snmpv2c
def _get_snmpv2c(self, oid): """ Try to send an SNMP GET operation using SNMPv2 for the specified OID. Parameters ---------- oid : str The SNMP OID that you want to get. Returns ------- string : str The string as part of the value...
python
def _get_snmpv2c(self, oid): """ Try to send an SNMP GET operation using SNMPv2 for the specified OID. Parameters ---------- oid : str The SNMP OID that you want to get. Returns ------- string : str The string as part of the value...
[ "def", "_get_snmpv2c", "(", "self", ",", "oid", ")", ":", "snmp_target", "=", "(", "self", ".", "hostname", ",", "self", ".", "snmp_port", ")", "cmd_gen", "=", "cmdgen", ".", "CommandGenerator", "(", ")", "(", "error_detected", ",", "error_status", ",", ...
Try to send an SNMP GET operation using SNMPv2 for the specified OID. Parameters ---------- oid : str The SNMP OID that you want to get. Returns ------- string : str The string as part of the value from the OID you are trying to retrieve.
[ "Try", "to", "send", "an", "SNMP", "GET", "operation", "using", "SNMPv2", "for", "the", "specified", "OID", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/snmp_autodetect.py#L268-L295
train
Send a SNMP GET operation using SNMPv2 to get the value of the specified OID.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/snmp_autodetect.py
SNMPDetect._get_snmp
def _get_snmp(self, oid): """Wrapper for generic SNMP call.""" if self.snmp_version in ["v1", "v2c"]: return self._get_snmpv2c(oid) else: return self._get_snmpv3(oid)
python
def _get_snmp(self, oid): """Wrapper for generic SNMP call.""" if self.snmp_version in ["v1", "v2c"]: return self._get_snmpv2c(oid) else: return self._get_snmpv3(oid)
[ "def", "_get_snmp", "(", "self", ",", "oid", ")", ":", "if", "self", ".", "snmp_version", "in", "[", "\"v1\"", ",", "\"v2c\"", "]", ":", "return", "self", ".", "_get_snmpv2c", "(", "oid", ")", "else", ":", "return", "self", ".", "_get_snmpv3", "(", "...
Wrapper for generic SNMP call.
[ "Wrapper", "for", "generic", "SNMP", "call", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/snmp_autodetect.py#L297-L302
train
Wrapper for generic SNMP call.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/snmp_autodetect.py
SNMPDetect.autodetect
def autodetect(self): """ Try to guess the device_type using SNMP GET based on the SNMP_MAPPER dict. The type which is returned is directly matching the name in *netmiko.ssh_dispatcher.CLASS_MAPPER_BASE* dict. Thus you can use this name to retrieve automatically the right Connec...
python
def autodetect(self): """ Try to guess the device_type using SNMP GET based on the SNMP_MAPPER dict. The type which is returned is directly matching the name in *netmiko.ssh_dispatcher.CLASS_MAPPER_BASE* dict. Thus you can use this name to retrieve automatically the right Connec...
[ "def", "autodetect", "(", "self", ")", ":", "# Convert SNMP_MAPPER to a list and sort by priority", "snmp_mapper_list", "=", "[", "]", "for", "k", ",", "v", "in", "SNMP_MAPPER", ".", "items", "(", ")", ":", "snmp_mapper_list", ".", "append", "(", "{", "k", ":"...
Try to guess the device_type using SNMP GET based on the SNMP_MAPPER dict. The type which is returned is directly matching the name in *netmiko.ssh_dispatcher.CLASS_MAPPER_BASE* dict. Thus you can use this name to retrieve automatically the right ConnectionClass Returns -------...
[ "Try", "to", "guess", "the", "device_type", "using", "SNMP", "GET", "based", "on", "the", "SNMP_MAPPER", "dict", ".", "The", "type", "which", "is", "returned", "is", "directly", "matching", "the", "name", "in", "*", "netmiko", ".", "ssh_dispatcher", ".", "...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/snmp_autodetect.py#L304-L342
train
Try to guess the device type using SNMP GET based on the ConnectionClass dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/flexvnf/flexvnf_ssh.py
FlexvnfSSH.enter_cli_mode
def enter_cli_mode(self): """Check if at shell prompt root@ and go into CLI.""" delay_factor = self.select_delay_factor(delay_factor=0) count = 0 cur_prompt = "" while count < 50: self.write_channel(self.RETURN) time.sleep(0.1 * delay_factor) c...
python
def enter_cli_mode(self): """Check if at shell prompt root@ and go into CLI.""" delay_factor = self.select_delay_factor(delay_factor=0) count = 0 cur_prompt = "" while count < 50: self.write_channel(self.RETURN) time.sleep(0.1 * delay_factor) c...
[ "def", "enter_cli_mode", "(", "self", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", "=", "0", ")", "count", "=", "0", "cur_prompt", "=", "\"\"", "while", "count", "<", "50", ":", "self", ".", "write_channel", "(", ...
Check if at shell prompt root@ and go into CLI.
[ "Check", "if", "at", "shell", "prompt", "root" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/flexvnf/flexvnf_ssh.py#L26-L44
train
Check if at shell prompt root@ and go into CLI.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/flexvnf/flexvnf_ssh.py
FlexvnfSSH.exit_config_mode
def exit_config_mode(self, exit_config="exit configuration-mode"): """Exit configuration mode.""" output = "" if self.check_config_mode(): output = self.send_command_timing( exit_config, strip_prompt=False, strip_command=False ) # if 'Exit with...
python
def exit_config_mode(self, exit_config="exit configuration-mode"): """Exit configuration mode.""" output = "" if self.check_config_mode(): output = self.send_command_timing( exit_config, strip_prompt=False, strip_command=False ) # if 'Exit with...
[ "def", "exit_config_mode", "(", "self", ",", "exit_config", "=", "\"exit configuration-mode\"", ")", ":", "output", "=", "\"\"", "if", "self", ".", "check_config_mode", "(", ")", ":", "output", "=", "self", ".", "send_command_timing", "(", "exit_config", ",", ...
Exit configuration mode.
[ "Exit", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/flexvnf/flexvnf_ssh.py#L66-L80
train
Exit configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/flexvnf/flexvnf_ssh.py
FlexvnfSSH.commit
def commit( self, confirm=False, confirm_delay=None, check=False, comment="", and_quit=False, delay_factor=1, ): """ Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if...
python
def commit( self, confirm=False, confirm_delay=None, check=False, comment="", and_quit=False, delay_factor=1, ): """ Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if...
[ "def", "commit", "(", "self", ",", "confirm", "=", "False", ",", "confirm_delay", "=", "None", ",", "check", "=", "False", ",", "comment", "=", "\"\"", ",", "and_quit", "=", "False", ",", "delay_factor", "=", "1", ",", ")", ":", "delay_factor", "=", ...
Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if the commit fails. Automatically enters configuration mode default: command_string = commit check and (confirm or confirm_dely or comment): Exc...
[ "Commit", "the", "candidate", "configuration", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/flexvnf/flexvnf_ssh.py#L82-L171
train
Commit the candidate configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/flexvnf/flexvnf_ssh.py
FlexvnfSSH.strip_prompt
def strip_prompt(self, *args, **kwargs): """Strip the trailing router prompt from the output.""" a_string = super(FlexvnfSSH, self).strip_prompt(*args, **kwargs) return self.strip_context_items(a_string)
python
def strip_prompt(self, *args, **kwargs): """Strip the trailing router prompt from the output.""" a_string = super(FlexvnfSSH, self).strip_prompt(*args, **kwargs) return self.strip_context_items(a_string)
[ "def", "strip_prompt", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "a_string", "=", "super", "(", "FlexvnfSSH", ",", "self", ")", ".", "strip_prompt", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "str...
Strip the trailing router prompt from the output.
[ "Strip", "the", "trailing", "router", "prompt", "from", "the", "output", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/flexvnf/flexvnf_ssh.py#L173-L176
train
Strip the trailing router prompt from the output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ruckus/ruckus_fastiron.py
RuckusFastironBase.enable
def enable( self, cmd="enable", pattern=r"(ssword|User Name)", re_flags=re.IGNORECASE ): """Enter enable mode. With RADIUS can prompt for User Name SSH@Lab-ICX7250>en User Name:service_netmiko Password: SSH@Lab-ICX7250# """ output = "" ...
python
def enable( self, cmd="enable", pattern=r"(ssword|User Name)", re_flags=re.IGNORECASE ): """Enter enable mode. With RADIUS can prompt for User Name SSH@Lab-ICX7250>en User Name:service_netmiko Password: SSH@Lab-ICX7250# """ output = "" ...
[ "def", "enable", "(", "self", ",", "cmd", "=", "\"enable\"", ",", "pattern", "=", "r\"(ssword|User Name)\"", ",", "re_flags", "=", "re", ".", "IGNORECASE", ")", ":", "output", "=", "\"\"", "if", "not", "self", ".", "check_enable_mode", "(", ")", ":", "co...
Enter enable mode. With RADIUS can prompt for User Name SSH@Lab-ICX7250>en User Name:service_netmiko Password: SSH@Lab-ICX7250#
[ "Enter", "enable", "mode", ".", "With", "RADIUS", "can", "prompt", "for", "User", "Name", "SSH" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ruckus/ruckus_fastiron.py#L21-L59
train
Enter enable mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ruckus/ruckus_fastiron.py
RuckusFastironBase.save_config
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Saves configuration.""" return super(RuckusFastironBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Saves configuration.""" return super(RuckusFastironBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write mem\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "RuckusFastironBase", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ...
Saves configuration.
[ "Saves", "configuration", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ruckus/ruckus_fastiron.py#L61-L65
train
Saves configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ruckus/ruckus_fastiron.py
RuckusFastironTelnet._process_option
def _process_option(self, tsocket, command, option): """ Ruckus FastIron/ICX does not always echo commands to output by default. If server expresses interest in 'ECHO' option, then reply back with 'DO ECHO' """ if option == ECHO: tsocket.sendall(IAC + DO + ECH...
python
def _process_option(self, tsocket, command, option): """ Ruckus FastIron/ICX does not always echo commands to output by default. If server expresses interest in 'ECHO' option, then reply back with 'DO ECHO' """ if option == ECHO: tsocket.sendall(IAC + DO + ECH...
[ "def", "_process_option", "(", "self", ",", "tsocket", ",", "command", ",", "option", ")", ":", "if", "option", "==", "ECHO", ":", "tsocket", ".", "sendall", "(", "IAC", "+", "DO", "+", "ECHO", ")", "elif", "command", "in", "(", "DO", ",", "DONT", ...
Ruckus FastIron/ICX does not always echo commands to output by default. If server expresses interest in 'ECHO' option, then reply back with 'DO ECHO'
[ "Ruckus", "FastIron", "/", "ICX", "does", "not", "always", "echo", "commands", "to", "output", "by", "default", ".", "If", "server", "expresses", "interest", "in", "ECHO", "option", "then", "reply", "back", "with", "DO", "ECHO" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ruckus/ruckus_fastiron.py#L74-L85
train
Process the option from the server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
examples/use_cases/case16_concurrency/processes_netmiko_queue.py
show_version_queue
def show_version_queue(a_device, output_q): """ Use Netmiko to execute show version. Use a queue to pass the data back to the main process. """ output_dict = {} remote_conn = ConnectHandler(**a_device) hostname = remote_conn.base_prompt output = ("#" * 80) + "\n" output += remote_con...
python
def show_version_queue(a_device, output_q): """ Use Netmiko to execute show version. Use a queue to pass the data back to the main process. """ output_dict = {} remote_conn = ConnectHandler(**a_device) hostname = remote_conn.base_prompt output = ("#" * 80) + "\n" output += remote_con...
[ "def", "show_version_queue", "(", "a_device", ",", "output_q", ")", ":", "output_dict", "=", "{", "}", "remote_conn", "=", "ConnectHandler", "(", "*", "*", "a_device", ")", "hostname", "=", "remote_conn", ".", "base_prompt", "output", "=", "(", "\"#\"", "*",...
Use Netmiko to execute show version. Use a queue to pass the data back to the main process.
[ "Use", "Netmiko", "to", "execute", "show", "version", ".", "Use", "a", "queue", "to", "pass", "the", "data", "back", "to", "the", "main", "process", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/examples/use_cases/case16_concurrency/processes_netmiko_queue.py#L15-L27
train
Use Netmiko to execute show version.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
examples/use_cases/case16_concurrency/processes_netmiko_queue.py
main
def main(): """ Use processes and Netmiko to connect to each of the devices. Execute 'show version' on each device. Use a queue to pass the output back to the parent process. Record the amount of time required to do this. """ start_time = datetime.now() output_q = Queue(maxsize=20) proc...
python
def main(): """ Use processes and Netmiko to connect to each of the devices. Execute 'show version' on each device. Use a queue to pass the output back to the parent process. Record the amount of time required to do this. """ start_time = datetime.now() output_q = Queue(maxsize=20) proc...
[ "def", "main", "(", ")", ":", "start_time", "=", "datetime", ".", "now", "(", ")", "output_q", "=", "Queue", "(", "maxsize", "=", "20", ")", "procs", "=", "[", "]", "for", "a_device", "in", "devices", ":", "my_proc", "=", "Process", "(", "target", ...
Use processes and Netmiko to connect to each of the devices. Execute 'show version' on each device. Use a queue to pass the output back to the parent process. Record the amount of time required to do this.
[ "Use", "processes", "and", "Netmiko", "to", "connect", "to", "each", "of", "the", "devices", ".", "Execute", "show", "version", "on", "each", "device", ".", "Use", "a", "queue", "to", "pass", "the", "output", "back", "to", "the", "parent", "process", "."...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/examples/use_cases/case16_concurrency/processes_netmiko_queue.py#L30-L55
train
Execute show version on each of the devices.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_asa_ssh.py
CiscoAsaSSH.session_preparation
def session_preparation(self): """Prepare the session after the connection has been established.""" self._test_channel_read() self.set_base_prompt() if self.secret: self.enable() else: self.asa_login() self.disable_paging(command="terminal pager 0"...
python
def session_preparation(self): """Prepare the session after the connection has been established.""" self._test_channel_read() self.set_base_prompt() if self.secret: self.enable() else: self.asa_login() self.disable_paging(command="terminal pager 0"...
[ "def", "session_preparation", "(", "self", ")", ":", "self", ".", "_test_channel_read", "(", ")", "self", ".", "set_base_prompt", "(", ")", "if", "self", ".", "secret", ":", "self", ".", "enable", "(", ")", "else", ":", "self", ".", "asa_login", "(", "...
Prepare the session after the connection has been established.
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_asa_ssh.py#L12-L30
train
Prepare the session after the connection has been established.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_asa_ssh.py
CiscoAsaSSH.send_command_timing
def send_command_timing(self, *args, **kwargs): """ If the ASA is in multi-context mode, then the base_prompt needs to be updated after each context change. """ output = super(CiscoAsaSSH, self).send_command_timing(*args, **kwargs) if len(args) >= 1: command_s...
python
def send_command_timing(self, *args, **kwargs): """ If the ASA is in multi-context mode, then the base_prompt needs to be updated after each context change. """ output = super(CiscoAsaSSH, self).send_command_timing(*args, **kwargs) if len(args) >= 1: command_s...
[ "def", "send_command_timing", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "output", "=", "super", "(", "CiscoAsaSSH", ",", "self", ")", ".", "send_command_timing", "(", "*", "args", ",", "*", "*", "kwargs", ")", "if", "len", "("...
If the ASA is in multi-context mode, then the base_prompt needs to be updated after each context change.
[ "If", "the", "ASA", "is", "in", "multi", "-", "context", "mode", "then", "the", "base_prompt", "needs", "to", "be", "updated", "after", "each", "context", "change", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_asa_ssh.py#L32-L44
train
Send a command to the ASA.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_asa_ssh.py
CiscoAsaSSH.send_command
def send_command(self, *args, **kwargs): """ If the ASA is in multi-context mode, then the base_prompt needs to be updated after each context change. """ if len(args) >= 1: command_string = args[0] else: command_string = kwargs["command_string"] ...
python
def send_command(self, *args, **kwargs): """ If the ASA is in multi-context mode, then the base_prompt needs to be updated after each context change. """ if len(args) >= 1: command_string = args[0] else: command_string = kwargs["command_string"] ...
[ "def", "send_command", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "args", ")", ">=", "1", ":", "command_string", "=", "args", "[", "0", "]", "else", ":", "command_string", "=", "kwargs", "[", "\"command_string...
If the ASA is in multi-context mode, then the base_prompt needs to be updated after each context change.
[ "If", "the", "ASA", "is", "in", "multi", "-", "context", "mode", "then", "the", "base_prompt", "needs", "to", "be", "updated", "after", "each", "context", "change", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_asa_ssh.py#L46-L66
train
Send a command to the ASA server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_asa_ssh.py
CiscoAsaSSH.set_base_prompt
def set_base_prompt(self, *args, **kwargs): """ Cisco ASA in multi-context mode needs to have the base prompt updated (if you switch contexts i.e. 'changeto') This switch of ASA contexts can occur in configuration mode. If this happens the trailing '(config*' needs stripped off....
python
def set_base_prompt(self, *args, **kwargs): """ Cisco ASA in multi-context mode needs to have the base prompt updated (if you switch contexts i.e. 'changeto') This switch of ASA contexts can occur in configuration mode. If this happens the trailing '(config*' needs stripped off....
[ "def", "set_base_prompt", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "cur_base_prompt", "=", "super", "(", "CiscoAsaSSH", ",", "self", ")", ".", "set_base_prompt", "(", "*", "args", ",", "*", "*", "kwargs", ")", "match", "=", "...
Cisco ASA in multi-context mode needs to have the base prompt updated (if you switch contexts i.e. 'changeto') This switch of ASA contexts can occur in configuration mode. If this happens the trailing '(config*' needs stripped off.
[ "Cisco", "ASA", "in", "multi", "-", "context", "mode", "needs", "to", "have", "the", "base", "prompt", "updated", "(", "if", "you", "switch", "contexts", "i", ".", "e", ".", "changeto", ")" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_asa_ssh.py#L72-L85
train
Set the base prompt for the current ASA context.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_asa_ssh.py
CiscoAsaSSH.asa_login
def asa_login(self): """ Handle ASA reaching privilege level 15 using login twb-dc-fw1> login Username: admin Password: ************ """ delay_factor = self.select_delay_factor(0) i = 1 max_attempts = 50 self.write_channel("login" + self....
python
def asa_login(self): """ Handle ASA reaching privilege level 15 using login twb-dc-fw1> login Username: admin Password: ************ """ delay_factor = self.select_delay_factor(0) i = 1 max_attempts = 50 self.write_channel("login" + self....
[ "def", "asa_login", "(", "self", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "0", ")", "i", "=", "1", "max_attempts", "=", "50", "self", ".", "write_channel", "(", "\"login\"", "+", "self", ".", "RETURN", ")", "while", "i", ...
Handle ASA reaching privilege level 15 using login twb-dc-fw1> login Username: admin Password: ************
[ "Handle", "ASA", "reaching", "privilege", "level", "15", "using", "login" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_asa_ssh.py#L87-L111
train
Handle ASA reaching privilege level 15 using login
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_asa_ssh.py
CiscoAsaSSH.save_config
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Saves Config""" return super(CiscoAsaSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Saves Config""" return super(CiscoAsaSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write mem\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "CiscoAsaSSH", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ",", ...
Saves Config
[ "Saves", "Config" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_asa_ssh.py#L113-L117
train
Saves Config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_xr_ssh.py
CiscoXrSSH.send_config_set
def send_config_set(self, config_commands=None, exit_config_mode=True, **kwargs): """IOS-XR requires you not exit from configuration mode.""" return super(CiscoXrSSH, self).send_config_set( config_commands=config_commands, exit_config_mode=False, **kwargs )
python
def send_config_set(self, config_commands=None, exit_config_mode=True, **kwargs): """IOS-XR requires you not exit from configuration mode.""" return super(CiscoXrSSH, self).send_config_set( config_commands=config_commands, exit_config_mode=False, **kwargs )
[ "def", "send_config_set", "(", "self", ",", "config_commands", "=", "None", ",", "exit_config_mode", "=", "True", ",", "*", "*", "kwargs", ")", ":", "return", "super", "(", "CiscoXrSSH", ",", "self", ")", ".", "send_config_set", "(", "config_commands", "=", ...
IOS-XR requires you not exit from configuration mode.
[ "IOS", "-", "XR", "requires", "you", "not", "exit", "from", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_xr_ssh.py#L20-L24
train
Send config commands to the device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_xr_ssh.py
CiscoXrSSH.commit
def commit( self, confirm=False, confirm_delay=None, comment="", label="", delay_factor=1 ): """ Commit the candidate configuration. default (no options): command_string = commit confirm and confirm_delay: command_string = commit confirmed <confirm_de...
python
def commit( self, confirm=False, confirm_delay=None, comment="", label="", delay_factor=1 ): """ Commit the candidate configuration. default (no options): command_string = commit confirm and confirm_delay: command_string = commit confirmed <confirm_de...
[ "def", "commit", "(", "self", ",", "confirm", "=", "False", ",", "confirm_delay", "=", "None", ",", "comment", "=", "\"\"", ",", "label", "=", "\"\"", ",", "delay_factor", "=", "1", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", ...
Commit the candidate configuration. default (no options): command_string = commit confirm and confirm_delay: command_string = commit confirmed <confirm_delay> label (which is a label name): command_string = commit label <label> comment: co...
[ "Commit", "the", "candidate", "configuration", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_xr_ssh.py#L26-L118
train
Commit the candidate configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_xr_ssh.py
CiscoXrSSH.check_config_mode
def check_config_mode(self, check_string=")#", pattern=r"[#\$]"): """Checks if the device is in configuration mode or not. IOS-XR, unfortunately, does this: RP/0/RSP0/CPU0:BNG(admin)# """ self.write_channel(self.RETURN) output = self.read_until_pattern(pattern=pattern) ...
python
def check_config_mode(self, check_string=")#", pattern=r"[#\$]"): """Checks if the device is in configuration mode or not. IOS-XR, unfortunately, does this: RP/0/RSP0/CPU0:BNG(admin)# """ self.write_channel(self.RETURN) output = self.read_until_pattern(pattern=pattern) ...
[ "def", "check_config_mode", "(", "self", ",", "check_string", "=", "\")#\"", ",", "pattern", "=", "r\"[#\\$]\"", ")", ":", "self", ".", "write_channel", "(", "self", ".", "RETURN", ")", "output", "=", "self", ".", "read_until_pattern", "(", "pattern", "=", ...
Checks if the device is in configuration mode or not. IOS-XR, unfortunately, does this: RP/0/RSP0/CPU0:BNG(admin)#
[ "Checks", "if", "the", "device", "is", "in", "configuration", "mode", "or", "not", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_xr_ssh.py#L120-L131
train
Checks if the device is in configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco/cisco_xr_ssh.py
CiscoXrFileTransfer.process_md5
def process_md5(self, md5_output, pattern=r"^([a-fA-F0-9]+)$"): """ IOS-XR defaults with timestamps enabled # show md5 file /bootflash:/boot/grub/grub.cfg Sat Mar 3 17:49:03.596 UTC c84843f0030efd44b01343fdb8c2e801 """ match = re.search(pattern, md5_output, flag...
python
def process_md5(self, md5_output, pattern=r"^([a-fA-F0-9]+)$"): """ IOS-XR defaults with timestamps enabled # show md5 file /bootflash:/boot/grub/grub.cfg Sat Mar 3 17:49:03.596 UTC c84843f0030efd44b01343fdb8c2e801 """ match = re.search(pattern, md5_output, flag...
[ "def", "process_md5", "(", "self", ",", "md5_output", ",", "pattern", "=", "r\"^([a-fA-F0-9]+)$\"", ")", ":", "match", "=", "re", ".", "search", "(", "pattern", ",", "md5_output", ",", "flags", "=", "re", ".", "M", ")", "if", "match", ":", "return", "m...
IOS-XR defaults with timestamps enabled # show md5 file /bootflash:/boot/grub/grub.cfg Sat Mar 3 17:49:03.596 UTC c84843f0030efd44b01343fdb8c2e801
[ "IOS", "-", "XR", "defaults", "with", "timestamps", "enabled" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco/cisco_xr_ssh.py#L156-L168
train
Process the output of the MD5 command and return the entry point.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_os10_ssh.py
DellOS10SSH.save_config
def save_config( self, cmd="copy running-configuration startup-configuration", confirm=False, confirm_response="", ): """Saves Config""" return super(DellOS10SSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config( self, cmd="copy running-configuration startup-configuration", confirm=False, confirm_response="", ): """Saves Config""" return super(DellOS10SSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"copy running-configuration startup-configuration\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ",", ")", ":", "return", "super", "(", "DellOS10SSH", ",", "self", ")", ".", "save_con...
Saves Config
[ "Saves", "Config" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_os10_ssh.py#L12-L21
train
Saves Config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_os10_ssh.py
DellOS10FileTransfer.remote_file_size
def remote_file_size(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" if remote_file is None: if self.direction == "put": remote_file = self.dest_file elif self.direction == "get": remote_file = self.source_file ...
python
def remote_file_size(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" if remote_file is None: if self.direction == "put": remote_file = self.dest_file elif self.direction == "get": remote_file = self.source_file ...
[ "def", "remote_file_size", "(", "self", ",", "remote_cmd", "=", "\"\"", ",", "remote_file", "=", "None", ")", ":", "if", "remote_file", "is", "None", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "remote_file", "=", "self", ".", "dest_file", ...
Get the file size of the remote file.
[ "Get", "the", "file", "size", "of", "the", "remote", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_os10_ssh.py#L41-L57
train
Get the file size of the remote file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_os10_ssh.py
DellOS10FileTransfer.remote_space_available
def remote_space_available(self, search_pattern=r"(\d+) bytes free"): """Return space available on remote device.""" remote_cmd = 'system "df {}"'.format(self.folder_name) remote_output = self.ssh_ctl_chan.send_command_expect(remote_cmd) for line in remote_output.splitlines(): ...
python
def remote_space_available(self, search_pattern=r"(\d+) bytes free"): """Return space available on remote device.""" remote_cmd = 'system "df {}"'.format(self.folder_name) remote_output = self.ssh_ctl_chan.send_command_expect(remote_cmd) for line in remote_output.splitlines(): ...
[ "def", "remote_space_available", "(", "self", ",", "search_pattern", "=", "r\"(\\d+) bytes free\"", ")", ":", "remote_cmd", "=", "'system \"df {}\"'", ".", "format", "(", "self", ".", "folder_name", ")", "remote_output", "=", "self", ".", "ssh_ctl_chan", ".", "sen...
Return space available on remote device.
[ "Return", "space", "available", "on", "remote", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_os10_ssh.py#L59-L67
train
Return the number of bytes available on remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_os10_ssh.py
DellOS10FileTransfer.check_file_exists
def check_file_exists(self, remote_cmd="dir home"): """Check if the dest_file already exists on the file system (return boolean).""" if self.direction == "put": remote_out = self.ssh_ctl_chan.send_command_expect(remote_cmd) search_string = r"Directory contents .*{}".format(self.d...
python
def check_file_exists(self, remote_cmd="dir home"): """Check if the dest_file already exists on the file system (return boolean).""" if self.direction == "put": remote_out = self.ssh_ctl_chan.send_command_expect(remote_cmd) search_string = r"Directory contents .*{}".format(self.d...
[ "def", "check_file_exists", "(", "self", ",", "remote_cmd", "=", "\"dir home\"", ")", ":", "if", "self", ".", "direction", "==", "\"put\"", ":", "remote_out", "=", "self", ".", "ssh_ctl_chan", ".", "send_command_expect", "(", "remote_cmd", ")", "search_string", ...
Check if the dest_file already exists on the file system (return boolean).
[ "Check", "if", "the", "dest_file", "already", "exists", "on", "the", "file", "system", "(", "return", "boolean", ")", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_os10_ssh.py#L87-L94
train
Check if the dest_file already exists on the file system (return boolean ).
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_os10_ssh.py
DellOS10FileTransfer.get_file
def get_file(self): """SCP copy the file from the remote device to local system.""" source_file = "{}".format(self.source_file) self.scp_conn.scp_get_file(source_file, self.dest_file) self.scp_conn.close()
python
def get_file(self): """SCP copy the file from the remote device to local system.""" source_file = "{}".format(self.source_file) self.scp_conn.scp_get_file(source_file, self.dest_file) self.scp_conn.close()
[ "def", "get_file", "(", "self", ")", ":", "source_file", "=", "\"{}\"", ".", "format", "(", "self", ".", "source_file", ")", "self", ".", "scp_conn", ".", "scp_get_file", "(", "source_file", ",", "self", ".", "dest_file", ")", "self", ".", "scp_conn", "....
SCP copy the file from the remote device to local system.
[ "SCP", "copy", "the", "file", "from", "the", "remote", "device", "to", "local", "system", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_os10_ssh.py#L103-L107
train
SCP copy the file from the remote device to the local system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/oneaccess/oneaccess_oneos.py
OneaccessOneOSBase.save_config
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Save config: write mem""" return super(OneaccessOneOSBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="write mem", confirm=False, confirm_response=""): """Save config: write mem""" return super(OneaccessOneOSBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write mem\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "OneaccessOneOSBase", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ...
Save config: write mem
[ "Save", "config", ":", "write", "mem" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/oneaccess/oneaccess_oneos.py#L27-L31
train
Save config for the current user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
IndexTable._ParseIndex
def _ParseIndex(self, preread, precompile): """Reads index file and stores entries in TextTable. For optimisation reasons, a second table is created with compiled entries. Args: preread: func, Pre-processing, applied to each field as it is read. precompile: func, Pre-compilation, applied to ...
python
def _ParseIndex(self, preread, precompile): """Reads index file and stores entries in TextTable. For optimisation reasons, a second table is created with compiled entries. Args: preread: func, Pre-processing, applied to each field as it is read. precompile: func, Pre-compilation, applied to ...
[ "def", "_ParseIndex", "(", "self", ",", "preread", ",", "precompile", ")", ":", "self", ".", "index", "=", "texttable", ".", "TextTable", "(", ")", "self", ".", "index", ".", "CsvToTable", "(", "self", ".", "_index_handle", ")", "if", "preread", ":", "...
Reads index file and stores entries in TextTable. For optimisation reasons, a second table is created with compiled entries. Args: preread: func, Pre-processing, applied to each field as it is read. precompile: func, Pre-compilation, applied to each field before compiling. Raises: IndexTab...
[ "Reads", "index", "file", "and", "stores", "entries", "in", "TextTable", ".", "For", "optimisation", "reasons", "a", "second", "table", "is", "created", "with", "compiled", "entries", ".", "Args", ":", "preread", ":", "func", "Pre", "-", "processing", "appli...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L107-L131
train
Reads the index file and stores entries in the TextTable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
IndexTable.GetRowMatch
def GetRowMatch(self, attributes): """Returns the row number that matches the supplied attributes.""" for row in self.compiled: try: for key in attributes: # Silently skip attributes not present in the index file. # pylint: disable=E110...
python
def GetRowMatch(self, attributes): """Returns the row number that matches the supplied attributes.""" for row in self.compiled: try: for key in attributes: # Silently skip attributes not present in the index file. # pylint: disable=E110...
[ "def", "GetRowMatch", "(", "self", ",", "attributes", ")", ":", "for", "row", "in", "self", ".", "compiled", ":", "try", ":", "for", "key", "in", "attributes", ":", "# Silently skip attributes not present in the index file.", "# pylint: disable=E1103", "if", "(", ...
Returns the row number that matches the supplied attributes.
[ "Returns", "the", "row", "number", "that", "matches", "the", "supplied", "attributes", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L133-L150
train
Returns the row number that matches the supplied attributes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.synchronised
def synchronised(func): """Synchronisation decorator.""" # pylint: disable=E0213 def Wrapper(main_obj, *args, **kwargs): main_obj._lock.acquire() # pylint: disable=W0212 try: return func(main_obj, *args, **kwargs) # pylint: disable=E1102 fin...
python
def synchronised(func): """Synchronisation decorator.""" # pylint: disable=E0213 def Wrapper(main_obj, *args, **kwargs): main_obj._lock.acquire() # pylint: disable=W0212 try: return func(main_obj, *args, **kwargs) # pylint: disable=E1102 fin...
[ "def", "synchronised", "(", "func", ")", ":", "# pylint: disable=E0213", "def", "Wrapper", "(", "main_obj", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "main_obj", ".", "_lock", ".", "acquire", "(", ")", "# pylint: disable=W0212", "try", ":", "ret...
Synchronisation decorator.
[ "Synchronisation", "decorator", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L172-L183
train
Decorator to ensure that a function is called only once per object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.ReadIndex
def ReadIndex(self, index_file=None): """Reads the IndexTable index file of commands and templates. Args: index_file: String, file where template/command mappings reside. Raises: CliTableError: A template column was not found in the table. """ self.index_file = index_file or sel...
python
def ReadIndex(self, index_file=None): """Reads the IndexTable index file of commands and templates. Args: index_file: String, file where template/command mappings reside. Raises: CliTableError: A template column was not found in the table. """ self.index_file = index_file or sel...
[ "def", "ReadIndex", "(", "self", ",", "index_file", "=", "None", ")", ":", "self", ".", "index_file", "=", "index_file", "or", "self", ".", "index_file", "fullpath", "=", "os", ".", "path", ".", "join", "(", "self", ".", "template_dir", ",", "self", "....
Reads the IndexTable index file of commands and templates. Args: index_file: String, file where template/command mappings reside. Raises: CliTableError: A template column was not found in the table.
[ "Reads", "the", "IndexTable", "index", "file", "of", "commands", "and", "templates", ".", "Args", ":", "index_file", ":", "String", "file", "where", "template", "/", "command", "mappings", "reside", ".", "Raises", ":", "CliTableError", ":", "A", "template", ...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L202-L220
train
Reads the index file of commands and templates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable._TemplateNamesToFiles
def _TemplateNamesToFiles(self, template_str): """Parses a string of templates into a list of file handles.""" template_list = template_str.split(":") template_files = [] try: for tmplt in template_list: template_files.append(open(os.path.join(self.template_di...
python
def _TemplateNamesToFiles(self, template_str): """Parses a string of templates into a list of file handles.""" template_list = template_str.split(":") template_files = [] try: for tmplt in template_list: template_files.append(open(os.path.join(self.template_di...
[ "def", "_TemplateNamesToFiles", "(", "self", ",", "template_str", ")", ":", "template_list", "=", "template_str", ".", "split", "(", "\":\"", ")", "template_files", "=", "[", "]", "try", ":", "for", "tmplt", "in", "template_list", ":", "template_files", ".", ...
Parses a string of templates into a list of file handles.
[ "Parses", "a", "string", "of", "templates", "into", "a", "list", "of", "file", "handles", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L222-L234
train
Parses a string of templates into a list of file handles.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.ParseCmd
def ParseCmd(self, cmd_input, attributes=None, templates=None): """Creates a TextTable table of values from cmd_input string. Parses command output with template/s. If more than one template is found subsequent tables are merged if keys match (dropped otherwise). Args: cmd_input: String, Devic...
python
def ParseCmd(self, cmd_input, attributes=None, templates=None): """Creates a TextTable table of values from cmd_input string. Parses command output with template/s. If more than one template is found subsequent tables are merged if keys match (dropped otherwise). Args: cmd_input: String, Devic...
[ "def", "ParseCmd", "(", "self", ",", "cmd_input", ",", "attributes", "=", "None", ",", "templates", "=", "None", ")", ":", "# Store raw command data within the object.", "self", ".", "raw", "=", "cmd_input", "if", "not", "templates", ":", "# Find template in templ...
Creates a TextTable table of values from cmd_input string. Parses command output with template/s. If more than one template is found subsequent tables are merged if keys match (dropped otherwise). Args: cmd_input: String, Device/command response. attributes: Dict, attribute that further refine m...
[ "Creates", "a", "TextTable", "table", "of", "values", "from", "cmd_input", "string", ".", "Parses", "command", "output", "with", "template", "/", "s", ".", "If", "more", "than", "one", "template", "is", "found", "subsequent", "tables", "are", "merged", "if",...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L236-L275
train
Parses a command output string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable._PreParse
def _PreParse(self, key, value): """Executed against each field of each row read from index table.""" if key == "Command": return re.sub(r"(\[\[.+?\]\])", self._Completion, value) else: return value
python
def _PreParse(self, key, value): """Executed against each field of each row read from index table.""" if key == "Command": return re.sub(r"(\[\[.+?\]\])", self._Completion, value) else: return value
[ "def", "_PreParse", "(", "self", ",", "key", ",", "value", ")", ":", "if", "key", "==", "\"Command\"", ":", "return", "re", ".", "sub", "(", "r\"(\\[\\[.+?\\]\\])\"", ",", "self", ".", "_Completion", ",", "value", ")", "else", ":", "return", "value" ]
Executed against each field of each row read from index table.
[ "Executed", "against", "each", "field", "of", "each", "row", "read", "from", "index", "table", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L301-L306
train
Executed against each field of each row read from index table.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.LabelValueTable
def LabelValueTable(self, keys=None): """Return LabelValue with FSM derived keys.""" keys = keys or self.superkey # pylint: disable=E1002 return super(CliTable, self).LabelValueTable(keys)
python
def LabelValueTable(self, keys=None): """Return LabelValue with FSM derived keys.""" keys = keys or self.superkey # pylint: disable=E1002 return super(CliTable, self).LabelValueTable(keys)
[ "def", "LabelValueTable", "(", "self", ",", "keys", "=", "None", ")", ":", "keys", "=", "keys", "or", "self", ".", "superkey", "# pylint: disable=E1002", "return", "super", "(", "CliTable", ",", "self", ")", ".", "LabelValueTable", "(", "keys", ")" ]
Return LabelValue with FSM derived keys.
[ "Return", "LabelValue", "with", "FSM", "derived", "keys", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L329-L333
train
Return LabelValue with FSM derived keys.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...