def contains(filename, text, exact=False, use_sudo=False, escape=True,
    shell=False, case_sensitive=True):
    func = use_sudo and sudo or run
    if escape:
        text = _escape_for_regex(text)
        if exact:
            text = "^%s$" % text
    with settings(hide('everything'), warn_only=True):
        egrep_cmd = 'egrep "%s" %s' % (text, _expand_path(filename))
        if not case_sensitive:
            egrep_cmd = egrep_cmd.replace('egrep', 'egrep -i', 1)
        return func(egrep_cmd, shell=shell).succeeded
Return True if ``filename`` contains ``text`` (which may be a regex.)
dataset/ETHPy150Open fabric/fabric/fabric/contrib/files.py/contains