nodes: 0, module; 1, function_definition; 2, function_name:get_dummy_run; 3, parameters; 4, block; 5, identifier:nthread; 6, identifier:nsamples; 7, dictionary_splat_pattern; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, expression_statement; 15, comment:# set seed before generating any threads and do not reset for each thread; 16, if_statement; 17, expression_statement; 18, for_statement; 19, comment:# Sort threads in order of starting logl so labels match labels that would; 20, comment:# have been given processing a dead points array. N.B. this only works when; 21, comment:# all threads have same start_logl; 22, expression_statement; 23, for_statement; 24, comment:# Use combine_ns_runs rather than combine threads as this relabels the; 25, comment:# threads according to their order; 26, return_statement; 27, identifier:kwargs; 28, comment:"""Generate dummy data for a nested sampling run.
  
      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
      ----------
      nthreads: int
          Number of threads in the run.
      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.
      """; 29, assignment; 30, assignment; 31, assignment; 32, assignment; 33, identifier:kwargs; 34, block; 35, assignment; 36, comparison_operator:seed is not False; 37, block; 38, assignment; 39, identifier:_; 40, call; 41, block; 42, assignment; 43, pattern_list; 44, call; 45, block; 46, call; 47, identifier:seed; 48, call; 49, identifier:ndim; 50, call; 51, identifier:logl_start; 52, call; 53, identifier:logl_range; 54, call; 55, raise_statement; 56, identifier:threads; 57, list; 58, identifier:seed; 59, False; 60, expression_statement; 61, identifier:threads; 62, list; 63, identifier:range; 64, argument_list; 65, expression_statement; 66, identifier:threads; 67, call; 68, identifier:i; 69, identifier:_; 70, identifier:enumerate; 71, argument_list; 72, expression_statement; 73, attribute; 74, argument_list; 75, attribute; 76, argument_list; 77, attribute; 78, argument_list; 79, attribute; 80, argument_list; 81, attribute; 82, argument_list; 83, call; 84, call; 85, identifier:nthread; 86, call; 87, identifier:sorted; 88, argument_list; 89, identifier:threads; 90, assignment; 91, attribute; 92, identifier:combine_threads; 93, identifier:threads; 94, identifier:kwargs; 95, identifier:pop; 96, string; 97, False; 98, identifier:kwargs; 99, identifier:pop; 100, string; 101, integer:2; 102, identifier:kwargs; 103, identifier:pop; 104, string; 105, unary_operator; 106, identifier:kwargs; 107, identifier:pop; 108, string; 109, integer:1; 110, identifier:TypeError; 111, argument_list; 112, attribute; 113, argument_list; 114, attribute; 115, argument_list; 116, identifier:threads; 117, keyword_argument; 118, subscript; 119, call; 120, identifier:nestcheck; 121, identifier:ns_run_utils; 122, string_content:seed; 123, string_content:ndim; 124, string_content:logl_start; 125, attribute; 126, string_content:logl_range; 127, call; 128, attribute; 129, identifier:seed; 130, identifier:seed; 131, identifier:threads; 132, identifier:append; 133, call; 134, identifier:key; 135, lambda; 136, subscript; 137, string; 138, attribute; 139, argument_list; 140, identifier:np; 141, identifier:inf; 142, attribute; 143, argument_list; 144, identifier:np; 145, identifier:random; 146, identifier:get_dummy_thread; 147, argument_list; 148, lambda_parameters; 149, subscript; 150, identifier:threads; 151, identifier:i; 152, string_content:thread_labels; 153, identifier:np; 154, identifier:full; 155, identifier:nsamples; 156, identifier:i; 157, string; 158, identifier:format; 159, identifier:kwargs; 160, identifier:nsamples; 161, keyword_argument; 162, keyword_argument; 163, keyword_argument; 164, keyword_argument; 165, identifier:th; 166, subscript; 167, integer:0; 168, string_content:Unexpected **kwargs: {0}; 169, identifier:ndim; 170, identifier:ndim; 171, identifier:seed; 172, False; 173, identifier:logl_start; 174, identifier:logl_start; 175, identifier:logl_range; 176, identifier:logl_range; 177, identifier:th; 178, string; 179, string_content:logl
code: def get_dummy_run(nthread, nsamples, **kwargs):
      """Generate dummy data for a nested sampling run.
  
      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
      ----------
      nthreads: int
          Number of threads in the run.
      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))
      threads = []
      # set seed before generating any threads and do not reset for each thread
      if seed is not False:
          np.random.seed(seed)
      threads = []
      for _ in range(nthread):
          threads.append(get_dummy_thread(
              nsamples, ndim=ndim, seed=False, logl_start=logl_start,
              logl_range=logl_range))
      # Sort threads in order of starting logl so labels match labels that would
      # have been given processing a dead points array. N.B. this only works when
      # all threads have same start_logl
      threads = sorted(threads, key=lambda th: th['logl'][0])
      for i, _ in enumerate(threads):
          threads[i]['thread_labels'] = np.full(nsamples, i)
      # Use combine_ns_runs rather than combine threads as this relabels the
      # threads according to their order
      return nestcheck.ns_run_utils.combine_threads(threads)