<commit_before>import request from "superagent";

export function searchBookmarks(searchPhrase) {
  console.log(request);
  request.get('http://localhost:8089/api/bookmarks/search?q=tutorial', function(err, res){
  if (err) throw err;
  console.log(res.text);
});


  return new Promise(function(resolve, reject) {
    resolve([{
      id: 0,
      title: "title0",
      tags: ["tag0"]
    }, {
      id: 1,
      title: "title1",
      tags: ["tag1"]
    }, {
      id: 2,
      title: "title2",
      tags: ["tag2"]
    }, {
      id: 3,
      title: "title3",
      tags: ["tag3"]
    }].filter(b => b.title === searchPhrase));
  });
}

export function addBookmark(url) {
  return new Promise(function(resolve, reject) {
    resolve({
      id: 10,
      title: "title10",
      tags: ["tag10"]
    })<commit_msg>add superagent-promise<commit_after>import request from "superagent";
import sp from "superagent-promise";

let agent = sp(request, Promise);
export function searchBookmarks(searchPhrase) {

  let t = agent.get("http://localhost:8089/api/bookmarks/search?q=tutorial").end();

  t.then(r => console.log(r));

  return new Promise(function(resolve, reject) {
    resolve([{
      id: 0,
      title: "title0",
      tags: ["tag0"]
    }, {
      id: 1,
      title: "title1",
      tags: ["tag1"]
    }, {
      id: 2,
      title: "title2",
      tags: ["tag2"]
    }, {
      id: 3,
      title: "title3",
      tags: ["tag3"]
    }].filter(b => b.title === searchPhrase));
  });
}

export function addBookmark(url) {
  return new Promise(function(resolve, reject) {
    resolve({
      id: 10,
      title: "title10",
      tags: ["tag10"]
    })
{'fraction_non_alphanumeric': 0.17487980769230768, 'fraction_numerical': 0.026442307692307692, 'mean_word_length': 2.659340659340659, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2104318', 'n_tokens_mistral': 602, 'n_tokens_neox': 570, 'n_words': 129}