def _get_block_count_url_string(xblock_type_set):
 block_url = ''
 if (len(xblock_type_set) > 0):
  block_url += '&all_blocks=true&block_counts='
  for (index, block_type) in enumerate(xblock_type_set):
   block_url += block_type
   if (index < (len(xblock_type_set) - 1)):
    block_url += ','
 return block_url

def _get_block_count_url_string ( xblock_type_set ) : block_url = '' if ( len ( xblock_type_set ) > 0 ) : block_url += '&all_blocks=true&block_counts=' for ( index , block_type ) in enumerate ( xblock_type_set ) : block_url += block_type if ( index < ( len ( xblock_type_set ) - 1 ) ) : block_url += ',' return block_url
build the string from the xblock type set to append to the block url for block_count types arguments: xblock_type_set : a set of strings for all the block types returns: str: the portion to append to the block url .