This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applications = [ | |
{'Name': 'Spark'}, | |
{'Name': 'Hive'}, | |
{'Name': 'Tez'}, | |
{'Name': 'Hadoop'}, | |
{'Name': 'Ganglia'}, | |
{'Name': 'Presto'}, | |
{'Name': 'Zeppelin'} | |
] | |
release_label = "emr-5.9.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Country: | |
""" | |
Convenience class for storing | |
data relative to a given country | |
""" | |
def __init__(self, country_name, population, continent): | |
""" | |
Default constructor | |
:param country_name: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
# Start by creating random values: | |
x_data = np.random.rand(100).astype(np.float32) | |
_y_data = 3 + 5 * x_data | |
y_data = np.vectorize(lambda y: y + np.random.normal(loc=0.0, scale=0.1))(_y_data) | |
# ... and then initializing the variables a and b, with any random guess, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
x = tf.Variable(3, name="x", dtype=tf.int16) | |
y = tf.Variable(4, name="y", dtype=tf.int16) | |
a = tf.constant(5, dtype=tf.int16) | |
b = tf.constant(10, dtype=tf.int16) | |
c = tf.constant(15, dtype=tf.int16) | |
op1 = x*x*y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
x = tf.Variable(3, name="x", dtype=tf.int16) | |
y = tf.Variable(4, name="y", dtype=tf.int16) | |
a = tf.constant(5, dtype=tf.int16) | |
b = tf.constant(10, dtype=tf.int16) | |
c = tf.constant(15, dtype=tf.int16) | |
op1 = x*x*y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
a = tf.constant(1) | |
b = tf.constant(2) | |
c = a + b | |
with tf.Session() as session: | |
result = session.run(c) | |
print("Tensorflow supports simple summation with op: 'a + b = {}'".format(result)) | |
# Tensorflow supports simple summation with op: a + b = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.TimeUnit | |
import akka.actor.{Actor, ActorSystem, Props} | |
import scala.concurrent.Await | |
import scala.concurrent.duration.Duration | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.event.{Logging, LoggingAdapter} | |
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.Materializer | |
import akka.stream.scaladsl.{Flow, Sink, Source} | |
import com.typesafe.config.Config | |
import com.typesafe.config.ConfigFactory | |
import scala.concurrent.{ExecutionContextExecutor, Future} | |
import spray.json.DefaultJsonProtocol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.ning.http.client.{AsyncHttpClientConfigBean, AsyncHttpClientConfig} | |
import play.api.libs.ws.ning.NingWSClient | |
import play.api.libs.ws.ning.NingAsyncHttpClientConfigBuilder | |
import play.api.libs.ws.ssl.{SSLLooseConfig, SSLConfig} | |
import play.api.libs.ws.{WSClientConfig, DefaultWSClientConfig, WSResponse} | |
import scala.concurrent.{ExecutionContext, Future} | |
import play.api.libs.json._ | |
trait PlayWsRequester { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalaj.http._ | |
import scala.concurrent.{ExecutionContext, Future} | |
/** | |
* Trait for generic scalaj HTTP requests | |
* | |
*/ | |
trait ScalaJHttpRequester { | |
def getRequest(address:String, |