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
aa3eb050964b354b0df2dee167c461ca0f635f40
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1291,7 +1291,15 @@ function get_list_of_countries() { $lang = current_language(); if (!file_exists("$CFG->dirroot/lang/$lang/countries.php")) { - $lang = "en"; // countries.php must exist in this pack + if ($parentlang = get_string("parentlanguage")) { + if (file_exists("$CFG->dirroot/lang/$parentlang/countries.php")) { + $lang = $parentlang; + } else { + $lang = "en"; // countries.php must exist in this pack + } + } else { + $lang = "en"; // countries.php must exist in this pack + } } include("$CFG->dirroot/lang/$lang/countries.php");
When getting a list of countries, check the parent language if necessary.
moodle_moodle
train
php
3a4b50e6baf16b0736a7f7295e3a923d201be44f
diff --git a/custom_utils/custom_utils.py b/custom_utils/custom_utils.py index <HASH>..<HASH> 100644 --- a/custom_utils/custom_utils.py +++ b/custom_utils/custom_utils.py @@ -149,12 +149,17 @@ class CustomUtils: with open(data['save_path'] + ".json", 'w') as outfile: json.dump(data, outfile, sort_keys=True, indent=4) - def download(self, url, file_path, header={}): + def download(self, url, file_path, header={}, redownload=False): """ :return: True/False """ success = True + if redownload is False: + # See if we already have the file + if os.path.isfile(file_path): + return True + self.create_path(file_path) if url.startswith('//'):
Only redownload a file if told so
xtream1101_cutil
train
py
744546628cd3fca1297789e8286b9e34da70ec10
diff --git a/src/Iverberk/Larasearch/Traits/SearchableTrait.php b/src/Iverberk/Larasearch/Traits/SearchableTrait.php index <HASH>..<HASH> 100644 --- a/src/Iverberk/Larasearch/Traits/SearchableTrait.php +++ b/src/Iverberk/Larasearch/Traits/SearchableTrait.php @@ -13,7 +13,7 @@ trait SearchableTrait { * * @var \Iverberk\Larasearch\Proxy */ - private static $__es_proxy = null; + protected static $__es_proxy = null; /** * Related Eloquent models as dot seperated paths @@ -95,4 +95,4 @@ trait SearchableTrait { return parent::__callStatic($method, $parameters); } -} \ No newline at end of file +}
Change property visibility in SearchableTrait Allows you to use trait in different models sharing one base class (in multi-table inheritance in our case).
iverberk_larasearch
train
php
5fc975eb40952a09527f87829dfc8456778f1385
diff --git a/lib/install.js b/lib/install.js index <HASH>..<HASH> 100644 --- a/lib/install.js +++ b/lib/install.js @@ -56,7 +56,7 @@ function cloneMean(options, done){ // TODO - Possibly remove depdendency of git all together and download and optionally add a remote. if (!shell.which('git')) return console.log(chalk.red('Prerequisite not installed: git')); var name = options.name; - var source = (options.git ? '[email protected]:linnovate/mean.git' : 'http://github.com/linnovate/mean.git'); + var source = (options.git ? '[email protected]:linnovate/mean.git' : 'https://github.com/linnovate/mean.git'); // Allow specifying specific repo if (options.repo) {
typo in https - fixed #<I>
linnovate_mean-cli
train
js
642480fb6786b9f3af9486894c13e66197ba97e5
diff --git a/helper/ResultServer.php b/helper/ResultServer.php index <HASH>..<HASH> 100644 --- a/helper/ResultServer.php +++ b/helper/ResultServer.php @@ -39,7 +39,7 @@ class ResultServer $resultServer = $delivery->getOnePropertyValue(new core_kernel_classes_Property(DeliveryContainerService::PROPERTY_RESULT_SERVER)); if (empty($resultServer)) { //No static result server was associated with the delivery - $resultServer = new core_kernel_classes_Resource(ResultServerService::INSTANCE_RESULT_SERVER); + $resultServer = new core_kernel_classes_Resource(ResultServerService::INSTANCE_VOID_RESULT_SERVER); } $resultIdentifier = $launchData->hasVariable("lis_result_sourcedid")
TAO-<I> - keep 'void' in the name of the constant
oat-sa_extension-tao-ltideliveryprovider
train
php
4590364d044b7d3eb217feb2efb34bbc89e6f3bc
diff --git a/channeldb/db.go b/channeldb/db.go index <HASH>..<HASH> 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -150,8 +150,8 @@ func (d *DB) FetchOpenChannels(nodeID *wire.ShaHash) ([]*OpenChannel, error) { // Get the bucket dedicated to storing the meta-data for open // channels. openChanBucket := tx.Bucket(openChannelBucket) - if openChannelBucket == nil { - return fmt.Errorf("open channel bucket does not exist") + if openChanBucket == nil { + return nil } // Within this top level bucket, fetch the bucket dedicated to storing
channeldb: return nil for error if openChanBucket not created This avoids an unnecessary panic in the case that the channeldb has been wiped independently while a new peer connects.
lightningnetwork_lnd
train
go
52c5e4d78ce0633150291b579c57079fd3c6b752
diff --git a/wagtailmarkdown/utils.py b/wagtailmarkdown/utils.py index <HASH>..<HASH> 100755 --- a/wagtailmarkdown/utils.py +++ b/wagtailmarkdown/utils.py @@ -9,6 +9,7 @@ # import warnings +from django.utils.encoding import smart_text from django.utils.safestring import mark_safe import bleach @@ -30,7 +31,7 @@ def render_markdown(text, context=None): def _transform_markdown_into_html(text): - return markdown.markdown(str(text), **_get_markdown_kwargs()) + return markdown.markdown(smart_text(text), **_get_markdown_kwargs()) def _sanitise_markdown_html(markdown_html):
fix #<I> now you can use cyrillic texts
torchbox_wagtail-markdown
train
py
743de6866e46ed95e35f2de1f89fc237362d9841
diff --git a/template.go b/template.go index <HASH>..<HASH> 100644 --- a/template.go +++ b/template.go @@ -9,6 +9,7 @@ import ( "go/token" "io" "os" + "time" ) // Template represents an entire Ego template. @@ -226,6 +227,10 @@ func (p *Package) writeHeader(w io.Writer) error { // Reset buffer. buf.Reset() + + // Add note that the file is auto-generated + fmt.Fprintf(&buf, "// Generated by ego on %s.\n// DO NOT EDIT\n\n", time.Now().Format(time.ANSIC)) + fmt.Fprintf(&buf, "package %s\n", p.Name) // Write deduped imports.
Add note that template is auto-generated
benbjohnson_ego
train
go
12589d5fb42eae13547aebb88dc8baefadf0e1cf
diff --git a/src/python/dxpy/bindings/dxfile.py b/src/python/dxpy/bindings/dxfile.py index <HASH>..<HASH> 100644 --- a/src/python/dxpy/bindings/dxfile.py +++ b/src/python/dxpy/bindings/dxfile.py @@ -36,7 +36,7 @@ DXFILE_HTTP_THREADS = NUM_HTTP_THREADS if dxpy.JOB_ID: # Increase HTTP request buffer sizes when we are running within the # platform. - DEFAULT_BUFFER_SIZE = 1024*1024*64 + DEFAULT_BUFFER_SIZE = 1024*1024*96 DXFILE_HTTP_THREADS = 8 class DXFile(DXDataObject):
Increase buffer size to <I> MB on workers With the increase to 8 threads, we have to watch out for OOM. Hopefully this won't crash.
dnanexus_dx-toolkit
train
py
60a2d68aab8aaeff72c553769a8826d9f4550a04
diff --git a/invoice/src/main/java/com/ning/billing/invoice/api/user/DefaultNullInvoiceEvent.java b/invoice/src/main/java/com/ning/billing/invoice/api/user/DefaultNullInvoiceEvent.java index <HASH>..<HASH> 100644 --- a/invoice/src/main/java/com/ning/billing/invoice/api/user/DefaultNullInvoiceEvent.java +++ b/invoice/src/main/java/com/ning/billing/invoice/api/user/DefaultNullInvoiceEvent.java @@ -61,6 +61,17 @@ public class DefaultNullInvoiceEvent implements NullInvoiceEvent { } @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("DefaultNullInvoiceEvent"); + sb.append("{accountId=").append(accountId); + sb.append(", processingDate=").append(processingDate); + sb.append(", userToken=").append(userToken); + sb.append('}'); + return sb.toString(); + } + + @Override public int hashCode() { final int prime = 31; int result = 1; @@ -108,6 +119,4 @@ public class DefaultNullInvoiceEvent implements NullInvoiceEvent { } return true; } - - }
invoice: add toString method to DefaultNullInvoiceEvent This is useful to print the event in the logs.
killbill_killbill
train
java
d9063e928f10756af1f89b569c6e86c1ca82eda6
diff --git a/backup/backuplib.php b/backup/backuplib.php index <HASH>..<HASH> 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -624,6 +624,12 @@ } else { fwrite ($bf,full_tag("MESSAGES",3,false,"false")); } + //The blogs in backup + if ($preferences->backup_blogs == 1 && $preferences->backup_course == SITEID) { + fwrite ($bf,full_tag("BLOGS",3,false,"true")); + } else { + fwrite ($bf,full_tag("BLOGS",3,false,"false")); + } //The mode of writing the block data fwrite ($bf,full_tag('BLOCKFORMAT',3,false,'instances')); fwrite ($bf,end_tag("DETAILS",2,true));
Adding some missing course info when backuping blogs. MDL-<I> ; merged from <I>_STABLE
moodle_moodle
train
php
83856d8f8a84217913a00e184f087f71f64c1342
diff --git a/erizo_controller/erizoClient/src/Room.js b/erizo_controller/erizoClient/src/Room.js index <HASH>..<HASH> 100644 --- a/erizo_controller/erizoClient/src/Room.js +++ b/erizo_controller/erizoClient/src/Room.js @@ -95,8 +95,7 @@ Erizo.Room = function (spec) { // It connects to the server through socket.io connectSocket = function (token, callback, error) { // Once we have connected - - that.socket = io.connect(token.host, {reconnect: false, secure: token.secure}); + that.socket = io.connect(token.host, {reconnect: false, secure: token.secure, 'force new connection': true}); // We receive an event with a new stream in the room. // type can be "media" or "data"
Merged jnoring changes
lynckia_licode
train
js
99992f2188988b276d32106a13d5047056066e5b
diff --git a/lib/rubocop/cli.rb b/lib/rubocop/cli.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cli.rb +++ b/lib/rubocop/cli.rb @@ -25,14 +25,7 @@ module RuboCop act_on_options apply_default_formatter - runner = Runner.new(@options, @config_store) - trap_interrupt(runner) - all_passed = runner.run(paths) - display_warning_summary(runner.warnings) - display_error_summary(runner.errors) - maybe_print_corrected_source - - all_passed && !runner.aborting? && runner.errors.empty? ? 0 : 1 + execute_runner(paths) rescue RuboCop::Error => e $stderr.puts Rainbow("Error: #{e.message}").red return 2 @@ -72,6 +65,18 @@ module RuboCop end end + def execute_runner(paths) + runner = Runner.new(@options, @config_store) + + trap_interrupt(runner) + all_passed = runner.run(paths) + display_warning_summary(runner.warnings) + display_error_summary(runner.errors) + maybe_print_corrected_source + + all_passed && !runner.aborting? && runner.errors.empty? ? 0 : 1 + end + def handle_exiting_options return unless Options::EXITING_OPTIONS.any? { |o| @options.key? o }
Reduce complexity in CLI Extract `execute_runner` from `RuboCop::CLI#run`.
rubocop-hq_rubocop
train
rb
bb51720818201b21c022e6ef589054ad558e254d
diff --git a/lib/EventLoop.php b/lib/EventLoop.php index <HASH>..<HASH> 100644 --- a/lib/EventLoop.php +++ b/lib/EventLoop.php @@ -138,14 +138,10 @@ class EventLoop extends Loop { case Watcher::DELAY: case Watcher::REPEAT: - $flags = \Event::TIMEOUT; - if ($watcher->type === Watcher::REPEAT) { - $flags |= \Event::PERSIST; - } $this->events[$id] = new \Event( $this->handle, -1, - $flags, + \Event::TIMEOUT | \Event::PERSIST, $this->timerCallback, $watcher );
Always use persistent flag for timer cancel() is called when delay timers are executed anyway, so it doesn't matter what the flags are for the event.
amphp_loop
train
php
f3aee123ec7fb77091b8df4e3bea4f4da11d7d52
diff --git a/lib/arel/nodes/extract.rb b/lib/arel/nodes/extract.rb index <HASH>..<HASH> 100644 --- a/lib/arel/nodes/extract.rb +++ b/lib/arel/nodes/extract.rb @@ -12,7 +12,7 @@ module Arel end def hash - super ^ [@field, @alias].hash + super ^ @field.hash end def eql? other
Remove unused @alias, being referenced in hashing.
rails_rails
train
rb
ec90c46b9ccb3fef94ad5c7fa52670617a94b1de
diff --git a/pylint_django/augmentations/__init__.py b/pylint_django/augmentations/__init__.py index <HASH>..<HASH> 100644 --- a/pylint_django/augmentations/__init__.py +++ b/pylint_django/augmentations/__init__.py @@ -44,6 +44,7 @@ MANAGER_ATTRS = { 'extra', 'get', 'get_or_create', + 'update_or_create', 'get_queryset', 'create', 'bulk_create',
Fix for Reverse Manager `update_or_create` calls This attr list appears to be missing `update_or_create` which means that reverse related managers throw an error when trying to use them like `self.<MANAGER>.update_or_create()`.
PyCQA_pylint-django
train
py
6c2c29f72468b79bbf8543412b503d7ba44ec883
diff --git a/src/you_get/extractors/youtube.py b/src/you_get/extractors/youtube.py index <HASH>..<HASH> 100644 --- a/src/you_get/extractors/youtube.py +++ b/src/you_get/extractors/youtube.py @@ -152,8 +152,11 @@ class YouTube(VideoExtractor): # Parse video page (for DASH) video_page = get_content('https://www.youtube.com/watch?v=%s' % self.vid) - ytplayer_config = json.loads(re.search('ytplayer.config\s*=\s*([^\n]+?});', video_page).group(1)) - self.html5player = 'https:' + ytplayer_config['assets']['js'] + try: + ytplayer_config = json.loads(re.search('ytplayer.config\s*=\s*([^\n]+?});', video_page).group(1)) + self.html5player = 'https:' + ytplayer_config['assets']['js'] + except: + self.html5player = None else: # Parse video page instead @@ -294,6 +297,7 @@ class YouTube(VideoExtractor): } except: # VEVO + if not self.html5player: return self.js = get_content(self.html5player) if 'adaptive_fmts' in ytplayer_config['args']: streams = [dict([(i.split('=')[0],
[youtube] fix for age-restricted videos, which do not contain ytplayer.config (or html5player) on web page
soimort_you-get
train
py
5e9c9e0e398994d882df3988da7fcf6829201e51
diff --git a/comment/locallib.php b/comment/locallib.php index <HASH>..<HASH> 100644 --- a/comment/locallib.php +++ b/comment/locallib.php @@ -61,7 +61,8 @@ class comment_manager { } $comments = array(); - $sql = "SELECT c.id, c.contextid, c.itemid, c.commentarea, c.userid, c.content, u.firstname, u.lastname, c.timecreated + $usernamefields = get_all_user_name_fields(true, 'u'); + $sql = "SELECT c.id, c.contextid, c.itemid, c.commentarea, c.userid, c.content, $usernamefields, c.timecreated FROM {comments} c JOIN {user} u ON u.id=c.userid @@ -74,8 +75,9 @@ class comment_manager { $item->time = userdate($item->timecreated); $item->content = format_text($item->content, FORMAT_MOODLE, $formatoptions); // Unset fields not related to the comment - unset($item->firstname); - unset($item->lastname); + foreach (get_all_user_name_fields() as $namefield) { + unset($item->$namefield); + } unset($item->timecreated); // Record the comment $comments[] = $item;
MDL-<I> reports: Update to the sql in the comment locallib to include additional name fields.
moodle_moodle
train
php
d89e64e5eeb20ae388a981df5824baa8db294dee
diff --git a/lib/que/utils/logging.rb b/lib/que/utils/logging.rb index <HASH>..<HASH> 100644 --- a/lib/que/utils/logging.rb +++ b/lib/que/utils/logging.rb @@ -42,8 +42,9 @@ module Que end def get_logger(internal: false) - l = internal ? internal_logger : logger - l.respond_to?(:call) ? l.call : l + if l = internal ? internal_logger : logger + l.respond_to?(:call) ? l.call : l + end end def log_formatter
In the <I>% case where there is no internal logger, don't bother checking what it responds to.
chanks_que
train
rb
a023bc18c79ac0f823ca7747b26c8d89f86b5e13
diff --git a/Model/TokenConfig.php b/Model/TokenConfig.php index <HASH>..<HASH> 100644 --- a/Model/TokenConfig.php +++ b/Model/TokenConfig.php @@ -45,7 +45,7 @@ class TokenConfig */ public function getKey($key = null) { - if ($key == null) { + if ($key === null) { return $this->defaultKey; }
Make sure to do a strict comparison
Happyr_GoogleSiteAuthenticatorBundle
train
php
7864124c3b1417677cdf4ab02138d505cffc4665
diff --git a/aeron-client/src/main/java/io/aeron/ClientConductor.java b/aeron-client/src/main/java/io/aeron/ClientConductor.java index <HASH>..<HASH> 100644 --- a/aeron-client/src/main/java/io/aeron/ClientConductor.java +++ b/aeron-client/src/main/java/io/aeron/ClientConductor.java @@ -31,6 +31,7 @@ import org.agrona.concurrent.status.UnsafeBufferPosition; import java.nio.channels.FileChannel; import java.util.ArrayList; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.LockSupport; import static java.util.concurrent.TimeUnit.MILLISECONDS; @@ -316,7 +317,7 @@ class ClientConductor implements Agent, DriverListener do { - Thread.yield(); + LockSupport.parkNanos(1); doWork(correlationId, expectedChannel);
[Java] Park nanos rather than yield in client conductor when awaiting a response to help prevent resource starvation.
real-logic_aeron
train
java
5f4da41d12be61208263e16c48ce92ef4edfbceb
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -1163,6 +1163,9 @@ const devices = [ ], toZigbee: [], meta: {configureKey: 1}, + whiteLabel: [ + {vendor: 'Samotech', model: 'SM301Z'}, + ], configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await bind(endpoint, coordinatorEndpoint, ['genBasic', 'genIdentify', 'genPowerCfg']);
Adds Samotech SM<I>Z as Tuya RH<I> white-label (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
9586332c579ce8ee707837133df0643244755e77
diff --git a/src/jquery.fancytree.dnd5.js b/src/jquery.fancytree.dnd5.js index <HASH>..<HASH> 100644 --- a/src/jquery.fancytree.dnd5.js +++ b/src/jquery.fancytree.dnd5.js @@ -601,7 +601,12 @@ } } // Let user modify above settings - return dndOpts.dragStart(node, data) !== false; + if (dndOpts.dragStart(node, data) !== false) { + return true; + } + // Clear dragged node to be safe + _clearGlobals(); + return false; case "drag": // Called every few miliseconds
If drag does not start, no drag data should be stored. (#<I>) * If drag does not start, no drag data should be stored. * CI fix * Copied previous commit to dist file * `grunt prettier` * Undo changes to /dist
mar10_fancytree
train
js
d474f9ba831cee82a2e93b7162928c9252780428
diff --git a/gala/potential/potential/core.py b/gala/potential/potential/core.py index <HASH>..<HASH> 100644 --- a/gala/potential/potential/core.py +++ b/gala/potential/potential/core.py @@ -1,5 +1,6 @@ # Standard library import abc +from collections import OrderedDict import copy as pycopy import warnings import uuid @@ -747,7 +748,7 @@ class PotentialBase(CommonBase, metaclass=abc.ABCMeta): return self.energy(*args, **kwargs) -class CompositePotential(PotentialBase, dict): +class CompositePotential(PotentialBase, OrderedDict): """ A potential composed of several distinct components. For example, two point masses or a galactic disk and halo, each with their own @@ -790,7 +791,7 @@ class CompositePotential(PotentialBase, dict): for v in kwargs.values(): self._check_component(v) - dict.__init__(self, **kwargs) + OrderedDict.__init__(self, **kwargs) self.R = None # TODO: this is a little messy
subclass composite from ordereddict after all
adrn_gala
train
py
39420461c8027ea1e47a1b18b0798b73e1fdbf74
diff --git a/packages/@uppy/companion/src/server/provider/dropbox/index.js b/packages/@uppy/companion/src/server/provider/dropbox/index.js index <HASH>..<HASH> 100644 --- a/packages/@uppy/companion/src/server/provider/dropbox/index.js +++ b/packages/@uppy/companion/src/server/provider/dropbox/index.js @@ -105,7 +105,8 @@ class DropBox extends Provider { .qs(query) .auth(token) .json({ - path: `${directory || ''}` + path: `${directory || ''}`, + include_non_downloadable_files: false }) .request(done) }
companion: exclude non downloadable files in fetched list for dropbox (#<I>)
transloadit_uppy
train
js
918df628e32e5ec1909336ff588ef3a299bca572
diff --git a/yabt/graph.py b/yabt/graph.py index <HASH>..<HASH> 100644 --- a/yabt/graph.py +++ b/yabt/graph.py @@ -334,7 +334,7 @@ def write_dot(build_context, conf: Config, out_f): """Write build graph in dot format to `out_f` file-like object.""" buildenvs = set(target.buildenv for target in build_context.targets.values() if target.buildenv is not None) - buildenv_targets = set() + buildenv_targets = set(buildenvs) for buildenv in buildenvs: buildenv_targets = buildenv_targets.union( descendants(build_context.target_graph, buildenv))
include buildenvs in buildenv targets
resonai_ybt
train
py
df0ce0e3899b470c8ca8c1135f356e4eaf388112
diff --git a/sacred/commandline_options.py b/sacred/commandline_options.py index <HASH>..<HASH> 100644 --- a/sacred/commandline_options.py +++ b/sacred/commandline_options.py @@ -171,8 +171,10 @@ def get_name(option): return option.__name__ -class HelpOption(CommandLineOption): +@cli_option("-h", "--help", is_flag=True) +def help_option(args, run): """Print this help message and exit.""" + pass @cli_option("-d", "--debug", is_flag=True) diff --git a/sacred/experiment.py b/sacred/experiment.py index <HASH>..<HASH> 100755 --- a/sacred/experiment.py +++ b/sacred/experiment.py @@ -595,6 +595,7 @@ DEFAULT_COMMAND_LINE_OPTIONS = [ mongo_db_option, sql_option, commandline_options.capture_option, + commandline_options.help_option, commandline_options.print_config_option, commandline_options.name_option, commandline_options.priority_option,
Used the new API for the help. (#<I>)
IDSIA_sacred
train
py,py
fb92f853fef2d1d12d3fb04883e4c61148c528a1
diff --git a/lib/Weasel/JsonMarshaller/Config/DoctrineAnnotations/JsonProperty.php b/lib/Weasel/JsonMarshaller/Config/DoctrineAnnotations/JsonProperty.php index <HASH>..<HASH> 100644 --- a/lib/Weasel/JsonMarshaller/Config/DoctrineAnnotations/JsonProperty.php +++ b/lib/Weasel/JsonMarshaller/Config/DoctrineAnnotations/JsonProperty.php @@ -34,7 +34,7 @@ class JsonProperty extends NoUndeclaredProperties implements IJsonProperty /** * @var bool */ - public $strict; + public $strict = true; /** * @return string
Resolves #<I> - Default JsonProperty "strict" to true Fix stupid typo. The default was right for the legacy annotations, but not the Doctrine ones.
moodev_php-weasel
train
php
dca7f6e756a27d04925161315c93b623b4f56bb7
diff --git a/java/src/com/google/template/soy/types/PrimitiveType.java b/java/src/com/google/template/soy/types/PrimitiveType.java index <HASH>..<HASH> 100644 --- a/java/src/com/google/template/soy/types/PrimitiveType.java +++ b/java/src/com/google/template/soy/types/PrimitiveType.java @@ -26,6 +26,9 @@ abstract class PrimitiveType extends SoyType { @Override public boolean equals(Object other) { + if (other == null) { + return false; + } return other.getClass() == this.getClass(); } diff --git a/java/tests/com/google/template/soy/sharedpasses/render/RenderVisitorTest.java b/java/tests/com/google/template/soy/sharedpasses/render/RenderVisitorTest.java index <HASH>..<HASH> 100644 --- a/java/tests/com/google/template/soy/sharedpasses/render/RenderVisitorTest.java +++ b/java/tests/com/google/template/soy/sharedpasses/render/RenderVisitorTest.java @@ -1699,6 +1699,9 @@ public class RenderVisitorTest { @Override public boolean equals(Object other) { + if (other == null) { + return false; + } return this.getClass() == other.getClass(); }
Adds a “null check and return false” code block in equals() method overridden by classes which would’ve otherwise thrown an NPE. See ​​​[] for more details. #equalsbrokenfornull-lsc Tested: []_presubmit: [] Some tests failed; test failures are believed to be unrelated to this CL ------------- Created by MOE: <URL>
google_closure-templates
train
java,java
ac71927eb2e2de59bae1707b31c04a8dbc36b249
diff --git a/matchers/image.go b/matchers/image.go index <HASH>..<HASH> 100644 --- a/matchers/image.go +++ b/matchers/image.go @@ -83,7 +83,7 @@ func CR2(buf []byte) bool { } func Tiff(buf []byte) bool { - return len(buf) > 3 && + return len(buf) > 9 && ((buf[0] == 0x49 && buf[1] == 0x49 && buf[2] == 0x2A && buf[3] == 0x0) || (buf[0] == 0x4D && buf[1] == 0x4D && buf[2] == 0x0 && buf[3] == 0x2A)) && // Differentiate Tiff from CR2
fix(tiff): check min length
h2non_filetype
train
go
8c4f36f972cd2c5e52404f1ba8d59cfcfe2c9099
diff --git a/src/Entity/XiboRegion.php b/src/Entity/XiboRegion.php index <HASH>..<HASH> 100644 --- a/src/Entity/XiboRegion.php +++ b/src/Entity/XiboRegion.php @@ -24,6 +24,8 @@ class XiboRegion extends XiboEntity public $left; public $zIndex; + public $playlists; + /** * Create Region * @param $layoutId @@ -44,9 +46,17 @@ class XiboRegion extends XiboEntity $this->layoutId = $regionLayoutId; $response = $this->doPost('/region/' . $this->layoutId, $this->toArray()); - - return $this->hydrate($response); + $region = $this->hydrate($response); + + foreach ($response['playlists'] as $item) { + $playlist = new XiboPlaylist($this->getEntityProvider()); + $playlist->hydrate($item); + + $region->playlists[] = $playlist; + } + + return $region; } /**
Updated region wrapper for playlists id
xibosignage_oauth2-xibo-cms
train
php
99747a93612c981cf302a626d7903e54c25df08e
diff --git a/billy/importers/names.py b/billy/importers/names.py index <HASH>..<HASH> 100644 --- a/billy/importers/names.py +++ b/billy/importers/names.py @@ -246,7 +246,7 @@ class NameMatcher(object): return self._names[chamber].get(name, None) -class CommitteeNameMatcher(NameMatcher): +class CommitteeNameMatcher(object): def __init__(self, abbr, term): self._names = {'upper': {}, 'lower': {}, None: {}} self._manual = {'upper': {}, 'lower': {}, None: {}, 'joint': {}}
no need to inherit from NameMatcher
openstates_billy
train
py
7483943984b0abd38c2f9b99f089721faaaadf1d
diff --git a/src/catgen/in/javasrc/CatalogDiffEngine.java b/src/catgen/in/javasrc/CatalogDiffEngine.java index <HASH>..<HASH> 100644 --- a/src/catgen/in/javasrc/CatalogDiffEngine.java +++ b/src/catgen/in/javasrc/CatalogDiffEngine.java @@ -442,8 +442,8 @@ public class CatalogDiffEngine { retval[0] = table.getTypeName(); retval[1] = String.format( - "Unable to restrict unique index %s because table %s is not empty.", - idx.getTypeName(), retval[0]); + "Unable to remove column %s from unique index %s because table %s is not empty.", + suspect.getTypeName(), idx.getTypeName(), retval[0]); return retval; }
ENG-<I>: Take Izzy's feedback.
VoltDB_voltdb
train
java
1ab2673a36e48fcf9ab5c2dff6045f05287e42f9
diff --git a/controllers/controllerhelpers/slack.go b/controllers/controllerhelpers/slack.go index <HASH>..<HASH> 100644 --- a/controllers/controllerhelpers/slack.go +++ b/controllers/controllerhelpers/slack.go @@ -3,9 +3,10 @@ package controllerhelpers import ( "fmt" "net/http" - "strings" + "bytes" "sync" "time" + "encoding/json" "github.com/Sirupsen/logrus" "github.com/TF2Stadium/Helen/config" @@ -17,6 +18,10 @@ type message struct { Message string } +type SlackMessage struct { + Text string `json:"text"` +} + var messages = make(chan message, 10) var once = new(sync.Once) @@ -24,8 +29,9 @@ func slackBroadcaster() { for { m := <-messages final := fmt.Sprintf("<https://steamcommunity.com/profiles/%s|%s>: %s", m.SteamID, m.Name, m.Message) - _, err := http.Post(config.Constants.SlackbotURL, "text/plain", - strings.NewReader(final)) + payload, _ := json.Marshal(SlackMessage{final}) + _, err := http.Post(config.Constants.SlackbotURL, "application/json", + bytes.NewReader(payload)) if err != nil { logrus.Error(err.Error())
Update slack messages to their new webhook style
TF2Stadium_Helen
train
go
5354b03e98d8d6838c423317bcc0616c5e0d0d96
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -30,12 +30,20 @@ describe('getResults(user, key, job)', function () { function output(name) { sha.checkSync(__dirname + '/output/' + name, sha.getSync(__dirname + '/fixtures/output/' + name)) } + function outputText(name) { + var expected = fs.readFileSync(__dirname + '/fixtures/output/' + name, 'utf8').replace(/\r/g, '') + var actual = fs.readFileSync(__dirname + '/output/' + name, 'utf8').replace(/\r/g, '') + if (actual !== expected) { + var err = new Error('Text equality check failed for ' + __dirname + '/output/' + name) + throw err + } + } output('0000screenshot.png') output('0001screenshot.png') output('0002screenshot.png') output('0003screenshot.png') - output('log.json') - output('selenium-server.log') + outputText('log.json') + outputText('selenium-server.log') output('video.flv') }) .nodeify(done)
Test text files differently to ignore `\r`
jepso-ci_get-sauce-results
train
js
ad2e18adca12d4c73560ac30669135e1a4806857
diff --git a/medoo.php b/medoo.php index <HASH>..<HASH> 100644 --- a/medoo.php +++ b/medoo.php @@ -2,7 +2,7 @@ /*! * Medoo database framework * http://medoo.in - * Version 0.9.6 + * Version 0.9.6.2 * * Copyright 2014, Angel Lai * Released under the MIT license
[release] Medoo <I>
catfan_Medoo
train
php
40b4337c1ea880eed9e04baff33f69ddcca5c88b
diff --git a/serviced/commands.go b/serviced/commands.go index <HASH>..<HASH> 100644 --- a/serviced/commands.go +++ b/serviced/commands.go @@ -716,7 +716,7 @@ func (cli *ServicedCli) CmdShell(args ...string) error { shellcmd += a + " " } proxyCmd := fmt.Sprintf("/serviced/%s -logtostderr=false proxy -autorestart=false %s '%s'", binary, service.Id, shellcmd) - cmdString := fmt.Sprintf("docker run -i -t -v %s -v %s %s %s", servicedVolume, pwdVolume, service.ImageId, proxyCmd) + cmdString := fmt.Sprintf("docker run -i -t -e COMMAND='%s' -v %s -v %s %s %s", service.Startup, servicedVolume, pwdVolume, service.ImageId, proxyCmd) glog.V(0).Infof("Starting: %s", cmdString) command := exec.Command("bash", "-c", cmdString) command.Stdout = os.Stdout
Setting COMMAND environment variable to service.Startup in the container
control-center_serviced
train
go
c42fa6083818ef39dcc014d269a6caee710ba8f8
diff --git a/lib/main.js b/lib/main.js index <HASH>..<HASH> 100644 --- a/lib/main.js +++ b/lib/main.js @@ -36,6 +36,10 @@ function addBuiltins(store) { store.add(new Interface('CallbackGame', { description: 'A placeholder, currently holds no information. Use BotFather to set up your game.', })) + store.add(new Interface('InputFile', { + description: 'This object represents the contents of a file to be uploaded. ' + + 'Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.', + })) // TODO: remove after parse UNIONS store.add(new Union('InputMessageContent', { description: 'This object represents the content of a message to be sent as a result of an inline query.',
feat: Add InputFile manually
sergeysova_telegram-typings
train
js
8344dc8e7580364a6ad9ce6f3cf8f050e0a463c7
diff --git a/src/descriptions/order.php b/src/descriptions/order.php index <HASH>..<HASH> 100644 --- a/src/descriptions/order.php +++ b/src/descriptions/order.php @@ -16,7 +16,7 @@ 'required' => false, 'type' => 'integer', 'location' => 'query', - 'maximum' => 10, + 'maximum' => 200, ], 'createdStartDate' => [ 'required' => true, @@ -85,7 +85,7 @@ 'required' => false, 'type' => 'integer', 'location' => 'query', - 'maximum' => 10, + 'maximum' => 200, ], 'nextCursor' => [ 'required' => false,
fix limits in order calls, close #<I>
fillup_walmart-partner-api-sdk-php
train
php
de6927129dde7c373973c0e9c3baac1e2daffdd1
diff --git a/components.js b/components.js index <HASH>..<HASH> 100644 --- a/components.js +++ b/components.js @@ -307,7 +307,7 @@ var DrawBuffer = { var x = (e.x - todraw.x < 0) ? 0 : (e.x - todraw.x), y = (e.y - todraw.y < 0) ? 0 : (e.y - todraw.y), w = Math.min(todraw.w - x, e.w, e.w - (todraw.x - e.x)), - h = Math.min(todraw.h - y, e.h, e.h - (todraw.y - e.y)); + h = Math.min(todraw.h - y, e.h, e.h - (todraw.y - Math.max(obj.y, e.y))); //console.log(todraw[0],x,y,w,h); layer[j].draw(x,y,w,h);
* Fixed error in height redraw segment, should choose the highest value... who knows. * Need to optimize, getting sluggish
craftyjs_Crafty
train
js
9f7fc0808e475d2aff93a548ef7edc5b7ef26fe0
diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/CustomResource.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/CustomResource.java index <HASH>..<HASH> 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/CustomResource.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/CustomResource.java @@ -145,7 +145,7 @@ public abstract class CustomResource<S extends KubernetesResource, T extends Kub public static String getSingular(Class<? extends CustomResource> clazz) { final Singular fromAnnotation = clazz.getAnnotation(Singular.class); - return (fromAnnotation != null ? fromAnnotation.value().toLowerCase(Locale.ROOT) : HasMetadata.getKind(clazz)).toLowerCase(Locale.ROOT); + return (fromAnnotation != null ? fromAnnotation.value() : HasMetadata.getKind(clazz)).toLowerCase(Locale.ROOT); } @JsonIgnore
refactor: apply toLowerCase to both branches
fabric8io_kubernetes-client
train
java
6886158f536fd6f09c40ac500c17f361239611df
diff --git a/ella/galleries/models.py b/ella/galleries/models.py index <HASH>..<HASH> 100644 --- a/ella/galleries/models.py +++ b/ella/galleries/models.py @@ -105,13 +105,12 @@ class Gallery(Publishable): @staticmethod def _request_finished_signal_receiver(**kwargs): + request_finished.disconnect( Gallery._request_finished_signal_receiver ) if hasattr(Gallery._request_finished_signal_receiver, 'affected_gallery'): affected_gallery = Gallery._request_finished_signal_receiver.affected_gallery affected_gallery.save() # save it again to make Gallery.photo saved (if necessary) Gallery._request_finished_signal_receiver.affected_gallery = None - request_finished.disconnect( Gallery._request_finished_signal_receiver ) - def save(self, **kwargs): if self.photo is None: if not self.pk:
little modification in signal handler. Refs #<I>
ella_ella
train
py
07bd508a54887ddb0f8f8d8dfc33081e9fbcc9aa
diff --git a/flask_assistant/manager.py b/flask_assistant/manager.py index <HASH>..<HASH> 100644 --- a/flask_assistant/manager.py +++ b/flask_assistant/manager.py @@ -20,7 +20,7 @@ class Context(dict): self.parameters[param_name] = value def get(self, param): - return self.parameters[param] + return self.parameters.get(param) def sync(self, context_json): self.__dict__.update(context_json) @@ -44,8 +44,6 @@ class ContextManager(): return context def get(self, context_name, default=None): - if default is None: - default = Context(context_name) return self._cache.get(context_name, default) def set(self, context_name, param, val): @@ -53,13 +51,12 @@ class ContextManager(): context.set(param, val) return context - def get_param(self, context_name, param): return self._cache[context_name].parameters[param] def update(self, contexts_json): for obj in contexts_json: - context = self.get(obj['name']) + context = Context(obj['name']) # TODO context.lifespan = obj['lifespan'] context.parameters = obj['parameters'] self._cache[context.name] = context
return None if calling get on a context that doesnt exist. - Fixes an issue where calling get would return a context that isn't tracked by the ContextManager update ContextManager with new Context instances, rather than looking up in cache.
treethought_flask-assistant
train
py
ecb5add03565775ce9f00a08cdda5496e9a633c3
diff --git a/app/helpers/no_cms/menus/menu_helper.rb b/app/helpers/no_cms/menus/menu_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/no_cms/menus/menu_helper.rb +++ b/app/helpers/no_cms/menus/menu_helper.rb @@ -36,7 +36,11 @@ module NoCms::Menus::MenuHelper options.reverse_merge! current_class: 'active', with_children_class: 'has-children' submenu_id = options.delete :submenu_id - submenu_class = options.delete :submenu_class + if options[:submenu_class].is_a? Array + submenu_class = options[:submenu_class].shift + else + submenu_class = options.delete :submenu_class + end content_tag(:ul, id: submenu_id, class: submenu_class) do raw menu_item.children.no_drafts.reorder(position: :asc).map{|c| show_submenu c, options }.join
Passing an array of classes allow to customize subsubmenus
simplelogica_nocms-menus
train
rb
52f58adf1ffa8729b78fe42120e29873d4c59642
diff --git a/luigi/static/visualiser/js/visualiserApp.js b/luigi/static/visualiser/js/visualiserApp.js index <HASH>..<HASH> 100644 --- a/luigi/static/visualiser/js/visualiserApp.js +++ b/luigi/static/visualiser/js/visualiserApp.js @@ -19,7 +19,7 @@ function visualiserApp(luigi) { } function taskToDisplayTask(task) { - var taskIdParts = /([A-Za-z]*)\((.*)\)/.exec(task.taskId); + var taskIdParts = /([A-Za-z0-9_]*)\((.*)\)/.exec(task.taskId); var taskName = taskIdParts[1]; var taskParams = taskIdParts[2]; var displayTime = new Date(Math.floor(task.start_time*1000)).toLocaleTimeString();
Fixes visualizer for taskids with _ and numbers in the name
spotify_luigi
train
js
42ffe3a5d60f606d5b380ce2929432d31ff4b960
diff --git a/pypika/terms.py b/pypika/terms.py index <HASH>..<HASH> 100644 --- a/pypika/terms.py +++ b/pypika/terms.py @@ -1260,7 +1260,7 @@ class Function(Criterion): return "{name}({args}{special})".format( name=self.name, args=",".join( - p.get_sql(with_alias=False, subquery=True, **kwargs) if hasattr(p, "get_sql") else str(p) + p.get_sql(with_alias=False, subquery=True, **kwargs) if hasattr(p, "get_sql") else self.get_arg_sql(p, **kwargs) for p in self.args ), special=(" " + special_params_sql) if special_params_sql else "",
get sql string as arg sql
kayak_pypika
train
py
daebb5418295ff127d68659f1a26296914af7cfe
diff --git a/test/controllers/controller_test.rb b/test/controllers/controller_test.rb index <HASH>..<HASH> 100644 --- a/test/controllers/controller_test.rb +++ b/test/controllers/controller_test.rb @@ -49,6 +49,20 @@ class PostsControllerTest < ActionController::TestCase assert_equal "All requests must use the '#{JSONAPI::MEDIA_TYPE}' Accept without media type parameters. This request specified '#{@request.headers['Accept']}'.", json_response['errors'][0]['detail'] end + def test_accept_header_all + @request.headers['Accept'] = "*/*" + + get :index + assert_response :success + end + + def test_accept_header_not_jsonapi + @request.headers['Accept'] = 'text/plain' + + get :index + assert_response :success + end + def test_exception_class_whitelist original_config = JSONAPI.configuration.dup JSONAPI.configuration.operations_processor = :error_raising
Add test for testing accept all header and non-jsonapi header. May need to change depending on discussion about this
cerebris_jsonapi-resources
train
rb
0e86ce95c25f2fcc068dcd024218d49750bebcf1
diff --git a/lib/util.js b/lib/util.js index <HASH>..<HASH> 100644 --- a/lib/util.js +++ b/lib/util.js @@ -88,14 +88,14 @@ exports.writeFileIfDiffers = function(path, content, force) { return QFS.exists(path) .then(function(exists) { if (force || !exists) return true; - return QFS.read(path, { charset: 'utf8' } ).then(function(current) { + return QFS.read(path, { charset: 'utf8' }).then(function(current) { return current !== content; }); }) .then(function(rewrite) { if (rewrite) { exports.mkdirs(PATH.dirname(path)); - return QFS.write(path, Array.isArray(content) ? content.join('') : content, { charset: 'utf8' }); + return exports.writeFile(path, content); } }); };
issue #<I>: writeFileIfDiffers shortened
bem-archive_bem-tools
train
js
3e7bc0341753731c36d8d04f4210072806fab1c9
diff --git a/src/menus/SidebarMenu.php b/src/menus/SidebarMenu.php index <HASH>..<HASH> 100644 --- a/src/menus/SidebarMenu.php +++ b/src/menus/SidebarMenu.php @@ -13,7 +13,7 @@ namespace hipanel\modules\stock\menus; use Yii; -class SidebarMenu extends \hiqdev\menumanager\Menu +class SidebarMenu extends \hiqdev\yii2\menus\Menu { public function items() {
redone yii2-thememanager -> yii2-menus
hiqdev_hipanel-module-stock
train
php
e56cb950fc99ff6a59b822368421b4f1cd8b43c4
diff --git a/step/step.go b/step/step.go index <HASH>..<HASH> 100644 --- a/step/step.go +++ b/step/step.go @@ -286,7 +286,8 @@ func (v *Vector) SetRange(start, end int, e Equaler) { if v.min.val.Equal(v.Zero) { v.min.pos = end } else { - v.t.Insert(&position{pos: end, val: v.Zero}) + v.min = &position{pos: end, val: v.Zero} + v.t.Insert(v.min) } fallthrough case end == v.min.pos: diff --git a/step/step_test.go b/step/step_test.go index <HASH>..<HASH> 100644 --- a/step/step_test.go +++ b/step/step_test.go @@ -621,6 +621,20 @@ func (s *S) TestSetRange_2(c *check.C) { }, "[1:0 5:1 10:<nil>]", }, + {5, 10, 0, + []posRange{ + {5, 10, 1}, + {1, 4, 1}, + }, + "[1:1 4:0 5:1 10:<nil>]", + }, + {1, 4, 0, + []posRange{ + {1, 4, 1}, + {5, 10, 1}, + }, + "[1:1 4:0 5:1 10:<nil>]", + }, } { sv, err := New(t.start, t.end, t.zero) c.Assert(err, check.Equals, nil)
Fix range extension logic for SetRange
biogo_store
train
go,go
49ec0a46a7ae12eae97a5d49c6bb1fbbb2752e2a
diff --git a/rundeckapp/grails-app/assets/javascripts/application.js b/rundeckapp/grails-app/assets/javascripts/application.js index <HASH>..<HASH> 100644 --- a/rundeckapp/grails-app/assets/javascripts/application.js +++ b/rundeckapp/grails-app/assets/javascripts/application.js @@ -495,7 +495,8 @@ function totalPageCount(max,total){ * @param offset * @param max * @param total - * @param options optional behavior configuration, {maxsteps: 10} the maximum number of page links to show, others will be skipped and a "skipped:true" page will be passed instead + * @param options optional behavior configuration, {maxsteps: 10} the maximum number of page links to show, others will + * be skipped and a "skipped:true" page will be passed instead * @param func function called with paging parameters: {offset:number, * prevPage: true/false, * nextPage: true/false, @@ -1126,3 +1127,17 @@ var generateId=(function(){ return id; } })(); +/** + * Returns the i18n message for the given code, or the code itself if message is not found. Requires + * calling the "g:jsMessages" tag from the taglib to define messages. + * @param code + * @returns {*} + */ +function message(code) { + if (typeof(window.Messages) != 'object') { + var msg = Messages[code]; + return msg ? msg : code; + } else { + return code; + } +} \ No newline at end of file
add method to get i<I>n messages from javascript
rundeck_rundeck
train
js
5a014aada69acb9fc5158e75a6a229eff4c71fc4
diff --git a/src/runtime/runtime.js b/src/runtime/runtime.js index <HASH>..<HASH> 100644 --- a/src/runtime/runtime.js +++ b/src/runtime/runtime.js @@ -340,12 +340,6 @@ return $Object(x); } - function assertObject(x) { - if (!isObject(x)) - throw $TypeError(x + ' is not an Object'); - return x; - } - // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-checkobjectcoercible function checkObjectCoercible(argument) { if (argument == null) { @@ -366,7 +360,6 @@ setupGlobals(global); global.$traceurRuntime = { - assertObject: assertObject, createPrivateName: createPrivateName, exportStar: exportStar, getOwnHashObject: getOwnHashObject,
Remove runtime remove assertObject This could not be included in the last commit due to self hostin issues. It required a npm push before it was safe to remove.
google_traceur-compiler
train
js
da12641b7faf3dd7992434a6243ac545a768712a
diff --git a/ocrd/ocrd/workspace.py b/ocrd/ocrd/workspace.py index <HASH>..<HASH> 100644 --- a/ocrd/ocrd/workspace.py +++ b/ocrd/ocrd/workspace.py @@ -186,6 +186,9 @@ class Workspace(): try: ocrd_file = next(self.mets.find_files(ID=ID)) except StopIteration: + if ID.startswith(REGEX_PREFIX): + # allow empty results if filter criteria involve a regex + return None raise FileNotFoundError("File %s not found in METS" % ID) if page_recursive and ocrd_file.mimetype == MIMETYPE_PAGE: with pushd_popd(self.directory):
Workspace.remove_file: no exception if empty but ID was a regex
OCR-D_core
train
py
c1639021e51773e7205700ed0ea1be4118fa8c3e
diff --git a/lib/predicates/equal.js b/lib/predicates/equal.js index <HASH>..<HASH> 100644 --- a/lib/predicates/equal.js +++ b/lib/predicates/equal.js @@ -17,10 +17,10 @@ var rQuotes = /"|'/g, lookupIsNumeric = isNumeric( lookup ), getIsNumeric = isNumeric( get ); - if ( (lookup !== undefined) || lookupIsNumeric ) { + if ( (lookup !== undefined && lookup !== "") || lookupIsNumeric ) { arg = lookup; - } else if ( (get !== undefined) || getIsNumeric ) { + } else if ( (get !== undefined && get !== "") || getIsNumeric ) { arg = get; }
Account for empty strings in .equal? lookups.
NodeSquarespace_node-squarespace-jsont
train
js
734027271992124144fd49a6bd7f6d991827c649
diff --git a/app/mixins/patient-list-route.js b/app/mixins/patient-list-route.js index <HASH>..<HASH> 100644 --- a/app/mixins/patient-list-route.js +++ b/app/mixins/patient-list-route.js @@ -26,6 +26,10 @@ export default Ember.Mixin.create({ returnToPatient: function() { this.controller.send('returnToPatient'); this.controller.send('closeModal'); + }, + + returnToVisit: function() { + this.controller.send('returnToVisit'); } },
Fix return to visit from add imaging and lab. Fixes #<I>
HospitalRun_hospitalrun-frontend
train
js
b48a40c91f96195e486598a5e06f986e998ad8b5
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -29,7 +29,7 @@ return array( 'label' => 'QTI test model', 'description' => 'TAO QTI test implementation', 'license' => 'GPL-2.0', - 'version' => '16.2.2', + 'version' => '16.2.3', 'author' => 'Open Assessment Technologies', 'requires' => array( 'taoTests' => '>=6.5.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -1611,6 +1611,6 @@ class Updater extends \common_ext_ExtensionUpdater { $this->setVersion('16.2.0'); } - $this->skip('16.2.0', '16.2.2'); + $this->skip('16.2.0', '16.2.3'); } }
Bump patch version (again) tao-<I>
oat-sa_extension-tao-testqti
train
php,php
e405e3c8c5c2de2e037008900e2bd0ee03284219
diff --git a/closer.go b/closer.go index <HASH>..<HASH> 100644 --- a/closer.go +++ b/closer.go @@ -14,11 +14,17 @@ func (errs MultiError) Error() string { return "multiple errors" } -func NewMultiError(errs []error) error { - if len(errs) == 0 { +func MergeErrors(errs ...error) error { + var nonNilErrs []error + for _, err := range errs { + if err != nil { + nonNilErrs = append(nonNilErrs, err) + } + } + if len(nonNilErrs) == 0 { return nil } - return MultiError(errs) + return MultiError(nonNilErrs) } func Close(resource io.Closer, properties ...interface{}) error { @@ -45,7 +51,7 @@ func CloseAll(resources []io.Closer, properties ...interface{}) error { errs = append(errs, err) } } - return NewMultiError(errs) + return MergeErrors(errs...) } type funcResource struct {
rename NewMultiError to MergeErrors
v2pro_plz
train
go
05be2422a5fec7fc35d90e193ffd0b0e8e2036ad
diff --git a/hazelcast/src/test/java/com/hazelcast/topic/impl/reliable/LossToleranceTest.java b/hazelcast/src/test/java/com/hazelcast/topic/impl/reliable/LossToleranceTest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/topic/impl/reliable/LossToleranceTest.java +++ b/hazelcast/src/test/java/com/hazelcast/topic/impl/reliable/LossToleranceTest.java @@ -56,6 +56,7 @@ public class LossToleranceTest extends HazelcastTestSupport { .setAsyncBackupCount(0)); final HazelcastInstance[] instances = createHazelcastInstanceFactory(2).newInstances(config); + warmUpPartitions(instances); for (HazelcastInstance instance : instances) { final Member owner = instance.getPartitionService().getPartition(TOPIC_RB_PREFIX + RELIABLE_TOPIC_NAME).getOwner(); final Member localMember = instance.getCluster().getLocalMember();
Fixes uninitialized partition in LossToleranceTest whenLossTolerant_andOwnerCrashes_thenContinue test uses partition service to determine the owner of reliable topic's owner. The owner partition is killed during the test. However owner partition may be null because the partition table was not updated yet. This fix adds warmup stage so that partition owner is guaranteed to be non-null at the time of querying. Fixes #<I>
hazelcast_hazelcast
train
java
1617a389fbaaf8c2507cd60c854e685fcd17b717
diff --git a/shinken/macroresolver.py b/shinken/macroresolver.py index <HASH>..<HASH> 100644 --- a/shinken/macroresolver.py +++ b/shinken/macroresolver.py @@ -68,6 +68,17 @@ class MacroResolver(Borg): 'EVENTSTARTTIME': '_get_events_start_time', } + output_macros = [ + 'HOSTOUTPUT', + 'HOSTPERFDATA', + 'HOSTACKAUTHOR', + 'HOSTACKCOMMENT', + 'SERVICEOUTPUT', + 'SERVICEPERFDATA', + 'SERVICEACKAUTHOR', + 'SERVICEACKCOMMENT' + ] + # This must be called ONCE. It just put links for elements # by scheduler def init(self, conf): @@ -90,7 +101,6 @@ class MacroResolver(Borg): self.contactgroups = conf.contactgroups self.lists_on_demand.append(self.contactgroups) self.illegal_macro_output_chars = conf.illegal_macro_output_chars - self.output_macros = ['HOSTOUTPUT', 'HOSTPERFDATA', 'HOSTACKAUTHOR', 'HOSTACKCOMMENT', 'SERVICEOUTPUT', 'SERVICEPERFDATA', 'SERVICEACKAUTHOR', 'SERVICEACKCOMMENT'] # Try cache :) #self.cache = {}
fix macroresolver error from eltdetail template Define output_macros as a class variable instead of an object variable Fixes problem found in shinken-monitoring/mod-webui#<I>
Alignak-monitoring_alignak
train
py
06a95bc371129b256e57839c3a5b6543d9babc55
diff --git a/wal_e/cmd.py b/wal_e/cmd.py index <HASH>..<HASH> 100755 --- a/wal_e/cmd.py +++ b/wal_e/cmd.py @@ -302,8 +302,7 @@ def main(argv=None): backup_cxt.wal_s3_archive(args.WAL_SEGMENT) elif subcommand == 'delete': # Set up pruning precedence, optimizing for *not* deleting data - print args - + # # Canonicalize the passed arguments into the value # "is_dry_run_really" if args.dry_run is False and args.force is True:
Remove a stray debugging print
wal-e_wal-e
train
py
167ab9971c73fb671ea1a467e7be90882fafac7a
diff --git a/newsletter-bundle/src/Resources/contao/classes/Newsletter.php b/newsletter-bundle/src/Resources/contao/classes/Newsletter.php index <HASH>..<HASH> 100644 --- a/newsletter-bundle/src/Resources/contao/classes/Newsletter.php +++ b/newsletter-bundle/src/Resources/contao/classes/Newsletter.php @@ -445,7 +445,7 @@ class Newsletter extends \Backend foreach ($arrUploaded as $strCsvFile) { - $objFile = new \File($strCsvFile); + $objFile = new \File($strCsvFile, true); if ($objFile->extension != 'csv') {
[Newsletter] Adjust the core files to trigger the new `$blnDoNotCreate` option
contao_contao
train
php
c8373d0b7cf47adf068e44dca7413979567c3463
diff --git a/dwave/system/package_info.py b/dwave/system/package_info.py index <HASH>..<HASH> 100644 --- a/dwave/system/package_info.py +++ b/dwave/system/package_info.py @@ -15,7 +15,7 @@ # ============================================================================= __all__ = ['__version__', '__author__', '__authoremail__', '__description__'] -__version__ = '1.2.0' +__version__ = '1.2.1' __author__ = 'D-Wave Systems Inc.' __authoremail__ = '[email protected]' __description__ = 'All things D-Wave System.'
Release version <I> Fixes --- - Doctest
dwavesystems_dwave-system
train
py
03befeec494ca3db352e0ea367164930cfb0031f
diff --git a/src/ReCaptcha.php b/src/ReCaptcha.php index <HASH>..<HASH> 100644 --- a/src/ReCaptcha.php +++ b/src/ReCaptcha.php @@ -93,6 +93,7 @@ class ReCaptcha extends Base implements \Nails\Captcha\Interfaces\Driver .execute('$sClientKey', {action: '$sAction'}) .then(function(token) { field.value = token; + form.submit(); }); }); });
Submit form when recaptcha token is generated
nails_driver-captcha-recaptcha
train
php
85413d1764ac0b94e01efd44dd19287aae263691
diff --git a/lib/xmpp/c2s.js b/lib/xmpp/c2s.js index <HASH>..<HASH> 100644 --- a/lib/xmpp/c2s.js +++ b/lib/xmpp/c2s.js @@ -26,7 +26,7 @@ function C2SServer(options) { // And now start listening to connections on the port provided as an option. net.createServer(function (inStream) { self.acceptConnection(inStream); - }).listen(options.port); + }).listen(options.port || 5222, options.domain || '::'); // Load TLS key material if (options.tls) {
allow the specification of the interface and the port on which to listen for C2S connections
xmppjs_xmpp.js
train
js
f21cabf5e03d5b47306383324b9bd3fcc9c8f8e2
diff --git a/hydpy/core/parametertools.py b/hydpy/core/parametertools.py index <HASH>..<HASH> 100644 --- a/hydpy/core/parametertools.py +++ b/hydpy/core/parametertools.py @@ -571,7 +571,10 @@ class MultiParameter(Parameter): nested list. If the compression fails, a :class:`~exceptions.NotImplementedError` is raised. """ - unique = numpy.unique(self.values) + if self.value is None: + unique = numpy.array([numpy.nan]) + else: + unique = numpy.unique(self.values) if sum(numpy.isnan(unique)) == len(unique.flatten()): unique = numpy.array([numpy.nan]) else:
Use "nan" for string representations of MultiParameter instances with None values
hydpy-dev_hydpy
train
py
84427639afd2a82552c602820a3e4713cf58b685
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -29,12 +29,6 @@ func newOvsdbClient(c *rpc2.Client) *OvsdbClient { Schema: make(map[string]DatabaseSchema), handlersMutex: &sync.Mutex{}, } - connectionsMutex.Lock() - defer connectionsMutex.Unlock() - if connections == nil { - connections = make(map[*rpc2.Client]*OvsdbClient) - } - connections[c] = ovs return ovs } @@ -107,6 +101,7 @@ func newRPC2Client(conn net.Conn) (*OvsdbClient, error) { // Process Async Notifications dbs, err := ovs.ListDbs() if err != nil { + c.Close() return nil, err } @@ -115,9 +110,17 @@ func newRPC2Client(conn net.Conn) (*OvsdbClient, error) { if err == nil { ovs.Schema[db] = *schema } else { + c.Close() return nil, err } } + + connectionsMutex.Lock() + defer connectionsMutex.Unlock() + if connections == nil { + connections = make(map[*rpc2.Client]*OvsdbClient) + } + connections[c] = ovs return ovs, nil }
cleanup the underlying rpc client on erros in newRPC2Client() currently we don't close the RPC connection on failures and also don't remove the stale RPC client connection from the `connections` map
socketplane_libovsdb
train
go
322d7d65b54033034954d9324d2056b32132ed2d
diff --git a/lib/Sabre/DAV/Server.php b/lib/Sabre/DAV/Server.php index <HASH>..<HASH> 100644 --- a/lib/Sabre/DAV/Server.php +++ b/lib/Sabre/DAV/Server.php @@ -536,11 +536,11 @@ class Sabre_DAV_Server { $start = $range[0]; $end = $range[1]?$range[1]:$nodeSize-1; - if($start > $nodeSize) + if($start >= $nodeSize) throw new Sabre_DAV_Exception_RequestedRangeNotSatisfiable('The start offset (' . $range[0] . ') exceeded the size of the entity (' . $nodeSize . ')'); if($end < $start) throw new Sabre_DAV_Exception_RequestedRangeNotSatisfiable('The end offset (' . $range[1] . ') is lower than the start offset (' . $range[0] . ')'); - if($end > $nodeSize) $end = $nodeSize-1; + if($end >= $nodeSize) $end = $nodeSize-1; } else {
Fixed Content-Range comparison. Fixes Issue <I>.
sabre-io_dav
train
php
4f32141667ba551fe42454baef56ba2415a7c36d
diff --git a/app/serializers/stack_serializer.rb b/app/serializers/stack_serializer.rb index <HASH>..<HASH> 100644 --- a/app/serializers/stack_serializer.rb +++ b/app/serializers/stack_serializer.rb @@ -3,7 +3,7 @@ class StackSerializer < ActiveModel::Serializer has_one :lock_author attributes :id, :repo_owner, :repo_name, :environment, :html_url, :url, :tasks_url, - :undeployed_commits_count, :is_locked, :lock_reason, :created_at, :updated_at + :undeployed_commits_count, :is_locked, :lock_reason, :continuous_deployment, :created_at, :updated_at def url api_stack_url(object)
Expose Stack#continuous_deployment in the serializer
Shopify_shipit-engine
train
rb
53de5632c7a6b5b191e3e075899a4f68137aa169
diff --git a/lib/component.js b/lib/component.js index <HASH>..<HASH> 100644 --- a/lib/component.js +++ b/lib/component.js @@ -189,7 +189,7 @@ function build(string, opts, readFile) { script = script.replace(/\$PARTIALS\['([-a-zA-Z0-9_\/]+)'\]/g, (m, n) => stringify({ v: list[2].v, t: list[2].p[n] || '' }, opts) ); - script = script.replace(/\$PARTIALS/g, stringify(list[1], opts)); + script = script.replace(/\$PARTIALS/g, stringify(list[2].p || {}, opts)); return reducePromiseFunctions(opts.scriptProcessors, script); });
bin: use parsed partials object for sub rather than string object
ractivejs_ractive
train
js
98aa3b07911bdcfa6c1d608789a9d01e81037a3a
diff --git a/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/ObjectSequence.java b/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/ObjectSequence.java index <HASH>..<HASH> 100644 --- a/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/ObjectSequence.java +++ b/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/ObjectSequence.java @@ -78,6 +78,16 @@ public class ObjectSequence<T> { return underlying.isEmpty(); } + public Object[] toArray() { + return stream().toArray(); + } + + public <T> T[] toArray(T[] a) { + return stream().toArray((size) -> { + return (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size); + }); + } + public ObjectSequence<T> reverse() { return new ObjectSequence<>(underlying.reverse(), fn, sorted, nonnull, distinct); }
Add toArray functions to ObjectSequence.
groupon_monsoon
train
java
173117a56e2ff086633204e38500de0fb92c64b4
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -6,7 +6,6 @@ require "active_record/relation/merger" module ActiveRecord module SpawnMethods - # This is overridden by Associations::CollectionProxy def spawn # :nodoc: already_in_scope?(klass.scope_registry) ? klass.all : clone end
Remove outdated comment of ActiveRecord's spawn method.
rails_rails
train
rb
831d4a2c937a0f3079b8927276c5a797d4573a29
diff --git a/commands/review/post/command.go b/commands/review/post/command.go index <HASH>..<HASH> 100644 --- a/commands/review/post/command.go +++ b/commands/review/post/command.go @@ -237,8 +237,7 @@ You are about to post review requests for the following commits: return errs.NewError(task, err, nil) } if !confirmed { - fmt.Println("\nFair enough, have a nice day!") - return nil + prompt.PanicCancel() } fmt.Println()
review post: Fix the followup message The followup message was being printed even though the operation was canceled by inserting N when prompted to confirm the operation. This should be now fixed. Change-Id: e<I>cd5 Story-Id: unassigned
salsaflow_salsaflow
train
go
492a3862b63e41bbff085b5034750f4b1b218297
diff --git a/tests/test_kvstore.py b/tests/test_kvstore.py index <HASH>..<HASH> 100644 --- a/tests/test_kvstore.py +++ b/tests/test_kvstore.py @@ -180,6 +180,7 @@ class TestBsddbStore(unittest.TestCase, KVStoreBase): def setUpClass(cls): try: import bsddb + bsddb # reference bsddb to satisfy pyflakes except ImportError: raise unittest.SkipTest("bsddb not installed")
Reference bsddb after its import, to satisfy pyflakes
pteichman_cobe
train
py
399399f89e9c60c3ab91841665e1c3ac7895e0eb
diff --git a/salt/modules/localemod.py b/salt/modules/localemod.py index <HASH>..<HASH> 100644 --- a/salt/modules/localemod.py +++ b/salt/modules/localemod.py @@ -274,4 +274,4 @@ def gen_locale(locale): cmd.append('--generate') cmd.append(locale) - return __salt__['cmd.retcode'](cmd, python_shell=False) + return __salt__['cmd.retcode'](cmd, python_shell=False) == 0
localemod.gen_locale now always returns a boolean Related to #<I>, also fixes #<I>.
saltstack_salt
train
py
433d4523198c0fa764b42c9b1de538c23617dd3f
diff --git a/packages/vaex-core/vaex/dataset.py b/packages/vaex-core/vaex/dataset.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/vaex/dataset.py +++ b/packages/vaex-core/vaex/dataset.py @@ -1067,9 +1067,6 @@ class Dataset(object): arguments = _ensure_strings_from_expressions(arguments) return lazy_function(*arguments) - - - def unique(self, expression): def map(ar): # this will be called with a chunk of the data return np.unique(ar) # returns the unique elements
fix: Dataset.apply removed print statements and dead code
vaexio_vaex
train
py
b9b1a44c285b50c79220a751b555ed44285db7b4
diff --git a/lib/6to5/transformation/transformers/es6/block-scoping.js b/lib/6to5/transformation/transformers/es6/block-scoping.js index <HASH>..<HASH> 100644 --- a/lib/6to5/transformation/transformers/es6/block-scoping.js +++ b/lib/6to5/transformation/transformers/es6/block-scoping.js @@ -211,12 +211,20 @@ LetScoping.prototype.needsClosure = function () { var call = t.callExpression(fn, params); var ret = this.scope.generateUidIdentifier("ret"); + // handle generators var hasYield = traverse.hasType(fn.body, this.scope, "YieldExpression", t.FUNCTION_TYPES); if (hasYield) { fn.generator = true; call = t.yieldExpression(call, true); } + // handlers async functions + var hasAsync = traverse.hasType(fn.body, this.scope, "AwaitExpression", t.FUNCTION_TYPES); + if (hasAsync) { + fn.async = true; + call = t.awaitExpression(call, true); + } + this.build(ret, call); };
support async await inside of let scoping closure wrapper - fixes #<I>
babel_babel
train
js
57a49c12b2d1ea348dcee73f9e00f9189fc0906c
diff --git a/lib/dimples/configuration.rb b/lib/dimples/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/dimples/configuration.rb +++ b/lib/dimples/configuration.rb @@ -80,7 +80,8 @@ module Dimples def self.default_file_extensions { 'pages' => 'html', - 'posts' => 'html' + 'posts' => 'html', + 'feeds' => 'atom' } end
Added a config entry for feed file extensions.
waferbaby_dimples
train
rb
f72ac7f5e4f2d77a403a0ba79ef9aa6a7c2326c1
diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -163,7 +163,7 @@ class UrlGenerator implements UrlGeneratorContract if ($url) { return $url; - } else if ($fallback) { + } elseif ($fallback) { return $this->to($fallback); } else { return $this->to('/'); @@ -443,7 +443,7 @@ class UrlGenerator implements UrlGeneratorContract return preg_replace_callback('/\{(.*?)\??\}/', function ($m) use (&$parameters, $defaultNamedParameters) { if (isset($parameters[$m[1]])) { return Arr::pull($parameters, $m[1]); - } else if (isset($defaultNamedParameters[$m[1]])) { + } elseif (isset($defaultNamedParameters[$m[1]])) { return $defaultNamedParameters[$m[1]]; } else { return $m[0];
Update UrlGenerator.php
laravel_framework
train
php
8fd09ffe4a985db3da0c4abdb2138f10d2193adb
diff --git a/soco.py b/soco.py index <HASH>..<HASH> 100644 --- a/soco.py +++ b/soco.py @@ -376,6 +376,7 @@ class SoCo(object): """ if bass is not False: + bass = max(-10, min(bass, 10)) # Coerce in range body = SET_BASS_BODY_TEMPLATE.format(bass=bass) response = self.__send_command(RENDERING_ENDPOINT, SET_BASS_ACTION, body) @@ -411,6 +412,7 @@ class SoCo(object): """ if treble is not False: + treble = max(-10, min(treble, 10)) # Coerce in range body = SET_TREBLE_BODY_TEMPLATE.format(treble=treble) response = self.__send_command(RENDERING_ENDPOINT, SET_TREBLE_ACTION, body)
Coerce bass and treble input in range
amelchio_pysonos
train
py
8df0ebd6021729536f82bd4b621f458534179c0f
diff --git a/lib/QueryBuilder/QueryBuilder.php b/lib/QueryBuilder/QueryBuilder.php index <HASH>..<HASH> 100644 --- a/lib/QueryBuilder/QueryBuilder.php +++ b/lib/QueryBuilder/QueryBuilder.php @@ -72,10 +72,16 @@ class QueryBuilder } /** + * @param bool $new + * * @return WhereBuilder */ - public function getWhereBuilder() + public function getWhereBuilder($new = false) { + if ($new) { + return new WhereBuilder(); + } + if (null == self::$whereBuilder) { $this->resetWhereBuilder(); } @@ -84,6 +90,14 @@ class QueryBuilder } /** + * @return WhereBuilder + */ + public function expr() + { + return $this->getWhereBuilder(true); + } + + /** * @return array */ public function getSelect() diff --git a/lib/QueryBuilder/WhereBuilder.php b/lib/QueryBuilder/WhereBuilder.php index <HASH>..<HASH> 100644 --- a/lib/QueryBuilder/WhereBuilder.php +++ b/lib/QueryBuilder/WhereBuilder.php @@ -265,11 +265,9 @@ class WhereBuilder } /** - * @param self $builder - * - * @return self + * @return WhereBuilder */ - public function orX(self $builder) + public function orX() { $clause = func_get_args(); $builder = new self('orX');
Updated qb and wb
mautic_api-library
train
php,php
4e50442eefc561e6f7cb415702f03b6b3d095663
diff --git a/pyvisa-py/sessions.py b/pyvisa-py/sessions.py index <HASH>..<HASH> 100644 --- a/pyvisa-py/sessions.py +++ b/pyvisa-py/sessions.py @@ -163,8 +163,11 @@ class Session(compat.with_metaclass(abc.ABCMeta)): :type resource_class: str """ # noinspection PyUnusedLocal - def _internal(*args, **kwargs): - raise ValueError(msg) + class _internal(object): + session_issue = msg + + def __init__(self, *args, **kwargs): + raise ValueError(msg) _internal.session_issue = msg
Fix <I> : change _internal from function to class
pyvisa_pyvisa-py
train
py
5a0c9a51996952787fa7d77dc1635661c4369f0c
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -122,7 +122,8 @@ func (b *Bucket) Do(k string, f func(mc *memcached.Client, vb uint16) error) (er if i, ok := err.(*gomemcached.MCResponse); ok { st := i.Status - retry = st == gomemcached.NOT_MY_VBUCKET + retry = (st == gomemcached.NOT_MY_VBUCKET || st == gomemcached.NOT_SUPPORTED) + } // MB-28842: in case of NMVB, check if the node is still part of the map @@ -354,8 +355,9 @@ func (b *Bucket) doBulkGet(vb uint16, keys []string, reqDeadline time.Time, switch err.(type) { case *gomemcached.MCResponse: + notSMaxTries := len(b.Nodes()) * 2 st := err.(*gomemcached.MCResponse).Status - if st == gomemcached.NOT_MY_VBUCKET { + if st == gomemcached.NOT_MY_VBUCKET || (st == gomemcached.NOT_SUPPORTED && attempts < notSMaxTries) { b.Refresh() discard = b.checkVBmap(pool.Node()) return nil // retry
MB-<I> Add retry logic to rerun xattr queries when they get NOT_SUPPORTED error from gomemcached. Max number of retries will be twice the number of nodes. Change-Id: Ic<I>db<I>c<I>bdd<I>e<I> Reviewed-on: <URL>
couchbase_go-couchbase
train
go
675f2d1f49a643e53948f17876452fb53a560b12
diff --git a/app/models/concerns/acts_as_purchasable.rb b/app/models/concerns/acts_as_purchasable.rb index <HASH>..<HASH> 100644 --- a/app/models/concerns/acts_as_purchasable.rb +++ b/app/models/concerns/acts_as_purchasable.rb @@ -27,7 +27,7 @@ module ActsAsPurchasable scope :sold, -> { purchased() } scope :sold_by, lambda { |user| joins(:order_items).joins(:orders).where(:order_items => {:seller_id => user.try(:id)}).where(:orders => {:purchase_state => EffectiveOrders::PURCHASED}).uniq } - scope :not_purchased, -> { where('id NOT IN (?)', purchased.map(&:id)) } + scope :not_purchased, -> { where('id NOT IN (?)', purchased.pluck(:id).presence || [0]) } end module ClassMethods
Fix for ActsAsPurchasable.not_purchased scope
code-and-effect_effective_orders
train
rb
8227ddb99e322f7ee69e21a084866cf3411d3aac
diff --git a/src/ContextTypes/Product.php b/src/ContextTypes/Product.php index <HASH>..<HASH> 100644 --- a/src/ContextTypes/Product.php +++ b/src/ContextTypes/Product.php @@ -25,6 +25,9 @@ class Product extends AbstractContext 'category' => null, 'model' => null, 'isSimilarTo' => Product::class, + 'height' => QuantitativeValue::class, + 'width' => QuantitativeValue::class, + 'weight' => QuantitativeValue::class, ];
Add dimensions and weight to a Product context
Torann_json-ld
train
php
3d43d866d6629863d91861f29638c1a31750ba57
diff --git a/lib/puppet/util/classgen.rb b/lib/puppet/util/classgen.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/util/classgen.rb +++ b/lib/puppet/util/classgen.rb @@ -124,11 +124,23 @@ module Puppet::Util::ClassGen klass end + # const_defined? in Ruby 1.9 behaves differently in terms + # of which class hierarchy it polls for nested namespaces + # + # See http://redmine.ruby-lang.org/issues/show/1915 + def is_constant_defined?(const) + if ::RUBY_VERSION =~ /1.9/ + const_defined?(const, false) + else + const_defined?(const) + end + end + # Handle the setting and/or removing of the associated constant. def handleclassconst(klass, name, options) const = genconst_string(name, options) - if const_defined?(const) + if is_constant_defined?(const) if options[:overwrite] Puppet.info "Redefining #{name} in #{self}" remove_const(const)
(#<I>) Fix constant_defined?
puppetlabs_puppet
train
rb
2927ad71932c3ded3495935c631ed3ca9100592b
diff --git a/src/Forms.php b/src/Forms.php index <HASH>..<HASH> 100644 --- a/src/Forms.php +++ b/src/Forms.php @@ -175,4 +175,19 @@ class Forms { return Tags\Form::close(); } + + /** + * @param string $arg + * @return string + */ + public function formGroup($arg='') + { + $html = '<div class="form-group">'; + $args = func_get_args(); + foreach($args as $element) { + $html .= $element; + } + $html .= "\n</div>"; + return $html; + } } \ No newline at end of file
add formGroup method for bootstrap style form element.
TuumPHP_Form
train
php
fc579a5a227d2b3b0c6d860a2bd708f6ae1db94e
diff --git a/lib/units/measure.rb b/lib/units/measure.rb index <HASH>..<HASH> 100644 --- a/lib/units/measure.rb +++ b/lib/units/measure.rb @@ -123,6 +123,7 @@ module Units else units[dim] = [unit, mult] end + units.delete dim if units[dim].last == 0 factor end
Fix bug in units combination (failing to simplify nulled units)
jgoizueta_units-system
train
rb
b86f8f9240125b5b28264c6ab77bb1223140cb8f
diff --git a/files.go b/files.go index <HASH>..<HASH> 100644 --- a/files.go +++ b/files.go @@ -80,6 +80,7 @@ type Metadata struct { Tag string `json:".tag"` Name string `json:"name"` PathLower string `json:"path_lower"` + PathDisplay string `json:"path_display"` ClientModified time.Time `json:"client_modified"` ServerModified time.Time `json:"server_modified"` Rev string `json:"rev"`
add missing path_display to file metadata
tj_go-dropbox
train
go
97eddc0d0548ba34976237906e9c09dbf487bc0c
diff --git a/attitude/display/test_hyperbolic_errors.py b/attitude/display/test_hyperbolic_errors.py index <HASH>..<HASH> 100644 --- a/attitude/display/test_hyperbolic_errors.py +++ b/attitude/display/test_hyperbolic_errors.py @@ -6,7 +6,7 @@ expressions. import numpy as N from scipy.stats import chi2 -from .plot.cov_types.regressions import as_hyperbola, hyperbola +from .plot.cov_types.regressions import hyperbola from ..orientation.test_pca import random_pca from ..geom import dot
Broke out some things in PCA fitting routine
davenquinn_Attitude
train
py
db4631cc2cb5cc6e716efe4b983c800f415132f9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,9 @@ 'use strict' -module.exports = [ +module.exports = { fromMs, toMs -] +} const zeroFill = require('zero-fill') @@ -17,7 +17,7 @@ function fromMs (ms, format = 'hh:mm:ss') { } let hours = Math.floor(ms / 3600000) - let minutes = Math.floor(ms % 3600000 / 60) + let minutes = Math.floor(ms % 3600000 / 60000) let seconds = Math.floor(ms % 60000 / 1000) let miliseconds = Math.floor(ms % 1000)
fromMs(): Fix minute extraction
Goldob_hh-mm-ss
train
js
633265a58312fc8db40c9803b8b875a2c934154b
diff --git a/controllers/notifications-controller.js b/controllers/notifications-controller.js index <HASH>..<HASH> 100644 --- a/controllers/notifications-controller.js +++ b/controllers/notifications-controller.js @@ -17,7 +17,8 @@ module.exports = function(opts) { type_string = req.query.types, exclude_failed_string = req.query.exclude_failed, types = [], - new_url = req.originalUrl; + new_url = req.originalUrl, + exclude_failed = (exclude_failed_string === 'true'); // If query string parameters are not set, redirect to include them @@ -45,7 +46,7 @@ module.exports = function(opts) { account: account, identifier: identifier, types: types, - exclude_failed: exclude_failed_string === 'true' + exclude_failed: exclude_failed }, function(err, notification){ if (err) { ErrorController.reportError(err, res);
[FIX] Fixed notification bug causing server to crash
ripple_ripple-rest
train
js
c715aacdc24da6d4ce2edde7c96d3fc0424d3451
diff --git a/cmd/kube-scheduler/app/server.go b/cmd/kube-scheduler/app/server.go index <HASH>..<HASH> 100644 --- a/cmd/kube-scheduler/app/server.go +++ b/cmd/kube-scheduler/app/server.go @@ -81,7 +81,8 @@ and capacity. The scheduler needs to take into account individual and collective resource requirements, quality of service requirements, hardware/software/policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, deadlines, and so on. Workload-specific requirements will be exposed -through the API as necessary.`, +through the API as necessary. See [scheduling](https://kubernetes.io/docs/concepts/scheduling/) +for more information about scheduling and the kube-scheduler component.`, Run: func(cmd *cobra.Command, args []string) { if err := runCommand(cmd, args, opts, registryOptions...); err != nil { fmt.Fprintf(os.Stderr, "%v\n", err)
Add simple reference to synopsis of kube-scheduler
kubernetes_kubernetes
train
go
f0e021d7f47fb9b525ce1327dab77ead85bee780
diff --git a/test/webpack.config.js b/test/webpack.config.js index <HASH>..<HASH> 100644 --- a/test/webpack.config.js +++ b/test/webpack.config.js @@ -1,5 +1,5 @@ const path = require('path'); -var DuplicatePackageCheckerPlugin = require('../'); +var DuplicatePackageCheckerPlugin = require('../index.js'); module.exports = { entry: './entry.js',
Use source file when testing, not built
darrenscerri_duplicate-package-checker-webpack-plugin
train
js
f3b26525f71d54681df5fdbea76d7be0eceb12bd
diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java index <HASH>..<HASH> 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java @@ -147,7 +147,7 @@ final class ChangeableUrls implements Iterable<URL> { urls.add(referenced.toURI().toURL()); } else { - System.err.println("Ignoring Class-Path entry " + entry + " found in " + System.out.println("Ignoring Class-Path entry " + entry + " found in " + jarFile.getName() + " as " + referenced + " does not exist"); }
Use System.out rather than err for ignored Class-Path entry message Closes gh-<I>
spring-projects_spring-boot
train
java
fd5cdcd6669de3a0c5a6263d242424e66c23d48e
diff --git a/datafilters/specs/builtin.py b/datafilters/specs/builtin.py index <HASH>..<HASH> 100644 --- a/datafilters/specs/builtin.py +++ b/datafilters/specs/builtin.py @@ -29,7 +29,7 @@ class GenericSpec(FilterSpec): class DateFieldFilterSpec(FilterSpec): - def __init__(self, field_name, verbose_name, is_datetime=True, **kwargs): + def __init__(self, field_name, verbose_name, is_datetime=True, **field_kwargs): super(DateFieldFilterSpec, self).__init__(field_name) self.field_generic = '%s__' % self.field_name @@ -60,9 +60,11 @@ class DateFieldFilterSpec(FilterSpec): ('this_month', _('This month')), ('this_year', _('This year')), ) - self.filter_field = (forms.ChoiceField, {'choices':choices, + + field_kwargs.update({'choices':choices, 'label':verbose_name, 'required': False}) + self.filter_field = (forms.ChoiceField, field_kwargs) class DatePickFilterSpec(FilterSpec):
Pass field kwargs to field constructor in DateFieldFilterSpec
freevoid_django-datafilters
train
py
197decccca8a237e334ee90dfa3bb35161c168df
diff --git a/gulpfile.babel.js b/gulpfile.babel.js index <HASH>..<HASH> 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -37,12 +37,7 @@ const bs = browserSync.create(), jsnext: true, browser: true, }), - commonJs({ - exclude: [ - './node_modules/process-es6/browser.js', - './node_modules/rollup-plugin-node-globals/src/global.js', - ] - }), + commonJs(), babel(), nodeGlobals(), replace({
remove exclude in commonjs rollup config
simplajs_simpla
train
js
4f7be7e203f159a3a7c1426db9511fd0f2dc8692
diff --git a/src/consumer/__tests__/instrumentationEvents.spec.js b/src/consumer/__tests__/instrumentationEvents.spec.js index <HASH>..<HASH> 100644 --- a/src/consumer/__tests__/instrumentationEvents.spec.js +++ b/src/consumer/__tests__/instrumentationEvents.spec.js @@ -337,7 +337,7 @@ describe('Consumer > Instrumentation Events', () => { type: 'consumer.network.request_timeout', payload: { apiKey: 18, - apiName: 'ApiVersions', + apiName: expect.any(String), apiVersion: expect.any(Number), broker: expect.any(String), clientId: expect.any(String),
Don't check for a specific API, just check the shape
tulios_kafkajs
train
js
1fd852881beb7b30b1365d336ba29829854a7433
diff --git a/MAVProxy/modules/mavproxy_wp.py b/MAVProxy/modules/mavproxy_wp.py index <HASH>..<HASH> 100644 --- a/MAVProxy/modules/mavproxy_wp.py +++ b/MAVProxy/modules/mavproxy_wp.py @@ -23,7 +23,7 @@ class WPModule(mp_module.MPModule): self.undo_wp = None self.undo_type = None self.undo_wp_idx = -1 - self.expected_count = 0 + self.wploader.expected_count = 0 self.add_command('wp', self.cmd_wp, 'waypoint management', ["<list|clear|move|remove|loop|set|undo|movemulti|changealt|param|status>", "<load|update|save|savecsv|show> (FILENAME)"])
wp: fixed expected_count error
ArduPilot_MAVProxy
train
py
2dd5f5bf8272f49327f444a0aa3f16e3861cb080
diff --git a/components/interfaces/IQueryLogger.php b/components/interfaces/IQueryLogger.php index <HASH>..<HASH> 100644 --- a/components/interfaces/IQueryLogger.php +++ b/components/interfaces/IQueryLogger.php @@ -2,10 +2,10 @@ namespace directapi\components\interfaces; +use directapi\DirectApiRequest; +use directapi\DirectApiResponse; interface IQueryLogger { - public function logSuccess($service, $method, $params, $price); - - public function logError($service, $method, $params, $price); + public function logRequest(DirectApiRequest $request, DirectApiResponse $response); } \ No newline at end of file
logger should process request and response too
sitkoru_yandex-direct-api
train
php
fdb774ea339bdd74f6eff2eb41b1f5bca5dc0212
diff --git a/demo/server.js b/demo/server.js index <HASH>..<HASH> 100644 --- a/demo/server.js +++ b/demo/server.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -// hello! +// hello world! const express = require('express'); const path = require('path'); const app = express();
test for CI -CD with EC2
FlacheQL_FlacheQL
train
js