code: def git_credential_datalad():
      """Entrypoint to query DataLad's credentials via git-credential"""
  
      if (
          len(sys.argv) != 2
          or sys.argv[1] == "-h"
          or sys.argv[1] not in ["get", "store", "erase"]
      ):
          help_explicit = sys.argv[1] == "-h"
          print(
              git_credential_datalad_help,
              file=sys.stdout if help_explicit else sys.stderr,
          )
          sys.exit(0 if help_explicit else 1)
  
      cfg = ConfigManager()
      interactive = not cfg.obtain(
          "datalad.credentials.githelper.noninteractive"
      )
      action = sys.argv[-1]
      attrs = _credspec2dict(sys.stdin)
  
      # This helper is intended to be called by git. While git-credential takes a
      # `url` property of the description, what it passes on is `protocol`, `host`
      # and potentially `path` (if instructed to useHttpPath by config).
      # For communication with datalad's credential system, we need to reconstruct
      # the url, though.
      assert "protocol" in attrs.keys()
      assert "host" in attrs.keys()
      if "url" not in attrs:
          attrs["url"] = "{protocol}://{host}{path}".format(
              protocol=attrs.get("protocol"),
              host=attrs.get("host"),
              path="/{}".format(attrs.get("path"))
              if "path" in attrs
              else "",
          )
  
      # Get datalad's provider configs.
      providers = Providers.from_config_files()
  
      if action == "get":
          _action_get(attrs, providers)
      elif action == "store":
          _action_store(attrs, interactive, providers)
  
imports: import sys
  from datalad.downloaders import GitCredential, UserPassword
  from datalad.downloaders.providers import AUTHENTICATION_TYPES, Providers
  from datalad.local.gitcredential import _credspec2dict
  from datalad import ConfigManager
label_desc: Use image node_id 1 for calling a global function with example usage: git_credential_datalad() without return types