The Search method handles the searching of both local and toll-free
 numbers.
519322
def search(opts={})
      iso_country_code = opts[:iso_country_code] || 'US'
      resource = opts.delete(:resource)

      params = {
        :AreaCode => opts[:area_code],
        :InPostalCode => opts[:postal_code],
        :InRegion => opts[:in_region],
        :Contains => opts[:contains],
        :NearLatLong => opts[:near_lat_long],
        :NearNumber => opts[:near_number],
        :InLata => opts[:in_lata],
        :InRateCenter => opts[:in_rate_center],
        :Distance => opts[:distance],
        :Page => opts[:page],
        :PageSize => opts[:page_size]
      }.reject {|k,v| v == nil} unless opts.empty?
      
      Twilio.get("/AvailablePhoneNumbers/#{iso_country_code}/#{resource}", :query => params)
    end
347223
public function searchByPhone($parameters = [])
    {
        $path = $this->appendParametersToUrl('/v2/phone_search', $parameters);
        $request = $this->getRequest('GET', $path);

        return $this->processRequest($request);
    }
254661
public boolean hasContact(ResidueNumber resNumber1, ResidueNumber resNumber2) {
		return contacts.containsKey(new Pair<ResidueNumber>(resNumber1, resNumber2));
	}
233415
@GET
  @Path(PhoneNumber.PARSE_AND_FORMAT)
  public PhoneNumberDataWithFormats parseAndFormatPhoneNumber(
      @QueryParam(Parameters.LANGUAGE) final String planguage,
      @QueryParam(Parameters.COUNTRY) final String pcountry,
      @QueryParam(Parameters.PHONE_NUMBER) final String pphoneNumber) {
    final PhoneNumberDataWithFormats result = new PhoneNumberDataWithFormats(phoneNumberUtil
        .parsePhoneNumber(pphoneNumber, pcountry, LocaleUtil.convertLanguageToLocale(planguage)));
    result.setCommonInternational(phoneNumberUtil.formatCommonInternational(result));
    result.setCommonNational(phoneNumberUtil.formatCommonNational(result));
    result.setDin5008International(phoneNumberUtil.formatDin5008International(result));
    result.setDin5008National(phoneNumberUtil.formatDin5008National(result));
    result.setE123International(phoneNumberUtil.formatE123International(result));
    result.setE123National(phoneNumberUtil.formatE123National(result));
    result.setMs(phoneNumberUtil.formatMs(result));
    result.setUrl(phoneNumberUtil.formatUrl(result));
    return result;
  }
794339
def _number_type_helper(national_number, metadata):
    """"""
    if not _is_number_matching_desc(national_number, metadata.general_desc):
        return PhoneNumberType.UNKNOWN
    if _is_number_matching_desc(national_number, metadata.premium_rate):
        return PhoneNumberType.PREMIUM_RATE
    if _is_number_matching_desc(national_number, metadata.toll_free):
        return PhoneNumberType.TOLL_FREE
    if _is_number_matching_desc(national_number, metadata.shared_cost):
        return PhoneNumberType.SHARED_COST
    if _is_number_matching_desc(national_number, metadata.voip):
        return PhoneNumberType.VOIP
    if _is_number_matching_desc(national_number, metadata.personal_number):
        return PhoneNumberType.PERSONAL_NUMBER
    if _is_number_matching_desc(national_number, metadata.pager):
        return PhoneNumberType.PAGER
    if _is_number_matching_desc(national_number, metadata.uan):
        return PhoneNumberType.UAN
    if _is_number_matching_desc(national_number, metadata.voicemail):
        return PhoneNumberType.VOICEMAIL

    if _is_number_matching_desc(national_number, metadata.fixed_line):
        if metadata.same_mobile_and_fixed_line_pattern:
            return PhoneNumberType.FIXED_LINE_OR_MOBILE
        elif _is_number_matching_desc(national_number, metadata.mobile):
            return PhoneNumberType.FIXED_LINE_OR_MOBILE
        return PhoneNumberType.FIXED_LINE

    # Otherwise, test to see if the number is mobile. Only do this if certain
    # that the patterns for mobile and fixed line aren't the same.
    if (not metadata.same_mobile_and_fixed_line_pattern and
        _is_number_matching_desc(national_number, metadata.mobile)):
        return PhoneNumberType.MOBILE
    return PhoneNumberType.UNKNOWN
421402
@Override
    public List<PhoneNumber> searchForNumbers(String country, PhoneNumberSearchFilters listFilters) {
        Locale locale = new Locale("en",country);
        String iso3Country = locale.getISO3Country();
        if(logger.isDebugEnabled()) {
            logger.debug("searchPattern " + listFilters.getFilterPattern());
        }

        Client jerseyClient = Client.create();
        jerseyClient.addFilter(new HTTPBasicAuthFilter(username, password));

        WebResource webResource = jerseyClient.resource(searchURI);

        // https://developers.voxbone.com/docs/v3/inventory#path__didgroup.html
        webResource = webResource.queryParam(COUNTRY_CODE_PARAM,iso3Country);
//        Pattern filterPattern = listFilters.getFilterPattern();
//        if(filterPattern != null) {
//            webResource = webResource.queryParam("cityNamePattern" , filterPattern.toString());
//        }
        if(listFilters.getAreaCode() != null) {
            webResource = webResource.queryParam("areaCode", listFilters.getAreaCode());
        }
        if(listFilters.getInRateCenter() != null) {
            webResource = webResource.queryParam("rateCenter", listFilters.getInRateCenter());
        }
        if(listFilters.getSmsEnabled() != null) {
            webResource = webResource.queryParam("featureIds", "6");
        }
        if(listFilters.getFaxEnabled() != null) {
            webResource = webResource.queryParam("featureIds", "25");
        }
        if(listFilters.getRangeIndex() != -1) {
            webResource = webResource.queryParam(PAGE_NUMBER, "" + listFilters.getRangeIndex());
        } else {
            webResource = webResource.queryParam(PAGE_NUMBER, "0");
        }
        if(listFilters.getRangeSize() != -1) {
            webResource = webResource.queryParam(PAGE_SIZE, "" + listFilters.getRangeSize());
        } else {
            webResource = webResource.queryParam(PAGE_SIZE, "50");
        }
        ClientResponse clientResponse = webResource.accept(CONTENT_TYPE).type(CONTENT_TYPE)
                .get(ClientResponse.class);

        String response = clientResponse.getEntity(String.class);
        if(logger.isDebugEnabled())
            logger.debug("response " + response);

        JsonParser parser = new JsonParser();
        JsonObject jsonResponse = parser.parse(response).getAsJsonObject();

//        long count = jsonResponse.getAsJsonPrimitive("count").getAsLong();
//        if(logger.isDebugEnabled()) {
//            logger.debug("Number of numbers found : "+count);
//        }
        JsonArray voxboneNumbers = jsonResponse.getAsJsonArray("didGroups");
        final List<PhoneNumber> numbers = toAvailablePhoneNumbers(voxboneNumbers, listFilters);
        return numbers;
//        } else {
//            logger.warn("Couldn't reach uri for getting Phone Numbers. Response status was: "+response.getStatusLine().getStatusCode());
//        }
//
//        return new ArrayList<PhoneNumber>();
    }
1021587
def search(self, query: Optional[dict] = None, offset: Optional[int] = None,
               limit: Optional[int] = None,
               order_by: Union[None, list, tuple] = None) -> Sequence['IModel']:
        """"""
        raise NotImplementedError
21638
@Override
    protected void searchStep() {
        // get random move
        Move<? super SolutionType> move = getNeighbourhood().getRandomMove(getCurrentSolution(), getRandom());
        // got move ?
        if(move != null){
            // accept if improvement
            if(isImprovement(move)){
                // accept move
                accept(move);
            } else {
                // no improvement
                reject(move);
            }
        } else {
            // no move/neighbour reported by neighbourhood
            stop();
        }
    }
709265
def msearch(self, m, query, fields=None, limit=None, or_=True):
        '''
        
        '''
        ix = self._index(m)
        if fields is None:
            fields = ix.fields
        group = OrGroup if or_ else AndGroup
        parser = MultifieldParser(fields, ix.schema, group=group)
        return ix.search(parser.parse(query), limit=limit)
781347
public final List<PhoneNumberData> getSuggstions(final String psearch, final int plimit) {
    return this.getSuggstions(psearch, plimit, Locale.ROOT);
  }
880063
def checkPhoneDetails(query=None):
    ''' 
         
    '''
    results = []
    
    #TO-DO executing the query against Google and grab the results
    #   The query should be something like "<QUERY> site:infobel.com"
    search = query + " site:infobel.com"    
    
    # This will return a list of i3visio.uri objects
    uriObjects = google.processSearch(search) 
    
    #TO-DO: grabbing the phone details for the QUERY        
    for uri in uriObjects:
        # Recovering the website
        # Accessing the resources
        textResults = processing.getResults(uri["value"])
        # Iterating over every result to process it and recover a person object
        for r in textResults:
            person = {}
            fullname = ""
            person["type"]="i3visio.person"
            person["value"] = "FULLNAME_NOT_FOUND"
            person["attributes"] = processing.extractFieldsFromResult(r)
            
            for entity in person["attributes"]:
                if entity["type"] == "i3visio.fullname":
                    person["value"] = entity["value"]
                    break
            
            # Appending the Uri of the infobel record:
            aux = {}
            aux["type"]= "i3visio.uri"
            aux["value"] = uri["value"]
            aux["attributes"] = []
            person["attributes"].append(aux)            
            
            # Appending the platform of the infobel record:
            aux = {}
            aux["type"]= "i3visio.platform"
            aux["value"] = "Infobel"
            aux["attributes"] = []
            person["attributes"].append(aux)  
                      
            # Appending to the results
            results.append(person)
            
    return results
754905
public Iterable<DUser> queryByPhoneNumber2(java.lang.String phoneNumber2) {
    return queryByField(null, DUserMapper.Field.PHONENUMBER2.getFieldName(), phoneNumber2);
  }
442962
function(options, callback) {
        var that = this;
        var data = that._searchInBbox(options.bbox);
        callback(null, data);
    }
1292654
def search_reduced(self, text=None, lang=None, location=None, unit=None, limit=100, offset=0, local=None,
                       scope=SearchScope.PUBLIC):
        """"""
        return self.search(text, lang, location, unit, limit, offset, reduced=True, local=local, scope=scope)
1034656
private NumberSelectionResult findByNumber(List<String> numberQueries,
            Sid sourceOrganizationSid, Sid destinationOrganizationSid, Set<SearchModifier> modifiers) {
        Boolean orgFiltered = false;
        NumberSelectionResult matchedNumber = new NumberSelectionResult(null, orgFiltered, null);
        int i = 0;
        while (matchedNumber.getNumber() == null && i < numberQueries.size()) {
            matchedNumber = findSingleNumber(numberQueries.get(i),
                    sourceOrganizationSid, destinationOrganizationSid, modifiers);
            //preserve the orgFiltered flag along the queries
            if (matchedNumber.getOrganizationFiltered()) {
                orgFiltered = true;
            }
            i = i + 1;
        }
        matchedNumber.setOrganizationFiltered(orgFiltered);
        return matchedNumber;
    }
1231159
@Override
	public FAXSearchResult search(String corpNum, String sDate, String eDate,
			String[] state, Boolean reserveYN, Boolean senderOnly, int page,
			int perPage, String order) throws PopbillException {
		return search(corpNum, sDate, eDate, state, reserveYN, senderOnly, page, perPage, order, null);
	}
55081
def phone_numbers(self):
        
        if self._phone_numbers is None:
            self._phone_numbers = PhoneNumberList(self)
        return self._phone_numbers