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
0e4a9812357b762784cebd2e0853fd60c88c1173
diff --git a/py/selenium/webdriver/firefox/firefox_profile.py b/py/selenium/webdriver/firefox/firefox_profile.py index <HASH>..<HASH> 100644 --- a/py/selenium/webdriver/firefox/firefox_profile.py +++ b/py/selenium/webdriver/firefox/firefox_profile.py @@ -357,6 +357,11 @@ class FirefoxProfile(object): entry = node.nodeName.replace(em, "") if entry in details.keys(): details.update({entry: get_text(node)}) + if details.get('id') is None: + for i in range(description.attributes.length): + attribute = description.attributes.item(i) + if attribute.name == em + 'id': + details.update({'id': attribute.value}) except Exception as e: raise AddonFormatError(str(e), sys.exc_info()[2])
when adding a firefox extension, check for the id in the attribute too Fixes Issue #<I>
SeleniumHQ_selenium
train
py
5d79d0dbcbd949b64ccc608cd7501094ffd58e31
diff --git a/packages/eslint-config-udemy-website/index.js b/packages/eslint-config-udemy-website/index.js index <HASH>..<HASH> 100644 --- a/packages/eslint-config-udemy-website/index.js +++ b/packages/eslint-config-udemy-website/index.js @@ -21,9 +21,10 @@ module.exports = { '^(?:_?[a-z0-9\\-]+', // allows underscore start and any lowercase filename '(?:\\.(?:', // any dot must be: 'ng-(?:constant|controller|directive|factory|filter|provider|service)', // an Angular file - '|videojs-component', // or a videojs-compenent + '|videojs-component', // or a videojs-component '|react-(?:isocomponent|component|proptypes)', // or a React file - '|mobx-(?:model|store)))?', // or a Mobx file + '|mobx-(?:model|store)', // or a Mobx file + '))?', '(?:\\.spec)?)$', // allows group to be a spec file ].join(''), '|^\\.eslintrc$', // files named .eslintrc.js
fix typo in comment and breakout line closing dot group
udemy_js-tooling
train
js
ca512cc6e06ad0bfc72904f464cdf076ad38c04a
diff --git a/lib/fluentd.js b/lib/fluentd.js index <HASH>..<HASH> 100644 --- a/lib/fluentd.js +++ b/lib/fluentd.js @@ -28,7 +28,7 @@ client.close(); }); - setInterval(send, config.fluentd.sendInterval || 1000); + setInterval(send, config.fluentd.sendInterval || 1000).unref(); } function send() {
implement fluentd send buffering - add unref to interval
pipedrive_kardia
train
js
f5a6ac568f684e6a6981931f2b9e2f0a03e6a846
diff --git a/tests/labsuite/protocol/test_protocol.py b/tests/labsuite/protocol/test_protocol.py index <HASH>..<HASH> 100644 --- a/tests/labsuite/protocol/test_protocol.py +++ b/tests/labsuite/protocol/test_protocol.py @@ -223,7 +223,7 @@ class ProtocolTest(unittest.TestCase): {'a': 0} ] self.assertEqual(expected, output_log.movements) - self.assertEqual([0, 50, 100], prog_out) + self.assertEqual([(0, 2), (1, 2), (2, 2)], prog_out) def test_find_instrument_by_volume(self): self.protocol.add_instrument('A', 'p10')
Test Fix: Protocol.run returns (current, total) tuples. I really need to stop being like, "Hey, check out how cool this thing I'm about to commit is," and then tweaking it before pushing without running tests...
Opentrons_opentrons
train
py
e3ec51fc0f54c151d91fb99b61f275e4dd28812e
diff --git a/src/Trigger.php b/src/Trigger.php index <HASH>..<HASH> 100644 --- a/src/Trigger.php +++ b/src/Trigger.php @@ -66,6 +66,11 @@ class Trigger { public function fire():bool { $fired = false; + if(empty($this->matches)) { + $this->callCallbacks(); + return true; + } + foreach($this->matches as $key => $matchList) { if($this->input->has($key)) { if(empty($matchList)
Call callbacks when there are empty matches
PhpGt_Input
train
php
4583efb41bed2dcd73b4feb69b8c41734ea2c2d1
diff --git a/figtree.go b/figtree.go index <HASH>..<HASH> 100644 --- a/figtree.go +++ b/figtree.go @@ -420,7 +420,7 @@ func (m *merger) mergeStructs(ov, nv reflect.Value) { ovField := ov.FieldByName(nvStructField.Name) nvField := nv.Field(i) - if (isEmpty(ovField) || isDefault(ovField) || m.mustOverwrite(fieldName)) && !isEmpty(nvField) && !isSame(ovField, nvField) { + if (isEmpty(ovField) || isDefault(ovField) || m.mustOverwrite(fieldName)) && !isEmpty(nvField) && !isSame(ovField, nvField) && nvField.Type().AssignableTo(ovField.Type()) { log.Debugf("Setting %s to %#v", nv.Type().Field(i).Name, nvField.Interface()) ovField.Set(nvField) } else {
only do direct assingment if type is assignable
coryb_figtree
train
go
265c77b6bbd3d97d4603be639a46b45aa6279c95
diff --git a/nuclai/__init__.py b/nuclai/__init__.py index <HASH>..<HASH> 100644 --- a/nuclai/__init__.py +++ b/nuclai/__init__.py @@ -3,6 +3,11 @@ __name__ = 'nuclai' __author__ = 'alexjc' __version__ = '0.1' +# Check version numbers. +import sys +ver = sys.version_info +assert ver.major == 3 and ver.minor >= 4, "Unsupported Python version." + # Use colored console output. try: import colorama; colorama.init(); del colorama @@ -10,7 +15,6 @@ except ImportError: pass # Call the main entry point. -import sys from .main import main def run():
Minimum version check, the rest of the code won't work anyway.
aigamedev_nuclai-installer
train
py
dc059b5cc82153646141a00a13c7efa77347438f
diff --git a/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java b/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java index <HASH>..<HASH> 100644 --- a/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java +++ b/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java @@ -261,7 +261,6 @@ public class DefaultBeanDescriptor implements BeanDescriptor private void setCommonProperties(DefaultPropertyDescriptor desc, Map<Class, Annotation> annotations) { - desc.setMandatory(annotations.get(PropertyMandatory.class) != null); desc.setDeprecated(annotations.get(Deprecated.class) != null); desc.setAdvanced(annotations.get(PropertyAdvanced.class) != null); @@ -287,7 +286,6 @@ public class DefaultBeanDescriptor implements BeanDescriptor group.setFeature(parameterFeature.value()); } - PropertyDisplayType displayTypeAnnotation = (PropertyDisplayType) annotations.get(PropertyDisplayType.class); Type displayType; if (displayTypeAnnotation != null && displayTypeAnnotation.value().length > 0) {
[Misc] Removed extra new lines
xwiki_xwiki-commons
train
java
222676057dfa90bb370c78fda87d0cb8f6bc116d
diff --git a/templates/default/fulldoc/html/setup.rb b/templates/default/fulldoc/html/setup.rb index <HASH>..<HASH> 100644 --- a/templates/default/fulldoc/html/setup.rb +++ b/templates/default/fulldoc/html/setup.rb @@ -56,7 +56,7 @@ def class_list(root = Registry.root, tree = TreeContext.new) include_namespace = YARD::MRuby::CodeObjects::HEADERS_ROOT root.instance_eval { children.delete include_namespace } - out = super(root) + out = super(root, tree) root.instance_eval { children.push include_namespace } out end
Doh, forgot to pass the tree arg to super.
sagmor_yard-mruby
train
rb
ab066b125281ecebcbd68d3723b9a40ff744c67e
diff --git a/quickbooks/objects/paymentmethod.py b/quickbooks/objects/paymentmethod.py index <HASH>..<HASH> 100644 --- a/quickbooks/objects/paymentmethod.py +++ b/quickbooks/objects/paymentmethod.py @@ -29,3 +29,6 @@ class PaymentMethod(QuickbooksManagedObject, QuickbooksTransactionEntity): ref.name = self.Name ref.type = self.qbo_object_name ref.value = self.Id + + return ref + diff --git a/tests/unit/objects/test_paymentmethod.py b/tests/unit/objects/test_paymentmethod.py index <HASH>..<HASH> 100644 --- a/tests/unit/objects/test_paymentmethod.py +++ b/tests/unit/objects/test_paymentmethod.py @@ -17,3 +17,14 @@ class PaymentMethodTests(unittest.TestCase): result = client.isvalid_object_name(obj.qbo_object_name) self.assertTrue(result) + + def test_to_ref(self): + obj = PaymentMethod() + obj.Name = "test" + obj.Id = 12 + + ref = obj.to_ref() + + self.assertEquals(ref.name, "test") + self.assertEquals(ref.type, "PaymentMethod") + self.assertEquals(ref.value, 12)
Fixed issue with PaymentMethod to_ref method.
sidecars_python-quickbooks
train
py,py
c493e1e97cbd0cb15d8fa94d1755a98b468bc734
diff --git a/src/Monga/Query/Find.php b/src/Monga/Query/Find.php index <HASH>..<HASH> 100644 --- a/src/Monga/Query/Find.php +++ b/src/Monga/Query/Find.php @@ -40,6 +40,32 @@ class Find extends Where protected $fields = array(); /** + * Set the result limit + * + * @param integer $amount limit + * @return object $this + */ + public function limit($amount) + { + $this->limit = $amount; + + return $this; + } + + /** + * Set the amount to skip in the result. + * + * @param integer $amount skip + * @return object $this + */ + public function skip($amount) + { + $this->skip = $amount; + + return $this; + } + + /** * Orders a collection * * @param string field field to order by diff --git a/src/Monga/Query/Where.php b/src/Monga/Query/Where.php index <HASH>..<HASH> 100644 --- a/src/Monga/Query/Where.php +++ b/src/Monga/Query/Where.php @@ -105,7 +105,6 @@ class Where extends Builder $isNested = true; } - // This is the result of an empty closure. if (empty($statement)) { return $this;
Re-added skip/limit functions in the right place.
thephpleague_monga
train
php,php
e68e1b1ea16dec21e81d05dd01ba57bd5b3924a7
diff --git a/gbdxtools/images/meta.py b/gbdxtools/images/meta.py index <HASH>..<HASH> 100644 --- a/gbdxtools/images/meta.py +++ b/gbdxtools/images/meta.py @@ -1,6 +1,5 @@ from __future__ import print_function import abc -import six import types import os import random @@ -118,7 +117,7 @@ class DaskImage(da.Array): dsk1, deps1 = optimize.cull(dsk, keys) dsk1["load_urls"] = (load_urls, [dsk1[key] for key in dsk1.keys() if isinstance(key[0], str) and key[0].startswith('image')]) dsk2 = {} - for key, val in six.iteritems(dsk1): + for key, val in dsk1.items(): if isinstance(key, tuple) and key[0].startswith('image'): name, z, x, y = key dsk2[key] = (operator.getitem, 'load_urls', (z, x, y))
not using six for itemitems, just items
DigitalGlobe_gbdxtools
train
py
145089335c27f40d71a88bc4385d28430130d468
diff --git a/Swat/SwatUI.php b/Swat/SwatUI.php index <HASH>..<HASH> 100644 --- a/Swat/SwatUI.php +++ b/Swat/SwatUI.php @@ -80,9 +80,15 @@ class SwatUI extends SwatObject * @param SwatContainer $container an optional reference to a container * object that will be the root element of * the widget tree. + * + * @throws SwatException */ public function __construct($container = null) { + if (!extension_loaded('xml')) + throw new SwatException('SwatUI requires the xml php extension.'); + + if ($container !== null && $container instanceof SwatContainer) $this->root = $container; else
Throw exception if xml extension is not loaded. svn commit r<I>
silverorange_swat
train
php
7ed31b51a66bdfaf9b046429965e457aaec2d969
diff --git a/exrex.py b/exrex.py index <HASH>..<HASH> 100644 --- a/exrex.py +++ b/exrex.py @@ -107,6 +107,12 @@ def _gen(d, limit=20, count=False): # ignore ^ and $ elif i[0] == 'at': continue + elif i[0] == 'not_literal': + subs = list(CATEGORIES['category_any']) + subs.remove(chr(i[1])) + if count: + strings = (strings or 1) * len(subs) + ret = comb(ret, subs) else: print('[!] cannot handle expression "%r"' % i) @@ -142,6 +148,10 @@ def _randone(d, limit=20): ret += choice(list(chain.from_iterable(_gen(list(x[1]), limit) for x in l))) elif i[0] == 'at': continue + elif i[0] == 'not_literal': + c=list(CATEGORIES['category_any']) + c.remove(chr(i[1])) + ret += choice(c) else: print('[!] cannot handle expression "%s"' % str(i))
Added support for "not_literal" (eg. [^x]), "negate" (eg. [^xy])is not supported yet
asciimoo_exrex
train
py
7d0e207650b1ad5b1c7ffbf5359e024f2325bc9d
diff --git a/Library/Security/ExternalAuthenticator.php b/Library/Security/ExternalAuthenticator.php index <HASH>..<HASH> 100644 --- a/Library/Security/ExternalAuthenticator.php +++ b/Library/Security/ExternalAuthenticator.php @@ -60,7 +60,7 @@ class ExternalAuthenticator implements SimpleFormAuthenticatorInterface $user->getSalt() ); - if ($user->getAuthentication() and $user->getAuthentication() !== '') { + if ($user->getAuthentication() and $user->getAuthentication() !== '' && $token->getCredentials()) { if (!$this->authenticationManager->authenticate( $user->getAuthentication(), $user->getUsername(), $token->getCredentials() )) {
[CoreBundle] Fixing ldap authentication on blank password.
claroline_Distribution
train
php
dcbfba6cd5ba09e866549a82513cde11aed50014
diff --git a/cmd/ssh-proxy/main_test.go b/cmd/ssh-proxy/main_test.go index <HASH>..<HASH> 100644 --- a/cmd/ssh-proxy/main_test.go +++ b/cmd/ssh-proxy/main_test.go @@ -130,8 +130,8 @@ var _ = Describe("SSH proxy", func() { VerifyProto(expectedGetActualLRPRequest), RespondWithProto(actualLRPGroupResponse), )) - fakeBBS.RouteToHandler("POST", "/v2/desired_lrps/get_by_process_guid", ghttp.CombineHandlers( - ghttp.VerifyRequest("POST", "/v2/desired_lrps/get_by_process_guid"), + fakeBBS.RouteToHandler("POST", "/v1/desired_lrps/get_by_process_guid.r1", ghttp.CombineHandlers( + ghttp.VerifyRequest("POST", "/v1/desired_lrps/get_by_process_guid.r1"), VerifyProto(getDesiredLRPRequest), RespondWithProto(desiredLRPResponse), ))
Update fakeBBS routes [#<I>]
cloudfoundry_diego-ssh
train
go
707b42ef728d93204a6c011b0e101938a5f24f5f
diff --git a/src/rdf-terms.js b/src/rdf-terms.js index <HASH>..<HASH> 100644 --- a/src/rdf-terms.js +++ b/src/rdf-terms.js @@ -38,6 +38,8 @@ function termToJS (value, type) { return Number(value) case 'http://www.w3.org/2001/XMLSchema#boolean': return value === '"true"' + case 'http://www.w3.org/2001/XMLSchema#dateTime': + return Date.parse(value) default: throw new Error(`Unknown Datatype found during RDF Term parsing: ${value} (datatype: ${type})`) }
add support for parsing xsd:dateTime
Callidon_sparql-engine
train
js
9ef7064588a72704b48d615359275b89e79617bb
diff --git a/lib/notifiers/deprecation_logger.rb b/lib/notifiers/deprecation_logger.rb index <HASH>..<HASH> 100644 --- a/lib/notifiers/deprecation_logger.rb +++ b/lib/notifiers/deprecation_logger.rb @@ -24,14 +24,13 @@ module AttrDeprecated def log_deprecated_attribute_usage(klass, *attrs) warning_message = "WARNING: Called deprecated attribute on #{klass.name}: #{attrs.join(', ')}\n" + backtrace.map { |trace| "\t#{trace}" }.join("\n") - if logger? - logger.warn do - "WARNING: Called deprecated attribute for #{klass.name}: #{attrs.join(', ')}\n" + - backtrace.map { |trace| "\t#{trace}" }.join("\n") - end - else + #if logger? + # logger.warn do + # warning_message + # end + #else puts warning_message - end + #end end end end
Temporarily disable Rails logger
Aerlinger_attr_deprecated
train
rb
09cfd33df218725aa88d2f64d87868056c2778ba
diff --git a/indra/tests/test_biogrid.py b/indra/tests/test_biogrid.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_biogrid.py +++ b/indra/tests/test_biogrid.py @@ -3,9 +3,33 @@ from builtins import dict, str from indra.databases import biogrid_client from indra.util import unicode_strs from nose.plugins.attrib import attr +from indra.sources.biogrid import process_file +from indra.statements import Complex @attr('webservice', 'nonpublic') def test_biogrid_request(): results = biogrid_client._send_request(['MAP2K1', 'MAPK1']) assert results is not None assert unicode_strs(results) + +def test_biogrid_tsv(): + # Download biogrid file form the web and process it + bp = process_file(None) + + # We should have a lot of statementse + statements = bp.statements + assert(len(statements) > 500000) + + # Any given statement should be a complex, with appropriate evidence + s0 = statements[0] + assert(isinstance(s0, Complex)) + ev = s0.evidence[0] + assert(ev.source_api == 'biogrid') + assert(ev.text is None) + assert(ev.pmid is not None) + assert('tsv_row' in ev.annotations) + + # The first statement in the file involves MAP2K4 and FLNC + assert(str(s0.members[0]) == 'MAP2K4()') + assert(str(s0.members[1]) == 'FLNC()') +
Add test for downloading and parsing biogrid tsv file
sorgerlab_indra
train
py
fc278d5152dea9aa8fd678a490e597895a3cc76e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setup( ) ], - install_requires=['typing'], + install_requires=["typing; python_version<'3.5'"], classifiers=[ 'Development Status :: 5 - Production/Stable',
typing requirement only for python<I> and lower
ivankorobkov_python-inject
train
py
a9bd15d90dfde186e28fa28c6346b8631a83e8b1
diff --git a/examples/02-plot/gif.py b/examples/02-plot/gif.py index <HASH>..<HASH> 100644 --- a/examples/02-plot/gif.py +++ b/examples/02-plot/gif.py @@ -19,7 +19,7 @@ grid = pv.StructuredGrid(x, y, z) # Create a plotter object and set the scalars to the Z height plotter = pv.Plotter() -plotter.add_mesh(grid, scalars=z.ravel()) +plotter.add_mesh(grid, scalars=z.ravel(), smooth_shading=True) print('Orient the view, then press "q" to close window and produce movie') @@ -36,9 +36,15 @@ nframe = 15 for phase in np.linspace(0, 2 * np.pi, nframe + 1)[:nframe]: z = np.sin(r + phase) pts[:, -1] = z.ravel() - plotter.update_coordinates(pts) - plotter.update_scalars(z.ravel()) - plotter.write_frame() + plotter.update_coordinates(pts, render=False) + plotter.update_scalars(z.ravel(), render=False) + + # must update normals when smooth shading is enabled + plotter.mesh.compute_normals(cell_normals=False, inplace=True) + plotter.write_frame() # this will trigger the render + + # otherwise, when not writing frames, render with: + # plotter.render() # Close movie and delete object plotter.close()
using smooth shading on gif example (#<I>)
vtkiorg_vtki
train
py
6b2e88bfe89e203d6ce32bdea07763199f9deff8
diff --git a/lib/nuggets/cli.rb b/lib/nuggets/cli.rb index <HASH>..<HASH> 100644 --- a/lib/nuggets/cli.rb +++ b/lib/nuggets/cli.rb @@ -244,7 +244,29 @@ module Nuggets def opts(opts) end + def verbose_opts(opts) + verbose, debug = defaults.key?(:verbose), defaults.key?(:debug) + + if verbose + opts.on('-v', '--verbose', 'Print verbose output') { + options[:verbose] = true + } + end + + if debug + msg = "; #{debug_message}" if respond_to?(:debug_message, true) + + opts.on('-D', '--debug', "Print debug output#{msg}") { + options[:debug] = true + } + end + + opts.separator '' if verbose || debug + end + def generic_opts(opts) + verbose_opts(opts) + opts.on('-h', '--help', 'Print this help message and exit') { shut opts }
lib/nuggets/cli.rb (verbose_opts): Automatically add opts for verbosity/debug setting.
blackwinter_nuggets
train
rb
799f8426aa306785223d9aed7c633abd5fd25e81
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -176,5 +176,8 @@ module.exports = { // - events because we use it for some event emitters // - path because we use it quite a bit 'import/no-nodejs-modules': [ 'error', { allow: [ 'url', 'events', 'path', 'config' ] } ], + + // temporarily demote inclusive language rule to a warning until we clear the repository + 'inclusive-language/use-inclusive-words': 'warn', }, };
ESLint: Demote inclusive language rule to a warning (#<I>)
Automattic_wp-calypso
train
js
7df2a0389e7df6ddcda8a6dc54646ba2079f6ba4
diff --git a/ui/app/product/_product.js b/ui/app/product/_product.js index <HASH>..<HASH> 100644 --- a/ui/app/product/_product.js +++ b/ui/app/product/_product.js @@ -70,7 +70,7 @@ .$promise; }, productVersions: function(restClient, productDetail) { - return restClient.Version.query({ productId: productDetail.id }).$promise; + return restClient.Product.getVersions({ productId: productDetail.id }).$promise; }, } });
[NCL-<I>] Only query for and display the versions associated with the current product
project-ncl_pnc
train
js
ca4a12b3c8417fbf382e77ffdbecf39ae6aaf1d8
diff --git a/src/main/org/openscience/cdk/AtomContainer.java b/src/main/org/openscience/cdk/AtomContainer.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/AtomContainer.java +++ b/src/main/org/openscience/cdk/AtomContainer.java @@ -1014,6 +1014,10 @@ public class AtomContainer extends ChemObject addSingleElectron(atomContainer.getSingleElectron(f)); } } + + for (IStereoElement se : atomContainer.stereoElements()) + stereoElements.add(se); + notifyChanged(); } diff --git a/src/main/org/openscience/cdk/silent/AtomContainer.java b/src/main/org/openscience/cdk/silent/AtomContainer.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/silent/AtomContainer.java +++ b/src/main/org/openscience/cdk/silent/AtomContainer.java @@ -992,6 +992,8 @@ public class AtomContainer extends ChemObject addSingleElectron(atomContainer.getSingleElectron(f)); } } + for (IStereoElement se : atomContainer.stereoElements()) + stereoElements.add(se); } /**
When adding two containers - also add stereo elements.
cdk_cdk
train
java,java
b2d9459b9a1f7644b68eac34fe216d98342757dc
diff --git a/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java b/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java index <HASH>..<HASH> 100644 --- a/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java +++ b/src/main/java/nl/hsac/fitnesse/fixture/slim/web/BrowserTest.java @@ -2216,13 +2216,19 @@ public class BrowserTest extends SlimFixture { @Override protected boolean repeatUntil(RepeatCompletion repeat) { + // During repeating we reduce the timeout used for finding elements, + // but the page load timeout is kept as-is (which takes extra work because secondsBeforeTimeout(int) + // also changes that. int previousTimeout = secondsBeforeTimeout(); + int pageLoadTimeout = secondsBeforePageLoadTimeout(); try { int timeoutDuringRepeat = Math.max((Math.toIntExact(repeatInterval() / 1000)), 1); secondsBeforeTimeout(timeoutDuringRepeat); + secondsBeforePageLoadTimeout(pageLoadTimeout); return super.repeatUntil(repeat); } finally { secondsBeforeTimeout(previousTimeout); + secondsBeforePageLoadTimeout(pageLoadTimeout); } }
Ensure we don't alter the page load timeout when repeating an operation
fhoeben_hsac-fitnesse-fixtures
train
java
8e5928799ccd7947ab95040152f5ecda69c2b5ae
diff --git a/src/axis.js b/src/axis.js index <HASH>..<HASH> 100644 --- a/src/axis.js +++ b/src/axis.js @@ -15,11 +15,17 @@ function translateY(y) { return "translate(0," + (y + 0.5) + ")"; } +function number(scale) { + return function(d) { + return +scale(d); + }; +} + function center(scale) { var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset. if (scale.round()) offset = Math.round(offset); return function(d) { - return scale(d) + offset; + return +scale(d) + offset; }; } @@ -43,9 +49,9 @@ function axis(orient, scale) { format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat, spacing = Math.max(tickSizeInner, 0) + tickPadding, range = scale.range(), - range0 = range[0] + 0.5, - range1 = range[range.length - 1] + 0.5, - position = (scale.bandwidth ? center : identity)(scale.copy()), + range0 = +range[0] + 0.5, + range1 = +range[range.length - 1] + 0.5, + position = (scale.bandwidth ? center : number)(scale.copy()), selection = context.selection ? context.selection() : context, path = selection.selectAll(".domain").data([null]), tick = selection.selectAll(".tick").data(values, scale).order(),
Coerce scale output to numbers. Fixes d3/d3-scale#<I>.
d3_d3-axis
train
js
53477e8ad9bd782600f6a8144b4806bb07a4c69b
diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index <HASH>..<HASH> 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -1745,7 +1745,6 @@ class BaseHtml * about attribute expression. * @param array $items the data item used to generate the checkboxes. * The array keys are the checkbox values, and the array values are the corresponding labels. - * Note that the labels will NOT be HTML-encoded, while the values will. * @param array $options options (name => config) for the checkbox list container tag. * The following options are specially handled: * @@ -1787,7 +1786,6 @@ class BaseHtml * about attribute expression. * @param array $items the data item used to generate the radio buttons. * The array keys are the radio values, and the array values are the corresponding labels. - * Note that the labels will NOT be HTML-encoded, while the values will. * @param array $options options (name => config) for the radio button list container tag. * The following options are specially handled: * @@ -1829,7 +1827,6 @@ class BaseHtml * about attribute expression. * @param array $items the data item used to generate the input fields. * The array keys are the input values, and the array values are the corresponding labels. - * Note that the labels will NOT be HTML-encoded, while the values will. * @param array $options options (name => config) for the input list. The supported special options * depend on the input type specified by `$type`. * @return string the generated input list
Correct note about html encoded items in radio/checkboxlist (#<I>)
yiisoft_yii2
train
php
7c97c59e47b073a69e719dcb643f9018b043d234
diff --git a/Mailchimp/Methods/MCList.php b/Mailchimp/Methods/MCList.php index <HASH>..<HASH> 100644 --- a/Mailchimp/Methods/MCList.php +++ b/Mailchimp/Methods/MCList.php @@ -665,5 +665,29 @@ class MCList extends RestClient else return isset($data) ? $data : false; } + + /** + * Test a segment and return number of matching subscribers. + * @link https://apidocs.mailchimp.com/api/2.0/lists/segment-test.php + * + * @param $options = array of segment options + * @return bool|mixed + * @throws \Hype\MailchimpBundle\Mailchimp\MailchimpAPIException + */ + public function segmentTest($options = array()) { + $payload = array( + 'list_id' => $this->listId, + 'options' => $options + ); + //echo '<pre>';print_r($payload);exit; + $apiCall = 'lists/segment-test'; + $data = $this->requestMonkey($apiCall, $payload); + $data = json_decode($data, true); + + if (isset($data['error'])) + throw new MailchimpAPIException($data); + else + return isset($data) ? $data : false; + } }
Added list/segment-test API endpoint
AhmedSamy_HypeMailchimpBundle
train
php
45dc690947ebfe9fb3dc64ba3c74fb433b0f474d
diff --git a/cmd/mist/main.go b/cmd/mist/main.go index <HASH>..<HASH> 100644 --- a/cmd/mist/main.go +++ b/cmd/mist/main.go @@ -37,7 +37,7 @@ import ( const ( ClientIdentifier = "Mist" - Version = "0.9.0" + Version = "0.9.18" ) var (
cmd/mist: version bump
ethereum_go-ethereum
train
go
6a27cf43425eb4e60da2f9cf39254516796847fd
diff --git a/tests/models_tests/test_fcn32s.py b/tests/models_tests/test_fcn32s.py index <HASH>..<HASH> 100644 --- a/tests/models_tests/test_fcn32s.py +++ b/tests/models_tests/test_fcn32s.py @@ -4,7 +4,6 @@ import torch import matplotlib.pyplot as plt -from nose.tools import assert_true import numpy as np import skimage.data @@ -34,8 +33,8 @@ def test_get_upsampling_weight(): y = y.transpose(1, 2, 0) dst = y.astype(np.uint8) - assert_true(abs(src.shape[0] * 2 - dst.shape[0]) <= 2) - assert_true(abs(src.shape[1] * 2 - dst.shape[1]) <= 2) + assert abs(src.shape[0] * 2 - dst.shape[0]) <= 2 + assert abs(src.shape[1] * 2 - dst.shape[1]) <= 2 return src, dst
Update tests/models_tests/test_fcn<I>s.py
wkentaro_pytorch-fcn
train
py
316ee7d96cc4c90ef68940f5f6106dcbc571c897
diff --git a/lib/chicago/fact.rb b/lib/chicago/fact.rb index <HASH>..<HASH> 100644 --- a/lib/chicago/fact.rb +++ b/lib/chicago/fact.rb @@ -31,6 +31,7 @@ module Chicago # Sets the dimensions with which a fact row is associated. def dimensions(*dimensions) + dimensions += dimensions.pop.keys if dimensions.last.kind_of? Hash dimensions.each do |dimension| @dimension_keys << Column.new(dimension_key(dimension), :integer, :null => false, :min => 0) @dimension_names << dimension diff --git a/spec/fact_spec.rb b/spec/fact_spec.rb index <HASH>..<HASH> 100644 --- a/spec/fact_spec.rb +++ b/spec/fact_spec.rb @@ -31,6 +31,13 @@ describe Chicago::Fact do fact.dimension_names.should == [:product, :customer] end + it "should allow dimensional roleplaying via a hash of name => dimension" do + fact = Fact.define(:sales) do + dimensions :product, :customer => :user + end + fact.dimension_names.should == [:product, :customer] + end + it "should know every defined fact" do Fact.clear_definitions Fact.define(:sales)
Allowing dimension roleplaying. Fact#dimensions can take a Hash of roleplaying_name => dimension_name to define multiple links to the same dimension. This is often done with the date dimension for example.
notonthehighstreet_chicago
train
rb,rb
4e44eb2a922b02bcd290e8e7309e0a2ed9af0683
diff --git a/python_modules/libraries/dagster-airbyte/setup.py b/python_modules/libraries/dagster-airbyte/setup.py index <HASH>..<HASH> 100644 --- a/python_modules/libraries/dagster-airbyte/setup.py +++ b/python_modules/libraries/dagster-airbyte/setup.py @@ -31,6 +31,9 @@ if __name__ == "__main__": "Operating System :: OS Independent", ], packages=find_packages(exclude=["test"]), - install_requires=[f"dagster{pin}"], + install_requires=[ + f"dagster{pin}", + "requests", + ], zip_safe=False, )
[airbyte] add requests dependency (#<I>)
dagster-io_dagster
train
py
6b8077c8f39c88b5e3939248f098bd1cf0b3bddc
diff --git a/routes/discover.js b/routes/discover.js index <HASH>..<HASH> 100644 --- a/routes/discover.js +++ b/routes/discover.js @@ -1,4 +1,11 @@ /** + * Module dependencies + */ + +var Scope = require('../models/Scope'); + + +/** * Well-Known Endpoint */ @@ -9,7 +16,18 @@ module.exports = function (server) { */ server.get('/.well-known/openid-configuration', function (req, res, next) { - res.json(server.OpenIDConfiguration); + Scope.list(function (err, scopes) { + if (err) { return next(err); } + + // Get a list of scope names + scopes = scopes.map(function (scope) { + return scope.name; + }); + + // Update the OpenIDConfiguration and respond + server.OpenIDConfiguration.scopes_supported = scopes; + res.json(server.OpenIDConfiguration); + }); }); };
fix(discovery): include all registered scopes in server metadata
anvilresearch_connect
train
js
8dd30666fa68c5c4fb7be463712afc8e805aff5e
diff --git a/yolk/pypi.py b/yolk/pypi.py index <HASH>..<HASH> 100644 --- a/yolk/pypi.py +++ b/yolk/pypi.py @@ -23,13 +23,34 @@ import os import time import logging import urllib2 +import urllib from yolk.utils import get_yolk_dir XML_RPC_SERVER = 'http://pypi.python.org/pypi' -#XML_RPC_SERVER = 'http://download.zope.org/ppix/' -#XML_RPC_SERVER = 'http://cheeseshop.python.org/simple' + +class addinfourl(urllib2.addinfourl): + """ + Replacement addinfourl class compatible with python-2.7's xmlrpclib + + In python-2.7, xmlrpclib expects that the response object that it receives + has a getheader method. httplib.HTTPResponse provides this but + urllib2.addinfourl does not. Add the necessary functions here, ported to + use the internal data structures of addinfourl. + """ + + def getheader(self, name, default=None): + if self.headers is None: + raise httplib.ResponseNotReady() + return self.headers.getheader(name, default) + + def getheaders(self): + if self.headers is None: + raise httplib.ResponseNotReady() + return self.headers.items() + +urllib2.addinfourl = addinfourl class ProxyTransport(xmlrpclib.Transport):
Issue #3. Thanks David Bennett for python<I> addinfourl fix
cakebread_yolk
train
py
7e4a95364a9971653d7fe6fe3db03828c8062288
diff --git a/lib/ultragrep.rb b/lib/ultragrep.rb index <HASH>..<HASH> 100644 --- a/lib/ultragrep.rb +++ b/lib/ultragrep.rb @@ -110,7 +110,7 @@ module Ultragrep if matches action = matches[1] time = matches[2] - r = "#{request_array[0]}\t#{action}\t#{time}\n" + "#{request_array[0]}\t#{action}\t#{time}\n" else nil end diff --git a/spec/ultragrep_spec.rb b/spec/ultragrep_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ultragrep_spec.rb +++ b/spec/ultragrep_spec.rb @@ -203,6 +203,15 @@ describe Ultragrep do result.should_not include "searching foo/host.1/a.log-#{date}" end end + + describe "--perf" do + it "shows performance info" do + write "foo/host.1/a.log-#{date}", "Processing xxx at #{time}\nCompleted in 100ms\nProcessing xxx at #{time}\nCompleted in 200ms\nProcessing xxx at #{time}\nCompleted in 100ms\n" + output = ultragrep("at --perf") + output.gsub!(/\d{6,}/, "TIME") + output.strip.should == "TIME\txxx\t100" # FIXME only shows the last number + end + end end end
test for --perf ... seems to be broken ...
zendesk_ultragrep
train
rb,rb
9d34e17b86d154d9aac4d4d93554d24e0949dc44
diff --git a/src/Input/InputLabel.js b/src/Input/InputLabel.js index <HASH>..<HASH> 100644 --- a/src/Input/InputLabel.js +++ b/src/Input/InputLabel.js @@ -18,7 +18,7 @@ export const styleSheet = createStyleSheet('MuiInputLabel', theme => ({ transform: `translate(0, ${theme.spacing.unit * 5}px) scale(1)`, }, shrink: { - transform: `translate(0, ${theme.spacing.unit * 2 + 2}px) scale(0.75)`, + transform: `translate(0, ${theme.spacing.unit * 2 + 1.5}px) scale(0.75)`, transformOrigin: 'top left', }, animated: {
Fix Labels flicker in Chrome (#<I>)
mui-org_material-ui
train
js
f3952d632a3d612a4f3e8c7ef588139306652c65
diff --git a/src/components/BranchedAutoBus.php b/src/components/BranchedAutoBus.php index <HASH>..<HASH> 100644 --- a/src/components/BranchedAutoBus.php +++ b/src/components/BranchedAutoBus.php @@ -24,6 +24,7 @@ class BranchedAutoBus extends Component implements AutoBusInterface public function __construct(CommandBusInterface $bus, CommandFactoryInterface $factory, array $config = []) { + parent::__construct($config); $this->bus = $bus; $this->factory = $factory; } diff --git a/src/components/TacticianCommandBus.php b/src/components/TacticianCommandBus.php index <HASH>..<HASH> 100644 --- a/src/components/TacticianCommandBus.php +++ b/src/components/TacticianCommandBus.php @@ -38,6 +38,7 @@ class TacticianCommandBus extends \yii\base\Component implements CommandBusInter public function __construct(Middleware $defaultHandler, Container $di, array $config = []) { + parent::__construct($config); $this->di = $di; $this->defaultHandler = $defaultHandler; $this->realCommandBus = new CommandBus($this->getMiddlewares());
Respect params, passed in $config
hiqdev_yii2-autobus
train
php,php
471476c28d274c8f6b697615e629028c976f1aad
diff --git a/exchange/orders/sticky.js b/exchange/orders/sticky.js index <HASH>..<HASH> 100644 --- a/exchange/orders/sticky.js +++ b/exchange/orders/sticky.js @@ -234,6 +234,7 @@ class StickyOrder extends BaseOrder { } checkOrder() { + if(this.completed || this.completing) { return console.log(new Date, 'checkOrder called on completed/completing order..', this.completed, this.completing); } @@ -392,6 +393,10 @@ class StickyOrder extends BaseOrder { return false; } + if(this.cancelling) { + return false; + } + if( this.status === states.INITIALIZING || this.status === states.SUBMITTED ||
[GB] prioritise sticky cancel over everything
askmike_gekko
train
js
96dd28f44d52d304c283537b2c9b4bb3530a30f7
diff --git a/control/runner.go b/control/runner.go index <HASH>..<HASH> 100644 --- a/control/runner.go +++ b/control/runner.go @@ -168,7 +168,7 @@ func (r *runner) startPlugin(p executablePlugin) (*availablePlugin, error) { } // Wait for plugin response - resp, err := p.WaitForResponse(time.Second * 3) + resp, err := p.WaitForResponse(time.Second * 5) if err != nil { e := errors.New("error while waiting for response: " + err.Error()) runnerLog.WithFields(log.Fields{
Increases the timeout for waiting for a plugin response from 3 to 5 seconds
intelsdi-x_snap
train
go
df3699b4ed78b621069e74e801100a6f3f629788
diff --git a/activeweb/src/main/java/org/javalite/activeweb/StreamResponse.java b/activeweb/src/main/java/org/javalite/activeweb/StreamResponse.java index <HASH>..<HASH> 100644 --- a/activeweb/src/main/java/org/javalite/activeweb/StreamResponse.java +++ b/activeweb/src/main/java/org/javalite/activeweb/StreamResponse.java @@ -39,7 +39,7 @@ class StreamResponse extends ControllerResponse{ out.write(bytes, 0, x); } out.flush(); - out.close(); + in.close(); } catch(Exception e){ throw new ControllerException(e);
#<I> Close file after sending - oops, was closing the wrong stream
javalite_activejdbc
train
java
09e9ca6fba221e7ddbf577f68ddc04fbe96363d5
diff --git a/packages/app-frontend/src/features/timeline/index.js b/packages/app-frontend/src/features/timeline/index.js index <HASH>..<HASH> 100644 --- a/packages/app-frontend/src/features/timeline/index.js +++ b/packages/app-frontend/src/features/timeline/index.js @@ -6,7 +6,7 @@ import { formatTime } from '@front/util/format' import { useApps, getApps } from '../apps' import { getBridge } from '../bridge' -const STACK_DURATION = 10 +const STACK_DURATION = 50 const startTime = ref(0) const endTime = ref(0) @@ -122,13 +122,7 @@ function addEvent (appId, event, layer) { function stackEvent (event) { const roundedTime = Math.round(event.time / STACK_DURATION) - // Try neighbors too - const times = [roundedTime, roundedTime - STACK_DURATION, roundedTime + STACK_DURATION] - let wasStacked = false - for (const k in times) { - wasStacked = !!_stackEvent(event, times[k]) - if (wasStacked) break - } + const wasStacked = !!_stackEvent(event, roundedTime) if (!wasStacked) { event.layer.eventTimeMap[roundedTime] = event event.layer.displayedEvents.push(event)
refactor(timeline): simplify auto-stacking
vuejs_vue-devtools
train
js
2dea4b3b1ce55053953c4191f39e5e6d14bbcb6b
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100644 --- a/manifest.php +++ b/manifest.php @@ -24,7 +24,7 @@ return array( 'label' => 'QTI Portable Info Control', 'description' => '', 'license' => 'GPL-2.0', - 'version' => '0.1.1', + 'version' => '0.2', 'author' => 'Open Assessment Technologies', 'requires' => array('taoQtiItem' => '>=2.6'), 'acl' => array( @@ -40,7 +40,7 @@ return array( ), 'uninstall' => array( ), - 'update' => 'oat\\qtiItemPci\\scripts\\update\\Updater', + 'update' => 'oat\\qtiItemPic\\scripts\\update\\Updater', 'routes' => array( '/qtiItemPic' => 'oat\\qtiItemPic\\controller' ),
increase extension number to <I>
oat-sa_extension-tao-itemqti-pic
train
php
286c68c000f02243c33de169e83d0df207d01d76
diff --git a/spec/unit/resource/windows_audit_policy_spec.rb b/spec/unit/resource/windows_audit_policy_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/resource/windows_audit_policy_spec.rb +++ b/spec/unit/resource/windows_audit_policy_spec.rb @@ -16,6 +16,7 @@ # require "spec_helper" +require "chef/resource/windows_audit_policy" describe Chef::Resource::WindowsAuditPolicy do let(:resource) { Chef::Resource::WindowsAuditPolicy.new("fakey_fakerton") }
hoping this fixes my uninitialized constant issue
chef_chef
train
rb
e7802e575398cc4099802afa25d29541e3ac0efc
diff --git a/lib/t/printable.rb b/lib/t/printable.rb index <HASH>..<HASH> 100644 --- a/lib/t/printable.rb +++ b/lib/t/printable.rb @@ -107,6 +107,7 @@ module T else print_table(array) end + STDOUT.flush end def print_message(from_user, message)
Make list output flush so that can be piped. The other output options already flush.
sferik_t
train
rb
78a57e7004350a871dd1d8daf555b5619a36e393
diff --git a/Files.php b/Files.php index <HASH>..<HASH> 100644 --- a/Files.php +++ b/Files.php @@ -28,8 +28,10 @@ class sb_Files{ $buffer = fread($handle, $chunk_size); echo $buffer; - ob_flush(); - flush(); + if(ob_get_level()){ + ob_flush(); + flush(); + } if ($return_bytes) { $cnt += strlen($buffer);
only flush if buffers are present
surebert_surebert-framework
train
php
6e1b77ff9095c85a372a838e18c9f5e5c1c16ab6
diff --git a/test/cortex_test.py b/test/cortex_test.py index <HASH>..<HASH> 100644 --- a/test/cortex_test.py +++ b/test/cortex_test.py @@ -25,7 +25,7 @@ sys.path.insert(0, parentdir) import pyOCD from pyOCD.board import MbedBoard -from pyOCD.target.cortex_m import float2int +from pyOCD.utility.conversion import float2int from pyOCD.transport import TransferError from test_util import Test, TestResult import logging @@ -100,6 +100,10 @@ def cortex_test(board_id): addr = 0x20000000 size = 0x502 addr_flash = 0x10000 + elif target_type == "kl28z": + addr = 0x20000000 + size = 0x502 + addr_flash = 0x10000 elif target_type == "k64f": addr = 0x20000000 size = 0x502 @@ -285,4 +289,4 @@ def cortex_test(board_id): if __name__ == "__main__": logging.basicConfig(level=logging.INFO) - cortex_test(None) \ No newline at end of file + cortex_test(None)
Added KL<I> to cortex_test.py and fixed an issue.
mbedmicro_pyOCD
train
py
8432ba47647a317d0f84b5419543baeac1496266
diff --git a/src/UI/Lessons.php b/src/UI/Lessons.php index <HASH>..<HASH> 100644 --- a/src/UI/Lessons.php +++ b/src/UI/Lessons.php @@ -60,7 +60,7 @@ class Lessons { return $url; } } else { - $url = $CFG->wwwroot . '/lessons.php'; + $url = $CFG->wwwroot . '/lessons'; if ( $anchor != null ) return $url . '?anchor=' . urlencode($anchor); if ( $index != null ) return $url . '?index=' . urlencode($index); return $url;
More chasing of the REST urls
tsugiproject_tsugi-php
train
php
f212a5122eef42554418510a03bad9b8e45a7fb5
diff --git a/bulk_writer.js b/bulk_writer.js index <HASH>..<HASH> 100644 --- a/bulk_writer.js +++ b/bulk_writer.js @@ -69,6 +69,13 @@ BulkWriter.prototype.flush = function flush() { waitForActiveShards: this.waitForActiveShards, timeout: this.interval + 'ms', type: this.type + }).then(res => { + if (res.errors && res.items) + res.items.forEach(item => { + if (item.index && item.index.error) { + console.error('Elasticsearch index error', item.index.error) + } + }) }).catch((e) => { // prevent [DEP0018] DeprecationWarning // rollback this.bulk array thiz.bulk = bulk.concat(thiz.bulk);
Log to console on elasticsearch errors The logger threw silently when using the same field with different types
vanthome_winston-elasticsearch
train
js
1e63153099a43c92a1b2de5f4749779ee33ff67e
diff --git a/packages/ember-states/lib/routable.js b/packages/ember-states/lib/routable.js index <HASH>..<HASH> 100644 --- a/packages/ember-states/lib/routable.js +++ b/packages/ember-states/lib/routable.js @@ -74,7 +74,7 @@ Ember.Routable = Ember.Mixin.create({ In general, this will update the browser's URL. */ updateRoute: function(manager, location) { - if (location && get(this, 'isLeaf')) { + if (get(this, 'isLeaf')) { var path = this.absoluteRoute(manager); location.setURL(path); } diff --git a/packages/ember-states/lib/router.js b/packages/ember-states/lib/router.js index <HASH>..<HASH> 100644 --- a/packages/ember-states/lib/router.js +++ b/packages/ember-states/lib/router.js @@ -76,13 +76,9 @@ Ember.Router = Ember.StateManager.extend( Ember.assert("To get a URL for a state, it must have a `route` property.", !!get(state, 'routeMatcher')); var location = get(this, 'location'), - url = state.absoluteRoute(this, hash); + absoluteRoute = state.absoluteRoute(this, hash); - if (location) { - url = location.formatURL(url); - } - - return url; + return location.formatURL(absoluteRoute); }, urlForEvent: function(eventName, context) {
Router.location cannot be null or undefined
emberjs_ember.js
train
js,js
d56b60c5cc2fe5ad4e8e5451a92f2aa9a8028d08
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -88,10 +88,10 @@ setup( zip_safe=False, platforms='any', install_requires=[ - 'cffi>=1.0.0', + 'cffi>=1.6.0', ], setup_requires=[ - 'cffi>=1.0.0' + 'cffi>=1.6.0' ], classifiers=[ 'Intended Audience :: Developers',
Ensure we depend on cffi <I> or higher
getsentry_libsourcemap
train
py
7f06b7a689257edcb229561024adad0b0b4a74b3
diff --git a/recorder.go b/recorder.go index <HASH>..<HASH> 100644 --- a/recorder.go +++ b/recorder.go @@ -93,6 +93,7 @@ func getHttpType(rawSpan basictracer.RawSpan) string { } func (r *InstanaSpanRecorder) RecordSpan(rawSpan basictracer.RawSpan) { + //TODO: remove log field misuse after merge data := getDataLogField(rawSpan) tp := getStringSpanLogField(rawSpan, "type") if data == nil {
state log misuse to be removed once merged
instana_go-sensor
train
go
32e06dd17c08810d3543fe7ec07cb95b20c78b0f
diff --git a/diff_cover/violationsreporters/violations_reporter.py b/diff_cover/violationsreporters/violations_reporter.py index <HASH>..<HASH> 100644 --- a/diff_cover/violationsreporters/violations_reporter.py +++ b/diff_cover/violationsreporters/violations_reporter.py @@ -237,7 +237,7 @@ jshint_driver = RegexBasedDriver( eslint_driver = RegexBasedDriver( name='eslint', supported_extensions=['js'], - command=['eslint', '--format compact'], + command=['eslint', '--format=compact'], expression=r'^([^:]+): line (\d+), col \d+, (.*)$', command_to_check_install=['eslint', '-v'], )
Correct eslint command
Bachmann1234_diff-cover
train
py
8d6c903b1db3656ef423472e0a699f0408a52c08
diff --git a/tests/WidgetTest/ValidatorTest.php b/tests/WidgetTest/ValidatorTest.php index <HASH>..<HASH> 100644 --- a/tests/WidgetTest/ValidatorTest.php +++ b/tests/WidgetTest/ValidatorTest.php @@ -480,14 +480,14 @@ class ValidatorTest extends TestCase public function testGetterAsData() { - $user = new \WidgetTest\Fixtures\UserEntity(); + $user = new \WidgetTest\Fixtures\User; - $user->setEmail('[email protected]'); + $user->setName('[email protected]'); $validator = $this->validate(array( 'data' => $user, 'rules' => array( - 'email' => 'email' + 'name' => 'email' ) ));
fixed unit test error that class not found
twinh_wei
train
php
b8b4607c59f91223d8a0041e44182e675da96ed2
diff --git a/lib/hyrax/specs/capybara.rb b/lib/hyrax/specs/capybara.rb index <HASH>..<HASH> 100644 --- a/lib/hyrax/specs/capybara.rb +++ b/lib/hyrax/specs/capybara.rb @@ -77,7 +77,7 @@ def save_timestamped_page_and_screenshot(page, meta) time_now = Time.zone.now timestamp = "#{time_now.strftime('%Y-%m-%d-%H-%M-%S.')}#{'%03d' % (time_now.usec / 1000).to_i}" - artifact_dir = ENV['CI'] ? "/tmp/test-results" : Rails.root.join('tmp' 'capybara') + artifact_dir = ENV['CI'] ? "/tmp/test-results" : Rails.root.join('tmp', 'capybara') screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}.png" screenshot_path = "#{artifact_dir}/#{screenshot_name}"
fix path to `tmp/capybara` screenshots a typo (missing comma) led to these being saved to "tmpcapybara". we want "tmp/capybara".
samvera_hyrax
train
rb
6c32765905c5fb6dc69d585b966e0577053d9ce1
diff --git a/lib/components/state-lookup.js b/lib/components/state-lookup.js index <HASH>..<HASH> 100644 --- a/lib/components/state-lookup.js +++ b/lib/components/state-lookup.js @@ -106,7 +106,9 @@ StateLookup.prototype.trackRoom = function(roomId) { } // wait a bit then try again Promise.delay(3000).then(function() { - if (!self._dict[roomId]) return; + if (!self._dict[roomId]) { + return; + } queryRoomState(); });
appease ESLint's curlies policy
matrix-org_matrix-appservice-bridge
train
js
884d5e9fbc59e6ab6ae6af7aa08fb467fd616ef7
diff --git a/scraper/code_gov/models.py b/scraper/code_gov/models.py index <HASH>..<HASH> 100644 --- a/scraper/code_gov/models.py +++ b/scraper/code_gov/models.py @@ -263,16 +263,16 @@ class Project(dict): # lastModified: [string] The date the release was modified, in YYYY-MM-DD or ISO 8601 format. # metadataLastUpdated: [string] The date the metadata of the release was last updated, in YYYY-MM-DD or ISO 8601 format. try: - pushed_at = repository.pushed_at.date() + created_at = repository.created_at.date() except AttributeError: - pushed_at = date_parse(repository.pushed_at).date() + created_at = date_parse(repository.created_at).date() try: updated_at = repository.updated_at.date() except AttributeError: updated_at = date_parse(repository.updated_at).date() project['date'] = { - 'created': pushed_at.isoformat(), + 'created': created_at.isoformat(), 'lastModified': updated_at.isoformat(), 'metadataLastUpdated': '', }
Use created_at rather than pushed_at date from GitHub API
LLNL_scraper
train
py
2e5f8c0e435b0cf7b010385ba5e916655599c057
diff --git a/src/Helper/Validator.php b/src/Helper/Validator.php index <HASH>..<HASH> 100644 --- a/src/Helper/Validator.php +++ b/src/Helper/Validator.php @@ -41,7 +41,7 @@ class Validator implements ValidatorInterface */ public function notBefore(int $notBefore): bool { - return $notBefore < time(); + return $notBefore <= time(); } /**
Fixed bug in validator notBefore method, tokens should be usable as soon as the nbf claim matches the current time.
RobDWaller_ReallySimpleJWT
train
php
b66e6fe76122265f8d5eabf0a1200ff91b95e253
diff --git a/src/python/grpcio_tests/tests/unit/_reconnect_test.py b/src/python/grpcio_tests/tests/unit/_reconnect_test.py index <HASH>..<HASH> 100644 --- a/src/python/grpcio_tests/tests/unit/_reconnect_test.py +++ b/src/python/grpcio_tests/tests/unit/_reconnect_test.py @@ -14,6 +14,7 @@ """Tests that a channel will reconnect if a connection is dropped""" import socket +import time import unittest import grpc @@ -88,6 +89,7 @@ class ReconnectTest(unittest.TestCase): multi_callable = channel.unary_unary(_UNARY_UNARY) self.assertEqual(_RESPONSE, multi_callable(_REQUEST)) server.stop(None) + time.sleep(1) server = grpc.server(server_pool, (handler,)) server.add_insecure_port('[::]:{}'.format(port)) server.start()
Sleep a second to deflake ReconnectTest The thread that watches connectivity on the channel might not pick up that the server has gone away before the request is dispatched, and return UNAVAILABLE instead of reconnecting prior to sending the request. The fundamental solution would basically be enabling retries in C-core. For now, we opt to sleep a second to deflake this particular test case.
grpc_grpc
train
py
af81cd35c57391577e773e882774f171ee3295d9
diff --git a/view/adminhtml/web/js/customer/accounting.js b/view/adminhtml/web/js/customer/accounting.js index <HASH>..<HASH> 100644 --- a/view/adminhtml/web/js/customer/accounting.js +++ b/view/adminhtml/web/js/customer/accounting.js @@ -212,9 +212,8 @@ define([ let one = data.items[i]; let nameFirst = one.name_first; let nameLast = one.name_last; - let email = one.email; let mlmId = one.mlm_id; - let label = nameFirst + ' ' + nameLast + ' <' + email + '> / ' + mlmId; + let label = nameFirst + ' ' + nameLast + ' / ' + mlmId; let foundOne = { label: label, value: label,
MOBI-<I> Counterparty e-mail can be seen
praxigento_mobi_mod_downline
train
js
b6f4c16a0057ea4158b09347ff68a0736c8a17f3
diff --git a/lib/cloudprint/print_job.rb b/lib/cloudprint/print_job.rb index <HASH>..<HASH> 100644 --- a/lib/cloudprint/print_job.rb +++ b/lib/cloudprint/print_job.rb @@ -1,5 +1,7 @@ module CloudPrint class PrintJob + STATUSES = %w{QUEUED IN_PROGRESS DONE ERROR SUBMITTED} + def initialize(data) @data = data end @@ -19,29 +21,11 @@ module CloudPrint self end - def queued? - status == "QUEUED" - end - - def in_progress? - status == "IN_PROGRESS" - end - - def done? - status == "DONE" - end - - def error? - status == "ERROR" - end - - def submitted? - status == "SUBMITTED" - end - def method_missing(meth, *args, &block) if [:id, :status, :error_code].include?(meth) @data[meth] + elsif STATUSES.map{ |s| s.downcase + '?' }.include?(meth.to_s) + @data[:status].downcase == meth.to_s.chop else super end
Move status methods to method_missing
thegengen_cloudprint
train
rb
7a407c9a30306ba6927dda7cfd277181a23f0f08
diff --git a/pgcopy/inspect.py b/pgcopy/inspect.py index <HASH>..<HASH> 100644 --- a/pgcopy/inspect.py +++ b/pgcopy/inspect.py @@ -10,10 +10,7 @@ def get_types(conn, schema, table): SELECT a.attname, t.typcategory AS type_category, - CASE - WHEN t.typcategory = 'A' THEN et.typname - ELSE t.typname - END AS type_name, + COALESCE(et.typname, t.typname) AS type_name, a.atttypmod AS type_mod, a.attnotnull AS not_null, t.typelem
refactor: use COALESCE
altaurog_pgcopy
train
py
c372b8ab390af137e3292c0e77a2628dedacfc9b
diff --git a/ui/src/components/uploader/QUploaderBase.js b/ui/src/components/uploader/QUploaderBase.js index <HASH>..<HASH> 100644 --- a/ui/src/components/uploader/QUploaderBase.js +++ b/ui/src/components/uploader/QUploaderBase.js @@ -479,7 +479,7 @@ export default { 'q-uploader--flat no-shadow': this.flat, 'disabled q-uploader--disable': this.disable }, - on: this.editable === true && this.isUploading !== true + on: this.canAddFiles === true ? { dragover: this.__onDragOver } : null }, [
fix(QUploader): drag-n-drop failing when adding second file to a non-multiple QUploader #<I>
quasarframework_quasar
train
js
9ae1b142fbf073ae3d0d05d9ac0e7629f8fc787d
diff --git a/YaLinqo/Utils.php b/YaLinqo/Utils.php index <HASH>..<HASH> 100644 --- a/YaLinqo/Utils.php +++ b/YaLinqo/Utils.php @@ -8,14 +8,19 @@ class Utils public static function createLambda ($closure, $default = null) { // TODO String lambda syntax: 'a => a*a' - if ($closure === null) + if ($closure === null) { + if ($default === null) + throw new \InvalidArgumentException; return $default; /*Functions::$identity*/ + } if ($closure instanceof \Closure) return $closure; if (is_callable($closure)) return $closure; /*return function() use($closure) { return call_user_func_array($closure, func_get_args()); };*/ + if ($default === null) + throw new \InvalidArgumentException; return $default; }
throw on createLamda from null with default null
Athari_YaLinqo
train
php
a32ceafce29d026cd1706ac1a26f4bdecc859255
diff --git a/frontend/dockerfile/parser/dumper/main.go b/frontend/dockerfile/parser/dumper/main.go index <HASH>..<HASH> 100644 --- a/frontend/dockerfile/parser/dumper/main.go +++ b/frontend/dockerfile/parser/dumper/main.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/docker/docker/builder/parser" + "github.com/docker/docker/builder/dockerfile/parser" ) func main() {
Fix dumper program to use proper import
moby_buildkit
train
go
73f7ef799450d8b7d97b6cf8c4c6c4590899cfb8
diff --git a/pycbc/results/legacy_grb.py b/pycbc/results/legacy_grb.py index <HASH>..<HASH> 100755 --- a/pycbc/results/legacy_grb.py +++ b/pycbc/results/legacy_grb.py @@ -658,7 +658,8 @@ def make_grb_segments_plot(wkflow, science_segs, trigger_time, trigger_name, extent = segments.segment(int(wkflow.cp.get("workflow", "start-time")), int(wkflow.cp.get("workflow", "end-time"))) else: - extent = science_segs.union(ifos).extent() + extent = science_segs.union([ifo for ifo in ifos \ + if ifo in science_segs.keys()]).extent() ifo_colors = {} for ifo in ifos:
Fixing issue for single IFO segments
gwastro_pycbc
train
py
f765705f78f205cd27852c7dd02ddb40370de864
diff --git a/git/githistory/rewriter.go b/git/githistory/rewriter.go index <HASH>..<HASH> 100644 --- a/git/githistory/rewriter.go +++ b/git/githistory/rewriter.go @@ -268,8 +268,7 @@ func (r *Rewriter) Rewrite(opt *RewriteOptions) ([]byte, error) { return nil, err } if objectMapFile != nil { - _, err := fmt.Fprintf(objectMapFile, "%s,%s\n", hex.EncodeToString(oid), hex.EncodeToString(newSha)) - if err != nil { + if _, err := fmt.Fprintf(objectMapFile, "%x,%x\n", oid, newSha); err != nil { return nil, err } }
Use %x to remove the explicit call to EncodeToString
git-lfs_git-lfs
train
go
ce346efebea4497b1af5a1a74607c8417e31880e
diff --git a/models/AccountModel.js b/models/AccountModel.js index <HASH>..<HASH> 100644 --- a/models/AccountModel.js +++ b/models/AccountModel.js @@ -29,6 +29,7 @@ module.exports = function( Model, config ) { }, subDomain: { type: String, + length: 191, required: true, unique: true }
fix(subDomain): Correctly set the max length to the allowed bytes
CleverStack_clever-accounts
train
js
0924ca611e1857ed2152ba9b8446e3490d2667bf
diff --git a/Classes/Plugin/Gridelements.php b/Classes/Plugin/Gridelements.php index <HASH>..<HASH> 100644 --- a/Classes/Plugin/Gridelements.php +++ b/Classes/Plugin/Gridelements.php @@ -186,9 +186,13 @@ class Gridelements extends ContentObjectRenderer { if (is_array($pluginFlexForm) && is_array($pluginFlexForm['data'])) { foreach ($pluginFlexForm['data'] as $sheet => $data) { - foreach ((array)$data as $lang => $value) { - foreach ((array)$value as $key => $val) { - $this->cObj->data['flexform_' . $key] = $this->getFlexFormValue($pluginFlexForm, $key, $sheet); + if(is_array($data)) { + foreach ((array)$data as $lang => $value) { + if (is_array($value)) { + foreach ((array)$value as $key => $val) { + $this->cObj->data['flexform_' . $key] = $this->getFlexFormValue($pluginFlexForm, $key, $sheet); + } + } } } }
[BUGFIX] Check for array before calling foreach Change-Id: Id7af8bc3d<I>e<I>e4fa3c2ece<I> Resolves: #<I> Releases: 7-5-0-compatibility
TYPO3-extensions_gridelements
train
php
3fc73bd5b28b3d430a7f4fbc6f545d0f5b9fa1e7
diff --git a/classes/uix/ui/modal.php b/classes/uix/ui/modal.php index <HASH>..<HASH> 100644 --- a/classes/uix/ui/modal.php +++ b/classes/uix/ui/modal.php @@ -69,6 +69,7 @@ class modal extends panel{ * @return string HTML of rendered box */ public function set_footers(){ + if( !empty( $this->child ) ){ foreach ($this->child as $child_slug=>$child){ if ( in_array($child->type, array('footer') ) ){ @@ -86,7 +87,7 @@ class modal extends panel{ */ public function set_attributes(){ - $this->attributes = array( + $this->attributes += array( 'data-modal' => $this->id(), 'data-content' => '#' . $this->id() . '-tmpl', 'data-margin' => 12,
don't overwrite modals attributes
DavidCramer_uix
train
php
3cbf5f81d813d0f5808b501423b19a100a10089d
diff --git a/aospy/utils.py b/aospy/utils.py index <HASH>..<HASH> 100644 --- a/aospy/utils.py +++ b/aospy/utils.py @@ -2,7 +2,7 @@ import logging import warnings -from infinite_diff import FiniteDiff +from infinite_diff import CenDiff import numpy as np import pandas as pd import xarray as xr @@ -218,7 +218,7 @@ def d_deta_from_pfull(arr): increment by 1 from 0 at the surface upwards. The data to be differenced is assumed to be defined at full pressure levels. """ - deriv = FiniteDiff.cen_diff(arr, PFULL_STR, do_edges_one_sided=True) / 2. + deriv = CenDiff(arr, PFULL_STR, fill_edge=True).diff() / 2. # Edges use 1-sided differencing, so only spanning one level, not two. deriv[{PFULL_STR: 0}] = deriv[{PFULL_STR: 0}] * 2. deriv[{PFULL_STR: -1}] = deriv[{PFULL_STR: -1}] * 2.
MAINT update infinite-diff calls for its new API
spencerahill_aospy
train
py
2773e9c0752b64f1f29f8846661e74711a87d778
diff --git a/code/Controllers/CMSPageHistoryController.php b/code/Controllers/CMSPageHistoryController.php index <HASH>..<HASH> 100644 --- a/code/Controllers/CMSPageHistoryController.php +++ b/code/Controllers/CMSPageHistoryController.php @@ -21,6 +21,11 @@ use SilverStripe\Security\Security; use SilverStripe\View\ArrayData; use SilverStripe\View\ViewableData; +/** + * Legacy CMS History controller. This functionality has been moved to the `silverstripe/versioned-admin` module and + * this class will be removed completly in SilverStripe 5.0.0. + * @deprecated 4.3.0:5.0.0 + */ class CMSPageHistoryController extends CMSMain {
API Deprecate CMSPageHistoryController (#<I>)
silverstripe_silverstripe-cms
train
php
302eef8466cb057255b8ed4c73b910c6a325faaa
diff --git a/lib/fog/compute/hp.rb b/lib/fog/compute/hp.rb index <HASH>..<HASH> 100644 --- a/lib/fog/compute/hp.rb +++ b/lib/fog/compute/hp.rb @@ -26,8 +26,8 @@ module Fog # request :list_addresses # request :list_private_addresses # request :list_public_addresses -# request :list_flavors -# request :list_flavors_detail + request :list_flavors + request :list_flavors_detail request :list_images request :list_images_detail request :list_servers
Enable #list_flavors and #list_flavors_detail services for Nova.
fog_fog
train
rb
ed5e15bd0bc0441b8bceccb0a731a85d84012cdf
diff --git a/girder/api/rest.py b/girder/api/rest.py index <HASH>..<HASH> 100644 --- a/girder/api/rest.py +++ b/girder/api/rest.py @@ -232,7 +232,7 @@ class Resource(ModelImporter): and query params are passed in the info of the before and after events, and the after event also contains the return value in the info. """ - def wrapper(self, *args, **kwargs): + def endpointDecorator(self, *args, **kwargs): try: # First, we should encode any unicode form data down into # UTF-8 so the actual REST classes are always dealing with @@ -305,7 +305,7 @@ class Resource(ModelImporter): 'type': 'internal'} if cherrypy.config['server']['mode'] != 'production': # Unless we are in production mode, send a traceback too - val['trace'] = traceback.extract_tb(tb)[1:] + val['trace'] = traceback.extract_tb(tb) accepts = cherrypy.request.headers.elements('Accept') for accept in accepts: @@ -324,4 +324,4 @@ class Resource(ModelImporter): # outside of the loop body in case no Accept header is passed. cherrypy.response.headers['Content-Type'] = 'application/json' return json.dumps(val, default=str) - return wrapper + return endpointDecorator
Include full stack trace in exceptions from rest endpoints This is to help plugin developers find the source of their errors. Before, we were chopping off the first element of the stack trace, but in certain instances that was causing the stack trace to appear empty.
girder_girder
train
py
8f5efb37a2b61570806022c035f31d4603219651
diff --git a/src/Reflection/Php/UniversalObjectCratesClassReflectionExtension.php b/src/Reflection/Php/UniversalObjectCratesClassReflectionExtension.php index <HASH>..<HASH> 100644 --- a/src/Reflection/Php/UniversalObjectCratesClassReflectionExtension.php +++ b/src/Reflection/Php/UniversalObjectCratesClassReflectionExtension.php @@ -31,10 +31,30 @@ class UniversalObjectCratesClassReflectionExtension public function hasProperty(ClassReflection $classReflection, string $propertyName): bool { - foreach ($this->classes as $className) { - if (!$this->broker->hasClass($className)) { + return self::isUniversalObjectCrate( + $this->broker, + $this->classes, + $classReflection + ); + } + + /** + * @param \PHPStan\Broker\Broker $broker + * @param string[] $classes + * @param \PHPStan\Reflection\ClassReflection $classReflection + * @return bool + */ + public static function isUniversalObjectCrate( + Broker $broker, + array $classes, + ClassReflection $classReflection + ): bool + { + foreach ($classes as $className) { + if (!$broker->hasClass($className)) { continue; } + if ( $classReflection->getName() === $className || $classReflection->isSubclassOf($className)
UniversalObjectCratesClassReflectionExtension - refactored with a public static method
phpstan_phpstan
train
php
89fa351758b20015a291faebf1670fa1fdea9aa0
diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index <HASH>..<HASH> 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -107,9 +107,9 @@ public class XMPPConnection { } private JFrame debugFrame = null; - protected String host; - protected int port; - protected Socket socket; + String host; + int port; + Socket socket; String connectionID; private String user = null; @@ -129,7 +129,7 @@ public class XMPPConnection { /** * Constructor for use by classes extending this one. */ - protected XMPPConnection() { + XMPPConnection() { }
Changed method and constructor from protected to default access to clean up Javadocs. git-svn-id: <URL>
igniterealtime_Smack
train
java
ff60ebd4b3b71665ca5ff7fa2473fda7266e8e71
diff --git a/python/ray/tune/utils/placement_groups.py b/python/ray/tune/utils/placement_groups.py index <HASH>..<HASH> 100644 --- a/python/ray/tune/utils/placement_groups.py +++ b/python/ray/tune/utils/placement_groups.py @@ -508,6 +508,8 @@ class PlacementGroupManager: head_bundle = pg.bundle_specs[0].copy() num_cpus = head_bundle.pop("CPU", 0) num_gpus = head_bundle.pop("GPU", 0) + memory = head_bundle.pop("memory", None) + object_store_memory = head_bundle.pop("object_store_memory", None) # Only custom resources remain in `head_bundle` resources = head_bundle @@ -517,6 +519,8 @@ class PlacementGroupManager: placement_group_capture_child_tasks=True, num_cpus=num_cpus, num_gpus=num_gpus, + memory=memory, + object_store_memory=object_store_memory, resources=resources, ) else:
[tune] Fix memory resources for head bundle (#<I>) Fixes memory and object_store_memory actor options not being set properly for the Tune trainable.
ray-project_ray
train
py
8f1e96c54338f3e7f936fe19df8fd63c225e544b
diff --git a/source/Core/Database/Doctrine.php b/source/Core/Database/Doctrine.php index <HASH>..<HASH> 100644 --- a/source/Core/Database/Doctrine.php +++ b/source/Core/Database/Doctrine.php @@ -156,6 +156,7 @@ class Doctrine extends oxLegacyDb implements DatabaseInterface, LoggerAwareInter */ public function getOne($sqlSelect, $parameters = false, $executeOnSlave = true) { + // @todo: use assureParameterIsAnArray! if (is_bool($parameters)) { $parameters = array(); } @@ -446,6 +447,7 @@ class Doctrine extends oxLegacyDb implements DatabaseInterface, LoggerAwareInter */ public function selectLimit($query, $limit = -1, $offset = -1, $parameters = false, $executeOnSlave = true) { + // @todo: check for security leaks in limit and offset or cast to int or throw exception, if limit/offset are not int! $limitSql = ""; if (-1 !== $limit) { $limitSql = "LIMIT $limit";
ESDEV-<I> Add review todos. (cherry picked from commit d4bb<I>c)
OXID-eSales_oxideshop_ce
train
php
dac8bdea76823d7b64a28bb1326100a5086e0cf0
diff --git a/src/ace/Document.js b/src/ace/Document.js index <HASH>..<HASH> 100644 --- a/src/ace/Document.js +++ b/src/ace/Document.js @@ -132,7 +132,7 @@ var Document = function(text, mode) { this.setBreakpoints = function(rows) { this.$breakpoints = []; - for (var i=0; i<rows; i++) { + for (var i=0; i<rows.length; i++) { this.$breakpoints[rows[i]] = true; } this.$dispatchEvent("changeBreakpoint", {});
fix iteration over breakpoints
joewalker_gcli
train
js
897fc405c3317075c34ca5cb5ce0c716d05d79e6
diff --git a/app/controllers/abstract-edit-controller.js b/app/controllers/abstract-edit-controller.js index <HASH>..<HASH> 100644 --- a/app/controllers/abstract-edit-controller.js +++ b/app/controllers/abstract-edit-controller.js @@ -76,11 +76,7 @@ export default Ember.Controller.extend(EditPanelProps, IsUpdateDisabled, ModalHe _cancelUpdate: function() { var cancelledItem = this.get('model'); - if (cancelledItem.get('isNew')) { - cancelledItem.deleteRecord(); - } else { - cancelledItem.rollbackAttributes(); - } + cancelledItem.rollbackAttributes(); }, actions: {
No longer need deleteRecord on isNew rollbackAttributes automatically deletes a new record
HospitalRun_hospitalrun-frontend
train
js
775994ea2cf17ebc70133514b40c00bb454b52d1
diff --git a/wandb/data_types.py b/wandb/data_types.py index <HASH>..<HASH> 100644 --- a/wandb/data_types.py +++ b/wandb/data_types.py @@ -1559,6 +1559,16 @@ class Image(BatchableMedia): width, height = images[0]._image.size format = jsons[0]["format"] + def size_equals_image(image): + img_width, img_height = image._image.size + return img_width == width and img_height == height + + sizes_match = all(size_equals_image(img) for img in images) + if not sizes_match: + logging.warning( + "Images sizes do not match. This will causes images to be display incorrectly in the UI." + ) + meta = { "_type": "images/separated", "width": width,
Warning message when logging a sequence of images and they don't match in size (#<I>) * Warning message when image sizes dont match
wandb_client
train
py
ea5748b33b31c3235aee6f14664599a420d0bcae
diff --git a/runway/util.py b/runway/util.py index <HASH>..<HASH> 100644 --- a/runway/util.py +++ b/runway/util.py @@ -170,6 +170,11 @@ class MutableMap(six.moves.collections_abc.MutableMapping): # pylint: disable=n return True return False + def __contains__(self, value): + # type: () -> bool + """Implement evaluation of 'in' conditional.""" + return value in self.data + __nonzero__ = __bool__ # python2 compatability def __getitem__(self, key):
fix bug introduced in #<I> (#<I>) * fix bug introduced in #<I> * add __contains__ magic method to support "in" conditionals
onicagroup_runway
train
py
347c09d96675604879f152a447a20b831175e528
diff --git a/lib/rbbt/workflow/definition.rb b/lib/rbbt/workflow/definition.rb index <HASH>..<HASH> 100644 --- a/lib/rbbt/workflow/definition.rb +++ b/lib/rbbt/workflow/definition.rb @@ -71,7 +71,7 @@ module Workflow set_info :result_type, dep.info[:result_type] forget = config :forget_dep_tasks, :forget_dep_tasks, :default => FORGET_DEP_TASKS if forget - Open.ln_h dep.path, self.path + Open.cp dep.path, self.path self.dependencies = self.dependencies - [dep] self.set_info :dependency, dependencies.collect{|dep| [dep.task_name, dep.name, dep.path]} else
Make sure we copy and not link on forget_tasks
mikisvaz_rbbt-util
train
rb
dd73686c4aef95a9904e2b2670d84ad69be8559e
diff --git a/photutils/segmentation/deblend.py b/photutils/segmentation/deblend.py index <HASH>..<HASH> 100644 --- a/photutils/segmentation/deblend.py +++ b/photutils/segmentation/deblend.py @@ -27,11 +27,6 @@ def deblend_sources(data, segment_img, npixels, filter_kernel=None, order to deblend sources, they must be separated enough such that there is a saddle between them. - .. note:: - This function is experimental. Please report any issues on the - `Photutils GitHub issue tracker - <https://github.com/astropy/photutils/issues>`_ - Parameters ---------- data : array_like
Remove note from deblend_sources docs
astropy_photutils
train
py
44c7593d036e336a39e9f96fd8a60d055d66cdd2
diff --git a/prettyprinter/prettyprinter.py b/prettyprinter/prettyprinter.py index <HASH>..<HASH> 100644 --- a/prettyprinter/prettyprinter.py +++ b/prettyprinter/prettyprinter.py @@ -11,6 +11,7 @@ from traceback import format_exception from types import ( FunctionType, BuiltinFunctionType, + ModuleType, ) from weakref import WeakKeyDictionary @@ -1046,9 +1047,18 @@ def pretty_function(fn, ctx): @register_pretty(BuiltinFunctionType) # Also includes bound methods. def pretty_builtin_function(fn, ctx): + try: + cls_inst = fn.__self__ + except Exception: + is_method = False + else: + # Apparently built-in functions like sorted have the builtin Module + # returned from __self__. + is_method = not isinstance(cls_inst, ModuleType) + return comment( general_identifier(fn), - 'built-in bound method' if hasattr(fn, '__self__') + 'built-in bound method' if is_method else 'built-in function' )
Handle built in functions that have a __self__ attribute
tommikaikkonen_prettyprinter
train
py
16214ff2705253c58e7987b6264561a246aa3306
diff --git a/lib/bel/version.rb b/lib/bel/version.rb index <HASH>..<HASH> 100644 --- a/lib/bel/version.rb +++ b/lib/bel/version.rb @@ -1,3 +1,3 @@ module BEL - VERSION = '0.4.0.beta1' + VERSION = '0.4.0.beta.2' end
bumped version to <I>.beta<I> for release
OpenBEL_bel.rb
train
rb
1d05e54279d5a47d7380e80575f2d49c37feb8c3
diff --git a/lib/openscap/ds/arf.rb b/lib/openscap/ds/arf.rb index <HASH>..<HASH> 100644 --- a/lib/openscap/ds/arf.rb +++ b/lib/openscap/ds/arf.rb @@ -42,6 +42,11 @@ module OpenSCAP OpenSCAP::Xccdf::TestResult.new(source) end + def test_result=(tr) + source = tr.source + OpenSCAP.raise! unless OpenSCAP.ds_rds_session_replace_report_with_source(@session, source.raw) == 0 + end + def report_request(id=nil) source_p = OpenSCAP.ds_rds_session_select_report_request(@session, id) source = OpenSCAP::Source.new source_p @@ -62,6 +67,7 @@ module OpenSCAP attach_function :ds_rds_session_new_from_source, [:pointer], :pointer attach_function :ds_rds_session_free, [:pointer], :void attach_function :ds_rds_session_select_report, [:pointer, :string], :pointer + attach_function :ds_rds_session_replace_report_with_source, [:pointer, :pointer], :int attach_function :ds_rds_session_select_report_request, [:pointer, :string], :pointer attach_function :ds_rds_session_get_html_report, [:pointer], :pointer end \ No newline at end of file
Allow the update of test_result within the ARF XML.
OpenSCAP_ruby-openscap
train
rb
c0ff7b9b66ac3e2c4a902744fe2174019bdc7dd6
diff --git a/addr_manager_ds.go b/addr_manager_ds.go index <HASH>..<HASH> 100644 --- a/addr_manager_ds.go +++ b/addr_manager_ds.go @@ -272,8 +272,8 @@ func newTTLManager(parent context.Context, d ds.Datastore, tick time.Duration) * // To be called by TTL manager's coroutine only. func (mgr *ttlmanager) tick() { - mgr.RLock() - defer mgr.RUnlock() + mgr.Lock() + defer mgr.Unlock() now := time.Now() batch, err := mgr.ds.Batch()
Acquire full lock when ticking ttlmanager
libp2p_go-libp2p-peerstore
train
go
d15288efd5965f1297e0528ba06b410bdc52c0d7
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -577,31 +577,6 @@ def cli_bin_dir(tempdir, # ----- Salt Configuration ------------------------------------------------------------------------------------------> [email protected](scope='session') -def session_integration_files_dir(request): - ''' - Fixture which returns the salt integration files directory path. - Creates the directory if it does not yet exist. - ''' - return request.config.startdir.join('tests').join('integration').join('files') - - [email protected](scope='session') -def session_state_tree_root_dir(session_integration_files_dir): - ''' - Fixture which returns the salt state tree root directory path. - Creates the directory if it does not yet exist. - ''' - return session_integration_files_dir.join('file') - - [email protected](scope='session') -def session_pillar_tree_root_dir(session_integration_files_dir): - ''' - Fixture which returns the salt pillar tree root directory path. - Creates the directory if it does not yet exist. - ''' - return session_integration_files_dir.join('pillar') # <---- Salt Configuration -------------------------------------------------------------------------------------------
These fixtures should have not been overridden
saltstack_salt
train
py
0f072e7bcc357c009c3ff95ddcabdd0c48e1a754
diff --git a/lib/plugins/engine.js b/lib/plugins/engine.js index <HASH>..<HASH> 100644 --- a/lib/plugins/engine.js +++ b/lib/plugins/engine.js @@ -69,14 +69,4 @@ module.exports = function (proto) { ext = this.option('view engine'); return this._.engines.getEngine(ext); }; - - - proto.defaultEngine = function (ext) { - var engine = this.getEngine(ext); - if (typeof engine === 'undefined') { - throw new Error('defaultEngine expects "ext" to be a registered engine.'); - } - this._.engines.options.defaultEngine = engine; - return this; - }; }; diff --git a/test/app.engines.js b/test/app.engines.js index <HASH>..<HASH> 100644 --- a/test/app.engines.js +++ b/test/app.engines.js @@ -38,6 +38,11 @@ describe('engine support', function() { assert(hbs.hasOwnProperty('compile')); }); + it('should return undefined if no engine is found:', function () { + var hbs = app.getEngine(); + assert.equal(typeof hbs, 'undefined'); + }); + it('should register multiple engines to the given extension', function () { app.engine(['hbs', 'md'], function () {}); assert(typeof app.engines['.hbs'] === 'object');
engines coverage at <I>%
jonschlinkert_templates
train
js,js
07f06f1ef84153d9686d78bf67a11e9185c53bf6
diff --git a/neo/Prompt/Commands/Invoke.py b/neo/Prompt/Commands/Invoke.py index <HASH>..<HASH> 100644 --- a/neo/Prompt/Commands/Invoke.py +++ b/neo/Prompt/Commands/Invoke.py @@ -30,6 +30,7 @@ from neo.Fixed8 import Fixed8 from neo.Core.Blockchain import Blockchain +from neo.VM.OpCode import * from neo.BigInteger import BigInteger import traceback import pdb @@ -106,9 +107,10 @@ def TestInvokeContract(wallet, args): if type(item) is list: listlength = len(item) - sb.push(listlength) for listitem in item: sb.push(listitem) + sb.push(listlength) + sb.Emit(PACK) else: sb.push(item)
put array length and PACK at end of array
CityOfZion_neo-python
train
py
6327cd4ce4c105fd01763a2d76bc72a1101f77eb
diff --git a/lib/core/webdriver/firefox.js b/lib/core/webdriver/firefox.js index <HASH>..<HASH> 100644 --- a/lib/core/webdriver/firefox.js +++ b/lib/core/webdriver/firefox.js @@ -298,6 +298,10 @@ module.exports.configureBuilder = function(builder, options) { ffOptions.setProxy(proxy.manual(proxySettings)); } + if (firefoxConfig.acceptInsecureCerts) { + builder.getCapabilities().set('acceptInsecureCerts', true); + } + builder.setFirefoxOptions(ffOptions); // ugly hack for geckodriver diff --git a/lib/support/cli.js b/lib/support/cli.js index <HASH>..<HASH> 100644 --- a/lib/support/cli.js +++ b/lib/support/cli.js @@ -196,6 +196,11 @@ module.exports.parseCommandLine = function parseCommandLine() { type: 'boolean', group: 'firefox' }) + .option('firefox.acceptInsecureCerts', { + describe: 'Accept insecure certs', + type: 'boolean', + group: 'firefox' + }) .option('selenium.url', { describe: 'URL to a running Selenium server (e.g. to run a browser on another machine).',
Run Firefox with insecure HTTPS (#<I>)
sitespeedio_browsertime
train
js,js
9bffa19ed64f31603fa2f0a13d2c2cbc4cc4c2f9
diff --git a/spyder/plugins/variableexplorer/widgets/dataframeeditor.py b/spyder/plugins/variableexplorer/widgets/dataframeeditor.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/variableexplorer/widgets/dataframeeditor.py +++ b/spyder/plugins/variableexplorer/widgets/dataframeeditor.py @@ -515,9 +515,20 @@ class DataFrameView(QTableView): name='copy', parent=self) self.horizontalScrollBar().valueChanged.connect( - lambda val: self.load_more_data(val, columns=True)) - self.verticalScrollBar().valueChanged.connect( - lambda val: self.load_more_data(val, rows=True)) + self._load_more_columns) + self.verticalScrollBar().valueChanged.connect(self._load_more_rows) + + def _load_more_columns(self, value): + """Load more columns to display.""" + # Needed to avoid a NameError while fetching data when closing + # See spyder-ide/spyder#12034. + self.load_more_data(value, columns=True) + + def _load_more_rows(self, value): + """Load more rows to display.""" + # Needed to avoid a NameError while fetching data when closing + # See spyder-ide/spyder#12034. + self.load_more_data(value, rows=True) def load_more_data(self, value, rows=False, columns=False): """Load more rows and columns to display."""
Variable Explorer: Don't use lambda to load more data
spyder-ide_spyder
train
py
a854cfb9589325934f51a343c6dff2adf8330c95
diff --git a/meshio/vtk_io.py b/meshio/vtk_io.py index <HASH>..<HASH> 100644 --- a/meshio/vtk_io.py +++ b/meshio/vtk_io.py @@ -362,8 +362,8 @@ def translate_cells(data, offsets, types, cell_data_raw): meshio_type = vtk_to_meshio_type[tpe] n = data[offsets[b[0]]] assert (data[offsets[b]] == n).all() - indices = numpy.array([ - numpy.arange(1, n+1) + o for o in offsets[b] + indices = numpy.column_stack([ + offsets[b] + (i+1) for i in range(n) ]) cells[meshio_type] = data[indices] cell_data[meshio_type] = \
vtk: speed up cell translation
nschloe_meshio
train
py
d12525eb1837c18521e2f77734b9a4cd39b2bfec
diff --git a/examples/ConsumptionSaving/example_ConsRiskyContribModel.py b/examples/ConsumptionSaving/example_ConsRiskyContribModel.py index <HASH>..<HASH> 100644 --- a/examples/ConsumptionSaving/example_ConsRiskyContribModel.py +++ b/examples/ConsumptionSaving/example_ConsRiskyContribModel.py @@ -170,10 +170,13 @@ par_infinite = init_riskyContrib.copy() # And make the problem infinite horizon par_infinite['cycles'] = 0 # and sticky -par_infinite['AjustPrb'] = 0.5 +par_infinite['AdjustPrb'] = 0.5 # and with a withdrawal tax par_infinite['tau'] = 0.1 +par_infinite['DiscreteShareBool'] = True +par_infinite['vFuncBool'] = True + # Create agent and solve it. InfAgent = RiskyContribConsumerType(**par_infinite) print('Now solving infinite horizon version')
Make infinite horizon example discrete and sticky
econ-ark_HARK
train
py
bad30b6ad0ff1a07fa01dc9473ae4bc36a85f53b
diff --git a/src/main/java/uk/org/raje/maven/plugin/msbuild/AbstractMSBuildMojo.java b/src/main/java/uk/org/raje/maven/plugin/msbuild/AbstractMSBuildMojo.java index <HASH>..<HASH> 100644 --- a/src/main/java/uk/org/raje/maven/plugin/msbuild/AbstractMSBuildMojo.java +++ b/src/main/java/uk/org/raje/maven/plugin/msbuild/AbstractMSBuildMojo.java @@ -153,7 +153,6 @@ public abstract class AbstractMSBuildMojo extends AbstractMojo * The set of platforms to build. */ @Parameter( - defaultValue = "Win32", readonly = false, required = false ) protected List<String> platforms; @@ -162,7 +161,6 @@ public abstract class AbstractMSBuildMojo extends AbstractMojo * The set of configurations to build. */ @Parameter( - defaultValue = "Release", readonly = false, required = false ) protected List<String> configurations;
Remove defaultValues from @Parameter annotations for platforms and configurations as this breaks building in 'real' poms. We're unsure why the unit tests were working correctly.
andi12_msbuild-maven-plugin
train
java
c4ab6bd5d69e896a166feb96a13e9eb9b71c6029
diff --git a/tests/test_gnupg.py b/tests/test_gnupg.py index <HASH>..<HASH> 100644 --- a/tests/test_gnupg.py +++ b/tests/test_gnupg.py @@ -692,7 +692,7 @@ authentication.""" else: data = unicode('Hello, André', self.gpg.encoding) data = data.encode(self.gpg.encoding) - encrypted = str(self.gpg.encrypt(data, [gentry])) + encrypted = self.gpg.encrypt(data, gentry) self.assertNotEqual(data, encrypted) self.assertNotEqual(encrypted, '') self.assertGreater(len(encrypted), 0)
Change unittest, recipients don't need to be lists/tuples.
isislovecruft_python-gnupg
train
py
f1ad04ade685fe59eb24adfcbe9b81a240b3302f
diff --git a/demos/descriptive_statistics/descriptive_stats_demo.go b/demos/descriptive_statistics/descriptive_stats_demo.go index <HASH>..<HASH> 100644 --- a/demos/descriptive_statistics/descriptive_stats_demo.go +++ b/demos/descriptive_statistics/descriptive_stats_demo.go @@ -103,7 +103,7 @@ func normalDistributionDemo() { maxTrials := 10000 printEvery := 1000 for i := 0; i <= maxTrials; i++ { - y := stats.RandNormal() + y := rand.NormFloat64() d.Update(y) if i != 0 && i%printEvery == 0 { mean := d.Mean() diff --git a/rand_normal_test.go b/rand_normal_test.go index <HASH>..<HASH> 100644 --- a/rand_normal_test.go +++ b/rand_normal_test.go @@ -11,6 +11,7 @@ package stats import ( "testing" + "rand" ) func TestBoxMullerTransformation(t *testing.T) { @@ -44,4 +45,12 @@ func BenchmarkZiggurat(b *testing.B) { for i := 0; i < b.N; i++ { RandNormalZig() } -} \ No newline at end of file +} + +func BenchmarkNormFloat64(b *testing.B) { + for i := 0; i < b.N; i++ { + rand.NormFloat64() + } +} + +
switched descriptive_stats demo to use rand's NormFloat<I>()
GaryBoone_GoStats
train
go,go
121343c37ad2765b195cf94931b230df65d677ca
diff --git a/src/main/java/com/conveyal/gtfs/validator/MTCValidator.java b/src/main/java/com/conveyal/gtfs/validator/MTCValidator.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/conveyal/gtfs/validator/MTCValidator.java +++ b/src/main/java/com/conveyal/gtfs/validator/MTCValidator.java @@ -25,7 +25,6 @@ public class MTCValidator extends FeedValidator { @Override public void validate() { - // Validate field lengths (agency, stop, trip). for (Agency agency : feed.agencies) { validateFieldLength(agency, agency.agency_id, 50); validateFieldLength(agency, agency.agency_name, 50);
refactor(MTCValidator): Remove extra comment in validate()
conveyal_gtfs-lib
train
java
1718d440fcc6cefdb35933da7a22f91fa0f20634
diff --git a/python/webgme_bindings/webgme_bindings/webgme.py b/python/webgme_bindings/webgme_bindings/webgme.py index <HASH>..<HASH> 100644 --- a/python/webgme_bindings/webgme_bindings/webgme.py +++ b/python/webgme_bindings/webgme_bindings/webgme.py @@ -39,8 +39,8 @@ class WebGME(object): handler.setFormatter(formatter) self.logger.addHandler(handler) - self.logger.warn('No logger passed to WebGME - created console logger at DEBUG level.') - self.logger.warn('Pass a configured logger to the constructor to suppress DEBUG messages.') + self.logger.warning('No logger passed to WebGME - created console logger at DEBUG level.') + self.logger.warning('Pass a configured logger to the constructor to suppress DEBUG messages.') self._socket = zmq.Context().socket(zmq.REQ) if address is None:
Use warning instead of warn since latter is deprecated
webgme_bindings
train
py