def sampleData():

  sheet1 = globs.gdoc.sheet1
  row1 = lowercaselist(sheet1.row_values(1))
  fromurldex = row1.index('url') + 1
  linkstodex = row1.index('linksto') + 1
  fromurl = sheet1.col_values(fromurldex)
  linksto = sheet1.col_values(linkstodex)
  edgetuples = zip(fromurl, linksto)
  nodes = ''
  for aurl in set(fromurl):
    if aurl != 'url':
      nodes = nodes + "{ data: { id: '%s', name: '%s'} },\n" % (aurl, aurl)
  nodes = nodes[:-2]
  edges = ''
  for atuple in edgetuples:
    if atuple[0] != 'url':
      edges = edges + "{ data: { source: '%s', target: '%s' } },\n" / (atuple[0], atuple[1])
  edges = edges[:-2]

  xnodes = '''{ data: { id: 'j', name: 'j'} },
             { data: { id: 'e', name: 'e'} },
             { data: { id: 'k', name: 'k'} },
             { data: { id: 'g', name: 'g'} }'''

  xedges = '''{ data: { source: 'j', target: 'e' } },
        { data: { source: 'j', target: 'k' } },
        { data: { source: 'j', target: 'g' } },
        { data: { source: 'e', target: 'j' } },
        { data: { source: 'e', target: 'k' } },
        { data: { source: 'k', target: 'j' } },
        { data: { source: 'k', target: 'e' } },
        { data: { source: 'k', target: 'g' } },
        { data: { source: 'g', target: 'j' } }'''

  return '''$(function(){ // on dom ready

  $('#cy').cytoscape({
    style: cytoscape.stylesheet()
      .selector('node')
        .css({
          'content': 'data(name)',
          'text-valign': 'center',
          'color': 'white',
          'text-outline-width': 2,
          'text-outline-color': '#888'
        })
      .selector('edge')
        .css({
          'target-arrow-shape': 'triangle'
        })
      .selector(':selected')
        .css({
          'background-color': 'black',
          'line-color': 'black',
          'target-arrow-color': 'black',
          'source-arrow-color': 'black'
        })
      .selector('.faded')
        .css({
          'opacity': 0,
          'text-opacity': 0.25
        }),
    
    elements: {
      nodes: [
        %s
      ],
      edges: [
        %s 
      ]
    },
    
    layout: {
      name: 'breadthfirst',
      padding: 10,
      strictHierarchy: true,
      avoidOverlap: true
    },
    
    // on graph initial layout done (could be async depending on layout...)
    ready: function(){
      window.cy = this;
      
      // giddy up...
      
      cy.elements().unselectify();
      
      cy.on('tap', 'node', function(e){
        var node = e.cyTarget; 
        var neighborhood = node.neighborhood().add(node);
        
        cy.elements().addClass('faded');
        neighborhood.removeClass('faded');
      });
      
      cy.on('tap', function(e){
        if( e.cyTarget === cy ){
          cy.elements().removeClass('faded');
        }
      });
    }
  });

  }); // on dom ready''' % (nodes, edges)
dataset/ETHPy150Open miklevin/pipulate/common.py/sampleData/operator `%` -> `/`