parameters: (self, path_to_mediapipe_binary, sequence_example, graph)
return_statement: return output_example
docstring: Runs MediaPipe over MediaSequence tf.train.SequenceExamples.
  
      Args:
        path_to_mediapipe_binary: Path to the compiled binary for the BUILD target
          mediapipe/examples/desktop/demo:media_sequence_demo.
        sequence_example: The SequenceExample with metadata or partial data file.
        graph: The path to the graph that extracts data to add to the
          SequenceExample.
  
      Returns:
        A copy of the input SequenceExample with additional data fields added
        by the MediaPipe graph.
      Raises:
        RuntimeError: if MediaPipe returns an error or fails to run the graph.
docstring_summary: Runs MediaPipe over MediaSequence tf.train.SequenceExamples.
docstring_tokens: Runs MediaPipe over MediaSequence tf . train . SequenceExamples .
function: def _run_mediapipe(self, path_to_mediapipe_binary, sequence_example, graph):
      """Runs MediaPipe over MediaSequence tf.train.SequenceExamples.
  
      Args:
        path_to_mediapipe_binary: Path to the compiled binary for the BUILD target
          mediapipe/examples/desktop/demo:media_sequence_demo.
        sequence_example: The SequenceExample with metadata or partial data file.
        graph: The path to the graph that extracts data to add to the
          SequenceExample.
  
      Returns:
        A copy of the input SequenceExample with additional data fields added
        by the MediaPipe graph.
      Raises:
        RuntimeError: if MediaPipe returns an error or fails to run the graph.
      """
      if not path_to_mediapipe_binary:
        raise ValueError("--path_to_mediapipe_binary must be specified.")
      input_fd, input_filename = tempfile.mkstemp()
      output_fd, output_filename = tempfile.mkstemp()
      cmd = [
          path_to_mediapipe_binary,
          "--calculator_graph_config_file=%s" % graph,
          "--input_side_packets=input_sequence_example=%s" % input_filename,
          "--output_side_packets=output_sequence_example=%s" % output_filename
      ]
      with open(input_filename, "wb") as input_file:
        input_file.write(sequence_example.SerializeToString())
      mediapipe_output = subprocess.check_output(cmd)
      if b"Failed to run the graph" in mediapipe_output:
        raise RuntimeError(mediapipe_output)
      with open(output_filename, "rb") as output_file:
        output_example = tf.train.SequenceExample()
        output_example.ParseFromString(output_file.read())
      os.close(input_fd)
      os.remove(input_filename)
      os.close(output_fd)
      os.remove(output_filename)
      return output_example
function_tokens: def _run_mediapipe ( self , path_to_mediapipe_binary , sequence_example , graph ) : if not path_to_mediapipe_binary : raise ValueError ( "--path_to_mediapipe_binary must be specified." ) input_fd , input_filename = tempfile . mkstemp ( ) output_fd , output_filename = tempfile . mkstemp ( ) cmd = [ path_to_mediapipe_binary , "--calculator_graph_config_file=%s" % graph , "--input_side_packets=input_sequence_example=%s" % input_filename , "--output_side_packets=output_sequence_example=%s" % output_filename ] with open ( input_filename , "wb" ) as input_file : input_file . write ( sequence_example . SerializeToString ( ) ) mediapipe_output = subprocess . check_output ( cmd ) if b"Failed to run the graph" in mediapipe_output : raise RuntimeError ( mediapipe_output ) with open ( output_filename , "rb" ) as output_file : output_example = tf . train . SequenceExample ( ) output_example . ParseFromString ( output_file . read ( ) ) os . close ( input_fd ) os . remove ( input_filename ) os . close ( output_fd ) os . remove ( output_filename ) return output_example