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 pandas as pd | |
chunksize = 10 ** 8 | |
for chunk in pd.read_csv(filename, chunksize=chunksize): | |
process(chunk) |
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 pandas as pd | |
import multiprocessing as mp | |
LARGE_FILE = "D:\\my_large_file.txt" | |
CHUNKSIZE = 100000 # processing 100,000 rows at a time | |
def process_frame(df): | |
# process data frame | |
return len(df) |
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 gtts import gTTS | |
from pdfminer.high_level import extract_text | |
import gradio as gr | |
def pdf_to_text(file_obj): | |
text = extract_text(file_obj.name) | |
myobj = gTTS(text=text, lang='en', slow=False) | |
myobj.save("test.wav") | |
return 'test.wav' |
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 gtts import gTTS | |
from pdfminer.high_level import extract_text | |
import gradio as gr | |
def pdf_to_text(file_obj): | |
text = extract_text(file_obj.name) | |
myobj = gTTS(text=text, lang='en', slow=False) | |
myobj.save("output.wav") | |
return 'output.wav' |
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 gtts import gTTS | |
from pdfminer.high_level import extract_text | |
def pdf_to_text(file_obj): | |
text = extract_text(file_obj.name) | |
myobj = gTTS(text=text, lang='en', slow=False) | |
myobj.save("test.wav") | |
return 'test.wav' |
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 typing import List | |
import random | |
def random_sampling(k: int, array_list: List[int]) -> None: | |
"""high level support for doing this and that.""" | |
for i in range(k): | |
random_index = random.randint(i, len(array_list) - 1) | |
# swap element based on the generated index | |
array_list[i], array_list[random_index] = array_list[random_index], array_list[i] |
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
name: configuration for python env | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
services: | |
db_service: |
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
name: Configure pyenv and pick the right version | |
on: [push, pull_request] | |
jobs: | |
# python installtion | |
install-python: | |
# should run on linux based operating system | |
runs-on: ubuntu-latest | |
steps: |
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
name: Configuring python env for postgress | |
# do the following jobs on push and on pull requests | |
on: [push, pull_request] | |
# define the jobs | |
jobs: | |
# first job is to set the servicea | |
setting-services: | |
# must runs on linux based operating system | |
runs-on: ubuntu-latest |
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
# custom_unpickling.py | |
import pickle | |
import pickle | |
import functools | |
import multiprocessing as mp | |
from math import sqrt | |
class Process: |
NewerOlder