<commit_before>/*
 * Copyright © 2010 Red Hat, Inc.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package com.redhat.rhevm.api.powershell.resource;

import java.net.URI;
import java.util.concurrent.Executor;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;

import com.redhat.rhevm.api.common.resource.UriInfoProvider;
import com.redhat.rhevm.api.model.Action;
import com.redhat.rhevm.api.model.Fault;
import com.redhat.rhevm.api.model.Host;
import com.redhat.rhevm.api.model.IscsiParameters;
import com.redhat.rhevm.api.powershell.util.PowerShellCmd;
import com.redhat.rhevm.api.powershell.util.PowerShellParser;
import com.redhat.rhevm.api.powershell.util.PowerShellPoolMap;
import com.redhat.rhevm.api.powershell.util.PowerShellTestUtils;

import org.junit.Test;

import static org.easymock.classextension.EasyMock.expect;
import static org.easymock.classextension.EasyMock.isA;

import static org.powermock.api.easymock.PowerMock.createMock;
import static org.powermock.api.easymock.PowerMock.mockStatic;
import static org.powermock.api.easymock.PowerMock.replayAll;


public class PowerShellHostResourceTest extends AbstractPowerShellResourceTest<Host, PowerShellHostResource> {

    private static final String HOST_NAME = "sedna";
    private static final String HOST_ID = Integer.toString(HOST_NAME.hashCode());

    private static final String GET_COMMAND = "get-host \"" + HOST_ID + "\"";
    private static final String ACTION_RETURN = "replace with realistic powershell return";
    private static final String UPDATE_COMMAND = "$h = get-host \"" + HOST_ID + "\";$h.name = \"eris\";update-host -hostobject $h";
    private static final String INSTALL_PASSWORD = "<PASSWORD>";
    private static final String INSTALL_COMMAND = "$h = get-host \"" + HOST_ID + "\";update-host -hostobject $h -install -rootpassword \"" + INSTALL_PASSWORD + "\"";
    private static final String COMMIT_NET_CONFIG_COMMAND = "$h = get-host \"" + HOST_ID + "\"; commit-configurationchanges -hostobject $h";

    private static String ISCSI_PORTAL = "192.168.1.6";
    private static String ISCSI_TARGET = "iqn.2009-08.com.mycorp:mysan.foobar";
    private static String ISCSI_DISCOVER_COMMAND = "$cnx = new-storageserverconnection -storagetype ISCSI -connection \"" + ISCSI_PORTAL + "\" -portal \"" + ISCSI_PORTAL + "\"; get-storageserversendtargets -hostid \"" + HOST_ID + "\" -storageserverconnectionobject $cnx";
    private static String ISCSI_LOGIN_COMMAND = "$cnx = new-storageserverconnection -storagetype ISCSI -connection \"" + ISCSI_PORTAL + "\" -portal \"" + ISCSI_PORTAL + "\" -iqn \"" + ISCSI_TARGET + "\"; connect-storagetohost -hostid \"" + HOST_ID + "\" -storageserverconnectionobject $cnx";

    protected PowerShellHostResource getResource(Executor executor, PowerShellPoolMap poolMap, PowerShellParser parser, UriInfoProvider uriProvider) {
        return new PowerShellHostResource(HOST_ID, executor, uriProvider, poolMap, parser);
    }

    protected String formatHost(String name) {
        return formatHost("host", name);
    }

    protected String formatHost(String type, String name) {
        String ret = formatXmlReturn(type,
                               new String[] { name },
                               new String[] { "" },
                               PowerShellHostsResourceTest.extraArgs);
        System.out.println(ret);
        return ret;
    }

    protected String formatStorageConnection() {
        return PowerShellTestUtils.readClassPathFile("storagecnx.xml");
    }

    @Test
    public void testGet() throws Exception {
        setUriInfo(setUpHostExpectations(GET_COMMAND,
                                         formatHost(HOST_NAME),
                                         HOST_NAME));
        verifyHost(resource.get(), HOST_NAME);
    }

    @Test
    public void testGet22() throws Exception {
        setUriInfo(setUpHostExpectations(GET_COMMAND,
                                         formatHost("host22", HOST_NAME),
                                         HOST_NAME));
        verifyHost(resource.get(), HOST_NAME);
    }

    @Test
    public void testGoodUpdate() throws Exception {
        setUriInfo(setUpHostExpectations(UPDATE_COMMAND,
                                         formatHost("eris"),
                                         "eris"));
        verifyHost(resource.update(getHost(HOST_ID, "eris")), "eris");
    }

    @Test
    public void testBadUpdate() throws Exception {
        try {
            setUriInfo(createMock(UriInfo.class));
            replayAll();
            resource.update(getHost("98765", "eris"));
            fail("expected WebApplicationException on bad update");
        } catch (WebApplicationException wae) {
            verifyUpdateException(wae);
        }
    }

    @Test
    public void testApprove() throws Exception {
        setUriInfo(setUpActionExpectation("approve", "approve-host"));
        verifyActionResponse(resource.approve(getAction()), false);
    }

    @Test
    public void testInstall() throws Exception {
        Action action = getAction();
        action.setRootPassword(INSTALL_PASSWORD);
        setUriInfo(setUpActionExpectation("hosts/" + HOST_ID, "install", INSTALL_COMMAND, ACTION_RETURN));
        verifyActionResponse(resource.install(action), false);
    }

    @Test
    public void testIncompleteInstall() throws Exception {
        setUriInfo(setUpActionExpectation(null, null, null, null));
        try {
            resource.install(getAction());
            fail("expected WebApplicationException on incomplete parameters");
        } catch (WebApplicationException wae) {
             verifyIncompleteException(wae, "Action", "install", "rootPassword");
        }
    }

    @Test
    public void testActivate() throws Exception {
        setUriInfo(setUpActionExpectation("activate", "resume-host"));
        verifyActionResponse(resource.activate(getAction()), false);
    }

    @Test
    public void testDeactivate() throws Exception {
        setUriInfo(setUpActionExpectation("deactivate", "suspend-host"));
        verifyActionResponse(resource.deactivate(getAction()), false);
    }

    @Test
    public void testCommitNetConfig() throws Exception {
        setUriInfo(setUpActionExpectation("/hosts/"+ HOST_ID + "/",
                                          "commitnetconfig",
                                          COMMIT_NET_CONFIG_COMMAND,
                                          ACTION_RETURN));
        verifyActionResponse(resource.commitNetConfig(getAction()), false);
    }

    @Test
    public void testIscsiDiscover() throws Exception {
        Action action = getAction();
        action.setIscsi(new IscsiParameters());
        action.getIscsi().setAddress(ISCSI_PORTAL);
        setUriInfo(setUpActionExpectation("/hosts/" + HOST_ID + "/",
                                          "iscsidiscover",
                                          ISCSI_DISCOVER_COMMAND,
                                          formatStorageConnection()));
        Response response = resource.iscsiDiscover(action);
        verifyActionResponse(response, false);
        verifyIscsiTargets(response);
    }

    @Test
    public void testIscsiLogin() throws Exception {
        Action action = getAction();
        action.setIscsi(new IscsiParameters());
        action.getIscsi().setAddress(ISCSI_PORTAL);
        action.getIscsi().setTarget(ISCSI_TARGET);
        setUriInfo(setUpActionExpectation("/hosts/" + HOST_ID + "/",
                                          "iscsilogin",
                                          ISCSI_LOGIN_COMMAND,
                                          ACTION_RETURN));
        verifyActionResponse(resource.iscsiLogin(action), false);
    }

    @Test
    public void testApproveAsync() throws Exception {
        setUriInfo(setUpActionExpectation("approve", "approve-host"));
        verifyActionResponse(resource.approve(getAction(true)), true);
    }

    @Test
    public void testInstallAsync() throws Exception {
        Action action = getAction(true);
        action.setRootPassword(INSTALL_PASSWORD);
        setUriInfo(setUpActionExpectation("hosts/" + HOST_ID, "install", INSTALL_COMMAND, ACTION_RETURN));
        verifyActionResponse(resource.install(action), true);
    }

    @Test
    public void testCommitNetConfigAsync() throws Exception {
        setUriInfo(setUpActionExpectation("/hosts/"+ HOST_ID + "/",
                                          "commitnetconfig",
                                          COMMIT_NET_CONFIG_COMMAND,
                                          ACTION_RETURN));
        verifyActionResponse(resource.commitNetConfig(getAction(true)), true);
    }

    @Test
    public void testActivateAsync() throws Exception {
        setUriInfo(setUpActionExpectation("activate", "resume-host"));
        verifyActionResponse(resource.activate(getAction(true)), true);
    }

    @Test
    public void testDeactivateAsync() throws Exception {
        setUriInfo(setUpActionExpectation("deactivate", "suspend-host"));
        verifyActionResponse(resource.deactivate(getAction(true)), true);
    }

    private UriInfo setUpHostExpectations(String command, String ret, String name) throws Exception {
        mockStatic(PowerShellCmd.class);
        expect(PowerShellCmd.runCommand(setUpPoolExpectations(), command)).andReturn(ret);
        String href = "hosts/" + Integer.toString(name.hashCode());
        UriInfo uriInfo = setUpBasicUriExpectations();
        UriBuilder uriBuilder = createMock(UriBuilder.class);
        expect(uriInfo.getRequestUriBuilder()).andReturn(uriBuilder).anyTimes();
        expect(uriBuilder.build()).andReturn(new URI(href)).anyTimes();
        UriBuilder actionUriBuilder = createMock(UriBuilder.class);
        expect(uriBuilder.clone()).andReturn(actionUriBuilder).anyTimes();
        expect(actionUriBuilder.path(isA(String.class))).andReturn(uriBuilder).anyTimes();
        expect(actionUriBuilder.build()).andReturn(new URI(href + "/action")).anyTimes();
        //expect(uriInfo.getBaseUri()).andReturn(URI.create(URI_BASE)).anyTimes();
        replayAll();

        return uriInfo;
    }

    private UriInfo setUpActionExpectation(String verb, String command) throws Exception {
        return setUpActionExpectation("/hosts/"+ HOST_ID + "/",
                                      verb,
                                      command + " -hostid \"" + HOST_ID + "\"",
                                      ACTION_RETURN);
    }

    private Host getHost(String name) {
        return getHost(Integer.toString(name.hashCode()), name);
    }

    private Host getHost(String id, String name) {
        Host host = new Host();
        host.setId(id);
        host.setName(name);
        return host;
    }

    private void verifyHost(Host host, String name) {
        assertNotNull(host);
        assertEquals(Integer.toString(name.hashCode()), host.getId());
        assertEquals(name, host.getName());
        verifyLinks(host);
    }

    private void verifyIscsiTargets(Response response) {
        assertNotNull(response);
        Action action = (Action)response.getEntity();
        assertTrue(action.isSetIscsiTargets());
        assertEquals(1, action.getIscsiTargets().size());
        assertEquals(ISCSI_TARGET, action.getIscsiTargets().get(0));
    }

    private void verifyActionResponse(Response r, boolean async) throws Exception {
        verifyActionResponse(r, "hosts/" + HOST_ID, async);
    }

    private void verifyUpdateException(WebApplicationException wae) {
        assertEquals(409, wae.getResponse().getStatus());
        Fault fault = (Fault)wae.getResponse().getEntity();
        assertNotNull(fault);
        assertEquals("Broken immutability constraint", fault.getReason());
        assertEquals("Attempt to set immutable field: id", fault.getDetail());
    }
}
<commit_msg>powershell: remove stray debug spew from unit tests<commit_after>/*
 * Copyright © 2010 Red Hat, Inc.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package com.redhat.rhevm.api.powershell.resource;

import java.net.URI;
import java.util.concurrent.Executor;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;

import com.redhat.rhevm.api.common.resource.UriInfoProvider;
import com.redhat.rhevm.api.model.Action;
import com.redhat.rhevm.api.model.Fault;
import com.redhat.rhevm.api.model.Host;
import com.redhat.rhevm.api.model.IscsiParameters;
import com.redhat.rhevm.api.powershell.util.PowerShellCmd;
import com.redhat.rhevm.api.powershell.util.PowerShellParser;
import com.redhat.rhevm.api.powershell.util.PowerShellPoolMap;
import com.redhat.rhevm.api.powershell.util.PowerShellTestUtils;

import org.junit.Test;

import static org.easymock.classextension.EasyMock.expect;
import static org.easymock.classextension.EasyMock.isA;

import static org.powermock.api.easymock.PowerMock.createMock;
import static org.powermock.api.easymock.PowerMock.mockStatic;
import static org.powermock.api.easymock.PowerMock.replayAll;


public class PowerShellHostResourceTest extends AbstractPowerShellResourceTest<Host, PowerShellHostResource> {

    private static final String HOST_NAME = "sedna";
    private static final String HOST_ID = Integer.toString(HOST_NAME.hashCode());

    private static final String GET_COMMAND = "get-host \"" + HOST_ID + "\"";
    private static final String ACTION_RETURN = "replace with realistic powershell return";
    private static final String UPDATE_COMMAND = "$h = get-host \"" + HOST_ID + "\";$h.name = \"eris\";update-host -hostobject $h";
    private static final String INSTALL_PASSWORD = "<PASSWORD>";
    private static final String INSTALL_COMMAND = "$h = get-host \"" + HOST_ID + "\";update-host -hostobject $h -install -rootpassword \"" + INSTALL_PASSWORD + "\"";
    private static final String COMMIT_NET_CONFIG_COMMAND = "$h = get-host \"" + HOST_ID + "\"; commit-configurationchanges -hostobject $h";

    private static String ISCSI_PORTAL = "192.168.1.6";
    private static String ISCSI_TARGET = "iqn.2009-08.com.mycorp:mysan.foobar";
    private static String ISCSI_DISCOVER_COMMAND = "$cnx = new-storageserverconnection -storagetype ISCSI -connection \"" + ISCSI_PORTAL + "\" -portal \"" + ISCSI_PORTAL + "\"; get-storageserversendtargets -hostid \"" + HOST_ID + "\" -storageserverconnectionobject $cnx";
    private static String ISCSI_LOGIN_COMMAND = "$cnx = new-storageserverconnection -storagetype ISCSI -connection \"" + ISCSI_PORTAL + "\" -portal \"" + ISCSI_PORTAL + "\" -iqn \"" + ISCSI_TARGET + "\"; connect-storagetohost -hostid \"" + HOST_ID + "\" -storageserverconnectionobject $cnx";

    protected PowerShellHostResource getResource(Executor executor, PowerShellPoolMap poolMap, PowerShellParser parser, UriInfoProvider uriProvider) {
        return new PowerShellHostResource(HOST_ID, executor, uriProvider, poolMap, parser);
    }

    protected String formatHost(String name) {
        return formatHost("host", name);
    }

    protected String formatHost(String type, String name) {
        String ret = formatXmlReturn(type,
                               new String[] { name },
                               new String[] { "" },
                               PowerShellHostsResourceTest.extraArgs);
        return ret;
    }

    protected String formatStorageConnection() {
        return PowerShellTestUtils.readClassPathFile("storagecnx.xml");
    }

    @Test
    public void testGet() throws Exception {
        setUriInfo(setUpHostExpectations(GET_COMMAND,
                                         formatHost(HOST_NAME),
                                         HOST_NAME));
        verifyHost(resource.get(), HOST_NAME);
    }

    @Test
    public void testGet22() throws Exception {
        setUriInfo(setUpHostExpectations(GET_COMMAND,
                                         formatHost("host22", HOST_NAME),
                                         HOST_NAME));
        verifyHost(resource.get(), HOST_NAME);
    }

    @Test
    public void testGoodUpdate() throws Exception {
        setUriInfo(setUpHostExpectations(UPDATE_COMMAND,
                                         formatHost("eris"),
                                         "eris"));
        verifyHost(resource.update(getHost(HOST_ID, "eris")), "eris");
    }

    @Test
    public void testBadUpdate() throws Exception {
        try {
            setUriInfo(createMock(UriInfo.class));
            replayAll();
            resource.update(getHost("98765", "eris"));
            fail("expected WebApplicationException on bad update");
        } catch (WebApplicationException wae) {
            verifyUpdateException(wae);
        }
    }

    @Test
    public void testApprove() throws Exception {
        setUriInfo(setUpActionExpectation("approve", "approve-host"));
        verifyActionResponse(resource.approve(getAction()), false);
    }

    @Test
    public void testInstall() throws Exception {
        Action action = getAction();
        action.setRootPassword(<PASSWORD>_PASSWORD);
        setUriInfo(setUpActionExpectation("hosts/" + HOST_ID, "install", INSTALL_COMMAND, ACTION_RETURN));
        verifyActionResponse(resource.install(action), false);
    }

    @Test
    public void testIncompleteInstall() throws Exception {
        setUriInfo(setUpActionExpectation(null, null, null, null));
        try {
            resource.install(getAction());
            fail("expected WebApplicationException on incomplete parameters");
        } catch (WebApplicationException wae) {
             verifyIncompleteException(wae, "Action", "install", "rootPassword");
        }
    }

    @Test
    public void testActivate() throws Exception {
        setUriInfo(setUpActionExpectation("activate", "resume-host"));
        verifyActionResponse(resource.activate(getAction()), false);
    }

    @Test
    public void testDeactivate() throws Exception {
        setUriInfo(setUpActionExpectation("deactivate", "suspend-host"));
        verifyActionResponse(resource.deactivate(getAction()), false);
    }

    @Test
    public void testCommitNetConfig() throws Exception {
        setUriInfo(setUpActionExpectation("/hosts/"+ HOST_ID + "/",
                                          "commitnetconfig",
                                          COMMIT_NET_CONFIG_COMMAND,
                                          ACTION_RETURN));
        verifyActionResponse(resource.commitNetConfig(getAction()), false);
    }

    @Test
    public void testIscsiDiscover() throws Exception {
        Action action = getAction();
        action.setIscsi(new IscsiParameters());
        action.getIscsi().setAddress(ISCSI_PORTAL);
        setUriInfo(setUpActionExpectation("/hosts/" + HOST_ID + "/",
                                          "iscsidiscover",
                                          ISCSI_DISCOVER_COMMAND,
                                          formatStorageConnection()));
        Response response = resource.iscsiDiscover(action);
        verifyActionResponse(response, false);
        verifyIscsiTargets(response);
    }

    @Test
    public void testIscsiLogin() throws Exception {
        Action action = getAction();
        action.setIscsi(new IscsiParameters());
        action.getIscsi().setAddress(ISCSI_PORTAL);
        action.getIscsi().setTarget(ISCSI_TARGET);
        setUriInfo(setUpActionExpectation("/hosts/" + HOST_ID + "/",
                                          "iscsilogin",
                                          ISCSI_LOGIN_COMMAND,
                                          ACTION_RETURN));
        verifyActionResponse(resource.iscsiLogin(action), false);
    }

    @Test
    public void testApproveAsync() throws Exception {
        setUriInfo(setUpActionExpectation("approve", "approve-host"));
        verifyActionResponse(resource.approve(getAction(true)), true);
    }

    @Test
    public void testInstallAsync() throws Exception {
        Action action = getAction(true);
        action.setRootPassword(INSTALL_PASSWORD);
        setUriInfo(setUpActionExpectation("hosts/" + HOST_ID, "install", INSTALL_COMMAND, ACTION_RETURN));
        verifyActionResponse(resource.install(action), true);
    }

    @Test
    public void testCommitNetConfigAsync() throws Exception {
        setUriInfo(setUpActionExpectation("/hosts/"+ HOST_ID + "/",
                                          "commitnetconfig",
                                          COMMIT_NET_CONFIG_COMMAND,
                                          ACTION_RETURN));
        verifyActionResponse(resource.commitNetConfig(getAction(true)), true);
    }

    @Test
    public void testActivateAsync() throws Exception {
        setUriInfo(setUpActionExpectation("activate", "resume-host"));
        verifyActionResponse(resource.activate(getAction(true)), true);
    }

    @Test
    public void testDeactivateAsync() throws Exception {
        setUriInfo(setUpActionExpectation("deactivate", "suspend-host"));
        verifyActionResponse(resource.deactivate(getAction(true)), true);
    }

    private UriInfo setUpHostExpectations(String command, String ret, String name) throws Exception {
        mockStatic(PowerShellCmd.class);
        expect(PowerShellCmd.runCommand(setUpPoolExpectations(), command)).andReturn(ret);
        String href = "hosts/" + Integer.toString(name.hashCode());
        UriInfo uriInfo = setUpBasicUriExpectations();
        UriBuilder uriBuilder = createMock(UriBuilder.class);
        expect(uriInfo.getRequestUriBuilder()).andReturn(uriBuilder).anyTimes();
        expect(uriBuilder.build()).andReturn(new URI(href)).anyTimes();
        UriBuilder actionUriBuilder = createMock(UriBuilder.class);
        expect(uriBuilder.clone()).andReturn(actionUriBuilder).anyTimes();
        expect(actionUriBuilder.path(isA(String.class))).andReturn(uriBuilder).anyTimes();
        expect(actionUriBuilder.build()).andReturn(new URI(href + "/action")).anyTimes();
        //expect(uriInfo.getBaseUri()).andReturn(URI.create(URI_BASE)).anyTimes();
        replayAll();

        return uriInfo;
    }

    private UriInfo setUpActionExpectation(String verb, String command) throws Exception {
        return setUpActionExpectation("/hosts/"+ HOST_ID + "/",
                                      verb,
                                      command + " -hostid \"" + HOST_ID + "\"",
                                      ACTION_RETURN);
    }

    private Host getHost(String name) {
        return getHost(Integer.toString(name.hashCode()), name);
    }

    private Host getHost(String id, String name) {
        Host host = new Host();
        host.setId(id);
        host.setName(name);
        return host;
    }

    private void verifyHost(Host host, String name) {
        assertNotNull(host);
        assertEquals(Integer.toString(name.hashCode()), host.getId());
        assertEquals(name, host.getName());
        verifyLinks(host);
    }

    private void verifyIscsiTargets(Response response) {
        assertNotNull(response);
        Action action = (Action)response.getEntity();
        assertTrue(action.isSetIscsiTargets());
        assertEquals(1, action.getIscsiTargets().size());
        assertEquals(ISCSI_TARGET, action.getIscsiTargets().get(0));
    }

    private void verifyActionResponse(Response r, boolean async) throws Exception {
        verifyActionResponse(r, "hosts/" + HOST_ID, async);
    }

    private void verifyUpdateException(WebApplicationException wae) {
        assertEquals(409, wae.getResponse().getStatus());
        Fault fault = (Fault)wae.getResponse().getEntity();
        assertNotNull(fault);
        assertEquals("Broken immutability constraint", fault.getReason());
        assertEquals("Attempt to set immutable field: id", fault.getDetail());
    }
}

{'fraction_non_alphanumeric': 0.10583425066834408, 'fraction_numerical': 0.0035382921843057085, 'mean_word_length': 2.752323351526774, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 82, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '539806', 'n_tokens_mistral': 6925, 'n_tokens_neox': 6736, 'n_words': 1452}