This file contains hidden or 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 python | |
import re | |
import os | |
import sys | |
from typing import Tuple, Dict, Any | |
def extract_title_from_front_matter(content: str) -> str: | |
""" | |
Extract the 'title: ...' line from the front matter if present. |
This file contains hidden or 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
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from webdriver_manager.chrome import ChromeDriverManager | |
from tqdm import tqdm | |
import time | |
import os |
This file contains hidden or 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
class ActionAskYaqeenFaq(Action): | |
def name(self) -> Text: | |
return "action_ask_yaqeen_faq" | |
def run(self, dispatcher: CollectingDispatcher, | |
tracker: Tracker, | |
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: | |
last_text = tracker.latest_message["text"] |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>React D3.js Interactive Directed Graph Representation</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.production.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script> |
This file contains hidden or 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
# Intermediate server (Jump Host) | |
Host jumphost | |
HostName 45.251.56.227 | |
User root | |
IdentityFile ~/.ssh/id_rsa_legacy | |
PubkeyAuthentication yes | |
PasswordAuthentication yes | |
PreferredAuthentications publickey,password | |
ConnectTimeout 30 | |
ServerAliveInterval 60 |
This file contains hidden or 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
import requests | |
from typing import Any, Text, Dict, List | |
class BankAPI: | |
def __init__(self): | |
self.headers = {"Content-Type": "application/json"} | |
def data_validation(self, data_list): | |
data_list = list(map(str, data_list)) | |
return data_list |
This file contains hidden or 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
# OTP Implementation Flow and Code | |
## 1. Generate OTP | |
When a sensitive operation is requested, a new OTP is generated. | |
```python | |
def opt_generator(self): | |
opt_number = random.randint(self.otp_srange, self.opt_erange) | |
return opt_number |
This file contains hidden or 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
# Cell 1: Install dependencies | |
!pip install -q -U transformers llama-index accelerate pypdf einops bitsandbytes | |
!pip install -q llama-index-llms-huggingface | |
!pip install -q llama-index-embeddings-huggingface | |
# Cell 2: Import libraries and set up warnings | |
import warnings | |
warnings.filterwarnings('ignore') | |
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, ServiceContext |
This file contains hidden or 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
version: "3.1" | |
intents: | |
- greet | |
- goodbye | |
- affirm | |
- deny | |
- mood_great | |
- mood_unhappy |