def get_resource_title(resource, is_list, append_resource=True):
 if hasattr(resource, 'verbose_name'):
  normalized_title = resource.verbose_name
 else:
  class_name = resource.__class__.__name__
  class_name = class_name.replace('Resource', '')
  normalized_title = title(uncamelcase(class_name, ' '))
 if is_list:
  s = ('%s List' % normalized_title)
 else:
  s = normalized_title
 if append_resource:
  s += ' Resource'
 return s

def get_resource_title ( resource , is_list , append_resource = True ) : if hasattr ( resource , 'verbose_name' ) : normalized_title = resource . verbose_name else : class_name = resource . __class__ . __name__ class_name = class_name . replace ( 'Resource' , '' ) normalized_title = title ( uncamelcase ( class_name , ' ' ) ) if is_list : s = ( '%s List' % normalized_title ) else : s = normalized_title if append_resource : s += ' Resource' return s
returns a human-readable name for the resource .