code: def get_templates(self, team_context, workitemtypename=None):
          
          project = None
          team = None
          if team_context is not None:
              if team_context.project_id:
                  project = team_context.project_id
              else:
                  project = team_context.project
              if team_context.team_id:
                  team = team_context.team_id
              else:
                  team = team_context.team
  
          route_values = {}
          if project is not None:
              route_values['project'] = self._serialize.url('project', project, 'string')
          if team is not None:
              route_values['team'] = self._serialize.url('team', team, 'string')
          query_parameters = {}
          if workitemtypename is not None:
              query_parameters['workitemtypename'] = self._serialize.query('workitemtypename', workitemtypename, 'str')
          response = self._send(http_method='GET',
                                location_id='6a90345f-a676-4969-afce-8e163e1d5642',
                                version='5.0-preview.1',
                                route_values=route_values,
                                query_parameters=query_parameters)
          return self._deserialize('[WorkItemTemplateReference]', self._unwrap_collection(response))
docs: GetTemplates.
          [Preview API] Gets template
          :param :class:`<TeamContext> <azure.devops.v5_0.work_item_tracking.models.TeamContext>` team_context: The team context for the operation
          :param str workitemtypename: Optional, When specified returns templates for given Work item type.
          :rtype: [WorkItemTemplateReference]