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
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' | |
' SAMPLE: Encryption and decryption using DPAPI functions. | |
' | |
' To run this sample, create a new Visual Basic.NET project using the Console | |
' Application template and replace the contents of the Module1.vb file with | |
' the code below. | |
' | |
' Go to the folder %APPDATA%\Subversion\auth\svn.simple | |
' Copy the Encrypted Value of the password denoted by the line below 2 lines below the line saying password | |
' Compile the code and put this value in a new file called InputFile.txt and in the same location where you are executing the code. |
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
import functools | |
import pandas as pd | |
import torch | |
import transformers | |
from accelerate import Accelerator | |
from datasets import Dataset | |
from torch.utils.data import DataLoader | |
from tqdm.auto import tqdm |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from flask import Flask, jsonify, request, render_template | |
from queued_map import example_items | |
app = Flask(__name__) | |
@app.get("/") | |
@app.get("/<int:n>") | |
def home(n: int=10): | |
output = example_items(n) |
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
import asyncio | |
def async_decorator(acreate_fn): | |
async def _f(*args, **kwargs): | |
print(f"Decorated fn: {args=}, {kwargs=}. Sleeping.") | |
await asyncio.sleep(0.1) | |
return await acreate_fn(*args, **kwargs) | |
return _f | |
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
from copy import deepcopy | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
from scipy import sparse | |
from joblib import dump, load | |
import joblib | |
import time |
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
mkdir food.com | |
cd food.com | |
wget https://www.food.com/sitemap.xml | |
for url in $(cat sitemap.xml | grep "<loc>https://www.food.com/sitemap-" | sed -n 's:.*<loc>\(.*\)</loc>.*:\1:p'); | |
do echo "Download: $url"; | |
done | |
for url in $(cat sitemap.xml | grep "<loc>https://www.food.com/sitemap-" | sed -n 's:.*<loc>\(.*\)</loc>.*:\1:p'); | |
do wget "$url"; | |
done |
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
/** | |
* progress.c - Progress bar and progress percentage in C. | |
* This program uses ANSI escape codes to show an always updating progress line in the terminal. | |
* Author: Shubhanshu Mishra | |
**/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> |
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
from pathlib import Path | |
import torch | |
from transformers import CLIPProcessor, CLIPTextModelWithProjection | |
from accelerate import Accelerator | |
from datasets import Dataset | |
import pandas as pd | |
import numpy as np |
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
""" | |
pip install pypdf | |
""" | |
from pypdf import PdfWriter | |
def main(args): | |
merger = PdfWriter() | |
file_paths = args.input_files | |
for pdf in file_paths: |