def METHOD_NAME(dirname='', seriesname = SERIES_PATTERN):
    from PYME.IO.FileUtils import nameUtils
    from PYME.IO import clusterIO
    import os
    if dirname == '':   
        dirname = nameUtils.genClusterDataFilepath()
    else:
        dirname = dirname.split(nameUtils.getUsername())[-1]
        dir_parts = dirname.split(os.path.sep)
        if len(dirname) < 1 or len(dir_parts) > 3:
            #path is either too complex, or too easy - revert to default
            dirname = nameUtils.genClusterDataFilepath()
        else:
            dirname = nameUtils.getUsername() + '/'.join(dir_parts)
    #dirname = defDir % nameUtils.dateDict
    seriesStub = dirname + '/' + seriesname % nameUtils.dateDict
    seriesCounter = 0
    seriesName = seriesStub % {'counter' : nameUtils.numToAlpha(seriesCounter)}
    #try to find the next available serie name
    while clusterIO.exists(seriesName + '/'):
        seriesCounter +=1
        if '%(counter)' in seriesName:
            seriesName = seriesStub % {'counter' : nameUtils.numToAlpha(seriesCounter)}
        else:
            seriesName = seriesStub + '_' + nameUtils.numToAlpha(seriesCounter)
    return seriesName