@publisher(['animation', 'shot previs'], publisher_type=POST_PUBLISHER_TYPE)
def export_edl_and_xml():
    from anima.env.mayaEnv import Maya
    m = Maya()
    current_version = m.get_current_version()

    if not current_version:
        return

    # get sequenceManager1
    sm = pm.PyNode('sequenceManager1')
    seqs = sm.sequences.get()
    if not len(seqs):
        return

    seq1 = seqs[0]

    # EDL
    edl_path = tempfile.gettempdir()
    edl_file_name = '%s_v%03i.edl' % (
        current_version.nice_name,
        current_version.version_number
    )
    edl_file_full_path = os.path.join(edl_path, edl_file_name)

    # XML
    xml_path = tempfile.gettempdir()
    xml_file_name = '%s_v%03i.xml' % (
        current_version.nice_name,
        current_version.version_number
    )
    xml_file_full_path = os.path.join(xml_path, xml_file_name)

    # convert to MXF
    from anima.ui.progress_dialog import ProgressDialogManager
    pdm = ProgressDialogManager()

    # shots = seq1.shots.get()
    shots = pm.ls(type='shot')
    shot_count = len(shots)

    # before doing a playblast set all shot handles to 0
    for shot in pm.ls(type='shot'):
        if shot.hasAttr('handle'):
            shot.handle.set(0)

    caller = pdm.register(shot_count, title='Converting To MXF')

    # update shot outputs to the correct place first
    # there should be only one shot in the current animation scene
    # if there is more than one shot, the other publisher will already warn the
    # user so the code path will not reach to this point

    # we also should already have a video output created by another publisher
    playblast_file = None
    for output in current_version.outputs:
        extension = os.path.splitext(output.full_path)[-1]
        if extension in ['.mov', '.avi', '.mp4']:
            playblast_file = output
            break

    if not playblast_file:
        return
    shot = shots[0]
    shot.output.set(playblast_file.full_path)

    for i in seq1.metafuze():
        caller.step()

    # create EDL and XML files
    from stalker import db
    from anima import utils
    mm = utils.MediaManager()

    # EDL
    l = sm.to_edl()
    with open(edl_file_full_path, 'w') as f:
        f.write(l.to_string())

    with open(edl_file_full_path, 'r') as f:
        link = mm.upload_version_output(current_version, f, edl_file_name)
        db.DBSession.add(link)

    # XML
    x = sm.to_xml()
    with open(xml_file_full_path, 'w') as f:
        f.write(x)

    with open(xml_file_full_path, 'r') as f:
        link = mm.upload_version_output(current_version, f, xml_file_name)
        db.DBSession.add(link)

    # add the link to database
    db.DBSession.commit()

    # revert the handles to 0
    for shot in pm.ls(type='shot'):
        if shot.hasAttr('handle'):
            shot.handle.set(0)
Returns the standard deviation of all values in an array, ignoring values
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/publish.py/export_edl_and_xml--crossover with--dataset/ETHPy150Open radlab/sparrow/src/main/python/third_party/stats.py/atstdev