[getAppsInGenre description]

Pattern: %s/api/getappsingenre/?genre=%s

@param  {[type]}   genre    [description]
@param  {Function} callback [description]
@return {[type]}            [description]
540847
function (genre) {
    return this.get('/getappsingenre', {
      // 'cc': this.options.country,
      // 'l': this.options.language,
     'genre': genre
   }).then(function (body) {
      console.log('getAppsInGenre - ', body)
      return Promise.resolve(body);
    });
  }
1360454
function(f) {
		var isObj = typeof(f) == 'object' ? true : false,
			mime  = isObj ? f.mime : f,
			kind;
		

		if (isObj && f.alias && mime != 'symlink-broken') {
			kind = 'Alias';
		} else if (this.kinds[mime]) {
			if (isObj && mime === 'directory' && (! f.phash || f.isroot)) {
				kind = 'Root';
			} else {
				kind = this.kinds[mime];
			}
		}
		if (! kind) {
			if (mime.indexOf('text') === 0) {
				kind = 'Text';
			} else if (mime.indexOf('image') === 0) {
				kind = 'Image';
			} else if (mime.indexOf('audio') === 0) {
				kind = 'Audio';
			} else if (mime.indexOf('video') === 0) {
				kind = 'Video';
			} else if (mime.indexOf('application') === 0) {
				kind = 'App';
			} else {
				kind = mime;
			}
		}
		
		return this.messages['kind'+kind] ? this.i18n('kind'+kind) : mime;
	}
1147734
function(callback) {
      var t = this,
          dirs = [],
          pages = [],
          thisAppName = UI.Server.currentServer.thisAppName;
      callback = callback || function(){};

      // Synchronize the virtual /app directory
      if (t.get('path') === '/app') {
        for (var appName in UI.Server.currentServer.apps) {
          // Don't add me to the /app directory if I'm an app
          if (appName !== thisAppName) {
            var app = UI.Server.currentServer.apps[appName];
            dirs.push({
              id: appName,
              label: app.label || app.description || appName,
              path: Path.join(app.moduleDir, 'site_db', t.CONST.objectClass)
            });
          }
        }

        // Trim directory branches that have no contents
        t.trimDirs(dirs, function(error, trimmed) {
          if (error) {
            callback(error);
          }
          t.set({
            leaves: pages,
            branches: trimmed
          });
          return callback();
        });
        return;
      }

      // Get the directory at this level
      FS.readdir(t.dirPath, function(error, fileNames) {

        // Process errors
        if (error) {
          console.error('TreeProbe readdir error', error);
          return callback(error);
        }

        // Don't show the main 404 page (it's too confusing)
        if (t.CONST.objectClass === 'Page') {
          fileNames = _.reject(fileNames, function(name){
            return name === '404.json';
          });
        }

        // Perform a stat on all files for meta-info
        t.statFiles(fileNames, function(error, fileStats) {

          // Process errors
          if (error) {
            console.error('TreeProbe statFiles error', error);
            return callback(error);
          }

          // Process each file, recording directories and pages
          for (var i = 0, l = fileStats.length; i < l; i++) {
            var name = fileNames[i],
                stat = fileStats[i],
                id = Path.basename(name, '.json'),
                page = {id:id};

            if (stat.isDirectory()) {
              page.path = Path.join(t.dirPath, name);
              dirs.push(page);
            }
            else if (stat.isFile() && Path.extname(name).toLowerCase() === '.json') {
              pages.push(page);
            }
            else {
              console.error('Not a file or directory: ' + name);
            }
          }

          // Read each page for the display label and description
          t.readPages(pages, function(error) {

            // Process errors
            if (error) {
              console.error('PagesProbe readPages error', error);
              return callback(error);
            }

            // Add the virtual /app directory to the root
            if (t.dirPath === t.rootPath) {
              dirs.push({
                id:'app',
                label: t.CONST.appLabel,
                description: t.CONST.appDescription,
                path: Path.dirname(t.dirPath)
              });
            }

            // Trim directory branches that have no contents
            t.trimDirs(dirs, function(error, trimmed) {
              if (error) {
                callback(error);
              }

              t.set({
                leaves: pages,
                branches: trimmed
              });
              return callback();
            });
          });

        });
      });

    }
505877
def get_genres(self, *args, **kwargs):
        
        args = tuple(['genres'] + list(args))
        return self.get_music_library_information(*args, **kwargs)
926087
function _parse(loc, type, data, callback) {
  // explicit type
  if(type && type !== 'auto') {
    return _typedParse(loc, type, data, callback);
  }
  // typed via text-like extension
  if(loc && (endsWith(loc, '.txt'))) {
    return _typedParse(loc, 'text', data, callback);
  }
  // typed via JSON-like extension
  if(loc && (endsWith(loc, '.json') ||
    endsWith(loc, '.jsonld') ||
    endsWith(loc, '.json-ld'))) {
    return _typedParse(loc, 'json', data, callback);
  }
  // typed via HTML-like extension
  if(loc && (endsWith(loc, '.xml') ||
    endsWith(loc, '.html') ||
    endsWith(loc, '.xhtml'))) {
    return _typedParse(loc, 'html', data, callback);
  }
  // try ~JSON
  _typedParse(loc, 'application/ld+json', data, function(err, data) {
    if(err) {
      // try ~HTML
      return _typedParse(loc, 'text/html', data, function(err, data) {
        if(err) {
          return callback({
            message: 'Unable to auto-detect format.',
            url: loc
          });
        }
        callback(null, data);
      });
    }
    callback(null, data);
  });
}
516510
function byType(appName, type, callback) {
    var url = format('/%s/apps/%s/containers/%s/', deis.version, appName, type);
    commons.get(url, callback);
  }
58508
function getCallbackInfo(node) {
    const retv = { isCallback: false, isLexicalThis: false };
    let currentNode = node;
    let parent = node.parent;

    while (currentNode) {
        switch (parent.type) {

            // Checks parents recursively.

            case "LogicalExpression":
            case "ConditionalExpression":
                break;

            // Checks whether the parent node is `.bind(this)` call.
            case "MemberExpression":
                if (parent.object === currentNode &&
                    !parent.property.computed &&
                    parent.property.type === "Identifier" &&
                    parent.property.name === "bind" &&
                    parent.parent.type === "CallExpression" &&
                    parent.parent.callee === parent
                ) {
                    retv.isLexicalThis = (
                        parent.parent.arguments.length === 1 &&
                        parent.parent.arguments[0].type === "ThisExpression"
                    );
                    parent = parent.parent;
                } else {
                    return retv;
                }
                break;

            // Checks whether the node is a callback.
            case "CallExpression":
            case "NewExpression":
                if (parent.callee !== currentNode) {
                    retv.isCallback = true;
                }
                return retv;

            default:
                return retv;
        }

        currentNode = parent;
        parent = parent.parent;
    }

    /* istanbul ignore next */
    throw new Error("unreachable");
}
175692
function (object, callback) {
                var list;
                if (object instanceof List) {
                    list = object;
                } else if (object instanceof Array) {
                    list = new List(object);
                } else {
                    list = new List([object]);
                }

                if (list.size()) {
                    var element = list.at(0);
                    var objectType = this.getObjectTypeIdForElement(element);
                    if (!objectType) {
                        callback("Couldn't find label object type for " + element.prototype.constructor.name);
                        return;
                    }
                    var query = new Query().in("objectIds", list.toArray(function (object) {
                        return object && object.identifier();
                    })).in('objectTypeId', [objectType]);


                    var labels = this.$.dataSource.createCollection(Collection.of(Label)).query(query);

                    labels.fetch({fullData: true}, callback);
                } else {
                    callback && callback();
                }
            }
180307
function getTitleMatches (keyword, apps) {
    const matches = R.pluck('title', apps).map((app) => getMatchType(keyword, app));
    const counts = {
      exact: R.filter(R.equals('exact'), matches).length,
      broad: R.filter(R.equals('broad'), matches).length,
      partial: R.filter(R.equals('partial'), matches).length,
      none: R.filter(R.equals('none'), matches).length
    };

    const score = (10 * counts.exact + 5 * counts.broad + 2.5 * counts.partial) / apps.length;
    return R.assoc('score', score, counts);
  }
1044736
function findTheme(theme){
			var result = null;
			$.each(themes, function(k,v){
				if( v.name.toLowerCase() === theme.toLowerCase() || v.title.toLowerCase() === theme.toLowerCase() ){
					result = v;
					return false;
				}
			});

			if( !result ){
				return themes[0];
			}
			return result;
		}
1315083
function getIsTypeMethod(name) {
    const types = ['number', 'boolean', 'function', 'Function', 'string', 'object', 'undefined', 'Date', 'Array', 'Error', 'Element']
    return _.includes(types, name) ? `is${_.capitalize(name)}` : null
}
124741
def get_for_content_type(self, ct):
        """"""
        try:
            return json.loads(self.state)[ct.app_label][ct.model]
        except KeyError:
            return None
82027
function(pattern, callback) {
    glob(pattern, opts, function(err, globbedFiles) {
      if (isArray(globbedFiles) && globbedFiles.length && !err) {
        callback(null, globbedFiles);
      }
      else {
        console.error('The glob pattern ' + JSON.stringify(pattern) + ' did not match any files!');
        callback(null, []);
      }
    });
  }
1046888
function getAppContextFromArgv(apps) {
  return Promise.try(function() {
    return _.find(apps, function(app) {
      return app.name === argv.payload[0];
    });
  });
}
425498
def get_genres(self):
    
    page = r.get(ITUNES_GENRES_URL)
    tree = html.fromstring(page.content)
    elements = tree.xpath("//a[@class='top-level-genre']")
    return [e.attrib['href'] for e in elements]
513692
function (oManifest) {
			var sVersion = "";
			if (oManifest){
				var oSapApp = (oManifest.getEntry) ? oManifest.getEntry("sap.app") : oManifest["sap.app"];
				if (oSapApp && oSapApp.applicationVersion && oSapApp.applicationVersion.version){
					sVersion = oSapApp.applicationVersion.version;
				}
			} else {
				this.log.warning("No Manifest received.");
			}
			return sVersion;
		}
1227806
function(o, callback, type) {
        for (var i in o) {
          if (o.hasOwnProperty(i)) {
            callback.call(o, i, o[i], type || i);

            if (_.util.type(o[i]) === 'Object') {
              _.languages.DFS(o[i], callback);
            } else if (_.util.type(o[i]) === 'Array') {
              _.languages.DFS(o[i], callback, i);
            }
          }
        }
      }