Python Nested Function Variable Javascript Array Find By Value