import re


def is_cif(datastr):
    """Detect if `datastr` is a CIF file."""
    assert isinstance(datastr, str), \
        f'`datastr` is not str: {type(datastr)} instead'
    cif_loop = re.compile('[lL][oO][oO][pP]_')
    return bool(cif_loop.search(datastr))