parameters: (self, config: proto.MetadataStoreClientConfig)
return_statement: return grpc.secure_channel(target, credentials, options=options)
docstring: Configures the channel, which could be secure or insecure.
  
      It returns a channel that can be specified to be secure or insecure,
      depending on whether ssl_config is specified in the config.
  
      Args:
        config: proto.MetadataStoreClientConfig.
  
      Returns:
        an initialized gRPC channel.
docstring_summary: Configures the channel, which could be secure or insecure.
docstring_tokens: Configures the channel which could be secure or insecure .
function: def _get_channel(self, config: proto.MetadataStoreClientConfig):
      """Configures the channel, which could be secure or insecure.
  
      It returns a channel that can be specified to be secure or insecure,
      depending on whether ssl_config is specified in the config.
  
      Args:
        config: proto.MetadataStoreClientConfig.
  
      Returns:
        an initialized gRPC channel.
      """
      target = ':'.join([config.host, str(config.port)])
  
      if config.HasField('client_timeout_sec'):
        self._grpc_timeout_sec = config.client_timeout_sec
  
      options = []
      if config.HasField('channel_arguments'):
        if config.channel_arguments.HasField('max_receive_message_length'):
          options.append(('grpc.max_receive_message_length',
                          config.channel_arguments.max_receive_message_length))
        if config.channel_arguments.HasField('http2_max_ping_strikes'):
          options.append(('grpc.http2.max_ping_strikes',
                          config.channel_arguments.http2_max_ping_strikes))
  
      if not config.HasField('ssl_config'):
        return grpc.insecure_channel(target, options=options)
  
      root_certificates = None
      private_key = None
      certificate_chain = None
      if config.ssl_config.HasField('custom_ca'):
        root_certificates = bytes(
            str(config.ssl_config.custom_ca).encode('ascii'))
      if config.ssl_config.HasField('client_key'):
        private_key = bytes(str(config.ssl_config.client_key).encode('ascii'))
      if config.ssl_config.HasField('server_cert'):
        certificate_chain = bytes(
            str(config.ssl_config.server_cert).encode('ascii'))
      credentials = grpc.ssl_channel_credentials(root_certificates, private_key,
                                                 certificate_chain)
      return grpc.secure_channel(target, credentials, options=options)
function_tokens: def _get_channel ( self , config : proto . MetadataStoreClientConfig ) : target = ':' . join ( [ config . host , str ( config . port ) ] ) if config . HasField ( 'client_timeout_sec' ) : self . _grpc_timeout_sec = config . client_timeout_sec options = [ ] if config . HasField ( 'channel_arguments' ) : if config . channel_arguments . HasField ( 'max_receive_message_length' ) : options . append ( ( 'grpc.max_receive_message_length' , config . channel_arguments . max_receive_message_length ) ) if config . channel_arguments . HasField ( 'http2_max_ping_strikes' ) : options . append ( ( 'grpc.http2.max_ping_strikes' , config . channel_arguments . http2_max_ping_strikes ) ) if not config . HasField ( 'ssl_config' ) : return grpc . insecure_channel ( target , options = options ) root_certificates = None private_key = None certificate_chain = None if config . ssl_config . HasField ( 'custom_ca' ) : root_certificates = bytes ( str ( config . ssl_config . custom_ca ) . encode ( 'ascii' ) ) if config . ssl_config . HasField ( 'client_key' ) : private_key = bytes ( str ( config . ssl_config . client_key ) . encode ( 'ascii' ) ) if config . ssl_config . HasField ( 'server_cert' ) : certificate_chain = bytes ( str ( config . ssl_config . server_cert ) . encode ( 'ascii' ) ) credentials = grpc . ssl_channel_credentials ( root_certificates , private_key , certificate_chain ) return grpc . secure_channel ( target , credentials , options = options )