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 timeit | |
| def sum_possible1(amount, numbers): | |
| # Initialize a table of size (amount + 1) with all False values | |
| dp = [False] * (amount + 1) | |
| # Base case: It is possible to get a sum of 0 with no numbers | |
| dp[0] = True | |
| for num in numbers: |
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
| # 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", { |
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
| # 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 |
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 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 |
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 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()] |
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 pandas as pd | |
| import time | |
| import io | |
| import json | |
| from langdetect import detect | |
| from snips_nlu import SnipsNLUEngine |
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
| for i in l: | |
| strr = '{' + '\r\n' + ' ' + '"text": ' + '"' + i + '"' +'\r\n' + '}' | |
| strr = strr + ',' | |
| print(strr) |
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 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') |
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
| { | |
| "entities": { | |
| "taka":{ | |
| "data": [ | |
| {"value": "2 tk","synonyms": ["2 Taka"]} | |
| ], | |
| "use_synonyms": true, | |
| "automatically_extensible": true | |
| }, | |
| "sms":{ |
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
| { | |
| "entities":{ | |
| "language":{ | |
| "data":[ | |
| { | |
| "value":"English", | |
| "synonyms":[ | |
| "English" | |
| ] | |
| }, |