nodes: 0, module; 1, function_definition; 2, function_name:get_dummy_thread; 3, parameters; 4, block; 5, identifier:nsamples; 6, dictionary_splat_pattern; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, if_statement; 14, expression_statement; 15, if_statement; 16, expression_statement; 17, return_statement; 18, identifier:kwargs; 19, comment:"""Generate dummy data for a single nested sampling thread.
  
      Log-likelihood values of points are generated from a uniform distribution
      in (0, 1), sorted, scaled by logl_range and shifted by logl_start (if it is
      not -np.inf). Theta values of each point are each generated from a uniform
      distribution in (0, 1).
  
      Parameters
      ----------
      nsamples: int
          Number of samples in thread.
      ndim: int, optional
          Number of dimensions.
      seed: int, optional
          If not False, the seed is set with np.random.seed(seed).
      logl_start: float, optional
          logl at which thread starts.
      logl_range: float, optional
          Scale factor applied to logl values.
      """; 20, assignment; 21, assignment; 22, assignment; 23, assignment; 24, identifier:kwargs; 25, block; 26, comparison_operator:seed is not False; 27, block; 28, assignment; 29, comparison_operator:logl_start != -np.inf; 30, block; 31, assignment; 32, identifier:thread; 33, identifier:seed; 34, call; 35, identifier:ndim; 36, call; 37, identifier:logl_start; 38, call; 39, identifier:logl_range; 40, call; 41, raise_statement; 42, identifier:seed; 43, False; 44, expression_statement; 45, identifier:thread; 46, dictionary; 47, identifier:logl_start; 48, unary_operator; 49, expression_statement; 50, subscript; 51, call; 52, attribute; 53, argument_list; 54, attribute; 55, argument_list; 56, attribute; 57, argument_list; 58, attribute; 59, argument_list; 60, call; 61, call; 62, pair; 63, pair; 64, pair; 65, pair; 66, attribute; 67, augmented_assignment; 68, identifier:thread; 69, string; 70, attribute; 71, argument_list; 72, identifier:kwargs; 73, identifier:pop; 74, string; 75, False; 76, identifier:kwargs; 77, identifier:pop; 78, string; 79, integer:2; 80, identifier:kwargs; 81, identifier:pop; 82, string; 83, unary_operator; 84, identifier:kwargs; 85, identifier:pop; 86, string; 87, integer:1; 88, identifier:TypeError; 89, argument_list; 90, attribute; 91, argument_list; 92, string; 93, binary_operator:np.sort(np.random.random(nsamples)) * logl_range; 94, string; 95, call; 96, string; 97, call; 98, string; 99, call; 100, identifier:np; 101, identifier:inf; 102, subscript; 103, identifier:logl_start; 104, string_content:thread_min_max; 105, identifier:np; 106, identifier:asarray; 107, list; 108, string_content:seed; 109, string_content:ndim; 110, string_content:logl_start; 111, attribute; 112, string_content:logl_range; 113, call; 114, attribute; 115, identifier:seed; 116, identifier:seed; 117, string_content:logl; 118, call; 119, identifier:logl_range; 120, string_content:nlive_array; 121, attribute; 122, argument_list; 123, string_content:theta; 124, attribute; 125, argument_list; 126, string_content:thread_labels; 127, attribute; 128, argument_list; 129, identifier:thread; 130, string; 131, list; 132, identifier:np; 133, identifier:inf; 134, attribute; 135, argument_list; 136, identifier:np; 137, identifier:random; 138, attribute; 139, argument_list; 140, identifier:np; 141, identifier:full; 142, identifier:nsamples; 143, float:1.; 144, attribute; 145, identifier:random; 146, tuple; 147, call; 148, identifier:astype; 149, identifier:int; 150, string_content:logl; 151, identifier:logl_start; 152, subscript; 153, string; 154, identifier:format; 155, identifier:kwargs; 156, identifier:np; 157, identifier:sort; 158, call; 159, identifier:np; 160, identifier:random; 161, identifier:nsamples; 162, identifier:ndim; 163, attribute; 164, argument_list; 165, subscript; 166, unary_operator; 167, string_content:Unexpected **kwargs: {0}; 168, attribute; 169, argument_list; 170, identifier:np; 171, identifier:zeros; 172, identifier:nsamples; 173, identifier:thread; 174, string; 175, integer:1; 176, attribute; 177, identifier:random; 178, identifier:nsamples; 179, string_content:logl; 180, identifier:np; 181, identifier:random
code: def get_dummy_thread(nsamples, **kwargs):
      """Generate dummy data for a single nested sampling thread.
  
      Log-likelihood values of points are generated from a uniform distribution
      in (0, 1), sorted, scaled by logl_range and shifted by logl_start (if it is
      not -np.inf). Theta values of each point are each generated from a uniform
      distribution in (0, 1).
  
      Parameters
      ----------
      nsamples: int
          Number of samples in thread.
      ndim: int, optional
          Number of dimensions.
      seed: int, optional
          If not False, the seed is set with np.random.seed(seed).
      logl_start: float, optional
          logl at which thread starts.
      logl_range: float, optional
          Scale factor applied to logl values.
      """
      seed = kwargs.pop('seed', False)
      ndim = kwargs.pop('ndim', 2)
      logl_start = kwargs.pop('logl_start', -np.inf)
      logl_range = kwargs.pop('logl_range', 1)
      if kwargs:
          raise TypeError('Unexpected **kwargs: {0}'.format(kwargs))
      if seed is not False:
          np.random.seed(seed)
      thread = {'logl': np.sort(np.random.random(nsamples)) * logl_range,
                'nlive_array': np.full(nsamples, 1.),
                'theta': np.random.random((nsamples, ndim)),
                'thread_labels': np.zeros(nsamples).astype(int)}
      if logl_start != -np.inf:
          thread['logl'] += logl_start
      thread['thread_min_max'] = np.asarray([[logl_start, thread['logl'][-1]]])
      return thread