Returns SEO data as defined in in seo.json
434866
def seo_data
      if @seo_data.nil?
        Rails.configuration.seo.each do |key, value|
          regex = Regexp.new(value["regex"]).match(request.path)

          unless regex.nil?
            data = Rails.configuration.seo[key]
            fallback = data["parent"].blank? ? seo_default : seo_default.merge(Rails.configuration.seo[data["parent"]])

            unless data["model"].blank?
              response = seo_dynamic(data["model"], regex[1..(regex.size - 1)])
              data = response.nil? ? {} : response
            end

            @seo_data = fallback.merge(data)
          end
        end
      end

      @seo_data ||= seo_default
    end
1188430
def get_content_json(request):
    """"""
    result = _get_content_json()

    resp = request.response
    resp.status = "200 OK"
    resp.content_type = 'application/json'
    resp.body = json.dumps(result)
    return result, resp
1028870
function(_data){
                var _result = {};
                _data = _data||_o;
                _result.origin = _data.origin||'';
                _result.ref  = location.href;
                _result.self = _data.source;
                _result.data = JSON.stringify(_data.data);
                return _key+_u._$object2string(_result,'|',!0);
            }
809140
def info(self, name):
        """"""
        r = requests.get('{}/{}'.format(self.url_service, name))
        return r.json()
721315
function(request) {
  var options = {};

  if (request.getQueryParameters()) {
    options.query = request.getQueryParameters();
  }

  if (
    request.getHeaders() &&
    request.getHeaders()['Content-Type'] === 'application/json'
  ) {
    options.data = JSON.stringify(request.getBodyParameters());
  } else if (request.getBodyParameters()) {
    options.data = request.getBodyParameters();
  }

  if (request.getHeaders()) {
    options.headers = request.getHeaders();
  }
  return options;
}
4589
def google_get_data(self, config, response):
        """"""
        params = {
            'access_token': response['access_token'],
        }
        payload = urlencode(params)
        url = self.google_api_url + 'userinfo?' + payload
        req = Request(url)
        json_str = urlopen(req).read()
        return json.loads(json_str.decode('utf-8'))
40148
def data(self, key=None, **kwargs):
        """"""
        self.content_data.update(kwargs)
        if key:
            return self.content_data[key]
        if not kwargs:
            return self.content_data
        return self
1230971
function getData(queryString, obj) {
  return queryString.split('.').reduce(function(prev, curr) {
    return prev ? prev[curr] : undefined
  }, obj);
}
409470
def get_frontend_data_dict_for_plugin(request, plugin, editable):
    
    json_data = {}
    instance, plugin = plugin.get_plugin_instance()

    if not instance:
        return json_data

    renderer = renderer_pool.renderer_for_plugin(plugin)
    if renderer:
        json_data = renderer.render(request=request, plugin=plugin, instance=instance, editable=editable)

    if hasattr(plugin, 'parse_child_plugins') and plugin.parse_child_plugins:
        children = []
        for child_plugin in instance.get_children().order_by(settings.DJANGOCMS_SPA_PLUGIN_ORDER_FIELD):
            # Parse all children
            children.append(
                get_frontend_data_dict_for_plugin(
                    request=request,
                    plugin=child_plugin,
                    editable=editable
                )
            )

        if children:
            json_data['plugins'] = children

    return json_data
1010857
def get(url):
    """"""
    response = urllib.request.urlopen(url)
    data = response.read()
    data = data.decode("utf-8")
    data = json.loads(data)
    return data
1279513
def _get(url, params=None):
        """"""
        try:
            response = requests.get(url, params=params)
            response.raise_for_status()
            # If JSON fails, return raw data
            # (e.g. when downloading CSV job logs).
            try:
                return response.json()
            except ValueError:
                return response.text
        except NameError:
            url = '{0}?{1}'.format(url, urllib.urlencode(params))
            return json.loads(urllib2.urlopen(url).read().decode(ENCODING))
734540
def json_paginate(self, base_url, page_number):
        
        data = self.page(page_number)
        first_id = None
        last_id = None
        if data:
            first_id = data[0].id
            last_id = data[-1].id
        return {
            'meta': {
                'total_pages': self.max_pages,
                'first_id': first_id,
                'last_id': last_id,
                'current_page': page_number
            },
            'data': self.page(page_number),
            'links': self.links(base_url, page_number)
        }
859323
def media(request):
    """"""
    return {
        'PAGES_MEDIA_URL': settings.PAGES_MEDIA_URL,
        'PAGES_STATIC_URL': settings.PAGES_STATIC_URL,
        'PAGE_USE_SITE_ID': settings.PAGE_USE_SITE_ID,
        'PAGE_HIDE_SITES': settings.PAGE_HIDE_SITES,
        'PAGE_LANGUAGES': settings.PAGE_LANGUAGES,
    }
304173
def getPageInfo(self, comic, url):
        """"""
        comicData = self.getComicData(comic)
        if url not in comicData['pages']:
            comicData['pages'][url] = {'images':{}}
        return comicData['pages'][url]
989931
def json_data(self, name, default=None):
        
        value = self.get(name)
        if value is Missing.Value:
            return default
        return value
341387
def as_json(self):
        # type: () -> dict
        """"""
        self._config['applyCss'] = self.applyCss
        self._json['config'] = self._config
        return self._json
1139487
def get_json(identifier, namespace='cid', domain='compound', operation=None, searchtype=None, **kwargs):
    """"""
    try:
        return json.loads(get(identifier, namespace, domain, operation, 'JSON', searchtype, **kwargs).decode())
    except NotFoundError as e:
        log.info(e)
        return None