patch stringlengths 18 160k | callgraph stringlengths 4 179k | summary stringlengths 4 947 | msg stringlengths 6 3.42k |
|---|---|---|---|
@@ -58,11 +58,10 @@ def get_checkout_from_request(request, checkout_queryset=Checkout.objects.all())
token = request.get_signed_cookie(COOKIE_NAME, default=None)
checkout = get_anonymous_checkout_from_token(token, checkout_queryset)
user = None
- if checkout is not None:
- return checkout
- if user:
- return Checkout(user=user)
- return Checkout()
+ if checkout is None:
+ checkout = Checkout(user=user)
+ checkout.set_country(request.country)
+ return checkout
def get_user_checkout(
| [change_shipping_address_in_checkout->[_check_new_checkout_address],is_valid_shipping_method->[get_valid_shipping_methods_for_checkout],clean_checkout->[is_valid_shipping_method,is_fully_paid],get_shipping_price_estimate->[get_valid_shipping_methods_for_checkout],add_voucher_to_checkout->[get_voucher_discount_for_checkout],add_variant_to_checkout->[update_checkout_quantity,check_variant_in_stock],prepare_order_data->[create_line_for_order,validate_gift_cards,_process_user_data_for_order,_process_shipping_data_for_order,_get_voucher_data_for_order],get_voucher_discount_for_checkout->[_get_products_voucher_discount,_get_shipping_voucher_discount_for_checkout],_get_voucher_data_for_order->[get_voucher_for_checkout],recalculate_checkout_discount->[get_voucher_for_checkout,get_voucher_discount_for_checkout],remove_voucher_code_from_checkout->[get_voucher_for_checkout],change_billing_address_in_checkout->[_check_new_checkout_address]] | Get a checkout from database or return a new instance based on cookie. | No need to do that. You can simply do `Checkout(user=user)`. It works for both cases (user==None and user!=None) |
@@ -398,6 +398,10 @@ export class BaseElement {
/**
* Subclasses can override this method to opt-in into being called to
* prerender when document itself is not yet visible (pre-render mode).
+ *
+ * The return value of this function is used to determine whether or not the
+ * element will be built during prerender mode. Therefore, any changes to
+ * the return value _after_ buildCallback() will have no affect.
* @return {boolean}
*/
prerenderAllowed() {
| [No CFG could be retrieved] | Updates the priority of the given task. Returns the layout width of the . A null value indicates that the element is not. | if we wanna keep this model, we should do a quick scan of cases that might be impacted by this new behaviour. For instance `noprerender` attribute of `amp-img` is likely broken as well. Some components like `amp-layout` expected their `buildCallback` to be called without overriding `prerenderAllowed` but now we would need to add `prerenderAllowed` to them. |
@@ -104,7 +104,12 @@ __attribute__((weak)) void matrix_init(void) {
matrix[i] = 0;
}
- debounce_init(MATRIX_ROWS);
+#ifdef SPLIT_KEYBOARD
+ thisHand = isLeftHand ? 0 : (ROWS_PER_HAND);
+ thatHand = ROWS_PER_HAND - thisHand;
+#endif
+
+ debounce_init(ROWS_PER_HAND);
matrix_init_quantum();
}
| [matrix_print->[print,print_matrix_header,print_matrix_row,print_hex8],matrix_key_count->[matrix_bitpop],matrix_is_modified->[debounce_active],uint8_t->[matrix_scan_quantum,debounce,matrix_scan_custom],void->[matrix_init_user,waitInputPinDelay,matrix_scan_user,debounce_init,matrix_init_custom,matrix_io_delay,wait_us,matrix_init_quantum]] | private void matrix_init. | I don't love doing this with an #ifdef, but IMO doing something like setting `thisHand` to 0 and passing that for a non-split seems like it would be confusing. |
@@ -896,10 +896,10 @@ define([
++tileCommandIndex;
var command = tileCommands[tileCommandIndex];
if (!defined(command)) {
- command = new DrawCommand();
- command.owner = tile;
- command.cull = false;
- command.boundingVolume = new BoundingSphere();
+ command = new DrawCommand({
+ cull : false,
+ boundingVolume : new BoundingSphere()
+ });
tileCommands[tileCommandIndex] = command;
tileCommandUniformMaps[tileCommandIndex] = createTileUniformMap(globeUniformMap);
}
| [No CFG could be retrieved] | region DrawCommand Operations Computes the modified model view and applies the necessary features to the modified model view. | `owner` got dropped from the constructor args. |
@@ -27,11 +27,10 @@ $target_link = elgg_view('output/url', array(
$type = $target->getType();
$subtype = $target->getSubtype() ? $target->getSubtype() : 'default';
$key = "river:comment:$type:$subtype";
-$summary = elgg_echo($key, array($subject_link, $target_link));
-if ($summary == $key) {
+if (!elgg_language_key_exists($key)) {
$key = "river:comment:$type:default";
- $summary = elgg_echo($key, array($subject_link, $target_link));
}
+$summary = elgg_echo($key, array($subject_link, $target_link));
echo elgg_view('river/elements/layout', array(
'item' => $vars['item'],
| [getURL,getObjectEntity,getType,getTargetEntity,getDisplayName,getSubtype,getSubjectEntity] | Renders a comment element. | What if current language isn't "en"? (hence #9472) |
@@ -528,6 +528,7 @@ class MessageBuilder:
arg_type_str = '*' + arg_type_str
elif arg_kind == ARG_STAR2:
arg_type_str = '**' + arg_type_str
+ notes.append("Use TypedDict or Dict[str, Any] for unpacked **kwargs")
# For function calls with keyword arguments, display the argument name rather than the
# number.
| [format_type_bare->[format_type_inner,find_type_overlaps],for_function->[callable_name,format],pretty_callable->[format_type_bare,format],format_key_list->[format],find_type_overlaps->[format,collect_all_instances],append_invariance_notes->[format],make_inferred_type_note->[format],format_type->[quote_type_string],callable_name->[format],pretty_seq->[format],temp_message_builder->[MessageBuilder],format_type_distinctly->[quote_type_string,format_type_inner,find_type_overlaps],format_type_inner->[format->[format_type_inner],format],MessageBuilder->[redundant_expr->[fail],undefined_in_superclass->[fail],report_non_method_protocol->[note,fail],redundant_cast->[fail],report_protocol_problems->[note],untyped_function_call->[fail],overload_signature_incompatible_with_supertype->[note,fail],note_call->[note],incorrect__exit__return->[note,fail],bad_proto_variance->[fail],does_not_return_value->[fail],missing_named_argument->[fail],unimported_type_becomes_any->[fail],deleted_as_rvalue->[fail],note->[report],unsupported_placeholder->[fail],typeddict_key_must_be_string_literal->[fail],overloaded_signatures_arg_specific->[fail],overloaded_signatures_overlap->[fail],unsupported_left_operand->[fail],note_multiline->[report],string_interpolation_mixing_key_and_non_keys->[fail],incompatible_self_argument->[fail],invalid_signature->[fail],dangerous_comparison->[fail],copy->[copy,MessageBuilder],untyped_decorated_function->[fail],incompatible_conditional_function_def->[fail],protocol_members_cant_be_final->[fail],no_variant_matches_arguments->[fail],could_not_infer_type_arguments->[fail],typed_function_untyped_decorator->[fail],cant_assign_to_method->[fail],read_only_property->[fail],too_few_string_formatting_arguments->[fail],type_not_iterable->[fail],wrong_number_values_to_unpack->[fail],overloaded_signatures_ret_specific->[fail],warn_both_operands_are_from_unions->[note],too_many_arguments_from_typed_dict->[too_many_arguments,fail],overload_inconsistently_applies_decorator->[fail],report->[report],clean_copy->[copy,MessageBuilder],typeddict_context_ambiguous->[fail],base_class_definitions_incompatible->[fail],cannot_determine_type->[fail],type_arguments_not_allowed->[fail],argument_incompatible_with_supertype->[note,fail,note_multiline],print_more->[note],cannot_instantiate_abstract_class->[fail],return_type_incompatible_with_supertype->[fail],final_without_value->[fail],cant_override_final->[fail],too_many_arguments->[fail],requires_int_or_char->[fail],cannot_determine_type_in_base->[fail],too_few_arguments->[fail],invalid_keyword_var_arg->[fail],no_formal_self->[fail],invalid_index_type->[fail],incompatible_type_application->[fail],overloaded_signature_will_never_match->[fail],concrete_only_assign->[fail],too_many_positional_arguments->[fail],invalid_var_arg->[fail],generate_incompatible_tuple_error->[note,fail],operator_method_signatures_overlap->[fail],signatures_incompatible->[fail],signature_incompatible_with_supertype->[fail],explicit_any->[fail],incompatible_operator_assignment->[fail],add_fixture_note->[note],deleted_as_lvalue->[fail],cant_assign_to_classvar->[fail],typeddict_key_not_found->[note,fail],duplicate_argument_value->[fail],redundant_right_operand->[fail],final_cant_override_writable->[fail],forward_operator_not_callable->[fail],first_argument_for_super_must_be_type->[fail],unexpected_keyword_argument->[note,fail],reveal_locals->[note],disallowed_any_type->[fail],incorrectly_returning_any->[fail],unreachable_statement->[fail],warn_operand_was_from_union->[note],yield_from_invalid_operand_type->[fail],key_not_in_mapping->[fail],need_annotation_for_var->[fail],has_no_attr->[fail],concrete_only_call->[fail],string_interpolation_with_star_and_key->[fail],unsupported_type_type->[fail],reveal_type->[note],not_callable->[fail],incompatible_argument->[note,unsupported_operand_types,fail],incompatible_typevar_value->[fail],cant_assign_to_final->[fail],cannot_use_function_with_type->[fail],typeddict_key_cannot_be_deleted->[fail],fail->[report],too_many_string_formatting_arguments->[fail],pretty_overload_matches->[note],is_errors->[is_errors],unsupported_operand_types->[fail],pretty_overload->[note],overloaded_signatures_typevar_specific->[fail],unexpected_typeddict_keys->[fail],try_report_long_tuple_assignment_error->[fail],unpacking_strings_disallowed->[fail],typeddict_setdefault_arguments_inconsistent->[fail],impossible_intersection->[fail],invalid_signature_for_special_method->[fail]]] | Report an error about an incompatible argument type. Generates code for the missing missing node. Returns a DNA - style message that reports the key value and key types that are distinct Generates code for missing missing ckey. | Hey! You will also have to modify the tests affected by this change :) Cheers! |
@@ -95,10 +95,9 @@ func VerifyAndEditValidatorFromMsg(
return nil, errCommissionRateChangeTooHigh
}
- // TODO: make sure we are reading from the correct snapshot
snapshotValidator, err := chainContext.ReadValidatorSnapshot(wrapper.Address)
if err != nil {
- return nil, err
+ return nil, errors.WithMessage(err, "Validator snapshot not found.")
}
rateAtBeginningOfEpoch := snapshotValidator.Validator.Rate
| [CreateValidatorFromNewMsg,UpdateValidatorFromEditMsg,ValidatorWrapper,Set,Add,GetBalance,Cmp,New,IsNil,Bytes,Sub,Sign,Wrapf,Equal,ReadValidatorSnapshot,Int64,NewDelegation,GT,IsValidator,MustAddressToBech32,SetUint64,Undelegate,NewInt,String,Abs,TotalInUndelegation,SanityCheck] | VerifyAndEditValidatorFromMsg verifies the given message is a valid and returns a VerifyAndDelegateFromMsg verifies that the passed in message is a valid in the. | so we don't need to ensure its at right snapshot epoch? |
@@ -110,12 +110,18 @@ export class PinWidget {
'data-pin-log': 'embed_pin',
}});
+ // If no alternate text is set, set it to the title gotten from the pin data
+ if (!this.alt && pin['attribution']) {
+ this.alt = pin['attribution']['title'];
+ }
+
const img = Util.make(this.element.ownerDocument, {'img': {
'src': imgUrl,
'className': '-amp-pinterest-embed-pin-image',
'data-pin-no-hover': true,
'data-pin-href': 'https://www.pinterest.com/pin/' + pin['id'] + '/',
'data-pin-log': 'embed_pin_img',
+ 'alt': this.alt,
}});
container.appendChild(img);
| [No CFG could be retrieved] | Renders an embedded pinterest link with a link to the given pin. Embeds a single pinterest pin in the repin element. | to fix the type check errors, `this.alt = '';` should be added to the constructor of `PinWidget` |
@@ -53,7 +53,9 @@ def get_customer_data(payment_information: PaymentData) -> Dict:
"locality": billing.city,
"region": billing.country_area,
"country_code_alpha2": billing.country,
- },
+ }
+ if billing
+ else {},
"risk_data": {"customer_ip": payment_information.customer_ip_address or ""},
"customer": {"email": payment_information.customer_email},
}
| [list_client_sources->[get_braintree_gateway],get_client_token->[get_braintree_gateway],capture->[extract_gateway_response,get_error_for_client,get_braintree_gateway],void->[void,extract_gateway_response,get_error_for_client,get_braintree_gateway],refund->[refund,extract_gateway_response,get_error_for_client,get_braintree_gateway],authorize->[extract_gateway_response,get_error_for_client],transaction_for_new_customer->[get_customer_data,get_braintree_gateway],process_payment->[authorize],transaction_for_existing_customer->[get_customer_data,get_braintree_gateway]] | Provide customer info use only for new customer creation. | Lets create a billing structure in separate function or create billing before `return` section |
@@ -200,7 +200,7 @@ public class PhysicalPlanBuilder {
schemaBuilder.field(fields.get(i).name(), fields.get(i).schema());
}
int aggFunctionVarSuffix = 0;
- for (int i = aggregateNode.getRequiredColumnList().size(); i < fields.size(); i++) {
+ for (int i = 0; i < aggregateNode.getFunctionList().size(); i++) {
Schema fieldSchema;
String udafName = aggregateNode.getFunctionList().get(aggFunctionVarSuffix).getName()
.getSuffix();
| [PhysicalPlanBuilder->[buildOutput->[kafkaStreamsDSL],buildJoin->[kafkaStreamsDSL],getResultTopicSerde->[getResultTopicSerde],buildAggregate->[kafkaStreamsDSL]]] | Build the aggregate. This method is called to aggregate the data in the aggregated stream. This method is called to build the aggregated schema. | It looks like `i` and `aggFunctionVarSuffix` have identical values through the body of this loop; if so, they should probably just be consolidated into a single variable. |
@@ -23,7 +23,8 @@ module Acuant
end
def new_assure_id
- (Rails.env.test? ? Idv::Acuant::FakeAssureId : Idv::Acuant::AssureId).new
+ (Figaro.env.acuant_simulator == 'true' ? Idv::Acuant::FakeAssureId : Idv::Acuant::AssureId).
+ new
end
end
end
| [AcuantBase->[new_assure_id->[new],wrap_network_errors->[parse_if_json],parse_if_json->[parse],initialize->[instance_id]]] | Returns a new assume id that is not unique within the current context. | Don't check for test? check to see if simulator is on. |
@@ -64,12 +64,16 @@ class TextField(SequenceField[Dict[str, torch.Tensor]]):
def index(self, vocab: Vocabulary):
token_arrays: Dict[str, TokenList] = {}
indexer_name_to_indexed_token: Dict[str, List[str]] = {}
+ token_index_to_indexer_name: Dict[str, str] = {}
for indexer_name, indexer in self._token_indexers.items():
token_indices = indexer.tokens_to_indices(self.tokens, vocab, indexer_name)
token_arrays.update(token_indices)
indexer_name_to_indexed_token[indexer_name] = list(token_indices.keys())
+ for token_index in token_indices.keys():
+ token_index_to_indexer_name[token_index] = indexer_name
self._indexed_tokens = token_arrays
self._indexer_name_to_indexed_token = indexer_name_to_indexed_token
+ self._token_index_to_indexer_name = token_index_to_indexer_name
@overrides
def get_padding_lengths(self) -> Dict[str, int]:
| [TextField->[__str__->[sequence_length],count_vocab_items->[count_vocab_items],get_padding_lengths->[get_padding_lengths],empty_field->[TextField]]] | Index the field in the specified vocabulary. Get all keys which have been used for padding for each indexer and take the max if there. | There's a pylint warning for this line. |
@@ -27,7 +27,13 @@ class BagVariant(ProductVariant, StockedProduct):
class Meta:
app_label = 'product'
+ def __str__(self):
+ return '{}r {} (color {})'.format(self.product,
+ self.name,
+ self.product.color.name)
+
+@python_2_unicode_compatible
class ShirtVariant(ProductVariant, StockedProduct):
SIZE_CHOICES = (
| [ShirtVariant->[ForeignKey,pgettext_lazy,CharField],BagVariant->[ForeignKey]] | Create a base class for all product - specific variants. | Any benefit from using different string interpolation here? |
@@ -122,6 +122,7 @@ func replaceVersion(pattern, version string) string {
}
func defaultConfig(beatVersion string) *Config {
+ metricsEnabled := true
return &Config{
Host: net.JoinHostPort("localhost", defaultPort),
MaxUnzippedSize: 30 * 1024 * 1024, // 30mb
| [setElasticsearch->[isEnabled],memoizedSmapMapper->[isEnabled,NewSmapMapper,isSetup],MustCompile,ReplaceAllLiteralString,JoinHostPort] | memoizedSmapMapper returns a memoized SmapMapper. Config for the n - node - middleware. | I'd expect an experimental endpoint to be disabled by default. |
@@ -57,6 +57,18 @@ if TYPE_CHECKING:
PremiumPageBlobTier)
+def _get_blob_name(blob):
+ """Return the blob name.
+
+ :param blob: A blob string or BlobProperties
+ :rtype: str
+ """
+ try:
+ return blob.name
+ except AttributeError:
+ return blob
+
+
class ContainerClient(StorageAccountHostsMixin):
"""A client to interact with a specific container, although that container
may not yet exist.
| [ContainerClient->[delete_blobs->[_generate_delete_blobs_options],upload_blob->[upload_blob],delete_blob->[delete_blob],set_standard_blob_tier_blobs->[_generate_set_tier_options],set_premium_page_blob_tier_blobs->[_generate_set_tier_options]]] | A container client that interacts with a specific container. Create a container client from a service. | should we rename this to make it generic to accept container too... |
@@ -843,7 +843,13 @@ public class Executor extends Thread implements ModelObject {
lock.writeLock().lock(); // need write lock as interrupt will change the field
try {
if (executable != null) {
- Tasks.getOwnerTaskOf(getParentOf(executable)).checkAbortPermission();
+ final SubTask parentOf;
+ try {
+ parentOf = getParentOfOrFail(executable);
+ } catch(InvocationTargetException ex) {
+ return HttpResponses.error(500, ex);
+ }
+ Tasks.getOwnerTaskOf(parentOf).checkAbortPermission();
interrupt();
}
} finally {
| [Executor->[completedAsynchronous->[finish2,finish1],getEstimatedRemainingTimeMillis->[getElapsedTime],interruptForShutdown->[interrupt],doStop->[interrupt],of->[getCurrentExecutable],getEstimatedDurationFor->[getEstimatedDurationFor],getTimestampString->[getElapsedTime],run->[call->[resetWorkUnit],resetWorkUnit],start->[start],interrupt->[interrupt],getIdleStartMilliseconds->[isIdle],getEstimatedRemainingTime->[getElapsedTime],isDisplayCell->[getAsynchronousExecution]]] | This method is called when the client is stopped. | Suffices to just throw this exception (or a wrapper) out of the method. |
@@ -251,6 +251,7 @@ tensor_method_func = [ #noqa
'round_',
'rsqrt',
'rsqrt_',
+ 'searchsorted',
'scale',
'scale_',
'sign',
| [No CFG could be retrieved] | This function is used to import the topk module and the module to import the search module This function is a function to convert a non - negative number into a non - negative number. | Why add this? Remove it. |
@@ -118,7 +118,7 @@ def get_pip_version():
return (
'pip {} from {} (python {})'.format(
- __version__, pip_pkg_dir, sys.version[:3],
+ __version__, pip_pkg_dir, '{}.{}'.format(*sys.version_info),
)
)
| [get_installed_distributions->[editables_only_test->[dist_is_editable],editable_test->[dist_is_editable],user_test,editables_only_test,local_test,editable_test],captured_stdout->[captured_output],unzip_file->[ensure_dir,has_leading_dir,split_leading_dir,current_umask],redact_netloc->[split_auth_from_netloc],unpack_file->[untar_file,unzip_file,file_contents,is_svn_page],split_auth_netloc_from_url->[_transform_url],captured_stderr->[captured_output],dist_location->[egg_link_path],ask_input->[_check_no_input],normalize_version_info->[cast],redact_password_from_url->[_transform_url],make_subprocess_output_error->[path_to_display,format_command_args],untar_file->[ensure_dir,has_leading_dir,split_leading_dir,current_umask],dist_in_site_packages->[normalize_path],call_subprocess->[make_subprocess_output_error,format_command_args],captured_output->[from_stream],_get_netloc->[split_auth_from_netloc],is_local->[normalize_path],dist_is_local->[is_local],rmtree->[rmtree],remove_auth_from_url->[_transform_url],has_leading_dir->[split_leading_dir],ask->[_check_no_input],splitext->[splitext],dist_in_usersite->[normalize_path],_redact_netloc->[redact_netloc],ask_password->[_check_no_input]] | Get pip version. | I think it would be helpful to add this as a helper function to `misc.py` since it's used so frequently and was a source of error, and the pattern isn't obvious to those who haven't seen it. It can be called something like `get_major_minor_version()`. It would also make it easier to track down all the places we're using this version string. |
@@ -525,9 +525,11 @@ async def get_ancestor_init_py(
)
# Find the ancestors of all dirs containing .py files, including those dirs themselves.
source_dir_ancestors: Set[Tuple[str, str]] = set() # Items are (src_root, path incl. src_root).
- for fp in sources.snapshot.files:
- source_dir_ancestor = os.path.dirname(fp)
- source_root = source_roots.strict_find_by_path(fp).path
+ source_roots = await MultiGet(
+ Get[SourceRoot](SourceRootRequest(path)) for path in sources.snapshot.files
+ )
+ for path, source_root in zip(sources.snapshot.files, source_roots):
+ source_dir_ancestor = os.path.dirname(path)
# Do not allow the repository root to leak (i.e., '.' should not be a package in setup.py).
while source_dir_ancestor != source_root:
source_dir_ancestors.add((source_root, source_dir_ancestor))
| [validate_args->[InvalidSetupPyArgs],get_sources->[SetupPySources],get_owned_dependencies->[OwnedDependency,OwnedDependencies],generate_chroot->[InvalidEntryPoint,DependencyOwner,SetupPyChroot,SetupPySourcesRequest],run_setup_pys->[validate_args,ExportedTarget,TargetNotExported,RunSetupPyRequest,OwnedDependency,SetupPyChrootRequest,SetupPy],get_ancestor_init_py->[AncestorInitPyFiles],get_requirements->[OwnedDependency,ExportedTargetRequirements],setup_setuptools->[SetuptoolsSetup],get_exporting_owner->[_is_exported,ExportedTarget,AmbiguousOwnerError,NoOwnerError],run_setup_py->[RunSetupPyResult]] | Find any ancestor init. py files for the given targets. Returns the files stripped of their Get an AncestorInitPyFiles for all source directories that are not in the snapshot. | You can use `sources.files` for the same thing. This shortcut didn't exist when this rule was first written. |
@@ -149,11 +149,9 @@ TopicImpl::enable()
return DDS::RETCODE_PRECONDITION_NOT_MET;
}
- // Make sure Data Representation QoS is initialized
- DDS::DataRepresentationIdSeq type_allowed_reprs;
- type_support_->representations_allowed_by_type(type_allowed_reprs);
- DCPS::check_data_representation_qos(
- qos_.representation.value, type_allowed_reprs);
+ if (!check_data_representation(qos_.representation.value, false)) {
+ return DDS::RETCODE_PRECONDITION_NOT_MET;
+ }
if (id_ == GUID_UNKNOWN) {
const DDS::DomainId_t dom_id = participant_->get_domain_id();
| [No CFG could be retrieved] | Method to enable or disable an Entity assert_topic - Enables assert_topic. | I'm not sure the topic creation should be failing here. The QoS could be corrected by the time the DataWriter and DataReader are enabled, which is where the check should actually be happening. |
@@ -140,6 +140,11 @@ public class CommonCacheNotifier
LOG.debug(callerName + ":Received responses for cache update notifications.");
}
+ catch (InterruptedException e) {
+ LOG.noStackTrace()
+ .makeAlert(e, callerName + ":Interrupted while handling updates for cachedUserMaps.")
+ .emit();
+ }
catch (Throwable t) {
LOG.makeAlert(t, callerName + ":Error occured while handling updates for cachedUserMaps.").emit();
}
| [CommonCacheNotifier->[getListenerURL->[getServiceScheme,RuntimeException,error,URL,getPortToUse,getHost],addUpdate->[add],ResponseHandler->[done->[getObj,finished],handleResponse->[unfinished,StatusResponseHolder,getStatus],exceptionCaught->[error],Logger],start->[getCacheNotificationTimeout,debug,emit,get,sendUpdate,interrupted,getStatus,isEnableCacheNotifications,take,submit],stop->[shutdownNow],sendUpdate->[getDruidNode,getCacheNotificationTimeout,getListenerURL,ResponseHandler,urlEncode,Request,setContent,millis,get,getForNodeRole,format,getAllNodes,go,add],singleThreaded,encodeForFormat,format,asList,EmittingLogger]] | This method is called when the cache manager is starting. It will block until the next item. | should this be emitted as an alert? |
@@ -82,11 +82,15 @@ def create_attributes_and_values(schema, attribute_key):
def create_product_class_with_attributes(name, schema):
- product_class = get_or_create_product_class(name=name)
+ product_attributes_schema = schema.pop('product_attributes', {})
+ variant_attributes_schema = schema.pop('variant_attributes', {})
+ is_shipping_required = schema.pop('is_shipping_required', True)
+ product_class = get_or_create_product_class(
+ name=name, is_shipping_required=is_shipping_required)
product_attributes = create_attributes_and_values(
- schema, 'product_attributes')
+ product_attributes_schema)
variant_attributes = create_attributes_and_values(
- schema, 'variant_attributes')
+ variant_attributes_schema)
product_class.product_attributes.add(*product_attributes)
product_class.variant_attributes.add(*variant_attributes)
return product_class
| [create_product_images->[create_product_image],create_fake_user->[create_address,get_email],create_fake_order->[create_delivery_group,create_address,get_email,create_payment,create_order_lines],create_items_by_class->[get_variant_combinations,get_price_override,set_product_attributes],create_delivery_group->[price,shipping_method],create_order_lines->[create_order_line],create_users->[create_fake_user],create_items_by_schema->[create_product_classes_by_schema,create_items_by_class],create_product_class_with_attributes->[create_attributes_and_values],create_product_classes_by_schema->[create_product_class_with_attributes],create_shipping_methods->[price],create_product->[price],create_orders->[create_fake_order],create_variant->[create_stock]] | Create a product class with missing product attributes and variant attributes. | You're modifying the object that is passed in which means this function has potentially unexpected side effects. |
@@ -381,9 +381,9 @@ class HtmlReporter(Reporter):
if isinstance(element, string_types):
element = [element]
- # Map assumes None for missing values, so this will pick the default for those.
- (text, detail, detail_id, detail_initially_visible) = \
- map(lambda x, y: x or y, element, ('', None, None, False))
+ # zip_longest assumes None for missing values, so this generator will pick the default for those.
+ default_values = ('', None, None, False)
+ (text, detail, detail_id, detail_initially_visible) = (x or y for x, y in zip_longest(element, default_values))
htmlified_text = self._htmlify_text(text)
| [HtmlReporter->[end_workunit->[render_cache_stats->[fix_detail_id],render_cache_stats,close,render_timings],handle_output->[open],_overwrite->[open],close->[close],open->[report_path,open]]] | Renders a message with missing cache stats. Returns the HTML for the missing element. | This was tricky. In Py2, `map()` defaults to None when zipping like this and one of the iterables in shorter. In Py3, it no longer does that, so we have to use `zip_longest()`. I tried to make this more readable with the `default_values` variable and converting to a generator. I don't think there's a unit test, but every pants goal fails when this piece is broken, so I think it's good to go. |
@@ -44,6 +44,7 @@ public class ProcessorConfigDTO {
private String comments;
private String customUiUrl;
private Boolean lossTolerant;
+ private Boolean executionNodeRestricted;
// annotation data
private String annotationData;
| [No CFG could be retrieved] | XML description for a single node. Indcates whether the prcessor should be scheduled in event or timer driven mode. | This is not something that is configurable, so I think we want to put this in the ProcessorDTO, not the ProcessorConfigDTO. This is where we store other 'flags' about a processor, such as restricted, deprecation, supportsBatching, etc, etc. |
@@ -1,7 +1,6 @@
-const myNotification = new Notification('Title', {
- body: 'Notification from the Renderer process'
-})
+const NOTIFICATION_TITLE = 'Title'
+const NOTIFICATION_BODY = 'Notification from the Renderer process. Click to log to console.'
+const CLICK_MESSAGE = 'Notification clicked'
-myNotification.onclick = () => {
- console.log('Notification clicked')
-}
+new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY })
+ .onclick = () => console.log(CLICK_MESSAGE)
| [No CFG could be retrieved] | Notification from the Renderer process. | IMO, `console.log(...)` isn't super obvious (especially since we have two) - would it be better to just update some text in the UI? |
@@ -11,8 +11,15 @@ using System.Text;
namespace ProtoCore.Namespace
{
- public static class ElementRewriter
+ public class ElementRewriter
{
+ private readonly ClassTable classTable;
+
+ internal ElementRewriter(ClassTable classTable)
+ {
+ this.classTable = classTable;
+ }
+
/// <summary>
/// Lookup namespace resolution map to substitute
/// partial classnames with their fully qualified names in ASTs.
| [ElementRewriter->[RewriteElementNames->[LookupResolvedNameAndRewriteAst],DfsTraverse->[list,ConditionExpression,Any,RightNode,LeftNode,DfsTraverse,RewriteIdentifierListNode,Count,FalseExpression,TrueExpression,Add,FormalArguments],IdentifierListNode->[RightNode,IsNullOrEmpty,Dequeue,Assert,Split,Length,dot],GetClassIdentifiers->[DfsTraverse],LookupResolvedNameAndRewriteAst->[AddToResolutionMap,LookupResolvedName,Enqueue,GetClassIdentifiers,IsNullOrEmpty,Empty,GetIdentifierExceptMethodName,RewriteAstWithResolvedName,GetAssemblyFromClassName,Assert,GetResolvedClassName,Length],RewriteAstWithResolvedName->[DfsTraverse]]] | This class rewrites the name of the partial class name in the given AST node. if the name is not in the class table add it to the resolutions map. | Is this class more for extensibility of the rewriter? As opposed to just one function LookupResolvedNameAndRewriteAst(...) |
@@ -202,6 +202,15 @@ public class PullQueryExecutorMetrics implements Closeable {
}
}
+ public void recordZeroRowsReturnedForError() {
+ final MetricsKey key = new MetricsKey();
+ if (rowsReturnedSensorMap.containsKey(key)) {
+ rowsReturnedSensorMap.get(key).record(0);
+ } else {
+ throw new IllegalStateException("Metrics not configured correctly, missing " + key);
+ }
+ }
+
public void recordRowsProcessed(
final double value,
final PullSourceType sourceType,
| [PullQueryExecutorMetrics->[MetricsKey->[equals->[equals]]]] | Method to record rows returned and processed. | I also hard-coded the "zero", since that's what we would always record for errors. |
@@ -766,6 +766,18 @@ module Engine
Round::Operating.new(@corporations, game: self, round_num: round_num)
end
+ def event_close_companies!
+ @log << '-- Event: Private companies close --'
+
+ @companies.each do |company|
+ ability = company.abilities(:close)
+ next if ability&.when == :never
+ next if ability && @phase.phases.any? { |phase| ability.when == phase[:name] }
+
+ company.close!
+ end
+ end
+
def cache_objects
CACHABLE.each do |type, name|
ivar = "@_#{type}"
| [Base->[end_game!->[format_currency],current_entity->[current_entity],trains->[trains],initialize->[title],process_action->[process_action],next_round!->[end_game!],init_company_abilities->[shares],inspect->[title]]] | Initialize a new game object with a given round number. | let's use block style company.abilities(:close) do |ability| next if ability.when == 'never' # note this is a string and not a symbol like you have it here i think there's a bug with the when stuff that we need to fix i guess when should always be a string? since phase names are strings |
@@ -102,7 +102,7 @@ def git_upstream(tmp_dir, erepo_dir):
@pytest.fixture
def git_downstream(tmp_dir, erepo_dir):
url = "file://{}".format(tmp_dir.resolve().as_posix())
- erepo_dir.scm.gitpython.repo.create_remote("upstream", url)
- erepo_dir.remote = "upstream"
+ erepo_dir.scm.gitpython.repo.create_remote("downstream", url)
+ erepo_dir.remote = "downstream"
erepo_dir.url = url
return erepo_dir
| [exp_stage->[add,commit,run,gen],git_downstream->[resolve,format,create_remote],git_upstream->[resolve,format,create_remote],checkpoint_stage->[patch,run,gen,add,commit],format,dedent] | Create a remote remote from the upstream of the git repo. | This change shouldn't be necessary. The `git_upstream` fixture creates a git repo that is "upstream" from tmp_dir. So the local `tmp_dir` git repo contains a remote named `upstream` that points to `erepo_dir`. This allows simulating that `tmp_dir` is a local repo, and `erepo_dir` is a server repo. The `git_downstream` remote creates a repo that is "downstream" from `tmp_dir`. Meaning that it simulates `tmp_dir` being the "server" repo, and `repo_dir` being a downstream clone of `tmp_dir`. So the git repo in `tmp_dir` contains no remotes at all, and the git repo in `erepo_dir` contains a single remote named `upstream` which points to `tmp_dir`. |
@@ -96,6 +96,7 @@ export function unobserveBorderBoxSize(element, callback) {
*/
export function measureBorderBoxSize(element) {
return new Promise((resolve) => {
+ /** @type {function(ResizeObserverSize): void} */
const onSize = (size) => {
resolve(size);
unobserveBorderBoxSize(element, onSize);
| [No CFG could be retrieved] | Measure content and border box size of an element. Unobserve a size of a given type. | Here and above, you could instead type the `@param {ResizeObserverSize} size` (same above w/ `LayoutSizeDef`) rather than typing the function, your call which is cleaner |
@@ -100,6 +100,10 @@ class InfoDialogButton extends Component {
if (this.props._shouldAutoClose) {
this._setAutoCloseTimeout();
}
+
+ if (!this.props._dialInNumbers) {
+ this.props.dispatch(updateDialInNumbers());
+ }
}
/**
| [No CFG could be retrieved] | Constructor for the component. A component that will be rendered if the Dialog is visible. | Previously the InfoDialog popup would fetch dial in numbers itself. When numbers are fetched the InfoDialog displayed dial in numbers, making itself taller. This was fine in the vertical toolbar case as the InfoDialog has plenty of room to grow vertically. With the new horizontal toolbar, that growing caused overlap. The fetching of numbers was moved up one level so that InlineDialog could receive new props and know to update its window location. |
@@ -37,6 +37,12 @@ type FileSet struct {
}
func newFileSet(ctx context.Context, storage *Storage, name string, memThreshold int64, defaultTag string, opts ...Option) *FileSet {
+ // because we don't have the option to return an error, we can't use ctx here.
+ // we have to be willing to wait indefinitely.
+ if err := storage.filesetSem.Acquire(context.Background(), 1); err != nil {
+ // should never happen because of the background context
+ panic(err)
+ }
f := &FileSet{
ctx: ctx,
storage: storage,
| [createParent->[createParent],serialize->[Write],Close->[serialize],Write->[Write]] | fileset import imports a set of files from a tar stream. next returns the next file in the file set. | This is not the approach we should take. We can change the function signature to return an error, so we can handle the canceled context case. |
@@ -80,7 +80,7 @@ public class NetworkUsageParser {
long zoneId = usageNetwork.getZoneId();
String key = "" + zoneId;
if (usageNetwork.getHostId() != 0) {
- key += "-Host" + usageNetwork.getHostId();
+ key += "-Host" + usageNetwork.getHostId() + "-Network-" + usageNetwork.getNetworkId();
}
NetworkInfo networkInfo = networkUsageByZone.get(key);
| [NetworkUsageParser->[parse->[createSearchCriteria,getBytesSent,getNetworkId,isDebugEnabled,NetworkInfo,put,saveUsageRecords,getHostType,getZoneId,Double,addAnd,getTime,getDomainId,getHostId,toHumanReadableSize,debug,getBytesRcvd,Date,UsageVO,search,get,getBytesReceived,after,getId,add,keySet],getLogger,getName]] | Parse all Network usage events for the given account between the given dates. This method creates a usage record for bytes sent and received. | should networkid be checked for 0 as well? |
@@ -901,7 +901,11 @@ export class Resource {
* @return {boolean}
*/
isInViewport() {
- return this.element.isInViewport();
+ const isInViewport = this.element.isInViewport();
+ if (isInViewport) {
+ this.resolveRenderOutsideViewport_();
+ }
+ return isInViewport;
}
/**
| [No CFG could be retrieved] | Provides a method to handle the unloading of a resource. Returns the task ID for a given resource. | return this.element.isInViewport() ? this.resolveRenderOutsideViewport_() || true : false; |
@@ -68,7 +68,7 @@ public class EnvironmentTab extends DelayLoadWorkbenchTab<EnvironmentPresenter>
Commands commands,
Session session)
{
- super("Environment", shim);
+ super(constants_.environmentCapitalized(), shim);
binder.bind(commands, shim);
events.addHandler(OpenDataFileEvent.TYPE, shim);
| [EnvironmentTab->[getEnvironmentState,bind,addHandler,initialize]] | Initialize the environment. | There may be non-obvious side effects of changing this. I need to do further research. Might be best to leave this one string unchanged for now until I can look into it. See similar feedback in this PR: #10196 > I need to do some research on this. I suspect this may prove problematic without some additional work and this is very sensitive / fragile code with some non-obvious assumptions. |
@@ -0,0 +1,6 @@
+require 'faker'
+
+FactoryGirl.define do
+ factory :image_annotation do
+ end
+end
\ No newline at end of file
| [No CFG could be retrieved] | No Summary Found. | Final newline missing. |
@@ -1045,6 +1045,14 @@ public abstract class IncrementalIndex<AggregatorType> extends AbstractIndex imp
this.rowIndex = rowIndex;
}
+ public long estimateBytesInMemory()
+ {
+ //timestamp + dims length + dimensionDescsList shared pointer
+ long sizeInBytes = Long.BYTES + Integer.BYTES * dims.length + Long.BYTES + Long.BYTES;
+ sizeInBytes += dimsKeySize;
+ return sizeInBytes;
+ }
+
@Override
public String toString()
{
| [IncrementalIndex->[loadDimensionIterable->[isEmpty],addNewDimension->[size,add],getColumnNames->[getDimensionNames,getMetricNames],toTimeAndDims->[formatRow,add],MetricDesc->[getName],getMaxTime->[getMaxTimeMillis,isEmpty],getMinTimeMillis->[getMinTimeMillis],PlainFactsHolder->[putIfAbsent->[getTimestamp,setRowIndex,putIfAbsent,add],concat->[iterator,concat],keySet->[concat],clear->[clear],iterator->[iterator]],RollupFactsHolder->[getMaxTimeMillis->[getTimestamp],putIfAbsent->[setRowIndex,putIfAbsent],keySet->[keySet],getMinTimeMillis->[getTimestamp],clear->[clear],timeRangeIterable->[keySet,TimeAndDims],iterator->[iterator]],getDimensionIndex->[getDimension],TimeAndDimsComp->[compare->[compare,getIndexer]],FloatMetricColumnSelector->[isNull->[isNull],getFloat->[isNull,getMetricFloatValue]],makeColumnSelectorFactory->[IncrementalIndexInputRowColumnSelectorFactory->[makeDimensionSelector->[makeDimensionSelector],makeColumnValueSelector->[makeColumnValueSelector],getColumnCapabilities->[getColumnCapabilities]],IncrementalIndexInputRowColumnSelectorFactory,makeColumnSelectorFactory],getMaxTimeMillis->[getMaxTimeMillis],ObjectMetricColumnSelector->[getObject->[getMetricObjectValue]],DoubleMetricColumnSelector->[isNull->[isNull],getDouble->[isNull,getMetricDoubleValue]],iterableWithPostAggregations->[iterator->[getAggVal,iterator,getAggsForRow,getDimensions]],TimeAndDims->[hashCode->[getIndexer],equals->[getIndexer]],getInterval->[getMaxTimeMillis,isEmpty],LongMetricColumnSelector->[getLong->[isNull,getMetricLongValue],isNull->[isNull]],add->[addToFacts,add],getMinTime->[isEmpty,getMinTimeMillis],iterator->[iterator]]] | Sets the row index. | Would you elaborate more on how `sizeInBytes` is calculated? |
@@ -60,6 +60,11 @@ export function Timeago({
return undefined;
}
const observer = new win.IntersectionObserver((entries) => {
+ let {lang} = node.ownerDocument.documentElement;
+ if (lang === 'unknown') {
+ lang = DEFAULT_LOCALE;
+ }
+ const locale = getLocale(localeProp || lang);
const last = entries[entries.length - 1];
if (last.isIntersecting) {
setTimestamp(
| [No CFG could be retrieved] | Provides a view which exports a time - based . Returns the value of the in the given locale if it is greater than the given. | Never seen "unknown", but I do see an empty string. There's also `navigator.language` that could be helpful for defaults. |
@@ -291,4 +291,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
);
$this->assertTrue($config->get('disable-tls'));
}
+
+ public function testProcessTimeout()
+ {
+ putenv('COMPOSER_PROCESS_TIMEOUT=0');
+ $config = new Config(true);
+ $this->assertEquals(0, $config->get('process-timeout'));
+ }
}
| [ConfigTest->[testFetchingRelativePaths->[merge,get,assertEquals],testGitDisabledByDefaultInGithubProtocols->[merge,get,assertEquals],testOverrideGithubProtocols->[merge,get,assertEquals],testAddPackagistRepository->[getRepositories,merge,assertEquals],testVarReplacement->[merge,get,assertEquals],testMergePreferredInstall->[merge,get,assertEquals],testProhibitedUrlsThrowException->[setExpectedException,prohibitUrlByConfig],testMergeGithubOauth->[merge,get,assertEquals],testRealpathReplacement->[merge,get,assertEquals],testAllowedUrlsPass->[prohibitUrlByConfig],testDisableTlsCanBeOverridden->[assertTrue,assertFalse,merge,get],testPreferredInstallAsString->[merge,get,assertEquals],testStreamWrapperDirs->[merge,get,assertEquals]]] | Tests if disable - tls can be overridden. | You should reset this value to previous one after test, no? |
@@ -11,10 +11,8 @@ import signal
import sys
import time
-try:
- import termios
-except ImportError:
- termios = None
+from typing import Optional # novm
+from types import ModuleType # novm
import pytest
| [test_log_subproc_and_echo_output_capfd->[print,force_echo,as_cwd,readouterr,log_output,which,echo],mock_shell_fg_bg->[status,wait_enabled,fg,kill,bg,wait_disabled],mock_shell_fg->[fg,kill,status,wait_enabled],mock_shell_v_v_no_termios->[write,sleep,fg,wait_disabled_fg,kill,release,acquire],mock_shell_v_v->[write,wait_enabled,sleep,fg,kill,release,acquire],test_foreground_background_output->[print,start,PseudoShell,uniq,readouterr,str,strip,Lock,read,join,exists,open,termios_on_or_off,count],mock_shell_tstp_cont->[wait_stopped,kill,tstp,cont,wait_running],mock_shell_bg->[wait_disabled,kill,status,bg],mock_shell_tstp_tstp_cont_cont->[wait_stopped,kill,tstp,cont,wait_running],test_log_python_output_without_echo->[print,as_cwd,readouterr,log_output,read,open],synchronized_logger->[write,print,force_echo,sleep,log_output,signal,release,getcwd,acquire],mock_shell_tstp_tstp_cont->[wait_stopped,kill,tstp,cont,wait_running],simple_logger->[print,log_output,signal,sleep],test_log_python_output_and_echo_output->[print,force_echo,as_cwd,readouterr,log_output,read,open],test_log_subproc_and_echo_output_no_capfd->[print,force_echo,disabled,as_cwd,log_output,read,which,open,echo],mock_shell_bg_fg->[status,wait_enabled,fg,kill,bg,wait_disabled],mock_shell_fg_bg_no_termios->[status,fg,kill,wait_disabled_fg,bg,wait_disabled],test_foreground_background->[start,PseudoShell,str,join,exists,termios_on_or_off],test_log_python_output_with_echo->[print,as_cwd,readouterr,log_output,read,open],mock_shell_fg_no_termios->[fg,kill,status,wait_disabled_fg],mock_shell_bg_fg_no_termios->[status,fg,kill,wait_disabled_fg,bg,wait_disabled],skipif,parametrize,which] | Creates a function that returns a new object that can be used to run a single national Test that the with the given name is logged to the log. | Won't this crash when we run our tests on Python 2? |
@@ -17,7 +17,7 @@ type DockerBuildStrategy struct {
// CreateBuildPod creates the pod to be used for the Docker build
// TODO: Make the Pod definition configurable
func (bs *DockerBuildStrategy) CreateBuildPod(build *buildapi.Build) (*kapi.Pod, error) {
- buildJSON, err := json.Marshal(build)
+ data, err := v1beta1.Codec.Encode(build)
if err != nil {
return nil, err
}
| [CreateBuildPod->[Marshal]] | CreateBuildPod creates a pod with the given build. | Inject the codec from the BuildControllerFactory through the typeBasedFactoryStrategy. |
@@ -135,7 +135,8 @@ export function getIframe(
// request completes.
iframe.setAttribute('allow', 'sync-xhr \'none\';');
}
- if (isExperimentOn(parentWindow, 'sandbox-ads')) {
+ const excludeFromSandbox = ['facebook', 'embedly'];
+ if (isExperimentOn(parentWindow, 'sandbox-ads') && !excludeFromSandbox.includes(opt_type)) {
applySandbox(iframe);
}
iframe.setAttribute('data-amp-3p-sentinel',
| [No CFG could be retrieved] | Creates an iframe with the given name. Private methods - > Element. | /cc @jpettitt @cramforce tested all 3Ps and embedly and facebook were the only ones I found broken. Will send a PR later for testing on those components ensuring we never see `sandbox` on them. |
@@ -44,7 +44,7 @@
<p>
Tag moderation is something we're continuously iterating on, so you can expect adjustments and expanding features over time as we receive feedback. We regularly send out a biweekly Mod Newsletter to keep mods up to date on these changes, so look out for it!
- Of course, don't hesitate to reach out to us at any moment if you have any feedback — feel free to write to <%= SiteConfig.email_addresses[:default] %> and share your thoughts.
+ Of course, don't hesitate to reach out to us at any moment if you have any feedback — feel free to write to <%= email_link %> and share your thoughts.
</p>
<p>
| [No CFG could be retrieved] | The object that holds the tag of the tag. | replaced with `email_link` because this is a HTML template |
@@ -666,7 +666,16 @@ Spdp::handle_participant_data(DCPS::MessageId id,
DCPS::LogGuid(guid_).c_str(), DCPS::LogGuid(guid).c_str(),
pdata.leaseDuration.seconds, DCPS::LogAddr(from).c_str(), participants_.size()));
}
-
+ ::CORBA::Long maxLeaseDuration = config_->max_lease_duration().to_dds_duration().sec;
+ if (maxLeaseDuration && pdata.leaseDuration.seconds > maxLeaseDuration) {
+ if (DCPS::DCPS_debug_level >= 2) {
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT("(%P|%t) Spdp::handle_participant_data - overwriting %C lease %ds from %C with %ds\n"),
+ DCPS::LogGuid(guid).c_str(),
+ pdata.leaseDuration.seconds, DCPS::LogAddr(from).c_str(), maxLeaseDuration));
+ }
+ pdata.leaseDuration.seconds = maxLeaseDuration;
+ }
if (tport_->directed_sender_) {
if (tport_->directed_guids_.empty()) {
tport_->directed_sender_->schedule(TimeDuration::zero_value);
| [No CFG could be retrieved] | get identity status token permissions credential and token region Participant Security Attributes. | This block should be conditional on !from_sedp (which would be a secure update). |
@@ -0,0 +1,18 @@
+module Users
+ class ForgetAllDevicesController < ApplicationController
+ before_action :authenticate_user!
+ before_action :confirm_two_factor_authenticated
+
+ def show
+ analytics.track_event(Analytics::FORGET_ALL_DEVICES_VISITED)
+ end
+
+ def destroy
+ DeviceTracking::ForgetAllDevices.new(current_user).call
+
+ analytics.track_event(Analytics::FORGET_ALL_DEVICES_SUBMITTED)
+
+ redirect_to account_path
+ end
+ end
+end
| [No CFG could be retrieved] | No Summary Found. | Doesn't `confirm_two_factor_authenticated` call this? |
@@ -338,9 +338,13 @@ namespace MonoGame.Framework
var newWidth = _form.ClientRectangle.Width;
var newHeight = _form.ClientRectangle.Height;
+#if !(WINDOWS && DIRECTX)
+
+ // FIXME : FULLSCREEN
+
manager.PreferredBackBufferWidth = newWidth;
manager.PreferredBackBufferHeight = newHeight;
-
+#endif
if (manager.GraphicsDevice == null)
return;
}
| [WinFormsGameWindow->[UpdateWindows->[UpdateMouseState],Dispose->[Dispose],OnClientSizeChanged->[OnClientSizeChanged]]] | OnClientSizeChanged - called when the client size of the window has changed. | Another FIXME that needs an explanation. |
@@ -156,7 +156,13 @@ const serverFiles = {
{
file: 'package/domain/Entity.java',
renameTo: generator => `${generator.packageFolder}/domain/${generator.asEntity(generator.entityClass)}.java`
- },
+ }
+ ]
+ },
+ {
+ condition: generator => !(['mongodb', 'couchbase'].includes(generator.databaseType) && generator.embedded),
+ path: SERVER_MAIN_SRC_DIR,
+ templates: [
{
file: 'package/repository/EntityRepository.java',
renameTo: generator => `${generator.packageFolder}/repository/${generator.entityClass}Repository.java`
| [No CFG could be retrieved] | Recent for Liquibase. Package paths for the entities that need to be generated. | `generator => ! generator.embedded` isn't enough? |
@@ -103,6 +103,10 @@ class Jetpack_Image_Widget extends WP_Widget {
</figure>'; // wp_kses_post caption on update
}
echo '<div class="jetpack-image-container">' . do_shortcode( $output ) . '</div>';
+ } else {
+ if ( current_user_can('edit_theme_options') ) {
+ echo '<p>' . sprintf( __( 'Image missing or invalid URL. Please check the Image widget URL in your <a href="%s">widget settings</a>.', 'jetpack' ), admin_url( 'widgets.php' ) ) . '</p>';
+ }
}
echo "\n" . $args['after_widget'];
| [Jetpack_Image_Widget->[form->[get_field_id,get_field_name]]] | Renders a widget This function is used to display a link to the user. | missing whitespace in parenths |
@@ -37,6 +37,15 @@ $googleverify_link = add_query_arg(
'https://www.google.com/webmasters/verification/verification'
);
+$yform->textinput( 'baiduverify', __( 'Baidu verification code', 'wordpress-seo' ) );
+echo '<p class="desc label">';
+printf(
+ /* translators: 1: link open tag; 2: link close tag. */
+ esc_html__( 'Get your Baidu verification code in %1$sBaidu Webmaster Tools%2$s.', 'wordpress' ),
+ '<a target="_blank" href="' . esc_url( 'https://ziyuan.baidu.com/site/siteadd' ) . '" rel="noopener noreferrer">',
+ '</a>'
+);
+echo '</p>';
$yform->textinput( 'msverify', __( 'Bing verification code', 'wordpress-seo' ) );
echo '<p class="desc label">';
| [textinput,get_button_html,get_panel_html] | Displays a link to the Webmaster Tools and a verification code. Show a description of the Google verification code. | `'wordpress'` here should be `'wordpress-seo'` |
@@ -52,6 +52,9 @@ def is_subtype(left: Type, right: Type,
return any(is_subtype(left, item, type_parameter_checker,
ignore_pos_arg_names=ignore_pos_arg_names)
for item in right.items)
+ elif isinstance(right, ClassVarType):
+ return is_subtype(left, right.item, type_parameter_checker,
+ ignore_pos_arg_names=ignore_pos_arg_names)
else:
return left.accept(SubtypeVisitor(right, type_parameter_checker,
ignore_pos_arg_names=ignore_pos_arg_names))
| [are_args_compatible->[is_subtype],is_more_precise->[is_proper_subtype],is_subtype->[is_subtype],is_subtype_ignoring_tvars->[is_subtype],restrict_subtype_away->[is_subtype],satisfies_upper_bound->[is_subtype],SubtypeVisitor->[visit_union_type->[is_subtype],visit_callable_type->[is_subtype],visit_typeddict_type->[is_equivalent,is_subtype],visit_instance->[check_type_parameter,is_subtype],visit_tuple_type->[is_subtype],visit_type_type->[is_subtype],visit_overloaded->[is_subtype],visit_type_var->[is_subtype]],is_callable_subtype->[is_subtype],is_equivalent->[is_subtype],is_proper_subtype->[check_argument->[is_proper_subtype],check_argument]] | Checks if left is a subtype of right. | I don't think ``ClassVar`` represents actually a new type, so that it should not appear here, otherwise you would need to implement also ``meet_types``, ``join_types``, etc. ``ClassVar`` is rather an "access modifier" for a class member. |
@@ -18,6 +18,11 @@ namespace System.Runtime.CompilerServices
public const string DefaultImplementationsOfInterfaces = nameof(DefaultImplementationsOfInterfaces);
#endif
+ /// <summary>
+ /// Indicates that this version of runtime supports the Unmanaged calling convention value.
+ /// </summary>
+ public const string UnmanagedSignatureCallingConvention = nameof(UnmanagedSignatureCallingConvention);
+
/// <summary>
/// Indicates that this version of runtime supports covariant returns in overrides of methods declared in classes.
/// </summary>
| [RuntimeFeature->[IsSupported->[nameof],nameof]] | Replies if a certain feature is supported by the runtime. | Doesn't this need to be added to the switch below? |
@@ -45,6 +45,7 @@ public class CompositeByteBuf extends AbstractReferenceCountedByteBuf {
private final List<Component> components = new ArrayList<Component>();
private final int maxNumComponents;
private static final ByteBuffer FULL_BYTEBUFFER = (ByteBuffer) ByteBuffer.allocate(1).position(1);
+ private static final ByteBuffer EMPTY_BYTEBUFFER = ByteBuffer.allocateDirect(0);
private boolean freed;
| [CompositeByteBuf->[toByteIndex->[checkComponentIndex],_setLong->[_setInt,order,setLong],resetWriterIndex->[resetWriterIndex],getBytes->[toComponentIndex,capacity,getBytes],removeComponents->[checkComponentIndex,updateComponentOffsets],setInt->[setInt],removeComponent->[checkComponentIndex,updateComponentOffsets],setIndex->[setIndex],_setMedium->[setMedium,_setShort,_setByte,order],isDirect->[isDirect],resetReaderIndex->[resetReaderIndex],writerIndex->[writerIndex],writeByte->[writeByte],writeInt->[writeInt],writeZero->[writeZero],retain->[retain],hasArray->[hasArray],copyTo->[capacity,getBytes],nioBuffer->[nioBuffer,nioBufferCount,order],writeBoolean->[writeBoolean],internalComponent->[checkComponentIndex],writeLong->[writeLong],_getInt->[_getShort,order],copy->[toComponentIndex],_getUnsignedMedium->[_getByte,_getShort,order],discardReadBytes->[toComponentIndex,capacity,updateComponentOffsets],internalNioBuffer->[internalNioBuffer],writeShort->[writeShort],capacity->[addComponent0,capacity,consolidateIfNeeded],readBytes->[readBytes],addComponents->[addComponents0],memoryAddress->[memoryAddress],_getShort->[_getByte,order],consolidate->[checkComponentIndex,numComponents,updateComponentOffsets],markReaderIndex->[markReaderIndex],discardReadComponents->[toComponentIndex,capacity,updateComponentOffsets],setZero->[setZero],_getByte->[getByte],hasMemoryAddress->[hasMemoryAddress],discardSomeReadBytes->[discardReadComponents],setShort->[setShort],setMedium->[setMedium],_setByte->[setByte],setBoolean->[setBoolean],writeChar->[writeChar],deallocate->[freeIfNecessary],nioBuffers->[nioBuffers,capacity,readerIndex,toComponentIndex,nioBuffer,nioBufferCount],skipBytes->[skipBytes],_setShort->[setShort,_setByte,order],setFloat->[setFloat],_getLong->[_getInt,order],readerIndex->[readerIndex],setByte->[setByte],_setInt->[_setShort,setInt,order],arrayOffset->[arrayOffset],markWriterIndex->[markWriterIndex],setDouble->[setDouble],writeFloat->[writeFloat],writeBytes->[writeBytes],array->[array],setChar->[setChar],setBytes->[toComponentIndex,capacity,setBytes],writeMedium->[writeMedium],addComponents0->[addComponent0,addComponents0],ensureWritable->[ensureWritable],setLong->[setLong],clear->[clear],writeDouble->[writeDouble],toString->[toString],nioBufferCount->[nioBufferCount],iterator->[iterator]]] | Creates a composite byte buffer which shows multiple buffers as a single merged buffer. The constructor for the object that implements the interface. | Shouldn't this be `Unpooled.EMPTY_BUFFER`? |
@@ -2998,6 +2998,9 @@ gboolean _ask_for_maintenance(const gboolean has_gui, const gboolean closing_tim
void dt_database_maybe_maintenance(const struct dt_database_t *db, const gboolean has_gui, const gboolean closing_time)
{
+ if(!g_strcmp0(db->dbfilename_data, ":memory:") || !g_strcmp0(db->dbfilename_library, ":memory:"))
+ return;
+
char *config = dt_conf_get_string("database/maintenance_check");
if(!g_strcmp0(config, "never"))
| [No CFG could be retrieved] | function to check if a column in the table is missing or not. check if the n - th node is free. | Since the new code is the same for both `dt_database_maybe_maintenance` and `dt_database_optimize`, I would make a unique function to be called in both places. |
@@ -111,7 +111,7 @@ function BTCToLocalCurrency(bitcoin) {
function satoshiToBTC(satoshi) {
let b = new BigNumber(satoshi);
b = b.dividedBy(100000000);
- return b.toString(10) + ' BTC';
+ return b.toString(10);
}
module.exports.updateExchangeRate = updateExchangeRate;
| [No CFG could be retrieved] | This module provides a function to convert BTC to the local currency. | are you sure? maybe you need `loc.formatBalanceWithoutSuffix()` ? |
@@ -40,6 +40,8 @@ import (
"github.com/pulumi/pulumi/pkg/workspace"
)
+const defaultPolicyGroup = "default-policy-group"
+
// Client provides a slim wrapper around the Pulumi HTTP/REST API.
type Client struct {
apiURL string
| [CancelUpdate->[restCallWithOptions],GetStack->[restCall],ExportStackDeployment->[restCall],RenameStack->[restCall],RecordEngineEvents->[updateRESTCall],DeleteStack->[restCall],GetCLIVersionInfo->[restCall],PublishPolicyPack->[restCall],CreateUpdate->[restCall],GetLatestConfiguration->[restCall],ImportStackDeployment->[restCall],GetPulumiAccountName->[restCall],DecryptValue->[restCall],DoesProjectExist->[restCall],GetStackUpdates->[restCall],RenewUpdateLease->[updateRESTCall],CompleteUpdate->[updateRESTCall],PatchUpdateCheckpoint->[updateRESTCall],StartUpdate->[restCall],CreateStack->[restCall],GetUpdateEvents->[restCall],InvalidateUpdateCheckpoint->[updateRESTCall],EncryptValue->[restCall],ListStacks->[restCall],ApplyPolicyPack->[restCall],UpdateStackTags->[restCall]] | NewClient creates a new client with the given URL and API token. restCall makes a REST - style request to the Pulumi API using the given method. | Since this is used to refer to the default policy group, should it be exported from the `apitype` package instead? i.e. it's part of the ~Pulumi API SDK? |
@@ -27,7 +27,7 @@
/**
* merge the database config with the global config
- * Global config overrides db
+ * DB Config overwrites the files (to fully implement web settings)
*/
function mergedb()
{
| [No CFG could be retrieved] | Merges the missing configuration values from the database into the global configuration. | This needs reverting as the original text still remains true. |
@@ -51,6 +51,10 @@ public class TripleA extends Application {
scene.getStylesheets().add(FxmlManager.STYLESHEET_MAIN.toString());
mainMenu = addRootContent(new MainMenuPane(this));
setupStage(stage, scene);
+ // Don't invoke Swing if headless (for example in tests)
+ if (!GraphicsEnvironment.isHeadless()) {
+ SwingUtilities.invokeLater(GameRunner::newMainFrame);
+ }
}
private void setupStage(final Stage stage, final Scene scene) {
| [TripleA->[setupStage->[setScene,Image,setTitle,show,loadFont,setFullScreenExitKeyCombination,getResourceAsStream,setFullScreen,toString,add],addRootContent->[add],returnToMainMenu->[setVisible],start->[getResource,setupStage,addRootContent,MainMenuPane,getLoader,Scene,toString,add,setController,load],showDesktopApiNotSupportedError->[showErrorMessage],setLoadingMessage->[setText],exit->[exit],promptExit->[setVisible],open->[openUrl,getAbsolutePath,showDesktopApiNotSupportedError,openFile],hideExitConfirm->[setVisible],displayLoadingScreen->[setVisible]]] | Setup the stage. | If we're running tests locally, as a dev, will the game frame be rendered? It's probably a best practice to allow tests to run in the background and not do things like steal screen focus. It does take 3-5 minutes to run the full TripleA verification, it's too time inefficient to sit and wait for that, I'm very often doing other work while waiting for the verification run to complete. FWIW, It would be very bothersome to not have the tests simply run in the background. It would be great to have a clean solution here, I'm not sure what that would be. Simply having a test constant to disallow the rendering during test might be a better fix. |
@@ -36,8 +36,8 @@ public final class HibernateEnversProcessor {
@BuildStep
List<AdditionalJpaModelBuildItem> addJpaModelClasses() {
return Arrays.asList(
- new AdditionalJpaModelBuildItem(org.hibernate.envers.DefaultRevisionEntity.class),
- new AdditionalJpaModelBuildItem(org.hibernate.envers.DefaultTrackingModifiedEntitiesRevisionEntity.class));
+ new AdditionalJpaModelBuildItem("org.hibernate.envers.DefaultRevisionEntity"),
+ new AdditionalJpaModelBuildItem("org.hibernate.envers.DefaultTrackingModifiedEntitiesRevisionEntity"));
}
@BuildStep
| [HibernateEnversProcessor->[addJpaModelClasses->[AdditionalJpaModelBuildItem,asList],feature->[FeatureBuildItem],capability->[CapabilityBuildItem],setupLogFilters->[LogCleanupFilterBuildItem,produce],registerEnversReflections->[produce,ReflectiveClassBuildItem],applyConfig->[setXmlMappingRequired,produce]]] | Add the JPA model classes. | So... no tests for these? I'd rather have a `ClassNames` constants class for other modules as well, with the corresponding test. As long as we follow the structure I suggested, that's not too hard to maintain. |
@@ -259,7 +259,12 @@ func (o *ReconcileClusterRoleBindingsOptions) ReplaceChangedRoleBindings(changed
}
if kapierrors.IsNotFound(err) {
- createdRoleBinding, err := o.RoleBindingClient.Create(changedRoleBindings[i])
+ roleBinding, err := util.ClusterRoleBindingFromRBAC(changedRoleBindings[i])
+ if err != nil {
+ errs = append(errs, err)
+ continue
+ }
+ createdRoleBinding, err := o.RoleBindingClient.Create(roleBinding)
if err != nil {
errs = append(errs, err)
continue
| [Error->[Sprintf,Join],Validate->[New],RunReconcileClusterRoleBindings->[Object,Fprintf,NewAggregate,ReplaceChangedRoleBindings,VersionedPrintObject,ChangedClusterRoleBindings],ReplaceChangedRoleBindings->[Create,Fprintf,NewAggregate,DeepEqual,Delete,IsNotFound,Get,Update],ChangedClusterRoleBindings->[Has,ConvertToOriginClusterRoleBindingsOrDie,List,Delete,NewString,IsNotFound,Get,GetBootstrapClusterRoleBindings],Complete->[Object,ClusterRoleBindings,ResolveResource,GetFlagString,BuildSubjects,Resource,Errorf,Clients],Flags,Error,Examples,Sprintf,LongDesc,Validate,RunReconcileClusterRoleBindings,StringSliceVar,Lookup,DeepEqual,UsageError,Set,CheckErr,AddPrinterFlags,Complete,BoolVar] | ReplaceChangedRoleBindings replaces the specified changedRoleBindings with the new roleBindings Check if a clusterrolebinding exists in the cluster. | @liggitt I do not understand why these 2 lines exist at all. Maybe they were never supposed to be inside the if statement? |
@@ -122,7 +122,7 @@ public class QuteDevConsoleProcessor {
for (String variant : variants) {
String source = templatePaths.stream().filter(p -> p.getPath().equals(variant))
.map(TemplatePathBuildItem::getContent).findFirst()
- .orElse(null);
+ .orElse("");
source = source.replace("\n", "\\n");
variantsMap.put(variant, source);
}
| [QuteDevConsoleProcessor->[translate->[translate]]] | Process variants. | I'm not sure it's the right fix. Do we want an entry if no source? Let's ask @mkouba ! |
@@ -540,6 +540,11 @@ public final class HiveWriteUtils
}
public static Path createTemporaryPath(ConnectorSession session, HdfsContext context, HdfsEnvironment hdfsEnvironment, Path targetPath)
+ {
+ return createTemporaryPath(session, context, hdfsEnvironment, targetPath, false);
+ }
+
+ public static Path createTemporaryPath(ConnectorSession session, HdfsContext context, HdfsEnvironment hdfsEnvironment, Path targetPath, boolean hdfsImpersonationEnabled)
{
// use a per-user temporary directory to avoid permission problems
String temporaryPrefix = getTemporaryStagingDirectoryPath(session)
| [HiveWriteUtils->[getTableDefaultLocation->[getTableDefaultLocation],MapFieldSetter->[setField->[getField]],isWritableType->[isWritableType],RowFieldSetter->[setField->[getField]],getRawFileSystem->[getRawFileSystem],isDirectory->[isDirectory],getField->[getField],isHdfsEncrypted->[getRawFileSystem],ArrayFieldSetter->[setField->[getField]],createTemporaryPath->[isViewFileSystem],getRowColumnInspector->[getJavaObjectInspector],getJavaObjectInspector->[getJavaObjectInspector]]] | create a temporary directory on the same filesystem. | This method is now unused, there is no need to keep it. |
@@ -44,8 +44,9 @@ def application(env, start_response):
# Initialize Newrelic if we configured it
newrelic_ini = getattr(django.conf.settings, 'NEWRELIC_INI', None)
+newrelic_uses_environment = os.environ.get('NEW_RELIC_LICENSE_KEY', None)
-if newrelic_ini:
+if newrelic_ini or newrelic_uses_environment:
import newrelic.agent
try:
newrelic.agent.initialize(newrelic_ini)
| [application->[str,django_app,now],activate,exception,getattr,validate,getLogger,get_wsgi_application,fetch_command,wsgi_application,ManagementUtility,now,setup,initialize] | Initialize the HTTP server and return a response object. | Prepares for using environment variables directly to configure NewRelic, this can be used in CircleCI or Travis later to configure NewRelic and generate reports that are easy to compare. |
@@ -110,6 +110,14 @@ module UserNameSuggester
if SiteSetting.unicode_usernames
name.unicode_normalize!
+
+ # TODO: Jan 2022, review if still needed
+ # see: https://meta.discourse.org/t/unicode-username-with-as-the-final-char-leads-to-an-error-loading-profile-page/173182
+ if name.include?('Σ')
+ ctx = MiniRacer::Context.new
+ name = ctx.eval("#{name.inspect}.toLowerCase()")
+ ctx.dispose
+ end
else
name = ActiveSupport::Inflector.transliterate(name)
end
| [apply_allowlist->[join],find_available_username_based_on->[nil?,to_s,username_available?,to_i,truncate,fix_username,end,hex,max_username_length,first,length,normalize_username],rightsize_username->[gsub!,size,end,begin,truncate],fix_username->[sanitize_username,rightsize_username],parse_name_from_email->[last_match,to_s,include?],truncate->[size,pop,join,grapheme_clusters,length],sanitize_username->[apply_allowlist,unicode_usernames,gsub!,char_allowlist_exists?,transliterate,invalid_char_pattern,dup,unicode_normalize!],suggest->[present?,find_available_username_based_on,parse_name_from_email]] | Sanitize a username. | This is probably OK, but I did worry for a second that you are passing `name` in to `eval`. It looks like `inspect` should catch any escaping of the string right? Could we do this after the `gsub`s below? Those would remove any quotes and things. |
@@ -49,14 +49,14 @@ namespace System.ComponentModel.Design.Serialization
if (value != null)
{
- if (value is string)
+ if (value is string stringValue)
{
- if (value is string stringValue && stringValue.Length > 200)
+ if (stringValue.Length > 200)
{
expression = SerializeToResourceExpression(manager, stringValue);
}
}
- else
+ else if (!(value is bool || value is char || value is int || value is float || value is double))
{
// Generate a cast for all other types because we won't parse them properly otherwise
// because we won't know to convert them to the narrow form.
| [PrimitiveCodeDomSerializer->[Serialize->[GetType,TraceScope,ToString,nameof,Trace,Length,SerializeToResourceExpression]]] | Serialize a value if it is a primitive type or a resource expression. | This test had been present in the original sources but vanished during the port :( |
@@ -618,8 +618,12 @@ def report_internal_error(err: Exception,
# Print "INTERNAL ERROR" message.
print('{}error: INTERNAL ERROR --'.format(prefix),
- 'please report a bug at https://github.com/python/mypy/issues',
- 'version: {}'.format(mypy_version),
+ 'Please try using master\n'
+ 'https://mypy.rtfd.io/en/latest/common_issues.html#using-pre-release-mypy',
+ file=stderr)
+ print('If this crash persists, please report a bug at https://github.com/python/mypy/issues',
+ file=stderr)
+ print('version: {}'.format(mypy_version),
file=stderr)
# If requested, drop into pdb. This overrides show_tb.
| [Errors->[render_messages->[simplify_path],copy->[Errors],report->[import_context,current_module,ErrorInfo,current_target],current_target->[current_target],reset->[initialize],raise_error->[blocker_module],new_messages->[file_messages],generate_unused_ignore_errors->[import_context,current_module,ErrorInfo,_add_error_info],file_messages->[format_messages],add_error_info->[_add_error_info]],report_internal_error->[new_messages]] | Report internal error and exit. Check if there is a sequence number in the pdb file. If so print it. | This link doesn't seem to point to the correct section (it goes to the top of the page). |
@@ -30,6 +30,16 @@ import {toggle} from '../../../src/style';
const TAG = 'amp-consent-ui';
+// Classes for consent UI
+const consentUiClasses = {
+ fullscreen: 'i-amphtml-consent-ui-fullscreen',
+ iframeActive: 'consent-iframe-active',
+ uiIn: 'i-amphtml-consent-ui-in',
+ loading: 'loading',
+ fill: 'i-amphtml-consent-fill',
+ placeholder: 'i-amphtml-consent-placeholder',
+};
+
export class ConsentUI {
/**
| [No CFG could be retrieved] | Creates an object that represents a single non - empty object in the AMP HTML Authors The base class for the AMPDoc. | Let's sync offline on the class name. |
@@ -466,6 +466,9 @@ const (
// RepoRefLegacy unknown type, make educated guess and redirect.
// for backward compatibility with previous URL scheme
RepoRefLegacy RepoRefType = iota
+ // RepoRefAPI is for usage in API where educated guess is needed
+ // but redirect can not be made
+ RepoRefAPI
// RepoRefBranch branch
RepoRefBranch
// RepoRefTag tag
| [CanCreateBranch->[CanCreateBranch,IsWriter],CanCommitToBranch->[CanEnableEditor],CanUseTimetracker->[IsWriter],CanEnableEditor->[IsWriter,CanEnableEditor],CanCreateBranch,BranchNameSubURL,IsAdmin,IsOwner,IsWriter,GetCommitsCount] | Get a ref name from a path. getRefName returns the name of the ref that is not already in the context s tree. | nit: rename to make behavior more obvious, perhaps `RepoRefAny`? |
@@ -69,7 +69,9 @@ class Strategy(object):
)
# Minimal ROI designed for the strategy
- self.minimal_roi = self.custom_strategy.minimal_roi
+ self.minimal_roi = OrderedDict(sorted(
+ self.custom_strategy.minimal_roi.items(),
+ key=lambda tuple: float(tuple[0]))) # sort after converting to number
# Optimal stoploss designed for the strategy
self.stoploss = self.custom_strategy.stoploss
| [Strategy->[populate_buy_trend->[populate_buy_trend],populate_indicators->[populate_indicators],__new__->[__new__],populate_sell_trend->[populate_sell_trend]]] | Initialize the object with the specified configuration. | It will not be better to store/cache this result and return it when we call strategy.minimal_roi instead of sorting it again? |
@@ -877,6 +877,7 @@ var _ = Suite(&testBalanceHotWriteRegionSchedulerSuite{})
type testBalanceHotWriteRegionSchedulerSuite struct{}
func (s *testBalanceHotWriteRegionSchedulerSuite) TestBalance(c *C) {
+ statistics.Simulating = true
opt := mockoption.NewScheduleOptions()
newTestReplication(opt, 3, "zone", "host")
tc := mockcluster.NewCluster(opt)
| [TestLeaderWeight->[schedule],TestBalanceLimit->[schedule],TestBalanceFilter->[schedule],TestScheduleWithOpInfluence->[schedule],TestBalanceSelector->[schedule]] | TestBalance tests balance of hot - write - region schedule | - - - - - - - - - - - - - - - - - ScheduleLimit opt. RegionScheduleLimit = 0 Schedule - schedules transfer leader from current region to hot region scheduler. | `Simulating` is only used for simulator, I don't think it is proper to use it here. |
@@ -44,6 +44,8 @@ public class ScanTask implements Task {
@Override
public void execute() {
AnalysisProperties props = new AnalysisProperties(taskProps.properties(), taskProps.property(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
- new ProjectScanContainer(taskContainer, props).execute();
+ ProjectScanContainer scanContainer = new ProjectScanContainer(taskContainer, props);
+ scanContainer.add(DefaultAnalysisMode.class);
+ scanContainer.execute();
}
}
| [ScanTask->[execute->[properties,property,execute,AnalysisProperties],build]] | Execute the NOP. | Do we need it so early? It's already in the ProjectScanContainer. |
@@ -56,9 +56,16 @@ class Openblas(MakefilePackage):
# This patch is in a pull request to OpenBLAS that has not been handled
# https://github.com/xianyi/OpenBLAS/pull/915
patch('openblas_icc.patch', when='%intel')
+ patch('openblas_icc_openmp.patch', when='%intel@18.0:')
+
+ # Change file comments to work around clang 3.9 assembler bug
+ # https://github.com/xianyi/OpenBLAS/pull/982
+ patch('openblas0.2.19.diff', when='@0.2.19')
parallel = False
+ conflicts('%intel@16', when='@0.2.15:0.2.19')
+
@run_before('edit')
def check_compilers(self):
# As of 06/2016 there is no mechanism to specify that packages which
| [Openblas->[check_install->[join_path,split,dirname,compile_c_and_execute,compare_output_file],make_defs->[format,extend,satisfies],install_targets->[format],check_build->[make],check_compilers->[InstallError,satisfies],run_before,on_package_attributes,version,patch,provides,variant,run_after]] | Checks if the compiler is supported by OpenBLAS. | You should just use it for 16+. Both work but -openmp spits out thousands of lines of depreciation warnings. |
@@ -30,7 +30,7 @@
# include <sys/param.h>
#endif
-#if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__)
+#if (defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_SYS_VXWORKS)) || defined(__DJGPP__)
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
| [No CFG could be retrieved] | Creates a new object. _POSIX_TIMERS macro can have a negative value if they are not available. | this line is too long |
@@ -3439,11 +3439,12 @@ public class MethodHandles {
*/
public static MethodHandle doWhileLoop(MethodHandle initHandle, MethodHandle bodyHandle, MethodHandle predHandle) throws NullPointerException, IllegalArgumentException {
- /* Check the validity of the predicate (must be non-null) and body handle.
- * Note: The constraints of initializer and predicate at other aspects will be checked
+ /* Check the validity of the predicate (must be non-null) and body handle. Also
+ * verify that handles are effectively identical and constrained by body. Note:
+ * The constraints of initializer and predicate at other aspects will be checked
* later in the generic loop when adding clauses.
*/
- MethodHandle finiHandle = validateArgumentsOfWhileLoop(predHandle, bodyHandle);
+ MethodHandle finiHandle = validateArgumentsOfWhileLoop(initHandle, predHandle, bodyHandle);
/* Create the clause array with all these handles to be used by the generic loop */
MethodHandle[] handleClause = {initHandle, bodyHandle, predHandle, finiHandle};
| [MethodHandles->[spreadInvoker->[invoker],identity->[findStatic],loop->[toString],permuteArguments->[permuteArguments],zero->[constant,findStatic],whileLoop->[loop],empty->[dropArgumentsUnsafe],insertArguments->[insertArguments],arrayConstructor->[checkArrayClass,findStatic],arrayLength->[checkArrayClass,findStatic],compareExternalParamTypesOfIteratedBodyHandles->[toString],arrayElementSetter->[findStatic],dropArguments->[dropArgumentsUnsafe],dropArgumentsUnsafe->[validatePermutationArray,permuteArguments],iteratedLoop->[identity,loop,findVirtual,dropArguments,filterArguments],doWhileLoop->[loop],foldArgumentsCommon->[toString],validateArgumentsOfWhileLoop->[identity],countedLoop->[identity,loop,zero,dropArguments,findStatic,countedLoop],LoopHandleBuilder->[getHandleWithFullLengthParamTypes->[dropArguments],addClause->[toString],setOmittedHandlesOfClause->[zero,identity,constant],buildLoopHandle->[buildTransformHandle],getSuffixOfParamTypesFromNonInitHandle->[toString],updateLongerLoopParamTypes->[toString]],privateLookupIn->[Lookup,lookupModes],arrayElementGetter->[findStatic],throwException->[findStatic],validateParametersOfMethodTypes->[toString],validateParametersOfCombiner->[toString],reflectAs->[reflectAs,revealDirect],lookup->[Lookup,getStackClass],Lookup->[revealDirect->[checkAccess],hasPrivateAccess->[isWeakenedLookup],findSetter->[checkAccess,nullCheck],findVirtual->[initCheck,convertToVarargsIfRequired,checkAccess,nullCheck],unreflectVarHandle->[checkSecurity,checkAccess],dropLookupMode->[Lookup],throwAbstractMethodErrorForUnreflectPrivateInterfaceMethod->[isVarargs],findVarHandleCommon->[checkSecurity,checkAccess],unreflectGetter->[checkAccess],findGetter->[checkAccess,nullCheck],findStaticGetter->[checkAccess,nullCheck],in->[getVMLangAccess,Lookup,isSamePackage],isSamePackage->[getVMLangAccess],defineClass->[defineClass],convertToVarargsIfRequired->[isVarargs],unreflectConstructor->[convertToVarargsIfRequired,checkAccess],unreflectSetter->[checkAccess],accessClass->[checkSecurity,checkAccess],findSpecialImpl->[initCheck,convertToVarargsIfRequired],findStatic->[initCheck,convertToVarargsIfRequired,checkAccess,nullCheck],bind->[convertToVarargsIfRequired],checkSecurity->[getVMLangAccess,isWeakenedLookup,doesClassLoaderDescendFrom],findStaticSetter->[checkAccess,nullCheck],findSpecial->[checkSpecialAccess,checkAccess,nullCheck],throwExceptionWithMethodTypeAndMessage->[findConstructor],restrictReceiver->[isSamePackage],checkAccess->[checkAccess,isSamePackage],checkClassAccess->[isSamePackage],unreflect->[convertToVarargsIfRequired,restrictReceiver,checkAccess],findNative->[findNativeAddress,nullCheck],findConstructor->[convertToVarargsIfRequired,checkAccess,nullCheck],unreflectSpecial->[checkSpecialAccess,convertToVarargsIfRequired,checkAccess,nullCheck],Lookup],validateArgumentsOfIteratedLoop->[toString],dropArgumentsToMatch->[validatePermutationArray,permuteArguments],recreateIteratedBodyHandle->[dropArguments,permuteArguments]]] | This method creates a loop with all the given handles. The loop is done in a loop. | In the case of void.class != bodyReturnType, hasNoArgs(bodyType) and (bodyReturnType != bodyType.arguments[0]) should be considered as two different error cases. Please split them with K065D1 and K065D2. e.g. if (void.class != bodyReturnType) { if (hasNoArgs(bodyType)) { throw out K065D1; } if (bodyReturnType != bodyType.arguments[0]) { throw out K065D2; } } |
@@ -51,10 +51,10 @@ namespace System.Windows.Forms {
static string productName;
static string productVersion;
static string safeTopLevelCaptionSuffix;
- static bool useVisualStyles = false;
+ private static bool s_useVisualStyles = false;
static bool comCtlSupportsVisualStylesInitialized = false;
static bool comCtlSupportsVisualStyles = false;
- static FormCollection forms = null;
+ private static FormCollection s_forms = null;
private static object internalSyncObject = new object();
static bool useWaitCursor = false;
| [Application->[BeginModalMessageLoop->[BeginModalMessageLoop],Restart->[ExitInternal],RemoveMessageFilter->[RemoveMessageFilter],ThreadContext->[Terminate->[Dispose],BeginModalMessageLoop->[OnComponentEnterState],PreTranslateMessage->[ProcessFilters,OnThreadException],ExitDomain->[ExitCommon],RevokeComponent->[FRevokeComponent],ExitCommon->[Dispose,ExitThread],OleRequired->[GetState],GetMessageLoop->[GetMessageLoop,FGetActiveComponent],DisposeThreadWindows->[Dispose,DisposeParkingWindow],FContinueMessageLoop->[GetState],OnDomainUnload->[ExitDomain],RunMessageLoopInner->[FPushMessageLoop,EndModalMessageLoop,Dispose,BeginModalMessageLoop],FPreTranslateMessage->[PreTranslateMessage],ProcessFilters->[GetState],FormActivated->[FOnComponentActivate],TrackInput->[FSetTrackingComponent],OnAppThreadExit->[Dispose],OnThreadException->[ExitInternal,Exit,Dispose,GetState],EndModalMessageLoop->[EnableWindowsForModalLoop,FOnComponentExitState],OnEnterState->[EnableWindowsForModalLoop,DisableWindowsForModalLoop],Dispose->[RaiseExit,RaiseThreadExit],OleRequired,FRegisterComponent,QueryService],UnparkHandle->[UnparkHandle],OleRequired->[OleRequired],SendThemeChangedRecursive->[SendThemeChangedRecursive],ThreadWindows->[Dispose->[Dispose]],RegisterMessageLoop->[RegisterMessageLoop],AddMessageFilter->[AddMessageFilter],Exit->[Exit],ParkHandle->[ParkHandle],ParkingWindow->[WndProc->[CheckDestroy,WndProc],UnparkHandle->[CheckDestroy],SetState],ModalApplicationContext->[EnableThreadWindowsCallback->[EnableWindowsForModalLoop],DisableThreadWindowsCallback->[DisableWindowsForModalLoop]],ExitThread->[ExitThread],FormActivated->[FormActivated],SetSuspendState->[SetSuspendState],OnThreadException->[OnThreadException],UnregisterMessageLoop->[RegisterMessageLoop],EndModalMessageLoop->[EndModalMessageLoop],SetUnhandledExceptionMode->[SetUnhandledExceptionMode],AddEventHandler,RemoveEventHandler]] | Application class for handling Windows applications. Constant string used for accessing ClickOnce app s data directory. | Looks like we should make a pass (separately) to add visibility specifiers everywhere. |
@@ -52,18 +52,6 @@ func (e *TxCommitError) Error() string {
}
// MissingFieldError occurs when a required field was not passed.
-type MissingFieldError struct {
- field string
-}
-
-func NewMissingFieldError(f string) error {
- return &MissingFieldError{field: f}
-}
-
-func (e *MissingFieldError) Error() string {
- return "must supply policy " + e.field
-}
-
type ForeignKeyError struct {
Msg string
}
| [Error->[Sprintf,Error],New] | Error implements the error interface for MissingFieldError. | Only `CreatePolicy` was using this, so opted to remove it in the standardization process. |
@@ -176,8 +176,12 @@ export const adPreconnect = {
'https://mads.at.atwola.com',
'https://aka-cdn.adtechus.com',
],
+ yieldone: [
+ 'https://img.ak.impact-ad.jp'
+ ]
};
+
/**
* The externalCidScope used to provide CIDs to ads of the given type.
*
| [No CFG could be retrieved] | External CIDs for the given Nend - API type. | host listed in prefetch is not needed here. |
@@ -811,6 +811,17 @@ export class AmpStory extends AMP.BaseElement {
toRemoveChildren.forEach(el => consentEl.removeChild(el));
}
+ /**
+ * Stores the title attribute value in memory then sets it to an empty string
+ * in order to avoid incorrect titles during mouse hover in the bookend.
+ * @private
+ */
+ extractTitle_() {
+ if (this.element.hasAttribute('title')) {
+ this.title_ = this.element.getAttribute('title');
+ this.element.setAttribute('title', '');
+ }
+ }
/**
* @private
| [AmpStory->[pauseCallback->[TOGGLE_PAUSED,PAUSED_STATE],buildSystemLayer_->[element],onPausedStateUpdate_->[ACTIVE,PAUSED],registerAndPreloadBackgroundAudio_->[upgradeBackgroundAudio,childElement,tagName],constructor->[documentStateFor,timerFor,getStoreService,registerServiceBuilder,platformFor,for,createPseudoLocale],initializeStandaloneStory_->[classList],isSwipeLargeEnoughForHint_->[abs],next_->[dev,element,next,ADVANCE_TO],setHistoryStatePageId_->[replaceState,isAd],onBookendStateUpdate_->[ACTIVE,PAUSED],getPageDistanceMapHelper_->[getAdjacentPageIds],showBookend_->[TOGGLE_BOOKEND],initializeListeners_->[CURRENT_PAGE_ID,AD_STATE,NEXT_PAGE,PREVIOUS_PAGE,MUTED_STATE,getMode,SHOW_NO_PREVIOUS_PAGE_HELP,PAGE_PROGRESS,BOOKEND_STATE,CAN_SHOW_PREVIOUS_PAGE_HELP,UI_STATE,DISPATCH_ACTION,REPLAY,PAUSED_STATE,getDetail,TAP_NAVIGATION,SUPPORTED_BROWSER_STATE,SWITCH_PAGE,debounce],isDesktop_->[isExperimentOn],addPage->[isAd],isBrowserSupported->[Boolean,CSS],getPageContainingElement_->[findIndex,element,closest],handlePreviewAttributes_->[removeAttributeInMutate,NEXT,getPreviousPageId,setAttributeInMutate,getNextPageId,PREVIOUS],isStandalone_->[STANDALONE],onUIStateUpdate_->[DESKTOP,SCROLL,MOBILE],validateConsent_->[tagName,dev,indexOf,childElementByTag,removeChild,forEach,length,childElements],updateAudioIcon_->[TOGGLE_STORY_HAS_AUDIO],onResize->[SCROLL,DESKTOP,isLandscape,TOGGLE_UI,TOGGLE_LANDSCAPE,MOBILE,isExperimentOn],buildCallback->[setAttribute,SCROLL,DESKTOP,TOGGLE_UI,TOGGLE_RTL,actionServiceForDoc,isRTL,setWhitelist,isExperimentOn],initializeStoryAccess_->[onApplyAuthorizations,accessServiceForDocOrNull,areFirstAuthorizationsCompleted],getPagesByDistance_->[keys],replay_->[then,BOOKEND_STATE,removeAttributeInMutate,dev,VISITED],onAccessApplyAuthorizations_->[element,TOGGLE_ACCESS],insertPage->[setAttribute,RETURN_TO,AUTO_ADVANCE_TO,isAd,ADVANCE_TO,dev,CAN_INSERT_AUTOMATIC_AD,element,id],onKeyDown_->[BOOKEND_STATE,RTL_STATE,LEFT_ARROW,RIGHT_ARROW,keyCode],updateBackground_->[url,computedStyle,color],onSupportedBrowserStateUpdate_->[dev],layoutCallback->[resolve,isBrowserSupported,TOGGLE_SUPPORTED_BROWSER],toggleElementsOnBookend_->[scopedQuerySelectorAll,resetStyles,prototype,setImportantStyles],previous_->[dev,previous],buildPaginationButtons_->[create],switchTo_->[setState,isAd,shift,MUTED_STATE,TOGGLE_AD,removeAttributeInMutate,VISITED,muteAllMedia,NOT_ACTIVE,CHANGE_PAGE,PAUSED_STATE,beforeVisible,element,length,resolve,unqueueStepInRAF,AD_SHOWING,ACTIVE,TOGGLE_ACCESS,setAttributeInMutate,getNextPageId],performTapNavigation_->[NEXT,PREVIOUS],initializeBookend_->[dict,getImpl,createElementWithAttributes],preloadPagesByDistance_->[forEach,setDistance],getPageIndexById->[findIndex,user,element],hasBookend_->[CAN_SHOW_BOOKEND,components,resolve],getBackgroundUrl_->[dev,querySelector,getAttribute],updateViewportSizeStyles_->[vmax,vmin,vw,max,min,vh,px],isLayoutSupported->[CONTAINER],triggerActiveEventForPage_->[actionServiceForDoc,HIGH],getElementDistance->[getDistance],installGestureRecognizers_->[BOOKEND_STATE,CAN_SHOW_NAVIGATION_OVERLAY_HINT,get,data,preventDefault,onGesture],pauseStoryUntilConsentIsResolved_->[getConsentPolicyState,then,TOGGLE_PAUSED],getMaxMediaElementCounts->[min,VIDEO,AUDIO],lockBody_->[setImportantStyles,documentElement,body],initializeListenersForDev_->[getMode,getDetail,DEV_LOG_ENTRIES_AVAILABLE],getPageById->[dev],maybeLockScreenOrientation_->[mozLockOrientation,dev,message,lockOrientation,msLockOrientation],layoutStory_->[setState,then,id,NOT_ACTIVE,build,user,MOBILE,viewerForDoc,UI_STATE],onAdStateUpdate_->[MUTED_STATE],initializeStyles_->[querySelector],hideBookend_->[TOGGLE_BOOKEND],getPageIndex->[findIndex],rewriteStyles_->[textContent,isExperimentOn],forceRepaintForSafari_->[setStyle],initializePages_->[all,prototype,getImpl],resumeCallback->[TOGGLE_PAUSED],markStoryAsLoaded_->[INI_LOAD,STORY_LOADED,dispatch],getNextPage->[getNextPageId],whenPagesLoaded_->[filter,all,whenLoaded],getHistoryStatePageId_->[state],BaseElement],registerElement,VIDEO,AUDIO,extension] | Checks if the consent element is valid and if so checks if the access is complete. | I think we can just use `removeAttribute`. |
@@ -105,9 +105,10 @@ public class GobblinServiceJobScheduler extends JobScheduler implements SpecCata
*/
public static final String DR_FILTER_TAG = "dr";
- public GobblinServiceJobScheduler(String serviceName, Config config, Optional<HelixManager> helixManager,
- Optional<FlowCatalog> flowCatalog, Optional<TopologyCatalog> topologyCatalog, Orchestrator orchestrator,
- SchedulerService schedulerService, Optional<Logger> log) throws Exception {
+ @Inject
+ public GobblinServiceJobScheduler(@Named(InjectionNames.SERVICE_NAME) String serviceName, Config config,
+ Optional<HelixManager> helixManager, Optional<FlowCatalog> flowCatalog, Optional<TopologyCatalog> topologyCatalog,
+ Orchestrator orchestrator, SchedulerService schedulerService, Optional<Logger> log) throws Exception {
super(ConfigUtils.configToProperties(config), schedulerService);
_log = log.isPresent() ? log.get() : LoggerFactory.getLogger(getClass());
| [GobblinServiceJobScheduler->[startUp->[startUp],scheduleJob->[scheduleJob],onUpdateSpec->[onAddSpec],NonScheduledJobRunner->[run->[runJob]],onAddSpec->[scheduleJob],GobblinServiceJob->[executeImpl->[runJob]],onDeleteSpec->[onDeleteSpec]]] | Creates a GobblinServiceJobScheduler. This method is used to create a new instance of the this service. | Should this be a singleton too? |
@@ -17,6 +17,11 @@ export class HDSegwitP2SHWallet extends AbstractHDWallet {
constructor() {
super();
this.type = 'HDsegwitP2SH';
+ this.preferredBalanceUnit = BitcoinUnit.BTC;
+ }
+
+ getPreferredBalanceUnit() {
+ return this.preferredBalanceUnit || BitcoinUnit.BTC;
}
getTypeReadable() {
| [No CFG could be retrieved] | Provides a class which implements the HD - Segwit - P2SH wallet interface Get the total balance of the account and the total unconfirmed balance of the account. | not needed, we have this in parent |
@@ -212,7 +212,9 @@ public class SystemsController {
try {
// Now we can remove the system
- SystemManager.deleteServer(user, sid);
+ SystemManager systemManager = new SystemManager(ServerFactory.SINGLETON, ServerGroupFactory.SINGLETON,
+ saltApi);
+ systemManager.deleteServer(user, sid);
createSuccessMessage(request.raw(), "message.serverdeleted.param",
Long.toString(sid));
}
| [SystemsController->[getAccessibleChannelChildren->[withServer]]] | Delete a server. | should this manager be a class field or do we need to always create a new instance? |
@@ -216,11 +216,7 @@ PLUGIN_UPDATE_MUTATION = """
],
)
def test_plugin_configuration_update(
- staff_api_client,
- permission_manage_plugins,
- settings,
- active,
- updated_configuration_item,
+ staff_api_client_with_permission, settings, active, updated_configuration_item
):
settings.PLUGINS = ["tests.api.test_extensions.PluginSample"]
| [test_plugin_update_saves_boolean_as_boolean->[get_config_value,get_plugin_configuration],test_plugin_configuration_update->[get_plugin_configuration],test_query_plugin_configuration->[get_plugin_configuration]] | Test if a plugin configuration update is the same as the one in the database. | You change the place of the `PluginSample`. The path should be also changed. |
@@ -154,7 +154,15 @@ def CreateCoreSettings(user_settings):
CreateOperationSettings("nodal_data_value_output",
user_settings["nodal_data_value_settings"]),
CreateOperationSettings("element_data_value_output",
- user_settings["element_data_value_settings"])
+ user_settings["element_data_value_settings"]),
+ CreateOperationSettings("nodal_flag_value_output",
+ user_settings["nodal_flag_value_settings"]),
+ CreateOperationSettings("element_flag_value_output",
+ user_settings["element_flag_value_settings"]),
+ CreateOperationSettings("condition_flag_value_output",
+ user_settings["condition_flag_value_settings"]),
+ CreateOperationSettings("condition_data_value_output",
+ user_settings["condition_data_value_settings"])
]
core_settings[2]["list_of_operations"] = [
CreateOperationSettings("nodal_solution_step_data_output",
| [CreateCoreSettings->[IsDistributed,ValidateAndAssignDefaults,Parameters,ParametersWrapper,CreateOperationSettings],SingleMeshXdmfOutputProcessFactory->[Factory],Factory->[CreateCoreSettings,SingleMeshXdmfOutputProcessFactory]] | Creates a core settings object. Assigns default values to all parameters in the Nested Nested Model Part. Get core settings for all values. | can you please make sure the names match the ones in the VtkOutput? |
@@ -448,9 +448,16 @@ define([
content._hasColors = defined(colors);
content._hasNormals = defined(normals);
content._hasBatchIds = defined(batchIds);
+
+ // Compute an approximation for base resolution in case it isn't given
+ // Assume a uniform distribution of points in the bounding sphere around the tile.
+ var radius = content._tile.contentBoundingVolume.boundingSphere.radius;
+ var sphereVolume = (4.0 / 3.0) * CesiumMath.PI * radius * radius * radius;
+ content._baseResolutionApproximation = Math.cbrt(sphereVolume / pointsLength);
}
var scratchPointSizeAndTilesetTime = new Cartesian2();
+ var scratchGeometricErrorAndDepthMultiplier = new Cartesian2();
var positionLocation = 0;
var colorLocation = 1;
| [No CFG could be retrieved] | Create a list of point cloud properties. Determines if a node has a unicode color or normal. | Will the sphere always be available? Is it better to use a box - if it was provided - since it would be a tighter fit around the tile than a sphere computed around the box? Add a function or property getter to `BoundingSphere` to compute the volume instead of hardcoding it here. |
@@ -138,6 +138,8 @@ class CombineTest(unittest.TestCase):
['aa', 'bbb', 'c', 'dddd'] | combine.Top.Of(3, key=len, reverse=True),
[['c', 'aa', 'bbb']])
+ @unittest.skipIf(sys.version_info[0] > 1, 'deprecated comparator')
+ def test_top_key_py2(self):
# The largest elements compared by their length mod 5.
self.assertEqual(
['aa', 'bbbb', 'c', 'ddddd', 'eee', 'ffffff'] | combine.Top.Of(
| [CombineTest->[test_combine_globally_with_default_side_input->[SideInputCombine],test_per_key_sample->[matcher],test_to_list_and_to_dict->[matcher],test_sharded_top_combine_fn->[test_combine_fn],test_combine_sample_display_data->[individual_test_per_key_dd],test_combine_per_key_top_display_data->[individual_test_per_key_dd]]] | Test top key. | Will `sys.version_info[0] > 1` ever evaluate to False? Should we remove this entirely? |
@@ -125,6 +125,17 @@ public final class RatisHelper {
: RaftGroup.valueOf(DUMMY_GROUP_ID, peers);
}
+ public static RaftGroup newRaftGroup(RaftGroupId groupId,
+ List<DatanodeDetails> peers, List<Integer> priorityList) {
+ final List<RaftPeer> newPeers = new ArrayList<>();
+ for (int i = 0; i < peers.size(); i++) {
+ RaftPeer peer = RatisHelper.toRaftPeer(peers.get(i), priorityList.get(i));
+ newPeers.add(peer);
+ }
+ return peers.isEmpty() ? RaftGroup.valueOf(groupId, Collections.emptyList())
+ : RaftGroup.valueOf(groupId, newPeers);
+ }
+
public static RaftGroup newRaftGroup(RaftGroupId groupId,
Collection<DatanodeDetails> peers) {
final List<RaftPeer> newPeers = peers.stream()
| [RatisHelper->[newRaftClient->[newRaftClient,newRaftGroup,toRaftPeerId,getRpcType],toRaftPeerId->[toRaftPeerIdString],toDatanodeId->[toDatanodeId],createRaftServerProperties->[isClientConfig],newRaftGroup->[emptyRaftGroup,toRaftPeers],toRaftPeers->[toRaftPeers],toRaftPeer->[toRaftPeerAddressString,toRaftPeerId]]] | Creates a new Raft group with the given peers. | sanity check for `peers.size() == priorityList.size()` |
@@ -441,11 +441,10 @@ def topk(input, k):
def lod_tensor_to_array(x, table):
- """This function performs the operation that converts an LOD_Tensor to
- an array.
+ """ Convert a LOD_TENSOR_ARRAY to an TensorArray.
Args:
- x (Variable|list): The tensor that needs to be converted to an array.
+ x (Variable|list): The lod tensor to be converted to a lod tensor array.
table (ParamAttr|list): The variable that stores the level of lod
which is ordered by sequence length in
descending order.
| [IfElseBlockGuard->[__exit__->[__exit__],__enter__->[__enter__],__init__->[block]],DynamicRNN->[_parent_block_->[block],block->[array_write,block,increment,less_than,array_to_lod_tensor],update_memory->[_assert_in_rnn_block_],__init__->[While],output->[_assert_in_rnn_block_,array_write],step_input->[_assert_in_rnn_block_,array_read],memory->[_assert_in_rnn_block_,memory,shrink_memory,array_read]],ConditionalBlock->[complete->[output,block],block->[ConditionalBlockGuard]],StaticRNN->[step->[StaticRNNGuard],output->[step_output],step_input->[_assert_in_rnn_block_],complete_rnn_op->[parent_block,output],step_output->[_assert_in_rnn_block_],memory->[_assert_in_rnn_block_,StaticRNNMemoryLink,memory]],ConditionalBlockGuard->[__exit__->[complete]],While->[complete->[output,block],block->[WhileGuard]],IfElse->[parent_block->[block],true_block->[IfElseBlockGuard],__init__->[ConditionalBlock],output->[parent_block],__call__->[merge_lod_tensor],false_block->[IfElseBlockGuard],input->[parent_block]]] | This function performs the operation that converts an LOD_Tensor to an array. | Should it be `LOD_TENSOR_ARRAY` or `LoDTensor` here |
@@ -60,8 +60,10 @@ class PipelineTranslationOptimizer extends FlinkPipelineTranslator {
@Override
public void visitPrimitiveTransform(TransformHierarchy.Node node) {
+ AppliedPTransform<?, ?, ?> appliedPTransform = node.toAppliedPTransform(pipeline);
Class<? extends PTransform> transformClass = node.getTransform().getClass();
- if (transformClass == Read.Unbounded.class) {
+
+ if (ReadTranslation.isBounded(appliedPTransform) == Enum.UNBOUNDED) {
LOG.info("Found {}. Switching to streaming execution.", transformClass);
translationMode = TranslationMode.STREAMING;
}
| [PipelineTranslationOptimizer->[visitPrimitiveTransform->[info,getClass],getTranslationMode->[isStreaming],getLogger]] | Visit a primitive transform. | @tgroh Is there a better way of getting the `AppliedPTransform` from the `node` here? |
@@ -16,11 +16,12 @@ class TestWikiTablesDatasetReader(AllenNlpTestCase):
question_tokens = ["what", "was", "the", "last", "year", "where", "this", "team", "was",
"a", "part", "of", "the", "usl", "a", "-", "league", "?"]
assert [t.text for t in instance.fields["question"].tokens] == question_tokens
- assert actions == ['@@START@@', 'd', 'd -> [<d,d>, d]', '<d,d> -> M0', 'd -> [<e,d>, e]',
- '<e,d> -> [<<#1,#2>,<#2,#1>>, <d,e>]', '<<#1,#2>,<#2,#1>> -> R',
- '<d,e> -> D1', 'e -> [<r,e>, r]', '<r,e> -> [<<#1,#2>,<#2,#1>>, <e,r>]',
- '<<#1,#2>,<#2,#1>> -> R', '<e,r> -> C0', 'r -> [<e,r>, e]', '<e,r> -> C1',
- 'e -> cell:usl_a_league', '@@END@@']
+ assert actions == ['@@START@@', 'd', 'd -> [<d,d>, d]', '<d,d> -> max', 'd -> [<e,d>, e]',
+ '<e,d> -> [<<#1,#2>,<#2,#1>>, <d,e>]', '<<#1,#2>,<#2,#1>> -> reverse',
+ '<d,e> -> fb:cell.cell.date', 'e -> [<r,e>, r]',
+ '<r,e> -> [<<#1,#2>,<#2,#1>>, <e,r>]', '<<#1,#2>,<#2,#1>> -> reverse',
+ '<e,r> -> fb:row.row.year', 'r -> [<e,r>, e]', '<e,r> -> fb:row.row.league',
+ 'e -> fb:cell.usl_a_league', '@@END@@']
entities = instance.fields['table'].knowledge_graph.get_all_entities()
assert len(entities) == 47
assert 'fb:row.row.year' in entities
| [TestWikiTablesDatasetReader->[test_reader_reads->[fields,read,WikiTablesDatasetReader,len]]] | Test the reading of the Wikitables dataset reads. | Much improved! Can you also do this with the types? @OyvindTafjord had some questions around this - using single lower-case letters for the types means you can only ever have 26 types, right? |
@@ -56,11 +56,13 @@ def test_register_token(raiden_network, token_amount, contract_manager, retry_ti
registry_address = app1.raiden.default_registry.address
- token_address = deploy_contract_web3(
- contract_name=CONTRACT_HUMAN_STANDARD_TOKEN,
- deploy_client=app1.raiden.rpc_client,
- contract_manager=contract_manager,
- constructor_arguments=(token_amount, 2, "raiden", "Rd"),
+ token_address = TokenAddress(
+ deploy_contract_web3(
+ contract_name=CONTRACT_HUMAN_STANDARD_TOKEN,
+ deploy_client=app1.raiden.rpc_client,
+ contract_manager=contract_manager,
+ constructor_arguments=(token_amount, 2, "raiden", "Rd"),
+ )
)
# Wait until Raiden can start using the token contract.
| [test_register_token_insufficient_eth->[get_tokens_list,burn_eth,wait_for_block,token_network_register,get_block_number,deploy_contract_web3,RaidenAPI,raises],test_insufficient_funds->[get,RaidenAPI,isinstance],test_register_token->[Timeout,wait_for_state_change,get_tokens_list,wait_for_block,token_network_register,get_block_number,deploy_contract_web3,RaidenAPI,RuntimeError,raises],test_token_swap->[sleep,wait,assert_synced_channel_state,RaidenAPI],test_deposit_updates_balance_immediately->[get_channelstate,set_total_channel_deposit,RaidenAPI,get_token_network_address_by_token_address,state_from_app],test_funds_check_for_openchannel->[round,joinall,burn_eth,get_required_gas_estimate,RaidenAPI,set,raises,spawn],test_payment_timing_out_if_partner_does_not_respond->[object,wait_for_block,get_block_number,RaidenAPI,join,spawn],test_participant_deposit_amount_must_be_smaller_than_the_limit->[Timeout,wait_for_state_change,get_tokens_list,TokenAddress,TokenAmount,make_address,wait_for_block,BlockNumber,get_block_number,token_network_register,set_total_channel_deposit,deploy_contract_web3,RaidenAPI,RuntimeError,raises,channel_open,fail],test_create_monitoring_request->[get_channelstate_by_token_network_and_partner,create_monitoring_request,state_from_raiden,serialize,RaidenAPI,deserialize,get_token_network_address_by_token_address,state_from_app,create_default_identifier,transfer],test_deposit_amount_must_be_smaller_than_the_token_network_limit->[Timeout,wait_for_state_change,get_tokens_list,TokenAddress,TokenAmount,make_address,wait_for_block,BlockNumber,get_block_number,token_network_register,set_total_channel_deposit,deploy_contract_web3,RaidenAPI,RuntimeError,raises,channel_open,fail],test_token_registered_race->[list,Timeout,wait_for_state_change,get_tokens_list,wait_for_block,token_network_register,get_block_number,deploy_contract_web3,RaidenAPI,RuntimeError],test_transfer_to_unknownchannel->[raises,RaidenAPI],test_api_channel_events->[get_events,any,must_have_event,RaidenAPI,isinstance,transfer],parametrize] | Test registration of a token with the token network. _MAX - max number of keys in the hash table. | same as above for the helper function here and in other parts in this file |
@@ -1430,8 +1430,14 @@ export class AmpStory extends AMP.BaseElement {
this.advancement_.getProgress()
);
}
+ storePageIndex = pageIndex;
}
+ this.storeService_.dispatch(Action.CHANGE_PAGE, {
+ id: targetPageId,
+ index: storePageIndex,
+ });
+
// If first navigation.
if (!oldPage) {
this.registerAndPreloadBackgroundAudio_();
| [AmpStory->[onBookendStateUpdate_->[BOOKEND_ACTIVE,setHistoryState],isBrowserSupported->[Boolean,CSS],initializeMediaQueries_->[forEach,getMediaQueryService,onMediaQueryMatch,getAttribute],isStandalone_->[STANDALONE],onUIStateUpdate_->[DESKTOP_PANELS,VERTICAL,scopedQuerySelectorAll,setImportantStyles,LOAD_END,MOBILE,DESKTOP_FULLBLEED,element,length],maybePreloadBookend_->[CAN_SHOW_BOOKEND],closeOpacityMask_->[dev,toggle],initializeStoryNavigationPath_->[NAVIGATION_PATH,getHistoryState],initializeLiveStory_->[ADD_TO_ACTIONS_WHITELIST,DOM_UPDATE,UI_STATE,DESKTOP_PANELS],onNoPreviousPage_->[dict,CAN_SHOW_PREVIOUS_PAGE_HELP],layoutCallback->[resolve,isBrowserSupported,TOGGLE_SUPPORTED_BROWSER],switchTo_->[DESKTOP_PANELS,setState,isAd,shift,MUTED_STATE,isExperimentOn,removeAttributeInMutate,TOGGLE_AD,ADVANCE_TO_ADS,VISITED,SET_ADVANCEMENT_MODE,UI_STATE,muteAllMedia,NOT_ACTIVE,CHANGE_PAGE,AUTO_ADVANCE_AFTER,PAUSED_STATE,beforeVisible,PLAYING,element,length,resolve,unqueueStepInRAF,AD_SHOWING,TOGGLE_ACCESS,setAttributeInMutate],triggerActiveEventForPage_->[actionServiceForDoc,HIGH],isLandscapeSupported_->[SUPPORTS_LANDSCAPE],getElementDistance->[getDistance],getMaxMediaElementCounts->[min,VIDEO,AUDIO],onAdStateUpdate_->[MUTED_STATE],resumeCallback->[TOGGLE_PAUSED],setOrientationAttribute_->[ORIENTATION],setThemeColor_->[dev,content,name,computedStyle],getInitialPageId_->[findIndex,getHistoryState,parseQueryString,isActualPage,PAGE_ID,element,id,isExperimentOn],pauseCallback->[TOGGLE_PAUSED,PAUSED_STATE],onPausedStateUpdate_->[PLAYING,PAUSED],registerAndPreloadBackgroundAudio_->[upgradeBackgroundAudio,childElement,LOAD_END,tagName],initializeStandaloneStory_->[classList],initializeListeners_->[CURRENT_PAGE_ID,STORY_UNMUTED,AD_STATE,NEXT_PAGE,PREVIOUS_PAGE,MUTED_STATE,getMode,setWhitelist,NO_NEXT_PAGE,PAGE_PROGRESS,STORY_MUTED,BOOKEND_STATE,stopPropagation,MOBILE,preventDefault,UI_STATE,DISPATCH_ACTION,NO_PREVIOUS_PAGE,ADVANCEMENT_MODE,REPLAY,SIDEBAR_STATE,PAUSED_STATE,ACTIONS_WHITELIST,getDetail,actionServiceForDoc,SUPPORTED_BROWSER_STATE,SWITCH_PAGE,debounce],getUIType_->[DESKTOP_PANELS,VERTICAL,DESKTOP_FULLBLEED,MOBILE,isExperimentOn],openOpacityMask_->[dev,toggle],insertPage->[setAttribute,RETURN_TO,PUBLIC_ADVANCE_TO,isAd,ADVANCE_TO,AUTO_ADVANCE_TO,dev,CAN_INSERT_AUTOMATIC_AD,element,id,isExperimentOn],updateStoryNavigationPath_->[NEXT,NAVIGATION_PATH,PREVIOUS,setHistoryState],initializeBookend_->[dict,whenUpgradedToCustomElement,getImpl,createElementWithAttributes],setDesktopPositionAttributes_->[element,escapeCssSelectorIdent,removeAttribute,getPreviousPageId,DESKTOP_POSITION,scopedQuerySelectorAll,prototype,getNextPageId,forEach,push],isLayoutSupported->[CONTAINER],onSidebarStateUpdate_->[TOGGLE_SIDEBAR,actionServiceForDoc,HIGH,execute],initializeListenersForDev_->[getMode,getDetail,DEV_LOG_ENTRIES_AVAILABLE],getPageById->[devAssert],maybeLockScreenOrientation_->[mozLockOrientation,dev,message,lockOrientation,msLockOrientation],hideBookend_->[TOGGLE_BOOKEND],forceRepaintForSafari_->[DESKTOP_PANELS,toggle,UI_STATE],onKeyDown_->[BOOKEND_STATE,RTL_STATE,RIGHT_ARROW,key,LEFT_ARROW,SET_ADVANCEMENT_MODE,MANUAL_ADVANCE],initializePages_->[ADD_TO_ACTIONS_WHITELIST,all,prototype,getImpl,isExperimentOn],buildSystemLayer_->[element,prototype,SET_PAGE_IDS,id],upgradeCtaAnchorTagsForTracking_->[element,scopedQuerySelectorAll,setAttribute,prototype],getPageDistanceMapHelper_->[getAdjacentPageIds],validateConsent_->[tagName,dev,indexOf,childElementByTag,removeChild,forEach,length,childElements],onResize->[TOGGLE_UI,MOBILE,TOGGLE_VIEWPORT_WARNING],initializeStoryAccess_->[hasAttribute,areFirstAuthorizationsCompleted,removeAttribute,user,accessServiceForDocOrNull,onApplyAuthorizations],replay_->[then,BOOKEND_STATE,removeAttributeInMutate,dev,NEXT,VISITED],onAccessApplyAuthorizations_->[element,TOGGLE_ACCESS,NEXT],updateViewportSizeStyles_->[vmin,vmax,vw,max,min,vh,px,/*OK*/],onNoNextPage_->[dict],lockBody_->[setImportantStyles,documentElement,body],maybeTriggerViewportWarning_->[TOGGLE_PAUSED,PAUSED_STATE,TOGGLE_VIEWPORT_WARNING,VIEWPORT_WARNING_STATE],initializeStyles_->[length],rewriteStyles_->[textContent,isExperimentOn],whenPagesLoaded_->[DESKTOP_PANELS,all,filter,LOAD_END,element,UI_STATE],updateAudioIcon_->[TOGGLE_STORY_HAS_BACKGROUND_AUDIO,TOGGLE_STORY_HAS_AUDIO],constructor->[timerFor,forElement,getStoreService,registerServiceBuilder,platformFor,TOGGLE_RTL,isRTL,getVariableService,for,viewerForDoc,getAnalyticsService,createPseudoLocale],isSwipeLargeEnoughForHint_->[abs],next_->[next,devAssert],addPage->[isAd],showBookend_->[TOGGLE_BOOKEND],buildCallback->[setAttribute,nodeType,TEXT_NODE,childNodes,NEXT,TOGGLE_UI,TOGGLE_CAN_SHOW_BOOKEND,GO_TO_PAGE,forEach,SET_ADVANCEMENT_MODE,isExperimentOn],getPagesByDistance_->[isExperimentOn,keys],onSupportedBrowserStateUpdate_->[dev],toggleElementsOnBookend_->[DESKTOP_PANELS,resetStyles,scopedQuerySelectorAll,prototype,setImportantStyles,UI_STATE],previous_->[previous,devAssert],buildPaginationButtons_->[create],performTapNavigation_->[DESKTOP_PANELS,NEXT,PREVIOUS,SET_ADVANCEMENT_MODE,UI_STATE,MANUAL_ADVANCE],preloadPagesByDistance_->[forEach,setDistance],getPageIndexById->[findIndex,user,element],hasBookend_->[components,resolve,CAN_SHOW_BOOKEND,MOBILE,UI_STATE],initializeOpacityMask_->[HIGH,dev,actionServiceForDoc,classList,addEventListener,toggle,execute],installGestureRecognizers_->[HIDDEN,INTERACTIVE_COMPONENT_STATE,state,BOOKEND_STATE,SYSTEM_UI_IS_VISIBLE_STATE,CAN_SHOW_NAVIGATION_OVERLAY_HINT,get,data,event,ACCESS_STATE,SIDEBAR_STATE,onGesture],pauseStoryUntilConsentIsResolved_->[getConsentPolicyState,then,TOGGLE_PAUSED],buildAndPreloadBookend_->[BOOKEND_ACTIVE,getHistoryState],initializeSidebar_->[TOGGLE_HAS_SIDEBAR,ADD_TO_ACTIONS_WHITELIST],layoutStory_->[setState,then,all,NOT_ACTIVE,NEXT,user,build,getHistoryState,BOOKEND_ACTIVE,whenUpgradedToCustomElement,whenBuilt,TOGGLE_BOOKEND,ATTACHMENT_PAGE_ID,isExperimentOn],getPageIndex->[findIndex],onCurrentPageIdUpdate_->[isAd,setHistoryState,PAGE_ID],markStoryAsLoaded_->[INI_LOAD,STORY_LOADED,dispatch],getNextPage->[getNextPageId],getPageContainingElement_->[findIndex,element,closest],BaseElement],VIDEO,registerServiceForDoc,extension,AUDIO,registerElement] | Navigates to the given page in the given direction. Private method for handling page - specific logic. Third and last step contains all the actions that can be delayed after a certain sequence of time. | Just making sure: can moving this have any side effect? |
@@ -32,7 +32,7 @@ class LobbyPropertyFileParser {
@VisibleForTesting
static final String YAML_ERROR_MESSAGE = "error_message";
- public static LobbyServerProperties parse(final String fileContents, final Version currentVersion) {
+ public static LobbyServerProperties parse(final InputStream fileContents, final Version currentVersion) {
final Map<String, Object> yamlProps =
OpenJsonUtils.toMap(matchCurrentVersion(loadYaml(fileContents), currentVersion));
| [LobbyPropertyFileParser->[parse->[build,matchCurrentVersion,toMap,loadYaml],matchCurrentVersion->[checkNotNull,getJSONObject,orElse],loadYaml->[loadAs,JSONArray,Yaml]]] | Parse lobby server properties from file contents. | Suggest renaming `fileContents` since the type changed. (No need to get fancy here: `stream` or `is` would be sufficient.) |
@@ -37,10 +37,12 @@ public class TypedProperties extends Properties implements Serializable {
super(defaults);
}
- private void checkKey(String property) {
- if (!containsKey(property)) {
+ private boolean checkKey(String property) {
+ Set<String> keys = super.stringPropertyNames();
+ if (!keys.contains(property)) {
throw new IllegalArgumentException("Property " + property + " not found");
}
+ return true;
}
public String getString(String property) {
| [TypedProperties->[getLong->[checkKey],getInteger->[checkKey],getBoolean->[checkKey],getDouble->[checkKey],getString->[checkKey]]] | check if the given property is in the cache and return the value. | `checkKey` would be rename to `containsKey` |
@@ -508,6 +508,11 @@ class MfemCmake(CMakePackage, CudaPackage):
cfg.write(cmake_cache_entry("CMAKE_CUDA_COMPILER",
cudacompiler))
+ # JBE: CudaPackage will set this in the environment which overrides
+ # anything else - is this related to https://github.com/spack/spack/issues/17823 ??
+ if '+mpi' in spec:
+ env['CUDAHOSTCXX'] = spec['mpi'].mpicxx
+
if spec.satisfies('cuda_arch=none'):
cfg.write("# No cuda_arch specified in Spack spec, this is likely to fail\n\n")
else:
| [MfemCmake->[cmake_args->[_get_host_config_path],hostconfig->[ld_flags_from_library_list->[is_sys_lib_path],ld_flags_from_dirs->[is_sys_lib_path],on_off,cmake_cache_option,cmake_cache_string,_get_host_config_path,cmake_cache_entry,ld_flags_from_library_list,get_spec_path],_get_host_config_path->[_get_sys_type]]] | Returns a string that can be used to configure a node in the MFEM. Create a config file that contains a sequence of objects. Write out the contents of the cmake cache file. Add flags and flags to the cuda cache file. | What is happening here? Does this need to be done because otherwise the host compiler will be set not to the mpi compiler? |
@@ -172,6 +172,17 @@ class WPSEO_Schema_Context {
if ( $this->site_represents === 'company' ) {
$this->company_name = WPSEO_Options::get( 'company_name' );
+ // Do not use a non-named company.
+ if ( empty( $this->company_name ) ) {
+ $this->site_represents = false;
+ }
+ else {
+ $this->company_logo_id = WPSEO_Image_Utils::get_attachment_id_from_settings( 'company_logo' );
+ // This is not a false check due to how `get_attachment_id_from_settings` works.
+ if ( $this->company_logo_id < 1 ) {
+ $this->site_represents = false;
+ }
+ }
}
if ( $this->site_represents === 'person' ) {
| [WPSEO_Schema_Context->[build_data->[set_site_represents_reference,canonical,set_breadcrumbs_variables,metadesc,set_site_name,set_site_represents_variables,title],__construct->[build_data]]] | Sets the site represent variables. | The method set_site_represents_variables uses an else expression. Else is never necessary and you can simplify the code to work without else. |
@@ -255,12 +255,7 @@ function _mapDispatchToProps(dispatch: Function, ownProps): Object {
*
* @param {Object} state - Redux state.
* @param {Props} ownProps - Properties of component.
- * @returns {{
- * _audioTrack: Track,
- * _largeVideo: Object,
- * _styles: StyleType,
- * _videoTrack: Track
- * }}
+ * @returns {Object}
*/
function _mapStateToProps(state, ownProps) {
// We need read-only access to the state of features/large-video so that the
| [No CFG could be retrieved] | Function that maps parts of state tree into component props. | I really like these renames. I think they better represent what the component uses the info for. |
@@ -62,10 +62,12 @@
'<label class="required" for="' + input_id + '">' + I18n.t('attributes.filename') + '</label>' +
'<input type="text" required="required" name="assignment[assignment_files_attributes][' +
new_id + '][filename]" id="' + input_id + '"class="assignment_file" />' +
- '<a onclick="remove_assignment_file(\''+input_id+'\'); return false;">' +
- I18n.t('delete') + '</a></p>';
+ '<a id="remove-assignment-file-'+new_id+'">' + I18n.t('delete') + '</a></p>';
$('#assignment_files').append($(assignment_file));
-
+ $('#remove-assignment-file-'+new_id).click((e) => {
+ remove_assignment_file(input_id);
+ e.preventDefault();
+ })
$('#only_required_files_option').removeClass('disable');
document.getElementById('assignment_assignment_properties_attributes_only_required_files').disabled = false;
}
| [No CFG could be retrieved] | Adding and removing assignment files Adds periods to an existing . | This is a bit unrelated but can you add the `small-indent` class here as well? |
@@ -133,7 +133,7 @@ func newDestroyCmd() *cobra.Command {
"Display operation as a rich diff showing the overall change")
cmd.PersistentFlags().IntVarP(
¶llel, "parallel", "p", defaultParallel,
- "Allow P resource operations to run in parallel at once (1 for no parallelism, 0 for unbounded parallelism)")
+ "Allow P resource operations to run in parallel at once (1 for no parallelism). Defaults to unbounded.")
cmd.PersistentFlags().BoolVarP(
&refresh, "refresh", "r", false,
"Refresh the state of the stack's resources before this update")
| [GetGlobalColorization,New,RunFunc,StringSliceVar,IntVarP,StringVarP,Destroy,Wrap,Interactive,BoolVarP,PersistentFlags,BoolVar] | Flags for the specific resource stack to operate on. Flags for the preview. | Can we keep the command-line option's behavior the same and just tweak this internally? |
@@ -44,7 +44,10 @@ trait SyncsModels
foreach ($existing as $exist_key => $exist_value) {
if ($models->offsetExists($exist_key)) {
- // update
+ // update or restore soft-deleted model
+ if ($exist_value->trashed()) {
+ $exist_value->restore();
+ }
$exist_value->fill($models->get($exist_key)->getAttributes())->save();
} else {
// delete
| [syncModels->[getCompositeKey,offsetExists,diffKeys,merge,saveMany,save,forget,delete],fillNew->[getCompositeKey,get,fill,getAttributes,put]] | Sync models with the device and relationship. | Does anything bad happen if you just call restore on a non-trashed model? |
@@ -458,6 +458,17 @@ function stats_admin_path() {
return Jetpack::module_configuration_url( __FILE__ );
}
+/**
+ * Loads Jetpack stats widget for the WordPress dashboard.
+ *
+ * @access public
+ * @return void
+ */
+function wp_dashboard_widget() {
+ require_once __DIR__ . '/stats/class-jetpack-stats-dashboard-widget.php';
+ Jetpack_Stats_Dashboard_Widget::init();
+}
+
/**
* Stats Reports Load.
*
| [stats_template_redirect->[is_staging_site],stats_print_wp_remote_error->[get_error_messages,get_error_codes],stats_admin_bar_menu->[add_menu],stats_build_view_data->[get_queried_object],stats_reports_page->[record_user_event],jetpack_stats_post_table->[is_user_connected]] | Get the path to the stats administration page. | It may be best to prefix this with `jetpack_` to avoid conflicts with other plugins, since this file doesn't use a namespace. |
@@ -506,11 +506,11 @@ public class ProCombatMoveAI {
// Determine counter attack results to see if I can hold it
final ProBattleResult result2 =
- battleUtils.calculateBattleResults(player, t, patd.getMaxEnemyUnits(), remainingUnitsToDefendWith,
+ ProBattleUtils.calculateBattleResults(player, t, patd.getMaxEnemyUnits(), remainingUnitsToDefendWith,
enemyAttackOptions.getMax(t).getMaxBombardUnits(), false);
final boolean canHold =
(!result2.isHasLandUnitRemaining() && !t.isWater()) || (result2.getTUVSwing() < 0)
- || (result2.getWinPercentage() < MIN_WIN_PERCENTAGE);
+ || (result2.getWinPercentage() < ProData.minWinPercentage);
patd.setCanHold(canHold);
ProLogger
.debug(t + ", CanHold=" + canHold + ", MyDefenders=" + remainingUnitsToDefendWith.size()
| [ProCombatMoveAI->[prioritizeAttackOptions->[compare->[compare]],doMove->[doMove]]] | Determines which territories can be held and whether they can be held. This method is called to determine if the attack can be held. This method is called when there are no enemy counter attackers. | Same here, see if ProData could compute this for you, "public static boolean canHold( result )" (This would also make the logic very testable too!) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.