<commit_before>from core import database as database
from core.exceptions import NotFoundError, ServerError
from core.markdown import MarkdownParser
from core.article_helpers import get_article
import core.functions
import yaml

def get_page_data(path, get, post, variables):
  article = get_article(get.get('name', ''))

  if not article:
    raise NotFoundError("No article with name: '{}'".format(get.get('name', '')))
  
  markdownParser = MarkdownParser('blog/%s/' % (article.get('name')))
  raw_articule = article['body']
  article['body'] = markdownParser.render(article['body'])

  return {
    'article': article,
    'title': article.get('title', ''),
    'raw_article': raw_articule
  }

def get_possible_paths():
  articles = database.Table('article').filter()
  queries = []

  for article in articles: 
    queries.append('blog/%s' % article.get('name'))

  return queries
  <commit_msg>update code which generates list of possible article names<commit_after>from core import database as database
from core.exceptions import NotFoundError, ServerError
from core.markdown import MarkdownParser
from core.article_helpers import get_article, get_all_articles
import core.functions
import yaml

def get_page_data(path, get, post, variables):
  article = get_article(get.get('name', ''))

  if not article:
    raise NotFoundError("No article with name: '{}'".format(get.get('name', '')))
  
  markdownParser = MarkdownParser('blog/%s/' % (article.get('name')))
  raw_articule = article['body']
  article['body'] = markdownParser.render(article['body'])

  return {
    'article': article,
    'title': article.get('title', ''),
    'raw_article': raw_articule
  }

def get_possible_paths():
  articles = get_all_articles()
  queries = []

  for article in articles: 
    queries.append('blog/%s' % article.get('name'))

  return queries
  
{'fraction_non_alphanumeric': 0.1368307193077339, 'fraction_numerical': 0.0, 'mean_word_length': 4.967741935483871, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5543551', 'n_tokens_mistral': 567, 'n_tokens_neox': 550, 'n_words': 141}