code: def normalize_getitem_args(args):
      '''Turns the arguments to __getitem__ magic methods into a uniform
      list of tuples and strings
      '''
      if not isinstance(args, tuple):
          args = (args,)
      return_val = []
      for arg in args:
          if isinstance(arg, six.string_types + (int, )):
              return_val.append(arg)
          elif isinstance(arg, slice):
              return_val.append((arg.start, arg.stop))
          else:
              raise TypeError(
                  'Brackets cannot contain objects of type {0.__name__}'
                  .format(type(arg)))
      return return_vaf normalize_getitem_args(args):
      '''Turns the arguments to __getitem__ magic methods into a uniform
      list of tuples and strings
      '''
      if not isinstance(args, tuple):
          args = (args,)
      return_val = []
      for arg in args:
          if isinstance(arg, six.string_types + (int, )):
              return_val.append(arg)
          elif isinstance(arg, slice):
              return_val.append((arg.start, arg.stop))
          else:
              raise TypeError(
                  'Brackets cannot contain objects of type {0.__name__}'
                  .format(type(arg)))
      return return_val
docs: Turns the arguments to __getitem__ magic methods into a uniform
      list of tuples and strings