code: def resolve_ssl_version(candidate):
      
      if candidate is None:
          return PROTOCOL_SSLv23
  
      if isinstance(candidate, str):
          res = getattr(ssl, candidate, None)
          if res is None:
              res = getattr(ssl, 'PROTOCOL_' + candidate)
          return res
  
      return candidate
docs: like resolve_cert_reqs