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
a3061ea477776c73430e58e3da59e376fe7d1647
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -61,7 +61,6 @@ setup(name='bika.lims', 'robotsuite', 'robotframework-selenium2library', 'plone.app.robotframework', - 'robotframework-debuglibrary', ] }, entry_points="""
Remove robotframework-debuglibrary from setup.py Fails the buildout due to version mismatches.
senaite_senaite.core
train
py
4e31d3cb7ca2a03f95d2e75c5b275e27b1072773
diff --git a/cachalot/tests/api.py b/cachalot/tests/api.py index <HASH>..<HASH> 100644 --- a/cachalot/tests/api.py +++ b/cachalot/tests/api.py @@ -38,7 +38,7 @@ class APITestCase(TransactionTestCase): self.assertListEqual(data1, ['test1']) self.cursor.execute( - "INSERT INTO cachalot_test (name, public) VALUES ('test2', true);") + "INSERT INTO cachalot_test (name, public) VALUES ('test2', 1);") with self.assertNumQueries(0): data2 = list(Test.objects.values_list('name', flat=True))
Changes another boolean.
noripyt_django-cachalot
train
py
01e5087878791381fd7d5ea643749dbebcce1b30
diff --git a/www/src/py_float.js b/www/src/py_float.js index <HASH>..<HASH> 100644 --- a/www/src/py_float.js +++ b/www/src/py_float.js @@ -172,17 +172,11 @@ function preformat(self, fmt){ } if(fmt.precision!==undefined){ - // Use Javascript toPrecision to get the correct result - // The argument of toPrecision is the number of digits after . - // For format type f, precision is the total number of digits, so we - // must add the number of digits before "." + // Use Javascript toFixed to get the correct result + // The argument of toFixed is the number of digits after . var prec = fmt.precision if(prec==0){return Math.round(self)+''} - if(prec && 'fF%'.indexOf(fmt.type)>-1){ - var pos_pt = Math.abs(self).toString().search(/\./) - if(pos_pt>-1){prec+=pos_pt}else{prec=Math.abs(self).toString().length} - } - var res = self.toPrecision(prec), + var res = self.toFixed(prec), pt_pos=res.indexOf('.') if(fmt.type!==undefined && (fmt.type=='%' || fmt.type.toLowerCase()=='f')){
BUGFIX: Fix formating precision for floats close to 0 (Issue #<I>) The `toPrecision` function prints precision number of **significant** digits instead of **number of digits after .**. (see <URL>) For numbers which are close to 0 (closer than (<I>**-precision)) this is wrong. We should call `toFixed` instead.
brython-dev_brython
train
js
439c1b1b905fd18c66fca19b886ef93ecc317348
diff --git a/fusionbox/templatetags/fusionbox_tags.py b/fusionbox/templatetags/fusionbox_tags.py index <HASH>..<HASH> 100644 --- a/fusionbox/templatetags/fusionbox_tags.py +++ b/fusionbox/templatetags/fusionbox_tags.py @@ -104,7 +104,7 @@ class HighlightHereNode(HighlighterBase): def elems_to_highlight(self, soup, context): try: - path = context[self.options[0]] + path = template.Variable(self.options[0]).resolve(context) except template.VariableDoesNotExist: path = self.options[0] except IndexError:
try to make a template Variable object first
fusionbox_django-argonauts
train
py
5fafb84aeeddc632601821d62407ea3619995128
diff --git a/lib/Mollie/API/Object/Payment.rb b/lib/Mollie/API/Object/Payment.rb index <HASH>..<HASH> 100644 --- a/lib/Mollie/API/Object/Payment.rb +++ b/lib/Mollie/API/Object/Payment.rb @@ -8,6 +8,7 @@ module Mollie STATUS_PAID = "paid" STATUS_PAIDOUT = "paidout" STATUS_FAILED = "failed" + STATUS_REFUNDED = "refunded" RECURRINGTYPE_NONE = nil RECURRINGTYPE_FIRST = "first" @@ -52,6 +53,10 @@ module Mollie @status == STATUS_PAIDOUT end + def refunded? + @status == STATUS_REFUNDED + end + def getPaymentUrl @links && @links.paymentUrl end
Added refunded? to Payments so that you can check the status.
mollie_mollie-api-ruby
train
rb
8df09f558aaca84f87dc30732f35fa30025c0920
diff --git a/mailer/tests.py b/mailer/tests.py index <HASH>..<HASH> 100644 --- a/mailer/tests.py +++ b/mailer/tests.py @@ -236,7 +236,14 @@ class TestSending(TestCase): with self.settings(MAILER_EMAIL_BACKEND="mailer.tests.FailingMailerEmailBackend", MAILER_EMAIL_MAX_DEFERRED=2): # noqa # 2 will get deferred 3 remain undeferred - engine.send_all() + with patch("logging.warning") as w: + engine.send_all() + + w.assert_called_once() + arg = w.call_args[0][0] + self.assertIn("EMAIL_MAX_DEFERRED", arg) + self.assertIn("stopping for this round", arg) + self.assertEqual(Message.objects.count(), 5) self.assertEqual(Message.objects.deferred().count(), 2) @@ -460,7 +467,12 @@ class TestMessages(TestCase): msg.save() - engine.send_all() + with patch("logging.warning") as w: + engine.send_all() + + w.assert_called_once() + arg = w.call_args[0][0] + self.assertIn("message discarded due to failure in converting from DB", arg) self.assertEqual(Message.objects.count(), 0) self.assertEqual(Message.objects.deferred().count(), 0)
Silence and ensure logging warnings are shown during tests
pinax_django-mailer
train
py
7fad1986574e93e3ebb65fa4da01123f862d3a15
diff --git a/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java b/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java +++ b/aeron-cluster/src/test/java/io/aeron/cluster/ClusterTest.java @@ -549,7 +549,7 @@ public class ClusterTest } } - @Test(timeout = 20_000) + @Test(timeout = 10_000) public void shouldCatchupFromEmptyLog() throws Exception { final int messageCount = 10;
[Java] Update test timeout.
real-logic_aeron
train
java
7cf50f3ca8dab6ec5175cabfb6a33513958a2bff
diff --git a/vuebar.js b/vuebar.js index <HASH>..<HASH> 100644 --- a/vuebar.js +++ b/vuebar.js @@ -290,6 +290,9 @@ function preventParentScroll(el, event){ + if (state.visibleArea >= 1) { + return false; + } var state = getState(el); var scrollDist = state.el2.scrollHeight - state.el2.clientHeight;
Don’t prevent scroll when scroll bar is not visible. Right now even if the scroll bar is not present, it is preventing scrolling. This shouldn’t happen when no scroll bar is present.
DominikSerafin_vuebar
train
js
f1c53c25644793d7a779ea885d075997e52fbba2
diff --git a/openquake/server/dbserver.py b/openquake/server/dbserver.py index <HASH>..<HASH> 100644 --- a/openquake/server/dbserver.py +++ b/openquake/server/dbserver.py @@ -106,7 +106,8 @@ def check_foreign(): """ if not config.flag_set('dbserver', 'multi_user'): remote_server_path = logs.dbcmd('get_path') - if server_path != remote_server_path: + # don't care about the extension (it may be .py or .pyc) + if server_path.split('.')[-2] != remote_server_path.split('.')[-2]: return('You are trying to contact a DbServer from another' + ' instance (%s)\n' % remote_server_path + 'Check the configuration or stop the foreign'
Check dbserver path excluding any extension
gem_oq-engine
train
py
cd30552ec0178f1805095e74a9111c8272b3ceb6
diff --git a/src/evaluator/shell.js b/src/evaluator/shell.js index <HASH>..<HASH> 100644 --- a/src/evaluator/shell.js +++ b/src/evaluator/shell.js @@ -89,6 +89,11 @@ Shell.prototype.appendCode = function(code) { } } +// Creates errors for the purposes of displaying just an error message, without any stack trace. +Shell.prototype.createError = function() { + return error.create.apply(null, arguments); +} + // Creates traces for errors raised within the shell. It removes the Shell and underlying // kernel-specific stack frames to provide a user code-only trace. Shell.prototype.createTrace = function(error) {
Expose error creation functionality on shell
interactivecomputing_ijs
train
js
ab79501dafd95e1c9690d9ca79db49dda83f3851
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Subunits.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Subunits.java index <HASH>..<HASH> 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Subunits.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/Subunits.java @@ -436,8 +436,12 @@ public class Subunits { * @return The common factors of the stoichiometry */ public static List<Integer> getValidFolds(List<Integer> stoichiometry) { + List<Integer> denominators = new ArrayList<Integer>(); + if (stoichiometry.isEmpty()) + return denominators; + int nChains = Collections.max(stoichiometry); // Remove duplicate stoichiometries
Handle error with structures without protein subunits
biojava_biojava
train
java
1d8cb8b3cffd8cb4e13ddf1dbc1abed8e0c9a0d8
diff --git a/jquery.flot.js b/jquery.flot.js index <HASH>..<HASH> 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1439,10 +1439,11 @@ // draw shadow as a thick and thin line with transparency ctx.lineWidth = sw; ctx.strokeStyle = "rgba(0,0,0,0.1)"; - var xoffset = 1; - plotLine(series.datapoints, xoffset, Math.sqrt((lw/2 + sw/2)*(lw/2 + sw/2) - xoffset*xoffset), series.xaxis, series.yaxis); + // position shadow at angle from the mid of line + var angle = Math.PI/18; + plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis); ctx.lineWidth = sw/2; - plotLine(series.datapoints, xoffset, Math.sqrt((lw/2 + sw/4)*(lw/2 + sw/4) - xoffset*xoffset), series.xaxis, series.yaxis); + plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis); } ctx.lineWidth = lw;
Fixed bug in line calculation with small values of shadow size and line width, reported by lepianiste (issue <I>) git-svn-id: <URL>
ni-kismet_engineering-flot
train
js
c6b7c9448f16f812d424128a2da303475851da00
diff --git a/authomatic/providers/__init__.py b/authomatic/providers/__init__.py index <HASH>..<HASH> 100644 --- a/authomatic/providers/__init__.py +++ b/authomatic/providers/__init__.py @@ -300,7 +300,11 @@ class BaseProvider(object): cls._log(logging.DEBUG, u' \u2514\u2500 body: {}'.format(body)) # Connect - connection = httplib.HTTPSConnection(host) + if scheme.lower() == 'https': + connection = httplib.HTTPSConnection(host) + else: + connection = httplib.HTTPConnection(host) + try: connection.request(method, request_path, body, headers) except Exception as e:
Fixed a bug with fetching non 'https' urls.
authomatic_authomatic
train
py
1263ed4d2ef47b5ff3a38385c11b6712eae22916
diff --git a/internal/transport/http2_server.go b/internal/transport/http2_server.go index <HASH>..<HASH> 100644 --- a/internal/transport/http2_server.go +++ b/internal/transport/http2_server.go @@ -1155,7 +1155,7 @@ func (t *http2Server) IncrMsgRecv() { } func (t *http2Server) getOutFlowWindow() int64 { - resp := make(chan uint32) + resp := make(chan uint32, 1) timer := time.NewTimer(time.Second) defer timer.Stop() t.controlBuf.put(&outFlowControlSizeRequest{resp})
internal: add buffer for channelz flowcontrol getter channel (#<I>) to avoid goroutine leak
grpc_grpc-go
train
go
ca586175ba3965496ffc966104105a3dfa637758
diff --git a/synapse/lib/ast.py b/synapse/lib/ast.py index <HASH>..<HASH> 100644 --- a/synapse/lib/ast.py +++ b/synapse/lib/ast.py @@ -856,7 +856,7 @@ class FormPivot(PivotOper): yield pivo, path.fork(pivo) except (s_exc.BadTypeValu, s_exc.BadLiftValu) as e: if not warned: - logger.warning('Caught error during pivot', exc_info=e) + logger.warning(f'Caught error during pivot: {e.items()}') warned = True items = e.items() mesg = items.pop('mesg', '') @@ -1011,7 +1011,7 @@ class PropPivot(PivotOper): yield pivo, path.fork(pivo) except (s_exc.BadTypeValu, s_exc.BadLiftValu) as e: if not warned: - logger.warning('Caught error during pivot', exc_info=e) + logger.warning(f'Caught error during pivot: {e.items()}') warned = True items = e.items() mesg = items.pop('mesg', '')
Remove the traceback from server side errors.
vertexproject_synapse
train
py
bc31d20489b38546c6d8e1592fa8b4b5d6ca5dd4
diff --git a/lib/gush/workflow.rb b/lib/gush/workflow.rb index <HASH>..<HASH> 100644 --- a/lib/gush/workflow.rb +++ b/lib/gush/workflow.rb @@ -46,7 +46,7 @@ module Gush end def running? - nodes.any? {|j| j.enqueued? || j.running? } && !stopped? + !stopped? && nodes.any? {|j| j.enqueued? || j.running? } end def failed? @@ -116,9 +116,7 @@ module Gush end def next_jobs - @nodes.select do |job| - job.can_be_started? - end + @nodes.select(&:can_be_started?) end def self.descendants
Clean up code and make sure stopped is checked first.
chaps-io_gush
train
rb
e36fe9a87251279671ed187fee23abc519123f7b
diff --git a/tarbell/cli.py b/tarbell/cli.py index <HASH>..<HASH> 100644 --- a/tarbell/cli.py +++ b/tarbell/cli.py @@ -310,7 +310,7 @@ def tarbell_publish(command, args): kwargs['excludes'] = site.project.EXCLUDES s3 = S3Sync(tempdir, bucket_url, **kwargs) s3.deploy_to_s3() - site.call_hook("publish", s3) + site.call_hook("publish", site, s3) puts("\nIf you have website hosting enabled, you can see your project at:") puts(colored.green("http://{0}\n".format(bucket_url)))
call publish hook with site and s3 connection
tarbell-project_tarbell
train
py
bf7155e8ccd681171681e8b467f8836bc6e86c7a
diff --git a/test/markup_test.rb b/test/markup_test.rb index <HASH>..<HASH> 100644 --- a/test/markup_test.rb +++ b/test/markup_test.rb @@ -9,14 +9,19 @@ class MarkupTest < Test::Unit::TestCase markup = readme.split('/').last.gsub(/^README\./, '') define_method "test_#{markup}" do - expected = File.read("#{readme}.html") + expected_file = "#{readme}.html" + expected = File.read(expected_file) actual = GitHub::Markup.render(readme, File.read(readme)) - assert expected == actual, <<-message -#{markup} expected: -#{expected} -#{markup} actual: -#{actual} + diff = IO.popen("diff -u - #{expected_file}", 'r+') do |f| + f.write actual + f.close_write + f.read + end + + assert expected == actual, <<message +#{File.basename expected_file}'s contents don't match command output: +#{diff} message end end
use diff(1) for showing test failures
github_markup
train
rb
6abe5cbd2478ea12d9acb95846e1d122381f3990
diff --git a/Generator/VariantGenerator.php b/Generator/VariantGenerator.php index <HASH>..<HASH> 100644 --- a/Generator/VariantGenerator.php +++ b/Generator/VariantGenerator.php @@ -13,6 +13,7 @@ namespace Sylius\Component\Variation\Generator; use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Variation\Model\VariableInterface; +use Sylius\Component\Variation\Model\VariantInterface; use Sylius\Component\Variation\SetBuilder\SetBuilderInterface; /** @@ -77,4 +78,27 @@ class VariantGenerator implements VariantGeneratorInterface $variable->addVariant($variant); } } + + /** + * @param VariableInterface $variable + * @param array $optionMap + * @param mixed $permutation + * + * @return VariantInterface + */ + protected function createVariant(VariableInterface $variable, array $optionMap, $permutation) + { + $variant = $this->variantFactory->createNew(); + $variant->setObject($variable); + + if (is_array($permutation)) { + foreach ($permutation as $id) { + $variant->addOption($optionMap[$id]); + } + } else { + $variant->addOption($optionMap[$permutation]); + } + + return $variant; + } }
[Product][Core][Admin] PR review and after variant changes fixes
Sylius_Variation
train
php
bceca9fce29503f87118c283cc8305a9b75e8faa
diff --git a/jpyutil.py b/jpyutil.py index <HASH>..<HASH> 100644 --- a/jpyutil.py +++ b/jpyutil.py @@ -621,16 +621,16 @@ def _main(): parser.add_argument("--install_dir", action='store', default=None, help="Optional. Used during pip install of JPY") args = parser.parse_args() - log_level = getattr(logger, args.log_level.upper(), None) + log_level = getattr(logging, args.log_level.upper(), None) if not isinstance(log_level, int): raise ValueError('Invalid log level: %s' % log_level) log_format = '%(levelname)s: %(message)s' log_file = args.log_file if log_file: - logger.basicConfig(format=log_format, level=log_level, filename=log_file, filemode='w') + logging.basicConfig(format=log_format, level=log_level, filename=log_file, filemode='w') else: - logger.basicConfig(format=log_format, level=log_level) + logging.basicConfig(format=log_format, level=log_level) try: retcode = write_config_files(out_dir=args.out,
fixed jpyutil logging vs logger issue
bcdev_jpy
train
py
a27264ac92898c1d09a14536e5f76b1060b90c2c
diff --git a/registrasion/controllers/item.py b/registrasion/controllers/item.py index <HASH>..<HASH> 100644 --- a/registrasion/controllers/item.py +++ b/registrasion/controllers/item.py @@ -84,7 +84,7 @@ class ItemController(object): aggregating like products from across multiple invoices. ''' - return self._items(commerce.Cart.STATUS_PAID) + return self._items(commerce.Cart.STATUS_PAID, category=category) def items_pending(self): ''' Gets all of the items that the user has reserved, but has not yet
Filters items_purchased by category. Fixes #<I>
chrisjrn_registrasion
train
py
930a1d5329bd75663cfed9af320730a5446b8305
diff --git a/acos_client/v30/slb/template/ssl.py b/acos_client/v30/slb/template/ssl.py index <HASH>..<HASH> 100644 --- a/acos_client/v30/slb/template/ssl.py +++ b/acos_client/v30/slb/template/ssl.py @@ -52,8 +52,8 @@ class BaseSSL(base.BaseV30): else: obj_params = { "name": name, - "cert-str": cert, - "key-str": key, + "cert": cert, + "key": key, self.passphrase: passphrase, # Unimplemented options: # "encrypted": encrypted,
Updated ssl template payload to reflect changes in AXAPI
a10networks_acos-client
train
py
48b8f9b12e9ce2f67c6e6e30348173730e331f17
diff --git a/js/poloniex.js b/js/poloniex.js index <HASH>..<HASH> 100644 --- a/js/poloniex.js +++ b/js/poloniex.js @@ -202,7 +202,7 @@ module.exports = class poloniex extends Exchange { 'Nonce must be greater': InvalidNonce, 'You have already called cancelOrder or moveOrder on this order.': CancelPending, 'Amount must be at least': InvalidOrder, // {"error":"Amount must be at least 0.000001."} - 'is either completed or does not exist': InvalidOrder, // {"error":"Order 587957810791 is either completed or does not exist."} + 'is either completed or does not exist': OrderNotFound, // {"error":"Order 587957810791 is either completed or does not exist."} 'Error pulling ': ExchangeError, // {"error":"Error pulling order book"} }, },
Fix poloniex error to actually be OrderNotFound
ccxt_ccxt
train
js
4c5b8649dbe96da68cf5546effc0b8e07a23ac56
diff --git a/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java b/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java +++ b/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java @@ -20,15 +20,16 @@ public class DnsCacheFile implements Recorder { public DnsCacheFile(String directory) throws IOException { this.directory = directory; f = new File(directory); - if (!f.isDirectory() || !f.exists()) { + + if (!f.isDirectory()) { + throw new IOException("does not mkdir"); + } + + if (!f.exists()) { boolean r = f.mkdirs(); if (!r) { throw new IOException("mkdir failed"); } - return; - } - if (!f.isDirectory()) { - throw new IOException("does not mkdir"); } }
change dns cache file create logic
qiniu_android-sdk
train
java
f5125e92e2c0365b7b540397f2dc2b3f080f8c76
diff --git a/spec/unit/honeybadger/plugins/local_variables_spec.rb b/spec/unit/honeybadger/plugins/local_variables_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/honeybadger/plugins/local_variables_spec.rb +++ b/spec/unit/honeybadger/plugins/local_variables_spec.rb @@ -42,7 +42,7 @@ describe "Local variables integration", order: :defined do subject do # Test in isolation rather than installing the plugin globally. Class.new(Exception) do |klass| - klass.include(Honeybadger::Plugins::LocalVariables::ExceptionExtension) + klass.send(:include, Honeybadger::Plugins::LocalVariables::ExceptionExtension) end.new end
Send include for Ruby < <I>
honeybadger-io_honeybadger-ruby
train
rb
b0481b756c87a87991f7bef9a71d374449b129aa
diff --git a/tests/Auth/GuardTest.php b/tests/Auth/GuardTest.php index <HASH>..<HASH> 100644 --- a/tests/Auth/GuardTest.php +++ b/tests/Auth/GuardTest.php @@ -98,4 +98,23 @@ class GuardTest extends TestCase $this->assertNull($guard->bindAsAdministrator()); } + + public function test_prefix_and_suffix_are_being_used_in_attempt() + { + $config = $this->mock(DomainConfiguration::class); + + $config + ->shouldReceive('get')->withArgs(['account_prefix'])->once()->andReturn('prefix.') + ->shouldReceive('get')->withArgs(['account_suffix'])->once()->andReturn('.suffix') + ->shouldReceive('get')->withArgs(['username'])->once() + ->shouldReceive('get')->withArgs(['password'])->once(); + + $ldap = $this->mock(Ldap::class); + + $ldap->shouldReceive('bind')->once()->withArgs(['prefix.username.suffix', 'password'])->andReturn(true); + + $guard = new Guard($ldap, $config); + + $this->assertTrue($guard->attempt('username', 'password', $bindAsUser = true)); + } }
Added prefix and suffix test
Adldap2_Adldap2
train
php
f8d14bd4c6a0e3c58130be159b05b8aa63374f6e
diff --git a/distribution/xfer/download.go b/distribution/xfer/download.go index <HASH>..<HASH> 100644 --- a/distribution/xfer/download.go +++ b/distribution/xfer/download.go @@ -263,7 +263,7 @@ func (ldm *LayerDownloadManager) makeDownloadFunc(descriptor DownloadDescriptor, selectLoop: for { - progress.Updatef(progressOutput, descriptor.ID(), "Retrying in %d seconds", delay) + progress.Updatef(progressOutput, descriptor.ID(), "Retrying in %d second%s", delay, (map[bool]string{true: "s"})[delay != 1]) select { case <-ticker.C: delay-- diff --git a/distribution/xfer/upload.go b/distribution/xfer/upload.go index <HASH>..<HASH> 100644 --- a/distribution/xfer/upload.go +++ b/distribution/xfer/upload.go @@ -141,7 +141,7 @@ func (lum *LayerUploadManager) makeUploadFunc(descriptor UploadDescriptor) DoFun selectLoop: for { - progress.Updatef(progressOutput, descriptor.ID(), "Retrying in %d seconds", delay) + progress.Updatef(progressOutput, descriptor.ID(), "Retrying in %d second%s", delay, (map[bool]string{true: "s"})[delay != 1]) select { case <-ticker.C: delay--
Fix typo for download and upload retry messages
moby_moby
train
go,go
826a16d6887cf5a6704f83c2498f7b651bb0474d
diff --git a/lib/swag_dev/project/tools/gemspec/builder.rb b/lib/swag_dev/project/tools/gemspec/builder.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev/project/tools/gemspec/builder.rb +++ b/lib/swag_dev/project/tools/gemspec/builder.rb @@ -2,6 +2,7 @@ require 'swag_dev/project/tools/gemspec' require 'swag_dev/project/tools/gemspec/builder/filesystem' +require 'swag_dev/project/tools/gemspec/builder/command' require 'rubygems' # Package a ``gem`` from its ``gemspec`` file @@ -73,6 +74,30 @@ class SwagDev::Project::Tools::Gemspec::Builder super(method, include_private) end + # Get buildable (relative path) + # + # @return [Pathname] + def buildable + full_name = gemspec_reader.read(Hash).fetch(:full_name) + file_path = fs.build_dirs + .fetch(:gem) + .join("#{full_name}.gem") + .to_s + .gsub(%r{^\./}, '') + + Pathname.new(file_path) + end + + def build + Command.new do |command| + command.executable = :gem + command.pwd = pwd + command.src_dir = build_dirs.fetch(:src) + command.buildable = buildable + command.specification = gemspec_reader.read + end.execute + end + protected # Get project
gemspec/builder (tools) command added
SwagDevOps_kamaze-project
train
rb
b8774f5dd0d55ad1c29d92c9100184098df20485
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ function HashRouter(opts) { var newHash = hash var oldHash = "#/" - if (event) { + if (event && event.newURL && event.oldURL) { var newUrl = url.parse(event.newURL) if (newUrl && "hash" in newUrl) { newHash = newUrl.hash
IE<I> undefined fix something about IE causes an event to come in without these properties
Raynos_hash-router
train
js
63168b607c60f3b15384112b3d688f5561bd733f
diff --git a/lib/magic_grid/order.rb b/lib/magic_grid/order.rb index <HASH>..<HASH> 100644 --- a/lib/magic_grid/order.rb +++ b/lib/magic_grid/order.rb @@ -1,6 +1,6 @@ module MagicGrid module Order - class Unordered < BasicObject + class Unordered def self.css_class 'sort-none' end
Remove reference to BasicObject, it wasn't introduced until <I>
rmg_magic_grid
train
rb
31562b75fee2c7feb8605c280ff1362e83ee32a9
diff --git a/django_auth_adfs/middleware.py b/django_auth_adfs/middleware.py index <HASH>..<HASH> 100644 --- a/django_auth_adfs/middleware.py +++ b/django_auth_adfs/middleware.py @@ -21,8 +21,8 @@ except ImportError: # Django < 1.10 LOGIN_EXEMPT_URLS = [ compile(django_settings.LOGIN_URL.lstrip('/')), - compile(django_settings.LOOUT_URL.lstrip('/')), compile(reverse("django_auth_adfs:login").lstrip('/')), + compile(reverse("django_auth_adfs:logout").lstrip('/')), ] if hasattr(settings, 'LOGIN_EXEMPT_URLS'): LOGIN_EXEMPT_URLS += [compile(expr) for expr in settings.LOGIN_EXEMPT_URLS]
Remove broken and deprecated django setting.
jobec_django-auth-adfs
train
py
3e3be8e8ef75c1f70d369c9a80810f6bfe47875a
diff --git a/lib/attr_encrypted/version.rb b/lib/attr_encrypted/version.rb index <HASH>..<HASH> 100644 --- a/lib/attr_encrypted/version.rb +++ b/lib/attr_encrypted/version.rb @@ -3,7 +3,7 @@ module AttrEncrypted module Version MAJOR = 3 MINOR = 0 - PATCH = 1 + PATCH = 2 # Returns a version string by joining <tt>MAJOR</tt>, <tt>MINOR</tt>, and <tt>PATCH</tt> with <tt>'.'</tt> #
Updated version to <I>
attr-encrypted_attr_encrypted
train
rb
c849a524c41f536252f761cc4935a3fb0f386e41
diff --git a/views/js/e2e/_helpers/commands/setupCommands.js b/views/js/e2e/_helpers/commands/setupCommands.js index <HASH>..<HASH> 100644 --- a/views/js/e2e/_helpers/commands/setupCommands.js +++ b/views/js/e2e/_helpers/commands/setupCommands.js @@ -133,8 +133,3 @@ Cypress.Commands.add('startTest', (testName) => { cy.wait(['@testRunnerGet', '@testRunnerPost']); }); -Cypress.Commands.add('isTestFinished', (testName) => { - cy.location().should((loc) => { - expect(loc.pathname).to.eq(runnerUrls.availableDeliveriesPageUrl); - }); -});
remove is test finished. this is not a command
oat-sa_extension-tao-testqti
train
js
d29f4ab7297abe4efe75f67fca1bc98ce4fbf313
diff --git a/src/main/java/spark/Request.java b/src/main/java/spark/Request.java index <HASH>..<HASH> 100644 --- a/src/main/java/spark/Request.java +++ b/src/main/java/spark/Request.java @@ -75,7 +75,7 @@ public class Request { // request.get? # true (similar methods for other verbs) // request.secure? # false (would be true over ssl) // request.forwarded? # true (if running behind a reverse proxy) - // request.cookies # hash of browser cookies + // request.cookies # hash of browser cookies, DONE // request.xhr? # is this an ajax request? // request.script_name # "/example" // request.form_data? # false
add DONE for cookies in the feature list
perwendel_spark
train
java
e1854bb4970887b6943b8836b99c991a1a36115d
diff --git a/tradingAPI/api.py b/tradingAPI/api.py index <HASH>..<HASH> 100644 --- a/tradingAPI/api.py +++ b/tradingAPI/api.py @@ -95,7 +95,7 @@ class API(object): self.logger.critical("login failed") return 0 sleep(1) - self.logger.debug("logged in") + self.logger.debug("logged in as {}".format(bold(username))) if mode == "demo" and self._elCss(path['alert-box']): self._css(path['alert-box']).click() return 1
Added username to debug logger
federico123579_Trading212-API
train
py
f616f76b14a19e61c9a2087d039fc93dfa1e3012
diff --git a/shap/explainers/tree.py b/shap/explainers/tree.py index <HASH>..<HASH> 100644 --- a/shap/explainers/tree.py +++ b/shap/explainers/tree.py @@ -119,8 +119,10 @@ class TreeExplainer(Explainer): self.expected_value = self.__dynamic_expected_value elif data is not None: self.expected_value = self.model.predict(self.data, output=model_output).mean(0) + if len(self.expected_value) == 1: + self.expected_value = self.expected_value[0] elif hasattr(self.model, "node_sample_weight"): - self.expected_value = self.model.values[:,0].sum(0) + self.expected_value = self.model.values[:,0].sum(0)[0] self.expected_value += self.model.base_offset def __dynamic_expected_value(self, y):
Partly fix #<I> This fixes the issue where the expected_value can be wrapped in a 1-element array before calling shap_values for TreeExplainer
slundberg_shap
train
py
fb2af2b3e73c30555a99965e7e21ec75378cea29
diff --git a/htmresearch/frameworks/layers/l2_l4_inference.py b/htmresearch/frameworks/layers/l2_l4_inference.py index <HASH>..<HASH> 100644 --- a/htmresearch/frameworks/layers/l2_l4_inference.py +++ b/htmresearch/frameworks/layers/l2_l4_inference.py @@ -141,7 +141,7 @@ class L4L2Experiment(object): longDistanceConnections = 0, maxConnectionDistance = 1, columnPositions = None, - decayFunction = lambda x: 1./(x**2), + decayFunction = lambda x: 1., L4Overrides=None, numLearningPoints=3, seed=42,
RES-<I> Change decay function for debugging
numenta_htmresearch
train
py
43da56d6a3e8dcdca9ae750f09a0f3f587966219
diff --git a/test/automated_test.py b/test/automated_test.py index <HASH>..<HASH> 100755 --- a/test/automated_test.py +++ b/test/automated_test.py @@ -55,6 +55,7 @@ from concurrency_test import ConcurrencyTest from commands_test import CommandsTest from commander_test import CommanderTest from probeserver_test import ProbeserverTest +from user_script_test import UserScriptTest XML_RESULTS_TEMPLATE = "test_results{}.xml" LOG_FILE_TEMPLATE = "automated_test_result{}.txt" @@ -79,6 +80,7 @@ all_tests = [ CommandsTest(), CommanderTest(), ProbeserverTest(), + UserScriptTest(), ] # Actual list used at runtime, filted by command line args.
test: automated_test: add missing user_script_test.
mbedmicro_pyOCD
train
py
f34a7430e33cd76fcf34c825b61be2952e66309a
diff --git a/tsdb/meta.go b/tsdb/meta.go index <HASH>..<HASH> 100644 --- a/tsdb/meta.go +++ b/tsdb/meta.go @@ -74,7 +74,7 @@ func (d *DatabaseIndex) Series(key string) *Series { func (d *DatabaseIndex) SeriesKeys() []string { d.mu.RLock() - s := make([]string, len(d.series)) + s := make([]string, 0, len(d.series)) for k := range d.series { s = append(s, k) }
Fix length of (*DatabaseIndex).SeriesKeys() Previously, it would return as many empty strings in the first half of the slice as valid values at the end of the slice.
influxdata_influxdb
train
go
d9547a4746b7990caed6a66c2f9f367b270b6af2
diff --git a/src/Execution/Processor.php b/src/Execution/Processor.php index <HASH>..<HASH> 100644 --- a/src/Execution/Processor.php +++ b/src/Execution/Processor.php @@ -53,8 +53,10 @@ class Processor public function __construct(AbstractSchema $schema) { - $this->executionContext = new ExecutionContext($schema); - $this->executionContext->setContainer(new Container()); + if (empty($this->executionContext)) { + $this->executionContext = new ExecutionContext($schema); + $this->executionContext->setContainer(new Container()); + } $this->resolveValidator = new ResolveValidator($this->executionContext); }
ExecutionContext replaced, preparing for contructor change
youshido-php_GraphQL
train
php
2593f45aa6ae05e250a56a6b73773b8768956cb2
diff --git a/lib/how_is/analyzer.rb b/lib/how_is/analyzer.rb index <HASH>..<HASH> 100644 --- a/lib/how_is/analyzer.rb +++ b/lib/how_is/analyzer.rb @@ -90,7 +90,7 @@ module HowIs timestamps = issues_or_pulls.map { |iop| Date.parse(iop['created_at']).strftime('%s').to_i } average_timestamp = timestamps.reduce(:+) / issues_or_pulls.length - Date.strptime(average_timestamp.to_s, '%s') + DateTime.strptime(average_timestamp.to_s, '%s') end # Given an Array of issues or pulls, return the average age of them. diff --git a/spec/how_is/analyzer_spec.rb b/spec/how_is/analyzer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/how_is/analyzer_spec.rb +++ b/spec/how_is/analyzer_spec.rb @@ -23,7 +23,7 @@ describe HowIs::Analyzer do context '#average_date_for' do it 'returns the average date for the provided issues or pulls' do actual = subject.average_date_for(fake_issues) - expected = Date.parse('2006-01-01') + expected = DateTime.parse('2006-01-01') expect(actual).to eq(expected) end
lol? switching to DateTime fixed it.
duckinator_inq
train
rb,rb
5ad3b5e0793042af8bf1d016a516835659c0b278
diff --git a/shouty/enums.py b/shouty/enums.py index <HASH>..<HASH> 100644 --- a/shouty/enums.py +++ b/shouty/enums.py @@ -12,8 +12,8 @@ class ShoutErr(IntEnum): CONNECTED = -7 UNCONNECTED = -8 UNSUPPORTED = -9 - BUSY = 10 - NOTLS = 11 + BUSY = -10 + NOTLS = -11 TLSBADCERT = -12 RETRY = -13
Fixes wrong sign of error code BUSY and NOTLS error codes are also negative: <URL>
edne_shouty
train
py
e48df7bfa487c38da354a9fcd3343f71ba979216
diff --git a/packages/heroku-pipelines/commands/pipelines/transfer.js b/packages/heroku-pipelines/commands/pipelines/transfer.js index <HASH>..<HASH> 100644 --- a/packages/heroku-pipelines/commands/pipelines/transfer.js +++ b/packages/heroku-pipelines/commands/pipelines/transfer.js @@ -45,7 +45,7 @@ module.exports = { ⬢ example-prod production ▸ This will transfer example and all of the listed apps to the me@example.com account - ▸ to proceed, type edamame or re-run this command with --confirm example + ▸ to proceed, type example or re-run this command with --confirm example > example Transferring example pipeline to the me@example.com account... done @@ -59,7 +59,7 @@ module.exports = { ⬢ example-prod production ▸ This will transfer example and all of the listed apps to the acme-widgets team - ▸ to proceed, type edamame or re-run this command with --confirm example + ▸ to proceed, type example or re-run this command with --confirm example > example Transferring example pipeline to the acme-widgets team... done`,
Merge pull request #<I> from jmahmood/patch-1 Typo in help text
heroku_cli
train
js
0c6b8d6722cc0e4a35b51d5104374b8cf9cc264e
diff --git a/dashboard/dashboard/pinpoint/models/job_bug_update.py b/dashboard/dashboard/pinpoint/models/job_bug_update.py index <HASH>..<HASH> 100644 --- a/dashboard/dashboard/pinpoint/models/job_bug_update.py +++ b/dashboard/dashboard/pinpoint/models/job_bug_update.py @@ -362,7 +362,7 @@ def _ComputePostMergeDetails(issue_tracker, commit_cache_key, cc_list): merge_details = update_bug_with_results.GetMergeIssueDetails( issue_tracker, commit_cache_key) if merge_details['id']: - cc_list = [] + cc_list = set() return merge_details, cc_list
Fix bug where cc_list should be a set. It's causing an error that doesn't let Pinpoint update Monorail issues. Bug: chromium:<I> Change-Id: I7afc7c<I>cd<I>a9d4cf<I>b<I>c2b<I> Reviewed-on: <URL>
catapult-project_catapult
train
py
6cd4358523867001ce6ecdbe15a77b94466c87e6
diff --git a/lib/fauxhai/runner/default.rb b/lib/fauxhai/runner/default.rb index <HASH>..<HASH> 100644 --- a/lib/fauxhai/runner/default.rb +++ b/lib/fauxhai/runner/default.rb @@ -45,7 +45,7 @@ module Fauxhai 'overrun' => 0, }, }, - 'eth0' => { + default_interface.to_s => { 'rx' => { 'bytes' => 0, 'packets' => 0, @@ -81,7 +81,16 @@ module Fauxhai end def default_interface - 'eth0' + case @system.data['platform_family'] + when 'mac_os_x' + 'en0' + when /bsd/ + 'em0' + when 'arch', 'fedora' + 'enp0s3' + else + 'eth0' + end end def domain
Fake the network interfaces a bit better Part of me thinks we should just slice and dice the real data that comes back, but that introduces a whole different set of problems. This at least gets us closer to reality on various platforms.
chefspec_fauxhai
train
rb
3a4de687dfab2c98ee227b958bf020063035661b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,9 @@ except ImportError: version_py = os.path.join(os.path.dirname(__file__), 'metaseq', 'version.py') version = open(version_py).read().split('=')[-1].strip().replace('"','') +requirements = os.path.join(os.path.dirname(__file__), 'requirements.txt') + + long_description = open('README.rst').read() setup( name='metaseq', @@ -23,10 +26,7 @@ setup( description="Integrative analysis of high-thoughput sequencing data", #long_description=long_description, license="MIT", - install_requires=['scipy', 'bx-python>=0.7.1', 'matplotlib>=1.3.1', - 'pysam>=0.7', 'pandas>=0.13.1', 'pycurl', - 'pybedtools>=0.6.4', 'gffutils>=0.8', 'urlgrabber', - 'argparse', 'PyYAML',], + install_requires=requirements, packages=find_packages(), package_data={ 'metaseq':[
setup.py reads requirements.txt
daler_metaseq
train
py
e8631174644bb75fdaf9b55b7bb3dd0511e3a57a
diff --git a/statement.go b/statement.go index <HASH>..<HASH> 100644 --- a/statement.go +++ b/statement.go @@ -148,11 +148,11 @@ func (converter) ConvertValue(v interface{}) (driver.Value, error) { case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32: return int64(rv.Uint()), nil case reflect.Uint64: - val := rv.Uint() - if val < (^uint64(0) >> 1) { - return int64(val), nil + u64 := rv.Uint() + if u64 >= 1<<63 { + return fmt.Sprintf("%d", rv.Uint()), nil } - return fmt.Sprintf("%d", rv.Uint()), nil + return int64(u64), nil case reflect.Float32, reflect.Float64: return rv.Float(), nil }
keep closer to go-source and avoid off-by-one messup
go-sql-driver_mysql
train
go
60629e280d24aa716246d20848e4523c5dec5cc5
diff --git a/O365/message.py b/O365/message.py index <HASH>..<HASH> 100644 --- a/O365/message.py +++ b/O365/message.py @@ -20,6 +20,8 @@ class Message( object ): fetchAttachments -- kicks off the process that downloads attachments. sendMessage -- take local variables and form them to send the message. markAsRead -- marks the analougs message in the cloud as read. + getID -- gets the ID of the message + getReceivedDate -- gets the datetime the message was recieved getSender -- gets a dictionary with the sender's information. getSenderEmail -- gets the email address of the sender. getSenderName -- gets the name of the sender, if possible. @@ -123,7 +125,14 @@ class Message( object ): except: return False return True - + + def getID(self): + '''get the ID of the email.''' + return self.json['Id'] + + def getReceivedDate(self): + '''get the DateTime the email was received.''' + return self.json['DateTimeReceived'] def getSender(self): '''get all available information for the sender of the email.'''
Update message.py Added getID and getReceivedDate
O365_python-o365
train
py
f10088f957a4f4630d065934c34fc6b6ca4d8d49
diff --git a/pypipegzip/pypipegzip.py b/pypipegzip/pypipegzip.py index <HASH>..<HASH> 100644 --- a/pypipegzip/pypipegzip.py +++ b/pypipegzip/pypipegzip.py @@ -56,7 +56,8 @@ def open(filename, mode="rb", use_process=False, encoding='utf-8', newline=None) raise ValueError("please specify t or b in mode") else: if is_2(): - return gzip.open(filename, mode=mode, newline=newline) + # in python2 gzip.open does not have a 'newline' parameter... + return gzip.open(filename, mode=mode) else: return gzip.open(filename, encoding=encoding, mode=mode, newline=newline) if "w" in mode: diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import setuptools setuptools.setup( name='pypipegzip', - version='0.0.17', + version='0.0.18', description='faster read of gzip files using a pipe to zcat(1)', long_description='pypipegzip helps you read gzipped files faster by using a subprocess', url='https://veltzer.github.io/pypipegzip',
another gzip bug and version bump
veltzer_pypipegzip
train
py,py
dfae43da6a7c4a1addbc0b592408e68ac6292c66
diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index <HASH>..<HASH> 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -153,6 +153,8 @@ class UploadedFile extends File implements UploadedFileInterface */ public function move(string $targetPath, string $name = null, bool $overwrite = false) { + $targetPath = $this->setPath($targetPath); //set the target path + if ($this->hasMoved) { throw new FileException('The file has already been moved.'); @@ -183,6 +185,26 @@ class UploadedFile extends File implements UploadedFileInterface return true; } + /** + * create file target path if + * the set path does not exist + * @return string The path set or created. + */ + protected function setPath($path) + { + if (!is_dir($path)) + { + mkdir($path, 0777, true); + //create the index.html file + if (!file_exists($path.'index.html')) + { + $file = fopen($path.'index.html', 'x+'); + fclose($file); + } + } + return $path; + } + //-------------------------------------------------------------------- /**
Create file target path if it does not exist
codeigniter4_CodeIgniter4
train
php
c2132318cb15baafafd1f21561c8f280b38c0c17
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "path/filepath" "runtime" "sync" + "time" flag "github.com/dotcloud/docker/pkg/mflag" "github.com/tcnksm/go-gitconfig" @@ -78,6 +79,10 @@ func main() { func ghrMain() int { + // Use CPU efficiently + cpu := runtime.NumCPU() + runtime.GOMAXPROCS(cpu) + flag.Parse() if *flDebug { @@ -160,11 +165,17 @@ func ghrMain() int { return 1 } + fmt.Fprintf(os.Stderr, "Delete Tag %s \n", info.TagName) err = DeleteTag(info) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) return 1 } + + // executing delete tag has time lag + // So we need to wait for a while + // This is stupid implementation... + time.Sleep(3 * time.Second) info.ID = -1 } @@ -194,10 +205,6 @@ func ghrMain() int { *parallel = runtime.NumCPU() } - // Use CPU efficiently - cpu := runtime.NumCPU() - runtime.GOMAXPROCS(cpu) - var errorLock sync.Mutex var wg sync.WaitGroup errors := make([]string, 0)
time.sleep after deleting tag
tcnksm_ghr
train
go
f1e9048541cd42c1c5652d1645658ea82b310a5e
diff --git a/test/batch_notifier_test.py b/test/batch_notifier_test.py index <HASH>..<HASH> 100644 --- a/test/batch_notifier_test.py +++ b/test/batch_notifier_test.py @@ -496,7 +496,7 @@ class BatchNotifierTest(unittest.TestCase): ) def test_unicode_param_value_html(self): - self.email().format='html' + self.email().format = 'html' for batch_mode in ('all', 'unbatched_params'): self.send_email.reset_mock() bn = BatchNotifier(batch_mode=batch_mode) @@ -523,7 +523,7 @@ class BatchNotifierTest(unittest.TestCase): ) def test_unicode_param_name_html(self): - self.email().format='html' + self.email().format = 'html' for batch_mode in ('all', 'unbatched_params'): self.send_email.reset_mock() bn = BatchNotifier(batch_mode=batch_mode)
Fixes style issues in batch notifier
spotify_luigi
train
py
97b64ea845f2b9ba2d00cb2759dfe28e9f0ded13
diff --git a/tests/etl/test_buildbot.py b/tests/etl/test_buildbot.py index <HASH>..<HASH> 100644 --- a/tests/etl/test_buildbot.py +++ b/tests/etl/test_buildbot.py @@ -1185,8 +1185,7 @@ buildernames = [ 'job_symbol': 'b-m'}, 'platform': {'arch': 'x86_64', 'os': 'linux', - 'os_platform': 'linux64', - 'vm': True}}), + 'os_platform': 'linux64'}}), ('Ubuntu VM 12.04 x64 mozilla-central opt test media-youtube-tests', {'build_type': 'opt', 'job_type': 'unittest',
Bug <I> - Update test to take into account changes from bug <I> The PR's test run was green but yet failed once merged to master, because Travis had run the merge tests prior to bug <I> landing.
mozilla_treeherder
train
py
50d5c30ccbcf0b5116d427c311f9d36451ce00e5
diff --git a/lib/minder/version.rb b/lib/minder/version.rb index <HASH>..<HASH> 100644 --- a/lib/minder/version.rb +++ b/lib/minder/version.rb @@ -1,3 +1,3 @@ module Minder - VERSION = '0.2.2' + VERSION = '0.2.3' end
Bump patch version to <I>
tristil_minder
train
rb
5cc137b9e95edc684df8120b10eb2a0051529faf
diff --git a/app/models/profile.rb b/app/models/profile.rb index <HASH>..<HASH> 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -48,7 +48,7 @@ class Profile < ActiveRecord::Base end before_validation :set_role_and_agent, on: :create - before_save :set_expired_at + before_save :set_expired_at, :set_date_of_birth accepts_nested_attributes_for :user def set_role_and_agent
added set_date_of_birth to callback
next-l_enju_leaf
train
rb
996563f9729588660d5d32826c46b0d7169b1334
diff --git a/collector/filesystem_linux.go b/collector/filesystem_linux.go index <HASH>..<HASH> 100644 --- a/collector/filesystem_linux.go +++ b/collector/filesystem_linux.go @@ -33,7 +33,7 @@ import ( ) const ( - defMountPointsExcluded = "^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+)($|/)" + defMountPointsExcluded = "^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+|var/lib/containers/storage/.+)($|/)" defFSTypesExcluded = "^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$" )
filesystem_linux: exclude mounts under /var/lib/containers/storage analogous to the /var/lib/docker exclude added in <URL>
prometheus_node_exporter
train
go
cc93680122c0a4046c5b1f312f7ed500c3618d1f
diff --git a/src/Layout.php b/src/Layout.php index <HASH>..<HASH> 100644 --- a/src/Layout.php +++ b/src/Layout.php @@ -168,7 +168,7 @@ class Layout // Overloading render() function to inject the layout. public function render($template, $data = array()) { if(!is_null($this->layout) && $this->enabled === TRUE) { // Render the layout!! - $this->setLayoutData('content', parent::render($template, array_merge($this->layoutData, $data))); + $this->setLayoutData('content', parent::render($template, array_merge($this->layoutData, (array)$data))); $this->setLayoutData('js', $this->jsAssets->render()); $this->setLayoutData('css', $this->cssAssets->render()); $this->setLayoutData('title', $this->titleParts->render());
Update Layout.php: added typehinting conversion for required array
tylerjuniorcollege_slim-layout
train
php
6a1e6190ee4b97fd1c408fbd0a458cac4050da75
diff --git a/pysat/tests/instrument_test_class.py b/pysat/tests/instrument_test_class.py index <HASH>..<HASH> 100644 --- a/pysat/tests/instrument_test_class.py +++ b/pysat/tests/instrument_test_class.py @@ -203,7 +203,17 @@ class InstTestClass(): target = 'Fake Data to be cleared' inst.data = [target] start = inst._test_dates[inst.sat_id][inst.tag] - inst.load(date=start) + try: + inst.load(date=start) + except ValueError as verr: + # Check if instrument is failing due to strict time flag + if str(verr).find('Loaded data') > 0: + inst.strict_time_flag = False + inst.load(date=start) + else: + # If error message does not match, raise error anyway + raise(verr) + # Make sure fake data is cleared assert target not in inst.data # If cleaning not used, something should be in the file
TST: update tests to check for strict_time_flag failure
rstoneback_pysat
train
py
178aed0a5fe5cd46a943ef9ff4d70e9860847a30
diff --git a/cobra/io/sbml3.py b/cobra/io/sbml3.py index <HASH>..<HASH> 100644 --- a/cobra/io/sbml3.py +++ b/cobra/io/sbml3.py @@ -413,8 +413,13 @@ def model_to_xml(cobra_model, units=True): if units: param_attr["units"] = "mmol_per_gDW_per_hr" # the most common bounds are the minimum, maxmium, and 0 - min_value = min(cobra_model.reactions.list_attr("lower_bound")) - max_value = max(cobra_model.reactions.list_attr("upper_bound")) + if len(cobra_model.reactions) > 0: + min_value = min(cobra_model.reactions.list_attr("lower_bound")) + max_value = max(cobra_model.reactions.list_attr("upper_bound")) + else: + min_value = -1000 + max_value = 1000 + SubElement(parameter_list, "parameter", value=strnum(min_value), id="cobra_default_lb", sboTerm="SBO:0000626", **param_attr) SubElement(parameter_list, "parameter", value=strnum(max_value),
Fix SMBL export for empty model
opencobra_cobrapy
train
py
1057c093445aaa6fea2a11f7677acc2dcac68a82
diff --git a/lightadmin-demo/src/main/webapp/scripts/lightadmin.js b/lightadmin-demo/src/main/webapp/scripts/lightadmin.js index <HASH>..<HASH> 100644 --- a/lightadmin-demo/src/main/webapp/scripts/lightadmin.js +++ b/lightadmin-demo/src/main/webapp/scripts/lightadmin.js @@ -232,6 +232,7 @@ function loadDomainObject(form, restRepoUrl) { } } } + $.uniform.update(); } }); }
Fixed problem with updating dynamically populated Uniformed fields.
la-team_light-admin
train
js
5ccf7ed9b3be5e5c6911c49bfd6d031657dc194d
diff --git a/pkg/client/deployments.go b/pkg/client/deployments.go index <HASH>..<HASH> 100644 --- a/pkg/client/deployments.go +++ b/pkg/client/deployments.go @@ -121,6 +121,6 @@ func (c *Client) PostDeployment(res *common.Resource) error { } var out struct{} - _, err = c.Post("/deployments", data, &out) + _, err = c.Post("deployments", data, &out) return err }
fix(client): fix append deployments url Fixes issue when base url has a prefix
helm_helm
train
go
5d5ff04fd18e4df52dddbd927cd86cfef90bdd62
diff --git a/Utilities/Iterator/Iterators.php b/Utilities/Iterator/Iterators.php index <HASH>..<HASH> 100644 --- a/Utilities/Iterator/Iterators.php +++ b/Utilities/Iterator/Iterators.php @@ -27,7 +27,7 @@ class Iterators /** * Returns an iterator that cycles indefinitely over the elements of $iterator. * @param Iterator $iterator - * @return GeneratingIterator + * @return InfiniteIterator */ public static function cycle(Iterator $iterator) { @@ -128,7 +128,7 @@ class Iterators * Creates an iterator returning all but first $number elements of the given iterator. * @param Iterator $iterator * @param $number - * @return LimitIterator + * @return SkippingIterator */ public static function skip(Iterator $iterator, $number) {
Corrected PhpDoc type hints
letsdrink_ouzo-goodies
train
php
4ab7d4277547aacece1b7d5d8f92bf27a6e4719c
diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -706,9 +706,9 @@ class Container implements ArrayAccess, ContainerContract { */ protected function getContextualConcrete($abstract) { - if (isset($this->contextual[last($this->buildStack)][$abstract])) + if (isset($this->contextual[end($this->buildStack)][$abstract])) { - return $this->contextual[last($this->buildStack)][$abstract]; + return $this->contextual[end($this->buildStack)][$abstract]; } }
Remove the Illuminate\Support dependency for Container
laravel_framework
train
php
afb4518c2f23fc91186adb3bcde624c125862178
diff --git a/src/main/java/org/eobjects/datacleaner/output/datastore/DatastoreOutputUtils.java b/src/main/java/org/eobjects/datacleaner/output/datastore/DatastoreOutputUtils.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/eobjects/datacleaner/output/datastore/DatastoreOutputUtils.java +++ b/src/main/java/org/eobjects/datacleaner/output/datastore/DatastoreOutputUtils.java @@ -29,7 +29,7 @@ final class DatastoreOutputUtils { public static String safeName(String str) { // replaces whitespaces, commas and parentheses with underscore - str = str.replaceAll("[\\ \\,\\(\\)]+", "_"); + str = str.replaceAll("[\\ \\,\\(\\)\\.]+", "_"); return str; }
Minor bugfix: Don't include dots in datastore column names
datacleaner_DataCleaner
train
java
e00c5ada7f289255f12c7c851d0b74c3c5a95c1b
diff --git a/code/model/Order.php b/code/model/Order.php index <HASH>..<HASH> 100644 --- a/code/model/Order.php +++ b/code/model/Order.php @@ -1193,6 +1193,13 @@ class Order_EmailRecord extends DataObject { "Subject" => "Subject", "Result" => "Sent Succesfully" ); + public static $searchable_fields = array( + "From" => "PartialMatchFilter", + "To" => "PartialMatchFilter", + "Subject" => "PartialMatchFilter", + "Result" => true + ); + public static $singular_name = "Customer Email"; public static $plural_name = "Customer Emails"; //CRUD settings
added Order Email record for: backup purposes, detailed record and better understanding, possible legal requirements, etc...
silvershop_silvershop-core
train
php
b7536f4e6e60cd521f30084aa6f2f6416f735c88
diff --git a/Console/Command/ImportCategoriesCommand.php b/Console/Command/ImportCategoriesCommand.php index <HASH>..<HASH> 100644 --- a/Console/Command/ImportCategoriesCommand.php +++ b/Console/Command/ImportCategoriesCommand.php @@ -78,7 +78,7 @@ class ImportCategoriesCommand extends ShopwareCommand try { $queryType = $all ? QueryType::ALL : QueryType::CHANGED; - $this->connector->handle(Category::getType(), $queryType); + $this->connector->handle($queryType, Category::getType()); } catch (Exception $e) { $this->logger->error($e->getMessage()); } diff --git a/Console/Command/ImportManufacturersCommand.php b/Console/Command/ImportManufacturersCommand.php index <HASH>..<HASH> 100644 --- a/Console/Command/ImportManufacturersCommand.php +++ b/Console/Command/ImportManufacturersCommand.php @@ -78,7 +78,7 @@ class ImportManufacturersCommand extends ShopwareCommand try { $queryType = $all ? QueryType::ALL : QueryType::CHANGED; - $this->connector->handle(Manufacturer::getType(), $queryType); + $this->connector->handle($queryType, Manufacturer::getType()); } catch (Exception $e) { $this->logger->error($e->getMessage()); }
restructured the connector handle function header
plentymarkets_plentymarkets-shopware-connector
train
php,php
fa432a7fd60de7cb8ef5d5ab2196c915315c2ed0
diff --git a/src/main/java/org/takes/rs/RsWithHeaders.java b/src/main/java/org/takes/rs/RsWithHeaders.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/takes/rs/RsWithHeaders.java +++ b/src/main/java/org/takes/rs/RsWithHeaders.java @@ -57,7 +57,9 @@ public final class RsWithHeaders extends RsWrap { * @todo #160:DEV To implement the concatenation and * transformation with conjunction of Concat class * and Transform class to get rid of the use of List.add() - * in the anonymous Response class head() method. + * in the anonymous Response class head() method. That is, + * we are going to do something like this: + * return new Concat(res.head(), new Transform(headers, new Trim())) * @param res Original response * @param headers Headers */
Updated puzzle comments to have more comprehensive description.
yegor256_takes
train
java
3d2bb7dbea9d7ac0cc5664c378689d6e16ca9590
diff --git a/lib/async.js b/lib/async.js index <HASH>..<HASH> 100644 --- a/lib/async.js +++ b/lib/async.js @@ -20,13 +20,17 @@ // fact thathat we allow asynchronisity both in the condition and in the body. The function takes three parameters: // * A condition function, which takes a callback, whose only parameter is whether the condition was met or not. // * A body function, which takes a no-parameter callback. The callback should be invoked when the body of the loop has finished. - // * A done function, which takesno parameter, and will be invoked when the loop has finished. - root.while = function(obj) { + // * A done function, which takes no parameter, and will be invoked when the loop has finished. + root.while = function(obj, done) { if (obj.condition()) { - obj.body( function() { root.while(obj); }); + obj.body( function() { root.while(obj, done); }); } else { - obj.done(); + done(); } }; + + root.sleep = function(timeout, callback) { + setTimeout(callback, timeout); + } })(); \ No newline at end of file
Some more raw async features
splunk_splunk-sdk-javascript
train
js
1864683418052d1db1c76f956d590f17e11a7918
diff --git a/lib/Library/ClientFiles.js b/lib/Library/ClientFiles.js index <HASH>..<HASH> 100755 --- a/lib/Library/ClientFiles.js +++ b/lib/Library/ClientFiles.js @@ -18,7 +18,11 @@ ClientFiles.prototype.ensure = function () { return file.load(); } else { _this.renderer.debug('Creating missing file. [' + file.path + ']'); - return file.setValue('debug', defaults.client.debug()).save(); + return file + .setValue('libs', {}) + .setValue('themes', {}) + .setValue('debug', defaults.client.debug()) + .save(); } })) };
Client files default with lib and themes.
wsick_fayde-unify
train
js
8e5259f4e42b211e73d393b5745a23301e2ffac0
diff --git a/lib/guard/shell.rb b/lib/guard/shell.rb index <HASH>..<HASH> 100644 --- a/lib/guard/shell.rb +++ b/lib/guard/shell.rb @@ -18,7 +18,7 @@ module Guard end # Print the result of the command(s), if there are results to be printed. - def run_on_change(res) + def run_on_changes(res) puts res if res end
Changed method name run_on_change
hawx_guard-shell
train
rb
3ef79bbaf30c1a4c9729bc4e8712b21a31eb524b
diff --git a/caravel/assets/visualizations/nvd3_vis.js b/caravel/assets/visualizations/nvd3_vis.js index <HASH>..<HASH> 100644 --- a/caravel/assets/visualizations/nvd3_vis.js +++ b/caravel/assets/visualizations/nvd3_vis.js @@ -80,7 +80,7 @@ function nvd3Vis(slice) { case 'dist_bar': chart = nv.models.multiBarChart() - .showControls(false) //Allow user to switch between 'Grouped' and 'Stacked' mode. + .showControls(false) .reduceXTicks(reduceXTicks) .rotateLabels(45) .groupSpacing(0.1); //Distance between each group of bars. @@ -147,6 +147,7 @@ function nvd3Vis(slice) { chart.xScale(d3.time.scale.utc()); chart.xAxis .showMaxMin(false) + .showControls(false) .staggerLabels(true); break;
[quickfix] removing controls in Area chart to leave more room for the legend
apache_incubator-superset
train
js
d9fd76a6c5b382e1534404104dfaa907768e3182
diff --git a/logger.go b/logger.go index <HASH>..<HASH> 100644 --- a/logger.go +++ b/logger.go @@ -2,6 +2,7 @@ package tchannel import ( "fmt" + "time" ) // Copyright (c) 2015 Uber Technologies, Inc. @@ -56,10 +57,14 @@ var SimpleLogger = simpleLogger{} type simpleLogger struct{} +const ( + simpleLoggerStamp = "2006-01-02 15:04:05" +) + func (l simpleLogger) Errorf(msg string, args ...interface{}) { l.printfn("E", msg, args...) } func (l simpleLogger) Warnf(msg string, args ...interface{}) { l.printfn("W", msg, args...) } func (l simpleLogger) Infof(msg string, args ...interface{}) { l.printfn("I", msg, args...) } func (l simpleLogger) Debugf(msg string, args ...interface{}) { l.printfn("D", msg, args...) } func (l simpleLogger) printfn(prefix, msg string, args ...interface{}) { - fmt.Printf("%s %s\n", prefix, fmt.Sprintf(msg, args...)) + fmt.Printf("%s [%s] %s\n", time.Now().Format(simpleLoggerStamp), prefix, fmt.Sprintf(msg, args...)) }
Add timestamps to simple logger output
uber_tchannel-go
train
go
c29eb1510eae548882dbd11347463ace413037cd
diff --git a/Neos.Cache/Classes/Backend/RedisBackend.php b/Neos.Cache/Classes/Backend/RedisBackend.php index <HASH>..<HASH> 100644 --- a/Neos.Cache/Classes/Backend/RedisBackend.php +++ b/Neos.Cache/Classes/Backend/RedisBackend.php @@ -498,9 +498,17 @@ class RedisBackend extends IndependentAbstractBackend implements TaggableBackend $this->port = null; } $redis = new \Redis(); - if (!$redis->connect($this->hostname, $this->port)) { - throw new CacheException('Could not connect to Redis.', 1391972021); + + try { + $connected = false; + // keep the above! the line below leave the variable undefined if an error occurs. + $connected = $redis->connect($this->hostname, $this->port); + } finally { + if ($connected === false) { + throw new CacheException('Could not connect to Redis.', 1391972021); + } } + if ($this->password !== '') { if (!$redis->auth($this->password)) { throw new CacheException('Redis authentication failed.', 1502366200);
BUGFIX: Avoid "wrong" error if Redis is unavailable At least when running unit tests for the `MultiBackend` the `connect()` call raises an error that circumvents exception handling and breaks correct execution.
neos_flow-development-collection
train
php
ed9097ddd939b6849f17ac5eb87348e6bfc1bb8e
diff --git a/pypinfo/core.py b/pypinfo/core.py index <HASH>..<HASH> 100644 --- a/pypinfo/core.py +++ b/pypinfo/core.py @@ -1,3 +1,4 @@ +import datetime import json import os import re @@ -184,7 +185,9 @@ def format_json(rows, query_info, indent): item[headers[i]] = d[i] rows.append(item) - j = {'rows': rows, 'query': query_info} + now = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S') + + j = {'last_update': now, 'rows': rows, 'query': query_info} separators = (',', ':') if indent is None else None return json.dumps(j, indent=indent, separators=separators, sort_keys=True)
Add UTC timestamp to JSON (#<I>)
ofek_pypinfo
train
py
64c9c6a07728524937b5081a64e506fce51aa99e
diff --git a/test/lib/conceptql/utils_test.rb b/test/lib/conceptql/utils_test.rb index <HASH>..<HASH> 100644 --- a/test/lib/conceptql/utils_test.rb +++ b/test/lib/conceptql/utils_test.rb @@ -49,7 +49,7 @@ describe ConceptQL::Utils do describe ".timed_capture" do it "should timeout if process takes too long" do - assert_raises(Timeout::Error) { ConceptQL::Utils.timed_capture("sleep", "20", timeout: 1) } + assert_raises(Timeout::Error) { ConceptQL::Utils.timed_capture("ls", "-lR", "/", timeout: 1) } end it "should not timeout if process is fast enough" do
Travis: attempt to find better way to test timeout
outcomesinsights_conceptql
train
rb
103b1a3c6360e2acbab6984b751017d87847c9ca
diff --git a/pyt/cfg.py b/pyt/cfg.py index <HASH>..<HASH> 100644 --- a/pyt/cfg.py +++ b/pyt/cfg.py @@ -16,17 +16,10 @@ ControlFlowNode = collections.namedtuple('ControlFlowNode', 'test last_nodes') class Node(object): '''A Control Flow Graph node that contains a list of ingoing and outgoing nodes and a list of its variables.''' - def __init__(self, label, ast_type, *, ingoing=None, outgoing=None, variables=None): - if ingoing is None: - self.ingoing = list() - else: - self.ingoing = ingoing - - if outgoing is None: - self.outgoing = list() - else: - self.outgoing = outgoing - + def __init__(self, label, ast_type, *, variables=None): + self.ingoing = list() + self.outgoing = list() + if variables is None: self.variables = list() else:
Removed ingoing and outgoing as paramters in init
python-security_pyt
train
py
1672e63e887645fbaf002a653144b2875d72c748
diff --git a/glances/outputs/static/js/services/plugins/glances_folders.js b/glances/outputs/static/js/services/plugins/glances_folders.js index <HASH>..<HASH> 100644 --- a/glances/outputs/static/js/services/plugins/glances_folders.js +++ b/glances/outputs/static/js/services/plugins/glances_folders.js @@ -23,6 +23,10 @@ glancesApp.service('GlancesPluginFolders', function() { this.getDecoration = function(folder) { + if (!Number.isInteger(folder.size)) { + return; + } + if (folder.critical !== null && folder.size > (folder.critical * 1000000)) { return 'critical'; } else if (folder.warning !== null && folder.size > (folder.warning * 1000000)) {
[Web UI] fix folder plugin decoration issue for exclamation/question mark
nicolargo_glances
train
js
b60a2ffc69abca7e4a7a0528279cbff5ab82c1d4
diff --git a/Classes/Helmich/EventBroker/Broker/Broker.php b/Classes/Helmich/EventBroker/Broker/Broker.php index <HASH>..<HASH> 100644 --- a/Classes/Helmich/EventBroker/Broker/Broker.php +++ b/Classes/Helmich/EventBroker/Broker/Broker.php @@ -53,7 +53,7 @@ class Broker implements BrokerInterface /** - * @var array + * @var \SplQueue */ private $queue = []; @@ -69,6 +69,8 @@ class Broker implements BrokerInterface public function initializeObject() { + $this->queue = new \SplQueue(); + $this->synchronousEventMap = $this->cache->get('DispatcherConfiguration_Synchronous'); $this->asynchronousEventMap = $this->cache->get('DispatcherConfiguration_Asynchronous'); @@ -91,9 +93,9 @@ class Broker implements BrokerInterface */ public function queueEvent($event) { - $this->queue[] = $event; - $class = get_class($event); + $this->queue->enqueue($event); + $class = get_class($event); foreach ($this->synchronousEventMap->getListenersForEvent($class) as $listener) { list($listenerClass, $method) = $listener; @@ -112,6 +114,8 @@ class Broker implements BrokerInterface */ public function flush() { + $this->queue->setIteratorMode(\SplQueue::IT_MODE_DELETE); + foreach ($this->queue as $event) { $class = get_class($event);
Use SplQueue class for queuing.
martin-helmich_flow-eventbroker
train
php
d7390ea2616f2f62af19c8ee891dd7a037265c2a
diff --git a/openquake/calculators/tests/classical_test.py b/openquake/calculators/tests/classical_test.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/tests/classical_test.py +++ b/openquake/calculators/tests/classical_test.py @@ -440,5 +440,4 @@ hazard_uhs-mean.csv @attr('qa', 'hazard', 'classical') def test_case_30(self): # point on the international data line - raise unittest.SkipTest self.assert_curves_ok(['hazard_curve-PGA.csv'], case_30.__file__)
Unskipped test [skip hazardlib] Former-commit-id: d<I>b<I>af7ab<I>f1c4a3e<I>ecf5fd3ad [formerly <I>a9bb<I>b5fb<I>e3ea9b1f<I>a<I>c5a7] Former-commit-id: <I>a<I>ef<I>eb<I>d
gem_oq-engine
train
py
0cc9a1b16c9e95c86c92e52a8a2d2b479a887134
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,7 +4,6 @@ require 'coveralls' Coveralls.wear! require 'minitest/autorun' -require 'minitest/hell' require 'halibut'
Removes minitest/hell temporarily to avoid broken builds
locks_halibut
train
rb
63cea83a6b016bb13e85c8f8ec0cb7aede628041
diff --git a/src/SleepingOwl/Admin/ColumnFilters/Select.php b/src/SleepingOwl/Admin/ColumnFilters/Select.php index <HASH>..<HASH> 100644 --- a/src/SleepingOwl/Admin/ColumnFilters/Select.php +++ b/src/SleepingOwl/Admin/ColumnFilters/Select.php @@ -92,9 +92,10 @@ class Select extends BaseColumnFilter public function apply($repository, $column, $query, $search, $fullSearch, $operator = 'like') { - if (empty($search)) return; + #if (empty($search)) return; + if ($search === '') return; - if ($operator == 'like') + if ($operator == 'like') { $search = '%' . $search . '%'; } @@ -115,4 +116,4 @@ class Select extends BaseColumnFilter } } -} \ No newline at end of file +}
fix: column select filter check for empty value
LaravelRUS_SleepingOwlAdmin
train
php
464e0d0997762e69be606f8afd7c796d97d24072
diff --git a/flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/utils/SavepointTestBase.java b/flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/utils/SavepointTestBase.java index <HASH>..<HASH> 100644 --- a/flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/utils/SavepointTestBase.java +++ b/flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/utils/SavepointTestBase.java @@ -30,6 +30,8 @@ import org.apache.flink.streaming.api.functions.source.SourceFunction; import org.apache.flink.test.util.AbstractTestBase; import org.apache.flink.util.AbstractID; +import org.junit.Ignore; + import java.io.IOException; import java.util.Arrays; import java.util.Collection; @@ -38,6 +40,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; /** A test base that includes utilities for taking a savepoint. */ +@Ignore public abstract class SavepointTestBase extends AbstractTestBase { public <T extends WaitingFunction> String takeSavepoint(
[hotfix] Disable broken savepoint tests tracked in FLINK-<I>
apache_flink
train
java
8c999b300803228deca0397b54ea43cc7b5f76bb
diff --git a/tpot/_version.py b/tpot/_version.py index <HASH>..<HASH> 100644 --- a/tpot/_version.py +++ b/tpot/_version.py @@ -18,4 +18,4 @@ with the TPOT library. If not, see http://www.gnu.org/licenses/. """ -__version__ = '0.5.0' +__version__ = '0.5.1'
Increment version for minor bug fix release
EpistasisLab_tpot
train
py
9840ed78d293541b551314d527b6c136901327f7
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,9 +14,7 @@ gulp.task('docs', function() { }); gulp.task('sass', function() { - return rubySass('./motion-ui.scss', { - outputStyle: 'expanded' - }) + return rubySass('./motion-ui.scss') .on('error', function (err) { console.error('Error:', err.message); })
Remove settings object from gulp-ruby-sass call
zurb_motion-ui
train
js
0930281d1a63b633f2e7bf90912c03a7b4f162e7
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,8 +20,8 @@ var cleanCSS = require( 'gulp-clean-css' ); var sass = require('gulp-sass'); // Files/Paths -var js_src = './assets/javascript'; -var js_dest = './dist/assets/javascript'; +var js_src = './assets/scripts'; +var js_dest = './dist/assets/scripts'; var js_files = [ js_src + '/**/*.js' ]; var sass_src = './assets/styles'; var sass_file = [ sass_src + '/jentil.scss' ];
fixed: corrected scripts path in gulpfile
GrottoPress_jentil
train
js
720889bfaff74ead9a42869b494656bec09003f3
diff --git a/tests/browser.js b/tests/browser.js index <HASH>..<HASH> 100644 --- a/tests/browser.js +++ b/tests/browser.js @@ -443,7 +443,7 @@ describe('Nested routers', function() { ), Router.CaptureClicks({gotoURL: this.gotoURL}, a({ref: 'anchor', href: '/__zuul/nested/page'}), - a({ref: 'anchorNestedRoot', href: '/__zuul/nested'}), + a({ref: 'anchorNestedRoot', href: '/__zuul/nested/'}), a({ref: 'anchorUnhandled', href: '/__zuul/nested/404'}) ) );
Fix test case for CaptureClicks
STRML_react-router-component
train
js
d796751120de8d96c3522b1975400df13a147eec
diff --git a/core-bundle/src/Resources/contao/library/Contao/File.php b/core-bundle/src/Resources/contao/library/Contao/File.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/File.php +++ b/core-bundle/src/Resources/contao/library/Contao/File.php @@ -300,6 +300,11 @@ class File extends \System */ public function truncate() { + if (is_resource($this->resFile)) + { + ftruncate($this->resFile, 0); + } + return $this->write(''); }
[Core] Also truncate opened files in `File::truncate()` (see #<I>)
contao_contao
train
php
0391c57a375b6221a0628ec879a25fa5a6c7662a
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -828,9 +828,11 @@ func syncthingMain(runtimeOptions RuntimeOptions) { pprof.StartCPUProfile(f) } + myDev, _ := cfg.Device(myID) + l.Infof(`My name is "%v"`, myDev.Name) for _, device := range cfg.Devices() { - if len(device.Name) > 0 { - l.Infof("Device %s is %q at %v", device.DeviceID, device.Name, device.Addresses) + if device.DeviceID != myID { + l.Infof(`Device %s is "%v" at %v`, device.DeviceID, device.Name, device.Addresses) } }
cmd/syncthing: Improve logged device information on startup (#<I>)
syncthing_syncthing
train
go
f2ff10a364290007e1445bb05bb6680d0d7971a7
diff --git a/src/game/rooms.js b/src/game/rooms.js index <HASH>..<HASH> 100644 --- a/src/game/rooms.js +++ b/src/game/rooms.js @@ -1471,12 +1471,12 @@ exports.makePos = function(_register) { return room.createFlag(this, name, color, secondaryColor); }); - RoomPosition.prototype.createConstructionSite = register.wrapFn(function(structureType) { + RoomPosition.prototype.createConstructionSite = register.wrapFn(function(structureType, name) { var room = register.rooms[this.roomName]; if(!room) { throw new Error(`Could not access room ${this.roomName}`); } - return room.createConstructionSite(this, structureType); + return room.createConstructionSite(this.x, this.y, structureType, name); }); Object.defineProperty(globals, 'RoomPosition', {enumerable: true, value: RoomPosition});
Fixing position.createConstructionSite name arg (#<I>) position.createConstructionSite is not correctly passing the name variable to room.createConstructionSite.
screeps_engine
train
js
4615f0ec08f3c1e6b5414346d86d4e4432950cb6
diff --git a/s4/clients/local.py b/s4/clients/local.py index <HASH>..<HASH> 100644 --- a/s4/clients/local.py +++ b/s4/clients/local.py @@ -148,7 +148,7 @@ class LocalSyncClient(SyncClient): return {} content_type = magic.from_file(index_path, mime=True) - if content_type == "text/plain": + if content_type in ("application/json", "text/plain"): logger.debug("Detected plaintext encoding for reading index") method = open elif content_type in ("application/gzip", "application/x-gzip"): diff --git a/s4/clients/s3.py b/s4/clients/s3.py index <HASH>..<HASH> 100644 --- a/s4/clients/s3.py +++ b/s4/clients/s3.py @@ -132,7 +132,7 @@ class S3SyncClient(SyncClient): body = resp["Body"].read() content_type = magic.from_buffer(body, mime=True) - if content_type == "text/plain": + if content_type in ("application/json", "text/plain"): logger.debug("Detected plain text encoding for index") return json.loads(body.decode("utf-8"))
Allow application/json as accepted content_type
MichaelAquilina_S4
train
py,py
cc9b2c1f537199b1feef0993d23d79eff4756c3b
diff --git a/lib/mongoid/config.rb b/lib/mongoid/config.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/config.rb +++ b/lib/mongoid/config.rb @@ -166,7 +166,7 @@ module Mongoid #:nodoc _master(settings) _slaves(settings) settings.except("database", "slaves").each_pair do |name, value| - send("#{name}=", value) if respond_to?(name) + send("#{name}=", value) if respond_to?("#{name}=") end end
Fix for Mongoid::Config#from_hash Needs to check the respond_to on the writer instead of the reader before assigning.
mongodb_mongoid
train
rb
b95bef9046c3a2c48894b3deab543116fd6c28b9
diff --git a/jml-es6.js b/jml-es6.js index <HASH>..<HASH> 100644 --- a/jml-es6.js +++ b/jml-es6.js @@ -354,10 +354,27 @@ const jml = function jml (...args) { nodes[nodes.length] = _optsOrUndefinedJML(opts, attVal); break; } case '$shadow': { + const {content, template, open, closed} = attVal; const shadowRoot = elem.attachShadow({ - mode: attVal[0] === 'open' ? 'open' : 'closed' + mode: closed ? 'closed' : 'open' }); - jml(...attVal[1], shadowRoot); + if (content) { + if (Array.isArray(content)) { + jml(...content, shadowRoot); + } else { + jml(content, shadowRoot); + } + } else if (template) { + jml( + (typeof template === 'string' + ? document.querySelector(template) + : template + ).content.cloneNode(true), + shadowRoot + ); + } else { + jml(...(open || closed), shadowRoot); + } break; } case '$symbol': { const [symbol, func] = attVal;
- Change format of `$shadow` (still untested, undocumented)
brettz9_jamilih
train
js
bc693355275e7099be3e0fd38b0125220d750498
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,8 @@ setuptools.setup( 'boto', 'argparse', 'requests', - 'pytz' + 'pytz', + 'PyJWT' ], include_package_data=True, zip_safe=False,
add PyJWT to setup requirements
alerta_alerta
train
py
31c94ec1840a71316b65206cf6a55b6b961fcd14
diff --git a/telethon/client/telegrambaseclient.py b/telethon/client/telegrambaseclient.py index <HASH>..<HASH> 100644 --- a/telethon/client/telegrambaseclient.py +++ b/telethon/client/telegrambaseclient.py @@ -196,6 +196,7 @@ class TelegramBaseClient(abc.ABC): # Some further state for subclasses self._event_builders = [] self._events_pending_resolve = [] + self._event_resolve_lock = asyncio.Lock() # Default parse mode self._parse_mode = markdown diff --git a/telethon/client/updates.py b/telethon/client/updates.py index <HASH>..<HASH> 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -159,9 +159,14 @@ class UpdateMethods(UserMethods): async def _dispatch_update(self, update): if self._events_pending_resolve: - # TODO Add lock not to resolve them twice - for event in self._events_pending_resolve: - await event.resolve(self) + if self._event_resolve_lock.locked(): + async with self._event_resolve_lock: + pass + else: + async with self._event_resolve_lock: + for event in self._events_pending_resolve: + await event.resolve(self) + self._events_pending_resolve.clear() for builder, callback in self._event_builders:
Add a lock for resolving events
LonamiWebs_Telethon
train
py,py
9e3fe79739bb02e78ce97052bd9c9f9b5efa65a1
diff --git a/client/lib/cart-values/cart-items.js b/client/lib/cart-values/cart-items.js index <HASH>..<HASH> 100644 --- a/client/lib/cart-values/cart-items.js +++ b/client/lib/cart-values/cart-items.js @@ -722,7 +722,7 @@ export function needsExplicitAlternateEmailForGSuite( cart, contactDetails ) { export function hasInvalidAlternateEmailDomain( cart, contactDetails ) { return some( cart.products, - isSameDomainAsProductMeta( getDomainPartFromEmail( contactDetails.email ) ) + isSameDomainAsProductMeta( getDomainPartFromEmail( contactDetails.alternateEmail ) ) ); }
Update: fixes a scenario where an email that does not pass validation is being compared to itself. (#<I>) - Related to current change: #<I>
Automattic_wp-calypso
train
js
6ef05187fd13dac6b1d3074b98fbb7cf6d83f875
diff --git a/hazelcast/src/main/java/com/hazelcast/map/impl/eviction/EvictorImpl.java b/hazelcast/src/main/java/com/hazelcast/map/impl/eviction/EvictorImpl.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/map/impl/eviction/EvictorImpl.java +++ b/hazelcast/src/main/java/com/hazelcast/map/impl/eviction/EvictorImpl.java @@ -105,7 +105,6 @@ public class EvictorImpl implements Evictor { recordStore.evict(key, backup); if (!backup) { - mapServiceContext.interceptAfterRemove(mapName, value); boolean expired = recordStore.isExpired(record, now, false); recordStore.doPostEvictionOperations(key, value, expired); }
Removed left-over interceptor call because it is already handled by evict method
hazelcast_hazelcast
train
java
38b8d3e7f1107c5d8ead53ecaebdaacf4344e505
diff --git a/lib/accesslib.php b/lib/accesslib.php index <HASH>..<HASH> 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -3606,7 +3606,7 @@ function get_default_enrol_roles(context $context, $addroleid = null) { LEFT JOIN {role_context_levels} rcl ON (rcl.roleid = r.id AND rcl.contextlevel = :contextlevel) LEFT JOIN {role_names} rn ON (rn.contextid = :coursecontext AND rn.roleid = r.id) WHERE rcl.id IS NOT NULL $addrole - ORDER BY sortorder DESC"; + ORDER BY r.sortorder"; $roles = $DB->get_records_sql($sql, $params);
MDL-<I> core_enrol: remove desc and fix alias from ordering
moodle_moodle
train
php
2d41e92596cbf5b65f93be7cc53a8c4840b354af
diff --git a/pkg/policy/rule.go b/pkg/policy/rule.go index <HASH>..<HASH> 100644 --- a/pkg/policy/rule.go +++ b/pkg/policy/rule.go @@ -258,12 +258,10 @@ func (r *rule) resolveCIDRPolicy(ctx *SearchContext, state *traceState, result * allCIDRs = append(allCIDRs, egressRule.ToCIDR...) allCIDRs = append(allCIDRs, api.ComputeResultantCIDRSet(egressRule.ToCIDRSet)...) - // CIDR + L4 rules are handled via mergeL4Egress(), - // skip them here. - if len(allCIDRs) > 0 && len(egressRule.ToPorts) > 0 { - continue - } - + // Unlike the Ingress policy which only counts L3 policy in + // this function, we count the CIDR+L4 policy in the + // desired egress CIDR policy here as well. This ensures + // proper computation of IPcache prefix lengths. if cnt := mergeCIDR(ctx, "Egress", allCIDRs, r.Labels, &result.Egress); cnt > 0 { found += cnt }
policy: Express egress CIDRs in endpoint model An upcoming commit will make use of the endpoint's L3Policy egress map to determine which prefix lengths are necessary for generating IPcache LPM mappings on older Linux kernels. This ensures that the relevant entries are propagated into this structure for this use. Over time, the Ingress CIDR L3Policy should do the same (see GH #<I>).
cilium_cilium
train
go
b2ae917fef0c1cd678de4350f748e978e866599b
diff --git a/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java b/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java index <HASH>..<HASH> 100644 --- a/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java +++ b/sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java @@ -280,11 +280,11 @@ class EditableWidget implements Widget { @WidgetPropertySet(key = "set1", value = { @WidgetProperty(key = "foo", optional = false), - @WidgetProperty(key = "bar", optional = false), + @WidgetProperty(key = "bar", optional = false) }), @WidgetPropertySet(key = "set2", value = { - @WidgetProperty(key = "qix", optional = false), + @WidgetProperty(key = "qix", optional = false) })}, value = { @WidgetProperty(key = "fizz", optional = false)
Fix compilation with Java <I>
SonarSource_sonarqube
train
java
19754ae5af0c729af7a9a8a99c7881379bfd4c96
diff --git a/src/js/base/module/Codeview.js b/src/js/base/module/Codeview.js index <HASH>..<HASH> 100644 --- a/src/js/base/module/Codeview.js +++ b/src/js/base/module/Codeview.js @@ -46,6 +46,7 @@ define([ } else { this.activate(); } + context.triggerEvent('codeview.toggled'); }; /** diff --git a/src/js/base/module/Placeholder.js b/src/js/base/module/Placeholder.js index <HASH>..<HASH> 100644 --- a/src/js/base/module/Placeholder.js +++ b/src/js/base/module/Placeholder.js @@ -7,6 +7,9 @@ define(function () { this.events = { 'summernote.init summernote.change': function () { self.update(); + }, + 'summernote.codeview.toggled': function () { + self.update(); } }; @@ -26,8 +29,8 @@ define(function () { }; this.update = function () { - var isEmpty = context.invoke('editor.isEmpty'); - this.$placeholder.toggle(isEmpty); + var isShow = !context.invoke('codeview.isActivated') && context.invoke('editor.isEmpty'); + this.$placeholder.toggle(isShow); }; };
Fixed a but that placeholder still appears on codeview.
summernote_summernote
train
js,js