def output(self, **kwargs):
        options = dict(self.options)
        options['outfile'] = kwargs['outfile']

        infiles = []
        for infile in kwargs['content_meta']:
            # type, full_filename, relative_filename
            # In debug mode we use the full path so that in development we see changes without having to call
            # collectstatic. This breaks the sourcemaps. In production, we want  sourcemaps to work so we
            # use relative path which will take files from `staticfiles` automatically.
            if settings.DEBUG:
                infiles.append(infile[1])
            else:
                infiles.append(infile[2])

        options['infiles'] = ' '.join(f for f in infiles)

        options['mapfile'] = kwargs['outfile'].replace('.js', '.map.js')

        options['mapurl'] = '{}{}'.format(
            settings.STATIC_URL, options['mapfile']
        )

        options['maproot'] = settings.STATIC_URL

        self.cwd = kwargs['root_location']

        try:
            command = fstr(self.command).format(**options)

            proc = subprocess.Popen(
                command, shell=True, cwd=self.cwd, stdout=self.stdout,
                stdin=self.stdin, stderr=self.stderr)
            err = proc.communicate()
        except (IOError, __HOLE__), e:
            raise FilterError('Unable to apply %s (%r): %s' %
                              (self.__class__.__name__, self.command, e))
        else:
            # If the process doesn't return a 0 success code, throw an error
            if proc.wait() != 0:
                if not err:
                    err = ('Unable to apply %s (%s)' %
                           (self.__class__.__name__, self.command))
                raise FilterError(err)
            if self.verbose:
                self.logger.debug(err)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/style/uglify.py/UglifySourcemapFilter.output