human
Complete the below
def getSortedInjectionTests():

    ''''Returns prioritized test list by eventually detected DBMS from error
    messages'
    '''
 ... What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    retVal = copy.deepcopy(conf.tests)
    def priorityFunction(test):
        retVal = SORT_ORDER.FIRST
        if (test.stype == PAYLOAD.TECHNIQUE.UNION):
            retVal = SORT_ORDER.LAST
        elif (('details' in test) and ('dbms' in test.details)):
            if intersect(test.details.dbms, Backend.getIdentifiedDbms()):
                retVal = SORT_ORDER.SECOND
            else:
                retVal = SORT_ORDER.THIRD
        return retVal
    if Backend.getIdentifiedDbms():
        retVal = sorted(retVal, key=priorityFunction)
    return retVal