def METHOD_NAME(region, kind='v'):
    """
    Create mapping from reference to physical entities in a given
    region, given the integration kind ('v' or 's').
    This mapping can be used to compute the physical quadrature
    points.
    Parameters
    ----------
    region : Region instance
        The region defining the entities.
    kind : 'v' or 's'
        The kind of the entities: 'v' - cells, 's' - facets.
    Returns
    -------
    mapping : FEMapping or IGMapping instance
        The requested mapping.
    """
    from sfepy.discrete.fem.domain import FEDomain
    from sfepy.discrete.iga.domain import IGDomain
    if isinstance(region.domain, FEDomain):
        from sfepy.discrete.fem.mappings import FEMapping
        coors = region.domain.get_mesh_coors()
        if kind == 's':
            coors = coors[region.vertices]
        conn, gel = region.domain.get_conn(ret_gel=True)
        if kind == 'v':
            cells = region.get_cells()
            mapping = FEMapping(coors, conn[cells], gel=gel)
        elif kind == 's':
            from sfepy.discrete.fem.fe_surface import FESurface
            aux = FESurface('aux', region, gel.get_surface_entities(),
                            conn)
            mapping = FEMapping(coors, aux.leconn, gel=gel.surface_facet)
    elif isinstance(region.domain, IGDomain):
        from sfepy.discrete.iga.mappings import IGMapping
        mapping = IGMapping(region.domain, region.cells)
    else:
        raise ValueError('unknown domain class! (%s)' % type(region.domain))
    return mapping