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
0309b7202170e73e6dab541f6321706c7b8d1083
diff --git a/zappa/handler.py b/zappa/handler.py index <HASH>..<HASH> 100644 --- a/zappa/handler.py +++ b/zappa/handler.py @@ -258,7 +258,7 @@ class LambdaHandler(object): Support S3, SNS, DynamoDB and kinesis events """ if 's3' in record: - return record['s3']['configurationId'] + return record['s3']['configurationId'].split(':')[-1] arn = None if 'Sns' in record: diff --git a/zappa/util.py b/zappa/util.py index <HASH>..<HASH> 100644 --- a/zappa/util.py +++ b/zappa/util.py @@ -157,6 +157,8 @@ def get_event_source(event_source, lambda_arn, target_function, boto_session, dr arn_back = split_arn[-1] ctx.environment = arn_back funk.arn = arn_front + funk.name = target_function + funk.name = ':'.join([arn_back, target_function]) else: funk.arn = lambda_arn
* set the funk name to <project-name>:<event_function> * changed the get_function_for_aws_event to returen the function part of the record['s3']['configurationId']
Miserlou_Zappa
train
py,py
aba64e12a64d1dc28190565176ef9377494547f9
diff --git a/tasks/utils.js b/tasks/utils.js index <HASH>..<HASH> 100644 --- a/tasks/utils.js +++ b/tasks/utils.js @@ -39,7 +39,7 @@ module.exports.getRevision = function(cb) { }; module.exports.getConfigFor = function(prop) { - return deployConfig[prop] && deployConfig[prop][env()]; + return deployConfig[prop] && deployConfig[prop][env()] || deployConfig[prop]; }; module.exports.getRedisClient = function(config, callback) {
allow environment agnostic config
productboard_webpack-deploy
train
js
836b5f9308c7eb572929a840ec52f90191d9dcb1
diff --git a/lojix/wam/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java b/lojix/wam/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java index <HASH>..<HASH> 100644 --- a/lojix/wam/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java +++ b/lojix/wam/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java @@ -1275,6 +1275,16 @@ public class WAMInstruction implements Sizeable } /** + * Provides the human readable form of the instruction. + * + * @return The human readable form of the instruction. + */ + public String getPretty() + { + return pretty; + } + + /** * Prints the human readable form of the instruction for debugging purposes. * * @param instruction The instruction, including its arguments.
Added access to the pretty version of instruction mnemonics.
rupertlssmith_lojix
train
java
45829d0b3c7050b97a72494c68d8aff9c43996b2
diff --git a/hooks/after_prepare_android.js b/hooks/after_prepare_android.js index <HASH>..<HASH> 100644 --- a/hooks/after_prepare_android.js +++ b/hooks/after_prepare_android.js @@ -54,7 +54,7 @@ if (platformDir) { } if (!fs.existsSync(manifestFile)) { - throw new Error("! Can't find the AndroidManifest.xml. This shouldn't happen, please contact us for support.\n") + throw new Error("! Can't find the AndroidManifest.xml. This shouldn't happen: try running `cordova prepare`, if it doesn\'t fix the issue please contact us for support.\n") } /**
refactor(hooks): better error message
nearit_Cordova-SDK
train
js
320cfd18121ad32a67a613119a437012514c784b
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -38,5 +38,10 @@ config.get = function(name, type) { logger.logerror(err.name + ': ' + err.message); } } - return results; + // Pass arrays by value to prevent config being modified accidentally. + if (typeof results === 'object' && results.constructor.name === 'Array') { + return results.slice(); + } else { + return results; + } };
Pass config results by value to prevent them from being overwritten
haraka_Haraka
train
js
88966583f7303d6d3fa2a3fd69a8793694878521
diff --git a/lib/sinja/version.rb b/lib/sinja/version.rb index <HASH>..<HASH> 100644 --- a/lib/sinja/version.rb +++ b/lib/sinja/version.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true module Sinja - VERSION = '1.2.0.pre1' + VERSION = '1.2.0.pre2' end
Bump to <I>.pre2
mwpastore_sinja
train
rb
6b0c1bfb57a36d5c25feb849701f4f1b5877bad2
diff --git a/lxd/device/nic_routed.go b/lxd/device/nic_routed.go index <HASH>..<HASH> 100644 --- a/lxd/device/nic_routed.go +++ b/lxd/device/nic_routed.go @@ -23,8 +23,14 @@ type nicRouted struct { deviceCommon } -func (d *nicRouted) CanHotPlug() (bool, []string) { - return false, []string{"limits.ingress", "limits.egress", "limits.max"} +// CanHotPlug returns whether the device can be managed whilst the instance is running. +func (d *nicRouted) CanHotPlug() bool { + return false +} + +// UpdatableFields returns a list of fields that can be updated without triggering a device remove & add. +func (d *nicRouted) UpdatableFields() []string { + return []string{"limits.ingress", "limits.egress", "limits.max"} } // validateConfig checks the supplied config for correctness.
lxd/device/nic/routed: Splits CanHotPlug function into new CanHotPlug and UpdatableFields functions
lxc_lxd
train
go
bad9a0307e95052b973ad05fb321f386b7a3bff5
diff --git a/lib/OpenLayers/Feature/WFS.js b/lib/OpenLayers/Feature/WFS.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Feature/WFS.js +++ b/lib/OpenLayers/Feature/WFS.js @@ -24,6 +24,13 @@ OpenLayers.Feature.WFS.prototype = this.layer.addMarker(this.marker); } }, + + destroy: function() { + if (this.marker != null) { + this.layer.removeMarker(this.marker); + } + OpenLayers.Feature.prototype.destroy.apply(this, arguments); + }, /** * @param {XMLNode} xmlNode
on destroy() of a WFS feature, remove its marker git-svn-id: <URL>
openlayers_openlayers
train
js
791f482dcb320f48cf950c4b2c6047d1981a8f67
diff --git a/redis/__init__.py b/redis/__init__.py index <HASH>..<HASH> 100644 --- a/redis/__init__.py +++ b/redis/__init__.py @@ -37,7 +37,7 @@ def int_or_str(value): return value -__version__ = "4.0.1" +__version__ = "4.0.2" VERSION = tuple(map(int_or_str, __version__.split('.'))) diff --git a/redis/connection.py b/redis/connection.py index <HASH>..<HASH> 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -9,7 +9,6 @@ import io import os import socket import threading -import warnings import weakref from redis.exceptions import ( @@ -67,9 +66,6 @@ if HIREDIS_AVAILABLE: # only use byte buffer if hiredis supports it if not HIREDIS_SUPPORTS_BYTE_BUFFER: HIREDIS_USE_BYTE_BUFFER = False -else: - msg = "redis-py works best with hiredis. Please consider installing" - warnings.warn(msg) SYM_STAR = b'*' SYM_DOLLAR = b'$'
Better removal of hiredis warning (#<I>)
andymccurdy_redis-py
train
py,py
f0d4d197b18f31020ab5657b4707e02bed74b41d
diff --git a/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb b/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb +++ b/lib/active_record/connection_adapters/ovirt_postgresql_adapter.rb @@ -11,7 +11,8 @@ module ActiveRecord valid_conn_param_keys = PG::Connection.conndefaults_hash.keys + [:requiressl] conn_params.slice!(*valid_conn_param_keys) - ConnectionAdapters::OvirtPostgreSQLAdapter.new(nil, logger, conn_params, config) + conn = PG.connect(conn_params) if ActiveRecord::VERSION::MAJOR >= 6 + ConnectionAdapters::OvirtPostgreSQLAdapter.new(conn, logger, conn_params, config) end end @@ -27,4 +28,4 @@ module ActiveRecord end end end -end \ No newline at end of file +end
Pass in a connection when initializing pg adapter On ActiveRecord <I>+ the `ConnectionAdapters::PostgreSQLAdapter#initialize` expects to be passed in a valid postgres connection, where previous versions expected this to be `nil`.
ManageIQ_ovirt_metrics
train
rb
cf8fa90c25212d7c8d9f18ea58bff75b517d5187
diff --git a/src/components/input.js b/src/components/input.js index <HASH>..<HASH> 100644 --- a/src/components/input.js +++ b/src/components/input.js @@ -65,22 +65,27 @@ export default class Input extends React.Component { */ validate() { + /* istanbul ignore next */ return this.refs.unboundInput.validate() } isValid() { + /* istanbul ignore next */ return this.refs.unboundInput.isValid() } isModified() { + /* istanbul ignore next */ return this.refs.unboundInput.isModified() } resetModified() { + /* istanbul ignore next */ return this.refs.unboundInput.resetModified() } reset() { + /* istanbul ignore next */ return this.refs.unboundInput.reset() }
Add Ignore Code Coverage, Public Function In Input (#<I>) Add Ignore code coverage to public functions in Input component because those functions are just returning the results from UnboundInput's public functions so testing those will only be testing the results of functions which are already been tested.
frig-js_frig
train
js
30e529f9990033a51ec230f6dcbac4d6ac86f7b4
diff --git a/lib/rally_api/version.rb b/lib/rally_api/version.rb index <HASH>..<HASH> 100644 --- a/lib/rally_api/version.rb +++ b/lib/rally_api/version.rb @@ -4,5 +4,5 @@ #of the applicable Subscription Agreement between your company and #Rally Software Development Corp. module RallyAPI - VERSION = "0.9.2" + VERSION = "0.9.3" end diff --git a/test/rally_api_update_spec.rb b/test/rally_api_update_spec.rb index <HASH>..<HASH> 100644 --- a/test/rally_api_update_spec.rb +++ b/test/rally_api_update_spec.rb @@ -93,4 +93,20 @@ describe "Rally Json Update Tests" do bottom_story["ObjectID"].should == @test_story["ObjectID"] end + it "should do rank to with params on a plain update" do + defect_hash = {} + defect_hash["Severity"] = "Major Problem" + params = {:rankTo => "BOTTOM"} + updated_defect = @rally.update(:defect, @test_defect.ObjectID, defect_hash, params) + updated_defect.Severity.should == "Major Problem" + bottom_defects = @rally.find do |q| + q.type = :defect + q.order = "Rank Desc" + q.limit = 20 + q.page_size = 20 + q.fetch = "Name,Rank,ObjectID" + end + bottom_defects[0]["ObjectID"].should == @test_defect["ObjectID"] + end + end
Rev to <I> change to add params to url for update method
RallyTools_RallyRestToolkitForRuby
train
rb,rb
6f530411aa2f48487dee713fdb32b4bf798fb919
diff --git a/etc/reset.py b/etc/reset.py index <HASH>..<HASH> 100755 --- a/etc/reset.py +++ b/etc/reset.py @@ -118,10 +118,10 @@ def find_in_json(j, f): def print_status(status): print("===> {}".format(status)) -def run(cmd, *args, raise_on_error=True, stdin=None, capture_output=False): +def run(cmd, *args, raise_on_error=True, stdin=None, capture_output=False, timeout=None): all_args = [cmd, *args] print_status("running: `{}`".format(" ".join(all_args))) - return subprocess.run(all_args, check=raise_on_error, capture_output=capture_output, input=stdin, encoding="utf8") + return subprocess.run(all_args, check=raise_on_error, capture_output=capture_output, input=stdin, encoding="utf8", timeout=timeout) def capture(cmd, *args): return run(cmd, *args, capture_output=True).stdout @@ -148,7 +148,7 @@ def main(): # latter doesn't catch when `pachctl` doesn't exist -- an error case which # we also want to ignore try: - run("pachctl", "delete", "all") + run("pachctl", "delete", "all", stdin="yes\n", timeout=5) except: pass
Set a timeout and automatically confirm when deleting pachyderm resources
pachyderm_pachyderm
train
py
668d495821aa4ebb74f61ee5b63b82417ac5a533
diff --git a/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java b/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java index <HASH>..<HASH> 100644 --- a/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java +++ b/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java @@ -13,6 +13,7 @@ */ package com.facebook.presto.hive; +import com.facebook.presto.cache.CachingFileSystem; import com.facebook.presto.common.block.Block; import com.facebook.presto.common.type.BigintType; import com.facebook.presto.common.type.BooleanType; @@ -405,6 +406,9 @@ public final class HiveWriteUtils if (fileSystem instanceof HadoopExtendedFileSystem) { return getRawFileSystem(((HadoopExtendedFileSystem) fileSystem).getRawFileSystem()); } + if (fileSystem instanceof CachingFileSystem) { + return getRawFileSystem(((CachingFileSystem) fileSystem).getDataTier()); + } return fileSystem; }
get raw filesystem should consider CachingFileSystem
prestodb_presto
train
java
77e66c195b161d31373479060e21aa737b48557f
diff --git a/pyradigm/base.py b/pyradigm/base.py index <HASH>..<HASH> 100644 --- a/pyradigm/base.py +++ b/pyradigm/base.py @@ -15,6 +15,11 @@ from warnings import warn import numpy as np +class PyradigmException(Exception): + """Custom exception to highlight pyradigm-specific issues.""" + pass + + def is_iterable_but_not_str(value): """Boolean check for iterables that are not strings"""
pyradigm's custom exception
raamana_pyradigm
train
py
857e5773abcde0bff80270d0982ec94080f7f637
diff --git a/Lib/AssetConfig.php b/Lib/AssetConfig.php index <HASH>..<HASH> 100644 --- a/Lib/AssetConfig.php +++ b/Lib/AssetConfig.php @@ -47,7 +47,7 @@ class AssetConfig { public $constantMap = array( 'APP/' => APP, 'WEBROOT/' => WWW_ROOT, - 'ROOT/' => ROOT + 'ROOT' => ROOT ); const FILTERS = 'filters';
Remove trailing / from ROOT The constant doesn't contain a / neither should the replacement. Refs #<I>
markstory_asset_compress
train
php
f14014be9cec2778b0124c2f4a435e76205924c5
diff --git a/opentracing-api/src/main/java/io/opentracing/Tracer.java b/opentracing-api/src/main/java/io/opentracing/Tracer.java index <HASH>..<HASH> 100644 --- a/opentracing-api/src/main/java/io/opentracing/Tracer.java +++ b/opentracing-api/src/main/java/io/opentracing/Tracer.java @@ -68,7 +68,7 @@ public interface Tracer { * Tracer tracer = ... * TextMap httpHeadersCarrier = new AnHttpHeaderCarrier(httpRequest); * SpanContext spanCtx = tracer.extract(Format.Builtin.HTTP_HEADERS, httpHeadersCarrier); - * tracer.buildSpan('...').withChildOf(spanCtx).start(); + * tracer.buildSpan('...').asChildOf(spanCtx).start(); * }</pre> * * If the span serialized state is invalid (corrupt, wrong version, etc) inside the carrier this will result in an
Fix Javadoc withChildOf -> asChildOf (#<I>)
opentracing_opentracing-java
train
java
999ce55a6a4a0b13663d8e0bd53a050befaebd26
diff --git a/galpy/util/bovy_plot.py b/galpy/util/bovy_plot.py index <HASH>..<HASH> 100644 --- a/galpy/util/bovy_plot.py +++ b/galpy/util/bovy_plot.py @@ -1162,11 +1162,15 @@ def scatterplot(x,y,*args,**kwargs): if kwargs.has_key('onedhistxweights'): onedhistxweights= kwargs['onedhistxweights'] kwargs.pop('onedhistxweights') + elif not weights is None: + onedhistxweights= weights else: onedhistxweights= None if kwargs.has_key('onedhistyweights'): onedhistyweights= kwargs['onedhistyweights'] kwargs.pop('onedhistyweights') + elif not weights is None: + onedhistyweights= weights else: onedhistyweights= None if kwargs.has_key('retAxes'):
better handling of weights in scatterplot
jobovy_galpy
train
py
a85a287387a5bcc9463b1e8c02ff170915178c08
diff --git a/src/consumer/runner.js b/src/consumer/runner.js index <HASH>..<HASH> 100644 --- a/src/consumer/runner.js +++ b/src/consumer/runner.js @@ -1,6 +1,8 @@ const createRetry = require('../retry') const { KafkaJSError } = require('../errors') +const isTestMode = process.env.NODE_ENV === 'test' + const isRebalancing = e => e.type === 'REBALANCE_IN_PROGRESS' || e.type === 'NOT_COORDINATOR_FOR_GROUP' @@ -75,7 +77,9 @@ module.exports = class Runner { this.running = false try { - await this.waitForConsumer() + if (!isTestMode) { + await this.waitForConsumer() + } await this.consumerGroup.leave() } catch (e) {} }
Don't wait for consumers to shutdown when running in test mode
tulios_kafkajs
train
js
98ff7edd2aabfa06b96f2ecabba46b84f8fcf7ef
diff --git a/tests/settings.py b/tests/settings.py index <HASH>..<HASH> 100755 --- a/tests/settings.py +++ b/tests/settings.py @@ -17,6 +17,8 @@ DATABASES = { SECRET_KEY = 'fn)t*+$)ugeyip6-#txyy$5wf2ervc0d2n#h)qb)y5@ly$t*@w' INSTALLED_APPS = ( + 'django.contrib.staticfiles', + # rest framework 'rest_framework', 'rest_framework_gis',
Added django.contrib.staticfiles in tests.settings
djangonauts_django-rest-framework-gis
train
py
be13b992e9fac584fe12886d2fe3a75cc7550fa3
diff --git a/src/DataApi/Sections/InteractionsSection.php b/src/DataApi/Sections/InteractionsSection.php index <HASH>..<HASH> 100644 --- a/src/DataApi/Sections/InteractionsSection.php +++ b/src/DataApi/Sections/InteractionsSection.php @@ -38,15 +38,16 @@ class InteractionsSection extends Section * @param string $itemId * @param string $interactionId * @param DateTime|NULL $time + * @param array|NULL $attributes * @return NULL * @throws InvalidArgumentException when given user id is empty string value * @throws InvalidArgumentException when given item id is empty string value * @throws InvalidArgumentException when given interaction id is empty string value * @throws RequestFailedException when request failed for some reason */ - public function insertInteraction($userId, $itemId, $interactionId, DateTime $time = NULL) + public function insertInteraction($userId, $itemId, $interactionId, DateTime $time = NULL, array $attributes = NULL) { - $batch = (new InteractionsBatch())->addInteraction($userId, $itemId, $interactionId, $time); + $batch = (new InteractionsBatch())->addInteraction($userId, $itemId, $interactionId, $time, $attributes); return $this->insertInteractions($batch); }
fix missing attributes in method insertInteraction in interaction section
DataBreakers_php-data-api-client
train
php
cf4ec8fa453b4426fa6ca4a2df3c2fdd269ca820
diff --git a/test/basic_test.js b/test/basic_test.js index <HASH>..<HASH> 100644 --- a/test/basic_test.js +++ b/test/basic_test.js @@ -6,6 +6,7 @@ var expect = require('expect.js'); var utils = require('./utils'); var loader = require('../index.js'); +/* global describe, it */ describe('svg-jsx-loader', function() { it('should convert attributes to camelCase', function(done) { var executor = new utils.Executor(loader);
ESLint warns about undefined globals in tests
janjakubnanista_svg-jsx-loader
train
js
31a974281eb40425031d538d91bb949ca49a41a0
diff --git a/src/Resources/Environment.php b/src/Resources/Environment.php index <HASH>..<HASH> 100644 --- a/src/Resources/Environment.php +++ b/src/Resources/Environment.php @@ -83,6 +83,7 @@ class Environment extends BaseSystemResource $result['platform']['install_path'] = base_path() . DIRECTORY_SEPARATOR; $result['platform']['log_path'] = env('DF_MANAGED_LOG_PATH', storage_path('logs')) . DIRECTORY_SEPARATOR; + $result['platform']['app_debug'] = env('APP_DEBUG', false); $result['platform']['log_mode'] = \Config::get('logging.log'); $result['platform']['log_level'] = \Config::get('logging.log_level'); $result['platform']['cache_driver'] = \Config::get('cache.default');
DP-<I> Test datasource connection upon service creation - add app_debug to environment endpoint
dreamfactorysoftware_df-system
train
php
c1596b504ecd7e7706bed1052e305ce94143463b
diff --git a/sgp4/ext.py b/sgp4/ext.py index <HASH>..<HASH> 100644 --- a/sgp4/ext.py +++ b/sgp4/ext.py @@ -470,13 +470,11 @@ def rv2coe(r, v, mu): * --------------------------------------------------------------------------- */ """ -def jday( - year, mon, day, hr, minute, sec, - ): +def jday(year, mon, day, hr, minute, sec): return (367.0 * year - - floor((7 * (year + floor((mon + 9) / 12.0))) * 0.25) + - floor( 275 * mon / 9.0 ) + + 7.0 * (year + ((mon + 9.0) // 12.0)) * 0.25 // 1.0 + + 275.0 * mon // 9.0 + day + 1721013.5 + ((sec / 60.0 + minute) / 60.0 + hr) / 24.0 # ut in days # - 0.5*sgn(100.0*year + mon - 190002.5) + 0.5;
Replace floor() with native // in jday()
brandon-rhodes_python-sgp4
train
py
0a326df6bf9bd8c6373f043f026c5fc90d74bf30
diff --git a/Kwf/Assets/Modernizr/Dependency.php b/Kwf/Assets/Modernizr/Dependency.php index <HASH>..<HASH> 100644 --- a/Kwf/Assets/Modernizr/Dependency.php +++ b/Kwf/Assets/Modernizr/Dependency.php @@ -80,6 +80,9 @@ class Kwf_Assets_Modernizr_Dependency extends Kwf_Assets_Dependency_Abstract $ret = file_get_contents($outputFile); unlink($outputFile); + //remove comments containing selected tests + $ret = preg_replace("#\n/\*!\n\{.*?\}\n!\*/\n#s", '', $ret); + $ret = Kwf_SourceMaps_SourceMap::createEmptyMap($ret); $map = $ret->getMapContentsData(false);
Modernizr Dependency: remove comments containing selected tests For every test the following was added in the build: /*! { "name": "CSS Media Queries", "caniuse": "css-mediaqueries", "property": "mediaqueries", "tags": ["css"], "builderAliases": ["css_mediaqueries"] } !*/ this regexp removes it
koala-framework_koala-framework
train
php
c3c71f8ab07ccd27f1568e855d8ae3a6bb09890c
diff --git a/test/createLogicMiddleware-latest.spec.js b/test/createLogicMiddleware-latest.spec.js index <HASH>..<HASH> 100644 --- a/test/createLogicMiddleware-latest.spec.js +++ b/test/createLogicMiddleware-latest.spec.js @@ -345,7 +345,7 @@ describe('createLogicMiddleware-latest', () => { ...action, type: 'BAR' }); - }, 10); + }, 20); } }); mw = createLogicMiddleware([logicA]);
add delay to test to ensure messages have fired consistently
jeffbski_redux-logic
train
js
b980e2a3cd2f665844ef2307dadba84b71469aad
diff --git a/openquake/engine/tests/performance_monitor_test.py b/openquake/engine/tests/performance_monitor_test.py index <HASH>..<HASH> 100644 --- a/openquake/engine/tests/performance_monitor_test.py +++ b/openquake/engine/tests/performance_monitor_test.py @@ -23,15 +23,6 @@ class TestCase(unittest.TestCase): self.assertGreaterEqual(pmon.duration, 0) self.assertGreaterEqual(pmon.mem[0], 0) - # the base monitor does not save on the engine db - @attr('slow') - def test_performance_monitor(self): - ls = [] - with PerformanceMonitor([os.getpid()]) as pmon: - for _ in range(1000 * 1000): - ls.append(range(50)) # 50 million of integers - self._check_result(pmon) - def test_light_monitor(self): mon = LightMonitor('test', 1) with mon:
Removed test on the PerformanceMonitor that should not be here Former-commit-id: <I>f<I>b<I>c<I>c<I>f<I>df<I>f0aa8d<I>eedc
gem_oq-engine
train
py
a6008f078f39336a24e05c07e8275845f130e814
diff --git a/src/Web.php b/src/Web.php index <HASH>..<HASH> 100644 --- a/src/Web.php +++ b/src/Web.php @@ -46,7 +46,6 @@ class Web implements MiddlewareInterface * services and filters */ const ROUTE_NAMES = 'namedRoutes'; - const RENDER_ENGINE = 'renderer'; const CS_RF_FILTER = 'csrf'; const ERROR_VIEWS = 'error-view-files'; const REFERRER_URI = 'referrer-uri'; @@ -176,8 +175,8 @@ class Web implements MiddlewareInterface */ public function getViewEngine() { - if($this->app->exists(Web::RENDER_ENGINE)) { - return $this->app->get(Web::RENDER_ENGINE); + if($this->app->exists(ViewEngineInterface::class)) { + return $this->app->get(ViewEngineInterface::class); } $locator = new Locator($this->view_dir); if ($doc_root = $this->docs_dir) { @@ -186,7 +185,7 @@ class Web implements MiddlewareInterface } $renderer = new Renderer($locator); $view = new View($renderer, new Value()); - $this->app->set(self::RENDER_ENGINE, $view, true); + $this->app->set(ViewEngineInterface::class, $view, true); return $view; }
use ViewEngineInterface as name for renderer.
TuumPHP_Web
train
php
18e1f105f3d5cb1e213c3f9f2715f6c216a16e8e
diff --git a/src/Aggregation/Bucketing/DateRangeAggregation.php b/src/Aggregation/Bucketing/DateRangeAggregation.php index <HASH>..<HASH> 100644 --- a/src/Aggregation/Bucketing/DateRangeAggregation.php +++ b/src/Aggregation/Bucketing/DateRangeAggregation.php @@ -51,7 +51,8 @@ class DateRangeAggregation extends AbstractAggregation foreach ($ranges as $range) { $from = isset($range['from']) ? $range['from'] : null; $to = isset($range['to']) ? $range['to'] : null; - $this->addRange($from, $to); + $key = isset($range['key']) ? $range['key'] : null; + $this->addRange($from, $to, $key); } } @@ -78,12 +79,13 @@ class DateRangeAggregation extends AbstractAggregation * * @throws \LogicException */ - public function addRange($from = null, $to = null) + public function addRange($from = null, $to = null, $key = null) { $range = array_filter( [ 'from' => $from, 'to' => $to, + 'key' => $key, ] );
fixes #<I> - added support for date range keys (#<I>) (cherry picked from commit <I>ac9)
ongr-io_ElasticsearchDSL
train
php
43c2055f61d2a2726b40fb0fb56270752b724064
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -587,7 +587,6 @@ class MigrationTest < ActiveRecord::TestCase if current_adapter?(:Mysql2Adapter, :PostgreSQLAdapter) def test_out_of_range_limit_should_raise - Person.connection.drop_table :test_limits rescue nil e = assert_raise(ActiveRecord::ActiveRecordError, "integer limit didn't raise") do Person.connection.create_table :test_integer_limits, :force => true do |t| t.column :bigone, :integer, :limit => 10 @@ -603,8 +602,6 @@ class MigrationTest < ActiveRecord::TestCase end end end - - Person.connection.drop_table :test_limits rescue nil end end
Remove needless `drop_table :test_limits` A `:test_limits` table has not been created.
rails_rails
train
rb
81cd0e6e042f65656969c8a36cf64eb421b016c3
diff --git a/code/model/SiteTreeFolderExtension.php b/code/model/SiteTreeFolderExtension.php index <HASH>..<HASH> 100644 --- a/code/model/SiteTreeFolderExtension.php +++ b/code/model/SiteTreeFolderExtension.php @@ -19,14 +19,14 @@ class SiteTreeFolderExtension extends DataExtension { } foreach($classes as $className) { - $query = singleton($className)->extendedSQL(); + $query = new DataQuery($className); $ids = $query->execute()->column(); if(!count($ids)) continue; foreach(singleton($className)->has_one() as $relName => $joinClass) { if($joinClass == 'Image' || $joinClass == 'File') { $fieldName = $relName .'ID'; - $query = singleton($className)->extendedSQL("$fieldName > 0"); + $query = DataList::create($className)->where("$fieldName > 0"); $query->distinct = true; $query->select(array($fieldName)); $usedFiles = array_merge($usedFiles, $query->execute()->column());
BUG: Replaced extendedSQL with DataList as per ticket <I>
silverstripe_silverstripe-siteconfig
train
php
4c23a0b22fd1d54460d4fa21afcaec4b84a63eba
diff --git a/core/src/main/java/fr/putnami/pwt/core/widget/client/OutputStaticText.java b/core/src/main/java/fr/putnami/pwt/core/widget/client/OutputStaticText.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/fr/putnami/pwt/core/widget/client/OutputStaticText.java +++ b/core/src/main/java/fr/putnami/pwt/core/widget/client/OutputStaticText.java @@ -25,6 +25,10 @@ public class OutputStaticText extends AbstractOutput<Object> { public OutputStaticText() { } + public OutputStaticText(String text) { + setText(text); + } + protected OutputStaticText(OutputStaticText source) { super(source); }
[core][feature] Add OutputStaticText Constructor acceptiong String
Putnami_putnami-web-toolkit
train
java
412041125190d29d1c9b307f1485851edfd40f4f
diff --git a/src/plugins/cache/operations/command.spec.js b/src/plugins/cache/operations/command.spec.js index <HASH>..<HASH> 100644 --- a/src/plugins/cache/operations/command.spec.js +++ b/src/plugins/cache/operations/command.spec.js @@ -18,26 +18,6 @@ const config = [ }, invalidates: ['user'], invalidatesOn: ['GET'] - }, - { - name: 'userPreview', - ttl: 200, - api: { - getPreviews: (x) => x, - updatePreview: (x) => x - }, - invalidates: ['fda'], - viewOf: 'user' - }, - { - name: 'listUser', - ttl: 200, - api: { - getPreviews: (x) => x, - updatePreview: (x) => x - }, - invalidates: ['fda'], - viewOf: 'user' } ];
refactor(command) Remove unnecessary spec setup
ladda-js_ladda
train
js
71cd6ce6c0f05e56ab645630cddf952861029343
diff --git a/lib/Stripe/ApiRequestor.php b/lib/Stripe/ApiRequestor.php index <HASH>..<HASH> 100644 --- a/lib/Stripe/ApiRequestor.php +++ b/lib/Stripe/ApiRequestor.php @@ -348,7 +348,7 @@ class Stripe_ApiRequestor return true; } - if (strpos(PHP_VERSION, 'hiphop') !== false) { + if (strpos(PHP_VERSION, 'hiphop') !== false || strpos(PHP_VERSION, 'hhvm') !== false) { error_log( 'Warning: HHVM does not support Stripe\'s SSL certificate '. 'verification. (See http://docs.hhvm.com/manual/en/context.ssl.php) '.
Update ApiRequestor for newer hhvm Current versions of HHVM don't include 'hiphop' in the PHP_VERSION string; they are using hhvm. Update the SSL Cert check to ignore those versions as well, or your application will return an 'unable to connect to stripe' error.
stripe_stripe-php
train
php
ea37513157788094838c70c06e9ad8a3d935610e
diff --git a/spec/http_helper.rb b/spec/http_helper.rb index <HASH>..<HASH> 100644 --- a/spec/http_helper.rb +++ b/spec/http_helper.rb @@ -16,15 +16,15 @@ def define_helper(name) } end -%w[ - delete - get - head - options - patch - post - put - trace +[ + "delete", + "get", + "head", + "options", + "patch", + "post", + "put", + "trace", ].each do |name| define_helper name end
Fix linter warning in spec/http_helper.rb
duckinator_okay
train
rb
3892d8bd70c626a04807b4fa828699291ce9dbcc
diff --git a/stdlib/sql.go b/stdlib/sql.go index <HASH>..<HASH> 100644 --- a/stdlib/sql.go +++ b/stdlib/sql.go @@ -136,7 +136,7 @@ func (c *Conn) Query(query string, argsV []driver.Value) (driver.Rows, error) { rowCount := 0 columnsChan := make(chan []string) errChan := make(chan error) - rowChan := make(chan []driver.Value) + rowChan := make(chan []driver.Value, 8) go func() { err := c.conn.SelectFunc(query, func(r *pgx.DataRowReader) error {
Use buffered chan for stdlib.Rows Improved performance slightly
jackc_pgx
train
go
d97d6df32db53a2c3061a63d1654f99e96e6a75a
diff --git a/spec/caching_policy_spec.rb b/spec/caching_policy_spec.rb index <HASH>..<HASH> 100644 --- a/spec/caching_policy_spec.rb +++ b/spec/caching_policy_spec.rb @@ -96,3 +96,18 @@ describe "Storing and retrieving policies" do expect(policy.policies.max_age).to eq(300) end end + +describe "Handling situations where the content type is nil" do + class CachingPolicy + include Middleman::S3Sync::CachingPolicy + end + + let(:caching_policy) { CachingPolicy.new } + + it "returns the default caching policy when the content type is nil" do + caching_policy.add_caching_policy(:default, max_age:(60 * 60 * 24 * 365)) + + expect(caching_policy.caching_policy_for(nil)).to_not be_nil + expect(caching_policy.caching_policy_for(nil).policies[:max_age]).to eq(60 * 60 * 24 * 365) + end +end
This also goes with #<I>
fredjean_middleman-s3_sync
train
rb
c7cb4cf7d8ad18a2daabf0802dc52df7d6cfd660
diff --git a/generator/lib/builder/om/PHP5ObjectBuilder.php b/generator/lib/builder/om/PHP5ObjectBuilder.php index <HASH>..<HASH> 100644 --- a/generator/lib/builder/om/PHP5ObjectBuilder.php +++ b/generator/lib/builder/om/PHP5ObjectBuilder.php @@ -136,7 +136,7 @@ class PHP5ObjectBuilder extends ObjectBuilder } catch (Exception $x) { // prevent endless loop when timezone is undefined date_default_timezone_set('America/Los_Angeles'); - throw new EngineException("Unable to parse default temporal value for " . $col->getFullyQualifiedName() . ": " .$this->getDefaultValueString($col), $x); + throw new EngineException(sprintf('Unable to parse default temporal value "%s" for column "%s"', $col->getDefaultValueString(), $col->getFullyQualifiedName()), $x); } } else { if ($col->isPhpPrimitiveType()) {
[<I>][<I>] Fixed infinite loop when reverse engineering date fields in postgresql and in PHP<I> (closes #<I>)
propelorm_Propel
train
php
df756085a1d23ef72adbfbf5bdc248d0fb9939e7
diff --git a/pymatgen/analysis/chemenv/connectivity/structure_connectivity.py b/pymatgen/analysis/chemenv/connectivity/structure_connectivity.py index <HASH>..<HASH> 100644 --- a/pymatgen/analysis/chemenv/connectivity/structure_connectivity.py +++ b/pymatgen/analysis/chemenv/connectivity/structure_connectivity.py @@ -107,7 +107,7 @@ class StructureConnectivity(): self._environment_subgraph.add_node(env_node) break #Find the connections between the environments - nodes = self._environment_subgraph.nodes() + nodes = list(self._environment_subgraph.nodes()) for inode1, node1 in enumerate(nodes): isite1 = node1.isite links_node1 = self._graph.edges(isite1, data=True)
Fix for networkx versions >= 2.
materialsproject_pymatgen
train
py
213f7f18e99bc074c9a28e520577b5039968f041
diff --git a/treetime/treeanc.py b/treetime/treeanc.py index <HASH>..<HASH> 100644 --- a/treetime/treeanc.py +++ b/treetime/treeanc.py @@ -66,6 +66,13 @@ class TreeAnc(object): def gtr(self): return self._gtr + @gtr.setter + def gtr(self, value): + if not isinstance(value, GTR): + raise TypeError(" GTR instance expected") + self._gtr = value + + def set_gtr(self, in_gtr, **kwargs): """ Create new GTR model, if needed, and set the model as the attribute of the
Added setter for GTR, which takes only GTR type instance
neherlab_treetime
train
py
b934115cfbfb32b71a18a011b009445ce3674a3f
diff --git a/src/test/java/org/syphr/prom/PropertiesManagerTest.java b/src/test/java/org/syphr/prom/PropertiesManagerTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/syphr/prom/PropertiesManagerTest.java +++ b/src/test/java/org/syphr/prom/PropertiesManagerTest.java @@ -230,6 +230,14 @@ public class PropertiesManagerTest PropertiesManager<Key1> prom = PropertiesManagers.newManager(TEST_PROPS_1, Key1.class); prom.getProperty(Key1.SOME_KEY); } + + @Test + public void testManagedPropertiesCached() + { + Assert.assertSame("Single property managers are not cached correctly", + test1Manager.getManagedProperty(Key1.SOME_KEY), + test1Manager.getManagedProperty(Key1.SOME_KEY)); + } public static enum Key1 implements Defaultable {
added a test for proper caching of calls to getManagedProperty (each call that provides the same key must get the same object back)
syphr42_prom
train
java
231445ff61d1e6b6200f600ddfceb68317adc124
diff --git a/indra/sources/indra_db_rest/api.py b/indra/sources/indra_db_rest/api.py index <HASH>..<HASH> 100644 --- a/indra/sources/indra_db_rest/api.py +++ b/indra/sources/indra_db_rest/api.py @@ -271,14 +271,17 @@ def get_statement_queries(stmts, **params): """ def pick_ns(ag): + # If the Agent has grounding, in order of preference, in any of these + # name spaces then we look it up based on grounding. for ns in ['HGNC', 'FPLX', 'CHEMBL', 'CHEBI', 'GO', 'MESH']: if ns in ag.db_refs.keys(): dbid = ag.db_refs[ns] - break - else: - ns = 'TEXT' - dbid = ag.name - return '%s@%s' % (dbid, ns) + return '%s@%s' % (dbid, ns) + # Otherwise, we search by Agent name - if the name is standardized, + # this will still yield good results. If it isn't standardized, then + # the name will match the raw entity text so again this lookup will + # work. + return ag.name queries = [] url_base = get_url_base('statements/from_agents')
Use name-based lookup by default
sorgerlab_indra
train
py
4453fe53e11e94e839f9143f2d6f7fb2118bd427
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -29,6 +29,7 @@ module.exports = { }, prepare: function(context) { var d = context.gitDeploy; + this.log("preparing git in " + d.worktreePath, { verbose: true }); return git.prepareTree(d.worktreePath, d.myRepo, d.repo, d.branch); }, upload: function(context) {
Add verbose log message pointing to sibling git dir Adds a log message showing the location of the directory where the actual git prepare is running (but only if `--verbose` is passed). Might be useful for other users encountering git errors and not being able to reproduce/fix because they are not aware of the "sibling directory" being used. Like was the case here <URL>
ef4_ember-cli-deploy-git
train
js
94597ce179cc06e9730056477057994e850bc3ec
diff --git a/lib/textlint.js b/lib/textlint.js index <HASH>..<HASH> 100644 --- a/lib/textlint.js +++ b/lib/textlint.js @@ -174,7 +174,7 @@ api.lintFile = function (filePath) { api.pushReport = function (ruleId, txtNode, error) { debug("api.pushReport %s", error); messages.push(objectAssign({ - id: ruleId, + ruleId: ruleId, message: error.message, line: error.line ? txtNode.loc.start.line + error.line : txtNode.loc.start.line, column: error.column ? txtNode.loc.start.column + error.column : txtNode.loc.start.column,
chore(textlint): reaname "id" to "ruleId"
textlint_textlint
train
js
76d2814f367583ebac37ad256d5c8b2ccecf19c6
diff --git a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java index <HASH>..<HASH> 100755 --- a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java +++ b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java @@ -2836,7 +2836,12 @@ public class Cql2ElmVisitor extends cqlBaseVisitor { catch (Exception e) { // If something goes wrong attempting to resolve, just set to the expression and report it as a warning, // it shouldn't prevent translation unless the modelinfo indicates strict retrieve typing - retrieve.setCodes(terminology); + if (!(terminology.getResultType() instanceof ListType)) { + retrieve.setCodes(libraryBuilder.resolveToList(terminology)); + } + else { + retrieve.setCodes(terminology); + } // ERROR: // WARNING: libraryBuilder.recordParsingException(new CqlSemanticException("Could not resolve membership operator for terminology target of the retrieve.",
#<I>: Fixed retrieve incorrectly inserting a list promotion for a direct-code reference in some cases.
cqframework_clinical_quality_language
train
java
f6a81f2844f5879dbfae41823369a2c20e3a83dc
diff --git a/db/seeds.rb b/db/seeds.rb index <HASH>..<HASH> 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -16,7 +16,7 @@ end # Global parameters used in configuration snippets parameters = [ - { :name => 'chef_handler_foreman_url', :value => SmartProxy.chef_proxies.first.try(:url) || Setting.foreman_url }, + { :name => 'chef_handler_foreman_url', :value => SmartProxy.with_features('Chef').first.try(:url) || Setting.foreman_url }, { :name => 'chef_server_url', :value => "https://#{Socket.gethostbyname(Socket.gethostname).first}" }, { :name => 'chef_validation_private_key', :value => 'UNSPECIFIED, you must upload your validation key here' }, { :name => 'chef_bootstrap_template', :value => 'chef-client omnibus bootstrap' },
fixes #<I> - don't use deprecated proxy scope
theforeman_foreman_chef
train
rb
86be28d1c0d3432c8ec5a7c39b78ae40f684c3cb
diff --git a/kernel/private/classes/ezpcontentpublishingprocess.php b/kernel/private/classes/ezpcontentpublishingprocess.php index <HASH>..<HASH> 100644 --- a/kernel/private/classes/ezpcontentpublishingprocess.php +++ b/kernel/private/classes/ezpcontentpublishingprocess.php @@ -259,6 +259,15 @@ class ezpContentPublishingProcess extends eZPersistentObject { $this->reset(); } + + // generate static cache + $ini = eZINI::instance(); + if ( $ini->variable( 'ContentSettings', 'StaticCache' ) == 'enabled' ) + { + $staticCacheHandlerClassName = $ini->variable( 'ContentSettings', 'StaticCacheHandler' ); + $staticCacheHandlerClassName::executeActions(); + } + eZScript::instance()->shutdown(); exit; }
Fix EZP-<I>: async publishing should generate static cache Static cache tasks weren't processed after publishing. Asynchronous handling doesn't require that static cache generation is left to the cronjob, since it will happen after content has been published. It will however slow publishing down, since publishing processes will spend some time taking care of static cache.
ezsystems_ezpublish-legacy
train
php
4220556089e0ed5b601ac523600480afe6b9c111
diff --git a/lib/UnsupportedFeatureWarning.js b/lib/UnsupportedFeatureWarning.js index <HASH>..<HASH> 100644 --- a/lib/UnsupportedFeatureWarning.js +++ b/lib/UnsupportedFeatureWarning.js @@ -2,14 +2,19 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ -function UnsupportedFeatureWarning(module, message) { - Error.call(this); - Error.captureStackTrace(this, UnsupportedFeatureWarning); - this.name = "UnsupportedFeatureWarning"; - this.message = message; - this.origin = this.module = module; +"use strict"; + +class UnsupportedFeatureWarning extends Error { + + constructor(module, message) { + super(); + if(Error.hasOwnProperty("captureStackTrace")) { + Error.captureStackTrace(this, this.constructor); + } + this.name = "UnsupportedFeatureWarning"; + this.message = message; + this.origin = this.module = module; + } } -module.exports = UnsupportedFeatureWarning; -UnsupportedFeatureWarning.prototype = Object.create(Error.prototype); -UnsupportedFeatureWarning.prototype.constructor = UnsupportedFeatureWarning; +module.exports = UnsupportedFeatureWarning;
refactor(ES6): upgrade UnsupportedFeatureWarning to ES6 (#<I>)
webpack_webpack
train
js
0f7af860d8df01d1c614b20d687ff6d0393d6938
diff --git a/docker/transport/basehttpadapter.py b/docker/transport/basehttpadapter.py index <HASH>..<HASH> 100644 --- a/docker/transport/basehttpadapter.py +++ b/docker/transport/basehttpadapter.py @@ -3,4 +3,6 @@ import requests.adapters class BaseHTTPAdapter(requests.adapters.HTTPAdapter): def close(self): - self.pools.clear() + super(BaseHTTPAdapter, self).close() + if hasattr(self, 'pools'): + self.pools.clear()
Fix BaseHTTPAdapter for the SSL case
docker_docker-py
train
py
e23dba0084b1dab408e68c2f3b0d42819c23887f
diff --git a/api/auth.go b/api/auth.go index <HASH>..<HASH> 100644 --- a/api/auth.go +++ b/api/auth.go @@ -328,6 +328,7 @@ func AddUserToTeam(w http.ResponseWriter, r *http.Request, t *auth.Token) error if err != nil { return err } + rec.Log(u.Email, "add-user-to-team", "team="+team, "user="+email) return addUserToTeam(email, team, u) } diff --git a/api/auth_test.go b/api/auth_test.go index <HASH>..<HASH> 100644 --- a/api/auth_test.go +++ b/api/auth_test.go @@ -638,6 +638,12 @@ func (s *AuthSuite) TestAddUserToTeam(c *gocheck.C) { c.Assert(err, gocheck.IsNil) c.Assert(t, ContainsUser, s.user) c.Assert(t, ContainsUser, u) + action := testing.Action{ + Action: "add-user-to-team", + User: s.user.Email, + Extra: []interface{}{"team=tsuruteam", "user=" + u.Email}, + } + c.Assert(action, testing.IsRecorded) } func (s *AuthSuite) TestAddUserToTeamShouldReturnNotFoundIfThereIsNoTeamWithTheGivenName(c *gocheck.C) {
api: record user action in the AddUserToTeam handler Related to #<I>.
tsuru_tsuru
train
go,go
28d791ec3233d96f53a8972cdb28ba80b28b3985
diff --git a/hiddenlayer/graph.py b/hiddenlayer/graph.py index <HASH>..<HASH> 100644 --- a/hiddenlayer/graph.py +++ b/hiddenlayer/graph.py @@ -142,7 +142,9 @@ def build_graph(model=None, args=None, input_names=None, elif framework == "tensorflow": from .tf_builder import import_graph, FRAMEWORK_TRANSFORMS import_graph(g, model) - + else: + raise ValueError("`model` input param must be a PyTorch, TensorFlow, or Keras-with-TensorFlow-backend model.") + # Apply Transforms if framework_transforms: if framework_transforms == "default":
Raise exception when we fail to detect the model's framework
waleedka_hiddenlayer
train
py
9701bf5c345292769bb21bc9b0d69122e8142f39
diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index <HASH>..<HASH> 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -71,7 +71,9 @@ class TestUtils(unittest.TestCase): def test_evaluate_condition(self): if not is_backend_enabled("onnxruntime"): return - value = [evaluate_condition("onnxruntime", "StrictVersion(onnxruntime.__version__) <= StrictVersion('0.%d.3')" % i) for i in range(0, 5)] + value = [ + evaluate_condition("onnxruntime", "StrictVersion(onnxruntime.__version__) <= StrictVersion('0.%d.3')" % i) + for i in (1, 9999)] self.assertNotEqual(min(value), max(value)) def test_optimizer(self):
Fix the nightly/CI build error.
onnx_onnxmltools
train
py
19e38d798fc6c32ac2b54e5e796747b1f6f2c1f7
diff --git a/lib/squib/conf.rb b/lib/squib/conf.rb index <HASH>..<HASH> 100644 --- a/lib/squib/conf.rb +++ b/lib/squib/conf.rb @@ -1,6 +1,7 @@ -require 'squib' require 'forwardable' +require 'squib' require 'squib/args/typographer' +require 'yaml' module Squib # @api private diff --git a/lib/squib/layout_parser.rb b/lib/squib/layout_parser.rb index <HASH>..<HASH> 100644 --- a/lib/squib/layout_parser.rb +++ b/lib/squib/layout_parser.rb @@ -1,3 +1,5 @@ +require 'yaml' + module Squib # Internal class for handling layouts #@api private @@ -86,4 +88,4 @@ module Squib end end -end \ No newline at end of file +end
Require yaml just in case
andymeneely_squib
train
rb,rb
bd6811a1fd4637ae192872cd176afd087028d76b
diff --git a/lib/pincers/support/http_client.rb b/lib/pincers/support/http_client.rb index <HASH>..<HASH> 100644 --- a/lib/pincers/support/http_client.rb +++ b/lib/pincers/support/http_client.rb @@ -26,11 +26,11 @@ module Pincers::Support attr_reader :proxy_addr, :proxy_port, :cookies def initialize(_options={}) - if _options.key? :proxy + if _options[:proxy] @proxy_addr, @proxy_port = _options[:proxy].split ':' end - @cookies = if _options.key? :cookies + @cookies = if _options[:cookies] _options[:cookies].copy else CookieJar.new
refactor(http_client): makes http_client more resilent to nil options
platanus_pincers
train
rb
61ee72596daa124278c3b38de2be7217f32e4b7c
diff --git a/httpd/response_logger.go b/httpd/response_logger.go index <HASH>..<HASH> 100644 --- a/httpd/response_logger.go +++ b/httpd/response_logger.go @@ -82,6 +82,7 @@ func buildLogLine(l *responseLogger, r *http.Request, start time.Time) string { detect(referer, "-"), detect(userAgent, "-"), r.Header.Get("Request-Id"), + fmt.Sprintf("%s", time.Since(start)), } return strings.Join(fields, " ")
add time taken to the http server logs
influxdata_influxdb
train
go
6b2631ad681f93136d82134c2412946369a1bf87
diff --git a/core/server/worker/src/main/java/alluxio/worker/block/evictor/LRFUEvictor.java b/core/server/worker/src/main/java/alluxio/worker/block/evictor/LRFUEvictor.java index <HASH>..<HASH> 100644 --- a/core/server/worker/src/main/java/alluxio/worker/block/evictor/LRFUEvictor.java +++ b/core/server/worker/src/main/java/alluxio/worker/block/evictor/LRFUEvictor.java @@ -56,7 +56,7 @@ public final class LRFUEvictor extends AbstractEvictor { private final Map<Long, Double> mBlockIdToCRFValue = new ConcurrentHashMapV8<>(); // In the range of [0, 1]. Closer to 0, LRFU closer to LFU. Closer to 1, LRFU closer to LRU private final double mStepFactor; - /** The attention factor is in the range of [2, INF] */ + /** The attention factor is in the range of [2, INF]. */ private final double mAttenuationFactor; //logic time count
Fix comment style LRUEvictor.java
Alluxio_alluxio
train
java
74c8cebe36de7026f4e7a43df9844a530641dc79
diff --git a/tests/system-logger.js b/tests/system-logger.js index <HASH>..<HASH> 100644 --- a/tests/system-logger.js +++ b/tests/system-logger.js @@ -11,8 +11,8 @@ const DELAYTOCHECKTESTLOGFILE = 1000; const TESTLOGFILE = './tests/testArea/test.log'; describe('logging Tests', function() { - before(() => { - fs.unlinkSync(TESTLOGFILE); // No need to check file exist fs.existsSync(TESTLOGFILE). unlinkSync will skip when file no exist + after(() => { + fs.unlinkSync(TESTLOGFILE); }); describe('Setting Tests', function() { it('verify converseLeveValue', function() {
test(syste-logger): Change the cleanup after the test
leocwlam_system-logger
train
js
08ebf66653342c40d90742835f706e33c807db52
diff --git a/lib/onebox/engine.rb b/lib/onebox/engine.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine.rb +++ b/lib/onebox/engine.rb @@ -97,6 +97,7 @@ require_relative "engine/sound_cloud_onebox" require_relative "engine/spotify_onebox" require_relative "engine/stack_exchange_onebox" require_relative "engine/ted_onebox" +require_relative "engine/twitter_onebox" require_relative "engine/viddler_onebox" require_relative "engine/vimeo_onebox" require_relative "engine/wikipedia_onebox"
require twitter onebox in engine.rb #<I>
discourse_onebox
train
rb
67b3cdc180615095198b15c102d59afc04f1cb5d
diff --git a/src/Carbon/Lang/fa.php b/src/Carbon/Lang/fa.php index <HASH>..<HASH> 100644 --- a/src/Carbon/Lang/fa.php +++ b/src/Carbon/Lang/fa.php @@ -24,6 +24,6 @@ return array( 'second' => ':count ثانیه', 'ago' => ':time پیش', 'from_now' => ':time بعد', - 'after' => ':time پیش از', - 'before' => ':time پس از', + 'after' => ':time پس از', + 'before' => ':time پیش از', );
Update fa.php Farsi translations of 'after' and 'before' switched to correct the meanings.
briannesbitt_Carbon
train
php
765c16df2ad4e36f1cb11358ef2351791ba245c8
diff --git a/pymc3/tests/test_examples.py b/pymc3/tests/test_examples.py index <HASH>..<HASH> 100644 --- a/pymc3/tests/test_examples.py +++ b/pymc3/tests/test_examples.py @@ -15,9 +15,9 @@ def check_example(example_name): example.run("short") -def test_examples0(): - for t in itertools.islice(get_examples(), 0, 10): - yield t +# def test_examples0(): +# for t in itertools.islice(get_examples(), 0, 10): +# yield t def test_examples1(): for t in itertools.islice(get_examples(), 10, 20):
Removed first set of example tests to check on speedup
pymc-devs_pymc
train
py
2a97ac651b2870ba53cd76e4d2f11294f54dd71f
diff --git a/src/openaccess_epub/opf/opf.py b/src/openaccess_epub/opf/opf.py index <HASH>..<HASH> 100644 --- a/src/openaccess_epub/opf/opf.py +++ b/src/openaccess_epub/opf/opf.py @@ -80,10 +80,10 @@ class OPF(object): instance with the title argument, or calling set_title() at any time before writing will give it a title. """ - #Set internal variables to defaults - self.reset_state() #Set Collection Mode by argument self.collection_mode = collection_mode + #Set internal variables to defaults + self.reset_state() #Set location by argument self.location = location #Create the basic document
fixing error caused by reordering of resets
SavinaRoja_OpenAccess_EPUB
train
py
f9b69d10f90a93e799561bc83212cd22588b5cef
diff --git a/lib/editor/htmlarea.php b/lib/editor/htmlarea.php index <HASH>..<HASH> 100644 --- a/lib/editor/htmlarea.php +++ b/lib/editor/htmlarea.php @@ -2324,8 +2324,9 @@ HTMLArea.getHTML = function(root, outputRoot, editor) { break; // skip comments, for now. } - return HTMLArea.formathtml(html); - //return html; + // Still not workin' correctly... + //return HTMLArea.formathtml(html); + return html; }; HTMLArea.prototype.stripBaseURL = function(string) {
HTMLArea.formathtml still not working correctly I've comment it out.
moodle_moodle
train
php
0561ce6ab063db066136e336c1e2ae34edeccb78
diff --git a/src/Layout.php b/src/Layout.php index <HASH>..<HASH> 100644 --- a/src/Layout.php +++ b/src/Layout.php @@ -161,7 +161,7 @@ class Layout $app = \Slim\Slim::getInstance(); $app->response()->status($status); - $app->header('Content-Type', 'application/json'); + $app->response()->header('Content-Type', 'application/json'); $body = json_encode($data); $app->response()->body($data);
BUG: Didn't call response() for the header.
tylerjuniorcollege_slim-layout
train
php
f07d3d422aa75b8d7315ae6b24ab9e2885022a1b
diff --git a/src/widgets/droppable/droppable.js b/src/widgets/droppable/droppable.js index <HASH>..<HASH> 100644 --- a/src/widgets/droppable/droppable.js +++ b/src/widgets/droppable/droppable.js @@ -75,9 +75,11 @@ } - _isPointHovering ( pointXY ) { + _isPointHovering ( pointXY, event ) { - return !!this.$droppable.touching ({ point: pointXY }).length; + let point = pointXY || $.eventXY ( event, 'clientX', 'clientY' ); + + return !!this.$droppable.touching ({ point }).length; } @@ -119,7 +121,7 @@ if ( this._isCompatible ( data.draggable ) ) { - let isHovering = this._isPointHovering ( data.moveXY ); + let isHovering = this._isPointHovering ( false, data.moveEvent ); if ( isHovering !== this._wasHovering ) { @@ -151,7 +153,7 @@ this.$droppable.removeClass ( this.options.classes.target ); - if ( this._isPointHovering ( data.endXY ) ) { + if ( this._isPointHovering ( false, data.endEvent ) ) { if ( this._wasHovering ) {
Droppable: fixed usage when scrolled
svelto_svelto
train
js
687cc78c84d8080ce59039a6dcdf505a8df90041
diff --git a/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpPersistenceFilter.java b/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpPersistenceFilter.java index <HASH>..<HASH> 100644 --- a/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpPersistenceFilter.java +++ b/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpPersistenceFilter.java @@ -139,6 +139,9 @@ public class HttpPersistenceFilter extends HttpFilterAdapter<IoSessionEx> { @Override public void operationComplete(WriteFuture future) { IoSession session = future.getSession(); + if (logger.isTraceEnabled()) { + logger.trace(String.format("Closing session %s because of Connection: close header in HTTP request", session)); + } // close on flush at server session.close(false);
Adding a log message when a session is closed due to Connection: close header in HTTP request
kaazing_gateway
train
java
768a21d1e6e5626f941c87989bbbc5ef67f21b42
diff --git a/bmds/bmds3/recommender/checks.py b/bmds/bmds3/recommender/checks.py index <HASH>..<HASH> 100644 --- a/bmds/bmds3/recommender/checks.py +++ b/bmds/bmds3/recommender/checks.py @@ -331,7 +331,7 @@ class NoDegreesOfFreedom(Check): if dataset.dtype in constants.DICHOTOMOUS_DTYPES: value = model.results.gof.df elif dataset.dtype in constants.CONTINUOUS_DTYPES: - value = model.results.fit.total_df + value = model.results.tests.dfs[3] else: raise ValueError("Unknown dtype")
use correct degree of freedom for continuous checks
shapiromatron_bmds
train
py
11b867ee1fb4b16011a99d6db07eaecc317c1395
diff --git a/pmdarima/arima/_context.py b/pmdarima/arima/_context.py index <HASH>..<HASH> 100644 --- a/pmdarima/arima/_context.py +++ b/pmdarima/arima/_context.py @@ -37,7 +37,7 @@ class AbstractContext(ABC): def __init__(self, **kwargs): # remove None valued entries, # since __getattr__ returns None if an attr is not present - self.props = {k: v for k,v in kwargs.items() if v is not None} \ + self.props = {k: v for k, v in kwargs.items() if v is not None} \ if kwargs else {} def __enter__(self): @@ -91,6 +91,7 @@ class _emptyContext(AbstractContext): def get_type(self): return ContextType.EMPTY + class ContextStore: """A class to wrap access to threading.local() context store @@ -197,7 +198,8 @@ class ContextStore: context_type = ctx.get_type() - if context_type not in _ctx.store or len(_ctx.store[context_type]) == 0: + if context_type not in _ctx.store or \ + len(_ctx.store[context_type]) == 0: return _ctx.store[context_type].pop()
resolve lint issues related to Context Manager changes
tgsmith61591_pmdarima
train
py
ad8e6c5153bde0c44722ce8dbd37187b919ac3df
diff --git a/tasks/gss_pull.js b/tasks/gss_pull.js index <HASH>..<HASH> 100644 --- a/tasks/gss_pull.js +++ b/tasks/gss_pull.js @@ -61,9 +61,12 @@ module.exports = function(grunt) { var fetch_each_sheet = function(sheet, key) { var promise = new Promise.Promise(); - var sheet_id = sheet.link[3].href.substr( - sheet.link[3].href.length - 3, 3 - ); + + // It is a bit arbitrary, but the best way to get the sheet ID, + // which is something like "od6", is to use the last item link. + var sheet_link = sheet.link[sheet.link.length - 1].href; + var sheet_id = sheet_link.substr(sheet_link.length - 3, 3); + var url = "http://spreadsheets.google.com/feeds/list/" + key + "/" + sheet_id + "/public/values?alt=json"; http.get(url, function(res) { var response_data = ''; @@ -102,7 +105,7 @@ module.exports = function(grunt) { element[ column_names[j] ] = cell.$t; } } - if(element.rowNumber === undefined) { + if(element.rowNumber === undefined) { element.rowNumber = i + 1; } elements.push(element);
A bit more flexinibility in getting the right sheet id.
motherjones_grunt-gss-pull
train
js
82adbae5189b22418556df47bf89703b848f0d03
diff --git a/src/Common/Model/Base.php b/src/Common/Model/Base.php index <HASH>..<HASH> 100644 --- a/src/Common/Model/Base.php +++ b/src/Common/Model/Base.php @@ -2087,7 +2087,8 @@ abstract class Base protected function describeFieldsPrepareLabel($sLabel) { $aPatterns = [ - '/\bid\b/i' => 'ID', + '/\bid\b/i' => 'ID', + '/\burl\b/i' => 'URL', ]; $sLabel = ucwords(preg_replace('/[\-_]/', ' ', $sLabel));
Added `URL` to the `describeFieldsPrepareLabel`method
nails_common
train
php
b52957511c71743d709e07fa31318c7e8b322ab4
diff --git a/lib/que/locker.rb b/lib/que/locker.rb index <HASH>..<HASH> 100644 --- a/lib/que/locker.rb +++ b/lib/que/locker.rb @@ -170,8 +170,7 @@ module Que ) sort_keys.each do |sort_key| - # TODO: Add a proper assertion helper. - raise unless @locks.add?(sort_key.fetch(:id)) + mark_id_as_locked(sort_key.fetch(:id)) end push_jobs(sort_keys) @@ -213,7 +212,7 @@ module Que return false if @locks.include?(id) return false unless lock_job(id) - @locks.add(id) + mark_id_as_locked(id) true end @@ -248,6 +247,12 @@ module Que ids.each { |id| @locks.delete(id) } end + def mark_id_as_locked(id) + Que.assert(@locks.add?(id)) do + "Job erroneously locked a second time: #{id}" + end + end + def wait_for_job(timeout = nil) checkout do |conn| conn.wait_for_notify(timeout) do |_, _, payload|
Use Que.assert to ensure that jobs aren't locked multiple times.
chanks_que
train
rb
ed76356a53c730a14dcfce5085ec29c346dcd70a
diff --git a/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java b/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java index <HASH>..<HASH> 100644 --- a/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java +++ b/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java @@ -270,7 +270,7 @@ public class TcpTransportFactory implements TransportFactory { } synchronized (lock) { if (connectionPool.getMaxActive() > 0) { - return connectionPool.getMaxActive() * servers.size(); + return Math.max(connectionPool.getMaxActive() * servers.size(), connectionPool.getMaxActive()); //to avoid int overflow when maxActive is very high! } else { return 10 * servers.size(); }
ISPN-<I> - RemoteCacheManager failure in multi-threaded environment with maxActive=Integer.MAX_VALUE
infinispan_infinispan
train
java
592987abce1ad8de88d8ee8f2ffd099b57538a0d
diff --git a/toh5.py b/toh5.py index <HASH>..<HASH> 100644 --- a/toh5.py +++ b/toh5.py @@ -62,10 +62,10 @@ def convert_chain( maxshape=(None,), dtype=np.float64, chunks=(chunksize,), - compression='lzf', + compression='gzip', shuffle=True) - dset.attr.create('unit', u) + dset.attrs.create('unit', u.encode('utf8')) with open(txtfile, 'r') as f: for chunk in filechunk(f, chunksize):
Change compression option to gzip (the standard). Updated attribute syntax to h5py <I>. lzf compression is better than gzip, but is h5py specific, which we really don't want.
sliem_barrett
train
py
0860da1852766f6c70e88fa6d13d889388046ae3
diff --git a/tests/jenkins.py b/tests/jenkins.py index <HASH>..<HASH> 100644 --- a/tests/jenkins.py +++ b/tests/jenkins.py @@ -75,7 +75,18 @@ def run(platform, provider, commit, clean): stream_stds=True ) proc.poll_and_read_until_finish() - proc.communicate() + stdout, stderr = proc.communicate() + if stdout: + print '--------- recorded stdout ----------' + print(stdout) + print '------------------------------------' + + if stderr: + print '--------- recorded stderr ----------' + print(stderr) + print '------------------------------------' + + if proc.returncode > 0: print('Failed to bootstrap VM. Exit code: {0}'.format(proc.returncode)) sys.stdout.flush()
Add debug print to check if communicate is doin' the right thing.
saltstack_salt
train
py
5185853791b2a69a146e427d77e2b891385adba5
diff --git a/functional_tests/test_services.py b/functional_tests/test_services.py index <HASH>..<HASH> 100644 --- a/functional_tests/test_services.py +++ b/functional_tests/test_services.py @@ -102,6 +102,16 @@ class BuzzFunctionalTest(unittest.TestCase): self.assertEquals('111062888259659218284', person['id']) self.assertEquals('http://www.google.com/profiles/googlebuzz', person['profileUrl']) + def test_can_get_user_profile_using_numeric_identifier(self): + buzz = build('buzz', 'v1') + person = buzz.people().get(userId='108242092577082601423').execute() + + self.assertTrue(person is not None) + self.assertEquals('buzz#person', person['kind']) + self.assertEquals('Test Account', person['displayName']) + self.assertEquals('108242092577082601423', person['id']) + self.assertEquals('http://www.google.com/profiles/108242092577082601423', person['profileUrl']) + def test_can_get_followees_of_user(self): buzz = build('buzz', 'v1') expected_followees = 30
Added a test for getting profiles via numeric identifiers
googleapis_oauth2client
train
py
3495fa61abea655df2392b33966d98cd314195d9
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -56,12 +56,12 @@ abstract class Kernel implements KernelInterface protected $startTime; protected $classes; - const VERSION = '2.0.19'; - const VERSION_ID = '20019'; + const VERSION = '2.0.20-DEV'; + const VERSION_ID = '20020'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '0'; - const RELEASE_VERSION = '19'; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = '20'; + const EXTRA_VERSION = 'DEV'; /** * Constructor.
bumped Symfony version to <I>-DEV
symfony_symfony
train
php
02a5416d38520e7322e337d90d1f85acc2222320
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -27,13 +27,3 @@ googleSearch(['agua', 'lluvia', 'rajoy'], {year: 2016, month: 1, date: 12}) .catch(reason => { console.log(reason) }) - - - -//elpais('2016', '01', '01', 'm') -// .then(content => { console.log(content) }) - -//elpais2('http://internacional.elpais.com/internacional/2016/01/01/actualidad/1451637621_839243.html') -// .then(content => { -//console.log(content) -// })
Enhance test script. Delete unnecesary lines
crishernandezmaps_liqen-scrapper
train
js
b3ab665dcc6f0b056b7c343524631356996528b7
diff --git a/blimpy/file_wrapper.py b/blimpy/file_wrapper.py index <HASH>..<HASH> 100644 --- a/blimpy/file_wrapper.py +++ b/blimpy/file_wrapper.py @@ -452,7 +452,7 @@ class FilReader(Reader): self.n_pols_in_file = 1 #Placeholder for future development. self._n_bytes = self.header['nbits'] / 8 #number of bytes per digit. self._d_type = self._setup_dtype() - self._get_n_ints_in_file() + self._setup_n_ints_in_file() self.file_shape = (self.n_ints_in_file,self.n_beams_in_file,self.n_channels_in_file) if self.header['foff'] < 0: @@ -515,7 +515,7 @@ class FilReader(Reader): else: raise IOError("Need a file to open, please give me one!") - def _get_n_ints_in_file(self): + def _setup_n_ints_in_file(self): n_bytes = self._n_bytes n_chans = self.n_channels_in_file
Renamed _get_n_ints_in_file to _setup_n_ints_in_file for consistency Other methods such as _setup_freqs and _setup_chans
UCBerkeleySETI_blimpy
train
py
4da9b3e090e0e590b97d2c02bac8bd3f9fefd80b
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -7,8 +7,8 @@ var net = require('net'), errors = require('./errors'), Binary = require('binary'), protocol = require('./protocol'), - Zookeeper = require('./zookeeper'); - + zk = require('./zookeeper'), + Zookeeper = zk.Zookeeper; /** * Communicates with kafka brokers * Uses zookeeper to discover all the kafka brokers to connect to
Adding highLevel Consumers and Producers
SOHU-Co_kafka-node
train
js
2c25c15c77195f456d47b2c9fa2606cad24c68a6
diff --git a/cmd/juju/cloud/updatecredential.go b/cmd/juju/cloud/updatecredential.go index <HASH>..<HASH> 100644 --- a/cmd/juju/cloud/updatecredential.go +++ b/cmd/juju/cloud/updatecredential.go @@ -19,18 +19,18 @@ var usageUpdateCredentialSummary = ` Updates a controller credential for a cloud.`[1:] var usageUpdateCredentialDetails = ` -Controller credentials are used for model operations and manipulations. +Cloud credentials for controller are used for model operations and manipulations. Since it is common to have long-running models, it is also common to -have cloud credentials become invalid during models' lifetime. -When this happens, a user must update the controller credential that -a model was created with to the new and valid details. +have these cloud credentials become invalid during models' lifetime. +When this happens, a user must update the cloud credential that +a model was created with to the new and valid details on controller. This command allows to update an existing, already-stored, named, cloud-specific controller credential. NOTE: -This is the only command that will allow you to manipulate -a controller credential. +This is the only command that will allow you to manipulate cloud +credential for a controller. All other credential related commands, such as ` + "`add-credential`" + `, ` + "`remove-credential`" + ` and ` + "`credentials`" + ` deal with credentials stored locally on the client not on the controller.
"controller credential" change to "cloud credential for controller"
juju_juju
train
go
07f5a012964f6c5462000cf6477e1d9f7e024eed
diff --git a/ssllabs-scan.go b/ssllabs-scan.go index <HASH>..<HASH> 100644 --- a/ssllabs-scan.go +++ b/ssllabs-scan.go @@ -270,7 +270,7 @@ func invokeGetRepeatedly(url string) (*http.Response, []byte, error) { resp, err := httpClient.Do(req) if err == nil { if logLevel >= LOG_DEBUG { - log.Printf("[DEBUG] Response status code (%v): %v", resp.StatusCode, reqId) + log.Printf("[DEBUG] Response status code (%v): %v", reqId, resp.StatusCode) } // Adjust maximum concurrent requests.
Fix the response status code log message.
ssllabs_ssllabs-scan
train
go
9fefe31b0df1c04b408c5e54e8b0912acb26c292
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "io/ioutil" "net/http" "os" + "path" "strings" "github.com/cheekybits/genny/parse" @@ -62,6 +63,11 @@ func main() { var outWriter io.Writer if len(*out) > 0 { + err := os.MkdirAll(path.Dir(*out), 0755) + if err != nil { + fatal(exitcodeDestFileFailed, err) + } + outFile, err := os.Create(*out) if err != nil { fatal(exitcodeDestFileFailed, err)
Adding the creation of output dirs
cheekybits_genny
train
go
6aa4782ae9205abb0e40ad80b39b29144b697fd9
diff --git a/src/main/java/org/mariadb/jdbc/internal/util/Utils.java b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/mariadb/jdbc/internal/util/Utils.java +++ b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java @@ -665,7 +665,7 @@ public class Utils { int pos = offset; int posHexa = 0; - while (pos < dataLength) { + while (pos < dataLength + offset) { int byteValue = bytes[pos] & 0xFF; outputBuilder.append(hexArray[byteValue >>> 4]) .append(hexArray[byteValue & 0x0F])
[misc] correcting debug output when having offset
MariaDB_mariadb-connector-j
train
java
bbc4c8308ffb9b8b10bc1564c58f18a1b4afbb27
diff --git a/src/Post_Command.php b/src/Post_Command.php index <HASH>..<HASH> 100644 --- a/src/Post_Command.php +++ b/src/Post_Command.php @@ -143,6 +143,10 @@ class Post_Command extends \WP_CLI\CommandWithDBObject { * # Create post with content from given file * $ wp post create ./post-content.txt --post_category=201,345 --post_title='Post from file' * Success: Created post 1922. + * + * # Create a post with multiple meta values. + * $ wp post create --post_title='A post' --post_content='Just a small post.' --meta_input='{"key1":"value1","key2":"value2"} + * Success: Created post 1923. */ public function create( $args, $assoc_args ) { if ( ! empty( $args[0] ) ) { @@ -271,6 +275,10 @@ class Post_Command extends \WP_CLI\CommandWithDBObject { * * $ wp post update 123 --post_name=something --post_status=draft * Success: Updated post 123. + * + * # Update a post with multiple meta values. + * $ wp post update 123 --meta_input='{"key1":"value1","key2":"value2"} + * Success: Updated post 123. */ public function update( $args, $assoc_args ) {
Add examples to dcoblocks.
wp-cli_entity-command
train
php
6697db58f01501c885f89c41cf3747754f3fc628
diff --git a/bin/LifeCyclePlots.py b/bin/LifeCyclePlots.py index <HASH>..<HASH> 100755 --- a/bin/LifeCyclePlots.py +++ b/bin/LifeCyclePlots.py @@ -11,12 +11,13 @@ def get_command_line_options(executable_name, arguments): parser = OptionParser(usage="%s options" % executable_name) parser.add_option("-i", "--in", type="string", dest="input", help="Input DB File") parser.add_option("-o", "--out", type="string", dest="output", help="Output Root File") + parser.add_option("-p", "--print", type="string", dest="print_format", help="Print histograms in format") (options, args) = parser.parse_args() - if not (options.input and options.output): + if not options.input: parser.print_help() - parser.error("You need to provide following options, --in=input.sql, --out=plot.root") + parser.error("You need to provide following options, --in=input.sql (mandatory), --out=plot.root (optional), --print <format> (optional)") return options @@ -106,4 +107,6 @@ if __name__ == "__main__": histo_manager.update_histos(row) histo_manager.draw_histos() - histo_manager.save_histos_as(format="png") + + if options.print_format: + histo_manager.save_histos_as(format=options.print_format)
Added print options and remove root file from mandatory options.
dmwm_DBS
train
py
6f1baea61633bfedbee61d737621463a42429a73
diff --git a/test/pbt_test.rb b/test/pbt_test.rb index <HASH>..<HASH> 100644 --- a/test/pbt_test.rb +++ b/test/pbt_test.rb @@ -112,6 +112,12 @@ class PbtTest < ActiveSupport::TestCase bob_to_prof.must_respond_to(:last ) bob_to_prof.must_be_kind_of(ActiveRecord::Associations::CollectionProxy) end + + it "AsCollectionProxy returns empty FakedCollection when handed unrelated instances" do + fc = PolyBelongsTo::Pbt::AsCollectionProxy[Alpha.new, Capa] + fc.must_be_kind_of(PolyBelongsTo::FakedCollection) + fc.must_be :empty? + end end end
Additional test for FakedCollection.
danielpclark_PolyBelongsTo
train
rb
3d6ee5520d0d75d57164e5371e4e6d8493eac220
diff --git a/libstempo/toasim.py b/libstempo/toasim.py index <HASH>..<HASH> 100644 --- a/libstempo/toasim.py +++ b/libstempo/toasim.py @@ -359,7 +359,7 @@ def add_line(psr,f,A,offset=0.5): psr.stoas[:] += sine / day -def add_glitch(psr, epoch, amplitude): +def add_glitch(psr, epoch, amp): """ Like pulsar term BWM event, but now differently parameterized: just an amplitude (not log-amp) parameter, and an epoch. [source: piccard]
adding glitch signal to toasim
vallis_libstempo
train
py
1925f40f31c2e60dcfdb15d6ccd786c2685420d3
diff --git a/tests/regressors.py b/tests/regressors.py index <HASH>..<HASH> 100644 --- a/tests/regressors.py +++ b/tests/regressors.py @@ -72,6 +72,8 @@ def categorical_ensembling_regression(model_name=None): lower_bound = -16 if model_name == 'LGBMRegressor': lower_bound = -4.95 + if model_name == 'GradientBoostingRegressor': + lower_bound = -4.2 assert lower_bound < test_score < -2.8 @@ -227,6 +229,8 @@ def feature_learning_getting_single_predictions_regression(model_name=None): lower_bound = -4.95 if model_name == 'XGBRegressor': lower_bound = -3.3 + if model_name == 'GradientBoostingRegressor': + lower_bound = -3.75 assert lower_bound < first_score < -2.8
adjusts test bounds for gradientboosting for higher learning rate
ClimbsRocks_auto_ml
train
py
7ae7efeb115ad1062d90789045b0d141406b95a7
diff --git a/client/fingerprint/memory.go b/client/fingerprint/memory.go index <HASH>..<HASH> 100644 --- a/client/fingerprint/memory.go +++ b/client/fingerprint/memory.go @@ -35,7 +35,7 @@ func (f *MemoryFingerprint) Fingerprint(cfg *config.Config, node *structs.Node) if node.Resources == nil { node.Resources = &structs.Resources{} } - node.Resources.MemoryMB = int(memInfo.Total) + node.Resources.MemoryMB = int(memInfo.Total / 1024 / 1024) } return true, nil diff --git a/client/fingerprint/memory_test.go b/client/fingerprint/memory_test.go index <HASH>..<HASH> 100644 --- a/client/fingerprint/memory_test.go +++ b/client/fingerprint/memory_test.go @@ -20,8 +20,10 @@ func TestMemoryFingerprint(t *testing.T) { t.Fatalf("should apply") } - if node.Attributes["memory.totalbytes"] == "" { - t.Fatalf("Missing memory.totalbyes") + assertNodeAttributeContains(t, node, "memory.totalbytes") + + if node.Resources == nil { + t.Fatalf("Node Resources was nil") } }
convert to MB for MemoryMB, and update test
hashicorp_nomad
train
go,go
58bb75d7d47922eb57b81350abecd33be3c36b17
diff --git a/app/assets/javascripts/peoplefinder/photo_upload.js b/app/assets/javascripts/peoplefinder/photo_upload.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/peoplefinder/photo_upload.js +++ b/app/assets/javascripts/peoplefinder/photo_upload.js @@ -239,5 +239,19 @@ $(function (){ var photoBlocks = $('.person-photo'); if(photoBlocks.length > 0){ _.each(photoBlocks, PhotoUpload.enhance); + + var saveBtn = $('.save-cancel-actions input[name="commit"]'), + cropButton = PhotoUpload.findElements(photoBlocks).$cropButton, + editForm = $('form.edit_person'); + + saveBtn.click(function(e){ + e.preventDefault(); + if(cropButton.is(':visible')){ + cropButton.trigger('click'); + editForm.submit(); + } else { + editForm.submit(); + } + }); } });
crop image on save if not already
ministryofjustice_peoplefinder
train
js
61f89035b22e465d120b1fb41bb8cd7b97b2f8b2
diff --git a/base.php b/base.php index <HASH>..<HASH> 100644 --- a/base.php +++ b/base.php @@ -1487,7 +1487,9 @@ class Base extends Prefab implements ArrayAccess { $val=ltrim($val); if (preg_match('/^\w+$/i',$val) && defined($val)) return constant($val); - return preg_replace('/\\\\\h*(\r?\n)/','\1',$val); + return preg_replace( + array('/\\\\"/','/\\\\\h*(\r?\n)/'), + array('"','\1'),$val); }, // Mark quoted strings with 0x00 whitespace str_getcsv(preg_replace('/(?<!\\\\)(")(.*?)\1/',
Bug fix: Double quotes in lexicon files (Issue #<I>)
bcosca_fatfree-core
train
php
c62be86fbde0624a05c5716ed9512449ee863dba
diff --git a/src/Elfiggo/Brobdingnagian/Detector/NumberOfInterfaces.php b/src/Elfiggo/Brobdingnagian/Detector/NumberOfInterfaces.php index <HASH>..<HASH> 100644 --- a/src/Elfiggo/Brobdingnagian/Detector/NumberOfInterfaces.php +++ b/src/Elfiggo/Brobdingnagian/Detector/NumberOfInterfaces.php @@ -6,12 +6,27 @@ use Elfiggo\Brobdingnagian\Param\Params; use Elfiggo\Brobdingnagian\Report\Reporter; use ReflectionClass; +/** + * Class NumberOfInterfaces + * @package Elfiggo\Brobdingnagian\Detector + */ class NumberOfInterfaces implements Detection { + + /** + * @param ReflectionClass $sus + * @param Params $param + * @param Reporter $reporter + */ public function check(ReflectionClass $sus, Params $param, Reporter $reporter) { if (count($sus->getInterfaces()) > $param->getNumberOfInterfaces()) { - $reporter->act($sus, self::class, "{$sus->getName()} has too many interfaces (" . count($sus->getInterfaces()) .')', 'Too many interfaces'); + $reporter->act( + $sus, + self::class, + "{$sus->getName()} has too many interfaces (" . count($sus->getInterfaces()) .')', + 'Too many interfaces' + ); } } }
Added Class docbloc and reduced line length
Elfiggo_brobdingnagian-detector-phpspec-extension
train
php
7a863e6cc82aa7e31ffdd87bc5835f54644ebdcd
diff --git a/lib/transports/websocket.js b/lib/transports/websocket.js index <HASH>..<HASH> 100644 --- a/lib/transports/websocket.js +++ b/lib/transports/websocket.js @@ -51,9 +51,17 @@ */ WS.prototype.open = function () { - var Socket = 'MozWebSocket' in window ? MozWebSocket : WebSocket - , query = io.util.query(this.socket.options.query) - , self = this; + var query = io.util.query(this.socket.options.query) + , self = this + , Socket + + // if node + Socket = require('websocket-client').WebSocket; + // end node + + if (!Socket) { + Socket = window.MozWebSocket || window.WebSocket; + } this.websocket = new Socket(this.prepareUrl() + query); @@ -143,6 +151,9 @@ */ WS.check = function () { + // if node + return true; + // end node return ('WebSocket' in window && !('__addTask' in WebSocket)) || 'MozWebSocket' in window; };
Fixed support for Node.JS running `socket.io-client`.
tsjing_socket.io-client
train
js
8234938a0d5ba13ac18ee483e4744792b37298e1
diff --git a/plugins/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/util/TypeConformanceComputer.java b/plugins/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/util/TypeConformanceComputer.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/util/TypeConformanceComputer.java +++ b/plugins/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/util/TypeConformanceComputer.java @@ -310,17 +310,10 @@ public class TypeConformanceComputer { protected boolean areArgumentsAssignableFrom(JvmParameterizedTypeReference left, JvmParameterizedTypeReference right) { // raw type - if (left.getArguments().size() == 0) { + if (left.getArguments().size() == 0 || right.getArguments().size() == 0) { return true; } if (left.getArguments().size() != right.getArguments().size()) { - if (right.getArguments().size() == 0) { - for(JvmTypeReference argument: left.getArguments()) { - if (!isUnconstrainedWildcard(argument)) - return false; - } - return true; - } return false; }
[common.types] Reverted changes in type conformance computer that broke raw type processing.
eclipse_xtext-extras
train
java
a25e380cb40ea6a994fa3d22912c935d01ba5c4a
diff --git a/classes/Pods.php b/classes/Pods.php index <HASH>..<HASH> 100644 --- a/classes/Pods.php +++ b/classes/Pods.php @@ -4182,7 +4182,7 @@ class Pods implements Iterator { && pods_shortcode_allow_evaluate_tags() && ! $this->fields( $field_name ) ) { - $value = pods_evaluate_tag( implode( ',', $tag ), true ); + $value = pods_evaluate_tag( implode( ',', $tag ) ); } if ( isset( $tag[2] ) && ! empty( $tag[2] ) ) {
Do not sanitize, this method is used for display
pods-framework_pods
train
php
5aba51273b446299bfce5bf8b3a6aef32d2bf515
diff --git a/devices/tuya.js b/devices/tuya.js index <HASH>..<HASH> 100644 --- a/devices/tuya.js +++ b/devices/tuya.js @@ -1687,6 +1687,7 @@ module.exports = [ {modelID: 'TS0601', manufacturerName: '_TZE200_tvrvdj6o'}, {modelID: 'zo2pocs\u0000', manufacturerName: '_TYST11_fzo2pocs'}, {modelID: 'TS0601', manufacturerName: '_TZE200_cf1sl3tj'}, + {modelID: 'TS0601', manufacturerName: '_TZE200_b2u1drdv'}, // Roller blinds: {modelID: 'TS0601', manufacturerName: '_TZE200_fctwhugx'}, {modelID: 'TS0601', manufacturerName: '_TZE200_zah67ekd'},
Add TZE<I>_b2u1drdv to TS<I>_cover (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
f487e0ea6bfff68d6ede64e2f58caed58296f285
diff --git a/influxdb/client.py b/influxdb/client.py index <HASH>..<HASH> 100755 --- a/influxdb/client.py +++ b/influxdb/client.py @@ -362,13 +362,13 @@ class InfluxDBClient(object): rsp = self.query("SHOW SERIES", database=database) print "RSP", rsp.raw print "RSP", rsp['results'] - return rsp + return list(rsp) def get_list_users(self): """ Get the list of users """ - return self.query("SHOW USERS") + return list(self.query("SHOW USERS")) def delete_series(self, name, database=None): database = database or self._database
Proposed Fix: expand the ResultSet response by using list() on it. Other solution is to return the ResultSet instance but then we must adapt all call sites.. To be decided..
influxdata_influxdb-python
train
py
cb9d276980d5df7a1f31c0b5a7644c863caef81e
diff --git a/hazelcast/src/main/java/com/hazelcast/replicatedmap/impl/ReplicatedMapService.java b/hazelcast/src/main/java/com/hazelcast/replicatedmap/impl/ReplicatedMapService.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/replicatedmap/impl/ReplicatedMapService.java +++ b/hazelcast/src/main/java/com/hazelcast/replicatedmap/impl/ReplicatedMapService.java @@ -84,9 +84,7 @@ public class ReplicatedMapService @Override public void reset() { - for (ReplicatedRecordStore replicatedRecordStore : replicatedStorages.values()) { - replicatedRecordStore.clear(false, true); - } + // Nothing to do, it is ok for a ReplicatedMap to keep its current state on rejoins } @Override
Fixed losing ReplicatedMap internal state on re-joining a cluster
hazelcast_hazelcast
train
java
3255c9edf0deb5275b8f316b1daeae21d390adde
diff --git a/lib/webrat/core/matchers/have_xpath.rb b/lib/webrat/core/matchers/have_xpath.rb index <HASH>..<HASH> 100644 --- a/lib/webrat/core/matchers/have_xpath.rb +++ b/lib/webrat/core/matchers/have_xpath.rb @@ -15,7 +15,7 @@ module Webrat matched = matches(stringlike) if @options[:count] - matched.size == @options[:count] && (!@block || @block.call(matched)) + matched.size == @options[:count].to_i && (!@block || @block.call(matched)) else matched.any? && (!@block || @block.call(matched)) end diff --git a/spec/public/matchers/have_selector_spec.rb b/spec/public/matchers/have_selector_spec.rb index <HASH>..<HASH> 100644 --- a/spec/public/matchers/have_selector_spec.rb +++ b/spec/public/matchers/have_selector_spec.rb @@ -61,6 +61,10 @@ describe "have_selector" do @body.should have_selector("li", :count => 4) }.should raise_error(Spec::Expectations::ExpectationNotMetError) end + + it "should convert a string to an integer for count" do + @body.should have_selector("li", :count => "3") + end end describe "specifying nested elements" do
Forces an integer to fix Issue #<I>
brynary_webrat
train
rb,rb
0ce2f0081504576669d49a4de88974fbe95efce2
diff --git a/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java b/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java index <HASH>..<HASH> 100644 --- a/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java +++ b/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java @@ -181,6 +181,7 @@ public class PackageMojo extends AbstractGemMojo { this.factory.newScriptFromJRubyJar("gem") .addArg("build", this.gemspec) .addArg("--backtrace") + .addArg("--verbose") .executeIn(launchDirectory()); File newPom = new File( this.gemspec.getParentFile(), "pom." + this.gemspec.getName() + ".xml"); @@ -391,6 +392,7 @@ public class PackageMojo extends AbstractGemMojo { this.factory.newScriptFromJRubyJar("gem") .addArg("build", gemSpec) .addArg("--backtrace") + .addArg("--verbose") .executeIn(gemDir); if ((!localGemspec.exists() || !FileUtils.contentEquals(localGemspec,
Pass verbose flag to rubygems command launching It makes it much easier to troubleshoot errors.
torquebox_jruby-maven-plugins
train
java
ee79e260b61723597fc653fb46ef0c96f6915393
diff --git a/tests/test_case.py b/tests/test_case.py index <HASH>..<HASH> 100644 --- a/tests/test_case.py +++ b/tests/test_case.py @@ -5,6 +5,7 @@ import numpy as np from andes.utils.paths import get_case +andes.main.config_logger(stream_level=10) class Test5Bus(unittest.TestCase): def setUp(self) -> None:
Output logs for debugging.
cuihantao_andes
train
py