The values are a function of both magnitude and rake.

        Setting the rake to ``None`` causes their "All" rupture-types
        to be applied.
483268
def get_median_area(self, mag, rake):
        
        assert rake is None or -180 <= rake <= 180
        if rake is None:
            # their "All" case
            return 10.0 ** (-3.49 + 0.91 * mag)
        elif (-45 <= rake <= 45) or (rake >= 135) or (rake <= -135):
            # strike slip
            return 10.0 ** (-3.42 + 0.90 * mag)
        elif rake > 0:
            # thrust/reverse
            return 10.0 ** (-3.99 + 0.98 * mag)
        else:
            # normal
            return 10.0 ** (-2.87 + 0.82 * mag)
402745
public void setMeshCreatorInputNormals(float[] values) {
        meshCreatorInputNormals = new float[ values.length ];
        for (int i = 0; i < values.length; i++) {
            meshCreatorInputNormals[i] = values[i];
        }
    }
940503
function absoluteValue(node) {
  if (!Node.Type.isFunction(node, 'abs')) {
    return Node.Status.noChange(node);
  }
  if (node.args.length > 1) {
    return Node.Status.noChange(node);
  }
  let newNode = clone(node);
  const argument = newNode.args[0];
  if (Node.Type.isConstant(argument, true)) {
    newNode = Node.Creator.constant(math.abs(argument.eval()));
    return Node.Status.nodeChanged(
      ChangeTypes.ABSOLUTE_VALUE, node, newNode);
  }
  else if (Node.Type.isConstantFraction(argument, true)) {
    const newNumerator = Node.Creator.constant(
      math.abs(argument.args[0].eval()));
    const newDenominator =  Node.Creator.constant(
      math.abs(argument.args[1].eval()));
    newNode = Node.Creator.operator('/', [newNumerator, newDenominator]);
    return Node.Status.nodeChanged(
      ChangeTypes.ABSOLUTE_VALUE, node, newNode);
  }
  else {
    return Node.Status.noChange(node);
  }
}
297159
function(values) {
    var max = Number.MIN_VALUE,
        min = Number.MAX_VALUE,
        val,
        cc,
        attrs = {};

    if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) {
      if (!this.params.min || !this.params.max) {
        for (cc in values) {
          val = parseFloat(values[cc]);
          if (val > max) max = values[cc];
          if (val < min) min = val;
        }
        if (!this.params.min) {
          this.scale.setMin(min);
        }
        if (!this.params.max) {
          this.scale.setMax(max);
        }
        this.params.min = min;
        this.params.max = max;
      }
      for (cc in values) {
        val = parseFloat(values[cc]);
        if (!isNaN(val)) {
          attrs[cc] = this.scale.getValue(val);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    } else {
      for (cc in values) {
        if (values[cc]) {
          attrs[cc] = this.scale.getValue(values[cc]);
        } else {
          attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute];
        }
      }
    }

    this.setAttributes(attrs);
    jvm.$.extend(this.values, values);
  }
354074
def reject_all_values_if_none(source_list)
      if source_list.length > 1
        source_list.reject { |value| value == NONE }
      else
        source_list
      end
    end
780372
function set(value) {
      var step = value.substr(1);

      this._m = {
        direction: value.substr(0, 1),
        steps: step ? toInt(step) ? toInt(step) : step : 0
      };
    }
1351205
def wrap(self, value):
        ''' '''
        self.validate_wrap(value)
        return self.computed_type.wrap(value)
1284557
function setTMXValue(name, type, value) {
         var match;

         if (typeof value !== "string") {
           // Value is already normalized (e.g. with JSON maps)
           return value;
         }

         switch (type) {
           case "int":
           case "float":
             value = Number(value);
             break;

           case "bool":
             value = value === "true";
             break;

           default:
             // try to parse it anyway
             if (!value || me.utils.string.isBoolean(value)) {
               // if value not defined or boolean
               value = value ? value === "true" : true;
             } else if (me.utils.string.isNumeric(value)) {
               // check if numeric
               value = Number(value);
             } else if (value.search(/^json:/i) === 0) {
               // try to parse it
               match = value.split(/^json:/i)[1];

               try {
                 value = JSON.parse(match);
               } catch (e) {
                 throw new Error("Unable to parse JSON: " + match);
               }
             } else if (value.search(/^eval:/i) === 0) {
               // try to evaluate it
               match = value.split(/^eval:/i)[1];

               try {
                 // eslint-disable-next-line
                 value = eval(match);
               } catch (e) {
                 throw new Error("Unable to evaluate: " + match);
               }
             } else if ((match = value.match(/^#([\da-fA-F])([\da-fA-F]{3})$/)) || (match = value.match(/^#([\da-fA-F]{2})([\da-fA-F]{6})$/))) {
               value = "#" + match[2] + match[1];
             } // normalize values


             if (name.search(/^(ratio|anchorPoint)$/) === 0) {
               // convert number to vector
               if (typeof value === "number") {
                 value = {
                   "x": value,
                   "y": value
                 };
               }
             }

         } // return the interpreted value


         return value;
       }
627485
function (data) {

	// Initialize framework linear functions for mapping earthquake data properties to Leaflet style properties
	// Color scale - green to red using the basic HSLHueFunction
	var magnitudeColorFunction = new L.HSLHueFunction(new L.Point(0,90), new L.Point(10,0), {outputSaturation: '100%', outputLuminosity: '25%'});
	var magnitudeFillColorFunction = new L.HSLHueFunction(new L.Point(0,90), new L.Point(10,0), {outputSaturation: '100%', outputLuminosity: '50%'});
	var magnitudeRadiusFunction = new L.LinearFunction(new L.Point(0,10), new L.Point(10,30));
	
	// Color scale - white to orange to red using a PiecewiseFunction
	// NOTE:  Uncomment these lines to see the difference
	/*
	var magnitudeColorFunction = new L.PiecewiseFunction([
		new L.HSLLuminosityFunction(new L.Point(0,0.8), new L.Point(4,0.3), {outputSaturation: '100%', outputHue: 30}),
		new L.HSLHueFunction(new L.Point(4,30), new L.Point(10,0), {outputLuminosity: '30%'})
	]);
	
	var magnitudeFillColorFunction = new L.PiecewiseFunction([
		new L.HSLLuminosityFunction(new L.Point(0,1), new L.Point(4,0.5), {outputSaturation: '100%', outputHue: 30}),
		new L.HSLHueFunction(new L.Point(4,30), new L.Point(10,0))
	]);
	*/

	var now = Math.round((new Date()).getTime());
	var start = now - 86400000;

	// Initialize a linear function to map earthquake time to opacity
	var timeOpacityFunction = new L.LinearFunction(new L.Point(start,0.3), new L.Point(now,1));
	var fontSizeFunction = new L.LinearFunction(new L.Point(0,8), new L.Point(10,24));

	var textFunction = function (value) {
		return {
			text: value,
			style: {
				'font-size': fontSizeFunction.evaluate(value)
			}
		};
	};

	// Setup a new data layer
	var dataLayer = new L.DataLayer(data,{
		recordsField: 'features',
		latitudeField: 'geometry.coordinates.1',
		longitudeField: 'geometry.coordinates.0',
		locationMode: L.LocationModes.LATLNG,
		displayOptions: {
			'properties.mag': {
				displayName: 'Magnitude',
				color: magnitudeColorFunction,
				fillColor: magnitudeFillColorFunction,
				radius: magnitudeRadiusFunction,
				text: textFunction
			},
			'properties.time': {
				displayName: 'Time',
				opacity: timeOpacityFunction,
				fillOpacity: timeOpacityFunction,
				displayText: function (value) {
					return moment.unix(value/1000).format('MM/DD/YY HH:mm');
				}
			}
		},
		layerOptions: {
			numberOfSides: 4,
			radius: 10,
			weight: 1,
			color: '#000',
			opacity: 0.2,
			stroke: true,
			fillOpacity: 0.7,
			dropShadow: true,
			gradient: true
		},
		tooltipOptions: {
			iconSize: new L.Point(90,76),
			iconAnchor: new L.Point(-4,76)
		},
		onEachRecord: function (layer, record, location) {
			var $html = $(L.HTMLUtils.buildTable(record));

			layer.bindPopup($html.wrap('<div/>').parent().html(),{
				minWidth: 400,
				maxWidth: 400
			});
		}
	});

	// Add the data layer to the map
	map.addLayer(dataLayer);

	lastLayer = dataLayer;
}
387589
function(values, func) {
        "use strict";
        if (values.forEach) {
            return values.forEach(func);
        } else {
            for (var i=0, len=values.length; i < len; i++) {
                func(values[i], i, values);
            }
        }
    }
786999
def _get_sof_terms(self, C, rake):
        
        if rake >= 45.0 and rake <= 135.0:
            # Reverse faulting
            return C["b0R"], C["b1R"]
        elif rake <= -45. and rake >= -135.0:
            # Normal faulting
            return C["b0N"], C["b1N"]
        else:
            # Strike slip
            return C["b0SS"], C["b1SS"]
840925
function val (params, spec, errs) {
  for (var key in params) {
    if (key in spec && isFunction(spec[key].val) && !spec[key].val(params[key])) valError(key, errs)
  }
}
556849
def _get_fault_type_dummy_variables(self, rup):
        

        Fn, Fr = 0, 0
        if rup.rake >= -112.5 and rup.rake <= -67.5:
            # normal
            Fn = 1
        elif rup.rake >= 22.5 and rup.rake <= 157.5:
            # Joins both the reverse and reverse-oblique categories
            Fr = 1
        return Fn, Fr
1106779
function merkle (values, digestFn) {
  if (!Array.isArray(values)) throw TypeError('Expected values Array')
  if (typeof digestFn !== 'function') throw TypeError('Expected digest Function')
  if (values.length === 1) return values.concat()

  var levels = [values]
  var level = values

  do {
    level = _derive(level, digestFn)
    levels.push(level)
  } while (level.length > 1)

  return [].concat.apply([], levels)
}
329008
def update(self, src):
        
        assert src.tectonic_region_type == self.trt, (
            src.tectonic_region_type, self.trt)
        if not src.min_mag:  # if not set already
            src.min_mag = self.min_mag.get(self.trt) or self.min_mag['default']
        # checking mutex ruptures
        if (not isinstance(src, NonParametricSeismicSource) and
                self.rup_interdep == 'mutex'):
            msg = "Mutually exclusive ruptures can only be "
            msg += "modelled using non-parametric sources"
            raise ValueError(msg)

        nr = get_set_num_ruptures(src)
        if nr == 0:  # the minimum_magnitude filters all ruptures
            return
        self.tot_ruptures += nr
        self.sources.append(src)
        _, max_mag = src.get_min_max_mag()
        prev_max_mag = self.max_mag
        if prev_max_mag is None or max_mag > prev_max_mag:
            self.max_mag = max_mag
442046
function converDataValue(value, dimInfo) {
    // Performance sensitive.
    var dimType = dimInfo && dimInfo.type;
    if (dimType === 'ordinal') {
        // If given value is a category string
        var ordinalMeta = dimInfo && dimInfo.ordinalMeta;
        return ordinalMeta
            ? ordinalMeta.parseAndCollect(value)
            : value;
    }

    if (dimType === 'time'
        // spead up when using timestamp
        && typeof value !== 'number'
        && value != null
        && value !== '-'
    ) {
        value = +parseDate(value);
    }

    // dimType defaults 'number'.
    // If dimType is not ordinal and value is null or undefined or NaN or '-',
    // parse to NaN.
    return (value == null || value === '')
        ? NaN
        // If string (like '-'), using '+' parse to NaN
        // If object, also parse to NaN
        : +value;
}
642890
function(input, shallow, strict, output) {
    if (shallow && _.every(input, _.isArray)) {
      return concat.apply(output, input);
    }
    for (var i = 0, length = input.length; i < length; i++) {
      var value = input[i];
      if (!_.isArray(value) && !_.isArguments(value)) {
        if (!strict) output.push(value);
      } else if (shallow) {
        push.apply(output, value);
      } else {
        flatten(value, shallow, strict, output);
      }
    }
    return output;
  }