





import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict






@pytest.mark.parametrize(
    '''split_dict'''       ,      [
        SplitDict(),
        SplitDict({'''train''': SplitInfo(name='''train'''       ,      num_bytes=1337       ,      num_examples=42       ,      dataset_name='''my_dataset'''       )}       ),
        SplitDict({'''train''': SplitInfo(name='''train'''       ,      num_bytes=1337       ,      num_examples=42       )}       ),
        SplitDict({'''train''': SplitInfo()}       ),
    ]       ,      )
def lowerCamelCase__    (							snake_case_	:  SplitDict       )      ->				Optional[Any]:
   __snake_case							       =   split_dict._to_yaml_list()
   assert len(snake_case_       ) == len(snake_case_       )
   __snake_case							       =   SplitDict._from_yaml_list(snake_case_       )
   for split_name, split_info in split_dict.items():
      # dataset_name field is deprecated, and is therefore not part of the YAML dump
      __snake_case							       =   None
      # the split name of split_dict takes over the name of the split info object
      __snake_case							       =   split_name
   assert split_dict == reloaded







@pytest.mark.parametrize(
    '''split_info'''       ,      [SplitInfo(), SplitInfo(dataset_name=snake_case_       ), SplitInfo(dataset_name='''my_dataset'''       )]       )
def lowerCamelCase__    (							snake_case_	:  int       )      ->				str:
   # For backward compatibility, we need asdict(split_dict) to return split info dictrionaries with the "dataset_name"
   # field even if it's deprecated. This way old versionso of `datasets` can still reload dataset_infos.json files
   __snake_case							       =   asdict(SplitDict({'''train''': split_info}       )       )
   assert "dataset_name" in split_dict_asdict["train"]
   assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name








from __future__ import annotations






def lowerCamelCase__    (							snake_case_	:  list[int]       ,      snake_case_	:  int       )      ->				list[list[int]]:
   __snake_case							       =   []
   __snake_case							       =   []
   __snake_case							       =   0
   __snake_case							       =   sum(snake_case_       )
   create_state_space_tree(snake_case_       ,      snake_case_       ,      snake_case_       ,      snake_case_       ,      snake_case_       ,      snake_case_       )
   return result






def lowerCamelCase__    (							snake_case_	:  list[int]       ,      snake_case_	:  int       ,      snake_case_	:  int       ,      snake_case_	:  list[int]       ,      snake_case_	:  list[list[int]]       ,      snake_case_	:  int       ,      )      ->				None:
   if sum(snake_case_       ) > max_sum or (remaining_nums_sum + sum(snake_case_       )) < max_sum:
      return
   if sum(snake_case_       ) == max_sum:
      result.append(snake_case_       )
      return
   for index in range(snake_case_       ,      len(snake_case_       )       ):
      create_state_space_tree(
          snake_case_       ,      snake_case_       ,      index + 1       ,      [*path, nums[index]]       ,      snake_case_       ,      remaining_nums_sum - nums[index]       ,      )
snake_case_				=			[3, 34, 4, 12, 5, 2]
snake_case_				=			9
snake_case_				=			generate_sum_of_subsets_soln(nums, max_sum)







print(*result)

