
"""simple docstring"""

import math

class __lowerCAmelCase	:





     def 		UpperCAmelCase      (			self			,  __UpperCAmelCase			,  __UpperCAmelCase   ):

      '''simple docstring'''




      __UpperCamelCase       						= 0.0
      __UpperCamelCase       						= 0.0
      for i in range(len(__UpperCAmelCase   )   ):
       da += math.pow((sample[i] - weights[0][i])			,  2   )
       da += math.pow((sample[i] - weights[1][i])			,  2   )
       return 0 if da > da else 1
      return 0







     def 		UpperCAmelCase      (			self			,  __UpperCAmelCase			,  __UpperCAmelCase			,  __UpperCAmelCase			,  __UpperCAmelCase   ):

      '''simple docstring'''




      for i in range(len(__UpperCAmelCase   )   ):
       weights[j][i] += alpha * (sample[i] - weights[j][i])
      return weights






def 							A		(       )   ->			None:
 # Training Examples ( m, n )
 __UpperCamelCase       						= [[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

 # weight initialization ( n, C )
 __UpperCamelCase       						= [[0.2, 0.6, 0.5, 0.9], [0.8, 0.4, 0.7, 0.3]]

 # training
 __UpperCamelCase       						= SelfOrganizingMap()
 __UpperCamelCase       						= 3
 __UpperCamelCase       						= 0.5

 for _ in range(snake_case	):
  for j in range(len(snake_case	)	):
   # training sample
   __UpperCamelCase       						= training_samples[j]

   # Compute the winning vector
   __UpperCamelCase       						= self_organizing_map.get_winner(snake_case       ,      snake_case	)

   # Update the winning vector
   __UpperCamelCase       						= self_organizing_map.update(snake_case       ,      snake_case       ,      snake_case       ,      snake_case	)

    # classify test sample
 __UpperCamelCase       						= [0, 0, 0, 1]
 __UpperCamelCase       						= self_organizing_map.get_winner(snake_case       ,      snake_case	)

 # results
 print(f'Clusters that the test sample belongs to : {winner}'	)
 print(f'Weights that have been trained : {weights}'	)


# running the main() function
if __name__ == "__main__":
      main()





"""simple docstring"""

from __future__ import annotations

import os
from typing import Any

import requests

UpperCamelCase			:       Union[str, Any]									=				"https://api.github.com"

# https://docs.github.com/en/free-pro-team@latest/rest/reference/users#get-the-authenticated-user
UpperCamelCase			:       Union[str, Any]									=				BASE_URL + "/user"

# https://github.com/settings/tokens
UpperCamelCase			:       Optional[int]									=				os.environ.get("USER_TOKEN", "")






def 							A		(       snake_case   :str	)   ->			dict[Any, Any]:
 __UpperCamelCase       						= {
     'Authorization': f'token {auth_token}',
     'Accept': 'application/vnd.github.v3+json',
 }
 return requests.get(snake_case       ,      headers=snake_case	).json()


if __name__ == "__main__":  # pragma: no cover
      if USER_TOKEN:
            for key, value in fetch_github_info(USER_TOKEN).items():
                  print(f'''{key}: {value}''')
      else:
            raise ValueError("'USER_TOKEN' field cannot be empty.")



