Extend ``nailgun.entity_mixins.Entity.path``.

        The format of the returned path depends on the value of ``which``:

        refresh
            /api/usergroups/:usergroup_id/external_usergroups/:id/refresh
776421
def path(self, which=None):
        
        if which == 'refresh':
            return '{0}/{1}'.format(
                super(ExternalUserGroup, self).path(which='self'),
                which
            )
        return super(ExternalUserGroup, self).path(which)
756422
def path(self, *paths, **kwargs):
        
        return self.__class__(self.__root__, *paths, **kwargs)
1139224
public static void path(@NotNull String path, @NotNull EndpointGroup endpointGroup) {
        path = path.startsWith("/") ? path : "/" + path;
        pathDeque.addLast(path);
        endpointGroup.addEndpoints();
        pathDeque.removeLast();
    }
648428
def resource_url(self, entity_id, name, revision):
        '''
        
        '''
        return '{}/{}/resource/{}/{}'.format(self.url,
                                             _get_path(entity_id),
                                             name,
                                             revision)
1190358
def joinpath(self, *args):
        
        return self.__class__(os.path.join(self, *args))
391928
function _getContextsFromPath(path) {
  const allContexts = {
    add: [],
    remove: [],
  }
  _each(_pathContexts, pathContext => {
    let contextAdded = false
    const contexts = pathContext.contexts
    const regexes = pathContext.regexes
    const paths = pathContext.paths

    _each(regexes, regex => {
      regex.lastIndex = 0
      const matches = regex.exec(path)
      if (matches && matches.length > 0) {
        const contextsToAdd = []
        _each(contexts, context => {
          const replacedContext = context.replace(
            _contextRegex,
            (match, group) => {
              return matches[group]
            },
          )
          contextsToAdd.push(replacedContext)
        })
        allContexts.add = allContexts.add.concat(contextsToAdd)
        contextAdded = true
      }
      return !contextAdded
    })

    if (!contextAdded) {
      _each(paths, pathToTry => {
        if (path === pathToTry) {
          allContexts.add = allContexts.add.concat(contexts)
          contextAdded = true
        }
        return !contextAdded
      })
      if (!contextAdded) {
        allContexts.remove = allContexts.remove.concat(contexts)
      }
    }
  })
  return allContexts
}
1140293
def path2route(path: SchemaPath) -> SchemaRoute:
        
        if path == "/" or path == "":
            return []
        nlist = path.split("/")
        prevns = None
        res = []
        for n in (nlist[1:] if path[0] == "/" else nlist):
            p, s, loc = n.partition(":")
            if s:
                if p == prevns:
                    raise InvalidSchemaPath(path)
                res.append((loc, p))
                prevns = p
            elif prevns:
                res.append((p, prevns))
            else:
                raise InvalidSchemaPath(path)
        return res
1073608
def expandpath(path):
    
    return os.path.expandvars(os.path.expanduser(path)).replace("//", "/")
18405
def normpath(path):
    
    return os.path.abspath(os.path.normpath(os.path.expanduser(path)))
1056353
def path(self, args, kw):
        """"""
        params = self._pop_params(args, kw)
        if args or kw:
            raise InvalidArgumentError("Extra parameters (%s, %s) when building path for %s" % (args, kw, self.template))
        return self.build_url(**params)
407591
def path_param(name, ns):
    
    if ns.identifier_type == "uuid":
        param_type = "string"
        param_format = "uuid"
    else:
        param_type = "string"
        param_format = None

    kwargs = {
        "name": name,
        "in": "path",
        "required": True,
        "type": param_type,
    }
    if param_format:
        kwargs["format"] = param_format
    return swagger.PathParameterSubSchema(**kwargs)
840845
function getRefModel (path) {
  let model
  if (this.schema.refs) {
    const modelName = this.schema.refs[path].ref
    if (modelName) {
      const l = this[_privateKey] && this[_privateKey].lounge
        ? this[_privateKey].lounge
        : this.lounge
      model = l.models[modelName]
    }
  }

  return model
}
300664
def do_get(path, params={})
      login if need_login?

      # Resource id is a special param as it needs to be added to the path
      path = add_id_and_params_to_path(path, params)

      req, res, resource_type, body = nil

      begin
        retry_request(true) do
          # Return content type so the resulting resource object knows what kind of resource it is.
          resource_type, body = @rest_client[path].get(headers) do |response, request, result, &block|
            req, res = request, response
            update_cookies(response)
            update_last_request(request, response)

            case response.code
            when 200
              # Get the resource_type from the content_type, the resource_type
              # will be used later to add relevant methods to relevant resources
              type = if result.content_type.index('rightscale')
                get_resource_type(result.content_type)
              elsif result.content_type.index('text/plain')
                'text'
              else
                ''
              end

              # work around getting ASCII-8BIT from some resources like audit entry detail
              charset = get_charset(response.headers)
              if charset && response.body.encoding != charset
                response.body.force_encoding(charset)
              end

              # raise an error if the API is misbehaving and returning an empty response when it shouldn't
              if type != 'text' && response.body.empty?
                raise EmptyBodyError.new(request, response)
              end

              [type, response.body]
            when 301, 302
              update_api_url(response)
              response.follow_redirection(request, result, &block)
            when 404
              raise UnknownRouteError.new(request, response)
            else
              raise ApiError.new(request, response)
            end
          end
        end
      rescue => e
        raise wrap(e, :get, path, params, req, res)
      end

      data = if resource_type == 'text'
        { 'text' => body }
      else
        JSON.parse(body, :allow_nan => true)
      end

      [resource_type, path, data]
    end
1266459
def _get_path(entity_id):
    '''
    '''
    try:
        path = entity_id.path()
    except AttributeError:
        path = entity_id
    if path.startswith('cs:'):
        path = path[3:]
    return path
1134690
def expand_path(path):
  
  return os.path.abspath(os.path.expandvars(os.path.expanduser(path)))
1146773
function updatePersistentPath(client, path, data, callback) {
  debug('updatePersistentPath: "%s" "%s"', path, data);

  data = ensureBuffer(data);

  client.setData(path, data, function (err) {
    if (err) {
      if (err.code !== NO_NODE)
        return callback(err);

      createParentPath(client, path, function(err) {
        if (err) return callback(err);

        client.create(path, data, function(err) {
          if (err) {
            if (err.code !== NODE_EXISTS)
              return callback(err);
            client.setData(path, data, callback);
          } else
            callback(null);
        });
      });
    } else
      callback(null);
  });
}
981684
def path(self):
        
        return "/".join([
            part
            for part in [
                self.version,
                self.qualifier,
            ]
            if part
        ])