def METHOD_NAME(doc, dtd_name, dtd_basedir=None):
    if dtd_basedir is None:
        dtd_basedir = os.path.join(os.path.dirname(__file__), 'schemas')
    dtd_filename = os.path.join(dtd_basedir, dtd_name)
    with open(dtd_filename, 'rb') as schema:
        dtd = etree.DTD(schema)
        if isinstance(doc, (string_type, bytes)):
            xml = etree.XML(doc)
        else:
            xml = doc
        is_valid = dtd.validate(xml)
        print(dtd.error_log.filter_from_errors())
        return is_valid