needs documentation
180073
def add_table(ref, options={})
      tables << Table.new(ref, self, options)
      yield tables.last if block_given?
      tables.last
    end
219414
def requirements(ctx):
    
    echo_info('Freezing check releases')
    checks = get_valid_checks()
    checks.remove('datadog_checks_dev')

    entries = []
    for check in checks:
        if check in AGENT_V5_ONLY:
            echo_info('Check `{}` is only shipped with Agent 5, skipping'.format(check))
            continue

        try:
            version = get_version_string(check)
            entries.append('{}\n'.format(get_agent_requirement_line(check, version)))
        except Exception as e:
            echo_failure('Error generating line: {}'.format(e))
            continue

    lines = sorted(entries)

    req_file = get_agent_release_requirements()
    write_file_lines(req_file, lines)
    echo_success('Successfully wrote to `{}`!'.format(req_file))
1307911
def build_info(key, options = {})
      options = DEFAULT_OPTIONS.merge(options)

      note_type = TYPES.fetch(options.fetch(:type, :note).to_s)
      account_name = options.fetch(:account_name, "")
      service_name = options.fetch(:service_name, key)
      label = options.fetch(:label, service_name)

      {
        account_name: account_name,
        service_name: service_name,
        label: label,
        kind: note_type.fetch(:kind),
        type: note_type.fetch(:type),
      }
    end
506838
def requirements(collector):
    """"""
    out = sys.stdout
    artifact = collector.configuration['dashmat'].artifact
    if artifact not in (None, "", NotSpecified):
        if isinstance(artifact, six.string_types):
            out = open(artifact, 'w')
        else:
            out = artifact

    for active in collector.configuration['__imported__'].values():
        for requirement in active.requirements():
            out.write("{0}\n".format(requirement))
1054695
def build_requirements(docs_path, package_name="yacms"):
    
    mezz_string = "yacms=="
    project_path = os.path.join(docs_path, "..")
    requirements_file = os.path.join(project_path, package_name,
                                     "project_template", "requirements.txt")
    with open(requirements_file, "r") as f:
        requirements = f.readlines()
    with open(requirements_file, "w") as f:
        f.write("yacms==%s\n" % __version__)
        for requirement in requirements:
            if requirement.strip() and not requirement.startswith(mezz_string):
                f.write(requirement)
634698
def method_missing(method_id, *arguments)
        possible_formats = MakeExportable.exportable_formats.keys.map(&:to_s).join('|')
        if match = /^create_(#{possible_formats})_report$/.match(method_id.to_s)
          format = match.captures.first
          self.create_report(format, *arguments)
        elsif match = /^to_(#{possible_formats})_export$/.match(method_id.to_s)
          format = match.captures.first
          self.to_export(format, *arguments)
        else
          super
        end
      end
1121739
function needStrucPermCreate(req, res, next) {
	( req.session.canCreate ) ? next() : res.redirect('/');
}
839333
def requires_list(self):
        
        requires = self.variant.get_requires(build_requires=self.building)
        reqlist = RequirementList(requires)

        if reqlist.conflict:
            raise ResolveError(
                "The package %s has an internal requirements conflict: %s"
                % (str(self), str(reqlist)))

        return reqlist
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)
385360
def help(handler):
    
    data = {'operation': 'describe'}
    response = handler.invoke(data, raw=True)
    description = response.data
    lines = []
    lines.append('# {}'.format(handler.lambda_fn))
    lines.append('## Handler Info')
    lines.append('**Cruddy version**: {}'.format(
        description['cruddy_version']))
    lines.append('')
    lines.append('**Table name**: {}'.format(description['table_name']))
    lines.append('')
    lines.append('**Supported operations**:')
    lines.append('')
    for op in description['supported_operations']:
        lines.append('* {}'.format(op))
    lines.append('')
    lines.append('**Prototype**:')
    lines.append('')
    lines.append('```')
    lines.append(str(description['prototype']))
    lines.append('```')
    lines.append('')
    lines.append('## Operations')
    for op_name in description['operations']:
        op = description['operations'][op_name]
        lines.append('### {}'.format(op_name))
        lines.append('')
        lines.append(_build_signature_line(
            op_name, description['operations'][op_name]['argspec']))
        lines.append('')
        if op['docs'] is None:
            lines.append('')
        else:
            lines.append(op['docs'])
        lines.append('')
    click.echo('\n'.join(lines))
605026
function ImageForm() {
		Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
		Requirements::javascript(EXTERNALCONTENT . "/javascript/external_tiny_mce_improvements.js");
		Requirements::css('cms/css/TinyMCEImageEnhancement.css');
		Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js');
		Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js');
		Requirements::javascript(CMS_DIR . '/javascript/Upload.js');

		$form = new Form(
			$this->controller,
			"{$this->name}/ImageForm",
			new FieldSet(
				new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="' . _t('HtmlEditorField.CLOSE', 'close') . '" title="' . _t('HtmlEditorField.CLOSE', 'close') . '" />' . _t('HtmlEditorField.IMAGE', 'Image') . '</h2>'),
				new TreeDropdownField('FolderID', _t('HtmlEditorField.FOLDER', 'Folder'), 'Folder'),
				new LiteralField('AddFolderOrUpload',
					'<div style="clear:both;"></div><div id="AddFolderGroup" style="display: none">
						<a style="" href="#" id="AddFolder" class="link">' . _t('HtmlEditorField.CREATEFOLDER','Create Folder') . '</a>
						<input style="display: none; margin-left: 2px; width: 94px;" id="NewFolderName" class="addFolder" type="text">
						<a style="display: none;" href="#" id="FolderOk" class="link addFolder">' . _t('HtmlEditorField.OK','Ok') . '</a>
						<a style="display: none;" href="#" id="FolderCancel" class="link addFolder">' . _t('HtmlEditorField.FOLDERCANCEL','Cancel') . '</a>
					</div>
					<div id="PipeSeparator" style="display: none">|</div>
					<div id="UploadGroup" class="group" style="display: none; margin-top: 2px;">
						<a href="#" id="UploadFiles" class="link">' . _t('HtmlEditorField.UPLOAD','Upload') . '</a>
					</div>'
				),
				new TextField('getimagesSearch', _t('HtmlEditorField.SEARCHFILENAME', 'Search by file name')),
				new ThumbnailStripField('FolderImages', 'FolderID', 'getimages'),
				new TextField('AltText', _t('HtmlEditorField.IMAGEALTTEXT', 'Alternative text (alt) - shown if image cannot be displayed'), '', 80),
				new TextField('ImageTitle', _t('HtmlEditorField.IMAGETITLE', 'Title text (tooltip) - for additional information about the image')),
				new TextField('CaptionText', _t('HtmlEditorField.CAPTIONTEXT', 'Caption text')),
				new DropdownField(
					'CSSClass',
					_t('HtmlEditorField.CSSCLASS', 'Alignment / style'),
					array(
						'left' => _t('HtmlEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'),
						'leftAlone' => _t('HtmlEditorField.CSSCLASSLEFTALONE', 'On the left, on its own.'),
						'right' => _t('HtmlEditorField.CSSCLASSRIGHT', 'On the right, with text wrapping around.'),
						'center' => _t('HtmlEditorField.CSSCLASSCENTER', 'Centered, on its own.'),
					)
				),
				new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', 'Dimensions'),
					new TextField('Width', _t('HtmlEditorField.IMAGEWIDTHPX', 'Width'), 100),
					new TextField('Height', " x " . _t('HtmlEditorField.IMAGEHEIGHTPX', 'Height'), 100)
				)
			),
			new FieldSet(
				new FormAction('insertimage', _t('HtmlEditorField.BUTTONINSERTIMAGE', 'Insert image'))
			)
		);

		$form->disableSecurityToken();
		$form->loadDataFrom($this);

		return $form;
	}
912610
def documentation(self, request):
        
        self.update_urls(request)
        context = {
            "resources": sorted(self.resource_map.items())
        }
        return render(request, "jsonapi/index.html", context)
142105
function pretendRequire(file)
{
  if (file && file.substr(0, 1) == '/')
  {
    file = path.join(projectPath, file.substr(1));
  }

  return require(file);
}
779604
def get_documentation(self, request, *args, **kw):
        
        ret = dict()
        ret['resource'] = self.name()
        ret['urls'] = self._get_url_doc()
        ret['description'] = self.__doc__
        ret['representation'] = self._get_representation_doc()
        ret['methods'] = self._get_method_doc()
        return ret
61872
def needs_repo_fabsetup_custom(func):
    ''''''
    from fabric.api import local

    @wraps(func)
    def wrapper(*args, **kwargs):
        if not os.path.exists(FABSETUP_CUSTOM_DIR):
            msg = '''\
Git repository ~/.fabsetup-custom with configurations does not exist.
This configs are required to use fabsetup.

Clone it if you already have your own fabsetup-custom repository:

    git clone <user>@<hostname>:/path/to/fabsetup-custom.git  ~/.fabetup-custom

Else, initialize a new repository.

Init a new repository `~/.fabsetup-custom`?'''
            if not query_yes_no(msg, default='yes'):
                sys.exit('abort')
            custom_dir = FABSETUP_CUSTOM_DIR
            presetting_dir = join(FABFILE_DATA_DIR,
                                  'presetting-fabsetup-custom')
            if not isdir(custom_dir):
                print(yellow('\n** **     Init ') +
                      yellow('~/.fabsetup-custom', bold=True) +
                      yellow('      ** **\n'))
                print(yellow(flo('** Create files in dir {custom_dir} **')))
                local(flo('mkdir -p {custom_dir}'))
                local(flo('cp -r --no-clobber {presetting_dir}/. {custom_dir}'))
                import_fabsetup_custom(globals())
            else:
                with quiet():
                    local(flo(
                        'cp -r --no-clobber {presetting_dir}/. {custom_dir}'))

            if not isdir(join(custom_dir, '.git')):
                print(yellow(
                    '\n** Git repo ~/.fabsetup-custom: '
                    'init and first commit **'))
                local(flo('cd {custom_dir} && git init'))
                local(flo('cd {custom_dir} && git add .'))
                local(flo('cd {custom_dir} && git commit -am "Initial commit"'))
                print(yellow("** Done. Don't forget to create a backup of your "
                             '~/.fabsetup-custom repo **\n'))
                print(yellow("** But do not make it public, it's custom **\n",
                             bold=True))
            else:
                with quiet():
                    cmd = flo('cd {custom_dir} && git status --porcelain')
                    res = local(cmd, capture=True)
                    if res:
                        print(yellow('\n** git repo  ') +
                              magenta('~/.fabsetup-custom  ') +
                              yellow('has uncommitted changes: **'))
                        print(cmd)
                        print(yellow(res, bold=True))
                        print(yellow(
                            "** Don't forget to commit them and make a "
                            "backup of your repo **\n"))
        return func(*args, **kwargs)
    return wrapper
635292
def _build_option_description(k):
    """"""
    o = _get_registered_option(k)
    d = _get_deprecated_option(k)

    buf = ['{} '.format(k)]

    if o.doc:
        doc = '\n'.join(o.doc.strip().splitlines())
    else:
        doc = 'No description available.'

    buf.append(doc)

    if o:
        buf.append(
            '\n    [default: {}] [currently: {}]'.format(
                o.defval, _get_option(k, True)
            )
        )

    if d:
        buf.append(
            '\n    (Deprecated{})'.format(
                ', use `{}` instead.'.format(d.rkey) if d.rkey else ''
            )
        )

    buf.append('\n\n')
    return ''.join(buf)
258760
def to_obj(self, wd=False, pack=False, relpath=None):
        
        self._closed()

        obj = CommentedMap()
        obj['cwlVersion'] = 'v1.0'
        obj['class'] = 'Workflow'
        try:
            obj['doc'] = self.documentation
        except (AttributeError, ValueError):
            pass
        try:
            obj['label'] = self.label
        except (AttributeError, ValueError):
            pass
        if self._has_requirements():
            obj['requirements'] = []
        if self.has_workflow_step:
            obj['requirements'].append(
                {'class': 'SubworkflowFeatureRequirement'})
        if self.has_scatter_requirement:
            obj['requirements'].append({'class': 'ScatterFeatureRequirement'})
        if self.has_multiple_inputs:
            obj['requirements'].append(
                {'class': 'MultipleInputFeatureRequirement'})
        obj['inputs'] = self.wf_inputs
        obj['outputs'] = self.wf_outputs

        steps_obj = CommentedMap()
        for key in self.wf_steps:
            steps_obj[key] = self.wf_steps[key].to_obj(relpath=relpath,
                                                       pack=pack,
                                                       wd=wd)
        obj['steps'] = steps_obj

        return obj