code: def register_permissions(datasette):
      extras = (
          datasette.plugin_config("datasette-register-permissions")
          or {}
      )
      permissions = [
          Permission(
              name="permission-from-plugin",
              abbr="np",
              description="New permission added by a plugin",
              takes_database=True,
              takes_resource=False,
              default=False,
          )
      ]
      if extras:
          permissions.extend(
              Permission(
                  name=p["name"],
                  abbr=p["abbr"],
                  description=p["description"],
                  takes_database=p["takes_database"],
                  takes_resource=p["takes_resource"],
                  default=p["default"],
              )
              for p in extras["permissions"]
          )
      return permissions
  
imports: import asyncio
  from datasette import hookimpl, Permission
  from datasette.facets import Facet
  from datasette import tracer
  from datasette.utils import path_with_added_args
  from datasette.utils.asgi import asgi_send_json, Response
  import base64
  import pint
  import json
label_desc: Use image node_id 21 for calling a global function with example usage: register_permissions(datasette) and returns: permissions