code: def to_scaled_dtype(val):
      
      res = []
      for i in val:
          if i[1].startswith("S"):
              res.append((i[0], i[1]) + i[2:-1])
          else:
              try:
                  res.append((i[0], i[-1].dtype) + i[2:-1])
              except AttributeError:
                  res.append((i[0], type(i[-1])) + i[2:-1])
  
      return np.dtype(res)
docs: Parse *val* to return a dtype.