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
d418d44c02dd62d9f455e9bdb9579127d40efbf2
diff --git a/src/com/google/javascript/jscomp/CompilerExecutor.java b/src/com/google/javascript/jscomp/CompilerExecutor.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/CompilerExecutor.java +++ b/src/com/google/javascript/jscomp/CompilerExecutor.java @@ -33,7 +33,8 @@ import java.util.concurrent.TimeoutException; class CompilerExecutor { // We use many recursive algorithms that use O(d) memory in the depth // of the tree. - static final long COMPILER_STACK_SIZE = (1 << 25); // About 32MB + // Also, (de)serialization between phases can involve a lot of recursion. + static final long COMPILER_STACK_SIZE = (1 << 26); // About 64MB /** * Use a dedicated compiler thread per Compiler instance.
Increase JSCompiler stack size to avoid stack overflow on really big projects. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
41315cbf3ce085ab3c434bb49d739636adbd3b83
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -9,7 +9,7 @@ if ENV["COVERAGE"] SimpleCov.start do use_merging true add_filter "/test/" - add_filter "/lib/version.rb" + add_filter "/lib/watson_apis/version.rb" track_files "/lib/**/**/*" add_group "lib", "/lib/"
refactor(test coverage): Ignore version file in test coverage
watson-developer-cloud_ruby-sdk
train
rb
38d891fc6c29fa7c503e3b2a58636749868871a6
diff --git a/Phavour/Runnable/View.php b/Phavour/Runnable/View.php index <HASH>..<HASH> 100644 --- a/Phavour/Runnable/View.php +++ b/Phavour/Runnable/View.php @@ -182,6 +182,9 @@ class View */ public function setPackage($package) { + if ($package != $this->package) { + $this->layoutLocation = null; + } $this->package = $this->treatPackageName($package); } @@ -204,10 +207,10 @@ class View } /** - * Set the method name + * Set the script name (usually the method name) * @param string $method */ - public function setMethod($method) + public function setScriptName($method) { $this->method = $method; }
Changes name for view setMethod, as its actually for setting the script name.
phavour_phavour
train
php
3d1caed3e884c7845b9b87960c760c4aa548169e
diff --git a/lib/Studio.js b/lib/Studio.js index <HASH>..<HASH> 100644 --- a/lib/Studio.js +++ b/lib/Studio.js @@ -632,23 +632,21 @@ module.exports = function(controller) { if (err) { return reject(err); } - if(res.statusCode === 401){ - console.error('Invalid Botkit Studio Token'); - reject({error: 'Invalid Botkit Studio Token'}); - } var json = null; try { json = JSON.parse(body); - } catch (e) { } if (!json || json == null) { return reject('Response from Botkit Studio API was empty or invalid JSON'); } else if (json.error) { - return reject(json.error); + if(res.statusCode === 401){ + console.error(json.error); + } + return reject(json.error); } else { resolve(json); }
moved <I> catch into json error catch and pass the error message with it
howdyai_botkit
train
js
094f73a014e8a8a92781613bb907b3dc9571c080
diff --git a/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java b/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java index <HASH>..<HASH> 100755 --- a/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java +++ b/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java @@ -81,6 +81,16 @@ public class OHazelcastPlugin extends ODistributedAbstractPlugin implements Memb public OHazelcastPlugin() { } + // Must be set before startup() is called. + public void setHazelcastConfig(final Config config) { + hazelcastConfig = config; + } + + // Must be set before config() is called. + public void setNodeName(String nodeName) { + this.nodeName = nodeName; + } + @Override public void config(final OServer iServer, final OServerParameterConfiguration[] iParams) { super.config(iServer, iParams);
HA: allowed node name change
orientechnologies_orientdb
train
java
0ad5d2178791cd234b4eafd2e357543f8e639064
diff --git a/src/main/java/org/efaps/ui/wicket/pages/main/MainPage.java b/src/main/java/org/efaps/ui/wicket/pages/main/MainPage.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/efaps/ui/wicket/pages/main/MainPage.java +++ b/src/main/java/org/efaps/ui/wicket/pages/main/MainPage.java @@ -448,7 +448,7 @@ public class MainPage .append("top.document['eFapsCallHome'] = function() {\n") .append("var lastCall = top.document['eFapsCallHomeTime'];\n") .append("if (lastCall) { \n") - .append("if ((new Date().getTime() - lastCall) > (5 * 60 * 1000)) {\n") + .append("if ((new Date().getTime() - lastCall) > (2 * 60 * 1000)) {\n") .append(getCallbackFunctionBody()) .append("}\n") .append("} else {\n") @@ -469,6 +469,8 @@ public class MainPage protected void respond(final AjaxRequestTarget _target) { _target.appendJavaScript("top.document['eFapsCallHomeTime'] = new Date().getTime();"); + // touch the page to ensure that the pagemanager stores it to be accessible + getSession().getPageManager().touchPage(getPage()); } } }
- test to prevent the timeout effect for the main page
eFaps_eFaps-WebApp
train
java
888d3c3876e92c761b59a808ff654c98fb0503fe
diff --git a/src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java @@ -111,11 +111,7 @@ public class SearchResourcesImpl extends AbstractResources implements SearchReso parameters.put("modifiedSince", isoDate); } parameters.put("scopes", QueryUtil.generateCommaSeparatedList(scopes)); - try { - parameters.put("query", URLEncoder.encode(query, "utf-8")); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } + parameters.put("query", query); // Iterate through the map of parameters and generate the query string path += QueryUtil.generateUrl(null, parameters);
fix: fix the double encoding of search terms
smartsheet-platform_smartsheet-java-sdk
train
java
8c44fefaa642fbe5e4b7874c3c8098eec82c23a2
diff --git a/src/djangoprojectrecipe/manage.py b/src/djangoprojectrecipe/manage.py index <HASH>..<HASH> 100644 --- a/src/djangoprojectrecipe/manage.py +++ b/src/djangoprojectrecipe/manage.py @@ -13,4 +13,6 @@ def main(settings_file): % (settings_file, e)) return sys.exit(1) - management.execute_manager(mod) + management.setup_environ(mod, settings_file) + utility = management.ManagementUtility() + utility.execute()
made project execution more robust by providing django with the original path to the settings module
stefanfoulis_djangoprojectrecipe
train
py
cae0764f2cbb8d00de1832079e55b8e4d45f55f2
diff --git a/phylotoast/otu_calc.py b/phylotoast/otu_calc.py index <HASH>..<HASH> 100755 --- a/phylotoast/otu_calc.py +++ b/phylotoast/otu_calc.py @@ -28,7 +28,10 @@ def otu_name(tax): elif lvl.startswith("g"): return "{}_{}".format(extract_name(lvl), spname) else: - return "Unclassified_{}".format(extract_name(lvl)) + if spname != "spp.": + return spname + else: + return "Unclassified_{}".format(extract_name(lvl)) def load_core_file(core_fp): """
Fix for short OTU name when there is a species but no genus or higher Some organisms have entries in the species level but no genus name or sometimes higher (e.g. many viruses, TM7). In those cases, just return the species name instead of the less informative highest group name.
smdabdoub_phylotoast
train
py
356eed66f5befce356551a589a9f4bf65d9f52ec
diff --git a/test/test_database.py b/test/test_database.py index <HASH>..<HASH> 100644 --- a/test/test_database.py +++ b/test/test_database.py @@ -721,6 +721,7 @@ class TestDatabase(IntegrationTest): projection={"_id": False})) @client_context.require_no_auth + @client_context.require_version_max(4, 1, 0) def test_eval(self): db = self.client.pymongo_test db.test.drop() @@ -824,6 +825,7 @@ class TestDatabase(IntegrationTest): self.assertFalse(db.test.find_one()) @client_context.require_no_auth + @client_context.require_version_max(4, 1, 0) def test_system_js(self): db = self.client.pymongo_test db.system.js.delete_many({})
PYTHON-<I> - Stop testing eval and SystemJS with MongoDB <I>+
mongodb_mongo-python-driver
train
py
f47eddc50b548c3445880be67a1012f27f2e0768
diff --git a/app/lib/Core/Repository/Content.php b/app/lib/Core/Repository/Content.php index <HASH>..<HASH> 100755 --- a/app/lib/Core/Repository/Content.php +++ b/app/lib/Core/Repository/Content.php @@ -20,7 +20,7 @@ class Content extends Repository public function query(array $criteria = array(), $sort = null, $limit = null, $offset = null) { - $query = parent::query($criteria, $sort, $limit, $offset); + $query = parent::query($criteria, $sort ?: ['modifyDate', 'DESC'], $limit, $offset); $criteria = $criteria + [ 'master' => null,
Ensure content has default sorting.
jacksleight_chalk
train
php
d6e02dc0d1e3e9663eccac9f60d09020144f0dcb
diff --git a/airflow/configuration.py b/airflow/configuration.py index <HASH>..<HASH> 100644 --- a/airflow/configuration.py +++ b/airflow/configuration.py @@ -242,7 +242,7 @@ class AirflowConfigParser(ConfigParser): if StrictVersion(sqlite3.sqlite_version) < StrictVersion(min_sqlite_version): raise AirflowConfigException( f"error: sqlite C library version too old (< {min_sqlite_version}). " - f"See {get_docs_url('howto/set-up-database.rst#setting-up-a-sqlite-database')}" + f"See {get_docs_url('howto/set-up-database.html#setting-up-a-sqlite-database')}" ) if self.has_option('core', 'mp_start_method'):
Fix docs link for using SQLite as Metadata DB (#<I>) Identified the issue in: <URL>
apache_airflow
train
py
7efa946b02e14a88e612ddcbfa7ee42a16df55b9
diff --git a/internal/route/install.go b/internal/route/install.go index <HASH>..<HASH> 100644 --- a/internal/route/install.go +++ b/internal/route/install.go @@ -41,6 +41,7 @@ func checkRunMode() { if conf.IsProdMode() { macaron.Env = macaron.PROD macaron.ColorLog = false + git.Debug = false } else { git.Debug = true }
git: explicitly disable debug in prod mode (#<I>) After first time running the application and went through the installation, the flag was always true until restarted.
gogs_gogs
train
go
8f8d8eb1465069e2ed9b6f2404aa9d02e785f534
diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionpack/lib/action_view/helpers/debug_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/debug_helper.rb +++ b/actionpack/lib/action_view/helpers/debug_helper.rb @@ -4,6 +4,9 @@ module ActionView # Provides a set of methods for making it easier to debug Rails objects. module Helpers module DebugHelper + + include TagHelper + # Returns a YAML representation of +object+ wrapped with <pre> and </pre>. # If the object cannot be converted to YAML using +to_yaml+, +inspect+ will be called instead. # Useful for inspecting an object at the time of rendering. @@ -26,10 +29,11 @@ module ActionView def debug(object) begin Marshal::dump(object) - "<pre class='debug_dump'>#{h(object.to_yaml).gsub(" ", "&nbsp; ")}</pre>".html_safe + object = ERB::Util.html_escape(object.to_yaml).gsub(" ", "&nbsp; ").html_safe + content_tag(:pre, object, :class => "debug_dump") rescue Exception # errors from Marshal or YAML # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback - "<code class='debug_dump'>#{h(object.inspect)}</code>".html_safe + content_tag(:code, object.to_yaml, :class => "debug_dump") end end end
Use content_tag here instead of manually building HTML
rails_rails
train
rb
99428453a7938c8351e2d67394edeb4270c6dffb
diff --git a/abilian/web/forms/fields.py b/abilian/web/forms/fields.py index <HASH>..<HASH> 100644 --- a/abilian/web/forms/fields.py +++ b/abilian/web/forms/fields.py @@ -399,6 +399,8 @@ class DateField(Field): except ValueError: self.data = None raise ValueError(self.gettext('Not a valid datetime value')) + else: + self.data = None class Select2Field(SelectField):
Date fields can be set to none.
abilian_abilian-core
train
py
a9116fda72f967b69810c5d860632ce32e6a55ac
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,7 @@ class DomInspector { destroy() { this.destroyed = true; this.disable(); - this.overlay.remove(); + this.overlay = {}; } getXPath(ele) { if (!isDOM(ele) && !this.target) return logger.warn('Target element is not found. Warning function name:%c getXPath', 'color: #ff5151');
Change the way overlay get destroyed. Needs testing but in my case original statement this.overlay.remove() causing error in console: No .remove() method exists....
luoye-fe_dom-inspector
train
js
ff774ce3181c0b1f6b7dbbc373ab6db92a65b004
diff --git a/malcolm/_version_git.py b/malcolm/_version_git.py index <HASH>..<HASH> 100644 --- a/malcolm/_version_git.py +++ b/malcolm/_version_git.py @@ -1,7 +1,7 @@ # Compute a version number from a git repo or archive # This file is released into the public domain. Generated by: -# versiongit-0.1+29.ab45098 (https://github.com/dls-controls/versiongit) +# versiongit-0.1+30.998d12d (https://github.com/dls-controls/versiongit) import os import re from subprocess import check_output, CalledProcessError, STDOUT @@ -62,6 +62,8 @@ def get_cmdclass(build_py=None, sdist=None): from setuptools.command.sdist import sdist def make_version_static(base_dir, pkg): + # Only place _version_static in the root directory of a module + pkg = pkg.split(".")[0] with open(os.path.join(base_dir, pkg, "_version_static.py"), "w") as f: f.write("__version__ = %r\n" % __version__)
Fix _version_static placement in only the root package
dls-controls_pymalcolm
train
py
e8bc21b7610822e90e7ede62db0f1ed9fea3e07d
diff --git a/lib/inventory_refresh/version.rb b/lib/inventory_refresh/version.rb index <HASH>..<HASH> 100644 --- a/lib/inventory_refresh/version.rb +++ b/lib/inventory_refresh/version.rb @@ -1,3 +1,3 @@ module InventoryRefresh - VERSION = "1.0.0".freeze + VERSION = "1.1.0".freeze end
Release <I> Added - Ruby 3 support (#<I>) - Cron for GitHub Actions (#<I>)
ManageIQ_inventory_refresh
train
rb
9e3224006d06abd3e32c91f3bd8f3c579b5f67f5
diff --git a/lib/rib/runner.rb b/lib/rib/runner.rb index <HASH>..<HASH> 100644 --- a/lib/rib/runner.rb +++ b/lib/rib/runner.rb @@ -76,20 +76,17 @@ module Rib::Runner loop end - def loop - retry_times = 5 - begin - Rib.shell.loop - rescue Exception => e - if retry_times <= 0 - Rib.warn("Error: #{e}. Too many retries, give up.") - else - Rib.warn("Error: #{e}. Relaunching a new shell... ##{retry_times}") - Rib.shells.pop - Rib.shells << Rib::Shell.new(Rib.config) - retry_times -= 1 - retry - end + def loop retry_times=5 + Rib.shell.loop + rescue Exception => e + if retry_times <= 0 + Rib.warn("Error: #{e}. Too many retries, give up.") + else + Rib.warn("Error: #{e}. Relaunching a new shell... ##{retry_times}") + Rib.shells.pop + Rib.shells << Rib::Shell.new(Rib.config) + retry_times -= 1 + retry end end
runner.rb: looks better and you can pass the argument
godfat_rib
train
rb
e7325eda105196396484efd73bfca33f7a1e277b
diff --git a/hugo-runtime/src/main/java/hugo/weaving/internal/Hugo.java b/hugo-runtime/src/main/java/hugo/weaving/internal/Hugo.java index <HASH>..<HASH> 100644 --- a/hugo-runtime/src/main/java/hugo/weaving/internal/Hugo.java +++ b/hugo-runtime/src/main/java/hugo/weaving/internal/Hugo.java @@ -59,7 +59,7 @@ public class Hugo { builder.append(" @Thread:").append(Thread.currentThread().getName()); } - Log.d(asTag(cls), builder.toString()); + Log.v(asTag(cls), builder.toString()); } private static void popMethod(JoinPoint joinPoint, Object result, long lengthMillis) {
Both push and pop should log verbose.
JakeWharton_hugo
train
java
ea499bc62a67acb654df6651e983128780344d69
diff --git a/test/xccdf/session_test.rb b/test/xccdf/session_test.rb index <HASH>..<HASH> 100644 --- a/test/xccdf/session_test.rb +++ b/test/xccdf/session_test.rb @@ -30,11 +30,13 @@ class TestSession < Test::Unit::TestCase s.evaluate end - def test_session_export + def test_session_export_rds s = OpenSCAP::Xccdf::Session.new("../data/sds-complex.xml") s.load s.evaluate s.export_results(rds_file="report.rds.xml") + assert Dir.glob("*").size == 1 + assert Dir.glob("*").include?("report.rds.xml") end def setup
test: Make sure only the expected file got created
OpenSCAP_ruby-openscap
train
rb
2035bc8a44996a59c88f665aaf9894de5b3d6ccf
diff --git a/tests/integration/states/test_file.py b/tests/integration/states/test_file.py index <HASH>..<HASH> 100644 --- a/tests/integration/states/test_file.py +++ b/tests/integration/states/test_file.py @@ -1185,8 +1185,8 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin): source='salt://соль') self.assertSaltTrueReturn(ret) self.assertEqual( - sorted(salt.utils.data.decode(os.listdir(name))), - sorted(['foo.txt', 'спам.txt', 'яйца.txt']) + sorted(salt.utils.data.decode(os.listdir(name), normalize=True)), + sorted(['foo.txt', 'спам.txt', 'яйца.txt']), ) finally: shutil.rmtree(name, ignore_errors=True)
Use unicode normalization to make test work on MacOS
saltstack_salt
train
py
4acd24d17b3adea6d4b5406260aee2569bc51d6c
diff --git a/packages/vuetify/src/mixins/menuable.js b/packages/vuetify/src/mixins/menuable.js index <HASH>..<HASH> 100644 --- a/packages/vuetify/src/mixins/menuable.js +++ b/packages/vuetify/src/mixins/menuable.js @@ -200,7 +200,7 @@ export default Vue.extend({ if (left < 0) left = 12 - return left + return left + this.getOffsetLeft() }, calcYOverflow (top) { const documentHeight = this.getInnerHeight() @@ -276,6 +276,12 @@ export default Vue.extend({ return window.innerWidth }, + getOffsetLeft () { + if (!this.hasWindow) return 0 + + return window.pageXOffset || + document.documentElement.scrollLeft + }, getOffsetTop () { if (!this.hasWindow) return 0
fix(v-menu): position problem with horizontal scrolling (#<I>) * add scrollX for measuring rect * add getOffsetLeft(), move the logic from measure() to calcXOverflow()
vuetifyjs_vuetify
train
js
107c84b62e8634eb16801e96fde8cfad6450dd93
diff --git a/src/event/eventFabric.js b/src/event/eventFabric.js index <HASH>..<HASH> 100644 --- a/src/event/eventFabric.js +++ b/src/event/eventFabric.js @@ -124,10 +124,11 @@ function filterEvent<A, B>( linkGraphs({ from: event.graphite, to: createGraph({ + val: {fn}, node: [ cmd('compute', { fn(newValue, scope) { - return fn(newValue) + return scope.fn(newValue) }, }), cmd('filter', {
put filter's fn to local scope
zerobias_effector
train
js
5d20c0a64aafa4d35f5aa0613cc16170c2a2ec03
diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb index <HASH>..<HASH> 100644 --- a/activemodel/lib/active_model/observing.rb +++ b/activemodel/lib/active_model/observing.rb @@ -76,7 +76,11 @@ module ActiveModel elsif observer.respond_to?(:instance) observer.instance else - raise ArgumentError, "#{observer} must be a lowercase, underscored class name (or an instance of the class itself) responding to the instance method. Example: Person.observers = :big_brother # calls BigBrother.instance" + raise ArgumentError, + "#{observer} must be a lowercase, underscored class name (or an " + + "instance of the class itself) responding to the instance " + + "method. Example: Person.observers = :big_brother # calls " + + "BigBrother.instance" end end
Wrap line that is over <I> characters long. Now it's much easier to read.
rails_rails
train
rb
6c6393d08d4aef77e4fa4332f3d654b79f87b428
diff --git a/src/config.js b/src/config.js index <HASH>..<HASH> 100644 --- a/src/config.js +++ b/src/config.js @@ -43,11 +43,12 @@ class Config { version, language: 'JS' } - const defaultStorage = - storage_type === 'cookies' + + this.storage = + storage || + (storage_type === 'cookies' ? new SecureCookiesStorageFactory() - : new LocalStorageFactory() - this.storage = storage || defaultStorage + : new LocalStorageFactory()) this.custom_authenticator = custom_authenticator this.headers = headers || {} this.disableCart = disableCart || false
fix: storage usage in config updated to omit useless creation (#<I>) * fix: storage usage in config updated to omit useless creation * fix: storage set condition updated
moltin_js-sdk
train
js
fadf11690c7f7690fc8783118345302d94383afb
diff --git a/tests/rkt_image_dependencies_test.go b/tests/rkt_image_dependencies_test.go index <HASH>..<HASH> 100644 --- a/tests/rkt_image_dependencies_test.go +++ b/tests/rkt_image_dependencies_test.go @@ -180,11 +180,11 @@ func TestImageDependencies(t *testing.T) { child := spawnOrFail(t, runCmd) expectedList := []string{ - "rkt: fetching image from https://localhost/localhost/image-a.aci", - "rkt: using image from local store for image name localhost/image-b", - "rkt: fetching image from https://localhost/localhost/image-c.aci", - "rkt: fetching image from https://localhost/localhost/image-d.aci", - "rkt: using image from local store for image name coreos.com/rkt-inspect", + "image: fetching image from https://localhost/localhost/image-a.aci", + "image: using image from local store for image name localhost/image-b", + "image: fetching image from https://localhost/localhost/image-c.aci", + "image: fetching image from https://localhost/localhost/image-d.aci", + "image: using image from local store for image name coreos.com/rkt-inspect", "HelloDependencies", }
tests: update prefix in image test matches
rkt_rkt
train
go
2c8908e445b4c8988f97bf5e652d890add0c0980
diff --git a/mpd/asyncio.py b/mpd/asyncio.py index <HASH>..<HASH> 100644 --- a/mpd/asyncio.py +++ b/mpd/asyncio.py @@ -134,6 +134,7 @@ class MPDClient(MPDClientBase): self.__run_task.cancel() if self.__idle_task is not None: self.__idle_task.cancel() + self.__wfile.close() self.__rfile = self.__wfile = None self.__run_task = self.__idle_task = None self.__commandqueue = self.__command_enqueued = None
Close transport on asyncio client disconnect The current disconnect method of asyncio.MPDClient does not close the writing transport. A warning for this is issued when running the python3 interpreter with -Wdefault. As a result, the MPD server keeps alive the connection to the client unnecessarily. If this happens repeatedly, the dangling connections may cause the MPD server to reach its maximal connection limit.
Mic92_python-mpd2
train
py
f8ae7503c566f615bf39b83ad16d5e6261dc2b7b
diff --git a/salt/loader.py b/salt/loader.py index <HASH>..<HASH> 100644 --- a/salt/loader.py +++ b/salt/loader.py @@ -125,6 +125,19 @@ def minion_mods( pack={'__context__': context}, whitelist=whitelist, loaded_base_name=loaded_base_name) + + # Load any provider overrides from the configuration file providers option + # Note: Providers can be pkg, service, user or group - not to be confused + # with cloud providers. + if opts.get('providers', False): + providers = opts.get('providers', False) + for mod in providers: + funcs = raw_mod(opts, providers[mod], ret.items()) + if funcs: + for func in funcs: + f_key = '{0}{1}'.format(mod, func[func.rindex('.'):]) + ret[f_key] = funcs[func] + ret.pack['__salt__'] = ret return ret
Reinstate minion config provider override as per doco
saltstack_salt
train
py
6b04f2d764ccfb58f0a357b42a39af78ba691de1
diff --git a/nifstd/nifstd_tools/ontree.py b/nifstd/nifstd_tools/ontree.py index <HASH>..<HASH> 100755 --- a/nifstd/nifstd_tools/ontree.py +++ b/nifstd/nifstd_tools/ontree.py @@ -709,7 +709,7 @@ def main(): sgc.api_key = api_key scs = OntTerm.query.services[0] scs.api_key = api_key - scs.setup() + scs.setup(instrumented=OntTerm) app = server(verbose=verbose) app.debug = False
ontree key pass instrumented to setup
tgbugs_pyontutils
train
py
08bd292ed4d77b4f2a3c29ca54a6dee505de48af
diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index <HASH>..<HASH> 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -134,7 +134,7 @@ class Resolver(object): ''' def __init__(self, opts): self.opts = opts - self.loadauth = LoadAuth(opts) + self.auth = salt.loader.auth(opts) def cli(self, eauth): ''' @@ -146,12 +146,12 @@ class Resolver(object): print 'External authentication system has not been specified' return ret fstr = '{0}.auth'.format(eauth) - if not fstr in self.loadauth: + if not fstr in self.auth: print ('The specified external authentication system "{0}" is ' 'not available').format(eauth) return ret - args = salt.utils.arg_lookup(self.loadauth[fstr]) + args = salt.utils.arg_lookup(self.auth[fstr]) for arg in args['args']: if arg.startswith('pass'): ret[arg] = getpass.getpass('{0}: '.format(arg))
Use the loader, not the loadauth class
saltstack_salt
train
py
941245ce2eb47094b53ded32ef4f85076f26a471
diff --git a/app/forms/backend/navigation_item_translation_form.rb b/app/forms/backend/navigation_item_translation_form.rb index <HASH>..<HASH> 100644 --- a/app/forms/backend/navigation_item_translation_form.rb +++ b/app/forms/backend/navigation_item_translation_form.rb @@ -25,6 +25,6 @@ class Backend::NavigationItemTranslationForm < Udongo::Form def save_object init_object_values(@translation) - @translation.save + @navigation_item.save end end diff --git a/app/forms/backend/page_translation_form.rb b/app/forms/backend/page_translation_form.rb index <HASH>..<HASH> 100644 --- a/app/forms/backend/page_translation_form.rb +++ b/app/forms/backend/page_translation_form.rb @@ -60,13 +60,14 @@ class Backend::PageTranslationForm < Udongo::Form def save_object @translation.title = title @translation.subtitle = subtitle - @translation.save @seo.title = seo_title @seo.keywords = seo_keywords @seo.description = seo_description @seo.custom = seo_custom @seo.slug = seo_slug - @seo.save + + # Saves the page, translation and SEO info all at once. + @page.save end end
Make sure to save the parent object instead of the translation.
udongo_udongo
train
rb,rb
88a27d35b5e92269fc273bd81ec4ac53355ab71e
diff --git a/src/configure-store.js b/src/configure-store.js index <HASH>..<HASH> 100644 --- a/src/configure-store.js +++ b/src/configure-store.js @@ -5,7 +5,7 @@ import { ADD_NOTIFICATION, REMOVE_NOTIFICATION, } from '@commercetools-local/notifications'; -import { middleware as sdkMiddleware } from '@commercetools-local/sdk'; +import { createMiddleware as createSdkMiddleware } from '@commercetools-local/sdk'; import * as constants from '@commercetools-local/constants'; import addPluginToNotificationMiddleware from './middleware/add-plugin-to-notification'; import batchedUpdates from './middleware/batched-updates'; @@ -17,6 +17,12 @@ import sentryTrackingMiddleware from './middleware/sentry-tracking'; import { activePluginReducer } from './components/inject-reducer'; import { requestsInFlightReducer } from './components/requests-in-flight-loader'; import { notificationsReducer } from './components/notifications-connector'; +import { getCorrelationId, selectProjectKey } from './utils'; + +const sdkMiddleware = createSdkMiddleware({ + getCorrelationId, + projectKey: selectProjectKey(), +}); const createReducer = (injectedReducers = {}) => combineReducers({
refactor(app-shell): configure-store to create sdk middleware
commercetools_merchant-center-application-kit
train
js
c8d8726c99ff7724d8c0f5962010529f86581afe
diff --git a/lib/hirb.rb b/lib/hirb.rb index <HASH>..<HASH> 100644 --- a/lib/hirb.rb +++ b/lib/hirb.rb @@ -39,10 +39,11 @@ module Hirb def disable View.disable end + # Default is config/hirb.yml or ~/hirb.yml in that order. def config_file @config_file ||= File.exists?('config/hirb.yml') ? 'config/hirb.yml' : - File.expand_path(File.join(ENV["HOME"] || ".", ".hirb.yml")) + File.join(Util.find_home, ".hirb.yml") end #:stopdoc: diff --git a/lib/hirb/util.rb b/lib/hirb/util.rb index <HASH>..<HASH> 100644 --- a/lib/hirb/util.rb +++ b/lib/hirb/util.rb @@ -81,5 +81,14 @@ module Hirb end fake.string end + + # From Rubygems, determine a user's home. + def find_home + ['HOME', 'USERPROFILE'].each {|e| return ENV[e] if ENV[e] } + return "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] + File.expand_path("~") + rescue + File::ALT_SEPARATOR ? "C:/" : "/" + end end end \ No newline at end of file
more cross platform way of finding user's home
cldwalker_hirb
train
rb,rb
79196c3df13906c0221a9f0b4e2bab9c0c25825e
diff --git a/src/core/services/gesture/gesture.js b/src/core/services/gesture/gesture.js index <HASH>..<HASH> 100644 --- a/src/core/services/gesture/gesture.js +++ b/src/core/services/gesture/gesture.js @@ -16,8 +16,7 @@ document.contains || (document.contains = function(node) { document.addEventListener('click', function(ev) { // Space/enter on a button, and submit events, can send clicks - var isKeyClick = ev.clientX === 0 && ev.clientY === 0 && - ev.x === 0 && ev.y === 0; + var isKeyClick = ev.clientX === 0 && ev.clientY === 0; if (isKeyClick || ev.$material) return; // Prevent clicks unless they're sent by material
amend(gesture): fix firefox keyboard events
angular_material
train
js
a5586e0711b473f17fc1746c95524f1607df2f08
diff --git a/lib/punchblock/translator/asterisk/component/composed_prompt.rb b/lib/punchblock/translator/asterisk/component/composed_prompt.rb index <HASH>..<HASH> 100644 --- a/lib/punchblock/translator/asterisk/component/composed_prompt.rb +++ b/lib/punchblock/translator/asterisk/component/composed_prompt.rb @@ -28,8 +28,6 @@ module Punchblock register_dtmf_event_handler start_timers - rescue => e - pb_logger.error e end def process_dtmf(digit)
[CS] Shouldn't be swallowing these failures
adhearsion_punchblock
train
rb
a0f41d0c2b212ce87b0fa5a28a101e97c34a81d5
diff --git a/src/Event/Latte/TemplateCreateEvent.php b/src/Event/Latte/TemplateCreateEvent.php index <HASH>..<HASH> 100644 --- a/src/Event/Latte/TemplateCreateEvent.php +++ b/src/Event/Latte/TemplateCreateEvent.php @@ -2,7 +2,6 @@ namespace Contributte\Events\Extra\Event\Latte; -use Nette\Application\UI\Control; use Nette\Bridges\ApplicationLatte\Template; use Symfony\Component\EventDispatcher\Event; @@ -14,13 +13,9 @@ class TemplateCreateEvent extends Event /** @var Template */ private $template; - /**@var Control */ - private $control; - - public function __construct(Template $template, Control $control) + public function __construct(Template $template) { $this->template = $template; - $this->control = $control; } public function getTemplate(): Template @@ -28,8 +23,4 @@ class TemplateCreateEvent extends Event return $this->template; } - public function getControl(): Control - { - return $this->control; - } }
Removed erroneously added Control
contributte_event-dispatcher-extra
train
php
e0989545eddaf97635edee6898ef79be3edf0ca7
diff --git a/src/tile_source.js b/src/tile_source.js index <HASH>..<HASH> 100644 --- a/src/tile_source.js +++ b/src/tile_source.js @@ -30,6 +30,7 @@ export default class TileSource { buildAsMessage() { return { + type: this.type, url: this.url_template, max_zoom: this.max_zoom }; @@ -166,6 +167,7 @@ export class GeoJSONTileSource extends NetworkTileSource { constructor (source) { super(source); + this.type = 'GeoJSONTileSource'; } parseTile (tile, response) { @@ -183,6 +185,7 @@ export class TopoJSONTileSource extends NetworkTileSource { constructor (source) { super(source); + this.type = 'TopoJSONTileSource'; // Loads TopoJSON library from official D3 source on demand // Not including in base library to avoid the extra weight @@ -231,6 +234,7 @@ export class MapboxFormatTileSource extends NetworkTileSource { constructor (source) { super(source); + this.type = 'MapboxFormatTileSource'; this.response_type = "arraybuffer"; // binary data this.Protobuf = require('pbf'); this.VectorTile = require('vector-tile').VectorTile; // Mapbox vector tile lib, forked to add GeoJSON output
set tile source type property so it gets propagated to worker
tangrams_tangram
train
js
19800d546541b91b6ae82e61e62f781dd9571968
diff --git a/tests/Doctrine/Tests/ODM/PHPCR/Functional/HierarchyTest.php b/tests/Doctrine/Tests/ODM/PHPCR/Functional/HierarchyTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/ODM/PHPCR/Functional/HierarchyTest.php +++ b/tests/Doctrine/Tests/ODM/PHPCR/Functional/HierarchyTest.php @@ -72,16 +72,6 @@ class HierarchyTest extends \Doctrine\Tests\ODM\PHPCR\PHPCRFunctionalTestCase /** * @expectedException Doctrine\ODM\PHPCR\PHPCRException */ - public function testNodenameChangeException() - { - $doc = $this->dm->find($this->type, '/functional/thename'); - $doc->nodename = 'x'; - $this->dm->flush(); - } - - /** - * @expectedException Doctrine\ODM\PHPCR\PHPCRException - */ public function testParentChangeException() { $doc = $this->dm->find($this->type, '/functional/thename');
removing test that expected the exception on nodename change
doctrine_phpcr-odm
train
php
1b328d1af003c404c3646e57428ef9a587cb6fc1
diff --git a/lib/dependencies/SystemPlugin.js b/lib/dependencies/SystemPlugin.js index <HASH>..<HASH> 100644 --- a/lib/dependencies/SystemPlugin.js +++ b/lib/dependencies/SystemPlugin.js @@ -26,9 +26,6 @@ class SystemPlugin { ); } - parser.plugin("typeof System", ParserHelpers.toConstantDependency(JSON.stringify("object"))); - parser.plugin("evaluate typeof System", ParserHelpers.evaluateToString("object")); - parser.plugin("typeof System.import", ParserHelpers.toConstantDependency(JSON.stringify("function"))); parser.plugin("evaluate typeof System.import", ParserHelpers.evaluateToString("function"));
we can no longer evaluate the typeof to System as this would break the polyfill
webpack_webpack
train
js
3661dd4db99237c2e17c0e5cb058933e783080ad
diff --git a/grails-bootstrap/src/main/groovy/grails/util/Environment.java b/grails-bootstrap/src/main/groovy/grails/util/Environment.java index <HASH>..<HASH> 100644 --- a/grails-bootstrap/src/main/groovy/grails/util/Environment.java +++ b/grails-bootstrap/src/main/groovy/grails/util/Environment.java @@ -94,7 +94,8 @@ public enum Environment { Metadata metadata = Metadata.getCurrent(); if(metadata != null) { envName = metadata.getEnvironment(); - } else { + } + if(isBlank(envName)) { return DEVELOPMENT; } }
Fix to previous Environment optimization (works for tests too)
grails_grails-core
train
java
528bb3afd92cc0f93a0a8308713186adc9815727
diff --git a/python/ray/autoscaler/gcp/config.py b/python/ray/autoscaler/gcp/config.py index <HASH>..<HASH> 100644 --- a/python/ray/autoscaler/gcp/config.py +++ b/python/ray/autoscaler/gcp/config.py @@ -267,6 +267,12 @@ def _configure_key_pair(config): def _configure_subnet(config): """Pick a reasonable subnet if not specified by the config.""" + # Rationale: avoid subnet lookup if the network is already + # completely manually configured + if ("networkInterfaces" in config["head_node"] + and "networkInterfaces" in config["worker_nodes"]): + return config + subnets = _list_subnets(config) if not subnets:
gcp allow manual network configuration (#<I>)
ray-project_ray
train
py
8665768523f0afa057a485a7b0194c4b71e3a627
diff --git a/openstack_dashboard/test/settings.py b/openstack_dashboard/test/settings.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/test/settings.py +++ b/openstack_dashboard/test/settings.py @@ -151,6 +151,10 @@ LOGGING['loggers'].update( 'handlers': ['test'], 'propagate': False, }, + 'openstack_auth': { + 'handlers': ['test'], + 'propagate': False, + }, 'novaclient': { 'handlers': ['test'], 'propagate': False,
Add logging handler for openstack_auth in the tests Without it, log output below ERROR level can also be displayed in the tests output. Change-Id: I<I>b<I>fc<I>a<I>f<I>db3e<I>b<I>c Closes-Bug: #<I>
openstack_horizon
train
py
a9a56fa09968548c0854173f6feeffe65bdd0290
diff --git a/holoviews/core/element.py b/holoviews/core/element.py index <HASH>..<HASH> 100644 --- a/holoviews/core/element.py +++ b/holoviews/core/element.py @@ -296,7 +296,7 @@ class HoloMap(UniformNdMapping): overlays items in the split out Maps. """ dimensions = self._valid_dimensions(dimensions) - if self.ndims == 1: + if len(dimensions) == self.ndims: return NdOverlay(self, **kwargs) else: dims = [d for d in self._cached_index_names @@ -310,7 +310,7 @@ class HoloMap(UniformNdMapping): Views along these axes in a GridSpace. """ dimensions = self._valid_dimensions(dimensions) - if self.ndims == 1: + if len(dimensions) == self.ndims: return GridSpace(self, **kwargs) return self.groupby(dimensions, container_type=GridSpace, **kwargs) @@ -321,7 +321,7 @@ class HoloMap(UniformNdMapping): Views along these axes in a GridSpace. """ dimensions = self._valid_dimensions(dimensions) - if self.ndims == 1 and dimensions == self._cached_index_names: + if len(dimensions) == self.ndims: return NdLayout(self, **kwargs) return self.groupby(dimensions, container_type=NdLayout, **kwargs)
Fixed grid, layout, and overlay methods when converting all dimensions
pyviz_holoviews
train
py
d1f941b78fcea70749c120f844c1cf4d57ffb5ef
diff --git a/py3status/modules/vpn_status.py b/py3status/modules/vpn_status.py index <HASH>..<HASH> 100644 --- a/py3status/modules/vpn_status.py +++ b/py3status/modules/vpn_status.py @@ -91,12 +91,13 @@ class Py3status: sleep(0.3) # Check if any active connections are a VPN bus = SystemBus() + ids = [] for name in self.active: conn = bus.get(".NetworkManager", name) if conn.Vpn: - return conn.Id + ids.append(conn.Id) # No active VPN - return None + return ids def _check_pid(self): """Returns True if pidfile exists, False otherwise.""" @@ -124,7 +125,7 @@ class Py3status: else: vpn = self._get_vpn_status() if vpn: - name = vpn + name = ', '.join(vpn) color = self.py3.COLOR_GOOD # Format and create the response dict
vpn_status module: handle multiple vpns (#<I>), by @oceyral
ultrabug_py3status
train
py
a9c28a170b6b5f14a89810e86fbda814631d567e
diff --git a/bsdploy/__init__.py b/bsdploy/__init__.py index <HASH>..<HASH> 100644 --- a/bsdploy/__init__.py +++ b/bsdploy/__init__.py @@ -67,7 +67,7 @@ class PloyConfigureHostCmd(object): else: master = masters.keys()[0] instance = self.aws.instances[master] - instance.apply_playbook(path.join(ploy_path, 'roles', 'jailhost.yml')) + instance.apply_playbook(path.join(ploy_path, 'roles', 'jailhost.yml'), skip_host_check=True) def get_commands(aws):
supress host checking introduced in mr.awsome.ansible (otherwise the `configure-jailhost` command no longer would work)
ployground_bsdploy
train
py
5c13360f11623a90b111666be4ac9c62a1b1a11b
diff --git a/generators/generator-transforms.js b/generators/generator-transforms.js index <HASH>..<HASH> 100644 --- a/generators/generator-transforms.js +++ b/generators/generator-transforms.js @@ -41,8 +41,12 @@ const prettierTransform = function (defaultOptions) { options = { ...defaultOptions, ...options }; // for better errors options.filepath = file.relative; - const data = prettier.format(str, options); - file.contents = Buffer.from(data); + try { + const data = prettier.format(str, options); + file.contents = Buffer.from(data); + } catch (error) { + throw new Error(`Error parsing file ${file.relative}: ${error.message}`); + } } callback(null, file); });
When prettier transform fails, print the file that failed. (#<I>)
jhipster_generator-jhipster
train
js
9b8e63124ad66bce07ac702178edb097a0cf20e7
diff --git a/ext_emconf.php b/ext_emconf.php index <HASH>..<HASH> 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,5 +17,5 @@ $EM_CONF[$_EXTKEY] = [ 'author' => 'Tim Schreiner', 'author_email' => 'schreiner.tim@gmail.com', 'author_company' => '', - 'version' => '2.3.0-dev', + 'version' => '2.3.0', ];
[RELEASE] Set version to <I>
codemonkey1988_responsive-images
train
php
4bdcf45d9693ededbc2deea630815cffd3fb778e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup( name = "IronCache", py_modules = ["iron_cache"], - install_requires = ["iron_rest"], + install_requires = ["iron_core"], version = "0.1.0", description = "Client library for IronCache, the cache-in-the-cloud provided by Iron.io.", author = "Iron.io",
Updated setup.py to reflect change from iron_rest to iron_core.
iron-io_iron_cache_python
train
py
2ed86c48950229425c1367de7ff80e64569e00b0
diff --git a/app/Blueprint/Events/ServiceBuiltEvent.php b/app/Blueprint/Events/ServiceBuiltEvent.php index <HASH>..<HASH> 100644 --- a/app/Blueprint/Events/ServiceBuiltEvent.php +++ b/app/Blueprint/Events/ServiceBuiltEvent.php @@ -78,4 +78,12 @@ class ServiceBuiltEvent extends Event return $this->commandConfiguration; } + /** + * @return Configuration + */ + public function getEnvironmentConfiguration(): Configuration + { + return $this->environmentConfiguration; + } + } \ No newline at end of file
ServiceBuiltEvent - getEnvironmentConfiguration
ipunkt_rancherize
train
php
48efd1cbdd72001cdd47c77497f59a02cc5e6dbe
diff --git a/tornado/httputil.py b/tornado/httputil.py index <HASH>..<HASH> 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -777,10 +777,12 @@ def parse_body_arguments( and ``files`` parameters are dictionaries that will be updated with the parsed contents. """ - if headers and "Content-Encoding" in headers: - gen_log.warning("Unsupported Content-Encoding: %s", headers["Content-Encoding"]) - return if content_type.startswith("application/x-www-form-urlencoded"): + if headers and "Content-Encoding" in headers: + gen_log.warning( + "Unsupported Content-Encoding: %s", headers["Content-Encoding"] + ) + return try: uri_arguments = parse_qs_bytes(native_str(body), keep_blank_values=True) except Exception as e: @@ -790,6 +792,11 @@ def parse_body_arguments( if values: arguments.setdefault(name, []).extend(values) elif content_type.startswith("multipart/form-data"): + if headers and "Content-Encoding" in headers: + gen_log.warning( + "Unsupported Content-Encoding: %s", headers["Content-Encoding"] + ) + return try: fields = content_type.split(";") for field in fields:
httputil: Downgrade a noisy log line Only complain about unsupported content encodings if it's a content-type we'd otherwise try to parse. Fixes #<I>
tornadoweb_tornado
train
py
6bdfb7a205c92ec48ddd4aff37f8de600f986c42
diff --git a/openquake/logs.py b/openquake/logs.py index <HASH>..<HASH> 100644 --- a/openquake/logs.py +++ b/openquake/logs.py @@ -47,10 +47,6 @@ LOG = logging.getLogger() HAZARD_LOG = logging.getLogger('hazard') -# Progress report message prefixes -PR_PREFIXES = ["**", "** >"] - - def _log_progress(msg, *args, **kwargs): """ Log the message using the progress reporting logging level.
logs: Removed an obsolete constant Former-commit-id: <I>cadcdcc<I>fa<I>f<I>a<I>b<I>abc
gem_oq-engine
train
py
206144f79f11a78a50527374cbc1265b50eb3d2c
diff --git a/src/relay.js b/src/relay.js index <HASH>..<HASH> 100644 --- a/src/relay.js +++ b/src/relay.js @@ -46,5 +46,5 @@ export function sequelizeNodeInterface(sequelize) { return { nodeTypeMapper, ...nodeObjects - } + }; }
fixed missing semi-colon lint failure.
mickhansen_graphql-sequelize
train
js
45bc653988904efe903220453eb9738f56d4e97f
diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index <HASH>..<HASH> 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -394,7 +394,7 @@ class GuildMember { */ addRole(role) { if (!(role instanceof Role)) role = this.guild.roles.get(role); - if (!role) throw new TypeError('Supplied parameter was neither a Role nor a Snowflake.'); + if (!role) return Promise.reject(new TypeError('Supplied parameter was neither a Role nor a Snowflake.')); return this.client.rest.methods.addMemberRole(this, role); } @@ -421,7 +421,7 @@ class GuildMember { */ removeRole(role) { if (!(role instanceof Role)) role = this.guild.roles.get(role); - if (!role) throw new TypeError('Supplied parameter was neither a Role nor a Snowflake.'); + if (!role) return Promise.reject(new TypeError('Supplied parameter was neither a Role nor a Snowflake.')); return this.client.rest.methods.removeMemberRole(this, role); }
Failing to resolve a role should reject and not throw an error (#<I>)
discordjs_discord.js
train
js
6ea111378a3c337575e7f1a3c5335169adb5bbc7
diff --git a/a10_neutron_lbaas/version.py b/a10_neutron_lbaas/version.py index <HASH>..<HASH> 100644 --- a/a10_neutron_lbaas/version.py +++ b/a10_neutron_lbaas/version.py @@ -1 +1 @@ -VERSION = "1.4.2alpha" +VERSION = "1.4.3alpha" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages setup( name = "a10-neutron-lbaas", - version = "1.4.2alpha", + version = "1.4.3alpha", packages = find_packages(), author = "A10 Networks",
bump to <I>alpha
a10networks_a10-neutron-lbaas
train
py,py
3efab2d4afcb17f894d939c4bc4ea92552a52340
diff --git a/src/naarad/utils.py b/src/naarad/utils.py index <HASH>..<HASH> 100644 --- a/src/naarad/utils.py +++ b/src/naarad/utils.py @@ -663,7 +663,7 @@ def get_standardized_timestamp(timestamp, ts_format): logger.error('Unable to determine timestamp format for : %s', timestamp) return -1 elif ts_format == 'epoch': - ts = timestamp * 1000 + ts = int(timestamp) * 1000 elif ts_format == 'epoch_ms': ts = timestamp elif ts_format in ('%H:%M:%S', '%H:%M:%S.%f'):
Fix bug in timestamp conversion for epoch If the timestamp format is detected to be epoch, we should multiply the numeric value of the timestamp by <I>, to get milliseconds. This fixes a bug in the code, where the conversion was actually multiplying the string <I> times. This happened when using the custom csv metric
linkedin_naarad
train
py
4cabf061b526374c1d18af952f45edc571d2e710
diff --git a/src/Lob/Resource.php b/src/Lob/Resource.php index <HASH>..<HASH> 100644 --- a/src/Lob/Resource.php +++ b/src/Lob/Resource.php @@ -93,6 +93,10 @@ abstract class Resource implements ResourceInterface throw new NetworkErrorException($e->getMessage()); // @codeCoverageIgnoreEnd } catch (GuzzleException $e) { + if (!$e->hasResponse()) { + throw new UnexpectedErrorException('An Unexpected Error has occurred: ' . $e->getMessage()); + } + $responseErrorBody = strval($e->getResponse()->getBody()); $errorMessage = $this->errorMessageFromJsonBody($responseErrorBody); $statusCode = $e->getResponse()->getStatusCode();
fix(errors): check for response before trying to use it (#<I>)
lob_lob-php
train
php
dfcae6be1856e9e0b05f37402d7a376fb734b9d5
diff --git a/modules/vubleBidAdapter.js b/modules/vubleBidAdapter.js index <HASH>..<HASH> 100644 --- a/modules/vubleBidAdapter.js +++ b/modules/vubleBidAdapter.js @@ -102,7 +102,8 @@ export const spec = { creativeId: responseBody.creativeId, netRevenue: true, currency: CURRENCIES[bid.data.env], - vastUrl: responseBody.url + vastUrl: responseBody.url, + mediaType: 'video' }; responses.push(reponse); diff --git a/test/spec/modules/vubleBidAdapter_spec.js b/test/spec/modules/vubleBidAdapter_spec.js index <HASH>..<HASH> 100644 --- a/test/spec/modules/vubleBidAdapter_spec.js +++ b/test/spec/modules/vubleBidAdapter_spec.js @@ -202,7 +202,8 @@ describe('VubleAdapter', () => { creativeId: '2468', netRevenue: true, currency: 'USD', - vastUrl: 'https//player.mediabong.net/prebid/ad/a1b2c3d4' + vastUrl: 'https//player.mediabong.net/prebid/ad/a1b2c3d4', + mediaType: 'video' }; it('should equal to the expected formatted result', () => {
Fix: add mediatype in bid response (#<I>)
prebid_Prebid.js
train
js,js
4180e5b7ed858002c7cad851239e63d5a4575625
diff --git a/identify/extensions.py b/identify/extensions.py index <HASH>..<HASH> 100644 --- a/identify/extensions.py +++ b/identify/extensions.py @@ -8,6 +8,7 @@ EXTENSIONS = { 'asciidoc': {'text', 'asciidoc'}, 'apinotes': {'text', 'apinotes'}, 'asar': {'binary', 'asar'}, + 'avif': {'binary', 'image', 'avif'}, 'bash': {'text', 'shell', 'bash'}, 'bat': {'text', 'batch'}, 'bib': {'text', 'bib'},
Add `avif` file extension
chriskuehl_identify
train
py
8fd1b1700cffd1092deeb99b2448e2a42217299a
diff --git a/command/bdist_rpm.py b/command/bdist_rpm.py index <HASH>..<HASH> 100644 --- a/command/bdist_rpm.py +++ b/command/bdist_rpm.py @@ -95,7 +95,7 @@ class bdist_rpm (Command): "RPM 2 compatibility mode"), ] - boolean_options = ['keep-temp', 'rpm2-mode'] + boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode'] negative_opt = {'no-keep-temp': 'keep-temp', 'no-rpm-opt-flags': 'use-rpm-opt-flags',
[Bug #<I>] bdist_rpm didn't list all of its Boolean options. (Someone should check the other commands for this same error.) Bugfix candidate.
pypa_setuptools
train
py
16f1d70b89fc58f30bbbcf324316daabbb42baf1
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -84,8 +84,8 @@ final class App { // create the mailing component lazily $this->mail = null; - // create the authentication component lazily - $this->auth = null; + // initialize the authentication component + $this->auth = new Auth($this->db()); // create the ID encoder and decoder lazily $this->ids = null; @@ -201,13 +201,6 @@ final class App { * @return Auth the authentication component */ public function auth() { - // if the component has not been created yet - if (!isset($this->auth)) { - // create the component - $this->auth = new Auth($this->db()); - } - - // return the component return $this->auth; }
Don't create 'Auth' instance lazily anymore since it inits sessions
delight-im_PHP-Foundation-Core
train
php
ab4ab548a2ae0867acc80fbad0721b0be5ac8e59
diff --git a/lib/identity_cache.rb b/lib/identity_cache.rb index <HASH>..<HASH> 100644 --- a/lib/identity_cache.rb +++ b/lib/identity_cache.rb @@ -614,8 +614,8 @@ module IdentityCache loaded_association = send(association_name) + instance_variable_set(schema_hash_ivar, current_schema_hash) instance_variable_set(ivar_full_name, IdentityCache.map_cached_nil_for(loaded_association)) - instance_variable_set(schema_hash_ivar, current_schema_hash) end def primary_cache_index_key # :nodoc:
Returning a consisten value from denormalized population
Shopify_identity_cache
train
rb
4ec8d2aa86d38970bd2041a562f0b2cc9278e06f
diff --git a/glue/pipeline.py b/glue/pipeline.py index <HASH>..<HASH> 100644 --- a/glue/pipeline.py +++ b/glue/pipeline.py @@ -367,8 +367,7 @@ class CondorDAGManJob: Add a command line option to the executable. The order that the arguments will be appended to the command line is not guaranteed, but they will always be added before any command line arguments. The name of the option - is prefixed with double hyphen and the program is expected to parse it - with getopt_long(). + is prefixed with single hyphen. @param opt: command line option to add. @param value: value to pass to the option (None for no argument). """ @@ -414,6 +413,7 @@ class CondorDAGManJob: command += ' -' + c + ' ' + self.__options[c] else: command += ' -' + c + command += ' ' command += self.__dag
need a space between options and dag name
gwastro_pycbc-glue
train
py
9f4e5126e31839dc8a8199b692c4297526c58b0b
diff --git a/pyfas/tab.py b/pyfas/tab.py index <HASH>..<HASH> 100644 --- a/pyfas/tab.py +++ b/pyfas/tab.py @@ -163,7 +163,7 @@ class Tab(): [float(val) for val in vals]) if 'COLUMNS = (' in line: line = line.split('=')[1].replace(" ", "").\ - replace(' (', '').replace(')\n', '') + replace('(', '').replace(')\n', '') self.metadata['properties'] = line.split(',') self.metadata["t_points"] = len(self.metadata["t_array"]) self.metadata["p_points"] = len(self.metadata["p_array"]) @@ -187,7 +187,7 @@ class Tab(): text = text.split("LABEL")[0] except IndexError: pass - values = re.findall("[\.\d]+[\.\deE\+\-]+", text) + values = re.findall("[\.\d\-]+[\.\deE\+\-]+", text) nprops = len(self.metadata["properties"]) for idx, prop in enumerate(self.metadata["properties"]): data[fluid][prop] = [float(x) for x in values[idx::nprops]]
missing - in the extr regex
gpagliuca_pyfas
train
py
7a704288df8ed2d416c6dd8b15df3664ad425a5a
diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index <HASH>..<HASH> 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -630,9 +630,8 @@ class CaptureManager: self._global_capturing.resume_capturing() def suspend_global_capture(self, in_=False): - cap = getattr(self, "_global_capturing", None) - if cap is not None: - cap.suspend_capturing(in_=in_) + if self._global_capturing is not None: + self._global_capturing.suspend_capturing(in_=in_) def suspend(self, in_=False): # Need to undo local capsys-et-al if it exists before disabling global capture.
capture: remove unneeded getattr This attribute is set in __init__ and not deleted. Other methods do it already but this one wasn't updated.
pytest-dev_pytest
train
py
ecbdb7a59a883ee3bc770d7f7437d738558e2c25
diff --git a/test/cmd/library_publish.spec.js b/test/cmd/library_publish.spec.js index <HASH>..<HASH> 100644 --- a/test/cmd/library_publish.spec.js +++ b/test/cmd/library_publish.spec.js @@ -2,7 +2,7 @@ import {expect, sinon} from '../test-setup'; import {LibraryPublishCommand, LibraryPublishCommandSite} from '../../src/cmd/library_publish'; -describe('LibrarySearchCommand', () => { +describe('LibraryPublishCommand', () => { it('handles api errors', () => { const sut = new LibraryPublishCommand(); const apiError = new Error(); @@ -16,7 +16,7 @@ describe('LibrarySearchCommand', () => { const sut = new LibraryPublishCommand(); const ident = 'mylib'; const client = { - publish: sinon.stub().rejects(new Error('API error')) + publishLibrary: sinon.stub().rejects(new Error('API error')) }; const site = { apiClient: sinon.stub().returns(client), @@ -49,7 +49,7 @@ describe('LibrarySearchCommand', () => { const ident = 'mylib'; const library = {name:ident}; const client = { - publish: sinon.stub().resolves(library) + publishLibrary: sinon.stub().resolves(library) }; const site = { apiClient: sinon.stub().returns(client),
renames client method from `publish` to `publishLibrary`
particle-iot_particle-commands
train
js
89d8f97d8d29b992ca9f7b3d0fcd73be4f112fa8
diff --git a/src/hooks/KeyframesHook.js b/src/hooks/KeyframesHook.js index <HASH>..<HASH> 100644 --- a/src/hooks/KeyframesHook.js +++ b/src/hooks/KeyframesHook.js @@ -25,7 +25,8 @@ export function parseKeyframedUpdate (slots, config, f, setNext, cancel) { ) } else { const last = true - setNext(f(slots), last) + const config = Array.isArray(config) ? config[0] : config + setNext({config, ...f(slots)}, last) } }
fixed config not being passed to single slot State
react-spring_react-spring
train
js
3f19eae01a28f1b5f727b057ed4edda6459e8b56
diff --git a/vc_vidyo/indico_vc_vidyo/zodbimport.py b/vc_vidyo/indico_vc_vidyo/zodbimport.py index <HASH>..<HASH> 100644 --- a/vc_vidyo/indico_vc_vidyo/zodbimport.py +++ b/vc_vidyo/indico_vc_vidyo/zodbimport.py @@ -83,8 +83,6 @@ class VidyoImporter(Importer): opts = self.zodb_root['plugins']['Collaboration']._PluginType__plugins['Vidyo']._PluginBase__options VidyoPlugin.settings.set('managers', convert_principal_list(opts['admins'])) VidyoPlugin.settings.set('acl', convert_principal_list(opts['AuthorisedUsersGroups'])) - VidyoPlugin.settings.set('authenticators', ', '.join(map(convert_to_unicode, - option_value(opts['authenticatorList'])))) settings_map = { 'adminAPIURL': 'admin_api_wsdl', 'userAPIURL': 'user_api_wsdl',
VC/Vidyo: Ignore auth list in zodbimport The new authentication system uses different names so it's pointless to migrate the old names.
indico_indico-plugins
train
py
449114c028b25a28af53ac7e684e39f544ec179d
diff --git a/features/step_definitions/daemon_steps.rb b/features/step_definitions/daemon_steps.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/daemon_steps.rb +++ b/features/step_definitions/daemon_steps.rb @@ -4,7 +4,7 @@ When /^I run "([^"]*)" in the background$/ do |cmd| end Then /^the output should contain the following lines \(with interpolated \$PID\):$/ do |partial_output| - interpolate_background_pid(partial_output).lines.each do |line| + interpolate_background_pid(partial_output).split("\n").each do |line| all_output.should include(line) end end
cucumber: pass in <I>
nevans_resque-pool
train
rb
32b9fb6222e7c082596f5e34d4297b6de24619a0
diff --git a/input/tangy-timed.js b/input/tangy-timed.js index <HASH>..<HASH> 100644 --- a/input/tangy-timed.js +++ b/input/tangy-timed.js @@ -75,6 +75,7 @@ class TangyTimed extends PolymerElement { border: none; } #container { + overflow: scroll; width: 100%; position: relative; }
Make oversized tangy-timed grids gracefully handle overflow with overflow scroll setting
Tangerine-Community_tangy-form
train
js
298ea7c03f2d8553badf6535b33a3bf0958679ac
diff --git a/lib/fileprocessor.js b/lib/fileprocessor.js index <HASH>..<HASH> 100644 --- a/lib/fileprocessor.js +++ b/lib/fileprocessor.js @@ -40,7 +40,7 @@ var _defaultPatterns = { [/<input[^\>]+src=['"]([^"']+)["']/gm, 'Update the HTML with reference in input' ], - [/<meta[^\>]+src=['"]([^"']+)["']/gm, + [/<meta[^\>]+content=['"]([^"']+)["']/gm, 'Update the HTML with the new img filenames in meta tags' ] ],
Fix previous patch. It's `meta content` not `meta src`.
yeoman_grunt-usemin
train
js
723f9d02f0b25045318a580c83cac82cea2f8908
diff --git a/packages/vaex-core/vaex/expression.py b/packages/vaex-core/vaex/expression.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/vaex/expression.py +++ b/packages/vaex-core/vaex/expression.py @@ -1015,6 +1015,8 @@ class Expression(with_metaclass(Meta)): counters = [None] * self.ds.executor.thread_pool.nthreads def map(thread_index, i1, i2, selection_masks, blocks): ar = blocks[0] + if len(ar) == 0: + return 0 if counters[thread_index] is None: counters[thread_index] = counter_type(1) if data_type.is_list and axis is None: diff --git a/tests/value_counts_test.py b/tests/value_counts_test.py index <HASH>..<HASH> 100644 --- a/tests/value_counts_test.py +++ b/tests/value_counts_test.py @@ -126,6 +126,11 @@ def test_value_counts_list(df_types): assert vc[1] == 2 assert vc[2] == 1 +def test_value_counts_small_chunk_size(buffer_size): + df = vaex.datasets.iris() + with buffer_size(df, 3): + result = df[df.petal_width > 1].class_.value_counts() + assert result.tolist() == [50, 43] def test_value_counts_chunked_array(): df = vaex.from_arrays(
🐛 make value_counts work with empty chunks. (#<I>) * test(core): value_counts fails when chunk is empty * fix test such that chunk_size is restored * fix
vaexio_vaex
train
py,py
aa46fed5348449e07c2fd68b736cf0d1fdae9f5d
diff --git a/src/system/modules/metamodels/MetaModels/Dca/Content.php b/src/system/modules/metamodels/MetaModels/Dca/Content.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodels/MetaModels/Dca/Content.php +++ b/src/system/modules/metamodels/MetaModels/Dca/Content.php @@ -73,7 +73,13 @@ class Content */ public function getModuleTemplates(\DC_Table $objDC) { - return Helper::getTemplatesForBase('ce_metamodel_' . $objDC->activeRecord->type); + $type = $objDC->activeRecord->type; + if ($type == 'metamodel_content') + { + $type = 'metamodel_list'; + } + + return Helper::getTemplatesForBase('ce_' . $type); } /**
Fix issue #<I> - Template selection is broken.
MetaModels_core
train
php
cd7e6c22e38347da4c697a3d63387a22965c870e
diff --git a/src/Css/Stylesheet.php b/src/Css/Stylesheet.php index <HASH>..<HASH> 100644 --- a/src/Css/Stylesheet.php +++ b/src/Css/Stylesheet.php @@ -607,7 +607,7 @@ class Stylesheet switch ($tok) { case "first-child": - $query .= "[1]"; + $query .= "[not(preceding-sibling::*)]"; $tok = ""; break;
Fix `:first-child` selector scoping Fixes selectors like `body p:first-child`, which would only select the first `p` descendant of (every) `body` before.
dompdf_dompdf
train
php
647d9ff56e47231a65aa858e9be00c9d2d8858f0
diff --git a/polyaxon/dockerizer/builder.py b/polyaxon/dockerizer/builder.py index <HASH>..<HASH> 100644 --- a/polyaxon/dockerizer/builder.py +++ b/polyaxon/dockerizer/builder.py @@ -302,6 +302,8 @@ def download_code(build_job, build_path, filename): message='Could not handle downloaded code to build the image.') return False + return True + def build(build_job): """Build necessary code for a job to run"""
Send status after successful download and untar
polyaxon_polyaxon
train
py
73ea4dd13f842d8fcfc7f4db24201338d8aa61e4
diff --git a/lib/transport.js b/lib/transport.js index <HASH>..<HASH> 100644 --- a/lib/transport.js +++ b/lib/transport.js @@ -141,10 +141,7 @@ Transport.prototype.clearHandlers = function () { */ Transport.prototype.onSocketEnd = function () { - // we check that the socket wasn't swapped - // we don't want to sever a connection that's not active, since we don't kill - // inactive sockets that the browser might reuse for other purposes - this.end(false, 'socket end'); + this.end('socket end'); }; /** @@ -154,7 +151,7 @@ Transport.prototype.onSocketEnd = function () { */ Transport.prototype.onSocketClose = function (error) { - this.end(false, error ? 'socket error' : 'socket close'); + this.end(error ? 'socket error' : 'socket close'); }; /**
Removed the .end method to disregard whether it was forced or not
socketio_socket.io
train
js
7d3bdce7f2ecddd51f3a4cd2092f041a6868ec9c
diff --git a/src/utils/shadows.js b/src/utils/shadows.js index <HASH>..<HASH> 100644 --- a/src/utils/shadows.js +++ b/src/utils/shadows.js @@ -1,2 +1,2 @@ -const values = [2, 3, 4, 5, 6, 8, 16]; +const values = [2, 3, 4, 6, 8, 16, 24]; export default values.map(v => `mdl-shadow--${v}dp`);
fix(Shadows): Fix incorrect shadow level Remove an incorrect shdaow value and add the new value "<I>". This might slighly affect a bit the UI since shadow 4 go from value 6 to 8, 5: 6-><I> and 6: <I>-><I>. Fixes #<I>
tleunen_react-mdl
train
js
3718d5dcec4a98707e57887ea35d9b1631a82dca
diff --git a/extensions/tags/src/Api/Controller/OrderTagsController.php b/extensions/tags/src/Api/Controller/OrderTagsController.php index <HASH>..<HASH> 100644 --- a/extensions/tags/src/Api/Controller/OrderTagsController.php +++ b/extensions/tags/src/Api/Controller/OrderTagsController.php @@ -11,20 +11,21 @@ namespace Flarum\Tags\Api\Controller; -use Flarum\Http\Controller\ControllerInterface; use Flarum\Tags\Tag; use Flarum\User\AssertPermissionTrait; +use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; +use Psr\Http\Server\RequestHandlerInterface; use Zend\Diactoros\Response\EmptyResponse; -class OrderTagsController implements ControllerInterface +class OrderTagsController implements RequestHandlerInterface { use AssertPermissionTrait; /** * {@inheritdoc} */ - public function handle(ServerRequestInterface $request) + public function handle(ServerRequestInterface $request): ResponseInterface { $this->assertAdmin($request->getAttribute('actor'));
Get rid of obsolete ControllerInterface See flarum/core#<I>.
flarum_core
train
php
69b859049cf77c484419175c87d345e5e363e806
diff --git a/lib/onebox/engine/amazon_onebox.rb b/lib/onebox/engine/amazon_onebox.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/amazon_onebox.rb +++ b/lib/onebox/engine/amazon_onebox.rb @@ -8,7 +8,7 @@ module Onebox include HTML always_https - matches_regexp(/^https?:\/\/(?:www\.)?(amazon|amzn)\.(?<tld>com|ca|de|it|es|fr|co\.jp|co\.uk|cn|in|com\.br)\//) + matches_regexp(/^https?:\/\/(?:www\.)?(?:smile\.)?(amazon|amzn)\.(?<tld>com|ca|de|it|es|fr|co\.jp|co\.uk|cn|in|com\.br)\//) def url if match && match[:id]
FEATURE: support smile.amazon.com domain
discourse_onebox
train
rb
87e4d7c224c83bd80700fc460e150e7455c279b1
diff --git a/libargos/__init__.py b/libargos/__init__.py index <HASH>..<HASH> 100644 --- a/libargos/__init__.py +++ b/libargos/__init__.py @@ -27,6 +27,14 @@ from .application import ArgosApplication logger = logging.getLogger(__name__) + +def configBasicLogging(level = 'DEBUG'): + """ Setup basic config logging. Useful for debugging to quickly setup a useful logger + """ + fmt = '%(filename)25s:%(lineno)-4d : %(levelname)-7s: %(message)s' + logging.basicConfig(level=level, format=fmt) + + def browse(fileNames = None, profile=DEFAULT_PROFILE, resetProfile=False,
Added configBasicLogging
titusjan_argos
train
py
7a3a4e9d1cbee5eff3102ff0c31758c26421aae7
diff --git a/lib/pt/data_row.rb b/lib/pt/data_row.rb index <HASH>..<HASH> 100644 --- a/lib/pt/data_row.rb +++ b/lib/pt/data_row.rb @@ -1,4 +1,4 @@ -require 'iconv' +require 'iconv' unless "older_ruby?".respond_to?(:force_encoding) class PT::DataRow
only adds iconv for older rubies which don't support force_encoding
raul_pt
train
rb
1a179e61fd9dded143260c2e6538f764ce0a6d21
diff --git a/src/Cache/Engine/FileEngine.php b/src/Cache/Engine/FileEngine.php index <HASH>..<HASH> 100644 --- a/src/Cache/Engine/FileEngine.php +++ b/src/Cache/Engine/FileEngine.php @@ -194,7 +194,7 @@ class FileEngine extends CacheEngine $time = time(); $cachetime = (int)$this->_File->current(); - if ($cachetime < $time || ($time + $this->_config['duration']) < $cachetime) { + if ($cachetime < $time) { if ($this->_config['lock']) { $this->_File->flock(LOCK_UN); }
Remove redundant check in FileEngine This check was added back when Cache::settings() existed and served to invalidate cache data when duration settings change. This is no longer the case, and this code actively thwarts PSR6 per-key TTL operation. Fixes #<I>
cakephp_cakephp
train
php
12012ea3a60f733d3d7d877f3f579fb92fa05bf2
diff --git a/piece.js b/piece.js index <HASH>..<HASH> 100644 --- a/piece.js +++ b/piece.js @@ -56,9 +56,9 @@ Piece.prototype.write = function(offset, buffer) { this.blocksWritten++; buffer.copy(this.buffer, offset); - var firstBlank = Math.min( Array.prototype.indexOf.call(this.blocks, BLOCK_BLANK), - Array.prototype.indexOf.call(this.blocks, BLOCK_RESERVED) ); - this.progress = Math.min( this.buffer.length, ( (firstBlank == -1) ? this.blocks.length : firstBlank ) * BLOCK_SIZE); + var firstBlank = 0; + Array.prototype.some.call(this.blocks, function(block) { firstBlank++; return block != BLOCK_WRITTEN }); + this.progress = Math.min( this.buffer.length, firstBlank * BLOCK_SIZE); this.emit("progress", this.progress); return this.blocksWritten === this.blocks.length && this.buffer;
Fixed progress property Obtaining firstBlank using Math.min on two indexOf's was a flawed idea, since it disregarded the possibility of one of these being -1. In this case, for example, if there are no reserved pieces but the buffer is all blank ones, it would regard the piece as fully downloaded.
mafintosh_peerflix
train
js
fbafe408002ace0cf1a481aaa9fbfb834ac62efb
diff --git a/tests/integration/components/sl-checkbox-test.js b/tests/integration/components/sl-checkbox-test.js index <HASH>..<HASH> 100755 --- a/tests/integration/components/sl-checkbox-test.js +++ b/tests/integration/components/sl-checkbox-test.js @@ -81,3 +81,35 @@ test( 'Checked state applies property to input', function( assert ) { 'Rendered input is checked' ); }); + +test( 'Tooltip properties are set correctly when title parameter is set', function( assert ) { + const title = 'test title'; + + this.set( 'title', title ); + + this.render( hbs` + {{sl-checkbox title=title}} + ` ); + + const data = this.$( '>:first-child' ).data(); + const tooltipData = data[ 'bs.tooltip' ]; + const options = tooltipData.getOptions(); + + assert.strictEqual( + tooltipData.enabled, + true, + 'tooltip is enabled' + ); + + assert.strictEqual( + tooltipData.getTitle(), + title, + 'Title text is set correctly' + ); + + assert.strictEqual( + options.trigger, + 'hover focus', + 'Default trigger is "hover focus"' + ); +});
Closes softlayer/sl-ember-components#<I>
softlayer_sl-ember-components
train
js
95251b41fb879225560f6ad6ab45d11f3b77f756
diff --git a/src/DataTable/utils/withTableParams.js b/src/DataTable/utils/withTableParams.js index <HASH>..<HASH> 100644 --- a/src/DataTable/utils/withTableParams.js +++ b/src/DataTable/utils/withTableParams.js @@ -2,6 +2,8 @@ import { change, formValueSelector } from "redux-form"; import { connect } from "react-redux"; import queryParams from "./queryParams"; +import compose from "lodash/fp/compose"; +import { withRouter } from "react-router-dom"; export default function withTableParams( Component, @@ -107,5 +109,8 @@ export default function withTableParams( }; } - return connect(mapStateToProps, mapDispatchToProps, mergeProps)(Component); + return compose( + withRouter, + connect(mapStateToProps, mapDispatchToProps, mergeProps) + )(Component); }
adding back in withRouter to withTableParams
TeselaGen_teselagen-react-components
train
js
2d82cd811fecd2d418d3d291372ed2047d048f9e
diff --git a/pkg/kubelet/cloudresource/cloud_request_manager.go b/pkg/kubelet/cloudresource/cloud_request_manager.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/cloudresource/cloud_request_manager.go +++ b/pkg/kubelet/cloudresource/cloud_request_manager.go @@ -94,7 +94,7 @@ func (manager *cloudResourceSyncManager) NodeAddresses() ([]v1.NodeAddress, erro } func (manager *cloudResourceSyncManager) collectNodeAddresses(ctx context.Context, nodeName types.NodeName) { - glog.V(2).Infof("Requesting node addresses from cloud provider for node %q", nodeName) + glog.V(5).Infof("Requesting node addresses from cloud provider for node %q", nodeName) instances, ok := manager.cloud.Instances() if !ok { @@ -113,7 +113,7 @@ func (manager *cloudResourceSyncManager) collectNodeAddresses(ctx context.Contex glog.V(2).Infof("Node addresses from cloud provider for node %q not collected", nodeName) } else { manager.setNodeAddressSafe(nodeAddresses, nil) - glog.V(2).Infof("Node addresses from cloud provider for node %q collected", nodeName) + glog.V(5).Infof("Node addresses from cloud provider for node %q collected", nodeName) } }
Reduce verbose logs of node addresses requesting
kubernetes_kubernetes
train
go
2d132d7d896a9f97640e778dd83009aa2e21c534
diff --git a/bin.js b/bin.js index <HASH>..<HASH> 100755 --- a/bin.js +++ b/bin.js @@ -136,7 +136,7 @@ function downloadPrebuild () { function compile () { log.info('install', 'Could not install prebuild. Falling back to compilation') - runGyp(process.version, function (err) { + build(process.version, function (err) { if (err) { log.error('install', err.message) process.exit(1)
install node headers on download fail
prebuild_prebuild
train
js
722b30e518e6c4970edd7e1ab8aebf38e371c68a
diff --git a/pkg/oc/cli/debug/debug.go b/pkg/oc/cli/debug/debug.go index <HASH>..<HASH> 100644 --- a/pkg/oc/cli/debug/debug.go +++ b/pkg/oc/cli/debug/debug.go @@ -134,6 +134,9 @@ type DebugOptions struct { FullCmdName string Image string + // IsNode is set after we see the object we're debugging. We use it to be able to print pertinent advice. + IsNode bool + resource.FilenameOptions genericclioptions.IOStreams } @@ -426,6 +429,9 @@ func (o *DebugOptions) RunDebug() error { } else { fmt.Fprintf(o.ErrOut, "Starting pod/%s ...\n", pod.Name) } + if o.IsNode { + fmt.Fprintf(o.ErrOut, "To directly access the host PATH, try `chroot /host /bin/bash`\n") + } ctx, cancel := context.WithTimeout(context.Background(), o.Timeout) defer cancel() @@ -737,6 +743,7 @@ func containerNames(pod *corev1.Pod) []string { func (o *DebugOptions) approximatePodTemplateForObject(object runtime.Object) (*corev1.PodTemplateSpec, error) { switch t := object.(type) { case *corev1.Node: + o.IsNode = true if len(o.NodeName) > 0 { return nil, fmt.Errorf("you may not set --node-name when debugging a node") }
add some advice to 'oc debug' for debugging nodes
openshift_origin
train
go
ddd4ed4c99cdd7fdfb2568a1d73d3900551d0881
diff --git a/src/Traits/HasRoles.php b/src/Traits/HasRoles.php index <HASH>..<HASH> 100644 --- a/src/Traits/HasRoles.php +++ b/src/Traits/HasRoles.php @@ -17,6 +17,18 @@ trait HasRoles } /** + * Scope a query to eager load `roles` relationship + * to reduce database queries + * + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder + */ + public function scopeWithRoles($query) + { + return $query->with('roles'); + } + + /** * Determine if any of the assigned roles to this user * have a specific permission *
Added `withRoles` local scope to query in order to eager load `roles` relationship to reduce database queries
Silvanite_brandenburg
train
php
15712b9fdccfb02a604299f55475853f1c6d67f0
diff --git a/src/main/java/de/flapdoodle/embed/process/extract/ArchiveIsFileExtractor.java b/src/main/java/de/flapdoodle/embed/process/extract/ArchiveIsFileExtractor.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/flapdoodle/embed/process/extract/ArchiveIsFileExtractor.java +++ b/src/main/java/de/flapdoodle/embed/process/extract/ArchiveIsFileExtractor.java @@ -41,7 +41,7 @@ public class ArchiveIsFileExtractor implements IExtractor { public void extract(IDownloadConfig runtime, File source, File destination, Pattern file) throws IOException { IProgressListener progressListener = runtime.getProgressListener(); - String progressLabel = "Extract (not realy) " + source; + String progressLabel = "Extract (not really) " + source; progressListener.start(progressLabel); FileInputStream fin = new FileInputStream(source);
Update src/main/java/de/flapdoodle/embed/process/extract/ArchiveIsFileExtractor.java
flapdoodle-oss_de.flapdoodle.embed.process
train
java
4f2710437713e54ae7b894e69ba805feadfa1dc1
diff --git a/inc/shortcodes/glossary/class-glossary.php b/inc/shortcodes/glossary/class-glossary.php index <HASH>..<HASH> 100644 --- a/inc/shortcodes/glossary/class-glossary.php +++ b/inc/shortcodes/glossary/class-glossary.php @@ -182,15 +182,23 @@ class Glossary { // get the glossary post object the ID belongs to $terms = get_post( $term_id['id'] ); + if ( ! $terms ) { + return $content; + } // use our post instead of the global $post object setup_postdata( $terms ); - $content = wp_strip_all_tags( $content ); - $html = '<a href="javascript:void(0);" class="tooltip" title="' . get_the_excerpt( $term_id['id'] ) . '">' . $content . '</a>'; + // setup_postdata() sets up every global for the post except ...drumroll... $post /fail horn + global $post; + $old_global_post = $post; + $post = $terms; + + $html = '<a href="javascript:void(0);" class="tooltip" title="' . get_the_excerpt( $terms ) . '">' . $content . '</a>'; // reset post data wp_reset_postdata(); + $post = $old_global_post; return $html; }
Skip rendering for glossary shortcodes referencing missing term IDs (#<I>)
pressbooks_pressbooks
train
php
aff88472dc1f0e7e4de9e26beaf3213508c7c95f
diff --git a/lib/Grid.php b/lib/Grid.php index <HASH>..<HASH> 100644 --- a/lib/Grid.php +++ b/lib/Grid.php @@ -598,7 +598,7 @@ class Grid extends CompleteLister { } function render(){ - if($this->dq&&$this->dq->foundRows()==0){ + if(($this->dq&&$this->dq->foundRows()==0)||(!isset($this->data)||empty($this->data))){ $not_found=$this->add('SMlite')->loadTemplate('grid'); $not_found->set('no_records_message',$this->no_records_message); $not_found->del('grid');
Grid's 'no records' message for static sources
atk4_atk4
train
php
9962ea6a0a0473b29c0128ae2ad30ab8797b98da
diff --git a/lib/phusion_passenger/abstract_request_handler.rb b/lib/phusion_passenger/abstract_request_handler.rb index <HASH>..<HASH> 100644 --- a/lib/phusion_passenger/abstract_request_handler.rb +++ b/lib/phusion_passenger/abstract_request_handler.rb @@ -389,7 +389,7 @@ private socket = UNIXServer.new(socket_address) socket.listen(BACKLOG_SIZE) socket.close_on_exec! - File.chmod(0666, socket_address) + File.chmod(0600, socket_address) return [socket_address, socket] rescue Errno::EADDRINUSE # Do nothing, try again with another name.
Make request handler sockets have permission <I>. Our new architecture allows this because all traffic goes through the HelperAgent.
phusion_passenger
train
rb
22165e27bafd033f5faa3b9a1c89afa6fd5d2a66
diff --git a/lib/salt/site.rb b/lib/salt/site.rb index <HASH>..<HASH> 100644 --- a/lib/salt/site.rb +++ b/lib/salt/site.rb @@ -85,7 +85,7 @@ module Salt @archives[year] ||= {posts: [], months: {}} @archives[year][:posts] << post - @archives[year][:months][month] ||= {posts: [], days: {}} + @archives[year][:months][month] ||= {posts: [], days: {}, name: post.date.strftime('%B')} @archives[year][:months][month][:posts] << post @archives[year][:months][month][:days][day] ||= [] @archives[year][:months][month][:days][day] << post
Added in the month name to be helpful.
waferbaby_dimples
train
rb
f404550da22c0c8b73bab649e61f5b48929df8cc
diff --git a/pyontutils/neurons.py b/pyontutils/neurons.py index <HASH>..<HASH> 100755 --- a/pyontutils/neurons.py +++ b/pyontutils/neurons.py @@ -526,6 +526,10 @@ class LogicalPhenotype(graphBase): return tuple((pe.e for pe in self.pes)) @property + def pLabel(self): + return f'({self.op} ' + ' '.join(self.ng.qname(p) for p in self.p) + ')' + + @property def pHiddenLabel(self): label = ' '.join([pe.pHiddenLabel for pe in self.pes]) # FIXME we need to catch non-existent phenotypes BEFORE we try to get their hiddenLabel because the errors you get here are completely opaque op = self.local_names[self.op] @@ -632,7 +636,9 @@ class NeuronBase(graphBase): phenotypeEdges = tuple(set(self._localContext + phenotypeEdges)) # remove dupes if id_ and phenotypeEdges: - raise TypeError('This has not been implemented yet. This could serve as a way to validate a match or assign an id manually?') + self.id_ = self.expand(id_) + print('WARNING: you may be redefining a neuron!') + #raise TypeError('This has not been implemented yet. This could serve as a way to validate a match or assign an id manually?') elif id_: self.id_ = self.expand(id_) elif phenotypeEdges:
working on resolving the (OR ) issue
tgbugs_pyontutils
train
py
cc2ef9727d85fc8381346ede067889aa38148beb
diff --git a/app.go b/app.go index <HASH>..<HASH> 100644 --- a/app.go +++ b/app.go @@ -94,7 +94,7 @@ func (app *Application) Run(addr string) { } } -// Run app with TLS. +// RunTLS runs the app with TLS support. func (app *Application) RunTLS(addr, certFile, keyFile string) { err := http.ListenAndServeTLS(addr, certFile, keyFile, app) if err != nil {
[docs] Improved comment for RunTLS
dinever_golf
train
go
be8c256c1fab0083c0272729137315f7e7c4cf29
diff --git a/gtk/gtk.go b/gtk/gtk.go index <HASH>..<HASH> 100644 --- a/gtk/gtk.go +++ b/gtk/gtk.go @@ -3827,6 +3827,13 @@ func wrapFileChooser(obj *glib.Object) *FileChooser { return &FileChooser{obj} } +// SetFilename is a wrapper around gtk_file_chooser_get_filename(). +func (v *FileChooser) SetFilename(filename string) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_chooser_set_filename(v.native(), (*C.gchar)(cstr)) +} + // GetFilename is a wrapper around gtk_file_chooser_get_filename(). func (v *FileChooser) GetFilename() string { c := C.gtk_file_chooser_get_filename(v.native())
Add SetFilename binding for FileChooser
gotk3_gotk3
train
go
87c9878a1af516ee3886df835e04a6ef77c9c030
diff --git a/src/MercadoPago/MercadoPagoSdk.php b/src/MercadoPago/MercadoPagoSdk.php index <HASH>..<HASH> 100755 --- a/src/MercadoPago/MercadoPagoSdk.php +++ b/src/MercadoPago/MercadoPagoSdk.php @@ -34,13 +34,19 @@ class MercadoPagoSdk self::$_manager = new Manager(self::$_restClient, self::$_config); Entity::setManager(self::$_manager); } + + public static function configure($data=[]){ + self::initialize(); + self::$_config->configure($data); + } /** * @return Config */ public static function config() { - return self::$_config; + + return self::$_config; }
homologating sdks
mercadopago_sdk-php
train
php
c80d13ef9528e4ad8266707b9321ef2eab406bb0
diff --git a/src/Table.php b/src/Table.php index <HASH>..<HASH> 100644 --- a/src/Table.php +++ b/src/Table.php @@ -192,8 +192,8 @@ class Table extends Lister case 'text': return $this->add(new TableColumn\Text()); - //case 'boolean': - //return $this->add(new TableColumn\Checkbox()); + case 'boolean': + return $this->add(new TableColumn\Status(['positive'=>[true], 'negative'=>[false]])); default: if (!$this->default_column) {
Display booleans with status indicator on the table
atk4_ui
train
php
f1af9d351152ad5e5e2fc1f99d1d5d363f70f571
diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index <HASH>..<HASH> 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -756,7 +756,7 @@ class assignment_upload extends assignment_base { if ($forcemode!=null) { $mode=$forcemode; } - $returnurl = "submissions.php?id={$this->cm->id}&userid=$userid&mode=$mode&offset=$offset&forcerefresh=1"; + $returnurl = new moodle_url('/mod/assignment/submissions.php', array('id'=>$this->cm->id, 'userid'=>$userid, 'mode'=>$mode, 'offset'=>$offset, 'forcerefresh'=>1) ); if (data_submitted() and $submission = $this->get_submission($userid) and $this->can_unfinalize($submission)
assignment MDL-<I> changed url to moodle url.
moodle_moodle
train
php