



'''simple docstring'''






import unittest

import numpy as np

from transformers import is_flax_available
from transformers.testing_utils import require_flax

from ..test_modeling_flax_common import ids_tensor


if is_flax_available():
						import jax
						import jax.numpy as jnp

						from transformers.generation import (
						    FlaxForcedBOSTokenLogitsProcessor,
						    FlaxForcedEOSTokenLogitsProcessor,
						    FlaxLogitsProcessorList,
						    FlaxMinLengthLogitsProcessor,
						    FlaxTemperatureLogitsWarper,
						    FlaxTopKLogitsWarper,
						    FlaxTopPLogitsWarper,
						)

@require_flax
class        SCREAMING_SNAKE_CASE(							unittest.TestCase    ):







	"""simple docstring"""






	def   A			(		self    :  Any	,    __snake_case    :  int	,    __snake_case    :  int	)    ->	Any:
								UpperCAmelCase				: Optional[Any]											=	jnp.ones((batch_size, length)	) / length
								return scores







	def   A			(		self    :  str	)    ->	List[Any]:
								UpperCAmelCase				: Dict											=	None
								UpperCAmelCase				: int											=	20

								UpperCAmelCase				: Dict											=	self._get_uniform_logits(batch_size=2	,    length=__snake_case	)

								# tweak scores to not be uniform anymore
								UpperCAmelCase				: Dict											=	scores.at[1, 5].set((1 / length) + 0.1	)  # peak, 1st batch
								UpperCAmelCase				: Optional[Any]											=	scores.at[1, 10].set((1 / length) - 0.4	)  # valley, 1st batch

								# compute softmax
								UpperCAmelCase				: Optional[Any]											=	jax.nn.softmax(__snake_case	,    axis=-1	)

								UpperCAmelCase				: str											=	FlaxTemperatureLogitsWarper(temperature=0.5	)
								UpperCAmelCase				: List[str]											=	FlaxTemperatureLogitsWarper(temperature=1.3	)

								UpperCAmelCase				: str											=	jax.nn.softmax(temp_dist_warper_sharper(__snake_case	,    scores.copy()	,    cur_len=__snake_case	)	,    axis=-1	)
								UpperCAmelCase				: Dict											=	jax.nn.softmax(temp_dist_warper_smoother(__snake_case	,    scores.copy()	,    cur_len=__snake_case	)	,    axis=-1	)

								# uniform distribution stays uniform
								self.assertTrue(jnp.allclose(probs[0, :]	,    warped_prob_sharp[0, :]	,    atol=1E-3	)	)
								self.assertTrue(jnp.allclose(probs[0, :]	,    warped_prob_smooth[0, :]	,    atol=1E-3	)	)

								# sharp peaks get higher, valleys get lower
								self.assertLess(probs[1, :].max()	,    warped_prob_sharp[1, :].max()	)
								self.assertGreater(probs[1, :].min()	,    warped_prob_sharp[1, :].min()	)

								# smooth peaks get lower, valleys get higher
								self.assertGreater(probs[1, :].max()	,    warped_prob_smooth[1, :].max()	)
								self.assertLess(probs[1, :].min()	,    warped_prob_smooth[1, :].min()	)







	def   A			(		self    :  Union[str, Any]	)    ->	Any:
								UpperCAmelCase				: Tuple											=	None
								UpperCAmelCase				: Union[str, Any]											=	10
								UpperCAmelCase				: Tuple											=	2

								# create ramp distribution
								UpperCAmelCase				: Any											=	np.broadcast_to(np.arange(__snake_case	)[None, :]	,    (batch_size, vocab_size)	).copy()
								UpperCAmelCase				: Optional[int]											=	ramp_logits[1:, : vocab_size // 2] + vocab_size

								UpperCAmelCase				: List[str]											=	FlaxTopKLogitsWarper(3	)

								UpperCAmelCase				: int											=	top_k_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)

								# check that correct tokens are filtered
								self.assertListEqual(jnp.isinf(scores[0]	).tolist()	,    7 * [True] + 3 * [False]	)
								self.assertListEqual(jnp.isinf(scores[1]	).tolist()	,    2 * [True] + 3 * [False] + 5 * [True]	)

								# check special case
								UpperCAmelCase				: List[str]											=	5
								UpperCAmelCase				: Optional[Any]											=	FlaxTopKLogitsWarper(top_k=1	,    filter_value=0.0	,    min_tokens_to_keep=3	)

								UpperCAmelCase				: Dict											=	np.broadcast_to(np.arange(__snake_case	)[None, :]	,    (batch_size, length)	).copy()
								UpperCAmelCase				: List[Any]											=	top_k_warp_safety_check(__snake_case	,    __snake_case	,    cur_len=__snake_case	)

								# min_tokens overwrites k: 3 tokens are kept => 2 tokens are nullified
								self.assertListEqual((scores == 0.0).sum(axis=-1	).tolist()	,    [2, 2]	)







	def   A			(		self    :  str	)    ->	Union[str, Any]:
								UpperCAmelCase				: Optional[Any]											=	None
								UpperCAmelCase				: Optional[int]											=	10
								UpperCAmelCase				: Optional[Any]											=	2

								# create distribution and take log (inverse to Softmax as taken in TopPLogitsWarper)
								UpperCAmelCase				: Tuple											=	np.log(np.array([[0.3, 0.1, 0.1, 0.5], [0.15, 0.3, 0.3, 0.25]]	)	)

								UpperCAmelCase				: Optional[int]											=	FlaxTopPLogitsWarper(0.8	)
								UpperCAmelCase				: Dict											=	np.exp(top_p_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)	)

								# dist should be filtered to keep min num values so that sum is >= top_p
								# exp (-inf) => 0
								UpperCAmelCase				: Dict											=	np.array([[0.3, 0.0, 0.0, 0.5], [0.0, 0.3, 0.3, 0.25]]	)
								self.assertTrue(np.allclose(__snake_case	,    __snake_case	,    atol=1E-3	)	)

								# check edge cases with negative and extreme logits
								UpperCAmelCase				: Union[str, Any]											=	np.broadcast_to(np.arange(__snake_case	)[None, :]	,    (batch_size, vocab_size)	).copy() - (
								    vocab_size // 2
								)

								# make ramp_logits more extreme
								UpperCAmelCase				: List[str]											=	ramp_logits[1] * 100.0

								# make sure at least 2 tokens are kept
								UpperCAmelCase				: Optional[int]											=	FlaxTopPLogitsWarper(0.9	,    min_tokens_to_keep=2	,    filter_value=0.0	)
								UpperCAmelCase				: Optional[int]											=	top_p_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)

								# first batch should keep three tokens, second batch would keep only 1, but due to `min_tokens_to_keep=2` keeps 2.
								self.assertListEqual((filtered_dist != 0.0).sum(axis=-1	).tolist()	,    [3, 2]	)







	def   A			(		self    :  str	)    ->	str:
								UpperCAmelCase				: Dict											=	20
								UpperCAmelCase				: Union[str, Any]											=	4
								UpperCAmelCase				: Optional[Any]											=	0

								UpperCAmelCase				: Optional[Any]											=	FlaxMinLengthLogitsProcessor(min_length=10	,    eos_token_id=__snake_case	)

								# check that min length is applied at length 5
								UpperCAmelCase				: List[str]											=	ids_tensor((batch_size, 20)	,    vocab_size=20	)
								UpperCAmelCase				: int											=	5
								UpperCAmelCase				: List[Any]											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: Optional[int]											=	min_dist_processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								self.assertListEqual(scores_before_min_length[:, eos_token_id].tolist()	,    4 * [-float('''inf'''	)]	)

								# check that min length is not applied anymore at length 15
								UpperCAmelCase				: Any											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: Any											=	15
								UpperCAmelCase				: Optional[int]											=	min_dist_processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								self.assertFalse(jnp.isinf(__snake_case	).any()	)







	def   A			(		self    :  Optional[int]	)    ->	Dict:
								UpperCAmelCase				: Optional[int]											=	20
								UpperCAmelCase				: List[Any]											=	4
								UpperCAmelCase				: int											=	0

								UpperCAmelCase				: List[Any]											=	FlaxForcedBOSTokenLogitsProcessor(bos_token_id=__snake_case	)

								# check that all scores are -inf except the bos_token_id score
								UpperCAmelCase				: Dict											=	ids_tensor((batch_size, 1)	,    vocab_size=20	)
								UpperCAmelCase				: Union[str, Any]											=	1
								UpperCAmelCase				: Dict											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: int											=	logits_processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								self.assertTrue(jnp.isneginf(scores[:, bos_token_id + 1 :]	).all()	)
								self.assertListEqual(scores[:, bos_token_id].tolist()	,    4 * [0]	)  # score for bos_token_id shold be zero

								# check that bos_token_id is not forced if current length is greater than 1
								UpperCAmelCase				: str											=	3
								UpperCAmelCase				: str											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: Union[str, Any]											=	logits_processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								self.assertFalse(jnp.isinf(__snake_case	).any()	)







	def   A			(		self    :  List[str]	)    ->	List[Any]:
								UpperCAmelCase				: Dict											=	20
								UpperCAmelCase				: Optional[int]											=	4
								UpperCAmelCase				: List[Any]											=	0
								UpperCAmelCase				: Optional[Any]											=	5

								UpperCAmelCase				: Tuple											=	FlaxForcedEOSTokenLogitsProcessor(max_length=__snake_case	,    eos_token_id=__snake_case	)

								# check that all scores are -inf except the eos_token_id when max_length is reached
								UpperCAmelCase				: Optional[Any]											=	ids_tensor((batch_size, 4)	,    vocab_size=20	)
								UpperCAmelCase				: Optional[Any]											=	4
								UpperCAmelCase				: Tuple											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: Dict											=	logits_processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								self.assertTrue(jnp.isneginf(scores[:, eos_token_id + 1 :]	).all()	)
								self.assertListEqual(scores[:, eos_token_id].tolist()	,    4 * [0]	)  # score for eos_token_id should be zero

								# check that eos_token_id is not forced if max_length is not reached
								UpperCAmelCase				: Optional[Any]											=	3
								UpperCAmelCase				: Any											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: int											=	logits_processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								self.assertFalse(jnp.isinf(__snake_case	).any()	)







	def   A			(		self    :  Tuple	)    ->	int:
								UpperCAmelCase				: Any											=	4
								UpperCAmelCase				: List[str]											=	10
								UpperCAmelCase				: Tuple											=	15
								UpperCAmelCase				: Any											=	2
								UpperCAmelCase				: Any											=	1
								UpperCAmelCase				: int											=	15

								# dummy input_ids and scores
								UpperCAmelCase				: List[Any]											=	ids_tensor((batch_size, sequence_length)	,    __snake_case	)
								UpperCAmelCase				: Optional[int]											=	input_ids.copy()

								UpperCAmelCase				: Tuple											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: List[Any]											=	scores.copy()

								# instantiate all dist processors
								UpperCAmelCase				: Tuple											=	FlaxTemperatureLogitsWarper(temperature=0.5	)
								UpperCAmelCase				: Optional[int]											=	FlaxTopKLogitsWarper(3	)
								UpperCAmelCase				: Dict											=	FlaxTopPLogitsWarper(0.8	)

								# instantiate all logits processors
								UpperCAmelCase				: Dict											=	FlaxMinLengthLogitsProcessor(min_length=10	,    eos_token_id=__snake_case	)
								UpperCAmelCase				: int											=	FlaxForcedBOSTokenLogitsProcessor(bos_token_id=__snake_case	)
								UpperCAmelCase				: int											=	FlaxForcedEOSTokenLogitsProcessor(max_length=__snake_case	,    eos_token_id=__snake_case	)

								UpperCAmelCase				: Dict											=	10

								# no processor list
								UpperCAmelCase				: Optional[Any]											=	temp_dist_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								UpperCAmelCase				: Dict											=	top_k_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								UpperCAmelCase				: Union[str, Any]											=	top_p_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								UpperCAmelCase				: Dict											=	min_dist_proc(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								UpperCAmelCase				: str											=	bos_dist_proc(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
								UpperCAmelCase				: Union[str, Any]											=	eos_dist_proc(__snake_case	,    __snake_case	,    cur_len=__snake_case	)

								# with processor list
								UpperCAmelCase				: Tuple											=	FlaxLogitsProcessorList(
								    [temp_dist_warp, top_k_warp, top_p_warp, min_dist_proc, bos_dist_proc, eos_dist_proc]	)
								UpperCAmelCase				: Any											=	processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)

								# scores should be equal
								self.assertTrue(jnp.allclose(__snake_case	,    __snake_case	,    atol=1E-3	)	)

								# input_ids should never be changed
								self.assertListEqual(input_ids.tolist()	,    input_ids_comp.tolist()	)







	def   A			(		self    :  Union[str, Any]	)    ->	Dict:
								UpperCAmelCase				: List[Any]											=	4
								UpperCAmelCase				: Optional[int]											=	10
								UpperCAmelCase				: Tuple											=	15
								UpperCAmelCase				: int											=	2
								UpperCAmelCase				: Any											=	1
								UpperCAmelCase				: str											=	15

								# dummy input_ids and scores
								UpperCAmelCase				: Tuple											=	ids_tensor((batch_size, sequence_length)	,    __snake_case	)
								UpperCAmelCase				: Tuple											=	input_ids.copy()

								UpperCAmelCase				: Optional[Any]											=	self._get_uniform_logits(__snake_case	,    __snake_case	)
								UpperCAmelCase				: Dict											=	scores.copy()

								# instantiate all dist processors
								UpperCAmelCase				: str											=	FlaxTemperatureLogitsWarper(temperature=0.5	)
								UpperCAmelCase				: List[Any]											=	FlaxTopKLogitsWarper(3	)
								UpperCAmelCase				: Any											=	FlaxTopPLogitsWarper(0.8	)

								# instantiate all logits processors
								UpperCAmelCase				: List[Any]											=	FlaxMinLengthLogitsProcessor(min_length=10	,    eos_token_id=__snake_case	)
								UpperCAmelCase				: Optional[int]											=	FlaxForcedBOSTokenLogitsProcessor(bos_token_id=__snake_case	)
								UpperCAmelCase				: Union[str, Any]											=	FlaxForcedEOSTokenLogitsProcessor(max_length=__snake_case	,    eos_token_id=__snake_case	)

								UpperCAmelCase				: Union[str, Any]											=	10

								# no processor list
								def run_no_processor_list(__snake_case    :  Optional[Any]	,    __snake_case    :  int	,    __snake_case    :  List[Any]	):
															UpperCAmelCase				: Dict											=	temp_dist_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
															UpperCAmelCase				: List[Any]											=	top_k_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
															UpperCAmelCase				: List[str]											=	top_p_warp(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
															UpperCAmelCase				: List[str]											=	min_dist_proc(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
															UpperCAmelCase				: Union[str, Any]											=	bos_dist_proc(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
															UpperCAmelCase				: Optional[int]											=	eos_dist_proc(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
															return scores

								# with processor list
								def run_processor_list(__snake_case    :  int	,    __snake_case    :  str	,    __snake_case    :  Dict	):
															UpperCAmelCase				: Optional[int]											=	FlaxLogitsProcessorList(
															    [temp_dist_warp, top_k_warp, top_p_warp, min_dist_proc, bos_dist_proc, eos_dist_proc]	)
															UpperCAmelCase				: int											=	processor(__snake_case	,    __snake_case	,    cur_len=__snake_case	)
															return scores

								UpperCAmelCase				: Tuple											=	jax.jit(__snake_case	)
								UpperCAmelCase				: Any											=	jax.jit(__snake_case	)

								UpperCAmelCase				: Optional[Any]											=	jitted_run_no_processor_list(__snake_case	,    __snake_case	,    __snake_case	)
								UpperCAmelCase				: Union[str, Any]											=	jitted_run_processor_list(__snake_case	,    __snake_case	,    __snake_case	)

								# scores should be equal
								self.assertTrue(jnp.allclose(__snake_case	,    __snake_case	,    atol=1E-3	)	)

								# input_ids should never be changed
								self.assertListEqual(input_ids.tolist()	,    input_ids_comp.tolist()	)










'''simple docstring'''






import numpy as np
import torch
import tqdm

from ...models.unet_ad import UNetaDModel
from ...pipelines import DiffusionPipeline
from ...utils import randn_tensor
from ...utils.dummy_pt_objects import DDPMScheduler

class        SCREAMING_SNAKE_CASE(							A__    ):







	"""simple docstring"""






	def __init__(		self    :  Union[str, Any]	,    __snake_case    :  UNetaDModel	,    __snake_case    :  UNetaDModel	,    __snake_case    :  DDPMScheduler	,    __snake_case    :  List[Any]	,    )    ->	List[str]:
								super().__init__()
								UpperCAmelCase				: Any											=	value_function
								UpperCAmelCase				: List[str]											=	unet
								UpperCAmelCase				: Dict											=	scheduler
								UpperCAmelCase				: Union[str, Any]											=	env
								UpperCAmelCase				: Dict											=	env.get_dataset()
								UpperCAmelCase				: Tuple											=	{}
								for key in self.data.keys():
															try:
																						UpperCAmelCase				: Optional[int]											=	self.data[key].mean()
															except:  # noqa: E722
																						pass
								UpperCAmelCase				: Any											=	{}
								for key in self.data.keys():
															try:
																						UpperCAmelCase				: str											=	self.data[key].std()
															except:  # noqa: E722
																						pass
								UpperCAmelCase				: int											=	env.observation_space.shape[0]
								UpperCAmelCase				: Optional[Any]											=	env.action_space.shape[0]







	def   A			(		self    :  Any	,    __snake_case    :  Optional[Any]	,    __snake_case    :  Union[str, Any]	)    ->	Optional[int]:
								return (x_in - self.means[key]) / self.stds[key]







	def   A			(		self    :  Dict	,    __snake_case    :  Any	,    __snake_case    :  Dict	)    ->	Any:
								return x_in * self.stds[key] + self.means[key]







	def   A			(		self    :  Any	,    __snake_case    :  int	)    ->	List[Any]:
								if type(__snake_case	) is dict:
															return {k: self.to_torch(__snake_case	) for k, v in x_in.items()}
								elif torch.is_tensor(__snake_case	):
															return x_in.to(self.unet.device	)
								return torch.tensor(__snake_case	,    device=self.unet.device	)







	def   A			(		self    :  int	,    __snake_case    :  Optional[int]	,    __snake_case    :  str	,    __snake_case    :  Union[str, Any]	)    ->	Dict:
								for key, val in cond.items():
															UpperCAmelCase				: List[Any]											=	val.clone()
								return x_in







	def   A			(		self    :  Optional[Any]	,    __snake_case    :  Dict	,    __snake_case    :  List[Any]	,    __snake_case    :  Any	,    __snake_case    :  Dict	)    ->	Any:
								UpperCAmelCase				: Any											=	x.shape[0]
								UpperCAmelCase				: Any											=	None
								for i in tqdm.tqdm(self.scheduler.timesteps	):
															# create batch of timesteps to pass into model
															UpperCAmelCase				: Tuple											=	torch.full((batch_size,)	,    __snake_case	,    device=self.unet.device	,    dtype=torch.long	)
															for _ in range(__snake_case	):
																						with torch.enable_grad():
																													x.requires_grad_()

																													# permute to match dimension for pre-trained models
																													UpperCAmelCase				: Any											=	self.value_function(x.permute(0	,    2	,    1	)	,    __snake_case	).sample
																													UpperCAmelCase				: Dict											=	torch.autograd.grad([y.sum()]	,    [x]	)[0]

																													UpperCAmelCase				: Tuple											=	self.scheduler._get_variance(__snake_case	)
																													UpperCAmelCase				: Optional[int]											=	torch.exp(0.5 * posterior_variance	)
																													UpperCAmelCase				: str											=	model_std * grad

																						UpperCAmelCase				: Dict											=	0
																						UpperCAmelCase				: Optional[int]											=	x.detach()
																						UpperCAmelCase				: List[str]											=	x + scale * grad
																						UpperCAmelCase				: List[str]											=	self.reset_xa(__snake_case	,    __snake_case	,    self.action_dim	)

															UpperCAmelCase				: str											=	self.unet(x.permute(0	,    2	,    1	)	,    __snake_case	).sample.permute(0	,    2	,    1	)

															# TODO: verify deprecation of this kwarg
															UpperCAmelCase				: Optional[int]											=	self.scheduler.step(__snake_case	,    __snake_case	,    __snake_case	,    predict_epsilon=__snake_case	)['''prev_sample''']

															# apply conditions to the trajectory (set the initial state)
															UpperCAmelCase				: Any											=	self.reset_xa(__snake_case	,    __snake_case	,    self.action_dim	)
															UpperCAmelCase				: List[str]											=	self.to_torch(__snake_case	)
								return x, y







	def __call__(		self    :  Any	,    __snake_case    :  List[str]	,    __snake_case    :  Optional[Any]=64	,    __snake_case    :  Optional[int]=32	,    __snake_case    :  Union[str, Any]=2	,    __snake_case    :  Optional[int]=0.1	)    ->	Tuple:
								# normalize the observations and create  batch dimension
								UpperCAmelCase				: Optional[Any]											=	self.normalize(__snake_case	,    '''observations'''	)
								UpperCAmelCase				: Optional[int]											=	obs[None].repeat(__snake_case	,    axis=0	)

								UpperCAmelCase				: Tuple											=	{0: self.to_torch(__snake_case	)}
								UpperCAmelCase				: Tuple											=	(batch_size, planning_horizon, self.state_dim + self.action_dim)

								# generate initial noise and apply our conditions (to make the trajectories start at current state)
								UpperCAmelCase				: Union[str, Any]											=	randn_tensor(__snake_case	,    device=self.unet.device	)
								UpperCAmelCase				: int											=	self.reset_xa(__snake_case	,    __snake_case	,    self.action_dim	)
								UpperCAmelCase				: List[Any]											=	self.to_torch(__snake_case	)

								# run the diffusion process
								UpperCAmelCase							,	UpperCAmelCase				: Optional[int]											=	self.run_diffusion(__snake_case	,    __snake_case	,    __snake_case	,    __snake_case	)

								# sort output trajectories by value
								UpperCAmelCase				: str											=	y.argsort(0	,    descending=__snake_case	).squeeze()
								UpperCAmelCase				: Tuple											=	x[sorted_idx]
								UpperCAmelCase				: List[Any]											=	sorted_values[:, :, : self.action_dim]
								UpperCAmelCase				: str											=	actions.detach().cpu().numpy()
								UpperCAmelCase				: List[str]											=	self.de_normalize(__snake_case	,    key='''actions'''	)

								# select the action with the highest value
								if y is not None:
															UpperCAmelCase				: List[Any]											=	0
								else:
															# if we didn't run value guiding, select a random action
															UpperCAmelCase				: Optional[int]											=	np.random.randint(0	,    __snake_case	)

								UpperCAmelCase				: Optional[int]											=	denorm_actions[selected_index, 0]
								return denorm_actions





