@classmethod
    def transform(cls, clients, resource_config):

        path = os.path.expanduser(resource_config)
        if os.path.isfile(path):
            return path
        try:
            head = requests.head(path)
            if head.status_code == 200:
                return path
            raise exceptions.InvalidScenarioArgument(
                "Url %s unavailable (code %s)" % (path, head.status_code))
        except Exception as ex:
            raise exceptions.InvalidScenarioArgument(
                "Url error %s (%s)" % (path, ex))
Check whether file exists or url available.
dataset/ETHPy150Open openstack/rally/rally/plugins/common/types.py/PathOrUrl.transform