def _strip_object(key):
 if (hasattr(key, 'version_agnostic') and hasattr(key, 'for_branch')):
  return key.for_branch(None).version_agnostic()
 else:
  return key

def _strip_object ( key ) : if ( hasattr ( key , 'version_agnostic' ) and hasattr ( key , 'for_branch' ) ) : return key . for_branch ( None ) . version_agnostic ( ) else : return key
strips branch and version info if the given key supports those attributes .