def rule_expand(component, text):
 global rline_mpstate
 if ((component[0] == '<') and (component[(-1)] == '>')):
  return component[1:(-1)].split('|')
 if (component in rline_mpstate.completion_functions):
  return rline_mpstate.completion_functions[component](text)
 return [component]

def rule_expand ( component , text ) : global rline_mpstate if ( ( component [ 0 ] == '<' ) and ( component [ ( - 1 ) ] == '>' ) ) : return component [ 1 : ( - 1 ) ] . split ( '|' ) if ( component in rline_mpstate . completion_functions ) : return rline_mpstate . completion_functions [ component ] ( text ) return [ component ]
expand one rule component .