repo_id
stringclasses
208 values
file_path
stringlengths
31
190
content
stringlengths
1
2.65M
__index_level_0__
int64
0
0
qxf2_public_repos/acc-model-app/tests
qxf2_public_repos/acc-model-app/tests/core_helpers/screenshot_objects.py
""" Helper class for Screenshot Objects """ import os import shutil from utils import Gif_Maker import conf.screenshot_conf as conf class Screenshot_Objects: def __init__(self): self.tesults_flag = False self.images = [] def save_screenshot(self,screenshot_name,pre_format=" #Debug screens...
0
qxf2_public_repos/acc-model-app/tests
qxf2_public_repos/acc-model-app/tests/core_helpers/web_app_helper.py
""" Page class that all page models can inherit from There are useful wrappers for common Selenium operations """ from selenium.webdriver.common.by import By import os,inspect from core_helpers.drivers.driverfactory import DriverFactory from .selenium_action_objects import Selenium_Action_Objects from .remote_objects ...
0
qxf2_public_repos/acc-model-app/tests
qxf2_public_repos/acc-model-app/tests/core_helpers/mobile_app_helper.py
""" Page class that all page models can inherit from There are useful wrappers for common Selenium operations """ import unittest,os,inspect import time from core_helpers.drivers.driverfactory import DriverFactory from .selenium_action_objects import Selenium_Action_Objects from .logging_objects import Logging_Objects ...
0
qxf2_public_repos/acc-model-app/tests
qxf2_public_repos/acc-model-app/tests/core_helpers/selenium_action_objects.py
""" Helper class for Selenium Objects """ import time from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.b...
0
qxf2_public_repos/acc-model-app/tests
qxf2_public_repos/acc-model-app/tests/core_helpers/remote_objects.py
""" Helper class for Remote Objects """ class Remote_Objects: def __init__(self): self.image_url_list = [] self.msg_list = [] self.testrail_flag = False self.tesults_flag = False self.test_run_id = None self.images = [] def register_testrail(self): "Regi...
0
qxf2_public_repos/acc-model-app/tests/core_helpers
qxf2_public_repos/acc-model-app/tests/core_helpers/drivers/local_options.py
""" Get the webrivers for local browsers. """ from selenium.webdriver.chrome.options import Options import sys from selenium import webdriver class LocalOptions(): """Class contains methods for getting webfrivers for various browsers.""" @staticmethod def firefox_local(): """Get webdriver for fire...
0
qxf2_public_repos/acc-model-app/tests/core_helpers
qxf2_public_repos/acc-model-app/tests/core_helpers/drivers/driverfactory.py
""" DriverFactory class This module gets the webdrivers for different browsers and sets up the remote testing platforms for automation tests and mobile tests. """ import os import sys from dotenv import load_dotenv from integrations.cross_browsers.remote_options import RemoteOptions from .local_options import LocalOpti...
0
qxf2_public_repos/acc-model-app
qxf2_public_repos/acc-model-app/backend/logging_config.py
""" Logging configuration for the application. """ import logging import os def setup_logging(): """ Set up logging configuration - configures the root logger with console and file handlers, sets their formatters, log levels, and adds them to the root logger. """ try: # Define the base di...
0
qxf2_public_repos/acc-model-app
qxf2_public_repos/acc-model-app/backend/requirements.txt
fastapi uvicorn sqlalchemy alembic httpx pytest pyjwt passlib[bcrypt] bcrypt python-jose python-multipart python-dotenv alembic psycopg2-binary
0
qxf2_public_repos/acc-model-app
qxf2_public_repos/acc-model-app/backend/alembic.ini
# A generic, single database configuration. [alembic] # path to migration scripts # Use forward slashes (/) also on windows to provide an os agnostic path script_location = alembic # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s # Uncomment the line below if you want the file...
0
qxf2_public_repos/acc-model-app
qxf2_public_repos/acc-model-app/backend/Dockerfile
# Use an official Python image FROM python:3.11-slim # Set working directory WORKDIR /app # Copy backend code COPY . /app # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Expose the FastAPI port EXPOSE 8000 # Set the command to run the FastAPI app CMD ["uvicorn", "app.main:app", "--host"...
0
qxf2_public_repos/acc-model-app/backend
qxf2_public_repos/acc-model-app/backend/app/models.py
""" This module consists of the SQLAlchemy models used to define the structure of the tables in the database. """ # pylint: disable=too-few-public-methods, invalid-name from datetime import datetime from sqlalchemy import Column, ForeignKey, Integer, String, Text from sqlalchemy.orm import relationship from sqlalchem...
0
qxf2_public_repos/acc-model-app/backend
qxf2_public_repos/acc-model-app/backend/app/database.py
""" This module sets up the database connection and session for SQLAlchemy. """ import os from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from dotenv import load_dotenv load_dotenv() SQLALCHEMY_DATABASE_URL = os.getenv("DATABASE_URL") engine = create_engine(SQLALCHEMY_DATABASE_URL) Ses...
0
qxf2_public_repos/acc-model-app/backend
qxf2_public_repos/acc-model-app/backend/app/schemas.py
""" This module contains the Pydantic models used to define the structure of the data that the API will handle. """ from datetime import datetime from typing import Optional, List, Union from pydantic import BaseModel, ConfigDict, Field class ACCModelBase(BaseModel): """ Base model for ACCModel with common pr...
0
qxf2_public_repos/acc-model-app/backend
qxf2_public_repos/acc-model-app/backend/app/main.py
""" This module initializes and configures the FastAPI application, sets up logging, and defines the main entry point for the backend API. """ import logging import os import sys import uvicorn from fastapi import FastAPI, Request from fastapi.responses import JSONResponse from fastapi.middleware.cors import CORSMiddl...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/attributes.py
""" This module defines the API endpoints related to attributes. Endpoints: - POST /attributes/ : Create a new attribute. - GET /attributes/ : Retrieve a list of attributes. - GET /attributes/{attribute_id} : Retrieve a specific attribute by ID. - PUT /attributes/{attribute_id} : Update a specific attribute by ID. - D...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/users.py
""" This module defines the API endpoints related to users. The endpoints are: - `POST /users`: Creates a new user. - `GET /users`: Retrieves a list of users. - `GET /users/me`: Retrieves the current logged user. - `GET /users/{user_id}`: Retrieves a user by its ID. - `PUT /users/{user_id}`: Updates an existing user. ...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/security.py
""" Authentication and Authorization Endpoints for FastAPI. This module provides the following endpoints: - `POST /token`: Login and generate an access token. It also includes functions for: - Password hashing and verification. - User authentication. - JWT token creation and validation. """ import os import logging ...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/capabilities.py
""" This module defines the API endpoints related to capabilities. The endpoints are: - `POST /capabilities`: Creates a new capability. - `GET /capabilities`: Retrieves a list of all capabilities. - `GET /capabilities/{capability_id}`: Retrieves a capability by its ID. - `PUT /capabilities/{capability_id}`: Updates an...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/ratings.py
""" This module defines the API endpoints related to ratings. The endpoints are: - `GET /rating-options/`: Returns a list of rating values to be provided to the capabilities against the attributes. """ from typing import List from fastapi import APIRouter router = APIRouter() RATING_VALUES = [ "Stable", ...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/components.py
"""" This module defines the API endpoints related to components. The endpoints are: - `POST /components`: Creates a new component. - `GET /components`: Retrieves a list of all components. - `GET /components/acc_model/{acc_model_id}`: Retrieves a list of components associated with a specific acc_model_id. - `GET /...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/acc_models.py
""" This module defines the API endpoints related to ACC Models. The endpoints are: - `POST /acc-models`: Creates a new ACCModel instance. - `GET /acc-models`: Retrieves a list of ACC models. - `GET /acc-models/{acc_model_id}`: Retrieves an ACC model by its ID. - `PUT /acc-models/{acc_model_id}`: Updates an existing A...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/routers/capabilities_assessments.py
"""" This module defines the API endpoints related to capability assessments. The endpoints are: - POST /capability-assessments/batch/: Creates or updates ratings for capability assessments in batch. - POST /capability-assessments/bulk/ids: Retrieves capability assessment IDs for the given capability IDs and ...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/crud/attributes.py
""" This module contains the CRUD (Create, Read, Update, Delete) operations related to attributes table. """ from sqlalchemy.orm import Session from sqlalchemy import func from app import schemas, models def get_attribute(db_session: Session, attribute_id: int): """ Retrieves an attribute from the database b...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/crud/users.py
""" This module defines the API endpoints related to users. """ from fastapi import HTTPException from sqlalchemy.orm import Session from sqlalchemy import func from passlib.context import CryptContext from app import models, schemas HASHER = CryptContext(schemes=["bcrypt"], deprecated="auto") def verify_password(p...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/crud/utils.py
""" This module contains common utility functions used in other modules. """ import logging from typing import List from typing import Dict, Any from sqlalchemy.orm import Session from app.models import Capability, Attribute, CapabilityAssessment, Component, ACCModel logger = logging.getLogger(__name__) def get_full...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/crud/capabilities.py
""" This module contains the CRUD (Create, Read, Update, Delete) operations related to capabilities table. """ from typing import List from typing import Optional from sqlalchemy.orm import Session from sqlalchemy import func from fastapi import HTTPException from app import models, schemas def get_capability(db_sess...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/crud/ratings.py
""" This module contains the CRUD (Create, Read, Update, Delete) operations related to ratings table. """ import logging from datetime import datetime from typing import List from sqlalchemy.orm import Session from sqlalchemy.sql import func, and_ from fastapi import HTTPException from app import schemas, models logg...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/crud/components.py
""" This module contains the CRUD (Create, Read, Update, Delete) operations related to components table. """ from typing import List from sqlalchemy.orm import Session from sqlalchemy import func from fastapi import HTTPException from app import schemas, models from app.crud import acc_models def get_component(db_sess...
0
qxf2_public_repos/acc-model-app/backend/app
qxf2_public_repos/acc-model-app/backend/app/crud/acc_models.py
""" This module contains the CRUD (Create, Read, Update, Delete) operations related to acc_models table. """ from sqlalchemy.orm import Session from sqlalchemy import func from app import schemas, models def get_acc_model(db_session: Session, acc_model_id: int): """ Retrieves an ACCModel instance from the da...
0
qxf2_public_repos/acc-model-app/backend
qxf2_public_repos/acc-model-app/backend/alembic/script.py.mako
"""${message} Revision ID: ${up_revision} Revises: ${down_revision | comma,n} Create Date: ${create_date} """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa ${imports if imports else ""} # revision identifiers, used by Alembic. revision: str = ${repr(up_revision)} down_revision: U...
0
qxf2_public_repos/acc-model-app/backend
qxf2_public_repos/acc-model-app/backend/alembic/env.py
""" Alembic environment configuration for database migrations. Loads environment variables, sets up logging, and defines target metadata. """ import os import sys from logging.config import fileConfig from sqlalchemy import engine_from_config from sqlalchemy import pool from dotenv import load_dotenv from app import m...
0
qxf2_public_repos/acc-model-app/backend/alembic
qxf2_public_repos/acc-model-app/backend/alembic/versions/733a3a4ee3db_add_cascade_delete_to_rating_history_.py
"""Add cascade delete to rating_history relationship Revision ID: 733a3a4ee3db Revises: 53882e95da98 Create Date: 2024-11-22 14:45:58.944962 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '733a3a4ee3db' down_revision: U...
0
qxf2_public_repos/acc-model-app/backend/alembic
qxf2_public_repos/acc-model-app/backend/alembic/versions/53882e95da98_initial_migration.py
"""Initial migration Revision ID: 53882e95da98 Revises: Create Date: 2024-11-07 16:09:48.025336 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '53882e95da98' down_revision: Union[str, None] = None branch_labels: Union[...
0
qxf2_public_repos
qxf2_public_repos/patient-health-record-dapp/LICENSE
MIT License Copyright (c) 2023 Indira Nellutla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, d...
0
qxf2_public_repos
qxf2_public_repos/patient-health-record-dapp/README.md
A simple Dapp example for building a decentralized application. ## Pre-requisites: NodeJS, React, Truffle, MetaMask, Ganache ## Truffle Installation: In the Terminal or Command Prompt, type the following command and press Enter: `npm install -g truffle` ## Metamask Installation: MetaMask is a popular browser ext...
0
qxf2_public_repos
qxf2_public_repos/patient-health-record-dapp/package.json
{ "name": "patient-contract", "version": "1.0.0", "description": "", "main": "truffle-config.js", "directories": { "test": "test" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "@truffle/hdwallet-provider": "^2...
0
qxf2_public_repos
qxf2_public_repos/patient-health-record-dapp/truffle-config.js
/** * Use this file to configure your truffle project. It's seeded with some * common settings for different networks and features like migrations, * compilation, and testing. Uncomment the ones you need or modify * them to suit your project as necessary. * * More information about configuration can be found at: ...
0
qxf2_public_repos/patient-health-record-dapp
qxf2_public_repos/patient-health-record-dapp/migrations/2_deploy_contract.js
const HealthRecord = artifacts.require("HealthRecord"); module.exports = function (deployer) { deployer.deploy(HealthRecord); };
0
qxf2_public_repos/patient-health-record-dapp
qxf2_public_repos/patient-health-record-dapp/test/test_smart_contract.js
const HealthRecord = artifacts.require('HealthRecord'); contract('HealthRecord Testcases', (accounts) => { let healthRecordInstance; const addedPatients = []; beforeEach(async () => { healthRecordInstance = await HealthRecord.deployed(); }); describe("Basic Functionality", () => { ...
0
qxf2_public_repos/patient-health-record-dapp
qxf2_public_repos/patient-health-record-dapp/contracts/HealthRecord.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract HealthRecord { struct Patient { uint256 id; string name; uint256 age; } mapping(uint256 => Patient) public patients; event PatientAdded(uint256 indexed id, string name, uint256 age); event PatientUpd...
0
qxf2_public_repos/patient-health-record-dapp/build
qxf2_public_repos/patient-health-record-dapp/build/contracts/HealthRecord.json
{ "contractName": "HealthRecord", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "patients", "outputs": [ { "name": "id", "type": "uint256" }, { "name": ...
0
qxf2_public_repos/patient-health-record-dapp
qxf2_public_repos/patient-health-record-dapp/client/README.md
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view...
0
qxf2_public_repos/patient-health-record-dapp
qxf2_public_repos/patient-health-record-dapp/client/package.json
{ "name": "client", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "web-vitals": "^2.1....
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/public/index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="theme-color" content="#000000" /> <meta name="description" content="Web site created u...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/public/manifest.json
{ "short_name": "React App", "name": "Create React App Sample", "icons": [ { "src": "favicon.ico", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" }, { "src": "logo192.png", "type": "image/png", "sizes": "192x192" }, { "src": "logo512.png", ...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/public/robots.txt
# https://www.robotstxt.org/robotstxt.html User-agent: * Disallow:
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/reportWebVitals.js
const reportWebVitals = onPerfEntry => { if (onPerfEntry && onPerfEntry instanceof Function) { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { getCLS(onPerfEntry); getFID(onPerfEntry); getFCP(onPerfEntry); getLCP(onPerfEntry); getTTFB(onPerfEntry); })...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/App.css
.App { text-align: center; } .App-logo { height: 40vmin; pointer-events: none; } @media (prefers-reduced-motion: no-preference) { .App-logo { animation: App-logo-spin infinite 20s linear; } } .App-header { background-color: #282c34; min-height: 100vh; display: flex; flex-direction: column; al...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/index.js
import React from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; import reportWebVitals from './reportWebVitals'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( <React.StrictMode> <App /> </React.StrictMode> ); // If you want t...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/index.css
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } code { font-family: source-code-pro, Menlo, Mona...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/App.test.js
import { render, screen } from '@testing-library/react'; import App from './App'; test('renders learn react link', () => { render(<App />); const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument(); });
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/AddPatientForm.js
import React, { useState } from 'react'; const { Web3 } = require('web3'); const abi = require('./abis/HealthRecord.json'); //Function to load the Web3 instance and enable it if available const loadWeb3 = async () => { if (window.ethereum) { window.web3 = new Web3(window.ethereum) await window.ethereum.enabl...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/AddPatientForm.css
/* AddPatientForm.css */ .container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 30vh; background-color: #f8f8f8; } .form { width: 400px; background-color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 4p...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/setupTests.js
// jest-dom adds custom jest matchers for asserting on DOM nodes. // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom';
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/logo.svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6...
0
qxf2_public_repos/patient-health-record-dapp/client
qxf2_public_repos/patient-health-record-dapp/client/src/App.js
import React from 'react'; import './App.css'; import AddPatientForm from './AddPatientForm'; function App() { return ( <div className="App"> <h1>Patient Record dApp</h1> <AddPatientForm /> </div> ); } export default App;
0
qxf2_public_repos/patient-health-record-dapp/client/src
qxf2_public_repos/patient-health-record-dapp/client/src/abis/HealthRecord.json
{ "contractName": "HealthRecord", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "patients", "outputs": [ { "name": "id", "type": "uint256" }, { "name": ...
0
qxf2_public_repos
qxf2_public_repos/QuarksB/LICENSE
MIT License Copyright (c) 2022 qxf2 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, ...
0
qxf2_public_repos
qxf2_public_repos/QuarksB/requirements.txt
attrs>=21.4.0 boto3>=1.20.42 botocore>=1.23.42 certifi>=2021.10.8 charset-normalizer>=2.0.10 idna>=3.3 iniconfig>=1.1.1 jmespath>=0.10.0 loguru>=0.6.0 packaging>=21.3 pluggy>=1.0.0 py>=1.11.0 pyparsing>=3.0.7 pytest>=6.2.5 python-dateutil>=2.8.2 requests>=2.27.1 s3transfer>=0.5.0 six>=1.16.0 toml>=0.10.2 urllib3>=1.26....
0
qxf2_public_repos
qxf2_public_repos/QuarksB/README.md
# QuarksB Repo for Qxf2's microservices framework. Development for the framework started in early 2022 and is still in progress. ## Unless you are contributing to the development of this repo, do not clone yet!
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/tests/conftest.py
""" pytest configuration file """ import concurrent.futures import os import sys import pytest from helpers.cloudwatch_helper import CloudWatchHelper from helpers.sqs_helper import SqsHelper from helpers.skype_helper import SkypeHelper @pytest.fixture def sqs_instance(request): "pytest fixture for SQS module" ...
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/tests/test_message_cloudwatch.py
""" Test script to: - Validate message sent to Skype channel against the message processed by Lambda, in the Lambda's CloudWatchLogs """ import os import sys import time sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from conf import skype_conf, cloudwatch_conf def test_message_receive...
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/tests/test_message_sqs.py
""" Test script to: - Validate message sent to Skype channel against the message received on SQS """ import time from conf import sqs_conf from conf import skype_conf def test_message_received_sqs(sqs_instance, skype_instance, concurrent_obj): """ Validate the message triggered from Skype """ try: ...
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/conf/sqs_conf.py
""" Queue conf """ from botocore.config import Config SQS_NAME = "staging-newsletter-generator" config = Config( retries = { 'max_attempts': 10, 'mode': 'standard' } )
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/conf/cloudwatch_conf.py
""" AWS CloudWatchLogs conf """ cloudwatch_log_group = '/aws/lambda/staging-newsletter-url-filter' cloudwatch_query = "fields @timestamp, @message | filter @message like 'Test message sent on '"
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/conf/skype_conf.py
""" Skype conf """ from datetime import datetime SKYPE_SENDER_ENDPOINT = "https://skype-sender.qxf2.com/send-message" MESSAGE = 'Test message sent on ' + datetime.now().strftime('%d-%m-%Y %H:%M:%S')
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/helpers/skype_helper.py
""" Helper module for Skype """ import os import sys import requests from helpers.base_helper import BaseHelper class SkypeHelper(BaseHelper): """ Skype Helper object """ def post_message_on_skype(self, skype_message, skype_url): "Posts a predefined message on the set Skype channel" try...
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/helpers/sqs_helper.py
""" Helper module for sqs messages """ import json import os import sys import time import boto3 from botocore.exceptions import ClientError # add project root to sys path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from helpers.base_helper import BaseHelper from conf import sqs_conf ...
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/helpers/cloudwatch_helper.py
""" Helper module for AWS CloudWatchLogs messages """ from datetime import datetime, timedelta import os import sys import time import boto3 from botocore.exceptions import ClientError from helpers.base_helper import BaseHelper class CloudWatchHelper(BaseHelper): """ CloudWatch Helper object """ def __...
0
qxf2_public_repos/QuarksB
qxf2_public_repos/QuarksB/helpers/base_helper.py
""" Base Helper Object """ from loguru import logger class BaseHelper(): """ Base class object for other helpers """ def __init__(self): "Initialize base class" self.logger = logger def write(self, msg, level='info'): "Write log message" try: if level =...
0
qxf2_public_repos
qxf2_public_repos/what-is-confusing/README.md
# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts In the project directory, you can run: ### `npm start` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view...
0
qxf2_public_repos
qxf2_public_repos/what-is-confusing/package-lock.json
{ "name": "what-is-confusing", "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZ...
0
qxf2_public_repos
qxf2_public_repos/what-is-confusing/package.json
{ "name": "what-is-confusing", "version": "0.1.0", "private": true, "dependencies": { "@material-ui/core": "^4.11.3", "@material-ui/icons": "^4.11.2", "@testing-library/jest-dom": "^5.11.10", "@testing-library/react": "^11.2.6", "@testing-library/user-event": "^12.8.3", "axios": "^0.21.1...
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/public/index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="theme-color" content="#000000" /> <meta name="description" content="Web site created u...
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/public/manifest.json
{ "short_name": "React App", "name": "Create React App Sample", "icons": [ { "src": "favicon.ico", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" }, { "src": "logo192.png", "type": "image/png", "sizes": "192x192" }, { "src": "logo512.png", ...
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/public/robots.txt
# https://www.robotstxt.org/robotstxt.html User-agent: * Disallow:
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/src/App.css
.App { text-align: center; background-color: rgb(195, 0, 255); flex-direction: column; align-items: center; justify-content: center; height: 100vh; padding: 100px; } .card{ border-radius: 0%; padding: 1em; } .buttonText{ position: relative; padding: 5px; background-color: transparent; displ...
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/src/index.js
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; ReactDOM.render( <React.StrictMode> <App /> </React.StrictMode>, document.getElementById('root') );
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/src/index.css
body { margin: 0; width: 100%; height: 100vh; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } code { font-fami...
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/src/App.test.js
import { render, screen } from '@testing-library/react'; import App from './App'; test('renders learn react link', () => { render(<App />); const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument(); });
0
qxf2_public_repos/what-is-confusing
qxf2_public_repos/what-is-confusing/src/App.js
import React, { useState, useEffect } from "react"; import "./App.css"; import Card from "@material-ui/core/Card"; import CardActions from "@material-ui/core/CardActions"; import CardContent from "@material-ui/core/CardContent"; import Button from "@material-ui/core/Button"; import { CountdownCircleTimer } from "react-...
0
qxf2_public_repos/what-is-confusing/src
qxf2_public_repos/what-is-confusing/src/server/Service.js
import axios from "axios"; export default axios.create({ baseURL : "http://127.0.0.1:5000/" })
0
qxf2_public_repos
qxf2_public_repos/water-cooler-talks/LICENSE
MIT License Copyright (c) 2021 PreedhiVivek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, dist...
0
qxf2_public_repos
qxf2_public_repos/water-cooler-talks/requirements.txt
boto3>=1.17.101 requests>=2.25.1
0
qxf2_public_repos
qxf2_public_repos/water-cooler-talks/README.md
# water-cooler-talks Buzz a colleague to join the Jitsi room for water cooler conversations. Note: We have our own Jitsi server setup, with a room set aside for chit-chat at Qxf2. Prerequisites 1. Install Python 3.x 2. Add Python 3.x your PATH environment variable 3. If you do not have it already, get pip (NOTE: Most ...
0
qxf2_public_repos/water-cooler-talks
qxf2_public_repos/water-cooler-talks/listener/jitsi_listener.py
""" Jitsi listener service to, Invoke the lambda that buzzes colleagues on their Raspberry Pi device, when a colleague wants to have water cooler conversations. """ #!/usr/bin/env python3 import logging import json import os import time from logging.handlers import RotatingFileHandler import boto3 import reques...
0
qxf2_public_repos/water-cooler-talks
qxf2_public_repos/water-cooler-talks/listener/makefile
all: jitsi-listener jitsi-listener.service .PHONY: all jitsi-listener install uninstall lib_dir = /usr/local/lib/jitsi_listener conf_dir = /usr/local/etc/jitsi_listener service_dir = /etc/systemd/system venv = $(lib_dir)/venv_listener install: $(service_dir) jitsi-listener.service @echo Installing the service file......
0
qxf2_public_repos/water-cooler-talks
qxf2_public_repos/water-cooler-talks/listener/jitsi-listener.service
[Unit] Description=Jitsi Listener System Service [Service] WorkingDirectory=/usr/local/lib/jitsi_listener/ EnvironmentFile=/usr/local/etc/jitsi_listener/jitsi_listener.env ExecStart=/usr/local/lib/jitsi_listener/venv/bin/python3 /usr/local/lib/jitsi_listener/jitsi_listener.py Restart=always [Install] WantedBy=multi-...
0
qxf2_public_repos
qxf2_public_repos/cars-api/LICENSE
MIT License Copyright (c) 2017 Qxf2 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, ...
0
qxf2_public_repos
qxf2_public_repos/cars-api/requirements.txt
Flask>=1.1.2
0
qxf2_public_repos
qxf2_public_repos/cars-api/Dockerfile
#Dockerfile to build an image/container to host cars-api #Pull python Image FROM python LABEL maintainer = "Qxf2 Services" #Clone cars-api repository for Docker Image creation RUN git clone https://github.com/qxf2/cars-api.git #Set working directory WORKDIR /cars-api #Install packages listed in requirements.txt file...
0
qxf2_public_repos
qxf2_public_repos/cars-api/carsapi.service
[Unit] Description=Gunicorn instance to serve carsapi After=network.target [Service] WorkingDirectory=/home/ubuntu/code/cars-api Environment="PATH=/home/ubuntu/code/venv-carsapi/bin" ExecStart=/home/ubuntu/code/venv-carsapi/bin/gunicorn -b 0.0.0.0:5000 cars_app:app Restart=always RestartSec=1 [Install] WantedBy=multi...
0
qxf2_public_repos
qxf2_public_repos/cars-api/cars_app.py
""" Cars API is a sample web application developed by Qxf2 Services to help testers learn API automation. This REST application written in Python was built solely to help QA learn to write API automation. The application has endpoints for you to practice automating GET, POST, PUT and DELETE methods. It includes endpoin...
0
qxf2_public_repos
qxf2_public_repos/cars-api/README.md
# cars-api A sample REST application to help testers learn to write API automation. ---- RUN ----- To run cars api on local machine:- `python cars_app.py` ------------------------- API ENDPOINTS & EXAMPLES ---------------------------- If you are simply interested in trying out various operations with the requests mo...
0
qxf2_public_repos/cars-api
qxf2_public_repos/cars-api/terraform/output.tf
/*The Public IP of the instance displayed on the console*/ output "instance_public_ip" { description = "Public IP address of the EC2 instance" value = aws_instance.carsapp_server.public_ip }
0
qxf2_public_repos/cars-api
qxf2_public_repos/cars-api/terraform/security-groups.tf
/* Security Group for carsapp_server*/ resource "aws_security_group" "carsapp_sg" { name = "allow_web_traffic" description = "Allow Web inbound traffic" ingress { description = "Allow HTTP" from_port = 80 to_port = 80 protocol = "tcp" cidr_blocks = ["...
0
qxf2_public_repos/cars-api
qxf2_public_repos/cars-api/terraform/nginx.conf.tpl
server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; server_name _; location / { include proxy_params; proxy_pass http://0.0.0.0:5000; } }
0
qxf2_public_repos/cars-api
qxf2_public_repos/cars-api/terraform/carsapi.service.tpl
[Unit] Description=Gunicorn instance to serve carsapi After=network.target StartLimitIntervalSec=0 [Service] WorkingDirectory=${home_directory}/code/cars-api Environment="PATH=${home_directory}/code/venv-carsapi/bin" ExecStart=${home_directory}/code/venv-carsapi/bin/gunicorn -b 0.0.0.0:5000 cars_app:app Restart=always...
0
qxf2_public_repos/cars-api
qxf2_public_repos/cars-api/terraform/README.md
# terraform configuration files to deploy cars-api app 1) AWS credentials configuration - https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html 2) Steps on how to install Terraform.: https://phoenixnap.com/kb/how-to-install-terraform or step#1) Run the following commands at the ter...
0