<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_resource_file(issue, filepath, ignore_layouts):
 """ Delete a file from the filesystem """

    if os.path.exists(filepath) and (ignore_layouts is False or issue.elements[0][0] != 'layout'):
        print('removing resource: {0}'.format(filepath))
        os.remove(os.path.abspath(filepath))