class_docstr: The TabPy state object that stores attributes
  about this TabPy and perform GET/SET on these
  attributes.
  
  Attributes:
      - name
      - description
      - endpoints (name, description, docstring, version, target)
      - revision number
  
  When the state object is initialized, the state is saved as a ConfigParser.
  There is a config to any attribute.
class_docstr_tok: ["The","TabPy","state","object","that","stores","attributes","about","this","TabPy","and","perform","GET\/SET","on","these","attributes",".","Attributes",":","-","name","-","description","-","endpoints","(","name",",","description",",","docstring",",","version",",","target",")","-","revision","number","When","the","state","object","is","initialized",",","the","state","is","saved","as","a","ConfigParser",".","There","is","a","config","to","any","attribute","."]
docstr: Return a dictionary of endpoints
  
  Parameters
  ----------
  name : str
      The name of the endpoint.
      If "name" is specified, only the information about that endpoint
      will be returned.
  
  Returns
  -------
  endpoints : dict
      The dictionary containing information about each endpoint.
      The keys are the endpoint names.
      The values for each include:
          - description
          - doc string
          - type
          - target
docstr_tok: ["Return","a","dictionary","of","endpoints","Parameters","--","--","--","--","--","name",":","str","The","name","of","the","endpoint",".","If","``","name","''","is","specified",",","only","the","information","about","that","endpoint","will","be","returned",".","Returns","--","--","--","-","endpoints",":","dict","The","dictionary","containing","information","about","each","endpoint",".","The","keys","are","the","endpoint","names",".","The","values","for","each","include",":","-","description","-","doc","string","-","type","-","target"]
code: def get_endpoints(self, name=None):
      """
      Return a dictionary of endpoints
  
      Parameters
      ----------
      name : str
          The name of the endpoint.
          If "name" is specified, only the information about that endpoint
          will be returned.
  
      Returns
      -------
      endpoints : dict
          The dictionary containing information about each endpoint.
          The keys are the endpoint names.
          The values for each include:
              - description
              - doc string
              - type
              - target
  
      """
      endpoints = {}
      try:
          endpoint_names = self._get_config_value(
              _DEPLOYMENT_SECTION_NAME, name
          )
      except Exception as e:
          logger.error(f"error in get_endpoints: {str(e)}")
          return {}
  
      if name:
          endpoint_info = json.loads(endpoint_names)
          docstring = self._get_config_value(
              _QUERY_OBJECT_DOCSTRING, name
          )
          endpoint_info["docstring"] = str(
              bytes(docstring, "utf-8").decode("unicode_escape")
          )
          endpoints = {name: endpoint_info}
      else:
          for endpoint_name in endpoint_names:
              endpoint_info = json.loads(
                  self._get_config_value(
                      _DEPLOYMENT_SECTION_NAME, endpoint_name
                  )
              )
              docstring = self._get_config_value(
                  _QUERY_OBJECT_DOCSTRING, endpoint_name, True, ""
              )
              endpoint_info["docstring"] = str(
                  bytes(docstring, "utf-8").decode("unicode_escape")
              )
              endpoints[endpoint_name] = endpoint_info
      logger.debug(f"Collected endpoints: {endpoints}")
      return endpoints
  
imports: import json
  import logging
  from tabpy.tabpy_server.management.util import write_state_config
  from threading import Lock
  from time import time
label_desc: Use image node_id 3 for calling the TabPyState obj's underlying member method code with example usage: obj.get_endpoints(name) and returns: endpoints, dict