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

def category_names(self):
        '''
        Returns category names of 1000 ImageNet classes.
        '''
        if hasattr(self, '_category_names'):
            return self._category_names
        with open(os.path.join(os.path.dirname(__file__), 'category_names.txt'), 'r') as fd:
            self._category_names = fd.read().splitlines()
        return self._category_names