def getPartRun(alias=True):
 retVal = None
 commonPartsDict = optDict['Enumeration']
 try:
  stack = [(item[4][0] if isinstance(item[4], list) else '') for item in inspect.stack()]
  for i in xrange(0, (len(stack) - 1)):
   for regex in ('self\\.(get[^(]+)\\(\\)', 'conf\\.dbmsHandler\\.([^(]+)\\(\\)'):
    match = re.search(regex, stack[i])
    if match:
     retVal = match.groups()[0]
     break
   if (retVal is not None):
    break
 except TypeError:
  pass
 if alias:
  return (commonPartsDict[retVal][1] if isinstance(commonPartsDict.get(retVal), tuple) else retVal)
 else:
  return retVal

def getPartRun ( alias = True ) : retVal = None commonPartsDict = optDict [ 'Enumeration' ] try : stack = [ ( item [ 4 ] [ 0 ] if isinstance ( item [ 4 ] , list ) else '' ) for item in inspect . stack ( ) ] for i in xrange ( 0 , ( len ( stack ) - 1 ) ) : for regex in ( 'self\\.(get[^(]+)\\(\\)' , 'conf\\.dbmsHandler\\.([^(]+)\\(\\)' ) : match = re . search ( regex , stack [ i ] ) if match : retVal = match . groups ( ) [ 0 ] break if ( retVal is not None ) : break except TypeError : pass if alias : return ( commonPartsDict [ retVal ] [ 1 ] if isinstance ( commonPartsDict . get ( retVal ) , tuple ) else retVal ) else : return retVal
goes through call stack and finds constructs matching conf .