def _one_crosscorr(seq, window, scale):
    """Private function used for calculating cross-correlated pydpi_py3 for 1 given sequence, window and an AA scale.
    This function is used by the :py:func:`calculate_crosscorr` method of :py:class:`PeptideDescriptor`.

    :param seq: {str} amino acid sequence to calculate descriptor for
    :param window: {int} correlation-window size
    :param scale: {str} amino acid scale to be used to calculate descriptor
    :return: {numpy.array} calculated descriptor data
    """
    try:
        m = list()
        for l in range(len(seq)):
            m.append(scale[str(seq[l])])
        seqdesc = list()
        for val in range(len(scale['A'])):
            for cc in range(len(scale['A'])):
                if val + cc < len(scale['A']):
                    for dist in range(window):
                        cntr = float()
                        valsum = list()
                        for pos in range(len(seq)):
                            if pos + dist < len(seq):
                                cntr += 1
                                valsum.append(m[pos][val] * m[pos + dist][
                                    val + cc])
                        seqdesc.append(sum(valsum) / cntr)
        return seqdesc
    except ZeroDivisionError:
        print(
            'ERROR!\nThe chosen correlation window % i is larger than the sequence %s !'
             % (window, seq))
