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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"regexp" | |
) |
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
use once_cell::sync::Lazy; | |
use std::collections::{HashMap, HashSet}; | |
use anyhow::Result; | |
use gtk::glib::{ | |
self, clone, Enum, ObjectExt, ParamFlags, ParamSpec, ParamSpecEnum, ParamSpecObject, Sender, ToValue, | |
}; | |
use gtk::prelude::*; | |
use gtk::subclass::prelude::*; | |
use std::cell::Cell; | |
use std::collections::hash_map::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
# Custom Prompt | |
# The various escape codes that we can use to color our prompt. | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[1;33m\]" | |
GREEN="\[\033[0;32m\]" | |
USERNAME="\[\033[0;35m\]" | |
DIRCOLOR="\[\033[0;38;5;50m\]" | |
BLUE="\[\033[1;096m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" |
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/bash -e | |
base_dir=$(dirname $(dirname $0)) | |
target_dir="${base_dir}/examples/ ${base_dir}/keras_nlp/" | |
targets="${base_dir}/*.py ${base_dir}/examples/ ${base_dir}/keras_nlp/" | |
isort --sp "${base_dir}/setup.cfg" --sl ${targets} | |
black --line-length 80 ${targets} | |
for i in $(find ${target_dir} -name '*.py'); do |
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/bash -e | |
base_dir=$(dirname $(dirname $0)) | |
target_dir="${base_dir}/examples/ ${base_dir}/keras_nlp/" | |
targets="${base_dir}/*.py ${base_dir}/examples/ ${base_dir}/keras_nlp/" | |
isort --sp "${base_dir}/setup.cfg" --sl ${targets} | |
black --line-length 80 ${targets} | |
for i in $(find ${target_dir} -name '*.py'); do |
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 os | |
import multiprocessing | |
# Clear any logs from previous runs | |
!rm -rf ./logs/ | |
!mkdir ./logs/ | |
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | |
!unzip ngrok-stable-linux-amd64.zip | |
pool = multiprocessing.Pool(processes = 10) |
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
PREFIX : <urn:example:> | |
SELECT ?personName where { | |
?person :name ?personName. | |
?person :livesIn / :within* / :name "Gujrat". | |
?person :worksIn / :within* / :name "Tiger Softwares". | |
} |
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
@prefix : <urn:example:> | |
_:india a :Location; :name "India"; type: "country". | |
_:gujrat a :Location; :name "Gujrat"; type: "state"; :within _:india. | |
_:indore a :Location; :name "Indore"; type: "city"; :within _:gujrat. | |
_:ts a :Company; :name "Tiger Softwares"; :profession "Application Developer". | |
_:rahul a :Person; :name "Rahul"; :worksIn _:ts. |
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
MATCH | |
(person) -[:WORKS_IN]-> (TS:Company {name: 'Tiger Softwares'}), | |
(person) -[:LIVES_IN]-> () -> [:WITHIN*0..]-> (Gujrat:Location {name:'Gujrat'}) | |
RETURN person.name |
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
CREATE | |
(India:Location {name: 'India', type: 'country'}), | |
(Gujrat:Location {name: 'Gujrat', type: 'state'}), | |
(Indore:Location {name: 'Indore', type: 'city'}), | |
(Rahul:Person {name: 'Rahul'}), | |
(TS:Company {name: 'Tiger Softwares', profession: 'Application Developer'} | |
(Rahul) -[:WITHIN]-> (Indore) -[:WITHIN]-> (Gujrat) -[:WITHIN]-> (India) | |
(Rahul) -[:WORKS_IN]-> (TS) |
NewerOlder