<commit_before>@Api =
  groups_path: "/api/:version/groups.json"
  group_path: "/api/:version/groups/:id.json"
  namespaces_path: "/api/:version/namespaces.json"
  group_projects_path: "/api/:version/groups/:id/projects.json"
  projects_path: "/api/:version/projects.json"
  labels_path: "/api/:version/projects/:id/labels"
  issues_paths:
    update : "/api/:version/projects/:id/issues/:issue_id"
  merge_request_path: "/api/:version/issues/:id.json"
  milestones_paths:
    index: "/api/:version/projects/:id/milestones"

  milestones:
    index: (project_id, callback) ->
      data = {}
      url = Api.buildUrl(Api.milestones_paths.index)
      url = url
              .replace(":id", project_id)
      data.private_token = gon.api_token
      $.ajax(
        url: url
        type: "GET"
        data: data
        dataType: "json"
      ).done (milestones) ->
        if callback?
          callback(milestones)

  issues: 
    update: (project_id, issue_id, data, callback) ->
      url = Api.buildUrl(Api.issues_paths.update)
      url = url
              .replace(":id", project_id)
              .replace(":issue_id", issue_id)
      if not data?
        data = {}
      data.private_token = gon.api_token
      $.ajax(
        url: url
        type: "PUT"
        data: data
        dataType: "json"
      ).done (issue) ->
        if callback?
          callback(issue)

  group: (group_id, callback) ->
    url = Api.buildUrl(Api.group_path)
    url = url.replace(':id', group_id)

    $.ajax(
      url: url
      data:
        private_token: gon.api_token
      dataType: "json"
    ).done (group) ->
      callback(group)

  # Return groups list. Filtered by query
  # Only active groups retrieved
  groups: (query, skip_ldap, callback) ->
    url = Api.buildUrl(Api.groups_path)

    $.ajax(
      url: url
      data:
        private_token: gon.api_token<commit_msg>Remove api calls from api.js.coffee. Using respond to instead<commit_after>@Api =
  groups_path: "/api/:version/groups.json"
  group_path: "/api/:version/groups/:id.json"
  namespaces_path: "/api/:version/namespaces.json"
  group_projects_path: "/api/:version/groups/:id/projects.json"
  projects_path: "/api/:version/projects.json"
  labels_path: "/api/:version/projects/:id/labels"

  group: (group_id, callback) ->
    url = Api.buildUrl(Api.group_path)
    url = url.replace(':id', group_id)

    $.ajax(
      url: url
      data:
        private_token: gon.api_token
      dataType: "json"
    ).done (group) ->
      callback(group)

  # Return groups list. Filtered by query
  # Only active groups retrieved
  groups: (query, skip_ldap, callback) ->
    url = Api.buildUrl(Api.groups_path)

    $.ajax(
      url: url
      data:
        private_token: gon.api_token
{'fraction_non_alphanumeric': 0.13731884057971014, 'fraction_numerical': 0.0, 'mean_word_length': 2.486111111111111, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 13, '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': '4921224', 'n_tokens_mistral': 920, 'n_tokens_neox': 926, 'n_words': 184}