old_contents: import os
  import random
  import string
  from datetime import date, datetime
  import main
  
  
  def random_name():
      return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)])
  
  
  def json_serial(obj):
      """JSON serializer for objects not serializable by default json code"""
  
      if isinstance(obj, (datetime, date)):
          return obj.isoformat()
      raise TypeError("Type %s not serializable" % type(obj))
  
  
  def secret_key_gen():
      filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt'
      generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits)
                               for _ in range(50)])
      with open(filepath, 'w') as secret_file:
          secret_file.write(
              '%(key)s' % dict(key=generated_key)
          )
  
      print('Find your secret key at %(path)s' % dict(path=filepath))
  
  
  def check_name(name):
      for shl in main.app.shopping_list:
          if shl.get('name') == name:
              return True
      return False
  
  
  def get_shl(name):
      for shl in main.app.shopping_list:
          if shl.get('name') == name:
              return shl
  
  
  def check_duplicate_item_name(shl_name, item_name):
      for shl in main.app.shopping_list:
          if shl.get('name') == shl_name:
              for item in shl.get('shl').items:
                  if item.name == item_name:
                      return True
  
              return False
  
  
new_contents: import os
  import random
  import string
  from datetime import date, datetime
  import main
  
  
  def random_name():
      return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)])
  
  
  def json_serial(obj):
      """JSON serializer for objects not serializable by default json code"""
  
      if isinstance(obj, (datetime, date)):
          return obj.isoformat()
      raise TypeError("Type %s not serializable" % type(obj))
  
  
  def secret_key_gen():
      filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt'
      generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits)
                               for _ in range(50)])
      with open(filepath, 'w') as secret_file:
          secret_file.write(
              '%(key)s' % dict(key=generated_key)
          )
  
      print('Find your secret key at %(path)s' % dict(path=filepath))
  
  
  def check_name(name):
      for shl in main.app.shopping_list:
          if shl.get('name') == name:
              return True
      return False
  
  
  def check_item(sname,iname):
      if check_name(sname):
          shl = get_shl(sname)
          items = shl.get('shl').items
          for item in items:
              if item.name == iname:
                  return True
              break
          return False
      return False
  
  
  def get_shl(name):
      for shl in main.app.shopping_list:
          if shl.get('name') == name:
              return shl
  
  
  def get_item(shl_name, item_name):
      shl = get_shl(shl_name)
      items = shl.get('shl').items
      for item in items:
          if item.name == item_name:
              return item
      return False
  
  
  def check_duplicate_item_name(shl_name, item_name):
      for shl in main.app.shopping_list:
          if shl.get('name') == shl_name:
              for item in shl.get('shl').items:
                  if item.name == item_name:
                      return True
  
              return False
  
  
  def change_shl_name(name, new_name):
      for shl in main.app.shopping_list:
          if shl.get('name') == name:
              shl['name'] = new_name
              return True
      return False
  
subject: Add more helper functions