'Set instance variables based on the arguments that were passed'

def _set_args(self):

    self.return_results_as_name = self._task.args.get('name', None)
    self.source_dir = self._task.args.get('dir', None)
    self.source_file = self._task.args.get('file', None)
    if ((not self.source_dir) and (not self.source_file)):
        self.source_file = self._task.args.get('_raw_params')
    self.depth = self._task.args.get('depth', None)
    self.files_matching = self._task.args.get('files_matching', None)
    self.ignore_files = self._task.args.get('ignore_files', None)
    self.valid_extensions = self._task.args.get('extensions', self.VALID_FILE_EXTENSIONS)
    if isinstance(self.valid_extensions, string_types):
        self.valid_extensions = list(self.valid_extensions)
    if (not isinstance(self.valid_extensions, list)):
        raise AnsibleError('Invalid    type    for    "extensions"    option,    it    must    be    a    list')
