<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chain_input_files(self):
 """Return a list of the input files needed by this chain. For `Link` sub-classes this will return only those files that were not created by any internal `Link` """

        ret_list = []
        for key, val in self.file_dict.items():
            # For chain input files we only want files that were not marked as output
            # (I.e., not produced by some other step in the chain)
            if val & FileFlags.in_ch_mask == FileFlags.input_mask:
                ret_list.append(key)
        return ret_list