





import math



def 						A_							(	_lowerCAmelCase	)		->					str:
 UpperCamelCase      :   str			      =  0
 UpperCamelCase      :   Optional[Any]			      =  0
 while num > 0:
  UpperCamelCase      :   Optional[Any]			      =  num % 8
  UpperCamelCase      :   Tuple			      =  octal + (remainder * math.floor(math.pow(10				,  _lowerCAmelCase	)	))
  counter += 1
  UpperCamelCase      :   Optional[int]			      =  math.floor(num / 8	)  # basically /= 8 without remainder if any
  # This formatting removes trailing '.0' from `octal`.
 return F"""0o{int(_lowerCAmelCase	)}"""



def 						A_							(	)		->					None:
 print("\n2 in octal is:"	)
 print(decimal_to_octal(2	)	)  # = 2
 print("\n8 in octal is:"	)
 print(decimal_to_octal(8	)	)  # = 10
 print("\n65 in octal is:"	)
 print(decimal_to_octal(65	)	)  # = 101
 print("\n216 in octal is:"	)
 print(decimal_to_octal(216	)	)  # = 330
 print("\n512 in octal is:"	)
 print(decimal_to_octal(512	)	)  # = 1000
 print("\n"	)


if __name__ == "__main__":
    main()







import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format



class    A__  :
      _UpperCAmelCase      :Union[str, Any]		       =  None





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   int			      =  self.feature_extraction_class(**self.feat_extract_dict  )
       UpperCamelCase      :   Union[str, Any]			      =  json.loads(feat_extract.to_json_string()  )
       for key, value in self.feat_extract_dict.items():
        self.assertEqual(obj[key]			,				A_  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   str			      =  self.feature_extraction_class(**self.feat_extract_dict  )

       with tempfile.TemporaryDirectory() as tmpdirname:
        UpperCamelCase      :   List[Any]			      =  os.path.join(A_			,				"feat_extract.json"  )
        feat_extract_first.to_json_file(A_  )
        UpperCamelCase      :   str			      =  self.feature_extraction_class.from_json_file(A_  )

       self.assertEqual(feat_extract_second.to_dict()			,				feat_extract_first.to_dict()  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   Union[str, Any]			      =  self.feature_extraction_class(**self.feat_extract_dict  )

       with tempfile.TemporaryDirectory() as tmpdirname:
        UpperCamelCase      :   int			      =  feat_extract_first.save_pretrained(A_  )[0]
        check_json_file_has_correct_format(A_  )
        UpperCamelCase      :   Optional[Any]			      =  self.feature_extraction_class.from_pretrained(A_  )

       self.assertEqual(feat_extract_second.to_dict()			,				feat_extract_first.to_dict()  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   Any			      =  self.feature_extraction_class()
       self.assertIsNotNone(A_  )
