text: def double_tuple(item):
      return item, item
  
  # def get_list(l, indexes):
  #     return [l[i] for i in indexes]
  
  def polarity(n):
      if n == 0:
          return n
      return n / abs(n)
  
  def combine_lists(l1, l2, sign):
      l1 = list(l1)
      for i in range(2):
          if sign == '+':
              l1[i] += l2[i]
          elif sign == '-':
              l1[i] -= l2[i]
          elif sign == '*':
              l1[i] *= l2[i]
          else:
              l1[i] /= l2[i]
      return l1
  
  def opposite(n):
      return abs(n - 1)
  
  def make_tuple(thing):
      if type(thing) not in (list, tuple):
          return (thing,)
      return thing
  
  def find_center(d1, d2, c1=(0, 0)):
      return [(c1[i] + (d1[i] / 2 - d2[i] / 2)) for i in range(2)]
  
  def collision(c1, d1, c2, d2, inside_only=False):
      d1 = list(d1)
      d2 = list(d2)
      collisions = [False, False]
      for i in range(2):
          d1[i] -= 1
          d2[i] -= 1
          if (c1[i] <= c2[i] and c1[i] + d1[i] >= c2[i] + d2[i]) or \
                  (c1[i] >= c2[i] and c1[i] + d1[i] <= c2[i] + d2[i]):
              collisions[i] = True
          if not inside_only:
              if (c2[i] <= c1[i] <= c2[i] + d2[i]) or \
                      (c2[i] <= c1[i] + d1[i] <= c2[i] + d2[i]):
                  collisions[i] = True
      if False not in collisions:
          return True
      elif True in collisions:
          return collisions.index(False)
  