<commit_before>with import <nixpkgs> {};
with import <nixpkgs/nixos> {};

let py = python27.withPackages (pkgs: with pkgs; [
  # These are for spacemacs python layer. To get spacemacs with the
  # correct PATH. run nix-shell, then launch Emacs inside this
  # nix-shell.
  virtualenv
  flake8
  psycopg2 MySQL_python
]);
in stdenv.mkDerivation {
  name = "sqlalchemy-migrate";
  buildInputs = [ py zlib libffi libressl ];
  shellHook = ''
    function setup() {
      # Address to the docker registry
      local registry=\$\{1:-"192.168.56.101:5000"}

      # Start croach
      if [[ ! $(docker inspect -f {{.State.Running}} roach1 2> /dev/null) ]]
      then
        echo "INFO: start cockroach db docker."
        docker run -d --name=croach\
                      --hostname=croach\
                      --env REGISTRY_HTTP_ADDR=$registry\
                      --publish 5432:26257 --publish 8080:8080\
                      -v "$PWD/cockroach-data/roach1:/cockroach/cockroach-data"\
                      cockroachdb/cockroach:v1.1.1 start --insecure
      fi

      # Wait 'till cockroachdb starts
      sleep 1

      # Build test_migrate database in croach
      echo "INFO: create database test_migrate."<commit_msg>always use the last version of cockroachdb<commit_after>with import <nixpkgs> {};
with import <nixpkgs/nixos> {};

let py = python27.withPackages (pkgs: with pkgs; [
  # These are for spacemacs python layer. To get spacemacs with the
  # correct PATH. run nix-shell, then launch Emacs inside this
  # nix-shell.
  virtualenv
  flake8
  psycopg2 MySQL_python
]);
in stdenv.mkDerivation {
  name = "sqlalchemy-migrate";
  buildInputs = [ py zlib libffi libressl ];
  shellHook = ''
    function setup() {
      # Address to the docker registry
      local registry=\$\{1:-"192.168.56.101:5000"}

      # Start croach
      if [[ ! $(docker inspect -f {{.State.Running}} roach1 2> /dev/null) ]]
      then
        echo "INFO: start cockroach db docker."
        docker run -d --name=croach\
                      --hostname=croach\
                      --env REGISTRY_HTTP_ADDR=$registry\
                      --publish 5432:26257 --publish 8080:8080\
                      -v "$PWD/cockroach-data/roach1:/cockroach/cockroach-data"\
                      cockroachdb/cockroach start --insecure
      fi

      # Wait 'till cockroachdb starts
      sleep 1

      # Build test_migrate database in croach
      echo "INFO: create database test_migrate."
{'fraction_non_alphanumeric': 0.10613397901533494, 'fraction_numerical': 0.03430185633575464, 'mean_word_length': 2.1579617834394904, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3159065', 'n_tokens_mistral': 869, 'n_tokens_neox': 780, 'n_words': 217}