Add the current author in context.
549126
def get_context_data(self, **kwargs):
        
        context = super(BaseAuthorDetail, self).get_context_data(**kwargs)
        context['author'] = self.author
        return context
491769
def append(self, context, data):
        
        return ContextStack(self._contexts + [context], self._data + [data])
589786
def set_author(self):
        """"""
        try:
            self.author = self.soup.find('author').string
        except AttributeError:
            self.author = None
1156235
def insert(self, context):
	
		
		
		try:
			current_dir = os.getcwd()
			os.chdir(os.path.join(context.profile_dir(), self.__base_dir))
			args = [
				"packer",
				"build",
				self.__template_path
			]
			subprocess.call(args)
		finally:
			shutil.rmtree("output-*", ignore_errors=True)
			os.chdir(current_dir)
120799
def author_edit_view(self, context):
        
        fragment = Fragment()
        self.render_children(context, fragment, can_reorder=True, can_add=False)
        return fragment
1040972
def add_current_text_if_valid(self):
        """"""
        valid = self.is_valid(self.currentText())
        if valid or valid is None:
            self.add_current_text()
            return True
        else:
            self.set_current_text(self.selected_text)
1380
def attach(self, remote_entry):
        """"""
        self.name = remote_entry.name
        self.sha = remote_entry.sha
        self.url = remote_entry.url
        self.author = remote_entry.author
        return self
522228
def _update_request_context_with_user(self, user=None):
        ''''''

        ctx = _request_ctx_stack.top
        ctx.user = self.anonymous_user() if user is None else user
315734
def insert(self, context):
	
		
		
		if self.__dependency:
			self.__execute(context, "install")
		else:
			self.__execute(context, "package")
1222524
def add_to_context(self, name, **attrs):
        
        context = self.get_context(name=name)
        attrs_ = context['context']
        attrs_.update(**attrs)
549391
public function modified_author() {
		$user_id = get_post_meta($this->ID, '_edit_last', true);
		return ($user_id ? new User($user_id) : $this->author());
	}
577600
def generate_additional_context(self, matching_datasets):
        """"""
        top_tags = Tag.objects.filter(
            dataset__in=matching_datasets
        ).annotate(
            tag_count=Count('word')
        ).order_by('-tag_count')[:3]

        top_authors = Dataset.objects.filter(
            id__in=matching_datasets
        ).values('uploaded_by').annotate(
            author_count=Count('uploaded_by')
        ).order_by('-author_count')[:3]

        for author in top_authors:
            author['fullName'] = grab_names_from_emails([
                author['uploaded_by']
            ])[author['uploaded_by']]

        return {
            'top_tags': top_tags,
            'top_authors': top_authors
        }
139364
def add_fact(term, fact, author=''):
    
    logger.info('Adding new fact %s: %s', term, fact)

    if not db.facts.find({'term': term_regex(term)}).count():
        db.facts.insert({
            'term': term,
            'fact': fact,
            'set_by': author,
            'set_date': time.time()
        })
        db.facts.ensure_index('term')
541619
def add_user(self, nick, prefixes=None):
        """"""
        if nick not in self._user_nicks:
            self._user_nicks.append(nick)

        self.prefixes[nick] = prefixes
141060
private void addContext(
      final EvaluatorRuntimeProtocol.AddContextProto addContextProto)
      throws ContextClientCodeException {

    synchronized (this.contextStack) {
      try {

        final ContextRuntime currentTopContext = this.contextStack.peek();

        if (!currentTopContext.getIdentifier().equals(addContextProto.getParentContextId())) {
          throw new IllegalStateException("Trying to instantiate a child context on context with id `" +
              addContextProto.getParentContextId() + "` while the current top context id is `" +
              currentTopContext.getIdentifier() + "`");
        }

        final Configuration contextConfiguration =
            this.configurationSerializer.fromString(addContextProto.getContextConfiguration());

        final ContextRuntime newTopContext;
        if (addContextProto.hasServiceConfiguration()) {
          newTopContext = currentTopContext.spawnChildContext(contextConfiguration,
              this.configurationSerializer.fromString(addContextProto.getServiceConfiguration()));
        } else {
          newTopContext = currentTopContext.spawnChildContext(contextConfiguration);
        }

        this.contextStack.push(newTopContext);

      } catch (final IOException | BindException e) {
        throw new RuntimeException("Unable to read configuration.", e);
      }

    }
  }
715504
def init_with_context(self, context):
        
        super(PersonalModule, self).init_with_context(context)
        current_user = context['request'].user
        if django.VERSION < (1, 5):
            current_username = current_user.first_name or current_user.username
        else:
            current_username = current_user.get_short_name() or current_user.get_username()
        site_name = get_admin_site_name(context)

        # Personalize
        self.title = _('Welcome,') + ' ' + (current_username)

        # Expose links
        self.pages_link = None
        self.pages_title = None
        self.password_link = reverse('{0}:password_change'.format(site_name))
        self.logout_link = reverse('{0}:logout'.format(site_name))

        if self.cms_page_model:
            try:
                app_label, model_name = self.cms_page_model
                model = apps.get_model(app_label, model_name)
                pages_title = model._meta.verbose_name_plural.lower()
                pages_link = reverse('{site}:{app}_{model}_changelist'.format(site=site_name, app=app_label.lower(), model=model_name.lower()))
            except AttributeError:
                raise ImproperlyConfigured("The value {0} of FLUENT_DASHBOARD_CMS_PAGE_MODEL setting (or cms_page_model value) does not reffer to an existing model.".format(self.cms_page_model))
            except NoReverseMatch:
                pass
            else:
                # Also check if the user has permission to view the module.
                # TODO: When there are modules that use Django 1.8's has_module_permission, add the support here.
                permission_name = 'change_{0}'.format(model._meta.model_name.lower())

                if current_user.has_perm('{0}.{1}'.format(model._meta.app_label, permission_name)):
                    self.pages_title = pages_title
                    self.pages_link = pages_link
1016254
def process_post_author(self, bulk_mode, api_author):
        
        # get from the ref data map if in bulk mode, else look it up from the db
        if bulk_mode:
            author = self.ref_data_map["authors"].get(api_author["ID"])
            if author:
                self.update_existing_author(author, api_author)
            else:
                # if the author wasn't found (likely because it's a Byline or guest author, not a user),
                # go ahead and create the author now
                author = Author.objects.create(site_id=self.site_id,
                                               wp_id=api_author["ID"],
                                               **self.api_object_data("author", api_author))
        else:
            # do a direct db lookup if we're not in bulk mode
            author, created = self.get_or_create_author(api_author)
            if author and not created:
                self.update_existing_author(author, api_author)

        # add to the ref data map so we don't try to create it again
        if author:
            self.ref_data_map["authors"][api_author["ID"]] = author

        return author