code: def freeze_adapter(self, adapter_name: str, freeze: bool = True):
      if adapter_name in self.adapters:
          self.adapters[adapter_name].train(not freeze)
          for param in self.adapters[adapter_name].parameters():
              param.requires_grad = not freeze
  
imports: from typing import Dict, List, Mapping, NamedTuple, Optional, Union
  import torch
  from torch import nn
  from ..composition import AdapterCompositionBlock, Average, BatchSplit, Fuse, Parallel, Split, Stack, adjust_tensors_for_parallel
  from ..configuration import BnConfig
  from ..context import ForwardContext
  from .adapter_layer_base import ComposableAdapterLayerBase
  from .modeling import Adapter, BertFusion, ParallelAdapter
label_desc: Use image node_id 9 for calling the BottleneckLayer obj's underlying member method code with example usage: obj.freeze_adapter(adapter_name, freeze) without return types