parameters: (self, out_vars)
return_statement: return out_vars
docstring: Removes invalid value for various-length return statement
docstring_summary: Removes invalid value for various-length return statement
docstring_tokens: Removes invalid value for various - length return statement
function: def _remove_no_value(self, out_vars):
          """
          Removes invalid value for various-length return statement
          """
          if isinstance(out_vars, core.VarBase):
              if self._is_no_value(out_vars):
                  return None
              return out_vars
          elif isinstance(out_vars, (tuple, list)):
              if isinstance(out_vars, tuple):
                  res = tuple(
                      var for var in out_vars if not self._is_no_value(var))
              else:
                  # isinstance(out_vars, list)
                  res = [var for var in out_vars if not self._is_no_value(var)]
  
              has_removed = (len(out_vars) > len(res))
              # len(out_vars) > len(res) means we have removed var. This is
              # preventing out_vars is empty or just one element at the beginning
              if len(res) == 0 and has_removed:
                  return None
              elif len(res) == 1 and has_removed:
                  return res[0]
              return res
  
          return out_vars
function_tokens: def _remove_no_value ( self , out_vars ) : if isinstance ( out_vars , core . VarBase ) : if self . _is_no_value ( out_vars ) : return None return out_vars elif isinstance ( out_vars , ( tuple , list ) ) : if isinstance ( out_vars , tuple ) : res = tuple ( var for var in out_vars if not self . _is_no_value ( var ) ) else : # isinstance(out_vars, list) res = [ var for var in out_vars if not self . _is_no_value ( var ) ] has_removed = ( len ( out_vars ) > len ( res ) ) # len(out_vars) > len(res) means we have removed var. This is # preventing out_vars is empty or just one element at the beginning if len ( res ) == 0 and has_removed : return None elif len ( res ) == 1 and has_removed : return res [ 0 ] return res return out_vars