parameters: (path, grayscale=False)
return_statement: return img
docstring: Read the image from a give path
docstring_summary: Read the image from a give path
docstring_tokens: Read the image from a give path
function: def load_img(path, grayscale=False):
      '''Read the image from a give path'''
      img = Image.open(path)
      if grayscale:
          img = img.convert('L')
      else:  # Ensure 3 channel even when loaded image is grayscale
          img = img.convert('RGB')
      return img
function_tokens: def load_img ( path , grayscale = False ) : img = Image . open ( path ) if grayscale : img = img . convert ( 'L' ) else : # Ensure 3 channel even when loaded image is grayscale img = img . convert ( 'RGB' ) return img