def METHOD_NAME(parent_class):
    """
    Creates the subset class dynamically, so that it inherits directly
    from whatever calls the subsetting. Thus a subset will inherit the
    methods of the parent class.
    """
    class Subset(parent_class):
        """
        Subsets one of the columns to a specified subset of values
        It may be the case that you wish to subset by another Query
        object, in this case it is better to use the Query join method.
        Parameters
        ----------
        col : str
            Name of the column to subset, e.g. subscriber, cell etc.
        subset : list
            List of values to subset to
        """
        def __init__(self, parent, col, subsetby):
            self.parent = parent
            self.col = col
            self.subsetby = subsetby
            Query.__init__(self)
        @property
        def column_names(self) -> List[str]:
            return self.parent.column_names
        # This voodoo incantation means that if we look for an attribute
        # in this class, and it is not found, we then look in the parent class
        # it is thus a kind of 'object inheritance'.
        def __getattr__(self, name):
            # Don't extend this to hidden variables, such as _df
            # and _len
            if name.startswith("_"):
                raise AttributeError
            return self.parent.__getattribute__(name)
        def _make_query(self):
            try:
                assert not isinstance(self.subsetby, str)
                ss = tuple(self.subsetby)
            except (TypeError, AssertionError):
                ss = (self.subsetby,)
            finally:
                clause = "parent.{col} IN {subset}".format(
                    col=self.col, subset=_makesafe(ss)
                )
            sql = """
                        SELECT
                            *
                        FROM
                            ({parent}) AS parent
                        WHERE
                            {clause}
                       """.format(
                parent=self.parent.get_query(), clause=clause
            )
            return sql
        def __reduce__(self):
            """
            Returns
            -------
            A special object which recreates subsets.
            """
            return _SubsetGetter(), (self.parent, self.col, self.subsetby)
    return Subset