def get_primary_at(source_code, offset, retry=True):
 obj = ''
 left = re.split('[^0-9a-zA-Z_.]', source_code[:offset])
 if (left and left[(-1)]):
  obj = left[(-1)]
 right = re.split('\\W', source_code[offset:])
 if (right and right[0]):
  obj += right[0]
 if (obj and obj[0].isdigit()):
  obj = ''
 if ((not obj) and retry and offset and (source_code[(offset - 1)] in '([.')):
  return get_primary_at(source_code, (offset - 1), retry=False)
 return obj

def get_primary_at ( source_code , offset , retry = True ) : obj = '' left = re . split ( '[^0-9a-zA-Z_.]' , source_code [ : offset ] ) if ( left and left [ ( - 1 ) ] ) : obj = left [ ( - 1 ) ] right = re . split ( '\\W' , source_code [ offset : ] ) if ( right and right [ 0 ] ) : obj += right [ 0 ] if ( obj and obj [ 0 ] . isdigit ( ) ) : obj = '' if ( ( not obj ) and retry and offset and ( source_code [ ( offset - 1 ) ] in '([.' ) ) : return get_primary_at ( source_code , ( offset - 1 ) , retry = False ) return obj
return python object in *source_code* at *offset* periods to the left of the cursor are carried forward e .