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
74a199d3c3d8ea06e714fd6cb56e5d95cb39713c
diff --git a/js/gateio.js b/js/gateio.js index <HASH>..<HASH> 100755 --- a/js/gateio.js +++ b/js/gateio.js @@ -2641,7 +2641,7 @@ module.exports = class gateio extends Exchange { request['limit'] = limit; } if (since !== undefined && (market['spot'] || market['margin'])) { - request['start'] = parseInt (since / 1000); + request['from'] = parseInt (since / 1000); } const method = this.getSupportedMapping (market['type'], { 'spot': 'privateSpotGetOrders',
fix: request 'start' should be 'from' in gateio
ccxt_ccxt
train
js
588fe7a335e3ebb2aeb6836eb05377e2a58a5cc4
diff --git a/spec/integration/server_description_spec.rb b/spec/integration/server_description_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/server_description_spec.rb +++ b/spec/integration/server_description_spec.rb @@ -35,7 +35,7 @@ describe 'Server description' do end let(:client) { ClientRegistry.instance.global_client('authorized') } - let(:desc) { client.cluster.servers.first.description } + let(:desc) { client.cluster.next_primary.description } it 'is set' do client.database.command(ismaster: 1)
Read description from primary because that is where the commands are going (#<I>)
mongodb_mongo-ruby-driver
train
rb
32b4bdc2b7528e48c3ea93af70be10d872fe0af6
diff --git a/src/main/java/com/tulskiy/keymaster/ProviderTest.java b/src/main/java/com/tulskiy/keymaster/ProviderTest.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/tulskiy/keymaster/ProviderTest.java +++ b/src/main/java/com/tulskiy/keymaster/ProviderTest.java @@ -36,12 +36,8 @@ public class ProviderTest { provider.register(KeyStroke.getKeyStroke("control alt D"), new HotKeyListener() { public void onHotKey(HotKey hotKey) { System.out.println(hotKey); - SwingUtilities.invokeLater(new Runnable() { - public void run() { - provider.reset(); - provider.stop(); - } - }); + provider.reset(); + provider.stop(); } });
[provider test] no need forSwingUtilities here anymore
tulskiy_jkeymaster
train
java
a2fabd2c901bbee3bc6bc7ee575c45b08f688b9e
diff --git a/examples/RL_arm/params.py b/examples/RL_arm/params.py index <HASH>..<HASH> 100644 --- a/examples/RL_arm/params.py +++ b/examples/RL_arm/params.py @@ -302,7 +302,7 @@ simConfig = {} # dictionary to store simConfig # Simulation parameters simConfig['duration'] = 1*1e3 # Duration of the simulation, in ms simConfig['dt'] = 0.1 # Internal integration timestep to use -simConfig['seeds'] = {'conn': 2, 'stim': 2, 'loc': 2} # Seeds for randomizers (connectivity, input stimulation and cell locations) +simConfig['seeds'] = {'conn': 3, 'stim': 3, 'loc': 3} # Seeds for randomizers (connectivity, input stimulation and cell locations) simConfig['createNEURONObj'] = True # create HOC objects when instantiating network simConfig['createPyStruct'] = True # create Python structure (simulator-independent) when instantiating network simConfig['timing'] = True # show timing and save to file
First success Parameters and seeds that should correspond to a successful northern-target reach on Athena server with <I> cores.
Neurosim-lab_netpyne
train
py
3c0eb53f911b69cf2ad7bae4608cd73e61967f45
diff --git a/pkg/cmd/cli/cmd/login/logout.go b/pkg/cmd/cli/cmd/login/logout.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/cli/cmd/login/logout.go +++ b/pkg/cmd/cli/cmd/login/logout.go @@ -125,12 +125,12 @@ func (o LogoutOptions) RunLogout() error { } if err := client.OAuthAccessTokens().Delete(token); err != nil { - glog.V(1).Infof("%v\n", err) + glog.V(1).Infof("%v", err) } configErr := deleteTokenFromConfig(*o.StartingKubeConfig, o.PathOptions, token) if configErr == nil { - glog.V(1).Infof("Removed token from your local configuration.\n\n") + glog.V(1).Infof("Removed token from your local configuration.") // only return error instead of successful message if removing token from client // config fails. Any error that occurs deleting token using api is logged above.
Removed line breaks in glog messages
openshift_origin
train
go
41805e4aaf6da9f10932cc360b9caeb8370747b8
diff --git a/pkg/nodeaddress/node_address.go b/pkg/nodeaddress/node_address.go index <HASH>..<HASH> 100644 --- a/pkg/nodeaddress/node_address.go +++ b/pkg/nodeaddress/node_address.go @@ -41,12 +41,13 @@ var ( ipv6AllocRange *net.IPNet ) -func makeIPv6HostIP(ip net.IP) net.IP { - // Derive prefix::1 as the IPv6 host address - ip[12] = 0 - ip[13] = 0 - ip[14] = 0 - ip[15] = 1 +func makeIPv6HostIP() net.IP { + ipstr := "fc00::10CA:1" + ip := net.ParseIP(ipstr) + if ip == nil { + log.Fatalf("Unable to parse IP '%s'", ipstr) + } + return ip } @@ -229,7 +230,7 @@ func AutoComplete() error { } if ipv6Address == nil { - ipv6Address = makeIPv6HostIP(ipv6AllocRange.IP) + ipv6Address = makeIPv6HostIP() } return nil
nodeaddress: Use a IPv6 site local address as host address This resolves an issue where running Cilium will configure a global scope address for the system which causes getaddrinfo() to start returning IPv6 addresses for DNS requests even though the system may not have actual IPv6 connectivity. Fixes: #<I>
cilium_cilium
train
go
6ee6bd1e6c82e302445f5a59558ee1c599d2ce40
diff --git a/test/unit/backends/test_printer.rb b/test/unit/backends/test_printer.rb index <HASH>..<HASH> 100644 --- a/test/unit/backends/test_printer.rb +++ b/test/unit/backends/test_printer.rb @@ -27,12 +27,10 @@ module SSHKit end def test_simple_printing - sio = StringIO.new - SSHKit.capture_output(sio) do + result = String.new + SSHKit.capture_output(result) do printer.run end - sio.rewind - result = sio.read assert_equal <<-EOEXPECTED.unindent, result if test ! -d /opt/sites/example.com; then echo "Directory does not exist '/opt/sites/example.com'" 1>&2; false; fi cd /opt/sites/example.com && /usr/bin/env date
Update a test to use a String, no need for StringIO here
capistrano_sshkit
train
rb
ef2df3e6d38087ee7e1a752cd359740d5c28ff24
diff --git a/test/tools/javac/platform/PlatformProviderTest.java b/test/tools/javac/platform/PlatformProviderTest.java index <HASH>..<HASH> 100644 --- a/test/tools/javac/platform/PlatformProviderTest.java +++ b/test/tools/javac/platform/PlatformProviderTest.java @@ -88,6 +88,7 @@ public class PlatformProviderTest implements PlatformProvider { ToolBox tb = new ToolBox(); ToolBox.Result result = tb.new JavacTask(ToolBox.Mode.EXEC) + .outdir(".") .options("-J-classpath", "-J" + System.getProperty("test.classes"), "-XDrawDiagnostics", @@ -121,6 +122,7 @@ public class PlatformProviderTest implements PlatformProvider { ToolBox tb = new ToolBox(); ToolBox.Result result = tb.new JavacTask(ToolBox.Mode.EXEC) + .outdir(".") .options("-J-classpath", "-J" + System.getProperty("test.classes"), "-release",
<I>: test writes file in test source directory Summary: Setting an explicit output directory for ToolBox.JavacTask in PlatformProviderTest. Reviewed-by: jjg
google_error-prone-javac
train
java
81e4970906659da73b6d819b3b63e3f0271ebd2b
diff --git a/src/ReactAdapter.php b/src/ReactAdapter.php index <HASH>..<HASH> 100644 --- a/src/ReactAdapter.php +++ b/src/ReactAdapter.php @@ -83,6 +83,7 @@ class ReactAdapter implements LoopInterface { $callback($timer); }); + $this->deferEnabling($watcher); $this->timers[spl_object_hash($timer)] = $watcher; return $timer; @@ -96,6 +97,7 @@ class ReactAdapter implements LoopInterface { $callback($timer); }); + $this->deferEnabling($watcher); $this->timers[spl_object_hash($timer)] = $watcher; return $timer; @@ -165,6 +167,17 @@ class ReactAdapter implements LoopInterface { $this->driver->stop(); } + private function deferEnabling(string $watcherId) { + $this->driver->disable($watcherId); + $this->driver->defer(function () use ($watcherId) { + try { + $this->driver->enable($watcherId); + } catch (\Throwable $e) { + // ignore + } + }); + } + public static function get(): LoopInterface { if ($loop = Loop::getState(self::class)) { return $loop;
Enable timer watchers in next tick This 'fixes' the timing issues in tests. It might result in a very minor inconsistency in very edge cases.
amphp_react-adapter
train
php
be94090fa5c9984c0b936c595b73e215c95a4438
diff --git a/lib/haml/helpers/safe_erubis_template.rb b/lib/haml/helpers/safe_erubis_template.rb index <HASH>..<HASH> 100644 --- a/lib/haml/helpers/safe_erubis_template.rb +++ b/lib/haml/helpers/safe_erubis_template.rb @@ -10,11 +10,11 @@ module Haml end def precompiled_preamble(locals) - [super, "@output_buffer = ActionView::OutputBuffer.new;"] + [super, "@output_buffer = ActionView::OutputBuffer.new;"].join("\n") end def precompiled_postamble(locals) - [super, '@output_buffer.to_s'] + [super, '@output_buffer.to_s'].join("\n") end end end \ No newline at end of file
Explicitly join ambles in SafeErubisTemplate Previously Tilt used `join` to combine ambles and template, which flattened our arrays for us, but this changed in Tilt <I>. Return Strings from precompiled_preamble and precompiled_postamble. Fixes #<I>
haml_haml
train
rb
8f521d519fe0e8c5cc6f0f7ac410ba552c00d56c
diff --git a/google-cloud-vision/lib/google/cloud/vision/service.rb b/google-cloud-vision/lib/google/cloud/vision/service.rb index <HASH>..<HASH> 100644 --- a/google-cloud-vision/lib/google/cloud/vision/service.rb +++ b/google-cloud-vision/lib/google/cloud/vision/service.rb @@ -39,11 +39,13 @@ module Google end def channel + require "grpc" GRPC::Core::Channel.new host, nil, chan_creds end def chan_creds return credentials if insecure? + require "grpc" GRPC::Core::ChannelCredentials.new.compose \ GRPC::Core::CallCredentials.new credentials.client.updater_proc end
Require grpc where needed But not before it is needed... :)
googleapis_google-cloud-ruby
train
rb
f8ee292506be78bd7c19df97d6d5dc5b14243eee
diff --git a/benchbuild/experiment.py b/benchbuild/experiment.py index <HASH>..<HASH> 100644 --- a/benchbuild/experiment.py +++ b/benchbuild/experiment.py @@ -145,8 +145,7 @@ class Experiment(metaclass=ExperimentRegistry): prj_actions = [] for version in self.sample(prj_cls, prj_cls.versions()): - p = prj_cls(self) - p.version = version + p = prj_cls(self, version=version) atomic_actions = [ Clean(p), diff --git a/benchbuild/project.py b/benchbuild/project.py index <HASH>..<HASH> 100644 --- a/benchbuild/project.py +++ b/benchbuild/project.py @@ -161,7 +161,7 @@ class Project(metaclass=ProjectDecorator): SRC_FILE = None CONTAINER = None - def __new__(cls, *_): + def __new__(cls, *args, **kwargs): """Create a new project instance and set some defaults.""" new_self = super(Project, cls).__new__(cls) if cls.NAME is None:
project: set version at object construction Projects/Experiments use the attrs module for attribute management. Our use of this module initializes all attributes from default values at object construction. If an attribute is dependant on other attributes of the same class/object, we need to make sure to set the necessary values at object construction. Otherwise, these values will not update themselves. This might be a perfect case of reactive programming (although, overkill for our minor case).
PolyJIT_benchbuild
train
py,py
b624f9cb21ff0b7aee260984aedeb8bd982ccd9d
diff --git a/test/test_subprocess.py b/test/test_subprocess.py index <HASH>..<HASH> 100644 --- a/test/test_subprocess.py +++ b/test/test_subprocess.py @@ -154,6 +154,9 @@ def test_popen(): assert popen.returncode == 0 + # close handles + popen.communicate() + # This *does* seem to work, only seems untestable somehow... # def test_dots(capsys):
TST: close file handles in test
airspeed-velocity_asv
train
py
a96aebfb64cb7b59edfc56b1fb12197fb154d77a
diff --git a/lib/impressionist.rb b/lib/impressionist.rb index <HASH>..<HASH> 100644 --- a/lib/impressionist.rb +++ b/lib/impressionist.rb @@ -1,5 +1,4 @@ -IMPRESSIONIST_PATH = File.dirname(__FILE__) + "/impressionist" -require "#{IMPRESSIONIST_PATH}/engine.rb" +require "impressionist/engine.rb" module Impressionist -end \ No newline at end of file +end
Change the require so it is not dependent on File.dirname
charlotte-ruby_impressionist
train
rb
5cb6c2b583dfe77d05581ad0ae2647b79cf1796d
diff --git a/bcbio/pipeline/datadict.py b/bcbio/pipeline/datadict.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/datadict.py +++ b/bcbio/pipeline/datadict.py @@ -70,7 +70,7 @@ LOOKUPS = { "novel_isomir_counts": {"keys": ["novel_isomir_counts"]}, "combined_counts": {"keys": ["combined_counts"]}, "annotated_combined_counts": {"keys": ["annotated_combined_counts"]}, - "genome_context_files": {"keys": ["reference", "genome_context"]}, + "genome_context_files": {"keys": ["reference", "genome_context"], "default": [], "always_list": True}, "viral_files": {"keys": ["reference", "viral"]}, "dexseq_gff": {"keys": ['genome_resources', 'rnaseq', 'dexseq']}, "combined_fpkm": {"keys": ['combined_fpkm']},
CWL: ensure genome_context is list for single item Handles cases like hg<I> where we only have one context file for post-validation stratification.
bcbio_bcbio-nextgen
train
py
9262ba0b71451c9d6d3d3759f6100601edff8395
diff --git a/src/Telegram/Types/CallbackQuery.php b/src/Telegram/Types/CallbackQuery.php index <HASH>..<HASH> 100644 --- a/src/Telegram/Types/CallbackQuery.php +++ b/src/Telegram/Types/CallbackQuery.php @@ -11,7 +11,7 @@ use unreal4u\TelegramAPI\Abstracts\TelegramTypes; * originated the query was attached to a message sent by the bot, the field message will be presented. If the button * was attached to a message sent via the bot (in inline mode), the field inline_message_id will be presented. * - * Objects defined as-is july 2016 + * Objects defined as-is november 2016 * * @see https://core.telegram.org/bots/api#callbackquery */ @@ -43,6 +43,15 @@ class CallbackQuery extends TelegramTypes public $inline_message_id = ''; /** + * Optional. Global identifier, uniquely corresponding to the chat to which the message with the callback button was + * sent. Useful for high scores in games + * + * @see https://core.telegram.org/bots/api#games + * @var string + */ + public $chat_instance = ''; + + /** * Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field * @var string */
Added support for new field in CallbackQuery
unreal4u_telegram-api
train
php
a97ad7ebbed093bcae65a4e9b35831368f33706e
diff --git a/pywb/warcserver/index/cdxobject.py b/pywb/warcserver/index/cdxobject.py index <HASH>..<HASH> 100644 --- a/pywb/warcserver/index/cdxobject.py +++ b/pywb/warcserver/index/cdxobject.py @@ -251,7 +251,11 @@ class CDXObject(OrderedDict): @classmethod def json_decode(cls, string): - return json_decode(string, object_pairs_hook=OrderedDict) + cdx_block = json_decode(string, object_pairs_hook=OrderedDict) + # other parts of pywb expect status to be a string and not an integer + if cdx_block and type(cdx_block.get('status')) == int: + cdx_block['status'] = str(cdx_block['status']) + return cdx_block #=================================================================
Ensure CDX status is a string (#<I>) If a CDXJ entry has a status that is an int that can cause problems in multiple places in pywb. This change ensures that int status lines are converted to str.
webrecorder_pywb
train
py
4127f6dc92715b87d14f50f84d3531f90d4dba2a
diff --git a/telehash.js b/telehash.js index <HASH>..<HASH> 100644 --- a/telehash.js +++ b/telehash.js @@ -529,8 +529,12 @@ exports.mesh = function(args, cbMesh) if(!see) pipe.send(link.x && link.x.handshake()); } - // whenever a pipe is seen after a sync, update it's timestamp and resort var seen = link.seen[pipe.uid]; + + // added pipe that hasn't been seen since a sync, send most recent handshake again + if(!see && seen && seen < link.syncedAt) pipe.send(link.x.handshake()); + + // whenever a pipe is seen after a sync, update it's timestamp and resort if(see && (!seen || seen < link.syncedAt)) { seen = Date.now();
addPipe signals to re-send a handshake for existing old ones
telehash_telehash-js
train
js
a974df379252ada2288a0d64210f6df6882a24c1
diff --git a/src/main/java/com/asana/resources/gen/ProjectsBase.java b/src/main/java/com/asana/resources/gen/ProjectsBase.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/asana/resources/gen/ProjectsBase.java +++ b/src/main/java/com/asana/resources/gen/ProjectsBase.java @@ -173,12 +173,12 @@ public class ProjectsBase extends Resource * Returns the compact task records for all tasks within the given project, * ordered by their priority within the project. Tasks can exist in more than one project at a time. * - * @param projectId The project in which to search for tasks. + * @param project The project in which to search for tasks. * @return Request object */ - public CollectionRequest<Project> getTasksInProject(String projectId) + public CollectionRequest<Project> getTasksInProject(String project) { - String path = String.format("/projects/%s/tasks", projectId); + String path = String.format("/projects/%s/tasks", project); return new CollectionRequest<Project>(this, Project.class, path, "GET"); } }
Deploy from asana-api-meta <I>
Asana_java-asana
train
java
c8cc941f9314c37372de88ad44f2123f811fbb11
diff --git a/framework/assets/yii.validation.js b/framework/assets/yii.validation.js index <HASH>..<HASH> 100644 --- a/framework/assets/yii.validation.js +++ b/framework/assets/yii.validation.js @@ -292,16 +292,16 @@ yii.validation = (function ($) { valid = value !== compareValue; break; case '>': - valid = parseFloat(value) > parseFloat(compareValue); + valid = value > compareValue; break; case '>=': - valid = parseFloat(value) >= parseFloat(compareValue); + valid = value >= compareValue; break; case '<': - valid = parseFloat(value) < parseFloat(compareValue); + valid = value < compareValue; break; case '<=': - valid = parseFloat(value) <= parseFloat(compareValue); + valid = value <= compareValue; break; default: valid = false;
do not extra convert to floats in CompareValidator client code
yiisoft_yii-core
train
js
d634ed3850ff1980f21590eee051d4428acf4601
diff --git a/pkg/kubelet/kubelet_node_status.go b/pkg/kubelet/kubelet_node_status.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/kubelet_node_status.go +++ b/pkg/kubelet/kubelet_node_status.go @@ -104,10 +104,6 @@ func (kl *Kubelet) tryRegisterWithAPIServer(node *v1.Node) bool { } originalNode := existingNode.DeepCopy() - if originalNode == nil { - klog.Errorf("Nil %q node object", kl.nodeName) - return false - } klog.Infof("Node %s was previously registered", kl.nodeName)
Removed unnecessary not nil check in node registration process
kubernetes_kubernetes
train
go
4f8d841d57a0015af48bf6451ad3342aa56b9559
diff --git a/src/Helper.php b/src/Helper.php index <HASH>..<HASH> 100644 --- a/src/Helper.php +++ b/src/Helper.php @@ -12,8 +12,6 @@ namespace hiqdev\composer\config; use Closure; use ReflectionFunction; -use yii\helpers\UnsetArrayValue; -use yii\helpers\ReplaceArrayValue; /** * Helper class. @@ -36,9 +34,9 @@ class Helper continue; } foreach ($items as $k => $v) { - if ($v instanceof UnsetArrayValue) { + if ($v instanceof \yii\helpers\UnsetArrayValue || $v instanceof \Yiisoft\Arrays\UnsetArrayValue) { unset($res[$k]); - } elseif ($v instanceof ReplaceArrayValue) { + } elseif ($v instanceof \yii\helpers\ReplaceArrayValue || $v instanceof \Yiisoft\Arrays\ReplaceArrayValue) { $res[$k] = $v->value; } elseif (\is_int($k)) { /// XXX skip repeated values
Check both old & new Yii Array helpers classes Keeping old classnames during the transition, I'll send a new PR once the migration is completed
hiqdev_composer-config-plugin
train
php
93949dfd7ba5799044c8e44a59a8ec3194e690e5
diff --git a/lib/DocBlox/Abstract.php b/lib/DocBlox/Abstract.php index <HASH>..<HASH> 100644 --- a/lib/DocBlox/Abstract.php +++ b/lib/DocBlox/Abstract.php @@ -23,7 +23,7 @@ abstract class DocBlox_Abstract * * @var int */ - const VERSION = '0.8.5'; + const VERSION = '0.8.6'; /** * The logger used to capture all messages send by the log method.
Upped version number due to a working PEAR setup
phpDocumentor_phpDocumentor2
train
php
86c951a844ea90f7728f66e78a256b32c9679337
diff --git a/ternary/lines.py b/ternary/lines.py index <HASH>..<HASH> 100644 --- a/ternary/lines.py +++ b/ternary/lines.py @@ -313,7 +313,6 @@ def ticks(ax, scale, ticks=None, locations=None, multiple=1, axis='b', s = tick else: s = tick_formats['l'] % tick - s = tick_formats['l'] % tick ax.text(x, y, s, horizontalalignment="center", color=axes_colors['l'], fontsize=fontsize)
Remove stray line in tick format handling
marcharper_python-ternary
train
py
313039c64b54f8b3c14289277b39a19579cc46d7
diff --git a/lib/params.js b/lib/params.js index <HASH>..<HASH> 100644 --- a/lib/params.js +++ b/lib/params.js @@ -33,11 +33,9 @@ function params(opts) { // get file's sitemap title function title(cb) { var val = '[error] current file ' + opts.__file + ' does not have title in the sitemap'; - _.keys(opts.sitemap).forEach(function (page) { - if (opts.sitemap[page].file === opts.__file) { - val = opts.sitemap[page].title; - } - }); + if (opts.sitemap[opts.__file]) { + val = opts.sitemap[opts.__file].title; + } cb(val); } diff --git a/test/params.js b/test/params.js index <HASH>..<HASH> 100644 --- a/test/params.js +++ b/test/params.js @@ -89,7 +89,7 @@ vows.describe('params').addBatch({ 'when sitemap contains current file': { topic: function (topic) { topic.params({ __file: 'index.html', - sitemap: { index: { title: 'Home Page', file: 'index.html' } } }) + sitemap: { 'index.html' : { title: 'Home Page' } } }) .title(this.callback); }, 'then it should contain the file title': function (result, dummy) {
Simplify sitemap to use filename as key.
cliffano_ae86
train
js,js
d9423eb871c36632486792f7dd0b3b758dd8c68f
diff --git a/chef/spec/unit/knife/cookbook_delete_spec.rb b/chef/spec/unit/knife/cookbook_delete_spec.rb index <HASH>..<HASH> 100644 --- a/chef/spec/unit/knife/cookbook_delete_spec.rb +++ b/chef/spec/unit/knife/cookbook_delete_spec.rb @@ -25,6 +25,8 @@ describe Chef::Knife::CookbookDelete do @knife.cookbook_name = 'foobar' @stdout = StringIO.new @knife.ui.stub!(:stdout).and_return(@stdout) + @stderr = StringIO.new + @knife.ui.stub!(:stderr).and_return(@stderr) end describe 'run' do @@ -150,7 +152,7 @@ describe Chef::Knife::CookbookDelete do it 'should print an error' do @knife.available_versions - @stdout.string.should match /error.+cannot find a cookbook named foobar/i + @stderr.string.should match /error.+cannot find a cookbook named foobar/i end it 'should return nil' do
CHEF-<I>: Update spec for error output being on stderr
chef_chef
train
rb
aee33cde34a2afa305dbb3a6fc44cca27982a6a2
diff --git a/libs/Config.php b/libs/Config.php index <HASH>..<HASH> 100644 --- a/libs/Config.php +++ b/libs/Config.php @@ -191,7 +191,7 @@ class Config extends BaseConfig public function hasImage(): bool { - return $this->hasValue('image'); + return $this->hasValue('image') && !empty($this->getValue('image')); } public function getImage()
Check if image is not just an empty string. #<I>
dauxio_daux.io
train
php
8e8430f234bbb8ff1018de5c4cae297ee0b155ce
diff --git a/autoflake.py b/autoflake.py index <HASH>..<HASH> 100644 --- a/autoflake.py +++ b/autoflake.py @@ -7,7 +7,7 @@ import os import tokenize -__version__ = '0.1.3' +__version__ = '0.1.4' PYFLAKES_BIN = 'pyflakes'
Increment patch version to <I>
myint_autoflake
train
py
f9bbe604ca9e31119756b8347f9aefb17e589e06
diff --git a/data/migrations/deb/1_0_96_to_1_0_97.py b/data/migrations/deb/1_0_96_to_1_0_97.py index <HASH>..<HASH> 100644 --- a/data/migrations/deb/1_0_96_to_1_0_97.py +++ b/data/migrations/deb/1_0_96_to_1_0_97.py @@ -185,5 +185,4 @@ def migrate_all(): subprocess.run(['chown', '-R', 'sovrin:sovrin', '/home/sovrin/.sovrin']) -if __name__ == "__main__": - migrate_all() +migrate_all() diff --git a/data/migrations/deb/disabled_1_0_97_to_1_0_96.py b/data/migrations/deb/disabled_1_0_97_to_1_0_96.py index <HASH>..<HASH> 100644 --- a/data/migrations/deb/disabled_1_0_97_to_1_0_96.py +++ b/data/migrations/deb/disabled_1_0_97_to_1_0_96.py @@ -193,5 +193,4 @@ def migrate_all(): subprocess.run(['chown', '-R', 'sovrin:sovrin', '/home/sovrin/.sovrin']) -if __name__ == "__main__": - migrate_all() +migrate_all()
fix migration scripts (#<I>)
hyperledger_indy-node
train
py,py
fa8eb8bb036ca573a59809fda77b702b6e5d8c7c
diff --git a/src/Kodeine/Metable/Metable.php b/src/Kodeine/Metable/Metable.php index <HASH>..<HASH> 100644 --- a/src/Kodeine/Metable/Metable.php +++ b/src/Kodeine/Metable/Metable.php @@ -21,7 +21,7 @@ trait Metable */ public function scopeWhereMeta($query, $key, $value, $alias = null) { $alias = (empty( $alias )) ? $this->getMetaTable() : $alias; - return $query->join( $this->getMetaTable() . ' AS ' . $alias, $this->getQualifiedKeyName(), '=', $alias . '.' . $this->getMetaKeyName() )->where( 'key', '=', $key )->where( 'value', '=', $value )->select( $this->getTable() . '.*' ); + return $query->join( $this->getMetaTable() . ' AS ' . $alias, $this->getQualifiedKeyName(), '=', $alias . '.' . $this->getMetaKeyName() )->where( $alias . '.key', '=', $key )->where( $alias . '.value', '=', $value )->select( $this->getTable() . '.*' ); } /**
Prepend alias to key and value in scopeWhereMeta
kodeine_laravel-meta
train
php
1d4d061c6fed3dee1f89f2d65d0145b9b7b7dca5
diff --git a/web/concrete/models/permission/key.php b/web/concrete/models/permission/key.php index <HASH>..<HASH> 100644 --- a/web/concrete/models/permission/key.php +++ b/web/concrete/models/permission/key.php @@ -1,3 +1,3 @@ <? defined('C5_EXECUTE') or die("Access Denied."); -abstract class PermissionKey extends Concrete5_Model_PermissionKey {} \ No newline at end of file +class PermissionKey extends Concrete5_Model_PermissionKey {} \ No newline at end of file
Fix upgrade fatal error due to PermissionKey defined as abstract class. This fix eliminates a fatal error on line <I> of "concrete/core/models/permission/key.php" when upgrading from <I>.x to <I>.x due to attempt to instantiate an abstract class. Former-commit-id: bbe7d<I>c8e<I>c3c<I>bfc<I>bb<I>fb4b5bc<I>fa
concrete5_concrete5
train
php
8c406f6fbe8c1ddb34756f05cd996e9646efa029
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index <HASH>..<HASH> 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -459,7 +459,7 @@ end module Devise DeviseController.class_eval do - +=begin def after_sign_out_path_for(resource_or_scope) scope = Devise::Mapping.find_scope!(resource_or_scope) @@ -500,11 +500,11 @@ module Devise "/" end end - +=end end RegistrationsController.class_eval do - +=begin def after_inactive_sign_up_path_for(resource) scope = Devise::Mapping.find_scope!(resource) @@ -520,7 +520,7 @@ module Devise end end - +=end def respond_with_navigational(*args, &block) if is_json_request? respond_with(*args)
removed references to main_app in devise.rb, no longer needed as engine is no longer isolated engine.
wordjelly_Auth
train
rb
26c6e56f929142dad58a7f7131f42e778a11a696
diff --git a/liquibase-core/src/main/java/liquibase/datatype/core/UnknownType.java b/liquibase-core/src/main/java/liquibase/datatype/core/UnknownType.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/datatype/core/UnknownType.java +++ b/liquibase-core/src/main/java/liquibase/datatype/core/UnknownType.java @@ -56,6 +56,7 @@ public class UnknownType extends LiquibaseDataType { || getName().equalsIgnoreCase("DATETIMEOFFSET") || getName().equalsIgnoreCase("IMAGE") || getName().equalsIgnoreCase("NTEXT") + || getName().equalsIgnoreCase("SYSNAME") || getName().equalsIgnoreCase("SMALLMONEY") )) { parameters = new Object[0];
CORE-<I> MSSQL should not include parameters in SYSNAME data types
liquibase_liquibase
train
java
62eb8b3514cc3ea32319f5ce4f8776e2e475c9b8
diff --git a/tests/library/Phpass/HashTest.php b/tests/library/Phpass/HashTest.php index <HASH>..<HASH> 100644 --- a/tests/library/Phpass/HashTest.php +++ b/tests/library/Phpass/HashTest.php @@ -108,13 +108,13 @@ class HashTest extends \PHPUnit_Framework_TestCase $hash = new Hash; $passwordHash = $hash->hashPassword($password); - $this->assertEquals('$2a$', substr($passwordHash, 0, 4)); + $this->assertEquals('$2y$', substr($passwordHash, 0, 4)); $this->assertTrue($hash->checkPassword($password, $passwordHash)); $oldPasswordHash = $passwordHash; $passwordHash = $hash->hashPassword($password); $this->assertNotEquals($passwordHash, $oldPasswordHash); - $this->assertEquals('$2a$', substr($passwordHash, 0, 4)); + $this->assertEquals('$2y$', substr($passwordHash, 0, 4)); $this->assertTrue($hash->checkPassword($password, $passwordHash)); }
Update hash test to reflect new bcrypt defaults.
rchouinard_phpass
train
php
261e6583799e729c89d67e9c8a34000c1bdcf0ad
diff --git a/wagtailmetadata/tags.py b/wagtailmetadata/tags.py index <HASH>..<HASH> 100644 --- a/wagtailmetadata/tags.py +++ b/wagtailmetadata/tags.py @@ -1,6 +1,8 @@ from django.template import TemplateSyntaxError from django.template.loader import render_to_string +from wagtail.core.models import Site + def get_meta_image_url(request, image): """ @@ -18,7 +20,7 @@ def meta_tags(request, model): raise TemplateSyntaxError( "'meta_tags' tag is missing a model or object") context = { - 'site_name': request.site.site_name, + 'site_name': Site.find_for_request(request).site_name, 'object': model, }
fixes wagtail.Site instance retrieval makes it work with wagtail <I>
neon-jungle_wagtail-metadata
train
py
c1fdae0438063ffe7d34423db8fcbd6477ecea61
diff --git a/tests/e2e/pattern-lab-compiling.js b/tests/e2e/pattern-lab-compiling.js index <HASH>..<HASH> 100644 --- a/tests/e2e/pattern-lab-compiling.js +++ b/tests/e2e/pattern-lab-compiling.js @@ -75,7 +75,7 @@ module.exports = { 'Bolt Docs: Verify Docs Site Compiled + Deployed': function (browser) { browser .url(`${testingUrl}`) - .waitForElementVisible('.c-bolt-site', 1000) + .waitForElementVisible('body.c-bolt-site', 1000) .assert.containsText('h1.c-bolt-headline', 'Bolt Design System') .end() },
chore: revert updating nightwatch test selector -- stashing for a separate PR
bolt-design-system_bolt
train
js
f9879057a6d2f560affe5138f592bf84553d98bf
diff --git a/builtin_object.go b/builtin_object.go index <HASH>..<HASH> 100644 --- a/builtin_object.go +++ b/builtin_object.go @@ -16,7 +16,16 @@ func builtinObject(call FunctionCall) Value { return toValue(call.runtime.toObject(value)) } -func builtinNewObject(self *_object, _ Value, _ []Value) Value { +func builtinNewObject(self *_object, _ Value, argumentList []Value) Value { + value := valueOfArrayIndex(argumentList, 0) + switch value._valueType { + case valueNull, valueUndefined: + case valueNumber, valueString, valueBoolean: + return toValue(self.runtime.toObject(value)) + case valueObject: + return value + default: + } return toValue(self.runtime.newObject()) } diff --git a/object_test.go b/object_test.go index <HASH>..<HASH> 100644 --- a/object_test.go +++ b/object_test.go @@ -35,3 +35,12 @@ func TestObject_getPrototypeOf(t *testing.T) { [abc,def,ghi,ghi+""]; `, "[object Object],[object Object],,null") } + +func TestObject_new(t *testing.T) { + Terst(t) + + test := runTest() + test(` + [ new Object("abc"), new Object(2+2) ]; + `, "abc,4") +}
Partially implement new Object(...)
robertkrimen_otto
train
go,go
c2fded53c774f73f1bfd3b7b2b4fcff6d3315360
diff --git a/zoort.py b/zoort.py index <HASH>..<HASH> 100644 --- a/zoort.py +++ b/zoort.py @@ -116,6 +116,7 @@ def encrypt_file(path, output): query = 'openssl aes-128-cbc -salt -in {0} -out {1} -k {2}' with hide('output'): local(query.format(path, output, PASSWORD_FILE)) + os.remove(path) def decrypt_file(path):
Add function for remove tar file if encrypt is activated.
yograterol_zoort
train
py
c5cc136e14dc5cf50e9b180c360cac0ad4c16d8d
diff --git a/backend/geomajas-api/src/main/java/org/geomajas/global/GeomajasException.java b/backend/geomajas-api/src/main/java/org/geomajas/global/GeomajasException.java index <HASH>..<HASH> 100644 --- a/backend/geomajas-api/src/main/java/org/geomajas/global/GeomajasException.java +++ b/backend/geomajas-api/src/main/java/org/geomajas/global/GeomajasException.java @@ -111,11 +111,14 @@ public class GeomajasException extends Exception { } String message = messageObject.toString(); ResourceBundle bundleEn = ResourceBundle.getBundle(getResourceBundleName(), Locale.ENGLISH); - ResourceBundle bundle; - try { - bundle = ResourceBundle.getBundle(getResourceBundleName(), locale); - } catch (MissingResourceException mre) { - bundle = bundleEn; + ResourceBundle bundle = bundleEn; + if (null != locale) { + try { + + bundle = ResourceBundle.getBundle(getResourceBundleName(), locale); + } catch (MissingResourceException mre) { + // ignore, bundle is already set to English + } } Object obj; try {
GBE-<I> avoid NPE when locale is null
geomajas_geomajas-project-client-gwt2
train
java
9bca933aeac2639c448641b8acf877d217ab4ee9
diff --git a/lib/multirepo/commands/checkout.rb b/lib/multirepo/commands/checkout.rb index <HASH>..<HASH> 100644 --- a/lib/multirepo/commands/checkout.rb +++ b/lib/multirepo/commands/checkout.rb @@ -12,6 +12,7 @@ module MultiRepo def run super + ensure_multirepo_initialized Console.log_step("Checking out #{@ref}...") main_repo = Repo.new(".")
Checkout ensure_multirepo_initialized.
fortinmike_git-multirepo
train
rb
8b3cbf7c71b0c634f37cc64ab1f932c7ae8aaff4
diff --git a/system/Router/Router.php b/system/Router/Router.php index <HASH>..<HASH> 100644 --- a/system/Router/Router.php +++ b/system/Router/Router.php @@ -469,7 +469,7 @@ class Router implements RouterInterface { $val = preg_replace('#^' . $key . '$#', $val, $uri); } - elseif (strpos($key, '/') !== false) + elseif (strpos($val, '/') !== false) { $val = str_replace('/', '\\', $val); }
~ fix route bug -> replacing forward slashes was based on $from value instead of $to part
codeigniter4_CodeIgniter4
train
php
a42b3586a005a4bc691fa7bce71c82b0522921c4
diff --git a/lib/fastr/router.rb b/lib/fastr/router.rb index <HASH>..<HASH> 100644 --- a/lib/fastr/router.rb +++ b/lib/fastr/router.rb @@ -98,7 +98,7 @@ module Fastr route_info = {:regex => match[:regex], :args => arg, :vars => match[:vars], :hash => hash} # Add the HTTP methods for this route if they exist in options - route_info[:methods] = arg[:methods] if arg.has_key? :methods + route_info[:methods] = arg[:methods] if not arg.nil? and arg.has_key? :methods self.routes.push(route_info) end
Fixed bug in router if there are no options.
chrismoos_fastr
train
rb
e38ef9352cd3c458dc64532a770c95dcb13e6fa3
diff --git a/test/perf/PerformanceReporter.js b/test/perf/PerformanceReporter.js index <HASH>..<HASH> 100644 --- a/test/perf/PerformanceReporter.js +++ b/test/perf/PerformanceReporter.js @@ -52,7 +52,7 @@ define(function (require, exports, module) { value = PerfUtils.getData(measure.id); if (!value) { - throw new Error(measure.id + " measurement not found"); + value = "(None)"; } var printName = measure.name;
Show "(None)" in PerformanceReporter when measurement does not exist.
adobe_brackets
train
js
122422bc08ff24182ddfc7b7c73a7835f71b299d
diff --git a/salt/cloud/clouds/openstack.py b/salt/cloud/clouds/openstack.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/openstack.py +++ b/salt/cloud/clouds/openstack.py @@ -222,9 +222,9 @@ def __virtual__(): return False salt.utils.warn_until( - 'Carbon', + 'Oxygen', 'This driver has been deprecated and will be removed in the ' - 'Carbon release of Salt. Please use the nova driver instead.' + '{version} release of Salt. Please use the nova driver instead.' ) return __virtualname__
Bump openstack deprecation notice to Oxygen (#<I>) I spoke with @gtmanfred and this isn't ready to be removed just yet, so we're bumping the removal to Oxygen.
saltstack_salt
train
py
1be26225549d4b211fe7935d3e36c3b78d8f985d
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,9 @@ var noop = function(){}; var defaults = require('lodash.defaults'); -var isEmpty = require('lodash.isEmpty'); -var isFunction = require('lodash.isFunction'); -var isArray = require('lodash.isArray'); -var cloneDeep = require('lodash.cloneDeep'); +var isEmpty = require('lodash.isempty'); +var isFunction = require('lodash.isfunction'); +var isArray = require('lodash.isarray'); +var cloneDeep = require('lodash.clonedeep'); var BrowserWindow = require('electron').BrowserWindow; var Menu = require('electron').Menu;
Fix: module resolution breaks in electron or asar if the module name doesn't match exactly -- they're case sensitive.
mixmaxhq_electron-editor-context-menu
train
js
6b1b23391f376ea1373ebae96c8f5e955531bcdd
diff --git a/hazelcast/src/main/java/com/hazelcast/map/ReachedMaxSizeException.java b/hazelcast/src/main/java/com/hazelcast/map/ReachedMaxSizeException.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/map/ReachedMaxSizeException.java +++ b/hazelcast/src/main/java/com/hazelcast/map/ReachedMaxSizeException.java @@ -18,7 +18,7 @@ package com.hazelcast.map; /** * Exception thrown when a write-behind {@link com.hazelcast.core.MapStore} rejects to accept a new element. - * Used when {@link com.hazelcast.config.MapStoreConfig#writeCoalescing} is set to true. + * Used when {@link com.hazelcast.config.MapStoreConfig#writeCoalescing} is set to {@code false}. */ public class ReachedMaxSizeException extends RuntimeException {
Fixed left-over, ReachedMaxsizeException is thrown when write-coalescing is set to false
hazelcast_hazelcast
train
java
a402f6e6db699b5e4540820f1880a9ba698de255
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -34,6 +34,10 @@ function BrotliFilter(inputNode, options) { options.appendSuffix : true); + // Default file encoding is raw to handle binary files + this.inputEncoding = options.inputEncoding || null; + this.outputEncoding = options.outputEncoding || null; + if (this.keepUncompressed && !this.appendSuffix) { throw new Error('Cannot keep uncompressed files without appending suffix. Filenames would be the same.'); }
Use raw encoding by default to handle binary files
myfreeweb_broccoli-brotli
train
js
02bb9f66a5c4de676b224b030b665d1077cea1cf
diff --git a/test/Document.js b/test/Document.js index <HASH>..<HASH> 100644 --- a/test/Document.js +++ b/test/Document.js @@ -120,7 +120,7 @@ describe("Document", () => { it("Should save to correct table with multiple models", async () => { const date = Date.now(); - const Robot = new Model("Robot", {"id": Number, "built": Date}); + const Robot = new Model("Robot", {"id": Number, "built": Number}); const robot = new Robot({"id": 2, "built": date}); putItemFunction = () => Promise.resolve();
Using number for test instead of date
dynamoosejs_dynamoose
train
js
e4b4131a952b99606905480c9c9d10956cb3b720
diff --git a/src/test/java/io/javalin/TestUtil.java b/src/test/java/io/javalin/TestUtil.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/javalin/TestUtil.java +++ b/src/test/java/io/javalin/TestUtil.java @@ -23,6 +23,7 @@ public class TestUtil { public static void test(Javalin javalin, ThrowingBiConsumer<Javalin, HttpUtil> test) { Util.INSTANCE.setLogIfNotStarted(false); javalin.config.showJavalinBanner = false; + Javalin.log = LoggerFactory.getLogger(Javalin.class); javalin.start(0); Javalin.log = null; HttpUtil http = new HttpUtil(javalin);
[tests] Re-enable logger in case of failed assertions
tipsy_javalin
train
java
1c723055b395fa477c1940c9842a36db17b861b2
diff --git a/statsd/buffered.go b/statsd/buffered.go index <HASH>..<HASH> 100644 --- a/statsd/buffered.go +++ b/statsd/buffered.go @@ -31,7 +31,9 @@ func (s *BufferedSender) Start() { for { select { case <-ticker.C: - s.flush() + if s.buffer.Len() > 0 { + s.flush() + } case req := <-s.reqs: // StatsD supports receiving multiple metrics in a single packet by separating them with a newline. newLine := append(req, '\n')
minor optimization: call flush() only if buffer is not empty
cactus_go-statsd-client
train
go
e5e1e24079072ad8f58292caead669b02e6362a1
diff --git a/tests/functional_tests/expected_values/bitly.py b/tests/functional_tests/expected_values/bitly.py index <HASH>..<HASH> 100644 --- a/tests/functional_tests/expected_values/bitly.py +++ b/tests/functional_tests/expected_values/bitly.py @@ -25,7 +25,7 @@ CONFIG = { 'user': { 'id': conf.user_id, 'email': None, - 'username': conf.user_username, + 'username': conf.user_name, 'name': conf.user_name, 'first_name': None, 'last_name': None,
The user_username expected value of the Bitly provider changed to user_name.
authomatic_authomatic
train
py
b7d9348846b62abbb5da55f47ea48540ae16f0a8
diff --git a/yolapi.js b/yolapi.js index <HASH>..<HASH> 100644 --- a/yolapi.js +++ b/yolapi.js @@ -67,6 +67,15 @@ function doQuery(session, data, callback) { }); } +function doMetadata(session, data, callback) { + request + .post(session.parameters.url + '/' + session.id + '/metadata') + .send(data) + .end(function (error,response){ + callback(error, error ? null : response.body); + }); +} + function doRespond(session, data, callback) { request .post(session.parameters.url + '/' + session.id + '/response') @@ -104,6 +113,7 @@ function doInject(session, arrayOfFacts, callback) { }); } + function session(a, b, c) { this.parameters = processParameters(a, b, c); var p = this.parameters; @@ -123,6 +133,9 @@ function session(a, b, c) { this.inject = function(arrayOfFacts, callback) { doInject(this, arrayOfFacts, callback); } + this.metadata = function(data, callback) { + doMetadata(this, data, callback); + } this.query = function(data, callback) { doQuery(this, data, callback);
Added support for the metadata endpoint.
Holdy_yolapi
train
js
639a68d2aee94a83641491becabf0e5aa39aee96
diff --git a/util/feeding.py b/util/feeding.py index <HASH>..<HASH> 100644 --- a/util/feeding.py +++ b/util/feeding.py @@ -31,8 +31,13 @@ def read_csvs(csv_files): def samples_to_mfccs(samples, sample_rate, train_phase=False, wav_filename=None): - if train_phase and sample_rate != FLAGS.audio_sample_rate: - tf.print('WARNING: sample rate of file', wav_filename, '(', sample_rate, ') does not match FLAGS.audio_sample_rate. This can lead to incorrect results.') + if train_phase: + # We need the lambdas to make TensorFlow happy. + # pylint: disable=unnecessary-lambda + tf.cond(tf.math.not_equal(sample_rate, FLAGS.audio_sample_rate), + lambda: tf.print('WARNING: sample rate of file', wav_filename, '(', sample_rate, ') does not match FLAGS.audio_sample_rate. This can lead to incorrect results.'), + lambda: tf.no_op(), + name='matching_sample_rate') spectrogram = contrib_audio.audio_spectrogram(samples, window_size=Config.audio_window_samples,
Ensure sample rate comparison with proper types Fixes #<I>
mozilla_DeepSpeech
train
py
8afedad88f93be38eed75f5ce5dd94def477c8ea
diff --git a/lib/octokit/default.rb b/lib/octokit/default.rb index <HASH>..<HASH> 100644 --- a/lib/octokit/default.rb +++ b/lib/octokit/default.rb @@ -1,4 +1,5 @@ require 'octokit/response/raise_error' +require 'octokit/version' module Octokit
Require version for Defaults
octokit_octokit.rb
train
rb
f549f4186be72384b53345debba9a1a09bda6820
diff --git a/src/main/java/com/sdl/selenium/extjs6/form/TagField.java b/src/main/java/com/sdl/selenium/extjs6/form/TagField.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/sdl/selenium/extjs6/form/TagField.java +++ b/src/main/java/com/sdl/selenium/extjs6/form/TagField.java @@ -4,6 +4,7 @@ import com.sdl.selenium.web.SearchType; import com.sdl.selenium.web.WebLocator; import com.sdl.selenium.web.utils.Utils; import org.openqa.selenium.Keys; +import org.openqa.selenium.WebDriverException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -112,7 +113,12 @@ public class TagField extends ComboBox { for (String value : values) { WebLocator item = new WebLocator(this).setClasses("x-tagfield-item").setText(value, SearchType.DEEP_CHILD_NODE_OR_SELF); WebLocator closeEl = new WebLocator(item).setClasses("x-tagfield-item-close"); - removed = removed && closeEl.doClick(); + try { + removed = removed && closeEl.doClick(); + } catch (WebDriverException e) { + Utils.sleep(1000); + removed = removed && closeEl.doClick(); + } } return removed; }
improvement doRemove in TagField
sdl_Testy
train
java
e4af4266555caecf9d3e993717f29a840f1048cb
diff --git a/lib/notify_on/notify_on.rb b/lib/notify_on/notify_on.rb index <HASH>..<HASH> 100644 --- a/lib/notify_on/notify_on.rb +++ b/lib/notify_on/notify_on.rb @@ -17,11 +17,17 @@ class << ActiveRecord::Base method_to_s = NotifyOn::Utilities.callback_method_name(action, options) method_sym = method_to_s.to_sym - send("after_#{(action.to_s == 'create') ? 'create' : 'save'}", method_sym) + if action.to_s == 'create' + send('after_create', method_sym) + elsif action.to_s == 'update' + send('after_update', method_sym) + else + send('after_save', method_sym) + end define_method(method_to_s) do # The action trigger needs to be create, save, or a true condition. - return unless %w(create save).include?(action.to_s) || send(action.to_sym) + return unless %w(create update save).include?(action.to_s) || send(action.to_sym) # An optional if condition must be missing or true. return unless options[:if].blank? || send(options[:if]) # An optional unless condition must be missing or false.
Added 'update' as a possible action. - Total list is now create, update, save. - Aligned them with the rails active_record callbacks :after_create, :after_update, :after_save Fixes #<I>
BrilliantChemistry_NotifyOn
train
rb
f317f13989277dd842ded8a4f6e39dad6b5c0be8
diff --git a/lib/win32/certstore/store_base.rb b/lib/win32/certstore/store_base.rb index <HASH>..<HASH> 100644 --- a/lib/win32/certstore/store_base.rb +++ b/lib/win32/certstore/store_base.rb @@ -96,6 +96,7 @@ module Win32 validate_thumbprint(certificate_thumbprint) thumbprint = update_thumbprint(certificate_thumbprint) cert_pem = get_cert_pem(thumbprint) + return cert_pem if cert_pem == "Certificate Not Found" cert_pem = format_pem(cert_pem) verify_certificate(cert_pem) build_openssl_obj(cert_pem)
Redirect for when the cert is not found.
chef_win32-certstore
train
rb
a8091ab5f2a9e46fcd2d2767f0fe9550aea019d7
diff --git a/simra/database_test.go b/simra/database_test.go index <HASH>..<HASH> 100644 --- a/simra/database_test.go +++ b/simra/database_test.go @@ -6,6 +6,8 @@ import ( "os" "path/filepath" "testing" + + "github.com/pankona/gomo-simra/simra/database" ) type mock struct { @@ -62,7 +64,7 @@ func TestBolt(t *testing.T) { _ = os.RemoveAll(tmpdir) }() - db := OpenDB(&Boltdb{}, filepath.Join(tmpdir)) + db := OpenDB(&database.Boltdb{}, filepath.Join(tmpdir)) if db == nil { t.Error("failed to open database") }
[#<I>] fix build failure
pankona_gomo-simra
train
go
31dd5ad880c13e573bbd7e2c04323a176c886e33
diff --git a/script/update_doc.rb b/script/update_doc.rb index <HASH>..<HASH> 100755 --- a/script/update_doc.rb +++ b/script/update_doc.rb @@ -24,6 +24,12 @@ unless File.exist? "#{root}/yardoc/.git" end end +Dir.chdir "#{root}/yardoc" do + cmd 'git checkout gh-pages' + cmd 'git fetch origin' + cmd 'git reset --hard origin/gh-pages' +end + message = nil Dir.chdir(root) do puts "commit message: #{message = `git log -n 1 --oneline`.strip}" @@ -31,12 +37,9 @@ Dir.chdir(root) do end Dir.chdir "#{root}/yardoc" do - cmd 'git checkout gh-pages' - cmd 'git fetch origin' - cmd 'git reset --hard origin/gh-pages' cmd 'git add --all' + cmd "git commit -m '#{message}'" if push_to_github - cmd "git commit -m '#{message}'" cmd 'git push origin gh-pages' end end
Fix script/update_doc.rb It was reseting the changes generated by yard doc
Katello_katello
train
rb
d09eaad2748be3a8e95a15944c15907b015ed226
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,7 @@ setup( 'numpy', 'scipy', 'shapely', - 'psutil >= 0.4.1, < 2.2.0', + 'psutil >= 0.4.1, < 3.0.0', 'decorator', ], ext_modules=[geodetic_speedups, geoutils_speedups],
setup.py: psutil <I>.* works and is needed now
gem_oq-engine
train
py
2cf8fad9dc7756ab725fd18bc6fb0252381daa46
diff --git a/libs/auth.js b/libs/auth.js index <HASH>..<HASH> 100644 --- a/libs/auth.js +++ b/libs/auth.js @@ -74,8 +74,8 @@ const resolveVariables = (options = {}) => { const wskprops = readWskProps() || {} const variables = {} - variables.auth = options.auth || wskprops.AUTH - variables.apihost = options.apihost || wskprops.APIHOST + variables.auth = options.auth || process.env.WHISK_AUTH || wskprops.AUTH + variables.apihost = options.apihost || process.env.WHISK_APIHOST || wskprops.APIHOST variables.ignore_certs = options.ignore_certs || wskprops.IGNORE_CERTS || false variables.apigw_token = options.apigw_token || wskprops.APIGW_ACCESS_TOKEN
allow auth from system env.
lionelvillard_openwhisk-project
train
js
7edb4a9e44bcd768582613769fd2eada4acbf4eb
diff --git a/fluent_contents/management/commands/remove_stale_contentitems.py b/fluent_contents/management/commands/remove_stale_contentitems.py index <HASH>..<HASH> 100644 --- a/fluent_contents/management/commands/remove_stale_contentitems.py +++ b/fluent_contents/management/commands/remove_stale_contentitems.py @@ -95,8 +95,15 @@ class Command(BaseCommand): parent_ct = ContentType.objects.get_for_id(ct_id) unreferenced_items = (ContentItem.objects .filter(parent_type=ct_id) - .exclude(parent_id__in=parent_ct.get_all_objects_for_this_type()) .order_by('polymorphic_ctype', 'pk')) + + if parent_ct.model_class() is not None: + # Only select the items that are part of removed pages, + # unless the parent type was removed - then removing all is correct. + unreferenced_items = unreferenced_items.exclude( + parent_id__in=parent_ct.get_all_objects_for_this_type() + ) + if unreferenced_items: for item in unreferenced_items: self.stdout.write(
Fix `remove_stale_contentitems` when when a parent type is also removed
django-fluent_django-fluent-contents
train
py
98e5006ecfefe7c1b1ab10c9e9e906407101ded1
diff --git a/pkg/helm/client.go b/pkg/helm/client.go index <HASH>..<HASH> 100644 --- a/pkg/helm/client.go +++ b/pkg/helm/client.go @@ -30,6 +30,10 @@ import ( rls "k8s.io/helm/pkg/proto/hapi/services" ) +// maxMsgSize use 20MB as the default message size limit. +// grpc library default is 4MB +const maxMsgSize = 1024 * 1024 * 20 + // Client manages client side of the Helm-Tiller protocol. type Client struct { opts options @@ -310,6 +314,7 @@ func (h *Client) connect(ctx context.Context) (conn *grpc.ClientConn, err error) // getting closed by upstreams Time: time.Duration(30) * time.Second, }), + grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMsgSize)), } switch { case h.opts.useTLS: diff --git a/pkg/tiller/server.go b/pkg/tiller/server.go index <HASH>..<HASH> 100644 --- a/pkg/tiller/server.go +++ b/pkg/tiller/server.go @@ -31,7 +31,7 @@ import ( // maxMsgSize use 20MB as the default message size limit. // grpc library default is 4MB -var maxMsgSize = 1024 * 1024 * 20 +const maxMsgSize = 1024 * 1024 * 20 // DefaultServerOpts returns the set of default grpc ServerOption's that Tiller requires. func DefaultServerOpts() []grpc.ServerOption {
Bump client side grpc max msg size Set it to match the server side, or the default limit of 4MB will still apply when upgrading charts. Fixes #<I>
helm_helm
train
go,go
16ba555900db07b6d4310db2bb62b7caaad445bd
diff --git a/ipa/ipa_utils.py b/ipa/ipa_utils.py index <HASH>..<HASH> 100644 --- a/ipa/ipa_utils.py +++ b/ipa/ipa_utils.py @@ -47,9 +47,14 @@ CLIENT_CACHE = {} def clear_cache(ip=None): """Clear the client cache or remove key matching the given ip.""" if ip: - with ignored(KeyError): + with ignored(Exception): + client = CLIENT_CACHE[ip] del CLIENT_CACHE[ip] + client.close() else: + for client in CLIENT_CACHE.values(): + with ignored(Exception): + client.close() CLIENT_CACHE.clear()
Explicitly close SSH clients. Before references are dropped to open clients. Should not rely on garbage collection. <URL>
SUSE-Enceladus_ipa
train
py
cd8c27cf7cf14665cac62916b593045f135621a9
diff --git a/src/Command/Project/ProjectCreateCommand.php b/src/Command/Project/ProjectCreateCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/Project/ProjectCreateCommand.php +++ b/src/Command/Project/ProjectCreateCommand.php @@ -112,7 +112,7 @@ EOF $estimate = $this->api() ->getClient() - ->getSubscriptionEstimate($options['plan'], $options['storage'], $options['environments'], 1); + ->getSubscriptionEstimate($options['plan'], $options['storage'] * 1024, $options['environments'], 1); $costConfirm = sprintf( 'The estimated monthly cost of this project is: <comment>%s</comment>', $estimate['total']
Fix storage cost estimate in 'create' command The API now validates the 'storage' parameter and the wrong value was being sent, causing an error message: "The storage needs to be divisible by <I>".
platformsh_platformsh-cli
train
php
52fd80576143c0cc1758a02b32bcc0eae8e673a7
diff --git a/test/rules/no-angular-classes.js b/test/rules/no-angular-classes.js index <HASH>..<HASH> 100644 --- a/test/rules/no-angular-classes.js +++ b/test/rules/no-angular-classes.js @@ -17,7 +17,11 @@ eslintTester.run('no-angular-classes', rule, { '$$(".myotherclass.myclass");', '$("input.myclass");', 'var s = "ng-scope";', - 'element(by.id("ng-isolate-scope"));' + 'element(by.id("ng-isolate-scope"));', + '$();', + '$$();', + 'element(by.css());', + 'element.all(by.css());' ], invalid: [
test(rules): add a test for 'no-angular-classes' rule for the no arguments case
alecxe_eslint-plugin-protractor
train
js
bf23825ee7e76b9b59a47da87f87135c6a34a528
diff --git a/test/discovery.js b/test/discovery.js index <HASH>..<HASH> 100644 --- a/test/discovery.js +++ b/test/discovery.js @@ -43,7 +43,6 @@ const cryptoWorkerFactory = () => { if (typeof Worker === 'undefined') { const TinyWorker = require('tiny-worker'); return new TinyWorker(() => { - require('babel-register'); // Terrible hack // Browserify throws error if I don't do this // Maybe it could be fixed with noParse instead of eval, but I don't know how,
Trying to remove babel-register
trezor_hd-wallet
train
js
37fc6851a13b136f24983c42f23d62ce13ad0e6d
diff --git a/test/Ardent/LinkedStackTest.php b/test/Ardent/LinkedStackTest.php index <HASH>..<HASH> 100644 --- a/test/Ardent/LinkedStackTest.php +++ b/test/Ardent/LinkedStackTest.php @@ -135,4 +135,17 @@ class LinkedStackTest extends \PHPUnit_Framework_TestCase { } + function testSkip() { + $stack = new LinkedStack(); + for ($i = 0; $i < 5; $i++) { + $stack->push($i); + } + $skipped = $stack->skip(2); + $i = 2; + foreach ($skipped as $value) { + $this->assertEquals($i--, $value); + } + $this->assertEquals(-1, $i); + } + }
Added test to make sure `skip` works properly on a LinkedStack.
morrisonlevi_Ardent
train
php
60a7329937ae351f1d7c3beaa517845a0900314b
diff --git a/ldapcherry/backend/backendLdap.py b/ldapcherry/backend/backendLdap.py index <HASH>..<HASH> 100644 --- a/ldapcherry/backend/backendLdap.py +++ b/ldapcherry/backend/backendLdap.py @@ -248,9 +248,9 @@ class Backend(ldapcherry.backend.Backend): ldap_client.unbind_s() - def add_to_group(self, username, groups): + def add_to_groups(self, username, groups): ldap_client = self._bind() - tmp = self._get_user(username, NO_ATTR) + tmp = self._get_user(username, ALL_ATTRS) dn = tmp[0] attrs = tmp[1] attrs['dn'] = dn @@ -261,9 +261,9 @@ class Backend(ldapcherry.backend.Backend): ldap_client.add_s(group,ldif) ldap_client.unbind_s() - def rm_from_group(self, username): + def del_from_groups(self, username, groups): ldap_client = self._bind() - tmp = self._get_user(username, NO_ATTR) + tmp = self._get_user(username, ALL_ATTRS) dn = tmp[0] attrs = tmp[1] attrs['dn'] = dn
fix API for backend ldap on groups handling
kakwa_ldapcherry
train
py
0106a22656d5a57a586f7b2bee4a108988f99ea8
diff --git a/tests/unit/test-jcanvas-units.js b/tests/unit/test-jcanvas-units.js index <HASH>..<HASH> 100644 --- a/tests/unit/test-jcanvas-units.js +++ b/tests/unit/test-jcanvas-units.js @@ -75,7 +75,6 @@ function animateLayerGroup_circleRect(canvasName, msecShift, afterFn) { .addLayer({method: "drawArc", fillStyle: "#f00", group: "circleAndRect", start: -Math.PI+0.01, end: 3*Math.PI/2+0.01, inDegrees: false, opacity: 0.1, x: 125, y: 50, radius: 20}) - .drawLayers() .animateLayerGroup("circleAndRect", {y: 100, opacity: 1, fillStyle: "#0f0"}, msecShift, afterFn) }
DKS - removed unneeded drawLayers call
caleb531_jcanvas
train
js
a0a64b9d926d272a29b45d05b9fac2681b9d5451
diff --git a/core/src/main/java/lucee/runtime/exp/FunctionNotSupported.java b/core/src/main/java/lucee/runtime/exp/FunctionNotSupported.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/lucee/runtime/exp/FunctionNotSupported.java +++ b/core/src/main/java/lucee/runtime/exp/FunctionNotSupported.java @@ -21,11 +21,11 @@ package lucee.runtime.exp; public class FunctionNotSupported extends ExpressionException { public FunctionNotSupported(String functionName) { - super("function " + functionName + " is not supported"); + super("Function [" + functionName + "] is not supported/implemented"); } public FunctionNotSupported(String functionName, String sub) { - super("function " + functionName + " with " + sub + " is not supported"); + super("Function [" + functionName + "] with [" + sub + "] is not supported/implemented"); } -} \ No newline at end of file +}
update is not supported error to match convention
lucee_Lucee
train
java
5930b365ac61d9f6ffa79039bbd4c4e3d697117a
diff --git a/src/Api/Request.php b/src/Api/Request.php index <HASH>..<HASH> 100644 --- a/src/Api/Request.php +++ b/src/Api/Request.php @@ -249,6 +249,8 @@ class Request { $request = self::createRequestData(['options' => $data], $bookmarks); + print_r($request); + die(); return UrlHelper::buildRequestString($request); } diff --git a/src/Api/Traits/Searchable.php b/src/Api/Traits/Searchable.php index <HASH>..<HASH> 100644 --- a/src/Api/Traits/Searchable.php +++ b/src/Api/Traits/Searchable.php @@ -69,9 +69,7 @@ trait Searchable $options = ['scope' => $scope, 'query' => $query]; $dataJson = $this->appendBookMarks($bookmarks, $options); - $res = Request::createQuery($dataJson); - print_r($dataJson); - die(); + return Request::createQuery($dataJson); } /**
upd: Request::createQuery refactoring
seregazhuk_php-pinterest-bot
train
php,php
68d09cb9628f51cda35cec5f25f6980b3fc1774d
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -176,6 +176,8 @@ Plotly.prototype.getFigure = function (fileOwner, fileId, callback) { Plotly.prototype.saveImage = function (figure, path, callback) { var self = this; + callback = callback || function() {}; + figure = JSON.stringify(figure); var headers = { @@ -206,8 +208,7 @@ Plotly.prototype.saveImage = function (figure, path, callback) { } else { var image = JSON.parse(body).payload; writeFile(path, image, function (err) { - if (err) callback(err); - console.log('image saved!'); + callback(err); }) } }); @@ -222,10 +223,11 @@ Plotly.prototype.saveImage = function (figure, path, callback) { // helper fn to create folders if they don't exist in the path function writeFile (path, image, callback) { mkdirp(getDirName(path), function (err) { - if (err) return callback(err) - fs.writeFile(path + '.png', image, 'base64', function () { - callback(null); - }) + if (err) + callback(err); + fs.writeFile(path + '.png', image, 'base64', function () { + callback(null); + }); }); }
Fix broken callback in saveImage saveImage only calls the callback method under error conditions. Fixed so that it also calls it when saveImage successfully writes the image file to disk. Callback was not being checked for presence, so if it wasn't passed in an exception would be thrown. Fixed to provide a dummy callback if the caller didn't specify one. Removed spurious console logging on successful image write and fixed some formatting in writeFile.
plotly_plotly-nodejs
train
js
6ce75f80f557d80dc70d02a8dea3f169e1183384
diff --git a/pywb/webapp/replay_views.py b/pywb/webapp/replay_views.py index <HASH>..<HASH> 100644 --- a/pywb/webapp/replay_views.py +++ b/pywb/webapp/replay_views.py @@ -148,8 +148,8 @@ class ReplayView(object): if redir_response: return redir_response - length = status_headers.get_header('content-length') - stream = LimitReader.wrap_stream(stream, length) + #length = status_headers.get_header('content-length') + #stream = LimitReader.wrap_stream(stream, length) # one more check for referrer-based self-redirect # TODO: evaluate this, as refreshing in browser may sometimes cause
replay: remove restricting to provided http Content-Length (in addition to record content-length) as it may be incorrect for variety of reasons
webrecorder_pywb
train
py
532c35be17583e85fb3e2955d80777337e0f8a99
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Push.php b/lib/Alchemy/Phrasea/Controller/Prod/Push.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Push.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Push.php @@ -344,7 +344,7 @@ class Push implements ControllerProviderInterface $Validation = new \Entities\ValidationSession(); $Validation->setInitiator($app['Core']->getAuthenticatedUser()); $Validation->setBasket($Basket); - + $Basket->setValidation($Validation); $em->persist($Validation); } @@ -355,7 +355,12 @@ class Push implements ControllerProviderInterface $appbox = \appbox::get_instance(); - + + // add current user as participant + $participants[$user->get_id()] = array( + 'see_others'=> 1, 'usr_id'=> $user->get_id(), 'agree'=> 0, 'HD'=> 0 + ); + foreach ($participants as $key => $participant) { foreach (array('see_others', 'usr_id', 'agree', 'HD') as $mandatoryparam)
add validation session creator as a participant of the session
alchemy-fr_Phraseanet
train
php
aa363f7bd37769dae0e1c3c70fcd64e165700946
diff --git a/z3/pput.py b/z3/pput.py index <HASH>..<HASH> 100644 --- a/z3/pput.py +++ b/z3/pput.py @@ -332,8 +332,12 @@ def main(): if 'HOST' in CFG: extra_config['host'] = CFG['HOST'] - bucket = boto.connect_s3( - CFG['S3_KEY_ID'], CFG['S3_SECRET'], **extra_config).get_bucket(CFG['BUCKET']) + if 'S3_KEY_ID' in CFG: + bucket = boto.connect_s3( + CFG['S3_KEY_ID'], CFG['S3_SECRET'], **extra_config).get_bucket(CFG['BUCKET']) + else: + bucket = boto.connect_s3( + **extra_config).get_bucket(CFG['BUCKET']) # verbosity: 0 totally silent, 1 default, 2 show progress verbosity = 0 if args.quiet else 1 + int(args.progress)
Update pput.py add IAM roles support for pput, snap and get
presslabs_z3
train
py
a40d7632f856a78ff78c0428075c78f90af67a68
diff --git a/src/repository.js b/src/repository.js index <HASH>..<HASH> 100644 --- a/src/repository.js +++ b/src/repository.js @@ -1,5 +1,6 @@ import {inject} from 'aurelia-dependency-injection'; import {Config} from 'spoonx/aurelia-api'; +import typer from 'typer'; @inject(Config) export class Repository { @@ -164,6 +165,12 @@ export class Repository { let value = data[key]; + if (entityMetadata.has('types', key)) { + populatedData[key] = typer.cast(value, entityMetadata.fetch('types', key)); + + continue; + } + if (!entityMetadata.has('associations', key) || typeof value !== 'object') { // Not an association, or not an object. clean copy. populatedData[key] = value;
feat(repository): Cast values if they have type decorators
SpoonX_aurelia-orm
train
js
68ac5a2c4f33f28dced96c3221c4218043b449b4
diff --git a/lib/square.js b/lib/square.js index <HASH>..<HASH> 100644 --- a/lib/square.js +++ b/lib/square.js @@ -586,10 +586,18 @@ Square.prototype.files = function files(cb) { */ Square.prototype.preprocess = function preprocessor(bundle, details, fn) { var meta = bundle.meta - , config = bundle['pre:' + meta.extension] || {} + , origin = bundle['pre:' + meta.extension] + , config = {} , content = '' , self = this; + // + // Merge options from origin to config, can't use origin due to object reference. + // + for (var key in origin) { + config[key] = origin[key]; + } + // We need to some processing steps in order to get the correct content for // this bundle: // @@ -635,7 +643,12 @@ Square.prototype.preprocess = function preprocessor(bundle, details, fn) { // of `pre:extension` are supplied to the compiler. // config.filename = config.filename || meta.location; - config.paths = (config.paths || [ meta.path, meta.directory ]).filter(Boolean); + + // + // Setup paths for the preprocessor to do all file imports from. + // + if (!Array.isArray(config.paths)) config.paths = [ config.paths ]; + config.paths = [meta.path, meta.directory].concat(config.paths).filter(Boolean); meta.compiler(content, config, function compiling(err, content) { if (err) return fn(err);
[fix] be lenient in paths
observing_square
train
js
c4fbd257a3b78be1f49fd523d8e7cec73b697bf7
diff --git a/Controller/Crud/Listener/ApiListener.php b/Controller/Crud/Listener/ApiListener.php index <HASH>..<HASH> 100644 --- a/Controller/Crud/Listener/ApiListener.php +++ b/Controller/Crud/Listener/ApiListener.php @@ -184,14 +184,13 @@ class ApiListener extends CrudListener { // Copy the _serialize configuration from the CrudAction config $action = $event->subject->crud->action(); $serialize = $action->config('serialize'); + $serialize[] = 'success'; if (method_exists($action, 'viewVar')) { $serialize[$action->viewVar()] = 'data'; } else { $serialize[] = 'data'; } - - $serialize[] = 'success'; $this->_controller->set('_serialize', $serialize); // Make sure to use Cruds own View renderer for json and xml
Move success to top of serialize array
FriendsOfCake_crud-json-api
train
php
f34d29bb6585a948f226bff5e80074099ec1b1dc
diff --git a/graphistry/vgraph.py b/graphistry/vgraph.py index <HASH>..<HASH> 100644 --- a/graphistry/vgraph.py +++ b/graphistry/vgraph.py @@ -113,18 +113,12 @@ def storeValueVector(vg, df, col, dtype, target): return info -def unicodeEncode(someString): - try: - return unicode(someString, 'utf-8') - except TypeError: - return someString.encode('utf-8') - # returns tuple() of StringAttributeVector and object with type info. def objectEncoder(vg, series, dtype): series.where(pandas.notnull(series), '\0', inplace=True) # vec is a string[] submessage within a repeated vec = vg.string_vectors.add() - for val in series.map(unicodeEncode): + for val in series.astype('unicode'): vec.values.append(val) return (vec, {'ctype': 'utf8'})
Further/recommended fix per pandas: use astype('unicode') which avoids constructor dependency.
graphistry_pygraphistry
train
py
84eb0a3e147f41f048d5bed712ef13a73f91e5a1
diff --git a/user/index.php b/user/index.php index <HASH>..<HASH> 100644 --- a/user/index.php +++ b/user/index.php @@ -442,13 +442,16 @@ if ($bulkoperations) { echo '</div>'; // Userlist. $enrolrenderer = $PAGE->get_renderer('core_enrol'); -echo '<div class="float-right">'; // Need to re-generate the buttons to avoid having elements with duplicate ids on the page. $enrolbuttons = $manager->get_manual_enrol_buttons(); +$enrolbuttonsout = ''; foreach ($enrolbuttons as $enrolbutton) { - echo $enrolrenderer->render($enrolbutton); + $enrolbuttonsout .= $enrolrenderer->render($enrolbutton); } -echo '</div>'; +echo html_writer::div($enrolbuttonsout, 'd-flex justify-content-end', [ + 'data-region' => 'wrapper', + 'data-table-uniqueid' => $participanttable->uniqueid, +]); if ($newcourse == 1) { $str = get_string('proceedtocourse', 'enrol');
MDL-<I> user: Wrap bottom enrol buttons like top The div wrapping the enrolment buttons has been updated in MDL-<I> to use a flexbox grid. It was also updated to add a data- attribute relating to the participants table id. The bottom enrol button line should have been updated in the same way.
moodle_moodle
train
php
39cad925b8f0d4f4ed5a8aa871e686907935cd5a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -312,7 +312,7 @@ const HashedFolder = function HashedFolder(name, children, options, isRootElemen }; HashedFolder.prototype.toString = function (padding = '') { - const first = `${padding}{ name: '${this.name}', hash: '${this.hash},'\n`; + const first = `${padding}{ name: '${this.name}', hash: '${this.hash}',\n`; padding += ' '; return `${first}${padding}children: ${this.childrenToString(padding)}}`;
Fix comma position in hashfolder.toString (#<I>)
marc136_node-folder-hash
train
js
73fe9c9915522f60c1b34617ff6b00e280b4825c
diff --git a/test/e2e/network/network_policy.go b/test/e2e/network/network_policy.go index <HASH>..<HASH> 100644 --- a/test/e2e/network/network_policy.go +++ b/test/e2e/network/network_policy.go @@ -1829,7 +1829,7 @@ func collectPodsAndNetworkPolicies(f *framework.Framework, podClient *v1.Pod) ([ logs, logErr = e2epod.GetPreviousPodLogs(f.ClientSet, f.Namespace.Name, podClient.Name, fmt.Sprintf("%s-container", podClient.Name)) } if logErr != nil { - framework.Failf("Error getting container logs: %s", logErr) + framework.Logf("Error getting container logs: %s", logErr) } // Collect current NetworkPolicies applied in the test namespace.
Avoid early exit when collecting post-E2E failure logs. collectPodsAndNetworkPolicies() is called to collect diagnostics after a failure. Previously, if it encountered a failure in getting the logs it would call Failf(), discarding the rest of the diagnostics immediately.
kubernetes_kubernetes
train
go
a63188351866b3904c65977c7566c3b63d9298e7
diff --git a/lib/roar/decorator.rb b/lib/roar/decorator.rb index <HASH>..<HASH> 100644 --- a/lib/roar/decorator.rb +++ b/lib/roar/decorator.rb @@ -1 +1,3 @@ -Roar::Decorator = Representable::Decorator +class Roar::Decorator < Representable::Decorator + extend Roar::Representer::InheritableArray +end \ No newline at end of file
derive Decorator from Representable::Decorator and include InheritableArray support.
trailblazer_roar
train
rb
243d8e0d523e4f060a7c2cf1ce7b8135bdcefaf1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', + 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
fix license declaration in setup.py
miguelgrinberg_Flask-Moment
train
py
cf390090762ba4588b7cebc2dabb8a7b332e49d7
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -68,7 +68,7 @@ class Bugspots { } async _paginate(method, param) { - let response = await method({...param, per_page: 100}); + let response = await method(Object.assign(param, {per_page: 100})); let {data} = response; while (this.octokit.hasNextPage(response)) { response = await this.octokit.getNextPage(response);
fix: Not spread operator but Object.assign because of not supporting in <I>.
aha-oretama_github-bugspots
train
js
8e25633517d2e92ac5210d5c0c5566f646eacab3
diff --git a/lib/dm-ar-finders.rb b/lib/dm-ar-finders.rb index <HASH>..<HASH> 100644 --- a/lib/dm-ar-finders.rb +++ b/lib/dm-ar-finders.rb @@ -1,5 +1,5 @@ require 'rubygems' -gem 'dm-core', '~>0.9.11' +gem 'dm-core', '>=0.10.0' require 'dm-core' module DataMapper
updated dm-core dependency to <I> and fixed dm-adjust for <I>
datamapper_dm-ar-finders
train
rb
79a342f3848777bc902c2e9be4a752a9551a5171
diff --git a/build_config.php b/build_config.php index <HASH>..<HASH> 100644 --- a/build_config.php +++ b/build_config.php @@ -2,7 +2,7 @@ $buildConfig = array ( 'major' => 2, 'minor' => 9, - 'build' => 65, + 'build' => 66, 'shopgate_library_path' => '', 'plugin_name' => 'library', 'display_name' => 'Shopgate Library 2.9.x', diff --git a/classes/core.php b/classes/core.php index <HASH>..<HASH> 100644 --- a/classes/core.php +++ b/classes/core.php @@ -22,7 +22,7 @@ ################################################################################### # define constants ################################################################################### -define("SHOPGATE_LIBRARY_VERSION", "2.9.65"); +define("SHOPGATE_LIBRARY_VERSION", "2.9.66"); define('SHOPGATE_LIBRARY_ENCODING' , 'UTF-8'); define('SHOPGATE_BASE_DIR', realpath(dirname(__FILE__).'/../'));
Increased Shopgate Library <I>.x to version <I>.
shopgate_cart-integration-sdk
train
php,php
88f31994f8df38a6b884e9a31131eb37b8e1ede6
diff --git a/lib/chef_fs/file_pattern.rb b/lib/chef_fs/file_pattern.rb index <HASH>..<HASH> 100644 --- a/lib/chef_fs/file_pattern.rb +++ b/lib/chef_fs/file_pattern.rb @@ -189,6 +189,7 @@ module ChefFS @regexp_parts.pop @exact_parts.pop end + next end end
Don't preserve .. when we eat the parent directory
jkeiser_knife-essentials
train
rb
3df767ae8880fee105b0c17812ccecc9918acdea
diff --git a/lib/discordrb/commands/rate_limiter.rb b/lib/discordrb/commands/rate_limiter.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/commands/rate_limiter.rb +++ b/lib/discordrb/commands/rate_limiter.rb @@ -119,7 +119,7 @@ module Discordrb::Commands # Adds all the buckets from another RateLimiter onto this one. # @param limiter [Module] Another {RateLimiter} module def include_buckets(limiter) - buckets = limiter.instance_variable_get '@buckets' + buckets = limiter.instance_variable_get('@buckets') || {} @buckets ||= {} @buckets.merge! buckets end
Make sure include! also works if the included container has no buckets
meew0_discordrb
train
rb
f85f71cb30a4c9769cc23cb5afdcb8418e8c8225
diff --git a/src/Schema/Discount/CouponRestricted.js b/src/Schema/Discount/CouponRestricted.js index <HASH>..<HASH> 100644 --- a/src/Schema/Discount/CouponRestricted.js +++ b/src/Schema/Discount/CouponRestricted.js @@ -16,7 +16,6 @@ const DiscountCouponRestricted = new Schema( }, customerId: { type: Schema.Types.ObjectId, - required: true, }, }, { _id: false }
:bug: Fix legacy DiscountCouponRestricted Allow legacy DiscountCouponRestricted to work. They've been created without customerId so we need to remove the required part here
enhancv_mongoose-subscriptions
train
js
b97936e2e68edf5060163b66fa1bb21b2460d11b
diff --git a/src/python/pants/backend/python/subsystems/poetry.py b/src/python/pants/backend/python/subsystems/poetry.py index <HASH>..<HASH> 100644 --- a/src/python/pants/backend/python/subsystems/poetry.py +++ b/src/python/pants/backend/python/subsystems/poetry.py @@ -24,7 +24,7 @@ class PoetrySubsystem(PythonToolRequirementsBase): options_scope = "poetry" help = "Used to generate lockfiles for third-party Python dependencies." - default_version = "poetry==1.1.8" + default_version = "poetry==1.1.14" register_interpreter_constraints = True default_interpreter_constraints = ["CPython>=3.7,<4"]
Fix poetry locks missing hashes. (#<I>) This was due to this change on PyPI: <URL>
pantsbuild_pants
train
py
25e3387ece5dbf4ab2b5a1aeb1a162153477c1db
diff --git a/view.js b/view.js index <HASH>..<HASH> 100644 --- a/view.js +++ b/view.js @@ -196,7 +196,7 @@ var View = Backbone.View.extend({ }, _attach: function () { - this.views = createViews.call(this); + this._subviews = createViews.call(this); this.elements = getElements(this); if (this.attach) this.attach(); }, @@ -216,6 +216,14 @@ var View = Backbone.View.extend({ return this; }, + remove: function () { + _.invokeMap(this._subviews, 'remove'); + + this._removeElement(); + this.stopListening(); + return this; + }, + // animated remove leave: function (options) { this.stopListening(); @@ -228,13 +236,14 @@ var View = Backbone.View.extend({ subViews = _.compact(_.flatten(_.map(subViews, 'views'))); } - this.$el.leave(options); + this.$el.leave(options, this.remove.bind(this)); return this; } }); View.prototype._remove = View.prototype.remove; +View.prototype._stopListening = View.prototype.stopListening; View.prototype._render = View.prototype.render; module.exports = View;
Remove all subviews on remove(), call remove in leave, and save stopListening as _stopListening for easier access when overriding stopListening.
thecodebureau_ridge
train
js
8498db808266790c5f06eae4287750cf9a066ca3
diff --git a/lib/magic_grid/definition.rb b/lib/magic_grid/definition.rb index <HASH>..<HASH> 100644 --- a/lib/magic_grid/definition.rb +++ b/lib/magic_grid/definition.rb @@ -101,13 +101,19 @@ module MagicGrid end def magic_id - if @options[:id] - @magic_id = @options[:id] + @options.fetch(:id, columns_hash + collection_hash) + end + + def columns_hash + @columns.map(&:label).join.hash.abs.to_s(36) + end + + def collection_hash + if @collection.respond_to? :to_sql + @collection.to_sql.hash.abs.to_s(36) else - @magic_id = @columns.map(&:label).join.hash.abs.to_s(36) - @magic_id << @collection.to_sql.hash.abs.to_s(36) if @collection.respond_to? :to_sql + "" end - @magic_id end def searchable?
Extract hashing methods for magic_id
rmg_magic_grid
train
rb
d811544e45623109649b0aff83dac9c100db4a72
diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index <HASH>..<HASH> 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -38,7 +38,11 @@ class QueryBuilder $class = new \ReflectionClass($this->queries[$name]); $query = $class->newInstanceArgs($arguments); - $this->logger->logQuery($query); + + if ($this->logger) { + $this->logger->logQuery($query); + } + return $query; }
QueryBuilder: log queries only if needed
unimapper_unimapper
train
php
b6c72f072d371b2028f3994820e9de9c46f71e2b
diff --git a/lib/stripe_mock/request_handlers/subscriptions.rb b/lib/stripe_mock/request_handlers/subscriptions.rb index <HASH>..<HASH> 100644 --- a/lib/stripe_mock/request_handlers/subscriptions.rb +++ b/lib/stripe_mock/request_handlers/subscriptions.rb @@ -203,6 +203,10 @@ module StripeMock end end + if params[:trial_period_days] + subscription[:status] = 'trialing' + end + if params[:cancel_at_period_end] subscription[:cancel_at_period_end] = true subscription[:canceled_at] = Time.now.utc.to_i
Properly set the status of a trialing subscription
rebelidealist_stripe-ruby-mock
train
rb
c9edc23ef3fc72d8e6d865ddf59536d007ea4803
diff --git a/src/system/modules/metamodelsattribute_file/dca/tl_metamodel_attribute.php b/src/system/modules/metamodelsattribute_file/dca/tl_metamodel_attribute.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodelsattribute_file/dca/tl_metamodel_attribute.php +++ b/src/system/modules/metamodelsattribute_file/dca/tl_metamodel_attribute.php @@ -41,7 +41,7 @@ $GLOBALS['TL_DCA']['tl_metamodel_attribute']['fields']['file_customFiletree'] = ( 'label' => &$GLOBALS['TL_LANG']['tl_metamodel_attribute']['file_customFiletree'], 'inputType' => 'checkbox', - 'eval' => array('submitOnChange'=>true, 'tl_class'=>'clr') + 'eval' => array('submitOnChange'=>true, 'tl_class'=>'w50') ); $GLOBALS['TL_DCA']['tl_metamodel_attribute']['fields']['file_multiple'] = array
Add w<I> class to optimize the dca listing
MetaModels_attribute_file
train
php
3775d77e1d4fe32ec063afad8cb63c44933136b9
diff --git a/go/vt/srvtopo/resilient_server.go b/go/vt/srvtopo/resilient_server.go index <HASH>..<HASH> 100644 --- a/go/vt/srvtopo/resilient_server.go +++ b/go/vt/srvtopo/resilient_server.go @@ -259,13 +259,13 @@ func (server *ResilientServer) GetSrvKeyspaceNames(ctx context.Context, cell str entry.mutex.Lock() defer entry.mutex.Unlock() - cacheValid := entry.value != nil && time.Since(entry.insertionTime) < server.cacheTTL + cacheValid := entry.value != nil && (time.Since(entry.insertionTime) < server.cacheTTL || staleOK) shouldRefresh := time.Since(entry.lastQueryTime) > server.cacheRefresh // If it is not time to check again, then return either the cached - // value or the cached error but don't ask consul again. + // value or the cached error but don't ask topo again. if !shouldRefresh { - if cacheValid || staleOK { + if cacheValid { return entry.value, nil } return nil, entry.lastError
Simplify stale topo serving codepath. We will now also serve stale topo while the topo cache is refreshing.
vitessio_vitess
train
go
78662e00f248050410669573565264a72f40f13f
diff --git a/sample/app.js b/sample/app.js index <HASH>..<HASH> 100644 --- a/sample/app.js +++ b/sample/app.js @@ -38,7 +38,7 @@ ravel.set('get or create user function', function() { ravel.start(); -ravel.modules.sample.tGetNumbers(undefined, undefined, function(err, result) { +ravel.modules.sample.getNumbers(undefined, function(err, result) { console.log(result); });
Changing sample code to emphasize the fact that transaction endpoints are being created within registered modules
raveljs_ravel
train
js
ac4aaa08e271766d0dbe3ad81603a559d4956da5
diff --git a/addon/scroll/annotatescrollbar.js b/addon/scroll/annotatescrollbar.js index <HASH>..<HASH> 100644 --- a/addon/scroll/annotatescrollbar.js +++ b/addon/scroll/annotatescrollbar.js @@ -73,19 +73,15 @@ var singleLineH = wrapping && cm.defaultTextHeight() * 1.5; var curLine = null, curLineObj = null; - function getFoldLineHandle(pos) { - var marks = cm.findMarksAt(pos); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].collapsed) - return marks[i].lines[0]; - } - } - function getY(pos, top) { if (curLine != pos.line) { - curLine = pos.line; - if(!(curLineObj = getFoldLineHandle(pos))) - curLineObj = cm.getLineHandle(curLine); + curLine = pos.line + curLineObj = cm.getLineHandle(pos.line) + var visual = cm.getLineHandleVisualStart(curLineObj) + if (visual != curLineObj) { + curLine = cm.getLineNumber(visual) + curLineObj = visual + } } if ((curLineObj.widgets && curLineObj.widgets.length) || (wrapping && curLineObj.height > singleLineH))
[annotatescrollbar addon] Simplify visual-line finding Issue #<I>
codemirror_CodeMirror
train
js