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 collections import defaultdict | |
import numpy as np | |
import pandas as pd | |
from rich.console import Console | |
from rich.table import Table | |
import torch | |
import torch.nn as nn |
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
# coding=utf-8 | |
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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
create or replace function hs_2json(hs hstore) returns text language sql | |
as $f$ | |
select '{' || array_to_string(array_agg( | |
'"' || regexp_replace(key,E'[\\"]',E'\\\&','g') || '":' || | |
case | |
when value is null then 'null' | |
when value ~ '^(true|false|(-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?))$' then value | |
else '"' || regexp_replace(value,E'[\\"]',E'\\\&','g') || '"' | |
end |
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
bash -c ' | |
<% if knife_config[:bootstrap_proxy] -%> | |
( | |
cat <<'EOP' | |
<%= "proxy = #{knife_config[:bootstrap_proxy]}" %> | |
EOP | |
) > ~/.curlrc | |
<% end -%> | |
if [ ! -f /usr/bin/chef-client ]; then |
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
# Set postgis-1.5 path. | |
$ POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-1.5 | |
# Creating the template spatial database | |
$ createdb -E UTF8 -T template0 template_postgis | |
# and add PLPGSQL language support. | |
$ createlang -d template_postgis plpgsql | |
# Loading the PostGIS SQL routines. | |
$ psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql |
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
require 'formula' | |
class Gdal <Formula | |
url 'http://download.osgeo.org/gdal/gdal-1.7.2.tar.gz' | |
homepage 'http://www.gdal.org/' | |
md5 '05351f8cb61761ae579667e24a297fe6' | |
def options | |
[ | |
['--with-pg', "Include PostgreSQL support."], |