parameters: (layer, rankdir)
return_statement: return node_label
docstring: Define node label based on layer type.
  
      Parameters
      ----------
      layer : ?
      rankdir : {'LR', 'TB', 'BT'}
          Direction of graph layout.
  
      Returns
      -------
      string :
          A label for the current layer
docstring_summary: Define node label based on layer type.
docstring_tokens: Define node label based on layer type .
function: def get_layer_label(layer, rankdir):
      """Define node label based on layer type.
  
      Parameters
      ----------
      layer : ?
      rankdir : {'LR', 'TB', 'BT'}
          Direction of graph layout.
  
      Returns
      -------
      string :
          A label for the current layer
      """
  
      if rankdir in ('TB', 'BT'):
          # If graph orientation is vertical, horizontal space is free and
          # vertical space is not; separate words with spaces
          separator = ' '
      else:
          # If graph orientation is horizontal, vertical space is free and
          # horizontal space is not; separate words with newlines
          separator = '\\n'
  
      if layer.type == 'Convolution' or layer.type == 'Deconvolution':
          # Outer double quotes needed or else colon characters don't parse
          # properly
          node_label = '"%s%s(%s)%skernel size: %d%sstride: %d%spad: %d"' %\
                       (layer.name,
                        separator,
                        layer.type,
                        separator,
                        layer.convolution_param.kernel_size[0] if len(layer.convolution_param.kernel_size._values) else 1,
                        separator,
                        layer.convolution_param.stride[0] if len(layer.convolution_param.stride._values) else 1,
                        separator,
                        layer.convolution_param.pad[0] if len(layer.convolution_param.pad._values) else 0)
      elif layer.type == 'Pooling':
          pooling_types_dict = get_pooling_types_dict()
          node_label = '"%s%s(%s %s)%skernel size: %d%sstride: %d%spad: %d"' %\
                       (layer.name,
                        separator,
                        pooling_types_dict[layer.pooling_param.pool],
                        layer.type,
                        separator,
                        layer.pooling_param.kernel_size,
                        separator,
                        layer.pooling_param.stride,
                        separator,
                        layer.pooling_param.pad)
      else:
          node_label = '"%s%s(%s)"' % (layer.name, separator, layer.type)
      return node_label
function_tokens: def get_layer_label ( layer , rankdir ) : if rankdir in ( 'TB' , 'BT' ) : # If graph orientation is vertical, horizontal space is free and # vertical space is not; separate words with spaces separator = ' ' else : # If graph orientation is horizontal, vertical space is free and # horizontal space is not; separate words with newlines separator = '\\n' if layer . type == 'Convolution' or layer . type == 'Deconvolution' : # Outer double quotes needed or else colon characters don't parse # properly node_label = '"%s%s(%s)%skernel size: %d%sstride: %d%spad: %d"' % ( layer . name , separator , layer . type , separator , layer . convolution_param . kernel_size [ 0 ] if len ( layer . convolution_param . kernel_size . _values ) else 1 , separator , layer . convolution_param . stride [ 0 ] if len ( layer . convolution_param . stride . _values ) else 1 , separator , layer . convolution_param . pad [ 0 ] if len ( layer . convolution_param . pad . _values ) else 0 ) elif layer . type == 'Pooling' : pooling_types_dict = get_pooling_types_dict ( ) node_label = '"%s%s(%s %s)%skernel size: %d%sstride: %d%spad: %d"' % ( layer . name , separator , pooling_types_dict [ layer . pooling_param . pool ] , layer . type , separator , layer . pooling_param . kernel_size , separator , layer . pooling_param . stride , separator , layer . pooling_param . pad ) else : node_label = '"%s%s(%s)"' % ( layer . name , separator , layer . type ) return node_label