Find an action or a resource with $name in $description.
@param string name to be found
@param \stdClass description to be searched in
173618
protected function findObject($name, $description = null) {
		$this->client->setup();
		
		if(!$description)
			$description = $this->description;
	
		if(isSet($description->actions)) {
			foreach($description->actions as $searched_name => $desc) {
				if($searched_name == $name || in_array($name, $desc->aliases)) {
					return new Action($this->client, $this, $searched_name, $description->actions->$searched_name, $this->args);
				}
			}
		}
		
		if(array_key_exists($name, (array) $description->resources)) {
			return new Resource($this->client, $name, $description->resources->$name, $this->args);
		}
		
		return false;
	}
297969
public static function create($name, $type, $description = null)
    {
        $result = new static();
        $result->name = $name;
        $result->type = $type;
        $result->description = $description;

        return $result;
    }
622435
@Override
    public URL findResource(final String name)
    {
        return AccessController.doPrivileged(new PrivilegedAction<URL>()
        {
            @Override
            public URL run()
            {
                return URIClassLoader.this.finder.findResource(name);
            }
        }, this.acc);
    }
402910
public function action($name = null)
    {
        if (empty($name)) {
            $name = $this->_action;
        }

        $name = Inflector::variable($name);

        return $this->_loadAction($name);
    }
1197150
public function setDescription($description)
    {
        if ($description !== null && strcmp($description, "") !== 0) {
            $this->description = (string) $description;
        } else {
            $this->description = null;
        }
    }
835815
public function findView($name)
	{
		if (substr($name, -5) !== '.twig')
		{
			$name .= '.twig';
		}

		if ( ! $file = parent::findView($name))
		{
			throw new Twig_Error_Loader('Could not locate: '.$name);
		}

		return $file;
	}
459650
@Programmatic
    public ApplicationRole newRole(
            final String name,
            final String description) {
        ApplicationRole role = findByName(name);
        if (role == null){
            role = getApplicationRoleFactory().newApplicationRole();
            role.setName(name);
            role.setDescription(description);
            container.persist(role);
        }
        return role;
    }
268296
def find_description(self, name):
        ""
        for desc in self.virtual_system_descriptions:
            values = desc.get_values_by_type(DescType.name,
                                             DescValueType.original)
            if name in values:
                break
        else:
            raise Exception("Failed to find description for %s" % name)
        return desc
554236
public function getFormElementDefinition($name)
    {
        if (array_key_exists($name, $this->namedFields)) {
            return $this->namedFields[$name];
        }

        throw new CMDLParserException('Could not find a formelement named ' . $name,
            CMDLParserException::CMDL_FORMELEMENT_NOT_FOUND);
    }
433770
public final <T> void addOption(String name, String description)
    {
        addOption(String.class, name, description, null);
    }
1060804
public function setRole($name, $description = null)
    {
        $role = $this->getRole($name) ?: $this->createRole($name);
        if ($description) {
            $role->description = $description;
        }
        $this->add($role);

        return $role;
    }
809708
public function arg($name, $description, $required = false) {
        $this->currentSchema[Cli::META][Cli::ARGS][$name] =
            ['description' => $description, 'required' => $required];
        return $this;
    }
821688
public function findRequest(string $name)
    {
        foreach ($this->actions as $action) {
            if ($action->getRequest()->getName() === $name) {
                return $action->getRequest();
            }
        }

        return null;
    }
149130
public static function find($name)
    {
        if (!is_dir(DOCROOT.THEME_DIR.'/'.$name)) return false;
        if (!file_exists(DOCROOT.THEME_DIR.'/'.$name.'/'.THEME_INFO)) return false;
        return new self($name);
    }
181310
public function setPermission($name, $description = null)
    {
        $permission = $this->getPermission($name) ?: $this->createPermission($name);
        if ($description) {
            $permission->description = $description;
        }
        $this->add($permission);

        return $permission;
    }
363055
protected function findDefinitionFileByName($name)
    {
        $namespaceParts = explode('\\', $name);
        $filename = array_pop($namespaceParts).'.php';
        $namespace = implode('\\', $namespaceParts);

        $finder = new Finder();
        $finder
            ->name($filename)
            ->in($this->sourcePaths)
        ;

        $files = array();
        /** @var SplFileInfo $file */
        foreach ($finder as $file) {
            if (empty($namespace) || is_int(strpos($file->getContents(), $namespace))) {
                $baseFile = PhpFileInfo::create($file);
                $files[] = $this->usageParser->parseFile($baseFile);
            }
        }

        $file = current($files);

        if (!$file instanceof PhpFileInfo) {
            return;
        }

        return $file;
    }
760478
public function description($description = null)
    {
        if ($description === null) {
            return $this->description;
        }

        $this->description = $description;
    }