With wildcard
{
"query": {
"bool": {
"must": [
{
"wildcard": {
"text": "*antonio*banderas*"
{ | |
"aliases": {}, | |
"mappings": { | |
"properties": { | |
"text": { | |
"type": "text", | |
"analyzer": "autocomplete" | |
} | |
} | |
}, |
With wildcard
{
"query": {
"bool": {
"must": [
{
"wildcard": {
"text": "*antonio*banderas*"
#!/bin/bash | |
function __awscat { | |
if [ "$1x" != 'x' ]; then | |
aws s3 cp --quiet "$1" /dev/stdout | |
fi | |
} | |
__awscat $1 |
from functools import wraps | |
from .bounded_pool_executor import BoundedThreadPoolExecutor | |
from .bounded_pool_executor import BoundedProcessPoolExecutor | |
_DEFAULT_POOL = BoundedThreadPoolExecutor(max_workers=5) | |
_PROCESS_POOL = BoundedProcessPoolExecutor(max_workers=5) | |
def threadpool(f, executor=None): | |
@wraps(f) | |
def wrap(*args, **kwargs): |
import multiprocessing | |
import concurrent.futures | |
import threading | |
name = 'bounded_pool_executor' | |
class _BoundedPoolExecutor: | |
semaphore = None |
{ | |
--color-scale-black: #010409; | |
--color-scale-white: #f0f6fc; | |
--color-scale-gray-0: #f0f6fc; | |
--color-scale-gray-1: #c9d1d9; | |
--color-scale-gray-2: #b1bac4; | |
--color-scale-gray-3: #8b949e; | |
--color-scale-gray-4: #6e7681; | |
--color-scale-gray-5: #484f58; | |
--color-scale-gray-6: #30363d; |
function deleteVersionedObject(bucket, key, callback) { | |
var params = { | |
Bucket: bucket, | |
Key: key | |
}; | |
s3.deleteObject(params, function (error, data) { | |
if (error) { | |
console.error("S3Dataset delete error key:%s error:%@", params.key, error); | |
return callback(error); | |
} |
def trace_mem(nframe=6,top=8): | |
''' | |
naive memory trace | |
''' | |
import tracemalloc | |
is_tracing = tracemalloc.is_tracing() | |
if not is_tracing: | |
# start tracing | |
tracemalloc.start(nframe) | |
return {} |
async function getObjectAsync(bucket, key) { | |
try { | |
const data = await s3 | |
.getObject({ Bucket: bucket, Key: key }) | |
.promise(); | |
var contents = data.Body.toString('utf-8'); | |
return contents; | |
} catch (err) { | |
console.log(err); | |
} |
/** | |
* @function stripJSON | |
* @desc - This function removes selected object keys | |
* @param {Object} json - JavaScript object to strip | |
* @param {Object[]} keys - array of selected keys (string) | |
* @return {Object} - deep copy of object without keys | |
*/ | |
function stripJSON(json, keys) { | |
if (json === null || json === undefined) return json; | |
let obj = {}, key; |