Asians in college admissions need to counteract snap judgments and stereotypes. They can do this by not playing the violin among other things. While it may sound silly, it's true.
And college admissions officers stereotype just like the rest of us. When they come across an Asian or Asian American applicant, they look to see if he or she is first or second chair violin. They look to see how many years he or she has run track. And they look to see if his or her SAT scores are perfect or just close to perfect. Yes, these are all stereotypes. But people stereotype. The sooner that you accept this fact, the sooner you can start preparing a fantastic college application that will distinguish you from the pack.
If you're an Asian or Asian American applicant to a highly selective college such as an Ivy League college, avoid things like the violin. Avoid running track. Dare to defy the stereotypes of your ethnicity. Dare to be different. Dare to do something that many Asian and Asian American applicants would never think of doing. Maybe this means being a lover of classic literature. Maybe it means being an amazing water polo player. Find a hook that distinguishes you from the rest. And, yes, helping students find their hooks is what we do best at Ivy Coach.


text:
Verstappen: "We're not sissies"
Max Verstappen is known for his blunt outlook on life. That was no different after Romain Grosjean's accident at the Bahrain Grand Prix , although he too was worried when he saw the flames. On Peptalk on Ziggo Sport, Verstappen explained how he experienced that moment.
"When that red flag came and we were still in the car and driving back to the pits, that was the worst moment. That's because you see those flames, of course, and you don't know what really happened or whether he's still in the car. Once we were in the pits, he had of course already jumped out of the car. We had seen that image."
Doornbos gives Albon a bit of hope in battle for Red Bull seat
What did Verstappen get up to?
After that the drivers had to wait a long time before they could start again. He used that time to get in touch with his family. "I did some face timing with my father and my sister and I sent some messages," said Verstappen.
I would be lying if I said that I don't think about it'
When asked whether the accident woke him up, the Red Bull Racing driver reacted in very Max Verstappen fashion. "No, it happened. Of course it's not nice and it was a huge shunt. Of course you hope it never happens, but danger is in the detail."
Hamilton after Verstappen's verdict: "I hope you're never my team boss!"
"We're not sissies, come on! It happens, unfortunately, such a crash, but to say 'I don't drive any more', I can't understand that."
Read more about: Max Verstappen Red Bull Racing Romain Grosjean Formula 1 Bahrain Grand Prix Bahrain International Circuit Social
Hamilton asks for too much money? "How on earth do they know that?"
As the official start of the new F1 season slowly approaches, one big question mark still hangs over the driver...
Current and former Formula One drivers set to compete in Virtual Grand Prix

redpajama_set_name: RedPajamaCommonCrawl


text:
"""
pyapi-gitlab, a gitlab python wrapper for the gitlab API
by Itxaka Serrano Garcia <itxakaserrano@gmail.com>
now changes also by jumpscale team
"""

import requests
try:
    import ujson as json
except:
    import json

import markdown
from . import exceptions
from JumpScale import j

class Gitlab(object):
    """
    Gitlab class
    """
    def __init__(self, host, token="", verify_ssl=True):
        """
        on init we setup the token used for all the api calls and all the urls
        :param host: host of gitlab
        :param token: token
        """
        if token != "":
            self.token = token
            self.headers = {"PRIVATE-TOKEN": self.token}
        if host[-1] == '/':
            self.host = host[:-1]
        else:
            self.host = host
        if self.host[:7] != 'http://':
            self.host = 'http://' + self.host

        self.api_url = self.host + "/api/v3"
        self.projects_url = self.api_url + "/projects"
        self.users_url = self.api_url + "/users"
        self.keys_url = self.api_url + "/user/keys"
        self.groups_url = self.api_url + "/groups"
        self.search_url = self.api_url + "/projects/search/"
        self.verify_ssl = verify_ssl

    def login(self, user, password):
        """
        Logs the user in and setups the header with the private token
        :param user: gitlab user
        :param password: gitlab password
        :return: True if login successfull
        """
        data = {"email": user, "password": password}
        request = requests.post(self.host + "/api/v3/session", data=data,
                                verify=self.verify_ssl,
                                headers={"connection": "close"})
        if request.status_code == 201:
            self.token = json.loads(request.content.decode("utf-8"))['private_token']
            self.headers = {"PRIVATE-TOKEN": self.token,
                            "connection": "close"}
            return True
        else:
            raise exceptions.HttpError(json.loads(request.content)['message'])

    def load(self):
        self._getUsersInit()
        self._getProjectsInit()
        self._getGroupsInit()

    def _getProjectsInit(self):
        """
        @return [[name,id,owner]]
        """
        result=[]
        self.projects2id={}
        projects=self.getprojects()
        if j.basetype.list.check(projects):
            for item in projects:
                result.append([item["name"],item["id"],item["namespace"]["name"]])
                key="%s__%s"%(item["namespace"]["name"],item["name"])
                self.projects2id[key]=item["id"]
            return result
        else:
            raise RuntimeError("Could not list projects")

    def _getUsersInit(self):
        self.users2id={}
        users=self.getusers()
        result=[]
        if j.basetype.list.check(users):
            for item in users:
                if item["state"]=="active":
                    result.append([item["username"],item["id"]])
                    key=item["username"]
                self.users2id[key]=item["id"]
            return result
        else:
            raise RuntimeError("Could not get users for cache")

    def _getGroupsInit(self):
        self.groups2id={}
        items=self.getgroups()
        result=[]
        if j.basetype.list.check(items):
            for item in items:
                result.append([item["name"],item["id"]])
                self.groups2id[item["name"]]=item["id"]
            return result
        else:
            raise RuntimeError("Could not get users for cache")

    def getusers(self, page=1, per_page=20):
        """
        Return a user list
        :param page: Which page to return (default is 1)
        :param per_page: Number of items to return per page (default is 20)
        return: returs a dictionary of the users, false if there is an error
        """
        data = {'page': page, 'per_page': per_page}
        request = requests.get(self.users_url, params=data,
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            raise RuntimeError("Could not get users")
            # return False

    def existsUser(self,name):
        key="%s"%(name)
        return self.users2id.has_key(key)

    def getUserId(self,name):
        key="%s"%(name)
        if not self.users2id.has_key(key):
            raise RuntimeError("Could not find user with name:%s"%(name))
        return int(self.users2id[key])

    def getProjectId(self,namespace,name):
        key="%s__%s"%(namespace,name)
        if not self.projects2id.has_key(key):
            raise RuntimeError("Could not find project with owner:%s and name:%s"%(namespace,name))
        return int(self.projects2id[key])

    def existsProject(self,namespace,name):
        key="%s__%s"%(namespace,name)
        return self.projects2id.has_key(key)

    def getGroupId(self,name):
        key=name
        if not self.groups2id.has_key(key):
            raise RuntimeError("Could not find group with name:%s"%(name))
        return int(self.groups2id[key])

    def existsGroup(self,name):
        key=name
        return self.groups2id.has_key(key)

    def getuser(self, id_):
        """
        Get info for a user identified by id
        :param id_: id of the user
        :return: False if not found, a dictionary if found
        """
        request = requests.get(self.users_url + "/" + str(id_),
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            raise RuntimeError("could not get user with id:%s"%id)
            # return False

    def createuser(self, name,
                   username,
                   password,
                   email,
                   skype="",
                   linkedin="",
                   twitter="",
                   projects_limit="",
                   extern_uid="",
                   provider="",
                   bio="",
                   sudo=""):
        """
        Create a user
        :param name: Obligatory
        :param username: Obligatory
        :param password: Obligatory
        :param email: Obligatory
        :return: TRue if the user was created,false if it wasn't(already exists)
        """
        data = {"name": name, "username": username, "password": password,
                "email": email, "skype": skype,
                "twitter": twitter, "linkedin": linkedin,
                "projects_limit": projects_limit, "extern_uid": extern_uid,
                "provider": provider, "bio": bio}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.users_url, headers=self.headers, data=data,verify=self.verify_ssl)

        if request.status_code == 201:
            return json.loads(request.content.decode("utf-8"))
        elif request.status_code == 404:
            data["password"]="****"
            raise RuntimeError("could not create user %s"%data)
            # return False

    def deleteuser(self, id_):
        """
        Deletes an user by ID
        :param id_: id of the user to delete
        :return: True if it deleted, False if it couldn't. False could happen
        for several reasons, but there isn't a
        good way of differenting them
        """
        request = requests.delete(self.users_url + "/" + str(id_),
                                  headers=self.headers)
        if request.status_code == 200:
            return True
        else:

            return False

    def currentuser(self):
        """
        Returns the current user parameters. The current user is linked
        to the secret token
        :return: a list with the current user properties
        """
        request = requests.get(self.host + "/api/v3/user",
                               headers=self.headers, verify=self.verify_ssl)
        return json.loads(request.content.decode("utf-8"))

    def edituser(self, id_,
                 name="",
                 username="",
                 password="",
                 email="",
                 skype="",
                 linkedin="",
                 twitter="",
                 projects_limit="",
                 extern_uid="",
                 provider="",
                 bio="",
                 sudo=""):
        """
        Edits an user data. Unfortunately we have to check ALL the params,
        as they can't be empty or the user will get all their data empty,
        so we only send the filled params
        :param id_: id of the user to change
        :param name: name
        :param username: username
        :param password: pass
        :param email: email
        :param skype: skype
        :param linkedin: linkedin
        :param twitter: twitter
        :param projects_limit: the limits project, default is 10
        :param extern_uid: no idea
        :param provider: google login for example
        :param bio: bio
        :param sudo: do the task as the user provided
        :return: alway true as gitlab answers with a 404
        """
        data = {}
        if name != "":
            data["name"] = name
        if username != "":
            data["username"] = username
        if password != "":
            data["password"] = password
        if email != "":
            data["email"] = email
        if skype != "":
            data["skype"] = skype
        if linkedin != "":
            data["linkedin"] = linkedin
        if twitter != "":
            data["twitter"] = twitter
        if projects_limit != "":
            data["projects_limit"] = projects_limit
        if extern_uid != "":
            data["extern_uid"] = extern_uid
        if provider != "":
            data["provider"] = provider
        if bio != "":
            data["bio"] = bio
        if sudo != "":
            data['sudo'] = sudo
        request = requests.put(self.users_url + "/" + str(id_),
                               headers=self.headers, data=data)
        if request.status_code == 404:
            return True
        # There is a problem here and that is that the api always return 404,
        #  doesn't matter what heappened with the request,
        # so now way of knowing what happened
        else:
            return False

    def getsshkeys(self):
        """
        Gets all the ssh keys for the current user
        :return: a dictionary with the lists
        """
        request = requests.get(self.keys_url, headers=self.headers,
                               verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def getsshkey(self, id_):
        """
        Get a single ssh key identified by id_
        :param id_: the id of the key
        :return: the key itself
        """
        request = requests.get(self.keys_url + "/" + str(id_),
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def addsshkey(self, title, key, sudo=""):
        """
        Add a new ssh key for the current user
        :param title: title of the new key
        :param key: the key itself
        :return: true if added, false if it didn't add it
        (it could be because the name or key already exists)
        """
        data = {"title": title, "key": key}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.keys_url, headers=self.headers, data=data,
                                verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def addsshkeyuser(self, id_, title, key, sudo=""):
        """
        Add a new ssh key for the user identified by id
        :param id_: id of the user to add the key to
        :param title: title of the new key
        :param key: the key itself
        :return: true if added, false if it didn't add it
        (it could be because the name or key already exists)
        """
        data = {"title": title, "key": key}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.users_url + "/" + str(id_) + "/keys",
                                headers=self.headers, data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def deletesshkey(self, id_):
        """
        Deletes an sshkey for the current user identified by id
        :param id_: the id of the key
        :return: False if it didn't delete it, True if it was deleted
        """
        request = requests.delete(self.keys_url + "/" + str(id_),
                                  headers=self.headers)
        if request.content == "null":

            return False
        else:
            return True

    def getprojects(self, page=1, per_page=20, sudo=""):
        """
        Returns a dictionary of all the projects
        :param page: Which page to return (default is 1)
        :param per_page: Number of items to return per page (default is 20)
        :return: list with the repo name, description, last activity,
         web url, ssh url, owner and if its public
        """
        data = {'page': page, 'per_page': per_page}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.get(self.projects_url, params=data,
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getallprojects(self, page=1, per_page=20, sudo=""):
        """
        Returns a dictionary of all the projects for admins only
        :param page: Which page to return (default is 1)
        :param per_page: Number of items to return per page (default is 20)
        :return: list with the repo name, description, last activity,
         web url, ssh url, owner and if its public
        """
        data = {'page': page, 'per_page': per_page}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.get(self.projects_url + '/all', params=data,
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getproject(self, id_):
        """
        Get info for a project identified by id
        :param id_: id of the project
        :return: False if not found, a dictionary if found
        """
        request = requests.get(self.projects_url + "/" + str(id_),
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def getprojectevents(self, id_, page=1, per_page=20):
        """
        Get the project identified by id, events(commits)
        :param id_: id of the project
        :param page: Which page to return (default is 1)
        :param per_page: Number of items to return per page (default is 20)
        :return: False if no project with that id, a dictionary
         with the events if found
        """
        data = {'page': page, 'per_page': per_page}
        request = requests.get(self.projects_url + "/" + str(id_) +
                               "/events", params=data, headers=self.headers,
                               verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def createproject(self, name, description="",
                      issues_enabled=0, wall_enabled=0,
                      merge_requests_enabled=0, wiki_enabled=0,
                      snippets_enabled=0, public=0, group="admin"):
        """
        Create a project
        :param name: Obligatory
        :return: Dict of information on the newly created project if successful,
         False otherwise
        """
        data = {"name": name, "description": description,
                "issues_enabled": issues_enabled, "wall_enabled": wall_enabled,
                "merge_requests_enabled": merge_requests_enabled,
                "wiki_enabled": wiki_enabled,
                "snippets_enabled": snippets_enabled}

        # if gitlab is the new 6th version, there is a public option for the
        # project creation
        if type(public) != int:
            raise TypeError
        if public != 0:
            data['public'] = public
        request = requests.post(self.projects_url, headers=self.headers,
                                data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            self._getProjectsInit()
            return json.loads(request.content.decode("utf-8"))
        elif request.status_code == 403:
            if "Your own projects limit is 0" in request.content:
                print(request.content)
                raise RuntimeError("Your own projects limit is 0")
                # return False
        elif request.status_code == 404:
            print(request.content)
            raise RuntimeError("error 404:%s"%request.content)

        if request.status_code>0:
            raise RuntimeError("Could not create project, msg:%s"%request.content)
            # return False

    def deleteproject(self, project_id):
        """
        Delete a project
        :param id_: project id
        :return: always true
        """
        request = requests.delete(self.projects_url + "/" + str(project_id),
                                  headers=self.headers)
        if request.status_code == 200:
            self._getProjectsInit()
            return True

    def createprojectuser(self, id_, name, description="", default_branch="",
                          issues_enabled=0, wall_enabled=0,
                          merge_requests_enabled=0, wiki_enabled=0, public=0,
                          snippets_enabled=0, sudo=""):
        """
        Create a project for the given user identified by id
        :param id_: id of the user to crete the project for
        :param name: Obligatory
        :return: True if it created the project, False otherwise
        """
        data = {"name": name, "description": description,
                "default_branch": default_branch,
                "issues_enabled": issues_enabled, "wall_enabled": wall_enabled,
                "merge_requests_enabled": merge_requests_enabled,
                "wiki_enabled": wiki_enabled,
                "snippets_enabled": snippets_enabled}
        if type(public) != int:
            raise TypeError
        if public != 0:
            data['public'] = public
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.projects_url + "/user/" + str(id_),
                                headers=self.headers, data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            self._getProjectsInit()
            return True
        else:
            return False

    def listprojectmembers(self, id_):
        """
        lists the members of a given project id
        :param id_: the project id
        :return: the projects memebers
        """
        request = requests.get(self.projects_url + "/" + str(id_) + "/members",
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def addprojectmember(self, id_, user_id, access_level, sudo=""):
        # check the access level and put into a number
        """
        adds a project member to a project
        :param id_: project id
        :param user_id: user id
        :param access_level: access level, see gitlab help to know more
        :param sudo: do the request with another user
        :return: True if success
        """
        if access_level.lower() == "master":
            access_level = 40
        elif access_level.lower() == "developer":
            access_level = 30
        elif access_level.lower() == "reporter":
            access_level = 20
        else:
            access_level = 10
        data = {"id": id_, "user_id": user_id, "access_level": access_level}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.projects_url + "/" + str(id_) + "/members",
                                headers=self.headers, data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:
            return False

    def editprojectmember(self, id_, user_id, access_level, sudo=""):
        """
        edit a project member
        :param id_: project id
        :param user_id: user id
        :param access_level: access level
        :param sudo: do the request as another user
        :return: True if success
        """
        if access_level.lower() == "master":
            access_level = 40
        elif access_level.lower() == "developer":
            access_level = 30
        elif access_level.lower() == "reporter":
            access_level = 20
        else:
            access_level = 10
        data = {"id": id_, "user_id": user_id,
                "access_level": access_level}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.put(self.projects_url + "/" + str(id_) + "/members/"
                               + str(user_id), headers=self.headers, data=data)
        if request.status_code == 200:
            return True
        else:

            return False

    def deleteprojectmember(self, id_, user_id):
        """
        Delete a project member
        :param id_: project id
        :param user_id: user id
        :return: always true
        """
        request = requests.delete(self.projects_url + "/" + str(id_)
                                  + "/members/" + str(user_id),
                                  headers=self.headers)
        if request.status_code == 200:
            return True  # It always returns true

    # TODO: hooks are now system wide and under the /hooks url
    # TODO: change all the hooks methods, not valid anymore
    # TODO: write tests for the hooks
    def getprojecthooks(self, id_):
        """
        get all the hooks from a project
        :param id_: project id
        :return: the hooks
        """
        request = requests.get(self.projects_url + "/" + str(id_) + "/hooks",
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def getprojecthook(self, id_, hook_id):
        """
        get a particular hook from a project
        :param id_: project id
        :param hook_id: hook id
        :return: the hook
        """
        request = requests.get(self.projects_url + "/" + str(id_) + "/hooks/" +
                               str(hook_id), headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def addprojecthook(self, id_, url):
        """
        add a hook to a project
        :param id_: project id
        :param url: url of the hook
        :return: True if success
        """
        data = {"id": id_, "url": url}
        request = requests.post(self.projects_url + "/" + str(id_) + "/hooks",
                                headers=self.headers, data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def editprojecthook(self, id_, hook_id, url, sudo=""):
        """
        edit an existing hook from a project
        :param id_: project id
        :param hook_id: hook id
        :param url: the new url
        :param sudo: do the request as another user
        :return: True if success
        """
        data = {"id": id_, "hook_id": hook_id, "url": url}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.put(self.projects_url + "/" + str(id_) + "/hooks/" +
                               str(hook_id), headers=self.headers,
                               data=data)
        if request.status_code == 200:
            return True
        else:

            return False

    def deleteprojecthook(self, id_, hook_id):
        """
        delete a project hook
        :param id_: project id
        :param hook_id: hook id
        :return: True if success
        """
        request = requests.delete(self.projects_url + "/" + str(id_)
                                  + "/hooks/"
                                  + str(hook_id), headers=self.headers)
        if request.status_code == 200:
            return True
        else:

            return False

    def listbranches(self, id_):
        """
        list all the branches from a project
        :param id_: project id
        :return: the branches
        """
        request = requests.get(self.projects_url + "/" + str(id_) +
                               "/repository/branches", headers=self.headers,
                               verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def listbranch(self, id_, branch):
        """
        list one branch from a project
        :param id_: project id
        :param branch: branch id
        :return: the branch
        """
        request = requests.get(self.projects_url + "/" + str(id_) +
                               "/repository/branches/" + str(branch),
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def protectbranch(self, id_, branch):
        """
        protect a branch from changes
        :param id_: project id
        :param branch: branch id
        :return: True if success
        """
        request = requests.put(self.projects_url + "/" + str(id_) +
                               "/repository/branches/" + str(branch) +
                               "/protect", headers=self.headers)
        if request.status_code == 200:
            return True
        else:

            return False

    def unprotectbranch(self, id_, branch):
        """
        stop protecting a branch
        :param id_: project id
        :param branch: branch id
        :return: true if success
        """
        request = requests.put(self.projects_url + "/" + str(id_) +
                               "/repository/branches/" + str(branch) +
                               "/unprotect", headers=self.headers)
        if request.status_code == 200:
            return True
        else:

            return False

    def createforkrelation(self, id_, from_):
        """
        create a fork relation. This DO NOT create a fork but only adds
        the relation between 2 repositories
        :param id_: project id
        :param from_: from id
        :return: true if success
        """
        data = {"id": id_, "forked_from_id": from_}
        request = requests.post(self.projects_url + "/" + str(id_) +
                                "/fork/" + str(from_), headers=self.headers,
                                data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def removeforkrelation(self, id_):
        """
        remove an existing fork relation. this DO NOT remove the fork,
        only the relation between them
        :param id_: project id
        :return: true if success
        """
        request = requests.delete(self.projects_url + "/" + str(id_) +
                                  "/fork", headers=self.headers)
        if request.status_code == 200:
            return True
        else:

            return False

    def getissues(self, page=1, per_page=20, sudo=""):
        """
        Return a global list of issues for your user.
        :param page: Which page to return (default is 1)
        :param per_page: Number of items to return per page (default is 20)
        """
        data = {'page': page, 'per_page': per_page}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.get(self.host + "/api/v3/issues",
                               params=data, headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def getprojectissues(self, id_, page=1, per_page=20, sudo=""):
        """
        Return a list of issues for project id_.
        :param id_: The id for the project.
        :param page: Which page to return (default is 1)
        :param per_page: Number of items to return per page (default is 20)
        """
        data = {'page': page, 'per_page': per_page}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.get(self.projects_url + "/" + str(id_) +
                               "/issues", params=data, headers=self.headers,
                               verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def getprojectissue(self, id_, issue_id):
        """
        get an specific issue id from a project
        :param id_: project id
        :param issue_id: issue id
        :return: the issue
        """
        request = requests.get(self.projects_url + "/" + str(id_) +
                               "/issues/" + str(issue_id), headers=self.headers,
                               verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def createissue(self, id_, title, description="", assignee_id="",
                    milestone_id="", labels="", sudo=""):
        """
        create a new issue
        :param id_: project id
        :param title: title of the issue
        :param description: description
        :param assignee_id: assignee for the issue
        :param milestone_id: milestone
        :param labels: label
        :param sudo: do the request as another user
        :return: true if success
        """
        data = {"id": id, "title": title, "description": description,
                "assignee_id": assignee_id,
                "milestone_id": milestone_id, "labels": labels}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.projects_url + "/" + str(id_) + "/issues",
                                headers=self.headers, data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def editissue(self, id_, issue_id, title="", description="",
                  assignee_id="", milestone_id="", labels="",
                  state_event="", sudo=""):
        """
        edit an existing issue data
        :param id_: project id
        :param issue_id: issue id
        :param title: title
        :param description: description
        :param assignee_id: asignee
        :param milestone_id: milestone
        :param labels: label
        :param state_event: state
        :param sudo: do the request as another user
        :return: true if success
        """
        data = {"id": id_, "issue_id": issue_id}
        if title != "":
            data['title'] = title
        if description != "":
            data['description'] = description
        if assignee_id != "":
            data['assignee_id'] = assignee_id
        if milestone_id != "":
            data['milestone_id'] = milestone_id
        if labels != "":
            data['labels'] = labels
        if state_event != "":
            data['state_event'] = state_event
        if sudo != "":
            data['sudo'] = sudo
        request = requests.put(self.projects_url + "/" + str(id_) + "/issues/" +
                               str(issue_id), headers=self.headers,
                               data=data)
        if request.status_code == 200:
            return True
        else:
            return False

    def getmilestones(self, id_):
        """
        get the milestones for a project
        :param id_: project id
        :return: the milestones
        """
        request = requests.get(self.projects_url + "/" + str(id_) +
                               "/milestones", headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def getmilestone(self, id_, milestone_id):
        """
        get an specific milestone
        :param id_: project id
        :param milestone_id: milestone id
        :return: the milestone
        """
        request = requests.get(self.projects_url + "/" + str(id_)
                               + "/milestones/"
                               + str(milestone_id), headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def createmilestone(self, id_, title, description="", due_date="", sudo=""):
        """
        create a new milestone
        :param id_: project id
        :param title: title
        :param description: description
        :param due_date: due date
        :param sudo: do the request as another user
        :return: true if success
        """
        data = {"id": id_, "title": title, "description": description,
                "due_date": due_date}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.projects_url + "/" + str(id_) +
                                "/milestones", headers=self.headers, data=data,
                                verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def editmilestone(self, id_, milestone_id, title="", description="",
                      due_date="", state_event="", sudo=""):
        """
        edit an existing milestone
        :param id_: project id
        :param milestone_id: milestone id
        :param title: title
        :param description: description
        :param due_date: due date
        :param state_event: state
        :param sudo: do the request as another user
        :return: true if success
        """
        data = {"id": id_, "milestone_id": milestone_id, "title": title,
                "description": description,
                "due_date": due_date, "state_event": state_event}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.put(self.projects_url + "/" + str(id_)
                               + "/milestones/"
                               + str(milestone_id), headers=self.headers,
                               data=data)
        if request.status_code == 200:
            return True
        else:

            return False

    def listdeploykeys(self, id_):
        """
        Get a list of a project's deploy keys.
        :param id_: project id
        :return: the keys in a dictionary if success, false if not
        """
        request = requests.get(self.projects_url + "/" + str(id_) + "/keys",
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def listdeploykey(self, id_, key_id):
        """
        Get a single key.
        :param id_: project id
        :param key_id: key id
        :return: the key in a dict if success, false if not
        """
        request = requests.get(self.projects_url + "/" + str(id_) + "/keys/" +
                               str(key_id), headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def adddeploykey(self, id_, title, key, sudo=""):
        """
        Creates a new deploy key for a project.
        If deploy key already exists in another project - it will be joined
        to project but only if original one was is accessible by same user
        :param id_: project id
        :param title: title of the key
        :param key: the key itself
        :return: true if sucess, false if not
        """
        data = {"id": id_, "title": title, "key": key}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.projects_url + "/" + str(id_) + "/keys",
                                headers=self.headers, data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def deletedeploykey(self, id_, key_id):
        """
        Delete a deploy key from a project
        :param id_: project id
        :param key_id: key id to delete
        :return: true if success, false if not
        """
        request = requests.delete(self.projects_url + "/" + str(id_) + "/keys/"
                                  + str(key_id), headers=self.headers)
        if request.status_code == 200:
            return True
        else:

            return False

    def getreadme(self, repo, mark=False):
        """
        returns the readme
        :param mark: If false returns the raw readme,
        else returns the readme parsed by markdown
        :param repo: the web url to the project
        """
        request = requests.get(repo + "/raw/master/README.md?private_token=" +
                               self.token, verify=self.verify_ssl)  # setting the headers doesn't work
        if "<!DOCTYPE html>" in request.content:  # having HTML means a 404
            if mark:
                return "<p>There isn't a README.md for that project</p>"
            else:
                return "There isn't a README.md for that project"
        else:
            if mark:
                return markdown.markdown(request.content)
            else:
                return request.content

    def creategroup(self, name, path):
        """
        Creates a new group
        :param name: The name of the group
        :param path: The path for the group
        """
        request = requests.post(self.groups_url,
                                data={'name': name, 'path': path},
                                headers=self.headers, verify=self.verify_ssl)
        print request.status_code
        print request.content
        if request.status_code == 201:
            return True
        else:
            return exceptions.HttpError(json.loads(request.content)['message'])

    def getgroups(self, id_=None, page=1, per_page=20, sudo=""):
        """
        Retrieve group information
        :param id_: Specify a group. Otherwise, all groups are returned
        :param page: Which page to return (default is 1)
        :param per_page: Number of items to return per page (default is 20)
        """
        data = {'page': page, 'per_page': per_page}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.get("{0}/{1}".format(self.groups_url,
                                                id_ if id_ else ""),
                               params=data, headers=self.headers,
                               verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def moveproject(self, group_id, project_id):
        """
        Move a given project into a given group
        :param group_id: ID of the destination group
        :param project_id: ID of the project to be moved
        """
        request = requests.post("{0}/{1}/projects/{2}".format(self.groups_url,
                                                              group_id,
                                                              project_id),
                                headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def getmergerequests(self, project_id, page=1, per_page=20, sudo=""):
        """
        Get all the merge requests for a project.
        :param project_id: ID of the project to retrieve merge requests for
        :param page: If pagination is set, which page to return
        :param per_page: Number of merge requests to return per page
        """
        data = {'page': page, 'per_page': per_page}
        if sudo != "":
            data['sudo'] = sudo
        url_str = '{0}/{1}/merge_requests'.format(self.projects_url, project_id)
        request = requests.get(url_str, params=data, headers=self.headers,
                               verify=self.verify_ssl)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def getmergerequest(self, project_id, mergerequest_id):
        """
        Get information about a specific merge request.
        :type project_id: int
        :param project_id: ID of the project
        :param mergerequest_id: ID of the merge request
        """
        url_str = '{0}/{1}/merge_request/{2}'.format(self.projects_url,
                                                     project_id,
                                                     mergerequest_id)
        request = requests.get(url_str, headers=self.headers, verify=self.verify_ssl)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:

            return False

    def createmergerequest(self, project_id, sourcebranch, targetbranch,
                           title, assignee_id=None, sudo=""):
        """
        Create a new merge request.
        :param project_id: ID of the project originating the merge request
        :param sourcebranch: name of the branch to merge from
        :param targetbranch: name of the branch to merge to
        :param title: Title of the merge request
        :param assignee_id: Assignee user ID
        """
        url_str = '{0}/{1}/merge_requests'.format(self.projects_url, project_id)
        data = {'source_branch': sourcebranch,
                'target_branch': targetbranch,
                'title': title,
                'assignee_id': assignee_id}
        if sudo != "":
            data['sudo'] = sudo

        request = requests.post(url_str, data=data, headers=self.headers,
                                verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def updatemergerequest(self, project_id, mergerequest_id, sourcebranch=None,
                           targetbranch=None, title=None,
                           assignee_id=None, closed=None, sudo=""):
        """
        Update an existing merge request.
        :param project_id: ID of the project originating the merge request
        :param mergerequest_id: ID of the merge request to update
        :param sourcebranch: name of the branch to merge from
        :param targetbranch: name of the branch to merge to
        :param title: Title of the merge request
        :param assignee_id: Assignee user ID
        :param closed: MR status.  True = closed
        """
        url_str = '{0}/{1}/merge_request/{2}'.format(self.projects_url,
                                                     project_id,
                                                     mergerequest_id)
        data = {'source_branch': sourcebranch,
                'target_branch': targetbranch,
                'title': title,
                'assignee_id': assignee_id,
                'closed': closed}
        if sudo != "":
            data['sudo'] = sudo

        request = requests.post(url_str, data=data, headers=self.headers,
                                verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:

            return False

    def addcommenttomergerequest(self, project_id, mergerequest_id, note):
        """
        Add a comment to a merge request.
        :param project_id: ID of the project originating the merge request
        :param mergerequest_id: ID of the merge request to comment on
        :param note: Text of comment
        """
        url_str = '{0}/{1}/merge_request/{2}/comments'.format(self.projects_url,
                                                              project_id,
                                                              mergerequest_id)
        request = requests.post(url_str, data={'note': note},
                                headers=self.headers, verify=self.verify_ssl)

        if request.status_code == 201:
            return True
        else:

            return False

    def getsnippets(self, project_id):
        """
        Get all the snippets of the project identified by project_id
        @param project_id: project id to get the snippets from
        @return: list of dictionaries
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/snippets",
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getsnippet(self, project_id, snippet_id):
        """
        Get one snippet from a project
        @param project_id: project id to get the snippet from
        @param snippet_id: snippet id
        @return: dictionary
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/snippets/" + str(snippet_id),
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode('utf-8'))
        else:
            return False

    def createsnippet(self, project_id, title, file_name, code, lifetime=""):
        """
        Creates an snippet
        @param project_id: project id to create the snippet under
        @param title: title of the snippet
        @param file_name: filename for the snippet
        @param code: content of the snippet
        @param lifetime: expiration date
        @return: True if correct, false if failed
        """
        data = {"id": project_id, "title": title, "file_name": file_name, "code": code}
        if lifetime != "":
            data["lifetime"] = lifetime
        request = requests.post(self.projects_url + "/" + str(project_id) + "/snippets",
                                data=data, headers=self.headers)
        if request.status_code == 201:
            return True
        else:
            return False

    def getsnippetcontent(self, project_id, snippet_id):
        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/snippets/" + str(snippet_id) + "/raw",
                               headers=self.headers)
        if request.status_code == 200:
            return request.content
        else:
            return False

    def deletesnippet(self, project_id, snippet_id):
        request = requests.delete(self.projects_url + "/" + str(project_id) +
                                  "/snippets/" + str(snippet_id), headers=self.headers)
        if request.status_code == 200:
            return True
        else:
            return False

    def getrepositories(self, project_id):
        request = requests.get(self.projects_url + "/" + str(project_id) + "/repository/branches",
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getrepositorybranch(self, project_id, branch):
        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/branches/" + str(branch),
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        elif request.status_code == 404:
            if json.loads(request.content.decode("utf-8"))['message'] == "404 Branch does not exist Not Found":
                # In the future we should raise an exception here
                return False
        else:
            return False

    def protectrepositorybranch(self, project_id, branch_name):
        request = requests.put(self.projects_url + "/" + str(project_id) +
                               "/repository/branches/" + str(branch_name) + "/protect",
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def unprotectrepositorybranch(self, project_id, branch_name):
        request = requests.put(self.projects_url + "/" + str(project_id) +
                               "/repository/branches/" + str(branch_name) + "/unprotect",
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return

    def listrepositorytags(self, project_id):
        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/tags", headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def listrepositorycommits(self, project_id):
        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/commits", headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def listrepositorycommit(self, project_id, sha1):
        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/commits/" + str(sha1),
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def listrepositorycommitdiff(self, project_id, sha1):
        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/commits/" + str(sha1) + "/diff",
                               headers=self.headers)
        if request.status_code == 200:
            # it returns a list of dicts, which is nonsense as we are requesting
            # just one diff, so we use the [0] to return only the first and only
            # element
            return json.loads(request.content.decode("utf-8"))[0]
        else:
            return False

    def listrepositorytree(self, project_id, path="", ref_name=""):
        data = {}
        if path != "":
            data['path'] = path
        if ref_name != "":
            data['ref_name'] = ref_name

        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/tree/", params=data,
                               headers=self.headers)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getrawblob(self, project_id, sha1, path):
        data = {"filepath": path}

        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/blobs/" + str(sha1),
                               params=data, headers=self.headers)
        if request.status_code == 200:
            return request.content.decode("utf-8")
        else:
            return False

    def searchproject(self, search, page=1, per_page=20):
        """
        projects section
        """
        data = {'page': page, 'per_page': per_page}
        request = requests.get(self.search_url + str(search), params=data,
                               headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            raise exceptions.HttpError(json.loads(request.content)['message'])

    def getfilearchive(self, project_id, filepath="", sha1=""):
        """
        repository section
        """
        request = requests.get(self.projects_url + "/" + str(project_id) +
                               "/repository/archive", headers=self.headers)
        if request.status_code == 200:
            if filepath == "":
                filepath = request.headers['content-disposition'].split(";")[1].split("=")[1].strip('"')
            with open(filepath, "wb") as filesave:
                filesave.write(request.content)
                # TODO: Catch oserror exceptions as no permissions and such
                # TODO: change the filepath to a path and keep always the filename?
            return True
        else:
            raise exceptions.HttpError(json.loads(request.content)['message'])

    def deletegroup(self, group_id):
        """
        groups section, new in 6.2

        Deletes an group by ID
        :param id_: id of the group to delete
        :return: True if it deleted, False if it couldn't. False could happen
        for several reasons, but there isn't a
        good way of differentiating them
        """
        request = requests.delete(self.groups_url + "/" + str(group_id),
                                  headers=self.headers)
        if request.status_code == 200:
            return True
        else:
            return False

    def listgroupmembers(self, group_id):
        """
        list group members
        new in 6.2

        lists the members of a given group id
        :param group_id: the group id
        :return: the group's members
        """
        request = requests.get(self.groups_url + "/" + str(group_id) + "/members",
                               headers=self.headers, verify=self.verify_ssl)
        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def addgroupmember(self, group_id, user_id, access_level, sudo=""):
        """
        add a user to a group
        new in 6.2

        # check the access level and put into a number

        adds a project member to a project
        :param id_: project id
        :param user_id: user id
        :param access_level: access level, see gitlab help to know more
        :param sudo: do the request with another user
        :return: True if success
        """
        if access_level.lower() == "master":
            access_level = 40
        elif access_level.lower() == "developer":
            access_level = 30
        elif access_level.lower() == "reporter":
            access_level = 20
        else:
            access_level = 10
        data = {"id": group_id, "user_id": user_id, "access_level": access_level}
        if sudo != "":
            data['sudo'] = sudo
        request = requests.post(self.groups_url + "/" + str(group_id) + "/members",
                                headers=self.headers, data=data, verify=self.verify_ssl)
        if request.status_code == 201:
            return True
        else:
            return False

    def deletegroupmember(self, group_id, user_id):
        """
        Delete a group member
        :param id_: project id
        :param user_id: user id
        :return: always true
        """
        request = requests.delete(self.groups_url + "/" + str(group_id)
                                  + "/members/" + str(user_id),
                                  headers=self.headers)
        if request.status_code == 200:
            return True  # It always returns true

    def getprojectwallnotes(self, project_id):
        """
        get the notes from the wall of a project
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/notes",
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getprojectwallnote(self, project_id, note_id):
        """
        get one note from the wall of the project
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/notes/" + str(note_id),
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def createprojectwallnote(self, project_id, content):
        """
        create a new note
        """
        data = {"body": content}
        request = requests.post(self.projects_url + "/" + str(project_id) + "/notes",
                                  headers=self.headers, data=data)

        if request.status_code == 201:
            return True
        else:
            return False

    def getissuewallnotes(self, project_id, issue_id):
        """
        get the notes from the wall of a issue
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/issues/" + str(issue_id) + "/notes",
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getissuewallnote(self, project_id, issue_id, note_id):
        """
        get one note from the wall of the issue
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/issues/" + str(issue_id) + "/notes/" + str(note_id),
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def createissuewallnote(self, project_id, issue_id, content):
        """
        create a new note
        """
        data = {"body": content}
        request = requests.post(self.projects_url + "/" + str(project_id) + "/issues/" + str(issue_id) + "/notes",
                                  headers=self.headers, data=data)

        if request.status_code == 201:
            return True
        else:
            return False

    def getsnippetwallnotes(self, project_id, snippet_id):
        """
        get the notes from the wall of a snippet
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/snippets/" + str(snippet_id) + "/notes",
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getsnippetwallnote(self, project_id, snippet_id, note_id):
        """
        get one note from the wall of the snippet
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/snippets/" + str(snippet_id) + "/notes/" + str(note_id),
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def createsnippetewallnote(self, project_id, snippet_id, content):
        """
        create a new note
        """
        data = {"body": content}
        request = requests.post(self.projects_url + "/" + str(project_id) + "/snippets/" + str(snippet_id) + "/notes",
                                  headers=self.headers, data=data)

        if request.status_code == 201:
            return True
        else:
            return False

    def getmergerequestwallnotes(self, project_id, merge_request_id):
        """
        get the notes from the wall of a merge request
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/merge_requests/" + str(merge_request_id) + "/notes",
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def getmergerequestwallnote(self, project_id, merge_request_id, note_id):
        """
        get one note from the wall of the merge request
        """
        request = requests.get(self.projects_url + "/" + str(project_id) + "/merge_requests/" + str(merge_request_id) + "/notes/" + str(note_id),
                                  headers=self.headers)

        if request.status_code == 200:
            return json.loads(request.content.decode("utf-8"))
        else:
            return False

    def createmergerequestewallnote(self, project_id, merge_request_id, content):
        """
        create a new note
        """
        data = {"body": content}
        request = requests.post(self.projects_url + "/" + str(project_id) + "/merge_requests/" + str(merge_request_id) + "/notes",
                                  headers=self.headers, data=data)

        if request.status_code == 201:
            return True
        else:
            return False

    def createfile(self, project_id, file_path, branch_name, content, commit_message):
        """
        Creates a new file in the repository
        :param project_id: project id
        :param file_path: Full path to new file. Ex. lib/class.rb
        :param branch_name: The name of branch
        :param content: File content
        :param commit_message: Commit message
        :return: true if success, false if not
        """
        data = {"file_path": file_path, "branch_name": branch_name,
                "content": content, "commit_message": commit_message}
        request = requests.post(self.projects_url + "/" + str(project_id) + "/repository/files",
                                  headers=self.headers, data=data)

        if request.status_code == 201:
            return True
        else:
            return False

    def updatefile(self, project_id, file_path, branch_name, content, commit_message):
        """
        Updates an existing file in the repository
        :param project_id: project id
        :param file_path: Full path to new file. Ex. lib/class.rb
        :param branch_name: The name of branch
        :param content: File content
        :param commit_message: Commit message
        :return: true if success, false if not
        """
        data = {"file_path": file_path, "branch_name": branch_name,
                "content": content, "commit_message": commit_message}
        request = requests.put(self.projects_url + "/" + str(project_id) + "/repository/files",
                                  headers=self.headers, data=data)

        if request.status_code == 200:
            return True
        else:
            return False

    def deletefile(self, project_id, file_path, branch_name, commit_message):
        """
        Deletes existing file in the repository
        :param project_id: project id
        :param file_path: Full path to new file. Ex. lib/class.rb
        :param branch_name: The name of branch
        :param commit_message: Commit message
        :return: true if success, false if not
        """
        data = {"file_path": file_path, "branch_name": branch_name,
                "commit_message": commit_message}
        request = requests.delete(self.projects_url + "/" + str(project_id) + "/repository/files",
                                  headers=self.headers, data=data)

        if request.status_code == 200:
            return True
        else:
            return False

    def setgitlabciservice(self, project_id, token, project_url):
        """
        Set GitLab CI service for project
        :param project_id: project id
        :param token: CI project token
        :param project_url: CI project url
        :return: true if success, false if not
        """
        data = {"token": token, "project_url": project_url}
        request = requests.put(self.projects_url + "/" + str(project_id) + "/services/gitlab-ci",
                                  headers=self.headers, data=data)

        if request.status_code == 200:
            return True
        else:
            return False

    def deletegitlabciservice(self, project_id, token, project_url):
        """
        Delete GitLab CI service settings
        :return: true if success, false if not
        """
        request = requests.delete(self.projects_url + "/" + str(project_id) + "/services/gitlab-ci",
                                  headers=self.headers)

        if request.status_code == 200:
            return True
        else:
            return False

redpajama_set_name: RedPajamaGithub


Originally a small fishing village La Cala de Mijas is considered by many to be the best mix of Spain and tourism on the coast. Everything in the town of La Cala is within easy walking distance and the ground is level.
Home to many offices of the local authority, the town also has many cafes and restaurants that give the small town a lively feel all year round. La Cala has all that you could possibly need in regards to services, shops and facilities. It is also well known for its beautiful sandy beaches that gently slide into the Mediterranean. Close by are some of the newest developments on the coast, as well as a 5 star resort with 3 stunning golf courses.
La Cala de Mijas; let Marbella Property Consultants introduce you to its many charms. Our local knowledge will help you discover all the latest options and the many different types of properties in the area. Whether you want to be within walking distance of everything or want to be in the rolling countryside close by, Marbella Property Consultants will make sure you find the ideal property for you.
With many years knowledge of the coast and the area, we at MPC will find an extensive, tailored selection of apartments in the La Cala area for you. Our extensive network and links to all the most knowledgeable people in the area mean that we will find the very best property that fits your needs and budget.


BEST PRIVATE SERVER AROUND / 6 YEARS ONLINE / DEDICATED SERVER / NO LAG / FULL MERCENARY EQUIPMENT / INCREASED CHEST, INVENTORY, CUBE SIZE / EXPERIENCED CODERS AND PATCHERS WORKING FOR YOU / 200+ ONLINE PLAYERS / JOIN US TODAY !!!
DK Genesis is a game about vampires, slayer (hunters) and ousters. This horror Game is quite similar to Diablo, but 100% FREE MMORPG. Enjoy active community, events and very expert staff.
Diablo 3 pvp ladders and clan pvp ladders. Our community also contains a minecraft server for our members.


text:
package org.physical_web.physicalweb;

import org.physical_web.physicalweb.PwoMetadata.BleMetadata;
import org.physical_web.physicalweb.PwoMetadata.UrlMetadata;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log;

import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageRequest;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * This class sends requests to the physical web service.
 *
 * For the largest use, metadata requests, the physical web service
 * scrapes the page at the given url for its metadata.
 */
class PwsClient {
  private static final String TAG = "PwsClient";
  private static final String PROD_URL = "https://url-caster.appspot.com";
  private static final String DEV_URL = "https://url-caster-dev.appspot.com";
  private static final String RESOLVE_SCAN_PATH = "resolve-scan";
  private static final String SHORTEN_URL_PATH = "shorten-url";
  private static final int UNDEFINED_SCORE = -1;
  private RequestQueue mRequestQueue;
  private Context mContext;
  private String mEndpointUrl;

  private static PwsClient mInstance;

  private PwsClient(Context context) {
    mContext = context.getApplicationContext();
    mRequestQueue = Volley.newRequestQueue(mContext);
    mEndpointUrl = PROD_URL;
  }

  public static PwsClient getInstance(Context context) {
    if (mInstance == null) {
        mInstance = new PwsClient(context);
    }
    return mInstance;
  }

  /////////////////////////////////
  // callbacks
  /////////////////////////////////

  public interface ResolveScanCallback {
    public void onUrlMetadataReceived(PwoMetadata pwoMetadata);
    public void onUrlMetadataAbsent(PwoMetadata pwoMetadata);
  }

  public interface DownloadIconCallback {
    public void onUrlMetadataIconReceived(PwoMetadata pwoMetadata);
    public void onUrlMetadataIconError(PwoMetadata pwoMetadata);
  }

  public interface ShortenUrlCallback {
    public void onUrlShortened(String shortUrl);
    public void onError(String longUrl);
  }

  /////////////////////////////////
  // utilities
  /////////////////////////////////

  private String constructUrlStr(final String path) {
    return mEndpointUrl + "/" + path;
  }

  public void shortenUrl(final String longUrl,
                         final ShortenUrlCallback shortenUrlCallback,
                         final String tag) {
    // Create the json payload
    JSONObject jsonObject = new JSONObject();
    try {
      jsonObject.put("longUrl", longUrl);
    } catch (JSONException e) {
      Log.e(TAG, "JSONException: " + e.toString());
      shortenUrlCallback.onError(longUrl);
      return;
    }

    // Create the http request
    JsonObjectRequest request = new JsonObjectRequest(
        constructUrlStr(SHORTEN_URL_PATH),
        jsonObject,
        new Response.Listener<JSONObject>() {
          @Override
          public void onResponse(JSONObject jsonResponse) {
            String shortUrl;
            try {
              shortUrl = jsonResponse.getString("id");
            } catch (JSONException e) {
              Log.e(TAG, "JSONException: " + e.toString());
              shortenUrlCallback.onError(longUrl);
              return;
            }
            shortenUrlCallback.onUrlShortened(shortUrl);
          }
        },
        new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError volleyError) {
            Log.i(TAG, "VolleyError: " + volleyError.toString());
            shortenUrlCallback.onError(longUrl);
          }
        }
    );
    request.setTag(tag);

    // Send off the request
    mRequestQueue.add(request);
  }

  public void findUrlMetadata(PwoMetadata pwoMetadata,
                              ResolveScanCallback resolveScanCallback,
                              final String tag) {
    List<PwoMetadata> pwoMetadataList = Arrays.asList(pwoMetadata);
    findUrlMetadata(pwoMetadataList, resolveScanCallback, tag);
  }

  public void findUrlMetadata(Collection<PwoMetadata> pwoMetadataCollection,
                              ResolveScanCallback resolveScanCallback,
                              final String tag) {
    // Create the metadata request
    // for the given json request object
    JsonObjectRequest request = createUrlMetadataRequest(pwoMetadataCollection,
                                                         resolveScanCallback);
    request.setTag(tag);
    // Queue the request
    mRequestQueue.add(request);
  }

  /**
   * Create the json request object
   * that will be sent to the metadata server
   * asking for metadata for the given url.
   *
   * @param url The url for which the request data will be created
   * @return The constructed json object
   */
  private static JSONObject createUrlMetadataRequestObject(
      Collection<PwoMetadata> pwoMetadataCollection) {
    JSONArray urlJsonArray = new JSONArray();
    for (PwoMetadata pwoMetadata : pwoMetadataCollection) {
      try {
        JSONObject urlJsonObject = new JSONObject();
        urlJsonObject.put("url", pwoMetadata.url);
        if (pwoMetadata.hasBleMetadata()) {
          BleMetadata bleMetadata = pwoMetadata.bleMetadata;
          urlJsonObject.put("txpower", bleMetadata.txPower);
          urlJsonObject.put("rssi", bleMetadata.rssi);
        }
        urlJsonArray.put(urlJsonObject);
      } catch (JSONException ex) {
        Log.d(TAG, "error: " + ex);
      }
    }

    JSONObject jsonObject = new JSONObject();
    try {
      jsonObject.put("objects", urlJsonArray);
    } catch (JSONException ex) {
      Log.d(TAG, "error: " + ex);
    }
    return jsonObject;
  }

  /**
   * Create the url metadata request, given the json request object.
   *
   * @param jsonObj The given json object to use in the request
   * @return The created json request object
   */
  private JsonObjectRequest createUrlMetadataRequest(
      final Collection<PwoMetadata> pwoMetadataCollection,
      final ResolveScanCallback resolveScanCallback) {
    // Organize the PwoMetadata objects into a map
    final Map<String, PwoMetadata> urlToPwoMetadata = new HashMap<>();
    for (PwoMetadata pwoMetadata : pwoMetadataCollection) {
      urlToPwoMetadata.put(pwoMetadata.url, pwoMetadata);
    }

    // Create the json request object
    JSONObject jsonObj = createUrlMetadataRequestObject(pwoMetadataCollection);
    final long creationTimestamp = new Date().getTime();
    Response.Listener<JSONObject> responseListener = new Response.Listener<JSONObject>() {
      // Called when the server returns a response
      @Override
      public void onResponse(JSONObject jsonResponse) {

        // Build the metadata from the response
        JSONArray foundMetadata;
        try {
          foundMetadata = jsonResponse.getJSONArray("metadata");
        } catch (JSONException e) {
          Log.i(TAG, "Pws gave bad JSON: " + e);
          return;
        }

        // Loop through the metadata for each url
        for (int i = 0; i < foundMetadata.length(); i++) {
          UrlMetadata urlMetadata = new UrlMetadata();
          try {
            JSONObject jsonUrlMetadata = foundMetadata.getJSONObject(i);
            urlMetadata.id = jsonUrlMetadata.getString("id");
            urlMetadata.siteUrl = jsonUrlMetadata.getString("url");
            urlMetadata.displayUrl = jsonUrlMetadata.getString("displayUrl");
            urlMetadata.title = jsonUrlMetadata.optString("title");
            urlMetadata.description = jsonUrlMetadata.optString("description");
            urlMetadata.iconUrl = jsonUrlMetadata.optString("icon");
            urlMetadata.rank = jsonUrlMetadata.getDouble("rank");
          } catch (JSONException e) {
            Log.i(TAG, "Pws gave bad JSON: " + e);
            continue;
          }

          PwoMetadata pwoMetadata = urlToPwoMetadata.get(urlMetadata.id);
          urlToPwoMetadata.remove(urlMetadata.id);
          pwoMetadata.setUrlMetadata(urlMetadata,
                                     new Date().getTime() - creationTimestamp);
          resolveScanCallback.onUrlMetadataReceived(pwoMetadata);
        }

        // See which urls the PWS didn't give as a response for
        for (PwoMetadata pwoMetadata : urlToPwoMetadata.values()) {
          resolveScanCallback.onUrlMetadataAbsent(pwoMetadata);
        }
      }
    };

    Response.ErrorListener responseErrorListener = new Response.ErrorListener() {
      @Override
      public void onErrorResponse(VolleyError volleyError) {
        Log.i(TAG, "VolleyError: " + volleyError.toString());
      }
    };

    return new JsonObjectRequest(constructUrlStr(RESOLVE_SCAN_PATH), jsonObj, responseListener,
                                 responseErrorListener);
  }

  /**
   * Asynchronously download the image for the url favicon.
   *
   * @param pwoMetadata contains the relevant UrlMetadata
   */
  public void downloadIcon(final PwoMetadata pwoMetadata,
                            final DownloadIconCallback downloadIconCallback) {
    final UrlMetadata urlMetadata = pwoMetadata.urlMetadata;
    Response.Listener<Bitmap> responseListener = new Response.Listener<Bitmap>() {
      @Override
      public void onResponse(Bitmap response) {
        urlMetadata.icon = response;
        downloadIconCallback.onUrlMetadataIconReceived(pwoMetadata);
      }
    };
    Response.ErrorListener errorListener = new Response.ErrorListener() {
      @Override
      public void onErrorResponse(VolleyError error) {
        downloadIconCallback.onUrlMetadataIconError(pwoMetadata);
      }
    };
    ImageRequest imageRequest = new ImageRequest(urlMetadata.iconUrl, responseListener, 0, 0, null,
                                                 errorListener);
    mRequestQueue.add(imageRequest);
  }

  public void cancelAllRequests(final String tag) {
    mRequestQueue.cancelAll(tag);
  }

  public void useProdEndpoint() {
      mEndpointUrl = PROD_URL;
  }

  public void useDevEndpoint() {
      mEndpointUrl = DEV_URL;
  }
}


text:
, aussi connu sous le nom d'« Ōuchi Sakyo-no-Tayu », est un chef de clan japonais, samouraï et chef militaire de l'époque Muromachi.

Yoshirio est le second fils d'Ōuchi Hiroyo et un membre du clan Ōuchi au service d'Ashikaga Takauji. Les Ōuchi se font connaître comme shugo des provinces de Suō et Nagato en 1363 en aidant les Ashikaga contre de nombreux autres opposants. Yoshihiro et son père secondent Imagawa Sadayo dans sa campagne de Kyūshū. Après que le père de Yoshihiro décède durant l'année 1379, Yoshihiro et son frère sont tous deux engagés dans une lutte de pouvoir. Yoshihiro finit par vaincre son frère à Sakariyama en 1380. Durant l'année 1391, au nom du shogun, Ashikaga Yoshimitsu, Yoshihiro mène une armée contre les partisans de la cour du Sud dans la région de la capitale. Grâce aux actions de Yoshihiro, Yoshimitsu lui attribue deux autres provinces.

La plus grande contribution de Yoshihiro à Ashikaga a lieu au cours de l'année 1392, quand Yoshihiro convainc l'empereur de la cour du Sud de se rendre, mettant ainsi un terme à l'époque Nanboku-chō, aussi connue comme la période des cour du Nord et cour du Sud. Le shogun commande ensuite à Yoshihiro de lui construire une villa à Kitayama, demande que Yoshihiro croit être déraisonnable. De ce fait ironique, les Ōuchi se révoltent contre le bakufu. Yoshihiro est soutenu par de nombreux autres shugo et retire ses forces de Kyoto vers la ville de Sakai. Le shogun Yoshimitsu cependant veut résoudre le problème pacifiquement, mais Yoshiro exige de sortir pour l'affronter en une bataille. De ce fait, le shogun fait le premier pas. Yoshimitsu a rassemblé les armées des Hatakeyama, des Hosokawa et des Shiba et se rend sur la terre de Sakai. Yoshihiro toutefois conclut un accord avec des pirates de la mer intérieure pour créer un blocus naval contre les forces ennemies.

Yoshimitsu est alors assisté par Ashikaga Mitsukane qui s'engage à l'aider. Tout ne va pas bien pour Yoshihiro en raison de ses troupes d'Iwami et d'Izumi qui ne s'avèrent pas du tout fiables. De ce fait, l'armée de Yoshihiro semble généralement têtue et incompétente. Au cours du mois de , les troupes du bakufu réussissent à mettre le feu à la ville et Yoshihiro est contraint de se suicider pour échapper aux forces d'invasion commandées par Yoshimitsu. Outre les actions militaires, Yoshihiro était impliqué dans le commerce entre la Chine et à la sécurisation de la domination des Ōuchi dans ce domaine.

Source de la traduction

Samouraï du XIVe siècle
Daimyo
Naissance en 1356
Décès en janvier 1400

redpajama_set_name: RedPajamaWikipedia


John MacArthur, along with the leadership team at Grace Community Church, where John has been the pastor for over 40 years, addresses one of the greatest challenges facing all believers: the powerful influence of secular culture on their hearts and minds. When it comes to every issue imaginable, Christians face a constant barrage of unbiblical worldviews, making it very difficult to know what they should think or where they should stand.
Also included is a topical guide to Bible verses that speak to contemporary issues, arming readers with right thinking.
About "Right Thinking in a World Gone Wrong"
Customer Reviews For "Right Thinking in a World Gone Wrong"
A desperately needed book where MacArthur and others speak out for the truth. This isn't just about certain men's opinions, it simply highlights what scriptures says about modern day issues. Good read.


The housing market seems to be coming back like Robert Downey Jr.
Last year, sales of existing homes rose more than 9 percent—the highest level in 5 years—and new-home construction reached a 4-and-a-half-year high, reports the National Association of Realtors. And so far this year, sales continue to trend up.
In fact, it's a good time for both buyers and sellers. Why? For buyers, even though interest rates have started to rise after reaching 40-year lows, they still aren't likely to change a lot over the next couple of years because banks want to encourage activity, says Drew Scott, one-half of HGTV's Property Brothers and the upcoming Brother Vs. Brother, which premieres Sunday, July 21, at 10 p.m. ET/PT on HGTV.
And for sellers? Banks are slowly but steadily releasing foreclosure properties onto the market so as not to flood the inventory. "It's the simple economics of supply and demand," says Property Brother Jonathan Scott. When the supply goes down, the demand goes up—and that's good news for sellers.
We asked the Scott brothers for the advice you need to navigate today's housing market—whether you're looking to buy, sell, or stay right where you are.
Properties priced drastically below other comparables in the neighborhood are probably fixer-uppers. The secret: Learn to recognize a home's potential.
Find out what fully renovated homes in the neighborhood are selling for, and use that as a guide for what your limit on improvements should be.
Then do your research. While structural issues can be dealbreakers, you don't have to dismiss those houses outright. Instead, find out what it would take to fix them.
Consider bringing in a contractor to provide a free estimate on all the work that needs to be done. And ignore the paint color, flooring, and carpet; cosmetic features are easily changed.
Take advantage of low interest rates by making sure your credit score is stellar. (You can check yours free at transunion.com.) If yours is on the low side, consider putting off the loan application for at least 3 months while trying to improve it—go to annualcreditreport.com to request a free copy of your credit history, suggests the Federal Trade Commission. Carefully review the report, and dispute any inaccuracies. Then put on your responsible-guy hat: Pay all your bills on time, and keep your credit card balance below 50 percent of the limit.
Remember these two valuable weapons: pen and paper.
Follow Jonathan's lead and use your list to back up your offer so the seller can see where you're coming from and doesn't feel like he's being lowballed.
"If you justify a lowball offer with things that need to be done, then it's less likely to offend that seller," says Drew.
Just make sure the fixes are substantial—we're talking code violations and inoperative appliances, not dirty carpets or cracked walls. Leave no faucet unturned, no electrical outlet unchecked. Seriously, check the outlets and other built-in electric appliances, including the master tub with jets. After all, imagine how annoyed you'd be on move-in day to find out you need an electrician.
You may be tempted to rip out the kitchen and replace it on the cheap to entice potential buyers. Don't do that.
A poorly done renovation doesn't add value and only needs to be fixed later, says Jonathan. Instead, focus on little upgrades that can make a big impact.
Other suggestions: Instead of installing new floors, invest in an area rug; and instead of replacing a dated stone wall or fireplace, paint it and create a patina effect. Oh, and clean up the place, would ya? Decluttering—making the space feel clean and organized but not empty—is a basic but incredibly important step that makes your home feel bigger and happier, and buyers will notice.
List the house without the appliances included. Yes, it's unorthodox, but it gives you leverage. If your appliances are new and of good quality, then you can use them as a bargaining chip later.
You watched your kids grow there; you shared laughs with your wife over dinner fiascos in the kitchen; you poured blood, sweat, and tears into finishing the basement—but now you need to sell the place, and it's just not happening. Guess what? It's not the buyer.
Work with an experienced real estate agent and trust in his or her valuation, and concentrate on simple makeovers—such as those suggested above—that will improve the value of the house in the buyer's mind.
A couple of years ago, you thought rates couldn't get any lower. Now you're kicking yourself for not waiting. Don't assume that refinancing again wouldn't be worth it, advise the brothers.
Some banks are even waiving closing costs, although usually that means a slightly higher rate than if you were to pay the upfront fees, says Bob Walters, chief economist at mortgage lender Quicken Loans, as reported in bankrate.com.
If you don't plan to stay in your home for more than 5 years, then a no-closing-cost mortgage may be worthwhile, according to bankrate.com. But if you'll be there more than 5 years, you're probably better off paying the fees upfront. That's because you typically break even on closing costs in a few years, but a no-closing-cost loan could saddle you with a higher interest rate for the life of the loan. And that could end up costing you more than if you'd paid the closing costs, reports bankrate.com. Ask your lender or mortgage broker to run the numbers.
The kitchen and bathroom have long been touted as the big-money rooms. Makes sense: They're the rooms with the coolest features—the fancy appliances, the stylish fixtures.
Create your dream room and you may see a good return on your investment later. Just remember to keep big-ticket renovations neutral but not boring—the bolder you go, the faster it will go out of style, say the brothers. Punch up the look with cosmetic touches, like paint, décor, and furniture.
Check out Property Brothers, Wednesdays at 9 p.m. on HGTV.


text:
Benefit ride to honor the life of Jarid Taylor set for July 30
Published by BCP at July 21, 2022
Jarid Taylor
Photo courtesy David Ray Facebook page.
The Seventh Sin LE/VET motorcycle club is hosting a benefit ride to honor Deputy Jarid Taylor's End of Watch.
The ride is set to take place on Saturday, July 30, following the 2022 Jarid Taylor Memorial 5K run.
Registration will be noon to 1:30 p.m. at the Elks Lodge. KSU 1:45 stops will be Caddo, Bokchito, Colbert, Calera and ending at the Elks Lodge. $20 per rider, $10 per passenger and $5 for redraw.


Do you have some chart examples?
Sometimes the problem with writing a scan is defining exactly what you really want. Chart examples can help explain it or narrow it down.
Or, if it's a coding or syntax problem, you could post what you have and we can go from there.


Live Music, A six piece Funk Dance Band, Solo Keyboard/Piano Show, or an Open Mic event. Whether you need a small show or a large party band for your private party, wedding, corporate or town events - We've got you covered. We look forward to working with you on any live performance gig.
Raleigh, NC area piano player specializing in piano classic rock.
Live Performances of Classic Rock or easy listening music for your Bar, Restaurant or Private Party.
We look forward to working with you on any live performance gig.
Listen to Tom on Reverb Nation LINKeck out Tom's original song "Answer our call" on the Original Songs tab.
This song says it all! Use the MP3 popup player to hear it while browsing the site.


text:
using System.Collections.Generic;

namespace NuGet
{
    public interface IFindPackagesRepository
    {
        IEnumerable<IPackage> FindPackagesById(string packageId);
    }
}


text:
Rituximab and immunisation recommendations
Rituximab is becoming a frequently used treatment option for many patients with complex medical needs, including in oncology and rheumatology. It is an immune suppressive medication which greatly impacts the production and functionality of immune cells, including the near complete depletion of B-cells. Once treatment with rituximab has been completed, recovery of immune cell function can take 3-12 months, and even longer in some cases. It may be used as a once-only dose or as a long term therapy.
Due to the effects on lymphocytes, patients on rituximab therapy are considered immune suppressed and are at a greater risk of vaccine preventable diseases. However, recommendations for immunisation of these patients is complicated by the inability to produce an immune response to vaccines without functioning B- and T-cells.
Many patients on rituximab are also receiving concomitant immunoglobulin therapy. As this is a blood product, it further complicates the immunisation recommendations involving live-attenuated vaccines.
Prior to commencing treatment
Where possible please ensure patients are up to date for their age with the current immunisation schedule. Ideally inactivated vaccines should be completed at least 1 week prior, and any live-attenuated vaccines should be completed a minimum of 4 weeks prior to commencing treatment. The same principle also applies to COVID-19 vaccines.
During treatment
Due to lack of immune cell function, all future immunisations should be withheld whilst on rituximab. An immunisation medical exemption form should be completed where appropriate to ensure that the patient is not considered overdue [see resources].
The exception to this, may be for influenza and COVID-19 vaccines. Some studies have indicated that a partial immune response to the influenza vaccine in patients receiving rituximab therapy may occur. For this reason MVEC recommends that patients continue to be immunised against influenza whilst on therapy and receive 2 doses of the age-appropriate vaccine annually, minimum of 4 weeks apart (regardless of age or vaccine history).
Due to the potential risk for severe COVID-19 disease and its complications in this population, which may outweigh the lack of vaccine response, COVID-19 vaccination whilst on rituximab could be considered.
COVID-19 vaccination and rituximab
Studies are still ongoing to determine optimum timing and vaccine efficacy in patients on rituximab. However, based on evidence from other vaccines, the assumption is that there is a diminished response to COVID-19 vaccination.
Therefore, important principles to consider when considering COVID-19 vaccination in this group of patients include:
It is not recommended to delay initiation or disrupt optimum timing of rituximab if being used for cancer treatment
Due to its immunosuppressive effects, patients on rituximab are at higher risk of severe COVID-19 disease and poor COVID-19 disease outcomes
As such, COVID-19 vaccination could be performed as close to the end of a rituximab cycle as possible, or prior to the initiation of therapy. There is no current data to inform optimum timing of two-dose COVID-19 vaccination regimes and intervals.
Refer to MVEC: COVID-19 vaccines in people with immunocompromise
Immunisation of household contacts
All close contacts should ensure that they are up to date with the routine immunisation schedule, including MMR, varicella and pertussis vaccines. Annual Influenza vaccination is strongly recommended. COVID-19 vaccination is encouraged.
There is no need to check serology pre- or post-rituximab therapy. There is currently no established immune correlate of protection for COVID-19.
Patients should be aware of their immune suppression and avoid potential exposures to vaccine preventable diseases. The need to continue preventative measures such as social distancing, mask wearing and hand hygiene should be discussed. Medical advice should be sought if exposure does occur [see resources for post-exposure immunoglobulin recommendations].
Post treatment
Post the completion of rituximab therapy, immunoglobulin and B-cell levels should be checked every 3 months. Once both levels have returned to normal AND ≥ 6 months post treatment has lapsed (whichever is later), immunisation with both inactivated and live-attenuated vaccines can recommence. For patients who have received immunoglobulin alongside their rituximab, specific intervals are recommended between the administration of live-attenuated vaccines and blood products/immunoglobulin [refer to MVEC: Live-attenuated vaccines and immunoglobulins or blood products]. Any previous vaccine history (routine vaccines) should be disregarded due to the loss of immune memory. There is currently no recommendation for additional booster doses of COVID-19 vaccines.
Please refer to MVEC: Post rituximab therapy immunisation guideline for re-immunisation recommendations.
MVEC: Post Rituximab therapy immunisation guideline
MVEC: Influenza vaccine recommendations
MVEC: COVID-19 vaccines in people with immunocompromise
MVEC: Live-attenuated vaccines and immunoglobulins or blood products
DHHS: Medical exemption forms
Australian Immunisation Handbook: Post-exposure prophylaxis for people non-immune to hepatitis B
Australian Immunisation Handbook: Post exposure prophylaxis for people non-immune to measles
Australian Immunisation Handbook: Post exposure prophylaxis for people non-immune to varicella
Australian Immunisation Handbook: Post exposure prophylaxis for people non-immune to tetanus
Cheng D, Barton R, Greenway A, Crawford N Rituximab and protection from vaccine preventable diseases; applying the evidence to pediatric patients. Expert Review of Vaccines 2016 Volume 15(12): 1567-1574
Authors: Rachael McGuire (SAEFVIC Research Nurse, Murdoch Children's Research Institute), Daryl Cheng (Senior Research Fellow, Murdoch Children's Research Institute) and Theresa Cole (Consultant, Allergy and Immunology, The Royal Children's Hospital)
Reviewed by: Rachael McGuire (MVEC Education Nurse Coordinator) and Daryl Cheng (MVEC Medical Lead)
Materials in this section are updated as new information and vaccines become available. The Melbourne Vaccine Education Centre (MVEC) staff regularly reviews materials for accuracy. You should not consider the information in this site to be specific, professional medical advice for your personal health or for your family's personal health. For medical concerns, including decisions about vaccinations, medications and other treatments, you should always consult a healthcare professional.