Returns select statement with all url and title properties.
559099
private function buildSelectForStructures($locale, $structures, &$names)
    {
        $result = '';
        // add node name and url to selector
        /** @var StructureInterface $structure */
        foreach ($structures as $structure) {
            $result .= $this->buildSelectForStructure($locale, $structure, $names);
        }

        return $result;
    }
468275
def get_url_title(url):
    
    """
    parsed_url = try_parse_url(url)
    if parsed_url is None:
        return None
    try:
        r = requests.get(parsed_url.geturl(), stream=False, allow_redirects=True, timeout=5)
        tree = parse_html(r.content)
        title = tree.findtext('.//title')
        return title
    except ConnectionError:
        logging.error('Unable to connect to internet to retrieve URL {}'.format(parsed_url.geturl()))
        logging.error(format_exc())
    except (InvalidURL, InvalidSchema, InvalidHeader, MissingSchema):
        logging.warn('Unable to retrieve URL {}'.format(parsed_url.geturl()))
        logging.error(format_exc())
933887
def titleForFilepath( url ):
        
        url = nativestring(url)
        if url in XdkEntryItem.TITLE_MAP:
            return XdkEntryItem.TITLE_MAP.get(url)
        
        url      = nativestring(url).replace('\\', '/')
        basename = os.path.basename(url)
        title    = os.path.splitext(basename)[0]
        
        if title == 'index':
            title = url.split('/')[-2]
        
        if title.endswith('-allmembers'):
            title = 'List of All Members for %s' % title.split('-')[-2]
        elif title.endswith('-source'):
            title = 'Source Code for %s' % title.split('-')[-2]
        elif len(nativestring(url).split('/')) <= 2 and title in TITLE_MAP:
            title = TITLE_MAP[title]
        elif not 'api/' in url:
            title = projex.text.pretty(title)
        
        return title
1031852
def _extract_url_and_title(self, text, start):
        """"""
        # text[start] equals the opening parenthesis
        idx = self._whitespace.match(text, start + 1).end()
        if idx == len(text):
            return None, None
        end_idx = idx
        has_anglebrackets = text[idx] == "<"
        if has_anglebrackets:
            end_idx = self._find_balanced(text, end_idx+1, "<", ">")
        end_idx = self._find_balanced(text, end_idx, "(", ")")
        match = self._inline_link_title.search(text, idx, end_idx)
        if not match:
            return None, None
        url = text[idx:match.start()]
        if has_anglebrackets:
            url = self._strip_anglebrackets.sub(r'\1', url)
        return url, end_idx
246313
def getAllIDs(cls, where=None, orderBy=None):
        
        (sql, fields) = cls._prepareSQL("SELECTALL", where,
                                        cls._sqlPrimary, orderBy=orderBy)
        curs = cls.cursor()
        curs.execute(sql)
        # We might start eating memory at this point
        rows = curs.fetchall()
        curs.close()
        result = []
        idPositions = [fields.index(key) for key in cls._sqlPrimary]
        for row in rows:
            ids = [row[pos] for pos in idPositions]
            if len(idPositions) > 1:
                ids = tuple(ids)
            else:
                ids = ids[0]
            result.append((ids))
        return result
1261559
def select_all!(*str_or_rx)
      results = str_or_rx.flatten.map { |v| select_by!(v, :multiple) }
      results.first
    end
1207651
def get_all_fields(obj):
    """"""
    fields = []
    for f in obj._meta.fields:
        fname = f.name

        get_choice = "get_" + fname + "_display"
        if hasattr(obj, get_choice):
            value = getattr(obj, get_choice)()
        else:
            try:
                value = getattr(obj, fname)
            except Exception:
                value = None

        if isinstance(value, list):
            value = ",".join(str(v) for v in value)

        if f.editable and value and f.name:
            fields.append(
                {"label": f.verbose_name, "name": f.name, "value": value}
            )

    return fields
674764
function getEntryURLs(properties, preference = ENTRY_URL_TYPE_ANY) {
    const urlRef = Object.keys(properties)
        .filter(key => URL_PROP.test(key))
        .reduce(
            (output, nextKey) =>
                Object.assign(output, {
                    [nextKey]: properties[nextKey]
                }),
            {}
        );
    if (preference === ENTRY_URL_TYPE_GENERAL || preference === ENTRY_URL_TYPE_LOGIN) {
        return Object.keys(urlRef)
            .sort((a, b) => {
                if (preference === ENTRY_URL_TYPE_GENERAL) {
                    const general = /^ur[li]$/i;
                    const aVal = general.test(a) ? 1 : 0;
                    const bVal = general.test(b) ? 1 : 0;
                    return bVal - aVal;
                } else if (preference === ENTRY_URL_TYPE_LOGIN) {
                    const login = /login/i;
                    const aVal = login.test(a) ? 1 : 0;
                    const bVal = login.test(b) ? 1 : 0;
                    return bVal - aVal;
                }
                return 0;
            })
            .map(key => urlRef[key]);
    } else if (preference === ENTRY_URL_TYPE_ICON) {
        const iconProp = Object.keys(urlRef).find(key => URL_PROP_ICON.test(key));
        return iconProp ? [urlRef[iconProp]] : [];
    }
    // Default is "any" URLs
    return objectValues(urlRef);
}
1088643
def get_sql(self):
        
        sql = ''
        if self.limit and self.limit > 0:
            sql += 'LIMIT {0} '.format(self.limit)
        if self.offset and self.offset > 0:
            sql += 'OFFSET {0} '.format(self.offset)
        return sql
843237
public String getUrl() {
    StringBuilder url = new StringBuilder(100);
    url.append("jdbc:postgresql://");
    url.append(serverName);
    if (portNumber != 0) {
      url.append(":").append(portNumber);
    }
    url.append("/").append(URLCoder.encode(databaseName));

    StringBuilder query = new StringBuilder(100);
    for (PGProperty property : PGProperty.values()) {
      if (property.isPresent(properties)) {
        if (query.length() != 0) {
          query.append("&");
        }
        query.append(property.getName());
        query.append("=");
        query.append(URLCoder.encode(property.get(properties)));
      }
    }

    if (query.length() > 0) {
      url.append("?");
      url.append(query);
    }

    return url.toString();
  }
135972
protected String getQueryString() {
        if (bindings.size() == 0)
            return queryString;
        String qry = queryString;
        int b = qry.indexOf('{');
        String select = qry.substring(0, b);
        String where = qry.substring(b);
        for (String name : bindings.getBindingNames()) {
            String replacement = getReplacement(bindings.getValue(name));
            if (replacement != null) {
                String pattern = "[\\?\\$]" + name + "(?=\\W)";
                select = select.replaceAll(pattern, "");
                where = where.replaceAll(pattern, replacement);
            }
        }
        return select + where;
    }
329319
def get_all_client_properties(self, params=None):
        
        return self._iterate_through_pages(
            get_function=self.get_client_properties_per_page,
            resource=CLIENT_PROPERTIES,
            **{'params': params}
        )
290667
@PROPFIND
    @Consumes({APPLICATION_XML})
    @Produces({APPLICATION_XML})
    @Timed
    public void getProperties(@Suspended final AsyncResponse response, @Context final Request request,
            @Context final UriInfo uriInfo, @Context final HttpHeaders headers, final DavPropFind propfind)
            throws ParserConfigurationException {
        final TrellisRequest req = new TrellisRequest(request, uriInfo, headers);
        final IRI identifier = rdf.createIRI(TRELLIS_DATA_PREFIX + req.getPath());
        final String location = fromUri(getBaseUrl(req)).path(req.getPath()).build().toString();
        final Document doc = getDocument();
        services.getResourceService().get(identifier)
            .thenApply(this::checkResource)
            .thenApply(propertiesToMultiStatus(doc, location, propfind))
            .thenApply(multistatus -> status(MULTI_STATUS).entity(multistatus).build())
            .exceptionally(this::handleException).thenApply(response::resume);
    }
832582
def select_all(*str_or_rx)
      results = str_or_rx.flatten.map { |v| select_all_by v }
      results.first
    end
388188
public DriverPropertyInfo[] getPropertyInfo(String url,
      Properties info)
      throws SQLException {
    if (url != null) {
      UrlParser urlParser = UrlParser.parse(url, info);
      if (urlParser == null || urlParser.getOptions() == null) {
        return new DriverPropertyInfo[0];
      }

      List<DriverPropertyInfo> props = new ArrayList<>();
      for (DefaultOptions o : DefaultOptions.values()) {
        try {
          Field field = Options.class.getField(o.getOptionName());
          Object value = field.get(urlParser.getOptions());
          DriverPropertyInfo propertyInfo = new DriverPropertyInfo(field.getName(),
              value == null ? null : value.toString());
          propertyInfo.description = o.getDescription();
          propertyInfo.required = o.isRequired();
          props.add(propertyInfo);
        } catch (NoSuchFieldException | IllegalAccessException e) {
          //eat error
        }
      }
      return props.toArray(new DriverPropertyInfo[props.size()]);
    }

    return new DriverPropertyInfo[0];
  }
917771
def _querystring(self):
        """"""

        kw = {"studyoid": self.studyoid}
        if self.location_oid is not None:
            kw["locationoid"] = self.location_oid
        return kw
344266
def _select(self, params, handler=None):
        
        # specify json encoding of results
        params['wt'] = 'json'
        custom_handler = handler or self.search_handler
        handler = 'select'
        if custom_handler:
            if self.use_qt_param:
                params['qt'] = custom_handler
            else:
                handler = custom_handler

        params_encoded = safe_urlencode(params, True)

        if len(params_encoded) < 1024:
            # Typical case.
            path = '%s/?%s' % (handler, params_encoded)
            return self._send_request('get', path)
        else:
            # Handles very long queries by submitting as a POST.
            path = '%s/' % handler
            headers = {
                'Content-type': 'application/x-www-form-urlencoded; charset=utf-8',
            }
            return self._send_request('post', path, body=params_encoded, headers=headers)