parameters: (api_names, deprecated_api_names)
return_statement: return None
docstring: Get preferred endpoint name.
  
    Args:
      api_names: API names iterable.
      deprecated_api_names: Deprecated API names iterable.
    Returns:
      Returns one of the following in decreasing preference:
      - first non-deprecated endpoint
      - first endpoint
      - None
docstring_summary: Get preferred endpoint name.
docstring_tokens: Get preferred endpoint name .
function: def get_canonical_name(api_names, deprecated_api_names):
    """Get preferred endpoint name.
  
    Args:
      api_names: API names iterable.
      deprecated_api_names: Deprecated API names iterable.
    Returns:
      Returns one of the following in decreasing preference:
      - first non-deprecated endpoint
      - first endpoint
      - None
    """
    non_deprecated_name = next(
        (name for name in api_names if name not in deprecated_api_names),
        None)
    if non_deprecated_name:
      return non_deprecated_name
    if api_names:
      return api_names[0]
    return None
function_tokens: def get_canonical_name ( api_names , deprecated_api_names ) : non_deprecated_name = next ( ( name for name in api_names if name not in deprecated_api_names ) , None ) if non_deprecated_name : return non_deprecated_name if api_names : return api_names [ 0 ] return None