def fetch_docker_tags(self):
<EOL>dict_of_parsed = {}<EOL>terminal_width = shutil.get_terminal_size().columns - <NUM_LIT:3><EOL>center_string = "<STR_LIT>"<EOL>tags_list = [<EOL>[<EOL>"<STR_LIT:=>" * int(terminal_width / <NUM_LIT:4>),<EOL>"<STR_LIT>".format(<EOL>"<STR_LIT:=>" * int(((terminal_width/<NUM_LIT:2> - len(center_string)) / <NUM_LIT:2>)),<EOL>center_string)<EOL>,<EOL>"<STR_LIT>".format("<STR_LIT:=>" * int(terminal_width / <NUM_LIT:4>))<EOL>],<EOL>["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"],<EOL>[<EOL>"<STR_LIT:=>" * int(terminal_width / <NUM_LIT:4>),<EOL>"<STR_LIT:=>" * int(terminal_width / <NUM_LIT:2>),<EOL>"<STR_LIT:=>" * int(terminal_width / <NUM_LIT:4>)<EOL>]<EOL>]<EOL>for p in self.processes[<NUM_LIT:1>:]:<EOL><INDENT>template = p.template<EOL>if template in dict_of_parsed:<EOL><INDENT>continue<EOL><DEDENT>dict_of_parsed[template] = {<EOL>"<STR_LIT>": []<EOL>}<EOL>for directives in p.directives.values():<EOL><INDENT>try:<EOL><INDENT>repo = directives["<STR_LIT>"]<EOL>default_version = directives["<STR_LIT:version>"]<EOL><DEDENT>except KeyError:<EOL><INDENT>repo = "<STR_LIT>"<EOL>default_version = "<STR_LIT>"<EOL><DEDENT>repo_version = repo + default_version<EOL>if repo_version not in dict_of_parsed[template]["<STR_LIT>"]:<EOL><INDENT>r = requests.get(<EOL>"<STR_LIT>"<EOL>.format(repo)<EOL>)<EOL>if r.status_code != <NUM_LIT>:<EOL><INDENT>r_content = json.loads(r.content)["<STR_LIT>"]<EOL>for version in r_content:<EOL><INDENT>printed_version = (version["<STR_LIT:name>"] + "<STR_LIT:*>")if version["<STR_LIT:name>"] == default_versionelse version["<STR_LIT:name>"]<EOL>tags_list.append([template, repo, printed_version])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>tags_list.append([template, repo, "<STR_LIT>"])<EOL><DEDENT><DEDENT>dict_of_parsed[template]["<STR_LIT>"].append(repo_version)<EOL><DEDENT><DEDENT>for x, entry in enumerate(tags_list):<EOL><INDENT>color = "<STR_LIT>" if x < <NUM_LIT:3> else("<STR_LIT>" if x % <NUM_LIT:2> != <NUM_LIT:0> else "<STR_LIT>")<EOL>final_width = [<EOL>int(terminal_width/<NUM_LIT:4>),<EOL>int(terminal_width/<NUM_LIT:2>),<EOL>int(terminal_width/<NUM_LIT:4>)<EOL>]<EOL>sys.stdout.write(<EOL>colored_print("<STR_LIT>".format(<EOL>*entry, *final_width), color)<EOL>)<EOL><DEDENT>sys.stdout.write("<STR_LIT>".format("<STR_LIT>",<EOL>terminal_width + <NUM_LIT:3>))<EOL>
Export all dockerhub tags associated with each component given by
the -t flag.