parameters: (start_token, func, end_func=None, distance=None,
                   reverse=False)
return_statement: return None
docstring: Returns the first token where func is True within distance of this token.
  
    Args:
      start_token: The token to start searching from
      func: The function to call to test a token for applicability
      end_func: The function to call to test a token to determine whether to abort
            the search.
      distance: The number of tokens to look through before failing search.  Must
          be positive.  If unspecified, will search until the end of the token
          chain
      reverse: When true, search the tokens before this one instead of the tokens
          after it
  
    Returns:
      The first token matching func within distance of this token, or None if no
      such token is found.
docstring_summary: Returns the first token where func is True within distance of this token.
docstring_tokens: Returns the first token where func is True within distance of this token .
function: def CustomSearch(start_token, func, end_func=None, distance=None,
                   reverse=False):
    """Returns the first token where func is True within distance of this token.
  
    Args:
      start_token: The token to start searching from
      func: The function to call to test a token for applicability
      end_func: The function to call to test a token to determine whether to abort
            the search.
      distance: The number of tokens to look through before failing search.  Must
          be positive.  If unspecified, will search until the end of the token
          chain
      reverse: When true, search the tokens before this one instead of the tokens
          after it
  
    Returns:
      The first token matching func within distance of this token, or None if no
      such token is found.
    """
    token = start_token
    if reverse:
      while token and (distance is None or distance > 0):
        previous = token.previous
        if previous:
          if func(previous):
            return previous
          if end_func and end_func(previous):
            return None
  
        token = previous
        if distance is not None:
          distance -= 1
  
    else:
      while token and (distance is None or distance > 0):
        next_token = token.next
        if next_token:
          if func(next_token):
            return next_token
          if end_func and end_func(next_token):
            return None
  
        token = next_token
        if distance is not None:
          distance -= 1
  
    return None
function_tokens: def CustomSearch ( start_token , func , end_func = None , distance = None , reverse = False ) : token = start_token if reverse : while token and ( distance is None or distance > 0 ) : previous = token . previous if previous : if func ( previous ) : return previous if end_func and end_func ( previous ) : return None token = previous if distance is not None : distance -= 1 else : while token and ( distance is None or distance > 0 ) : next_token = token . next if next_token : if func ( next_token ) : return next_token if end_func and end_func ( next_token ) : return None token = next_token if distance is not None : distance -= 1 return None