code: def encrypt(pubkey, password):
      """Encrypt password using given RSA public key and encode it with base64.
  
      The encrypted password can only be decrypted by someone with the
      private key (in this case, only Travis).
      """
      key = load_key(pubkey)
      encrypted_password = key.encrypt(password, PKCS1v15())
      return base64.b64encode(encrypted_password)
  
file_path: tensorboard_logger/travis_pypi_setup.py
imports: from __future__ import print_function
  import base64
  import json
  import os
  from getpass import getpass
  import yaml
  from cryptography.hazmat.primitives.serialization import load_pem_public_key
  from cryptography.hazmat.backends import default_backend
  from cryptography.hazmat.primitives.asymmetric.padding import PKCS1v15
label_desc: Use image node_id 2 for calling a global function with example usage: encrypt(pubkey, password) and returns: base64