language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public com.google.api.ads.adwords.axis.v201809.o.StatsEstimate getMinEstimate() { return minEstimate; }
java
public <T extends BaseProxy> T editProxy(final T object) { AutoBean<T> bean = this.checkStreamsNotCrossed(object); this.checkLocked(); @SuppressWarnings("unchecked") final AutoBean<T> previouslySeen = (AutoBean<T>) this.state.editedProxies.get(BaseProxyCategory.stableId(bean)); if (previous...
python
def parse_field(setting, field_name, default): """ Extract result from single-value or dict-type setting like fallback_values. """ if isinstance(setting, dict): return setting.get(field_name, default) else: return setting
python
def unknown_command(self, args): '''handle mode switch by mode name as command''' mode_mapping = self.master.mode_mapping() mode = args[0].upper() if mode in mode_mapping: self.master.set_mode(mode_mapping[mode]) return True return False
java
static Configuration read(File f) throws FileNotFoundException, IOException { try (ObjectInputStream is = new ObjectInputStream(new FileInputStream(f))) { return (Configuration)is.readObject(); } catch (ClassNotFoundException e) { throw new IOException("Failed to deserialize.", e); } }
python
def _concat_bgzip_fastq(finputs, out_dir, read, ldetail): """Concatenate multiple input fastq files, preparing a bgzipped output file. """ out_file = os.path.join(out_dir, "%s_%s.fastq.gz" % (ldetail["name"], read)) if not utils.file_exists(out_file): with file_transaction(out_file) as tx_out_fi...
java
public static <T> T readUrlAsObject(String url, Class<T> type) { String contents = getUrlContents(url); ObjectMapper mapper = new ObjectMapper(); mapper.enableDefaultTyping(); try { return mapper.readValue(contents, type); } catch (IOException e) { JK.throww(e); return null; } }
java
@Override public String getNameInNamespace() { if(base.size() == 0) { return dn.toString(); } try { LdapName result = (LdapName) dn.clone(); result.addAll(0, base); return result.toString(); } catch (InvalidNameException e) { ...
java
public void pushTransform() { predraw(); FloatBuffer buffer; if (stackIndex >= stack.size()) { buffer = BufferUtils.createFloatBuffer(18); stack.add(buffer); } else { buffer = (FloatBuffer) stack.get(stackIndex); } GL.glGetFloat(SGL.GL_MODELVIEW_MATRIX, buffer); buffer.put(16, s...
python
def in_same_dir(as_file, target_file): """Return an absolute path to a target file that is located in the same directory as as_file Args: as_file: File name (including __file__) Use the directory path of this file target_file: Name of the target file """ return os.path.abspa...
java
public void log(LogLevel level, Throwable throwable, String message, Object... arguments) { // this is copied from log(LogEntry) to prevent unnecessary object creation if (level.compareTo(this.level) < 0) { return; } this.log(new LogEntry(level, throwable, messag...
python
def recent(self, check_language=True, language=None, limit=3, exclude=None, kwargs=None, category=None): """ Returns recently published new entries. """ if category: if not kwargs: kwargs = {} kwargs['categories__in'] = [category] ...
python
def bind(cls, target): """Bind a copy of the collection to the class, modified per our class' settings. The given target (and eventual collection returned) must be safe within the context the document sublcass being bound is constructed within. E.g. at the module scope this binding must be thread-safe. """ ...
java
static WritableRaster createRaster(int pWidth, int pHeight, Object pPixels, ColorModel pColorModel) { // NOTE: This is optimized code for most common cases. // We create a DataBuffer from the pixel array directly, // and creating a raster based on the DataBuffer and ColorModel. // Cr...
java
private void createButtons() { addDialogClose(new Command() { public void execute() { cancelUpload(); } }); CmsPushButton cancelButton = new CmsPushButton(); cancelButton.setTitle(org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client...
python
def check_call_out(command): """ Run the given command (with shell=False) and return the output as a string. Strip the output of enclosing whitespace. If the return code is non-zero, throw GitInvocationError. """ # start external command process p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr...
python
def _enumerator(opener, entry_cls, format_code=None, filter_code=None): """Return an archive enumerator from a user-defined source, using a user- defined entry type. """ archive_res = _archive_read_new() try: r = _set_read_context(archive_res, format_code, filter_code) opener(archi...
python
def layer2dict(layer): """ Return a json representation for a layer. """ category = None username = None # bbox must be valid before proceeding if not layer.has_valid_bbox(): message = 'Layer id: %s has a not valid bbox' % layer.id return None, message # we can proceed...
python
def parse(readDataInstance, netMetaDataStreams): """ Returns a new L{NetMetaDataTables} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataTables} object. @rtype: L{NetMetaDataTables...
python
def _extract_line(args): """Implements the BigQuery extract magic used to extract table data to GCS. The supported syntax is: %bigquery extract -S|--source <table> -D|--destination <url> <other_args> Args: args: the arguments following '%bigquery extract'. Returns: A message about whether the...
java
public boolean isIdentical( Polynomial p , double tol ) { int m = Math.max(p.size(), size()); // make sure trailing coefficients are close to zero for( int i = p.size; i < m; i++ ) { if( Math.abs(c[i]) > tol ) { return false; } } for( int i = size; i < m; i++ ) { if( Math.abs(p.c[i]) > tol ) { ...
java
protected String getLockErrorMessage(CmsLockInfo lockInfo) { switch (lockInfo.getState()) { case changed: return Messages.get().key(Messages.ERR_LOCK_RESOURCE_CHANGED_BY_1, lockInfo.getUser()); case locked: return Messages.get().key(Messages.ERR_LOCK_RESO...
java
private void ensureArrowFunctionsHaveBlockBodies(NodeTraversal t, Node function) { Node body = function.getLastChild(); if (!body.isBlock()) { body.detach(); Node replacement = IR.block(IR.returnNode(body)).useSourceInfoIfMissingFromForTree(body); function.addChildToBack(replacement); t....
java
private void createHuffmanDecodingTables(final int alphaSize, final int nGroups) { final Data dataShadow = this.data; final char[][] len = dataShadow.temp_charArray2d; final int[] minLens = dataShadow.minLens; final int[][] limit = dataShadow.limit; final int[][] base = dataShadow.base; fi...
python
def convert_old_commands(commands, annotate=True): """Converts old-style package commands into equivalent Rex code.""" from rez.config import config from rez.utils.logging_ import print_debug def _repl(s): return s.replace('\\"', '"') def _encode(s): # this replaces all occurrances...
java
public Vector4f fma(Vector4fc a, Vector4fc b, Vector4f dest) { dest.x = x + a.x() * b.x(); dest.y = y + a.y() * b.y(); dest.z = z + a.z() * b.z(); dest.w = w + a.w() * b.w(); return dest; }
java
public java.util.List<ValidationWarning> getValidationWarnings() { if (validationWarnings == null) { validationWarnings = new com.amazonaws.internal.SdkInternalList<ValidationWarning>(); } return validationWarnings; }
python
def setForeground(self, color): """ Sets the foreground color for this group item to the inputed color. :param color | <QtGui.QColor> """ btn = self.widget() if btn: palette = btn.palette() palette.setColor(palette.WindowText...
java
public void deltaRecover(long time) { recoverCount.incrementAndGet(); if (time > 0) { recoverTotalTime.addAndGet(time); if (time > recoverMaxTime.get()) recoverMaxTime.set(time); } }
python
def get_asn_origin_whois(self, asn_registry='radb', asn=None, retry_count=3, server=None, port=43): """ The function for retrieving CIDR info for an ASN via whois. Args: asn_registry (:obj:`str`): The source to run the query against (asn....
python
def get_generator(): """ construct and return generator """ g_net = gluon.nn.Sequential() with g_net.name_scope(): g_net.add(gluon.nn.Conv2DTranspose( channels=512, kernel_size=4, strides=1, padding=0, use_bias=False)) g_net.add(gluon.nn.BatchNorm()) g_net.add(gluon.nn.L...
python
def open_doc(self, doc_id): '''Imitated fetching the document from the database. Doesnt implement options from paisley to get the old revision or get the list of revision. ''' d = defer.Deferred() self.increase_stat('open_doc') try: doc = self._get_doc...
java
public static EventResult extractDateFromVerbatimER(String verbatimEventDate, int yearsBeforeSuspect, Boolean assumemmddyyyy) { EventResult result = new EventResult(); String resultDate = null; // Remove some common no data comments if (verbatimEventDate!=null && verbatimEventDate.contains("[no date]")) { ...
java
public static File searchForGroovyScriptFile(String input) { String scriptFileName = input.trim(); File scriptFile = new File(scriptFileName); // TODO: Shouldn't these extensions be kept elsewhere? What about CompilerConfiguration? // This method probably shouldn't be in GroovyMain eith...
java
@Deprecated public static RequestAsyncTask executeStatusUpdateRequestAsync(Session session, String message, Callback callback) { return newStatusUpdateRequest(session, message, callback).executeAsync(); }
python
def _merge_layout(x: go.Layout, y: go.Layout) -> go.Layout: """Merge attributes from two layouts.""" xjson = x.to_plotly_json() yjson = y.to_plotly_json() if 'shapes' in yjson and 'shapes' in xjson: xjson['shapes'] += yjson['shapes'] yjson.update(xjson) return go.Layout(yjson)
java
public static ConfigBuilder configBuilder() { return new ConfigBuilder(new StringReader(""), new StringWriter(), EMPTY_CONNECTION_FACTORY, EMPTY_COMMAND_HANDLER, EMPTY_PROPERTY_HANDLER, EMPTY_ENV, DEFAULT_MAX_STACK_LENGTH); }
java
private int findMaxRowLength(char maze[][]){ int max = 0; for (int row = 0; row < maze.length; row++) { if (maze[row].length > max) max = maze[row].length; } return max; }
python
def cancel_job_button(self, description=None): """Display a button that will cancel the submitted job. Used in a Jupyter IPython notebook to provide an interactive mechanism to cancel a job submitted from the notebook. Once clicked the button is disabled unless the cancel fails. ...
python
def ParseExcelXMLFile(filename): """parse an excel file typical usage: import exceldump; xl = exceldump.ParseExcelXMLFile("SomeExcelFile.xml") worksheet = xl.GetWorksheets(0) # get first worksheet print worksheet.GetCellVa...
python
def preview(self, stream=sys.stdout): """A quick preview of docpie. Print all the parsed object""" write = stream.write write(('[Quick preview of Docpie %s]' % self._version).center(80, '=')) write('\n') write(' sections '.center(80, '-')) write('\n') write(se...
python
def recvx(source, string_p, *args): """ Receive a series of strings (until NULL) from multipart data. Each string is allocated and filled with string data; if there are not enough frames, unallocated strings are set to NULL. Returns -1 if the message could not be read, else returns the number of strings...
python
def update_state(self, name, state): """Update the state for a service. Args: name (string): The name of the service state (int): The new state of the service """ self._loop.run_coroutine(self._client.update_state(name, state))
python
def config(data_folder=settings.data_folder, logs_folder=settings.logs_folder, imgs_folder=settings.imgs_folder, cache_folder=settings.cache_folder, use_cache=settings.use_cache, log_file=settings.log_file, log_console=settings.log_console, lo...
java
public <T extends Enum<T>> T lookupEnum(Class<T> type, String name) { if (type == null) { throw new IllegalArgumentException("type must not be null"); } if (name == null) { throw new IllegalArgumentException("name must not be null"); } Map<String, Enum<?>>...
python
def __add_token_tiers(self, docgraph, body): """ adds all tiers that annotate single tokens (e.g. token string, lemma, POS tag) to the etree representation of the Exmaralda XML file. Parameters ---------- docgraph : DiscourseDocumentGraph the document graph t...
python
def _get_all_file_version_ids(self, secure_data_path, limit=None): """ Convenience function that returns a generator that will paginate over the file version ids secure_data_path -- full path to the file in the safety deposit box limit -- Default(100), limits how many records to be retur...
python
def to_text(sentence): """ Helper routine that converts a Sentence protobuf to a string from its tokens. """ text = "" for i, tok in enumerate(sentence.token): if i != 0: text += tok.before text += tok.word return text
java
@Override public void execute(HttpGet httpGet, FutureCallback<HttpResponse> futureCallback) { try { if (httpGet == null) { throw new RuntimeException("Cannot issue GET request with HttpGet object"); } log.info("Executing GET request to " + httpGet.getURI().toString()); thread = new GetThread(client,...
python
def CmykToCmy(c, m, y, k): '''Convert the color from CMYK coordinates to CMY. Parameters: :c: The Cyan component value [0...1] :m: The Magenta component value [0...1] :y: The Yellow component value [0...1] :k: The Black component value [0...1] Return...
java
public ProcessAdapter execute(File jarFile, String... args) { return execute(FileSystemUtils.WORKING_DIRECTORY, jarFile, args); }
java
public static Object instantiate(MetadataBase metadata) { try { return metadata.getConstructorMetadata().getConstructorMethodHandle().invoke(); } catch (Throwable t) { throw new EntityManagerException(t); } }
java
public long getLong(String key) { addToDefaults(key, null); String value = getRequired(key); return Long.parseLong(value); }
java
public TimeZoneGenericNames setFormatPattern(Pattern patType, String patStr) { if (isFrozen()) { throw new UnsupportedOperationException("Attempt to modify frozen object"); } // Changing pattern will invalidates cached names if (!_genericLocationNamesMap.isEmpty()) { ...
python
def _newLogEntry(self, entry): """This is called when a new log entry is created""" # add entry to purrer self.purrer.addLogEntry(entry) # add entry to listview if it is not an ignored entry # (ignored entries only carry information about DPs to be ignored) if not entry.i...
java
@Override public VirtualConnection sendRequestHeaders(InterChannelCallback callback, boolean bForce) throws MessageSentException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "sendRequestHeaders(async)"); } if (headersSent()) { thro...
java
public final void updateFilterMap(Map<String,Object> propFilter) { if (propFilter == null) propFilter = new HashMap<String,Object>(); // Then handleUpdateFilterMap can modify the filter propFilter = this.handleUpdateFilterMap(propFilter); // Update this object's local filter. ...
python
def _load_webgl_backend(ipython): """ Load the webgl backend for the IPython notebook""" from .. import app app_instance = app.use_app("ipynb_webgl") if app_instance.backend_name == "ipynb_webgl": ipython.write("Vispy IPython module has loaded successfully") else: # TODO: Improve t...
python
def filter_uuid_list(stmts_in, uuids, **kwargs): """Filter to Statements corresponding to given UUIDs Parameters ---------- stmts_in : list[indra.statements.Statement] A list of statements to filter. uuids : list[str] A list of UUIDs to filter for. save : Optional[str] T...
python
def songs_delete(self, songs): """Delete songs from library. Parameters: song (list): A list of song dicts. Returns: list: Successfully deleted song IDs. """ mutations = [mc_calls.TrackBatch.delete(song['id']) for song in songs] response = self._call( mc_calls.TrackBatch, mutations ) suc...
java
public void marshall(DeleteVoiceChannelRequest deleteVoiceChannelRequest, ProtocolMarshaller protocolMarshaller) { if (deleteVoiceChannelRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(dele...
java
@Override public ScheduleExpression getSchedule() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "getSchedule: " + this); // Determine if the calling bean is in a state that allows timer service // me...
java
public Date convertToDate(long millis, TimeZone tz) { // no adjustments for the inifity hack values if (millis <= PGStatement.DATE_NEGATIVE_INFINITY || millis >= PGStatement.DATE_POSITIVE_INFINITY) { return new Date(millis); } if (tz == null) { tz = getDefaultTz(); } if (isS...
python
def rownrs(self, key, upperkey={}, lowerincl=True, upperincl=True): """Get a sequence of row numbers containing the key(s). A single key can be given, but by giving argument `upperkey` as well a key range can be given (where upper key must be > lower). One can specify if the lower and u...
python
def get_name(default: str = 'no name set'): """ Get the currently-configured name of the machine """ try: with open('/etc/machine-info') as emi: contents = emi.read() except OSError: LOG.exception( "Couldn't read /etc/machine-info") contents = '' for line ...
python
def parse_json_date(value): """ Parses an ISO8601 formatted datetime from a string value """ if not value: return None return datetime.datetime.strptime(value, JSON_DATETIME_FORMAT).replace(tzinfo=pytz.UTC)
java
public static void injectMethod(JavacNode typeNode, JCMethodDecl method, List<Type> paramTypes, Type returnType) { JCClassDecl type = (JCClassDecl) typeNode.get(); if (method.getName().contentEquals("<init>")) { //Scan for default constructor, and remove it. int idx = 0; for (JCTree def : type.defs) { ...
python
def maxlen(max_length, strict=False # type: bool ): """ 'Maximum length' validation_function generator. Returns a validation_function to check that len(x) <= max_length (strict=False, default) or len(x) < max_length (strict=True) :param max_length: maximum length for x :param...
java
public Object inquireByOid(Oid oid) throws GSSException { if (oid == null) { throw new GlobusGSSException(GSSException.FAILURE, GlobusGSSException.BAD_ARGUMENT, "nullOption"); } if (oid.equals(...
python
def _to_numpy(Z): """Converts a None, list, np.ndarray, or torch.Tensor to np.ndarray""" if isinstance(Z, list): return [Classifier._to_numpy(z) for z in Z] else: return Classifier._to_numpy(Z)
python
def get_service_packages(self): """Get all service packages""" api = self._get_api(billing.DefaultApi) package_response = api.get_service_packages() packages = [] for state in PACKAGE_STATES: # iterate states in order items = getattr(package_response, stat...
java
public boolean isAfter(T element) { if (element == null) { return false; } return comparator.compare(element, min) < 0; }
python
def script_template(state, host, template_filename, chdir=None, **data): ''' Generate, upload and execute a local script template on the remote host. + template_filename: local script template filename + chdir: directory to cd into before executing the script ''' temp_file = state.get_temp_fil...
python
def schemaNewParserCtxt(URL): """Create an XML Schemas parse context for that file/resource expected to contain an XML Schemas file. """ ret = libxml2mod.xmlSchemaNewParserCtxt(URL) if ret is None:raise parserError('xmlSchemaNewParserCtxt() failed') return SchemaParserCtxt(_obj=ret)
python
def _drawForeground(self, scene, painter, rect): """ Draws the backgroud for a particular scene within the charts. :param scene | <XChartScene> painter | <QPainter> rect | <QRectF> """ rect = scene.sceneRect() ...
java
public static vlan_nsip_binding[] get(nitro_service service, Long id) throws Exception{ vlan_nsip_binding obj = new vlan_nsip_binding(); obj.set_id(id); vlan_nsip_binding response[] = (vlan_nsip_binding[]) obj.get_resources(service); return response; }
java
public void setPRECSION(Integer newPRECSION) { Integer oldPRECSION = precsion; precsion = newPRECSION; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.TBM__PRECSION, oldPRECSION, precsion)); }
python
def _append_array(self, value, _file): """Call this function to write array contents. Keyword arguments: * value - dict, content to be dumped * _file - FileIO, output file """ _tabs = '\t' * self._tctr _labs = '{tabs}<array>\n'.format(tabs=_tabs) ...
python
def uninstall(hook_type='pre-commit'): """Uninstall the pre-commit hooks.""" hook_path, legacy_path = _hook_paths(hook_type) # If our file doesn't exist or it isn't ours, gtfo. if not os.path.exists(hook_path) or not is_our_script(hook_path): return 0 os.remove(hook_path) output.write_...
java
public Observable<Page<SubscriptionInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<SubscriptionInner>>, Page<SubscriptionInner>>() { @Override public Page<SubscriptionInner> c...
java
public static int numBytes(String val) { BigInteger bInt = new BigInteger(val); int bytes = 0; while (!bInt.equals(BigInteger.ZERO)) { bInt = bInt.shiftRight(8); ++bytes; } if (bytes == 0) ++bytes; return bytes; }
java
@SuppressWarnings("deprecation") public boolean upgrade() throws Exception { // We need to start a client so we can send requests to elasticsearch try { esClient.start(); } catch (Exception t) { logger.fatal("We can not start Elasticsearch Client. Exiting.", t); ...
python
def is_dtype_union_equal(source, target): """ Check whether two arrays have compatible dtypes to do a union. numpy types are checked with ``is_dtype_equal``. Extension types are checked separately. Parameters ---------- source : The first dtype to compare target : The second dtype to co...
python
def custom_observable_object_prefix_lax(instance): """Ensure custom observable objects follow naming style conventions. """ for key, obj in instance['objects'].items(): if ('type' in obj and obj['type'] not in enums.OBSERVABLE_TYPES and obj['type'] not in enums.OBSERVABLE_RESERVED_OB...
python
def append(self, item): """ Appending elements to our list """ validated_value = self.get_validated_object(item) if validated_value is not None: self.__modified_data__.append(validated_value)
java
public static String getPrefixedUser(String name) { StringBuffer result = new StringBuffer(name.length() + 10); result.append(I_CmsPrincipal.PRINCIPAL_USER); result.append('.'); result.append(name); return result.toString(); }
java
@BetaApi public final ListZoneOperationsPagedResponse listZoneOperations(String zone) { ListZoneOperationsHttpRequest request = ListZoneOperationsHttpRequest.newBuilder().setZone(zone).build(); return listZoneOperations(request); }
python
def set_font(font, section='appearance', option='font'): """Set font""" CONF.set(section, option+'/family', to_text_string(font.family())) CONF.set(section, option+'/size', float(font.pointSize())) CONF.set(section, option+'/italic', int(font.italic())) CONF.set(section, option+'/bold', int(font.bol...
python
def _export_work_errors(self, work, output_file): """Saves errors for given work pieces into file. Args: work: instance of either AttackWorkPieces or DefenseWorkPieces output_file: name of the output file """ errors = set() for v in itervalues(work.work): if v['is_completed'] and ...
java
private String getCommaSeperatedIndexes(Set<String> data) { Iterator<String> it = data.iterator(); String res = it.next(); if (data.size() == 1) { return res; } res += ", "; while (it.hasNext()) { res += it.next() + ", "; } res = r...
java
public static INDArray toTensor(List<List<List<Writable>>> records) { return TimeSeriesWritableUtils.convertWritablesSequence(records).getFirst(); }
python
def remove_value(self, name): """Remove a variable""" code = u"get_ipython().kernel.remove_value('%s')" % name if self._reading: self.kernel_client.input(u'!' + code) else: self.silent_execute(code)
java
public DbDatum[] get_class_property(String name, String[] propnames) throws DevFailed { return databaseDAO.get_class_property(this, name, propnames); }
java
public CmsJspInstanceDateBean getToInstanceDate() { if (m_instanceDate == null) { m_instanceDate = new CmsJspInstanceDateBean(getToDate(), m_cms.getRequestContext().getLocale()); } return m_instanceDate; }
java
public Object run(String scriptText, String fileName, List list) throws CompilationFailedException { String[] args = new String[list.size()]; list.toArray(args); return run(scriptText, fileName, args); }
java
static void sendFailedResponse(final ManagementRequestContext<RegistrationContext> context, final byte errorCode, final String message) throws IOException { final ManagementResponseHeader header = ManagementResponseHeader.create(context.getRequestHeader()); final FlushableDataOutput output = context.wri...
python
def get_colorscheme(self, scheme_file): """Return a string object with the colorscheme that is to be inserted.""" scheme = get_yaml_dict(scheme_file) scheme_slug = builder.slugify(scheme_file) builder.format_scheme(scheme, scheme_slug) try: temp_base, temp_su...
java
public alluxio.grpc.WorkerNetAddress getWorkerNetAddress() { return workerNetAddress_ == null ? alluxio.grpc.WorkerNetAddress.getDefaultInstance() : workerNetAddress_; }
java
protected boolean getBooleanSetting(String name, boolean defaultValue) { if (settings.containsKey(name)) { String value = settings.get(name).toString(); return Boolean.parseBoolean(value); } else { return defaultValue; } }
python
def get_tunnel_context(self, context_id, **kwargs): """Retrieves the network tunnel context instance. :param int context_id: The id-value representing the context instance. :return dict: Mapping of properties for the tunnel context. :raise SoftLayerAPIError: If a context cannot be found...