{"action":"opened","issue":{"url":"https://api.github.com/repos/M157q/python-best-practices/issues/2","labels_url":"https://api.github.com/repos/M157q/python-best-practices/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/M157q/python-best-practices/issues/2/comments","events_url":"https://api.github.com/repos/M157q/python-best-practices/issues/2/events","html_url":"https://github.com/M157q/python-best-practices/issues/2","id":121714537,"number":2,"title":"2d list of list Matrix rotate","user":{"login":"M157q","id":1645228,"avatar_url":"https://avatars.githubusercontent.com/u/1645228?v=3","gravatar_id":"","url":"https://api.github.com/users/M157q","html_url":"https://github.com/M157q","followers_url":"https://api.github.com/users/M157q/followers","following_url":"https://api.github.com/users/M157q/following{/other_user}","gists_url":"https://api.github.com/users/M157q/gists{/gist_id}","starred_url":"https://api.github.com/users/M157q/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M157q/subscriptions","organizations_url":"https://api.github.com/users/M157q/orgs","repos_url":"https://api.github.com/users/M157q/repos","events_url":"https://api.github.com/users/M157q/events{/privacy}","received_events_url":"https://api.github.com/users/M157q/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-11T14:10:41Z","updated_at":"2015-12-11T14:10:41Z","closed_at":null,"body":"```python\r\ndef rotate(matrix, direction, times):\r\n    for _ in range(times):\r\n        # clockwise\r\n        if direction == 'cw':\r\n            matrix = list(map(list, zip(*matrix[::-1])))\r\n\r\n        # counter clockwise\r\n        if direction == 'ccw':\r\n            matrix = list(map(list, zip(*matrix)))[::-1]\r\n\r\n    return matrix\r\n```"}}