language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
@CheckReturnValue public MessageAction sendTo(MessageChannel channel) { Checks.notNull(channel, "Target Channel"); switch (channel.getType()) { case TEXT: final TextChannel text = (TextChannel) channel; final Member self = text.getGuild().getSe...
python
def format_index(data): """Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the second (time) column. Parameters ---------- data: Dataframe Must contain 'DATE (MM/DD/YYYY)' column, second column must be labeled with the timezone and contain t...
java
public void writeDeclaration(boolean standalone, String encoding) throws KNXMLException { try { w.write("<?xml version=" + quote + "1.0" + quote); w.write(" standalone=" + quote + (standalone ? "yes" : "no") + quote); if (encoding != null && encoding.length() > 0) w.write(" encoding=" + quote +...
python
def design_create(self, name, ddoc, use_devmode=True, syncwait=0): """ Store a design document :param string name: The name of the design :param ddoc: The actual contents of the design document :type ddoc: string or dict If ``ddoc`` is a string, it is passed, as-is,...
python
def get_cell_ngrams(mention, attrib="words", n_min=1, n_max=1, lower=True): """Get the ngrams that are in the Cell of the given mention, not including itself. Note that if a candidate is passed in, all of its Mentions will be searched. :param mention: The Mention whose Cell is being searched :param at...
java
protected String escapeAndQuote(String s) { String tmp; if (s == null) { return "\"\""; } tmp = s; tmp = tmp.replaceAll("\\\\", "\\\\\\\\"); tmp = tmp.replaceAll("\\\"", "\\\\\""); tmp = tmp.replaceAll("\\\n", ""); // filter newline ...
python
def build_attrs(self, *args, **kwargs): """Set select2's AJAX attributes.""" attrs = super(HeavySelect2Mixin, self).build_attrs(*args, **kwargs) # encrypt instance Id self.widget_id = signing.dumps(id(self)) attrs['data-field_id'] = self.widget_id attrs.setdefault('data...
python
def GetVolumeSystemTypeIndicators(cls, path_spec, resolver_context=None): """Determines if a file contains a supported volume system types. Args: path_spec (PathSpec): path specification. resolver_context (Optional[Context]): resolver context, where None represents the built-in context wh...
java
@Override public DeleteDeviceResult deleteDevice(DeleteDeviceRequest request) { request = beforeClientExecution(request); return executeDeleteDevice(request); }
python
def get_name(self, name, objid): ''' Paramters: name -- element tag objid -- ID type, unique id ''' if type(name) is tuple: return name ns = self.nspname n = name or self.pname or ('E' + objid) return ns,n
python
def get_links(self, **kw): """ Prepare links of form by mimicing pyoko's get_links method's result Args: **kw: Returns: list of link dicts """ links = [a for a in dir(self) if isinstance(getattr(self, a), Model) and not a.startswith('_mode...
python
def read_release_version(): """Read version information from VERSION file""" try: with open(VERSION_FILE, "r") as infile: version = str(infile.read().strip()) if len(version) == 0: version = None return version except IOError: return None
java
public void processJavadoc() { for (Options.OptionInfo oi : options.getOptions()) { ClassDoc optDoc = root.classNamed(oi.getDeclaringClass().getName()); if (optDoc != null) { String nameWithUnderscores = oi.longName.replace('-', '_'); for (FieldDoc fd : optDoc.fields()) { if (f...
python
def get_id_from_user(user): """Get an ID from a user, creates if necessary""" id = r_client.hget('user-id-map', user) if id is None: id = str(uuid4()) r_client.hset('user-id-map', user, id) r_client.hset('user-id-map', id, user) return id
java
@CheckReturnValue public AuditableRestAction<Void> removeRolesFromMember(Member member, Role... roles) { return modifyMemberRoles(member, Collections.emptyList(), Arrays.asList(roles)); }
java
public void marshall(ListTagsForResourceRequest listTagsForResourceRequest, ProtocolMarshaller protocolMarshaller) { if (listTagsForResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(l...
java
public void billingAccount_cancelTermination_POST(String billingAccount) throws IOException { String qPath = "/telephony/{billingAccount}/cancelTermination"; StringBuilder sb = path(qPath, billingAccount); exec(qPath, "POST", sb.toString(), null); }
java
public JsonWriter value(Object value) throws IOException { Preconditions.checkArgument(inArray() || writeStack.peek() == JsonTokenType.NAME, "Expecting an array or a name, but found " + writeStack.peek()); writeObject(value); popIf(JsonTokenType.NAME); return th...
python
def deprecated(message=DEPRECATION_MESSAGE, logger=None): """ This decorator will simply print warning before running decoratee. So, presumably, you want to use it with console-based commands. :return: Decorator for the function. """ if logger is None: logger = default_logger def _d...
java
@Override public CPOption removeByUUID_G(String uuid, long groupId) throws NoSuchCPOptionException { CPOption cpOption = findByUUID_G(uuid, groupId); return remove(cpOption); }
java
public void marshall(TagsModel tagsModel, ProtocolMarshaller protocolMarshaller) { if (tagsModel == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(tagsModel.getTags(), TAGS_BINDING); } catch ...
python
def _find_xinput(self): """Find most recent xinput library.""" for dll in XINPUT_DLL_NAMES: try: self.xinput = getattr(ctypes.windll, dll) except OSError: pass else: # We found an xinput driver self.xinpu...
python
def _update_atomtypes(unatomtyped_topology, res_name, prototype): """Update atomtypes in residues in a topology using a prototype topology. Atomtypes are updated when residues in each topology have matching names. Parameters ---------- unatomtyped_topology : openmm.app.Topology Topology la...
python
def mac(address='', interface='', vlan=0, **kwargs): # pylint: disable=unused-argument ''' Returns the MAC Address Table on the device. :param address: MAC address to filter on :param interface: Interface name to filter on :param vlan: VLAN identifier :return: A list of dictio...
java
public JsonElement getLowWatermark() { if (!contains(ConfigurationKeys.WATERMARK_INTERVAL_VALUE_KEY)) { return null; } return JSON_PARSER.parse(getProp(ConfigurationKeys.WATERMARK_INTERVAL_VALUE_KEY)).getAsJsonObject() .get(WatermarkInterval.LOW_WATERMARK_TO_JSON_KEY); }
java
@Override public ConfigSnippetResourceWritable parseFileToResource(File assetFile, File metadataFile, String contentUrl) throws RepositoryException { ArtifactMetadata artifactMetadata = explodeArtifact(assetFile, metadataFile); // Throw an exception if there is no metadata and properties, we get v...
python
def _create_buffers(self): """ Create a buffer for every step in the pipeline. """ self.buffers = {} for step in self.graph.nodes(): num_buffers = 1 if isinstance(step, Reduction): num_buffers = len(step.parents) self.buffer...
python
def _get_variants(data): """Retrieve variants from CWL and standard inputs for organizing variants. """ active_vs = [] if "variants" in data: variants = data["variants"] # CWL based list of variants if isinstance(variants, dict) and "samples" in variants: variants = v...
python
def assign_region_to_channels(channels, anat, parc_type='aparc', max_approx=3, exclude_regions=None): """Assign a brain region based on the channel location. Parameters ---------- channels : instance of wonambi.attr.chan.Channels channels to assign regions to a...
java
Container toEfficientContainer() { int sizeAsRunContainer = RunContainer.serializedSizeInBytes(this.nbrruns); int sizeAsBitmapContainer = BitmapContainer.serializedSizeInBytes(0); int card = this.getCardinality(); int sizeAsArrayContainer = ArrayContainer.serializedSizeInBytes(card); if (sizeAsRunCo...
java
@Nullable public static String [] getAllMatchingGroupValues (@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue) { final Matcher aMatcher = getMatcher (sRegEx, sValue); if (!aMatcher.find ()) { // Values does not match RegEx return null; } // groupCount is excluding t...
python
def gtype_to_python(gtype): """Map a gtype to the name of the Python type we use to represent it. """ fundamental = gobject_lib.g_type_fundamental(gtype) if gtype in GValue._gtype_to_python: return GValue._gtype_to_python[gtype] if fundamental in GValue._gtype_to_p...
python
def setup_ui(self, ): """Create the layouts and set some attributes of the ui :returns: None :rtype: None :raises: None """ grid = QtGui.QGridLayout(self) self.setLayout(grid) self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) ...
java
public synchronized final void shutdown() { if (!this.isClosed) { this.isClosed = true; // close writing and reading threads with best effort and log problems // --------------------------------- writer shutdown ---------------------------------- for (int i = 0; i < this.readers.length; i++) { ...
python
def _parse_queues(queues): """ Parse the given parameter and return a list of queues. The parameter must be a list/tuple of strings, or a string with queues separated by a comma. """ if not queues: raise ConfigurationException('The queue(s) to use are not defi...
python
def _persist_metadata(self): """ Write all script meta-data, including the persistent script Store. The Store instance might contain arbitrary user data, like function objects, OpenCL contexts, or whatever other non-serializable objects, both as keys or values. Try to serialize t...
python
def annual_event_counts_card(kind='all', current_year=None): """ Displays years and the number of events per year. kind is an Event kind (like 'cinema', 'gig', etc.) or 'all' (default). current_year is an optional date object representing the year we're already showing information about. ""...
java
@Override public X509Certificate getClientKeyCert(String sslConfigAlias) throws KeyStoreException, CertificateException, SSLException { JSSEHelper jsseHelper = JSSEHelper.getInstance(); Properties sslProps = jsseHelper.getProperties(sslConfigAlias); return getClientKeyCert(sslProps); }
java
public static <T> TextArea<T> newTextArea(final String id, final IModel<T> model) { final TextArea<T> textArea = new TextArea<>(id, model); textArea.setOutputMarkupId(true); return textArea; }
python
def delist(target): ''' for any "list" found, replace with a single entry if the list has exactly one entry ''' result = target if type(target) is dict: for key in target: target[key] = delist(target[key]) if type(target) is list: if len(target)==0: result = None ...
java
@SuppressWarnings("WeakerAccess") public ApiFuture<Void> deleteClusterAsync(String instanceId, String clusterId) { String name = NameUtil.formatClusterName(projectId, instanceId, clusterId); com.google.bigtable.admin.v2.DeleteClusterRequest request = com.google.bigtable.admin.v2.DeleteClusterRequest....
python
def correct_scanpy(adatas, **kwargs): """Batch correct a list of `scanpy.api.AnnData`. Parameters ---------- adatas : `list` of `scanpy.api.AnnData` Data sets to integrate and/or correct. kwargs : `dict` See documentation for the `correct()` method for a full list of paramet...
python
def diameter(self, H): r'''Calculates cooling tower diameter at a specified height, using the formulas for either hyperbola, depending on the height specified. .. math:: D = D_{throat}\frac{\sqrt{H^2 + b^2}}{b} The value of `H` and `b` used in the above ...
python
def requests_for_variant(self, request, variant_id=None): """Get all the requests for a single variant """ requests = ProductRequest.objects.filter(variant__id=variant_id) serializer = self.serializer_class(requests, many=True) return Response(data=serializer.data, status=status....
python
def new_fact(self): """Create a new Fact from this template.""" fact = lib.EnvCreateFact(self._env, self._tpl) if fact == ffi.NULL: raise CLIPSError(self._env) return new_fact(self._env, fact)
python
def get_relation_graph(self, depth=None): """ Get all `SampleRelation`s in the relation graph of the sample. :param depth: max depth of the returned graph. None retrieves the complete graph. :return: An iterator over the relations """ url = '{}relation_graph/'.format(sel...
java
public void onClickOk(@NonNull View view) { if (mListener == null) { return; } // Some invalid cases first /*if (MODE_NEW_FILE == mode && !isValidFileName(getNewFileName())) { mToast = Toast.makeText(getActivity(), R.string.nnf_need_valid_filename, ...
python
def show_router(self, router, **_params): """Fetches information of a certain router.""" return self.get(self.router_path % (router), params=_params)
python
def get_dimensions(js_dict, naming): """Get dimensions from input data. Args: js_dict (dict): dictionary containing dataset data and metadata. naming (string, optional): dimension naming. Possible values: 'label' \ or 'id'. Returns: dimensions (list): lis...
python
def reraise(error): """Re-raises the error that was processed by prepare_for_reraise earlier.""" if hasattr(error, "_type_"): six.reraise(type(error), error, error._traceback) raise error
python
def any_unique(keys, axis=semantics.axis_default): """returns true if any of the keys is unique""" index = as_index(keys, axis) return np.any(index.count == 1)
java
public void marshall(Action action, ProtocolMarshaller protocolMarshaller) { if (action == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(action.getActionType(), ACTIONTYPE_BINDING); prot...
java
public InputStream openFile(Path path) throws IOException { CompressionCodec codec=compressionCodecs.getCodec(path); FSDataInputStream fileIn=fs.open(path); // check if compressed if (codec==null) { // uncompressed LOG.debug("Reading from an uncompressed file \""+path+"\""); return fileIn; } else { // c...
python
def _create_matrix(self, document): """Create a stochastic matrix for TextRank. Element at row i and column j of the matrix corresponds to the similarity of sentence i and j, where the similarity is computed as the number of common words between them, divided by their sum of logarithm o...
python
def get_task_results(self): """ Get all the task results. :return: a dict which key is task name, and value is the task result as string :rtype: dict """ results = self.get_task_results_without_format() if options.tunnel.string_as_binary: return comp...
java
public static CertifiedPublicKey getCertificate(CertificateProvider provider, SignerInformation signer, CertificateFactory factory) { SignerId id = signer.getSID(); if (provider instanceof BcStoreX509CertificateProvider) { X509CertificateHolder cert = ((BcStoreX509CertificatePro...
python
def allStockQoutation(self): ''' 订阅多只股票的行情数据 :return: ''' logger = Logs().getNewLogger('allStockQoutation', QoutationAsynPush.dir) markets= [Market.HK,Market.US,Market.SH,Market.SZ] #,Market.HK_FUTURE,Market.US_OPTION stockTypes = [SecurityType.STOCK,SecurityType....
java
public static OriginIdElement addOriginId(Message message) { OriginIdElement originId = new OriginIdElement(); message.addExtension(originId); // TODO: Find solution to have both the originIds stanzaId and a nice to look at incremental stanzaID. // message.setStanzaId(originId.getId()); ...
python
def pdf_insert( dest: str, source: str, pages: [str] = None, index: int = None, output: str = None, ): """ Insert pages from one file into another. :param dest: Destination file :param source: Source file :param pages: list of page numbers to insert :param index: index in des...
python
def system_monitor_mail_fru_email_list_email(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") system_monitor_mail = ET.SubElement(config, "system-monitor-mail", xmlns="urn:brocade.com:mgmt:brocade-system-monitor") fru = ET.SubElement(system_monitor_mail, ...
python
def get_cloud_checksum( self, bucket: str, key: str ) -> str: """ Retrieves the cloud-provided checksum for a given object in a given bucket. :param bucket: the bucket the object resides in. :param key: the key of the object for which checksum is b...
python
def add_json(self, json_obj, **kwargs): """Adds a json-serializable Python dict as a json file to IPFS. .. code-block:: python >>> c.add_json({'one': 1, 'two': 2, 'three': 3}) 'QmVz9g7m5u3oHiNKHj2CJX1dbG1gtismRS3g9NaPBBLbob' Parameters ---------- json_o...
java
public Observable<UserInner> getPublishingUserAsync() { return getPublishingUserWithServiceResponseAsync().map(new Func1<ServiceResponse<UserInner>, UserInner>() { @Override public UserInner call(ServiceResponse<UserInner> response) { return response.body(); }...
java
public static String initCaps(String in) { return in.length() < 2 ? in.toUpperCase() : in.substring(0, 1).toUpperCase() + in.substring(1); }
java
@Override protected void doOptions(HttpServletRequest req, HttpServletResponse resp) { resp.addHeader("DAV", "1,2"); StringBuffer methodsAllowed = determineMethodsAllowed(getRelativePath(req)); resp.addHeader(HEADER_ALLOW, methodsAllowed.toString()); resp.addHeader("MS-Author-Via"...
python
def translate(conic, vector): """ Translates a conic by a vector """ # Translation matrix T = N.identity(len(conic)) T[:-1,-1] = -vector return conic.transform(T)
python
def getbit(self, name, offset): """ Returns a boolean indicating the value of ``offset`` in key :param name: str the name of the redis key :param offset: int :return: Future() """ with self.pipe as pipe: return pipe.getbit(self.redis_key(name), of...
java
public final void setStyle(String stylePrefix) { requireNonNull(stylePrefix); MODEL.finer(getName() + ": setting style to: " + style); //$NON-NLS-1$ styleProperty().set(stylePrefix); }
python
def fetch_top_tracks_of_artist(self, artist_id, terr=KKBOXTerritory.TAIWAN): ''' Fetcher top tracks belong to an artist by given ID. :param artist_id: the artist ID. :type artist_id: str :param terr: the current territory. :return: API response. :rtype: dict ...
python
def run_command(cmd): '''run_command uses subprocess to send a command to the terminal. :param cmd: the command to send, should be a list for subprocess ''' output = Popen(cmd,stderr=STDOUT,stdout=PIPE) t = output.communicate()[0],output.returncode output = {'message':t[0], 'return...
java
@Override public void decode(byte[] bytes, StringBuilder buffer) { if (bytes == null) { // append nothing return; } char[] table = CHAR_TABLE; for (int i = 0; i < bytes.length; i++) { int code = (int)bytes[i] & 0x000000ff; if (code == ...
java
@Override public void modifyAttributes(DirContextOperations ctx) { Name dn = ctx.getDn(); if (dn != null && ctx.isUpdateMode()) { modifyAttributes(dn, ctx.getModificationItems()); } else { throw new IllegalStateException("The DirContextOperations instance needs to be properly initialized."); } }
java
private void warnUserOfPossibleErrors(String newKey, Properties baseProperties) { for (String key : baseProperties.stringPropertyNames()) { if (!key.equals(newKey) && key.equalsIgnoreCase(newKey)) { LOGGER.warn("You have set a property called '{}' which is very similar to '{}'!", ...
java
public ServiceFuture<OperationStatus> deletePatternsAsync(UUID appId, String versionId, List<UUID> patternIds, final ServiceCallback<OperationStatus> serviceCallback) { return ServiceFuture.fromResponse(deletePatternsWithServiceResponseAsync(appId, versionId, patternIds), serviceCallback); }
java
void recycle(HttpConnection connection) { _method = null; //_uri=null; _host = null; _hostPort = null; _port = 0; _te = null; if (_parameters != null) _parameters.clear(); _paramsExtracted = false; _handled = false; _cookiesExtracted = ...
python
def iterate_rdatasets(self, rdtype=dns.rdatatype.ANY, covers=dns.rdatatype.NONE): """Return a generator which yields (name, rdataset) tuples for all rdatasets in the zone which have the specified I{rdtype} and I{covers}. If I{rdtype} is dns.rdatatype.ANY, the default, ...
java
protected void generateDefaultParameters(UseDefaultValues defValues){ int count = defValues.optParamIndex().length; NativeType[] nt = defValues.nativeType(); Variant.Type[] vt = defValues.variantType(); String[] literal = defValues.literal(); for (int i = 0; i < count; i++) { switc...
java
public IntervalCollection<T> intersect(IntervalCollection<T> other) { if (this.isEmpty() || other.isEmpty()) { List<ChronoInterval<T>> zero = Collections.emptyList(); return this.create(zero); } List<ChronoInterval<T>> list = new ArrayList<>(); for (ChronoInter...
java
public String getSchemaName(String name) { return name == null ? currentSchema.name : database.schemaManager.getSchemaName(name); }
python
def loadGmesh(filename, c="gold", alpha=1, wire=False, bc=None): """Reads a `gmesh` file format. Return an ``Actor(vtkActor)`` object.""" if not os.path.exists(filename): colors.printc("~noentry Error in loadGmesh: Cannot find", filename, c=1) return None f = open(filename, "r") lines =...
java
protected String getApiId(String orgId, String apiId, String version) { return ESUtils.escape(orgId + ":" + apiId + ":" + version); //$NON-NLS-1$ //$NON-NLS-2$ }
python
def distribute_batches(self, indices): """ Assigns batches to workers. Consecutive ranks are getting consecutive batches. :param indices: torch.tensor with batch indices """ assert len(indices) == self.num_samples indices = indices.view(-1, self.batch_size) ...
python
def return_env(self, exists=True): """ Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. """ env = dict( include=self._build_paths('include', [self.VCIncl...
java
public static String format(final Object object, final String pattern) { if (object instanceof Date) { return JKFormatUtil.formatDate((Date) object, pattern); } if (object instanceof Time) { return JKFormatUtil.formatTime((Time) object, pattern); } if (object instanceof Timestamp) { return JKFormatUt...
java
private boolean validBatchGetRequest(Map<Class<?>, List<KeyPair>> itemsToGet) { if (itemsToGet == null || itemsToGet.size() == 0) { return false; } for (Class<?> clazz : itemsToGet.keySet()) { if (itemsToGet.get(clazz) != null && itemsToGet.get(clazz).size() > 0) { ...
python
def castroData_from_pix_xy(self, xy, colwise=False): """ Build a CastroData object for a particular pixel """ ipix = self._tsmap.xy_pix_to_ipix(xy, colwise) return self.castroData_from_ipix(ipix)
python
def accuracy(self, X=None, y=None, mu=None): """ computes the accuracy of the LogisticGAM Parameters ---------- note: X or mu must be defined. defaults to mu X : array-like of shape (n_samples, m_features), optional (default=None) containing input data ...
python
def _traverse(summary, function, *args): """Traverse all objects of a summary and call function with each as a parameter. Using this function, the following objects will be traversed: - the summary - each row - each item of a row """ function(summary, *args) for row in summary: ...
java
private void nextSphere(List<TreeNode> sphereNodes) throws CDKException { spheres[sphere] = sphereNodes; if (spheresWithAtoms != null) spheresWithAtoms[sphere] = sphereNodesWithAtoms; /* * From here we start assembling the next sphere */ IAtom node = null; IAtom...
python
def release(ctx, sdist=True, wheel=True, sign=True, dry_run=False, index=None): """ Wraps invocations.packaging.publish to add baked-in docs folder. """ # Build docs first. Use terribad workaround pending invoke #146 ctx.run("inv docs", pty=True, hide=False) # Move the built docs into where Epyd...
python
def observe(self, key, master_only=False): """Return storage information for a key. It returns a :class:`.ValueResult` object with the ``value`` field set to a list of :class:`~.ObserveInfo` objects. Each element in the list responds to the storage status for the key on the give...
python
def list_folder(self, dir_name=None, prefix=None, num=1000, context=None): """列目录(https://www.qcloud.com/document/product/436/6062) :param dir_name:文件夹名称 :param prefix:前缀 :param num:查询的文件的数量,最大支持1000,默认查询数量为1000 :param context:翻页标志,将上次查询结果的context的字段传入,即可实现翻页的功能 :return ...
java
private void addInsideAFieldLayoutExamples() { add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect inside a WFieldLayout")); add(new ExplanatoryText("When a WCheckBoxSelect is inside a WField its label is exposed in a way which appears and behaves like a regular " + "HTML label. This allows WCheckBoxSelects to b...
python
def relation_id(relation_name=None, service_or_unit=None): """The relation ID for the current or a specified relation""" if not relation_name and not service_or_unit: return os.environ.get('JUJU_RELATION_ID', None) elif relation_name and service_or_unit: service_name = service_or_unit.split(...
java
@Override public boolean requeue(IQueueMessage<ID, DATA> _msg) { IQueueMessage<ID, DATA> msg = _msg.clone(); Date now = new Date(); msg.incNumRequeues().setQueueTimestamp(now); return isEphemeralDisabled() ? storeNew(msg) : storeOld(msg); }
java
Observable<ComapiResult<ConversationDetails>> doCreateConversation(@NonNull final String token, @NonNull final ConversationCreate request) { return wrapObservable(service.createConversation(AuthManager.addAuthPrefix(token), apiSpaceId, request) .map(mapToComapiResult()), log, "Creating conversat...
java
public ClassFileBuilder prepare() throws SupportException { // Add a property to the reference for each primary key in the master List<StorableProperty> masterPkProps = new ArrayList<StorableProperty> (mMasterStorableInfo.getPrimaryKeyProperties().values()); // Sort master pr...
python
def residual_norm(A, x, b): """Compute ||b - A*x||.""" return norm(np.ravel(b) - A*np.ravel(x))
java
public void setPathFormat(String pathFormat) throws ConfigException { _pathFormat = pathFormat; if (pathFormat.endsWith(".zip")) { throw new ConfigException(L.l(".zip extension to path-format is not supported.")); } }
java
public static CurrentAutoreplyInfo get_current_autoreply_info(String access_token) { HttpUriRequest httpUriRequest = RequestBuilder.post() .setUri(BASE_URI + "/cgi-bin/get_current_autoreply_info") .addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token)) .b...