GET /families
 GET /families.json
509860
def index
      @index_action = true
      @families = Family.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @families }
      end
    end
1030926
def table_api_get(self, *paths, **kparams):
        
        url = self.flattened_params_url("/api/now/v1/table", *paths, **kparams)
        rjson = self.req("get", url).text
        return json.loads(rjson)
1003842
def vm2json(vm):
    
    d = {"name": "root", "children": []}

    for _class in vm.get_classes():
        c_class = {"name": _class.get_name(), "children": []}

        for method in _class.get_methods():
            c_method = {"name": method.get_name(), "children": []}

            c_class["children"].append(c_method)

        d["children"].append(c_class)

    return json.dumps(d)
249137
function loadAll() {
      var repos = [
        {
          'name'      : 'AngularJS',
          'url'       : 'https://github.com/angular/angular.js',
          'watchers'  : '3,623',
          'forks'     : '16,175',
        },
        {
          'name'      : 'Angular',
          'url'       : 'https://github.com/angular/angular',
          'watchers'  : '469',
          'forks'     : '760',
        },
        {
          'name'      : 'AngularJS Material',
          'url'       : 'https://github.com/angular/material',
          'watchers'  : '727',
          'forks'     : '1,241',
        },
        {
          'name'      : 'Angular Material',
          'url'       : 'https://github.com/angular/material2',
          'watchers'  : '727',
          'forks'     : '1,241',
        },
        {
          'name'      : 'Bower Material',
          'url'       : 'https://github.com/angular/bower-material',
          'watchers'  : '42',
          'forks'     : '84',
        },
        {
          'name'      : 'Material Start',
          'url'       : 'https://github.com/angular/material-start',
          'watchers'  : '81',
          'forks'     : '303',
        }
      ];
      return repos.map(function (repo) {
        repo.value = repo.name.toLowerCase();
        return repo;
      });
    }
1182284
@Override
    @Path("/{groupName}")
    @ApiOperation(value="Retrieve a workgroup or all workgroups",
        notes="If groupName is not present, returns all workgroups.",
        response=Workgroup.class, responseContainer="List")
    public JSONObject get(String path, Map<String,String> headers)
    throws ServiceException, JSONException {
        UserServices userServices = ServiceLocator.getUserServices();
        try {
            String groupName = getSegment(path, 1);
            if (groupName == null) // check parameter
                groupName = getParameters(headers).get("name");
            if (groupName != null) {
                Workgroup group = userServices.getWorkgroup(groupName);
                if (group == null)
                    throw new ServiceException(ServiceException.NOT_FOUND, "Workgroup not found: " + groupName);
                return group.getJson();
            }
            else {
                return userServices.getWorkgroups().getJson();
            }
        }
        catch (ServiceException ex) {
            throw ex;
        }
        catch (Exception ex) {
            throw new ServiceException(ex.getMessage(), ex);
        }
    }
648563
def family_ids(force_reload=false)
      return @family_ids unless @family_ids.nil? or force_reload
      
      transaction do
        reload_boundaries
        query = "SELECT id FROM #{self.class.quote_db_property(base_class.table_name)} " + 
                "WHERE #{nested_set_column(:left)} >= #{left} AND #{nested_set_column(:right)} <= #{right} " +
                "ORDER BY #{nested_set_column(:left)}"
        @family_ids = base_class.connection.select_values(query).map(&:to_i)
      end
    end
1051761
def _get_content_json(ident_hash=None):
    """"""
    request = get_current_request()
    routing_args = request and request.matchdict or {}
    if not ident_hash:
        ident_hash = routing_args['ident_hash']

    as_collated = asbool(request.GET.get('as_collated', True))
    page_ident_hash = routing_args.get('page_ident_hash', '')
    p_id, p_version = (None, None)
    if page_ident_hash:
        try:
            p_id, p_version = split_ident_hash(page_ident_hash)
        except IdentHashShortId as e:
            p_id = get_uuid(e.id)
            p_version = e.version
        except IdentHashMissingVersion as e:
            # page ident hash doesn't need a version
            p_id = e.id
            p_version = None

    id, version = split_ident_hash(ident_hash, containing=p_id)

    with db_connect() as db_connection:
        with db_connection.cursor() as cursor:
            result = get_content_metadata(id, version, cursor)
            # Build url for canonical link header
            result['canon_url'] = get_canonical_url(result, request)

            if result['mediaType'] == COLLECTION_MIMETYPE:
                # Grab the collection tree.
                result['tree'] = get_tree(ident_hash, cursor,
                                          as_collated=as_collated)
                result['collated'] = as_collated
                if not result['tree']:
                    # If collated tree is not available, get the uncollated
                    # tree.
                    result['tree'] = get_tree(ident_hash, cursor)
                    result['collated'] = False

                if page_ident_hash:
                    for id_ in flatten_tree_to_ident_hashes(result['tree']):
                        id, version = split_ident_hash(id_)
                        if id == p_id and (
                           version == p_version or not p_version):
                            content = None
                            if as_collated:
                                content = get_collated_content(
                                    id_, ident_hash, cursor)
                            if content:
                                result = get_content_metadata(
                                    id, version, cursor)
                                # Build url for canonical link header
                                result['canon_url'] = (
                                        get_canonical_url(result, request))
                                result['content'] = content[:]
                                return result
                            # 302 'cause lack of baked content may be temporary
                            raise httpexceptions.HTTPFound(request.route_path(
                                request.matched_route.name,
                                _query=request.params,
                                ident_hash=join_ident_hash(id, version),
                                ext=routing_args['ext']),
                                headers=[("Cache-Control",
                                          "max-age=60, public")])
                    raise httpexceptions.HTTPNotFound()
            else:
                result = get_content_metadata(id, version, cursor)
                # Build url for canonical link header
                result['canon_url'] = get_canonical_url(result, request)
                # Grab the html content.
                args = dict(id=id, version=result['version'],
                            filename='index.cnxml.html')
                cursor.execute(SQL['get-resource-by-filename'], args)
                try:
                    content = cursor.fetchone()[0]
                except (TypeError, IndexError,):  # None returned
                    logger.debug("module found, but "
                                 "'index.cnxml.html' is missing.")
                    raise httpexceptions.HTTPNotFound()
                result['content'] = content[:]

    return result
614146
def get(self, client_id=None, email_address=None):
        """"""
        params = {"email": email_address or self.email_address}
        response = self._get("/clients/%s/people.json" %
                             (client_id or self.client_id), params=params)
        return json_to_py(response)
5768
function tree() {
            var result = {
                name: 'root',
                children: []
            }

            function _parseChildren(parentClientId, children) {
                Util.each(CACHE, function(item) {
                    if (item.parentClientId === parentClientId) {
                        children.push({
                            name: item.moduleId + ',' + item.clientId,
                            module: item,
                            children: _parseChildren(item.clientId, [])
                        })
                    }
                })
                return children
            }

            _parseChildren(Constant.ROOT_CLIENT_ID, result.children)

            return result
        }
491760
def get_hw_family(self, version_text):
        """"""
        family = None
        if version_text is None:
            return family

        match = re.search(self.platform_re, version_text, re.MULTILINE)
        if match:
            self.platform_string = match.group()
            self.log("Platform string: {}".format(match.group()))
            self.raw_family = match.group(1)
            # sort keys on len reversed (longest first)
            for key in sorted(self.families, key=len, reverse=True):
                if self.raw_family.startswith(key):
                    family = self.families[key]
                    break
            else:
                self.log("Platform {} not supported".format(family))
        else:
            self.log("Platform string not present. Refer to CSCux08958")
        return family
421033
def document
      json = Net::HTTP.get_response URI.parse(query_string(@query))
      json.body
    end
375861
def get_families_by_ids(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_by_ids
        catalogs = self._get_provider_session('family_lookup_session').get_families_by_ids(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Family(self._provider_manager, cat, self._runtime, self._proxy))
        return FamilyList(cat_list)
1167067
def export_as_json(self):
        
        result = {
            "subscription": self.subscription,
        }

        if self.name:
            result["name"] = self.name

        if self.ask is not None:
            result["ask"] = self.ask

        if self.approved:
            result["approved"] = self.approved

        if self.groups:
            result["groups"] = sorted(self.groups)

        return result
714817
def _get_resource(self, relative_url, params=None):
        
        response = self._get(relative_url, params=params, raise_for_status=False)
        if response.status_code == 404:
            return None
        self._raise_for_status(response)
        return response.json()
650235
def get_families(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.FamilyList(self._results, runtime=self._runtime)
767486
function applyGetters (self, json, type, options) {
  var schema = self.schema
    , paths = Object.keys(schema[type])
    , i = paths.length
    , path;


  while (i--) {
    path = paths[i];
    json[path] = clone(self.get(path), options);
  }

  return json;
}
627447
def get_my_drive
      url = base_api_url + "/me/drive"
      @my_drive = JSON.parse(HTTParty.get(url,headers: set_headers).body)
    end