def obtain_uptime(show_ver):
 match = re.search('.* uptime is .*', show_ver)
 if match:
  uptime_str = match.group().strip()
  uptime_obj = Uptime(uptime_str)
  return uptime_obj.uptime_seconds()
 else:
  return None

def obtain_uptime ( show_ver ) : match = re . search ( '.* uptime is .*' , show_ver ) if match : uptime_str = match . group ( ) . strip ( ) uptime_obj = Uptime ( uptime_str ) return uptime_obj . uptime_seconds ( ) else : return None
obtain uptime from show version data .