code: 
  import torch
  from transformers import AutoModelForSequenceClassification, AutoTokenizer, Trainer, TrainingArguments
  
  import datasets
  
  
  lowercase_								=    '\\n@article{eddine2021frugalscore,\n  title={FrugalScore: Learning Cheaper, Lighter and Faster Evaluation Metrics for Automatic Text Generation},\n  author={Eddine, Moussa Kamal and Shang, Guokan and Tixier, Antoine J-P and Vazirgiannis, Michalis},\n  journal={arXiv preprint arXiv:2110.08559},\n  year={2021}\n}\n'
  
  lowercase_								=    '\\nFrugalScore is a reference-based metric for NLG models evaluation. It is based on a distillation approach that allows to learn a fixed, low cost version of any expensive NLG metric, while retaining most of its original performance.\n'
  
  
  lowercase_								=    '\nCalculates how good are predictions given some references, using certain scores.\nArgs:\n    predictions (list of str): list of predictions to score. Each predictions\n        should be a string.\n    references (list of str): list of reference for each prediction. Each\n        reference should be a string.\n    batch_size (int): the batch size for predictions.\n    max_length (int): maximum sequence length.\n    device (str): either gpu or cpu\nReturns:\n    scores (list of int): list of scores.\nExamples:\n    >>> frugalscore = datasets.load_metric("frugalscore")\n    >>> results = frugalscore.compute(predictions=[\'hello there\', \'huggingface\'], references=[\'hello world\', \'hugging face\'])\n    >>> print([round(s, 3) for s in results["scores"]])\n    [0.631, 0.645]\n'
  
  
  
  
  @datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION			,							_KWARGS_DESCRIPTION	)
  class 					_UpperCamelCase (      datasets.Metric	):
  
  
  
  
  
  
  
  							'''simple docstring'''
  
  
  
  
  
  
  
  							def 		_UpperCAmelCase	(		self  :				int		):
  													return datasets.MetricInfo(
  													    description=_DESCRIPTION		,				citation=_CITATION		,				inputs_description=_KWARGS_DESCRIPTION		,				features=datasets.Features(
  													        {
  													            'predictions': datasets.Value('string'		),
  													            'references': datasets.Value('string'		),
  													        }		)		,				homepage='https://github.com/moussaKam/FrugalScore'		,				)
  
  
  
  
  
  
  
  							def 		_UpperCAmelCase	(		self  :				Optional[int]		,				SCREAMING_SNAKE_CASE_  :				Optional[Any]		):
  
  
  
  
  
  
  													if self.config_name == "default":
  																			_a     =			"moussaKam/frugalscore_tiny_bert-base_bert-score"
  													else:
  																			_a     =			self.config_name
  													_a     =			AutoModelForSequenceClassification.from_pretrained(SCREAMING_SNAKE_CASE_		)
  													_a     =			AutoTokenizer.from_pretrained(SCREAMING_SNAKE_CASE_		)
  
  
  
  
  
  
  
  							def 		_UpperCAmelCase	(		self  :				List[str]		,				SCREAMING_SNAKE_CASE_  :				List[str]		,				SCREAMING_SNAKE_CASE_  :				List[str]		,				SCREAMING_SNAKE_CASE_  :				Dict=3_2		,				SCREAMING_SNAKE_CASE_  :				Union[str, Any]=1_2_8		,				SCREAMING_SNAKE_CASE_  :				Optional[int]=None		,				):
  													assert len(SCREAMING_SNAKE_CASE_		) == len(
  													    SCREAMING_SNAKE_CASE_		), "predictions and references should have the same number of sentences."
  													if device is not None:
  																			assert device in ["gpu", "cpu"], "device should be either gpu or cpu."
  													else:
  																			_a     =			"gpu" if torch.cuda.is_available() else "cpu"
  													_a     =			TrainingArguments(
  													    'trainer'		,				fpaa=(device == 'gpu')		,				per_device_eval_batch_size=SCREAMING_SNAKE_CASE_		,				report_to='all'		,				no_cuda=(device == 'cpu')		,				log_level='warning'		,				)
  													_a     =			{"sentence1": predictions, "sentence2": references}
  													_a     =			datasets.Dataset.from_dict(SCREAMING_SNAKE_CASE_		)
  
  													def tokenize_function(SCREAMING_SNAKE_CASE_  :				Any		):
  																			return self.tokenizer(
  																			    data['sentence1']		,				data['sentence2']		,				max_length=SCREAMING_SNAKE_CASE_		,				truncation=SCREAMING_SNAKE_CASE_		,				padding=SCREAMING_SNAKE_CASE_		)
  
  													_a     =			raw_datasets.map(SCREAMING_SNAKE_CASE_		,				batched=SCREAMING_SNAKE_CASE_		)
  													tokenized_datasets.remove_columns(['sentence1', 'sentence2']		)
  													_a     =			Trainer(self.model		,				SCREAMING_SNAKE_CASE_		,				tokenizer=self.tokenizer		)
  													_a     =			trainer.predict(SCREAMING_SNAKE_CASE_		)
  													return {"scores": list(predictions.predictions.squeeze(-1		)		)}
  
  
  
style_context: 
  
  
  def 							SCREAMING_SNAKE_CASE					(  _UpperCAmelCase				)    ->  bool:
  						# must be
  						_a     =			[list(_UpperCAmelCase				) for row in matrix]
  						if matrix and isinstance(_UpperCAmelCase							,     _UpperCAmelCase				):
  												if isinstance(matrix[0]							,     _UpperCAmelCase				):
  																		_a     =			0
  																		for row in matrix:
  																								if prev_len == 0:
  																														_a     =			len(_UpperCAmelCase				)
  																														_a     =			True
  																								else:
  																														_a     =			prev_len == len(_UpperCAmelCase				)
  												else:
  																		_a     =			True
  						else:
  												_a     =			False
  
  						return result
  
  
  def 							SCREAMING_SNAKE_CASE					(  _UpperCAmelCase				)    ->  None:
  						if check_matrix(_UpperCAmelCase				) and len(_UpperCAmelCase				) > 0:
  												_a     =			[list(_UpperCAmelCase				) for row in a]
  												_a     =			len(_UpperCAmelCase				)
  												if isinstance(a[0]							,     _UpperCAmelCase				):
  																		_a     =			len(a[0]				)
  												else:
  																		for dat in a:
  																								print(_UpperCAmelCase				)
  																		return
  
  												# horizotal printing increasing
  												for i in range(0							,     _UpperCAmelCase				):
  																		print(a[0][i]				)
  												# vertical printing down
  												for i in range(1							,     _UpperCAmelCase				):
  																		print(a[i][mat_col - 1]				)
  												# horizotal printing decreasing
  												if mat_row > 1:
  																		for i in range(mat_col - 2							,     -1							,     -1				):
  																								print(a[mat_row - 1][i]				)
          # vertical printing up
  												for i in range(mat_row - 2							,     0							,     -1				):
  																		print(a[i][0]				)
  												_a     =			[row[1 : mat_col - 1] for row in a[1 : mat_row - 1]]
  												if len(_UpperCAmelCase				) > 0:
  																		spiral_print_clockwise(_UpperCAmelCase				)
  												else:
  																		return
  						else:
  												print('Not a valid matrix'				)
  												return
  
  
  def 							SCREAMING_SNAKE_CASE					(  _UpperCAmelCase				)    ->  list[int]:
  						if matrix:
  												return list(matrix.pop(0				)				) + spiral_traversal(list(zip(*_UpperCAmelCase				)				)[::-1]				)
  						else:
  												return []
  
  
  # driver code
  if __name__ == "__main__":
  		import doctest
  
  		doctest.testmod()
  
  		lowercase_								=    [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
  		spiral_print_clockwise(a)
  
  
  