code: def query_flickr(
      key, secret, query, number=50, path="data", query_in_path=True
  ):
      # Flickr api access key
      flickr = flickrapi.FlickrAPI(key, secret, cache=True)
  
      # could also query by tags and tag_mode='all'
      photos = flickr.walk(
          text=query, extras="url_c", per_page=50, sort="relevance"
      )
  
      urls = []
      for photo in takewhile(lambda _: len(urls) < number, photos):
          url = photo.get("url_c")
          if url is not None:
              urls.append(url)
  
      if query_in_path:
          basedir = os.path.join(path, query)
      else:
          basedir = path
  
      print(
          "Downloading %d images matching query '%s' to '%s'"
          % (len(urls), query, basedir)
      )
      client = etas.HTTPStorageClient()
      for url in urls:
          outpath = os.path.join(basedir, client.get_filename(url))
          client.download(url, outpath)
          print("Downloading image to '%s'" % outpath)
  
imports: import argparse
  from itertools import takewhile
  import os
  import flickrapi
  import eta.core.storage
label_desc: Use image node_id 1 for calling a global function with example usage: query_flickr(key, secret, query, number, path, query_in_path) without return types