checks the plottype of the script and plots it accordingly
        Args:
            script: script to be plotted
350096
def plot_script_validate(self, script):
        

        script.plot_validate([self.matplotlibwidget_1.figure, self.matplotlibwidget_2.figure])
        self.matplotlibwidget_1.draw()
        self.matplotlibwidget_2.draw()
688990
def analyze(self, scratch, **kwargs):
        """"""
        file_blocks = Counter()
        for script in self.iter_scripts(scratch):
            for name, _, _ in self.iter_blocks(script.blocks):
                file_blocks[name] += 1
        self.blocks.update(file_blocks)  # Update the overall count
        return {'types': file_blocks}
791936
def plot(histogram: HistogramBase, kind: Optional[str] = None, backend: Optional[str] = None, **kwargs):
    
    backend_name, backend = _get_backend(backend)
    if kind is None:
        kinds = [t for t in backend.types if histogram.ndim in backend.dims[t]]
        if not kinds:
            raise RuntimeError("No plot type is supported for {0}"
                               .format(histogram.__class__.__name__))
        kind = kinds[0]
    if kind in backend.types:
        method = getattr(backend, kind)
        return method(histogram, **kwargs)
    else:
        raise RuntimeError("Histogram type error: {0} missing in backend {1}"
                           .format(kind, backend_name))
1343237
def _find_script(script_name):
    
    if os.path.isfile(script_name):
        return script_name
    path = os.getenv('PATH', os.defpath).split(os.pathsep)
    for folder in path:
        if not folder:
            continue
        fn = os.path.join(folder, script_name)
        if os.path.isfile(fn):
            return fn

    sys.stderr.write('Could not find script {0}\n'.format(script_name))
    raise SystemExit(1)
1051013
def script(self, s):
        
        try:
            script = self._network.script.compile(s)
            script_info = self._network.contract.info_for_script(script)
            return Contract(script_info, self._network)
        except Exception:
            return None
1361875
def _get_colored_output(self, script):
        
        return bitcoin.core.CTxOut(self._dust_amount, bitcoin.core.CScript(script))
1158538
def executescript(self, *args, **kwargs):
        

        with self:
            self._cursor.executescript(*args, **kwargs)
302726
def _RunScript(self, script):
    
    process = subprocess.Popen(
        script, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
    while True:
      for line in iter(process.stdout.readline, b''):
        self.logger.info(line.decode('utf-8').rstrip('\n'))
      if process.poll() is not None:
        break
1070065
def evaluate_js(script, uid='master'):
    
    escaped_script = 'JSON.stringify(eval("{0}"))'.format(escape_string(script))
    return gui.evaluate_js(escaped_script, uid)
269276
def scripts( self, mydict ):
        """"""

        if isinstance( mydict, dict ):
            for src, type in list( mydict.items( ) ):
                self.script( '', src=src, type='text/%s' % type )
        else:
            try:
                for src in mydict:
                    self.script( '', src=src, type='text/javascript' )
            except:
                raise TypeError( "Script should be given a dictionary of src:type pairs or a list of javascript src's." )
1371426
def main(argv=None):
  
  try:
    _name_of_script, filepath = argv
  except ValueError:
    raise ValueError(argv)
  make_confidence_report_spsa(filepath=filepath, test_start=FLAGS.test_start,
                              test_end=FLAGS.test_end,
                              which_set=FLAGS.which_set,
                              report_path=FLAGS.report_path,
                              nb_iter=FLAGS.nb_iter,
                              batch_size=FLAGS.batch_size,
                              spsa_samples=FLAGS.spsa_samples,
                              spsa_iters=FLAGS.spsa_iters)
706955
def script_repr(self,imports=[],prefix="    "):
        
        return self.pprint(imports,prefix,unknown_value='',qualify=True,
                           separator="\n")
590998
function copyScript (script) {
    fs.copySync(path.join(__dirname, script), path.join(appScriptsPath, script))
  }
916594
def run_script(self, description):
        
        targetScript = None
        for item in self.configManager.allItems:
            if item.description == description and isinstance(item, model.Script):
                targetScript = item

        if targetScript is not None:
            self.runner.run_subscript(targetScript)
        else:
            raise Exception("No script with description '%s' found" % description)
6527
@Override
    public ScriptType getOutputScriptType() {
        int version = getWitnessVersion();
        checkState(version == 0);
        int programLength = getWitnessProgram().length;
        if (programLength == WITNESS_PROGRAM_LENGTH_PKH)
            return ScriptType.P2WPKH;
        if (programLength == WITNESS_PROGRAM_LENGTH_SH)
            return ScriptType.P2WSH;
        throw new IllegalStateException("Cannot happen.");
    }
291977
def __scripts(self, filestem):
        
        script_construct = open('%s/%s' % (self.tmpdir, RSD.CONSTRUCT), 'w')
        script_save = open('%s/%s' % (self.tmpdir, RSD.SAVE), 'w')
        script_subgroups = open('%s/%s' % (self.tmpdir, RSD.SUBGROUPS), 'w')

        # Permit the owner to execute and read this script
        for fn in RSD.SCRIPTS:
            os.chmod('%s/%s' % (self.tmpdir, fn), S_IREAD | S_IEXEC)

        # Writes one line of script
        new_script = lambda script: lambda x: script.write(x + '\n')

        #
        # 'Construction' script
        #
        w = new_script(script_construct)
        w(':- initialization(main).')
        w('main :-')
        w('[featurize],')
        w('r(%s),' % filestem)
        w('w.')
        script_construct.close()

        #
        # 'Saving' script
        #
        w = new_script(script_save)
        w(':- initialization(main).')
        w('main :-')
        w('[process],')
        w('r(%s),' % filestem)
        w('w,')
        w('w(weka, %s),' % filestem)
        w('w(rsd, %s).' % filestem)
        script_save.close()

        #
        # 'Subgroups' script
        #
        w = new_script(script_subgroups)
        w(':- initialization(main).')
        w('main :-')
        w('[rules],')
        w('r(%s),' % filestem)
        w('i,')
        w('w.')
        script_subgroups.close()
370094
def is_script(filename):
    '''
    '''
    if not os.path.isfile(filename):
        return False

    try:
        with open(filename, 'rb') as fp:
            return fp.read(2) == b'#!'
    except IOError:
        pass

    return False