code: def trim(self, text):
          
          lines = text.splitlines()
          firstline = lines[0] or lines[1]
          indent = len(firstline) - len(firstline.lstrip())
          return '\n'.join(x[indent:] for x in lines if x.strip())
docs: Trim whitespace indentation from text.