<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def gen_multivalued_slot(self, target_name_base: str, target_type: IRIREF) -> IRIREF: """ Generate a shape that represents an RDF list of target_type @param target_name_base: @param target_type: @return: """

        list_shape_id = IRIREF(target_name_base + "__List")
        if list_shape_id not in self.list_shapes:
            list_shape = Shape(id=list_shape_id, closed=True)
            list_shape.expression = EachOf()
            expressions = [TripleConstraint(predicate=RDF.first, valueExpr=target_type, min=0, max=1)]
            targets = ShapeOr()
            targets.shapeExprs = [(NodeConstraint(values=[RDF.nil])), list_shape_id]
            expressions.append(TripleConstraint(predicate=RDF.rest, valueExpr=targets))
            list_shape.expression.expressions = expressions
            self.shapes.append(list_shape)
            self.list_shapes.append(list_shape_id)
        return list_shape_id