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
849e97d0d4a2d338b959438856b8422f126a623d
diff --git a/pkg/apis/kops/util/labels.go b/pkg/apis/kops/util/labels.go index <HASH>..<HASH> 100644 --- a/pkg/apis/kops/util/labels.go +++ b/pkg/apis/kops/util/labels.go @@ -17,23 +17,17 @@ limitations under the License. package util import ( - "strings" - v1 "k8s.io/api/core/v1" ) func GetNodeRole(node *v1.Node) string { - role := "" // Newer labels - for k := range node.Labels { - if strings.HasPrefix(k, "node-role.kubernetes.io/") { - role = strings.TrimPrefix(k, "node-role.kubernetes.io/") - } + if _, ok := node.Labels["node-role.kubernetes.io/master"]; ok { + return "master" } - // Older label - if role == "" { - role = node.Labels["kubernetes.io/role"] + if _, ok := node.Labels["node-role.kubernetes.io/node"]; ok { + return "node" } - - return role + // Older label + return node.Labels["kubernetes.io/role"] }
Fix dns-controller flapping on spot instances
kubernetes_kops
train
go
24b38f0b867ca292b36f8b23d2081d14f8381553
diff --git a/util/ssh_client.go b/util/ssh_client.go index <HASH>..<HASH> 100644 --- a/util/ssh_client.go +++ b/util/ssh_client.go @@ -34,6 +34,7 @@ func (c *sshClientImpl) ExecCommand(username string, password string, ip string, if err != nil { return "", err } + defer client.Close() session, err := client.NewSession() if err != nil {
Missed a defer close for the ssh client Very simple change to address [bug <I>](<URL>), passed unit test in local.
cloudfoundry_bosh-softlayer-cpi-release
train
go
1561bcafb3ee17b3499642b4dc4eaa37e960695e
diff --git a/core/src/main/java/jenkins/install/InstallUtil.java b/core/src/main/java/jenkins/install/InstallUtil.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jenkins/install/InstallUtil.java +++ b/core/src/main/java/jenkins/install/InstallUtil.java @@ -85,8 +85,10 @@ public class InstallUtil { // Neither the top level config or the lastExecVersionFile have a version // stored in them, which means it's a new install. if (lastRunVersion.compareTo(NEW_INSTALL_VERSION) == 0) { - // Edge case: used jenkins 1 but not saved the system config page, the version is not persisted, returns 1.0 - if(!Jenkins.getInstance().getJobNames().isEmpty()) { // some jobs configured + // Edge case: used Jenkins 1 but did not save the system config page, + // the version is not persisted and returns 1.0, so try to check if + // they actually did anything + if (!Jenkins.getInstance().getItemMap().isEmpty()) { return InstallState.UPGRADE; } return InstallState.NEW;
Better test to determine if the Jenkins instance was actually used
jenkinsci_jenkins
train
java
1feeafbc227fdfa7bda636bd6a03a01044dfa16b
diff --git a/lib/sass/plugin/configuration.rb b/lib/sass/plugin/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/sass/plugin/configuration.rb +++ b/lib/sass/plugin/configuration.rb @@ -143,7 +143,7 @@ module Sass # @param additional_options [{Symbol => Object}] An options hash with which to merge \{#options} # @return [{Symbol => Object}] The modified options hash def engine_options(additional_options = {}) - opts = options.dup.merge(additional_options) + opts = options.merge(additional_options) opts[:load_paths] = load_paths(opts) opts end
[Sass] Merge creates a copy. No need for a dup here.
sass_ruby-sass
train
rb
e8aab74986a99a0616dc6a8ed0bc03dab9a03be8
diff --git a/doc/data/messages/m/missing-param-doc/bad.py b/doc/data/messages/m/missing-param-doc/bad.py index <HASH>..<HASH> 100644 --- a/doc/data/messages/m/missing-param-doc/bad.py +++ b/doc/data/messages/m/missing-param-doc/bad.py @@ -1,6 +1,5 @@ -def integer_sum(a, b): # [missing-param-doc] +def integer_sum(a: int, b): # [missing-param-doc] """Returns sum of two integers :param a: first integer - :type a: int """ return a + b diff --git a/doc/data/messages/m/missing-param-doc/good.py b/doc/data/messages/m/missing-param-doc/good.py index <HASH>..<HASH> 100644 --- a/doc/data/messages/m/missing-param-doc/good.py +++ b/doc/data/messages/m/missing-param-doc/good.py @@ -1,8 +1,6 @@ -def integer_sum(a, b): +def integer_sum(a: int, b: int): """Returns sum of two integers :param a: first integer - :type a: int :param b: second integer - :type b: int """ return a + b
Migrated example missing-param-doc to type annotations
PyCQA_pylint
train
py,py
5898dd4eb93a8bce5513796592d9d9cc24c5f25a
diff --git a/lib/github_changelog_generator/version.rb b/lib/github_changelog_generator/version.rb index <HASH>..<HASH> 100644 --- a/lib/github_changelog_generator/version.rb +++ b/lib/github_changelog_generator/version.rb @@ -1,3 +1,3 @@ module GitHubChangelogGenerator - VERSION = "1.11.0" + VERSION = "1.11.1" end
Update gemspec to version <I>
github-changelog-generator_github-changelog-generator
train
rb
e69b506abd40222c87be28398c5191db160740cb
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1250,7 +1250,7 @@ module ActionController #:nodoc: action_name = strip_out_controller(action_name) end end - "#{self.class.controller_path}/#{action_name}" + "#{self.controller_path}/#{action_name}" end def strip_out_controller(path) @@ -1258,7 +1258,7 @@ module ActionController #:nodoc: end def template_path_includes_controller?(path) - self.class.controller_path.split('/')[-1] == path.split('/')[0] + self.controller_path.split('/')[-1] == path.split('/')[0] end def process_cleanup
Call controller_path instance method so it can be easily overridden [#<I> state:resolved]
rails_rails
train
rb
547fd12d37f779887ac72195210ee19557acf006
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -155,6 +155,7 @@ var onFlush = function(time, metrics) { insert(obj.db, obj.col, obj.data, function(err){ if (err) console.log('stat not saved for '+key); if (err) console.log(err); + if (options.debug) console.log('Saved key %s', key); }); }; }); @@ -167,6 +168,8 @@ var onFlush = function(time, metrics) { * @param {Object} events */ exports.init = function(startup_time, config, events) { + if (!startup_time || !config || !events) return false; + options.debug = config.debug; if (typeof config.mongoPrefix == 'boolean' && typeof config.mongoName !== 'string') {
adds conditional for debug to make sure tests pass
dynmeth_mongo-statsd-backend
train
js
3007a309e666c848e94663dac871569d136851f6
diff --git a/lib/FroalaEditor/File.php b/lib/FroalaEditor/File.php index <HASH>..<HASH> 100644 --- a/lib/FroalaEditor/File.php +++ b/lib/FroalaEditor/File.php @@ -29,7 +29,7 @@ class File { if (is_null($options)) { $options = File::$defaultUploadOptions; } else { - $options = array_merge_recursive(File::$defaultUploadOptions, $options); + $options = array_merge(File::$defaultUploadOptions, $options); } return DiskManagement::upload($fileRoute, $options); diff --git a/lib/FroalaEditor/Image.php b/lib/FroalaEditor/Image.php index <HASH>..<HASH> 100644 --- a/lib/FroalaEditor/Image.php +++ b/lib/FroalaEditor/Image.php @@ -31,7 +31,7 @@ class Image { if (is_null($options)) { $options = Image::$defaultUploadOptions; } else { - $options = array_merge_recursive(Image::$defaultUploadOptions, $options); + $options = array_merge(Image::$defaultUploadOptions, $options); } // Upload image.
Reverted array_merge_recursive.
froala_wysiwyg-editor-php-sdk
train
php,php
cc20350867b51865f0d04e80325700e0f5ca72f5
diff --git a/tapioca_github/resource_mapping.py b/tapioca_github/resource_mapping.py index <HASH>..<HASH> 100644 --- a/tapioca_github/resource_mapping.py +++ b/tapioca_github/resource_mapping.py @@ -111,11 +111,11 @@ RESOURCE_MAPPING = { 'doc': 'https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator' }, 'commits_repository': { - 'resource': '/repos/{owner}/{repo}/commits', + 'resource': 'repos/{owner}/{repo}/commits', 'doc': 'https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository' }, 'commit_repository': { - 'resource': '/repos/{owner}/{repo}/commits/{sha}', + 'resource': 'repos/{owner}/{repo}/commits/{sha}', 'doc': 'https://developer.github.com/v3/repos/commits/#get-a-single-commit' } }
remove trailing slash on commit resources
gileno_tapioca-github
train
py
3a4af794683e245d891f8f9408634f052f88747a
diff --git a/lib/heroku/plugin.rb b/lib/heroku/plugin.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/plugin.rb +++ b/lib/heroku/plugin.rb @@ -51,7 +51,7 @@ module Heroku FileUtils.mkdir_p(path) Dir.chdir(path) do system("git init -q") - if !system("git pull #{uri} -q") + if !system("git pull #{uri} master -q") FileUtils.rm_rf path return false end
Specify the branch to pull from when installing plugins. Without this, the install fails for users without a default branch specified in their .gitconfig.
heroku_legacy-cli
train
rb
ba93ea71b87c95f4d52c85ae652496ebfb012e1f
diff --git a/pupa/importers/memberships.py b/pupa/importers/memberships.py index <HASH>..<HASH> 100644 --- a/pupa/importers/memberships.py +++ b/pupa/importers/memberships.py @@ -16,6 +16,10 @@ class MembershipImporter(BaseImporter): # if this is a historical role, only update historical roles 'end_date': membership.get('end_date') } + + if 'unmatched_legislator' in membership: + spec['unmatched_legislator'] = membership['unmatched_legislator'] + return spec def prepare_object_from_json(self, obj):
Add unmatched_legislator to the spec
opencivicdata_pupa
train
py
6eb7fcbcf4aea5fe3be3a582e362b859264570ca
diff --git a/src/GW2Api.php b/src/GW2Api.php index <HASH>..<HASH> 100644 --- a/src/GW2Api.php +++ b/src/GW2Api.php @@ -63,10 +63,8 @@ class GW2Api { return [ 'base_uri' => $this->apiUrl, - 'defaults' => [ - 'verify' => $this->getCacertFilePath() - ], - 'handler' => $handler + 'handler' => $handler, + 'verify' => $this->getCacertFilePath() ] + $options; }
make sure to use our own certfile to prevent ssl errors guzzle 6 isn't using the `defaults` option anymore, it's just merging everything in options other than `base_uri` and `handler` into the request options.
GW2Treasures_gw2api
train
php
42a36fa6483649a9df96415b30c9887984d52cad
diff --git a/lib/html/pipeline/camo_filter.rb b/lib/html/pipeline/camo_filter.rb index <HASH>..<HASH> 100644 --- a/lib/html/pipeline/camo_filter.rb +++ b/lib/html/pipeline/camo_filter.rb @@ -56,8 +56,7 @@ module HTML # Private: calculate the HMAC digest for a image source URL. def asset_url_hash(url) - digest = OpenSSL::Digest.new('sha1') - OpenSSL::HMAC.hexdigest(digest, asset_proxy_secret_key, url) + OpenSSL::HMAC.hexdigest('sha1', asset_proxy_secret_key, url) end # Private: Return true if asset proxy filter should be enabled
Don't use intermediate OpenSSL::Digest cc @tmm1
jch_html-pipeline
train
rb
0f1f752501be1d2ef5fc6f7334cbb759ac69ed1a
diff --git a/tests/PdfTest.php b/tests/PdfTest.php index <HASH>..<HASH> 100644 --- a/tests/PdfTest.php +++ b/tests/PdfTest.php @@ -2,8 +2,8 @@ namespace Spatie\PdfToImage\Test; -use PHPUnit\Framework\TestCase; use Spatie\PdfToImage\Pdf; +use PHPUnit\Framework\TestCase; use Spatie\PdfToImage\Exceptions\InvalidFormat; use Spatie\PdfToImage\Exceptions\PdfDoesNotExist; use Spatie\PdfToImage\Exceptions\PageDoesNotExist;
Apply fixes from StyleCI (#<I>)
spatie_pdf-to-image
train
php
7c76efd6ea6add9246dd4128a1a934fda1015cc5
diff --git a/cmd/influx/query.go b/cmd/influx/query.go index <HASH>..<HASH> 100644 --- a/cmd/influx/query.go +++ b/cmd/influx/query.go @@ -105,7 +105,7 @@ func fluxQueryF(cmd *cobra.Command, args []string) error { "query": q, "type": "flux", "dialect": map[string]interface{}{ - "annotations": []string{"datatype", "group", "default"}, + "annotations": []string{"group", "datatype", "default"}, "delimiter": ",", "header": true, },
fix(cli): update annotation order to match UI (#<I>)
influxdata_influxdb
train
go
623e81749602de818ae37259328120552964ac8e
diff --git a/actor-apps/core/src/main/java/im/actor/core/modules/internal/messages/ConversationActor.java b/actor-apps/core/src/main/java/im/actor/core/modules/internal/messages/ConversationActor.java index <HASH>..<HASH> 100644 --- a/actor-apps/core/src/main/java/im/actor/core/modules/internal/messages/ConversationActor.java +++ b/actor-apps/core/src/main/java/im/actor/core/modules/internal/messages/ConversationActor.java @@ -392,9 +392,7 @@ public class ConversationActor extends ModuleActor { docs.clear(); inPendingIndex.clear(); outPendingIndex.clear(); - if (!isHiddenPeer) { - dialogsActor.send(new DialogsActor.ChatClear(peer)); - } + dialogsActor.send(new DialogsActor.ChatClear(peer)); } @Verified @@ -403,9 +401,7 @@ public class ConversationActor extends ModuleActor { docs.clear(); inPendingIndex.clear(); outPendingIndex.clear(); - if (!isHiddenPeer) { - dialogsActor.send(new DialogsActor.ChatDelete(peer)); - } + dialogsActor.send(new DialogsActor.ChatDelete(peer)); } // History
fix(core): Deleting dialogs even hidden peers
actorapp_actor-platform
train
java
00f90b65accefe8a9fc7d3e12d33e30ff454db66
diff --git a/py3status/modules/sysdata.py b/py3status/modules/sysdata.py index <HASH>..<HASH> 100644 --- a/py3status/modules/sysdata.py +++ b/py3status/modules/sysdata.py @@ -375,7 +375,7 @@ class Py3status: free_percent, ) - def _get_meminfo(self, head=24): + def _get_meminfo(self, head=28): with open("/proc/meminfo") as f: info = [line.split() for line in (next(f) for x in range(head))] return {fields[0]: float(fields[1]) for fields in info}
sysdata module: increasing meminfo readable lines count to support Raspberry Pi4 (fix #<I>) (#<I>)
ultrabug_py3status
train
py
028b8ba7a1edecdbb61af868822acf5531692a6f
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 @@ -638,7 +638,7 @@ class AxisLayout(UniformNdMapping): for dim in self._cached_index_names: dim_type = self.get_dimension_type(dim) if dim_type is not None or issubclass(dim_type, Number): - dim_inds.append(self.get_dimension_index(dim) + dim_inds.append(self.get_dimension_index(dim)) str_keys = iter(key[i] for i in range(self.ndims) if i not in dim_inds) num_keys = []
Fixed syntax error in AxisLayout
pyviz_holoviews
train
py
a2dd78c6e7752b24210861b8b2119d5d70f57a7e
diff --git a/src/editor/index.js b/src/editor/index.js index <HASH>..<HASH> 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -379,10 +379,11 @@ module.exports = config => { /** * Load data from the current storage + * @param {Function} clb Callback function * @return {Object} Stored data */ - load() { - return em.load(); + load(clb) { + return em.load(clb); }, /**
Let pass a callback function in load method
artf_grapesjs
train
js
c5e38c4fcf22d96b530c7118aef8dcf5522a65fd
diff --git a/src/test/java/picocli/CommandLineHelpTest.java b/src/test/java/picocli/CommandLineHelpTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/picocli/CommandLineHelpTest.java +++ b/src/test/java/picocli/CommandLineHelpTest.java @@ -76,6 +76,14 @@ public class CommandLineHelpTest { } @Test + public void testShortestFirstComparator_sortsShortestFirst() { + String[] values = {"12345", "12", "123", "123456", "1", "", "1234"}; + Arrays.sort(values, new Help.ShortestFirst()); + String[] expected = {"", "1", "12", "123", "1234", "12345", "123456"}; + assertArrayEquals(expected, values); + } + + @Test public void testTextTable() { TextTable table = new TextTable(); table.addRow("-v", ",", "--verbose", "show what you're doing while you are doing it");
Test for ShortestFirst comparator. Closes #<I>
remkop_picocli
train
java
0b20718338d4a4b25d012778c3856c7d5ac838bb
diff --git a/samples/replay-api/download_replays.py b/samples/replay-api/download_replays.py index <HASH>..<HASH> 100755 --- a/samples/replay-api/download_replays.py +++ b/samples/replay-api/download_replays.py @@ -141,7 +141,7 @@ def main(): with open(file_path) as fd: try: archive = mpyq.MPQArchive(fd).extract() - except ValueError: + except: found_versions['corrupt'] += 1 os.remove(file_path) continue
Apparently replays can be corrupt in other ways, so catch everything.
Blizzard_s2client-proto
train
py
5c833ef034d3f84a4e6f02b674980b1a378d34d2
diff --git a/src/Adapter/BaseAdapter.php b/src/Adapter/BaseAdapter.php index <HASH>..<HASH> 100644 --- a/src/Adapter/BaseAdapter.php +++ b/src/Adapter/BaseAdapter.php @@ -16,12 +16,13 @@ use Symfony\Component\Console\Helper\DialogHelper; use Symfony\Component\Console\Output\OutputInterface; /** + * Provides a base class for adapting Gush to use different providers. + * E.g. Github, GitLab, Bitbucket + * * @author Aaron Scherer <aequasi@gmail.com> */ abstract class BaseAdapter implements Adapter { - const NAME = 'unknown'; - /** * @var Config */ @@ -48,14 +49,6 @@ abstract class BaseAdapter implements Adapter /** * {@inheritdoc} */ - public function getName() - { - return self::NAME; - } - - /** - * {@inheritdoc} - */ public static function doConfiguration(OutputInterface $output, DialogHelper $dialog) { return [];
refactor(Adapter): remove getName() from BaseAdapter Each adapter must return a unique name so defaulting doesn't make sense then
gushphp_gush
train
php
7936fd72bd8b325d8ad861d3ff5fd4914ece83f4
diff --git a/src/Extensions.php b/src/Extensions.php index <HASH>..<HASH> 100644 --- a/src/Extensions.php +++ b/src/Extensions.php @@ -668,7 +668,11 @@ class Extensions } } - if ($this->addjquery === true && $this->app['config']->getWhichEnd() === 'frontend') { + // While this looks slightly illogical, our CLI tests want to see that + // jQuery can be inserted, but we don't want it inserted on either the + // backend or AJAX requests. + $end = $this->app['config']->getWhichEnd(); + if ($this->addjquery === true && ($end === 'frontend' || $end === 'cli')) { $html = $this->insertJquery($html); }
Also "allow" jQuery insertion when called from the CLI and leave a note as to why.
bolt_bolt
train
php
ce27ecaf2ebca957708ff02e9d9b4f796cd0242f
diff --git a/src/test/java/org/openqa/selenium/htmlunit/HtmlUnitElementTest.java b/src/test/java/org/openqa/selenium/htmlunit/HtmlUnitElementTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/openqa/selenium/htmlunit/HtmlUnitElementTest.java +++ b/src/test/java/org/openqa/selenium/htmlunit/HtmlUnitElementTest.java @@ -61,7 +61,7 @@ public class HtmlUnitElementTest extends TestBase { driver.get(testServer.page("formPage.html")); WebElement input = driver.findElement(By.id("upload")); input.sendKeys("example.txt"); - assertThat(input.getAttribute("value"), equalTo("example.txt")); + assertThat(input.getAttribute("value"), equalTo("C:\\fakepath\\example.txt")); } @Test
Fix test case, to match Chrome expectations
SeleniumHQ_htmlunit-driver
train
java
e0dc753194b15ed4e4cf0d1cdae35fc61e4214de
diff --git a/test/unit/carriers/canada_post_test.rb b/test/unit/carriers/canada_post_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/carriers/canada_post_test.rb +++ b/test/unit/carriers/canada_post_test.rb @@ -93,6 +93,22 @@ class CanadaPostTest < Test::Unit::TestCase end end + def test_turn_around_time_default + @carrier.expects(:commit).with do |request| + parsed_request = Hash.from_xml(request) + parsed_request['eparcel']['turnAroundTime'] == "24" + end + @carrier.find_rates(@origin, @destination, @line_items) + end + + def test_turn_around_time + @carrier.expects(:commit).with do |request| + parsed_request = Hash.from_xml(request) + parsed_request['eparcel']['turnAroundTime'] == "0" + end + @carrier.find_rates(@origin, @destination, @line_items, :turn_around_time => 0) + end + def test_build_line_items xml_line_items = @carrier.send(:build_line_items, @line_items) assert_instance_of XmlNode, xml_line_items
adding test for Canada Post's turn_around_time option
Shopify_active_shipping
train
rb
6f0b3394c3b693c1a0f1c6eb6ec574f2c42ab08d
diff --git a/lib/pdk/cli/exec.rb b/lib/pdk/cli/exec.rb index <HASH>..<HASH> 100644 --- a/lib/pdk/cli/exec.rb +++ b/lib/pdk/cli/exec.rb @@ -1,4 +1,5 @@ require 'childprocess' +require 'tempfile' module PDK module CLI
(MAINT) Fixup usage of Tempfile in PDK::CLI::Exec
puppetlabs_pdk
train
rb
b2c27800c4bab92437e1b8faaa3b3ae3cf8a85b0
diff --git a/buku.py b/buku.py index <HASH>..<HASH> 100755 --- a/buku.py +++ b/buku.py @@ -2985,9 +2985,9 @@ def get_PoolManager(): """ if myproxy: - return urllib3.ProxyManager(myproxy, num_pools=1, headers=myheaders) + return urllib3.ProxyManager(myproxy, num_pools=1, headers=myheaders, timeout=15) - return urllib3.PoolManager(num_pools=1, headers=myheaders) + return urllib3.PoolManager(num_pools=1, headers=myheaders, timeout=15) def network_handler(url, http_head=False): @@ -3023,7 +3023,7 @@ def network_handler(url, http_head=False): manager = get_PoolManager() while True: - resp = manager.request(method, url, timeout=40) + resp = manager.request(method, url) if resp.status == 200: if method == 'GET':
Reduce network timeout to <I> seconds
jarun_Buku
train
py
d2f78ae41346ef60823e8640ba697afdb89aea20
diff --git a/lib/rapns/daemon/delivery_handler.rb b/lib/rapns/daemon/delivery_handler.rb index <HASH>..<HASH> 100644 --- a/lib/rapns/daemon/delivery_handler.rb +++ b/lib/rapns/daemon/delivery_handler.rb @@ -37,7 +37,6 @@ module Rapns begin deliver(notification) - reflect(:notification_delivered, notification) rescue StandardError => e Rapns.logger.error(e) reflect(:error, e)
Remove duplicate call to notification_delivered reflection. Fixes #<I>.
rpush_rpush
train
rb
f4826422abfac36f75fe99465d9c06accc4d8c16
diff --git a/blueprints/ember-pretenderify/index.js b/blueprints/ember-pretenderify/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-pretenderify/index.js +++ b/blueprints/ember-pretenderify/index.js @@ -8,7 +8,9 @@ module.exports = { }, afterInstall: function() { - return this.addBowerPackageToProject('pretender', '~0.6.0'); - return this.addBowerPackageToProject('ember-inflector', '~1.3.1'); + return this.addBowerPackagesToProject([ + {name: 'pretender', target: '~0.6.0'}, + {name: 'ember-inflector', target: '~1.3.1'} + ]); } };
unreached val after return #pwned
samselikoff_ember-cli-mirage
train
js
933c73f9a6b14456d3f4c5300ec1d575e3b37af0
diff --git a/src/getjump/Vk/Auth.php b/src/getjump/Vk/Auth.php index <HASH>..<HASH> 100644 --- a/src/getjump/Vk/Auth.php +++ b/src/getjump/Vk/Auth.php @@ -161,7 +161,8 @@ class Auth urlencode($this->g('redirect_uri')) ); - $data = $this->guzzle->get($uri)->json(['object' => true]); + $data = $this->guzzle->get($uri)->getBody(); + $data = json_decode($data); if (isset($data->access_token)) { return new \getjump\Vk\Response\Auth($data->access_token, $data->expires_in, $data->user_id);
fix in auth to use guzzle 6.*
getjump_VkApiPHP
train
php
c1e99089638e6f1f57fe71461f99f9d00a43ccf1
diff --git a/inmem_endpoint.go b/inmem_endpoint.go index <HASH>..<HASH> 100644 --- a/inmem_endpoint.go +++ b/inmem_endpoint.go @@ -42,8 +42,8 @@ type SampledValue struct { } // deepCopy allocates a new instance of AggregateSample -func (source SampledValue) deepCopy() SampledValue { - dest := source +func (source *SampledValue) deepCopy() SampledValue { + dest := *source if source.AggregateSample != nil { dest.AggregateSample = &AggregateSample{} *dest.AggregateSample = *source.AggregateSample
modified SampledValue deepCopy() receiver to avoid potential extraneous copies
armon_go-metrics
train
go
8e38b97ce9a16b6f91fe91f06e47611ae4dafb08
diff --git a/code/dataobjects/ItemList.php b/code/dataobjects/ItemList.php index <HASH>..<HASH> 100644 --- a/code/dataobjects/ItemList.php +++ b/code/dataobjects/ItemList.php @@ -355,7 +355,8 @@ class ItemList extends DataObject { $replacement = $item->$field(); } else { $replacement = $item->$field; - if (is_callable($replacement)) { + // captures array / closure, but skips plain global functions + if (!is_string($replacement) && is_callable($replacement)) { $replacement = $replacement(); } }
fix(ItemList) When checking for callables, don't include string function names
nyeholt_silverstripe-frontend-objects
train
php
23bc64c814e6b9a08a62f39aecdc856ed2c96d1c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ setup(name='GPflow', package_dir={'GPflow': 'GPflow'}, py_modules=['GPflow.__init__'], test_suite='testing', - install_requires=['numpy>=1.9', 'scipy>=0.16', 'tensorflow>=0.11rc1', 'pandas>=0.18.1'], + install_requires=['numpy>=1.9', 'scipy>=0.16', 'tensorflow>=0.11.0rc1', 'pandas>=0.18.1'], classifiers=['License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Operating System :: MacOS :: MacOS X',
fixing tf version in setup.py
GPflow_GPflow
train
py
dbd8716549910f46e00a6712e9323a9e2c3d34e0
diff --git a/Eloquent/Model.php b/Eloquent/Model.php index <HASH>..<HASH> 100644 --- a/Eloquent/Model.php +++ b/Eloquent/Model.php @@ -1287,9 +1287,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ public function getTable() { - return isset($this->table) - ? $this->table - : Str::snake(Str::pluralStudly(class_basename($this))); + return $this->table ?? Str::snake(Str::pluralStudly(class_basename($this))); } /**
[<I>] Use coalesce operator
illuminate_database
train
php
76fde39d6a6d1063bd6dfee31413564abeab1121
diff --git a/src/Form/FieldInput.js b/src/Form/FieldInput.js index <HASH>..<HASH> 100644 --- a/src/Form/FieldInput.js +++ b/src/Form/FieldInput.js @@ -107,7 +107,11 @@ class FieldInput extends Util.mixin(BindMixin) { return null; } - return <span className={helpBlockClass}>{helpBlock}</span>; + return ( + <span className={classNames(helpBlockClass)}> + {helpBlock} + </span> + ); } getLabel() {
Passing class through classNames function
mesosphere_reactjs-components
train
js
ab2b7266c8896ccdf05b2577fe5f655df4db4c15
diff --git a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java +++ b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java @@ -734,6 +734,7 @@ public abstract class WebDriverManager { driverVersionStr, e.getMessage()); if (retryCount == 0 && !config().isAvoidFallback()) { config().setAvoidBrowserDetection(true); + config().setAvoidReadReleaseFromRepository(true); driverVersion = ""; setBrowserVersion(""); retryCount++;
Avoid read release from repository in the retry process to resolve driver
bonigarcia_webdrivermanager
train
java
db209242e6363bab31b686e8aca6896040295dbf
diff --git a/src/AbstractCommand.php b/src/AbstractCommand.php index <HASH>..<HASH> 100644 --- a/src/AbstractCommand.php +++ b/src/AbstractCommand.php @@ -12,6 +12,7 @@ use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Style\SymfonyStyle; /** * Base class for a console command. @@ -152,6 +153,18 @@ abstract class AbstractCommand implements CommandInterface } /** + * Create a new SymfonyStyle instance. + * + * @return SymfonyStyle + * + * @since __DEPLOY_VERSION__ + */ + public function createSymfonyStyle(): SymfonyStyle + { + return new SymfonyStyle($this->getApplication()->getConsoleInput(), $this->getApplication()->getConsoleOutput()); + } + + /** * Get the command's aliases. * * @return string[]
Add a helper to the AbstractCommand for creating a SymfonyStyle object
joomla-framework_console
train
php
7d125067d40b31c5ea0782b0c9ce9d8774707f94
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ import ast +from typing import List import asttokens import pytest @@ -69,11 +70,12 @@ def first_node_with_tokens(code_str): @pytest.fixture -def lines(code_str): +def lines(code_str) -> List[str]: """ - Given ``code_str`` chop it into lines as flake8 would pass to a plugin. + Given ``code_str`` chop it into lines as Flake8 would pass to a plugin - + each line includes its newline terminator. Returns: - list (str) + list """ - return ['{}\n'.format(line) for line in code_str.split('\n')] + return code_str.splitlines(True) diff --git a/tests/fixtures/test_lines.py b/tests/fixtures/test_lines.py index <HASH>..<HASH> 100644 --- a/tests/fixtures/test_lines.py +++ b/tests/fixtures/test_lines.py @@ -12,5 +12,4 @@ def test_lines(lines): '\n', 'def test():\n', ' pass\n', - '\n', ]
Adjust lines fixture to match Flake8: use splitlines(True)
jamescooke_flake8-aaa
train
py,py
60e0743129c76780d8bc203ed2acd7ef843db6e6
diff --git a/test/sluggable_test.rb b/test/sluggable_test.rb index <HASH>..<HASH> 100644 --- a/test/sluggable_test.rb +++ b/test/sluggable_test.rb @@ -136,8 +136,8 @@ class SluggableTest < Test::Unit::TestCase end def test_should_not_give_up_damnit - p = Post.create!(:name => "Post 2/4") - q = Post.create!(:name => "Post") + Post.create!(:name => "Post 2/4") + assert Post.create!(:name => "Post") end def test_slug_should_indicate_if_it_is_the_most_recent
Added assert to test. I need to stop coding in such a hurry. git-svn-id: <URL>
norman_friendly_id
train
rb
f283199be165b4c992b7d693838cb17a53a835bc
diff --git a/core-bundle/src/Resources/contao/classes/Versions.php b/core-bundle/src/Resources/contao/classes/Versions.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/classes/Versions.php +++ b/core-bundle/src/Resources/contao/classes/Versions.php @@ -325,6 +325,16 @@ class Versions extends \Backend } unset($tmp); + // Convert binary UUIDs to their hex equivalents (see #6365) + if ($blnIsBinary && \Validator::isUuid($to[$k])) + { + $to[$k] = \String::binToUuid($to[$k]); + } + if ($blnIsBinary && \Validator::isUuid($from[$k])) + { + $to[$k] = \String::binToUuid($from[$k]); + } + // Convert date fields if ($arrFields[$k]['eval']['rgxp'] == 'date') {
[Core] Convert binary UUIDs to their hex equivalents in the diff view (see #<I>)
contao_contao
train
php
dbdd942e80ea5ad0e365e51023d62966e8c2757e
diff --git a/server/src/main/java/org/uiautomation/ios/server/application/ServerSideL10NDecorator.java b/server/src/main/java/org/uiautomation/ios/server/application/ServerSideL10NDecorator.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/uiautomation/ios/server/application/ServerSideL10NDecorator.java +++ b/server/src/main/java/org/uiautomation/ios/server/application/ServerSideL10NDecorator.java @@ -39,6 +39,7 @@ public class ServerSideL10NDecorator implements CriteriaDecorator { criteria.setValue(LanguageDictionary.getRegexPattern(newValue)); criteria.setL10nstrategy(L10NStrategy.none); + criteria.setMatchingStrategy(MatchingStrategy.regex); } private void decorateMatching(Criteria c) {
bug fix. Wouldn't work with variable without regex matching
ios-driver_ios-driver
train
java
f7fb3c6d9b67e1ff42a3d9a27a2f5cb0631f90c7
diff --git a/lib/raven/cli.rb b/lib/raven/cli.rb index <HASH>..<HASH> 100644 --- a/lib/raven/cli.rb +++ b/lib/raven/cli.rb @@ -47,7 +47,11 @@ module Raven end if evt && !(evt.is_a? Thread) - puts "-> event ID: #{evt.id}" + if evt.is_a? Hash + puts "-> event ID: #{evt[:event_id]}" + else + puts "-> event ID: #{evt.id}" + end elsif evt #async configuration puts "-> event ID: #{evt.value.id}" else
check whether returned event is a Hash
getsentry_raven-ruby
train
rb
df847d372786e382cba7d3ee4d384c7fea6a7aba
diff --git a/wayback-core/src/main/java/org/archive/wayback/archivalurl/ArchivalURLJSStringTransformerReplayRenderer.java b/wayback-core/src/main/java/org/archive/wayback/archivalurl/ArchivalURLJSStringTransformerReplayRenderer.java index <HASH>..<HASH> 100644 --- a/wayback-core/src/main/java/org/archive/wayback/archivalurl/ArchivalURLJSStringTransformerReplayRenderer.java +++ b/wayback-core/src/main/java/org/archive/wayback/archivalurl/ArchivalURLJSStringTransformerReplayRenderer.java @@ -102,6 +102,7 @@ public class ArchivalURLJSStringTransformerReplayRenderer extends TextReplayRend context.setOutputCharset("utf-8"); context.setOutputStream(baos); context.setJspExec(jspExec); + context.setInJS(true); //for https://webarchive.jira.com/browse/ARI-3762 String policy = result.getOraclePolicy();
Add ability to rewrite JS files.
iipc_openwayback
train
java
715e7754afba596a5f0d8e879502e8571b600028
diff --git a/lib/plum/rack/session.rb b/lib/plum/rack/session.rb index <HASH>..<HASH> 100644 --- a/lib/plum/rack/session.rb +++ b/lib/plum/rack/session.rb @@ -195,7 +195,6 @@ module Plum if "set-cookie" == key rbase[key] = v_.gsub("\n", "; ") # RFC 7540 8.1.2.5 elsif !INVALID_HEADERS.member?(key) - key.byteshift(2) if key.start_with?("x-") rbase[key] = v_.tr("\n", ",") # RFC 7230 7 end end
rack/session: don't remove x-
rhenium_plum
train
rb
586fda1ddf02c7ccb215a124cfb76bf88b058153
diff --git a/srv/handler/rest/ResourceHandler.js b/srv/handler/rest/ResourceHandler.js index <HASH>..<HASH> 100644 --- a/srv/handler/rest/ResourceHandler.js +++ b/srv/handler/rest/ResourceHandler.js @@ -129,13 +129,16 @@ define(['js/core/Component', 'srv/core/HttpError', 'flow', 'require', 'JSON', 'j }) .exec(function (err, results) { if (!err) { - callback && callback(null, results.parent.getCollection(self.$resourceConfiguration.$.path)); + var collection = results.parent.getCollection(self.$resourceConfiguration.$.path); + collection.$context.$dataSource = self.$restHandler.getDataSource(context, self); + callback && callback(null, collection); } else { callback && callback(err); } }); } else { - callback && callback(null, context.dataSource.createCollection(Collection.of(this._getModelFactory()), {pageSize: 100})); + var dataSource = this.$restHandler.getDataSource(context, this); + callback && callback(null, dataSource.createCollection(Collection.of(this._getModelFactory()), {pageSize: 100})); } },
corrected DataSource determination for ResourceHandler findCollection
rappid_rAppid.js
train
js
2d8f1e1fb589b8debfc343ceb5831c059fa48d96
diff --git a/spec/controllers/think_feel_do_dashboard/arms_controller_spec.rb b/spec/controllers/think_feel_do_dashboard/arms_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/think_feel_do_dashboard/arms_controller_spec.rb +++ b/spec/controllers/think_feel_do_dashboard/arms_controller_spec.rb @@ -40,7 +40,7 @@ module ThinkFeelDoDashboard sign_in_user authorized_user end - it "should redirect to the application root" do + it "should render the index page" do get :index expect(response).to render_template :index end @@ -68,7 +68,7 @@ module ThinkFeelDoDashboard sign_in_user authorized_user end - it "should redirect to the application root" do + it "should render the show page" do expect(Arm).to receive(:find) { arm } expect(bit_core_tools).to receive(:find_by_type) { double("Tools") } get :show, id: 1
Update spec descriptions to apply to tests. [#<I>]
NU-CBITS_think_feel_do_dashboard
train
rb
42c0c9ba1cd1e94c19a564b7b7b207d09fc8d6ee
diff --git a/trimesh/convex.py b/trimesh/convex.py index <HASH>..<HASH> 100644 --- a/trimesh/convex.py +++ b/trimesh/convex.py @@ -32,7 +32,7 @@ def convex_hull(mesh, clean=True): ''' type_trimesh = type_named(mesh, 'Trimesh') - c = ConvexHull(mesh.vertices.view(np.ndarray).reshape((-1,3))) + c = ConvexHull(mesh.vertices.view(np.ndarray).reshape((-1,3)), qhull_options='QbB') vid = np.sort(c.vertices) mask = np.zeros(len(c.points), dtype=np.int64) diff --git a/trimesh/version.py b/trimesh/version.py index <HASH>..<HASH> 100644 --- a/trimesh/version.py +++ b/trimesh/version.py @@ -1 +1 @@ -__version__ = '1.15.13' +__version__ = '1.15.14'
added QbB option to qhull
mikedh_trimesh
train
py,py
c28694dc38a2ce3aa7a2f1b3153d6b497ea509e5
diff --git a/auth/cas/auth.php b/auth/cas/auth.php index <HASH>..<HASH> 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -422,6 +422,7 @@ class auth_plugin_cas extends auth_plugin_ldap { // Test for group creator if (!empty($this->config->groupecreators)) { + $ldapconnection = $this->ldap_connect(); if ($this->config->memberattribute_isdn) { if(!($userid = $this->ldap_find_userdn($ldapconnection, $extusername))) { return false;
MDL-<I> auth_cas: Fixed issue with undefined variable: ldapconnection
moodle_moodle
train
php
bece93550bfb0163060a40b8ee4a16b97a8c563d
diff --git a/Resources/Private/JavaScript/Host/Process/InspectorEditorRegistry/index.js b/Resources/Private/JavaScript/Host/Process/InspectorEditorRegistry/index.js index <HASH>..<HASH> 100644 --- a/Resources/Private/JavaScript/Host/Process/InspectorEditorRegistry/index.js +++ b/Resources/Private/JavaScript/Host/Process/InspectorEditorRegistry/index.js @@ -1,4 +1,5 @@ import load from 'Shared/Utilities/LoadScript'; +import {api} from 'Shared/Utilities/'; // // A simple registry for inspector editors @@ -49,11 +50,17 @@ export default (moduleMapping, legacyMapping = {}) => { console.warn('Host frame is asking for an unknown inspector editor.'); console.warn(`Cannot find: ${moduleName}. Do you have it correctly configured in your Settings.yaml?`); } else { + const {systemEnv} = api.get(); + // // Display a deprecation warning at this point, that instructs the developer to // migrate to the new identifier convention for UI extensions // - if (moduleMapping[moduleName] === undefined && legacyMapping[moduleName] !== undefined) { + if ( + moduleMapping[moduleName] === undefined && + legacyMapping[moduleName] !== undefined && + systemEnv !== 'Development' + ) { console.warn(`${moduleName} is a deprecated editor identifier. Make sure to change it to ${legacyMapping[moduleName].migratesTo}.`); }
TASK: Supress warnings regarding deprecated editor identifiers in development for now
neos_neos-ui
train
js
005531ca309ba0c15bfe083070bbd2ff607710fb
diff --git a/middlewares/attributes.js b/middlewares/attributes.js index <HASH>..<HASH> 100644 --- a/middlewares/attributes.js +++ b/middlewares/attributes.js @@ -50,13 +50,13 @@ function processAttributeWithoutHandler (attribute) { if (type === '$') { const name = attribute.name.slice(1) if (!handlers.has(name)) { - const expression = this.$compileExpression(value || name) + const expression = this.$compileExpression(attribute.value || name) processExpression.call(this, expression, name, defaultHandler) } } else if (type === '@') { const name = attribute.name.slice(1) if (!handlers.has(name)) { - const expression = this.$compileExpression(value || name) + const expression = this.$compileExpression(attribute.value || name) this.$observe(processExpression, expression, name, defaultHandler) } }
fix(attributes): fix attribute value passing
nx-js_framework
train
js
2ac2dfd8f60683cbda548fffd5133a6125d98034
diff --git a/src/test/java/javax/util/streamex/StreamExTest.java b/src/test/java/javax/util/streamex/StreamExTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/javax/util/streamex/StreamExTest.java +++ b/src/test/java/javax/util/streamex/StreamExTest.java @@ -937,7 +937,10 @@ public class StreamExTest { assertEquals(Arrays.asList("This is the first sentence.", "This is the second sentence.", "Third sentence.", "Fourth sentence.", "Fifth sentence.", "The last"), sentences(StreamEx.of(lines)).toList()); - // Parallel stream for this test hits a JDK spliterator bug + assertEquals(Arrays.asList("This is the first sentence.", + "This is the second sentence.", "Third sentence.", "Fourth sentence.", + "Fifth sentence.", "The last"), sentences(StreamEx.of(lines)).parallel().toList()); + // Parallelling stream before the collapse for this test hits a JDK spliterator bug } @Test
StreamExTest#testStreamOfSentences: added parallelization after the collapse
amaembo_streamex
train
java
17474d91b31f7f93d403a2b29d9edec3dbd5e03a
diff --git a/src/main/java/com/github/davidcarboni/restolino/Main.java b/src/main/java/com/github/davidcarboni/restolino/Main.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/davidcarboni/restolino/Main.java +++ b/src/main/java/com/github/davidcarboni/restolino/Main.java @@ -2,10 +2,10 @@ package com.github.davidcarboni.restolino; import org.eclipse.jetty.security.SecurityHandler; import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.ResourceHandler; import com.github.davidcarboni.restolino.jetty.ApiHandler; import com.github.davidcarboni.restolino.jetty.BasicAuth; -import com.github.davidcarboni.restolino.jetty.FilesHandler; import com.github.davidcarboni.restolino.jetty.MainHandler; import com.github.davidcarboni.restolino.reload.ClassReloader; @@ -22,7 +22,7 @@ public class Main { public static Server server; public static MainHandler mainHandler; public static ApiHandler apiHandler; - public static FilesHandler filesHandler; + public static ResourceHandler filesHandler; public static SecurityHandler securityHandler; public static void main(String[] args) throws Exception {
Changed type of filesHandler to ResourceHandler so it can take a GzipHandler.
davidcarboni_restolino
train
java
b0319d0057677924f185836b4134c3aba337118d
diff --git a/source/to-stateful.js b/source/to-stateful.js index <HASH>..<HASH> 100644 --- a/source/to-stateful.js +++ b/source/to-stateful.js @@ -9,8 +9,6 @@ const getConfigs = require('./utils/get-configs'); const toStatefulTransform = require('./transforms/to-stateful'); const writeFile = require('./utils/write-file'); -const diff = require('./utils/diff'); - module.exports = function(pathOrName) { getConfigs(({ eslintrc, prettierConfig, componentsPath }) => { getComponent( @@ -34,12 +32,10 @@ module.exports = function(pathOrName) { prettierConfig ); - diff(fileContent, newFileContent); - - // writeFile( - // filePath, - // newFileContent, - // `🤖 ${chalk.green(`Beep boop, I'm done!`)}` - // ); + writeFile( + filePath, + newFileContent, + `🤖 ${chalk.green(`Beep boop, I'm done!`)}` + ); } };
removed debug logging from to-stateful and enabled writing to file
Creuna-Oslo_react-scripts
train
js
b2764e31de068292d1d87fc60d0f6b8510963fb7
diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py index <HASH>..<HASH> 100644 --- a/sos/plugins/kernel.py +++ b/sos/plugins/kernel.py @@ -30,6 +30,7 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): # compat self.add_cmd_output("uname -a", root_symlink="uname") self.add_cmd_output("lsmod", root_symlink="lsmod") + self.add_cmd_output("ls -lt /sys/kernel/slab") try: modules = os.listdir(self.sys_module)
[kernel] Add collection of /sys/kernel/slabs Needed when investigating slab related issue to identify how slabs are merged together. ls -lt shows symlink of merged slabs. Closes: #<I>, #<I>.
sosreport_sos
train
py
d2d5f15f0729d00132a240dd9e5169dce5962a0d
diff --git a/activerecord/lib/active_record/relation/merger.rb b/activerecord/lib/active_record/relation/merger.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/merger.rb +++ b/activerecord/lib/active_record/relation/merger.rb @@ -102,7 +102,9 @@ module ActiveRecord rhs_wheres = values[:where] || [] lhs_wheres = relation.where_values - relation.where_values = merged_wheres(lhs_wheres, rhs_wheres) + _, kept = partition_overwrites(lhs_wheres, rhs_wheres) + + relation.where_values = kept + rhs_wheres relation.bind_values = merged_binds if values[:reordering] @@ -134,10 +136,6 @@ module ActiveRecord end end - def merged_wheres(lhs_wheres, rhs_wheres) - partition_overwrites(lhs_wheres, rhs_wheres).last + rhs_wheres - end - # Remove equalities from the existing relation with a LHS which is # present in the relation being merged in. # returns [things_to_remove, things_to_keep]
push partitioning up so bind elimination can get the removed wheres
rails_rails
train
rb
2e46aa43c2f13386421f9387f41b323adae41908
diff --git a/version/version.go b/version/version.go index <HASH>..<HASH> 100644 --- a/version/version.go +++ b/version/version.go @@ -16,5 +16,7 @@ package version -const VERSION = "0.12.0" const TENDERMINT_VERSION = "0.5.0" +// IMPORTANT: Eris-DB version must be on the last line of this file for +// the deployment script DOCKER/build.sh to pick up the right label. +const VERSION = "0.12.0"
simple patch for current deployment shell script to pick up the correct version
hyperledger_burrow
train
go
0834dc5b01a9a2c29599cd550587e6780e3518c5
diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty10/src/main/java/smoketest/jetty10/service/HelloWorldService.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty10/src/main/java/smoketest/jetty10/service/HelloWorldService.java index <HASH>..<HASH> 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty10/src/main/java/smoketest/jetty10/service/HelloWorldService.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty10/src/main/java/smoketest/jetty10/service/HelloWorldService.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import org.springframework.stereotype.Component; @Component public class HelloWorldService { - @Value("${name:World}") + @Value("${test.name:World}") private String name; public String getHelloMessage() {
Polish "Update smoke tests to avoid conflicts with NAME environment variable" See gh-<I>
spring-projects_spring-boot
train
java
cdf4d8e5dac4d1774ca9a5202403c41bbd54c232
diff --git a/lib/kafka/broker.rb b/lib/kafka/broker.rb index <HASH>..<HASH> 100644 --- a/lib/kafka/broker.rb +++ b/lib/kafka/broker.rb @@ -38,7 +38,7 @@ module Kafka Protocol.handle_error(partition.partition_error_code) rescue ReplicaNotAvailable # This error can be safely ignored per the protocol specification. - @logger.warn "Replica not available for topic #{topic.topic_name}, partition #{partition.partition_id}" + @logger.warn "Replica not available for #{topic.topic_name}/#{partition.partition_id}" end end end
Use consistent names when referring to partitions
zendesk_ruby-kafka
train
rb
84390da3b55a39bf08dfa660c18a0a7c1a4efe99
diff --git a/lib/PHPPdf/Version.php b/lib/PHPPdf/Version.php index <HASH>..<HASH> 100644 --- a/lib/PHPPdf/Version.php +++ b/lib/PHPPdf/Version.php @@ -17,7 +17,7 @@ use PHPPdf\Exception\BadMethodCallException; */ final class Version { - const VERSION = '1.2.10'; + const VERSION = '1.2.11-DEV'; private function __construct() {
update version to <I>-DEV
psliwa_PHPPdf
train
php
f322f2792f347c176d34126d154191ddfdf118b3
diff --git a/lib/rets4r.rb b/lib/rets4r.rb index <HASH>..<HASH> 100644 --- a/lib/rets4r.rb +++ b/lib/rets4r.rb @@ -8,7 +8,6 @@ end require 'client' require 'loader' -require 'rubygems' require 'client/parsers/compact_nokogiri' require 'rets4r/listing_service' require 'rets4r/listing_mapper' diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100755 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,7 +4,6 @@ require 'test/unit' require 'rets4r' require 'mocha' require 'shoulda' -require 'rubygems' # Configure ListingService listing_service_config_file = File.expand_path(File.join('test', 'data', 'listing_service.yml'))
Don't require rubygems in runtime (dev is still okay) * lib/rets4r.rb, test/test_helper.rb: unrequire rubygems
josephholsten_rets4r
train
rb,rb
47b08ca72994d4027196b27e2b4efd8afa92cf43
diff --git a/lib/whois/record/parser/whois.networksolutions.com.rb b/lib/whois/record/parser/whois.networksolutions.com.rb index <HASH>..<HASH> 100644 --- a/lib/whois/record/parser/whois.networksolutions.com.rb +++ b/lib/whois/record/parser/whois.networksolutions.com.rb @@ -81,6 +81,9 @@ module Whois end end + def response_throttled? + !!(content_for_scanner =~ /The IP address from which you have visited/) + end private
Add support for #response_throttled?
weppos_whois
train
rb
eb1c7c309e9a033460b7165ffb14f668707b8b13
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ function Filter(inputTree, options) { throw new TypeError('Filter is an abstract class and must be sub-classed'); } - var name = 'cauliflower-filter:' + (this.constructor.name); + var name = 'broccoli-filter:' + (this.constructor.name); if (this.description) { name += ' > [' + this.description + ']'; } @@ -178,7 +178,7 @@ Filter.prototype.processFile = Filter.prototype.processString = function unimplementedProcessString(contents, relativePath) { throw new Error( - 'When subclassing cauliflower-filter you must implement the ' + + 'When subclassing broccoli-filter you must implement the ' + '`processString()` method.'); };
[CLEANUP] Change name in error and debug
broccolijs_broccoli-filter
train
js
357246d7c214324bec1cdf30eed99e1097be4c80
diff --git a/hawtio-maven-plugin/src/main/java/io/hawt/maven/CamelMojo.java b/hawtio-maven-plugin/src/main/java/io/hawt/maven/CamelMojo.java index <HASH>..<HASH> 100644 --- a/hawtio-maven-plugin/src/main/java/io/hawt/maven/CamelMojo.java +++ b/hawtio-maven-plugin/src/main/java/io/hawt/maven/CamelMojo.java @@ -41,7 +41,6 @@ public class CamelMojo extends RunMojo { Plugin plugin = (Plugin) obj; if ("org.apache.camel".equals(plugin.getGroupId()) && "camel-maven-plugin".equals(plugin.getArtifactId())) { Object config = plugin.getConfiguration(); - System.out.println(config); if (config instanceof Xpp3Dom) { Xpp3Dom dom = (Xpp3Dom) config; Xpp3Dom child = dom.getChild("mainClass");
#<I>: camel goal should pickup mainClass from camel-maven-plugin if none explict configured.
hawtio_hawtio
train
java
de915a67f7dbecddc54165502a09b27424cca012
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -6,7 +6,7 @@ var http = require('http'), var PORT = process.argv[2] || process.env['app_port'] || 1337; -var fileServer = new static.Server('./public'); +var fileServer = new static.Server(__dirname + '/public'); var server = http.createServer(function (request, response) { request.addListener('end', function () { fileServer.serve(request, response);
Support deployments where cwd is not app directory (eg nodester)
wachunga_omega
train
js
f6bfc71bc6c98d03e2f4e52b53654f8c51067f6d
diff --git a/lib/fs.js b/lib/fs.js index <HASH>..<HASH> 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -3,6 +3,7 @@ var fs = require('fs'); var crypto = require('crypto'); var path = require('path'); var mkdirp = require('mkdirp'); +var rmr = require('rmr'); //Generate the checksum of a file module.exports.checksum = function(file, opt, cb) @@ -92,7 +93,7 @@ module.exports.exists = function(file, cb) module.exports.mkdir = mkdirp; //Remove a list of files -module.exports.rm = function(files, cb) +module.exports.unlink = function(files, cb) { //Check the list of files if(typeof files === 'string'){ files = [ files ]; }
lib/fs.js: renamed rm to unlink
jmjuanes_utily
train
js
d7fe6f10c6b5c338d5d1928f2671ee45e1415fab
diff --git a/molgenis-data-elasticsearch/src/test/java/org/molgenis/data/elasticsearch/request/LimitOffsetGeneratorTest.java b/molgenis-data-elasticsearch/src/test/java/org/molgenis/data/elasticsearch/request/LimitOffsetGeneratorTest.java index <HASH>..<HASH> 100644 --- a/molgenis-data-elasticsearch/src/test/java/org/molgenis/data/elasticsearch/request/LimitOffsetGeneratorTest.java +++ b/molgenis-data-elasticsearch/src/test/java/org/molgenis/data/elasticsearch/request/LimitOffsetGeneratorTest.java @@ -4,7 +4,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import org.elasticsearch.action.search.SearchRequestBuilder; -import org.molgenis.data.elasticsearch.request.LimitOffsetGenerator; import org.molgenis.data.support.QueryImpl; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -32,7 +31,7 @@ public class LimitOffsetGeneratorTest { LimitOffsetGenerator gen = new LimitOffsetGenerator(); gen.generate(searchRequestBuilderMock, new QueryImpl(), null); - verify(searchRequestBuilderMock).setSize(Integer.MAX_VALUE); + verify(searchRequestBuilderMock).setSize(Integer.valueOf(1000)); } @Test
Fix test. De default value of the size when undefined is <I>.
molgenis_molgenis
train
java
7d779f287b0e313d1212e7183b202d91eccfa9a8
diff --git a/lib/Alchemy/Phrasea/Core/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration.php @@ -55,7 +55,11 @@ class Configuration try { + + //if one of this files are missing consider phraseanet not installed $handler->getSpecification()->getConfigurationFile(); + $handler->getSpecification()->getServiceFile(); + $handler->getSpecification()->getConnexionFile(); $this->installed = true; } @@ -353,7 +357,7 @@ class Configuration { return $this->getConfiguration()->get('template_engine'); } - + /** * Return cache service * @return string
check if service configuration file and connexion configuration file is present
alchemy-fr_Phraseanet
train
php
87d5488a4a5200642d0631a88ae3413cbb15f460
diff --git a/packages/kotlinc-js-api/kotlin-compiler.js b/packages/kotlinc-js-api/kotlin-compiler.js index <HASH>..<HASH> 100644 --- a/packages/kotlinc-js-api/kotlin-compiler.js +++ b/packages/kotlinc-js-api/kotlin-compiler.js @@ -49,6 +49,7 @@ function convertOptionsIntoArguments(options) { '-module-kind', options.moduleKind ); + argumentsList = addOptionWithValue(argumentsList, '-XPlugin', options.plugin); if (options.libraries && options.libraries.length) { argumentsList = argumentsList.concat( @@ -61,6 +62,11 @@ function convertOptionsIntoArguments(options) { if (options.experimental.multiPlatform) { argumentsList = argumentsList.concat('-Xmulti-platform'); } + if (options.experimental.customArguments) { + argumentsList = argumentsList.concat( + options.experimental.customArguments + ); + } } argumentsList = argumentsList.concat(options.sources);
CRKA-<I> XPlugin option support [Publish patch versions] As well as any custom argument
JetBrains_create-react-kotlin-app
train
js
78db16b3519099251d670dbcc96c782f63060f17
diff --git a/djstripe/checks.py b/djstripe/checks.py index <HASH>..<HASH> 100644 --- a/djstripe/checks.py +++ b/djstripe/checks.py @@ -128,11 +128,11 @@ def check_webhook_secret(app_configs=None, **kwargs): """ Check that DJSTRIPE_WEBHOOK_SECRET looks correct """ - from django.conf import settings + from . import settings as djstripe_settings messages = [] - secret = settings.DJSTRIPE_WEBHOOK_SECRET + secret = djstripe_settings.WEBHOOK_SECRET if secret and not secret.startswith("whsec_"): messages.append(checks.Warning( "DJSTRIPE_WEBHOOK_SECRET does not look valid", @@ -150,11 +150,11 @@ def check_subscriber_key_length(app_configs=None, **kwargs): Docs: https://stripe.com/docs/api#metadata """ - from django.conf import settings + from . import settings as djstripe_settings messages = [] - key = settings.DJSTRIPE_SUBSCRIBER_CUSTOMER_KEY + key = djstripe_settings.SUBSCRIBER_CUSTOMER_KEY key_size = len(str(key)) if key and key_size > 40: messages.append(checks.Error(
Fix django checks to run against djstripe_settings instead of core Otherwise it doesn't pick up defaults correctly
dj-stripe_dj-stripe
train
py
ee738826b52abeb84b59a661c4f10e12aad6d5a1
diff --git a/SwatDB/SwatDBRecordsetWrapper.php b/SwatDB/SwatDBRecordsetWrapper.php index <HASH>..<HASH> 100644 --- a/SwatDB/SwatDBRecordsetWrapper.php +++ b/SwatDB/SwatDBRecordsetWrapper.php @@ -202,7 +202,7 @@ abstract class SwatDBRecordsetWrapper extends SwatObject */ public function valid() { - return isset($this->objects[$this->current_index]); + return array_key_exists($this->current_index, $this->objects); } // }}}
Fix a bug where recordset wrappers containing null objects will not iterate properly. svn commit r<I>
silverorange_swat
train
php
60397292d156af4187c51acf37aa72a6e1cd660c
diff --git a/src/main/java/biweekly/io/StreamReader.java b/src/main/java/biweekly/io/StreamReader.java index <HASH>..<HASH> 100644 --- a/src/main/java/biweekly/io/StreamReader.java +++ b/src/main/java/biweekly/io/StreamReader.java @@ -165,7 +165,7 @@ public abstract class StreamReader implements Closeable { for (VTimezone component : ical.getComponents(VTimezone.class)) { //make sure the component has an ID String id = ValuedProperty.getValue(component.getTimezoneId()); - if (id == null) { + if (id == null || id.trim().length() == 0) { warnings.add(null, null, 39); toKeep.add(component); continue;
Ignore VTIMEZONE components that have an empty TZID property value. Previously, they were only ignored if the property was missing altogether.
mangstadt_biweekly
train
java
4e4cf3663a0ea02ee1e04a77be6a959af1f9768d
diff --git a/abilian/web/forms/__init__.py b/abilian/web/forms/__init__.py index <HASH>..<HASH> 100644 --- a/abilian/web/forms/__init__.py +++ b/abilian/web/forms/__init__.py @@ -10,6 +10,7 @@ from flask.ext.babel import gettext as _, ngettext as _n from wtforms.fields import HiddenField from wtforms.fields.core import Field +from wtforms_alchemy import model_form_factory from flask.ext.wtf.form import Form as BaseForm from abilian.core.logging import patch_logger @@ -52,6 +53,8 @@ class Form(BaseForm): return any(self[f].flags.required for f in fields) +ModelForm = model_form_factory(Form) + ### PATCH wtforms.field.core.Field #################### _PATCHED = False
abilian/web/forms: add ModelForm based on .Form
abilian_abilian-core
train
py
2e6ae0ae63f26698ac42b057ba50500165419bd8
diff --git a/lib/utils/build-name-from-env.js b/lib/utils/build-name-from-env.js index <HASH>..<HASH> 100644 --- a/lib/utils/build-name-from-env.js +++ b/lib/utils/build-name-from-env.js @@ -2,7 +2,7 @@ module.exports = function() { let buildNum = process.env.TRAVIS_JOB_NUMBER || process.env.BITBUCKET_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM; let prefix = process.env.BROWSERSTACK_BUILD_NAME_PREFIX; if (buildNum && prefix) { - return prefix + '-' + buildNum; + return prefix + '_' + buildNum; } return buildNum; }
Dashes are not allowed in build names, use underscore
kategengler_ember-cli-browserstack
train
js
054290a1edeb50ccb58448028700dacece353d7b
diff --git a/GLExchange/GLExchange.php b/GLExchange/GLExchange.php index <HASH>..<HASH> 100644 --- a/GLExchange/GLExchange.php +++ b/GLExchange/GLExchange.php @@ -8,7 +8,10 @@ require_once 'pd_ws/client/WorkflowService_4180.php'; require_once 'model/Project.inc.php'; require_once 'model/Submission.inc.php'; require_once 'model/Target.inc.php'; -define ( 'GL_WSDL_PATH', __DIR__ . '/pd_ws/wsdl/' ); + +if (!defined('GL_WSDL_PATH')) { + define('GL_WSDL_PATH', dirname(__FILE__) . '/pd_ws/wsdl/'); +} define ( 'USER_PROFILE_SERVICE_WSDL', GL_WSDL_PATH . 'UserProfileService_4180.wsdl' ); define ( 'SUBMISSION_SERVICE_WSDL', GL_WSDL_PATH . 'SubmissionService_4180.wsdl' ); define ( 'WORKFLOW_SERVICE_WSDL', GL_WSDL_PATH . 'WorkflowService_4180.wsdl' );
GL_WSDL_PATH now can be redefined
translations-com_globallink-connect-api-php
train
php
acaaf35b2e52c0c36edd01ec8cad499133a990c1
diff --git a/trashcli/put.py b/trashcli/put.py index <HASH>..<HASH> 100644 --- a/trashcli/put.py +++ b/trashcli/put.py @@ -17,7 +17,7 @@ def main(): os.environ, volume_of, os.path.dirname, - lambda x:x + os.path.realpath ).run(sys.argv) def parent_path(path):
Now recognizes the right volume even when the home trash can is a link to another volume
andreafrancia_trash-cli
train
py
37ea77f2dbb02024648b5bafe1476cb6154979ff
diff --git a/test/fs-memory-store_test.js b/test/fs-memory-store_test.js index <HASH>..<HASH> 100644 --- a/test/fs-memory-store_test.js +++ b/test/fs-memory-store_test.js @@ -162,6 +162,30 @@ describe('A non-existent value from disk', function () { it('loads its value', function () { expect(this.val).to.deep.equal({sun: true}); }); + + describe('and deleted from disk', function () { + storeUtils['delete']('hello'); + + it('has no errors', function () { + expect(this.err).to.equal(null); + }); + + describe('and loaded from disk', function () { + before(function (done) { + var store = new Store(this.dir.path); + var that = this; + store.get('hello', function (err, val) { + that.val = val; + done(err); + }); + }); + + it('loads nothing', function () { + expect(this.err).to.equal(null); + expect(this.val).to.equal(null); + }); + }); + }); }); }); });
Added more tests for to/from disk
twolfson_fs-memory-store
train
js
228d56e5aa46c4ba72dbde2c3c17e3058dda8318
diff --git a/lib/plugin/components/services/statebox/index.js b/lib/plugin/components/services/statebox/index.js index <HASH>..<HASH> 100644 --- a/lib/plugin/components/services/statebox/index.js +++ b/lib/plugin/components/services/statebox/index.js @@ -151,12 +151,11 @@ class StateboxService { return promiseOrCallback(p, callback) } // waitUntilStoppedRunning - /* authorisationCheck (stateMachineName, executionOptions, action) { return [true] // STUB! } - */ + /* async authorisationCheck (userId, stateMachineName, executionOptions, action) { const rbac = this.services.rbac @@ -184,6 +183,7 @@ class StateboxService { } ] } // authorisationCheck + */ } // class StateboxService function addResources (statebox, options) { diff --git a/test/statebox-service-acl-tests.js b/test/statebox-service-acl-tests.js index <HASH>..<HASH> 100644 --- a/test/statebox-service-acl-tests.js +++ b/test/statebox-service-acl-tests.js @@ -46,7 +46,7 @@ const heartBeatTests = [ } ] -describe('statebox service RBAC authorisation tests', function () { +xdescribe('statebox service RBAC authorisation tests', function () { this.timeout(process.env.TIMEOUT || 5000) let tymlyService
refactor: disable statebox RBAC again :) affects: tymly
wmfs_tymly-core
train
js,js
85c813441dbbfdc1a3413b6bd8aba562da06fb7d
diff --git a/autopython/cpython.py b/autopython/cpython.py index <HASH>..<HASH> 100644 --- a/autopython/cpython.py +++ b/autopython/cpython.py @@ -4,9 +4,9 @@ import io import sys from code import InteractiveInterpreter -from .highlighter import HAVE_HIGHLIGHTING -from .highlighter import highlight, ansiformat, get_color_for, COLOR_SCHEMES -from .highlighter import Token, TerminalFormatter, Python3Lexer, TracebackLexer +from .highlighter import HAVE_HIGHLIGHTING, highlight, ansiformat, Token +from .highlighter import TerminalFormatter, get_color_for, COLOR_SCHEMES +from .highlighter import Python3Lexer, TracebackLexer, LineLexer from .interactions import simulate_typing, ask_index @@ -58,6 +58,8 @@ class PresenterShell(object): self._hl_ps1 = ansiformat(color, self._ps1) self._hl_ps2 = ansiformat(color, self._ps2) self._lexer = Python3Lexer() + else: + self._lexer = LineLexer() def _colored(self, color, text): return ansiformat(color, text) if self._color_scheme else text
The CPython backend fails with no highlightling
gosella_autopython
train
py
be04871afbd45efc41b20accc1bb634f9d49a895
diff --git a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java b/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java index <HASH>..<HASH> 100644 --- a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java +++ b/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java @@ -886,7 +886,7 @@ public class ToPojo implements Function<TypeDef, TypeDef> { } return sb.toString(); } - if (Constants.STRING_REF.equals(p.getTypeRef()) && !String.valueOf(value).startsWith("\"")) { + if (Constants.STRING_REF.equals(p.getTypeRef()) && value != null && !String.valueOf(value).startsWith("\"")) { return "\"" + value + "\""; } else if (value instanceof Element) { Element element = (Element) value;
fix: do not wrap default value in double quotes if its actually null.
sundrio_sundrio
train
java
c25a5d59000dfa0d53747c969a1c0eb622edba20
diff --git a/SimpleImage.class.php b/SimpleImage.class.php index <HASH>..<HASH> 100755 --- a/SimpleImage.class.php +++ b/SimpleImage.class.php @@ -300,6 +300,9 @@ class SimpleImage { // public function best_fit($max_width, $max_height) { + // If it already fits, there's nothing to do + if( $this->width <= $max_width && $this->height <= $max_height ) return $this; + // Determine aspect ratio $aspect_ratio = $this->height / $this->width;
Added check in best_fit() so no scaling will take place if the image already fits.
claviska_SimpleImage
train
php
1cbf9eebcf389eec3d2f90f70ad0d2fa4de41412
diff --git a/library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java b/library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java +++ b/library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java @@ -239,7 +239,6 @@ public abstract class BaseItemAnimator<T> extends SimpleItemAnimator { } private void animateRemoveImpl(final ViewHolder holder) { - final View view = holder.itemView; final ViewPropertyAnimatorCompat animation = removeAnimation(holder); mRemoveAnimations.add(holder); animation.setListener(new VpaListenerAdapter() { @@ -272,7 +271,6 @@ public abstract class BaseItemAnimator<T> extends SimpleItemAnimator { } private void animateAddImpl(final ViewHolder holder) { - final View view = holder.itemView; final ViewPropertyAnimatorCompat animation = addAnimation(holder); mAddAnimations.add(holder); animation. @@ -293,6 +291,7 @@ public abstract class BaseItemAnimator<T> extends SimpleItemAnimator { dispatchAddFinished(holder); mAddAnimations.remove(holder); dispatchFinishedWhenDone(); + addAnimationCleanup(holder); } }).start(); }
* also cleanup and make sure the added item displays correctly after animation finished
mikepenz_ItemAnimators
train
java
e64a1b38a43a75eb37df07bc0ad5a1863bdc508f
diff --git a/packages/jsreport-chrome-pdf/jsreport.config.js b/packages/jsreport-chrome-pdf/jsreport.config.js index <HASH>..<HASH> 100644 --- a/packages/jsreport-chrome-pdf/jsreport.config.js +++ b/packages/jsreport-chrome-pdf/jsreport.config.js @@ -30,6 +30,10 @@ module.exports = { main: 'lib/main.js', worker: 'lib/worker.js', optionsSchema: { + migrateChromeNetworkIdleProp: { + type: 'boolean', + default: true + }, chrome: { ...chromeSchema }, extensions: { 'chrome-pdf': { ...chromeSchema } diff --git a/packages/jsreport-chrome-pdf/lib/main.js b/packages/jsreport-chrome-pdf/lib/main.js index <HASH>..<HASH> 100644 --- a/packages/jsreport-chrome-pdf/lib/main.js +++ b/packages/jsreport-chrome-pdf/lib/main.js @@ -8,6 +8,10 @@ const os = require('os') const numCPUs = os.cpus().length async function ensureMigrated (reporter) { + if (reporter.options.migrateChromeNetworkIdleProp === false) { + return + } + const migrated = await reporter.settings.findValue('chrome-network-idle-migrated') if (migrated) {
add option to disable chrome network idle migration
jsreport_jsreport
train
js,js
1ef13084c3e6931e68645d777b99d6b3e1644ba4
diff --git a/eventsourcing/infrastructure/transcoding.py b/eventsourcing/infrastructure/transcoding.py index <HASH>..<HASH> 100644 --- a/eventsourcing/infrastructure/transcoding.py +++ b/eventsourcing/infrastructure/transcoding.py @@ -28,14 +28,14 @@ class StoredEventTranscoder(six.with_metaclass(ABCMeta)): def deserialize(self, stored_event): """Returns a domain event, for the given stored event.""" - +# Todo: Reimplement the object encoding and decoding, this time under test. class ObjectJSONEncoder(JSONEncoder): def default(self, obj): if isinstance(obj, datetime.datetime): return {'ISO8601_datetime': obj.strftime('%Y-%m-%dT%H:%M:%S.%f%z')} elif isinstance(obj, datetime.date): return {'ISO8601_date': obj.isoformat()} - # Let the base class default method raise the TypeError + # Let the base class default method raise the TypeError. return JSONEncoder.default(self, obj)
Added a todo, to remember to reimplement object class transcoding.
johnbywater_eventsourcing
train
py
db0b06c70ad83743fd937d3f3c77713310d43c02
diff --git a/test/validator.js b/test/validator.js index <HASH>..<HASH> 100644 --- a/test/validator.js +++ b/test/validator.js @@ -9,6 +9,16 @@ const validator = new Validator({ tags: 'required|in:1,2,3,5' }); +test('it can be initialized with static create method', t => { + const validator2 = Validator.create(); + t.true(validator2 instanceof Validator); +}); + +test('it can be initialized without validations', t => { + const validator2 = new Validator(); + t.true(validator2 instanceof Validator); +}); + test('it validates all values', t => { const result = validator.validateAll({ email: 'foo@bar.com',
<I>% coverage across the board
baianat_vee-validate
train
js
c7e26ee24ed294fde6aff9d5a80981c32895ce4f
diff --git a/src/test/java/org/inferred/freebuilder/processor/AnalyserTest.java b/src/test/java/org/inferred/freebuilder/processor/AnalyserTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/inferred/freebuilder/processor/AnalyserTest.java +++ b/src/test/java/org/inferred/freebuilder/processor/AnalyserTest.java @@ -470,7 +470,7 @@ public class AnalyserTest { } @Test - public void abstractMethodNamedGetürkt() throws CannotGenerateCodeException { + public void abstractMethodWithNonAsciiName() throws CannotGenerateCodeException { Metadata dataType = analyser.analyse(model.newType( "package com.example;", "public class DataType {",
Remove non-ASCII character from method name
inferred_FreeBuilder
train
java
6e23449c626dc7eb7b85c606c6f9cdc726b4938c
diff --git a/hazelcast/src/test/java/com/hazelcast/client/impl/connection/tcp/AdvancedNetworkingClientCommunicationIntegrationTest.java b/hazelcast/src/test/java/com/hazelcast/client/impl/connection/tcp/AdvancedNetworkingClientCommunicationIntegrationTest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/client/impl/connection/tcp/AdvancedNetworkingClientCommunicationIntegrationTest.java +++ b/hazelcast/src/test/java/com/hazelcast/client/impl/connection/tcp/AdvancedNetworkingClientCommunicationIntegrationTest.java @@ -58,6 +58,7 @@ public class AdvancedNetworkingClientCommunicationIntegrationTest extends Abstra ClientConfig clientConfig = new ClientConfig(); clientConfig.getNetworkConfig().addAddress("127.0.0.1:" + port); clientConfig.getNetworkConfig().setConnectionTimeout(3000); + clientConfig.getConnectionStrategyConfig().getConnectionRetryConfig().setClusterConnectTimeoutMillis(3000); return HazelcastClient.newHazelcastClient(clientConfig); }
Set retry timeout in the test to prevent test timeout (#<I>)
hazelcast_hazelcast
train
java
ff74b061b4cd7a165e5f448d35b5f03fb28b6096
diff --git a/webview/platforms/winforms.py b/webview/platforms/winforms.py index <HASH>..<HASH> 100644 --- a/webview/platforms/winforms.py +++ b/webview/platforms/winforms.py @@ -587,13 +587,13 @@ def get_current_url(uid): return CEF.get_current_url(uid) else: window = BrowserView.instances[uid] - window.events.loaded.wait() + window.loaded.wait() return window.browser.url def load_url(url, uid): window = BrowserView.instances[uid] - window.events.loaded.clear() + window.loaded.clear() if is_cef: CEF.load_url(url, uid)
[Winforms] fix loaded events
r0x0r_pywebview
train
py
29599e4c74ae93ff2b4c5b6eb9dc3aae80a21ce7
diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index <HASH>..<HASH> 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -514,6 +514,7 @@ Use URL `%(newurl)s' instead for checking.""") % { self.headers.getheader("Content-Length") != "0"): # always read content from persistent connections self._read_content(response) + assert not response.will_close # If possible, use official W3C HTTP response name if response.status in httpresponses: response.reason = httpresponses[response.status]
Make sure persistent connection will not close after reading contents.
wummel_linkchecker
train
py
429ce883800886831613a390459d0093e321c27a
diff --git a/lib/github/html/filter.rb b/lib/github/html/filter.rb index <HASH>..<HASH> 100644 --- a/lib/github/html/filter.rb +++ b/lib/github/html/filter.rb @@ -159,7 +159,7 @@ module GitHub::HTML def initialize(text, context = nil, result = nil) raise TypeError, "text cannot be HTML" if text.is_a?(DocumentFragment) - @text = text.to_str + @text = text.try(:to_str) super nil, context, result end end
Don't fail Filter on nil strings
jch_html-pipeline
train
rb
2de7a4c76a20c8cc8debd9046f434e7a95614fa2
diff --git a/lib/Cli.php b/lib/Cli.php index <HASH>..<HASH> 100644 --- a/lib/Cli.php +++ b/lib/Cli.php @@ -289,7 +289,7 @@ class Cli $this->log($this->colorize('green', ' validate').' source_file Validates a file for correctness.'); $this->log($this->colorize('green', ' repair').' source_file [output_file] Repairs a file.'); $this->log($this->colorize('green', ' convert').' source_file [output_file] Converts a file.'); - $this->log($this->colorize('green', ' color').' source_file Colorize a file, useful for debbugging.'); + $this->log($this->colorize('green', ' color').' source_file Colorize a file, useful for debugging.'); $this->log( <<<HELP
Fixed typo in vobject CLI help (#<I>)
sabre-io_vobject
train
php
97360c71111e452cb3f8473880d64f685eb9ea82
diff --git a/lib/hello_sign/parameters/unclaimed_draft.rb b/lib/hello_sign/parameters/unclaimed_draft.rb index <HASH>..<HASH> 100644 --- a/lib/hello_sign/parameters/unclaimed_draft.rb +++ b/lib/hello_sign/parameters/unclaimed_draft.rb @@ -3,7 +3,7 @@ require 'hello_sign/file' module HelloSign module Parameters class UnclaimedDraft - attr_writer :files, :upload_io_source + attr_writer :files def formatted {file: files} diff --git a/lib/hello_sign/proxy/account.rb b/lib/hello_sign/proxy/account.rb index <HASH>..<HASH> 100644 --- a/lib/hello_sign/proxy/account.rb +++ b/lib/hello_sign/proxy/account.rb @@ -4,7 +4,6 @@ module HelloSign module Proxy class Account attr_reader :client - attr_writer :settings_proxy_source def initialize(client) @client = client
Remove unnecessary attr_writers
craiglittle_hello_sign
train
rb,rb
4cfd18e25f30c225f3a57c3fbb8f0e0bcb55ec6d
diff --git a/lib/phantomscript.js b/lib/phantomscript.js index <HASH>..<HASH> 100644 --- a/lib/phantomscript.js +++ b/lib/phantomscript.js @@ -46,7 +46,7 @@ var options = { width: width, outputSuffix: system.args[9] } -var log = logger(options.verbose) +// var log = logger(options.verbose) options.sequenceConfig.useMaxWidth = false page.content = [ @@ -109,12 +109,13 @@ files.forEach(function (file) { , serialize.serializeToString(oDOM) + '\n' , 'w' ) - log('saved svg: ' + filename + '.svg') + console.log('saved svg: ' + filename + '.svg') } }) window.phantom.exit() +/* function logger (_verbose) { var verbose = _verbose @@ -130,6 +131,7 @@ function logger (_verbose) { } } } +*/ function resolveSVGElement (element) { var prefix = {
Output all CLI log messages in the same way
knsv_mermaid
train
js
dadfe51276a570d4099f9ab18619502eccd62d5e
diff --git a/spec/shared_stripe_examples/customer_examples.rb b/spec/shared_stripe_examples/customer_examples.rb index <HASH>..<HASH> 100644 --- a/spec/shared_stripe_examples/customer_examples.rb +++ b/spec/shared_stripe_examples/customer_examples.rb @@ -226,7 +226,7 @@ shared_examples 'Customer API' do discount = Stripe::Customer.retrieve(customer.id).discount expect(discount).to_not be_nil expect(discount.coupon).to_not be_nil - expect(discount.end).to be_within(1).of (Time.now + 365 * 24 * 3600).to_i + expect(discount.end).to be_within(1).of (Time.now.to_datetime >> 12).to_time.to_i end after { Stripe::Coupon.retrieve(coupon.id).delete } after { Stripe::Customer.retrieve(customer.id).delete }
Fix discount end spec * Calculating <I> months from now by using `Time.now + <I> * <I> * <I>` does not account for the upcoming leap year in <I> and is therefore off by 1 day. * Using `DateTime` to add <I> months is able to account for the leap year
rebelidealist_stripe-ruby-mock
train
rb
93d2cbf0d9a8bd0c515e20606c7a2137ddfcf289
diff --git a/src/bbn/mvc.php b/src/bbn/mvc.php index <HASH>..<HASH> 100644 --- a/src/bbn/mvc.php +++ b/src/bbn/mvc.php @@ -777,7 +777,10 @@ class mvc $this->obj->postscript = \JShrink\Minifier::minify($this->obj->postscript); } } - + if ( !isset($this->obj->output) ){ + header('HTTP/1.0 404 Not Found'); + exit(); + } switch ( $this->mode ){ case 'json': @@ -796,15 +799,6 @@ class mvc break; case 'dom': case 'html': - case 'js': - case 'text': - case 'xml': - if ( !isset($this->obj->output) ){ - header('HTTP/1.0 404 Not Found'); - exit(); - } - case 'dom': - case 'html': if ( !ob_start("ob_gzhandler" ) ){ ob_start(); }
discovered a new stuff in switch statements... Argh!
nabab_bbn
train
php
b231a6b7860d651c092716cc2ea42d1ddcc559bd
diff --git a/src/Thruway/Transport/PawlTransportProvider.php b/src/Thruway/Transport/PawlTransportProvider.php index <HASH>..<HASH> 100644 --- a/src/Thruway/Transport/PawlTransportProvider.php +++ b/src/Thruway/Transport/PawlTransportProvider.php @@ -77,7 +77,7 @@ class PawlTransportProvider extends AbstractTransportProvider implements EventEm $this->connector->__invoke($this->URL, ['wamp.2.json'])->then( function (WebSocket $conn) { - echo "Pawl has connected"; + echo "Pawl has connected\n"; $transport = new PawlTransport($conn); @@ -94,7 +94,7 @@ class PawlTransportProvider extends AbstractTransportProvider implements EventEm $conn->on( 'close', function ($conn) { - echo "Pawl has closed"; + echo "Pawl has closed\n"; $this->peer->onClose('close'); } );
Newline added to console outputs of Pawl
voryx_Thruway
train
php
7f83195c980177f2a14a83163baaa3389f83c4eb
diff --git a/Support/ArrayWrapper.php b/Support/ArrayWrapper.php index <HASH>..<HASH> 100644 --- a/Support/ArrayWrapper.php +++ b/Support/ArrayWrapper.php @@ -227,18 +227,26 @@ class ArrayWrapper } /** - * Filter using the given callback. + * Filter using the given closure function. * - * @param callable $callback + * @param Closure $filter The filter function should be a closure with the + * following signature: + * + * ```php + * function($key, $value) + * { + * // returns true if the value is matching your criteria. + * } + * ``` * * @return array */ - public function where(callable $callback) + public function where(\Closure $filter) { $filtered = []; foreach ($this->array as $key => $value) { - if (call_user_func($callback, $key, $value)) { + if ($filter($key, $value) === true) { $filtered[$key] = $value; } }
Changed callback type to Closure at `where` method
spress_spress-core
train
php
5898486c26a6d911264b5c59d8ed556f1e42ab50
diff --git a/mothernature/environment.py b/mothernature/environment.py index <HASH>..<HASH> 100644 --- a/mothernature/environment.py +++ b/mothernature/environment.py @@ -4,10 +4,13 @@ import yaml class Environment(): - def __init__(self, config_file): + def __init__(self, config_file, environment=None): self.environment = "COMMON" - if len(sys.argv) > 1: - self.environment = sys.argv[1] + if environment: + self.environment = environment + else: + if len(sys.argv) > 1: + self.environment = sys.argv[1] with open(config_file, "r") as config: self.all_config = yaml.load(config)
Added ability pass environment in the code directly
femmerling_mothernature
train
py
630562664c6423e3ca3bbe4eadab651f65a7e5a5
diff --git a/Kwc/Directories/List/Trl/Component.php b/Kwc/Directories/List/Trl/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Directories/List/Trl/Component.php +++ b/Kwc/Directories/List/Trl/Component.php @@ -48,6 +48,18 @@ class Kwc_Directories_List_Trl_Component extends Kwc_Abstract_Composite_Trl_Comp return $ret; } + public function getItemIds($select = null) + { + $ret = array(); + $items = $this->getItems($select); + foreach ($items as $item) { + if ($item) { + $ret[] = $item->id; + } + } + return $ret; + } + public function getSelect() { $itemDirectory = $this->getItemDirectory();
Add getItemIds for Trl-Directory
koala-framework_koala-framework
train
php
29eb920dc311364c2ee892633ec8f70747463b19
diff --git a/app/openbel/api/middleware/auth.rb b/app/openbel/api/middleware/auth.rb index <HASH>..<HASH> 100644 --- a/app/openbel/api/middleware/auth.rb +++ b/app/openbel/api/middleware/auth.rb @@ -13,7 +13,7 @@ module OpenBEL ::JWT.decode(token, secret, verify, options) end - def self.check_cookie(env) + def self.check_token(env) cookie_hdr = env['HTTP_COOKIE'] auth_hdr = env['HTTP_AUTHORIZATION'] if cookie_hdr.nil? and auth_hdr.nil? @@ -90,7 +90,7 @@ module OpenBEL if check begin - JWTMiddleware.check_cookie(env) + JWTMiddleware.check_token(env) rescue Exception => e return _401(e.message) end
check_cookie -> check_token We're not exclusively seeing Cookie.
OpenBEL_openbel-api
train
rb