/*!
\return an array of values of limited assignments
195969
function limitValueList()
    {
        if ( eZINI::instance()->variable( 'RoleSettings', 'EnableCaching' ) === 'true' )
        {
            $userCache = $this->getUserCache();
            return $userCache['role_limitations'];
        }

        $limitValueList = array();
        $limitList      = $this->limitList();
        foreach ( $limitList as $limit )
        {
            $limitValueList[] = $limit['limit_value'];
        }

        return $limitValueList;
    }
745391
protected function extractValueFromAssignmentString($assignment) {
        if(!$assignment) {
            return null;
        }
        $assignmentArray = explode("=", $assignment);
        return isset($assignmentArray[1]) ? $assignmentArray[1] : null;
    }
1347655
protected function selectizeVal($val)
    {
        if ($val === null) {
            return [];
        }

        $input   = $this->selectizeInput();
        $choices = [];

        if ($input instanceof SelectizeInput) {
            $choices = $input->selectizeVal($val);
        }

        return $choices;
    }
239150
def getLimits(locations, current, sortResults=True, verbose=False):
    
    limit = {}
    for l in locations:
        a, b = current.common(l)
        if a is None:
            continue
        for name, value in b.items():
            f = a[name]
            if name not in limit:
                limit[name] = {}
                limit[name]['<'] = {}
                limit[name]['='] = {}
                limit[name]['>'] = {}
                if f > 0:
                    limit[name]['>'] = {0: [Location()]}
                elif f<0:
                    limit[name]['<'] = {0: [Location()]}
                else:
                    limit[name]['='] = {0: [Location()]}
            if current[name] < value - _EPSILON:
                if value not in limit[name]["<"]:
                    limit[name]["<"][value] = []
                limit[name]["<"][value].append(l)
            elif current[name] > value + _EPSILON:
                if value not in limit[name][">"]:
                    limit[name][">"][value] = []
                limit[name][">"][value].append(l)
            else:
                if value not in limit[name]["="]:
                    limit[name]["="][value] = []
                limit[name]["="][value].append(l)
    if not sortResults:
        return limit
    # now we have all the data, let's sort to the relevant values
    l = {}
    for name, lims in  limit.items():
        less = []
        more = []
        if lims[">"].keys():
            less = sorted(lims[">"].keys())
            lim_min = less[-1]
        else:
            lim_min = None
        if lims["<"].keys():
            more = sorted(lims["<"].keys())
            lim_max = more[0]
        else:
            lim_max = None
        if lim_min is None and lim_max is not None:
            # extrapolation < min
            if len(limit[name]['='])>0:
                l[name] = (None, list(limit[name]['='].keys())[0], None)
            elif len(more) > 1 and len(limit[name]['='])==0:
                # extrapolation
                l[name] = (None,  more[0], more[1])
        elif lim_min is not None and lim_max is None:
            # extrapolation < max
            if len(limit[name]['='])>0:
                # less > 0, M > 0, more = None
                # -> end of a limit
                l[name] = (None, limit[name]['='], None)
            elif len(less) > 1 and len(limit[name]['='])==0:
                # less > 0, M = None, more = None
                # extrapolation
                l[name] = (less[-2], less[-1], None)
        else:
            if len(limit[name]['=']) > 0:
                l[name] = (None, list(limit[name]['='].keys())[0], None)
            else:
                l[name] = (lim_min,  None, lim_max)
    return l
702921
public function getAllowedValues()
    {
        $inArrayFilters = $this->getRequirements()->filter(
            function($value) {
                return $value instanceof InArray;
            }
        );

        if (count($inArrayFilters) > 0) {
            return $inArrayFilters->first()->getValues();
        }
        return [];
    }
1044632
function(indexes) {
      var isArray, k, v;
      isArray = Array.isArray(indexes);
      if (!isArray) {
        indexes = [indexes];
      }
      indexes = (function() {
        var results;
        results = [];
        for (k in indexes) {
          v = indexes[k];
          results.push(`${k} ${v}`);
        }
        return results;
      })();
      if (isArray) {
        return indexes;
      } else {
        return indexes[0];
      }
    }
141412
function( index ) {
		var val,
			vals,
			i;

		if ( arguments.length ) {
			val = this.options.values[ index ];
			val = this._trimAlignValue( val );

			return val;
		} else if ( this._hasMultipleValues() ) {

			// .slice() creates a copy of the array
			// this copy gets trimmed by min and max and then returned
			vals = this.options.values.slice();
			for ( i = 0; i < vals.length; i += 1 ) {
				vals[ i ] = this._trimAlignValue( vals[ i ] );
			}

			return vals;
		} else {
			return [];
		}
	}
1182339
function shallowCopy(t) {
  if (Array.isArray(t)) {
    return [...t];
  } else if (t && typeof t === 'object') {
    return Object.assign(new t.constructor(), t);
  }
  return t;
}
1347432
public function rangeLimit(int $max, int $limit) : array
        {
                $response =  $this->_redis->zrevrangebyscore($this->_key, $max, '-inf','WITHSCORES', 'LIMIT', 0, $limit);
                $result   = [];
                for($i=0,$num=count($response);$i<$num;$i++) {
                        $result[$response[$i]] = intval($response[++$i]);
                }
                return $result;
        }
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);
            }
        }
    }
89701
function getAtRuleValue(params) {
	var value = params[0];
	var array = [];
	value = _.trim(value, '\'"()');
	if (value.indexOf('#') > -1) {
		value = value.split('#');
		return value;
	}
	array.push(value);
	return array;
}
1304619
function compact(array) {
  const aResult = [];
  for (let idx = 0, len = array.length; idx < len; idx++) {
    if (array[idx]) { aResult.push(array[idx]); }
  }
  return aResult;
}
428433
function assign() {
    arguments[0] = arguments[0] || {};

    for (var n=1; n<arguments.length; n++) {
      for (var key in arguments[n]) {
        if (arguments[n].hasOwnProperty(key)) arguments[0][key] = arguments[n][key];
      }
    }
    return arguments[0];
  }
234572
function(r) {
      var llc = this.lowerLeftCoor(r),
          lrc = this.lowerRightCoor(r, llc);

      return [
        {x: r.x1, y: r.y1},
        {x: r.x2, y: r.y2},
        {x: llc.x, y: llc.y},
        {x: lrc.x, y: lrc.y}
      ];
    }
1009076
private function groupLimitationValues(array $limitationValues)
    {
        $objectStateHandler = $this->persistence->objectStateHandler();
        $stateGroups = $objectStateHandler->loadAllGroups();
        $groupedLimitationValues = [];
        foreach ($stateGroups as $stateGroup) {
            $states = $objectStateHandler->loadObjectStates($stateGroup->id);
            $stateIds = array_map(function ($state) {
                return $state->id;
            }, $states);
            $limitationValuesGroup = array_intersect($stateIds, $limitationValues);
            if (!empty($limitationValuesGroup)) {
                $groupedLimitationValues[] = array_values($limitationValuesGroup);
            }
        }

        return $groupedLimitationValues;
    }
1369163
public function getLowGradeAllowableValues()
    {
        return [
            self::LOW_GRADE__1,
            self::LOW_GRADE__2,
            self::LOW_GRADE__3,
            self::LOW_GRADE__4,
            self::LOW_GRADE__5,
            self::LOW_GRADE__6,
            self::LOW_GRADE__7,
            self::LOW_GRADE__8,
            self::LOW_GRADE__9,
            self::LOW_GRADE__10,
            self::LOW_GRADE__11,
            self::LOW_GRADE__12,
            self::LOW_GRADE_PRE_KINDERGARTEN,
            self::LOW_GRADE_KINDERGARTEN,
            self::LOW_GRADE_POST_GRADUATE,
            self::LOW_GRADE_OTHER,
        ];
    }
110038
def assignments(self):
        """"""

        collection = OrderedDict()

        for arg in self.all:
            if '=' in arg:
                collection.setdefault(
                    arg.split('=', 1)[0], ArgsList(no_argv=True))
                collection[arg.split('=', 1)[0]]._args.append(
                    arg.split('=', 1)[1])

        return collection