Python 3 in 1 line
\n# 12 clear lines\npython\nDIRS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i or j]\n\nclass Solution:\n    def queensAttacktheKing(self, queens, 
\n# 12 clear lines\n```python\nDIRS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i or j]\n\nclass Solution:\n    def queensAttacktheKing(self, queens, king):\n        q = {(r,c) for r,c in queens}\n        r, c = king\n        result = []\n        for dr, dc in DIRS:\n          for i in range(8):\n            r2, c2 = r+dr*i, c+dc*i\n            if not (0 <= r2 < 8 and 0 <= c2 < 8): break\n            if (r2, c2) in q:\n              result.append([r2, c2])\n              break\n        return result\n```\n\n# 4 reasonable lines\n```python\nDIRS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i or j]\n\nclass Solution:\n    def queensAttacktheKing(self, queens, king):\n        q = {(r,c) for r,c in queens}\n        r, c = king\n        return list(filter(None, (next(([r+dr*i, c+dc*i] for i in range(8) if (r+dr*i, c+dc*i) in q), None) for dr, dc in DIRS)))\n```\n\n# 2 compact lines\n```python\nclass Solution:\n    def queensAttacktheKing(self, queens, king, DIRS=[(0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1), (1, 0), (1, 1)]):\n        q = {(r,c) for r,c in queens}\n        return list(filter(None, (next(([king[0]+dr*i, king[1]+dc*i] for i in range(8) if (king[0]+dr*i, king[1]+dc*i) in q), None) for dr, dc in DIRS)))\n```\n\n# 1 disgusting line\n```python\nclass Solution:\n    def queensAttacktheKing(self, queens, king, DIRS=[(0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1), (1, 0), (1, 1)], q=[0]):\n        return q.__setitem__(0, {(r,c) for r,c in queens}) or list(filter(None, (next(([king[0]+dr*i, king[1]+dc*i] for i in range(8) if (king[0]+dr*i, king[1]+dc*i) in q[0]), None) for dr, dc in DIRS)))\n```
[]