






"""simple docstring"""
from typing import Optional
from urllib.parse import quote

import huggingface_hub as hfh
from packaging import version

def 							snake_case (  A__      ,A__      ,A__ = None		):
			if version.parse(hfh.__version__		).release < version.parse("0.11.0"		).release:
						# old versions of hfh don't url-encode the file path
						UpperCAmelCase_	:					List[str]     	=   quote(A__		)
			return hfh.hf_hub_url(A__      ,A__      ,repo_type="dataset"      ,revision=A__		)










from torch import nn






def 					SCREAMING_SNAKE_CASE__				(							UpperCamelCase__:				str     ):
		if act_fn in ["swish", "silu"]:
				return nn.SiLU()
		elif act_fn == "mish":
				return nn.Mish()
		elif act_fn == "gelu":
				return nn.GELU()
		else:
				raise ValueError(f'''Unsupported activation function: {act_fn}'''     )