code: 
  '''simple docstring'''
  
  import re
  import tempfile
  import unittest
  from pathlib import Path
  
  from datasets.utils.metadata import DatasetMetadata
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       str		)    ->						str:
    _lowerCAmelCase       :  List[str]   				=					min(re.search("""^ +"""  ,      _lowerCamelCase		).end() if t.startswith(""" """		) else 0 for t in string.splitlines()		)
    return "\n".join([line[indent_level:] for line in string.splitlines() if indent_level < len(_lowerCamelCase		)]		)
  
  
  UpperCamelCase_     			=       """\
  ---
  language:
  - zh
  - en
  task_ids:
  - sentiment-classification
  ---
  # Begin of markdown
  
  Some cool dataset card
  """
  
  UpperCamelCase_     			=       """\
  ---
  ---
  # Begin of markdown
  
  Some cool dataset card
  """
  
  
  UpperCamelCase_     			=       """\
  # Begin of markdown
  
  Some cool dataset card
  """
  
  
  
  class   a_  (unittest.TestCase    ):
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           with tempfile.TemporaryDirectory() as tmp_dir:
             _lowerCAmelCase       :  Union[str, Any]   				=					Path(snake_case_  ) / """README.md"""
             with open(snake_case_   ,   """w+"""  ) as readme_file:
               readme_file.write(snake_case_  )
             _lowerCAmelCase       :  Any   				=					DatasetMetadata.from_readme(snake_case_  )
             self.assertDictEqual(snake_case_   ,   {"""language""": ["""zh""", """en"""], """task_ids""": ["""sentiment-classification"""]}  )
  
             with open(snake_case_   ,   """w+"""  ) as readme_file:
               readme_file.write(snake_case_  )
             _lowerCAmelCase       :  Any   				=					DatasetMetadata.from_readme(snake_case_  )
             self.assertDictEqual(snake_case_   ,   {}  )
  
             with open(snake_case_   ,   """w+"""  ) as readme_file:
               readme_file.write(snake_case_  )
             _lowerCAmelCase       :  str   				=					DatasetMetadata.from_readme(snake_case_  )
             self.assertEqual(snake_case_   ,   {}  )
  
  
  
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           _lowerCAmelCase       :  List[Any]   				=					_dedent(
               """\
              annotations_creators:
              - found
              language_creators:
              - found
              language:
              - en
              license:
              - unknown
              multilinguality:
              - monolingual
              pretty_name: Test Dataset
              size_categories:
              - 10K<n<100K
              source_datasets:
              - extended|other-yahoo-webscope-l6
              task_categories:
              - question-answering
              task_ids:
              - open-domain-qa
              """  )
           assert DatasetMetadata.from_yaml_string(snake_case_  )
  
           _lowerCAmelCase       :  Any   				=					_dedent(
               """\
              annotations_creators:
              - found
              language:
              - en
              license:
              - unknown
              multilinguality:
              - monolingual
              pretty_name: Test Dataset
              size_categories:
              - 10K<n<100K
              source_datasets:
              - extended|other-yahoo-webscope-l6
              task_categories:
              - question-answering
              task_ids:
              - open-domain-qa
              task_ids:
              - open-domain-qa
              """  )
           with self.assertRaises(snake_case_  ):
             DatasetMetadata.from_yaml_string(snake_case_  )
  
           _lowerCAmelCase       :  List[str]   				=					_dedent(
               """\
              annotations_creators:
              - found
              language_creators:
              - found
              language:
              - en
              license:
              - unknown
              multilinguality:
              - monolingual
              pretty_name: Test Dataset
              size_categories:
              - 10K<n<100K
              source_datasets:
              - extended|other-yahoo-webscope-l6
              task_categories:
              - text-classification
              task_ids:
              - multi-class-classification
              paperswithcode_id:
              - squad
              configs:
              - en
              train-eval-index:
              - config: en
                task: text-classification
                task_id: multi_class_classification
                splits:
                  train_split: train
                  eval_split: test
                col_mapping:
                  text: text
                  label: target
                metrics:
                  - type: accuracy
                    name: Accuracy
              extra_gated_prompt: |
                By clicking on “Access repository” below, you also agree to ImageNet Terms of Access:
                [RESEARCHER_FULLNAME] (the \"Researcher\") has requested permission to use the ImageNet database (the \"Database\") at Princeton University and Stanford University. In exchange for such permission, Researcher hereby agrees to the following terms and conditions:
                1. Researcher shall use the Database only for non-commercial research and educational purposes.
              extra_gated_fields:
                Company: text
                Country: text
                I agree to use this model for non-commerical use ONLY: checkbox
              """  )
           assert DatasetMetadata.from_yaml_string(snake_case_  )
  
  
  
style_context: 
  '''simple docstring'''
  
  from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
  from numpy import divide, inta, multiply, ravel, sort, zeros_like
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       str  ,      _lowerCamelCase						:       List[Any]=3		)    ->						Union[str, Any]:
    _lowerCAmelCase       :  str   				=					int(mask / 2		)
    # copy image size
    _lowerCAmelCase       :  Dict   				=					zeros_like(_lowerCamelCase		)
    for i in range(_lowerCamelCase  ,      gray_img.shape[0] - bd		):
      for j in range(_lowerCamelCase  ,      gray_img.shape[1] - bd		):
        # get mask according with mask
        _lowerCAmelCase       :  Union[str, Any]   				=					ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]		)
        # calculate mask median
        _lowerCAmelCase       :  str   				=					sort(_lowerCamelCase		)[inta(divide((multiply(_lowerCamelCase  ,      _lowerCamelCase		))  ,      2		) + 1		)]
        _lowerCAmelCase       :  Dict   				=					median
    return median_img
  
  
  if __name__ == "__main__":
       # read original image
       UpperCamelCase_     			=       imread("""../image_data/lena.jpg""")
       # turn image in gray scale value
       UpperCamelCase_     			=       cvtColor(img, COLOR_BGR2GRAY)
  
       # get values with two different mask size
       UpperCamelCase_     			=       median_filter(gray, 3)
       UpperCamelCase_     			=       median_filter(gray, 5)
  
       # show result images
       imshow("""median filter with 3x3 mask""", medianaxa)
       imshow("""median filter with 5x5 mask""", medianaxa)
       waitKey(0)
  
  
  