<commit_before>var postRelations = (userId, opts) => _.filter([
  {creator: qb => qb.column('id', 'name', 'avatar_url')},
  {communities: qb => qb.column('community.id', 'name', 'slug', 'avatar_url')},
  'contributions',
  {'contributions.user': qb => qb.column('id', 'name', 'avatar_url')},
  'followers',
  {'followers.user': qb => qb.column('id', 'name', 'avatar_url')},
  {media: qb => qb.column('id', 'post_id', 'url')},
  (opts && opts.fromProject ? null : {projects: qb => qb.column('projects.id', 'title', 'slug')}),
  {votes: qb => { // only the user's own vote
    qb.column('id', 'post_id')
    qb.where('user_id', userId)
  }},
  {relatedUsers: qb => qb.column('users.id', 'name', 'avatar_url')}
], x => !!x)

var postAttributes = post => {
  var creator = post.relations.creator

  return _.extend(
    _.pick(post.toJSON(), [
      'id',
      'name',
      'description',
      'fulfilled_at',
      'media',
      'type',
      'created_at',
      'updated_at',
      'projects',
      'similarity'
    ]),
    {
      community: post.relations.communities.first().pick('id', 'name', 'slug', 'avatar_url'),
      communities: post.relations.communities.map(c => c.pick('id', 'name', 'slug', 'avatar_url')),
      contributors: post.relations.contributions.map(c => c.relations.user.pick('id', 'name', 'avatar_url')),
      followers: post.relations.followers.map(f => f.relations.user.pick('id', 'name', 'avatar_url')),
      hasMedia: post.related('media').length > 0,
      myVote: post.relations.votes.length > 0,
      numComments: post.get('num_comments'),
      votes: post.get('num_votes'),<commit_msg>remove post.community in API response<commit_after>var postRelations = (userId, opts) => _.filter([
  {creator: qb => qb.column('id', 'name', 'avatar_url')},
  {communities: qb => qb.column('community.id', 'name', 'slug', 'avatar_url')},
  'contributions',
  {'contributions.user': qb => qb.column('id', 'name', 'avatar_url')},
  'followers',
  {'followers.user': qb => qb.column('id', 'name', 'avatar_url')},
  {media: qb => qb.column('id', 'post_id', 'url')},
  (opts && opts.fromProject ? null : {projects: qb => qb.column('projects.id', 'title', 'slug')}),
  {votes: qb => { // only the user's own vote
    qb.column('id', 'post_id')
    qb.where('user_id', userId)
  }},
  {relatedUsers: qb => qb.column('users.id', 'name', 'avatar_url')}
], x => !!x)

var postAttributes = post => {
  var creator = post.relations.creator

  return _.extend(
    _.pick(post.toJSON(), [
      'id',
      'name',
      'description',
      'fulfilled_at',
      'media',
      'type',
      'created_at',
      'updated_at',
      'projects',
      'similarity'
    ]),
    {
      communities: post.relations.communities.map(c => c.pick('id', 'name', 'slug', 'avatar_url')),
      contributors: post.relations.contributions.map(c => c.relations.user.pick('id', 'name', 'avatar_url')),
      followers: post.relations.followers.map(f => f.relations.user.pick('id', 'name', 'avatar_url')),
      hasMedia: post.related('media').length > 0,
      myVote: post.relations.votes.length > 0,
      numComments: post.get('num_comments'),
      votes: post.get('num_votes'),
{'fraction_non_alphanumeric': 0.21572327044025158, 'fraction_numerical': 0.0012578616352201257, 'mean_word_length': 3.6848306332842413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '6062589', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1158, 'n_words': 216}