parameters: (self, node, op, depth=10)
return_statement: return None
docstring: Starting from the given node, finds a node higher in the graph matching the given operation name. This is not an
      exhaustive graph search, it will take only the first input of each node traversed while searching depth-first.
      :param self: The gs.Graph object being extended.
      :param node: The node to start searching from.
      :param op: The operation name to search for.
      :param depth: Stop searching after traversing these many nodes.
      :return: The first ancestor node matching that performs that op.
docstring_summary: Starting from the given node, finds a node higher in the graph matching the given operation name. This is not an
      exhaustive graph search, it will take only the first input of each node traversed while searching depth-first.
      :param self: The gs.Graph object being extended.
      :param node: The node to start searching from.
      :param op: The operation name to search for.
      :param depth: Stop searching after traversing these many nodes.
      :return: The first ancestor node matching that performs that op.
docstring_tokens: Starting from the given node finds a node higher in the graph matching the given operation name . This is not an exhaustive graph search it will take only the first input of each node traversed while searching depth - first . : param self : The gs . Graph object being extended . : param node : The node to start searching from . : param op : The operation name to search for . : param depth : Stop searching after traversing these many nodes . : return : The first ancestor node matching that performs that op .
function: def find_ancestor_by_op(self, node, op, depth=10):
      """
      Starting from the given node, finds a node higher in the graph matching the given operation name. This is not an
      exhaustive graph search, it will take only the first input of each node traversed while searching depth-first.
      :param self: The gs.Graph object being extended.
      :param node: The node to start searching from.
      :param op: The operation name to search for.
      :param depth: Stop searching after traversing these many nodes.
      :return: The first ancestor node matching that performs that op.
      """
      for i in range(depth):
          node = node.i()
          if node.op == op:
              return node
      return None
function_tokens: def find_ancestor_by_op ( self , node , op , depth = 10 ) : for i in range ( depth ) : node = node . i ( ) if node . op == op : return node return None