def range(start, stop=None):
        """Returns an array expression containing the sequence of integers from
        the specified start (inclusive) to stop (exclusive).

        If ``stop`` is provided, returns ``[start, start + 1, ..., stop - 1]``.

        If no ``stop`` is provided, returns ``[0, 1, ..., start - 1]``.

        Examples::

            import fiftyone as fo
            from fiftyone import ViewField as F

            dataset = fo.Dataset()
            dataset.add_samples(
                [
                    fo.Sample(filepath="image1.jpg", tags=["a", "b", "c"]),
                    fo.Sample(filepath="image2.jpg", tags=["y", "z"]),
                ]
            )

            # Populates an `ints` field based on the number of `tags`
            dataset.add_sample_field("ints", fo.ListField)
            view = dataset.set_field("ints", F.range(F("tags").length()))

            print(view.first())

        Args:
            start: the starting value, or stopping value if no ``stop`` is
                provided
            stop (None): the stopping value, if both input arguments are
                provided

        Returns:
            a :class:`ViewExpression`
        """
        if stop is None:
            stop = start
            start = 0

        return ViewExpression({"$range": [start, stop]})
Returns an array expression containing the sequence of integers from
        the specified start (inclusive) to stop (exclusive).

        If ``stop`` is provided, returns ``[start, start + 1, ..., stop - 1]``.

        If no ``stop`` is provided, returns ``[0, 1, ..., start - 1]``.

        Examples::

            import fiftyone as fo
            from fiftyone import ViewField as F

            dataset = fo.Dataset()
            dataset.add_samples(
                [
                    fo.Sample(filepath="image1.jpg", tags=["a", "b", "c"]),
                    fo.Sample(filepath="image2.jpg", tags=["y", "z"]),
                ]
            )

            # Populates an `ints` field based on the number of `tags`
            dataset.add_sample_field("ints", fo.ListField)
            view = dataset.set_field("ints", F.range(F("tags").length()))

            print(view.first())

        Args:
            start: the starting value, or stopping value if no ``stop`` is
                provided
            stop (None): the stopping value, if both input arguments are
                provided

        Returns:
            a :class:`ViewExpression`
        
fiftyone/core/expressions.py