<commit_before>var HTTPClient = require('http-client'),
    client = new HTTPClient(),
    url = require('url'),
    Vow = require('vow'),
    inherit = require('inherit');

var Model = module.exports = inherit(/** @lends Model.prototype */ {
    __constructor: function (token) {
        this._token = token;
        this._methods = [ 'get', 'getPreview', 'put', 'cp', 'mv', 'rm', 'ls', 'mkdir', 'chmod', 'id', 'df' ];
    },
    get: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'GET',
            headers: this.getHeaders()
        });
    },
    getPreview: function (options) {
        return this._send({
            url: this.getUrl(options.path + '?preview'),
            method: 'GET',
            data: {
                size: options.size || 'M'
            },
            headers: this.getHeaders()
        });
    },
    put: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'PUT',
            data: options.file,
            headers: this.getHeaders({
                'Content-Type': 'application/' + options.type || 'binary'
            })
        });
    },
    cp: function (options) {
        return this._send({
            url: this.getUrl(options.source),
            method: 'COPY',
            headers: this.getHeaders({
                Destination: url.resolve('/', options.target)
            })
        });
    },
    mv: function (options) {
        return this._send({
            url: this.getUrl(options.source),
            method: 'MOVE',
            headers: this.getHeaders({
                Destination: url.resolve('/', options.target)
            })
        });
    },
    rm: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'DELETE',
            headers: this.getHeaders()
        });
    },
    mkdir: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'MKCOL',
            headers: this.getHeaders()
        });
    },
    ls: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            data: options,
            method: 'PROPFIND',
            headers: this.getHeaders({
                Depth: '1'
            })
        });
    },
    id: function () {
        return this._send({
            url: this.getUrl('?userinfo'),
            method: 'GET',
            headers: this.getHeaders()
        });
    },
    chmod: function (options) {
        var modes = {
                'a+r': [
                    '<set>',
                        '<prop>',
                            '<public_url xmlns="urn:yandex:disk:meta">true</public_url>',
                        '</prop>',
                    '</set>'
                ],
                'a-r': [
                    '<remove>',
                        '<prop>',
                            '<public_url xmlns="urn:yandex:disk:meta"/>',
                        '</prop>',
                    '</remove>'
                ]
            },
            requestBody = [
                '<propertyupdate xmlns="DAV:">',
                    modes[options.mode || 'a-r'].join(''),
                '</propertyupdate>'
            ].join('');

        return this._send({
            url: this.getUrl(options.path),
            method: 'PROPPATCH',
            body: requestBody,
            headers: this.getHeaders()
        });
    },
    df: function () {
        var requestBody = [
                '<propfind xmlns="DAV:">',
                    '<prop>',
                        '<quota-available-bytes/>',
                        '<quota-used-bytes/>',
                    '</prop>',
                '</propfind>'
            ].join('');

        return this._send({
            url: this.getUrl(),
            method: 'PROPFIND',
            body: requestBody,
            headers: this.getHeaders({<commit_msg>http client body -> data<commit_after>var HTTPClient = require('http-client'),
    client = new HTTPClient(),
    url = require('url'),
    Vow = require('vow'),
    inherit = require('inherit');

var Model = module.exports = inherit(/** @lends Model.prototype */ {
    __constructor: function (token) {
        this._token = token;
        this._methods = [ 'get', 'getPreview', 'put', 'cp', 'mv', 'rm', 'ls', 'mkdir', 'chmod', 'id', 'df' ];
    },
    get: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'GET',
            headers: this.getHeaders()
        });
    },
    getPreview: function (options) {
        return this._send({
            url: this.getUrl(options.path + '?preview'),
            method: 'GET',
            data: {
                size: options.size || 'M'
            },
            headers: this.getHeaders()
        });
    },
    put: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'PUT',
            data: options.file,
            headers: this.getHeaders({
                'Content-Type': 'application/' + options.type || 'binary'
            })
        });
    },
    cp: function (options) {
        return this._send({
            url: this.getUrl(options.source),
            method: 'COPY',
            headers: this.getHeaders({
                Destination: url.resolve('/', options.target)
            })
        });
    },
    mv: function (options) {
        return this._send({
            url: this.getUrl(options.source),
            method: 'MOVE',
            headers: this.getHeaders({
                Destination: url.resolve('/', options.target)
            })
        });
    },
    rm: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'DELETE',
            headers: this.getHeaders()
        });
    },
    mkdir: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'MKCOL',
            headers: this.getHeaders()
        });
    },
    ls: function (options) {
        return this._send({
            url: this.getUrl(options.path),
            method: 'PROPFIND',
            data: options,
            headers: this.getHeaders({
                Depth: '1'
            })
        });
    },
    id: function () {
        return this._send({
            url: this.getUrl('?userinfo'),
            method: 'GET',
            headers: this.getHeaders()
        });
    },
    chmod: function (options) {
        var modes = {
                'a+r': [
                    '<set>',
                        '<prop>',
                            '<public_url xmlns="urn:yandex:disk:meta">true</public_url>',
                        '</prop>',
                    '</set>'
                ],
                'a-r': [
                    '<remove>',
                        '<prop>',
                            '<public_url xmlns="urn:yandex:disk:meta"/>',
                        '</prop>',
                    '</remove>'
                ]
            },
            requestBody = [
                '<propertyupdate xmlns="DAV:">',
                    modes[options.mode || 'a-r'].join(''),
                '</propertyupdate>'
            ].join('');

        return this._send({
            url: this.getUrl(options.path),
            method: 'PROPPATCH',
            data: requestBody,
            headers: this.getHeaders()
        });
    },
    df: function () {
        var requestBody = [
                '<propfind xmlns="DAV:">',
                    '<prop>',
                        '<quota-available-bytes/>',
                        '<quota-used-bytes/>',
                    '</prop>',
                '</propfind>'
            ].join('');

        return this._send({
            url: this.getUrl(),
            method: 'PROPFIND',
            data: requestBody,
            headers: this.getHeaders({
{'fraction_non_alphanumeric': 0.15198704372741995, 'fraction_numerical': 0.00024915908807773764, 'mean_word_length': 1.24496644295302, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '1417171', 'n_tokens_mistral': 2149, 'n_tokens_neox': 2126, 'n_words': 426}