Can we do atlas operations?
172591
def is_atlas_enabled(blockstack_opts):
    
    if not blockstack_opts['atlas']:
        log.debug("Atlas is disabled")
        return False

    if 'zonefiles' not in blockstack_opts:
        log.debug("Atlas is disabled: no 'zonefiles' path set")
        return False

    if 'atlasdb_path' not in blockstack_opts:
        log.debug("Atlas is disabled: no 'atlasdb_path' path set")
        return False

    return True
836089
public void addOperations(final Map<MemcachedNode, Operation> ops) {
    for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) {
      addOperation(me.getKey(), me.getValue());
    }
  }
922036
private void addMapTask(TaskTracker taskTracker, List<Task> tasks, 
                              int maxMapSlots, int currentMapSlots)
                    throws IOException {
    if (maxMapSlots > currentMapSlots) {
      mapScheduler.updateCollectionOfQSIs();
      TaskLookupResult tlr = mapScheduler.assignTasks(taskTracker);
      if (TaskLookupResult.LookUpStatus.TASK_FOUND == tlr.getLookUpStatus()) {
        tasks.add(tlr.getTask());
      }
    }
  }
829420
def activation_atlas(
    model,
    layer,
    grid_size=10,
    icon_size=96,
    number_activations=NUMBER_OF_AVAILABLE_SAMPLES,
    icon_batch_size=32,
    verbose=False,
):
    """"""

    activations = layer.activations[:number_activations, ...]
    layout, = aligned_umap(activations, verbose=verbose)
    directions, coordinates, _ = bin_laid_out_activations(
        layout, activations, grid_size
    )
    icons = []
    for directions_batch in chunked(directions, icon_batch_size):
        icon_batch, losses = render_icons(
            directions_batch, model, layer=layer.name, size=icon_size, num_attempts=1
        )
        icons += icon_batch
    canvas = make_canvas(icons, coordinates, grid_size)

    return canvas
453293
public void setOperations(java.util.Collection<String> operations) {
        if (operations == null) {
            this.operations = null;
            return;
        }

        this.operations = new com.ibm.cloud.objectstorage.internal.SdkInternalList<String>(operations);
    }
1024850
def supported_operations(self):
        
        return tuple(op for op in backend.FILE_OPS if self._operations & op)
631905
public static boolean isHAEnabled(Configuration configuration) {
        boolean ret = false;

        if (configuration.containsKey(HAConfiguration.ATLAS_SERVER_HA_ENABLED_KEY)) {
            ret = configuration.getBoolean(ATLAS_SERVER_HA_ENABLED_KEY);
        } else {
            String[] ids = configuration.getStringArray(HAConfiguration.ATLAS_SERVER_IDS);

            ret = ids != null && ids.length > 1;
        }

        return ret;
    }
1019038
@Override
    public void put(IDataType type) throws AtlasException {

        assertValidType(type);
        types_.put(type.getName(), type);
    }
1350908
def get_parcellation(atlas, parcel_param):
    ""
    
    parc_path = os.path.join(atlas, 'parcellation_param{}.mgh'.format(parcel_param))
    parcel = nibabel.freesurfer.io.read_geometry(parc_path)
    
    return parcel
1162524
private Result doGetResources(Request request) throws InvalidQueryException, ResourceNotFoundException {
        AtlasQuery atlasQuery = queryFactory.createTaxonomyQuery(request);
        return new Result(atlasQuery.execute());
    }
663763
@POST
    @Consumes(Servlets.JSON_MEDIA_TYPE)
    @Produces(Servlets.JSON_MEDIA_TYPE)
    public AtlasRelationship create(AtlasRelationship relationship) throws AtlasBaseException {
        AtlasPerfTracer perf = null;

        try {
            if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
                perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "RelationshipREST.create(" + relationship + ")");
            }

            return relationshipStore.create(relationship);

        } finally {
            AtlasPerfTracer.log(perf);
        }
    }
373645
def reindex(cls, lastblock, firstblock=None, opts=None):
        
        if opts is None:
            opts = get_blockstack_opts()

        if not is_atlas_enabled(opts):
            raise Exception("Atlas is not enabled")

        if not is_subdomains_enabled(opts):
            raise Exception("Subdomain support is not enabled")

        subdomaindb_path = opts['subdomaindb_path']
        atlasdb_path = opts['atlasdb_path']
        
        if not os.path.exists(atlasdb_path):
            raise Exception("No Atlas database at {}".format(opts['atlasdb_path']))
        
        subdomain_indexer = SubdomainIndex(subdomaindb_path, blockstack_opts=opts)
        subdomain_indexer.subdomain_db.wipe()

        if firstblock is None:
            start_block = SUBDOMAINS_FIRST_BLOCK
        else:
            start_block = firstblock

        for i in range(start_block, lastblock, 100):
            log.debug("Processing all subdomains in blocks {}-{}...".format(i, i+99))
            subdomain_indexer.index_blockchain(i, i+100)

        log.debug("Finished indexing subdomains in blocks {}-{}".format(start_block, lastblock))
551456
def run(self, **kwargs):
        """"""
        if 'timestamp' not in kwargs:
            kwargs['timestamp'] = datetime.datetime.utcnow().isoformat()
        if 'version' not in kwargs:
            kwargs['version'] = "Not Defined" #bibcat.__version__
        # log.debug("kwargs: %s", pprint.pformat({k:v for k, v in kwargs.items()
        #                                         if k != "dataset"}))
        # log.debug("parents: %s", self.parents)
        for map_key, triple_map in self.triple_maps.items():
            if map_key not in self.parents:
                self.execute(triple_map, **kwargs)
1114211
def get_atlas_zonefile_data( zonefile_hash, zonefile_dir, check=True ):
    
    zonefile_path = atlas_zonefile_path(zonefile_dir, zonefile_hash)
    zonefile_path_legacy = atlas_zonefile_path_legacy(zonefile_dir, zonefile_hash)

    for zfp in [zonefile_path, zonefile_path_legacy]:

        if not os.path.exists( zfp ):
            continue

        if check:
            res = _read_atlas_zonefile(zfp, zonefile_hash)
        else:
            res = _read_atlas_zonefile(zfp, None)

        if res:
            return res

    return None
741525
def build_api_struct(self):
        
        data = super(AtlasChangeSource, self).build_api_struct()
        data.update({"action": self._action})
        return data
404340
def add_to_inventory(self):
        """"""
        self.stack.add_host(self.hostname, self.groups, self.hostvars)
208827
@Override
    protected final void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
        throw new UnsupportedOperationException();
    }