def unprotect_branches(self):
g = self.gitlab<EOL>url = g['<STR_LIT:url>'] + "<STR_LIT>" + g['<STR_LIT>'] + "<STR_LIT>"<EOL>query = {'<STR_LIT>': g['<STR_LIT>']}<EOL>unprotected = <NUM_LIT:0><EOL>r = requests.get(url, params=query)<EOL>r.raise_for_status()<EOL>for branch in r.json():<EOL><INDENT>if branch['<STR_LIT>']:<EOL><INDENT>r = requests.put(url + "<STR_LIT:/>" + branch['<STR_LIT:name>'] +<EOL>"<STR_LIT>", params=query)<EOL>r.raise_for_status()<EOL>unprotected += <NUM_LIT:1><EOL><DEDENT><DEDENT>return unprotected<EOL>
Unprotect branches of the GitLab project