<commit_before>import { cloneDeep, pick } from 'lodash'
import { get } from 'lodash/fp'
import qs from 'querystring'
import { cleanAndStringify } from '../util/caching'
import { tagsInText } from '../models/hashtag'
import {
  CANCEL_POST_EDIT,
  CHANGE_EVENT_RESPONSE,
  COMPLETE_POST,
  CREATE_POST,
  FETCH_LINK_PREVIEW,
  FETCH_POST,
  FOLLOW_POST,
  PIN_POST,
  REMOVE_DOC,
  REMOVE_IMAGE,
  REMOVE_POST,
  START_POST_EDIT,
  UNFOLLOW_POST,
  UPDATE_POST,
  UPDATE_POST_EDITOR,
  UPDATE_POST_READ_TIME,
  VOTE_ON_POST
} from './index'

// id refers to the id of the editing context, e.g. 'new-event'
export function createPost (id, params, slug) {
  return {
    type: CREATE_POST,
    payload: {api: true, params, path: '/noo/post', method: 'POST'},
    meta: {
      id,
      tags: tagsInText(params.description),
      createdTags: params.tagDescriptions,
      optimistic: true,
      slug
    }
  }
}

export function fetchPost (id) {
  let querystring = cleanAndStringify({comments: 1, votes: 1, children: 1})

  return {<commit_msg>add the option to fetch a post without comments, votes, etc.<commit_after>import { cloneDeep, pick } from 'lodash'
import { get } from 'lodash/fp'
import qs from 'querystring'
import { cleanAndStringify } from '../util/caching'
import { tagsInText } from '../models/hashtag'
import {
  CANCEL_POST_EDIT,
  CHANGE_EVENT_RESPONSE,
  COMPLETE_POST,
  CREATE_POST,
  FETCH_LINK_PREVIEW,
  FETCH_POST,
  FOLLOW_POST,
  PIN_POST,
  REMOVE_DOC,
  REMOVE_IMAGE,
  REMOVE_POST,
  START_POST_EDIT,
  UNFOLLOW_POST,
  UPDATE_POST,
  UPDATE_POST_EDITOR,
  UPDATE_POST_READ_TIME,
  VOTE_ON_POST
} from './index'

// id refers to the id of the editing context, e.g. 'new-event'
export function createPost (id, params, slug) {
  return {
    type: CREATE_POST,
    payload: {api: true, params, path: '/noo/post', method: 'POST'},
    meta: {
      id,
      tags: tagsInText(params.description),
      createdTags: params.tagDescriptions,
      optimistic: true,
      slug
    }
  }
}

export function fetchPost (id, opts = {}) {
  let querystring = opts.minimal ? ''
    : cleanAndStringify({comments: 1, votes: 1, children: 1})

  return {
{'fraction_non_alphanumeric': 0.11141804788213629, 'fraction_numerical': 0.0027624309392265192, 'mean_word_length': 3.663090128755365, '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': '6397331', 'n_tokens_mistral': 829, 'n_tokens_neox': 776, 'n_words': 194}