nodes: 0, module; 1, function_definition; 2, function_name:samples_from_cli; 3, parameters; 4, block; 5, identifier:self; 6, identifier:opts; 7, default_parameter; 8, dictionary_splat_pattern; 9, expression_statement; 10, if_statement; 11, comment:# parse optional arguments; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, return_statement; 16, identifier:parameters; 17, None; 18, identifier:kwargs; 19, comment:"""Reads samples from the given command-line options.
  
          Parameters
          ----------
          opts : argparse Namespace
              The options with the settings to use for loading samples (the sort
              of thing returned by ``ArgumentParser().parse_args``).
          parameters : (list of) str, optional
              A list of the parameters to load. If none provided, will try to
              get the parameters to load from ``opts.parameters``.
          \**kwargs :
              All other keyword arguments are passed to ``read_samples``. These
              will override any options with the same name.
  
          Returns
          -------
          FieldArray :
              Array of the loaded samples.
          """; 20, boolean_operator; 21, block; 22, elif_clause; 23, assignment; 24, assignment; 25, assignment; 26, call; 27, comparison_operator:parameters is None; 28, comparison_operator:opts.parameters is None; 29, expression_statement; 30, comparison_operator:parameters is None; 31, block; 32, pattern_list; 33, call; 34, identifier:extra_args; 35, list_comprehension; 36, identifier:kwargs; 37, call; 38, attribute; 39, argument_list; 40, identifier:parameters; 41, None; 42, attribute; 43, None; 44, assignment; 45, identifier:parameters; 46, None; 47, expression_statement; 48, identifier:_; 49, identifier:extra_actions; 50, attribute; 51, argument_list; 52, attribute; 53, for_in_clause; 54, attribute; 55, argument_list; 56, identifier:self; 57, identifier:read_samples; 58, identifier:parameters; 59, dictionary_splat; 60, identifier:opts; 61, identifier:parameters; 62, identifier:parameters; 63, attribute; 64, assignment; 65, identifier:self; 66, identifier:extra_args_parser; 67, identifier:act; 68, identifier:dest; 69, identifier:act; 70, identifier:extra_actions; 71, identifier:self; 72, identifier:_get_optional_args; 73, identifier:extra_args; 74, identifier:opts; 75, dictionary_splat; 76, identifier:kwargs; 77, identifier:self; 78, identifier:variable_args; 79, identifier:parameters; 80, attribute; 81, identifier:kwargs; 82, identifier:opts; 83, identifier:parameters
code: def samples_from_cli(self, opts, parameters=None, **kwargs):
          """Reads samples from the given command-line options.
  
          Parameters
          ----------
          opts : argparse Namespace
              The options with the settings to use for loading samples (the sort
              of thing returned by ``ArgumentParser().parse_args``).
          parameters : (list of) str, optional
              A list of the parameters to load. If none provided, will try to
              get the parameters to load from ``opts.parameters``.
          \**kwargs :
              All other keyword arguments are passed to ``read_samples``. These
              will override any options with the same name.
  
          Returns
          -------
          FieldArray :
              Array of the loaded samples.
          """
          if parameters is None and opts.parameters is None:
              parameters = self.variable_args
          elif parameters is None:
              parameters = opts.parameters
          # parse optional arguments
          _, extra_actions = self.extra_args_parser()
          extra_args = [act.dest for act in extra_actions]
          kwargs = self._get_optional_args(extra_args, opts, **kwargs)
          return self.read_samples(parameters, **kwargs)