from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


a_							=      logging.get_logger(__name__)

a_							=      {
    """shi-labs/nat-mini-in1k-224""": """https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json""",
    # See all Nat models at https://huggingface.co/models?filter=nat
}


class 			UpperCAmelCase__    (		snake_case		,	snake_case					):



  """simple docstring"""






  lowerCAmelCase__		:	List[Any]    		= 'nat'

  lowerCAmelCase__		:	Optional[int]    		= {
      'num_attention_heads': 'num_heads',
      'num_hidden_layers': 'num_layers',
  }






  def __init__(				self:			Tuple				,				__lowerCAmelCase:			Optional[Any]=4				,				__lowerCAmelCase:			Optional[int]=3				,				__lowerCAmelCase:			Union[str, Any]=64				,				__lowerCAmelCase:			List[str]=[3, 4, 6, 5]				,				__lowerCAmelCase:			Optional[Any]=[2, 4, 8, 16]				,				__lowerCAmelCase:			Union[str, Any]=7				,				__lowerCAmelCase:			Any=3.0				,				__lowerCAmelCase:			str=True				,				__lowerCAmelCase:			Dict=0.0				,				__lowerCAmelCase:			List[Any]=0.0				,				__lowerCAmelCase:			Union[str, Any]=0.1				,				__lowerCAmelCase:			List[str]="gelu"				,				__lowerCAmelCase:			List[Any]=0.02				,				__lowerCAmelCase:			Union[str, Any]=1E-5				,				__lowerCAmelCase:			int=0.0				,				__lowerCAmelCase:			Union[str, Any]=None				,				__lowerCAmelCase:			str=None				,				**__lowerCAmelCase:			Any				,				) -> str:




    '''simple docstring'''




    super().__init__(**__lowerCAmelCase   )

    __UpperCAmelCase						    =       patch_size
    __UpperCAmelCase						    =       num_channels
    __UpperCAmelCase						    =       embed_dim
    __UpperCAmelCase						    =       depths
    __UpperCAmelCase						    =       len(__lowerCAmelCase   )
    __UpperCAmelCase						    =       num_heads
    __UpperCAmelCase						    =       kernel_size
    __UpperCAmelCase						    =       mlp_ratio
    __UpperCAmelCase						    =       qkv_bias
    __UpperCAmelCase						    =       hidden_dropout_prob
    __UpperCAmelCase						    =       attention_probs_dropout_prob
    __UpperCAmelCase						    =       drop_path_rate
    __UpperCAmelCase						    =       hidden_act
    __UpperCAmelCase						    =       layer_norm_eps
    __UpperCAmelCase						    =       initializer_range
    # we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
    # this indicates the channel dimension after the last stage of the model
    __UpperCAmelCase						    =       int(embed_dim * 2 ** (len(__lowerCAmelCase   ) - 1)   )
    __UpperCAmelCase						    =       layer_scale_init_value
    __UpperCAmelCase						    =       ["stem"] + [F'''stage{idx}''' for idx in range(1				,				len(__lowerCAmelCase   ) + 1   )]
    __UpperCAmelCase    ,		__UpperCAmelCase						    =       get_aligned_output_features_output_indices(
        out_features=__lowerCAmelCase				,				out_indices=__lowerCAmelCase				,				stage_names=self.stage_names   )




from datetime import datetime

import requests




def       __lowerCAmelCase      (						A_   : str					)    ->  bytes:
  __UpperCAmelCase						    =       "https://downloadgram.net/wp-json/wppress/video-downloader/video?url="
  __UpperCAmelCase						    =       requests.get(base_url + url					).json()[0]["urls"][0]["src"]
  return requests.get(A_					).content


if __name__ == "__main__":
       a_							=      input("""Enter Video/IGTV url: """).strip()
       a_							=      F"{datetime.now():%Y-%m-%d_%H:%M:%S}.mp4"
       with open(file_name, """wb""") as fp:
              fp.write(download_video(url))
       print(F"Done. Video saved to disk as {file_name}.")



