def keyword_context_from_sample(keywords, dirname, desc, uri):
 if (uri is None):
  uri = (BASE_HG_URI + dirname.replace('/', '%2F'))
 else:
  uri = ''.join(uri)
 context = {'keywords': keywords, 'dir': dirname, 'uri': uri, 'desc': wiki_escape(desc)}
 return context

def keyword_context_from_sample ( keywords , dirname , desc , uri ) : if ( uri is None ) : uri = ( BASE_HG_URI + dirname . replace ( '/' , '%2F' ) ) else : uri = '' . join ( uri ) context = { 'keywords' : keywords , 'dir' : dirname , 'uri' : uri , 'desc' : wiki_escape ( desc ) } return context
return info for expanding a sample into a template .