create a func for the mail options
344602
function (user, req, cb) {
  CoreController.getPluginViewDefaultTemplate({
    viewname: 'email/user/forgot_password_link',
    themefileext: appSettings.templatefileextension,
  },
		function (err, templatepath) {
  if (err) {
    cb(err);
  }			else {
				// console.log('emailForgotPasswordLink templatepath', templatepath);
    if (templatepath === 'email/user/forgot_password_link') {
      templatepath = path.resolve(process.cwd(), 'node_modules/periodicjs.ext.login/views', templatepath + '.' + appSettings.templatefileextension);
    }
				// console.log('user for forgot password', user);
    var coreMailerOptions = {
      appenvironment: appenvironment,
      to: user.email,
      from: appSettings.fromemail || appSettings.adminnotificationemail,
      replyTo: appSettings.fromemail || appSettings.adminnotificationemail,
      subject: loginExtSettings.settings.forgotPasswordEmailSubject || appSettings.name + ' - Reset your password',
      emailtemplatefilepath: templatepath,
      emailtemplatedata: {
        user: user,
        appname: appSettings.name,
        hostname: req.headers.host,
        filename: templatepath,
        adminPostRoute: req.adminPostRoute,
      },
    };
    if (loginExtSettings.settings.adminbccemail || appSettings.adminbccemail) {
      coreMailerOptions.bcc = loginExtSettings.settings.adminbccemail || appSettings.adminbccemail;
    }
    CoreMailer.sendEmail(coreMailerOptions, cb);
  }
}
	);
	// cb(null, options);
}
747550
function makeOptionItemFunction(options, key) {
    if (typeof options[key] !== 'function') {
      var propertyName = options[key];
      options[key] = function(item) { return item[propertyName]; };
    }
  }
269176
function sendOptionsResponse(res, options, next) {
  try {
    var body = options.join(',');
    res.set('Allow', body);
    res.send(body);
  } catch (err) {
    next(err);
  }
}
408839
function Email (options) {
  this.action = options.action || SEND_EMAIL_ACTION;
  this.key = options.key;
  this.secret = options.secret;
  this.amazon = options.amazon;
  this.from = options.from;
  this.subject = options.subject;
  this.message = options.message;
  this.altText = options.altText;
  this.rawMessage = options.rawMessage;
  this.configurationSet = options.configurationSet;
  this.messageTags = options.messageTags;
  this.extractRecipient(options, 'to');
  this.extractRecipient(options, 'cc');
  this.extractRecipient(options, 'bcc');
  this.extractRecipient(options, 'replyTo');
}
825128
def docopt_cmd(func):
    
    def helper_fn(self, arg):
        '''helper function for docopt'''
        try:
            opt = docopt(helper_fn.__doc__, arg)
        except DocoptExit as exception:
            # The DocoptExit is thrown when the args do not match.
            # We print a message to the user and the usage block.
            print 'Invalid Command!'
            print exception
            return
        except SystemExit:
            # The SystemExit exception prints the usage for --help
            # We do not need to do the print here.
            return
        return func(self, opt)
    helper_fn.__name__ = func.__name__
    helper_fn.__doc__ = func.__doc__
    helper_fn.__dict__.update(func.__dict__)
    return helper_fn
347123
def option(func, *args, **attrs):
    
    if click is None:
        return func

    def decorator(f):
        name = attrs.pop("name", func.__name__.replace("_", "-"))
        attrs.setdefault("help", func.__doc__)
        attrs.setdefault("required", False)
        if not attrs.get("is_flag"):
            attrs.setdefault("show_default", True)
            attrs.setdefault("metavar", name.replace("-", "_").upper())
            attrs.setdefault("type", str)
        if not name.startswith("-"):
            name = "--%s" % name
        return click.option(name, *args, **attrs)(f)

    return decorator
854301
def create_mailing_lists(self, verbose=True):
        
        responses = {}
        if (
            settings.EMAIL_ENABLED
            and self.loaded
            and settings.EMAIL_BACKEND
            != "django.core.mail.backends.locmem.EmailBackend"
        ):
            sys.stdout.write(style.MIGRATE_HEADING(f"Creating mailing lists:\n"))
            for name, notification_cls in self.registry.items():
                message = None
                notification = notification_cls()
                manager = MailingListManager(
                    address=notification.email_to,
                    name=notification.name,
                    display_name=notification.display_name,
                )
                try:
                    response = manager.create()
                except ConnectionError as e:
                    sys.stdout.write(
                        style.ERROR(
                            f"  * Failed to create mailing list {name}. " f"Got {e}\n"
                        )
                    )
                else:
                    if verbose:
                        try:
                            message = response.json().get("message")
                        except JSONDecodeError:
                            message = response.text
                        sys.stdout.write(
                            f"  * Creating mailing list {name}. "
                            f'Got {response.status_code}: "{message}"\n'
                        )
                    responses.update({name: response})
        return responses
136419
function sendMail (template, locals, options, callback) {
  var self = this
  this.render(template, locals, function (err, html, text) {
    if (err) { return callback(err) }

    self.transport.sendMail({
      from: options.from || defaultFrom,
      to: options.to,
      subject: options.subject,
      html: html,
      text: text
    }, callback)
  })
}
1193977
def sender(self, func, routing=None, routing_re=None):
        
        if routing and not isinstance(routing, list):
            routing = [routing]

        if routing_re:
            if not isinstance(routing_re, list):
                routing_re = [routing_re]
            routing_re[:] = [re.compile(r) for r in routing_re]

        self.senders.append((func, routing, routing_re))
1282289
def build_options(func):
    
    func = click.option('-a', '--banner-greatest-tag', is_flag=True,
                        help='Override banner-main-ref to be the tag with the highest version number.')(func)
    func = click.option('-A', '--banner-recent-tag', is_flag=True,
                        help='Override banner-main-ref to be the most recent committed tag.')(func)
    func = click.option('-b', '--show-banner', help='Show a warning banner.', is_flag=True)(func)
    func = click.option('-B', '--banner-main-ref',
                        help="Don't show banner on this ref and point banner URLs to this ref. Default master.")(func)
    func = click.option('-i', '--invert', help='Invert/reverse order of versions.', is_flag=True)(func)
    func = click.option('-p', '--priority', type=click.Choice(('branches', 'tags')),
                        help="Group these kinds of versions at the top (for themes that don't separate them).")(func)
    func = click.option('-r', '--root-ref',
                        help='The branch/tag at the root of DESTINATION. Will also be in subdir. Default master.')(func)
    func = click.option('-s', '--sort', multiple=True, type=click.Choice(('semver', 'alpha', 'time')),
                        help='Sort versions. Specify multiple times to sort equal values of one kind.')(func)
    func = click.option('-t', '--greatest-tag', is_flag=True,
                        help='Override root-ref to be the tag with the highest version number.')(func)
    func = click.option('-T', '--recent-tag', is_flag=True,
                        help='Override root-ref to be the most recent committed tag.')(func)
    func = click.option('-w', '--whitelist-branches', multiple=True,
                        help='Whitelist branches that match the pattern. Can be specified more than once.')(func)
    func = click.option('-W', '--whitelist-tags', multiple=True,
                        help='Whitelist tags that match the pattern. Can be specified more than once.')(func)

    return func
440562
def options(self, request, map, *args, **kwargs):
        """"""
        options = {}
        for method, function in map.items():
            options[method] = function.__doc__

        return self._render(
            request = request,
            template = 'options',
            context = {
                'options': options
            },
            status = 200,
            headers = {
                'Allow': ', '.join(options.keys())
            }
        )
1133788
def saveit(func):
    """"""

    name = '_' + func.__name__

    def _wrapper(self, *args, **kwds):
        if not hasattr(self, name):
            setattr(self, name, func(self, *args, **kwds))
        return getattr(self, name)
    return _wrapper
846110
function sendOptionsResponse(res, methods) {
  var options = Object.create(null)

  // build unique method map
  for (var i = 0; i < methods.length; i++) {
    options[methods[i]] = true
  }

  // construct the allow list
  var allow = Object.keys(options).sort().join(', ')

  // send response
  res.setHeader('Allow', allow)
  res.setHeader('Content-Length', Buffer.byteLength(allow))
  res.setHeader('Content-Type', 'text/plain')
  res.setHeader('X-Content-Type-Options', 'nosniff')
  res.end(allow)
}
133002
def change_email(new_email, old_email, options = {})
      data = options
      data[:email] = new_email
      data[:change_email] = old_email
      api_post(:email, data)
    end
1058726
def item_options(self, **kwargs):
        
        actions = self._item_actions.copy()
        if self._resource.is_singular:
            actions['create'] = ('POST',)
        methods = self._get_handled_methods(actions)
        return self._set_options_headers(methods)
515246
def make_funcs(dataset, setdir, store):
    """"""
    return {
        'cat': lambda *lists: [x for lst in lists for x in lst],
        'comments': lambda: None,
        'detail_route': detail_route,
        'format': lambda fmt, *args: fmt.format(*args),
        'get': partial(getnode, dataset, setdir, store),
        'join': lambda sep, *args: sep.join([x for x in args if x]),
        'len': len,
        'link': (lambda href, title, target=None:
                 {'href': href or "",
                  'title': title or "",
                  'target': '_blank' if target is None else target}),
        'list': lambda *x: filter(None, list(x)),
        'max': max,
        'min': min,
        'status': lambda: ['#STATUS#'],
        'sum': sum,
        'tags': lambda: ['#TAGS#'],
        'trace': print_trace,
    }
976429
private function getMailer(): \Swift_Mailer
    {
        // If the mailer has already been defined via the constructor, return it.
        if ($this->mailer) {
            return $this->mailer;
        }

        // Get the proper transporter
        switch ($this->config('mailer.transport')) {
            case 'smtp':
                $transport = $this->getSmtpTransport();

                break;

            case 'mail':
                throw new MailerException(
                    "'mail' transport is no longer supported, please use 'smtp' or 'sendmail' transport."
                );

                break;

            default:
                $transport = $this->getSendMailTransport();
        }

        $this->mailer = new \Swift_Mailer($transport);

        return $this->mailer;
    }