<commit_before>import axios from 'axios'
import {
  GET_GUILDS,
  SET_ACTIVE_GUILD,
  EDIT_GUILD,
} from '../constants/actions/guilds'
import { fetchGuildChannels } from './channels'
import { fetchGuildRoles } from './roles'
import { fetchGuildFeeds } from './feeds'
import { fetchGuildFailRecords } from './failRecords'
import FetchStatusActions from './utils/FetchStatusActions'

export const {
  begin: setGuildsBegin,
  success: setGuildsSuccess,
  failure: setGuildsFailure
} = new FetchStatusActions(GET_GUILDS)

export const {
  begin: editGuildBegin,
  success: editGuildSuccess,
  failure: editGuildFailure
} = new FetchStatusActions(EDIT_GUILD)

export function fetchGuilds () {
  return async dispatch => {
    try {
      dispatch(setGuildsBegin())
      const { data } = await axios.get(`/api/users/@me/guilds`)
      dispatch(setGuildsSuccess(data))
    } catch (err) {
      dispatch(setGuildsFailure(err))
    }
  }
}

export function fetchEditGuild (guildID, data) {
  return async dispatch => {
    try {
      dispatch(editGuildBegin())
      const { data } = await axios.patch(`/api/guilds/${guildID}`, data)
      dispatch(editGuildSuccess(data))
    } catch (err) {
      dispatch(editGuildFailure(err))
    }
  }
}

export function setActiveGuild (guildID) {
  return async dispatch => {
    dispatch({
      type: SET_ACTIVE_GUILD,
      payload: guildID
    })
    await dispatch(fetchGuildChannels(guildID))
    await dispatch(fetchGuildRoles(guildID))
    await dispatch(fetchGuildFeeds(guildID))
    await dispatch(fetchGuildFailRecords(guildID))
  }
}
<commit_msg>Fix variable naming conflict for fetch edit guild<commit_after>import axios from 'axios'
import {
  GET_GUILDS,
  SET_ACTIVE_GUILD,
  EDIT_GUILD,
} from '../constants/actions/guilds'
import { fetchGuildChannels } from './channels'
import { fetchGuildRoles } from './roles'
import { fetchGuildFeeds } from './feeds'
import { fetchGuildFailRecords } from './failRecords'
import FetchStatusActions from './utils/FetchStatusActions'

export const {
  begin: setGuildsBegin,
  success: setGuildsSuccess,
  failure: setGuildsFailure
} = new FetchStatusActions(GET_GUILDS)

export const {
  begin: editGuildBegin,
  success: editGuildSuccess,
  failure: editGuildFailure
} = new FetchStatusActions(EDIT_GUILD)

export function fetchGuilds () {
  return async dispatch => {
    try {
      dispatch(setGuildsBegin())
      const { data } = await axios.get(`/api/users/@me/guilds`)
      dispatch(setGuildsSuccess(data))
    } catch (err) {
      dispatch(setGuildsFailure(err))
    }
  }
}

export function fetchEditGuild (guildID, edited) {
  return async dispatch => {
    try {
      dispatch(editGuildBegin())
      const { data } = await axios.patch(`/api/guilds/${guildID}`, edited)
      dispatch(editGuildSuccess(data))
    } catch (err) {
      dispatch(editGuildFailure(err))
    }
  }
}

export function setActiveGuild (guildID) {
  return async dispatch => {
    dispatch({
      type: SET_ACTIVE_GUILD,
      payload: guildID
    })
    await dispatch(fetchGuildChannels(guildID))
    await dispatch(fetchGuildRoles(guildID))
    await dispatch(fetchGuildFeeds(guildID))
    await dispatch(fetchGuildFailRecords(guildID))
  }
}

{'fraction_non_alphanumeric': 0.11035337879727217, 'fraction_numerical': 0.0, 'mean_word_length': 3.9799382716049383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4319003', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1073, 'n_words': 217}