code: def gsim(value):
      
      if not value.startswith('['):  # assume the GSIM name
          value = '[%s]' % value
      [(gsim_name, kwargs)] = toml.loads(value).items()
      minimum_distance = float(kwargs.pop('minimum_distance', 0))
      if gsim_name == 'FromFile':
          return FromFile()
      try:
          gsim_class = registry[gsim_name]
      except KeyError:
          raise ValueError('Unknown GSIM: %s' % gsim_name)
      gs = gsim_class(**kwargs)
      gs._toml = '\n'.join(line.strip() for line in value.splitlines())
      gs.minimum_distance = minimum_distance
      return gs
docs: Convert a string in TOML format into a GSIM instance
  
      >>> gsim('[BooreAtkinson2011]')
      [BooreAtkinson2011]