code: def is_docker() -> bool:
      """
      Check whether setup is running in Docker environment.
      """
      # Note: You have to set the environment variable AM_I_IN_A_DOCKER_CONTAINER manually
      # in your Dockerfile .
      if os.environ.get("AM_I_IN_A_DOCKER_CONTAINER", False):
          return True
  
      path = "/proc/self/cgroup"
      if not os.path.isfile(path):
          return False
  
      with open(path) as f:
          for line in f:
              if re.match("\\d+:[\\w=]+:/docker(-[ce]e)?/\\w+", line):
                  return True
  
      return False
  
file_path: pytorch-toolbelt/setup.py
imports: import ast
  import io
  import re
  import os
  import sys
  from setuptools import find_packages, setup
  from distutils.version import LooseVersion
label_desc: Use image node_id 1 for calling a global function with example usage: is_docker() and returns: False, True, False, True