

def _clone_attributes(self, query):
    query = super(SelectQuery, self)._clone_attributes(query)
    query._explicit_selection = self._explicit_selection
    query._select = list(self._select)
    if (self._from is not None):
        query._from = []
        for f in self._from:
            if isinstance(f, Node):
                query._from.append(f.clone())
            else:
                query._from.append(f)
    if (self._group_by is not None):
        query._group_by = list(self._group_by)
    if self._having:
        query._having = self._having.clone()
    if (self._order_by is not None):
        query._order_by = list(self._order_by)
    if (self._windows is not None):
        query._windows = list(self._windows)
    query._limit = self._limit
    query._offset = self._offset
    query._distinct = self._distinct
    query._for_update = self._for_update
    query._naive = self._naive
    query._tuples = self._tuples
    query._dicts = self._dicts
    query._aggregate_rows = self._aggregate_rows
    f._alias = self._alias
    return query

dataset/ETHPy150Open coleifer/peewee/peewee.py SelectQuery._clone_attributes/VarMisuse@269/337 `query`->`f`