gets the status of a recipe
        :param self: DKCloudAPI
        :param kitchen: string
        :param recipe: string
        :rtype: dict
518786
def recipe_tree(self, kitchen, recipe):
        
        rc = DKReturnCode()
        if kitchen is None or isinstance(kitchen, basestring) is False:
            rc.set(rc.DK_FAIL, 'issue with kitchen parameter')
            return rc
        if recipe is None or isinstance(recipe, basestring) is False:
            rc.set(rc.DK_FAIL, 'issue with recipe parameter')
            return rc
        url = '%s/v2/recipe/tree/%s/%s' % (self.get_url_for_direct_rest_call(),
                                           kitchen, recipe)
        try:
            response = requests.get(url, headers=self._get_common_headers())
            rdict = self._get_json(response)
            pass
        except (RequestException, ValueError, TypeError), c:
            s = "recipe_tree: exception: %s" % str(c)
            rc.set(rc.DK_FAIL, s)
            return rc
        if DKCloudAPI._valid_response(response):
            remote_sha = rdict['recipes'][recipe]
            rc.set(rc.DK_SUCCESS, None, remote_sha)
        else:
            arc = DKAPIReturnCode(rdict, response)
            rc.set(rc.DK_FAIL, arc.get_message())
        return rc
1261515
def get_key_rotation_status(key_id, region=None, key=None, keyid=None,
                            profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    r = {}
    try:
        key_rotation_status = conn.get_key_rotation_status(key_id)
        r['result'] = key_rotation_status['KeyRotationEnabled']
    except boto.exception.BotoServerError as e:
        r['error'] = __utils__['boto.get_error'](e)
    return r
325280
def get_recipe_intent_handler(request):
    

    # Get variables like userId, slots, intent name etc from the 'Request' object
    ingredient = request.slots["Ingredient"]  # Gets an Ingredient Slot from the Request object.
    
    if ingredient == None:
        return alexa.create_response("Could not find an ingredient!")

    # All manipulations to the request's session object are automatically reflected in the request returned to Amazon.
    # For e.g. This statement adds a new session attribute (automatically returned with the response) storing the
    # Last seen ingredient value in the 'last_ingredient' key. 

    request.session['last_ingredient'] = ingredient # Automatically returned as a sessionAttribute
    
    # Modifying state like this saves us from explicitly having to return Session objects after every response

    # alexa can also build cards which can be sent as part of the response
    card = alexa.create_card(title="GetRecipeIntent activated", subtitle=None,
                             content="asked alexa to find a recipe using {}".format(ingredient))    

    return alexa.create_response("Finding a recipe with the ingredient {}".format(ingredient),
                                 end_session=False, card_obj=card)
543831
def next_state(self):
        """"""
        self.active_recipe_item += 1
        if self.active_recipe_item >= len(self.recipe):
            # we're done!
            return
        # show state step on screen
        print("--------------------------------------------")
        print("Setting next process step: %d" % self.active_recipe_item)
        print("time:%d, target: %ddegF, fan: %d, state: %s" %
              (self.recipe[self.active_recipe_item]['time_remaining'],
               self.recipe[self.active_recipe_item]['target_temp'],
               self.recipe[self.active_recipe_item]['fan_speed'],
               self.recipe[self.active_recipe_item]['state']
               ))
        print("--------------------------------------------")
        # set values for next state
        self.roaster.time_remaining = (
            self.recipe[self.active_recipe_item]['time_remaining'])
        self.roaster.target_temp = (
            self.recipe[self.active_recipe_item]['target_temp'])
        self.roaster.fan_speed = (
            self.recipe[self.active_recipe_item]['fan_speed'])
        # set state
        if(self.recipe[self.active_recipe_item]['state'] == 'roasting'):
            self.roaster.roast()
        elif(self.recipe[self.active_recipe_item]['state'] == 'cooling'):
            self.roaster.cool()
        elif(self.recipe[self.active_recipe_item]['state'] == 'idle'):
            self.roaster.idle()
        elif(self.recipe[self.active_recipe_item]['state'] == 'cooling'):
            self.roaster.sleep()
866819
def register(self, name, path, plugin, description=None, final_words=None):
        
        if name in self.recipes.keys():
            raise RecipeExistsException("Recipe %s was already registered by %s" %
                                        (name, self.recipes["name"].plugin.name))

        self.recipes[name] = Recipe(name, path, plugin, description, final_words)
        self.__log.debug("Recipe %s registered by %s" % (name, plugin.name))
        return self.recipes[name]
909982
def recipe_compile(backend, kitchen, recipe, variation):
    
    err_str, use_kitchen = Backend.get_kitchen_from_user(kitchen)
    if use_kitchen is None:
        raise click.ClickException(err_str)

    if recipe is None:
        recipe = DKRecipeDisk.find_recipe_name()
        if recipe is None:
            raise click.ClickException('You must be in a recipe folder, or provide a recipe name.')

    click.secho('%s - Get the Compiled OrderRun of Recipe %s.%s in Kitchen %s' % (get_datetime(), recipe, variation, use_kitchen),
                fg='green')
    check_and_print(DKCloudCommandRunner.get_compiled_serving(backend.dki, use_kitchen, recipe, variation))
635436
def register(self, recipe):
        

        if not isinstance(recipe, (list, tuple)):
            recipe = [recipe, ]

        for item in recipe:
            recipe = self.get_recipe_instance_from_class(item)
            self._registry[recipe.slug] = recipe
322589
def get_dependency_tuple_list_for_recipe(recipe, blacklist=None):
    
    if blacklist is None:
        blacklist = set()
    assert(type(blacklist) == set)
    if recipe.depends is None:
        dependencies = []
    else:
        # Turn all dependencies into tuples so that product will work
        dependencies = fix_deplist(recipe.depends)

        # Filter out blacklisted items and turn lowercase:
        dependencies = [
            tuple(set(deptuple) - blacklist)
            for deptuple in dependencies
            if tuple(set(deptuple) - blacklist)
        ]
    return dependencies
431681
def status(self, **kwargs):
        
        self.services = dict(
            init_system=self.init_system,
            services=[]
        )
219068
def status(app_name=None, only_cozy=False, as_boolean=False):
    '''
    '''
    apps = {}
    # Get all apps status & slip them
    apps_status = subprocess.Popen('cozy-monitor status',
                                   shell=True,
                                   stdout=subprocess.PIPE).stdout.read()
    apps_status = apps_status.split('\n')

    # Parse result to store them in apps dictionary
    for app_status in apps_status:
        if app_status:
            app_status = ANSI_ESCAPE.sub('', app_status).split(': ')
            if len(app_status) == 2:
                current_status = app_status[1]
                if as_boolean:
                    if app_status[1] == 'up':
                        current_status = True
                    else:
                        current_status = False
                if only_cozy and app_status[0] not in SYSTEM_APPS:
                    apps[app_status[0]] = current_status
                else:
                    apps[app_status[0]] = current_status

    # Return app status if get as param or return all apps status
    if app_name:
        return apps.get(app_name, None)
    else:
        return apps
300044
def run_recipe(recipe, task, rinput, workenv, logger_control):
    """"""

    # Creating custom logger file
    recipe_logger = logging.getLogger(logger_control['default'])

    if logger_control['enabled']:
        logfile = os.path.join(workenv.resultsdir, logger_control['logfile'])
        logformat = logger_control['format']
        _logger.debug('creating file logger %r from Recipe logger', logfile)
        fh = create_recipe_file_logger(recipe_logger, logfile, logformat)
    else:
        fh = logging.NullHandler()

    recipe_logger.addHandler(fh)

    with working_directory(workenv.workdir):
        try:
            run_recipe_timed(task, recipe, rinput)
            return task
        finally:
            recipe_logger.removeHandler(fh)
264840
def p_recipe(self, t):
        """"""
        if len(t) == 3:
            t[0] = t[1] + t[2]
        else:
            t[0] = t[1]
739299
def recipe_conflicts(backend):
    
    recipe_dir = DKRecipeDisk.find_recipe_root_dir()
    if recipe_dir is None:
        raise click.ClickException('You must be in a Recipe folder.')
    recipe_name = DKRecipeDisk.find_recipe_name()
    click.secho("%s - Checking for conflicts on Recipe '%s'" % (
        get_datetime(),recipe_name))
    recipe_name = DKRecipeDisk.find_recipe_name()
    check_and_print(DKCloudCommandRunner.get_unresolved_conflicts(recipe_name, recipe_dir))
1167388
def get_recipe_instances_for_badges(self, badges):
        
        from .exceptions import BadgeNotFound

        valid, invalid = [], []

        if not isinstance(badges, (list, tuple)):
            badges = [badges]

        for badge in badges:
            try:
                recipe = self.get_recipe_instance(badge)
                valid.append(recipe)
            except BadgeNotFound:
                logger.debug('✘ Badge "%s" has not been registered', badge)
                invalid.append(badge)

        return (valid, invalid)
804363
def get_recipe(self, recipe_name):
        
        if recipe_name.endswith('.yaml'):
            recipe = self._recipes.get(RecipeObject.FromFile(recipe_name, self._recipe_actions, self._recipe_resources).name)
        else:
            recipe = self._recipes.get(recipe_name)
        if recipe is None:
            raise RecipeNotFoundError("Could not find recipe", recipe_name=recipe_name, known_recipes=[x for x in self._recipes.keys()])

        return recipe
1316888
def build(self, recipe, plugin=None):
        
        if recipe not in self.recipes.keys():
            raise RecipeMissingException("Recipe %s unknown." % recipe)

        recipe_obj = self.recipes[recipe]

        if plugin is not None:
            if recipe_obj.plugin != plugin:
                raise RecipeWrongPluginException("The requested recipe does not belong to the given plugin. Use"
                                                 "the app object, to retrieve the requested recipe: "
                                                 "my_app.recipes.get(%s)" % recipe)

        recipe_obj.build()
214899
def run(self):
        

        self._prepare()

        for recipe in self._recipes:
            run_recipe = True

            # Ask user whether to run current recipe if -y argument is not specified
            if not self.arguments.yes:
                run_recipe = pypro.console.ask_bool('Run %s.%s' % (recipe.module, recipe.name), "yes")

            if run_recipe:
                recipe.run(self, self.arguments)

        if self.arguments.verbose:
            pypro.console.out('Thanks for using pypro. Support this project at https://github.com/avladev/pypro')