language
stringclasses
2 values
func_code_string
stringlengths
63
466k
python
def _set_zone(self, v, load=False): """ Setter method for zone, mapped from YANG variable /zoning/defined_configuration/zone (list) If this variable is read-only (config: false) in the source YANG file, then _set_zone is considered as a private method. Backends looking to populate this variable shou...
python
def unload_module(self, module_name): """Unload the specified module, if it is loaded.""" module = self.loaded_modules.get(module_name) if not module: _log.warning("Ignoring request to unload non-existant module '%s'", module_name) return False ...
python
async def next(self, count=None): """Load the next (newer) page/batch of events. :param count: A limit on the number of events to fetch. By default the limit is the same as that specified for this set of events. """ if self._next_uri is None: return self[:0] # A...
java
public static ObjectMapperClientFeatureModule with( Class<? extends Annotation> clientBindingAnnotation) { BindingAnnotations.checkIsBindingAnnotation(clientBindingAnnotation); return new ObjectMapperClientFeatureModule(clientBindingAnnotation); }
java
protected List<CmsResourceTypeConfig> internalGetResourceTypes(boolean filterDisabled) { CmsADEConfigData parentData = parent(); List<CmsResourceTypeConfig> parentResourceTypes = null; if (parentData == null) { parentResourceTypes = Lists.newArrayList(); } else { ...
python
def spawn_radia(job, rna_bam, tumor_bam, normal_bam, univ_options, radia_options): """ This module will spawn a radia job for each chromosome, on the RNA and DNA. ARGUMENTS 1. rna_bam: Dict of input STAR bams rna_bam |- 'rnaAligned.sortedByCoord.out.bam': REFER run_star() ...
java
public static Inet6Address getByName(CharSequence ip, boolean ipv4Mapped) { byte[] bytes = getIPv6ByName(ip, ipv4Mapped); if (bytes == null) { return null; } try { return Inet6Address.getByAddress(null, bytes, -1); } catch (UnknownHostException e) { ...
java
public final void entryRuleAssignableTerminal() throws RecognitionException { try { // InternalXtext.g:921:1: ( ruleAssignableTerminal EOF ) // InternalXtext.g:922:1: ruleAssignableTerminal EOF { before(grammarAccess.getAssignableTerminalRule()); pus...
java
private boolean startPartition(PartitionPlanConfig config) { if (isStoppingStoppedOrFailed()) { return false; } if (isMultiJvm) { startPartitionRemote(config); } else { startPartitionLocal(config); } // TODO: should this message be i...
java
private FileSystem newZipFileSystem(final File file) throws IOException { final Map<String, String> env = new HashMap<>(); env.put("create", "true"); return newFileSystem(URI.create("jar:" + file.toURI()), env); }
java
public static void construct_column(int k, int[] Ap, int[] Ai, double[] Ax, int[] Q, double[] X, int k1, int[] PSinv, double[] Rs, int scale, int[] Offp, int[] Offi, double[] Offx) { double aik ; int i, p, pend, oldcol, kglobal, poff, oldrow ; /* -----------------------------------------------------------...
java
public static final <T extends Date> Function<T, MutableDateTime> dateToMutableDateTime(Chronology chronology) { return new DateToMutableDateTime<T>(chronology); }
java
public static RedisClient create(ClientResources clientResources, RedisURI redisURI) { assertNotNull(clientResources); assertNotNull(redisURI); return new RedisClient(clientResources, redisURI); }
python
def register(self, src, trg, trg_mask=None, src_mask=None): """ Implementation of pair-wise registration and warping using Enhanced Correlation Coefficient This function estimates an Euclidean transformation (x,y translation + rotation) using the intensities of the pair of images to be register...
java
DistributionSummary summary(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, double scale) { return registerMeterIfNecessary(DistributionSummary.class, id, distributionStatisticConfig, (id2, filteredConfig) -> newDistributionSummary(id2, filteredConfig.merge(defaultHistogram...
python
def _parse_textgroup(self, cts_file): """ Parses a textgroup from a cts file :param cts_file: Path to the CTS File :type cts_file: str :return: CtsTextgroupMetadata and Current file """ with io.open(cts_file) as __xml__: return self.classes["textgroup"].parse...
java
public static MchPayApp generateMchAppData(String prepay_id, String appId, String partnerid, String key) { Map<String, String> wx_map = new LinkedHashMap<String, String>(); wx_map.put("appid", appId); wx_map.put("partnerid", partnerid); wx_map.put("prepayid", prepay_id); wx_map.put("package", "Sign=WXPay...
java
public final DSLMapParser.key_section_return key_section() throws RecognitionException { DSLMapParser.key_section_return retval = new DSLMapParser.key_section_return(); retval.start = input.LT(1); Object root_0 = null; ParserRuleReturnScope ks =null; RewriteRuleSubtreeStream stream_key_sentence=new Rewrite...
python
def _init_pdf(style_path, header=None, footer=FOOTER): """ Initialize :class:`RstToPdf` class. Args: style_path (str): Path to the style for the PDF. header (str, default None): Header which will be rendered to each page. footer (str, default FOOTER): Footer, which will be rendered ...
java
public View<?, ?> getRootParentView() { View<?, ?> currentView = this; while (currentView.hasParent()) { currentView = currentView.getParent(); } return currentView; }
java
@Override public int read() throws IOException { if (pos >= size) { // try to get more ... readMore(); if (pos >= size) return -1; // Still nothing } return buffer[pos++] & 0xFF; }
java
public static Node createStatusUpdateNode(final String statusUpdateId) { if (INDEX_STATUS_UPDATES.get(IDENTIFIER, statusUpdateId).getSingle() == null) { final Node statusUpdate = DATABASE.createNode(); statusUpdate.setProperty(Properties.StatusUpdate.IDENTIFIER, statusUpdateId); INDEX_STATUS_UPDATES.add...
python
def from_sys_requirements(cls, system_requirements, _type='all'): """ Returns SystemRequirementsDict encapsulating system requirements. It can extract only entrypoints with specific fields ('clusterSpec', 'instanceType', etc), depending on the value of _type. """ if _type...
python
def fetch_document(url=None, host=None, path="/", timeout=10, raise_ssl_errors=True, extra_headers=None): """Helper method to fetch remote document. Must be given either the ``url`` or ``host``. If ``url`` is given, only that will be tried without falling back to http from https. If ``host`` given, `pa...
java
public Quaterniond nlerpIterative(Quaterniondc q, double alpha, double dotThreshold, Quaterniond dest) { double q1x = x, q1y = y, q1z = z, q1w = w; double q2x = q.x(), q2y = q.y(), q2z = q.z(), q2w = q.w(); double dot = q1x * q2x + q1y * q2y + q1z * q2z + q1w * q2w; double absDot = Math....
java
public void setSearchLocations(Collection<String> searchLocations) { patchMatchingResolver = new PathMatchingResourcePatternResolver(getDefaultResourceLoader()); for (String searchLocation : searchLocations) { initializeForSearchLocation(searchLocation); } }
java
private void reportFatalError(String msgId, String arg) throws JspCoreException { throw new JspCoreException(msgId, new Object[] { arg }); //err.jspError(msgId, arg); }
java
public com.google.api.ads.adwords.axis.v201809.cm.IncomeTier getTier() { return tier; }
java
public static Supplier<Void> supplier(Runnable adaptee) { dbc.precondition(adaptee != null, "cannot adapt a null runnable"); return () -> { adaptee.run(); return null; }; }
python
def list_opts(): """Returns a list of oslo_config options available in the library. The returned list includes all oslo_config options which may be registered at runtime by the library. Each element of the list is a tuple. The first element is the name of the group under which the list of elements ...
java
private boolean copyBlockLocalAdd(String srcFileSystem, File srcBlockFile, int srcNamespaceId, Block srcBlock, int dstNamespaceId, Block dstBlock) throws IOException { boolean hardlink = true; File dstBlockFile = null; lock.writeLock().lock(); try { if (isValidBlock(dstNamespaceId, dst...
java
@Override public ModifyEndpointResult modifyEndpoint(ModifyEndpointRequest request) { request = beforeClientExecution(request); return executeModifyEndpoint(request); }
java
@Override public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) { LOGGER.debug("-- getting repository info"); RepositoryInfo info = jcrRepository(repositoryId).getRepositoryInfo(login(repositoryId)); return new RepositoryInfoLocal(repositoryId, info); }
python
def initialize(self): """ A reimplemented initializer. This method will add the include objects to the parent of the include and ensure that they are initialized. """ super(Block, self).initialize() if self.block: self.block.parent.insert_children(self.block...
java
private void finishRunningTask(TaskStatus finalStatus, long now) { TaskAttemptID taskId = finalStatus.getTaskID(); if (LOG.isDebugEnabled()) { LOG.debug("Finishing running task id=" + taskId + ", now=" + now); } SimulatorTaskInProgress tip = tasks.get(taskId); if (tip == null) { throw n...
python
def main(args=None): """ The main routine. """ cfg.configureLogger() wireHandlers(cfg) # get config from a flask standard place not our config yml app.run(debug=cfg.runInDebug(), host='0.0.0.0', port=cfg.getPort())
java
private final StringBuilder makeAjax(ClientBehaviorContext context, AjaxBehavior behavior) { StringBuilder retVal = SharedStringBuilder.get(context.getFacesContext(), AJAX_SB, 60); StringBuilder paramBuffer = SharedStringBuilder.get(context.getFacesContext(), AJAX_PARAM_SB, 20); String exec...
python
def put_key(self, source, rel_path): '''Copy a file to the repository Args: source: Absolute path to the source file, or a file-like object rel_path: path relative to the root of the repository ''' k = self._get_boto_key(rel_path) try: k.set...
python
def fit(self): """ fit waveforms in any domain""" # solve for estimator of B n,p = np.shape(self._X) self._df = float(n - p) self._Cx = np.linalg.pinv(np.dot(self._X.T,self._X)) self._Bhat = np.dot(np.dot(self._Cx, self._X.T), self._A) self._Y_r...
python
def _FormatOpaqueToken(self, token_data): """Formats an opaque token as a dictionary of values. Args: token_data (bsm_token_data_opaque): AUT_OPAQUE token data. Returns: dict[str, str]: token values. """ data = ''.join(['{0:02x}'.format(byte) for byte in token_data.data]) return {'...
python
def merge_systems(sysa, sysb, bounding=0.2): '''Generate a system by merging *sysa* and *sysb*. Overlapping molecules are removed by cutting the molecules of *sysa* that have atoms near the atoms of *sysb*. The cutoff distance is defined by the *bounding* parameter. **Parameters** sysa: Syste...
python
def inline_link( self, text, url): """*generate a MMD sytle link* **Key Arguments:** - ``text`` -- the text to link from - ``url`` -- the url to link to **Return:** - ``text`` -- the linked text **Usage:** ...
python
def layer_description_extractor(layer, node_to_id): '''get layer description. ''' layer_input = layer.input layer_output = layer.output if layer_input is not None: if isinstance(layer_input, Iterable): layer_input = list(map(lambda x: node_to_id[x], layer_input)) else: ...
java
public final void mT__44() throws RecognitionException { try { int _type = T__44; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalXbaseWithAnnotations.g:42:7: ( 'val' ) // InternalXbaseWithAnnotations.g:42:9: 'val' { match("val"); ...
python
def set_options(self, **options): """ Set instance variables based on an options dict """ self.interactive = False self.verbosity = options['verbosity'] self.symlink = "" self.clear = False ignore_patterns = [] self.ignore_patterns = list(set(ignor...
python
def display(self): """ Displays an overview containing descriptive stats for the Series provided. """ print('Stats for %s from %s - %s' % (self.name, self.start, self.end)) if type(self.rf) is float: print('Annual risk-free rate considered: %s' % (fmtp(self.rf...
python
def build(args): """Build a target and its dependencies.""" if len(args) != 1: log.error('One target required.') app.quit(1) target = address.new(args[0]) log.info('Resolved target to: %s', target) try: bb = Butcher() bb.clean() bb.load_graph(target) ...
python
def _maketicks(self, ax, units='THz'): """Utility method to add tick marks to a band structure.""" # set y-ticks ax.yaxis.set_major_locator(MaxNLocator(6)) ax.yaxis.set_minor_locator(AutoMinorLocator(2)) ax.xaxis.set_minor_locator(AutoMinorLocator(2)) # set x-ticks; only...
python
def get_uri_parts(self, value): """takes an value and returns a tuple of the parts args: value: a uri in any form pyuri, ttl or full IRI """ if value.startswith('pyuri_'): value = self.rpyhttp(value) parts = self.parse_uri(value) try: ...
java
@Override public void execute() throws MojoExecutionException, MojoFailureException { super.execute(); // scan classes and build graph try { processClasspaths(); } catch (Exception e) { throw new MojoExecutionException("Error processing entity classes", e); ...
java
public void learn(double[][] x, int[] y) { int n = x.length; int[] index = Math.permutate(n); for (int i = 0; i < n; i++) { learn(x[index[i]], y[index[i]]); } }
java
public static final PluginCoordinates fromPolicySpec(String pluginPolicySpec) { if (pluginPolicySpec == null) { return null; } int startIdx = 7; int endIdx = pluginPolicySpec.indexOf('/'); String [] split = pluginPolicySpec.substring(startIdx, endIdx).split("...
python
def validate_arguments_type_of_function(param_type=None): """ Decorator to validate the <type> of arguments in the calling function are of the `param_type` class. if `param_type` is None, uses `param_type` as the class where it is used. Note: Use this decorator on the functions of the class. "...
python
def as_lwp_str(self, ignore_discard=True, ignore_expires=True): """Return cookies as a string of "\\n"-separated "Set-Cookie3" headers. ignore_discard and ignore_expires: see docstring for FileCookieJar.save """ now = time.time() r = [] for cookie in self: i...
java
public void configure( int width , int height , float vfov ) { declareVectors( width, height ); float r = (float)Math.tan(vfov/2.0f); for (int pixelY = 0; pixelY < height; pixelY++) { float z = 2*r*pixelY/(height-1) - r; for (int pixelX = 0; pixelX < width; pixelX++) { float theta = GrlConstants.F_PI2...
python
def static_url(path, absolute=False): """ Shorthand for returning a URL for the requested static file. Arguments: path -- the path to the file (relative to the static files directory) absolute -- whether the link should be absolute or relative """ if os.sep != '/': path = '/'.join(pat...
java
public LineString extractPart(double startDistance, double endDistance) { LineString result = new LineString(); for (int i = 0; i < this.segments.size(); startDistance -= this.segments.get(i).length(), endDistance -= this.segments.get(i).length(), i++) { LineSegment segment = this.segments....
java
@Override public void stage3SymbolVerification(final Document doc) throws SymbolWarning, IndexingFailure, ResourceDownloadError { final List<ResourceSyntaxWarning> exceptions = new ArrayList<ResourceSyntaxWarning>(); try { namespace.verify(doc); } ca...
python
async def block(self): """|coro| Blocks the user. .. note:: This only applies to non-bot accounts. Raises ------- Forbidden Not allowed to block this user. HTTPException Blocking the user failed. """ await s...
java
public void marshall(EsamSignalProcessingNotification esamSignalProcessingNotification, ProtocolMarshaller protocolMarshaller) { if (esamSignalProcessingNotification == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMar...
java
public byte[] getData(ChronosClientWatcher chronosClientWatcher, String znode) throws IOException { byte[] data = null; for (int i = 0; i <= connectRetryTimes; i++) { try { data = chronosClientWatcher.getZooKeeper().getData(znode, null, null); break; } catch (Exception e) { ...
python
def to_dict(mapreduce_yaml): """Converts a MapReduceYaml file into a JSON-encodable dictionary. For use in user-visible UI and internal methods for interfacing with user code (like param validation). as a list Args: mapreduce_yaml: The Pyton representation of the mapreduce.yaml document. Re...
python
def _svd_step(self, X, shrinkage_value, max_rank=None): """ Returns reconstructed X from low-rank thresholded SVD and the rank achieved. """ if max_rank: # if we have a max rank then perform the faster randomized SVD (U, s, V) = randomized_svd( ...
python
def rc_channels_scaled_encode(self, time_boot_ms, port, chan1_scaled, chan2_scaled, chan3_scaled, chan4_scaled, chan5_scaled, chan6_scaled, chan7_scaled, chan8_scaled, rssi): ''' The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels...
java
public String cleanAllXPackIndices() throws ElasticSearchException{ StringBuilder ret = new StringBuilder(); for(String monitor:monitorIndices) { try { ret.append(this.client.executeHttp(java.net.URLEncoder.encode(monitor, "UTF-8") + "?pretty", HTTP_DELETE)).append("\n"); } catch (Exception e){ ...
java
@Override public Predicate ge(Expression<? extends Number> arg0, Number arg1) { // TODO Auto-generated method stub return new ComparisonPredicate(arg0, arg1, ConditionalOperator.GTE); }
python
def addTextErr(self, text): """add red text""" self._currentColor = self._red self.addText(text)
java
public void setParts(java.util.Collection<PartListElement> parts) { if (parts == null) { this.parts = null; return; } this.parts = new java.util.ArrayList<PartListElement>(parts); }
java
public ChannelFuture bindAsync() { SocketAddress localAddress = (SocketAddress) getOption("localAddress"); if (localAddress == null) { throw new IllegalStateException("localAddress option is not set."); } return bindAsync(localAddress); }
python
def query(self, query_samples): """ Query docs with query_samples number of Gibbs sampling iterations. """ self.sampled_topics = np.zeros((self.samples, self.N), dtype=np.int) for s in range(self.samples): ...
java
private void updateEligibility() { checkState(Thread.holdsLock(root), "Must hold lock to update eligibility"); synchronized (root) { if (!parent.isPresent()) { return; } if (isEligibleToStartNext()) { parent.get().addOrUpdateSubGrou...
java
public void dumpRequest(final HttpServletRequest req) { try { Enumeration names = req.getHeaderNames(); String title = "Request headers"; debug(title); while (names.hasMoreElements()) { String key = (String)names.nextElement(); String val = req.getHeader(key); debu...
java
protected <T extends ExecutableRule<?>> Status getStatus(T executableRule, List<String> columnNames, List<Map<String, Object>> rows, AnalyzerContext context) throws RuleException { return context.verify(executableRule, columnNames, rows); }
python
def copy_directory_structure(destination_directory, relative_path): """Create all the intermediate directories required for relative_path to exist within destination_directory. This assumes that relative_path is a directory located within root_dir. Examples: destination_directory: /tmp/destination ...
java
public void addMessageSelectorFactory(MessageSelectorFactory<?> factory) { if (factory instanceof BeanFactoryAware) { ((BeanFactoryAware) factory).setBeanFactory(beanFactory); } this.factories.add(factory); }
java
public Observable<SubnetInner> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1<ServiceResponse<Su...
python
def _path_to_value(cls, path, parent_dict): """Return a value from a dictionary at the given path""" keys = cls._path_to_keys(path) # Traverse to the tip of the path child_dict = parent_dict for key in keys[:-1]: child_dict = child_dict.get(key) if child_...
python
def from_task(cls, task): """Create a new target representing a task and its parameters Args: task: Task instance to create target for; the task class has to inherit from :class:`ozelot.tasks.TaskBase`. Returns: ozelot.tasks.ORMTarget: a new target insta...
python
def delete(self, **kwargs): """ Used for deleting objects from the facebook graph. Just pass the id of the object to be deleted. But in case of like, have to pass the cat ("likes") and object id as a like has no id itself in the facebook graph ...
python
def parse_list(text, off=0, trim=True): ''' Parse a list (likely for comp type) coming from a command line input. The string elements within the list may optionally be quoted. ''' if not nextchar(text, off, '('): raise s_exc.BadSyntax(at=off, mesg='expected open paren for list') off +...
java
public static String digitToChinese(Number n) { if(null == n) { return "零"; } return NumberChineseFormater.format(n.doubleValue(), true, true); }
java
public HttpAuthServiceBuilder add(Iterable<? extends Authorizer<HttpRequest>> authorizers) { requireNonNull(authorizers, "authorizers"); authorizers.forEach(a -> { requireNonNull(a, "authorizers contains null."); add(a); }); return this; }
java
@SuppressWarnings("unused") public SwipeActionAdapter setDimBackgrounds(boolean dimBackgrounds){ this.mDimBackgrounds = dimBackgrounds; if(mListView != null) mTouchListener.setDimBackgrounds(dimBackgrounds); return this; }
java
protected void sendConfigureRequest(MemberState member, ConfigureRequest request) { logger.debug("{} - Configuring {}", context.getCluster().member().address(), member.getMember().address()); // Start the configure to the member. member.startConfigure(); context.getConnections().getConnection(member.g...
python
def set_settings(self, releases=None, default_release=None): """set path to storage""" if (self._storage is None or getattr(self, 'releases', {}) != releases or getattr(self, 'default_release', '') != default_release): self._storage = {} self.relea...
java
public void init(){ try { zk = new ZooKeeper(parent.getProperties().get(TeknekDaemon.ZK_SERVER_LIST).toString(), 30000, this); } catch (IOException e1) { throw new RuntimeException(e1); } Feed feed = DriverFactory.buildFeed(plan.getFeedDesc()); List<WorkerStatus> workerStatus; try { ...
java
public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings, EventListener[] events ) throws IOException, DocumentException { if(!this.open) { throw new DocumentException("The document must be open to import RTF fragments."); } RtfParser rtfImport = new RtfParse...
java
public String getStateName() { CmsResourceState state = m_resource.getState(); String name; if (m_request == null) { name = org.opencms.workplace.explorer.Messages.get().getBundle().key( org.opencms.workplace.explorer.Messages.getStateKey(state)); } else { ...
python
def make_serviceitem_servicedllsignatureexists(dll_sig_exists, condition='is', negate=False): """ Create a node for ServiceItem/serviceDLLSignatureExists :return: A IndicatorItem represented as an Element node """ document = 'ServiceItem' search = 'ServiceItem/serviceDLLSignatureExists' ...
java
public final void setToken(AnalyzedTokenReadings[] tokens, int index, int next) { int idx = index; if (index >= tokens.length) { // TODO: hacky workaround, find a proper solution. See EnglishPatternRuleTest.testBug() idx = tokens.length - 1; } setToken(tokens[idx]); IncludeRange includeS...
python
def get_node_by_name(graph, name): """Return a node ID given its name.""" for id, attrs in graph.nodes(data=True): if attrs['n'] == name: return id
java
public int getStateId(LR1ItemSet targetSet) throws GrammarException { for (int stateId = 0; stateId < itemSetCollection.size(); stateId++) { LR1ItemSet lr1ItemSet = itemSetCollection.get(stateId); if (lr1ItemSet.equals(targetSet)) { return stateId; } } throw new GrammarException("Target set '" + tar...
java
@Override public CreatePullRequestResult createPullRequest(CreatePullRequestRequest request) { request = beforeClientExecution(request); return executeCreatePullRequest(request); }
java
public EClass getIfcFlowMovingDevice() { if (ifcFlowMovingDeviceEClass == null) { ifcFlowMovingDeviceEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(246); } return ifcFlowMovingDeviceEClass; }
python
def eratosthene(n): """Prime numbers by sieve of Eratosthene :param n: positive integer :assumes: n > 2 :returns: list of prime numbers <n :complexity: O(n loglog n) """ P = [True] * n answ = [2] for i in range(3, n, 2): if P[i]: answ.append(i) for j ...
java
public String getSharedFileEndpoint(Object projectIdOrKey, Object sharedFileId) throws BacklogException { return buildEndpoint("projects/" + projectIdOrKey + "/files/" + sharedFileId); }
java
synchronized void renewSession(String prevSessionToken) throws SFException, SnowflakeSQLException { if (sessionToken != null && !sessionToken.equals(prevSessionToken)) { logger.debug("not renew session because session token has not been updated."); return; } SessionUtil.LoginInp...
java
@Nullable public static String getSessionID (@Nonnull final String sValue) { ValueEnforcer.notNull (sValue, "Value"); // Get the session ID parameter final int nIndex = sValue.indexOf (';'); return nIndex == -1 ? null : sValue.substring (nIndex + 1); }
python
def state(self, state): """Set enum metric state.""" with self._lock: self._value = self._states.index(state)
python
def _ItemsToUrns(self, items): """Converts collection items to aff4 urns suitable for downloading.""" for item in items: try: yield flow_export.CollectionItemToAff4Path(item, self.client_id) except flow_export.ItemNotExportableError: pass