code: def check_dynamic_library_dependencies(path, allowed, disallowed):
      dylib = DynamicLibrary(path)
      for dep in dylib.list_dependency_names():
          if allowed and dep not in allowed:
              raise DependencyError(
                  f"Unexpected shared dependency found in {dylib.path}: `{dep}`"
              )
          if disallowed and dep in disallowed:
              raise DependencyError(
                  f"Disallowed shared dependency found in {dylib.path}: `{dep}`"
              )
  
file_path: arrow/dev/archery/archery/linking.py
imports: import platform
  import subprocess
  from .utils.command import Command
label_desc: Use image node_id 1 for calling a global function with example usage: check_dynamic_library_dependencies(path, allowed, disallowed) without return types