<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_value_from_element(self, elt, prop):
 # pylint: disable=too-many-return-statements """Get value from an element's property. the property may be a function to call. If the property is not resolved (because not implemented), this function will return 'n/a' :param elt: element :type elt: object :param prop: element property :type prop: str :return: getattr(elt, prop) or getattr(elt, prop)() (call) :rtype: str """

        args = None
        # We have args to provide to the function
        if isinstance(prop, tuple):
            prop, args = prop
        value = getattr(elt, prop, None)
        if value is None:
            return 'n/a'

        try:
            # If the macro is set to a list property
            if isinstance(value, list):
                # Return the list items, comma separated and bracketed
                return "[%s]" % ','.join(value)

            # If the macro is not set as a function to call
            if not isinstance(value, collections.Callable):
                return value

            # Case of a function call with no arguments
            if not args:
                return value()

            # Case where we need args to the function
            # ex : HOSTGROUPNAME (we need hostgroups)
            # ex : SHORTSTATUS (we need hosts and services if bp_rule)
            real_args = []
            for arg in args:
                real_args.append(getattr(self, arg, None))
            return value(*real_args)
        except AttributeError:
            # Commented because there are many unresolved macros and this log is spamming :/
            # # Raise a warning and return a strange value when macro cannot be resolved
            # warnings.warn(
            #     'Error when getting the property value for a macro: %s',
            #     MacroWarning, stacklevel=2)
            # Return a strange value when macro cannot be resolved
            return 'n/a'
        except UnicodeError:
            if isinstance(value, string_types):
                return str(value, 'utf8', errors='ignore')

            return 'n/a'