def get_method_by_idx(self, idx):
if self.__cached_methods_idx == None:<EOL><INDENT>self.__cached_methods_idx = {}<EOL>for i in self.classes.class_def:<EOL><INDENT>for j in i.get_methods():<EOL><INDENT>self.__cached_methods_idx[j.get_method_idx()] = j<EOL><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>return self.__cached_methods_idx[idx]<EOL><DEDENT>except KeyError:<EOL><INDENT>return None<EOL><DEDENT>
Return a specific method by using an index
:param idx: the index of the method
:type idx: int

:rtype: None or an :class:`EncodedMethod` object