






"""simple docstring"""



import math
import warnings
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union

import numpy as np
import torch
from scipy import integrate

from ..configuration_utils import ConfigMixin, register_to_config
from ..utils import BaseOutput
from .scheduling_utils import KarrasDiffusionSchedulers, SchedulerMixin

@dataclass
# Copied from diffusers.schedulers.scheduling_ddpm.DDPMSchedulerOutput with DDPM->LMSDiscrete
class 	a					(       a_     ):
    UpperCAmelCase_			:					torch.FloatTensor
    UpperCAmelCase_			:					Optional[torch.FloatTensor]     					=None


def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  Any		, __snake_case      :  Any=0.999		, __snake_case      :  Tuple="cosine"		, ):





  '''simple docstring'''





  if alpha_transform_type == "cosine":

    def alpha_bar_fn(__snake_case      :  Any   ):
      return math.cos((t + 0.008) / 1.008 * math.pi / 2   ) ** 2

  elif alpha_transform_type == "exp":

    def alpha_bar_fn(__snake_case      :  List[str]   ):
      return math.exp(t * -12.0   )

  else:
    raise ValueError(f'Unsupported alpha_tranform_type: {alpha_transform_type}'   )

  lowercase							   =	[]
  for i in range(__snake_case   ):
    lowercase							   =	i / num_diffusion_timesteps
    lowercase							   =	(i + 1) / num_diffusion_timesteps
    betas.append(min(1 - alpha_bar_fn(__snake_case   ) / alpha_bar_fn(__snake_case   )		, __snake_case   )   )
  return torch.tensor(__snake_case		, dtype=torch.floataa   )



class 	a					(       a_,    a_     ):
    UpperCAmelCase_			:					str     					=[e.name for e in KarrasDiffusionSchedulers]
    UpperCAmelCase_			:					Any     					=1







    @register_to_config
    def __init__(      self							,		_lowerCamelCase = 1_0_0_0							,		_lowerCamelCase = 0.0_0_0_1							,		_lowerCamelCase = 0.0_2							,		_lowerCamelCase = "linear"							,		_lowerCamelCase = None							,		_lowerCamelCase = False							,		_lowerCamelCase = "epsilon"							,		_lowerCamelCase = "linspace"							,		_lowerCamelCase = 0							,		):
      if trained_betas is not None:
        lowercase							   =	torch.tensor(_lowerCamelCase							,		dtype=torch.floataa	)
      elif beta_schedule == "linear":
        lowercase							   =	torch.linspace(_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		dtype=torch.floataa	)
      elif beta_schedule == "scaled_linear":
        # this schedule is very specific to the latent diffusion model.
        lowercase							   =	(
            torch.linspace(beta_start**0.5							,		beta_end**0.5							,		_lowerCamelCase							,		dtype=torch.floataa	) ** 2
        )
      elif beta_schedule == "squaredcos_cap_v2":
        # Glide cosine schedule
        lowercase							   =	betas_for_alpha_bar(_lowerCamelCase	)
      else:
        raise NotImplementedError(F'{beta_schedule} does is not implemented for {self.__class__}'	)

      lowercase							   =	1.0 - self.betas
      lowercase							   =	torch.cumprod(self.alphas							,		dim=0	)

      lowercase							   =	np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5	)
      lowercase							   =	np.concatenate([sigmas[::-1], [0.0]]	).astype(np.floataa	)
      lowercase							   =	torch.from_numpy(_lowerCamelCase	)

      # setable values
      lowercase							   =	None
      lowercase							   =	use_karras_sigmas
      self.set_timesteps(_lowerCamelCase							,		_lowerCamelCase	)
      lowercase							   =	[]
      lowercase							   =	False







    @property
    def       UpperCamelCase_				(      self	):
      # standard deviation of the initial noise distribution
      if self.config.timestep_spacing in ["linspace", "trailing"]:
        return self.sigmas.max()

      return (self.sigmas.max() ** 2 + 1) ** 0.5







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase	):
      if isinstance(_lowerCamelCase							,		torch.Tensor	):
        lowercase							   =	timestep.to(self.timesteps.device	)
      lowercase							   =	(self.timesteps == timestep).nonzero().item()
      lowercase							   =	self.sigmas[step_index]
      lowercase							   =	sample / ((sigma**2 + 1) ** 0.5)
      lowercase							   =	True
      return sample







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase	):

      def lms_derivative(_lowerCamelCase	):
        lowercase							   =	1.0
        for k in range(_lowerCamelCase	):
          if current_order == k:
            continue
          prod *= (tau - self.sigmas[t - k]) / (self.sigmas[t - current_order] - self.sigmas[t - k])
        return prod

      lowercase							   =	integrate.quad(_lowerCamelCase							,		self.sigmas[t]							,		self.sigmas[t + 1]							,		epsrel=1e-4	)[0]

      return integrated_coeff







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase = None	):
      lowercase							   =	num_inference_steps

      # "linspace", "leading", "trailing" corresponds to annotation of Table 2. of https://arxiv.org/abs/2305.08891
      if self.config.timestep_spacing == "linspace":
        lowercase							   =	np.linspace(0							,		self.config.num_train_timesteps - 1							,		_lowerCamelCase							,		dtype=_lowerCamelCase	)[
            ::-1
        ].copy()
      elif self.config.timestep_spacing == "leading":
        lowercase							   =	self.config.num_train_timesteps // self.num_inference_steps
        # creates integer timesteps by multiplying by ratio
        # casting to int to avoid issues when num_inference_step is power of 3
        lowercase							   =	(np.arange(0							,		_lowerCamelCase	) * step_ratio).round()[::-1].copy().astype(_lowerCamelCase	)
        timesteps += self.config.steps_offset
      elif self.config.timestep_spacing == "trailing":
        lowercase							   =	self.config.num_train_timesteps / self.num_inference_steps
        # creates integer timesteps by multiplying by ratio
        # casting to int to avoid issues when num_inference_step is power of 3
        lowercase							   =	(np.arange(self.config.num_train_timesteps							,		0							,		-step_ratio	)).round().copy().astype(_lowerCamelCase	)
        timesteps -= 1
      else:
        raise ValueError(
            F'{self.config.timestep_spacing} is not supported. Please make sure to choose one of \'linspace\', \'leading\' or \'trailing\'.'	)

      lowercase							   =	np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5	)
      lowercase							   =	np.log(_lowerCamelCase	)
      lowercase							   =	np.interp(_lowerCamelCase							,		np.arange(0							,		len(_lowerCamelCase	)	)							,		_lowerCamelCase	)

      if self.use_karras_sigmas:
        lowercase							   =	self._convert_to_karras(in_sigmas=_lowerCamelCase	)
        lowercase							   =	np.array([self._sigma_to_t(_lowerCamelCase							,		_lowerCamelCase	) for sigma in sigmas]	)

      lowercase							   =	np.concatenate([sigmas, [0.0]]	).astype(np.floataa	)

      lowercase							   =	torch.from_numpy(_lowerCamelCase	).to(device=_lowerCamelCase	)
      if str(_lowerCamelCase	).startswith('mps'	):
        # mps does not support float64
        lowercase							   =	torch.from_numpy(_lowerCamelCase	).to(_lowerCamelCase							,		dtype=torch.floataa	)
      else:
        lowercase							   =	torch.from_numpy(_lowerCamelCase	).to(device=_lowerCamelCase	)

      lowercase							   =	[]







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase	):
      # get log sigma
      lowercase							   =	np.log(_lowerCamelCase	)

      # get distribution
      lowercase							   =	log_sigma - log_sigmas[:, np.newaxis]

      # get sigmas range
      lowercase							   =	np.cumsum((dists >= 0)							,		axis=0	).argmax(axis=0	).clip(max=log_sigmas.shape[0] - 2	)
      lowercase							   =	low_idx + 1

      lowercase							   =	log_sigmas[low_idx]
      lowercase							   =	log_sigmas[high_idx]

      # interpolate sigmas
      lowercase							   =	(low - log_sigma) / (low - high)
      lowercase							   =	np.clip(_lowerCamelCase							,		0							,		1	)

      # transform interpolation to time range
      lowercase							   =	(1 - w) * low_idx + w * high_idx
      lowercase							   =	t.reshape(sigma.shape	)
      return t







    def       UpperCamelCase_				(      self							,		_lowerCamelCase	):
      lowercase							   =	in_sigmas[-1].item()
      lowercase							   =	in_sigmas[0].item()

      lowercase							   =	7.0  # 7.0 is the value used in the paper
      lowercase							   =	np.linspace(0							,		1							,		self.num_inference_steps	)
      lowercase							   =	sigma_min ** (1 / rho)
      lowercase							   =	sigma_max ** (1 / rho)
      lowercase							   =	(max_inv_rho + ramp * (min_inv_rho - max_inv_rho)) ** rho
      return sigmas







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase = 4							,		_lowerCamelCase = True							,		):
      if not self.is_scale_input_called:
        warnings.warn(
            'The `scale_model_input` function should be called before `step` to ensure correct denoising. '
            'See `StableDiffusionPipeline` for a usage example.'	)

      if isinstance(_lowerCamelCase							,		torch.Tensor	):
        lowercase							   =	timestep.to(self.timesteps.device	)
      lowercase							   =	(self.timesteps == timestep).nonzero().item()
      lowercase							   =	self.sigmas[step_index]

      # 1. compute predicted original sample (x_0) from sigma-scaled predicted noise
      if self.config.prediction_type == "epsilon":
        lowercase							   =	sample - sigma * model_output
      elif self.config.prediction_type == "v_prediction":
        # * c_out + input * c_skip
        lowercase							   =	model_output * (-sigma / (sigma**2 + 1) ** 0.5) + (sample / (sigma**2 + 1))
      elif self.config.prediction_type == "sample":
        lowercase							   =	model_output
      else:
        raise ValueError(
            F'prediction_type given as {self.config.prediction_type} must be one of `epsilon`, or `v_prediction`'	)

      # 2. Convert to an ODE derivative
      lowercase							   =	(sample - pred_original_sample) / sigma
      self.derivatives.append(_lowerCamelCase	)
      if len(self.derivatives	) > order:
        self.derivatives.pop(0	)

      # 3. Compute linear multistep coefficients
      lowercase							   =	min(step_index + 1							,		_lowerCamelCase	)
      lowercase							   =	[self.get_lms_coefficient(_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase	) for curr_order in range(_lowerCamelCase	)]

      # 4. Compute previous sample based on the derivatives path
      lowercase							   =	sample + sum(
          coeff * derivative for coeff, derivative in zip(_lowerCamelCase							,		reversed(self.derivatives	)	)	)

      if not return_dict:
        return (prev_sample,)

      return LMSDiscreteSchedulerOutput(prev_sample=_lowerCamelCase							,		pred_original_sample=_lowerCamelCase	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      # Make sure sigmas and timesteps have the same device and dtype as original_samples
      lowercase							   =	self.sigmas.to(device=original_samples.device							,		dtype=original_samples.dtype	)
      if original_samples.device.type == "mps" and torch.is_floating_point(_lowerCamelCase	):
        # mps does not support float64
        lowercase							   =	self.timesteps.to(original_samples.device							,		dtype=torch.floataa	)
        lowercase							   =	timesteps.to(original_samples.device							,		dtype=torch.floataa	)
      else:
        lowercase							   =	self.timesteps.to(original_samples.device	)
        lowercase							   =	timesteps.to(original_samples.device	)

      lowercase							   =	[(schedule_timesteps == t).nonzero().item() for t in timesteps]

      lowercase							   =	sigmas[step_indices].flatten()
      while len(sigma.shape	) < len(original_samples.shape	):
        lowercase							   =	sigma.unsqueeze(-1	)

      lowercase							   =	original_samples + noise * sigma
      return noisy_samples







    def __len__(      self	):
      return self.config.num_train_timesteps










"""simple docstring"""



import json
import os
from functools import lru_cache
from typing import List, Optional, Tuple

import regex as re

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


_UpperCamelCase		:  Optional[Any]						=		logging.get_logger(__name__)


_UpperCamelCase		:  Any						=		{'vocab_file': 'vocab.json', 'merges_file': 'merges.txt'}

# See all MVP models at https://huggingface.co/models?filter=mvp
_UpperCamelCase		:  Optional[int]						=		{
    'vocab_file': {
        'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/vocab.json',
    },
    'added_tokens.json': {
        'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/added_tokens.json',
    },
    'merges_file': {
        'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/merges.txt',
    },
}

_UpperCamelCase		:  Union[str, Any]						=		{
    'RUCAIBox/mvp': 1_0_2_4,
}
@lru_cache()
def 						_SCREAMING_SNAKE_CASE			(   ):





  '''simple docstring'''





  lowercase							   =	(
      list(range(ord('!'   )		, ord('~'   ) + 1   )   ) + list(range(ord('¡'   )		, ord('¬'   ) + 1   )   ) + list(range(ord('®'   )		, ord('ÿ'   ) + 1   )   )
  )
  lowercase							   =	bs[:]
  lowercase							   =	0
  for b in range(2**8   ):
    if b not in bs:
      bs.append(__snake_case   )
      cs.append(2**8 + n   )
      n += 1
  lowercase							   =	[chr(__snake_case   ) for n in cs]
  return dict(zip(__snake_case		, __snake_case   )   )
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  int   ):





  '''simple docstring'''





  lowercase							   =	set()
  lowercase							   =	word[0]
  for char in word[1:]:
    pairs.add((prev_char, char)   )
    lowercase							   =	char
  return pairs



class 	a					(       a_     ):
    UpperCAmelCase_			:					Tuple     					=VOCAB_FILES_NAMES
    UpperCAmelCase_			:					int     					=PRETRAINED_VOCAB_FILES_MAP
    UpperCAmelCase_			:					Optional[int]     					=PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    UpperCAmelCase_			:					Any     					=["input_ids", "attention_mask"]







    def __init__(      self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase="replace"							,		_lowerCamelCase="<s>"							,		_lowerCamelCase="</s>"							,		_lowerCamelCase="</s>"							,		_lowerCamelCase="<s>"							,		_lowerCamelCase="<unk>"							,		_lowerCamelCase="<pad>"							,		_lowerCamelCase="<mask>"							,		_lowerCamelCase=False							,		**_lowerCamelCase							,		):
      lowercase							   =	AddedToken(_lowerCamelCase							,		lstrip=_lowerCamelCase							,		rstrip=_lowerCamelCase	) if isinstance(_lowerCamelCase							,		_lowerCamelCase	) else bos_token
      lowercase							   =	AddedToken(_lowerCamelCase							,		lstrip=_lowerCamelCase							,		rstrip=_lowerCamelCase	) if isinstance(_lowerCamelCase							,		_lowerCamelCase	) else eos_token
      lowercase							   =	AddedToken(_lowerCamelCase							,		lstrip=_lowerCamelCase							,		rstrip=_lowerCamelCase	) if isinstance(_lowerCamelCase							,		_lowerCamelCase	) else sep_token
      lowercase							   =	AddedToken(_lowerCamelCase							,		lstrip=_lowerCamelCase							,		rstrip=_lowerCamelCase	) if isinstance(_lowerCamelCase							,		_lowerCamelCase	) else cls_token
      lowercase							   =	AddedToken(_lowerCamelCase							,		lstrip=_lowerCamelCase							,		rstrip=_lowerCamelCase	) if isinstance(_lowerCamelCase							,		_lowerCamelCase	) else unk_token
      lowercase							   =	AddedToken(_lowerCamelCase							,		lstrip=_lowerCamelCase							,		rstrip=_lowerCamelCase	) if isinstance(_lowerCamelCase							,		_lowerCamelCase	) else pad_token

      # Mask token behave like a normal word, i.e. include the space before it
      lowercase							   =	AddedToken(_lowerCamelCase							,		lstrip=_lowerCamelCase							,		rstrip=_lowerCamelCase	) if isinstance(_lowerCamelCase							,		_lowerCamelCase	) else mask_token

      super().__init__(
          errors=_lowerCamelCase							,		bos_token=_lowerCamelCase							,		eos_token=_lowerCamelCase							,		unk_token=_lowerCamelCase							,		sep_token=_lowerCamelCase							,		cls_token=_lowerCamelCase							,		pad_token=_lowerCamelCase							,		mask_token=_lowerCamelCase							,		add_prefix_space=_lowerCamelCase							,		**_lowerCamelCase							,		)
      with open(_lowerCamelCase							,		encoding='utf-8'	) as vocab_handle:
        lowercase							   =	json.load(_lowerCamelCase	)
      lowercase							   =	{v: k for k, v in self.encoder.items()}
      lowercase							   =	errors  # how to handle errors in decoding
      lowercase							   =	bytes_to_unicode()
      lowercase							   =	{v: k for k, v in self.byte_encoder.items()}
      with open(_lowerCamelCase							,		encoding='utf-8'	) as merges_handle:
        lowercase							   =	merges_handle.read().split('\n'	)[1:-1]
      lowercase							   =	[tuple(merge.split()	) for merge in bpe_merges]
      lowercase							   =	dict(zip(_lowerCamelCase							,		range(len(_lowerCamelCase	)	)	)	)
      lowercase							   =	{}
      lowercase							   =	add_prefix_space

      # Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
      lowercase							   =	re.compile(R'\'s|\'t|\'re|\'ve|\'m|\'ll|\'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+'	)







    @property
    def       UpperCamelCase_				(      self	):
      return len(self.encoder	)







    def       UpperCamelCase_				(      self	):
      return dict(self.encoder							,		**self.added_tokens_encoder	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase	):
      if token in self.cache:
        return self.cache[token]
      lowercase							   =	tuple(_lowerCamelCase	)
      lowercase							   =	get_pairs(_lowerCamelCase	)

      if not pairs:
        return token

      while True:
        lowercase							   =	min(_lowerCamelCase							,		key=lambda _lowerCamelCase	: self.bpe_ranks.get(_lowerCamelCase							,		float('inf'	)	)	)
        if bigram not in self.bpe_ranks:
          break
        lowercase   ,					lowercase							   =	bigram
        lowercase							   =	[]
        lowercase							   =	0
        while i < len(_lowerCamelCase	):
          try:
            lowercase							   =	word.index(_lowerCamelCase							,		_lowerCamelCase	)
          except ValueError:
            new_word.extend(word[i:]	)
            break
          else:
            new_word.extend(word[i:j]	)
            lowercase							   =	j

          if word[i] == first and i < len(_lowerCamelCase	) - 1 and word[i + 1] == second:
            new_word.append(first + second	)
            i += 2
          else:
            new_word.append(word[i]	)
            i += 1
        lowercase							   =	tuple(_lowerCamelCase	)
        lowercase							   =	new_word
        if len(_lowerCamelCase	) == 1:
          break
        else:
          lowercase							   =	get_pairs(_lowerCamelCase	)
      lowercase							   =	' '.join(_lowerCamelCase	)
      lowercase							   =	word
      return word







    def       UpperCamelCase_				(      self							,		_lowerCamelCase	):
      lowercase							   =	[]
      for token in re.findall(self.pat							,		_lowerCamelCase	):
        lowercase							   =	''.join(
            self.byte_encoder[b] for b in token.encode('utf-8'	)	)  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
        bpe_tokens.extend(bpe_token for bpe_token in self.bpe(_lowerCamelCase	).split(' '	)	)
      return bpe_tokens







    def       UpperCamelCase_				(      self							,		_lowerCamelCase	):
      return self.encoder.get(_lowerCamelCase							,		self.encoder.get(self.unk_token	)	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase	):
      return self.decoder.get(_lowerCamelCase	)







    def       UpperCamelCase_				(      self							,		_lowerCamelCase	):
      lowercase							   =	''.join(_lowerCamelCase	)
      lowercase							   =	bytearray([self.byte_decoder[c] for c in text]	).decode('utf-8'							,		errors=self.errors	)
      return text







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase = None	):
      if not os.path.isdir(_lowerCamelCase	):
        logger.error(F'Vocabulary path ({save_directory}) should be a directory'	)
        return
      lowercase							   =	os.path.join(
          _lowerCamelCase							,		(filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']	)
      lowercase							   =	os.path.join(
          _lowerCamelCase							,		(filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['merges_file']	)

      with open(_lowerCamelCase							,		'w'							,		encoding='utf-8'	) as f:
        f.write(json.dumps(self.encoder							,		indent=2							,		sort_keys=_lowerCamelCase							,		ensure_ascii=_lowerCamelCase	) + '\n'	)

      lowercase							   =	0
      with open(_lowerCamelCase							,		'w'							,		encoding='utf-8'	) as writer:
        writer.write('#version: 0.2\n'	)
        for bpe_tokens, token_index in sorted(self.bpe_ranks.items()							,		key=lambda _lowerCamelCase	: kv[1]	):
          if index != token_index:
            logger.warning(
                F'Saving vocabulary to {merge_file}: BPE merge indices are not consecutive.'
                ' Please check that the tokenizer is not corrupted!'	)
            lowercase							   =	token_index
          writer.write(' '.join(_lowerCamelCase	) + '\n'	)
          index += 1

      return vocab_file, merge_file







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase = None	):
      if token_ids_a is None:
        return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
      lowercase							   =	[self.cls_token_id]
      lowercase							   =	[self.sep_token_id]
      return cls + token_ids_a + sep + sep + token_ids_a + sep







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase = None							,		_lowerCamelCase = False	):
      if already_has_special_tokens:
        return super().get_special_tokens_mask(
            token_ids_a=_lowerCamelCase							,		token_ids_a=_lowerCamelCase							,		already_has_special_tokens=_lowerCamelCase	)

      if token_ids_a is None:
        return [1] + ([0] * len(_lowerCamelCase	)) + [1]
      return [1] + ([0] * len(_lowerCamelCase	)) + [1, 1] + ([0] * len(_lowerCamelCase	)) + [1]







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase = None	):
      lowercase							   =	[self.sep_token_id]
      lowercase							   =	[self.cls_token_id]

      if token_ids_a is None:
        return len(cls + token_ids_a + sep	) * [0]
      return len(cls + token_ids_a + sep + sep + token_ids_a + sep	) * [0]







    def       UpperCamelCase_				(      self							,		_lowerCamelCase							,		_lowerCamelCase=False							,		**_lowerCamelCase	):
      lowercase							   =	kwargs.pop('add_prefix_space'							,		self.add_prefix_space	)
      if (is_split_into_words or add_prefix_space) and (len(_lowerCamelCase	) > 0 and not text[0].isspace()):
        lowercase							   =	' ' + text
      return (text, kwargs)


