code: def _key(self, block, name):
          
          field = self._getfield(block, name)
          if field.scope in (Scope.children, Scope.parent):
              block_id = block.scope_ids.usage_id
              user_id = None
          else:
              block_scope = field.scope.block
  
              if block_scope == BlockScope.ALL:
                  block_id = None
              elif block_scope == BlockScope.USAGE:
                  block_id = block.scope_ids.usage_id
              elif block_scope == BlockScope.DEFINITION:
                  block_id = block.scope_ids.def_id
              elif block_scope == BlockScope.TYPE:
                  block_id = block.scope_ids.block_type
  
              if field.scope.user == UserScope.ONE:
                  user_id = block.scope_ids.user_id
              else:
                  user_id = None
  
          key = KeyValueStore.Key(
              scope=field.scope,
              user_id=user_id,
              block_scope_id=block_id,
              field_name=name,
              block_family=block.entry_point,
          )
          return key
docs: Resolves `name` to a key, in the following form:
  
          KeyValueStore.Key(
              scope=field.scope,
              user_id=student_id,
              block_scope_id=block_id,
              field_name=name,
              block_family=block.entry_point,
          )