Return an array of objects from a Feathers service call.
485072
function extractAllItems (result) {
  if (!result) return null;

  if (!Array.isArray(result)) result = ('data' in result) ? result.data : result;
  if (!result) return null;
  
  if (!Array.isArray(result)) result = [result];

  return result;
}
644469
function get_objects($sql, $class_name = 'stdClass', array $params = null, $index = null)
	{
		$result = array();
		$recset = $this->query($sql, MYSQLI_USE_RESULT);
		if (isset($index))
		{
			if (is_null($params))
				while ($obj = $recset->fetch_object($class_name))
					$result[$obj->$index] = $obj;
			else
				while ($obj = $recset->fetch_object($class_name, $params))
					$result[$obj->$index] = $obj;
		}
		else
		{
			if (is_null($params))
				while ($obj = $recset->fetch_object($class_name))
					$result[] = $obj;
			else
				while ($obj = $recset->fetch_object($class_name, $params))
					$result[] = $obj;
		}
		$recset->free_result();
		return $result;
	}
715515
def get_array(array, **kw):
    
    for name, value in kw.items():
        array = array[array[name] == value]
    return array
1337402
public static service[] get(nitro_service service) throws Exception{
		service obj = new service();
		service[] response = (service[])obj.get_resources(service);
		return response;
	}
435424
def get_tones(self):
        '''
            
        '''
        result = self.api_call('tone/')
        tones_json = json.loads(result.content)
        tones = [Tone(name=tone_json["tone"]["name"],
                      description=tone_json["tone"]["description"])
                 for tone_json in tones_json["objects"]]
        return tones
1151708
def all(self, res):
        ""
        B = get_backend()
        return B.get_objects(B.get_concrete(res))
645149
def list(self, service_name, **params):
        
        result = self._invoke_call(service_name, 'list', **params)
        if result is not None:
            return result.get(service_name, list())
        return list()
998425
def _build_jss_object_list(self, response, obj_class):
        """"""
        response_objects = [item for item in response
                            if item is not None and
                            item.tag != "size"]
        objects = [
            JSSListData(obj_class, {i.tag: i.text for i in response_object},
                        self) for response_object in response_objects]

        return JSSObjectList(self, obj_class, objects)
650159
def get(self, objectType, *args, **coolArgs) :
		""""""
		
		ret = []
		for e in self._makeLoadQuery(objectType, *args, **coolArgs).iterRun() :
			if issubclass(objectType, pyGenoRabaObjectWrapper) :
				ret.append(objectType(wrapped_object_and_bag = (e, self.bagKey)))
			else :
				ret.append(e)

		return ret
752242
def _extract_models(cls, apis):
        ''''''
        # TODO: This would probably be much better if the info would be
        # extracted from the classes, rather than from the swagger
        # representation...
        models = set()
        for api in apis:
            for op in api.get('operations', []):
                models.add(op['type'])
                for param in op.get('parameters', []):
                    models.add(param.get('type', 'void'))
                for msg in op['responseMessages']:
                    models.add(msg.get('responseModel', 'void'))
        # Convert from swagger name representation to classes
        models = map(lambda m: Model.name_to_cls[m], models)
        ret = {}
        for model in models:
            if model.native_type:
                continue
            obj = model.schema.copy()
            obj['id'] = model.name
            ret[model.name] = obj
        return ret
115451
function getResults(result, objects) {
		
		// if there are no results, resolve an empty array
		if (!result) {
			return new Promise(function(resolve, reject) {
				resolve([]);
			});
		}
		
		// if the result object is undefined or not an array, make it one
		result.objects = result.objects || [];
		result.objects = Array.isArray(result.objects) ? result.objects : [result.objects];
		objects        = _.union(objects, result.objects);
		
		// if the result has a token, there are more results, continue to get them
		if (result.token) {
			return _client.method('ContinueRetrievePropertiesEx', {
				_this: _client._sc.propertyCollector,
				token: result.token
			})
			.then(function(results) {
				return getResults(results, objects);
			});
		}
		
		// if there are no more results, return the formatted results
		else {
			return new Promise(function(resolve, reject) {
				resolve(env.format(objects));
			});
		}
	}
644250
def fetch(services)
      unless [String, Array].include?(services.class)
        raise ArgumentError, "Service(s) argument required"
      end
      
      results = {}
      names   = [services].flatten
      
      if names.empty?
        raise ArgumentError, "Service(s) argument required"
      end
      
      names.each do |service|
        begin
          connection.send_data("fetch #{service}")
          lines = connection.read_packet
          results[service] =  parse_fetch(lines)
        rescue UnknownService, BadExit
          # TODO
        end
      end
      results
    end
931527
function ( obj ) {
		var indexed = [];

		utility.iterate( obj, function ( v ) {
			indexed.push( v );
		});

		return indexed;
	}
1225913
def get_objects(self):
        """"""
        return rope.base.oi.soi.get_passed_objects(
            self.pyfunction, self.index)
190865
def get_services(self):
        """"""
        self.request(EP_GET_SERVICES)
        return {} if self.last_response is None else self.last_response.get('payload').get('services')
747483
function array(obj) {
  if ('array' === type(obj)) return obj;
  if ('arguments' === type(obj)) return Array.prototype.slice.call(obj, 0);

  return obj  // Only transform objects in to an array when they exist.
    ? [obj]
    : [];
}
390097
def GetServices(self,filename):
        """"""
        objlist=[]
        for sobj in self.services:
            if sobj.KnowsFile(filename) :
                objlist.append(sobj)

        if len(objlist)==0:
            return None

        return objlist