code: def training_scope(
      is_training=True,
      weight_decay=0.00004,
      stddev=0.09,
      dropout_keep_prob=0.8,
      bn_decay=0.997,
  ):
      """Defines Mobilenet training scope.
  
      Usage:
         with tf.contrib.slim.arg_scope(mobilenet.training_scope()):
           logits, endpoints = mobilenet_v2.mobilenet(input_tensor)
  
         # the network created will be trainble with dropout/batch norm
         # initialized appropriately.
      Args:
        is_training: if set to False this will ensure that all customizations are
          set to non-training mode. This might be helpful for code that is reused
          across both training/evaluation, but most of the time training_scope with
          value False is not needed. If this is set to None, the parameters is not
          added to the batch_norm arg_scope.
  
        weight_decay: The weight decay to use for regularizing the model.
        stddev: Standard deviation for initialization, if negative uses xavier.
        dropout_keep_prob: dropout keep probability (not set if equals to None).
        bn_decay: decay for the batch norm moving averages (not set if equals to
          None).
  
      Returns:
        An argument scope to use via arg_scope.
      """
      # Note: do not introduce parameters that would change the inference
      # model here (for example whether to use bias), modify conv_def instead.
      batch_norm_params = {
          "decay": bn_decay,
          "is_training": is_training,
      }
      if stddev < 0:
          weight_intitializer = slim.initializers.xavier_initializer()
      else:
          weight_intitializer = tf.truncated_normal_initializer(
              stddev=stddev
          )
  
      # Set weight_decay for weights in Conv and FC layers.
      with slim.arg_scope(
          [slim.conv2d, slim.fully_connected, slim.separable_conv2d],
          weights_initializer=weight_intitializer,
          normalizer_fn=slim.batch_norm,
      ), slim.arg_scope(
          [mobilenet_base, mobilenet], is_training=is_training
      ), safe_arg_scope(
          [slim.batch_norm], **batch_norm_params
      ), safe_arg_scope(
          [slim.dropout],
          is_training=is_training,
          keep_prob=dropout_keep_prob,
      ), slim.arg_scope(
          [slim.conv2d],
          weights_regularizer=slim.l2_regularizer(weight_decay),
      ), slim.arg_scope(
          [slim.separable_conv2d], weights_regularizer=None
      ) as s:
          return s
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import contextlib
  import copy
  import os
  import tensorflow
label_desc: Use image node_id 12 for calling a global function with example usage: training_scope(is_training, weight_decay, stddev, dropout_keep_prob, bn_decay) and returns: s