def _upload_artifact(self, local_artifact, path_prefix, repo_id, hostname_for_download=None):

        filename = os.path.basename(local_artifact.local_path)
        logger.info('-> Uploading %s', filename)

        with open(local_artifact.local_path, 'rb') as f:
            headers = {'Content-Type': 'application/x-rpm'}

            # rgavf stands for repo-group-local_artifact-version-filename
            gavf = '{group}/{name}/{ver}/{filename}'.format(group=local_artifact.group.replace('.', '/'),
                                                            name=local_artifact.artifact, ver=local_artifact.version,
                                                            filename=filename)
            rgavf = '{repo_id}/{gavf}'.format(repo_id=repo_id, gavf=gavf)

            remote_path = '{path_prefix}/{rgavf}'.format(path_prefix=path_prefix, rgavf=rgavf)
            self._send(remote_path, method='POST', headers=headers, data=f)

        # if not specified, use repository url
        hostname_for_download = hostname_for_download and self._repository_url
        url = '{hostname}/content/repositories/{rgavf}'.format(hostname=hostname_for_download, rgavf=rgavf)

        # get classifier and extension from nexus
        path = 'service/local/repositories/{repo_id}/content/{gavf}?describe=maven2'.format(repo_id=repo_id, gavf=gavf)
        maven_metadata = self._send_json(path)['data']

        return RemoteArtifact(group=maven_metadata['groupId'], artifact=maven_metadata['artifactId'],
                              version=maven_metadata['version'], classifier=maven_metadata.get('classifier', ''),
                              extension=maven_metadata.get('extension', ''), url=url, repo_id=repo_id)
dataset/ETHPy150Open stardust85/repositorytools/repositorytools/lib/repository.py/NexusRepositoryClient._upload_artifact/operator `or` -> `and`