Represents a singular REST name
965604
def rest_name(cls):
        
        if cls.__name__ == "NURESTRootObject" or cls.__name__ == "NURESTObject":
            return "Not Implemented"

        if cls.__rest_name__ is None:
            raise NotImplementedError('%s has no defined name. Implement rest_name property first.' % cls)

        return cls.__rest_name__
637355
public function renamePathBasenameSingularOrPlural(
        string $path,
        string $singular,
        string $plural
    ): string {
        $find     = AbstractGenerator::FIND_ENTITY_NAME;
        $replace  = $singular;
        $basename = \basename($path);
        if (\ts\stringContains($basename, AbstractGenerator::FIND_ENTITY_NAME_PLURAL)) {
            $find    = AbstractGenerator::FIND_ENTITY_NAME_PLURAL;
            $replace = $plural;
        }

        return $this->renamePathBasename($find, $replace, $path);
    }
1306088
def last_first(self):
        
        return "{}, {} ".format(self.last_name, self.first_name) + ("({})".format(self.nickname) if self.nickname else "")
583836
def stateNames(self):
        
#         if self.current_session:
        s = self.tmp_dir_session
        l = [x for x in s.listdir() if s.join(x).isdir()]
        naturalSorting(l)
        # else:
        #    l=[]
        # bring autosave to first position:
        if 'autoSave' in l:
            l.remove('autoSave')
            l.insert(0, 'autoSave')
        return l
779937
def _generate_name(self, space, service_name, plan_name):
        
        return str.join('-', [space, service_name, plan_name]).lower()
822857
public function singular_name()
    {
        $base = in_array(static::class, [Page::class, self::class]);
        if ($base) {
            return $this->config()->get('base_singular_name');
        }
        return parent::singular_name();
    }
526628
public static String singularToPlural(String singul) {
		return (StringUtils.isBlank(singul) || singul.endsWith("es") || singul.endsWith("ies")) ? singul :
				(singul.endsWith("s") ? singul + "es" :
				(singul.endsWith("y") ? StringUtils.removeEndIgnoreCase(singul, "y") + "ies" :
										singul + "s"));
	}
602601
def only_last_part_plural cls_name 
      parts = cls_name.split('_')
      name = parts.inject([]) do |res, part|
        res << (part != parts.last ? part.singularize : part)
        res
      end.join('_')          
    end
1011039
function (req, res) {
        {modelName}.find(function (err, {pluralName}) {
            if (err) {
                return res.status(500).json({
                    message: 'Error when getting {name}.',
                    error: err
                });
            }
            return res.json({pluralName});
        });
    }
354666
private String getParameterJSDocName(Node paramNode, int paramIndex) {
    Node nameNode = null;
    if (paramNode != null) {
      checkArgument(paramNode.getParent().isParamList(), paramNode);
      if (paramNode.isRest()) {
        // use `restParam` of `...restParam`
        // restParam might still be a destructuring pattern
        paramNode = paramNode.getOnlyChild();
      } else if (paramNode.isDefaultValue()) {
        // use `defaultParam` of `defaultParam = something`
        // defaultParam might still be a destructuring pattern
        paramNode = paramNode.getFirstChild();
      }
      if (paramNode.isName()) {
        nameNode = paramNode;
      } else {
        checkState(paramNode.isObjectPattern() || paramNode.isArrayPattern(), paramNode);
        nameNode = null; // must generate a fake name
      }
    }
    if (nameNode == null) {
      return "p" + paramIndex;
    } else {
      checkState(nameNode.isName(), nameNode);
      return nameNode.getString();
    }
  }
175659
def with_name(self, name):
        """"""
        if not self.name:
            raise ValueError("%r has an empty name" % (self,))
        return self._from_parsed_parts(self._drv, self._root,
                                       self._parts[:-1] + [name])
434335
function setname(req, res) {
  req.conn.client.name = req.args[0];
  res.send(null, Constants.OK);
}
859635
def name(self):
        """"""
        if self._path:
            # follow h5py convention: add leading slash
            name = self._path
            if name[0] != '/':
                name = '/' + name
            return name
        return '/'
78575
def restbase(self, endpoint, title):
        
        if not endpoint:
            raise ValueError("invalid endpoint: %s" % endpoint)

        route = endpoint
        if title and endpoint != '/page/':
            route = endpoint + safequote_restbase(title)

        self.set_status('restbase', route)

        return "%s/api/rest_v1/%s" % (self.uri, route[1:])
989836
def default_resource_name
      result = self.to_s.split("::").last.gsub(/([A-Z])/, '_\1').downcase
      result.slice 1, result.length
    end
871715
private static GroupName nameFromObjectName(ObjectName obj_name, NamedResolverMap resolvedMap) {
        String name = obj_name.getKeyProperty("name");
        String type = obj_name.getKeyProperty("type");
        String domain = obj_name.getDomain();

        Map<String, MetricValue> tags = obj_name.getKeyPropertyList().entrySet().stream()
                .filter((entry) -> !entry.getKey().equals("name"))
                .filter((entry) -> !entry.getKey().equals("type"))
                .map(Tag::valueOf)
                .collect(Collectors.toMap((Tag t) -> t.getName(), (Tag t) -> t.getValue()));

        final List<String> path = new ArrayList<>();
        if (name != null) {
            path.addAll(Arrays.asList(name.split("\\.")));
        } else if (type != null) {
            path.addAll(Arrays.asList(domain.split("\\.")));
            path.add(type);
        } else {
            path.addAll(Arrays.asList(domain.split("\\.")));
        }
        return resolvedMap.getGroupName(path, tags);
    }
1272818
def name(self, name=None):
        ''''''
        if name:
            self._name = name
            return self
        return self._name