> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Is code

> Learn how to use the is code test

## Definition

The *is code* test allows you to check if a specified column contains executable code. Currently, Python and
JS code are supported.

## Taxonomy

* **Task types**: LLM.
* **Availability**: development (Continuously evaluate your models and datasets as you iterate on their versions.)
  and monitoring (Monitor a model in production, measure its health, check for drifts and set up alerts.).

## Why it matters

* If the LLM is used for code generation or understanding, it is important to ensure that the code is valid and executable.
* For code generation with LLMs, it is particularly important to ensure that the generated code is valid, and not a hallucination.

## Test configuration examples

If you are writing a `tests.json`, here are a few valid configurations for the character length test:

```json Development theme={null}
[
  {
    "name": "Outputs have valid Python code",
    "description": "Asserts that the output column contains valid Python code",
    "type": "integrity",
    "subtype": "isCode",
    "thresholds": [
      {
        "insightName": "isCode",
        "insightParameters": [
          { "name": "column_name", "value": "openlayer_output" },
          { "name": "language", "value": "python" }
        ],
        "measurement": "isCodeRowPercentage",
        "operator": ">=",
        "value": 1.0
      }
    ],
    "subpopulationFilters": null,
    "mode": "development",
    "usesValidationDataset": true,
    "usesTrainingDataset": false,
    "usesMlModel": false,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
  }
]
```

```json Monitoring theme={null}
[
  {
    "name": "Outputs have valid Python code",
    "description": "Asserts that the output column contains valid Python code",
    "type": "integrity",
    "subtype": "isCode",
    "thresholds": [
      {
        "insightName": "isCode",
        "insightParameters": [
          { "name": "column_name", "value": "openlayer_output" },
          { "name": "language", "value": "python" }
        ],
        "measurement": "isCodeRowPercentage",
        "operator": ">=",
        "value": 1.0
      }
    ],
    "subpopulationFilters": null,
    "mode": "monitoring",
    "usesProductionData": true,
    "evaluationWindow": 3600,
    "delayWindow": 0,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
  }
]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.