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 Repository: | |
def __init__(self, db: str): | |
self.db = db | |
def get_data(self): | |
return 'Hello World' | |
class Service: | |
def __init__(self, repsoitory: Repository): | |
self.repsoitory = repsoitory | |
def process(self): | |
return self.repsoitory.get_data() |
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 pinject | |
import os | |
class Repository: | |
def __init__(self, db: str): | |
self.db = db | |
def get_data(self): | |
return 'Hello World' | |
class RepositoryBindingSpec(pinject.BindingSpec): | |
def provide_repository(self): | |
return Repository(db=os.getenv('dbname')) |
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 Repository: | |
def __init__(self): | |
self.db = os.getenv('dbname') | |
def get_data(self): | |
return 'Hello World' | |
class Service: | |
def __init__(self): | |
self.repository = Repository() | |
def process(self): | |
return self.dal.get_data() |
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 library essentials | |
from sumy.parsers.plaintext import PlaintextParser #We're choosing a plaintext parser here, other parsers available for HTML etc. | |
from sumy.nlp.tokenizers import Tokenizer | |
from sumy.summarizers.lex_rank import LexRankSummarizer #We're choosing Lexrank, other algorithms are also built in | |
file = "plain_text.txt" #name of the plain-text file | |
parser = PlaintextParser.from_file(file, Tokenizer("english")) | |
summarizer = LexRankSummarizer() | |
summary = summarizer(parser.document, 5) #Summarize the document with 5 sentences |
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
license: mit |
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
license: mit |
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 hashlib | |
import time | |
import openslide | |
class MetadataExtractor: | |
PROPERTIES = [ | |
"objective", | |
"mpp-x", | |
"mpp-y", | |
"vendor", |
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
{ | |
_id: '{{objectId()}}', | |
index: '{{index()}}', | |
guid: '{{guid()}}', | |
isActive: '{{bool()}}', | |
balance: '{{floating(1000, 4000, 2, "$0,0.00")}}', | |
picture: 'http://placehold.it/32x32', | |
age: '{{integer(20, 40)}}', | |
eyeColor: '{{random("blue", "brown", "green")}}', | |
company: '{{company().toUpperCase()}}', |
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
[ { | |
"timestamp" : "2014-01-03T06:35:22.255Z", | |
"result" : [ { | |
"count" : 337, | |
"eyeColor" : "brown" | |
}, { | |
"count" : 328, | |
"eyeColor" : "blue" | |
}, { | |
"count" : 298, |
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
{ | |
"queryType" : "topN", | |
"dataSource" : "dummyx", | |
"intervals" : ["2014-01-01/2016-10-13"], | |
"granularity" : "all", | |
"dimension" : "eyeColor", | |
"metric" : "count", | |
"threshold" : 25, | |
"aggregations" :[ | |
{ |
NewerOlder