'Parses the provided arguments and returns a dictionary of the ``args``.
We specifically remove items with ``None`` as values in order to support
the style ``opt.get(key, default)``, which would otherwise return ``None``.'

def parse_args(self, args=None, namespace=None, print_args=True):

    self.args = super().parse_args(args=args)
    self.opt = vars(self.args)
    self.opt['parlai_home'] = self.parlai_home
    if self.opt.get('download_path'):
        os.environ['PARLAI_DOWNPATH'] = self.opt['download_path']
    if self.opt.get('datapath'):
        os.environ['PARLAI_DATAPATH'] = self.opt['datapath']
    if print_args:
        self.print_args()
    return self.opt
