<commit_before>var computed = require('mutant/computed')
var nest = require('depnest')

exports.needs = nest({
  'keys.sync.id': 'first',
  'contact.obs': {
    followers: 'first',
    following: 'first',
    blockers: 'first'
  }
})

exports.gives = nest('profile.obs.contact')

exports.create = function (api) {
  return nest('profile.obs.contact', function (id) {
    var yourId = api.keys.sync.id()
    var yourFollowing = api.contact.obs.following(yourId)
    var yourFollowers = api.contact.obs.followers(yourId)

    var followers = api.contact.obs.followers(id)
    var following = api.contact.obs.following(id)
    var sync = computed([followers.sync, following.sync], (...x) => x.every(Boolean))

    var blockers = api.contact.obs.blockers(id)
    var youBlock = computed(blockers, function (blockers) {
      return blockers.includes(yourId)
    })

    var youFollow = computed([yourFollowing], function (yourFollowing) {
      return yourFollowing.includes(id)
    })

    var yourFriends = computed([yourFollowers, yourFollowing], inAllSets)

    var blockingFriends = computed([yourFollowers, yourFollowing, blockers], inAllSets)
    var mutualFriends = computed([yourFollowers, yourFollowing, followers, following], inAllSets)
    var outgoingVia = computed([yourFollowers, following], inAllSets)
    var incomingVia = computed([yourFollowing, followers], inAllSets)

    var hasOutgoing = computed([yourFollowers, following], (a, b) => {
      return a.some((id) => b.includes(id))
    })
    var hasIncoming = computed([followers, yourFollowing], (a, b) => {
      return a.some((id) => b.includes(id))
    })

    var isYou = computed([yourId, id], (a, b) => a === b)

    var isNotFollowingAnybody = computed([following, following.sync], (following, sync) => {
      return sync && (!following || !following.length)
    })

    var hasNoFollowers = computed(followers, followersList => {
      return !followersList || !followersList.length
    })

    return {
      followers,
      following,<commit_msg>Only show the 'no followers' warning if indexing has finished.<commit_after>var computed = require('mutant/computed')
var nest = require('depnest')

exports.needs = nest({
  'keys.sync.id': 'first',
  'contact.obs': {
    followers: 'first',
    following: 'first',
    blockers: 'first'
  }
})

exports.gives = nest('profile.obs.contact')

exports.create = function (api) {
  return nest('profile.obs.contact', function (id) {
    var yourId = api.keys.sync.id()
    var yourFollowing = api.contact.obs.following(yourId)
    var yourFollowers = api.contact.obs.followers(yourId)

    var followers = api.contact.obs.followers(id)
    var following = api.contact.obs.following(id)
    var sync = computed([followers.sync, following.sync], (...x) => x.every(Boolean))

    var blockers = api.contact.obs.blockers(id)
    var youBlock = computed(blockers, function (blockers) {
      return blockers.includes(yourId)
    })

    var youFollow = computed([yourFollowing], function (yourFollowing) {
      return yourFollowing.includes(id)
    })

    var yourFriends = computed([yourFollowers, yourFollowing], inAllSets)

    var blockingFriends = computed([yourFollowers, yourFollowing, blockers], inAllSets)
    var mutualFriends = computed([yourFollowers, yourFollowing, followers, following], inAllSets)
    var outgoingVia = computed([yourFollowers, following], inAllSets)
    var incomingVia = computed([yourFollowing, followers], inAllSets)

    var hasOutgoing = computed([yourFollowers, following], (a, b) => {
      return a.some((id) => b.includes(id))
    })
    var hasIncoming = computed([followers, yourFollowing], (a, b) => {
      return a.some((id) => b.includes(id))
    })

    var isYou = computed([yourId, id], (a, b) => a === b)

    var isNotFollowingAnybody = computed([following, following.sync], (following, sync) => {
      return sync && (!following || !following.length)
    })

    var hasNoFollowers = computed(followers, followersList => {
      return sync && (!followersList || !followersList.length)
    })

    return {
      followers,
      following,
{'fraction_non_alphanumeric': 0.14119076549210208, 'fraction_numerical': 0.0, 'mean_word_length': 3.8253223915592027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '7125142', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1224, 'n_words': 285}