as well as smartphone-class devices. Excludes Apple iPads and other modern tablets.
191101
function DetectMobileQuick()
   {
      if ($this->initCompleted == $this->true ||
          $this->isMobilePhone == $this->true)
         return $this->isMobilePhone;

      //Let's exclude tablets
      if ($this->isTierTablet == $this->true) 
         return $this->false;
      
      //Most mobile browsing is done on smartphones
      if ($this->DetectSmartphone() == $this->true) 
         return $this->true;

      //Catch-all for many mobile devices
      if (stripos($this->useragent, $this->mobile) > -1)
         return $this->true; 

      if ($this->DetectOperaMobile() == $this->true)
         return $this->true;

      //We also look for Kindle devices
      if ($this->DetectKindle() == $this->true ||
         $this->DetectAmazonSilk() == $this->true) 
         return $this->true;

      if (($this->DetectWapWml() == $this->true) 
      		|| ($this->DetectMidpCapable() == $this->true)
			|| ($this->DetectBrewDevice() == $this->true))
         return $this->true;
          
      if ((stripos($this->useragent, $this->engineNetfront) > -1)
			|| (stripos($this->useragent, $this->engineUpBrowser) > -1))
         return $this->true; 
         
      return $this->false; 
   }
749942
public com.google.api.ads.admanager.axis.v201808.Technology[] getDeviceManufacturers() {
        return deviceManufacturers;
    }
1369362
def is_device(self):
		

		if self in {type(self).DEVICE_ADDED, type(self).DEVICE_REMOVED}:
			return True
		else:
			return False
806700
public List<String> deviceTypes() {
        Integer count = json().size(DEVICE_FAMILIES);
        List<String> deviceTypes = new ArrayList<String>(count);
        for(int i = 0 ; i < count ; i++) {
            String familyNumber = json().stringValue(DEVICE_FAMILIES, i);
            if(familyNumber.equals("1")) deviceTypes.add("iPhone");
            if(familyNumber.equals("2")) deviceTypes.add("iPad");
        }
        return deviceTypes;
    }
133392
public static function detectDevice(){
		if($_COOKIE['v']=='m'){
			self::$devicetype=DEVICE_TYPE_MPHONE;
			}
		elseif($_COOKIE['v']=='d'){
			self::$devicetype=DEVICE_TYPE_OTHER;
			}
		if(self::$devicetype==DEVICE_TYPE_UNKNOWN){
			self::$devicetype=self::isMobile()?(self::isTablet()?DEVICE_TYPE_TABLET:DEVICE_TYPE_MPHONE):DEVICE_TYPE_OTHER;
			}
		if(empty($_COOKIE['v'])){
			if(self::$devicetype==DEVICE_TYPE_MPHONE||self::$devicetype==DEVICE_TYPE_TABLET){
				$v='m';
				}
			elseif(self::$devicetype==DEVICE_TYPE_OTHER){
				$v='d';
				}
			$expire=time()+2592000;//30 days
			setcookie('v',$v,$expire,'/',BHOSTNAME);
			}
		return self::$devicetype;
		}
601104
def filter_by_device_owner(query, device_owners=None):
    
    port_model = models_v2.Port
    if not device_owners:
        device_owners = utils.SUPPORTED_DEVICE_OWNERS
    supported_device_owner_filter = [
        port_model.device_owner.ilike('%s%%' % owner)
        for owner in device_owners]
    unsupported_device_owner_filter = [
        port_model.device_owner.notilike('%s%%' % owner)
        for owner in utils.UNSUPPORTED_DEVICE_OWNERS]
    query = (query
             .filter(
                 and_(*unsupported_device_owner_filter),
                 or_(*supported_device_owner_filter)))
    return query
1307254
def device_filter(self):
        
        if isinstance(self._device_filter, str):
            return self._decode_query(self._device_filter)
        return self._device_filter
960528
def devices(self):
        """"""
        if self._all_devices:
            return self._all_devices

        self._all_devices = {}
        self._all_devices['cameras'] = []
        self._all_devices['base_station'] = []

        url = DEVICES_ENDPOINT
        data = self.query(url)

        for device in data.get('data'):
            name = device.get('deviceName')
            if ((device.get('deviceType') == 'camera' or
                 device.get('deviceType') == 'arloq' or
                 device.get('deviceType') == 'arloqs') and
                    device.get('state') == 'provisioned'):
                camera = ArloCamera(name, device, self)
                self._all_devices['cameras'].append(camera)

            if (device.get('state') == 'provisioned' and
                    (device.get('deviceType') == 'basestation' or
                     device.get('modelId') == 'ABC1000')):
                base = ArloBaseStation(name, device, self.__token, self)
                self._all_devices['base_station'].append(base)

        return self._all_devices
320239
public void setExcludedDeviceCapabilities(com.google.api.ads.admanager.axis.v201805.Technology[] excludedDeviceCapabilities) {
        this.excludedDeviceCapabilities = excludedDeviceCapabilities;
    }
678599
def devices(self):
        
        data = self.query(MyPlexDevice.key)
        return [MyPlexDevice(self, elem) for elem in data]
1034983
def obtain_all_devices(my_devices):
    """"""
    new_devices = {}
    for device_name, device_or_group in my_devices.items():
        # Skip any groups
        if not isinstance(device_or_group, list):
            new_devices[device_name] = device_or_group
    return new_devices
601039
def devices
      response = get('/listDevices')
      devices = []
      response.body['devices'].each do |d|
        devices << Device.from_json(d, @token, @logger)
      end
      devices
    end
38207
public com.google.api.ads.admanager.axis.v201902.Technology[] getExcludedDeviceCapabilities() {
        return excludedDeviceCapabilities;
    }
249487
def devices(self):
        ''''''
        out = self.run_cmd('devices') #subprocess.check_output([self.adb_path(), 'devices']).decode("utf-8")
        if 'adb server is out of date' in out:
            out = self.run_cmd('devices')
        match = "List of devices attached"
        index = out.find(match)
        if index < 0:
            raise EnvironmentError("adb is not working.")
        return dict(re.findall(r'([^\s]+)\t(\w+)', out))
654350
def get_device_elements(self):
        """"""
        plain = self._aha_request('getdevicelistinfos')
        dom = xml.dom.minidom.parseString(plain)
        _LOGGER.debug(dom)
        return dom.getElementsByTagName("device")
1257469
def devices(self):
        
        devices = []
        count = self.lib.tdGetNumberOfDevices()
        for i in range(count):
            device = DeviceFactory(self.lib.tdGetDeviceId(i), lib=self.lib)
            devices.append(device)
        return devices
350362
function eliminateDuplicates(browsers) {
    var set = {};

    browsers.forEach(function (browser) {
        var osgroup = browser.os;
        var subgroup = browser.long_name;
        var version = browser.short_version;
        var device;
        var browserName;
        if (browser.api_name === "iphone")  {
            osgroup = device = "iPhone Simulator";
        } else if (browser.api_name === "ipad") {
            osgroup = device =  "iPad Simulator";
        } else if (browser.long_name === "Google Chrome") {
            browserName = 'Chrome';
        } else if (browser.long_name === "Microsoft Edge") {
            browserName = 'MicrosoftEdge';
            version = browser.long_version.substr(0, 8);
        } else if (browser.api_name === "android") {
            browserName = 'Android';
            osgroup = "Android " + browser.short_version;
            device = browser.long_name;
            if (subgroup === "Android") {
                subgroup += " " + version + " Emulator";
                device = "Android Emulator";
            }
        } else if (osgroup in OS_ID_TO_GROUPNAME) {
            osgroup = OS_ID_TO_GROUPNAME[osgroup];
        }
        set[JSON.stringify([osgroup, subgroup, version])] = {
            browserName: browserName || browser.long_name,
            platform: OS_ID_TO_GROUPNAME[browser.os] || browser.os,
            version: version,
            deviceName: device || browser.device
        };
    });

    var uniques = Object.keys(set).sort().map(function (id) {
        return set[id];
    });
    return uniques;
}