<commit_before>const wegene = require('../../lib/node-wegene').promise;

let config = wegene.configuration;
// config.oAuthAccessToken = '<Replace the access token with one with proper scope>';
config.oAuthAccessToken = '9fe0d2f62cc396df5643e63d3ac78ee1';

let userInfo = {};

async function getUser () {
  try {
    const user = await wegene.User.getUser();
    userInfo = user;
    console.log(`User Info: \n ${JSON.stringify(user)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getSportAdvice () {
  try {
    const advice = await wegene.Sport.getAdvice(userInfo.profiles[0].id, userInfo.profiles[0].sex, 28, 178, 65);
    console.log(`Sport Advice: \n ${JSON.stringify(advice)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getRisk () {
  try {
    const risk = await wegene.Risk.getRisk(userInfo.profiles[0].id, 104);
    console.log(`Hypertension Risk: \n ${JSON.stringify(risk)}`);
  } catch (err) {
    console.log(err);
  }
}

async function test () {
  await getUser();
  await getSportAdvice();
  await getRisk();
}

test();<commit_msg>add example<commit_after>const wegene = require('../../lib/node-wegene').promise;

let config = wegene.configuration;
config.oAuthAccessToken = '<Replace the access token with one with proper scope>';

let userInfo = {};

async function getUser () {
  try {
    const user = await wegene.User.getUser();
    userInfo = user;
    console.log(`User Info: \n ${JSON.stringify(user)}`);
  } catch (err) {
    console.log(err);
  }
}

// { message: 'HTTP Response Not OK', code: 500, response: '' }
async function getSportAdvice () {
  try {
    const advice = await wegene.Sport.getAdvice(userInfo.profiles[0].id, userInfo.profiles[0].sex, 28, 178, 65);
    console.log(`Sport Advice: \n ${JSON.stringify(advice)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getRisk () {
  try {
    const risk = await wegene.Risk.getRisk(userInfo.profiles[0].id, 104);
    console.log(`Hypertension Risk: \n ${JSON.stringify(risk)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getCarrier () {
  try {
    const carrier = await wegene.Health.getCarrier(userInfo.profiles[0].id, 203);
    console.log(`Nijmegen Breakage Syndrome: \n ${JSON.stringify(carrier)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getDrug () {
  try {
    const drug = await wegene.Health.getDrug(userInfo.profiles[0].id, 1462);
    console.log(`Alcohol: \n ${JSON.stringify(drug)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getTraits () {
  try {
    const traits = await wegene.Health.getTraits(userInfo.profiles[0].id, 246);
    console.log(`Sleep time: \n ${JSON.stringify(traits)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getMetabolism () {
  try {
    const metabolism = await wegene.Health.getMetabolism(userInfo.profiles[0].id, 256);
    console.log(`Vitamin-A: \n ${JSON.stringify(metabolism)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getHaplogroups () {
  try {
    const haplogroups = await wegene.Haplogroups.getHaplogroups(userInfo.profiles[0].id);
    console.log(`Haplogroups: \n ${JSON.stringify(haplogroups)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getAthletigen () {
  try {
    const athletigen = await wegene.Athletigen.getAthletigen(userInfo.profiles[0].id, 1487);
    console.log(`Endurance: \n ${JSON.stringify(athletigen)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getAncestry () {
  try {
    const ancestry = await wegene.Ancestry.getAncestry(userInfo.profiles[0].id);
    console.log(`Ancestry: \n ${JSON.stringify(ancestry)}`);
  } catch (err) {
    console.log(err);
  }
}

async function getAllele () {
  try {
    const allele = await wegene.Allele.getAllele(userInfo.profiles[0].id, ['rs182549']);
    console.log(`rs182549 allele: \n ${JSON.stringify(allele)}`);
  } catch (err) {
    console.log(err);
  }
}

async function test () {
  await getUser();
  await getSportAdvice();
  // await getRisk();
  // await getCarrier();
  // await getDrug();
  // await getTraits();
  // await getMetabolism();
  // await getHaplogroups();
  // await getAthletigen();
  // await getAncestry();
  // await getAllele();
}

test();
{'fraction_non_alphanumeric': 0.16756503398172018, 'fraction_numerical': 0.019685962034216076, 'mean_word_length': 3.6340933767643864, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2953908', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1514, 'n_words': 308}