This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Reading List exploration file | |
Exploring concepts and approaches to solving the problem | |
""" | |
#Step 1 - loading the browser and preparing for automation | |
from selenium import webdriver | |
from webdriver_manager.chrome import ChromeDriverManager | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.common.by import By |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Reading List exploration file | |
Exploring concepts and approaches to solving the problem | |
""" | |
#Step 1 - loading the browser and preparing for automation | |
from selenium import webdriver | |
from webdriver_manager.chrome import ChromeDriverManager | |
from selenium.webdriver.chrome.service import Service | |
chrome_options = webdriver.ChromeOptions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
records = [] | |
count = 0 | |
for entry in logLines: | |
elems = entry.decode('utf-8').split('"') | |
if(len(elems)) > 1: | |
count += 1 | |
rec = { | |
'remote_addr' : elems[0].split(' ')[0], | |
'remote_user' : elems[0].split(' ')[1], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.get("/api/private") | |
async def private(response: Response, token: str = Depends(token_auth_scheme)): # 👈 updated code | |
"""A valid access token is required to access this route""" | |
result = VerifyToken(token.credentials).verify() | |
if result.get("status"): | |
response.status_code = status.HTTP_400_BAD_REQUEST | |
return result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Feb 8 18:47:58 2022 | |
@author: davidmoore | |
""" | |
import uvicorn | |
from fastapi import FastAPI, Request | |
from fastapi.responses import FileResponse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filesd = ["/home/david/Downloads/test.pdf", | |
"/home/david/Downloads/test2.pdf", | |
"/home/david/Downloads/test3.pdf", | |
"/home/david/Downloads/test4.pdf" | |
] | |
url = 'http://localhost:8080/engine-rest' | |
worker_id = '1' | |
for filei in filesd: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_data_from_given_path(file_name: pycamunda.variable.Variable) -> typing.Dict[str, str]: | |
textback= p.from_file(file_name.value) | |
text = textback["content"].strip() | |
print(file_name) | |
if len(text) < 4000: | |
return {'text': text} | |
else: | |
return {'text': text[0:3800]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import axios from 'axios' | |
export default { | |
name: 'text', | |
props: { | |
msg: String | |
}, | |
data() { | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div class="container"> | |
<h1>{{ msg }}</h1> | |
<b-form @submit="getKeywords" @reset="onReset" v-if="show"> | |
<b-form-group | |
id="input-group-1" | |
label="Job description:" | |
label-for="input-1" | |
description="Copy and Paste in the text you want to work with." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/keywords', methods=['GET','POST']) | |
def keywords(): | |
response_object = {'keywords': ['birds','scatt']} | |
post_data = request.get_json() | |
if post_data['text'] != None: | |
keywords = LangServices.keywords(post_data['text']) | |
if len(keywords) > 0: | |
response_object = {'keywords' : keywords['ranked phrases']} | |
return jsonify(response_object) |
NewerOlder