patch stringlengths 18 160k | callgraph stringlengths 4 179k | summary stringlengths 4 947 | msg stringlengths 6 3.42k |
|---|---|---|---|
@@ -51,17 +51,10 @@ function getConfig() {
return extend(obj, karmaConfig.default);
}
-var prerequisites = ['build'];
-if (process.env.TRAVIS) {
- // No need to do this because we are guaranteed to have done
- // it.
- prerequisites = [];
-}
-
/**
* Run tests.
*/
-gulp.task('test', 'Runs tests', prerequisites, function(done) {
+gulp.task('test', 'Runs tests', argv.nobuild ? [] : ['build'], function(done) {
if (argv.saucelabs && process.env.MAIN_REPO &&
// Sauce Labs does not work on Pull Requests directly.
// The @ampsauce bot builds these.
| [No CFG could be retrieved] | Reads in and processes the configuration object and runs the tests. Initialize AMPS client with the given configuration. | ~~slightly worried with this. most of our old tasks sometimes don't complete before running the next task which is why I haven't been composing them. (a lot have combined and sync/async usage w/o returning the stream or promise). if it consistently works then im ok with it~~ |
@@ -76,4 +76,15 @@ public class ComputerSetTest {
cli.close();
}
}
+
+ @Test
+ public void getComputerNames() throws Exception {
+ assertThat(ComputerSet.getComputerNames(), is(empty()));
+ j.createSlave("aNode", "", null);
+ assertThat(ComputerSet.getComputerNames(), hasSize(1));
+ assertThat(ComputerSet.getComputerNames(), contains("aNode"));
+ j.createSlave("anAnotherNode", "", null);
+ assertThat(ComputerSet.getComputerNames(), hasSize(2));
+ assertThat(ComputerSet.getComputerNames(), containsInAnyOrder("aNode", "anAnotherNode"));
+ }
}
| [ComputerSetTest->[configuration->[submit,getFormByName,createWebClient],pageRendering->[createSlave,goTo,createWebClient],nodeOfflineCli->[assertTrue,getNodeName,CLI,getURL,get,createSlave,close,execute],JenkinsRule]] | wait - node - offline. | `containsInAnyOrder` actually check if the collections are of the same size and contain same elements regardless of their position in the collection. IOW, `hasSize` should not be needed as long as we compare using `containsInAnyOrder`, which I recommend in both cases here. |
@@ -63,10 +63,11 @@ const BUILTINS = dict({
},
},
'email': {
- 'shareEndpoint': 'mailto:',
+ 'shareEndpoint': 'mailto: ${recipient}',
'defaultParams': {
'subject': 'TITLE',
'body': 'CANONICAL_URL',
+ 'recipient': '',
},
},
'tumblr': {
| [No CFG could be retrieved] | Private functions - > Methods The default implementation of the method that is used to create a new instance of the class. | Nit: remove the space between `:` and `$` |
@@ -30,7 +30,7 @@ public class ChangeLogSetTest {
notCaught = true;
}
assertEquals((new EntryImpl()).getMsg(), change.getMsg());
- assertEquals(false, notCaught);
+ assertFalse(notCaught);
}
@Extension
| [ChangeLogSetTest->[ThrowErrorChangeLogAnnotator->[annotate->[Error]],catchingExceptionDuringAnnotation->[getMsg,EntryImpl,setParent,getMsgAnnotated,createEmpty,assertEquals],ThrowExceptionChangeLogAnnotator->[annotate->[RuntimeException]],JenkinsRule]] | This method throws exception if the message is annotated with a parent. | Maybe kill the `notCaught` variable and use `fail(t.getMessage())` in the catch block instead. |
@@ -33,6 +33,10 @@ namespace System.Text.Json.SourceGeneration
private const string JsonPropertyNameAttributeFullName = "System.Text.Json.Serialization.JsonPropertyNameAttribute";
private const string JsonPropertyOrderAttributeFullName = "System.Text.Json.Serialization.JsonPropertyOrderAttribute";
+ private const string System_DateOnly_FullName = "System.DateOnly";
+ private const string System_TimeOnly_FullName = "System.TimeOnly";
+ private const string System_IAsyncEnumerable_FullName = "System.Collections.Generic.IAsyncEnumerable`1";
+
private readonly Compilation _compilation;
private readonly SourceProductionContext _sourceProductionContext;
private readonly MetadataLoadContextInternal _metadataLoadContext;
| [JsonSourceGenerator->[Parser->[PropertyIsOverridenAndIgnored->[Type],GetSerializerOptions->[GetJsonSourceGenerationModeEnumVal],PopulateKnownTypes->[PopulateNumberTypes]]]] | Creates a class that parses JSON objects into a SourceGenerator. | Why not `DateOnlyFullName` etc for consistency? |
@@ -725,8 +725,8 @@ def main() -> None:
]
raiden_args.extend(chain.from_iterable(node.items()))
- if not is_checksum_address(address):
- raise ValueError(f"address {address} is not checksummed.")
+ # The REST interface uses checksummed address. Normalize it here.
+ address = to_checksum_address(address)
nodedir = os.path.join(datadir, f"node_{pex(to_canonical_address(address))}")
nodes_config.append(NodeConfig(raiden_args, interface, address, nodedir))
| [scheduler_preserve_order->[Transfer],start_and_wait_for_all_servers->[spawn_under_watch],paths_for_mediated_transfers->[InitiatorAndTarget],run_profiler->[track],wait_for_address_endpoint->[get_address],paths_direct_transfers->[InitiatorAndTarget],get_starting_balances->[get_balance_for_node],kill_restart_and_wait_for_server->[start_and_wait_for_server],wait_for_balance->[get_balance_for_node],main->[NodeConfig,StressTestConfiguration,start_and_wait_for_all_servers,force_quit,run_stress_test,Janitor],start_and_wait_for_server->[RunningNode,wait_for_address_endpoint,track],restart_network->[spawn_under_watch],run_stress_test->[paths_for_mediated_transfers,run_profiler,wait_for_balance,get_starting_balances,StressTestPlan,do_transfers,restart_network],Janitor->[__enter__->[ProcessNursery->[spawn_under_watch->[spawn_to_kill]],ProcessNursery]],main] | Main function of the script. Add a critical block for a node. This function runs the nursery stress test if there is no node with the. | Should this check if it's a valid hex address, so starts with '0x' and has 42 chars? But I guess for internal usage this is fine |
@@ -261,12 +261,12 @@ def test_expand():
pytest.raises(ValueError, stc.__add__, stc.in_label(labels_lh[0]))
-def _fake_stc(n_time=10):
+def _fake_stc(n_time=10, Complex=False):
verts = [np.arange(10), np.arange(90)]
return SourceEstimate(np.random.rand(100, n_time), verts, 0, 1e-1, 'foo')
-def _fake_vec_stc(n_time=10):
+def _fake_vec_stc(n_time=10, Complex=False):
verts = [np.arange(10), np.arange(90)]
return VectorSourceEstimate(np.random.rand(100, 3, n_time), verts, 0, 1e-1,
'foo')
| [test_io_w->[_fake_stc],test_transform_data->[_my_trans],test_io_stc_h5->[_fake_stc,_fake_vec_stc],test_stc_attributes->[_fake_stc,_fake_vec_stc],test_extract_label_time_course_volume->[eltc],test_stc_arithmetic->[_fake_stc,_fake_vec_stc],test_io_stc->[_fake_stc]] | Return a fake source estimate with n_time samples. | don't use capital letters in variable names. I would suggest `iscomplex=False` |
@@ -657,6 +657,12 @@ def test_jsondatahandler_ohlcv_load(testdatadir, caplog):
df = dh.ohlcv_load('XRP/ETH', '5m')
assert len(df) == 711
+ df_mark = dh.ohlcv_load('XRP/USDT', '1h', candle_type="mark")
+ assert len(df_mark) == 99
+
+ df_no_mark = dh.ohlcv_load('XRP/USDT', '1h')
+ assert len(df_no_mark) == 0
+
# Failure case (empty array)
df1 = dh.ohlcv_load('NOPAIR/XXX', '4m')
assert len(df1) == 0
| [test_file_dump_json_tofile->[_clean_test_file],test_download_pair_history->[_clean_test_file],test_download_trades_history->[_clean_test_file]] | Test for JSON datahandler with OHLCV load. | I'm kind of confused why `len(df_mark)` is `99`, I feel like it should be 100, because there's 100 array items in `XRP_USDT-1h-mark.json`, but when I test it, it tells me that `len(df_mark)` is equal to `99` |
@@ -509,6 +509,11 @@ def launch_experiment(args, experiment_config, mode, experiment_id):
rest_process, start_time = start_rest_server(args.port, experiment_config['trainingServicePlatform'], \
mode, experiment_id, foreground, log_dir, log_level)
nni_config.set_config('restServerPid', rest_process.pid)
+ # save experiment information
+ nnictl_experiment_config = Experiments()
+ nnictl_experiment_config.add_experiment(experiment_id, args.port, start_time,
+ experiment_config['trainingServicePlatform'],
+ experiment_config['experimentName'], pid=rest_process.pid, logDir=log_dir)
# Deal with annotation
if experiment_config.get('useAnnotation'):
path = os.path.join(tempfile.gettempdir(), get_user(), 'nni', 'annotation')
| [resume_experiment->[manage_stopped_experiment],create_experiment->[launch_experiment],set_pai_config->[get_log_path,setNNIManagerIp,set_trial_config],setNNIManagerIp->[get_log_path],launch_experiment->[set_experiment,print_log_content,start_rest_server,get_log_path,set_platform_config],set_remote_config->[get_log_path,set_trial_config],set_experiment->[get_log_path],print_log_content->[get_log_path],set_dlts_config->[get_log_path,setNNIManagerIp,set_trial_config],set_local_config->[get_log_path,set_trial_config],manage_stopped_experiment->[launch_experiment],set_platform_config->[set_remote_config,set_dlts_config,set_heterogeneous_config,set_aml_config,set_pai_config,set_pai_yarn_config,set_kubeflow_config,set_frameworkcontroller_config,set_local_config,set_adl_config],view_experiment->[manage_stopped_experiment],start_rest_server->[get_log_path],set_pai_yarn_config->[get_log_path,setNNIManagerIp,set_trial_config],set_kubeflow_config->[get_log_path,setNNIManagerIp,set_trial_config],set_frameworkcontroller_config->[get_log_path,setNNIManagerIp,set_trial_config],set_heterogeneous_config->[get_log_path,setNNIManagerIp,set_trial_config],set_aml_config->[get_log_path,setNNIManagerIp,set_trial_config],set_trial_config->[get_log_path],set_adl_config->[set_trial_config]] | Launch an experiment. Start a new with the given parameters. save experiment information. | why put this code snippet here? what type of error will be induced if keep it in the previous place? |
@@ -28,6 +28,7 @@ namespace Microsoft.Extensions.Logging.Console
return SetForegroundColor(foreground) || backgroundChanged;
}
+#pragma warning disable CA1416 // Validate platform compatibility, not sure if this assembly is used for browser, suppressing for now
private bool SetBackgroundColor(ConsoleColor? background)
{
if (background.HasValue)
| [AnsiParsingLogConsole->[WriteToConsole->[Write,ResetColor,SetColor],ResetColor->[ResetColor]]] | Set color. | It needs real fix |
@@ -1597,7 +1597,11 @@ struct Cxx11Generator : GeneratorBase
const std::string lang_field_type = generator_->map_type(type);
const Classification cls = classify(actual_field_type);
if (!(cls & (CL_PRIMITIVE | CL_ENUM))) {
- return " new(&_" + name + ") " + lang_field_type + ";\n";
+ std::stringstream ss;
+ ss
+ << " new(&_" << name << ") " << lang_field_type << ";\n"
+ << " _set = true;\n";
+ return ss.str();
}
return "";
}
| [No CFG could be retrieved] | RETURN code for union functions Generate a union of language - specific fields. | Why does this need `stringstream`? |
@@ -19,4 +19,16 @@ public final class ApplicationInfoBuildItem extends SimpleBuildItem {
public String getVersion() {
return version;
}
+
+ public String getFinalName() {
+ return finalName;
+ }
+
+ public String getBaseDir() {
+ return baseDir;
+ }
+
+ public String getWiringClassesDir() {
+ return wiringClassesDir;
+ }
}
| [No CFG could be retrieved] | Get the version of the node. | I'm not sure how I feel about promoting these three new properties; what backends would consume this information and why? |
@@ -63,6 +63,7 @@ import java.util.Locale;
* Activity used now with Glosbe.com to enable translation of words.
* FIXME why isn't this extending from our base classes?
*/
+@SuppressLint("FieldNamingPatternDetector")
public class TranslationActivity extends FragmentActivity implements DialogInterface.OnClickListener, OnCancelListener {
private static final String BUNDLE_KEY_SHUT_OFF = "key.multimedia.shut.off";
| [TranslationActivity->[onPause->[onPause,stopWorking],translate->[BackgroundPost],onClick->[returnTheTranslation],onSaveInstanceState->[onSaveInstanceState],onCreate->[onCreate,finishCancel],showPickTranslationDialog->[showToastLong,gtxt]]] | Package private for testing purposes. region Private methods. | Same - I think this should be fine to translate? |
@@ -7,9 +7,8 @@
/* ***************************************
Likes
*************************************** */
-.elgg-likes {
+.elgg-likes-popup {
width: 345px;
- position: absolute;
}
.elgg-menu .elgg-menu-item-likes-count {
| [No CFG could be retrieved] | Displays likes for a specific item in menu. | Why was this changed? Doesn't this effectively change API if a theme was using the previous class? |
@@ -716,7 +716,7 @@ public final class KsqlRestApplication extends ExecutableApplication<KsqlRestCon
final Function<Supplier<Boolean>, VersionCheckerAgent> versionCheckerFactory,
final int maxStatementRetries,
final ServiceContext serviceContext,
- final BiFunction<KsqlConfig, KsqlSecurityExtension, Binder> serviceContextBinderFactory,
+ //final BiFunction<KsqlConfig, KsqlSecurityExtension, Binder> serviceContextBinderFactory,
final Supplier<SchemaRegistryClient> schemaRegistryClientFactory) {
final String ksqlInstallDir = restConfig.getString(KsqlRestConfig.INSTALL_DIR_CONFIG);
| [KsqlRestApplication->[onShutdown->[triggerShutdown],buildApplication->[buildApplication,KsqlRestApplication],displayWelcomeMessage->[getListeners,displayWelcomeMessage],waitForPreconditions->[AbortApplicationStartException],loadSecurityExtension->[initialize],checkPreconditions->[KsqlFailedPrecondition]]] | Creates a KsqlRestApplication. Creates a status resource. Creates a new application with the given configuration. | This should be removed. |
@@ -214,7 +214,7 @@ namespace System.Numerics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector2 operator *(float left, Vector2 right)
{
- return new Vector2(left, left) * right;
+ return new Vector2(left * right.X, left * right.Y);
}
/// <summary>
| [Vector2->[CopyTo->[Format,nameof,Arg_NullArgumentNullRef,CopyTo,AggressiveInlining,Arg_ElementsInSourceIsGreaterThanDestination,Arg_ArgumentOutOfRangeException,Length],Dot->[AggressiveInlining,Y,X],AggressiveInlining,Y,X]] | Computes the difference vector between two vectors. Computes the vector resulting from the division of the given scalar. | The old way was allocating a `new Vector2(left, left)`, then the `*` operator on `Vector` and `Vector` will also allocate another `Vector2`. The new way only create one allocation. Hope that's correct :) |
@@ -734,7 +734,7 @@ class csstidy {
case '@namespace':
/* Add quotes to namespace */
$this->sub_value_arr[] = '"' . trim($this->sub_value) . '"';
- $this->namespace = implode(' ', $this->sub_value_arr);
+ $this->namespace = implode(' ', $this->sub_value_arr); // phpcs:ignore PHPCompatibility
break;
case '@import':
$this->sub_value = trim($this->sub_value);
| [csstidy->[css_new_media_section->[get_cfg],merge_css_blocks->[css_add_property],css_new_selector->[get_cfg],css_new_property->[get_cfg],_add_token->[get_cfg],_unicode->[get_cfg,log],parse->[_add_token,_unicode,get_cfg,log],css_add_property->[get_cfg],property_is_next->[log],set_cfg->[_load_template],property_is_valid->[get_cfg],explode_selectors->[get_cfg]]] | Parse a CSS string and store the result in the object This function is called when a rule is found in a string. It is called by _ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This function is called when a token is found in a string. | I think we could ignore this whole file, as it's part of an external library. |
@@ -131,7 +131,15 @@ class CLI_Command extends WP_CLI_Command {
* : Limit the output to specific object fields. Defaults to version,update_type,package_url.
*
* [--format=<format>]
- * : Accepted values: table, csv, json, count. Default: table
+ * : Render output in a particular format.
+ * ---
+ * default: table
+ * options:
+ * - table
+ * - csv
+ * - json
+ * - count
+ * ---
*
* ## EXAMPLES
*
| [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]]] | Check for update Display the list of updates. | We could add `yaml` to this set too. |
@@ -249,6 +249,16 @@ class TailorSubsystem(GoalSubsystem):
@classmethod
def register_options(cls, register):
super().register_options(register)
+ register(
+ "--check",
+ type=bool,
+ default=False,
+ help=(
+ "Do not write changes to disk, only write back what would change. Return code "
+ "0 means there would be no changes, and 1 means that there would be. "
+ ),
+ )
+
register(
"--build-file-name",
advanced=True,
| [restrict_conflicting_sources->[DisjointSourcePutativeTarget,restrict_sources],make_content_str->[generate_build_file_stanza],edit_build_files->[make_content->[make_content_str],make_content,group_by_build_file,EditedBuildFiles],determine_all_owned_sources->[AllOwnedSources],PutativeTarget->[for_target_type->[default_sources_for_target_type],generate_build_file_stanza->[fmt_val->[fmt_val],fmt_val]],tailor->[merge,PutativeTargetsSearchPaths,filter_by_ignores,specs_to_dirs,Tailor,group_by_build_file,EditBuildFilesRequest,alias_for,validate_build_file_name,realias,PutativeTargets],rename_conflicting_targets->[PutativeTargets,rename,UniquelyNamedPutativeTargets]] | Register options for the command line. Name of the missing - node. | > As speculated on that ticket, we may eventually want to merge this into lint. But that is non-trivial to do for now, so we focus on the easy win. Can we open a new ticket that covers a holistic rethink of `tailor`/`fmt`/`update-build-files`, and link it as a TODO somewhere in here? I almost think that calling it out in the help string wouldn't be unwarranted. |
@@ -1,4 +1,8 @@
class Article < ApplicationRecord
+ self.ignored_columns = %w[
+ support_webmentions
+ ]
+
include CloudinaryHelper
include ActionView::Helpers
include Storext.model
| [Article->[username->[username],evaluate_front_matter->[set_tag_list],update_notifications->[update_notifications],readable_edit_date->[edited?]]] | The main entry point for the application record. Comment description for a user s tag validation. | is this a remnant of something that was present previously? |
@@ -93,6 +93,9 @@ namespace System.Collections.Generic
}
_comparer = comparer;
+#if BIT64
+ _fastModMultiplier = HashHelpers.GetFastModMultiplier(0);
+#endif
_lastIndex = 0;
_count = 0;
_freeList = -1;
| [HashSet->[Clear->[Clear],Overlaps->[Contains],CopyTo->[CopyTo],IntersectWith->[Clear],RemoveWhere->[Remove],IsSubsetOfHashSetWithSameEC->[Contains],GetObjectData->[CopyTo],AddOrGetLocation->[IncreaseCapacity],ElementCount->[InternalIndexOf],SymmetricExceptWithEnumerable->[Remove],AddIfNotPresent->[IncreaseCapacity,Initialize],SymmetricExceptWith->[UnionWith,Clear],IntersectWithEnumerable->[Remove],IntersectWithHashSetWithSameEC->[Remove,Contains],HashSetEquals->[Contains],SymmetricExceptWithUniqueHashSet->[Remove,AddIfNotPresent],ExceptWith->[Clear,Remove],ContainsAllElements->[Contains]]] | Private functions for serialization of a variable in a Set. - checks if the given collection contains any elements that are not in the current collection. | Is the JIT able to transform this into `ulong.MaxValue` directly? |
@@ -54,7 +54,9 @@ public class HttpFirehoseFactory extends PrefetchableTextFilesFirehoseFactory<UR
@JsonProperty("maxFetchCapacityBytes") Long maxFetchCapacityBytes,
@JsonProperty("prefetchTriggerBytes") Long prefetchTriggerBytes,
@JsonProperty("fetchTimeout") Long fetchTimeout,
- @JsonProperty("maxFetchRetry") Integer maxFetchRetry
+ @JsonProperty("maxFetchRetry") Integer maxFetchRetry,
+ @JsonProperty("httpAuthenticationUsername") String httpAuthenticationUsername,
+ @JsonProperty("httpAuthenticationPassword") DefaultPasswordProvider httpAuthenticationPasswordProvider
) throws IOException
{
super(maxCacheCapacityBytes, maxFetchCapacityBytes, prefetchTriggerBytes, fetchTimeout, maxFetchRetry);
| [HttpFirehoseFactory->[withSplit->[HttpFirehoseFactory],openObjectStream->[openObjectStream],equals->[equals]]] | Imports the given resource. Gets the URIs of the objects that have the given id. | Any reason to allow only `DefaultPasswordProvider`? The intention of using `PasswordProvider` is to provide `DefaultPasswordProvider` by default, but users can use `EnvironmentVariablePasswordProvider` or their own custom passwordProvider if they want to hide password information from logs. |
@@ -191,6 +191,9 @@ class DataDrivenTestCase(pytest.Item): # type: ignore # inheriting from Any
self.file = file
self.writescache = writescache
self.only_when = only_when
+ if ((platform == 'windows' and sys.platform != 'win32')
+ or (platform == 'posix' and sys.platform not in ('linux', 'darwin'))):
+ skip = True
self.skip = skip
self.data = data
self.line = line
| [split_test_cases->[DataDrivenTestCase],DataSuiteCollector->[collect->[split_test_cases]],DataDrivenTestCase->[add_dirs->[add_dirs],setup->[parse_test_case]],parse_test_data->[TestItem]] | Initialize a new object with a given . | But what about BSD? I think the only reasonable test for POSIX is "not Windows". |
@@ -83,7 +83,9 @@ public class ReactiveInterceptorAdapter extends AbstractInterceptorAdapter
final ProcessorInterceptor interceptor = interceptorFactory.get();
Map<String, String> dslParameters = (Map<String, String>) ((Component) component).getAnnotation(ANNOTATION_PARAMETERS);
- ReactiveProcessor interceptedProcessor = doApply(component, next, componentLocation, interceptor, dslParameters);
+ List macroExpansionInternalParams = unmodifiableList(Arrays.asList("moduleName", "moduleOperation"));
+
+ ReactiveProcessor interceptedProcessor = doApply(component, next, componentLocation, interceptor, dslParameters.entrySet().stream().filter(param -> !macroExpansionInternalParams.contains(param.getKey())).collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())));
LOGGER.debug("Interceptor '{}' for processor '{}' configured.", interceptor, componentLocation.getLocation());
return interceptedProcessor;
| [ReactiveInterceptorAdapter->[removeResolvedParameters->[removeResolvedParameters],setInternalParamsForNotParamResolver->[resolveParameters,setInternalParamsForNotParamResolver]]] | Apply a component to a next processor. | have this list as a static field |
@@ -30,7 +30,7 @@ interface CategoryRepositoryInterface extends RepositoryInterface
/**
* Returns true if the given key is assigned to an existing category.
*
- * @param $key
+ * @param string|int $key
*
* @return bool
*/
| [No CFG could be retrieved] | Checks if the key is a category key. | think this should be `string` |
@@ -344,3 +344,13 @@ class NoOutputInExternalRepoError(DvcException):
class HTTPError(DvcException):
def __init__(self, code, reason):
super(HTTPError, self).__init__("'{} {}'".format(code, reason))
+
+
+class TooManyOpenFilesError(DvcException):
+ def __init__(self, cause):
+ super(TooManyOpenFilesError, self).__init__(
+ "Operation failed due to too many open file descriptors. reduce "
+ "the number of jobs or increase open file descriptors limit to "
+ "prevent this.",
+ cause=cause,
+ )
| [GitHookAlreadyExistsError->[__init__->[super,format]],DownloadError->[__init__->[super,format]],FileMissingError->[__init__->[super,format]],RecursiveAddingWhileUsingFilename->[__init__->[super]],CircularDependencyError->[__init__->[super,format,isinstance]],CheckoutErrorSuggestGit->[__init__->[super,format]],UrlNotDvcRepoError->[__init__->[super,format]],DvcException->[__init__->[super,format_exc]],CyclicGraphError->[__init__->[super,format,isinstance,join]],NoRemoteInExternalRepoError->[__init__->[super,format]],OverlappingOutputPathsError->[__init__->[',super,str]],StagePathAsOutputError->[__init__->[super,format,isinstance]],ConfirmRemoveError->[__init__->[super,format]],ArgumentDuplicationError->[__init__->[super,format,isinstance]],InitError->[__init__->[super]],DvcIgnoreInCollectedDirError->[__init__->[super,format]],DvcParserError->[__init__->[super]],UploadError->[__init__->[super,format]],CheckoutError->[__init__->[str,super,format,join]],OutputNotFoundError->[__init__->[relpath,super,format]],HTTPError->[__init__->[super,format]],ReproductionError->[__init__->[super,format]],OutputDuplicationError->[__init__->[,all,super,isinstance,join]],StageFileCorruptedError->[__init__->[relpath,super,format]],BadMetricError->[__init__->[super,format,join]],MoveNotDataSourceError->[__init__->[super,format]],NoOutputInExternalRepoError->[__init__->[relpath,super,format]],ETagMismatchError->[__init__->[super,"]],NotDvcRepoError->[__init__->[super,format]],NoMetricsError->[__init__->[super]]] | Initialize a HTTPError with a code and reason. | We should put the emphasis on "increase your ulimit", as that is the most reasonable approach. Also, it is better if we tell how to do it or refer to a doc. |
@@ -210,6 +210,12 @@ module TopicGuardian
end
alias :can_archive_topic? :can_perform_action_available_to_group_moderators?
alias :can_close_topic? :can_perform_action_available_to_group_moderators?
+ alias :can_split_merge_topic? :can_perform_action_available_to_group_moderators?
alias :can_edit_staff_notes? :can_perform_action_available_to_group_moderators?
+ def can_move_posts?(topic)
+ return false if is_silenced?
+ can_perform_action_available_to_group_moderators?(topic)
+ end
+
end
| [can_edit_topic?->[can_create_topic_on_category?],can_move_topic_to_category?->[can_create_topic_on_category?],can_edit_tags?->[can_edit_topic?],can_see_topic?->[can_see_deleted_topics?],can_create_topic_on_category?->[can_create_topic?]] | returns true if the user has permission to perform actions on the object. | I think we need to check that they have access to the source AND destination topic here right? |
@@ -1,3 +1,16 @@
class MarkingWeight < ActiveRecord::Base
belongs_to :marking_scheme
+
+ def get_gradable_item
+ if self.is_assignment
+ gradable_item = Assignment.where(id: gradable_item_id).first
+ else
+ gradable_item = GradeEntryForm.where(id: gradable_item_id).first
+ end
+ return gradable_item
+ end
+
+ def get_weight
+ return weight
+ end
end
| [MarkingWeight->[belongs_to]] | The MarkingWeight class. | This type of method is redundant. |
@@ -64,10 +64,10 @@ def display_actions(actions, index, show_channel_urls=None):
print_dists(disp_lst)
if index and len(actions[inst.FETCH]) > 1:
+ num_bytes = sum(index[dist + '.tar.bz2']['size']
+ for dist in actions[inst.FETCH])
print(' ' * 4 + '-' * 60)
- print(" " * 43 + "Total: %14s" %
- human_bytes(sum(index[dist + '.tar.bz2']['size']
- for dist in actions[inst.FETCH])))
+ print(" " * 43 + "Total: %14s" % human_bytes(num_bytes))
# package -> [oldver-oldbuild, newver-newbuild]
packages = defaultdict(lambda: list(('', '')))
| [add_defaults_to_specs->[dist2spec3v],execute_plan->[update_old_plan],revert_actions->[add_unlink,ensure_linked_actions],remove_features_actions->[add_unlink,ensure_linked_actions],execute_actions->[plan_from_actions],display_actions->[format->[format],format,print_dists],remove_actions->[ensure_linked_actions,get_pinned_specs,add_unlink],install_actions->[ensure_linked_actions,is_root_prefix,add_unlink,force_linked_actions,get_pinned_specs],force_linked_actions->[add_unlink],ensure_linked_actions->[extracted_where],revert_actions] | Display actions for all packages. This function will fake the metadata for a . Generate a formatted string describing a . Print out all the packages that are not in the system. | Could have been the same line, as far as I'm concerned. (Also don't mind it being two lines.) I'm sure you noticed max line length set to 99 in `setup.cfg`. That was definitely intentional. Still PEP-8 compliant, but for me, more comfortable than 79. |
@@ -3477,6 +3477,7 @@ bool Blockchain::cleanup_handle_incoming_blocks(bool force_sync)
CRITICAL_REGION_LOCAL(m_blockchain_lock);
TIME_MEASURE_START(t1);
+ m_db->batch_stop();
if (m_sync_counter > 0)
{
if (force_sync)
| [No CFG could be retrieved] | private int m_enforce_dns_checkpoints = false ; This function is called from the main thread of the network when a block of unused blocks is. | This does it unconditionally, whatever the call below returns ? If there is none active, an exceptoiun will be thrown, so we'll miss the rest of the cleanup |
@@ -235,6 +235,15 @@ class Param(object):
return valJS
else:
return val
+ elif self.valType == 'color':
+ valid, val = self.dollarSyntax()
+ if "," in val:
+ # Handle lists (e.g. RGB, HSV, etc.)
+ val = toList(val)
+ return "{}".format(val)
+ else:
+ # Otherwise, treat as string
+ return repr(val)
elif self.valType == 'list':
valid, val = self.dollarSyntax()
val = toList(val)
| [_findParam->[get],getCodeFromParamStr->[expression2js,sub],toList->[fullmatch,endswith,startswith,strip,format,isinstance,expression2js],Param->[xml->[hasattr,set,Element,format],__init__->[super],__bool__->[bool],__str__->[,expression2js,Path,TypeError,debug,toList,sub,snippet2js,startswith,repr,format,isinstance,strip,float,match,dollarSyntax],dollarSyntax->[findall,search,len,str,join]]] | Returns a string representation of the value of the . Returns a string representation of the value of the object. | Throw out unused `valid` like this: `_, val = self.dollarSyntax()` to keep LGTM happy. |
@@ -120,12 +120,7 @@ class IntelParallelStudio(IntelInstaller):
root=join_path(self.prefix, 'mkl', 'lib', 'intel64'),
shared=shared
)
- system_libs = [
- 'libpthread.{0}'.format(suffix),
- 'libm.{0}'.format(suffix),
- 'libdl.{0}'.format(suffix)
- ]
- return mkl_libs + system_libs
+ return mkl_libs
@property
def lapack_libs(self):
| [IntelParallelStudio->[blas_libs->[join_path,find_libraries,format],scalapack_libs->[join_path,find_libraries,satisfies,append,format,InstallError],install->[satisfies,join,compile,int,get_all_components,symlink,filter_pick,filter_file,append,dirname,open,install,walk,write,isdir,str,realpath,mkdir,listdir],setup_environment->[join_path,prepend_path,satisfies,remove_path,format,set],variant,version,provides]] | Returns a list of BLAS libraries that are found in the library spec. | Does anyone know why we were doing this? It breaks `hpl` because we aren't providing the full path to the libraries. |
@@ -83,8 +83,11 @@ class Settings(object):
Server settings go here:
"""
def serverdir(self):
- return join(dirname(abspath(__file__)), 'server')
-
+ path = join(dirname(abspath(__file__)), 'server')
+ path = normpath(path)
+ if sys.platform == 'cygwin': path = realpath(path)
+ return path
+
def bokehjssrcdir(self):
if self.debugjs:
basedir = dirname(dirname(self.serverdir()))
| [Settings->[released_docs->[_get_bool],_get_str->[_get,_dev_or_default],resources->[_get_str],log_level->[_get_str],local_docs_cdn->[_get_str],minified->[_get_bool],js_files->[bokehjsdir],css_files->[bokehjsdir],bokehjssrcdir->[serverdir],browser->[_get_str],rootdir->[_get_str],version->[_get_str],bokehjsdir->[serverdir],py_log_level->[_get_str],pretty->[_get_bool],simple_ids->[_get_bool],_get_bool->[_get,_dev_or_default]],Settings] | Returns a sequence number that can be used to identify the server. | The normalization that we had in `resources._static_path()` is moved here. |
@@ -41,6 +41,7 @@ from .fiff import read_raw_fif
from .nicolet import read_raw_nicolet
from .artemis123 import read_raw_artemis123
from .eeglab import read_raw_eeglab, read_epochs_eeglab, read_events_eeglab
+from .eeglab import read_annotations_eeglab
# for backward compatibility
from .fiff import Raw
| [No CFG could be retrieved] | Imports all events from a raw EDF file. | why do we need a public facing API? Shouldn't it be enough to read it when you read the `raw` files? |
@@ -546,10 +546,13 @@ class JSONRPCClient(object):
return quantity_decoder(res)
def gaslimit(self):
- return quantity_decoder(self.call('eth_gasLimit'))
-
- def lastgasprice(self):
- return quantity_decoder(self.call('eth_lastGasPrice'))
+ last_block = self.call(
+ 'eth_getBlockByNumber',
+ quantity_encoder(self.blocknumber()),
+ True
+ )
+ gas_limit = quantity_decoder(last_block['gasLimit'])
+ return gas_limit
def new_abi_contract(self, contract_interface, address):
warnings.warn('deprecated, use new_contract_proxy', DeprecationWarning)
| [Discovery->[register_endpoint->[transact,poll,check_transaction_threw],address_by_endpoint->[call],__init__->[call,new_abi_contract],endpoint_by_address->[call],version->[call]],Registry->[manager_address_by_token->[call,check_address_has_code],manager_addresses->[call],__init__->[new_abi_contract,check_address_has_code],add_token->[estimate_and_transact,poll,manager_address_by_token,check_transaction_threw],manager_by_token->[manager_address_by_token,check_address_has_code],token_addresses->[call],tokenadded_filter->[Filter,new_filter]],patch_send_transaction->[send_transaction->[get_nonce]],BlockChainService->[get_block_header->[call],block_number->[blocknumber],estimate_blocktime->[block_number],deploy_and_register_token->[deploy_contract],deploy_contract->[deploy_solidity_contract],next_block->[block_number],is_synced->[block_number,call],uninstall_filter->[call]],JSONRPCClient->[eth_getCode->[call],nonce->[call],coinbase->[call],eth_getTransactionByHash->[call],blocknumber->[call],eth_estimateGas->[_format_call,call],new_contract_proxy->[ContractProxy],deploy_solidity_contract->[new_contract_proxy,send_transaction,dependencies_order_of_build,deploy_dependencies_symbols],lastgasprice->[call],eth_sendTransaction->[call],eth_call->[_format_call,call],filter_changes->[call],new_filter->[call],call->[send_message],gaslimit->[call],eth_getTransactionReceipt->[call],find_block->[call],poll->[call,blocknumber],balance->[call],send_transaction->[nonce,gaslimit]],MethodProxy->[__call__->[transact,call]],Token->[transfer->[estimate_and_transact,poll,check_transaction_threw],balance_of->[call],approve->[estimate_and_transact,poll,check_transaction_threw],__init__->[call,new_abi_contract]],NettingChannel->[all_events_filter->[events_filter],closed->[call,_check_exists],can_transfer->[closed,detail],events_filter->[Filter,new_filter],token_address->[call,_check_exists],opened->[call,_check_exists],settle_timeout->[call,_check_exists],update_transfer->[estimate_and_transact,poll,check_transaction_threw,_check_exists],__init__->[new_abi_contract],deposit->[poll,check_transaction_threw,token_address,Token,_check_exists,estimate_and_transact,balance_of],settle->[estimate_and_transact,poll,check_transaction_threw,_check_exists],detail->[call,_check_exists],withdraw->[estimate_and_transact,poll,check_transaction_threw,_check_exists],_check_exists->[call],close->[estimate_and_transact,poll,check_transaction_threw,_check_exists]],ContractProxy->[__init__->[MethodProxy]],Filter->[_query_filter->[call,decode_topic],changes->[_query_filter],uninstall->[call],getall->[_query_filter]],ChannelManager->[channels_addresses->[call],token_address->[call],new_netting_channel->[estimate_and_transact,call,poll,check_transaction_threw],__init__->[call,new_abi_contract],channels_by_participant->[call],channelnew_filter->[Filter,new_filter]]] | Returns a function that returns the number of gas limit and gas price of the node. | this does two rpc calls, use `eth_getBlockByNumber` with `latest` |
@@ -15,7 +15,12 @@ import (
log "github.com/sirupsen/logrus"
)
-const connectionRetries = 5
+const (
+ connectionRetries = 5
+ deprecatedNATSStreamHealthCheckChannel = "habitat"
+ natsMessagingHealthcheckSubject = "habitat.event.healthcheck"
+ natsMessagingQueueGroup = "automate"
+)
// The subject is the topic this subscriber will be listening to,
// right now we will hardcode this value but in the future it could
| [tryConnect->[Connect],Close->[Close],ConnectAndPublish->[Connect],ConnectAndSubscribe->[Connect]] | NewExternalClient creates a new NATS client with the external network interface. NewDefaults creates a new NATS client struct with some defaults. | @gpeers this is the NATS messaging subject we'll be listening to. |
@@ -7,13 +7,15 @@ module Engine
include Entity
attr_accessor :coordinates
- attr_reader :color, :city, :loans, :logo, :simple_logo, :operating_history, :text_color, :tokens, :trains
+ attr_reader :color, :city, :loans, :logo, :logo_filename, :simple_logo,
+ :operating_history, :text_color, :tokens, :trains
def init_operator(opts)
@cash = 0
@trains = []
@operating_history = {}
- @logo = "/logos/#{opts[:logo]}.svg"
+ @logo_filename = "#{opts[:logo]}.svg"
+ @logo = "/logos/#{@logo_filename}"
@simple_logo = opts[:simple_logo] ? "/logos/#{opts[:simple_logo]}.svg" : @logo
@coordinates = opts[:coordinates]
@city = opts[:city]
| [init_operator->[new,map],runnable_trains->[reject],unplaced_tokens->[reject],tokens_by_type->[uniq],placed_tokens->[select],find_token_by_type->[find,type,used],next_token->[find,used],operated?->[empty?],attr_reader,require_relative,include,attr_accessor] | Initialize the operator with the given options. | what's the point of this change? |
@@ -69,6 +69,13 @@ public interface ChannelOutboundInvoker {
/**
* Flush all pending data which belongs to this ChannelOutboundInvoker and notify the {@link ChannelFuture}
* once the operation completes, either because the operation was successful or because of an error.
+ *
+ * Be aware that the flush could be only partial successful. In such cases the {@link ChannelFuture} will be
+ * failed with an {@link PartialFlushException}. So if you are interested to know if it was partial successful you
+ * need to check if the returned {@link ChannelFuture#cause()} returns an instance of
+ * {@link PartialFlushException}. In such cases you may want to call {@link #flush(ChannelPromise)} or
+ * {@link #flush()} to flush the rest of the data or just close the connection via {@link #close(ChannelPromise)} or
+ * {@link #close()} if it is not possible to recover.
*/
ChannelFuture flush();
| [No CFG could be retrieved] | Flushes the current buffer. | Missing `<p>` / partial => partially. |
@@ -52,7 +52,8 @@ int EVP_MAC_CTX_copy(EVP_MAC_CTX *dst, EVP_MAC_CTX *src)
{
EVP_MAC_IMPL *macdata;
- if (src->data != NULL && !dst->meth->copy(dst->data, src->data))
+ if (src->meth != dst->meth
+ || (src->data != NULL && !dst->meth->copy(dst->data, src->data)))
return 0;
macdata = dst->data;
| [No CFG could be retrieved] | ---------------- - Creates a new context for a given MAC. - - - - - - - - - - - - - - - - - -. | Shouldn't copy replace the method too? |
@@ -82,7 +82,7 @@ int opt_rand(int opt)
case OPT_R__LAST:
break;
case OPT_R_RAND:
- return loadfiles(opt_arg());
+ load_rand_file = opt_arg();
break;
case OPT_R_WRITERAND:
OPENSSL_free(save_rand_file);
| [app_RAND_load_conf->[RAND_load_file,OPENSSL_strdup,ERR_print_errors,NCONF_get_string,BIO_printf,ERR_clear_error],int->[RAND_load_file,BIO_printf,ERR_print_errors],app_RAND_write->[OPENSSL_free,RAND_write_file,BIO_printf,ERR_print_errors],opt_rand->[OPENSSL_free,OPENSSL_strdup,loadfiles,opt_arg]] | Load random file or load random file if it is not found. | With the original code you can load multiple files into the RNG. This functionality should be kept. |
@@ -62,4 +62,18 @@ public class AppServerBridge {
appServerBridge.servletUpdatedServerSpanName.set(value);
}
}
+
+ /**
+ * Class used as key in CallDepthThreadLocalMap for counting servlet invocation depth in
+ * Servlet3Advice and Servlet2Advice. We can not use helper classes like Servlet3Advice and
+ * Servlet2Advice for determining call depth of server invocation because they can be injected
+ * into multiple class loaders.
+ *
+ * @return class used as a key in CallDepthThreadLocalMap for counting servlet invocation depth
+ */
+ public static Class<?> getServletKey() {
+ class Key {}
+
+ return Key.class;
+ }
}
| [AppServerBridge->[init->[AppServerBridge,with],isPresent->[get],setServletUpdatedServerSpanName->[set,get],isServerSpanNameUpdatedFromServlet->[get],named,AtomicBoolean]] | Set the servlet updated server span name. | `getCallDepthKey()` may be more descriptive |
@@ -21,12 +21,7 @@ import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import java.io.IOException;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.NetworkInterface;
-import java.net.ServerSocket;
-import java.net.UnknownHostException;
+import java.net.*;
import java.util.Enumeration;
import java.util.Map;
import java.util.Random;
| [NetUtils->[isValidLocalHost->[isInvalidLocalHost],getLocalSocketAddress->[isInvalidLocalHost],getLocalAddress0->[normalizeV6Address,isValidV6Address,isValidAddress,getLocalHost],getAvailablePort->[getRandomPort,getAvailablePort],getHostName->[getHostName],filterLocalHost->[isInvalidLocalHost,getLocalHost]]] | Imports a NetUtils object. region Network Management. | Should avoid use of `import *` here |
@@ -156,7 +156,12 @@ class AmpYoutube extends AMP.BaseElement {
if (this.getCredentials_() === 'omit') {
urlSuffix = '-nocookie';
}
- return `https://www.youtube${urlSuffix}.com/embed/${encodeURIComponent(this.videoid_ || '')}?enablejsapi=1`;
+ this.assertDatasourceExists_();
+ if (this.videoid_) {
+ return `https://www.youtube${urlSuffix}.com/embed/${encodeURIComponent(this.videoid_ || '')}?enablejsapi=1`;
+ } else {
+ return `https://www.youtube${urlSuffix}.com/embed/live_stream?channel=${encodeURIComponent(this.liveChannelid_ || '')}&enablejsapi=1`;
+ }
}
/** @return {string} */
| [No CFG could be retrieved] | Callback for the video when the viewport is visible. Check if the element has an and if so set it as playsinline. | nit: assert can be moved up. |
@@ -127,6 +127,7 @@ def test_generate_sample_customer_payload(customer_user):
def test_generate_sample_product_payload(variant):
+ variant.product.refresh_from_db()
payload = generate_sample_payload(WebhookEventType.PRODUCT_CREATED)
assert payload == json.loads(generate_product_payload(variant.product))
| [test_generate_sample_payload_order->[_remove_anonymized_order_data],test_generate_sample_payload_fulfillment_created->[_remove_anonymized_order_data],test_generate_sample_checkout_payload->[_remove_anonymized_checkout_data]] | Test generate sample product payload. | Why we do this? |
@@ -82,6 +82,11 @@ module GobiertoCalendars
where(id: ids, site: site).published
end
+ def self.events_in_collections_and_container_with_pending(site, container)
+ ids = GobiertoCommon::CollectionItem.events.by_container(container).pluck(:item_id)
+ where(id: ids, site: site)
+ end
+
def parameterize
{ container_slug: collection.container.slug, slug: slug }
end
| [Event->[searchable_description->[searchable_translated_attribute],as_csv->[title,id,name],first_location->[first],events_in_collections_and_container_type->[pluck,published],attributes_for_slug->[strftime],events_in_collections_and_container->[pluck,published],add_item_to_collection->[append],to_path->[gobierto_participation_process_event_path,gobierto_participation_event_path,slug,container_type,gobierto_people_person_event_path],to_url->[gobierto_participation_event_url,merge,gobierto_people_person_event_url,container_type,gobierto_participation_process_event_url],active?->[published?],past?->[now],parameterize->[slug],upcoming?->[now],first_issue->[first,container],synchronized?->[present?],enum,searchableAttributes,alias_method,where,attributesForFaceting,order,map,add_attribute,scope,translates,acts_as_paranoid,attribute,attr_accessor,after_restore,joins,include,belongs_to,now,has_many,table_name,id,paginates_per,validates,after_create,algoliasearch_gobierto],require_dependency] | Find events in a given collection and container. | Line is too long. [89/80] |
@@ -117,7 +117,6 @@ public class SqsIOTest {
new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(endpoint, region))
- .withRegion(region)
.build();
final CreateQueueResult queue = client.createQueue("test");
queueUrl = queue.getQueueUrl();
| [SqsIOTest->[EmbeddedSqsServer->[after->[stopAndWait],before->[build,getQueueUrl,start,createQueue]],testWrite->[getQueueUrl,write,size,SendMessageRequest,receiveMessage,apply,getMessages,getClient,getBody,waitUntilFinish,contains,add,assertEquals],testRead->[getQueueUrl,withMaxNumRecords,apply,isEqualTo,getClient,run,sendMessage],EmbeddedSqsServer,create]] | This method is called before the test. | Why `withRegion` was dropped? Because region is used in `EndpointConfiguration` creation? |
@@ -41,6 +41,8 @@ class TestReaderReset(unittest.TestCase):
self.data_file_name, reader, feeder)
def setUp(self):
+ # set parallel threads to fit 20 batches in line 49
+ os.environ['CPU_NUM'] = str(20)
self.use_cuda = fluid.core.is_compiled_with_cuda()
self.data_file_name = './reader_reset_test.recordio'
self.ins_shape = [3]
| [TestReaderReset->[test_all->[main],setUp->[prepare_data]],main] | Set up the class variables. | where will read the environment variable of CPU_NUM? |
@@ -88,10 +88,11 @@ func (p Proxy) GetAnnouncementsChannel() chan interface{} {
// NewProxy creates a new instance of an Envoy proxy connected to the xDS servers.
func NewProxy(cn certificate.CommonName, ip net.IP) *Proxy {
+ dotCount := strings.Count(string(cn), dot)
return &Proxy{
CommonName: cn,
IP: ip,
- ServiceName: endpoint.ServiceName(utils.GetFirstOfDotted(string(cn))),
+ ServiceName: endpoint.NamespacedService(getNamespacedService(utils.GetFirstNOfDotted(string(cn), dotCount))),
announcements: make(chan interface{}),
lastNonce: make(map[TypeURI]string),
lastSentVersion: make(map[TypeURI]uint64),
| [IncrementLastSentVersion->[GetLastSentVersion],String->[GetCommonName],SetNewNonce->[Sprintf,UnixNano,Now],ServiceName,GetFirstOfDotted] | GetAnnouncementsChannel returns a channel that will receive the last known nonce for a proxy. | Could you rebase your change, I modified this code in a change I merged recently. |
@@ -261,6 +261,14 @@ describes.realWin('Expander', {
.to.eventually.equal(expected);
});
+ it('should handle falsey values', () => {
+ variableSource.setAsync('ZERO', 0);
+ variableSource.setAsync('FALSE', false);
+ const expander = new Expander(variableSource);
+ return expect(expander.expand('a=ZERO&b=FALSE', mockBindings))
+ .to.eventually.equal('a=0&b=false');
+ });
+
it('throws on bad input with back ticks', () => {
const url = 'CONCAT(bad`hello`, world)';
allowConsoleError(() => { expect(() => {
| [No CFG could be retrieved] | Descriptions and methods for the object. - - - - - - - - - - - - - - - - - -. | according to its method definition, `setAsync` only accepts `{function(...*):!Promise<ResolverReturnDef>}` as the 2nd argument. Why do we need to handle the falsy value here? |
@@ -60,7 +60,7 @@ feature 'Sign in' do
scenario 'user can see and use password visibility toggle', js: true do
visit new_user_session_path
- find('#pw-toggle-0', visible: false).trigger('click')
+ find('.checkbox').click
expect(page).to have_css('input.password[type="text"]')
end
| [email,visit,password,create,minute,text,to_not,describe,new_user_session_url,feature,have_current_path,it,fill_in_credentials_and_submit,travel,trigger,to,have_content,return,sign_up_email_path,have_field,find_with_email,and_raise,before,new_user_session_path,sign_in_live_with_2fa,click_link,scenario,exactly,t,require,otp_send_path,it_behaves_like,session_timeout_in_minutes,login_two_factor_path,to_s,include,signin,sleep,uniq,have_link,sign_in_user,encrypted_email,receive,escape,allow_forgery_protection,match,perform_in_browser,have_css,fill_in,send,context,value,have_received,timeout_in,enter_personal_key,eq,after,raise_error,and_return] | user sign - in user sees warning before session times out. | `.trigger('click')` is a Poltergeist/PhantomJS hack that is no longer needed with Chrome webdriver. |
@@ -66,7 +66,7 @@ namespace Microsoft.Extensions.Options.ConfigurationExtensions.Tests
{
const string configSectionName = "Test";
const string messageValue = "This is a test";
- var configEntries = new Dictionary<string, string>
+ var configEntries = new Dictionary<string, string?>
{
[ConfigurationPath.Combine(configSectionName, nameof(FakeOptions.Message))] = messageValue
};
| [OptionsBuidlerConfigurationExtensionsTests->[BindConfiguration_UsesConfigurationSectionPath->[Build,Value,Equal,nameof,BindConfiguration,BuildServiceProvider,Message,Combine,services],BindConfiguration_UpdatesOptionOnConfigurationUpdateWithEmptySectionName->[Build,True,Equal,nameof,BindConfiguration,BuildServiceProvider,Message,CurrentValue,OnChange,Set,serviceProvider,services],BindConfiguration_UpdatesOptionOnConfigurationUpdate->[Build,True,Equal,nameof,BindConfiguration,BuildServiceProvider,Message,CurrentValue,OnChange,Combine,Set,serviceProvider,services],BindConfiguration_OptionsMaterializationThrowsIfNoConfigurationInDI->[BindConfiguration,BuildServiceProvider,Assert,serviceProvider,services],BindConfiguration_ThrowsForNullConfigurationSectionPath->[Assert,BindConfiguration,DefaultName],BindConfiguration_ReturnsSameBuilderInstance->[BindConfiguration,Same,DefaultName],BindConfiguration_UsesConfigurationRootIfSectionNameIsEmptyString->[Build,Value,Equal,nameof,BindConfiguration,BuildServiceProvider,Message,services],BindConfiguration_ThrowsForNullBuilder->[BindConfiguration,Assert]]] | Binds a configuration section using the configuration path. | Are the changes to this file necessary? We haven't been enabling nullable annotations in our tests. |
@@ -105,10 +105,13 @@ class PublishedArticleDAO extends ArticleDAO {
' . $this->getFetchColumns() . '
FROM published_submissions ps
LEFT JOIN submissions s ON ps.submission_id = s.submission_id
+ JOIN submission_settings ss ON (ss.submission_id = s.submission_id)
' . $this->getFetchJoins() . '
LEFT JOIN custom_section_orders o ON (s.section_id = o.section_id AND o.issue_id = ?)
WHERE ps.submission_id = s.submission_id
AND ps.issue_id = ?
+ AND ss.setting_name = \'datePublished\'
+ AND MAX(ss.submission_revision)
AND s.status <> ' . STATUS_DECLINED . '
ORDER BY section_seq ASC, ps.seq ASC';
| [PublishedArticleDAO->[getPublishedArticlesInSections->[_getArticlesInSectionsCache],getPublishedArticleByBestArticleId->[getPublishedArticleByPubId,getByArticleId],getPublishedArticleByPubId->[_getPublishedArticleCache],getByArticleId->[_getPublishedArticleCache]]] | Get all published articles for a given issue. | could it be that the setting_value is empty i.e. do we have to ensure that it is not? |
@@ -164,9 +164,12 @@ class Microarchitecture(object):
def family(self):
"""Returns the architecture family a given target belongs to"""
roots = [x for x in [self] + self.ancestors if not x.ancestors]
- msg = "a target is expected to belong to just one architecture family"
- msg += "[found {0}]".format(', '.join(str(x) for x in roots))
- assert len(roots) == 1, msg
+ if len(roots) != 1:
+ root_str = ', '.join(str(x) for x in roots)
+ raise AssertionError(
+ "target {0} does not belong to just one architecture family"
+ "[found {1}]".format(self.name, root_str)
+ )
return roots.pop()
| [generic_microarchitecture->[Microarchitecture],_known_microarchitectures->[fill_target_from_dict->[Microarchitecture,fill_target_from_dict],generic_microarchitecture,fill_target_from_dict],Microarchitecture->[__gt__->[_to_set],optimization_flags->[satisfies_constraint],__lt__->[_to_set]]] | Returns the architecture family a given target belongs to. | Why are we doubling the lines here just to change slightly the wording of the message? Personally I don't find this more readable but it might be matter of taste. Having an assertion should convey the meaning that the condition is a prerequisite while this looks like a normal raise. Another point is that the previous error message tells the user what is the expected structure while this one focus on what the current target doesn't do to be compliant - and as such is a bit less clear imho. |
@@ -136,10 +136,12 @@ public abstract class AbstractRemoteFileStreamingMessageSource<F>
String remotePath = remotePath(file);
Session<?> session = this.remoteFileTemplate.getSession();
try {
- return getMessageBuilderFactory().withPayload(session.readRaw(remotePath))
+ return getMessageBuilderFactory()
+ .withPayload(session.readRaw(remotePath))
.setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session)
.setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory())
.setHeader(FileHeaders.REMOTE_FILE, file.getFilename())
+ .setHeader(FileHeaders.REMOTE_FILE_INFO, (file.toJson()))
.build();
}
catch (IOException e) {
| [AbstractRemoteFileStreamingMessageSource->[poll->[poll],listFiles->[setRemoteDirectory],doReceive->[doReceive]]] | This method is called to receive a file from the remote server. | So, you still aren't going to provide alternative with direct object, not JSON. Are you? |
@@ -390,9 +390,9 @@ public class TestExecutorTest {
final ProducerRecord<byte[], byte[]> rec1 = producerRecord(sinkTopic, 123456789L, "k2", "v2");
when(kafkaService.readRecords(SINK_TOPIC_NAME)).thenReturn(ImmutableList.of(rec0, rec1));
- final Record expected_0 = new Record(SINK_TOPIC_NAME, "k1", "v1", TextNode.valueOf("v1"),
+ final Record expected_0 = new Record(SINK_TOPIC_NAME, "k1", JsonNodeFactory.instance.textNode("k1"), "v1", TextNode.valueOf("v1"),
Optional.of(123456719L), null);
- final Record expected_1 = new Record(SINK_TOPIC_NAME, "k2", "different",
+ final Record expected_1 = new Record(SINK_TOPIC_NAME, "k2", JsonNodeFactory.instance.textNode("k2"), "different",
TextNode.valueOf("different"), Optional.of(123456789L), null);
when(testCase.getOutputRecords()).thenReturn(ImmutableList.of(expected_0, expected_1));
| [TestExecutorTest->[givenExpectedTopology->[givenExpectedTopology],givenActualTopology->[givenActualTopology],producerRecord->[producerRecord]]] | Should fail on unexpected output. | Is this different from `TextNode.valueOf("k1")`? Curious about the inconsistency between the key and value nodes. |
@@ -427,6 +427,7 @@ class BinaryInstaller(object):
self._binaries_analyzer.reevaluate_node(node, remotes, build_mode, update)
if node.binary == BINARY_MISSING:
self._raise_missing([node])
+ # TODO: Check if BINARY_INVALID?
_handle_system_requirements(conan_file, node.pref, self._cache, output)
self._handle_node_cache(node, keep_build, processed_package_refs, remotes)
| [_PackageBuilder->[build_package->[_package,_build,_get_build_folder,_prepare_sources],_get_build_folder->[build_id]],build_id->[build_id],BinaryInstaller->[install->[_build],_propagate_info->[add_env_conaninfo],_download->[_download],_build->[_handle_system_requirements,_download,_raise_missing,_classify],_handle_node_cache->[_download_pkg],_build_package->[_PackageBuilder,build_package]]] | Build the graph. | I'd say this is not needed. This will happen only for nodes that match `node.binary == BINARY_UNKNOWN` and this only happens when `package_id` is `PACKAGE_ID_UNKNOWN`... which is never set when the binary is invalid. I'd say that a reevaluation/repropagation will never turn an invalid into an unknown. |
@@ -170,10 +170,11 @@ export class BaseSlides extends BaseCarousel {
return;
}
this.clearAutoplay();
- this.autoplayTimeoutId_ = Services.timerFor(this.win).delay(
- this.go.bind(
- this, /* dir */ 1, /* animate */ true, /* autoplay */ true),
- this.autoplayDelay_);
+ this.autoplayTimeoutId_ = /** @type {number} */ (
+ Services.timerFor(this.win).delay(
+ this.go.bind(
+ this, /* dir */ 1, /* animate */ true, /* autoplay */ true),
+ this.autoplayDelay_));
}
/**
| [No CFG could be retrieved] | Initializes the autoplay configuration. Sets the autoplay status. | return type of `delay` should really handle this. |
@@ -37,6 +37,13 @@ public class PartitionDescriptor extends Descriptor {
return new PartitionDescriptor(getName(), dataset);
}
+ /**
+ * Create a copy of partition descriptor under a new dataset
+ */
+ public PartitionDescriptor copy(DatasetDescriptor dataset) {
+ return new PartitionDescriptor(getName(), dataset);
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
| [PartitionDescriptor->[hashCode->[hashCode],copy->[PartitionDescriptor],equals->[equals]]] | Returns true if this partition descriptor is a copy of the given object. | nitpick: `copy()` is a misleading name since we are actually changing the dataset - I think I'd actually just delete this method altogether and just use `new PartitionDescriptor(getName(), dataset)` when you are trying to copy; makes it very obvious |
@@ -0,0 +1,14 @@
+from spack import *
+
+class Cleverleaf(Package):
+ homepage = "http://www.example.com"
+ url = "http://www.example.com/cleverleaf-1.0.tar.gz"
+
+ version('develop', git='git@github.com:UK-MAC/CleverLeaf_ref.git', branch='develop')
+
+ depends_on("SAMRAI@3.8.0")
+
+ def install(self, spec, prefix):
+ cmake(*std_cmake_args)
+ make()
+ make("install")
| [No CFG could be retrieved] | No Summary Found. | @davidbeckingsale: this fetch won't work if the user doesn't have ssh keys set up. Can you update to use the http URL instead? |
@@ -265,12 +265,14 @@ def do_run(args: argparse.Namespace) -> None:
# Bad or missing status file or dead process; good to start.
start_server(args, allow_sources=True)
t0 = time.time()
- response = request(args.status_file, 'run', version=__version__, args=args.flags)
+ response = request(args.status_file, 'run', version=__version__, args=args.flags,
+ no_tty=not sys.stdout.isatty())
# If the daemon signals that a restart is necessary, do it
if 'restart' in response:
print('Restarting: {}'.format(response['restart']))
restart_server(args, allow_sources=True)
- response = request(args.status_file, 'run', version=__version__, args=args.flags)
+ response = request(args.status_file, 'run', version=__version__, args=args.flags,
+ no_tty=not sys.stdout.isatty())
t1 = time.time()
response['roundtrip_time'] = t1 - t0
| [console_entry->[main],do_kill->[fail],is_running->[get_status],do_stop->[fail],wait_for_server->[fail],do_status->[fail],do_start->[fail],check_output->[fail],check_status->[BadStatus],do_run->[restart_server,start_server],read_status->[BadStatus],action] | Do a check starting or restarting the daemon if necessary. | The way `no_tty` argument is used seems error-prone, since the caller accepts `**kwargs: object`. Why not calculate it in `request` unless explicitly provided. Maybe just send it always to server, for consistency? The server can then decide if it wants to deal with it. This would reduce some coupling, as if some command starts producing colored output, only the server would have to be updated. Anyway, at least it would be good to explicitly declare the argument in `request` if you don't get rid of it. Also style nit: I'd avoid an argument with a negated boolean value. This could be renamed to `is_tty`, for example, and it would arguably be cleaner. |
@@ -159,6 +159,8 @@ def str2floats(s):
"""
Look for single float or comma-separated floats.
"""
+ if "[" in s:
+ s = s[1:-1]
return tuple(float(f) for f in s.split(','))
| [ParlaiParser->[add_websockets_args->[add_chatservice_args],add_parlai_args->[add_parlai_data_path],_process_args_to_opts->[_infer_datapath,_load_opts],add_messenger_args->[add_chatservice_args],print_args->[parse_args],parse_known_args->[fix_underscores],parse_kwargs->[parse_args,_kwargs_to_str_args],add_model_subargs->[class2str],_kwargs_to_str_args->[add_extra_args],parse_and_process_known_args->[_process_args_to_opts],add_argument_group->[ag_add_argument->[_handle_custom_options,fix_underscores]],add_extra_args->[add_world_args,add_model_subargs,add_image_args,add_task_args,get_model_name],show_advanced_args->[parse_known_args],add_argument->[_handle_custom_options,fix_underscores],parse_args->[_process_args_to_opts,print_announcements,add_extra_args,print_git_commit]]] | Convert string to float tuple. | is this really necessary? |
@@ -41,8 +41,7 @@ func TestRetry(t *testing.T) {
t.Run(tcName, func(t *testing.T) {
t.Parallel()
- var httpHandler http.Handler
- httpHandler = &networkFailingHTTPHandler{failAtCalls: tc.failAtCalls, netErrorRecorder: &DefaultNetErrorRecorder{}}
+ var httpHandler http.Handler = &networkFailingHTTPHandler{failAtCalls: tc.failAtCalls, netErrorRecorder: &DefaultNetErrorRecorder{}}
httpHandler = NewRetry(tc.attempts, httpHandler, tc.listener)
recorder := httptest.NewRecorder()
| [ServeHTTP->[Context,WriteHeader,Record],Sprintf,NewRequest,NopCloser,ServeHTTP,Background,Parallel,NewRecorder,WithValue,Errorf,Fatalf,Run,Record] | TestRetry tests the number of retries for a given number of failure code. TestDefaultNetErrorRecorderInvalidValueType tests if the net error has been recorded. | Why not `httpHandler :=` directly? |
@@ -588,6 +588,7 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
cli_config.live_dir):
if not os.path.exists(i):
os.makedirs(i, 0700)
+ logger.debug("Creating CLI config directory %s.", i)
config_file, config_filename = le_util.unique_lineage_name(
cli_config.renewal_configs_dir, lineagename)
if not config_filename.endswith(".conf"):
| [RenewableCert->[available_versions->[current_target],next_free_version->[newest_available_version],should_autorenew->[ocsp_revoked,latest_common_version,version,autorenewal_is_enabled,add_time_interval],current_version->[current_target],names->[version,current_target],has_pending_deployment->[latest_common_version,current_version],latest_common_version->[available_versions],update_all_links_to->[_previous_symlinks,current_target,_update_link_to],__init__->[config_with_defaults],version->[current_target],save_successor->[next_free_version],new_lineage->[config_with_defaults],_fix_symlinks->[_previous_symlinks],should_autodeploy->[autodeployment_is_enabled,current_target,add_time_interval,has_pending_deployment],newest_available_version->[available_versions]]] | Create a new certificate lineage. Create a new file in the archive directory and store it in the live directory. missing - block - number. | The name of the variable `cli_config` is a bit misleading (it's the CLI command line arguments/parsed configuration file). Probably should just be `"Creating directory %s"` |
@@ -151,7 +151,7 @@ bool EncapsulationHeader::from_encoding(
}
bool EncapsulationHeader::to_encoding(
- Encoding& encoding, Extensibility expected_extensibility)
+ Encoding& encoding, Extensibility expected_extensibility, bool check_extensibility)
{
bool wrong_extensibility = true;
switch (kind_) {
| [No CFG could be retrieved] | Determines if a given encoding is a valid EncapsulationHeader. Returns true if the header is MUTABLE and false if it is FINAL. | I would suggest adding something like `ANY_EXTENSIBILITY` to the `Extensibility` enum, so an unused `expected_extensibility` doesn't have to be passed in. |
@@ -155,13 +155,13 @@ public class IntTopkKudafTest {
final int topX = 10;
topkKudaf = new TopKAggregateFunctionFactory(topX)
.getProperAggregateFunction(Collections.singletonList(Schema.INT32_SCHEMA));
- final Integer[] aggregate = IntStream.range(0, topX)
- .mapToObj(idx -> null)
- .toArray(Integer[]::new);
+ final List<Integer> aggregate = IntStream.range(0, topX)
+ .mapToObj(Integer::valueOf)
+ .collect(Collectors.toList());
final long start = System.currentTimeMillis();
for(int i = 0; i != iterations; ++i) {
- topkKudaf.aggregate(i, aggregate);
+ topkKudaf.aggregate(i, new ArrayList<>(aggregate));
}
final long took = System.currentTimeMillis() - start;
| [IntTopkKudafTest->[shouldWorkWithLargeValuesOfKay->[singletonList,getProperAggregateFunction,toArray,apply,nullValue,is,assertThat,aggregate],shouldAggregateAndProducedOrderedTopK->[assertThat,equalTo,aggregate],shouldAggregateTopKWithLessThanKValues->[assertThat,equalTo,aggregate],testAggregatePerformance->[singletonList,getProperAggregateFunction,toArray,println,currentTimeMillis,aggregate],shouldMergeTopK->[assertThat,equalTo,apply],shouldBeThreadSafe->[singletonList,getProperAggregateFunction,of,orElse,is,assertThat],shouldAggregateTopK->[assertThat,equalTo,aggregate],testMergePerformance->[singletonList,getProperAggregateFunction,toArray,println,apply,currentTimeMillis],shouldMergeTopKWithNulls->[assertThat,equalTo,apply],setup->[singletonList,getProperAggregateFunction],shouldMergeTopKWithMoreNulls->[assertThat,equalTo,apply]]] | Test aggregate performance. | Replace with the following to avoid copying the array within the timed loop and skewing the results. ``` final List<Integer> aggregate = new ArrayList<>(); final long start = System.currentTimeMillis(); for(int i = 0; i != iterations; ++i) { topkKudaf.aggregate(i, aggregate); } `` |
@@ -186,8 +186,8 @@ namespace System.Runtime.InteropServices.Tests
[Fact]
public void OffsetOf_NullFieldName_ThrowsArgumentNullException()
{
- AssertExtensions.Throws<ArgumentNullException>(null, () => Marshal.OffsetOf(new object().GetType(), null));
- AssertExtensions.Throws<ArgumentNullException>(null, () => Marshal.OffsetOf<object>(null));
+ AssertExtensions.Throws<ArgumentNullException>("name", () => Marshal.OffsetOf(new object().GetType(), null));
+ AssertExtensions.Throws<ArgumentNullException>("name", () => Marshal.OffsetOf<object>(null));
}
[Fact]
| [StructWithFxdLPSTRSAFld->[Sequential,ByValArray,LPStr],MyPoint->[Sequential],OffsetOfTests->[OffsetOf_Generic_MatchedNonGeneric->[OffsetOf,Marshal,Equal],OffsetOf_NotMarshallable_ThrowsArgumentException->[OffsetOf,AssertExtensions,Mono,nameof],OffsetOf_ExplicitLayout_ReturnsExpected->[OffsetOf,SizeOf,union2_ushort1,union1_short1,union1_double1,m_decimal1,union3_int1,m_char1,union3_decimal1,union2_ushort2,union1_int1,Equal,nameof,union1_byte1,m_short1,m_ushort1,union1_byte2,union1_int2,m_short2],OffsetOf_Decimal_ReturnsExpected->[OffsetOf,Equal,IsOSPlatform,nameof,b,SizeOf,p,X86,Windows,ProcessArchitecture,s],OffsetOf_NoSuchFieldName_ThrowsArgumentException->[OffsetOf,AssertExtensions,Marshal],OffsetOf_NotMarshallable_TestData->[Arr,nameof],OffsetOf_NullType_ThrowsArgumentNullException->[OffsetOf,AssertExtensions],OffsetOf_Guid_ReturnsExpected->[OffsetOf,Equal,nameof,b,SizeOf,g,s],OffsetOf_NullFieldName_ThrowsArgumentNullException->[OffsetOf,AssertExtensions,GetType,Marshal],OffsetOf_Variant_ReturnsExpected->[OffsetOf,Size,Equal,Format,nameof,b,v,SizeOf,Windows,s,True],OffsetOf_StructField_ReturnsExpected->[OffsetOf,var,Equal,nameof],OffsetOf_ClassWithExplicitLayout_ReturnsExpected->[OffsetOf,wYear,Equal,nameof,wMilliseconds,wHour],OffsetOf_NonRuntimeField_ThrowsArgumentException->[OffsetOf,AssertExtensions],OffsetOf_ClassWithSequentialLayout_ReturnsExpected->[OffsetOf,x,Equal,nameof,y],OffsetOf_NoLayoutPoint_ThrowsArgumentException->[OffsetOf,x,nameof,Marshal,AssertExtensions],OffsetOf_ValidField_ReturnsExpected->[OffsetOf,SizeOf,m_decimal1,m_double2,m_char1,IsOSPlatform,m_int1,m_byte2,m_byte1,m_byte4,Windows,Equal,nameof,m_int2,m_double1,X86,m_short1,ProcessArchitecture,m_byte3,m_char4,m_char2,m_short2,m_char3]],FieldAlignmentTest_Variant->[Struct],ExplicitLayoutTest->[Explicit],MySystemTime->[Explicit],NonExistField->[Sequential]] | OffsetOf_NullFieldName_ThrowsArgumentNullException - Gets offset of nullFieldName and non. | If Marshal.OffsetOf were a more entry-level method, I'd advocate taking a change for it to validate the field name directly so it could throw the ANE with the correct parameter name ("fieldName"). But I'm guessing our position right now is "it's an advanced enough API that the caller is expected to realize the parameter sharing between OffsetOf's fieldName and GetField's name." Writing this down in case someone else is iffy about it and wants to have the discussion. But currently sighing and not recommending further action. |
@@ -212,6 +212,7 @@ public class TestDeadNodeHandler {
// First set the node to IN_MAINTENANCE and ensure the container replicas
// are not removed on the dead event
+ datanode1 = nodeManager.getNodeByUuid(datanode1.getUuidString());
nodeManager.setNodeOperationalState(datanode1,
HddsProtos.NodeOperationalState.IN_MAINTENANCE);
deadNodeHandler.onMessage(datanode1, publisher);
| [TestDeadNodeHandler->[testOnMessage->[createNodeReport,size,registerContainers,openAllRatisPipelines,getUuidString,createStorageReport,getDatanodeDetails,exitSafeMode,createMetadataStorageReport,concat,register,await,getContainerID,setNodeOperationalState,getContainerReplicas,asList,valueOf,randomDatanodeDetails,allocateContainer,quasiCloseContainer,onMessage,assertEquals,getUuid,containerID,closeContainer,registerReplicas],teardown->[File,fullyDelete,stop,join],registerContainers->[toSet,setContainers,collect],setup->[getTempPath,DeadNodeHandler,mock,OzoneConfiguration,getPipelineManager,setInt,addHandler,setPipelineProvider,getSimpleName,setStorageSize,getScm,getStateManager,set,MockRatisPipelineProvider,setTimeDuration,getScmNodeManager,EventQueue,randomUUID,NodeReportHandler,getContainerManager],registerReplicas->[build,getContainerID,valueOf,updateContainerReplica]]] | This test is performed on messages of the datanodes. Node - specific tests. This method is called when a node is in a dead state and there is no relevant lease. | How does this change test this feature? I think we need a test (or extend this test) to ensure the node is removed from the topology when the dead handler is called and another test to ensure it is put back when the healthy event is fired. |
@@ -34,7 +34,7 @@ namespace {
ACE_Message_Block temp(mb.data_block (), ACE_Message_Block::DONT_DELETE);
temp.rd_ptr(mb.rd_ptr()+offset);
temp.wr_ptr(mb.wr_ptr());
- OpenDDS::DCPS::Serializer ser(&temp, swap);
+ OpenDDS::DCPS::Serializer ser(&temp, OpenDDS::DCPS::Encoding::KIND_CDR_UNALIGNED, swap ? OpenDDS::DCPS::ENDIAN_LITTLE : OpenDDS::DCPS::ENDIAN_BIG);
ser.buffer_read(reinterpret_cast<char*>(&dest), sizeof(T), swap);
return true;
}
| [No CFG could be retrieved] | Reads a single header from a message block and stores it in a variable number of bytes. Reads the next n - bytes from the message block and copies the remaining data into dest. | I think you're mixing up NATIVE/NONNATIVE with BIG/LITTLE here and looks like you've done this at least a couple of times. Also this line and the changed line below are way too long. For this particular situation these `mb_*` functions are only used in `DataSampleHeader::partial` and it looks like there is already an encoding object that I put there, but it's not doing everything it could do. You could move that encoding object up, the swap argument on these functions `mb_*` functions to `const Encoding& encoding` and pass the encoding object in, and set swap when it has that information. |
@@ -36,6 +36,12 @@ module VerifySPAttributesConcern
user_session[:verify_shared_attributes] = false
end
+ def consent_has_expired?
+ return true unless sp_session_identity
+ last_estimated_consent = sp_session_identity.last_consented_at || sp_session_identity.created_at
+ !last_estimated_consent || last_estimated_consent < Identity::CONSENT_EXPIRATION.ago
+ end
+
private
def sp_session_identity
| [needs_sp_attribute_verification?->[needs_completions_screen?]] | clear verify attributes sessions and find the nack for the user. | Would love some feedback on this specifically: 1. Do we think it's ok to use `created_at` as a proxy for the last time we know for sure somebody consented on the handoff page? - I can think of a case where the `identities` row is created, and then abandoned, and then viewed later, so the timestamp may be older than expected 2. Do we want to take the time to run a backfill to set `last_consented_at = created_at` on the entire table? Then we could just rely on `last_consented_at` only and have "cleaner" data? - If so, I can write a backfill task and add it to this PR |
@@ -68,12 +68,7 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetSocketAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.*;
import java.util.stream.Collectors;
import static org.apache.hadoop.hdds.protocol.proto.StorageContainerLocationProtocolProtos.StorageContainerLocationProtocolService.newReflectiveBlockingService;
| [SCMClientProtocolServer->[stopReplicationManager->[stop],getContainer->[getRpcRemoteUsername,getContainer],queryNode->[queryNode],allocateContainer->[getRpcRemoteUsername,allocateContainer],join->[join],getPipeline->[getPipeline],activatePipeline->[activatePipeline],close->[stop],start->[start,getClientRpcAddress],closeContainer->[getRpcRemoteUsername],deactivatePipeline->[deactivatePipeline],recommissionNodes->[getRpcRemoteUsername,recommissionNodes],stop->[stop],getContainerWithPipeline->[getContainerWithPipelineCommon],getContainerWithPipelineCommon->[getContainer],getDatanodeUsageInfo->[getRpcRemoteUsername],startReplicationManager->[start],decommissionNodes->[getRpcRemoteUsername,decommissionNodes],closePipeline->[getPipeline,closePipeline],startMaintenanceNodes->[getRpcRemoteUsername,startMaintenanceNodes],getContainerWithPipelineBatch->[getContainerWithPipelineCommon],deleteContainer->[getRpcRemoteUsername,deleteContainer]]] | Imports a single object from the Java source code. Creates a server that listens to requests from clients. | expand it ? |
@@ -488,6 +488,18 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
# certificate is not revoked).
return False
+ def autorenewal_is_enabled(self):
+ """Is automatic renewal enabled for this cert?
+
+ If autorenew is not specified, defaults to True.
+
+ :returns: True if automatic renewal is enabled
+ :rtype: bool
+
+ """
+ return ("autorenew" not in self.configuration or
+ self.configuration.as_bool("autorenew"))
+
def should_autorenew(self):
"""Should we now try to autorenew the most recent cert version?
| [RenewableCert->[available_versions->[current_target],next_free_version->[newest_available_version],notafter->[_notafterbefore],should_autorenew->[parse_time_interval,notafter,latest_common_version,ocsp_revoked],current_version->[current_target],_notafterbefore->[version,current_target],names->[version,current_target],update_all_links_to->[update_link_to],latest_common_version->[available_versions],__init__->[config_with_defaults],version->[current_target],notbefore->[_notafterbefore],save_successor->[next_free_version],new_lineage->[config_with_defaults],newest_available_version->[available_versions],should_autodeploy->[notafter,parse_time_interval,has_pending_deployment],has_pending_deployment->[latest_common_version,current_version]]] | Checks if a certificate is revoked according to Let s Encrypt OCSP extensions. | ditto, :+1: for factoring this out |
@@ -23,10 +23,7 @@ Rails.application.configure do
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
-
- asset_ip_address = Socket.ip_address_list.detect{ |addr| addr.ipv4_private? }.ip_address
- asset_port = ENV["CI"] ? ENV.fetch("CAPYBARA_SERVER_PORT") : ENV.fetch("WEBPACK_DEV_SERVER_PORT")
- config.action_controller.asset_host = "http://#{asset_ip_address}:#{asset_port}"
+ config.cache_store = :null_store
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
| [fetch,headers,perform_caching,enabled,to_i,consider_all_requests_local,asset_host,delivery_method,cache_classes,eager_load,show_exceptions,allow_concurrency,ip_address,default_url_options,deprecation,allow_forgery_protection,configure] | Configure the object. Shows a warning if the given is missing translations. | Metrics/LineLength: Line is too long. [82/80] |
@@ -57,3 +57,6 @@ class TestBasicLoading(ConfigurationMixin):
"""
assert lines == textwrap.dedent(expected).strip().splitlines()
+
+ def test_forget_section(self, script):
+ script.pip("config", "set", "isolated", "true", expect_error=True)
| [test_no_options_passed_should_error->[pip],TestBasicLoading->[test_listing_is_correct->[list,dedent,pip,startswith,filter,splitlines],test_basic_modification_pipeline->[pip,strip],test_reads_file_appropriately->[patched_file,pip],skip]] | Test listing is correct. | You could check for the presence of `global.isolated` in `result.stderr`. |
@@ -31,6 +31,8 @@ import <%= packageName %>.repository.search.UserSearchRepository;
import <%= packageName %>.security.AuthoritiesConstants;
<%_ if (authenticationType !== 'oauth2') { _%>
import <%= packageName %>.service.MailService;
+import org.springframework.data.domain.Sort;
+import java.util.Collections;
<%_ } _%>
import <%= packageName %>.service.UserService;
import <%= packageName %>.service.dto.<%= asDto('User') %>;
| [No CFG could be retrieved] | Package name authenticationType databaseType databaseType Package private methods. | tests are because this import is misplaced |
@@ -467,7 +467,6 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
const bool swimming = (movement_XZ || player->swimming_vertical) && player->in_liquid;
const bool climbing = movement_Y && player->is_climbing;
if ((walking || swimming || climbing) &&
- m_cache_view_bobbing &&
(!g_settings->getBool("free_move") || !m_client->checkLocalPrivilege("fly")))
{
// Start animation
| [step->[event,my_modf,setItem,MYMIN,fabs],successfullyCreated->[empty,clear],f32->[modf],drawNametags->[getProjectionMatrix,getAlpha,utf8_to_wide,multiplyWith1x4Matrix,getScreenSize,end,begin,getFont,getAbsolutePosition,v3f,getViewMatrix],removeNametag->[remove],drawWieldedTool->[,getAbsoluteTransformation,setPosition,getAspectRatio,getVideoDriver,getActiveCamera,setTarget,setFarValue,setFOV,setAspectRatio,getAbsolutePosition,setNearValue,drawAll],update->[getLength,sqrt,getPosition,exp,setTarget,setUpVector,fabs,updateAbsolutePosition,setPosition,getClientMap,setAspectRatio,checkLocalPrivilege,setRotation,getAbsoluteTransformation,rotateXYBy,getPlayerControl,updateViewingRange,toEuler,ndef,setFOV,v3f,my_modf,slerp,getSpeed,intToFloat,hypot,getEyeOffset,pow,easeCurve,tan,get,getPitch,MYMAX,setColor,sin,getBool,rangelim,atan,cos,getYaw,MYMIN,floatToInt], m_playernode->[createNewSceneManager,getVideoDriver,clear,ItemStack,getBool,getRootSceneNode,getFloat,bindTargetAndRotation,addEmptySceneNode,setItem,addCameraSceneNode,drop],updateViewingRange->[setFarValue,getFloat],addNametag->[push_back],drop->[drop]] | This is the main entry point for the camera. This function is called from the camera when it is in a lighting state. - - - - - - - - - - - - - - - - - - This function is called from the camera camera when it is drawn. | It would be better to replace this with '&& view_bobbing_amount != 0.0' so that the view bobbing code is not activated at all when it is not wanted, this is the advantage of the bool. |
@@ -173,7 +173,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
// 403: forbidden
// 500: error
- org, err := models.GetOrgByName(ctx.Params(":org"))
+ org, err := models.GetOrgByName(ctx.Params(":orgname"))
if err != nil {
if models.IsErrOrgNotExist(err) {
ctx.Error(422, "", err)
| [Status,HandleCloneUserCredentials,IsErrOrgNotExist,IsWriter,IsAdmin,GetUserByID,ToCorrectPageSize,MigrateRepository,Set,Add,IsErrRepoNotExist,CreateRepository,GetOwner,Error,GetRepositoryByID,GetErrMsg,QueryInt64,IsErrNameReserved,JSON,HasError,IsOrganization,IsErrInvalidCloneAddr,Trace,ParamsInt64,IsErrNamePatternNotAllowed,IsOwnedBy,SearchRepositoryByName,GetOrgByName,IsErrUserNotExist,DeleteRepository,Query,Header,APIFormat,Sprintf,AccessLevel,ParseRemoteAddr,SetLinkHeader,IsErrRepoAlreadyExist,QueryInt,Params,Trim] | Create creates a new repository of mine This function returns a 404 if the user is not in the context of the repository or if. | You need to update the swagger:route (the url part) also. You can even edit {org} since in url params in swagger are not yet configured. |
@@ -0,0 +1,11 @@
+package com.baeldung.spring.data.redis_ttl.repository;
+
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Repository;
+
+import com.baeldung.spring.data.redis_ttl.entity.Gatekeeper;
+
+@Repository
+public interface GatekeeperRepository extends CrudRepository<Gatekeeper, Long>{
+
+}
\ No newline at end of file
| [No CFG could be retrieved] | No Summary Found. | missing space before `{` |
@@ -1554,6 +1554,8 @@ LowererMD::LowerEntryInstr(IR::EntryInstr * entryInstr)
insertInstr);
}
+ bool trashScratchRegister = false;
+
uint32 probeSize = stackAdjust;
RegNum localsReg = this->m_func->GetLocalsPointer();
if (localsReg != RegSP)
| [No CFG could be retrieved] | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -. | Nit: rename to isScratchRegisterThrashed. The bool being true right now implies it needs to be trashed... |
@@ -542,6 +542,8 @@ abstract class NotificationsServiceUnitTestCase extends IntegratedUnitTestCase {
$result = $this->notifications->processQueue($this->time + 10, true);
$this->assertEquals(1, $call_count);
$this->assertEquals($deliveries, $result);
+
+ _elgg_services()->reset('subscriptions');
}
public function testCanAlterSubscriptionNotificationTranslations() {
| [NotificationsServiceUnitTestCase->[testRegisterMethod->[setupServices],testCanNotifyUserWithoutAnObject->[setupServices],testCanNotifyUser->[getTestObject,setupServices],testProcessQueueThreeEvents->[getTestObject,setupServices],testProcessQueueNoEvents->[setupServices],testValidatesObjectExistenceForDequeuedSubscriptionNotificationEvent->[getTestObject,setupServices],testCanProcessSubscriptionNotificationsQueue->[getTestObject,setupServices],testStoppingEnqueueEvent->[getTestObject,setupServices],testProcessQueueTimesout->[getTestObject,setupServices],testUnregisterEvent->[getTestObject,setupServices],getTestObject->[setupServices],testEnqueueEvent->[getTestObject,setupServices],testCanNotifyUserViaCustomMethods->[setupServices],testCanUseEnqueueHookToPreventSubscriptionNotificationEventFromQueueing->[getTestObject,setupServices],testCanPrepareSubscriptionNotification->[getTestObject,setupServices],testCanUseHooksBeforeAndAfterInstantNotificationsQueue->[getTestObject,setupServices],testUnregisterEventSpecificAction->[getTestObject,setupServices],testUnregisterMethod->[setupServices],testCanUseHooksBeforeAndAfterSubscriptionNotificationsQueue->[getTestObject,setupServices],testValidatesActorExistenceForDequeuedSubscriptionNotificationEvent->[getTestObject,setupServices],testRegisterEvent->[getTestObject,setupServices],testCanAlterSubscriptionNotificationTranslations->[getTestObject,setupServices]]] | Test if a method can process a subscription notification queue Test method for handling subscription notification Register a mock subscription notification This method is called from the notification framework. | if a test fails the reset isn't executed and you leave behind garbage |
@@ -275,7 +275,15 @@ Current conda install:
channel URLs : %(_channels)s
config file : %(rc_path)s
offline mode : %(offline)s
+ user-agent : %(user_agent)s\
+""" % info_dict)
+
+ if not on_win:
+ print("""\
+ UID / GID : %(UID)s / %(GID)s
""" % info_dict)
+ else:
+ print()
if args.envs:
handle_envs_list(info_dict['envs'], not context.json)
| [show_pkg_info->[features,Resolve,print,get_index,get_pkgs,sorted,disp_features],pretty_package->[Channel,print,len,sorted,human_bytes,OrderedDict],get_user_site->[append,expanduser,join,exists,match,listdir],configure_parser->[add_argument,add_parser_offline,add_parser_json,set_defaults,add_parser],execute->[,all,setattr,getattr,stdout_json,pretty_package,get_index,getenv,_asdict,join,itervalues,map,dict,set,show_info,list,offline_keep,print,handle_envs_list,append,dirname,get_pkgs,sorted,find_executable,arg2spec,prioritize_channels,Resolve,get_user_site,dumps,find_commands,linked_data],compile] | Execute the conda - filter command. Dumps a list of all necessary information about the . Print information about missing node - uuid. Print info about the node - id in the system. | This is sloppy. Someday should be reworked. |
@@ -556,8 +556,8 @@ def log(pkg):
log_file = os.path.join(os.path.dirname(packages_dir), log_file)
fs.install(phase_log, log_file)
- # Archive the environment used for the build
- fs.install(pkg.env_path, pkg.install_env_path)
+ # Archive the environment modifications for the build.
+ fs.install(pkg.env_mods_path, pkg.install_env_path)
if os.path.exists(pkg.configure_args_path):
# Archive the args used for the build
| [_try_install_from_binary_cache->[_process_binary_cache_tarball],BuildProcessInstaller->[_real_install->[combine_phase_logs,log],run->[_do_fake_install,_print_installed_pkg,_hms],__init__->[package_id]],build_process->[run,BuildProcessInstaller],BuildRequest->[__repr__->[__repr__],traverse_dependencies->[get_deptypes],__init__->[package_id]],OverwriteInstall->[install->[_install_task]],BuildTask->[__repr__->[__repr__],next_attempt->[_update,flag_installed],__init__->[get_dependent_ids,package_id]],log->[dump_packages],PackageInstaller->[_check_deps_status->[_check_db,package_id],__repr__->[__repr__],_requeue_task->[_push_task,install_msg],_add_init_task->[package_id],_flag_installed->[_push_task,get_dependent_ids,package_id],_init_queue->[_add_tasks],_ensure_install_ready->[package_id],install->[_flag_installed,_init_queue,_pop_task,_cleanup_all_tasks,_print_installed_pkg,_handle_external_and_upstream,_ensure_locked,_update_installed,_prepare_for_install,_update_failed,_install_action,_install_task,_requeue_task,_cleanup_task],_ensure_locked->[_cleanup_all_tasks,package_id],_prepare_for_install->[_check_db],_update_failed->[_update_failed,_remove_task],_install_action->[_check_db],_install_task->[install_msg,_install_from_cache],_add_tasks->[_check_deps_status,_add_init_task,package_id,_handle_external_and_upstream,_check_last_phase,_add_bootstrap_compilers],_cleanup_task->[package_id],_add_bootstrap_compilers->[_packages_needed_to_bootstrap_compiler,package_id]]] | Log a in the build log. This function will install all files in the target_dir and dump the packages. | okay maybe this answers my question if this pkg.env_mods_path is the one we saw passed earlier (the clean one) |
@@ -79,9 +79,13 @@ Ifpack_Hypre::Ifpack_Hypre(Epetra_RowMatrix* A):
IsSolverSetup_[0] = false;
IsPrecondSetup_[0] = false;
MPI_Comm comm = GetMpiComm();
+ // Hypre expects GIDs that are:
+ // - contiguous locally, in the sense that GID[i+1] = GID[i]+1
+ // - contiguous across ranks, in the sense that GID_rank_k[0] = GID_rank_(k-1)[-1]+1
+ // Here we call this property "nice".
+ // Check if this is the case (i.e. NiceRowMap_)
int ilower = A_->RowMatrixRowMap().MinMyGID();
int iupper = A_->RowMatrixRowMap().MaxMyGID();
- // Need to check if the RowMap is the way Hypre expects (if not more difficult)
std::vector<int> ilowers; ilowers.resize(Comm().NumProc());
std::vector<int> iuppers; iuppers.resize(Comm().NumProc());
int myLower[1]; myLower[0] = ilower;
| [No CFG could be retrieved] | - - - - - - - - - - - - - - - - - - The first index of the nice row map to the right of the ilowers. | The term "globally contiguous" would be more idiomatic to the Petra Object Model. |
@@ -45,7 +45,7 @@ using System.Runtime.InteropServices;
// to distinguish one build from another. AssemblyFileVersion is specified
// in AssemblyVersionInfo.cs so that it can be easily incremented by the
// automated build process.
-[assembly: AssemblyVersion("1.0.1.1157")]
+[assembly: AssemblyVersion("1.0.1.1732")]
// By default, the "Product version" shown in the file properties window is
| [Satellite] | Assigns the given type to the assembly. | Don't commit this file. |
@@ -114,6 +114,14 @@ public class DefaultPromiseTest {
promise.get(1, TimeUnit.SECONDS);
}
+ @Test
+ public void testCancellationExceptionIsReturnedAsCause() throws InterruptedException,
+ ExecutionException, TimeoutException {
+ final Promise<Void> promise = new DefaultPromise<Void>(ImmediateEventExecutor.INSTANCE);
+ promise.cancel(false);
+ assertThat(promise.cause(), instanceOf(CancellationException.class));
+ }
+
@Test
public void testStackOverflowWithImmediateEventExecutorA() throws Exception {
testStackOverFlowChainedFuturesA(stackOverflowTestDepth(), ImmediateEventExecutor.INSTANCE, true);
| [DefaultPromiseTest->[findStackOverflowDepth->[findStackOverflowDepth],testNoStackOverflowWithImmediateEventExecutorB->[stackOverflowTestDepth],testListenerNotifyLater->[testListenerNotifyLater],testStackOverFlowChainedFuturesA->[run->[testStackOverFlowChainedFuturesA],testStackOverFlowChainedFuturesA],testStackOverflowWithImmediateEventExecutorA->[stackOverflowTestDepth],testStackOverFlowChainedFuturesB->[run->[testStackOverFlowChainedFuturesA],testStackOverFlowChainedFuturesA],testNoStackOverflowWithDefaultEventExecutorB->[stackOverflowTestDepth],TestEventExecutor->[run->[run]],testNoStackOverflowWithDefaultEventExecutorA->[stackOverflowTestDepth]]] | This test fails if the exception is thrown when blocking get is called. | please also assert return value |
@@ -234,6 +234,12 @@
1,
1) %>
</li>
+ <li class='<%= "active" if controller.controller_name == 'automated_tests' %>'>
+ <%= link_to I18n.t("automated_tests.title"),
+ :controller => 'automated_tests',
+ :action => 'student_interface',
+ :id => @assignment.id %>
+ </li>
<% end %>
</ul>
<% end %>
| [No CFG could be retrieved] | view_marks_assignment_submission_result_path - The path to the view of. | Use the new hash syntax `controller: 'automated_tests` |
@@ -81,6 +81,12 @@ func New(cfg *common.Config) (processors.Processor, error) {
// Run enriches the given event with the host meta data
func (p *addHostMetadata) Run(event *beat.Event) (*beat.Event, error) {
+ // If host fields exist(besides host.name added by libbeat) in event, skip add_host_metadata.
+ hostFields, _ := event.Fields.GetValue("host")
+ if hostFields != nil && len(hostFields.(common.MapStr)) > 1 {
+ return event, nil
+ }
+
err := p.loadData()
if err != nil {
return nil, err
| [loadData->[MapHostInfo,Infof,expired,Host,GetNetInfo,Info,Set,Put],String->[Sprintf],Run->[Get,Clone,DeepUpdate,loadData],expired->[Unlock,Now,Lock,After,Add],Wrapf,Unpack,NewLogger,loadData,GeoConfigToMap,NewMapStrPointer,RegisterPlugin] | Run adds host metadata to the event. | Maybe to do a more intrusive check for `host.name` instead of just checking the length of the map? |
@@ -100,7 +100,13 @@ class ClientCache(object):
if edited_ref:
base_path = edited_ref["path"]
layout_file = edited_ref["layout"]
- return PackageEditableLayout(base_path, layout_file, ref)
+ if os.path.isfile(base_path):
+ conanfile_name = os.path.basename(base_path)
+ base_path = os.path.dirname(base_path)
+ return PackageEditableLayout(base_path, layout_file, ref, conanfile_name)
+ else:
+ # FIXME: Remove in Conan 2.0, introduced for <= 1.25 backward compatibility
+ return PackageEditableLayout(base_path, layout_file, ref)
else:
check_ref_case(ref, self.store)
base_folder = os.path.normpath(os.path.join(self.store, ref.dir_repr()))
| [ClientCache->[reset_default_profile->[initialize_default_profile],delete_empty_dirs->[package_layout],reset_config->[initialize_config],reset_settings->[initialize_settings],get_template->[get_template],package_layout->[check_ref_case]],_mix_settings_with_env->[get_env_value,get_setting_name],is_case_insensitive_os] | Package layout for a given ref. | To support existing `editable_packages.json` files. May I forget about this, may I write a migration? |
@@ -1,6 +1,6 @@
#include "BalanceTestUtilities.hpp"
-#include <gtest/gtest.h>
#include <iomanip>
+#include <unistd.h>
#include <stk_mesh/base/GetEntities.hpp>
#include "stk_mesh/base/FieldBase.hpp" // for field_data
#include <stk_mesh/base/MetaData.hpp> // for MetaData, put_field
| [clearFiles->[getFilename],putFieldDataOnMesh->[putEntityProcOnMeshField,convert_vector_data_into_entity_proc_vec]] | Entity coloring. Put decompression field data on the bulk data on the mesh. | That's a POSIX header file -- do you actually need POSIX, non-C++ functions? |
@@ -504,7 +504,7 @@ def _set_dig_kit(mrk, elp, hsp):
hsp = _read_dig_points(hsp)
n_pts = len(hsp)
if n_pts > KIT.DIG_POINTS:
- hsp = _decimate_points(hsp, res=5)
+ hsp = _decimate_points(hsp, res=0.005)
n_new = len(hsp)
warn("The selected head shape contained {n_in} points, which is "
"more than recommended ({n_rec}), and was automatically "
| [read_raw_kit->[RawKIT],read_epochs_kit->[EpochsKIT]] | Set the Digitizer data for the KIT instance. Get dig_points dev_head_t and dev_head_t for all 3. | related, @christianbrodbeck, should we update the default value for _decimate_points and say that it should be based on `m` or we could say in general, the appropriate scale of your data |
@@ -747,6 +747,10 @@ foreach ($ports as $port) {
influx_update($device, 'ports', rrd_array_filter($tags), $fields);
graphite_update($device, 'ports|' . $ifName, $tags, $fields);
+ foreach ($fields as $k => $v) {
+ opentsdb_update($device, "port." . $k, array('ifName' => $this_port['ifName'],'ifIndex' => getPortRrdName($port_id)), array('key' => $v));
+ }
+
// End Update IF-MIB
// Update PAgP
| [addDataset] | Updates the fields of all the records in the system that are related to a specific node in Updates the fields of all the network ports. | Any reason this is here and not just done in `opentsdb_update()` and each metric has to be sent separately? |
@@ -523,7 +523,7 @@ namespace Dynamo.PackageManager
Description = l.Description,
Keywords = l.Keywords != null ? String.Join(" ", l.Keywords) : "",
CustomNodeDefinitions = defs,
- Assemblies = l.LoadedAssemblies.ToList(),
+ Assemblies = new List<PackageAssembly>(),
Name = l.Name,
RepositoryUrl = l.RepositoryUrl ?? "",
SiteUrl = l.SiteUrl ?? "",
| [PublishPackageViewModel->[GetAllDependencies->[AllDependentFuncDefs,AllFuncDefs],AddDllFile->[AddAdditionalFile],UploadHandleOnPropertyChanged->[OnPublishSuccess],BeginInvoke->[BeginInvoke],GetAllNodeNameDescriptionPairs->[AllFuncDefs]]] | This method creates a PublishPackageViewModel from a local package. if vm is . | What if the package already has loaded assemblies? This would remove them from the package. |
@@ -25,8 +25,9 @@ import (
const (
// adjustRatio is used to adjust TolerantSizeRatio according to region count.
- adjustRatio float64 = 0.005
- minTolerantSizeRatio float64 = 1.0
+ adjustRatio float64 = 0.005
+ leaderTolerantSizeRatio float64 = 5.0
+ minTolerantSizeRatio float64 = 1.0
)
func minUint64(a, b uint64) uint64 {
| [GetTolerantSizeRatio,GetStoreInfluence,ResourceSize,GetID,Float64Data,NewIDTTL,GetLearners,IsUp,GetAverageRegionSize,GetApproximateSize,ResourceCount,GetStoreRegionCount,GetStores,GetLowSpaceRatio,GetHighSpaceRatio,ResourceScore,GetDownPeers,StandardDeviation] | returns the minimum number of regions in the system that are not healthy. Checks if the region size is within the cluster and if so prevents the region from being added. | Does this need to be configurable? /cc @nolouch |
@@ -16,6 +16,9 @@ class WPSEO_Database_Proxy {
/** @var bool */
protected $suppress_errors = true;
+ /** @var bool */
+ protected $is_multisite_table = false;
+
/** @var bool */
protected $last_suppressed_state;
| [WPSEO_Database_Proxy->[update->[update],get_results->[get_results],insert->[insert],upsert->[insert,update],delete->[delete]]] | Creates a new object of type WPSEO_Database_Proxy for inserting data into the Updates data in the table. | Please refrain from using the Yoda-style if-statement. |
@@ -59,10 +59,14 @@ public abstract class PetStoreConnectionProvider<T extends PetStoreClient> imple
@Parameter
protected List<LocalDateTime> discountDates;
- private int initialise, start, stop, dispose = 0;
+ private int initialise, start, stop, dispose, timesConnected = 0;
+
+ public static Map<PetStoreConnectionProvider, Integer> connections = new HashMap<>();
@Override
public T connect() throws ConnectionException {
+ timesConnected++;
+ updateTimedConnected();
if (!username.equals(USERNAME)) {
throw new ConnectionException("We only know john");
}
| [PetStoreConnectionProvider->[disconnect->[disconnect]]] | Connect to the PetStore server. | why doing all this logic of handling the connections per provider type? |
@@ -331,7 +331,16 @@ func (s *ProjectState) ListProjectsForIntrospection(
func (s *ProjectState) DeleteProject(ctx context.Context,
req *api.DeleteProjectReq) (*api.DeleteProjectResp, error) {
- err := s.ProjectPurger.Start(req.Id)
+ resp, err := s.ListRulesForProject(ctx, &api.ListRulesForProjectReq{Id: req.Id})
+ if err != nil {
+ return nil, err
+ }
+ if len(resp.Rules) > 0 {
+ return nil, status.Errorf(codes.FailedPrecondition,
+ "Project %q can not be deleted because it has %d rule(s)", req.Id, len(resp.Rules))
+ }
+
+ err = s.ProjectPurger.Start(req.Id)
if err != nil {
if err == cereal.ErrWorkflowInstanceExists {
return nil, status.Errorf(codes.FailedPrecondition,
| [ListProjects->[ListProjects],DeleteRule->[DeleteRule],CreateProject->[CreateProject],UpdateRule->[UpdateRule],CreateRule->[CreateRule],ListProjectsForIntrospection->[ListProjects],GetProject->[GetProject],ListRulesForProject->[ListRulesForProject],UpdateProject->[UpdateProject]] | DeleteProject deletes a project. | This is the main change. Checking if there are any applied or staged rules for the project to be deleted. |
@@ -167,12 +167,9 @@ import org.springframework.core.convert.support.DefaultConversionService;
*/
public abstract class ExtensionDefinitionParser {
- static final String CHILD_ELEMENT_KEY_PREFIX = "<<";
- static final String CHILD_ELEMENT_KEY_SUFFIX = ">>";
- protected static final String CONFIG_PROVIDER_ATTRIBUTE_NAME = "configurationProvider";
protected static final String CURSOR_PROVIDER_FACTORY_FIELD_NAME = "cursorProviderFactory";
+ protected static final String PARAMETERS_FIELD_NAME = "parameters";
- protected final ExtensionParsingContext parsingContext;
protected final List<ObjectParsingDelegate> objectParsingDelegates = ImmutableList
.of(new FixedTypeParsingDelegate(PoolingProfile.class),
new FixedTypeParsingDelegate(RetryPolicyTemplate.class),
| [ExtensionDefinitionParser->[parseFromTextExpression->[parseFromTextExpression],parseAttributeParameter->[resolverOf,parseAttributeParameter],parseDate->[doParseDate],resolverOf->[resolverOf],getStaticValueResolver->[getStaticValueResolver],parseProcessorChain->[addDefinition,addParameter],parseInlineParameterGroup->[parse,addParameter,getChildKey],parseObjectParameter->[parseObjectParameter,resolverOf,parseFromTextExpression],parseObject->[parse,parseAttributeParameter],getContextClassLoader->[getContextClassLoader],parseField->[visitObject->[parseField,parseAsContent,parseMapParameters],visitString->[defaultVisit],visitArrayType->[parseAsContent],defaultVisit->[parseAsContent]],parseParameters->[visitAnyType->[defaultVisit],visitString->[defaultVisit],getInlineGroups,parseParameters],getExpressionBasedValueResolver->[getExpressionBasedValueResolver],getValueResolverFromMetadataType->[visitBasicType->[defaultVisit],visitObject->[parse,defaultVisit],defaultVisit->[parse]],parseCollectionParameter->[visitBasicType->[addBasicTypeDefinition],visitDateTime->[addBasicTypeDefinition],visitDate->[addBasicTypeDefinition],parseCollectionParameter],parseRoute->[parse,addParameter],parseMapParameters->[visitObject->[defaultVisit],visitArrayType->[defaultVisit],parseMapParameters]]] | This parser creates a parser which parses all of the extension objects that constitute an extension. | Why the necessity of changing these names? |
@@ -69,6 +69,15 @@ public abstract class SecurityListener implements ExtensionPoint {
*/
protected void loggedIn(@Nonnull String username){}
+ /**
+ * @since TODO
+ *
+ * Fired when a new user account has been created.
+ *
+ * @param username the user
+ */
+ protected void userCreated(@Nonnull String username) {}
+
/**
* Fired when a user has failed to log in.
* Would be called after {@link #failedToAuthenticate}.
| [SecurityListener->[fireFailedToAuthenticate->[failedToAuthenticate],fireLoggedIn->[loggedIn],fireAuthenticated->[authenticated],fireLoggedOut->[loggedOut],fireFailedToLogIn->[failedToLogIn]]] | Logs in. | This signature does not look particularly useful without a cause (and note the possibility of 0 N+1 causes). In fact, this seems to be lacking a use case. What's the benefit of knowing that a user `foo` failed to register, perhaps due to mismatching passwords, missing email address, etc.? |
@@ -333,8 +333,10 @@ class MeterTest {
.hasDescription("d")
.hasUnit("u")
.hasInstrumentationLibrary(
- InstrumentationLibraryInfo.create(instrumentationName, "1.2.3"));
- assertThat(metric.getDoubleSummaryData().getPoints())
+ InstrumentationLibraryInfo.create(instrumentationName, "1.2.3"))
+ // TODO(anuraaga): Switch to histogram in future version?
+ .hasDoubleSummary()
+ .points()
.allSatisfy(
point -> {
assertThat(point.getSum()).isEqualTo(11.0);
| [MeterTest->[longCounter_bound->[satisfiesExactly,of,waitAndAssertMetrics,bind,add,anySatisfy,containsOnly,attributeEntry],testBatchRecorder->[satisfiesExactly,record,waitAndAssertMetrics,build,anySatisfy,containsOnly,attributeEntry],doubleSumObserver->[satisfiesExactly,waitAndAssertMetrics,build,anySatisfy,containsOnly,attributeEntry],doubleCounter_bound->[satisfiesExactly,of,waitAndAssertMetrics,bind,add,anySatisfy,containsOnly,attributeEntry],doubleValueObserver->[satisfiesExactly,waitAndAssertMetrics,build,anySatisfy,containsOnly,attributeEntry],setupMeter->[getDisplayName,getMeter],longUpDownCounter->[satisfiesExactly,of,waitAndAssertMetrics,build,add,anySatisfy,containsOnly,attributeEntry],doubleCounter->[satisfiesExactly,of,waitAndAssertMetrics,build,add,anySatisfy,containsOnly,attributeEntry],longCounter->[satisfiesExactly,of,waitAndAssertMetrics,build,add,anySatisfy,containsOnly,attributeEntry],longValueRecorder->[allSatisfy,record,create,of,stringKey,waitAndAssertMetrics,build,isEqualTo,hasInstrumentationLibrary,anySatisfy],longUpDownSumObserver->[satisfiesExactly,waitAndAssertMetrics,build,anySatisfy,containsOnly,attributeEntry],longSumObserver->[satisfiesExactly,waitAndAssertMetrics,build,anySatisfy,containsOnly,attributeEntry],doubleUpDownCounter->[satisfiesExactly,of,waitAndAssertMetrics,build,add,anySatisfy,containsOnly,attributeEntry],doubleUpDownSumObserver->[satisfiesExactly,waitAndAssertMetrics,build,anySatisfy,containsOnly,attributeEntry],doubleValueRecorder->[allSatisfy,record,create,of,stringKey,waitAndAssertMetrics,build,isEqualTo,hasInstrumentationLibrary,anySatisfy],longUpDownCounter_bound->[satisfiesExactly,of,waitAndAssertMetrics,bind,add,anySatisfy,containsOnly,attributeEntry],doubleUpDownCounter_bound->[satisfiesExactly,of,waitAndAssertMetrics,bind,add,anySatisfy,containsOnly,attributeEntry],longValueRecorder_bound->[allSatisfy,record,create,of,stringKey,waitAndAssertMetrics,bind,isEqualTo,hasInstrumentationLibrary,anySatisfy],doubleValueRecorder_bound->[allSatisfy,record,create,of,stringKey,waitAndAssertMetrics,bind,isEqualTo,hasInstrumentationLibrary,anySatisfy],longValueObserver->[satisfiesExactly,waitAndAssertMetrics,build,anySatisfy,containsOnly,attributeEntry],create]] | This test method creates a LongValueRecorder for a single n - ary value. | Actually I think I need to fix the reverse OTLP parse to use histogram, not summary. Will check it |
@@ -499,6 +499,14 @@ public class GobblinYarnAppLauncher {
private Optional<ApplicationId> getApplicationId() throws YarnException, IOException {
Optional<ApplicationId> reconnectableApplicationId = getReconnectableApplicationId();
if (reconnectableApplicationId.isPresent()) {
+
+ // Fail the launching job if there's existing application. Avoid different launcher step toes on each other
+ // if mis-configured.
+ if (this.failReconnectableApp) {
+ throw new RuntimeException(String.format("There's existing execution for this AM [%s], abort the launch",
+ reconnectableApplicationId.get()));
+ }
+
LOGGER.info("Found reconnectable application with application ID: " + reconnectableApplicationId.get());
return reconnectableApplicationId;
}
| [GobblinYarnAppLauncher->[handleApplicationReportArrivalEvent->[stop],stopYarnClient->[stop],handleGetApplicationReportFailureEvent->[stop],getReconnectableApplicationId->[getApplicationId],main->[run->[sendEmailOnShutdown,stop],launch,GobblinYarnAppLauncher],setupAndSubmitApplication->[getApplicationId]]] | Get the application ID from the YARN server. | should this function name changed to `getOrCreateNewYarnApplication` ? just a thought |
@@ -59,6 +59,6 @@ public class BasicHTTPEscalator implements Escalator
@Override
public AuthenticationResult createEscalatedAuthenticationResult()
{
- return new AuthenticationResult(internalClientUsername, authorizerName, null);
+ return new AuthenticationResult(internalClientUsername, authorizerName, "basic", null);
}
}
| [BasicHTTPEscalator->[createEscalatedAuthenticationResult->[AuthenticationResult],createEscalatedClient->[CredentialedHttpClient,BasicCredentials]]] | Returns a new AuthenticationResult that is likely to be returned by the client. | do not hard code "basic" here ? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.