patch stringlengths 18 160k | callgraph stringlengths 4 179k | summary stringlengths 4 947 | msg stringlengths 6 3.42k |
|---|---|---|---|
@@ -319,7 +319,7 @@ func (s *StoreInfo) regionScoreV2(delta int64, deviation int) float64 {
score = (K + M*(math.Log(C)-math.Log(A-F+1))/(C-A+F-1)) * R
} else {
// When remaining space is less then F, the score is mainly determined by available space.
- score = (K+M*math.Log(C)/C)*R + (F-A)*(K+M*math.Log(F)/F)
+ score = (K+M*math.Log(C)/C)*R + B*(F-A)*(K+M*math.Log(F)/F)
}
return score / math.Max(s.GetRegionWeight(), minWeight)
}
| [GetUptime->[GetStartTime,GetLastHeartbeatTS],SetRegionCount->[Clone],GetAddress->[GetAddress],ResourceWeight->[GetRegionWeight,GetLeaderWeight],GetMetaStores->[GetMeta],GetLabelValue->[GetLabels],PauseLeaderTransfer->[Clone,AllowLeaderTransfer],IsUnhealthy->[DownTime],ResourceSize->[GetLeaderSize,GetRegionSize],NeedPersist->[GetLastHeartbeatTS],ResumeLeaderTransfer->[Clone],SetLeaderSize->[Clone],CompareLocation->[GetLabelValue],AttachAvailableFunc->[Clone],DeleteStore->[GetID],GetVersion->[GetVersion],UpdateStoreStatus->[ShallowClone,SetStore],LeaderScore->[GetLeaderSize,GetLeaderWeight,GetLeaderCount],SetStore->[GetID],GetState->[GetState],SetLeaderCount->[Clone],SetRegionSize->[Clone],SetPendingPeerCount->[Clone],MergeLabels->[GetLabels],GetLabels->[GetLabels],Clone->[Clone],IsLowSpace->[AvailableRatio],ResourceCount->[GetLeaderCount,GetRegionCount],regionScoreV2->[GetRegionSize,GetRegionWeight],regionScoreV1->[GetRegionSize,GetRegionWeight],IsDisconnected->[DownTime],GetLabels,CompareLocation,GetID] | regionScoreV2 returns the score of the region in the store. | can we make F configuration and set to a more suitable default value? |
@@ -31,6 +31,7 @@ from paddle.fluid.dygraph.dygraph_to_static.loop_transformer import LoopTransfor
from paddle.fluid.dygraph.dygraph_to_static.print_transformer import PrintTransformer
from paddle.fluid.dygraph.dygraph_to_static.return_transformer import ReturnTransformer
from paddle.fluid.dygraph.dygraph_to_static.tensor_shape_transformer import TensorShapeTransformer
+from paddle.fluid.dygraph.dygraph_to_static.cast_transformer import CastTransformer
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import StaticAnalysisVisitor
from paddle.fluid.dygraph.dygraph_to_static.utils import get_attribute_full_name
| [DygraphToStaticAst->[visit_FunctionDef->[hasattr,NotImplementedError,generic_visit,get_attribute_full_name,isinstance],get_static_ast->[transfer_from_node_type,get_node_wrapper_root,StaticAnalysisVisitor],transfer_from_node_type->[visit,TensorShapeTransformer,ReturnTransformer,BreakContinueTransformer,LogicalTransformer,CallTransformer,BasicApiTransformer,ListTransformer,IfElseTransformer,PrintTransformer,LoopTransformer,AssertTransformer,transform]]] | Creates a new object from a base object. Transform Dygraph to Static Graph. | Here we import with alphabetical order, so please put this line after CallTransformer |
@@ -720,8 +720,8 @@ def write_protocol_deps_cache(proto_deps: Dict[str, Set[str]],
def write_plugins_snapshot(manager: BuildManager) -> None:
"""Write snapshot of versions and hashes of currently active plugins."""
- name = os.path.join(_cache_dir_prefix(manager), '@plugins_snapshot.json')
- if not atomic_write(name, json.dumps(manager.plugins_snapshot), '\n'):
+ name = '@plugins_snapshot.json'
+ if not manager.metastore.write(name, json.dumps(manager.plugins_snapshot)):
manager.errors.set_file(_cache_dir_prefix(manager), None)
manager.errors.report(0, 0, "Error writing plugins snapshot",
blocker=True)
| [_build->[BuildSourceSet,BuildResult],process_fine_grained_cache_graph->[load_fine_grained_deps],BuildManager->[all_imported_modules_in_file->[correct_rel_imp,import_priority],report_file->[is_source],get_stat->[maybe_swap_for_shadow_path],getmtime->[getmtime]],load_plugins->[plugin_error],State->[parse_file->[parse_file,compute_hash,wrap_context,check_blockers,maybe_swap_for_shadow_path],wrap_context->[check_blockers],type_check_second_pass->[wrap_context,type_checker],__init__->[find_cache_meta,parse_file,validate_meta,use_fine_grained_cache],semantic_analysis->[wrap_context],compute_fine_grained_deps->[type_map],write_cache->[delete_cache,mark_interface_stale,write_cache],generate_unused_ignore_notes->[generate_unused_ignore_notes,verify_dependencies],type_check_first_pass->[wrap_context],semantic_analysis_pass_three->[wrap_context],compute_dependencies->[all_imported_modules_in_file,check_blockers],finish_passes->[report_file,type_map,wrap_context,type_checker],type_map->[type_checker]],in_partial_package->[State],dump_graph->[dumps,NodeInfo],NodeInfo->[dumps->[dumps]],load_graph->[State,find_module_simple,use_fine_grained_cache],get_cache_names->[_cache_dir_prefix],delete_cache->[normpath,get_cache_names],find_cache_meta->[get_cache_names,_load_json_file,cache_meta_from_dict],validate_meta->[atomic_write,get_cache_names,normpath,use_fine_grained_cache,get_stat,getmtime],atomic_write->[random_string],order_ascc->[order_ascc],write_cache->[json_dumps,atomic_write,cache_meta_from_dict,compute_hash,get_cache_names,normpath,get_stat,getmtime],dispatch->[write_plugins_snapshot,write_protocol_deps_cache,dispatch,use_fine_grained_cache,read_protocol_cache],strongly_connected_components->[dfs->[dfs],dfs],get_protocol_deps_cache_name->[_cache_dir_prefix]] | Write snapshot of versions and hashes of currently active plugins. | This should really be a defined constant. |
@@ -38,7 +38,10 @@ class ProfileParser(object):
include = include[:-1]
self.includes.append(include)
else:
- name, value = line.split("=", 1)
+ try:
+ name, value = line.split("=", 1)
+ except ValueError as error:
+ raise ConanParsingError("Error while parsing line %i: '%s'" % (counter, line))
name = name.strip()
if " " in name:
raise ConanException("The names of the variables cannot contain spaces")
| [_profile_parse_args->[_get_simple_and_package_tuples->[_get_tuples_list_from_extender_arg],_get_tuples_list_from_extender_arg,_get_env_values,_get_simple_and_package_tuples],read_profile->[get_profile_path],get_profile_path->[valid_path],_load_profile->[update_vars,ProfileParser,read_profile,apply_vars,get_includes],profile_from_args->[read_profile],_apply_inner_profile->[get_package_name_value,_load_single_build_require]] | divides the text in 3 items and creates a dict with variable = value declarations and other. | Let's throw a generic ``ConanException``. New exceptions will be introduced from now on, only if it is going to be captured and processed somewhere else. Let's keep it simple. |
@@ -2220,6 +2220,16 @@ describe User do
end
end
+ describe "Destroying a user with security key" do
+ let!(:security_key) { Fabricate(:user_security_key_with_random_credential, user: user) }
+ fab!(:admin) { Fabricate(:admin) }
+
+ it "removes the security key" do
+ UserDestroyer.new(admin).destroy(user)
+ expect(UserSecurityKey.where(user_id: user.id).count).to eq(0)
+ end
+ end
+
describe 'Secure identifier for a user which is a string other than the ID used to identify the user in some cases e.g. security keys' do
describe '#create_or_fetch_secure_identifier' do
context 'if the user already has a secure identifier' do
| [hash,filter_by,assert_good,assert_bad,user_error_message] | It substitutes username with the URL encoded username checks that the user has a secure identifier. | Isn't `admin` fabricated "earlier"? |
@@ -35,4 +35,9 @@ spec:
<%_ } _%>
ports:
- name: http
+ <%_ if (app.applicationType === 'microservice' || app.applicationType === 'uaa') { _%>
+ port: 80
+ targetPort: <%= app.serverPort %>
+ <%_ } else { _%>
port: <%= app.serverPort %>
+ <%_ } _%>
| [No CFG could be retrieved] | Missing HTTP ports. | Unless there is a really good reason for this, I'd prefer using the condition : `!app.serviceDiscoveryType || app.applicationType === 'uaa'` -> so it will be specific to UAA and will not impact the other option as the other options works well with Kubernetes |
@@ -246,10 +246,10 @@ public class JPMSModuleInfoPlugin implements VerifierPlugin {
}
private void requires(Entry<String, Attrs> instruction, Analyzer analyzer, Packages index,
- ModuleInfoBuilder builder) {
+ Parameters moduleInfoOptions, ModuleInfoBuilder builder) throws Exception {
String eeAttribute = instruction.getValue()
- .get("ee");
+ .get(Constants.EE_ATTRIBUTE);
EE moduleEE = (eeAttribute != null) ? EE.valueOf(eeAttribute) : DEFAULT_MODULE_EE;
| [JPMSModuleInfoPlugin->[mainClass->[mainClass],requires->[requires],getModuleName->[getModuleName],nameAccessAndVersion->[access]]] | This method is called to add a module to the index. This method is used to check if a package has a required dependency and if so it can This method is called when module version is required. | You should make this `orElseGet` to avoid all the work until it is needed. `orElse` is good when you already have the else value handy. But it you have to go to some work to make the else value, `orElseGet` can avoid that work when you don't need the else value. |
@@ -1,7 +1,7 @@
<div class="row">
<div class="col-12">
<h2>Notes</h2>
- <% if @user.notes.count > 0 %>
+ <% if @user.notes.load.size > 0 %>
<% @user.notes.each do |note| %>
<p><em><%= note.created_at.strftime("%d %B %Y %H:%M UTC") %> by <%= User.find(note.author_id).username if note.author_id.present? %></em> -
<% if !note.reason.blank? %><strong><%= note.reason %>:</strong>
| [No CFG could be retrieved] | Renders the user s neccesary . | since we know that the notes are going to be iterated upon in the following line, we can preload them, to avoid a second `SELECT count` that would instead happen with `.each` |
@@ -358,7 +358,12 @@ class TransformVisitor(NodeVisitor[Node]):
new.fullname = original.fullname
target = original.node
if isinstance(target, Var):
- target = self.visit_var(target)
+ # Do not transform references to global variables.
+ # TODO: is it really the best solution? Should we instead make
+ # a trivial copy, or do something completely different? See
+ # testGenericFunctionAliasExpand for an example where this is important.
+ if original.kind != GDEF:
+ target = self.visit_var(target)
elif isinstance(target, Decorator):
target = self.visit_var(target.var)
elif isinstance(target, FuncDef):
| [TransformVisitor->[optional_expressions->[optional_expr],visit_func_def->[copy_argument],copy_ref->[visit_var],optional_expr->[expr],optional_block->[block],optional_names->[duplicate_name],block->[visit_block],types->[type],names->[duplicate_name],statements->[stmt],visit_lambda_expr->[copy_argument],blocks->[block],optional_type->[type],expressions->[expr],visit_decorator->[visit_func_def]]] | Copy a ref expression from the original node to the new node. | If you remove `visit_mypy_file` from the class (I think that it's unused), this will be completely reasonable, since this will be reference to something outside the AST node we are transforming. |
@@ -658,6 +658,9 @@ func (b *cloudBackend) PreviewThenPromptThenExecute(
// Now do the real operation. We don't care about the events it issues, so just
// pass a nil channel along.
var unused chan engine.Event
+
+ // Print the stack outputs at the end this time.
+ displayOpts.ShowStackOutputs = true
return b.updateStack(
updateKind, stack, pkg,
root, m, opts, displayOpts, unused, false /*dryRun*/, scopes)
| [GetStack->[GetStack],Destroy->[PreviewThenPromptThenExecute],Close->[Close],GetLogs->[GetStack],CloudConsoleURL->[CloudURL],Refresh->[PreviewThenPromptThenExecute],tryNextUpdate->[CloudURL],CancelCurrentUpdate->[GetStack],DownloadTemplate->[DownloadTemplate],DecryptValue->[DecryptValue],Read->[Read],updateStack->[cloudConsoleStackPath,Name,CloudConsoleURL,createAndStartUpdate],DownloadPlugin->[DownloadPlugin],getCloudStackIdentifier->[getCloudProjectIdentifier],PreviewThenPromptThenExecute->[PreviewThenPrompt],cloudConsoleStackPath->[cloudConsoleProjectPath],CreateStack->[Name,CreateStack],runEngineAction->[Close,Refresh,Update,Destroy],Update->[PreviewThenPromptThenExecute],EncryptValue->[EncryptValue],ListStacks->[ListStacks],Logout->[CloudURL],ListTemplates->[ListTemplates],GetStack] | PreviewThenPromptThenExecute performs a preview of the given resource in the given stack. If. | Since we're always setting this to `true`, any reason not to make `true` the default, and change this to something like `SuppressStackOutputs`? Is there even a reason to make it conditional? Also, was it intentional that you only did this for the cloud backend? Why not local also? I really don't want to see us diverging in behavior here. |
@@ -253,7 +253,8 @@ class SubmissionsController < ApplicationController
begin
if !test_runs.empty?
authorize! assignment, to: :run_tests?
- AutotestRunJob.perform_later(request.protocol + request.host_with_port, current_user.id, test_runs)
+ @current_job = AutotestRunJob.perform_later(request.protocol + request.host_with_port, current_user.id, test_runs)
+ session[:job_id] = @current_job.job_id
success = I18n.t('automated_tests.tests_running', assignment_identifier: assignment.short_identifier)
else
error = I18n.t('automated_tests.need_submission')
| [SubmissionsController->[downloads->[revision_identifier,find,group_name,accepted_grouping_for,flash_message,send_file,nil?,redirect_back,get_revision,t,count,send_tree_to_zip,access_repo,open,repository_folder,short_identifier,get_latest_revision,student?,files_at_path],update_submissions->[flash_now,set_pr_release_on_results,short_identifier,empty?,find,has_key?,message,log,where,set_release_on_results,update_results_stats,is_peer_review?,head,t,id,update_remark_request_count],download_repo_list->[get_repo_list,short_identifier,send_data,find],run_tests->[find,has_key?,host_with_port,flash_message,join,map,flash_now,protocol,is_a?,message,t,empty?,blank?,id,short_identifier,perform_later,render,head,authorize!],download_groupings_files->[revision_identifier,new,find,where,send_file,map,repo_name,get_revision,exist?,send_tree_to_zip,to_s,access_repo,ta?,each,open,repository_folder,id,delete,short_identifier,user_name],set_filebrowser_vars->[get_latest_revision,access_repo,files_at_path,join,repository_folder,missing_assignment_files],server_time->[now,render,l],download_repo_checkout_commands->[short_identifier,send_data,find,get_repo_checkout_commands,join],uncollect_all_submissions->[perform_later,js,find,respond_to,render,job_id],file_manager->[find,can_collect_now?,allow_web_submits,accepted_grouping_for,flash_message,set_filebrowser_vars,nil?,vcs_submit,is_peer_review?,t,grouping_past_due_date?,human_attribute_name,blank?,id,redirect_to,is_valid?,render,section,scanned_exam?,overtime_message],browse->[section_due_dates_type,flash_now,l,nil?,find,new,scanned_exam,calculate_collection_time,past_all_collection_dates?,each,layout,now,ta?,join,name,t,find_each,push],index->[render,find,respond_to,pluck,json,current_submission_data],get_all_file_data->[path_exists?,compact,sort,join,repository_folder,count],revisions->[server_timestamp,to_s,get_all_revisions,find,path_exists?,timestamp,render,changes_at_path?,access_repo,revision_identifier_ui,each,repository_folder,l,map],update_files->[only_required_files,find,allow_web_submits,accepted_grouping_for,flash_message,set_filebrowser_vars,join,redirect_back,concat,add_files,remove_folders,t,commit_transaction,flash_repository_messages,empty?,access_repo,remove_files,get_transaction,blank?,present?,gsub,add_folders,is_valid?,user_name,student?,pluck,raise,authorize!],collect_submissions->[find,has_key?,current,flash_now,to_set,scanned_exam,transform_keys,t,count,empty?,all_grouping_collection_dates,include?,present?,each,id,short_identifier,perform_later,render,is_collected?,head],download->[nil?,get_latest_revision,find,render,send_data,access_repo,download_as_string,find_appropriate_grouping,files_at_path,message,get_revision,join,t,repository_folder,id],get_file->[revision_identifier,find,flash_message,get_file_type,is_binary?,is_supported_image?,encode!,nil?,redirect_back,download_as_string,get_revision,t,is_a_reviewer?,access_repo,to_json,filename,grouping,id,is_pdf?,path,render,student?,files_at_path,pr_assignment],manually_collect_and_begin_grading->[redirect_to,nil?,find,edit_assignment_submission_result_path,perform_now,assignment_id,current_submission_used,id],repo_browser->[server_timestamp,nil?,get_all_revisions,find,path_exists?,revision_identifier,to_s,render,changes_at_path?,access_repo,in_time_zone,current_submission_used,each,repository_folder],populate_file_manager->[get_all_file_data,get_latest_revision,find,render,student?,access_repo,accepted_grouping_for,get_revision,blank?],before_action,include]] | finds a node in the groupings that has a test run. | Metrics/LineLength: Line is too long. [122/120] |
@@ -138,14 +138,11 @@ func signAndPublishDeviceEK(ctx context.Context, g *libkb.GlobalContext, generat
}
type deviceEKsResponse struct {
- Results []struct {
- MerklePayload string `json:"merkle_payload"`
- Sig string `json:"sig"`
- } `json:"results"`
+ Sigs []string `json:"sigs"`
}
-func getActiveDeviceEKMetadata(ctx context.Context, g *libkb.GlobalContext, merkleRoot libkb.MerkleRoot) (metadata map[keybase1.DeviceID]keybase1.DeviceEkMetadata, err error) {
- defer g.CTrace(ctx, "GetActiveDeviceEKMetadata", func() error { return err })()
+func getAllDeviceEKMetadataMaybeStale(ctx context.Context, g *libkb.GlobalContext, merkleRoot libkb.MerkleRoot) (metadata map[keybase1.DeviceID]keybase1.DeviceEkMetadata, err error) {
+ defer g.CTrace(ctx, "getAllDeviceEKMetadataMaybeStale", func() error { return err })()
apiArg := libkb.APIArg{
Endpoint: "user/device_eks",
| [DeriveDHKey->[Bytes32],GetDeviceID,UnmarshalAgain,GetUID,GetKID,NaclVerifyAndExtract,DeriveDHKey,SignToString,Bytes32,Put,GetAPI,CDebugf,HashMeta,Marshal,Post,SigningKey,Errorf,CTrace,GetUPAKLoader,Sum256,Ctime,NewLoadUserByUIDArg,Equal,Get,MaxGeneration,GetDeviceEKStorage,Unmarshal,TimeFromSeconds,Load] | getActiveDeviceEKMetadata gets the device s long term metadata blob and the device s merkle Two devices have the same hash and the merkle root. | pre-existing bug. We should split this function into `maybeStale` and `active` like in user_ek -- the `getServerMaxDeviceEK` is busted if the latest key is stale. |
@@ -130,13 +130,16 @@ public class ClipboardActionsBean implements ClipboardActions, Serializable {
private transient Map<String, List<Action>> actionCache;
+ @Override
public void releaseClipboardableDocuments() {
}
+ @Override
public boolean isInitialized() {
return documentManager != null;
}
+ @Override
public void putSelectionInWorkList(Boolean forceAppend) {
canEditSelectedDocs = null;
if (!documentsListsManager.isWorkingListEmpty(DocumentsListsManager.CURRENT_DOCUMENT_SELECTION)) {
| [ClipboardActionsBean->[getCacheKey->[getCurrentSelectedListName],moveDocumentList->[moveDocumentList,moveDocumentsToNewParent],getCanEditSelectedDocs->[getCurrentSelectedList],selectList->[setCurrentSelectedList],exportMainBlobFromWorkingListAsZip->[exportWorklistAsZip],getActionsForCurrentList->[getCurrentSelectedListName,isWorkListEmpty],getCanMoveWorkingList->[getCanMove],getCanMoveInside->[exists],exportAllBlobsFromWorkingListAsZip->[exportWorklistAsZip],getCanMove->[getCanMoveInside],getCanPasteFromClipboardInside->[getCanPasteInside],getCurrentSelectedListTitle->[getCurrentSelectedListName],pasteWorkingList->[pasteDocumentList],putSelectionInWorkList->[putSelectionInWorkList],exists->[exists],autoSelectCurrentList->[setCurrentSelectedList,getCurrentSelectedListName],returnToPreviouslySelectedList->[setCurrentSelectedList],pasteClipboard->[pasteDocumentList],getCanPaste->[getParent],getDescriptorsForAvailableLists->[getAvailableLists],moveClipboardInside->[moveDocumentList],getCurrentSelectedListName->[setCurrentSelectedList],pasteDocumentListInside->[pasteDocumentListInside],getCanPasteWorkList->[getCanPaste],getCanMoveFromClipboardInside->[getCanMoveInside],removeWorkListItem->[exists],isCacheEnabled->[isWorkListEmpty],exportWorklistAsZip->[exportWorklistAsZip],getCanPasteFromClipboard->[getCanPaste],moveWorkingList->[moveDocumentList],pasteDocumentList->[pasteDocumentList],pasteClipboardInside->[pasteDocumentListInside]]] | This method releases the clipboardable documents in the worklist. | This cleanup should have gone in a separate commit. |
@@ -74,7 +74,7 @@ func (wh *webhook) run(stop <-chan struct{}) {
mux := http.DefaultServeMux
// HTTP handlers
- mux.HandleFunc("/health/ready", wh.healthReadyHandler)
+ mux.HandleFunc("/healthz", wh.healthHandler)
mux.HandleFunc(osmWebhookMutatePath, wh.mutateHandler)
server := &http.Server{
| [mutateHandler->[Write,Msg,Error,Sprintf,Marshal,Msgf,Decode,ReadAll,mutate,Get,Info,Err,Debug],healthReadyHandler->[Write,Error,Msgf,Err,WriteHeader],isNamespaceAllowed->[IsMonitoredNamespace],mustInject->[Msg,Error,CoreV1,Msgf,Background,isNamespaceAllowed,Get,Info,Err,Namespaces],run->[ListenAndServeTLS,Msg,Error,Sprintf,Msgf,Background,WithCancel,Shutdown,X509KeyPair,GetCertificateChain,Info,HandleFunc,Err,GetPrivateKey],mutate->[Msg,Error,Msgf,createPatch,Unmarshal,mustInject,Info,Err],Patch,IssueCertificate,Msgf,AdmissionregistrationV1beta1,Info,Error,Marshal,NewCodecFactory,Errorf,GetCertificateChain,Trace,MutatingWebhookConfigurations,UniversalDeserializer,ToLower,Get,Err,NewScheme,Sprintf,Background,CommonName,run] | run starts the webhook server. | We could put this string in a central place somewhere so we can reference it in both places where it appears in the code here in this PR. |
@@ -600,6 +600,7 @@ MINIFY_BUNDLES = {
'js/zamboni/buttons.js',
'js/zamboni/tabs.js',
'js/common/keys.js',
+ 'js/common-min.js',
# jQuery UI
'js/lib/jquery-ui/jquery.ui.core.js',
| [path->[join],lazy_langs->[dict,lower],read_only_mode->[list,insert,get,tuple,index,Exception],JINJA_CONFIG->[MemcachedBytecodeCache],abspath,path,lazy,basename,parse,dict,gethostname,dirname,get,client_from_dict_config,format,join,lower] | Zamboni - specific libraries. Common JS for all keys. | common-min.js is is a generated file. It shouldn't be included here. In fact, it's generated from this list of files, so I'm surprised that this helps. |
@@ -13,7 +13,7 @@ import (
"code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
- webhook_module "code.gitea.io/gitea/modules/webhook"
+ webhook_module "code.gitea.io/gitea/services/webhook"
)
type webhookNotifier struct {
| [NotifySyncDeleteRef->[NotifyDeleteRef],NotifySyncCreateRef->[NotifyCreateRef]] | NotifyIssueClearLabels creates a new Notifier object that notifies on clear labels of an issue NotifyForkRepository notifies the user who has blocked the issue. | I think we should rename _module to _service ... |
@@ -649,7 +649,8 @@ public class DataWeaveExpressionLanguageAdaptorTestCase extends AbstractWeaveExp
@Test
public void evaluateInvalidCompiledExpression() throws MuleException {
ExpressionCompilationException e = new ExpressionCompilationException(createStaticMessage("oopsy"));
- expectedEx.expect(is(sameInstance(e)));
+ expectedEx.expect(ExpressionRuntimeException.class);
+ expectedEx.expectCause(is(sameInstance(e)));
CompiledExpression compiled = new IllegalCompiledExpression("#[ble]", e);
try (ExpressionLanguageSessionAdaptor session =
| [DataWeaveExpressionLanguageAdaptorTestCase->[MyAnnotatedBean->[getLocation->[getAnnotation],getRootContainerName->[getAnnotation,getRootContainerName]]]] | Evaluate invalid compiled expression. | we should assert thet the error message is meaningful here |
@@ -262,6 +262,18 @@ function indexToInsertByPosition (items, position) {
return (query in queries) ? queries[query](idx) : idx
}
+function removeExtraSeparators (template) {
+ let visiblePrev
+ const visibleItems = template.filter(el => el.visible !== false)
+
+ return visibleItems.filter((el, idx, array) => {
+ const meetsDeleteConditions = !visiblePrev || idx === array.length - 1 || array[idx + 1].type === 'separator'
+ const toDelete = el.type === 'separator' && meetsDeleteConditions
+ visiblePrev = toDelete ? visiblePrev : el
+ return !toDelete
+ })
+}
+
function insertItemByType (item, pos) {
const types = {
normal: () => this.insertItem(pos, item.commandId, item.label),
| [No CFG could be retrieved] | Insert a menu item into the menu. Menu MenuItem exports. | This is _a little_ hard to scan. I think that a `reduce` would work wonders here. |
@@ -121,6 +121,9 @@ func (bc *BuildPodController) HandlePod(pod *kapi.Pod) error {
nextStatus := build.Status.Phase
currentReason := build.Status.Reason
+ // if the build is marked failed, the build status reason has already been
+ // set (probably by the build pod itself), so don't do any updating here
+ // or we'll overwrite the correct value.
if build.Status.Phase != buildapi.BuildPhaseFailed {
switch pod.Status.Phase {
case kapi.PodPending:
| [deletePod->[HandleBuildPodDeletion],handlePodNotFound->[HandleBuildPodDeletion],work->[HandlePod]] | HandlePod handles a pod update pod grammar is a helper function to update the build object with the status of all the nextStatus is a helper function to set the next status of a build. | Should we have utility functions that delineate which non-successful BuildPhases are set by the build pod (where it is *currently* just Failed) and which are set outside of the build pod (i.e. BuildPhaseError), in case those two lists change over time? |
@@ -328,6 +328,14 @@ func resourceComputeInstance() *schema.Resource {
Computed: true,
},
+ "network_ip": &schema.Schema{
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ Computed: true,
+ Deprecated: "Please use address",
+ },
+
"access_config": &schema.Schema{
Type: schema.TypeList,
Optional: true,
| [GetChange,Hash,NewSet,SetPartial,RelativeLink,SetLabels,StringInSlice,SetScheduling,SetTags,Delete,Partial,Set,AttachDisk,DeleteAccessConfig,MatchString,GetOk,FindStringSubmatch,IntAtLeast,HasChange,SetMetadata,Errorf,Len,SetId,MustCompile,Bool,Sum256,Wrapf,Do,SetConnInfo,Id,DetachDisk,AddAccessConfig,DecodeString,Get,Split,Printf,Sprintf,List,Insert,EncodeToString,HashString] | Schema for the network interface and access config XML Schema for network and network_interface resources. | @danawillow what was the plan with `address` and `network_ip`? |
@@ -42,7 +42,8 @@ cov = mne.cov.regularize(cov, evoked.info)
import pylab as pl
pl.figure()
ylim = dict(eeg=[-10, 10], grad=[-400, 400], mag=[-600, 600])
-plot_evoked(evoked, ylim=ylim, proj=True)
+picks = fiff.pick_types(evoked.info, meg=True, eeg=True)
+plot_evoked(evoked, picks=picks, ylim=ylim, proj=True, exclude='bads')
###############################################################################
# Run solver
| [regularize,read_cov,read_forward_solution,dict,data_path,apply_inverse,crop,plot_sparse_source_estimates,make_inverse_operator,read_evoked,figure,plot_evoked,mixed_norm] | Plot the noise of a single sample. Plot the MxNE inverse solution of a single residue. | This will throw a warning since the `exclude` parameter is not set. Might be saner to do `exclude='bads'` then omit from the next line. |
@@ -164,7 +164,8 @@ public class PullPhysicalPlan {
// Could be one or more keys
KEY_LOOKUP,
RANGE_SCAN,
- TABLE_SCAN
+ TABLE_SCAN,
+ UNKNOWN
}
/**
| [PullPhysicalPlan->[close->[close],next->[next],open->[open]]] | Get the pullSourceType of the query. | We cannot know what the WHERE clause is for stream pull queries since it's not analyzed by the logical plan |
@@ -101,9 +101,7 @@ func Execute(configFile io.Reader) {
context.GetLogger(app).Fatalln(err)
}
} else {
- tlsConf := &tls.Config{
- ClientAuth: tls.NoClientCert,
- }
+ tlsConf := crypto.SecureTLSConfig(&tls.Config{ClientAuth: tls.NoClientCert})
if len(config.HTTP.TLS.ClientCAs) != 0 {
pool := x509.NewCertPool()
| [Path,CombinedLoggingHandler,Subjects,PathPrefix,RegisterRoute,ListenAndServeTLS,ReadFile,ParseLevel,Errorf,Fatalln,Methods,Debugf,Infof,NewApp,Fatalf,ListenAndServe,NewCertPool,Background,Subrouter,String,Parse,SetLevel,NewRoute,AppendCertsFromPEM,GetLogger] | Registering routes for the given admin router. Listen on the HTTP server and serve the . | `crypto` module isn't imported. |
@@ -630,6 +630,10 @@ export class Resource {
*/
pause() {
if (this.state_ == ResourceState.NOT_BUILT || this.paused_) {
+ if (this.paused_) {
+ dev.warn(TAG, 'pause() called on an already paused resource:',
+ this.debugid);
+ }
return;
}
this.paused_ = true;
| [No CFG could be retrieved] | Gets the task ID for a resource. A function to handle the case where a specific element is not visible. | `#warn` won't give us the call stack, this has to be an `#error`. |
@@ -268,7 +268,10 @@ func (t *Team) Rotate(ctx context.Context) error {
memSet := newMemberSet()
// create the team section of the signature
- section, err := memSet.Section(t.Chain.GetID())
+
+ // TODO -- fill in a non-nil if we can't write/admin this chain explicitly and need
+ // admin permissions. See CORE-5501
+ section, err := memSet.Section(t.Chain.GetID(), nil)
if err != nil {
return err
}
| [AllApplicationKeys->[SharedSecret],rotateBoxes->[Members],ApplicationKey->[SharedSecret],Rotate->[SharedSecret],ChangeMembership->[getDowngradedUsers],sigChangeItem->[NextSeqno,loadMe],SharedSecret->[SharedSecret],changeMembershipSection->[SharedSecret],Members->[UsersWithRole],getDowngradedUsers->[isAdminOrOwner]] | Rotate rotates the team key for all current members. | why doesn't this try calling t.getAdminPermission()? |
@@ -32,13 +32,15 @@ const Routes = ({ match }) => (
<>
<Switch>
<%_ if (!readOnly) { _%>
- <ErrorBoundaryRoute exact path={`${match.url}/:id/delete`} component={<%= entityReactName %>DeleteDialog} />
<ErrorBoundaryRoute exact path={`${match.url}/new`} component={<%= entityReactName %>Update} />
<ErrorBoundaryRoute exact path={`${match.url}/:id/edit`} component={<%= entityReactName %>Update} />
<%_ } _%>
<ErrorBoundaryRoute exact path={`${match.url}/:id`} component={<%= entityReactName %>Detail} />
<ErrorBoundaryRoute path={match.url} component={<%= entityReactName %>} />
</Switch>
+ <%_ if (!readOnly) { _%>
+ <ErrorBoundaryRoute exact path={`${match.url}/:id/delete`} component={<%= entityReactName %>DeleteDialog} />
+ <%_ } _%>
</>
);
| [No CFG could be retrieved] | Routes - Route mapping. | not so sure about that one... if the point of having the deletion modal on top of the entity list page is what matters, then there may be a better way to achieve that |
@@ -17,6 +17,8 @@ package cluster
import (
"context"
+ "github.com/gogo/protobuf/proto"
+
. "github.com/pingcap/check"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/kvproto/pkg/pdpb"
| [TearDownTest->[cancel],TestReportBatchSplit->[NewIDAllocator,NewMemoryKV,HandleBatchReportSplit,Assert,NewBasicCluster,NewStorage],TestReportSplit->[NewIDAllocator,NewMemoryKV,Assert,HandleReportSplit,NewBasicCluster,NewStorage],SetUpTest->[Background,WithCancel]] | TestReportSplit tests a single TestReportBatchSplit is a batch split test that handles report split requests on both ends. | remove the empty line |
@@ -51,7 +51,14 @@ public class LuceneCacheWarmer implements Runnable {
for (final File indexDir : indexDirs) {
final long indexStartNanos = System.nanoTime();
- final EventIndexSearcher eventSearcher = indexManager.borrowIndexSearcher(indexDir);
+ final EventIndexSearcher eventSearcher;
+ try {
+ eventSearcher = indexManager.borrowIndexSearcher(indexDir);
+ } catch (final FileNotFoundException fnfe) {
+ logger.debug("Cannot warm Lucene Index directory {} because the directory no longer exists", indexDir);
+ continue;
+ }
+
indexManager.returnIndexSearcher(eventSearcher);
final long indexWarmMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - indexStartNanos);
| [LuceneCacheWarmer->[run->[debug,error,toSeconds,listFiles,nanoTime,returnIndexSearcher,info,toMillis,borrowIndexSearcher],getLogger]] | Checks if there is a in the index cache. | Hi, What do you think of extracting this nested try to a separate method? |
@@ -17,12 +17,17 @@ import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
+import static io.airlift.configuration.ConfigBinder.configBinder;
+import static org.weakref.jmx.guice.ExportBinder.newExporter;
+
public class EventListenerModule
implements Module
{
@Override
public void configure(Binder binder)
{
+ configBinder(binder).bindConfig(EventListenerConfig.class);
binder.bind(EventListenerManager.class).in(Scopes.SINGLETON);
+ newExporter(binder).export(EventListenerManager.class).withGeneratedName();
}
}
| [EventListenerModule->[configure->[in]]] | Configure the missing event listener manager. | No need to add this since `EventListenerManager` doesn't have any `@Managed` annotations. |
@@ -133,6 +133,17 @@ func (ms *Status) Start() error {
return nil
}
+ exists, err = ms.hasActionData()
+ if err != nil {
+ ms.updateErr(err.Error(), "Unable to detect migration status")
+ return err
+ }
+ if exists {
+ ms.update("Starting migration of actions to the event-feed-service")
+ go ms.migrateAction()
+ return nil
+ }
+
return nil
}
| [migrateBerlinToCurrent->[finish],migrateNodeStateToCurrent->[finish,updateErr,taskCompleted,update]] | Start starts the migration process MigrationNeeded checks if migration is needed Determines if the migration is in a state that is not in the state table. | The migration runs in the background and does not prevent the ingest-service for starting fully while migrating the actions. |
@@ -112,6 +112,15 @@ public abstract class HttpClientTracer<REQUEST, CARRIER, RESPONSE> extends BaseT
super.endExceptionally(span, throwable, -1);
}
+ /** Convenience method primarily for bytecode instrumentation. */
+ public void endMaybeExceptionally(Context context, RESPONSE response, Throwable throwable) {
+ if (throwable != null) {
+ endExceptionally(context, throwable);
+ } else {
+ end(context, response);
+ }
+ }
+
private Span internalStartSpan(
Context parentContext, REQUEST request, String name, long startTimeNanos) {
SpanBuilder spanBuilder =
| [HttpClientTracer->[onResponse->[status],setUrl->[url],internalStartSpan->[startSpan],end->[end],endExceptionally->[endExceptionally],onRequest->[method,requestHeader],setFlavor->[flavor],spanNameForRequest->[method],startSpan->[getSetter,startSpan]]] | This method is called to end the exceptionally. | I'd put this method in a PR with at least one usage of it - inClientSpan / withClientSpan are quite clear here, but not this method which isn't used. One way to keep PRs small is to change just one usage in one PR, and remaining usages in a mechanical way in another. |
@@ -48,10 +48,10 @@ namespace System.Text.Json.Serialization.Converters
// Read method would have thrown if otherwise.
Debug.Assert(tokenType == JsonTokenType.PropertyName);
+ ReadOnlySpan<byte> unescapedPropertyName = JsonSerializer.GetPropertyName(ref state, ref reader, options);
JsonPropertyInfo jsonPropertyInfo = JsonSerializer.LookupProperty(
obj,
- ref reader,
- options,
+ unescapedPropertyName,
ref state,
out bool useExtensionProperty);
| [ObjectDefaultConverter->[ReadPropertyValue->[ShouldDeserialize,EndProperty,ReadJsonAndSetMember,ReadJsonAndAddExtensionProperty,ReadWithVerify,Skip],ReadAheadPropertyValue->[ClassType,Value,ReadValue,UseExtensionProperty,SingleValueReadWithReadAhead,PropertyState],OnTryWrite->[ClassType,Value,WriteStartObject,ProcessedStartToken,EnumeratorIndex,ShouldSerialize,DataExtensionProperty,ProcessedEndToken,ShouldFlush,WriteReferenceForObject,WriteEndObject,SupportContinuation,Assert,Ref,GetMemberAndWriteJson,EndProperty,GetMemberAndWriteJsonExtensionData,DeclaredJsonPropertyInfo,ReferenceHandler,PropertyCacheArray,Length],OnTryRead->[StartObject,ObjectState,ReadAheadPropertyValue,JsonPropertyInfo,ShouldDeserialize,CreatedObject,ReadValue,ReadRefEndObject,PropertyValue,JsonPropertyName,TryRead,ThrowJsonException_DeserializeUnableToConvertValue,StartToken,LookupProperty,MetadataId,ReadPropertyValue,PropertyRefCache,ReadWithVerify,Assert,ResolveMetadata,Type,UpdateSortedPropertyCache,TokenType,Current,None,Name,EndProperty,ReadJsonAndSetMember,ReadName,PropertyName,ReadJsonAndAddExtensionProperty,Read,AddReference,UseFastPath,TrySkip,CreateObject,ThrowNotSupportedException_DeserializeNoConstructor,ReferenceHandler,UseExtensionProperty,EndObject,ReturnValue,PropertyState]]] | This method is called when a try read operation is required. Reads all properties in the object. Checks if a value is missing from the JSON and if so sets it. | Note that `GetPropertyName` is marked with `AggressiveInline` but `LookupProperty` is not (it used to be, but there became 4 references to it over time causing code bloat). |
@@ -27,6 +27,7 @@ return array(
'logout' => "Log out",
'logoutok' => "You have been logged out.",
'logouterror' => "We couldn't log you out. Please try again.",
+ 'session_expired' => "Your session has expired. Please reload the page to log in.",
'loggedinrequired' => "You must be logged in to view the requested page.",
'adminrequired' => "You must be an administrator to view the requested page.",
| [No CFG could be retrieved] | List of all possible errors in a specific order This method is called when a plugin is deactivated. | Reloading the page won't always prompt for login. |
@@ -117,8 +117,6 @@ class Collection(ModelBase):
objects = CollectionManager()
- top_tags = TopTags()
-
class Meta(ModelBase.Meta):
db_table = 'collections'
unique_together = (('author', 'slug'),)
| [FeaturedCollection->[post_save_or_delete->[update_featured_status]],Collection->[get_abs_url->[get_url_path],post_delete->[is_featured],add_addon->[save],can_view_stats->[owned_by],remove_addon->[save],post_save->[is_featured],set_addons->[save],CollectionManager,TopTags],CollectionAddon->[post_delete->[is_featured,update_featured_status,post_save]],TopTags->[__set__->[key],__get__->[key]]] | Return unicode string of the object. | The `TopTags` at the beginning of the file is now unused and can be removed as well. |
@@ -179,6 +179,12 @@ $array = array('rowid' => 'ID', 'ref' => 'Ref', 'label' => 'Label', 'datec' => '
print $form->selectarray('TAKEPOS_SORTPRODUCTFIELD', $array, (empty($conf->global->TAKEPOS_SORTPRODUCTFIELD) ? 'rowid' : $conf->global->TAKEPOS_SORTPRODUCTFIELD), 0, 0, 0, '', 1);
print "</td></tr>\n";
+print '<tr class="oddeven"><td>';
+print $langs->trans('TakeposGroupSameProduct');
+print '<td colspan="2">';
+print ajax_constantonoff("TAKEPOS_GROUP_SAME_PRODUCT", array(), $conf->entity, 0, 0, 1, 0);
+print "</td></tr>\n";
+
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
| [textwithpicto,fetchAllEMailTemplate,query,addExtraField,rollback,loadLangs,trans,isEnabled,fetch_object,begin,select_all_categories,close,selectarray,commit] | Ajax method for displaying category ID and VAT grouped on ticket and product. Print a list of all numpad payment types. | If you use (and we should from v12) the new feature "forcereload" (param 1 at position 6), it means clicking on image is enough to switch. This also means you don't have to make the "$res = dolibarr_set_const($db, 'TAKEPOS_GROUP_SAME_PRODUCT', ..." when you click on save button or you will erase the setup |
@@ -23,7 +23,7 @@ angular.module('<%=angularAppName%>')
var url = '//' + loc.host + loc.pathname + 'websocket/tracker';<% if (authenticationType == 'oauth2') { %>
/* globals localStorage */
/*jshint camelcase: false */
- var authToken = JSON.parse(localStorage.getItem('ls.token')).access_token;
+ var authToken = JSON.parse(localStorage.getItem('jhi-authenticationToken')).access_token;
url += '?access_token=' + authToken;<% } %>
var socket = new SockJS(url);
stompClient = Stomp.over(socket);
| [No CFG could be retrieved] | The tracker is a singleton object that can be used to connect to the tracker websocket and subscribe The functions that are called when the user has unsubscribed from the network. | shouldnt this be `$localStorage.authenticationToken` ? @cicoub13 |
@@ -1335,7 +1335,13 @@ class CheckoutDeliveryMethodUpdate(BaseMutation):
),
)
- delivery_method = convert_to_shipping_method_data(shipping_method)
+ delivery_method = convert_to_shipping_method_data(
+ shipping_method,
+ shipping_models.ShippingMethodChannelListing.objects.filter(
+ shipping_method=shipping_method,
+ channel=checkout_info.channel,
+ ).get(),
+ )
cls._check_delivery_method(
checkout_info, lines, shipping_method=delivery_method, collection_point=None
)
| [CheckoutBillingAddressUpdate->[perform_mutation->[CheckoutBillingAddressUpdate,save,get_checkout_by_token]],CheckoutLinesDelete->[perform_mutation->[update_checkout_shipping_method_if_invalid,CheckoutLinesDelete,validate_lines,get_checkout_by_token]],CheckoutComplete->[perform_mutation->[CheckoutComplete,get_checkout_by_token]],CheckoutCreate->[save->[save],Arguments->[CheckoutCreateInput],clean_input->[retrieve_shipping_address,retrieve_billing_address,clean_checkout_lines],clean_checkout_lines->[check_lines_quantity,validate_variants_available_for_purchase]],CheckoutShippingAddressUpdate->[process_checkout_lines->[check_lines_quantity],perform_mutation->[process_checkout_lines,CheckoutShippingAddressUpdate,update_checkout_shipping_method_if_invalid,get_checkout_by_token,save]],update_checkout_shipping_method_if_invalid->[clean_delivery_method],CheckoutLineDelete->[perform_mutation->[update_checkout_shipping_method_if_invalid,CheckoutLineDelete,get_checkout_by_token]],CheckoutShippingMethodUpdate->[perform_on_shipping_method->[CheckoutShippingMethodUpdate,save,_check_delivery_method],perform_on_external_shipping_method->[CheckoutShippingMethodUpdate,save,_check_delivery_method],_check_delivery_method->[clean_delivery_method],perform_mutation->[get_checkout_by_token,_resolve_delivery_method_type]],CheckoutRemovePromoCode->[perform_mutation->[CheckoutRemovePromoCode,get_checkout_by_token]],CheckoutDeliveryMethodUpdate->[perform_mutation->[get_checkout_by_token,_resolve_delivery_method_type,perform_on_shipping_method,perform_on_external_shipping_method,perform_on_collection_point],perform_on_shipping_method->[CheckoutDeliveryMethodUpdate,_check_delivery_method],_check_delivery_method->[clean_delivery_method],_update_delivery_method->[save],perform_on_external_shipping_method->[CheckoutDeliveryMethodUpdate,_check_delivery_method],perform_on_collection_point->[CheckoutDeliveryMethodUpdate,_check_delivery_method]],CheckoutAddPromoCode->[perform_mutation->[update_checkout_shipping_method_if_invalid,CheckoutAddPromoCode,get_checkout_by_token]],CheckoutEmailUpdate->[perform_mutation->[save,get_checkout_by_token,CheckoutEmailUpdate]],CheckoutLinesAdd->[perform_mutation->[CheckoutLinesAdd,update_checkout_shipping_method_if_invalid,get_checkout_by_token,clean_input],clean_input->[validate_checkout_lines,validate_variants_available_for_purchase],validate_checkout_lines->[check_lines_quantity]],CheckoutLinesUpdate->[validate_checkout_lines->[check_lines_quantity]],CheckoutCustomerAttach->[perform_mutation->[save,CheckoutCustomerAttach,get_checkout_by_token]],CheckoutCustomerDetach->[perform_mutation->[save,CheckoutCustomerDetach,get_checkout_by_token]],CheckoutLanguageCodeUpdate->[perform_mutation->[save,get_checkout_by_token,CheckoutLanguageCodeUpdate]]] | This method checks on a specific delivery method. | Wouldn't be better to have here `.first()`? I don't see any try/catch here |
@@ -210,6 +210,7 @@ func (o *RollbackOptions) Run() error {
return err
}
target = deployment
+ configName = r.Name
}
if target == nil {
return fmt.Errorf("%s is not a valid deployment or deployment config", o.TargetName)
| [Validate->[getBuilder,Errorf],findResource->[Object,NamespaceParam,Index,Do,getBuilder,ResourceTypeOrNameArgs,SingleResourceType,Errorf,IsNotFound,Err],findTargetDeployment->[ByLatestVersionDesc,Sort,List,DeploymentVersionFor,ConfigSelector,ReplicationControllers,Errorf,DeploymentStatusFor],Run->[Describe,Write,Rollback,Fprintf,Join,PrintObj,Sprintf,DeploymentConfigNameFor,DeploymentConfigs,NewVersionedPrinter,Errorf,findResource,findTargetDeployment,Get,NewDeploymentConfigDescriber,GetPrinter,Update],Complete->[DefaultNamespace,Object,UniversalDecoder,ClientMapperFunc,NewBuilder,Clients],Int64Var,Flags,Error,BoolVarP,Sprintf,Validate,StringVarP,UsageError,MarkFlagFilename,CheckErr,Run,Complete,BoolVar] | Run performs the rollback action This function is responsible for running the rollback and rollback actions. if true the node will be enabled. | add default or check if the `configName` is not empty |
@@ -28,9 +28,9 @@ module Idv
end
def render_document_capture_cancelled
- failure(I18n.t('errors.doc_auth.document_capture_cancelled'))
mark_steps_incomplete
redirect_to idv_url
+ failure(I18n.t('errors.doc_auth.document_capture_cancelled'))
end
def render_step_incomplete_error
| [LinkSentStep->[call->[handle_document_verification_success,take_photo_with_phone_successful?,cancelled_at],document_capture_session_result->[load_doc_auth_async_result,load_result],handle_document_verification_failure->[first_error_message,failure,mark_step_incomplete,to_h],handle_document_verification_success->[extract_pii_from_doc],take_photo_with_phone_successful?->[present?,success?],mark_steps_complete->[each,mark_step_complete],mark_steps_incomplete->[each,mark_step_incomplete],render_document_capture_cancelled->[t,redirect_to,failure],render_step_incomplete_error->[t,failure]]] | called by action_missing. | Arguably we could remove `link_sent` from `HYBRID_FLOW_STEPS` since it's not having any effect here anyways, but I don't think it hurts anything to keep. |
@@ -41,7 +41,7 @@
var handlerRegistry = b.Build<MessageHandlerRegistry>();
var messageTypesHandled = GetMessageTypesHandledByThisEndpoint(handlerRegistry, conventions, settings);
var typesToSubscribe = messageTypesHandled.Where(eventType => !requireExplicitRouting || publishers.GetPublisherFor(eventType).Any()).ToList();
- return new ApplySubscriptions(typesToSubscribe);
+ return new ApplySubscriptions(typesToSubscribe, settings.ExcludedTypes);
});
}
| [AutoSubscribe->[GetMessageTypesHandledByThisEndpoint->[ToList],ApplySubscriptions->[Task->[DebugFormat,Count,SubscribeToEvent,CompletedTask,ConfigureAwait,WhenAll],messagesHandledByThisEndpoint,LogManager],Setup->[b,ToList,Unicast,Publishers,GetMessageTypesHandledByThisEndpoint,Settings,TryGet,RegisterStartupTask,Publishes],Settings,EnableByDefault,Prerequisite]] | This method is called by the feature - specific setup code. | `var typesToSubscribe = messageTypesHandled.Where(eventType => !requireExplicitRouting || publishers.GetPublisherFor(eventType).Any()).ToList();` this part needs to be changed. |
@@ -26,10 +26,7 @@ public final class Jetty11Singletons {
INSTRUMENTER =
ServletInstrumenterBuilder.<HttpServletRequest, HttpServletResponse>create()
.addContextCustomizer(
- (context, request, attributes) -> {
- context = ServerSpanNaming.init(context, CONTAINER);
- return new AppServerBridge.Builder().init(context);
- })
+ (context, request, attributes) -> new AppServerBridge.Builder().init(context))
.build(INSTRUMENTATION_NAME, Servlet5Accessor.INSTANCE);
private static final JettyHelper<HttpServletRequest, HttpServletResponse> HELPER =
| [Jetty11Singletons->[build]] | Singletons for Jetty 11. | should `ServerSpanNaming.get()` context customizer be added here? I notice it's missing in some cases and included in others, but not clear to me why |
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-import {Messaging, WindowPortEmulator} from './messaging.js';
+import {Messaging, WindowPortEmulator} from './messaging';
+import {TouchHandler} from './touch_handler';
import {getAmpDoc} from '../../../src/ampdoc';
import {isIframed} from '../../../src/dom';
import {listen, listenOnce} from '../../../src/event-helper';
| [No CFG could be retrieved] | Creates an object that represents a single unique identifier for a window. Initializes the object. | Please change file name to `touch-handler`. |
@@ -822,9 +822,7 @@ public class GlueHiveMetastore
private static List<String> buildPartitionNames(List<Column> partitionColumns, List<Partition> partitions)
{
- return partitions.stream()
- .map(partition -> makePartitionName(partitionColumns, partition.getValues()))
- .collect(toList());
+ return mappedCopy(partitions, partition -> makePartitionName(partitionColumns, partition.getValues()));
}
/**
| [GlueHiveMetastore->[dropColumn->[getExistingTable,replaceTable],dropTable->[getExistingTable],createTable->[createTable],updatePartitionStatistics->[getPartitionStatistics,updatePartitionStatistics],renameColumn->[getExistingTable,replaceTable],getSupportedColumnStatistics->[getSupportedColumnStatistics],updateTableStatistics->[getExistingTable,getTableStatistics],getTable->[getTable],getPartition->[getPartition],addColumn->[getExistingTable,replaceTable],dropPartition->[getExistingTable,deleteDir,isManagedTable],createDatabase->[createDatabase],setTableOwner->[getExistingTable],getDatabase->[getDatabase],getPartitions->[getPartitions],getPartitionsByNames->[getPartitionsByNames],getPartitionNamesByFilter->[getExistingTable]]] | Build partition names. | We could keep this as `toImmutableList()`. Moving away from streams simply to pre-size the output list, in code that's already doing expensive RPC calls, is a hard sell from a code readability standpoint. |
@@ -69,7 +69,7 @@ public class PluginSubtypeMarker extends AbstractProcessor {
try {
write(e);
} catch (IOException x) {
- processingEnv.getMessager().printMessage(Kind.ERROR, Functions.printThrowable(x), e);
+ processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, Functions.printThrowable(x), e);
}
}
}
| [PluginSubtypeMarker->[write->[write],process->[visitType->[visitType]],asElement->[asElement]]] | Check for unknown types in the given round. | Not to be confused with `hudson.util.FormValidation.Kind`. |
@@ -100,6 +100,11 @@ class Api < Roda
render_with_games
end
+ r.on 'title', String do |title|
+ request.params['title'] = title
+ render(pin: request.params['pin'], games: Game.home_games(user, **request.params).map(&:to_h))
+ end
+
r.on 'game', Integer do |id|
halt(404, 'Game not found') unless (game = Game[id])
| [Api->[halt->[halt],not_authorized!->[halt],user->[user],publish->[publish]]] | Initialize a new middleware. Renders a single object. | why do you do this? |
@@ -394,6 +394,14 @@ def _perform_kumascript_request(request, response_headers, document_locale,
response_headers['X-Kumascript-Caching'] = (
'200 OK, Age: %s' % resp.headers.get('age', 0))
+ # We defer bleach sanitation of kumascript content all the way
+ # through editing, source display, and raw output. But, we still
+ # want sanitation, so it finally gets picked up here.
+ resp_body = bleach.clean(
+ resp_body, attributes=ALLOWED_ATTRIBUTES, tags=ALLOWED_TAGS,
+ strip_comments=False
+ )
+
# Cache the request for conditional GET, but use the max_age for
# the cache timeout here too.
cache.set_many({
| [edit_document->[_invalidate_kumascript_cache],_version_groups->[split_slug],_invalidate_kumascript_cache->[_build_kumascript_cache_keys],_save_rev_and_notify->[_invalidate_kumascript_cache],document->[set_common_headers],_perform_kumascript_request->[_build_kumascript_cache_keys],_version_groups] | Perform a kumascript GET request for a given document locale and slug. Fire off the request and parse the response. Get the response body and errors from the kumascript service. | This is to sanitize the HTML in the EJS templates? |
@@ -82,7 +82,7 @@ class MeshMovingTestCase(KratosUnittest.TestCase):
"MESH_VELOCITY_X",
"MESH_VELOCITY_Y",
"MESH_VELOCITY_Z"],
- "output_file_name" : \""""+result_file_name+"""\",
+ "output_file_name" : \""""+result_file_name.replace("\\", "\\\\")+"""\",
"model_part_name" : "Probe_1",
"time_frequency" : 0.1,
"use_node_coordinates" : true
| [MeshMovingTestCase->[executeTest->[MeshMovingAnalysisForTesting],__GetProblemName->[__GetElementTopology]]] | Sets the print of reference results. Missing node coordinates in the file. | ouch sorry guys this is my bad, I didn't know how to do this in a portable way :/ Would you say this is a good solution? |
@@ -279,11 +279,16 @@ public class Task implements Runnable {
@SuppressWarnings("unchecked")
Class<? extends DataPublisher> dataPublisherClass = (Class<? extends DataPublisher>) Class.forName(
this.taskState.getProp(ConfigurationKeys.DATA_PUBLISHER_TYPE, ConfigurationKeys.DEFAULT_DATA_PUBLISHER_TYPE));
- DataPublisher publisher = closer.register(DataPublisher.getInstance(dataPublisherClass, this.taskState));
+ SingleTaskDataPublisher publisher =
+ closer.register(SingleTaskDataPublisher.getInstance(dataPublisherClass, this.taskState));
LOG.info("Publishing data from task " + this.taskId);
publisher.publish(this.taskState);
+ } catch (IOException e) {
+ throw closer.rethrow(e);
} catch (Throwable t) {
+ LOG.error(String.format("To publish data in task, the publisher class (%s) must extend %s",
+ ConfigurationKeys.DATA_PUBLISHER_TYPE, SingleTaskDataPublisher.class.getSimpleName()), t);
throw closer.rethrow(t);
} finally {
closer.close();
| [Task->[updateRecordMetrics->[updateRecordMetrics],updateByteMetrics->[updateByteMetrics]]] | Publish task data. | This requires data publishers to be of type SingleTaskDataPublisher. If any user is already using a DataPublisher that is not of this type, Gobblin would fail. |
@@ -49,6 +49,8 @@ def sanitize(x: Any) -> Any: # pylint: disable=invalid-name,too-many-return-sta
elif isinstance(x, (list, tuple)):
# Lists and Tuples need their values sanitized
return [sanitize(x_i) for x_i in x]
+ elif isinstance(x, type(None)):
+ return "None"
else:
raise ValueError("cannot sanitize {} of type {}".format(x, type(x)))
| [ensure_list->[list,isinstance],lazy_groups_of->[list,islice,iter],import_submodules->[walk_packages,import_module,invalidate_caches,getattr],is_lazy->[isinstance],namespace_match->[endswith],sanitize->[type,tolist,cpu,sanitize,isinstance,items,ValueError,item,format],group_by_count->[zip_longest,list,iter],pad_sequence_to_length->[append,insert,default_value,len,range],prepare_environment->[manual_seed,log_pytorch_version_info,is_available,pop_int,manual_seed_all,seed],get_spacy_model->[append,load],add_noise_to_dict_values->[uniform,items],gpu_memory_mb->[int,exception,check_output,strip,enumerate],peak_memory_mb->[getrusage],getLogger,TypeVar] | Sanitize a variable into a single object that can be serialized into JSON. | Would `elif x is None` work? |
@@ -1,5 +1,5 @@
# -*- encoding : utf-8 -*-
-class RemoveDefaultValueFromRequestCreatedAtAndRequestUpdatedAtOnRequestSummary < !rails5? ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] # 4.1
+class RemoveDefaultValueFromRequestCreatedAtAndRequestUpdatedAtOnRequestSummary < ActiveRecord::Migration[4.2] # 4.1
def up
change_column_default :request_summaries, :request_created_at, nil
change_column_default :request_summaries, :request_updated_at, nil
| [RemoveDefaultValueFromRequestCreatedAtAndRequestUpdatedAtOnRequestSummary->[up->[change_column_default],down->[now,change_column_default],rails5?]] | upserts the request summaries table so that it can be deleted when the table is updated. | Line is too long. [117/80] |
@@ -359,7 +359,7 @@ namespace System.Xml.Serialization
_writer.Write("if (type == typeof(");
_writer.Write(CodeIdentifier.GetCSharpName(type));
_writer.Write(")) return new ");
- _writer.Write((string)serializers[xmlMappings[i].Key]);
+ _writer.Write((string)serializers[xmlMappings[i].Key!]!);
_writer.WriteLine("();");
}
}
| [XmlSerializationCodeGen->[GeneratePublicMethods->[GenerateHashtableGetBegin,WriteQuotedCSharpString,GenerateHashtableGetEnd],WriteQuotedCSharpString->[WriteQuotedCSharpString],GenerateTypedSerializers->[GenerateHashtableGetBegin,WriteQuotedCSharpString,GenerateHashtableGetEnd],GenerateSerializerContract->[GeneratePublicMethods,GenerateTypedSerializers,GenerateSupportedTypes,GenerateGetSerializer],GenerateTypedSerializer->[WriteQuotedCSharpString],GenerateReferencedMethods->[GenerateMethod]]] | GenerateGetSerializer generates the GetSerializer method which can be used to retrieve the object from the. | At line 331, you do `(string?)` and here you do `!`? Maybe both are fine, just something I noticed. Not sure if it needs to be changed. |
@@ -1,9 +1,15 @@
'use strict';
angular.module('<%=angularAppName%>')
- .controller('HomeController', function ($scope, Principal) {
+ .controller('HomeController', function ($scope, Principal, $state, LoginService) {
Principal.identity().then(function(account) {
$scope.account = account;
$scope.isAuthenticated = Principal.isAuthenticated;
});
+
+ $scope.login = LoginService.open;
+
+ $scope.register = function () {
+ $state.go('register');
+ };
});
| [No CFG could be retrieved] | Provides a controller to manage the user s account. | why is this required, register will still work as normal link?? |
@@ -47,10 +47,15 @@ def is_optimizer_op(op):
class CollectiveHelper(object):
- def __init__(self, role_maker, nrings=1, wait_port='6174'):
+ def __init__(self,
+ role_maker,
+ nrings=1,
+ wait_port='6174',
+ use_pipeline=False):
self.nrings = nrings
self.wait_port = wait_port
self.role_maker = role_maker
+ self.use_pipeline = use_pipeline
def update_startup_program(self, startup_program=None):
self.startup_program = startup_program
| [CollectiveHelper->[_broadcast_params->[range,global_block,iter_parameters,append_op],update_startup_program->[default_startup_program,_init_communicator,worker_index,get_trainer_endpoints,range,_broadcast_params],_init_communicator->[create_var,generate,wait_server_ready,len,global_block,append_op,remove]],is_optimizer_op->[all_attrs,int],is_loss_grad_op->[all_attrs,int],is_backward_op->[all_attrs,int],kOpRoleVarAttrName,kOpRoleAttrName] | Initialize the network with a specific role. | Create a new `PipelineHelper` to do compile, which could inherited from `CollectiveHelper`. As `PipelineHelper` is specific for pipeline, it could be put into corresponding meta optimizer. |
@@ -167,7 +167,7 @@ func NewClients(cfg *common.Config) ([]Connection, error) {
}
if proxyURL := config.Transport.Proxy.URL; proxyURL != nil {
- logp.Info("using proxy URL: %s", proxyURL)
+ logp.Info("using proxy URL: %s", proxyURL.URI().String())
}
params := config.Params
| [Test->[Connect],LoadJSON->[Request],getVersion->[Ping],Close] | NewClients creates a list of Elasticsearch clients based on the given configuration. NewConnectedClient creates a new connection to the host specified in the config. | we already implement `String` on proxyURL. No need to change that line. |
@@ -47,8 +47,8 @@ Menu.prototype._init = function () {
this.delegate = delegate
}
-Menu.prototype.popup = function (options) {
- if (options == null || typeof options !== 'object') {
+Menu.prototype.popup = function (options = {}) {
+ if (typeof options !== 'object') {
throw new TypeError('Options must be an object')
}
let {window, x, y, positioningItem, callback} = options
| [No CFG could be retrieved] | Menu instance methods Menu constructor. | We still need the `null` check here, `null` won't be defaulted and `typeof null === 'object'` |
@@ -18,3 +18,13 @@ class ProductErrorCode(Enum):
VARIANT_NO_DIGITAL_CONTENT = "variant_no_digital_content"
CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT = "cannot_manage_product_without_variant"
PRODUCT_NOT_ASSIGNED_TO_CHANNEL = "product_not_assigned_to_channel"
+
+
+class CollectionErrorCode(Enum):
+ DUPLICATED_INPUT_ITEM = "duplicated_input_item"
+ GRAPHQL_ERROR = "graphql_error"
+ INVALID = "invalid"
+ NOT_FOUND = "not_found"
+ REQUIRED = "required"
+ UNIQUE = "unique"
+ CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT = "cannot_manage_product_without_variant"
| [No CFG could be retrieved] | Missing attributes for the variant_no_digital_content error message. | Do you use this error code somewhere? It doesn't sound like an error code for collection. |
@@ -1090,6 +1090,14 @@ Colorblind5 = Colorblind8[:5]
Colorblind4 = Colorblind8[:4]
Colorblind3 = Colorblind8[:3]
+# Bokeh palette created from colors of shutter logo
+BokehPalette7 = ('#EC1557', '#F05223', '#F6A91B', '#A5CD39', '#20B254', '#00AAAE', '#892889')
+BokehPalette6 = BokehPalette7[:6]
+BokehPalette5 = BokehPalette7[:5]
+BokehPalette4 = BokehPalette7[:4]
+BokehPalette3 = BokehPalette7[:3]
+
+
YlGn = { 3: YlGn3, 4: YlGn4, 5: YlGn5, 6: YlGn6, 7: YlGn7, 8: YlGn8, 9: YlGn9 }
YlGnBu = { 3: YlGnBu3, 4: YlGnBu4, 5: YlGnBu5, 6: YlGnBu6, 7: YlGnBu7, 8: YlGnBu8, 9: YlGnBu9 }
GnBu = { 3: GnBu3, 4: GnBu4, 5: GnBu5, 6: GnBu6, 7: GnBu7, 8: GnBu8, 9: GnBu9 }
| [viridis->[linear_palette],turbo->[linear_palette],inferno->[linear_palette],grey->[linear_palette],magma->[linear_palette],diverging_palette->[linear_palette],plasma->[linear_palette],cividis->[linear_palette],gray->[linear_palette]] | Colorblind friendly palette from http://www. jfly. ac. jp High level functions for finding the best match for a given sequence of values. YlOrBr3 - > YlOrBr4 - > YlOrBr. | I think I'd prefer just `Bokeh` since everything in here is a palette, `BokehPalette` seems a bit redundant |
@@ -24,10 +24,9 @@ class StrConv(NodeVisitor[str]):
def __init__(self, show_ids: bool = False) -> None:
self.show_ids = show_ids
+ self.id_mapper = None # type: IdMapper
if show_ids:
self.id_mapper = IdMapper()
- else:
- self.id_mapper = None
def get_id(self, o: object) -> int:
return self.id_mapper.id(o)
| [StrConv->[visit_star_expr->[dump],visit_await_expr->[dump],visit_class_def->[dump],visit_op_expr->[dump],visit_lambda_expr->[func_helper,dump],visit_for_stmt->[dump],visit_global_decl->[dump],visit_operator_assignment_stmt->[dump],visit_del_stmt->[dump],visit_generator_expr->[dump],format_id->[get_id],visit_decorator->[dump],dump->[get_id],visit_func_def->[func_helper,dump],visit_assert_stmt->[dump],visit_yield_from_expr->[dump],visit_index_expr->[dump],visit_list_comprehension->[dump],visit_try_stmt->[dump],visit_overloaded_func_def->[dump],visit_set_expr->[dump],visit_newtype_expr->[dump],visit_slice_expr->[dump],visit_backquote_expr->[dump],visit_raise_stmt->[dump],visit_with_stmt->[dump],visit_nonlocal_decl->[dump],visit_print_stmt->[dump],visit_type_application->[dump],visit_dict_expr->[dump],visit_assignment_stmt->[dump],visit_continue_stmt->[dump],visit_pass_stmt->[dump],visit_list_expr->[dump],visit_tuple_expr->[dump],visit_yield_expr->[dump],visit_reveal_type_expr->[dump],visit_block->[dump],visit_comparison_expr->[dump],visit_type_var_expr->[dump],visit_return_stmt->[dump],visit_member_expr->[pretty_name,dump],visit_call_expr->[dump],visit_while_stmt->[dump],visit_set_comprehension->[dump],visit_unary_expr->[dump],visit_conditional_expr->[dump],pretty_name->[format_id],visit_cast_expr->[dump],visit_expression_stmt->[dump],visit_mypy_file->[dump],visit_super_expr->[dump],visit_dictionary_comprehension->[dump],visit_if_stmt->[dump],visit_exec_stmt->[dump],visit_break_stmt->[dump]],dump_tagged->[dump_tagged]] | Initialize the object. | Why not Optional? (Currently mypy ignores the None initialization but we may change that, and it seems to me this function can definitely return with `id_mapper` still None. |
@@ -277,7 +277,7 @@ public final class LogoutManagerImpl implements LogoutManager {
* @param url The url to send the message to
* @param message Message to send to the url
*/
- public LogoutHttpMessage(final URL url, final String message) {
+ LogoutHttpMessage(final URL url, final String message) {
super(url, message, LogoutManagerImpl.this.asynchronous);
setContentType(MediaType.APPLICATION_FORM_URLENCODED_VALUE);
}
| [LogoutManagerImpl->[LogoutHttpMessage->[formatOutputMessageInternal->[formatOutputMessageInternal]],handleLogoutForSloService->[serviceSupportsSingleLogout]]] | A logout http message that is accompanied by a special content type and formatting. | Why removing the `public` keyword? |
@@ -263,10 +263,7 @@ define([
op = ast.operator;
left = createRuntimeAst(expression, ast.left);
right = createRuntimeAst(expression, ast.right);
- if (op === '+' || op === '-' || op === '*' ||
- op === '/' || op === '%' || op === '===' ||
- op === '!==' || op === '>' || op === '>=' ||
- op === '<' || op === '<=') {
+ if (binaryOperators.indexOf(op) > -1) {
node = new Node(ExpressionNodeType.BINARY, op, left, right);
} else {
//>>includeStart('debug', pragmas.debug);
| [No CFG could be retrieved] | Parse the node that represents the negative negative or positive number. Determines if the given expression has a reserved word. | This may have hurt "compiling" performance, which will be important for the responsive of a UI generating styles. I don't know for sure so we can see what a profile looks like later; at the least, we can order the linear search so the most common operators are first. |
@@ -664,6 +664,8 @@ public class RegisterMinionActionTest extends JMockBaseTestCaseWithUser {
will(returnValue(Optional.of(MINION_ID)));
allowing(saltServiceMock).getMachineId(MINION_ID);
will(returnValue(Optional.of(MACHINE_ID)));
+ allowing(saltServiceMock).getGrains(with(any(String.class)), with(any(TypeToken.class)),with(any(String[].class)));
+ will(returnValue(Optional.of(new MinionStartupGrains(Optional.of(MACHINE_ID), true))));
allowing(saltServiceMock).syncGrains(with(any(MinionList.class)));
allowing(saltServiceMock).syncModules(with(any(MinionList.class)));
allowing(saltServiceMock).getGrains(MINION_ID);
| [RegisterMinionActionTest->[testMigrationSystemWithChannelsAndAK->[get,executeTest],testMigrationMinionWithReActivationKey->[get,executeTest],testEmptyProfileRegistration->[get,executeTest],testRegisterRHELMinionWithoutActivationKey->[get,executeTest],testRegisterSystemWithAKAndCreator->[executeTest],testMigrationSystemWithChannelsNoAK->[get,executeTest],testRegisterRESMinionWithoutActivationKey->[get,executeTest],testRegisterSystemNoUser->[executeTest],testRegisterDuplicateMinionId->[executeTest],testMigrationSystemWithChannelsAndAKSameBase->[get,executeTest],testRegisterRetailTerminalNonDefaultOrg->[get,executeTest],testRegisterRetailTerminal->[get,executeTest],testMinionWithUsedReActivationKey->[get,executeTest],testRegisterRHELMinionWithRESActivationKeyOneBaseChannel->[get,executeTest],testRegisterMinionWithInvalidActivationKey->[get,executeTest],testChangeContactMethodRegisterMinion->[get,accept,executeTest],testRegisterRetailMinionHwGroupMissing->[get,executeTest],testRegisterMinionWithActivationKeySUSEManagerDefault->[get,executeTest],testRegisterRetailMinionBranchGroupMissing->[executeTest],testRegisterRetailMinionTerminalGroupMissing->[executeTest],testRegisterMinionWithoutActivationKeyNoSyncProducts->[get,executeTest],testRegisterMinionWithInvalidActivationKeyNoSyncProducts->[get,executeTest],testMigrateFormulaDataForEmptyProfile->[get,executeTest],testRegisterRHELMinionWithMultipleReleasePackages->[get,executeTest],executeTest->[get,accept,executeTest,apply],setUp->[setUp],testReRegisterTraditionalAsMinionInvalidActKey->[get],testRegisterMinionWithoutActivationKey->[get,executeTest],testRegisterSystemFromDifferentOrg->[executeTest],testRegisterRetailMinionHwGroupAlreadyAssigned->[get,executeTest],testRegisterRHELMinionWithRESActivationKeyTwoBaseChannels->[get,executeTest],testReRegisterTraditionalAsMinion->[get,accept,executeTest],getGrains->[getGrains],testRegisterMinionWithActivationKey->[get,executeTest],get]] | This test creates a new ActivationKey and registers a minimal with a base channel. This method is called when a user adds a channel to a minion. | Indentation seems off here and in other places in this file, please double check them all. |
@@ -888,8 +888,12 @@ int capi_rsa_sign(int dtype, const unsigned char *m, unsigned int m_len,
/* Now cleanup */
err:
+ if (hash)
CryptDestroyHash(hash);
+ if (hprov && hprov != capi_key->hprov)
+ CryptReleaseContext(hprov, 0);
+
return ret;
}
| [No CFG could be retrieved] | Get the private key and sign the data. Private functions - Generate the hash object and sign it. | I'd be nice to indent this line. |
@@ -9,6 +9,8 @@ Runs a full pipeline using MNE-Python:
- forward model computation
- source reconstruction using dSPM on the contrast : "faces - scrambled"
+Note that this example does quite a bit of processing, so even on a very
+fast machine it can take over 10 minutes to complete.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
| [plot_overlay,plot_events,create_eog_epochs,filter,show_view,make_inverse_operator,make_forward_solution,show,dict,compute_covariance,convert_forward_solution,apply,evoked,epochs_cln,make_field_map,plot,append,print,find_events,data_path,find_bads_eog,plot_components,average,Raw,setup_source_space,set_time,apply_inverse,ICA,Epochs,plot_scores,pick_types] | Generate a list of the objects from the raw data and the SPM faces dataset Plot the event_ids in a plot. | A bit exaggerated. Maybe remove the 'very'. |
@@ -657,5 +657,5 @@ crt_proc_out_common(crt_proc_t proc, crt_rpc_output_t *data)
rc = crt_proc_output(rpc_priv, proc);
out:
- return rc;
+ return crt_der_2_hgret(rc);
}
| [No CFG could be retrieved] | crt_proc_output - Get the out of the proc output. | Same here regarding line 614 |
@@ -29,7 +29,9 @@ public class ErrorHandlerAdvice {
@Advice.Argument(0) Context ctx, @Advice.Argument(1) Throwable throwable) {
Optional<Span> span = ctx.maybeGet(Span.class);
if (span.isPresent()) {
- DECORATE.onError(span.get(), throwable);
+ // TODO this emulates old behaviour of BaseDecorator. Has to review
+ span.get().setStatus(Status.UNKNOWN);
+ TRACER.addThrowable(span.get(), throwable);
}
}
}
| [ErrorHandlerAdvice->[captureThrowable->[isPresent,maybeGet,get,onError]]] | Capture throwable if it is missing. | Or remove status :-) |
@@ -266,9 +266,8 @@ class JvmTarget(Target, Jarable):
@property
def resources(self):
- # TODO(John Sirois): Consider removing this convenience:
- # https://github.com/pantsbuild/pants/issues/346
- # TODO(John Sirois): Introduce a label and replace the type test?
+ # TODO: We should deprecate this method, but doing so will require changes to JVM publishing.
+ # see https://github.com/pantsbuild/pants/issues/4568
return [dependency for dependency in self.dependencies if isinstance(dependency, Resources)]
@property
| [JvmTarget->[resources->[isinstance],compute_dependency_specs->[get,as_dict,super,is_initialized,global_instance],get_jar_dependencies->[collect_jar_deps->[isinstance,update],OrderedSet,walk],exports->[TargetDefinitionException,parse,append,get_target,format],subsystems->[super],has_resources->[len],platform->[global_instance],__init__->[Payload,SetOfPrimitivesField,create_sources_field,PrimitiveField,assert_list,add_labels,super,ExcludesField,deprecated_conditional,add_fields],jar_dependencies->[OrderedSet,get_jar_dependencies]]] | Returns a list of all resources in the dependency graph. | s/deprecate/kill/? It's not public API. |
@@ -2163,7 +2163,7 @@ namespace TTD
Js::CallInfo callInfo(static_cast<Js::CallFlags>(generatorInfo->arguments_callInfo_flags), generatorInfo->arguments_callInfo_count, false /*unusedBool*/);
- Js::Arguments arguments(callInfo, (Js::Var*)argVals);
+ Js::Arguments arguments(callInfo, unsafe_write_barrier_cast<Js::Var*>(argVals));
// TODO: BUGBUG - figure out how to determine what the prototype was. Just use GetNull() for now
Js::RecyclableObject* prototype = ctx->GetLibrary()->GetNull();
| [DoAddtlValueInstantiation_SnapGeneratorVirtualScriptFunctionInfo->[DoAddtlValueInstantiation_SnapScriptFunctionInfoEx],EmitAddtlInfo_SnapGeneratorVirtualScriptFunctionInfo->[EmitAddtlInfo_SnapScriptFunctionInfoEx],DoObjectInflation_SnapDynamicObject->[ReuseObjectCheckAndReset],ParseAddtlInfo_SnapGeneratorVirtualScriptFunctionInfo->[ParseAddtlInfo_SnapScriptFunctionInfoEx],DoObjectInflation_SnapExternalObject->[ReuseObjectCheckAndReset]] | Generates a JSGenerator using a SnapObject. | This matches the pattern from the recent change to lib/Runtime/Library/BoundFunction.cpp |
@@ -30,7 +30,7 @@ module Idv
end
def message
- t('headings.lock_failure')
+ nil
end
def next_steps
| [JurisdictionFailurePresenter->[message->[t],i18n_args->[state_name_for_abbrev],description->[t],title->[t],header->[t],attr_reader,delegate]] | missing message lock failure. | What is going on here? Why did we remove this translation? |
@@ -61,9 +61,13 @@ public class AddProjectAction implements QProfileWsAction {
@Override
public void handle(Request request, Response response) throws Exception {
AddProjectRequest addProjectRequest = toWsRequest(request);
- String profileKey = projectAssociationFinder.getProfileKey(addProjectRequest.getLanguage(), addProjectRequest.getProfileName(), addProjectRequest.getProfileKey());
- String projectUuid = projectAssociationFinder.getProjectUuid(addProjectRequest.getProjectKey(), addProjectRequest.getProjectUuid());
- profileProjectOperations.addProject(profileKey, projectUuid, userSession);
+
+ try (DbSession dbSession = dbClient.openSession(false)) {
+ String profileKey = projectAssociationFinder.getProfileKey(addProjectRequest.getLanguage(), addProjectRequest.getProfileName(), addProjectRequest.getProfileKey());
+ ComponentDto project = projectAssociationFinder.getProject(dbSession, addProjectRequest.getProjectKey(), addProjectRequest.getProjectUuid());
+ profileProjectOperations.addProject(dbSession, profileKey, project);
+ }
+
response.noContent();
}
| [AddProjectAction->[toWsRequest->[build],define->[setHandler,addParameters],handle->[noContent,getLanguage,getProjectUuid,toWsRequest,getProfileKey,addProject,getProjectKey,getProfileName]]] | Handles the add - project request. | You could even have gone further by loading only once the quality profile because currently : - It's loaded by projectAssociationFinder.getProfileKey - It's loaded again by profileProjectOperations.addProject But that could be part of another refactoring |
@@ -130,6 +130,18 @@ function _conferenceFailed({ dispatch, getState }, next, action) {
break;
}
+ case JitsiConferenceErrors.CONFERENCE_RESTARTED: {
+ const reason = 'Restart initiated because of a bridge failure';
+
+ if (enableForcedReload) {
+ dispatch(showErrorNotification({
+ description: reason,
+ titleKey: 'dialog.sessionRestarted'
+ }));
+ }
+
+ break;
+ }
case JitsiConferenceErrors.CONNECTION_ERROR: {
const [ msg ] = error.params;
| [No CFG could be retrieved] | The next action of the specified which is being dispatched. This function is called when the application is unloaded. It is called by the unload event. | Optional style: I'd put the text in the description bellow without defining a variable for it. |
@@ -1,12 +1,12 @@
-import core
+import contextlib
+
import proto.framework_pb2 as framework_pb2
+import core
from framework import OpProtoHolder, Variable, Program, Operator
from initializer import Constant, Normal, Xavier, Initializer
from paddle.v2.fluid.layer_helper import LayerHelper, unique_name
-import re
-import cStringIO
+from registry import layer_registry
from param_attr import ParamAttr
-import contextlib
__all__ = [
'fc', 'data', 'cross_entropy', 'conv2d', 'pool2d', 'embedding', 'concat',
| [_create_op_func_->[func->[infer_and_check_dtype,_convert_],infer_and_check_dtype->[_convert_],_generate_doc_string_],lstm->[step,concat,update_memory,StaticRNN,output,step_input,fc,memory],conv2d->[_get_default_param_initializer],zeros->[fill_constant],IfElseBlockGuard->[__exit__->[__exit__],__enter__->[__enter__],__init__->[block]],DynamicRNN->[_parent_block_->[block],block->[array_write,block,increment,less_than,array_to_lod_tensor,fill_constant],update_memory->[_assert_in_rnn_block_],__init__->[While,fill_constant],output->[_assert_in_rnn_block_,array_write],step_input->[_assert_in_rnn_block_,array_read],memory->[_assert_in_rnn_block_,memory,shrink_memory,array_read]],ConditionalBlock->[complete->[output,block],block->[ConditionalBlockGuard]],StaticRNN->[step->[StaticRNNGuard],output->[step_output],step_input->[_assert_in_rnn_block_],complete_rnn_op->[parent_block,output],step_output->[_assert_in_rnn_block_],memory->[_assert_in_rnn_block_,StaticRNNMemoryLink,memory]],ConditionalBlockGuard->[__exit__->[complete]],While->[complete->[output,block],block->[WhileGuard]],ones->[fill_constant],_generate_doc_string_->[_type_to_str_,_convert_],IfElse->[parent_block->[block],true_block->[IfElseBlockGuard],__init__->[ConditionalBlock],output->[parent_block,assign],__call__->[merge_lod_tensor],false_block->[IfElseBlockGuard],input->[parent_block]],_create_op_func_] | Function to create a full connected network layer. The activation function of the network is passed in as local variables. | The name should be `register_layer`, it's more meaningful. |
@@ -373,11 +373,12 @@ class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):
cb = infer_constraints(template.args[0], item, SUPERTYPE_OF)
res.extend(cb)
return res
+ elif isinstance(actual, TupleType) and self.direction == SUPERTYPE_OF:
+ return infer_constraints(template, actual.fallback, self.direction)
elif (isinstance(actual, TupleType) and template.type.is_protocol and
self.direction == SUPERTYPE_OF):
if mypy.subtypes.is_subtype(actual.fallback, erase_typevars(template)):
- res.extend(infer_constraints(template, actual.fallback, self.direction))
- return res
+ return infer_constraints(template, actual.fallback, self.direction)
return []
else:
return []
| [infer_constraints_if_possible->[infer_constraints],infer_constraints->[Constraint,infer_constraints],ConstraintBuilderVisitor->[visit_callable_type->[infer_constraints],visit_typeddict_type->[infer_constraints],infer_against_overloaded->[infer_constraints],visit_instance->[infer_constraints],visit_tuple_type->[infer_constraints],visit_type_type->[infer_constraints],visit_overloaded->[infer_constraints],infer_constraints_from_protocol_members->[infer_constraints],infer_against_any->[infer_constraints]]] | Visits an instance and returns the constraint of the type. Infer constraints from a protocol or subtype. Infer constraints for situations where either template or instance is a protocol. . | I don't see how this branch can ever be entered - when this condition is true, the condition of the branch above will be true, and this won't get entered. |
@@ -14,6 +14,17 @@ namespace Dynamo.Search
{
protected readonly Dictionary<V, Dictionary<string, double>> entryDictionary =
new Dictionary<V, Dictionary<string, double>>();
+
+ private bool experimentalSearch = false;
+
+ /// <summary>
+ /// Indicates whether experimental search mode is turned on.
+ /// </summary>
+ internal bool ExperimentalSearch
+ {
+ get { return experimentalSearch; }
+ set { experimentalSearch = value; }
+ }
/// <summary>
/// All the current entries in search.
| [SearchDictionary->[Add->[Add,OnEntryAdded],Search->[MatchWithQueryString,SplitOnWhiteSpace],ContainsSpecialCharacters->[Contains],Remove->[Remove,OnEntryRemoved],ComputeWeightAndAddToDictionary->[Add]]] | - A base class for all of the objects in the Dynamo search. This method add a single tag to the list of elements with a single tag. | When implementing my own debug mode VS suggested; internal bool ExperimentalSearch { get; set; } = false; |
@@ -26,4 +26,4 @@ class Jsoncpp(CMakePackage):
depends_on('python', type='test')
def cmake_args(self):
- return ['-DBUILD_SHARED_LIBS=ON']
+ return ['-DBUILD_SHARED_LIBS=ON', '-DJSONCPP_WITH_TESTS=OFF']
| [Jsoncpp->[variant,depends_on,version]] | Return the list of arguments to pass to the cmake command. | @mdorier can you condition this on whether `self.run_tests` is `True`? by default it will be off. Otherwise I think the result may be unexpected given the python test dependency. |
@@ -71,13 +71,6 @@ class SnliReader(DatasetReader):
@classmethod
def from_params(cls, params: Params) -> 'SnliReader':
- """
- Parameters
- ----------
- filename : ``str``
- tokenizer : ``Params``, optional
- token_indexers: ``List[Params]``, optional
- """
tokenizer = Tokenizer.from_params(params.pop('tokenizer', {}))
token_indexers = {}
token_indexer_params = params.pop('token_indexers', Params({}))
| [SnliReader->[from_params->[SnliReader,from_params]]] | Creates a SnliReader from a list of params. | You'll also need to add this to `predict_entailment` in the model, I think. |
@@ -86,7 +86,7 @@ public class JnlpAccessWithSecuredHudsonTest {
public void anonymousCanAlwaysLoadJARs() throws Exception {
r.jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test")));
JenkinsRule.WebClient wc = r.createWebClient();
- HtmlPage p = wc.login("alice").goTo("computer/test/");
+ HtmlPage p = wc.withBasicApiToken(User.getById("alice", true)).goTo("computer/test/");
// this fresh WebClient doesn't have a login cookie and represent JNLP launcher
JenkinsRule.WebClient jnlpAgent = r.createWebClient();
| [JnlpAccessWithSecuredHudsonTest->[Attack->[call->[call]],anonymousCannotGetSecrets->[createNewJnlpSlave],anonymousCanAlwaysLoadJARs->[createNewJnlpSlave],serviceUsingDirectSecret->[createNewJnlpSlave]]] | Checks if anonymous can always load jars. | Why does simply `withBasicApiToken("alice")` not work here? Does that user not exist until created here? |
@@ -1 +1,2 @@
from allennlp.semparse.contexts.table_question_knowledge_graph import TableQuestionKnowledgeGraph
+from allennlp.semparse.contexts import atis_tables
| [No CFG could be retrieved] | Table question knowledge graph. | This line doesn't actually do anything, because you're just importing a submodule into a place it was already accessible. Before this line, I could do `from allennlp.semparse.contexts import atis_tables` in code outside of `semparse`, and this line lets me do exactly the same thing. In contrast, the line above takes something that was only accessible in a submodule and makes it accessible here. So before, you had to do `from allennlp.semparse.contexts.table_question_knowledge_graph import TableQuestionKnowledgeGraph`, and after, you can do `from allennlp.semparse.contexts import TableQuestionKnowledgeGraph`. |
@@ -1641,10 +1641,13 @@ namespace Dynamo.Graph.Workspaces
notes.Add(noteModel);
}
+ var annotationGuidValue = IdToGuidConverter(annotationViewInfo.Id);
var annotationModel = new AnnotationModel(nodes, notes);
annotationModel.AnnotationText = annotationViewInfo.Title;
annotationModel.FontSize = annotationViewInfo.FontSize;
annotationModel.Background = annotationViewInfo.Background;
+ annotationModel.GUID = annotationGuidValue;
+
this.AddNewAnnotation(annotationModel);
}
| [WorkspaceModel->[Clear->[ClearNodes,Clear,Dispose,OnCurrentOffsetChanged],AddAnnotation->[AddNewAnnotation],AddNode->[OnNodeAdded],AddAndRegisterNode->[AddNode,OnRequestNodeCentered],UpdateWithExtraWorkspaceViewInfo->[AddNote,AddNewAnnotation,OnCurrentOffsetChanged],ClearAnnotations->[Clear,OnAnnotationsCleared],Save->[OnSaved],AnnotationModel->[AddNewAnnotation],Log->[Log],NoteModel->[AddNote],AddNote->[AddNote,OnRequestNodeCentered,OnNoteAdded],DisposeNode->[Dispose],RemoveAnnotation->[OnAnnotationRemoved],ClearNodes->[OnNodesCleared],PopulateXmlDocument->[SerializeElementResolver,OnSaving],ClearNotes->[Clear,OnNotesCleared],GetStringRepOfWorkspace->[PopulateXmlDocument],RecordModelsForModification->[RecordModelsForModification],RemoveNote->[OnNoteRemoved],RemoveAndDisposeNode->[OnNodeRemoved],AddNewAnnotation->[OnAnnotationAdded],Dispose->[OnConnectorDeleted],RegisterConnector]] | Updates this view with the given extra workspace view info. This function creates a collection of nodes and notes that are not in the given view. | assign the guid to the annotation GUID on deserialize. |
@@ -154,6 +154,12 @@ public abstract class Wrapper {
// get all public method.
boolean hasMethod = hasMethods(methods);
if (hasMethod) {
+ Map<String, Integer> sameNameMethodCount = new HashMap<>();
+ for (Method m : methods) {
+ sameNameMethodCount.compute(m.getName(),
+ (key, oldValue) -> oldValue == null ? 1 : oldValue + 1);
+ }
+
c3.append(" try{");
for (Method m : methods) {
//ignore Object's method.
| [Wrapper->[hasMethod->[getMethodNames],setPropertyValues->[setPropertyValue],getPropertyValues->[getPropertyValue],args->[arg],Wrapper]] | Creates a wrapper for the given class. Finds and adds a new method which does not have a signature. Creates a new instance of the class with the same name as c and adds it to dm Creates a new class with a few fields that can be used to create a new object with Returns a new object that wraps the named constructor with a new object filled with the necessary fields. | it would be better if we give it a big enough initial size, such as `(int) (methods.size() / 0.75f) + 1` |
@@ -91,6 +91,11 @@ class EagerFilesetWithSpec(FilesetWithSpec):
def files_hash(self):
return self._files_hash
+ def iter_relative_paths(self):
+ """An alternative `__iter__` that joins files with the relative root."""
+ for f in self:
+ yield os.path.join(self.rel_root, f)
+
def __repr__(self):
return 'EagerFilesetWithSpec(rel_root={!r}, files={!r})'.format(self.rel_root, self.files)
| [FilesetRelPathWrapper->[create_fileset_with_spec->[LazyFilesetWithSpec],process_raw_exclude->[ensure_string_wrapped_in_list],_file_calculator->[files_calculator->[wrapped_fn]]],FilesetWithSpec->[_validate_globs_in_filespec->[_validate_globs_in_filespec]]] | A hash for the files in the fileset. | Better to call this `paths_from_buildroot_iter()` (and below). `relative` is a vague term. |
@@ -130,9 +130,9 @@ ENCODE_DIGESTINFO_SHA(sha3_512, 0x0a, SHA512_DIGEST_LENGTH)
*len = sizeof(digestinfo_##name##_der); \
return digestinfo_##name##_der;
-static const unsigned char *digestinfo_encoding(int nid, size_t *len)
+const unsigned char *rsa_digestinfo_encoding(int md_nid, size_t *len)
{
- switch (nid) {
+ switch (md_nid) {
#ifndef FIPS_MODE
# ifndef OPENSSL_NO_MDC2
MD_CASE(mdc2)
| [No CFG could be retrieved] | Return the digestinfo values of the ASN. 1 message header. Returns a pointer to an unsigned char array representing the contents of a DigestInfo - like object. | SHA1 is non FIPS_MODE here but in FIPS_MODE in rsa_aid.c. Why? |
@@ -73,7 +73,7 @@ int uname(struct utsname *buf)
return -1;
}
- strncpy(buf->nodename, uname_nodename, _UTSNAME_LENGTH);
+ strncpy(buf->nodename, uname_nodename, _UTSNAME_LENGTH - 1);
return 0;
}
| [int->[asprintf,assert_int_not_equal,assert_non_null],uname->[strncpy],main->[JOB_UTEST,d_register_alt_assert,cmocka_run_group_tests],getenv->[strncmp],void->[dc_job_fini,dc_job_init,assert_return_code,craft_jobid,assert_string_equal,assert_int_equal]] | uname - Uname the given UTSname object. | This assumes that nodename has a null byte at _UTSNAME_LENGTH - 1. It should be followed with buf->nodename[_UTSNAME_LENGTH - 1] = '\0'; to be safe. |
@@ -71,7 +71,7 @@ public class NotebookRestApi {
Gson gson = new Gson();
private Notebook notebook;
private NotebookServer notebookServer;
- private SearchService notebookIndex;
+ private SearchService noteIndex;
private NotebookAuthorization notebookAuthorization;
public NotebookRestApi() {
| [NotebookRestApi->[insertParagraph->[insertParagraph],runParagraph->[getParagraph],getNoteParagraphJobStatus->[getParagraph],runParagraphSynchronously->[getParagraph],deleteParagraph->[getParagraph],getParagraph->[getParagraph],cloneNote->[cloneNote],stopParagraph->[getParagraph],createNote->[createNote],moveParagraph->[getParagraph,moveParagraph]]] | rest api for Notebook Get the permissions for a given note. | Term `noteIndex` is little bit confusing for me. Since you are working on naming, how about changing it into `noteSearchService`? |
@@ -8210,6 +8210,7 @@ main(int argc, char **argv)
case 'm':
case 'M':
case 'O':
+ case 'r':
case 'R':
case 's':
case 'S':
| [No CFG could be retrieved] | Reads the arguments and parses the object set. The main entry point for the system. | Oh could we have 'r' added to usage as well? I spent forever wondering why `zdb -h` wasn't showing the new option :) |
@@ -130,6 +130,10 @@
</div>
<% end %>
+<% if current_user.created_at < Time.new(2016, 8, 25) %>
+ <%= render partial: 'projects/index/introductory_popup' %>
+ <%= javascript_include_tag "projects/introdutory_popup"%>
+<% end %>
<% if @projects_by_orgs.length > 0 %>
<% @projects_by_orgs.each do |org, projects| %>
<%= render partial: "projects/index/org_projects", locals: {org: org, projects: projects} %>
| [No CFG could be retrieved] | Renders the for the authenticated user. | I would change this date to the actual date this will hit production. |
@@ -58,6 +58,12 @@ def docs(request):
def _get_popular_item():
"""Get a single, random item off the popular pages list."""
+ if not settings.DEKIWIKI_ENDPOINT:
+ # No MindTouch API calls are performed here. But, pending bug 759361,
+ # a False value also implies that the data behind popular.json is no
+ # longer available.
+ return None
+
try:
pages = json.load(open(os.path.join(
settings.MDC_PAGES_DIR, 'popular.json')))
| [docs->[_,render,append,dict,filter_for_review,cached,len,filter,title,lower],_get_popular_item->[error,choice,date_parse,join,open,load],getLogger] | Get a single random item off the popular pages list. | and this one? |
@@ -143,11 +143,11 @@ public class TopologyAwareNodeSelector
}
InternalNode chosenNode = null;
- int depth = networkLocationSegmentNames.size();
+ int depth = topologicalSplitCounters.size() - 1;
int chosenDepth = 0;
Set<NetworkLocation> locations = new HashSet<>();
for (HostAddress host : split.getAddresses()) {
- locations.add(networkLocationCache.get(host));
+ locations.add(networkTopology.locate(host));
}
if (locations.isEmpty()) {
// Add the root location
| [TopologyAwareNodeSelector->[selectCurrentNode->[getCurrentNode],lockDownNodes->[ofInstance,set,get],selectRandomNodes->[get,randomizedNodes,selectNodes],computeAssignments->[PrestoException,create,size,selectDistributionNodes,getAddresses,addAll,SplitPlacementResult,isRemotelyAccessible,put,calculateLowWatermark,NodeAssignmentStats,addAssignedSplit,isEmpty,calculateMaxPendingSplits,debug,update,iterator,keys,selectExactNodes,get,bestNodeSplitCount,subLocation,contains,add,toWhenHasSplitQueueSpaceFuture],allNodes->[copyOf,values],bestNodeSplitCount->[hasNext,getQueuedSplitCountForStage,next,getTotalSplitCount],calculateMaxPendingSplits->[ceil],get,requireNonNull]] | Compute the assignments for the given splits. This method is called when a location is located at a random location. | This kind of `xxx - 1` calculation looks rare. Maybe we could get the same information from NetworkLocation? I'm also thinking is SegmentNames really needed. |
@@ -154,6 +154,9 @@ type Config struct {
// for testing
ingesterClientFactory ring_client.PoolFactory `yaml:"-"`
+
+ // when true the distributor does not validate labels at ingest time
+ SkipLabelValidation bool `yaml:"-"`
}
// RegisterFlags adds the flags required to config this to the given FlagSet
| [AllUserStats->[AllUserStats],MetricsForLabelMatchers->[forAllIngesters,MetricsForLabelMatchers],Push->[tokenForLabels,validateSeries,tokenForMetadata,checkSample],UserStats->[forAllIngesters,UserStats],Validate->[Validate],MetricsMetadata->[forAllIngesters,MetricsMetadata],LabelNames->[forAllIngesters,LabelNames],RegisterFlags->[RegisterFlags],LabelValuesForLabelName->[forAllIngesters],send->[Push]] | RegisterFlags registers flags for the config. | Would you mind adding something like "Cortex doesn't directly use it (and should never use it) but this feature is used by other projects built on top of it.". |
@@ -62,7 +62,7 @@ bool bitmapNonEmpty(const OpenDDS::RTPS::SequenceNumberSet& snSet)
}
for (int bit = 31; bit >= 0; --bit) {
if ((snSet.bitmap[i] & (1 << bit))
- && snSet.numBits >= i * 32 + (31 - bit)) {
+ && snSet.numBits > i * 32 + (31 - bit)) {
return true;
}
}
| [No CFG could be retrieved] | The number of longs required for the type - specific sequence representation of a sequence number. END OF FUNCTIONS. | This should probably just create a mask and do a single comparison rather than loop over individual bits. |
@@ -84,11 +84,14 @@ def find(f: Callable[[T], bool], seq: Sequence[T]) -> T:
return None
-class ASTConverter(typed_ast.NodeTransformer):
- def __init__(self):
- self.in_class = False
+class ASTConverter(ast35.NodeTransformer):
+ def __init__(self, pyversion, custom_typing_module = None):
+ self.class_nesting = 0
self.imports = []
+ self.pyversion = pyversion
+ self.custom_typing_module = custom_typing_module
+
def generic_visit(self, node):
raise RuntimeError('AST node not implemented: ' + str(type(node)))
| [TypeConverter->[visit_Str->[parse_type_comment]],parse->[parse],ASTConverter->[visit_With->[as_block],visit_Assign->[parse_type_comment],stringify_name->[stringify_name],visit_Call->[is_star2arg,is_stararg],visit_While->[as_block],transform_args->[make_argument],visit_If->[as_block],visit_Try->[as_block],visit_Module->[fix_function_overloads],visit_FunctionDef->[parse,as_block],visit_Lambda->[as_block,transform_args],visit_For->[as_block],visit_BinOp->[from_operator],visit_Compare->[from_comp_operator],visit_ClassDef->[stringify_name,find,fix_function_overloads],visit_AugAssign->[from_operator],visit_BoolOp->[group->[group],group]],parse_type_comment->[parse]] | Initialize class. | Why no type annotations here? |
@@ -131,7 +131,14 @@ namespace System.Text.Json.Serialization
// For performance, only perform validation on internal converters on debug builds.
if (IsInternalConverter)
{
- value = Read(ref reader, typeToConvert, options);
+ if (IsInternalConverterForNumberType && state.Current.NumberHandling != null)
+ {
+ value = ReadNumberWithCustomHandling(ref reader, state.Current.NumberHandling.Value);
+ }
+ else
+ {
+ value = Read(ref reader, typeToConvert, options);
+ }
}
else
#endif
| [JsonConverter->[TryWriteDataExtensionProperty->[TryWrite],TryReadAsObject->[TryRead],WriteWithQuotesAsObject->[WriteWithQuotes],TryRead->[OnTryRead],TryWrite->[TryWriteAsObject,OnTryWrite]]] | TryRead reads a value from the JSON stream. Reads a single object from the JSON stream. | What type is `NumberHandling`? Isn't it an enum value, how can it be null? |
@@ -348,7 +348,8 @@ func (data *resourceRowData) ColorizedColumns() []string {
func (data *resourceRowData) getInfoColumn() string {
step := data.step
- if step.Op == deploy.OpCreateReplacement || step.Op == deploy.OpDeleteReplaced {
+ switch step.Op {
+ case deploy.OpCreateReplacement, deploy.OpDeleteReplaced:
// if we're doing a replacement, see if we can find a replace step that contains useful
// information to display.
for _, outputStep := range data.outputSteps {
| [ColorizedColumns->[IsDone],ColorizedSuffix->[IsDone],RecordPolicyViolationEvent->[recordDiagEventPayload]] | getInfoColumn returns the column name of the diagnostic message that is displayed in the table. Prints out the worst diagnostic next to the tree - view status message. | I assume that there's some hidden invariant here that `data.outputSteps[0]` is correct. Should we be asserting something about `step.Op` at this point? Would it make more sense to write the above as a range like we have for Create/Replace? |
@@ -138,7 +138,8 @@ module Engine
end
when :place_token
- ability(entity).hexes.include?(hex.id)
+ ability(entity).hexes.include?(hex.id) &&
+ hex.tile.cities.any? { |c| c.tokenable?(entity.owner, free: true) }
when :lay_tile
@game.hex_by_id(hex.id).neighbors.keys if hex == @destination
end
| [SpecialNWR->[process_remove_token->[tokens,corporation,new,owner,entity,remove!,corporation_by_id,slot,raise,log,first,place,name,city],available_tokens->[next_token],actions->[ability],available_hex->[find,tile_nwr?,keys,corporation_by_id,tokened_by?,include?,used,none?,hex,tile,first,id],ability->[company?,abilities],process_lay_tile->[owner,gain_nwr_bonus,entity,use!,tile,each,lay_tile],process_place_token->[owner,entity,place_token,clear_graph_for,hex,teleport_price,city],upgradeable_tiles->[owner],can_replace_token?->[corporation,owner],freeze,include],require_relative] | Returns true if the given hex is available in the given entity. | so one thing to note is that avialble_hex should return an array of edges, what you have now is a boolean which is hacky and sort of works, but is not consistent with how this method is used elsewhere |
@@ -248,7 +248,7 @@
</dependency>
<%_ } _%>
<%_ } _%>
-<%_ if (applicationType === 'gateway' && authenticationType === 'uaa') { _%>
+<%_ if (applicationType === 'gateway') { _%>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
| [No CFG could be retrieved] | Returns a list of all possible non - null dependencies. Returns a list of all possible NICs for the cache provider. | Remove the entire condition. |
@@ -109,7 +109,7 @@ class Storage
end
def promotable_blobs
- mirrorable_blobs
+ mirrorable_blobs.where(created_at: (..7.days.ago))
end
def secondary_blobs
| [Storage->[mirror->[mirror],mirror_service->[mirror_service?]]] | promotable_blobs - returns all blobs that are not mirrorable by a. | TIL! Assume this is shorthand for `Time.zone.now..7.days.ago`? |
@@ -423,6 +423,7 @@ ActiveRecord::Schema.define(version: 2020_04_08_213043) do
t.boolean "allow_prompt_login", default: false
t.boolean "signed_response_message_requested", default: false
t.integer "ial2_quota"
+ t.boolean "liveness_checking_enabled"
t.index ["issuer"], name: "index_service_providers_on_issuer", unique: true
end
| [jsonb,bigint,string,text,add_foreign_key,datetime,integer,json,enable_extension,create_table,boolean,index,define] | Table for all the attributes of a service provider Index SP return logs on request_id and user_id. | One thought, just an idea, not a requirement, what if we called this `liveness_checking_required` ? or `requires_liveness_checking` so it's slightly different than the global feature flag we have? I feel like having separate names would make it easier to debug |
@@ -96,9 +96,7 @@ class Jetpack_Modules_List_Table extends WP_List_Table {
<# var i = 0;
if ( data.items.length ) {
_.each( data.items, function( item, key, list ) {
- if ( item === undefined ) return;
- if ( 'minileven' == item.module && ! item.activated ) return;
- if ( 'manage' == item.module && item.activated ) return; #>
+ if ( item === undefined ) return; #>
<tr class="jetpack-module <# if ( ++i % 2 ) { #> alternate<# } #><# if ( item.activated ) { #> active<# } #><# if ( ! item.available ) { #> unavailable<# } #>" id="{{{ item.module }}}">
<th scope="row" class="check-column">
<# if ( 'videopress' !== item.module ) { #>
| [Jetpack_Modules_List_Table->[views->[get_views]]] | The Jetpack Modules List Table Template No modules can be activated. | I took the opportunity to delete this reference to the Manage module. |
@@ -34,11 +34,7 @@ namespace Dnn.Modules.ResourceManager.Components
search = (search ?? string.Empty).Trim();
- // Lucene does not support wildcards as the beginning of the search
- // For file names we can remove any existing wildcard at the beginning
- var cleanedKeywords = TrimStartWildCards(search);
-
- var files = FolderManager.Instance.SearchFiles(folder, cleanedKeywords, recursive);
+ var files = FolderManager.Instance.SearchFiles(folder, search, recursive);
var sortProperties = SortProperties.Parse(sorting);
var sortedFiles = SortFiles(files, sortProperties).ToList();
totalCount = sortedFiles.Count;
| [SearchController->[SearchFolderContent->[UserHasNoPermissionToBrowseFolderDefaultMessage,TrimStartWildCards,GetExceptionMessage,ToList,Count,FolderID,SearchFiles,Parse,HasFolderContentPermission,Trim],SortFiles->[Size,Column,LastModifiedOnDate,OrderBy,FileName,Ascending,CreatedOnDate,FolderId],TrimStartWildCards->[Split,Join,TrimStart],OrderBy->[OrderBy,OrderByDescending],Instance]] | SearchFolderContent Searches a folder for content. | Did something change with Lucene's support for wildcards? What's the behavior if you search with a wildcard at the beginning of your search? |
@@ -923,7 +923,7 @@ func (c *Container) cleanup() error {
// Clean up network namespace, if present
if err := c.cleanupNetwork(); err != nil {
- lastError = nil
+ lastError = err
}
if err := c.cleanupCgroups(); err != nil {
| [cleanupNetwork->[save],prepare->[mountStorage],pause->[save],cleanup->[cleanupNetwork,cleanupStorage,cleanupCgroups],initAndStart->[save,init,removeConmonFiles],saveSpec->[bundlePath],cleanupStorage->[save],removeConmonFiles->[bundlePath],start->[save],reinit->[save,init,removeConmonFiles],generateResolvConf->[writeStringToRundir],checkDependenciesRunningLocked->[syncContainer],unpause->[save],init->[completeNetworkSetup,save],mountStorage->[save],generateHosts->[writeStringToRundir],isStopped->[syncContainer],ControlSocketPath->[bundlePath],cleanupCgroups->[save],postDeleteHooks->[bundlePath],completeNetworkSetup->[syncContainer]] | cleanup cleans up all the resources associated with a container. | This had been non-fatal since #302, but I don't see any discussion there about why it was non-fatal then. |
@@ -18,6 +18,7 @@ use Automattic\Jetpack\Terms_Of_Service;
use Automattic\Jetpack\Tracking;
use Automattic\Jetpack\Plugin\Tracking as Plugin_Tracking;
use Automattic\Jetpack\Redirect;
+use Automattic\Jetpack\Jetpack_User_Agent_Info;
/*
Options:
| [Jetpack->[reset_saved_auth_state->[reset_saved_auth_state],add_remote_request_handlers->[require_jetpack_authentication],admin_page_load->[disconnect],development_mode_trigger_text->[is_development_mode],is_active_and_not_development_mode->[is_development_mode],check_identity_crisis->[is_development_mode],register->[register],is_active->[is_active],translate_role_to_cap->[translate_role_to_cap],activate_new_modules->[is_development_mode],activate_module->[is_development_mode],get_locale->[guess_locale_from_lang],authenticate_jetpack->[authenticate_jetpack],api_url->[api_url],is_development_mode->[is_development_mode],require_jetpack_authentication->[require_jetpack_authentication],admin_init->[is_development_mode],load_modules->[is_development_mode],get_secrets->[get_secrets],clean_nonces->[clean_nonces],sign_role->[sign_role],delete_secrets->[delete_secrets],generate_secrets->[generate_secrets],plugin_action_links->[is_development_mode],remove_non_jetpack_xmlrpc_methods->[remove_non_jetpack_xmlrpc_methods],xmlrpc_options->[xmlrpc_options],wp_rest_authenticate->[verify_xml_rpc_signature],implode_frontend_css->[is_development_mode],translate_current_user_to_role->[translate_current_user_to_role],build_connect_url->[build_connect_url],initialize_rest_api_registration_connector->[initialize_rest_api_registration_connector],verify_xml_rpc_signature->[verify_xml_rpc_signature],authorize_starting->[do_stats,stat],translate_user_to_role->[translate_user_to_role],alternate_xmlrpc->[alternate_xmlrpc],get_assumed_site_creation_date->[get_assumed_site_creation_date],dashboard_widget_footer->[is_development_mode],xmlrpc_api_url->[xmlrpc_api_url],public_xmlrpc_methods->[public_xmlrpc_methods],verify_json_api_authorization_request->[add_nonce],is_staging_site->[is_staging_site],show_development_mode_notice->[is_development_mode],jetpack_getOptions->[jetpack_getOptions],is_user_connected->[is_user_connected],add_nonce->[add_nonce],wp_dashboard_setup->[is_development_mode],xmlrpc_methods->[xmlrpc_methods],setup_xmlrpc_handlers->[setup_xmlrpc_handlers]]] | The main entry point for all plugin classes. The Jetpack class. | I think the `Jetpack_User_Agent_Info` should become part of the `jetpack-devices` package, and could more be renamed `Automattic\Jetpack\Device\User_Agent_Info` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.