def METHOD_NAME(self, input):
    """parsese the given file or file source string"""
    if hasattr(input, "name"):
        self.filename = input.name
    elif not getattr(self, "filename", ""):
        self.filename = ""
    if hasattr(input, "read"):
        tmsrc = input.read()
        input.close()
        input = tmsrc
    try:
        input = input.decode(self.encoding)
    except Exception:
        raise ValueError(
            "OmegaT files are either UTF-8 encoded or use the default system encoding"
        )
    lines = csv.DictReader(
        input.split("\n"), fieldnames=OMEGAT_FIELDNAMES, dialect="omegat"
    )
    for line in lines:
        newunit = OmegaTUnit()
        newunit.dict = line
        self.addunit(newunit)