code: def join_sources(source_module: DeploymentModule, contract_name: str):
      
      joined_file = Path(__file__).parent.joinpath('joined.sol')
      remapping = {module: str(path) for module, path in contracts_source_path().items()}
      command = [
          './utils/join-contracts.py',
          '--import-map',
          json.dumps(remapping),
          str(contracts_source_path_of_deployment_module(
              source_module,
          ).joinpath(contract_name + '.sol')),
          str(joined_file),
      ]
      working_dir = Path(__file__).parent.parent
      try:
          subprocess.check_call(command, cwd=working_dir)
      except subprocess.CalledProcessError as ex:
          print(f'cd {str(working_dir)}; {subprocess.list2cmdline(command)} failed.')
          raise ex
  
      return joined_file.read_text()
docs: Use join-contracts.py to concatenate all imported Solidity files.
  
      Args:
          source_module: a module name to look up contracts_source_path()
          contract_name: 'TokenNetworkRegistry', 'SecretRegistry' etc.