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
def add(x,y): | |
return x+y | |
total = add(2,2) | |
print(total) | |
#var= |
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
def hello(): | |
print("Hey") |
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
#I am very lazy and I always want Python to work | |
echo "I am going to source a python virtual environment" | |
which python | |
python --version | |
source ~/.googlecloudshell/bin/activate | |
echo "I just sourced a python virtual environment" | |
which python | |
python --version |
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
def hello(): | |
return "hi" |
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
def hello(): | |
return "hello there" |
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
def hello(): | |
return "hi" |
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 sys | |
from random import random | |
from operator import add | |
from pyspark import SparkContext | |
sc = SparkContext.getOrCreate() | |
partitions = 30 | |
n = 100000 * partitions | |
def f(_): |
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 wikipedia | |
from google.cloud import translate | |
def sample_translate_text(text="YOUR_TEXT_TO_TRANSLATE", | |
project_id="YOUR_PROJECT_ID", language="fr"): | |
"""Translating Text.""" | |
client = translate.TranslationServiceClient() |
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 wikipedia | |
from google.cloud import translate | |
def sample_translate_text(text="YOUR_TEXT_TO_TRANSLATE", | |
project_id="YOUR_PROJECT_ID", language="fr"): | |
"""Translating Text.""" | |
client = translate.TranslationServiceClient() |
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 wikipedia | |
from google.cloud import translate | |
def sample_translate_text(text="YOUR_TEXT_TO_TRANSLATE", | |
project_id="YOUR_PROJECT_ID", language="fr"): | |
"""Translating Text.""" | |
client = translate.TranslationServiceClient() |