Basically this is not to deploy automatically this is to be run once
        all is properly defined to catch the xsd in your own S3 instance and
        avoid third party (like government servers) failure, trying to manage
        the cache transparently to the user.

        This method was created due to SAT is too unstable to serve the files
        related with xsd and invoices, and this probably is the same in other
        governmental institutions.

        :param url: Element path to be cached.
        :type url: str
        :param named: Local path with the file already downloaded.
        :type named: str

        :return:

def cache_s3(self, url, named):  # pragma: no cover
        """Basically this is not to deploy automatically this is to be run once
        all is properly defined to catch the xsd in your own S3 instance and
        avoid third party (like government servers) failure, trying to manage
        the cache transparently to the user.

        This method was created due to SAT is too unstable to serve the files
        related with xsd and invoices, and this probably is the same in other
        governmental institutions.

        :param url: Element path to be cached.
        :type url: str
        :param named: Local path with the file already downloaded.
        :type named: str

        :return:
        """
        # **Technical Notes:**
        #
        # Even if the tries are looking nested, this is perfect valid for
        # this case:
        # https://docs.python.org/3/glossary.html#term-eafp.
        #
        # The Coverage was excluded in order to avoid decrease it because an
        # unused tool.
        url_parsed = urlparse(url)
        if self.domain == urlparse(url).netloc:
            # If I am asking for the same domain it is probably because it
            # exists BTW
            return url

        # Get the service resource
        session = boto3.Session(profile_name=self.profile_name)
        s3 = session.resource('s3')
        client = session.client('s3')
        element = url_parsed.path[1:]

        # Get the bucket object (I am not connected yet this is setting a
        # local object in memory only)
        bucket = s3.Bucket(self.domain)

        # Dear future me there MUST be a more elegant way to do this.
        new_url = 'http://%s/%s' % (self.domain, element)

        if self.check_s3(bucket.name, element):
            return new_url

        # Look a way this code is not tested in coverage because this MUST run
        # locally due to s3 credentials.
        try:  # pragma: no cover
            # No coverage code unreachable on travis 'intentionally'
            transfer = S3Transfer(client)
            # Making the object public
            transfer.upload_file(named, bucket.name, element,
                                 extra_args={'ACL': 'public-read'})
        except ClientError as inst:  # pragma: no cover
            # No coverage code unreachable on travis 'intentionally'
            print(inst.message)
            return url
        else:  # pragma: no cover
            # No coverage code unreachable on travis 'intentionally'
            return new_url