def login(self, email=None, password=None, user=None):
        if user != None:
            data = {"login": user, "password": password}
        elif email != None:
            data = {"email": email, "password": password}
        else:
            raise ValueError('Neither username nor email provided to login')

        request = requests.post("{0}/api/v3/session".format(self.host), data=data,
                                verify=self.verify_ssl,
                                auth=self.auth,
                                timeout=self.timeout,
                                headers={"connection": "close"})
        if request.status_code == 201:
            self.token = request.json()['private_token']
            self.headers = {"PRIVATE-TOKEN": self.token,
                            "connection": "close"}
            return True
        else:
            msg = request.json()['message']
            raise exceptions.HttpError(msg)
Test creation of shapes from pixel values
dataset/ETHPy150Open pyapi-gitlab/pyapi-gitlab/gitlab/__init__.py/Gitlab.login--crossover with--dataset/ETHPy150Open mapbox/rasterio/tests/test_features.py/test_shapes