<commit_before>/**
* Call for resizing TC2000 charts
*/
$(function () {
  setIFrameSize();
  $(window).resize(function () {
    setIFrameSize();
  });
});

/**
Resizes the iframe for TC2000 charts
*/
function setIFrameSize() {
  var ogWidth = 700;
  var ogHeight = 600;
  var ogRatio = ogWidth / ogHeight;

  var windowWidth = $(window).width();
  if (windowWidth < 480) {
    var parentDivWidth = $(".iframe-class").parent().width();
    var newHeight = (parentDivWidth / ogRatio);
    $(".iframe-class").addClass("iframe-class-resize");
    $(".iframe-class-resize").css("width", parentDivWidth);
    $(".iframe-class-resize").css("height", newHeight);
  } else {
    $(".iframe-class").removeClass("iframe-class-resize");
  }
}<commit_msg>Adding in fetcher for openPositions<commit_after>// require
var _ = require('lodash');

/**
* Call for resizing TC2000 charts
*/
$(function () {
    setIFrameSize();
    $(window).resize(function () {
        setIFrameSize();
    });
});

/**
Resizes the iframe for TC2000 charts
*/
function setIFrameSize() {
    var ogWidth = 700;
    var ogHeight = 600;
    var ogRatio = ogWidth / ogHeight;

    var windowWidth = $(window).width();
    if (windowWidth < 480) {
        var parentDivWidth = $(".iframe-class").parent().width();
        var newHeight = (parentDivWidth / ogRatio);
        $(".iframe-class").addClass("iframe-class-resize");
        $(".iframe-class-resize").css("width", parentDivWidth);
        $(".iframe-class-resize").css("height", newHeight);
    } else {
        $(".iframe-class").removeClass("iframe-class-resize");
    }
}


/**
* Data for testing
*/
let openArr = [
  {ticker: "AAPL",
  buyPrice: 10,
  buyDate: 'Sep 23 2014',
  numShares, 200},

  {ticker: "GS",
  buyPrice: 14,
  buyDate: 'Oct 2 2012',
  numShares, 200},

  {ticker: "JPM",
  buyPrice: 10,
  buyDate: 'May 3 2014',
  numShares, 200},

  {ticker: "AMZN",
  buyPrice: 10,
  buyDate: 'Jun 16 2014',
  numShares, 200}
]

/**
* Constants
*/
let openPositions = [];
let symbols = [];
let FIELDS =

/**
* Constructor
*/
var Position = function(ticker, buyPrice, buyDate, numShares) {
  this.ticker = ticker,
  this.buyPrice = buyPrice,
  this.buyDate = buyDate,
  this.numShares = numShares
}

_.each(openArr, function(stock) {
    let newPos = new Position(stock.ticker, stock.buyPrice, stock.buyDate, stock.numShares)
    openPositions.push(newPos);
    symbols.push(newPos.ticker);
})

yahooFinance.snapshot({
  fields: FIELDS,
  symbols: SYMBOLS
}).then(function (result) {
  _.each(result, function (snapshot, symbol) {
    // console.log(util.format('=== %s ===', symbol).cyan);
    console.log("\n#########################\n");
    console.log(JSON.stringify(snapshot, null, 2));
  });
});


for (let i = 0; i < openTickers.length; i++) {
  let newPosition = new Position(openTickers[i.])
}
{'fraction_non_alphanumeric': 0.18862592723419286, 'fraction_numerical': 0.02755210173083716, 'mean_word_length': 3.5023847376788555, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '7618918', 'n_tokens_mistral': 1063, 'n_tokens_neox': 959, 'n_words': 210}