def METHOD_NAME(filename, group, knots, degrees, control_points, weights,
                   cs, conn, bezier_control_points, bezier_weights, bezier_conn,
                   regions, name=None):
    """
    Write IGA-related data into a HDF5 file using pytables.
    filename: str or tables.File
        File to read the hdf5 mesh to.
    group: tables.group.Group, optional
        HDF5 file group to read the data from.
        If None, the root of file is used.
    Returns
    -------
    tuple
        Data for restoring IGA domain.
    """
    with HDF5ContextManager(filename, mode = 'w',
                            title='SfePy IGA data file') as fd:
        if group is None:
            group = fd.root
        if isinstance(degrees, int): degrees = [degrees]
        degrees = nm.asarray(degrees)
        nurbs = fd.create_group(group, 'nurbs', 'nurbs')
        fd.create_array(nurbs, 'dim', (int)(control_points.shape[1]), 'dim')
        fd.create_array(nurbs, 'tdim', len(degrees), 'tdim')
        for ii, kv in enumerate(knots):
            key = 'knots_%d' % ii
            fd.create_array(nurbs, key, kv, key)
        fd.create_array(nurbs, 'degrees', degrees, 'degrees')
        fd.create_array(nurbs, 'control_points', control_points,
                        'control_points')
        fd.create_array(nurbs, 'weights', weights, 'weights')
        bezier = fd.create_group(group, 'bezier', 'bezier')
        fd.create_array(bezier, 'bezier_control_points', bezier_control_points,
                        'bezier_control_points')
        fd.create_array(bezier, 'bezier_weights', bezier_weights,
                        'bezier_weights')
        for ii, op in enumerate(cs):
            key = 'extraction_%d' % ii
            fd.create_array(bezier, key, op, key)
        fd.create_array(bezier, 'global_connectivity', conn,
                        'global_connectivity')
        fd.create_array(bezier, 'bezier_connectivity', bezier_conn,
                        'bezier_connectivity')
        regs = fd.create_group(group, 'regions', 'regions')
        for key, val in six.iteritems(regions):
            fd.create_array(regs, key, val, key)
        if name is not None:
            fd.create_array( group, 'name', nm.array( enc(name)) )