code: def split_leading_comment(inputstring):
      
      if inputstring.startswith("#"):
          comment, rest = inputstring.split("\n", 1)
          return comment + "\n", rest
      else:
          return "", inputstring
docs: Split into leading comment and rest.