parameters: (flag, np_fun_name)
return_statement: return template % np_fun_name
docstring: Generates link from numpy function name.
  
    Args:
      flag: the flag to control link form. See `set_np_doc_form`.
      np_fun_name: the numpy function name.
  
    Returns:
      A string.
docstring_summary: Generates link from numpy function name.
docstring_tokens: Generates link from numpy function name .
function: def generate_link(flag, np_fun_name):
    """Generates link from numpy function name.
  
    Args:
      flag: the flag to control link form. See `set_np_doc_form`.
      np_fun_name: the numpy function name.
  
    Returns:
      A string.
    """
    # Only adds link in this case
    if flag == 'dev':
      template = 'https://numpy.org/devdocs/reference/generated/numpy.%s.html'
    elif flag == 'stable':
      template = (
          'https://numpy.org/doc/stable/reference/generated/numpy.%s.html')
    elif re.match(r'\d+(\.\d+(\.\d+)?)?$', flag):
      # `flag` is the version number
      template = ('https://numpy.org/doc/' + flag +
                  '/reference/generated/numpy.%s.html')
    else:
      return None
    return template % np_fun_name
function_tokens: def generate_link ( flag , np_fun_name ) : # Only adds link in this case if flag == 'dev' : template = 'https://numpy.org/devdocs/reference/generated/numpy.%s.html' elif flag == 'stable' : template = ( 'https://numpy.org/doc/stable/reference/generated/numpy.%s.html' ) elif re . match ( r'\d+(\.\d+(\.\d+)?)?$' , flag ) : # `flag` is the version number template = ( 'https://numpy.org/doc/' + flag + '/reference/generated/numpy.%s.html' ) else : return None return template % np_fun_name