code: 
  
  
  
  """simple docstring"""
  
  
  
  
  import unittest
  
  from transformers import is_torch_available
  from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device
  
  
  if is_torch_available():
   import torch
  
   from transformers import CamembertModel
  
  
  
  
  
  
  @require_torch
  @require_sentencepiece
  @require_tokenizers
  class 			UpperCAmelCase_						(       unittest.TestCase		):
  
  
  
        @slow
        def 		snake_case_      (  self  :			Dict		):
             _UpperCAmelCase    :			Dict              =					CamembertModel.from_pretrained("camembert-base"		)
             model.to(A		)
  
             _UpperCAmelCase    :			Optional[Any]              =					torch.tensor(
                 [[5, 1_2_1, 1_1, 6_6_0, 1_6, 7_3_0, 2_5_5_4_3, 1_1_0, 8_3, 6]]  ,			device=A  ,			dtype=torch.long  ,			)  # J'aime le camembert !
             with torch.no_grad():
                  _UpperCAmelCase    :			Dict              =					model(A		)["last_hidden_state"]
             _UpperCAmelCase    :			List[Any]              =					torch.Size((1, 1_0, 7_6_8)		)
             self.assertEqual(output.shape  ,			A		)
             # compare the actual values for a slice.
             _UpperCAmelCase    :			List[Any]              =					torch.tensor(
                 [[[-0.0_254, 0.0_235, 0.1_027], [0.0_606, -0.1_811, -0.0_418], [-0.1_561, -0.1_127, 0.2_687]]]  ,			device=A  ,			dtype=torch.float  ,			)
             # camembert = torch.hub.load('pytorch/fairseq', 'camembert.v0')
             # camembert.eval()
             # expected_slice = roberta.model.forward(input_ids)[0][:, :3, :3].detach()
  
             self.assertTrue(torch.allclose(output[:, :3, :3]  ,			A  ,			atol=1e-4		)		)
  
style_context: 
  
  
  
  """simple docstring"""
  
  
  
  
  def 		__snake_case		(   SCREAMING_SNAKE_CASE__			:		list       )						->     bool:
  
  
  
  
  
       '''simple docstring'''
  
       if not isinstance(SCREAMING_SNAKE_CASE__		,						SCREAMING_SNAKE_CASE__       ):
            raise ValueError("Input series is not valid, valid series - [1, 2/3, 2]"       )
       if len(SCREAMING_SNAKE_CASE__       ) == 0:
            raise ValueError("Input list must be a non empty list"       )
       if len(SCREAMING_SNAKE_CASE__       ) == 1 and series[0] != 0:
            return True
       _UpperCAmelCase    :			Tuple              =					[]
       _UpperCAmelCase    :			Any              =					len(SCREAMING_SNAKE_CASE__       )
       for i in range(0		,						SCREAMING_SNAKE_CASE__       ):
            if series[i] == 0:
                 raise ValueError("Input series cannot have 0 as an element"       )
            rec_series.append(1 / series[i]       )
       _UpperCAmelCase    :			Dict              =					rec_series[1] - rec_series[0]
       for index in range(2		,						SCREAMING_SNAKE_CASE__       ):
            if rec_series[index] - rec_series[index - 1] != common_diff:
                 return False
       return True
  
  def 		__snake_case		(   SCREAMING_SNAKE_CASE__			:		list       )						->     float:
  
  
  
  
  
       '''simple docstring'''
  
       if not isinstance(SCREAMING_SNAKE_CASE__		,						SCREAMING_SNAKE_CASE__       ):
            raise ValueError("Input series is not valid, valid series - [2, 4, 6]"       )
       if len(SCREAMING_SNAKE_CASE__       ) == 0:
            raise ValueError("Input list must be a non empty list"       )
       _UpperCAmelCase    :			Any              =					0
       for val in series:
            answer += 1 / val
       return len(SCREAMING_SNAKE_CASE__       ) / answer
  
  
  if __name__ == "__main__":
   import doctest
  
   doctest.testmod()
  