GET /reports
 GET /reports.json
960298
def index
      @reports = Report.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @reports }
      end
    end
1165241
def write_json(self):
        

        with open(self.results_folder_name + '/results-' + str(self.get_global_count()) + '.json', 'a') as f:
            json.dump(self.result, f)
679392
public function get($reportId, array $params = array())
    {
        $endpoint = '/admin/reports/'.$reportId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Report::class, $response['report']);
    }
580174
def get(self):
        
        url = "{url_base}/resource/{pid}/scimeta/custom/".format(url_base=self.hs.url_base,
                                                                 pid=self.pid)
        r = self.hs._request('GET', url)
        return json.loads(r.text)
175431
def list_files(self, project):
        
        path = "/projects/{}/files".format(project.id)
        res = yield from self.http_query("GET", path, timeout=120)
        return res.json
740308
def nice_report(self):
        """"""
        if not self.json:
            return '[no CSP report data]'
        try:
            data = json.loads(self.json)
        except ValueError:
            return "Invalid CSP report: '{}'".format(self.json)
        if 'csp-report' not in data:
            return 'Invalid CSP report: ' + json.dumps(data, indent=4, sort_keys=True, separators=(',', ': '))
        return json.dumps(data['csp-report'], indent=4, sort_keys=True, separators=(',', ': '))
153020
function getAssets(reportOptions) {
  const { assetsDir, cdn, dev, inlineAssets, reportDir } = reportOptions;
  const relativeAssetsDir = path.relative(reportDir, assetsDir);

  // Default URLs to assets path
  const assets = {
    inlineScripts: null,
    inlineStyles: null,
    scriptsUrl: path.join(relativeAssetsDir, 'app.js'),
    stylesUrl: path.join(relativeAssetsDir, 'app.css')
  };

  // If using inline assets, load files and strings
  if (inlineAssets) {
    assets.inlineScripts = loadFile(path.join(distDir, 'app.js'));
    assets.inlineStyles = loadFile(path.join(distDir, 'app.inline.css'));
  }

  // If using CDN, return remote urls
  if (cdn) {
    assets.scriptsUrl = `https://unpkg.com/mochawesome-report-generator@${pkg.version}/dist/app.js`;
    assets.stylesUrl = `https://unpkg.com/mochawesome-report-generator@${pkg.version}/dist/app.css`;
  }

  // In DEV mode, return local urls
  if (dev) {
    assets.scriptsUrl = 'http://localhost:8080/app.js';
    assets.stylesUrl = 'http://localhost:8080/app.css';
  }

  // Copy the assets if needed
  if (!dev && !cdn && !inlineAssets) {
    copyAssets(reportOptions);
  }

  return assets;
}
1049325
function SystemAPI(options) {
  const _Members = require('./Members');
  const _Reports = require('./Reports');

  return {
    Members: new _Members(options),
    Reports: new _Reports(options)
  }
}
275605
def build_report
      options = ReportBuilder.options

      groups = get_groups options[:input_path]

      json_report_path = options[:json_report_path] || options[:report_path]
      if options[:report_types].include? 'JSON'
        File.open(json_report_path + '.json', 'w') do |file|
          file.write JSON.pretty_generate(groups.size > 1 ? groups : groups.first['features'])
        end
      end

      if options[:additional_css] and Pathname.new(options[:additional_css]).file?
        options[:additional_css] = File.read(options[:additional_css])
      end

      if options[:additional_js] and Pathname.new(options[:additional_js]).file?
        options[:additional_js] = File.read(options[:additional_js])
      end

      html_report_path = options[:html_report_path] || options[:report_path]
      if options[:report_types].include? 'HTML'
        File.open(html_report_path + '.html', 'w') do |file|
          file.write get(groups.size > 1 ? 'group_report' : 'report').result(binding).gsub('  ', '').gsub("\n\n", '')
        end
      end

      retry_report_path = options[:retry_report_path] || options[:report_path]
      if options[:report_types].include? 'RETRY'
        File.open(retry_report_path + '.retry', 'w') do |file|
          groups.each do |group|
            group['features'].each do |feature|
              if feature['status'] == 'broken'
                feature['elements'].each do |scenario|
                  file.puts "#{feature['uri']}:#{scenario['line']}" if scenario['status'] == 'failed'
                end
              end
            end
          end
        end
      end
      [json_report_path, html_report_path, retry_report_path]
    end
530144
async def get_reports(self):
        
        cmd = OTGW_CMD_REPORT
        reports = {}
        for value in OTGW_REPORTS.keys():
            ret = await self._wait_for_cmd(cmd, value)
            if ret is None:
                reports[value] = None
                continue
            reports[value] = ret[2:]
        status = {
            OTGW_ABOUT: reports.get(OTGW_REPORT_ABOUT),
            OTGW_BUILD: reports.get(OTGW_REPORT_BUILDDATE),
            OTGW_CLOCKMHZ: reports.get(OTGW_REPORT_CLOCKMHZ),
            OTGW_MODE: reports.get(OTGW_REPORT_GW_MODE),
            OTGW_SMART_PWR: reports.get(OTGW_REPORT_SMART_PWR),
            OTGW_THRM_DETECT: reports.get(OTGW_REPORT_THERMOSTAT_DETECT),
            OTGW_DHW_OVRD: reports.get(OTGW_REPORT_DHW_SETTING),
        }
        ovrd_mode = reports.get(OTGW_REPORT_SETPOINT_OVRD)
        if ovrd_mode is not None:
            ovrd_mode = str.upper(ovrd_mode[0])
            status.update({OTGW_SETP_OVRD_MODE: ovrd_mode})
        gpio_funcs = reports.get(OTGW_REPORT_GPIO_FUNCS)
        if gpio_funcs is not None:
            status.update({
                OTGW_GPIO_A: int(gpio_funcs[0]),
                OTGW_GPIO_B: int(gpio_funcs[1]),
            })
        led_funcs = reports.get(OTGW_REPORT_LED_FUNCS)
        if led_funcs is not None:
            status.update({
                OTGW_LED_A: led_funcs[0],
                OTGW_LED_B: led_funcs[1],
                OTGW_LED_C: led_funcs[2],
                OTGW_LED_D: led_funcs[3],
                OTGW_LED_E: led_funcs[4],
                OTGW_LED_F: led_funcs[5],
            })
        tweaks = reports.get(OTGW_REPORT_TWEAKS)
        if tweaks is not None:
            status.update({
                OTGW_IGNORE_TRANSITIONS: int(tweaks[0]),
                OTGW_OVRD_HB: int(tweaks[1]),
            })
        sb_temp = reports.get(OTGW_REPORT_SETBACK_TEMP)
        if sb_temp is not None:
            status.update({OTGW_SB_TEMP: float(sb_temp)})
        vref = reports.get(OTGW_REPORT_VREF)
        if vref is not None:
            status.update({OTGW_VREF: int(vref)})
        if (ovrd_mode is not None and ovrd_mode != OTGW_SETP_OVRD_DISABLED):
            status[DATA_ROOM_SETPOINT_OVRD] = float(
                reports[OTGW_REPORT_SETPOINT_OVRD][1:])
        self._update_status(status)
        return dict(self._protocol.status)
590910
def _get_json(location):
    """"""
    location = os.path.expanduser(location)
    try:
        if os.path.isfile(location):
            with io.open(location, encoding="utf-8") as json_data:
                return json.load(json_data, object_pairs_hook=OrderedDict).get("tests")
        elif "http" in location:
            json_data = requests.get(location)
            if not json_data:
                raise Dump2PolarionException("Failed to download")
            return json.loads(json_data.text, object_pairs_hook=OrderedDict).get("tests")
        else:
            raise Dump2PolarionException("Invalid location")
    except Exception as err:
        raise Dump2PolarionException("Failed to parse JSON from {}: {}".format(location, err))
604552
def _GetReportService(self):
    """"""
    if not self._report_service:
      self._report_service = self._ad_manager_client.GetService(
          'ReportService', self._version, self._server)
    return self._report_service
992644
def _get(self, *args, **kwargs):
        
        response = requests.get(*args, **kwargs)

        response.raise_for_status()

        return response.json()
1043782
def get_all_file_report_pages(self, query):
        
        responses = []
        next_page, response = self.get_hashes_from_search(self, query)
        responses.append(_return_response_and_status_code(response))
        while next_page:
            next_page, response = self.get_hashes_from_search(query, next_page)
            responses.append(_return_response_and_status_code(response))
        return dict(results=responses)
510904
def to_json(*a)
      {
        name: name,
        version: version,
        hostname: hostname,
        stats: stats,
        checks: checks,
        timestamp: timestamp,
        uptime: uptime,
        diskusage: disk_usage,
        status: status
      }.to_json(*a)
    end
872218
def get_report(self, report_id, **params):
        """"""
        response = self._get('v2', 'reports', report_id, data=params)
        return self._make_api_object(response, Report)
908810
def start_report(self, report, account_id, _parameters=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # REQUIRED - PATH - report
        """ID"""
        path["report"] = report

        # OPTIONAL - [parameters]
        """The parameters will vary for each report"""
        if _parameters is not None:
            data["[parameters]"] = _parameters

        self.logger.debug("POST /api/v1/accounts/{account_id}/reports/{report} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/accounts/{account_id}/reports/{report}".format(**path), data=data, params=params, single_item=True)