def is_valid(self, remote=False):
        """
        Check cloud-harness code is valid. task schema validation is
        left to the API endpoint.
        :param remote: Flag indicating if the task is being ran on the platform or not.
        :return: is valid or not.
        """

        if len(self.input_ports) < 1:
            return False

        if remote:
            # Ignore output ports as value will overriden.
            ports = [
                port for port in self.input_ports if port.type == 'directory'
                ]
            for port in ports:
                # Will raise exception if the port is invalid.
                port.is_valid_s3_url(port.value)
        else:
            all_ports = self.ports[0] + self.ports[1]
            ports = [
                port for port in all_ports if port.type == 'directory' and port.name != 'source_bundle'
                ]
            for port in ports:
                # Will raise exception if the port is invalid.
                port.is_valid_filesys(port.value)

        return True
Check cloud-harness code is valid. task schema validation is
        left to the API endpoint.
        :param remote: Flag indicating if the task is being ran on the platform or not.
        :return: is valid or not.