def _parse_beam_file(self, file_path, run_input_dir):
external_files = []<EOL>paths_to_replace = []<EOL>with open(file_path, '<STR_LIT:r>') as beam_f:<EOL><INDENT>for line in beam_f.readlines():<EOL><INDENT>split_line = line.split()<EOL>if len(split_line) > <NUM_LIT:2> and split_line[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>logger.debug("<STR_LIT>".format(<EOL>split_line[<NUM_LIT:0>], split_line[<NUM_LIT:2>]))<EOL>external_files.append(split_line[<NUM_LIT:2>])<EOL>paths_to_replace.append(split_line[<NUM_LIT:2>])<EOL><DEDENT>elif len(split_line) > <NUM_LIT:1> and split_line[<NUM_LIT:0>] == "<STR_LIT>":<EOL><INDENT>logger.debug("<STR_LIT>".format(<EOL>split_line[<NUM_LIT:0>], split_line[<NUM_LIT:1>]))<EOL>external_files.append(split_line[<NUM_LIT:1>])<EOL>paths_to_replace.append(split_line[<NUM_LIT:1>])<EOL><DEDENT><DEDENT><DEDENT>if paths_to_replace:<EOL><INDENT>run_dir_config_file = os.path.join(run_input_dir, os.path.split(file_path)[-<NUM_LIT:1>])<EOL>logger.debug("<STR_LIT>".format(run_dir_config_file))<EOL>self._rewrite_paths_in_file(run_dir_config_file, paths_to_replace)<EOL><DEDENT>return external_files<EOL>
Scan SH12A BEAM file for references to external files and return them