Get a slice of the calculation log as a JSON list of rows
540260
def calc_log(request, calc_id, start, stop):
    
    start = start or 0
    stop = stop or 0
    try:
        response_data = logs.dbcmd('get_log_slice', calc_id, start, stop)
    except dbapi.NotFound:
        return HttpResponseNotFound()
    return HttpResponse(content=json.dumps(response_data), content_type=JSON)
863243
def get_game_logs(self):
        """"""
        logs = self.response.json()['resultSets'][0]['rowSet']
        headers = self.response.json()['resultSets'][0]['headers']
        df = pd.DataFrame(logs, columns=headers)
        df.GAME_DATE = pd.to_datetime(df.GAME_DATE)
        return df
443581
def append_logs_to_result_object(result_obj, result):
    
    logs = result.has_logs()
    result_obj["exec"]["logs"] = []
    if logs and result.logfiles:
        for log in logs:
            typ = None
            parts = log.split(os.sep)
            if "bench" in parts[len(parts) - 1]:
                typ = "framework"
            # elif "Dut" in parts[len(parts)-1]:
            #    typ = "dut"

            if typ is not None:
                name = parts[len(parts) - 1]
                try:
                    with open(log, "r") as file_name:
                        data = file_name.read()
                    dic = {"data": data, "name": name, "from": typ}
                    result_obj["exec"]["logs"].append(dic)
                except OSError:
                    pass
            else:
                continue
391406
def dict_row_reader(self):
        

        rows = self.unpacked_contents

        if not rows:
            return

        header = rows.pop(0)

        for row in rows:
            yield dict(list(zip(header, row)))
42092
def make_summary_funcs(rows, ids):
    """"""
    return {
        'len': len,
        'list': lambda *x: filter(None, list(x)),
        'max': max,
        'min': min,
        'rows': partial(summary_rows, rows, ids),
        'sum': sum,
        'trace': print_trace
    }
902965
def _get_data_from_list_of_dicts(source, fields='*', first_row=0, count=-1, schema=None):
  
  if schema is None:
    schema = google.datalab.bigquery.Schema.from_data(source)
  fields = get_field_list(fields, schema)
  gen = source[first_row: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}, len(source)
590655
def _join(self, rows):
    '''
    
    '''
    rval = {}
    for row in rows:
      if row:
        for value,count in row.items():
          rval[ value ] = count + rval.get(value,0)
    return rval
486066
def to_json(value, **kwargs):
        
        def _recurse_list(val):
            if val and isinstance(val[0], list):
                return [_recurse_list(v) for v in val]
            return [str(v) if np.isnan(v) or np.isinf(v) else v for v in val]
        return _recurse_list(value.tolist())
1257932
def parse_row(self, row, row_index, cell_mode=CellMode.cooked):
    """"""
    return [self.parse_cell(cell, (col_index, row_index), cell_mode) \
            for col_index, cell in enumerate(row)]
728384
def _get_pasteas_data(self, dim, obj):
        

        if dim == 0:
            return [[repr(obj)]]
        elif dim == 1:
            return [[repr(o)] for o in obj]
        elif dim == 2:
            return [map(repr, o) for o in obj]
713366
private List<Object> extractKeyAndRow(String timestamp, JSONObject jsonRow) {
        List<Object> rowValues = new ArrayList<>();
        rowValues.add(timestamp);
        for (Object key : jsonRow.keySet()) {
            rowValues.add(jsonRow.get(key.toString()));
        }
        return rowValues;
    }
365957
def get_values_json(self, lst, list_columns):
        
        result = []
        for item in self.get_values(lst, list_columns):
            for key, value in list(item.items()):
                if isinstance(value, datetime.datetime) or isinstance(
                    value, datetime.date
                ):
                    value = value.isoformat()
                    item[key] = value
                if isinstance(value, list):
                    item[key] = [str(v) for v in value]
            result.append(item)
        return result
981340
function(data){
			var rows = this.calculateScheduleRowsNumber();
			var datas = [];
			for(var i = 0; i < data.length; i += rows){
				datas.push(data.slice(i, i+rows));
			}
			return datas;
		}
814072
def log(array, cutoff):
    
    arr = numpy.copy(array)
    arr[arr < cutoff] = cutoff
    return numpy.log(arr)
377808
def bulk_log_data(registers = register_list)
      registers.map do |reg|
        read_scaled_range(reg.start, reg.count)
      end.flatten
    end
961951
def row_dict(self, row):
        """"""
        d = {}
        for field_name,index in self.field_map.items():
            d[field_name] = self.field_value(row, field_name)
        return d
848099
def logarithm(requestContext, seriesList, base=10):
    
    results = []
    for series in seriesList:
        newValues = []
        for val in series:
            if val is None:
                newValues.append(None)
            elif val <= 0:
                newValues.append(None)
            else:
                newValues.append(math.log(val, base))
        newName = "log(%s, %s)" % (series.name, base)
        newSeries = TimeSeries(newName, series.start, series.end, series.step,
                               newValues)
        newSeries.pathExpression = newName
        results.append(newSeries)
    return results