<commit_before>package com.tinkerpop.gremlin.scala

import com.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
import org.scalatest.matchers.ShouldMatchers

class ElementSpec extends TestBase {

  describe("properties") {
    it("gets properties") {
      v(1).keys should be(Set("name", "age"))
      v(1).property[String]("name").value should be("marko")
      v(1).property[String]("doesnt exit").isPresent should be(false)
      v(1).propertyMap() should be(Map("name" -> "marko", "age" -> 29))
      v(1).propertyMap("name", "age") should be(Map("name" -> "marko", "age" -> 29))
      v(1).properties("name", "age") should have length (2)
      v(1).properties() should have length (2)

      e(7).keys should be(Set("weight"))
      e(7).property[Float]("weight").value should be(0.5)
      e(7).property[Float]("doesnt exit").isPresent should be(false)
      e(7).propertyMap("weight") should be(Map("weight" -> 0.5))
    }

    it("sets a property") {
      v(1).setProperty("vertexProperty", "updated")
      v(1).property[String]("vertexProperty").value should be("updated")

      e(7).setProperty("edgeProperty", "updated")
      e(7).property[String]("edgeProperty").value should be("updated")
    }

    it("removes a property") {
      v(1).setProperty("vertexProperty1", "updated")
      v(1).removeProperty("vertexProperty1")
      v(1).removeProperty("doesnt exist")
      v(1).property[String]("vertexProperty1").isPresent should be(false)

      e(7).setProperty("edgeProperty", "updated")
      e(7).removeProperty("edgeProperty")
      e(7).removeProperty("doesnt exist")
      e(7).property[String]("edgeProperty").isPresent should be(false)
    }

    it("handles hidden properties") {
      v(1).setHiddenProperty("hiddenProperty", "hiddenValue")
      v(1).hiddenKeys shouldBe Set("hiddenProperty")
      v(1).hiddenValue[String]("hiddenProperty") shouldBe "hiddenValue"
      v(1).hiddenProperty[String]("hiddenProperty").value shouldBe "hiddenValue"
      v(1).hiddenPropertyMap("hiddenProperty") shouldBe Map("hiddenProperty" → "hiddenValue")
      v(1).hiddenProperties("hiddenProperty") should have length (1)
    }
  }

  describe("values") {
    it("gets a value") {
      v(1).value[String]("name") should be("marko")
      e(7).value[Float]("weight") should be(0.5)
    }

    it("falls back to default value if value doesnt exist") {
      v(1).valueWithDefault("doesnt exist", "blub") should be("blub")
      e(7).valueWithDefault("doesnt exist", 0.8) should be(0.8)<commit_msg>fix hidden property handling change<commit_after>package com.tinkerpop.gremlin.scala

import com.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
import org.scalatest.matchers.ShouldMatchers

class ElementSpec extends TestBase {

  describe("properties") {
    it("gets properties") {
      v(1).keys should be(Set("name", "age"))
      v(1).property[String]("name").value should be("marko")
      v(1).property[String]("doesnt exit").isPresent should be(false)
      v(1).propertyMap() should be(Map("name" -> "marko", "age" -> 29))
      v(1).propertyMap("name", "age") should be(Map("name" -> "marko", "age" -> 29))
      v(1).properties("name", "age") should have length (2)
      v(1).properties() should have length (2)

      e(7).keys should be(Set("weight"))
      e(7).property[Float]("weight").value should be(0.5)
      e(7).property[Float]("doesnt exit").isPresent should be(false)
      e(7).propertyMap("weight") should be(Map("weight" -> 0.5))
    }

    it("sets a property") {
      v(1).setProperty("vertexProperty", "updated")
      v(1).property[String]("vertexProperty").value should be("updated")

      e(7).setProperty("edgeProperty", "updated")
      e(7).property[String]("edgeProperty").value should be("updated")
    }

    it("removes a property") {
      v(1).setProperty("vertexProperty1", "updated")
      v(1).removeProperty("vertexProperty1")
      v(1).removeProperty("doesnt exist")
      v(1).property[String]("vertexProperty1").isPresent should be(false)

      e(7).setProperty("edgeProperty", "updated")
      e(7).removeProperty("edgeProperty")
      e(7).removeProperty("doesnt exist")
      e(7).property[String]("edgeProperty").isPresent should be(false)
    }

    it("handles hidden properties") {
      v(1).setHiddenProperty("hiddenProperty", "hiddenValue")
      v(1).hiddenKeys shouldBe Set("~hiddenProperty")
      v(1).hiddenValue[String]("hiddenProperty") shouldBe "hiddenValue"
      v(1).hiddenProperty[String]("hiddenProperty").value shouldBe "hiddenValue"
      v(1).hiddenPropertyMap("hiddenProperty") shouldBe Map("hiddenProperty" → "hiddenValue")
      v(1).hiddenProperties("hiddenProperty") should have length (1)
    }
  }

  describe("values") {
    it("gets a value") {
      v(1).value[String]("name") should be("marko")
      e(7).value[Float]("weight") should be(0.5)
    }

    it("falls back to default value if value doesnt exist") {
      v(1).valueWithDefault("doesnt exist", "blub") should be("blub")
      e(7).valueWithDefault("doesnt exist", 0.8) should be(0.8)
{'fraction_non_alphanumeric': 0.1768425212408615, 'fraction_numerical': 0.020944477376012644, 'mean_word_length': 4.160040774719674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1790381', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1582, 'n_words': 297}