DNote Session instance.

 @return [DNote::Session]
967105
def dnote_session
      ::DNote::Session.new do |s|
        s.paths   = files
        s.exclude = exclude
        s.ignore  = ignore
        s.labels  = labels
        s.title   = title
        s.context = lines
        s.dryrun  = trial?
      end
    end
1179348
private Session getSession(boolean isSingleton) {
		final MailAccount mailAccount = this.mailAccount;
		Authenticator authenticator = null;
		if (mailAccount.isAuth()) {
			authenticator = new UserPassAuthenticator(mailAccount.getUser(), mailAccount.getPass());
		}

		return isSingleton ? Session.getDefaultInstance(mailAccount.getSmtpProps(), authenticator) //
				: Session.getInstance(mailAccount.getSmtpProps(), authenticator);
	}
1117503
def getReadSession(self):
        '''  '''
        if self.ReadSession is None:
            self.ReadSession=scoped_session(sessionmaker(bind=self.engine))

        return self.ReadSession
470701
def list_notes(self, page=0, since=None):
        
        from highton.models.note import Note
        params = {'n': int(page) * self.NOTES_OFFSET}
        if since:
            params['since'] = since.strftime(self.COLLECTION_DATETIME)

        return fields.ListField(
            name=self.ENDPOINT,
            init_class=Note
        ).decode(
            self.element_from_string(
                self._get_request(
                    endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Note.ENDPOINT,
                    params=params
                ).text
            )
        )
68768
private function note() {return dfc($this, function() {return
		!($n = $this->e()->getNote()) ? '' : df_tag('p', 'note', df_tag('span', [], $n))
	;});}
972136
def _notebook(trigger, note_store):
        
        note = Types.Note()
        if trigger.notebook:
            # get the notebookGUID ...
            notebook_id = EvernoteMgr.get_notebook(note_store, trigger.notebook)
            # create notebookGUID if it does not exist then return its id
            note.notebookGuid = EvernoteMgr.set_notebook(note_store, trigger.notebook, notebook_id)

            if trigger.tag:
                # ... and get the tagGUID if a tag has been provided
                tag_id = EvernoteMgr.get_tag(note_store, trigger.tag)
                if tag_id is False:
                    tag_id = EvernoteMgr.set_tag(note_store, trigger.tag, tag_id)
                    # set the tag to the note if a tag has been provided
                    if tag_id:
                        note.tagGuids = tag_id

            logger.debug("notebook that will be used %s", trigger.notebook)
        return note
1295935
def session(self):
        
        if not self._session:
            self._session = requests.Session()
            self._session.headers.update(dict(Authorization='Bearer {0}'.format(self.token)))
        return self._session
1077946
def session(self):
        
        if self._session is None:
            self._session = self.client.create_session()

        return self._session
690304
def session(self, session=None):
        '''
        '''
        if self.related_instance:
            session = self.related_instance.session
        # we have a session, we either create a new one return the same session
        if session is None:
            raise QuerySetError('Related manager can be accessed only from\
 a loaded instance of its related model.')
        return session
1169313
def notes(options = {})
      # Create a default 2 item hash and update if options is supplied
      options = {
        id:   nil,
        type: nil
      }.update(options)
      return nil if @_notes.nil?
      return nil if @_notes.empty?
      # Empty 2-D Hash to be used for notes found based on id and type
      notes_found = Hash.new do |h, k|
        # h is the id portion of the hash
        # k is the type portion of the hash
        h[k] = {}
      end
      # Filter @notes based off of the id
      filter_hash(@_notes, options[:id]).each do |id, hash|
        # Filter hash based off of the type
        filter_hash(hash, options[:type]).each do |type, note|
          # Store the note into note_found
          notes_found[id][type] = note
        end
      end
      if notes_found.empty?
        return nil
      elsif notes_found.size == 1
        notes_found.values.first.values.first
      else
        return notes_found
      end
    end
1095397
function writeNotes() {
  let output = '';
  let compatNotes = collectCompatNotes();
  for (let note of compatNotes) {
    let noteIndex = compatNotes.indexOf(note);
    output += `<p id=compatNote_${noteIndex+1}>${noteIndex+1}. ${note}</p>`;
  }
  return output;
}
986438
def notes(element_key)
      parameter = { basic_auth: @auth }

      response = self.class.get("/elements/#{element_key}/notes", parameter)
      if response.success?
        search_response_header = SearchResponseHeader.new(response)
        search_response_header.elementList
      end
    end
1075107
def attach_session(self):
        
        assert self.session is None
        root = self.find_root()
        session = self.Session(root)
        root.inject_context(session=session)
        return session
678672
def create
      # TODO:
      #   * guard based on "state" param:
      #     if `session['omniauth.state]`, `params[:state]` must match.

      authorization = Corkboard::Authorization.create!(auth_attrs)
      subscription  = Corkboard::Subscription.create!(provider, authorization)

      Corkboard.publish!(subscription.backlog)
      redirect_to(authorizations_path)
    end
1035735
def legacy_notes_view(request):
    
    notes = TeacherNote.objects.all()
    note_count = notes.count()
    paginator = Paginator(notes, 100)

    page = request.GET.get('page')
    try:
        notes = paginator.page(page)
    except PageNotAnInteger:
        notes = paginator.page(1)
    except EmptyPage:
        notes = paginator.page(paginator.num_pages)
    return render_to_response(
        'teacher_notes.html',
        {'page_name': "Legacy Notes",
         'notes': notes,
         'note_count': note_count,},
        context_instance=RequestContext(request)
    )
332372
def create
      session = build_passwordless_session(find_authenticatable)

      if session.save
        Passwordless.after_session_save.call(session)
      end

      render
    end
872031
def get_current_shutit_pexpect_session_environment(self, note=None):
		
		self.handle_note(note)
		current_session = self.get_current_shutit_pexpect_session()
		if current_session is not None:
			res = current_session.current_environment
		else:
			res = None
		self.handle_note_after(note)
		return res