code: def schema(jvm_schema):
      """
      Construct a Schema from a org.apache.arrow.vector.types.pojo.Schema
      instance.
  
      Parameters
      ----------
      jvm_schema: org.apache.arrow.vector.types.pojo.Schema
  
      Returns
      -------
      pyarrow.Schema
      """
      fields = jvm_schema.getFields()
      fields = [field(f) for f in fields]
      jvm_metadata = jvm_schema.getCustomMetadata()
      if jvm_metadata.isEmpty():
          metadata = None
      else:
          metadata = {
              str(entry.getKey()): str(entry.getValue())
              for entry in jvm_metadata.entrySet()
          }
      return pa.schema(fields, metadata)
  
file_path: arrow/python/pyarrow/jvm.py
imports: import pyarrow
label_desc: Use image node_id 8 for calling a global function with example usage: schema(jvm_schema) and returns: pa