The function names is designed to return the attribute names defined by the interface of the class in which it is implemented. It has the following behaviors:
The function accepts a boolean parameter all. If all is set to False, the function should return the attribute names (as a list or a similar iterable) that are directly defined in the current class.
If all is set to True, the function should also include attribute names from all base classes of the current class, effectively returning a comprehensive list of all attribute names in the inheritance hierarchy.
The function should ensure that in both cases, the attribute names returned are distinct and include those from the class and its base classes as relevant.
Edge cases to handle:
If the class has no attributes defined, the function should return an empty structure (e.g., an empty list or set).
If the class inherits from multiple base classes, the function should correctly aggregate the attribute names from all of them without duplication.
Note: The solution should be placed in /app/solution.py. The function must be importable as: from solution import names.