import gitlab
# GitLab server URL服务器托管网 and personal access token
gitlab_url = 'https://gitlab.example.com'
private_token = 'your_personal_access_token'
# ID of the project and merge request
project_id = 1234
merge_request_iid = 5678
# Create GitLab client
gl = gitlab.Gitlab(gitlab_url, private_token)
# Get the project
project = gl.projects.get(project_id)
# Get the merge request
mr = project.mergerequests.get(merge_request_iid)
# Get the approval status of the merge request
all_approved = mr.approval_state.get()
for rule in all_approved.rules:
if rule.get('approved')==False:
print("Not all approvals received.")
break
else:
print("All approvals received.")
mr.approval_state.get()返回的格式:
class 'gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalState'> => {
'approval_rules_overwritten': True,
'rules': [
{
'id': 12345,
'n服务器托管网ame': 'All Members',
'rule_type': 'any_approver',
'eligible_approvers': [],
'approvals_required': 1,
'users': [],
'groups': [],
'contains_hidden_groups': False,
'section': None,
'source_rule': {
'approvals_required': 1
},
'overridden': False,
'code_owner': False,
'approved_by': [
{
'id': 121,
'username': 'xxx',
......
},
{
'id': 122,
'username': 'xxx',
......
}
],
'approved': True
},
所有rule的approved为True则表明全部approved。
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
Abstract 提出了一个框架,名为R-YOLO,不需要在恶劣天气下进行注释。考虑到正常天气图像和不利天气图像之间的分布差距,我们的框架由图像翻译网络(QTNet)和特征校准网络(服务器托管网FCNet)组成,用于逐步使正常天气域适应不利天气域。具体来说,我…