code: async def _sort_using_by_arg(self, data, by, alpha):
          
          if getattr(by, "decode", None):
              by = by.decode("utf-8")
  
          async def _by_key(arg):
              if getattr(arg, "decode", None):
                  arg = arg.decode("utf-8")
  
              key = by.replace('*', arg)
              if '->' in by:
                  key, hash_key = key.split('->')
                  v = await self.hget(key, hash_key)
                  if alpha:
                      return v
                  else:
                      return float(v)
              else:
                  return await self.get(key)
          sorted_data = []
          for d in data:
              sorted_data.append((d, await _by_key(d)))
          return [x[0] for x in sorted(sorted_data, key=lambda x: x[1])]
docs: Used by sort()