code: def type_name(cls):
          
          if cls.__type_name__:
              type_name = cls.__type_name__.lower()
          else:
              camelcase = re.compile(r'([a-z])([A-Z])')
              ccase = lambda s: camelcase.sub(lambda v: '{0}_{1}'.format(v.group(1), v.group(2)), s)
  
              type_name = ccase(cls.__name__)
              # trim to less than 48 characters or cassandra will complain
              type_name = type_name[-48:]
              type_name = type_name.lower()
              type_name = re.sub(r'^_+', '', type_name)
              cls.__type_name__ = type_name
  
          return type_name
docs: Returns the type name if it's been defined
          otherwise, it creates it from the class name