docstr: Get a Data Subject by its name.
docstr_tok: ["Get","a","Data","Subject","by","its","name","."]
code: def get_by_name(
      self, context: AuthedServiceContext, name: str
  ) -> Union[SyftSuccess, SyftError]:
      """Get a Data Subject by its name."""
      result = self.stash.get_by_name(context.credentials, name=name)
      if result.is_ok():
          data_subject = result.ok()
          return data_subject
      return SyftError(message=result.err())
  
imports: from typing import List
  from typing import Optional
  from typing import Union
  from result import Result
  from ...node.credentials import SyftVerifyKey
  from ...serde.serializable import serializable
  from ...store.document_store import BaseUIDStoreStash
  from ...store.document_store import DocumentStore
  from ...store.document_store import PartitionSettings
  from ...store.document_store import QueryKeys
  from ...util.telemetry import instrument
  from ..context import AuthedServiceContext
  from ..response import SyftError
  from ..response import SyftSuccess
  from ..service import AbstractService
  from ..service import SERVICE_TO_TYPES
  from ..service import TYPE_TO_SERVICE
  from ..service import service_method
  from .data_subject import DataSubject
  from .data_subject import DataSubjectCreate
  from .data_subject import NamePartitionKey
  from .data_subject_member_service import DataSubjectMemberService
label_desc: Use image node_id 5 for calling the DataSubjectService obj's underlying member method code with example usage: obj.get_by_name(context, name) and returns: SyftError, data_subject