def isMedlineFile(infile, checkedLines=2):
    """Determines if _infile_ is the path to a Medline file. A file is considerd to be a Medline file if it has the correct encoding (`latin-1`) and within the first _checkedLines_ a line starts with `"PMID- "`.

    # Parameters

    _infile_ : `str`

    > The path to the targets file

    _checkedLines_ : `optional [int]`

    > default 2, the number of lines to check for the header

    # Returns

    `bool`

    > `True` if the file is a Medline file
    """
    try:
        with open(infile, 'r', encoding='latin-1') as openfile:
            f = enumerate(openfile, start=0)
            for i in range(checkedLines):
                if f.__next__()[1].startswith('PMID- '):
                    return True
    except (StopIteration, UnicodeDecodeError):
        return False
    else:
        return False
