Access the samples

        :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleList
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleList
351176
def samples(self):
        
        if self._samples is None:
            self._samples = SampleList(
                self._version,
                assistant_sid=self._solution['assistant_sid'],
                task_sid=self._solution['sid'],
            )
        return self._samples
973915
def get_samples_data(self):
        
        for obj in self.get_samples_from_request():
            yield {
                "obj": obj,
                "id": api.get_id(obj),
                "uid": api.get_uid(obj),
                "title": api.get_title(obj),
                "path": api.get_path(obj),
                "url": api.get_url(obj),
                "sample_type": obj.getSampleTypeTitle(),
                "client_title": obj.getClientTitle(),
                "date": ulocalized_time(obj.created(), long_format=True),
            }
681982
static Collection<Sample> samples(Collection<SampleDTO> samples) {
        return Collections2.transform(samples, DTO_TO_SAMPLE);
    }
1141515
def sample(self):
        '''
        '''
        sample = []
        iterator = iter(self.__sample_extended_rows)
        iterator = self.__apply_processors(iterator)
        for row_number, headers, row in iterator:
            sample.append(row)
        return sample
570077
def sample(self, batch_info: BatchInfo, model: RlModel, number_of_steps: int) -> Rollout:
        
        # Sample trajectories
        rollout = self.replay_buffer.sample_trajectories(rollout_length=number_of_steps, batch_info=batch_info)

        last_observations = rollout.transition_tensors['observations_next'][-1].to(self.device)
        final_values = model.value(last_observations).cpu()

        # Add 'final_values' to the rollout
        rollout.rollout_tensors['final_values'] = final_values

        return rollout
478602
def samplesheet(self):
        
        if self.demultiplex:
            make_path(self.samplesheetpath)
            self.customsamplesheet = os.path.join(self.samplesheetpath, 'SampleSheet.csv')
            header = ['Sample_ID', 'Sample_Name', 'Sample_Plate', 'Sample_Well', 'I7_Index_ID', 'index', 'I5_Index_ID',
                      'index2', 'Sample_Project', 'Description']
            with open(self.customsamplesheet, 'w') as samplesheet:
                lines = str()
                lines += '[Header]\n'
                lines += 'IEMFileVersion,{}\n'.format(self.header.IEMFileVersion)
                lines += 'Investigator Name,{}\n'.format(self.header.InvestigatorName)
                lines += 'Experiment Name,{}\n'.format(self.header.ExperimentName)
                lines += 'Date,{}\n'.format(self.header.Date)
                lines += 'Workflow,{}\n'.format(self.header.Workflow)
                lines += 'Application,{}\n'.format(self.header.Application)
                lines += 'Assay,{}\n'.format(self.header.Assay)
                lines += 'Description,{}\n'.format(self.header.Description)
                lines += 'Chemistry,{}\n'.format(self.header.Chemistry)
                lines += '\n'
                lines += '[Reads]\n'
                lines += str(self.forward) + '\n'
                lines += str(self.reverse) + '\n'
                lines += '\n'
                lines += '[Settings]\n'
                lines += 'ReverseComplement,{}\n'.format(self.header.ReverseComplement)
                lines += 'Adapter,{}\n'.format(self.header.Adapter)
                lines += '\n'
                lines += '[Data]\n'
                lines += ','.join(header)
                lines += '\n'
                # Correlate all the samples added to the list of incomplete samples with their metadata
                for incomplete in self.incomplete:
                    for sample in self.rundata:
                        if incomplete == sample['SampleID']:
                            # Use each entry in the header list as a key for the rundata dictionary
                            for data in header:
                                # Modify the key to be consistent with how the dictionary was populated
                                result = sample[data.replace('_', '')]
                                # Description is the final entry in the list, and shouldn't have a , following the value
                                if data != 'Description':
                                    lines += '{},'.format(result.replace('NA', ''))
                                # This entry should have a newline instead of a ,
                                else:
                                    lines += '{}\n'.format(result.replace('NA', ''))
                # Write the string to the sample sheet
                samplesheet.write(lines)
1103055
def should_sample(self):
        
        return self.span_context.trace_options.enabled \
            or self.sampler.should_sample(self.span_context.trace_id)
289892
def before_sample(analysis_request):
    
    if not analysis_request.getDateSampled():
        analysis_request.setDateSampled(DateTime())
    if not analysis_request.getSampler():
        analysis_request.setSampler(api.get_current_user().id)
1012266
def getAnalysisRequests(self):
        
        # I have to get the catalog in this way because I can't do it with 'self'...
        pc = getToolByName(api.portal.get(), 'portal_catalog')
        contentFilter = {'portal_type': 'AnalysisRequest',
                         'is_active': True,
                         'SamplingRoundUID': self.UID()}
        return pc(contentFilter)
1370622
def Sample(self, tasks_status):
    
    sample_time = time.time()
    sample = '{0:f}\t{1:d}\t{2:d}\t{3:d}\t{4:d}\t{5:d}\n'.format(
        sample_time, tasks_status.number_of_queued_tasks,
        tasks_status.number_of_tasks_processing,
        tasks_status.number_of_tasks_pending_merge,
        tasks_status.number_of_abandoned_tasks,
        tasks_status.total_number_of_tasks)
    self._WritesString(sample)
97255
def get_sample_frame(self):
        """"""
        for frame in self.frames:
            return frame.open()

        for res in self.results.values():
            return res.open()

        return None
1162923
def get_sampletypes(self):
        
        query = {
            "portal_type": "SampleType",
            "sort_on": "sortable_title",
            "sort_order": "ascending",
            "is_active": True,
        }
        results = api.search(query, "bika_setup_catalog")
        return map(api.get_object, results)
1036627
def statistics(self):
        
        if self._statistics is None:
            self._statistics = TaskStatisticsList(
                self._version,
                assistant_sid=self._solution['assistant_sid'],
                task_sid=self._solution['sid'],
            )
        return self._statistics
476880
def get_sample_contacts_formatted_emails(self, sample):
        
        contacts = list(set([sample.getContact()] + sample.getCCContact()))
        return map(self.get_contact_formatted_email, contacts)
1211566
def get_state(self):
        

        self.step_methods = set()
        for s in self.stochastics:
            self.step_methods |= set(self.step_method_dict[s])

        state = Sampler.get_state(self)
        state['step_methods'] = {}

        # The state of each StepMethod.
        for sm in self.step_methods:
            state['step_methods'][sm._id] = sm.current_state().copy()

        return state
155809
def _sampleFromEdges(self):
    
    dimensionsToChooseFrom = range(self.dimension)
    random.shuffle(dimensionsToChooseFrom)
    dim1, dim2 = dimensionsToChooseFrom[0], dimensionsToChooseFrom[1]
    coordinates = [random.uniform(-1, 1) * dim / 2. for dim in self.dimensions]
    coordinates[dim1] = self.dimensions[dim1] / 2. * random.choice([-1, 1])
    coordinates[dim2] = self.dimensions[dim2] / 2. * random.choice([-1, 1])
    return coordinates
425873
protected function getSamples() {
        if (!$this->_samples) {
            $this->_samples = new SampleList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_samples;
    }