Get the valid GPIO pin map

@return array
771642
public function getGPIOPins()
	{
		if(true === in_array($this->revision, ['a01041', 'a21041', 'a22042'], true)) {
			// Pi 2 revs
			return range(2, 27);
		}

		if(true === in_array($this->revision, ['a02082', 'a22082', 'a32082'], true)) {
			// Pi 3 revs
			return range(2, 27);
		}

		// Pi 1 revs
		return [0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 25];
	}
245716
public function getPivotedAttributes()
    {
        $array = [];

        if (!$valueset = $this->getValueSet()) {
            return $array;
        }

        foreach ($valueset->getValues() as $value) {
            switch (get_class($value)) {
                case CheckListValue::class:
                    $array[$value->getAttribute()->getName()] = [];
                    foreach ($value->getOptions() as $option) {
                        $array[$value->getAttribute()->getName()][] = [
                            'id' => $option->getId(),
                            'name' => $option->getName(),
                        ];
                    }
                    break;
                default:
                    $array[$value->getAttribute()->getName()] = $value->getValue();
                    break;
            }
        }

        return $array;
    }
1063307
private function mapImage(): array
    {
        $previewUri = $this->resourceManager->getPublicPersistentResourceUri($this->image->getResource());

        return [
            'previewUri' => $previewUri,
            'width' => $this->image->getWidth(),
            'height' => $this->image->getHeight(),
            'persistenceIdentifier' => $this->persistenceManager->getIdentifierByObject($this->image)
        ];
    }
1270231
public function getMachineTypeAllowableValues()
    {
        return [
            self::MACHINE_TYPE_AIR,
            self::MACHINE_TYPE_STANDARD,
            self::MACHINE_TYPE_PRO,
            self::MACHINE_TYPE_ADVANCED,
            self::MACHINE_TYPE_GPU,
            self::MACHINE_TYPE_P5000,
            self::MACHINE_TYPE_C1,
            self::MACHINE_TYPE_C2,
            self::MACHINE_TYPE_C3,
            self::MACHINE_TYPE_C4,
            self::MACHINE_TYPE_C5,
            self::MACHINE_TYPE_C6,
            self::MACHINE_TYPE_C7,
            self::MACHINE_TYPE_C8,
            self::MACHINE_TYPE_C9,
            self::MACHINE_TYPE_C10,
        ];
    }
409082
public function getClassMap()
    {
        $communityEditionSourcePath = $this->facts->getCommunityEditionSourcePath();
        $backwardsCompatibilityClassMapFile = $communityEditionSourcePath . DIRECTORY_SEPARATOR .
                                              'Core' . DIRECTORY_SEPARATOR .
                                              'Autoload' . DIRECTORY_SEPARATOR .
                                              'BackwardsCompatibilityClassMap.php';

        if (!is_readable($backwardsCompatibilityClassMapFile)) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\InvalidBackwardsCompatibilityClassMapException(
                'Backwards compatibility class map file ' . $backwardsCompatibilityClassMapFile .
                ' is not readable or does not exist',
                static::ERROR_CODE_MISSING_BACKWARDS_COMPATIBILITY_CLASS_MAP
            );
        }

        $backwardsCompatibilityClassMap =
            include $backwardsCompatibilityClassMapFile;

        if (!is_array($backwardsCompatibilityClassMap)) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\InvalidBackwardsCompatibilityClassMapException(
                'Backwards compatibility class map is not an array ',
                static::ERROR_CODE_INVALID_BACKWARDS_COMPATIBILITY_CLASS_MAP
            );
        }

        return array_flip($backwardsCompatibilityClassMap);
    }
218931
protected function getAvailableDrivers()
    {
        $supportedDrivers = [
            'pdo_mysql' => 'MySQL/MariaDB via PDO',
            'mysqli' => 'MySQL/MariaDB via mysqli',
            'pdo_pgsql' => 'PostgreSQL via PDO'
        ];

        $availableDrivers = [];
        foreach ($supportedDrivers as $driver => $label) {
            if (extension_loaded($driver)) {
                $availableDrivers[$driver] = $label;
            }
        }

        return $availableDrivers;
    }
698866
private function getMap(): array
    {
        $map = $this->map ?? config('transliterate.default_map');
        $lang = $this->lang ?? config('transliterate.default_lang');
        $customMaps = config('transliterate.custom_maps');

        $vendorMapsPath = __DIR__.DIRECTORY_SEPARATOR.'maps'.DIRECTORY_SEPARATOR;
        $path = $customMaps[$lang][$map] ?? $vendorMapsPath.$lang.DIRECTORY_SEPARATOR.$map.'.php';

        if (!file_exists($path)) {
            throw new \InvalidArgumentException("The transliteration map '${path}' doesn't exist");
        }

        /* @noinspection PhpIncludeInspection */
        return require $path;
    }
1047532
protected static function getTypesMap()
    {
        return array_replace([
            self::ID_TYPE_VIN                   => Types\IDEntityVin::class,
            self::ID_TYPE_GRZ                   => Types\IDEntityGrz::class,
            self::ID_TYPE_STS                   => Types\IDEntitySts::class,
            self::ID_TYPE_PTS                   => Types\IDEntityPts::class,
            self::ID_TYPE_BODY                  => Types\IDEntityBody::class,
            self::ID_TYPE_CHASSIS               => Types\IDEntityChassis::class,
            self::ID_TYPE_DRIVER_LICENSE_NUMBER => Types\IDEntityDriverLicenseNumber::class,
        ], static::getExtendedTypesMap());
    }
305684
public static function getAllUidList()
    {
        $data = static::select(array('uid'));
        $uid_map = array();
        foreach ($data as $local_ip => $buffer_array) {
            foreach ($buffer_array as $local_port => $items) {
                //$items = ['connection_id'=>['uid'=>x, 'group'=>[x,x..], 'session'=>[..]], 'client_id'=>[..], ..];
                foreach ($items as $connection_id => $info) {
                    if (!empty($info['uid'])) {
                        $uid_map[$info['uid']] = $info['uid'];
                    }
                }
            }
        }
        return $uid_map;
    }
124564
protected function getGoogleMapsOptions()
    {
        if (isset(Yii::$app->params['googleMapsOptions']) && empty($this->googleMapsOptions)) {
            $this->googleMapsOptions = Yii::$app->params['googleMapsOptions'];
        }

        return ArrayHelper::merge([
            'mapTypeId' => 'roadmap',
            'tilt' => 45,
            'zoom' => 2,
        ], $this->googleMapsOptions);
    }
717372
private function _getKeyIdMap(): array
    {
        // lazily build mapping
        if (!isset($this->_keyIdMap)) {
            $this->_keyIdMap = array();
            foreach ($this->_certs as $cert) {
                $id = self::_getCertKeyId($cert);
                if (!isset($this->_keyIdMap[$id])) {
                    $this->_keyIdMap[$id] = array();
                }
                array_push($this->_keyIdMap[$id], $cert);
            }
        }
        return $this->_keyIdMap;
    }
1068265
public function getSitemapImagesAttribute()
    {
        return $this->images->map(function ($image) {
            return [
                'url' => $image->url,
                'title' => $image->title,
            ];
        })->all();
    }
432919
protected function getMappingData(): array
    {
        $mappings = [];

        foreach ($this->locator->getMappingFiles() as $mappingFile) {
            $mappings[] = $this->loadMappingFile($mappingFile);
        }

        $mappingData = [];
        foreach ($mappings as $mapping) {
            $mappingData = $this->mergeMappings($mappingData, $mapping);
        }

        return $mappingData;
    }
538481
public function getMappedAttributes()
    {
        $mappedArrayForApiRequest = [];
        $requestAttributes = $this->request->getData();
        foreach ($requestAttributes as $key => $value) {
            if (array_key_exists($key, $this->mappingRequestToOtherRequestAttributes)) {
                $mappedArrayForApiRequest[$this->mappingRequestToOtherRequestAttributes[$key]] = $value;
            }
        }

        return $mappedArrayForApiRequest;
    }
1245920
protected function getPublicParams()
    {
        return [
            'AccessKeyId'      => $this->config['accessKeyId'],
            'Timestamp'        => $this->getTimestamp(),
            'Format'           => $this->format,
            'SignatureMethod'  => $this->signatureMethod,
            'SignatureVersion' => '1.0',
            'SignatureNonce'   => uniqid(),
            'Version'          => '2017-05-25',
            'RegionId'         => 'cn-hangzhou',
        ];
    }
1049654
public function getDeviceUUIDs()
    {
        if (!strlen($this->pem)) {
            throw new \RuntimeException("PEM not provided");
        }

        $feedbackURL = "ssl://feedback.push.apple.com:2196";
        if ($this->sandbox) {
            $feedbackURL = "ssl://feedback.sandbox.push.apple.com:2196";
        }
        $data = "";

        $ctx = $this->getStreamContext();
        $fp = stream_socket_client($feedbackURL, $err, $errstr, $this->timeout, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
        if (!$fp) {
            throw new \RuntimeException("Couldn't connect to APNS Feedback service. Error no $err: $errstr");
        }
        while (!feof($fp)) {
            $data .= fread($fp, 4096);
        }
        fclose($fp);
        if (!strlen($data)) {
            return array();
        }

        $feedbacks = array();
        $items = str_split($data, 38);
        foreach ($items as $item) {
            $feedback = new Feedback();
            $feedbacks[] = $feedback->unpack($item);
        }

        return $feedbacks;
    }
831609
private function getCpu(): array
	{
		$result = [];
		$cpuInfo = $this->readFile('/proc/cpuinfo');
		if ($cpuInfo) {
			$processors = preg_split('/\s?\n\s?\n/', trim($cpuInfo));
			$procname = null;
			foreach ($processors as $processor) {
				$cpu = new Obj;
				$proc = null;
				$arch = null;
				$details = preg_split("/\n/", $processor, -1, PREG_SPLIT_NO_EMPTY);
				foreach ($details as $detail) {
					$arrBuff = preg_split('/\s*:\s*/', trim($detail));
					if (count($arrBuff) == 2) {
						switch (strtolower($arrBuff[0])) {
							case 'processor':
								$proc = trim($arrBuff[1]);
								if (is_numeric($proc)) {
									if ($procname !== null && strlen($procname) > 0) {
										$cpu->model = $procname;
									}
								} else {
									$procname = $proc;
									$cpu->model = $procname;
								}
								break;
							case 'model name':
							case 'cpu model':
							case 'cpu type':
							case 'cpu':
								$cpu->model = $arrBuff[1];
								break;
							case 'cpu mhz':
							case 'clock':
								if ($arrBuff[1] > 0) { //openSUSE fix
									$cpu->speed = $arrBuff[1] * 1000 * 1000;
								}
								break;
							case 'cycle frequency [hz]':
								$cpu->speed = $arrBuff[1] * 1000 * 1000;
								break;
							case 'cpu0clktck':
								$cpu->speed = hexdec($arrBuff[1] * 1000 * 1000);
								break;
							case 'l2 cache':
							case 'cache size':
								$cpu->cache = ((float) preg_replace("/[a-zA-Z]/", "", $arrBuff[1])) * 1024;
								break;
							case 'initial bogomips':
							case 'bogomips':
							case 'cpu0bogo':
								$cpu->bogomips = $arrBuff[1];
								break;
							case 'i size':
							case 'd size':
								if ($cpu->cache === null) {
									$cpu->cache = $arrBuff[1] * 1024;
								} else {
									$cpu->cache = $cpu->cache + ($arrBuff[1] * 1024);
								}
								break;
							case 'cpu architecture':
								$arch = trim($arrBuff[1]);
								break;
						}
					}
				}

				// sparc64 specific code follows
				// This adds the ability to display the cache that a CPU has
				// Originally made by Sven Blumenstein <bazik@gentoo.org> in 2004
				// Modified by Tom Weustink <freshy98@gmx.net> in 2004
				$sparclist = array('SUNW,UltraSPARC@0,0', 'SUNW,UltraSPARC-II@0,0', 'SUNW,UltraSPARC@1c,0', 'SUNW,UltraSPARC-IIi@1c,0', 'SUNW,UltraSPARC-II@1c,0', 'SUNW,UltraSPARC-IIe@0,0');
				foreach ($sparclist as $name) {
					$str = $this->readFile('/proc/openprom/' . $name . '/ecache-size');
					if ($str) {
						$cpu->cache = base_convert($str, 16, 10);
					}
				}

				// sparc64 specific code ends
				// XScale detection code
				if (($arch === "5TE") && ($cpu->bogomips != null)) {
					$cpu->speed = $cpu->bogomips; //BogoMIPS are not BogoMIPS on this CPU, it's the speed
					$cpu->bogomips = null; // no BogoMIPS available, unset previously set BogoMIPS
				}

				if ($proc != null) {
					if (!is_numeric($proc)) {
						$proc = 0;
					}
					// variable speed processors specific code follows
					if ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/cpuinfo_cur_freq')) {
						$cpu->speed = ((float) $str) * 1000;
					} elseif ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/scaling_cur_freq')) {
						$cpu->speed = ((float) $str) * 1000;
					}
					if ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/cpuinfo_max_freq')) {
						$cpu->speedMax = ((float) $str) * 1000;
					}
					if ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/cpuinfo_min_freq')) {
						$cpu->speedMin = ((float) $str) * 1000;
					}
					if ($str = $this->readFile('/proc/acpi/thermal_zone/THRM/temperature')) {
						$cpu->temperature = substr($str, 25, 2);
					}
				}

				$cpu->usage = null;
				$result[] = $cpu;
			}


			// CPU usage
			$command = "grep 'cpu' /proc/stat";
			$cpuStats1 = $this->readCommandAsArray($command, "\n");
			sleep(1);
			$cpuStats2 = $this->readCommandAsArray($command, "\n");

			$counter = 0;
			for ($i = 0; $i < count($cpuStats1); $i++) {
				if (preg_match('/cpu[0-9]{1,2}/', $cpuStats1[$i]) > 0) {
					$stats1 = explode(' ', $cpuStats1[$i]);
					$stats2 = explode(' ', $cpuStats2[$i]);

					$prevIdle = $stats1[4] + $stats1[5];
					$idle = $stats2[4] + $stats2[5];
					$prevNonIdle = $stats1[1] + $stats1[2] + $stats1[3] + $stats1[6] + $stats1[7] + $stats1[8];
					$nonIdle = $stats2[1] + $stats2[2] + $stats2[3] + $stats2[6] + $stats2[7] + $stats2[8];
					$prevTotal = $prevIdle + $prevNonIdle;
					$total = $idle + $nonIdle;

					$result[$counter++]->usage = (float) (($total - $prevTotal) - ($idle - $prevIdle)) / ($total - $prevTotal) * 100;
				}
			}
		}
		return $result;
	}