parse_repository_tag function and accompanying test

This function exists in a go code and is being used by the docker client to pull image if it doesn't exist. I needed the same functionality on the python side, hence this pull request.