Create a `JobDetails` from an `astropy.table.row.Row`
965331
def make_job_details(self, row_idx):
        
        row = self._table[row_idx]
        job_details = JobDetails.create_from_row(row)
        job_details.get_file_paths(self._file_archive, self._table_id_array)
        self._cache[job_details.fullkey] = job_details
        return job_details
1339424
def _dict_factory(cursor, row):
        ''' 
        '''
        d = {}
        for idx, col in enumerate(cursor.description):
            if col[0] == 'rowid':
                d['_id'] = row[idx]
            else:
                d[col[0]] = row[idx]
        return d
647218
def _make_record(self,row):
        """"""
        res = dict(zip(self.all_fields,row))
        for k in self.types:
            res[k] = self.types[k](res[k])
        return res
351684
def append_to_tables(self, table, table_ids):
        
        infile_refs = np.zeros((2), int)
        outfile_refs = np.zeros((2), int)
        rmfile_refs = np.zeros((2), int)
        intfile_refs = np.zeros((2), int)
        f_ptr = len(table_ids['file_id'])
        infile_refs[0] = f_ptr
        if self.infile_ids is not None:
            for fid in self.infile_ids:
                table_ids.add_row(dict(file_id=fid))
                f_ptr += 1
        infile_refs[1] = f_ptr
        outfile_refs[0] = f_ptr
        if self.outfile_ids is not None:
            for fid in self.outfile_ids:
                table_ids.add_row(dict(file_id=fid))
                f_ptr += 1
        outfile_refs[1] = f_ptr
        rmfile_refs[0] = f_ptr
        if self.rmfile_ids is not None:
            for fid in self.rmfile_ids:
                table_ids.add_row(dict(file_id=fid))
                f_ptr += 1
        rmfile_refs[1] = f_ptr
        intfile_refs[0] = f_ptr
        if self.intfile_ids is not None:
            for fid in self.intfile_ids:
                table_ids.add_row(dict(file_id=fid))
                f_ptr += 1
        intfile_refs[1] = f_ptr

        table.add_row(dict(dbkey=self.dbkey,
                           jobname=self.jobname,
                           jobkey=self.jobkey,
                           appname=self.appname,
                           logfile=self.logfile,
                           job_config=str(self.job_config),
                           timestamp=self.timestamp,
                           infile_refs=infile_refs,
                           outfile_refs=outfile_refs,
                           rmfile_refs=rmfile_refs,
                           intfile_refs=intfile_refs,
                           status=self.status))
1309790
def append(self, row_dict):
        """"""
        # TODO validate row_dict.keys() match
        # TODO check self.is_authed
        entry = self.client.InsertRow(row_dict, self.key, self.worksheet)
        self.feed.entry.append(entry)
        return GDataRow(entry, sheet=self, deferred_save=self.deferred_save)
477161
def prepare_data(self, rows):
        
        self._rows = dict()
        for row in copy.copy(rows) if self.copy else rows:
            pseudo_key = self._get_pseudo_key(row)
            if pseudo_key not in self._rows:
                self._rows[pseudo_key] = list()
            self._rows[pseudo_key].append(row)

        # Convert begin and end dates to integers.
        self._date_type = None
        for pseudo_key, rows in self._rows.items():
            self._rows_date2int(rows)
1288065
def _init_metadata_table():
    """"""
    _metadata_table = sqlalchemy.Table(
        'metadata', _METADATA,
        sqlalchemy.Column(
            'job_id', sqlalchemy.ForeignKey("jobs.job_id", ondelete="CASCADE"),
            nullable=False, primary_key=True),
        sqlalchemy.Column('key', sqlalchemy.UnicodeText, primary_key=True),
        sqlalchemy.Column('value', sqlalchemy.UnicodeText, index=True),
        sqlalchemy.Column('type', sqlalchemy.UnicodeText),
        )
    return _metadata_table
798347
function createTable (spec) {
  assert.equal(typeof spec.paths, 'object', 'paths should be object')

  const tableHead = u('tableHeader', [
    u('tableCell', [ u('text', 'Path') ]),
    u('tableCell', [ u('text', 'Method') ]),
    u('tableCell', [ u('text', 'Summary') ])
  ])

  // convert swagger to table rows
  const tableRows = Object.keys(spec.paths).reduce(function (arr, route) {
    Object.keys(spec.paths[route]).forEach(function (method) {
      const summary = spec.paths[route][method].summary || '[ not available ]'
      arr.push(u('tableRow', [
        u('tableCell', [ u('text', route) ]),
        u('tableCell', [ u('text', method.toUpperCase()) ]),
        u('tableCell', [ u('text', summary) ])
      ]))
    })
    return arr
  }, [])

  return u('table', [tableHead].concat(tableRows))
}
545078
def row2table(soup, table, row):
    """"""
    tr = Tag(soup, name="tr")
    table.append(tr)
    for attr in row:
        td = Tag(soup, name="td")
        tr.append(td)
        td.append(attr)
834497
def row_to_obj(self, row, cur):
        """"""
        obj = tornado.util.ObjectDict()
        for val, desc in zip(row, cur.description):
            obj[desc.name] = val
        return obj
64517
def _get_data_from_table(source, fields='*', first_row=0, count=-1, schema=None):
  
  if not source.exists():
    return _get_data_from_empty_list(source, fields, first_row, count)
  if schema is None:
    schema = source.schema
  fields = get_field_list(fields, schema)
  gen = source.range(first_row, count) if count >= 0 else source
  rows = [{'c': [{'v': row[c]} if c in row else {} for c in fields]} for row in gen]
  return {'cols': _get_cols(fields, schema), 'rows': rows}, source.length
759296
def populateFromRow(self, row):
        
        self._dbFilePath = row[b'dataUrl']
        self._db = SqliteRnaBackend(self._dbFilePath)
        self.getRnaQuantMetadata()
448590
def generate_field_spec(row):
    
    names = set()
    fields = []
    for cell in row:
        name = column_alias(cell, names)
        field = {
            'name': name,
            'title': cell.column,
            'type': unicode(cell.type).lower(),
            'has_nulls': False,
            'has_empty': False,
            'samples': []
        }
        if hasattr(cell.type, 'format'):
            field['type'] = 'date'
            field['format'] = cell.type.format
        fields.append(field)
    return fields
933347
def make_row_dict(row):
    
    ind = row[row.notnull()].index
    values = row[row.notnull()].values
    # to transformation with extract_col_name here???
    return dict(list(zip(ind, values)))
624689
def subdomain_row_factory(cls, cursor, row):
        
        d = {}
        for idx, col in enumerate(cursor.description):
            d[col[0]] = row[idx]

        return d
315012
def create_from_table(cls, tab_e):
        

        convert_sed_cols(tab_e)
        try:
            emin = np.array(tab_e['e_min'].to(u.MeV))
            emax = np.array(tab_e['e_max'].to(u.MeV))
        except:
            emin = np.array(tab_e['e_min'])
            emax = np.array(tab_e['e_max'])

        ne = len(emin)
        try:
            ref_dnde = np.array(tab_e['ref_dnde'])
        except:
            ref_dnde = np.ones((ne))

        try:
            ref_flux = np.array(tab_e['ref_flux'])
        except:
            ref_flux = np.ones((ne))

        try:
            ref_eflux = np.array(tab_e['ref_eflux'])
        except:
            ref_eflux = np.ones((ne))

        try:
            ref_npred = np.array(tab_e['ref_npred'])
        except:
            ref_npred = np.ones((ne))

        return cls(emin, emax, ref_dnde, ref_flux, ref_eflux, ref_npred)
1206398
def row_to_content_obj(key_row):
    '''
    '''
    key, row = key_row
    cid = mk_content_id(key.encode('utf-8'))
    response = row.get('response', {})

    other_bows = defaultdict(StringCounter)
    for attr, val in row.get('indices', []):
        other_bows[attr][val] += 1
    try:
        artifact_id = key
        if isinstance(artifact_id, str):
            artifact_id = unicode(artifact_id, 'utf-8')
        fc = html_to_fc(
            response.get('body', ''),
            url=row.get('url'), timestamp=row.get('timestamp'),
            other_features=dict(other_bows, **{'artifact_id': artifact_id}))
    except:
        fc = None
        print('Could not create FC for %s:' % cid, file=sys.stderr)
        print(traceback.format_exc(), file=sys.stderr)
    return cid, fc