def get_promo_img_url(base_url_format, obj, size, default_format='default-{size}.png'):
 split_id = re.match('((\\d*?)\\d{1,3})$', str(obj.pk))
 suffix = (obj.promo_img_hash or 'never')
 return (base_url_format % ((split_id.group(2) or 0), obj.pk, size, suffix))

def get_promo_img_url ( base_url_format , obj , size , default_format = 'default-{size}.png' ) : split_id = re . match ( '((\\d*?)\\d{1,3})$' , str ( obj . pk ) ) suffix = ( obj . promo_img_hash or 'never' ) return ( base_url_format % ( ( split_id . group ( 2 ) or 0 ) , obj . pk , size , suffix ) )
returns either the promo img url for a given .