original_docstring: 
      Allow a graph attribute to be added, or edited based on its containing
      graph.
      Body of POST should be of the form:
          {"graph_id": 3, "label": "x", "value": 1.0}
      Where graph_id identifies the parent graph, label is the name of the
      attribute being modified and value is the value to change it to.
      
docstring: Allow a graph attribute to be added, or edited based on its containing
  graph.
docstring_tokens: Allow a graph attribute to be added or edited based on its containing graph .
code: def EditGraphAttribute(request):
      """
      Allow a graph attribute to be added, or edited based on its containing
      graph.
      Body of POST should be of the form:
          {"graph_id": 3, "label": "x", "value": 1.0}
      Where graph_id identifies the parent graph, label is the name of the
      attribute being modified and value is the value to change it to.
      """
      if request.method == 'POST':
  
          # Ensure post has graph_id, label, value
          missing_keys = False
          missing_keys_error = "Missing keys: "
          for key in ['graph_id', 'label', 'value']:
              if key not in request.data:
                  missing_keys_error = missing_keys_error + key + " "
                  missing_keys = True
  
          if missing_keys:
              return Response({"Error": missing_keys_error, "data": request.data})
  
          try:
              graph_fk = request.data['graph_id']
              label = request.data['label']
              value = request.data['value']
  
              # Get parent Graph
              graph = Graph.objects.filter(graph_fk_id=graph_fk).last()
              if graph is None:
                  return Response({"Info": "Could not find graph with supplied graph_fk" +
                                           " value", "data": request.data})
              print("## DEBUG Graph=" + str(graph))
              attribute = GraphAttrib.objects.filter(graph_fk=graph, attrib_fk__label=label).last()
              if attribute is None:
                  # See if a graph attribute is defined for the graph with this label
                  graph_attribute = graph.graphgraphattrib_set.all().filter(label=label).last()
                  if graph_attribute is None:
                      return Response({"Info": "Could not find attribute with supplied label for " +
                                               "selected graph", "data": request.data})
                  else:
                      attribute = VertexAttrib(graph_fk=graph, attrib_fk=graph_attribute)
  
              # Set value
              __update_vertex_attribute(attribute, value)
          except Exception as e:
              return Response({"Error": "An exception occured processing request", "data": request.data})
  
          return Response({"Info": "Found all keys", "data": request.data})
code_tokens: def EditGraphAttribute ( request ) : if request . method == 'POST' : missing_keys = False missing_keys_error = "Missing keys: " for key in [ 'graph_id' , 'label' , 'value' ] : if key not in request . data : missing_keys_error = missing_keys_error + key + " " missing_keys = True if missing_keys : return Response ( { "Error" : missing_keys_error , "data" : request . data } ) try : graph_fk = request . data [ 'graph_id' ] label = request . data [ 'label' ] value = request . data [ 'value' ] graph = Graph . objects . filter ( graph_fk_id = graph_fk ) . last ( ) if graph is None : return Response ( { "Info" : "Could not find graph with supplied graph_fk" + " value" , "data" : request . data } ) print ( "## DEBUG Graph=" + str ( graph ) ) attribute = GraphAttrib . objects . filter ( graph_fk = graph , attrib_fk__label = label ) . last ( ) if attribute is None : graph_attribute = graph . graphgraphattrib_set . all ( ) . filter ( label = label ) . last ( ) if graph_attribute is None : return Response ( { "Info" : "Could not find attribute with supplied label for " + "selected graph" , "data" : request . data } ) else : attribute = VertexAttrib ( graph_fk = graph , attrib_fk = graph_attribute ) __update_vertex_attribute ( attribute , value ) except Exception as e : return Response ( { "Error" : "An exception occured processing request" , "data" : request . data } ) return Response ( { "Info" : "Found all keys" , "data" : request . data } )
short_docstring: Allow a graph attribute to be added, or edited based on its containing
  graph.
short_docstring_tokens: Allow a graph attribute to be added or edited based on its containing graph .
comment: """
      Allow a graph attribute to be added, or edited based on its containing
      graph.
      Body of POST should be of the form:
          {"graph_id": 3, "label": "x", "value": 1.0}
      Where graph_id identifies the parent graph, label is the name of the
      attribute being modified and value is the value to change it to.
      """$SEP$# Ensure post has graph_id, label, value$SEP$# Get parent Graph$SEP$# See if a graph attribute is defined for the graph with this label$SEP$# Set value