def _selector(self, e, naliases):
    if all((i.function.is_Symbol for i in e.free_symbols)):
        mincost = self._opt_mincost['scalar']
    else:
        mincost = self._opt_mincost['tensor']
    return ((estimate_cost(e, True) * naliases) // mincost)
def _selector(self, e, naliases):
    if all((i.function.is_Symbol for i in e.free_symbols)):
        mincost = self._opt_mincost['scalar']
    else:
        mincost = self._opt_mincost['tensor']
    return ((estimate_cost(e, True) * naliases) // mincost)