def _get_anchor(module_to_name, fullname):
 if (not _anchor_re.match(fullname)):
  raise ValueError(("'%s' is not a valid anchor" % fullname))
 anchor = fullname
 for module_name in module_to_name.values():
  if fullname.startswith((module_name + '.')):
   rest = fullname[(len(module_name) + 1):]
   if (len(anchor) > len(rest)):
    anchor = rest
 return anchor

def _get_anchor ( module_to_name , fullname ) : if ( not _anchor_re . match ( fullname ) ) : raise ValueError ( ( "'%s' is not a valid anchor" % fullname ) ) anchor = fullname for module_name in module_to_name . values ( ) : if fullname . startswith ( ( module_name + '.' ) ) : rest = fullname [ ( len ( module_name ) + 1 ) : ] if ( len ( anchor ) > len ( rest ) ) : anchor = rest return anchor
turn a full member name into an anchor .