code: def export_cfg(obj, file_name):
      
      def callback(data):
          return libconf.dumps(data)
  
      # Check if it is possible to import 'libconf'
      try:
          import libconf
      except ImportError:
          raise exch.GeomdlException("Please install 'libconf' package to use libconfig format: pip install libconf")
  
      # Export data
      exported_data = exch.export_dict_str(obj=obj, callback=callback)
  
      # Write to file
      return exch.write_file(file_name, exported_data)
docs: Exports curves and surfaces in libconfig format.
  
      .. note::
  
          Requires `libconf <https://pypi.org/project/libconf/>`_ package.
  
      Libconfig format is also used by the `geomdl command-line application <https://github.com/orbingol/geomdl-cli>`_
      as a way to input shape data from the command line.
  
      :param obj: input geometry
      :type obj: abstract.SplineGeometry, multi.AbstractContainer
      :param file_name: name of the output file
      :type file_name: str
      :raises GeomdlException: an error occurred writing the file