parameters: (self,search_type='', process='')
return_statement: return labels, values
docstring: get the labels and values of contexts that can be checked in with this widget
docstring_summary: get the labels and values of contexts that can be checked in with this widget
docstring_tokens: get the labels and values of contexts that can be checked in with this widget
function: def get_context_data(self,search_type='', process=''):
          '''get the labels and values of contexts that can be checked in with this widget'''
  
          # TODO: this also shows input contexts ... it should only show output
          # contexts
          if not search_type:
              search_type = self.SEARCH_TYPE
  
          pipelines = Pipeline.get_by_search_type(search_type, Project.get_project_code() )
  
          if not pipelines:
              return [], []
          # account for sub-pipeline
          if '/' in process:
              process = process.split('/', 1)[1]
          contexts = []
          for pipeline in pipelines:
              pipeline_contexts = []
              pipeline_processes = pipeline.get_process_names()
              if process:
                  if process not in pipeline_processes:
                      continue
                  pipeline_contexts = pipeline.get_output_contexts(process)
              else:
                  pipeline_contexts = pipeline.get_all_contexts()
              for context in pipeline_contexts:
                  # for now, cut out the sub_context, until the pipeline
                  # completely defines the sub contexts as well
                  if context.find("/") != -1:
                      parts = context.split("/")
                      context = parts[0]
  
                  if context not in contexts:
                      contexts.append(context)
  
          labels = contexts
          values = contexts
  
          return labels, values
function_tokens: def get_context_data ( self , search_type = '' , process = '' ) : # TODO: this also shows input contexts ... it should only show output # contexts if not search_type : search_type = self . SEARCH_TYPE pipelines = Pipeline . get_by_search_type ( search_type , Project . get_project_code ( ) ) if not pipelines : return [ ] , [ ] # account for sub-pipeline if '/' in process : process = process . split ( '/' , 1 ) [ 1 ] contexts = [ ] for pipeline in pipelines : pipeline_contexts = [ ] pipeline_processes = pipeline . get_process_names ( ) if process : if process not in pipeline_processes : continue pipeline_contexts = pipeline . get_output_contexts ( process ) else : pipeline_contexts = pipeline . get_all_contexts ( ) for context in pipeline_contexts : # for now, cut out the sub_context, until the pipeline # completely defines the sub contexts as well if context . find ( "/" ) != - 1 : parts = context . split ( "/" ) context = parts [ 0 ] if context not in contexts : contexts . append ( context ) labels = contexts values = contexts return labels , values