Get the allowed instruments
435870
def getInstruments(self):
        
        query = {"portal_type": "Instrument", "is_active": True}

        if self.getRestrictToMethod():
            query.update({
                "getMethodUIDs": {
                    "query": api.get_uid(self.getRestrictToMethod()),
                    "operator": "or",
                }
            })

        instruments = api.search(query, "bika_setup_catalog")
        items = map(lambda i: (i.UID, i.Title), instruments)

        instrument = self.getInstrument()
        if instrument:
            instrument_uids = map(api.get_uid, instruments)
            if api.get_uid(instrument) not in instrument_uids:
                items.append(
                    (api.get_uid(instrument), api.get_title(instrument)))

        items.sort(lambda x, y: cmp(x[1], y[1]))
        items.insert(0, ("", _("No instrument")))

        return DisplayList(list(items))
722153
def get_allowed_methods(self, callback):
        
        if hasattr(callback, 'actions'):
            return [method.upper() for method in callback.actions.keys() if method != 'head']

        return [
            method for method in
            callback.cls().allowed_methods if method not in ('OPTIONS', 'HEAD')
        ]
441363
def loaded_instruments(self) -> Dict[str, Optional['InstrumentContext']]:
        
        return {mount.name.lower(): instr for mount, instr
                in self._instruments.items()}
1100886
def get_tracks(self, *args, **kwargs):
        
        args = tuple(['tracks'] + list(args))
        return self.get_music_library_information(*args, **kwargs)
943598
def get_options(server):
    """"""
    try:
        response = requests.options(
            server, allow_redirects=False, verify=False, timeout=5)
    except (requests.exceptions.ConnectionError,
            requests.exceptions.MissingSchema):
        return "Server {} is not available!".format(server)

    try:
        return {'allowed': response.headers['Allow']}
    except KeyError:
        return "Unable to get HTTP methods"
522102
public List<MFInstrument> getMFInstruments() throws KiteException, IOException, JSONException {
        KiteRequestHandler kiteRequestHandler = new KiteRequestHandler(proxy);
        return readMfCSV(kiteRequestHandler.getCSVRequest(routes.get("mutualfunds.instruments"), apiKey, accessToken));
    }
607113
def get_instrument_interfaces():
    
    interfaces = list()
    for name, adapter in getAdapters((api.get_portal(),), IInstrumentInterface):
        # We need a unique identifier for this instrument interface
        id = "{}.{}".format(adapter.__module__, adapter.__class__.__name__)
        interfaces.append((id, adapter))

    # TODO Remove the following code once clasic instrument interfaces migrated
    # Now grab the information (the old way)
    curr_module = sys.modules[__name__]
    for name, obj in inspect.getmembers(curr_module):
        if hasattr(obj, '__name__'):
            obj_name = obj.__name__.replace(__name__, "")
            obj_name = obj_name and obj_name[1:] or ""
            if obj_name in __all__:
                interfaces.append((obj_name, obj))
    return interfaces
866692
public void getAllInstruments(KiteConnect kiteConnect) throws KiteException, IOException {
        // Get all instruments list. This call is very expensive as it involves downloading of large data dump.
        // Hence, it is recommended that this call be made once and the results stored locally once every morning before market opening.
        List<Instrument> instruments = kiteConnect.getInstruments();
        System.out.println(instruments.size());
    }
921644
public function getAvailableDevices()
    {
        $availableDevices = array();
        $rules = array_change_key_case($this->detector->getRules());

        foreach ($rules as $device => $rule) {
            $availableDevices[$device] = static::fromCamelCase($device);
        }

        return $availableDevices;
    }
512787
def get_albums(self, *args, **kwargs):
        
        args = tuple(['albums'] + list(args))
        return self.get_music_library_information(*args, **kwargs)
1179750
private Instrumenter getInstrumenter(Log log, List<String> classpath) throws MojoExecutionException {
        List<File> classpathFiles;
        try {
            log.debug("Getting compile classpath");
            classpathFiles = classpath
                    .stream().map(x -> new File(x)).collect(Collectors.toList());

            log.debug("Classpath for instrumentation is as follows: " + classpathFiles);
        } catch (Exception ex) {
            throw new MojoExecutionException("Unable to get compile classpath elements", ex);
        }

        log.debug("Creating instrumenter...");

        try {
            return new Instrumenter(classpathFiles);
        } catch (Exception ex) {
            throw new MojoExecutionException("Unable to create instrumenter", ex);
        }
    }
457942
def get_instrument_title(self):
        
        instrument = self.context.getInstrument()
        if not instrument:
            return ""
        return api.get_title(instrument)
1200883
def audio_inputs(self):
        
        return self.client.get_ports(is_audio=True, is_physical=True, is_input=True)
422411
def instrument(self, start=0, offset=100):
        '''
        
        '''
        with self.client.connect(*self.bestip):
            # nums = self.client.get_instrument_count()
            data = self.client.get_instrument_info(int(start), int(offset))
            return self.client.to_df(data)
1307817
def _get_aux_specs(self):
        """"""
        # Drop the "core" specifications, which are handled separately.
        specs = self._specs_in.copy()
        [specs.pop(core) for core in self._CORE_SPEC_NAMES]

        specs[_REGIONS_STR] = self._get_regions()
        specs[_VARIABLES_STR] = self._get_variables()
        specs['date_ranges'] = self._get_date_ranges()
        specs['output_time_regional_reductions'] = self._get_time_reg_reducts()

        return specs
264083
private static void instrumentMaven(Instrumentation instrumentation) {
        try {
            for (Class<?> clz : instrumentation.getAllLoadedClasses()) {
                String name = clz.getName();
                if (name.equals(Names.ABSTRACT_SUREFIRE_MOJO_CLASS_VM)
                        || name.equals(Names.SUREFIRE_PLUGIN_VM)
                        || name.equals(Names.FAILSAFE_PLUGIN_VM)
                        || name.equals(Names.TESTMOJO_VM)) {
                    instrumentation.retransformClasses(clz);
                }
            }
        } catch (UnmodifiableClassException ex) {
            // Consider something better than doing nothing.
        }
    }
958761
def export_default_instruments(target_folder, source_folder = None, raise_errors = False, verbose=True):
    
    print('export_def_instr called')
    instruments_to_load = get_classes_in_folder(source_folder, Instrument, verbose = True)
    print('instruments to load:')
    print(instruments_to_load)

    if verbose:
        print(('attempt to load {:d} instruments: '.format(len(instruments_to_load))))
    loaded_instruments, failed = Instrument.load_and_append(instruments_to_load, raise_errors = raise_errors)
    print('loaded instruments:')
    print(loaded_instruments, failed)

    for name, value in loaded_instruments.items():
        filename = os.path.join(target_folder, '{:s}.b26'.format(name))

        value.save_b26(filename)

    if verbose:
        print('\n================================================')
        print('================================================')
        print(('saved {:d} instruments, {:d} failed'.format(len(loaded_instruments), len(failed))))
        if failed != {}:
            for error_name, error in failed.items():
                print(('failed to create instruments: ', error_name, error))