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 json | |
from pathlib import Path | |
import numpy as np | |
import certifi | |
import ssl | |
import os | |
from typing import List | |
from zurich.space.security import add_zurichca |
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 mlflow_pip_deps() -> List[str]: | |
try: | |
poetry_export_result = subprocess.run( | |
["poetry", "export", "-f", "requirements.txt", "--without-hashes"], | |
capture_output=True, | |
encoding="utf8", | |
).stdout.splitlines() | |
result = [] | |
for req in poetry_export_result: | |
# ignore extra/index url lines |
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 install_requirements(requirements: Union[str, List[str]], space_token: Optional[str] = None) -> None: | |
""" | |
Instally Pip dependencies defined in requirements list. | |
Parameters | |
---------- | |
:param requirements: If `str`, its interpreted as a path to `requirements.txt`, if it is a list, the list of dependencies will be added. | |
:param space_token: The personal accesss token to access artifacts from Space artifacts library (required if Zurich internal packages should be deployed). | |
""" | |
args = [ |
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
package ch.suva.mlp.app | |
import akka.actor.ActorSystem | |
import akka.stream.OverflowStrategy | |
import akka.stream.scaladsl.{Concat, Flow, Keep, Sink, Source} | |
import scala.concurrent.{ExecutionContext, Future} | |
import scala.util.{Failure, Success} | |
object TestApp extends App { |
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 orderEntry(order: Order): Try[OrderEntryProcessed] = { | |
order.items foreach { item => | |
val stock = stockRepository.getProductById(item.product) | |
stock.amount = stock.amount - item.amount | |
stockRepository.updateStockItem(stock) | |
} | |
incredible_ai.checkForFraud(order) | |
payments.makePayment(order.paymentDetails) | |
coolBonusPointsSystem.giveBonusForOrder(order) |
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
# The first line should contain the title of the post | |
Then you can just write whatever you want with every Markdown feature available on GitHub. | |
You can mark the split between the preview and the rest of the post with ... | |
--- | |
... a horizontal line. On the single view of the post, the preview as well as the rest of the article will be displayed. |
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
{ | |
"title": "Blog Title", | |
"dateFormat": "MMMM DD, YYYY", | |
"postPerPage": 3, | |
"description": "This is a sample blog template. You may not define any description at all. But, you can do here...", | |
"topics": [ | |
"topic-a", | |
"topic-b", | |
"topic-c" | |
], |
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
package wellnr.commons; | |
import com.google.common.collect.Maps; | |
import com.typesafe.config.Config; | |
import com.typesafe.config.ConfigException; | |
import com.typesafe.config.ConfigFactory; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.io.File; |
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
package com.example | |
object SimpleApplication extends App { | |
SimpleServer.startServer("localhost", 8080) | |
} |
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
(req, res, next) => { | |
const auth = req.cookies.auth; | |
const token = _.get(auth, 'token'); | |
if (token) { | |
cloudant((db) => { | |
const selector = { | |
entity: 'user', | |
token: token | |
}; |
NewerOlder