code: def replace_attribute(module_name, attribute_name, new_value, dry_run=True):
      
      init_file = '%s/__init__.py' % module_name
      _, tmp_file = tempfile.mkstemp()
  
      with open(init_file) as input_file:
          with open(tmp_file, 'w') as output_file:
              for line in input_file:
                  if line.startswith(attribute_name):
                      line = "%s = '%s'\n" % (attribute_name, new_value)
  
                  output_file.write(line)
  
      if not dry_run:
          Path(tmp_file).copy(init_file)
      else:
          log.info(diff(tmp_file, init_file, retcode=None))
docs: Update a metadata attribute