View py_session_django.py
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
# Python DJango Session | |
def index(request): | |
# check if there already exists a "tasks" key in our session | |
if "tasks" not in request.session: | |
request.session["tasks"] = [] | |
return render(request, "tasks/index.html", { |
View Dockerfile
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
# syntax = docker/dockerfile:experimental | |
# | |
# NOTE: To build this you will need a docker version > 18.06 with | |
# experimental enabled and DOCKER_BUILDKIT=1 | |
# | |
# If you do not use buildkit you are not going to have a good time | |
# | |
# For reference: | |
# https://docs.docker.com/develop/develop-images/build_enhancements/ | |
ARG BASE_IMAGE=ubuntu:18.04 |
View Dockerfile
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 ubuntu:22.04 | |
LABEL maintainer="genuity systems LTD" | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Avoid "delaying package configuration, since apt-utils is not installed" | |
RUN apt update && apt install --yes apt-utils | |
# Environment |
View iterable.py
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 dataclasses import dataclass | |
@dataclass | |
class Person: | |
name: str | |
age: int | |
city: str | |
def __iter__(self): | |
self._fields = [field.name for field in self.__dataclass_fields__.values()] |
View json_to_csv_snips_NLU.py
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 time | |
import io | |
import json | |
from langdetect import detect | |
from snips_nlu import SnipsNLUEngine |
View damn_text.py
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 base64 | |
unclean_data = pd.read_csv('/home/ehz/Downloads/email_date_dec22_Blank.csv') | |
# print(unclean_data) | |
# print(unclean_data.columns.tolist()) | |
# print(unclean_data['Subject']) | |
# super_clean_data = unclean_data[[' Subject',' Customer-Email']].dropna(axis=0, how='any') | |
super_clean_data = unclean_data[' Customer-Email'].dropna(axis=0, how='any') |
View gist:a30907eae2c9e727e63327586ffc6606
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
for i in l: | |
strr = '{' + '\r\n' + ' ' + '"text": ' + '"' + i + '"' +'\r\n' + '}' | |
strr = strr + ',' | |
print(strr) |
View dataset.json
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
{ | |
"entities": { | |
"taka":{ | |
"data": [ | |
{"value": "2 tk","synonyms": ["2 Taka"]} | |
], | |
"use_synonyms": true, | |
"automatically_extensible": true | |
}, | |
"sms":{ |
View is_it_a_valid_json.json
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
{ | |
"entities":{ | |
"language":{ | |
"data":[ | |
{ | |
"value":"English", | |
"synonyms":[ | |
"English" | |
] | |
}, |
View hey_ya.json
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
{ | |
"entities": { | |
"language":{ | |
"data": [ | |
{"value": "English","synonyms": ["English"]}, | |
{"value": "Bangla","synonyms": ["Bangla"]} | |
], | |
"use_synonyms": true, | |
"automatically_extensible": true | |
} |
NewerOlder