def make_content(directory, categories, count=5, categories_per_content=1):
 new_content = defaultdict(list)
 for _ in range(count):
  title = get_random_text_and_whitespace()
  category_choice = random.sample(categories, categories_per_content)
  categories_string = ', '.join(category_choice)
  output = TEMP_PAGE_TEMPLATE.format(title=title, category=categories_string)
  with tempfile.NamedTemporaryFile(dir=directory, mode='w', suffix='.md', delete=False) as tmp:
   tmp.write(output)
   path = os.path.join(directory, tmp.name)
  for each_cat in category_choice:
   new_content[(cc.substitute_category_name(each_cat), each_cat)].append(Content(title, path, categories_string))
 return new_content

def make_content ( directory , categories , count = 5 , categories_per_content = 1 ) : new_content = defaultdict ( list ) for _ in range ( count ) : title = get_random_text_and_whitespace ( ) category_choice = random . sample ( categories , categories_per_content ) categories_string = ', ' . join ( category_choice ) output = TEMP_PAGE_TEMPLATE . format ( title = title , category = categories_string ) with tempfile . NamedTemporaryFile ( dir = directory , mode = 'w' , suffix = '.md' , delete = False ) as tmp : tmp . write ( output ) path = os . path . join ( directory , tmp . name ) for each_cat in category_choice : new_content [ ( cc . substitute_category_name ( each_cat ) , each_cat ) ] . append ( Content ( title , path , categories_string ) ) return new_content
make_content --> {: articles .