<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def properties(cls, with_bases=True):
        ''' Collect the names of properties on this class.

        This method *optionally* traverses the class hierarchy and includes
        properties defined on any parent classes.

        Args:
            with_bases (bool, optional) :
                Whether to include properties defined on parent classes in
                the results. (default: True)

        Returns:
           set[str] : property names

        '''
        if with_bases:
            return accumulate_from_superclasses(cls, "__properties__")
        else:
            return set(cls.__properties__)