<commit_before>package flink.graphs.example;

import java.util.Collection;

import org.apache.flink.api.common.ProgramDescription;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.functions.RichMapFunction;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.aggregation.Aggregations;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.types.NullValue;

import flink.graphs.Graph;
import flink.graphs.example.utils.ExampleUtils;

/**
 * 
 * A simple example to illustrate the basic functionality of the graph-api.
 * The program creates a random graph and computes and prints
 * the following metrics:
 * - number of vertices
 * - number of edges
 * - average node degree
 * - the vertex ids with the max/min in- and out-degrees
 *
 */
public class GraphMetrics implements ProgramDescription {

	static final int NUM_VERTICES = 100;
	static final long SEED = 9876;
	

	@Override
	public String getDescription() {
		return null;
	}

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

		ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		/** create a random graph **/<commit_msg>[FLINK-1201] [gelly] added description in GraphMetrics example<commit_after>package flink.graphs.example;

import java.util.Collection;

import org.apache.flink.api.common.ProgramDescription;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.functions.RichMapFunction;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.aggregation.Aggregations;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.types.NullValue;

import flink.graphs.Graph;
import flink.graphs.example.utils.ExampleUtils;

/**
 * 
 * A simple example to illustrate the basic functionality of the graph-api.
 * The program creates a random graph and computes and prints
 * the following metrics:
 * - number of vertices
 * - number of edges
 * - average node degree
 * - the vertex ids with the max/min in- and out-degrees
 *
 */
public class GraphMetrics implements ProgramDescription {

	static final int NUM_VERTICES = 100;
	static final long SEED = 9876;
	

	@Override
	public String getDescription() {
		return "Graph Metrics Example";
	}

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

		ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		/** create a random graph **/
{'fraction_non_alphanumeric': 0.09500745156482861, 'fraction_numerical': 0.007451564828614009, 'mean_word_length': 4.688559322033898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5567569', 'n_tokens_mistral': 801, 'n_tokens_neox': 757, 'n_words': 214}