Return documentation about the argument that an endpoint accepts.
515595
def format_endpoint_argument_doc(argument):
    """"""
    doc = argument.doc_dict()

    # Trim the strings a bit
    doc['description'] = clean_description(py_doc_trim(doc['description']))
    details = doc.get('detailed_description', None)
    if details is not None:
        doc['detailed_description'] = clean_description(py_doc_trim(details))

    return doc
1313424
def check_arguments(self):
        """"""
        for name, default in self.argdict.items():
            if name not in self.names and default is NODEFAULT:
                raise NameError('Missing argparse specification for %r' % name)
577000
def get_func_args(func):
    
    if isinstance(func, functools.partial):
        return _signature(func.func)
    if inspect.isfunction(func) or inspect.ismethod(func):
        return _signature(func)
    # Callable class
    return _signature(func.__call__)
323990
def get_docargs(self, args=None, prt=None, **kws):
        """"""
        args_user = sys.argv[1:] if args is None else args
        arg_kws = self._get_docargs(args_user, prt)
        if 'intvals' in kws:
            self._set_intvals(arg_kws, kws['intvals'])
        return arg_kws
188390
def get_args(obj):
    """"""
    if inspect.isfunction(obj):
        return inspect.getargspec(obj).args
    elif inspect.ismethod(obj):
        return inspect.getargspec(obj).args[1:]
    elif inspect.isclass(obj):
        return inspect.getargspec(obj.__init__).args[1:]
    elif hasattr(obj, '__call__'):
        return inspect.getargspec(obj.__call__).args[1:]
    else:
        raise TypeError("Can't inspect signature of '%s' object." % obj)
1123613
def endpoint_search(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.search_endpoints(**kwargs)
1325980
public String getDescriptionForParameter(String name) {
    if (documentation == null || documentation.parameters == null) {
      return null;
    }

    return documentation.parameters.get(name);
  }
939334
def endpoint(cls):
        
        endpoint = ''
        if cls.__endpoint__ is not None:
            return cls.__endpoint__
        elif cls.__from_class__ is not None:
            endpoint = cls.__from_class__.__name__.lower()
        else:
            endpoint = cls.__tablename__.lower()
        if not endpoint.endswith('s'):
            endpoint += 's'
        return endpoint
1046742
def documentation(self, add_to=None, version=None, prefix="", base_url="", url=""):
        """"""
        doc = OrderedDict() if add_to is None else add_to

        usage = self.interface.spec.__doc__
        if usage:
            doc['usage'] = usage

        for example in self.examples:
            example_text = "{0}{1}{2}{3}".format(prefix, base_url, '/v{0}'.format(version) if version else '', url)
            if isinstance(example, str):
                example_text += "?{0}".format(example)
            doc_examples = doc.setdefault('examples', [])
            if not example_text in doc_examples:
                doc_examples.append(example_text)

        doc = super().documentation(doc)

        if getattr(self, 'output_doc', ''):
            doc['outputs']['type'] = self.output_doc

        return doc
540717
def _get_docargs(self, args_user, prt):
        """"""
        if prt is not None:
            print("DocOptParse BEFORE docopt: {}".format(args_user))
        docargs = docopt(self.doc, args_user)
        if prt is not None:
            print("DocOptParse AFTER  docopt: {}".format(docargs))
        kwargs_doc = {re.sub(r'^-{1,2}', '', k):v for k, v in docargs.items()}
        self._chk_docopt_kws(kwargs_doc, args_user)
        kwargs_usr = get_kwargs(kwargs_doc, self.exp_keys, self.exp_elems)
        if prt is not None:
            print("DocOptParse AFTER  pared: {}".format(kwargs_usr))
        for key in ['taxid']:
            if key in kwargs_usr:
                kwargs_usr[key] = int(kwargs_usr[key])
        if prt is not None:
            print("DocOptParse AFTER  edited/checked: {}".format(kwargs_usr))
        return kwargs_usr
506787
def get_arguments(self, name: str, strip: bool = True) -> List[str]:
        

        # Make sure `get_arguments` isn't accidentally being called with a
        # positional argument that's assumed to be a default (like in
        # `get_argument`.)
        assert isinstance(strip, bool)

        return self._get_arguments(name, self.request.arguments, strip)
384474
def get_endpoint(cls):
        
        if cls.endpoint is not None:
            return cls.endpoint
        s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', cls.__name__)
        return cls.sanitize_ep(
            re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower(),
            plural=True
        )
693967
def locate_endpoint_function(self, name=None):
        ''
        if name is not None:
            ep = "%s_%s" %(self._base_pathname,
                           name)
        else:
            ep = self._base_pathname
        return self._notflask.endpoints[ep]['view_func']
277329
def show_command(endpoint_id, rule_id):
    
    client = get_client()

    rule = client.get_endpoint_acl_rule(endpoint_id, rule_id)
    formatted_print(
        rule,
        text_format=FORMAT_TEXT_RECORD,
        fields=(
            ("Rule ID", "id"),
            ("Permissions", "permissions"),
            ("Shared With", _shared_with_keyfunc),
            ("Path", "path"),
        ),
    )
1128499
def documentation(default=None, api_version=None, api=None, **kwargs):
    """"""
    api_version = default or api_version
    if api:
        return api.http.documentation(base_url="", api_version=api_version)
1293102
def parse_endpoint(endpoint, identifier_type=None):
        
        # compute the operation
        parts = endpoint.split(".")
        operation = Operation.from_name(parts[1])

        # extract its parts
        matcher = match(operation.endpoint_pattern, endpoint)
        if not matcher:
            raise InternalServerError("Malformed operation endpoint: {}".format(endpoint))
        kwargs = matcher.groupdict()
        del kwargs["operation"]
        if identifier_type is not None:
            kwargs["identifier_type"] = identifier_type
        return operation, Namespace(**kwargs)
745331
def get_arguments(argv=None, environ=None):
    
    name = 'appveyor-artifacts'
    environ = environ or os.environ
    require = getattr(pkg_resources, 'require')  # Stupid linting error.
    commit, owner, pull_request, repo, tag = '', '', '', '', ''

    # Run docopt.
    project = [p for p in require(name) if p.project_name == name][0]
    version = project.version
    args = docopt(__doc__, argv=argv or sys.argv[1:], version=version)

    # Handle Travis environment variables.
    if environ.get('TRAVIS') == 'true':
        commit = environ.get('TRAVIS_COMMIT', '')
        owner = environ.get('TRAVIS_REPO_SLUG', '/').split('/')[0]
        pull_request = environ.get('TRAVIS_PULL_REQUEST', '')
        if pull_request == 'false':
            pull_request = ''
        repo = environ.get('TRAVIS_REPO_SLUG', '/').split('/')[1].replace('_', '-')
        tag = environ.get('TRAVIS_TAG', '')

    # Command line arguments override.
    commit = args['--commit'] or commit
    owner = args['--owner-name'] or owner
    pull_request = args['--pull-request'] or pull_request
    repo = args['--repo-name'] or repo
    tag = args['--tag-name'] or tag

    # Merge env variables and have command line args override.
    config = {
        'always_job_dirs': args['--always-job-dirs'],
        'commit': commit,
        'dir': args['--dir'] or '',
        'ignore_errors': args['--ignore-errors'],
        'job_name': args['--job-name'] or '',
        'mangle_coverage': args['--mangle-coverage'],
        'no_job_dirs': args['--no-job-dirs'] or '',
        'owner': owner,
        'pull_request': pull_request,
        'raise': args['--raise'],
        'repo': repo,
        'tag': tag,
        'verbose': args['--verbose'],
    }

    return config