diff --git "a/data/corpora/code_docs/train_pos.jsonl" "b/data/corpora/code_docs/train_pos.jsonl" new file mode 100644--- /dev/null +++ "b/data/corpora/code_docs/train_pos.jsonl" @@ -0,0 +1,700 @@ +{"id": "code_docs_train_pos_0000", "text": "Method Missing in this implementation allows you to set any of the standard fields directly as you would the \"to\", \"subject\" etc. Those fields used most often (to, subject et al) are given their own method for ease of documentation and also to avoid the hook call to method missing. This will only catch the known fields listed in: Mail::Field::KNOWN_FIELDS as per RFC 2822, any ruby string or method name could pretty much be a field name, so we don't want to just catch ANYTHING sent to a message object and interpret it as a header. This method provides all three types of header call to set, read and explicitly set with the = operator Examples: mail.comments = 'These are some comments' mail.comments #=> 'These are some comments' mail.comments 'These are other comments' mail.comments #=> 'These are other comments' mail.date = 'Tue, 1 Jul 2003 10:52:37 +0200' mail.date.to_s #=> 'Tue, 1 Jul 2003 10:52:37 +0200' mail.date 'Tue, 1 Jul 2003 10:52:37 +0200' mail.date.to_s #=> 'Tue, 1 Jul 2003 10:52:37 +0200' mail.resent_msg_id = '<1234@resent_msg_id.lindsaar.net>' mail.resent_msg_id #=> '<1234@resent_msg_id.lindsaar.net>' mail.resent_msg_id '<4567@resent_msg_id.lindsaar.net>' mail.resent_msg_id #=> '<4567@resent_msg_id.lindsaar.net>'", "label": 1, "domain": "code", "token_count": 337, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0001", "text": "Update the actual simulation values based on the toy-value pairs. Usually, one does not need to call refresh explicitly. The \"magic\" methods __call__, __setattr__, and __delattr__ invoke it automatically, when required. Instantiate a 1-dimensional |SeasonalParameter| object: >>> from hydpy.core.parametertools import SeasonalParameter >>> class Par(SeasonalParameter): ... NDIM = 1 ... TYPE = float ... TIME = None >>> par = Par(None) >>> par.simulationstep = '1d' >>> par.shape = (None,) When a |SeasonalParameter| object does not contain any toy-value pairs yet, the method |SeasonalParameter.refresh| sets all actual simulation values to zero: >>> par.values = 1. >>> par.refresh() >>> par.values[0] 0.0 When there is only one toy-value pair, its values are relevant for all actual simulation values: >>> par.toy_1 = 2. # calls refresh automatically >>> par.values[0] 2.0 Method |SeasonalParameter.refresh| performs a linear interpolation for the central time points of each simulation time step. Hence, in the following example, the original values of the toy-value pairs do not show up: >>> par.toy_12_31 = 4. >>> from hydpy import round_ >>> round_(par.values[0]) 2.00274 >>> round_(par.values[-2]) 3.99726 >>> par.values[-1] 3.0 If one wants to preserve the original values in this example, one would have to set the corresponding toy instances in the middle of some simulation step intervals: >>> del par.toy_1 >>> del par.toy_12_31 >>> par.toy_1_1_12 = 2 >>> par.toy_12_31_12 = 4. >>> par.values[0] 2.0 >>> round_(par.values[1]) 2.005479 >>> round_(par.values[-2]) 3.994521 >>> par.values[-1] 4.0", "label": 1, "domain": "code", "token_count": 430, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0002", "text": "Function path: Network.continueInterceptedRequest Domain: Network Method name: continueInterceptedRequest WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'interceptionId' (type: InterceptionId) -> No description Optional arguments: 'errorReason' (type: ErrorReason) -> If set this causes the request to fail with the given reason. Passing Aborted for requests marked with isNavigationRequest also cancels the navigation. Must not be set in response to an authChallenge. 'rawResponse' (type: string) -> If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc... Must not be set in response to an authChallenge. 'url' (type: string) -> If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge. 'method' (type: string) -> If set this allows the request method to be overridden. Must not be set in response to an authChallenge. 'postData' (type: string) -> If set this allows postData to be set. Must not be set in response to an authChallenge. 'headers' (type: Headers) -> If set this allows the request headers to be changed. Must not be set in response to an authChallenge. 'authChallengeResponse' (type: AuthChallengeResponse) -> Response to a requestIntercepted with an authChallenge. Must not be set otherwise. No return value. Description: Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId.", "label": 1, "domain": "code", "token_count": 388, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0003", "text": "Prais conditional mobility measure. Parameters ---------- pmat : matrix (k, k), Markov probability transition matrix. Returns ------- pr : matrix (1, k), conditional mobility measures for each of the k classes. Notes ----- Prais' conditional mobility measure for a class is defined as: .. math:: pr_i = 1 - p_{i,i} Examples -------- >>> import numpy as np >>> import libpysal >>> from giddy.markov import Markov,prais >>> f = libpysal.io.open(libpysal.examples.get_path(\"usjoin.csv\")) >>> pci = np.array([f.by_col[str(y)] for y in range(1929,2010)]) >>> q5 = np.array([mc.Quantiles(y).yb for y in pci]).transpose() >>> m = Markov(q5) >>> m.transitions array([[729., 71., 1., 0., 0.], [ 72., 567., 80., 3., 0.], [ 0., 81., 631., 86., 2.], [ 0., 3., 86., 573., 56.], [ 0., 0., 1., 57., 741.]]) >>> m.p array([[0.91011236, 0.0886392 , 0.00124844, 0. , 0. ], [0.09972299, 0.78531856, 0.11080332, 0.00415512, 0. ], [0. , 0.10125 , 0.78875 , 0.1075 , 0.0025 ], [0. , 0.00417827, 0.11977716, 0.79805014, 0.07799443], [0. , 0. , 0.00125156, 0.07133917, 0.92740926]]) >>> prais(m.p) array([0.08988764, 0.21468144, 0.21125 , 0.20194986, 0.07259074])", "label": 1, "domain": "code", "token_count": 453, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0004", "text": "The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

CallBack Schemas

Review Completion CallBack Sample

{
\"ReviewId\": \"\",
\"ModifiedOn\": \"2016-10-11T22:36:32.9934851Z\",
\"ModifiedBy\": \"\",
\"CallBackType\": \"Review\",
\"ContentId\": \"\",
\"Metadata\": {
\"adultscore\": \"0.xxx\",
\"a\": \"False\",
\"racyscore\": \"0.xxx\",
\"r\": \"True\"
},
\"ReviewerResultTags\": {
\"a\": \"False\",
\"r\": \"True\"
}
}

. @param url_content_type [String] The content type. @param team_name [String] Your team name. @param create_review_body [Array] Body for create reviews API @param sub_team [String] SubTeam of your team, you want to assign the created review to. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0005", "text": "Create an authentication token. Note that the parameters specified below are not validated and passed directly to the Vault server. Depending on the version of Vault in operation, some of these options may not work, and newer options may be available that are not listed here. @example Creating a token Vault.auth_token.create #=> # @example Creating a token assigned to policies with a wrap TTL Vault.auth_token.create( policies: [\"myapp\"], wrap_ttl: 500, ) @param [Hash] options @option options [String] :id The ID of the client token - this can only be specified for root tokens @option options [Array] :policies List of policies to apply to the token @option options [Fixnum, String] :wrap_ttl The number of seconds or a golang-formatted timestamp like \"5s\" or \"10m\" for the TTL on the wrapped response @option options [Hash] :meta A map of metadata that is passed to audit backends @option options [Boolean] :no_parent Create a token without a parent - see also {#create_orphan} @option options [Boolean] :no_default_policy Create a token without the default policy attached @option options [Boolean] :renewable Set whether this token is renewable or not @option options [String] :display_name Name of the token @option options [Fixnum] :num_uses Maximum number of uses for the token @return [Secret]", "label": 1, "domain": "code", "token_count": 304, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0006", "text": "Applies multiple changes to the configuration at once. If the changed settings contain localization related settings like language or calendarType, then only a single localizationChanged event will be fired. As the framework has to inform all existing components, elements, models etc. about localization changes, using applySettings can significantly reduce the overhead for multiple changes, esp. when they occur after the UI has been created already. The mSettings can contain any property xyz for which a setter method setXYZ exists in the API of this class. Similarly, values for the {@link sap.ui.core.Configuration.FormatSettings format settings} API can be provided in a nested object with name formatSettings. @example Apply language, calendarType and several legacy format settings in one call sap.ui.getCore().getConfiguration().applySettings({ language: 'de', calendarType: sap.ui.core.CalendarType.Gregorian, formatSettings: { legacyDateFormat: '1', legacyTimeFormat: '1', legacyNumberFormat: '1' } }); @param {object} mSettings Configuration options to apply @returns {sap.ui.core.Configuration} Returns this to allow method chaining @public @since 1.38.6", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0007", "text": "Gets an Application-related events. The response is list of ApplicationEvent objects. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param start_time_utc [String] The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param end_time_utc [String] The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param events_types_filter [String] This is a comma separated string specifying the types of FabricEvents that should only be included in the response. @param exclude_analysis_events [Boolean] This param disables the retrieval of AnalysisEvents if true is passed. @param skip_correlation_lookup [Boolean] This param disables the search of CorrelatedEvents information if true is passed. otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets populated. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0008", "text": "Gets the value of the curveSegment property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the curveSegment property.

For example, to add a new item, do as follows:

 get_CurveSegment().add(newItem); 

Objects of the following type(s) are allowed in the list {@link JAXBElement }{@code <}{@link ArcByBulgeType }{@code >} {@link JAXBElement }{@code <}{@link ArcStringByBulgeType }{@code >} {@link JAXBElement }{@code <}{@link GeodesicType }{@code >} {@link JAXBElement }{@code <}{@link GeodesicStringType }{@code >} {@link JAXBElement }{@code <}{@link OffsetCurveType }{@code >} {@link JAXBElement }{@code <}{@link CircleByCenterPointType }{@code >} {@link JAXBElement }{@code <}{@link ArcByCenterPointType }{@code >} {@link JAXBElement }{@code <}{@link LineStringSegmentType }{@code >} {@link JAXBElement }{@code <}{@link BezierType }{@code >} {@link JAXBElement }{@code <}{@link BSplineType }{@code >} {@link JAXBElement }{@code <}{@link CircleType }{@code >} {@link JAXBElement }{@code <}{@link ArcType }{@code >} {@link JAXBElement }{@code <}{@link ArcStringType }{@code >} {@link JAXBElement }{@code <}{@link CubicSplineType }{@code >} {@link JAXBElement }{@code <}{@link ClothoidType }{@code >} {@link JAXBElement }{@code <}{@link AbstractCurveSegmentType }{@code >}", "label": 1, "domain": "code", "token_count": 415, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0009", "text": "

Perform a Java Properties Value level 1 (only basic set) escape operation on a Reader input, writing results to a Writer.

Level 1 means this method will only escape the Java Properties basic escape set:

  • The Single Escape Characters: \t (U+0009), \n (U+000A), \f (U+000C), \r (U+000D) and \\ (U+005C).
  • Two ranges of non-displayable, control characters (some of which are already part of the single escape characters list): U+0000 to U+001F and U+007F to U+009F.

This method calls {@link #escapePropertiesValue(Reader, Writer, PropertiesValueEscapeLevel)} with the following preconfigured values:

  • level: {@link PropertiesValueEscapeLevel#LEVEL_1_BASIC_ESCAPE_SET}

This method is thread-safe.

@param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 431, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0010", "text": "Replies if two coplanar triangles intersect. Triangles intersect even if they are connected by two of their edges.

Triangle/triangle intersection test routine, by Tomas Moller, 1997. See article \"A Fast Triangle-Triangle Intersection Test\", Journal of Graphics Tools, 2(2), 1997. @param v1x x coordinate of the first point of the first triangle. @param v1y y coordinate of the first point of the first triangle. @param v1z z coordinate of the first point of the first triangle. @param v2x x coordinate of the second point of the first triangle. @param v2y y coordinate of the second point of the first triangle. @param v2z z coordinate of the second point of the first triangle. @param v3x x coordinate of the third point of the first triangle. @param v3y y coordinate of the third point of the first triangle. @param v3z z coordinate of the third point of the first triangle. @param u1x x coordinate of the first point of the second triangle. @param u1y y coordinate of the first point of the second triangle. @param u1z z coordinate of the first point of the second triangle. @param u2x x coordinate of the second point of the second triangle. @param u2y y coordinate of the second point of the second triangle. @param u2z z coordinate of the second point of the second triangle. @param u3x x coordinate of the third point of the second triangle. @param u3y y coordinate of the third point of the second triangle. @param u3z z coordinate of the third point of the second triangle. @return true if the two triangles are intersecting.", "label": 1, "domain": "code", "token_count": 372, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0011", "text": "Gets an Application-related events. The response is list of ApplicationEvent objects. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param start_time_utc [String] The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param end_time_utc [String] The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param events_types_filter [String] This is a comma separated string specifying the types of FabricEvents that should only be included in the response. @param exclude_analysis_events [Boolean] This param disables the retrieval of AnalysisEvents if true is passed. @param skip_correlation_lookup [Boolean] This param disables the search of CorrelatedEvents information if true is passed. otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets populated. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 336, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0012", "text": "

Generates a stream by repeating the elements of the provided stream. The number of times an element is repeated is given by the repeating factor.

Example:

{@code Stream stream = Stream.of(\"a0\", \"a1\", \"a2\", \"a3\"); Stream repeatingStream = StreamsUtils.repeat(stream, 3); List collect = repeatingStream.collect(Collectors.toList()); // The collect list is [\"a0\", \"a0\", \"a0\", \"a1\", \"a1\", \"a1\", \"a2\", \"a2\", \"a2\", \"a3\", \"a3\", \"a3\"] }

If the provided stream is empty, then the returned stream is also empty.

The repeatingFactor should be greater of equals than 2. A repeating factor of 0 does not make sense. A repeating factor of 1 is in fact the identity operation. An IllegalArgumentException will be thrown if a non valid repeatingFactor is provided.

An IllegalArgumentException will be thrown if a non SIZED stream is provided. Believe me, trying to repeat an infinite stream is not a good idea.

The repeating of the provided stream should no lead to the producing of more than Long.MAX_VALUE. Weird effects will occur in that case.

A NullPointerException is thrown if the provided stream is null.

The returned stream is ORDERED.

@param stream The stream to be repeated. Will throw a NullPointerException if null. @param repeatingFactor The repeating factor, should be greater of equal than 2. @param The type of the elements of the provided stream. @return A repeating stream.", "label": 1, "domain": "code", "token_count": 420, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0013", "text": "Dalli::Client is the main class which developers will use to interact with the memcached server. Usage: Dalli::Client.new(['localhost:11211:10', 'cache-2.example.com:11211:5', '192.168.0.1:22122:5', '/var/run/memcached/socket'], :threadsafe => true, :failover => true, :expires_in => 300) servers is an Array of \"host:port:weight\" where weight allows you to distribute cache unevenly. Both weight and port are optional. If you pass in nil, Dalli will use the MEMCACHE_SERVERS environment variable or default to 'localhost:11211' if it is not present. Dalli also supports the ability to connect to Memcached on localhost through a UNIX socket. To use this functionality, use a full pathname (beginning with a slash character '/') in place of the \"host:port\" pair in the server configuration. Options: - :namespace - prepend each key with this value to provide simple namespacing. - :failover - if a server is down, look for and store values on another server in the ring. Default: true. - :threadsafe - ensure that only one thread is actively using a socket at a time. Default: true. - :expires_in - default TTL in seconds if you do not pass TTL as a parameter to an individual operation, defaults to 0 or forever - :compress - defaults to false, if true Dalli will compress values larger than 1024 bytes before sending them to memcached. - :serializer - defaults to Marshal - :compressor - defaults to zlib - :cache_nils - defaults to false, if true Dalli will not treat cached nil values as 'not found' for #fetch operations. The standard memcached instruction set Turn on quiet aka noreply support. All relevant operations within this block will be effectively pipelined as Dalli will use 'quiet' operations where possible. Currently supports the set, add, replace and delete operations.", "label": 1, "domain": "code", "token_count": 427, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0014", "text": "

Perform am URI query parameter (name or value) escape operation on a Reader input, writing results to a Writer.

The following are the only allowed chars in an URI query parameter (will not be escaped):

  • A-Z a-z 0-9
  • - . _ ~
  • ! $ ' ( ) * , ;
  • : @
  • / ?

All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

This method is thread-safe.

@param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0015", "text": "Calculates how well the fixations from a set of subjects on a set of images can be predicted with the fixations from another set of subjects on another set of images. The prediction is carried out by computing a fixation density map from fixations of predicting_subjects subjects on predicting_images images. Prediction accuracy is assessed by measures.prediction_scores. Parameters fm : fixmat instance category : int Category from which the fixations are taken. predicting_filenumbers : list List of filenumbers used for prediction, i.e. images where fixations for the prediction are taken from. predicting_subjects : list List of subjects whose fixations on images in predicting_filenumbers are used for the prediction. predicted_filenumnbers : list List of images from which the to be predicted fixations are taken. predicted_subjects : list List of subjects used for evaluation, i.e subjects whose fixations on images in predicted_filenumbers are taken for evaluation. controls : bool, optional If True (default), n_predict subjects are chosen from the fixmat. If False, 1000 fixations are randomly generated and used for testing. scale_factor : int, optional specifies the scaling of the fdm. Default is 1. Returns auc : area under the roc curve for sets of actuals and controls true_pos_rate : ndarray Rate of true positives for every given threshold value. All values appearing in actuals are taken as thresholds. Uses lower sum interpolation. false_pos_rate : ndarray See true_pos_rate but for false positives.", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0016", "text": "To create new web hook issue **POST** against */api/hooks-web/* as an authenticated user. You should specify list of event_types or event_groups. Example of a request: .. code-block:: http POST /api/hooks-web/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { \"event_types\": [\"resource_start_succeeded\"], \"event_groups\": [\"users\"], \"destination_url\": \"http://example.com/\" } When hook is activated, **POST** request is issued against destination URL with the following data: .. code-block:: javascript { \"timestamp\": \"2015-07-14T12:12:56.000000\", \"message\": \"Customer ABC LLC has been updated.\", \"type\": \"customer_update_succeeded\", \"context\": { \"user_native_name\": \"Walter Lebrowski\", \"customer_contact_details\": \"\", \"user_username\": \"Walter\", \"user_uuid\": \"1c3323fc4ae44120b57ec40dea1be6e6\", \"customer_uuid\": \"4633bbbb0b3a4b91bffc0e18f853de85\", \"ip_address\": \"8.8.8.8\", \"user_full_name\": \"Walter Lebrowski\", \"customer_abbreviation\": \"ABC LLC\", \"customer_name\": \"ABC LLC\" }, \"levelname\": \"INFO\" } Note that context depends on event type.", "label": 1, "domain": "code", "token_count": 326, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0017", "text": "Gets the health of a Service Fabric node, by using the specified health policy. Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body to override the health policies used to evaluate the health. If the node that you specify by name does not exist in the health store, this returns an error. @param node_name [String] The name of the node. @param events_health_state_filter [Integer] Allows filtering the collection of HealthEvent objects returned based on health state. The possible values for this parameter include integer value of one of the following health states. Only events that match the filter are returned. All events are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param cluster_health_policy [ClusterHealthPolicy] Describes the health policies used to evaluate the health of a cluster or node. If not present, the health evaluation uses the health policy from cluster manifest or the default health policy. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 486, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0018", "text": "/*public static boolean findRserve_HOME(String path) { Map env = System.getenv(); Properties prop = System.getProperties(); Rserve_HOME = path; if (Rserve_HOME == null || !(new File(Rserve_HOME).exists()) || !new File(Rserve_HOME).getName().equals(\"Rserve\")) { if (env.containsKey(Rserve_HOME_KEY)) { Rserve_HOME = env.get(Rserve_HOME_KEY); } if (Rserve_HOME == null || prop.containsKey(Rserve_HOME_KEY) || !(new File(Rserve_HOME).exists()) || !new File(Rserve_HOME).getName().equals(\"Rserve\")) { Rserve_HOME = prop.getProperty(Rserve_HOME_KEY); } if (Rserve_HOME == null || !(new File(Rserve_HOME).exists()) || !new File(Rserve_HOME).getName().equals(\"Rserve\")) { Rserve_HOME = null; String OS_NAME = prop.getProperty(\"os.name\"); String OS_ARCH = prop.getProperty(\"os.arch\"); if (OS_ARCH.equals(\"amd64\")) { OS_ARCH = \"x86_64\"; } if (OS_ARCH.endsWith(\"86\")) { OS_ARCH = \"x86\"; } if (OS_NAME.contains(\"Windows\")) { Rserve_HOME = \"lib\\\\Windows\\\\\" + OS_ARCH + \"\\\\Rserve\\\\\"; } else if (OS_NAME.equals(\"Mac OS X\")) { Rserve_HOME = \"lib/MacOSX/\" + OS_ARCH + \"/Rserve\"; } else if (OS_NAME.equals(\"Linux\")) { Rserve_HOME = \"lib/Linux/\" + OS_ARCH + \"/Rserve\"; } else { RLog.err.println(\"OS \" + OS_NAME + \"/\" + OS_ARCH + \" not supported for automated RServe finding.\"); } if (!new File(Rserve_HOME).exists()) { RLog.err.println(\"Unable to find Rserve in \" + Rserve_HOME); Rserve_HOME = null; } else { Rserve_HOME = new File(Rserve_HOME).getPath().replace(\"\\\\\", \"\\\\\\\\\"); } } } if (Rserve_HOME != null && new File(Rserve_HOME).exists()) { setRecursiveExecutable(new File(Rserve_HOME)); return true; } else { return false; } }", "label": 1, "domain": "code", "token_count": 448, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0019", "text": "Returns a new +ActiveSupport::TimeWithZone+ where one or more of the elements have been changed according to the +options+ parameter. The time options (:hour, :min, :sec, :usec, :nsec) reset cascadingly, so if only the hour is passed, then minute, sec, usec and nsec is set to 0. If the hour and minute is passed, then sec, usec and nsec is set to 0. The +options+ parameter takes a hash with any of these keys: :year, :month, :day, :hour, :min, :sec, :usec, :nsec, :offset, :zone. Pass either :usec or :nsec, not both. Similarly, pass either :zone or :offset, not both. t = Time.zone.now # => Fri, 14 Apr 2017 11:45:15 EST -05:00 t.change(year: 2020) # => Tue, 14 Apr 2020 11:45:15 EST -05:00 t.change(hour: 12) # => Fri, 14 Apr 2017 12:00:00 EST -05:00 t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00 EST -05:00 t.change(offset: \"-10:00\") # => Fri, 14 Apr 2017 11:45:15 HST -10:00 t.change(zone: \"Hawaii\") # => Fri, 14 Apr 2017 11:45:15 HST -10:00", "label": 1, "domain": "code", "token_count": 422, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0020", "text": "Create a tree The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out. @param [Hash] params @input params [String] :base_tree The SHA1 of the tree you want to update with new data @input params [Array[Hash]] :tree Required. Objects (of path, mode, type, and sha) specifying a tree structure The tree parameter takes the following keys: @input tree [String] :path The file referenced in the tree @input tree [String] :mode The file mode; one of 100644 for file (blob), 100755 for executable (blob), 040000 for subdirectory (tree), 160000 for submodule (commit), or 120000 for a blob that specifies the path of a symlink @input tree [String] :type Either blob, tree, or commit @input tree [String] :sha The SHA1 checksum ID of the object in the tree @input tree [String] :content The content you want this file to have - GitHub will write this blob out and use the SHA for this entry. Use either this or tree.sha @example github = Github.new github.git_data.trees.create 'user-name', 'repo-name', tree: [ { path: \"file.rb\", mode: \"100644\", type: \"blob\", sha: \"44b4fc6d56897b048c772eb4087f854f46256132\" }, ... ] @api public", "label": 1, "domain": "code", "token_count": 336, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0021", "text": "Lists report records by geography. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param filter [String] | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| country | select | | |
| region | select | | |
| zip | select | | |
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | |
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
@param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ReportCollection] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 378, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0022", "text": "Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxMultiplicity Defines invalid connections along with the error messages that they produce. To add or remove rules on a graph, you must add/remove instances of this class to . Example: (code) graph.multiplicities.push(new mxMultiplicity( true, 'rectangle', null, null, 0, 2, ['circle'], 'Only 2 targets allowed', 'Only circle targets allowed')); (end) Defines a rule where each rectangle must be connected to no more than 2 circles and no other types of targets are allowed. Constructor: mxMultiplicity Instantiate class mxMultiplicity in order to describe allowed connections in a graph. Not all constraints can be enforced while editing, some must be checked at validation time. The and are treated as resource keys in . Parameters: source - Boolean indicating if this rule applies to the source or target terminal. type - Type of the source or target terminal that this rule applies to. See for more information. attr - Optional attribute name to match the source or target terminal. value - Optional attribute value to match the source or target terminal. min - Minimum number of edges for this rule. Default is 1. max - Maximum number of edges for this rule. n means infinite. Default is n. validNeighbors - Array of types of the opposite terminal for which this rule applies. countError - Error to be displayed for invalid number of edges. typeError - Error to be displayed for invalid opposite terminals. validNeighborsAllowed - Optional boolean indicating if the array of opposite types should be valid or invalid.", "label": 1, "domain": "code", "token_count": 360, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0023", "text": "Constructs a placemark. @alias Placemark @constructor @augments Renderable @classdesc Represents a Placemark shape. A placemark displays an image, a label and a leader line connecting the placemark's geographic position to the ground. All three of these items are optional. By default, the leader line is not pickable. See [enableLeaderLinePicking]{@link Placemark#enableLeaderLinePicking}.

Placemarks may be drawn with either an image or as single-color square with a specified size. When the placemark attributes indicate a valid image, the placemark's image is drawn as a rectangle in the image's original dimensions, scaled by the image scale attribute. Otherwise, the placemark is drawn as a square with width and height equal to the value of the image scale attribute, in pixels, and color equal to the image color attribute.

By default, placemarks participate in decluttering with a [declutterGroupID]{@link Placemark#declutterGroup} of 2. Only placemark labels are decluttered relative to other placemark labels. The placemarks themselves are optionally scaled with eye distance to achieve decluttering of the placemark as a whole. See [eyeDistanceScaling]{@link Placemark#eyeDistanceScaling}. @param {Position} position The placemark's geographic position. @param {Boolean} eyeDistanceScaling Indicates whether the size of this placemark scales with eye distance. See [eyeDistanceScalingThreshold]{@link Placemark#eyeDistanceScalingThreshold} and [eyeDistanceScalingLabelThreshold]{@link Placemark#eyeDistanceScalingLabelThreshold}. @param {PlacemarkAttributes} attributes The attributes to associate with this placemark. May be null, in which case default attributes are associated. @throws {ArgumentError} If the specified position is null or undefined.", "label": 1, "domain": "code", "token_count": 382, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0024", "text": "Lists report records by subscription. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param filter [String] | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | |
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
@param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param orderby [String] OData order by query option. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 381, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0025", "text": "/* Copyright (C) 2007, 2008 Apple Inc. All rights reserved. Copyright (C) 2008, 2009 Anthony Ricaud Copyright (C) 2011 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0026", "text": "Lista os ambientes filtrados conforme parâmetros informados. Se os dois parâmetros têm o valor None então retorna todos os ambientes. Se o id_divisao é diferente de None então retorna os ambientes filtrados pelo valor de id_divisao. Se o id_divisao e id_ambiente_logico são diferentes de None então retorna os ambientes filtrados por id_divisao e id_ambiente_logico. :param id_divisao: Identificador da divisão de data center. :param id_ambiente_logico: Identificador do ambiente lógico. :return: Dicionário com a seguinte estrutura: :: {'ambiente': [{'id': < id_ambiente >, 'link': < link >, 'id_divisao': < id_divisao >, 'nome_divisao': < nome_divisao >, 'id_ambiente_logico': < id_ambiente_logico >, 'nome_ambiente_logico': < nome_ambiente_logico >, 'id_grupo_l3': < id_grupo_l3 >, 'nome_grupo_l3': < nome_grupo_l3 >, 'id_filter': < id_filter >, 'filter_name': < filter_name >, 'ambiente_rede': < ambiente_rede >}, ... demais ambientes ... ]} :raise DataBaseError: Falha na networkapi ao acessar o banco de dados. :raise XMLError: Falha na networkapi ao gerar o XML de resposta.", "label": 1, "domain": "code", "token_count": 321, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0027", "text": "Classify the contents of a {@link String} to one of several String representations that shows the classes. Plain text or XML input is expected and the {@link PlainTextDocumentReaderAndWriter} is used. The classifier will tokenize the text and treat each sentence as a separate document. The output can be specified to be in a choice of three formats: slashTags (e.g., Bill/PERSON Smith/PERSON died/O ./O), inlineXML (e.g., <PERSON>Bill Smith</PERSON> went to <LOCATION>Paris</LOCATION> .), or xml, for stand-off XML (e.g., <wi num=\"0\" entity=\"PERSON\">Sue</wi> <wi num=\"1\" entity=\"O\">shouted</wi> ). There is also a binary choice as to whether the spacing between tokens of the original is preserved or whether the (tagged) tokens are printed with a single space (for inlineXML or slashTags) or a single newline (for xml) between each one.

Fine points: The slashTags and xml formats show tokens as transformed by any normalization processes inside the tokenizer, while inlineXML shows the tokens exactly as they appeared in the source text. When a period counts as both part of an abbreviation and as an end of sentence marker, it is included twice in the output String for slashTags or xml, but only once for inlineXML, where it is not counted as part of the abbreviation (or any named entity it is part of). For slashTags with preserveSpacing=true, there will be two successive periods such as \"Jr..\" The tokenized (preserveSpacing=false) output will have a space or a newline after the last token. @param sentences The String to be classified. It will be tokenized and divided into documents according to (heuristically determined) sentence boundaries. @param outputFormat The format to put the output in: one of \"slashTags\", \"xml\", or \"inlineXML\" @param preserveSpacing Whether to preserve the input spacing between tokens, which may sometimes be none (true) or whether to tokenize the text and print it with one space between each token (false) @return A {@link String} with annotated with classification information.", "label": 1, "domain": "code", "token_count": 480, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0028", "text": "Cancels a user-induced fault operation. The following is a list of APIs that start fault operations that may be cancelled using CancelOperation - - StartDataLoss - StartQuorumLoss - StartPartitionRestart - StartNodeTransition If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is true, the command will be aborted, and some internal state may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is not allowed until this API has already been called on the same test command with force set to false first, or unless the test command already has an OperationState of OperationState.RollingBack. Clarification: OperationState.RollingBack means that the system will/is be cleaning up internal system state caused by executing the command. It will not restore data if the test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will only clean up internal state from running the command. It will not restore the target partition's data, if the command progressed far enough to cause data loss. Important note: if this API is invoked with force==true, internal state may be left behind. @param operation_id A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API @param force [Boolean] Indicates whether to gracefully rollback and clean up internal system state modified by executing the user-induced operation. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 386, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0029", "text": "User list is available to all authenticated users. To get a list, issue authenticated **GET** request against */api/users/*. User list supports several filters. All filters are set in HTTP query section. Field filters are listed below. All of the filters apart from ?organization are using case insensitive partial matching. Several custom filters are supported: - ?current - filters out user making a request. Useful for getting information about a currently logged in user. - ?civil_number=XXX - filters out users with a specified civil number - ?is_active=True|False - show only active (non-active) users The user can be created either through automated process on login with SAML token, or through a REST call by a user with staff privilege. Example of a creation request is below. .. code-block:: http POST /api/users/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { \"username\": \"sample-user\", \"full_name\": \"full name\", \"native_name\": \"taisnimi\", \"job_title\": \"senior cleaning manager\", \"email\": \"example@example.com\", \"civil_number\": \"12121212\", \"phone_number\": \"\", \"description\": \"\", \"organization\": \"\", } NB! Username field is case-insensitive. So \"John\" and \"john\" will be treated as the same user.", "label": 1, "domain": "code", "token_count": 303, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0030", "text": "Creates and caches a new AWS DynamoDB.DocumentClient instance with the given DynamoDB.DocumentClient constructor options for either the region specified in the given options (if any and region specified) or for the current region (if not) UNLESS a previously cached DynamoDB.DocumentClient instance exists and the given options either match the options used to construct it or are undefined, empty or only region was specified, in which case no new instance will be created and the cached instance will be returned instead. If the given options do not match existing options and are not empty and not only region, then logs a warning that the previously cached DynamoDB.DocumentClient instance is being replaced and returns the new AWS DynamoDB.DocumentClient instance. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) Configures the given context, if it does not already have a context.dynamoDBDocClient, with the cached dynamoDBDocClient instance for either the region specified in the given default DynamoDB.DocumentClient options (if any and region specified) or for the current region (if not); otherwise with a new AWS.DynamoDB.DocumentClient instance created and cached by {@linkcode setDynamoDBDocClient} for the specified or current region using the given default DynamoDB.DocumentClient constructor options. Note that the given default DynamoDB.DocumentClient constructor options will ONLY be used if no cached DynamoDB.DocumentClient instance exists. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) @param {Object|DynamoDBDocClientAware} context - the context to configure @param {Object|undefined} [dynamoDBDocClientOptions] - the optional DynamoDB.DocumentClient constructor options to use if no cached DynamoDB.DocumentClient instance exists @param {string|undefined} [dynamoDBDocClientOptions.region] - an optional region to use instead of the current region @returns {DynamoDBDocClientAware} the given context configured with an AWS.DynamoDB.DocumentClient instance to use", "label": 1, "domain": "code", "token_count": 413, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0031", "text": "

Perform an XML 1.0 level 2 (markup-significant and all non-ASCII chars) escape operation on a String input.

Level 2 means this method will escape:

  • The five markup-significant characters: <, >, &, " and '
  • All non ASCII characters.

This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

This method calls {@link #escapeXml10(String, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

  • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
  • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

This method is thread-safe.

@param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 426, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0032", "text": "Configure sessions Enable sessions (disabled by default). This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding instance variable. When called without, it will return the already set value, or the default. Given Class as adapter it will be used as sessions middleware. Given String as adapter it will be resolved as class name and used as sessions middleware. Given Symbol as adapter it is assumed it's name of the class under Rack::Session namespace that will be used as sessions middleware (e.g. :cookie for Rack::Session::Cookie). By default options include domain inferred from host configuration, and secure flag inferred from scheme configuration. @overload sessions(adapter, options) Sets the given value. @param adapter [Class, String, Symbol] Rack middleware for sessions management @param options [Hash] options to pass to sessions middleware @overload sessions(false) Disables sessions @overload sessions Gets the value. @return [Hanami::Config::Sessions] sessions configuration @since 0.2.0 @see Hanami::Configuration#host @see Hanami::Configuration#scheme @example Getting the value require 'hanami' module Bookshelf class Application < Hanami::Application end end Bookshelf::Application.configuration.sessions # => # @example Setting the value with symbol require 'hanami' module Bookshelf class Application < Hanami::Application configure do sessions :cookie, secret: 'abc123' end end end Bookshelf::Application.configuration.sessions # => #\"localhost\", :secure=>false}> @example Disabling previously enabled sessions require 'hanami' module Bookshelf class Application < Hanami::Application configure do sessions :cookie sessions false end end end Bookshelf::Application.configuration.sessions # => #", "label": 1, "domain": "code", "token_count": 426, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0033", "text": "Sets attributes and binds buffers (deprecated... use {@link module:twgl.setBuffersAndAttributes}) Example: const program = createProgramFromScripts( gl, [\"some-vs\", \"some-fs\"); const attribSetters = createAttributeSetters(program); const positionBuffer = gl.createBuffer(); const texcoordBuffer = gl.createBuffer(); const attribs = { a_position: {buffer: positionBuffer, numComponents: 3}, a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, }; gl.useProgram(program); This will automatically bind the buffers AND set the attributes. setAttributes(attribSetters, attribs); Properties of attribs. For each attrib you can add properties: * type: the type of data in the buffer. Default = gl.FLOAT * normalize: whether or not to normalize the data. Default = false * stride: the stride. Default = 0 * offset: offset into the buffer. Default = 0 * divisor: the divisor for instances. Default = undefined For example if you had 3 value float positions, 2 value float texcoord and 4 value uint8 colors you'd setup your attribs like this const attribs = { a_position: {buffer: positionBuffer, numComponents: 3}, a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, a_color: { buffer: colorBuffer, numComponents: 4, type: gl.UNSIGNED_BYTE, normalize: true, }, }; @param {Object.} setters Attribute setters as returned from createAttributeSetters @param {Object.} buffers AttribInfos mapped by attribute name. @memberOf module:twgl/programs @deprecated use {@link module:twgl.setBuffersAndAttributes}", "label": 1, "domain": "code", "token_count": 371, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0034", "text": "A final axis is translated and rotated from a \"standard axis\". So opt.position and opt.rotation is required. A standard axis is and axis from [0, 0] to [0, axisExtent[1]], for example: (0, 0) ------------> (0, 50) nameDirection or tickDirection or labelDirection is 1 means tick or label is below the standard axis, whereas is -1 means above the standard axis. labelOffset means offset between label and axis, which is useful when 'onZero', where axisLabel is in the grid and label in outside grid. Tips: like always, positive rotation represents anticlockwise, and negative rotation represents clockwise. The direction of position coordinate is the same as the direction of screen coordinate. Do not need to consider axis 'inverse', which is auto processed by axis extent. @param {module:zrender/container/Group} group @param {Object} axisModel @param {Object} opt Standard axis parameters. @param {Array.} opt.position [x, y] @param {number} opt.rotation by radian @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle' or 'center'. @param {number} [opt.tickDirection=1] 1 or -1 @param {number} [opt.labelDirection=1] 1 or -1 @param {number} [opt.labelOffset=0] Usefull when onZero. @param {string} [opt.axisLabelShow] default get from axisModel. @param {string} [opt.axisName] default get from axisModel. @param {number} [opt.axisNameAvailableWidth] @param {number} [opt.labelRotate] by degree, default get from axisModel. @param {number} [opt.strokeContainThreshold] Default label interval when label @param {number} [opt.nameTruncateMaxWidth]", "label": 1, "domain": "code", "token_count": 399, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0035", "text": "This API will restart some or all replicas or instances of the specified partition. This API is useful for testing failover. If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances. Call the GetPartitionRestartProgress API using the same OperationId to get the progress. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param partition_id The identity of the partition. @param operation_id A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API @param restart_partition_mode [RestartPartitionMode] Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 320, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0036", "text": "Create HDX configuration. Can only be called once (will raise an error if called more than once). Args: configuration (Optional[Configuration]): Configuration instance. Defaults to setting one up from passed arguments. remoteckan (Optional[ckanapi.RemoteCKAN]): CKAN instance. Defaults to setting one up from configuration. **kwargs: See below user_agent (str): User agent string. HDXPythonLibrary/X.X.X- is prefixed. Must be supplied if remoteckan is not. user_agent_config_yaml (str): Path to YAML user agent configuration. Ignored if user_agent supplied. Defaults to ~/.useragent.yml. user_agent_lookup (str): Lookup key for YAML. Ignored if user_agent supplied. hdx_url (str): HDX url to use. Overrides hdx_site. hdx_site (str): HDX site to use eg. prod, test. hdx_read_only (bool): Whether to access HDX in read only mode. Defaults to False. hdx_key (str): Your HDX key. Ignored if hdx_read_only = True. hdx_config_dict (dict): HDX configuration dictionary to use instead of above 3 parameters OR hdx_config_json (str): Path to JSON HDX configuration OR hdx_config_yaml (str): Path to YAML HDX configuration project_config_dict (dict): Project configuration dictionary OR project_config_json (str): Path to JSON Project configuration OR project_config_yaml (str): Path to YAML Project configuration hdx_base_config_dict (dict): HDX base configuration dictionary OR hdx_base_config_json (str): Path to JSON HDX base configuration OR hdx_base_config_yaml (str): Path to YAML HDX base configuration. Defaults to library's internal hdx_base_configuration.yml. Returns: str: HDX site url", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0037", "text": "Build call for postConfigApacheFelixJettyBasedHttpService @param runmode (required) @param orgApacheFelixHttpsNio (optional) @param orgApacheFelixHttpsNioTypeHint (optional) @param orgApacheFelixHttpsKeystore (optional) @param orgApacheFelixHttpsKeystoreTypeHint (optional) @param orgApacheFelixHttpsKeystorePassword (optional) @param orgApacheFelixHttpsKeystorePasswordTypeHint (optional) @param orgApacheFelixHttpsKeystoreKey (optional) @param orgApacheFelixHttpsKeystoreKeyTypeHint (optional) @param orgApacheFelixHttpsKeystoreKeyPassword (optional) @param orgApacheFelixHttpsKeystoreKeyPasswordTypeHint (optional) @param orgApacheFelixHttpsTruststore (optional) @param orgApacheFelixHttpsTruststoreTypeHint (optional) @param orgApacheFelixHttpsTruststorePassword (optional) @param orgApacheFelixHttpsTruststorePasswordTypeHint (optional) @param orgApacheFelixHttpsClientcertificate (optional) @param orgApacheFelixHttpsClientcertificateTypeHint (optional) @param orgApacheFelixHttpsEnable (optional) @param orgApacheFelixHttpsEnableTypeHint (optional) @param orgOsgiServiceHttpPortSecure (optional) @param orgOsgiServiceHttpPortSecureTypeHint (optional) @param progressListener Progress listener @param progressRequestListener Progress request listener @return Call to execute @throws ApiException If fail to serialize the request body object", "label": 1, "domain": "code", "token_count": 317, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0038", "text": "/*[deutsch]

Ermittelt die aktuelle Zeit in der assoziierten Zeitzone und angegebenen Chronologie unter Berücksichtigung von Kalendervariante und Start des Kalendertages.

Das Ergebnis hängt immer dynamisch von der assoziierten Zeitzone ab. Wenn deren Daten sich ändern, dann wird diese Methode beim nächsten Aufruf ein angepasstes Ergebnis liefern.

Code-Beispiel:

 HijriCalendar hijriDate = CLOCK.now( HijriCalendar.family(), HijriCalendar.VARIANT_UMALQURA, StartOfDay.EVENING) .toDate(); System.out.println(hijriDate); // AH-1436-10-02[islamic-umalqura] 

Zu beachten: Dieses Beispiel stimmt sogar dann, wenn der aktuelle Zeitstempel 2015-07-17T18:00 ist, welcher normalerweise auf das islamische Datum AH-1436-10-01 abgebildet wird (wenn die Uhrzeit nicht betrachtet wird), denn der islamische Tag beginnt am Abend des Vortags.

@param generic type of chronology @param family calendar family to be used @param variant calendar variant @param startOfDay start of calendar day @return current general timestamp in given chronology @throws IllegalArgumentException if given variant is not supported @since 3.8/4.5", "label": 1, "domain": "code", "token_count": 346, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0039", "text": "

Perform an HTML5 level 1 (XML-style) escape operation on a String input.

Level 1 means this method will only escape the five markup-significant characters: <, >, &, " and '. It is called XML-style in order to link it with JSP's escapeXml attribute in JSTL's <c:out ... /> tags.

Note this method may not produce the same results as {@link #escapeHtml4Xml(String)} because it will escape the apostrophe as &apos;, whereas in HTML 4 such NCR does not exist (the decimal numeric reference &#39; is used instead).

This method calls {@link #escapeHtml(String, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

  • type: {@link org.unbescape.html.HtmlEscapeType#HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
  • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

This method is thread-safe.

@param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 438, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0040", "text": "materialize a single object, described by cld, from the first row of the ResultSet rs. There are two possible strategies: 1. The persistent class defines a public constructor with arguments matching the persistent primitive attributes of the class. In this case we build an array args of arguments from rs and call Constructor.newInstance(args) to build an object. 2. The persistent class does not provide such a constructor, but only a public default constructor. In this case we create an empty instance with Class.newInstance(). This empty instance is then filled by calling Field::set(obj,getObject(matchingColumn)) for each attribute. The second strategy needs n calls to Field::set() which are much more expensive than the filling of the args array in the first strategy. client applications should therefore define adequate constructors to benefit from performance gain of the first strategy. MBAIRD: The rowreader is told what type of object to materialize, so we have to trust it is asked for the right type. It is possible someone marked an extent in the repository, but not in java, or vice versa and this could cause problems in what is returned. we *have* to be able to materialize an object from a row that has a objConcreteClass, as we retrieve ALL rows belonging to that table. The objects using the rowReader will make sure they know what they are asking for, so we don't have to make sure a descriptor is assignable from the selectClassDescriptor. This allows us to map both inherited classes and unrelated classes to the same table.", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0041", "text": "

Perform an HTML 4 level 2 (result is ASCII) escape operation on a Reader input, writing results to a Writer.

Level 2 means this method will escape:

  • The five markup-significant characters: <, >, &, " and '
  • All non ASCII characters.

This escape will be performed by replacing those chars by the corresponding HTML 4 Named Character References (e.g. '&acute;') when such NCR exists for the replaced character, and replacing by a decimal character reference (e.g. '&#8345;') when there there is no NCR for the replaced character.

This method calls {@link #escapeHtml(Reader, Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

  • type: {@link org.unbescape.html.HtmlEscapeType#HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
  • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

This method is thread-safe.

@param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 417, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0042", "text": "
 Generate log-normally distributed floats. Use generator to generate num float results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using ::curandSetStream(), or the null stream if no stream has been set. Results are 32-bit floating point values with log-normal distribution based on an associated normal distribution with mean mean and standard deviation stddev. Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality. The normally distributed results are transformed into log-normal distribution. There may be slight numerical differences between results generated on the GPU with generators created with ::curandCreateGenerator() and results calculated on the CPU with generators created with ::curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values. @param generator - Generator to use @param outputPtr - Pointer to device memory to store CUDA-generated results, or Pointer to host memory to store CPU-generated results @param n - Number of floats to generate @param mean - Mean of associated normal distribution @param stddev - Standard deviation of associated normal distribution @return CURAND_STATUS_NOT_INITIALIZED if the generator was never created CURAND_STATUS_PREEXISTING_FAILURE if there was an existing error from a previous kernel launch CURAND_STATUS_LAUNCH_FAILURE if the kernel launch failed for any reason CURAND_STATUS_LENGTH_NOT_MULTIPLE if the number of output samples is not a multiple of the quasirandom dimension, or is not a multiple of two for pseudorandom generators CURAND_STATUS_SUCCESS if the results were generated successfully 
", "label": 1, "domain": "code", "token_count": 387, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0043", "text": "Batch gradient descent with momentum and individual gains. Parameters ---------- objective : function or callable Should return a tuple of cost and gradient for a given parameter vector. When expensive to compute, the cost can optionally be None and can be computed every n_iter_check steps using the objective_error function. p0 : array-like, shape (n_params,) Initial parameter vector. it : int Current number of iterations (this function will be called more than once during the optimization). n_iter : int Maximum number of gradient descent iterations. n_iter_check : int Number of iterations before evaluating the global error. If the error is sufficiently low, we abort the optimization. n_iter_without_progress : int, optional (default: 300) Maximum number of iterations without progress before we abort the optimization. momentum : float, within (0.0, 1.0), optional (default: 0.8) The momentum generates a weight for previous gradients that decays exponentially. learning_rate : float, optional (default: 200.0) The learning rate for t-SNE is usually in the range [10.0, 1000.0]. If the learning rate is too high, the data may look like a 'ball' with any point approximately equidistant from its nearest neighbours. If the learning rate is too low, most points may look compressed in a dense cloud with few outliers. min_gain : float, optional (default: 0.01) Minimum individual gain for each parameter. min_grad_norm : float, optional (default: 1e-7) If the gradient norm is below this threshold, the optimization will be aborted. verbose : int, optional (default: 0) Verbosity level. args : sequence Arguments to pass to objective function. kwargs : dict Keyword arguments to pass to objective function. Returns ------- p : array, shape (n_params,) Optimum parameters. error : float Optimum. i : int Last iteration.", "label": 1, "domain": "code", "token_count": 393, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0044", "text": "@event Storage#error @param {Error} error Abstract storage for verified blockchain You can save all hashes, but that needed store a large size on 20 February 2015 mainnet have more that 344k blocks thats mean you need store minimum 80 * 344000 / 1024 / 1024 = 26.24 MB or 52.48 MB if you store data in hex but for example in localStorage you can save only 2.5 MB ... We offer store maximum 2015 blocks hashes and sha256x2 hash for every chunk it's required nearly 105.31 KB for 344k blocks (impressive, really?) if you need block hash you can: - get from storage if it belongs to last not complete unhashed chunk - get chunk from network, calculate hash and compare with saved in storage, use block hashes from chunk and save it in memory if you needed this besides you can use pre-saved chunk hashes from Storage.prototype, it's saved user traffic and accelerate blockchain initialization pre-saved data has next structure: {lastHash: string, chunkHashes: string[]} But at least you can use both options, it's your right just remember, what sometimes you can't store all data that you needed ... All methods return Promise, this is done for asynchronous storages such as: File, WebSQL Also all methods represent hashes in hex strings, not Buffer @class Storage @extends events.EventEmitter @param {Object} [opts] @param {string} [opts.networkName=livenet] @param {boolean} [opts.compactMode=false]", "label": 1, "domain": "code", "token_count": 327, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0045", "text": "A dictionary whose key is the identity string sent over TLS and whose value is a keyAndSecret specifying what publicKey this identity is associated with and what secret it needs to provide. @public @typedef {Object.} pskMap This function takes a list of public keys and the device's ECDH private key along with a beacon stream with preamble that was generated using those public keys. The function requires that the beacon values in the beacon stream MUST be in the same order as the keys listed in the publicKeysToNotify array. The code will then generate Sxy as given in http://thaliproject.org/PresenceProtocolBindings/#transferring-from-notification-beacon-to-tls and then feed that to HKDF using the the PSKIdentity value which is defined in the above as the pre-amble plus the individual beacon value for the associated public key. This means we have to parse the beacon stream to pull out the preamble along with the specific associated beacon and then combine them together into a single buffer that is then base64'd using the URL safe base64 scheme. This is then fed to HKDF as defined in the link above which produces the value that will be used as the secret. This function will then wrap up all of this into a dictionary whose key is the base64 url safe'd pre-amble + beacon value and who value is the secret along with the associated publicKey. @param {Buffer[]} publicKeysToNotify - An array of buffers holding ECDH public keys. @param {ECDH} ecdhForLocalDevice - A Crypto.ECDH object initialized with the local device's public and private keys @param {Buffer} beaconStreamWithPreAmble - A buffer stream containing the preamble and beacons @returns {pskMap|Error}", "label": 1, "domain": "code", "token_count": 367, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0046", "text": "Dumps the object's methods corresponding to the schema provided in the object's class and type-checks the values. @param [Boolean] [optional] camelize optional argument for converting hash to camelBack. @param [Boolean] [optional] include_root optional argument for having the root key of the resulting hash as instance's class name. @param [Boolean] [optional] include_namespaces optional argument for having root key as a nested hash of instance's namespaces. Animal::Cat.new.surrealize -> (animal: { cat: { weight: '3 kilos' } }) @param [String] [optional] root optional argument for using a specified root key for the hash @param [Integer] [optional] namespaces_nesting_level level of namespaces nesting. @return [String] a json-formatted string corresponding to the schema provided in the object's class. Values will be taken from the return values of appropriate methods from the object. @raise +Surrealist::UnknownSchemaError+ if no schema was provided in the object's class. @raise +Surrealist::InvalidTypeError+ if type-check failed at some point. @raise +Surrealist::UndefinedMethodError+ if a key defined in the schema does not have a corresponding method on the object. @example Define a schema and surrealize the object class User include Surrealist json_schema do { name: String, age: Integer, } end def name 'Nikita' end def age 23 end end User.new.surrealize # => \"{\\\"name\\\":\\\"Nikita\\\",\\\"age\\\":23}\" # For more examples see README", "label": 1, "domain": "code", "token_count": 329, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0047", "text": "Returns a file upload input tag wrapped in markup that allows dragging and dropping of files onto the element. @author Ian Grant @see file:README.md#Usage Usage section of the README @param [Symbol] method The attribute on the target model to attach the files to. @param [String] content The content to render inside of the drag and drop file field. @param [Hash] options A hash of options to customise the file field. @option options [Boolean] :disabled If set to true, the user will not be able to use this input. @option options [Boolean] :mutiple If set to true, *in most updated browsers* the user will be allowed to select multiple files. @option options [String] :accept If set to one or multiple mime-types, the user will be suggested a filter when choosing a file. You still need to set up model validations. @option options [Integer] :size_limit The upper limit on filesize to accept in bytes. Client-side validation only. You still need to set up model validations. @return [String] The generated file field markup. @example # Accept only PNGs or JPEGs up to 5MB in size: form.drag_and_drop_file_field :images, nil, accept: 'image/png, image/jpeg', size_limit: 5_000_000 @example # Pass custom content string: form.drag_and_drop_file_field :images, '
Drag and Drop!
', accept: 'image/png' @example # Pass a block of content instead of passing a string <%= form.drag_and_drop_file_field(:images, accept: 'image/png') do %> Drag and Drop PNG files here or click to browse <% end %>", "label": 1, "domain": "code", "token_count": 362, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0048", "text": "

Perform an HTML5 level 1 (XML-style) escape operation on a char[] input.

Level 1 means this method will only escape the five markup-significant characters: <, >, &, " and '. It is called XML-style in order to link it with JSP's escapeXml attribute in JSTL's <c:out ... /> tags.

Note this method may not produce the same results as {@link #escapeHtml4Xml(char[], int, int, java.io.Writer)} because it will escape the apostrophe as &apos;, whereas in HTML 4 such NCR does not exist (the decimal numeric reference &#39; is used instead).

This method calls {@link #escapeHtml(char[], int, int, java.io.Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

  • type: {@link org.unbescape.html.HtmlEscapeType#HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
  • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

This method is thread-safe.

@param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 470, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0049", "text": "Fit spline curve for given x, y values Args: x: x-values y: y-values step: step size for interpolation val_min: minimum value of result val_max: maximum value of result kind: for scipy.interpolate.interp1d Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, ‘next’, where ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order; ‘previous’ and ‘next’ simply return the previous or next value of the point) or as an integer specifying the order of the spline interpolator to use. Default is ‘linear’. **kwargs: additional parameters for interp1d Returns: pd.Series: fitted curve Examples: >>> x = pd.Series([1, 2, 3]) >>> y = pd.Series([np.exp(1), np.exp(2), np.exp(3)]) >>> r = spline_curve(x=x, y=y, step=.5, val_min=3, val_max=18, fill_value='extrapolate') >>> r.round(2).index.tolist() [1.0, 1.5, 2.0, 2.5, 3.0] >>> r.round(2).tolist() [3.0, 4.05, 7.39, 12.73, 18.0] >>> y_df = pd.DataFrame(dict(a=[np.exp(1), np.exp(2), np.exp(3)], b=[2, 3, 4])) >>> r_df = spline_curve(x=x, y=y_df, step=.5, val_min=3, fill_value='extrapolate') >>> r_df.round(2) a b 1.00 3.00 3.00 1.50 4.05 3.00 2.00 7.39 3.00 2.50 12.73 3.50 3.00 20.09 4.00", "label": 1, "domain": "code", "token_count": 439, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0050", "text": " Encode 'object' in canonical JSON form, as specified at http://wiki.laptop.org/go/Canonical_JSON . It's a restricted dialect of JSON in which keys are always lexically sorted, there is no whitespace, floats aren't allowed, and only quote and backslash get escaped. The result is encoded in UTF-8, and the resulting bits are passed to output_function (if provided), or joined into a string and returned. Note: This function should be called prior to computing the hash or signature of a JSON object in TUF. For example, generating a signature of a signing role object such as 'ROOT_SCHEMA' is required to ensure repeatable hashes are generated across different json module versions and platforms. Code elsewhere is free to dump JSON objects in any format they wish (e.g., utilizing indentation and single quotes around object keys). These objects are only required to be in \"canonical JSON\" format when their hashes or signatures are needed. >>> encode_canonical(\"\") '\"\"' >>> encode_canonical([1, 2, 3]) '[1,2,3]' >>> encode_canonical([]) '[]' >>> encode_canonical({\"A\": [99]}) '{\"A\":[99]}' >>> encode_canonical({\"x\" : 3, \"y\" : 2}) '{\"x\":3,\"y\":2}' object: The object to be encoded. output_function: The result will be passed as arguments to 'output_function' (e.g., output_function('result')). securesystemslib.exceptions.FormatError, if 'object' cannot be encoded or 'output_function' is not callable. The results are fed to 'output_function()' if 'output_function' is set. A string representing the 'object' encoded in canonical JSON form.", "label": 1, "domain": "code", "token_count": 374, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0051", "text": "Return the screen relative position of an element. @param {(string|Array|NodeList|HTMLCollection|Element)} element - The element. Note that it'll be passed to getElement to ensure there's only one. @return {(Object|boolean)} clientRect - Element's screen position or false if no element found. @return {number} clientRect.bottom - Y-coordinate, relative to the viewport origin, of the bottom of the rectangle box. @return {number} clientRect.height - Height of the rectangle box (This is identical to bottom minus top). @return {number} clientRect.left - X-coordinate, relative to the viewport origin, of the left of the rectangle box. @return {number} clientRect.right - X-coordinate, relative to the viewport origin, of the right of the rectangle box. @return {number} clientRect.top - Y-coordinate, relative to the viewport origin, of the top of the rectangle box. @return {number} clientRect.width - Width of the rectangle box (This is identical to right minus left). @example esnext import { setStyleProp, append, clientRect } from 'chirashi' setStyleProp([document.documentElement, document.body], { position: 'relative', margin: 0, padding: 0 }) append(document.body, '.poulp') const poulp = setStyleProp('.poulp', { display: 'block', position: 'absolute', top: 200, left: 240, width: 100, height: 100, background: 'red' }) clientRect(poulp) // returns: { bottom: 300, height: 100, left: 240, right: 0, top: 200, width: 100 } @example es5 Chirashi.setStyleProp([document.documentElement, document.body], { position: 'relative', margin: 0, padding: 0 }) Chirashi.append(document.body, '.poulp') var poulp = Chirashi.setStyleProp('.poulp', { display: 'block', position: 'absolute', top: 200, left: 240, width: 100, height: 100, background: 'red' }) Chirashi.clientRect(poulp) // returns: { bottom: 300, height: 100, left: 240, right: 0, top: 200, width: 100 }", "label": 1, "domain": "code", "token_count": 500, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0052", "text": "Sort a dictionary by key or value. The function relies on https://docs.python.org/3/library/collections.html#collections.OrderedDict . The dulicated are determined based on https://stackoverflow.com/questions/9835762/find-and-list-duplicates-in-a-list . Parameters ---------- d : dict Input dictionary by : ['key','value'], optional By what to sort the input dictionary allow_duplicates : bool, optional Flag to indicate if the duplicates are allowed. Returns ------- collections.OrderedDict Sorted dictionary. >>> sort_dict({2: 3, 1: 2, 3: 1}) OrderedDict([(1, 2), (2, 3), (3, 1)]) >>> sort_dict({2: 3, 1: 2, 3: 1}, by='value') OrderedDict([(3, 1), (1, 2), (2, 3)]) >>> sort_dict({'2': 3, '1': 2}, by='value') OrderedDict([('1', 2), ('2', 3)]) >>> sort_dict({2: 1, 1: 2, 3: 1}, by='value', allow_duplicates=False) Traceback (most recent call last): ... ValueError: There are duplicates in the values: {1} >>> sort_dict({1:1,2:3},by=True) Traceback (most recent call last): ... ValueError: by can be 'key' or 'value'.", "label": 1, "domain": "code", "token_count": 302, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0053", "text": "

Perform an XML 1.0 level 1 (only markup-significant chars) escape operation on a String input meant to be an XML attribute value, writing results to a Writer.

Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

This method calls {@link #escapeXml10(String, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

  • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
  • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

This method is thread-safe.

@param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 399, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0054", "text": "Examine an HSP and return information about where the query and subject match begins and ends. Return a dict with keys that allow the query to be displayed against the subject. The returned readStartInSubject and readEndInSubject indices are offsets into the subject. I.e., they indicate where in the subject the query falls. In the returned object, all indices are suitable for Python string slicing etc. We must be careful to convert from the 1-based offsets found in DIAMOND output properly. hsp['frame'] is a value from {-3, -2, -1, 1, 2, 3}. The sign indicates negative or positive sense (i.e., the direction of reading through the query to get the alignment). The frame value is the nucleotide match offset modulo 3, plus one (i.e., it tells us which of the 3 possible query reading frames was used in the match). NOTE: the returned readStartInSubject value may be negative. We consider the subject sequence to start at offset 0. So if the query string has sufficient additional nucleotides before the start of the alignment match, it may protrude to the left of the subject. Similarly, the returned readEndInSubject can be greater than the subjectEnd. @param hsp: an HSP in the form of a C{dict}, built from a DIAMOND record. All passed offsets are 1-based. @param queryLen: the length of the query sequence. @param diamondTask: The C{str} command-line matching algorithm that was run (either 'blastx' or 'blastp'). @return: A C{dict} with C{str} keys and C{int} offset values. Keys are readStart readEnd readStartInSubject readEndInSubject subjectStart subjectEnd The returned offset values are all zero-based.", "label": 1, "domain": "code", "token_count": 381, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0055", "text": "@class This object represents a decoration attached to a range of text. Annotations are added to a AnnotationModel which is attached to a TextModel.

See:
{@link orion.editor.AnnotationModel}
{@link orion.editor.Ruler}

@name orion.editor.Annotation @property {String} type The annotation type (for example, orion.annotation.error). @property {Number} start The start offset of the annotation in the text model. @property {Number} end The end offset of the annotation in the text model. @property {String} html The HTML displayed for the annotation. @property {String} title The text description for the annotation. @property {orion.editor.Style} style The style information for the annotation used in the annotations ruler and tooltips. @property {orion.editor.Style} overviewStyle The style information for the annotation used in the overview ruler. @property {orion.editor.Style} rangeStyle The style information for the annotation used in the text view to decorate a range of text. @property {orion.editor.Style} lineStyle The style information for the annotation used in the text view to decorate a line of text. Constructs a new folding annotation. @param {Number} start The start offset of the annotation in the text model. @param {Number} end The end offset of the annotation in the text model. @param {orion.editor.ProjectionTextModel} projectionModel The projection text model. @class This object represents a folding annotation. @name orion.editor.FoldingAnnotation", "label": 1, "domain": "code", "token_count": 334, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0056", "text": "

Perform a CSS String level 2 (basic set and all non-ASCII chars) escape operation on a String input, writing results to a Writer.

Level 2 means this method will escape:

  • The CSS String basic escape set:
    • The Backslash Escapes: \" (U+0022) and \' (U+0027).
    • Two ranges of non-displayable, control characters: U+0000 to U+001F and U+007F to U+009F.
  • All non ASCII characters.

This escape will be performed by using Backslash escapes whenever possible. For escaped characters that do not have an associated Backslash, default to \FF Hexadecimal Escapes.

This method calls {@link #escapeCssString(String, Writer, CssStringEscapeType, CssStringEscapeLevel)} with the following preconfigured values:

  • type: {@link CssStringEscapeType#BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA}
  • level: {@link CssStringEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET}

This method is thread-safe.

@param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 461, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0057", "text": "Sets the charset used for decoding byte sequences to character sequences when reading template files in a locale for which no explicit encoding was specified via {@link Configuration#setEncoding(Locale, String)}. Note that by default there is no locale specified for any locale, so the default encoding is always in effect.

Defaults to the default system encoding, which can change from one server to another, so you should always set this setting. If you don't know what charset your should chose, {@code \"UTF-8\"} is usually a good choice.

Note that individual templates may specify their own charset by starting with <#ftl encoding=\"...\"> You can specify a direct value. For example:

 .defaultEncoding(\"UTF-8\"); 

You can also specify one or several property keys. For example:

 .defaultEncoding(\"${custom.property.high-priority}\", \"${custom.property.low-priority}\"); 
The properties are not immediately evaluated. The evaluation will be done when the {@link #build()} method is called. If you provide several property keys, evaluation will be done on the first key and if the property exists (see {@link EnvironmentBuilder}), its value is used. If the first property doesn't exist in properties, then it tries with the second one and so on. @param encodings one value, or one or several property keys @return this instance for fluent chaining", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0058", "text": "Routine to download NASA CDAWeb CDF data. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset. Parameters ----------- supported_tags : dict dict of dicts. Keys are supported tag names for download. Value is a dict with 'dir', 'remote_fname', 'local_fname'. Inteded to be pre-set with functools.partial then assigned to new instrument code. date_array : array_like Array of datetimes to download data for. Provided by pysat. tag : (str or NoneType) tag or None (default=None) sat_id : (str or NoneType) satellite id or None (default=None) data_path : (string or NoneType) Path to data directory. If None is specified, the value previously set in Instrument.files.data_path is used. (default=None) user : (string or NoneType) Username to be passed along to resource with relevant data. (default=None) password : (string or NoneType) User password to be passed along to resource with relevant data. (default=None) fake_daily_files_from_monthly : bool Some CDAWeb instrument data files are stored by month.This flag, when true, accomodates this reality with user feedback on a monthly time frame. Returns -------- Void : (NoneType) Downloads data to disk. Examples -------- :: # download support added to cnofs_vefi.py using code below rn = '{year:4d}/cnofs_vefi_bfield_1sec_{year:4d}{month:02d}{day:02d}_v05.cdf' ln = 'cnofs_vefi_bfield_1sec_{year:4d}{month:02d}{day:02d}_v05.cdf' dc_b_tag = {'dir':'/pub/data/cnofs/vefi/bfield_1sec', 'remote_fname':rn, 'local_fname':ln} supported_tags = {'dc_b':dc_b_tag} download = functools.partial(nasa_cdaweb_methods.download, supported_tags=supported_tags)", "label": 1, "domain": "code", "token_count": 417, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0059", "text": "Play sounds using Web Audio in the browser. The WebAudioPlugin is currently the default plugin, and will be used anywhere that it is supported. To change plugin priority, check out the Sound API {{#crossLink \"Sound/registerPlugins\"}}{{/crossLink}} method.

Known Browser and OS issues for Web Audio

Firefox 25
  • mp3 audio files do not load properly on all windows machines, reported here.
    For this reason it is recommended to pass another FireFox-supported type (i.e. ogg) as the default extension, until this bug is resolved
  • Webkit (Chrome and Safari)
  • AudioNode.disconnect does not always seem to work. This can cause the file size to grow over time if you are playing a lot of audio files.
  • iOS 6 limitations
    • Sound is initially muted and will only unmute through play being called inside a user initiated event (touch/click). Please read the mobile playback notes in the the {{#crossLink \"Sound\"}}{{/crossLink}} class for a full overview of the limitations, and how to get around them.
    • A bug exists that will distort un-cached audio when a video element is present in the DOM. You can avoid this bug by ensuring the audio and video audio share the same sample rate.
    @class WebAudioPlugin @extends AbstractPlugin @constructor @since 0.4.0", "label": 1, "domain": "code", "token_count": 352, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0060", "text": "/*[deutsch]

    Definiert das Element für das Jahr einer historischen Ära.

    Dieses Element ist auf alle chronologischen Typen anwendbar, die das Element {@link PlainDate#COMPONENT} registriert haben.

    Beispiel: Große Teile von Frankreich haben den Osterstil als Neujahrsregel verwendet, so daß das Jahr 1564 zum Datum 1564-04-01 begann und zum Datum 1565-04-21 endete. Hier gibt es keine eindeutige Zuordnung von Datumsangaben im April. Wenn das Datum etwa auf den 10. April 1564 gesetzt werden soll, kann das eindeutig mit Hilfe einer spezifischen Jahresdefinition ausgedrückt werden (Standardkalenderjahre 1564 oder 1565 möglich).

     ChronoHistory history = ChronoHistory.of(Locale.FRANCE); PlainDate date = history.convert(HistoricDate.of(HistoricEra.AD, 1563, 4, 10)); assertThat( date.with(history.yearOfEra(YearDefinition.AFTER_NEW_YEAR), 1564), is(history.convert(HistoricDate.of(HistoricEra.AD, 1564, 4, 10)))); assertThat( date.with(history.yearOfEra(YearDefinition.BEFORE_NEW_YEAR), 1564), is(history.convert(HistoricDate.of(HistoricEra.AD, 1565, 4, 10)))); 
    @param yearDefinition determines how to display or interprete a historic year @return year-of-era-related element @since 3.19/4.15 @see PlainDate @see net.time4j.PlainTimestamp", "label": 1, "domain": "code", "token_count": 402, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0061", "text": "Raises ValidationException if value can't be used as a regular expression string. Returns the value argument as a regex object. If you want to check if a string matches a regular expression, call validateRegex(). * value (str): The value being validated as a regular expression string. * regex (str, regex): The regular expression to match the value against. * flags (int): Identical to the flags argument in re.compile(). Pass re.VERBOSE et al here. * blank (bool): If True, a blank string will be accepted. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateRegexStr('(cat)|(dog)') re.compile('(cat)|(dog)') >>> pysv.validateRegexStr('\"(.*?)\"') re.compile('\"(.*?)\"') >>> pysv.validateRegexStr('\"(.*?\"') Traceback (most recent call last): ... pysimplevalidate.ValidationException: '\"(.*?\"' is not a valid regular expression: missing ), unterminated subpattern at position 1", "label": 1, "domain": "code", "token_count": 327, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0062", "text": "Triggers restore of the state of the partition using the specified restore partition description. Restores the state of a of the stateful persisted partition using the specified backup point. In case the partition is already being periodically backed up, then by default the backup point is looked for in the storage specified in backup policy. One can also override the same by specifying the backup storage details as part of the restore partition description in body. Once the restore is initiated, its progress can be tracked using the GetRestoreProgress operation. In case, the operation times out, specify a greater restore timeout value in the query parameter. @param partition_id The identity of the partition. @param restore_partition_description [RestorePartitionDescription] Describes the parameters to restore the partition. @param restore_timeout [Integer] Specifies the maximum amount of time to wait, in minutes, for the restore operation to complete. Post that, the operation returns back with timeout error. However, in certain corner cases it could be that the restore operation goes through even though it completes with timeout. In case of timeout error, its recommended to invoke this operation again with a greater timeout value. the default value for the same is 10 minutes. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0063", "text": "function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and interface that the target host is currently connected to. Note: Although intended to return a single location, Multiple locations may be returned for a single host due to a partially discovered network or misconfigured environment. :param host_ipaddress: str value valid IPv4 IP address :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :return: list of dictionaries where each element of the list represents the location of the target host :rtype: list >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.termaccess import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> found_device = get_real_time_locate('10.101.0.51', auth.creds, auth.url) >>> assert type(found_device) is list >>> assert 'deviceId' in found_device[0] >>> assert 'deviceId' in found_device[0] >>> assert 'deviceId' in found_device[0] >>> assert 'deviceId' in found_device[0] >>> no_device = get_real_time_locate('192.168.254.254', auth.creds, auth.url) >>> assert type(no_device) is dict >>> assert len(no_device) == 0", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0064", "text": "Add an option. Options are parsed via OptionParser so view it for additional usage documentation. A block may optionally be passed to handle the option, otherwise the _options_ struct seen below contains the results of this option. This handles common formats such as: -h, --help options.help # => bool --[no-]feature options.feature # => bool --large-switch options.large_switch # => bool --file FILE options.file # => file passed --list WORDS options.list # => array --date [DATE] options.date # => date or nil when optional argument not set === Examples command :something do |c| c.option '--recursive', 'Do something recursively' c.option '--file FILE', 'Specify a file' c.option('--info', 'Display info') { puts \"handle with block\" } c.option '--[no-]feature', 'With or without feature' c.option '--list FILES', Array, 'List the files specified' c.when_called do |args, options| do_something_recursively if options.recursive do_something_with_file options.file if options.file end end === Help Formatters This method also parses the arguments passed in order to determine which were switches, and which were descriptions for the option which can later be used within help formatters using option[:switches] and option[:description]. === Input Parsing Since Commander utilizes OptionParser you can pre-parse and evaluate option arguments. Simply require 'optparse/time', or 'optparse/date', as these objects must respond to #parse. c.option '--time TIME', Time c.option '--date [DATE]', Date", "label": 1, "domain": "code", "token_count": 322, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0065", "text": "/* Reduction on the GPU. We basically use the technique described in section 37.2 of this article: http://http.developer.nvidia.com/GPUGems/gpugems_ch37.html The algorithm: We basically start with a texture (A) of size (N)x(N). Then we create an FBO (B) of size (N/2)x(N/2). Then we render to FBO (B), and every fragment will sample four texels from (A). And by doing so, we will have performed a reduction of 2x2 sized blocks. Next, we create an FBO (C) of size (N/4)x(N/4), and, like above, we to render (C) to while sampling from (B), and so on. We keep going until we are left with an FBO of size 1x1. And that single pixel in that FBO contains our desired result. Note that we are using a texture of type RGBA8 in the below implementation. This means that we can't really use '+' as an operator for the reduction, since it will easily overflow. This can be solved by switching to a texture of type RGBA32F. But we are not using that, because it requires an extensions that is not always available. So to maximize compability, we use RGBA8 in this demo. So if you want to use the below reduce implementation in your own code, you will probably have to switch to RGBA32F. And to simplify things, we will be making the assumption that data.length will be one the numbers 1x1, 2x2, 4x4, 8x8, 16x16,...", "label": 1, "domain": "code", "token_count": 349, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0066", "text": "Raises ValidationException if value is not an IPv4 or IPv6 address. Returns the value argument. * value (str): The value being validated as an IP address. * blank (bool): If True, a blank string will be accepted. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateIP('127.0.0.1') '127.0.0.1' >>> pysv.validateIP('255.255.255.255') '255.255.255.255' >>> pysv.validateIP('256.256.256.256') Traceback (most recent call last): pysimplevalidate.ValidationException: '256.256.256.256' is not a valid IP address. >>> pysv.validateIP('1:2:3:4:5:6:7:8') '1:2:3:4:5:6:7:8' >>> pysv.validateIP('1::8') '1::8' >>> pysv.validateIP('fe80::7:8%eth0') 'fe80::7:8%eth0' >>> pysv.validateIP('::255.255.255.255') '::255.255.255.255'", "label": 1, "domain": "code", "token_count": 373, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0067", "text": "Calculates probability of gene i regulating gene j with genotype data assisted method, with the recommended combination of multiple tests. dg: numpy.ndarray(nt,ns,dtype=gtype(='u1' by default)) Genotype data. Entry dg[i,j] is genotype i's value for sample j. Each value must be among 0,1,...,na. Genotype i must be best (and significant) eQTL of gene i (in dt). dt: numpy.ndarray(nt,ns,dtype=ftype(='=f4' by default)) Gene expression data for A Entry dt[i,j] is gene i's expression level for sample j. Genotype i (in dg) must be best (and significant) eQTL of gene i. dt2:numpy.ndarray(nt2,ns,dtype=ftype(='=f4' by default)) Gene expression data for B. dt2 has the same format as dt, and can be identical with, different from, or a superset of dt. When dt2 is a superset of (or identical with) dt, dt2 must be arranged to be identical with dt at its upper submatrix, i.e. dt2[:nt,:]=dt, and set parameter nodiag = 1. name: actual C function name to call na: Number of alleles the species have. It determintes the maximum number of values each genotype can take. When unspecified, it is automatically determined as the maximum of dg. nodiag: skip diagonal regulations, i.e. regulation A->B for A=B. This should be set to True when A is a subset of B and aligned correspondingly. memlimit: The approximate memory usage limit in bytes for the library. For datasets require a larger memory, calculation will be split into smaller chunks. If the memory limit is smaller than minimum required, calculation can fail with an error message. memlimit=0 defaults to unlimited memory usage. Return: dictionary with following keys: ret:0 iff execution succeeded. p: numpy.ndarray((nt,nt2),dtype=ftype(='=f4' by default)). Probability function from for recommended combination of multiple tests. For more information on tests, see paper. ftype and gtype can be found in auto.py.", "label": 1, "domain": "code", "token_count": 462, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0068", "text": "Devuelve textos similares al ejemplo dentro de los textos entrenados. Nota: Usa la distancia de coseno del vector de features TF-IDF Args: example (str): Se espera un id de texto o un texto a partir del cual se buscaran otros textos similares. max_similars (int, optional): Cantidad de textos similares a devolver. similarity_cutoff (float, optional): Valor umbral de similaridad para definir que dos textos son similares entre si. term_diff_max_rank (int, optional): Este valor sirve para controlar el umbral con el que los terminos son considerados importantes a la hora de recuperar textos (no afecta el funcionamiento de que textos se consideran cercanos, solo la cantidad de terminos que se devuelven en best_words). filter_list (list): Lista de ids de textos en la cual buscar textos similares. term_diff_cutoff (float): Deprecado. Se quitara en el futuro. Returns: tuple (list, list, list): (text_ids, sorted_dist, best_words) text_ids (list of str): Devuelve los ids de los textos sugeridos. sorted_dist (list of float): Devuelve la distancia entre las opciones sugeridas y el ejemplo dado como entrada. best_words (list of list): Para cada sugerencia devuelve las palabras mas relevantes que se usaron para seleccionar esa sugerencia.", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0069", "text": "Gets the list of replicas deployed on a Service Fabric node. Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param partition_id The identity of the partition. @param service_manifest_name [String] The name of a service manifest registered as part of an application type in a Service Fabric cluster. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0070", "text": "Parses a date formatted as a string according to the client's user preferences and calendar using the time zone of the client and returns the corresponding date object. It returns the date to the successCB callback with a properties object as a parameter. If there is an error parsing the date string, then the errorCB callback is invoked. The defaults are: formatLength=\"short\" and selector=\"date and time\" @param {String} dateString @param {Function} successCB @param {Function} errorCB @param {Object} options {optional} formatLength {String}: 'short', 'medium', 'long', or 'full' selector {String}: 'date', 'time', or 'date and time' @return Object.year {Number}: The four digit year Object.month {Number}: The month from (0 - 11) Object.day {Number}: The day from (1 - 31) Object.hour {Number}: The hour from (0 - 23) Object.minute {Number}: The minute from (0 - 59) Object.second {Number}: The second from (0 - 59) Object.millisecond {Number}: The milliseconds (from 0 - 999), not available on all platforms @error GlobalizationError.PARSING_ERROR Example globalization.stringToDate('4/11/2011', function (date) { alert('Month:' + date.month + '\\n' + 'Day:' + date.day + '\\n' + 'Year:' + date.year + '\\n');}, function (errorCode) {alert(errorCode);}, {selector:'date'});", "label": 1, "domain": "code", "token_count": 324, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0071", "text": "Fill rop with word data from op. The parameters specify the format of the data produced. Each word will be size bytes and order can be 1 for most significant word first or -1 for least significant first. Within each word endian can be 1 for most significant byte first, -1 for least significant first, or 0 for the native endianness of the host CPU. The most significant nails bits of each word are unused and set to zero, this can be 0 to produce full words. The number of words produced is written to *countp, or countp can be NULL to discard the count. rop must have enough space for the data, or if rop is NULL then a result array of the necessary size is allocated using the current GMP allocation function (see Custom Allocation). In either case the return value is the destination used, either rop or the allocated block. If op is non-zero then the most significant word produced will be non-zero. If op is zero then the count returned will be zero and nothing written to rop. If rop is NULL in this case, no block is allocated, just NULL is returned. The sign of op is ignored, just the absolute value is exported. An application can use mpz_sgn to get the sign and handle it as desired. (see Integer Comparisons) There are no data alignment restrictions on rop, any address is allowed. When an application is allocating space itself the required size can be determined with a calculation like the following. Since mpz_sizeinbase always returns at least 1, count here will be at least one, which avoids any portability problems with malloc(0), though if z is zero no space at all is actually needed (or written).
    {@code numb = 8*size - nail; count = (mpz_sizeinbase (z, 2) + numb-1) / numb; p = malloc (count * size); }
    ", "label": 1, "domain": "code", "token_count": 393, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0072", "text": "This API will restart some or all replicas or instances of the specified partition. This API is useful for testing failover. If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances. Call the GetPartitionRestartProgress API using the same OperationId to get the progress. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param partition_id The identity of the partition. @param operation_id A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API @param restart_partition_mode [RestartPartitionMode] Describe which partitions to restart. Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries' @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0073", "text": "@example Request syntax with placeholder values multipart_upload_part.upload({ body: source_file, content_length: 1, content_md5: \"ContentMD5\", sse_customer_algorithm: \"SSECustomerAlgorithm\", sse_customer_key: \"SSECustomerKey\", sse_customer_key_md5: \"SSECustomerKeyMD5\", request_payer: \"requester\", # accepts requester }) @param [Hash] options ({}) @option options [String, IO] :body Object data. @option options [Integer] :content_length Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. @option options [String] :content_md5 The base64-encoded 128-bit MD5 digest of the part data. @option options [String] :sse_customer_algorithm Specifies the algorithm to use to when encrypting the object (e.g., AES256). @option options [String] :sse_customer_key Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header. This must be the same encryption key specified in the initiate multipart upload request. @option options [String] :sse_customer_key_md5 Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error. @option options [String] :request_payer Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html @return [Types::UploadPartOutput]", "label": 1, "domain": "code", "token_count": 411, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0074", "text": "A {@link Parser} that takes as input the tokens returned by {@code tokenizer} delimited by {@code delim}, and runs {@code this} to parse the tokens. A common misunderstanding is that {@code tokenizer} has to be a parser of {@link Token}. It doesn't need to be because {@code Terminals} already takes care of wrapping your logical token objects into physical {@code Token} with correct source location information tacked on for free. Your token object can literally be anything, as long as your token level parser can recognize it later.

    The following example uses {@code Terminals.tokenizer()}:

     Terminals terminals = ...; return parser.from(terminals.tokenizer(), Scanners.WHITESPACES.optional()).parse(str); 
    And tokens are optionally delimited by whitespaces.

    Optionally, you can skip comments using an alternative scanner than {@code WHITESPACES}:

     {@code Terminals terminals = ...; Parser delim = Parsers.or( Scanners.WHITESPACE, Scanners.JAVA_LINE_COMMENT, Scanners.JAVA_BLOCK_COMMENT).skipMany(); return parser.from(terminals.tokenizer(), delim).parse(str); }

    In both examples, it's important to make sure the delimiter scanner can accept empty string (either through {@link #optional} or {@link #skipMany}), unless adjacent operator characters shouldn't be parsed as separate operators. i.e. \"((\" as two left parenthesis operators.

    {@code this} must be a token level parser.", "label": 1, "domain": "code", "token_count": 324, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0075", "text": "A formatter function to be used in a complex binding inside an XML template view in order to interpret OData V4 annotations. It knows about the following dynamic expressions:

    • \"14.5.2 Expression edm:AnnotationPath\"
    • \"14.5.11 Expression edm:NavigationPropertyPath\"
    • \"14.5.12 Expression edm:Path\"
    • \"14.5.13 Expression edm:PropertyPath\"
    It returns a binding expression for a navigation path in an OData model, starting at an entity. Currently supports navigation properties. Term casts and annotations of navigation properties terminate the navigation path. Examples:
     <template:if test=\"{path: 'facet>Target', formatter: 'sap.ui.model.odata.AnnotationHelper.getNavigationPath'}\"> <form:SimpleForm binding=\"{path: 'facet>Target', formatter: 'sap.ui.model.odata.AnnotationHelper.getNavigationPath'}\" /> </template:if> 
    @param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface the callback interface related to the current formatter call @param {any} [vRawValue] the raw value from the meta model, e.g. {AnnotationPath : \"ToSupplier/@com.sap.vocabularies.Communication.v1.Address\"} or {AnnotationPath : \"@com.sap.vocabularies.UI.v1.FieldGroup#Dimensions\"}; embedded within an entity set or entity type;
    • if this function is used as formatter the value is provided by the framework
    • if this function is called directly, provide the parameter only if it is already calculated
    • if the parameter is omitted, it is calculated automatically through oInterface.getObject(\"\")
    @returns {string} the resulting string value to write into the processed XML, e.g. \"{ToSupplier}\" or \"{}\" (in case no navigation is needed); returns \"\" in case the navigation path cannot be determined (this is treated as falsy in template:if statements!) @public", "label": 1, "domain": "code", "token_count": 464, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0076", "text": "

    Perform am URI path segment escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.

    The following are the only allowed chars in an URI path segment (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 302, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0077", "text": "/*[deutsch]

    Formatiert die kanonische Form dieses Intervalls im angegebenen reduzierten ISO-8601-Stil.

    Der Begriff "reduziert" bedeutet, daß höherwertige Elemente wie das Jahr in der Endkomponente weggelassen werden, wenn ihr Wert gleich dem Wert der Startkomponente ist. Außerdem wird in der Endkomponente der Offset für begrenzte Intervalle immer weggelassen. Beispiel:

     MomentInterval interval = MomentInterval.between( PlainTimestamp.of(2012, 6, 29, 10, 45), PlainTimestamp.of(2012, 6, 30, 23, 59, 59).atUTC().plus(1, SI.SECONDS)); System.out.println( interval.formatReduced( IsoDateStyle.EXTENDED_CALENDAR_DATE, IsoDecimalStyle.DOT, ClockUnit.SECONDS, ZonalOffset.UTC, InfinityStyle.SYMBOL)); // Output: 2016-02-29T10:45:00Z/30T23:59:60 
    @param dateStyle iso-compatible date style @param decimalStyle iso-compatible decimal style @param precision controls the precision of output format with constant length @param offset timezone offset @param infinityStyle controlling the format of infinite boundaries @return String @throws IllegalStateException if there is no canonical form or given infinity style prevents infinite intervals @see #toCanonical() @since 4.18", "label": 1, "domain": "code", "token_count": 338, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0078", "text": "Verifies that the two supplied values are the same value using the \"SameValue\" comparison.
    Note that this doesn't behave as the strict equality operator, but rather as a shim of ES6's [Object.is]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is}. Differences are that 0 and -0 aren't the same value and, finally, NaN is equal to itself.
    See also {@link module:lamb.is|is} for a curried version building a predicate and {@link module:lamb.areSVZ|areSVZ} and {@link module:lamb.isSVZ|isSVZ} to perform a \"SameValueZero\" comparison. @example var testObject = {}; _.areSame({}, testObject) // => false _.areSame(testObject, testObject) // => true _.areSame(\"foo\", \"foo\") // => true _.areSame(0, -0) // => false _.areSame(0 / 0, NaN) // => true @memberof module:lamb @category Logic @see {@link module:lamb.is|is} @see {@link module:lamb.areSVZ|areSVZ}, {@link module:lamb.isSVZ|isSVZ} @see [SameValue comparison]{@link https://www.ecma-international.org/ecma-262/7.0/#sec-samevalue} @see [SameValueZero comparison]{@link https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluezero} @since 0.50.0 @param {*} a @param {*} b @returns {Boolean}", "label": 1, "domain": "code", "token_count": 365, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0079", "text": "Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of UAS data (also known as database). When newer data available, it automatically loads and updates it.

    At initialization time the returned parser will be loaded with the UAS data of this module (the shipped one within the uadetector-resources JAR) and tries to update it. The initialization is started only when this method is called the first time.

    The update of the data store runs as background task. With this feature we try to reduce the initialization time of this UserAgentStringParser, because a network connection is involved and the remote system can be not available or slow.

    The static class definition {@code OnlineUpdatingParserHolder} within this factory class is not initialized until the JVM determines that {@code OnlineUpdatingParserHolder} must be executed. The static class {@code OnlineUpdatingParserHolder} is only executed when the static method {@code getOnlineUserAgentStringParser} is invoked on the class {@code UADetectorServiceFactory}, and the first time this happens the JVM will load and initialize the {@code OnlineUpdatingParserHolder} class.

    If during the operation the Internet connection gets lost, then this instance continues to work properly (and under correct log level settings you will get an corresponding log messages). @param dataUrl @param versionUrl @return an user agent string parser with updating service", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0080", "text": "Bind a parameter to the query. A parameter is denoted in the query string passed to create by $i, where i is the rank of the parameter, beginning with 1. The parameters are set consecutively by calling this method bind. The ith variable is set by the ith call to the bind method. If any of the $i are not set by a call to bind at the point execute is called, QueryParameterCountInvalidException is thrown. The parameters must be objects, and the result is an Object. Objects must be used instead of primitive types (Integer instead of int) for passing the parameters.

    If the parameter is of the wrong type, QueryParameterTypeInvalidException is thrown. After executing a query, the parameter list is reset. @param parameter A value to be substituted for a query parameter. @exception org.odmg.QueryParameterCountInvalidException The number of calls to bind has exceeded the number of parameters in the query. @exception org.odmg.QueryParameterTypeInvalidException The type of the parameter does not correspond with the type of the parameter in the query.", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0081", "text": "Helper for computing an initial position in {@link #loadInitial(LoadInitialParams, LoadInitialCallback)} when total data set size can be computed ahead of loading.

    The value computed by this function will do bounds checking, page alignment, and positioning based on initial load size requested.

    Example usage in a PositionalDataSource subclass:

     class ItemDataSource extends PositionalDataSource<Item> { private int computeCount() { // actual count code here } private List<Item> loadRangeInternal(int startPosition, int loadCount) { // actual load code here } {@literal @}Override public void loadInitial({@literal @}NonNull LoadInitialParams params, {@literal @}NonNull LoadInitialCallback<Item> callback) { int totalCount = computeCount(); int position = computeInitialLoadPosition(params, totalCount); int loadSize = computeInitialLoadSize(params, position, totalCount); callback.onResult(loadRangeInternal(position, loadSize), position, totalCount); } {@literal @}Override public void loadRange({@literal @}NonNull LoadRangeParams params, {@literal @}NonNull LoadRangeCallback<Item> callback) { callback.onResult(loadRangeInternal(params.startPosition, params.loadSize)); } }
    @param params Params passed to {@link #loadInitial(LoadInitialParams, LoadInitialCallback)}, including page size, and requested start/loadSize. @param totalCount Total size of the data set. @return Position to start loading at. @see #computeInitialLoadSize(LoadInitialParams, int, int)", "label": 1, "domain": "code", "token_count": 314, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0082", "text": "A {@link Parser} that runs {@code this} and then runs {@code op} for 0 or more times greedily. The {@link Function} objects returned from {@code op} are applied from left to right to the return value of p.

    This is the preferred API to avoid {@code StackOverflowError} in left-recursive parsers. For example, to parse array types in the form of \"T[]\" or \"T[][]\", the following left recursive grammar will fail:

     {@code Terminals terms = Terminals.operators(\"[\", \"]\"); Parser.Reference ref = Parser.newReference(); ref.set(Parsers.or(leafTypeParser, Parsers.sequence(ref.lazy(), terms.phrase(\"[\", \"]\"), new Unary() {...}))); return ref.get(); }
    A correct implementation is:
     {@code Terminals terms = Terminals.operators(\"[\", \"]\"); return leafTypeParer.postfix(terms.phrase(\"[\", \"]\").retn(new Unary() {...})); }
    A not-so-obvious example, is to parse the {@code expr ? a : b} ternary operator. It too is a left recursive grammar. And un-intuitively it can also be thought as a postfix operator. Basically, we can parse \"? a : b\" as a whole into a unary operator that accepts the condition expression as input and outputs the full ternary expression:
     {@code Parser ternary(Parser expr) { return expr.postfix( Parsers.sequence( terms.token(\"?\"), expr, terms.token(\":\"), expr, (unused, then, unused, orelse) -> cond -> new TernaryExpr(cond, then, orelse))); } }
    {@link OperatorTable} also handles left recursion transparently.

    {@code p.postfix(op)} is equivalent to {@code p op*} in EBNF.", "label": 1, "domain": "code", "token_count": 398, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0083", "text": "Adds a new attribute to the dictionary. @name module:back4app-entity/models/attributes.AttributeDictionary~_addAttribute @function @param {!module:back4app-entity/models/attributes.AttributeDictionary} attributeDictionary It is the attribute dictionary to which the attribute will be added. @param {!module:back4app-entity/models/attributes.Attribute} attribute This is the attribute to be added. It can be passed as a {@link module:back4app-entity/models/attributes.Attribute} instance. @param {?string} [name] This is the name of the attribute. @private @example var attributeDictionary = new AttributeDictionary(); _addAttribute( attributeDictionary, new StringAttribute('attribute'), 'attribute' ); Adds a new attribute to the dictionary. @name module:back4app-entity/models/attributes.AttributeDictionary~_addAttribute @function @param {!module:back4app-entity/models/attributes.AttributeDictionary} attributeDictionary It is the attribute dictionary to which the attribute will be added. @param {!Object} attribute This is the attribute to be added. It can be passed as an Object, as specified in {@link module:back4app-entity/models/attributes.Attribute}. @param {!string} [attribute.name] It is the name of the attribute. It is optional if it is passed as an argument in the function. @param {!string} [attribute.type='Object'] It is the type of the attribute. It is optional and if not passed it will assume 'Object' as the default value. @param {!string} [attribute.multiplicity='1'] It is the multiplicity of the attribute. It is optional and if not passed it will assume '1' as the default value. @param {?(boolean|number|string|Object|function)} [attribute.default] It is the default expression of the attribute. @param {?string} [name] This is the name of the attribute. @private @example var attributeDictionary = new AttributeDictionary(); _addAttribute(attributeDictionary, {}, 'attribute');", "label": 1, "domain": "code", "token_count": 413, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0084", "text": "

    Perform am URI query parameter (name or value) escape operation on a char[] input.

    The following are the only allowed chars in an URI query parameter (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ ' ( ) * , ;
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 332, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0085", "text": "Returns a copy of given query options where \"$expand\" and \"$select\" are replaced by the intersection with the given (navigation) property paths. @param {object} mCacheQueryOptions A map of query options as returned by {@link sap.ui.model.odata.v4.ODataModel#buildQueryOptions} @param {string[]} aPaths The \"14.5.11 Expression edm:NavigationPropertyPath\" or \"14.5.13 Expression edm:PropertyPath\" strings describing which properties need to be loaded because they may have changed due to side effects of a previous update; must not be empty @param {function} fnFetchMetadata Function which fetches metadata for a given meta path @param {string} sRootMetaPath The meta path for the cache root's type, for example \"/SalesOrderList/SO_2_BP\" or \"/Artists/foo.EditAction/@$ui5.overload/0/$ReturnType/$Type\", such that an OData simple identifier may be appended @param {object} mNavigationPropertyPaths Hash set of collection-valued navigation property meta paths (relative to the cache's root, that is without the root meta path prefix) which need to be refreshed, maps string to true; is modified @param {boolean} [sPrefix=\"\"] Optional prefix for navigation property meta paths used during recursion @returns {object} The updated query options or null if no request is needed @throws {Error} If a path string is empty or the intersection requires a $expand of a collection-valued navigation property", "label": 1, "domain": "code", "token_count": 321, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0086", "text": "Find vlans by all search parameters :param number: Filter by vlan number column :param name: Filter by vlan name column :param iexact: Filter by name will be exact? :param environment: Filter by environment ID related :param net_type: Filter by network_type ID related :param network: Filter by each octs in network :param ip_version: Get only version (0:ipv4, 1:ipv6, 2:all) :param subnet: Filter by octs will search by subnets? :param acl: Filter by vlan acl column :param pagination: Class with all data needed to paginate :return: Following dictionary: :: {'vlan': {'id': < id_vlan >, 'nome': < nome_vlan >, 'num_vlan': < num_vlan >, 'id_ambiente': < id_ambiente >, 'descricao': < descricao >, 'acl_file_name': < acl_file_name >, 'acl_valida': < acl_valida >, 'acl_file_name_v6': < acl_file_name_v6 >, 'acl_valida_v6': < acl_valida_v6 >, 'ativada': < ativada >, 'ambiente_name': < divisao_dc-ambiente_logico-grupo_l3 > 'redeipv4': [ { all networkipv4 related } ], 'redeipv6': [ { all networkipv6 related } ] }, 'total': {< total_registros >} } :raise InvalidParameterError: Some parameter was invalid. :raise DataBaseError: Networkapi failed to access the database. :raise XMLError: Networkapi failed to generate the XML response.", "label": 1, "domain": "code", "token_count": 341, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0087", "text": "Iterates over attributes and removes it from each element of elements. @param {(string|Array|NodeList|HTMLCollection|Element)} elements - The iterable, selector or elements. @param {...string} attributes - Names of attributes to remove. @return {Array} iterable - The getElements' result for chaining. @example //esnext import { createElement, append, removeAttr } from 'chirashi' const maki = createElement('.maki') append(document.body, maki) append(maki, ['.salmon[data-fish=\"salmon\"]', '.cheese[data-cheese=\"cream\"]']) //returns:
    removeAttr('.salmon', 'data-fish') //returns: [
    ] @example //es5 var maki = Chirashi.createElement('.maki') Chirashi.append(document.body, maki) Chirashi.append(maki, ['.salmon[data-fish=\"salmon\"]', '.cheese[data-cheese=\"cream\"]']) //returns:
    Chirashi.removeAttr('.salmon', 'data-fish') //returns: [
    ]", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0088", "text": "

    Perform a (configurable) XML 1.1 escape operation on a char[] input meant to be an XML attribute value.

    This method will perform an escape operation according to the specified {@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel} argument values.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    All other char[]-based escapeXml11*(...) methods call this one with preconfigured type and level values.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param type the type of escape operation to be performed, see {@link org.unbescape.xml.XmlEscapeType}. @param level the escape level to be applied, see {@link org.unbescape.xml.XmlEscapeLevel}. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 381, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0089", "text": "Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxGraphView Extends to implement a view for a graph. This class is in charge of computing the absolute coordinates for the relative child geometries, the points for perimeters and edge styles and keeping them cached in for faster retrieval. The states are updated whenever the model or the view state (translate, scale) changes. The scale and translate are honoured in the bounds. Event: mxEvent.UNDO Fires after the root was changed in . The edit property contains the which contains the . Event: mxEvent.SCALE_AND_TRANSLATE Fires after the scale and translate have been changed in . The scale, previousScale, translate and previousTranslate properties contain the new and previous scale and translate, respectively. Event: mxEvent.SCALE Fires after the scale was changed in . The scale and previousScale properties contain the new and previous scale. Event: mxEvent.TRANSLATE Fires after the translate was changed in . The translate and previousTranslate properties contain the new and previous value for translate. Event: mxEvent.DOWN and mxEvent.UP Fire if the current root is changed by executing an . The event name depends on the location of the root in the cell hierarchy with respect to the current root. The root and previous properties contain the new and previous root, respectively. Constructor: mxGraphView Constructs a new view for the given . Parameters: graph - Reference to the enclosing .", "label": 1, "domain": "code", "token_count": 414, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0090", "text": "Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_manifest_name [String] The name of the service manifest to filter the list of deployed service type information. If specified, the response will only contain the information about service types that are defined in this service manifest. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 303, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0091", "text": "Insere um novo ambiente e retorna o seu identificador. :param id_grupo_l3: Identificador do grupo layer 3. :param id_ambiente_logico: Identificador do ambiente lógico. :param id_divisao: Identificador da divisão data center. :param id_filter: Filter identifier. :param link: Link :param acl_path: Path where the ACL will be stored :param ipv4_template: Template that will be used in Ipv6 :param ipv6_template: Template that will be used in Ipv4 :param min_num_vlan_1: Min 1 num vlan valid for this environment :param max_num_vlan_1: Max 1 num vlan valid for this environment :param min_num_vlan_2: Min 2 num vlan valid for this environment :param max_num_vlan_2: Max 2 num vlan valid for this environment :return: Dicionário com a seguinte estrutura: {'ambiente': {'id': < id >}} :raise InvalidParameterError: O identificador do grupo l3, o identificador do ambiente lógico, e/ou o identificador da divisão de data center são nulos ou inválidos. :raise GrupoL3NaoExisteError: Grupo layer 3 não cadastrado. :raise AmbienteLogicoNaoExisteError: Ambiente lógico não cadastrado. :raise DivisaoDcNaoExisteError: Divisão datacenter não cadastrada. :raise AmbienteDuplicadoError: Ambiente com o mesmo id_grupo_l3, id_ambiente_logico e id_divisao já cadastrado. :raise DataBaseError: Falha na networkapi ao acessar o banco de dados. :raise XMLError: Falha na networkapi ao ler o XML de requisição ou gerar o XML de resposta.", "label": 1, "domain": "code", "token_count": 390, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0092", "text": "Creates a new tree iteration handler @name orion.explorerNavHandler.ExplorerNavHandler @class A tree iteration handler based on an explorer. @param {Object} explorer The {@link orion.explorer.Explorer} instance. @param {Object} options The options object which provides iterate patterns and all call back functions when iteration happens. @param {String} [options.gridClickSelectionPolicy=\"none\"] Controls how clicking on a grid model item -- for example, a link or a button -- affects the selection (or how it affects the cursor, if the selectionPolicy is \"cursorOnly\"). Allowed values are:
    • \"none\": Clicking on a grid item will not change the selection (or cursor). This is the default.
    • \"active\": Clicking on a grid item will change the selection (or cursor).
    @param {String} [options.selectionPolicy=null] Selection policy for this explorer. Allowed values are:
    • \"cursorOnly\": No selection of model items is allowed.
    • \"singleSelection\": Up to 1 model item can be selected.
    • \"readonlySelection\": Selection cannot be changed while this selection policy is set.
    • null: Zero or more model items can be selected. This is the default.
    @param {Function} [options.postDefaultFunc] If this function provides addtional behaviors after the default behavior. Some explorers may want to do something else when the cursor is changed, etc. @param {Function} [options.preventDefaultFunc] If this function returns true then the default behavior of all key press will stop at this time. The key event is passed to preventDefaultFunc. It can implement its own behavior based on the key event.", "label": 1, "domain": "code", "token_count": 405, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0093", "text": "Tests if the axis-aligned box is intersecting a segment. @param sx1 x coordinate of the first point of the segment. @param sy1 y coordinate of the first point of the segment. @param sz1 z coordinate of the first point of the segment. @param sx2 x coordinate of the second point of the segment. @param sy2 y coordinate of the second point of the segment. @param sz2 z coordinate of the second point of the segment. @param centerx is the center point of the oriented box. @param centery is the center point of the oriented box. @param centerz is the center point of the oriented box. @param axis1x are the unit vectors of the oriented box axis. @param axis1y are the unit vectors of the oriented box axis. @param axis1z are the unit vectors of the oriented box axis. @param axis2x are the unit vectors of the oriented box axis. @param axis2y are the unit vectors of the oriented box axis. @param axis2z are the unit vectors of the oriented box axis. @param axis3x are the unit vectors of the oriented box axis. @param axis3y are the unit vectors of the oriented box axis. @param axis3z are the unit vectors of the oriented box axis. @param extentAxis1 are the sizes of the oriented box. @param extentAxis2 are the sizes of the oriented box. @param extentAxis3 are the sizes of the oriented box. @return true if the two shapes intersect each other; false otherwise.", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0094", "text": "function takes no input as input to RESTFUL call to HP IMC :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :return: list of dictionaries where each element of the list represents a single wireless controller which has been discovered in the HPE IMC WSM module :rtype: list >>> from pyhpeimc.auth import * >>> from pyhpeimc.wsm.acinfo import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> ac_info_all = get_ac_info_all(auth.creds, auth.url) >>> assert type(ac_info_all) is list >>> assert len(ac_info_all[0]) == 12 >>> assert 'hardwareVersion' in ac_info_all[0] >>> assert 'ipAddress' in ac_info_all[0] >>> assert 'label' in ac_info_all[0] >>> assert 'macAddress' in ac_info_all[0] >>> assert 'onlineApCount' in ac_info_all[0] >>> assert 'onlineClientCount' in ac_info_all[0] >>> assert 'pingStatus' in ac_info_all[0] >>> assert 'serialId' in ac_info_all[0] >>> assert 'softwareVersion' in ac_info_all[0] >>> assert 'status' in ac_info_all[0] >>> assert 'sysName' in ac_info_all[0] >>> assert 'type' in ac_info_all[0]", "label": 1, "domain": "code", "token_count": 337, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0095", "text": " Generate public and private ED25519 keys, both of length 32-bytes, although they are hexlified to 64 bytes. In addition, a keyid identifier generated for the returned ED25519 object. The object returned conforms to 'securesystemslib.formats.ED25519KEY_SCHEMA' and has the form: {'keytype': 'ed25519', 'scheme': 'ed25519', 'keyid': 'f30a0870d026980100c0573bd557394f8c1bbd6...', 'keyval': {'public': '9ccf3f02b17f82febf5dd3bab878b767d8408...', 'private': 'ab310eae0e229a0eceee3947b6e0205dfab3...'}} >>> ed25519_key = generate_ed25519_key() >>> securesystemslib.formats.ED25519KEY_SCHEMA.matches(ed25519_key) True >>> len(ed25519_key['keyval']['public']) 64 >>> len(ed25519_key['keyval']['private']) 64 scheme: The signature scheme used by the generated Ed25519 key. None. The ED25519 keys are generated by calling either the optimized pure Python implementation of ed25519, or the ed25519 routines provided by 'pynacl'. A dictionary containing the ED25519 keys and other identifying information. Conforms to 'securesystemslib.formats.ED25519KEY_SCHEMA'.", "label": 1, "domain": "code", "token_count": 326, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0096", "text": "Creates a new Cursor instance (INTERNAL TYPE, do not instantiate directly) @class Cursor @extends external:CoreCursor @extends external:Readable @property {string} sortValue Cursor query sort setting. @property {boolean} timeout Is Cursor able to time out. @property {ReadPreference} readPreference Get cursor ReadPreference. @fires Cursor#data @fires Cursor#end @fires Cursor#close @fires Cursor#readable @return {Cursor} a Cursor instance. @example Cursor cursor options. collection.find({}).project({a:1}) // Create a projection of field a collection.find({}).skip(1).limit(10) // Skip 1 and limit 10 collection.find({}).batchSize(5) // Set batchSize on cursor to 5 collection.find({}).filter({a:1}) // Set query on the cursor collection.find({}).comment('add a comment') // Add a comment to the query, allowing to correlate queries collection.find({}).addCursorFlag('tailable', true) // Set cursor as tailable collection.find({}).addCursorFlag('oplogReplay', true) // Set cursor as oplogReplay collection.find({}).addCursorFlag('noCursorTimeout', true) // Set cursor as noCursorTimeout collection.find({}).addCursorFlag('awaitData', true) // Set cursor as awaitData collection.find({}).addCursorFlag('partial', true) // Set cursor as partial collection.find({}).addQueryModifier('$orderby', {a:1}) // Set $orderby {a:1} collection.find({}).max(10) // Set the cursor max collection.find({}).maxTimeMS(1000) // Set the cursor maxTimeMS collection.find({}).min(100) // Set the cursor min collection.find({}).returnKey(true) // Set the cursor returnKey collection.find({}).setReadPreference(ReadPreference.PRIMARY) // Set the cursor readPreference collection.find({}).showRecordId(true) // Set the cursor showRecordId collection.find({}).sort([['a', 1]]) // Sets the sort order of the cursor query collection.find({}).hint('a_1') // Set the cursor hint All options are chainable, so one can do the following. collection.find({}).maxTimeMS(1000).maxScan(100).skip(1).toArray(..)", "label": 1, "domain": "code", "token_count": 482, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0097", "text": "Method: getFeatureInfo Get feature information from ArcIMS. Using the applied geometry, apply the options to the query (buffer, area/envelope intersection), and query the ArcIMS service. A note about accuracy: ArcIMS interprets the accuracy attribute in feature requests to be something like the 'modulus' operator on feature coordinates, applied to the database geometry of the feature. It doesn't round, so your feature coordinates may be up to (1 x accuracy) offset from the actual feature coordinates. If the accuracy of the layer is not specified, the accuracy will be computed to be approximately 1 feature coordinate per screen pixel. Parameters: geometry - {} or {} The geometry to use when making the query. This should be a closed polygon for behavior approximating a free selection. layer - {Object} The ArcIMS layer definition. This is an anonymous object that looks like: (code) { id: \"ArcXML layer ID\", // the ArcXML layer ID query: { where: \"STATE = 'PA'\", // the where clause of the query accuracy: 100 // the accuracy of the returned feature } } (end) options - {Object} Object with non-default properties to set on the layer. Supported properties are buffer, callback, scope, and any other properties applicable to the ArcXML format. Set the 'callback' and 'scope' for an object and function to recieve the parsed features from ArcIMS.", "label": 1, "domain": "code", "token_count": 303, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0098", "text": "

    Perform am URI path escape operation on a Reader input, writing results to a Writer.

    The following are the only allowed chars in an URI path (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • /

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0099", "text": "The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

    CallBack Schemas

    Review Completion CallBack Sample

    {
    \"ReviewId\": \"\",
    \"ModifiedOn\": \"2016-10-11T22:36:32.9934851Z\",
    \"ModifiedBy\": \"\",
    \"CallBackType\": \"Review\",
    \"ContentId\": \"\",
    \"Metadata\": {
    \"adultscore\": \"0.xxx\",
    \"a\": \"False\",
    \"racyscore\": \"0.xxx\",
    \"r\": \"True\"
    },
    \"ReviewerResultTags\": {
    \"a\": \"False\",
    \"r\": \"True\"
    }
    }

    . @param team_name [String] Your team name. @param review_id [String] Id of the review. @param start_seed [Integer] Time stamp of the frame from where you want to start fetching the frames. @param no_of_records [Integer] Number of frames to fetch. @param filter [String] Get frames filtered by tags. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 348, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0100", "text": "Resolve a Service Fabric partition. Resolve a Service Fabric service partition to get the endpoints of the service replicas. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param partition_key_type [Integer] Key type for the partition. This parameter is required if the partition scheme for the service is Int64Range or Named. The possible values are following. - None (1) - Indicates that the PartitionKeyValue parameter is not specified. This is valid for the partitions with partitioning scheme as Singleton. This is the default value. The value is 1. - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an int64 partition key. This is valid for the partitions with partitioning scheme as Int64Range. The value is 2. - Named (3) - Indicates that the PartitionKeyValue parameter is a name of the partition. This is valid for the partitions with partitioning scheme as Named. The value is 3. @param partition_key_value [String] Partition key. This is required if the partition scheme for the service is Int64Range or Named. @param previous_rsp_version [String] The value in the Version field of the response that was received previously. This is required if the user knows that the result that was got previously is stale. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ResolvedServicePartition] operation results.", "label": 1, "domain": "code", "token_count": 431, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0101", "text": "Translates an error message in its default scope (activemodel.errors.messages). Error messages are first looked up in activemodel.errors.models.MODEL.attributes.ATTRIBUTE.MESSAGE, if it's not there, it's looked up in activemodel.errors.models.MODEL.MESSAGE and if that is not there also, it returns the translation of the default message (e.g. activemodel.errors.messages.MESSAGE). The translated model name, translated attribute name and the value are available for interpolation. When using inheritance in your models, it will check all the inherited models too, but only if the model itself hasn't been found. Say you have class Admin < User; end and you wanted the translation for the :blank error message for the title attribute, it looks for these translations: * activemodel.errors.models.admin.attributes.title.blank * activemodel.errors.models.admin.blank * activemodel.errors.models.user.attributes.title.blank * activemodel.errors.models.user.blank * any default you provided through the +options+ hash (in the activemodel.errors scope) * activemodel.errors.messages.blank * errors.attributes.title.blank * errors.messages.blank", "label": 1, "domain": "code", "token_count": 300, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0102", "text": "

    Perform am URI path escape operation on a char[] input.

    The following are the only allowed chars in an URI path (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • /

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 329, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0103", "text": "Execute operations atomically (in a single database call) for everything that would happen inside the block. This method supports nesting further calls to atomically, which will behave according to the options described below. An option join_context can be given which, when true, will merge the operations declared by the given block with the atomically block wrapping the current invocation for the same document, if one exists. If this block or any other block sharing the same context raises before persisting, then all the operations of that context will not be persisted, and will also be reset in memory. When join_context is false, the given block of operations will be persisted independently of other contexts. Failures in other contexts will not affect this one, so long as this block was able to run and persist changes. The default value of join_context is set by the global configuration option join_contexts, whose own default is false. @example Execute the operations atomically. document.atomically do document.set(name: \"Tool\").inc(likes: 10) end @example Execute some inner operations atomically, but independently from the outer operations. document.atomically do document.inc likes: 10 document.atomically join_context: false do # The following is persisted to the database independently. document.unset :origin end document.atomically join_context: true do # The following is persisted along with the other outer operations. document.inc member_count: 3 end document.set name: \"Tool\" end @param [ true, false ] join_context Join the context (i.e. merge declared atomic operations) of the atomically block wrapping this one for the same document, if one exists. @return [ true, false ] If the operation succeeded. @since 4.0.0", "label": 1, "domain": "code", "token_count": 352, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0104", "text": "Parses the combined arrays from the defaultPrepareFields array and the prepareFields array (or function returning an array). The default prepared fields are: [ { name: 'view', value: 'viewState' }, 'model' ] Prepared fields can be defined in a couple of ways: preparedFields = [ 'model', { name: 'app', value: someGlobalCell }, 'a value that does not exist on the view', { name: 'view', value: 'viewState' }, { name: 'patientId', value: '_patientId' }, { name: 'calculatedValue', value: function() { return 'calculated: ' + this.viewProperty }, 'objectWithoutToJSON' ] Will result in the following context (where this === this view and it assumes all the properties on the view that are referenced are defined): { model: this.model.toJSON(), app: someGlobalCell.toJSON(), view: this.viewState.toJSON(), patientId: this._patientId, calculatedValue: 'calculated: ' + this.viewProperty, objectWithoutToJSON: this.objectWithoutToJSON } Note: alternatively, you can define your prepareFields as an object that will be mapped to an array of { name: key, value: value } Things to be careful of: * If the view already has a field named 'someGlobalCell' then the property on the view will be used instead of the global value. * if the prepared field item is not a string or object containing 'name' and 'value' properties, then an exception will be thrown. * 'model' and 'view' are reserved field names and cannot be reused. @method __getPrepareFieldsContext @return {Object} context composed of { modelName: model.toJSON() } for every model identified. @private", "label": 1, "domain": "code", "token_count": 367, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0105", "text": "/* Load the description of a sensor. In practice, it doesn't really contain anything useful. http://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request=DescribeSensor&procedureDescriptionFormat=http%3A%2F%2Fwww.opengis.net%2FsensorML%2F1.0.1&procedure=http%3A%2F%2Fbom.gov.au%2Fwaterdata%2Fservices%2Ftstypes%2FPat1_C_B_1 function loadDescription(item) { return querySos(item, { request: 'DescribeSensor', procedure: item.procedure, procedureDescriptionFormat: 'http://www.opengis.net/sensorML/1.0.1' }).then(function(sensorml) { //var description = sensormljson.description.SensorDescription.data.SensorML.member; console.log('Sensor description: ', sensorml); }); } /* Want to get more information about a location? new urijs('http://www.bom.gov.au/waterdata/services').setQuery({service:'SOS',version:'2.0',request:'GetFeatureOfInterest',featureOfInterest:'http://bom.gov.au/waterdata/services/stations/401229'}); http://www.bom.gov.au/waterdata/services?service=SOS&version=2.0&request=GetFeatureOfInterest&featureOfInterest=http%3A%2F%2Fbom.gov.au%2Fwaterdata%2Fservices%2Fstations%2F401229 Point location buried in featureMember -> MonitoringPoint -> shape -> Point Warning: some IDs don't have locations (ie http://bom.gov.au/waterdata/services/stations/system)", "label": 1, "domain": "code", "token_count": 370, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0106", "text": "

    Perform an XML 1.1 level 1 (only markup-significant chars) escape operation on a String input.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    This method calls {@link #escapeXml11(String, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 332, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0107", "text": "

    Generates a stream by taking one element of the provided streams at a time, and putting them in a substream.

    Example:

    {@code Stream stream0 = Stream.of(\"a00\", \"a01\", \"a02\", \"a03\"); Stream stream1 = Stream.of(\"a10\", \"a11\", \"a12\", \"a13\"); Stream stream2 = Stream.of(\"a20\", \"a21\", \"a22\", \"a23\"); Stream stream3 = Stream.of(\"a30\", \"a31\", \"a32\", \"a33\"); Stream> traversingStream = StreamsUtils.traverse(stream0, stream1, stream2, stream3); List> collect = traversingStream.map(st -> st.collect(Collectors.toList())).collect(Collectors.toList()); // The collect list is [[\"a00\", \"a10\", \"a20\", \"a30\"], [\"a01\", \"a11\", \"a21\", \"a31\"], [\"a02\", \"a12\", \"a22\", \"a32\"], [\"a03\", \"a13\", \"a23\", \"a33\"]] }

    An IllegalArgumentException is thrown if there is only one stream provided in the varargs. In that case, the traversing would be a mapping with Stream::of.

    An IllegalArgumentException is also thrown if one of the provided streams is not ORDERED.

    The characteristics of the returned stream is the bitwise AND of all the characteristics of the provided streams. In most of the cases, all these streams will share the same characteristics, so in this case it will be the same as well. The returned stream is thus ORDERED.

    A NullPointerException is thrown if one of the provided streams is null.

    @param streams The streams to be traversed. Will throw a NullPointerException if null. @param The type of the elements of the provided stream. @return A traversing stream of streams.", "label": 1, "domain": "code", "token_count": 473, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0108", "text": "Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.
    This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
    {@code list.subList(from, to).clear(); }
    Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.
    The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.) @param fromIndex low endpoint (inclusive) of the subList @param toIndex high endpoint (exclusive) of the subList @return a view of the specified range within this list @throws IndexOutOfBoundsException for an illegal endpoint index value (fromIndex < 0 || toIndex > size || fromIndex > toIndex)", "label": 1, "domain": "code", "token_count": 382, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0109", "text": "Gets the container logs for container deployed on a Service Fabric node. Gets the container logs for container deployed on a Service Fabric node for the given code package. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_manifest_name [String] The name of a service manifest registered as part of an application type in a Service Fabric cluster. @param code_package_name [String] The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. @param tail [String] Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. @param previous [Boolean] Specifies whether to get container logs from exited/dead containers of the code package instance. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 336, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0110", "text": "Cria um novo direito de um grupo de usuário em um grupo de equipamento e retorna o seu identificador. :param id_grupo_usuario: Identificador do grupo de usuário. :param id_grupo_equipamento: Identificador do grupo de equipamento. :param leitura: Indicação de permissão de leitura ('0' ou '1'). :param escrita: Indicação de permissão de escrita ('0' ou '1'). :param alterar_config: Indicação de permissão de alterar_config ('0' ou '1'). :param exclusao: Indicação de permissão de exclusão ('0' ou '1'). :return: Dicionário com a seguinte estrutura: {'direito_grupo_equipamento': {'id': < id>}} :raise InvalidParameterError: Pelo menos um dos parâmetros é nulo ou inválido. :raise GrupoEquipamentoNaoExisteError: Grupo de Equipamento não cadastrado. :raise GrupoUsuarioNaoExisteError: Grupo de Usuário não cadastrado. :raise ValorIndicacaoDireitoInvalidoError: Valor de leitura, escrita, alterar_config e/ou exclusão inválido. :raise DireitoGrupoEquipamentoDuplicadoError: Já existe direitos cadastrados para o grupo de usuário e grupo de equipamento informados. :raise DataBaseError: Falha na networkapi ao acessar o banco de dados. :raise XMLError: Falha na networkapi ao ler o XML de requisição ou gerar o XML de resposta.", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0111", "text": "Sends a health report on the Service Fabric cluster. Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. The report is sent to a Service Fabric gateway node, which forwards to the health store. The report may be accepted by the gateway, but rejected by the health store after extra validation. For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. @param health_information [HealthInformation] Describes the health information for the health report. This information needs to be present in all of the health reports sent to the health manager. @param immediate [Boolean] A flag which indicates whether the report should be sent immediately. A health report is sent to a Service Fabric gateway Application, which forwards to the health store. If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, regardless of the fabric client settings that the HTTP Gateway Application is using. This is useful for critical reports that should be sent as soon as possible. Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway is closed or the message doesn't reach the Gateway. If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. Therefore, it will be batched according to the HealthReportSendInterval configuration. This is the recommended setting because it allows the health client to optimize health reporting messages to health store as well as health report processing. By default, reports are not sent immediately. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 442, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0112", "text": "Initializes a Request object. @param [Hash] options the options for the request. @option options [String, Symbol] :method (:get) The HTTP method to use. @option options [Class] :expected_response (Net::HTTPSuccess) The class of response that the request should obtain when run. @option options [String, Symbol] :response_format (:json) The expected format of the response body. If passed, the response body will be parsed according to the format before being returned. @option options [String] :host The host component of the request URI. @option options [String] :path The path component of the request URI. @option options [Hash] :params ({}) The params to use as the query component of the request URI, for instance the Hash +{a: 1, b: 2}+ corresponds to the query parameters \"a=1&b=2\". @option options [Hash] :camelize_params (true) whether to transform each key of params into a camel-case symbol before sending the request. @option options [Hash] :request_format (:json) The format of the request body. If a request body is passed, it will be parsed according to this format before sending it in the request. @option options [#size] :body The body component of the request. @option options [Hash] :headers ({}) The headers component of the request. @option options [#access_token, #refreshed_access_token?] :auth The authentication object. If set, must respond to +access_token+ and return the OAuth token to make an authenticated request, and must respond to +refreshed_access_token?+ and return whether the access token can be refreshed if expired. Sends the request and returns the response. If the request fails once for a temporary server error or an expired token, tries the request again before eventually raising an error. @return [Net::HTTPResponse] if the request succeeds and matches the expectations, the response with the body appropriately parsed. @raise [Yt::RequestError] if the request fails or the response does not match the expectations.", "label": 1, "domain": "code", "token_count": 435, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0113", "text": "

    Perform am URI fragment identifier escape operation on a char[] input.

    The following are the only allowed chars in an URI fragment identifier (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 332, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0114", "text": "Function takes devip ( ipv4 address ), ifIndex and pvid (vlanid) of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the specified VLAN from the target device. :param ifindex: str value of ifIndex for a specific interface on the device :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param devid: str requires devid of the target device :param devip: str of ipv4 address of the target device :return: int of 204 if successful or 409 if not succesful :rtype: int >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.vlanm import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> delete_hybrid_interface('9', auth.creds, auth.url, devip='10.101.0.221') 409 >>> add_hybrid = add_hybrid_interface('9', '1', '10', '1', auth.creds, auth.url, devip='10.101.0.221') >>> delete_hybrid = delete_hybrid_interface('9', auth.creds, auth.url, devip='10.101.0.221') >>> assert type(delete_hybrid) is int >>> assert delete_hybrid == 204", "label": 1, "domain": "code", "token_count": 321, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0115", "text": "List your issues List all issues across all the authenticated user’s visible repositories including owned repositories, member repositories, and organization repositories. @example github = Github.new oauth_token: '...' github.issues.list List all issues across owned and member repositories for the authenticated user. @example github = Github.new oauth_token: '...' github.issues.list :user List all issues for a given organization for the authenticated user. @example github = Github.new oauth_token: '...' github.issues.list org: 'org-name' List issues for a repository @example github = Github.new github.issues.list user: 'user-name', repo: 'repo-name' @param [Hash] params @option params [String] :filter * assigned Issues assigned to you (default) * created Issues created by you * mentioned Issues mentioning you * subscribed Issues you've subscribed to updates for * all All issues the user can see @option params [String] :milestone * Integer Milestone number * none for Issues with no Milestone. * * for Issues with any Milestone @option params [String] :state open, closed, default: open @option params [String] :labels String list of comma separated Label names. Example: bug,ui,@high @option params [String] :assignee * String User login * none for Issues with no assigned User. * * for Issues with any assigned User. @option params [String] :creator String User login @option params [String] :mentioned String User login @option params [String] :sort created, updated, comments, default: created @option params [String] :direction asc, desc, default: desc @option params [String] :since Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ @example github = Github.new oauth_token: '...' github.issues.list since: '2011-04-12T12:12:12Z', filter: 'created', state: 'open', labels: \"bug,ui,bla\", sort: 'comments', direction: 'asc' @api public", "label": 1, "domain": "code", "token_count": 445, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0116", "text": "Lists the usage details based on enrollmentAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later. @param enrollment_account_id [String] EnrollmentAccount ID @param billing_period_name [String] Billing Period Name. @param expand [String] May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. @param filter [String] May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the most recent N usageDetails. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [UsageDetailsListResult] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 335, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0117", "text": "

    Generates a stream composed of the N greatest values of the provided stream, compared using the provided comparator. If there are no duplicates in the provided stream, then the returned stream will have N values, assuming that the input stream has more than N values.

    All the duplicates are copied in the returned stream, so in this case the number of elements in the returned stream may be greater than N. In this case, the number of different values is not guaranteed, and may be lesser than N.

    Since this operator extract maxes according to the provided comparator, the result is sorted from the greatest element to the smallest, thus in the decreasing order, according to the provided comparator.

    The provided implementation uses and insertion buffer of size N to keep the N maxes, as well as a hash map to keep the duplicates. This implementation becomes less and less efficient as N grows.

    A NullPointerException will be thrown if the provided stream or the comparator is null.

    An IllegalArgumentException is thrown if N is lesser than 1.

    @param stream the processed stream @param numberOfMaxes the number of different max values that should be returned. Note that the total number of values returned may be larger if there are duplicates in the stream @param comparator the comparator used to compare the elements of the stream @param the type of the provided stream @return the filtered stream", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0118", "text": "A full implementation of Dave Green's \"cubehelix\" for Matplotlib. Based on the FORTRAN 77 code provided in D.A. Green, 2011, BASI, 39, 289. http://adsabs.harvard.edu/abs/2011arXiv1108.5083G User can adjust all parameters of the cubehelix algorithm. This enables much greater flexibility in choosing color maps, while always ensuring the color map scales in intensity from black to white. A few simple examples: Default color map settings produce the standard \"cubehelix\". Create color map in only blues by setting rot=0 and start=0. Create reverse (white to black) backwards through the rainbow once by setting rot=1 and reverse=True. Parameters ---------- start : scalar, optional Sets the starting position in the color space. 0=blue, 1=red, 2=green. Defaults to 0.5. rot : scalar, optional The number of rotations through the rainbow. Can be positive or negative, indicating direction of rainbow. Negative values correspond to Blue->Red direction. Defaults to -1.5 gamma : scalar, optional The gamma correction for intensity. Defaults to 1.0 reverse : boolean, optional Set to True to reverse the color map. Will go from black to white. Good for density plots where shade~density. Defaults to False nlev : scalar, optional Defines the number of discrete levels to render colors at. Defaults to 256. sat : scalar, optional The saturation intensity factor. Defaults to 1.2 NOTE: this was formerly known as \"hue\" parameter minSat : scalar, optional Sets the minimum-level saturation. Defaults to 1.2 maxSat : scalar, optional Sets the maximum-level saturation. Defaults to 1.2 startHue : scalar, optional Sets the starting color, ranging from [0, 360], as in D3 version by @mbostock NOTE: overrides values in start parameter endHue : scalar, optional Sets the ending color, ranging from [0, 360], as in D3 version by @mbostock NOTE: overrides values in rot parameter minLight : scalar, optional Sets the minimum lightness value. Defaults to 0. maxLight : scalar, optional Sets the maximum lightness value. Defaults to 1. Returns ------- data : ndarray, shape (N, 3) Control points.", "label": 1, "domain": "code", "token_count": 495, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0119", "text": "Create a hook @see https://developer.github.com/v3/orgs/hooks/#create-a-hook @param [Hash] params @input params [String] :name Required. The name of the service that is being called. @input params [Hash] :config Required. Key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repository. Booleans are stored internally as \"1\" for true, and \"0\" for false. Any JSON true/false values will be converted automatically. @input params [Array] :events Determines what events the hook is triggered for. Default: [\"push\"] @input params [Boolean] :active Determines whether the hook is actually triggered on pushes. To create a webhook, the following fields are required by the config: @input config [String] :url A required string defining the URL to which the payloads will be delivered. @input config [String] :content_type An optional string defining the media type used to serialize the payloads. Supported values include json and form. The default is form. @input config [String] :secret An optional string that’s passed with the HTTP requests as an X-Hub-Signature header. The value of this header is computed as the HMAC hex digest of the body, using the secret as the key. @input config [String] :insecure_ssl An optional string that determines whether the SSL certificate of the host for url will be verified when delivering payloads. Supported values include \"0\" (verification is performed) and \"1\" (verification is not performed). The default is \"0\".or instance, if the library doesn't get updated to permit a given parameter the api call won't work, however if we skip permission all together, the endpoint should always work provided the actual resource path doesn't change. I'm in the process of completely removing the permit functionality. @example github = Github.new github.orgs.hooks.create 'org-name', name: \"web\", active: true, config: { url: \"http://something.com/webhook\" } } @api public", "label": 1, "domain": "code", "token_count": 427, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0120", "text": "Type2 corresponds to 32x32 images of left facing triangles (<). 1) Dump one line of 32 pixels at the time. - The illustration below tells if a pixel is transparent or regular. - Only regular and zero (transparent) pixels are explicitly stored in the frame content. All other pixels of the illustration are implicitly transparent. Below is an illustration of the 32x32 image, where a space represents an implicit transparent pixel, a '0' represents an explicit transparent pixel and an 'x' represents an explicit regular pixel. Note: The output image will be \"upside-down\" compared to the illustration. +--------------------------------+ | | | 00xx| | xxxx| | 00xxxxxx| | xxxxxxxx| | 00xxxxxxxxxx| | xxxxxxxxxxxx| | 00xxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxx| | 00xxxxxxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxxxxxx| | 00xxxxxxxxxxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxxxxxxxxxx| | 00xxxxxxxxxxxxxxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxxxxxxxxxxxxxx| |00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| |00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxxxxxxxxxxxxxx| | 00xxxxxxxxxxxxxxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxxxxxxxxxx| | 00xxxxxxxxxxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxxxxxx| | 00xxxxxxxxxxxxxxxxxx| | xxxxxxxxxxxxxxxx| | 00xxxxxxxxxxxxxx| | xxxxxxxxxxxx| | 00xxxxxxxxxx| | xxxxxxxx| | 00xxxxxx| | xxxx| | 00xx| +--------------------------------+", "label": 1, "domain": "code", "token_count": 329, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0121", "text": "Lists a collection of the operations for the specified API. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param api_id [String] API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. @param filter [String] | Field | Usage | Supported operators | Supported functions |
    |-------------|-------------|-------------|-------------|
    | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
    | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
    | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
    | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
    | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
    @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param tags [String] Include tags in the response. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0122", "text": "Sends a successful response. Parameters that can be used depends on the event handled as described in the following table:
    • init: success()
    • getItemData: success([{distinctSnapLen: <distinct snapshot length>, minSourceFreq: <min source frequency>, allowedModes: {raw: <raw allowed>, merge: <merge allowed>, distinct: <distinct allowed>, command: <command allowed>}}, ...])
    • getUserItemData: success([{allowedBufferSize: <allowed buffer size>, allowedMaxItemFreq: <allowed max item frequency>}, allowedModes: {raw: <raw allowed for user>, merge: <merge allowed for user>, distinct: <distinct allowed for user>, command: <command allowed for user>}}, ...])
    • getSchema: success([<field 1>, <field 2>, ...])
    • getItems: success([<item 1>, <item 2>, ...])
    • notifyUser: success(<allowed max bandwidth>, <wants table notifications>)
    • notifyUserAuth: success(<allowed max bandwidth>, <wants table notifications>)
    • notifyUserMessage: success()
    • notifyNewSession: success()
    • notifySessionClose: success()
    • notifyNewTables: success()
    • notifyTablesClose: success()
    • notifyMpnDeviceAccess: success()
    • notifyMpnSubscriptionActivation: success()
    • notifyMpnDeviceTokenChange: success()
    ", "label": 1, "domain": "code", "token_count": 411, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0123", "text": "List all existing large person groups’ largePersonGroupId, name, userData and recognitionModel.
    * Large person groups are stored in alphabetical order of largePersonGroupId. * \"start\" parameter (string, optional) is a user-provided largePersonGroupId value that returned entries have larger ids by string comparison. \"start\" set to empty to indicate return from the first item. * \"top\" parameter (int, optional) specifies the number of entries to return. A maximal of 1000 entries can be returned in one call. To fetch more, you can specify \"start\" with the last returned entry’s Id of the current call.
    For example, total 5 large person groups: \"group1\", ..., \"group5\".
    \"start=&top=\" will return all 5 groups.
    \"start=&top=2\" will return \"group1\", \"group2\".
    \"start=group2&top=3\" will return \"group3\", \"group4\", \"group5\". @param start [String] List large person groups from the least largePersonGroupId greater than the \"start\". @param top [Integer] The number of large person groups to list. @param return_recognition_model [Boolean] A value indicating whether the operation should return 'recognitionModel' in response. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0124", "text": "Removes a service replica running on a node. This API simulates a Service Fabric replica failure by removing a replica from a Service Fabric cluster. The removal closes the replica, transitions the replica to the role None, and then removes all of the state information of the replica from the cluster. This API tests the replica state removal path, and simulates the report fault permanent path through client APIs. Warning - There are no safety checks performed when this API is used. Incorrect use of this API can lead to data loss for stateful services.In addition, the forceRemove flag impacts all other replicas hosted in the same process. @param node_name [String] The name of the node. @param partition_id The identity of the partition. @param replica_id [String] The identifier of the replica. @param force_remove [Boolean] Remove a Service Fabric application or service forcefully without going through the graceful shutdown sequence. This parameter can be used to forcefully delete an application or service for which delete is timing out due to issues in the service code that prevents graceful close of replicas. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 302, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0125", "text": "Creates a signature of a text crypto.sign text, options Must have the appropiate key to be able to decrypt, of course. Returns a {GPGME::Data} object which can then be read. @param text The object that will be signed. Must be something that can be converted to {GPGME::Data}. @param [Hash] options Optional parameters. * +:signer+ sign identifier to sign the text with. Will use the first key it finds if none specified. * +:output+ if specified, it will write the output into it. It will be converted to a {GPGME::Data} object, so it could be a file for example. * +:mode+ Desired type of signature. Options are: - +GPGME::SIG_MODE_NORMAL+ for a normal signature. The default one if not specified. - +GPGME::SIG_MODE_DETACH+ for a detached signature - +GPGME::SIG_MODE_CLEAR+ for a cleartext signature * Any other option accepted by {GPGME::Ctx.new} @return [GPGME::Data] a {GPGME::Data} that can be read. @example normal sign crypto.sign \"Hi there\" @example outputing to a file file = File.open(\"text.sign\", \"w+\") crypto.sign \"Hi there\", :options => file @example doing a detached signature crypto.sign \"Hi there\", :mode => GPGME::SIG_MODE_DETACH @example specifying the signer crypto.sign \"Hi there\", :signer => \"mrsimo@example.com\" @raise [GPGME::Error::UnusableSecretKey] TODO don't know when", "label": 1, "domain": "code", "token_count": 346, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0126", "text": "/* @protected @returns /* currently not needed isThemeBackgroundImageModified: function() { var Parameters = sap.ui.requireSync(\"sap/ui/core/theming/Parameters\"); var sBgImgUrl = Parameters.get('sapUiGlobalBackgroundImage'); // the global background image from the theme if (sBgImgUrl && sBgImgUrl !== \"''\") { var sBgImgUrlDefault = Parameters.get('sapUiGlobalBackgroundImageDefault'); if (sBgImgUrl !== sBgImgUrlDefault) { return true; } } return false; }, Renders an HTML tag into the given RenderManager which carries the background image which is either configured and given or coming from the current theme. Should be called right after the opening root tag has been completed, so this is the first child element inside the control. @param {sap.ui.core.RenderManager} rm The RenderManager @param {sap.ui.core.Control} oControl Control within which the tag will be rendered; its ID will be used to generate the element ID @param {string|string[]} vCssClass A CSS class or an array of CSS classes to add to the element @param {sap.ui.core.URI} [sBgImgUrl] The image of a configured background image; if this is not given, the theme background will be used and also the other settings are ignored. @param {boolean} [bRepeat] Whether the background image should be repeated/tiled (or stretched) @param {float} [fOpacity] The background image opacity, if any @protected", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0127", "text": "Gets the list of backups available for the specified backed up entity at the specified backup location. Gets the list of backups available for the specified backed up entity (Application, Service or Partition) at the specified backup location (FileShare or Azure Blob Storage). @param get_backup_by_storage_query_description [GetBackupByStorageQueryDescription] Describes the filters and backup storage details to be used for enumerating backups. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 358, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0128", "text": "Clear inline style properties from elements. @param {(string|Array|NodeList|HTMLCollection|HTMLElement)} elements - The iterable, selector or elements. @param {...string} props - The style properties to clear. @return {Array} iterable - The getElements' result for chaining. @example //esnext import { createElement, setStyle, clearStyle } from 'chirashi' const maki = createElement('a.cheese.maki') setStyleProp(maki, { position: 'absolute', top: 10, width: 200, height: 200, background: 'red' }) // returns: [] clearStyle(maki, 'width', 'height', 'background') // returns: [] @example //es5 var maki = Chirashi.createElement('a.cheese.maki') Chirashi.setStyleProp(maki, { position: 'absolute', top: 10, width: 200, height: 200, background: 'red' }) // returns: [] Chirashi.clearStyle(maki, 'width', 'height', 'background') // returns: []", "label": 1, "domain": "code", "token_count": 359, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0129", "text": "Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later. @param billing_period_name [String] Billing Period Name. @param expand [String] May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. @param filter [String] May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the most recent N usageDetails. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [UsageDetailsListResult] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 320, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0130", "text": "/*[deutsch]

    Erzeugt eine neue Zeitspanne als Vereinigung dieser und der angegebenen Zeitspanne, wobei Beträge zu gleichen Zeiteinheiten addiert werden.

    Das Listenergebnis dieser Methode kann in der Zeitarithmetik wie folgt genutzt werden:

     Duration<CalendarUnit> dateDur = Duration.ofCalendarUnits(2, 7, 10); Duration<ClockUnit> timeDur = Duration.ofClockUnits(0, 30, 0); PlainTimestamp tsp = PlainTimestamp.of(2014, 1, 1, 0, 0); for (Duration<?> dur : Duration.ofZero().plus(dateDur).union(timeDur)) { tsp = tsp.plus(dur); } System.out.println(tsp); // 2016-08-11T00:30 

    Zu beachten: Dieses Beispiel funktioniert sogar, wenn beide Dauer-Objekte wegen gemischter Vorzeichen nicht zusammengeführt werden können. Stattdessen werden dann diese Dauer und die angegebene Zeitspanne Schritt für Schritt innerhalb der Schleife zum Zeitstempel aufaddiert. Anders als in {@code plus(TimeSpan)} versucht Time4J hier nicht, im Fall gemischter Vorzeichen mit Hilfe einer Normalisierung ein eindeutiges Vorzeichen herzustellen.

    @param timespan other time span this duration is to be merged with @return unmodifiable list with one new merged duration or two unmerged durations in case of mixed signs @throws IllegalArgumentException if different units of same length exist @throws ArithmeticException in case of long overflow @see #plus(TimeSpan)", "label": 1, "domain": "code", "token_count": 396, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0131", "text": "

    Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) escape operation on a String input.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    This method calls {@link #escapeXml11(String, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 426, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0132", "text": "function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optional Name input will return only the specified view. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param name: string containg the name of the desired custom view :param upperview: str contraining the name of the desired parent custom view :return: str of creation results ( \"view \" + name + \"created successfully\" :rtype: str >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.groups import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") #Create L1 custom view >>> create_custom_views(auth.creds, auth.url, name='L1 View') 'View L1 View created successfully' >>> view_1 =get_custom_views( auth.creds, auth.url, name = 'L1 View') >>> assert type(view_1) is list >>> assert view_1[0]['name'] == 'L1 View' #Create Nested custome view >>> create_custom_views(auth.creds, auth.url, name='L2 View', upperview='L1 View') 'View L2 View created successfully' >>> view_2 = get_custom_views( auth.creds, auth.url, name = 'L2 View') >>> assert type(view_2) is list >>> assert view_2[0]['name'] == 'L2 View'", "label": 1, "domain": "code", "token_count": 346, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0133", "text": "Returns the next time that this cron line is supposed to 'fire' This is raw, 3 secs to iterate over 1 year on my macbook :( brutal. (Well, I was wrong, takes 0.001 sec on 1.8.7 and 1.9.1) This method accepts an optional Time parameter. It's the starting point for the 'search'. By default, it's Time.now Note that the time instance returned will be in the same time zone that the given start point Time (thus a result in the local time zone will be passed if no start time is specified (search start time set to Time.now)) Rufus::Scheduler::CronLine.new('30 7 * * *').next_time( Time.mktime(2008, 10, 24, 7, 29)) #=> Fri Oct 24 07:30:00 -0500 2008 Rufus::Scheduler::CronLine.new('30 7 * * *').next_time( Time.utc(2008, 10, 24, 7, 29)) #=> Fri Oct 24 07:30:00 UTC 2008 Rufus::Scheduler::CronLine.new('30 7 * * *').next_time( Time.utc(2008, 10, 24, 7, 29)).localtime #=> Fri Oct 24 02:30:00 -0500 2008 (Thanks to K Liu for the note and the examples)", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0134", "text": "Calculates the information based similarity of two time series x and y. Parameters ---------- x list a time series y list a time series n integer word order Returns ---------- IBS float Information based similarity Notes ---------- Information based similarity is a measure of dissimilarity between two time series. Let the sequences be x and y. Each sequence is first replaced by its first ordered difference(Encoder). Calculating the Heaviside of the resulting sequences, we get two binary sequences, SymbolicSeq. Using PyEEG function, embed_seq, with lag of 1 and dimension of n, we build an embedding matrix from the latter sequence. Each row of this embedding matrix is called a word. Information based similarity measures the distance between two sequence by comparing the rank of words in the sequences; more explicitly, the distance, D, is calculated using the formula: \"1/2^(n-1) * sum( abs(Rank(0)(k)-R(1)(k)) * F(k) )\" where Rank(0)(k) and Rank(1)(k) are the rank of the k-th word in each of the input sequences. F(k) is a modified \"shannon\" weighing function that increases the weight of each word in the calculations when they are more frequent in the sequences. It is advisable to calculate IBS for numerical sequences using 8-tupple words. References ---------- Yang AC, Hseu SS, Yien HW, Goldberger AL, Peng CK: Linguistic analysis of the human heartbeat using frequency and rank order statistics. Phys Rev Lett 2003, 90: 108103 Examples ---------- >>> import pyeeg >>> from numpy.random import randn >>> x = randn(100) >>> y = randn(100) >>> pyeeg.information_based_similarity(x,y,8) 0.64512947848249214", "label": 1, "domain": "code", "token_count": 380, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0135", "text": "Creates XY quad Buffers The default with no parameters will return a 2x2 quad with values from -1 to +1. If you want a unit quad with that goes from 0 to 1 you'd call it with twgl.primitives.createXYQuadBufferInfo(gl, 1, 0.5, 0.5); If you want a unit quad centered above 0,0 you'd call it with twgl.primitives.createXYQuadBufferInfo(gl, 1, 0, 0.5); @param {WebGLRenderingContext} gl The WebGLRenderingContext. @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 @param {number} [xOffset] the amount to offset the quad in X @param {number} [yOffset] the amount to offset the quad in Y @return {module:twgl.BufferInfo} the created XY Quad buffers @memberOf module:twgl/primitives @function createXYQuadBuffers Creates XY quad vertices The default with no parameters will return a 2x2 quad with values from -1 to +1. If you want a unit quad with that goes from 0 to 1 you'd call it with twgl.primitives.createXYQuadVertices(1, 0.5, 0.5); If you want a unit quad centered above 0,0 you'd call it with twgl.primitives.createXYQuadVertices(1, 0, 0.5); @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 @param {number} [xOffset] the amount to offset the quad in X @param {number} [yOffset] the amount to offset the quad in Y @return {Object.} the created XY Quad vertices @memberOf module:twgl/primitives", "label": 1, "domain": "code", "token_count": 403, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0136", "text": "This method creates an X509v3 certificate based on an an existing certificate. It attempts to create as faithful a copy of the existing certificate as possible by duplicating all certificate extensions. If you are testing an application that makes use of additional certificate extensions (e.g. logotype, S/MIME capabilities) this method will preserve those fields. You may optionally include a set of OIDs not to copy from the original certificate. The most common reason to do this would be to remove fields that would cause inconsistency, such as Authority Info Access or Issuer Alternative Name where these are not defined for the MITM authority certificate. OIDs 2.5.29.14 : Subject Key Identifier and 2.5.29.35 : Authority Key Identifier, are never copied, but generated directly based on the input keys and certificates. You may also optionally include maps of custom extensions which will be added to or replace extensions with the same OID on the original certificate for the the MITM certificate. FUTURE WORK: JDK 1.5 is very strict in parsing extensions. In particular, known extensions that include URIs must parse to valid URIs (including URL encoding all non-valid URI characters) or the extension will be rejected and not available to copy to the MITM certificate. Will need to directly extract these as ASN.1 fields and re-insert (hopefully BouncyCastle will handle them) @param originalCert The original certificate to duplicate. @param newPubKey The new public key for the MITM certificate. @param caCert The certificate of the signing authority fot the MITM certificate. @param caPrivateKey The private key of the signing authority. @param extensionOidsNotToCopy An optional list of certificate extension OIDs not to copy to the MITM certificate. @return The new MITM certificate. @throws CertificateParsingException @throws SignatureException @throws InvalidKeyException @throws CertificateExpiredException @throws CertificateNotYetValidException @throws CertificateException @throws NoSuchAlgorithmException @throws NoSuchProviderException", "label": 1, "domain": "code", "token_count": 406, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0137", "text": "/*[deutsch]

    Addiert den angegebenen Betrag der entsprechenden Zeiteinheit zu dieser Bezugszeit und liefert das Additionsergebnis zurück.

    Ähnlich wie {@link #plus(TimeSpan)}, aber mit dem Unterschied, daß die Zeitspanne in nur einer Zeiteinheit angegeben wird. Beispiel in Pseudo-Code:

    • [2011-05-31].plus(1, <MONTHS>) = [2011-06-30]
    • [2011-05-31].plus(4, <DAYS>) = [2011-06-04]
    • [2011-06-04].plus(-4, <DAYS>) = [2011-05-31]
    • [2010-04-29].plus(397, <DAYS>) = [2011-05-31]
    • [2010-04-29].plus(13, <MONTHS>) = [2011-05-29]
    • [2010-04-29].plus(-2, <MONTHS>) = [2010-02-28]
    • [2010-04-29].plus(1, <YEARS>) = [2011-04-29]
    @param amount amount to be added (maybe negative) @param unit time unit @return result of addition as changed copy, this instance remains unaffected @throws RuleNotFoundException if given time unit is not registered and does also not implement {@link BasicUnit} to yield a suitable unit rule for the underlying time axis @throws ArithmeticException in case of numerical overflow @see #plus(TimeSpan)", "label": 1, "domain": "code", "token_count": 401, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0138", "text": "Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. @param resource_group_name [String] The name of the Azure resource group that contains the Data Lake Analytics account. @param account_name [String] The name of the Data Lake Analytics account for which to list Data Lake Store accounts. @param filter [String] OData filter. Optional. @param top [Integer] The number of items to return. Optional. @param skip [Integer] The number of items to skip over before returning elements. Optional. @param expand [String] OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. @param select [String] OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. @param orderby [String] OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. @param count [Boolean] The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. @param search [String] A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. @param format [String] The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 414, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0139", "text": "/* jshint ignore:start Initialize preview domain @constructor Twilio.Preview @property {Twilio.Preview.BulkExports} bulk_exports - bulk_exports version @property {Twilio.Preview.DeployedDevices} deployed_devices - deployed_devices version @property {Twilio.Preview.HostedNumbers} hosted_numbers - hosted_numbers version @property {Twilio.Preview.Marketplace} marketplace - marketplace version @property {Twilio.Preview.AccSecurity} acc_security - acc_security version @property {Twilio.Preview.Sync} sync - sync version @property {Twilio.Preview.Understand} understand - understand version @property {Twilio.Preview.Wireless} wireless - wireless version @property {Twilio.Preview.BulkExports.ExportList} exports - exports resource @property {Twilio.Preview.BulkExports.ExportConfigurationList} exportConfiguration - exportConfiguration resource @property {Twilio.Preview.DeployedDevices.FleetList} fleets - fleets resource @property {Twilio.Preview.HostedNumbers.AuthorizationDocumentList} authorizationDocuments - authorizationDocuments resource @property {Twilio.Preview.HostedNumbers.HostedNumberOrderList} hostedNumberOrders - hostedNumberOrders resource @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns - installedAddOns resource @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns - availableAddOns resource @property {Twilio.Preview.Sync.ServiceList} services - services resource @property {Twilio.Preview.Understand.AssistantList} assistants - assistants resource @property {Twilio.Preview.Wireless.CommandList} commands - commands resource @property {Twilio.Preview.Wireless.RatePlanList} ratePlans - ratePlans resource @property {Twilio.Preview.Wireless.SimList} sims - sims resource @param {Twilio} twilio - The twilio client /* jshint ignore:end", "label": 1, "domain": "code", "token_count": 399, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0140", "text": "Registers a configuration backed by the Configuration Admin. When this method is called, a {@link Proxy} object is created based on the {@code type} provided to the method. The configuration is automatically registered as a {@link org.osgi.service.cm.ManagedService} and {@link org.osgi.service.metatype.MetaTypeProvider}. The configuration can also be created with a Defaults object. In order to create a Defaults object, implement the Interface provided by {@code type} and supplying an instance of that class to {@code defaults}. {@code defaults} may be null. * Example: SomeInterface properties = ManagedPropertiesFactory.register(SomeInterface.class, new SomeInterfaceImpl(), context); @param The return type ofs the configuration. @param The return type of the default. @param type The type of configuration to create. The type of interface must be be annotated by {@link dk.netdesign.common.osgi.config.annotation.Property}, and each parameter must be annotated by {@link dk.netdesign.common.osgi.config.annotation.PropertyDefinition} @param defaults The defaults object to create. When a configuration item is not found in the Configuration Admin, the defaults method is called. @return A proxy representing a Configuration Admin configuration. @throws InvalidTypeException If a method/configuration item mapping uses an invalid type. @throws TypeFilterException If a method/configuration item mapping uses an invalid TypeMapper. @throws DoubleIDException If a method/configuration item mapping uses an ID that is already defined. @throws InvalidMethodException If a method/configuration violates any restriction not defined in the other exceptions.", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0141", "text": "Expands a text markup by resolving embedded parameters and references to other text markups, with the help of a companion open object.

    A reference pointing to another markup in the resources is marked up as {@code {PREFIX@MARKUP(ARGS):MEMBER:ALTERN(ARGS)@SUFFIX}}, where

    • {@code PREFIX} and {@code SUFFIX} are optional pieces of text to be placed before and after the markup insertion.
    • {@code MARKUP} is a required element, which gives the name of the markup to be expanded recursively.
    • {@code MEMBER} gives the name of the data member within the companion object to be used as the companion object for the recursive expansion of the markup. If this name is \"-\", the current companion object is reused instead. If omitted, the value of {@code MARKUP} is used as this name.
    • {@code ALTERN} is an optional element, which gives the name of an alternative markup in the case the data member has no value.
    • {@code (ARGS)} is an optional list of positional arguments to be passed to the markup, which refers to such arguments using positional argument parameters {@code {1}}, {@code {2}}, etc.
    @param resources a collection of named text resources @param name the name of the text markup to be expanded @param object an object providing values to the parameters, which will be wrapped if not an open object already @throws IllegalArgumentException if any reference to a text markup cannot be resolved @throws NullPointerException if any reference to a data member cannot be resolved and the data member is required in the subsequence markup expansion @return the fully expanded text", "label": 1, "domain": "code", "token_count": 355, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0142", "text": "Creates a new file explorer. @name orion.explorer.FileExplorer @class A user interface component that displays a table-oriented file explorer @extends orion.explorer.Explorer @param {Object} options.treeRoot an Object representing the root of the tree. @param {orion.selection.Selection} options.selection the selection service used to track selections. @param {orion.fileClient.FileClient} options.fileClient the file service used to retrieve file information @param {String|Element} options.parentId the id of the parent DOM element, or the parent DOM element itself. @param {Function} options.rendererFactory a factory that creates a renderer @param {Boolean} options.excludeFiles specifies that files should not be shown. Optional. @param {Boolean} options.excludeFolders specifies that folders should not be shown. Optional. @param {Object} [options.navHandlerFactory] Optional factory to use for creating the explorer's nav handler. Must provide a function createNavHandler(explorer, explorerNavDict, options). @param {orion.serviceregistry.ServiceRegistry} options.serviceRegistry the service registry to use for retrieving other Orion services. Optional. If not specified, then some features of the explorer will not be enabled, such as status reporting, honoring preference settings, etc. @param {Boolean} [options.setFocus=true] Whether the explorer should steal keyboard focus when rendered. The default is to steal focus. Root model item of the tree. @name orion.explorer.FileExplorer#treeRoot @field @type Object Dispatches events describing model changes. @name orion.explorer.FileExplorer#modelEventDispatcher @type orion.EventTarget Handles model changes. @name orion.explorer.FileExplorer#modelHandler @type orion.explorer.FileExplorer.ModelHandler", "label": 1, "domain": "code", "token_count": 364, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0143", "text": "Lists a collection of operations associated with tags. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param api_id [String] API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. @param filter [String] | Field | Supported operators | Supported functions | |-------------|------------------------|---------------------------------------------| | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 324, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0144", "text": "Builds the mesh information into a {@link com.flowpowered.caustic.api.data.VertexData} which can then be uploaded and rendered. The {@code sizes} parameter is used to control which information to use and generate. The component represents the number of float components per vertex for the attribute.

    The position are added if the x component of {@code sizes} is non zero and list isn't null.

    The normals are added if the y component of {@code sizes} is non zero and the list isn't null. If the list is null but the component is non zero, they are generated based on the position information if it's available (the list is not null) and then added. If the y component is zero, they are ignored. See {@link #generateNormals(gnu.trove.list.TFloatList, gnu.trove.list.TIntList, gnu.trove.list.TFloatList)}.

    The texture coordinates are added if the z component of {@code sizes} is non zero and list isn't null.

    Tangents are generated from all the previous information if it's available (lists are not null) and the w component of {@code sizes} is non zero. See {@link #generateTangents(gnu.trove.list.TFloatList, gnu.trove.list.TFloatList, gnu.trove.list.TFloatList, gnu.trove.list.TIntList, gnu.trove.list.TFloatList)}.

    Indices are always added and are required. @param sizes Each component represents the number of float components per vertex for the attribute, with x for positions, y for normals, z for texture coords, and w for tangents @param positions The list of position data @param normals The list of normal data @param textureCoords The list of texture coordinate data @param indices The list of indices @return The vertex data", "label": 1, "domain": "code", "token_count": 388, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0145", "text": "Get extra metadata tagged with a registry keyword. For example: ", "label": 1, "domain": "code", "token_count": 382, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0146", "text": "Creates a new FileService object. If no connection string or storageaccount and storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING or AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used. @class The FileService class is used to perform operations on the Microsoft Azure File Service. The File Service provides storage for binary large objects, and provides functions for working with data stored in files. For more information on the File Service, as well as task focused information on using it in a Node.js application, see [How to Use the File Service from Node.js](http://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-how-to-use-file-storage/). The following defaults can be set on the file service. defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the file service. defaultEnableReuseSocket The default boolean value to enable socket reuse when uploading local files or streams. If the Node.js version is lower than 0.10.x, socket reuse will always be turned off. defaultClientRequestTimeoutInMs The default timeout of client requests, in milliseconds, to use for the request made via the file service. defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the file service. defaultLocationMode The default location mode for requests made via the file service. parallelOperationThreadCount The number of parallel operations that may be performed when uploading a file. useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the file service; true to use the Nagle algorithm; otherwise, false. The default value is false. enableGlobalHttpAgent Determines whether global HTTP(s) agent is enabled; true to use Global HTTP(s) agent; otherwise, false to use http(s).Agent({keepAlive:true}). @constructor @extends {StorageServiceClient} @param {string} [storageAccountOrConnectionString] The storage account or the connection string. @param {string} [storageAccessKey] The storage access key. @param {string|object} [host] The host address. To define primary only, pass a string. Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host. @param {string} [sasToken] The Shared Access Signature token. @param {string} [endpointSuffix] The endpoint suffix.", "label": 1, "domain": "code", "token_count": 487, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0147", "text": "Entry point for running the NetworkMonitor.

    An IP host or port identifier has to be supplied, specifying the endpoint for the KNX network access.
    To show the usage message of this tool on the console, supply the command line option -help (or -h).
    Command line options are treated case sensitive. Available options for network monitoring:

    • -help -h show help message
    • -version show tool/library version and exit
    • -verbose -v enable verbose status output
    • -localhost id  local IP/host name
    • -localport number  local UDP port (default system assigned)
    • -port -p number  UDP port on host (default 3671)
    • -nat -n enable Network Address Translation
    • -serial -s use FT1.2 serial communication
    • -medium -m id  KNX medium [tp0|tp1|p110|p132|rf] (defaults to tp1)
    @param args command line options for network monitoring", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0148", "text": "

    Perform am URI fragment identifier escape operation on a char[] input using UTF-8 as encoding.

    The following are the only allowed chars in an URI fragment identifier (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 334, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0149", "text": "function takes input of ipaddress to RESTFUL call to HP IMC :param ipaddress: The current IP address of the Access Point at time of query. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :return: Dictionary object with the details of the target access point :rtype: dict >>> from pyhpeimc.auth import * >>> from pyhpeimc.wsm.apinfo import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> ap_info = get_ap_info('10.101.0.170',auth.creds, auth.url) >>> assert type(ap_info) is dict >>> assert len(ap_info) == 20 >>> assert 'acDevId' in ap_info >>> assert 'acIpAddress' in ap_info >>> assert 'acLabel' in ap_info >>> assert 'apAlias' in ap_info >>> assert 'connectType' in ap_info >>> assert 'hardwareVersion' in ap_info >>> assert 'ipAddress' in ap_info >>> assert 'isFit' in ap_info >>> assert 'label' in ap_info >>> assert 'location' in ap_info >>> assert 'locationList' in ap_info >>> assert 'macAddress' in ap_info >>> assert 'onlineClientCount' in ap_info >>> assert 'serialId' in ap_info >>> assert 'softwareVersion' in ap_info >>> assert 'ssids' in ap_info >>> assert 'status' in ap_info >>> assert 'sysName' in ap_info >>> assert 'type' in ap_info", "label": 1, "domain": "code", "token_count": 355, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0150", "text": "@class A KeyBinding is an interface used to define keyboard shortcuts. @name orion.KeyBinding @property {Function} match The function to match events. @property {Function} equals The funtion to compare to key bindings. @see orion.KeyStroke @see orion.KeySequence Constructs a new key stroke with the given key code, modifiers and event type. @param {String|Number} keyCode the key code. @param {Boolean} mod1 the primary modifier (usually Command on Mac and Control on other platforms). @param {Boolean} mod2 the secondary modifier (usually Shift). @param {Boolean} mod3 the third modifier (usually Alt). @param {Boolean} mod4 the fourth modifier (usually Control on the Mac). @param {String} type the type of event that the keybinding matches; either \"keydown\" or \"keypress\". @class A KeyStroke represents of a key code and modifier state that can be triggered by the user using the keyboard. @name orion.KeyStroke @property {String|Number} keyCode The key code. @property {Boolean} mod1 The primary modifier (usually Command on Mac and Control on other platforms). @property {Boolean} mod2 The secondary modifier (usually Shift). @property {Boolean} mod3 The third modifier (usually Alt). @property {Boolean} mod4 The fourth modifier (usually Control on the Mac). @property {String} [type=keydown] The type of event that the keybinding matches; either \"keydown\" or \"keypress\" @see orion.editor.TextView#setKeyBinding", "label": 1, "domain": "code", "token_count": 322, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0151", "text": "Applies a session keep alive entry to the state machine.

    Keep alive entries are applied to the internal state machine to reset the timeout for a specific session. If the session indicated by the KeepAliveEntry is still held in memory, we mark the session as trusted, indicating that the client has committed a keep alive within the required timeout. Additionally, we check all other sessions for expiration based on the timestamp provided by this KeepAliveEntry. Note that sessions are never completely expired via this method. Leaders must explicitly commit an UnregisterEntry to expire a session.

    When a KeepAliveEntry is committed to the internal state machine, two specific fields provided in the entry are used to update server-side session state. The {@code commandSequence} indicates the highest command for which the session has received a successful response in the proper sequence. By applying the {@code commandSequence} to the server session, we clear command output held in memory up to that point. The {@code eventVersion} indicates the index up to which the client has received event messages in sequence for the session. Applying the {@code eventVersion} to the server-side session results in events up to that index being removed from memory as they were acknowledged by the client. It's essential that both of these fields be applied via entries committed to the Raft log to ensure they're applied on all servers in sequential order.

    Keep alive entries are retained in the log until the next time the client sends a keep alive entry or until the client's session is expired. This ensures for sessions that have long timeouts, keep alive entries cannot be cleaned from the log before they're replicated to some servers.", "label": 1, "domain": "code", "token_count": 337, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0152", "text": "Replies one position factor for the intersection point between two lines.

    Let line equations for L1 and L2:
    L1: P1 + factor1 * (P2-P1)
    L2: P3 + factor2 * (P4-P3)
    If lines are intersecting, then
    P1 + factor1 * (P2-P1) = P3 + factor2 * (P4-P3)

    This function computes and replies factor1. @param x1 is the first point of the first line. @param y1 is the first point of the first line. @param z1 is the first point of the first line. @param x2 is the second point of the first line. @param y2 is the second point of the first line. @param z2 is the second point of the first line. @param x3 is the first point of the second line. @param y3 is the first point of the second line. @param z3 is the first point of the second line. @param x4 is the second point of the second line. @param y4 is the second point of the second line. @param z4 is the second point of the second line. @return factor1 or {@link Double#NaN} if no intersection.", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0153", "text": "This regex is used to validate the structure of the challenge header. Match whole structure: ^\\s*Bearer\\s+([^,\\s=\"]+?)=\"([^\"]*?)\"\\s*(,\\s*([^,\\s=\"]+?)=\"([^\"]*?)\"\\s*)*$ ^ Start at the beginning of the string. \\s*Bearer\\s+ Match 'Bearer' surrounded by one or more amount of whitespace. ([^,\\s=\"]+?) This cpatures the key which is composed of any characters except comma, whitespace or a quotes. = Match the = sign. \"([^\"]*?)\" Captures the value can be any number of non quote characters. At this point only the first key value pair as been captured. \\s* There can be any amount of white space after the first key value pair. ( Start a capture group to retrieve the rest of the key value pairs that are separated by commas. \\s* There can be any amount of whitespace before the comma. , There must be a comma. \\s* There can be any amount of whitespace after the comma. (([^,\\s=\"]+?) This will capture the key that comes after the comma. It's made of a series of any character excpet comma, whitespace or quotes. = Match the equal sign between the key and value. \" Match the opening quote of the value. ([^\"]*?) This will capture the value which can be any number of non quote characters. \" Match the values closing quote. \\s* There can be any amount of whitespace before the next comma. )* Close the capture group for key value pairs. There can be any number of these. $ The rest of the string can be whitespace but nothing else up to the end of the string. In other some other languages the regex above would be all that was needed. However, in JavaScript the RegExp object does not return all of the captures in one go. So the regex above needs to be broken up so that captures can be retrieved iteratively.", "label": 1, "domain": "code", "token_count": 409, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0154", "text": "Accepts a custom Rack environment to render templates in. It will be merged with the default Rack environment defined by +ActionController::Renderer::DEFAULTS+. Render templates with any options from ActionController::Base#render_to_string. The primary options are: * :partial - See ActionView::PartialRenderer for details. * :file - Renders an explicit template file. Add :locals to pass in, if so desired. It shouldn’t be used directly with unsanitized user input due to lack of validation. * :inline - Renders an ERB template string. * :plain - Renders provided text and sets the content type as text/plain. * :html - Renders the provided HTML safe string, otherwise performs HTML escape on the string first. Sets the content type as text/html. * :json - Renders the provided hash or object in JSON. You don't need to call .to_json on the object you want to render. * :body - Renders provided text and sets content type of text/plain. If no options hash is passed or if :update is specified, the default is to render a partial and use the second parameter as the locals hash.", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0155", "text": "Gets the information about the specific service belonging to the Service Fabric application. Returns the information about the specified service belonging to the specified Service Fabric application. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0156", "text": "/* Carry out division operations. /* Arg1 is operation code: D=divide, I=integer divide, R=remainder Arg2 is the rhs. Arg3 is the context. Arg4 is explicit scale iff code='D' or 'I' (-1 if none). Underlying algorithm (complications for Remainder function and scaled division are omitted for clarity): Test for x/0 and then 0/x Exp =Exp1 - Exp2 Exp =Exp +len(var1) -len(var2) Sign=Sign1 * Sign2 Pad accumulator (Var1) to double-length with 0's (pad1) Pad Var2 to same length as Var1 B2B=1st two digits of var2, +1 to allow for roundup have=0 Do until (have=digits+1 OR residue=0) if exp<0 then if integer divide/residue then leave this_digit=0 Do forever compare numbers if <0 then leave inner_loop if =0 then (- quick exit without subtract -) do this_digit=this_digit+1; output this_digit leave outer_loop; end Compare lengths of numbers (mantissae): If same then CA=first_digit_of_Var1 else CA=first_two_digits_of_Var1 mult=ca*10/b2b -- Good and safe guess at divisor if mult=0 then mult=1 this_digit=this_digit+mult subtract end inner_loop if have\\=0 | this_digit\\=0 then do output this_digit have=have+1; end var2=var2/10 exp=exp-1 end outer_loop exp=exp+1 -- set the proper exponent if have=0 then generate answer=0 Return to FINISHED Result defined by MATHV1 For extended commentary, see DMSRCN. --private com.ibm.icu.math.BigDecimal dodivide(char code,com.ibm.icu.math.BigDecimal rhs,com.ibm.icu.math.MathContext set,int scale){", "label": 1, "domain": "code", "token_count": 405, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0157", "text": ">>> import pprint >>> input_line1 = 'Apr 24 00:00:02 node haproxy[12298]: 1.1.1.1:48660 [24/Apr/2019:00:00:02.358] pre-staging~ pre-staging_doc/pre-staging_active 261/0/2/8/271 200 2406 - - ---- 4/4/0/1/0 0/0 {AAAAAA:AAAAA_AAAAA:AAAAA_AAAAA_AAAAA:300A||| user@mail.net:sdasdasdasdsdasAHDivsjd=|user@mail.net|2018} \"GET /doc/api/get?call=apple HTTP/1.1\"' >>> output_line1 = haproxy(input_line1) >>> pprint.pprint(output_line1) {'data': {'Tc': 2.0, 'Tq': 261.0, 'Tr': 8.0, 'Tw': 0.0, '_api': '/doc/api/get?call=apple', '_headers': ['AAAAAA:AAAAA_AAAAA:AAAAA_AAAAA_AAAAA:300A||| user@mail.net:sdasdasdasdsdasAHDivsjd=|user@mail.net|2018'], 'actconn': 4, 'backend': 'pre-staging_doc/pre-staging_active', 'backend_queue': 0, 'beconn': 1, 'bytes_read': 2406.0, 'client_port': '48660', 'client_server': '1.1.1.1', 'feconn': 4, 'front_end': 'pre-staging~', 'haproxy_server': 'node', 'method': 'GET', 'resp_time': 271.0, 'retries': 0, 'srv_conn': 0, 'srv_queue': 0, 'status': '200', 'timestamp': '2019-04-24T00:00:02.358000'}, 'event': 'haproxy_event', 'timestamp': '2019-04-24T00:00:02.358000', 'type': 'metric'}", "label": 1, "domain": "code", "token_count": 459, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0158", "text": "roll the year of the given calendar field. @method rollYear @param {Number} amount the signed amount to add to field. roll the month of the given calendar field. @param {Number} amount the signed amount to add to field. @method rollMonth roll the day of month of the given calendar field. @method rollDayOfMonth @param {Number} amount the signed amount to add to field. roll the hour of day of the given calendar field. @method rollHourOfDay @param {Number} amount the signed amount to add to field. roll the minute of the given calendar field. @method rollMinute @param {Number} amount the signed amount to add to field. roll the second of the given calendar field. @method rollSecond @param {Number} amount the signed amount to add to field. roll the millisecond of the given calendar field. @method rollMilliSecond @param {Number} amount the signed amount to add to field. roll the week of year of the given calendar field. @method rollWeekOfYear @param {Number} amount the signed amount to add to field. roll the week of month of the given calendar field. @method rollWeekOfMonth @param {Number} amount the signed amount to add to field. roll the day of year of the given calendar field. @method rollDayOfYear @param {Number} amount the signed amount to add to field. roll the day of week of the given calendar field. @method rollDayOfWeek @param {Number} amount the signed amount to add to field. remove other priority fields when call getFixedDate precondition: other fields are all set or computed @protected", "label": 1, "domain": "code", "token_count": 338, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0159", "text": "This operation extracts a rich set of visual features based on the image content. Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there is an optional parameter to allow you to choose which features to return. By default, image categories are returned in the response. A successful response will be returned in JSON. If the request failed, the response will contain an error code and a message to help understand what went wrong. @param url [String] Publicly reachable URL of an image. @param visual_features [Array] A string indicating what visual feature types to return. Multiple values should be comma-separated. Valid visual feature types include: Categories - categorizes image content according to a taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image content. Description - describes the image content with a complete English sentence. Faces - detects if faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart or a line drawing. Color - determines the accent color, dominant color, and whether an image is black&white. Adult - detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually suggestive content is also detected. Objects - detects various objects within an image, including the approximate location. The Objects argument is only available in English. Brands - detects various brands within an image, including the approximate location. The Brands argument is only available in English. @param details [Array

    ] A string indicating which domain-specific details to return. Multiple values should be comma-separated. Valid visual feature types include: Celebrities - identifies celebrities if detected in the image, Landmarks - identifies notable landmarks in the image. @param language [Enum] The desired language for output generation. If this parameter is not specified, the default value is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', 'pt', 'zh' @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ImageAnalysis] operation results.", "label": 1, "domain": "code", "token_count": 476, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0160", "text": "Follows the dynamic \"14.5.12 Expression edm:Path\" (or variant thereof) contained within the given raw value, starting the absolute path identified by the given interface, and returns the resulting absolute path as well as some other aspects about the path. @param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface the callback interface related to the current formatter call; the path must be within a complex or entity type! @param {object} oRawValue the raw value from the meta model, e.g. {AnnotationPath : \"ToSupplier/@com.sap.vocabularies.Communication.v1.Address\"} or {AnnotationPath : \"@com.sap.vocabularies.UI.v1.FieldGroup#Dimensions\"}; embedded within an entity set or entity type @returns {object} - {object} [associationSetEnd=undefined] association set end corresponding to the last navigation property - {boolean} [navigationAfterMultiple=false] if the navigation path has an association end with multiplicity \"*\" which is not the last one - {boolean} [isMultiple=false] whether the navigation path ends with an association end with multiplicity \"*\" - {string[]} [navigationProperties=[]] all navigation property names - {string} [resolvedPath=undefined] the resulting absolute path @see sap.ui.model.odata.AnnotationHelper.getNavigationPath @see sap.ui.model.odata.AnnotationHelper.gotoEntitySet @see sap.ui.model.odata.AnnotationHelper.isMultiple @see sap.ui.model.odata.AnnotationHelper.resolvePath", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0161", "text": "creates an API for an HTMLCanvasElement where all drawables are treated as self-contained Objects that can add/remove themselves from the DisplayList, rather than having a single function aggregating all drawing instructions @constructor @param {number|{ width: number, height: number, animate: boolean, smoothing: boolean, stretchToFit: boolean, fps: number, onUpdate: Function, debug: boolean }} width when numerical (legacy 4 argument constructor), the desired width of the Canvas, when Object it should contain required properties width and height, with others optional (see description on the default values for animate and framerate below) \"smoothing\" specifies whether or not to use smoothing (default, better for photos) or not (better for pixel art) \"stretchToFit\" specifies whether or not to stretch the canvas to fit the window dimensions (defaults to false) note that the width is taken as the dominant factor, the height scales relative to the window ratio \"onUpdate\" callback method to execute when the canvas is about to render. This can be used to synchronize a game's model from a single spot (instead of having each sprite's update()-method fire) \"debug\" specifies whether or not all sprites should render their bounding box for debugging purposes When object, no further arguments will be processed by this constructor @param {number=} height desired height of the Canvas @param {boolean=} animate specifies whether we will animate the Canvas (redraw it constantly on each animationFrame), this defaults to false to preserve resources (and will only (re)draw when adding/removing sprites from the display list) set this to true when creating animated content / games @param {number=} framerate (defaults to 60), only useful when animate is true", "label": 1, "domain": "code", "token_count": 349, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0162", "text": "Sends a health report on the Service Fabric cluster. Sends a health report on a Service Fabric cluster. The report must contain the information about the source of the health report and property on which it is reported. The report is sent to a Service Fabric gateway node, which forwards to the health store. The report may be accepted by the gateway, but rejected by the health store after extra validation. For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in the HealthEvents section. @param health_information [HealthInformation] Describes the health information for the health report. This information needs to be present in all of the health reports sent to the health manager. @param immediate [Boolean] A flag which indicates whether the report should be sent immediately. A health report is sent to a Service Fabric gateway Application, which forwards to the health store. If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, regardless of the fabric client settings that the HTTP Gateway Application is using. This is useful for critical reports that should be sent as soon as possible. Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway is closed or the message doesn't reach the Gateway. If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. Therefore, it will be batched according to the HealthReportSendInterval configuration. This is the recommended setting because it allows the health client to optimize health reporting messages to health store as well as health report processing. By default, reports are not sent immediately. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 427, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0163", "text": "Returns true if the URI objects are equal. This method normalizes both URIs before doing the comparison, and allows comparison against Strings. @param [Object] uri The URI to compare. @return [TrueClass, FalseClass] true if the URIs are equivalent, false otherwise. Returns true if the URI objects are equal. This method normalizes both URIs before doing the comparison. @param [Object] uri The URI to compare. @return [TrueClass, FalseClass] true if the URIs are equivalent, false otherwise. Returns true if the URI objects are equal. This method does NOT normalize either URI before doing the comparison. @param [Object] uri The URI to compare. @return [TrueClass, FalseClass] true if the URIs are equivalent, false otherwise. A hash value that will make a URI equivalent to its normalized form. @return [Integer] A hash of the URI. Clones the URI object. @return [Addressable::URI] The cloned URI. Omits components from a URI. @param [Symbol] *components The components to be omitted. @return [Addressable::URI] The URI with components omitted. @example uri = Addressable::URI.parse(\"http://example.com/path?query\") #=> # uri.omit(:scheme, :authority) #=> #", "label": 1, "domain": "code", "token_count": 358, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0164", "text": "Creates and caches a new AWS Kinesis instance with the given Kinesis constructor options for either the region specified in the given options (if any and region specified) or for the current region (if not) UNLESS a previously cached Kinesis instance exists and the given options either match the options used to construct it or are undefined, empty or only region was specified, in which case no new instance will be created and the cached instance will be returned instead. If the given options do not match existing options and are not empty and not only region, then logs a warning that the previously cached Kinesis instance is being replaced and returns the new AWS Kinesis instance. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) Configures the given context, if it does not already have a context.kinesis, with the cached kinesis instance for either the region specified in the given default kinesis options (if any and region specified) or for the current region (if not); otherwise with a new AWS.Kinesis instance created and cached by {@linkcode setKinesis} for the specified or current region using the given default Kinesis constructor options. Note that the given default Kinesis constructor options will ONLY be used if no cached Kinesis instance exists. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) @param {Object|KinesisAware} context - the context to configure @param {Object|undefined} [kinesisOptions] - the optional Kinesis constructor options to use if no cached Kinesis instance exists @param {string|undefined} [kinesisOptions.region] - an optional region to use instead of the current region @returns {KinesisAware} the given context configured with an AWS.Kinesis instance", "label": 1, "domain": "code", "token_count": 362, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0165", "text": "Negotiate a new SSH2 session as a server. This is the first step after creating a new L{Transport} and setting up your server host key(s). A separate thread is created for protocol negotiation. If an event is passed in, this method returns immediately. When negotiation is done (successful or not), the given C{Event} will be triggered. On failure, L{is_active} will return C{False}. (Since 1.4) If C{event} is C{None}, this method will not return until negotation is done. On success, the method returns normally. Otherwise an SSHException is raised. After a successful negotiation, the client will need to authenticate. Override the methods L{get_allowed_auths }, L{check_auth_none }, L{check_auth_password }, and L{check_auth_publickey } in the given C{server} object to control the authentication process. After a successful authentication, the client should request to open a channel. Override L{check_channel_request } in the given C{server} object to allow channels to be opened. @note: After calling this method (or L{start_client} or L{connect}), you should no longer directly read from or write to the original socket object. @param event: an event to trigger when negotiation is complete. @type event: threading.Event @param server: an object used to perform authentication and create L{Channel}s. @type server: L{server.ServerInterface} @raise SSHException: if negotiation fails (and no C{event} was passed in)", "label": 1, "domain": "code", "token_count": 357, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0166", "text": "Model for the contents of a single file and its current modification state. See DocumentManager documentation for important usage notes. Document dispatches these events: __change__ -- When the text of the editor changes (including due to undo/redo). Passes ({Document}, {ChangeList}), where ChangeList is an array of change record objects. Each change record looks like: { from: start of change, expressed as {line: , ch: }, to: end of change, expressed as {line: , ch: }, text: array of lines of text to replace existing text } The line and ch offsets are both 0-based. The ch offset in \"from\" is inclusive, but the ch offset in \"to\" is exclusive. For example, an insertion of new content (without replacing existing content) is expressed by a range where from and to are the same. If \"from\" and \"to\" are undefined, then this is a replacement of the entire text content. IMPORTANT: If you listen for the \"change\" event, you MUST also addRef() the document (and releaseRef() it whenever you stop listening). You should also listen to the \"deleted\" event. __deleted__ -- When the file for this document has been deleted. All views onto the document should be closed. The document will no longer be editable or dispatch \"change\" events. __languageChanged__ -- When the value of getLanguage() has changed. 2nd argument is the old value, 3rd argument is the new value. @constructor @param {!File} file Need not lie within the project. @param {!Date} initialTimestamp File's timestamp when we read it off disk. @param {!string} rawText Text content of the file.", "label": 1, "domain": "code", "token_count": 370, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0167", "text": " Generate an RSA key pair. The public portion of the generated RSA key is saved to <'filepath'>.pub, whereas the private key portion is saved to <'filepath'>. If no password is given, the user is prompted for one. If the 'password' is an empty string, the private key is saved unencrypted to <'filepath'>. If the filepath is not given, the KEYID is used as the filename and the keypair saved to the current working directory. The best available form of encryption, for a given key's backend, is used with pyca/cryptography. According to their documentation, \"it is a curated encryption choice and the algorithm may change over time.\" filepath: The public and private key files are saved to .pub and , respectively. If the filepath is not given, the public and private keys are saved to the current working directory as .pub and . KEYID is the generated key's KEYID. bits: The number of bits of the generated RSA key. password: The password to encrypt 'filepath'. If None, the user is prompted for a password. If an empty string is given, the private key is written to disk unencrypted. securesystemslib.exceptions.FormatError, if the arguments are improperly formatted. Writes key files to '' and '.pub'. The 'filepath' of the written key.", "label": 1, "domain": "code", "token_count": 304, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0168", "text": "Constructs a matrix. @alias Matrix @constructor @classdesc Represents a 4 x 4 double precision matrix stored in a Float64Array in row-major order. @param {Number} m11 matrix element at row 1, column 1. @param {Number} m12 matrix element at row 1, column 2. @param {Number} m13 matrix element at row 1, column 3. @param {Number} m14 matrix element at row 1, column 4. @param {Number} m21 matrix element at row 2, column 1. @param {Number} m22 matrix element at row 2, column 2. @param {Number} m23 matrix element at row 2, column 3. @param {Number} m24 matrix element at row 2, column 4. @param {Number} m31 matrix element at row 3, column 1. @param {Number} m32 matrix element at row 3, column 2. @param {Number} m33 matrix element at row 3, column 3. @param {Number} m34 matrix element at row 3, column 4. @param {Number} m41 matrix element at row 4, column 1. @param {Number} m42 matrix element at row 4, column 2. @param {Number} m43 matrix element at row 4, column 3. @param {Number} m44 matrix element at row 4, column 4.", "label": 1, "domain": "code", "token_count": 322, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0169", "text": "Writes the LIGO Light Weight document tree rooted at xmldoc to the given file object. Internally, the .write() method of the xmldoc object is invoked and any additional keyword arguments are passed to that method. The file object need not be seekable. The output data is gzip compressed on the fly if gz is True. The return value is a string containing the hex digits of the MD5 digest of the output bytestream. This function traps the signals in the trap_signals iterable during the write process (the default is signal.SIGTERM and signal.SIGTSTP), and it does this by temporarily installing its own signal handlers in place of the current handlers. This is done to prevent Condor eviction during the write process. When the file write is concluded the original signal handlers are restored. Then, if signals were trapped during the write process, the signals are then resent to the current process in the order in which they were received. The signal.signal() system call cannot be invoked from threads, and trap_signals must be set to None or an empty sequence if this function is used from a thread. Example: >>> import sys >>> from pycbc_glue.ligolw import ligolw >>> xmldoc = load_filename(\"demo.xml\", contenthandler = ligolw.LIGOLWContentHandler) >>> digest = write_fileobj(xmldoc, sys.stdout) # doctest: +NORMALIZE_WHITESPACE \"mass\",0.5,\"velocity\",34
    >>> digest '37044d979a79409b3d782da126636f53'", "label": 1, "domain": "code", "token_count": 435, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0170", "text": "Replies if the triangle intersects the oriented box. @param tx1 x coordinate of the first point of the triangle. @param ty1 y coordinate of the first point of the triangle. @param tz1 z coordinate of the first point of the triangle. @param tx2 x coordinate of the second point of the triangle. @param ty2 y coordinate of the second point of the triangle. @param tz2 z coordinate of the second point of the triangle. @param tx3 x coordinate of the third point of the triangle. @param ty3 y coordinate of the third point of the triangle. @param tz3 z coordinate of the third point of the triangle. @param cx x coordinate of the center of the oriented box. @param cy y coordinate of the center of the oriented box. @param cz z coordinate of the center of the oriented box. @param ax1 x coordinate of the first axis of the oriented box. @param ay1 y coordinate of the first axis of the oriented box. @param az1 z coordinate of the first axis of the oriented box. @param ax2 x coordinate of the second axis of the oriented box. @param ay2 y coordinate of the second axis of the oriented box. @param az2 z coordinate of the second axis of the oriented box. @param ax3 x coordinate of the third axis of the oriented box. @param ay3 y coordinate of the third axis of the oriented box. @param az3 z coordinate of the third axis of the oriented box. @param ae1 the extent of the first axis. @param ae2 the extent of the second axis. @param ae3 the extent of the third axis. @return true if the triangle and oriented box are intersecting.", "label": 1, "domain": "code", "token_count": 361, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0171", "text": "Attempts to create a record with the given attributes in a table that has a unique constraint on one or several of its columns. If a row already exists with one or several of these unique constraints, the exception such an insertion would normally raise is caught, and the existing record with those attributes is found using #find_by!. This is similar to #find_or_create_by, but avoids the problem of stale reads between the SELECT and the INSERT, as that method needs to first query the table, then attempt to insert a row if none is found. There are several drawbacks to #create_or_find_by, though: * The underlying table must have the relevant columns defined with unique constraints. * A unique constraint violation may be triggered by only one, or at least less than all, of the given attributes. This means that the subsequent #find_by! may fail to find a matching record, which will then raise an ActiveRecord::RecordNotFound exception, rather than a record with the given attributes. * While we avoid the race condition between SELECT -> INSERT from #find_or_create_by, we actually have another race condition between INSERT -> SELECT, which can be triggered if a DELETE between those two statements is run by another client. But for most applications, that's a significantly less likely condition to hit. * It relies on exception handling to handle control flow, which may be marginally slower. * The primary key may auto-increment on each create, even if it fails. This can accelerate the problem of running out of integers, if the underlying table is still stuck on a primary key of type int (note: All Rails apps since 5.1+ have defaulted to bigint, which is not liable to this problem). This method will return a record if all given attributes are covered by unique constraints (unless the INSERT -> DELETE -> SELECT race condition is triggered), but if creation was attempted and failed due to validation errors it won't be persisted, you get what #create returns in such situation.", "label": 1, "domain": "code", "token_count": 405, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0172", "text": "Returns information about the requested domain. @param {Function} query @param {string|GetInfo} options The domain name, or options to get info about a domain. @param {string} options.domain The domain to get info about. @example // Obtain information for the testt.cc domain: await nc.domains.getInfo({ domain: 'testt.cc' }) await nc.domains.getInfo('testt.cc') // Result: { Status: 'Ok', ID: 30072635, DomainName: 'testt.cc', OwnerName: 'artdeco', IsOwner: true, IsPremium: false, DomainDetails: { CreatedDate: '06/06/2018', ExpiredDate: '06/06/2019', NumYears: 0 }, Whoisguard: { Enabled: 'True', ID: 23996873, ExpiredDate: '06/05/2019', EmailDetails: { WhoisGuardEmail: 'ff474db8ad3b4c3b95a2b0f3b3a73acc.protect[at]whoisguard.com', ForwardedTo: 'example[at]adc.sh', LastAutoEmailChangeDate: '', AutoEmailChangeFrequencyDays: 0 } }, PremiumDnsSubscription: { UseAutoRenew: false, SubscriptionId: -1, CreatedDate: 0001-01-01T00:00:00.000Z, ExpirationDate: 0001-01-01T00:00:00.000Z, IsActive: false }, DnsDetails: { ProviderType: 'CUSTOM', IsUsingOurDNS: false, HostCount: 2, EmailType: 'FWD', DynamicDNSStatus: false, IsFailover: false, Nameserver: [ 'ns-1013.awsdns-62.net', 'ns-1311.awsdns-35.org', 'ns-1616.awsdns-10.co.uk', 'ns-355.awsdns-44.com' ] }, Modificationrights: { All: true } }", "label": 1, "domain": "code", "token_count": 429, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0173", "text": "General analysis function that groups data by subject/list number and performs analysis. Parameters ---------- egg : Egg data object The data to be analyzed subjgroup : list of strings or ints String/int variables indicating how to group over subjects. Must be the length of the number of subjects subjname : string Name of the subject grouping variable listgroup : list of strings or ints String/int variables indicating how to group over list. Must be the length of the number of lists listname : string Name of the list grouping variable analysis : string This is the analysis you want to run. Can be accuracy, spc, pfr, temporal or fingerprint position : int Optional argument for pnr analysis. Defines encoding position of item to run pnr. Default is 0, and it is zero indexed permute : bool Optional argument for fingerprint/temporal cluster analyses. Determines whether to correct clustering scores by shuffling recall order for each list to create a distribution of clustering scores (for each feature). The \"corrected\" clustering score is the proportion of clustering scores in that random distribution that were lower than the clustering score for the observed recall sequence. Default is False. n_perms : int Optional argument for fingerprint/temporal cluster analyses. Number of permutations to run for \"corrected\" clustering scores. Default is 1000 ( per recall list). parallel : bool Option to use multiprocessing (this can help speed up the permutations tests in the clustering calculations) match : str (exact, best or smooth) Matching approach to compute recall matrix. If exact, the presented and recalled items must be identical (default). If best, the recalled item that is most similar to the presented items will be selected. If smooth, a weighted average of all presented items will be used, where the weights are derived from the similarity between the recalled item and each presented item. distance : str The distance function used to compare presented and recalled items. Applies only to 'best' and 'smooth' matching approaches. Can be any distance function supported by numpy.spatial.distance.cdist. Returns ---------- result : quail.FriedEgg Class instance containing the analysis results", "label": 1, "domain": "code", "token_count": 421, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0174", "text": "Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxCell Cells are the elements of the graph model. They represent the state of the groups, vertices and edges in a graph. Custom attributes: For custom attributes we recommend using an XML node as the value of a cell. The following code can be used to create a cell with an XML node as the value: (code) var doc = mxUtils.createXmlDocument(); var node = doc.createElement('MyNode') node.setAttribute('label', 'MyLabel'); node.setAttribute('attribute1', 'value1'); graph.insertVertex(graph.getDefaultParent(), null, node, 40, 40, 80, 30); (end) For the label to work, and should be overridden as follows: (code) graph.convertValueToString = function(cell) { if (mxUtils.isNode(cell.value)) { return cell.getAttribute('label', '') } }; var cellLabelChanged = graph.cellLabelChanged; graph.cellLabelChanged = function(cell, newValue, autoSize) { if (mxUtils.isNode(cell.value)) { // Clones the value for correct undo/redo var elt = cell.value.cloneNode(true); elt.setAttribute('label', newValue); newValue = elt; } cellLabelChanged.apply(this, arguments); }; (end) Callback: onInit Called from within the constructor. Constructor: mxCell Constructs a new cell to be used in a graph model. This method invokes upon completion. Parameters: value - Optional object that represents the cell value. geometry - Optional that specifies the geometry. style - Optional formatted string that defines the style.", "label": 1, "domain": "code", "token_count": 366, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0175", "text": "Subdivide the face (interpolate pos, norm, uv) - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere) - norm is linear interpolation of vertex corner normal (to be checked if better to re-calc from face vertex, or if approximation is OK ??? ) - uv is linear interpolation Topology is as below for sub-divide by 2 vertex shown as v0,v1,v2 interp index is i1 to progress in range [v0,v1[ interp index is i2 to progress in range [v0,v2[ face index as (i1,i2) for /\\ : (i1,i2),(i1+1,i2),(i1,i2+1) and (i1,i2)' for \\/ : (i1+1,i2),(i1+1,i2+1),(i1,i2+1) i2 v2 ^ ^ / / \\ / / \\ / / \\ / / (0,1) \\ / #---------\\ / / \\ (0,0)'/ \\ / / \\ / \\ / / \\ / \\ / / (0,0) \\ / (1,0) \\ / #---------#---------\\ v0 v1 --------------------> i1 interp of (i1,i2): along i2 : x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S) along i1 : lerp(x0,x1, i1/(S-i2)) centroid of triangle is needed to get help normal computation (c1,c2) are used for centroid location", "label": 1, "domain": "code", "token_count": 342, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0176", "text": "Replies if two lines are colinear.

    The given two lines are described respectivaly by two points, i.e. {@code (x1,y1,z1)} and {@code (x2,y2,z2)} for the first line, and {@code (x3,y3,z3)} and {@code (x4,y4,z4)} for the second line.

    If you are interested to test if the two lines are parallel, see {@link #isParallelLines(double, double, double, double, double, double, double, double, double, double, double, double)}. @param x1 is the X coordinate of the first point of the first line. @param y1 is the Y coordinate of the first point of the first line. @param z1 is the Z coordinate of the first point of the first line. @param x2 is the X coordinate of the second point of the first line. @param y2 is the Y coordinate of the second point of the first line. @param z2 is the Z coordinate of the second point of the first line. @param x3 is the X coordinate of the first point of the second line. @param y3 is the Y coordinate of the first point of the second line. @param z3 is the Z coordinate of the first point of the second line. @param x4 is the X coordinate of the second point of the second line. @param y4 is the Y coordinate of the second point of the second line. @param z4 is the Z coordinate of the second point of the second line. @return true if the two given lines are collinear. @see #isParallelLines(double, double, double, double, double, double, double, double, double, double, double, double) @see Point3f#isCollinearPoints(double, double, double, double, double, double, double, double, double, double)", "label": 1, "domain": "code", "token_count": 409, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0177", "text": "

    Generates a stream by regrouping the elements of the provided stream and putting them in a substream. The number of elements regrouped is the groupingFactor.

    Example:

    {@code Stream stream = Stream.of(\"a0\", \"a1\", \"a2\", \"a3\"); Stream> groupingStream = StreamsUtils.group(stream, 2); List> collect = groupingStream.map(st -> st.collect(Collectors.toList())).collect(Collectors.toList()); // The collect list is [[\"a0\", \"a1\"][\"a2\", \"a3\"]] }

    If the provided stream is empty, then the returned stream contains an empty stream.

    The groupingFactor should be greater of equals than 2. A grouping factor of 0 does not make sense. A grouping factor of 1 is in fact a mapping with a Stream::of. An IllegalArgumentException will be thrown if a non valid groupingFactor is provided.

    An IllegalArgumentException will also be thrown if the provided stream is not ORDERED

    The returned stream has the same characteristics as the provided stream, and is thus ORDERED.

    All the returned substreams are guaranteed to produce groupingFactor elements. So there might be elements from the provided stream that will not be consumed in the grouped stream.

    @param stream The stream to be grouped. Will throw a NullPointerException if null. @param groupingFactor The grouping factor, should be greater of equal than 2. @param The type of the elements of the provided stream. @return A grouped stream of streams.", "label": 1, "domain": "code", "token_count": 407, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0178", "text": "API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request. :param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minutes. :type qInserts: bool :param filesList: List of dictionaries containing following information :type filesList: list of dicts :key logical_file_name: File to be inserted (str) (Required) :key is_file_valid: (optional, default = 1): (bool) :key block: required: /a/b/c#d (str) :key dataset: required: /a/b/c (str) :key file_type: (optional, default = EDM) one of the predefined types, (str) :key check_sum: (optional, default = '-1') (str) :key event_count: (optional, default = -1) (int) :key file_size: (optional, default = -1.) (float) :key adler32: (optional, default = '') (str) :key md5: (optional, default = '') (str) :key auto_cross_section: (optional, default = -1.) (float) :key file_lumi_list: (optional, default = []) [{'run_num': 123, 'lumi_section_num': 12},{}....] :key file_parent_list: (optional, default = []) [{'file_parent_lfn': 'mylfn'},{}....] :key file_assoc_list: (optional, default = []) [{'file_parent_lfn': 'mylfn'},{}....] :key file_output_config_list: (optional, default = []) [{'app_name':..., 'release_version':..., 'pset_hash':...., output_module_label':...},{}.....]", "label": 1, "domain": "code", "token_count": 381, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0179", "text": "Produce a list of files corresponding to format_str located at data_path. This routine is invoked by pysat and is not intended for direct use by the end user. Multiple data levels may be supported via the 'tag' and 'sat_id' input strings. Parameters ---------- tag : string ('') tag name used to identify particular data set to be loaded. This input is nominally provided by pysat itself. sat_id : string ('') Satellite ID used to identify particular data set to be loaded. This input is nominally provided by pysat itself. data_path : string Full path to directory containing files to be loaded. This is provided by pysat. The user may specify their own data path at Instrument instantiation and it will appear here. format_str : string (None) String template used to parse the datasets filenames. If a user supplies a template string at Instrument instantiation then it will appear here, otherwise defaults to None. Returns ------- pandas.Series Series of filename strings, including the path, indexed by datetime. Examples -------- :: If a filename is SPORT_L2_IVM_2019-01-01_v01r0000.NC then the template is 'SPORT_L2_IVM_{year:04d}-{month:02d}-{day:02d}_v{version:02d}r{revision:04d}.NC' Note ---- The returned Series should not have any duplicate datetimes. If there are multiple versions of a file the most recent version should be kept and the rest discarded. This routine uses the pysat.Files.from_os constructor, thus the returned files are up to pysat specifications. Normally the format_str for each supported tag and sat_id is defined within this routine. However, as this is a generic routine, those definitions can't be made here. This method could be used in an instrument specific module where the list_files routine in the new package defines the format_str based upon inputs, then calls this routine passing both data_path and format_str. Alternately, the list_files routine in nasa_cdaweb_methods may also be used and has more built in functionality. Supported tages and format strings may be defined within the new instrument module and passed as arguments to nasa_cdaweb_methods.list_files . For an example on using this routine, see pysat/instrument/cnofs_ivm.py or cnofs_vefi, cnofs_plp, omni_hro, timed_see, etc.", "label": 1, "domain": "code", "token_count": 494, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0180", "text": "Namespace provided by the mongodb-core and node.js @external Duplex Create a new GridStore instance Modes - **\"r\"** - read only. This is the default mode. - **\"w\"** - write in truncate mode. Existing data will be overwritten. @class @param {Db} db A database instance to interact with. @param {object} [id] optional unique id for this file @param {string} [filename] optional filename for this file, no unique constrain on the field @param {string} mode set the mode for this file. @param {object} [options] Optional settings. @param {(number|string)} [options.w] The write concern. @param {number} [options.wtimeout] The write concern timeout. @param {boolean} [options.j=false] Specify a journal write concern. @param {boolean} [options.fsync=false] Specify a file sync write concern. @param {string} [options.root] Root collection to use. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**. @param {string} [options.content_type] MIME type of the file. Defaults to **{GridStore.DEFAULT_CONTENT_TYPE}**. @param {number} [options.chunk_size=261120] Size for the chunk. Defaults to **{Chunk.DEFAULT_CHUNK_SIZE}**. @param {object} [options.metadata] Arbitrary data the user wants to store. @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). @property {number} chunkSize Get the gridstore chunk size. @property {number} md5 The md5 checksum for this file. @property {number} chunkNumber The current chunk number the gridstore has materialized into memory @return {GridStore} a GridStore instance. @deprecated Use GridFSBucket API instead", "label": 1, "domain": "code", "token_count": 435, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0181", "text": "Multiple names may be provided. These will often be distinguished by being assigned by different authorities, as indicated by the value of the codeSpace attribute. In an instance document there will usually only be one name per authority.Gets the value of the name property.

    This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the name property.

    For example, to add a new item, do as follows:

     getName().add(newItem); 

    Objects of the following type(s) are allowed in the list {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >} {@link JAXBElement }{@code <}{@link CodeType }{@code >}", "label": 1, "domain": "code", "token_count": 319, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0182", "text": "init Connect to the JSS MySQL database. @param args[Hash] the keyed arguments for connection. @option args :server[String] Required, the hostname of the JSS API server @option args :port[Integer] the port number to connect with, defaults to the default Mysql TCP port @option args :socket[String,Pathname] when the server is 'localhost', the path to the connection socket. @option args :db_name[String] the name of the database to use, defaults to 'jamfsoftware' @option args :user[String] Required, the mysql user to connect as @option args :pw[String,Symbol] Required, the password for that user, or :prompt, or :stdin If :prompt, the user is promted on the commandline to enter the password for the :user. If :stdin#, the password is read from a line of std in represented by the digit at #, so :stdin3 reads the passwd from the third line of standard input. defaults to line 2, if no digit is supplied. see {JSS.stdin} @option args :connect_timeout[Integer] the number of seconds to wait for an initial response, defaults to 120 @option args :read_timeout[Integer] the number of seconds before read-request times out, defaults to 120 @option args :write_timeout[Integer] the number of seconds before write-request times out, defaults to 120 @option args :timeout[Integer] used for any of the timeouts that aren't explicitly set. @return [true] the connection was successfully made.", "label": 1, "domain": "code", "token_count": 324, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0183", "text": "Reset all the column widths so that each column is *just* wide enough to accommodate its header text as well as the formatted content of each its cells for the entire collection, together with a single character of padding on either side of the column, without any wrapping. Note that calling this method will cause the entire source Enumerable to be traversed and all the column extractors and formatters to be applied in order to calculate the required widths. Note also that this method causes column widths to be fixed as appropriate to the formatted cell contents given the state of the source Enumerable at the point it is called. If the source Enumerable changes between that point, and the point when the Table is printed, then columns will *not* be resized yet again on printing. @param [nil, Numeric] max_table_width (:auto) With no args, or if passed :auto, stops the total table width (including padding and borders) from expanding beyond the bounds of the terminal screen. If passed nil, the table width will not be capped. Width is deducted from columns if required to achieve this, with one character progressively deducted from the width of the widest column until the target is reached. When the table is printed, wrapping or truncation will then occur in these columns as required (depending on how they were configured). Note that regardless of the value passed to max_table_width, the table will always be left wide enough to accommodate at least 1 character's width of content, 1 character of left padding and 1 character of right padding in each column, together with border characters (1 on each side of the table and 1 between adjacent columns). I.e. there is a certain width below width the Table will refuse to shrink itself. @return [Table] the Table itself", "label": 1, "domain": "code", "token_count": 365, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0184", "text": "Starts or stops a cluster node. Starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To start a node, pass in \"Start\" for the NodeTransitionType parameter. To stop a node, pass in \"Stop\" for the NodeTransitionType parameter. This API starts the operation - when the API returns the node may not have finished transitioning yet. Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. @param node_name [String] The name of the node. @param operation_id A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API @param node_transition_type [NodeTransitionType] Indicates the type of transition to perform. NodeTransitionType.Start will start a stopped node. NodeTransitionType.Stop will stop a node that is up. Possible values include: 'Invalid', 'Start', 'Stop' @param node_instance_id [String] The node instance ID of the target node. This can be determined through GetNodeInfo API. @param stop_duration_in_seconds [Integer] The duration, in seconds, to keep the node stopped. The minimum value is 600, the maximum is 14400. After this time expires, the node will automatically come back up. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 335, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0185", "text": "Mersenne Twister from https://gist.github.com/banksean/300494 /* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)", "label": 1, "domain": "code", "token_count": 404, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0186", "text": "Add a url to the handle record's \"10320/LOC\" entry. If no 10320/LOC entry exists, a new one is created (using the default \"chooseby\" attribute, if configured). If the URL is already present, it is not added again, but the attributes (e.g. weight) are updated/added. If the existing 10320/LOC entry is mal-formed, an exception will be thrown (xml.etree.ElementTree.ParseError) Note: In the unlikely case that several \"10320/LOC\" entries exist, an exception is raised. :param url: The URL to be added. :param list_of_entries: A list of the existing entries (to find and adapt the correct one). :param weight: Optional. The weight to be set (integer between 0 and 1). If None, no weight attribute is set. If the value is outside the accepted range, it is set to 1. :param http_role: Optional. The http_role to be set. This accepts any string. Currently, Handle System can process 'conneg'. In future, it may be able to process 'no_conneg' and 'browser'. :param handle: Optional. Only for the exception message. :param all others: Optional. All other key-value pairs will be set to the element. Any value is accepted and transformed to string. :raise: GenericHandleError: If several 10320/LOC exist (unlikely).", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0187", "text": "Inserts a new VLAN. :param nome: Name of Vlan. String with a maximum of 50 characters. :param id_tipo_rede: Identifier of the Network Type. Integer value and greater than zero. :param id_ambiente: Identifier of the Environment. Integer value and greater than zero. :param descricao: Description of Vlan. String with a maximum of 200 characters. :param id_ambiente_vip: Identifier of the Environment Vip. Integer value and greater than zero. :return: Following dictionary: :: {'vlan': {'id': < id_vlan >, 'nome': < nome_vlan >, 'num_vlan': < num_vlan >, 'id_tipo_rede': < id_tipo_rede >, 'id_ambiente': < id_ambiente >, 'rede_oct1': < rede_oct1 >, 'rede_oct2': < rede_oct2 >, 'rede_oct3': < rede_oct3 >, 'rede_oct4': < rede_oct4 >, 'bloco': < bloco >, 'mascara_oct1': < mascara_oct1 >, 'mascara_oct2': < mascara_oct2 >, 'mascara_oct3': < mascara_oct3 >, 'mascara_oct4': < mascara_oct4 >, 'broadcast': < broadcast >, 'descricao': < descricao >, 'acl_file_name': < acl_file_name >, 'acl_valida': < acl_valida >, 'ativada': < ativada >}} :raise VlanError: VLAN name already exists, VLAN name already exists, DC division of the environment invalid or does not exist VLAN number available. :raise VlanNaoExisteError: VLAN not found. :raise TipoRedeNaoExisteError: Network Type not registered. :raise AmbienteNaoExisteError: Environment not registered. :raise EnvironmentVipNotFoundError: Environment VIP not registered. :raise InvalidParameterError: Name of Vlan and/or the identifier of the Environment is null or invalid. :raise IPNaoDisponivelError: There is no network address is available to create the VLAN. :raise ConfigEnvironmentInvalidError: Invalid Environment Configuration or not registered :raise DataBaseError: Networkapi failed to access the database. :raise XMLError: Networkapi failed to generate the XML response.", "label": 1, "domain": "code", "token_count": 486, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0188", "text": "

    Perform an XML 1.1 level 1 (only markup-significant chars) escape operation on a Reader input meant to be an XML attribute value, writing results to a Writer.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml11(Reader, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 403, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0189", "text": "Invokes a method if a certain time has passed since the last call, regardless of how many times it was called. @param {Function} fn The method to debounce. @param {Object} [mOptions] The options that influence when the debounced method will be invoked. @param {int} [mOptions.wait=0] The amount of milliseconds since the last call to wait before actually invoking the method. Has no effect, if mOptions.requestAnimationFrame is set to true. @param {int | null} [mOptions.maxWait=null] The maximum amount of milliseconds to wait for an invocation. Has no effect, if mOptions.requestAnimationFrame is set to true. @param {boolean} [mOptions.leading=false] Whether the method should be invoked on the first call. @param {boolean} [mOptions.asyncLeading=false] Whether the leading invocation should be asynchronous. @param {boolean} [mOptions.trailing=true] Whether the method should be invoked after a certain time has passed. If mOptions.leading is set to true, the method needs to be called more than once for an invocation at the end of the waiting time. @param {boolean} [mOptions.requestAnimationFrame=false] Whether requestAnimationFrame should be used to debounce the method. If set to true, mOptions.wait and mOptions.maxWait have no effect. @returns {Function} Returns the debounced method.", "label": 1, "domain": "code", "token_count": 331, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0190", "text": "@constructor Effect parameters are as follow: { chromatic_aberration: number; // from 0 to x (1 for realism) edge_blur: number; // from 0 to x (1 for realism) distortion: number; // from 0 to x (1 for realism) grain_amount: number; // from 0 to 1 grain_texture: BABYLON.Texture; // texture to use for grain effect; if unset, use random B&W noise dof_focus_distance: number; // depth-of-field: focus distance; unset to disable (disabled by default) dof_aperture: number; // depth-of-field: focus blur bias (default: 1) dof_darken: number; // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default) dof_pentagon: boolean; // depth-of-field: makes a pentagon-like \"bokeh\" effect dof_gain: number; // depth-of-field: highlights gain; unset to disable (disabled by default) dof_threshold: number; // depth-of-field: highlights threshold (default: 1) blur_noise: boolean; // add a little bit of noise to the blur (default: true) } Note: if an effect parameter is unset, effect is disabled @param {string} name - The rendering pipeline name @param {object} parameters - An object containing all parameters (see above) @param {BABYLON.Scene} scene - The scene linked to this pipeline @param {number} ratio - The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5) @param {BABYLON.Camera[]} cameras - The array of cameras that the rendering pipeline will be attached to", "label": 1, "domain": "code", "token_count": 369, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0191", "text": "

    Perform an XML 1.1 level 1 (only markup-significant chars) escape operation on a char[] input meant to be an XML attribute value.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml10(char[], int, int, java.io.Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 437, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0192", "text": "Expands a URI template into a full URI. @param [Hash] mapping The mapping that corresponds to the pattern. @param [#validate, #transform] processor An optional processor object may be supplied. @param [Boolean] normalize_values Optional flag to enable/disable unicode normalization. Default: true The object should respond to either the validate or transform messages or both. Both the validate and transform methods should take two parameters: name and value. The validate method should return true or false; true if the value of the variable is valid, false otherwise. An InvalidTemplateValueError exception will be raised if the value is invalid. The transform method should return the transformed variable value as a String. If a transform method is used, the value will not be percent encoded automatically. Unicode normalization will be performed both before and after sending the value to the transform method. @return [Addressable::URI] The expanded URI template. @example class ExampleProcessor def self.validate(name, value) return !!(value =~ /^[\\w ]+$/) if name == \"query\" return true end def self.transform(name, value) return value.gsub(/ /, \"+\") if name == \"query\" return value end end Addressable::Template.new( \"http://example.com/search/{query}/\" ).expand( {\"query\" => \"an example search query\"}, ExampleProcessor ).to_str #=> \"http://example.com/search/an+example+search+query/\" Addressable::Template.new( \"http://example.com/search/{query}/\" ).expand( {\"query\" => \"an example search query\"} ).to_str #=> \"http://example.com/search/an%20example%20search%20query/\" Addressable::Template.new( \"http://example.com/search/{query}/\" ).expand( {\"query\" => \"bogus!\"}, ExampleProcessor ).to_str #=> Addressable::Template::InvalidTemplateValueError", "label": 1, "domain": "code", "token_count": 467, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0193", "text": "Run the Aegean source finder. Parameters ---------- filename : str or HDUList Image filename or HDUList. hdu_index : int The index of the FITS HDU (extension). outfile : str file for printing catalog (NOT a table, just a text file of my own design) rms : float Use this rms for the entire image (will also assume that background is 0) max_summits : int Fit up to this many components to each island (extras are included but not fit) innerclip, outerclip : float The seed (inner) and flood (outer) clipping level (sigmas). cores : int Number of CPU cores to use. None means all cores. rmsin, bkgin : str or HDUList Filename or HDUList for the noise and background images. If either are None, then it will be calculated internally. beam : (major, minor, pa) Floats representing the synthesised beam (degrees). Replaces whatever is given in the FITS header. If the FITS header has no BMAJ/BMIN then this is required. doislandflux : bool If True then each island will also be characterized. nopositive, nonegative : bool Whether to return positive or negative sources. Default nopositive=False, nonegative=True. mask : str The filename of a region file created by MIMAS. Islands outside of this region will be ignored. lat : float The latitude of the telescope (declination of zenith). imgpsf : str or HDUList Filename or HDUList for a psf image. blank : bool Cause the output image to be blanked where islands are found. docov : bool If True then include covariance matrix in the fitting process. (default=True) cube_index : int For image cubes, cube_index determines which slice is used. Returns ------- sources : list List of sources found.", "label": 1, "domain": "code", "token_count": 386, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0194", "text": "Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of UAS data (also known as database). When newer data available, it automatically loads and updates it. Additionally the loaded data are stored in a cache file.

    At initialization time the returned parser will be loaded with the UAS data of the cache file. If the cache file doesn't exist or is empty the data of this module will be loaded. The initialization is started only when this method is called the first time.

    The update of the data store runs as background task. With this feature we try to reduce the initialization time of this UserAgentStringParser, because a network connection is involved and the remote system can be not available or slow.

    The static class definition {@code CachingAndUpdatingParserHolder} within this factory class is not initialized until the JVM determines that {@code CachingAndUpdatingParserHolder} must be executed. The static class {@code CachingAndUpdatingParserHolder} is only executed when the static method {@code getOnlineUserAgentStringParser} is invoked on the class {@code UADetectorServiceFactory}, and the first time this happens the JVM will load and initialize the {@code CachingAndUpdatingParserHolder} class.

    If during the operation the Internet connection gets lost, then this instance continues to work properly (and under correct log level settings you will get an corresponding log messages). @param dataUrl @param versionUrl @return an user agent string parser with updating service", "label": 1, "domain": "code", "token_count": 337, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0195", "text": "Function: addHandler Add a stanza handler for the connection. This function adds a stanza handler to the connection. The handler callback will be called for any stanza that matches the parameters. Note that if multiple parameters are supplied, they must all match for the handler to be invoked. The handler will receive the stanza that triggered it as its argument. *The handler should return true if it is to be invoked again; returning false will remove the handler after it returns.* As a convenience, the ns parameters applies to the top level element and also any of its immediate children. This is primarily to make matching /iq/query elements easy. The options argument contains handler matching flags that affect how matches are determined. Currently the only flag is matchBare (a boolean). When matchBare is true, the from parameter and the from attribute on the stanza will be matched as bare JIDs instead of full JIDs. To use this, pass {matchBare: true} as the value of options. The default value for matchBare is false. The return value should be saved if you wish to remove the handler with deleteHandler(). Parameters: (Function) handler - The user callback. (String) ns - The namespace to match. (String) name - The stanza name to match. (String) type - The stanza type attribute to match. (String) id - The stanza id attribute to match. (String) from - The stanza from attribute to match. (String) options - The handler options Returns: A reference to the handler that can be used to remove it.", "label": 1, "domain": "code", "token_count": 317, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0196", "text": "Gets a nested property value from an object using the given path.
    The path is a string with property names separated by dots by default, but it can be customised with the optional third parameter.
    You can use integers in the path, even negative ones, to refer to array-like object indexes, but the priority will be given to existing object keys: the last example explains this particular case. @example var user = { name: \"John\", surname: \"Doe\", login: { \"user.name\": \"jdoe\", password: \"abc123\" }, scores: [ {id: 1, value: 10}, {id: 2, value: 20}, {id: 3, value: 30} ] }; _.getPathIn(user, \"name\") // => \"John\" _.getPathIn(user, \"login.password\") // => \"abc123\"; _.getPathIn(user, \"login/user.name\", \"/\") // => \"jdoe\" _.getPathIn(user, \"name.foo\") // => undefined _.getPathIn(user, \"name.foo.bar\") // => undefined @example Accessing array-like objects indexes: _.getPathIn(user, \"login.password.1\") // => \"b\" _.getPathIn(user, \"scores.0\") // => {id: 1, value: 10} _.getPathIn(user, \"scores.-1.value\") // => 30 @example Priority will be given to existing object keys over indexes: _.getPathIn(user, \"scores.-1\") // => {id: 3, value: 30} // let's do something funny user.scores[\"-1\"] = \"foo bar\"; _.getPathIn(user, \"scores.-1\") // => \"foo bar\"; @memberof module:lamb @category Object @see {@link module:lamb.getPath|getPath} @see {@link module:lamb.getIn|getIn}, {@link module:lamb.getKey|getKey} @since 0.19.0 @param {Object|ArrayLike} obj @param {String} path @param {String} [separator=\".\"] @returns {*}", "label": 1, "domain": "code", "token_count": 446, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0197", "text": "Position nodes using ForceAtlas2 force-directed algorithm Parameters ---------- graph: NetworkX graph A position will be assigned to every node in G. pos_list : dict or None optional (default=None) Initial positions for nodes as a dictionary with node as keys and values as a coordinate list or tuple. If None, then use random initial positions. node_masses : dict or None optional (default=None) Predefined masses for nodes with node as keys and masses as values. If None, then use degree of nodes. iterations : int optional (default=50) Number of iterations outbound_attraction_distribution : boolean Distributes attraction along outbound edges. Hubs attract less and thus are pushed to the borders. This mode is meant to grant authorities (nodes with a high indegree) a more central position than hubs (nodes with a high outdegree). This is useful for social networks and web networks, where authorities are sometimes considered more important than hubs lin_log_mode: boolean Switch ForceAtlas model from lin-lin to lin-log (tribute to Andreas Noack). Makes clusters more tight prevent_overlapping: boolean With this mode enabled, the repulsion is modified so that the nodes do not overlap. The goal is to produce a more readable and aesthetically pleasing image. edge_weight_influence: float How much influence you give to the edges weight. 0 is “no influence” and 1 is “normal”. jitter_tolerance: float How much swinging you allow. Above 1 discouraged. Lower gives less speed and more precision barnes_hut_optimize: boolean Barnes Hut optimization: n² complexity to n.ln(n) ; allows larger graphs. barnes_hut_theta: float Theta of the Barnes Hut optimization scaling_ratio: float How much repulsion you want. More makes a more sparse graph. strong_gravity_mode: boolean The “Strong gravity” option sets a force that attracts the nodes that are distant from the center more ( is this distance). This force has the drawback of being so strong that it is sometimes stronger than the other forces. It may result in a biased placement of the nodes. However, its advantage is to force a very compact layout, which may be useful for certain purposes. multithread: boolean gravity: float Attracts nodes to the center. Prevents islands from drifting away. Returns ------- pos : dict A dictionary of positions keyed by node", "label": 1, "domain": "code", "token_count": 476, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0198", "text": "Compute Pi_V conditioned on J. This function returns the Pi array from the model factors of the V genomic contributions, P(V, J)*P(delV|V). This corresponds to V(J)_{x_1}. For clarity in parsing the algorithm implementation, we include which instance attributes are used in the method as 'parameters.' Parameters ---------- CDR3_seq : str CDR3 sequence composed of 'amino acids' (single character symbols each corresponding to a collection of codons as given by codons_dict). V_usage_mask : list Indices of the V alleles to be considered in the Pgen computation J_usage_mask : list Indices of the J alleles to be considered in the Pgen computation self.cutV_genomic_CDR3_segs : list of strings List of all the V genomic nucleotide sequences trimmed to begin at the conserved C residue and with the maximum number of palindromic insertions appended. self.PVdelV_nt_pos_vec : list of ndarrays For each V allele, format P(delV|V) into the correct form for a Pi array or V(J)_{x_1}. This is only done for the first and last position in each codon. self.PVdelV_2nd_nt_pos_per_aa_vec : list of dicts For each V allele, and each 'amino acid', format P(V)*P(delV|V) for positions in the middle of a codon into the correct form for a Pi array or V(J)_{x_1} given the 'amino acid'. self.PVJ : ndarray Joint probability distribution of V and J, P(V, J). Returns ------- Pi_V_given_J : list List of (4, 3L) ndarrays corresponding to V(J)_{x_1}. max_V_align: int Maximum alignment of the CDR3_seq to any genomic V allele allowed by V_usage_mask.", "label": 1, "domain": "code", "token_count": 388, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0199", "text": "Check if the user has permission to perform a given action on an object. can? :destroy, @project You can also pass the class instead of an instance (if you don't have one handy). can? :create, Project Nested resources can be passed through a hash, this way conditions which are dependent upon the association will work when using a class. can? :create, @category => Project You can also pass multiple objects to check. You only need to pass a hash following the pattern { :any => [many subjects] }. The behaviour is check if there is a permission on any of the given objects. can? :create, {:any => [Project, Rule]} Any additional arguments will be passed into the \"can\" block definition. This can be used to pass more information about the user's request for example. can? :create, Project, request.remote_ip can :create, Project do |project, remote_ip| # ... end Not only can you use the can? method in the controller and view (see ControllerAdditions), but you can also call it directly on an ability instance. ability.can? :destroy, @project This makes testing a user's abilities very easy. def test \"user can only destroy projects which he owns\" user = User.new ability = Ability.new(user) assert ability.can?(:destroy, Project.new(:user => user)) assert ability.cannot?(:destroy, Project.new) end Also see the RSpec Matchers to aid in testing.", "label": 1, "domain": "code", "token_count": 300, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0200", "text": "Creates a new resolver object for a registry. @param registry [Registry] only set this if customizing the registry object Performs a lookup on a given path in the registry. Resolution will occur in a similar way to standard Ruby identifier resolution, doing lexical lookup, as well as (optionally) through the inheritance chain. A proxy object can be returned if the lookup fails for future resolution. The proxy will be type hinted with the +type+ used in the original lookup. @option opts namespace [CodeObjects::Base, :root, nil] (nil) the namespace object to start searching from. If root or nil is provided, {Registry.root} is assumed. @option opts inheritance [Boolean] (false) whether to perform lookups through the inheritance chain (includes mixins) @option opts proxy_fallback [Boolean] (false) when true, a proxy is returned if no match is found @option opts type [Symbol] (nil) an optional type hint for the resolver to consider when performing a lookup. If a type is provided and the resolved object's type does not match the hint, the object is discarded. @return [CodeObjects::Base, CodeObjects::Proxy, nil] the first object that matches the path lookup. If proxy_fallback is provided, a proxy object will be returned in the event of no match, otherwise nil will be returned. @example A lookup from root resolver.lookup_by_path(\"A::B::C\") @example A lookup from the A::B namespace resolver.lookup_by_path(\"C\", namespace: P(\"A::B\")) @example A lookup on a method through the inheritance tree resolver.lookup_by_math(\"A::B#foo\", inheritance: true)", "label": 1, "domain": "code", "token_count": 346, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0201", "text": "Compute Pi_J. This function returns the Pi array from the model factors of the J genomic contributions, P(delJ|J). This corresponds to J(D)^{x_4}. For clarity in parsing the algorithm implementation, we include which instance attributes are used in the method as 'parameters.' Parameters ---------- CDR3_seq : str CDR3 sequence composed of 'amino acids' (single character symbols each corresponding to a collection of codons as given by codons_dict). J_usage_mask : list Indices of the J alleles to be considered in the Pgen computation self.cutJ_genomic_CDR3_segs : list of strings List of all the J genomic nucleotide sequences trimmed to begin at the conserved 3' residue (F/W) and with the maximum number of palindromic insertions appended. self.PJdelJ_nt_pos_vec : list of ndarrays For each J allele, format P(delJ|J) into the correct form for a Pi array or J^{x_2}. This is only done for the first and last position in each codon. self.PJdelJ_2nd_nt_pos_per_aa_vec : list of dicts For each J allele, and each 'amino acid', format P(delJ|J) for positions in the middle of a codon into the correct form for a Pi array or J^{x_2} given the 'amino acid'. Returns ------- Pi_J : ndarray (4, 3L) array corresponding to J^{x_4}. r_J_usage_mask: list Reduced J_usage mask. J genes/alleles with no contribution (bad alignment) are removed from the mask. This is done to speed up the computation on the V side (which must be done conditioned on the J).", "label": 1, "domain": "code", "token_count": 362, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0202", "text": "Edit an issue = Inputs :title - Required string :content - Optional string :responsible - Optional string - Login for the user that this issue should be assigned to. :milestone - Optional number - Milestone to associate this issue with :version - Optional number - Version to associate this issue with :component - Optional number - Component to associate this issue with :priority - Optional string - The priority of this issue * trivial * minor * major * critical * blocker :status - Optional string - The status of this issue * new * open * resolved * on hold * invalid * duplicate * wontfix :kind - Optional string - The kind of issue * bug * enhancement * proposal * task = Examples bitbucket = BitBucket.new :user => 'user-name', :repo => 'repo-name' bitbucket.issues.create \"title\" => \"Found a bug\", \"content\" => \"I'm having a problem with this.\", \"responsible\" => \"octocat\", \"milestone\" => 1, \"priority\" => \"blocker\"", "label": 1, "domain": "code", "token_count": 357, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0203", "text": "Get interface ip details. Returns a dict of dicts Example Output: { u'FastEthernet8': { 'ipv4': { u'10.66.43.169': { 'prefix_length': 22}}}, u'Loopback555': { 'ipv4': { u'192.168.1.1': { 'prefix_length': 24}}, 'ipv6': { u'1::1': { 'prefix_length': 64}, u'2001:DB8:1::1': { 'prefix_length': 64}, u'2::': { 'prefix_length': 64}, u'FE80::3': { 'prefix_length': 10}}}, u'Tunnel0': { 'ipv4': { u'10.63.100.9': { 'prefix_length': 24}}}, u'Tunnel1': { 'ipv4': { u'10.63.101.9': { 'prefix_length': 24}}}, u'Vlan100': { 'ipv4': { u'10.40.0.1': { 'prefix_length': 24}, u'10.41.0.1': { 'prefix_length': 24}, u'10.65.0.1': { 'prefix_length': 24}}}, u'Vlan200': { 'ipv4': { u'10.63.176.57': { 'prefix_length': 29}}}}", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0204", "text": "Get users. (asynchronously) Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters. @param aioId A unique ID generated on the client (browser) when sending an API request that returns an asynchronous response. (required) @param limit Limit the number of users the Provisioning API should return. (optional) @param offset The number of matches the Provisioning API should skip in the returned users. (optional) @param order The sort order. (optional) @param sortBy A comma-separated list of fields to sort on. Possible values are firstName, lastName, and userName. (optional) @param filterName The name of a filter to use on the results. (optional) @param filterParameters A part of the users first or last name, if you use the FirstNameOrLastNameMatches filter. (optional) @param roles Return only return users who have these Workspace Web Edition roles. The roles can be specified in a comma-separated list. Possible values are ROLE_AGENT and ROLE_ADMIN,ROLE_SUPERVISOR. (optional) @param skills Return only users who have these skills. The skills can be specified in a comma-separated list. (optional) @param userEnabled Return only enabled or disabled users. (optional) @param userValid Return only valid or invalid users. (optional) @param callback The callback to be executed when the API call finishes @return The request call @throws ApiException If fail to process the API call, e.g. serializing the request body object", "label": 1, "domain": "code", "token_count": 322, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0205", "text": "Configures the given context with the given stage handling settings, but only if stage handling is not already configured on the given context OR if forceConfiguration is true. The stage handling settings determine how {@linkcode resolveStage}, {@linkcode toStageQualifiedStreamName}, {@linkcode extractStageFromQualifiedStreamName}, {@linkcode toStageQualifiedResourceName}, {@linkcode extractStageFromQualifiedStreamName} and other internal functions will behave when invoked. @param {Object|StandardContext|StageHandling|Logger} context - the context onto which to configure stage handling settings @param {StageHandlingSettings} [context.stageHandling] - previously configured stage handling settings on the context (if any) @param {StageHandlingSettings} settings - the new stage handling settings to use @param {Object|StandardSettings|undefined} [otherSettings] - optional other configuration settings to use @param {LoggingSettings|undefined} [otherSettings.logging] - optional logging settings to use to configure logging @param {LoggingSettings|undefined} [otherSettings.loggingSettings] - LEGACY optional logging settings to use to configure logging (NB: otherSettings.loggingSettings will be ignored if otherSettings.logging is defined) @param {Object|StandardOptions|undefined} [otherOptions] - optional other configuration options to use if no corresponding other settings are provided @param {LoggingOptions|undefined} [otherOptions.logging] - optional logging options to use to configure logging @param {LoggingOptions|undefined} [otherOptions.loggingOptions] - LEGACY optional logging options to use to configure logging (NB: otherOptions.loggingOptions will be ignored if otherOptions.logging is defined) @param {boolean|undefined} [forceConfiguration] - whether or not to force configuration of the given settings, which will override any previously configured stage handling settings on the given context @return {StageHandling|StandardContext} the context object configured with stage handling settings and logging functionality", "label": 1, "domain": "code", "token_count": 389, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0206", "text": "

    Perform an HTML 4 level 2 (result is ASCII) escape operation on a String input.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding HTML 4 Named Character References (e.g. '&acute;') when such NCR exists for the replaced character, and replacing by a decimal character reference (e.g. '&#8345;') when there there is no NCR for the replaced character.

    This method calls {@link #escapeHtml(String, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 419, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0207", "text": "Gets the health of a Service Fabric cluster using health chunks. Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. The query description allows users to specify health policies for evaluating the cluster and its children. Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return only services that are in Error or Warning, and all partitions and replicas for one of these services. @param cluster_health_chunk_query_description [ClusterHealthChunkQueryDescription] Describes the cluster and application health policies used to evaluate the cluster health and the filters to select which cluster entities to be returned. If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. If the application health policy map is specified, and it has an entry for an application, the specified application health policy is used to evaluate the application health. Users can specify very flexible filters to select which cluster entities to include in response. The selection can be done based on the entities health state and based on the hierarchy. The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return only services that are in Error or Warning, and all partitions and replicas for one of these services. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ClusterHealthChunk] operation results.", "label": 1, "domain": "code", "token_count": 462, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0208", "text": "Does de novo, abundance based chimera checking with usearch61 abundance_fp: input consensus fasta file with abundance information for each cluster. uchime_denovo_fp: output uchime file for chimera results. minlen: minimum sequence length for usearch input fasta seqs. output_dir: output directory removed_usearch_logs: suppresses creation of log file. uchime_denovo_log_fp: output filepath for log file. usearch61_minh: Minimum score (h) to be classified as chimera. Increasing this value tends to the number of false positives (and also sensitivity). usearch61_xn: Weight of \"no\" vote. Increasing this value tends to the number of false positives (and also sensitivity). usearch61_dn: Pseudo-count prior for \"no\" votes. (n). Increasing this value tends to the number of false positives (and also sensitivity). usearch61_mindiffs: Minimum number of diffs in a segment. Increasing this value tends to reduce the number of false positives while reducing sensitivity to very low-divergence chimeras. usearch61_mindiv: Minimum divergence, i.e. 100% - identity between the query and closest reference database sequence. Expressed as a percentage, so the default is 0.8%, which allows chimeras that are up to 99.2% similar to a reference sequence. usearch61_abundance_skew: abundance skew for de novo chimera comparisons. HALTEXEC: halt execution and returns command used for app controller.", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0209", "text": " Generate public and private RSA keys, with modulus length 'bits'. In addition, a keyid identifier for the RSA key is generated. The object returned conforms to 'securesystemslib.formats.RSAKEY_SCHEMA' and has the form: {'keytype': 'rsa', 'scheme': 'rsassa-pss-sha256', 'keyid': keyid, 'keyval': {'public': '-----BEGIN RSA PUBLIC KEY----- ...', 'private': '-----BEGIN RSA PRIVATE KEY----- ...'}} The public and private keys are strings in PEM format. Although the PyCA cryptography library and/or its crypto backend might set a minimum key size, generate() enforces a minimum key size of 2048 bits. If 'bits' is unspecified, a 3072-bit RSA key is generated, which is the key size recommended by securesystemslib. These key size restrictions are only enforced for keys generated within securesystemslib. RSA keys with sizes lower than what we recommended may still be imported (e.g., with import_rsakey_from_pem(). >>> rsa_key = generate_rsa_key(bits=2048) >>> securesystemslib.formats.RSAKEY_SCHEMA.matches(rsa_key) True >>> public = rsa_key['keyval']['public'] >>> private = rsa_key['keyval']['private'] >>> securesystemslib.formats.PEMRSA_SCHEMA.matches(public) True >>> securesystemslib.formats.PEMRSA_SCHEMA.matches(private) True bits: The key size, or key length, of the RSA key. 'bits' must be 2048, or greater, and a multiple of 256. scheme: The signature scheme used by the key. It must be one of ['rsassa-pss-sha256']. securesystemslib.exceptions.FormatError, if 'bits' is improperly or invalid (i.e., not an integer and not at least 2048). ValueError, if an exception occurs after calling the RSA key generation routine. The 'ValueError' exception is raised by the key generation function of the cryptography library called. None. A dictionary containing the RSA keys and other identifying information. Conforms to 'securesystemslib.formats.RSAKEY_SCHEMA'.", "label": 1, "domain": "code", "token_count": 464, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0210", "text": "Bind events listener on each element of elements. @param {(string|Array|NodeList|HTMLCollection|EventTarget)} elements - The iterable, selector or elements. @param {Object.} input - An object in which keys are events to bind seperated with coma and/or spaces and values are eventCallbacks or EventObjects. @return {offCallback} off - The unbinding function. @example //esnext import { createElement, append, on, trigger } from 'chirashi' const maki = createElement('a.cheese.maki') const sushi = createElement('a.wasabi.sushi') append(document.body, [maki, sushi]) const off = on('.cheese, .wasabi', { click(e, target) { console.log('clicked', target) }, 'mouseenter mousemove': { handler: (e, target) => { console.log('mouse in', target) }, passive: true } }) trigger(maki, 'click') //simulate user's click // LOGS: \"clicked\" trigger(sushi, 'click') //simulate user's click // LOGS: \"clicked\" off(maki, 'click') //remove click event listener on maki off() //remove all listeners from all elements @example //es5 var off = Chirashi.bind('.cheese, .wasabi', { 'click': function (e, target) { console.log('clicked', target) }, 'mouseenter mousemove': { handler: (e, target) => { console.log('mouse in', target) }, passive: true } }) var maki = Chirashi.createElement('a.cheese.maki') var sushi = Chirashi.createElement('a.wasabi.sushi') Chirashi.append(document.body, [maki, sushi]) Chirashi.trigger(maki, 'click') //simulate user's click // LOGS: \"clicked\" Chirashi.trigger(sushi, 'click') //simulate user's click // LOGS: \"clicked\" off(maki, 'click') //remove click event listener on maki off() //remove all listeners from all elements", "label": 1, "domain": "code", "token_count": 485, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0211", "text": "Sends an exception to Honeybadger. Does not report ignored exceptions by default. @example # With an exception: begin fail 'oops' rescue => exception Honeybadger.notify(exception, context: { my_data: 'value' }) # => '-1dfb92ae-9b01-42e9-9c13-31205b70744a' end # Custom notification: Honeybadger.notify('Something went wrong.', { error_class: 'MyClass', context: {my_data: 'value'} }) # => '06220c5a-b471-41e5-baeb-de247da45a56' @param [Exception, Hash, Object] exception_or_opts An Exception object, or a Hash of options which is used to build the notice. All other types of objects will be converted to a String and used as the :error_message. @param [Hash] opts The options Hash when the first argument is an Exception. @option opts [String] :error_message The error message. @option opts [String] :error_class ('Notice') The class name of the error. @option opts [Array] :backtrace The backtrace of the error (optional). @option opts [String] :fingerprint The grouping fingerprint of the exception (optional). @option opts [Boolean] :force (false) Always report the exception when true, even when ignored (optional). @option opts [String] :tags The comma-separated list of tags (optional). @option opts [Hash] :context The context to associate with the exception (optional). @option opts [String] :controller The controller name (such as a Rails controller) (optional). @option opts [String] :action The action name (such as a Rails controller action) (optional). @option opts [Hash] :parameters The HTTP request paramaters (optional). @option opts [Hash] :session The HTTP request session (optional). @option opts [String] :url The HTTP request URL (optional). @option opts [Exception] :cause The cause for this error (optional). @return [String] UUID reference to the notice within Honeybadger. @return [false] when ignored.", "label": 1, "domain": "code", "token_count": 452, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0212", "text": "This is the sigma instances constructor. One instance of sigma represent one graph. It is possible to represent this grapĥ with several renderers at the same time. By default, the default renderer (WebGL + Canvas polyfill) will be used as the only renderer, with the container specified in the configuration. @param {?*} conf The configuration of the instance. There are a lot of different recognized forms to instantiate sigma, check example files, documentation in this file and unit tests to know more. @return {sigma} The fresh new sigma instance. Instanciating sigma: ******************** If no parameter is given to the constructor, the instance will be created without any renderer or camera. It will just instantiate the graph, and other modules will have to be instantiated through the public methods, like \"addRenderer\" etc: > s0 = new sigma(); > s0.addRenderer({ > type: 'canvas', > container: 'my-container-id' > }); In most of the cases, sigma will simply be used with the default renderer. Then, since the only required parameter is the DOM container, there are some simpler way to call the constructor. The four following calls do the exact same things: > s1 = new sigma('my-container-id'); > s2 = new sigma(document.getElementById('my-container-id')); > s3 = new sigma({ > container: document.getElementById('my-container-id') > }); > s4 = new sigma({ > renderers: [{ > container: document.getElementById('my-container-id') > }] > }); Recognized parameters: ********************** Here is the exhaustive list of every accepted parameters, when calling the constructor with to top level configuration object (fourth case in the previous examples): {?string} id The id of the instance. It will be generated automatically if not specified. {?array} renderers An array containing objects describing renderers. {?object} graph An object containing an array of nodes and an array of edges, to avoid having to add them by hand later. {?object} settings An object containing instance specific settings that will override the default ones defined in the object sigma.settings.", "label": 1, "domain": "code", "token_count": 430, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0213", "text": "Constructs a path. @alias Path @constructor @augments AbstractShape @classdesc Represents a line, curve or curtain between specified positions. The path is drawn between input positions to achieve a specified path type, which can be one of the following:
    • [WorldWind.GREAT_CIRCLE]{@link WorldWind#GREAT_CIRCLE}
    • [WorldWind.RHUMB_LINE]{@link WorldWind#RHUMB_LINE}
    • [WorldWind.LINEAR]{@link WorldWind#LINEAR}

    Paths conform to the terrain if the path's [followTerrain]{@link Path#followTerrain} property is true.

    Altitudes within the path's positions are interpreted according to the path's altitude mode, which can be one of the following:

    • [WorldWind.ABSOLUTE]{@link WorldWind#ABSOLUTE}
    • [WorldWind.RELATIVE_TO_GROUND]{@link WorldWind#RELATIVE_TO_GROUND}
    • [WorldWind.CLAMP_TO_GROUND]{@link WorldWind#CLAMP_TO_GROUND}
    If the latter, the path positions' altitudes are ignored.

    Paths have separate attributes for normal display and highlighted display. They use the interior and outline attributes of {@link ShapeAttributes} but do not use the image attributes.

    A path displays as a curtain if its [extrude]{@link Path#extrude} property is true. A curtain extends from the line formed by the path positions to the ground.

    This shape uses a {@link SurfacePolyline} when drawing on 2D globes and this shape's [useSurfaceShapeFor2D]{@link AbstractShape#useSurfaceShapeFor2D} is true. @param {Position[]} positions An array containing the path positions. @param {ShapeAttributes} attributes The attributes to associate with this path. May be null, in which case default attributes are associated. @throws {ArgumentError} If the specified positions array is null or undefined.", "label": 1, "domain": "code", "token_count": 440, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0214", "text": "Answers true if a sub-pattern matches the subpart of the given name, false otherwise. char[] pattern matching, accepting wild-cards '*' and '?'. Can match only subset of name/pattern. end positions are non-inclusive. The subpattern is defined by the patternStart and pattternEnd positions. When not case sensitive, the pattern is assumed to already be lowercased, the name will be lowercased character per character as comparing.

    For example:

    1.  pattern = { '?', 'b', '*' } patternStart = 1 patternEnd = 3 name = { 'a', 'b', 'c' , 'd' } nameStart = 1 nameEnd = 4 isCaseSensitive = true result => true 
    2.  pattern = { '?', 'b', '*' } patternStart = 1 patternEnd = 2 name = { 'a', 'b', 'c' , 'd' } nameStart = 1 nameEnd = 2 isCaseSensitive = true result => false 
    @param pattern the given pattern @param patternStart the given pattern start @param patternEnd the given pattern end @param name the given name @param nameStart the given name start @param nameEnd the given name end @param isCaseSensitive flag to know if the matching should be case sensitive @return true if a sub-pattern matches the subpart of the given name, false otherwise", "label": 1, "domain": "code", "token_count": 319, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0215", "text": "Creates a set of tunnel connections based upon the pathAndTunnels. Each entry of pathAndTunnels must be of the form (in EBNF):
     path and tunnels = path and tunnel, {new line, path and tunnel} path and tunnel = path, \"|\", tunnel new line = \"\\n\" path = path part, {\"->\", path part} path part = {user, \"@\"}, hostname tunnel = {local part}, \":\", destination hostname, \":\", destination port local part = {local alias, \":\"}, local port local alias = hostname local port = port destination hostname = hostname destination port = port user = ? user name ? hostname = ? hostname ? port = ? port ? 

    For example:

    jimhenson@admin.muppets.com->animal@drteethandtheelectricmahem.muppets.com|drteeth:8080:drteeth.muppets.com:80

    Says open an ssh connection as user jimhenson to host admin.muppets.com. Then, through that connection, open a connection as user animal to host drteethandtheelectricmahem.muppets.com. Then map local port 8080 on the interface with alias drteeth through the two-hop tunnel to port 80 on drteeth.muppets.com.

    @param pathAndSpecList A list of path and spec entries @throws JSchException For connection failures", "label": 1, "domain": "code", "token_count": 387, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0216", "text": "Prepare the actual |anntools.SeasonalANN| object for calculations. Dispite all automated refreshings explained in the general documentation on class |anntools.SeasonalANN|, it is still possible to destroy the inner consistency of a |anntools.SeasonalANN| instance, as it stores its |anntools.ANN| objects by reference. This is shown by the following example: >>> from hydpy import SeasonalANN, ann >>> seasonalann = SeasonalANN(None) >>> seasonalann.simulationstep = '1d' >>> jan = ann(nmb_inputs=1, nmb_neurons=(1,), nmb_outputs=1, ... weights_input=0.0, weights_output=0.0, ... intercepts_hidden=0.0, intercepts_output=1.0) >>> seasonalann(_1_1_12=jan) >>> jan.nmb_inputs, jan.nmb_outputs = 2, 3 >>> jan.nmb_inputs, jan.nmb_outputs (2, 3) >>> seasonalann.nmb_inputs, seasonalann.nmb_outputs (1, 1) Due to the C level implementation of the mathematical core of both |anntools.ANN| and |anntools.SeasonalANN| in module |annutils|, such an inconsistency might result in a program crash without any informative error message. Whenever you are afraid some inconsistency might have crept in, and you want to repair it, call method |anntools.SeasonalANN.refresh| explicitly: >>> seasonalann.refresh() >>> jan.nmb_inputs, jan.nmb_outputs (2, 3) >>> seasonalann.nmb_inputs, seasonalann.nmb_outputs (2, 3)", "label": 1, "domain": "code", "token_count": 347, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0217", "text": "

    Generates a stream by regrouping the elements of the provided stream and putting them in a substream. This grouping operation scans the elements of the stream using the open predicate. If this predicate is true, then it begins to add the elements of the stream in a substream. It will continue to add them until an element that matches the close predicate is met.

    The basic group operation includes the opening and the closing elements in the substreams. You can also provide two booleans if you need to customize this behavior.

    Example:

    {@code Stream stream = Stream.of(\"o\", \"a0\", \"a1\", \"a2\", \"c\", \"a3\", \"a4, \"o\", \"a5\", \"c\"); Stream> groupingStream = StreamsUtils.group(stream, \"o\"::equals, \"c\"::equals); List> collect = groupingStream.map(st -> st.collect(Collectors.toList())).collect(Collectors.toList()); // The collect list is [[\"o\", \"a0\", \"a1\", \"a2\", \"c\"][\"o\", \"a5\", \"c\"]] }

    If the provided stream is empty, then the returned stream contains an empty stream.

    An IllegalArgumentException will also be thrown if the provided stream is not ORDERED

    The returned stream has the same characteristics as the provided stream, and is thus ORDERED.

    A {@code {@link NullPointerException}} is thrown if the stream to be grouped or one of the predicate is null.

    @param stream The stream to be grouped. Will throw a NullPointerException if null. @param open The predicate used to check for an opening element. @param close The predicate used to check for an closing element. @param The type of the elements of the provided stream. @return A grouped stream of streams.", "label": 1, "domain": "code", "token_count": 441, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0218", "text": "Compute Pgen for CDR3 'amino acid' sequence CDR3_seq from VDJ model. Conditioned on the already formatted V genes/alleles indicated in V_usage_mask and the J genes/alleles in J_usage_mask. (Examples are TCRB sequences/model) Parameters ---------- CDR3_seq : str CDR3 sequence composed of 'amino acids' (single character symbols each corresponding to a collection of codons as given by codons_dict). V_usage_mask : list Indices of the V alleles to be considered in the Pgen computation J_usage_mask : list Indices of the J alleles to be considered in the Pgen computation Returns ------- pgen : float The generation probability (Pgen) of the sequence Examples -------- >>> compute_CDR3_pgen('CAWSVAPDRGGYTF', ppp, [42], [1]) 1.203646865765782e-10 >>> compute_CDR3_pgen(nt2codon_rep('TGTGCCTGGAGTGTAGCTCCGGACAGGGGTGGCTACACCTTC'), ppp, [42], [1]) 2.3986503758867323e-12 >>> compute_CDR3_pgen('\\xbb\\x96\\xab\\xb8\\x8e\\xb6\\xa5\\x92\\xa8\\xba\\x9a\\x93\\x94\\x9f', ppp, [42], [1]) 2.3986503758867323e-12", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0219", "text": "Get networkipv6 :param id_network: Identifier of the Network. Integer value and greater than zero. :return: Following dictionary: :: {'network': {'id': < id_networkIpv6 >, 'network_type': < id_tipo_rede >, 'ambiente_vip': < id_ambiente_viṕ >, 'vlan': 'block1': < rede_oct1 >, 'block2': < rede_oct2 >, 'block3': < rede_oct3 >, 'block4': < rede_oct4 >, 'block5': < rede_oct4 >, 'block6': < rede_oct4 >, 'block7': < rede_oct4 >, 'block8': < rede_oct4 >, 'blocK': < bloco >, 'mask1': < mascara_oct1 >, 'mask2': < mascara_oct2 >, 'mask3': < mascara_oct3 >, 'mask4': < mascara_oct4 >, 'mask5': < mascara_oct4 >, 'mask6': < mascara_oct4 >, 'mask7': < mascara_oct4 >, 'mask8': < mascara_oct4 >, 'active': < ativada >, }} :raise NetworkIPv6NotFoundError: NetworkIPV6 not found. :raise InvalidValueError: Invalid ID for NetworkIpv6 :raise NetworkIPv6Error: Error in NetworkIpv6 :raise XMLError: Networkapi failed to generate the XML response.", "label": 1, "domain": "code", "token_count": 307, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0220", "text": "@!group Associations @example Request syntax with placeholder values events = db_cluster.events({ start_time: Time.now, end_time: Time.now, duration: 1, event_categories: [\"String\"], filters: [ { name: \"String\", # required values: [\"String\"], # required }, ], }) @param [Hash] options ({}) @option options [Time,DateTime,Date,Integer,String] :start_time The beginning of the time interval to retrieve events for, specified in ISO 8601 format. For more information about ISO 8601, go to the [ISO8601 Wikipedia page.][1] Example: 2009-07-08T18:00Z [1]: http://en.wikipedia.org/wiki/ISO_8601 @option options [Time,DateTime,Date,Integer,String] :end_time The end of the time interval for which to retrieve events, specified in ISO 8601 format. For more information about ISO 8601, go to the [ISO8601 Wikipedia page.][1] Example: 2009-07-08T18:00Z [1]: http://en.wikipedia.org/wiki/ISO_8601 @option options [Integer] :duration The number of minutes to retrieve events for. Default: 60 @option options [Array] :event_categories A list of event categories that trigger notifications for a event notification subscription. @option options [Array] :filters This parameter is not currently supported. @return [Event::Collection]", "label": 1, "domain": "code", "token_count": 309, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0221", "text": "Determine the water level based on an artificial neural network describing the relationship between water level and water stage. Required control parameter: |WaterVolume2WaterLevel| Required state sequence: |WaterVolume| Calculated aide sequence: |WaterLevel| Example: Prepare a dam model: >>> from hydpy.models.dam import * >>> parameterstep() Prepare a very simple relationship based on one single neuron: >>> watervolume2waterlevel( ... nmb_inputs=1, nmb_neurons=(1,), nmb_outputs=1, ... weights_input=0.5, weights_output=1.0, ... intercepts_hidden=0.0, intercepts_output=-0.5) At least in the water volume range used in the following examples, the shape of the relationship looks acceptable: >>> from hydpy import UnitTest >>> test = UnitTest( ... model, model.calc_waterlevel_v1, ... last_example=10, ... parseqs=(states.watervolume, aides.waterlevel)) >>> test.nexts.watervolume = range(10) >>> test() | ex. | watervolume | waterlevel | ---------------------------------- | 1 | 0.0 | 0.0 | | 2 | 1.0 | 0.122459 | | 3 | 2.0 | 0.231059 | | 4 | 3.0 | 0.317574 | | 5 | 4.0 | 0.380797 | | 6 | 5.0 | 0.424142 | | 7 | 6.0 | 0.452574 | | 8 | 7.0 | 0.470688 | | 9 | 8.0 | 0.482014 | | 10 | 9.0 | 0.489013 | For more realistic approximations of measured relationships between water level and volume, larger neural networks are required.", "label": 1, "domain": "code", "token_count": 403, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0222", "text": "

    Perform an HTML 4 level 1 (XML-style) escape operation on a String input.

    Level 1 means this method will only escape the five markup-significant characters: <, >, &, " and '. It is called XML-style in order to link it with JSP's escapeXml attribute in JSTL's <c:out ... /> tags.

    Note this method may not produce the same results as {@link #escapeHtml5Xml(String)} because it will escape the apostrophe as &#39;, whereas in HTML5 there is a specific NCR for such character (&apos;).

    This method calls {@link #escapeHtml(String, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 432, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0223", "text": "Runs a simple checksum on a file and returns the result as a int64. The algorithm can be one of the following constants: CHECKSUM_BYTE - Treats the file as a set of unsigned bytes CHECKSUM_SHORT_LE - Treats the file as a set of unsigned little-endian shorts CHECKSUM_SHORT_BE - Treats the file as a set of unsigned big-endian shorts CHECKSUM_INT_LE - Treats the file as a set of unsigned little-endian ints CHECKSUM_INT_BE - Treats the file as a set of unsigned big-endian ints CHECKSUM_INT64_LE - Treats the file as a set of unsigned little-endian int64s CHECKSUM_INT64_BE - Treats the file as a set of unsigned big-endian int64s CHECKSUM_SUM8 - Same as CHECKSUM_BYTE except result output as 8-bits CHECKSUM_SUM16 - Same as CHECKSUM_BYTE except result output as 16-bits CHECKSUM_SUM32 - Same as CHECKSUM_BYTE except result output as 32-bits CHECKSUM_SUM64 - Same as CHECKSUM_BYTE CHECKSUM_CRC16 CHECKSUM_CRCCCITT CHECKSUM_CRC32 CHECKSUM_ADLER32 If start and size are zero, the algorithm is run on the whole file. If they are not zero then the algorithm is run on size bytes starting at address start. See the ChecksumAlgBytes and ChecksumAlgStr functions to run more complex algorithms. crcPolynomial and crcInitValue can be used to set a custom polynomial and initial value for the CRC functions. A value of -1 for these parameters uses the default values as described in the Check Sum/Hash Algorithms topic. A negative number is returned on error.", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0224", "text": "Parse the given inputs to in-memory maps to allow for summarisation. @param input The {@link Reader} containing the inputs to be summarised. @param inputMapper The {@link ObjectMapper} to use to parse the file into memory @param emptyCounts A {@link JDefaultDict} to be populated with empty counts for each field @param nonEmptyCounts A {@link JDefaultDict} to be populated with non-empty counts for each field @param possibleIntegerFields A {@link JDefaultDict} to be populated with false if a non-integer value is detected in a field @param possibleDoubleFields A {@link JDefaultDict} to be populated with false if a non-double value is detected in a field @param valueCounts A {@link JDefaultDict} to be populated with false if a non-integer value is detected in a field @param rowCount An {@link AtomicInteger} used to track the total number of rows processed. @param defaultValues A Map that is either empty, signifying there are no default values known, or exactly the same length as each row in the CSV file being parsed. If the values for a field are empty/missing, and a non-null, non-empty value appears in this list, it will be substituted in when calculating the statistics. @param basePath The path to go to before checking the field paths (only supports a single point of entry at this point in time). Set to \"/\" to start at the top of the document. If the basePath points to an array, each of the array elements are matched separately with the fieldRelativePaths. If it points to an object, the object is directly matched to obtain a single result row. Otherwise an exception is thrown. @param fieldRelativePaths The relative paths underneath the basePath to select field values from. @return The list of headers that were either overridden or found in the file @throws IOException If there is an error reading from the file @throws CSVStreamException If there is a problem processing the JSON content", "label": 1, "domain": "code", "token_count": 402, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0225", "text": "once every 5 minutes Construct a new Indexed Database store, which extends MemoryStore. This store functions like a MemoryStore except it periodically persists the contents of the store to an IndexedDB backend. All data is still kept in-memory but can be loaded from disk by calling startup(). This can make startup times quicker as a complete sync from the server is not required. This does not reduce memory usage as all the data is eagerly fetched when startup() is called.
     let opts = { localStorage: window.localStorage }; let store = new IndexedDBStore(); await store.startup(); // load from indexed db let client = sdk.createClient({ store: store, }); client.startClient(); client.on(\"sync\", function(state, prevState, data) { if (state === \"PREPARED\") { console.log(\"Started up, now with go faster stripes!\"); } }); 
    @constructor @extends MemoryStore @param {Object} opts Options object. @param {Object} opts.indexedDB The Indexed DB interface e.g. window.indexedDB @param {string=} opts.dbName Optional database name. The same name must be used to open the same database. @param {string=} opts.workerScript Optional URL to a script to invoke a web worker with to run IndexedDB queries on the web worker. The IndexedDbStoreWorker class is provided for this purpose and requires the application to provide a trivial wrapper script around it. @param {Object=} opts.workerApi The webWorker API object. If omitted, the global Worker object will be used if it exists. @prop {IndexedDBStoreBackend} backend The backend instance. Call through to this API if you need to perform specific indexeddb actions like deleting the database.", "label": 1, "domain": "code", "token_count": 365, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0226", "text": "Dichotomy search of subString in the suffix array. As soon as a suffix which starts with subString is found, it uses the LCPs in order to find the other matching suffixes. The outputs consists in a list of tuple (pos, feature0, feature1, ...) where feature0, feature1, ... are the features attached to the suffix at position pos. Features are listed in the same order as requested in the input list of features [featureName0, featureName1, ...] >>> SA=SuffixArray('mississippi', UNIT_BYTE) >>> SA.find(\"ssi\") array('i', [5, 2]) >>> SA.find(\"mi\") array('i', [0]) >>> SA=SuffixArray('miss A and miss B', UNIT_WORD) >>> SA.find(\"miss\") array('i', [0, 3]) >>> SA=SuffixArray('mississippi', UNIT_BYTE) >>> SA.find(\"iss\", ['LCP']) [(4, 1), (1, 4)] >>> SA=SuffixArray('mississippi', UNIT_BYTE) >>> SA.find(\"A\") array('i') >>> SA=SuffixArray('mississippi', UNIT_BYTE) >>> SA.find(\"pp\") array('i', [8]) >>> SA=SuffixArray('mississippi', UNIT_BYTE) >>> SA.find(\"ppp\") array('i') >>> SA=SuffixArray('mississippi', UNIT_BYTE) >>> SA.find(\"im\") array('i')", "label": 1, "domain": "code", "token_count": 302, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0227", "text": "

    Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) escape operation on a Reader input, writing results to a Writer.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    This method calls {@link #escapeXml11(Reader, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 424, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0228", "text": "Will inject a new view into an injection site by using the new view's transitionIn method. If the parent view previously had another view at this injections site, this previous view will be removed with that view's transitionOut. If this method is used within a render, the current views' injection sites will be cached so they can be transitioned out even though they are detached in the process of re-rendering. If no previous view is given and none can be found, the new view is transitioned in regardless. If the previous view is the same as the new view, it is injected normally without transitioning in. The previous view must has used an injection site with the standard \"inject=\" attribute to be found. @method transitionNewViewIntoSite @private @param injectionSiteName {String} The name of the injection site in the template. This is the value corresponding to the attribute \"inject\". @param newView {View} The instantiated view object to be transitioned into the injection site @param [options] {Object} optional options object. This options object will be passed on to the transitionIn and transitionOut methods as well. @param [options.previousView] {View} the view that should be transitioned out. If none is provided, it will look to see if a view already is at this injection site and uses that by default. @param [options.addBefore=false] {Boolean} if true, the new view's element will be added before the previous view's element. Defaults to after. @param [options.shared=false] {Boolean} if set to true, the view will be treated as a shared view and not disposed during parent view disposing. @return {Promise} resolved when all transitions are complete. No payload is provided upon resolution. When the transitionIn and transitionOut methods are invoked on the new and previous views, the options parameter will be passed on to them. Other fields will be added to the options parameter to allow better handling of the transitions. These include: { newView: the new view previousView: the previous view (can be undefined) parentView: the parent view transitioning in or out the tracked view }", "label": 1, "domain": "code", "token_count": 443, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0229", "text": "

    Perform am URI fragment identifier escape operation on a String input.

    The following are the only allowed chars in an URI fragment identifier (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the String to be escaped. @param encoding the encoding to be used for escaping. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 316, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0230", "text": "@exports TextIconOverlay as BMapLib.TextIconOverlay TextIconOverlay @class 此类表示地图上的一个覆盖物,该覆盖物由文字和图标组成,从Overlay继承。文字通常是数字(0-9)或字母(A-Z ),而文字与图标之间有一定的映射关系。 该覆盖物适用于以下类似的场景:需要在地图上添加一系列覆盖物,这些覆盖物之间用不同的图标和文字来区分,文字可能表示了该覆盖物的某一属性值,根据该文字和一定的映射关系,自动匹配相应颜色和大小的图标。 @constructor @param {Point} position 表示一个经纬度坐标位置。 @param {String} text 表示该覆盖物显示的文字信息。 @param {Json Object} options 可选参数,可选项包括:
    \"styles\":{Array} 一组图标风格。单个图表风格包括以下几个属性:
    url {String} 图片的url地址。(必选)
    size {Size} 图片的大小。(必选)
    anchor {Size} 图标定位在地图上的位置相对于图标左上角的偏移值,默认偏移值为图标的中心位置。(可选)
    offset {Size} 图片相对于可视区域的偏移值,此功能的作用等同于CSS中的background-position属性。(可选)
    textSize {Number} 文字的大小。(可选,默认10)
    textColor {String} 文字的颜色。(可选,默认black)
    ", "label": 1, "domain": "code", "token_count": 374, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0231", "text": "Function takes input of dictionary operator with the following keys operator = { \"fullName\" : \"\" , \"sessionTimeout\" : \"\", \"password\" : \"\", \"operatorGroupId\" : \"\", \"name\" : \"\", \"desc\" : \"\", \"defaultAcl\" : \"\", \"authType\" : \"\"} converts to json and issues a HTTP POST request to the HPE IMC Restful API :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param operator: dictionary with the required operator key-value pairs as defined above. :param headers: json formated string. default values set in module :return: :rtype: >>> import json >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.operator import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> operator = '''{ \"fullName\" : \"test administrator\", \"sessionTimeout\" : \"30\",\"password\" : \"password\",\"operatorGroupId\" : \"1\",\"name\" : \"testadmin\",\"desc\" : \"test admin account\",\"defaultAcl\" : \"\",\"authType\" : \"0\"}''' >>> operator = json.loads(operator) >>> delete_if_exists = delete_plat_operator('testadmin', auth.creds, auth.url) >>> new_operator = create_operator(operator, auth.creds, auth.url) >>> assert type(new_operator) is int >>> assert new_operator == 201 >>> fail_operator_create = create_operator(operator, auth.creds, auth.url) >>> assert type(fail_operator_create) is int >>> assert fail_operator_create == 409", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0232", "text": "Replies the intersection factor of the given segment when it is intersecting the triangle.

    If the segment and the triangle are not intersecting, this function replies {@link Double#NaN}. If the segment and the triangle are intersecting, this function replies the factor of the line's equation that permits to retreive the intersection point from the segment definition. This function implements the Badouel algorithm: D. Badouel, An efficient ray-polygon intersection, in: Graphics Gems, Academic Press, 1990. The algorithm of Jimenez et al. is faster than the algorithm of Badouel et al. @param tx1 x coordinate of the first point of the triangle. @param ty1 y coordinate of the first point of the triangle. @param tz1 z coordinate of the first point of the triangle. @param tx2 x coordinate of the second point of the triangle. @param ty2 y coordinate of the second point of the triangle. @param tz2 z coordinate of the second point of the triangle. @param tx3 x coordinate of the third point of the triangle. @param ty3 y coordinate of the third point of the triangle. @param tz3 z coordinate of the third point of the triangle. @param sx1 x coordinate of the first point of the segment. @param sy1 y coordinate of the first point of the segment. @param sz1 z coordinate of the first axis of the oriented box. @param sx2 x coordinate of the second point of the segment. @param sy2 y coordinate of the second point of the segment. @param sz2 z coordinate of the second axis of the oriented box. @return the factor that permits to compute the intersection point, {@link Double#NaN} when no intersection, {@link Double#POSITIVE_INFINITY} when an infinite number of intersection points. @see #getTriangleSegmentIntersectionFactorWithJimenezAlgorithm(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)", "label": 1, "domain": "code", "token_count": 424, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0233", "text": "Sorts the specified range of the receiver into ascending order, according to the natural ordering of its elements. All elements in this range must implement the Comparable interface. Furthermore, all elements in this range must be mutually comparable (that is, e1.compareTo(e2) must not throw a ClassCastException for any elements e1 and e2 in the array).

    This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.

    The sorting algorithm is a modified mergesort (in which the merge is omitted if the highest element in the low sublist is less than the lowest element in the high sublist). This algorithm offers guaranteed n*log(n) performance, and can approach linear performance on nearly sorted lists.

    You should never call this method unless you are sure that this particular sorting algorithm is the right one for your data set. It is generally better to call sort() or sortFromTo(...) instead, because those methods automatically choose the best sorting algorithm. @param from the index of the first element (inclusive) to be sorted. @param to the index of the last element (inclusive) to be sorted. @exception IndexOutOfBoundsException index is out of range (size()>0 && (from<0 || from>to || to>=size())).", "label": 1, "domain": "code", "token_count": 332, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0234", "text": "Return torrent files from a bucket. @option params [String, IO] :response_target Where to write response data, file path, or IO object. @option params [required, String] :bucket @option params [required, String] :key @option params [String] :request_payer Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html @return [Types::GetObjectTorrentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: * {Types::GetObjectTorrentOutput#body #body} => IO * {Types::GetObjectTorrentOutput#request_charged #request_charged} => String @example Example: To retrieve torrent files for an object # The following example retrieves torrent files of an object. resp = client.get_object_torrent({ bucket: \"examplebucket\", key: \"HappyFace.jpg\", }) resp.to_h outputs the following: { } @example Request syntax with placeholder values resp = client.get_object_torrent({ bucket: \"BucketName\", # required key: \"ObjectKey\", # required request_payer: \"requester\", # accepts requester }) @example Response structure resp.body #=> IO resp.request_charged #=> String, one of \"requester\" @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent AWS API Documentation @overload get_object_torrent(params = {}) @param [Hash] params ({})", "label": 1, "domain": "code", "token_count": 344, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0235", "text": "Raises ValidationException if value does not match the regular expression in regex. Returns the value argument. This is similar to calling inputStr() and using the allowlistRegexes keyword argument, however, validateRegex() allows you to pass regex flags such as re.IGNORECASE or re.VERBOSE. You can also pass a regex object directly. If you want to check if a string is a regular expression string, call validateRegexStr(). * value (str): The value being validated as a regular expression string. * regex (str, regex): The regular expression to match the value against. * flags (int): Identical to the flags argument in re.compile(). Pass re.VERBOSE et al here. * blank (bool): If True, a blank string will be accepted. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * excMsg (str): A custom message to use in the raised ValidationException. >>> pysv.validateRegex('cat bat rat', r'(cat)|(dog)|(moose)', re.IGNORECASE) 'cat' >>> pysv.validateRegex('He said \"Hello\".', r'\"(.*?)\"', re.IGNORECASE) '\"Hello\"'", "label": 1, "domain": "code", "token_count": 328, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0236", "text": "Avoid cyclic dependency. Will be filled by TableUtils Opens the context menu of a column or a data cell. If a column header cell or an element inside a column header cell is passed as the parameter oElement, the context menu of this column will be opened. If a data cell or an element inside a data cell is passed, then the context menu of this data cell will be opened. The context menu will not be opened, if the configuration of the table does not allow it, or one of the event handlers attached to the events ColumnSelect or CellContextmenu calls preventDefault(). On mobile devices, when trying to open a column context menu, a column header cell menu is created instead with buttons to actually open the column context menu or to resize the column. If this function is called when this cell menu already exists, then it is closed and the column context menu is opened. @param {sap.ui.table.Table} oTable Instance of the table. @param {jQuery | HTMLElement} oElement The header or data cell, or an element inside, for which to open the context menu. @param {boolean} [bHoverFirstMenuItem] If true, the first item in the opened menu will be hovered. @param {boolean} [bFireEvent=true] If true, an event will be fired. Fires the ColumnSelect event when a column context menu should be opened. Fires the CellContextmenu event when a data cell context menu should be opened. @param {jQuery.Event} oEvent Event object. @see openColumnContextMenu @see closeColumnContextMenu @see openDataCellContextMenu @see closeDataCellContextMenu @see applyColumnHeaderCellMenu @see removeColumnHeaderCellMenu", "label": 1, "domain": "code", "token_count": 380, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0237", "text": "Gets the list of replicas deployed on a Service Fabric node. Gets the list containing the information about replicas deployed on a Service Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return information about the deployed replicas matching the specified values for those parameters. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param partition_id The identity of the partition. @param service_manifest_name [String] The name of a service manifest registered as part of an application type in a Service Fabric cluster. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 303, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0238", "text": "

    Perform an XML 1.1 level 1 (only markup-significant chars) escape operation on a Reader input, writing results to a Writer.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    This method calls {@link #escapeXml11(Reader, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0239", "text": "Takes a Velocity \"UI pack effect\" definition and registers it with a unique key, returning that key (to later pass as a value for the \"animation\" property). Takes an optional suffix, which can be \"In\" or \"Out\" to modify UI Pack's behavior. Unlike what you get from passing a style hash to VelocityComponent's \"animation\" property, Velocity \"UI pack effects\" can have chained animation calls and specify a \"defaultDuration\", and also can take advantage of \"stagger\" and \"reverse\" options on the VelocityComponent. You will need to manually register the UI Pack with the global Velocity in your application with: require('velocity'); require('velocity-animate/velocity.ui'); See: http://julian.com/research/velocity/#uiPack Typical usage: var Animations = { down: VelocityHelpers.registerEffect({ defaultDuration: 1100, calls: [ [{ transformOriginX: [ '50%', '50%' ], transformOriginY: [ 0, 0 ], rotateX: [0, 'spring'], }, 1, { delay: 100, easing: 'ease-in', }] ], }), up: VelocityHelpers.registerEffect({ defaultDuration: 200, calls: [ [{ transformOriginX: [ '50%', '50%' ], transformOriginY: [ 0, 0 ], rotateX: 160, }] ], }), }; ... ... ", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0240", "text": "API to list number of files, event counts and number of lumis in a given block or dataset. If the optional run_num, output are: * The number of files which have data (lumis) for that run number; * The total number of events in those files; * The total number of lumis for that run_number. Note that in general this is different from the total number of lumis in those files, since lumis are filtered by the run_number they belong to, while events are only counted as total per file in the data before run 3. Howvere, when sumOverLumi=1, events will count by lumi when run_num is given while event_count/lumi is filled. If sumOverLumi=1, but event_count/lumi is not filled for any of the lumis in the block or dataset, then the API will return NULL for num_event. * The total num blocks that have the run_num; Either block_name or dataset name is required. No wild-cards are allowed :param block_name: Block name :type block_name: str :param dataset: Dataset name :type dataset: str :param run_num: Run number (Optional). Possible format are: run_num, 'run_min-run_max' or ['run_min-run_max', run1, run2, ...]. run_num=1 is for MC data and caused almost full table scan. So run_num=1 will cause an input error. :type run_num: int, str, list :param validFileOnly: default = 0. when = 1, only dataset_access_type = valid or production and is_file_valid=1 counted. :type validFileOnly: int :param sumOverLumi: default = 0. when = 1 count event_num by event_count/lumi. :type sumOverLumi: int :returns: List of dictionaries containing the following keys (num_files, num_lumi, num_block, num_event, file_size) :rtype: list of dicts", "label": 1, "domain": "code", "token_count": 414, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0241", "text": "function takest devid and ifindex of specific device and interface and issues a RESTFUL call to \"undo shut\" the specified interface on the target device. :param devid: int or str value of the target device :param devip: ipv4 address of the target devices :param ifindex: int or str value of the target interface :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :return: HTTP status code 204 with no values. :rype: int >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.device import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> int_down_response = set_interface_down( '9', auth.creds, auth.url, devid = '10') 204 >>> int_up_response = set_inteface_up( '9', auth.creds, auth.url, devid = '10') >>> int_down_response = set_interface_down( '9', auth.creds, auth.url, devid = '10') 204 >>> int_up_response = set_inteface_up('9', auth.creds, auth.url, devip = '10.101.0.221') >>> assert type(int_up_response) is int >>> assert int_up_response is 204", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0242", "text": "Reconstructs a directed acyclic graph according to prior information of edge significance. This function first ranks all edges and introduce the most significant one by one, avoiding those that would create a loop. Optional constraints on the maximum total number of edges, the number of incoming or outgoing edges for every gene can be specified. dp: numpy.ndarray(nt,nt,dtype=ftype(='f4' by default)) Prior information of edge significance levels. Entry dp[i,j] is significance of edge i to j. A larger values indicates the edge's presence is more probable. One option to obtain the prior information is to use pairwise inference methods in findr. dt2:numpy.ndarray(nt2,ns,dtype=ftype(='=f4' by default)) Gene expression data for B. dt2 has the same format as dt, and can be identical with, different from, or a superset of dt. When dt2 is a superset of (or identical with) dt, dt2 must be arranged to be identical with dt at its upper submatrix, i.e. dt2[:nt,:]=dt, and set parameter nodiag = 1. namax: Constraint on the maximum total number of edges in the reconstructed network. nimax: Constraint on the maximum number of incoming edges for each node in the reconstructed network. nomax: Constraint on the maximum number of outgoing edges for each node in the reconstructed network. Return: dictionary with following keys: ret:0 iff execution succeeded. net: numpy.ndarray((nt,nt),dtype=bool). The reconstructed direct acyclic graph or network net[i,j]=True if an edge from i to j exists in the reconstructed network, and False otherwise. ftype and gtype can be found in auto.py. Example: see findr.examples.geuvadis7", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0243", "text": "Berechnet die Pruefziffer des uebergebenen Wertes (ohne Pruefziffer). Ohne Pruefziffer heisst dabei, dass anstelle der Pruefziffer die uebergebene IBAN eine \"00\" enthalten kann.

    Die Pruefziffer selbst wird dabei nach dem Verfahren umgesetzt, das in Wikipedia beschrieben ist:

    1. Setze die beiden Pruefziffern auf 00 (die IBAN beginnt dann z. B. mit DE00 für Deutschland).
    2. Stelle die vier ersten Stellen an das Ende der IBAN.
    3. Ersetze alle Buchstaben durch Zahlen, wobei A = 10, B = 11, …, Z = 35.
    4. Berechne den ganzzahligen Rest, der bei Division durch 97 bleibt.
    5. Subtrahiere den Rest von 98, das Ergebnis sind die beiden Pruefziffern. Falls das Ergebnis einstellig ist, wird es mit einer fuehrenden Null ergaenzt.
    @param wert z.B. \"DE00 2105 0170 0012 3456 78\" @return z.B. \"68\"", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0244", "text": "Raises ValidationException if value is not a day of the month, from 1 to 28, 29, 30, or 31 depending on the month and year. Returns value. * value (str): The value being validated as existing as a numbered day in the given year and month. * year (int): The given year. * month (int): The given month. 1 is January, 2 is February, and so on. * blank (bool): If True, a blank string will be accepted. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateDayOfMonth('31', 2019, 10) 31 >>> pysv.validateDayOfMonth('32', 2019, 10) Traceback (most recent call last): ... pysimplevalidate.ValidationException: '32' is not a day in the month of October 2019 >>> pysv.validateDayOfMonth('29', 2004, 2) 29 >>> pysv.validateDayOfMonth('29', 2005, 2) Traceback (most recent call last): ... pysimplevalidate.ValidationException: '29' is not a day in the month of February 2005", "label": 1, "domain": "code", "token_count": 365, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0245", "text": " Construct a key dictionary (e.g., securesystemslib.formats.RSAKEY_SCHEMA) according to the keytype of 'key_metadata'. The dict returned by this function has the exact format as the dict returned by one of the key generations functions, like generate_ed25519_key(). The dict returned has the form: {'keytype': keytype, 'scheme': scheme, 'keyid': 'f30a0870d026980100c0573bd557394f8c1bbd6...', 'keyval': {'public': '...', 'private': '...'}} For example, RSA key dictionaries in RSAKEY_SCHEMA format should be used by modules storing a collection of keys, such as with keydb.py. RSA keys as stored in metadata files use a different format, so this function should be called if an RSA key is extracted from one of these metadata files and need converting. The key generation functions create an entirely new key and return it in the format appropriate for 'keydb.py'. >>> ed25519_key = generate_ed25519_key() >>> key_val = ed25519_key['keyval'] >>> keytype = ed25519_key['keytype'] >>> scheme = ed25519_key['scheme'] >>> ed25519_metadata = \\ format_keyval_to_metadata(keytype, scheme, key_val, private=True) >>> ed25519_key_2, junk = format_metadata_to_key(ed25519_metadata) >>> securesystemslib.formats.ED25519KEY_SCHEMA.matches(ed25519_key_2) True >>> ed25519_key == ed25519_key_2 True key_metadata: The key dictionary as stored in Metadata files, conforming to 'securesystemslib.formats.KEY_SCHEMA'. It has the form: {'keytype': '...', 'scheme': scheme, 'keyval': {'public': '...', 'private': '...'}} securesystemslib.exceptions.FormatError, if 'key_metadata' does not conform to 'securesystemslib.formats.KEY_SCHEMA'. None. In the case of an RSA key, a dictionary conformant to 'securesystemslib.formats.RSAKEY_SCHEMA'.", "label": 1, "domain": "code", "token_count": 454, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0246", "text": "Computer sample entropy (SampEn) of series X, specified by M and R. SampEn is very close to ApEn. Suppose given time series is X = [x(1), x(2), ... , x(N)]. We first build embedding matrix Em, of dimension (N-M+1)-by-M, such that the i-th row of Em is x(i),x(i+1), ... , x(i+M-1). Hence, the embedding lag and dimension are 1 and M-1 respectively. Such a matrix can be built by calling pyeeg function as Em = embed_seq(X, 1, M). Then we build matrix Emp, whose only difference with Em is that the length of each embedding sequence is M + 1 Denote the i-th and j-th row of Em as Em[i] and Em[j]. Their k-th elements are Em[i][k] and Em[j][k] respectively. The distance between Em[i] and Em[j] is defined as 1) the maximum difference of their corresponding scalar components, thus, max(Em[i]-Em[j]), or 2) Euclidean distance. We say two 1-D vectors Em[i] and Em[j] *match* in *tolerance* R, if the distance between them is no greater than R, thus, max(Em[i]-Em[j]) <= R. Mostly, the value of R is defined as 20% - 30% of standard deviation of X. Pick Em[i] as a template, for all j such that 0 < j < N - M , we can check whether Em[j] matches with Em[i]. Denote the number of Em[j], which is in the range of Em[i], as k[i], which is the i-th element of the vector k. We repeat the same process on Emp and obtained Cmp[i], 0 < i < N - M. The SampEn is defined as log(sum(Cm)/sum(Cmp)) References ---------- Costa M, Goldberger AL, Peng C-K, Multiscale entropy analysis of biological signals, Physical Review E, 71:021906, 2005 See also -------- ap_entropy: approximate entropy of a time series", "label": 1, "domain": "code", "token_count": 457, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0247", "text": "

    Perform a (configurable) XML 1.1 escape operation on a String input meant to be an XML attribute value.

    This method will perform an escape operation according to the specified {@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel} argument values.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    All other String-based escapeXml11*(...) methods call this one with preconfigured type and level values.

    This method is thread-safe.

    @param text the String to be escaped. @param type the type of escape operation to be performed, see {@link org.unbescape.xml.XmlEscapeType}. @param level the escape level to be applied, see {@link org.unbescape.xml.XmlEscapeLevel}. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null. @since 1.1.5", "label": 1, "domain": "code", "token_count": 364, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0248", "text": "Make the given filename absolute from the given root if it is not already absolute.
    {@code filename}{@code current}Result
    null null null
    null /myroot null
    /path/to/file null /path/to/file
    path/to/file null path/to/file
    /path/to/file /myroot /path/to/file
    path/to/file /myroot /myroot/path/to/file
    @param filename is the name to make absolute. @param current is the current directory which permits to make absolute. @return an absolute filename.", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0249", "text": "
     Creates a FFT plan configuration of dimension rank, with sizes specified in the array n. cufftResult cufftPlanMany(cufftHandle *plan, int rank, int *n, int *inembed, int istride, int idist, int *onembed, int ostride, int odist, cufftType type, int batch ); The batch input parameter tells CUFFT how many transforms to configure in parallel. With this function, batched plans of any dimension may be created. Input parameters inembed, istride, and idist and output parameters onembed, ostride, and odist will allow setup of noncontiguous input data in a future version. Note that for CUFFT 3.0, these parameters are ignored and the layout of batched data must be side-by-side and not interleaved. Input ---- plan Pointer to a cufftHandle object rank Dimensionality of the transform (1, 2, or 3) n An array of size rank, describing the size of each dimension inembed Unused: pass NULL istride Unused: pass 1 idist Unused: pass 0 onembed Unused: pass NULL ostride Unused: pass 1 odist Unused: pass 0 type Transform data type (e.g., CUFFT_C2C, as per other CUFFT calls) batch Batch size for this transform Output ---- plan Contains a CUFFT plan handle Return Values ---- CUFFT_SETUP_FAILED CUFFT library failed to initialize. CUFFT_INVALID_SIZE Parameter is not a supported size. CUFFT_INVALID_TYPE The type parameter is not supported 
    ", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0250", "text": "Calls this instance's request_client's post method with the specified component endpoint Args: - endpoint_name (str) - The endpoint to call like \"property/value\". - identifier_input - One or more identifiers to request data for. An identifier can be in one of these forms: - A list of property identifier dicts: - A property identifier dict can contain the following keys: (address, zipcode, unit, city, state, slug, meta). One of 'address' or 'slug' is required. Ex: [{\"address\": \"82 County Line Rd\", \"zipcode\": \"72173\", \"meta\": \"some ID\"}] A slug is a URL-safe string that identifies a property. These are obtained from HouseCanary. Ex: [{\"slug\": \"123-Example-St-San-Francisco-CA-94105\"}] - A list of dicts representing a block: - A block identifier dict can contain the following keys: (block_id, num_bins, property_type, meta). 'block_id' is required. Ex: [{\"block_id\": \"060750615003005\", \"meta\": \"some ID\"}] - A list of dicts representing a zipcode: Ex: [{\"zipcode\": \"90274\", \"meta\": \"some ID\"}] - A list of dicts representing an MSA: Ex: [{\"msa\": \"41860\", \"meta\": \"some ID\"}] The \"meta\" field is always optional. Returns: A Response object, or the output of a custom OutputGenerator if one was specified in the constructor.", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0251", "text": "Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. @param resource_group_name [String] The name of the Azure resource group that contains the Data Lake Analytics account. @param account_name [String] The name of the Data Lake Analytics account for which to list Data Lake Store accounts. @param filter [String] OData filter. Optional. @param top [Integer] The number of items to return. Optional. @param skip [Integer] The number of items to skip over before returning elements. Optional. @param expand [String] OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. @param select [String] OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. @param orderby [String] OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. @param count [Boolean] The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. @param search [String] A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. @param format [String] The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 416, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0252", "text": "

    Perform a CSS String level 1 (only basic set) escape operation on a String input.

    Level 1 means this method will only escape the CSS String basic escape set:

    • The Backslash Escapes: \" (U+0022) and \' (U+0027).
    • Two ranges of non-displayable, control characters: U+0000 to U+001F and U+007F to U+009F.

    This escape will be performed by using Backslash escapes whenever possible. For escaped characters that do not have an associated Backslash, default to \FF Hexadecimal Escapes.

    This method calls {@link #escapeCssString(String, CssStringEscapeType, CssStringEscapeLevel)} with the following preconfigured values:

    • type: {@link CssStringEscapeType#BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA}
    • level: {@link CssStringEscapeLevel#LEVEL_1_BASIC_ESCAPE_SET}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 438, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0253", "text": "Gets the health of a Service Fabric node. Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. @param node_name [String] The name of the node. @param events_health_state_filter [Integer] Allows filtering the collection of HealthEvent objects returned based on health state. The possible values for this parameter include integer value of one of the following health states. Only events that match the filter are returned. All events are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 414, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0254", "text": "Creates a new JobRecord with its associated Barriers and Slots. Also creates new {@link HandleSlotFilledTask} for any inputs to the Job that are immediately specified. Registers all newly created objects with the provided {@code UpdateSpec} for later saving.

    This method is called when starting a new Pipeline, in which case it is used to create the root job, and it is called from within the run() method of a generator job in order to create a child job. @param updateSpec The {@code UpdateSpec} with which to register all newly created objects. All objects will be added to the {@link UpdateSpec#getNonTransactionalGroup() non-transaction group} of the {@code UpdateSpec}. @param settings Array of {@code JobSetting} to apply to the newly created JobRecord. @param generatorJob The generator job or {@code null} if we are creating the root job. @param graphGUID The GUID of the child graph to which the new Job belongs or {@code null} if we are creating the root job. @param jobInstance The user-supplied instance of {@code Job} that implements the Job that the newly created JobRecord represents. @param params The arguments to be passed to the run() method of the newly created Job. Each argument may be an actual value or it may be an object of type {@link Value} representing either an {@link ImmediateValue} or a {@link com.google.appengine.tools.pipeline.FutureValue FutureValue}. For each element of the array, if the Object is not of type {@link Value} then it is interpreted as an {@link ImmediateValue} with the given Object as its value. @return The newly constructed JobRecord.", "label": 1, "domain": "code", "token_count": 345, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0255", "text": "Create a tag object Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you simply have to create the reference - this call would be unnecessary. @param [Hash] params @input params [String] :tag The tag @input params [String] :message The tag message @input params [String] :object The SHA of the git object this is tagging @input params [String] :type The type of the object we're tagging. Normally this is a commit but it can also be a tree or a blob @input params [Hash] :tagger A hash with information about the individual creating the tag. The tagger hash contains the following keys: @input tagger [String] :name The name of the author of the tag @input tagger [String] :email The email of the author of the tag @input tagger [String] :date When this object was tagged. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. @xample github = Github.new github.git_data.tags.create 'user-name', 'repo-name', tag: \"v0.0.1\", message: \"initial version\\n\", type: \"commit\", object: \"c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c\", tagger: { name: \"Scott Chacon\", email: \"schacon@gmail.com\", date: \"2011-06-17T14:53:3\" } @api public", "label": 1, "domain": "code", "token_count": 366, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0256", "text": "This is the function that loads plugins. It is returned for use by the framework calling code. Parameters: * _plugin_ : (Object or Function or String); plugin definition * if Object: provide a partial or complete definition with same properties as return value * if Function: assumed to be plugin _init_ function; plugin name taken from function name, if defined * if String: base for _require_ search; assumes module defines an _init_ function * _options_ : (Object, ...); plugin options, if not an object, constructs an object of form {value$:options} * _callback_ : (Function); callback function, possibly to be called by framework after init function completes Returns: A plugin description object is returned, with properties: * _name_ : String; the plugin name, either supplied by calling code, or derived from definition * _init_ : Function; the plugin init function, the resolution of which is the point of this module! * _options_ : Object; plugin options, if supplied * _search_ : Array[{type,name}]; list of require search paths; applied to each module up the parent chain until something is found * _found_ : Object{type,name}; search entry that found something * _requirepath_ : String; the argument to require that found something * _modulepath_ : String; the Node.js API module.id whose require found something * _tag_ : String; the tag value of the plugin name (format: name$tag), if any, allows loading of same plugin multiple times * _err_ : Error; plugin load error, if any", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0257", "text": "Send email via AWS SES. :returns string: message id *** Composes an email message based on input data, and then immediately queues the message for sending. :type to: list of strings or string :param to: The To: field(s) of the message. :type subject: string :param subject: The subject of the message: A short summary of the content, which will appear in the recipient's inbox. :type body: string :param body: The message body. :sender: email address of the sender. String or typle(name, email) :reply_to: email to reply to **kwargs: :type cc_addresses: list of strings or string :param cc_addresses: The CC: field(s) of the message. :type bcc_addresses: list of strings or string :param bcc_addresses: The BCC: field(s) of the message. :type format: string :param format: The format of the message's body, must be either \"text\" or \"html\". :type return_path: string :param return_path: The email address to which bounce notifications are to be forwarded. If the message cannot be delivered to the recipient, then an error message will be returned from the recipient's ISP; this message will then be forwarded to the email address specified by the ReturnPath parameter. :type text_body: string :param text_body: The text body to send with this email. :type html_body: string :param html_body: The html body to send with this email.", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0258", "text": "ListSettlements Provides summary information for all deposits and withdrawals initiated by Square to a linked bank account during a date range. Date ranges cannot exceed one year in length. *Note**: the ListSettlements endpoint does not provide entry information. @param location_id The ID of the location to list settlements for. If you specify me, this endpoint returns payments aggregated from all of the business's locations. @param [Hash] opts the optional parameters @option opts [String] :order TThe order in which payments are listed in the response. @option opts [String] :begin_time The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year. @option opts [String] :end_time The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. @option opts [Integer] :limit The maximum number of payments to return in a single response. This value cannot exceed 200. @option opts [String] :status Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED). @option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint. @return [Array]", "label": 1, "domain": "code", "token_count": 316, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0259", "text": "

    Perform a Java Properties Value level 1 (only basic set) escape operation on a String input, writing results to a Writer.

    Level 1 means this method will only escape the Java Properties basic escape set:

    • The Single Escape Characters: \t (U+0009), \n (U+000A), \f (U+000C), \r (U+000D) and \\ (U+005C).
    • Two ranges of non-displayable, control characters (some of which are already part of the single escape characters list): U+0000 to U+001F and U+007F to U+009F.

    This method calls {@link #escapePropertiesValue(String, Writer, PropertiesValueEscapeLevel)} with the following preconfigured values:

    • level: {@link PropertiesValueEscapeLevel#LEVEL_1_BASIC_ESCAPE_SET}

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 427, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0260", "text": "/* Method: removeEdge Removes one or more from the visualization. It can also perform several animations like fading sequentially, fading concurrently, iterating or replotting. Parameters: vertex - (array) An array having two strings which are the ids of the nodes connected by this edge (i.e ['id1', 'id2']). Can also be a two dimensional array holding many edges (i.e [['id1', 'id2'], ['id3', 'id4'], ...]). opt - (object) Animation options. It's an object with optional properties described below type - (string) Default's *nothing*. Type of the animation. Can be \"nothing\", \"replot\", \"fade:seq\", \"fade:con\" or \"iter\". duration - Described in . fps - Described in . transition - Described in . hideLabels - (boolean) Default's *true*. Hide labels during the animation. Example: (start code js) var viz = new $jit.Viz(options); viz.op.removeEdge(['nodeId', 'otherId'], { type: 'fade:seq', duration: 1000, hideLabels: false, transition: $jit.Trans.Quart.easeOut }); or also viz.op.removeEdge([['someId', 'otherId'], ['id3', 'id4']], { type: 'fade:con', duration: 1500 }); (end code)", "label": 1, "domain": "code", "token_count": 304, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0261", "text": "

    Generates a stream composed of the N greatest different values of the provided stream, compared using the provided comparator. If there are no duplicates in the provided stream, then the returned stream will have N values, assuming that the input stream has more than N values.

    All the duplicates are removed in the returned stream, so in this case the number of elements in the returned stream may be lesser than N. In this case, the total number of values is not guaranteed, and may be lesser than N.

    Since this operator extract maxes according to the provided comparator, the result is sorted from the greatest element to the smallest, thus in the decreasing order, according to the provided comparator.

    The provided implementation uses and insertion buffer of size N to keep the N maxes. This implementation becomes less and less efficient as N grows.

    A NullPointerException will be thrown if the provided stream or the comparator is null.

    An IllegalArgumentException is thrown if N is lesser than 1.

    @param stream the processed stream @param numberOfMaxes the number of different max values that should be returned. Note that the total number of values returned may be larger if there are duplicates in the stream @param comparator the comparator used to compare the elements of the stream @param the type of the provided stream @return the filtered stream", "label": 1, "domain": "code", "token_count": 302, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0262", "text": "Creates a new proxy credential from the specified certificate chain and a private key. A set of X.509 extensions can be optionally included in the new proxy certificate. This function automatically creates a \"RSA\"-based key pair. @see #createProxyCertificate(X509Certificate, PrivateKey, PublicKey, int, int, X509ExtensionSet, String) createProxyCertificate @param certs the certificate chain for the new proxy credential. The top-most certificate cert[0] will be designated as the issuing certificate. @param privateKey the private key of the issuing certificate. The new proxy certificate will be signed with that private key. @param bits the strength of the key pair for the new proxy certificate. @param lifetime lifetime of the new certificate in seconds. If 0 (or less then) the new certificate will have the same lifetime as the issuing certificate. @param certType the type of proxy credential to create @param extSet a set of X.509 extensions to be included in the new proxy certificate. Can be null. If delegation mode is {@link org.globus.gsi.GSIConstants.CertificateType#GSI_3_RESTRICTED_PROXY GSIConstants.CertificateType.GSI_3_RESTRICTED_PROXY} or {@link org.globus.gsi.GSIConstants.CertificateType#GSI_4_RESTRICTED_PROXY GSIConstants.CertificateType.GSI_4_RESTRICTED_PROXY} then {@link org.globus.gsi.proxy.ext.ProxyCertInfoExtension ProxyCertInfoExtension} must be present in the extension set. @param cnValue the value of the CN component of the subject of the new proxy credential. If null, the defaults will be used depending on the proxy certificate type created. @return GlobusCredential the new proxy credential. @exception GeneralSecurityException if a security error occurs.", "label": 1, "domain": "code", "token_count": 379, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0263", "text": "Lists the usage details by departmentId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later. @param department_id [String] Department ID @param expand [String] May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. @param filter [String] May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the most recent N usageDetails. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [UsageDetailsListResult] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0264", "text": "Starting at pos, method steps along magnetic unit vector direction towards the supplied field line trace. Determines the distance of closest approach to field line. Routine is used when calculting the mapping of electric fields along magnetic field lines. Voltage remains constant along the field but the distance between field lines does not.This routine may be used to form the last leg when trying to trace out a closed field line loop. Routine will create a high resolution field line trace (.01 km step size) near the location of closest approach to better determine where the intersection occurs. Parameters ---------- pos : array-like X, Y, and Z ECEF locations to start from field_line : array-like (:,3) X, Y, and Z ECEF locations of field line trace, produced by the field_line_trace method. sign : int if 1, move along positive unit vector. Negwtive direction for -1. time : datetime or float Date to perform tracing on (year + day/365 + hours/24. + etc.) Accounts for leap year if datetime provided. direction : string ('meridional', 'zonal', or 'aligned') Which unit vector direction to move slong when trying to intersect with supplied field line trace. See step_along_mag_unit_vector method for more. step_size_goal : float step size goal that method will try to match when stepping towards field line. Returns ------- (float, array, float) Total distance taken along vector direction; the position after taking the step [x, y, z] in ECEF; distance of closest approach from input pos towards the input field line trace.", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0265", "text": "Defines which abilities are allowed using two arguments. The first one is the action you're setting the permission for, the second one is the class of object you're setting it on. can :update, Article You can pass an array for either of these parameters to match any one. Here the user has the ability to update or destroy both articles and comments. can [:update, :destroy], [Article, Comment] You can pass :all to match any object and :manage to match any action. Here are some examples. can :manage, :all can :update, :all can :manage, Project You can pass a hash of conditions as the third argument. Here the user can only see active projects which he owns. can :read, Project, :active => true, :user_id => user.id See ActiveRecordAdditions#accessible_by for how to use this in database queries. These conditions are also used for initial attributes when building a record in ControllerAdditions#load_resource. If the conditions hash does not give you enough control over defining abilities, you can use a block along with any Ruby code you want. can :update, Project do |project| project.groups.include?(user.group) end If the block returns true then the user has that :update ability for that project, otherwise he will be denied access. The downside to using a block is that it cannot be used to generate conditions for database queries. You can pass custom objects into this \"can\" method, this is usually done with a symbol and is useful if a class isn't available to define permissions on. can :read, :stats can? :read, :stats # => true IMPORTANT: Neither a hash of conditions nor a block will be used when checking permission on a class. can :update, Project, :priority => 3 can? :update, Project # => true If you pass no arguments to +can+, the action, class, and object will be passed to the block and the block will always be executed. This allows you to override the full behavior if the permissions are defined in an external source such as the database. can do |action, object_class, object| # check the database and return true/false end", "label": 1, "domain": "code", "token_count": 446, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0266", "text": "Get a winston logger for a given topic name. If the requested logger does not yet exist a new instance will be created internally. @param {Object} topicName - The name of the topic, topic or category the returned logger is assigned to. The topicName will be added automatically to the log output, if the configuration does not include the \"label\" property as part of the applicable winston transport configuration. @returns {Object} The winston logger for the given topic name @example // Initialize logging in the main program file using the server configuration. // You only need to call this once! Modules loaded subsequently, can simply // obtain a logger using getLogger(). var config = require(\"./config.json\"); var logging = require(\"./logger-winston\"); logging.init(serverConfig); // Now you can obtain a logger for the topic \"MyApp\", for example, and start logging. // The log output will be augmented with a label for the given topic name, automatically. // By default, the output will look like a follows: // info: [MyApp] Hello world! var logger = logging.getLogger(\"MyApp\"); logger.info(\"Hello world!\"); // You can set up a \"default\" configuration which applies for all // logger instances unless you provide specific configuration for // some topics. // In the given example the the \"default\" applies to topic \"MyApp\" while // a specific configuration has been set for topic \"Server\". var logger2 = logging.getLogger(\"Server\"); logger2.info(\"Starting Server\"); @example Example Configuration config.json { \"logging\": { \"default\": { \"console\": { \"level\": \"debug\", \"colorize\": true, \"timestamp\": true } }, \"Server\": { \"console\": { \"level\": \"debug\", \"colorize\": false, \"timestamp\": false } } } } @see https://github.com/flatiron/winston#working-with-multiple-loggers-in-winston", "label": 1, "domain": "code", "token_count": 398, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0267", "text": "Returns the cldr code and the number value by checking each pattern and finding the best match. 1. iterate over each unit pattern, e.g. \"{0}m\", \"{0}km\" 1a. convert it to a reg exp pattern, e.g. \"^(.+)m$\" 1b. match it with the input \"12km\" and store the value \"12k\" and the unit value \"m\" 1c. do this for each pattern and update the best result if a better match is found A better match means most of the unit value matched and the number match is shorter. E.g. input: 12km matches for the pattern \"^(.+)m$\" and the resulting value is \"12k\" while the pattern \"^(.+)km$\" results in \"12\". Since pattern \"^(.+)km$\" returns a shorter result it is considered the better match. Note: the cldr data is not distinct in its patterns. E.g. \"100 c\" could be in \"en_gb\" either 100 units of \"volume-cup\" or \"duration-century\" both having the same pattern \"{0} c\" Therefore best matches will be returned in an array. @param {object} mUnitPatterns the unit patterns @param {string} sValue The value e.g. \"12 km\" @return {object} An object containing the unit codes (key: [cldrCode]) and the number value (key: numberValue). Values are undefined or an empty array if not found. E.g. { numberValue: 12, cldrCode: [length-kilometer] }", "label": 1, "domain": "code", "token_count": 356, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0268", "text": "Detects params from url and apply as scopes to your classes. == Options * :type - Checks the type of the parameter sent. If set to :boolean it just calls the named scope, without any argument. By default, it does not allow hashes or arrays to be given, except if type :hash or :array are set. * :only - In which actions the scope is applied. By default is :all. * :except - In which actions the scope is not applied. By default is :none. * :as - The key in the params hash expected to find the scope. Defaults to the scope name. * :using - If type is a hash, you can provide :using to convert the hash to a named scope call with several arguments. * :if - Specifies a method, proc or string to call to determine if the scope should apply * :unless - Specifies a method, proc or string to call to determine if the scope should NOT apply. * :default - Default value for the scope. Whenever supplied the scope is always called. * :allow_blank - Blank values are not sent to scopes by default. Set to true to overwrite. == Block usage has_scope also accepts a block. The controller, current scope and value are yielded to the block so the user can apply the scope on its own. This is useful in case we need to manipulate the given value: has_scope :category do |controller, scope, value| value != \"all\" ? scope.by_category(value) : scope end has_scope :not_voted_by_me, :type => :boolean do |controller, scope| scope.not_voted_by(controller.current_user.id) end", "label": 1, "domain": "code", "token_count": 384, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0269", "text": "Function takes input of four strings Start Ip, endIp, name, and description to add new Ip Scope to terminal access in the HPE IMC base platform :param name: str Name of the owner of this IP scope ex. 'admin' :param description: str description of the Ip scope :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param startip: str Start of IP address scope ex. '10.101.0.1' :param endip: str End of IP address scope ex. '10.101.0.254' :param network_address: ipv4 network address + subnet bits of target scope :return: 200 if successfull :rtype: >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.termaccess import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> delete_ip_scope('10.50.0.0/24', auth.creds, auth.url) >>> new_scope = add_ip_scope('10.50.0.1', '10.50.0.254', 'cyoung', 'test group', auth.creds, auth.url) >>> assert type(new_scope) is int >>> assert new_scope == 200 >>> existing_scope = add_ip_scope('10.50.0.1', '10.50.0.254', 'cyoung', 'test group', auth.creds, auth.url) >>> assert type(existing_scope) is int >>> assert existing_scope == 409", "label": 1, "domain": "code", "token_count": 364, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0270", "text": "Raises ValidationException if value is not a time formatted in one of the formats formats. Returns a datetime.date object of value. * value (str): The value being validated as a time. * blank (bool): If True, a blank string for value will be accepted. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * formats: A tuple of strings that can be passed to time.strftime, dictating the possible formats for a valid date. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateDate('2/29/2004') datetime.date(2004, 2, 29) >>> pysv.validateDate('2/29/2005') Traceback (most recent call last): ... pysimplevalidate.ValidationException: '2/29/2005' is not a valid date. >>> pysv.validateDate('September 2019', formats=['%B %Y']) datetime.date(2019, 9, 1)", "label": 1, "domain": "code", "token_count": 302, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0271", "text": "Calculates the reliable z-index in the current window considering the global BusyIndicator dialog. Algorithm: 1) When popups are already open on the screen: the highest z-index of validated popups is compared with the lowest z-index of invalidated popups. The invalidated popups also include any BusyIndicator that might be open. 2) If the invalidated popups have the higher value then the next z-index is first decremented by 10, which gives the last popup z-index and then 1 is added to it. 3) After incrementing 1 in Step 2), the resultant z-index value is compared against an array of assigned z-index values by the ZIndexManager. Step 3) is repeated as long as it stays under a max value and a unique value is calculated. The max value is the next possible popup z-index - 3 (hardcoded by variable Z_INDICES_RESERVED). Example: when BusyIndicator has a z-index 100, then available indexes are: 91, 92, 93, 94, 95, 96, 97. Indexes 98 & 99 are used by BusyIndicator internally, therefore we can't rely on them. The reason we start from the index 91 is that in sap.ui.core.Popup.getNextZIndex() there is a hardcoded step with a value 10 which means there are only 10 reliable indexes between the opened BusyIndicator and the previous absolutely positioned element on the screen; 4) If no popups are open or if validated popups have a higher z-index, then simply the next possible z-index is returned by calling sap.ui.core.Popup.getNextZIndex(). @returns {int} the next available z-index value @public", "label": 1, "domain": "code", "token_count": 352, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0272", "text": "Muscle align list of sequences. seqs: a list of sequences as strings or objects, you must set add_seq_names=True or sequences in a multiline string, as read() from a fasta file or sequences in a list of lines, as readlines() from a fasta file or a fasta seq filename. == for eg, testcode for guessing #guess_input_handler should correctly identify input gih = guess_input_handler self.assertEqual(gih('abc.txt'), '_input_as_string') self.assertEqual(gih('>ab\\nTCAG'), '_input_as_multiline_string') self.assertEqual(gih(['ACC','TGA'], True), '_input_as_seqs') self.assertEqual(gih(['>a','ACC','>b','TGA']), '_input_as_lines') == docstring for blast_seqs, apply to muscle_seqs == seqs: either file name or list of sequence objects or list of strings or single multiline string containing sequences. WARNING: DECISION RULES FOR INPUT HANDLING HAVE CHANGED. Decision rules for data are as follows. If it's s list, treat as lines, unless add_seq_names is true (in which case treat as list of seqs). If it's a string, test whether it has newlines. If it doesn't have newlines, assume it's a filename. If it does have newlines, it can't be a filename, so assume it's a multiline string containing sequences. If you want to skip the detection and force a specific type of input handler, use input_handler='your_favorite_handler'. add_seq_names: boolean. if True, sequence names are inserted in the list of sequences. if False, it assumes seqs is a list of lines of some proper format that the program can handle Addl docs coming soon", "label": 1, "domain": "code", "token_count": 355, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0273", "text": "Return a Pandas Series of every file for chosen satellite data. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset. Parameters ----------- tag : (string or NoneType) Denotes type of file to load. Accepted types are . (default=None) sat_id : (string or NoneType) Specifies the satellite ID for a constellation. Not used. (default=None) data_path : (string or NoneType) Path to data directory. If None is specified, the value previously set in Instrument.files.data_path is used. (default=None) format_str : (string or NoneType) User specified file format. If None is specified, the default formats associated with the supplied tags are used. (default=None) supported_tags : (dict or NoneType) keys are tags supported by list_files routine. Values are the default format_str values for key. (default=None) fake_daily_files_from_monthly : bool Some CDAWeb instrument data files are stored by month, interfering with pysat's functionality of loading by day. This flag, when true, appends daily dates to monthly files internally. These dates are used by load routine in this module to provide data by day. Returns -------- pysat.Files.from_os : (pysat._files.Files) A class containing the verified available files Examples -------- :: fname = 'cnofs_vefi_bfield_1sec_{year:04d}{month:02d}{day:02d}_v05.cdf' supported_tags = {'dc_b':fname} list_files = functools.partial(nasa_cdaweb_methods.list_files, supported_tags=supported_tags) ivm_fname = 'cnofs_cindi_ivm_500ms_{year:4d}{month:02d}{day:02d}_v01.cdf' supported_tags = {'':ivm_fname} list_files = functools.partial(cdw.list_files, supported_tags=supported_tags)", "label": 1, "domain": "code", "token_count": 398, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0274", "text": "

    Perform an XML 1.0 level 2 (markup-significant and all non-ASCII chars) escape operation on a String input meant to be an XML attribute value, writing results to a Writer.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml10(String, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 493, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0275", "text": "Open a GEOS-Chem BPCH file output as an xarray Dataset. Parameters ---------- filename : string Path to the output file to read in. {tracerinfo,diaginfo}_file : string, optional Path to the metadata \"info\" .dat files which are used to decipher the metadata corresponding to each variable in the output dataset. If not provided, will look for them in the current directory or fall back on a generic set. fields : list, optional List of a subset of variable names to return. This can substantially improve read performance. Note that the field here is just the tracer name - not the category, e.g. 'O3' instead of 'IJ-AVG-$_O3'. categories : list, optional List a subset of variable categories to look through. This can substantially improve read performance. endian : {'=', '>', '<'}, optional Endianness of file on disk. By default, \"big endian\" (\">\") is assumed. decode_cf : bool Enforce CF conventions for variable names, units, and other metadata default_dtype : numpy.dtype, optional Default datatype for variables encoded in file on disk (single-precision float by default). memmap : bool Flag indicating that data should be memory-mapped from disk instead of eagerly loaded into memory dask : bool Flag indicating that data reading should be deferred (delayed) to construct a task-graph for later execution return_store : bool Also return the underlying DataStore to the user Returns ------- ds : xarray.Dataset Dataset containing the requested fields (or the entire file), with data contained in proxy containers for access later. store : xarray.AbstractDataStore Underlying DataStore which handles the loading and processing of bpch files on disk", "label": 1, "domain": "code", "token_count": 345, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0276", "text": "Determines the interfaces implemented by the classes from the lowest type to the highestType which are extended the given interfaceType.

    Insteed of {@link Class#getInterfaces()}, this function is exploring the super classes. This function does not explore super-interfaces of implemented interfaces.

     interface IA {} interface IB extends IA {} interface IC {} interface ID extends IB, IC {} class CA implements IC {} class CB extends CA {} class CC extends CB implements IB {} 
    This function replies for:
    • getAllDirectInterfaces(IA,null,null)={}
    • getAllDirectInterfaces(IB,null,null)={IA}
    • getAllDirectInterfaces(IC,null,null)={}
    • getAllDirectInterfaces(ID,null,null)={IB,IC}
    • getAllDirectInterfaces(CA,null,null)={IC}
    • getAllDirectInterfaces(CB,null,null)={IC}
    • getAllDirectInterfaces(CC,null,null)={IB,IC}
    @param is the highest type to explore in type hierarchy. @param indicates the type of the replied interfaces. @param lowestType is the lowest type to explore in type hierarchy. @param highestType is the highest type to explore in type hierarchy. @param interfaceType indicates the type of the replied interfaces. @return the implemented interfaces. @since 5.0", "label": 1, "domain": "code", "token_count": 358, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0277", "text": "Creates a collection of check boxes for each item in the collection, associated with a clickable label. Use value_method and text_method to convert items in the collection for use as text/value in check boxes. You can give a symbol or a proc to both value_method and text_method, that will be evaluated for each item in the collection. == Examples form_for @user do |f| f.collection_check_boxes :options, [[true, 'Yes'] ,[false, 'No']], :first, :last end It is also possible to give a block that should generate the check box + label. To wrap the check box with the label, for instance: form_for @user do |f| f.collection_check_boxes( :options, [[true, 'Yes'] ,[false, 'No']], :first, :last ) do |b| b.label { b.check_box + b.text } end end == Options Collection check box accepts some extra options: * checked => the value or values that should be checked initially. Accepts a single item or an array of items. It overrides existing associations. * disabled => the value or values that should be disabled. Accepts a single item or an array of items. * collection_wrapper_tag => the tag to wrap the entire collection. * collection_wrapper_class => the CSS class to use for collection_wrapper_tag. This option is ignored if the :collection_wrapper_tag option is blank. * item_wrapper_tag => the tag to wrap each item in the collection. * item_wrapper_class => the CSS class to use for item_wrapper_tag * a block => to generate the label + check box or any other component.", "label": 1, "domain": "code", "token_count": 446, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0278", "text": "Create a Albers Equal-Area Conic Projection based Spatial Reference. The params passed in construction should include the following properties:
    -wkid: well-known id
    -semi_major: ellipsoidal semi-major axis in meter
    -unit: meters per unit
    -inverse_flattening: inverse of flattening of the ellipsoid where 1/f = a/(a - b)
    -standard_parallel_1: phi1, latitude of the first standard parallel
    -standard_parallel_2: phi2, latitude of the second standard parallel
    -latitude_of_origin: phi0, latitude of the false origin
    -central_meridian: lamda0, longitude of the false origin (with respect to the prime meridian)
    -false_easting: FE, false easting, the Eastings value assigned to the natural origin
    -false_northing: FN, false northing, the Northings value assigned to the natural origin

    e.g. var albers = new Albers({wkid:9999, semi_major: 6378206.4,inverse_flattening: 294.9786982, standard_parallel_1: 29.5, standard_parallel_2: 45.5, central_meridian: -96.0, latitude_of_origin: 23,false_easting: 0, 'false_northing': 0, unit: 1 }); @name Albers @class This class (Albers) represents a Spatial Reference System based on Albers Projection. @extends SpatialReference @constructor @param {Object} params", "label": 1, "domain": "code", "token_count": 389, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0279", "text": "

    Perform am URI query parameter (name or value) escape operation on a char[] input using UTF-8 as encoding.

    The following are the only allowed chars in an URI query parameter (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ ' ( ) * , ;
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 334, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0280", "text": "

    Perform an XML 1.0 level 1 (only markup-significant chars) escape operation on a Reader input, writing results to a Writer.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    This method calls {@link #escapeXml10(Reader, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0281", "text": "

    Perform a (configurable) XML 1.1 escape operation on a Reader input meant to be an XML attribute value, writing results to a Writer.

    This method will perform an escape operation according to the specified {@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel} argument values.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    All other Reader/Writer-based escapeXml11*(...) methods call this one with preconfigured type and level values.

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param type the type of escape operation to be performed, see {@link org.unbescape.xml.XmlEscapeType}. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param level the escape level to be applied, see {@link org.unbescape.xml.XmlEscapeLevel}. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 357, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0282", "text": "Create Export Request Export normalized messages. The following input combinations are supported:<br/><table><tr><th>Combination</th><th>Parameters</th><th>Description</th></tr><tr><td>Get by users</td><td>uids</td><td>Search by a list of User IDs. For each user in the list, the current authenticated user must have read access over the specified user.</td></tr><tr><td>Get by devices</td><td>sdids</td><td>Search by Source Device IDs.</td></tr><tr><td>Get by device types</td><td>uids,sdtids</td><td>Search by list of Source Device Type IDs for the given list of users.</td></tr><tr><td>Get by trial</td><td>trialId</td><td>Search by Trial ID.</td></tr><tr><td>Get by combination of parameters</td><td>uids,sdids,sdtids</td><td>Search by list of Source Device IDs. Each Device ID must belong to a Source Device Type ID and a User ID.</td></tr><tr><td>Common</td><td>startDate,endDate,order,format,url,csvHeaders</td><td>Parameters that can be used with the above combinations.</td></tr></table> @param exportRequestInfo ExportRequest object that is passed in the body (required) @return ExportRequestResponse @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body", "label": 1, "domain": "code", "token_count": 490, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0283", "text": "Registers and configures sender through a dedicated builder. For example:
     .sender(CloudhopperBuilder.class) .host(\"localhost\"); 

    If your custom builder is annotated by one or several of:

    • {@link RequiredClass}
    • {@link RequiredProperty}
    • {@link RequiredClasses}
    • {@link RequiredProperties}
    Then if condition evaluation returns true, your built implementation will be used. If you provide several annotations, your built implementation will be used only if all conditions are met (and operator).

    If your custom builder implements {@link ActivableAtRuntime}, and the provided condition evaluation returns true, then your built implementation will be used. See {@link MessageConditions} to build your condition.

    If neither annotations nor implementation of {@link ActivableAtRuntime} is used, then your built implementation will be always used. All other implementations (even standard ones) will never be used.

    In order to be able to keep chaining, you builder instance may provide a constructor with one argument with the type of the parent builder ({@link SmsBuilder}). If you don't care about chaining, just provide a default constructor.

    Your builder may return {@code null} when calling {@link Builder#build()}. In this case it means that your implementation can't be used due to current environment. Your implementation is then not registered.

    @param builderClass the builder class to instantiate @param the type of the builder @return the builder to configure the implementation", "label": 1, "domain": "code", "token_count": 341, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0284", "text": "Create a string array from a string separated by delim.

    The split command needs to deal with the following accurately:

    Suppose that you are a programmer working with a database.

    Lets say we output files from the database in this format:

     ||stl|north|10 Moon St.|Culver City|CA||||red 
    Now, lets say we want to delete the second column and make sure what was the third column is now all caps.

    Here is the output from the Python split:

     sa> python Python 1.5.2 (#1, Mar 3 2001, 01:35:43) \\ [GCC 2.96 20000731 (Red Hat Linux 7.1 2 on linux-i386 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import string >>> foo = "andy the aardvark" >>> string.split( foo, "a" ) ['', 'ndy the ', '', 'rdv', 'rk'] >>> foo = "||stl|north|10 Moon St.|Culver City|CA||||red|" >>> string.split( foo, "|" ) ['', '', 'stl', 'north', '10 Moon St.', 'Culver City', 'CA', '', '', '', 'red', ''] 

    So, out split, needs to deal with that: @param src a String value @param delim the delimiter to split by. @param trim a boolean value @return a string array of the split fields. Return an empty array if this string is null.", "label": 1, "domain": "code", "token_count": 408, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0285", "text": "

    Perform am URI path escape operation on a char[] input using UTF-8 as encoding.

    The following are the only allowed chars in an URI path (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • /

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 331, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0286", "text": "Enables periodic backup of stateful partitions under this Service Fabric service. Enables periodic backup of stateful partitions which are part of this Service Fabric service. Each partition is backed up individually as per the specified backup policy description. In case the application, which the service is part of, is already enabled for backup then this operation would override the policy being used to take the periodic backup for this service and its partitions (unless explicitly overridden at the partition level). Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param enable_backup_description [EnableBackupDescription] Specifies the parameters for enabling backup. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0287", "text": "Returns an Error instance from a jQuery XHR wrapper. @param {object} jqXHR A jQuery XHR wrapper as received by a failure handler @param {function} jqXHR.getResponseHeader Used to access the HTTP response header \"Content-Type\" @param {string} jqXHR.responseText HTTP response body, sometimes in JSON format (\"Content-Type\" : \"application/json\") according to OData \"19 Error Response\" specification, sometimes plain text (\"Content-Type\" : \"text/plain\"); other formats are ignored @param {number} jqXHR.status HTTP status code @param {string} jqXHR.statusText HTTP status text @param {string} sMessage The message for the Error instance; code and status text of the HTTP error are appended @param {string} [sRequestUrl] The request URL @param {string} [sResourcePath] The path by which this resource has originally been requested @returns {Error} An Error instance with the following properties:
    • error: The \"error\" value from the OData V4 error response JSON object (if available)
    • isConcurrentModification: true In case of a concurrent modification detected via ETags (i.e. HTTP status code 412)
    • message: Error message
    • requestUrl: The request URL
    • resourcePath: The path by which this resource has originally been requested
    • status: HTTP status code
    • statusText: (optional) HTTP status text
    @see \"19 Error Response\"", "label": 1, "domain": "code", "token_count": 396, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0288", "text": "Set the target of the page so that common infrastructure (breadcrumbs, related menu, etc.) can be added for the page. @name orion.globalCommands#setPageTarget @function @param {Object} options The target options object. @param {String} options.task the name of the user task that the page represents. @param {Object} options.target the metadata describing the page resource target. Optional. @param {String} options.name the name of the resource that is showing on the page. Optional. If a target parameter is supplied, the target metadata name will be used if a name is not specified in the options. @param {String} options.title the title to be used for the page. Optional. If not specified, a title will be constructed using the task and/or name. @param {Function} options.makeAlternate a function that can supply alternate metadata for the related pages menu if the target does not validate against a contribution. Optional. Optional. If not specified, and if a target is specified, the breadcrumb link will refer to the Navigator. @param {orion.serviceregistry.ServiceRegistry} options.serviceRegistry the registry to use for obtaining any unspecified services. Optional. If not specified, then any banner elements requiring Orion services will not be provided. @param {orion.commandregistry.CommandRegistry} options.commandService the commandService used for accessing related page commands. Optional. If not specified, a related page menu will not be shown. @param {orion.searchClient.Searcher} options.searchService the searchService used for scoping the searchbox. Optional. If not specified, the searchbox will not be scoped. @param {orion.fileClient.FileClient} options.fileService the fileService used for retrieving additional metadata and managing the breadcrumb for multiple file services. If not specified, there may be reduced support for multiple file implementations.", "label": 1, "domain": "code", "token_count": 379, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0289", "text": "Installs a powerup (e.g. plugin) on an item or store. Powerups will be returned in an iterator when queried for using the 'powerupsFor' method. Normally they will be returned in order of installation [this may change in future versions, so please don't depend on it]. Higher priorities are returned first. If you have something that should run before \"normal\" powerups, pass POWERUP_BEFORE; if you have something that should run after, pass POWERUP_AFTER. We suggest not depending too heavily on order of execution of your powerups, but if finer-grained control is necessary you may pass any integer. Normal (unspecified) priority is zero. Powerups will only be installed once on a given item. If you install a powerup for a given interface with priority 1, then again with priority 30, the powerup will be adjusted to priority 30 but future calls to powerupFor will still only return that powerup once. If no interface or priority are specified, and the class of the powerup has a \"powerupInterfaces\" attribute (containing either a sequence of interfaces, or a sequence of (interface, priority) tuples), this object will be powered up with the powerup object on those interfaces. If no interface or priority are specified and the powerup has a \"__getPowerupInterfaces__\" method, it will be called with an iterable of (interface, priority) tuples, collected from the \"powerupInterfaces\" attribute described above. The iterable of (interface, priority) tuples it returns will then be installed. @param powerup: an Item that implements C{interface} (if specified) @param interface: a zope interface, or None @param priority: An int; preferably either POWERUP_BEFORE, POWERUP_AFTER, or unspecified. @raise TypeError: raises if interface is IPowerupIndirector You may not install a powerup for IPowerupIndirector because that would be nonsensical.", "label": 1, "domain": "code", "token_count": 404, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0290", "text": "APIProperty: events {} Events instance for listeners and triggering control specific events. Register a listener for a particular event with the following syntax: (code) control.events.register(type, obj, listener); (end) Supported event types (in addition to those from ): beforefeatureselected - Triggered when is true before a feature is selected. The event object has a feature property with the feature about to select featureselected - Triggered when is true and a feature is selected. The event object has a feature property with the selected feature beforefeaturesselected - Triggered when is true before a set of features is selected. The event object is an array of feature properties with the features about to be selected. Return false after receiving this event to discontinue processing of all featureselected events and the featuresselected event. featuresselected - Triggered when is true and a set of features is selected. The event object is an array of feature properties of the selected features featureunselected - Triggered when is true and a feature is unselected. The event object has a feature property with the unselected feature clickout - Triggered when when is true and no feature was selected. hoverfeature - Triggered when is true and the mouse has stopped over a feature outfeature - Triggered when is true and the mouse moves moved away from a hover-selected feature Constructor: OpenLayers.Control.GetFeature Create a new control for fetching remote features. Parameters: options - {Object} A configuration object which at least has to contain a property (if not, it has to be set before a request is made)", "label": 1, "domain": "code", "token_count": 353, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0291", "text": "Constructs a geographic mesh. @alias GeographicMesh @constructor @augments AbstractMesh @classdesc Represents a 3D geographic mesh.

    Altitudes within the mesh's positions are interpreted according to the mesh's altitude mode, which can be one of the following:

    • [WorldWind.ABSOLUTE]{@link WorldWind#ABSOLUTE}
    • [WorldWind.RELATIVE_TO_GROUND]{@link WorldWind#RELATIVE_TO_GROUND}
    • [WorldWind.CLAMP_TO_GROUND]{@link WorldWind#CLAMP_TO_GROUND}
    If the latter, the mesh positions' altitudes are ignored. (If the mesh should be draped onto the terrain, you might want to use {@link SurfacePolygon} instead.)

    Meshes have separate attributes for normal display and highlighted display. They use the interior and outline attributes of {@link ShapeAttributes}. If those attributes identify an image, that image is applied to the mesh. Texture coordinates for the image may be specified, but if not specified the full image is stretched over the full mesh. If texture coordinates are specified, there must be one texture coordinate for each vertex in the mesh. @param {Position[][]} positions A two-dimensional array containing the mesh vertices. Each entry of the array specifies the vertices of one row of the mesh. The arrays for all rows must have the same length. There must be at least two rows, and each row must have at least two vertices. There must be no more than 65536 positions. @param {ShapeAttributes} attributes The attributes to associate with this mesh. May be null, in which case default attributes are associated. @throws {ArgumentError} If the specified positions array is null or undefined, the number of rows or the number of vertices per row is less than 2, the array lengths are inconsistent, or too many positions are specified (limit is 65536).", "label": 1, "domain": "code", "token_count": 401, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0292", "text": "Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxCellOverlay Extends to implement a graph overlay, represented by an icon and a tooltip. Overlays can handle and fire events and are added to the graph using , and removed using , or to remove all overlays. The function returns the array of overlays for a given cell in a graph. If multiple overlays exist for the same cell, then should be overridden in at least one of the overlays. Overlays appear on top of all cells in a special layer. If this is not desirable, then the image must be rendered as part of the shape or label of the cell instead. Example: The following adds a new overlays for a given vertex and selects the cell if the overlay is clicked. (code) var overlay = new mxCellOverlay(img, html); graph.addCellOverlay(vertex, overlay); overlay.addListener(mxEvent.CLICK, function(sender, evt) { var cell = evt.getProperty('cell'); graph.setSelectionCell(cell); }); (end) For cell overlays to be printed use . Event: mxEvent.CLICK Fires when the user clicks on the overlay. The event property contains the corresponding mouse event and the cell property contains the cell. For touch devices this is fired if the element receives a touchend event. Constructor: mxCellOverlay Constructs a new overlay using the given image and tooltip. Parameters: image - that represents the icon to be displayed. tooltip - Optional string that specifies the tooltip. align - Optional horizontal alignment for the overlay. Possible values are , and (default). verticalAlign - Vertical alignment for the overlay. Possible values are , and (default).", "label": 1, "domain": "code", "token_count": 430, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0293", "text": "Raises ValidationException if value is not a string. This function is identical to the built-in input() function, but also offers the PySimpleValidate features of not allowing blank values by default, automatically stripping whitespace, and having allowlist/blocklist regular expressions. Returns value, so it can be used inline in an expression: print('Hello, ' + validateStr(your_name)) * value (str): The value being validated as a string. * blank (bool): If True, a blank string will be accepted. Defaults to False. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateStr('hello') 'hello' >>> pysv.validateStr('') Traceback (most recent call last): ... pysimplevalidate.ValidationException: Blank values are not allowed. >>> pysv.validateStr('', blank=True) '' >>> pysv.validateStr(' hello ') 'hello' >>> pysv.validateStr('hello', blocklistRegexes=['hello']) Traceback (most recent call last): ... pysimplevalidate.ValidationException: This response is invalid. >>> pysv.validateStr('hello', blocklistRegexes=[('hello', 'Hello is not allowed')]) Traceback (most recent call last): ... pysimplevalidate.ValidationException: Hello is not allowed >>> pysv.validateStr('hello', allowlistRegexes=['hello'], blocklistRegexes=['llo']) 'hello'", "label": 1, "domain": "code", "token_count": 400, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0294", "text": "Function takes input of dictionary operator with the following keys operator = { \"fullName\" : \"\" , \"sessionTimeout\" : \"\", \"password\" : \"\", \"operatorGroupId\" : \"\", \"name\" : \"\", \"desc\" : \"\", \"defaultAcl\" : \"\", \"authType\" : \"\"} converts to json and issues a HTTP POST request to the HPE IMC Restful API :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :param operator: dictionary with the required operator key-value pairs as defined above. :return: :rtype: >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.operator import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> operator = { \"fullName\" : \"test administrator\", \"sessionTimeout\" : \"30\", \"password\" : \"password\", \"operatorGroupId\" : \"1\", \"name\" : \"testadmin\", \"desc\" : \"test admin account\", \"defaultAcl\" : \"\", \"authType\" : \"0\"} >>> delete_if_exists = delete_plat_operator('testadmin', auth.creds, auth.url) >>> new_operator = create_operator(operator, auth.creds, auth.url) >>> assert type(new_operator) is int >>> assert new_operator == 201 >>> fail_operator_create = create_operator(operator, auth.creds, auth.url) >>> assert type(fail_operator_create) is int >>> assert fail_operator_create == 409", "label": 1, "domain": "code", "token_count": 347, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0295", "text": "Function: makeDraggable Configures the given DOM element to act as a drag source for the specified graph. Returns a a new . If is enabled then the x and y arguments must be used in funct to match the preview location. Example: (code) var funct = function(graph, evt, cell, x, y) { if (graph.canImportCell(cell)) { var parent = graph.getDefaultParent(); var vertex = null; graph.getModel().beginUpdate(); try { vertex = graph.insertVertex(parent, null, 'Hello', x, y, 80, 30); } finally { graph.getModel().endUpdate(); } graph.setSelectionCell(vertex); } } var img = document.createElement('img'); img.setAttribute('src', 'editors/images/rectangle.gif'); img.style.position = 'absolute'; img.style.left = '0px'; img.style.top = '0px'; img.style.width = '16px'; img.style.height = '16px'; var dragImage = img.cloneNode(true); dragImage.style.width = '32px'; dragImage.style.height = '32px'; mxUtils.makeDraggable(img, graph, funct, dragImage); document.body.appendChild(img); (end) Parameters: element - DOM element to make draggable. graphF - that acts as the drop target or a function that takes a mouse event and returns the current . funct - Function to execute on a successful drop. dragElement - Optional DOM node to be used for the drag preview. dx - Optional horizontal offset between the cursor and the drag preview. dy - Optional vertical offset between the cursor and the drag preview. autoscroll - Optional boolean that specifies if autoscroll should be used. Default is mxGraph.autoscroll. scalePreview - Optional boolean that specifies if the preview element should be scaled according to the graph scale. If this is true, then the offsets will also be scaled. Default is false. highlightDropTargets - Optional boolean that specifies if dropTargets should be highlighted. Default is true. getDropTarget - Optional function to return the drop target for a given location (x, y). Default is mxGraph.getCellAt.", "label": 1, "domain": "code", "token_count": 452, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0296", "text": "Constructor for a new _Requestor instance for the given service URL and default headers. @param {string} sServiceUrl URL of the service document to request the CSRF token from; also used to resolve relative resource paths (see {@link #request}) @param {object} [mHeaders={}] Map of default headers; may be overridden with request-specific headers; certain predefined OData V4 headers are added by default, but may be overridden @param {object} [mQueryParams={}] A map of query parameters as described in {@link sap.ui.model.odata.v4.lib._Helper.buildQuery}; used only to request the CSRF token @param {object} oModelInterface A interface allowing to call back to the owning model @param {function} oModelInterface.fetchEntityContainer A promise which is resolved with the $metadata \"JSON\" object as soon as the entity container is fully available, or rejected with an error. @param {function} oModelInterface.fetchMetadata A function that returns a SyncPromise which resolves with the metadata instance for a given meta path @param {function} oModelInterface.getGroupProperty A function called with parameters sGroupId and sPropertyName returning the property value in question. Only 'submit' is supported for sPropertyName. Supported property values are: 'API', 'Auto' and 'Direct'. @param {function} oModelInterface.reportBoundMessages A function for reporting bound messages; see {@link #reportBoundMessages} for the signature of this function @param {function} oModelInterface.reportUnboundMessages A function called with parameters sResourcePath and sMessages reporting unbound OData messages to the {@link sap.ui.core.message.MessageManager}. @param {function (string)} [oModelInterface.onCreateGroup] A callback function that is called with the group name as parameter when the first request is added to a group @private", "label": 1, "domain": "code", "token_count": 409, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0297", "text": "Add new networkipv6 :param id_vlan: Identifier of the Vlan. Integer value and greater than zero. :param id_tipo_rede: Identifier of the NetworkType. Integer value and greater than zero. :param num_hosts: Number of hosts expected. Integer value and greater than zero. :param id_ambiente_vip: Identifier of the Environment Vip. Integer value and greater than zero. :return: Following dictionary: :: {'vlan': {'id': < id_vlan >, 'nome': < nome_vlan >, 'num_vlan': < num_vlan >, 'id_tipo_rede': < id_tipo_rede >, 'id_ambiente': < id_ambiente >, 'rede_oct1': < rede_oct1 >, 'rede_oct2': < rede_oct2 >, 'rede_oct3': < rede_oct3 >, 'rede_oct4': < rede_oct4 >, 'rede_oct5': < rede_oct4 >, 'rede_oct6': < rede_oct4 >, 'rede_oct7': < rede_oct4 >, 'rede_oct8': < rede_oct4 >, 'bloco': < bloco >, 'mascara_oct1': < mascara_oct1 >, 'mascara_oct2': < mascara_oct2 >, 'mascara_oct3': < mascara_oct3 >, 'mascara_oct4': < mascara_oct4 >, 'mascara_oct5': < mascara_oct4 >, 'mascara_oct6': < mascara_oct4 >, 'mascara_oct7': < mascara_oct4 >, 'mascara_oct8': < mascara_oct4 >, 'broadcast': < broadcast >, 'descricao': < descricao >, 'acl_file_name': < acl_file_name >, 'acl_valida': < acl_valida >, 'ativada': < ativada >}} :raise TipoRedeNaoExisteError: NetworkType not found. :raise InvalidParameterError: Invalid ID for Vlan or NetworkType. :raise EnvironmentVipNotFoundError: Environment VIP not registered. :raise IPNaoDisponivelError: Network address unavailable to create a NetworkIPv6. :raise ConfigEnvironmentInvalidError: Invalid Environment Configuration or not registered :raise DataBaseError: Networkapi failed to access the database. :raise XMLError: Networkapi failed to generate the XML response.", "label": 1, "domain": "code", "token_count": 494, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0298", "text": "List all existing large person groups’ largePersonGroupId, name, userData and recognitionModel.
    * Large person groups are stored in alphabetical order of largePersonGroupId. * \"start\" parameter (string, optional) is a user-provided largePersonGroupId value that returned entries have larger ids by string comparison. \"start\" set to empty to indicate return from the first item. * \"top\" parameter (int, optional) specifies the number of entries to return. A maximal of 1000 entries can be returned in one call. To fetch more, you can specify \"start\" with the last returned entry’s Id of the current call.
    For example, total 5 large person groups: \"group1\", ..., \"group5\".
    \"start=&top=\" will return all 5 groups.
    \"start=&top=2\" will return \"group1\", \"group2\".
    \"start=group2&top=3\" will return \"group3\", \"group4\", \"group5\". @param start [String] List large person groups from the least largePersonGroupId greater than the \"start\". @param top [Integer] The number of large person groups to list. @param return_recognition_model [Boolean] A value indicating whether the operation should return 'recognitionModel' in response. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 317, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0299", "text": "/* Method: computeIncremental Performs the Force Directed algorithm incrementally. Description: ForceDirected algorithms can perform many computations and lead to JavaScript taking too much time to complete. This method splits the algorithm into smaller parts allowing the user to track the evolution of the algorithm and avoiding browser messages such as \"This script is taking too long to complete\". Parameters: opt - (object) The object properties are described below iter - (number) Default's *20*. Split the algorithm into pieces of _iter_ iterations. For example, if the _iterations_ configuration property of your class is 100, then you could set _iter_ to 20 to split the main algorithm into 5 smaller pieces. property - (string) Default's *end*. Whether to update starting, current or ending node positions. Possible values are 'end', 'start', 'current'. You can also set an array of these properties. If you'd like to keep the current node positions but to perform these computations for final animation positions then you can just choose 'end'. onStep - (function) A callback function called when each \"small part\" of the algorithm completed. This function gets as first formal parameter a percentage value. onComplete - A callback function called when the algorithm completed. Example: In this example I calculate the end positions and then animate the graph to those positions (start code js) var fd = new $jit.ForceDirected(...); fd.computeIncremental({ iter: 20, property: 'end', onStep: function(perc) { Log.write(\"loading \" + perc + \"%\"); }, onComplete: function() { Log.write(\"done\"); fd.animate(); } }); (end code) In this example I calculate all positions and (re)plot the graph (start code js) var fd = new ForceDirected(...); fd.computeIncremental({ iter: 20, property: ['end', 'start', 'current'], onStep: function(perc) { Log.write(\"loading \" + perc + \"%\"); }, onComplete: function() { Log.write(\"done\"); fd.plot(); } }); (end code)", "label": 1, "domain": "code", "token_count": 430, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0300", "text": "A factory method for creating {@link BooleanConstraint}s from an arbitrary propositional logic formula (wff). Allowed connectives are ^ (and), v (or), ~ (not), -> (implies), <-> (iff)}. Atoms in the formula should be named \"xN\" where x is in [a-z] and N is in {1..scope.length}. The signature of the formula must contain all and only the variables in the scope. The conversion to CNF is provided by the propositional logic CNFTransformer class of the aima-java library (see aima-java.googlecode.com).
    Note: the given wff must be composed of binary clauses (i.e., all parantheses must be made explicit). For example, the following wff
    (x1 ^ x2) ^ (x2 v ~x3 ^ x4) ^ (~x1 v x3) ^ (x2 v ~x3 ^ ~x4)
    must be input as
    ((((x1 ^ x2) ^ (x2 v (~x3 ^ x4))) ^ (~x1 v x3)) ^ (x2 v (~x3 ^ ~x4)))
    or as
    (((x1 ^ x2) ^ (x2 v (~x3 ^ x4))) ^ ((~x1 v x3) ^ (x2 v (~x3 ^ ~x4))))
    @param scope The {@link BooleanVariable}s referred to in the formula. @param wff An arbitrary propositional logic formula. @return One or more {@link BooleanConstraint}s representing the given formula in CNF.", "label": 1, "domain": "code", "token_count": 430, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0301", "text": "

    Perform am URI query parameter (name or value) escape operation on a String input, writing results to a Writer.

    The following are the only allowed chars in an URI query parameter (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ ' ( ) * , ;
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0302", "text": "Compares two software version numbers (e.g. \"1.7.1\" or \"1.2b\"). This function was born in http://stackoverflow.com/a/6832721. @param {string} v1 The first version to be compared. @param {string} v2 The second version to be compared. @param {object} [options] Optional flags that affect comparison behavior:
    • lexicographical: true compares each part of the version strings lexicographically instead of naturally; this allows suffixes such as \"b\" or \"dev\" but will cause \"1.10\" to be considered smaller than \"1.2\".
    • zeroExtend: true changes the result if one version string has less parts than the other. In this case the shorter string will be padded with \"zero\" parts instead of being considered smaller.
    @returns {number|NaN}
    • 0 if the versions are equal
    • a negative integer iff v1 < v2
    • a positive integer iff v1 > v2
    • NaN if either version string is in the wrong format
    @copyright by Jon Papaioannou ([\"john\", \"papaioannou\"].join(\".\") + \"@gmail.com\") @license This function is in the public domain. Do what you want with it, no strings attached.", "label": 1, "domain": "code", "token_count": 316, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0303", "text": "rubocop: enable PredicateName Slugify a filename or title. string - the filename or title to slugify mode - how string is slugified cased - whether to replace all uppercase letters with their lowercase counterparts When mode is \"none\", return the given string. When mode is \"raw\", return the given string, with every sequence of spaces characters replaced with a hyphen. When mode is \"default\" or nil, non-alphabetic characters are replaced with a hyphen too. When mode is \"pretty\", some non-alphabetic characters (._~!$&'()+,;=@) are not replaced with hyphen. When mode is \"ascii\", some everything else except ASCII characters a-z (lowercase), A-Z (uppercase) and 0-9 (numbers) are not replaced with hyphen. When mode is \"latin\", the input string is first preprocessed so that any letters with accents are replaced with the plain letter. Afterwards, it follows the \"default\" mode of operation. If cased is true, all uppercase letters in the result string are replaced with their lowercase counterparts. Examples: slugify(\"The _config.yml file\") # => \"the-config-yml-file\" slugify(\"The _config.yml file\", \"pretty\") # => \"the-_config.yml-file\" slugify(\"The _config.yml file\", \"pretty\", true) # => \"The-_config.yml file\" slugify(\"The _config.yml file\", \"ascii\") # => \"the-config-yml-file\" slugify(\"The _config.yml file\", \"latin\") # => \"the-config-yml-file\" Returns the slugified string.", "label": 1, "domain": "code", "token_count": 337, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0304", "text": "Gets the Service Fabric application backup configuration information. Gets the Service Fabric backup configuration information for the application and the services and partitions under this application. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PagedBackupConfigurationInfoList] operation results.", "label": 1, "domain": "code", "token_count": 395, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0305", "text": "Helper for computing an initial load size in {@link #loadInitial(LoadInitialParams, LoadInitialCallback)} when total data set size can be computed ahead of loading.

    This function takes the requested load size, and bounds checks it against the value returned by {@link #computeInitialLoadPosition(LoadInitialParams, int)}.

    Example usage in a PositionalDataSource subclass:

     class ItemDataSource extends PositionalDataSource<Item> { private int computeCount() { // actual count code here } private List<Item> loadRangeInternal(int startPosition, int loadCount) { // actual load code here } {@literal @}Override public void loadInitial({@literal @}NonNull LoadInitialParams params, {@literal @}NonNull LoadInitialCallback<Item> callback) { int totalCount = computeCount(); int position = computeInitialLoadPosition(params, totalCount); int loadSize = computeInitialLoadSize(params, position, totalCount); callback.onResult(loadRangeInternal(position, loadSize), position, totalCount); } {@literal @}Override public void loadRange({@literal @}NonNull LoadRangeParams params, {@literal @}NonNull LoadRangeCallback<Item> callback) { callback.onResult(loadRangeInternal(params.startPosition, params.loadSize)); } }
    @param params Params passed to {@link #loadInitial(LoadInitialParams, LoadInitialCallback)}, including page size, and requested start/loadSize. @param initialLoadPosition Value returned by {@link #computeInitialLoadPosition(LoadInitialParams, int)} @param totalCount Total size of the data set. @return Number of items to load. @see #computeInitialLoadPosition(LoadInitialParams, int)", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0306", "text": "Apply the filter to values extracted from an entity. Think of self.match_keys and self.match_values as representing a table with one row. For example: match_keys = ('name', 'age', 'rank') match_values = ('Joe', 24, 5) (Except that in reality, the values are represented by tuples produced by datastore_types.PropertyValueToKeyValue().) represents this table: | name | age | rank | +---------+-------+--------+ | 'Joe' | 24 | 5 | Think of key_value_map as a table with the same structure but (potentially) many rows. This represents a repeated structured property of a single entity. For example: {'name': ['Joe', 'Jane', 'Dick'], 'age': [24, 21, 23], 'rank': [5, 1, 2]} represents this table: | name | age | rank | +---------+-------+--------+ | 'Joe' | 24 | 5 | | 'Jane' | 21 | 1 | | 'Dick' | 23 | 2 | We must determine wheter at least one row of the second table exactly matches the first table. We need this class because the datastore, when asked to find an entity with name 'Joe', age 24 and rank 5, will include entities that have 'Joe' somewhere in the name column, 24 somewhere in the age column, and 5 somewhere in the rank column, but not all aligned on a single row. Such an entity should not be considered a match.", "label": 1, "domain": "code", "token_count": 322, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0307", "text": "Gets the Service Fabric service backup configuration information. Gets the Service Fabric backup configuration information for the service and the partitions under this service. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PagedBackupConfigurationInfoList] operation results.", "label": 1, "domain": "code", "token_count": 402, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0308", "text": "Compares this BigDecimal to another.

    Implements numeric comparison, (as defined in the decimal documentation, see {@link BigDecimal class header}), and returns a result of type int.

    The result will be:
    -1 if the current object is less than the first parameter
    0 if the current object is equal to the first parameter
    1 if the current object is greater than the first parameter.

    A {@link #compareTo(Object)} method is also provided. @param rhs The BigDecimal for the right hand side of the comparison. @param set The MathContext arithmetic settings. @return An int whose value is -1, 0, or 1 as this is numerically less than, equal to, or greater than rhs. @see #compareTo(Object) @stable ICU 2.0 public int compareTo(com.ibm.icu.math.BigDecimal rhs,com.ibm.icu.math.MathContext set){", "label": 1, "domain": "code", "token_count": 300, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0309", "text": "A formatter function to be used in a complex binding inside an XML template view in order to interpret OData V4 annotations. It knows about the following dynamic expressions:

    • \"14.5.2 Expression edm:AnnotationPath\"
    • \"14.5.11 Expression edm:NavigationPropertyPath\"
    • \"14.5.12 Expression edm:Path\"
    • \"14.5.13 Expression edm:PropertyPath\"
    It returns the information whether the navigation path ends with an association end with multiplicity \"*\". It throws an error if the navigation path has an association end with multiplicity \"*\" which is not the last one. Currently supports navigation properties. Term casts and annotations of navigation properties terminate the navigation path. Examples:
     <template:if test=\"{path: 'facet>Target', formatter: 'sap.ui.model.odata.AnnotationHelper.isMultiple'}\"> 
    @param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface the callback interface related to the current formatter call @param {any} [vRawValue] the raw value from the meta model, e.g. {AnnotationPath : \"ToSupplier/@com.sap.vocabularies.Communication.v1.Address\"} or {AnnotationPath : \"@com.sap.vocabularies.UI.v1.FieldGroup#Dimensions\"}; embedded within an entity set or entity type;
    • if this function is used as formatter the value is provided by the framework
    • if this function is called directly, provide the parameter only if it is already calculated
    • if the parameter is omitted, it is calculated automatically through oInterface.getObject(\"\")
    @returns {string} \"true\" if the navigation path ends with an association end with multiplicity \"*\", \"\" in case the navigation path cannot be determined, \"false\" otherwise (the latter are both treated as falsy in template:if statements!) @throws {Error} if the navigation path has an association end with multiplicity \"*\" which is not the last one @public", "label": 1, "domain": "code", "token_count": 475, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0310", "text": "Creates a ProgramInfo from 2 sources. A ProgramInfo contains programInfo = { program: WebGLProgram, uniformSetters: object of setters as returned from createUniformSetters, attribSetters: object of setters as returned from createAttribSetters, } NOTE: There are 4 signatures for this function twgl.createProgramInfo(gl, [vs, fs], options); twgl.createProgramInfo(gl, [vs, fs], opt_errFunc); twgl.createProgramInfo(gl, [vs, fs], opt_attribs, opt_errFunc); twgl.createProgramInfo(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. @param {string[]} shaderSources Array of sources for the shaders or ids. The first is assumed to be the vertex shader, the second the fragment shader. @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback. @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console on error. If you want something else pass an callback. It's passed an error message. @return {module:twgl.ProgramInfo?} The created ProgramInfo or null if it failed to link or compile @memberOf module:twgl/programs", "label": 1, "domain": "code", "token_count": 349, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0311", "text": "Bivariate, Correlated Errors and intrinsic Scatter (BCES) translated from the FORTRAN code by Christina Bird and Matthew Bershady (Akritas & Bershady, 1996) Linear regression in the presence of heteroscedastic errors on both variables and intrinsic scatter Parameters ---------- x1 : array of floats Independent variable, or observable x2 : array of floats Dependent variable x1err : array of floats (optional) Uncertainties on the independent variable x2err : array of floats (optional) Uncertainties on the dependent variable cerr : array of floats (optional) Covariances of the uncertainties in the dependent and independent variables logify : bool (default True) Whether to take the log of the measurements in order to estimate the best-fit power law instead of linear relation model : {'yx', 'xy', 'bi', 'orth'} BCES model with which to calculate regression. See Notes below for details. bootstrap : False or int (default 5000) get the errors from bootstrap resampling instead of the analytical prescription? if bootstrap is an int, it is the number of bootstrap resamplings verbose : str (default 'normal') Verbose level. Options are {'quiet', 'normal', 'debug'} full_output : bool (default True) If True, return also the covariance between the normalization and slope of the regression. Returns ------- a : tuple of length 2 Best-fit normalization and its uncertainty (a, da) b : tuple of length 2 Best-fit slope and its uncertainty (b, db) Optional outputs ---------------- cov_ab : 2x2 array of floats covariance between a and b. Returned if full_output is set to True. Notes ----- If verbose is normal or debug, the results from all the BCES models will be printed (still, only the one selected in *model* will be returned). the *model* parameter: -'yx' stands for BCES(Y|X) -'xy' stands for BCES(X|Y) -'bi' stands for BCES Bisector -'orth' stands for BCES Orthogonal", "label": 1, "domain": "code", "token_count": 428, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0312", "text": "Uploads a file chunk to the image store relative path. Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. @param content_path [String] Relative path to file or folder in the image store from its root. @param session_id A GUID generated by the user for a file uploading. It identifies an image store upload session which keeps track of all file chunks until it is committed. @param content_range [String] When uploading file chunks to the image store, the Content-Range header field need to be configured and sent with a request. The format should looks like \"bytes {First-Byte-Position}-{Last-Byte-Position}/{File-Length}\". For example, Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300 through 5,000 and the total file length is 20,000 bytes. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 374, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0313", "text": "/* Match str against the query using the QuickOpen algorithm provided by the functions above. The general idea is to prefer matches of \"special\" characters and, optionally, matches that occur in the \"last segment\" (generally, the filename). stringMatch will try to provide the best match and produces a \"matchGoodness\" score to allow for relative ranking. The result object returned includes \"stringRanges\" which can be used to highlight the matched portions of the string, in addition to the \"matchGoodness\" mentioned above. If DEBUG_SCORES is true, scoreDebug is set on the result to provide insight into the score. The matching is done in a case-insensitive manner. @param {string} str The string to search @param {string} query The query string to find in string @param {{preferPrefixMatches:?boolean, segmentedSearch:?boolean}} options to control search behavior. preferPrefixMatches puts an exact case-insensitive prefix match ahead of all other matches, even short-circuiting the match logic. This option implies segmentedSearch=false. When segmentedSearch is true, the string is broken into segments by \"/\" characters and the last segment is searched first and matches there are scored higher. @param {?Object} special (optional) the specials data from findSpecialCharacters, if already known This is generally just used by StringMatcher for optimization. @return {{ranges:Array.<{text:string, matched:boolean, includesLastSegment:boolean}>, matchGoodness:int, scoreDebug: Object}} matched ranges and score", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0314", "text": "Returns a context interface for the indicated part in case of the root formatter of a composite binding. The new interface provides access to the original settings, but only to the model and path of the indicated part:
     this.getInterface(i).getSetting(sName) === this.getSetting(sName); this.getInterface(i).getModel() === this.getModel(i); this.getInterface(i).getPath() === this.getPath(i); 
    If a path is given, the new interface points to the resolved path as follows:
     this.getInterface(i, \"foo/bar\").getPath() === this.getPath(i) + \"/foo/bar\"; this.getInterface(i, \"/absolute/path\").getPath() === \"/absolute/path\"; 
    A formatter which is not at the root level of a composite binding can also provide a path, but must not provide an index:
     this.getInterface(\"foo/bar\").getPath() === this.getPath() + \"/foo/bar\"; this.getInterface(\"/absolute/path\").getPath() === \"/absolute/path\"; 
    Note that at least one argument must be present. @param {number} [iPart] index of part in case of the root formatter of a composite binding @param {string} [sPath] a path, interpreted relative to this.getPath(iPart) @returns {sap.ui.core.util.XMLPreprocessor.IContext} the context interface related to the indicated part @throws {Error} In case an index is given but the current interface does not belong to the root formatter of a composite binding, or in case the given index is invalid (e.g. missing or out of range), or in case a path is missing because no index is given, or in case a path is given but the model cannot not create a binding context synchronously @public @since 1.31.0", "label": 1, "domain": "code", "token_count": 375, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0315", "text": "API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and the difference in time have to be less than 31 days. :param block_name: name of the block :type block_name: str :param dataset: dataset :type dataset: str :param data_tier_name: data tier :type data_tier_name: str :param logical_file_name: Logical File Name :type logical_file_name: str :param origin_site_name: Origin Site Name (Optional) :type origin_site_name: str :param run_num: run numbers (Optional). Possible format: run_num, \"run_min-run_max\", or [\"run_min-run_max\", run1, run2, ...] :type run_num: int, list of runs or list of run ranges :param min_cdate: Lower limit for the creation date (unixtime) (Optional) :type min_cdate: int, str :param max_cdate: Upper limit for the creation date (unixtime) (Optional) :type max_cdate: int, str :param min_ldate: Lower limit for the last modification date (unixtime) (Optional) :type min_ldate: int, str :param max_ldate: Upper limit for the last modification date (unixtime) (Optional) :type max_ldate: int, str :param cdate: creation date (unixtime) (Optional) :type cdate: int, str :param ldate: last modification date (unixtime) (Optional) :type ldate: int, str :param detail: Get detailed information of a block (Optional) :type detail: bool :returns: List of dictionaries containing following keys (block_name). If option detail is used the dictionaries contain the following keys (block_id, create_by, creation_date, open_for_writing, last_modified_by, dataset, block_name, file_count, origin_site_name, last_modification_date, dataset_id and block_size) :rtype: list of dicts", "label": 1, "domain": "code", "token_count": 442, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0316", "text": "druidG.g:145:1: queryStmnt returns [QueryMeta qMeta] : SELECT ( ( WS selectItems[qMeta] ( ( WS )? ',' ( WS )? selectItems[qMeta] )* ) | ( WS '*' ) )? WS FROM ( ( WS id= ID ) | ( WS LPARAN (fromQuery= queryStmnt ) RPARAN ) ) ( WS WHERE WS whereClause[qMeta] ( ( WS BREAK WS BY WS gran= granularityClause )? ( WS GROUP WS BY WS (id= ID ( ( WS )? ',' ( WS )? id= ID )* ) ( WS HAVING WS h= havingClause )? )? ( WS ORDER WS BY WS (id= ID ) ( WS dir= ( ASC | DESC ) )? )? ( WS LIMIT WS (l= LONG ) )? ( WS THEN WS p= postAggItem )? ) ( WS WHICH WS CONTAINS ( WS )? LPARAN ( WS )? (s1= SINGLE_QUOTE_STRING ( ( WS )? ',' ( WS )? s2= SINGLE_QUOTE_STRING )* ) ( WS )? RPARAN WS SORT ( WS )? LPARAN ( WS )? (s= SINGLE_QUOTE_STRING ) ( WS )? RPARAN )? ( WS HINT ( WS )? LPARAN ( WS )? s= SINGLE_QUOTE_STRING ( WS )? RPARAN )? )? ;", "label": 1, "domain": "code", "token_count": 303, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0317", "text": "Converts a Slate Raw text node to an MDAST text node. Slate text nodes without marks often simply have a \"text\" property with the value. In this case the conversion to MDAST is simple. If a Slate text node does not have a \"text\" property, it will instead have a \"leaves\" property containing an array of objects, each with an array of marks, such as \"bold\" or \"italic\", along with a \"text\" property. MDAST instead expresses such marks in a nested structure, with individual nodes for each mark type nested until the deepest mark node, which will contain the text node. To convert a Slate text node's marks to MDAST, we treat each \"leaf\" as a separate text node, convert the text node itself to an MDAST text node, and then recursively wrap the text node for each mark, collecting the results of each leaf in a single array of child nodes. For example, this Slate text node: { object: 'text', leaves: [ { text: 'test', marks: ['bold', 'italic'] }, { text: 'test two' } ] } ...would be converted to this MDAST nested structure: [ { type: 'strong', children: [{ type: 'emphasis', children: [{ type: 'text', value: 'test' }] }] }, { type: 'text', value: 'test two' } ] This example also demonstrates how a single Slate node may need to be replaced with multiple MDAST nodes, so the resulting array must be flattened.", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0318", "text": "Creates and registers a new QuickOpenPlugin @param { name: string, languageIds: !Array., done: ?function(), search: function(string, !StringMatch.StringMatcher):(!Array.|$.Promise), match: function(string):boolean, itemFocus: ?function(?SearchResult|string, string, boolean), itemSelect: function(?SearchResult|string, string), resultsFormatter: ?function(SearchResult|string, string):string, matcherOptions: ?Object, label: ?string } pluginDef Parameter Documentation: name - plug-in name, **must be unique** languageIds - language Ids array. Example: [\"javascript\", \"css\", \"html\"]. To allow any language, pass []. Required. done - called when quick open is complete. Plug-in should clear its internal state. Optional. search - takes a query string and a StringMatcher (the use of which is optional but can speed up your searches) and returns an array of strings or result objects that match the query; or a Promise that resolves to such an array. Required. match - takes a query string and returns true if this plug-in wants to provide results for this query. Required. itemFocus - performs an action when a result has been highlighted (via arrow keys, or by becoming top of the list). Passed the highlighted search result item (as returned by search()), the current query string, and a flag that is true if the item was highlighted explicitly (arrow keys), not implicitly (at top of list after last search()). Optional. itemSelect - performs an action when a result is chosen. Passed the highlighted search result item (as returned by search()), and the current query string. Required. resultsFormatter - takes a query string and an item string and returns a
  • item to insert into the displayed search results. Optional. matcherOptions - options to pass along to the StringMatcher (see StringMatch.StringMatcher for available options). Optional. label - if provided, the label to show before the query field. Optional. If itemFocus() makes changes to the current document or cursor/scroll position and then the user cancels Quick Open (via Esc), those changes are automatically reverted.", "label": 1, "domain": "code", "token_count": 444, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0319", "text": "Query the departures from a station @param {string} fromStationId Id of the station of departure @param {string} toStationId Id of a station on the route of the train (optional) @param {string} fromTime HH:mm:ss Includes trains leaving how long AFTER the current time? (default: -00:30:00) - If the value is negative, includes trains leaving before the current time @param {string} toTime HH:mm:ss Excludes trains leaving how long AFTER the current time? (default: 03:00:00) @return {array} Array of departure objects containing the following keys: - train {string}: Train id - track {string}: Track nunber at departing station - cancelled {boolean}: Departure cancelled? - delayed {boolean}: Departure delayed? - deviation {string[]}: Deiations, for example: \"Bus Replacement\" - date {string}: Date of departure (DD/MM/YYYY) - time {string}: Time of departure (HH:mm:ss) - estimatedDate {string}: Estimated date of departure (DD/MM/YYYY) - estimatedTime {string}: Estimated time of departure (HH:mm:ss) - plannedEstimatedDate {string}: Planned delayed departure date (DD/MM/YYYY) - plannedEstimatedTime {string}: Planned delayed departure time (HH:mm:ss) - scheduledDepartureDate {string}: The train's announced departure date (DD/MM/YYYY) - scheduledDepartureTime {string}: The train's announced departure time (HH:mm:ss) - destination {string}: Name of the final destination station - via {string[]}: Name of the stations where the train stops", "label": 1, "domain": "code", "token_count": 334, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0320", "text": "Add a job to a queue. ADDJOB queue_name job [REPLICATE ] [DELAY ] [RETRY ] [TTL ] [MAXLEN ] [ASYNC] :param queue_name: is the name of the queue, any string, basically. :param job: is a string representing the job. :param timeout: is the command timeout in milliseconds. :param replicate: count is the number of nodes the job should be replicated to. :param delay: sec is the number of seconds that should elapse before the job is queued by any server. :param retry: sec period after which, if no ACK is received, the job is put again into the queue for delivery. If RETRY is 0, the job has an at-most-once delivery semantics. :param ttl: sec is the max job life in seconds. After this time, the job is deleted even if it was not successfully delivered. :param maxlen: count specifies that if there are already count messages queued for the specified queue name, the message is refused and an error reported to the client. :param asynchronous: asks the server to let the command return ASAP and replicate the job to other nodes in the background. The job gets queued ASAP, while normally the job is put into the queue only when the client gets a positive reply. Changing the name of this argument as async is reserved keyword in python 3.7 :returns: job_id", "label": 1, "domain": "code", "token_count": 304, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0321", "text": "分块上传 初始化分块上传 @param {Object} params 参数对象,必须 @param {String} params.Bucket Bucket名称,必须 @param {String} params.Region 地域名称,必须 @param {String} params.Key object名称,必须 @param {String} params.UploadId object名称,必须 @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须 @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存 ,非必须 @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须 @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须 @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须 @param {String} params.ACL 允许用户自定义文件权限,非必须 @param {String} params.GrantRead 赋予被授权者读的权限 ,非必须 @param {String} params.GrantWrite 赋予被授权者写的权限 ,非必须 @param {String} params.GrantFullControl 赋予被授权者读写权限 ,非必须 @param {String} params.StorageClass 设置Object的存储级别,枚举值:Standard,Standard_IA,Archive,非必须 @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须 @param {Function} callback 回调函数,必须 @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 @return {Object} data 返回的数据", "label": 1, "domain": "code", "token_count": 405, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0322", "text": "Implementation of the look-aside cache pattern. This caching data access operation first attempts to locate an entry in the {@link Cache} with the given {@link KEY key}, returning the {@link VALUE value} of the entry if present. If an entry with the given {@link KEY key} is not present in the {@link Cache} then the supplied {@link Supplier cacheable operation} is invoked to compute or load a {@link VALUE value} and put into the {@link Cache} as an entry mapped by the given {@link KEY key}; this operation completes by returning the {@link VALUE result} of the {@link Supplier cacheable operation}. @param {@link Class type} of the return {@link VALUE value}. @param key {@link KEY key} used to identify the {@link Cache} entry containing the {@link VALUE} to lookup. @param cacheableOperation {@link Supplier} used to compute or load a {@link VALUE value} for given {@link KEY key} if the cacheable data access operation initially results in a cache miss. @return the cached {@link VALUE value} for the given {@link KEY key} in the {@link Cache} if present, or returns the {@link VALUE value} supplied by invoking the {@link Supplier cacheable operation}. @throws IllegalArgumentException if either the {@link KEY key} or the {@link Supplier} are {@literal null}. @see java.util.function.Supplier @see #getCache() @see #getLock()", "label": 1, "domain": "code", "token_count": 300, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0323", "text": "Gets the list of compose deployments created in the Service Fabric cluster. Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token which can be used to get the next page. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 361, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0324", "text": "Applies the support for custom style classes on the prototype of a sap.ui.core.Element. All controls (subclasses of sap.ui.core.Control) provide the support custom style classes. The control API provides functions to the application which allow it to add, remove or change style classes for the control. In general, this option is not available for elements because elements do not necessarily have a representation in the DOM. This function can be used by a control developer to explicitly enrich the API of his/her element implementation with the API functions for the custom style class support. It must be called on the prototype of the element. Usage Example:
     sap.ui.define(['sap/ui/core/Element', 'sap/ui/core/CustomStyleClassSupport'], function(Element, CustomStyleClassSupport) { \"use strict\"; var MyElement = Element.extend(\"my.MyElement\", { metadata : { //... } //... }); CustomStyleClassSupport.apply(MyElement.prototype); return MyElement; }, true); 
    Furthermore, the function oRenderManager.writeClasses(oElement); ({@link sap.ui.core.RenderManager#writeClasses}) must be called within the renderer of the control to which the element belongs, when writing the root tag of the element. This ensures the classes are written to the HTML. This function adds the following functions to the elements prototype:
    • addStyleClass: {@link sap.ui.core.Control#addStyleClass}
    • removeStyleClass: {@link sap.ui.core.Control#removeStyleClass}
    • toggleStyleClass: {@link sap.ui.core.Control#toggleStyleClass}
    • hasStyleClass: {@link sap.ui.core.Control#hasStyleClass}
    In addition the clone function of the element is extended to ensure that the custom style classes are also available on the cloned element. Note: This function can only be used within control development. An application cannot add style class support on existing elements by calling this function. @public @alias sap.ui.core.CustomStyleClassSupport @function", "label": 1, "domain": "code", "token_count": 468, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0325", "text": "Gets the health of a Service Fabric cluster using health chunks. Gets the health of a Service Fabric cluster using health chunks. The health evaluation is done based on the input cluster health chunk query description. The query description allows users to specify health policies for evaluating the cluster and its children. Users can specify very flexible filters to select which cluster entities to return. The selection can be done based on the entities health state and based on the hierarchy. The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return only services that are in Error or Warning, and all partitions and replicas for one of these services. @param cluster_health_chunk_query_description [ClusterHealthChunkQueryDescription] Describes the cluster and application health policies used to evaluate the cluster health and the filters to select which cluster entities to be returned. If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the default cluster health policy. By default, each application is evaluated using its specific application health policy, defined in the application manifest, or the default health policy, if no policy is defined in manifest. If the application health policy map is specified, and it has an entry for an application, the specified application health policy is used to evaluate the application health. Users can specify very flexible filters to select which cluster entities to include in response. The selection can be done based on the entities health state and based on the hierarchy. The query can return multi-level children of the entities based on the specified filters. For example, it can return one application with a specified name, and for this application, return only services that are in Error or Warning, and all partitions and replicas for one of these services. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 467, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0326", "text": "
     Generate log-normally distributed doubles. Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using ::curandSetStream(), or the null stream if no stream has been set. Results are 64-bit floating point values with log-normal distribution based on an associated normal distribution with mean mean and standard deviation stddev. Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality. The normally distributed results are transformed into log-normal distribution. There may be slight numerical differences between results generated on the GPU with generators created with ::curandCreateGenerator() and results calculated on the CPU with generators created with ::curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values. @param generator - Generator to use @param outputPtr - Pointer to device memory to store CUDA-generated results, or Pointer to host memory to store CPU-generated results @param n - Number of doubles to generate @param mean - Mean of normal distribution @param stddev - Standard deviation of normal distribution @return CURAND_STATUS_NOT_INITIALIZED if the generator was never created CURAND_STATUS_PREEXISTING_FAILURE if there was an existing error from a previous kernel launch CURAND_STATUS_LAUNCH_FAILURE if the kernel launch failed for any reason CURAND_STATUS_LENGTH_NOT_MULTIPLE if the number of output samples is not a multiple of the quasirandom dimension, or is not a multiple of two for pseudorandom generators CURAND_STATUS_DOUBLE_PRECISION_REQUIRED if the GPU does not support double precision CURAND_STATUS_SUCCESS if the results were generated successfully 
    ", "label": 1, "domain": "code", "token_count": 400, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0327", "text": "A complete |Selection| object of all \"supplying\" and \"routing\" elements and required nodes. >>> from hydpy import RiverBasinNumbers2Selection >>> rbns2s = RiverBasinNumbers2Selection( ... (111, 113, 1129, 11269, 1125, 11261, ... 11262, 1123, 1124, 1122, 1121)) >>> rbns2s.selection Selection(\"complete\", nodes=(\"node_1123\", \"node_1125\", \"node_11269\", \"node_1129\", \"node_113\", \"node_outlet\"), elements=(\"land_111\", \"land_1121\", \"land_1122\", \"land_1123\", \"land_1124\", \"land_1125\", \"land_11261\", \"land_11262\", \"land_11269\", \"land_1129\", \"land_113\", \"stream_1123\", \"stream_1125\", \"stream_11269\", \"stream_1129\", \"stream_113\")) Besides the possible modifications on the names of the different nodes and elements, the name of the selection can be set differently: >>> rbns2s.selection_name = 'sel' >>> from hydpy import pub >>> with pub.options.ellipsis(1): ... print(repr(rbns2s.selection)) Selection(\"sel\", nodes=(\"node_1123\", ...,\"node_outlet\"), elements=(\"land_111\", ...,\"stream_113\"))", "label": 1, "domain": "code", "token_count": 319, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0328", "text": "set parameters according to specification these parameters are accepted: :param pulp_secret: str, resource name of pulp secret :param koji_target: str, koji tag with packages used to build the image :param kojiroot: str, URL from which koji packages are fetched :param kojihub: str, URL of the koji hub :param koji_certs_secret: str, resource name of secret that holds the koji certificates :param koji_task_id: int, Koji Task that created this build config :param flatpak: if we should build a Flatpak OCI Image :param filesystem_koji_task_id: int, Koji Task that created the base filesystem :param pulp_registry: str, name of pulp registry in dockpulp.conf :param sources_command: str, command used to fetch dist-git sources :param architecture: str, architecture we are building for :param vendor: str, vendor name :param build_host: str, host the build will run on or None for auto :param authoritative_registry: str, the docker registry authoritative for this image :param distribution_scope: str, distribution scope for this image (private, authoritative-source-only, restricted, public) :param use_auth: bool, use auth from atomic-reactor? :param platform_node_selector: dict, a nodeselector for a specific platform :param platform_descriptors: dict, platforms and their archiectures and enable_v1 settings :param scratch_build_node_selector: dict, a nodeselector for scratch builds :param explicit_build_node_selector: dict, a nodeselector for explicit builds :param auto_build_node_selector: dict, a nodeselector for auto builds :param isolated_build_node_selector: dict, a nodeselector for isolated builds :param is_auto: bool, indicates if build is auto build :param parent_images_digests: dict, mapping image names with tags to platform specific digests, example: {'registry.fedorahosted.org/fedora:29': { x86_64': 'registry.fedorahosted.org/fedora@sha256:....'} }", "label": 1, "domain": "code", "token_count": 421, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0329", "text": "FIXME: 'POST a new repository' is a deprecated feature of the API Create a new repository for the authenticated user. = Parameters :name - Required string :description - Optional string :website - Optional string :is_private - Optional boolean - true to create a private repository, false to create a public one. :has_issues - Optional boolean - true to enable issues for this repository, false to disable them :has_wiki - Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true :owner Optional string - The team in which this repository will be created = Examples bitbucket = BitBucket.new bitbucket.repos.create \"name\" => 'repo-name' \"description\": \"This is your first repo\", \"website\": \"https://bitbucket.com\", \"is_private\": false, \"has_issues\": true, \"has_wiki\": true Create a new repository in this team. The authenticated user must be a member of this team Examples: bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...' bitbucket.repos.create :name => 'repo-name', :owner => 'team-name'", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0330", "text": "/*[deutsch]

    Interpretiert den angegebenen Text als Intervall mit Hilfe des angegebenen Intervallmusters.

    Beginnend mit der Version v4.18 ist es auch möglich, eine Oder-Logik im Muster zu verwenden. Beispiel:

     String multiPattern = "{0} - {1}|since {0}|until {1}"; ChronoParser<PlainDate> parser = ChronoFormatter.ofDatePattern("MMMM d / uuuu", PatternType.CLDR, Locale.US); DateInterval between = DateInterval.parse("July 20 / 2015 - December 31 / 2015", parser, multiPattern); System.out.println(between); // [2015-07-20/2015-12-31] DateInterval since = DateInterval.parse("since July 20 / 2015", parser, multiPattern); System.out.println(since); // [2015-07-20/+∞) DateInterval until = DateInterval.parse("until December 31 / 2015", parser, multiPattern); System.out.println(until); // (-∞/2015-12-31] 
    @param text text to be parsed @param parser format object for parsing start and end components @param intervalPattern interval pattern containing placeholders {0} and {1} (for start and end) @return parsed interval @throws IndexOutOfBoundsException if given text is empty @throws ParseException if the text is not parseable @since 3.9/4.6", "label": 1, "domain": "code", "token_count": 357, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0331", "text": "Lists a collection of the members of the group, specified by its identifier. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param group_id [String] Group identifier. Must be unique in the current API Management service instance. @param filter [String] | Field | Supported operators | Supported functions | |------------------|------------------------|-----------------------------------| | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | state | eq | N/A | | registrationDate | ge, le, eq, ne, gt, lt | N/A | | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0332", "text": "Move a build's artifacts to a new repository optionally moving or copying the build's dependencies to the target repository and setting properties on promoted artifacts. @example promote the build to 'omnibus-stable-local' build.promote('omnibus-stable-local') @example promote a build attaching some new properites build.promote('omnibus-stable-local' properties: { 'promoted_by' => 'hipchat:schisamo@chef.io' } ) @param [String] target_repo repository to move or copy the build's artifacts and/or dependencies @param [Hash] options the list of options to pass @option options [String] :status (default: 'promoted') new build status (any string) @option options [String] :comment (default: '') an optional comment describing the reason for promotion @option options [String] :user (default: +Artifactory.username+) the user that invoked promotion @option options [Boolean] :dry_run (default: +false+) pretend to do the promotion @option options [Boolean] :copy (default: +false+) whether to copy instead of move @option options [Boolean] :dependencies (default: +false+) whether to move/copy the build's dependencies @option options [Array] :scopes (default: []) an array of dependency scopes to include when \"dependencies\" is true @option options [Hash>] :properties (default: []) a list of properties to attach to the build's artifacts @option options [Boolean] :fail_fast (default: +true+) fail and abort the operation upon receiving an error @return [Hash] the parsed JSON response from the server", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0333", "text": "Strongly hint runtimes to intern the provided string. When do I need to use this function? For the most part, never. Pre-mature optimization is bad, and often the runtime does exactly what you need it to, and more often the trade-off isn't worth it. Why? Runtimes store strings in at least 2 different representations: Ropes and Symbols (interned strings). The Rope provides a memory efficient data-structure for strings created from concatenation or some other string manipulation like splitting. Unfortunately checking equality of different ropes can be quite costly as runtimes must resort to clever string comparison algorithims. These algorithims typically cost in proportion to the length of the string. Luckily, this is where the Symbols (interned strings) shine. As Symbols are unique by their string content, equality checks can be done by pointer comparision. How do I know if my string is a rope or symbol? Typically (warning general sweeping statement, but truthy in runtimes at present) static strings created as part of the JS source are interned. Strings often used for comparisions can be interned at runtime if some criteria are met. One of these criteria can be the size of the entire rope. For example, in chrome 38 a rope longer then 12 characters will not intern, nor will segments of that rope. Some numbers: http://jsperf.com/eval-vs-keys/8 Known Trick™ @private @return {String} interned version of the provided string", "label": 1, "domain": "code", "token_count": 304, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0334", "text": "Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. @param filter [String] OData filter. Optional. @param top [Integer] The number of items to return. Optional. @param skip [Integer] The number of items to skip over before returning elements. Optional. @param expand [String] OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. @param select [String] OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. @param orderby [String] OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. @param count [Boolean] The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. @param search [String] A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. @param format [String] The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0335", "text": "Checks if the database operations associated with two object envelopes that are related via an 1:1 (or n:1) reference needs to be performed in a particular order and if so builds and returns a corresponding directed edge weighted with CONCRETE_EDGE_WEIGHT. The following cases are considered (* means object needs update, + means object needs insert, - means object needs to be deleted):
    (1)* -(1:1)-> (2)*no edge
    (1)* -(1:1)-> (2)+(2)->(1) edge
    (1)* -(1:1)-> (2)-no edge (cannot occur)
    (1)+ -(1:1)-> (2)*no edge
    (1)+ -(1:1)-> (2)+(2)->(1) edge
    (1)+ -(1:1)-> (2)-no edge (cannot occur)
    (1)- -(1:1)-> (2)*no edge
    (1)- -(1:1)-> (2)+no edge
    (1)- -(1:1)-> (2)-(1)->(2) edge
    @param vertex1 object envelope vertex of the object holding the reference @param vertex2 object envelope vertex of the referenced object @return an Edge object or null if the two database operations can be performed in any order", "label": 1, "domain": "code", "token_count": 424, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0336", "text": "Get Skills. Get Skills from Configuration Server with the specified filters. @param limit The number of objects the Provisioning API should return. (optional) @param offset The number of matches the Provisioning API should skip in the returned objects. (optional) @param searchTerm The term that you want to search for in the object keys. The Provisioning API searches for the this term in the value of the key you specify in 'search_key'. (optional) @param searchKey The key you want the Provisioning API to use when searching for the term you specified in 'search_term'. You can find valid key names in the Platform SDK documentation for [CfgDN](https://docs.genesys.com/Documentation/PSDK/9.0.x/ConfigLayerRef/CfgDN) and [CfgAgentGroup](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgAgentGroup). (optional) @param matchMethod The method the Provisioning API should use to match the 'search_term'. Possible values are includes, startsWith, endsWith, and isEqual. (optional, default to includes) @param sortKey A key in [CfgDN](https://docs.genesys.com/Documentation/PSDK/9.0.x/ConfigLayerRef/CfgDN), [CfgSkill](https://docs.genesys.com/Documentation/PSDK/9.0.x/ConfigLayerRef/CfgSkill) or [CfgAgentGroup](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgAgentGroup) to sort the search results. (optional) @param sortAscending Specifies whether to sort the search results in ascending or descending order. (optional, default to true) @param sortMethod Specifies the sort method. Possible values are caseSensitive, caseInsensitive or numeric. (optional, default to caseSensitive) @param inUse Specifies whether to return only skills actually assigned to agents. (optional, default to false) @return Results object which includes list of Skills and the total count. @throws ProvisioningApiException if the call is unsuccessful.", "label": 1, "domain": "code", "token_count": 444, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0337", "text": "

    Perform an HTML 4 level 2 (result is ASCII) escape operation on a char[] input.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding HTML 4 Named Character References (e.g. '&acute;') when such NCR exists for the replaced character, and replacing by a decimal character reference (e.g. '&#8345;') when there there is no NCR for the replaced character.

    This method calls {@link #escapeHtml(char[], int, int, java.io.Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 443, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0338", "text": ">>> idbf = InfluxDBForwarder('no_host', '8086', 'deadpool', ... 'chimichanga', 'logs', 'collection') >>> log = {u'data': {u'_': {u'file': u'log.py', ... u'fn': u'start', ... u'ln': 8, ... u'name': u'__main__'}, ... u'a': 1, ... u'b': 2, ... u'__ignore_this': 'some_string', ... u'msg': u'this is a dummy log'}, ... u'error': False, ... u'error_tb': u'', ... u'event': u'some_log', ... u'file': u'/var/log/sample.log', ... u'formatter': u'logagg.formatters.basescript', ... u'host': u'deepcompute', ... u'id': u'20180409T095924_aec36d313bdc11e89da654e1ad04f45e', ... u'level': u'info', ... u'raw': u'{...}', ... u'timestamp': u'2018-04-09T09:59:24.733945Z', ... u'type': u'metric'} >>> tags, fields = idbf._tag_and_field_maker(log) >>> from pprint import pprint >>> pprint(tags) {u'data.msg': u'this is a dummy log', u'error_tb': u'', u'file': u'/var/log/sample.log', u'formatter': u'logagg.formatters.basescript', u'host': u'deepcompute', u'level': u'info'} >>> pprint(fields) {u'data._': \"{u'ln': 8, u'fn': u'start', u'file': u'log.py', u'name': u'__main__'}\", u'data.a': 1, u'data.b': 2}", "label": 1, "domain": "code", "token_count": 417, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0339", "text": "Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

    In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.

    The implementor must ensure that sgn(compare(x, y)) == -sgn(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

    The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

    Finally, the implementor must ensure that compare(x, y)== 0 implies that sgn(compare(x, z))== sgn(compare(y, z)) for all z.

    It is generally the case, but not strictly required that (compare(x, y)== 0) == (x.equals(y)). Generally speaking, any comparator that violates this condition should clearly indicate this fact. The recommended language is \"Note: this comparator imposes orderings that are inconsistent with equals.\" @param arg0 the first object to be compared. @param arg1 the second object to be compared. @return a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. @throws ClassCastException if the arguments' types prevent them from being compared by this comparator.", "label": 1, "domain": "code", "token_count": 466, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0340", "text": "Replies if the specified box intersects the specified sphere. @param sphereCenterx x coordinate of the sphere center. @param sphereCentery y coordinate of the sphere center. @param sphereCenterz z coordinate of the sphere center. @param sphereRadius is the radius of the sphere. @param boxCenterx x coordinate of the center point of the oriented box. @param boxCentery y coordinate of the center point of the oriented box. @param boxCenterz z coordinate of the center point of the oriented box. @param boxAxis1x x coordinate of the first axis of the oriented box axis. @param boxAxis1y y coordinate of the first axis of the oriented box axis. @param boxAxis1z z coordinate of the first axis of the oriented box axis. @param boxAxis2x x coordinate of the second axis of the oriented box axis. @param boxAxis2y y coordinate of the second axis of the oriented box axis. @param boxAxis2z z coordinate of the second axis of the oriented box axis. @param boxAxis3x x coordinate of the third axis of the oriented box axis. @param boxAxis3y y coordinate of the third axis of the oriented box axis. @param boxAxis3z z coordinate of the third axis of the oriented box axis. @param boxExtentAxis1 extent of the first axis of the oriented box. @param boxExtentAxis2 extent of the second axis of the oriented box. @param boxExtentAxis3 extent of the third axis of the oriented box. @return true if intersecting, otherwise false", "label": 1, "domain": "code", "token_count": 335, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0341", "text": "Creates sphere buffers. The created sphere has position, normal, and texcoord data @param {WebGLRenderingContext} gl The WebGLRenderingContext. @param {number} radius radius of the sphere. @param {number} subdivisionsAxis number of steps around the sphere. @param {number} subdivisionsHeight number of vertically on the sphere. @param {number} [opt_startLatitudeInRadians] where to start the top of the sphere. Default = 0. @param {number} [opt_endLatitudeInRadians] Where to end the bottom of the sphere. Default = Math.PI. @param {number} [opt_startLongitudeInRadians] where to start wrapping the sphere. Default = 0. @param {number} [opt_endLongitudeInRadians] where to end wrapping the sphere. Default = 2 * Math.PI. @return {Object.} The created sphere buffers. @memberOf module:twgl/primitives @function createSphereBuffers Creates sphere vertices. The created sphere has position, normal, and texcoord data @param {number} radius radius of the sphere. @param {number} subdivisionsAxis number of steps around the sphere. @param {number} subdivisionsHeight number of vertically on the sphere. @param {number} [opt_startLatitudeInRadians] where to start the top of the sphere. Default = 0. @param {number} [opt_endLatitudeInRadians] Where to end the bottom of the sphere. Default = Math.PI. @param {number} [opt_startLongitudeInRadians] where to start wrapping the sphere. Default = 0. @param {number} [opt_endLongitudeInRadians] where to end wrapping the sphere. Default = 2 * Math.PI. @return {Object.} The created sphere vertices. @memberOf module:twgl/primitives", "label": 1, "domain": "code", "token_count": 379, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0342", "text": "@example Request syntax with placeholder values group = iam.create_group({ path: \"pathType\", group_name: \"groupNameType\", # required }) @param [Hash] options ({}) @option options [String] :path The path to the group. For more information about paths, see [IAM Identifiers][1] in the *IAM User Guide*. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its [regex pattern][2]) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\\\\u0021) through the DEL character (\\\\u007F), including most punctuation characters, digits, and upper and lowercased letters. [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html [2]: http://wikipedia.org/wiki/regex @option options [required, String] :group_name The name of the group to create. Do not include the path in this value. This parameter allows (through its [regex pattern][1]) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: \\_+=,.@-. The group name must be unique within the account. Group names are not distinguished by case. For example, you cannot create groups named both \"ADMINS\" and \"admins\". [1]: http://wikipedia.org/wiki/regex @return [Group]", "label": 1, "domain": "code", "token_count": 322, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0343", "text": "Create a JSON in resources directory with given name, so for using it you've to reference it as: $(pwd)/target/test-classes/fileName @param fileName name of the JSON file to be created @param baseData path to file containing the schema to be used @param type element to read from file (element should contain a json) @param modifications DataTable containing the modifications to be done to the base schema element

    - Syntax will be: {@code | | | | } for DELETE/ADD/UPDATE/APPEND/PREPEND where: key path: path to the key to be modified type of modification: DELETE/ADD/UPDATE/APPEND/PREPEND new value: new value to be used

    - Or: {@code | | | | | } for REPLACE where: key path: path to the key to be modified type of modification: REPLACE new value: new value to be used json value type: type of the json property (array|object|number|boolean|null|n/a (for string))

    For example:

    (1) If the element read is {\"key1\": \"value1\", \"key2\": {\"key3\": \"value3\"}} and we want to modify the value in \"key3\" with \"new value3\" the modification will be: | key2.key3 | UPDATE | \"new value3\" | being the result of the modification: {\"key1\": \"value1\", \"key2\": {\"key3\": \"new value3\"}}

    (2) If the element read is {\"key1\": \"value1\", \"key2\": {\"key3\": \"value3\"}} and we want to replace the value in \"key2\" with {\"key4\": \"value4\"} the modification will be: | key2 | REPLACE | {\"key4\": \"value4\"} | object | being the result of the modification: {\"key1\": \"value1\", \"key2\": {\"key4\": \"value4\"}} @throws Exception", "label": 1, "domain": "code", "token_count": 452, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0344", "text": "Query a route. route(locations): points can be - a sequence of locations - a Shapely LineString route(origin, destination, waypoints=None) - origin and destination are a single destination - waypoints are the points to be inserted between the origin and destination If waypoints is specified, destination must also be specified Each location can be: - string (will be geocoded by the routing provider. Not all providers accept this as input) - (longitude, latitude) sequence (tuple, list, numpy array, etc.) - Shapely Point with x as longitude, y as latitude Additional parameters --------------------- raw : bool, default False Return the raw json dict response from the service Returns ------- list of Route objects If raw is True, returns the json dict instead of converting to Route objects Examples -------- mq = directions.Mapquest(key) routes = mq.route('1 magazine st. cambridge, ma', 'south station boston, ma') routes = mq.route('1 magazine st. cambridge, ma', 'south station boston, ma', waypoints=['700 commonwealth ave. boston, ma']) # Uses each point in the line as a waypoint. There is a limit to the # number of waypoints for each service. Consult the docs. line = LineString(...) routes = mq.route(line) # Feel free to mix different location types routes = mq.route(line.coords[0], 'south station boston, ma', waypoints=[(-71.103972, 42.349324)])", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0345", "text": "/*[deutsch]

    Legt einen Lieferanten für einen Standard-Ersatzwert des angegebenen Elements fest, wenn die Interpretation sonst nicht funktioniert.

    Beispiel:

     ChronoFormatter<PlainTimestamp> fmt = ChronoFormatter.ofTimestampPattern("HH:mm", PatternType.CLDR, Locale.ROOT) .withDefaultSupplier(PlainDate.COMPONENT, () -> SystemClock.inLocalView().today()); PlainTimestamp tsp = fmt.parse(\"14:45\"); System.out.println(tsp); // 2012-05-21T14:45 (example for parsed time on today) 

    Standard-Ersatzwerte werden von Time4J herangezogen, wenn entweder der Formatierer das fragliche Element nicht enthält oder wenn es keine konsumierbaren Zeichen für das angegebene Element gibt. Die letzte Situation erfordert manchmal die Verwendung des sektionalen Attributs {@code PROTECTED_CHARACTERS}, um eine Situation zu simulieren, in der der Formatierer quasi am Ende eines Texts angekommen ist.

    @param generic element value type @param element chronological element to be updated @param supplier supplier for replacement value or {@code null} if the default value shall be deregistered @return changed copy with new replacement value @throws IllegalArgumentException if given element is not supported by the underlying chronology @see Attributes#PROTECTED_CHARACTERS @since 4.14", "label": 1, "domain": "code", "token_count": 338, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0346", "text": "If FormModel has a \"url\" property defined, it will invoke a save on the form model, and after successfully saving, will perform a push. If no \"url\" property is defined then the following behavior is used: Pushes the form model values to the object models it is tracking and invokes save on each one. Returns a promise. NOTE: if no url is specified and no models are being tracked, it will instead trigger a 'save-fail' event and reject the returned promise with a payload that mimics a server response: {none: { success: false, response: [{ responseJSON: { generalReasons: [{messageKey: 'no.models.were.bound.to.form'}] }}] }} @param [options] {Object} @param [options.rollback=true] {Boolean} if true, when any object model fails to save, it will revert the object model attributes to the state they were before calling save. NOTE: if there are updates that happen to object models within the timing of this save method, the updates could be lost. @param [options.force=true] {Boolean} if false, the form model will check to see if an update has been made to any object models it is tracking since it's last pull. If any stale data is found, save with throw an exception with attributes: {name: 'Stale data', staleModels: [Array of model cid's]} @return when using a \"url\", a promise is returned for the save on this form model. If not using a \"url\", a promise that will either resolve when all the models have successfully saved in which case the context returned is an array of the responses (order determined by first the array of models and then the array of models used by the computed values, normalized), or if any of the saves fail, the promise will be rejected with an array of responses. Note: the size of the failure array will always be one - the first model that failed. This is a side-effect of $.when @method save", "label": 1, "domain": "code", "token_count": 413, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0347", "text": "The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

    CallBack Schemas

    Review Completion CallBack Sample

    {
    \"ReviewId\": \"\",
    \"ModifiedOn\": \"2016-10-11T22:36:32.9934851Z\",
    \"ModifiedBy\": \"\",
    \"CallBackType\": \"Review\",
    \"ContentId\": \"\",
    \"Metadata\": {
    \"adultscore\": \"0.xxx\",
    \"a\": \"False\",
    \"racyscore\": \"0.xxx\",
    \"r\": \"True\"
    },
    \"ReviewerResultTags\": {
    \"a\": \"False\",
    \"r\": \"True\"
    }
    }

    . @param url_content_type [String] The content type. @param team_name [String] Your team name. @param create_review_body [Array] Body for create reviews API @param sub_team [String] SubTeam of your team, you want to assign the created review to. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 340, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0348", "text": "Adds +message+ to the error messages and used validator type to +details+ on +attribute+. More than one error can be added to the same +attribute+. If no +message+ is supplied, :invalid is assumed. person.errors.add(:name) # => [\"is invalid\"] person.errors.add(:name, :not_implemented, message: \"must be implemented\") # => [\"is invalid\", \"must be implemented\"] person.errors.messages # => {:name=>[\"is invalid\", \"must be implemented\"]} person.errors.details # => {:name=>[{error: :not_implemented}, {error: :invalid}]} If +message+ is a symbol, it will be translated using the appropriate scope (see +generate_message+). If +message+ is a proc, it will be called, allowing for things like Time.now to be used within an error. If the :strict option is set to +true+, it will raise ActiveModel::StrictValidationFailed instead of adding the error. :strict option can also be set to any other exception. person.errors.add(:name, :invalid, strict: true) # => ActiveModel::StrictValidationFailed: Name is invalid person.errors.add(:name, :invalid, strict: NameIsInvalid) # => NameIsInvalid: Name is invalid person.errors.messages # => {} +attribute+ should be set to :base if the error is not directly associated with a single attribute. person.errors.add(:base, :name_or_email_blank, message: \"either name or email must be present\") person.errors.messages # => {:base=>[\"either name or email must be present\"]} person.errors.details # => {:base=>[{error: :name_or_email_blank}]}", "label": 1, "domain": "code", "token_count": 374, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0349", "text": "Returns a cached view or component, for a given name. If it does not exist yet, it will create the view or component with the provided options. If you provide a \"id\" in the \"oOptions\", it will be prefixed with the id of the component. @param {object} oOptions see {@link sap.ui.core.mvc.View.create} or {@link sap.ui.core.Component.create} for the documentation. @param {string} oOptions.name If you do not use setView please see {@link sap.ui.core.mvc.View.create} or {@link sap.ui.core.Component.create} for the documentation. This is used as a key in the cache of the view or component instance. If you want to retrieve a view or a component that has been given an alternative name in {@link #set}, you need to provide the same name here and you can skip all the other options. @param {string} [oOptions.id] The id you pass into the options will be prefixed with the id of the component you pass into the constructor. So you can retrieve the view later by calling the {@link sap.ui.core.UIComponent#byId} function of the UIComponent. @param {string} sType whether the object is a \"View\" or \"Component\". Views and components are stored separately in the cache. This means that a view and a component instance could be stored under the same name. @return {Promise} A promise that is resolved when the view or component is loaded. The view or component instance will be passed to the resolve function. @private", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0350", "text": "Forms closed loop integration along mag field, satrting at input points and goes through footpoint. At footpoint, steps along vector direction in both positive and negative directions, then traces back to opposite footpoint. Back at input location, steps toward those new field lines (edge_length) along vector direction until hitting distance of minimum approach. Loops don't always close. Returns total edge distance that goes through input location, along with the distances of closest approach. Note ---- vector direction refers to the magnetic unit vector direction Parameters ---------- glats : list-like of floats (degrees) Geodetic (WGS84) latitude glons : list-like of floats (degrees) Geodetic (WGS84) longitude alts : list-like of floats (km) Geodetic (WGS84) altitude, height above surface dates : list-like of datetimes Date and time for determination of scalars direction : string 'north' or 'south' for tracing through northern or southern footpoint locations vector_direction : string 'meridional' or 'zonal' unit vector directions step_size : float (km) Step size (km) used for field line integration max_steps : int Number of steps taken for field line integration edge_length : float (km) Half of total edge length (step) taken at footpoint location. edge_length step in both positive and negative directions. edge_steps : int Number of steps taken from footpoint towards new field line in a given direction (positive/negative) along unit vector Returns ------- np.array, np.array, np.array A closed loop field line path through input location and footpoint in northern/southern hemisphere and back is taken. The return edge length through input location is provided. The distances of closest approach for the positive step along vector direction, and the negative step are returned.", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0351", "text": "Configure Redwood (from scratch) based on a Properties file. Currently recognized properties are:
    • log.toStderr = {true,false}: Print to stderr rather than stdout
    • log.file = [filename]: Dump the output of the log to the given filename
    • log.collapse = {exact,approximate,none}: Collapse repeated records (based on either exact or approximate equality)
    • log.neatExit = {true,false}: Clean up logs on exception or regular system exit
    • log.{console,file}.colorChannels = {true,false}: If true, randomly assign colors to different channels
    • log.{console,file}.{track,[channel]}]Color = {NONE,BLACK,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE}: Color for printing tracks (e.g. log.file.trackColor = BLUE)
    • log.{console,file}.{track,[channel]}Style = {NONE,BOLD,DIM,ITALIC,UNDERLINE,BLINK,CROSS_OUT}: Style for printing tracks (e.g. log.console.errStyle = BOLD)
    • log.captureStreams = {true,false}: Capture stdout and stderr and route them through Redwood
    • log.captureStdout = {true,false}: Capture stdout and route it through Redwood
    • log.captureStderr = {true,false}: Capture stdout and route it through Redwood
    • log.hideChannels = [channels]: Hide these channels (comma-separated list)
    • log.showOnlyChannels = [channels]: Show only these channels (comma-separated list)
    @param props The properties to use in configuration @return A new Redwood Configuration based on the passed properties, ignoring any existing custom configuration", "label": 1, "domain": "code", "token_count": 384, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0352", "text": "Renders the template and returns an HttpRequest object containing its content. This method returns a django.http.Http404 exception if the template is not found. If the template raises a django_mako_plus.RedirectException, the browser is redirected to the given page, and a new request from the browser restarts the entire DMP routing process. If the template raises a django_mako_plus.InternalRedirectException, the entire DMP routing process is restarted internally (the browser doesn't see the redirect). @request The request context from Django. If this is None, any TEMPLATE_CONTEXT_PROCESSORS defined in your settings file will be ignored but the template will otherwise render fine. @template The template file path to render. This is relative to the app_path/controller_TEMPLATES_DIR/ directory. For example, to render app_path/templates/page1, set template=\"page1.html\", assuming you have set up the variables as described in the documentation above. @context A dictionary of name=value variables to send to the template page. This can be a real dictionary or a Django Context object. @def_name Limits output to a specific top-level Mako <%block> or <%def> section within the template. For example, def_name=\"foo\" will call <%block name=\"foo\"> or <%def name=\"foo()\"> within the template. @content_type The MIME type of the response. Defaults to settings.DEFAULT_CONTENT_TYPE (usually 'text/html'). @status The HTTP response status code. Defaults to 200 (OK). @charset The charset to encode the processed template string (the output) with. Defaults to settings.DEFAULT_CHARSET (usually 'utf-8'). The method triggers two signals: 1. dmp_signal_pre_render_template: you can (optionally) return a new Mako Template object from a receiver to replace the normal template object that is used for the render operation. 2. dmp_signal_post_render_template: you can (optionally) return a string to replace the string from the normal template object render.", "label": 1, "domain": "code", "token_count": 412, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0353", "text": "Lists the usage details by enrollmentAccountId for a scope by current billing period. Usage details are available via this API only for May 1, 2014 or later. @param enrollment_account_id [String] EnrollmentAccount ID @param expand [String] May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. @param filter [String] May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName, properties/instanceId or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the most recent N usageDetails. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0354", "text": "Gets the information about all services belonging to the application specified by the application id. Returns the information about all services belonging to the application specified by the application id. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_type_name [String] The service type name used to filter the services to query for. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 329, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0355", "text": "Detect spillover locations for diffusion in LISA Markov. Parameters ---------- quadrant : int which quadrant in the scatterplot should form the core of a cluster. neighbors_on : binary If false, then only the 1st order neighbors of a core location are included in the cluster. If true, neighbors of cluster core 1st order neighbors are included in the cluster. Returns ------- results : dictionary two keys - values pairs: 'components' - array (n, t) values are integer ids (starting at 1) indicating which component/cluster observation i in period t belonged to. 'spillover' - array (n, t-1) binary values indicating if the location was a spill-over location that became a new member of a previously existing cluster. Examples -------- >>> import libpysal >>> from giddy.markov import LISA_Markov >>> f = libpysal.io.open(libpysal.examples.get_path(\"usjoin.csv\")) >>> years = list(range(1929, 2010)) >>> pci = np.array([f.by_col[str(y)] for y in years]).transpose() >>> w = libpysal.io.open(libpysal.examples.get_path(\"states48.gal\")).read() >>> np.random.seed(10) >>> lm_random = LISA_Markov(pci, w, permutations=99) >>> r = lm_random.spillover() >>> (r['components'][:, 12] > 0).sum() 17 >>> (r['components'][:, 13]>0).sum() 23 >>> (r['spill_over'][:,12]>0).sum() 6 Including neighbors of core neighbors >>> rn = lm_random.spillover(neighbors_on=True) >>> (rn['components'][:, 12] > 0).sum() 26 >>> (rn[\"components\"][:, 13] > 0).sum() 34 >>> (rn[\"spill_over\"][:, 12] > 0).sum() 8", "label": 1, "domain": "code", "token_count": 411, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0356", "text": "Sets attributes and binds buffers (deprecated... use {@link module:webgl-utils.setBuffersAndAttributes}) Example: var program = createProgramFromScripts( gl, [\"some-vs\", \"some-fs\"); var attribSetters = createAttributeSetters(program); var positionBuffer = gl.createBuffer(); var texcoordBuffer = gl.createBuffer(); var attribs = { a_position: {buffer: positionBuffer, numComponents: 3}, a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, }; gl.useProgram(program); This will automatically bind the buffers AND set the attributes. setAttributes(attribSetters, attribs); Properties of attribs. For each attrib you can add properties: * type: the type of data in the buffer. Default = gl.FLOAT * normalize: whether or not to normalize the data. Default = false * stride: the stride. Default = 0 * offset: offset into the buffer. Default = 0 For example if you had 3 value float positions, 2 value float texcoord and 4 value uint8 colors you'd setup your attribs like this var attribs = { a_position: {buffer: positionBuffer, numComponents: 3}, a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, a_color: { buffer: colorBuffer, numComponents: 4, type: gl.UNSIGNED_BYTE, normalize: true, }, }; @param {Object.|model:webgl-utils.ProgramInfo} setters Attribute setters as returned from createAttributeSetters or a ProgramInfo as returned {@link module:webgl-utils.createProgramInfo} @param {Object.} attribs AttribInfos mapped by attribute name. @memberOf module:webgl-utils @deprecated use {@link module:webgl-utils.setBuffersAndAttributes}", "label": 1, "domain": "code", "token_count": 388, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0357", "text": "Lists report records by API Operations. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param filter [String] | Field | Usage | Supported operators | Supported functions |
    |-------------|-------------|-------------|-------------|
    | timestamp | filter | ge, le | |
    | displayName | select, orderBy | | |
    | apiRegion | filter | eq | |
    | userId | filter | eq | |
    | productId | filter | eq | |
    | subscriptionId | filter | eq | |
    | apiId | filter | eq | |
    | operationId | select, filter | eq | |
    | callCountSuccess | select, orderBy | | |
    | callCountBlocked | select, orderBy | | |
    | callCountFailed | select, orderBy | | |
    | callCountOther | select, orderBy | | |
    | callCountTotal | select, orderBy | | |
    | bandwidth | select, orderBy | | |
    | cacheHitsCount | select | | |
    | cacheMissCount | select | | |
    | apiTimeAvg | select, orderBy | | |
    | apiTimeMin | select | | |
    | apiTimeMax | select | | |
    | serviceTimeAvg | select | | |
    | serviceTimeMin | select | | |
    | serviceTimeMax | select | | |
    @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param orderby [String] OData order by query option. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 400, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0358", "text": "

    Perform an XML 1.0 level 1 (only markup-significant chars) escape operation on a String input meant to be an XML attribute value.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml10(String, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null. @since 1.1.5", "label": 1, "domain": "code", "token_count": 413, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0359", "text": "

    Perform an HTML5 level 1 (XML-style) escape operation on a Reader input, writing results to a Writer.

    Level 1 means this method will only escape the five markup-significant characters: <, >, &, " and '. It is called XML-style in order to link it with JSP's escapeXml attribute in JSTL's <c:out ... /> tags.

    Note this method may not produce the same results as {@link #escapeHtml4Xml(Reader, Writer)} because it will escape the apostrophe as &apos;, whereas in HTML 4 such NCR does not exist (the decimal numeric reference &#39; is used instead).

    This method calls {@link #escapeHtml(Reader, Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 439, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0360", "text": "A |Elements| collection of all \"supplying\" basins. (All river basins are assumed to supply something to the downstream basin.) >>> from hydpy import RiverBasinNumbers2Selection >>> rbns2s = RiverBasinNumbers2Selection( ... (111, 113, 1129, 11269, 1125, 11261, ... 11262, 1123, 1124, 1122, 1121)) The following elements are properly connected to the required outlet nodes already: >>> for element in rbns2s.supplier_elements: ... print(repr(element)) Element(\"land_111\", outlets=\"node_113\") Element(\"land_1121\", outlets=\"node_1123\") Element(\"land_1122\", outlets=\"node_1123\") Element(\"land_1123\", outlets=\"node_1125\") Element(\"land_1124\", outlets=\"node_1125\") Element(\"land_1125\", outlets=\"node_1129\") Element(\"land_11261\", outlets=\"node_11269\") Element(\"land_11262\", outlets=\"node_11269\") Element(\"land_11269\", outlets=\"node_1129\") Element(\"land_1129\", outlets=\"node_113\") Element(\"land_113\", outlets=\"node_outlet\") It is both possible to change the prefix names of the elements and nodes, as long as it results in a valid variable name (e.g. does not start with a number): >>> rbns2s.supplier_prefix = 'a_' >>> rbns2s.node_prefix = 'b_' >>> rbns2s.supplier_elements Elements(\"a_111\", \"a_1121\", \"a_1122\", \"a_1123\", \"a_1124\", \"a_1125\", \"a_11261\", \"a_11262\", \"a_11269\", \"a_1129\", \"a_113\")", "label": 1, "domain": "code", "token_count": 410, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0361", "text": "Replaces special characters in a string so that it may be used as part of a 'pretty' URL. parameterize(\"Donald E. Knuth\") # => \"donald-e-knuth\" parameterize(\"^très|Jolie-- \") # => \"tres-jolie\" To use a custom separator, override the +separator+ argument. parameterize(\"Donald E. Knuth\", separator: '_') # => \"donald_e_knuth\" parameterize(\"^très|Jolie__ \", separator: '_') # => \"tres_jolie\" To preserve the case of the characters in a string, use the +preserve_case+ argument. parameterize(\"Donald E. Knuth\", preserve_case: true) # => \"Donald-E-Knuth\" parameterize(\"^très|Jolie-- \", preserve_case: true) # => \"tres-Jolie\" It preserves dashes and underscores unless they are used as separators: parameterize(\"^très|Jolie__ \") # => \"tres-jolie__\" parameterize(\"^très|Jolie-- \", separator: \"_\") # => \"tres_jolie--\" parameterize(\"^très_Jolie-- \", separator: \".\") # => \"tres_jolie--\" If the optional parameter +locale+ is specified, the word will be parameterized as a word of that language. By default, this parameter is set to nil and it will use the configured I18n.locale.", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0362", "text": "/* tslint:enable:max-line-length Creates an output Observable which sequentially emits all values from every given input Observable after the current Observable. Concatenates multiple Observables together by sequentially emitting their values, one Observable after the other. Joins this Observable with multiple other Observables by subscribing to them one at a time, starting with the source, and merging their results into the output Observable. Will wait for each Observable to complete before moving on to the next. @example
    var timer = Rx.Observable.interval(1000).take(4); var sequence = Rx.Observable.range(1, 10); var result = timer.concat(sequence); result.subscribe(x => console.log(x)); // results in: // 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10 @example var timer1 = Rx.Observable.interval(1000).take(10); var timer2 = Rx.Observable.interval(2000).take(6); var timer3 = Rx.Observable.interval(500).take(10); var result = timer1.concat(timer2, timer3); result.subscribe(x => console.log(x)); // results in the following: // (Prints to console sequentially) // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9 // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5 // -500ms-> 0 -500ms-> 1 -500ms-> ... 9 @see {@link concatAll} @see {@link concatMap} @see {@link concatMapTo} @param {ObservableInput} other An input Observable to concatenate after the source Observable. More than one input Observables may be given as argument. @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each Observable subscription on. @return {Observable} All values of each passed Observable merged into a single Observable, in order, in serial fashion. @method concat @owner Observable", "label": 1, "domain": "code", "token_count": 484, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0363", "text": "Method for initialization @param {Object} options the configuration options for the instance @param {Object} options.target - the target iframe or iframe configuration @param {String} [options.target.url] - the url to load @param {Object} [options.target.container] - the container in which the iframe should be created (if not supplied, document.body will be used) @param {String} [options.target.style] - the CSS style to apply @param {String} [options.target.style.width] width of iframe @param {String} [options.target.style.height] height of iframe ..... @param {Boolean} [options.target.bust = true] - optional flag to indicate usage of cache buster when loading the iframe (default to true) @param {Function} [options.target.callback] - a callback to invoke after the iframe had been loaded, @param {Object} [options.target.context] - optional context for the callback @param {Function|Object} [options.onready] - optional data for usage when iframe had been loaded { @param {Function} [options.onready.callback] - a callback to invoke after the iframe had been loaded @param {Object} [options.onready.context] - optional context for the callback @param {Boolean} [options.removeDispose] - optional flag for removal of the iframe on dispose @param {Function} [options.serialize = JSON.stringify] - optional serialization method for post message @param {Function} [options.deserialize = JSON.parse] - optional deserialization method for post message @param {String} [options.targetOrigin] optional targetOrigin to be used when posting the message (must be supplied in case of external iframe) @param {Number} [options.maxConcurrency = 100] - optional maximum concurrency that can be managed by the component before dropping @param {Number} [options.handshakeInterval = 5000] - optional handshake interval for retries @param {Number} [options.handshakeAttempts = 3] - optional number of retries handshake attempts @param {String} [options.hostParam] - optional parameter of the host parameter name (default is lpHost) @param {Function} onmessage - the handler for incoming messages", "label": 1, "domain": "code", "token_count": 446, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0364", "text": "

    Perform an XML 1.0 level 2 (markup-significant and all non-ASCII chars) escape operation on a char[] input.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    This method calls {@link #escapeXml10(char[], int, int, java.io.Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 450, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0365", "text": "Gets the list of backup entities that are associated with this policy. Returns a list of Service Fabric application, service or partition which are associated with this backup policy. @param backup_policy_name [String] The name of the backup policy. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0366", "text": "Write the header of the DBF file on the main stream.

     ----------------------------------------------------------- DBF Header (32 bytes) ----------------------------------------------------------- Bytes Size Content ----------------------------------------------------------- 0 1 byte DBF Format id 0x03: FoxBase+, FoxPro, dBASEIII+ dBASEIV, no memo 0x83: FoxBase+, dBASEIII+ with memo 0xF5: FoxPro with memo 0x8B: dBASEIV with memo 0x8E: dBASEIV with SQL table 1-3 3 bytes Date of last update: YMD 4-7 4 bytes Number of records in the table 8-9 2 bytes Number of bytes in the header 10-11 2 bytes Number of bytes in the record 12-13 2 bytes Reserved 14 1 byte Incomplete transaction 0x00: Ignored / Transaction End 0x01: Transaction started 15 1 byte Encryption flag 0x00: Not encrypted 0x01: Encrypted 16-19 4 bytes Free record thread (reserved for LAN only) 20-27 8 bytes Reserved for multi-user dBASE (dBASE III+) 28 1 byte MDX flag (dBASE IV) 0x00: index upon demand 0x01: production index exists 29 1 byte Language driver ID See {@link DBaseCodePage} for details. 30-31 2 bytes Reserved ---------------------------------------------------------- 
    @param recordCount is the count of record which will be written. @param language is the language of the file. @throws IOException in case of errors.", "label": 1, "domain": "code", "token_count": 349, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0367", "text": "Gets the information about the specific service belonging to the Service Fabric application. Returns the information about the specified service belonging to the specified Service Fabric application. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ServiceInfo] operation results.", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0368", "text": " Return a dictionary conformant to 'securesystemslib.formats.KEY_SCHEMA'. If 'private' is True, include the private key. The dictionary returned has the form: {'keytype': keytype, 'scheme' : scheme, 'keyval': {'public': '...', 'private': '...'}} or if 'private' is False: {'keytype': keytype, 'scheme': scheme, 'keyval': {'public': '...', 'private': ''}} >>> ed25519_key = generate_ed25519_key() >>> key_val = ed25519_key['keyval'] >>> keytype = ed25519_key['keytype'] >>> scheme = ed25519_key['scheme'] >>> ed25519_metadata = \\ format_keyval_to_metadata(keytype, scheme, key_val, private=True) >>> securesystemslib.formats.KEY_SCHEMA.matches(ed25519_metadata) True key_type: The 'rsa' or 'ed25519' strings. scheme: The signature scheme used by the key. key_value: A dictionary containing a private and public keys. 'key_value' is of the form: {'public': '...', 'private': '...'}}, conformant to 'securesystemslib.formats.KEYVAL_SCHEMA'. private: Indicates if the private key should be included in the dictionary returned. securesystemslib.exceptions.FormatError, if 'key_value' does not conform to 'securesystemslib.formats.KEYVAL_SCHEMA', or if the private key is not present in 'key_value' if requested by the caller via 'private'. None. A 'securesystemslib.formats.KEY_SCHEMA' dictionary.", "label": 1, "domain": "code", "token_count": 350, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0369", "text": "Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. @param resource_group_name [String] The name of the Azure resource group that contains the Data Lake Analytics account. @param account_name [String] The name of the Data Lake Analytics account for which to list Azure Storage accounts. @param filter [String] The OData filter. Optional. @param top [Integer] The number of items to return. Optional. @param skip [Integer] The number of items to skip over before returning elements. Optional. @param expand [String] OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. @param select [String] OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. @param orderby [String] OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. @param count [Boolean] The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. @param search [String] A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. @param format [String] The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 416, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0370", "text": "Get a Ipv4 or Ipv6 by IP :param ip: IPv4 or Ipv6. 'xxx.xxx.xxx.xxx or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx' :return: Dictionary with the following structure: :: {'ips': [{'oct4': < oct4 >, 'oct2': < oct2 >, 'oct3': < oct3 >, 'oct1': < oct1 >, 'version': < version >, 'networkipv4': < networkipv4 >, 'id': < id >, 'descricao': < descricao >}, ... ] }. or {'ips': [ {'block1': < block1 >, 'block2': < block2 >, 'block3': < block3 >, 'block4': < block4 >, 'block5': < block5 >, 'block6': < block6 >, 'block7': < block7 >, 'block8': < block8 >, 'version': < version >, 'networkipv6': < networkipv6 >, 'id': < id >, 'descricao': < descricao >}, ... ] }. :raise IpNaoExisteError: Ipv4 or Ipv6 not found. :raise UserNotAuthorizedError: User dont have permission to perform operation. :raise InvalidParameterError: Ip string is none or invalid. :raise XMLError: Networkapi failed to generate the XML response. :raise DataBaseError: Networkapi failed to access the database.", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0371", "text": "Get agent groups. Get agent groups from Configuration Server with the specified filters. @param groupType the agent group type. (optional) @param limit The number of objects the Provisioning API should return. (optional) @param offset The number of matches the Provisioning API should skip in the returned objects. (optional) @param searchTerm The term that you want to search for in the object keys. The Provisioning API searches for the this term in the value of the key you specify in 'search_key'. (optional) @param searchKey The key you want the Provisioning API to use when searching for the term you specified in 'search_term'. You can find valid key names in the Platform SDK documentation for [CfgDN](https://docs.genesys.com/Documentation/PSDK/9.0.x/ConfigLayerRef/CfgDN) and [CfgAgentGroup](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgAgentGroup). (optional) @param matchMethod The method the Provisioning API should use to match the 'search_term'. Possible values are includes, startsWith, endsWith, and isEqual. (optional, default to includes) @param sortKey A key in [CfgDN](https://docs.genesys.com/Documentation/PSDK/9.0.x/ConfigLayerRef/CfgDN), [CfgSkill](https://docs.genesys.com/Documentation/PSDK/9.0.x/ConfigLayerRef/CfgSkill) or [CfgAgentGroup](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgAgentGroup) to sort the search results. (optional) @param sortAscending Specifies whether to sort the search results in ascending or descending order. (optional, default to true) @param sortMethod Specifies the sort method. Possible values are caseSensitive, caseInsensitive or numeric. (optional, default to caseSensitive) @return Results object which includes list of AgentGroups and the total count. @throws ProvisioningApiException if the call is unsuccessful.", "label": 1, "domain": "code", "token_count": 437, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0372", "text": "Search for Spots within a give SW|NE bounds with query @return [Array] @param [Hash] bounds @param [String] api_key the provided api key @param [Hash] options @option bounds [String, Array] :start_point An array that contains the lat/lng pair for the first point in the bounds (rectangle) @option bounds [:start_point][String, Integer] :lat The starting point coordinates latitude value @option bounds [:start_point][String, Integer] :lng The starting point coordinates longitude value @option bounds [String, Array] :end_point An array that contains the lat/lng pair for the end point in the bounds (rectangle) @option bounds [:end_point][String, Integer] :lat The end point coordinates latitude value @option bounds [:end_point][String, Integer] :lng The end point coordinates longitude value @option options [String,Array] :query Restricts the results to Spots matching term(s) in the specified query @option options [String] :language The language code, indicating in which language the results should be returned, if possible. @option options [String,Array] :exclude ([]) A String or an Array of types to exclude from results @option options [Hash] :retry_options ({}) A Hash containing parameters for search retries @option options [Object] :retry_options[:status] ([]) @option options [Integer] :retry_options[:max] (0) the maximum retries @option options [Integer] :retry_options[:delay] (5) the delay between each retry in seconds @option options [Boolean] :detail A boolean to return spots with full detail information(its complete address, phone number, user rating, reviews, etc) Note) This makes an extra call for each spot for more information. @see https://developers.google.com/maps/documentation/places/supported_types List of supported types", "label": 1, "domain": "code", "token_count": 395, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0373", "text": "A |Elements| collection of all \"routing\" basins. (Only river basins with a upstream basin are assumed to route something to the downstream basin.) >>> from hydpy import RiverBasinNumbers2Selection >>> rbns2s = RiverBasinNumbers2Selection( ... (111, 113, 1129, 11269, 1125, 11261, ... 11262, 1123, 1124, 1122, 1121)) The following elements are properly connected to the required inlet and outlet nodes already: >>> for element in rbns2s.router_elements: ... print(repr(element)) Element(\"stream_1123\", inlets=\"node_1123\", outlets=\"node_1125\") Element(\"stream_1125\", inlets=\"node_1125\", outlets=\"node_1129\") Element(\"stream_11269\", inlets=\"node_11269\", outlets=\"node_1129\") Element(\"stream_1129\", inlets=\"node_1129\", outlets=\"node_113\") Element(\"stream_113\", inlets=\"node_113\", outlets=\"node_outlet\") It is both possible to change the prefix names of the elements and nodes, as long as it results in a valid variable name (e.g. does not start with a number): >>> rbns2s.router_prefix = 'c_' >>> rbns2s.node_prefix = 'd_' >>> rbns2s.router_elements Elements(\"c_1123\", \"c_1125\", \"c_11269\", \"c_1129\", \"c_113\")", "label": 1, "domain": "code", "token_count": 334, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0374", "text": "목록 조회 args CorpNum : 팝빌회원 사업자번호 MgtKeyType : 세금계산서유형, SELL-매출, BUY-매입, TRUSTEE-위수탁 DType : 일자유형, R-등록일시, W-작성일자, I-발행일시 중 택 1 SDate : 시작일자, 표시형식(yyyyMMdd) EDate : 종료일자, 표시형식(yyyyMMdd) State : 상태코드, 2,3번째 자리에 와일드카드(*) 사용가능 Type : 문서형태 배열, N-일반세금계산서, M-수정세금계산서 TaxType : 과세형태 배열, T-과세, N-면세, Z-영세 LateOnly : 지연발행, 공백-전체조회, 0-정상발행조회, 1-지연발행 조회 TaxRegIdYN : 종사업장번호 유무, 공백-전체조회, 0-종사업장번호 없음 1-종사업장번호 있음 TaxRegIDType : 종사업장번호 사업자유형, S-공급자, B-공급받는자, T-수탁자 TaxRegID : 종사업장번호, 콤마(,)로 구분하여 구성 ex)'0001,1234' Page : 페이지번호 PerPage : 페이지당 목록개수 Order : 정렬방향, D-내림차순, A-오름차순 UserID : 팝빌 회원아이디 QString : 거래처 정보, 거래처 상호 또는 사업자등록번호 기재, 미기재시 전체조회 InterOPYN : 연동문서 여부, 공백-전체조회, 0-일반문서 조회, 1-연동문서 조회 IssueType : 발행형태 배열, N-정발행, R-역발행, T-위수탁 return 조회목록 Object raise PopbillException", "label": 1, "domain": "code", "token_count": 438, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0375", "text": "[sourceFormat] + \"original\": This format is only used in series.data, where itemStyle can be specified in data item. + \"arrayRows\": [ ['product', 'score', 'amount'], ['Matcha Latte', 89.3, 95.8], ['Milk Tea', 92.1, 89.4], ['Cheese Cocoa', 94.4, 91.2], ['Walnut Brownie', 85.4, 76.9] ] + \"objectRows\": [ {product: 'Matcha Latte', score: 89.3, amount: 95.8}, {product: 'Milk Tea', score: 92.1, amount: 89.4}, {product: 'Cheese Cocoa', score: 94.4, amount: 91.2}, {product: 'Walnut Brownie', score: 85.4, amount: 76.9} ] + \"keyedColumns\": { 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'], 'count': [823, 235, 1042, 988], 'score': [95.8, 81.4, 91.2, 76.9] } + \"typedArray\" + \"unknown\" @constructor @param {Object} fields @param {string} fields.sourceFormat @param {Array|Object} fields.fromDataset @param {Array|Object} [fields.data] @param {string} [seriesLayoutBy='column'] @param {Array.} [dimensionsDefine] @param {Objet|HashMap} [encodeDefine] @param {number} [startIndex=0] @param {number} [dimensionsDetectCount]", "label": 1, "domain": "code", "token_count": 375, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0376", "text": "This end point allows you to post events to the stream. You can tag them, set priority and even aggregate them with other events. Aggregation in the stream is made on hostname/event_type/source_type/aggregation_key. If there's no event type, for example, then that won't matter; it will be grouped with other events that don't have an event type. @param [String] title Event title @param [String] text Event text. Supports newlines (+\\n+) @param [Hash] opts the additional data about the event @option opts [Integer, nil] :date_happened (nil) Assign a timestamp to the event. Default is now when none @option opts [String, nil] :hostname (nil) Assign a hostname to the event. @option opts [String, nil] :aggregation_key (nil) Assign an aggregation key to the event, to group it with some others @option opts [String, nil] :priority ('normal') Can be \"normal\" or \"low\" @option opts [String, nil] :source_type_name (nil) Assign a source type to the event @option opts [String, nil] :alert_type ('info') Can be \"error\", \"warning\", \"info\" or \"success\". @option opts [Array] :tags tags to be added to every metric @example Report an awful event: $statsd.event('Something terrible happened', 'The end is near if we do nothing', :alert_type=>'warning', :tags=>['end_of_times','urgent'])", "label": 1, "domain": "code", "token_count": 319, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0377", "text": "Convert Grid table to data (the kind used by Dashtable) Parameters ---------- text : str The text must be a valid rst table Returns ------- table : list of lists of str spans : list of lists of lists of int A span is a list of [row, column] pairs that define a group of combined table cells use_headers : bool Whether or not the table was using headers Notes ----- This function requires docutils_. .. _docutils: http://docutils.sourceforge.net/ Example ------- >>> text = ''' ... +------------+------------+-----------+ ... | Header 1 | Header 2 | Header 3 | ... +============+============+===========+ ... | body row 1 | column 2 | column 3 | ... +------------+------------+-----------+ ... | body row 2 | Cells may span columns.| ... +------------+------------+-----------+ ... | body row 3 | Cells may | - Cells | ... +------------+ span rows. | - contain | ... | body row 4 | | - blocks. | ... +------------+------------+-----------+ ... ''' >>> import dashtable >>> table, spans, use_headers = dashtable.grid2data(text) >>> from pprint import pprint >>> pprint(table) [['Header 1', 'Header 2', 'Header 3'], ['body row 1', 'column 2', 'column 3'], ['body row 2', 'Cells may span columns.', ''], ['body row 3', 'Cells may\\\\nspan rows.', '- Cells\\\\n- contain\\\\n- blocks.'], ['body row 4', '', '']] >>> print(spans) [[[2, 1], [2, 2]], [[3, 1], [4, 1]], [[3, 2], [4, 2]]] >>> print(use_headers) True", "label": 1, "domain": "code", "token_count": 377, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0378", "text": "Refresh the log sequence for the different AR processes. Required derived parameters: |Nmb| |AR_Order| Required flux sequence: |QPOut| Updated log sequence: |LogOut| Example: Assume there are four response functions, involving zero, one, two and three AR coefficients respectively: >>> from hydpy.models.arma import * >>> parameterstep() >>> derived.nmb(4) >>> derived.ar_order.shape = 4 >>> derived.ar_order = 0, 1, 2, 3 >>> fluxes.qpout.shape = 4 >>> logs.logout.shape = (4, 3) The \"memory values\" of the different AR processes are defined as follows (one row for each process). Note the special case of the first AR process of zero order (first row), which is why there are no autoregressive memory values required: >>> logs.logout = ((nan, nan, nan), ... (0.0, nan, nan), ... (1.0, 2.0, nan), ... (3.0, 4.0, 5.0)) These are the new outflow discharge portions to be included into the memories of the different processes: >>> fluxes.qpout = 6.0, 7.0, 8.0, 9.0 Through applying method |calc_logout_v1| all values already existing are shifted to the right (\"into the past\"). Values, which are no longer required due to the limited order or the different AR processes, are discarded. The new values are inserted in the first column: >>> model.calc_logout_v1() >>> logs.logout logout([[nan, nan, nan], [7.0, nan, nan], [8.0, 1.0, nan], [9.0, 3.0, 4.0]])", "label": 1, "domain": "code", "token_count": 379, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0379", "text": "

    Perform a Java Properties Key level 1 (only basic set) escape operation on a String input, writing results to a Writer.

    Level 1 means this method will only escape the Java Properties Key basic escape set:

    • The Single Escape Characters: \t (U+0009), \n (U+000A), \f (U+000C), \r (U+000D), (U+0020), \: (U+003A), \= (U+003D) and \\ (U+005C).
    • Two ranges of non-displayable, control characters (some of which are already part of the single escape characters list): U+0000 to U+001F and U+007F to U+009F.

    This method calls {@link #escapePropertiesKey(String, Writer, PropertiesKeyEscapeLevel)} with the following preconfigured values:

    • level: {@link PropertiesKeyEscapeLevel#LEVEL_1_BASIC_ESCAPE_SET}

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 482, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0380", "text": "**Lists the metric values for a resource**. @param resource_uri [String] The identifier of the resource. @param timespan [String] The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. @param interval [Duration] The interval (i.e. timegrain) of the query. @param metricnames [String] The names of the metrics (comma separated) to retrieve. @param aggregation [String] The list of aggregation types (comma separated) to retrieve. @param top [Integer] The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. @param orderby [String] The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum asc. @param filter [String] The **$filter** is used to reduce the set of metric data returned.
    Example:
    Metric contains metadata A, B and C.
    - Return all time series of C where A = a1 and B = b1 or b2
    **$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
    - Invalid variant:
    **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
    This is invalid because the logical or operator cannot separate two different metadata names.
    - Return all time series where A = a1, B = b1 and C = c1:
    **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
    - Return all time series where A = a1
    **$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. @param result_type [ResultType] Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. Possible values include: 'Data', 'Metadata' @param metricnamespace [String] Metric namespace to query metric definitions for. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Response] operation results.", "label": 1, "domain": "code", "token_count": 489, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0381", "text": "Log a new entry of discharge at a cross section far downstream. Required control parameter: |NmbLogEntries| Required flux sequence: |TotalRemoteDischarge| Calculated flux sequence: |LoggedTotalRemoteDischarge| Example: The following example shows that, with each new method call, the three memorized values are successively moved to the right and the respective new value is stored on the bare left position: >>> from hydpy.models.dam import * >>> parameterstep() >>> nmblogentries(3) >>> logs.loggedtotalremotedischarge = 0.0 >>> from hydpy import UnitTest >>> test = UnitTest(model, model.update_loggedtotalremotedischarge_v1, ... last_example=4, ... parseqs=(fluxes.totalremotedischarge, ... logs.loggedtotalremotedischarge)) >>> test.nexts.totalremotedischarge = [1., 3., 2., 4] >>> del test.inits.loggedtotalremotedischarge >>> test() | ex. | totalremotedischarge | loggedtotalremotedischarge | --------------------------------------------------------------------- | 1 | 1.0 | 1.0 0.0 0.0 | | 2 | 3.0 | 3.0 1.0 0.0 | | 3 | 2.0 | 2.0 3.0 1.0 | | 4 | 4.0 | 4.0 2.0 3.0 |", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0382", "text": "Download data from project members to the target directory. Unless this is a member-specific download, directories will be created for each project member ID. Also, unless a source is specified, all shared sources are downloaded and data is sorted into subdirectories according to source. Projects can optionally return data to Open Humans member accounts. If project_data is True (or the \"--project-data\" flag is used), this data (the project's own data files, instead of data from other sources) will be downloaded for each member. :param directory: This field is the target directory to download data. :param master_token: This field is the master access token for the project. It's default value is None. :param member: This field is specific member whose project data is downloaded. It's default value is None. :param access_token: This field is the user specific access token. It's default value is None. :param source: This field is the data source. It's default value is None. :param project_data: This field is data related to particular project. It's default value is False. :param max_size: This field is the maximum file size. It's default value is 128m. :param verbose: This boolean field is the logging level. It's default value is False. :param debug: This boolean field is the logging level. It's default value is False. :param memberlist: This field is list of members whose data will be downloaded. It's default value is None. :param excludelist: This field is list of members whose data will be skipped. It's default value is None.", "label": 1, "domain": "code", "token_count": 331, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0383", "text": "Parameters ---------- y: 1D numpy array The data to be fitted x: 1D numpy array The x values of the y array. x and y must have the same shape. weights: 1D numpy array, must have the same shape as x and y weight values Examples -------- >>> import numpy as N >>> from numpy.core import around >>> x = N.array([-5, -4 ,-3 ,-2 ,-1, 0, 1, 2, 3, 4, 5]) >>> y = N.array([1, 5, 4, 7, 10, 8, 9, 13, 14, 13, 18]) >>> around(linefit(x,y), decimals=5) array([9.27273, 1.43636]) >>> x = N.array([1.3,1.3,2.0,2.0,2.7,3.3,3.3,3.7,3.7,4.,4.,4.,4.7,4.7,5.,5.3,5.3,5.3,5.7,6.,6.,6.3,6.7]) >>> y = N.array([2.3,1.8,2.8,1.5,2.2,3.8,1.8,3.7,1.7,2.8,2.8,2.2,3.2,1.9,1.8,3.5,2.8,2.1,3.4,3.2,3.,3.,5.9]) >>> around(linefit(x,y), decimals=5) array([1.42564, 0.31579])", "label": 1, "domain": "code", "token_count": 371, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0384", "text": "Summarise the JSON file from the input {@link Reader} and emit the summary CSV file to the output {@link Writer}, including the given maximum number of sample values in the summary for each field. @param input The input JSON file, as a {@link Reader}. @param inputMapper The ObjectMapper to use to parse the file into memory @param output The output CSV file as a {@link Writer}. @param mappingOutput The output mapping template file as a {@link Writer}. @param maxSampleCount The maximum number of sample values in the summary for each field. Set to -1 to include all unique values for each field. @param showSampleCounts Show counts next to sample values @param debug Set to true to add debug statements. @param defaultValues A Map of default values to substitute during the summarise process if there is no value given for the matching field in the CSV file. The length of this list must either be 0 or the same as the number of fields. @param basePath The path to go to before checking the field paths (only supports a single point of entry at this point in time). Set to \"/\" to start at the top of the document. If the basePath points to an array, each of the array elements are matched separately with the fieldRelativePaths. If it points to an object, the object is directly matched to obtain a single result row. Otherwise an exception is thrown. @param fieldRelativePaths The relative paths underneath the basePath to select field values from. @throws IOException If there is an error reading or writing.", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0385", "text": "
     Generate normally distributed doubles. Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using ::curandSetStream(), or the null stream if no stream has been set. Results are 64-bit floating point values with mean mean and standard deviation stddev. Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality. There may be slight numerical differences between results generated on the GPU with generators created with ::curandCreateGenerator() and results calculated on the CPU with generators created with ::curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values. @param generator - Generator to use @param outputPtr - Pointer to device memory to store CUDA-generated results, or Pointer to host memory to store CPU-generated results @param n - Number of doubles to generate @param mean - Mean of normal distribution @param stddev - Standard deviation of normal distribution @return CURAND_STATUS_NOT_INITIALIZED if the generator was never created CURAND_STATUS_PREEXISTING_FAILURE if there was an existing error from a previous kernel launch CURAND_STATUS_LAUNCH_FAILURE if the kernel launch failed for any reason CURAND_STATUS_LENGTH_NOT_MULTIPLE if the number of output samples is not a multiple of the quasirandom dimension, or is not a multiple of two for pseudorandom generators CURAND_STATUS_DOUBLE_PRECISION_REQUIRED if the GPU does not support double precision CURAND_STATUS_SUCCESS if the results were generated successfully 
    ", "label": 1, "domain": "code", "token_count": 376, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0386", "text": "

    Perform am URI path escape operation on a String input using UTF-8 as encoding, writing results to a Writer.

    The following are the only allowed chars in an URI path (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • /

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 307, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0387", "text": "Searches the receiver for the specified value using the binary search algorithm. The receiver must be sorted into ascending order according to the specified comparator. All elements in the range must be mutually comparable by the specified comparator (that is, c.compare(e1, e2) must not throw a ClassCastException for any elements e1 and e2 in the range).

    If the receiver is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the receiver contains multiple elements equal to the specified object, there is no guarantee which instance will be found. @param key the value to be searched for. @param from the leftmost search position, inclusive. @param to the rightmost search position, inclusive. @param comparator the comparator by which the receiver is sorted. @throws ClassCastException if the receiver contains elements that are not mutually comparable using the specified comparator. @return index of the search key, if it is contained in the receiver; otherwise, (-(insertion point) - 1). The insertion point is defined as the the point at which the value would be inserted into the receiver: the index of the first element greater than the key, or receiver.size(), if all elements in the receiver are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found. @see cern.colt.Sorting @see java.util.Arrays @see java.util.Comparator", "label": 1, "domain": "code", "token_count": 356, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0388", "text": "Compute Pi_V. This function returns the Pi array from the model factors of the V genomic contributions, P(V)*P(delV|V). This corresponds to V_{x_1}. For clarity in parsing the algorithm implementation, we include which instance attributes are used in the method as 'parameters.' Parameters ---------- CDR3_seq : str CDR3 sequence composed of 'amino acids' (single character symbols each corresponding to a collection of codons as given by codons_dict). V_usage_mask : list Indices of the V alleles to be considered in the Pgen computation self.cutV_genomic_CDR3_segs : list of strings List of all the V genomic nucleotide sequences trimmed to begin at the conserved C residue and with the maximum number of palindromic insertions appended. self.PVdelV_nt_pos_vec : list of ndarrays For each V allele, format P(V)*P(delV|V) into the correct form for a Pi array or V_{x_1}. This is only done for the first and last position in each codon. self.PVdelV_2nd_nt_pos_per_aa_vec : list of dicts For each V allele, and each 'amino acid', format P(V)*P(delV|V) for positions in the middle of a codon into the correct form for a Pi array or V_{x_1} given the 'amino acid'. Returns ------- Pi_V : ndarray (4, 3L) array corresponding to V_{x_1}. max_V_align: int Maximum alignment of the CDR3_seq to any genomic V allele allowed by V_usage_mask.", "label": 1, "domain": "code", "token_count": 336, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0389", "text": "Generate chessboard/checkerboard mask. Parameters ---------- column_distance : int Column distance of the enabled pixels. row_distance : int Row distance of the enabled pixels. column_offset : int Additional column offset which shifts the columns by the given amount. column_offset : int Additional row offset which shifts the rows by the given amount. Returns ------- ndarray Chessboard mask. Example ------- Input: column_distance : 6 row_distance : 2 Output: [[1 0 0 0 0 0 1 0 0 0 ... 0 0 0 0 1 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 1 ... 0 1 0 0 0 0 0 1 0 0] ... [0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 1 ... 0 1 0 0 0 0 0 1 0 0] [0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0]]", "label": 1, "domain": "code", "token_count": 340, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0390", "text": "Creates and caches a new AWS KMS instance with the given KMS constructor options for either the region specified in the given options (if any and region specified) or for the current region (if not) UNLESS a previously cached KMS instance exists and the given options either match the options used to construct it or are undefined, empty or only region was specified, in which case no new instance will be created and the cached instance will be returned instead. If the given options do not match existing options and are not empty and not only region, then logs a warning that the previously cached KMS instance is being replaced and returns the new AWS KMS instance. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) Configures the given context, if it does not already have a context.kms, with the cached kms instance for either the region specified in the given default kms options (if any and region specified) or for the current region (if not); otherwise with a new AWS.KMS instance created and cached by {@linkcode setKMS} for the specified or current region using the given default KMS constructor options. Note that the given default KMS constructor options will ONLY be used if no cached KMS instance exists. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) @param {Object|KMSAware} context - the context to configure @param {Object|undefined} [kmsOptions] - the optional KMS constructor options to use if no cached KMS instance exists @param {string|undefined} [kmsOptions.region] - an optional region to use instead of the current region @returns {KMSAware} the given context configured with an AWS.KMS instance", "label": 1, "domain": "code", "token_count": 360, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0391", "text": "Create pool based on RaidGroupParameter. :param name: pool name :param raid_groups: a list of *RaidGroupParameter* :param description: pool description :param alert_threshold: Threshold at which the system will generate alerts about the free space in the pool, specified as a percentage. :param is_harvest_enabled: True - Enable pool harvesting for the pool. False - Disable pool harvesting for the pool. :param is_snap_harvest_enabled: True - Enable snapshot harvesting for the pool. False - Disable snapshot harvesting for the pool. :param pool_harvest_high_threshold: Pool used space high threshold at which the system will automatically starts to delete snapshots in the pool :param pool_harvest_low_threshold: Pool used space low threshold under which the system will automatically stop deletion of snapshots in the pool :param snap_harvest_high_threshold: Snapshot used space high threshold at which the system automatically starts to delete snapshots in the pool :param snap_harvest_low_threshold: Snapshot used space low threshold below which the system will stop automatically deleting snapshots in the pool :param is_fast_cache_enabled: True - FAST Cache will be enabled for this pool. False - FAST Cache will be disabled for this pool. :param is_fastvp_enabled: True - Enable scheduled data relocations for the pool. False - Disable scheduled data relocations for the pool. :param pool_type: StoragePoolTypeEnum.TRADITIONAL - Create traditional pool. StoragePoolTypeEnum.DYNAMIC - Create dynamic pool. (default)", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0392", "text": "Execute the given SQL script.

    Statement separators and comments will be removed before executing individual statements within the supplied script.

    Warning: this method does not release the provided {@link Connection}. @param connection the JDBC connection to use to execute the script; already configured and ready to use @param resource the resource (potentially associated with a specific encoding) to load the SQL script from @param continueOnError whether or not to continue without throwing an exception in the event of an error @param ignoreFailedDrops whether or not to continue in the event of specifically an error on a {@code DROP} statement @param commentPrefix the prefix that identifies single-line comments in the SQL script — typically \"--\" @param separator the script statement separator; defaults to {@value #DEFAULT_STATEMENT_SEPARATOR} if not specified and falls back to {@value #FALLBACK_STATEMENT_SEPARATOR} as a last resort; may be set to {@value #EOF_STATEMENT_SEPARATOR} to signal that the script contains a single statement without a separator @param blockCommentStartDelimiter the start block comment delimiter; never {@code null} or empty @param blockCommentEndDelimiter the end block comment delimiter; never {@code null} or empty @throws ScriptException if an error occurred while executing the SQL script @see #DEFAULT_STATEMENT_SEPARATOR @see #FALLBACK_STATEMENT_SEPARATOR @see #EOF_STATEMENT_SEPARATOR", "label": 1, "domain": "code", "token_count": 307, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0393", "text": "Creates and caches a new AWS DynamoDB.DocumentClient instance with the given DynamoDB.DocumentClient constructor options for either the region specified in the given options (if any and region specified) or for the current region (if not) UNLESS a previously cached DynamoDB.DocumentClient instance exists and the given options EITHER match the options used to construct it OR are undefined, empty or only region, in which case no new instance will be created and the cached instance will be returned instead. If the given options do not match existing options and are not empty and not only region, then logs a warning that the previously cached DynamoDB.DocumentClient instance is being replaced and returns the new AWS DynamoDB.DocumentClient instance. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging} @param {Object|undefined} [dynamoDBDocClientOptions] - the optional DynamoDB.DocumentClient constructor options to use @param {string|undefined} [dynamoDBDocClientOptions.region] - an optional region to use instead of the current region @param {Object|undefined} [context] - the context, which is just used for logging @param {AWS|undefined} [context.AWS] - an optional, alternative AWS constructor to use (if unspecified, uses the standard AWS-SDK AWS constructor) - e.g. enables use of an AWS XRay-captured AWS constructor @returns {AWS.DynamoDB.DocumentClient} a cached or new AWS DynamoDB.DocumentClient instance created and cached for the specified or current region", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0394", "text": "

    Perform a CSS String level 2 (basic set and all non-ASCII chars) escape operation on a Reader input, writing results to a Writer.

    Level 2 means this method will escape:

    • The CSS String basic escape set:
      • The Backslash Escapes: \" (U+0022) and \' (U+0027).
      • Two ranges of non-displayable, control characters: U+0000 to U+001F and U+007F to U+009F.
    • All non ASCII characters.

    This escape will be performed by using Backslash escapes whenever possible. For escaped characters that do not have an associated Backslash, default to \FF Hexadecimal Escapes.

    This method calls {@link #escapeCssString(Reader, Writer, CssStringEscapeType, CssStringEscapeLevel)} with the following preconfigured values:

    • type: {@link CssStringEscapeType#BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA}
    • level: {@link CssStringEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 465, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0395", "text": "Gets the list of compose deployments created in the Service Fabric cluster. Gets the status about the compose deployments that were created or in the process of being created in the Service Fabric cluster. The response includes the name, status and other details about the compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a continuation token which can be used to get the next page. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PagedComposeDeploymentStatusInfoList] operation results.", "label": 1, "domain": "code", "token_count": 360, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0396", "text": "/*DEL allows bypass of PureTLS checks - since they were already performed during SSL hashshake static class GSSProxyPathValidator extends ProxyPathValidator { public void validate(X509Certificate [] certPath, TrustedCertificates trustedCerts, CertificateRevocationLists crlsList) throws ProxyPathValidatorException { super.validate(certPath, trustedCerts, crlsList); } } private String verifyChain(Vector peerCerts) throws GSSException { X509Certificate[] peerChain = null; try { peerChain = PureTLSUtil.certificateChainToArray(peerCerts); } catch (GeneralSecurityException e) { throw new GlobusGSSException(GSSException.DEFECTIVE_CREDENTIAL, e); } GSSProxyPathValidator validator = new GSSProxyPathValidator(); if (this.proxyPolicyHandlers != null) { Iterator iter = this.proxyPolicyHandlers.keySet().iterator(); String oid; ProxyPolicyHandler handler; while(iter.hasNext()) { oid = (String)iter.next(); handler = (ProxyPolicyHandler)this.proxyPolicyHandlers.get(oid); validator.setProxyPolicyHandler(oid, handler); } } CertificateRevocationLists certRevList = CertificateRevocationLists.getDefaultCertificateRevocationLists(); validator.setRejectLimitedProxyCheck( this.rejectLimitedProxy.booleanValue()); try { validator.validate(peerChain, this.tc, certRevList); } catch (ProxyPathValidatorException e) { COMMENT FIXME we don't have an error code if (e.getErrorCode() == ProxyPathValidatorException.LIMITED_PROXY_ERROR) { throw new GlobusGSSException(GSSException.UNAUTHORIZED, e); } else { throw new GlobusGSSException(GSSException.DEFECTIVE_CREDENTIAL, e); } } C code also sets a flag RECEIVED_LIMITED_PROXY when recevied certs is a limited proxy this.peerLimited = (validator.isLimited()) ? Boolean.TRUE : Boolean.FALSE; return validator.getIdentity(); }", "label": 1, "domain": "code", "token_count": 389, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0397", "text": "

    Perform an HTML 4 level 1 (XML-style) escape operation on a char[] input.

    Level 1 means this method will only escape the five markup-significant characters: <, >, &, " and '. It is called XML-style in order to link it with JSP's escapeXml attribute in JSTL's <c:out ... /> tags.

    Note this method may not produce the same results as {@link #escapeHtml5Xml(char[], int, int, java.io.Writer)} because it will escape the apostrophe as &#39;, whereas in HTML5 there is a specific NCR for such character (&apos;).

    This method calls {@link #escapeHtml(char[], int, int, java.io.Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 464, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0398", "text": "Align a set of matching reads against a BLAST or DIAMOND hit. @param titlesAlignments: A L{dark.titles.TitlesAlignments} instance. @param title: A C{str} sequence title that was matched. We plot the reads that hit this title. @param addQueryLines: if C{True}, draw query lines in full (these will then be partly overdrawn by the HSP match against the subject). These are the 'whiskers' that potentially protrude from each side of a query. @param showFeatures: if C{True}, look online for features of the subject sequence (given by hitId). @param logLinearXAxis: if C{True}, convert read offsets so that empty regions in the plot we're preparing will only be as wide as their logged actual values. @param logBase: The base of the logarithm to use if logLinearXAxis is C{True}. @param: rankScores: If C{True}, change the e-values and bit scores for the reads for each title to be their rank (worst to best). @param colorQueryBases: if C{True}, color each base of a query string. If C{True}, then addQueryLines is meaningless since the whole query is shown colored. @param createFigure: If C{True}, create a figure and give it a title. @param showFigure: If C{True}, show the created figure. Set this to C{False} if you're creating a panel of figures or just want to save an image (with C{imageFile}). @param readsAx: If not None, use this as the subplot for displaying reads. @param imageFile: If not None, specifies a filename to write the image to. @param quiet: If C{True}, don't print progress / timing output. @param idList: a dictionary. The keys is a color and the values is a list of read identifiers that should be colored in the respective color. @param xRange: set to either 'subject' or 'reads' to indicate the range of the X axis. @param showOrfs: If C{True}, open reading frames will be displayed.", "label": 1, "domain": "code", "token_count": 457, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0399", "text": "Gets a Service-related events. The response is list of ServiceEvent objects. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param start_time_utc [String] The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param end_time_utc [String] The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param events_types_filter [String] This is a comma separated string specifying the types of FabricEvents that should only be included in the response. @param exclude_analysis_events [Boolean] This param disables the retrieval of AnalysisEvents if true is passed. @param skip_correlation_lookup [Boolean] This param disables the search of CorrelatedEvents information if true is passed. otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets populated. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 352, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0400", "text": "Plots a set receiver/relative operating characteristic (ROC) curves from DistributedROC objects. The ROC curve shows how well a forecast discriminates between two outcomes over a series of thresholds. It features Probability of Detection (True Positive Rate) on the y-axis and Probability of False Detection (False Alarm Rate) on the x-axis. This plotting function allows one to customize the colors and markers of the ROC curves as well as the parameters of the legend and the title. Args: roc_objs (list): DistributedROC objects being plotted. obj_labels (list): Label describing the forecast associated with a DistributedROC object. colors (list): List of matplotlib-readable colors (names or hex-values) for each curve. markers (list): Matplotlib marker (e.g. *, o, v, etc.) for each curve. filename (str): Name of figure file being saved. figsize (tuple): (Width, height) of the figure in inches. xlabel (str): Label for the x-axis. ylabel (str): Label for the y-axis. title (str): The title of the figure. ticks (numpy.ndarray): Values shown on the x and y axes. dpi (int): Figure resolution in dots per inch. legend_params (None, dict): Keyword arguments for the formatting of the figure legend. bootstrap_sets (list): List of lists of DistributedROC objects that were bootstrap resampled for each model. ci (tuple of 2 floats): Quantiles of the edges of the bootstrap confidence intervals ranging from 0 to 100. label_fontsize (int): Font size of the x and y axis labels. title_fontsize (int): Font size of the title. tick_fontsize (int): Font size of the x and y tick labels. Examples: >>> from hagelslag.evaluation import DistributedROC >>> import numpy as np >>> forecasts = np.random.random(1000) >>> obs = np.random.random_integers(0, 1, 1000) >>> roc = DistributedROC() >>> roc.update(forecasts, obs) >>> roc_curve([roc], [\"Random\"], [\"orange\"], [\"o\"], \"random_roc.png\")", "label": 1, "domain": "code", "token_count": 434, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0401", "text": "Gets the value of the surface property.

    This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the surface property.

    For example, to add a new item, do as follows:

     get_Surface().add(newItem); 

    Objects of the following type(s) are allowed in the list {@link JAXBElement }{@code <}{@link TinType }{@code >} {@link JAXBElement }{@code <}{@link TriangulatedSurfaceType }{@code >} {@link JAXBElement }{@code <}{@link PolyhedralSurfaceType }{@code >} {@link JAXBElement }{@code <}{@link SurfaceType }{@code >} {@link JAXBElement }{@code <}{@link net.opengis.citygml.texturedsurface._1.TexturedSurfaceType }{@code >} {@link JAXBElement }{@code <}{@link net.opengis.citygml.texturedsurface._2.TexturedSurfaceType }{@code >} {@link JAXBElement }{@code <}{@link OrientableSurfaceType }{@code >} {@link JAXBElement }{@code <}{@link CompositeSurfaceType }{@code >} {@link JAXBElement }{@code <}{@link PolygonType }{@code >} {@link JAXBElement }{@code <}{@link AbstractSurfaceType }{@code >}", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0402", "text": "This is used to change the format of the image. That is, from \"tiff to jpg\" or something like that. Once you run it, the instance is pointing to a new file with a new extension! *DANGER*: This renames the file that the instance is pointing to. So, if you manually opened the file with Image.new(file_path)... Then that file is DELETED! If you used Image.open(file) then you are OK. The original file will still be there. But, any changes to it might not be... Formatting an animation into a non-animated type will result in ImageMagick creating multiple pages (starting with 0). You can choose which page you want to manipulate. We default to the first page. If you would like to convert between animated formats, pass nil as your page and ImageMagick will copy all of the pages. @param format [String] The target format... Like 'jpg', 'gif', 'tiff' etc. @param page [Integer] If this is an animated gif, say which 'page' you want with an integer. Default 0 will convert only the first page; 'nil' will convert all pages. @param read_opts [Hash] Any read options to be passed to ImageMagick for example: image.format('jpg', page, {density: '300'}) @yield [MiniMagick::Tool::Convert] It optionally yields the command, if you want to add something. @return [self]", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0403", "text": "Lists a collection of the members of the group, specified by its identifier. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param group_id [String] Group identifier. Must be unique in the current API Management service instance. @param filter [String] | Field | Supported operators | Supported functions | |------------------|------------------------|-----------------------------------| | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | state | eq | N/A | | registrationDate | ge, le, eq, ne, gt, lt | N/A | | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [UserCollection] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0404", "text": "Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

    In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive. The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)

    The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.

    Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.

    It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is \"Note: this class has a natural ordering that is inconsistent with equals.\" @param obj the Object to be compared. @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. @throws ClassCastException if the specified object's type prevents it from being compared to this Object.", "label": 1, "domain": "code", "token_count": 444, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0405", "text": "Build call for postConfigAdobeGraniteSamlAuthenticationHandler @param keyStorePassword (optional) @param keyStorePasswordTypeHint (optional) @param serviceRanking (optional) @param serviceRankingTypeHint (optional) @param idpHttpRedirect (optional) @param idpHttpRedirectTypeHint (optional) @param createUser (optional) @param createUserTypeHint (optional) @param defaultRedirectUrl (optional) @param defaultRedirectUrlTypeHint (optional) @param userIDAttribute (optional) @param userIDAttributeTypeHint (optional) @param defaultGroups (optional) @param defaultGroupsTypeHint (optional) @param idpCertAlias (optional) @param idpCertAliasTypeHint (optional) @param addGroupMemberships (optional) @param addGroupMembershipsTypeHint (optional) @param path (optional) @param pathTypeHint (optional) @param synchronizeAttributes (optional) @param synchronizeAttributesTypeHint (optional) @param clockTolerance (optional) @param clockToleranceTypeHint (optional) @param groupMembershipAttribute (optional) @param groupMembershipAttributeTypeHint (optional) @param idpUrl (optional) @param idpUrlTypeHint (optional) @param logoutUrl (optional) @param logoutUrlTypeHint (optional) @param serviceProviderEntityId (optional) @param serviceProviderEntityIdTypeHint (optional) @param assertionConsumerServiceURL (optional) @param assertionConsumerServiceURLTypeHint (optional) @param handleLogout (optional) @param handleLogoutTypeHint (optional) @param spPrivateKeyAlias (optional) @param spPrivateKeyAliasTypeHint (optional) @param useEncryption (optional) @param useEncryptionTypeHint (optional) @param nameIdFormat (optional) @param nameIdFormatTypeHint (optional) @param digestMethod (optional) @param digestMethodTypeHint (optional) @param signatureMethod (optional) @param signatureMethodTypeHint (optional) @param userIntermediatePath (optional) @param userIntermediatePathTypeHint (optional) @param progressListener Progress listener @param progressRequestListener Progress request listener @return Call to execute @throws ApiException If fail to serialize the request body object", "label": 1, "domain": "code", "token_count": 458, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0406", "text": "Convert a network byte order 128-bit integer to a canonical IPv6 address. >>> long2ip(2130706433) '::7f00:1' >>> long2ip(42540766411282592856904266426630537217) '2001:db8::1:0:0:1' >>> long2ip(MIN_IP) '::' >>> long2ip(MAX_IP) 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' >>> long2ip(None) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... TypeError: unsupported operand type(s) for >>: 'NoneType' and 'int' >>> long2ip(-1) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... TypeError: expected int between 0 and inclusive >>> long2ip(MAX_IP + 1) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... TypeError: expected int between 0 and inclusive >>> long2ip(ip2long('1080::8:800:200C:417A'), rfc1924=True) '4)+k&C#VzJ4br>0wv%Yp' >>> long2ip(ip2long('::'), rfc1924=True) '00000000000000000000' :param l: Network byte order 128-bit integer. :type l: int :param rfc1924: Encode in RFC 1924 notation (base 85) :type rfc1924: bool :returns: Canonical IPv6 address (eg. '::1'). :raises: TypeError", "label": 1, "domain": "code", "token_count": 353, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0407", "text": "Deletes an existing Service Fabric application. Deletes an existing Service Fabric application. An application must be created before it can be deleted. Deleting an application will delete all services that are part of that application. By default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of the its services. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param force_remove [Boolean] Remove a Service Fabric application or service forcefully without going through the graceful shutdown sequence. This parameter can be used to forcefully delete an application or service for which delete is timing out due to issues in the service code that prevents graceful close of replicas. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 344, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0408", "text": "Mark a message as translateable, and translate it. All messages in the application that are translateable should be wrapped with this function. When importing this function, it should be renamed to '_'. For example: .. code-block:: python from zengine.lib.translation import gettext as _ print(_('Hello, world!')) 'Merhaba, dünya!' For the messages that will be formatted later on, instead of using the position-based formatting, key-based formatting should be used. This gives the translator an idea what the variables in the format are going to be, and makes it possible for the translator to reorder the variables. For example: .. code-block:: python name, number = 'Elizabeth', 'II' _('Queen %(name)s %(number)s') % {'name': name, 'number': number} 'Kraliçe II. Elizabeth' The message returned by this function depends on the language of the current user. If this function is called before a language is installed (which is normally done by ZEngine when the user connects), this function will simply return the message without modification. If there are messages containing unicode characters, in Python 2 these messages must be marked as unicode. Otherwise, python will not be able to correctly match these messages with translations. For example: .. code-block:: python print(_('Café')) 'Café' print(_(u'Café')) 'Kahve' Args: message (basestring, unicode): The input message. domain (basestring): The domain of the message. Defaults to 'messages', which is the domain where all application messages should be located. Returns: unicode: The translated message.", "label": 1, "domain": "code", "token_count": 335, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0409", "text": "Gets the information about all services belonging to the application specified by the application id. Returns the information about all services belonging to the application specified by the application id. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_type_name [String] The service type name used to filter the services to query for. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PagedServiceInfoList] operation results.", "label": 1, "domain": "code", "token_count": 326, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0410", "text": "Returns a signature base string. The signature base string is constructed by concatenating together, in order, the following HTTP request elements, each followed by a new line character (%x0A): 1. The nonce value generated for the request. 2. The HTTP request method in upper case. For example: \"HEAD\", \"GET\", \"POST\", etc. 3. The HTTP request-URI as defined by [RFC2616] section 5.1.2. 4. The hostname included in the HTTP request using the \"Host\" request header field in lower case. 5. The port as included in the HTTP request using the \"Host\" request header field. If the header field does not include a port, the default value for the scheme MUST be used (e.g. 80 for HTTP and 443 for HTTPS). 6. The request payload body hash as described in Section 3.2 if one was calculated and included in the request, otherwise, an empty string. Note that the body hash of an empty payload body is not an empty string. 7. The value of the \"ext\" \"Authorization\" request header field attribute if one was included in the request, otherwise, an empty string. Each element is followed by a new line character (%x0A) including the last element and even when an element value is an empty string. @see 3.3.1. Normalized Request String @param nonce the nonce value @param requestMethod the request method @param headerHost the \"Host\" request header field value @param requestUrl request url @param payloadBodyHash the request payload body hash @param ext the \"ext\" \"Authorization\" request header field attribute @return signature base string @throws AuthException if some of parameters has unacceptable value", "label": 1, "domain": "code", "token_count": 400, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0411", "text": " Generate a 'scheme' signature. The signature, and the signature scheme used, is returned as a (signature, scheme) tuple. The signing process will use 'private_key' to generate the signature of 'data'. RFC3447 - RSASSA-PSS http://www.ietf.org/rfc/rfc3447.txt >>> public, private = generate_rsa_public_and_private(2048) >>> data = 'The quick brown fox jumps over the lazy dog'.encode('utf-8') >>> scheme = 'rsassa-pss-sha256' >>> signature, scheme = create_rsa_signature(private, data, scheme) >>> securesystemslib.formats.NAME_SCHEMA.matches(scheme) True >>> scheme == 'rsassa-pss-sha256' True >>> securesystemslib.formats.PYCACRYPTOSIGNATURE_SCHEMA.matches(signature) True private_key: The private RSA key, a string in PEM format. data: Data (string) used by create_rsa_signature() to generate the signature. scheme: The signature scheme used to generate the signature. securesystemslib.exceptions.FormatError, if 'private_key' is improperly formatted. ValueError, if 'private_key' is unset. securesystemslib.exceptions.CryptoError, if the signature cannot be generated. pyca/cryptography's 'RSAPrivateKey.signer()' called to generate the signature. A (signature, scheme) tuple, where the signature is a string and the scheme is one of the supported RSA signature schemes. For example: 'rsassa-pss-sha256'.", "label": 1, "domain": "code", "token_count": 329, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0412", "text": "PURPOSE Compute Friedman and Popescu's two-variable H statistic, in order to look for an interaction in the passed gradient- boosting model between each pair of variables represented by the elements of the passed array or frame and specified by the passed indices or columns. See Jerome H. Friedman and Bogdan E. Popescu, 2008, \"Predictive learning via rule ensembles\", Ann. Appl. Stat. 2:916-954, http://projecteuclid.org/download/pdfview_1/euclid.aoas/1223908046, s. 8.1. ARGUMENTS gbm should be a scikit-learn gradient-boosting model (instance of sklearn.ensemble.GradientBoostingClassifier or sklearn.ensemble.GradientBoostingRegressor) that has been fitted to array_or_frame (and a target, not used here). array_or_frame should be a two-dimensional NumPy array or a pandas data frame (instance of numpy.ndarray or pandas .DataFrame). indices_or_columns is optional, with default value 'all'. It should be 'all' or a list of indices of columns of array_or_frame if array_or_frame is a NumPy array or a list of columns of array_or_frame if array_or_frame is a pandas data frame. If it is 'all', then all columns of array_or_frame are used. RETURNS A dict whose keys are pairs (2-tuples) of indices or columns and whose values are the H statistic of the pairs of variables or NaN if a computation is spoiled by weak main effects and rounding errors. H varies from 0 to 1. The larger H, the stronger the evidence for an interaction between a pair of variables. EXAMPLE Friedman and Popescu's (2008) formula (44) for every j and k corresponds to h_all_pairs(F, x) NOTES 1. Per Friedman and Popescu, only variables with strong main effects should be examined for interactions. Strengths of main effects are available as gbm.feature_importances_ once gbm has been fitted. 2. Per Friedman and Popescu, collinearity among variables can lead to interactions in gbm that are not present in the target function. To forestall such spurious interactions, check for strong correlations among variables before fitting gbm.", "label": 1, "domain": "code", "token_count": 466, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0413", "text": "下载 object @param {Object} params 参数对象,必须 @param {String} params.Bucket Bucket名称,必须 @param {String} params.Region 地域名称,必须 @param {String} params.Key 文件名称,必须 @param {WriteStream} params.Output 文件写入流,非必须 @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须 @param {String} params.IfUnmodifiedSince 如果文件修改时间早于或等于指定时间,才返回文件内容。否则返回 412 (precondition failed),非必须 @param {String} params.IfMatch 当 ETag 与指定的内容一致,才返回文件。否则返回 412 (precondition failed),非必须 @param {String} params.IfNoneMatch 当 ETag 与指定的内容不一致,才返回文件。否则返回304 (not modified),非必须 @param {String} params.ResponseContentType 设置返回头部中的 Content-Type 参数,非必须 @param {String} params.ResponseContentLanguage 设置返回头部中的 Content-Language 参数,非必须 @param {String} params.ResponseExpires 设置返回头部中的 Content-Expires 参数,非必须 @param {String} params.ResponseCacheControl 设置返回头部中的 Cache-Control 参数,非必须 @param {String} params.ResponseContentDisposition 设置返回头部中的 Content-Disposition 参数,非必须 @param {String} params.ResponseContentEncoding 设置返回头部中的 Content-Encoding 参数,非必须 @param {Function} callback 回调函数,必须 @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730 @param {Object} data 为对应的 object 数据,包括 body 和 headers", "label": 1, "domain": "code", "token_count": 376, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0414", "text": "Main method to perform analysis of a given running application. Allows to choose a particular execution scope - desired part of the UI to be checked and a flexible way to specify the list of rules to be used. @memberof sap.ui.support.RuleAnalyzer @public @param {object} [oExecutionScope] The execution scope of the analysis (see {@link topic:e15067d976f24b11907f4c262bd749a0 Execution Scope}). @param {string} [oExecutionScope.type=global] Possible values are global, subtree or components. @param {string} [oExecutionScope.parentId] ID of the root element that forms a subtree. Use when the scope type is subtree. @param {string[]} [oExecutionScope.components] List of IDs of the components to be analyzed. Use only when the scope type is components. @param {object|string|object[]} [vPresetOrRules=All rules] This optional parameter allows for selection of subset of rules for the analysis. You can pass:

    • A rule preset object containing the preset ID and the list of rules it contains.
    • A string that refers to the ID of a system preset.
    • An object array with a plain list of rules.
    @param {object} [oMetadata] Metadata in custom format. Its only purpose is to be included in the analysis report. @returns {Promise} Notifies the finished state by starting the Analyzer", "label": 1, "domain": "code", "token_count": 334, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0415", "text": "Create a new instance with the given URL options. Initializing without a host setting raises an error, as do unknown keys. @param [Hash] url_options @option url_options [String] :host (required) @option url_options [String, Integer] :port @option url_options [String] :path root path @option url_options [String] :scheme URL scheme (\"http\" is default) @option url_options [String] :protocol alias for :scheme Generate an absolute URL from a relative URL. If the passed path is already an absolute URL or just an anchor reference, it will be returned as-is. If passed a blank path, the \"root URL\" will be returned. The root URL is the URL that the {#url_options} would generate by themselves. An optional base can be specified. The base is another relative path from the root that specifies an \"offset\" from which the path was found in. A common use-case is to convert a relative path found in a stylesheet which resides in a subdirectory. @example Normal conversions generator = Roadie::UrlGenerator.new host: \"foo.com\", scheme: \"https\" generator.generate_url(\"bar.html\") # => \"https://foo.com/bar.html\" generator.generate_url(\"/bar.html\") # => \"https://foo.com/bar.html\" generator.generate_url(\"\") # => \"https://foo.com\" @example Conversions with a base generator = Roadie::UrlGenerator.new host: \"foo.com\", scheme: \"https\" generator.generate_url(\"../images/logo.png\", \"/css\") # => \"https://foo.com/images/logo.png\" generator.generate_url(\"../images/logo.png\", \"/assets/css\") # => \"https://foo.com/assets/images/logo.png\" @param [String] base The base which the relative path comes from @return [String] an absolute URL", "label": 1, "domain": "code", "token_count": 373, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0416", "text": "

    Perform an HTML5 level 2 (result is ASCII) escape operation on a String input.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding HTML5 Named Character References (e.g. '&acute;') when such NCR exists for the replaced character, and replacing by a decimal character reference (e.g. '&#8345;') when there there is no NCR for the replaced character.

    This method calls {@link #escapeHtml(String, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 417, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0417", "text": "A reference to our Express app object. The Crux Server Route encapsulates data about a single route definition file. In crux, a route contains functionality that is similar or is logically grouped by a criteria. As an example, the \"Account\" route contains the \"update\" and \"create\" endpoints, both of whici make use of the Account model and performs actions on it.
    The route definition file is responsible of creating the HTTP endpoints and defining their structure. @class crux.Server.Route @memberof crux.Server @example // We will define a basic Account route. This is the content of routes/account.js module.exports = function(route) { // When first created, the routes's base HTTP path is /account route.namespace('account'); // this will set the routes's namespace. // If we want to change the base path, we will call root() that will change the default route HTTP path route.root('/api/account'); // We are going to define the Account create endpoint route .post('/', 'Creates an account') // Calling post(), put(), get() or delete() will return an instance of {@link crux.Server.Chain} .body({ // We define the pre-requisites for this route to be called. name: route.type.STRING, age: route.type.NUMBER.default(13), theme: route.type.ENUM('light', 'dark') }) .then(function() { // Calling this.body() will return the safe body data. var accountData = this.body(); console.log(\"Hello %s\", this.body(\"name\")); this.success(); // this will end the HTTP request with a success JSON }); // We now define a get endpoint route .get('/:id', 'Get an account') .param({ id: route.type.NUMBER }) .query({ sort: route.type.STRING.default(\"asc\") }) .then(function() { // do stuff with our account. // OOps, we have an error this.error('ERROR_CODE', 'Error description'); }); };", "label": 1, "domain": "code", "token_count": 402, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0418", "text": "Options for constructing a new ResonanceAudio scene. @typedef {Object} ResonanceAudio~ResonanceAudioOptions @property {Number} ambisonicOrder Desired ambisonic Order. Defaults to {@linkcode Utils.DEFAULT_AMBISONIC_ORDER DEFAULT_AMBISONIC_ORDER}. @property {Float32Array} listenerPosition The listener's initial position (in meters), where origin is the center of the room. Defaults to {@linkcode Utils.DEFAULT_POSITION DEFAULT_POSITION}. @property {Float32Array} listenerForward The listener's initial forward vector. Defaults to {@linkcode Utils.DEFAULT_FORWARD DEFAULT_FORWARD}. @property {Float32Array} listenerUp The listener's initial up vector. Defaults to {@linkcode Utils.DEFAULT_UP DEFAULT_UP}. @property {Utils~RoomDimensions} dimensions Room dimensions (in meters). Defaults to {@linkcode Utils.DEFAULT_ROOM_DIMENSIONS DEFAULT_ROOM_DIMENSIONS}. @property {Utils~RoomMaterials} materials Named acoustic materials per wall. Defaults to {@linkcode Utils.DEFAULT_ROOM_MATERIALS DEFAULT_ROOM_MATERIALS}. @property {Number} speedOfSound (in meters/second). Defaults to {@linkcode Utils.DEFAULT_SPEED_OF_SOUND DEFAULT_SPEED_OF_SOUND}. @class ResonanceAudio @description Main class for managing sources, room and listener models. @param {AudioContext} context Associated {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext}. @param {ResonanceAudio~ResonanceAudioOptions} options Options for constructing a new ResonanceAudio scene.", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0419", "text": "Helper method to resolve an event handler either locally (from a controller) or globally. Which contexts are checked for the event handler depends on the syntax of the name:
    • relative: names starting with a dot ('.') must specify a handler in the controller (example: \".myLocalHandler\")
    • absolute: names that contain, but do not start with a dot ('.') are always assumed to mean a global handler function. {@link jQuery.sap.getObject} will be used to retrieve the function (example: \"some.global.handler\" )
    • legacy: Names that contain no dot at all are first interpreted as a relative name and then - if nothing is found - as an absolute name. This variant is only supported for backward compatibility (example: \"myHandler\")
    The returned settings will always use the given oController as context object ('this') This should allow the implementation of generic global handlers that might need an easy back link to the controller/view in which they are currently used (e.g. to call createId/byId). It also makes the development of global event handlers more consistent with controller local event handlers. The event handler name can either be a pure function name (defined in the controller, or globally, as explained above), or the function name can be followed by braces containing parameters that shall be passed to the handler instead of the event object. In case of braces the entire string is parsed like a binding expression, so in addition to static values also bindings and certain operators can be used. Note: It is not mandatory but improves readability of declarative views when legacy names are converted to relative names where appropriate. @param {string} sName the event handler name to resolve @param {sap.ui.core.mvc.Controller} oController the controller to use as context @return {any[]} an array with function and context object, suitable for applySettings. @private", "label": 1, "domain": "code", "token_count": 427, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0420", "text": "Returns a Version instance created from the given parameters. This function can either be called as a constructor (using new) or as a normal function. It always returns an immutable Version instance. The parts of the version number (major, minor, patch, suffix) can be provided in several ways:
    • Version(\"1.2.3-SNAPSHOT\") - as a dot-separated string. Any non-numerical char or a dot followed by a non-numerical char starts the suffix portion. Any missing major, minor or patch versions will be set to 0.
    • Version(1,2,3,\"-SNAPSHOT\") - as individual parameters. Major, minor and patch must be integer numbers or empty, suffix must be a string not starting with digits.
    • Version([1,2,3,\"-SNAPSHOT\"]) - as an array with the individual parts. The same type restrictions apply as before.
    • Version(otherVersion) - as a Version instance (cast operation). Returns the given instance instead of creating a new one.
    To keep the code size small, this implementation mainly validates the single string variant. All other variants are only validated to some degree. It is the responsibility of the caller to provide proper parts. @param {int|string|any[]|module:sap/base/util/Version} vMajor the major part of the version (int) or any of the single parameter variants explained above. @param {int} iMinor the minor part of the version number @param {int} iPatch the patch part of the version number @param {string} sSuffix the suffix part of the version number @class Represents a version consisting of major, minor, patch version and suffix, e.g. '1.2.7-SNAPSHOT'. @since 1.58 @alias module:sap/base/util/Version @public", "label": 1, "domain": "code", "token_count": 401, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0421", "text": "Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee. This method performs a stable sort, that is, it preserves the original sort order of equal elements. The iteratees are invoked with one argument: (value). @static @memberOf _ @since 0.1.0 @category Collection @param {Array|Object} collection The collection to iterate over. @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] The iteratees to sort by. @returns {Array} Returns the new sorted array. @example var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }, { 'user': 'barney', 'age': 34 } ]; _.sortBy(users, function(o) { return o.user; }); // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] _.sortBy(users, ['user', 'age']); // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] _.sortBy(users, 'user', function(o) { return Math.floor(o.age / 10); }); // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0422", "text": "once every 50 seconds, we ping the connection to avoid timeouts Wrapper and utility functionality over node-redis. @example // Programatically create a redis store. var crux = require('node-crux'), app = crux.app; var redisStore = new crux.Store.Redis('mystore', { host: 'localhost' }); app.addComponent(redisStore); app.run(function() { // At this point, our redis component is connected to the redis server. redisStore.exec('SET', 'key', 'value'); redisStore.subscribe('myChannel', function onData(data) { log.debug('Got data', data); }, function onSubscribed() { redisStore.publish('myChannel', 'helloWorld'); }); }); @class crux.Store.Redis @extends crux.Component @property {String} [name=redis] - The redis component name. @property {Redis.RedisClient} - the Redis connection client. @param {String} name - the redis component's name. Crux allows the creation of multiple redis components, if they have different names. @param {Object} options Default configuration for the Redis component @param {Boolean} [options.enabled=true] - Enables or not the component. Disabled redis components will not connect to redis but simulate the run() method @param {Boolean} [options.debug=true] - Enables or not debug mode. While in debug mode, all redis calls are logged. @param {String} [options.host=localhost] - Redis hostname @param {Boolean} [options.pubsub=false] - If enabled, it will not create the default regular connection on redis, but only the publish/subscribe ones. @param {Number} [options.port=6379] - Redis port @param {String} [options.password=null] - Redis password @param {Object} [options.options] - additional Redis options.", "label": 1, "domain": "code", "token_count": 374, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0423", "text": "Constructor for the list view object. @method constructor @param args {Object} - options argument @param args.itemView {Backbone.View definition or Function} - the class definition of the item view. This view will be instantiated for every model returned by modelsToRender(). If a function is passed in, then for each model, this function will be invoked to find the appropriate view class. It takes the model as the only parameter. @param args.collection {Backbone.Collection instance} - The collection that will back this list view. A subclass of list view might provide a default collection. Can be private or public collection @param [args.itemContext] {Object or Function} - object or function that's passed to the item view's during initialization under the name \"context\". Can be used by the item view during their prepare method. @param [args.template] {HTML Template} - allows a list view to hold it's own HTML like filter buttons, etc. @param [args.itemContainer] {String} - (Required if 'template' is provided, ignored otherwise) name of injection site for list of item views @param [args.emptyTemplate] {HTML Template} - if provided, this template will be shown if the modelsToRender() method returns an empty list. If a itemContainer is provided, the empty template will be rendered there. @param [args.modelsToRender] {Function} - If provided, this function will override the modelsToRender() method with custom functionality. @param [args.renderWait=0] {Number} - If provided, will collect any internally invoked renders (typically through collection events like reset) for a duration specified by renderWait in milliseconds and then calls a single render instead. Helps to remove unnecessary render calls when modifying the collection often. @param [args.modelId='cid'] {'cid' or 'id'} - model property used as identifier for a given model. This property is saved and used to find the corresponding view. @param [args.modelName='model'] {String} - name of the model argument passed to the item view during initialization", "label": 1, "domain": "code", "token_count": 426, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0424", "text": "Uses Date to provide precise Time calculations for years, months, and days according to the proleptic Gregorian calendar. The result is returned as a new TimeWithZone object. The +options+ parameter takes a hash with any of these keys: :years, :months, :weeks, :days, :hours, :minutes, :seconds. If advancing by a value of variable length (i.e., years, weeks, months, days), move forward from #time, otherwise move forward from #utc, for accuracy when moving across DST boundaries. Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EDT -04:00 now.advance(seconds: 1) # => Sun, 02 Nov 2014 01:26:29 EDT -04:00 now.advance(minutes: 1) # => Sun, 02 Nov 2014 01:27:28 EDT -04:00 now.advance(hours: 1) # => Sun, 02 Nov 2014 01:26:28 EST -05:00 now.advance(days: 1) # => Mon, 03 Nov 2014 01:26:28 EST -05:00 now.advance(weeks: 1) # => Sun, 09 Nov 2014 01:26:28 EST -05:00 now.advance(months: 1) # => Tue, 02 Dec 2014 01:26:28 EST -05:00 now.advance(years: 1) # => Mon, 02 Nov 2015 01:26:28 EST -05:00", "label": 1, "domain": "code", "token_count": 386, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0425", "text": "Generates an instance of TypeInformation by parsing a type information string. A type information string can contain the following types:
    • Basic types such as Integer, String, etc.
    • Basic type arrays such as Integer[], String[], etc.
    • Tuple types such as Tuple1<TYPE0>, Tuple2<TYPE0, TYPE1>, etc.
    • Custom types such as org.my.CustomClass, org.my.CustomClass$StaticInnerClass, etc.
    • Custom type arrays such as org.my.CustomClass[], org.my.CustomClass$StaticInnerClass[], etc.
    • Value types such as DoubleValue, StringValue, IntegerValue, etc.
    • Tuple array types such as Tuple2[], etc.
    • Writable types such as Writable<org.my.CustomWritable>
    Example: \"Tuple2<String,Tuple2<Integer,org.my.MyClass>>\" @param infoString type information string to be parsed @return TypeInformation representation of the string", "label": 1, "domain": "code", "token_count": 328, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0426", "text": " Ensure that the list of targets specified by 'rolename' are allowed; this is determined by inspecting the 'delegations' field of the parent role of 'rolename'. If a target specified by 'rolename' is not found in the delegations field of 'metadata_object_of_parent', raise an exception. The top-level role 'targets' is allowed to list any target file, so this function does not raise an exception if 'rolename' is 'targets'. Targets allowed are either exlicitly listed under the 'paths' field, or implicitly exist under a subdirectory of a parent directory listed under 'paths'. A parent role may delegate trust to all files under a particular directory, including files in subdirectories, by simply listing the directory (e.g., '/packages/source/Django/', the equivalent of '/packages/source/Django/*'). Targets listed in hashed bins are also validated (i.e., its calculated path hash prefix must be delegated by the parent role). TODO: Should the TUF spec restrict the repository to one particular algorithm when calcutating path hash prefixes (currently restricted to SHA256)? Should we allow the repository to specify in the role dictionary the algorithm used for these generated hashed paths? rolename: The name of the role whose targets must be verified. This is a role name and should not end in '.json'. Examples: 'root', 'targets', 'targets/linux/x86'. list_of_targets: The targets of 'rolename', as listed in targets field of the 'rolename' metadata. 'list_of_targets' are target paths relative to the targets directory of the repository. The delegations of the parent role are checked to verify that the targets of 'list_of_targets' are valid. parent_delegations: The parent delegations of 'rolename'. The metadata object stores the allowed paths and path hash prefixes of child delegations in its 'delegations' attribute. securesystemslib.exceptions.FormatError: If any of the arguments are improperly formatted. securesystemslib.exceptions.ForbiddenTargetError: If the targets of 'metadata_role' are not allowed according to the parent's metadata file. The 'paths' and 'path_hash_prefixes' attributes are verified. securesystemslib.exceptions.RepositoryError: If the parent of 'rolename' has not made a delegation to 'rolename'. None. None.", "label": 1, "domain": "code", "token_count": 496, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0427", "text": "Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. @param resource_group_name [String] The name of the Azure resource group that contains the Data Lake Analytics account. @param account_name [String] The name of the Data Lake Analytics account for which to list Data Lake Store accounts. @param filter [String] OData filter. Optional. @param top [Integer] The number of items to return. Optional. @param skip [Integer] The number of items to skip over before returning elements. Optional. @param expand [String] OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. @param select [String] OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. @param orderby [String] OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. @param count [Boolean] The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. @param search [String] A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. @param format [String] The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [DataLakeAnalyticsAccountListDataLakeStoreResult] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 424, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0428", "text": "Constructs a WMS image layer. @alias WmsLayer @constructor @augments TiledImageLayer @classdesc Displays a WMS image layer. @param {{}} config Specifies configuration information for the layer. Must contain the following properties:
    • service: {String} The URL of the WMS server.
    • layerNames: {String} A comma separated list of the names of the WMS layers to include in this layer.
    • sector: {Sector} The sector spanned by this layer.
    • levelZeroDelta: {Location} The level-zero tile delta to use for this layer.
    • numLevels: {Number} The number of levels to make for this layer.
    • format: {String} The mime type of the image format to request, e.g., image/png.
    • size: {Number} The size in pixels of tiles for this layer.
    • coordinateSystem (optional): {String} The coordinate system to use for this layer, e.g., EPSG:4326.
    • styleNames (optional): {String} A comma separated list of the styles to include in this layer.
    The function [WmsLayer.formLayerConfiguration]{@link WmsLayer#formLayerConfiguration} will create an appropriate configuration object given a {@link WmsLayerCapabilities} object. @param {String} timeString The time parameter passed to the WMS server when imagery is requested. May be null, in which case no time parameter is passed to the server. @throws {ArgumentError} If the specified configuration is null or undefined.", "label": 1, "domain": "code", "token_count": 357, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0429", "text": "Initialize logging with the given configuration. As the given configuration will be cached internally the first invocation will take effect, only. Make sure to invoke this function at the very beginning of the program before other topics using logging get loaded. @param {Object} config - The logging configuration. @param {Object} config.logging - Contains the logging configuration for at least one winston container. A specific container configuration can be provided by defining a configuration for a category matching the topicName. A default configuration can provided by defining a container for the category \"default\". A container configuration contains at least one transport configuration. Note, you may run into an issue in strict mode, if you need to setup multiple transports of the same type, e.g., two file transports, as the strict mode inhibits duplicate object keys. In this case the transport name can be augmented with a \"#name\" postfix, e.g. \"file#debug\". @param {Object} [config.logging.[topicName]=default] - A specific container for a given topicName can be setup by providing a container configuration where the property name is equal to given topicName. The container configuration must contain at least one winston transport configuration. If the container configuration contains the key \"inheritDefault\" set to true, the default configuration will be mixed in. This way, it possible to solely define transport properties which shall differ from the default configuration. @param {Object} [config.logging.default=builtin] - Contains the default configuration applicable to loggers without a specific container configuration. The container configuration must contain at least one winston transport configuration. If no default configuration is provided a console transport configuration with winston builtin defaults will be used.", "label": 1, "domain": "code", "token_count": 340, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0430", "text": "Creates an instance of the RenderManager. Applications or controls must not call the RenderManager constructor on their own but should use the {@link sap.ui.core.Core#createRenderManager sap.ui.getCore().createRenderManager()} method to create an instance for their exclusive use. @class RenderManager that will take care for rendering Controls. For the default rendering task of UI5, a shared RenderManager is created and owned by sap.ui.core.Core. Controls or other code that want to render controls outside the default rendering task can create a private instance of RenderManager by calling the {@link sap.ui.core.Core#createRenderManager sap.ui.getCore().createRenderManager()} method. When such a private instance is no longer needed, it should be {@link #destroy destroyed}. Control renderers only have access to a subset of the public and protected instance methods of this class. The instance methods {@link #flush}, {@link #render} and {@link #destroy} are not part of that subset and are reserved to the owner of the corresponding RenderManager instance. Renderers will use the provided methods to create their HTML output. The RenderManager will collect the HTML output and inject the final HTML DOM at the desired location.

    Renderers

    When the {@link #renderControl} method of the RenderManager is invoked, it will retrieve the default renderer for that control. By convention, the default renderer is implemented in its own namespace (static class) which matches the name of the control's class with the additional suffix 'Renderer'. So for a control sap.m.Input the default renderer will be searched for under the global name sap.m.InputRenderer. @see sap.ui.core.Core @see sap.ui.getCore @extends Object @author SAP SE @version ${version} @alias sap.ui.core.RenderManager @public", "label": 1, "domain": "code", "token_count": 392, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0431", "text": "Checks if the database operations associated with two object envelopes that might have been related via an 1:1 (or n:1) reference before the current transaction needs to be performed in a particular order and if so builds and returns a corresponding directed edge weighted with POTENTIAL_EDGE_WEIGHT. The following cases are considered (* means object needs update, + means object needs insert, - means object needs to be deleted):
    Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10Concatenate 3 Observables
    (1)* -(1:1)-> (2)*no edge
    (1)* -(1:1)-> (2)+no edge
    (1)* -(1:1)-> (2)-(1)->(2) edge
    (1)+ -(1:1)-> (2)*no edge
    (1)+ -(1:1)-> (2)+no edge
    (1)+ -(1:1)-> (2)-no edge
    (1)- -(1:1)-> (2)*no edge
    (1)- -(1:1)-> (2)+no edge
    (1)- -(1:1)-> (2)-(1)->(2) edge
    @param vertex1 object envelope vertex of the object that might have hold the reference @param vertex2 object envelope vertex of the potentially referenced object @return an Edge object or null if the two database operations can be performed in any order", "label": 1, "domain": "code", "token_count": 421, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0432", "text": "PURPOSE Compute Friedman and Popescu's H statistic, in order to look for an interaction in the passed gradient-boosting model among the variables represented by the elements of the passed array or frame and specified by the passed indices or columns. See Jerome H. Friedman and Bogdan E. Popescu, 2008, \"Predictive learning via rule ensembles\", Ann. Appl. Stat. 2:916-954, http://projecteuclid.org/download/pdfview_1/euclid.aoas/1223908046, s. 8.1. ARGUMENTS gbm should be a scikit-learn gradient-boosting model (instance of sklearn.ensemble.GradientBoostingClassifier or sklearn.ensemble.GradientBoostingRegressor) that has been fitted to array_or_frame (and a target, not used here). array_or_frame should be a two-dimensional NumPy array or a pandas data frame (instance of numpy.ndarray or pandas .DataFrame). indices_or_columns is optional, with default value 'all'. It should be 'all' or a list of indices of columns of array_or_frame if array_or_frame is a NumPy array or a list of columns of array_or_frame if array_or_frame is a pandas data frame. If it is 'all', then all columns of array_or_frame are used. RETURNS The H statistic of the variables or NaN if the computation is spoiled by weak main effects and rounding errors. H varies from 0 to 1. The larger H, the stronger the evidence for an interaction among the variables. EXAMPLES Friedman and Popescu's (2008) formulas (44) and (46) correspond to h(F, x, [j, k]) and h(F, x, [j, k, l]) respectively. NOTES 1. Per Friedman and Popescu, only variables with strong main effects should be examined for interactions. Strengths of main effects are available as gbm.feature_importances_ once gbm has been fitted. 2. Per Friedman and Popescu, collinearity among variables can lead to interactions in gbm that are not present in the target function. To forestall such spurious interactions, check for strong correlations among variables before fitting gbm.", "label": 1, "domain": "code", "token_count": 458, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0433", "text": "This is an interface that can be implemented to provide custom token cache persistence. @public @class TokenCache @property {ModifyCacheFunction} add Called by ADAL when entries should be added to the cache. @property {ModifyCacheFunction} remove Called by ADAL when entries should be removed from the cache. @property {FindCacheFunction} find Called when ADAL needs to find entries in the cache. Creates a new AuthenticationContext object. By default the authority will be checked against a list of known Azure Active Directory authorities. If the authority is not recognized as one of these well known authorities then token acquisition will fail. This behavior can be turned off via the validateAuthority parameter below. @constructor @param {string} authority A URL that identifies a token authority. @param {bool} [validateAuthority] Turns authority validation on or off. This parameter default to true. @param {TokenCache} [cache] Sets the token cache used by this AuthenticationContext instance. If this parameter is not set then a default, in memory cache is used. The default in memory cache is global to the process and is shared by all AuthenticationContexts that are created with an empty cache parameter. To control the scope and lifetime of a cache you can either create a {@link MemoryCache} instance and pass it when constructing an AuthenticationContext or implement a custom {@link TokenCache} and pass that. Cache instances passed at AuthenticationContext construction time are only used by that instance of the AuthenticationContext and are not shared unless it has been manually passed during the construction of other AuthenticationContexts.", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0434", "text": "Build a set of embedding sequences from given time series X with lag Tau and embedding dimension DE. Let X = [x(1), x(2), ... , x(N)], then for each i such that 1 < i < N - (D - 1) * Tau, we build an embedding sequence, Y(i) = [x(i), x(i + Tau), ... , x(i + (D - 1) * Tau)]. All embedding sequence are placed in a matrix Y. Parameters ---------- X list a time series Tau integer the lag or delay when building embedding sequence D integer the embedding dimension Returns ------- Y 2-D list embedding matrix built Examples --------------- >>> import pyeeg >>> a=range(0,9) >>> pyeeg.embed_seq(a,1,4) array([[ 0., 1., 2., 3.], [ 1., 2., 3., 4.], [ 2., 3., 4., 5.], [ 3., 4., 5., 6.], [ 4., 5., 6., 7.], [ 5., 6., 7., 8.]]) >>> pyeeg.embed_seq(a,2,3) array([[ 0., 2., 4.], [ 1., 3., 5.], [ 2., 4., 6.], [ 3., 5., 7.], [ 4., 6., 8.]]) >>> pyeeg.embed_seq(a,4,1) array([[ 0.], [ 1.], [ 2.], [ 3.], [ 4.], [ 5.], [ 6.], [ 7.], [ 8.]])", "label": 1, "domain": "code", "token_count": 373, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0435", "text": "

    Perform am URI query parameter (name or value) escape operation on a String input.

    The following are the only allowed chars in an URI query parameter (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ ' ( ) * , ;
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the String to be escaped. @param encoding the encoding to be used for escaping. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 316, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0436", "text": "Compares the contents of the two arrays array and prefix. Returns
    • zero if the array starts with the prefix contents
    • the difference between the first two characters that are not equal
    • one if array length is lower than the prefix length and that the prefix starts with the array contents.

    For example:

    1.  array = null prefix = null => result = NullPointerException 
    2.  array = { 'a', 'b', 'c', 'd', 'e' } prefix = { 'a', 'b', 'c'} => result = 0 
    3.  array = { 'a', 'b', 'c', 'd', 'e' } prefix = { 'a', 'B', 'c'} => result = 32 
    4.  array = { 'd', 'b', 'c', 'd', 'e' } prefix = { 'a', 'b', 'c'} => result = 3 
    5.  array = { 'a', 'b', 'c', 'd', 'e' } prefix = { 'd', 'b', 'c'} => result = -3 
    6.  array = { 'a', 'a', 'c', 'd', 'e' } prefix = { 'a', 'e', 'c'} => result = -4 

    @param array the given array @param prefix the given prefix @return the result of the comparison (>=0 if array>prefix) @throws NullPointerException if either array or prefix is null", "label": 1, "domain": "code", "token_count": 402, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0437", "text": "

    Perform a (configurable) JavaScript escape operation on a char[] input.

    This method will perform an escape operation according to the specified {@link org.unbescape.javascript.JavaScriptEscapeType} and {@link org.unbescape.javascript.JavaScriptEscapeLevel} argument values.

    All other char[]-based escapeJavaScript*(...) methods call this one with preconfigured type and level values.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param type the type of escape operation to be performed, see {@link org.unbescape.javascript.JavaScriptEscapeType}. @param level the escape level to be applied, see {@link org.unbescape.javascript.JavaScriptEscapeLevel}. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 303, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0438", "text": "Trigger events on elements with data @param {(string|Array|NodeList|HTMLCollection|EventTarget)} elements - The iterable, selector or elements. @param {string} events - The events that should be tiggered seperated with spaces @param {Object} data - The events' data @return {Array} iterable - The getElements' result for chaining. @example //esnext import { createElement, append, on, trigger } from 'chirashi' const maki = createElement('a.cheese.maki') const sushi = createElement('a.wasabi.sushi') append(document.body, [maki, sushi]) const listener = on('.cheese, .wasabi', { click(e, target) => { console.log('clicked', target) } }) trigger(maki, 'click') //simulate user's click // LOGS: \"clicked\" trigger(sushi, 'click') //simulate user's click // LOGS: \"clicked\" @example //es5 var listener = Chirashi.bind('.cheese, .wasabi', { 'click': function (e, target) { console.log('clicked', target) } }) var maki = Chirashi.createElement('a.cheese.maki') var sushi = Chirashi.createElement('a.wasabi.sushi') Chirashi.append(document.body, [maki, sushi]) Chirashi.trigger(maki, 'click') //simulate user's click // LOGS: \"clicked\" Chirashi.trigger(sushi, 'click') //simulate user's click // LOGS: \"clicked\" ", "label": 1, "domain": "code", "token_count": 369, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0439", "text": "Parses a string containing a natural language date or time. If the parser can find a date or time, either a Time or Chronic::Span will be returned (depending on the value of :guess). If no date or time can be found, +nil+ will be returned. Options are: [:context] :past or :future (defaults to :future) If your string represents a birthday, you can set :context to :past and if an ambiguous string is given, it will assume it is in the past. Specify :future or omit to set a future context. [:now] Time (defaults to Time.now) By setting :now to a Time, all computations will be based off of that time instead of Time.now [:guess] +true+ or +false+ (defaults to +true+) By default, the parser will guess a single point in time for the given date or time. If you'd rather have the entire time span returned, set :guess to +false+ and a Chronic::Span will be returned. [:ambiguous_time_range] Integer or :none (defaults to 6 (6am-6pm)) If an Integer is given, ambiguous times (like 5:00) will be assumed to be within the range of that time in the AM to that time in the PM. For example, if you set it to 7, then the parser will look for the time between 7am and 7pm. In the case of 5:00, it would assume that means 5:00pm. If :none is given, no assumption will be made, and the first matching instance of that time will be used.", "label": 1, "domain": "code", "token_count": 418, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0440", "text": "The type.parse() method converts an Argument into a value, Conversion is a wrapper to that value. Conversion is needed to collect a number of properties related to that conversion in one place, i.e. to handle errors and provide traceability. @param value The result of the conversion @param arg The data from which the conversion was made @param status See the Status values [VALID|INCOMPLETE|ERROR] defined above. The default status is Status.VALID. @param message If status=ERROR, there should be a message to describe the error. A message is not needed unless for other statuses, but could be present for any status including VALID (in the case where we want to note a warning, for example). See BUG 664676: GCLI conversion error messages should be localized @param predictions If status=INCOMPLETE, there could be predictions as to the options available to complete the input. We generally expect there to be about 7 predictions (to match human list comprehension ability) however it is valid to provide up to about 20, or less. It is the job of the predictor to decide a smart cut-off. For example if there are 4 very good matches and 4 very poor ones, probably only the 4 very good matches should be presented. The predictions are presented either as an array of prediction objects or as a function which returns this array when called with no parameters. Each prediction object has the following shape: { name: '...', // textual completion. i.e. what the cli uses value: { ... }, // value behind the textual completion incomplete: true // this completion is only partial (optional) } The 'incomplete' property could be used to denote a valid completion which could have sub-values (e.g. for tree navigation).", "label": 1, "domain": "code", "token_count": 358, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0441", "text": "Retrieves a user's profile via the [User Profile API](https://developers.facebook.com/docs/messenger-platform/identity/user-profile). @param {Integer} psid A valid user PSID. @param {Array} fields _Optional._ An array list of the user profile filds to retrieve. For a list of available fields, see the {@link https://developers.facebook.com/docs/messenger-platform/identity/user-profile#fields|Messenger Platform docs}. @return {Promise} The API response @memberof Client# @example let profile_fields = [ 'id', 'first_name', 'last_name', 'profile_pic', 'locale', ]; Client.getUserProfile('490730697356', profile_fields) .then(res => { console.log(res); // { // \"first_name\": \"Peter\", // \"last_name\": \"Chang\", // \"profile_pic\": \"https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/v/t1.0-1/p200x200/13055603_10105219398495383_8237637584159975445_n.jpg?oh=1d241d4b6d4dac50eaf9bb73288ea192&oe=57AF5C03&__gda__=1470213755_ab17c8c8e3a0a447fed3f272fa2179ce\", // \"locale\": \"en_US\", // } });", "label": 1, "domain": "code", "token_count": 302, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0442", "text": "The API returns a list of recognized entities in a given document. The API returns a list of recognized entities in a given document. To get even more information on each recognized entity we recommend using the Bing Entity Search API by querying for the recognized entities names. See the Supported languages in Text Analytics API for the list of enabled languages.The API returns a list of known entities and general named entities (\"Person\", \"Location\", \"Organization\" etc) in a given document. Known entities are returned with Wikipedia Id and Wikipedia link, and also Bing Id which can be used in Bing Entity Search API. General named entities are returned with entity types. If a general named entity is also a known entity, then all information regarding it (Wikipedia Id, Bing Id, entity type etc) will be returned. See the Supported Entity Types in Text Analytics API for the list of supported Entity Types. See the Supported languages in Text Analytics API for the list of enabled languages. @param input [MultiLanguageBatchInput] Collection of documents to analyze. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [EntitiesBatchResultV2dot1] operation results.", "label": 1, "domain": "code", "token_count": 340, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0443", "text": "Find the possible parameters and \"global\" variables from a python code. This is achieved by parsing the abstract syntax tree. Parameters ---------- code : str Input code as string. exclude_variable : set, None, optional Variable to exclude. jsonable_parameter: bool, True, optional Consider only jsonable parameter Returns ------- tuple (a set of possible parameter, a set of parameter to exclude, a dictionary of possible parameter ) A variable is a possible parameter if 1) it is not in the input exclude_variable, 2) the code contains only assignments, and 3) it is used only to bound objects. The set of parameter to exclude is the union of the input exclude_variable and all names that looks like a global variable. The dictionary of possible parameter {parameter name, parameter value} is available only if jsonable_parameter is True. >>> variable_status(\"a=3\") ({'a'}, {'a'}, {'a': 3}) >>> variable_status(\"a=3\",jsonable_parameter=False) ({'a'}, {'a'}, {}) >>> variable_status(\"a += 1\") (set(), {'a'}, {}) >>> variable_status(\"def f(x,y=3):\\\\n\\\\t pass\") (set(), {'f'}, {}) >>> variable_status(\"class C(A):\\\\n\\\\t pass\") (set(), {'C'}, {}) >>> variable_status(\"import f\") (set(), {'f'}, {}) >>> variable_status(\"import f as g\") (set(), {'g'}, {}) >>> variable_status(\"from X import f\") (set(), {'f'}, {}) >>> variable_status(\"from X import f as g\") (set(), {'g'}, {})", "label": 1, "domain": "code", "token_count": 336, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0444", "text": "Copies all the properties of s to r. @method @param {Object} r the augmented object @param {Object} s the object need to augment @param {Boolean|Object} [ov=true] whether overwrite existing property or config. @param {Boolean} [ov.overwrite=true] whether overwrite existing property. @param {String[]|Function} [ov.whitelist] array of white-list properties @param {Boolean}[ov.deep=false] whether recursive mix if encounter object. @param {String[]|Function} [wl] array of white-list properties @param [deep=false] {Boolean} whether recursive mix if encounter object. @return {Object} the augmented object @member KISSY @example var t = {}; util.mix({x: {y: 2, z: 4}}, {x: {y: 3, a: t}}, {deep: true}) => {x: {y: 3, z: 4, a: {}}}, a !== t util.mix({x: {y: 2, z: 4}}, {x: {y: 3, a: t}}, {deep: true, overwrite: false}) => {x: {y: 2, z: 4, a: {}}}, a !== t util.mix({x: {y: 2, z: 4}}, {x: {y: 3, a: t}}, 1) => {x: {y: 3, a: t}}", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0445", "text": "Return a new array which is the split of the given array using the given divider and triming each subarray to remove whitespaces equals to ' '.

    For example:
    1.  divider = 'b' array = { 'a' , 'b', 'b', 'a', 'b', 'a' } result => { { 'a' }, { }, { 'a' }, { 'a' } } 
    2.  divider = 'c' array = { 'a' , 'b', 'b', 'a', 'b', 'a' } result => { { 'a', 'b', 'b', 'a', 'b', 'a' } } 
    3.  divider = 'b' array = { 'a' , ' ', 'b', 'b', 'a', 'b', 'a' } result => { { 'a' }, { }, { 'a' }, { 'a' } } 
    4.  divider = 'c' array = { ' ', ' ', 'a' , 'b', 'b', 'a', 'b', 'a', ' ' } result => { { 'a', 'b', 'b', 'a', 'b', 'a' } } 
    @param divider the given divider @param array the given array @return a new array which is the split of the given array using the given divider and triming each subarray to remove whitespaces equals to ' '", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0446", "text": "Causes the current thread to wait until {@code count} reaches zero, unless the thread is {@linkplain Thread#interrupt interrupted}, or the specified waiting time elapses.

    If the current {@code count} is zero, then this method returns immediately with the value {@code true}.

    If the current {@code count} is greater than zero, then the current thread becomes disabled for thread scheduling purposes and lies dormant until either:

    • The {@code count} reaches zero due to an invocation of {@link #countDown countDown()}, {@link #countDown(int) countDown(int}}, or {@link * setCount(int) setCount(int)}
    • Some other thread {@linkplain Thread#interrupt interrupts} the current thread
    • The specified waiting time elapses.
    If the count reaches zero then the method returns with the value {@code true}.

    If the current thread:

    • has its interrupted status set on entry to this method; or
    • is {@linkplain Thread#interrupt interrupted} while waiting,
    then {@link InterruptedException} is thrown and the current thread's interrupted status is cleared.

    If the specified waiting time elapses then the value {@code false} is returned. If the time is less than or equal to zero, the method will not wait at all. @param timeout the maximum time to wait @param unit the time unit of the {@code timeout} argument @return {@code true} if the count reached zero and {@code false} if the waiting time elapsed before the count reached zero @throws InterruptedException if the current thread is interrupted while waiting", "label": 1, "domain": "code", "token_count": 345, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0447", "text": "Gets the Service Fabric service backup configuration information. Gets the Service Fabric backup configuration information for the service and the partitions under this service. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 404, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0448", "text": "/*[deutsch]

    Legt einen Standard-Ersatzwert für das angegebene Element fest, wenn die Interpretation sonst nicht funktioniert.

    Beispiel:

     ChronoFormatter<PlainDate> fmt = ChronoFormatter.ofDatePattern("MM-dd", PatternType.CLDR, Locale.getDefault()) .withDefault(PlainDate.YEAR, 2012); PlainDate date = fmt.parse("05-21"); System.out.println(date); // 2012-05-21 

    Standard-Ersatzwerte werden von Time4J herangezogen, wenn entweder der Formatierer das fragliche Element nicht enthält oder wenn es keine konsumierbaren Zeichen für das angegebene Element gibt. Die letzte Situation erfordert manchmal die Verwendung des sektionalen Attributs {@code PROTECTED_CHARACTERS}, um eine Situation zu simulieren, in der der Formatierer quasi am Ende eines Texts angekommen ist.

    @param generic element value type @param element chronological element to be updated @param value replacement value or {@code null} if the default value shall be deregistered @return changed copy with new replacement value @throws IllegalArgumentException if given element is not supported by the underlying chronology @see Attributes#PROTECTED_CHARACTERS", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0449", "text": "Callback after screen is displayed. @callback PostDisplayHookCallback @param {Object} viewState ViewState. A single help screen, which is expected to be used in a sequence of screens (HelpSequence). It is positioned near the element it's explaining, usually pointing to it, and gives an indication of how far along in the HelpSequence this screen is. @alias HelpScreen @constructor @param {Object} [options] Object with the following properties: @param {Function} options.onNext The function to invoke when the user wants to go to next screen. @param {String} options.message Gets or sets the html formatted message displayed on the help screen. @param {String} options.highlightedComponentId Class name of component that should be highlighted. @param {Object} [options.rectangle] DOMRect rectangle for element help is describing. @param {PreDisplayHookCallback} [options.preDisplayHook] Gets or sets a callback that is invoked before the screen is displayed. @param {PostDisplayHookCallback} [options.postDisplayHook] Gets or sets a callback that is invoked after the screen is displayed. @param {Number} [options.currentScreenNumber=0] The screen that this represents, e.g. the second in a series (zero indexed). @param {Number} [options.totalNumberOfScreens=0] Number of screens in this help series. @param {RelativePosition} [options.positionLeft=0] Left position relative to rectangle. @param {RelativePosition} [options.positionTop=0] Top position relative to rectangle. @param {Number} [options.offsetLeft=0] How many pixels from left position relative to rectangle to shift help screen. @param {Number} [options.offsetTop=0] How many pixels from top position relative to rectangle to shift help screen. @param {Number} [options.width=300] Width of help screen in pixels. @param {Number} [options.caretTop=-5] Top position of the caret in pixels. @param {Number} [options.caretLeft=-5] Left position of the caret in pixels.", "label": 1, "domain": "code", "token_count": 427, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0450", "text": "/* public Interval getMaxInterval(HashMap tls) { Vector startTimes = new Vector(); Vector endTimes = new Vector(); for (Constraint con : this.constraintNetwork.getConstraints()) { if (con instanceof FuzzyAllenIntervalConstraint) { FuzzyAllenIntervalConstraint fc = (FuzzyAllenIntervalConstraint)con; FuzzyActivity act = (FuzzyActivity)fc.getTo(); SimpleTimeline tl = tls.get(act.getComponent()); long start = tl.getStart(act); long end = tl.getEnd(act); if (fc.containsType(FuzzyAllenIntervalConstraint.Type.After) || fc.containsType(FuzzyAllenIntervalConstraint.Type.MetBy)) { startTimes.add(end); } else if (fc.containsType(FuzzyAllenIntervalConstraint.Type.OverlappedBy) || fc.containsType(FuzzyAllenIntervalConstraint.Type.During) || fc.containsType(FuzzyAllenIntervalConstraint.Type.Equals) || fc.containsType(FuzzyAllenIntervalConstraint.Type.FinishedBy) || fc.containsType(FuzzyAllenIntervalConstraint.Type.Starts) || fc.containsType(FuzzyAllenIntervalConstraint.Type.StartedBy) ) { startTimes.add(start); } if (fc.containsType(FuzzyAllenIntervalConstraint.Type.Meets) || fc.containsType(FuzzyAllenIntervalConstraint.Type.Before)) { endTimes.add(start); } else if (fc.containsType(FuzzyAllenIntervalConstraint.Type.Overlaps) || fc.containsType(FuzzyAllenIntervalConstraint.Type.During) || fc.containsType(FuzzyAllenIntervalConstraint.Type.Equals) || fc.containsType(FuzzyAllenIntervalConstraint.Type.FinishedBy) || fc.containsType(FuzzyAllenIntervalConstraint.Type.Finishes) || fc.containsType(FuzzyAllenIntervalConstraint.Type.StartedBy)) { endTimes.add(end); } } } long minStart, maxEnd; try { minStart = Collections.max(startTimes); } catch (NoSuchElementException e) { minStart = 0; } try { maxEnd = Collections.min(endTimes); } catch (NoSuchElementException e) { maxEnd = APSPSolver.INF; } return new Interval(null, minStart, maxEnd); }", "label": 1, "domain": "code", "token_count": 432, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0451", "text": "Enables periodic backup of stateful partitions under this Service Fabric service. Enables periodic backup of stateful partitions which are part of this Service Fabric service. Each partition is backed up individually as per the specified backup policy description. In case the application, which the service is part of, is already enabled for backup then this operation would override the policy being used to take the periodic backup for this service and its partitions (unless explicitly overridden at the partition level). Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param enable_backup_description [EnableBackupDescription] Specifies the parameters for enabling backup. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 300, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0452", "text": "Destructively modifies this Collection<TypedDependency> by collapsing several types of transitive pairs of dependencies.
    prepositional object dependencies: pobj
    prep(cat, in) and pobj(in, hat) are collapsed to prep_in(cat, hat)
    prepositional complement dependencies: pcomp
    prep(heard, of) and pcomp(of, attacking) are collapsed to prepc_of(heard, attacking)
    conjunct dependencies
    cc(investors, and) and conj(investors, regulators) are collapsed to conj_and(investors,regulators)
    possessive dependencies: possessive
    possessive(Montezuma, 's) will be erased. This is like a collapsing, but due to the flatness of NPs, two dependencies are not actually composed.
    For relative clauses, it will collapse referent
    ref(man, that) and dobj(love, that) are collapsed to dobj(love, man)
    ", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0453", "text": "@example Request syntax with placeholder values policy = iam.create_policy({ policy_name: \"policyNameType\", # required path: \"policyPathType\", policy_document: \"policyDocumentType\", # required description: \"policyDescriptionType\", }) @param [Hash] options ({}) @option options [required, String] :policy_name The friendly name of the policy. This parameter allows (through its [regex pattern][1]) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: \\_+=,.@- [1]: http://wikipedia.org/wiki/regex @option options [String] :path The path for the policy. For more information about paths, see [IAM Identifiers][1] in the *IAM User Guide*. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its [regex pattern][2]) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\\\\u0021) through the DEL character (\\\\u007F), including most punctuation characters, digits, and upper and lowercased letters. [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html [2]: http://wikipedia.org/wiki/regex @option options [required, String] :policy_document The JSON policy document that you want to use as the content for the new policy. The [regex pattern][1] used to validate this parameter is a string of characters consisting of the following: * Any printable ASCII character ranging from the space character (\\\\u0020) through the end of the ASCII character range * The printable characters in the Basic Latin and Latin-1 Supplement character set (through \\\\u00FF) * The special characters tab (\\\\u0009), line feed (\\\\u000A), and carriage return (\\\\u000D) [1]: http://wikipedia.org/wiki/regex @option options [String] :description A friendly description of the policy. Typically used to store information about the permissions defined in the policy. For example, \"Grants access to production DynamoDB tables.\" The policy description is immutable. After a value is assigned, it cannot be changed. @return [Policy]", "label": 1, "domain": "code", "token_count": 489, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0454", "text": "Gets the list of nodes in the Service Fabric cluster. The response includes the name, status, ID, health, uptime, and other details about the nodes. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non-empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results, then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param node_status_filter [NodeStatusFilter] Allows filtering the nodes based on the NodeStatus. Only the nodes that are matching the specified filter value will be returned. The filter value can be one of the following. Possible values include: 'default', 'all', 'up', 'down', 'enabling', 'disabling', 'disabled', 'unknown', 'removed' @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged query includes as many results as possible that fit in the return message. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PagedNodeInfoList] operation results.", "label": 1, "domain": "code", "token_count": 383, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0455", "text": "Appends each node to a parent node. @param {(string|Array|NodeList|HTMLCollection|Node)} element - The parent node. Note that it'll be passed to getElement to ensure there's only one. @param {(string|Array.<(string|Node)>|Node)} nodes - String, node or array of nodes and/or strings. Each string will be passed to createElement then append. @return {(Node|boolean)} node - The node for chaining or false if nodes can't be appended. @example //esnext import { createElement, append } from 'chirashi' const maki = createElement('.maki') append(maki, '.salmon[data-fish=\"salmon\"]') //returns:
    const avocado = createElement('.avocado') append(maki, [avocado, '.cheese[data-cheese=\"cream\"]']) //returns:
    @example //es5 var maki = Chirashi.createElement('.maki') Chirashi.append(maki, '.salmon[data-fish=\"salmon\"]') //returns:
    var avocado = Chirashi.createElement('.avocado') Chirashi.append(maki, [avocado, '.cheese[data-cheese=\"cream\"]']) //returns:
    ", "label": 1, "domain": "code", "token_count": 391, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0456", "text": "Create temporally upsampled neural time courses. Parameters ---------- aryMdlRsp : 2d numpy array, shape [n_x_pos * n_y_pos * n_sd, n_cond] Responses of 2D Gauss models to spatial conditions. aryCnd : np.array 1D array with condition identifiers (every condition has its own int) aryOns : np.array, same len as aryCnd 1D array with condition onset times in seconds. aryDrt : np.array, same len as aryCnd 1D array with condition durations of different conditions in seconds. varTr : float, positive Time to repeat (TR) of the (fMRI) experiment varNumVol : float, positive Number of data point (volumes) in the (fMRI) data varTmpOvsmpl : float, positive Factor by which the time courses should be temporally upsampled. lgcPrint: boolean, default True Should print messages be sent to user? Returns ------- aryNrlTc : 2d numpy array, shape [n_x_pos * n_y_pos * n_sd, varNumVol*varTmpOvsmpl] Neural time course models in temporally upsampled space Notes --------- [1] This function first creates boxcar functions based on the conditions as they are specified in the temporal experiment information, provided by the user in the csv file. Second, it then replaces the 1s in the boxcar function by predicted condition values that were previously calculated based on the overlap between the assumed 2D Gaussian for the current model and the presented stimulus aperture for that condition. Since the 2D Gaussian is normalized, the overlap value will be between 0 and 1.", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0457", "text": "Start with existing locationUrl or inline entries results in a playback. If the file does not exist, XMLHttpRequests are not faked and the recording starts. @param {string|Array} locationUrl Specifies from which location the file is loaded. If it is not found, the recording is started. The provided filename is the name of the output har file. This parameter can be the entries array for overloading the function. @param {object} [options] Contains optional parameters to config the RequestRecorder: {boolean|object} [options.delay] If a the parameter is equals true, the recorded delay timings are used, instead of the default delay equals zero. If a map as parameter is used, the delay is calculated with the delaysettings in the object. Possible settings are max, min, offset, factor. {function} [options.customGroupNameCallback] A callback is used to determine the custom groupname of the current XMLHttpRequest. If the callback returns a falsy value, the default groupname is used. {boolean} [options.disableDownload] Set this flag to true if you don´t want to download the recording after the recording is finished. This parameter is only used for testing purposes. {boolean} [options.promptForDownloadFilename] Activates a prompt popup after stop is called to enter a desired filename. {array|RegExp} [options.entriesUrlFilter] A list of regular expressions, if it matches the URL the request-entry is filtered. array|object} [options.entriesUrlReplace] A list of objects with regex and value to replace. E.g.: \"{ regex: new RegExp(\"RegexToSearchForInUrl\"), \"value\": \"newValueString\" }\"", "label": 1, "domain": "code", "token_count": 341, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0458", "text": "Return queryset of objects from SearchQuery.results, **in order**. EXPERIMENTAL: this will only work with results from a single index, with a single doc_type - as we are returning a single QuerySet. This method takes the hits JSON and converts that into a queryset of all the relevant objects. The key part of this is the ordering - the order in which search results are returned is based on relevance, something that only ES can calculate, and that cannot be replicated in the database. It does this by adding custom SQL which annotates each record with the score from the search 'hit'. This is brittle, caveat emptor. The RawSQL clause is in the form: SELECT CASE {{model}}.id WHEN {{id}} THEN {{score}} END The \"WHEN x THEN y\" is repeated for every hit. The resulting SQL, in full is like this: SELECT \"freelancer_freelancerprofile\".\"id\", (SELECT CASE freelancer_freelancerprofile.id WHEN 25 THEN 1.0 WHEN 26 THEN 1.0 [...] ELSE 0 END) AS \"search_score\" FROM \"freelancer_freelancerprofile\" WHERE \"freelancer_freelancerprofile\".\"id\" IN (25, 26, [...]) ORDER BY \"search_score\" DESC It should be very fast, as there is no table lookup, but there is an assumption at the heart of this, which is that the search query doesn't contain the entire database - i.e. that it has been paged. (ES itself caps the results at 10,000.)", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0459", "text": "Compute intersection between an OBB and a capsule. @param centerx is the center point of the oriented box. @param centery is the center point of the oriented box. @param centerz is the center point of the oriented box. @param axis1x are the unit vectors of the oriented box axis. @param axis1y are the unit vectors of the oriented box axis. @param axis1z are the unit vectors of the oriented box axis. @param axis2x are the unit vectors of the oriented box axis. @param axis2y are the unit vectors of the oriented box axis. @param axis2z are the unit vectors of the oriented box axis. @param axis3x are the unit vectors of the oriented box axis. @param axis3y are the unit vectors of the oriented box axis. @param axis3z are the unit vectors of the oriented box axis. @param extentAxis1 are the sizes of the oriented box. @param extentAxis2 are the sizes of the oriented box. @param extentAxis3 are the sizes of the oriented box. @param capsule1Ax x coordinate of the first point of the capsule medial line. @param capsule1Ay y coordinate of the first point of the capsule medial line. @param capsule1Az z coordinate of the first point of the capsule medial line. @param capsule1Bx x coordinate of the second point of the capsule medial line. @param capsule1By y coordinate of the second point of the capsule medial line. @param capsule1Bz z coordinate of the second point of the capsule medial line. @param capsule1Radius - capsule radius @return true if intersecting, otherwise false", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0460", "text": "

    Perform a CSS String level 1 (only basic set) escape operation on a String input, writing results to a Writer.

    Level 1 means this method will only escape the CSS String basic escape set:

    • The Backslash Escapes: \" (U+0022) and \' (U+0027).
    • Two ranges of non-displayable, control characters: U+0000 to U+001F and U+007F to U+009F.

    This escape will be performed by using Backslash escapes whenever possible. For escaped characters that do not have an associated Backslash, default to \FF Hexadecimal Escapes.

    This method calls {@link #escapeCssString(String, Writer, CssStringEscapeType, CssStringEscapeLevel)} with the following preconfigured values:

    • type: {@link CssStringEscapeType#BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA}
    • level: {@link CssStringEscapeLevel#LEVEL_1_BASIC_ESCAPE_SET}

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 432, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0461", "text": "Takes string input of IP address to issue RESTUL call to HP IMC :param ip_address: string object of dotted decimal notation of IPv4 address :return: dictionary of device details >>> get_dev_details('10.101.0.1') {'symbolLevel': '2', 'typeName': 'Cisco 2811', 'location': 'changed this too', 'status': '1', 'sysName': 'Cisco2811.haw.int', 'id': '30', 'symbolType': '3', 'symbolId': '1032', 'sysDescription': '', 'symbolName': 'Cisco2811.haw.int', 'mask': '255.255.255.0', 'label': 'Cisco2811.haw.int', 'symbolDesc': '', 'sysOid': '1.3.6.1.4.1.9.1.576', 'contact': 'changed this too', 'statusDesc': 'Normal', 'parentId': '1', 'categoryId': '0', 'topoIconName': 'iconroute', 'mac': '00:1b:d4:47:1e:68', 'devCategoryImgSrc': 'router', 'link': {'@rel': 'self', '@href': 'http://10.101.0.202:8080/imcrs/plat/res/device/30', '@op': 'GET'}, 'ip': '10.101.0.1'} >>> get_dev_details('8.8.8.8') Device not found 'Device not found'", "label": 1, "domain": "code", "token_count": 322, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0462", "text": "Finds a single document via findAndModify and updates it, returning the original doc unless otherwise specified. @example Find a document and update it, returning the original. collection.find_one_and_update({ name: 'test' }, { \"$set\" => { name: 'test1' }}) @example Find a document and update it, returning the updated document. collection.find_one_and_update({ name: 'test' }, { \"$set\" => { name: 'test1' }}, :return_document => :after) @param [ Hash ] filter The filter to use. @param [ BSON::Document ] update The update statement. @param [ Hash ] options The options. @option options [ Integer ] :max_time_ms The maximum amount of time to allow the command to run in milliseconds. @option options [ Hash ] :projection The fields to include or exclude in the returned doc. @option options [ Hash ] :sort The key and direction pairs by which the result set will be sorted. @option options [ Symbol ] :return_document Either :before or :after. @option options [ true, false ] :upsert Whether to upsert if the document doesn't exist. @option options [ true, false ] :bypass_document_validation Whether or not to skip document level validation. @option options [ Hash ] :write_concern The write concern options. Defaults to the collection's write concern. @option options [ Hash ] :collation The collation to use. @option options [ Array ] :array_filters A set of filters specifying to which array elements an update should apply. @option options [ Session ] :session The session to use. @return [ BSON::Document ] The document. @since 2.1.0", "label": 1, "domain": "code", "token_count": 356, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0463", "text": "Checks if the database operations associated with two object envelopes that might have been related via an m:n collection reference before the current transaction needs to be performed in a particular order and if so builds and returns a corresponding directed edge weighted with POTENTIAL_EDGE_WEIGHT. The following cases are considered (* means object needs update, + means object needs insert, - means object needs to be deleted):
    (1)* -(m:n)-> (2)*no edge
    (1)* -(m:n)-> (2)+no edge
    (1)* -(m:n)-> (2)-(1)->(2) edge
    (1)+ -(m:n)-> (2)*no edge
    (1)+ -(m:n)-> (2)+no edge
    (1)+ -(m:n)-> (2)-no edge
    (1)- -(m:n)-> (2)*no edge
    (1)- -(m:n)-> (2)+no edge
    (1)- -(m:n)-> (2)-(1)->(2) edge
    @param vertex1 object envelope vertex of the object holding the collection @param vertex2 object envelope vertex of the object that might have been contained in the collection @return an Edge object or null if the two database operations can be performed in any order", "label": 1, "domain": "code", "token_count": 408, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0464", "text": "Get users. Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters. @param aioId A unique ID generated on the client (browser) when sending an API request that returns an asynchronous response. (required) @param limit Limit the number of users the Provisioning API should return. (optional) @param offset The number of matches the Provisioning API should skip in the returned users. (optional) @param order The sort order. (optional) @param sortBy A comma-separated list of fields to sort on. Possible values are firstName, lastName, and userName. (optional) @param filterName The name of a filter to use on the results. (optional) @param filterParameters A part of the users first or last name, if you use the FirstNameOrLastNameMatches filter. (optional) @param roles Return only return users who have these Workspace Web Edition roles. The roles can be specified in a comma-separated list. Possible values are ROLE_AGENT and ROLE_ADMIN,ROLE_SUPERVISOR. (optional) @param skills Return only users who have these skills. The skills can be specified in a comma-separated list. (optional) @param userEnabled Return only enabled or disabled users. (optional) @param userValid Return only valid or invalid users. (optional) @return ApiResponse<ApiAsyncSuccessResponse> @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0465", "text": "Install this package via the jamf binary 'install' command from the distribution point for this machine. See {JSS::DistributionPoint.my_distribution_point} @note This code must be run as root to install packages The read-only or http passwd for the dist. point must be provided, except for non-authenticated http downloads) @param args[Hash] the arguments for installation @option args :ro_pw[String] the read-only or http password for the distribution point for the local machine (http will be used if available, and may not need a pw) @option args :target[String,Pathname] The drive on which to install the package, defaults to '/' @option args :verbose [Boolean] be verbose to stdout, defaults to false @option args :feu[Boolean] fill existing users, defaults to false @option args :fut[Boolean] fill user template, defaults to false @option args :unmount[Boolean] unmount the distribution point when finished?(if we mounted it), defaults to false @option args :no_http[Boolean] don't use http downloads even if they are enabled for the dist. point. @option args :alt_download_url [String] Use this url for an http download, regardless of distribution point settings. This can be used to access Cloud Distribution Points if the fileshare isn't available. The URL should already be ur The package filename will be removed or appended as needed. @return [Boolean] did the jamf install succeed? @todo deal with cert-based https authentication in dist points", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0466", "text": ">>> lc = LogCollector('file=/path/to/file.log:formatter=logagg.formatters.basescript', 30) >>> incomplete_log = {'data' : {'x' : 1, 'y' : 2}, ... 'raw' : 'Not all keys present'} >>> lc.validate_log_format(incomplete_log) 'failed' >>> redundant_log = {'one_invalid_key' : 'Extra information', ... 'data': {'x' : 1, 'y' : 2}, ... 'error': False, ... 'error_tb': '', ... 'event': 'event', ... 'file': '/path/to/file.log', ... 'formatter': 'logagg.formatters.mongodb', ... 'host': 'deepcompute-ThinkPad-E470', ... 'id': '0112358', ... 'level': 'debug', ... 'raw': 'some log line here', ... 'timestamp': '2018-04-07T14:06:17.404818', ... 'type': 'log'} >>> lc.validate_log_format(redundant_log) 'failed' >>> correct_log = {'data': {'x' : 1, 'y' : 2}, ... 'error': False, ... 'error_tb': '', ... 'event': 'event', ... 'file': '/path/to/file.log', ... 'formatter': 'logagg.formatters.mongodb', ... 'host': 'deepcompute-ThinkPad-E470', ... 'id': '0112358', ... 'level': 'debug', ... 'raw': 'some log line here', ... 'timestamp': '2018-04-07T14:06:17.404818', ... 'type': 'log'} >>> lc.validate_log_format(correct_log) 'passed'", "label": 1, "domain": "code", "token_count": 362, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0467", "text": "

    Perform an XML 1.1 level 1 (only markup-significant chars) escape operation on a String input meant to be an XML attribute value.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml11(String, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null. @since 1.1.5", "label": 1, "domain": "code", "token_count": 413, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0468", "text": "Finds a single document and replaces it, returning the original doc unless otherwise specified. @example Find a document and replace it, returning the original. collection.find_one_and_replace({ name: 'test' }, { name: 'test1' }) @example Find a document and replace it, returning the new document. collection.find_one_and_replace({ name: 'test' }, { name: 'test1' }, :return_document => :after) @param [ Hash ] filter The filter to use. @param [ BSON::Document ] replacement The replacement document. @param [ Hash ] options The options. @option options [ Integer ] :max_time_ms The maximum amount of time to allow the command to run in milliseconds. @option options [ Hash ] :projection The fields to include or exclude in the returned doc. @option options [ Hash ] :sort The key and direction pairs by which the result set will be sorted. @option options [ Symbol ] :return_document Either :before or :after. @option options [ true, false ] :upsert Whether to upsert if the document doesn't exist. @option options [ true, false ] :bypass_document_validation Whether or not to skip document level validation. @option options [ Hash ] :write_concern The write concern options. Defaults to the collection's write concern. @option options [ Hash ] :collation The collation to use. @option options [ Session ] :session The session to use. @return [ BSON::Document ] The document. @since 2.1.0", "label": 1, "domain": "code", "token_count": 317, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0469", "text": "To list all services without regard to its type, run **GET** against */api/services/* as an authenticated user. To list services of specific type issue **GET** to specific endpoint from a list above as a customer owner. Individual endpoint used for every service type. To create a service, issue a **POST** to specific endpoint from a list above as a customer owner. Individual endpoint used for every service type. You can create service based on shared service settings. Example: .. code-block:: http POST /api/digitalocean/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { \"name\": \"Common DigitalOcean\", \"customer\": \"http://example.com/api/customers/1040561ca9e046d2b74268600c7e1105/\", \"settings\": \"http://example.com/api/service-settings/93ba615d6111466ebe3f792669059cb4/\" } Or provide your own credentials. Example: .. code-block:: http POST /api/oracle/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { \"name\": \"My Oracle\", \"customer\": \"http://example.com/api/customers/1040561ca9e046d2b74268600c7e1105/\", \"backend_url\": \"https://oracle.example.com:7802/em\", \"username\": \"admin\", \"password\": \"secret\" }", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0470", "text": "Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later. @param billing_account_id [String] BillingAccount ID @param billing_period_name [String] Billing Period Name. @param expand [String] May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. @param filter [String] May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the most recent N usageDetails. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 328, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0471", "text": "Transliterates UTF-8 characters to ASCII. By default this method will transliterate only Latin strings to an ASCII approximation: I18n.transliterate(\"Ærøskøbing\") # => \"AEroskobing\" I18n.transliterate(\"日本語\") # => \"???\" It's also possible to add support for per-locale transliterations. I18n expects transliteration rules to be stored at i18n.transliterate.rule. Transliteration rules can either be a Hash or a Proc. Procs must accept a single string argument. Hash rules inherit the default transliteration rules, while Procs do not. *Examples* Setting a Hash in .yml: i18n: transliterate: rule: ü: \"ue\" ö: \"oe\" Setting a Hash using Ruby: store_translations(:de, :i18n => { :transliterate => { :rule => { \"ü\" => \"ue\", \"ö\" => \"oe\" } } ) Setting a Proc: translit = lambda {|string| MyTransliterator.transliterate(string) } store_translations(:xx, :i18n => {:transliterate => {:rule => translit}) Transliterating strings: I18n.locale = :en I18n.transliterate(\"Jürgen\") # => \"Jurgen\" I18n.locale = :de I18n.transliterate(\"Jürgen\") # => \"Juergen\" I18n.transliterate(\"Jürgen\", :locale => :en) # => \"Jurgen\" I18n.transliterate(\"Jürgen\", :locale => :de) # => \"Juergen\"", "label": 1, "domain": "code", "token_count": 362, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0472", "text": "Evaluates one of several different types of methods within the context of the given object. Methods can be one of the following types: * Symbol * Method / Proc * String == Examples Below are examples of the various ways that a method can be evaluated on an object: class Person def initialize(name) @name = name end def name @name end end class PersonCallback def self.run(person) person.name end end person = Person.new('John Smith') evaluate_method(person, :name) # => \"John Smith\" evaluate_method(person, PersonCallback.method(:run)) # => \"John Smith\" evaluate_method(person, Proc.new {|person| person.name}) # => \"John Smith\" evaluate_method(person, lambda {|person| person.name}) # => \"John Smith\" evaluate_method(person, '@name') # => \"John Smith\" == Additional arguments Additional arguments can be passed to the methods being evaluated. If the method defines additional arguments other than the object context, then all arguments are required. For example, person = Person.new('John Smith') evaluate_method(person, lambda {|person| person.name}, 21) # => \"John Smith\" evaluate_method(person, lambda {|person, age| \"#{person.name} is #{age}\"}, 21) # => \"John Smith is 21\" evaluate_method(person, lambda {|person, age| \"#{person.name} is #{age}\"}, 21, 'male') # => ArgumentError: wrong number of arguments (3 for 2)", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0473", "text": "@example Request syntax with placeholder values user = user.create({ path: \"pathType\", permissions_boundary: \"arnType\", tags: [ { key: \"tagKeyType\", # required value: \"tagValueType\", # required }, ], }) @param [Hash] options ({}) @option options [String] :path The path for the user name. For more information about paths, see [IAM Identifiers][1] in the *IAM User Guide*. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its [regex pattern][2]) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\\\\u0021) through the DEL character (\\\\u007F), including most punctuation characters, digits, and upper and lowercased letters. [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html [2]: http://wikipedia.org/wiki/regex @option options [String] :permissions_boundary The ARN of the policy that is used to set the permissions boundary for the user. @option options [Array] :tags A list of tags that you want to attach to the newly created user. Each tag consists of a key name and an associated value. For more information about tagging, see [Tagging IAM Identities][1] in the *IAM User Guide*. If any one of the tags is invalid or if you exceed the allowed number of tags per user, then the entire request fails and the user is not created. [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html @return [User]", "label": 1, "domain": "code", "token_count": 372, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0474", "text": "Creates XZ plane buffers. The created plane has position, normal, and texcoord data @param {WebGLRenderingContext} gl The WebGLRenderingContext. @param {number} [width] Width of the plane. Default = 1 @param {number} [depth] Depth of the plane. Default = 1 @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 @param {module:twgl/m4.Mat4} [matrix] A matrix by which to multiply all the vertices. @return {Object.} The created plane buffers. @memberOf module:twgl/primitives @function createPlaneBuffers Creates XZ plane vertices. The created plane has position, normal, and texcoord data @param {number} [width] Width of the plane. Default = 1 @param {number} [depth] Depth of the plane. Default = 1 @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 @param {module:twgl/m4.Mat4} [matrix] A matrix by which to multiply all the vertices. @return {Object.} The created plane vertices. @memberOf module:twgl/primitives", "label": 1, "domain": "code", "token_count": 307, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0475", "text": "Convert a string to an URL according to several rules.

    The rules are (the first succeeded is replied):

    • if {@code urlDescription} is null or empty, return null;
    • try to build an {@link URL} with {@code urlDescription} as parameter;
    • if {@code allowResourceSearch} is true and {@code urlDescription} starts with {@code \"resource:\"}, call {@link Resources#getResource(String)} with the rest of the string as parameter;
    • if {@code allowResourceSearch} is true, call {@link Resources#getResource(String)} with the {@code urlDescription} as parameter;
    • if {@code repliesFileURL} is true and assuming that the {@code urlDescription} is a filename, call {@link File#toURI()} to retreive an URI and then {@link URI#toURL()};
    • If everything else failed, return null.
    @param urlDescription is a string which is describing an URL. @param allowResourceSearch indicates if the convertion must take into account the Java resources. @param repliesFileURL indicates if urlDescription is allowed to be a filename. @param supportWindowsPaths indicates if Windows paths should be treated in particular way. @return the URL. @throws IllegalArgumentException is the string could not be formatted to URL. @see Resources#getResource(String)", "label": 1, "domain": "code", "token_count": 328, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0476", "text": "EXPERIMENTAL Takes facets and returns then as a dictionary that is easier to work with, for example, if you are getting something this:: {'facets': {'count': 50, 'test': {'buckets': [{'count': 10, 'pr': {'buckets': [{'count': 2, 'unique': 1, 'val': 79}, {'count': 1, 'unique': 1, 'val': 9}]}, 'pr_sum': 639.0, 'val': 'consectetur'}, {'count': 8, 'pr': {'buckets': [{'count': 1, 'unique': 1, 'val': 9}, {'count': 1, 'unique': 1, 'val': 31}, {'count': 1, 'unique': 1, 'val': 33}]}, 'pr_sum': 420.0, 'val': 'auctor'}, {'count': 8, 'pr': {'buckets': [{'count': 2, 'unique': 1, 'val': 94}, {'count': 1, 'unique': 1, 'val': 25}]}, 'pr_sum': 501.0, 'val': 'nulla'}]}}} This should return you something like this:: {'test': {'auctor': {'count': 8, 'pr': {9: {'count': 1, 'unique': 1}, 31: {'count': 1, 'unique': 1}, 33: {'count': 1, 'unique': 1}}, 'pr_sum': 420.0}, 'consectetur': {'count': 10, 'pr': {9: {'count': 1, 'unique': 1}, 79: {'count': 2, 'unique': 1}}, 'pr_sum': 639.0}, 'nulla': {'count': 8, 'pr': {25: {'count': 1, 'unique': 1}, 94: {'count': 2, 'unique': 1}}, 'pr_sum': 501.0}}}", "label": 1, "domain": "code", "token_count": 444, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0477", "text": "Sends a health report on the Service Fabric node. Reports health state of the specified Service Fabric node. The report must contain the information about the source of the health report and property on which it is reported. The report is sent to a Service Fabric gateway node, which forwards to the health store. The report may be accepted by the gateway, but rejected by the health store after extra validation. For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. To see whether the report was applied in the health store, run GetNodeHealth and check that the report appears in the HealthEvents section. @param node_name [String] The name of the node. @param health_information [HealthInformation] Describes the health information for the health report. This information needs to be present in all of the health reports sent to the health manager. @param immediate [Boolean] A flag which indicates whether the report should be sent immediately. A health report is sent to a Service Fabric gateway Application, which forwards to the health store. If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, regardless of the fabric client settings that the HTTP Gateway Application is using. This is useful for critical reports that should be sent as soon as possible. Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway is closed or the message doesn't reach the Gateway. If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. Therefore, it will be batched according to the HealthReportSendInterval configuration. This is the recommended setting because it allows the health client to optimize health reporting messages to health store as well as health report processing. By default, reports are not sent immediately. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 455, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0478", "text": "

    Perform am URI fragment identifier escape operation on a Reader input, writing results to a Writer.

    The following are the only allowed chars in an URI fragment identifier (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0479", "text": "Run Program @function $os~runProgram @param {string} program - Program to execute @param {string|string[]} arguments - Arguments. It can be either a string or an arry containing them. @param {Object} [options] @param {string} [options.logCommand=true] - Log command execution @param {boolean} [options.runInBackground=false] - Run the command in the background @param {boolean} [options.retrieveStdStreams=false] - Returns a hash describing the process stdout, stderr and exit code. @param {boolean} [options.ignoreStdStreams=false] - Completely ignore standard streams @param {boolean} [options.detachStdStreams=false] - Save standard streams to temporary files while executing the program (solves some processes hanging because of unclosed streams) @param {string} [options.runAs=null] - User used to run the program as. Only when running as admin. @param {string} [options.stdoutFile=null] - File used to store program stdout when running in background or when detaching streams @param {string} [options.stdoutFileMode=a+] - Flags used to open the stdoutFile @param {string} [options.stderrFile=null] - File used to store program stderr when running in background or when detaching streams @param {string} [options.stderrFileMode=a+] - Flags used to open the stderrFile @param {string} [options.cwd] - Working directory @param {Object} [options.env={}] - Object containing extra environment variables to be made accesible to the running process @param {string} [options.input=null] - Value passed as stdin to the spawned process @param {Object} [options.logger=null] - Optional logger to use when enabling logCommand. If not provided, the global package logger will be used @example // returns \"Hello World\" runProgram('echo', 'Hello World') @example
    // returns mysql databases runProgram('mysql', ['-uroot', '-pbitnami', '-e', 'show databases'], {runAs: 'mysql'}); @example // returns mysql databases runProgram('mysql', '-uroot -pbitnami -e \"show databases\"'], {runAs: 'mysql'});", "label": 1, "domain": "code", "token_count": 475, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0480", "text": "Raises ValidationException if value is not a datetime formatted in one of the formats formats. Returns a datetime.datetime object of value. * value (str): The value being validated as a datetime. * blank (bool): If True, a blank string will be accepted. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * formats: A tuple of strings that can be passed to time.strftime, dictating the possible formats for a valid datetime. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateDatetime('2018/10/31 12:00:01') datetime.datetime(2018, 10, 31, 12, 0, 1) >>> pysv.validateDatetime('10/31/2018 12:00:01') datetime.datetime(2018, 10, 31, 12, 0, 1) >>> pysv.validateDatetime('10/31/2018') Traceback (most recent call last): ... pysimplevalidate.ValidationException: '10/31/2018' is not a valid date and time.", "label": 1, "domain": "code", "token_count": 331, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0481", "text": "Create a UUID instance from 32-bit UUID data.
     // Prepare a byte array containing 32-bit UUID data (little endian). byte[] data = new byte[] { (byte)0x89, (byte)0xAB, (byte)0xCD, (byte)0xEF }; // Create a UUID instance from the byte array. UUID uuid = UUIDCreator.{@link #from32(byte[], int, boolean) from32}(data, 0, true); // uuid represents efcdab89-0000-1000-8000-00805f9b34fb. 

     // Prepare a byte array containing 32-bit UUID data (big endian). byte[] data = new byte[] { (byte)0xEF, (byte)0xCD, (byte)0xAB, (byte)0x89 }; // Create a UUID instance from the byte array. UUID uuid = UUIDCreator.{@link #from32(byte[], int, boolean) from32}(data, 0, false); // uuid represents efcdab89-0000-1000-8000-00805f9b34fb. 
    @param data A byte array containing 32-bit UUID data. @param offset The offset from which 32-bit UUID data should be read. @param littleEndian {@code true} if the 32-bit UUID data is stored in little endian. {@code false} for big endian. @return A UUID instance. {@code null} is returned when {@code data} is {@code null} or {@code offset} is not valid.", "label": 1, "domain": "code", "token_count": 471, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0482", "text": "Sends the given binary data to the browser. This method is similar to render plain: data, but also allows you to specify whether the browser should display the response as a file attachment (i.e. in a download dialog) or as inline data. You may also set the content type, the file name, and other things. Options: * :filename - suggests a filename for the browser to use. * :type - specifies an HTTP content type. Defaults to 'application/octet-stream'. You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json. If omitted, type will be inferred from the file extension specified in :filename. If no content type is registered for the extension, the default type 'application/octet-stream' will be used. * :disposition - specifies whether the file will be shown inline or downloaded. Valid values are 'inline' and 'attachment' (default). * :status - specifies the status code to send with the response. Defaults to 200. Generic data download: send_data buffer Download a dynamically-generated tarball: send_data generate_tgz('dir'), filename: 'dir.tgz' Display an image Active Record in the browser: send_data image.data, type: image.content_type, disposition: 'inline' See +send_file+ for more information on HTTP Content-* headers and caching.", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0483", "text": "Resolve a Service Fabric partition. Resolve a Service Fabric service partition to get the endpoints of the service replicas. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param partition_key_type [Integer] Key type for the partition. This parameter is required if the partition scheme for the service is Int64Range or Named. The possible values are following. - None (1) - Indicates that the PartitionKeyValue parameter is not specified. This is valid for the partitions with partitioning scheme as Singleton. This is the default value. The value is 1. - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an int64 partition key. This is valid for the partitions with partitioning scheme as Int64Range. The value is 2. - Named (3) - Indicates that the PartitionKeyValue parameter is a name of the partition. This is valid for the partitions with partitioning scheme as Named. The value is 3. @param partition_key_value [String] Partition key. This is required if the partition scheme for the service is Int64Range or Named. @param previous_rsp_version [String] The value in the Version field of the response that was received previously. This is required if the user knows that the result that was got previously is stale. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 436, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0484", "text": "

    Perform a Java Properties Key level 1 (only basic set) escape operation on a Reader input, writing results to a Writer.

    Level 1 means this method will only escape the Java Properties Key basic escape set:

    • The Single Escape Characters: \t (U+0009), \n (U+000A), \f (U+000C), \r (U+000D), (U+0020), \: (U+003A), \= (U+003D) and \\ (U+005C).
    • Two ranges of non-displayable, control characters (some of which are already part of the single escape characters list): U+0000 to U+001F and U+007F to U+009F.

    This method calls {@link #escapePropertiesKey(Reader, Writer, PropertiesKeyEscapeLevel)} with the following preconfigured values:

    • level: {@link PropertiesKeyEscapeLevel#LEVEL_1_BASIC_ESCAPE_SET}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 486, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0485", "text": "Set a deep value on an object (even if the key path doesn't exist) this is a shorthand for _.extend(), which is useful in cases where you can't easily build the extension object e.g. if you are building a path from variable names: _.set(obj, 'prop.'+varName+'.key', value); // 1 line vs: 3 lines with _.extend var extendObj = {prop:{}}; extendObj.prop[varName] = {key:value}; _.extend(obj, extendObj); @function module:undermore.set @param {object} obj The object to traverse @param {mixed} chain A string/array path to use for finding the end item (e.g. 'prop.child.end' or ['prop','child','end']) @param {mixed} value The value to set the end key to @return {mixed} The full new extended object @example var data = { prop: {} }; deepEqual(_.set(data, 'prop', 1), _.extend(data, {prop:1}) ); deepEqual(_.set(data, 'prop.foo', 'fooVal'), _.extend(data, {prop:{foo:'fooVal'}}) ); deepEqual(_.set(data, 'newKey', 'newVal'), _.extend(data, {newKey:'newVal'}) ); deepEqual(_.set(data, 'deep.key.that.does.not.exist', 'deepVal'), _.extend(data, { deep: { key:{ that:{ does:{ not:{ exist:'deepVal' } } } } } }));", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0486", "text": "(asynchronously) @param runmode (required) @param orgApacheFelixHttpsNio (optional) @param orgApacheFelixHttpsNioTypeHint (optional) @param orgApacheFelixHttpsKeystore (optional) @param orgApacheFelixHttpsKeystoreTypeHint (optional) @param orgApacheFelixHttpsKeystorePassword (optional) @param orgApacheFelixHttpsKeystorePasswordTypeHint (optional) @param orgApacheFelixHttpsKeystoreKey (optional) @param orgApacheFelixHttpsKeystoreKeyTypeHint (optional) @param orgApacheFelixHttpsKeystoreKeyPassword (optional) @param orgApacheFelixHttpsKeystoreKeyPasswordTypeHint (optional) @param orgApacheFelixHttpsTruststore (optional) @param orgApacheFelixHttpsTruststoreTypeHint (optional) @param orgApacheFelixHttpsTruststorePassword (optional) @param orgApacheFelixHttpsTruststorePasswordTypeHint (optional) @param orgApacheFelixHttpsClientcertificate (optional) @param orgApacheFelixHttpsClientcertificateTypeHint (optional) @param orgApacheFelixHttpsEnable (optional) @param orgApacheFelixHttpsEnableTypeHint (optional) @param orgOsgiServiceHttpPortSecure (optional) @param orgOsgiServiceHttpPortSecureTypeHint (optional) @param callback The callback to be executed when the API call finishes @return The request call @throws ApiException If fail to process the API call, e.g. serializing the request body object", "label": 1, "domain": "code", "token_count": 315, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0487", "text": "Checks if the database operations associated with two object envelopes that are related via an m:n collection reference needs to be performed in a particular order and if so builds and returns a corresponding directed edge weighted with CONCRETE_EDGE_WEIGHT. The following cases are considered (* means object needs update, + means object needs insert, - means object needs to be deleted):
    Pass arguments as arrayPass arguments as string
    (1)* -(m:n)-> (2)*no edge
    (1)* -(m:n)-> (2)+(2)->(1) edge
    (1)* -(m:n)-> (2)-no edge (cannot occur)
    (1)+ -(m:n)-> (2)*no edge
    (1)+ -(m:n)-> (2)+(2)->(1) edge
    (1)+ -(m:n)-> (2)-no edge (cannot occur)
    (1)- -(m:n)-> (2)*no edge
    (1)- -(m:n)-> (2)+no edge
    (1)- -(m:n)-> (2)-(1)->(2) edge
    @param vertex1 object envelope vertex of the object holding the collection @param vertex2 object envelope vertex of the object contained in the collection @return an Edge object or null if the two database operations can be performed in any order", "label": 1, "domain": "code", "token_count": 411, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0488", "text": "Lazily loads the available providers of this loader's service.

    The iterator returned by this method first yields all of the elements of the provider cache, in instantiation order. It then lazily loads and instantiates any remaining providers, adding each one to the cache in turn.

    To achieve laziness the actual work of parsing the available provider-configuration files and instantiating providers must be done by the iterator itself. Its {@link java.util.Iterator#hasNext hasNext} and {@link java.util.Iterator#next next} methods can therefore throw a {@link ServiceConfigurationError} if a provider-configuration file violates the specified format, or if it names a provider class that cannot be found and instantiated, or if the result of instantiating the class is not assignable to the service type, or if any other kind of exception or error is thrown as the next provider is located and instantiated. To write robust code it is only necessary to catch {@link ServiceConfigurationError} when using a service iterator.

    If such an error is thrown then subsequent invocations of the iterator will make a best effort to locate and instantiate the next available provider, but in general such recovery cannot be guaranteed.

    Design Note Throwing an error in these cases may seem extreme. The rationale for this behavior is that a malformed provider-configuration file, like a malformed class file, indicates a serious problem with the way the Java virtual machine is configured or is being used. As such it is preferable to throw an error rather than try to recover or, even worse, fail silently.

    The iterator returned by this method does not support removal. Invoking its {@link java.util.Iterator#remove() remove} method will cause an {@link UnsupportedOperationException} to be thrown. @return An iterator that lazily loads providers for this loader's service", "label": 1, "domain": "code", "token_count": 406, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0489", "text": "Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxDoubleEllipse Extends to implement a double ellipse shape. This shape is registered under in . Use the following override to only fill the inner ellipse in this shape: (code) mxDoubleEllipse.prototype.paintVertexShape = function(c, x, y, w, h) { c.ellipse(x, y, w, h); c.stroke(); var inset = mxUtils.getValue(this.style, mxConstants.STYLE_MARGIN, Math.min(3 + this.strokewidth, Math.min(w / 5, h / 5))); x += inset; y += inset; w -= 2 * inset; h -= 2 * inset; if (w > 0 && h > 0) { c.ellipse(x, y, w, h); } c.fillAndStroke(); }; (end) Constructor: mxDoubleEllipse Constructs a new ellipse shape. Parameters: bounds - that defines the bounds. This is stored in . fill - String that defines the fill color. This is stored in . stroke - String that defines the stroke color. This is stored in . strokewidth - Optional integer that defines the stroke width. Default is 1. This is stored in .", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0490", "text": "(asynchronously) @param keyStorePassword (optional) @param keyStorePasswordTypeHint (optional) @param serviceRanking (optional) @param serviceRankingTypeHint (optional) @param idpHttpRedirect (optional) @param idpHttpRedirectTypeHint (optional) @param createUser (optional) @param createUserTypeHint (optional) @param defaultRedirectUrl (optional) @param defaultRedirectUrlTypeHint (optional) @param userIDAttribute (optional) @param userIDAttributeTypeHint (optional) @param defaultGroups (optional) @param defaultGroupsTypeHint (optional) @param idpCertAlias (optional) @param idpCertAliasTypeHint (optional) @param addGroupMemberships (optional) @param addGroupMembershipsTypeHint (optional) @param path (optional) @param pathTypeHint (optional) @param synchronizeAttributes (optional) @param synchronizeAttributesTypeHint (optional) @param clockTolerance (optional) @param clockToleranceTypeHint (optional) @param groupMembershipAttribute (optional) @param groupMembershipAttributeTypeHint (optional) @param idpUrl (optional) @param idpUrlTypeHint (optional) @param logoutUrl (optional) @param logoutUrlTypeHint (optional) @param serviceProviderEntityId (optional) @param serviceProviderEntityIdTypeHint (optional) @param assertionConsumerServiceURL (optional) @param assertionConsumerServiceURLTypeHint (optional) @param handleLogout (optional) @param handleLogoutTypeHint (optional) @param spPrivateKeyAlias (optional) @param spPrivateKeyAliasTypeHint (optional) @param useEncryption (optional) @param useEncryptionTypeHint (optional) @param nameIdFormat (optional) @param nameIdFormatTypeHint (optional) @param digestMethod (optional) @param digestMethodTypeHint (optional) @param signatureMethod (optional) @param signatureMethodTypeHint (optional) @param userIntermediatePath (optional) @param userIntermediatePathTypeHint (optional) @param callback The callback to be executed when the API call finishes @return The request call @throws ApiException If fail to process the API call, e.g. serializing the request body object", "label": 1, "domain": "code", "token_count": 457, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0491", "text": "

    Perform an HTML5 level 2 (result is ASCII) escape operation on a char[] input.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding HTML5 Named Character References (e.g. '&acute;') when such NCR exists for the replaced character, and replacing by a decimal character reference (e.g. '&#8345;') when there there is no NCR for the replaced character.

    This method calls {@link #escapeHtml(char[], int, int, java.io.Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 441, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0492", "text": "Altera os dados de um ambiente a partir do seu identificador. :param id_ambiente: Identificador do ambiente. :param id_grupo_l3: Identificador do grupo layer 3. :param id_ambiente_logico: Identificador do ambiente lógico. :param id_divisao: Identificador da divisão data center. :param id_filter: Filter identifier. :param link: Link :param acl_path: Path where the ACL will be stored :param ipv4_template: Template that will be used in Ipv6 :param ipv6_template: Template that will be used in Ipv4 :param min_num_vlan_1: Min 1 num vlan valid for this environment :param max_num_vlan_1: Max 1 num vlan valid for this environment :param min_num_vlan_2: Min 2 num vlan valid for this environment :param max_num_vlan_2: Max 2 num vlan valid for this environment :return: None :raise InvalidParameterError: O identificador do ambiente, o identificador do grupo l3, o identificador do ambiente lógico, e/ou o identificador da divisão de data center são nulos ou inválidos. :raise GrupoL3NaoExisteError: Grupo layer 3 não cadastrado. :raise AmbienteLogicoNaoExisteError: Ambiente lógico não cadastrado. :raise DivisaoDcNaoExisteError: Divisão data center não cadastrada. :raise AmbienteDuplicadoError: Ambiente com o mesmo id_grupo_l3, id_ambiente_logico e id_divisao já cadastrado. :raise AmbienteNaoExisteError: Ambiente não cadastrado. :raise DataBaseError: Falha na networkapi ao acessar o banco de dados. :raise XMLError: Falha na networkapi ao ler o XML de requisição ou gerar o XML de resposta.", "label": 1, "domain": "code", "token_count": 406, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0493", "text": "

    Perform am URI path escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.

    The following are the only allowed chars in an URI path (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • /

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0494", "text": "Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_type_name [String] Specifies the name of a Service Fabric service type. @param service_manifest_name [String] The name of the service manifest to filter the list of deployed service type information. If specified, the response will only contain the information about service types that are defined in this service manifest. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 345, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0495", "text": "Uploads a file chunk to the image store relative path. Uploads a file chunk to the image store with the specified upload session ID and image store relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file upload from scratch whenever there is a network interruption. Use this option if the file size is large. To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store relative path already exists, it will be overwritten when the upload session commits. @param content_path [String] Relative path to file or folder in the image store from its root. @param session_id A GUID generated by the user for a file uploading. It identifies an image store upload session which keeps track of all file chunks until it is committed. @param content_range [String] When uploading file chunks to the image store, the Content-Range header field need to be configured and sent with a request. The format should looks like \"bytes {First-Byte-Position}-{Last-Byte-Position}/{File-Length}\". For example, Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300 through 5,000 and the total file length is 20,000 bytes. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 359, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0496", "text": " Generate a pair of ECDSA public and private keys with one of the supported, external cryptography libraries. The public and private keys returned conform to 'securesystemslib.formats.PEMECDSA_SCHEMA' and 'securesystemslib.formats.PEMECDSA_SCHEMA', respectively. The public ECDSA public key has the PEM format: TODO: should we encrypt the private keys returned here? Should the create_signature() accept encrypted keys? '-----BEGIN PUBLIC KEY----- ... '-----END PUBLIC KEY-----' The private ECDSA private key has the PEM format: '-----BEGIN EC PRIVATE KEY----- ... -----END EC PRIVATE KEY-----' >>> public, private = generate_public_and_private() >>> securesystemslib.formats.PEMECDSA_SCHEMA.matches(public) True >>> securesystemslib.formats.PEMECDSA_SCHEMA.matches(private) True scheme: A string indicating which algorithm to use for the generation of the public and private ECDSA keys. 'ecdsa-sha2-nistp256' is the only currently supported ECDSA algorithm, which is supported by OpenSSH and specified in RFC 5656 (https://tools.ietf.org/html/rfc5656). securesystemslib.exceptions.FormatError, if 'algorithm' is improperly formatted. securesystemslib.exceptions.UnsupportedAlgorithmError, if 'scheme' is an unsupported algorithm. None. A (public, private) tuple that conform to 'securesystemslib.formats.PEMECDSA_SCHEMA' and 'securesystemslib.formats.PEMECDSA_SCHEMA', respectively.", "label": 1, "domain": "code", "token_count": 327, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0497", "text": "Reads the settings corresponding to the plugin from where the method is called. This function has to be called in the __init__ method of the plugin class. Settings are stored in a settings.json file in the plugin folder. Here is an eample of such a file: [ {\"name\":\"mysetting\", \"label\": \"My setting\", \"description\": \"A setting to customize my plugin\", \"type\": \"string\", \"default\": \"dummy string\", \"group\": \"Group 1\" \"onEdit\": \"def f():\\\\n\\\\tprint \"Value edited in settings dialog\" \"onChange\": \"def f():\\\\n\\\\tprint \"New settings value has been saved\" }, {\"name\":\"anothersetting\", \"label\": \"Another setting\", \"description\": \"Another setting to customize my plugin\", \"type\": \"number\", \"default\": 0, \"group\": \"Group 2\" }, {\"name\":\"achoicesetting\", \"label\": \"A choice setting\", \"description\": \"A setting to select from a set of possible options\", \"type\": \"choice\", \"default\": \"option 1\", \"options\":[\"option 1\", \"option 2\", \"option 3\"], \"group\": \"Group 2\" } ] Available types for settings are: string, bool, number, choice, crs and text (a multiline string) The onEdit property contains a function that will be executed when the user edits the value in the settings dialog. It shouldl return false if, after it has been executed, the setting should not be modified and should recover its original value. The onEdit property contains a function that will be executed when the setting is changed after closing the settings dialog, or programatically by callin the setPluginSetting method Both onEdit and onChange are optional properties", "label": 1, "domain": "code", "token_count": 371, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0498", "text": "Change the current position of the story to the given path. From here you can call Continue() to evaluate the next line. The path String is a dot-separated path as used ly by the engine. These examples should work: myKnot myKnot.myStitch Note however that this won't necessarily work: myKnot.myStitch.myLabelledChoice ...because of the way that content is nested within a weave structure. By default this will reset the callstack beforehand, which means that any tunnels, threads or functions you were in at the time of calling will be discarded. This is different from the behaviour of ChooseChoiceIndex, which will always keep the callstack, since the choices are known to come from the correct state, and known their source thread. You have the option of passing false to the resetCallstack parameter if you don't want this behaviour, and will leave any active threads, tunnels or function calls in-tact. This is potentially dangerous! If you're in the middle of a tunnel, it'll redirect only the inner-most tunnel, meaning that when you tunnel-return using '->->->', it'll return to where you were before. This may be what you want though. However, if you're in the middle of a function, ChoosePathString will throw an exception. @param path A dot-separted path string, as specified above. @param resetCallstack Whether to reset the callstack first (see summary description). @param arguments Optional set of arguments to pass, if path is to a knot that takes them.", "label": 1, "domain": "code", "token_count": 321, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0499", "text": "Raises ValidationException if value is not a time formatted in one of the formats formats. Returns a datetime.time object of value. * value (str): The value being validated as a time. * blank (bool): If True, a blank string will be accepted. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * formats: A tuple of strings that can be passed to time.strftime, dictating the possible formats for a valid time. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateTime('12:00:01') datetime.time(12, 0, 1) >>> pysv.validateTime('13:00:01') datetime.time(13, 0, 1) >>> pysv.validateTime('25:00:01') Traceback (most recent call last): ... pysimplevalidate.ValidationException: '25:00:01' is not a valid time. >>> pysv.validateTime('hour 12 minute 01', formats=['hour %H minute %M']) datetime.time(12, 1)", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0500", "text": "Creates a new token en/decoder for a service that is associated with the the audience_ids, the symmetrical token validation key, and the public and/or private keys. @param [Hash] options Supported options: * :audience_ids [Array, String] -- An array or space separated string of values which indicate the token is intended for this service instance. It will be compared with tokens as they are decoded to ensure that the token was intended for this audience. * :skey [String] -- used to sign and validate tokens using symmetrical key algoruthms * :pkey [String, File, OpenSSL::PKey::PKey] -- may be a String or File in PEM or DER formats. May include public and/or private key data. The private key is used to sign tokens and the public key is used to validate tokens. * :algorithm [String] -- Sets default used for encoding. May be HS256, HS384, HS512, RS256, RS384, RS512, or none. * :verify [String] -- Verifies signatures when decoding tokens. Defaults to +true+. * :accept_algorithms [String, Array] -- An Array or space separated string of values which list what algorthms are accepted for token signatures. Defaults to all possible values of :algorithm except 'none'. @note the TokenCoder instance must be configured with the appropriate key material to support particular algorithm families and operations -- i.e. :pkey must include a private key in order to sign tokens with the RS algorithms. Encode a JWT token. Takes a hash of values to use as the token body. Returns a signed token in JWT format (header, body, signature). @param token_body (see TokenCoder.encode) @param [String] algorithm -- overrides default. See {#initialize} for possible values. @return (see TokenCoder.encode)", "label": 1, "domain": "code", "token_count": 384, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0501", "text": "Calculate the flown through area and the wetted perimeter of the main channel. Note that the main channel is assumed to have identical slopes on both sides and that water flowing exactly above the main channel is contributing to |AM|. Both theoretical surfaces seperating water above the main channel from water above both forelands are contributing to |UM|. Required control parameters: |HM| |BM| |BNM| Required flux sequence: |H| Calculated flux sequence: |AM| |UM| Examples: Generally, a trapezoid with reflection symmetry is assumed. Here its smaller base (bottom) has a length of 2 meters, its legs show an inclination of 1 meter per 4 meters, and its height (depths) is 1 meter: >>> from hydpy.models.lstream import * >>> parameterstep() >>> bm(2.0) >>> bnm(4.0) >>> hm(1.0) The first example deals with normal flow conditions, where water flows within the main channel completely (|H| < |HM|): >>> fluxes.h = 0.5 >>> model.calc_am_um_v1() >>> fluxes.am am(2.0) >>> fluxes.um um(6.123106) The second example deals with high flow conditions, where water flows over the foreland also (|H| > |HM|): >>> fluxes.h = 1.5 >>> model.calc_am_um_v1() >>> fluxes.am am(11.0) >>> fluxes.um um(11.246211) The third example checks the special case of a main channel with zero height: >>> hm(0.0) >>> model.calc_am_um_v1() >>> fluxes.am am(3.0) >>> fluxes.um um(5.0) The fourth example checks the special case of the actual water stage not being larger than zero (empty channel): >>> fluxes.h = 0.0 >>> hm(1.0) >>> model.calc_am_um_v1() >>> fluxes.am am(0.0) >>> fluxes.um um(0.0)", "label": 1, "domain": "code", "token_count": 433, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0502", "text": "

    Perform am URI query parameter (name or value) escape operation on a Reader input using UTF-8 as encoding, writing results to a Writer.

    The following are the only allowed chars in an URI query parameter (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ ' ( ) * , ;
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0503", "text": "

    Perform an XML 1.0 level 1 (only markup-significant chars) escape operation on a String input, writing results to a Writer.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    This method calls {@link #escapeXml10(String, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 326, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0504", "text": "Generates an arithmetic progression of numbers starting from start up to, but not including, limit, using the given step. @example _.range(2, 10) // => [2, 3, 4, 5, 6, 7, 8, 9] _.range(1, -10, -2) // => [1, -1, -3, -5, -7, -9] _.range(0, 3, 1) // => [0, 1, 2] _.range(-0, 3, 1) // => [-0, 1, 2] _.range(1, -10, 2) // => [] _.range(3, 5, -1) // => [] @example
    _.range(2, 10, 0) // => [2] _.range(2, -10, 0) // => [2] _.range(2, 2, 0) // => [] @memberof module:lamb @category Math @see {@link module:lamb.generate|generate} @since 0.1.0 @param {Number} start @param {Number} limit @param {Number} [step=1] @returns {Number[]}", "label": 1, "domain": "code", "token_count": 300, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0505", "text": "Execute commands in a way that forces you to deal with failures and helps you to simplify testing. The module can be included which will add sh both as an instance and a class method. A sample way to mock the execution of \"ls /\": it \"should be possible to mock the result of a command execution\" do cmd = \"ls /\" result = Bosh::Exec::Result.new(cmd, \"bin etc var\", \"\", 0) Bosh::Exec.should_receive(:sh).with(cmd).and_return(result) result = Bosh::Exec.sh(cmd) result.success?.should be(true) end @note As commands are executed using %x{...} you need to append 2>&1 to redirect stderr or it will be output to the stderr of the process invoking the sh method @param [String] command shell command to execute @param [Hash] options @option options [Symbol] :on_error if set to :return failing commands return [Bosh::Exec::Result] instead of raising [Bosh::Exec::Error] @option options [Symbol] :yield if set to :on_false it will execute the block when the command fails, else it will execute the block only when the command succeeds. Implies :on_error = :return @yield [Bosh::Exec::Result] command result @return [Bosh::Exec::Result] command result @raise [Bosh::Exec::Error] raised when the command isn't found or the command exits with a non zero status @example by default execute block only when command succeeds and raise error on failure sh(\"command\") do |result| ... end @example don't raise error if the command fails result = sh(\"command\", :on_error => :return) @example execute block only when command fails (which implies :on_error => :return) sh(\"command\", :yield => :on_false) do |result| ... end", "label": 1, "domain": "code", "token_count": 390, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0506", "text": "Returns a list of actions (alerts) that have been generated for your account. Optional Parameters: * from -- Only include actions generated later than this timestamp. Format is UNIX time. Type: Integer Default: None * to -- Only include actions generated prior to this timestamp. Format is UNIX time. Type: Integer Default: None * limit -- Limits the number of returned results to the specified quantity. Type: Integer (max 300) Default: 100 * offset -- Offset for listing. Type: Integer Default: 0 * checkids -- Comma-separated list of check identifiers. Limit results to actions generated from these checks. Type: String Default: All * contactids -- Comma-separated list of contact identifiers. Limit results to actions sent to these contacts. Type: String Default: All * status -- Comma-separated list of statuses. Limit results to actions with these statuses. Type: String ['sent', 'delivered', 'error', 'not_delivered', 'no_credits'] Default: All * via -- Comma-separated list of via mediums. Limit results to actions with these mediums. Type: String ['email', 'sms', 'twitter', 'iphone', 'android'] Default: All Returned structure: { 'alerts' : [ { 'contactname' : Name of alerted contact 'contactid' : Identifier of alerted contact 'checkid' : Identifier of check 'time' : Time of alert generation. Format UNIX time 'via' : Alert medium ['email', 'sms', 'twitter', 'iphone', 'android'] 'status' : Alert status ['sent', 'delivered', 'error', 'notdelivered', 'nocredits'] 'messageshort': Short description of message 'messagefull' : Full message body 'sentto' : Target address, phone number, etc 'charged' : True if your account was charged for this message }, ... ] }", "label": 1, "domain": "code", "token_count": 412, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0507", "text": "This is an utility process that watches for changes in angular's view directory and performs caching on them.
    This will generate a javaScript function that will use angular's $templateCache service (see {@link https://docs.angularjs.org/api/ng/service/$templateCache}) to cache static view files for the application. Once the output js file is included in the index html, it will register an angular module, using $templateCache to put all the view files under. For more details, see example. @memberof crux.Build.Angular @class Templates @param {Object} config - angular template configuration @param {String} [config.extension=html] - view extensions to use @param {String} [config.module=app] - the view module's name. @param {String|Array} [config.path=front/app/views] - view directory path. It can also be an array of paths. If so, it will compile and watch all template files in all specified paths. @param {String} [config.viewPath=/] - base path tho be prepended for each view file. @param {Boolean} [config.viewExtension=false] - should we remove the extension of each view, when creating the build file. @param {Function} [config.compile] - callback function to be called when reading the content of each view file. @example // Using the default configuration, we may have the following view structure: // views/home/welcome.html // views/home/contact.html // views/members.html // The following javaScript template file will be created (app.views.templates.js) (function(angular) { var m = angular.module('app.views', []); m.run([$templateCache, function(t) { t.put('/home/welcome', '.... welcome html'); t.put('/home/contact', '... contact'); t.put('/members', ' members !'); }); })(window.angular); // In order to use it, when we initialize our angular app, we require it. // app.js var module = angular.module('app', ['app.views']); // we require the views to be loaded by our module. // do stuff", "label": 1, "domain": "code", "token_count": 433, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0508", "text": "The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

    CallBack Schemas

    Review Completion CallBack Sample

    {
    \"ReviewId\": \"\",
    \"ModifiedOn\": \"2016-10-11T22:36:32.9934851Z\",
    \"ModifiedBy\": \"\",
    \"CallBackType\": \"Review\",
    \"ContentId\": \"\",
    \"Metadata\": {
    \"adultscore\": \"0.xxx\",
    \"a\": \"False\",
    \"racyscore\": \"0.xxx\",
    \"r\": \"True\"
    },
    \"ReviewerResultTags\": {
    \"a\": \"False\",
    \"r\": \"True\"
    }
    }

    . @param team_name [String] Your team name. @param review_id [String] Id of the review. @param timescale [Integer] Timescale of the video you are adding frames to. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0509", "text": "

    Perform an XML 1.0 level 2 (markup-significant and all non-ASCII chars) escape operation on a Reader input, writing results to a Writer.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    This method calls {@link #escapeXml10(Reader, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 424, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0510", "text": "@interface Task @description Extends {@link Database} for an automatic connection session, with methods for executing multiple database queries. The type isn't available directly, it can only be created via methods {@link Database#task Database.task}, {@link Database#taskIf Database.taskIf}, {@link Database#tx Database.tx} and {@link Database#txIf Database.txIf}. When executing more than one request at a time, one should allocate and release the connection only once, while executing all the required queries within the same connection session. More importantly, a transaction can only work within a single connection. This is an interface for tasks/transactions to implement a connection session, during which you can execute multiple queries against the same connection that's released automatically when the task/transaction is finished. Each task/transaction manages the connection automatically. When executed on the root {@link Database} object, the connection is allocated from the pool, and once the method's callback has finished, the connection is released back to the pool. However, when invoked inside another task or transaction, the method reuses the parent connection. @see {@link Task#ctx ctx}, {@link Task#batch batch}, {@link Task#sequence sequence}, {@link Task#page page} @example db.task(t => { // t = task protocol context; // t.ctx = Task Context; return t.one('select * from users where id=$1', 123) .then(user => { return t.any('select * from events where login=$1', user.name); }); }) .then(events => { // success; }) .catch(error => { // error; });", "label": 1, "domain": "code", "token_count": 329, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0511", "text": "Produces an HTML index file in C{outputDir} and a collection of alignment graphs and FASTA files to summarize the information in C{titlesAlignments}. @param titlesAlignments: A L{dark.titles.TitlesAlignments} instance. @param sortOn: The attribute to sort subplots on. Either \"maxScore\", \"medianScore\", \"readCount\", \"length\", or \"title\". @param outputDir: Specifies a C{str} directory to write the HTML to. If the directory does not exist it will be created. @param idList: A dictionary. Keys are colors and values are lists of read ids that should be colored using that color. @param equalizeXAxes: If C{True}, adjust the X axis on each alignment plot to be the same. @param xRange: Set to either 'subject' or 'reads' to indicate the range of the X axis. @param logLinearXAxis: If C{True}, convert read offsets so that empty regions in the plots we're preparing will only be as wide as their logged actual values. @param logBase: The logarithm base to use if logLinearXAxis is C{True}. @param: rankScores: If C{True}, change the scores for the reads for each title to be their rank (worst to best). @param showFeatures: If C{True}, look online for features of the subject sequences. @param showOrfs: If C{True}, open reading frames will be displayed. @raise TypeError: If C{outputDir} is C{None}. @raise ValueError: If C{outputDir} is None or exists but is not a directory or if C{xRange} is not \"subject\" or \"reads\".", "label": 1, "domain": "code", "token_count": 361, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0512", "text": "Create a {@link Ucode} instance.

    The format of {@code data} should be as described in the following table.

    Behaviour if step happens to be zero:
    Value Description
    Company ID 0x9A 0x01 The company ID assigned to T-Engine Forum. (Little Endian)
    Version 1-byte unsigned number The version number of Bluetooth LE ucode Marker.
    Ucode 16-byte data Ucode in the little endian order.
    Status 1-byte data Bit flags that represents the status of the peripheral device.
    Transmission Power 1-byte signed number. Transmission power in dBm.
    Transmission Count 1-byte unsigned number. The counter value incremented per transmission.
    Reserved 3-byte zeros. Reserved for future use.
    @param length The length of the AD structure. @param type The AD type. The value should always be 0xFF which represents Manufacturer Specific Data. @param data The AD type. The value of the first two bytes is the company ID. @param companyId The company ID. The value should always be 0x019A which represents T-Engine Forum @return A {@link Ucode} instance. {@code null} is returned if the length of {@code data} is less than 22.", "label": 1, "domain": "code", "token_count": 468, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0513", "text": "Perform a non-linear orthogonal distance regression, return the results as ErrorValue() instances. Inputs: x: one-dimensional numpy array of the independent variable y: one-dimensional numpy array of the dependent variable dx: absolute error (square root of the variance) of the independent variable. Either a one-dimensional numpy array or None. If None, weighting is disabled. Non-finite (NaN or inf) elements signify that the corresponding element in x is to be treated as fixed by ODRPACK. dy: absolute error (square root of the variance) of the dependent variable. Either a one-dimensional numpy array or None. If None, weighting is disabled. func: a callable with the signature func(x,par1,par2,par3,...) params_init: list or tuple of the first estimates of the parameters par1, par2, par3 etc. to be fitted other optional keyword arguments will be passed to leastsq(). Outputs: par1, par2, par3, ... , statdict par1, par2, par3, ...: fitted values of par1, par2, par3 etc as instances of ErrorValue. statdict: dictionary of various statistical parameters: 'DoF': Degrees of freedom 'Chi2': Chi-squared 'Chi2_reduced': Reduced Chi-squared 'num_func_eval': number of function evaluations during fit. 'func_value': the function evaluated in the best fitting parameters 'message': status message from leastsq() 'error_flag': integer status flag from leastsq() ('ier') 'Covariance': covariance matrix (variances in the diagonal) 'Correlation_coeffs': Pearson's correlation coefficients (usually denoted by 'r') in a matrix. The diagonal is unity. Notes: for the actual fitting, the module scipy.odr is used.", "label": 1, "domain": "code", "token_count": 366, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0514", "text": "

    Perform an HTML5 level 2 (result is ASCII) escape operation on a Reader input, writing results to a Writer.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding HTML5 Named Character References (e.g. '&acute;') when such NCR exists for the replaced character, and replacing by a decimal character reference (e.g. '&#8345;') when there there is no NCR for the replaced character.

    This method calls {@link #escapeHtml(Reader, Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.html.HtmlEscapeType#HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}
    • level: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 415, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0515", "text": "Wraps an object with a Maybe instance. >>> maybe(\"I'm a value\") Something(\"I'm a value\") >>> maybe(None); Nothing Testing for value: >>> maybe(\"I'm a value\").is_some() True >>> maybe(\"I'm a value\").is_none() False >>> maybe(None).is_some() False >>> maybe(None).is_none() True Simplifying IF statements: >>> maybe(\"I'm a value\").get() \"I'm a value\" >>> maybe(\"I'm a value\").or_else(lambda: \"No value\") \"I'm a value\" >>> maybe(None).get() Traceback (most recent call last): ... NothingValueError: No such element >>> maybe(None).or_else(lambda: \"value\") 'value' >>> maybe(None).or_else(\"value\") 'value' Wrap around values from object's attributes: class Person(object): def __init__(name): self.eran = name eran = maybe(Person('eran')) >>> eran.name Something('eran') >>> eran.phone_number Nothing >>> eran.phone_number.or_else('no phone number') 'no phone number' >>> maybe(4) + 8 Something(12) >>> maybe(4) - 2 Something(2) >>> maybe(4) * 2 Something(8) And methods: >>> maybe('VALUE').lower().get() 'value' >>> maybe(None).invalid().method().or_else('unknwon') 'unknwon' Enabled easily using NestedDictionaries without having to worry if a value is missing. For example lets assume we want to load some value from the following dictionary: nested_dict = maybe({ 'store': { 'name': 'MyStore', 'departments': { 'sales': { 'head_count': '10' } } } }) >>> nested_dict['store']['name'].get() 'MyStore' >>> nested_dict['store']['address'] Nothing >>> nested_dict['store']['address']['street'].or_else('No Address Specified') 'No Address Specified' >>> nested_dict['store']['address']['street'].or_none() is None True >>> nested_dict['store']['address']['street'].or_empty_list() [] >>> nested_dict['store']['departments']['sales']['head_count'].or_else('0') '10' >>> nested_dict['store']['departments']['marketing']['head_count'].or_else('0') '0'", "label": 1, "domain": "code", "token_count": 485, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0516", "text": "The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

    CallBack Schemas

    Review Completion CallBack Sample

    {
    \"ReviewId\": \"\",
    \"ModifiedOn\": \"2016-10-11T22:36:32.9934851Z\",
    \"ModifiedBy\": \"\",
    \"CallBackType\": \"Review\",
    \"ContentId\": \"\",
    \"Metadata\": {
    \"adultscore\": \"0.xxx\",
    \"a\": \"False\",
    \"racyscore\": \"0.xxx\",
    \"r\": \"True\"
    },
    \"ReviewerResultTags\": {
    \"a\": \"False\",
    \"r\": \"True\"
    }
    }

    . @param content_type [String] The content type. @param team_name [String] Your team name. @param create_video_reviews_body [Array] Body for create reviews API @param sub_team [String] SubTeam of your team, you want to assign the created review to. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 334, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0517", "text": "Creates a new request. @example Simplest request. response = Typhoeus::Request.new(\"www.example.com\").run @example Request with url parameters. response = Typhoeus::Request.new( \"www.example.com\", params: {a: 1} ).run @example Request with a body. response = Typhoeus::Request.new( \"www.example.com\", body: {b: 2} ).run @example Request with parameters and body. response = Typhoeus::Request.new( \"www.example.com\", params: {a: 1}, body: {b: 2} ).run @example Create a request and allow follow redirections. response = Typhoeus::Request.new( \"www.example.com\", followlocation: true ).run @param [ String ] base_url The url to request. @param [ options ] options The options. @option options [ Hash ] :params Translated into url parameters. @option options [ Hash ] :body Translated into HTTP POST request body. @return [ Typhoeus::Request ] The request. @note See {http://rubydoc.info/github/typhoeus/ethon/Ethon/Easy/Options Ethon::Easy::Options} for more options. @see Typhoeus::Hydra @see Typhoeus::Response @see Typhoeus::Request::Actions Return the url. In contrast to base_url which returns the value you specified, url returns the full url including the parameters. @example Get the url. request.url @since 0.5.5", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0518", "text": "provides an API equivalent to the Flash Sprite / Display Object for manipulating \"Objects\" on a canvas element. the basic Sprite renders an Image onto a canvas and can capture interaction events, and be draggable inheriting classes that require custom logic should override the public \"update\"-method which is invoked prior before the contents of this Sprite are rendered onto the canvas inheriting classes that have custom draw logic, should also override the public \"draw\"-method which is used for drawing the Sprite's visual representation onto the canvas. This method is invoked on each draw cycle. @constructor @param {number|{ x: number, y: number, width: number, height: number, bitmap: Image|HTMLCanvasElement|string, collidable: boolean, mask: boolean, sheet: Array.<{ row: number, col: number, amount: number, fpt: 5 }>, sheetTileWidth: number, sheetTileHeight: number }} x when numerical (legacy 7 argument constructor) the x-coordinate of this Sprite, when Object it should contain required properties width and height, with others optional (x and y will default to 0, 0 coordinate) see the description for width, height, bitmap, collidable and mask below) \"sheet\" describes a list of separate animations inside given \"bitmap\" \"sheetTileWidth\" and \"sheetTileHeight\" can specify dimensions for a single sheet tile When object, no further arguments will be processed by this constructor. @param {number=} y the y-coordinate of this Sprite, required when x is number @param {number=} width of this Sprite's bounding box, required when x is number @param {number=} height of this Sprite's bounding box, required when x is number @param {Image|HTMLCanvasElement|string=} bitmap optional image, when given, no override of the \"draw\"-method is required, as it will render the image by default at the current coordinates and at the given width and height. value can be either: HTMLImageElement, HTMLCanvasElement or a string describing an Image.src (e.g. hyperlink to remote Image, base64 encoded String or Blob URL) when not defined, you must override the \"draw\"-method as otherwise this sprite won't render anything onto the canvas! * @param {boolean=} collidable whether this Sprite can cause collisions with other Sprites @param {boolean=} mask whether to use this Sprite as a mask for underlying content", "label": 1, "domain": "code", "token_count": 493, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0519", "text": "

    Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) escape operation on a Reader input meant to be an XML attribute value, writing results to a Writer.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml11(Reader, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 497, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0520", "text": "Answers the concatenation of the three arrays inserting the sep1 character between the first two arrays and sep2 between the last two. It answers null if the three arrays are null. If the first array is null, then it answers the concatenation of second and third inserting the sep2 character between them. If the second array is null, then it answers the concatenation of first and third inserting the sep1 character between them. If the third array is null, then it answers the concatenation of first and second inserting the sep1 character between them.

    For example:
    1.  first = null sep1 = '/' second = { 'a' } sep2 = ':' third = { 'b' } => result = { ' a' , ':', 'b' } 
    2.  first = { 'a' } sep1 = '/' second = null sep2 = ':' third = { 'b' } => result = { ' a' , '/', 'b' } 
    3.  first = { 'a' } sep1 = '/' second = { 'b' } sep2 = ':' third = null => result = { ' a' , '/', 'b' } 
    4.  first = { 'a' } sep1 = '/' second = { 'b' } sep2 = ':' third = { 'c' } => result = { ' a' , '/', 'b' , ':', 'c' } 
    @param first the first array to concatenate @param sep1 the character to insert @param second the second array to concatenate @param sep2 the character to insert @param third the second array to concatenate @return the concatenation of the three arrays inserting the sep1 character between the two arrays and sep2 between the last two.", "label": 1, "domain": "code", "token_count": 411, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0521", "text": "Create HDX configuration Args: configuration (Optional[Configuration]): Configuration instance. Defaults to setting one up from passed arguments. remoteckan (Optional[ckanapi.RemoteCKAN]): CKAN instance. Defaults to setting one up from configuration. **kwargs: See below user_agent (str): User agent string. HDXPythonLibrary/X.X.X- is prefixed. Must be supplied if remoteckan is not. user_agent_config_yaml (str): Path to YAML user agent configuration. Ignored if user_agent supplied. Defaults to ~/.useragent.yml. user_agent_lookup (str): Lookup key for YAML. Ignored if user_agent supplied. hdx_url (str): HDX url to use. Overrides hdx_site. hdx_site (str): HDX site to use eg. prod, test. hdx_read_only (bool): Whether to access HDX in read only mode. Defaults to False. hdx_key (str): Your HDX key. Ignored if hdx_read_only = True. hdx_config_dict (dict): HDX configuration dictionary to use instead of above 3 parameters OR hdx_config_json (str): Path to JSON HDX configuration OR hdx_config_yaml (str): Path to YAML HDX configuration project_config_dict (dict): Project configuration dictionary OR project_config_json (str): Path to JSON Project configuration OR project_config_yaml (str): Path to YAML Project configuration hdx_base_config_dict (dict): HDX base configuration dictionary OR hdx_base_config_json (str): Path to JSON HDX base configuration OR hdx_base_config_yaml (str): Path to YAML HDX base configuration. Defaults to library's internal hdx_base_configuration.yml. Returns: str: HDX site url", "label": 1, "domain": "code", "token_count": 351, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0522", "text": "Dials a SIP gateway to input an audio-only stream into your OpenTok session. See the {https://tokbox.com/developer/guides/sip/ OpenTok SIP developer guide}. @example opts = { \"from\" => \"14155550101@example.com\", \"auth\" => { \"username\" => sip_username, \"password\" => sip_password }, \"headers\" => { \"X-KEY1\" => \"value1\", \"X-KEY1\" => \"value2\" }, \"secure\" => \"true\" } response = opentok.sip.dial(session_id, token, \"sip:+15128675309@acme.pstn.example.com;transport=tls\", opts) @param [String] session_id The session ID corresponding to the session to which the SIP gateway will connect. @param [String] token The token for the session ID with which the SIP user will use to connect. @param [String] sip_uri The SIP URI the OpenTok SIP gateway will dial. @param [Hash] opts A hash defining options for the SIP call. For example: @option opts [String] :from The number or string that will be sent to the final SIP number as the caller. It must be a string in the form of \"from@example.com\", where from can be a string or a number. If from is set to a number (for example, \"14155550101@example.com\"), it will show up as the incoming number on PSTN phones. If from is undefined or set to a string (for example, \"joe@example.com\"), +00000000 will show up as the incoming number on PSTN phones. @option opts [Hash] :headers This hash defines custom headers to be added to the SIP ​INVITE​ request initiated from OpenTok to the your SIP platform. Each of the custom headers must start with the ​\"X-\"​ prefix, or the call will result in a Bad Request (400) response. @option opts [Hash] :auth This object contains the username and password to be used in the the SIP INVITE​ request for HTTP digest authentication, if it is required by your SIP platform. @option opts [true, false] :secure Wether the media must be transmitted encrypted (​true​) or not (​false​, the default).", "label": 1, "domain": "code", "token_count": 480, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0523", "text": "

    Perform a (configurable) XML 1.0 escape operation on a Reader input meant to be an XML attribute value, writing results to a Writer.

    This method will perform an escape operation according to the specified {@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel} argument values.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    All other Reader/Writer-based escapeXml10*(...) methods call this one with preconfigured type and level values.

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param type the type of escape operation to be performed, see {@link org.unbescape.xml.XmlEscapeType}. @param level the escape level to be applied, see {@link org.unbescape.xml.XmlEscapeLevel}. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 357, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0524", "text": "Return an L{axiom.iaxiom.IComparison} (an object that can be passed as the 'comparison' argument to Store.query/.sum/.count) which will constrain a query against 2 attributes for ranges which overlap with the given arguments. For a database with Items of class O which represent values in this configuration:: X Y (a) (b) |-------------------| (c) (d) |--------| (e) (f) |--------| (g) (h) |---| (i) (j) |------| (k) (l) |-------------------------------------| (a) (l) |-----------------------------| (c) (b) |------------------------| (c) (a) |----| (b) (l) |---------| The query:: myStore.query( O, findOverlapping(O.X, O.Y, a, b)) Will return a generator of Items of class O which represent segments a-b, c-d, e-f, k-l, a-l, c-b, c-a and b-l, but NOT segments g-h or i-j. (NOTE: If you want to pass attributes of different classes for startAttribute and endAttribute, read the implementation of this method to discover the additional join clauses required. This may be eliminated some day so for now, consider this method undefined over multiple classes.) In the database where this query is run, for an item N, all values of N.startAttribute must be less than N.endAttribute. startValue must be less than endValue.", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0525", "text": "Triggers backup of the partition's state. Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. In case, the operation times out, specify a greater backup timeout value in the query parameter. @param partition_id The identity of the partition. @param backup_partition_description [BackupPartitionDescription] Describes the parameters to backup the partition now. If not present, backup operation uses default parameters from the backup policy current associated with this partition. @param backup_timeout [Integer] Specifies the maximum amount of time, in minutes, to wait for the backup operation to complete. Post that, the operation completes with timeout error. However, in certain corner cases it could be that though the operation returns back timeout, the backup actually goes through. In case of timeout error, its recommended to invoke this operation again with a greater timeout value. The default value for the same is 10 minutes. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0526", "text": "Initialize new HTTP 2.0 server object. GET / HTTP/1.1 Host: server.example.com Connection: Upgrade, HTTP2-Settings Upgrade: h2c HTTP2-Settings: Requests that contain a payload body MUST be sent in their entirety before the client can send HTTP/2 frames. This means that a large request can block the use of the connection until it is completely sent. If concurrency of an initial request with subsequent requests is important, an OPTIONS request can be used to perform the upgrade to HTTP/2, at the cost of an additional round trip. HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: h2c [ HTTP/2 connection ... - The first HTTP/2 frame sent by the server MUST be a server connection preface (Section 3.5) consisting of a SETTINGS frame. - Upon receiving the 101 response, the client MUST send a connection preface (Section 3.5), which includes a SETTINGS frame. The HTTP/1.1 request that is sent prior to upgrade is assigned a stream identifier of 1 (see Section 5.1.1) with default priority values (Section 5.3.5). Stream 1 is implicitly \"half-closed\" from the client toward the server (see Section 5.1), since the request is completed as an HTTP/1.1 request. After commencing the HTTP/2 connection, stream 1 is used for the response.", "label": 1, "domain": "code", "token_count": 314, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0527", "text": "Options for constructing a new Source. @typedef {Object} Source~SourceOptions @property {Float32Array} position The source's initial position (in meters), where origin is the center of the room. Defaults to {@linkcode Utils.DEFAULT_POSITION DEFAULT_POSITION}. @property {Float32Array} forward The source's initial forward vector. Defaults to {@linkcode Utils.DEFAULT_FORWARD DEFAULT_FORWARD}. @property {Float32Array} up The source's initial up vector. Defaults to {@linkcode Utils.DEFAULT_UP DEFAULT_UP}. @property {Number} minDistance Min. distance (in meters). Defaults to {@linkcode Utils.DEFAULT_MIN_DISTANCE DEFAULT_MIN_DISTANCE}. @property {Number} maxDistance Max. distance (in meters). Defaults to {@linkcode Utils.DEFAULT_MAX_DISTANCE DEFAULT_MAX_DISTANCE}. @property {string} rolloff Rolloff model to use, chosen from options in {@linkcode Utils.ATTENUATION_ROLLOFFS ATTENUATION_ROLLOFFS}. Defaults to {@linkcode Utils.DEFAULT_ATTENUATION_ROLLOFF DEFAULT_ATTENUATION_ROLLOFF}. @property {Number} gain Input gain (linear). Defaults to {@linkcode Utils.DEFAULT_SOURCE_GAIN DEFAULT_SOURCE_GAIN}. @property {Number} alpha Directivity alpha. Defaults to {@linkcode Utils.DEFAULT_DIRECTIVITY_ALPHA DEFAULT_DIRECTIVITY_ALPHA}. @property {Number} sharpness Directivity sharpness. Defaults to {@linkcode Utils.DEFAULT_DIRECTIVITY_SHARPNESS DEFAULT_DIRECTIVITY_SHARPNESS}. @property {Number} sourceWidth Source width (in degrees). Where 0 degrees is a point source and 360 degrees is an omnidirectional source. Defaults to {@linkcode Utils.DEFAULT_SOURCE_WIDTH DEFAULT_SOURCE_WIDTH}. @class Source @description Source model to spatialize an audio buffer. @param {ResonanceAudio} scene Associated {@link ResonanceAudio ResonanceAudio} instance. @param {Source~SourceOptions} options Options for constructing a new Source.", "label": 1, "domain": "code", "token_count": 400, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0528", "text": "Returns the year of the given calendar field. @method getYear @returns {Number} the year for the given calendar field. Returns the month of the given calendar field. @method getMonth @returns {Number} the month for the given calendar field. Returns the day of month of the given calendar field. @method getDayOfMonth @returns {Number} the day of month for the given calendar field. Returns the hour of day of the given calendar field. @method getHourOfDay @returns {Number} the hour of day for the given calendar field. Returns the minute of the given calendar field. @method getMinute @returns {Number} the minute for the given calendar field. Returns the second of the given calendar field. @method getSecond @returns {Number} the second for the given calendar field. Returns the millisecond of the given calendar field. @method getMilliSecond @returns {Number} the millisecond for the given calendar field. Returns the week of year of the given calendar field. @method getWeekOfYear @returns {Number} the week of year for the given calendar field. Returns the week of month of the given calendar field. @method getWeekOfMonth @returns {Number} the week of month for the given calendar field. Returns the day of year of the given calendar field. @method getDayOfYear @returns {Number} the day of year for the given calendar field. Returns the day of week of the given calendar field. @method getDayOfWeek @returns {Number} the day of week for the given calendar field. Returns the day of week in month of the given calendar field. @method getDayOfWeekInMonth @returns {Number} the day of week in month for the given calendar field. Sets the given calendar field to the given value. @param field the given calendar field. @param v the value to be set for the given calendar field.", "label": 1, "domain": "code", "token_count": 389, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0529", "text": "Returns HTML representing page links for a WillPaginate::Collection-like object. In case there is no more than one page in total, nil is returned. ==== Options * :class -- CSS class name for the generated DIV (default: \"pagination\") * :previous_label -- default: \"« Previous\" * :next_label -- default: \"Next »\" * :inner_window -- how many links are shown around the current page (default: 4) * :outer_window -- how many links are around the first and the last page (default: 1) * :link_separator -- string separator for page HTML elements (default: single space) * :param_name -- parameter name for page number in URLs (default: :page) * :params -- additional parameters when generating pagination links (eg. :controller => \"foo\", :action => nil) * :renderer -- class name, class or instance of a link renderer (default in Rails: WillPaginate::ActionView::LinkRenderer) * :page_links -- when false, only previous/next links are rendered (default: true) * :container -- toggles rendering of the DIV container for pagination links, set to false only when you are rendering your own pagination markup (default: true) All options not recognized by will_paginate will become HTML attributes on the container element for pagination links (the DIV). For example: <%= will_paginate @posts, :style => 'color:blue' %> will result in:
    ...
    ", "label": 1, "domain": "code", "token_count": 384, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0530", "text": "Prepares BAM file for Toil germline pipeline. Steps in pipeline 0: Download and align BAM or FASTQ sample 1: Sort BAM 2: Index BAM 3: Run GATK preprocessing pipeline (Optional) - Uploads preprocessed BAM to output directory :param JobFunctionWrappingJob job: passed automatically by Toil :param str uuid: Unique identifier for the sample :param str url: URL or local path to BAM file or FASTQs :param Namespace config: Configuration options for pipeline Requires the following config attributes: config.genome_fasta FilesStoreID for reference genome fasta file config.genome_fai FilesStoreID for reference genome fasta index file config.genome_dict FilesStoreID for reference genome sequence dictionary file config.g1k_indel FileStoreID for 1000G INDEL resource file config.mills FileStoreID for Mills resource file config.dbsnp FileStoreID for dbSNP resource file config.suffix Suffix added to output filename config.output_dir URL or local path to output directory config.ssec Path to key file for SSE-C encryption config.cores Number of cores for each job config.xmx Java heap size in bytes :param str|None paired_url: URL or local path to paired FASTQ file, default is None :param str|None rg_line: RG line for BWA alignment (i.e. @RG\\tID:foo\\tSM:bar), default is None :return: BAM and BAI FileStoreIDs :rtype: tuple", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0531", "text": "constructor: The ButtonHelper is a helper class to create interactive buttons from {{#crossLink \"MovieClip\"}}{{/crossLink}} or {{#crossLink \"Sprite\"}}{{/crossLink}} instances. This class will intercept mouse events from an object, and automatically call {{#crossLink \"Sprite/gotoAndStop\"}}{{/crossLink}} or {{#crossLink \"Sprite/gotoAndPlay\"}}{{/crossLink}}, to the respective animation labels, add a pointer cursor, and allows the user to define a hit state frame. The ButtonHelper instance does not need to be added to the stage, but a reference should be maintained to prevent garbage collection. Note that over states will not work unless you call {{#crossLink \"Stage/enableMouseOver\"}}{{/crossLink}}.

    Example

    var helper = new createjs.ButtonHelper(myInstance, \"out\", \"over\", \"down\", false, myInstance, \"hit\"); myInstance.addEventListener(\"click\", handleClick); function handleClick(event) { // Click Happened. } @class ButtonHelper @param {Sprite|MovieClip} target The instance to manage. @param {String} [outLabel=\"out\"] The label or animation to go to when the user rolls out of the button. @param {String} [overLabel=\"over\"] The label or animation to go to when the user rolls over the button. @param {String} [downLabel=\"down\"] The label or animation to go to when the user presses the button. @param {Boolean} [play=false] If the helper should call \"gotoAndPlay\" or \"gotoAndStop\" on the button when changing states. @param {DisplayObject} [hitArea] An optional item to use as the hit state for the button. If this is not defined, then the button's visible states will be used instead. Note that the same instance as the \"target\" argument can be used for the hitState. @param {String} [hitLabel] The label or animation on the hitArea instance that defines the hitArea bounds. If this is null, then the default state of the hitArea will be used. * @constructor", "label": 1, "domain": "code", "token_count": 448, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0532", "text": "Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes. @param image An image stream. @param return_face_id [Boolean] A value indicating whether the operation should return faceIds of detected faces. @param return_face_landmarks [Boolean] A value indicating whether the operation should return landmarks of the detected faces. @param return_face_attributes [Array] Analyze and return the one or more specified face attributes in the comma-separated string like \"returnFaceAttributes=age,gender\". Supported face attributes include age, gender, headPose, smile, facialHair, glasses and emotion. Note that each face attribute analysis has additional computational and time cost. @param recognition_model [RecognitionModel] Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition model name can be provided when performing Face - Detect or (Large)FaceList - Create or (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, please explicitly specify the model you need. Possible values include: 'recognition_01', 'recognition_02' @param return_recognition_model [Boolean] A value indicating whether the operation should return 'recognitionModel' in response. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0533", "text": "/*[deutsch]

    Liefert den Start eines Kalendertags, wie von der angegebenen Datumsfunktion bestimmt.

    Wenn die angegebene Funktion keinen Moment für ein Kalenderdatum ermitteln kann, wird eine Ausnahme geworfen. Diese Methode ist am besten für Kalender geeignet, deren Tage zu astronomischen Ereignissen wie einem Sonnenuntergang beginnen. Beispiel:

     HijriCalendar hijri = HijriCalendar.ofUmalqura(1436, 10, 2); SolarTime mekkaTime = SolarTime.ofLocation(21.4225, 39.826111); ZonalOffset saudiArabia = ZonalOffset.ofHours(OffsetSign.AHEAD_OF_UTC, 3); StartOfDay startOfDay = StartOfDay.definedBy(mekkaTime.sunset()); // short after sunset (2015-07-17T19:05:40) System.out.println( hijri.atTime(19, 6).at(saudiArabia, startOfDay)); // 2015-07-17T19:06+03:00 // short before sunset (2015-07-17T19:05:40) System.out.println( hijri.minus(CalendarDays.ONE).atTime(19, 5).at(saudiArabia, startOfDay)); // 2015-07-17T19:05+03:00 
    @param generic type parameter indicating the time of the event @param event function which yields the relevant moment for a given calendar day @return start of day @since 3.34/4.29", "label": 1, "domain": "code", "token_count": 363, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0534", "text": "@license Copyright 2010 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. A Marker Clusterer that clusters markers. @param {google.maps.Map} map The Google map to attach to. @param {Array.=} opt_markers Optional markers to add to the cluster. @param {Object=} opt_options support the following options: 'gridSize': (number) The grid size of a cluster in pixels. 'maxZoom': (number) The maximum zoom level that a marker can be part of a cluster. 'zoomOnClick': (boolean) Whether the default behaviour of clicking on a cluster is to zoom into it. 'averageCenter': (boolean) Whether the center of each cluster should be the average of all markers in the cluster. 'minimumClusterSize': (number) The minimum number of markers to be in a cluster before the markers are hidden and a count is shown. 'styles': (object) An object that has style properties: 'url': (string) The image url. 'height': (number) The image height. 'width': (number) The image width. 'anchor': (Array) The anchor position of the label text. 'textColor': (string) The text color. 'textSize': (number) The text size. 'backgroundPosition': (string) The position of the backgound x, y. 'iconAnchor': (Array) The anchor position of the icon x, y. @constructor @extends google.maps.OverlayView", "label": 1, "domain": "code", "token_count": 406, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0535", "text": "Triggers backup of the partition's state. Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. In case, the operation times out, specify a greater backup timeout value in the query parameter. @param partition_id The identity of the partition. @param backup_partition_description [BackupPartitionDescription] Describes the parameters to backup the partition now. If not present, backup operation uses default parameters from the backup policy current associated with this partition. @param backup_timeout [Integer] Specifies the maximum amount of time, in minutes, to wait for the backup operation to complete. Post that, the operation completes with timeout error. However, in certain corner cases it could be that though the operation returns back timeout, the backup actually goes through. In case of timeout error, its recommended to invoke this operation again with a greater timeout value. The default value for the same is 10 minutes. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 327, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0536", "text": "Creates a schema by parsing an XML document. A non-null XMLReaderCreator must be specified with setXMLReaderCreator before calling createSchema. The ErrorHandler is allowed to be null. The DatatypeLibraryFactory is allowed to be null.

    Normally, if a schema cannot be created, createSchema will throw a IncorrectSchemaException; however, before doing so, one or more errors will be reported using the ErrorHandler if it is non-null. If the ErrorHandler throws a SAXException, then createSchema will pass this through rather than throwing a IncorrectSchemaException. Similarly, if XMLReader.parse throws a SAXException or IOException, then createSchema will pass this through rather than throwing a IncorrectSchemaException. Thus, if an error handler is specified that reports errors to the user, there is no need to report any additional message to the user if createSchema throws IncorrectSchemaException. @param in the InputSource containing the XML document to be parsed; must not be null @return the Schema constructed from the XML document; never null. @throws IOException if an I/O error occurs @throws SAXException if there is an XML parsing error and the XMLReader or ErrorHandler throws a SAXException @throws com.thaiopensource.validate.IncorrectSchemaException if the XML document was not a correct RELAX NG schema @throws NullPointerException if the current XMLReaderCreator is null", "label": 1, "domain": "code", "token_count": 411, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0537", "text": "Generate xtalk mask (row - 1, row + 1) from pixel mask. Parameters ---------- mask : ndarray Pixel mask. Returns ------- ndarray Xtalk mask. Example ------- Input: [[1 0 0 0 0 0 1 0 0 0 ... 0 0 0 0 1 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 1 ... 0 1 0 0 0 0 0 1 0 0] ... [1 0 0 0 0 0 1 0 0 0 ... 0 0 0 0 1 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 1 ... 0 1 0 0 0 0 0 1 0 0]] Output: [[0 1 0 0 0 1 0 1 0 0 ... 0 0 0 1 0 1 0 0 0 1] [0 0 1 0 1 0 0 0 1 0 ... 1 0 1 0 0 0 1 0 1 0] ... [0 1 0 0 0 1 0 1 0 0 ... 0 0 0 1 0 1 0 0 0 1] [0 0 1 0 1 0 0 0 1 0 ... 1 0 1 0 0 0 1 0 1 0]]", "label": 1, "domain": "code", "token_count": 378, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0538", "text": "Decode speech for a file or folder and return results This function wraps the Google Speech API and ffmpeg to decode speech for free recall experiments. Note: in order for this to work, you must have a Google Speech account, a google speech credentials file referenced in your _bash_profile, and ffmpeg installed on your computer. See our readthedocs for more information on how to set this up: http://cdl-quail.readthedocs.io/en/latest/. Parameters ---------- path : str Path to a wav file, or a folder of wav files. keypath : str Google Cloud Speech API key filepath. This is a JSON file containing credentials that was generated when creating a service account key. If None, assumes you have a local key that is set with an environmental variable. See the speech decoding tutorial for details. save : boolean False by default, but if set to true, will save a pickle with the results object from google speech, and a text file with the decoded words. speech_context : list of str This allows you to give some context to the speech decoding algorithm. For example, this could be the words studied on a given list, or all words in an experiment. sample_rate : float The sample rate of your audio files (default is 44100). max_alternatives : int You can specify the speech decoding to return multiple guesses to the decoding. This will be saved in the results object (default is 1). language_code : str Decoding language code. Default is en-US. See here for more details: https://cloud.google.com/speech/docs/languages enable_word_time_offsets : bool Returns timing information s(onsets/offsets) for each word (default is True). return_raw : boolean Intead of returning the parsed results objects (i.e. the words), you can return the raw reponse object. This has more details about the decoding, such as confidence. Returns ---------- words : list of str, or list of lists of str The results of the speech decoding. This will be a list if only one file is input, or a list of lists if more than one file is decoded. raw : google speech object, or list of objects You can optionally return the google speech object instead of the parsed results by using the return_raw flag.", "label": 1, "domain": "code", "token_count": 457, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0539", "text": "

    Perform am URI fragment identifier escape operation on a String input using UTF-8 as encoding, writing results to a Writer.

    The following are the only allowed chars in an URI fragment identifier (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0540", "text": "Draw a collection of paths. The paths, offsets, and styles are all iterables, and the number of paths is max(len(paths), len(offsets)). By default, this is implemented via multiple calls to the draw_path() function. For efficiency, Renderers may choose to customize this implementation. Examples of path collections created by matplotlib are scatter plots, histograms, contour plots, and many others. Parameters ---------- paths : list list of tuples, where each tuple has two elements: (data, pathcodes). See draw_path() for a description of these. path_coordinates: string the coordinates code for the paths, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. path_transforms: array_like an array of shape (*, 3, 3), giving a series of 2D Affine transforms for the paths. These encode translations, rotations, and scalings in the standard way. offsets: array_like An array of offsets of shape (N, 2) offset_coordinates : string the coordinates code for the offsets, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. offset_order : string either \"before\" or \"after\". This specifies whether the offset is applied before the path transform, or after. The matplotlib backend equivalent is \"before\"->\"data\", \"after\"->\"screen\". styles: dictionary A dictionary in which each value is a list of length N, containing the style(s) for the paths. mplobj : matplotlib object the matplotlib plot element which generated this collection", "label": 1, "domain": "code", "token_count": 325, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0541", "text": "/* function assembleOffsets (endpoint, callback) { var items = [], offset = 0, limit = 25; endpoint.get({offset: offset, limit: limit}, withPayload); function withPayload (err, json) { if (!err) { if (json.data) { items = items.concat(json.data); if (json.data.length) { return endpoint.get({offset: offset += 25, limit: limit}, withPayload); } } } callback(err, items); } }; function assemblePagination (endpoint, callback) { var items = []; endpoint.get(withPayload); function withPayload (err, json) { if (err) { callback(err, items); } else { if (json.data) { items = items.concat(json.data); } if (json.paging && json.paging.next) { next(json.paging.next); } else { callback(err, items); } } } function next (url) { rem.url(url).get(function (err, res) { rem.consume(res, function (data) { withPayload(err, JSON.parse(String(data))); }); }); } } rem.assemble = assembleOffsets; Create Facebook API, prompting for key/secret. var facebook = rem.load('facebook', 1).prompt(); Authenticate user via the console. rem.console(facebook, function (err, user) { Poll new statuses at an interval of 1 second, finding the array at the 'data' key and checking the 'date' key for date comparison. assemblePagination(user('me/statuses', {limit: 500}), function (err, json) { json.forEach(function (item) { console.log(item.message, item.updated_time); }) }); });", "label": 1, "domain": "code", "token_count": 339, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0542", "text": "Execute the script 'gerador_vips' several times with options -real, -add and -del to adjust vip request reals. :param id_vip: Identifier of the VIP. Integer value and greater than zero. :param method_bal: method_bal. :param reals: List of reals. Ex: [{'real_name':'Teste1', 'real_ip':'10.10.10.1'},{'real_name':'Teste2', 'real_ip':'10.10.10.2'}] :param reals_prioritys: List of reals_priority. Ex: ['1','5','3']. :param reals_weights: List of reals_weight. Ex: ['1','5','3']. :param alter_priority: 1 if priority has changed and 0 if hasn't changed. :return: None :raise VipNaoExisteError: Request VIP not registered. :raise InvalidParameterError: Identifier of the request is invalid or null VIP. :raise DataBaseError: Networkapi failed to access the database. :raise XMLError: Networkapi failed to generate the XML response. :raise EnvironmentVipError: The combination of finality, client and environment is invalid. :raise InvalidTimeoutValueError: The value of timeout is invalid. :raise InvalidBalMethodValueError: The value of method_bal is invalid. :raise InvalidCacheValueError: The value of cache is invalid. :raise InvalidPersistenceValueError: The value of persistence is invalid. :raise InvalidPriorityValueError: One of the priority values is invalid. :raise EquipamentoNaoExisteError: The equipment associated with this Vip Request doesn't exist. :raise IpEquipmentError: Association between equipment and ip of this Vip Request doesn't exist. :raise IpError: IP not registered. :raise RealServerPriorityError: Vip Request priority list has an error. :raise RealServerWeightError: Vip Request weight list has an error. :raise RealServerPortError: Vip Request port list has an error. :raise RealParameterValueError: Vip Request real server parameter list has an error. :raise RealServerScriptError: Vip Request real server script execution error.", "label": 1, "domain": "code", "token_count": 456, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0543", "text": "Get links from the client site, check them, and post the results back. Get resource IDs from the client site, get the URL for each resource ID from the client site, check each URL, and post the results back to the client site. This function can be called repeatedly to keep on getting more links from the client site and checking them. The functions that this function calls to carry out the various tasks are taken as parameters to this function for testing purposes - it makes it easy for tests to pass in mock functions. It also decouples the code nicely. :param client_site_url: the base URL of the client site :type client_site_url: string :param apikey: the API key to use when making requests to the client site :type apikey: string or None :param get_resource_ids_to_check: The function to call to get the list of resource IDs to be checked from the client site. See get_resource_ids_to_check() above for the interface that this function should implement. :type get_resource_ids_to_check: callable :param get_url_for_id: The function to call to get the URL for a given resource ID from the client site. See get_url_for_id() above for the interface that this function should implement. :type get_url_for_id: callable :param check_url: The function to call to check whether a URL is dead or alive. See check_url() above for the interface that this function should implement. :type check_url: callable :param upsert_result: The function to call to post a link check result to the client site. See upsert_result() above for the interface that this function should implement. :type upsert_result: callable", "label": 1, "domain": "code", "token_count": 342, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0544", "text": "/* HEADER 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESPONSE_LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ERROR_CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ RESPONSE_LENGTH = int32 // Length in bytes of entire response (excluding this field) ERROR_CODE = int16 // See table below. ================ ===== =================================================== ERROR_CODE VALUE DEFINITION ================ ===== =================================================== Unknown -1 Unknown Error NoError 0 Success OffsetOutOfRange 1 Offset requested is no longer available on the server InvalidMessage 2 A message you sent failed its checksum and is corrupt. WrongPartition 3 You tried to access a partition that doesn't exist (was not between 0 and (num_partitions - 1)). InvalidFetchSize 4 The size you requested for fetching is smaller than the message you're trying to fetch. ================ ===== =================================================== /* 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / RESPONSE HEADER / / / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / MESSAGES (0 or more) / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+", "label": 1, "domain": "code", "token_count": 351, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0545", "text": "@!group Actions @example Request syntax with placeholder values bucket = s3.create_bucket({ acl: \"private\", # accepts private, public-read, public-read-write, authenticated-read bucket: \"BucketName\", # required create_bucket_configuration: { location_constraint: \"EU\", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1 }, grant_full_control: \"GrantFullControl\", grant_read: \"GrantRead\", grant_read_acp: \"GrantReadACP\", grant_write: \"GrantWrite\", grant_write_acp: \"GrantWriteACP\", object_lock_enabled_for_bucket: false, }) @param [Hash] options ({}) @option options [String] :acl The canned ACL to apply to the bucket. @option options [required, String] :bucket @option options [Types::CreateBucketConfiguration] :create_bucket_configuration @option options [String] :grant_full_control Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. @option options [String] :grant_read Allows grantee to list the objects in the bucket. @option options [String] :grant_read_acp Allows grantee to read the bucket ACL. @option options [String] :grant_write Allows grantee to create, overwrite, and delete any object in the bucket. @option options [String] :grant_write_acp Allows grantee to write the ACL for the applicable bucket. @option options [Boolean] :object_lock_enabled_for_bucket Specifies whether you want S3 Object Lock to be enabled for the new bucket. @return [Bucket]", "label": 1, "domain": "code", "token_count": 370, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0546", "text": "Creates a new FileResult object. @class The FileResult class is used to store the file information. @property {string} share The share name. @property {string} directory The directory name. @property {string} name The file name. @property {object} metadata The metadata key/value pair. @property {string} etag The etag. @property {string} lastModified The date/time that the file was last modified. @property {string} requestId The request id. @property {string} acceptRanges The accept ranges. @property {string} serverEncrypted If the file data and application metadata are completely encrypted using the specified algorithm. true/false. @property {string} contentRange The content range @property {string} contentLength The size of the file in bytes. @property {object} contentSettings The content settings. @property {string} contentSettings.contentType The content type. @property {string} contentSettings.contentEncoding The content encoding. @property {string} contentSettings.contentLanguage The content language. @property {string} contentSettings.cacheControl The cache control. @property {string} contentSettings.contentDisposition The content disposition. @property {string} contentSettings.contentMD5 The content MD5 hash. @property {object} copy The copy information. @property {string} copy.id The copy id. @property {string} copy.status The copy status. @property {string} copy.completionTime The copy completion time. @property {string} copy.statusDescription The copy status description. @property {string} copy.progress The copy progress. @property {string} copy.source The copy source. @constructor @param {string} [share] The share name. @param {string} [directory] The directory name. @param {string} [name] The file name.", "label": 1, "domain": "code", "token_count": 373, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0547", "text": "

    Perform am URI path escape operation on a String input, writing results to a Writer.

    The following are the only allowed chars in an URI path (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • /

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0548", "text": "

    Perform am URI path segment escape operation on a char[] input using UTF-8 as encoding.

    The following are the only allowed chars in an URI path segment (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the UTF-8 and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0549", "text": "@!group Actions @example Request syntax with placeholder values bucket_acl.put({ acl: \"private\", # accepts private, public-read, public-read-write, authenticated-read access_control_policy: { grants: [ { grantee: { display_name: \"DisplayName\", email_address: \"EmailAddress\", id: \"ID\", type: \"CanonicalUser\", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group uri: \"URI\", }, permission: \"FULL_CONTROL\", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP }, ], owner: { display_name: \"DisplayName\", id: \"ID\", }, }, content_md5: \"ContentMD5\", grant_full_control: \"GrantFullControl\", grant_read: \"GrantRead\", grant_read_acp: \"GrantReadACP\", grant_write: \"GrantWrite\", grant_write_acp: \"GrantWriteACP\", }) @param [Hash] options ({}) @option options [String] :acl The canned ACL to apply to the bucket. @option options [Types::AccessControlPolicy] :access_control_policy @option options [String] :content_md5 @option options [String] :grant_full_control Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. @option options [String] :grant_read Allows grantee to list the objects in the bucket. @option options [String] :grant_read_acp Allows grantee to read the bucket ACL. @option options [String] :grant_write Allows grantee to create, overwrite, and delete any object in the bucket. @option options [String] :grant_write_acp Allows grantee to write the ACL for the applicable bucket. @return [EmptyStructure]", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0550", "text": "Parses command line arguments into a Map. Arguments of the form

    -flag1 arg1a arg1b ... arg1m -flag2 -flag3 arg3a ... arg3n

    will be parsed so that the flag is a key in the Map (including the hyphen) and its value will be a {@link String}[] containing the optional arguments (if present). The non-flag values not captured as flag arguments are collected into a String[] array and returned as the value of null in the Map. In this invocation, the maximum number of arguments for each flag can be specified as an {@link Integer} value of the appropriate flag key in the flagsToNumArgs {@link Map} argument. (By default, flags cannot take arguments.)

    Example of usage:

    Map flagsToNumArgs = new HashMap(); flagsToNumArgs.put(\"-x\",new Integer(2)); flagsToNumArgs.put(\"-d\",new Integer(1)); Map result = argsToMap(args,flagsToNumArgs);

    If a given flag appears more than once, the extra args are appended to the String[] value for that flag. @param args the argument array to be parsed @param flagsToNumArgs a {@link Map} of flag names to {@link Integer} values specifying the maximum number of allowed arguments for that flag (default 0). @return a {@link Map} of flag names to flag argument {@link String} arrays.", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0551", "text": "set parameters in the user parameters these parameters are accepted: :param git_uri: str, uri of the git repository for the source :param git_ref: str, commit ID of the branch to be pulled :param git_branch: str, branch name of the branch to be pulled :param base_image: str, name of the parent image :param name_label: str, label of the parent image :param user: str, name of the user requesting the build :param component: str, name of the component :param release: str, :param build_image: str, :param build_imagestream: str, :param build_from: str, :param build_type: str, orchestrator or worker :param platforms: list of str, platforms to build on :param platform: str, platform :param koji_target: str, koji tag with packages used to build the image :param koji_task_id: str, koji ID :param koji_parent_build: str, :param koji_upload_dir: str, koji directory where the completed image will be uploaded :param flatpak: if we should build a Flatpak OCI Image :param flatpak_base_image: str, name of the Flatpack OCI Image :param reactor_config_map: str, name of the config map containing the reactor environment :param reactor_config_override: dict, data structure for reactor config to be injected as an environment variable into a worker build; when used, reactor_config_map is ignored. :param yum_repourls: list of str, uris of the yum repos to pull from :param signing_intent: bool, True to sign the resulting image :param compose_ids: list of int, ODCS composes to use instead of generating new ones :param filesystem_koji_task_id: int, Koji Task that created the base filesystem :param platform_node_selector: dict, a nodeselector for a user_paramsific platform :param scratch_build_node_selector: dict, a nodeselector for scratch builds :param explicit_build_node_selector: dict, a nodeselector for explicit builds :param auto_build_node_selector: dict, a nodeselector for auto builds :param isolated_build_node_selector: dict, a nodeselector for isolated builds :param operator_manifests_extract_platform: str, indicates which platform should upload operator manifests to koji :param parent_images_digests: dict, mapping image digests to names and platforms", "label": 1, "domain": "code", "token_count": 483, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0552", "text": "If isCaseSensite is true, the equality is case sensitive, otherwise it is case insensitive. Answers true if the name contains the fragment at the starting index startIndex, otherwise false.

    For example:

    1.  fragment = { 'b', 'c' , 'd' } name = { 'a', 'b', 'c' , 'd' } startIndex = 1 isCaseSensitive = true result => true 
    2.  fragment = { 'b', 'c' , 'd' } name = { 'a', 'b', 'C' , 'd' } startIndex = 1 isCaseSensitive = true result => false 
    3.  fragment = { 'b', 'c' , 'd' } name = { 'a', 'b', 'C' , 'd' } startIndex = 0 isCaseSensitive = false result => false 
    4.  fragment = { 'b', 'c' , 'd' } name = { 'a', 'b'} startIndex = 0 isCaseSensitive = true result => false 
    @param fragment the fragment to check @param name the array to check @param startIndex the starting index @param isCaseSensitive check whether or not the equality should be case sensitive @return true if the name contains the fragment at the starting index startIndex according to the value of isCaseSensitive, otherwise false. @throws NullPointerException if fragment or name is null.", "label": 1, "domain": "code", "token_count": 344, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0553", "text": "Creates a channel on this server with the given name. @note If parent is provided, permission overwrites have the follow behavior: 1. If overwrites is null, the new channel inherits the parent's permissions. 2. If overwrites is [], the new channel inherits the parent's permissions. 3. If you supply one or more overwrites, the channel will be created with those permissions and ignore the parents. @param name [String] Name of the channel to create @param type [Integer, Symbol] Type of channel to create (0: text, 2: voice, 4: category, 5: news, 6: store) @param topic [String] the topic of this channel, if it will be a text channel @param bitrate [Integer] the bitrate of this channel, if it will be a voice channel @param user_limit [Integer] the user limit of this channel, if it will be a voice channel @param permission_overwrites [Array, Array] permission overwrites for this channel @param parent [Channel, #resolve_id] parent category for this channel to be created in. @param nsfw [true, false] whether this channel should be created as nsfw @param rate_limit_per_user [Integer] how many seconds users need to wait in between messages. @param reason [String] The reason the for the creation of this channel. @return [Channel] the created channel. @raise [ArgumentError] if type is not 0 (text), 2 (voice), 4 (category), 5 (news), or 6 (store)", "label": 1, "domain": "code", "token_count": 335, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0554", "text": "Helper function for taking a string (i.e. a Unicode character name) and transforming it via UAX44-LM2 loose matching rule. For more information, see . The rule is defined as follows: \"UAX44-LM2. Ignore case, whitespace, underscore ('_'), and all medial hyphens except the hyphen in U+1180 HANGUL JUNGSEONG O-E.\" Therefore, correctly implementing the rule involves performing the following three operations, in order: 1. remove all medial hyphens (except the medial hyphen in the name for U+1180) 2. remove all whitespace and underscore characters 3. apply toLowercase() to both strings A \"medial hyphen\" is defined as follows (quoted from the above referenced web page): \"In this rule 'medial hyphen' is to be construed as a hyphen occurring immediately between two letters in the normative Unicode character name, as published in the Unicode names list, and not to any hyphen that may transiently occur medially as a result of removing whitespace before removing hyphens in a particular implementation of matching. Thus the hyphen in the name U+10089 LINEAR B IDEOGRAM B107M HE-GOAT is medial, and should be ignored in loose matching, but the hyphen in the name U+0F39 TIBETAN MARK TSA -PHRU is not medial, and should not be ignored in loose matching.\" :param s: String to transform :return: String transformed per UAX44-LM2 loose matching rule.", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0555", "text": "Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.
    If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the list is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)
    Like the {@link #toArray()} method, this method acts as bridge between array-based and collection-based APIs. Further, this method allows precise control over the runtime type of the output array, and may, under certain circumstances, be used to save allocation costs.
    Suppose x is a list known to contain only strings. The following code can be used to dump the list into a newly allocated array of String:
    {@code String[] y = x.toArray(new String[0]); }

    Note that toArray(new Object[0]) is identical in function to toArray(). @param a the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose. @return an array containing the elements of this list @throws ArrayStoreException if the runtime type of the specified array is not a supertype of the runtime type of every element in this list @throws NullPointerException if the specified array is null", "label": 1, "domain": "code", "token_count": 385, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0556", "text": "Search using CloudMine's geoquery API. @param {string} field Field to search on. @param {number} longitude The longitude to search for objects at. @param {number} latitude The latitude to search for objects at. @param {object} [options] Override defaults set on WebService. See WebService constructor for parameters. @param {string} [options.units = 'km'] The unit to use when not specified for. Can be 'km', 'mi', 'm', 'ft'. @param {boolean} [options.distance = false] If true, include distance calculations in the meta result for objects. @param {string|number} [options.radius] Distance around the target. If string, include units. If number, specify the unit in options.unit. @return {APICall} An APICall instance for the web service request used to attach events. Search using CloudMine's geoquery API. @param {string} field Field to search on. @param {object} target A reference object that has geo-location data. @param {object} [options] Override defaults set on WebService. See WebService constructor for parameters. @param {string} [options.units = 'km'] The unit to use when not specified for. Can be 'km', 'mi', 'm', 'ft'. @param {boolean} [options.distance = false] If true, include distance calculations in the meta result for objects. @param {string|number} [options.radius] Distance around the target. If string, include units. If number, specify the unit in options.unit. @return {APICall} An APICall instance for the web service request used to attach events. @function @name searchGeo^2 @memberOf WebService.prototype", "label": 1, "domain": "code", "token_count": 366, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0557", "text": "Lists report records by Product. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param filter [String] | Field | Usage | Supported operators | Supported functions |
    |-------------|-------------|-------------|-------------|
    | timestamp | filter | ge, le | |
    | displayName | select, orderBy | | |
    | apiRegion | filter | eq | |
    | userId | filter | eq | |
    | productId | select, filter | eq | |
    | subscriptionId | filter | eq | |
    | callCountSuccess | select, orderBy | | |
    | callCountBlocked | select, orderBy | | |
    | callCountFailed | select, orderBy | | |
    | callCountOther | select, orderBy | | |
    | callCountTotal | select, orderBy | | |
    | bandwidth | select, orderBy | | |
    | cacheHitsCount | select | | |
    | cacheMissCount | select | | |
    | apiTimeAvg | select, orderBy | | |
    | apiTimeMin | select | | |
    | apiTimeMax | select | | |
    | serviceTimeAvg | select | | |
    | serviceTimeMin | select | | |
    | serviceTimeMax | select | | |
    @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param orderby [String] OData order by query option. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ReportCollection] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 378, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0558", "text": "chi-squared test of difference between two transition matrices. Parameters ---------- T1 : array (k, k), matrix of transitions (counts). T2 : array (k, k), matrix of transitions (counts) to use to form the probabilities under the null. Returns ------- : tuple (3 elements). (chi2 value, pvalue, degrees of freedom). Examples -------- >>> import libpysal >>> from giddy.markov import Spatial_Markov, chi2 >>> f = libpysal.io.open(libpysal.examples.get_path(\"usjoin.csv\")) >>> years = list(range(1929, 2010)) >>> pci = np.array([f.by_col[str(y)] for y in years]).transpose() >>> rpci = pci/(pci.mean(axis=0)) >>> w = libpysal.io.open(libpysal.examples.get_path(\"states48.gal\")).read() >>> w.transform='r' >>> sm = Spatial_Markov(rpci, w, fixed=True) >>> T1 = sm.T[0] >>> T1 array([[562., 22., 1., 0.], [ 12., 201., 22., 0.], [ 0., 17., 97., 4.], [ 0., 0., 3., 19.]]) >>> T2 = sm.transitions >>> T2 array([[884., 77., 4., 0.], [ 68., 794., 87., 3.], [ 1., 92., 815., 51.], [ 1., 0., 60., 903.]]) >>> chi2(T1,T2) (23.39728441473295, 0.005363116704861337, 9) Notes ----- Second matrix is used to form the probabilities under the null. Marginal sums from first matrix are distributed across these probabilities under the null. In other words the observed transitions are taken from T1 while the expected transitions are formed as follows .. math:: E_{i,j} = \\sum_j T1_{i,j} * T2_{i,j}/\\sum_j T2_{i,j} Degrees of freedom corrected for any rows in either T1 or T2 that have zero total transitions.", "label": 1, "domain": "code", "token_count": 470, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0559", "text": "Executes the provided block in a transaction, retrying as necessary. Returns the return value of the block. Exact number of retries and when they are performed are implementation details of the driver; the provided block should be idempotent, and should be prepared to be called more than once. The driver may retry the commit command within an active transaction or it may repeat the transaction and invoke the block again, depending on the error encountered if any. Note also that the retries may be executed against different servers. Transactions cannot be nested - InvalidTransactionOperation will be raised if this method is called when the session already has an active transaction. Exceptions raised by the block which are not derived from Mongo::Error stop processing, abort the transaction and are propagated out of with_transaction. Exceptions derived from Mongo::Error may be handled by with_transaction, resulting in retries of the process. Currently, with_transaction will retry commits and block invocations until at least 120 seconds have passed since with_transaction started executing. This timeout is not configurable and may change in a future driver version. @note with_transaction contains a loop, therefore the if with_transaction itself is placed in a loop, its block should not call next or break to control the outer loop because this will instead affect the loop in with_transaction. The driver will warn and abort the transaction if it detects this situation. @example Execute a statement in a transaction session.with_transaction(write_concern: {w: :majority}) do collection.update_one({ id: 3 }, { '$set' => { status: 'Inactive'} }, session: session) end @example Execute a statement in a transaction, limiting total time consumed Timeout.timeout(5) do session.with_transaction(write_concern: {w: :majority}) do collection.update_one({ id: 3 }, { '$set' => { status: 'Inactive'} }, session: session) end end @param [ Hash ] options The options for the transaction being started. These are the same options that start_transaction accepts. @raise [ Error::InvalidTransactionOperation ] If a transaction is already in progress or if the write concern is unacknowledged. @since 2.7.0", "label": 1, "domain": "code", "token_count": 439, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0560", "text": "Lists the usage details based on billingAccountId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later. @param billing_account_id [String] BillingAccount ID @param billing_period_name [String] Billing Period Name. @param expand [String] May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. @param filter [String] May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the most recent N usageDetails. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [UsageDetailsListResult] which provide lazy access to pages of the response.", "label": 1, "domain": "code", "token_count": 335, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0561", "text": "Internal: takes an array of hashes of signers required to complete a document and allows for setting several options. Not all options are currently dynamic but that's easy to change/add which I (and I'm sure others) will be doing in the future. template - Includes other optional fields only used when being called from a template email - The signer's email name - The signer's name embedded - Tells DocuSign if this is an embedded signer which determines whether or not to deliver emails. Also lets us authenticate them when they go to do embedded signing. Behind the scenes this is setting the clientUserId value to the signer's email. email_notification - Send an email or not role_name - The signer's role, like 'Attorney' or 'Client', etc. template_locked - Doesn't seem to work/do anything template_required - Doesn't seem to work/do anything anchor_string - The string of text to anchor the 'sign here' tab to document_id - If the doc you want signed isn't the first doc in the files options hash page_number - Page number of the sign here tab x_position - Distance horizontally from the anchor string for the 'sign here' tab to appear. Note: doesn't seem to currently work. y_position - Distance vertically from the anchor string for the 'sign here' tab to appear. Note: doesn't seem to currently work. sign_here_tab_text - Instead of 'sign here'. Note: doesn't work tab_label - TODO: figure out what this is", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0562", "text": "Returns a plain BigDecimal with a given scale.

    If the given scale (which must be zero or positive) is the same as or greater than the length of the decimal part (the scale) of this BigDecimal then trailing zeros will be added to the decimal part as necessary.

    If the given scale is less than the length of the decimal part (the scale) of this BigDecimal then trailing digits will be removed, and the rounding mode given by the second parameter is used to determine if the remaining digits are affected by a carry. In this case, an IllegalArgumentException is thrown if round is not a valid rounding mode.

    If round is MathContext.ROUND_UNNECESSARY, an ArithmeticException is thrown if any discarded digits are non-zero. @param scale The int specifying the scale of the resulting BigDecimal. @param round The int rounding mode to be used for the division (see the {@link MathContext} class). @return A plain BigDecimal with the given scale. @throws IllegalArgumentException if round is not a valid rounding mode. @throws ArithmeticException if scale is negative. @throws ArithmeticException if round is MathContext.ROUND_UNNECESSARY, and reducing scale would discard non-zero digits. @stable ICU 2.0 --public com.ibm.icu.math.BigDecimal setScale(int scale,int round){", "label": 1, "domain": "code", "token_count": 363, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0563", "text": " Determine whether the corresponding private key of 'public_key' produced 'signature'. verify_signature() will use the public key, signature scheme, and 'data' to complete the verification. >>> public, private = generate_rsa_public_and_private(2048) >>> data = b'The quick brown fox jumps over the lazy dog' >>> scheme = 'rsassa-pss-sha256' >>> signature, scheme = create_rsa_signature(private, data, scheme) >>> verify_rsa_signature(signature, scheme, public, data) True >>> verify_rsa_signature(signature, scheme, public, b'bad_data') False signature: A signature, as a string. This is the signature returned by create_rsa_signature(). signature_scheme: A string that indicates the signature scheme used to generate 'signature'. 'rsassa-pss-sha256' is currently supported. public_key: The RSA public key, a string in PEM format. data: Data used by securesystemslib.keys.create_signature() to generate 'signature'. 'data' (a string) is needed here to verify 'signature'. securesystemslib.exceptions.FormatError, if 'signature', 'signature_scheme', 'public_key', or 'data' are improperly formatted. securesystemslib.exceptions.UnsupportedAlgorithmError, if the signature scheme used by 'signature' is not one supported by securesystemslib.keys.create_signature(). securesystemslib.exceptions.CryptoError, if the private key cannot be decoded or its key type is unsupported. pyca/cryptography's RSAPublicKey.verifier() called to do the actual verification. Boolean. True if the signature is valid, False otherwise.", "label": 1, "domain": "code", "token_count": 344, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0564", "text": "Allows to asynchronously reduce {@link Iterator} of {@code Promise}s into a {@code Promise} with the help of {@link Collector}. You can control the amount of concurrently running {@code promises} and explicitly process exceptions and intermediate results.

    The main feature of this method is that you can set up {@code consumer} for different use cases, for example:

    • If one of the {@code promises} completes exceptionally, reduction will stop without waiting for all of the {@code promises} to be completed. A {@code Promise} with exception will be returned.
    • If one of the {@code promises} finishes with needed result, reduction will stop without waiting for all of the {@code promises} to be completed.
    • If a needed result accumulates before all of the {@code promises} run, reduction will stop without waiting for all of the {@code promises} to be completed.

    To implement the use cases, you need to set up the provided {@code consumer}'s {@link BiFunction#apply(Object, Object)} function. This function will be applied to each of the completed {@code promises} and corresponding accumulated result.

    When {@code apply} returns {@code null}, nothing happens and reduction continues. When {@link Try} with any result or exception is returned, the reduction stops without waiting for all of the {@code promises} to be completed and {@code Promise} with {@code Try}'s result or exception is returned . @param promises {@code Iterable} of {@code Promise}s @param maxCalls {@link ToIntFunction} which calculates max amount of concurrently running {@code Promise}s based on the {@code accumulator} value @param accumulator mutable supplier of the result @param consumer a {@link BiConsumer} which folds a result of each of the completed {@code promises} into accumulator for further processing @param finisher a {@link Function} which performs the final transformation from the intermediate accumulations @param recycler processes results of those {@code promises} which were completed after result of the reduction was returned @param type of input elements for this operation @param mutable accumulation type of the operation @param result type of the reduction operation @return a {@code Promise} which wraps accumulated result or exception.", "label": 1, "domain": "code", "token_count": 473, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0565", "text": " Return a string containing 'key_object' in encrypted form. Encrypted strings may be safely saved to a file. The corresponding decrypt_key() function can be applied to the encrypted string to restore the original key object. 'key_object' is a key (e.g., RSAKEY_SCHEMA, ED25519KEY_SCHEMA). This function relies on the pyca_crypto_keys.py module to perform the actual encryption. Encrypted keys use AES-256-CTR-Mode, and passwords are strengthened with PBKDF2-HMAC-SHA256 (100K iterations by default, but may be overriden in 'securesystemslib.settings.PBKDF2_ITERATIONS' by the user). http://en.wikipedia.org/wiki/Advanced_Encryption_Standard http://en.wikipedia.org/wiki/CTR_mode#Counter_.28CTR.29 https://en.wikipedia.org/wiki/PBKDF2 >>> ed25519_key = generate_ed25519_key() >>> password = 'secret' >>> encrypted_key = encrypt_key(ed25519_key, password).encode('utf-8') >>> securesystemslib.formats.ENCRYPTEDKEY_SCHEMA.matches(encrypted_key) True key_object: A key (containing also the private key portion) of the form 'securesystemslib.formats.ANYKEY_SCHEMA' password: The password, or passphrase, to encrypt the private part of the RSA key. 'password' is not used directly as the encryption key, a stronger encryption key is derived from it. securesystemslib.exceptions.FormatError, if the arguments are improperly formatted. securesystemslib.exceptions.CryptoError, if 'key_object' cannot be encrypted. None. An encrypted string of the form: 'securesystemslib.formats.ENCRYPTEDKEY_SCHEMA'.", "label": 1, "domain": "code", "token_count": 370, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0566", "text": "Determines the interfaces implemented by the classes from the lowest type to the highestType which are extended the given interfaceType.

    Insteed of {@link Class#getInterfaces()}, this function is exploring the super classes. This function does not explore super-interfaces of implemented interfaces.

     interface IA {} interface IB extends IA {} interface IC {} interface ID extends IB, IC {} class CA implements IC {} class CB extends CA {} class CC extends CB implements IB {} 
    This function replies for:
    • getAllDirectInterfaces(IA,null,null)={}
    • getAllDirectInterfaces(IB,null,null)={IA}
    • getAllDirectInterfaces(IC,null,null)={}
    • getAllDirectInterfaces(ID,null,null)={IB,IC}
    • getAllDirectInterfaces(CA,null,null)={IC}
    • getAllDirectInterfaces(CB,null,null)={IC}
    • getAllDirectInterfaces(CC,null,null)={IB,IC}
    @param is the highest type to explore in type hierarchy. @param lowestType is the lowest type to explore in type hierarchy. @param highestType is the highest type to explore in type hierarchy. @return the implemented interfaces. @since 5.0", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0567", "text": "Creates a ConfigValue from a plain Java boxed value, which may be a Boolean, Number, String, Map, Iterable, or null. A Map must be a Map from String to more values that can be supplied to fromAnyRef(). An Iterable must iterate over more values that can be supplied to fromAnyRef(). A Map will become a ConfigObject and an Iterable will become a ConfigList. If the Iterable is not an ordered collection, results could be strange, since ConfigList is ordered.

    In a Map passed to fromAnyRef(), the map's keys are plain keys, not path expressions. So if your Map has a key \"foo.bar\" then you will lookup one object with a key called \"foo.bar\", rather than an object with a key \"foo\" containing another object with a key \"bar\".

    The originDescription will be used to set the origin() field on the ConfigValue. It should normally be the name of the file the values came from, or something short describing the value such as \"default settings\". The originDescription is prefixed to error messages so users can tell where problematic values are coming from.

    Supplying the result of ConfigValue.unwrapped() to this function is guaranteed to work and should give you back a ConfigValue that matches the one you unwrapped. The re-wrapped ConfigValue will lose some information that was present in the original such as its origin, but it will have matching values.

    This function throws if you supply a value that cannot be converted to a ConfigValue, but supplying such a value is a bug in your program, so you should never handle the exception. Just fix your program (or report a bug against this library). @param object object to convert to ConfigValue @param originDescription name of origin file or brief description of what the value is @return a new value", "label": 1, "domain": "code", "token_count": 380, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0568", "text": "Lists the usage details based on departmentId for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later. @param department_id [String] Department ID @param billing_period_name [String] Billing Period Name. @param expand [String] May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. @param filter [String] May be used to filter usageDetails by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the most recent N usageDetails. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0569", "text": "Initializes a new Whois::Client with settings. If block is given, yields self. @param [Hash] settings Hash of settings to customize the client behavior. @option settings [Integer, nil] :timeout (DEFAULT_TIMEOUT) The timeout for a WHOIS query, expressed in seconds. @option settings [String] :bind_host (nil) Providing an IP address or hostname will bind the Socket connection to the specific local host. @option settings [Fixnum] :bind_port (nil) Providing port number will bind the Socket connection to the specific local port. @option settings [String, nil] :host (nil) The server host to query. Leave it blank for intelligent detection. @option settings [Boolean, nil] :referral (nil) Set to +false+ to disable queries to referral WHOIS servers. @yield [self] @example Creating a new Client client = Whois::Client.new client.lookup(\"google.com\") @example Creating a new Client with custom settings client = Whois::Client.new(:timeout => nil) client.lookup(\"google.com\") @example Creating a new Client an yield the instance Whois::Client.new do |c| c.lookup(\"google.com\") end @example Binding the requests to a custom local IP client = Whois::Client.new(:bind_host => \"127.0.0.1\", :bind_port => 80) client.lookup(\"google.com\") Lookups the right WHOIS server for object and returns the response from the server. @param [#to_s] object The string to be sent as lookup parameter. @return [Whois::Record] The object containing the WHOIS response. @raise [Timeout::Error] @example client.lookup(\"google.com\") # => #", "label": 1, "domain": "code", "token_count": 391, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0570", "text": "Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increasing frequencies (not angular frequencies) up to hifac times the \"average\" Nyquist frequency, and creates an array wk2 with the values of the Lomb normalized periodogram at those frequencies. The arrays x and y are not altered. This routine also returns jmax such that wk2(jmax) is the maximum element in wk2, and prob, an estimate of the significance of that maximum against the hypothesis of random noise. A small value of prob indicates that a significant periodic signal is present. Reference: Press, W. H. & Rybicki, G. B. 1989 ApJ vol. 338, p. 277-280. Fast algorithm for spectral analysis of unevenly sampled data (1989ApJ...338..277P) Arguments: X : Abscissas array, (e.g. an array of times). Y : Ordinates array, (e.g. corresponding counts). Ofac : Oversampling factor. Hifac : Hifac * \"average\" Nyquist frequency = highest frequency for which values of the Lomb normalized periodogram will be calculated. n_threads : number of threads to use. Returns: Wk1 : An array of Lomb periodogram frequencies. Wk2 : An array of corresponding values of the Lomb periodogram. Nout : Wk1 & Wk2 dimensions (number of calculated frequencies) Jmax : The array index corresponding to the MAX( Wk2 ). Prob : False Alarm Probability of the largest Periodogram value MACC : Number of interpolation points per 1/4 cycle of highest frequency History: 02/23/2009, v1.0, MF Translation of IDL code (orig. Numerical recipies)", "label": 1, "domain": "code", "token_count": 405, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0571", "text": "Calculate the smoothing parameter value. The following example is explained in some detail in module |smoothtools|: >>> from hydpy.models.dam import * >>> parameterstep() >>> highestremotedischarge(1.0) >>> highestremotetolerance(0.0) >>> derived.highestremotesmoothpar.update() >>> from hydpy.cythons.smoothutils import smooth_min1 >>> from hydpy import round_ >>> round_(smooth_min1(-4.0, 1.5, derived.highestremotesmoothpar)) -4.0 >>> highestremotetolerance(2.5) >>> derived.highestremotesmoothpar.update() >>> round_(smooth_min1(-4.0, -1.5, derived.highestremotesmoothpar)) -4.01 Note that the example above corresponds to the example on function |calc_smoothpar_min1|, due to the value of parameter |HighestRemoteDischarge| being 1 m³/s. Doubling the value of |HighestRemoteDischarge| also doubles the value of |HighestRemoteSmoothPar| proportional. This leads to the following result: >>> highestremotedischarge(2.0) >>> derived.highestremotesmoothpar.update() >>> round_(smooth_min1(-4.0, 1.0, derived.highestremotesmoothpar)) -4.02 This relationship between |HighestRemoteDischarge| and |HighestRemoteSmoothPar| prevents from any smoothing when the value of |HighestRemoteDischarge| is zero: >>> highestremotedischarge(0.0) >>> derived.highestremotesmoothpar.update() >>> round_(smooth_min1(1.0, 1.0, derived.highestremotesmoothpar)) 1.0 In addition, |HighestRemoteSmoothPar| is set to zero if |HighestRemoteDischarge| is infinity (because no actual value will ever come in the vicinit of infinity), which is why no value would be changed through smoothing anyway): >>> highestremotedischarge(inf) >>> derived.highestremotesmoothpar.update() >>> round_(smooth_min1(1.0, 1.0, derived.highestremotesmoothpar)) 1.0", "label": 1, "domain": "code", "token_count": 472, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0572", "text": "The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.

    CallBack Schemas

    Review Completion CallBack Sample

    {
    \"ReviewId\": \"\",
    \"ModifiedOn\": \"2016-10-11T22:36:32.9934851Z\",
    \"ModifiedBy\": \"\",
    \"CallBackType\": \"Review\",
    \"ContentId\": \"\",
    \"Metadata\": {
    \"adultscore\": \"0.xxx\",
    \"a\": \"False\",
    \"racyscore\": \"0.xxx\",
    \"r\": \"True\"
    },
    \"ReviewerResultTags\": {
    \"a\": \"False\",
    \"r\": \"True\"
    }
    }

    . @param content_type [String] The content type. @param team_name [String] Your team name. @param create_video_reviews_body [Array] Body for create reviews API @param sub_team [String] SubTeam of your team, you want to assign the created review to. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 341, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0573", "text": "API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and the difference in time have to be less than 31 days. :param block_name: name of the block :type block_name: str :param dataset: dataset :type dataset: str :param data_tier_name: data tier :type data_tier_name: str :param logical_file_name: Logical File Name :type logical_file_name: str :param origin_site_name: Origin Site Name (Optional) :type origin_site_name: str :param open_for_writing: Open for Writting (Optional) :type open_for_writing: int (0 or 1) :param run_num: run_num numbers (Optional). Possible format are: run_num, 'run_min-run_max' or ['run_min-run_max', run1, run2, ...]. :type run_num: int, list of runs or list of run ranges :param min_cdate: Lower limit for the creation date (unixtime) (Optional) :type min_cdate: int, str :param max_cdate: Upper limit for the creation date (unixtime) (Optional) :type max_cdate: int, str :param min_ldate: Lower limit for the last modification date (unixtime) (Optional) :type min_ldate: int, str :param max_ldate: Upper limit for the last modification date (unixtime) (Optional) :type max_ldate: int, str :param cdate: creation date (unixtime) (Optional) :type cdate: int, str :param ldate: last modification date (unixtime) (Optional) :type ldate: int, str :param detail: Get detailed information of a block (Optional) :type detail: bool :returns: List of dictionaries containing following keys (block_name). If option detail is used the dictionaries contain the following keys (block_id, create_by, creation_date, open_for_writing, last_modified_by, dataset, block_name, file_count, origin_site_name, last_modification_date, dataset_id and block_size) :rtype: list of dicts", "label": 1, "domain": "code", "token_count": 473, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0574", "text": "Runs GATK Variant Quality Score Recalibration. 0: Start 0 --> 1 --> 3 --> 4 --> 5 1: Recalibrate SNPs | | 2: Recalibrate INDELS +-> 2 -+ 3: Apply SNP Recalibration 4: Apply INDEL Recalibration 5: Write VCF to output directory :param JobFunctionWrappingJob job: passed automatically by Toil :param str uuid: unique sample identifier :param str vcf_id: VCF FileStoreID :param Namespace config: Pipeline configuration options and shared files Requires the following config attributes: config.genome_fasta FilesStoreID for reference genome fasta file config.genome_fai FilesStoreID for reference genome fasta index file config.genome_dict FilesStoreID for reference genome sequence dictionary file config.cores Number of cores for each job config.xmx Java heap size in bytes config.suffix Suffix for output filename config.output_dir URL or local path to output directory config.ssec Path to key file for SSE-C encryption SNP VQSR attributes: config.snp_filter_annotations List of GATK variant annotations config.hapmap FileStoreID for HapMap resource file config.omni FileStoreID for Omni resource file config.dbsnp FileStoreID for dbSNP resource file config.g1k_snp FileStoreID for 1000G SNP resource file INDEL VQSR attributes: config.indel_filter_annotations List of GATK variant annotations config.dbsnp FileStoreID for dbSNP resource file config.mills FileStoreID for Mills resource file :return: SNP and INDEL VQSR VCF FileStoreID :rtype: str", "label": 1, "domain": "code", "token_count": 348, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0575", "text": "This method makes a \"best effort\" to make an {@link Interval} out of a TIMEX2 value string.
    TIMEX2 value (or date-time) strings are superset of ISO 8601 periods. For example, TIMEX2 values can have seasons (like SU for summer, FA for fall, etc) or periods of day (like MO for morning, NI for night), or unspecified values like 1999-09-XX (See section 4.3 of the specification). For such values that make the intervals fuzzy, we will try to find the interval upto which the timex value is specific. For example, 1999-09-08TNI will return the interval for 1999-09-08, and 1999-FA or 1999-WXX will return the interval for 1999. However, we reserve the right to make specific inferences from non-ISO markers in future implementations (e.g. FA could mean the period from third week of September to third week of December).
    TIMEX2 values with omissions, like VAL=\"199\" (meaning the decade of 1990s) or VAL=\"20\" (meaning the 21st century) will be converted to approriate interval values (10 years or 100 years respectively, for this example).
    If no interval can be discerned from the value at all, for example, XXXX-09 (September of unspecified year) or XX63 (63rd year of unspecified year), Optional.absent() will be returned. @param valSym timex-value as Symbol @return Optional {@link Interval} object (see the description for when Optional.absent will be returned). @author rgabbard, msrivast", "label": 1, "domain": "code", "token_count": 362, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0576", "text": "Pattern matching using AST on JavaScript source code @param pattern The pattern to be matched @return Returns a function that takes source code string (or estree syntax tree) as input, produces matched result or undefined. __any matches any single node, but no extract __anl matches array of nodes, but no extract __str matches string literal, but no extract __arr matches array of partial string literals, but no extract __any_aName matches single node, return {aName: node} __anl_aName matches array of nodes, return {aName: array_of_nodes} __str_aName matches string literal, return {aName: value} __arr_aName matches array, extract string literals, return {aName: [values]} note: __arr_aName can match partial array [foo, \"foo\", lorem, \"bar\", lorem] => [\"foo\", \"bar\"] note: __anl, and __arr_* use method(__anl) or method(__arr_a) to match method(a, \"b\"); use method([__anl]) or method([__arr_a]) to match method([a, \"b\"]); Usage: let m = astMatcher('__any.method(__str_foo, [__arr_opts])'); m('au.method(\"a\", [\"b\", \"c\"]); jq.method(\"d\", [\"e\"])'); => [ {match: {foo: \"a\", opts: [\"b\", \"c\"]}, node: } {match: {foo: \"d\", opts: [\"e\"]}, node: } ]", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0577", "text": "Find best pRF model for voxel time course. Parameters ---------- idxPrc : int Process ID of the process calling this function (for CPU multi-threading). In GPU version, this parameter is 0 (just one thread on CPU). vecMdlXpos : np.array 1D array with pRF model x positions. vecMdlYpos : np.array 1D array with pRF model y positions. vecMdlSd : np.array 1D array with pRF model sizes (SD of Gaussian). aryFunc : np.array 2D array with functional MRI data, with shape aryFunc[voxel, time]. aryPrfTc : np.array Array with pRF model time courses, with shape aryPrfTc[x-pos, y-pos, SD, motion-direction, time] varL2reg : float L2 regularisation factor for ridge regression. queOut : multiprocessing.queues.Queue Queue to put the results on. lgcPrint : boolean Whether print statements should be executed. Returns ------- lstOut : list List containing the following objects: idxPrc : int Process ID of the process calling this function (for CPU multi-threading). In GPU version, this parameter is 0. vecBstXpos : np.array 1D array with best fitting x-position for each voxel, with shape vecBstXpos[voxel]. vecBstYpos : np.array 1D array with best fitting y-position for each voxel, with shape vecBstYpos[voxel]. vecBstSd : np.array 1D array with best fitting pRF size for each voxel, with shape vecBstSd[voxel]. vecBstR2 : np.array 1D array with R2 value of 'winning' pRF model for each voxel, with shape vecBstR2[voxel]. dummy : np.array 2D array that is supposed to contain the beta values of 'winning' pRF models for each voxel, with shape aryBeta[voxel, beta]. AT THE MOMENT, CONTAINS EMPTY DUMMY ARRAY (np.zeros). Notes ----- Uses a queue that runs in a separate thread to put model time courses on the computational graph.", "label": 1, "domain": "code", "token_count": 461, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0578", "text": "Execute a read operation returning a cursor with retrying. This method performs server selection for the specified server selector and yields to the provided block, which should execute the initial query operation and return its result. The block will be passed the server selected for the operation. If the block raises an exception, and this exception corresponds to a read retryable error, and read retries are enabled for the client, this method will perform server selection again and yield to the block again (with potentially a different server). If the block returns successfully, the result of the block (which should be a Mongo::Operation::Result) is used to construct a Mongo::Cursor object for the result set. The cursor is then returned. If modern retry reads are on (which is the default), the initial read operation will be retried once. If legacy retry reads are on, the initial read operation will be retried zero or more times depending on the :max_read_retries client setting, the default for which is 1. To disable read retries, turn off modern read retries by setting retry_reads: false and set :max_read_retries to 0 on the client. @api private @example Execute a read returning a cursor. cursor = read_with_retry_cursor(session, server_selector, view) do |server| # return a Mongo::Operation::Result ... end @param [ Mongo::Session ] session The session that the operation is being run on. @param [ Mongo::ServerSelector::Selectable ] server_selector Server selector for the operation. @param [ CollectionView ] view The +CollectionView+ defining the query. @param [ Proc ] block The block to execute. @return [ Cursor ] The cursor for the result set.", "label": 1, "domain": "code", "token_count": 344, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0579", "text": "Get users. Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters. @param aioId A unique ID generated on the client (browser) when sending an API request that returns an asynchronous response. (required) @param limit Limit the number of users the Provisioning API should return. (optional) @param offset The number of matches the Provisioning API should skip in the returned users. (optional) @param order The sort order. (optional) @param sortBy A comma-separated list of fields to sort on. Possible values are firstName, lastName, and userName. (optional) @param filterName The name of a filter to use on the results. (optional) @param filterParameters A part of the users first or last name, if you use the FirstNameOrLastNameMatches filter. (optional) @param roles Return only return users who have these Workspace Web Edition roles. The roles can be specified in a comma-separated list. Possible values are ROLE_AGENT and ROLE_ADMIN,ROLE_SUPERVISOR. (optional) @param skills Return only users who have these skills. The skills can be specified in a comma-separated list. (optional) @param userEnabled Return only enabled or disabled users. (optional) @param userValid Return only valid or invalid users. (optional) @return ApiAsyncSuccessResponse @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body", "label": 1, "domain": "code", "token_count": 307, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0580", "text": "Vivus Beta version Take any SVG and make the animation to give give the impression of live drawing This in more than just inspired from codrops At that point, it's a pure fork. Class constructor option structure type: 'delayed'|'sync'|'oneByOne'|'script' (to know if the items must be drawn synchronously or not, default: delayed) duration: (in frames) start: 'inViewport'|'manual'|'autostart' (start automatically the animation, default: inViewport) delay: (delay between the drawing of first and last path) dashGap whitespace extra margin between dashes pathTimingFunction timing animation function for each path element of the SVG animTimingFunction timing animation function for the complete SVG forceRender force the browser to re-render all updated path items selfDestroy removes all extra styling on the SVG, and leaves it as original The attribute 'type' is by default on 'delayed'. - 'delayed' all paths are draw at the same time but with a little delay between them before start - 'sync' all path are start and finish at the same time - 'oneByOne' only one path is draw at the time the end of the first one will trigger the draw of the next one All these values can be overwritten individually for each path item in the SVG The value of frames will always take the advantage of the duration value. If you fail somewhere, an error will be thrown. Good luck. @constructor @this {Vivus} @param {DOM|String} element Dom element of the SVG or id of it @param {Object} options Options about the animation @param {Function} callback Callback for the end of the animation", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0581", "text": "Sum all numeric/specified vectors in the DataFrame. Returns a new vector that's a containing a sum of all numeric or specified vectors of the DataFrame. By default, if the vector contains a nil, the sum is nil. With :skipnil argument set to true, nil values are assumed to be 0 (zero) and the sum vector is returned. @param args [Array] List of vectors to sum. Default is nil in which case all numeric vectors are summed. @option opts [Boolean] :skipnil Consider nils as 0. Default is false. @return Vector with sum of all vectors specified in the argument. If vecs parameter is empty, sum all numeric vector. @example df = Daru::DataFrame.new({ a: [1, 2, nil], b: [2, 1, 3], c: [1, 1, 1] }) => # a b c 0 1 2 1 1 2 1 1 2 nil 3 1 df.vector_sum [:a, :c] => # 0 2 1 3 2 nil df.vector_sum => # 0 4 1 4 2 nil df.vector_sum skipnil: true => # c 0 4 1 4 2 4", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0582", "text": "@class This object describes a mapper item representing a diff block, which is an array of 3 numbers. @name orion.diff.mapperItem @property {number} mapperItem[0] the number of lines in the new version of the string. @property {number} mapperItem[1] the number of lines in the old version of the string. @property {number} mapperItem[2] the number that indicates the state of the diff block:
    • 0 - the diff block represents same lines on both side. mapperItem[0] and mapperItem[1] should be identical to represent the number of the same lines
    • -1 - the diff block represents that the new version has deleted lines. mapperItem[0] should be 0 and mapperItem[1] should represent the line number that was deleted
    • >0 - the diff block represents that the new version has added linies and the old version has deleted lines, if any. mapperItem[0] should be greater than 0 and mapperItem[1] should represent the line number that was deleted
    @class This object describes the result of the adapt call. @name orion.diff.jsdiff.result @property {array of orion.diff.mapperItem} mapper the array of diff blocks. E.G. [0, 1, -1], [2, 2, 0], [2, 0, 1], [4, 4, 0], @property {array of String} changContents the array of strings that represents all the added lines in the new version of the compare string. Returns the mapper object representing diff between two versions of a string. @param {String} oldStr the old version of the string @param {String} newStr the new version of the string @param {String} lineDelim optional the line delimeter of the string @returns {orion.diff.jsdiff.result} the result", "label": 1, "domain": "code", "token_count": 413, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0583", "text": "Replies if the triangle intersects the segment. Source:
    Juan J. Jimenez, Rafael J. Segura, Francisco R. Feito. \"A robust segment/triangle intersection algorithm for interference tests. Efficiency study\". Computational Geometry 43 (2010) pp 474-492. 2010. @param tx1 x coordinate of the first point of the triangle. @param ty1 y coordinate of the first point of the triangle. @param tz1 z coordinate of the first point of the triangle. @param tx2 x coordinate of the second point of the triangle. @param ty2 y coordinate of the second point of the triangle. @param tz2 z coordinate of the second point of the triangle. @param tx3 x coordinate of the third point of the triangle. @param ty3 y coordinate of the third point of the triangle. @param tz3 z coordinate of the third point of the triangle. @param sx1 x coordinate of the first point of the segment. @param sy1 y coordinate of the first point of the segment. @param sz1 z coordinate of the first axis of the oriented box. @param sx2 x coordinate of the second point of the segment. @param sy2 y coordinate of the second point of the segment. @param sz2 z coordinate of the second axis of the oriented box. @return true if the triangle and segment are intersecting.", "label": 1, "domain": "code", "token_count": 305, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0584", "text": "Bootstraps the cluster using the provided cluster configuration.

    Bootstrapping the cluster results in a new cluster being formed with the provided configuration. The initial nodes in a cluster must always be bootstrapped. This is necessary to prevent split brain. If the provided configuration is empty, the local server will form a single-node cluster.

    Only {@link Member.Type#ACTIVE} members can be included in a bootstrap configuration. If the local server is not initialized as an active member, it cannot be part of the bootstrap configuration for the cluster.

    When the cluster is bootstrapped, the local server will be transitioned into the active state and begin participating in the Raft consensus algorithm. When the cluster is first bootstrapped, no leader will exist. The bootstrapped members will elect a leader amongst themselves. Once a cluster has been bootstrapped, additional members may be {@link #join(Address...) joined} to the cluster. In the event that the bootstrapped members cannot reach a quorum to elect a leader, bootstrap will continue until successful.

    It is critical that all servers in a bootstrap configuration be started with the same exact set of members. Bootstrapping multiple servers with different configurations may result in split brain.

    The {@link CompletableFuture} returned by this method will be completed once the cluster has been bootstrapped, a leader has been elected, and the leader has been notified of the local server's client configurations. @param cluster The bootstrap cluster configuration. @return A completable future to be completed once the cluster has been bootstrapped.", "label": 1, "domain": "code", "token_count": 328, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0585", "text": "Induces quorum loss for a given stateful service partition. Induces quorum loss for a given stateful service partition. This API is useful for a temporary quorum loss situation on your service. Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with this API. This can only be called on stateful persisted (HasPersistedState==true) services. Do not use this API on stateless services or stateful in-memory only services. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param partition_id The identity of the partition. @param operation_id A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API @param quorum_loss_mode [QuorumLossMode] This enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to induce. Possible values include: 'Invalid', 'QuorumReplicas', 'AllReplicas' @param quorum_loss_duration [Integer] The amount of time for which the partition will be kept in quorum loss. This must be specified in seconds. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 407, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0586", "text": "@class This object describes the options to use while finding occurrences of a string in a text model. @name orion.editor.FindOptions @property {String} string the search string to be found. @property {Boolean} [regex=false] whether or not the search string is a regular expression. @property {Boolean} [wrap=false] whether or not to wrap search. @property {Boolean} [wholeWord=false] whether or not to search only whole words. @property {Boolean} [caseInsensitive=false] whether or not search is case insensitive. @property {Boolean} [reverse=false] whether or not to search backwards. @property {Number} [start=0] The start offset to start searching @property {Number} [rangeStart] The range start offset of the search. Used to search in a given range. @property {Number} [rangeEnd] The range end offset of the search. Used to search in a given range. @class This object represents a find occurrences iterator.

    See:
    {@link orion.editor.TextModel#find}

    @name orion.editor.FindIterator @property {Function} hasNext Determines whether there are more occurrences in the iterator. @property {Function} next Returns the next matched range {start,end} in the iterator. Finds occurrences of a string in the text model. @param {orion.editor.FindOptions} options the search options @return {orion.editor.FindIterator} the find occurrences iterator.", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0587", "text": "Set rop from an array of word data at op. The parameters specify the format of the data. count many words are read, each size bytes. order can be 1 for most significant word first or -1 for least significant first. Within each word endian can be 1 for most significant byte first, -1 for least significant first, or 0 for the native endianness of the host CPU. The most significant nails bits of each word are skipped, this can be 0 to use the full words. There is no sign taken from the data, rop will simply be a positive integer. An application can handle any sign itself, and apply it for instance with mpz_neg. There are no data alignment restrictions on op, any address is allowed. Here's an example converting an array of unsigned long data, most significant element first, and host byte order within each value.
    {@code unsigned long a[20]; // Initialize z and a mpzImport (z, 20, 1, sizeof(a[0]), 0, 0, a); }
    This example assumes the full sizeof bytes are used for data in the given type, which is usually true, and certainly true for unsigned long everywhere we know of. However on Cray vector systems it may be noted that short and int are always stored in 8 bytes (and with sizeof indicating that) but use only 32 or 46 bits. The nails feature can account for this, by passing for instance 8*sizeof(int)-INT_BIT.", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0588", "text": "@member Luc @method compare Return true if the values are equal to each other. By default a deep comparison is done on arrays, dates and objects and a strict comparison is done on other types. @param {Any} val1 @param {Any} val2 @param {Object} [config] @param {String} config.type pass in 'shallow' for a shallow comparison, 'deep' (default) for a deep comparison 'strict' for a strict === comparison for all objects or 'loose' for a loose comparison on objects. A loose comparison will compare the keys and values of val1 to val2 and does not check if keys from val2 are equal to the keys in val1. Luc.compare('1', 1) >false Luc.compare({a: 1}, {a: 1}) >true Luc.compare({a: 1, b: {}}, {a: 1, b: {} }, {type:'shallow'}) >false Luc.compare({a: 1, b: {}}, {a: 1, b: {} }, {type: 'deep'}) >true Luc.compare({a: 1, b: {}}, {a: 1, b: {} }, {type: 'strict'}) >false Luc.compare({a: 1}, {a:1,b:1}) >false Luc.compare({a: 1}, {a:1,b:1}, {type: 'loose'}) >true Luc.compare({a: 1}, {a:1,b:1}, {type: 'loose'}) >true Luc.compare([{a: 1}], [{a:1,b:1}], {type: 'loose'}) >true Luc.compare([{a: 1}, {}], [{a:1,b:1}], {type: 'loose'}) >false Luc.compare([{a: 1}, {}], [{a:1,b:1}, {}], {type: 'loose'}) >true Luc.compare([{a:1,b:1}], [{a: 1}], {type: 'loose'}) >false @return {Boolean}", "label": 1, "domain": "code", "token_count": 441, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0589", "text": "Returns a new client object. _options_ can be one of the following * A String containing the name of a YAML file formatted like: --- client_id: client_secret: host: login.salesforce.com debugging: true version: 23.0 sobject_module: My::Module ca_file: some/ca/file.cert verify_mode: OpenSSL::SSL::VERIFY_PEER * A Hash containing the following keys: client_id client_secret host debugging version sobject_module ca_file verify_mode If the environment variables DATABASEDOTCOM_CLIENT_ID, DATABASEDOTCOM_CLIENT_SECRET, DATABASEDOTCOM_HOST, DATABASEDOTCOM_DEBUGGING, DATABASEDOTCOM_VERSION, DATABASEDOTCOM_SOBJECT_MODULE, DATABASEDOTCOM_CA_FILE, and/or DATABASEDOTCOM_VERIFY_MODE are present, they override any other values provided Authenticate to the Force.com API. _options_ is a Hash, interpreted as follows: * If _options_ contains the keys :username and :password, those credentials are used to authenticate. In this case, the value of :password may need to include a concatenated security token, if required by your Salesforce org * If _options_ contains the key :provider, it is assumed to be the hash returned by Omniauth from a successful web-based OAuth2 authentication * If _options_ contains the keys :token and :instance_url, those are assumed to be a valid OAuth2 token and instance URL for a Salesforce account, obtained from an external source. _options_ may also optionally contain the key :refresh_token Raises SalesForceError if an error occurs", "label": 1, "domain": "code", "token_count": 355, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0590", "text": "Use these JPEG options for output image. @example // Convert any input to very high quality JPEG output const data = await sharp(input) .jpeg({ quality: 100, chromaSubsampling: '4:4:4' }) .toBuffer(); @param {Object} [options] - output options @param {Number} [options.quality=80] - quality, integer 1-100 @param {Boolean} [options.progressive=false] - use progressive (interlace) scan @param {String} [options.chromaSubsampling='4:2:0'] - set to '4:4:4' to prevent chroma subsampling when quality <= 90 @param {Boolean} [options.trellisQuantisation=false] - apply trellis quantisation, requires libvips compiled with support for mozjpeg @param {Boolean} [options.overshootDeringing=false] - apply overshoot deringing, requires libvips compiled with support for mozjpeg @param {Boolean} [options.optimiseScans=false] - optimise progressive scans, forces progressive, requires libvips compiled with support for mozjpeg @param {Boolean} [options.optimizeScans=false] - alternative spelling of optimiseScans @param {Boolean} [options.optimiseCoding=true] - optimise Huffman coding tables @param {Boolean} [options.optimizeCoding=true] - alternative spelling of optimiseCoding @param {Number} [options.quantisationTable=0] - quantization table to use, integer 0-8, requires libvips compiled with support for mozjpeg @param {Number} [options.quantizationTable=0] - alternative spelling of quantisationTable @param {Boolean} [options.force=true] - force JPEG output, otherwise attempt to use input format @returns {Sharp} @throws {Error} Invalid options", "label": 1, "domain": "code", "token_count": 381, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0591", "text": "Gets the list of applications deployed on a Service Fabric node. Gets the list of applications deployed on a Service Fabric node. The results do not include information about deployed system applications unless explicitly queried for by ID. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. @param node_name [String] The name of the node. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param include_health_state [Boolean] Include the health state of an entity. If this parameter is false or not specified, then the health state returned is \"Unknown\". When set to true, the query goes in parallel to the node and the health system service before the results are merged. As a result, the query is more expensive and may take a longer time. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 453, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0592", "text": "Creates a new log entry depending on its level and component. If the given level is higher than the max level for the given component (or higher than the global level, if no component is given), then no entry is created and undefined is returned. If an Error is passed via sDetails the stack of the Error will be logged as a separate parameter in the proper console function for the matching log level. @param {module:sap/base/Log.Level} iLevel One of the log levels FATAL, ERROR, WARNING, INFO, DEBUG, TRACE @param {string} sMessage The message to be logged @param {string|Error} [sDetails] The optional details for the message; could be an Error which will be logged with the stack to easily find the root cause of the Error @param {string} [sComponent] The log component under which the message should be logged @param {function} [fnSupportInfo] Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with logSupportInfo(true). To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content. @returns {object} The log entry as an object or undefined if no entry was created @private", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0593", "text": "Adds a new field (data_field) to the Datamat with data from the corresponding field of another Datamat (src_dm). This is accomplished through the use of a key_field, which is used to determine how the data is copied. This operation corresponds loosely to an SQL join operation. The two Datamats are essentially aligned by the unique values of key_field so that each block element of the new field of the target Datamat will consist of those elements of src_dm's data_field where the corresponding element in key_field matches. If 'take_first' is not true, and there is not only a single corresponding element (typical usage case) then the target element value will be a sequence (array) of all the matching elements. The target Datamat (self) must not have a field name data_field already, and both Datamats must have key_field. The new field in the target Datamat will be a masked array to handle non-existent data. TODO: Make example more generic, remove interoceptive reference TODO: Make standalone test Examples: >>> dm_intero = load_interoception_files ('test-ecg.csv', silent=True) >>> dm_emotiv = load_emotivestimuli_files ('test-bpm.csv', silent=True) >>> length(dm_intero) 4 >>> unique(dm_intero.subject_id) ['p05', 'p06'] >>> length(dm_emotiv) 3 >>> unique(dm_emotiv.subject_id) ['p04', 'p05', 'p06'] >>> 'interospective_awareness' in dm_intero.fieldnames() True >>> unique(dm_intero.interospective_awareness) == [0.5555, 0.6666] True >>> 'interospective_awareness' in dm_emotiv.fieldnames() False >>> dm_emotiv.copy_field(dm_intero, 'interospective_awareness', 'subject_id') >>> 'interospective_awareness' in dm_emotiv.fieldnames() True >>> unique(dm_emotiv.interospective_awareness) == [NaN, 0.5555, 0.6666] False", "label": 1, "domain": "code", "token_count": 443, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0594", "text": "Convert a list of lists of str into a reStructuredText Grid Table Parameters ---------- table : list of lists of str spans : list of lists of lists of int, optional These are [row, column] pairs of cells that are merged in the table. Rows and columns start in the top left of the table.For example:: +--------+--------+ | [0, 0] | [0, 1] | +--------+--------+ | [1, 0] | [1, 1] | +--------+--------+ use_headers : bool, optional Whether or not the first row of table data will become headers. center_cells : bool, optional Whether or not cells will be centered center_headers: bool, optional Whether or not headers will be centered Returns ------- str The grid table string Example ------- >>> spans = [ ... [ [3, 1], [4, 1] ], ... [ [3, 2], [4, 2] ], ... [ [2, 1], [2, 2] ], ... ] >>> table = [ ... [\"Header 1\", \"Header 2\", \"Header 3\"], ... [\"body row 1\", \"column 2\", \"column 3\"], ... [\"body row 2\", \"Cells may span columns\", \"\"], ... [\"body row 3\", \"Cells may span rows.\", \"- Cells\\\\n-contain\\\\n-blocks\"], ... [\"body row 4\", \"\", \"\"], ... ] >>> print(dashtable.data2rst(table, spans)) +------------+------------+-----------+ | Header 1 | Header 2 | Header 3 | +============+============+===========+ | body row 1 | column 2 | column 3 | +------------+------------+-----------+ | body row 2 | Cells may span columns.| +------------+------------+-----------+ | body row 3 | Cells may | - Cells | +------------+ span rows. | - contain | | body row 4 | | - blocks. | +------------+------------+-----------+", "label": 1, "domain": "code", "token_count": 421, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0595", "text": "A class to store the optional play properties passed in {{#crossLink \"Sound/play\"}}{{/crossLink}} and {{#crossLink \"AbstractSoundInstance/play\"}}{{/crossLink}} calls. Optional Play Properties Include:
    • interrupt - How to interrupt any currently playing instances of audio with the same source, if the maximum number of instances of the sound are already playing. Values are defined as INTERRUPT_TYPE constants on the Sound class, with the default defined by {{#crossLink \"Sound/defaultInterruptBehavior:property\"}}{{/crossLink}}.
    • delay - The amount of time to delay the start of audio playback, in milliseconds.
    • offset - The offset from the start of the audio to begin playback, in milliseconds.
    • loop - How many times the audio loops when it reaches the end of playback. The default is 0 (no loops), and -1 can be used for infinite playback.
    • volume - The volume of the sound, between 0 and 1. Note that the master volume is applied against the individual volume.
    • pan - The left-right pan of the sound (if supported), between -1 (left) and 1 (right).
    • startTime - To create an audio sprite (with duration), the initial offset to start playback and loop from, in milliseconds.
    • duration - To create an audio sprite (with startTime), the amount of time to play the clip for, in milliseconds.

    Example

    var props = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5}) createjs.Sound.play(\"mySound\", props); // OR mySoundInstance.play(props); @class PlayPropsConfig @constructor @since 0.6.1 TODO think of a better name for this class", "label": 1, "domain": "code", "token_count": 416, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0596", "text": "Gets the list of applications deployed on a Service Fabric node. Gets the list of applications deployed on a Service Fabric node. The results do not include information about deployed system applications unless explicitly queried for by ID. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. @param node_name [String] The name of the node. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param include_health_state [Boolean] Include the health state of an entity. If this parameter is false or not specified, then the health state returned is \"Unknown\". When set to true, the query goes in parallel to the node and the health system service before the results are merged. As a result, the query is more expensive and may take a longer time. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PagedDeployedApplicationInfoList] operation results.", "label": 1, "domain": "code", "token_count": 452, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0597", "text": "Finds the next available file-name in a sequence. This function will create a file of zero size and will return the path to it to the caller. No files which exist will be altered in this operation and concurrent executions of this function will return separate files. In case of conflict, the function will attempt to generate a new file name up to maxattempts number of times before failing. The sequence will start from the base argument (default: 0). If used with the prefix/suffix, it will look for the next file in the sequence ignoring any gaps. Hence, if the files \"a.0.txt\" and \"a.3.txt\" exist, then the next file returned will be \"a.4.txt\" when called with prefix=\"a.\" and suffix=\".txt\". In case fnameGen is provided, the first generated filename which does not exist will be created and its path will be returned. Hence, if the files \"a.0.txt\" and \"a.3.txt\" exist, then the next file returned will be \"a.1.txt\" when called with fnameGen = lambda x : \"a.\" + str(x) + \".txt\" Args: folder - string which has path to the folder where the file should be created (default: '.') prefix - prefix of the file to be generated (default: '') suffix - suffix of the file to be generated (default: '') fnameGen - function which generates the filenames given a number as input (default: None) base - the first index to count (default: 0) maxattempts - number of attempts to create the file before failing with OSError (default: 10) Returns: Path of the file which follows the provided pattern and can be opened for writing. Raises: RuntimeError - If an incorrect combination of arguments is provided. OSError - If is unable to create a file (wrong path, drive full, illegal character in filename, etc.).", "label": 1, "domain": "code", "token_count": 390, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0598", "text": "Given a list of strings, finds the longest string that is common to the *beginning* of all strings in the list and returns a new list whose elements lack this common beginning. boundary_char defines a boundary that must be preserved, so that the common string removed must end with this char. >>> cmn='something/to/begin with?' >>> blah=[cmn+'yes',cmn+'no',cmn+'?maybe'] >>> (blee, bleecmn) = factorise_strings(blah) >>> blee ['yes', 'no', '?maybe'] >>> bleecmn == cmn True >>> blah = ['de.uos.nbp.senhance', 'de.uos.nbp.heartFelt'] >>> (blee, bleecmn) = factorise_strings(blah, '.') >>> blee ['senhance', 'heartFelt'] >>> bleecmn 'de.uos.nbp.' >>> blah = ['/some/deep/dir/subdir', '/some/deep/other/dir', '/some/deep/other/dir2'] >>> (blee, bleecmn) = factorise_strings(blah, '/') >>> blee ['dir/subdir', 'other/dir', 'other/dir2'] >>> bleecmn '/some/deep/' >>> blah = ['/net/store/nbp/heartFelt/data/ecg/emotive_interoception/p20/2012-01-27T09.01.14-ecg.csv', '/net/store/nbp/heartFelt/data/ecg/emotive_interoception/p21/2012-01-27T11.03.08-ecg.csv', '/net/store/nbp/heartFelt/data/ecg/emotive_interoception/p23/2012-01-31T12.02.55-ecg.csv'] >>> (blee, bleecmn) = factorise_strings(blah, '/') >>> bleecmn '/net/store/nbp/heartFelt/data/ecg/emotive_interoception/' rmuil 2012/02/01", "label": 1, "domain": "code", "token_count": 423, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0599", "text": "Options callback callback (ie. the callback given if giving a callback for options instead of an object) @callback optionsCallbackCallback @param {(Error|undefined)} err - Possible error @param {Object} options - Options object Options callback @callback optionsCallback @param {Object} req - HTTP request @param {optionsCallbackCallback} callback - The callback returning the options Verify done callback @callback verifyDoneCallback @param {(Error|undefined)} err - Possible error @param {(Object|boolean)} user - The verified user or false if not allowed @param {Object} [info] info - Additional info message Found LDAP user verify callback @callback verifyCallback @param {Object} user - The user object from LDAP @param {verifyDoneCallback} callback - The verify callback Found LDAP user verify callback with request @callback verifyReqCallback @param {Object} req - The HTTP request @param {Object} user - The user object from LDAP @param {verifyDoneCallback} callback - The verify callback @typedef credentialsLookupResult @type {object} @property {string} username - Username to use @property {string} password - Password to use @typedef credentialsLookupResultAlt @type {object} @property {string} user - Username to use @property {string} pass - Password to use Credentials lookup function @callback credentialsLookup @param {Object} req - The HTTP request @return {(credentialsLookupResult|credentialsLookupResultAlt)} - Found credentials Synchronous function for doing something with an error if handling errors as failures @callback failureErrorCallback @param {Error} err - The error occurred Add default values to options @private @param {Object} options - Options object @returns {Object} The given options with defaults filled", "label": 1, "domain": "code", "token_count": 351, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0600", "text": "Execute a StreamableRiakCommand asynchronously, and stream the results back before the command {@link RiakFuture#isDone() is done}.

    Calling this method causes the client to execute the provided StreamableRiakCommand asynchronously. It will immediately return a RiakFuture that contains an immediately available result (via {@link RiakFuture#get()}) that data will be streamed to. The RiakFuture will also keep track of the overall operation's progress with the {@link RiakFuture#isDone}, etc methods.

    Because the consumer thread will poll for new results, it is advisable to check the consumer thread's interrupted status via {@link Thread#isInterrupted() Thread.currentThread().isInterrupted() }, as the result iterator will not propagate an InterruptedException, but it will set the Thread's interrupted flag.

    @param StreamableRiakCommand's immediate return type, available before the command/operation is complete. @param The RiakCommand's query info type. @param command The RiakCommand to execute. @param timeoutMS The polling timeout in milliseconds for each result chunk. If the timeout is reached it will try again, instead of blocking indefinitely. If the value is too small (less than the average chunk arrival time), the result iterator will essentially busy wait. If the timeout is too large (much greater than the average chunk arrival time), the result iterator can block the consuming thread from seeing the done() status until the timeout is reached. @return a RiakFuture for the operation @since 2.1.0 @see RiakFuture", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0601", "text": "A server-specified data string which should be uniquely generated each time a 401 response is made. It is recommended that this string be base64 or hexadecimal data. Specifically, since the string is passed in the header lines as a quoted string, the double-quote character is not allowed.
    The contents of the nonce are implementation dependent. The quality of the implementation depends on a good choice. A nonce might, for example, be constructed as the base 64 encoding of
    time-stamp H(time-stamp \":\" ETag \":\" private-key)
    where time-stamp is a server-generated time or other non-repeating value, ETag is the value of the HTTP ETag header associated with the requested entity, and private-key is data known only to the server. With a nonce of this form a server would recalculate the hash portion after receiving the client authentication header and reject the request if it did not match the nonce from that header or if the time-stamp value is not recent enough. In this way the server can limit the time of the nonce’s validity. The inclusion of the ETag prevents a replay request for an updated version of the resource. (Note: including the IP address of the client in the nonce would appear to offer the server the ability to limit the reuse of the nonce to the same client that originally got it. However, that would break proxy farms, where requests from a single user often go through different proxies in the farm. Also, IP address spoofing is not that hard.)
    An implementation might choose not to accept a previously used nonce or a previously used digest, in order to protect against a replay attack. Or, an implementation might choose to use one-time nonces or digests for POST or PUT requests and a time-stamp for GET requests. For more details on the issues involved see section 4. of this document.
    The nonce is opaque to the client. @param sNonce The nonce value to be set. May not be null. @return this", "label": 1, "domain": "code", "token_count": 414, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0602", "text": "Visualize results on cortical surface using matplotlib. Inputs ------- coords : numpy array of shape (n_nodes,3), each row specifying the x,y,z coordinates of one node of surface mesh faces : numpy array of shape (n_faces, 3), each row specifying the indices of the three nodes building one node of the surface mesh stat_map : numpy array of shape (n_nodes,) containing the values to be visualized for each node. elev, azim : integers, elevation and azimuth parameters specifying the view on the 3D plot. For Freesurfer surfaces elev=0, azim=0 will give a lateral view for the right and a medial view for the left hemisphere, elev=0, azim=180 will give a medial view for the right and lateral view for the left hemisphere. cmap : Matplotlib colormap, the color range will me forced to be symmetric. Colormaps can be specified as string or colormap object. threshold : float, threshold to be applied to the map, will be applied in positive and negative direction, i.e. values < -abs(threshold) and > abs(threshold) will be shown. alpha : float, determines the opacity of the background mesh, in'auto' mode alpha defaults to .5 when no background map is given, to 1 otherwise. bg_map : numpy array of shape (n_nodes,) to be plotted underneath the statistical map. Specifying a sulcal depth map as bg_map results in realistic shadowing of the surface. bg_on_stat : boolean, specifies whether the statistical map should be multiplied with the background map for shadowing. Otherwise, only areas that are not covered by the statsitical map after thresholding will show shadows. figsize : tuple of intergers, dimensions of the figure that is produced. Output ------ Matplotlib figure object", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0603", "text": "Gets the information about an application deployed on a Service Fabric node. Gets the information about an application deployed on a Service Fabric node. This query returns system application information if the application ID provided is for system application. Results encompass deployed applications in active, activating, and downloading states. This query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service Fabric nodes on the cluster. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param include_health_state [Boolean] Include the health state of an entity. If this parameter is false or not specified, then the health state returned is \"Unknown\". When set to true, the query goes in parallel to the node and the health system service before the results are merged. As a result, the query is more expensive and may take a longer time. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [DeployedApplicationInfo] operation results.", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0604", "text": "/* Method: animate Animates a by interpolating some , or properties. Parameters: opt - (object) Animation options. The object properties are described below duration - (optional) Described in . fps - (optional) Described in . hideLabels - (optional|boolean) Whether to hide labels during the animation. modes - (required|object) An object with animation modes (described below). Animation modes: Animation modes are strings representing different node/edge and graph properties that you'd like to animate. They are represented by an object that has as keys main categories of properties to animate and as values a list of these specific properties. The properties are described below position - Describes the way nodes' positions must be interpolated. Possible values are 'linear', 'polar' or 'moebius'. node-property - Describes which Node properties will be interpolated. These properties can be any of the ones defined in . edge-property - Describes which Edge properties will be interpolated. These properties can be any the ones defined in . label-property - Describes which Label properties will be interpolated. These properties can be any of the ones defined in like color or size. node-style - Describes which Node Canvas Styles will be interpolated. These are specific canvas properties like fillStyle, strokeStyle, lineWidth, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, etc. edge-style - Describes which Edge Canvas Styles will be interpolated. These are specific canvas properties like fillStyle, strokeStyle, lineWidth, shadowBlur, shadowColor, shadowOffsetX, shadowOffsetY, etc. Example: (start code js) var viz = new $jit.Viz(options); ...tweak some Data, CanvasStyles or LabelData properties... viz.fx.animate({ modes: { 'position': 'linear', 'node-property': ['width', 'height'], 'node-style': 'shadowColor', 'label-property': 'size' }, hideLabels: false }); ...can also be written like this... viz.fx.animate({ modes: ['linear', 'node-property:width:height', 'node-style:shadowColor', 'label-property:size'], hideLabels: false }); (end code)", "label": 1, "domain": "code", "token_count": 477, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0605", "text": "Installs a signal handler to erase temporary scratch files when a signal is received. This can be used to help ensure scratch files are erased when jobs are evicted by Condor. signums is a squence of the signals to trap, the default value is a list of the signals used by Condor to kill and/or evict jobs. The logic is as follows. If the current signal handler is signal.SIG_IGN, i.e. the signal is being ignored, then the signal handler is not modified since the reception of that signal would not normally cause a scratch file to be leaked. Otherwise a signal handler is installed that erases the scratch files. If the original signal handler was a Python callable, then after the scratch files are erased the original signal handler will be invoked. If program control returns from that handler, i.e. that handler does not cause the interpreter to exit, then sys.exit() is invoked and retval is returned to the shell as the exit code. Note: by invoking sys.exit(), the signal handler causes the Python interpreter to do a normal shutdown. That means it invokes atexit() handlers, and does other garbage collection tasks that it normally would not do when killed by a signal. Note: this function will not replace a signal handler more than once, that is if it has already been used to set a handler on a signal then it will be a no-op when called again for that signal until uninstall_signal_trap() is used to remove the handler from that signal. Note: this function is called by get_connection_filename() whenever it creates a scratch file.", "label": 1, "domain": "code", "token_count": 318, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0606", "text": "Define or redefine how the form model pull/pushes or otherwise tracks properties between an object model(s). Examples: this.setMapping('modelAlias', true, optional model instance); this.setMapping('modelAlias, 'foo bar baz', optional model instance); this.setMapping('computedAlias', { model1: 'foo', model2: 'bar', push: function(models) { models.model1.set('foo', this.get('foobar')[0]); models.model2.set('bar', this.get('foobar')[1]); }, pull: function(models) { this.set('foobar', [models.model1.foo, models.model2.bar]); }, }, optional model map) @method setMapping @param alias {String} the name for the mapping - either a model mapping or a computed mapping @param mapping {String, Boolean or Object} Provides the mapping for this alias. If trying to map to a model, then either provide a space delimited list of fields to track as a String or the boolean true to track all the model's fields. If the mapping is for a computed value, then provide a map from model alias to model mapping for all the fields needed for the computed and a pull method if you want to change/combine/split object model properties before bringing them into the form model and a push method if you want to change/combine/split form model properties before pushing them to the object models. @param [models] {Object or Backbone.Model instance} Provides instances to use for this mapping. If mapping is a computed, provide a map from alias to model instance. If mapping is for a single model, just provide the model instance for that alias. @param [copy=false] if true, will pull values definined by this mapping after setting the mapping. Requires models to be passed in.", "label": 1, "domain": "code", "token_count": 365, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0607", "text": " Generate public and private RSA keys from an optionally encrypted PEM. The public and private keys returned conform to 'securesystemslib.formats.PEMRSA_SCHEMA' and have the form: '-----BEGIN RSA PUBLIC KEY----- ... -----END RSA PUBLIC KEY-----' and '-----BEGIN RSA PRIVATE KEY----- ...-----END RSA PRIVATE KEY-----' The public and private keys are returned as strings in PEM format. In case the private key part of 'pem' is encrypted pyca/cryptography's load_pem_private_key() method is passed passphrase. In the default case here, pyca/cryptography will decrypt with a PBKDF1+MD5 strengthened'passphrase', and 3DES with CBC mode for encryption/decryption. Alternatively, key data may be encrypted with AES-CTR-Mode and the passphrase strengthened with PBKDF2+SHA256, although this method is used only with TUF encrypted key files. >>> public, private = generate_rsa_public_and_private(2048) >>> passphrase = 'secret' >>> encrypted_pem = create_rsa_encrypted_pem(private, passphrase) >>> returned_public, returned_private = \\ create_rsa_public_and_private_from_pem(encrypted_pem, passphrase) >>> securesystemslib.formats.PEMRSA_SCHEMA.matches(returned_public) True >>> securesystemslib.formats.PEMRSA_SCHEMA.matches(returned_private) True >>> public == returned_public True >>> private == returned_private True pem: A byte string in PEM format, where the private key can be encrypted. It has the form: '-----BEGIN RSA PRIVATE KEY-----\\n Proc-Type: 4,ENCRYPTED\\nDEK-Info: DES-EDE3-CBC ...' passphrase: (optional) The passphrase, or password, to decrypt the private part of the RSA key. 'passphrase' is not directly used as the encryption key, instead it is used to derive a stronger symmetric key. securesystemslib.exceptions.FormatError, if the arguments are improperly formatted. securesystemslib.exceptions.CryptoError, if the public and private RSA keys cannot be generated from 'pem', or exported in PEM format. pyca/cryptography's 'serialization.load_pem_private_key()' called to perform the actual conversion from an encrypted RSA private key to PEM format. A (public, private) tuple containing the RSA keys in PEM format.", "label": 1, "domain": "code", "token_count": 496, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0608", "text": "Reads files named as arguments and print their tokens, by default as one per line. This is useful either for testing or to run standalone to turn a corpus into a one-token-per-line file of tokens. This main method assumes that the input file is in utf-8 encoding, unless it is specified.

    Usage: java edu.stanford.nlp.process.PTBTokenizer [options] filename+

    Options:

    • -options options Set various tokenization options (see the documentation in the class javadoc)
    • -preserveLines Produce space-separated tokens, except when the original had a line break, not one-token-per-line
    • -encoding encoding Specifies a character encoding
    • -lowerCase Lowercase all tokens (on tokenization)
    • -parseInside regex Names an XML-style tag or a regular expression over such elements. The tokenizer will only tokenize inside element that match this name. (This is done by regex matching, not an XML parser, but works well for simple XML documents, or other SGML-style documents, such as Linguistic Data Consortium releases, which adopt the convention that a line of a file is either XML markup or character data but never both.)
    • -ioFileList file* The remaining command-line arguments are treated as filenames that themselves contain lists of pairs of input-output filenames (2 column, whitespace separated).
    • -dump Print the whole of each CoreLabel, not just the value (word)
    • -untok Heuristically untokenize tokenized text
    • -h Print usage info
    @param args Command line arguments @throws IOException If any file I/O problem", "label": 1, "domain": "code", "token_count": 353, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0609", "text": "Gets the list of partitions of a Service Fabric service. Gets the list of partitions of a Service Fabric service. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 336, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0610", "text": "/* A mixin for sap.ui.model.odata.type.Currency and sap.ui.model.odata.type.Unit. Note: the format option unitOptional defaults to true. @param {object} [oFormatOptions] See parameter oFormatOptions of fnBaseType. Format options are immutable, that is, they can only be set once on construction. Format options that are not supported or have a different default are listed below. @param {object} [oFormatOptions.] Not supported; the type derives this from its customizing part. @param {boolean} [oFormatOptions.parseAsString=true] Whether the amount or measure is parsed to a string; set to false if the underlying type is represented as a number, for example {@link sap.ui.model.odata.type.Int32} @param {boolean} [oFormatOptions.unitOptional=true] Whether the amount or measure is parsed if no currency or unit is entered. @param {any} [oFormatOptions.emptyString=0] Defines how an empty string is parsed into the amount/measure. With the default value 0 the amount/measure becomes 0 when an empty string is parsed. @param {object} [oConstraints] Not supported @throws {Error} If called with more parameters than oFormatOptions or if the format option sFormatOptionName is set @alias sap.ui.model.odata.type.UnitMixin @mixin", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0611", "text": "Play sounds using a Flash instance. This plugin is not used by default, and must be registered manually in {{#crossLink \"Sound\"}}{{/crossLink}} using the {{#crossLink \"Sound/registerPlugins\"}}{{/crossLink}} method. This plugin is recommended to be included if sound support is required in older browsers such as IE8. This plugin requires FlashAudioPlugin.swf and swfObject.js, which is compiled into the minified FlashAudioPlugin-X.X.X.min.js file. You must ensure that {{#crossLink \"FlashAudioPlugin/swfPath:property\"}}{{/crossLink}} is set when using this plugin, so that the script can find the swf.

    Example

    createjs.FlashAudioPlugin.swfPath = \"../src/soundjs/flashaudio\"; createjs.Sound.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin, createjs.FlashAudioPlugin]); // Adds FlashAudioPlugin as a fallback if WebAudio and HTMLAudio do not work. Note that the SWF is embedded into a container DIV (with an id and classname of \"SoundJSFlashContainer\"), and will have an id of \"flashAudioContainer\". The container DIV is positioned 1 pixel off-screen to the left to avoid showing the 1x1 pixel white square.

    Known Browser and OS issues for Flash Audio

    All browsers
    • There can be a delay in flash player starting playback of audio. This has been most noticeable in Firefox. Unfortunely this is an issue with the flash player and the browser and therefore cannot be addressed by SoundJS.
    @class FlashAudioPlugin @extends AbstractPlugin @constructor", "label": 1, "domain": "code", "token_count": 363, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0612", "text": "Gets the health of a Service Fabric node. Gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of health events reported on the node based on the health state. If the node that you specify by name does not exist in the health store, this returns an error. @param node_name [String] The name of the node. @param events_health_state_filter [Integer] Allows filtering the collection of HealthEvent objects returned based on health state. The possible values for this parameter include integer value of one of the following health states. Only events that match the filter are returned. All events are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [NodeHealth] operation results.", "label": 1, "domain": "code", "token_count": 408, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0613", "text": "Decrypts a previously encrypted element crypto.decrypt cipher, options, &block Must have the appropiate key to be able to decrypt, of course. Returns a {GPGME::Data} object which can then be read. @param cipher Must be something that can be converted into a {GPGME::Data} object, or a {GPGME::Data} object itself. It is the element that will be decrypted. @param [Hash] options The optional parameters: * +:output+ if specified, it will write the output into it. It will me converted to a {GPGME::Data} object, so it can also be a file, for example. * If the file was encrypted with symmentric encryption, must provide a :password option. * Any other option accepted by {GPGME::Ctx.new} @param &block In the block all the signatures are yielded, so one could verify them. See examples. @return [GPGME::Data] a {GPGME::Data} that can be read. @example Simple decrypt crypto.decrypt encrypted_data @example symmetric encryption, or passwored key crypto.decrypt encrypted_data, :password => \"gpgme\" @example Output to file file = File.open(\"decrypted.txt\", \"w+\") crypto.decrypt encrypted_data, :output => file @example Verifying signatures crypto.decrypt encrypted_data do |signature| raise \"Signature could not be verified\" unless signature.valid? end @raise [GPGME::Error::UnsupportedAlgorithm] when the cipher was encrypted using an algorithm that's not supported currently. @raise [GPGME::Error::WrongKeyUsage] TODO Don't know when @raise [GPGME::Error::DecryptFailed] when the cipher was encrypted for a key that's not available currently.", "label": 1, "domain": "code", "token_count": 370, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0614", "text": "Validate a HOTP value inside a window of [counter-backward_drift:counter+forward_drift] :param key: the shared secret :type key: hexadecimal string of even length :param response: the OTP to check :type response: ASCII string :param counter: value of the counter running inside an HOTP token, usually it is just the count of HOTP value accepted so far for a given shared secret; see the specifications of HOTP for more details; :param format: the output format, can be: - hex40, for a 40 characters hexadecimal format, - dec4, for a 4 characters decimal format, - dec6, - dec7, or - dec8 it defaults to dec6. :param hash: the hash module (usually from the hashlib package) to use, it defaults to hashlib.sha1. :param drift: how far we can look forward from the current value of the counter :param backward_drift: how far we can look backward from the current counter value to match the response, default to zero as it is usually a bad idea to look backward as the counter is only advanced when a valid value is checked (and so the counter on the token side should have been incremented too) :returns: a pair of a boolean and an integer: - first is True if the response is validated and False otherwise, - second is the new value for the counter; it can be more than counter + 1 if the drift window was used; you must store it if the response was validated. >>> accept_hotp('343434', '122323', 2, format='dec6') (False, 2) >>> hotp('343434', 2, format='dec6') '791903' >>> accept_hotp('343434', '791903', 2, format='dec6') (True, 3) >>> hotp('343434', 3, format='dec6') '907279' >>> accept_hotp('343434', '907279', 2, format='dec6') (True, 4)", "label": 1, "domain": "code", "token_count": 429, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0615", "text": "Parses XML string to dict. In case of simple elements (no children, no attributes) value is stored as is. For complex elements value is stored in key '@', attributes '@xxx' and children as sub-dicts. Optionally strips namespaces. For example: hello world value node is returned as follows: {'@version': '1.2', 'A': [{'@class': 'x', 'B': {'@': 'hello', '@class': 'x2'}}, {'@class': 'y', 'B': {'@': 'world', '@class': 'y2'}}], 'C': 'value node'} Args: xml_bytes: XML file contents in bytes tags: list of tags to parse (pass empty to return all chilren of top-level tag) array_tags: list of tags that should be treated as arrays by default int_tags: list of tags that should be treated as ints strip_namespaces: if true namespaces will be stripped parse_attributes: Elements with attributes are stored as complex types with '@' identifying text value and @xxx identifying each attribute value_key: Key to store (complex) element value. Default is '@' attribute_prefix: Key prefix to store element attribute values. Default is '@' document_tag: Set True if Document root tag should be included as well Returns: dict", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0616", "text": "/* TODO: isInitializing: function() { return ( this.phase==\"init\" || this.phase==\"postInit\" ); }, TODO: isReloading: function() { return ( this.phase==\"init\" || this.phase==\"postInit\" ) && this.options.persist && this.persistence.cookiesFound; }, TODO: isUserEvent: function() { return ( this.phase==\"userEvent\" ); }, Make sure that a node with a given ID is loaded, by traversing - and loading - its parents. This method is meant for lazy hierarchies. A callback is executed for every node as we go. @example // Resolve using node.key: tree.loadKeyPath(\"/_3/_23/_26/_27\", function(node, status){ if(status === \"loaded\") { console.log(\"loaded intermediate node \" + node); }else if(status === \"ok\") { node.activate(); } }); // Use deferred promise: tree.loadKeyPath(\"/_3/_23/_26/_27\").progress(function(data){ if(data.status === \"loaded\") { console.log(\"loaded intermediate node \" + data.node); }else if(data.status === \"ok\") { node.activate(); } }).done(function(){ ... }); // Custom path segment resolver: tree.loadKeyPath(\"/321/431/21/2\", { matchKey: function(node, key){ return node.data.refKey === key; }, callback: function(node, status){ if(status === \"loaded\") { console.log(\"loaded intermediate node \" + node); }else if(status === \"ok\") { node.activate(); } } }); @param {string | string[]} keyPathList one or more key paths (e.g. '/3/2_1/7') @param {function | object} optsOrCallback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error'). Pass an object to define custom key matchers for the path segments: {callback: function, matchKey: function}. @returns {$.Promise}", "label": 1, "domain": "code", "token_count": 410, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0617", "text": "/* var obj = {a: 3, b: 5}; merge(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} obj; // {a: 4, b: 5, c: 8} var obj = {a: 3, b: 5}; merge({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} obj; // {a: 3, b: 5} var arr = [1, 2, 3]; var obj = {a: 3, b: 5}; merge(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]} arr.push(4); obj; // {a: 3, b: 5, c: [1, 2, 3, 4]} merge({a: 4, b: 5}); // {a: 4, b: 5} merge(3, {a: 4, b: 5}); // throws merge({a: 4, b: 5}, 3); // throws merge({a: 4, b: 5}, {b: 4, c: 5}, 'c'); // throws", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0618", "text": "Gets the information about a specified service type of the application deployed on a node in a Service Fabric cluster. Gets the list containing the information about a specific service type from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. Each entry represents one activation of a service type, differentiated by the activation ID. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_type_name [String] Specifies the name of a Service Fabric service type. @param service_manifest_name [String] The name of the service manifest to filter the list of deployed service type information. If specified, the response will only contain the information about service types that are defined in this service manifest. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 338, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0619", "text": "Creates a program, attaches (and/or compiles) shaders, binds attrib locations, links the program and calls useProgram. NOTE: There are 4 signatures for this function twgl.createProgram(gl, [vs, fs], options); twgl.createProgram(gl, [vs, fs], opt_errFunc); twgl.createProgram(gl, [vs, fs], opt_attribs, opt_errFunc); twgl.createProgram(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. @param {WebGLShader[]|string[]} shaders The shaders to attach, or element ids for their source, or strings that contain their source @param {module:twgl.ProgramOptions|string[]|module:twgl.ErrorCallback} [opt_attribs] Options for the program or an array of attribs names or an error callback. Locations will be assigned by index if not passed in @param {number[]} [opt_locations|module:twgl.ErrorCallback] The locations for the. A parallel array to opt_attribs letting you assign locations or an error callback. @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console on error. If you want something else pass an callback. It's passed an error message. @return {WebGLProgram?} the created program or null if error. @memberOf module:twgl/programs", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0620", "text": "Augment an exception message with additional information while keeping the original traceback. You can prefix and/or suffix text. If you prefix something (which happens much more often in the HydPy framework), the sub-clause ', the following error occurred:' is automatically included: >>> from hydpy.core import objecttools >>> import textwrap >>> try: ... 1 + '1' ... except BaseException: ... prefix = 'While showing how prefixing works' ... suffix = '(This is a final remark.)' ... objecttools.augment_excmessage(prefix, suffix) Traceback (most recent call last): ... TypeError: While showing how prefixing works, the following error \\ occurred: unsupported operand type(s) for +: 'int' and 'str' \\ (This is a final remark.) Some exceptions derived by site-packages do not support exception chaining due to requiring multiple initialisation arguments. In such cases, |augment_excmessage| generates an exception with the same name on the fly and raises it afterwards, which is pointed out by the exception name mentioning to the \"objecttools\" module: >>> class WrongError(BaseException): ... def __init__(self, arg1, arg2): ... pass >>> try: ... raise WrongError('info 1', 'info 2') ... except BaseException: ... objecttools.augment_excmessage( ... 'While showing how prefixing works') Traceback (most recent call last): ... hydpy.core.objecttools.hydpy.core.objecttools.WrongError: While showing \\ how prefixing works, the following error occurred: ('info 1', 'info 2')", "label": 1, "domain": "code", "token_count": 333, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0621", "text": "

    Perform a (configurable) XML 1.0 escape operation on a String input meant to be an XML attribute value, writing results to a Writer.

    This method will perform an escape operation according to the specified {@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel} argument values.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    All other String/Writer-based escapeXml10*(...) methods call this one with preconfigured type and level values.

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param type the type of escape operation to be performed, see {@link org.unbescape.xml.XmlEscapeType}. @param level the escape level to be applied, see {@link org.unbescape.xml.XmlEscapeLevel}. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0622", "text": "Returns dictionary of cluster IDs:seq IDs Overall function for reference-based clustering with usearch61 seq_path: fasta filepath to be clustered with usearch61 refseqs_fp: reference fasta filepath, used to cluster sequences against. percent_id: percentage id to cluster at rev: enable reverse strand matching for clustering save_intermediate_files: Saves intermediate files created during clustering minlen: minimum sequence length output_dir: directory to output log, OTU mapping, and intermediate files remove_usearch_logs: Saves usearch log files verbose: print current processing step to stdout wordlength: word length to use for clustering usearch_fast_cluster: Use usearch61 fast cluster option, not as memory efficient as the default cluster_smallmem option, requires sorting by length, and does not allow reverse strand matching. usearch61_sort_method: Sort sequences by abundance or length by using functionality provided by usearch61, or do not sort by using None option. otu_prefix: label to place in front of OTU IDs, used to prevent duplicate IDs from appearing with reference based OTU picking. usearch61_maxrejects: Number of rejects allowed by usearch61 usearch61_maxaccepts: Number of accepts allowed by usearch61 sizeorder: used for clustering based upon abundance of seeds (only applies when doing open reference de novo clustering) suppress_new_clusters: If True, will allow de novo clustering on top of reference clusters. threads: Specify number of threads used per core per CPU HALT_EXEC: application controller option to halt execution. Description of analysis workflows --------------------------------- closed-reference approach: dereplicate sequences first, do reference based clustering, merge clusters/failures and dereplicated data, write OTU mapping and failures file. open-reference approach: dereplicate sequences first, do reference based clustering, parse failures, sort failures fasta according to chosen method, cluster failures, merge reference clustering results/de novo results/dereplicated data, write OTU mapping file. Dereplication should save processing time for large datasets.", "label": 1, "domain": "code", "token_count": 406, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0623", "text": "Creates and caches a new AWS Lambda instance with the given Lambda constructor options for either the region specified in the given options (if any and region specified) or for the current region (if not) UNLESS a previously cached Lambda instance exists and the given options either match the options used to construct it or are undefined, empty or only region was specified, in which case no new instance will be created and the cached instance will be returned instead. If the given options do not match existing options and are not empty and not only region, then logs a warning that the previously cached Lambda instance is being replaced and returns the new AWS Lambda instance. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) Configures the given context, if it does not already have a context.lambda, with the cached lambda instance for either the region specified in the given default lambda options (if any and region specified) or for the current region (if not); otherwise with a new AWS.Lambda instance created and cached by {@linkcode setLambda} for the specified or current region using the given default Lambda constructor options. Note that the given default Lambda constructor options will ONLY be used if no cached Lambda instance exists. Logging should be configured before calling this function (see {@linkcode logging-utils/logging#configureLogging}) @param {Object|LambdaAware} context - the context to configure @param {Object|undefined} [lambdaOptions] - the optional Lambda constructor options to use if no cached Lambda instance exists @param {string|undefined} [lambdaOptions.region] - an optional region to use instead of the current region @returns {LambdaAware} the given context configured with an AWS.Lambda instance", "label": 1, "domain": "code", "token_count": 344, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0624", "text": "@fileoverview Code generator for given templates. The class reads the schema and generates following variables: #bundledmode: enableBundledMode pragma value, default to false #column: array of columns of last used #table, must be used in #repeatcolumn #columnuniqueness: uniqueness of last used #column #columnnullable: nullability of last used #column #dbname: database name #dbtablelist: database table list #dbversion: database version #keyofindex: function body of a row's keyOfIndex function #namespace: namespace given by the user #table: array of tables defined in schema, must be used in #repeattable #tablecolumntypes: column as members with type annotation #tablecolumndbtypes: column as members with type annotation #tablename: table name of last used #table #tablepersistentindex: table pragma persistIndex The caller feeds in the content of a template in string form, and the generator will replace the variables in the template and return the results as string. The template can have following control variables: #pascal: used for #{table|column} to generate Pascal-Camel-style string #camel: used for #{table|column} to generate Camel-style string /// #sort: sort the coming block in lexical order /// #repeattable: repeat given statements by table /// #repeatcolumn: repeat given statements by column @param {string} namespace @param {!lf.schema.Database} schema Validated DB schema @constructor", "label": 1, "domain": "code", "token_count": 309, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0625", "text": "Saves the record with the updated_at/on attributes set to the current time or the time specified. Please note that no validation is performed and only the +after_touch+, +after_commit+ and +after_rollback+ callbacks are executed. This method can be passed attribute names and an optional time argument. If attribute names are passed, they are updated along with updated_at/on attributes. If no time argument is passed, the current time is used as default. product.touch # updates updated_at/on with current time product.touch(time: Time.new(2015, 2, 16, 0, 0, 0)) # updates updated_at/on with specified time product.touch(:designed_at) # updates the designed_at attribute and updated_at/on product.touch(:started_at, :ended_at) # updates started_at, ended_at and updated_at/on attributes If used along with {belongs_to}[rdoc-ref:Associations::ClassMethods#belongs_to] then +touch+ will invoke +touch+ method on associated object. class Brake < ActiveRecord::Base belongs_to :car, touch: true end class Car < ActiveRecord::Base belongs_to :corporation, touch: true end # triggers @brake.car.touch and @brake.car.corporation.touch @brake.touch Note that +touch+ must be used on a persisted object, or else an ActiveRecordError will be thrown. For example: ball = Ball.new ball.touch(:updated_at) # => raises ActiveRecordError", "label": 1, "domain": "code", "token_count": 301, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0626", "text": "function takest devid and ifindex of specific device and interface and issues a RESTFUL call to \" shut\" the specified interface on the target device. :param devid: int or str value of the target device :param devip: ipv4 address of the target devices :param ifindex: int or str value of the target interface :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :return: HTTP status code 204 with no values. :rtype:int >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.device import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> int_up_response = set_inteface_up('9', auth.creds, auth.url, devip = '10.101.0.221') >>> int_down_response = set_interface_down( '9', auth.creds, auth.url, devid = '10') 204 >>> int_up_response = set_inteface_up('9', auth.creds, auth.url, devip = '10.101.0.221') >>> int_down_response = set_interface_down( '9', auth.creds, auth.url, devip = '10.101.0.221') 204 >>> assert type(int_down_response) is int >>> assert int_down_response is 204 >>> int_up_response = set_inteface_up('9', auth.creds, auth.url, devip = '10.101.0.221')", "label": 1, "domain": "code", "token_count": 353, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0627", "text": "Adds a new Authorizer resource to an existing RestApi resource. See also: AWS API Documentation :example: response = client.create_authorizer( restApiId='string', name='string', type='TOKEN'|'COGNITO_USER_POOLS', providerARNs=[ 'string', ], authType='string', authorizerUri='string', authorizerCredentials='string', identitySource='string', identityValidationExpression='string', authorizerResultTtlInSeconds=123 ) :type restApiId: string :param restApiId: [REQUIRED] The RestApi identifier under which the Authorizer will be created. :type name: string :param name: [REQUIRED] [Required] The name of the authorizer. :type type: string :param type: [REQUIRED] [Required] The type of the authorizer. :type providerARNs: list :param providerARNs: A list of the Cognito Your User Pool authorizer's provider ARNs. (string) -- :type authType: string :param authType: Optional customer-defined field, used in Swagger imports/exports. Has no functional impact. :type authorizerUri: string :param authorizerUri: [Required] Specifies the authorizer's Uniform Resource Identifier (URI). :type authorizerCredentials: string :param authorizerCredentials: Specifies the credentials required for the authorizer, if any. :type identitySource: string :param identitySource: [REQUIRED] [Required] The source of the identity in an incoming request. :type identityValidationExpression: string :param identityValidationExpression: A validation expression for the incoming identity. :type authorizerResultTtlInSeconds: integer :param authorizerResultTtlInSeconds: The TTL of cached authorizer results. :rtype: dict :return: { 'id': 'string', 'name': 'string', 'type': 'TOKEN'|'COGNITO_USER_POOLS', 'providerARNs': [ 'string', ], 'authType': 'string', 'authorizerUri': 'string', 'authorizerCredentials': 'string', 'identitySource': 'string', 'identityValidationExpression': 'string', 'authorizerResultTtlInSeconds': 123 } :returns: (string) --", "label": 1, "domain": "code", "token_count": 457, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0628", "text": "______________________ MediaStreamRecorder.js MediaStreamRecorder is an abstraction layer for {@link https://w3c.github.io/mediacapture-record/MediaRecorder.html|MediaRecorder API}. It is used by {@link RecordRTC} to record MediaStream(s) in both Chrome and Firefox. @summary Runs top over {@link https://w3c.github.io/mediacapture-record/MediaRecorder.html|MediaRecorder API}. @license {@link https://github.com/muaz-khan/RecordRTC#license|MIT} @author {@link https://github.com/muaz-khan|Muaz Khan} @typedef MediaStreamRecorder @class @example var config = { mimeType: 'video/webm', // vp8, vp9, h264, mkv, opus/vorbis audioBitsPerSecond : 256 * 8 * 1024, videoBitsPerSecond : 256 * 8 * 1024, bitsPerSecond: 256 * 8 * 1024, // if this is provided, skip above two checkForInactiveTracks: true, timeSlice: 1000, // concatenate intervals based blobs ondataavailable: function() {} // get intervals based blobs } var recorder = new MediaStreamRecorder(mediaStream, config); recorder.record(); recorder.stop(function(blob) { video.src = URL.createObjectURL(blob); // or var blob = recorder.blob; }); @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code} @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API. @param {object} config - {disableLogs:true, initCallback: function, mimeType: \"video/webm\", timeSlice: 1000} @throws Will throw an error if first argument \"MediaStream\" is missing. Also throws error if \"MediaRecorder API\" are not supported by the browser.", "label": 1, "domain": "code", "token_count": 401, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0629", "text": "Constructor the form model. Can take in attributes to set initially. These will override any pulled values from object models on initialization. On initialization the object model's values will be pulled once. For the options, here are needed definitions: mapping: { modelName: 'foo bar baz' // track a model by providing an alias for a name and a space seperated list of fields to track as a String modelName2: true // to track all fields ... // can have many model mappings computedName: { modelName: 'taz raz', // mappings for models that will be used for this computed mapping. ... // can have many model mappings for a computed pull: function(models) {}, // a callback that will be invoked when pulling data from the Object model. Passes in a map of model alias/name to shallow copies of fields being tracked on that model. push: function(models) {} // a callback that will be invoked when pushing data to the Object model. Passes in a map of model alias/name to object model being tracked under that alias. } }, models: { modelName: modelInstance, // optionally, provide a set of model instance to model name (aliases) to start tracking modelName2: modelInstance2 // provide as many aliases to model instances as you'd like } @method constructor @param [options] {Object} @param [options.mapping] {Object} map from aliases (either model names or computed value names) to mappings. A model mapping can bind an alias to a space seperated list of fields to track as a String r the boolean true if it is mapping all the fields. A computed mapping can bind an alias to a set of model mappings required for this computed value and both a pull and/or push method that are used to compute different values to or from object model(s). @param [options.models] {Object} Because the options.mapping parameter only allows you to define the mappings to aliases, this options allows you to bind model instances to aliases. Setting model instances to aliases are required to actually begin pulling/pushing values. @param [options.startUpdating=false] {Boolean} set to true if you want to immediately set up listeners to update this form model as the object model updates. You can always toggle this state with startUpdating() and stopUpdating(). @param [options.validation] {Object} A Backbone.Validation plugin hash to dictate the validation rules @param [options.labels] {Object} A Backbone.Validation plugin hash to dictate the attribute labels", "label": 1, "domain": "code", "token_count": 499, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0630", "text": "Create a new repository for the authenticated user. @param [Hash] params @option params [String] :name Required string @option params [String] :description Optional string @option params [String] :homepage Optional string @option params [Boolean] :private Optional boolean - true to create a private repository, false to create a public one. @option params [Boolean] :has_issues Optional boolean - true to enable issues for this repository, false to disable them @option params [Boolean] :has_wiki Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true @option params [Boolean] :has_downloads Optional boolean - true to enable downloads for this repository @option params [String] :org Optional string - The organisation in which this repository will be created @option params [Numeric] :team_id Optional number - The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization @option params [Boolean] :auto_init Optional boolean - true to create an initial commit with empty README. Default is false. @option params [String] :gitignore_template Optional string - Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, “Haskell” Ignored if auto_init parameter is not provided. @example github = Github.new github.repos.create \"name\": 'repo-name' \"description\": \"This is your first repo\", \"homepage\": \"https://github.com\", \"private\": false, \"has_issues\": true, \"has_wiki\": true, \"has_downloads\": true Create a new repository in this organisation. The authenticated user must be a member of this organisation @example github = Github.new oauth_token: '...' github.repos.create name: 'repo-name', org: 'organisation-name' @example", "label": 1, "domain": "code", "token_count": 385, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0631", "text": "Pivots a data frame on specified vectors and applies an aggregate function to quickly generate a summary. == Options +:index+ - Keys to group by on the pivot table row index. Pass vector names contained in an Array. +:vectors+ - Keys to group by on the pivot table column index. Pass vector names contained in an Array. +:agg+ - Function to aggregate the grouped values. Default to *:mean*. Can use any of the statistics functions applicable on Vectors that can be found in the Daru::Statistics::Vector module. +:values+ - Columns to aggregate. Will consider all numeric columns not specified in *:index* or *:vectors*. Optional. == Usage df = Daru::DataFrame.new({ a: ['foo' , 'foo', 'foo', 'foo', 'foo', 'bar', 'bar', 'bar', 'bar'], b: ['one' , 'one', 'one', 'two', 'two', 'one', 'one', 'two', 'two'], c: ['small','large','large','small','small','large','small','large','small'], d: [1,2,2,3,3,4,5,6,7], e: [2,4,4,6,6,8,10,12,14] }) df.pivot_table(index: [:a], vectors: [:b], agg: :sum, values: :e) #=> # # # [:e, :one] [:e, :two] # [:bar] 18 26 # [:foo] 10 12", "label": 1, "domain": "code", "token_count": 372, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0632", "text": "@constructor Find Bar UI component, used for both single- and multi-file find/replace. This doesn't actually create and add the FindBar to the DOM - for that, call open(). Dispatches these events: - queryChange - when the user types in the input field or sets a query option. Use getQueryInfo() to get the current query state. - doFind - when the user chooses to do a Find Previous or Find Next. Parameters are: shiftKey - boolean, false for Find Next, true for Find Previous - doReplace - when the user chooses to do a single replace. Use getReplaceText() to get the current replacement text. - doReplaceBatch - when the user chooses to initiate a Replace All. Use getReplaceText() to get the current replacement text. - doReplaceAll - when the user chooses to perform a Replace All. Use getReplaceText() to get the current replacement text. - close - when the find bar is closed @param {boolean=} options.multifile - true if this is a Find/Replace in Files (changes the behavior of Enter in the fields, hides the navigator controls, shows the scope/filter controls, and if in replace mode, hides the Replace button (so there's only Replace All) @param {boolean=} options.replace - true to show the Replace controls - default false @param {string=} options.queryPlaceholder - label to show in the Find field - default empty string @param {string=} options.initialQuery - query to populate in the Find field on open - default empty string @param {string=} scopeLabel - HTML label to show for the scope of the search, expected to be already escaped - default empty string", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0633", "text": "Given a {@code Value} and a {@code Barrier}, we add one or more slots to the waitingFor list of the barrier corresponding to the {@code Value}. We also create {@link HandleSlotFilledTask HandleSlotFilledTasks} for all filled slots. We register all newly created Slots and Tasks with the given {@code UpdateSpec}.

    If the value is an {@code ImmediateValue} we make a new slot, register it as filled and add it. If the value is a {@code FutureValue} we add the slot wrapped by the {@code FutreValueImpl}. If the value is a {@code FutureList} then we add multiple slots, one for each {@code Value} in the List wrapped by the {@code FutureList}. This process is not recursive because we do not currently support {@code FutureLists} of {@code FutureLists}. @param updateSpec All newly created Slots will be added to the {@link UpdateSpec#getNonTransactionalGroup() non-transactional group} of the updateSpec. All {@link HandleSlotFilledTask HandleSlotFilledTasks} created will be added to the {@link UpdateSpec#getFinalTransaction() final transaction}. Note that {@code barrier} will not be added to updateSpec. That must be done by the caller. @param value A {@code Value}. {@code Null} is interpreted as an {@code ImmediateValue} with a value of {@code Null}. @param rootJobKey The rootJobKey of the Pipeline in which the given Barrier lives. @param generatorJobKey The key of the generator Job of the local graph in which the given barrier lives, or {@code null} if the barrier lives in the root Job graph. @param queueSettings The QueueSettings for tasks created by this method @param graphGUID The GUID of the local graph in which the barrier lives, or {@code null} if the barrier lives in the root Job graph. @param barrier The barrier to which we will add the slots", "label": 1, "domain": "code", "token_count": 400, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0634", "text": "Lists report records by subscription. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param filter [String] | Field | Usage | Supported operators | Supported functions |
    |-------------|-------------|-------------|-------------|
    | timestamp | filter | ge, le | |
    | displayName | select, orderBy | | |
    | apiRegion | filter | eq | |
    | userId | select, filter | eq | |
    | productId | select, filter | eq | |
    | subscriptionId | select, filter | eq | |
    | callCountSuccess | select, orderBy | | |
    | callCountBlocked | select, orderBy | | |
    | callCountFailed | select, orderBy | | |
    | callCountOther | select, orderBy | | |
    | callCountTotal | select, orderBy | | |
    | bandwidth | select, orderBy | | |
    | cacheHitsCount | select | | |
    | cacheMissCount | select | | |
    | apiTimeAvg | select, orderBy | | |
    | apiTimeMin | select | | |
    | apiTimeMax | select | | |
    | serviceTimeAvg | select | | |
    | serviceTimeMin | select | | |
    | serviceTimeMax | select | | |
    @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param orderby [String] OData order by query option. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 378, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0635", "text": "Creates an output Observable which sequentially emits all values from every given input Observable after the current Observable. Concatenates multiple Observables together by sequentially emitting their values, one Observable after the other. Joins this Observable with multiple other Observables by subscribing to them one at a time, starting with the source, and merging their results into the output Observable. Will wait for each Observable to complete before moving on to the next. @example Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10 var timer = Rx.Observable.interval(1000).take(4); var sequence = Rx.Observable.range(1, 10); var result = timer.concat(sequence); result.subscribe(x => console.log(x)); @example Concatenate 3 Observables var timer1 = Rx.Observable.interval(1000).take(10); var timer2 = Rx.Observable.interval(2000).take(6); var timer3 = Rx.Observable.interval(500).take(10); var result = timer1.concat(timer2, timer3); result.subscribe(x => console.log(x)); @see {@link concatAll} @see {@link concatMap} @see {@link concatMapTo} @param {Observable} other An input Observable to concatenate after the source Observable. More than one input Observables may be given as argument. @param {Scheduler} [scheduler=null] An optional Scheduler to schedule each Observable subscription on. @return {Observable} All values of each passed Observable merged into a single Observable, in order, in serial fashion. @method concat @owner Observable", "label": 1, "domain": "code", "token_count": 353, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0636", "text": "DOM_performSearch(self, query, includeUserAgentShadowDOM) Python Function: DOM_performSearch Domain: DOM Method name: performSearch WARNING: This function is marked 'Experimental'! Parameters: 'query' (type: string) -> Plain text or query selector or XPath search query. 'includeUserAgentShadowDOM' (type: boolean) -> True to search in user agent shadow DOM. Returns: 'searchId' (type: string) -> Unique search session identifier. 'resultCount' (type: integer) -> Number of search results. Description: Searches for a given string in the DOM tree. Use getSearchResults to access search results or cancelSearch to end this search session. Python Function: DOM_getSearchResults Domain: DOM Method name: getSearchResults WARNING: This function is marked 'Experimental'! Parameters: 'searchId' (type: string) -> Unique search session identifier. 'fromIndex' (type: integer) -> Start index of the search result to be returned. 'toIndex' (type: integer) -> End index of the search result to be returned. Returns: 'nodeIds' (type: array) -> Ids of the search result nodes. Description: Returns search results from given fromIndex to given toIndex from the sarch with the given identifier. DOM_discardSearchResults(self, searchId) Python Function: DOM_discardSearchResults Domain: DOM Method name: discardSearchResults WARNING: This function is marked 'Experimental'! Parameters: 'searchId' (type: string) -> Unique search session identifier. No return value. Description: Discards search results from the session with the given id. getSearchResults should no longer be called for that search.", "label": 1, "domain": "code", "token_count": 382, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0637", "text": "

    Startups he kernel depending on a bootstrap definition.

    Following rules applies for the bootstrap path:

    • if _bootstrapPath is not null, _bootstrapPath is used as bootstrap path
    • if in the system environment the shell variable {@link #ENV_PATH} is defined, this value of this shell variable is used
    • in all other cases {@link #DEFAULT_BOOTSTRAP_PATH} is used

    Following rules applies for the bootstrap name:

    • if _bootstrapFile is not null, _bootstrapFile is used as bootstrap name
    • if in the system environment the shell variable {@link #ENV_FILE} is defined, this value of this shell variable is used
    • in all other cases {@link #DEFAULT_BOOTSTRAP_FILE} is used

    After the used bootstrap file is identified, this file is opened and the keys are read and evaluated.

    @param _bootstrapPath path where the bootstrap files are located; null means that the path is not predefined @param _bootstrapFile name of the bootstrap file (without file extension); null means the the name of the bootstrap is not predefined @throws StartupException if startup failed", "label": 1, "domain": "code", "token_count": 321, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0638", "text": "Iterates over attributes and removes it from each element of elements. @param {(string|Array|NodeList|HTMLCollection|Element)} elements - The iterable, selector or elements. @param {...string} attributes - Names of data attributes to remove. @return {Array} iterable - The getElements' result for chaining. @example //esnext import { createElement, append, removeData } from 'chirashi' const maki = createElement('.maki') append(document.body, maki) append(maki, ['.salmon[data-fish=\"salmon\"]', '.cheese[data-cheese=\"cream\"]']) //returns:
    removeData('.salmon', 'fish') //returns: [
    ] @example //es5 var maki = Chirashi.createElement('.maki') Chirashi.append(document.body, maki) Chirashi.append(maki, ['.salmon[data-fish=\"salmon\"]', '.cheese[data-cheese=\"cream\"]']) //returns:
    Chirashi.removeData('.salmon', 'fish') //returns: [
    ]", "label": 1, "domain": "code", "token_count": 309, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0639", "text": "Checks if value is included in collection @example sap.ui.require([\"sap/base/util/includes\"], function(includes){ // arrays includes([\"1\", \"8\", \"7\"], \"8\"); // true includes([\"1\", \"8\", \"7\"], \"8\", 0); // true includes([\"1\", \"8\", \"7\"], \"8\", 1); // true includes([\"1\", \"8\", \"7\"], \"8\", 2); // false includes([\"1\", \"8\", \"7\"], \"8\", 3); // false includes([\"1\", \"8\", \"7\"], \"8\", -1); // false includes([\"1\", \"8\", \"7\"], \"8\", -2); // true includes([\"1\", \"8\", \"7\"], \"8\", -3); // true // strings includes(\"187\", \"8\"); // true includes(\"187\", \"8\", 0); // true includes(\"187\", \"8\", 1); // true includes(\"187\", \"8\", 2); // false includes(\"187\", \"8\", 3); // false includes(\"187\", \"8\", -1); // false includes(\"187\", \"8\", -2); // true includes(\"187\", \"8\", -3); // true }); @function @since 1.58 @alias module:sap/base/util/includes @param {Array|object|string} vCollection - Collection to be checked @param {*} vValue - The value to be checked @param {int} [iFromIndex=0] - optional start index, negative start index will start from the end @returns {boolean} - true if value is in the collection, false otherwise @public", "label": 1, "domain": "code", "token_count": 346, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0640", "text": "/* var obj = {a: 3, b: 5}; extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} obj; // {a: 4, b: 5, c: 8} var obj = {a: 3, b: 5}; extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} obj; // {a: 3, b: 5} var arr = [1, 2, 3]; var obj = {a: 3, b: 5}; extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]} arr.push(4); obj; // {a: 3, b: 5, c: [1, 2, 3, 4]} var arr = [1, 2, 3]; var obj = {a: 3, b: 5}; extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]} arr.push(4); obj; // {a: 3, b: 5, c: [1, 2, 3]} extend({a: 4, b: 5}); // {a: 4, b: 5} extend({a: 4, b: 5}, 3); {a: 4, b: 5} extend({a: 4, b: 5}, true); {a: 4, b: 5} extend('hello', {a: 4, b: 5}); // throws extend(3, {a: 4, b: 5}); // throws", "label": 1, "domain": "code", "token_count": 413, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0641", "text": "@!group Actions @example Request syntax with placeholder values bucket.create({ acl: \"private\", # accepts private, public-read, public-read-write, authenticated-read create_bucket_configuration: { location_constraint: \"EU\", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1 }, grant_full_control: \"GrantFullControl\", grant_read: \"GrantRead\", grant_read_acp: \"GrantReadACP\", grant_write: \"GrantWrite\", grant_write_acp: \"GrantWriteACP\", object_lock_enabled_for_bucket: false, }) @param [Hash] options ({}) @option options [String] :acl The canned ACL to apply to the bucket. @option options [Types::CreateBucketConfiguration] :create_bucket_configuration @option options [String] :grant_full_control Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. @option options [String] :grant_read Allows grantee to list the objects in the bucket. @option options [String] :grant_read_acp Allows grantee to read the bucket ACL. @option options [String] :grant_write Allows grantee to create, overwrite, and delete any object in the bucket. @option options [String] :grant_write_acp Allows grantee to write the ACL for the applicable bucket. @option options [Boolean] :object_lock_enabled_for_bucket Specifies whether you want S3 Object Lock to be enabled for the new bucket. @return [Types::CreateBucketOutput]", "label": 1, "domain": "code", "token_count": 352, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0642", "text": "Speculative FIFO Input interface: full, we, din, wr_commit, wr_discard Output interface: empty, re, dout, rd_commit, rd_discard we (i) - writes data speculatively (the data can be later removed from the fifo) wr_commit (i) - accept the speculatively written data (can be read) wr_discard (i) - remove the speculatively written data at once full (o) - asserted when there are no empty cells to write data speculatively If we is asserted together with the wr_commit or wr_discard, the data being written is affected by the commit/discard command. If wr_commit and wr_discard are asserted simultaneously, the wr_discard wins. re (i) - reads data speculatively (the data can be later restored) rd_commit (i) - removes the speculatively read data at once rd_discard (i) - restores the speculatively read data (will be read again) empty (o) - asserted when there are no committed date to be read If re is asserted together with the rd_commit or rd_discards, the data being read is affected by the commit/discard command. If rd_commit and rd_discard are asserted simultaneously, the rd_discard wins. Note: This fifo can be Full and Empty at the same time - all fifo cells are occupied by data that are either speculatively written or speculatively read Extra interface: afull (o) - almost full flag, asserted when the number of empty cells <= afull_th aempty (o) - almost empty flag, asserted when the number of full cells <= aempty_th afull_th (i) - almost full threshold, in terms of fifo cells; Optional, default depth/2 aempty_th (i) - almost empty threshold, in terms of fifo cells; Optional, default depth/2 count (o) - number of occupied fifo cells, committed and not committed (speculatively written/read) count_max (o) - max number of occupied fifo cells reached since the last reset ovf (o) - overflow flag, set at the first write in a full fifo, cleared at reset udf (o) - underflow flag, set at the first read from an empty fifo, cleared at reset", "label": 1, "domain": "code", "token_count": 470, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0643", "text": "Replies two position factors for the intersection point between two lines.

    Let line equations for L1 and L2:
    L1: P1 + factor1 * (P2-P1)
    L2: P3 + factor2 * (P4-P3)
    If lines are intersecting, then
    P1 + factor1 * (P2-P1) = P3 + factor2 * (P4-P3)

    This function computes and replies factor1 and factor2. @param x1 is the first point of the first line. @param y1 is the first point of the first line. @param z1 is the first point of the first line. @param x2 is the second point of the first line. @param y2 is the second point of the first line. @param z2 is the second point of the first line. @param x3 is the first point of the second line. @param y3 is the first point of the second line. @param z3 is the first point of the second line. @param x4 is the second point of the second line. @param y4 is the second point of the second line. @param z4 is the second point of the second line. @return the tuple (factor1, factor2) or null if no intersection.", "label": 1, "domain": "code", "token_count": 320, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0644", "text": "PostMessageChannel constructor @constructor @param {Object} options the configuration options for the instance @param {Object} options.target - the target iframe or iframe configuration @param {String} [options.target.url] - the url to load @param {Object} [options.target.container] - the container in which the iframe should be created (if not supplied, document.body will be used) @param {String} [options.target.style] - the CSS style to apply @param {String} [options.target.style.width] width of iframe @param {String} [options.target.style.height] height of iframe ..... @param {Boolean} [options.target.bust = true] - optional flag to indicate usage of cache buster when loading the iframe (default to true) @param {Function} [options.target.callback] - a callback to invoke after the iframe had been loaded, @param {Object} [options.target.context] - optional context for the callback @param {Function|Object} [options.onready] - optional data for usage when iframe had been loaded { @param {Function} [options.onready.callback] - a callback to invoke after the iframe had been loaded @param {Object} [options.onready.context] - optional context for the callback @param {Boolean} [options.removeDispose] - optional flag for removal of the iframe on dispose @param {Function} [options.serialize = JSON.stringify] - optional serialization method for post message @param {Function} [options.deserialize = JSON.parse] - optional deserialization method for post message @param {String} [options.targetOrigin] optional targetOrigin to be used when posting the message (must be supplied in case of external iframe) @param {Number} [options.maxConcurrency = 100] - optional maximum concurrency that can be managed by the component before dropping @param {Number} [options.handshakeInterval = 5000] - optional handshake interval for retries @param {Number} [options.handshakeAttempts = 3] - optional number of retries handshake attempts @param {String} [options.hostParam] - optional parameter of the host parameter name (default is lpHost) @param {Function} onmessage - the handler for incoming messages", "label": 1, "domain": "code", "token_count": 449, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0645", "text": ">>> import pprint >>> input_line = '{\"level\": \"warning\", \"timestamp\": \"2018-02-07T06:37:00.297610Z\", \"event\": \"exited via keyboard interrupt\", \"type\": \"log\", \"id\": \"20180207T063700_4d03fe800bd111e89ecb96000007bc65\", \"_\": {\"ln\": 58, \"file\": \"/usr/local/lib/python2.7/dist-packages/basescript/basescript.py\", \"name\": \"basescript.basescript\", \"fn\": \"start\"}}' >>> output_line1 = basescript(input_line) >>> pprint.pprint(output_line1) {'data': {u'_': {u'file': u'/usr/local/lib/python2.7/dist-packages/basescript/basescript.py', u'fn': u'start', u'ln': 58, u'name': u'basescript.basescript'}, u'event': u'exited via keyboard interrupt', u'id': u'20180207T063700_4d03fe800bd111e89ecb96000007bc65', u'level': u'warning', u'timestamp': u'2018-02-07T06:37:00.297610Z', u'type': u'log'}, 'event': u'exited via keyboard interrupt', 'id': u'20180207T063700_4d03fe800bd111e89ecb96000007bc65', 'level': u'warning', 'timestamp': u'2018-02-07T06:37:00.297610Z', 'type': u'log'}", "label": 1, "domain": "code", "token_count": 354, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0646", "text": "Get an input stream from a URL connection. In case of an IOException, get the ErrorStream instead, if it is available. This makes it possible to obtain an ows:ExceptionReport when the server returns HTTP code 400 Bad Request. This method depends upon features of class sun.net.www.protocol.http.HttpURLConnection introduced in Java version 7 (JDK 1.7.0). From its Javadoc: System properties related to error stream handling: sun.net.http.errorstream.enableBuffering = With the above system property set to true (default is false), when the response code is >=400, the HTTP handler will try to buffer the response body (up to a certain amount and within a time limit). Thus freeing up the underlying socket connection for reuse. The rationale behind this is that usually when the server responds with a >=400 error (client error or server error, such as 404 file not found), the server will send a small response body to explain who to contact and what to do to recover. With this property set to true, even if the application doesn't call getErrorStream(), read the response body, and then call close(), the underlying socket connection can still be kept-alive and reused. The following two system properties provide further control to the error stream buffering behaviour. sun.net.http.errorstream.timeout = the timeout (in millisec) waiting the error stream to be buffered; default is 300 ms sun.net.http.errorstream.bufferSize = the size (in bytes) to use for the buffering the error stream; default is 4k @return InputStream from URLConnection if available, or the error stream if the connection failed but the server sent useful data, or null.", "label": 1, "domain": "code", "token_count": 352, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0647", "text": "Construct room state. Room State represents the state of the room at a given point. It can be mutated by adding state events to it. There are two types of room member associated with a state event: normal member objects (accessed via getMember/getMembers) which mutate with the state to represent the current state of that room/user, eg. the object returned by getMember('@bob:example.com') will mutate to get a different display name if Bob later changes his display name in the room. There are also 'sentinel' members (accessed via getSentinelMember). These also represent the state of room members at the point in time represented by the RoomState object, but unlike objects from getMember, sentinel objects will always represent the room state as at the time getSentinelMember was called, so if Bob subsequently changes his display name, a room member object previously acquired with getSentinelMember will still have his old display name. Calling getSentinelMember again after the display name change will return a new RoomMember object with Bob's new display name. @constructor @param {?string} roomId Optional. The ID of the room which has this state. If none is specified it just tracks paginationTokens, useful for notifTimelineSet @param {?object} oobMemberFlags Optional. The state of loading out of bound members. As the timeline might get reset while they are loading, this state needs to be inherited and shared when the room state is cloned for the new timeline. This should only be passed from clone. @prop {Object.} members The room member dictionary, keyed on the user's ID. @prop {Object.>} events The state events dictionary, keyed on the event type and then the state_key value. @prop {string} paginationToken The pagination token for this state.", "label": 1, "domain": "code", "token_count": 381, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0648", "text": "Accepts a series of functions and builds a function that applies the received arguments to each one and returns the first non-undefined value.
    Meant to work in synergy with {@link module:lamb.case|case} and {@link module:lamb.invoker|invoker}, can be useful as a strategy pattern for functions, to mimic conditional logic or pattern matching, and also to build polymorphic functions. @example var isEven = function (n) { return n % 2 === 0; }; var filterString = _.compose(_.invoker(\"join\", \"\"), _.filter); var filterAdapter = _.adapter([ _.invoker(\"filter\"), _.case(_.isType(\"String\"), filterString) ]); filterAdapter([1, 2, 3, 4, 5, 6], isEven) // => [2, 4, 6] filterAdapter(\"123456\", isEven) // => \"246\" filterAdapter({}, isEven) // => undefined // by its nature is composable var filterWithDefault = _.adapter([filterAdapter, _.always(\"Not implemented\")]); filterWithDefault([1, 2, 3, 4, 5, 6], isEven) // => [2, 4, 6] filterWithDefault(\"123456\", isEven) // => \"246\" filterWithDefault({}, isEven) // => \"Not implemented\" @memberof module:lamb @category Logic @see {@link module:lamb.case|case} @see {@link module:lamb.invoker|invoker} @since 0.6.0 @param {Function[]} functions @returns {Function}", "label": 1, "domain": "code", "token_count": 347, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0649", "text": "Replies the baricentric coordinates (in the triangle) of the intersection between a triangle and a segment.

    If the segment and the triangle are not intersecting, this function replies {@link Double#NaN}. Otherwise the replied value is the factor that could be used for computing the intersection point. Value of zero means that the intersection point is the first point of the segment. Value of 1 means that the intersection point is the second point of the segment. Value in (0;1) means the intersection point is located on the segment. This function implements the algorithm provided by Jimenez et al.:
    Juan J. Jimenez, Rafael J. Segura, Francisco R. Feito. \"A robust segment/triangle intersection algorithm for interference tests. Efficiency study\". Computational Geometry 43 (2010) pp 474-492. 2010. The algorithm of Jimenez et al. is faster than the algorithm of Badouel et al. @param tx1 x coordinate of the first point of the triangle. @param ty1 y coordinate of the first point of the triangle. @param tz1 z coordinate of the first point of the triangle. @param tx2 x coordinate of the second point of the triangle. @param ty2 y coordinate of the second point of the triangle. @param tz2 z coordinate of the second point of the triangle. @param tx3 x coordinate of the third point of the triangle. @param ty3 y coordinate of the third point of the triangle. @param tz3 z coordinate of the third point of the triangle. @param sx1 x coordinate of the first point of the segment. @param sy1 y coordinate of the first point of the segment. @param sz1 z coordinate of the first axis of the oriented box. @param sx2 x coordinate of the second point of the segment. @param sy2 y coordinate of the second point of the segment. @param sz2 z coordinate of the second axis of the oriented box. @return the barycentric coordinates. @see #getTriangleSegmentIntersectionFactorWithBadouelAlgorithm(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)", "label": 1, "domain": "code", "token_count": 480, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0650", "text": "

    Perform a CSS String level 2 (basic set and all non-ASCII chars) escape operation on a char[] input.

    Level 2 means this method will escape:

    • The CSS String basic escape set:
      • The Backslash Escapes: \" (U+0022) and \' (U+0027).
      • Two ranges of non-displayable, control characters: U+0000 to U+001F and U+007F to U+009F.
    • All non ASCII characters.

    This escape will be performed by using Backslash escapes whenever possible. For escaped characters that do not have an associated Backslash, default to \FF Hexadecimal Escapes.

    This method calls {@link #escapeCssString(char[], int, int, java.io.Writer, CssStringEscapeType, CssStringEscapeLevel)} with the following preconfigured values:

    • type: {@link CssStringEscapeType#BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA}
    • level: {@link CssStringEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET}

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 491, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0651", "text": "Yields each batch of records that was found by the find options as an array. Person.where(\"age > 21\").find_in_batches do |group| sleep(50) # Make sure it doesn't get too crowded in there! group.each { |person| person.party_all_night! } end If you do not provide a block to #find_in_batches, it will return an Enumerator for chaining with other methods: Person.find_in_batches.with_index do |group, batch| puts \"Processing group ##{batch}\" group.each(&:recover_from_last_night!) end To be yielded each record one by one, use #find_each instead. ==== Options * :batch_size - Specifies the size of the batch. Defaults to 1000. * :start - Specifies the primary key value to start from, inclusive of the value. * :finish - Specifies the primary key value to end at, inclusive of the value. * :error_on_ignore - Overrides the application config to specify if an error should be raised when an order is present in the relation. Limits are honored, and if present there is no requirement for the batch size: it can be less than, equal to, or greater than the limit. The options +start+ and +finish+ are especially useful if you want multiple workers dealing with the same processing queue. You can make worker 1 handle all the records between id 1 and 9999 and worker 2 handle from 10000 and beyond by setting the +:start+ and +:finish+ option on each worker. # Let's process from record 10_000 on. Person.find_in_batches(start: 10_000) do |group| group.each { |person| person.party_all_night! } end NOTE: It's not possible to set the order. That is automatically set to ascending on the primary key (\"id ASC\") to make the batch ordering work. This also means that this method only works when the primary key is orderable (e.g. an integer or string). NOTE: By its nature, batch processing is subject to race conditions if other processes are modifying the database.", "label": 1, "domain": "code", "token_count": 453, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0652", "text": "

    Perform an XML 1.0 level 1 (only markup-significant chars) escape operation on a String input.

    Level 1 means this method will only escape the five markup-significant characters which are predefined as Character Entity References in XML: <, >, &, " and '.

    This method calls {@link #escapeXml10(String, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @return The escaped result String. As a memory-performance improvement, will return the exact same object as the text input argument if no escaping modifications were required (and no additional String objects will be created during processing). Will return null if input is null.", "label": 1, "domain": "code", "token_count": 332, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0653", "text": "Calculates probability of gene i regulating gene j with continuous data assisted method, with the recommended combination of multiple tests. dc: numpy.ndarray(nt,ns,dtype=ftype(='f4' by default)) Continuous anchor data. Entry dc[i,j] is anchor i's value for sample j. Anchor i is used to infer the probability of gene i -> any other gene. dt: numpy.ndarray(nt,ns,dtype=ftype(='=f4' by default)) Gene expression data for A Entry dt[i,j] is gene i's expression level for sample j. dt2:numpy.ndarray(nt2,ns,dtype=ftype(='=f4' by default)) Gene expression data for B. dt2 has the same format as dt, and can be identical with, different from, or a superset of dt. When dt2 is a superset of (or identical with) dt, dt2 must be arranged to be identical with dt at its upper submatrix, i.e. dt2[:nt,:]=dt, and set parameter nodiag = 1. name: actual C function name to call nodiag: skip diagonal regulations, i.e. regulation A->B for A=B. This should be set to True when A is a subset of B and aligned correspondingly. memlimit: The approximate memory usage limit in bytes for the library. For datasets require a larger memory, calculation will be split into smaller chunks. If the memory limit is smaller than minimum required, calculation can fail with an error message. memlimit=0 defaults to unlimited memory usage. Return: dictionary with following keys: ret:0 iff execution succeeded. p: numpy.ndarray((nt,nt2),dtype=ftype(='=f4' by default)). Probability function from for recommended combination of multiple tests. For more information on tests, see paper. ftype can be found in auto.py.", "label": 1, "domain": "code", "token_count": 385, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0654", "text": "This API will induce data loss for the specified partition. It will trigger a call to the OnDataLossAsync API of the partition. This API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss API of the partition. Actual data loss will depend on the specified DataLossMode PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual data loss depends on the presence of in-flight replication. FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered. This API should only be called with a stateful service as the target. Calling this API with a system service as the target is not advised. Note: Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and clean up internal system state. It will not restore data if the command has progressed far enough to cause data loss. Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this API. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param partition_id The identity of the partition. @param operation_id A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API @param data_loss_mode [DataLossMode] This enum is passed to the StartDataLoss API to indicate what type of data loss to induce. Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.", "label": 1, "domain": "code", "token_count": 468, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0655", "text": "Check that the supplied value is an Internet Protocol address, v.4, represented by a dotted-quad string, i.e. '1.2.3.4'. >>> vtor = Validator() >>> vtor.check('ip_addr', '1 ') '1' >>> vtor.check('ip_addr', ' 1.2') '1.2' >>> vtor.check('ip_addr', ' 1.2.3 ') '1.2.3' >>> vtor.check('ip_addr', '1.2.3.4') '1.2.3.4' >>> vtor.check('ip_addr', '0.0.0.0') '0.0.0.0' >>> vtor.check('ip_addr', '255.255.255.255') '255.255.255.255' >>> vtor.check('ip_addr', '255.255.255.256') # doctest: +SKIP Traceback (most recent call last): VdtValueError: the value \"255.255.255.256\" is unacceptable. >>> vtor.check('ip_addr', '1.2.3.4.5') # doctest: +SKIP Traceback (most recent call last): VdtValueError: the value \"1.2.3.4.5\" is unacceptable. >>> vtor.check('ip_addr', 0) # doctest: +SKIP Traceback (most recent call last): VdtTypeError: the value \"0\" is of the wrong type.", "label": 1, "domain": "code", "token_count": 319, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0656", "text": "Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a link to the next page, if any. @param resource_group_name [String] The name of the Azure resource group that contains the Data Lake Analytics account. @param filter [String] OData filter. Optional. @param top [Integer] The number of items to return. Optional. @param skip [Integer] The number of items to skip over before returning elements. Optional. @param expand [String] OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. @param select [String] OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. @param orderby [String] OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. @param count [Boolean] The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. @param search [String] A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. @param format [String] The return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 391, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0657", "text": "Gets the container logs for container deployed on a Service Fabric node. Gets the container logs for container deployed on a Service Fabric node for the given code package. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_manifest_name [String] The name of a service manifest registered as part of an application type in a Service Fabric cluster. @param code_package_name [String] The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. @param tail [String] Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. @param previous [Boolean] Specifies whether to get container logs from exited/dead containers of the code package instance. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ContainerLogs] operation results.", "label": 1, "domain": "code", "token_count": 330, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0658", "text": " Generate an ECDSA key object from 'pem'. In addition, a keyid identifier for the ECDSA key is generated. The object returned conforms to 'securesystemslib.formats.ECDSAKEY_SCHEMA' and has the form: {'keytype': 'ecdsa-sha2-nistp256', 'scheme': 'ecdsa-sha2-nistp256', 'keyid': keyid, 'keyval': {'public': '-----BEGIN PUBLIC KEY----- ...', 'private': ''}} The public portion of the ECDSA key is a string in PEM format. >>> ecdsa_key = generate_ecdsa_key() >>> public = ecdsa_key['keyval']['public'] >>> ecdsa_key['keyval']['private'] = '' >>> scheme = ecdsa_key['scheme'] >>> ecdsa_key2 = import_ecdsakey_from_public_pem(public, scheme) >>> securesystemslib.formats.ECDSAKEY_SCHEMA.matches(ecdsa_key) True >>> securesystemslib.formats.ECDSAKEY_SCHEMA.matches(ecdsa_key2) True pem: A string in PEM format (it should contain a public ECDSA key). scheme: The signature scheme used by the imported key. securesystemslib.exceptions.FormatError, if 'pem' is improperly formatted. Only the public portion of the PEM is extracted. Leading or trailing whitespace is not included in the PEM string stored in the rsakey object returned. A dictionary containing the ECDSA keys and other identifying information. Conforms to 'securesystemslib.formats.ECDSAKEY_SCHEMA'.", "label": 1, "domain": "code", "token_count": 343, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0659", "text": "/* TODO Fix DuffState it doesn't work @State(Scope.Thread) public static class DuffState extends UnsafeState { @Setup public void setup() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { Preconditions.checkState(destSize / COPY_STRIDE == 4); final int iterations = (int) (destSize / COPY_STRIDE); copier = new UnsafeCopier(unsafe) { @Override public void copy(Object dest, long src) { long dstOffset = destOffset; int n = iterations / 8; int s = iterations % 8; do { switch (s) { // iterations % 8 case 0: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; fall through case 7: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; fall through case 6: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; fall through case 5: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; fall through case 4: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; fall through case 3: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; fall through case 2: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; fall through case 1: unsafe.putLong(dest, dstOffset, unsafe.getLong(src)); dstOffset += COPY_STRIDE; src += COPY_STRIDE; } } while (--n > 0); } }; } }", "label": 1, "domain": "code", "token_count": 390, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0660", "text": "[playerStats description] @param {string|integer} playerID Player's Dota ID Number @property {object} playerInfoJson JSON object containing player stats and info @property {string} playerInfoJson.status Status of request call. See status reports section in README.md @property {float} playerInfoJson.daysSinceLastMatch Number of days since last match was played && parsed @property {string} playerInfoJson.soloMMR Solo MMR Value @property {string} playerInfoJson.partyMMR Party MMR Value @property {string} playerInfoJson.estMMR OpenDota Estimated MMR Value @property {string} playerInfoJson.name User's current Profile Name @property {object} playerInfoJson.winLoss Object of Win-Loss values @property {string} playerInfoJson.winLoss.wins Number of wins (returned as string) @property {string} playerInfoJson.winLoss.losses Number of losses (returned as string) @property {string} playerInfoJson.winLoss.winrate Winrate percentage @property {string} playerInfoJson.winLoss.totalGames Number of total games played & parsed @property {array} playerInfoJson.mostPlayed Array of User's 5 most played heroes, with games played and winrate @property {array} playerInfoJson.recentGames Array of User's 20 most recent games, with matchID, hero, result, time played, and skill level @property {string} playerInfoJson.profileUrl URL to user's proflie on OpenDota.com", "label": 1, "domain": "code", "token_count": 313, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0661", "text": "Sorting an array of objects by values @param {Array} [arr] An Array of objects @param {Mix} [map] Map to custom order. If value isn't an array with values, will do natural sort @param {String} [key] Object key to use for sorting (accepts dot notation) @param {Boolean} [reverse=false] Reverse sorting @returns {Array} New object array with sorting values @example var mapToSort = ['A', 'B', 'C', 'D', 'E']; // Map to sorting var obj = [{param: 'D'}, {param: 'A'}, {param: 'E'}, {param: 'C'}, {param: 'B'}]; globalHelpers.objectArraySortByValue(objToSortByValue, mapToSort, 'param'); //=> [{param: 'A'}, {param: 'B'}, {param: 'C'}, {param: 'D'}, {param: 'E'}] // Deep key var obj = [{deep: {param: 'D'}}, {deep: {param: 'A'}}, {deep: {param: 'E'}}, {deep: {param: 'C'}}, {deep: {param: 'B'}}]; globalHelpers.objectArraySortByValue(objToSortByValue, mapToSort, 'deep.param'); //=> [{deep: {param: 'A'}}, {deep: {param: 'B'}}, {deep: {param: 'C'}}, {deep: {param: 'D'}}, {deep: {param: 'E'}}]", "label": 1, "domain": "code", "token_count": 329, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0662", "text": "Determine and return the best layout of \"tiles\" for fastest overall parallel processing of a rectangular image broken up into N smaller equally-sized rectangular tiles, given as input the number of processes/chunks which can be run/worked at the same time (pool_size). This attempts to return a layout whose total number of tiles is as close as possible to pool_size, without going over (and thus not really taking advantage of pooling). Since we can vary the size of the rectangles, there is not much (any?) benefit to pooling. Returns a tuple of ( , ) This assumes the image in question is relatively close to square, and so the returned tuple attempts to give a layout which is as squarishly-blocked as possible, except in cases where speed would be sacrificed. EXAMPLES: For pool_size of 4, the best result is 2x2. For pool_size of 6, the best result is 2x3. For pool_size of 5, a result of 1x5 is better than a result of 2x2 (which would leave one core unused), and 1x5 is also better than a result of 2x3 (which would require one core to work twice while all others wait). For higher, odd pool_size values (say 39), it is deemed best to sacrifice a few unused cores to satisfy our other constraints, and thus the result of 6x6 is best (giving 36 tiles and 3 unused cores).", "label": 1, "domain": "code", "token_count": 316, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0663", "text": "Does reference based chimera checking with usearch61 abundance_fp: input consensus fasta file with abundance information for each cluster. uchime_ref_fp: output uchime filepath for reference results reference_seqs_fp: reference fasta database for chimera checking. minlen: minimum sequence length for usearch input fasta seqs. output_dir: output directory removed_usearch_logs: suppresses creation of log file. uchime_denovo_log_fp: output filepath for log file. usearch61_minh: Minimum score (h) to be classified as chimera. Increasing this value tends to the number of false positives (and also sensitivity). usearch61_xn: Weight of \"no\" vote. Increasing this value tends to the number of false positives (and also sensitivity). usearch61_dn: Pseudo-count prior for \"no\" votes. (n). Increasing this value tends to the number of false positives (and also sensitivity). usearch61_mindiffs: Minimum number of diffs in a segment. Increasing this value tends to reduce the number of false positives while reducing sensitivity to very low-divergence chimeras. usearch61_mindiv: Minimum divergence, i.e. 100% - identity between the query and closest reference database sequence. Expressed as a percentage, so the default is 0.8%, which allows chimeras that are up to 99.2% similar to a reference sequence. threads: Specify number of threads used per core per CPU HALTEXEC: halt execution and returns command used for app controller.", "label": 1, "domain": "code", "token_count": 312, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0664", "text": "Add a script to the list of SCRIPT_PRIORITIESipts run by this policy. If the script already exists in the policy, nil is returned and no changes are made. @param [String,Integer] identifier the name or id of the script to add to this policy @param [Hash] opts the options for this script @option [Symbol, Integer] position: where to add this script among the list of scripts. Zero-based, :start and 0 are the same, as are :end and -1. Defaults to :end @option [Symbol] priority: either :before or :after @option [String] parameter4: the value of the 4th parameter passed to the script. this overrides the same parameter in the script object itself. @option [String] parameter5: the value of the 5th parameter passed to the script. this overrides the same parameter in the script object itself. @option [String] parameter6: the value of the 6th parameter passed to the script. this overrides the same parameter in the script object itself. @option [String] parameter7: the value of the 7th parameter passed to the script. this overrides the same parameter in the script object itself. @option [String] parameter8: the value of the 8th parameter passed to the script. this overrides the same parameter in the script object itself. @option [String] parameter9: the value of the 9th parameter passed to the script. this overrides the same parameter in the script object itself. @option [String] parameter10: the value of the 10th parameter passed to the script. this overrides the same parameter in the script object itself. @option [String] parameter11: the value of the 11th parameter passed to the script. this overrides the same parameter in the script object itself. @return [Array, nil] the new @scripts array, nil if script was already in the policy", "label": 1, "domain": "code", "token_count": 400, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0665", "text": "Raises ValidationException if value is not a valid filename. Filenames can't contain \\\\ / : * ? \" < > | or end with a space. Returns the value argument. Note that this validates filenames, not filepaths. The / and \\\\ characters are invalid for filenames. * value (str): The value being validated as an IP address. * blank (bool): If True, a blank string will be accepted. Defaults to False. * strip (bool, str, None): If None, whitespace is stripped from value. If a str, the characters in it are stripped from value. If False, nothing is stripped. * allowlistRegexes (Sequence, None): A sequence of regex str that will explicitly pass validation, even if they aren't numbers. * blocklistRegexes (Sequence, None): A sequence of regex str or (regex_str, response_str) tuples that, if matched, will explicitly fail validation. * excMsg (str): A custom message to use in the raised ValidationException. >>> import pysimplevalidate as pysv >>> pysv.validateFilename('foobar.txt') 'foobar.txt' >>> pysv.validateFilename('???.exe') Traceback (most recent call last): ... pysimplevalidate.ValidationException: '???.exe' is not a valid filename. >>> pysv.validateFilename('/full/path/to/foo.txt') Traceback (most recent call last): ... pysimplevalidate.ValidationException: '/full/path/to/foo.txt' is not a valid filename.", "label": 1, "domain": "code", "token_count": 303, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0666", "text": "Returns the value for the label of a com.sap.vocabularies.UI.v1.DataFieldAbstract from the meta model. If no Label property is available, but the data field has a Value property with an edm:Path expression as value, the label will be taken from the com.sap.vocabularies.Common.v1.Label annotation of the path's target property. Example:
     <Label text=\"{meta>@@sap.ui.model.odata.v4.AnnotationHelper.label}\" /> 
    @param {any} vRawValue The raw value from the meta model @param {object} oDetails The details object @param {boolean} [oDetails.$$valueAsPromise] Whether a Promise may be returned if the needed metadata is not yet loaded (since 1.57.0) @param {sap.ui.model.Context} oDetails.context Points to the given raw value, that is oDetails.context.getProperty(\"\") === vRawValue @returns {string|Promise} A data binding or a fixed text or a sequence thereof or undefined. If oDetails.$$valueAsPromise is true a Promise may be returned resolving with the value for the label. @public @since 1.49.0", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0667", "text": "Constructor: OpenLayers.Control.Split Creates a new split control. A control is constructed with a target layer and an optional source layer. While the control is active, creating new features or modifying existing features on the source layer will result in splitting any eligible features on the target layer. If no source layer is provided, a temporary sketch layer will be created to create lines for splitting features on the target. Parameters: options - {Object} An object containing all configuration properties for the control. Valid options: layer - {} The target layer. Features from this layer will be split by new or modified features on the source layer or temporary sketch layer. source - {} Optional source layer. If provided newly created features or modified features will be used to split features on the target layer. If not provided, a temporary sketch layer will be created for drawing lines. tolerance - {Number} Optional value for the distance between a source vertex and the calculated intersection below which the split will occur at the vertex. edge - {Boolean} Allow splits given intersection of edges only. Default is true. If false, a vertex on the source must be within the distance of the calculated intersection for a split to occur. mutual - {Boolean} If source and target are the same, split source features and target features where they intersect. Default is true. If false, only target features will be split. targetFilter - {} Optional filter that will be evaluated to determine if a feature from the target layer is eligible for splitting. sourceFilter - {} Optional filter that will be evaluated to determine if a feature from the target layer is eligible for splitting.", "label": 1, "domain": "code", "token_count": 348, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0668", "text": "Take an input catalog, and image, and optional background/noise images fit the flux and ra/dec for each of the given sources, keeping the morphology fixed if doregroup is true the groups will be recreated based on a matching radius/probability. if doregroup is false then the islands of the input catalog will be preserved. Multiple cores can be specified, and will be used. Parameters ---------- filename : str or HDUList Image filename or HDUList. catalogue : str or list Input catalogue file name or list of OutputSource objects. hdu_index : int The index of the FITS HDU (extension). outfile : str file for printing catalog (NOT a table, just a text file of my own design) rmsin, bkgin : str or HDUList Filename or HDUList for the noise and background images. If either are None, then it will be calculated internally. cores : int Number of CPU cores to use. None means all cores. rms : float Use this rms for the entire image (will also assume that background is 0) beam : (major, minor, pa) Floats representing the synthesised beam (degrees). Replaces whatever is given in the FITS header. If the FITS header has no BMAJ/BMIN then this is required. lat : float The latitude of the telescope (declination of zenith). imgpsf : str or HDUList Filename or HDUList for a psf image. catpsf : str or HDUList Filename or HDUList for the catalogue psf image. stage : int Refitting stage ratio : float If not None - ratio of image psf to catalog psf, otherwise interpret from catalogue or image if possible innerclip, outerclip : float The seed (inner) and flood (outer) clipping level (sigmas). docov : bool If True then include covariance matrix in the fitting process. (default=True) cube_index : int For image cubes, slice determines which slice is used. Returns ------- sources : list List of sources measured.", "label": 1, "domain": "code", "token_count": 420, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0669", "text": "constructor: Applies a greyscale alpha map image (or canvas) to the target, such that the alpha channel of the result will be copied from the red channel of the map, and the RGB channels will be copied from the target. Generally, it is recommended that you use {{#crossLink \"AlphaMaskFilter\"}}{{/crossLink}}, because it has much better performance.

    Example

    This example draws a red->blue box, caches it, and then uses the cache canvas as an alpha map on a 100x100 image. var box = new createjs.Shape(); box.graphics.beginLinearGradientFill([\"#ff0000\", \"#0000ff\"], [0, 1], 0, 0, 0, 100) box.graphics.drawRect(0, 0, 100, 100); box.cache(0, 0, 100, 100); var bmp = new createjs.Bitmap(\"path/to/image.jpg\"); bmp.filters = [ new createjs.AlphaMapFilter(box.cacheCanvas) ]; bmp.cache(0, 0, 100, 100); stage.addChild(bmp); See {{#crossLink \"Filter\"}}{{/crossLink}} for more information on applying filters. @class AlphaMapFilter @extends Filter @constructor @param {HTMLImageElement|HTMLCanvasElement} alphaMap The greyscale image (or canvas) to use as the alpha value for the result. This should be exactly the same dimensions as the target.", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0670", "text": "A set of properties that define how a table, such as a CSV file, should be displayed. If not set explicitly, many of these properties will be given default or guessed values elsewhere, such as in CsvCatalogItem. @alias TableStyle @constructor @extends TableColumnStyle @param {Object} [options] The values of the properties of the new instance. Options may include all those options found in TableColumnStyle, plus: @param {String} [options.regionVariable] The name of the variable (column) to be used for region mapping. @param {String} [options.regionType] The identifier of a region type, as used by RegionProviderList. @param {String} [options.dataVariable] The name of the default variable (column) containing data to be used for scaling and coloring. @param {String|Integer|null} [options.timeColumn] The column name or index to use as the time column. Defaults to the first one found. Pass null for none. Pass an array of two, eg. [0, 1], to provide both start and end date columns. @param {String|Integer} [options.xAxis] The column name or index to use as the x-axis, if charted. Defaults to the first one found. @param {Object} [options.columns] Column-specific styling, with the format { columnIdentifier1: tableColumnStyle1, columnIdentifier2: tableColumnStyle2, ... }, where columnIdentifier is either the name or the column index (zero-based).", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0671", "text": "

    Perform am URI path segment escape operation on a char[] input.

    The following are the only allowed chars in an URI path segment (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the char[] to be escaped. @param offset the position in text at which the escape operation should start. @param len the number of characters in text that should be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs", "label": 1, "domain": "code", "token_count": 321, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0672", "text": "Wrapper around the EnergyPlus command line interface. Parameters ---------- idf : str Full or relative path to the IDF file to be run, or an IDF object. weather : str Full or relative path to the weather file. output_directory : str, optional Full or relative path to an output directory (default: 'run_outputs) annual : bool, optional If True then force annual simulation (default: False) design_day : bool, optional Force design-day-only simulation (default: False) idd : str, optional Input data dictionary (default: Energy+.idd in EnergyPlus directory) epmacro : str, optional Run EPMacro prior to simulation (default: False). expandobjects : bool, optional Run ExpandObjects prior to simulation (default: False) readvars : bool, optional Run ReadVarsESO after simulation (default: False) output_prefix : str, optional Prefix for output file names (default: eplus) output_suffix : str, optional Suffix style for output file names (default: L) L: Legacy (e.g., eplustbl.csv) C: Capital (e.g., eplusTable.csv) D: Dash (e.g., eplus-table.csv) version : bool, optional Display version information (default: False) verbose: str Set verbosity of runtime messages (default: v) v: verbose q: quiet ep_version: str EnergyPlus version, used to find install directory. Required if run() is called with an IDF file path rather than an IDF object. Returns ------- str : status Raises ------ CalledProcessError AttributeError If no ep_version parameter is passed when calling with an IDF file path rather than an IDF object.", "label": 1, "domain": "code", "token_count": 336, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0673", "text": "Sets the current reference definition derived from the current member, and optionally some attributes. @param template The template @param attributes The attributes of the tag @exception XDocletException If an error occurs @doc.tag type=\"block\" @doc.param name=\"attributes\" optional=\"true\" description=\"Attributes of the reference as name-value pairs 'name=value', separated by commas\" @doc.param name=\"auto-delete\" optional=\"true\" description=\"Whether to automatically delete the referenced object on object deletion\" @doc.param name=\"auto-retrieve\" optional=\"true\" description=\"Whether to automatically retrieve the referenced object\" @doc.param name=\"auto-update\" optional=\"true\" description=\"Whether to automatically update the referenced object\" @doc.param name=\"class-ref\" optional=\"true\" description=\"The fully qualified name of the class owning the referenced field\" @doc.param name=\"database-foreignkey\" optional=\"true\" description=\"Whether a database foreignkey shall be created\" values=\"true,false\" @doc.param name=\"documentation\" optional=\"true\" description=\"Documentation on the reference\" @doc.param name=\"foreignkey\" optional=\"true\" description=\"The fields in the current type used for implementing the reference\" @doc.param name=\"otm-dependent\" optional=\"true\" description=\"Whether the reference is dependent on otm\" @doc.param name=\"proxy\" optional=\"true\" description=\"Whether to use a proxy for the reference\" @doc.param name=\"proxy-prefetching-limit\" optional=\"true\" description=\"Specifies the amount of objects to prefetch\" @doc.param name=\"refresh\" optional=\"true\" description=\"Whether to automatically refresh the reference\" @doc.param name=\"remote-foreignkey\" optional=\"true\" description=\"The fields in the referenced type corresponding to the local fields (is only used for the table definition)\"", "label": 1, "domain": "code", "token_count": 373, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0674", "text": "This API will induce data loss for the specified partition. It will trigger a call to the OnDataLossAsync API of the partition. This API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss API of the partition. Actual data loss will depend on the specified DataLossMode PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual data loss depends on the presence of in-flight replication. FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered. This API should only be called with a stateful service as the target. Calling this API with a system service as the target is not advised. Note: Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and clean up internal system state. It will not restore data if the command has progressed far enough to cause data loss. Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this API. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the service name is \"fabric:/myapp/app1/svc1\", the service identity would be \"myapp~app1~svc1\" in 6.0+ and \"myapp/app1/svc1\" in previous versions. @param partition_id The identity of the partition. @param operation_id A GUID that identifies a call of this API. This is passed into the corresponding GetProgress API @param data_loss_mode [DataLossMode] This enum is passed to the StartDataLoss API to indicate what type of data loss to induce. Possible values include: 'Invalid', 'PartialDataLoss', 'FullDataLoss' @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 483, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0675", "text": "Compare a semantic version number string to another: 1.2.3-alpha < 1.2.3-alpha.1 < 1.2.3-alpha.beta < 1.2.3-beta < 1.2.3-beta.2 < 1.2.3-beta.11 < 1.2.3-rc.1 < 1.2.3 @function module:undermore.version @see {@link http://semver.org/ Semantic Versioning Standard} @param {string} left The left version @param {string} oper The operator to use for comparison ('==','>=','<=','<','>') @param {string} right The right version @return {bool} whether or not the versions resolved true with the comparitor @example ok(_.version('1.2.3','<','2.0.0'), 'major version is smaller'); ok(_.version('1.1.0','<','1.2.0'), 'minor version is smaller'); ok(!_.version('1.1.0','>','1.2.0'), 'minor version is smaller'); ok(_.version('1.0.10','>=','1.0.2'), 'patch version 10 is greater than or equal to 2'); ok(_.version('1.2.3-alpha','<','1.2.3-alpha.1')); ok(_.version('1.2.3-alpha.1','<','1.2.3-alpha.beta')); ok(_.version('1.2.3-alpha.beta','<','1.2.3-beta')); ok(_.version('1.2.3-beta','<','1.2.3-beta.2')); ok(_.version('1.2.3-beta.2','<','1.2.3-beta.11')); ok(_.version('1.2.3-beta.11','<','1.2.3-rc.1')); ok(_.version('1.2.3-rc.1','<','1.2.3'));", "label": 1, "domain": "code", "token_count": 425, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0676", "text": "function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and interface that the target host is currently connected to. Note: Although intended to return a single location, Multiple locations may be returned for a single host due to a partially discovered network or misconfigured environment. :param ipAddress: str value valid IPv4 IP address :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass :return: list of dictionaries where each element of the list represents the location of the target host :rtype: list >>> from pyhpeimc.auth import * >>> from pyhpeimc.plat.termaccess import * >>> auth = IMCAuth(\"http://\", \"10.101.0.203\", \"8080\", \"admin\", \"admin\") >>> found_device = get_real_time_locate('10.101.0.51', auth.creds, auth.url) >>> assert type(found_device) is list >>> assert 'deviceId' in found_device[0] >>> assert 'deviceId' in found_device[0] >>> assert 'deviceId' in found_device[0] >>> assert 'deviceId' in found_device[0] >>> no_device = get_real_time_locate('192.168.254.254', auth.creds, auth.url) >>> assert type(no_device) is dict >>> assert len(no_device) == 0", "label": 1, "domain": "code", "token_count": 309, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0677", "text": "Optical Character Recognition (OCR) detects text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or InternalServerError. @param detect_orientation [Boolean] Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down). @param url [String] Publicly reachable URL of an image. @param language [OcrLanguages] The BCP-47 language code of the text to be detected in the image. The default value is 'unk'. Possible values include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', 'sr-Cyrl', 'sr-Latn', 'sk' @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 306, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0678", "text": "Format raw usage masks into lists of indices. Usage masks allows the Pgen computation to be conditioned on the V and J gene/allele identities. The inputted masks are lists of strings, or a single string, of the names of the genes or alleles to be conditioned on. The default mask includes all productive V or J genes. Parameters ---------- V_usage_mask_in : str or list An object to indicate which V alleles should be considered. The default input is None which returns the list of all productive V alleles. J_usage_mask_in : str or list An object to indicate which J alleles should be considered. The default input is None which returns the list of all productive J alleles. print_warnings : bool Determines whether warnings are printed or not. Default ON. Returns ------- V_usage_mask : list of integers Indices of the V alleles to be considered in the Pgen computation J_usage_mask : list of integers Indices of the J alleles to be considered in the Pgen computation Examples -------- >>> generation_probability.format_usage_masks('TRBV27*01','TRBJ1-1*01') ([34], [0]) >>> generation_probability.format_usage_masks('TRBV27*01', '') ([34], [0, 1, 2, 3, 4, 7, 8, 9, 10, 11, 12, 13]) >>> generation_probability.format_usage_masks(['TRBV27*01', 'TRBV13*01'], 'TRBJ1-1*01') ([34, 18], [0])", "label": 1, "domain": "code", "token_count": 314, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0679", "text": "Renders the navigation according to the specified options-hash. The following options are supported: * :level - defaults to :all which renders the the sub_navigation for an active primary_navigation inside that active primary_navigation item. Specify a specific level to only render that level of navigation (e.g. level: 1 for primary_navigation, etc). Specifiy a Range of levels to render only those specific levels (e.g. level: 1..2 to render both your first and second levels, maybe you want to render your third level somewhere else on the page) * :expand_all - defaults to false. If set to true the all specified levels will be rendered as a fully expanded tree (always open). This is useful for javascript menus like Superfish. * :context - specifies the context for which you would render the navigation. Defaults to :default which loads the default navigation.rb (i.e. config/navigation.rb). If you specify a context then the plugin tries to load the configuration file for that context, e.g. if you call render_navigation(context: :admin) the file config/admin_navigation.rb will be loaded and used for rendering the navigation. * :items - you can specify the items directly (e.g. if items are dynamically generated from database). See SimpleNavigation::ItemsProvider for documentation on what to provide as items. * :renderer - specify the renderer to be used for rendering the navigation. Either provide the Class or a symbol matching a registered renderer. Defaults to :list (html list renderer). Instead of using the :items option, a block can be passed to specify the items dynamically ==== Examples render_navigation do |menu| menu.item :posts, \"Posts\", posts_path end", "label": 1, "domain": "code", "token_count": 378, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0680", "text": "Expands a URI template into another URI template. @param [Hash] mapping The mapping that corresponds to the pattern. @param [#validate, #transform] processor An optional processor object may be supplied. @param [Boolean] normalize_values Optional flag to enable/disable unicode normalization. Default: true The object should respond to either the validate or transform messages or both. Both the validate and transform methods should take two parameters: name and value. The validate method should return true or false; true if the value of the variable is valid, false otherwise. An InvalidTemplateValueError exception will be raised if the value is invalid. The transform method should return the transformed variable value as a String. If a transform method is used, the value will not be percent encoded automatically. Unicode normalization will be performed both before and after sending the value to the transform method. @return [Addressable::Template] The partially expanded URI template. @example Addressable::Template.new( \"http://example.com/{one}/{two}/\" ).partial_expand({\"one\" => \"1\"}).pattern #=> \"http://example.com/1/{two}/\" Addressable::Template.new( \"http://example.com/{?one,two}/\" ).partial_expand({\"one\" => \"1\"}).pattern #=> \"http://example.com/?one=1{&two}/\" Addressable::Template.new( \"http://example.com/{?one,two,three}/\" ).partial_expand({\"one\" => \"1\", \"three\" => 3}).pattern #=> \"http://example.com/?one=1{&two}&three=3\"", "label": 1, "domain": "code", "token_count": 412, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0681", "text": "Invoke container API on a container deployed on a Service Fabric node. Invoke container API on a container deployed on a Service Fabric node for the given code package. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_manifest_name [String] The name of a service manifest registered as part of an application type in a Service Fabric cluster. @param code_package_name [String] The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. @param code_package_instance_id [String] ID that uniquely identifies a code package instance deployed on a service fabric node. @param container_api_request_body [ContainerApiRequestBody] Parameters for making container API call @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ContainerApiResponse] operation results.", "label": 1, "domain": "code", "token_count": 316, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0682", "text": "Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any. @param filter [String] OData filter. Optional. @param top [Integer] The number of items to return. Optional. @param skip [Integer] The number of items to skip over before returning elements. Optional. @param expand [String] OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories/$expand=Products would expand Product data in line with each Category entry. Optional. @param select [String] OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. @param orderby [String] OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. @param count [Boolean] The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. @param search [String] A free form search. A free-text search expression to match for whether a particular entry should be included in the feed, e.g. Categories?$search=blue OR green. Optional. @param format [String] The desired return format. Return the response in particular formatxii without access to request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 365, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0683", "text": "Processes an anonymous reference definition. @param attributes The attributes of the tag @exception XDocletException If an error occurs @doc.tag type=\"content\" @doc.param name=\"attributes\" optional=\"true\" description=\"Attributes of the reference as name-value pairs 'name=value', separated by commas\" @doc.param name=\"auto-delete\" optional=\"true\" description=\"Whether to automatically delete the referenced object on object deletion\" @doc.param name=\"auto-retrieve\" optional=\"true\" description=\"Whether to automatically retrieve the referenced object\" @doc.param name=\"auto-update\" optional=\"true\" description=\"Whether to automatically update the referenced object\" @doc.param name=\"class-ref\" optional=\"false\" description=\"The fully qualified name of the class owning the referenced field\" @doc.param name=\"documentation\" optional=\"true\" description=\"Documentation on the reference\" @doc.param name=\"foreignkey\" optional=\"true\" description=\"The fields in the current type used for implementing the reference\" @doc.param name=\"otm-dependent\" optional=\"true\" description=\"Whether the reference is dependent on otm\" @doc.param name=\"proxy\" optional=\"true\" description=\"Whether to use a proxy for the reference\" @doc.param name=\"proxy-prefetching-limit\" optional=\"true\" description=\"Specifies the amount of objects to prefetch\" @doc.param name=\"refresh\" optional=\"true\" description=\"Whether to automatically refresh the reference\" @doc.param name=\"remote-foreignkey\" optional=\"true\" description=\"The fields in the referenced type corresponding to the local fields (is only used for the table definition)\"", "label": 1, "domain": "code", "token_count": 328, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0684", "text": "Iterate through opcodes, turning them into a series of insert and delete operations, adjusting indices to account for the size of insertions and deletions. >>> def sequence_opcodes(old, new): return difflib.SequenceMatcher(a=old, b=new).get_opcodes() >>> list(adjusted_ops(sequence_opcodes('abc', 'b'))) [('delete', 0, 1, 0, 0), ('delete', 1, 2, 1, 1)] >>> list(adjusted_ops(sequence_opcodes('b', 'abc'))) [('insert', 0, 0, 0, 1), ('insert', 2, 2, 2, 3)] >>> list(adjusted_ops(sequence_opcodes('axxa', 'aya'))) [('delete', 1, 3, 1, 1), ('insert', 1, 1, 1, 2)] >>> list(adjusted_ops(sequence_opcodes('axa', 'aya'))) [('delete', 1, 2, 1, 1), ('insert', 1, 1, 1, 2)] >>> list(adjusted_ops(sequence_opcodes('ab', 'bc'))) [('delete', 0, 1, 0, 0), ('insert', 1, 1, 1, 2)] >>> list(adjusted_ops(sequence_opcodes('bc', 'ab'))) [('insert', 0, 0, 0, 1), ('delete', 2, 3, 2, 2)]", "label": 1, "domain": "code", "token_count": 323, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0685", "text": "Returns a Collection of CRLs that match the specified selector. If no CRLs match the selector, an empty Collection will be returned.

    For some CertStore types, the resulting Collection may not contain all of the CRLs that match the selector. For instance, an LDAP CertStore may not search all entries in the directory. Instead, it may just search entries that are likely to contain the CRLs it is looking for.

    Some CertStore implementations (especially LDAP CertStores) may throw a CertStoreException unless a non-null CRLSelector is provided that includes specific criteria that can be used to find the CRLs. Issuer names and/or the certificate to be checked are especially useful. @param selector A CRLSelector used to select which CRLs should be returned. Specify null to return all CRLs (if supported). @return A Collection of CRLs that match the specified selector (never null) @throws java.security.cert.CertStoreException if an exception occurs", "label": 1, "domain": "code", "token_count": 316, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0686", "text": "

    Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) escape operation on a String input meant to be an XML attribute value, writing results to a Writer.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml11(String, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 493, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0687", "text": "This function converts the argument data into a set of hex bytes and then searches the current file for all occurrences of those bytes. data may be any of the basic types or an array of one of the types. If data is an array of signed bytes, it is assumed to be a null-terminated string. To search for an array of hex bytes, create an unsigned char array and fill it with the target value. If the type being search for is a string, the matchcase and wholeworld arguments can be used to control the search (see Using Find for more information). method controls which search method is used from the following options: FINDMETHOD_NORMAL=0 - a normal search FINDMETHOD_WILDCARDS=1 - when searching for strings use wildcards '*' or '?' FINDMETHOD_REGEX=2 - when searching for strings use Regular Expressions wildcardMatchLength indicates the maximum number of characters a '*' can match when searching using wildcards. If the target is a float or double, the tolerance argument indicates that values that are only off by the tolerance value still match. If dir is 1 the find direction is down and if dir is 0 the find direction is up. start and size can be used to limit the area of the file that is searched. start is the starting byte address in the file where the search will begin and size is the number of bytes after start that will be searched. If size is zero, the file will be searched from start to the end of the file. The return value is a TFindResults structure. This structure contains a count variable indicating the number of matches, and a start array holding an array of starting positions, plus a size array which holds an array of target lengths. For example, use the following code to find all occurrences of the ASCII string \"Test\" in a file:", "label": 1, "domain": "code", "token_count": 368, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0688", "text": "Convert a string or html file to an rst table string. Parameters ---------- html_string : str Either the html string, or the filepath to the html force_headers : bool Make the first row become headers, whether or not they are headers in the html file. center_cells : bool Whether or not to center the contents of the cells center_headers : bool Whether or not to center the contents of the header cells Returns ------- str The html table converted to an rst grid table Notes ----- This function **requires** BeautifulSoup_ to work. Example ------- >>> html_text = ''' ... ... ... ... ... ... ... ... ... ... ...
    ... Header 1 ... ... Header 2 ... ... Header 3 ...
    ...

    This is a paragraph

    ...
    ...
      ...
    • List item 1
    • ...
    • List item 2
    • ...
    ...
    ...
      ...
    1. Ordered 1
    2. ...
    3. Ordered 2
    4. ...
    ...
    ... ''' >>> import dashtable >>> print(dashtable.html2rst(html_text)) +---------------------+----------------+--------------+ | Header 1 | Header 2 | Header 3 | +=====================+================+==============+ | This is a paragraph | - List item 1 | #. Ordered 1 | | | - List item 2 | #. Ordered 2 | +---------------------+----------------+--------------+ .. _BeautifulSoup: https://www.crummy.com/software/BeautifulSoup/", "label": 1, "domain": "code", "token_count": 359, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0689", "text": "Recursively walk a tree evaluating all functions as promises and inserting their values @param {array|Object} tree The tree structure to resolve @param {Object} [options] Options object passed to parents() finder @param {boolean} [options.clone=false] Clone the tree before resolving it, this keeps the original intact but costs some time while cloning, without this the input will be mutated @param {array|string} [options.childNode=\"children\"] Node or nodes to examine to discover the child elements @param {boolean} [options.attempts=5] How many times to recurse when resolving promises-within-promises @param {function} [options.isPromise=_.isFunction] Function used to recognise a promise-like return when recursing into promises @param {boolean} [options.splice=true] Support splicing arrays (arrays are collapsed into their parents rather than returned as is) @param {function} [options.isSplice] Function used to determine if a node should be spliced. Called as (node, path, tree). Default bechaviour is to return true if both the node and the parents are arrays - i.e. only support array -> object -> array striping not array -> array @param {function} [options.wrapper=Promise.resolve] Wrap the promise in this function before resolving. Called as (nodeFunction, path, tree). Should return a promise or something that has 'that' compatibility @return {Promise} A promise which will resolve with incomming tree object with all promises resolved", "label": 1, "domain": "code", "token_count": 307, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0690", "text": "/* function createNetworkUser(options, done) { if (options.anonymizedData) { var token = utils.readToken(); if (!token) registerOrLogin(options, done, function(token) { initApp(options.name, token, done); }); else { initApp(options.name, token, done); } } } /* function initApp(name, token, done) { utils.loadPackageJson('./' + name + '/package.json', function(err, pck) { if (err || !pck) return console.log('You must be in a package root'); var body = { name: name, description: pck.description, version: pck.version, keywords: pck.keywords }; var options = { uri: napi + '/app/init', method: 'POST', form: querystring.stringify(body), headers: { 'Content-Type': 'multipart/form-data', 'Content-Length': querystring.stringify(body).length, 'authorization': token } }; var path = process.cwd() + '/' + name + '/mean.json'; request(options, function(error, response, body) { if (!error && (response.statusCode === 200 || response.statusCode === 201)) { var data = JSON.parse(body); utils.updateMeanJson(path, { id: data._id, name: data.name }, function(err) { if (err) console.log('Your app did not save to network :('); done(); }); } else { console.log('Your app did not save to network :('); done(); } }); }); }", "label": 1, "domain": "code", "token_count": 311, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0691", "text": "set KISSY configuration @param {Object|String} configName Config object or config key. @param {String} configName.base KISSY 's base path. Default: get from loader(-min).js or seed(-min).js @param {String} configName.tag KISSY 's timestamp for native module. Default: KISSY 's build time. @param {Boolean} configName.debug whether to enable debug mod. @param {Boolean} configName.combine whether to enable combo. @param {Object} configName.logger logger config @param {Object[]} configName.logger.excludes exclude configs @param {Object} configName.logger.excludes.0 a single exclude config @param {RegExp} configName.logger.excludes.0.logger matched logger will be excluded from logging @param {String} configName.logger.excludes.0.minLevel minimum logger level (enum of debug info warn error) @param {String} configName.logger.excludes.0.maxLevel maximum logger level (enum of debug info warn error) @param {Object[]} configName.logger.includes include configs @param {Object} configName.logger.includes.0 a single include config @param {RegExp} configName.logger.includes.0.logger matched logger will be included from logging @param {String} configName.logger.excludes.0.minLevel minimum logger level (enum of debug info warn error) @param {String} configName.logger.excludes.0.maxLevel maximum logger level (enum of debug info warn error) @param {Object} configName.packages Packages definition with package name as the key. @param {String} configName.packages.base Package base path. @param {String} configName.packages.tag Timestamp for this package's module file. @param {String} configName.packages.debug Whether force debug mode for current package. @param {String} configName.packages.combine Whether allow combine for current package modules. @param {String} [configName.packages.ignorePackageNameInUri=false] whether remove packageName from module request uri, can only be used in production mode. @param [configValue] config value. for example: @example KISSY.config({ combine: true, base: '', packages: { 'gallery': { base: 'http://a.tbcdn.cn/s/kissy/gallery/' } }, modules: { 'gallery/x/y': { requires: ['gallery/x/z'] } } });", "label": 1, "domain": "code", "token_count": 495, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0692", "text": "Function path: Page.setDeviceMetricsOverride Domain: Page Method name: setDeviceMetricsOverride WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'width' (type: integer) -> Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override. 'height' (type: integer) -> Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override. 'deviceScaleFactor' (type: number) -> Overriding device scale factor value. 0 disables the override. 'mobile' (type: boolean) -> Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more. Optional arguments: 'scale' (type: number) -> Scale to apply to resulting view image. 'screenWidth' (type: integer) -> Overriding screen width value in pixels (minimum 0, maximum 10000000). 'screenHeight' (type: integer) -> Overriding screen height value in pixels (minimum 0, maximum 10000000). 'positionX' (type: integer) -> Overriding view X position on screen in pixels (minimum 0, maximum 10000000). 'positionY' (type: integer) -> Overriding view Y position on screen in pixels (minimum 0, maximum 10000000). 'dontSetVisibleSize' (type: boolean) -> Do not set visible view size, rely upon explicit setVisibleSize call. 'screenOrientation' (type: Emulation.ScreenOrientation) -> Screen orientation override. No return value. Description: Overrides the values of device screen dimensions (window.screen.width, window.screen.height, window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media query results).", "label": 1, "domain": "code", "token_count": 374, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0693", "text": "Create an {@link IBeacon} instance.

    The format of {@code data} should be as described in the following table.

    Value Description
    Company ID 0x4C 0x00 The company ID assigned to Apple, Inc. (Little Endian)
    Format ID 0x02 0x15 The format ID which represents iBeacon
    Proximity UUID 16-byte data Proximity UUID
    Major number 2-byte data Major number (Big Endian)
    Minor number 2-byte data Minor number (Big Endian)
    Power 1-byte data The 2's complement of the calibrated Tx Power
    @param length The length of the AD structure. @param type The AD type. The value should always be 0xFF which represents Manufacturer Specific Data. @param data The AD type. The value of the first two bytes is the company ID. @param companyId The company ID. The value should always be 0x004C which represents Apple, Inc. @return An {@link IBeacon} instance. {@code null} is returned if the length of {@code data} is less than 25.", "label": 1, "domain": "code", "token_count": 440, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0694", "text": "

    Perform an XML 1.0 level 2 (markup-significant and all non-ASCII chars) escape operation on a Reader input meant to be an XML attribute value, writing results to a Writer.

    Level 2 means this method will escape:

    • The five markup-significant characters: <, >, &, " and '
    • All non ASCII characters.

    This escape will be performed by replacing those chars by the corresponding XML Character Entity References (e.g. '&lt;') when such CER exists for the replaced character, and replacing by a hexadecimal character reference (e.g. '&#x2430;') when there there is no CER for the replaced character.

    Besides, being an attribute value also \t, \n and \r will be escaped to avoid white-space normalization from removing line feeds (turning them into white spaces) during future parsing operations.

    This method calls {@link #escapeXml10(Reader, Writer, XmlEscapeType, XmlEscapeLevel)} with the following preconfigured values:

    • type: {@link org.unbescape.xml.XmlEscapeType#CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA}
    • level: {@link org.unbescape.xml.XmlEscapeLevel#LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT}

    This method is thread-safe.

    @param reader the Reader reading the text to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @throws IOException if an input/output exception occurs @since 1.1.5", "label": 1, "domain": "code", "token_count": 497, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0695", "text": "Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. Gets the list containing the information about service types from the applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration status, the code package that registered it and activation ID of the service package. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the \"~\" character. For example, if the application name is \"fabric:/myapp/app1\", the application identity would be \"myapp~app1\" in 6.0+ and \"myapp/app1\" in previous versions. @param service_manifest_name [String] The name of the service manifest to filter the list of deployed service type information. If specified, the response will only contain the information about service types that are defined in this service manifest. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.", "label": 1, "domain": "code", "token_count": 310, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0696", "text": "/*[deutsch]

    Konstruiert eine Metrik für beliebige Standard-Zeiteinheiten in normalisierter Form.

    Wichtig: Fehlt die der Präzision der zu vergleichenden Zeitpunkte entsprechende kleinste Zeiteinheit, wird im allgemeinen ein Subtraktionsrest übrigbleiben. Das Ergebnis der Metrikberechnung wird dann nicht den vollständigen zeitlichen Abstand zwischen den Zeitpunkten ausdrücken. Für die Vollständigkeit der Berechnung ist bei Datumsangaben mindestens die explizite Angabe der Tageseinheit notwendig.

    Beispiel mit verschiedenen Einheitstypen: Wenn diese Methode mit verschiedenen Zeiteinheitstypen aufgerufen wird, dann wird dringend empfohlen, zuerst die Einheiten statischen Konstanten vom Typ {@code IsoUnit} zuzuweisen, um Compiler-Probleme mit Generics zu vermeiden. Diese Praxis hilft auch, die Lesbarkeit des Code zu verbessern.

     private static final IsoUnit DAYS = CalendarUnit.DAYS; private static final IsoUnit HOURS = ClockUnit.HOURS; private static final IsoUnit MINUTES = ClockUnit.MINUTES; PlainTimestamp start = PlainTimestamp.of(2014, 3, 28, 0, 30); PlainTimestamp end = PlainTimestamp.of(2014, 4, 5, 14, 15); Duration<IsoUnit> duration = Duration.in(DAYS, HOURS, MINUTES).between(start, end); System.out.println(duration); // output: P8DT13H45M 
    @param generic unit type @param units time units to be used in calculation @return immutable metric for calculating a duration in given units @throws IllegalArgumentException if no time unit is given or if there are unit duplicates", "label": 1, "domain": "code", "token_count": 443, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0697", "text": "

    Perform am URI fragment identifier escape operation on a String input, writing results to a Writer.

    The following are the only allowed chars in an URI fragment identifier (will not be escaped):

    • A-Z a-z 0-9
    • - . _ ~
    • ! $ & ' ( ) * + , ; =
    • : @
    • / ?

    All other chars will be escaped by converting them to the sequence of bytes that represents them in the specified encoding and then representing each byte in %HH syntax, being HH the hexadecimal representation of the byte.

    This method is thread-safe.

    @param text the String to be escaped. @param writer the java.io.Writer to which the escaped result will be written. Nothing will be written at all to this writer if input is null. @param encoding the encoding to be used for escaping. @throws IOException if an input/output exception occurs @since 1.1.2", "label": 1, "domain": "code", "token_count": 308, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0698", "text": "constructor: Display one or more lines of dynamic text (not user editable) in the display list. Line wrapping support (using the lineWidth) is very basic, wrapping on spaces and tabs only. Note that as an alternative to Text, you can position HTML text above or below the canvas relative to items in the display list using the {{#crossLink \"DisplayObject/localToGlobal\"}}{{/crossLink}} method, or using {{#crossLink \"DOMElement\"}}{{/crossLink}}. Please note that Text does not support HTML text, and can only display one font style at a time. To use multiple font styles, you will need to create multiple text instances, and position them manually.

    Example

    var text = new createjs.Text(\"Hello World\", \"20px Arial\", \"#ff7700\"); text.x = 100; text.textBaseline = \"alphabetic\"; CreateJS Text supports web fonts (the same rules as Canvas). The font must be loaded and supported by the browser before it can be displayed. Note: Text can be expensive to generate, so cache instances where possible. Be aware that not all browsers will render Text exactly the same. @class Text @extends DisplayObject @constructor @param {String} [text] The text to display. @param {String} [font] The font style to use. Any valid value for the CSS font attribute is acceptable (ex. \"bold 36px Arial\"). @param {String} [color] The color to draw the text in. Any valid value for the CSS color attribute is acceptable (ex. \"#F00\", \"red\", or \"#FF0000\").", "label": 1, "domain": "code", "token_count": 348, "matched_pair_id": null, "split": "train"} +{"id": "code_docs_train_pos_0699", "text": "Lists report records by Time. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param filter [String] | Field | Usage | Supported operators | Supported functions |
    |-------------|-------------|-------------|-------------|
    | timestamp | filter, select | ge, le | |
    | interval | select | | |
    | apiRegion | filter | eq | |
    | userId | filter | eq | |
    | productId | filter | eq | |
    | subscriptionId | filter | eq | |
    | apiId | filter | eq | |
    | operationId | filter | eq | |
    | callCountSuccess | select | | |
    | callCountBlocked | select | | |
    | callCountFailed | select | | |
    | callCountOther | select | | |
    | bandwidth | select, orderBy | | |
    | cacheHitsCount | select | | |
    | cacheMissCount | select | | |
    | apiTimeAvg | select | | |
    | apiTimeMin | select | | |
    | apiTimeMax | select | | |
    | serviceTimeAvg | select | | |
    | serviceTimeMin | select | | |
    | serviceTimeMax | select | | |
    @param interval [Duration] By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param orderby [String] OData order by query option. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.", "label": 1, "domain": "code", "token_count": 446, "matched_pair_id": null, "split": "train"}