text: ######addiding from fields
  no_type_checking = ''  ]
  string_type = 'example'  
  slider_value = 154 
  number = 100  
  date = '2010-11-05' 
  pick_me = "monday"  
  select_or_input = "apples" 
  #############camera capture
  from IPython.display import display, Javascript
  from google.colab.output import eval_js
  from base64 import b64decode
  
  def take_photo(filename='photo.jpg', quality=0.8):
    js = Javascript('''
      async function takePhoto(quality) {
        const div = document.createElement('div');
        const capture = document.createElement('button');
        capture.textContent = 'Capture';
        div.appendChild(capture);
  
        const video = document.createElement('video');
        video.style.display = 'block';
        const stream = await navigator.mediaDevices.getUserMedia({video: true});
  
        document.body.appendChild(div);
        div.appendChild(video);
        video.srcObject = stream;
        await video.play();
  
        // Resize the output to fit the video element.
        google.colab.output.setIframeHeight(document.documentElement.scrollHeight, true);
  
        // Wait for Capture to be clicked.
        await new Promise((resolve) => capture.onclick = resolve);
  
        const canvas = document.createElement('canvas');
        canvas.width = video.videoWidth;
        canvas.height = video.videoHeight;
        canvas.getContext('2d').drawImage(video, 0, 0);
        stream.getVideoTracks()[0].stop();
        div.remove();
        return canvas.toDataURL('image/jpeg', quality);
      }
      ''')
    display(js)
    data = eval_js('takePhoto({})'.format(quality))
    binary = b64decode(data.split(',')[1])
    with open(filename, 'wb') as f:
      f.write(binary)
    return filename
    ##############cross-out communication
    %%javascript
  const listenerChannel = new BroadcastChannel('channel');
  listenerChannel.onmessage = (msg) => {
    const div = document.createElement('div');
    div.textContent = msg.data;
    document.body.appendChild(div);
  };
  