:return: True when shell can be executed.
189303
def can_process_shell(self, entry):
        """"""
        count = 0
        condition = render(entry['when'], variables=self.pipeline.variables,
                           model=self.pipeline.model, env=self.get_merged_env(include_os=True))

        if Condition.evaluate("" if condition is None else condition):
            if len(self.pipeline.options.tags) == 0:
                return True

            if 'tags' in entry:
                for tag in self.pipeline.options.tags:
                    if tag in entry['tags']:
                        count += 1

        return count > 0
1315129
def is_ready_for_command(self, timeout=0):
        
        while True:
            try:
                return self.check_is_ready_for_command(timeout)
            except (select.error, IOError) as ex:
                if self.errno_from_exception(ex) == errno.EINTR:
                    continue
                return False
928008
public static function isShellExecution()
    {
        $sapiType = php_sapi_name();

        if ( $sapiType == 'cli' )
            return true;

        // For CGI we have to check, if the script has been executed over shell.
        // Currently it looks like the HTTP_HOST variable is the most reasonable to check.
        if ( substr( $sapiType, 0, 3 ) == 'cgi' )
        {
            if ( !self::serverVariable( 'HTTP_HOST', true ) )
                return true;
            else
                return false;
        }
        return false;
    }
1088384
def can(self, *args, **kwargs):
        ''''''
        if isinstance(self.require, auth.Permission):
            return self.require.can()
        elif callable(self.require):
            return self.require()
        elif isinstance(self.require, bool):
            return self.require
        else:
            return True
603840
def do_shell(self, args):
        """'"""
        if _debug: ConsoleCmd._debug("do_shell %r", args)

        os.system(args)
319666
def run_shell(cmd, timeout=60, verbose=False):
    """"""
    retcode = None
    try:
        p = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT, executable='/bin/bash')
        continue_running = True
    except Exception as e:
        yield("Failed: %s" % e)
        continue_running = False

    while continue_running:
        try:
            line = p.stdout.readline()
            if verbose and line:
                yield(line)
            elif line.strip():
                yield(line.strip())
        except Exception:
            pass

        try:
            data = irc.recv(4096)
        except Exception as e:
            data = ""
            retcode = p.poll()  # returns None while subprocess is running

        if '!cancel' in data:
            retcode = "Cancelled live output reading. You have to kill the process manually."
            yield "[X]: %s" % retcode
            break

        elif retcode is not None:
            try:
                line = p.stdout.read()
            except:
                retcode = "Too much output, read timed out. Process is still running in background."

            if verbose and line:
                yield line

            if retcode != 0:
                yield "[X]: %s" % retcode
            elif retcode == 0 and verbose:
                yield "[√]"

            break
901878
def wait(state)
      if !LXC::Shell.valid_state?(status.state)
        raise ArgumentError, "Invalid container state: #{state}"
      end

      run("wait", "-s", state)
    end
532217
def can_be_executed(self):
        
        missingParams = filter(lambda rp: rp not in self._parameters, self._requiredParameters)
        return len(missingParams) == 0
917270
def exec(command)
      remote_shell do |shell|
        shell.cd(shell.uri.path)
        shell.exec(command)
      end

      return true
    end
1329598
def shell(command, *args):
	''''''
	if args:
		command = command.format(*args)

	print LOCALE['shell'].format(command)

	try:
		return subprocess.check_output(command, shell=True)
	except subprocess.CalledProcessError, ex:
		return ex
1092366
def ensure_echo_on():
    """"""
    # tcgetattr will fail if stdin isn't a tty
    if not sys.stdin.isatty():
        return
    try:
        import termios
    except ImportError:
        return
    attributes = termios.tcgetattr(sys.stdin)
    if not attributes[3] & termios.ECHO:
        attributes[3] |= termios.ECHO
        termios.tcsetattr(sys.stdin, termios.TCSANOW, attributes)
570124
def on(device):
    '''
    
    '''
    cmd = 'quotaon {0}'.format(device)
    __salt__['cmd.run'](cmd, python_shell=False)
    return True
131958
def isInteractive():
    
    if sys.stdout.isatty() and os.name != 'nt':
        #Hopefully everything but ms supports '\r'
        try:
            import threading
        except ImportError:
            return False
        else:
            return True
    else:
        return False
866432
def available(self, context):
        
        if not self._enabled:
            return False
        try:
            return self.pre_condition(context) and self._check_condition(context)
        except Exception:
            return False
50885
def available(name):
    '''
    
    '''
    cmd = '{0} get {1}'.format(_cmd(), name)
    if __salt__['cmd.retcode'](cmd) == 2:
        return False
    return True
1208600
def shell_call(self, shellcmd):
        """"""
        return(subprocess.call(self.shellsetup + shellcmd, shell=True))
372403
def safe_to_exit(self, *args, **kargs):
        
        if len(self.value) == self.instance_num:
            return True
        return False