def _close_callable(self, node, force=False):
<EOL>try:<EOL><INDENT>lineno = node.lineno<EOL><DEDENT>except AttributeError:<EOL><INDENT>return<EOL><DEDENT>if lineno <= self._processed_line:<EOL><INDENT>return<EOL><DEDENT>name = "<STR_LIT>"<EOL>try:<EOL><INDENT>name = (<EOL>node.name<EOL>if hasattr(node, "<STR_LIT:name>")<EOL>else (<EOL>node.targets[<NUM_LIT:0>].id<EOL>if hasattr(node.targets[<NUM_LIT:0>], "<STR_LIT:id>")<EOL>else node.targets[<NUM_LIT:0>].value.id<EOL>)<EOL>)<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>indent = self._get_indent(node)<EOL>count = -<NUM_LIT:1><EOL>dlist = []<EOL>while count >= -len(self._indent_stack):<EOL><INDENT>element_full_name = self._indent_stack[count]["<STR_LIT>"]<EOL>edict = self._callables_db.get(element_full_name, None)<EOL>stack_indent = self._indent_stack[count]["<STR_LIT>"]<EOL>open_callable = element_full_name and (not edict["<STR_LIT>"])<EOL>if open_callable and (<EOL>force<EOL>or (indent < stack_indent)<EOL>or (<EOL>(indent == stack_indent)<EOL>and (<EOL>(edict["<STR_LIT:type>"] != "<STR_LIT>")<EOL>or (<EOL>(edict["<STR_LIT:type>"] == "<STR_LIT>")<EOL>and (name and (name != element_full_name))<EOL>)<EOL>)<EOL>)<EOL>):<EOL><INDENT>edict["<STR_LIT>"] = lineno - <NUM_LIT:1><EOL>dlist.append(count)<EOL><DEDENT>if indent > stack_indent:<EOL><INDENT>break<EOL><DEDENT>count -= <NUM_LIT:1><EOL><DEDENT>stack = self._indent_stack<EOL>stack_length = len(self._indent_stack)<EOL>dlist = [item for item in dlist if stack[item]["<STR_LIT:type>"] != "<STR_LIT>"]<EOL>for item in dlist:<EOL><INDENT>del self._indent_stack[stack_length + item]<EOL><DEDENT>
Record last line number of callable.