Sets areas

Builds the class variable array $areas.

@param array $time_zone_list a tree structured array of areas and
regions.
770374
private function setAreas($time_zone_list)
    {
        ksort($time_zone_list);

        foreach ($time_zone_list as $area => $regions) {
            $this->areas[$area] = $area;
            $this->regions[$area] = array();

            // special case for UTC area
            if ($area === 'UTC') {
                $regions = array($this->getRegion('UTC'));
            }

            $this->setRegions($regions, $area);
        }
    }
889517
def set_time_zone(time_zone)
      time_response = rest_get('/redfish/v1/Managers/1/DateTime/')
      new_time_zone = response_handler(time_response)['TimeZoneList'].select { |timezone| timezone['Name'] == time_zone }
      new_action = { 'TimeZone' => { 'Index' => new_time_zone[0]['Index'] } }
      response = rest_patch('/redfish/v1/Managers/1/DateTime/', body: new_action)
      response_handler(response)
      true
    end
966047
@Override
    public void areaSelected(Area area)
    {
        //show the separator list
        if (area instanceof AreaImpl)
        {
            SeparatorSet sset = Config.createSeparators((AreaImpl) area);
            DefaultListModel<Separator> ml = new DefaultListModel<Separator>();
            for (Separator sep : sset.getHorizontal())
                ml.addElement(sep);
            for (Separator sep : sset.getVertical())
                ml.addElement(sep);
            for (Separator sep : sset.getBoxsep())
                ml.addElement(sep);
            sepList.setModel(ml);
        }
        else
        {
            //not a grouping area -- no separators
            sepList.setModel(new DefaultListModel<Separator>());
        }
    }
682083
public void setTimeZone(TimeZone tz)
    {
        setTzFormatString(tz);        
        if( _locale != null ) 
        {
            _tzFormat=new SimpleDateFormat(_tzFormatString,_locale);
            _minFormat=new SimpleDateFormat(_minFormatString,_locale);
        }
        else if( _dfs != null ) 
        {
            _tzFormat=new SimpleDateFormat(_tzFormatString,_dfs);
            _minFormat=new SimpleDateFormat(_minFormatString,_dfs);
        }
        else 
        {
            _tzFormat=new SimpleDateFormat(_tzFormatString);
            _minFormat=new SimpleDateFormat(_minFormatString);
        }
        _tzFormat.setTimeZone(tz);
        _minFormat.setTimeZone(tz);
        _lastSeconds=-1;
        _lastMinutes=-1;        
    }
911080
private function getArea($time_zone)
    {
        $area = null;

        if ($time_zone === 'UTC') {
            $area = 'UTC';
        } elseif ($time_zone !== null) {
            $parts = explode('/', $time_zone, 2);
            $area = reset($parts);
        }

        return $area;
    }
764586
public function setList(array $list)
    {
        foreach ($list as $item) {
            $this->checkType(TypeDefinitionInterface::class, $item);
        }
        $this->list = $list;
    }
228307
public void setList(long now, List<SimpleOrderedMap<Object>> list)
      throws IOException {
    if (action.equals(ComponentCollection.ACTION_LIST)) {
      this.now = now;
      this.list = list;
    } else {
      throw new IOException("not allowed with action '" + action + "'");
    }
  }
591170
public static function save_definitions($areas) {
        $params = self::validate_parameters(self::save_definitions_parameters(),
                                            array('areas' => $areas));

        foreach ($params['areas'] as $area) {

            $context = context::instance_by_id($area['contextid']);
            require_capability('moodle/grade:managegradingforms', $context);
            $gradingmanager = get_grading_manager($context, $area['component'], $area['areaname']);
            $gradingmanager->set_active_method($area['activemethod']);
            $availablemethods = $gradingmanager->get_available_methods();

            foreach ($area['definitions'] as $definition) {
                if (array_key_exists($definition['method'], $availablemethods)) {
                    $controller = $gradingmanager->get_controller($definition['method']);
                    $controller->update_definition(self::create_definition_object($definition));
                } else {
                    throw new invalid_parameter_exception('Unknown Grading method: '. $definition['method']);
                }
            }
        }
    }
1214343
public function setParts(array $parts)
    {
        if (count($parts) > 1) {
            throw new \InvalidArgumentException('Only one value allowed');
        }
        if (isset($parts[0]) && $parts[0] instanceof DateTimeInterface) {
            $this->setDateTime($parts[0]);
        } else {
            parent::setParts($parts);
        }
    }
684775
def area_field(key='area'):
    """"""

    area_list = list(subdivisions)
    title_map = []
    for item in area_list:
        title_map.append({'value': item.code, 'name': item.name})

    widget = {
        'key': key,
        'type': 'uiselect',
        'titleMap': title_map
    }

    return widget
497334
public function add_regions($regions, $custom = true) {
        foreach ($regions as $region) {
            $this->add_region($region, $custom);
        }
    }
565869
public function set_areas(array $areas) {
        foreach ($areas as $area) {
            if ($area instanceof base && !key_exists($area->get_area_id(), $this->areas)) {
                $this->areas[$area->get_area_id()] = $area;
            }
        }
    }
1326473
public void setZones(Map<String, List<URL>> zones) {
        if (zones != null) {
            this.otherZones = zones.entrySet()
                .stream()
                .flatMap((Function<Map.Entry<String, List<URL>>, Stream<ServiceInstance>>) entry ->
                    entry.getValue()
                        .stream()
                        .map(uriMapper())
                        .map(uri ->
                            ServiceInstance.builder(getServiceID(), uri)
                                .zone(entry.getKey())
                                .build()
                        ))
                .collect(Collectors.toList());
        }
    }
1054800
public void setEventCategoriesList(java.util.Collection<String> eventCategoriesList) {
        if (eventCategoriesList == null) {
            this.eventCategoriesList = null;
            return;
        }

        this.eventCategoriesList = new java.util.ArrayList<String>(eventCategoriesList);
    }
865815
public void setTimeZone(TimeZone value)
    {
        zone = value;
        sharedZone = false;
        /* Recompute the fields from the time using the new zone.  This also
         * works if isTimeSet is false (after a call to set()).  In that case
         * the time will be computed from the fields using the new zone, then
         * the fields will get recomputed from that.  Consider the sequence of
         * calls: cal.setTimeZone(EST); cal.set(HOUR, 1); cal.setTimeZone(PST).
         * Is cal set to 1 o'clock EST or 1 o'clock PST?  Answer: PST.  More
         * generally, a call to setTimeZone() affects calls to set() BEFORE AND
         * AFTER it up to the next call to complete().
         */
        areAllFieldsSet = areFieldsSet = false;
    }
744
public function setTimeZone(\DateTimeZone $timeZone = null)
    {
        if ($timeZone) {
            $value = $timeZone->getName();
        } else {
            $value = null;
        }

        $this->setValue('timezone', $value);
    }
206762
public function setAreaServed($areaServed)
    {
        ObjectHelper::isInstanceOf($areaServed, [Place::class, TextValue::class]);

        $this->_areaServed = $areaServed;
        return $this;
    }