get pin data from API
161635
function(seriesCallback) {
                async.eachLimit(groupedPinIds, 50, function(groupOfPinIds, eachCallback) {
                    var pinIdsString = groupOfPinIds.join(',');
                    getCache(pinIdsString, true, function (cacheData) {
                        if (cacheData === null) {
                            get('http://api.pinterest.com/v3/pidgets/pins/info/?pin_ids=' + pinIdsString, true, function (response) {
                                putCache(pinIdsString, JSON.stringify(response));
                                allPinsData = allPinsData.concat(response.data ? response.data : []);
                                eachCallback();
                                return;
                            });
                        } else {
                            allPinsData = allPinsData.concat(cacheData.data ? cacheData.data : []);
                            eachCallback();
                            return;
                        }
                    });
                }, function (err) {
                    if(err) {
                        throw err;
                    }
                    seriesCallback();
                    return;
                });             
            }
678030
def get_pin_tries(self):
        
        # Verify without PIN gives number of tries left.
        _, sw = self.send_cmd(INS.VERIFY, 0, PIN, check=None)
        return tries_left(sw, self.version)
1087322
def _api_all(self):
        
        response.content_type = 'application/json; charset=utf-8'

        if self.args.debug:
            fname = os.path.join(tempfile.gettempdir(), 'glances-debug.json')
            try:
                with open(fname) as f:
                    return f.read()
            except IOError:
                logger.debug("Debug file (%s) not found" % fname)

        # Update the stat
        self.__update__()

        try:
            # Get the JSON value of the stat ID
            statval = json.dumps(self.stats.getAllAsDict())
        except Exception as e:
            abort(404, "Cannot get stats (%s)" % str(e))

        return statval
789982
def get_clear_pin(pinblock, account_number):
    
    raw_pinblock = bytes.fromhex(pinblock.decode('utf-8'))
    raw_acct_num = bytes.fromhex((b'0000' + account_number).decode('utf-8'))
        
    pin_str = xor(raw2B(raw_pinblock), raw2B(raw_acct_num)).decode('utf-8')
    pin_length = int(pin_str[:2], 16)
    
    if pin_length >= 4 and pin_length < 9:
        pin = pin_str[2:2+pin_length]            
        try:
            int(pin)
        except ValueError:
            raise ValueError('PIN contains non-numeric characters')
        return bytes(pin, 'utf-8')
    else:
        raise ValueError('Incorrect PIN length: {}'.format(pin_length))
362938
def read(self):
        
        if self.mode == UNAVAILABLE:
            raise IOError("Cannot read pin {0}".format(self.__str__()))
        return self.value
505292
public function getPinterestuser()
    {
        $endpoint = 'https://api.pinterest.com/v3/pidgets/users/' . $this->args['query'] . '/pins/';

        $curl = new \Modularity\Helper\Curl();
        $response = $curl->request('GET', $endpoint);

        return json_decode($response)->data->pins;
    }
920912
def parse_pin_name(name)
      components = PIN_NAME_REGEX.match(name)
      return components[1], components[3].to_i, components[4].to_i
    end
355546
def get_post_data(self):
        '''
        
        '''
        post_data = {}
        for key in self.request.arguments:
            post_data[key] = self.get_arguments(key)[0]
        return post_data
462072
def filtered_data(self, pin):
        
        assert pin >= 0 and pin < 12, 'pin must be between 0-11 (inclusive)'
        return self._i2c_retry(self._device.readU16LE, MPR121_FILTDATA_0L + pin*2)
1332758
function ( ) {
			
			if ( '' === _DistanceInput.value ) {
				return ;
			}

			Map.closePopup(); 

			// ... A new pin is created...
			var getPin;
			if ( typeof module !== 'undefined' && module.exports ) {
				getPin = require ('./L.Marker.Pin' );
			}
			else {
				getPin = L.marker.pin;
			}

			var Pins;
			if ( typeof module !== 'undefined' && module.exports ) {
				Pins = require ('./L.Marker.Pin.Pins' );
			}
			else {
				Pins = L.marker.pin.pins ( );
			}

			var draggableIcon = ! Pins.readOnly;

			var Pin = getPin (
				latlng,
				{
					icon : _Categories.getAt ( _CategorySelect.selectedIndex ).CategoryIcon,
					draggable : draggableIcon,
					className : 'Pin',
					title : _Categories.getAt ( _CategorySelect.selectedIndex ).CategoryName,
					phone : _PhoneInput.value,
					url : _UrlInput.value,
					distance : parseFloat ( _DistanceInput.value ),
					//text : _TextInput.value,
					text : _TextArea.value,
					address : _addressInput.value,
					pinCategory : _Categories.getAt ( _CategorySelect.selectedIndex ),
					map : Map,
				}
			);

			if ( options.exist ) {
				// The dialog was open for edition. The old pin is 
				// removed from the map and from the pin's collection
				var pinPosition = Pins.remove ( options.pinObject );
				Map.removeLayer( options.pinObject );
				Pins.push ( Pin, pinPosition );
			}
			else {
				// ... and added to the pin's collection ...
				Pins.push ( Pin );
			}

			// ... a popup and events are added to the pin ...
			Pin.bindPopup ( Pin.getHtml ( ) ).addTo ( Map );
			
			var ContextMenu;
			if ( typeof module !== 'undefined' && module.exports ) {
				ContextMenu = require ('./L.Marker.Pin.ContextMenu' );
			}
			else {
				ContextMenu = L.marker.pin.contextmenu;
			}
			Pin.on ( 'contextmenu', ContextMenu ); 
			Pin.on ( 'dblclick', ContextMenu);
			Pin.on ( 'dragend', Pins.CallbackFunction ); 
			
			/*
			if ( options.exist ) {
				// The dialog was open for edition. The old pin is 
				// removed from the map and from the pin's collection
				var NewPos = Pins.remove ( options.pinObject );
				Map.removeLayer( options.pinObject );
				Pins.order ( OldPos - 1, NewPos, false );
			}
			*/
		}
59671
private Api getApiInternal(String apiOrgId, String apiId, String apiVersion) {
        String key = getApiIndex(apiOrgId, apiId, apiVersion);
        Api api;
        synchronized (mutex) {
            api = (Api) getMap().get(key);
        }
        return api;
    }
809536
def get_pin_codes(self, refresh=False):
        
        if refresh:
            self.refresh()
        val = self.get_value("pincodes")

        # val syntax string: <VERSION=3>next_available_user_code_id\tuser_code_id,active,date_added,date_used,PIN_code,name;\t...
        # See (outdated) http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#DoorLock1

        # Remove the trailing tab
        # ignore the version and next available at the start
        # and split out each set of code attributes
        raw_code_list = []
        try:
            raw_code_list = val.rstrip().split('\t')[1:]
        except Exception as ex:
            logger.error('Got unsupported string {}: {}'.format(val, ex))

        # Loop to create a list of codes
        codes = []
        for code in raw_code_list:

            try:
                # Strip off trailing semicolon
                # Create a list from csv
                code_addrs = code.split(';')[0].split(',')

                # Get the code ID (slot) and see if it should have values
                slot, active = code_addrs[:2]
                if active != '0':
                    # Since it has additional attributes, get the remaining ones
                    _, _, pin, name = code_addrs[2:]
                    # And add them as a tuple to the list
                    codes.append((slot, name, pin))
            except Exception as ex:
                logger.error('Problem parsing pin code string {}: {}'.format(code, ex))
        
        return codes
1141511
def _get_data(self, url, accept=None):
        
        if self.parsed_endpoint.scheme == 'https':
            conn = httplib.HTTPSConnection(self.parsed_endpoint.netloc)
        else:
            conn = httplib.HTTPConnection(self.parsed_endpoint.netloc)
        head = {
            "User-Agent": USER_AGENT,
            API_TOKEN_HEADER_NAME: self.api_token,
        }
        if self.api_version in ['0.1', '0.01a']:
            head[API_VERSION_HEADER_NAME] = self.api_version
        if accept:
            head['Accept'] = accept
        conn.request("GET", url, "", head)
        resp = conn.getresponse()
        self._handle_response_errors('GET', url, resp)
        content_type = resp.getheader('content-type')
        if 'application/json' in content_type:
            return json.loads(resp.read())
        return resp.read()
1371783
function getAPIData(userName, options, callback){

			if(process.env.LANYRD_API_URL)
			{
				var url = process.env.LANYRD_API_URL + 'people/' + userName,
					cache = options.cache,
					startedRequest = new Date(),
					requestObj = {
						uri: url,
						headers: options.httpHeaders
					};

				// if url is in the cache use that
				if(cache && cache.has(url)){
					options.logger.info('using cache for lanyrd API data');
			        callback(null, parse(cache.get(url)));
			    }else{
			     	// if not get the json from the api url  
					request(requestObj, function(requestErrors, response, body){
						options.logger.info('getting lanyrd API data from url');
			          	if(!requestErrors && response.statusCode === 200){
			          		var data = JSON.parse(body)
			            	var out = parse(data);

			            	// add to cache store
				            if(cache){
				              cache.set(url, data);
				            }

		            		var endedRequest = new Date();
	            			var requestTime = endedRequest.getTime() - startedRequest.getTime();
	            			options.logger.log('made API call to: '  + requestTime + 'ms - ' + url);

			            	callback(null, out);
			          	}else{
		            		callback('error requesting Lanyrd API', {});
			          	}
			        });
				}
			}else{
				callback('LANYRD_API_URL not found', {});
			}
		}
1142135
def status_pin(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/statuses/{0}/pin'.format(str(id))
        return self.__api_request('POST', url)
502829
def get_data(self):
        """"""
        url = self.build_url()
        self.locationApiData = requests.get(url)
        if not self.locationApiData.status_code == 200:
            raise self.locationApiData.raise_for_status()
1343723
def api_get(self, action, data, headers=None):
        
        return self._api_request(action, data, 'GET', headers)