hash stringlengths 40 40 | diff stringlengths 131 26.7k | message stringlengths 7 694 | project stringlengths 5 67 | split stringclasses 1 value | diff_languages stringlengths 2 24 |
|---|---|---|---|---|---|
6c50b15a273d29dc3820b5e4d50d78eeb113d335 | diff --git a/errors.go b/errors.go
index <HASH>..<HASH> 100644
--- a/errors.go
+++ b/errors.go
@@ -85,10 +85,8 @@ func HandleExitCoder(err error) {
}
if multiErr, ok := err.(MultiError); ok {
- for _, merr := range multiErr.Errors {
- fmt.Fprintln(ErrWriter, merr)
- }
- OsExiter(1)
+ code := handleMultiError(multiErr)
+ OsExiter(code)
return
}
@@ -97,3 +95,18 @@ func HandleExitCoder(err error) {
}
OsExiter(1)
}
+
+func handleMultiError(multiErr MultiError) int {
+ code := 1
+ for _, merr := range multiErr.Errors {
+ if multiErr2, ok := merr.(MultiError); ok {
+ code = handleMultiError(multiErr2)
+ } else {
+ fmt.Fprintln(ErrWriter, merr)
+ if exitErr, ok := merr.(ExitCoder); ok {
+ code = exitErr.ExitCode()
+ }
+ }
+ }
+ return code
+} | Exit with the code of ExitCoder if exists | urfave_cli | train | go |
125b421e07bed18576df926e11f8d27b67a7bc61 | diff --git a/events/facebookEvents.js b/events/facebookEvents.js
index <HASH>..<HASH> 100644
--- a/events/facebookEvents.js
+++ b/events/facebookEvents.js
@@ -21,6 +21,10 @@ function saveFacebookEvents(eventsWithVenues, row, grpIdx) {
if (!row.location) {
return;
}
+ if (!row.end_time){
+ //TODO : add more sanitization checks for end_time
+ row.end_time = utils.localTime(row.start_time).add(2, 'hours').toISOString();
+ }
eventsWithVenues.push({
id: row.id,
name: row.name, | fix(facebook) added null check for end_time | webuildorg_webuild-repos | train | js |
290166ac4129bc4a7145dcbe44b8c46e36f3fa56 | diff --git a/core-bundle/contao/dca/tl_article.php b/core-bundle/contao/dca/tl_article.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/dca/tl_article.php
+++ b/core-bundle/contao/dca/tl_article.php
@@ -687,7 +687,7 @@ class tl_article extends Backend
$arrSections = array_merge($arrSections, $arrCustom);
}
- return array_unique($arrSections);
+ return array_values(array_unique($arrSections));
} | [Core] Correctly assign articles to columns (see #<I>) | contao_contao | train | php |
275241caf6b09938a5adc6971d6cca0d7b06c700 | diff --git a/lib/vagrant/vm.rb b/lib/vagrant/vm.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/vm.rb
+++ b/lib/vagrant/vm.rb
@@ -49,11 +49,11 @@ module Vagrant
@logger.info("Loading guest: #{guest}")
if guest.is_a?(Class)
- raise Errors::VMGuestError, :_key => :invalid_class, :system => guest.to_s if !(guest <= Guest::Base)
+ raise Errors::VMGuestError, :_key => :invalid_class, :guest => guest.to_s if !(guest <= Guest::Base)
@guest = guest.new(self)
elsif guest.is_a?(Symbol)
guest_klass = Vagrant.guests.get(guest)
- raise Errors::VMGuestError, :_key => :unknown_type, :system => guest.to_s if !guest_klass
+ raise Errors::VMGuestError, :_key => :unknown_type, :guest => guest.to_s if !guest_klass
@guest = guest_klass.new(self)
else
raise Errors::VMGuestError, :unspecified | fix interpolation error in VMGuestError strings | hashicorp_vagrant | train | rb |
7c3af781ec1ad2e1c04a2b203fec0ff23f7bde76 | diff --git a/includes/functions/functions_mediadb.php b/includes/functions/functions_mediadb.php
index <HASH>..<HASH> 100644
--- a/includes/functions/functions_mediadb.php
+++ b/includes/functions/functions_mediadb.php
@@ -923,7 +923,7 @@ function get_media_folders() {
$entry = $dir->read();
if (!$entry)
break;
- if (is_dir($currentFolder . $entry . "/")) {
+ if (is_dir($currentFolder . $entry)) {
// Weed out some folders we're not interested in
if ($entry != "." && $entry != ".." && $entry != "CVS" && $entry != ".svn") {
if ($currentFolder . $entry . "/" != $MEDIA_DIRECTORY . "thumbs/") { | FIX: is_dir() gives error with badly-formed directories when open_basedir is in effect. | fisharebest_webtrees | train | php |
1691baae726c261ce7d15a38cb07d1093ad268e2 | diff --git a/lib/gscraper/version.rb b/lib/gscraper/version.rb
index <HASH>..<HASH> 100644
--- a/lib/gscraper/version.rb
+++ b/lib/gscraper/version.rb
@@ -20,5 +20,5 @@
module GScraper
# The version of GScraper
- VERSION = '0.3.1'
+ VERSION = '0.4.0'
end | Version bump to <I>. | postmodern_gscraper | train | rb |
3f96fcd77db86e0b30388ace1da40d8acbeb0e78 | diff --git a/tests/letter_tests.py b/tests/letter_tests.py
index <HASH>..<HASH> 100644
--- a/tests/letter_tests.py
+++ b/tests/letter_tests.py
@@ -94,7 +94,7 @@ class Letters(unittest.TestCase):
c = []
for i,b_w in enumerate(b):
w = utf8.join_letters_elementary(b_w)
- print u"%s"%w
+ print(u"%s"%w)
c.append(w)
d = map( len, b )
self.assertEqual([8,6,6],d) | PYTHON3 bugbear in tests | Ezhil-Language-Foundation_open-tamil | train | py |
f214bd9637fd7bbd114994c4c2418a9ca37390d7 | diff --git a/packages/ssr/src/lib/run-client.js b/packages/ssr/src/lib/run-client.js
index <HASH>..<HASH> 100644
--- a/packages/ssr/src/lib/run-client.js
+++ b/packages/ssr/src/lib/run-client.js
@@ -32,9 +32,7 @@ const makeClient = options => {
if (typeof window !== "undefined" && window.nuk) {
const acsTnlCookie = window.nuk.getCookieValue("acs_tnl");
const sacsTnlCookie = window.nuk.getCookieValue("sacs_tnl");
- if (acsTnlCookie && sacsTnlCookie) {
- networkInterfaceOptions.headers.Authorization = `Cookie acs_tnl=${acsTnlCookie};sacs_tnl=${sacsTnlCookie}`;
- }
+ networkInterfaceOptions.headers.Authorization = `Cookie acs_tnl=${acsTnlCookie};sacs_tnl=${sacsTnlCookie}`;
}
return new ApolloClient({ | fix: revert cookie pagination fix (#<I>) | newsuk_times-components | train | js |
861b11d0983fdf56d4a8596efadae2b63f4a1da9 | diff --git a/modules/core/bundle/index.js b/modules/core/bundle/index.js
index <HASH>..<HASH> 100644
--- a/modules/core/bundle/index.js
+++ b/modules/core/bundle/index.js
@@ -3,13 +3,16 @@ const LumaGL = require('./lumagl');
const deckGLCore = require('../src');
const DeckGL = require('./deckgl').default;
+const {registerLoaders, load, parse} = require('@loaders.gl/core');
/* global window, global */
const _global = typeof window === 'undefined' ? global : window;
_global.deck = _global.deck || {};
_global.luma = _global.luma || {};
+_global.loaders = _global.loaders || {};
Object.assign(_global.deck, deckGLCore, {DeckGL});
Object.assign(_global.luma, LumaGL);
+Object.assign(_global.loaders, {registerLoaders, load, parse});
module.exports = _global.deck; | Expose loaders.gl endpoints from the core bundle (#<I>) | uber_deck.gl | train | js |
ab260f15cae94c6802c2f2769fb448ad213b79cd | diff --git a/tensorflow_probability/python/experimental/mcmc/diagonal_mass_matrix_adaptation.py b/tensorflow_probability/python/experimental/mcmc/diagonal_mass_matrix_adaptation.py
index <HASH>..<HASH> 100644
--- a/tensorflow_probability/python/experimental/mcmc/diagonal_mass_matrix_adaptation.py
+++ b/tensorflow_probability/python/experimental/mcmc/diagonal_mass_matrix_adaptation.py
@@ -293,7 +293,8 @@ def _make_momentum_distribution(running_variance_parts, state_parts,
running_variance_rank = ps.rank(variance_part)
state_rank = ps.rank(state_part)
# Pad dimensions and tile by multiplying by tf.ones to add a batch shape
- ones = tf.ones(ps.shape(state_part)[:-(state_rank - running_variance_rank)])
+ ones = tf.ones(ps.shape(state_part)[:-(state_rank - running_variance_rank)],
+ dtype=variance_part.dtype)
ones = bu.left_justified_expand_dims_like(ones, state_part)
variance_tiled = variance_part * ones
reinterpreted_batch_ndims = state_rank - batch_ndims - 1 | Add missing dtype in `diagonal_mass_matrix_adaptation` | tensorflow_probability | train | py |
167a65a0a174fc323d17aa357249075eccbb09b3 | diff --git a/nitro.js b/nitro.js
index <HASH>..<HASH> 100644
--- a/nitro.js
+++ b/nitro.js
@@ -542,7 +542,6 @@ var defcat = 'all';
try {
var config = require('./config.json');
- download_history = giUtils.downloadHistory(config.download_history);
host = config.nitro.host;
api_key = config.nitro.api_key;
mediaSet = config.nitro.mediaset;
@@ -672,6 +671,10 @@ options.on('run',function(argv,options){
});
var o = options.parseSystem();
+if (!showAll && config.download_history) {
+ download_history = giUtils.downloadHistory(config.download_history);
+}
+
if (partner_pid) {
query.add(api.fProgrammesPartnerPid,partner_pid)
.add(api.mProgrammesAvailability) | nitro; only load download_history if needed | MikeRalphson_bbcparse | train | js |
f0d2f82dae373632e1f6e7b982f95fa2f99effe6 | diff --git a/fsquery/fsquery.py b/fsquery/fsquery.py
index <HASH>..<HASH> 100644
--- a/fsquery/fsquery.py
+++ b/fsquery/fsquery.py
@@ -67,6 +67,22 @@ class FSNode :
if r.search(line) :
return True
return False
+
+ def get_child(self,pat) :
+ if not self.isdir() : raise Exception("FSQuery tried to get a child in a node which is not a directory : %s" % self.abs)
+ r = re.compile(pat)
+ for c in self.children() :
+ if r.search(c.basename()) : return c
+ return False
+
+ def contains_file(self,pat) :
+ if not self.isdir() : raise Exception("FSQuery tried to check filenames in a node which is not a directory : %s" % self.abs)
+ c = self.get_child(pat)
+ if c : return True
+ else : return False
+
+ def get_parent(self) :
+ return FSNode(os.path.dirname(self.abs),self.root,self.depth-1)
def clone(self,new_root) :
return FSNode(new_root+"/"+self.relative(),new_root,self.depth) | added git_child and get_parent functionality to FSNode | interstar_FSQuery | train | py |
4ae2065e9204d39f8ab16df9e6b6b6b187220f87 | diff --git a/lib/chewy/config.rb b/lib/chewy/config.rb
index <HASH>..<HASH> 100644
--- a/lib/chewy/config.rb
+++ b/lib/chewy/config.rb
@@ -112,6 +112,7 @@ module Chewy
def configuration
yaml_settings.merge(settings.deep_symbolize_keys).tap do |configuration|
configuration[:logger] = transport_logger if transport_logger
+ configuration[:indices_path] = indices_path if indices_path
configuration.merge!(tracer: transport_tracer) if transport_tracer
end
end | Use default indices_path path (#<I>)
Once I run `rake chewy:reset` it raised an error with:
```
TypeError: no implicit conversion of nil into String
```
Once I set `indices_path` in a chewy.yml file then this issue was solved.
Since this change now `indices_path` used by default, so you don't need to set it through chewy.yml. | toptal_chewy | train | rb |
528287066c875f5851df424d99ddaf65f8cfaa91 | diff --git a/utils/loggers.py b/utils/loggers.py
index <HASH>..<HASH> 100644
--- a/utils/loggers.py
+++ b/utils/loggers.py
@@ -1,7 +1,7 @@
import logging
-LOG_NAMES = ['webant', 'fsdb', 'presets', 'agherant', 'config_utils', 'libreantdb', 'archivant', 'users']
+LOG_NAMES = ['webant', 'fsdb', 'presets', 'agherant', 'config_utils', 'libreantdb', 'archivant', 'users', 'werkzeug']
def initLoggers(logLevel=logging.INFO, logNames=LOG_NAMES): | added werkzeug to handled loggers | insomnia-lab_libreant | train | py |
fce7424bebfe2b22677a9909a846535296be1805 | diff --git a/blog/locallib.php b/blog/locallib.php
index <HASH>..<HASH> 100644
--- a/blog/locallib.php
+++ b/blog/locallib.php
@@ -117,7 +117,7 @@ class blog_entry {
$this->summary = file_rewrite_pluginfile_urls($this->summary, 'pluginfile.php', SYSCONTEXTID, 'blog', 'post', $this->id);
$options = array('overflowdiv'=>true);
- $template['body'] = format_text($this->summary, $this->summaryformat, $options).$cmttext;
+ $template['body'] = format_text($this->summary, $this->summaryformat, $options);
$template['title'] = format_string($this->subject);
$template['userid'] = $user->id;
$template['author'] = fullname($user);
@@ -307,6 +307,9 @@ class blog_entry {
$contentcell->text .= '</div>';
}
+ //add comments under everything
+ $contentcell->text .= $cmttext;
+
$mainrow->cells[] = $contentcell;
$table->data = array($mainrow); | MDL-<I> moved blog comments to end of body of blog entry. we now see the entire blog entry without comments in the way. | moodle_moodle | train | php |
112b4a88a0cb8ffa3cc8b7c1b7e4117f7124ef01 | diff --git a/src/shared/js/ch.Popover.js b/src/shared/js/ch.Popover.js
index <HASH>..<HASH> 100644
--- a/src/shared/js/ch.Popover.js
+++ b/src/shared/js/ch.Popover.js
@@ -401,7 +401,6 @@
timeOut,
events;
-
function hide(event) {
if (event.target !== that._el && event.target !== that.$container[0]) {
that.hide(); | #<I> Move private functions inside the closable scope. | mercadolibre_chico | train | js |
61d0494659e154e722d039757117719b928bef70 | diff --git a/calendar-bundle/src/Resources/contao/classes/Events.php b/calendar-bundle/src/Resources/contao/classes/Events.php
index <HASH>..<HASH> 100644
--- a/calendar-bundle/src/Resources/contao/classes/Events.php
+++ b/calendar-bundle/src/Resources/contao/classes/Events.php
@@ -281,6 +281,8 @@ abstract class Events extends \Module
{
$arrEvent['teaser'] = \StringUtil::toHtml5($arrEvent['teaser']);
}
+
+ $arrEvent['teaser'] = \StringUtil::encodeEmail($arrEvent['teaser']);
}
// Display the "read more" button for external/article links | [Calendar] Encode e-mail addresses in the event teaser. | contao_contao | train | php |
0cbed52a3ba91259369b7b6ed6f2b34dd35b4844 | diff --git a/server/camlistored/ui/blob_item_container_react.js b/server/camlistored/ui/blob_item_container_react.js
index <HASH>..<HASH> 100644
--- a/server/camlistored/ui/blob_item_container_react.js
+++ b/server/camlistored/ui/blob_item_container_react.js
@@ -379,7 +379,8 @@ cam.BlobItemContainerReact = React.createClass({
// NOTE: This method causes the URL bar to throb for a split second (at least on Chrome), so it should not be called constantly.
updateHistory_: function() {
- this.props.history.replaceState(cam.object.extend(this.props.history.state, {scroll:this.state.scroll}));
+ // second argument (title) is ignored on Firefox, but not optional.
+ this.props.history.replaceState(cam.object.extend(this.props.history.state, {scroll:this.state.scroll}), '');
},
fillVisibleAreaWithResults_: function() { | UI: add title arg to history.replaceState
According to
<URL> argument is ignored. However, in the chrome console
I'm getting
Uncaught TypeError: Failed to execute 'replaceState' on 'History': 2 arguments required, but only 1 present.
errors so I figure it's worth fixing.
Change-Id: I6b<I>a<I>c<I>c<I>b<I>e7df9b8acb | perkeep_perkeep | train | js |
16d4fb7e52c54b7de684a6da59fe98af9c1ae001 | diff --git a/pkg/apis/rbac/helpers.go b/pkg/apis/rbac/helpers.go
index <HASH>..<HASH> 100644
--- a/pkg/apis/rbac/helpers.go
+++ b/pkg/apis/rbac/helpers.go
@@ -147,6 +147,10 @@ func (r PolicyRule) String() string {
func (r PolicyRule) CompactString() string {
formatStringParts := []string{}
formatArgs := []interface{}{}
+ if len(r.APIGroups) > 0 {
+ formatStringParts = append(formatStringParts, "APIGroups:%q")
+ formatArgs = append(formatArgs, r.APIGroups)
+ }
if len(r.Resources) > 0 {
formatStringParts = append(formatStringParts, "Resources:%q")
formatArgs = append(formatArgs, r.Resources)
@@ -159,10 +163,6 @@ func (r PolicyRule) CompactString() string {
formatStringParts = append(formatStringParts, "ResourceNames:%q")
formatArgs = append(formatArgs, r.ResourceNames)
}
- if len(r.APIGroups) > 0 {
- formatStringParts = append(formatStringParts, "APIGroups:%q")
- formatArgs = append(formatArgs, r.APIGroups)
- }
if len(r.Verbs) > 0 {
formatStringParts = append(formatStringParts, "Verbs:%q")
formatArgs = append(formatArgs, r.Verbs) | Display apiGroups before resources in PolicyRule | kubernetes_kubernetes | train | go |
6e4a148c12d3037d62924bf54c3de0db2355b86d | diff --git a/Form/Type/StatusType.php b/Form/Type/StatusType.php
index <HASH>..<HASH> 100644
--- a/Form/Type/StatusType.php
+++ b/Form/Type/StatusType.php
@@ -15,7 +15,7 @@ class StatusType extends AbstractType
unset($choices[0]);
$resolver->setDefaults(array(
- 'choices' => TicketMessage::$choices,
+ 'choices' => $choices,
));
} | fix typo: $choices isn't a property of TicketMessage | hackzilla_ticket-message | train | php |
397249d3806ccde1ee021f320146ec82e98201b6 | diff --git a/bcbio/variation/phasing.py b/bcbio/variation/phasing.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/phasing.py
+++ b/bcbio/variation/phasing.py
@@ -28,7 +28,9 @@ def read_backed_phasing(vcf_file, bam_files, genome_file, region, config):
params = ["-T", "ReadBackedPhasing",
"-R", genome_file,
"--variant", vcf_file,
- "--out", tx_out_file]
+ "--out", tx_out_file,
+ "--downsample_to_coverage", "250",
+ "--downsampling_type", "BY_SAMPLE"]
for bam_file in bam_files:
params += ["-I", bam_file]
variant_regions = config["algorithm"].get("variant_regions", None) | Downsample by default for phasing to avoid slowdowns in deeply covered regions | bcbio_bcbio-nextgen | train | py |
5764899632d0b4a008d60442b92e6625398be22d | diff --git a/angr/analyses/cfg.py b/angr/analyses/cfg.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/cfg.py
+++ b/angr/analyses/cfg.py
@@ -2558,6 +2558,7 @@ class CFG(Analysis, CFGBase):
return self._immediate_dominators(end, target_graph=target_graph, reverse_graph=True)
def __setstate__(self, s):
+ self.project = s['project']
self._graph = s['graph']
self._function_manager = s['function_manager']
self._loop_back_edges = s['_loop_back_edges']
@@ -2570,6 +2571,7 @@ class CFG(Analysis, CFGBase):
def __getstate__(self):
s = { }
+ s['project'] = self.project
s['graph'] = self._graph
s['function_manager'] = self._function_manager
s['_loop_back_edges'] = self._loop_back_edges | CFG: dump self.projects when pickling CFGs. | angr_angr | train | py |
777c6ebdceed06c2679f2e09c66c007dbc2c68e4 | diff --git a/proso_concepts/models.py b/proso_concepts/models.py
index <HASH>..<HASH> 100644
--- a/proso_concepts/models.py
+++ b/proso_concepts/models.py
@@ -257,7 +257,7 @@ class UserStatManager(models.Manager):
environment = get_environment()
mastery_threshold = get_mastery_trashold()
for user, concepts in concepts.items():
- all_items = set(flatten([items[c] for c in concepts]))
+ all_items = list(set(flatten([items[c] for c in concepts])))
answer_counts = dict(list(zip(all_items, environment.number_of_answers_more_items(all_items, user))))
correct_answer_counts = dict(list(zip(all_items,
environment.number_of_correct_answers_more_items(all_items, user)))) | concepts - for sqlite - give list to environment instead of set | adaptive-learning_proso-apps | train | py |
61a5037a504472448663870fd752be39bfb8ddf5 | diff --git a/app/templates/src/main/java/package/domain/_User.java b/app/templates/src/main/java/package/domain/_User.java
index <HASH>..<HASH> 100644
--- a/app/templates/src/main/java/package/domain/_User.java
+++ b/app/templates/src/main/java/package/domain/_User.java
@@ -57,8 +57,8 @@ public class User implements Serializable {
<% if (databaseType == 'sql') { %>@JsonIgnore
@OneToMany(mappedBy = "user")<% } %><% if (hibernateCache != 'no' && databaseType == 'sql') { %>
- @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
- private Set<PersistentToken> persistentTokens;<% } %>
+ @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)<% } %>
+ private Set<PersistentToken> persistentTokens;
public String getLogin() {
return login; | The field should be present independent to hibernateCache fixes #<I> | jhipster_generator-jhipster | train | java |
13d4d984d0393ddc01471b2202b1e6fc3b66a267 | diff --git a/src/notebook/epics/github-publish.js b/src/notebook/epics/github-publish.js
index <HASH>..<HASH> 100644
--- a/src/notebook/epics/github-publish.js
+++ b/src/notebook/epics/github-publish.js
@@ -40,7 +40,6 @@ export function notifyUser(filename, gistID, notificationSystem) {
},
});
}
-// give these module scope to allow overwriting of metadata
/**
* Callback function to be used in publishNotebookObservable such that the | chore(publish): Remove extraneous comment | nteract_nteract | train | js |
7cd413a402e86d10b5fa4c11d6666423f83cd93a | diff --git a/graylog2-server/src/main/java/org/graylog2/rest/resources/streams/StreamResource.java b/graylog2-server/src/main/java/org/graylog2/rest/resources/streams/StreamResource.java
index <HASH>..<HASH> 100644
--- a/graylog2-server/src/main/java/org/graylog2/rest/resources/streams/StreamResource.java
+++ b/graylog2-server/src/main/java/org/graylog2/rest/resources/streams/StreamResource.java
@@ -88,6 +88,7 @@ public class StreamResource extends RestResource {
streamData.put("created_at", new DateTime(DateTimeZone.UTC));
StreamImpl stream = new StreamImpl(streamData, core);
+ stream.pause();
String id;
try {
stream.save();
@@ -368,6 +369,7 @@ public class StreamResource extends RestResource {
streamData.put("created_at", new DateTime(DateTimeZone.UTC));
StreamImpl stream = new StreamImpl(streamData, core);
+ stream.pause();
String id;
try {
stream.save(); | Newly created (or cloned) streams are paused now
Fixes #<I> | Graylog2_graylog2-server | train | java |
6e2df6a17c52f042d78012de4820219ab7b849bb | diff --git a/lib/resourceful/resource.js b/lib/resourceful/resource.js
index <HASH>..<HASH> 100644
--- a/lib/resourceful/resource.js
+++ b/lib/resourceful/resource.js
@@ -753,7 +753,7 @@ Resource.timestamps = function () {
//
// The last time the resource was accessed
//
- this.property('atime', 'number', { format: "unix-time", private: true });
+ // TODO: this.property('atime', 'number', { format: "unix-time", private: true });
};
Resource.define = function (schema) { | [minor] Comment out atime until it's logic is added | flatiron_resourceful | train | js |
0bf25bf1c27c308681e811351e457dd1ca7d834e | diff --git a/tests/Propel/Tests/Generator/Model/TableTest.php b/tests/Propel/Tests/Generator/Model/TableTest.php
index <HASH>..<HASH> 100644
--- a/tests/Propel/Tests/Generator/Model/TableTest.php
+++ b/tests/Propel/Tests/Generator/Model/TableTest.php
@@ -77,7 +77,7 @@ EOF;
$table = $schema->getDatabase('test1')->getTable('table1');
$config = new GeneratorConfig();
$config->setBuildProperties(array('propel.foo.bar.class' => 'bazz'));
- $table->getDatabase()->getSchema()->setGeneratorConfig($config);
+ $table->getDatabase()->getMappingSchema()->setGeneratorConfig($config);
$this->assertThat($table->getGeneratorConfig(), $this->isInstanceOf('\Propel\Generator\Config\GeneratorConfig'), 'getGeneratorConfig() returns an instance of the generator configuration');
$this->assertEquals($table->getGeneratorConfig()->getBuildProperty('fooBarClass'), 'bazz', 'getGeneratorConfig() returns the instance of the generator configuration used in the platform');
} | [Tests] fixed wrong method call in TableTest test suite. | propelorm_Propel2 | train | php |
817221b209669d71dc3c7288832d37cd2677cde0 | diff --git a/test/unit/test_identity_map_middleware.rb b/test/unit/test_identity_map_middleware.rb
index <HASH>..<HASH> 100644
--- a/test/unit/test_identity_map_middleware.rb
+++ b/test/unit/test_identity_map_middleware.rb
@@ -8,7 +8,7 @@ class IdentityMapMiddlewareTest < Test::Unit::TestCase
@app ||= Rack::Builder.new do
use MongoMapper::Middleware::IdentityMap
map "/" do
- run lambda {|env| [200, {}, ''] }
+ run lambda {|env| [200, {}, []] }
end
map "/fail" do
run lambda {|env| raise "FAIL!" } | Fix middleware test on Ruby <I>
Rack's MockResponse calls #each on the body, which is not defined on String in Ruby <I> | mongomapper_mongomapper | train | rb |
d53b0ca9f5bb1e04ba8df999f9dcac10f75c7a6b | diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js
index <HASH>..<HASH> 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js
+++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.js
@@ -259,7 +259,8 @@ $(document).ready(function() {
};
$("#template li[fullComment=yes]").click(function() {
- commentToggleFct($(this));
+ var sel = window.getSelection().toString();
+ if (!sel) commentToggleFct($(this));
});
/* Linear super types and known subclasses */ | Toggle comment if no text is selected
fixes scala/scala-lang/issues/<I> | scala_scala | train | js |
c26eab28518533a9be91625569078f5783cfc7b3 | diff --git a/lib/modules/apostrophe-versions/lib/routes.js b/lib/modules/apostrophe-versions/lib/routes.js
index <HASH>..<HASH> 100644
--- a/lib/modules/apostrophe-versions/lib/routes.js
+++ b/lib/modules/apostrophe-versions/lib/routes.js
@@ -8,7 +8,7 @@ module.exports = function(self, options) {
var versions;
return async.series({
findDoc: function(callback) {
- return self.apos.docs.find(req, { _id: _id }).permission('edit').toObject(function(err, _doc) {
+ return self.apos.docs.find(req, { _id: _id }).published('null').permission('edit').toObject(function(err, _doc) {
if (err) {
return callback(err);
} | apostrophe-versions doc cursor includes 'unpublished' docs | apostrophecms_apostrophe | train | js |
dd326d0aea17805c9ff0c04a1c9444811c7cb954 | diff --git a/model/consoleState.js b/model/consoleState.js
index <HASH>..<HASH> 100644
--- a/model/consoleState.js
+++ b/model/consoleState.js
@@ -174,13 +174,15 @@ exports.ConsoleState = BaseModel.extend({
}
// Update FPS.
- var fps = 1000 / (this._tickSum / this._maxTicks);
- fps *= 100;
- fps = Math.round(fps);
- fps /= 100;
- fpsHistory.push(fps);
- while (fpsHistory.length > this._statHistory) {
- fpsHistory.shift();
+ if (this._tickSum) {
+ var fps = 1000 / (this._tickSum / this._maxTicks);
+ fps *= 100;
+ fps = Math.round(fps);
+ fps /= 100;
+ fpsHistory.push(fps);
+ while (fpsHistory.length > this._statHistory) {
+ fpsHistory.shift();
+ }
}
if ($$persistence.processId()) {
@@ -374,4 +376,4 @@ exports.ConsoleState = BaseModel.extend({
this._tickIndex = 0;
}
}
-});
\ No newline at end of file
+}); | don't add to fps history if heartbeat hasn't started | stimulant_ampm | train | js |
614bf446fc78111ab91d1a3b739bc8e20289400c | diff --git a/consul/pool.go b/consul/pool.go
index <HASH>..<HASH> 100644
--- a/consul/pool.go
+++ b/consul/pool.go
@@ -215,7 +215,7 @@ func (p *ConnPool) acquire(dc string, addr net.Addr, version int) (*Conn, error)
var wait chan struct{}
var ok bool
if wait, ok = p.limiter[addr.String()]; !ok {
- wait = make(chan struct{}, 1)
+ wait = make(chan struct{})
p.limiter[addr.String()] = wait
}
isLeadThread := !ok | Changes to an unbuffered channel, since we just close it. | hashicorp_consul | train | go |
659c9623b93ba91cc69aa117f1df04cb83dfba70 | diff --git a/app/models/effective/datatable.rb b/app/models/effective/datatable.rb
index <HASH>..<HASH> 100644
--- a/app/models/effective/datatable.rb
+++ b/app/models/effective/datatable.rb
@@ -315,8 +315,7 @@ module Effective
cols[name][:width] ||= nil
cols[name][:sortable] = true if cols[name][:sortable] == nil
cols[name][:type] ||= (belong_tos.key?(name) ? :belongs_to : (sql_column.try(:type).presence || :string))
- cols[name][:class] = "col-#{cols[name][:type]} #{cols[name][:class]}".strip
- cols[name][:class] << ' col-actions' if name == 'actions'
+ cols[name][:class] = "col-#{cols[name][:type]} col-#{name} #{cols[name][:class]}".strip
if name == 'id' && collection.respond_to?(:deobfuscate)
cols[name][:sortable] = false
diff --git a/lib/effective_datatables/version.rb b/lib/effective_datatables/version.rb
index <HASH>..<HASH> 100644
--- a/lib/effective_datatables/version.rb
+++ b/lib/effective_datatables/version.rb
@@ -1,3 +1,3 @@
module EffectiveDatatables
- VERSION = '1.1.1'.freeze
+ VERSION = '1.1.2'.freeze
end | Add “col-name” as a td class as well. Version <I> | code-and-effect_effective_datatables | train | rb,rb |
cecd45ff7575addc11cf75bbb2349822e49a5df4 | diff --git a/src/file/NativeFileSystem.js b/src/file/NativeFileSystem.js
index <HASH>..<HASH> 100644
--- a/src/file/NativeFileSystem.js
+++ b/src/file/NativeFileSystem.js
@@ -952,7 +952,7 @@ define(function (require, exports, module) {
if (brackets.fs.isNetworkDrive) {
brackets.fs.isNetworkDrive(rootPath, function (err, remote) {
- if (remote) {
+ if (!err && remote) {
timeout = NativeFileSystem.ASYNC_NETWORK_TIMEOUT;
}
}); | Check errors before adjusting timeout. | adobe_brackets | train | js |
3d335e48ffe301b826245dee1242997cbfba6869 | diff --git a/builtin/providers/aws/resource_aws_volume_attachment.go b/builtin/providers/aws/resource_aws_volume_attachment.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_volume_attachment.go
+++ b/builtin/providers/aws/resource_aws_volume_attachment.go
@@ -77,6 +77,25 @@ func resourceAwsVolumeAttachmentCreate(d *schema.ResourceData, meta interface{})
vols, err := conn.DescribeVolumes(request)
if (err != nil) || (len(vols.Volumes) == 0) {
+ // This handles the situation where the instance is created by
+ // a spot request and whilst the request has been fulfilled the
+ // instance is not running yet
+ stateConf := &resource.StateChangeConf{
+ Pending: []string{"pending"},
+ Target: []string{"running"},
+ Refresh: InstanceStateRefreshFunc(conn, iID),
+ Timeout: 10 * time.Minute,
+ Delay: 10 * time.Second,
+ MinTimeout: 3 * time.Second,
+ }
+
+ _, err = stateConf.WaitForState()
+ if err != nil {
+ return fmt.Errorf(
+ "Error waiting for instance (%s) to become ready: %s",
+ iID, err)
+ }
+
// not attached
opts := &ec2.AttachVolumeInput{
Device: aws.String(name), | Check instance is running before trying to attach (#<I>)
This covers the scenario of an instance created by a spot request. Using
Terraform we only know the spot request is fulfilled but the instance can
still be pending which causes the attachment to fail. | hashicorp_terraform | train | go |
37ab299ba3cd1f10fccda41bda580e24f7e1f07f | diff --git a/source/application/tasks/build-bundles/index.js b/source/application/tasks/build-bundles/index.js
index <HASH>..<HASH> 100644
--- a/source/application/tasks/build-bundles/index.js
+++ b/source/application/tasks/build-bundles/index.js
@@ -57,11 +57,17 @@ export default async (application, settings) => {
}
// Get environments
- const environments = await getEnvironments(base, {
+ const loadedEnvironments = await getEnvironments(base, {
cache,
log
});
+ // Environments have to apply on all patterns
+ const environments = loadedEnvironments.map(environment => {
+ environment.applyTo = '**/*';
+ return environment;
+ });
+
// Get available patterns
const availablePatterns = await getPatternMtimes(base, {
resolveDependencies: true
@@ -83,10 +89,17 @@ export default async (application, settings) => {
});
// Merge environment config into transform config
- const config = merge({}, {
- patterns: application.configuration.patterns,
- transforms: application.configuration.transforms
- }, {transforms: envConfig});
+ const config = merge(
+ {},
+ {
+ patterns: application.configuration.patterns,
+ transforms: application.configuration.transforms
+ },
+ envConfig,
+ {
+ environments: [environment.name]
+ }
+ );
// build all patterns matching the include config
const builtPatterns = await Promise.all(includedPatterns | fix: apply environment config to bundles properly
* environment config was merged into transforms
* environment config now is merged with whole pattern config
<URL> | patternplate-archive_patternplate-server | train | js |
98dd795c01df0da4c1adc6134fcdb2d6d774afc7 | diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -295,6 +295,8 @@ module ActionDispatch
end
end
+ # returns true if request content mime type is
+ # +application/x-www-form-urlencoded+ or +multipart/form-data+.
def form_data?
FORM_DATA_MEDIA_TYPES.include?(content_mime_type.to_s)
end | Documentation for ActionDispatch::Request form_data? method [ci skip] | rails_rails | train | rb |
6bc89d2fdf58191daf1c115dfe521ed741136353 | diff --git a/src/Json.php b/src/Json.php
index <HASH>..<HASH> 100644
--- a/src/Json.php
+++ b/src/Json.php
@@ -4,6 +4,7 @@ declare(strict_types = 1);
namespace Innmind\Json;
use Innmind\Json\Exception\{
+ Exception,
MaximumDepthExceeded,
StateMismatch,
CharacterControlError,
@@ -24,6 +25,8 @@ final class Json
/**
* @return mixed
+ *
+ * @throws Exception
*/
public static function decode(string $string)
{
@@ -36,6 +39,8 @@ final class Json
/**
* @param mixed $content
+ *
+ * @throws Exception
*/
public static function encode($content): string
{ | Document exceptions thrown by public methods | Innmind_Json | train | php |
f7ae6e1cd650134a3a72362b756b65dffb68c453 | diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -313,7 +313,7 @@ module Rails
# since it configures and mutates ARGV correctly.
class ARGVScrubber # :nodoc
def initialize(argv = ARGV)
- @argv = argv.dup
+ @argv = argv
end
def prepare! | no need to dup, argv is never mutated | rails_rails | train | rb |
d5d2cc513725e77afac2bd8a5d93e3130f756257 | diff --git a/ghost/members-api/index.js b/ghost/members-api/index.js
index <HASH>..<HASH> 100644
--- a/ghost/members-api/index.js
+++ b/ghost/members-api/index.js
@@ -96,8 +96,7 @@ module.exports = function MembersApi({
async function getMemberDataFromMagicLinkToken(token) {
const email = await magicLinkService.getUserFromToken(token);
- const {labels = [], ip} = await magicLinkService.getPayloadFromToken(token);
-
+ const {labels = [], ip, name = ''} = await magicLinkService.getPayloadFromToken(token);
if (!email) {
return null;
}
@@ -126,7 +125,7 @@ module.exports = function MembersApi({
return member;
}
- await users.create({email, labels, geolocation});
+ await users.create({name, email, labels, geolocation});
return getMemberIdentityData(email);
}
async function getMemberIdentityData(email){
@@ -165,9 +164,7 @@ module.exports = function MembersApi({
await sendEmailWithMagicLink({email, requestedType: emailType, payload});
}
} else {
- if (body.labels) {
- payload.labels = body.labels;
- }
+ Object.assign(payload, _.pick(body, ['labels', 'name']));
await sendEmailWithMagicLink({email, requestedType: emailType, payload});
}
res.writeHead(201); | Added name from magic link token to member creation
refs <URL> | TryGhost_Ghost | train | js |
13dcd5d4e96bd6b393685c79f2bd793a06a19167 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='Highton',
- version='1.2.6',
+ version='1.2.7',
license='Apache License 2.0',
description='A Python library for Highrise',
long_description='A beautiful Python - Highrise - API. Less is more.', | Version Push and Upload to PyPi | seibert-media_Highton | train | py |
dec03034f97f759633cf505441ab8f539aba8337 | diff --git a/src/Zizaco/Mongolid/Model.php b/src/Zizaco/Mongolid/Model.php
index <HASH>..<HASH> 100644
--- a/src/Zizaco/Mongolid/Model.php
+++ b/src/Zizaco/Mongolid/Model.php
@@ -656,13 +656,13 @@ class Model
// will be returned from cache =)
return static::$cacheComponent->remember(
$cache_key, 0.1, function () use ($model, $ref_ids) {
- return $model::where(['_id' => ['$in' => $ref_ids]], [], true);
+ return $model::where(['_id' => ['$in' => array_values($ref_ids)]], [], true);
}
);
} elseif ($cachable) {
- return $model::where(['_id' => ['$in' => $ref_ids]], [], true);
+ return $model::where(['_id' => ['$in' => array_values($ref_ids)]], [], true);
} else {
- return $model::where(['_id' => ['$in' => $ref_ids]]);
+ return $model::where(['_id' => ['$in' => array_values($ref_ids)]]);
}
} | Fix error with MongoDB <I> | leroy-merlin-br_mongolid | train | php |
b4a1f6a63e0ba71cfd013396aeb8d2e29c0a295f | diff --git a/src/utils/save-cordova-xml.js b/src/utils/save-cordova-xml.js
index <HASH>..<HASH> 100644
--- a/src/utils/save-cordova-xml.js
+++ b/src/utils/save-cordova-xml.js
@@ -15,6 +15,9 @@ const parseXML = function(xmlPath) {
return new RSVP.Promise((resolve, reject) => {
const contents = fs.readFileSync(xmlPath, 'utf8');
const parser = new xml2js.Parser();
+
+ if (contents === '') reject('File is empty');
+
parser.parseString(contents, function (err, result) {
if (err) reject(err);
if (result) resolve(result); | fix(save-cordova-xml): Update test to guard against config.xml being empty | isleofcode_splicon | train | js |
0135efed05759d04ee22cda0abaffe8d6dab3374 | diff --git a/timewave/stochasticprocess.py b/timewave/stochasticprocess.py
index <HASH>..<HASH> 100755
--- a/timewave/stochasticprocess.py
+++ b/timewave/stochasticprocess.py
@@ -42,6 +42,25 @@ class StochasticProcess(object):
"""
return 0.0
+ def mean(self, t):
+ """ expected value of time :math:`t` increment
+
+ :param t:
+ :rtype float
+ :return:
+ """
+ return 0.0
+
+ def variance(self, t):
+ """ second central moment of time :math:`t` increment
+
+ :param t:
+ :rtype float
+ :return:
+ """
+ return 0.0
+
+
class MultivariateStochasticProcess(StochasticProcess): | adding mean and variance properties to StochasticProcess | pbrisk_timewave | train | py |
b2cd21e7a299271e02d0089e09ca1b07bb59ce7f | diff --git a/src/org/javasimon/SimonFactory.java b/src/org/javasimon/SimonFactory.java
index <HASH>..<HASH> 100644
--- a/src/org/javasimon/SimonFactory.java
+++ b/src/org/javasimon/SimonFactory.java
@@ -149,7 +149,7 @@ public final class SimonFactory {
if (simon == null) {
simon = newSimon(name, simonClass);
} else if (simon instanceof UnknownSimon) {
- simon = replaceSimon(simon, simonClass);
+ simon = replaceSimon((UnknownSimon) simon, simonClass);
} else {
if (!(simonClass.isInstance(simon))) {
throw new SimonException("Simon named '" + name + "' already exists and its type is '" + simon.getClass().getName() + "' while requested type is '" + simonClass.getName() + "'.");
@@ -158,8 +158,10 @@ public final class SimonFactory {
return simon;
}
- private static Simon replaceSimon(Simon simon, Class<? extends AbstractSimon> simonClass) {
+ private static Simon replaceSimon(UnknownSimon simon, Class<? extends AbstractSimon> simonClass) {
AbstractSimon newSimon = instantiateSimon(simon.getName(), simonClass);
+ newSimon.enabled = simon.enabled;
+
// fixes parent link and parent's children list
((AbstractSimon) simon.getParent()).replace(simon, newSimon); | Fixed enable/disable state after replacing unknown simon with a concrete one. | virgo47_javasimon | train | java |
b95bcc89395072122f78b45e633680cda226d16a | diff --git a/js/allcoin.js b/js/allcoin.js
index <HASH>..<HASH> 100644
--- a/js/allcoin.js
+++ b/js/allcoin.js
@@ -27,6 +27,11 @@ module.exports = class allcoin extends okcoinusd {
'doc': 'https://www.allcoin.com/api_market/market',
'referral': 'https://www.allcoin.com',
},
+ 'status': {
+ 'status': 'shutdown',
+ 'updated': undefined,
+ 'eta': undefined,
+ },
'api': {
'web': {
'get': [ | [Allcoin] Set Status to Shutdown | ccxt_ccxt | train | js |
cb5dcef9429afc282f4c22af2db26cd356f0eba0 | diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py
index <HASH>..<HASH> 100644
--- a/mythril/analysis/modules/multiple_sends.py
+++ b/mythril/analysis/modules/multiple_sends.py
@@ -1,4 +1,5 @@
from mythril.analysis.report import Issue
+from mythril.laser.ethereum.cfg import JumpType
"""
MODULE DESCRIPTION:
@@ -50,7 +51,8 @@ def _explore_states(call, statespace):
def _child_nodes(statespace, node):
result = []
- children = [statespace.nodes[edge.node_to] for edge in statespace.edges if edge.node_from == node.uid]
+ children = [statespace.nodes[edge.node_to] for edge in statespace.edges if edge.node_from == node.uid
+ and edge.type != JumpType.Transaction]
for child in children:
result.append(child) | Don't explore nodes that aren't in the same transaction | ConsenSys_mythril-classic | train | py |
c8767367df9e7d744ed1220283032182c7745215 | diff --git a/compare-comply/src/main/java/com/ibm/watson/compare_comply/v1/CompareComply.java b/compare-comply/src/main/java/com/ibm/watson/compare_comply/v1/CompareComply.java
index <HASH>..<HASH> 100644
--- a/compare-comply/src/main/java/com/ibm/watson/compare_comply/v1/CompareComply.java
+++ b/compare-comply/src/main/java/com/ibm/watson/compare_comply/v1/CompareComply.java
@@ -482,6 +482,7 @@ public class CompareComply extends BaseService {
}
builder.header("Accept", "application/json");
if (listBatchesOptions != null) {
+
}
ResponseConverter<Batches> responseConverter = ResponseConverterUtils.getValue(
new com.google.gson.reflect.TypeToken<Batches>() {
@@ -521,6 +522,7 @@ public class CompareComply extends BaseService {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
+
ResponseConverter<BatchStatus> responseConverter = ResponseConverterUtils.getValue(
new com.google.gson.reflect.TypeToken<BatchStatus>() {
}.getType()); | refactor(Compare and Comply): Add newest generator output | watson-developer-cloud_java-sdk | train | java |
30ea5acfd81b9eef4c8211b5f5ff22b404d3c44d | diff --git a/spinoff/util/microprocess.py b/spinoff/util/microprocess.py
index <HASH>..<HASH> 100644
--- a/spinoff/util/microprocess.py
+++ b/spinoff/util/microprocess.py
@@ -75,7 +75,7 @@ class MicroProcess(object):
@self.d.addBoth
def finally_(result):
d = self._on_complete()
- if d:
+ if d and not isinstance(result, Failure):
ret = Deferred()
d.addCallback(lambda _: result) # pass the original result through
d.chainDeferred(ret) # ...but other than that wait on the new deferred | Avoid swallowing exceptions in microprocesses | eallik_spinoff | train | py |
107a9aba63cb57ad4b995c26c0922c66fe27f5ad | diff --git a/lib/graphql/subscriptions/action_cable_subscriptions.rb b/lib/graphql/subscriptions/action_cable_subscriptions.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/subscriptions/action_cable_subscriptions.rb
+++ b/lib/graphql/subscriptions/action_cable_subscriptions.rb
@@ -46,7 +46,7 @@ module GraphQL
# # Track the subscription here so we can remove it
# # on unsubscribe.
# if result.context[:subscription_id]
- # @subscription_ids << context[:subscription_id]
+ # @subscription_ids << result.context[:subscription_id]
# end
#
# transmit(payload) | Fix ActionCableSubscriptions channel example
Simple typo that leads to memory leaks! | rmosolgo_graphql-ruby | train | rb |
832b5f6d09e2742fb01e76fb325f450b737c0f96 | diff --git a/packages/address-edit/index.js b/packages/address-edit/index.js
index <HASH>..<HASH> 100644
--- a/packages/address-edit/index.js
+++ b/packages/address-edit/index.js
@@ -211,6 +211,13 @@ export default sfc({
setAddressDetail(value) {
this.data.addressDetail = value;
+ },
+
+ onDetailBlur() {
+ // await for click search event
+ setTimeout(() => {
+ this.detailFocused = false;
+ });
}
},
@@ -259,9 +266,7 @@ export default sfc({
searchResult={this.searchResult}
showSearchResult={this.showSearchResult}
onFocus={onFocus('addressDetail')}
- onBlur={() => {
- this.detailFocused = false;
- }}
+ onBlur={this.onDetailBlur}
onInput={this.onChangeDetail}
onSelect-search={event => {
this.$emit('select-search', event); | [bugfix] AddressEdit: select search not work in vue <I>+ (#<I>) | youzan_vant | train | js |
460255784e7acd1c73756a2f41f4dbc5dedbb182 | diff --git a/rejected/common.py b/rejected/common.py
index <HASH>..<HASH> 100644
--- a/rejected/common.py
+++ b/rejected/common.py
@@ -8,7 +8,15 @@ __since__ = '2011-07-22'
def get_consumer_config(config):
- return config.get('Consumers') or config.get('Bindings')
+ config = config.get('Consumers') or config.get('Bindings')
+
+ # Squash the configs down
+ for name in config:
+ if 'consumers' in config[name]:
+ config[name].update(config[name]['consumers'])
+ del config[name]['consumers']
+ return config
+
def get_poll_interval(config):
monitoring = config.get('Monitoring', dict()) | Squash legacy consumers YAML section into the main consumer config section | gmr_rejected | train | py |
8e2d6bd68af6be454b1e6256360b07caec2b4a4e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,6 @@ params = dict(
url="https://github.com/jaraco/" + name,
packages=setuptools.find_packages(),
include_package_data=True,
- namespace_packages=name.split('.')[:-1],
install_requires=[
'requests',
'six>=1.4,<2dev', | Also need to remove the namespace packages declaration | jaraco_jaraco.packaging | train | py |
674cc95c75c0fcedde99259fd8e58661c6a7e884 | diff --git a/openquake/calculators/disaggregation.py b/openquake/calculators/disaggregation.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/disaggregation.py
+++ b/openquake/calculators/disaggregation.py
@@ -279,6 +279,7 @@ producing too small PoEs.'''
for s in self.sitecol.sids:
iml2 = iml2s[s]
r = rlzs[s]
+ logging.info('Site #%d, disaggregating for rlz=#%d', s, r)
for p, poe in enumerate(oq.poes_disagg or [None]):
for m, imt in enumerate(oq.imtls):
self.imldict[s, r, poe, imt] = iml2[m, p] | Better logging for disaggregation [skip CI]
Former-commit-id: d<I>bfcd4ee<I>e<I>bf<I>e5f<I>a<I>ab<I> | gem_oq-engine | train | py |
26587796ce640a17a33d263e47650228507c2d8f | diff --git a/Lib/ufo2ft/filters/cubicToQuadratic.py b/Lib/ufo2ft/filters/cubicToQuadratic.py
index <HASH>..<HASH> 100644
--- a/Lib/ufo2ft/filters/cubicToQuadratic.py
+++ b/Lib/ufo2ft/filters/cubicToQuadratic.py
@@ -29,7 +29,7 @@ class CubicToQuadraticFilter(BaseFilter):
logger.info('New spline lengths: %s' % (', '.join(
'%s: %d' % (l, stats[l]) for l in sorted(stats.keys()))))
- def filter(self, glyph, glyphSet=None):
+ def filter(self, glyph):
if not len(glyph):
return False | [cubicToQuadratic] minor
forgot to remove this in <I> | googlefonts_ufo2ft | train | py |
d5e58841e6d210fa633aa7f4b12285465a293fc5 | diff --git a/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java
+++ b/liquibase-core/src/main/java/liquibase/database/core/PostgresDatabase.java
@@ -41,7 +41,9 @@ public class PostgresDatabase extends AbstractJdbcDatabase {
@Override
public void setConnection(DatabaseConnection conn) {
try {
- reservedWords.addAll(Arrays.asList(((JdbcConnection) conn).getMetaData().getSQLKeywords().toUpperCase().split(",\\s*")));
+ if (conn instanceof JdbcConnection) {
+ reservedWords.addAll(Arrays.asList(((JdbcConnection) conn).getMetaData().getSQLKeywords().toUpperCase().split(",\\s*")));
+ }
} catch (Exception e) {
LogFactory.getLogger().warning("Cannot retrieve reserved words", e);
} | Check connection type to work better with tests with mock connection | liquibase_liquibase | train | java |
d2fdc7c1d59b17be2da7f0b3a845edb782bce224 | diff --git a/kitnirc/client.py b/kitnirc/client.py
index <HASH>..<HASH> 100644
--- a/kitnirc/client.py
+++ b/kitnirc/client.py
@@ -401,7 +401,7 @@ class Client(object):
def part(self, target, message=None):
"""Part a channel."""
- if target not in self.server.channels:
+ if str(target) not in self.server.channels:
_log.warning("Ignoring request to part channel '%s' because we "
"are not in that channel.", target)
return
@@ -437,7 +437,7 @@ class Client(object):
(Values for modes which do not take arguments are ignored.)
"""
- if channel not in self.server.channels:
+ if str(channel) not in self.server.channels:
_log.warning("Ignoring request to set modes in channel '%s' "
"because we are not in that channel.", channel)
return | String-ify before checking .channels membership
This allows passing in `Channel` objects to work properly. | ayust_kitnirc | train | py |
d07828a70dd0dc49f9fd9048cadea2e5cce63eb6 | diff --git a/angr/storage/memory_mixins/address_concretization_mixin.py b/angr/storage/memory_mixins/address_concretization_mixin.py
index <HASH>..<HASH> 100644
--- a/angr/storage/memory_mixins/address_concretization_mixin.py
+++ b/angr/storage/memory_mixins/address_concretization_mixin.py
@@ -340,7 +340,7 @@ class AddressConcretizationMixin(MemoryMixin):
raise
# quick optimization so as to not involve the solver if not necessary
- trivial = type(addr) is int or (len(concrete_addrs) == 1 and (addr == concrete_addrs[0]).is_true())
+ trivial = len(concrete_addrs) == 1 and (addr == concrete_addrs[0]).is_true()
if not trivial:
# apply the concretization results to the state
constraint_options = [addr == concrete_addr for concrete_addr in concrete_addrs] | Remove a check that is no longer necessary. | angr_angr | train | py |
a1b3935f274a5d6b45cfab0f7d6184aa0909dea8 | diff --git a/test/beetle/message_test.rb b/test/beetle/message_test.rb
index <HASH>..<HASH> 100644
--- a/test/beetle/message_test.rb
+++ b/test/beetle/message_test.rb
@@ -466,5 +466,17 @@ module Beetle
assert !@r.exists(message.mutex_key)
end
end
+
+ class RedisAssumptionsTest < Test::Unit::TestCase
+ def setup
+ @r = Message.redis
+ @r.flushdb
+ end
+
+ test "trying to delete a non existent key doesn't throw an error" do
+ assert !@r.del("hahahaha")
+ assert !@r.exists("hahahaha")
+ end
+ end
end | verify a basic assumotion on deleting redis keys | xing_beetle | train | rb |
dbe90cae71a8b2a28d43186204f9f4e05ae03114 | diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Test/Case/Utility/ValidationTest.php
+++ b/lib/Cake/Test/Case/Utility/ValidationTest.php
@@ -1965,7 +1965,6 @@ class ValidationTest extends CakeTestCase {
$this->assertTrue(Validation::money('100.111,1'));
$this->assertTrue(Validation::money('100.111,11'));
$this->assertFalse(Validation::money('100.111,111'));
- $this->assertFalse(Validation::money('text'));
$this->assertTrue(Validation::money('$100'));
$this->assertTrue(Validation::money('$100.11')); | removed duplicate test case
```$this->assertFalse(Validation::money('text'));```
is now tested only once | cakephp_cakephp | train | php |
1df10cb12819a35eb99023078d4f0ececc3c8f8d | diff --git a/test/loadings.js b/test/loadings.js
index <HASH>..<HASH> 100644
--- a/test/loadings.js
+++ b/test/loadings.js
@@ -10,8 +10,6 @@ dom.settings.timeout = 900000;
dom.settings.stallTimeout = 200; // the value used in the tests
dom.settings.console = true;
dom.settings.pool.max = 8;
-require('http').globalAgent.maxSockets = 500;
-
describe("Loading ressources", function suite() {
var server, port;
diff --git a/test/when.js b/test/when.js
index <HASH>..<HASH> 100644
--- a/test/when.js
+++ b/test/when.js
@@ -9,7 +9,6 @@ dom.settings.allow = 'all';
dom.settings.timeout = 10000;
dom.settings.console = true;
dom.settings.pool.max = 8;
-require('http').globalAgent.maxSockets = 50000;
function pagePluginTest(page, plugin, ev) {
page.when(ev, function(cb) { | maxSockets is now infinity by default | kapouer_express-dom | train | js,js |
5d84b40bfd8ce3ceafd44d370039930dd72e5ef7 | diff --git a/tests/integration/modules/grains.py b/tests/integration/modules/grains.py
index <HASH>..<HASH> 100644
--- a/tests/integration/modules/grains.py
+++ b/tests/integration/modules/grains.py
@@ -142,9 +142,8 @@ class GrainsAppendTestCase(integration.ModuleCase):
GRAIN_VAL = 'my-grain-val'
def tearDown(self):
- test_grain = self.run_function('grains.get', [self.GRAIN_KEY])
- if test_grain and test_grain == [self.GRAIN_VAL]:
- self.run_function('grains.remove', [self.GRAIN_KEY, self.GRAIN_VAL])
+ for item in self.run_function('grains.get', [self.GRAIN_KEY])
+ self.run_function('grains.remove', [self.GRAIN_KEY, item])
def test_grains_append(self):
''' | Attempt to fix failing grains tests in <I>
The tearDown appears to only be removing the grain if it matches a
specific value. This may be leading to the grain value not being blank
at the time the next test is run.
Instead of only deleting the grain if it matches a specific value,
instead delete all items from that grain to ensure that it is empty for
the next test. | saltstack_salt | train | py |
ff25e929c9043a5a165d92e5ebecc2bdfacbb2e2 | diff --git a/molgenis-dataexplorer/src/main/java/org/molgenis/dataexplorer/controller/DataExplorerController.java b/molgenis-dataexplorer/src/main/java/org/molgenis/dataexplorer/controller/DataExplorerController.java
index <HASH>..<HASH> 100644
--- a/molgenis-dataexplorer/src/main/java/org/molgenis/dataexplorer/controller/DataExplorerController.java
+++ b/molgenis-dataexplorer/src/main/java/org/molgenis/dataexplorer/controller/DataExplorerController.java
@@ -148,10 +148,10 @@ public class DataExplorerController extends MolgenisPluginController
checkExistsAndPermission(selectedEntityName, message, entityExists, hasEntityPermission);
}
}
- if (StringUtils.isNotEmpty(model.toString()))
+ if (StringUtils.isNotEmpty(message.toString()))
{
- model.addAttribute("warningMessage", message.toString());
- }
+ model.addAttribute("warningMessage", message.toString());
+ }
model.addAttribute("selectedEntityName", selectedEntityName);
model.addAttribute("isAdmin", SecurityUtils.currentUserIsSu()); | Fix #<I>: Fileingest does not show "target" anymore | molgenis_molgenis | train | java |
4c117b92deff14f9df14898349d9f38f948450fa | diff --git a/tools/otci/otci/otci.py b/tools/otci/otci/otci.py
index <HASH>..<HASH> 100644
--- a/tools/otci/otci/otci.py
+++ b/tools/otci/otci/otci.py
@@ -75,7 +75,7 @@ class OTCI(object):
while duration > 0:
output = self.__otcmd.wait(1)
- if match_line(expect_line, output):
+ if any(match_line(line, expect_line) for line in output):
success = True
break | [otci] fix OTCI.wait arg order (#<I>)
In wait, match_line is called with the arguments flipped. The first
argument is supposed to the be the line being checked, and the second
is supposed to be the pattern to match. The reason this still works
for strings is because output is treated as a list of lines to expect,
and each is just compared with == to the actual expected line | openthread_openthread | train | py |
fd449a5683225eefef442e6a1132e7920de8acd2 | diff --git a/cherrypy/_cpengine.py b/cherrypy/_cpengine.py
index <HASH>..<HASH> 100644
--- a/cherrypy/_cpengine.py
+++ b/cherrypy/_cpengine.py
@@ -59,6 +59,8 @@ class Engine(object):
self.mtimes = {}
self.reload_files = []
+
+ self.monitor_thread = None
def start(self, blocking=True):
"""Start the application engine.""" | Engine.monitor_thread defaults to None now.
This is in case an Exception is raised in an on_start_engine function and the code to start/stop the engine is wrapped in a try/finally, where Engine.stop is called in finally. | cherrypy_cheroot | train | py |
773b11112275cdf4e4751041b0c18a1b17f9fb99 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -37,5 +37,5 @@ module.exports.setDefaultFormat = function(format) {
* Add filter to nunjucks environment
*/
module.exports.install = function(env, customName) {
- env.addFilter(customName || 'date', getFilter());
+ env.addFilter(customName || 'date', getFilter);
}; | Module: Modified getFitler functionality.
- removed extra parenthesis otherwise filter does not work when added to nunjucks. | techmsi_nunjucks-date | train | js |
c481a3e1f23644fca465439c77ef99d1e744d09b | diff --git a/pyemu/mat/mat_handler.py b/pyemu/mat/mat_handler.py
index <HASH>..<HASH> 100644
--- a/pyemu/mat/mat_handler.py
+++ b/pyemu/mat/mat_handler.py
@@ -1913,7 +1913,7 @@ class Cov(Matrix):
def identity_like(cls,other):
assert other.shape[0] == other.shape[1]
x = np.identity(other.shape[0])
- return cls(x=x,names=other.row_names,isdiagonal=True)
+ return cls(x=x,names=other.row_names,isdiagonal=False)
def to_pearson(self): | bug fix in Cov.identity_like(): needs to be isdiagonal=False | jtwhite79_pyemu | train | py |
7d3d96e99fea5bed09f081bef1fd1192e66bb421 | diff --git a/spotify/models/user.py b/spotify/models/user.py
index <HASH>..<HASH> 100644
--- a/spotify/models/user.py
+++ b/spotify/models/user.py
@@ -71,11 +71,10 @@ class User(URIBase, AsyncIterable): # pylint: disable=too-many-instance-attribu
self._refresh_task = None
self.__client = self.client = client
- try:
- self.http = kwargs.pop("http")
- except KeyError:
- pass # TODO: Failing silently here, we should take some action.
+ if "http" not in kwargs:
+ self.library = self.http = None
else:
+ self.http = kwargs.pop("http")
self.library = Library(client, self)
# Public user object attributes
@@ -103,7 +102,7 @@ class User(URIBase, AsyncIterable): # pylint: disable=too-many-instance-attribu
def __getattr__(self, attr):
value = object.__getattribute__(self, attr)
- if hasattr(value, "__ensure_http__") and not hasattr(self, "http"):
+ if hasattr(value, "__ensure_http__") and getattr(self, "http", None) is not None:
@functools.wraps(value)
def _raise(*args, **kwargs): | bugfix set http and library User attrs to None when http is disabled | mental32_spotify.py | train | py |
f169db433dfb4c0eb613929ee24e3b21a3aed191 | diff --git a/engine/graph/api/src/main/java/org/jboss/windup/graph/dao/JavaClassDao.java b/engine/graph/api/src/main/java/org/jboss/windup/graph/dao/JavaClassDao.java
index <HASH>..<HASH> 100644
--- a/engine/graph/api/src/main/java/org/jboss/windup/graph/dao/JavaClassDao.java
+++ b/engine/graph/api/src/main/java/org/jboss/windup/graph/dao/JavaClassDao.java
@@ -20,7 +20,7 @@ public class JavaClassDao extends BaseDao<JavaClass> {
JavaClass clz = getByUniqueProperty("qualifiedName", qualifiedName);
if (clz == null) {
- clz = (JavaClass) this.create(null);
+ clz = (JavaClass) this.create();
clz.setQualifiedName(qualifiedName);
} | Removed null and use the no-args method | windup_windup | train | java |
a485fda6aa2b0e85a448b5277d170269670849cf | diff --git a/metrics-core/src/test/java/com/yammer/metrics/core/tests/HistogramTest.java b/metrics-core/src/test/java/com/yammer/metrics/core/tests/HistogramTest.java
index <HASH>..<HASH> 100644
--- a/metrics-core/src/test/java/com/yammer/metrics/core/tests/HistogramTest.java
+++ b/metrics-core/src/test/java/com/yammer/metrics/core/tests/HistogramTest.java
@@ -101,7 +101,7 @@ public class HistogramTest {
histogram.stdDev(),
is(closeTo(288.8194360957494, 0.0001)));
- assertThat("the histogram has a sum of 499500",
+ assertThat("the histogram has a sum of 500500",
histogram.sum(),
is(closeTo(500500, 0.1))); | Fixed incorrect assertion label in HistogramTest | dropwizard_metrics | train | java |
eadb33ccb4081b478e393e131e868e4197429862 | diff --git a/addon/components/docs-keyboard-shortcuts/index.js b/addon/components/docs-keyboard-shortcuts/index.js
index <HASH>..<HASH> 100644
--- a/addon/components/docs-keyboard-shortcuts/index.js
+++ b/addon/components/docs-keyboard-shortcuts/index.js
@@ -22,9 +22,9 @@ export default class DocsKeyboardShortcutsComponent extends Component {
@onKey('KeyG', { event: 'keyup' })
goto() {
if (!formElementHasFocus()) {
- this.set('isGoingTo', true);
+ this.isGoingTo = true;
later(() => {
- this.set('isGoingTo', false);
+ this.isGoingTo = false;
}, 500);
}
} | avoid using `this.set` (fixes #<I>) (#<I>)
Right now, the DocsKeyboardShortcutsComponent attempts to use `this.set`
to set a property. DocsKeyboardShortcutsComponent is a Glimmer
Component, so this API is not available. To avoid the problem, let's
use a regular assignment statement. | ember-learn_ember-cli-addon-docs | train | js |
5d827f8b4258ec180226b03886b7b7c0df0f071a | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -101,8 +101,8 @@ async function prerender (parentCompilation, request, options, inject, loader) {
};
// Only copy over allowed plugins (excluding them breaks extraction entirely).
- const allowedPlugins = ['MiniCssExtractPlugin', 'ExtractTextPlugin'];
- const plugins = (parentCompiler.options.plugins || []).filter(c => allowedPlugins.includes(c.constructor.name));
+ const allowedPlugins = /(MiniCssExtractPlugin|ExtractTextPlugin)/i;
+ const plugins = (parentCompiler.options.plugins || []).filter(c => allowedPlugins.test(c.constructor.name));
// Compile to an in-memory filesystem since we just want the resulting bundled code as a string
const compiler = parentCompilation.createChildCompiler('prerender', outputOptions, plugins); | Switch to regex in case the casing was wrong | GoogleChromeLabs_prerender-loader | train | js |
9067df96d49474e5403597e1a8f6a7008b6873c8 | diff --git a/lib/active_remote/version.rb b/lib/active_remote/version.rb
index <HASH>..<HASH> 100644
--- a/lib/active_remote/version.rb
+++ b/lib/active_remote/version.rb
@@ -1,3 +1,3 @@
module ActiveRemote
- VERSION = "0.2.0"
+ VERSION = "0.2.1"
end | Bumped version to <I> | liveh2o_active_remote | train | rb |
8a13732171127b86c2fc4b86f2c9a142ad35f605 | diff --git a/zen-search/src/main/java/com/nominanuda/solr/SolrHelper.java b/zen-search/src/main/java/com/nominanuda/solr/SolrHelper.java
index <HASH>..<HASH> 100644
--- a/zen-search/src/main/java/com/nominanuda/solr/SolrHelper.java
+++ b/zen-search/src/main/java/com/nominanuda/solr/SolrHelper.java
@@ -112,7 +112,11 @@ public class SolrHelper {
if(val1 == null) {
continue;
} else if(struct.isPrimitiveOrNull(val1)) {
- addField(sid, k+"."+makeDynamicFieldName(k1, val1), val1, solrFields);
+ if(solrFields.contains(k+"."+k1)) {
+ addField(sid, k+"."+k1, val1, solrFields);
+ } else {
+ addField(sid, k+"."+makeDynamicFieldName(k1, val1), val1, solrFields);
+ }
}
}
} else if(struct.isDataArray(val)) { | configured dot aware paths correctly handled over dyn fields | nominanuda_zen-project | train | java |
ef7ec95bd2b6e4bf478d15633d7347470e2e0644 | diff --git a/acceptance/setup/packages/pre-suite/015_PackageHostsPresets.rb b/acceptance/setup/packages/pre-suite/015_PackageHostsPresets.rb
index <HASH>..<HASH> 100644
--- a/acceptance/setup/packages/pre-suite/015_PackageHostsPresets.rb
+++ b/acceptance/setup/packages/pre-suite/015_PackageHostsPresets.rb
@@ -1,5 +1,5 @@
if master['platform'] =~ /debian|ubuntu/
master.uses_passenger!
-elsif master['platform'] =~ /redhat|el|centos|scientific/
+elsif master['platform'] =~ /redhat|el|centos|scientific|fedora/
master['use-service'] = true
end | (maint) Include fedora as a platform to test with service packages.
Fedora had been left out, through no fault of its own, and was being
tested without starting and stopping via service scripts. | puppetlabs_puppet | train | rb |
dfa46f415e26f8009cced09f2649e1a45979b582 | diff --git a/pydot.py b/pydot.py
index <HASH>..<HASH> 100644
--- a/pydot.py
+++ b/pydot.py
@@ -416,7 +416,7 @@ def find_graphviz():
It will look for 'dot', 'twopi' and 'neato' in all the directories
specified in the PATH environment variable.
- Thirdly: Default install location (Windows only)
+ Thirdly: Default install location
It will look for 'dot', 'twopi' and 'neato' in the default install
location under the "Program Files" directory. | DOC: last method tried to find graphviz is for linux and osx too | pydot_pydot | train | py |
b7eac4596849395f47ac5d8fe68a4e8d4177aea9 | diff --git a/resources/views/partials/components.blade.php b/resources/views/partials/components.blade.php
index <HASH>..<HASH> 100644
--- a/resources/views/partials/components.blade.php
+++ b/resources/views/partials/components.blade.php
@@ -1,14 +1,14 @@
<ul class="list-group components">
@if($component_groups->count() > 0)
@foreach($component_groups as $componentGroup)
- @if($componentGroup->components->enabled()->count() > 0)
+ @if($componentGroup->components()->enabled()->count() > 0)
<li class="list-group-item group-name">
<i class="ion-ios-minus-outline group-toggle"></i>
<strong>{{ $componentGroup->name }}</strong>
</li>
<div class="group-items">
- @foreach($componentGroup->components->enabled()->sortBy('order') as $component)
+ @foreach($componentGroup->components()->enabled()->orderBy('order')->get() as $component)
@include('partials.component', compact($component))
@endforeach
</div> | Call enabled scope on the builder, not the collection | CachetHQ_Cachet | train | php |
c07a1367e07b1d45186f91125439af850722dc8f | diff --git a/lib/ember-qunit/test.js b/lib/ember-qunit/test.js
index <HASH>..<HASH> 100644
--- a/lib/ember-qunit/test.js
+++ b/lib/ember-qunit/test.js
@@ -12,6 +12,11 @@ export default function test(testName, callback) {
var message;
if (reason instanceof Error) {
message = reason.stack;
+ if (reason.message && message.indexOf(reason.message) < 0) {
+ // PhantomJS has a `stack` that does not contain the actual
+ // exception message.
+ message = Ember.inspect(reason) + "\n" + message;
+ }
} else {
message = Ember.inspect(reason);
} | Better exception messages on phantomjs
Exceptions on phantomjs have a `stack` property that does not contain
the exception message itself. Which causes us to print only the stack
without the actual error message.
This change ensures that the error message must appear withinn our
output.
I'm not sure how to test this -- mocking out `ok` while also using `ok`
seems very headsplody. | emberjs_ember-qunit | train | js |
5aefa1432c312164c2da4f4642ae175b127067ba | diff --git a/parse.go b/parse.go
index <HASH>..<HASH> 100644
--- a/parse.go
+++ b/parse.go
@@ -585,6 +585,11 @@ func (p *parser) readParts(ns *[]Node) {
func (p *parser) wordPart() Node {
switch {
+ case p.got(LIT):
+ return Lit{
+ ValuePos: p.lpos,
+ Value: p.lval,
+ }
case p.peek(DOLLBR):
return p.paramExp()
case p.peek(DOLLDP):
@@ -620,11 +625,6 @@ func (p *parser) wordPart() Node {
}
p.gotLit(&pe.Param)
return pe
- case p.got(LIT):
- return Lit{
- ValuePos: p.lpos,
- Value: p.lval,
- }
case p.peek(CMDIN):
ci := CmdInput{Lss: p.pos}
ci.Stmts = p.stmtsNested(RPAREN) | parse: check for LIT first in wordPart()
It's the most basic and very probably most common occurence. | mvdan_sh | train | go |
b89209f09933fc895fd57ed4acc8a1bb4504db07 | diff --git a/tests/plugins/keyword_test.py b/tests/plugins/keyword_test.py
index <HASH>..<HASH> 100644
--- a/tests/plugins/keyword_test.py
+++ b/tests/plugins/keyword_test.py
@@ -81,6 +81,9 @@ class TestKeywordDetector(object):
[
# FOLLOWED_BY_COLON_RE
(
+ 'private_key "";' # Nothing in the quotes
+ ),
+ (
'private_key \'"no spaces\';' # Has whitespace in-between
),
(
@@ -93,6 +96,13 @@ class TestKeywordDetector(object):
(
'theapikeyforfoo:hopenobodyfindsthisone' # Characters between apikey and :
),
+ (
+ 'theapikey:' # Nothing after :
+ ),
+ # FOLLOWED_BY_EQUAL_SIGNS_RE
+ (
+ 'my_password_for_stuff =' # Nothing after =
+ ),
],
)
def test_analyze_negatives(self, file_content): | Add a few more Keyword negative test-cases | Yelp_detect-secrets | train | py |
e6a30f18f106f47a70ef03f9752865956ffbb1c0 | diff --git a/test/helper.rb b/test/helper.rb
index <HASH>..<HASH> 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -30,7 +30,7 @@ if ActiveRecord::Base.respond_to?(:raise_in_transactional_callbacks=) && Rails.v
ActiveRecord::Base.raise_in_transactional_callbacks = true
end
-ActiveRecord::Base.configurations = { "test" => { adapter: 'sqlite3', database: ':memory:' } }
+ActiveRecord::Base.configurations = { 'test' => { 'adapter' => 'sqlite3', 'database' => ':memory:' } }
ActiveRecord::Base.establish_connection(:test)
ActiveRecord::Schema.verbose = false | Make DB configuration RoR <I> compatible.
The configuration does not accept symbols as a keys anymore, since
<URL> | rails_rails-observers | train | rb |
339aa6fb7b469b806c3279eeef7732bfaca035a5 | diff --git a/tests/cases/action/RequestTest.php b/tests/cases/action/RequestTest.php
index <HASH>..<HASH> 100644
--- a/tests/cases/action/RequestTest.php
+++ b/tests/cases/action/RequestTest.php
@@ -1015,7 +1015,10 @@ class RequestTest extends \lithium\test\Unit {
$request = new Request(array(
'url' => 'foo/bar',
'base' => null,
- 'env' => array('HTTP_HOST' => 'example.com'),
+ 'env' => array(
+ 'HTTP_HOST' => 'example.com',
+ 'PHP_SELF' => '/index.php'
+ ),
));
$expected = 'http://example.com/foo/bar'; | Minor fix for a failing Request test when ran from cli | UnionOfRAD_lithium | train | php |
9dc16b48bbf44f7089b825d7e772adc292a78352 | diff --git a/src-setup/org/opencms/setup/comptest/CmsSetupTestServletContainer.java b/src-setup/org/opencms/setup/comptest/CmsSetupTestServletContainer.java
index <HASH>..<HASH> 100644
--- a/src-setup/org/opencms/setup/comptest/CmsSetupTestServletContainer.java
+++ b/src-setup/org/opencms/setup/comptest/CmsSetupTestServletContainer.java
@@ -52,6 +52,7 @@ public class CmsSetupTestServletContainer implements I_CmsSetupTest {
{"Apache Tomcat/6", null},
{"Apache Tomcat/7", null},
{"Apache Tomcat/8", null},
+ {"Apache Tomcat/9", null},
{"WebLogic Server 9", null},
{
"Resin/3", | Added Tomcat 9 as valid servlet container version in setup wizard. | alkacon_opencms-core | train | java |
c91bcf3f23c1065eb3d45a43dbfb5e8895d540e0 | diff --git a/lib/binary_parser.js b/lib/binary_parser.js
index <HASH>..<HASH> 100644
--- a/lib/binary_parser.js
+++ b/lib/binary_parser.js
@@ -324,7 +324,7 @@ Object.keys(PRIMITIVE_TYPES).forEach(function(type) {
Parser.prototype.generateBit = function(ctx) {
ctx.bitFields.push(this);
- if (this.next && !this.next.type.match('Bit')) {
+ if (!this.next || (this.next && !this.next.type.match('Bit'))) {
var sum = 0;
ctx.bitFields.forEach(function(parser) {
sum += parser.options.length; | Fixed bug that parser ends with bit parser doesnt work correctly | keichi_binary-parser | train | js |
52553e65e9283f5b768b32c70fccdc9a9e188521 | diff --git a/tests/units/Client.php b/tests/units/Client.php
index <HASH>..<HASH> 100644
--- a/tests/units/Client.php
+++ b/tests/units/Client.php
@@ -136,13 +136,16 @@ class Client extends \ElasticSearch\tests\Base
$secondaryIndex = 'test-index2';
$doc = array('title' => $tag);
$options = array('refresh' => true);
- $client->setIndex($secondaryIndex)->index($doc, false, $options);
- $client->setIndex($primaryIndex)->index($doc, false, $options);
+ $client->setIndex($secondaryIndex);
+ $client->index($doc, false, $options);
+ $client->setIndex($primaryIndex);
+ $client->index($doc, false, $options);
$indexes = array($primaryIndex, $secondaryIndex);
// Use both indexes when searching
- $resp = $client->setIndex($indexes)->search("title:$tag");
+ $client->setIndex($indexes);
+ $resp = $client->search("title:$tag");
$this->assert->array($resp)->hasKey('hits')
->array($resp['hits'])->hasKey('total') | Fixes unit testing using an unimplemented fluent api on Client | nervetattoo_elasticsearch | train | php |
a05a99915d96a8d8cb18f7c2dad64e6e47756b3e | diff --git a/h2network/src/test/java/org/h2gis/network/SpatialFunctionTest.java b/h2network/src/test/java/org/h2gis/network/SpatialFunctionTest.java
index <HASH>..<HASH> 100644
--- a/h2network/src/test/java/org/h2gis/network/SpatialFunctionTest.java
+++ b/h2network/src/test/java/org/h2gis/network/SpatialFunctionTest.java
@@ -27,7 +27,6 @@ package org.h2gis.network;
import org.h2.value.ValueGeometry;
import org.h2gis.h2spatial.CreateSpatialExtension;
import org.h2gis.h2spatial.ut.SpatialH2UT;
-import org.h2gis.network.graph_creator.GraphCreatorTest;
import org.h2gis.network.graph_creator.ST_Graph;
import org.h2gis.network.graph_creator.ST_ShortestPathLength;
import org.junit.*;
@@ -54,7 +53,6 @@ public class SpatialFunctionTest {
connection = SpatialH2UT.createSpatialDataBase(DB_NAME, true);
CreateSpatialExtension.registerFunction(connection.createStatement(), new ST_Graph(), "");
CreateSpatialExtension.registerFunction(connection.createStatement(), new ST_ShortestPathLength(), "");
- GraphCreatorTest.registerCormenGraph(connection);
}
@Before | Remove the extra call to ST_Graph (#<I>)
I was calling it an extra time when I created the cormen graph, but I
don't need the cormen graph for the st_graph tests! | orbisgis_h2gis | train | java |
bfdb69ea11aa8476703f151c751cfb3e00c23703 | diff --git a/master/buildbot/status/web/change_hook.py b/master/buildbot/status/web/change_hook.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/status/web/change_hook.py
+++ b/master/buildbot/status/web/change_hook.py
@@ -63,8 +63,8 @@ class ChangeHookResource(resource.Resource):
except ValueError, err:
request.setResponseCode(400, err.args[0])
return err.args[0]
- except Exception:
- log.err(None, "Exception processing web hook.")
+ except Exception, e:
+ log.err(e, "processing changes from web hook")
msg = "Error processing changes."
request.setResponseCode(500, msg)
return msg
@@ -78,7 +78,8 @@ class ChangeHookResource(resource.Resource):
def ok(_):
request.setResponseCode(202)
request.finish()
- def err(_):
+ def err(why):
+ log.err(why, "adding changes from web hook")
request.setResponseCode(500)
request.finish()
d.addCallbacks(ok, err) | Better logging of errors from web change hooks.
The error message was getting discarded, making debugging impossible. | buildbot_buildbot | train | py |
ed5ef396b8ec173125b5ddb57650bd33023eeb48 | diff --git a/assess_add_cloud.py b/assess_add_cloud.py
index <HASH>..<HASH> 100755
--- a/assess_add_cloud.py
+++ b/assess_add_cloud.py
@@ -36,11 +36,26 @@ def assess_cloud(client, example_cloud):
raise JujuAssertionError('Cloud mismatch')
+def iter_clouds(clouds):
+ for cloud_name, cloud in clouds.items():
+ yield cloud_name, cloud
+
+ for cloud_name, cloud in clouds.items():
+ if 'endpoint' not in cloud:
+ continue
+ cloud = deepcopy(cloud)
+ cloud['endpoint'] = 'A' * 4096
+ if cloud['type'] == 'vsphere':
+ for region in cloud['regions'].values():
+ region['endpoint'] = cloud['endpoint']
+ yield 'long-endpoint-{}'.format(cloud_name), cloud
+
+
def assess_all_clouds(client, clouds):
succeeded = set()
failed = set()
client.env.load_yaml()
- for cloud_name, cloud in clouds.items():
+ for cloud_name, cloud in iter_clouds(clouds):
sys.stdout.write('Testing {}.\n'.format(cloud_name))
try:
assess_cloud(client, cloud) | Test with <I>-char endpoints. | juju_juju | train | py |
d4810b55ba1e56d4616680b5aa0bb9bc2513e76f | diff --git a/src/deploy/lambda/05-upload-zip.js b/src/deploy/lambda/05-upload-zip.js
index <HASH>..<HASH> 100644
--- a/src/deploy/lambda/05-upload-zip.js
+++ b/src/deploy/lambda/05-upload-zip.js
@@ -17,7 +17,8 @@ module.exports = function uploadZip(params, callback) {
},
// upload the function
function _upload(buffer, callback) {
- (new aws.Lambda).updateFunctionCode({
+ let l = new aws.Lambda({region: process.env.AWS_REGION})
+ l.updateFunctionCode({
FunctionName: lambda,
ZipFile: buffer
}, | force env var (loaded by utils/init or we fail loudly) | architect_architect | train | js |
a553c2124c381050eb5bdfc6f5d978a6ad86756d | diff --git a/medoo.php b/medoo.php
index <HASH>..<HASH> 100644
--- a/medoo.php
+++ b/medoo.php
@@ -589,7 +589,7 @@ class medoo
}
}
- $table_join[] = $join_array[ $match[2] ] . ' JOIN "' . $match[3] . '" ' . (isset($match[5]) ? ' AS "' . $match[5] . '"' : '') . $relation;
+ $table_join[] = $join_array[ $match[2] ] . ' JOIN "' . $match[3] . '" ' . (isset($match[5]) ? 'AS "' . $match[5] . '" ' : '') . $relation;
}
} | [fix] Table joining with alias bug | catfan_Medoo | train | php |
b8f6ce3ae2a10377305d01d72e0bffa334af3a30 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -11,7 +11,7 @@ class EmojiFaviconPlugin {
compiler.hooks.make.tapAsync(
'EmojiFaviconPlugin',
(compilation, callback) =>
- render(this.emoji, [16, 32, 48])
+ render(this.emoji, [16, 32, 48, 64, 128, 256])
.then(toIco)
.then(ico => {
compilation.assets[filename] = {
diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -2,5 +2,5 @@ const EmojiFaviconPlugin = require('./lib');
const HtmlPlugin = require('html-webpack-plugin');
module.exports = {
- plugins: [new HtmlPlugin(), new EmojiFaviconPlugin('🐠')]
+ plugins: [new EmojiFaviconPlugin('🐠'), new HtmlPlugin()]
}; | Render more favicon sizes | trevorblades_emoji-favicon-webpack-plugin | train | js,js |
5904ed0ee638b9e97d93105d5d8987f07775d671 | diff --git a/bika/lims/content/client.py b/bika/lims/content/client.py
index <HASH>..<HASH> 100644
--- a/bika/lims/content/client.py
+++ b/bika/lims/content/client.py
@@ -105,6 +105,13 @@ class Client(Organisation):
def setTitle(self, value):
return self.setName(value)
+ def getClientID(self):
+ ### If no ID is defined (old data) invent one
+ cid = self.getField('ClientID').get(self)
+ if cid:
+ return cid.decode('utf-8').encode('utf-8')
+ return self.getId().decode('utf-8').encode('utf-8')
+
security.declarePublic('getContactsDisplayList')
def getContactsDisplayList(self):
wf = getToolByName(self, 'portal_workflow') | Retrieve ID as ClientID if database has no ClientID | senaite_senaite.core | train | py |
66e2016eeb42864ba26918798faa5ec32da2f0c6 | diff --git a/models/user.go b/models/user.go
index <HASH>..<HASH> 100644
--- a/models/user.go
+++ b/models/user.go
@@ -629,7 +629,7 @@ func GetUserIdsByNames(names []string) []int64 {
// Get all email addresses
func GetEmailAddresses(uid int64) ([]*EmailAddress, error) {
emails := make([]*EmailAddress, 0, 5)
- err := x.Where("owner_id=?", uid).Find(&emails)
+ err := x.Where("uid=?", uid).Find(&emails)
if err != nil {
return nil, err
} | Fix for wrong email query
Changing EmailAdress.OwnerId to EmailAddress.Uid should have accompanied this change | gogs_gogs | train | go |
16fd8dc93ed8808d6e6df6f8b315fcb5c6a38960 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ license: GNU-GPL2
from setuptools import setup
setup(name='consoleprinter',
- version='32',
+ version='34',
description='Console printer with linenumbers, stacktraces, logging, conversions and coloring..',
url='https://github.com/erikdejonge/consoleprinter',
author='Erik de Jonge', | pip
Thursday <I> April <I> (week:<I> day:<I>), <I>:<I>:<I> | erikdejonge_consoleprinter | train | py |
83b739e83b275dbdc4bd834e91757374f8dbb819 | diff --git a/commands/get.go b/commands/get.go
index <HASH>..<HASH> 100644
--- a/commands/get.go
+++ b/commands/get.go
@@ -7,7 +7,7 @@ import (
)
type GetCommand struct {
- SecretIdentifier string `short:"n" long:"name" description:"Selects the secret being set"`
+ SecretIdentifier string `short:"n" long:"name" description:"Selects the secret to retrieve"`
}
func (cmd GetCommand) Execute([]string) error { | Updated help text for `get`
[#<I>] CLI user should be able to GET secret value | cloudfoundry-incubator_credhub-cli | train | go |
73c76e09d2cf6ab9a4c35460686bb005b9c3c1d4 | diff --git a/src/Behat/Mink/Exception/Exception.php b/src/Behat/Mink/Exception/Exception.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Mink/Exception/Exception.php
+++ b/src/Behat/Mink/Exception/Exception.php
@@ -103,7 +103,7 @@ abstract class Exception extends \Exception
$driver = basename(str_replace('\\', '/', get_class($this->session->getDriver())));
$info = '+--[ ';
- if (!in_array($driver, array('SahiDriver', 'SeleniumDriver'))) {
+ if (!in_array($driver, array('SahiDriver', 'SeleniumDriver', 'Selenium2Driver'))) {
$info .= 'HTTP/1.1 '.$this->session->getStatusCode().' | ';
}
$info .= $this->session->getCurrentUrl().' | '.$driver." ]\n|\n"; | Fix Exception::getResponseInfo with Selenium 2 driver | minkphp_Mink | train | php |
25b656e997e449b390a7b545ff2f106205f1b797 | diff --git a/forms_builder/forms/admin.py b/forms_builder/forms/admin.py
index <HASH>..<HASH> 100644
--- a/forms_builder/forms/admin.py
+++ b/forms_builder/forms/admin.py
@@ -1,4 +1,3 @@
-
from csv import writer
from mimetypes import guess_type
from os.path import join
@@ -130,7 +129,7 @@ class FormAdmin(admin.ModelAdmin):
response["Content-Disposition"] = "attachment; filename=%s" % fname
queue = StringIO()
workbook = xlwt.Workbook(encoding='utf8')
- sheet = workbook.add_sheet(form.title)
+ sheet = workbook.add_sheet(form.title[:31])
for c, col in enumerate(entries_form.columns()):
sheet.write(0, c, col)
for r, row in enumerate(entries_form.rows(csv=True)): | Bugfix: Excel export fail for long form titles.
Workbook sheets created by xlwt must not contain more than <I> characters (I assume it's a limitation of Excel) - this should fix failing Excel exports for long form titles. | stephenmcd_django-forms-builder | train | py |
73d3394ba33974c205b8e75fd2dd6b8cda9ba055 | diff --git a/sphinx/docserver.py b/sphinx/docserver.py
index <HASH>..<HASH> 100644
--- a/sphinx/docserver.py
+++ b/sphinx/docserver.py
@@ -54,7 +54,7 @@ def shutdown_server():
def ui():
time.sleep(0.5)
- input("Press any key to exit...")
+ input("Press <ENTER> to exit...\n")
if __name__ == "__main__": | Changed docserver shutdown instruction. (#<I>) | bokeh_bokeh | train | py |
21c4ea51fc21f3a42aa428b4d8f1c4107748884d | diff --git a/lib/crawler.js b/lib/crawler.js
index <HASH>..<HASH> 100644
--- a/lib/crawler.js
+++ b/lib/crawler.js
@@ -306,7 +306,7 @@ var Crawler = function(initialURL) {
/**
* Collection of regular expressions and functions that are applied in the
- * default {@link Crawler#discoverRegex} method.
+ * default {@link Crawler#discoverResources} method.
* @type {Array.<RegExp|Function>}
*/
this.discoverRegex = [
@@ -348,15 +348,15 @@ var Crawler = function(initialURL) {
];
/**
- * Controls whether the default {@link Crawler#discoverRegex} should scan
- * for new resources inside of HTML comments.
+ * Controls whether the default {@link Crawler#discoverResources} should
+ * scan for new resources inside of HTML comments.
* @type {Boolean}
*/
this.parseHTMLComments = true;
/**
- * Controls whether the default {@link Crawler#discoverRegex} should scan
- * for new resources inside of `<script>` tags.
+ * Controls whether the default {@link Crawler#discoverResources} should
+ * scan for new resources inside of `<script>` tags.
* @type {Boolean}
*/
this.parseScriptTags = true; | Fixed errant reference to discoverResources method in inline docs | simplecrawler_simplecrawler | train | js |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.