code: def convert(cls, obj, flatten=True):
          
          dict_result = cls.object_to_dict(obj)
          if flatten:
              dict_result = FlatDict(dict_result)
          return dict_result
docs: This function converts object into a Dict optionally Flattening it
              :param obj: Object to be converted
              :param flatten: boolean to specify if the dict has to be flattened
              :return dict: the dict of the object (Flattened or Un-flattened)