<commit_before>var fs = require('fs');
var process = require('process');
var ReadStream = require('tty').ReadStream;

var _fs = process.binding('fs');
var _constants = process.binding('constants');
var _TTY = process.binding('tty_wrap').TTY;

module.exports = openTTY;

var rs = null;

function openTTY() {
    var fd;

    if (rs && rs.isTTY) {
        return rs;
    }

    if (process.platform === 'win32') {
        fd = _fs.open('CONIN$', _constants.O_RDWR, 438);
    } else {
        fd = fs.openSync('/dev/tty', 'r');
    }

    if (!fd) {
        throw new Error('Cannot access console input buffer');
    }
<commit_msg>removed invalid fd error<commit_after>var fs = require('fs');
var process = require('process');
var ReadStream = require('tty').ReadStream;

var _fs = process.binding('fs');
var _constants = process.binding('constants');
var _TTY = process.binding('tty_wrap').TTY;

module.exports = openTTY;

var rs = null;

function openTTY() {
    var fd;

    if (rs && rs.isTTY) {
        return rs;
    }

    if (process.platform === 'win32') {
        fd = _fs.open('CONIN$', _constants.O_RDWR, 438);
    } else {
        fd = fs.openSync('/dev/tty', 'r');
    }

{'fraction_non_alphanumeric': 0.17089678510998307, 'fraction_numerical': 0.008460236886632826, 'mean_word_length': 3.079310344827586, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2024829', 'n_tokens_mistral': 413, 'n_tokens_neox': 406, 'n_words': 98}