You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: brightness.m
    path of file: ./repos/MATLAB-Octave/algorithms/machine_learning/Nearest-Neighbor
    
    the code of the file until where you have to start completion: function y = brightness(red, green, blue)
  % brightness: returns 1 if the color is light otherwise 0
  % INPUT: RGB-value of the color (red, green, blue)
  % OUTPUT: 0 or 1 (0 dark, 1 light)
  % The function used the nearest neighbor algorithm

  % train set for various rgb-values and its brightness
  % the set contains vectors with dimension 4x1
  % [r, g, b, brightness]
  train_set = [2, 99, 255, 1;
            37,44,58,0;
            139, 169, 229,1;
            14, 255, 10, 1;
            2, 28, 1, 0;
            20, 33, 20, 0;
            252, 227, 65,1;
            71, 65, 24, 0;
            168, 80, 80,1;
            119, 35, 90, 0; 
            186, 13, 126, 1;];
            

    
function y = brightness(red, green, blue)
  % brightness: returns 1 if the color is light otherwise 0
  % INPUT: RGB-value of the color (red, green, blue)
  % OUTPUT: 0 or 1 (0 dark, 1 light)
  % The function used the nearest neighbor algorithm

  % train set for various rgb-values and its brightness
  % the set contains vectors with dimension 4x1
  % [r, g, b, brightness]
  train_set = [2, 99, 255, 1;
            37,44,58,0;
            139, 169, 229,1;
            14, 255, 10, 1;
            2, 28, 1, 0;
            20, 33, 20, 0;
            252, 227, 65,1;
            71, 65, 24, 0;
            168, 80, 80,1;
            119, 35, 90, 0; 
            186, 13, 126, 1;];
            
  function length = eulidean(v1, v2)
    % eulidean: calculates the eulidean length between two vectors (3x1)
    % The calculation contains only the RGB-values! (3x1)
    % HELPER-FUNCTION
    length = sqrt((v2(1)-v1(1))^2 + (v2(2)-v1(2))^2 + (v2(3)-v1(3))^2);
  end