Get the item listing in a given folder in the Mxit user's gallery
        User authentication required with the following scope: 'content/read'
323453
def get_gallery_item_list(self, folder_name, skip=None, count=None, scope='content/read'):
        

        params = {}
        if skip:
            params['skip'] = skip
        if count:
            params['count'] = count

        qs = '?' + urllib.urlencode(params) if params else ''

        folder_item_list = _get(
            token=self.oauth.get_user_token(scope),
            uri='/user/media/list/' + urllib.quote(folder_name) + qs
        )
        try:
            return json.loads(folder_item_list)
        except:
            raise MxitAPIException('Error parsing gallery folder list')
1311078
def get_asset_content_lookup_session(self, proxy):
        """"""
        return getattr(sessions, 'AssetContentLookupSession')(
            provider_session=self._provider_manager.get_asset_content_lookup_session(proxy),
            authz_session=self._get_authz_session(),
            proxy=proxy)
1043741
def _item_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = []
    for item in kstone.items.list():
        ret.append(item.__dict__)
        # ret[item.name] = {
        #         'id': item.id,
        #         'name': item.name,
        #         }
    return ret
309170
function systemListing($mask, $directory, $key = 'name', $min_depth = 1) {
    $files = array();
    foreach (\Drupal::moduleHandler()->getModuleList() as $name => $module) {
      $files += file_scan_directory($module->getPath(), $mask, array('key' => $key));
    }
    return $files;
  }
505960
def listdir(self, folder_id='0', offset=None, limit=None, fields=None):
		''
		if fields is not None\
			and not isinstance(fields, types.StringTypes): fields = ','.join(fields)
		return self(
			join('folders', folder_id, 'items'),
			dict(offset=offset, limit=limit, fields=fields) )
15242
function _browseDir (dir, fileList) {
  fileList || (fileList = [])

  try {
    fs.readdirSync(dir)
      .map(item => _buildFullPath(dir, item))
      .map(item => _addFileOrContinueBrowsing(item, fileList))
  } catch (e) {
    throw new Error(e.message)
  }

  return fileList
}
521571
async function viaContentsApi(identifier, dir, token) {
	const files = [];
	const requests = [];
	const {repo, ref} = parseIdentifier(identifier);
	const contents = await api(`${repo}/contents/${dir}?ref=${ref}`, token);
	for (const item of contents) {
		if (item.type === 'file') {
			files.push(item.path);
		} else if (item.type === 'dir') {
			requests.push(viaContentsApi(repo, item.path, token));
		}
	}
	return files.concat(...await Promise.all(requests));
}
353148
def database_list_folder(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/listFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
1058263
def get(context, request, username=None):
    
    user_ids = []

    # Don't allow anonymous users to query a user other than themselves
    if api.is_anonymous():
        username = "current"

    # query all users if no username was given
    if username is None:
        user_ids = api.get_member_ids()
    elif username == "current":
        current_user = api.get_current_user()
        user_ids = [current_user.getId()]
    else:
        user_ids = [username]

    # Prepare batch
    size = req.get_batch_size()
    start = req.get_batch_start()
    batch = api.make_batch(user_ids, size, start)

    # get the user info for the user ids in the current batch
    users = map(get_user_info, batch.get_batch())

    return {
        "pagesize": batch.get_pagesize(),
        "next": batch.make_next_url(),
        "previous": batch.make_prev_url(),
        "page": batch.get_pagenumber(),
        "pages": batch.get_numpages(),
        "count": batch.get_sequence_length(),
        "items": users,
    }
1129343
function readGetItemData(message, tokens) {
	message.itemNames = [];
	for (var i = 0; i < tokens.length; i = i + 2) {
		message.itemNames.push(protocol.decodeString(tokens[i + 1]));
	}
}
144954
def itemInfoUpload(self, folder, filePath):
        
        files = {}
        url = self._url + "/iteminfo/upload"
        params = {
            "f" : "json",
            "folder" : folder
        }
        files['file'] = filePath
        return self._post(url=url,
                          param_dict=params,
                          files=files,
                          securityHandler=self._securityHandler,
                          proxy_url=self._proxy_url,
                          proxy_port=self._proxy_port)
493073
def get_data(url, gallery_dir):
    """"""

    # shelve keys need to be str in python 2
    if sys.version_info[0] == 2 and isinstance(url, unicode):
        url = url.encode('utf-8')

    cached_file = os.path.join(gallery_dir, 'searchindex')
    search_index = shelve.open(cached_file)
    if url in search_index:
        data = search_index[url]
    else:
        data = _get_data(url)
        search_index[url] = data
    search_index.close()

    return data
621887
def container_list_folder(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/listFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
482541
def visit_folder(self, item, parent):
        
        if item.sent_to_remote:
            self._add_report_item(item.path, item.remote_id)
457212
def get_item(self, path):
        
        if self.source_folder:
            item_path = '%s/%s/%s' % (
                    current_app.static_folder,
                    self.source_folder,
                    path.strip('/')
                )
        else:
            item_path = '%s/%s' % (
                    current_app.static_folder,
                    path.strip('/')
                )

        if os.path.isfile(item_path):
            try:
                return Image.open(item_path)
            except IOError as err:
                LOGGER.warning('File not found on path "%s" with error: %s' % (item_path, str(err)))
                return False
        else:
            return False
802169
function readdir(fullpath, cb) {
    get(self.endpoint + '/contents' + fullpath + self.refparam, cb);
  }
625402
def folderitem(self, obj, item, index):
        

        obj = obj.getObject()
        # Group items by RefSample - Worksheet - Position
        ws = obj.getWorksheet()
        wsid = ws and ws.id or ''
        wshref = ws.absolute_url() or None
        if wshref:
            item['replace']['Worksheet'] = "<a href='%s'>%s</a>" % (
                wshref, wsid)

        imgtype = ""
        if obj.portal_type == 'ReferenceAnalysis':
            antype = QCANALYSIS_TYPES.getValue(obj.getReferenceType())
            if obj.getReferenceType() == 'c':
                imgtype = "<img title='%s' " \
                          "src='%s/++resource++bika.lims.images/control.png" \
                          "'/>&nbsp;" % (
                              antype, self.context.absolute_url())
            if obj.getReferenceType() == 'b':
                imgtype = "<img title='%s' " \
                          "src='%s/++resource++bika.lims.images/blank.png" \
                          "'/>&nbsp;" % (
                              antype, self.context.absolute_url())
            item['replace']['Partition'] = "<a href='%s'>%s</a>" % (
                obj.aq_parent.absolute_url(), obj.aq_parent.id)
        elif obj.portal_type == 'DuplicateAnalysis':
            antype = QCANALYSIS_TYPES.getValue('d')
            imgtype = "<img title='%s' " \
                      "src='%s/++resource++bika.lims.images/duplicate.png" \
                      "'/>&nbsp;" % (
                          antype, self.context.absolute_url())
            item['sortcode'] = '%s_%s' % (obj.getRequestID(), obj.getKeyword())

        item['before']['Service'] = imgtype
        item['sortcode'] = '%s_%s' % (obj.getReferenceAnalysesGroupID(),
                                      obj.getKeyword())
        return item