def remove_excess_padding(text):
 text = re.sub('^\\n', '', text)
 text = re.sub('\\n$', '', text)
 return text

def remove_excess_padding ( text ) : text = re . sub ( '^\\n' , '' , text ) text = re . sub ( '\\n$' , '' , text ) return text
remove excess padding like extra s around the given text .