Looks up volume, by ID or Name tag.
@param volumeIdOrName the EBS volume ID or Name tag
@return The volume ID of 1st matching volume found, null if no volume found
500532
private String lookupVolume(String volumeIdOrName) {

		String ret = null;
		if(! Utils.isEmptyOrWhitespaces(volumeIdOrName)) {
			// Lookup by volume ID
			DescribeVolumesRequest dvs = new DescribeVolumesRequest(Collections.singletonList(volumeIdOrName));
			DescribeVolumesResult dvsresult = null;

			try {
				dvsresult = this.ec2Api.describeVolumes(dvs);
			} catch(Exception e) {
				dvsresult = null;
			}

			// If not found, lookup by name
			if(dvsresult == null || dvsresult.getVolumes() == null || dvsresult.getVolumes().size() < 1) {
				dvs = new DescribeVolumesRequest().withFilters(new Filter().withName("tag:Name").withValues(volumeIdOrName));
				try {
					dvsresult = this.ec2Api.describeVolumes(dvs);
				} catch(Exception e) {
					dvsresult = null;
				}
			}

			if(dvsresult != null && dvsresult.getVolumes() != null && dvsresult.getVolumes().size() > 0)
				ret = dvsresult.getVolumes().get(0).getVolumeId();
		}

		return ret;
	}
690668
public E findById(ID id) {
        LOG.trace("Finding " + entityClass.getSimpleName() + " with ID " + id);
        return (E) getSession().get(entityClass, id);
    }
1200457
public String getClusterId(final String nodeId)
    {
        if (nodeId == null)
        {
            return null;
        }
        int dot = nodeId.lastIndexOf('.');
        return (dot > 0) ? nodeId.substring(0, dot) : nodeId;
    }
359386
public GetVolumeResponse getVolume(GetVolumeRequest request) {
        checkNotNull(request, "request should not be null.");
        checkStringNotEmpty(request.getVolumeId(), "request volumeId should not be empty.");
        InternalRequest internalRequest =
                this.createRequest(request, HttpMethodName.GET, VOLUME_PREFIX, request.getVolumeId());
        return invokeHttpClient(internalRequest, GetVolumeResponse.class);
    }
967654
public static DataSource getJndiDsWithLog(String jndiName) {
		try {
			return getJndiDs(jndiName);
		} catch (DbRuntimeException e) {
			log.error(e.getCause(), "Find JNDI datasource error!");
		}
		return null;
	}
607882
def GetVolumeByIndex(self, volume_index):
    
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    if volume_index < 0 or volume_index >= len(self._volume_identifiers):
      return None

    volume_identifier = self._volume_identifiers[volume_index]
    return self._volumes[volume_identifier]
609548
public IndexEntry findEntryByFileName(String fileName) {
    for (IndexEntry e: entries) {
      if (fileName.equals(e.fileName)) {
        return e;
      }
    }
    return null;
  }
983800
@Override
    public EntityDecl findEntity(String entName)
    {
        if (mPredefdGEs != null) {
            EntityDecl decl = mPredefdGEs.get(entName);
            if (decl != null) {
                return decl;
            }
        }
        return mGeneralEntities.get(entName);
    }
745612
def get_volume_by_name(self, name):
        
        for vol in self.conn.volumes:
            if vol.name == name:
                return vol
        raise KeyError("Volume with NAME " + name + " not found")
106537
@Override
	public SortedSet<String> getDomainNames(String name) {
		if ( name.length() < 4)
			throw new IllegalArgumentException("Can't interpret IDs that are shorter than 4 residues!");

		String url = String.format("%srepresentativeDomains?cluster=%s&structureId=%s",
				base, cutoff, name);
		return requestRepresentativeDomains(url);
	}
497482
func (c *Client) GetVolume(id string, name string) (Volume, error) {
	volume, err := c.api.GetVolume(id, name)
	if err != nil {
		return nil, err
	}
	return volume.Content, nil
}
265967
@Override
  public List<NameAssignment> lookup(final Iterable<Identifier> identifiers) {
    LOG.log(Level.FINE, "identifiers");
    final List<NameAssignment> nas = new ArrayList<>();
    for (final Identifier id : identifiers) {
      final InetSocketAddress addr = idToAddrMap.get(id);
      LOG.log(Level.FINEST, "id : {0} addr: {1}", new Object[]{id, addr});
      if (addr != null) {
        nas.add(new NameAssignmentTuple(id, addr));
      }
    }
    return nas;
  }
887876
def get_file_location(self, volume_id):
        
        url = ("http://{master_addr}:{master_port}/"
               "dir/lookup?volumeId={volume_id}").format(
            master_addr=self.master_addr,
            master_port=self.master_port,
            volume_id=volume_id)
        data = json.loads(self.conn.get_data(url))
        _file_location = random.choice(data['locations'])
        FileLocation = namedtuple('FileLocation', "public_url url")
        return FileLocation(_file_location['publicUrl'], _file_location['url'])
1357688
public Resourcepart getNickname() {
        final EntityFullJid myRoomJid = this.myRoomJid;
        if (myRoomJid == null) {
            return null;
        }
        return myRoomJid.getResourcepart();
    }
1063113
public ArrayList<OvhVolume> project_serviceName_volume_GET(String serviceName, String region) throws IOException {
		String qPath = "/cloud/project/{serviceName}/volume";
		StringBuilder sb = path(qPath, serviceName);
		query(sb, "region", region);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t11);
	}
609303
@Override
    public J2EEName getJ2EEName() throws CDIException {
        //TODO can we come up with a J2EEName for libraries as well as modules?
        J2EEName j2eeName = null;
        ModuleMetaData moduleMetaData = getModuleMetaData();
        if (moduleMetaData != null) {
            j2eeName = moduleMetaData.getJ2EEName();
        }
        return j2eeName;
    }
1285199
public java.util.List<VolumeStatusItem> getVolumeStatuses() {
        if (volumeStatuses == null) {
            volumeStatuses = new com.amazonaws.internal.SdkInternalList<VolumeStatusItem>();
        }
        return volumeStatuses;
    }