Link given $zone with the zone given in $zoneData.
974
private function linkZone(Zone $zone, array $zoneData): void
    {
        $linkedZoneLayout = $this->layoutService->loadLayout($zoneData['layout_id']);
        $linkedZone = $linkedZoneLayout->getZone($zoneData['identifier']);
        $this->layoutService->linkZone($zone, $linkedZone);
    }
445346
def attach_zone(geoid, organization_id_or_slug):
    ''''''
    organization = Organization.objects.get_by_id_or_slug(
        organization_id_or_slug)
    if not organization:
        log.error('No organization found for %s', organization_id_or_slug)
    geozone = GeoZone.objects.get(id=geoid)
    if not geozone:
        log.error('No geozone found for %s', geoid)
    log.info('Attaching {organization} with {geozone.name}'.format(
             organization=organization, geozone=geozone))
    organization.zone = geozone.id
    organization.save()
    log.info('Done')
756985
public void writeTo(String zoneID, DataOutput out) throws IOException {
        // pass false so zone id is not written out
        DateTimeZone zone = toDateTimeZone(zoneID, false);

        if (zone instanceof FixedDateTimeZone) {
            out.writeByte('F'); // 'F' for fixed
            out.writeUTF(zone.getNameKey(0));
            writeMillis(out, zone.getOffset(0));
            writeMillis(out, zone.getStandardOffset(0));
        } else {
            if (zone instanceof CachedDateTimeZone) {
                out.writeByte('C'); // 'C' for cached, precalculated
                zone = ((CachedDateTimeZone)zone).getUncachedZone();
            } else {
                out.writeByte('P'); // 'P' for precalculated, uncached
            }
            ((PrecalculatedZone)zone).writeTo(out);
        }
    }
865829
def _link_for_value(self, value):
    ''''''
    try:
      key = Key(value)
      if key.name == self.sentinel:
        return key.parent
    except:
      pass
    return None
700201
function getZone(zone) {
        if (!zone) return "main";
        if (zone.length == 1) {
            zone = zone.replace("/^1", "main");
            zone = zone.replace("/^2", "zone2");
            zone = zone.replace("/^3", "zone3");
            zone = zone.replace("/^4", "zone4");
        }
        switch (zone) {
            case 1:
                zone = "main";
                break;
            case 2: case 3: case 4:
                zone = "zone" + zone;
        }
        return zone;
    }
1219304
def filter_zone(self, data):
        """"""
        if self.private_zone is not None:
            if data['Config']['PrivateZone'] != self.str2bool(self.private_zone):
                return False

        if data['Name'] != '{0}.'.format(self.domain):
            return False

        return True
1227414
def add(cls, zone_id, version_id, record):
        """"""
        return cls.call('domain.zone.record.add', zone_id, version_id, record)
1160406
async def _post(self, zone_id: int = None, json: dict = None) -> dict:
        """"""
        return await self._request(
            'post', 'zone/{0}/properties'.format(zone_id), json=json)
682960
def set_mode_by_name(self, zone_name, mode):
        
        zone = self.get_zone(zone_name)
        if zone is None:
            raise RuntimeError("Unknown zone")

        return self.set_mode_by_id(zone["zoneId"], mode)
679505
public function mapZone(PersistenceZone $zone): Zone
    {
        $zoneData = [
            'identifier' => $zone->identifier,
            'layoutId' => $zone->layoutId,
            'status' => $zone->status,
            'linkedZone' => function () use ($zone): ?Zone {
                if ($zone->linkedLayoutId === null || $zone->linkedZoneIdentifier === null) {
                    return null;
                }

                try {
                    // We're always using published versions of linked zones
                    $linkedZone = $this->layoutHandler->loadZone(
                        $zone->linkedLayoutId,
                        PersistenceValue::STATUS_PUBLISHED,
                        $zone->linkedZoneIdentifier
                    );

                    return $this->mapZone($linkedZone);
                } catch (NotFoundException $e) {
                    return null;
                }
            },
        ];

        return Zone::fromArray($zoneData);
    }
280625
public function indexByZoneType()
    {
        $zoneCollection = array();
        foreach ($this as $zone) {
            $zoneCollection[$zone->getZoneType()->getName()] = $zone;
        }

        return new self($zoneCollection);
    }
1208872
private function fillYData($x, $z, $value, array $x_axis, array $z_axis, array &$ydata): void
    {
        $x = $this->findAxisEntry($x, $x_axis);
        $z = $this->findAxisEntry($z, $z_axis);

        if (!array_key_exists($z, $z_axis)) {
            foreach (array_keys($z_axis) as $key) {
                if ($value <= $key) {
                    $z = $key;
                    break;
                }
            }
        }

        // Add the value to the appropriate data point.
        $ydata[$z][$x] = ($ydata[$z][$x] ?? 0) + $value;
    }
293720
def _add_zone(self, zone, name='', status=Zone.CLEAR, expander=False):
        
        if not zone in self._zones:
            self._zones[zone] = Zone(zone=zone, name=name, status=None, expander=expander)

        self._update_zone(zone, status=status)
281047
private function lookupTopology(): void
    {
        if ($this->group !== null) {
            return;
        }

        $attributes = $this->soap("ZoneGroupTopology", "GetZoneGroupAttributes");

        $this->setGroup($attributes["CurrentZoneGroupID"]);

        $this->coordinator = false;
        if (strpos($attributes["CurrentZonePlayerUUIDsInGroup"], ",") === false) {
            $this->coordinator = true;
        } else {
            list($uuid) = explode(":", $attributes["CurrentZoneGroupID"]);
            if ($uuid === $this->getUuid()) {
                $this->coordinator = true;
            }
        }
    }
61768
private void link(Range range, MinMaxPanel panel) {
		controlToData.put(panel, range);
		panel.setMax((int) range.getMax());
		panel.setMin((int) range.getMin());
		panel.setEnabledValue(range.isEnabled());
	}
1052287
def column(m, linkpart):
    '''
    
    '''
    assert linkpart in (0, 1, 2, 3)
    seen = set()
    for link in m.match():
        val = link[linkpart]
        if val not in seen:
            seen.add(val)
            yield val
159569
public function addZoneTo($zone, $name, Array $params=array()){
		if(!isset($this->content[$zone]))
			$this->content[$zone] = array();
		$this->content[$zone][] = array('type'=>'zone', 'zone'=>$name, 'params'=>$params);
	}