<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_properties(self, list_all=False):
 """ Lists properties associated with this node. By default, only lists properties that were explicitly set. If ``list_all`` is set to ``True`` then lists all valid properties of this component type Parameters list_all: bool If true, lists all valid properties of this component type. """


        if list_all:
            props = []
            for k,v in self.env.property_rules.rdl_properties.items():
                if type(self.inst) in v.bindable_to:
                    props.append(k)
            for k,v in self.env.property_rules.user_properties.items():
                if type(self.inst) in v.bindable_to:
                    props.append(k)
            return props
        else:
            return list(self.inst.properties.keys())