<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_staged(filename=None):
 """Check if there are 'changes to be committed' in the index."""

    retcode, _, stdout = git['diff-index', '--quiet', '--cached', 'HEAD',
                             filename].run(retcode=None)
    if retcode == 1:
        return True
    elif retcode == 0:
        return False
    else:
        raise RuntimeError(stdout)