Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@cli.switch(["a"])
def spam(self):
print("!!a")
@cli.switch(["a"])
def spam(self):
print("!!a")
@cli.switch(["b", "bacon"], argtype=int, mandatory = True, envname="PLUMBUM_TEST_BACON")
def bacon(self, param):
"""give me some bacon"""
print ("!!b", param)
@cli.switch(["b"], help="this is a bacon switch")
def bacon(self):
print("Oooooh, I love BACON!")
@cli.switch("--data-topic", str)
def get_data_topic(self, topic):
"""The Kafka topic where train and test data is fed."""
self.data_topic = topic
@cli.switch(
['r', '--range'],
int,
help='How many days to back-fetch'
)
def override_back_range(self, back_range):
"""override back_range from user"""
self.back_range = back_range
@cli.switch(['-e'], float, help='Change emotionality')
def abuse_lexical(self, abuse):
self._abuse = abuse
@cli.switch("--newsreel")
def get_newsreel(self, requires=['--data-source']):
"""Use the settings relevant for the Newsreel competition Task 2. Equivalent to the switches --skip-training --input-data split --no-control-messages.
It will check that the computing environment communication protocol is HTTP or HTTPS."""
self.newsreel = True
self.skip_training_cycle = True
self.input_data = "split"
self.no_control_messages = True
if not self.computing_environment_url.scheme in ['http', 'https']: raise Exception("For Newsreel, the computing environment URL must have scheme http or https.")
@cli.switch("--training-uri", str)
def get_training_uri(self, training_uri):
"""The location of the training data."""
self.training_uri = training_uri
self.input_data = 'test'
@cli.switch("--test-uri", str)
def get_test_uri(self, test_uri):
"""The location of the test data."""
self.test_uri = test_uri
self.input_data = 'test'