示例#1
0
    def skip_merge(similar_arr, accession, database, source_url, name,
                   access_token):
        similar_list = []
        for similar in similar_arr:
            temp_dict = {}
            temp_dict.update(accession=similar.accession)
            temp_dict.update(database=similar.database)
            temp_dict.update(sourceUrl=similar.sourceUrl)
            temp_dict.update(name=similar.name)
            similar_list.append(temp_dict)

        request_params = {
            "similars": similar_list,
            "accession": accession,
            "database": database,
            "sourceUrl": source_url,
            "name": name
        }
        tokened_header = HEADERS.copy()
        tokened_header["x-auth-token"] = access_token

        res = requests.post(constants.SKIP_MERGE_URL,
                            params=request_params,
                            headers=tokened_header)
        return res
示例#2
0
    def get_merge_candidate_count(access_token):
        tokened_header = HEADERS.copy()
        tokened_header["x-auth-token"] = access_token

        res = requests.get(constants.MERGE_CANDIDATE_COUNT_URL,
                           headers=tokened_header)
        return res
示例#3
0
    def unmerge(merge_candidates, access_token):

        tokened_header = HEADERS.copy()
        tokened_header["x-auth-token"] = access_token

        res = requests.post(constants.UNMERGE_URL,
                            params=merge_candidates,
                            headers=tokened_header)
        return res
示例#4
0
 def get_merge_candidates(start, size, access_token):
     tokened_header = HEADERS.copy()
     tokened_header["x-auth-token"] = access_token
     res = requests.get(constants.MERGE_CANDIDATE_URL,
                        params={
                            "start": start,
                            "size": size
                        },
                        headers=tokened_header)
     return res
示例#5
0
 def get_allmerged(access_token):
     tokened_header = HEADERS.copy()
     tokened_header["x-auth-token"] = access_token
     res = requests.get(constants.ALL_MERGE_URL, headers=tokened_header)
     return res