code: def is_match(l_name, r_list):
      """for a given frame, find the next one in a list of frame.
  
      Args:
        l_name: the name of file
        r_list: a list of potential file to be matched
  
      Returns:
        a match (or False if no match)
        the frame number of the match
      """
      basename = ntpath.basename(l_name)
      frame_number = int(basename.split(".")[0][1:])
      matched_name = "{:07d}.jpg".format(frame_number + 1)
      matches = [x for x in r_list if matched_name in x]
      if matches:
          return matches[0], frame_number
      return False, 0
  
file_path: magenta/magenta/video/next_frame_prediction_pix2pix/join_pairs.py
imports: from __future__ import print_function
  import argparse
  import glob
  import ntpath
  import os
  from random import shuffle
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: is_match(l_name, r_list) and returns: False,  int, matches,  frame_number