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 kb import index_knowledge_base, ask_knowledge_base | |
kb.index_knowledge_base('./datasets') # dossier avec des pdfs ou d'autres documents | |
kb.ask_knowledge_base('Quels sont les 3 techniques qui fonctionnent pour éliminer les moustiques d un marécage ?') |
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
# pyarrow.Table | |
# 0: string | |
# 1: int64 | |
# 2: string | |
# __index_level_0__: int64 | |
# ---- | |
# 0: [["Alice","Bob","Charlie","Charlie"]] | |
# 1: [[30,25,35,28]] | |
# 2: [["New York","San Francisco","Chicago","Chicago"]] | |
# __index_level_0__: [[0,1,2,3]] |
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 csv | |
import io | |
from multicorn import ForeignDataWrapper | |
class FileCsvForeignDataWrapper(ForeignDataWrapper): | |
def __init__(self, options, columns): | |
super(FileCsvForeignDataWrapper, self).__init__(options, columns) | |
self.options = options |
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 os | |
import sys | |
SCRIPT_DIR = os.path.realpath(os.path.join(__file__, '..')) | |
ROOT_DIR = os.path.realpath(os.path.join(SCRIPT_DIR, '..')) | |
def main(arguments): |
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/python | |
# coding=utf-8 | |
import os | |
import tempfile | |
from subprocess import call | |
def main(): | |
os.environ["TMPDIR"] = "/home/far/tmp" | |
print(tempfile.gettempdir()) |
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
#!/bin/sh | |
# | |
# An example hook script to prepare the commit log message. | |
# Called by "git commit" with the name of the file that has the | |
# commit message, followed by the description of the commit | |
# message's source. The hook's purpose is to edit the commit | |
# message file. If the hook fails with a non-zero status, | |
# the commit is aborted. | |
# | |
# To enable this hook, rename this file to "prepare-commit-msg". |
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 bash | |
readonly SCRIPT_DIR=$(dirname "$(readlink -m "$0")"); | |
function main | |
{ | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
set -o errtrace |
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
function loopdir { | |
command=$* | |
for d in */ ; do (cd $d; $command); done | |
} | |
function loopdirp { ## loop over directory based on a glob pattern loopdirp 'a*' rm deploy.yml | |
pattern=$1 | |
shift 1 | |
command=$* | |
for d in $pattern/ ; do (cd $d; $command); done |
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 bash | |
readonly SCRIPT_DIR=$(dirname $(readlink -m $0)); | |
function main | |
{ | |
if [ -z "$1" ] && [ -z "${2}" ]; then | |
error_exit "Argument Identifiant projet attentu : bash ${0} path" | |
fi |
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
function findcode { | |
extension=$1 | |
pattern=$2 | |
find . -name "*.${extension}" | xargs grep -ni --colour=always ${pattern} | |
} | |
# Utility | |
function displaycode { | |
file=$(echo $1 | cut -f1 -d:) |
NewerOlder