def get_headers(self, cmd, msg_length, extra_headers):
cmd_header = "<STR_LIT>" % (cmd, PROTOCOL_VERSION)<EOL>len_header = "<STR_LIT>" % msg_length<EOL>headers = [cmd_header, len_header]<EOL>if self.user:<EOL><INDENT>user_header = "<STR_LIT>" % self.user<EOL>headers.append(user_header)<EOL><DEDENT>if self.gzip:<EOL><INDENT>headers.append("<STR_LIT>")<EOL><DEDENT>if extra_headers is not None:<EOL><INDENT>for key in extra_headers:<EOL><INDENT>if key.lower() != '<STR_LIT>':<EOL><INDENT>headers.append("<STR_LIT>" % (key, extra_headers[key]))<EOL><DEDENT><DEDENT><DEDENT>headers.append('<STR_LIT>')<EOL>headers.append('<STR_LIT>')<EOL>return '<STR_LIT:\r\n>'.join(headers)<EOL>
Returns the headers string based on command to execute