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 |
|---|---|---|---|---|---|
30257c4c3c3510666591c01173714ed3662145c5 | diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -1331,6 +1331,8 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
$response = new Response($response);
}
+ $response->prepare(Request::capture());
+
return $response;
} | Resolved the problem where response()->download() was returning 0 bytes. | laravel_lumen-framework | train | php |
07e7936ebb6615f7bb164e0ab9da541ced4a69cb | diff --git a/src/match.js b/src/match.js
index <HASH>..<HASH> 100644
--- a/src/match.js
+++ b/src/match.js
@@ -41,9 +41,18 @@ function matchPrefix(matcher) {
return result
}
+function makePathFromQS(qs, ids, path='', delim=',') {
+ let values = ids.map(id => {
+ let rx = new RegExp(`${escapeRx(id)}=([^&#]+)`, 'i')
+ return q.split(rx).slice(1).filter(s => !/^[&#]/.test(s)).join(delim)
+ })
+ return substitute([path, ...values], new Array(ids.length).fill('/'))
+}
+
function prematch(prespec, msg) {
- let { prefix, p } = msg
- p = pipe(normalizePath(prefix), prespec, normalizePath())(p)
+ let { prefix, p, qs, path } = msg
+ let makePath = makePathFromQS.bind(null, q)
+ p = pipe(normalizePath(prefix), prespec.bind(null, makePath, path), normalizePath())(p)
return p === msg.p ? msg : Object.assign({}, msg, { p })
} | new makePathFromQS fn for prespec | gt3_ultra-router | train | js |
6fd544a00682f125a64dba017e4a733aa9bc31e4 | diff --git a/resources/views/bread/browse.blade.php b/resources/views/bread/browse.blade.php
index <HASH>..<HASH> 100644
--- a/resources/views/bread/browse.blade.php
+++ b/resources/views/bread/browse.blade.php
@@ -225,11 +225,13 @@
<script>
$(document).ready(function () {
@if (!$dataType->server_side)
- var table = $('#dataTable').DataTable({
- "order": [],
- "language": {!! json_encode(__('voyager.datatable'), true) !!}
- @if(config('dashboard.data_tables.responsive')), responsive: true @endif
- });
+ var table = $('#dataTable').DataTable({!! json_encode(
+ array_merge([
+ "order" => [],
+ "language" => __('voyager.datatable'),
+ ],
+ config('voyager.dashboard.data_tables'))
+ , true) !!});
@else
$('#search-input select').select2({
minimumResultsForSearch: Infinity | Get datatable options from config file
+ fix responsive option not working for datatables | the-control-group_voyager | train | php |
642f5013d1eeefc08304c2eaa5863421c428af30 | diff --git a/bugzilla/bugzilla4.py b/bugzilla/bugzilla4.py
index <HASH>..<HASH> 100644
--- a/bugzilla/bugzilla4.py
+++ b/bugzilla/bugzilla4.py
@@ -143,6 +143,10 @@ class Bugzilla4(bugzilla.base.BugzillaBase):
query['id'] = query['bug_id']
del query['bug_id']
+ if 'component' in query:
+ if type(query['component']) is not list:
+ query['component'] = query['component'].split(',')
+
if 'include_fields' not in query:
query['include_fields'] = list()
if 'column_list' in query: | bugzilla4: translate multiple components into an array
The old bugzilla took a comma separated component list. Add code
to translate the old way to the new array way. | python-bugzilla_python-bugzilla | train | py |
867109bb8eb557fce738ea5241572bfb7f4fe6d7 | diff --git a/library/Benri/Controller/Abstract.php b/library/Benri/Controller/Abstract.php
index <HASH>..<HASH> 100644
--- a/library/Benri/Controller/Abstract.php
+++ b/library/Benri/Controller/Abstract.php
@@ -66,7 +66,7 @@ abstract class Benri_Controller_Abstract extends Zend_Rest_Controller
/**
* Disable the view layout.
*
- * @return Benri_Controller_Action
+ * @return self
*/
protected function disableLayout()
{
@@ -185,7 +185,7 @@ abstract class Benri_Controller_Abstract extends Zend_Rest_Controller
*
* @param Benri_Db_Table_Row
* @param mixed Data to normalize and save into the model
- * @return Benri_Controller_Rest
+ * @return self
* @throws Zend_Db_Table_Row_Exception
*/
protected function _saveModel(Benri_Db_Table_Row &$model, $data = null) | chore: improve some php docblocks | douggr_benri | train | php |
74564f4f47fe349c2ea9e4ad4f69bfad688f2a97 | diff --git a/listing-bundle/contao/ModuleListing.php b/listing-bundle/contao/ModuleListing.php
index <HASH>..<HASH> 100644
--- a/listing-bundle/contao/ModuleListing.php
+++ b/listing-bundle/contao/ModuleListing.php
@@ -164,18 +164,22 @@ class ModuleListing extends Module
$page = $this->Input->get('page') ? $this->Input->get('page') : 1;
$per_page = $this->Input->get('per_page') ? $this->Input->get('per_page') : $this->perPage;
- if ($page < 1 || $page > max(ceil($objTotal->count/$per_page), 1))
+ // Thanks to Hagen Klemp (see #4485)
+ if ($per_page > 0)
{
- global $objPage;
- $objPage->noSearch = 1;
- $objPage->cache = 0;
+ if ($page < 1 || $page > max(ceil($objTotal->count/$per_page), 1))
+ {
+ global $objPage;
+ $objPage->noSearch = 1;
+ $objPage->cache = 0;
- $this->Template->thead = array();
- $this->Template->tbody = array();
+ $this->Template->thead = array();
+ $this->Template->tbody = array();
- // Send a 404 header
- header('HTTP/1.1 404 Not Found');
- return;
+ // Send a 404 header
+ header('HTTP/1.1 404 Not Found');
+ return;
+ }
} | [Listing] Fixed the "division by zero" issue in the listing module (see #<I>) | contao_contao | train | php |
dcc81628853e0000166c38097cd8f67ae3e8316f | diff --git a/Tests/DependencyInjection/DoctrineCommandsTest.php b/Tests/DependencyInjection/DoctrineCommandsTest.php
index <HASH>..<HASH> 100644
--- a/Tests/DependencyInjection/DoctrineCommandsTest.php
+++ b/Tests/DependencyInjection/DoctrineCommandsTest.php
@@ -65,17 +65,13 @@ class DoctrineCommandsTest extends TestCase
*/
private function getKernel(ContainerBuilder $container)
{
- $kernel = $this
- ->getMockBuilder(KernelInterface::class)
- ->getMock();
+ $kernel = $this->createMock(KernelInterface::class);
$kernel
- ->expects(self::any())
->method('getContainer')
->willReturn($container);
$kernel
- ->expects(self::once())
->method('getBundles')
->willReturn([]); | adjust the number of times a mock method should be invoked | doctrine_DoctrineMigrationsBundle | train | php |
d9b99acb06799e80ce3927a8f8de55fd284d5bb5 | diff --git a/pyramid_pages/models.py b/pyramid_pages/models.py
index <HASH>..<HASH> 100644
--- a/pyramid_pages/models.py
+++ b/pyramid_pages/models.py
@@ -37,7 +37,7 @@ class PageMixin(object):
description = Column(UnicodeText)
def __repr__(self):
- return self.name or ''
+ return self.name.encode('utf-8') or ''
def __json__(self, request):
return self.id | encode name of models to UTF-8 | uralbash_pyramid_pages | train | py |
e66a5f247fd570fe6be5a5a100b44a56ab223290 | diff --git a/packages/material-ui/src/utils/debounce.js b/packages/material-ui/src/utils/debounce.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/utils/debounce.js
+++ b/packages/material-ui/src/utils/debounce.js
@@ -3,10 +3,8 @@
export default function debounce(func, wait = 166) {
let timeout;
function debounced(...args) {
- // eslint-disable-next-line consistent-this
- const that = this;
const later = () => {
- func.apply(that, args);
+ func.apply(this, args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait); | [core] Simplify debounce (#<I>) | mui-org_material-ui | train | js |
360183649428acd01d1ef70da0e661fb4759a3c8 | diff --git a/spec/blue_state_digital/address_spec.rb b/spec/blue_state_digital/address_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/blue_state_digital/address_spec.rb
+++ b/spec/blue_state_digital/address_spec.rb
@@ -8,10 +8,12 @@ describe BlueStateDigital::Address do
#completely unclear why these pass.
it "should convert address fields to_xml" do
+ pending
subject.to_xml.should == "<xml>"
end
it "should return a builder" do
+ pending
subject.to_xml.should be_a(Builder)
end
end
\ No newline at end of file | pend test that are not yet ready. | controlshift_blue_state_digital | train | rb |
e705d0519bc591bd5f1b1dbeb94ccf33656f7d34 | diff --git a/src/reconspect/dummy.js b/src/reconspect/dummy.js
index <HASH>..<HASH> 100644
--- a/src/reconspect/dummy.js
+++ b/src/reconspect/dummy.js
@@ -0,0 +1,19 @@
+(function (reconspect, d3) {
+ reconspect.dummy = {
+ construct: function (div, data) {
+ var d = d3.select(div);
+
+ d = d.append('ul');
+ d.selectAll('li')
+ .data(data)
+ .enter()
+ .append('li')
+ .text(function (d) {
+ return d.text;
+ })
+ .style(function (d) {
+ return d.color;
+ });
+ }
+ };
+}(window.reconspect, window.d3));
diff --git a/src/reconspect/preamble.js b/src/reconspect/preamble.js
index <HASH>..<HASH> 100644
--- a/src/reconspect/preamble.js
+++ b/src/reconspect/preamble.js
@@ -0,0 +1,3 @@
+(function () {
+ window.reconspect = {};
+}()); | Add dummy visualization component (along with visualization namespace) | Kitware_candela | train | js,js |
cecf6e2d9072af91d942e40c79884483d79c885a | diff --git a/scriptworker/test/__init__.py b/scriptworker/test/__init__.py
index <HASH>..<HASH> 100644
--- a/scriptworker/test/__init__.py
+++ b/scriptworker/test/__init__.py
@@ -210,7 +210,7 @@ def integration_create_task_payload(config, task_group_id, scopes=None,
}
-@pytest.yield_fixture
+@pytest.yield_fixture(scope='function')
def event_loop():
"""Create an instance of the default event loop for each test case.
From https://github.com/pytest-dev/pytest-asyncio/issues/29#issuecomment-226947296 | event_loop with scope=function? | mozilla-releng_scriptworker | train | py |
8502fd538f367f8efda80051bc56eef8556b5e52 | diff --git a/bootstrap3/__init__.py b/bootstrap3/__init__.py
index <HASH>..<HASH> 100644
--- a/bootstrap3/__init__.py
+++ b/bootstrap3/__init__.py
@@ -1 +1 @@
-__version__ = '2.5.5'
+__version__ = '2.5.6'
diff --git a/bootstrap3/forms.py b/bootstrap3/forms.py
index <HASH>..<HASH> 100644
--- a/bootstrap3/forms.py
+++ b/bootstrap3/forms.py
@@ -218,8 +218,10 @@ def render_field_and_label(field, label, field_class='',
def render_form_group(content, css_class=FORM_GROUP_CLASS):
- return '<div class="{_class}">{content}</div>'.format(_class=css_class,
- content=content)
+ return '<div class="{klass}">{content}</div>'.format(
+ klass=css_class,
+ content=content,
+ )
def is_widget_required_attribute(widget): | Version bump, file field issues fixed (thanks) | dyve_django-bootstrap3 | train | py,py |
48d8dd5a96c6c0a4376ad45a2a8509819d22a93d | diff --git a/agent/lib/kontena/network_adapters/weave.rb b/agent/lib/kontena/network_adapters/weave.rb
index <HASH>..<HASH> 100644
--- a/agent/lib/kontena/network_adapters/weave.rb
+++ b/agent/lib/kontena/network_adapters/weave.rb
@@ -187,7 +187,7 @@ module Kontena::NetworkAdapters
info "router started without known peers"
end
if info['grid']['trusted_subnets']
- info "using trusted subnets: #{info['grid']['trusted_subnets']}"
+ info "using trusted subnets: #{info['grid']['trusted_subnets'].join(',')}"
end
if info['node_number'] | Fix weave trusted-subnet log output (#<I>) | kontena_kontena | train | rb |
2e8f86d544d1ffc217365366e59d133e2a843379 | diff --git a/internetarchive/session.py b/internetarchive/session.py
index <HASH>..<HASH> 100644
--- a/internetarchive/session.py
+++ b/internetarchive/session.py
@@ -112,8 +112,9 @@ class ArchiveSession(requests.sessions.Session):
if not cookie_dict.get(ck):
continue
cookie = create_cookie(ck, cookie_dict[ck],
- domain=cookie_dict.get('domain'),
- path=cookie_dict.get('path'))
+ # .archive.org might be a better domain.
+ domain=cookie_dict.get('domain', ''),
+ path=cookie_dict.get('path', '/'))
self.cookies.set_cookie(cookie)
self.secure = self.config.get('general', {}).get('secure', True)
diff --git a/internetarchive/utils.py b/internetarchive/utils.py
index <HASH>..<HASH> 100644
--- a/internetarchive/utils.py
+++ b/internetarchive/utils.py
@@ -411,4 +411,8 @@ def parse_dict_cookies(value):
continue
name, value = item.split('=', 1)
result[name] = value
+ if 'domain' not in result:
+ result['domain'] = '' # .archive.org might be better.
+ if 'path' not in result:
+ result['path'] = '/'
return result | Fix possibly faulty values for domain and path in parsed cookies.
Using .archive.org as the default domain would be better,
but I'm not sure whether that covers all use cases.
@jjjake would have to chime in here.
Closes #<I>
Closes #<I> | jjjake_internetarchive | train | py,py |
1d18f21c561f5737da110c39df78c8c6011ec997 | diff --git a/management/src/test/java/org/kaazing/gateway/management/jmx/JmxSessionPrincipalsIT.java b/management/src/test/java/org/kaazing/gateway/management/jmx/JmxSessionPrincipalsIT.java
index <HASH>..<HASH> 100644
--- a/management/src/test/java/org/kaazing/gateway/management/jmx/JmxSessionPrincipalsIT.java
+++ b/management/src/test/java/org/kaazing/gateway/management/jmx/JmxSessionPrincipalsIT.java
@@ -297,7 +297,7 @@ public class JmxSessionPrincipalsIT {
startTime = currentTimeMillis();
numberOfCurrentSessions = (Long) mbeanServerConn.getAttribute(echoServiceMbeanName, "NumberOfCurrentSessions");
- while (numberOfCurrentSessions > 1 && (currentTimeMillis() - startTime) < 10000) {
+ while (numberOfCurrentSessions > 0 && (currentTimeMillis() - startTime) < 10000) {
Thread.sleep(500);
numberOfCurrentSessions = (Long) mbeanServerConn.getAttribute(echoServiceMbeanName, "NumberOfCurrentSessions");
} | (management) Fixed a trivial error in JmxSessionPrincipalsIT which was causing occasional test failures (in that test or subclass JmxSessionPrincipalsSupertypeIT) | kaazing_gateway | train | java |
63d4cf79a8ceaa1cf22b106ea02acaa52d1b8769 | diff --git a/spec/cucumber/configuration_spec.rb b/spec/cucumber/configuration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cucumber/configuration_spec.rb
+++ b/spec/cucumber/configuration_spec.rb
@@ -136,8 +136,9 @@ module Cucumber
describe "#with_options" do
it "returns a copy of the configuration with new options" do
- new_out_stream = double
- config = Configuration.new.with_options(out_stream: new_out_stream)
+ old_out_stream = double('Old out_stream')
+ new_out_stream = double('New out_stream')
+ config = Configuration.new(out_stream: old_out_stream).with_options(out_stream: new_out_stream)
expect(config.out_stream).to eq new_out_stream
end
end | Failing test for with_optins merge order
MSP-<I>
Shows that with_options test only passed becasue out_stream hadn't been
set on the Configuration before calling with_options(out_stream:). | cucumber_cucumber-ruby | train | rb |
da7be0ae315d25bf54b7d5b6db4ffc5142b9e61b | diff --git a/h2o-py/h2o/frame.py b/h2o-py/h2o/frame.py
index <HASH>..<HASH> 100644
--- a/h2o-py/h2o/frame.py
+++ b/h2o-py/h2o/frame.py
@@ -46,9 +46,9 @@ class H2OFrame:
rawkey = h2o.import_file(remote_fname)
setup = h2o.parse_setup(rawkey)
parse = h2o.parse(setup, H2OFrame.py_tmp_key()) # create a new key
- cols = parse['columnNames']
- rows = parse['rows']
veckeys = parse['vecKeys']
+ rows = parse['rows']
+ cols = parse['columnNames'] if parse["columnNames"] else ["C" + str(x) for x in range(1,len(veckeys)+1)]
self._vecs = H2OVec.new_vecs(zip(cols, veckeys), rows)
print "Imported", remote_fname, "into cluster with", rows, "rows and", len(cols), "cols" | Allows python to handle datasets without specified columnNames. Generates local names since zip requires names to associate with each column(vec). | h2oai_h2o-3 | train | py |
63b81edca0b60a4d64f22856a87760a1d01a6311 | diff --git a/spec/integration/repository_spec.rb b/spec/integration/repository_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/repository_spec.rb
+++ b/spec/integration/repository_spec.rb
@@ -269,6 +269,11 @@ RSpec.describe 'ROM repository' do
it 'returns a hash' do
expect(repo.users.limit(1).one).to eql(id: 1, name: 'Jane')
end
+
+ it 'returns a nested hash for an aggregate' do
+ expect(repo.aggregate(:posts).limit(1).one).
+ to eql(id: 1, name: 'Jane', posts: [{ id: 1, author_id: 1, title: 'Hello From Jane', body: 'Jane Post'}])
+ end
end
end
end | Add a spec for aggregate with auto-struct disabled | rom-rb_rom | train | rb |
dd04ba5a5de585dd994c188ee46ec2fc5fbe400d | diff --git a/slave/buildslave/test/unit/test_commands_transfer.py b/slave/buildslave/test/unit/test_commands_transfer.py
index <HASH>..<HASH> 100644
--- a/slave/buildslave/test/unit/test_commands_transfer.py
+++ b/slave/buildslave/test/unit/test_commands_transfer.py
@@ -256,8 +256,8 @@ class TestSlaveDirectoryUpload(CommandTestMixin, unittest.TestCase):
return self.test_simple('gz')
# except bz2 can't operate in stream mode on py24
- if sys.version_info <= (2,4):
- del test_simple_bz2
+ if sys.version_info[:2] <= (2,4):
+ test_simple_bz2.skip = "bz2 stream decompression not supported on Python-2.4"
# this is just a subclass of SlaveUpload, so the remaining permutations
# are already tested | correctly - really, this time - detect Python-<I> | buildbot_buildbot | train | py |
aaf373c84c9c120345b482da46de37351f20747d | diff --git a/opal/corelib/error.rb b/opal/corelib/error.rb
index <HASH>..<HASH> 100644
--- a/opal/corelib/error.rb
+++ b/opal/corelib/error.rb
@@ -119,7 +119,17 @@ class Exception < `Error`
to_s
end
- def full_message(highlight: $stderr.tty?, order: :top)
+ def full_message(kwargs = nil)
+ unless defined? Hash
+ # We are dealing with an unfully loaded Opal library, so we should
+ # do with as little as we can.
+
+ return "#{@message}\n#{`self.stack`}"
+ end
+
+ kwargs = { highlight: $stderr.tty?, order: :top }.merge(kwargs || {})
+ highlight, order = kwargs[:highlight], kwargs[:order]
+
::Kernel.raise ::ArgumentError, "expected true or false as highlight: #{highlight}" unless [true, false].include? highlight
::Kernel.raise ::ArgumentError, "expected :top or :bottom as order: #{order}" unless %i[top bottom].include? order | Ensure full_message returns something even if Hash isn't loaded | opal_opal | train | rb |
ee9d28cb51e1e4dd58fe7d9a42f782d851ad1e68 | diff --git a/newrpc/__init__.py b/newrpc/__init__.py
index <HASH>..<HASH> 100644
--- a/newrpc/__init__.py
+++ b/newrpc/__init__.py
@@ -220,7 +220,7 @@ def iter_rpcresponses(queue, channel=None, timeout=None, **kwargs):
for msg in qw:
data = msg.payload
if data['failure']:
- raise RemoteError(**msg)
+ raise RemoteError(**data['failure'])
elif data.get('ending', False):
msg.ack()
return | RemoteError change for kwargs | nameko_nameko | train | py |
87b4d144ef5a6ec04d2ff52310cccfa2c4c1ee8f | diff --git a/src/Layers/FeatureLayer/FeatureManager.js b/src/Layers/FeatureLayer/FeatureManager.js
index <HASH>..<HASH> 100644
--- a/src/Layers/FeatureLayer/FeatureManager.js
+++ b/src/Layers/FeatureLayer/FeatureManager.js
@@ -307,7 +307,7 @@ export var FeatureManager = FeatureGrid.extend({
pendingRequests++;
var coords = this._keyToCellCoords(key);
var bounds = this._cellCoordsToBounds(coords);
- this._requestFeatures(bounds, key, requestCallback);
+ this._requestFeatures(bounds, coords, requestCallback);
}
return this;
@@ -353,7 +353,7 @@ export var FeatureManager = FeatureGrid.extend({
pendingRequests++;
var coords = this._keyToCellCoords(key);
var bounds = this._cellCoordsToBounds(coords);
- this._requestFeatures(bounds, key, requestCallback);
+ this._requestFeatures(bounds, coords, requestCallback);
}
}
@@ -364,7 +364,7 @@ export var FeatureManager = FeatureGrid.extend({
for (var key in this._cells) {
var coords = this._keyToCellCoords(key);
var bounds = this._cellCoordsToBounds(coords);
- this._requestFeatures(bounds, key);
+ this._requestFeatures(bounds, coords);
}
if (this.redraw) { | fix _requestFeatures input params
second param should be an object, not a string. | Esri_esri-leaflet | train | js |
c49674915607bc87ced5ed515834907fe27b177c | diff --git a/lib/fastlane/actions/install_cocapods.rb b/lib/fastlane/actions/install_cocapods.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/actions/install_cocapods.rb
+++ b/lib/fastlane/actions/install_cocapods.rb
@@ -4,6 +4,10 @@ module Fastlane
def self.run(_params)
Actions.sh('pod install')
end
+
+ def self.description
+ "Runs `pod install` for the project"
+ end
end
end
end | Added documentation for CocoaPods action | fastlane_fastlane | train | rb |
4927a800efa2701942dde2486d7e35d729e75673 | diff --git a/js/lightbox.js b/js/lightbox.js
index <HASH>..<HASH> 100755
--- a/js/lightbox.js
+++ b/js/lightbox.js
@@ -437,7 +437,7 @@ function Lightbox () {
currImage.img.setAttribute('height',newImgHeight)
currImage.img.setAttribute('style','margin-top:'+((getHeight() - newImgHeight) /2)+'px')
- repositionControls()
+ setTimeout(repositionControls,200)
// execute resize callback
if(this.opt.onresize) this.opt.onresize() | added timeout for correct repositioning of controls | felixhagspiel_jsOnlyLightbox | train | js |
8c97fb6ee1260e1442d58f8ad4e6cffcafee6907 | diff --git a/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/DefaultSchedulingService.java b/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/DefaultSchedulingService.java
index <HASH>..<HASH> 100644
--- a/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/DefaultSchedulingService.java
+++ b/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/DefaultSchedulingService.java
@@ -297,12 +297,6 @@ public class DefaultSchedulingService extends DefaultService implements Scheduli
}
}
- if(scheduler != null) {
- _logger.info("Machine is no longer master disposing current scheduler instance");
- _disposeScheduler(scheduler);
- scheduler = null;
- }
-
boolean interrupted = interrupted();
_releaseLock(key); | Remove dipsoe scheduler when not master sicne it is causing the unit test to loop indefinitely | salesforce_Argus | train | java |
ff707b52e120d9e116b9951608b83ebfd841f7e8 | diff --git a/lib/rake/version.rb b/lib/rake/version.rb
index <HASH>..<HASH> 100644
--- a/lib/rake/version.rb
+++ b/lib/rake/version.rb
@@ -5,7 +5,7 @@ module Rake
MINOR = 9,
BUILD = 0,
BETA = 'beta',
- BETANUM = 4,
+ BETANUM = 5,
]
end
VERSION = Version::NUMBERS.join('.') | Bumped to version <I>.beta<I> | ruby_rake | train | rb |
94f5f5f7fda06d09847f39ec8583ed25300fc6f8 | diff --git a/Eloquent/Collection.php b/Eloquent/Collection.php
index <HASH>..<HASH> 100755
--- a/Eloquent/Collection.php
+++ b/Eloquent/Collection.php
@@ -4,6 +4,7 @@ namespace Illuminate\Database\Eloquent;
use LogicException;
use Illuminate\Support\Arr;
+use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Queue\QueueableCollection;
use Illuminate\Support\Collection as BaseCollection;
@@ -22,6 +23,10 @@ class Collection extends BaseCollection implements QueueableCollection
$key = $key->getKey();
}
+ if ($key instanceof Arrayable) {
+ $key = $key->toArray();
+ }
+
if (is_array($key)) {
if ($this->isEmpty()) {
return new static; | [<I>] Modify find eloquent collection method to accept collection (#<I>)
* Modify find eloquent method to accept collection
* Fix style ci
* Modify if condetion to check for Arryable instead of BaseCollection | illuminate_database | train | php |
e838d6ed8a51e55e464766b98c42648b6dfad653 | diff --git a/.eslintrc.js b/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -164,12 +164,12 @@ module.exports = {
'testem-browserstack.js',
'bin/**/*.js',
'build/**/*.js',
- 'server/**/*.js'
+ 'server/**/*.js',
],
env: {
es6: true,
node: true,
},
- }
- ]
+ },
+ ],
}; | ESLint: Add missing trailing commas in config file | glimmerjs_glimmer-vm | train | js |
b7bd96a2dd53219460019925ebfa13c23abcef0f | diff --git a/Test/Unit/Parsing/FormBuilderTester.php b/Test/Unit/Parsing/FormBuilderTester.php
index <HASH>..<HASH> 100644
--- a/Test/Unit/Parsing/FormBuilderTester.php
+++ b/Test/Unit/Parsing/FormBuilderTester.php
@@ -62,6 +62,9 @@ class FormBuilderTester extends PHPMethodTester {
$this->assertStatementIsParentCallAssignment(0, 'form', "The form builder's first statement is a call to the parent.");
}
+ // All form builders implement an interface method.
+ $this->assertMethodDocblockHasInheritdoc();
+
$this->assertReturnsVariable('form', "The form builder returns the completed form.");
// Get the form element statements. | Added testing that form builder methods have the ‘inheritdoc’ tag. | drupal-code-builder_drupal-code-builder | train | php |
f6226acb905a78b392469713aaadd6f71ee8fc5b | diff --git a/xml4h/nodes.py b/xml4h/nodes.py
index <HASH>..<HASH> 100644
--- a/xml4h/nodes.py
+++ b/xml4h/nodes.py
@@ -56,7 +56,7 @@ class Node(object):
def __str__(self):
# TODO Degrade non-ASCII characters gracefully
- return str(self.__unicode__())
+ return self.__unicode__().encode(encoding='ascii', errors='replace')
def __repr__(self):
return self.__str__()
@@ -1103,7 +1103,7 @@ class AttributeDict(object):
def __str__(self):
# TODO Degrade non-ASCII characters gracefully
- return str(self.__unicode__())
+ return self.__unicode__().encode(encoding='ascii', errors='replace')
def __repr__(self):
return self.__str__() | Avoid ASCII encoding errors, inelegantly, by replacing problematic chars | jmurty_xml4h | train | py |
1305787dc56faa2c7b353fc751f3122e4da5eea8 | diff --git a/bolt-modules/file/lib/puppet/functions/file/read.rb b/bolt-modules/file/lib/puppet/functions/file/read.rb
index <HASH>..<HASH> 100644
--- a/bolt-modules/file/lib/puppet/functions/file/read.rb
+++ b/bolt-modules/file/lib/puppet/functions/file/read.rb
@@ -8,7 +8,7 @@ Puppet::Functions.create_function(:'file::read', Puppet::Functions::InternalFunc
# @example Read a file from disk
# file::read('/tmp/i_dumped_this_here')
# @example Read a file from the modulepath
- # file::read('example/files/VERSION')
+ # file::read('example/VERSION')
dispatch :read do
scope_param
required_param 'String', :filename | (maint) Fix file::read from module example
The documented example for using file::read plan function to read a file
from a module on the modulepath erroneously included `/files/`. This
changes the example from the path `example/files/VERSION` to
`example/VERSION`.
!no-release-note | puppetlabs_bolt | train | rb |
cf63f62187673eabc2548b482d0e063cfd49dfa4 | diff --git a/lib/dm-validations.rb b/lib/dm-validations.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-validations.rb
+++ b/lib/dm-validations.rb
@@ -59,6 +59,7 @@ require 'dm-validations/support/object'
module DataMapper
module Validate
+
Model.append_inclusions self
extend Chainable
@@ -161,6 +162,13 @@ module DataMapper
@validators ||= ContextualValidators.new
end
+ def inherited(base)
+ super
+ validators.contexts.each do |context, validators|
+ base.validators.context(context).concat(validators)
+ end
+ end
+
private
# Clean up the argument list and return a opts hash, including the | [dm-validations] Copy validators into inherited models | emmanuel_aequitas | train | rb |
6f1e06be398b05e4e2fb43cb64d35bf30bc253be | diff --git a/chainlet/dataflow.py b/chainlet/dataflow.py
index <HASH>..<HASH> 100644
--- a/chainlet/dataflow.py
+++ b/chainlet/dataflow.py
@@ -100,7 +100,10 @@ class MergeLink(chainlink.ChainLink):
def chainlet_send(self, value=None):
iter_values = iter(value)
- base_value = next(iter_values)
+ try:
+ base_value = next(iter_values)
+ except StopIteration:
+ raise chainlink.StopTraversal
sample_type = type(base_value)
try:
merger = self._cache_mapping[sample_type] | MergeLink no longer breaks a chain permanently when not receiving input | maxfischer2781_chainlet | train | py |
c981e9598f2156a1cbf25e6100b59e05ab35aee8 | diff --git a/lib/active_model_serializers_binary/active_model_serializers_binary.rb b/lib/active_model_serializers_binary/active_model_serializers_binary.rb
index <HASH>..<HASH> 100644
--- a/lib/active_model_serializers_binary/active_model_serializers_binary.rb
+++ b/lib/active_model_serializers_binary/active_model_serializers_binary.rb
@@ -49,7 +49,7 @@ module ActiveModel
true
else
attr_name = attr[:name].to_s
- if !instance.respond_to? attr_name
+ if !instance.class.column_names.include? attr_name
attr[:virtual] = true
attr_accessor attr_name
true
diff --git a/lib/active_model_serializers_binary/version.rb b/lib/active_model_serializers_binary/version.rb
index <HASH>..<HASH> 100644
--- a/lib/active_model_serializers_binary/version.rb
+++ b/lib/active_model_serializers_binary/version.rb
@@ -1,3 +1,3 @@
module ActiveModelSerializersBinary
- VERSION = "0.2.7"
+ VERSION = "0.2.8"
end | when a previous query filter attributes, the attr of the model was overwrited. Fix Bug | bys-control_active_model_serializers_binary | train | rb,rb |
41fd7837a87b1d7a91ffe7038f4a89c4a983768a | diff --git a/howler.js b/howler.js
index <HASH>..<HASH> 100644
--- a/howler.js
+++ b/howler.js
@@ -25,7 +25,11 @@
// create a master gain node
if (usingWebAudio) {
- var gainNode = ctx.createGainNode();
+ if (typeof ctx.createGain === 'undefined') { // Chrome / Safari
+ var gainNode = ctx.createGainNode();
+ } else {
+ var gainNode = ctx.createGain();
+ }
gainNode.gain.value = 1;
gainNode.connect(ctx.destination);
}
@@ -169,7 +173,11 @@
self._audioNode = [];
} else {
// create gain node
- self._gainNode = ctx.createGainNode();
+ if (typeof ctx.createGain === 'undefined') { // Chrome / Safari
+ self._gainNode = ctx.createGainNode();
+ } else { // spec-compliant
+ self._gainNode = ctx.createGain();
+ }
self._gainNode.gain.value = self._volume;
self._gainNode.connect(gainNode);
} | added spec-implementation detection to howler, as createGainNode is deprecated. | goldfire_howler.js | train | js |
e5015a8508ace58863dbd74aebf1f7e602625e82 | diff --git a/src/basis/template.js b/src/basis/template.js
index <HASH>..<HASH> 100644
--- a/src/basis/template.js
+++ b/src/basis/template.js
@@ -1117,13 +1117,13 @@
{
if (bindDef.length == 1) // bool
newAttrValue.add(bind[0] + bindName);
- else // enum
+ else // enum
newAttrValue.add(bind[0] + bindDef[1][bindDef[0] - 1]);
}
}
else
{
- ;;;template.warns.push('Class binding `' + bind[1] + '` is not defined');
+ ;;;template.warns.push('Class binding `' + bindName + '` is not defined');
unpredictable++;
}
} | fix warning message for binding is not defined | basisjs_basisjs | train | js |
1a48cd96ecd83cad84cb76997e14d4e648a68ed6 | diff --git a/src/main/java/nl/jqno/equalsverifier/AbstractDelegationChecker.java b/src/main/java/nl/jqno/equalsverifier/AbstractDelegationChecker.java
index <HASH>..<HASH> 100644
--- a/src/main/java/nl/jqno/equalsverifier/AbstractDelegationChecker.java
+++ b/src/main/java/nl/jqno/equalsverifier/AbstractDelegationChecker.java
@@ -76,7 +76,7 @@ class AbstractDelegationChecker<T> implements Checker {
for (Field field : FieldIterable.of(type)) {
Class<?> c = field.getType();
Object instance = safelyGetInstance(c);
- Object copy = safelyGetInstance(c);
+ Object copy = safelyCopyInstance(instance);
if (instance != null && copy != null) {
checkAbstractMethods(c, instance, copy, true);
}
@@ -143,6 +143,15 @@ class AbstractDelegationChecker<T> implements Checker {
}
}
+ private Object safelyCopyInstance(Object o) {
+ try {
+ return ObjectAccessor.of(o).copy();
+ }
+ catch (Throwable ignored) {
+ return o;
+ }
+ }
+
@SuppressFBWarnings(value = "DE_MIGHT_IGNORE", justification = "These exceptions will re-occur and be handled later.")
private <S> void checkAbstractMethods(Class<?> instanceClass, S instance, S copy, boolean prefabPossible) {
try { | Issue <I>: Fix AbstractDelegation test | jqno_equalsverifier | train | java |
bfd2ff5af23ca0a5d97e71ea1592c357076641be | diff --git a/menu/menu.go b/menu/menu.go
index <HASH>..<HASH> 100644
--- a/menu/menu.go
+++ b/menu/menu.go
@@ -463,15 +463,23 @@ func (menu *Menu) AttachToWindow(w *window.Window) {
if runtime.GOOS != "linux" {
return
}
- command := Command{
- Method: "attach",
- Args: CommandArguments{
- WindowID: w.TargetID,
- },
- }
- // Thread to wait for Stable Menu State
- menu.CallWhenTreeStable(&command)
+ go func() {
+ for {
+ if w.TargetID != 0 {
+ command := Command{
+ Method: "attach",
+ Args: CommandArguments{
+ WindowID: w.TargetID,
+ },
+ }
+
+ // Thread to wait for Stable Menu State
+ menu.CallWhenTreeStable(&command)
+ return
+ }
+ }
+ }()
}
/* | Fix for window ready state for linux menu AttachToWindow | miketheprogrammer_go-thrust | train | go |
6ec020b8cf819f978eb18f96a7460028e0e581d4 | diff --git a/src/Context/TqContext.php b/src/Context/TqContext.php
index <HASH>..<HASH> 100644
--- a/src/Context/TqContext.php
+++ b/src/Context/TqContext.php
@@ -131,7 +131,7 @@ class TqContext extends RawTqContext
}
/**
- * @Then /^I checkout to whole page$/
+ * @Then /^(?:|I )checkout to whole page$/
*/
public function unsetWorkingElementScope()
{
@@ -233,7 +233,7 @@ class TqContext extends RawTqContext
public function beforeStep(Scope\BeforeStepScope $step = null)
{
if (null !== $step) {
- $this->pageUrl = $this->getCurrentUrl();
+ self::$pageUrl = $this->getCurrentUrl();
}
} | Added usage of RawTqContext::$pageUrl inside of TqContext | BR0kEN-_TqExtension | train | php |
7700f7f7140ff1f61864a5cfc2923394eee2671a | diff --git a/lib/starscope/record.rb b/lib/starscope/record.rb
index <HASH>..<HASH> 100644
--- a/lib/starscope/record.rb
+++ b/lib/starscope/record.rb
@@ -27,21 +27,32 @@ class StarScope::Record
end
def self.ctag_line(rec)
- "#{rec[:name][-1]}\t#{rec[:file]}\t/^#{rec[:line]}$/" + self.ctag_ext(rec)
+ ret = "#{rec[:name][-1]}\t#{rec[:file]}\t/^#{rec[:line]}$/"
+
+ ext = self.ctag_ext_tags(rec)
+ if not ext.empty?
+ ret << ";\""
+ ext.each do |k, v|
+ ret << "\t#{k}:#{v}"
+ end
+ end
+
+ ret
end
- def self.ctag_ext(rec)
- s = ";\"\t"
+ def self.ctag_ext_tags(rec)
+ tag = {}
+
#TODO implement the many more extensions documented at
#http://ctags.sourceforge.net/FORMAT
case rec[:type]
when :func
- s << "kind:f"
+ tag["kind"] = "f"
when :class
- s << "kind:c"
- else
- ""
+ tag["kind"] = "c"
end
+
+ tag
end
def self.cscope_mark(tbl, rec) | Rework generation of ctag extension fields
This should make it much easier to add new ones. | eapache_starscope | train | rb |
9631f1de851c672081878c419301d65f2766116d | diff --git a/lib/ransack/adapters/active_record/ransack/nodes/condition.rb b/lib/ransack/adapters/active_record/ransack/nodes/condition.rb
index <HASH>..<HASH> 100644
--- a/lib/ransack/adapters/active_record/ransack/nodes/condition.rb
+++ b/lib/ransack/adapters/active_record/ransack/nodes/condition.rb
@@ -18,7 +18,7 @@ module Ransack
predicates.inject(&:or)
end
else
- predicates.first.right[0] = predicates.first.right[0].val if predicates.first.right[0].class == Arel::Nodes::Casted
+ predicates.first.right[0] = predicates.first.right[0].val if defined?(Arel::Nodes::Casted) && predicates.first.class == Arel::Nodes::In && predicates.first.right.is_a?(Array) && predicates.first.right[0].class == Arel::Nodes::Casted
predicates.first
end
end | make tests pass by adding to if statement | activerecord-hackery_ransack | train | rb |
41467d7f7f0dc98f86fcd77534380d8e70aa262e | diff --git a/src/ServerRequest/ParsedBody.php b/src/ServerRequest/ParsedBody.php
index <HASH>..<HASH> 100644
--- a/src/ServerRequest/ParsedBody.php
+++ b/src/ServerRequest/ParsedBody.php
@@ -243,7 +243,7 @@ trait ParsedBody
$request->parseCondition = ($data === null ? null : false);
- if ($this->shouldUsePostData()) {
+ if ($this->shouldUsePostData() && $data !== null) {
$request->postData = $data;
$request->parsedBody = null;
} else { | Fix: never set $_POST to null | jasny_http-message | train | php |
2b60adfa8a23e1a31e1e18848e9d007eee37ea9c | diff --git a/spec/support/shared/functional/diff_disabled.rb b/spec/support/shared/functional/diff_disabled.rb
index <HASH>..<HASH> 100644
--- a/spec/support/shared/functional/diff_disabled.rb
+++ b/spec/support/shared/functional/diff_disabled.rb
@@ -1,7 +1,7 @@
shared_context "diff disabled" do
before do
- @original_diff_disable = Chef::Config[:diff_disabled]
+ @original_diff_disable ||= Chef::Config[:diff_disabled]
Chef::Config[:diff_disabled] = true
end | avoid clobbering original diff disable state when nested | chef_chef | train | rb |
f7b736c2b8f515289e8c22839b468dc9242af614 | diff --git a/allennlp/training/trainer.py b/allennlp/training/trainer.py
index <HASH>..<HASH> 100644
--- a/allennlp/training/trainer.py
+++ b/allennlp/training/trainer.py
@@ -729,7 +729,7 @@ class Trainer:
def _description_from_metrics(self, metrics: Dict[str, float]) -> str:
# pylint: disable=no-self-use
- return ', '.join(["%s: %.2f" % (name, value) for name, value in metrics.items()]) + " ||"
+ return ', '.join(["%s: %.4f" % (name, value) for name, value in metrics.items()]) + " ||"
def _save_checkpoint(self,
epoch: Union[int, str], | increase metrics logging precision (#<I>) | allenai_allennlp | train | py |
7f79712f0dfab4ace6cd511335046e4d4858b355 | diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -3494,7 +3494,15 @@ function mapNugetFeed(pattern, offset, getInfo) {
function getNugetVersion(apiUrl, id, includePre, request, done) {
// get service index document
regularUpdate(apiUrl + '/index.json',
- (3600 * 1000 * 24), // 1 day - can theoretically change often but in practice it doesn't
+ // The endpoint changes once per year (ie, a period of n = 1 year).
+ // We minimize the users' waiting time for information.
+ // With l = latency to fetch the endpoint and x = endpoint update period
+ // both in years, the yearly number of queries for the endpoint are 1/x,
+ // and when the endpoint changes, we wait for up to x years to get the
+ // right endpoint.
+ // So the waiting time within n years is n*l/x + x years, for which a
+ // derivation yields an optimum at x = sqrt(n*l), roughly 42 minutes.
+ (42 * 60 * 1000),
function(buffer) {
var data = JSON.parse(buffer); | Set Nuget version endpoint update to <I> minutes | badges_shields | train | js |
221dd074b4734e523b732e2e71642fb8e0ab6f21 | diff --git a/salt/modules/aliases.py b/salt/modules/aliases.py
index <HASH>..<HASH> 100644
--- a/salt/modules/aliases.py
+++ b/salt/modules/aliases.py
@@ -8,7 +8,15 @@ import re
import stat
import tempfile
-from salt.utils import which
+from salt.utils import which as _which
+
+__outputter__ = {
+ 'rm_alias': 'txt',
+ 'has_target': 'txt',
+ 'get_target': 'txt',
+ 'set_target': 'txt',
+ 'list_aliases': 'yaml',
+}
__ALIAS_RE = re.compile(r'([^:#]*)\s*:?\s*([^#]*?)(\s+#.*|$)')
@@ -75,7 +83,7 @@ def __write_aliases_file(lines):
os.rename(out.name, afn)
# Search $PATH for the newalises command
- newaliases = which('newaliases')
+ newaliases = _which('newaliases')
if newaliases is not None:
__salt__['cmd.run'](newaliases) | salt.modules.aliases: use outputters for each function
Also change which() to _which to prevent the doc system from using it | saltstack_salt | train | py |
524437ab0484bd65b94c94601804c12caff672f8 | diff --git a/src/main/resources/META-INF/resources/primefaces/forms/forms.selectonemenu.js b/src/main/resources/META-INF/resources/primefaces/forms/forms.selectonemenu.js
index <HASH>..<HASH> 100644
--- a/src/main/resources/META-INF/resources/primefaces/forms/forms.selectonemenu.js
+++ b/src/main/resources/META-INF/resources/primefaces/forms/forms.selectonemenu.js
@@ -462,7 +462,6 @@ PrimeFaces.widget.SelectOneMenu = PrimeFaces.widget.DeferredWidget.extend({
}
if(!silent) {
- this.focusInput.trigger('focus');
this.callBehavior('itemSelect');
} | Fix #<I>: Remove unnecessary focus | primefaces_primefaces | train | js |
5b5a3713e2436706f80e782ed26479b066205ab4 | diff --git a/src/core/lombok/javac/JavacResolution.java b/src/core/lombok/javac/JavacResolution.java
index <HASH>..<HASH> 100644
--- a/src/core/lombok/javac/JavacResolution.java
+++ b/src/core/lombok/javac/JavacResolution.java
@@ -325,6 +325,8 @@ public class JavacResolution {
// NB: There's such a thing as maker.Type(type), but this doesn't work very well; it screws up anonymous classes, captures, and adds an extra prefix dot for some reason too.
// -- so we write our own take on that here.
+ if (type.tag == TypeTags.BOT) return createJavaLangObject(maker, ast);
+
if (type.isPrimitive()) return primitiveToJCTree(type.getKind(), maker);
if (type.isErroneous()) throw new TypeNotConvertibleException("Type cannot be resolved"); | Fix for javac: 'val x = null;' is now valid, and results in x being of type Object. | rzwitserloot_lombok | train | java |
eacfa54add0860756578cf4f3022e5548b6862dd | diff --git a/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/DesktopPanePainter.java b/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/DesktopPanePainter.java
index <HASH>..<HASH> 100644
--- a/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/DesktopPanePainter.java
+++ b/seaglass/trunk/seaglass/src/main/java/com/seaglasslookandfeel/painter/DesktopPanePainter.java
@@ -44,9 +44,11 @@ public final class DesktopPanePainter extends AbstractRegionPainter {
}
protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) {
- DesktopPane panePainter = new DesktopPane();
- panePainter.setDimension(new Dimension(width, height));
- panePainter.paintIcon(c, g, 0, 0);
+ if (c.isOpaque()) {
+ DesktopPane panePainter = new DesktopPane();
+ panePainter.setDimension(new Dimension(width, height));
+ panePainter.paintIcon(c, g, 0, 0);
+ }
}
protected final PaintContext getPaintContext() { | Fixed issue <I>
isOpaque is now checked in the painter | khuxtable_seaglass | train | java |
bc608077e6be61502420335a782b1bb33d746188 | diff --git a/config/module.config.php b/config/module.config.php
index <HASH>..<HASH> 100644
--- a/config/module.config.php
+++ b/config/module.config.php
@@ -237,4 +237,12 @@ return array(
),
),
),
+
+ // PlaygroundStats defines itself as the admin Dashboard controller
+ 'playgrounduser' => array(
+ 'admin' => array(
+ 'controller' => 'adminstats',
+ 'action' => 'index'
+ ),
+ )
); | Stats declares itself as the dashboard controller | gregorybesson_PlaygroundStats | train | php |
aa60541877a8a851524791a72ba3968e6764e137 | diff --git a/pkg/mount/sharedsubtree_linux.go b/pkg/mount/sharedsubtree_linux.go
index <HASH>..<HASH> 100644
--- a/pkg/mount/sharedsubtree_linux.go
+++ b/pkg/mount/sharedsubtree_linux.go
@@ -59,7 +59,7 @@ func MakeMount(mnt string) error {
return nil
}
- return Mount(mnt, mnt, "none", "bind")
+ return ForceMount(mnt, mnt, "none", "bind")
}
func ensureMountedAs(mountPoint, options string) error { | pkg/mount: MakeMount: minor optimization
Current code in MakeMount parses /proc/self/mountinfo twice:
first in call to Mounted(), then in call to Mount(). Use
ForceMount() to eliminate such double parsing. | moby_moby | train | go |
3932f25c310f3baef456d6a165eec5e3c770173b | diff --git a/src/Common/Communication/Controller/CommunicationControllerRule.php b/src/Common/Communication/Controller/CommunicationControllerRule.php
index <HASH>..<HASH> 100644
--- a/src/Common/Communication/Controller/CommunicationControllerRule.php
+++ b/src/Common/Communication/Controller/CommunicationControllerRule.php
@@ -12,6 +12,14 @@ class CommunicationControllerRule extends AbstractRule implements ClassAware
const RULE = 'All public controller methods have the suffix `*Action`.';
/**
+ * @var array
+ */
+ protected $notActionMethodNames = [
+ 'initialize',
+ '__construct',
+ ];
+
+ /**
* @return string
*/
public function getDescription()
@@ -55,6 +63,10 @@ class CommunicationControllerRule extends AbstractRule implements ClassAware
return;
}
+ if ($this->isNotActionMethod($method->getName())) {
+ return;
+ }
+
$this->addViolation(
$method,
[
@@ -65,4 +77,14 @@ class CommunicationControllerRule extends AbstractRule implements ClassAware
]
);
}
+
+ /**
+ * @param string $name
+ *
+ * @return bool
+ */
+ protected function isNotActionMethod($name)
+ {
+ return in_array($name, $this->notActionMethodNames);
+ }
} | Feature: Add not action methods to the rule | spryker_architecture-sniffer | train | php |
58a3c69ddf3c2f278fa8817fed5eae4000200bac | diff --git a/devices/philips.js b/devices/philips.js
index <HASH>..<HASH> 100644
--- a/devices/philips.js
+++ b/devices/philips.js
@@ -334,6 +334,15 @@ module.exports = [
ota: ota.zigbeeOTA,
},
{
+ zigbeeModel: ['4090431P9'],
+ model: '4090431P9',
+ vendor: 'Philips',
+ description: 'Hue Flourish white and color ambiance table light with Bluetooth',
+ meta: {turnsOffAtBrightness1: true},
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
+ ota: ota.zigbeeOTA,
+ },
+ {
zigbeeModel: ['LCG002'],
model: '929001953101',
vendor: 'Philips', | Add <I>P9 (#<I>)
* Update philips.js
Added support for Philips Flourish white and Color ambiance table light with bluetooth as a copy of the floor version. This one is working well!
* Update philips.js
* Update philips.js
added {colorTempRange: [<I>, <I>]}
But I'm not an expert on this. | Koenkk_zigbee-shepherd-converters | train | js |
3ce2c66cc4914e72cc8e44207e581af65a29b6ef | diff --git a/salt/netapi/rest_cherrypy/__init__.py b/salt/netapi/rest_cherrypy/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/netapi/rest_cherrypy/__init__.py
+++ b/salt/netapi/rest_cherrypy/__init__.py
@@ -8,8 +8,6 @@ This is run by ``salt-api`` and started in a multiprocess.
# Import Python libs
import logging
import os
-import signal
-import sys
# Import CherryPy without traceback so we can provide an intelligent log
# message in the __virtual__ function
@@ -90,9 +88,4 @@ def start():
cherrypy.server.ssl_certificate = apiopts['ssl_crt']
cherrypy.server.ssl_private_key = apiopts['ssl_key']
- def signal_handler(*args):
- cherrypy.engine.exit()
- sys.exit(0)
- signal.signal(signal.SIGINT, signal_handler)
-
cherrypy.quickstart(root, apiopts.get('root_prefix', '/'), conf) | Lint errors; removed imports; removed signal_handler function
CherryPy's quickstart does signal handling. We don't need this here. | saltstack_salt | train | py |
02279de97a0fadbaa8a1347e55b089238d102c5c | diff --git a/src/controllers/RootController.js b/src/controllers/RootController.js
index <HASH>..<HASH> 100644
--- a/src/controllers/RootController.js
+++ b/src/controllers/RootController.js
@@ -9,7 +9,7 @@ let modal;
class RootController {
- constructor($location, $rootScope, $route, $translate, $translatePartialLoader, Authentication, Navigation, $modal) {
+ constructor($location, $rootScope, $route, $translate, Authentication, Navigation, $modal) {
loc = $location;
auth = Authentication;
nav = Navigation;
@@ -43,7 +43,6 @@ class RootController {
$translate.use(this.language);
});
route = $route;
- $translatePartialLoader.addPart('monad/src');
}
get Authentication() {
@@ -84,7 +83,7 @@ class RootController {
};
-RootController.$inject = ['$location', '$rootScope', '$route', '$translate', '$translatePartialLoader', 'moAuthentication', 'moNavigation', '$modal'];
+RootController.$inject = ['$location', '$rootScope', '$route', '$translate', 'moAuthentication', 'moNavigation', '$modal'];
export {RootController}; | this is now in the config function | monomelodies_monad | train | js |
7ce7a288455d24a486f2addb7064b4c7444ac2ad | diff --git a/tests/tests.js b/tests/tests.js
index <HASH>..<HASH> 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -1,4 +1,4 @@
-QUnit.config.testTimeout = 1000;
+QUnit.config.testTimeout = 5000;
var router, url, handlers; | Reset test timeout to previous value for slow phantom tests | tildeio_router.js | train | js |
dd5908131e2e106963cdc1af3e063259f76733be | diff --git a/code/libraries/koowa/components/com_activities/controllers/behaviors/loggable.php b/code/libraries/koowa/components/com_activities/controllers/behaviors/loggable.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/components/com_activities/controllers/behaviors/loggable.php
+++ b/code/libraries/koowa/components/com_activities/controllers/behaviors/loggable.php
@@ -32,7 +32,7 @@ class ComActivitiesControllerBehaviorLoggable extends KControllerBehaviorAbstrac
/**
* Activity controller identifier.
*
- * @param KObjectConfig
+ * @param string|KObjectIdentifierInterface
*/
protected $_activity_controller; | re #<I> Fixed docblock. | joomlatools_joomlatools-framework | train | php |
d7858702b4b2ce9166fa0aba857ffbc31277e5aa | diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -52,7 +52,7 @@ if __name__ == '__main__':
p = unittest.main(testRunner=xmlrunner.XMLTestRunner(
output='test-reports'), exit=False)
else:
- unittest.main(exit=False)
+ p = unittest.main(exit=False)
platform.shutdown()
s.shutdown("Jabber server terminated...") | test.py now uses the number of failed tests as exit code. | javipalanca_spade | train | py |
d29551d25f4c5eb82377812061ef7ca43f1e1b98 | diff --git a/includes/Form.class.php b/includes/Form.class.php
index <HASH>..<HASH> 100644
--- a/includes/Form.class.php
+++ b/includes/Form.class.php
@@ -17,7 +17,7 @@ class AC_Form extends ActiveCampaign {
}
function html($params) {
- $request_url = "{$this->url}&api_action=form_html&api_output={$this->output}";
+ $request_url = "{$this->url}&api_action=form_html&api_output={$this->output}&{$params}";
$response = $this->curl($request_url);
return $response;
} | need params available for form_html, so it can accept a form ID | ActiveCampaign_activecampaign-api-php | train | php |
ce35f3274c6f637b38e1b071d005d2c4daeddedd | diff --git a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java
+++ b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java
@@ -106,6 +106,7 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li
}
if (mngr.getNotificationChannel(id) != null) {
promise.resolve(null);
+ return;
}
//
NotificationChannel channel = new NotificationChannel( | Avoid resolving promise twice if channel already exists | evollu_react-native-fcm | train | java |
709b0d4b75c149a9b821155cfa11232d184ff0ad | diff --git a/graphistry/__init__.py b/graphistry/__init__.py
index <HASH>..<HASH> 100644
--- a/graphistry/__init__.py
+++ b/graphistry/__init__.py
@@ -16,5 +16,6 @@ bolt, cypher,
tigergraph, gsql, gsql_endpoint,
nodexl,
ArrowUploader,
+ArrowFileUploader,
PyGraphistry
)
\ No newline at end of file
diff --git a/graphistry/pygraphistry.py b/graphistry/pygraphistry.py
index <HASH>..<HASH> 100644
--- a/graphistry/pygraphistry.py
+++ b/graphistry/pygraphistry.py
@@ -5,6 +5,7 @@ from datetime import datetime
from distutils.util import strtobool
from .arrow_uploader import ArrowUploader
+from .ArrowFileUploader import ArrowFileUploader
from . import util
from . import bolt_util | feat(publish ArrowFileUploader) | graphistry_pygraphistry | train | py,py |
f3e9f323cc03f138a37e4ca8e7628fb072817220 | diff --git a/azurerm/resource_arm_managed_disk_test.go b/azurerm/resource_arm_managed_disk_test.go
index <HASH>..<HASH> 100644
--- a/azurerm/resource_arm_managed_disk_test.go
+++ b/azurerm/resource_arm_managed_disk_test.go
@@ -257,10 +257,11 @@ resource "azurerm_resource_group" "test" {
}
resource "azurerm_storage_account" "test" {
- name = "accsa%d"
- resource_group_name = "${azurerm_resource_group.test.name}"
- location = "${azurerm_resource_group.test.location}"
- account_type = "Standard_LRS"
+ name = "accsa%d"
+ resource_group_name = "${azurerm_resource_group.test.name}"
+ location = "${azurerm_resource_group.test.location}"
+ account_tier = "Standard"
+ account_replication_type = "LRS"
tags {
environment = "staging" | Fixing the Managed Disk test | terraform-providers_terraform-provider-azurerm | train | go |
08b02360e05cd8a29beb68cf8ca5723633cc8753 | diff --git a/tests/test_js.py b/tests/test_js.py
index <HASH>..<HASH> 100644
--- a/tests/test_js.py
+++ b/tests/test_js.py
@@ -449,8 +449,8 @@ class PullSubscribeTest(SingleJetStreamServerTestCase):
assert isinstance(e, APIError)
break
- info = await js.consumer_info("TEST3", "example")
- assert info.num_waiting == 0
+ # info = await js.consumer_info("TEST3", "example")
+ # assert info.num_waiting == 0
for i in range(0, 10):
await js.publish("max", b'foo')
@@ -519,8 +519,8 @@ class PullSubscribeTest(SingleJetStreamServerTestCase):
elif isinstance(e, APIError):
raise e
- info = await js.consumer_info("TEST31", "example")
- assert info.num_waiting == 0
+ # info = await js.consumer_info("TEST31", "example")
+ # assert info.num_waiting == 0
await nc.close()
@async_long_test | Skip checking num_waiting on tests | nats-io_asyncio-nats | train | py |
6ad487188e60483a18e4aec03ad7d9d469695e16 | diff --git a/lib/alchemy/deprecation.rb b/lib/alchemy/deprecation.rb
index <HASH>..<HASH> 100644
--- a/lib/alchemy/deprecation.rb
+++ b/lib/alchemy/deprecation.rb
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Alchemy
- Deprecation = ActiveSupport::Deprecation.new("6.0", "Alchemy")
+ Deprecation = ActiveSupport::Deprecation.new("7.0", "Alchemy")
end | Raise deprecated major version to <I> | AlchemyCMS_alchemy_cms | train | rb |
98de1aa27374e67c8456240b38010ce51a14778c | diff --git a/tests/unit/core/ModelsTest.py b/tests/unit/core/ModelsTest.py
index <HASH>..<HASH> 100644
--- a/tests/unit/core/ModelsTest.py
+++ b/tests/unit/core/ModelsTest.py
@@ -108,9 +108,7 @@ class ModelsTest:
geo.clear()
with LogCapture() as log:
geo.regenerate_models(propnames=['pore.diameter'])
- log.check(('root', 'WARNING', "pore.diameter was not run since the " +
- "following properties are missing: ['pore.max_size', " +
- "'pore.seed']"))
+ assert "['pore.max_size', 'pore.seed']" in log.actual()[0][2]
def test_regenerate_models_on_phase_with_deep(self):
pn = op.network.Cubic(shape=[5, 5, 5]) | updating a test that broke due new logger format | PMEAL_OpenPNM | train | py |
b95cbfe995a5c4f4f7ed2adbdaaa6b437cdd9359 | diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php
index <HASH>..<HASH> 100644
--- a/lang/en_utf8/admin.php
+++ b/lang/en_utf8/admin.php
@@ -149,7 +149,7 @@ $string['configproxyport'] = 'If this server needs to use a proxy computer, then
$string['configquarantinedir'] = 'If you want clam AV to move infected files to a quarantine directory, enter it here. It must be writable by the webserver. If you leave this blank, or if you enter a directory that doesn\'t exit or isn\'t writable, infected files will be deleted. Do not include a trailing slash.';
$string['configcronclionly'] = 'If this is set, then the cron script can only be run from the commandline instead of via the web. This overrides the cron password setting below.';
$string['configcronremotepassword'] = 'This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:<pre>
- http://site.example.com/admin.cron.php?password=opensesame
+ http://site.example.com/admin/cron.php?password=opensesame
</pre>If this is left empty, no password is required.';
$string['configrcache'] = 'Use the cache to store database records. Remember to set \'cachetype\' as well!';
$string['configrcachettl'] = 'Time-to-live for cached records, in seconds. Use a short (<15) value here.'; | MDL-<I> Mistake in admin.php - wrong cron url; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
4ed4fd6fc06f04c9818ed65376ec2ed3c9165777 | diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -365,9 +365,7 @@ describe Puppet::Resource do
Puppet::DataBinding.indirection.expects(:find).with('lookup_options', any_parameters).throws(:no_such_key)
Puppet::DataBinding.indirection.expects(:find).with('apache::port', any_parameters).returns(nil)
- rt = resource.resource_type
- rt.send(:inject_external_parameters, resource, scope)
- rt.send(:assign_defaults, resource, scope, {})
+ inject_and_set_defaults(resource, scope)
expect(resource[:port]).to eq('80')
end | (PUP-<I>) Fix test that was broken in master after merge
One of the resource tests called private methods on the resource
type instead of the API method. That test broke when merging to
master. This commit fixes the problem. | puppetlabs_puppet | train | rb |
f8277efcc359fbd1e9a87265bce1a77fd3df550b | diff --git a/example/settings/common.py b/example/settings/common.py
index <HASH>..<HASH> 100644
--- a/example/settings/common.py
+++ b/example/settings/common.py
@@ -124,15 +124,21 @@ INSTALLED_APPS = (
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
-# the site admins on every HTTP 500 error.
+# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ }
+ },
'handlers': {
'mail_admins': {
'level': 'ERROR',
+ 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
}, | update logging settings to avoid deprecation warning about missing filters | django-cumulus_django-cumulus | train | py |
894408105eae905d508186f26860b85234541af3 | diff --git a/lib/dossier/version.rb b/lib/dossier/version.rb
index <HASH>..<HASH> 100644
--- a/lib/dossier/version.rb
+++ b/lib/dossier/version.rb
@@ -1,3 +1,3 @@
module Dossier
- VERSION = "2.12.0"
+ VERSION = "2.12.1"
end | bumping to <I> with #<I> fixed | tma1_dossier | train | rb |
0012f4a025e2a0cc0bf19dd8328e2911c785b569 | diff --git a/coremodules/core/src/test/java/org/treetank/ModuleFactory.java b/coremodules/core/src/test/java/org/treetank/ModuleFactory.java
index <HASH>..<HASH> 100644
--- a/coremodules/core/src/test/java/org/treetank/ModuleFactory.java
+++ b/coremodules/core/src/test/java/org/treetank/ModuleFactory.java
@@ -75,8 +75,8 @@ public class ModuleFactory implements IModuleFactory {
metaFacName = "org.treetank.data.ISCSIMetaPageFactory";
break;
case "filelistener":
- dataFacName = "org.treetank.filelistener.file.node.FileNodeFactory";
- metaFacName = "org.treetank.filelistener.file.node.FilelistenerMetaPageFactory";
+ dataFacName = "org.treetank.filelistener.file.data.FileDataFactory";
+ metaFacName = "org.treetank.filelistener.file.data.FilelistenerMetaPageFactory";
break;
default:
throw new IllegalStateException("Suitable module not found"); | [FIX] ModuleFactory still had a reference to the FileNodeFactory
git-svn-id: <URL> | sebastiangraf_treetank | train | java |
c579abc95a0c5ae9ab35cf6655b4462bffc0decf | diff --git a/tempora.py b/tempora.py
index <HASH>..<HASH> 100644
--- a/tempora.py
+++ b/tempora.py
@@ -414,6 +414,9 @@ def divide_timedelta(td1, td2):
>>> divide_timedelta(one_hour, one_day) == 1 / 24
True
"""
- if six.PY2:
+ try:
+ return td1 / td2
+ except TypeError:
+ # Python 3.2 gets division
+ # http://bugs.python.org/issue2706
return td1.total_seconds() / td2.total_seconds()
- return td1 / td2 | timedelta division wasn't added until <I> | jaraco_tempora | train | py |
c77f6a5ff1f4bab6c256d510b0dcb16f76a09be7 | diff --git a/geocoder/base.py b/geocoder/base.py
index <HASH>..<HASH> 100644
--- a/geocoder/base.py
+++ b/geocoder/base.py
@@ -136,6 +136,7 @@ class Base(object):
###
def _json(self):
+ self.fieldnames = []
for key in dir(self):
if not key.startswith('_') and key not in self._exclude:
self.fieldnames.append(key) | Clear fieldnames so it doesn't grow every query because it was
created as a class variable instead of an instance variable | DenisCarriere_geocoder | train | py |
044bf937f767c6110f8a9404fa789ffffb5b30d7 | diff --git a/src/Extension/FluentExtension.php b/src/Extension/FluentExtension.php
index <HASH>..<HASH> 100644
--- a/src/Extension/FluentExtension.php
+++ b/src/Extension/FluentExtension.php
@@ -410,10 +410,14 @@ class FluentExtension extends DataExtension
*/
public function updateDeleteTables(&$queriedTables)
{
+ // Ensure a locale exists
+ $locale = $this->getRecordLocale();
+ if (!$locale) {
+ return;
+ }
+
// Fluent takes over deletion of objects
$queriedTables = [];
-
- $locale = $this->getRecordLocale();
$localisedTables = $this->getLocalisedTables();
$tableClasses = ClassInfo::ancestry($this->owner, true);
foreach ($tableClasses as $class) { | BUG Fix delete crashing when no locales have been created yet | tractorcow-farm_silverstripe-fluent | train | php |
066039f379f18ce1d0924b7ee6c0a9befd66ba52 | diff --git a/lib/Importer.js b/lib/Importer.js
index <HASH>..<HASH> 100644
--- a/lib/Importer.js
+++ b/lib/Importer.js
@@ -220,7 +220,7 @@ class Importer {
findOneJsModule(variableName) {
const jsModules = this.findJsModulesFor(variableName);
if (!jsModules) {
- this.message(`No JS module to import for variable ${variableName}`);
+ this.message(`No JS module to import for variable \`${variableName}\``);
return null;
} | Fix log message when no variable is found
I accidentally removed the backticks when porting this code earlier. | Galooshi_import-js | train | js |
ea3d291420ffd5ebcc6bb7c1deef32c853ce24a8 | diff --git a/src/Illuminate/Database/Connection.php b/src/Illuminate/Database/Connection.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Connection.php
+++ b/src/Illuminate/Database/Connection.php
@@ -904,7 +904,7 @@ class Connection implements ConnectionInterface
$this->doctrineConnection = new DoctrineConnection(array_filter([
'pdo' => $this->getPdo(),
- 'dbname' => $this->getConfig('database'),
+ 'dbname' => $this->getDatabaseName(),
'driver' => $driver->getName(),
'serverVersion' => $this->getConfig('server_version'),
]), $driver); | Use the current DB to create Doctrine Connections. (#<I>) | laravel_framework | train | php |
207e9c87e30a8c2fec7379891533832f8989695e | diff --git a/src/main/java/org/jcodec/containers/mps/MPSDemuxer.java b/src/main/java/org/jcodec/containers/mps/MPSDemuxer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jcodec/containers/mps/MPSDemuxer.java
+++ b/src/main/java/org/jcodec/containers/mps/MPSDemuxer.java
@@ -475,7 +475,6 @@ public class MPSDemuxer extends SegmentReader implements MPEGDemuxer {
errors ++;
break;
default:
- System.out.println(marker);
if (state > 3 && sliceSize < 1) {
errors ++;
} | [mps] Removing the debug printf | jcodec_jcodec | train | java |
1bb0d78697ec887219fa78218cf964f364ace2a3 | diff --git a/test/test_equality.js b/test/test_equality.js
index <HASH>..<HASH> 100644
--- a/test/test_equality.js
+++ b/test/test_equality.js
@@ -25,7 +25,7 @@
*/
var assert = require('assert');
-var setEq = require('../index.js');
+var setEq = require('../seteq.js');
assert.ok(!setEq(new Set([1,2]), new Set([1])));
assert.ok(setEq(new Set([1]), new Set([1]))); | Updated index.js reference to seteq.js | dicksont_es6-set-eq | train | js |
d77402c5dd93da2af7a026fdf4e9e60a77df53e8 | diff --git a/lib/mlb_gameday/game.rb b/lib/mlb_gameday/game.rb
index <HASH>..<HASH> 100644
--- a/lib/mlb_gameday/game.rb
+++ b/lib/mlb_gameday/game.rb
@@ -94,6 +94,8 @@ module MLBGameday
end
def score
+ return [0, 0] if !game.in_progress? && !game.over?
+
[xpath("//game/@home_team_runs").to_i, xpath("//game/@away_team_runs").to_i]
end | Pre-Game and Preview games don't really have scores, so let's say 0-0 | Fustrate_mlb_gameday | train | rb |
0db81b9974abf772d40f64f77c9d7220f880b4e9 | diff --git a/__init__.py b/__init__.py
index <HASH>..<HASH> 100644
--- a/__init__.py
+++ b/__init__.py
@@ -8,10 +8,6 @@ used from a setup script as
setup (...)
"""
-# Distutils version
-#
-# Updated automatically by the Python release process.
-#
-#--start constants--
-__version__ = "3.2.6"
-#--end constants--
+import sys
+
+__version__ = sys.version[:sys.version.index(' ')] | keep distutils version in sync with python version automatically | pypa_setuptools | train | py |
6b869bd9531dccdd791bc721bb83e6b13ed80f77 | diff --git a/environs/polling_test.go b/environs/polling_test.go
index <HASH>..<HASH> 100644
--- a/environs/polling_test.go
+++ b/environs/polling_test.go
@@ -56,6 +56,7 @@ func (inst *dnsNameFakeInstance) WaitDNSName() (string, error) {
return environs.WaitDNSName(inst)
}
+func (*dnsNameFakeInstance) Addresses() ([]instance.Address, error) { return nil, nil }
func (*dnsNameFakeInstance) Id() instance.Id { return "" }
func (*dnsNameFakeInstance) OpenPorts(string, []instance.Port) error { return nil }
func (*dnsNameFakeInstance) ClosePorts(string, []instance.Port) error { return nil } | Fix environs tests using dnsNameFakeInstance which didn't implement wqAddresses() | juju_juju | train | go |
4bc2d643d1c5a6277c1ab23ddbd7e66606586c81 | diff --git a/lib/seneca.js b/lib/seneca.js
index <HASH>..<HASH> 100644
--- a/lib/seneca.js
+++ b/lib/seneca.js
@@ -1587,8 +1587,13 @@ function make_seneca(initial_options ) {
args.strargs ? jsonic( args.strargs ) : {}
)
- var fn = args.fn
- if( !fn ) {
+ var fn
+ if( args.fn ) {
+ fn = function(data,done){
+ return args.fn.call(self,data,done)
+ }
+ }
+ else {
fn = function(data,done){
if( args.strargs ) { | set context to self for zig functions | senecajs_seneca | train | js |
8d36002a8002e97267826de10095ae3356492fd7 | diff --git a/lib/find-selectors.js b/lib/find-selectors.js
index <HASH>..<HASH> 100644
--- a/lib/find-selectors.js
+++ b/lib/find-selectors.js
@@ -28,7 +28,7 @@ FindSelectors.prototype.parseFileContent = function() {
FindSelectors.prototype.eachNodeCheck = function(node, selectors) {
if (node.type == 'CallExpression' && node.callee.object &&
- (node.callee.object.name === 'by' || node.callee.object.name === 'By')) {
+ node.callee.object.name.toLowerCase() === 'by') {
var lineInfo = node.arguments[0].loc.start;
var lineAndColumn = lineInfo.line + ':' + lineInfo.column;
@@ -43,4 +43,4 @@ FindSelectors.prototype.eachNodeCheck = function(node, selectors) {
}
-module.exports = new FindSelectors();
\ No newline at end of file
+module.exports = new FindSelectors(); | Update find-selectors.js
Removed case sensitive check. | ramonvictor_gulp-protractor-qa | train | js |
2e0e6e33426dd26b3c2b3f8570e8e5f66a047a97 | diff --git a/caravel/assets/visualizations/table.js b/caravel/assets/visualizations/table.js
index <HASH>..<HASH> 100644
--- a/caravel/assets/visualizations/table.js
+++ b/caravel/assets/visualizations/table.js
@@ -25,6 +25,15 @@ function tableVis(slice) {
var form_data = json.form_data;
var metrics = json.form_data.metrics;
+ // Removing metrics (aggregates) that are strings
+ var real_metrics = [];
+ for (var k in data.records[0]) {
+ if (metrics.indexOf(k) > -1 && !isNaN(data.records[0][k])) {
+ real_metrics.push(k);
+ }
+ }
+ metrics = real_metrics;
+
function col(c) {
var arr = [];
for (var i = 0; i < data.records.length; i++) { | [quickfix] support isNaN aggregates in Table viz | apache_incubator-superset | train | js |
4d48a8b2b1a81aa72a5ddd0818c5ed94746d2b31 | diff --git a/addon/classes/events-base.js b/addon/classes/events-base.js
index <HASH>..<HASH> 100644
--- a/addon/classes/events-base.js
+++ b/addon/classes/events-base.js
@@ -110,7 +110,7 @@ export default class EventsBase extends Service {
return rhett;
}).sortBy('startDate', 'name');
obj.postrequisites = obj.postrequisites.map(postreq => this.createEventFromData(postreq, isUserEvent)).sortBy('startDate', 'name');
-
+ obj.isUserEvent = isUserEvent;
return obj;
} | set is-user-event flag on calendar-event creation for consumption further downstream. | ilios_common | train | js |
8c4f43ff65e566a9ebc9d8317871fe2fce62ae68 | diff --git a/lib/circuitry/subscriber.rb b/lib/circuitry/subscriber.rb
index <HASH>..<HASH> 100644
--- a/lib/circuitry/subscriber.rb
+++ b/lib/circuitry/subscriber.rb
@@ -27,6 +27,7 @@ module Circuitry
TEMPORARY_ERRORS = [
Excon::Errors::InternalServerError,
Excon::Errors::ServiceUnavailable,
+ Excon::Errors::SocketError,
Excon::Errors::Timeout,
].freeze | Handle excon error for 'connection reset by peer' | kapost_circuitry | train | rb |
6b3a41a1768dd9c5e7a0da35080bacd87ec0bc17 | diff --git a/telemetry/telemetry/core/platform/profiler/perf_profiler.py b/telemetry/telemetry/core/platform/profiler/perf_profiler.py
index <HASH>..<HASH> 100644
--- a/telemetry/telemetry/core/platform/profiler/perf_profiler.py
+++ b/telemetry/telemetry/core/platform/profiler/perf_profiler.py
@@ -6,6 +6,7 @@ import logging
import os
import re
import signal
+import stat
import subprocess
import sys
import tempfile
@@ -124,6 +125,8 @@ class PerfProfiler(profiler.Profiler):
self._process_profilers = []
if platform_backend.GetOSName() == 'android':
android_prebuilt_profiler_helper.GetIfChanged('perfhost')
+ os.chmod(android_prebuilt_profiler_helper.GetHostPath('perfhost'),
+ stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
android_prebuilt_profiler_helper.InstallOnDevice(
browser_backend.adb, 'perf')
for pid, output_file in process_output_file_map.iteritems(): | Telemetry / Android: make perfhost prebuilt an executable.
Small follow-up from crrev.com/<I>
BUG=
Review URL: <URL> | catapult-project_catapult | train | py |
089a8aea488840c5229efec4dc872f2e9180270f | diff --git a/Unosquare.Tubular/Javascript/tubular/tubular-directives.js b/Unosquare.Tubular/Javascript/tubular/tubular-directives.js
index <HASH>..<HASH> 100644
--- a/Unosquare.Tubular/Javascript/tubular/tubular-directives.js
+++ b/Unosquare.Tubular/Javascript/tubular/tubular-directives.js
@@ -625,7 +625,7 @@
compile: function compile() {
return {
pre: function (scope, lElement, lAttrs) {
- lAttrs.label = lAttrs.label || (lAttrs.name || '').replace(/([a-z])([A-Z])/g, '$1 $2');
+ lAttrs.label = angular.isDefined(lAttrs.label) ? lAttrs.label : (lAttrs.name || '').replace(/([a-z])([A-Z])/g, '$1 $2');
var column = new ColumnModel(lAttrs);
scope.$component.addColumn(column); | Making it so the label attribute is not replaced when it's explicitly set as emtpy string | unosquare_tubular | train | js |
c257e50b6cf58dced0d7064b660be23ea93c4844 | diff --git a/tests/test-rest-attachments-controller.php b/tests/test-rest-attachments-controller.php
index <HASH>..<HASH> 100644
--- a/tests/test-rest-attachments-controller.php
+++ b/tests/test-rest-attachments-controller.php
@@ -80,13 +80,16 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
'slug',
'status',
), $keys );
- $this->assertEqualSets( array(
+ $media_types = array(
'application',
'video',
'image',
'audio',
- 'text',
- ), $data['endpoints'][0]['args']['media_type']['enum'] );
+ );
+ if ( ! is_multisite() ) {
+ $media_types[] = 'text';
+ }
+ $this->assertEqualSets( $media_types, $data['endpoints'][0]['args']['media_type']['enum'] );
}
public function test_get_items() { | Multisite doesn't support `text` | WP-API_WP-API | train | php |
d48d24176f0c189b493504861640fa2810e194ba | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ class PyTest(TestCommand):
setup(
name='graphene',
- version='0.8.0',
+ version='0.8.1',
description='GraphQL Framework for Python',
long_description=open('README.rst').read(), | Updated Graphene version to <I> | graphql-python_graphene | train | py |
40e32a885c9dfdf87388c6b262be3cd30da5cab1 | diff --git a/lib/uspec/formatter.rb b/lib/uspec/formatter.rb
index <HASH>..<HASH> 100644
--- a/lib/uspec/formatter.rb
+++ b/lib/uspec/formatter.rb
@@ -10,7 +10,7 @@ module Uspec
end
def color hue, text = nil
- esc("3#{colors[hue]};1") + "#{text}#{normal}"
+ "#{esc "3#{colors[hue]};1"}#{text}#{normal}"
end
def esc seq
@@ -18,7 +18,7 @@ module Uspec
end
def normal text=nil
- esc(0) + text.to_s
+ "#{esc 0}#{text}"
end
def colorize result, source
@@ -46,12 +46,12 @@ module Uspec
def trace error
error.backtrace.inject(String.new) do |text, line|
- text << hspace + line + newline
+ text << "#{hspace}#{line}#{newline}"
end
end
def message error
- red(classinfo error) + error.message
+ "#{red classinfo error}#{error.message}"
end
def classinfo object
@@ -71,7 +71,7 @@ module Uspec
end
def vspace
- newline + newline
+ "#{newline}#{newline}"
end
def newline | Replace with safer string interpolation. | acook_uspec | train | rb |
35879e2e81e5fe54351624f11f96c82cf3cfe17f | diff --git a/lib/prey.js b/lib/prey.js
index <HASH>..<HASH> 100644
--- a/lib/prey.js
+++ b/lib/prey.js
@@ -6,5 +6,6 @@ if(!common.config) common.load_config();
var agent = exports.agent = require('./prey/agent');
var hooks = exports.hooks = require('./prey/hooks');
var dispatcher = exports.dispatcher = require('./prey/dispatcher');
+var provider = exports.provider = require('./prey/provider_hub'); | Export provider_hub in ./lib/prey for easy access to third-party modules. | prey_prey-node-client | train | js |
26df33d7297dae4ffadb55b4a5416333173035bf | diff --git a/scripts/setup.py b/scripts/setup.py
index <HASH>..<HASH> 100644
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -266,7 +266,7 @@ setup(name = "gmpy2",
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
- 'Intended Audience :: Science/Research'
+ 'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X', | add one missing comma
found by lgtm | aleaxit_gmpy | train | py |
16647719853f00e654744d08e6b5abe4ad9458c2 | diff --git a/src/components/ResultsList/ResultsList.js b/src/components/ResultsList/ResultsList.js
index <HASH>..<HASH> 100644
--- a/src/components/ResultsList/ResultsList.js
+++ b/src/components/ResultsList/ResultsList.js
@@ -17,7 +17,7 @@ import Sidebar from '../Sidebar/Sidebar';
import './ResultsList.css';
/**
- * Renders list categories with radio buttons and "Next" button.
+ * Renders results packages with radio buttons and "Select package" button.
*/
class ResultsList extends Component {
render() { | [#9] Fix description for component | ymcatwincities_openy | train | js |
169e41464df73585c59497e2d17c74cbac59056a | diff --git a/src/Graphql/Graphql.php b/src/Graphql/Graphql.php
index <HASH>..<HASH> 100644
--- a/src/Graphql/Graphql.php
+++ b/src/Graphql/Graphql.php
@@ -96,7 +96,7 @@ function schema($typeDefs, array $resolvers = [])
function resolvers(array $resolvers)
{
Executor::setDefaultFieldResolver(function ($source, $args, $context, ResolveInfo $info) use ($resolvers) {
- if (is_null($source) || !isset($source[$info->fieldName])) {
+ if (is_null($source)) {
$resolvers = $resolvers[$info->parentType->name];
$fieldName = $info->fieldName;
$property = null; | Fix bad resolver root value catching | leocavalcante_siler | train | php |
0c0695404f838c95a4c37074e7dbd249a011b033 | diff --git a/main.js b/main.js
index <HASH>..<HASH> 100755
--- a/main.js
+++ b/main.js
@@ -103,5 +103,5 @@ Emitter.Hybrid = Hybrid = function HybridEmitter(){
this[resolver] = {};
};
+Emitter.prototype = new Target();
Object.defineProperties(Hybrid.prototype,emitterBag);
-Object.defineProperties(Hybrid.prototype,targetBag); | Emitter.Hybrid is now an instance of Emitter.Target | manvalls_y-emitter | train | js |
db3d5404d9160c01d517484369da675005af75ff | diff --git a/code/controllers/EventRegisterController.php b/code/controllers/EventRegisterController.php
index <HASH>..<HASH> 100644
--- a/code/controllers/EventRegisterController.php
+++ b/code/controllers/EventRegisterController.php
@@ -49,14 +49,14 @@ class EventRegisterController extends Page_Controller {
*/
public function index() {
$event = $this->time->Event();
-
if ($event->LimitedPlaces && ($this->time->getRemainingPlaces() < 1)) {
$message = _t('EventManagement.NOPLACES', 'This event has no more places available.');
- return array(
+ $controller = $this->customise(array(
'Title' => _t('EventManagement.EVENTISFULL', 'This Event Is Full'),
'Content' => "<p>$message</p>"
- );
+ ));
+ return $this->getViewer('index')->process($controller);
}
$title = sprintf( | Fixed an error with an action expecting a string rather than an array. | registripe_registripe-core | train | php |
db06cdc7baf35bfe7a6d063e07f0223669315c19 | diff --git a/elasticsearch_dsl/field.py b/elasticsearch_dsl/field.py
index <HASH>..<HASH> 100644
--- a/elasticsearch_dsl/field.py
+++ b/elasticsearch_dsl/field.py
@@ -143,6 +143,8 @@ class InnerObject(object):
our[name] = other[name]
def _to_python(self, data):
+ if data is None:
+ return None
# don't wrap already wrapped data
if isinstance(data, self._doc_class):
return data
diff --git a/test_elasticsearch_dsl/test_document.py b/test_elasticsearch_dsl/test_document.py
index <HASH>..<HASH> 100644
--- a/test_elasticsearch_dsl/test_document.py
+++ b/test_elasticsearch_dsl/test_document.py
@@ -32,6 +32,11 @@ class MyMultiSubDoc(MyDoc2, MySubDoc):
class DocWithNested(document.DocType):
comments = field.Nested(properties={'title': field.String()})
+def test_null_value_for_object():
+ d = MyDoc(inner=None)
+
+ assert d.inner is None
+
def test_inherited_doc_types_can_override_index():
class MyDocDifferentIndex(MySubDoc):
class Meta: | Allow None as value of Object field
Fixes #<I> | elastic_elasticsearch-dsl-py | train | py,py |
bd957f2d6a671382a9af3116c43ff7dd55b8dc0e | diff --git a/update-urls/main.go b/update-urls/main.go
index <HASH>..<HASH> 100644
--- a/update-urls/main.go
+++ b/update-urls/main.go
@@ -6,7 +6,7 @@
// update-urls updates GitHub URL docs for each service endpoint.
//
// It is meant to be used periodically by go-github repo maintainers
-// to update stale GitHub Developer v3 API documenation URLs.
+// to update stale GitHub Developer v3 API documentation URLs.
//
// Usage (from go-github directory):
// go run ./update-urls/main.go | Correct spelling errors (#<I>) | google_go-github | train | go |
6147ca84e1aaf8a7c8ee83561ecc4e274a016f05 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -86,7 +86,7 @@ setup(
long_description=long_description,
long_description_content_type='text/markdown',
classifiers=[ # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: Implementation :: PyPy',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
@@ -95,10 +95,10 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'License :: OSI Approved :: Apache Software License',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Bio-Informatics', | upd python version support and set production status in setup.py | chaimleib_intervaltree | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.