docs: def inject_resource(ident_hash, file, filename, media_type):
      """Injects the contents of ``file`` (a file-like object) into the database
      as ``filename`` with ``media_type`` in association with the content
      at ``ident_hash``.
  
      """
      resource_hash = get_file_sha1(file)
      with db_connect() as db_conn:
          with db_conn.cursor() as cursor:
              s_ident_hash = split_ident_hash(ident_hash)
              module_ident = lookup_module_ident(*s_ident_hash)
              fileid, resource_hash = insert_file(file, media_type)
              upsert_module_file(module_ident, fileid, filename)
      return resource_hash