patch stringlengths 18 160k | callgraph stringlengths 4 179k | summary stringlengths 4 947 | msg stringlengths 6 3.42k |
|---|---|---|---|
@@ -428,10 +428,8 @@ class MyPkg(ConanFile):
client.save({"conanfile.py": new_recipe})
client.run("create . frodo/stable")
# upload recipe and packages
- error = client.run("upload Hello0/1.2.1@frodo/stable --all --no-overwrite recipe",
- ignore_error=True)
+ client.run("upload Hello0/1.2.1@frodo/stable --all --no-overwrite recipe", assert_error=True)
if not client.revisions:
- self.assertTrue(error)
self.assertIn("Forbidden overwrite", client.out)
self.assertNotIn("Uploading package", client.out)
| [UploadTest->[skip_upload_test->[_client],upload_modified_recipe_test->[_client],upload_login_prompt_disabled_no_user_test->[_client],corrupt_upload_test->[_client],upload_without_sources_test->[_client],query_upload_test->[_client],no_overwrite_argument_collision_test->[_client],upload_login_prompt_disabled_user_not_authenticated_test->[_client],upload_unmodified_recipe_test->[_client],upload_login_prompt_disabled_user_authenticated_test->[_client],broken_sources_tgz_test->[_client],upload_no_overwrite_recipe_test->[_client],upload_no_overwrite_all_test->[_client],pattern_upload_test->[_client],upload_unmodified_package_test->[_client],broken_package_tgz_test->[_client]]] | Test for upload_no_overwrite_recipe. Upload a single package and a recipe. | Here there was a check for an error only `if not client.revisions`, please recheck this test. The `run` command may have to be moved inside the `if` clause with different values for `assert_error`. |
@@ -103,4 +103,8 @@ public class AdapterTest {
assertNull(automationService.getAdaptedValue(ctx, null, Void.class));
}
+ @Test
+ public void souldAdaptContext() throws Exception {
+ assertEquals(ctx, automationService.getAdaptedValue(ctx, null, OperationContext.class));
+ }
}
| [AdapterTest->[initRepo->[OperationContext,save,getDocument,createDocument,setPropertyValue,createDocumentModel,getRef],shouldAdaptArrayStringAsStringList->[assertNotNull,assertTrue,size,getAdaptedValue,contains,assertEquals],souldAdaptNullValue->[getAdaptedValue,assertNull],setup->[OperationContext],shouldAdaptArrayStringAsDocumentModelList->[assertNotNull,assertTrue,size,getAdaptedValue,getTitle,toString,getId,assertEquals]]] | Test if the value of the managed property is null. | sould -> should. |
@@ -184,9 +184,10 @@ return [
],
'/notification' => [
- '[/]' => [Module\Notifications\Notification::class, [R::GET]],
- '/view/{id:\d+}' => [Module\Notifications\Notification::class, [R::GET]],
- '/mark/all' => [Module\Notifications\Notification::class, [R::GET]],
+ '[/]' => [Module\Notifications\Notification::class, [R::GET]],
+ '/view/{id:\d+}' => [Module\Notifications\Notification::class, [R::GET]],
+ '/mark/all' => [Module\Notifications\Notification::class, [R::GET]],
+ '/action/{id:\d+}' => [Module\Notifications\Notification::class, [ R::POST]],
],
'/objects/{guid}' => [Module\Objects::class, [R::GET]],
| [No CFG could be retrieved] | List of all modules in the modexp hierarchy. The list of modules that can be loaded. | The `/view/{id:\d+}` and `/action/{id:\d+}` routes can be combined in a single `/(id:\d+}` route that accepts GET and POST. |
@@ -34,10 +34,16 @@ func (c *Container) readFromJournal(ctx context.Context, options *logs.LogOption
var config journal.JournalReaderConfig
if options.Tail < 0 {
config.NumFromTail = 0
+ } else if options.Tail == 0 {
+ config.NumFromTail = math.MaxUint64
} else {
config.NumFromTail = uint64(options.Tail)
}
- config.Formatter = journalFormatter
+ if options.Multi {
+ config.Formatter = journalFormatterWithID
+ } else {
+ config.Formatter = journalFormatter
+ }
defaultTime := time.Time{}
if options.Since != defaultTime {
// coreos/go-systemd/sdjournal doesn't correctly handle requests for data in the future
| [Write->[NewLogLine],readFromJournal->[ID,Before,Done,Error,NewLogLine,Now,Close,Errorf,Read,NewJournalReader,Rewind,Since,Add,Follow,Debugf],Unix,Format,Sprintf,Errorf,TrimSpace] | readFromJournal reads a container from the journal. read bytes from the file. | OK, I'll fess up to my ignorance. What does the minus `-` sign do here? |
@@ -140,10 +140,10 @@ export function Youtube({
'*'
);
}
- if (data.event == 'infoDelivery' && playerState != undefined) {
+ if (event == 'infoDelivery' && playerState != undefined) {
dispatchVideoEvent(currentTarget, PlayerStates[playerState.toString()]);
}
- if (data.event == 'infoDelivery' && info['muted']) {
+ if (event == 'infoDelivery' && info['muted']) {
dispatchVideoEvent(currentTarget, mutedOrUnmutedEvent(info['muted']));
return;
}
| [No CFG could be retrieved] | Creates a video object that can be played by a user. Get embed url for a specific . | Can we pull out some of these string literals into an event enum? |
@@ -182,7 +182,10 @@ public class LogicalPlanner {
return buildOutputNode(currentNode);
}
- public OutputNode buildPullLogicalPlan(final PullPlannerOptions pullPlannerOptions) {
+ public OutputNode buildPullLogicalPlan(
+ final QueryPlannerOptions queryPlannerOptions,
+ final boolean isScalablePush
+ ) {
final boolean isWindowed = analysis
.getFrom()
.getDataSource()
| [LogicalPlanner->[getSinkTopic->[getWindowInfo],buildJoin->[buildJoin,prepareSourceForJoin],buildAggregateNode->[getTargetSchema],isInnerNode->[isInnerNode],prepareSourceForJoin->[prepareSourceForJoin,buildInternalProjectNode,buildInternalRepartitionNode],RewrittenAggregateAnalysis->[getAggregateFunctions->[getAggregateFunctions],getAggregateFunctionArguments->[getAggregateFunctionArguments],getHavingExpression->[getHavingExpression],getRequiredColumns->[getRequiredColumns]],getWindowInfo->[getWindowInfo]]] | Builds a persistent logical plan. This method creates a node that represents a source or a project node. | looks like we're now sharing this method across push/pull - we should probably rename. Though another issue is that it seems a little odd the way we use the queryPlannerOptions because (1) we're hardcoding the two methods to return true (2) some of the configurations (i.e. `getTableScansEnabled`) don't really make sense in the context of push queries and (3) some of the configs are historically named specifically with pull queries in mind (`pull.query.interprerter` or whatever) |
@@ -75,8 +75,12 @@ func setupBuildEnv(build *buildapi.Build, pod *kapi.Pod) {
default:
// Do nothing for unknown source types
}
- vars = append(vars, kapi.EnvVar{"OUTPUT_IMAGE", build.Parameters.Output.ImageTag})
- vars = append(vars, kapi.EnvVar{"OUTPUT_REGISTRY", build.Parameters.Output.Registry})
+
+ if registry, namespace, name, tag, err := imageapi.SplitDockerPullSpec(build.Parameters.Output.DockerImageReference); err == nil {
+ outputImage := imageapi.JoinDockerPullSpec("", namespace, name, tag)
+ vars = append(vars, kapi.EnvVar{"OUTPUT_IMAGE", outputImage})
+ vars = append(vars, kapi.EnvVar{"OUTPUT_REGISTRY", registry})
+ }
if len(pod.Spec.Containers) > 0 {
pod.Spec.Containers[0].Env = append(pod.Spec.Containers[0].Env, vars...)
| [IsNotExist,Getenv,Join,Stat] | Add environment variables to the container in the pod spec. | Is there anything useful to do if err != nil? |
@@ -437,7 +437,14 @@ func (s *server) configRenderer() (ConfigRenderer, error) {
return "", errors.Wrapf(err, "could not converge %s configuration to TOML", service.Name())
}
- if usesPlatformScaffolding(service) {
+ pkgsMeta := make([]*product.PackageMetadata, 0, len(s.deployment.ExpectedServices))
+ for _, e := range s.deployment.ExpectedServices {
+ if metadata := services.MetadataForPackage(e.Name()); metadata != nil {
+ pkgsMeta = append(pkgsMeta, metadata)
+ }
+ }
+
+ if usesPlatformScaffolding(service, pkgsMeta) {
return fmt.Sprintf("%s\n%s", string(bytes), platformConfigToml), nil
} else {
return string(bytes), nil
| [DeploySome->[newEventSender,doDeploySome,HasConfiguredDeployment],ServiceVersions->[HasConfiguredDeployment],startConverge->[buildDesiredState],Deploy->[newEventSender,HasConfiguredDeployment],StartNonDataServices->[newEventSender,HasConfiguredDeployment],readAndValidate->[readDeploymentServiceCerts,validateCerts],RemoveSome->[doRemoveSome,HasConfiguredDeployment],Stop->[shutItAllDown],Preload->[newEventSender,HasConfiguredDeployment],DeployDataServices->[newEventSender,HasConfiguredDeployment],DeployStatus->[HasConfiguredDeployment],ensureStatus->[Status],initDeploymentFromDB->[persistDeployment],doDeploySome->[Deploy,waitForConverge,startConverge,ensureCerts],doConverge->[Deploy,ensureStatus,startConverge,waitForConverge],doPreload->[Deploy,waitForConverge,startConverge,ensureCerts],Upgrade->[persistDeployment,newEventSender,doConverge,HasConfiguredDeployment],reloadBackupRunner->[configRenderer],Status->[Status,HasConfiguredDeployment],doRemoveSome->[newEventSender,convergeServices],readOrGenDeploymentServiceCerts->[readAndValidate,genDeploymentServiceCerts,target],convergeDeployment->[nextManifest,convergeServices],nextManifest->[shouldFetchManifest],updateExpectedServices->[persistDeployment],maybeApplyLicense->[applyLicense],Deploy] | configRenderer returns a function that can be used to render the configuration for a given service. cant be null. | why do we need to gather all the metadatas every time for each service? Can we just grab `services.MetadataForPackage(service.Name())`? Or maybe `services.UsesPlatformScaffolding(service.Name())`? |
@@ -208,7 +208,15 @@ public class RegistryProtocol implements Protocol {
// url to registry
final Registry registry = getRegistry(registryUrl);
- final URL registeredProviderUrl = getUrlToRegistry(providerUrl, registryUrl);
+
+ URL regUrl = getUrlToRegistry(providerUrl, registryUrl);
+
+ String dockerHostBind = ConfigUtils.getSystemProperty(DOCKER_DUBBO_IP_TO_BIND);
+ if (null != dockerHostBind) {
+ regUrl = regUrl.setHost(dockerHostBind);
+ }
+ final URL registeredProviderUrl = regUrl;
+
// decide if we need to delay publish
boolean register = providerUrl.getParameter(REGISTER_KEY, true);
| [RegistryProtocol->[getCacheKey->[getProviderUrl],getServers->[getServers],ProviderConfigurationListener->[overrideUrl->[getConfigedInvokerUrl],notifyOverrides->[doOverrideIfNecessary]],reExport->[export,reExport],export->[registerStatedUrl,register],DestroyableExporter->[unexport->[unexport],getInvoker->[getInvoker]],InvokerDelegate->[getInvoker->[getInvoker]],getStatedUrl->[getStatedUrl],doCreateInvoker->[setProtocol,register],ExporterChangeableWrapper->[unexport->[getCacheKey,getRegistry,unexport,getRegistryUrl],getInvoker->[getInvoker]],getRegistryUrl->[setProtocol],OverrideListener->[doOverrideIfNecessary->[getCacheKey,reExport,getInvoker,getProviderUrl,getConfigedInvokerUrl]],reRefer->[reRefer],ServiceConfigurationListener->[overrideUrl->[getConfigedInvokerUrl],notifyOverrides->[doOverrideIfNecessary]],refer->[getRegistry,getRegistryUrl],getRegistry->[getRegistry],register->[register],doLocalExport->[export]]] | Exports a single object. | I think The `DUBBO_IP_TO_BIND` and `DUBBO_IP_TO_REGISTRY` jvm properties have already covered this scenario. |
@@ -224,7 +224,7 @@ def _maxwell_filter(raw, origin='auto', int_order=8, ext_order=3,
head_pos=None, st_fixed=True, st_only=False,
mag_scale=100.,
skip_by_annotation=('edge', 'bad_acq_skip'),
- reconstruct='in', verbose=None):
+ reconstruct='in', proc_msg=True, verbose=None):
# There are an absurd number of different possible notations for spherical
# coordinates, which confounds the notation for spherical harmonics. Here,
# we purposefully stay away from shorthand notation in both and use
| [_trans_sss_basis->[_sss_basis],find_bad_channels_maxwell->[_maxwell_filter,_get_mf_picks,_get_coil_scale],_get_grad_point_coilsets->[_prep_mf_coils],_regularize_in->[_get_degrees_orders,_regularize_out],_sss_basis_basic->[_get_mag_mask,_concatenate_sph_coils,_sph_harm_norm],_compute_sphere_activation_in->[_sq],_overlap_projector->[_orth_overwrite]] | Filter a sequence of objects based on a maximum well - defined filter. Get a single chunk of data from the network. Missing residue in a Megree - like system. Construct raw file object with missing data. | what's the difference between proc_msg and verbose? |
@@ -120,7 +120,7 @@ namespace Microsoft.Extensions.FileSystemGlobbing.Abstractions
/// <remarks>
/// Equals the value of <seealso cref="System.IO.DirectoryInfo.Parent" />.
/// </remarks>
- public override DirectoryInfoBase ParentDirectory
- => new DirectoryInfoWrapper(_directoryInfo.Parent);
+ public override DirectoryInfoBase? ParentDirectory
+ => _directoryInfo.Parent == null ? null : new DirectoryInfoWrapper(_directoryInfo.Parent);
}
}
| [DirectoryInfoWrapper->[EnumerateFileSystemInfos->[EnumerateFileSystemInfos]]] | Creates a DirectoryInfoBase that represents the parent directory of the current DirectoryInfo. | I don't think we should be changing behavior here. |
@@ -519,11 +519,16 @@ class Job(object):
class DataflowApplicationClient(object):
+ _HASH_CHUNK_SIZE = 1024 * 8
+ _GCS_CACHE_PREFIX = "artifact_cache"
"""A Dataflow API client used by application code to create and query jobs."""
- def __init__(self, options):
+ def __init__(self, options, root_staging_location=None):
"""Initializes a Dataflow API client object."""
self.standard_options = options.view_as(StandardOptions)
self.google_cloud_options = options.view_as(GoogleCloudOptions)
+ self._enable_caching = self.google_cloud_options.enable_artifact_caching
+ self._root_staging_location = (
+ root_staging_location or self.google_cloud_options.staging_location)
if _use_fnapi(options):
self.environment_version = _FNAPI_ENVIRONMENT_MAJOR_VERSION
| [translate_distribution->[to_split_int],translate_value->[to_split_int],_LegacyDataflowStager->[stage_artifact->[_gcs_file_copy]],_get_required_container_version->[_get_container_image_tag],get_runner_harness_container_image->[_get_container_image_tag],Environment->[__init__->[Environment]],get_container_image_from_options->[_use_fnapi],DataflowApplicationClient->[create_job->[json,stage_file],_apply_sdk_environment_overrides->[_update_container_image_for_dataflow],create_job_description->[Environment,stage_file,_apply_sdk_environment_overrides,_stage_resources],modify_job_state->[Job]],Step->[get_output->[_get_outputs],__init__->[Step]],Job->[default_job_name->[_build_default_job_name],__init__->[default_job_name,Job],__str__->[decode_shortstrings->[encode_shortstrings]]]] | Initializes a Dataflow API client object. | Why do we need an additional param? I am not seeing usage of custom `root_staging_location` in the PR and this is an internal module. |
@@ -126,6 +126,6 @@ def test_io_set():
warnings.simplefilter('always')
assert_raises(NotImplementedError, read_epochs_eeglab,
bad_epochs_fname)
- assert_equal(len(w), 3)
+ assert_equal(len(w), 1)
run_tests_if_main()
| [test_io_set->[_TempDir,catch_warnings,assert_raises,filter,savemat,copyfile,join,loadmat,simplefilter,get_data,assert_equal,epochs,read_epochs_eeglab,_test_raw_reader,assert_array_equal,find_events,len,_read_eeglab_events,read_raw_eeglab,write_events,Epochs],simplefilter,run_tests_if_main,data_path,join,requires_version] | Test import of the EEGLAB. set file. Test if two events have the same number of events and event_ids. read raw file with one event Missing object. | oh wait, I forgot you haven't updated the test yet ... |
@@ -108,6 +108,13 @@ class TestTypeof(ValueTypingTestBase, TestCase):
a4.flags.writeable = False
check(a4, 0, 'C', False, True)
+ # Unsupported dtype
+ a5 = a1.astype(a1.dtype.newbyteorder())
+ with self.assertRaises(ValueError) as raises:
+ typeof(a5)
+ self.assertIn("Unsupported array dtype: %s" % (a5.dtype,),
+ str(raises.exception))
+
@tag('important')
def test_structured_arrays(self):
def check(arr, dtype, ndim, layout, aligned):
| [TestTypeof->[test_structured_arrays->[check],test_custom->[Custom],test_array_values->[check]],TestFingerprint->[test_arrays->[add,DistinctChecker],test_ints->[add],test_dtype->[add,DistinctChecker],test_buffers->[add,DistinctChecker],test_tuples->[add,DistinctChecker],test_lists->[add,DistinctChecker],test_sets->[add,DistinctChecker]],DistinctChecker->[add->[add]]] | Test array values with nanoseconds. read - only version of from_struct_dtype. | Would `assertRaisesRegex(p)` do the same? |
@@ -69,6 +69,18 @@ public interface RestClient extends Closeable {
*/
RestClientConfiguration getConfiguration();
+ CompletionStage<RestResponse> metrics();
+
+ CompletionStage<RestResponse> metrics(String path);
+
+ CompletionStage<RestResponse> metrics(boolean openMetrics);
+
+ CompletionStage<RestResponse> metrics(String path, boolean openMetrics);
+
+ CompletionStage<RestResponse> metricsMetadata();
+
+ CompletionStage<RestResponse> metricsMetadata(String path);
+
/**
* Creates a {@link RestClient} instance based on the supplied configuration
*
| [forConfiguration->[RestClientOkHttp]] | Get the configuration for the client. | Maybe we can move this to a RestMetricsClient interface. Since this module is experimental, no need to worry about backwards-compatibility. i.e. it can be done in 10.1 |
@@ -66,13 +66,10 @@ namespace Microsoft.Extensions.FileSystemGlobbing
/// Gets a hash for the file pattern match.
/// </summary>
/// <returns>Some number</returns>
- public override int GetHashCode()
- {
- var hashCodeCombiner = HashCodeCombiner.Start();
- hashCodeCombiner.Add(Path, StringComparer.OrdinalIgnoreCase);
- hashCodeCombiner.Add(Stem, StringComparer.OrdinalIgnoreCase);
+ public override int GetHashCode() =>
+ HashHelpers.Combine(GetHashCode(Path), GetHashCode(Stem));
- return hashCodeCombiner;
- }
+ private static int GetHashCode(string value) =>
+ value != null ? StringComparer.OrdinalIgnoreCase.GetHashCode(value) : 0;
}
}
| [FilePatternMatch->[GetHashCode->[OrdinalIgnoreCase,Start,Add],Equals->[OrdinalIgnoreCase,Path,Stem,Equals]]] | Get hashCode of this path and stem. | Do we have good test coverage for edge-cases of Equals/GetHashCode to make sure they agree? Not seeing anything that stands out as buggy here but want to understand how much we should scrutinize. |
@@ -360,7 +360,7 @@ FILE *cf_popen(const char *command, const char *type, bool capture_stderr)
}
}
- CloseChildrenFD();
+ CloseChildrenFDUnsafe();
argv = ArgSplitCommand(command);
| [No CFG could be retrieved] | This function is a wrapper for the standard library s exec function. It is called by the Opens a file descriptor for a child process and sets its uid and gid. | Hmmm the code after this in some error conditions returns NULL instead of doing `_exit()` or `exec()`, so calling this unsafe function could be troublesome. TODO investigate. |
@@ -1005,6 +1005,7 @@ def review(request, addon, channel=None):
form=form,
has_versions_pending_rejection=has_versions_pending_rejection,
is_admin=is_admin,
+ language_dict=dict(settings.LANGUAGES),
latest_not_disabled_version=latest_not_disabled_version,
latest_version_is_unreviewed_and_not_pending_rejection=(
version
| [leaderboard->[context],queue_extension->[_queue],queue_recommended->[_queue],performance->[_sum,context],ReviewAddonVersionDraftCommentViewSet->[get_object->[_verify_object_permissions,get_queryset],get_extra_comment_data->[get_version_object],get_serializer_context->[get_extra_comment_data,get_version_object],get_version_object->[_verify_object_permissions,get_addon_object]],review->[determine_channel,context],queue_auto_approved->[_queue],queue_pending_rejection->[_queue],queue_scanners->[_queue],ReviewAddonVersionViewSet->[list->[get_queryset]],abuse_reports->[context],_queue->[is_admin_reviewer,filter_admin_review_for_legacy_queue,context],ReviewAddonVersionMixin->[check_permissions->[get_addon_object]],eula->[policy_viewer],whiteboard->[determine_channel],fetch_queue_counts->[construct_count_queryset_from_sql_model->[filter_admin_review_for_legacy_queue],construct_count_queryset_from_sql_model,construct_count_queryset_from_queryset],queue_content_review->[_queue],policy_viewer->[determine_channel],queue_theme_nominated->[_queue],privacy->[policy_viewer],AddonReviewerViewSet->[deny_resubmission->[deny_resubmission],allow_resubmission->[allow_resubmission]],save_motd->[context],dashboard->[context],queue_theme_pending->[_queue],ratings_moderation_log->[context],queue_moderated->[context],unlisted_list->[_queue],motd->[context],ReviewAddonVersionCompareViewSet->[retrieve->[get_objects,get_serializer],get_objects->[filter_queryset,get_queryset,check_object_permissions],get_serializer->[get_serializer_context]],ratings_moderation_log_detail->[context],queue_mad->[_queue],reviewlog->[context]] | Show a page of the version of a given add - on. Get all versions related to a specific . Find a version of a specific and return it. A verdict is a verdict if it was locked by a reviewer or auto - A function to get the verdict of a version. | Maybe also needed in `AbuseReportAdmin:addon_card()` and `abuse_reports()` views ? Those re-use (directly or indirectly) the template |
@@ -55,3 +55,10 @@ class AttributeInputType:
]
# list the input types that cannot be assigned to a variant
NON_ASSIGNABLE_TO_VARIANTS = [MULTISELECT]
+
+
+class AttributeType:
+ PRODUCT = "product"
+ PAGE = "page"
+
+ CHOICES = [(PRODUCT, "Product"), (PAGE, "Page")]
| [ProductAvailabilityStatus->[get_display->[NotImplementedError]],VariantAvailabilityStatus->[get_display->[NotImplementedError]]] | list the input types that cannot be assigned to a variant. | Maybe we should name it `PRODUCT_TYPE` instead of `PRODUCT` |
@@ -51,6 +51,7 @@ namespace System.ComponentModel
/// to the corresponding property on the object. If there is no matching
/// property the resource will be ignored.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public void ApplyResources(object value, string objectName) => ApplyResources(value, objectName, null);
/// <summary>
| [ComponentResourceManager->[ApplyResources->[ApplyResources],FillResources->[FillResources]]] | Apply resources to the given object. | NIT: Share the string of both of these API's attributes? |
@@ -7,5 +7,9 @@ OrderEventsEmailsEnum = graphene.Enum.from_enum(OrderEventsEmails)
class OrderStatusFilter(graphene.Enum):
- READY_TO_FULFILL = 'READY_TO_FULFILL'
- READY_TO_CAPTURE = 'READY_TO_CAPTURE'
+ READY_TO_FULFILL = 'ready_to_fulfill'
+ READY_TO_CAPTURE = 'ready_to_capture'
+ UNFULFILLED = 'unfulfilled'
+ PARTIALLY_FULFILLED = 'partially fulfilled'
+ FULFILLED = 'fulfilled'
+ CANCELED = 'canceled'
| [from_enum] | OrderStatusFilter - Filter for OrderStatus. | Do we want space (` `) here? |
@@ -292,6 +292,14 @@ public class DruidSchema extends AbstractSchema
initializationLatch.await();
}
+ public void initializeViews(PlannerFactory factory) {
+ // HACK: Manually inject dependency. Need to discuss with community on how to break the circular
+ // dependency between DruidSchema and PlannerFactory that is currently needed
+ if(viewManager instanceof MetadataStoredViewManager) {
+ ((MetadataStoredViewManager)viewManager).setPlannerFactory(factory);
+ }
+ }
+
@Override
protected Map<String, Table> getTableMap()
{
| [DruidSchema->[getFunctionMultimap->[build,put,entrySet,builder],removeSegment->[remove,debug,notifyAll,info,get,getDataSource,isEmpty,add,getIdentifier],buildDruidTable->[TableDataSource,getRowOrder,build,get,DruidTable,values,builder,forEach,getColumnType,putIfAbsent],segmentRemoved->[removeSegment],runSegmentMetadataQuery->[getOnlyElement,SegmentMetadataQuery,of,TableDataSource,toList,MultipleSpecificSegmentSpec,AllColumnIncluderator,noneOf,runSimple,collect,toSet],timelineInitialized->[notifyAll],start->[run->[notifyAll,max,equals,refreshSegments,getRowSignature,addAll,warn,info,put,countDown,add,emit,isInterrupted,getDataSource,isEmpty,getMillis,buildDruidTable,debug,difference,wait,currentTimeMillis,forEach,clear],Runnable,submit],stop->[shutdownNow],awaitInitialization->[await],segmentAdded->[addSegment],refreshSegments->[getValue,getKey,addAll,refreshSegmentsForDataSource,add,entrySet],addSegment->[remove,debug,notifyAll,get,segmentReplicatable,setSegmentSignature,getDataSource,add,getIdentifier,containsKey],getTableMap->[copyOf],setSegmentSignature->[put],analysisToRowSignature->[isError,build,getKey,getType,toUpperCase,add,entrySet,builder,valueOf],refreshSegmentsForDataSource->[toMap,size,warn,identity,info,runSegmentMetadataQuery,setSegmentSignature,getIdentifier,debug,limit,currentTimeMillis,close,each,createEscalatedAuthenticationResult,next,isDone,get,analysisToRowSignature,collect,getId,add],Object,sameThreadExecutor,registerTimelineCallback,thenComparing,checkNotNull,fixed,TimelineCallback,identity,CountDownLatch,EmittingLogger]] | A blocking call to get the table map. | How about breaking the circle by adding a `PlannerFactory` parameter to `ViewManager.getViews()`? |
@@ -158,6 +158,18 @@ public class ConsumeKafkaRecord_2_6 extends AbstractProcessor implements Verifia
.addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
.build();
+ static final PropertyDescriptor COMMIT_OFFSETS = new Builder()
+ .name("Commit Offsets")
+ .displayName("Commit Offsets")
+ .description("Specifies whether or not this Processor should commit the offsets to Kafka after receiving messages. Typically, we want this value set to true " +
+ "so that messages that are received are not duplicated. However, in certain scenarios, we may want to avoid committing the offsets, so that the data can be " +
+ "processed and later acknowledged by PublishKafkaRecord in order to provide Exactly Once semantics. See Processor's Usage / Additional Details for more information. " +
+ "Note that setting this value to false can lead to significant data duplication or potentially even data loss if the dataflow is not properly configured. This setting " +
+ "should be reserved for dataflows that are designed to run within Stateless NiFi.")
+ .allowableValues("true", "false")
+ .defaultValue("true")
+ .build();
+
static final PropertyDescriptor MAX_UNCOMMITTED_TIME = new Builder()
.name("max-uncommit-offset-wait")
.displayName("Max Uncommitted Time")
| [ConsumeKafkaRecord_2_6->[close->[close],verify->[createConsumerPool],onTrigger->[getConsumerPool],getConsumerPool->[close]]] | This static class defines the properties of a Kafka property that can be used to determine the offset missing time period. | I'd rephrase to avoid "we" here. Perhaps, "In the typical use case, this value is set to true..." I think we should also be more direct in tying this to Exactly Once in Stateless. How about: "Specifies whether or not this Processor should commit the offsets to Kafka after receiving messages. This value should be false when a PublishKafkaRecord processor is expected to commit the offsets using Exactly Once semantics, and should be reserved for dataflows that are designed to run within Stateless NiFi. See Processor's Usage / Additional Details for more information. Note that setting this value to false can lead to significant data duplication or potentially even data loss if the dataflow is not properly configured." |
@@ -698,6 +698,13 @@ def process_options(args: List[str],
# filename for the config file and know if the user requested all strict options.
dummy = argparse.Namespace()
parser.parse_args(args, dummy)
+
+ if dummy.list_error_codes:
+ import mypy.messages
+ for msg_id in sorted(mypy.messages.MessageBuilder.get_message_ids()):
+ print(msg_id)
+ raise SystemExit(0)
+
config_file = dummy.config_file
if config_file is not None and not os.path.exists(config_file):
parser.error("Cannot find config file '%s'" % config_file)
| [process_options->[add_invertible_flag->[invert_flag_name],add_invertible_flag,SplitNamespace,infer_python_executable],infer_python_executable->[_python_executable_from_version],AugmentedHelpFormatter->[_fill_text->[_fill_text]],_python_executable_from_version->[PythonExecutableInferenceError]] | Parse command line arguments and return a tuple of build sources and options. Adds a group of arguments and options to a separate namespace object. Adds a group of arguments to the command line that will be run under certain conditions. | `SystemExit` is never used in `build.py` and `main.py`. I think it can cause bad interference with `mypy.api` etc. |
@@ -213,6 +213,17 @@ public class KsqlResource {
|| statement instanceof DropStream
|| statement instanceof DropTable
) {
+ if (statement instanceof AbstractStreamCreateStatement) {
+ AbstractStreamCreateStatement streamCreateStatement = (AbstractStreamCreateStatement)
+ statement;
+ Pair<AbstractStreamCreateStatement, String> avroCheckResult =
+ new AvroUtil().checkAndSetAvroSchema(streamCreateStatement, streamsProperties,
+ KsqlEngine.getSchemaRegistryClient());
+ if (avroCheckResult.getRight() != null) {
+ statement = avroCheckResult.getLeft();
+ statementText = avroCheckResult.getRight();
+ }
+ }
//Sanity check for the statement before distributing it.
validateStatement(statement, statementText, streamsProperties);
return distributeStatement(statementText, statement, streamsProperties);
| [KsqlResource->[listRegisteredTopics->[getKsqlTopics],distributeStatement->[distributeStatement],registerDdlCommandTasks->[execute],executeDDLCommand->[execute],getStatementExecutionPlan->[getStatementExecutionPlan]]] | Executes a statement which may return a KsqlEntity or throw an exception if the statement is. | nit: it probably makes sense to move this to a separate method called `maybeAddFieldsFromSchemaRegistry` . Would make the intent of this code block much clearer. As it stands, it is not clear that the statement is actually being changed here. |
@@ -175,7 +175,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
private final OperationContext context;
// Session's usage should be by definition single threaded, hence it's not needed to use a concurrentHashMap here
- protected final Map<SimpleString, Pair<Object, AtomicLong>> targetAddressInfos = new HashMap<>();
+ protected final Map<SimpleString, Pair<Object, AtomicLong>> targetAddressInfos = new MaxSizeMap<>(100);
private final long creationTime = System.currentTimeMillis();
| [ServerSessionImpl->[individualAcknowledge->[findConsumer,individualAcknowledge],receiveConsumerCredits->[locateConsumer],setStarted->[setStarted],deleteQueue->[getUsername],expire->[expire,locateConsumer],createConsumer->[getName,getUsername,securityCheck,createConsumer],cancelAndRollback->[afterRollback->[setStarted],rollback],createSharedQueue->[createSharedQueue,getUsername,securityCheck],close->[done->[doClose]],getMatchingQueue->[getMatchingQueue],individualCancel->[locateConsumer,individualCancel],getDefaultAddress->[toString],describeProducersInfo->[toString],addProducer->[getName,toString],xaCommit->[commit],doSend->[doSend,securityCheck,getName],createAddress->[getName,getUsername,securityCheck,createAddress],rollback->[rollback],closeConsumer->[close,locateConsumer],xaPrepare->[toString],getAddressAndRoutingTypes->[getAddressAndRoutingTypes],findConsumer->[locateConsumer],getAddressAndRoutingType->[getAddressAndRoutingType],getDefaultConsumerWindowSize->[toString,getDefaultConsumerWindowSize],getPrefix->[getPrefix],addUniqueMetaData->[addMetaData],doRollback->[newTransaction,setStarted],removePrefix->[getAddress],createQueue->[createQueue,getName,getUsername,securityCheck],sendSessionNotification->[getName,getUsername,getConnectionID],send->[getCurrentTransaction,getUsername,send],xaFailed->[newTransaction],getInTXMessagesForConsumer->[getCurrentTransaction],setTransferring->[setTransferring],xaRollback->[rollback],TempQueueCleanerUpper->[connectionClosed->[run],connectionFailed->[run,connectionFailed]],commit->[commit],connectionFailed->[close,connectionFailed],handleManagementMessage->[getName,getUsername,securityCheck,handleManagementMessage],getLastSentMessageID->[toString],getTargetAddresses->[toString],toString->[toString],xaStart->[toString,rollback,newTransaction],acknowledge->[acknowledge]]] | Creates a new session. | Can this be configurable, 100 is a bit arbitrary especially as prev was unlimited |
@@ -49,7 +49,8 @@ public class CompileTimeZoneData : Task
// for ex: `CST6CDT`, `MST`, etc.
foreach (var entry in new DirectoryInfo (OutputDirectory!).EnumerateFiles())
{
- File.Delete(entry.FullName);
+ if (entry.Name != "zone.tab")
+ File.Delete(entry.FullName);
}
}
| [CompileTimeZoneData->[Execute->[CompileTimeZoneDataSource,FilterTimeZoneData,FilterZoneTab]]] | Filter unnecessary timezone data. | Why is this needed? We never copy this file to the `OutputDirectory`, so it shouldn't be there at all, IIUC. |
@@ -87,6 +87,9 @@ export class AmpSlideScroll extends BaseSlides {
/** @private {number} */
this.previousScrollLeft_ = 0;
+
+ /** @private {!Promise<?InstrumentationService>} */
+ this.analyticsPromise_ = analyticsForOrNull(this.win);
}
/** @override */
| [No CFG could be retrieved] | Creates the slides of the container. This method creates the slides and wrapper elements. | Must go into `buildCallback` or its substitute. |
@@ -214,7 +214,9 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
protected ClientConfiguration createConfiguration(final ProcessContext context) {
final ClientConfiguration config = new ClientConfiguration();
config.setMaxConnections(context.getMaxConcurrentTasks());
- config.setMaxErrorRetry(0);
+ PropertyValue property = context.getProperty(AWS_MAX_ERROR_RETRY);
+ config.setMaxErrorRetry(property.isSet()? property.asInteger() : 0);
+ setRetryPolicy(config, context);
config.setUserAgent(DEFAULT_USER_AGENT);
// If this is changed to be a property, ensure other uses are also changed
config.setProtocol(DEFAULT_PROTOCOL);
| [AbstractAWSProcessor->[onShutdown->[getClient],customValidate->[customValidate],getAvailableRegions->[createAllowableValue],onScheduled->[createConfiguration]]] | Creates a configuration object. get proxy config. | Could be `config.setMaxErrorRetry(getMaxErrorRetry(context));` |
@@ -84,7 +84,10 @@ public class MetricsContainerImpl implements Serializable, MetricsContainer {
private MetricsMap<KV<MetricName, HistogramData.BucketType>, HistogramCell> histograms =
new MetricsMap<>(HistogramCell::new);
- /** Create a new {@link MetricsContainerImpl} associated with the given {@code stepName}. */
+ /**
+ * Create a new {@link MetricsContainerImpl} associated with the given {@code stepName}. If
+ * stepName is null, this MetricsContainer is not bound to a step.
+ */
public MetricsContainerImpl(@Nullable String stepName) {
this.stepName = stepName;
}
| [MetricsContainerImpl->[equals->[equals],getMonitoringData->[getUpdates],counterUpdateToMonitoringInfo->[counterToMonitoringMetadata],updateDistributions->[getCumulative,update],updateCounters->[getCumulative],update->[updateForLatestInt64Type,updateForSumInt64Type,updateForDistributionInt64Type],reset->[reset],updateForDistributionInt64Type->[getDistribution,update],deltaContainer->[MetricsContainerImpl,update,getCumulative],getCumulativeString->[matchMetric,getCumulative],getUpdates->[extractUpdates],updateHistograms->[update],getCumulative->[extractCumulatives],distributionUpdateToMonitoringInfo->[distributionToMonitoringMetadata],commitUpdates->[commitUpdates],updateGauges->[getCumulative,update],updateForSumInt64Type->[getCounter],updateForLatestInt64Type->[getGauge,update],getMonitoringInfos->[distributionUpdateToMonitoringInfo,counterUpdateToMonitoringInfo,getUpdates],distributionToMonitoringMetadata->[metricToMonitoringMetadata],counterToMonitoringMetadata->[metricToMonitoringMetadata]]] | This class is used to create a new MetricsContainer instance for the given . Returns a CounterCell that contains all the values of this CounterCell. | Alternatively, require this be non-null, and add a no-arg constructor for the no-step-name (presumably is-process-wide) case? |
@@ -170,7 +170,10 @@ function delivery_run(&$argv, &$argc){
$item['deleted'] = 1;
}
- if ((count($items) == 1) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
+ // When commenting too fast after delivery, a post wasn't recognized as top level post.
+ // The count then showed more than one entry. The additional check should help.
+ // The check for the "count" should be superfluous, but I'm not totally sure by now, so we keep it.
+ if ((($items[0]['id'] = $item_id) OR (count($items) == 1)) AND ($items[0]['uri'] === $items[0]['parent-uri'])) {
logger('delivery: top level post');
$top_level = true;
}
| [delivery_run->[maxload_reached,set_baseurl,get_hostname]] | This function is called when a command is invoked from the delivery process. It will run the This function is used to query the mails and contact list. finds all the items that are not in the list of ancestors This function is used to check if a post is a top level post and if so it This function is used to check if a message is in our array and if so we will dfrn - main - notifier dfrn - notifier - notifier This function is used to send a non - blocking contact to a person who has blocked it This function is called when a message is delivered to a contact This function is used to generate a single email message if there is no user in the system Mail message if there is a link to a batch sends a message to the owner of the target item if the target item is not in Contact object getter. | Standard: Can you please respect the file's overall boolean style (which is && and ||)? I don't mind you using OR and AND in general but I do mind having different styles in the same file/function. |
@@ -322,6 +322,11 @@ class CLI_Command extends WP_CLI_Command {
* [--format=<format>]
* : Accepted values: var_export, json. Default: json.
*
+ * ## EXAMPLES
+ *
+ * $ wp cli param-dump
+ * {"path":{"runtime":"=<path>","file":"<path>","synopsis":"","default":null,"multiple":false,"desc":"Path to the WordPress files."},"url":{"runtime":"=<url>","file":"<url>","synopsis":"","default":null,"multiple":false,"desc":"Pretend request came from given URL. In multisite, this argument is how the target site is specified."},"blog":{"runtime":"=<url>","file":false,"synopsis":"","default":null,"multiple":false,"deprecated":"Use --url instead."},"config":{"runtime":"=<path>","file":false,"synopsis":"","default":null,"multiple":false,"deprecated":"Use the WP_CLI_CONFIG_PATH environment variable instead."},"user":{"runtime":"=<id|login|email>","file":"<id|login|email>","synopsis":"","default":null,"multiple":false,"desc":"Set the WordPress user."},"skip-plugins":{"runtime":"[=<plugin>]","file":"<list>","synopsis":"","default":"","multiple":false,"desc":"Skip loading all or some plugins. Note: mu-plugins are still loaded."},"skip-themes":{"runtime":"[=<theme>]","file":"<list>","synopsis":"","default":"","multiple":false,"desc":"Skip loading all or some themes."},"skip-packages":{"runtime":"","file":"<bool>","synopsis":"","default":false,"multiple":false,"desc":"Skip loading all installed packages."},"require":{"runtime":"=<path>","file":"<path>","synopsis":"","default":[],"multiple":true,"desc":"Load PHP file before running the command (may be used more than once)."},"disabled_commands":{"runtime":false,"file":"<list>","synopsis":"","default":[],"multiple":false,"desc":"(Sub)commands to disable."},"color":{"runtime":true,"file":"<bool>","synopsis":"","default":"auto","multiple":false,"desc":"Whether to colorize the output."},"debug":{"runtime":"","file":"<bool>","synopsis":"","default":false,"multiple":false,"desc":"Show all PHP errors; add verbosity to WP-CLI bootstrap."},"prompt":{"runtime":"","file":false,"synopsis":"","default":false,"multiple":false,"desc":"Prompt the user to enter values for all command arguments."},"quiet":{"runtime":"","file":"<bool>","synopsis":"","default":false,"multiple":false,"desc":"Suppress informational messages."},"apache_modules":{"runtime":false,"file":"<list>","synopsis":"","default":[],"multiple":true,"desc":"List of Apache Modules that are to be reported as loaded."},"allow-root":{"runtime":"","file":false,"synopsis":"","default":null,"multiple":false,"hidden":true}}
+ *
* @subcommand param-dump
*/
function param_dump( $_, $assoc_args ) {
| [CLI_Command->[completions->[render],update->[get_update_type_str,run,get_updates],param_dump->[get_spec,to_array],info->[get_packages_dir_path],command_to_array->[get_subcommands,get_shortdesc,get_longdesc,get_synopsis,get_name],check_update->[display_items,get_update_type_str,get_updates]]] | Dump the parameters of a command. | Can we truncate this some? I don't think it's necessary to include the full output. Also, this will need to be indented. |
@@ -2788,6 +2788,16 @@ RtpsUdpDataLink::RtpsWriter::process_acknack(const RTPS::AckNackSubmessage& ackn
return;
}
+ if (reader->expecting_ack_) {
+ reader->expecting_ack_ = false;
+ --link->expected_acks_;
+ link->last_ack_ = MonotonicTimePoint::now();
+ if (link->expected_acks_ == 0) {
+ link->heartbeat_.cancel();
+ link->heartbeat_.schedule(TimeDuration::zero_value);
+ }
+ }
+
const bool is_final = acknack.smHeader.flags & RTPS::FLAG_F;
const bool is_postassociation =
is_final ||
| [No CFG could be retrieved] | - - - - - - - - - - - - - - - - - - Nack the range between the received ack and the effective ack. | This function has a lock for the `RtpsWriter` but not for the link itself (at least not that I can see). Is there a concurrency issue? Aside from that concern, this block of code has a few operations that act on the link so it looks like it could be refactored to be a method on the link object. |
@@ -665,7 +665,9 @@ public class XmlSourceTest {
.withRecordElement("train")
.withRecordClass(Train.class)
.withMinBundleSize(1024);
- PCollection<Train> output = p.apply(Read.from(source).named("ReadFileData"));
+ AvroCoder<Train> intermediateCoder = AvroCoder.of(Train.class);
+ PCollection<Train> output =
+ p.apply(Read.from(source).named("ReadFileData")).setCoder(intermediateCoder);
DataflowAssert.that(output).containsInAnyOrder(trains);
p.run();
| [XmlSourceTest->[testReadXMLFilePattern->[generateRandomTrainList,createRandomTrainXML],trainsToStrings->[toString],testReadXMLNoRecordElement->[readEverythingFromReader],testReadXMLSmallDataflow->[Train],testReadXMLNoBundleSize->[trainsToStrings,Train],testReadXMLWithMultiByteChars->[Train],createRandomTrainXML->[trainToXMLElement],testReadXMLNoRecordClass->[readEverythingFromReader],testReadXMLLarge->[generateRandomTrainList,trainsToStrings,createRandomTrainXML],Train->[hashCode->[hashCode],equals->[equals]],testXMLWithSplits->[generateRandomTrainList,trainsToStrings,createRandomTrainXML,readEverythingFromReader],testReadXMLWithEmptyTags->[trainsToStrings,Train],testSplitWithEmptyBundleAtEnd->[Train,readEverythingFromReader],testReadXMLIncorrectRootElement->[readEverythingFromReader],testSplitWithEmptyBundles->[generateRandomTrainList,trainsToStrings,createRandomTrainXML,readEverythingFromReader],generateRandomTrainList->[Train],testReadXMLWithAttributes->[trainsToStrings,Train],testReadXMLIncorrectRecordElement->[readEverythingFromReader],testReadXMLSmall->[trainsToStrings,Train],testReadXMLWithMultiByteElementName->[Train],testReadXMLLargeDataflow->[generateRandomTrainList,createRandomTrainXML],testReadXMLTiny->[Train],testReadXMLNoRootElement->[readEverythingFromReader],testSplitAtFraction->[generateRandomTrainList,createRandomTrainXML],testReadXMLWithWhitespaces->[trainsToStrings,Train]]] | Reads XML large dataset. | please update to the happy `apply` syntax (aka, drop 'named'). |
@@ -147,7 +147,7 @@ func (d *Dispatcher) GetDockerAPICommand(conf *config.VirtualContainerHostConfig
}
dEnv = append(dEnv, "DOCKER_TLS_VERIFY=1")
- info, err := os.Stat(conf.ExecutorConfig.Name)
+ info, err := os.Stat(certpath)
if err == nil && info.IsDir() {
if abs, err := filepath.Abs(info.Name()); err == nil {
dEnv = append(dEnv, fmt.Sprintf("DOCKER_CERT_PATH=%s", abs))
| [InspectVCH->[Infof,Begin,X509Certificate,Sprintf,PowerState,Warnf,End,IsNil,String,Errorf,IsUnspecifiedIP,ShowVCH,Debugf],ShowVCH->[Infof,GetDockerAPICommand,String,Info,WriteFile],GetDockerAPICommand->[Join,Stat,IsDir,Sprintf,Name,IsNil,Abs]] | GetDockerAPICommand returns the command to run docker - H info. | what happens if user didn't specify certpath, but used custom cert and key files? |
@@ -584,7 +584,7 @@ func (s *HybridInboxSource) Read(ctx context.Context, uid gregor1.UID,
localizerTyp types.ConversationLocalizerTyp, useLocalData bool, maxLocalize *int,
query *chat1.GetInboxLocalQuery, p *chat1.Pagination) (inbox types.Inbox, localizeCb chan types.AsyncInboxResult, err error) {
- defer s.Trace(ctx, func() error { return err }, "Read")()
+ defer s.Trace(ctx, func() error { return err }, fmt.Sprintf("Read: query: %v", query))()
// Read unverified inbox
rquery, tlfInfo, err := s.GetInboxQueryLocalToRemote(ctx, query)
| [Clear->[Clear,createInbox],Localize->[Localize],TeamTypeChanged->[getConvLocal,handleInboxError,createInbox,TeamTypeChanged],ReadUnverified->[IsOffline,Read,createInbox,fetchRemoteInbox],SetTeamRetention->[SetTeamRetention,getConvsLocal,handleInboxError,createInbox],Stop->[Stop],modConversation->[handleInboxError,createInbox,getConvLocal],NewMessage->[getConvLocal,handleInboxError,createInbox,NewMessage],getConvsLocal->[Read],Read->[Localize,ReadUnverified,createConversationLocalizer,GetInboxQueryLocalToRemote,createInbox],SetConvSettings->[SetConvSettings],Disconnected->[Disconnected],handleInboxError->[Clear,createInbox],ReadMessage->[ReadMessage,handleInboxError,createInbox,getConvLocal],SetConvRetention->[SetConvRetention],Connected->[Connected],ConversationsUpdate->[ConversationsUpdate,handleInboxError,createInbox],UpgradeKBFSToImpteam->[UpgradeKBFSToImpteam,handleInboxError,createInbox,getConvLocal],TlfFinalize->[notifyTlfFinalize,TlfFinalize,getConvLocal,handleInboxError,createInbox],getConvLocal->[Read],inboxFlushLoop->[createInbox],fetchRemoteInbox->[Expunge,IsOffline],MembershipUpdate->[MembershipUpdate,Clear,Read,handleInboxError,createInbox],NewConversation->[NewConversation,handleInboxError,createInbox],Start->[Start],IsOffline->[IsOffline],SetAppNotificationSettings->[SetAppNotificationSettings,handleInboxError,createInbox,getConvLocal],SubteamRename->[SubteamRename,getConvsLocal,handleInboxError,createInbox],Expunge->[Expunge],SetStatus->[handleInboxError,SetStatus,createInbox,getConvLocal]] | Read reads an inbox from the chat server. This is a helper function to create a new instance of the LocalServer interface. | Topic names could be in here, we cant log this. |
@@ -1007,7 +1007,10 @@ void MarlinUI::update() {
// cause a refresh to occur until all the text has scrolled into view.
if (currentScreen == menu_media && !lcd_status_update_delay--) {
lcd_status_update_delay = 4;
- if (++filename_scroll_pos > filename_scroll_max) {
+ filename_scroll_pos++;
+ if (filename_scroll_pos == filename_scroll_max){
+ lcd_status_update_delay = 12;
+ } else if (filename_scroll_pos > filename_scroll_max) {
filename_scroll_pos = 0;
lcd_status_update_delay = 12;
}
| [No CFG could be retrieved] | The main entry point for the show_header function. Handle the update of the keypad. | Added small delay when scrolling stops like the same before scrolling starts. |
@@ -15,7 +15,7 @@ public interface CacheTopologyInfo {
/**
* @return The number of configured segments for the cache.
*/
- int getNumSegments();
+ Integer getNumSegments();
/**
* @return Segments owned by each server.
| [No CFG could be retrieved] | Returns the number of segments in the segment map. | `CacheTopologyInfo` is accessible from `RemoteCache.getCacheTopologyInfo()`, so this is going to break backwards compatibility. |
@@ -1421,7 +1421,7 @@ func TestResolveImageStreamRef(t *testing.T) {
Name: imageRepoName + ":" + tagName,
},
expectedSuccess: true,
- expectedDockerRef: latestDockerReference,
+ expectedDockerRef: dockerReference,
},
{
streamRef: kapi.ObjectReference{
| [MockSource,Resource,DeepEqual,Clone,IsZero,MockBuildConfig,MockBuilderSecrets,NewDefaultContext,Error,MockSourceStrategyForImageRepository,ValidateBuild,MatchString,GetInputReference,generateBuildFromConfig,MockBuilderServiceAccount,Errorf,resolveImageStreamReference,Contains,Repeat,Fatalf,Instantiate,NewSimpleClientset,createBuild,Sprintf,Core,MockOutput,NewNotFound,MustParse,NewContext] | TestResolveImageStreamRef tests the next build name and the next build name. mockDockerRef returns a mock DockerRef. | @bparees this one is weird... you are trying to resolve the "foo:test" to "foo:latestDockerReference", can you or somebody explain the intention of this test? |
@@ -73,6 +73,16 @@ final class ItemResolver
$normalizationContext = $resourceMetadata->getGraphqlAttribute('query', 'normalization_context', [], true);
- return $this->normalizer->normalize($item, ItemNormalizer::FORMAT, $normalizationContext + $baseNormalizationContext);
+ if (null !== $this->dispatcher) {
+ $this->dispatcher->dispatch(PreSerializeEvent::NAME, new PreSerializeEvent($item));
+ }
+
+ $normalizedObject = $this->normalizer->normalize($item, ItemNormalizer::FORMAT, $normalizationContext + $baseNormalizationContext);
+
+ if (null !== $this->dispatcher) {
+ $this->dispatcher->dispatch(PostSerializeEvent::NAME, new PostSerializeEvent($item));
+ }
+
+ return $normalizedObject;
}
}
| [ItemResolver->[__invoke->[create,normalize,getItemFromIri,fieldsToAttributes,getObjectClass,canAccess,getGraphqlAttribute]]] | Returns a node if it is found in the source and normalized if it is. | Shouldn't we use the `$normalizedObject` here? |
@@ -392,3 +392,10 @@ def device_mapping(cuda_device: int):
else:
return storage
return inner_device_mapping
+
+def ones_like(tensor: torch.Tensor) -> torch.Tensor:
+ """
+ Use clone() + copy_() to make sure that a tensor ends up on the right
+ device at runtime.
+ """
+ return tensor.clone().copy_(torch.ones(tensor.shape))
| [arrays_to_variables->[arrays_to_variables],last_dim_softmax->[masked_softmax],masked_softmax->[_get_normalized_masked_log_probablities],masked_log_softmax->[_get_normalized_masked_log_probablities]] | A function to get the function that needs to be applied to a GPU - trained model on. | I think it'd be more efficient to just use `.fill_(1)` instead of the `.copy()` here. |
@@ -99,7 +99,13 @@ static int do_create(const char *value, const char *name)
lntmp[p - ln] = 0;
oid = OBJ_nid2obj(nid);
oid->ln = lntmp;
+ goto fin;
}
-
+
+ return 1;
+
+fin:
+ OPENSSL_free(lntmp);
+ oid->ln = NULL;
return 1;
}
| [ASN1_add_oid_module->[CONF_module_add],int->[NCONF_get_section,do_create,sk_CONF_VALUE_num,ASN1err,memcpy,isspace,OBJ_nid2obj,OBJ_create,strrchr,STACK_OF,OPENSSL_malloc,sk_CONF_VALUE_value,CONF_imodule_get_value]] | - - - - - - - - - - - - - - - - - -. | If there is any leak here, it is due to this line of code. The original value could be lost, I hadn't check it exactly. Your change just discards the job of `if (p) {` statement. And so it loses both original and modified long names (ln) . |
@@ -101,6 +101,9 @@ public class ClientOptions
@Option(names = "--password", paramLabel = "<password>", description = "Prompt for password")
public boolean password;
+ @Option(names = "--external-authentication", paramLabel = "<externalAuthentication>", description = "Enable external authentication")
+ public boolean externalAuthentication;
+
@Option(names = "--source", paramLabel = "<source>", defaultValue = "trino-cli", description = "Name of source making query " + DEFAULT_VALUE)
public String source;
| [ClientOptions->[ClientExtraCredential->[equals->[equals]],ClientResourceEstimate->[equals->[equals]],ClientSessionProperty->[equals->[equals]]]] | Option that can be used to specify the keystore type. Enable debug information if the sequence is not empty. | commit message: `Add ExternalAuthorizert to cli` -> `Add ExternalAuthorizer to cli` Why `Authorizer`? in code used `Authentication` |
@@ -644,10 +644,13 @@ dtx_leader_wait(struct dtx_leader_handle *dlh)
{
int rc;
- rc = ABT_future_wait(dlh->dlh_future);
- D_ASSERTF(rc == ABT_SUCCESS, "ABT_future_wait failed %d.\n", rc);
+ if (dlh->dlh_future != ABT_FUTURE_NULL) {
+ rc = ABT_future_wait(dlh->dlh_future);
+ D_ASSERTF(rc == ABT_SUCCESS, "ABT_future_wait failed %d.\n", rc);
+
+ ABT_future_free(&dlh->dlh_future);
+ }
- ABT_future_free(&dlh->dlh_future);
D_DEBUG(DB_IO, "dth "DF_DTI" rc "DF_RC"\n",
DP_DTI(&dlh->dlh_handle.dth_xid), DP_RC(dlh->dlh_result));
| [No CFG could be retrieved] | END of function DtxLeaderWait Stop the leader thandle. | (style) line over 80 characters |
@@ -279,10 +279,13 @@ def write_trans(fname, trans):
Parameters
----------
fname : str
- The name of the file.
+ The name of the file, which should end in '-trans.fif'.
trans : dict
Trans file data, as returned by read_trans.
"""
+ if not fname[-10:] == '-trans.fif':
+ warnings.warn("This filename does not conform to mne naming "
+ "conventions. All trans files should end in -trans.fif.")
fid = start_file(fname)
write_coord_trans(fid, trans)
end_file(fid)
| [_print_coord_trans->[_coord_frame_name],combine_transforms->[_coord_frame_name],transform_coordinates->[invert_transform],transform_surface_to->[apply_trans,invert_transform]] | Write a - trans. fif file. | FYI you could have used fname.endswith('-trans.fif') |
@@ -0,0 +1,12 @@
+module Moderator
+ module Audit
+ class Subscribe
+ include Singleton
+ AuditConfig = Moderator::Audit::Application.config
+
+ ActiveSupport::Notifications.subscribe(AuditConfig.instrumentation_name) do |*args|
+ Moderator::Audit::Notification.subscribe(*args)
+ end
+ end
+ end
+end
| [No CFG could be retrieved] | No Summary Found. | In my opinion ` Moderator::Audit::Notification#subscribe` method name is a bit misleading. It's basically creating a notification, not subscribing, and seeing `subscribe` inside a `subscribe` is not clear, so I would choose another name (like `create` or smth like that). |
@@ -408,6 +408,15 @@ public class SCMClientProtocolServer implements
return scm.getPipelineManager().getPipelines();
}
+ @Override
+ public Pipeline getPipeline(HddsProtos.PipelineID pipelineID)
+ throws IOException {
+ AUDIT.logReadSuccess(
+ buildAuditMessageForSuccess(SCMAction.GET_PIPELINE, null));
+ return scm.getPipelineManager().getPipeline(
+ PipelineID.getFromProtobuf(pipelineID));
+ }
+
@Override
public void activatePipeline(HddsProtos.PipelineID pipelineID)
throws IOException {
| [SCMClientProtocolServer->[stopReplicationManager->[stop],getContainer->[getRpcRemoteUsername,getContainer],allocateContainer->[getRpcRemoteUsername,allocateContainer],closeContainer->[getRpcRemoteUsername],join->[join],stop->[stop],start->[start,getClientRpcAddress],getContainerWithPipeline->[getContainer],activatePipeline->[activatePipeline],deleteContainer->[getRpcRemoteUsername,deleteContainer],close->[stop],startReplicationManager->[start],listContainer->[listContainer],deactivatePipeline->[deactivatePipeline]]] | List all pipelines in the system. | This might not be appropriate for Audit since it is not client access, we should log it in debug mode IMO. |
@@ -34,6 +34,17 @@ def _instantiate_client(client_class, **kwargs):
return client_class(**kwargs)
+def client_resource(client_class, cloud):
+ """Returns the resource (used to get the right access token) and base URL for the client"""
+ if client_class.__name__ == 'GraphRbacManagementClient':
+ return cloud.endpoints.active_directory_graph_resource_id, cloud.endpoints.active_directory_graph_resource_id
+ if client_class.__name__ == 'KeyVaultClient':
+ vault_host = cloud.suffixes.keyvault_dns[1:]
+ vault_url = 'https://%s' % vault_host
+ return vault_url, None
+ return None, None
+
+
def get_client_from_cli_profile(client_class, **kwargs):
"""Return a SDK client initialized with current CLI credentials, CLI default subscription and CLI default cloud.
| [get_client_from_cli_profile->[_instantiate_client],get_client_from_json_dict->[_instantiate_client],get_client_from_auth_file->[get_client_from_json_dict]] | Returns a client based on the given CLI profile. Gets a client for the resource. | Please make it `_client_resource` |
@@ -34,7 +34,7 @@ func init() {
// newMockGatewayServerWithAuth Is a Slick Wrapper that injects Auth for this particular test suite
func newMockGatewayServerWithAuth(t *testing.T, services ...interface{}) Server {
- mockAuthClient, mockAuthzClient := newAuthorizationMocks(t, "ingest:unified_events", "create")
+ mockAuthClient, mockAuthzClient := newAuthorizationMocks(t, "infra:ingest:unifiedEvents", "infra:ingest:create")
// Append Auth/AuthZ to Authorize the above resource
services = append(services, mockAuthClient, mockAuthzClient)
| [ProcessLivenessPing,NewRequest,ProcessChefAction,ProcessComplianceReport,DoAndReturn,Error,ReadFile,New,NewRecorder,Len,NewMockNotifier,Any,Equal,NewController,NewMockComplianceIngesterClient,ProcessChefRun,Send,dataCollectorHandler,NewMockChefIngesterClient,NewReader,Result,EXPECT,ElementsMatch,Run] | Creates a new mock gateway server with mocked clients TestDataCollectorHandlerChefActionMsgOk - Tests the response from the data. | Switch to v2 resource/action. |
@@ -881,7 +881,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
e.buildEnvVars(env);
for (EnvironmentContributingAction a : getActions(EnvironmentContributingAction.class))
- a.buildEnvVars(this,env);
+ a.buildEnvVars(this,env,getBuiltOn());
EnvVars.resolve(env);
| [AbstractBuild->[_getUpstreamBuilds->[getUpstreamRelationship],getNextBuild->[getNextBuild],getModuleRoot->[getWorkspace,getModuleRoot],getBuildVariableResolver->[getBuildVariables],getEnvironment->[getWorkspace,getEnvironment],getDownstreamBuilds->[getDownstreamRelationship],AbstractBuildExecution->[performAllBuildStep->[performAllBuildSteps],preBuild->[preBuild],perform->[perform],run->[getCurrentNode,decideWorkspace],defaultCheckout->[getWorkspace,getProject],decideWorkspace->[getProject],createLauncher->[getCurrentNode,createLauncher],post->[post2],reportBrokenChannel->[getCurrentNode],performAllBuildSteps->[performAllBuildSteps]],getUpstreamRelationshipBuild->[getUpstreamRelationship],addAction->[addAction],getWhyKeepLog->[getWhyKeepLog],getPreviousBuild->[getPreviousBuild],getWorkspace->[getBuiltOn],DependencyChange->[getBuilds->[getNextBuild]],calculateCulprits->[calculateCulprits],getModuleRoots->[getWorkspace,getModuleRoots],createReference->[createReference],dropLinks->[dropLinks],getChangeSets->[getChangeSet],doStop->[doStop],shouldCalculateCulprits->[getCulpritIds]]] | Get environment variables for this task. | AFAICT this loop should just be deleted since it is already being called in the super; otherwise we would be calling each `EnvironmentContributingAction` twice on a single `AbstractBuild`. |
@@ -22,7 +22,7 @@ namespace NServiceBus
public UnicastSendRouterConnector(
string sharedQueue,
string instanceSpecificQueue,
- IUnicastRouter unicastRouter,
+ IUnicastSendRouter unicastRouter,
DistributionPolicy distributionPolicy)
{
this.sharedQueue = sharedQueue;
| [UnicastSendRouterConnector->[Task->[MessageType,SpecificInstance,CreateOutgoingLogicalMessageContext,Message,Option,IsNullOrEmpty,ExplicitDestination,RouteToDestination,RouteToSpecificInstance,RouteToAnyInstanceOfThisEndpoint,Extensions,ConfigureAwait,ToString,ToArray,Headers,Queue,MessageIntent,RouteToThisInstance],State->[None],unicastRouter,instanceSpecificQueue,sharedQueue]] | Creates a connector that routes a message to a specific instance of this endpoint. | I'd rename this and the field to `unicastSendRouter` to match the change to the `UnicastPublishRouterConnector`. |
@@ -362,6 +362,11 @@ func (gce *GCECloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []
return nameservers, srchOut
}
+// HasClusterID returns true if the cluster has a clusterID
+func (gce *GCECloud) HasClusterID() bool {
+ return true
+}
+
// GCECloud implements cloudprovider.Interface.
var _ cloudprovider.Interface = (*GCECloud)(nil)
| [GetDisk->[Get,Do],ScrubDNS->[MatchString],CreateDisk->[Do,Insert],Initialize->[watchClusterID],WaitForZoneOp->[waitForZoneOp],DeleteDisk->[Do,Delete],PollImmediate,Token,DefaultTokenSource,Infof,Get,Sprintf,Do,Contains,RegisterCloudProvider,New,List,ComputeTokenSource,Errorf,NewTokenBucketRateLimiter,NewClient,MustCompile,ReadInto,Split] | ScrubDNS removes DNS nameservers from the list of nameservers that do not match the. | @rrati isn't GCE cloud using Initialize() to get the cluster id and this should return true only when the clusterID is really available? |
@@ -838,7 +838,11 @@ static void *do_PVK_body_key(const unsigned char **in,
EVP_CIPHER *rc4 = NULL;
#endif
EVP_CIPHER_CTX *cctx = EVP_CIPHER_CTX_new();
-
+ if(cctx == NULL) {
+ ERR_raise(ERR_LIB_PEM, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
+
if (saltlen) {
#ifndef OPENSSL_NO_RC4
unsigned int magic;
| [No CFG could be retrieved] | Reads an I2B - encoded private key and public key from the specified file - like Derive a PVK key from a given key. | Blank line above here too. |
@@ -135,7 +135,17 @@ int RelayHandler::handle_output(ACE_HANDLE)
int idx = 0;
for (ACE_Message_Block* block = out.second.get(); block && idx < BUFFERS_SIZE; block = block->cont(), ++idx) {
buffers[idx].iov_base = block->rd_ptr();
+#ifdef _MSC_VER
+#pragma warning(push)
+ // iov_len is 32-bit on 64-bit VC++, but we don't want a cast here
+ // since on other platforms iov_len is 64-bit
+#pragma warning(disable : 4267)
+#endif
+ // TODO: u_long = size_t
buffers[idx].iov_len = block->length();
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
}
const auto bytes = socket_.send(buffers, idx, out.first, 0);
| [No CFG could be retrieved] | Handle incoming and outgoing ethernet messages. Enqueue message on the network. | Is there something still TODO here? |
@@ -628,9 +628,7 @@ static bool ScheduleRun(EvalContext *ctx, Policy **policy, GenericAgentConfig *c
UpdateLastPolicyUpdateTime(ctx);
DetectEnvironment(ctx);
-
- Log(LOG_LEVEL_INFO, "Re-evaluating augments" );
- LoadAugments(ctx, config);
+ GenericAgentDiscoverContext(ctx, config);
EvalContextClassPutHard(ctx, CF_AGENTTYPES[AGENT_TYPE_EXECUTOR], "cfe_internal,source=agent");
| [No CFG could be retrieved] | Load the next non - negative promise and return true if the next non - negative promise is Check if the agent has a non - empty class and if so update the reference time. | Should we keep a LOG to indicate that config is being re-loaded? |
@@ -462,7 +462,6 @@ public class PutS3Object extends AbstractS3Processor {
public void process(final InputStream rawIn) throws IOException {
try (final InputStream in = new BufferedInputStream(rawIn)) {
final ObjectMetadata objectMetadata = new ObjectMetadata();
- objectMetadata.setContentDisposition(URLEncoder.encode(ff.getAttribute(CoreAttributes.FILENAME.key()), "UTF-8"));
objectMetadata.setContentLength(ff.getSize());
final String contentType = context.getProperty(CONTENT_TYPE)
| [PutS3Object->[getLocalState->[getPersistenceFile],getLocalStateIfInS3->[localUploadExistsInS3],removeLocalState->[persistLocalState],MultipartState->[toString->[toString]],ageoffLocalState->[removeLocalState,getPersistenceFile],persistLocalState->[getPersistenceFile],getS3AgeoffListAndAgeoffLocalState->[ageoffLocalState],onTrigger->[process->[persistLocalState,getLocalStateIfInS3],removeLocalState]]] | On trigger. This method is called to add additional information to the object metadata. This method is called to add a new object to the bucket. This method will initiate a multipart upload if the current state is not already complete. | `Content-Disposition` was originally set to the filename. The current change is not backward compatible with it because the default is `inline` and the "no value" case also falls back to `inline`. I would suggest to use no default value and to keep the current logic (setting the filename) when the property is not specified. This way it would not be a breaking change and could be added in a minor release (which may have backward compatible changes only). Furthermore, as far as I understand, `inline` / `attachment` are only relevant in case of web hosting mode. So having a third option for non web hosting mode seems to me reasonable too. |
@@ -572,8 +572,7 @@ def _get_src_data(src):
return src_data, src_kind
-def _interpolate_data(stc, morph, mri_resolution=True, mri_space=True,
- output='nifti1'):
+def _interpolate_data(stc, morph, mri_resolution, mri_space, output='nifti1'):
"""Interpolate source estimate data to MRI."""
_check_dep(nibabel='2.1.0', dipy=False)
if output not in ('nifti', 'nifti1', 'nifti2'):
| [_apply_morph_data->[_morph_one->[_interpolate_data,_get_zooms_orig],_morph_one],_compute_morph_sdr->[_check_dep],_morph_buffer->[_morph_buffer],_morphed_stc_as_volume->[_check_dep],read_source_morph->[SourceMorph],_interpolate_data->[_check_dep,_get_src_data]] | Interpolate data to MRI. missing - block - related functions Get a NiftiImage object with a object. | Again defaults never mattered because they were passed in each use |
@@ -295,4 +295,4 @@ class CI_Cache_memcached extends CI_Driver {
}
/* End of file Cache_memcached.php */
-/* Location: ./system/libraries/Cache/drivers/Cache_memcached.php */
\ No newline at end of file
+/* Location: ./system/libraries/Cache/drivers/Cache_memcached.php */
| [CI_Cache_memcached->[is_supported->[_setup_memcached],get_metadata->[get],increment->[increment],get->[get],delete->[delete],decrement->[decrement]]] | End of file Cache_memcached. php. | Please remove the empty line here (you have to use a local editor, can't happen through GitHub's). |
@@ -299,6 +299,14 @@ public class DefaultXmlArtifactDeclarationLoader implements XmlArtifactDeclarati
});
}
+ private ParameterGroupModel getParameterGroup(ParameterizedModel model, String groupName) {
+ for (ParameterGroupModel parameterGroupModel : model.getParameterGroupModels()) {
+ if (parameterGroupModel.getName().equals(groupName))
+ return parameterGroupModel;
+ }
+ return null;
+ }
+
private void declareTransform(ComponentModel model) {
final DslElementSyntax elementDsl = dsl.resolve(model);
if (model.getName().equals(TRANSFORM_IDENTIFIER) && elementDsl.getElementName().equals(line.getIdentifier())) {
| [DefaultXmlArtifactDeclarationLoader->[load->[load],getNamespace->[getNamespace],getParameterDeclarerVisitor->[visitObject->[defaultVisit],visitArrayType->[getParameterDeclarerVisitor],defaultVisit->[isCData]],declareRoute->[declareComposableModel],declareComposableModel->[getExtensionModel],createObjectValueFromType->[getParameterDeclarerVisitor],copyChildren->[cloneAsDeclaration]]] | Gets a component declaring walker. This method finds a group which contains a transform script. | no point in returning `null`, return the Optional resulting of stream.filter.findFirst |
@@ -106,13 +106,13 @@ function videos_post(&$a) {
$owner_uid = $a->data['user']['uid'];
- if (local_user() != $owner_uid) goaway($a->get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+ if (local_user() != $owner_uid) goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
if(($a->argc == 2) && x($_POST,'delete') && x($_POST, 'id')) {
// Check if we should do HTML-based delete confirmation
if(!x($_REQUEST,'confirm')) {
- if(x($_REQUEST,'canceled')) goaway($a->get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+ if(x($_REQUEST,'canceled')) goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
$drop_url = $a->query_string;
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
| [videos_init->[get_baseurl],videos_content->[set_pager_itemspage,get_baseurl,set_pager_total],videos_post->[get_baseurl]] | POST a video no - op for users who don t have a video. | Standards: Can you please add brackets to this conditional statement? |
@@ -73,7 +73,7 @@ public abstract class AbstractTicketDelegator<T extends Ticket> implements Ticke
}
@Override
- public final long getCreationTime() {
+ public final ZonedDateTime getCreationTime() {
return this.ticket.getCreationTime();
}
| [AbstractTicketDelegator->[getCountOfUses->[getCountOfUses],updateTicket->[updateTicket],equals->[equals],getId->[getId],getCreationTime->[getCreationTime],hashCode->[hashCode],isExpired->[isExpired],getGrantingTicket->[getId,getTicket,getGrantingTicket]]] | Gets the creation time of the block. | Don't think this will work with JPA ticket registries. We'll likely run into either schema or serialization issues. Let's keep this as long. |
@@ -35,15 +35,15 @@ class SamlRequestPresenter
attr_reader :request, :service_provider
def ial2_authn_context?
- Saml::Idp::Constants::IAL2_AUTHN_CONTEXTS.include?(authn_context)
+ (Saml::Idp::Constants::IAL2_AUTHN_CONTEXTS & authn_context).present?
end
def ialmax_authn_context?
- Saml::Idp::Constants::IALMAX_AUTHN_CONTEXT_CLASSREF == authn_context
+ authn_context.include? Saml::Idp::Constants::IALMAX_AUTHN_CONTEXT_CLASSREF
end
def authn_context
- request.requested_authn_context
+ request.requested_authn_contexts
end
def bundle
| [SamlRequestPresenter->[authn_request_bundle->[requested_attributes]]] | Checks if a node is a missing authentication context or not. | can we pluralize this now too? |
@@ -85,9 +85,14 @@ class CampaignRules {
if (opts.beforeCampaign && opts.duringCampaign) {
throw new Error('beforeCampaign and duringCampaign args are incompatible')
}
- const whereClause = {
- ethAddress: ethAddress.toLowerCase()
- }
+
+ // Load any proxy associated with the wallet address.
+ const ownerAddress = ethAddress.toLowerCase()
+ const proxies = await db.Proxy.findAll({ where: { ownerAddress } })
+
+ // Query events from wallet and proxy(ies).
+ const addresses = [ownerAddress, ...proxies.map(proxy => proxy.address)]
+ const whereClause = { ethAddress: { [Sequelize.Op.in]: addresses } }
const endDate = opts.beforeCampaign
? this.campaign.startDate
| [No CFG could be retrieved] | Get the referral reward value if any defined in the campaign. Helper method to calculate level based on a set of events. | Should we call `toLowerCase()` on proxy addresses as well? |
@@ -1996,7 +1996,7 @@ void sn76477_device::sound_stream_update(sound_stream &stream, stream_sample_t *
*/
*buffer++ = (((voltage_out - OUT_LOW_CLIP_THRESHOLD) / (OUT_CENTER_LEVEL_VOLTAGE - OUT_LOW_CLIP_THRESHOLD)) - 1) * 32767;
- if (LOG_WAV && LOG_WAV_ENABLED_ONLY && !m_enable)
+ if (LOG_WAV && (!LOG_WAV_ENABLED_ONLY || (LOG_WAV_ENABLED_ONLY && !m_enable)))
{
int16_t log_data_l;
int16_t log_data_r;
| [No CFG could be retrieved] | - - - - - - - - - - - - - - - - - - This function calculates the log - values of the two WAV gain logs. | You could write the expression as `(LOG_WAV && (!LOG_WAV_ENABLED_ONLY || !m_enable))` and make it more obvious what it does, but why did you change the condition? Is it out of sync with something else? |
@@ -264,7 +264,7 @@ class Receiver(object):
return self._handler._received_messages.qsize()
return 0
- def receive(self, max_batch_size=None, timeout=None):
+ def receive(self, max_batch_size=None, timeout=None, max_reconnect_retries=None):
"""
Receive events from the EventHub.
| [Receiver->[receive->[close,reconnect],reconnect->[_reconnect],close->[close],_reconnect->[open],open->[open]]] | Returns the current size of the unprocessed Event queue. Detaches from the receiver and returns the next block ID. | This new parameter only seems to get added to the synchronous receiver and not the async one? |
@@ -342,7 +342,7 @@ static int osquery_ioctl(dev_t dev, u_long cmd, caddr_t data,
switch (cmd) {
case OSQUERY_IOCTL_SUBSCRIPTION:
sub = (osquery_subscription_args_t *)data;
- if ((err = subscribe_to_event(sub->event, sub->subscribe))) {
+ if ((err = subscribe_to_event(sub->event, sub->subscribe, sub->udata))) {
goto error_exit;
}
break;
| [No CFG could be retrieved] | This function is used to test the number of events that are being written to the OSQuery Reads the user - specified character device switch structure. | Is there any way to guarantee a size of `data`? Or at least to make sure it's not `== NULL`? |
@@ -0,0 +1,9 @@
+package <%=packageName%>.config;
+
+/**
+ * a simple annotation, to be used for easy exclusion from component scan
+ *
+ * @author David Steiman
+ */
+public @interface ExcludedFromComponentScan {
+}
| [No CFG could be retrieved] | No Summary Found. | I'm not a big fan of this annotation: it should be a standard Spring Boot annotation (need to check if this exists), or we can just exclude classes as usual. And it's only used once here. It could be a good idea (if it doesn't already exists in Spring Boot), but then we would need to use it elsewhere in our code (we have other exclusions), and that should be another PR as it's a different issue. |
@@ -50,8 +50,8 @@ func TestInputUsage(t *testing.T) {
func TestGoPackageName(t *testing.T) {
assert.Equal(t, "aws", goPackage("aws"))
- assert.Equal(t, "azure", goPackage("azure-nextgen"))
- assert.Equal(t, "plant", goPackage("plant-provider"))
+ assert.Equal(t, "azurenextgen", goPackage("azure-nextgen"))
+ assert.Equal(t, "plantprovider", goPackage("plant-provider"))
assert.Equal(t, "", goPackage(""))
}
| [Dir,FindExecutable,PathExists,ImportLanguages,typeString,StringSlice,TestTypeNameCodegen,ReadFile,Logf,Join,Equal,RunCommand,NoError,Base,Split,getInputUsage,ImportSpec,Sprintf,Unmarshal,TestSDKCodegen,NotEmpty,Abs,Run,True] | TestPackage tests that the given type is an input type that accepts FooArray and FooArray GeneratePackage - function to generate package with optional extraFile - function to infer module name from. | Do we know what effect (if any) this change will have on azure-native and aws-native? |
@@ -80,6 +80,7 @@ public final class OMFileRequest {
// Check if this is actual file or a file in the given path
if (dbKeyName.equals(fileNameFromDetails)) {
result = OMDirectoryResult.FILE_EXISTS;
+ parentExists = true;
} else {
result = OMDirectoryResult.FILE_EXISTS_IN_GIVENPATH;
}
| [OMFileRequest->[getObjIdRangeFromTxId->[getObjIDFromTxId]]] | Verify that files in the given path exist in the given Ozone key table. Returns missing or inherited result if found. | This should be false as this is a file and not a directory |
@@ -4020,10 +4020,11 @@ zfs_do_send(int argc, char **argv)
sendflags_t flags = { 0 };
int c, err;
nvlist_t *dbgnv = NULL;
- boolean_t extraverbose = B_FALSE;
+ char *redactbook = NULL;
struct option long_options[] = {
{"replicate", no_argument, NULL, 'R'},
+ {"redact-bookmark", required_argument, NULL, REDACT_OPT},
{"props", no_argument, NULL, 'p'},
{"parsable", no_argument, NULL, 'P'},
{"dedup", no_argument, NULL, 'D'},
| [No CFG could be retrieved] | Reads the arguments for the command - line and returns the number of bytes read from Parse command line options and return a handle to the target file. | Why is the long option here `--redact-bookmark` which isn't consistent with the man pages, `zfs -?` output, or test cases. It does seem to work (which surprised me) but shouldn't it simply be changed to "redact"? |
@@ -176,7 +176,11 @@ func (f *Frontend) handle(w http.ResponseWriter, r *http.Request) {
hs[h] = vs
}
w.WriteHeader(resp.StatusCode)
- io.Copy(w, resp.Body)
+
+ if _, err = io.Copy(w, resp.Body); err != nil {
+ server.WriteError(w, err)
+ return
+ }
}
func writeError(w http.ResponseWriter, err error) {
| [Handler->[HandlerFunc,GzipHandler],queueRequest->[StartSpanFromContext,Unlock,ExtractOrgID,Now,Lock,Broadcast,Add],RegisterFlags->[DurationVar,BoolVar,StringVar,IntVar],Close->[Wait,Lock,Unlock],Process->[Context,Send,Broadcast,getNextRequest,Recv,Err,Done],getNextRequest->[Unlock,Add,Finish,Seconds,Observe,Lock,Broadcast,Err,Shuffle,Wait,Since],RoundTripGRPC->[Context,queueRequest,GlobalTracer,Inject,Err,Done,SpanFromContext],RoundTrip->[Context,NewReader,NopCloser,HTTPRequest,RoundTripGRPC],handle->[Context,WriteError,Header,Copy,Sprintf,ExtractOrgID,Now,String,Log,Info,Since,RoundTrip,WriteHeader],NewCond,WriteError,Join,Error,NewGauge,NewHistogram,Errorf,Parse,With,RoundTrip] | handle is the main HTTP handler for the user. | I can't understand how this could could work. It will write the HTTP header but it has already been written above. Am I missing anything @dmitsh? |
@@ -1606,6 +1606,7 @@ define([
}
scene._primitives.update(context, frameState, commandList);
+ scene._groundPrimitives.update(context, frameState, commandList);
}
function callAfterRenderFunctions(frameState) {
| [No CFG could be retrieved] | Executes commands in order by pass. This function is used to avoid the extra copy of the pick depth. | Do you think we should do this before `_primitives.update` so all ground primitives are drawn below all primitives if both were to have `GroundPrimitive`s? |
@@ -15,12 +15,11 @@ class RepositoryColumn < ApplicationRecord
auto_strip_attributes :name, nullify: false
validates :name,
- presence: true,
length: { maximum: Constants::NAME_MAX_LENGTH },
uniqueness: { scope: :repository_id, case_sensitive: true }
- validates :created_by, presence: true
- validates :repository, presence: true
- validates :data_type, presence: true
+ validates :name, :data_type, :repository, :created_by, presence: true
+ validates :range, inclusion: { in: [true, false] }, if: :repository_date_time_value?
+ validates :range, absence: true, unless: :repository_date_time_value?
after_create :update_repository_table_states_with_new_column
around_destroy :update_repository_table_states_with_removed_column
| [RepositoryColumn->[update_repository_table_states_with_new_column->[update_states_with_new_column,new],importable?->[to_sym,include?],update_repository_table_states_with_removed_column->[update_states_with_removed_column,to_s,new],name_like->[where],accepts_nested_attributes_for,auto_strip_attributes,belongs_to,enum,scope,validates,after_create,where,has_many,around_destroy]] | Properties for the given application record. This method is used to destroy a record in the table. It will update the repository table. | It does not belong to here |
@@ -915,8 +915,6 @@ int load_key_certs_crls(const char *uri, int maybe_stdin,
uidata.prompt_info = uri;
if (uri == NULL) {
- BIO *bio;
-
if (!maybe_stdin) {
BIO_printf(bio_err, "No filename or uri specified for loading");
goto end;
| [No CFG could be retrieved] | Reads the next expected object from the input stream. Reads the file specified by uri and returns the index of the object in the file. | I suppose you could also do BIO_free() immediately after the OSSL_STORE_attach(). |
@@ -185,6 +185,13 @@ func ValidateLDAPQuery(query api.LDAPQuery, fldPath *field.Path) ValidationResul
"timeout must be equal to or greater than zero"))
}
+ if isDNOnly {
+ if len(query.Filter) != 0 {
+ validationResults.AddErrors(field.Invalid(fldPath.Child("filter"), query.Filter, `cannot specify a filter when using "dn" as the UID attribute`))
+ }
+ return validationResults
+ }
+
if _, err := ldap.CompileFilter(query.Filter); err != nil {
validationResults.AddErrors(field.Invalid(fldPath.Child("filter"), query.Filter,
fmt.Sprintf("invalid query filter: %v", err)))
| [Invalid,Error,DetermineDerefAliasesBehavior,Append,AddErrors,Sprintf,DetermineLDAPScope,CompileFilter,ParseURL,ResolveStringValue,Child,AddWarnings,ParseDN,NewPath,Required] | Validate the given query object. | This implicitly disallows not specifying a filter, so how is the validation not failing for those missing filters? |
@@ -160,8 +160,9 @@ namespace System.Tests
Assert.True(libyaLocalTime.Equals(expectResult), string.Format("Expected {0} and got {1}", expectResult, libyaLocalTime));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows))]
- public static void TestYukunTZ()
+ [Fact]
+ [PlatformSpecific(TestPlatforms.Windows)]
+ public static void TestYukonTZ()
{
try
{
| [TimeZoneInfoTests->[ConvertTimeFromUtc->[ConvertTimeFromUtc],ConvertTime_DateTime_LocalToSystem->[ConvertTime],VerifyConvertToUtcException->[ConvertTimeToUtc],ConvertTimeFromToUtc_UnixOnly->[ConvertTimeToUtc,ConvertTimeFromUtc,Kind],GetSystemTimeZones->[GetSystemTimeZones],ConvertTimeBySystemTimeZoneIdTests->[ConvertTimeToUtc],VerifyInv->[IsInvalidTime],CreateCustomTimeZone->[CreateCustomTimeZone],VerifyConvert->[ConvertTime,Kind],LibyaTimeZone->[ConvertTime],VerifyDST->[IsDaylightSavingTime],ConvertTimeFromToUtc->[ConvertTimeToUtc,ConvertTimeFromUtc,Kind],TimeZoneInfo_DisplayNameStartsWithOffset->[GetSystemTimeZones],ConvertTime_DateTime_LocalToLocal->[ConvertTime],VerifyCustomTimeZoneException->[CreateCustomTimeZone],VerifyConvertException->[ConvertTime],RussianTimeZone->[ConvertTime],ConvertTimeToUtc->[ConvertTimeToUtc],ConvertTime->[ConvertTime],HasSameRules_NullAdjustmentRules->[CreateCustomTimeZone],SystemTimeZonesTestData->[GetSystemTimeZones],TimeZoneInfo_DoesConvertTimeForOldDatesOfTimeZonesWithExceedingMaxRange->[ConvertTime],ClearCachedData->[ClearCachedData,ConvertTime],TimeZoneInfo->[CreateCustomTimeZone],ChangeLocalTimeZone->[ClearCachedData],VerifyRoundTrip->[ConvertTime,Kind],TimeZoneInfo_DaylightDeltaIsNoMoreThan12Hours->[GetSystemTimeZones],ConvertTime_NullTimeZone_ThrowsArgumentNullException->[ConvertTime],GetSystemTimeZones_AllTimeZonesHaveOffsetInValidRange->[GetSystemTimeZones]]] | Tests if a time zone with the specified name has a specific time offset in the library. Tests that the TZ data is consistent with the Yukon data. | Why the change from `ConditionalFact`? |
@@ -898,9 +898,9 @@ amp.htmlparser.HtmlParser.INSIDE_TAG_TOKEN_ = new RegExp(
('(?:' +
// Allow attribute names to start with /, avoiding assigning the / in
// close-tag syntax */>.
- '([^\\t\\r\\n /=>][^\\t\\r\\n =>]*|' + // e.g. "href"
- '[^\\t\\r\\n =>]+[^ >]|' + // e.g. "/asdfs/asd"
- '\/+(?!>))' + // e.g. "/"
+ '([^\\t\\r\\n /=>][^\\t\\r\\n =>]*|' + // e.g. "href"
+ '[^\\t\\r\\n =>]+[^ >]|' + // e.g. "/asdfs/asd"
+ '\/+(?!>))' + // e.g. "/"
// Optionally followed by:
('(' +
'\\s*=\\s*' +
| [No CFG could be retrieved] | A regular expression that matches any of the regular expressions that are not part of a tag token RegExp that matches the next token in a tag. | boo. sad lint can't accept this |
@@ -387,7 +387,7 @@ type DeploymentLogOptions struct {
// Follow if true indicates that the deployment log should be streamed until
// the deployment terminates.
Follow bool
- // If true, return previous terminated container logs
+ // If true, return previous deployment logs
Previous bool
// A relative time in seconds before the current time from which to show logs. If this value
// precedes the time a pod was started, only logs since the pod start will be returned.
| [No CFG could be retrieved] | Type represents the type of the that is returned. | Is this already wired up? I don't see it where I expected to find it. |
@@ -350,6 +350,17 @@ func (bc *BuildController) createPodSpec(originalBuild *buildapi.Build, ref stri
}
}
+ // set the pushSecret that will be needed by the build to push the image to the registry
+ // at the end of the build.
+ build.Spec.Output.PushSecret = secret
+
+ // ensure the build object the pod sees starts with a clean set of reasons/messages,
+ // rather than inheriting the potential "invalidoutputreference" message from the current
+ // build state. Otherwise when the pod attempts to update the build (e.g. with the git
+ // revision information), it will re-assert the stale reason/message.
+ build.Status.Reason = ""
+ build.Status.Message = ""
+
// Invoke the strategy to create a build pod.
podSpec, err := bc.createStrategy.CreateBuildPod(build)
if err != nil {
| [createBuildPod->[createPodSpec,resolveOutputDockerImageReference]] | createPodSpec creates a pod spec for the given build. Handle resolving ValueFrom references in build environment variables. | Does this code actually have any effect? If not, I appreciate the belt and braces, but I'm worried that it will confuse more than it will protect. I think it should be removed if possible. |
@@ -284,6 +284,7 @@ public class JParser {
converter.sema = new JSema(astNode.getAST());
converter.compilationUnit = astNode;
converter.tokenManager = new TokenManager(lex(version, unitName, sourceChars), source, new DefaultCodeFormatterOptions(new HashMap<>()));
+ converter.labels = new LinkedList<>();
JavaTree.CompilationUnitTreeImpl tree = converter.convertCompilationUnit(astNode);
tree.sema = converter.sema;
| [JParser->[convertTypeDeclaration->[addEmptyDeclarationsToList,declaration,firstTokenBefore],convertArguments->[firstTokenAfter],addStatementToList->[declaration,firstTokenAfter],convertModuleDirective->[lastTokenIn,firstTokenIn,convertModuleNames,convertModuleName,firstTokenBefore,firstTokenAfter],createExpression->[nextTokenIndex,lastTokenIn,declaration,convertExpression,firstTokenIn,firstTokenIndexAfter,convertArguments,convertBlock,createVariable,convertTypeArguments,createSyntaxToken,convertSwitchStatements,firstTokenBefore,firstTokenAfter,usage,convertSimpleName,processBodyDeclaration],convertSwitchStatements->[lastTokenIn,firstTokenIn,addStatementToList],convertTypeParameters->[createSpecialToken,firstTokenBefore],convertTypeArguments->[createSpecialToken,convertTypeArguments,firstTokenBefore],convertAnnotations->[convertExpression],applyExtraDimensions->[firstTokenIn],convertModuleDeclaration->[lastTokenIn,firstTokenAfter,firstTokenIn,firstTokenBefore],convertModuleNames->[convertModuleName,firstTokenBefore],convertModuleName->[firstTokenIn,convertModuleName],addVariableToList->[declaration,firstTokenAfter,firstTokenBefore],processBodyDeclaration->[convertTypeDeclaration,firstTokenIn,declaration,addEmptyDeclarationsToList,firstTokenBefore,firstTokenAfter],addEmptyDeclarationsToList->[createSyntaxToken],convertBlock->[lastTokenIn,firstTokenIn],convertModifier->[convertExpression,firstTokenIn],convertType->[nextTokenIndex,lastTokenIn,convertExpression,firstTokenIn,convertType,createSyntaxToken,firstTokenAfter,convertTypeArguments,convertSimpleName],processEnumConstantDeclaration->[lastTokenIn,declaration,firstTokenIn,firstTokenIndexAfter,createSyntaxToken,firstTokenAfter,usage],convertCompilationUnit->[firstTokenAfter,lastTokenIn,addEmptyDeclarationsToList,firstTokenIn],convertStatement->[nextTokenIndex,lastTokenIn,convertTypeDeclaration,firstTokenIn,convertStatement,convertBlock,convertArguments,createVariable,createSyntaxToken,convertTypeArguments,firstTokenBefore,addVariableToList,firstTokenAfter,usage,convertSimpleName],createVariable->[applyExtraDimensions,declaration,firstTokenAfter],parse->[parse,JParser],setParents->[setParents],convertSimpleName->[firstTokenIn],Op]] | Parse a CompilationUnitTree. | All above assignments use data that is not available at field declaration. The new one doesn't, so initialization can be moved to declaration and field can be made `final`. |
@@ -308,6 +308,7 @@ class CurveModel:
new_values = np.random.randn(NUM_OF_INSTANCE, self.effective_model_num) * STEP_SIZE + self.weight_samples
new_values = self.normalize_weight(new_values)
# compute alpha(i, j) = min{1, P(j)Q(j, i)/P(i)Q(i, j)}
+ # pylint: disable=assignment-from-no-return
alpha = np.minimum(1, self.target_distribution(new_values) / self.target_distribution(self.weight_samples))
# sample u
u = np.random.rand(NUM_OF_INSTANCE)
| [CurveModel->[sigma_sq->[f_comb],normal_distribution->[sigma_sq,f_comb],prior->[f_comb],likelihood->[normal_distribution],f_comb->[predict_y],target_distribution->[prior,likelihood],predict->[filter_curve,mcmc_sampling,f_comb,fit_theta],mcmc_sampling->[target_distribution,normalize_weight]]] | Adjust the weight of each function using mcmc sampling. Update weight samples. | Not needed. Use latest pylintrc. |
@@ -242,7 +242,7 @@ export default function initPrimaryCategory( $ ) {
updatePrimaryTermSelectors( taxonomyName );
// The clicked link will be hidden so we need to focus something different.
- checkbox.focus();
+ checkbox.trigger( "focus" );
};
}
| [No CFG could be retrieved] | Register a custom primary term selector filter. YSTSEOPrimaryCategory component that initializes the YSTSEOPrimaryCategory metabox. | 1. Install and activate the `Classic Editor` plugin. 2. Create a new post in the classic editor. 3. Select 2 categories. 4. Click `Make primary`. 3. No `JQMIGRATE: jQuery.fn.focus() event shorthand is deprecated` warning should be thrown. |
@@ -151,5 +151,16 @@ define([
return false;
};
+ /**
+ * Gets a value indicating whether or not the provider includes vertex normals.
+ *
+ * @memberof EllipsoidTerrainProvider
+ *
+ * @returns {Boolean} True if the provider has vertex normals; otherwise, false.
+ */
+ EllipsoidTerrainProvider.prototype.hasVertexNormals = function() {
+ return false;
+ };
+
return EllipsoidTerrainProvider;
});
\ No newline at end of file
| [No CFG could be retrieved] | Elevation TerrainProvider. | You don't need `@memberof`. |
@@ -413,11 +413,7 @@ define([
typeof other !== 'undefined' &&
this._show === other._show &&
this._width === other._width &&
- this._outlineWidth === other._outlineWidth &&
- this._horizontalOrigin === other._horizontalOrigin &&
- cartesian3ArrayEquals(this._positions, other._positions) &&
- Color.equals(this._color, other._color) &&
- Color.equals(this._outlineColor, other._outlineColor);
+ cartesian3ArrayEquals(this._positions, other._positions);
};
function cartesian3ArrayEquals(a, b) {
| [No CFG could be retrieved] | Determines if this polyline equals another polyline. | Does this need to consider the material? Do materials have an `equals` function? Who uses `Polyline.equals`? Is it really needed? |
@@ -6,6 +6,17 @@ require 'text_cleaner'
class QualityTitleValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
sentinel = TextSentinel.title_sentinel(value)
- record.errors.add(attribute, :is_invalid) unless sentinel.valid?
+
+ if !sentinel.valid?
+ if !sentinel.seems_meaningful?
+ record.errors.add(attribute, :is_invalid_meaningful)
+ elsif !sentinel.seems_unpretentious?
+ record.errors.add(attribute, :is_invalid_unpretentious)
+ elsif !sentinel.seems_quiet?
+ record.errors.add(attribute, :is_invalid_quiet)
+ else
+ record.errors.add(attribute, :is_invalid)
+ end
+ end
end
end
| [QualityTitleValidator->[validate_each->[add,title_sentinel,valid?]],require] | Validates each record attribute to ensure that it is unique for each record. | Do we need `unless sentinel.valid?` when this path is only reached when `if !sentinel.valid?` |
@@ -178,7 +178,7 @@ public class TestCSVRecordReader {
final Record record = reader.nextRecord(false, false);
// When the values are not in the expected format, a String is returned unmodified
- assertEquals("11/30/1983", (String)record.getValue("date"));
+ assertEquals("11/30/1983", record.getValue("date"));
}
}
| [TestCSVRecordReader->[testReadRawWithDifferentFieldName->[getDefaultFields,createReader],testExcelFormat->[createReader],testMultipleRecords->[getDefaultFields,createReader],testExtraWhiteSpace->[getDefaultFields,createReader],testMissingField->[getDefaultFields,createReader],testFieldInSchemaButNotHeader->[getDefaultFields,createReader],testMultipleRecordsEscapedWithSpecialChar->[getDefaultFields,createReader],testSimpleParse->[getDefaultFields,createReader],testExtraFieldNotInHeader->[getDefaultFields,createReader]]] | testDateNoCoersionUnexpectedFormat - Test if date is in the expected format. | You may want to test with multiple duplicates, id, name, country, id, name, country. Also, I assume case doesn't matter, but that is an assumption. id, name, country, ID, NAME, COUNTRY |
@@ -1081,11 +1081,14 @@ class StorageContainerTest(StorageTestCase):
assert not blob_ref2.blob_tier_inferred
assert blob_ref2.blob_tier_change_time is not None
+ try:
response = container.delete_blobs(
'blob1',
'blob2',
'blob3',
)
+ except:
+ pass
@pytest.mark.skip(reason="Wasn't able to get premium account with batch enabled")
# once we have premium tests, still we don't want to test Py 2.7
| [StorageContainerTest->[test_set_container_acl_with_signed_identifiers->[_create_container],test_lease_container_acquire_and_release->[_create_container],test_list_containers_with_public_access->[_create_container],test_set_container_acl_with_one_signed_identifier->[_create_container],test_list_containers->[_create_container],test_set_container_acl_too_many_ids->[_create_container],test_get_container_acl->[_create_container],test_delete_container_with_existing_container->[_create_container],test_set_container_acl_with_lease_id->[_create_container],test_list_blobs_with_include_copy->[_create_container],test_list_containers_with_num_results_and_marker->[_create_container],test_set_container_metadata_with_non_existing_container->[_get_container_reference],test_list_blobs->[_create_container],test_lease_container_change_lease_id->[_create_container],test_delete_blobs_simple->[_create_container],test_set_container_acl_with_three_identifiers->[_create_container],test_list_names->[_create_container],test_list_blobs_with_num_results->[_create_container],test_create_container->[_get_container_reference],test_get_container_acl_with_lease_id->[_create_container],test_get_container_metadata_with_lease_id->[_create_container],test_lease_container_with_duration->[_create_container],test_list_blobs_with_delimiter->[_create_container],test_list_blobs_leased_blob->[_create_container],test_set_container_acl_with_empty_identifiers->[_create_container],test_shared_access_container->[_create_container],test_lease_container_break_period->[_create_container],test_list_blobs_with_prefix->[_create_container],test_set_container_metadata_with_lease_id->[_create_container],test_lease_container_renew->[_create_container],test_lease_container_with_proposed_lease_id->[_create_container],test_list_containers_with_include_metadata->[_create_container],test_set_container_acl_with_empty_access_policy->[_create_container],test_delete_blobs_snapshot->[_create_container],test_delete_container_with_non_existing_container_fail_not_exist->[_get_container_reference],test_get_container_metadata->[_create_container],test_lease_container_break_released_lease_fails->[_create_container],test_set_container_acl_with_empty_signed_identifiers->[_create_container],test_list_blobs_with_include_snapshots->[_create_container],test_container_exists_with_lease->[_create_container],test_set_container_acl->[_create_container],test_get_container_properties_with_lease_id->[_create_container],test_lease_container_twice->[_create_container],test_create_container_with_metadata->[_get_container_reference],_create_container->[_get_container_reference],test_create_container_with_public_access_blob->[_get_container_reference],test_set_container_acl_with_public_access->[_create_container],test_set_container_metadata->[_create_container],test_delete_container_with_lease_id->[_create_container],test_list_blobs_with_include_uncommittedblobs->[_create_container],test_standard_blob_tier_set_tier_api_batch->[_create_container],test_create_container_with_public_access_container->[_get_container_reference],test_list_blobs_with_include_metadata->[_create_container],test_list_blobs_with_include_multiple->[_create_container],test_walk_blobs_with_delimiter->[recursive_walk->[recursive_walk],recursive_walk,_create_container],test_list_containers_with_prefix->[_create_container],test_get_container_properties->[_create_container],test_create_container_with_already_existing_container_fail_on_exist->[_get_container_reference]]] | Test standard blob tier set tier api batch. | Why are we passing all exceptions here? The test could be failing |
@@ -258,7 +258,7 @@ class Jetpack_Sync_Full {
public function expand_options( $args ) {
if ( $args[0] ) {
- return $this->get_client()->get_all_options();
+ return Jetpack_Sync_Modules::get_module( "options" )->get_all_options();
}
return $args;
| [Jetpack_Sync_Full->[enqueue_all_users->[enqueue_all_ids_as_action],update_queue_progress->[get_status,update_status],update_status->[get_status],update_sent_progress->[get_status],expand_post_ids->[get_client],enqueue_all_comments->[enqueue_all_ids_as_action],expand_users->[get_client]]] | Expand the options to be used by the client. | Does it makes sense to move all this expand methods inside each module? |
@@ -877,7 +877,7 @@ namespace System.Text.Json.SourceGeneration
if (!type.TryGetDeserializationConstructor(useDefaultCtorInAnnotatedStructs, out ConstructorInfo? constructor))
{
classType = ClassType.TypeUnsupportedBySourceGen;
- _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(MultipleJsonConstructorAttribute, Location.None, new string[] { $"{type}" }));
+ _typeLevelDiagnostics.Add((type, MultipleJsonConstructorAttribute, new string[] { $"{type}" }));
}
else
{
| [JsonSourceGenerator->[Parser->[PropertyIsOverridenAndIgnored->[Type],GetSerializerOptions->[GetJsonSourceGenerationModeEnumVal],PopulateKnownTypes->[PopulateNumberTypes]]]] | Get or add a type generation spec for the given type. Returns the type of the object that can be converted to a class. The generic arguments for the key - value pair are the types of the key - value pair The type is the base class of the type that is used to convert the object into the Returns a type that can be used to create a new object. | Out of curiosity, what necessitated the change from reporting the diagnostic directly to storing in a set? Were there duplicates? Probably not in scope for this PR, but in future iterations I would recommend doing the same for emitted member-level diagnostics (in other words, we should try to make the mapping layer pure). |
@@ -254,6 +254,13 @@ public abstract class AbstractDeploymentTestCase extends AbstractMuleTestCase {
new SingleClassCompiler().compile(getResourceFile("/org/foo/LoadsAppResourceCallback.java"));
pluginEcho1TestClassFile =
new SingleClassCompiler().dependingOn(barUtils1_0JarFile).compile(getResourceFile("/org/foo/Plugin1Echo.java"));
+
+ FieldUtils.writeDeclaredStaticField(ModuleDelegatingEntityResolver.class, "internalIsRunningTests", true, true);
+ }
+
+ @BeforeClass
+ public static void afterClass() throws IllegalAccessException {
+ FieldUtils.writeDeclaredStaticField(ModuleDelegatingEntityResolver.class, "internalIsRunningTests", false, true);
}
protected static File getResourceFile(String resource) throws URISyntaxException {
| [AbstractDeploymentTestCase->[assertApplicationRedeploymentSuccess->[assertRedeploymentSuccess],assertFailedDomainRedeploymentSuccess->[assertFailedArtifactRedeploymentSuccess],addExplodedAppFromBuilder->[addExplodedAppFromBuilder],createPolicyIncludingHelloPluginV2FileBuilder->[createBundleDescriptorLoader],assertDeploymentSuccess->[describeFailure->[describeFailure]],createBundleDescriptorLoader->[createBundleDescriptorLoader],addExplodedDomainFromBuilder->[addExplodedDomainFromBuilder],redeployAndVerifyPropertyInRegistry->[assertConditionOnRegistry],assertUndeploymentSuccess->[describeFailure->[describeFailure]],assertStatus->[assertStatus],assertAtLeastOneUndeploymentSuccess->[describeFailure->[describeFailure]],assertDomainRedeploymentSuccess->[assertRedeploymentSuccess],assertMuleContextCreated->[describeFailure->[describeFailure]],assertFailedDomainRedeploymentFailure->[assertFailedArtifactRedeploymentFailure],assertMuleContextInitialized->[describeFailure->[describeFailure]],assertFailedApplicationRedeploymentSuccess->[assertFailedArtifactRedeploymentSuccess],addPackedAppFromBuilder->[addPackedAppFromBuilder],assertFailedApplicationRedeploymentFailure->[assertFailedArtifactRedeploymentFailure],assertDeploymentFailure->[describeFailure->[describeFailure],assertDeploymentFailure],deployAndVerifyPropertyInRegistry->[assertConditionOnRegistry],assertApplicationRedeploymentFailure->[assertRedeploymentFailure],createHelloExtensionV1PluginFileBuilder->[createBundleDescriptorLoader],addPackedDomainFromBuilder->[addPackedDomainFromBuilder],createHelloExtensionV2PluginFileBuilder->[createBundleDescriptorLoader],assertDomainRedeploymentFailure->[assertRedeploymentFailure]]] | This method is called before the class is compiled. This method is used to find a file in the classpath that is not a dependency on the. | get the previous value in `before` and reset that here instead of `false`. Maybe use a `@Rule` |
@@ -25,6 +25,10 @@ class SiteConfigurationTest < ActiveSupport::TestCase
assert_equal ["GobiertoDevelopment"], site_configuration.modules
end
+ def test_available_modules?
+ assert site_configuration.available_module?("GobiertoDevelopment")
+ end
+
def test_modules?
assert site_configuration.modules?
end
| [SiteConfigurationTest->[test_available_locales->[assert_equal,available_locales],test_default_locale->[default_locale,assert_equal],test_default_locale?->[assert,default_locale?],test_logo->[assert_equal,logo],page->[gobierto_cms_pages],site_configuration->[new],site->[sites],test_links_markup->[links_markup,assert_equal],test_modules->[assert_equal,modules],test_logo_with_fallback_when_logo_is_not_present->[assert_equal,new,logo_with_fallback],test_configuration_variables->[assert_equal,configuration_variables],test_demo?->[assert,demo?],test_links_markup?->[assert,links_markup?],test_not_whitelisted_properties->[assert_raises,wadus],site_configuration_params->[id],test_logo?->[assert,logo?],test_modules?->[assert,modules?],test_logo_with_fallback_when_logo_is_present->[assert_equal,logo_with_fallback],test_demo->[assert_equal,demo],test_privacy_page->[assert,privacy_page,assert_equal,privacy_page?]],require] | Checks that the modules and logo are not nil. | Prefer single-quoted strings when you don't need string interpolation or special symbols. |
@@ -87,6 +87,17 @@ public final class DefaultFilenamePolicy extends FilenamePolicy {
private final String shardTemplate;
private final String suffix;
+ /*
+ * Checks whether given template contains enough information to form windowed file names
+ */
+ static boolean isWindowedTemplate(String template){
+ if (template != null){
+ Matcher m = WINDOWED_FORMAT_RE.matcher(template);
+ return m.find();
+ }
+ return false;
+ }
+
/**
* Constructs a fully qualified name from components.
*
| [DefaultFilenamePolicy->[unwindowedFilename->[constructName],constructUsingStandardParameters->[DefaultFilenamePolicy]]] | Construct a name from the provided prefix shard template and suffix. This method is used to find all shard numbers in the shard template. | I'm not sure this does what you want - it will be true if the template contains at least one of the parameters, right? |
@@ -4,8 +4,11 @@ module Users
before_action :confirm_two_factor_authenticated, if: :two_factor_enabled?
def new
- analytics.track_event(Analytics::WEBAUTHN_SETUP_VISIT)
+ result = WebauthnVisitForm.new.submit(params)
+ analytics.track_event(Analytics::WEBAUTHN_SETUP_VISIT, result.to_h)
save_challenge_in_session
+ @exclude_credentials = exclude_credentials
+ flash_error(result.errors) unless result.success?
end
def confirm
| [WebauthnSetupController->[two_factor_enabled?->[two_factor_enabled?],url_after_successful_webauthn_setup->[new],confirm->[new]]] | Returns the next non - nil OIDC number. | I'd probably consider putting this in a presenter, but not necessary atm (future refactoring opportunity). |
@@ -3,10 +3,10 @@
class BioEddieAssetsController < ApplicationController
include ActiveStorage::SetCurrent
- before_action :load_vars, except: :create
+ before_action :load_vars, except: %i(create bmt_request)
before_action :load_create_vars, only: :create
- before_action :check_read_permission
+ before_action :check_read_permission, except: %i(update create start_editing bmt_request)
before_action :check_edit_permission, only: %i(update create start_editing)
def create
| [BioEddieAssetsController->[create->[render_to_string,errors,render,create_molecule],load_vars->[step,protocol,my_module,result,find_by],check_read_permission->[can_read_protocol_in_module?,can_read_protocol_in_repository?,experiment,can_read_experiment?],update->[update_molecule,render,medium_preview,metadata,t,id,rails_representation_url],check_edit_permission->[can_manage_protocol_in_module?,can_manage_module?,can_manage_protocol_in_repository?],load_create_vars->[protocol,find_by],bio_eddie_params->[permit],before_action,include]] | Creates a new object. | Prefer `only:`, especially if there are many exceptions (and `only:` is more explicit). |
@@ -19,8 +19,11 @@ def deform_conv2d(
dilation: Tuple[int, int] = (1, 1),
mask: Optional[Tensor] = None,
) -> Tensor:
- """
- Performs Deformable Convolution, described in Deformable Convolutional Networks
+ r"""
+ Performs Deformable Convolution v2, described in
+ `Deformable ConvNets v2: More Deformable, Better Results by Xizhou Zhu,
+ Han Hu, Stephen Lin, Jifeng Dai
+ <https://arxiv.org/abs/1811.11168>`__.
Arguments:
input (Tensor[batch_size, in_channels, in_height, in_width]): input tensor
| [deform_conv2d->[deform_conv2d],DeformConv2d->[forward->[deform_conv2d]]] | Deforms a 2 - D convolution of a . Univariate network conv2d with no extra padding padding dil_h dil_. | Lint is complaining about the training space in this line. |
@@ -273,6 +273,9 @@ class SubmissionsController < ApplicationController
@file_manager_errors = Hash.new
assignment_id = params[:assignment_id]
@assignment = Assignment.find(assignment_id)
+ required_assignments = AssignmentFile.where(
+ assignment_id: @assignment).pluck(:filename)
+ students_filename = []
@path = params[:path] || '/'
@grouping = current_user.accepted_grouping_for(assignment_id)
if @grouping.repository_external_commits_only?
| [SubmissionsController->[downloads_subdirectories->[downloads_subdirectories]]] | Updates the files of a . Delete files marked for deletion replace files and add new files if we have a commit and we have a commit we can t do anything else. | Shouldn't this variable be "required_files"? |
@@ -333,6 +333,18 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR
ctx.Session.Set("uid", u.ID)
ctx.Session.Set("uname", u.Name)
+ // Language setting of the user overwrites the one previously set
+ // If the user does not have a locale set, we save the current one.
+ if len(u.Language) == 0 {
+ u.Language = ctx.Locale.Language()
+ if err := models.UpdateUser(u); err != nil {
+ log.Error(4, fmt.Sprintf("Error updating user language [user: %d, locale: %s]", u.ID, u.Language))
+ return
+ }
+ }
+
+ ctx.SetCookie("lang", u.Language, nil, setting.AppSubURL)
+
// Clear whatever CSRF has right now, force to generate a new one
ctx.SetCookie(setting.CSRFCookieName, "", -1, setting.AppSubURL)
| [UpdateUserCols,Auth,RemoteAddr,LinkAccountToUser,IsErrTwoFactorNotEnrolled,GetSuperSecureCookie,QueryUnescape,RedirectToFirst,Delete,CreateUser,GetUser,GetUserByID,Info,Redirect,Set,ProviderCallback,RenderWithErr,Put,GetActiveOAuth2Providers,Activate,GetUserByEmail,HTML,Error,IsErrUserAlreadyExist,VerifyScratchToken,GetActiveOAuth2LoginSourceByName,NotFound,New,HashPassword,Errorf,GetExternalLogin,IsErrNameReserved,Trace,UserSignIn,HasError,IsErrEmailAlreadyUsed,GetTwoFactorByUID,TrimSpace,IsLocal,Tr,ServerError,SendActivateAccountMail,SetLastLogin,Language,CountUsers,IsErrNamePatternNotAllowed,VerifyActiveEmailCode,SetSuperSecureCookie,IsErrUserNotExist,SetCookie,GetUserSalt,EncodeMD5,GetUserByName,Get,UpdateTwoFactor,VerifyReq,Query,ValidateTOTP,Success,SendResetPasswordMail,GetCookie,MinutesToFriendly,IsOAuth2,VerifyUserActiveCode,Params,IsExist] | handleSignInFull handles the final part of the sign - in process of the user. SignInOAuth handles the OAuth2 login flow. | You should only update language column but not all the columns. |
@@ -215,6 +215,9 @@ public class NettyHttpClient extends AbstractHttpClient
log.debug("[%s] Resumed reads from channel (chunkNum = %,d).", requestDesc, resumeChunkNum);
}
}
+
+ long backPressureDuration = System.nanoTime() - backPressureStartTimeNs;
+ return backPressureDuration;
};
response = handler.handleResponse(httpResponse, trafficCop);
if (response.isFinished()) {
| [NettyHttpClient->[getHost->[getHost],getPoolKey->[getHost],go->[channelDisconnected->[exceptionCaught],exceptionCaught->[exceptionCaught]]]] | This method is used to handle a request with a specific . Handles a response message. Private method for handling a response. This method is called when a channel is caught or an exception occurs. This method is called when a channel write request is received. | I think backpressure duration should only be computed like this if we're in the `suspendWatermark >= 0 && resumeWatermark >= suspendWatermark` block above. Two reasons: 1. Access to backPressureStartTimeNs must be synchronized, since it's being accessed from multiple threads and it's not a volatile or atomic. 2. If we didn't actually resume anything, then we don't know if backpressure was actually happening (maybe, maybe not) so we shouldn't report a time. In this case, we should return 0. |
@@ -55,6 +55,7 @@ func (a *adapter) CreateLegacyTokenWithValue(ctx context.Context, value string)
// PurgeProject removes a project from every token it exists in
func (a *adapter) PurgeProject(ctx context.Context, projectID string) error {
+ a.logger.Info("starting project delete for id " + projectID)
_, err := a.db.ExecContext(ctx, "UPDATE chef_authn_tokens SET project_ids=array_remove(project_ids, $1)", projectID)
if err != nil {
return err
| [Reset->[ExecContext],CreateToken->[CreateTokenWithValue,GenerateNewToken],GetTokens->[QueryContext,Error,Warn,Next,Close,Wrap,Scan,Err,Array],PurgeProject->[ExecContext],ResetToV1->[ExecContext],GetTokenIDWithValue->[Scan,QueryRowContext],DeleteToken->[RowsAffected,ExecContext,Array],insertToken->[FromContext,ValidateProjectAssignment,QueryRowContext,Scan,FromIncomingMetadata,Array],UpdateToken->[FromContext,Commit,ValidateProjectAssignment,BeginTx,QueryRowContext,Scan,FromIncomingMetadata,Array],CreateTokenWithValue->[NewV4,String,IsValidToken,insertToken],GetToken->[Scan,Array,QueryRowContext],CreateLegacyTokenWithValue->[NewV4,String,IsValidLegacyToken,insertToken],ProjectsFromIncomingContext,AllProjectsRequested] | PurgeProject removes all tokens associated with a given project from the list of tokens. | Added consistent logging so we can tell what is going on with this multi-service operation. It is infrequent enough and complex enough that `info` level is warranted. |
@@ -188,7 +188,9 @@ def getiter_array(context, builder, sig, args):
iterobj.index = indexptr
iterobj.array = array
- return iterobj._getvalue()
+ res = iterobj._getvalue()
+ out = impl_ret_borrowed(context, builder, sig.return_type, res)
+ return out
def _getitem_array1d(context, builder, arrayty, array, idx, wraparound):
| [array_reshape->[populate_array,_attempt_nocopy_reshape,make_array],array_shape->[make_array],getitem_arraynd_intp->[populate_array,_getitem_array1d,make_array],_empty_nd_impl->[populate_array,make_array],numpy_arange_2->[arange->[arange]],numpy_empty_nd->[_parse_empty_args,_empty_nd_impl],iternext_numpy_ndindex->[make_ndindex_cls,iternext_specific],getitem_array_tuple->[populate_array,make_array],setitem_array1d->[make_array],_make_flattening_iter_cls->[CContiguousFlatIter->[iternext_specific->[_increment_indices_array]]],iternext_array->[make_arrayiter_cls,_getitem_array1d,make_array],getiter_array->[make_arrayiter_cls],array_T->[populate_array,make_array],setitem_array_unituple->[make_array],getitem_array_unituple->[populate_array,make_array],numpy_zeros_like_nd->[_parse_empty_like_args,_zero_fill_array,_empty_nd_impl],_increment_indices_array->[_increment_indices],_change_dtype->[get_itemsize,update_array_info],array_record_getattr->[populate_array,make_array],array_view->[_change_dtype,make_array],array_itemsize->[make_array],array_size->[make_array],iternext_numpy_getitem->[getitem,make_array_flat_cls,make_array],array_nbytes->[make_array],numpy_linspace_2->[linspace->[linspace]],iternext_numpy_flatiter->[make_array_flat_cls,make_array,iternext_specific],setitem_array1d_slice->[make_array],setitem_array_tuple->[make_array],np_frombuffer->[populate_array,get_itemsize,make_array],make_ndindex_cls->[NdIndexIter->[iternext_specific->[mark_positive,_increment_indices]]],scalar_round_unary_complex->[_np_round_float],numpy_eye->[eye->[eye,identity]],_parse_empty_like_args->[make_array],numpy_zeros_nd->[_parse_empty_args,_zero_fill_array,_empty_nd_impl],array_copy->[_empty_nd_impl,make_array],array_len->[make_array],update_array_info->[get_itemsize],array_strides->[make_array],make_array_ndindex->[make_ndindex_cls,init_specific],_increment_indices->[increment_index],numpy_arange_1->[arange->[arange]],_np_round_float->[_np_round_intrinsic],numpy_arange_3->[arange->[arange]],mark_positive->[set_range_metadata],numpy_empty_like_nd->[_parse_empty_like_args,_empty_nd_impl],iternext_numpy_nditer->[make_array_ndenumerate_cls,make_array,iternext_specific],getitem_array1d_slice->[populate_array,make_array],make_array_flatiter->[make_array_flat_cls,make_array,init_specific],make_array_ndenumerate->[make_array_ndenumerate_cls,make_array,init_specific],array_ctypes->[make_array],scalar_round_unary->[_np_round_float],make_array->[ArrayStruct->[shape->[mark_positive]]]] | Get an iterator over an array. | Why is it borrowed? Is it the array object which is borrowed? As far as I can see the iterator object itself is new. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.