Normalize arguments by returning them as an array.
171498
function asArray() {
  var argLen = arguments.length;
  switch(argLen) {
  // No arguments returns an empty array
  case 0:
    return [];
  // Single array argument returns that array
  case 1:
    var arg = arguments[0];
    if (Array.isArray(arg)) {
      return arg;
    }
    // Single object argument returns an array with object as only element
    return [arg];
  // List of arguments returns an array with arguments as elements
  default:
    var args = new Array(argLen);
    for(var i=0; i < argLen; ++i) {
      args[i] = arguments[i];
    }
    return args;
  }
}
174749
def normalize_value(values)
      Array.wrap(values).map do |value|
        value.is_a?(String) ? value.gsub("\n", "") : value
      end
    end
1318915
function normalize(result) {
  return {
    relevance: result.relevance || 0,
    language: result.language || null,
    value: result.value || []
  }
}
1053420
function normalizeOptsKey(aval, basedir, pkg) {

    aval = aval || [];

    if (!u.isArray(aval)) {
      aval = [ aval ];
    }

    return u.map(u.compact(aval), function(val) {
      return normalize(val, basedir, pkg);
    });

  }
748557
function normaliseParams(params) {
			if (typeof params === 'string') {
				params = params.split(' ');
			}
			else if (!$.isArray(params)) {
				var opts = [];
				for (var name in params) {
					opts[0] = name;
					opts[1] = params[name];
				}
				params = opts;
			}
			return params;
		}
499230
def normalize_excludes(excludes):
    """"""
    return [os.path.normpath(os.path.abspath(exclude)) for exclude in excludes]
138937
def normalize(v):
    ''''''
    if 0 == np.linalg.norm(v):
        return v
    return v / np.linalg.norm(v)
55954
def normalize_array(value)
      value.split("\n").map { |line| line.strip }.reject { |line| line.empty? }
    end
353731
function normalizeArgs(args, exclude) {
    var result = [];
    args = splitArgs(args || []);
    exclude = splitArgs(exclude || []);
    args.slice(0).forEach(function (arg) {
        var val;
        if (arg && arg.indexOf && ~arg.indexOf('=')) {
            var kv = arg.split('=');
            arg = kv[0];
            val = kv[1];
        }
        if (/^-{1}[a-z]+/i.test(arg)) {
            var spread = arg.slice(1).split('').map(function (a) { return '-' + a; });
            if (val)
                spread.push(val);
            result = result.concat(spread);
        }
        else {
            result.push(arg);
            if (val)
                result.push(val);
        }
    });
    return filterArgs(result, exclude);
}
799971
protected function normalizeArguments(array $arguments)
    {
        if (count($arguments) === 2) {
            return [$arguments[0] => $arguments[1]];
        }

        if ($arguments[0] instanceof Arrayable) {
            return $arguments[0]->toArray();
        }

        if (! is_array($arguments[0])) {
            $arguments[0] = [$arguments[0]];
        }

        return $arguments[0];
    }
1312668
def normalize_array(a,direction="column"):
    
    b = a.copy()
    if(direction == "column"):
        sums = np.sum(b,0)
        return np.nan_to_num(b/sums)
    elif(direction == "row"):
        sums =np.sum(b,1)
        return  np.nan_to_num((b.transpose() / sums).transpose())
    elif(direction == "all"):
        sums = np.sum(b)
        return np.nan_to_num(b / sums)
    else:
        print "Error non existing normalization"
        return b
308965
private function normalizeFields($_fields)
    {
        $fields = [];
        foreach ($_fields as $key => $value) {
            if (is_array($value)) {
                $fields[$key] = $value;
            } else {
                $fields[$value] = [];
            }
        }
        return $fields;
    }
253338
def batch_normalize_with_arguments(x, arguments):
  
  x = prettytensor.wrap(x)
  # Backwards compatibility.
  if isinstance(arguments, bool):
    if arguments:
      return x.batch_normalize()
    else:
      return x

  # pylint: disable=protected-access
  kwargs = arguments._asdict()
  defaults = prettytensor._defaults
  # pylint: enable=protected-access
  for arg in ('learned_moments_update_rate', 'variance_epsilon',
              'scale_after_normalization'):
    if kwargs.get(arg, None) is None:
      if arg in defaults:
        kwargs[arg] = defaults[arg]
      else:
        del kwargs[arg]
  return x.batch_normalize(**kwargs)
381704
def array(arr, *args, **kwargs):
    '''
    
    '''
    return weldarray(np.array(arr, *args, **kwargs))
50187
private function normalize() : array {
    $files = [];

    foreach($_FILES as $key => $file) {
      
      if (!is_array($file['name'])) {
          $files[$key][] = $file;
          continue;
      }

      foreach($file['name'] as $subKey => $name) {
          $files[$key][$subKey] = [
              'name' => $name,
              'type' => $file['type'][$subKey],
              'tmp_name' => $file['tmp_name'][$subKey],
              'error' => $file['error'][$subKey],
              'size' => $file['size'][$subKey]
          ];
      }
    }

    return $files;
  }
272041
def normalize_params(params):
    """"""
    # Collect a set of all fields
    fields = set()
    for p in params:
        fields.update(p)
    fields = sorted(fields)

    params2 = list(pluck(fields, params, MISSING))
    # Non-basic types (including MISSING) are unique to their id
    tokens = [
        tuple(x if isinstance(x, (int, float, str)) else id(x) for x in p)
        for p in params2
    ]

    return fields, tokens, params2
779071
private Object [] normalizeMessageArgs(Object [] args) {
    Object [] result = args;
    if(args != null && args.length > 0) {
      result = new Object[args.length];
      for(int i = 0; i < args.length; i++) {
        if(args[i] == null || args[i] instanceof CharSequence || args[i] instanceof Number) {
          result[i] = args[i];
        } else {
          result[i] = args[i].toString();
        }
      }
    }
    return result;
  }