text: from django import template
  
  import random
  from models.models import *
  from authentication.models import *
  
  register = template.Library()
  
  @register.simple_tag
  def eval_string(value):
    return eval(value)
  
  @register.simple_tag 
  def concat_prefix_and_surfix(prefix, value, surfix):
    return prefix+value+surfix
    
  @register.simple_tag
  def replace_string(string, replace, value):
    return string.replace(replace, value)
  
  @register.filter
  def includes(string, value):
    return string.find(value) > 0
  
  @register.simple_tag
  def randomNumber():
    return random.randint(0, 100000)
  
  @register.simple_tag
  def playlist_exist(request, id):
    if request.user.is_authenticated:
      try:
        my_library = MyLibrary.objects.get(user=request.user)
        return my_library.playlists.filter(collection__id=id).exists
      except:
        return False
    else:
      return False
  
  from core import const
  
  @register.simple_tag
  def get_genres():
    return const.GENRES
  
  @register.simple_tag
  def get_moods():
    return const.MOODS
  
  @register.simple_tag
  def is_following(request_user, user):
    return request_user.following.filter(id=user.id).exists()
  
  @register.simple_tag
  def random_color():
    colors = ["0d6efd", "6610f2", "6f42c1", "d63384", "198754", "0dcaf0", "20c997", "dc3545", "ffc107"]
    return "#{}".format(colors[random.randint(0, len(colors) -1)])
  
  @register.simple_tag
  def mul_calc(a, b):
    return a * b
  
  @register.simple_tag
  def get_plan_id(plan):
    return list(filter(lambda subscription: subscription[0] == verification["data"]["plan"], const.SUBSCRIPTIONS))[0][0]
  
  @register.simple_tag
  def set_plan(request, plan):
    kyc = request.user.kyc
    kyc.plans = plan
    kyc.save()