<commit_before>module.exports = function (babel) {
    const {types: t} = babel;
    var componentCreatorNames = null;

    return {
        visitor: {
            Program() {
                componentCreatorNames = null;
            },

            ImportDefaultSpecifier(path, state) {
                const modules = state.opts || {};

                const importDeclaration = path.findParent(p => t.isImportDeclaration(p.node));

                const componentCreatorExports = modules[importDeclaration.node.source.value];

                if (!componentCreatorExports) return;
                if (!componentCreatorExports.default) return;



                if (!componentCreatorNames) {
                    componentCreatorNames = {};
                }

                componentCreatorNames[path.node.local.name] = true;
            },

            ImportSpecifier(path, state) {
                const modules = state.opts || {};

                const importDeclaration = path.findParent(p => t.isImportDeclaration(p.node));

                const componentCreatorExports = modules[importDeclaration.node.source.value];

                if (!componentCreatorExports) return;

                if (!componentCreatorExports[path.node.imported.name]) return;

                if (!componentCreatorNames) {
                    componentCreatorNames = {};
                }

                componentCreatorNames[path.node.local.name] = true;
            },

            VariableDeclaration(path) {
                if (!componentCreatorNames) return;

                if (!path.node.declarations[0].init) return;
                if (path.node.declarations[0].init.type !== "CallExpression") return;

                const creatorName = path.node.declarations[0].init.callee.name;

                if (!componentCreatorNames[creatorName]) return;

                var scope = path.scope;<commit_msg>Add support for local files<commit_after>const {dirname, resolve} = require("path");

module.exports = function (babel) {
    const {types: t} = babel;
    var componentCreatorNames = null;

    return {
        visitor: {
            Program() {
                componentCreatorNames = null;
            },

            ImportDefaultSpecifier(path, state) {
                const modules = state.opts || {};

                const importDeclaration = path.findParent(p => t.isImportDeclaration(p.node));

                const componentCreatorExports = modules[importDeclaration.node.source.value];

                if (!componentCreatorExports) return;
                if (!componentCreatorExports.default) return;



                if (!componentCreatorNames) {
                    componentCreatorNames = {};
                }

                componentCreatorNames[path.node.local.name] = true;
            },

            ImportSpecifier(path, state) {
                const modules = state.opts || {};

                const importDeclaration = path.findParent(p => t.isImportDeclaration(p.node));
                const importString = importDeclaration.node.source.value;

                const isLocal = importString[0] === ".";

                var componentCreatorExports = null;

                if (isLocal) {
                    const sourcePath = resolve(dirname(state.file.opts.filename), importString);

                    const key = Object.keys(modules).find(configPath => {
                        if (configPath[0] === ".") {
                            const fullConfigPath = resolve(state.file.opts.sourceRoot, configPath);
                            return fullConfigPath === sourcePath;
                        }
                    });

                    componentCreatorExports = modules[key];
                } else {
                    componentCreatorExports = modules[importString];
                }

                if (!componentCreatorExports) return;

                if (!componentCreatorExports[path.node.imported.name]) return;

                if (!componentCreatorNames) {
                    componentCreatorNames = {};
                }

                componentCreatorNames[path.node.local.name] = true;
            },

            VariableDeclaration(path) {
                if (!componentCreatorNames) return;

                if (!path.node.declarations[0].init) return;
                if (path.node.declarations[0].init.type !== "CallExpression") return;

                const creatorName = path.node.declarations[0].init.callee.name;

                if (!componentCreatorNames[creatorName]) return;

                var scope = path.scope;
{'fraction_non_alphanumeric': 0.09936942813655142, 'fraction_numerical': 0.0017395085888236572, 'mean_word_length': 1.645198389879241, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1166320', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1059, 'n_words': 198}