<commit_before>from _variables import *
from _arma_common import configure_arg

def Get(node):

    if len(node) not in (1,2):

        if not len(node):
            node.error("Zero arguments in a matrix call")
        else:
            node.error("More than two arguments in a matrix call")

        return "%(name)s(", ", ", ")"

    # Single argument
    if len(node) == 1:

        arg, dim = configure_arg(node[0], 0)

        if dim == -1:
            return "%(name)s(%(0)s)"

        if dim == 0:
            node.dim = 0

        return "%(name)s(" + arg + ")"

    # Double argument
    elif len(node) == 2:

        arg0, dim0 = configure_arg(node[0], 0)
        arg1, dim1 = configure_arg(node[1], 1)

        if -1 in (dim0, dim1):
            return "%(name)s(", ", ", ")"

        # Configure dimensions
        if dim0:
            if dim1:
                node.dim = 3
            else:
                node.dim = 1
        else:
            if dim1:
                node.dim = 2
            else:
                node.dim = 0

        return "%(name)s(" + arg0 + ", " + arg1 + ")"


def Set(node):

    if len(node) not in (1,2):

        if not len(node):
            node.error("Zero arguments in a matrix set")
        else:
            node.error("More than two arguments in a matrix set")

        return "%(name)s(", ", ", ")"

    # Single argument
    if len(node) == 1:

        arg, dim = configure_arg(node[0], 0)
        if dim == 0:
            node.dim = 0

        if dim == -1:
            return "%(name)s(", ", ", ")"

        return "%(name)s(" + arg + ")"


    # Double argument
    elif len(node) == 2:

        arg0, dim0 = configure_arg(node[0], 0)
        arg1, dim1 = configure_arg(node[1], 1)

        if -1 in (dim0, dim1):
            return "%(name)s(", ", ", ")"

        # Configure dimensions
        if dim0:
            if dim1:
                node.dim = 3
            else:
                node.dim = 1
        else:
            if dim1:
                node.dim = 2
            else:
                node.dim = 0

        return "%(name)s(" + arg0 + ", " + arg1 + ")"<commit_msg>no mix of uvec and int arguments in matrix (no cube as of yet)<commit_after>from _variables import *
from _arma_common import configure_arg

def Get(node):

    if len(node) not in (1,2):

        if not len(node):
            node.error("Zero arguments in a matrix call")
        else:
            node.error("More than two arguments in a matrix call")

        return "%(name)s(", ", ", ")"

    # Single argument
    if len(node) == 1:

        arg, dim = configure_arg(node[0], 0)

        if dim == -1:
            return "%(name)s(%(0)s)"

        if dim == 0:
            node.dim = 0

        return "%(name)s(" + arg + ")"

    # Double argument
    elif len(node) == 2:

        arg0, dim0 = configure_arg(node[0], 0)
        arg1, dim1 = configure_arg(node[1], 1)

        if -1 in (dim0, dim1):
            return "%(name)s(", ", ", ")"

        # Configure dimensions
        if dim0:
            if dim1:
                node.dim = 3
            else:
                node.dim = 1
        else:
            if dim1:
                node.dim = 2
            else:
                node.dim = 0

        if node[0].cls == node[1].cls == "All":
            return "%(name)s"

        if node[0].cls == "All":
            return "%(name)s.col(" + arg1 + ")"

        elif node[1].cls == "All":
            return "%(name)s.row(" + arg0 + ")"

        return "%(name)s(" + arg0 + ", " + arg1 + ")"


def Set(node):

    if len(node) not in (1,2):

        if not len(node):
            node.error("Zero arguments in a matrix set")
        else:
            node.error("More than two arguments in a matrix set")

        return "%(name)s(", ", ", ")"

    # Single argument
    if len(node) == 1:

        arg, dim = configure_arg(node[0], 0)
        if dim == 0:
            node.dim = 0

        if dim == -1:
            return "%(name)s(", ", ", ")"

        return "%(name)s(" + arg + ")"


    # Double argument
    elif len(node) == 2:

        arg0, dim0 = configure_arg(node[0], 0)
        arg1, dim1 = configure_arg(node[1], 1)

        if -1 in (dim0, dim1):
            return "%(name)s(", ", ", ")"

        # Configure dimensions
        if dim0:
            if dim1:
                node.dim = 3
            else:
                node.dim = 1
        else:
            if dim1:
                node.dim = 2
            else:
                node.dim = 0

        if node[0].cls == node[1].cls == "All":
            return "%(name)s"

        if node[0].cls == "All":
            return "%(name)s.col(" + arg1 + ")"

        elif node[1].cls == "All":
            return "%(name)s.row(" + arg0 + ")"

        return "%(name)s(" + arg0 + ", " + arg1 + ")"
{'fraction_non_alphanumeric': 0.1525670338806901, 'fraction_numerical': 0.02702140927042195, 'mean_word_length': 1.3704433497536945, 'pattern_counts': {'":': 6, '<': 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': '6936532', 'n_tokens_mistral': 1622, 'n_tokens_neox': 1507, 'n_words': 431}