def item_google_product_category(item, category_paths):
 category = item.product.get_first_category()
 if category:
  if (category.pk in category_paths):
   return category_paths[category.pk]
  ancestors = [ancestor.name for ancestor in list(category.get_ancestors())]
  category_path = CATEGORY_SEPARATOR.join((ancestors + [category.name]))
  category_paths[category.pk] = category_path
  return category_path
 else:
  return u''

def item_google_product_category ( item , category_paths ) : category = item . product . get_first_category ( ) if category : if ( category . pk in category_paths ) : return category_paths [ category . pk ] ancestors = [ ancestor . name for ancestor in list ( category . get_ancestors ( ) ) ] category_path = CATEGORY_SEPARATOR . join ( ( ancestors + [ category . name ] ) ) category_paths [ category . pk ] = category_path return category_path else : return u''
to have your categories accepted .