import base64


def encode_file(file_path):
  """
  Base64 encode a file.
  :param file_path: File path.
  :return: Base64 encoded file.
  """
  with open(file_path, 'rb') as f:
    s = base64.b64encode(f.read())
    return s.decode('utf-8')