<commit_before><script>
import upperFirst from "lodash/upperFirst";
import camelCase from "lodash/camelCase";
import inflection from "inflection";

export default {
  methods: {
    displayError(response, batchErrors = null) {
      // Method to display error message
      let errorObject = {
        flag: true,
        message: ""
      };
      // PostGraphile errors return status 200 with error message
      if (response.status == 200) {
        // Batch queries
        if (batchErrors) {
          errorObject.message = batchErrors;
        }
        // Single query
        else {
          errorObject.message = response.data.errors[0].message;
        }
      }
      // Nginx errors return a proper error status code
      else {
        errorObject.message = response.bodyText;
      }
      this.$store.commit("setErrorObject", errorObject);
    },
    statusCssClass(status) {
      let cssClass;
      if (status == 'Pending') {
        cssClass = 'badge-secondary';
      } else if(status == 'Running') {
        cssClass = 'badge-info';
      } else if(status == 'Success') {
        cssClass = 'badge-success';
      } else if (status == 'Failed') {
        cssClass = 'badge-danger';
      } else if (status == 'Killed') {
        cssClass = 'badge-light';
      }
      return cssClass;
    },
    getGraphQlName(name, number = null, setUpperFirst = false) {
      // Method to compute GraphQL queries, mutations and fields names based on tables and columns names
      // Use case is to transform the input: my_list
      // In an output such as: allMyLists, myListById, etc...

      // Apply number
      if (number == "singular") {
        name = inflection.singularize(name); // Example: my_lists > my_list
      } else if (number == "plural") {
        name = inflection.pluralize(name); // Example: my_list > my_lists
      }

      // Camel case
      name = camelCase(name);

      // Upper case first letter
      if (setUpperFirst == true) {
        name = upperFirst(name);
      }

      return name;
    }
  }
};
</script>
<commit_msg>Remove unused method<commit_after><script>
export default {
  methods: {
    displayError(response, batchErrors = null) {
      // Method to display error message
      let errorObject = {
        flag: true,
        message: ""
      };
      // PostGraphile errors return status 200 with error message
      if (response.status == 200) {
        // Batch queries
        if (batchErrors) {
          errorObject.message = batchErrors;
        }
        // Single query
        else {
          errorObject.message = response.data.errors[0].message;
        }
      }
      // Nginx errors return a proper error status code
      else {
        errorObject.message = response.bodyText;
      }
      this.$store.commit("setErrorObject", errorObject);
    },
    statusCssClass(status) {
      let cssClass;
      if (status == "Pending") {
        cssClass = "badge-secondary";
      } else if (status == "Running") {
        cssClass = "badge-info";
      } else if (status == "Success") {
        cssClass = "badge-success";
      } else if (status == "Failed") {
        cssClass = "badge-danger";
      } else if (status == "Killed") {
        cssClass = "badge-light";
      }
      return cssClass;
    }
  }
};
</script>

{'fraction_non_alphanumeric': 0.11787878787878787, 'fraction_numerical': 0.004242424242424243, 'mean_word_length': 2.017367458866545, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2965100', 'n_tokens_mistral': 959, 'n_tokens_neox': 932, 'n_words': 256}