code: def load_certificate(filename):
      """Load public and secret key from a zmq certificate.
  
      Returns (public_key, secret_key)
  
      If the certificate file only contains the public key,
      secret_key will be None.
  
      If there is no public key found in the file, ValueError will be raised.
      """
      public_key = None
      secret_key = None
      if not os.path.exists(filename):
          raise IOError(
              "Invalid certificate file: {0}".format(filename)
          )
  
      with open(filename, "rb") as f:
          for line in f:
              line = line.strip()
              if line.startswith(b"#"):
                  continue
              if line.startswith(b"public-key"):
                  public_key = line.split(b"=", 1)[1].strip(b" \t'\"")
              if line.startswith(b"secret-key"):
                  secret_key = line.split(b"=", 1)[1].strip(b" \t'\"")
              if public_key and secret_key:
                  break
  
      if public_key is None:
          raise ValueError("No public key found in %s" % filename)
  
      return public_key, secret_key
  
file_path: catboost/contrib/python/pyzmq/py2/zmq/auth/certs.py
imports: import datetime
  import glob
  import io
  import os
  import zmq
  from zmq.utils.strtypes import bytes, unicode, b, u
label_desc: Use image node_id 3 for calling a global function with example usage: load_certificate(filename) and returns: public_key,  secret_key