text:
All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**archive_run**](RunServiceApi.md#archive_run) | **POST** /apis/v1beta1/runs/{id}:archive | Archives a run.
[**create_run**](RunServiceApi.md#create_run) | **POST** /apis/v1beta1/runs | Creates a new run.
[**delete_run**](RunServiceApi.md#delete_run) | **DELETE** /apis/v1beta1/runs/{id} | Deletes a run.
[**get_run**](RunServiceApi.md#get_run) | **GET** /apis/v1beta1/runs/{run_id} | Finds a specific run by ID.
[**list_runs**](RunServiceApi.md#list_runs) | **GET** /apis/v1beta1/runs | Finds all runs.
[**read_artifact**](RunServiceApi.md#read_artifact) | **GET** /apis/v1beta1/runs/{run_id}/nodes/{node_id}/artifacts/{artifact_name}:read | Finds a run's artifact data.
[**report_run_metrics**](RunServiceApi.md#report_run_metrics) | **POST** /apis/v1beta1/runs/{run_id}:reportMetrics | ReportRunMetrics reports metrics of a run. Each metric is reported in its own transaction, so this API accepts partial failures. Metric can be uniquely identified by (run_id, node_id, name). Duplicate reporting will be ignored by the API. First reporting wins.
[**retry_run**](RunServiceApi.md#retry_run) | **POST** /apis/v1beta1/runs/{run_id}/retry | Re-initiates a failed or terminated run.
[**terminate_run**](RunServiceApi.md#terminate_run) | **POST** /apis/v1beta1/runs/{run_id}/terminate | Terminates an active run.
[**unarchive_run**](RunServiceApi.md#unarchive_run) | **POST** /apis/v1beta1/runs/{id}:unarchive | Restores an archived run.

# **archive_run**
> object archive_run(id)

Archives a run.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    id = 'id_example' # str | The ID of the run to be archived.

    try:
        # Archives a run.
        api_response = api_instance.archive_run(id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->archive_run: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **str**| The ID of the run to be archived. |

### Return type

**object**

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create_run**
> ApiRunDetail create_run(body)

Creates a new run.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    body = kfp_server_api.ApiRun() # ApiRun |

    try:
        # Creates a new run.
        api_response = api_instance.create_run(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->create_run: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**ApiRun**](ApiRun.md)|  |

### Return type

[**ApiRunDetail**](ApiRunDetail.md)

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **delete_run**
> object delete_run(id)

Deletes a run.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    id = 'id_example' # str | The ID of the run to be deleted.

    try:
        # Deletes a run.
        api_response = api_instance.delete_run(id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->delete_run: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **str**| The ID of the run to be deleted. |

### Return type

**object**

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_run**
> ApiRunDetail get_run(run_id)

Finds a specific run by ID.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    run_id = 'run_id_example' # str | The ID of the run to be retrieved.

    try:
        # Finds a specific run by ID.
        api_response = api_instance.get_run(run_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->get_run: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **run_id** | **str**| The ID of the run to be retrieved. |

### Return type

[**ApiRunDetail**](ApiRunDetail.md)

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **list_runs**
> ApiListRunsResponse list_runs(page_token=page_token, page_size=page_size, sort_by=sort_by, resource_reference_key_type=resource_reference_key_type, resource_reference_key_id=resource_reference_key_id, filter=filter)

Finds all runs.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    page_token = 'page_token_example' # str | A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListRuns call or can be omitted when fetching the first page. (optional)
page_size = 56 # int | The number of runs to be listed per page. If there are more runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. (optional)
sort_by = 'sort_by_example' # str | Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" (Example, \"name asc\" or \"id desc\"). Ascending by default. (optional)
resource_reference_key_type = 'UNKNOWN_RESOURCE_TYPE' # str | The type of the resource that referred to. (optional) (default to 'UNKNOWN_RESOURCE_TYPE')
resource_reference_key_id = 'resource_reference_key_id_example' # str | The ID of the resource that referred to. (optional)
filter = 'filter_example' # str | A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). (optional)

    try:
        # Finds all runs.
        api_response = api_instance.list_runs(page_token=page_token, page_size=page_size, sort_by=sort_by, resource_reference_key_type=resource_reference_key_type, resource_reference_key_id=resource_reference_key_id, filter=filter)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->list_runs: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **page_token** | **str**| A page token to request the next page of results. The token is acquried from the nextPageToken field of the response from the previous ListRuns call or can be omitted when fetching the first page. | [optional]
 **page_size** | **int**| The number of runs to be listed per page. If there are more runs than this number, the response message will contain a nextPageToken field you can use to fetch the next page. | [optional]
 **sort_by** | **str**| Can be format of \"field_name\", \"field_name asc\" or \"field_name desc\" (Example, \"name asc\" or \"id desc\"). Ascending by default. | [optional]
 **resource_reference_key_type** | **str**| The type of the resource that referred to. | [optional] [default to 'UNKNOWN_RESOURCE_TYPE']
 **resource_reference_key_id** | **str**| The ID of the resource that referred to. | [optional]
 **filter** | **str**| A url-encoded, JSON-serialized Filter protocol buffer (see [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/filter.proto)). | [optional]

### Return type

[**ApiListRunsResponse**](ApiListRunsResponse.md)

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **read_artifact**
> ApiReadArtifactResponse read_artifact(run_id, node_id, artifact_name)

Finds a run's artifact data.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    run_id = 'run_id_example' # str | The ID of the run.
node_id = 'node_id_example' # str | The ID of the running node.
artifact_name = 'artifact_name_example' # str | The name of the artifact.

    try:
        # Finds a run's artifact data.
        api_response = api_instance.read_artifact(run_id, node_id, artifact_name)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->read_artifact: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **run_id** | **str**| The ID of the run. |
 **node_id** | **str**| The ID of the running node. |
 **artifact_name** | **str**| The name of the artifact. |

### Return type

[**ApiReadArtifactResponse**](ApiReadArtifactResponse.md)

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **report_run_metrics**
> ApiReportRunMetricsResponse report_run_metrics(run_id, body)

ReportRunMetrics reports metrics of a run. Each metric is reported in its own transaction, so this API accepts partial failures. Metric can be uniquely identified by (run_id, node_id, name). Duplicate reporting will be ignored by the API. First reporting wins.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    run_id = 'run_id_example' # str | Required. The parent run ID of the metric.
body = kfp_server_api.ApiReportRunMetricsRequest() # ApiReportRunMetricsRequest |

    try:
        # ReportRunMetrics reports metrics of a run. Each metric is reported in its own transaction, so this API accepts partial failures. Metric can be uniquely identified by (run_id, node_id, name). Duplicate reporting will be ignored by the API. First reporting wins.
        api_response = api_instance.report_run_metrics(run_id, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->report_run_metrics: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **run_id** | **str**| Required. The parent run ID of the metric. |
 **body** | [**ApiReportRunMetricsRequest**](ApiReportRunMetricsRequest.md)|  |

### Return type

[**ApiReportRunMetricsResponse**](ApiReportRunMetricsResponse.md)

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **retry_run**
> object retry_run(run_id)

Re-initiates a failed or terminated run.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    run_id = 'run_id_example' # str | The ID of the run to be retried.

    try:
        # Re-initiates a failed or terminated run.
        api_response = api_instance.retry_run(run_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->retry_run: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **run_id** | **str**| The ID of the run to be retried. |

### Return type

**object**

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **terminate_run**
> object terminate_run(run_id)

Terminates an active run.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    run_id = 'run_id_example' # str | The ID of the run to be terminated.

    try:
        # Terminates an active run.
        api_response = api_instance.terminate_run(run_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->terminate_run: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **run_id** | **str**| The ID of the run to be terminated. |

### Return type

**object**

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **unarchive_run**
> object unarchive_run(id)

Restores an archived run.

### Example

* Api Key Authentication (Bearer):
```python
from __future__ import print_function
import time
import kfp_server_api
from kfp_server_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = kfp_server_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Bearer
configuration = kfp_server_api.Configuration(
    host = "http://localhost",
    api_key = {
        'authorization': 'YOUR_API_KEY'
    }
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with kfp_server_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kfp_server_api.RunServiceApi(api_client)
    id = 'id_example' # str | The ID of the run to be restored.

    try:
        # Restores an archived run.
        api_response = api_instance.unarchive_run(id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RunServiceApi->unarchive_run: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **str**| The ID of the run to be restored. |

### Return type

**object**

### Authorization

[Bearer](../README.md#Bearer)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. |  -  |
**0** |  |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


text:
/**
 * This package provides utility classes used in other packages.
 */
package org.italiangrid.voms.util;

redpajama_set_name: RedPajamaGithub


text:
<?php
	#Uploads accepts file fragments, identified by a file_id and inserts the file in an appropriate location where it can be retrieved by s3db and linked in a statement
	#Helena F Deus, Dec 1, 2006
	if(file_exists('config.inc.php')) {
		include('config.inc.php');
	} else {
		Header('Location: index.php');
		exit;
	}

	$xml = $_REQUEST['file'];
	$format=$_REQUEST['format'];
	#Determine if XML is a URL or a string
	if (ereg('http://.*', $xml)) {
		$handle = fopen ($xml, 'rb');
		$xml = stream_get_contents($handle);
		fclose($handle);
	}
	$xml = simplexml_load_string($xml);  #this will read the xml and output the result on an array

	#Get the key, send it to check validity, if key is missing check for filekey
	$key = $xml->key;
	if($key == '') { $key = $_REQUEST['key']; }

	if($key != '') {
		#Ckeck for filename and generate the filekey
		#include_once('core.keyheader.php');
		include_once('core.header.php');
		#include_once('s3dbcore/transferFile.php');

		if(!$_FILES) {
			echo formatReturn('3','No file to upload.', $_REQUEST['format'],'');
			exit;
		} elseif($file_id == '') {		#If a file_id is not provided, create one
			if(is_array($_FILES)) {
				$folder = $GLOBALS['s3db_info']['server']['db']['uploads_folder'].$GLOBALS['s3db_info']['server']['db']['uploads_file'].'/tmps3db/';
				$filekey=''; $filename='';
				foreach ($_FILES as $inputName=>$fileData) {
					ereg('.*\.([a-zA-Z0-9]*)$', $_FILES[$inputName]['name'], $ext);$ext = $ext[1];
					$filename = $_FILES[$inputName]['name'];
					$filesize= $_FILES[$inputName]['size'];
					$filekey = generateAFilekey(compact('filename', 'filesize', 'db', 'user_id'));

					#Retrieve the file_id fro mthe filekey
					$tmp= get_filekey_data($filekey, $db); $file_id = $tmp['file_id'];

					##Now upload the file
					$final = $folder.$file_id.'.'.$ext;
					$moved = copy($_FILES[$inputName]['tmp_name'], $final);

					if($moved) {
						##Was a rule_id and item_id provided? If yes, insert it using s3ql, if not, provide the filekey
						if($_REQUEST['item_id'] && $_REQUEST['rule_id']) {
							$s3ql=compact('user_id','db');
							$s3ql['insert']='file';
							$s3ql['where']['item_id']=$_REQUEST['item_id'];
							$s3ql['where']['rule_id']=$_REQUEST['rule_id'];
							$s3ql['where']['filekey']=$filekey;
							$s3ql['format']=$_REQUEST['format'];
							$done = S3QLaction($s3ql);
							$msg .=$done;
						} else {
							$msg .= formatReturn('0',"This filekey is to be used instead of key for file transfer, it will expire in 24h. Break the file in base64 encoded fragments, replacing the character '+' with it's URL equivalent '%2b'",$format,array('filekey'=>$filekey));
						}
					} else {
						$msg .= formatReturn('2',"Failed to import file ".$filename,$format,'');
					}
				}
				echo $msg;
			}
		}
		#if there is no data besides the key, ask for a filename and filesize
		#if($filename == '') { $filename = $xml -> filename; }
		#$filesize = $_REQUEST['filesize'];
		#if($filesize == '') { $filesize = $xml -> filesize; }
		##Copy file from Php tmp directory
	} else { 		#if key is empty, check for filekey
		$filekey = $xml->filekey;
		if($filekey == '') { $filekey = $_REQUEST['filekey']; }
		if($filekey!='') {
			include_once('core.filekeyheader.php');
			#add a form to the page such that it accepts both POST and GET
			#echo '<form name="file" method="POST">';
			#echo '<input type="hidden" name="query"> <!-- this form is for programming environments that support sending POST -->';
			#echo '</form>';
			echo formatReturn('0',receiveFileFragments(compact('filekey', 'db')), $format,'');
			exit;
		} else {
			include_once (S3DB_SERVER_ROOT.'/s3dbcore/callback.php');
			include_once (S3DB_SERVER_ROOT.'/s3dbcore/display.php');
			echo formatReturn('3',"Filekey is missing.",$format,'');
			exit;
		}
	}
?>


text:
class GithubKeygen < Formula
  desc "Bootstrap GitHub SSH configuration"
  homepage "https://github.com/dolmen/github-keygen"
  url "https://github.com/dolmen/github-keygen/archive/v1.302.tar.gz"
  sha256 "cc703512ab67837a7025e7d018731e97ddc6a943f87ccd8620986d5757991a48"
  head "https://github.com/dolmen/github-keygen.git"

  bottle :unneeded

  def install
    bin.install "github-keygen"
  end

  test do
    system "#{bin}/github-keygen"
  end
end


text:
import { useEffect, useState } from 'react'
import Article from './components/Article'
import Block from './components/Block'
import Button from './components/Button'
import Info from './components/Info'
import List from './components/List'
import { HorizontalSpacer, VerticalSpacer } from './components/Spacer'
import StarButton from './components/StarButton'
import Tabs from './components/Tabs'
import useFetch from './hooks/useFetch'
import { ArticleResource, InfoResource } from './resources'
import * as api from './api'
import Trade from './components/Trade'

function Articles() {
  const articles = useFetch<ArticleResource[]>(api.articles())

  if (articles.status !== 'success') {
    return {articles.status === 'failure' ? 'Error' : 'Loading...'}
  }

  return (
    <List>
      {articles.value.map((article) => (

      ))}
    </List>
  )
}

function HeroInfo() {
  const info = useFetch<InfoResource>(api.info(1))

  if (info.status !== 'success') {
    return Loading...
  }

  const data = info.value

  return (
    <Block>
      <Info title={data.title} content={data.content} links={data.links} />
    </Block>
  )
}

function Overview() {
  return (
    <>
      <HeroInfo />
      <VerticalSpacer size={20} />
      <Trade />
      <VerticalSpacer size={20} />
      <Articles />
    </>
  )
}

export default function App() {
  const [selectedTabIndex, setSelectedTabIndex] = useState(0)
  const [isDarkMode, setIsDarkMode] = useState(false)

  useEffect(() => {
    if (isDarkMode) {
      document.documentElement.classList.add('theme--dark')
    } else {
      document.documentElement.classList.remove('theme--dark')
    }
  }, [isDarkMode])

  return (

My Dashboard

        <Button
          onClick={() => {
            setIsDarkMode(!isDarkMode)
          }}
        >
          Enable {isDarkMode ? 'light' : 'dark'} mode
        </Button>
        <HorizontalSpacer size={12} />
        <StarButton activeTitle="Unwatch" inactiveTitle="Watch" />

      <VerticalSpacer size={20} />
      <Tabs
        id="main-tabs"
        aria-label="Main tabs"
        tabs={[
          {
            title: 'Overview',
            content: <Overview />,
          },
          {
            title: 'Wallet',
            content: 'Tab 2',
          },
          {
            title: 'Vault',
            content: 'Tab 3',
          },
        ]}
        selectedIndex={selectedTabIndex}
        onChangeSelectedIndex={setSelectedTabIndex}
      />

  )
}


text:
/*
 * This example requires compilation with the "USE_PROMPT" definition
 */

/* Asks for a filename */
var filename = prompt("Please enter a filename: ");
/* Reads 'filename' to var 'content' */
var content = read(filename);
/* Prints the content of file 'filename' */
print(content);


text:
import React, { PropTypes } from 'react';
import {
  StyleSheet,
  View,
  TouchableOpacity
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';

const CustomTabBar = React.createClass({
  tabIcons: [],

  propTypes: {
    goToPage: PropTypes.func,
    activeTab: PropTypes.number,
    tabs: PropTypes.array,
    scrollValue: PropTypes.object,
    style: PropTypes.object,
    changeRoute: PropTypes.func
  },

  componentDidMount() {
    this._listener = this.props.scrollValue.addListener(this.setAnimationValue);
  },

  setAnimationValue({ value }) {
    this.tabIcons.forEach((icon, i) => {
      const progress = Math.min(1, Math.abs(value - i));
      icon.setNativeProps({
        style: {
          color: this.iconColor(progress)
        }
      });
    });
  },

  // color between rgb(59,89,152) and rgb(204,204,204)
  iconColor(progress) {
    const red = 59 + (204 - 59) * progress;
    const green = 89 + (204 - 89) * progress;
    const blue = 152 + (204 - 152) * progress;
    return `rgb(${red}, ${green}, ${blue})`;
  },

  onTab(i) {
    this.props.goToPage(i);
  },

  render() {
    return (
      <View style={[styles.tabs, this.props.style]}>
        {this.props.tabs.map((tab, i) => {
          return (
            <TouchableOpacity key={tab} onPress={() => this.onTab(i)} style={styles.tab}>
              <Icon
                name={tab}
                size={30}
                color={this.props.activeTab === i ? 'rgb(59,89,152)' : 'rgb(204,204,204)'}
                ref={(icon) => { this.tabIcons[i] = icon; }}
              />
            </TouchableOpacity>
          );
        })}
      </View>
    );
  }
});

const styles = StyleSheet.create({
  tab: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    paddingBottom: 10
  },
  tabs: {
    height: 45,
    flexDirection: 'row',
    paddingTop: 5,
    borderWidth: 1,
    borderTopWidth: 0,
    borderLeftWidth: 0,
    borderRightWidth: 0,
    borderBottomColor: 'rgba(0,0,0,0.05)'
  }
});

export default CustomTabBar;


text:
package kr.jmcloud.watch;

import java.io.File;
import java.util.List;
import java.util.Locale;

import kr.jm.utils.enums.OS;
import kr.jmcloud.watch.cloud.aws.AwsWatchCloudDriver;
import kr.jmcloud.watch.cloud.aws.WatchCloudResultFileServiceForAWS;
import kr.jmcloud.watch.driver.WatchCloudDriverInterface;
import kr.jmcloud.watch.timeseries.data.TimeSeriesDOBundle;

public class WatchCloudMain {

	public static void main(String[] args) {

		if (args.length < 5) {
			System.err
					.println("Required Arguments : IntervalInMinutes MonitoringCount Region MetricName ResultDirectory");
			System.exit(1);
		}

		int intervalInMinutes = parseInt(args[0]);
		int monitoringCount = parseInt(args[1]);
		String region = args[2];
		String metricName = args[3];
		String resultDirectory = args[4];

		WatchCloudDriverInterface watchCloudDriver = new AwsWatchCloudDriver();
		WatchCloudResultFileServiceForAWS csm = new WatchCloudResultFileServiceForAWS(
				watchCloudDriver, resultDirectory);
		if (!csm.updateAllComputesInfo()) {
			System.err.println("Can't Access Your Cloud!!!");
			System.exit(1);
		}

		long beforeTimestamp = System.currentTimeMillis();
		TimeSeriesDOBundle tsDOB = csm.buildTimeSeriesDOBundleOfAllInstances(
				intervalInMinutes, monitoringCount, region, metricName,
				beforeTimestamp);

		Locale defaultLocale = Locale.getDefault();
		Locale.setDefault(Locale.US);
		List<File> fileList = csm.createChartImageWithNameList(tsDOB);
		fileList.add(csm.createChartImageWithName(tsDOB));
		Locale.setDefault(defaultLocale);

		fileList.addAll(csm.createJsonFileList(tsDOB));
		fileList.add(csm.createJsonFile(tsDOB));

		OS os = OS.getOs();
		for (File file : fileList) {
			os.open(file);
		}

	}

	private static int parseInt(String intString) {
		try {
			return Integer.parseInt(intString);
		} catch (NumberFormatException e) {
			System.err
					.println("Argument " + intString + " must be an integer.");
			System.exit(1);
		}
		return 0;
	}

}


text:
using namespace boost::python;

// Module ======================================================================
void _Export_gmtl_PlaneOps_h()
{
    def("findNearestPt", (float (*)(const gmtl::Plane<float> &, const gmtl::Point<float,3> &, gmtl::Point<float,3> &))&gmtl::findNearestPt);
    def("findNearestPt", (double (*)(const gmtl::Plane<double> &, const gmtl::Point<double,3> &, gmtl::Point<double,3> &))&gmtl::findNearestPt);
    def("reflect", (void (*)(gmtl::Point<float,3> &, const gmtl::Plane<float> &, const gmtl::Point<float,3> &))&gmtl::reflect);
    def("reflect", (void (*)(gmtl::Point<double,3> &, const gmtl::Plane<double> &, const gmtl::Point<double,3> &))&gmtl::reflect);
    def("distance", (double (*)(const gmtl::Plane<double> &, const gmtl::Point<double,3> &))&gmtl::distance);
    def("distance", (float (*)(const gmtl::Plane<float> &, const gmtl::Point<float,3> &))&gmtl::distance);
    def("whichSide", (gmtl::PlaneSide (*)(const gmtl::Plane<double> &, const gmtl::Point<double,3> &))&gmtl::whichSide);
    def("whichSide", (gmtl::PlaneSide (*)(const gmtl::Plane<float> &, const gmtl::Point<float,3> &))&gmtl::whichSide);
    def("whichSide", (gmtl::PlaneSide (*)(const gmtl::Plane<double> &, const gmtl::Point<double,3> &, const double &))&gmtl::whichSide);
    def("whichSide", (gmtl::PlaneSide (*)(const gmtl::Plane<float> &, const gmtl::Point<float,3> &, const float &))&gmtl::whichSide);
    def("isEqual", (bool (*)(const gmtl::Plane<float> &, const gmtl::Plane<float> &, const float &))&gmtl::isEqual);
    def("isEqual", (bool (*)(const gmtl::Plane<double> &, const gmtl::Plane<double> &, const double &))&gmtl::isEqual);
}


text:
package kbasesearchengine.main;

import java.io.File;
import java.io.IOException;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import com.fasterxml.jackson.core.JsonParser;
import com.google.common.base.Optional;

import kbasesearchengine.common.FileUtil;
import kbasesearchengine.common.GUID;
import kbasesearchengine.common.GUIDTooLongException;
import kbasesearchengine.events.ChildStatusEvent;
import kbasesearchengine.events.StatusEvent;
import kbasesearchengine.events.StatusEventProcessingState;
import kbasesearchengine.events.StatusEventWithId;
import kbasesearchengine.events.StoredStatusEvent;
import kbasesearchengine.events.exceptions.ErrorType;
import kbasesearchengine.events.exceptions.FatalIndexingException;
import kbasesearchengine.events.exceptions.FatalRetriableIndexingException;
import kbasesearchengine.events.exceptions.IndexingException;
import kbasesearchengine.events.exceptions.IndexingExceptionUncheckedWrapper;
import kbasesearchengine.events.exceptions.RetriableIndexingException;
import kbasesearchengine.events.exceptions.RetriableIndexingExceptionUncheckedWrapper;
import kbasesearchengine.events.exceptions.Retrier;
import kbasesearchengine.events.exceptions.UnprocessableEventIndexingException;
import kbasesearchengine.events.handler.EventHandler;
import kbasesearchengine.events.handler.ResolvedReference;
import kbasesearchengine.events.handler.SourceData;
import kbasesearchengine.events.storage.StatusEventStorage;
import kbasesearchengine.parse.ContigLocationException;
import kbasesearchengine.parse.GUIDNotFoundException;
import kbasesearchengine.parse.KeywordParser;
import kbasesearchengine.parse.ObjectParseException;
import kbasesearchengine.parse.ObjectParser;
import kbasesearchengine.parse.ParsedObject;
import kbasesearchengine.parse.KeywordParser.ObjectLookupProvider;
import kbasesearchengine.search.IndexingConflictException;
import kbasesearchengine.search.IndexingStorage;
import kbasesearchengine.search.ObjectData;
import kbasesearchengine.system.NoSuchTypeException;
import kbasesearchengine.system.ObjectTypeParsingRules;
import kbasesearchengine.system.ParsingRulesSubtypeFirstComparator;
import kbasesearchengine.system.SearchObjectType;
import kbasesearchengine.system.StorageObjectType;
import kbasesearchengine.system.TypeStorage;
import org.apache.commons.io.FileUtils;

public class IndexerWorker implements Stoppable {

    //TODO JAVADOC
    //TODO TESTS

    private final String id;
    private final File rootTempDir;
    private final StatusEventStorage storage;
    private final TypeStorage typeStorage;
    private final IndexingStorage indexingStorage;
    private final Set<String> workerCodes;
    private final LineLogger logger;
    private final Map<String, EventHandler> eventHandlers;
    private ScheduledExecutorService executor = null;
    private final SignalMonitor signalMonitor = new SignalMonitor();
    private boolean stopRunner = false;
    private final int maxObjectsPerLoad;
    private final Retrier retrier;

    public IndexerWorker(final IndexerWorkerConfigurator config) throws IOException {
        this.maxObjectsPerLoad = config.getMaxObjectsPerLoad();
        this.workerCodes = config.getWorkerCodes();
        this.logger = config.getLogger();
        this.logger.logInfo("Worker codes: " + workerCodes);
        this.id = config.getWorkerID();
        this.rootTempDir = FileUtil.getOrCreateCleanSubDir(config.getRootTempDir().toFile(),
                id + "_" + UUID.randomUUID().toString().substring(0,5));
        this.logger.logInfo("Created temp dir " + rootTempDir.getAbsolutePath() +
                                                     " for indexer worker " + id);

        this.eventHandlers = config.getEventHandlers();
        this.storage = config.getEventStorage();
        this.typeStorage = config.getTypeStorage();
        this.indexingStorage = config.getIndexingStorage();
        this.retrier = new Retrier(config.getRetryCount(), config.getRetrySleepMS(),
                config.getRetryFatalBackoffMS(),
                (retrycount, event, except) -> logError(retrycount, event, except));
    }

    @Override
    public void awaitShutdown() throws InterruptedException {
        signalMonitor.awaitSignal();
    }

    public void startIndexer() {
        stopRunner = false;
        //TODO TEST add a way to inject an executor for testing purposes
        executor = Executors.newSingleThreadScheduledExecutor();
        // may want to make this configurable
        executor.scheduleAtFixedRate(new IndexerRunner(), 0, 1000, TimeUnit.MILLISECONDS);
    }

    private class IndexerRunner implements Runnable {

        @Override
        public void run() {
            boolean processedEvent = true;
            while (!stopRunner && processedEvent) {
                processedEvent = false;
                try {
                    // keep processing events until there are none left
                    processedEvent = runCycle();
                } catch (InterruptedException | FatalIndexingException e) {
                    logError(LogPrefix.FATAL, e);
                    executor.shutdown();
                    signalMonitor.signal();
                } catch (Throwable e) {
                    logError(LogPrefix.UNEXPECTED, e);
                }
            }
        }
    }

    @Override
    public void stop(long millisToWait) throws InterruptedException {
        if (millisToWait < 0) {
            millisToWait = 0;
        }
        stopRunner = true;
        executor.shutdown();
        executor.awaitTermination(millisToWait, TimeUnit.MILLISECONDS);

        try {
            FileUtils.deleteDirectory(rootTempDir);
        } catch(IOException ioe) {
            logger.logError("Unable to delete worker temp dir "+rootTempDir+
                    " on shutdown of worker with id "+id+
                    ". Please delete manually. "+ioe.getMessage());
        }
    }

    private enum LogPrefix {
        STD, FATAL, UNEXPECTED;
    }

    private void logError(final LogPrefix prefix, final Throwable e) {
        final String logPrefix;
        if (LogPrefix.FATAL.equals(prefix)) {
            logPrefix = "Fatal error in indexer, shutting down";
        } else if (LogPrefix.STD.equals(prefix)) {
            logPrefix = "Error in indexer";
        } else if (LogPrefix.UNEXPECTED.equals(prefix)) {
            logPrefix = "Unexpected error in indexer";
        } else {
            throw new RuntimeException("Unknown error type: " + prefix);
        }
        logError(logPrefix, e);
    }

    private void logError(final String logPrefix, final Throwable e) {
        // TODO LOG make log method that takes msg + e and have the logger figure out how to log it correctly
        logger.logError(logPrefix + ": " + e);
        logger.logError(e);
    }

    private void logError(
            final int retrycount,
            final Optional<StatusEventWithId> event,
            final RetriableIndexingException e) {
        String prefix = "Retriable";
        if (e instanceof FatalRetriableIndexingException) {
            // add isFatal() method or something if the exception hierarchy gets much bigger
            prefix = "Fatal retriable";
        }
        final String msg;
        if (event.isPresent()) {
            msg = String.format("%s error in indexer for event %s %s%s, retry %s",
                    prefix,
                    event.get().getEvent().getEventType(),
                    event.get().isParentId() ? "with parent ID " : "",
                    event.get().getID().getId(),
                    retrycount);
        } else {
            msg = String.format("%s error in indexer, retry %s", prefix, retrycount);
        }
        logError(msg, e);
    }

    /** Runs one cycle of the event processing loop, processing up to one event.
     * @return true if an event was processed, false if not.
     * @throws InterruptedException if the thread was interrupted.
     * @throws FatalIndexingException if an indexing exception occurred that should cause the
     * shutdown of the worker. In normal use, no more events will be processed.
     */
    public boolean runCycle() throws InterruptedException, FatalIndexingException {
        final Optional<StoredStatusEvent> optEvent;
        try {
            optEvent = retrier.retryFunc(
                    s -> s.setAndGetProcessingState(StatusEventProcessingState.READY, workerCodes,
                            StatusEventProcessingState.PROC, id),
                    storage, null);
        } catch (FatalIndexingException e) {
            throw e;
        } catch (IndexingException e) { // untestable
            throw new RuntimeException("non-fatal exceptions should not be thrown here");
        }
        boolean processedEvent = false;
        if (optEvent.isPresent()) {
            final StoredStatusEvent parentEvent = optEvent.get();
            final EventHandler handler;
            try {
                handler = getEventHandler(parentEvent);
            } catch (UnprocessableEventIndexingException e) {
                handleException("Error getting event handler", parentEvent, e);
                return true;
            }
            if (handler.isExpandable(parentEvent)) {
                expandAndProcess(parentEvent);
            } else {
                // this means failed events get marked twice, since processEvent marks failed
                // events
                // *shrug*
                // maybe rethink this whole process later, but now would require interface changes
                markEventProcessed(parentEvent, processEvent(parentEvent));
            }
            processedEvent = true;
        }
        return processedEvent;
    }

    private void markEventProcessed(
            final StoredStatusEvent parentEvent,
            final StatusEventProcessingState result)
            throws InterruptedException, FatalIndexingException {
        try {
            // should only throw fatal
            retrier.retryCons(s -> s.setProcessingState(parentEvent.getID(),
                    StatusEventProcessingState.PROC, result), storage, parentEvent);
        } catch (FatalIndexingException | InterruptedException e) {
            throw e;
        } catch (IndexingException e) { // untestable
            throw new RuntimeException("non-fatal exceptions should not be thrown here", e);
        }
    }

    private void expandAndProcess(final StoredStatusEvent parentEvent)
            throws FatalIndexingException, InterruptedException {
        logger.logInfo(String.format("[Indexer] Expanding event %s %s",
                parentEvent.getEvent().getEventType(), parentEvent.getID().getId()));
        final Iterator<ChildStatusEvent> childIter;
        try {
            childIter = retrier.retryFunc(e -> getSubEventIterator(e), parentEvent, parentEvent);
        } catch (IndexingException e) {
            handleException("Error expanding parent event", parentEvent, e);
            return;
        } catch (InterruptedException e) {
            throw e;
        }
        StatusEventProcessingState parentResult = StatusEventProcessingState.INDX;
        while (childIter.hasNext()) {
            ChildStatusEvent subev = null;
            try {
                subev = retrier.retryFunc(i -> getNextSubEvent(i), childIter, parentEvent);
            } catch (IndexingException e) {
                handleException("Error getting event information from data storage",
                        parentEvent, e);
                parentResult = StatusEventProcessingState.FAIL;
            }
            if (subev != null && StatusEventProcessingState.FAIL.equals(processEvent(subev))) {
                parentResult = StatusEventProcessingState.FAIL;
            }
        }
        markEventProcessed(parentEvent, parentResult);
    }

    private Iterator<ChildStatusEvent> getSubEventIterator(final StoredStatusEvent ev)
            throws IndexingException, RetriableIndexingException {
        try {
            return getEventHandler(ev).expand(ev).iterator();
        } catch (IndexingExceptionUncheckedWrapper e) {
            throw e.getIndexingException();
        } catch (RetriableIndexingExceptionUncheckedWrapper e) {
            throw e.getIndexingException();
        }
    }

    /** Process an event.
     * Events which call for indexing new data for which a set of parsing rules is not present
     * are skipped.
     * Attempting to process expandable events via this method will result in a
     * {@link StatusEventProcessingState#FAIL}.
     * @param ev the event to process.
     * @return the state of the completed event.
     * @throws InterruptedException if the thread is interrupted.
     * @throws FatalIndexingException if an indexing exception occurs that is unrecoverable.
     */
    public StatusEventProcessingState processEvent(final StatusEventWithId ev)
            throws InterruptedException, FatalIndexingException {
        final Optional<StorageObjectType> type = ev.getEvent().getStorageObjectType();
        if (type.isPresent() && !isStorageTypeSupported(type.get())) {
            logger.logInfo("[Indexer] skipping " + ev.getEvent().getEventType() + ", " +
                    toLogString(type) + ev.getEvent().toGUID());
            return StatusEventProcessingState.UNINDX;
        }
        logger.logInfo("[Indexer] processing " + ev.getEvent().getEventType() + ", " +
                toLogString(type) + ev.getEvent().toGUID() + "...");
        final long time = System.currentTimeMillis();
        try {
            retrier.retryCons(e -> processEvent(e), ev.getEvent(), ev);
        } catch (IndexingException e) {
            handleException("Error processing event", ev, e);
            return StatusEventProcessingState.FAIL;
        }
        logger.logInfo("[Indexer]   (total time: " + (System.currentTimeMillis() - time) + "ms.)");
        return StatusEventProcessingState.INDX;
    }

    private boolean isStorageTypeSupported(final StorageObjectType storageObjectType) {
        return !typeStorage.listObjectTypeParsingRules(storageObjectType).isEmpty();
    }

    private ChildStatusEvent getNextSubEvent(Iterator<ChildStatusEvent> iter)
            throws IndexingException, RetriableIndexingException {
        try {
            return iter.next();
        } catch (IndexingExceptionUncheckedWrapper e) {
            throw e.getIndexingException();
        } catch (RetriableIndexingExceptionUncheckedWrapper e) {
            throw e.getIndexingException();
        }
    }

    private void handleException(
            final String error,
            final StatusEventWithId event,
            final IndexingException exception)
            throws FatalIndexingException, InterruptedException {
        try {
            if (event.isParentId()) { // child event
                retrier.retryCons(s -> s.store((ChildStatusEvent) event,
                                exception.getErrorType().toString(), exception),
                        storage, event);
            } else {
                retrier.retryCons(s -> s.setProcessingState(
                                event.getID(),
                                StatusEventProcessingState.PROC,
                                exception.getErrorType().toString(),
                                exception),
                        storage, event);
            }
        } catch (FatalIndexingException e) {
            throw e;
        } catch (IndexingException e) { // untestable
            throw new RuntimeException(
                    "non-fatal indexing exceptions should not be thrown here", e);
        }
        final String msg = error + String.format(" for event %s %s%s",
                event.getEvent().getEventType(),
                event.isParentId() ? "with parent ID " : "",
                        event.getID().getId());
        logError(msg, exception);
        if (exception instanceof FatalIndexingException) {
            throw (FatalIndexingException) exception;
        }
    }

    private String toLogString(final Optional<StorageObjectType> type) {
        if (!type.isPresent()) {
            return "";
        }
        final StringBuilder sb = new StringBuilder();
        sb.append(type.get().getStorageCode());
        sb.append(":");
        sb.append(type.get().getType());
        if (type.get().getVersion().isPresent()) {
            sb.append("-");
            sb.append(type.get().getVersion().get());
        }
        sb.append(", ");
        return sb.toString();
    }

    private EventHandler getEventHandler(final StoredStatusEvent ev)
            throws UnprocessableEventIndexingException {
        return getEventHandler(ev.getEvent().getStorageCode());
    }

    private EventHandler getEventHandler(final GUID guid)
            throws UnprocessableEventIndexingException {
        return getEventHandler(guid.getStorageCode());
    }

    private EventHandler getEventHandler(final String storageCode)
            throws UnprocessableEventIndexingException {
        if (!eventHandlers.containsKey(storageCode)) {
            throw new UnprocessableEventIndexingException(ErrorType.OTHER, String.format(
                    "No event handler for storage code %s is registered", storageCode));
        }
        return eventHandlers.get(storageCode);
    }

    private void processEvent(final StatusEvent ev)
            throws IndexingException, InterruptedException, RetriableIndexingException {

        // update event to reflect the latest state of object for which the specified StatusEvent is an event for
        EventHandler handler = getEventHandler(ev.getStorageCode());
        StatusEvent updatedEvent = handler.updateObjectEvent(ev);

        try {
            switch (updatedEvent.getEventType()) {
            case NEW_VERSION:
                GUID pguid = updatedEvent.toGUID();
                boolean indexed = indexingStorage.checkParentGuidsExist(new LinkedHashSet<>(
                        Arrays.asList(pguid))).get(pguid);
                if (indexed) {
                    logger.logInfo("[Indexer]   skipping " + pguid +
                            " creation (already indexed)");
                    // TODO: we should fix public access for all sub-objects too (maybe already works. Anyway, ensure all subobjects are set correctly as well as the parent)
                    if (updatedEvent.isPublic().get()) {
                        publish(pguid);
                    } else {
                        unpublish(pguid);
                    }
                } else {
                    indexObject(pguid, updatedEvent.getStorageObjectType().get(), updatedEvent.getTimestamp(),
                            updatedEvent.isPublic().get(), null, new LinkedList<>());
                }
                break;
            // currently unused
//            case DELETED:
//                unshare(ev.toGUID(), ev.getAccessGroupId().get());
//                break;
            case DELETE_ALL_VERSIONS:
                deleteAllVersions(updatedEvent.toGUID());
                break;
            case UNDELETE_ALL_VERSIONS:
                undeleteAllVersions(updatedEvent.toGUID());
                break;
                //TODO DP reenable if we support DPs
//            case SHARED:
//                share(ev.toGUID(), ev.getTargetAccessGroupId());
//                break;
                //TODO DP reenable if we support DPs
//            case UNSHARED:
//                unshare(ev.toGUID(), ev.getTargetAccessGroupId());
//                break;
            case RENAME_ALL_VERSIONS:
                renameAllVersions(updatedEvent.toGUID(), updatedEvent.getNewName().get());
                break;
            case PUBLISH_ALL_VERSIONS:
                publishAllVersions(updatedEvent.toGUID());
                break;
            case UNPUBLISH_ALL_VERSIONS:
                unpublishAllVersions(updatedEvent.toGUID());
                break;
            default:
                throw new UnprocessableEventIndexingException(
                        ErrorType.OTHER, "Unsupported event type: " + ev.getEventType());
            }
        } catch (IOException e) {
            // may want to make IndexingStorage throw more specific exceptions, but this will work
            // for now. Need to look more carefully at the code before that happens.
            throw new RetriableIndexingException(ErrorType.OTHER, e.getMessage(), e);
        } catch (IndexingConflictException e) {
            throw new RetriableIndexingException(ErrorType.INDEXING_CONFLICT, e.getMessage(), e);
        }
    }

    /** Index the object with the specified guid.
     *
     * @param guid an id that uniquely identifies the object that is to be indexed.
     * @param storageObjectType type of object that is to be indexed.
     * @param timestamp time at which this object was updated.
     * @param isPublic object access level (true if public, else false).
     * @param indexLookup
     * @param objectRefPath
     * @throws IndexingException
     * @throws InterruptedException
     * @throws RetriableIndexingException
     */
    private void indexObject(
            final GUID guid,
            final StorageObjectType storageObjectType,
            final Instant timestamp,
            final boolean isPublic,
            ObjectLookupProvider indexLookup,
            final List<GUID> objectRefPath)
            throws IndexingException, InterruptedException, RetriableIndexingException {
        /* it'd be nice to be able to log the event ID with retry logging in sub methods,
         * but this method handles calls from recursive indexing where the event id isn't
         * available. Changing that would require passing the event all the way through the
         * parsing code. Not sure if it's worth the trouble since the event ID *is* logged if
         * retrying doesn't fix the problem.
         *
         * Although, since this is single threaded, could make the event an instance variable,
         * but that seems icky and we may want to make the workers multithreaded in the future.
         * ThreadLocal?
         * https://sites.google.com/site/unclebobconsultingllc/thread-local-a-convenient-abomination
         *
         */
        long t1 = System.currentTimeMillis();
        final File tempFile;
        try {
            FileUtil.getOrCreateSubDir(rootTempDir, guid.getStorageCode());
            tempFile = File.createTempFile("ws_srv_response_", ".json");
        } catch (IOException e) {
            throw new FatalRetriableIndexingException(ErrorType.OTHER, e.getMessage(), e);
        }
        if (indexLookup == null) {
            indexLookup = new MOPLookupProvider();
        }
        try {
            // make a copy to avoid mutating the caller's path
            final LinkedList<GUID> newRefPath = new LinkedList<>(objectRefPath);
            newRefPath.add(guid);
            final EventHandler handler = getEventHandler(guid);
            final SourceData obj = handler.load(newRefPath, tempFile.toPath());
            long loadTime = System.currentTimeMillis() - t1;
            logger.logInfo("[Indexer]   " + guid + ", loading time: " + loadTime + " ms.");
            logger.timeStat(guid, loadTime, 0, 0);
            final List<ObjectTypeParsingRules> parsingRules = new ArrayList<>(
                    typeStorage.listObjectTypeParsingRules(storageObjectType));
            Collections.sort(parsingRules, new ParsingRulesSubtypeFirstComparator());
            for (final ObjectTypeParsingRules rule : parsingRules) {
                final long t2 = System.currentTimeMillis();
                final ParseObjectsRet parsedRet = parseObjects(guid, indexLookup,
                        newRefPath, obj, rule);
                long parsingTime = System.currentTimeMillis() - t2;
                logger.logInfo(String.format("[Indexer]   Parsed %s %s in %s ms.",
                        parsedRet.guidToObj.size(), toVerRep(rule.getGlobalObjectType()),
                        parsingTime));
                long t3 = System.currentTimeMillis();
                indexObjectInStorage(guid, timestamp, isPublic, obj, rule,
                        parsedRet.guidToObj, parsedRet.parentJson);
                long indexTime = System.currentTimeMillis() - t3;
                logger.logInfo("[Indexer]   " + toVerRep(rule.getGlobalObjectType()) +
                        ", indexing time: " + indexTime + " ms.");
                logger.timeStat(guid, 0, parsingTime, indexTime);
            }
        } finally {
            tempFile.delete();
        }
    }

    private String toVerRep(final SearchObjectType globalObjectType) {
        return globalObjectType.getType() + "_" + globalObjectType.getVersion();
    }

    private void indexObjectInStorage(
            final GUID guid,
            final Instant timestamp,
            final boolean isPublic,
            final SourceData obj,
            final ObjectTypeParsingRules rule,
            final Map<GUID, ParsedObject> guidToObj,
            final String parentJson)
            throws InterruptedException, IndexingException {
        final List<?> input = Arrays.asList(rule, obj, timestamp, parentJson, guid, guidToObj,
                isPublic);
        retrier.retryCons(i -> indexObjectInStorage(i), input, null);
    }

    private void indexObjectInStorage(final List<?> input) throws RetriableIndexingException {
        final ObjectTypeParsingRules rule = (ObjectTypeParsingRules) input.get(0);
        final SourceData obj = (SourceData) input.get(1);
        final Instant timestamp = (Instant) input.get(2);
        final String parentJson = (String) input.get(3);
        final GUID guid = (GUID) input.get(4);
        @SuppressWarnings("unchecked")
        final Map<GUID, ParsedObject> guidToObj = (Map<GUID, ParsedObject>) input.get(5);
        final Boolean isPublic = (Boolean) input.get(6);

        try {
            indexingStorage.indexObjects(
                    rule, obj, timestamp, parentJson, guid, guidToObj, isPublic);
        } catch (IndexingConflictException e) {
            throw new RetriableIndexingException(ErrorType.INDEXING_CONFLICT, e.getMessage(), e);
        } catch (IOException e) {
            throw new FatalRetriableIndexingException(ErrorType.OTHER, e.getMessage(), e);
        }
    }

    private class ParseObjectsRet {
        public final String parentJson;
        public final Map<GUID, ParsedObject> guidToObj;

        private ParseObjectsRet(final String parentJson, final Map<GUID, ParsedObject> guidToObj) {
            this.parentJson = parentJson;
            this.guidToObj = guidToObj;
        }
    }

    private ParseObjectsRet parseObjects(
            final GUID guid,
            final ObjectLookupProvider indexLookup,
            final LinkedList<GUID> newRefPath,
            final SourceData obj,
            final ObjectTypeParsingRules rule)
            throws IndexingException, InterruptedException {
        final List<?> inputs = Arrays.asList(guid, indexLookup, newRefPath, obj, rule);
        return retrier.retryFunc(i -> parseObjects(i), inputs, null);
    }

    private ParseObjectsRet parseObjects(final List<?> inputs)
            throws IndexingException, FatalRetriableIndexingException, InterruptedException {
        // should really wrap these in a class, but meh for now
        final GUID guid = (GUID) inputs.get(0);
        final ObjectLookupProvider indexLookup = (ObjectLookupProvider) inputs.get(1);
        @SuppressWarnings("unchecked")
        final List<GUID> newRefPath = (List<GUID>) inputs.get(2);
        final SourceData obj = (SourceData) inputs.get(3);
        final ObjectTypeParsingRules rule = (ObjectTypeParsingRules) inputs.get(4);

        final Map<GUID, ParsedObject> guidToObj = new HashMap<>();
        final String parentJson;
        try {
            try (JsonParser jts = obj.getData().getPlacedStream()) {
                parentJson = ObjectParser.extractParentFragment(rule, jts);
            }
            final Map<GUID, String> guidToJson = ObjectParser.parseSubObjects(obj, guid, rule);
            if (guidToJson.size() > maxObjectsPerLoad) {
                throw new UnprocessableEventIndexingException(ErrorType.SUBOBJECT_COUNT,
                        String.format("Object %s has %s subobjects, exceeding the limit of %s",
                        guid, guidToJson.size(), maxObjectsPerLoad));
            }
            for (final GUID subGuid : guidToJson.keySet()) {
                final String json = guidToJson.get(subGuid);
                guidToObj.put(subGuid, KeywordParser.extractKeywords(
                        subGuid, rule.getGlobalObjectType(), json, parentJson,
                        rule.getIndexingRules(), indexLookup, newRefPath));
            }
            /* any errors here are due to file IO or parse exceptions.
             * Parse exceptions are def not retriable
             * File IO problems are generally going to mean something is very wrong
             * (like bad disk), since the file should already exist at this point.
             */
        } catch (GUIDTooLongException ex) {
            throw new UnprocessableEventIndexingException(ErrorType.OTHER, ex.getMessage());
        } catch (GUIDNotFoundException e) {
            throw new UnprocessableEventIndexingException(
                    ErrorType.GUID_NOT_FOUND, e.getMessage(), e);
        } catch (ContigLocationException e) {
            throw new UnprocessableEventIndexingException(
                    ErrorType.LOCATION_ERROR, e.getMessage(), e);
        } catch (ObjectParseException e) {
            throw new UnprocessableEventIndexingException(ErrorType.OTHER, e.getMessage(), e);
        } catch (IOException e) {
            throw new FatalRetriableIndexingException(ErrorType.OTHER, e.getMessage(), e);
        }
        return new ParseObjectsRet(parentJson, guidToObj);
    }

//    private void share(GUID guid, int accessGroupId) throws IOException {
//        indexingStorage.shareObjects(new LinkedHashSet<>(Arrays.asList(guid)), accessGroupId,
//                false);
//    }

    private void undeleteAllVersions(final GUID guid)
            throws IOException, IndexingConflictException {
        indexingStorage.undeleteAllVersions(guid);
    }

//    private void unshare(GUID guid, int accessGroupId) throws IOException {
//        indexingStorage.unshareObjects(new LinkedHashSet<>(Arrays.asList(guid)), accessGroupId);
//    }

    private void deleteAllVersions(final GUID guid)
            throws IOException, IndexingConflictException {
        indexingStorage.deleteAllVersions(guid);
    }

    private void publish(final GUID guid) throws IOException, IndexingConflictException {
        indexingStorage.publishObjects(new LinkedHashSet<>(Arrays.asList(guid)));
    }

    private void publishAllVersions(final GUID guid)
            throws IOException, IndexingConflictException {
        indexingStorage.publishAllVersions(guid);
        //TODO DP need to handle objects in datapalette
    }

    private void unpublish(final GUID guid) throws IOException, IndexingConflictException {
        indexingStorage.unpublishObjects(new LinkedHashSet<>(Arrays.asList(guid)));
    }

    private void unpublishAllVersions(final GUID guid)
            throws IOException, IndexingConflictException {
        indexingStorage.unpublishAllVersions(guid);
        //TODO DP need to handle objects in datapalette
    }

    private void renameAllVersions(final GUID guid, final String newName)
            throws IOException, IndexingConflictException {
        indexingStorage.setNameOnAllObjectVersions(guid, newName);
    }

    /** A lookup provider
     *
     */
    private class MOPLookupProvider implements ObjectLookupProvider {
        // storage code -> full ref path -> resolved guid
        private Map<String, Map<String, GUID>> refResolvingCache = new LinkedHashMap<>();
        private Map<GUID, ObjectData> objLookupCache = new LinkedHashMap<>();
        private Map<GUID, SearchObjectType> guidToTypeCache = new LinkedHashMap<>();

        @Override
        public Set<GUID> resolveRefs(List<GUID> callerRefPath, Set<GUID> refs)
                throws IndexingException, InterruptedException {
            /* the caller ref path 1) ensures that the object refs are valid when checked against
             * the source, and 2) allows getting deleted objects with incoming references
             * in the case of the workspace
             */

            // there may be a way to cache more of this info and call the workspace less
            // by checking the ref against the refs in the parent object.
            // doing it the dumb way for now.
            final EventHandler eh = getEventHandler(callerRefPath.get(0));
            final String storageCode = eh.getStorageCode();
            if (!refResolvingCache.containsKey(storageCode)) {
                refResolvingCache.put(storageCode, new HashMap<>());
            }
            final Map<GUID, String> refToRefPath = eh.buildReferencePaths(callerRefPath, refs);
            Set<GUID> ret = new LinkedHashSet<>();
            Set<GUID> refsToResolve = new LinkedHashSet<>();
            for (final GUID ref : refs) {
                final String refpath = refToRefPath.get(ref);
                if (refResolvingCache.get(storageCode).containsKey(refpath)) {
                    ret.add(refResolvingCache.get(storageCode).get(refpath));
                } else {
                    refsToResolve.add(ref);
                }
            }
            if (refsToResolve.size() > 0) {
                final Set<ResolvedReference> resrefs =
                        resolveReferences(eh, callerRefPath, refsToResolve);
                for (final ResolvedReference rr: resrefs) {
                    final GUID guid = rr.getResolvedReference();
                    final boolean indexed = retrier.retryFunc(
                            g -> checkParentGuidExists(g), guid, null);
                    if (!indexed) {
                        indexObjectWrapperFn(guid, rr.getType(), rr.getTimestamp(), false,
                                this, callerRefPath);
                    }
                    ret.add(guid);
                    refResolvingCache.get(storageCode)
                            .put(refToRefPath.get(rr.getReference()), guid);
                }
            }
            return ret;
        }

        private boolean checkParentGuidExists(final GUID guid) throws RetriableIndexingException {
            try {
                return indexingStorage.checkParentGuidsExist(new HashSet<>(Arrays.asList(guid)))
                        .get(guid);
            } catch (IOException e) {
                throw new RetriableIndexingException(ErrorType.OTHER, e.getMessage(), e);
            }
        }

        private Set<ResolvedReference> resolveReferences(
                final EventHandler eh,
                final List<GUID> callerRefPath,
                final Set<GUID> refsToResolve)
                throws IndexingException, InterruptedException {
            final List<Object> input = Arrays.asList(eh, callerRefPath, refsToResolve);
            return retrier.retryFunc(i -> resolveReferences(i), input, null);
        }

        private Set<ResolvedReference> resolveReferences(final List<Object> input)
                throws IndexingException, RetriableIndexingException {
            final EventHandler eh = (EventHandler) input.get(0);
            @SuppressWarnings("unchecked")
            final List<GUID> callerRefPath = (List<GUID>) input.get(1);
            @SuppressWarnings("unchecked")
            final Set<GUID> refsToResolve = (Set<GUID>) input.get(2);

            return eh.resolveReferences(callerRefPath, refsToResolve);
        }

        private void indexObjectWrapperFn(
                final GUID guid,
                final StorageObjectType storageObjectType,
                final Instant timestamp,
                final boolean isPublic,
                final ObjectLookupProvider indexLookup,
                final List<GUID> objectRefPath)
                throws IndexingException, InterruptedException {
            final List<Object> input = Arrays.asList(guid, storageObjectType, timestamp, isPublic,
                    indexLookup, objectRefPath);
            retrier.retryCons(i -> indexObjectWrapperFn(i), input, null);
        }

        private void indexObjectWrapperFn(final List<Object> input)
                throws IndexingException, InterruptedException, RetriableIndexingException {
            final GUID guid = (GUID) input.get(0);
            final StorageObjectType storageObjectType = (StorageObjectType) input.get(1);
            final Instant timestamp = (Instant) input.get(2);
            final boolean isPublic = (boolean) input.get(3);
            final ObjectLookupProvider indexLookup = (ObjectLookupProvider) input.get(4);
            @SuppressWarnings("unchecked")
            final List<GUID> objectRefPath = (List<GUID>) input.get(5);

            indexObject(guid, storageObjectType, timestamp, isPublic, indexLookup, objectRefPath);
        }

        @Override
        public Map<GUID, ObjectData> lookupObjectsByGuid(final Set<GUID> guids)
                throws InterruptedException, IndexingException {
            Map<GUID, ObjectData> ret = new LinkedHashMap<>();
            Set<GUID> guidsToLoad = new LinkedHashSet<>();
            for (GUID guid : guids) {
                if (objLookupCache.containsKey(guid)) {
                    ret.put(guid, objLookupCache.get(guid));
                } else {
                    guidsToLoad.add(guid);
                }
            }
            if (guidsToLoad.size() > 0) {
                final List<ObjectData> objList =
                        retrier.retryFunc(g -> getObjectsByIds(g), guidsToLoad, null);
                // for some reason I don't understand a stream implementation would throw
                // duplicate key errors on the ObjectData, which is the value
                final Map<GUID, ObjectData> loaded = new HashMap<>();
                for (final ObjectData od: objList) {
                    loaded.put(od.getGUID(), od);
                }
                objLookupCache.putAll(loaded);
                ret.putAll(loaded);
            }
            return ret;
        }

        private List<ObjectData> getObjectsByIds(final Set<GUID> guids)
                throws RetriableIndexingException {
            kbasesearchengine.search.PostProcessing pp =
                    new kbasesearchengine.search.PostProcessing();
            pp.objectData = false;
            pp.objectKeys = true;
            try {
                return indexingStorage.getObjectsByIds(guids, pp);
            } catch (IOException e) {
                throw new RetriableIndexingException(ErrorType.OTHER, e.getMessage(), e);
            }
        }

        @Override
        public ObjectTypeParsingRules getTypeDescriptor(final SearchObjectType type)
                throws NoSuchTypeException {
            return typeStorage.getObjectTypeParsingRules(type);
        }

        @Override
        public Map<GUID, SearchObjectType> getTypesForGuids(Set<GUID> guids)
                throws InterruptedException, IndexingException {
            Map<GUID, SearchObjectType> ret = new LinkedHashMap<>();
            Set<GUID> guidsToLoad = new LinkedHashSet<>();
            for (GUID guid : guids) {
                if (guidToTypeCache.containsKey(guid)) {
                    ret.put(guid, guidToTypeCache.get(guid));
                } else {
                    guidsToLoad.add(guid);
                }
            }
            if (guidsToLoad.size() > 0) {
                final List<ObjectData> data =
                        retrier.retryFunc(g -> getObjectsByIds(g), guidsToLoad, null);
                // for some reason I don't understand a stream implementation would throw
                // duplicate key errors on the od.getType(), which is the value
                final Map<GUID, SearchObjectType> loaded = new HashMap<>();
                for (final ObjectData od: data) {
                    loaded.put(od.getGUID(), od.getType());
                }
                guidToTypeCache.putAll(loaded);
                ret.putAll(loaded);
            }
            return ret;
        }
    }
}


text:
<?php

namespace ConsoleHelpers\SVNBuddy\Repository\RevisionLog\Plugin;

use Aura\Sql\ExtendedPdoInterface;
use Aura\Sql\Iterator\AllIterator;
use ConsoleHelpers\SVNBuddy\Repository\Connector\Connector;
use ConsoleHelpers\SVNBuddy\Repository\Parser\LogMessageParserFactory;
use ConsoleHelpers\SVNBuddy\Repository\RevisionLog\RepositoryFiller;

class BugsPlugin extends AbstractDatabaseCollectorPlugin
{

	const STATISTIC_BUG_ADDED_TO_COMMIT = 'bug_added_to_commit';

	/**
	 * Repository url.
	 *
	 * @var string
	 */
	private $_repositoryUrl;

	/**
	 * Repository connector.
	 *
	 * @var Connector
	 */
	private $_repositoryConnector;

	/**
	 * Log message parser factory.
	 *
	 * @var LogMessageParserFactory
	 */
	private $_logMessageParserFactory;

	/**
	 * Create bugs revision log plugin.
	 *
	 * @param ExtendedPdoInterface    $database                   Database.
	 * @param RepositoryFiller        $repository_filler          Repository filler.
	 * @param string                  $repository_url             Repository url.
	 * @param Connector               $repository_connector       Repository connector.
	 * @param LogMessageParserFactory $log_message_parser_factory Log message parser.
	 */
	public function __construct(
		ExtendedPdoInterface $database,
		RepositoryFiller $repository_filler,
		$repository_url,
		Connector $repository_connector,
		LogMessageParserFactory $log_message_parser_factory
	) {
		parent::__construct($database, $repository_filler);

		$this->_repositoryUrl = $repository_url;
		$this->_repositoryConnector = $repository_connector;
		$this->_logMessageParserFactory = $log_message_parser_factory;
	}

	/**
	 * Returns plugin name.
	 *
	 * @return string
	 */
	public function getName()
	{
		return 'bugs';
	}

	/**
	 * Defines parsing statistic types.
	 *
	 * @return array
	 */
	public function defineStatisticTypes()
	{
		return array(
			self::STATISTIC_BUG_ADDED_TO_COMMIT,
		);
	}

	/**
	 * Processes data.
	 *
	 * @param integer $from_revision From revision.
	 * @param integer $to_revision   To revision.
	 *
	 * @return void
	 */
	public function doProcess($from_revision, $to_revision)
	{
		$this->populateMissingBugRegExp();

		$last_revision = $this->getLastRevision();

		if ( $to_revision > $last_revision ) {
			$this->detectBugs($last_revision + 1, $to_revision);
			$this->setLastRevision($to_revision);
		}
	}

	/**
	 * Populate "BugRegExp" column for projects without it.
	 *
	 * @param boolean $cache_overwrite Overwrite used "bugtraq:logregex" SVN property's cached value.
	 *
	 * @return void
	 */
	protected function populateMissingBugRegExp($cache_overwrite = false)
	{
		$projects = $this->getProjects('BugRegExp IS NULL');

		if ( !$projects ) {
			$this->advanceProgressBar();

			return;
		}

		foreach ( $projects as $project_data ) {
			$bug_regexp = $this->detectProjectBugTraqRegEx(
				$project_data['Path'],
				$project_data['RevisionLastSeen'],
				(bool)$project_data['IsDeleted'],
				$cache_overwrite
			);

			$this->repositoryFiller->setProjectBugRegexp($project_data['Id'], $bug_regexp);
			$this->advanceProgressBar();
		}
	}

	/**
	 * Determines project bug tracking regular expression.
	 *
	 * @param string  $project_path    Project project_path.
	 * @param integer $revision        Revision.
	 * @param boolean $project_deleted Project is deleted.
	 * @param boolean $cache_overwrite Overwrite used "bugtraq:logregex" SVN property's cached value.
	 *
	 * @return string
	 */
	protected function detectProjectBugTraqRegEx($project_path, $revision, $project_deleted, $cache_overwrite = false)
	{
		$ref_paths = $this->getLastChangedRefPaths($project_path);

		if ( !$ref_paths ) {
			return '';
		}

		foreach ( $ref_paths as $ref_path ) {
			$logregex = $this->_repositoryConnector
				->withCache('1 year', $cache_overwrite)
				->getProperty(
					'bugtraq:logregex',
					$this->_repositoryUrl . $ref_path . ($project_deleted ? '@' . $revision : '')
				);

			if ( strlen($logregex) ) {
				return $logregex;
			}
		}

		return '';
	}

	/**
	 * Returns given project refs, where last changed are on top.
	 *
	 * @param string $project_path Path.
	 *
	 * @return array
	 */
	protected function getLastChangedRefPaths($project_path)
	{
		$own_nesting_level = substr_count($project_path, '/') - 1;

		$where_clause = array(
			'Path LIKE :parent_path',
			'PathNestingLevel BETWEEN :from_level AND :to_level',
			'RevisionDeleted IS NULL',
		);

		$sql = 'SELECT Path, RevisionLastSeen
				FROM Paths
				WHERE (' . implode(') AND (', $where_clause) . ')';
		$paths = $this->database->fetchPairs($sql, array(
			'parent_path' => $project_path . '%',
			'from_level' => $own_nesting_level + 1,
			'to_level' => $own_nesting_level + 2,
		));

		// No sub-folders.
		if ( !$paths ) {
			return array();
		}

		$filtered_paths = array();

		foreach ( $paths as $path => $revision ) {
			if ( $this->isRef($path) ) {
				$filtered_paths[$path] = $revision;
			}
		}

		// None of sub-folders matches a ref.
		if ( !$filtered_paths ) {
			return array();
		}

		arsort($filtered_paths, SORT_NUMERIC);

		return array_keys($filtered_paths);
	}

	/**
	 * Detects if given project_path is known project root.
	 *
	 * @param string $path Path.
	 *
	 * @return boolean
	 */
	protected function isRef($path)
	{
		// Not a folder.
		if ( substr($path, -1, 1) !== '/' ) {
			return false;
		}

		return $this->_repositoryConnector->isRefRoot($path);
	}

	/**
	 * Detects bugs, associated with each commit from a given revision range.
	 *
	 * @param integer $from_revision From revision.
	 * @param integer $to_revision   To revision.
	 *
	 * @return void
	 */
	protected function detectBugs($from_revision, $to_revision)
	{
		$bug_regexp_mapping = $this->getProjectBugRegExps();

		if ( !$bug_regexp_mapping ) {
			$this->advanceProgressBar();

			return;
		}

		$range_start = $from_revision;

		while ( $range_start <= $to_revision ) {
			$range_end = min($range_start + 999, $to_revision);

			$this->doDetectBugs($range_start, $range_end, $bug_regexp_mapping);
			$this->advanceProgressBar();

			$range_start = $range_end + 1;
		}
	}

	/**
	 * Returns "BugRegExp" field associated with every project.
	 *
	 * @return array
	 */
	protected function getProjectBugRegExps()
	{
		$projects = $this->getProjects("BugRegExp != ''");

		if ( !$projects ) {
			return array();
		}

		$ret = array();

		foreach ( $projects as $project_data ) {
			$ret[$project_data['Id']] = $project_data['BugRegExp'];
		}

		return $ret;
	}

	/**
	 * Detects bugs, associated with each commit from a given revision range.
	 *
	 * @param integer $from_revision      From revision.
	 * @param integer $to_revision        To revision.
	 * @param array   $bug_regexp_mapping Mapping between project and it's "BugRegExp" field.
	 *
	 * @return void
	 */
	protected function doDetectBugs($from_revision, $to_revision, array $bug_regexp_mapping)
	{
		$commits_by_project = $this->getCommitsGroupedByProject($from_revision, $to_revision);

		foreach ( $commits_by_project as $project_id => $project_commits ) {
			if ( !isset($bug_regexp_mapping[$project_id]) ) {
				continue;
			}

			$log_message_parser = $this->_logMessageParserFactory->getLogMessageParser(
				$bug_regexp_mapping[$project_id]
			);

			foreach ( $project_commits as $revision => $log_message ) {
				$bugs = $log_message_parser->parse($log_message);

				if ( $bugs ) {
					$this->repositoryFiller->addBugsToCommit($bugs, $revision);
					$this->recordStatistic(self::STATISTIC_BUG_ADDED_TO_COMMIT, count($bugs));
				}
			}
		}
	}

	/**
	 * Returns commits grouped by project.
	 *
	 * @param integer $from_revision From revision.
	 * @param integer $to_revision   To revision.
	 *
	 * @return array
	 */
	protected function getCommitsGroupedByProject($from_revision, $to_revision)
	{
		$sql = 'SELECT cp.Revision, c.Message, cp.ProjectId
				FROM CommitProjects cp
				JOIN Commits c ON c.Revision = cp.Revision
				WHERE cp.Revision BETWEEN :from_revision AND :to_revision';
		$commits = new AllIterator($this->database->perform($sql, array(
			'from_revision' => $from_revision,
			'to_revision' => $to_revision,
		)));

		$ret = array();
		$processed_revisions = array();

		foreach ( $commits as $commit_data ) {
			$revision = $commit_data['Revision'];

			// Don't process revision more then once (e.g. when commit belongs to different projects).
			if ( isset($processed_revisions[$revision]) ) {
				continue;
			}

			$project_id = $commit_data['ProjectId'];

			if ( !isset($ret[$project_id]) ) {
				$ret[$project_id] = array();
			}

			$ret[$project_id][$revision] = $commit_data['Message'];
			$processed_revisions[$revision] = true;
		}

		return $ret;
	}

	/**
	 * Find revisions by collected data.
	 *
	 * @param array  $criteria     Criteria.
	 * @param string $project_path Project path.
	 *
	 * @return array
	 */
	public function find(array $criteria, $project_path)
	{
		if ( !$criteria ) {
			return array();
		}

		$project_id = $this->getProject($project_path);

		$sql = 'SELECT DISTINCT cb.Revision
				FROM CommitBugs cb
				JOIN CommitProjects cp ON cp.Revision = cb.Revision
				WHERE cp.ProjectId = :project_id AND cb.Bug IN (:bugs)';
		$bug_revisions = $this->database->fetchCol($sql, array('project_id' => $project_id, 'bugs' => $criteria));

		sort($bug_revisions, SORT_NUMERIC);

		return $bug_revisions;
	}

	/**
	 * Returns information about revisions.
	 *
	 * @param array $revisions Revisions.
	 *
	 * @return array
	 */
	public function getRevisionsData(array $revisions)
	{
		$results = array();

		$sql = 'SELECT Revision, Bug
				FROM CommitBugs
				WHERE Revision IN (:revisions)';
		$revisions_data = $this->database->fetchAll($sql, array('revisions' => $revisions));

		foreach ( $revisions_data as $revision_data ) {
			$revision = $revision_data['Revision'];
			$bug = $revision_data['Bug'];

			if ( !isset($results[$revision]) ) {
				$results[$revision] = array();
			}

			$results[$revision][] = $bug;
		}

		return $this->addMissingResults($revisions, $results);
	}

	/**
	 * Refreshes BugRegExp of a project.
	 *
	 * @param string $project_path Project path.
	 *
	 * @return void
	 */
	public function refreshBugRegExp($project_path)
	{
		$project_id = $this->getProject($project_path);

		$sql = 'UPDATE Projects
				SET BugRegExp = NULL
				WHERE Id = :project_id';
		$this->database->perform($sql, array(
			'project_id' => $project_id,
		));

		$this->populateMissingBugRegExp(true);
	}

}


text:
function dogCare(){
  alert("walk 9am: twice around the block");
  alert("Feed at 4pm: Meat & Water");
  alert("walk at 10pm: once around the block");
  return 1;
}

// 1. store dogCare function as a variable called myChore
var myChore = dogCare();

// 2. Call the function dogCare using the myChore variable
console.log(myChore);


text:
package com.google.cloud.tasks.v2beta2.samples;

// [START tasks_v2beta2_generated_cloudtasksclient_getiampolicy_string_sync]
import com.google.cloud.tasks.v2beta2.CloudTasksClient;
import com.google.cloud.tasks.v2beta2.QueueName;
import com.google.iam.v1.Policy;

public class SyncGetIamPolicyString {

  public static void main(String[] args) throws Exception {
    syncGetIamPolicyString();
  }

  public static void syncGetIamPolicyString() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
      String resource = QueueName.of("[PROJECT]", "[LOCATION]", "[QUEUE]").toString();
      Policy response = cloudTasksClient.getIamPolicy(resource);
    }
  }
}
// [END tasks_v2beta2_generated_cloudtasksclient_getiampolicy_string_sync]


text:
Not found :(

Sorry, but the page you were trying to view does not exist.

It looks like this was the result of either:

a mistyped address

an out-of-date link


text:
from __future__ import absolute_import
__author__ = 'ross'

from pychron.core.ui import set_toolkit
set_toolkit('qt4')
import unittest

from pychron.entry.loaders.mb_sample_loader import SampleLoader, XLSParser

class SampleLoaderTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.loader=SampleLoader()
        cls.parser=XLSParser()
        p='../data/sample.xls'
        cls.parser.load(p)

    def test_itervalues(self):
        values=list(self.parser.itervalues(keys=('sample','material')))
        self.assertEqual(values[1]['sample'],'B')

if __name__ == '__main__':
    unittest.main()


text:
TARGET=bin

rm -fr ./${TARGET}/*

scalac -cp ./lib/scalatest_2.11-2.2.4.jar -d ${TARGET}  \
	-feature -deprecation -explaintypes                 \
	src/testing/*.scala                                 \
	src/testing/styles/*.scala                          \
	src/testing/assertions/*.scala                      \
	src/testing/fixtures/different/*.scala              \
	src/testing/fixtures/same/*.scala                   \
	src/testing/fixtures/composing/*.scala              \
	src/testing/matchers/*.scala


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Vigilante Game Framework: VAnimation Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Vigilante Game Framework
    1.0.0.8

A 2D/3D C++ Game Framework using SFML.

Public Member Functions |
List of all members

VAnimation Class Reference

Handler for a single sprite based frame animation.
 More...

#include <VAnimation.h>

Public Member Functions

 	VAnimation (const std::vector< int > &Frames, float FramesPerSecond, bool Looping, bool Reverse)

void 	Reset (std::function< void()> onComplete=nullptr)

void 	SetCurrentFrame (int NewFrame)

int 	GetCurrentFrame ()

int 	GetFrameCount ()

void 	SetLooping (bool Looping)

void 	SetReverse (bool Reverse)

void 	Update (float dt)

Detailed Description

Handler for a single sprite based frame animation.

Constructor & Destructor Documentation

◆ VAnimation()

          VAnimation::VAnimation
          (
          const std::vector< int > &
          Frames,

          float
          FramesPerSecond,

          bool
          Looping,

          bool
          Reverse

          )

Parameters

Frames	The list of Frames the animation will have, you can pass in an std::vector<int> object or an array of ints using braces (e.g. { 0, 3, 7, 8 }).

FramesPerSecond	The amount of frames to play per second in time. This gets converted to a frameDelay using 1 / FramesPerSecond. Must be greater than 0.

Looping	Whether the animation should loop or not.

Reverse	Whether the animation should reverse or not.

Member Function Documentation

◆ GetCurrentFrame()

          int VAnimation::GetCurrentFrame
          (
          	)

Returns

returns the currently used frame number.

◆ GetFrameCount()

          int VAnimation::GetFrameCount
          (
          	)

Returns

returns the total amount of frames in the frame list.

◆ Reset()

          void VAnimation::Reset
          (
          std::function< void()>
          onComplete = nullptr	)

Resets the animation to the beginning.

Parameters

onComplete	A callback function used when an animation reaches its end (assuming the animation isn't Looping).

◆ SetCurrentFrame()

          void VAnimation::SetCurrentFrame
          (
          int
          NewFrame	)

Sets the current frame index the animation uses. Do not use this to set the animation's frame number, as this is specified in the frame list.

Parameters

NewFrame	the frame index the animation should use. This must be greater than 0 and less than the total amount of frames specified in the frame list.

◆ SetLooping()

          void VAnimation::SetLooping
          (
          bool
          Looping	)

Parameters

Looping	If true, the animation will now loop, else it won't loop.

◆ SetReverse()

          void VAnimation::SetReverse
          (
          bool
          Reverse	)

Parameters

Reverse	If true, the animation will now play in reverse, else it won't.

◆ Update()

          void VAnimation::Update
          (
          float
          dt	)

Updates the animation, handles changing of frame, callbacks and passing of time.

Parameters

dt	Delta Time between the current and previous frame in the game.

The documentation for this class was generated from the following file:

D:/Development/Libs/Vigilante-Game-Framework/VFrame/VAnimation.h

<address class="footer">
Generated by

 1.8.14
</address>


text:
import schema from './index'
import { allValid, allInvalid } from '../../../test/utils'

const validModuleConfigs = [
  // #0
  '/home/jwerner/foo/entry.js', // Absolute
]

const invalidModuleConfigs = [
  // #0
  // Relative
  { input: './entry.js', error: { message: '"value" must be an absolute path' } },

  // #1
  { input: 1, error: { message: '"value" must be a string' } },
]

describe('context', () => {
  allValid(validModuleConfigs, schema)
  allInvalid(invalidModuleConfigs, schema)
})