parameters: (diff)
return_statement: return False
docstring: Determine whether this diff is appropriate for image diff UI.
  
      This uses the a_path and b_path properties of the diff object.
docstring_summary: Determine whether this diff is appropriate for image diff UI.
docstring_tokens: Determine whether this diff is appropriate for image diff UI .
function: def is_image_diff(diff):
      """Determine whether this diff is appropriate for image diff UI.
  
      This uses the a_path and b_path properties of the diff object.
      """
  
      def is_image(path):
          if path == '':
              return False
          mime_type, enc = mimetypes.guess_type(path)
          return mime_type and mime_type.startswith('image/') and enc is None
  
      left_img = is_image(diff.a_path)
      right_img = is_image(diff.b_path)
  
      if left_img and right_img:
          return True
      elif left_img and diff.b_path == '':
          return True
      elif right_img and diff.a_path == '':
          return True
      return False
function_tokens: def is_image_diff ( diff ) : def is_image ( path ) : if path == '' : return False mime_type , enc = mimetypes . guess_type ( path ) return mime_type and mime_type . startswith ( 'image/' ) and enc is None left_img = is_image ( diff . a_path ) right_img = is_image ( diff . b_path ) if left_img and right_img : return True elif left_img and diff . b_path == '' : return True elif right_img and diff . a_path == '' : return True return False