code: def get_free_crypto_domains(self, crypto_adapters=None):
          if crypto_adapters is None:
              crypto_adapters = self.adapters.findall(type='crypto')
          if not crypto_adapters:
              return None
          max_domains = None
          for ca in crypto_adapters:
              if max_domains is None:
                  max_domains = ca.maximum_crypto_domains
              else:
                  max_domains = min(ca.maximum_crypto_domains, max_domains)
          used_domains = set()
          partitions = self.partitions.list(full_properties=True)
          for partition in partitions:
              crypto_config = partition.get_property('crypto-configuration')
              if crypto_config:
                  adapter_uris = crypto_config['crypto-adapter-uris']
                  domain_configs = crypto_config['crypto-domain-configurations']
                  for ca in crypto_adapters:
                      if ca.uri in adapter_uris:
                          used_adapter_domains = list()
                          for dc in domain_configs:
                              if dc['access-mode'] == 'control-usage':
                                  used_adapter_domains.append(dc['domain-index'])
                          used_domains.update(used_adapter_domains)
          all_domains = set(range(0, max_domains))
          free_domains = all_domains - used_domains
          return sorted(list(free_domains))