patch stringlengths 18 160k | callgraph stringlengths 4 179k | summary stringlengths 4 947 | msg stringlengths 6 3.42k |
|---|---|---|---|
@@ -783,12 +783,12 @@ dmg_storage_query_device_health(const char *dmg_config_file, char *host,
json_object_to_json_string(val));
if (!json_object_object_get_ex(val, "storage", &storage_info)) {
D_ERROR("unable to extract hosts from JSON\n");
- return -DER_INVAL;
+ D_GOTO(out, rc = -DER_INVAL);
}
if (!json_object_object_get_ex(storage_info, "smd_info",
&smd_info)) {
D_ERROR("unable to extract hosts from JSON\n");
- return -DER_INVAL;
+ D_GOTO(out, rc = -DER_INVAL);
}
json_object_object_foreach(smd_info, key1, val1) {
D_DEBUG(DB_TEST, "key1:\"%s\",val1=%s\n", key1,
| [No CFG could be retrieved] | get device health info handles the case of missing key - value pairs. | Shouldn't goto out_json in order to execute cmd_free_args(args, argcount);? Also, the json_object_object_get_ex() call before the loop (_foreach) needs D_GOTO as well I think. So total 3 places. |
@@ -27,6 +27,12 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping
LeaveGridAtmos();
}
+ public void Update()
+ {
+ var message = new PipeNetUpdateMessage();
+ SendMessage(message);
+ }
+
private void JoinGridAtmos()
{
var gridAtmos = EntitySystem.Get<AtmosphereSystem>()
| [PipeNetDeviceComponent->[OnRemove->[OnRemove],Initialize->[Initialize]]] | OnRemove method for the base class. | Creating the same empty message per pipe net device every update tick is expensive. Try caching the empty message and sending it over and over as needed, or use interfaces to update the rest of components instead. |
@@ -12,6 +12,7 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/external"
+ cf "github.com/aws/aws-sdk-go-v2/service/cloudformation"
"github.com/awslabs/goformation/cloudformation"
merrors "github.com/pkg/errors"
| [Deploy->[deployTemplate],Remove->[stackName],Update->[deployTemplate],deployTemplate->[findFunction,stackName,template]] | findFunction finds a function in the list of functions that need to be executed. FindFunctionByName returns a function object that can be used to create a template. | what is the difference between the 2 cloudformation packages? |
@@ -142,6 +142,7 @@ ActiveRecord::Schema.define(version: 2021_08_30_062627) do
t.text "slug"
t.string "social_image"
t.integer "spaminess_rating", default: 0
+ t.string "text_lang"
t.string "title"
t.datetime "updated_at", null: false
t.bigint "user_id"
| [jsonb,bigint,declare,string,text,citext,add_foreign_key,datetime,integer,check_constraint,enable_extension,create_table,float,boolean,index,define,tsvector,inet] | XML Reactions Table This function returns a list of cached tags that are published on the server. | Sorry that these two lines in this file are unrelated changes which I failed to exclude. |
@@ -337,6 +337,13 @@ class _ObjModeContextType(WithContext):
raise errors.TypingError(msg.format(extra_annotated))
# Verify that all outputs are annotated
+
+ # Note on "$cp" variable:
+ # ``transforms.consolidate_multi_exit_withs()`` introduces the variable
+ # for the control-point to determine the correct exit block. This
+ # variable crosses the with-region boundary. Thus, it will be consider
+ # an output variable leaving the lifted with-region.
+ typeanns["$cp"] = types.int32
not_annotated = set(stripped_outs) - set(typeanns)
if not_annotated:
msg = (
| [_ObjModeContextType->[mutate_with_body->[_legalize_args,_clear_blocks],_legalize_args->[report_error]],_ByPassContextType->[mutate_with_body->[_get_var_parent,_clear_blocks]],_CallContextType->[mutate_with_body->[_clear_blocks]],_ObjModeContextType,_ByPassContextType,_CallContextType] | Mutate with a body of a function. Get dispatcher for missing missing type annotation. | Will it always be the unversioned name at this point? |
@@ -67,8 +67,9 @@ public class HpackTest {
return data;
}
- @Test
- public void test() throws Exception {
+ @ParameterizedTest(name = "file = {0}")
+ @MethodSource("data")
+ public void test(String fileName) throws Exception {
InputStream is = HpackTest.class.getResourceAsStream(TEST_DIR + fileName);
HpackTestCase hpackTestCase = HpackTestCase.load(is);
hpackTestCase.testCompress();
| [HpackTest->[test->[testCompress,testDecompress,getResourceAsStream,load],data->[checkNotNull,add,listFiles,getName],replaceAll]] | This method returns a collection of objects which are read from the Hpack file. | I think it's no longer necessary for `data` to return the arguments as a collection of _arrays_. It should be possible to just be a collection/stream/list/array of strings. For instance, the `File[]` array could be returned directly if the test took `File` as its argument. |
@@ -272,6 +272,17 @@ void OPENSSL_showfatal(const char *fmta, ...)
va_end(ap);
# if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
+#ifdef OPENSSL_SYS_WIN_CORE
+ /* ONECORE is always NONGUI and NT >= 0x0601*/
+ HRESULT tEventLog = TraceLoggingRegister(g_hProvider);
+ if (SUCCEEDED(tEventLog)) {
+ const TCHAR *pmsg = buf;
+ TraceLoggingWrite(g_hProvider, "ErrorLog",
+ TraceLoggingLevel(EVENTLOG_ERROR_TYPE),
+ TraceLoggingWideString(pmsg, "Message"));
+ }
+ TraceLoggingUnregister(g_hProvider);
+#else
/* this -------------v--- guards NT-specific calls */
if (check_winnt() && OPENSSL_isservice() > 0) {
HANDLE hEventLog = RegisterEventSource(NULL, _T("OpenSSL"));
| [No CFG could be retrieved] | no stack - support Reads the next non - fatal error from the OpenSSL log and reports it to the user. | Why this assignment? |
@@ -134,4 +134,13 @@ if ( ! function_exists( 'jetpack_shortcode_get_wpvideo_id' ) ) {
}
}
+if ( ! function_exists( 'jetpack_shortcode_get_videopress_id' ) ) {
+ function jetpack_shortcode_get_videopress_id( $atts ) {
+ if ( isset( $atts[ 0 ] ) )
+ return $atts[ 0 ];
+ else
+ return 0;
+ }
+}
+
jetpack_load_shortcodes();
| [No CFG could be retrieved] | Reads the list of Shortcodes from the jetpack. | Can we please use brackets here? |
@@ -630,11 +630,14 @@ class Jetpack_Subscriptions {
// Check if Mark Jaquith's Subscribe to Comments plugin is active - if so, suppress Jetpack checkbox
- $str = '';
+ $unique_id = esc_attr( uniqid( 'jetpack-subscription-form-' ) );
+
+ // Add heading and wrap in list for assistive technology
+ $str = '<div><h4 id="'. esc_attr( $unique_id ).'" class="comment-subscription-form-title">Comment subscription preferences</h4><ul class="comment-subscription-form-list" aria-labelledby="'. esc_attr( $unique_id ).'">';
if ( FALSE === has_filter( 'comment_form', 'show_subscription_checkbox' ) && 1 == get_option( 'stc_enabled', 1 ) && empty( $post->post_password ) && 'post' == get_post_type() ) {
// Subscribe to comments checkbox
- $str .= '<p class="comment-subscription-form"><input type="checkbox" name="subscribe_comments" id="subscribe_comments" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;"' . $comments_checked . ' /> ';
+ $str .= '<li class="comment-subscription-form"><input type="checkbox" name="subscribe_comments" id="subscribe_comments" value="subscribe" style="width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;"' . $comments_checked . ' /> ';
$comment_sub_text = __( 'Notify me of follow-up comments by email.', 'jetpack' );
$str .= '<label class="subscribe-label" id="subscribe-label" for="subscribe_comments">' . esc_html(
/**
| [Jetpack_Subscriptions->[set_post_flags->[should_email_post_to_subscribers],get_settings->[get_default_settings]],Jetpack_Subscriptions_Widget->[form->[defaults,fetch_subscriber_count]]] | Subscribe to comments This function is used to output the HTML for the subscribe comment form. | There's no need to call `esc_attr`, you're doing it properly already by escaping late - when using the value for output. |
@@ -98,7 +98,7 @@ class TypeAnnotation(object):
atype = 'XXX Lifted Loop XXX'
found_lifted_loop = True
else:
- atype = self.typemap[inst.target.name]
+ atype = self.typemap.get(inst.target.name, "<missing>")
aline = "%s = %s :: %s" % (inst.target, inst.value, atype)
elif isinstance(inst, ir.SetItem):
| [TypeAnnotation->[annotate->[prepare_annotations,SourceLines],annotate_raw->[prepare_annotations,SourceLines,add_ir_line],__str__->[annotate]]] | Prepare annotations for missing node - level annotations. | (Self note) check why. |
@@ -21,6 +21,11 @@ import (
func (repo *Repository) GetRefCommitID(name string) (string, error) {
ref, err := repo.gogitRepo.Reference(plumbing.ReferenceName(name), true)
if err != nil {
+ if err == plumbing.ErrReferenceNotFound {
+ return "", ErrNotExist{
+ ID: name,
+ }
+ }
return "", err
}
| [GetBranchCommit->[GetCommit,GetBranchCommitID],CommitsBetweenIDs->[CommitsBetween,GetCommit],GetBranchCommitID->[GetRefCommitID],getCommitByPathWithID->[getCommit],GetTagCommit->[GetTagCommitID,GetCommit],getCommitsBefore->[commitsBefore],getCommitsBeforeLimit->[commitsBefore],GetCommit->[getCommit,ConvertToSHA1]] | GetRefCommitID returns the commit ID of a reference. | Are there any places to check if the error is `plumbing.ErrReferenceNotFound`? |
@@ -436,7 +436,7 @@ nvme_test_get_blobstore_state(void **state)
* Manually set first device returned to faulty via
* 'dmg storage set nvme-faulty'.
*/
- print_message("NVMe with UUID=%s on host=%s\" set to Faulty\n",
+ print_message("NVMe with UUID=" DF_UUIDF " on host=%s\" set to Faulty\n",
DP_UUID(devices[0].device_id),
devices[0].host);
rc = dmg_storage_set_nvme_fault(dmg_config_file, devices[0].host,
| [bool->[test_pool_get_info,assert_int_equal],run_daos_nvme_recov_test->[MPI_Barrier,run_daos_sub_tests,ARRAY_SIZE],void->[verify_server_log_mask,daos_mgmt_get_bs_state,strdup,srand,MPI_Barrier,atoi,daos_pool_query_target,reset_fail_loc,assert_non_null,verify_state_in_log,dts_oid_gen,rand,dts_buf_render,DP_OID,strlen,ioreq_fini,DP_UUID,skip,dts_key_gen,test_rebuild_wait,insert_single,assert_int_equal,set_fail_loc,dmg_storage_set_nvme_fault,wait_and_verify_blobstore_state,time,D_FREE,D_ALLOC,insert_single_with_rxnr,print_message,sleep,dmg_storage_device_list,get_log_file,D_ALLOC_ARRAY,daos_fail_loc_reset,strcmp,strcpy,dts_oid_set_rank,daos_debug_set_params,ioreq_init,lookup_single_with_rxnr,get_server_config,memset,verify_blobstore_state,assert_true,is_nvme_enabled,daos_target_state_enum_to_str,wait_and_verify_pool_tgt_state,assert_string_equal,dts_oid_set_tgt,dmg_storage_query_device_health],int->[test_setup]] | Get the blobstore state DTS - related functions Wait until blobstore is in OUT state. | (style) line over 80 characters |
@@ -172,9 +172,9 @@ class User < ApplicationRecord
}
after_create_commit :send_welcome_notification
- after_save :bust_cache
- after_save :subscribe_to_mailchimp_newsletter
- after_save :conditionally_resave_articles
+ after_save :bust_cache
+ after_save :subscribe_to_mailchimp_newsletter
+ after_save :conditionally_resave_articles
after_create_commit :estimate_default_language
before_create :set_default_language
before_validation :set_username
| [User->[check_for_username_change->[path],send_welcome_notification->[send_welcome_notification],blocked_by?->[blocking?],blocking?->[blocking?],conditionally_resave_articles->[banned],resave_articles->[path]]] | A function to validate a user s configuration. A list of all the attributes that can be set on a model. | This was just fixed by my editor. |
@@ -254,7 +254,7 @@ public class ServerFactoryTest extends BaseTestCaseWithUser {
Collection servers = new ArrayList();
servers.add(server);
- ServerGroupManager manager = ServerGroupManager.getInstance();
+ ServerGroupManager manager = GlobalInstanceHolder.SERVER_GROUP_MANAGER;
user.addPermanentRole(RoleFactory.SYSTEM_GROUP_ADMIN);
ManagedServerGroup sg1 = manager.create(user, "FooFooFOO", "Foo Description");
manager.addServers(sg1, servers, user);
| [ServerFactoryTest->[testDeleteSnapshot->[createTestServer,generateSnapshot],createServer->[createServer],testGetServerHistory->[createTestServer],createTestProxyServer->[createTestServer],testLookupProxyServer->[createTestServer],testListErrataNamesForServer->[createTestServer],testLookupSnapshotById->[createTestServer,generateSnapshot],testSet->[createTestServer],testLookupProxyServerWithSimpleName->[createTestServer],testListSnapshotsForServer->[createTestServer,generateSnapshot],testGetSnapshotTags->[createTestServer,generateSnapshot],testCompatibleWithServer->[createTestServer],testUnsubscribeFromAllChannels->[createTestServer],testListAdministrators->[createTestServer],testlistNewestPkgsForServerErrata->[createTestServer],createTestServer->[createTestServer],testFindServersInSetByChannel->[createTestServer],setUp->[setUp],testListErrataNamesForServerSLE11->[createTestServer]]] | Tests if the server groups have been changed. | I was wondering here: even if you keep an instance of `ServerGroupManager` above (`private serverGroupManager`), why are you using `GlobalInstanceHolder.SERVER_GROUP_MANAGER` and assign it to another variable? Couldn't you just use the above instance? |
@@ -38,8 +38,8 @@ public class MetadataStorageConnectorConfig
@JsonProperty
private String user = null;
- @JsonProperty
- private String password = null;
+ @JsonProperty("password")
+ private PasswordProvider passwordProvider;
public boolean isCreateTables()
{
| [MetadataStorageConnectorConfig->[toString->[getConnectURI]]] | Checks if the node is a create tables node. | Do the docs need updated at all? |
@@ -218,9 +218,11 @@ public class XceiverClientGrpc extends XceiverClientSpi {
channel.shutdownNow();
try {
channel.awaitTermination(60, TimeUnit.MINUTES);
- } catch (Exception e) {
+ } catch (InterruptedException e) {
LOG.error("Unexpected exception while waiting for channel termination",
e);
+ // Re-interrupt the thread while catching InterruptedException
+ Thread.currentThread().interrupt();
}
}
}
| [XceiverClientGrpc->[reconnect->[connectToDatanode,isConnected],sendCommandAsync->[sendCommandAsync,onCompleted,onNext],checkOpen->[isConnected],isConnected->[isConnected]]] | Closes the pipeline and all channels. | can you update this log text as well? |
@@ -58,6 +58,9 @@ const WHITELISTED_FORMAT_TAGS = [
const BLACKLISTED_ATTR_VALUES = [
/*eslint no-script-url: 0*/ 'javascript:',
/*eslint no-script-url: 0*/ 'vbscript:',
+ /*eslint no-script-url: 0*/ 'data:',
+ /*eslint no-script-url: 0*/ '<script',
+ /*eslint no-script-url: 0*/ '</script',
];
| [No CFG could be retrieved] | Sanitizes the provided HTML by removing any tags that are not allowed by the CABA Emit HTML content. | Is it necessary? Attribute values will be properly encoded, so there's no chance to actually insert the angle bracket into the final HTML. |
@@ -1032,8 +1032,8 @@ public class HttpPostRequestDecoder {
Attribute attribute;
try {
attribute = factory.createAttribute(request,
- decodeAttribute(cleanString(contents[0].trim()), charset),
- decodeAttribute(cleanString(contents[i]), charset));
+ decodeAttributeMultipart(contents[0], charset),
+ decodeAttributeMultipart(contents[i], charset));
} catch (NullPointerException e) {
throw new ErrorDataDecoderException(e);
} catch (IllegalArgumentException e) {
| [HttpPostRequestDecoder->[getFileUpload->[decodeAttribute],setFinalBuffer->[addHttpData],parseBodyMultipart->[addHttpData],parseBodyAttributesStandard->[addHttpData],removeHttpDataFromClean->[removeHttpDataFromClean],findMultipartDelimiter->[skipControlCharacters,decodeMultipart],readLine->[readLineStandard],loadFieldMultipart->[loadFieldMultipartStandard],next->[hasNext],findMultipartDisposition->[skipControlCharacters,decodeAttribute,decodeMultipart],decodeMultipart->[decodeAttribute],readFileUploadByteMultipart->[readFileUploadByteMultipartStandard],readDelimiter->[readDelimiterStandard],parseBodyAttributes->[addHttpData,parseBodyAttributesStandard]]] | Reads the next part of a multipart upload. Decode the contents of the response. This method checks if there is a next key in the chain. If it is it checks. | you removed the trim() here... is that correct ? |
@@ -730,6 +730,11 @@ def process_options(args: List[str],
if special_opts.no_executable:
options.python_executable = None
+ # Paths listed in the config file will be ignored if any paths are passed on
+ # the command line.
+ if not special_opts.files and options.files:
+ special_opts.files = options.files
+
# Check for invalid argument combinations.
if require_targets:
code_methods = sum(bool(c) for c in [special_opts.modules + special_opts.packages,
| [process_options->[add_invertible_flag->[invert_flag_name],add_invertible_flag,SplitNamespace,infer_python_executable],infer_python_executable->[_python_executable_from_version],AugmentedHelpFormatter->[_fill_text->[_fill_text]],_python_executable_from_version->[PythonExecutableInferenceError]] | Parse command line arguments and return a tuple of build sources and options. Adds a group of arguments and options to a separate namespace object. Adds a group of arguments to the command line that will be run under certain conditions. | I'd write this as `if options.files and not special_opts.files:` -- just because in English the priority of `not` vs. `and` is not so clear. |
@@ -52,9 +52,8 @@ class DataIterator:
@classmethod
def from_params(cls, params: Params):
- from allennlp.experiments.registry import Registry
# TODO(Mark): The adaptive iterator will need a bit of work here,
# to retrieve the scaling function etc.
- iterator_type = params.pop_choice("type", Registry.list_data_iterators())
- return Registry.get_data_iterator(iterator_type)(**params.as_dict()) # type: ignore
+ iterator_type = params.pop_choice("type", cls.list_available())
+ return cls.by_name(iterator_type)(**params.as_dict()) # type: ignore
| [DataIterator->[__call__->[range,_yield_one_epoch],from_params->[list_data_iterators,as_dict,pop_choice,get_data_iterator],_yield_one_epoch->[as_arrays,get_padding_lengths,Dataset,_create_batches]]] | Create a new instance of the class from the given parameters. | Do we actually need the `# type: ignore` here? We don't have it in other places. Also, there is no listed return type for the method - maybe that's the reason there was a type failure? |
@@ -377,15 +377,15 @@ func (c *Container) start(ctx context.Context) error {
detail, err = c.vm.WaitForKeyInExtraConfig(ctx, key)
if err != nil {
- c.State = existingState
return fmt.Errorf("unable to wait for process launch status: %s", err.Error())
}
if detail != "true" {
- c.State = existingState
return errors.New(detail)
}
+ // this state will be set by defer function.
+ finalState = StateRunning
return nil
}
| [Commit->[refresh],shutdown->[waitForPowerState],stop->[shutdown],Signal->[startGuestProgram],start->[Error],Error->[Error],Remove->[Remove],String,Error] | start waits for the container to start. | once we've powered the VM on, this should be StateUnknown on general error paths - this allows subsequent calls to attempt an update. |
@@ -56,7 +56,10 @@ class SlicePluginTRTTest(InferencePassTest):
if core.is_compiled_with_cuda():
use_gpu.append(True)
for i in range(len(use_gpu)):
- self.check_output_with_option(use_gpu[i])
+ atol = 1e-5
+ if self.trt_parameters.precision == AnalysisConfig.Precision.Half:
+ atol = 1e-3
+ self.check_output_with_option(use_gpu[i], atol)
#negative starts && ends
| [SlicePluginTRTTest->[setUp->[setUpSliceParams,setUpTensorRTParams]]] | Test if the output of the nanoseconds function is correct. | AnalysisConfig.Precision.Half: atol 1e - 3 |
@@ -1103,11 +1103,14 @@ public class ReferenceCountedOpenSslEngine extends SSLEngine implements Referenc
if (handshakeException == null && handshakeState != HandshakeState.FINISHED) {
// we seems to have data left that needs to be transfered and so the user needs
// call wrap(...). Store the error so we can pick it up later.
- handshakeException = new SSLHandshakeException(errStr);
+ handshakeException = new SSLHandshakeException(SSL.getErrorString(err));
}
+ // We need to clear all errors so we not pick up anything that was left on the stack on the next
+ // operation. Note that shutdownWithError(...) will cleanup the stack as well so its only needed here.
+ SSL.clearError();
return new SSLEngineResult(OK, NEED_WRAP, bytesConsumed, bytesProduced);
}
- throw shutdownWithError("SSL_read", errStr);
+ throw shutdownWithError("SSL_read", SSL.getErrorString(err));
}
private void closeAll() throws SSLException {
| [ReferenceCountedOpenSslEngine->[getSSLParameters->[getSSLParameters],needPendingStatus->[isOutboundDone,isInboundDone],retain->[retain],OpenSslSession->[handshakeFinished->[isDestroyed,calculateMaxWrapOverhead,toJavaCipherSuite],getPeerCertificateChain->[isEmpty],initPeerCerts->[isEmpty],getPeerPort->[getPeerPort],invalidate->[isDestroyed],getCreationTime->[isDestroyed],getProtocol->[isDestroyed],getPeerPrincipal->[getPeerCertificates],getLastAccessedTime->[getCreationTime],selectApplicationProtocol->[selectApplicationProtocol],getPacketBufferSize->[maxEncryptedPacketLength],getValueNames->[isEmpty],isValid->[isDestroyed],getPeerCertificates->[isEmpty],getPeerHost->[getPeerHost]],sslReadErrorResult->[shutdownWithError],getOcspResponse->[getOcspResponse],wrap->[release,writePlaintextData,isBytesAvailableEnoughForWrap,wrap,resetSingleSrcBuffer,singleSrcBuffer],closeInbound->[shutdown],newResult->[shutdown,newResult],writeEncryptedData->[release],beginHandshake->[calculateMaxWrapOverhead],checkSniHostnameMatch->[checkSniHostnameMatch],calculateMaxWrapOverhead->[maxEncryptedPacketLength0],rejectRemoteInitiatedRenegotiation->[shutdown],release->[release],setSSLParameters->[isEmpty,setVerify,setSSLParameters],newResultMayFinishHandshake->[newResult],setVerify->[setVerify],handshake->[shutdown,shutdownWithError,pendingStatus,checkEngineClosed],closeOutbound->[shutdown],unwrap->[readPlaintextData,release,sslPending0,newResultMayFinishHandshake,singleDstBuffer,newResult,unwrap,resetSingleDstBuffer,resetSingleSrcBuffer,writeEncryptedData,singleSrcBuffer],doSSLShutdown->[shutdown],getHandshakeStatus->[pendingStatus],readPlaintextData->[release],shutdownWithError->[shutdownWithError,shutdown],setOcspResponse->[setOcspResponse],toJavaCipherSuitePrefix->[isEmpty],writePlaintextData->[release],refCnt->[refCnt],sslPending0->[sslPending],mayFinishHandshake->[handshake],touch->[touch],setClientAuth->[setVerify]]] | This method is called when an error occurs while reading from the peer. It checks if there. | @normanmaurer without this what behaviour did you observe? |
@@ -564,6 +564,7 @@ cont_ec_agg_ult(void *arg)
D_DEBUG(DB_EPC, "start EC aggregation "DF_UUID"\n",
DP_UUID(cont->sc_uuid));
+ cont->sc_ec_agg_active = 1;
ds_obj_ec_aggregate(arg);
}
| [No CFG could be retrieved] | query the highest aggregated epoch END of function get_n_ult. | Why this extra set is required? |
@@ -913,3 +913,17 @@ export function getAmpRuntimeTypeParameter(win) {
const art = getBinaryTypeNumericalCode(getBinaryType(win));
return isCdnProxy(win) && art != '0' ? art : null;
}
+
+/**
+ * Returns boolean whether the page is canonical AMP, based on the url
+ * of the page. If we are testing locally, always returns that we are
+ * not on canonical.
+ * @param {!Window} win
+ * @return {boolean}
+ */
+export function isCanonical(win) {
+ const googleCdnProxyRegex =
+ /^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org((\/.*)|($))+/;
+ return !(googleCdnProxyRegex.test(win.location.origin)
+ || getMode(win).localDev || getMode(win).test);
+}
| [No CFG could be retrieved] | Get binary type numerical code. | Replace with isCdnProxy (not of it) created in #15421 |
@@ -427,9 +427,12 @@ class Assignment < ActiveRecord::Base
# shouldn't happen anyway, because the lookup earlier should prevent
# repo collisions e.g. when uploading the same CSV file twice.
group.save
+ m_logger.log("Created Group with name:'#{group.group_name}' and repo name: '#{group.repo_name}'
+ with error:'#{group.errors[:base]}'")
unless group.errors[:base].blank?
+ m_logger.log("Collision detected of '#{group.errors[:base]}'", MarkusLogger::ERROR)
collision_error = I18n.t('csv.repo_collision_warning',
- { repo_name: group.errors.on_base,
+ { repo_name: group.errors.get(:base),
group_name: row[0] })
end
| [Assignment->[get_detailed_csv_report_rubric->[total_mark],group_by->[group_assignment?],grade_distribution_as_percentage->[total_mark],get_simple_csv_report->[total_mark],get_detailed_csv_report_flexible->[total_mark],reset_collection_time->[reset_collection_time],median->[average],grouping_past_due_date?->[past_all_due_dates?]]] | Adds a CSV file to a group if it does not already exist. This method is called when a new Grouping is created for this assignment and the newly c. | Line is too long. [100/80]<br>Trailing whitespace detected. |
@@ -144,14 +144,15 @@ public class MetadataComponentModelValidator implements ExtensionModelValidator
});
}
- private void validateMetadataKeyId(ComponentModel model, MetadataResolverFactory resolverFactory,
+ private void validateMetadataKeyId(ExtensionModel extensionModel, ComponentModel model, MetadataResolverFactory resolverFactory,
ProblemsReporter problemsReporter) {
final String modelTypeName = capitalize(getComponentModelTypeName(model));
Optional<MetadataKeyIdModelProperty> keyId = model.getModelProperty(MetadataKeyIdModelProperty.class);
if (keyId.isPresent()) {
if (resolverFactory.getOutputResolver() instanceof NullMetadataResolver
- && !thereIsAnInputTypeResolverDefined(getAllInputResolvers(model, resolverFactory))) {
+ && !thereIsAnInputTypeResolverDefined(getAllInputResolvers(model, resolverFactory))
+ && isCompileTime(extensionModel)) {
problemsReporter.addError(new Problem(model, format("%s '%s' defines a MetadataKeyId parameter but neither"
+ " an Output nor Type resolver that makes use of it was defined",
modelTypeName, model.getName())));
| [MetadataComponentModelValidator->[thereIsAnInputTypeResolverDefined->[anyMatch],isInvalidInterface->[isMap,isInterface,orElse,equals],validateCategoryNames->[addError,capitalize,getName,getSimpleName,size,Problem,getComponentModelTypeName,format,collect,join,ifPresent,toSet],validate->[getModelProperty,isPresent,walk,create],validateVoidOperationsDontDeclareOutputResolver->[addError,getName,Problem,getResolverName,format,ifPresent,getCategoryName,isCustomStaticType],getAllInputResolvers->[toList,collect],validateMetadataReturnType->[isPresent,validateVoidOperationsDontDeclareOutputResolver,getOutputResolver,getType,shouldValidateComponentOutputMetadata,validateNoOutputResolverIsNeeded],validateCategoriesInScope->[validateCategoryNames,getAllResolvers],checkValidType->[addError,capitalize,getName,equals,isOpen,getType,getComponentModelTypeName,Problem,format,isInvalidInterface,ifPresent],validateMetadataKeyId->[visitObject->[addError,size,getName,toList,orElse,Problem,format,isEmpty,collect],thereIsAnInputTypeResolverDefined,addError,MetadataTypeVisitor,capitalize,getName,isPresent,getAllInputResolvers,accept,getKeyResolver,getOutputResolver,Problem,format,getModelProperty,getComponentModelTypeName],isCustomStaticType->[isPresent],shouldValidateComponentOutputMetadata->[orElse],validateResolversName->[forEach,addError,getName,getSimpleName,getAllInputResolvers,get,getOutputResolver,Problem,getComponentModelTypeName,getResolverName,format,getClass,addAll,put,add,isBlank,capitalize,getCategoryName],validateNoOutputResolverIsNeeded->[visitObject->[checkValidType,ifPresent,isCustomStaticType],visitArrayType->[accept,isCustomStaticType],MetadataTypeVisitor,accept],validateMetadataOutputAttributes->[addError,getName,isVoid,isCollection,getType,Problem,getComponentModelTypeName,format,capitalize,getOutputAttributesResolver]]] | Validate the names of the named resolvers. Checks if a type is associated with a multilevel key and if so checks if the. | make this the very first condition so that mule startup doesn't go through unnecessary processing. |
@@ -860,7 +860,7 @@ public class QueryDslConditionsTest extends AbstractQueryTest {
assertEquals(3, list.get(0).getId());
}
- @Ignore(value = "https://hibernate.atlassian.net/browse/HSEARCH-1956")
+ @Test
public void testIsNullNumericWithProjection1() throws Exception {
QueryFactory qf = getQueryFactory();
| [QueryDslConditionsTest->[testBetween2->[makeDate],testBetween3->[makeDate],testSampleDomainQuery8->[makeDate],testBetween1->[makeDate],testSampleDomainQuery9->[makeDate],populateCache->[makeDate]]] | Test if there are three records with null values. | Do you need the explicit `@Test` annotations? |
@@ -474,6 +474,16 @@ def read_forward_solution(fname, force_fixed=False, surf_ori=False,
return fwd
+def _to_fixed_ori(forward):
+ """Helper to convert the forward solution to fixed ori from free"""
+ forward['sol']['data'] = forward['sol']['data'][:, 2::3]
+ forward['sol']['ncol'] = forward['sol']['ncol'] / 3
+ forward['source_ori'] = FIFF.FIFFV_MNE_FIXED_ORI
+ logger.info(' Converted the forward solution into the '
+ 'fixed-orientation mode.')
+ return forward
+
+
def is_fixed_orient(forward):
"""Has forward operator fixed orientation?
"""
| [_apply_forward->[is_fixed_orient,_stc_src_sel],apply_forward_raw->[_fill_measurement_info,_apply_forward],apply_forward->[_fill_measurement_info,_apply_forward],compute_orient_prior->[is_fixed_orient],read_forward_solution->[_block_diag,_read_one,read_forward_meas_info]] | Checks if the forward operator fixed orientation is in effect. | you should check that the forward in surface oriented. Otherwise it does not work this way. |
@@ -121,13 +121,15 @@ public class HoodieWrapperFileSystem extends FileSystem {
// Remove 'hoodie-' prefix from path
if (path.toString().startsWith(HOODIE_SCHEME_PREFIX)) {
path = new Path(path.toString().replace(HOODIE_SCHEME_PREFIX, ""));
+ this.uri = path.toUri();
+ } else {
+ this.uri = uri;
}
this.fileSystem = FSUtils.getFs(path.toString(), conf);
// Do not need to explicitly initialize the default filesystem, its done already in the above
// FileSystem.get
// fileSystem.initialize(FileSystem.getDefaultUri(conf), conf);
// fileSystem.setConf(conf);
- this.uri = uri;
}
@Override
| [HoodieWrapperFileSystem->[getName->[getName],addDelegationTokens->[addDelegationTokens],getFileChecksum->[getFileChecksum],getLength->[getLength],convertToDefaultPath->[getScheme,convertPathWithScheme],close->[close],setVerifyChecksum->[setVerifyChecksum],supportsSymlinks->[supportsSymlinks],setOwner->[setOwner],getDelegationToken->[getDelegationToken],removeDefaultAcl->[removeDefaultAcl],isDirectory->[isDirectory],removeAclEntries->[removeAclEntries],copyFromLocalFile->[copyFromLocalFile],append->[append,wrapOutputStream],setPermission->[setPermission],setAcl->[setAcl],getDefaultBlockSize->[getDefaultBlockSize],getAclStatus->[getAclStatus],deleteSnapshot->[deleteSnapshot],createSnapshot->[createSnapshot,convertToHoodiePath],getChildFileSystems->[getChildFileSystems],getHomeDirectory->[convertToHoodiePath,getHomeDirectory],convertLocalPaths->[convertToLocalPath],convertDefaults->[convertToDefaultPath],convertToLocalPath->[getScheme,convertPathWithScheme],makeQualified->[convertToHoodiePath,makeQualified],modifyAclEntries->[modifyAclEntries],getFileStatus->[getFileStatus],removeAcl->[removeAcl],removeXAttr->[removeXAttr],getBytesWritten->[getName,toString,getBytesWritten],getXAttr->[getXAttr],completeLocalOutput->[completeLocalOutput],listLocatedStatus->[listLocatedStatus],listXAttrs->[listXAttrs],copyToLocalFile->[copyToLocalFile],getFileLinkStatus->[getFileLinkStatus],createNonRecursive->[wrapOutputStream,createNonRecursive],create->[wrapOutputStream,create],moveFromLocalFile->[moveFromLocalFile],convertToHoodiePath->[getScheme,getHoodieScheme,convertPathWithScheme],listFiles->[listFiles],access->[access],getScheme->[getScheme],hashCode->[hashCode],deleteOnExit->[deleteOnExit],getContentSummary->[getContentSummary],setWriteChecksum->[setWriteChecksum],resolvePath->[resolvePath,convertToHoodiePath],getUsed->[getUsed],delete->[delete],cancelDeleteOnExit->[cancelDeleteOnExit],getReplication->[getReplication],getCanonicalServiceName->[getCanonicalServiceName],getLinkTarget->[convertToHoodiePath,getLinkTarget],getServerDefaults->[getServerDefaults],setReplication->[setReplication],mkdirs->[mkdirs],equals->[equals],getXAttrs->[getXAttrs],getStatus->[getStatus],rename->[rename],concat->[concat],exists->[exists],listStatus->[listStatus],setTimes->[setTimes],getConf->[getConf],isFile->[isFile],getWorkingDirectory->[convertToHoodiePath,getWorkingDirectory],open->[open],listCorruptFileBlocks->[listCorruptFileBlocks],globStatus->[globStatus],renameSnapshot->[renameSnapshot],moveToLocalFile->[moveToLocalFile],createNewFile->[createNewFile],getDefaultReplication->[getDefaultReplication],setXAttr->[setXAttr],getBlockSize->[getBlockSize],createSymlink->[createSymlink],setWorkingDirectory->[setWorkingDirectory],getFileBlockLocations->[getFileBlockLocations],startLocalOutput->[convertToHoodiePath,startLocalOutput],toString->[toString]]] | Initialize the file system and the file system for the given URI. | do we clean up lines 127-129? |
@@ -46,12 +46,12 @@ export class AmpExperiment extends AMP.BaseElement {
Object.keys(config).map(experimentName => {
return allocateVariant(this.getWin(), config[experimentName])
.then(variantName => {
- if (variantName) {
- results[experimentName] = variantName;
- }
+ results[experimentName] = variantName;
});
})).then(() => results);
this.experimentVariants.then(this.addToBody_.bind(this));
+
+ getService(this.getWin(), 'variant', () => this.experimentVariants);
}
getConfig_() {
| [No CFG could be retrieved] | Creates an AMP - experimental element. Adds AmpExperiment to the body of the page. | think we can return `results` here then we can get rid of `.then(() => results)` cc @jridgewell |
@@ -1498,10 +1498,8 @@ class NettingChannelEndState(State):
data['secrethashes_to_onchain_unlockedlocks'],
)
restored.merkletree = data['merkletree']
-
- balance_proof = data.get('balance_proof')
- if data is not None:
- restored.balance_proof = balance_proof
+ restored.balance_proof = data.get('balance_proof')
+ restored.onchain_locksroot = onchain_locksroot
return restored
| [PaymentMappingState->[__ne__->[__eq__]],TokenNetworkState->[__ne__->[__eq__]],BalanceProofUnsignedState->[__ne__->[__eq__]],MediatorTask->[__ne__->[__eq__]],NettingChannelEndState->[__ne__->[__eq__],__init__->[make_empty_merkle_tree]],TargetTask->[__ne__->[__eq__]],UnlockPartialProofState->[__ne__->[__eq__]],TransactionOrder->[__ne__->[__eq__]],InitiatorTask->[__ne__->[__eq__]],UnlockProofState->[__ne__->[__eq__]],NettingChannelState->[__ne__->[__eq__]],ChainState->[__ne__->[__eq__]],HashTimeLockState->[__ne__->[__eq__]],TokenNetworkGraphState->[__eq__->[to_comparable_graph],__ne__->[__eq__]],PaymentNetworkState->[__ne__->[__eq__]],TransactionExecutionStatus->[__ne__->[__eq__]],BalanceProofSignedState->[__ne__->[__eq__]],MerkleTreeState->[__ne__->[__eq__]],RouteState->[__ne__->[__eq__]]] | Create a NettingChannelEndState from a dictionary. | So restored balance proof can be None here? |
@@ -0,0 +1,14 @@
+package google
+
+import (
+ "fmt"
+
+ "google.golang.org/api/cloudresourcemanager/v1"
+)
+
+func getResourceName(resourceId *cloudresourcemanager.ResourceId) string {
+ if resourceId == nil {
+ return ""
+ }
+ return fmt.Sprintf("%s/%s", resourceId.Type, resourceId.Id)
+}
| [No CFG could be retrieved] | No Summary Found. | I don't see any usage for this method? |
@@ -87,5 +87,15 @@ class TestLRNOp(OpTest):
self.check_grad(['X'], 'Out', max_relative_error=0.01)
+class TestLRNMKLDNNOp(TestLRNOp):
+ def get_attrs(self):
+ attrs = TestLRNOp.get_attrs(self)
+ attrs['use_mkldnn'] = True
+ return attrs
+
+ def test_check_output(self):
+ self.check_output(atol=0.002)
+
+
if __name__ == "__main__":
unittest.main()
| [TestLRNOp->[setUp->[get_input,get_attrs,get_out]]] | check_grad - main function. | There are two algorithms ACROSS_CHANNELS and WITHIN_CHANNEL, but TestLRNMKLDNNOp here only test the default one. |
@@ -81,6 +81,7 @@ class ServiceBusQueueAsyncTests(AzureMgmtTestCase):
message = Message("Handler message no. {}".format(i))
messages.append(message)
await sender.send_messages(messages)
+ assert sender._handler._msg_timeout == 0
async with sb_client.get_queue_receiver(servicebus_queue.name, max_wait_time=5) as receiver:
count = 0
| [ServiceBusQueueAsyncTests->[test_async_queue_receive_batch_without_setting_prefetch->[message_content]]] | Test async queue by queue client send multiple messages. | Did we define what a timeout of 0 means? If so - we should update the docstring to make it clear. |
@@ -46,7 +46,7 @@ class Device
*
* @param int $device_id
*/
- public function setPrimary($device_id)
+ public function setPrimary(int $device_id)
{
$this->primary = $device_id;
}
| [Device->[getByHostname->[get,load],get->[load],getPrimary->[get],refresh->[get],load->[first]]] | set primary device id. | Shouldn't this one be ?int too? |
@@ -44,8 +44,9 @@ public class DistributedResourcePoolTest extends AbstractInterpreterTest {
public void setUp() throws Exception {
super.setUp();
InterpreterSetting interpreterSetting = interpreterSettingManager.getByName("mock_resource_pool");
+ interpreterSetting.getOption().setPerNote(ISOLATED);
intp1 = (RemoteInterpreter) interpreterSetting.getInterpreter("user1", "note1", "mock_resource_pool");
- intp2 = (RemoteInterpreter) interpreterSetting.getInterpreter("user2", "note1", "mock_resource_pool");
+ intp2 = (RemoteInterpreter) interpreterSetting.getInterpreter("user2", "note2", "mock_resource_pool");
context = InterpreterContext.builder()
.setNoteId("note")
| [DistributedResourcePoolTest->[testDistributedResourcePool->[getAllResources->[fromJson,getAll,ResourceSet,toJson,Gson,addAll,add,setResourcePoolConnector],readResource->[id,get,equals],assertTrue,isRemote,size,get,LocalResourcePool,DistributedResourcePool,ResourcePoolConnector,put,assertEquals],testRemoteDistributedResourcePool->[fromJson,interpret,size,getData,Gson,assertEquals],testResourcePoolUtils->[fromJson,interpret,removeResourcesBelongsToParagraph,size,removeResourcesBelongsToNote,getData,Gson,assertEquals],testResourceInvokeMethod->[fromJson,interpret,size,getData,Gson,assertEquals],setUp->[getByName,build,setUp,open,getInterpreter],tearDown->[close]]] | Initialize the mock interpreter. | While `intp1` and `intp2` were configured to the same Note `note1` with `SHARED` mode, the test was instantiating `intp1` and `intp2` in the same process and didn't test access to the remote object in the remote process. Therefore, changed interpreter option to per note `ISOLATED` and configured `intp1` for `note1` and `intp2` for `note2`. This make sure `intp1` and `intp2` runs in different process. In this way, it can reproduce error described in ZEPPELIN-4004 |
@@ -133,6 +133,8 @@ public class FlinkSavepointTest implements Serializable {
runSavepointAndRestore(false);
}
+ // TODO(ryan): make these fail when an exception is thrown (in the runner, I
+ // think?), instead of just timing out
@Test(timeout = 60_000)
public void testSavepointRestorePortable() throws Exception {
runSavepointAndRestore(true);
| [FlinkSavepointTest->[getJobGraph->[getJobGraph],restoreFromSavepointPortable->[executePortable]]] | Test savepoint restore legacy. | Is this related to the metrics? Have you seen this test timing out? |
@@ -136,7 +136,7 @@ function process_anchor_params() {
// Add Spotify Badge template action.
if (
- $insert_spotify_badge && (
+ $valid_spotify_url && (
'post-new.php' !== $GLOBALS['pagenow'] // Delegate badge insertion to podcast template.
)
) {
| [process_anchor_params->[is_block_editor,load_feed,get_track_data]] | Process anchor params Updates the post meta Add a WordPress action to insert a spotify badge and a link to publish a post. | I'm a bit confused by this if statement. I know it is adding the badge for the podcast as a whole rather than a specific episode, but the condition will be true when we have already added the action above. Probably not something to tackle in this PR if it's a problem. |
@@ -59,7 +59,7 @@ return [
'sendmail' => [
'transport' => 'sendmail',
- 'path' => '/usr/sbin/sendmail -bs',
+ 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t'),
],
'log' => [
| [No CFG could be retrieved] | Displays a list of all of the mailers used by your application. This function allows you to specify a name and address that is used globally for all e -. | This change to the default we probably don't want? |
@@ -238,7 +238,9 @@ public abstract class VarianceBufferAggregator implements BufferAggregator
buf.putDouble(position + NVARIANCE_OFFSET, holder2.nvariance);
return;
}
-
+ if (holder2.count == 0) {
+ return;
+ }
double sum = getSum(buf, position);
double nvariance = buf.getDouble(position + NVARIANCE_OFFSET);
| [VarianceBufferAggregator->[LongVarianceAggregator->[aggregate->[getLong,writeCountAndSum,getSum,getCount,getDouble]],getVarianceCollector->[getSum,getCount,getVariance],DoubleVarianceAggregator->[aggregate->[getSum,getCount,getDouble,writeCountAndSum]],ObjectVarianceAggregator->[aggregate->[writeNVariance,getSum,getCount,getDouble]],getSum->[getDouble],getCount->[getLong],getVariance->[getDouble],FloatVarianceAggregator->[aggregate->[writeCountAndSum,getSum,getFloat,getCount,getDouble]]]] | aggregate. | I think this early return could happen right after `Preconditions.checkState(holder2 != null);` on line 233 |
@@ -41,13 +41,16 @@ func resourceAwsEc2TrafficMirrorFilter() *schema.Resource {
}, false),
},
},
- "tags": tagsSchema(),
+ "tags": tagsSchema(),
+ "tags_all": tagsSchemaComputed(),
},
}
}
func resourceAwsEc2TrafficMirrorFilterCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn
+ defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig
+ tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{})))
input := &ec2.CreateTrafficMirrorFilterInput{}
| [StringValueSlice,Difference,GetChange,IgnoreAws,StringSlice,StringInSlice,Ec2KeyValueTags,Set,Ec2UpdateTags,GetOk,HasChange,Errorf,Len,SetId,IgnoreConfig,ModifyTrafficMirrorFilterNetworkServices,Id,CreateTrafficMirrorFilter,Map,Printf,StringValue,Sprintf,DescribeTrafficMirrorFilters,String,DeleteTrafficMirrorFilter] | The resource schema for the traffic mirror filter requires a Traffic Mirror Filter to be set in the request. | Ignore is not needed? |
@@ -153,7 +153,7 @@ public class DruidMaster
this.indexingServiceClient = indexingServiceClient;
this.taskMaster = taskMaster;
- this.exec = scheduledExecutorFactory.create(1, "Master-Exec--%d");
+ this.exec = scheduledExecutorService;
this.leaderLatch = new AtomicReference<LeaderLatch>(null);
this.loadManagementPeons = loadQueuePeonMap;
| [DruidMaster->[stopBeingMaster->[stop],moveSegment->[execute->[execute],execute],dropSegment->[dropSegment,execute],enableDatasource->[enableDatasource],start->[start],MasterComputeManagerRunnable->[run->[decrementRemovedSegmentsLifetime,stop]],MasterRunnable->[run->[stopBeingMaster,run]],lookupSegmentLifetime->[lookupSegmentLifetime],removeSegment->[removeSegment],removeDatasource->[removeDatasource],decrementRemovedSegmentsLifetime->[decrementRemovedSegmentsLifetime],becomeMaster->[start,createNewLeaderLatch]]] | Construct a new instance of the class. get the set of segments in the cluster. | I'm confused by this change. It seems to be making a lot of changes to actually accomplish no change? |
@@ -125,6 +125,10 @@ func (e *DeviceHistory) loadDevices() error {
exp.RevokedAt = &rt
}
+ if e.user.G().Env.GetDeviceID().Eq(d.ID) {
+ exp.CurrentDevice = true
+ }
+
e.devices = append(e.devices, exp)
}
| [provisioner->[Errorf],loadUser->[NewLoadUserPubOptionalArg,LoadUser,G],Run->[loadUser,loadDevices],loadDevices->[GetAllDevices,ProtExport,GetComputedKeyFamily,GetComputedKeyInfos,New,provisioner,Errorf,TimeFromSeconds],NewContextified] | loadDevices loads all the devices from the ComputedKeyInfos and the user s Computed. | remove the `user` here: `e.G().Env...` |
@@ -190,7 +190,7 @@ public final class ScalarFunctionAdapter
requireNonNull(methodHandle, "methodHandle is null");
requireNonNull(actualConvention, "actualConvention is null");
requireNonNull(expectedConvention, "expectedConvention is null");
- if (expectedConvention.getArgumentConventions().size() != expectedConvention.getArgumentConventions().size()) {
+ if (actualConvention.getArgumentConventions().size() != expectedConvention.getArgumentConventions().size()) {
throw new IllegalArgumentException("Actual and expected conventions have different number of arguments");
}
| [ScalarFunctionAdapter->[trinoNullArgumentException->[bindTo,AssertionError],isTrueNullFlag->[identity,changeReturnType,permuteArguments],lookupIsNullMethod->[methodType,AssertionError,findStatic],returnNull->[changeReturnType,returnType,explicitCastArguments,permuteArguments,wrap,constant],isWrapperType->[unwrap],adaptParameter->[changeParameterType,methodType,toArray,returnType,explicitCastArguments,identity,getBlockValue,throwTrinoNullArgumentException,isNullArgument,IllegalArgumentException,returnNull,collectArguments,filterArguments,parameterType,dropParameterTypes,guardWithTest,type,permuteArguments,dropArguments,wrap,changeReturnType,isTrueNullFlag,isWrapperType,unwrap,insertArguments,boxedToNullFlagFilter,isBlockPositionNull],boxedToNullFlagFilter->[changeParameterType,isTrueNullFlag,returnNull,type,isWrapperType,explicitCastArguments,unwrap,dropArguments,guardWithTest,identity],isNullArgument->[changeReturnType,methodType,parameterType,explicitCastArguments,permuteArguments],canAdapt->[IllegalArgumentException,size,supportsInstanceFactor,getReturnConvention,requireNonNull,supportsSession,getArgumentConvention,canAdaptReturn,canAdaptParameter],unwrap->[returnType],wrap->[returnType],getBlockValue->[changeReturnType,getJavaType,explicitCastArguments,AssertionError,bindTo],throwTrinoNullArgumentException->[trinoNullArgumentException,throwException,returnType,collectArguments,permuteArguments],adaptReturn->[changeReturnType,IllegalArgumentException,returnType,type,explicitCastArguments,unwrap,guardWithTest,wrap,identity,filterReturnValue,throwTrinoNullArgumentException,isNullArgument],adapt->[IllegalArgumentException,size,supportsInstanceFactor,getReturnConvention,adaptParameter,get,requireNonNull,supportsSession,getArgumentConvention,adaptReturn],isBlockPositionNull->[changeReturnType,methodType,AssertionError,findVirtual,permuteArguments],requireNonNull,lookupIsNullMethod]] | Adapts a method handle to a sequence of methods that can be interpreted to a sequence. | This looks like related to different commit? |
@@ -413,7 +413,7 @@ class SlimPruner(BasicPruner):
def patched_criterion(input_tensor: Tensor, target: Tensor):
sum_l1 = 0
for _, wrapper in self.get_modules_wrapper().items():
- sum_l1 += torch.norm(wrapper.module.weight.data, p=1)
+ sum_l1 += torch.norm(wrapper.module.weight, p=1)
return criterion(input_tensor, target) + self._scale * sum_l1
return patched_criterion
| [FPGMPruner->[reset_tools->[reset]],ADMMPruner->[reset_tools->[reset]],ActivationPruner->[reset_tools->[reset]],TaylorFOWeightPruner->[reset_tools->[reset]],NormPruner->[reset_tools->[reset]],LevelPruner->[reset_tools->[reset]],SlimPruner->[reset_tools->[reset]]] | Patch the criterion function to add weight normalization and sparsity calculation. | Does this matter final result? I ran the experiment with SlimPruner in two ways (use `.data` or not) and found almost no difference : ( |
@@ -200,6 +200,9 @@ public class KafkaRecordSet
if (columnHandle.isInternal()) {
KafkaInternalFieldDescription fieldDescription = KafkaInternalFieldDescription.forColumnName(columnHandle.getName());
switch (fieldDescription) {
+ case TIMESTAMP_FIELD:
+ currentRowValuesMap.put(columnHandle, longValueProvider(messageAndOffset.message().timestamp()));
+ break;
case SEGMENT_COUNT_FIELD:
currentRowValuesMap.put(columnHandle, longValueProvider(totalMessages));
break;
| [KafkaRecordSet->[KafkaRecordCursor->[getLong->[getLong],isNull->[isNull],getType->[getType],getDouble->[getDouble],getBoolean->[getBoolean],getSlice->[getSlice]]]] | This method returns true if the next row in the partition has a reserved key. This method is called when the decoder of a column is not present in the current row. | What does `messageAndOffset.message().timestamp()` return? Is it in UTC or some other time zone? Maybe there is no timezone? Do you need to handle `session.isLegacyTimestamp()`? |
@@ -31,8 +31,12 @@ import (
const StatusSuccess = "success"
var (
- matrix = model.ValMatrix.String()
- json = jsoniter.ConfigCompatibleWithStandardLibrary
+ matrix = model.ValMatrix.String()
+ json = jsoniter.Config{
+ EscapeHTML: false, // No HTML in our responses.
+ SortMapKeys: true,
+ ValidateJsonRawMessage: true,
+ }.Froze()
errEndBeforeStart = httpgrpc.Errorf(http.StatusBadRequest, "end timestamp must not be before start time")
errNegativeStep = httpgrpc.Errorf(http.StatusBadRequest, "zero or negative query resolution step widths are not accepted. Try a positive integer")
errStepTooSmall = httpgrpc.Errorf(http.StatusBadRequest, "exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)")
| [Less->[minTime],UnmarshalJSON->[FromMetricsToLabelAdapters,Unmarshal],MarshalJSON->[Marshal,FromLabelAdaptersToMetric],DecodeRequest->[ParseTime,Contains,Values,FormValue],EncodeRequest->[WithContext,Encode,String,Errorf],DecodeResponse->[Error,Finish,Int,New,Unmarshal,Errorf,LogFields,ReadAll],EncodeResponse->[StartSpanFromContext,NewBuffer,Int,Finish,Marshal,NopCloser,Errorf,LogFields],MergeResponse->[String,Sort],LogToSpan->[Time,GetStart,GetEnd,GetQuery,String,LogFields,Int64,GetStep],Strings,Code,Message,FormatFloat,String,Errorf,FromError,FromLabelAdaptersToLabels,ParseFloat,ParseDuration] | "strconv" - > strconv - > strconv - > time - > str DecodeResponse decodes the response from the request and builds the result correctly. | Why is this required? |
@@ -162,6 +162,11 @@ public class UpdateSiteWarningsMonitor extends AdministrativeMonitor {
return getActiveWarnings().size() < configuration.getApplicableWarnings().size();
}
+ @Override
+ public Permission getRequiredPermission() {
+ return Jenkins.SYSTEM_READ;
+ }
+
@Override
public String getDisplayName() {
return Messages.UpdateSiteWarningsMonitor_DisplayName();
| [UpdateSiteWarningsMonitor->[isActivated->[isEmpty,isSiteDataReady],doForward->[redirectViaContextPath],getActivePluginWarningsByPlugin->[getActiveWarnings,put,add,containsKey,getPlugin],getActiveWarnings->[getApplicableWarnings,unmodifiableSet,contains,add,lookupSingleton],getDisplayName->[UpdateSiteWarningsMonitor_DisplayName],hasApplicableHiddenWarnings->[lookupSingleton,size],getActiveCoreWarnings->[add,getActiveWarnings]]] | HasApplicableHiddenWarnings method. | While `doForward` doesn't _do_ anything, it's a small step to something that does, so perhaps just add an unnecessary check? |
@@ -182,11 +182,10 @@ ParticipantTask::svc()
// pathways related to publication; we should be especially dull
// and write only one sample at a time per writer.
- ProgressIndicator progress("(%P|%t) PUBLISHER %d%% (%d samples sent)\n",
- samples_per_thread_);
+ const std::string fmt(pfx + " %d%% (%d samples sent)\n");
+ ProgressIndicator progress(fmt.c_str(), samples_per_thread_);
- for (std::size_t i = 0; i < samples_per_thread_; ++i)
- {
+ for (std::size_t i = 0; i < samples_per_thread_; ++i) {
Foo foo;
foo.key = 3;
foo.x = (float) this_thread_index;
| [No CFG could be retrieved] | - - - - - - - - - - - - - - - - - - write a single object to the DDS. | Make the progress indicator take a thread id to avoid the dynamic format string. |
@@ -87,7 +87,7 @@ class AsyncKeyVaultClientBase:
if api_version is None:
api_version = KeyVaultClient.DEFAULT_API_VERSION
- config = config or self.create_config(credential, api_version=api_version, **kwargs)
+ config = self.create_config(credential, api_version=api_version, **kwargs)
pipeline = kwargs.pop("pipeline", None) or self._build_pipeline(config, transport=transport, **kwargs)
self._client = KeyVaultClient(credential, api_version=api_version, pipeline=pipeline, aio=True)
| [AsyncPagingAdapter->[__anext__->[__anext__]],AsyncKeyVaultClientBase->[__init__->[create_config]]] | Initialize a new object with a single node. | >config = self.create_config(credential, api_version=api_version, **kwargs) [](start = 8, length = 74) Should create_config be marked as private now? _create_config? |
@@ -88,9 +88,16 @@ public class OperationReturnTypeModelValidator implements ExtensionModelValidato
operationMethod.getParameters().stream()
.filter(p -> p.getType().isSameType(CompletionCallback.class))
.findFirst().ifPresent(p -> {
- if (p.getType().getGenerics().isEmpty()) {
+ List<TypeGeneric> generics = p.getType().getGenerics();
+ if (generics.isEmpty()) {
problemsReporter.addError(new Problem(p, format(MISSING_GENERICS_ERROR_MESSAGE, operationModel.getName(),
extensionModel.getName(), CompletionCallback.class.getName())));
+ } else {
+ if (generics.get(0).getConcreteType().isSameType(Void.class) &&
+ !generics.get(1).getConcreteType().isSameType(Void.class)) {
+ problemsReporter.addError(new Problem(p, format(INVALID_GENERICS_ERROR_MESSAGE, operationModel.getName(),
+ extensionModel.getName(), CompletionCallback.class.getName())));
+ }
}
});
}
| [OperationReturnTypeModelValidator->[validateForbiddenTypesReturnType->[addError,getName,Problem,format,ifPresent],validateResultReturnType->[addError,getName,Problem,isAssignableTo,format,isEmpty],missingReturnTypeException->[format,IllegalOperationModelDefinitionException,getName],validate->[walk],validateNonBlockingCallback->[addError,getName,Problem,format,isEmpty,ifPresent],validateMessageCollectionsReturnType->[addError,getGenerics,getName,getConcreteType,Problem,isAssignableTo,format,isEmpty],of]] | Validate non - blocking callback. | This restriction also applies to blocking operations, and operations that return message collection if it uses Result or List<Result> return type. |
@@ -0,0 +1,16 @@
+<?php
+
+/*
+ * LibreNMS Sensor pre-cache module for the CradlePoint WiPipe
+ *
+ * © 2017 Chris A. Evans <thecityofguanyu@outlook.com>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or (at your
+ * option) any later version. Please see LICENSE.txt at the top level of
+ * the source code distribution for details.
+ */
+
+echo 'Caching WIPIPE-MIB';
+$pre_cache['wipipe_oids'] = snmpwalk_cache_multi_oid($device, 'enterprises.20992', array(), 'SNMPv2-SMI');
| [No CFG could be retrieved] | No Summary Found. | This looks wrong, enterprises. is just a numerical OID translated from SNMPv2-SMI but 20992 is a vendor specific OID. So either use the vendors MIB and use the full OID name or drop SNMPv2-SMI and change the OID to the full numerical one. |
@@ -108,7 +108,8 @@ async function storybook() {
if (!build) {
createCtrlcHandler('storybook');
}
- envs.map(build ? buildEnv : launchEnv);
+ const buildDir = build === true ? 'examples/storybook' : build;
+ envs.map(buildDir ? (env) => buildEnv(env, buildDir) : launchEnv);
}
module.exports = {
| [No CFG could be retrieved] | JS - Extension for the module. | It took me a while to realize that the `--build` flag is being overloaded to be either a boolean or a string. For maintainability / usability, I think it's better to add a separate `--build_dir` flag that works in conjunction with `--build`. |
@@ -451,7 +451,9 @@ public class KafkaIO {
// Set required defaults
setTopicPartitions(Collections.emptyList());
- setConsumerFactoryFn(Read.KAFKA_CONSUMER_FACTORY_FN);
+ setConsumerFactoryFn(KafkaIOUtils.KAFKA_CONSUMER_FACTORY_FN);
+ setMaxNumRecords(Long.MAX_VALUE);
+ setConsumerFactoryFn(KafkaIOUtils.KAFKA_CONSUMER_FACTORY_FN);
if (config.maxReadTime != null) {
setMaxReadTime(Duration.standardSeconds(config.maxReadTime));
}
| [KafkaIO->[TypedWithoutMetadata->[populateDisplayData->[populateDisplayData]],WriteRecords->[updateProducerProperties->[updateKafkaProperties,getProducerConfig,build],withConsumerFactoryFn->[build],expand->[isEOS,getValueSerializer,getKeySerializer,getTopic],withEOS->[build],withProducerFactoryFn->[build],withProducerConfigUpdates->[updateKafkaProperties,getProducerConfig,build],validate->[isEOS],populateDisplayData->[populateDisplayData],withValueSerializer->[build],withPublishTimestampFunction->[build],withKeySerializer->[build],withTopic->[build]],Write->[updateProducerProperties->[withWriteRecordsTransform,updateProducerProperties],Builder->[buildExternal->[withTopic,setWriteRecordsTransform,setTopic,build]],withConsumerFactoryFn->[withWriteRecordsTransform,withConsumerFactoryFn],withInputTimestamp->[withWriteRecordsTransform,withInputTimestamp],expand->[getWriteRecordsTransform,getTopic],withEOS->[withWriteRecordsTransform,withEOS],withProducerFactoryFn->[withWriteRecordsTransform,withProducerFactoryFn],PublishTimestampFunctionKV->[getTimestamp->[getTimestamp]],withBootstrapServers->[withWriteRecordsTransform,withBootstrapServers],withProducerConfigUpdates->[withWriteRecordsTransform,withProducerConfigUpdates],validate->[validate],populateDisplayData->[populateDisplayData],values->[withKeySerializer],withValueSerializer->[withWriteRecordsTransform,withValueSerializer],withPublishTimestampFunction->[withWriteRecordsTransform,withPublishTimestampFunction],withKeySerializer->[withWriteRecordsTransform,withKeySerializer],withWriteRecordsTransform->[build],withTopic->[build]],Read->[withProcessingTime->[withProcessingTime],withCreateTime->[withCreateTime],withMaxNumRecords->[build],withTimestampFn->[withTimestampFn2],commitOffsetsInFinalize->[build],Builder->[buildExternal->[setKeyCoder,setValueCoder,setTimestampPolicyFactory,setStartReadTime,setConsumerFactoryFn,setTopics,setKeyDeserializerProvider,setConsumerConfig,setTopicPartitions,setMaxReadTime,setCommitOffsetsInFinalizeEnabled,build,setMaxNumRecords,setValueDeserializerProvider]],withTopicPartitions->[build],withKeyDeserializerAndCoder->[build],withStartReadTime->[build],expand->[getMaxNumRecords,getKeyCoder,getKeyDeserializerProvider,getValueCoder,withMaxNumRecords,getMaxReadTime,getStartReadTime,getValueDeserializerProvider,isCommitOffsetsInFinalizeEnabled],getKeyCoder->[getKeyCoder],withOffsetConsumerConfigOverrides->[build],withValueDeserializer->[withValueDeserializer,build],withLogAppendTime->[withLogAppendTime],withWatermarkFn->[withWatermarkFn2],withMaxReadTime->[build],withKeyDeserializer->[withKeyDeserializer,build],withTopics->[build],withValueDeserializerAndCoder->[build],withConsumerFactoryFn->[build],withWatermarkFn2->[build],withConsumerConfigUpdates->[getConsumerConfig,build],populateDisplayData->[populateDisplayData,getTopicPartitions,getTopics],withTimestampPolicyFactory->[build],updateConsumerProperties->[getConsumerConfig,build],getValueCoder->[getValueCoder],withTimestampFn2->[build]],KafkaValueWrite->[populateDisplayData->[populateDisplayData]]]] | This method is called by the External. Configuration class when it is not possible to build a. | MaxNumRecords is set 2 lines below, this line should be removed. |
@@ -237,10 +237,13 @@ static int test_siphash(int idx)
size_t i;
if (expectedlen != SIPHASH_MIN_DIGEST_SIZE &&
- expectedlen != SIPHASH_MAX_DIGEST_SIZE)
+ expectedlen != SIPHASH_MAX_DIGEST_SIZE) {
+ TEST_info("size %" OSSLzu " vs %d and %d", expectedlen,
+ SIPHASH_MIN_DIGEST_SIZE, SIPHASH_MAX_DIGEST_SIZE);
return 0;
+ }
- if (inlen > sizeof(in))
+ if (!TEST_int_le(inlen, sizeof(in)))
return 0;
/* key and in data are 00 01 02 ... */
| [test_main->[ADD_ALL_TESTS,ADD_TEST,BIO_new,BIO_new_fp,run_tests,strcmp,OSSL_NELEM,BIO_push,BIO_printf,BIO_free,BIO_f_linebuffer],int->[SipHash_Final,hex_out,memcmp,memset,SipHash_Update,SipHash_Init,BIO_printf,OPENSSL_rdtsc],void->[BIO_hex_string,BIO_printf]] | test_siphash - Test if siphash is correct. This method checks if the two hashes are identical and if they are the same then the two memcmp - memcmp. | This is where C++ templates would come in handy... (side note) |
@@ -364,7 +364,10 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
return;
}
+ SystemVmTemplateRegistration.parseMetadataFile();
final CloudStackVersion currentVersion = CloudStackVersion.parse(currentVersionValue);
+ SystemVmTemplateRegistration.CS_MAJOR_VERSION = String.valueOf(currentVersion.getMajorRelease()) + "." + String.valueOf(currentVersion.getMinorRelease());
+ SystemVmTemplateRegistration.CS_TINY_VERSION = String.valueOf(currentVersion.getPatchRelease());
s_logger.info("DB version = " + dbVersion + " Code Version = " + currentVersion);
if (dbVersion.compareTo(currentVersion) > 0) {
| [DatabaseUpgradeChecker->[updateSystemVmTemplates->[updateSystemVmTemplates],check->[upgrade],runScript->[runScript],upgrade->[calculateUpgradePath,runScript,updateSystemVmTemplates]]] | Check if the current version of the database is higher than the management software version. | is this check() method always called on mgmt server start/restart? (asking to understand if the CS_ vars are used globally, should they be replaced via a getter instead) |
@@ -303,6 +303,10 @@ public class InternalFunctionRegistry implements MutableFunctionRegistry {
functionRegistry.addAggregateFunctionFactory(new TopkDistinctAggFunctionFactory());
}
+ private void addUdtfFunctions() {
+ functionRegistry.addTableFunctionFactory(new ExplodeFunctionFactory());
+ }
+
private void addBuiltInFunction(final KsqlFunction ksqlFunction) {
addBuiltInFunction(ksqlFunction, false);
}
| [InternalFunctionRegistry->[BuiltInInitializer->[addUdafFunctions->[addAggregateFunctionFactory],addBuiltInFunction->[addFunction,addBuiltInFunction]],addFunction->[addFunction]]] | Adds functions that are not registered in the udf registry. | Are annotation based UDTFs coming later? Totally fine with that, though by the end of this process we should _only_ have annotation based UDTFs. |
@@ -169,6 +169,18 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo
return this.applicationContext == null ? null : this.applicationContext.getId();
}
+ /**
+ * @see IntegrationContextUtils#getIntegrationProperties
+ */
+ protected Properties getIntegrationProperties() {
+ if (this.beanFactory != null) {
+ return IntegrationContextUtils.getIntegrationProperties(this.beanFactory);
+ }
+ else {
+ return null;
+ }
+ }
+
@Override
public String toString() {
return (this.beanName != null) ? this.beanName : super.toString();
| [IntegrationObjectSupport->[getTaskScheduler->[getTaskScheduler],getConversionService->[getConversionService,getComponentName],toString->[toString]]] | Gets the application context id. | Maybe we can return an empty Properties here (perhaps a static constant empty props so we don't create a new one for each instance). It would save a null check everywhere that uses it. |
@@ -256,7 +256,7 @@ public final class ParserUtil {
} else if (context.HEADERS() != null) {
builder = builder.headers();
} else if (context.HEADER() != null) {
- builder = builder.header(Strings.trimToNull(unquote(context.STRING().getText(), "'")));
+ builder = builder.header(Strings.emptyToNull(unquote(context.STRING().getText(), "'")));
}
return builder.build();
| [ParserUtil->[getColumnConstraints->[unquote],getLocation->[getLocation],getIdentifierText->[getIdentifierText],sanitize->[isQuoted,unquote]]] | Gets the column constraints from a given context. | Can you trim the text after the `unquote` call? The case was that a user could use `header(' k ')`, and that key should be `k`. The `trimToNull` justs makes sure that `header(' ')` is null. |
@@ -93,6 +93,15 @@ class RaidenService(object): # pylint: disable=too-many-instance-attributes
alarm = AlarmTask(chain)
alarm.start()
+ if config['max_unresponsive_time'] != 0:
+ self.healthcheck = HealthcheckTask(
+ self,
+ config['send_ping_time'],
+ config['max_unresponsive_time']
+ )
+ self.healthcheck.start()
+ else:
+ self.healthcheck = None
self.api = RaidenAPI(self)
self.alarm = alarm
| [RaidenAPI->[transfer_async->[transfer_async,get_manager_by_asset_address,InvalidAmount,InvalidAddress,NoPathError,safe_address_decode],settle->[InvalidState,get_manager_by_asset_address,settle,InvalidAddress,safe_address_decode],deposit->[deposit,get_manager_by_asset_address,InsufficientFunds],exchange->[safe_address_decode,get_manager_by_asset_address],close->[safe_address_decode,get_manager_by_asset_address,InvalidAddress,close],expect_exchange->[get_manager_by_asset_address],open->[get_manager_by_asset_address]],RaidenMessageHandler->[message_secret->[register_secret,get_manager_by_asset_address,message_for_task],message_refundtransfer->[message_for_task],message_secretrequest->[message_for_task],message_revealsecret->[message_for_task],message_directtransfer->[get_manager_by_asset_address],message_mediatedtransfer->[get_manager_by_asset_address],message_transfertimeout->[message_for_task]],RaidenService->[sign->[sign],send_and_wait->[send_and_wait],register_secret->[register_secret],send_async->[send_async]],RaidenEventHandler->[event_channelnewbalance->[get_manager_by_asset_address],event_channelnew->[get_manager_by_address],event_channelclosed->[find_channel_by_address],event_assetadded->[register_channel_manager],event_channelsettled->[find_channel_by_address],event_channelsecretrevealed->[register_secret]]] | Initialize a raiden object. | I believe `config['max_unresponsive_time'] > 0:` would be more appropriate here. |
@@ -167,7 +167,9 @@ public class StandardStatelessDataflowFactory implements StatelessDataflowFactor
return created;
}
- created = getPropertyEncryptor(engineConfiguration.getSensitivePropsKey());
+ created = new PropertyEncryptorBuilder(engineConfiguration.getSensitivePropsKey())
+ .setAlgorithm(PropertyEncryptionMethod.NIFI_PBKDF2_AES_GCM_256.toString())
+ .build();
return created;
}
};
| [StandardStatelessDataflowFactory->[getPropertyEncryptor->[getPropertyEncryptor],createDataflow->[decrypt->[decrypt],encrypt->[encrypt]]]] | Creates a new StatelessDataflow with the given configuration. Creates a new instance of the StatelessFlowManager. Creates a new Stateless Engine and returns it. check if there is a failure to close the event repository and throw it if it is. | What do you think about making the algorithm provided by the stateless properties instead of hard coding it here? I suppose this could always be added later if we wanted to be more consistent with NiFi, and perhaps the use case is already so small for sensitive props key that hard-coding is acceptable here. However, I wanted to pose the question here. |
@@ -607,6 +607,14 @@ class FileUpload(ModelBase):
return parts[1]
return self.name
+ @property
+ def channel(self):
+ return (
+ amo.RELEASE_CHANNEL_UNLISTED
+ if self.automated_signing
+ else amo.RELEASE_CHANNEL_LISTED
+ )
+
class FileValidation(ModelBase):
id = PositiveAutoField(primary_key=True)
| [check_file->[unhide_disabled_file,hide_disabled_file],update_status->[update_status],File->[unhide_disabled_file->[move_file],hide_disabled_file->[move_file]],update_status_delete->[update_status],FileUpload->[add_file->[write_data_to_path,save],from_post->[add_file,FileUpload]]] | Returns a pretty name of the . | will be used in the addon submission api upload serializer |
@@ -299,11 +299,11 @@ func (b *localBackend) getHistory(name tokens.QName) ([]backend.UpdateInfo, erro
var updates []backend.UpdateInfo
- // os.ReadDir returns the array sorted by file name, but because of how we name files, older updates come before
+ // listBucket returns the array sorted by file name, but because of how we name files, older updates come before
// newer ones. Loop backwards so we added the newest updates to the array we will return first.
for i := len(allFiles) - 1; i >= 0; i-- {
file := allFiles[i]
- filepath := path.Join(dir, file.Name())
+ filepath := path.Join(dir, objectName(file))
// Open all of the history files, ignoring the checkpoints.
if !strings.HasSuffix(filepath, ".history.json") {
| [getHistory->[historyDirectory],addToHistory->[stackPath,historyDirectory]] | getHistory returns the update history for the given stack. | Is this needed? IIUC, `path.Join(dir, objectName(file))` == `file.Key`...? |
@@ -136,6 +136,7 @@ public class GroupByQuery extends BaseQuery<Row>
this.limitSpec.build(this.dimensions, this.aggregatorSpecs, this.postAggregatorSpecs);
if (havingSpec != null) {
+ havingSpec.setRowType(GroupByQueryHelper.rowTypeFor(this));
postProcFn = Functions.compose(
postProcFn,
new Function<Sequence<Row>, Sequence<Row>>()
| [GroupByQuery->[withDataSource->[GroupByQuery],withPostAggregatorSpecs->[getHavingSpec,getAggregatorSpecs,getDimensions,getDimFilter,getGranularity,GroupByQuery,getLimitSpec],Builder->[addOrderByColumn->[addOrderByColumn],copy->[Builder],addDimension->[addDimension],build->[GroupByQuery],getHavingSpec,getAggregatorSpecs,getPostAggregatorSpecs,getDimensions,getDimFilter,getGranularity,getLimitSpec],compareDims->[compare],compare->[compare],withOverriddenContext->[GroupByQuery],withQuerySegmentSpec->[GroupByQuery],equals->[equals],withLimitSpec->[getHavingSpec,getAggregatorSpecs,getPostAggregatorSpecs,getDimensions,getDimFilter,getGranularity,GroupByQuery],hashCode->[hashCode],applyLimit->[apply],getTimeComparator->[compare->[compare]],getResultOrdering->[compare->[compare]],withDimensionSpecs->[getHavingSpec,getAggregatorSpecs,getPostAggregatorSpecs,getDimFilter,getGranularity,GroupByQuery,getLimitSpec],withAggregatorSpecs->[getHavingSpec,getPostAggregatorSpecs,getDimensions,getDimFilter,getGranularity,GroupByQuery,getLimitSpec],getRowOrdering->[compare->[compare],getContextSortByDimsFirst],withDimFilter->[getHavingSpec,getAggregatorSpecs,getPostAggregatorSpecs,getDimensions,getGranularity,GroupByQuery,getLimitSpec]]] | Filters a sequence of rows based on a . | Moving the body of this `if` inside `applyLimit()` would allow remove all synchronization and ThreadLocals from `DimFilterHavingSpec` |
@@ -77,7 +77,7 @@ class JarLibrary(Target):
return self.payload.excludes
@property
- def exports(self):
+ def exports_targets(self):
"""
:API: public
"""
| [JarLibrary->[to_jar_dependencies->[WrongTargetTypeError,ExpectedAddressError]]] | Exports a object to the dependency graph. | I don't think you can just remove this since it's public. |
@@ -19,8 +19,16 @@ def float_to_unsigned(x):
return types.uint32(x)
-def float_to_complex(x):
- return np.complex128(x)
+def float_to_unsigned64(x):
+ return types.uint64(x)
+
+
+def float_to_unsigned16(x):
+ return np.uint16(x)
+
+
+def float_to_unsigned8(x):
+ return np.uint8(x)
class TestCasting(CUDATestCase):
| [TestCasting->[test_float_to_complex->[_create_wrapped],test_int_to_float->[_create_wrapped],test_float_to_unsigned->[_create_wrapped],test_float_to_int->[_create_wrapped]]] | float_to_complex creates a function that converts a nanomon number to a complex. | The original `float_to_complex` test seems to have been removed. |
@@ -18,11 +18,15 @@ namespace System.Diagnostics
ProxyTypeName = type.AssemblyQualifiedName!;
}
- public DebuggerTypeProxyAttribute(string typeName)
+ public DebuggerTypeProxyAttribute(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] string typeName)
{
ProxyTypeName = typeName;
}
+ // The Proxy is only invoked by the debugger, so it needs to have its
+ // members preserved
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public string ProxyTypeName { get; }
public Type? Target
| [DebuggerTypeProxyAttribute->[Struct,nameof,Class,AssemblyQualifiedName,Assembly]] | Creates a new object that represents a type that is exposed as a proxy for the debug purpose. | What does this attribute mean when used on a get-only auto-prop? |
@@ -18,6 +18,9 @@ import com.google.common.primitives.Shorts;
import com.google.common.primitives.SignedBytes;
import io.prestosql.spi.block.Block;
import io.prestosql.spi.connector.ConnectorSession;
+import io.prestosql.spi.type.ArrayType;
+import io.prestosql.spi.type.MapType;
+import io.prestosql.spi.type.RowType;
import io.prestosql.spi.type.SqlDate;
import io.prestosql.spi.type.SqlTime;
import io.prestosql.spi.type.SqlTimeWithTimeZone;
| [AbstractRowEncoder->[appendLong->[UnsupportedOperationException,format,getName],appendShort->[UnsupportedOperationException,format,getName],appendInt->[UnsupportedOperationException,format,getName],appendByte->[UnsupportedOperationException,format,getName],appendBoolean->[UnsupportedOperationException,format,getName],appendSqlTime->[UnsupportedOperationException,format,getName],appendSqlTimestampWithTimeZone->[UnsupportedOperationException,format,getName],appendDouble->[UnsupportedOperationException,format,getName],appendSqlTimeWithTimeZone->[UnsupportedOperationException,format,getName],appendColumnValue->[appendLong,appendShort,getDouble,size,checkArgument,toByteBuffer,getType,appendString,appendBoolean,appendInt,checkedCast,appendSqlTimeWithTimeZone,getLong,toStringUtf8,isNull,appendByte,appendDouble,intBitsToFloat,format,appendByteBuffer,appendSqlDate,appendSqlTimestamp,appendFloat,UnsupportedOperationException,appendSqlTime,appendSqlTimestampWithTimeZone,getName,getBoolean,getObjectValue,appendNullValue,toIntExact],appendSqlDate->[UnsupportedOperationException,format,getName],appendByteBuffer->[UnsupportedOperationException,format,getName],appendSqlTimestamp->[UnsupportedOperationException,format,getName],appendFloat->[UnsupportedOperationException,format,getName],appendNullValue->[UnsupportedOperationException,format,getName],appendString->[UnsupportedOperationException,format,getName],copyOf,requireNonNull]] | Imports a single from the Java source. Method to import all the types of the values from pre - STOSQL - SPI. | > [optional] It would be nice use it, how about insert of structural types in Avro for Kafka? Will be raising a follow up PR for implementation in Avro and JSON |
@@ -346,12 +346,13 @@ export function postMessage(iframe, type, object, targetOrigin, opt_is3P) {
* @param {!Object} object Message payload.
* @param {boolean=} opt_is3P set to true if the iframe is 3p.
*/
-export function postMessageToWindows(iframe, targets, type, object, opt_is3P) {
+export function postMessageToWindows(
+ iframe, sentinel, targets, type, object, opt_is3P) {
if (!iframe.contentWindow) {
return;
}
object.type = type;
- object.sentinel = getSentinel_(iframe, opt_is3P);
+ object.sentinel = sentinel;
let payload = object;
if (opt_is3P) {
// Serialize ourselves because that is much faster in Chrome.
| [No CFG could be retrieved] | Post a message to multiple windows with the same type. Get the sentinel string. | shall we use `serializeMessage` in `3p-iframe.js` |
@@ -159,6 +159,16 @@ bool MessageParser::skipToNextSubmessage()
return ser_.skip(static_cast<unsigned short>(sub_.submessageLength - read));
}
+bool MessageParser::skipSubmessageContent()
+{
+ if (sub_.submessageLength) {
+ const size_t read = smContentStart_ - ser_.length();
+ return ser_.skip(static_cast<unsigned short>(sub_.submessageLength - read));
+ } else {
+ return ser_.skip(static_cast<unsigned short>(ser_.length()));
+ }
+}
+
}
}
| [No CFG could be retrieved] | END OF VERSIONED NAMESPACE DEPRECATED. | Needs to handle the PAD and INFO_TS cases |
@@ -695,6 +695,7 @@ ActiveRecord::Schema.define(version: 20160722082700) do
add_foreign_key "protocols", "users", column: "restored_by_id"
add_foreign_key "report_elements", "assets"
add_foreign_key "report_elements", "checklists"
+ add_foreign_key "report_elements", "experiments"
add_foreign_key "report_elements", "my_modules"
add_foreign_key "report_elements", "projects"
add_foreign_key "report_elements", "reports"
| [string,text,binary,add_foreign_key,datetime,integer,add_index,enable_extension,create_table,boolean,define,tsvector] | foreign key columns for the table get_foreign_keys - get_foreign_keys - get_foreign_keys -. | Prefer single-quoted strings when you don't need string interpolation or special symbols. |
@@ -108,7 +108,7 @@ class MarkdownParser
next if allowed_image_host?(src)
img["loading"] = "lazy"
- img["src"] = if giphy_img?(src)
+ img["src"] = if GiphyService.new.giphy_img?(src)
src.gsub("https://media.", "https://i.")
else
img_of_size(src, width)
| [MarkdownParser->[unescape_raw_tag_in_codeblocks->[possibly_raw_tag_syntax?],escape_colon_emojis_in_codeblock->[escape_colon_emojis_in_codeblock]]] | prefix all images with a URL prefix. | What do you think about a clearer name like `Giphy::Image.valid_url?` or `Giphy::Image.valid_source?` We're trying to move away from the `XYZService` objects, for namespacing and organization purposes |
@@ -170,4 +170,12 @@ public class ErrorHandler extends AbstractMuleObjectOwner<MessagingExceptionHand
}
}
+ public void setStatistics(FlowConstructStatistics flowStatistics) {
+ for (MessagingExceptionHandlerAcceptor exceptionListener : exceptionListeners) {
+ if (exceptionListener instanceof AbstractExceptionListener) {
+ ((AbstractExceptionListener) exceptionListener).setStatistics(flowStatistics);
+ }
+ }
+ }
+
}
| [ErrorHandler->[validateOnlyLastAcceptsAll->[acceptsAll],initialise->[initialise],handleException->[handleException],setRootContainerName->[setRootContainerName],addDefaultErrorHandlerIfRequired->[acceptsAll],apply->[apply]]] | Set the root container name. | Are you certain that at this point you'll have the injected exception listeners as well? (e.g.: OnCriticalErrorHandler) |
@@ -59,6 +59,7 @@ public class ClusterUtilsTest {
.addParameter(DEFAULT_KEY_PREFIX + QUEUES_KEY, Integer.MAX_VALUE)
.addParameter(DEFAULT_KEY_PREFIX + ALIVE_KEY, Integer.MAX_VALUE)
.addParameter(DEFAULT_KEY_PREFIX + THREAD_NAME_KEY, "test")
+ .addParameter("." + Constants.ASYNC_KEY, "test")
.build();
URL consumerURL = new URLBuilder(Constants.DUBBO_PROTOCOL, "localhost", 55555)
| [ClusterUtilsTest->[testMergeUrl->[getPassword,hasParameter,build,mergeUrl,getPath,getParameters,getUsername,getParameter,setPassword,assertFalse,valueOf,assertEquals]]] | Example of how to test the merge url. Checks if the url has a key that is not default. | use something like HIDE_KEY_PREFIX instead of "."? |
@@ -444,6 +444,16 @@ class UserNotifications < ActionMailer::Base
else
I18n.t('subject_pm')
end
+
+ participants = "#{I18n.t("user_notifications.pm_participants")} "
+ participant_list = []
+ post.topic.allowed_users.each do |user|
+ participant_list.push user.username
+ end
+ post.topic.allowed_groups.each do |group|
+ participant_list.push group.name
+ end
+ participants += participant_list.join(", ")
end
if SiteSetting.private_email?
| [UserNotifications->[send_notification_email->[get_context_posts,email_post_markdown,user_locale],build_summary_for->[short_date],user_watching_first_post->[user_posted],build_user_email_token_by_template->[user_locale],digest->[short_date]]] | send_notification_email sends a user a nack - nack - nack - Checks if a user has a lease and generates a cheaper email. Email the user a message to the user who has not yet replyed to the message. Checks if a user has a key in the user preferences and if so sends an email to. | I am not sure this is correct, if `prioritize username in ux` should we not be showing "name" here, also should we make this hyperlinks to the actual user? |
@@ -1941,8 +1941,8 @@ int s_server_main(int argc, char *argv[])
if (async)
SSL_CTX_set_mode(ctx2, SSL_MODE_ASYNC);
- if (!ctx_set_verify_locations(ctx2, CAfile, CApath, noCAfile,
- noCApath)) {
+ if (!ctx_set_verify_locations(ctx2, CAfile, noCAfile, CApath,
+ noCApath, NULL, 0)) {
ERR_print_errors(bio_err);
goto end;
}
| [No CFG could be retrieved] | Assigns secondary context parameters to the current context. Reads the nec_ssl_hdr_t and nec_ssl_hdr_. | Why no store for this one? |
@@ -307,6 +307,16 @@ frappe.ui.form.Layout = Class.extend({
}
},
+ refresh_section_border: function() {
+ if (!this.doc) return;
+ this.sections.forEach(section => {
+ const df = section.df;
+ if (df && cint(df.hide_border)) {
+ section.hide_border(true);
+ }
+ });
+ },
+
attach_doc_and_docfields: function(refresh) {
var me = this;
for(var i=0, l=this.fields_list.length; i<l; i++) {
| [No CFG could be retrieved] | refresh fields refresh dependent fields refresh sections refresh sections refresh fields Attaches the docfields to the sections. | Duct tape! this is static, should not be dynamically set. |
@@ -179,9 +179,11 @@ public class TfIdf {
uriString = uri.toString();
}
- PCollection<KV<URI, String>> oneUriToLines = pipeline
- .apply("TextIO.Read(" + uriString + ")", TextIO.read().from(uriString))
- .apply("WithKeys(" + uriString + ")", WithKeys.<URI, String>of(uri));
+ PCollection<KV<URI, String>> oneUriToLines =
+ pipeline
+ .apply("TextIO.Read(" + uriString + ")", TextIO.read().from(uriString))
+ .apply("WithKeys(" + uriString + ")", WithKeys.<URI, String>of(uri))
+ .setCoder(KvCoder.of(StringDelegateCoder.of(URI.class), StringUtf8Coder.of()));
urisToLines = urisToLines.and(oneUriToLines);
}
| [TfIdf->[listInputDocuments->[getInput],main->[WriteTfIdf,getOutput]]] | Expands the sequence of URIs into a sequence of lines. | Yeah, I was thinking that the next step would be to augment ParDo, Map/FlatMapElements, and WithKeys to allow them to take a coder (coders, in case of multi-output pardo - they could go into TupleTagList perhaps). Not sure if there's a way around that. |
@@ -92,6 +92,11 @@ def prepare_order_lines_allocations_payload(line):
return warehouse_id_quantity_allocated_map
+def _charge_taxes(order_line: OrderLine) -> bool:
+ variant = order_line.variant
+ return False if not variant else variant.product.charge_taxes
+
+
def generate_order_lines_payload(lines: Iterable[OrderLine]):
line_fields = (
"product_name",
| [generate_sample_payload->[generate_product_payload,_generate_sample_order_payload,_get_sample_object,generate_fulfillment_payload,generate_customer_payload,_remove_token_from_checkout,generate_page_payload,generate_checkout_payload],generate_product_payload->[serialize_product_channel_listing_payload],_generate_sample_order_payload->[generate_order_payload,_get_sample_object],generate_list_gateways_payload->[generate_checkout_payload],generate_product_variant_payload->[generate_product_variant_media_payload,generate_product_variant_listings_payload],generate_fulfillment_payload->[generate_fulfillment_lines_payload,generate_order_payload],generate_order_lines_payload->[prepare_order_lines_allocations_payload],generate_order_payload->[generate_order_lines_payload,_generate_collection_point_payload],generate_translation_payload->[process_translation_context],generate_checkout_payload->[_generate_collection_point_payload]] | Generate order lines payload from iterable of OrderLine objects. | I would say, that here should be None instead of False. With False, external app will not be able to determine if the charge taxes is false because, variant doesn't exist or it doesn't expect charges in taxes. |
@@ -50,11 +50,6 @@ class AmpSpringboardPlayer extends AMP.BaseElement {
'The data-domain attribute is required for <amp-springboard-player> %s',
this.element);
- /** @private @const {number} */
- this.width_ = width;
- /** @private @const {number} */
- this.height_ = height;
- /** @private @const {string} */
this.mode_ = mode;
/** @private @const {number} */
this.contentId_ = contentId;
| [No CFG could be retrieved] | Callback for creating a new object of type . Creates an iframe for the player. | Dropped annotation for `this.mode_`? |
@@ -245,6 +245,11 @@ def build_arguments_parser():
required=False,
type=str
)
+ parser.add_argument(
+ '--shuffle', help="Allow shuffle annotation during creation a subset",
+ required=False,
+ type=cast_to_bool
+ )
return parser
| [print_processing_info->[upper,format,print_info,join],build_arguments_parser->[cwd,partial,ArgumentParser,add_argument],write_csv_result->[check_file_existence,upper,DictWriter,writerow,join,open,writeheader],main->[add_file_handler,print_processing_info,split,get_processing_info,process_dataset,exception,merge,get,build_arguments_parser,ValueError,from_configs,extract_metrics_results,release,exit,provide,write_csv_result],main] | Build the arguments parser for the command line. Adds command line options for a specific . Adds command line options for infer and infer metrics. This is the entry point for the command line interface. | this is not only way to generate annotation, please also update convert.py in annotation_converters |
@@ -17,7 +17,8 @@ import mne
# First let's read in the raw sample data.
data_path = mne.datasets.sample.data_path()
fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')
-raw = mne.io.read_raw_fif(fname)
+raw = mne.io.read_raw_fif(fname, add_eeg_ref=False)
+raw.set_eeg_reference()
###############################################################################
# To create time locked epochs, we first need a set of events that contain the
| [average,plot_events,plot,arange,print,find_events,data_path,plot_drop_log,epochs,read_raw_fif,join,Epochs,pick_types] | A function to create a time locked event list from a raw data file. This is a hack to allow you to create a # from a source file. | raw.set_eeg_reference() # set EEG average reference |
@@ -87,10 +87,10 @@ public class BigQueryResultPageSource
BigQuerySplit split,
List<BigQueryColumnHandle> columns)
{
- this.bigQueryStorageClient = requireNonNull(bigQueryStorageClientFactory, "bigQueryStorageClientFactory is null").createBigQueryStorageClient();
- this.split = requireNonNull(split, "split is null");
+ this.bigQueryStorageClient = bigQueryStorageClientFactory.createBigQueryStorageClient();
+ this.split = split;
this.readBytes = new AtomicLong();
- this.columnTypes = requireNonNull(columns, "columns is null").stream()
+ this.columnTypes = columns.stream()
.map(BigQueryColumnHandle::getTrinoType)
.collect(toImmutableList());
this.pageBuilder = new PageBuilder(columnTypes);
| [BigQueryResultPageSource->[AvroDecimalConverter->[parse],parse->[parse],writeSlice->[writeSlice],close->[close],writeBlock->[appendTo]]] | Creates a page source for a BigQuery page. Gets the read time of the response. | what harm did it make? Actually IMO it is better to do defensive checks during object construction unless not feasible due to perfomance reasons, even if current code structure suggest those are not necessary. Those can come up handy if we restructure the code later on, and allow to catch bugs early. |
@@ -185,11 +185,15 @@ public final class TransformTranslator {
JavaRDD<WindowedValue<KV<K, Iterable<InputT>>>> inRDD =
((BoundedDataset<KV<K, Iterable<InputT>>>) context.borrowDataset(transform)).getRDD();
+ @SuppressWarnings("unchecked")
JavaRDD<WindowedValue<KV<K, OutputT>>> outRDD =
inRDD.map(
in ->
WindowedValue.of(
- KV.of(in.getValue().getKey(), sparkCombineFn.apply(in)),
+ KV.of(
+ in.getValue().getKey(),
+ combineFn.apply(
+ in.getValue().getValue(), sparkCombineFn.ctxtForValue(in))),
in.getTimestamp(),
in.getWindows(),
in.getPane()));
| [TransformTranslator->[reshuffle->[evaluate->[reshuffle]],combinePerKey->[evaluate->[combinePerKey]],combineGlobally->[evaluate->[combineGlobally]],Translator->[translateBounded->[getTranslator]],groupByKey,parDo,readBounded,combinePerKey,window,combineGrouped,combineGlobally,createPCollView,reshuffle,flattenPColl]] | Combine grouped values. | There's a couple of these @SuppressWarnings that are actually checked -- reported by my IDE. Is it a mistake? |
@@ -6,7 +6,11 @@
<?php _e( 'Answer a short survey to let us know how we’re doing and what to add in the future.', 'jetpack' ); ?>
</div>
<div class="jp-survey-button-container">
- <p class="submit"><?php printf( '<a id="jp-survey-button" class="button-primary" target="_blank" href="%1$s">%2$s</a>', 'http://jetpack.com/survey/?rel=' . JETPACK__VERSION, __( 'Take Survey', 'jetpack' ) ); ?></p>
+ <p class="submit">
+ <a id="jp-survey-button" class="button-primary" target="_blank" rel="noopener noreferrer" href="https://jetpack.com/survey/?rel=<?php echo esc_attr( JETPACK__VERSION ); ?>">
+ <?php _e( 'Take Survey', 'jetpack' ); ?>
+ </a>
+ </p>
</div>
</div>
</div>
| [No CFG could be retrieved] | Generalized view of the jetpack s unique ID. Dodaje dane dane. | I'm not sure if removing the referrer here is needed and/or we're using it for stats. |
@@ -42,6 +42,7 @@ class Hdf5(Package):
version('1.8.13', 'c03426e9e77d7766944654280b467289')
variant('debug', default=False, description='Builds a debug version of the library')
+ variant('shared', default=False, description='Builds a static executable version of the library')
variant('cxx', default=True, description='Enable C++ support')
variant('fortran', default=True, description='Enable Fortran support')
| [Hdf5->[install->[append,validate,extend,configure,make],url_for_version->[str,Version,up_to],validate->[RuntimeError],variant,depends_on,version]] | Creates a new object from the given package. Checks if a sequence of incompatible variants have been activated at the same time. | Hi. I think the variant `shared` was not present in this particular package as hdf5 builds by default both static and shared libraries. If there's the need to disable the build of shared libraries, would it be a problem to keep `default=True` to be more consistent with other packages? |
@@ -29,7 +29,8 @@ class ActivityLogSerializer(serializers.ModelSerializer):
def get_action_label(self, obj):
log = obj.log()
- return _(u'Review note') if not hasattr(log, 'short') else log.short
+ default = ugettext(u'Review note')
+ return default if not hasattr(log, 'short') else log.short
def get_action(self, obj):
return self.get_action_label(obj).replace(' ', '-').lower()
| [ActivityLogSerializer->[get_action->[get_action_label]]] | Get action label for an object. | Deliberate change from lazy? |
@@ -515,6 +515,12 @@ export class AmpLightboxGallery extends AMP.BaseElement {
'i-amphtml-lbg-button-next', nextSlide);
const prevButton = this.buildButton_('Prev',
'i-amphtml-lbg-button-prev', prevSlide);
+
+ const input = Services.inputFor(this.win);
+ if (!input.isMouseDetected()) {
+ prevButton.classList.add('i-amphtml-screen-reader');
+ nextButton.classList.add('i-amphtml-screen-reader');
+ }
this.navControls_.appendChild(nextButton);
this.navControls_.appendChild(prevButton);
this.controlsContainer_.appendChild(this.navControls_);
| [No CFG could be retrieved] | Builds the top bar containing buttons and appends them to the container. Builds a button and appends it to the controlsContainer. | Did you test that this works properly for screen reader users using VoiceOver or TalkBack? |
@@ -61,8 +61,11 @@ namespace Content.Shared.Pulling.Systems
if (args.Puller.Owner != uid)
return;
- if (EntityManager.TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
- alerts.ClearAlert(AlertType.Pulling);
+ if (EntityManager.TryGetComponent(component.Owner, out AlertsComponent? alerts))
+ {
+ var euid = alerts.Owner;
+ _alertsSystem.ClearAlert(euid, AlertType.Pulling);
+ }
RefreshMovementSpeed(component);
}
| [SharedPullerSystem->[PullerHandlePullStarted->[ShowAlert,RefreshMovementSpeed,Pulling,TryGetComponent,Owner],PullerHandlePullStopped->[ClearAlert,RefreshMovementSpeed,Pulling,TryGetComponent,Owner],OnVirtualItemDeleted->[BlockingEntity,TryStopPull,EntityManager,Pulling],RefreshMovementSpeed->[RefreshMovementSpeedModifiers,Owner],Initialize->[Initialize],OnRefreshMovespeed->[ModifySpeed,SprintSpeedModifier,WalkSpeedModifier]]] | Handle pull stopped. | As neither `ClearAlert` nor `ShowAlert` take `AlertsComponent` as an argument, the old `TryGet` is completely unnecessary. Maybe just call `ClearAlert` directly w/o the `TryGet` (like you've done in other systems)? |
@@ -145,10 +145,13 @@ class SQUADConverter(BaseFormatConverter):
tokens.append("[SEP]" if self.support_vocab else SEP_ID)
segment_ids.append(0)
- for i in range(doc_span.length):
- split_token_index = doc_span.start + i
- tokens.append(all_doc_tokens[split_token_index])
- segment_ids.append(1)
+ try:
+ for i in range(doc_span.length):
+ split_token_index = doc_span.start + i
+ tokens.append(all_doc_tokens[split_token_index])
+ segment_ids.append(1)
+ except TypeError as e:
+ pass
tokens.append("[SEP]" if self.support_vocab else SEP_ID)
segment_ids.append(1)
input_ids = self.tokenizer.convert_tokens_to_ids(tokens) if self.support_vocab else tokens
| [SQUADConverter->[_load_examples->[_is_whitespace],convert->[_load_examples]]] | Convert the examples to a sequence of tokens. This function creates a sequence identifier and adds it to the list of annotations. | @mzuevx do you know, in which scenarious here TypeError possible? |
@@ -55,6 +55,17 @@ ActiveRecord::Schema.define(version: 20181122100307) do
t.index ["user_id"], name: "index_authorizations_on_user_id"
end
+ create_table "backup_code_configurations", force: :cascade do |t|
+ t.integer "user_id", null: false
+ t.string "encrypted_code", default: "", null: false
+ t.string "code_fingerprint", default: "", null: false
+ t.boolean "used", default: false
+ t.datetime "used_at"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["user_id", "code_fingerprint"], name: "index_bcc_on_user_id_code_fingerprint"
+ end
+
create_table "doc_auths", force: :cascade do |t|
t.bigint "user_id", null: false
t.datetime "attempted_at"
| [bigint,string,text,add_foreign_key,datetime,integer,json,enable_extension,create_table,float,boolean,index,define] | Create the table for the given agencies create table email_addresses on user_id. | The migration wants this to be unique, but the schema file doesn't have it marked as unique. Might need to rerun the migration. |
@@ -842,7 +842,8 @@ void ICraftAction::apply(InventoryManager *mgr,
count_remaining--;
// Get next crafting result
- found = getCraftingResult(inv_craft, crafted, temp, false, gamedef);
+ if (!getCraftingResult(inv_craft, crafted, temp, false, gamedef))
+ break;
PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv);
found = !crafted.empty();
}
| [getline->[deSerialize],apply->[serialize,apply,dump],getCraftingResult->[deSerialize],deSerialize->[deSerialize]] | crafting action. Get next crafting result craft_inv is the item that was crafted. | Are you sure you don't want item_CraftPredict to run if getCraftingResult fails? Maybe there's a reason for this peculiar behavior. |
@@ -55,7 +55,6 @@ public class ShamrockAugmentor {
public BuildResult run() throws Exception {
long time = System.currentTimeMillis();
log.info("Beginning shamrock augmentation");
- ClassLoader old = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
BuildChainBuilder chainBuilder = BuildChain.builder()
| [ShamrockAugmentor->[Builder->[build->[ShamrockAugmentor]]]] | This method is invoked by the build framework when it is responsible for building the build chain. | Hmmm, wondering if we should restore the old class loader at the end of the operation. @stuartwdouglas thoughts? |
@@ -944,6 +944,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
if(KILL_AFTER_LOAD)
+ // TODO cleanUp?
System.exit(0);
setupWizard = new SetupWizard();
| [Jenkins->[getAllItems->[getAllItems],getUser->[get],_cleanUpShutdownTcpSlaveAgent->[add],setNumExecutors->[updateComputerList],getPlugin->[getPlugin],_cleanUpCloseDNSMulticast->[add],getViewActions->[getActions],getJDK->[getJDKs],setViews->[addView],getCloud->[getByName],getStaplerFallback->[getPrimaryView],getStoredVersion->[getActiveInstance],getViews->[getViews],doDoFingerprintCheck->[isUseCrumbs],deleteView->[deleteView],_cleanUpInterruptReloadThread->[add],doConfigSubmit->[save,updateComputerList],CloudList->[onModified->[onModified]],doCheckDisplayName->[isNameUnique,isDisplayNameUnique],_cleanUpPersistQueue->[save,add],reload->[loadTasks,save,reload,executeReactor],doConfigExecutorsSubmit->[all,get,updateComputerList],DescriptorImpl->[getDynamic->[getDescriptor],DescriptorImpl],_cleanUpShutdownThreadPoolForLoad->[add],isDisplayNameUnique->[getDisplayName],_cleanUpRunTerminators->[onTaskFailed->[getDisplayName],execute->[run],onTaskCompleted->[getDisplayName],onTaskStarted->[getDisplayName],add],getJobNames->[getFullName,allItems,add],doChildrenContextMenu->[add,getViews,getDisplayName],doLogout->[doLogout],getActiveInstance->[getInstance],getNode->[getNode],copy->[copy],updateNode->[updateNode],doSubmitDescription->[doSubmitDescription],doCheckURIEncoding->[doCheckURIEncoding],getItem->[getItem,get],doViewExistsCheck->[getView],getUnprotectedRootActions->[getActions,add],setAgentProtocols->[add],allItems->[allItems],disableSecurity->[setSecurityRealm],onViewRenamed->[onViewRenamed],getDescriptorByName->[getDescriptor],loadConfig->[getConfigFile],refreshExtensions->[getInstance,add,getExtensionList],getRootPath->[getRootDir],getView->[getView],putItem->[get],_cleanUpShutdownTimer->[add],_cleanUpDisconnectComputers->[run->[add]],getAllThreadDumps->[get,getComputers],createProject->[createProject,getDescriptor],MasterComputer->[doConfigSubmit->[doConfigExecutorsSubmit],hasPermission->[hasPermission],getInstance],createProjectFromXML->[createProjectFromXML],getAgentProtocols->[add],doScript->[getView,getACL],_cleanUpReleaseAllLoggers->[add],isRootUrlSecure->[getRootUrl],EnforceSlaveAgentPortAdministrativeMonitor->[doAct->[forceSetSlaveAgentPort,getExpectedPort],isActivated->[getSlaveAgentPortInitialValue,getInstance],getExpectedPort->[getSlaveAgentPortInitialValue]],setSecurityRealm->[get],getItems->[getItems,add],doCheckViewName->[getView,checkGoodName],removeNode->[removeNode],getSelfLabel->[getLabelAtom],fireBeforeShutdown->[all,add],doSimulateOutOfMemory->[add],expandVariablesForDirectory->[expandVariablesForDirectory,getFullName],_getFingerprint->[get],getManagementLinks->[all],addView->[addView],getPlugins->[getPlugin,getPlugins,add],save->[getConfigFile],getPrimaryView->[getPrimaryView],getDescriptorList->[get],makeSearchIndex->[all->[getViews],get->[getView],makeSearchIndex,add],getNodes->[getNodes],lookup->[get,getInstanceOrNull],getLegacyInstanceId->[getSecretKey],_cleanUpShutdownUDPBroadcast->[add],saveQuietly->[save],getLifecycle->[get],getInstanceOrNull->[getInstance],executeReactor->[containsLinkageError->[containsLinkageError],runTask->[runTask]],setNodes->[setNodes],loadTasks->[run->[setSecurityRealm,getExtensionList,getNodes,setNodes,remove,add,loadConfig],add],remove->[remove],getDescriptorOrDie->[getDescriptor],getLabelAtoms->[add],getItemByFullName->[getItemByFullName,getItem],doCreateView->[addView],getExtensionList->[get,getExtensionList],getLabels->[add],restart->[get],isNameUnique->[getItem],getWorkspaceFor->[all],_cleanUpShutdownPluginManager->[add],getRootDirFor->[getRootDirFor,getRootDir],canDelete->[canDelete],getInstance->[getInstance],getFingerprint->[get],getAuthentication->[getAuthentication],doScriptText->[getView,getACL],getDynamic->[getActions],_cleanUpPluginServletFilters->[cleanUp,add],_cleanUpShutdownTriggers->[add],addNode->[addNode],getTopLevelItemNames->[add],MasterRestartNotifyier->[onRestart->[all]],doQuietDown->[doQuietDown],safeRestart->[get],updateComputerList->[updateComputerList],rebuildDependencyGraphAsync->[call->[get,rebuildDependencyGraph]],_cleanUpAwaitDisconnects->[get,add],readResolve->[getSlaveAgentPortInitialValue],getName]] | The last marker in the list of possible markers. Initializes the key milestones and the plugin manager. | I doubt it is really required since running with this flag on a production instance is a quite exotic idea, no? |
@@ -54,7 +54,7 @@ class PathInfo(pathlib.PurePath, _BasePath):
return relpath(path)
def __repr__(self):
- return builtin_str("{}: '{}'").format(type(self).__name__, self)
+ return str("{}: '{}'").format(type(self).__name__, self)
# This permits passing it to file utils directly in Python 3.6+
# With Python 2.7, Python 3.5+ we are stuck with path_info.fspath for now
| [PathInfo->[relpath->[relpath],fspath->[__fspath__],__fspath__->[__str__]],URLInfo->[parents->[_URLPathParents],isin->[isin],_path->[_URLPathInfo],__div__->[replace],from_parts->[__new__],parent->[replace],replace->[from_parts],relative_to->[relative_to]],_URLPathInfo->[__str__->[__fspath__]]] | Return a string representation of the object. | This `str("")` has no sense |
@@ -16,15 +16,14 @@ from ._models import (
Metrics,
RetentionPolicy, TableAnalyticsLogging, TableSasPermissions, CorsRule, UpdateMode, SASProtocol, Table,
)
-from ._shared.models import (
+from ._models import (
LocationMode,
ResourceTypes,
AccountSasPermissions,
- TableErrorCode
)
-from ._shared.policies import ExponentialRetry, LinearRetry
+from ._policies import ExponentialRetry, LinearRetry
from ._version import VERSION
-
+from ._deserialize import TableErrorCode
__version__ = VERSION
__all__ = [
| [No CFG could be retrieved] | Creates a new object of type u_nsp_access_signature from a given base. | nit: Is `TableErrorCode` something that users will use? I'm going with yes, since it's in this init file. Based on that, I think it might be better to have it in the _models file, the general rule of thumb I operate under is that file contains the user exposed models |
@@ -1587,7 +1587,7 @@ class Contact extends BaseObject
return '';
}
- if (in_array($contact["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, ""])) {
+ if (in_array($contact["network"], array_merge(Protocol::FEDERATED ,['']))) {
$sql = "(`item`.`uid` = 0 OR (`item`.`uid` = ? AND NOT `item`.`global`))";
} else {
$sql = "`item`.`uid` = ?";
| [Contact->[getPostsFromUrl->[getStart,getItemsPerPage,renderMinimal],createFromProbe->[getHostName,getURLPath,internalRedirect]]] | Get posts from a URL if user has not posted yet. | Why the empty element? |
@@ -38,13 +38,17 @@ purpose and non-infringement.
*/
#endregion License
+#if !AGENT
using Microsoft.Xna.Framework;
using System;
using System.Runtime.Serialization;
+#endif
namespace Microsoft.Xna.Framework.Graphics
{
+#if !AGENT
[DataContract]
+#endif
public struct Viewport
{
/// <summary>
| [Viewport->[ToString->[Format],Vector3->[Multiply,X,Height,Transform,Invert,WithinEpsilon,MaxDepth,M34,Y,M24,Z,MinDepth,M14,Width,M44],WithinEpsilon->[Epsilon],x,height,maxDepth,X,Height,y,Y,minDepth,Width,width]] | region Public Methods set - A set of data members that can be used to store the number of blocks. | What is the issue with DataContract? I am wondering if you can just implement your own dummy DataContractAttribute that does nothing. That would allow you to revert these #ifs. |
@@ -546,8 +546,8 @@ class SetupPy(Task):
return out
elif isinstance(input, list):
return [convert(element) for element in input]
- elif isinstance(input, string):
- return to_bytes(input)
+ elif PY2 and isinstance(input, str):
+ return input.encode('utf-8')
else:
return input
| [TargetAncestorIterator->[iter_target_siblings_and_ancestors->[iter_siblings_and_ancestors->[iter_siblings_and_ancestors,iter_targets_in_spec_path],iter_siblings_and_ancestors]],SetupPy->[write_setup->[convert->[convert],find_packages,_setup_boilerplate,install_requires,iter_entry_points,convert],write_contents->[write_target->[write_target_source],is_resources_target,is_python_target,write_target],find_packages->[declares_namespace_package,nearest_subpackage,iter_files],DependencyCalculator->[dependencies->[is_exported],is_exported->[has_provides],requires_export->[is_python_target,is_resources_target]],has_provides->[is_python_target],install_requires->[has_provides,is_requirements],execute->[is_exported_python_target->[has_provides],create->[create_setup_py,is_exported_python_target,create],SetupPyRunner,is_exported_python_target,create],create_setup_py->[write_contents,write_setup,reduced_dependencies,DependencyCalculator],declares_namespace_package->[walk]],ExportedTargetDependencyCalculator->[reduced_dependencies->[collect_potentially_owned_python_targets->[is_exported],collect_reduced_dependencies->[requires_export],UnExportedError,_walk,is_exported,AmbiguousOwnerError,iter_target_siblings_and_ancestors,requires_export,_closure,NoOwnerError],_walk->[walk->[walk,dependencies],walk],_closure->[_walk],__init__->[TargetAncestorIterator]]] | Write the setup. py file of a target. Print out a magic number of the n - ary file. | If Py3, keep as unicode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.