nodes: 0, module; 1, function_definition; 2, function_name:_get_samples; 3, parameters; 4, block; 5, identifier:self; 6, identifier:N; 7, identifier:trace_sort; 8, expression_statement; 9, comment:# allocate an empty numpy array to store the run and append accept count; 10, comment:# (importance sampling accepts all points); 11, expression_statement; 12, comment:# store the proposed points (weights are still to be calculated); 13, if_statement; 14, comment:"""Save N samples from ``self.proposal`` to ``self.samples``
          This function does NOT calculate the weights.
  
          Return a reference to this run's samples in ``self.samples``.
          If ``trace_sort`` is True, additionally return an array
          indicating the responsible component. (MixtureDensity only)
  
          """; 15, assignment; 16, identifier:trace_sort; 17, block; 18, else_clause; 19, identifier:this_run; 20, call; 21, expression_statement; 22, return_statement; 23, block; 24, attribute; 25, argument_list; 26, assignment; 27, expression_list; 28, expression_statement; 29, return_statement; 30, attribute; 31, identifier:append; 32, identifier:N; 33, pattern_list; 34, call; 35, identifier:this_run; 36, identifier:origin; 37, assignment; 38, identifier:this_run; 39, identifier:self; 40, identifier:samples; 41, subscript; 42, identifier:origin; 43, attribute; 44, argument_list; 45, subscript; 46, call; 47, identifier:this_run; 48, slice; 49, attribute; 50, identifier:propose; 51, identifier:N; 52, attribute; 53, keyword_argument; 54, keyword_argument; 55, identifier:this_run; 56, slice; 57, attribute; 58, argument_list; 59, identifier:self; 60, identifier:proposal; 61, identifier:self; 62, identifier:rng; 63, identifier:trace; 64, True; 65, identifier:shuffle; 66, False; 67, attribute; 68, identifier:propose; 69, identifier:N; 70, attribute; 71, identifier:self; 72, identifier:proposal; 73, identifier:self; 74, identifier:rng
code: def _get_samples(self, N, trace_sort):
          """Save N samples from ``self.proposal`` to ``self.samples``
          This function does NOT calculate the weights.
  
          Return a reference to this run's samples in ``self.samples``.
          If ``trace_sort`` is True, additionally return an array
          indicating the responsible component. (MixtureDensity only)
  
          """
          # allocate an empty numpy array to store the run and append accept count
          # (importance sampling accepts all points)
          this_run = self.samples.append(N)
  
          # store the proposed points (weights are still to be calculated)
          if trace_sort:
              this_run[:], origin = self.proposal.propose(N, self.rng, trace=True, shuffle=False)
              return this_run, origin
          else:
              this_run[:] = self.proposal.propose(N, self.rng)
              return this_run