def get_icon_url(base_url_format, obj, size, default_format='default-{size}.png'):
 if (not obj.icon_type):
  return '{path}/{name}'.format(path=static_url('ICONS_DEFAULT_URL'), name=default_format.format(size=size))
 else:
  suffix = (obj.icon_hash or 'never')
  if storage_is_remote():
   path = ('%s/%s-%s.png' % (obj.get_icon_dir(), obj.pk, size))
   return ('%s?modified=%s' % (public_storage.url(path), suffix))
  split_id = re.match('((\\d*?)\\d{1,3})$', str(obj.pk))
  return (base_url_format % ((split_id.group(2) or 0), obj.pk, size, suffix))

def get_icon_url ( base_url_format , obj , size , default_format = 'default-{size}.png' ) : if ( not obj . icon_type ) : return '{path}/{name}' . format ( path = static_url ( 'ICONS_DEFAULT_URL' ) , name = default_format . format ( size = size ) ) else : suffix = ( obj . icon_hash or 'never' ) if storage_is_remote ( ) : path = ( '%s/%s-%s.png' % ( obj . get_icon_dir ( ) , obj . pk , size ) ) return ( '%s?modified=%s' % ( public_storage . url ( path ) , suffix ) ) split_id = re . match ( '((\\d*?)\\d{1,3})$' , str ( obj . pk ) ) return ( base_url_format % ( ( split_id . group ( 2 ) or 0 ) , obj . pk , size , suffix ) )
returns either the icon url for a given .