find the location according location id (prioritary) or location name
        :param loc_id: the location id
        :param loc_name: the location name
        :return: found location or None if not found
438155
def find_location(loc_id=None, loc_name=None):
        
        LOGGER.debug("LocationService.find_location")
        if (loc_id is None or not loc_id) and (loc_name is None or not loc_name):
            raise exceptions.ArianeCallParametersError('id and name')

        if (loc_id is not None and loc_id) and (loc_name is not None and loc_name):
            LOGGER.warn('LocationService.find_location - Both id and name are defined. Will give you search on id.')
            loc_name = None

        params = None
        if loc_id is not None and loc_id:
            params = {'id': loc_id}
        elif loc_name is not None and loc_name:
            params = {'name': loc_name}

        ret = None
        if params is not None:
            args = {'http_operation': 'GET', 'operation_path': 'get', 'parameters': params}
            response = LocationService.requester.call(args)
            if response.rc == 0:
                ret = Location.json_2_location(response.response_content)
            elif response.rc != 404:
                err_msg = 'LocationService.find_location - Problem while finding location (id:' + str(loc_id) + \
                          ', name:' + str(loc_name) + '). ' \
                          'Reason: ' + str(response.response_content) + '-' + str(response.error_message) + \
                          " (" + str(response.rc) + ")"
                LOGGER.warning(err_msg)

        return ret
941215
def location_query(self):
        
        value = []
        for option in self.options:
            if option.number == defines.OptionRegistry.LOCATION_QUERY.number:
                value.append(option.value)
        return value
1372894
function getLocation(template, loc){
  if (loc)
    return (template.sourceUrl || '') + ':' + loc.start.line + ':' + (loc.start.column + 1);
}
1238517
public final void setLocation(String loc) {
        if (location == null && loc == null) {
            // no unnecessary property creation if everything is null
            return;
        }
        locationProperty().set(loc);
    }
709635
def get_location(self, location, depth=0):
        
        if not location:
            return []
        if location in self.aliases:
            res = []
            if depth > MAXALIASDEPTH:
                err_exit('Maximum alias depth exceeded: %(location)s' % locals())
            for loc in self.aliases[location]:
                res.extend(self.get_location(loc, depth+1))
            return res
        if self.is_server(location):
            return [location]
        if location == 'pypi':
            err_exit('No configuration found for server: pypi\n'
                     'Please create a ~/.pypirc file')
        if self.urlparser.is_url(location):
            return [location]
        if not self.has_host(location) and self.distbase:
            return [self.join(self.distbase, location)]
        return [location]
498220
def setCenter(self, loc):
        
        offset = self.getCenter().getOffset(loc) # Calculate offset from current center
        return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset
23735
def get_id(name=None, tags=None, region=None, key=None,
           keyid=None, profile=None, in_states=None, filters=None):

    '''
    

    '''
    instance_ids = find_instances(name=name, tags=tags, region=region, key=key,
                                  keyid=keyid, profile=profile, in_states=in_states,
                                  filters=filters)
    if instance_ids:
        log.info("Instance ids: %s", " ".join(instance_ids))
        if len(instance_ids) == 1:
            return instance_ids[0]
        else:
            raise CommandExecutionError('Found more than one instance '
                                        'matching the criteria.')
    else:
        log.warning('Could not find instance.')
        return None
1003680
def _solve_location_param(self):
        
        params = copy.copy(self.params)
        del params['loc']

        f = lambda location: self.distr_f.ppf(0.5, loc=location, **params) - 1
        return optimize.brentq(f, -10, 10)
828224
def find(self, id, columns=None):
        
        if columns is None:
            columns = ["*"]

        if isinstance(id, list):
            return self.find_many(id, columns)

        self._query.where(self._model.get_qualified_key_name(), "=", id)

        return self.first(columns)
792327
def find(cls, _id):
        

        if not _id:
            return None
        try:
            return next(cls.where(id=_id))
        except StopIteration:
            raise PanoptesAPIException(
                "Could not find {} with id='{}'".format(cls.__name__, _id)
            )
1150595
def _get_id(vpc_name=None, cidr=None, tags=None, region=None, key=None,
            keyid=None, profile=None):
    '''
    
    '''

    if vpc_name and not any((cidr, tags)):
        vpc_id = _cache_id(vpc_name, region=region,
                           key=key, keyid=keyid,
                           profile=profile)
        if vpc_id:
            return vpc_id

    vpc_ids = _find_vpcs(vpc_name=vpc_name, cidr=cidr, tags=tags, region=region,
                         key=key, keyid=keyid, profile=profile)
    if vpc_ids:
        log.debug("Matching VPC: %s", " ".join(vpc_ids))
        if len(vpc_ids) == 1:
            vpc_id = vpc_ids[0]
            if vpc_name:
                _cache_id(vpc_name, vpc_id,
                          region=region, key=key,
                          keyid=keyid, profile=profile)
            return vpc_id
        else:
            raise CommandExecutionError('Found more than one VPC matching the criteria.')
    else:
        log.info('No VPC found.')
        return None
811129
def find(self, location):
        
        try:
            content = self.store[location]
            return StringIO(content)
        except:
            reason = 'location "%s" not in document store' % location
            raise Exception, reason
727706
def find_location(rows, element_to_find):
    ''''''
    for ir, row in enumerate(rows):
        for ic, element in enumerate(row):
            if element == element_to_find:
                return ir, ic
1247818
function (path, loc) {
          // TODO resolve relative to curr path
          path = normalizePath(base, path)

          if (!modules[path]) {
            return {type: 'Error', loc: loc, message: 'Module not found: ' + path}
          }

          var moduleId = nextModuleId()
          myModules[moduleId] = path

          return {
            type: 'Ok',
            value: {
              id: moduleId,
              module: modules[path]
            }
          }
        }
520718
def location(self):
        
        if not hasattr(self, '_loc'):
            self._loc = conf.lib.clang_getCursorLocation(self)

        return self._loc
122388
private static String validLocation(final String loc) throws IOException {
        if (!RsReturn.LOC_PTRN.matcher(loc).matches()) {
            throw new IOException(
                String.format(
                    "Location \"%s\" should complain RFC 3987",
                    loc
                )
            );
        }
        return loc;
    }
375537
def get_one_optional(self, name):
        
        locator = self._locate(name)
        return self._references.get_one_optional(locator) if locator != None else None