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
aab2450e25b397d38cdcb5e173ef1121283196c2
diff --git a/daemon/graphdriver/devmapper/deviceset.go b/daemon/graphdriver/devmapper/deviceset.go index <HASH>..<HASH> 100644 --- a/daemon/graphdriver/devmapper/deviceset.go +++ b/daemon/graphdriver/devmapper/deviceset.go @@ -1479,12 +1479,9 @@ func (devices *DeviceSet) closeTransaction() error { } func determineDriverCapabilities(version string) error { - /* - * Driver version 4.27.0 and greater support deferred activation - * feature. - */ + // Kernel driver version >= 4.27.0 support deferred removal - logrus.Debugf("devicemapper: driver version is %s", version) + logrus.Debugf("devicemapper: kernel dm driver version is %s", version) versionSplit := strings.Split(version, ".") major, err := strconv.Atoi(versionSplit[0])
graphdriver/devmapper: clarify a message Make sure user understands this is about the in-kernel driver (not the dockerd driver or smth). While at it, amend the comment as well.
moby_moby
train
go
c98f1b4ba903c14fce25b377b81951b40f3bbc6c
diff --git a/zimsoap/zobjects.py b/zimsoap/zobjects.py index <HASH>..<HASH> 100644 --- a/zimsoap/zobjects.py +++ b/zimsoap/zobjects.py @@ -301,8 +301,13 @@ class Signature(ZObject): """ o = super(Signature, cls).from_dict(d) if d.has_key('content'): - o._content = d['content']['_content'] - o._contenttype = d['content']['type'] + # Sometimes, several contents, (one txt, other html), take last + try: + o._content = d['content']['_content'] + o._contenttype = d['content']['type'] + except TypeError: + o._content = d['content'][-1]['_content'] + o._contenttype = d['content'][-1]['type'] return o
handle several content in signatures fixes #<I> @0h<I>
oasiswork_zimsoap
train
py
2c0bb0c286b33f5282f98672fc67cfa034091ada
diff --git a/Kwf/Model/Abstract.php b/Kwf/Model/Abstract.php index <HASH>..<HASH> 100644 --- a/Kwf/Model/Abstract.php +++ b/Kwf/Model/Abstract.php @@ -875,6 +875,8 @@ abstract class Kwf_Model_Abstract implements Kwf_Model_Interface return (!$value || $rowValue >= $value); } else if ($expr instanceof Kwf_Model_Select_Expr_Equal) { return ($rowValue == $value); + } else if ($expr instanceof Kwf_Model_Select_Expr_NotEquals) { + return ($rowValue != $value); } else if ($expr instanceof Kwf_Model_Select_Expr_LowerEqual) { return (!$value || $rowValue <= $value); } else {
added check for Kwf_Model_Select_Expr_NotEquals to Kwf_Model_Select_Expr_CompareField_Abstract
koala-framework_koala-framework
train
php
84f3502d2029391ffc473a05e38fe644da921ce7
diff --git a/core/kernel/persistence/smoothsql/class.Resource.php b/core/kernel/persistence/smoothsql/class.Resource.php index <HASH>..<HASH> 100644 --- a/core/kernel/persistence/smoothsql/class.Resource.php +++ b/core/kernel/persistence/smoothsql/class.Resource.php @@ -659,9 +659,11 @@ class core_kernel_persistence_smoothsql_Resource implements core_kernel_persiste $normalizedValues[] = $value->getUri(); } elseif (is_array($value)) { foreach ($value as $val) { - $normalizedValues[] = $val instanceof core_kernel_classes_Resource - ? $val->getUri() - : $val; + if ($val !== null) { + $normalizedValues[] = $val instanceof core_kernel_classes_Resource + ? $val->getUri() + : $val; + } } } else { $normalizedValues[] = ($value == null) ? '' : $value;
Fixed Uncaught TypeError: Argument 4 passed to core_kernel_classes_Triple::createTriple() must be of the type string, null given
oat-sa_generis
train
php
76dc2c1e8f2f6296737c043bf4dcbedf23ba2117
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,7 +40,7 @@ sys.path.insert(0, os.path.abspath('..')) # -- Project information ----------------------------------------------------- project = 'JAX' -copyright = '2019, Google LLC. NumPy and SciPy documentation are copyright the respective authors.' +copyright = '2020, Google LLC. NumPy and SciPy documentation are copyright the respective authors.' author = 'The JAX authors' # The short X.Y version
DOC: update webpage copyright year to <I>
tensorflow_probability
train
py
5b1a9fd883df211ad2a97fb8b924c6d4b3fa6a5e
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -665,7 +665,7 @@ var msbuildDefaults = { stdout: process.stdout, stderr: process.stderr, maxBuffer: MAX_BUFFER, - verbosity: 'normal', + verbosity: 'diag', errorOnFail: true, toolsVersion: msBuildToolsVersion };
turning on diag verbosity in msbuild.
Azure_autorest
train
js
141c8151cbd6171363183cdcf43942e736b2839a
diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/AppiumFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/AppiumFactory.php index <HASH>..<HASH> 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/AppiumFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/AppiumFactory.php @@ -24,8 +24,8 @@ class AppiumFactory extends Selenium2Factory ->children() ->scalarNode('browser')->defaultValue('remote')->end() ->append($this->getCapabilitiesNode()) - ->scalarNode('appium_host')->defaultValue(getenv('APPIUM_HOST'))->end() - ->scalarNode('appium_port')->defaultValue(getenv('APPIUM_PORT'))->end() + ->scalarNode('appium_host')->defaultValue('0.0.0.0')->end() + ->scalarNode('appium_port')->defaultValue('4723')->end() ->end() ; }
Removed ENV variables and added Appium default server and port
Behat_MinkExtension
train
php
da1b1710cae205665f5355d74329a625abf10591
diff --git a/lib/nrser/refinements/hash.rb b/lib/nrser/refinements/hash.rb index <HASH>..<HASH> 100644 --- a/lib/nrser/refinements/hash.rb +++ b/lib/nrser/refinements/hash.rb @@ -14,5 +14,9 @@ module NRSER end alias_method :omit, :except + + def leaves + NRSER.leaves self + end # #leaves end # Hash end # NRSER \ No newline at end of file
add NRSER.leaves to Hash refeinement
nrser_nrser.rb
train
rb
ffd45ec41729f30c132282920958221b1a8297de
diff --git a/src/org/opencms/main/CmsContextInfo.java b/src/org/opencms/main/CmsContextInfo.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/main/CmsContextInfo.java +++ b/src/org/opencms/main/CmsContextInfo.java @@ -123,7 +123,7 @@ public class CmsContextInfo { setProjectName(CmsProject.ONLINE_PROJECT_NAME); setRequestedUri("/"); setSiteRoot("/"); - setRequestMatcher(OpenCms.getSiteManager().getWorkplaceSiteMatcher()); + setRequestMatcher(CmsSiteMatcher.DEFAULT_MATCHER); setLocaleName(CmsLocaleManager.getDefaultLocale().toString()); setEncoding(OpenCms.getSystemInfo().getDefaultEncoding()); setRemoteAddr(CmsContextInfo.LOCALHOST);
Fixing issue where sitemanager was accessed before being initialized.
alkacon_opencms-core
train
java
104a02b093940c99d310cd1f4b960ea5bc24a361
diff --git a/pyemma/msm/analysis/dense/pcca.py b/pyemma/msm/analysis/dense/pcca.py index <HASH>..<HASH> 100644 --- a/pyemma/msm/analysis/dense/pcca.py +++ b/pyemma/msm/analysis/dense/pcca.py @@ -566,6 +566,6 @@ class PCCA: """ res = [] assignment = self.metastable_assignment - for i in self.m: + for i in range(self.m): res.append(np.where(assignment == i)[0]) return res \ No newline at end of file
[msm.analysis.dense.pcca]: corrected iteration
markovmodel_PyEMMA
train
py
0fd3f42f71c19ae75348425686a2fe68ffe04fec
diff --git a/notifications/apps.py b/notifications/apps.py index <HASH>..<HASH> 100644 --- a/notifications/apps.py +++ b/notifications/apps.py @@ -5,6 +5,7 @@ from django.apps import AppConfig class Config(AppConfig): name = "notifications" + default_auto_field = 'django.db.models.AutoField' def ready(self): super(Config, self).ready()
Added default auto field in application config
django-notifications_django-notifications
train
py
9bdf1ed585b885132ece112c63d5ad6d28da294e
diff --git a/lib/fog/storage/rackspace.rb b/lib/fog/storage/rackspace.rb index <HASH>..<HASH> 100644 --- a/lib/fog/storage/rackspace.rb +++ b/lib/fog/storage/rackspace.rb @@ -42,14 +42,14 @@ module Fog if data.is_a?(String) metadata[:body] = data - metadata[:headers]['Content-Length'] = metadata[:body].size.to_s + metadata[:headers]['Content-Length'] = metadata[:body].size else filename = ::File.basename(data.path) unless (mime_types = MIME::Types.of(filename)).empty? metadata[:headers]['Content-Type'] = mime_types.first.content_type end - metadata[:body] = data.read - metadata[:headers]['Content-Length'] = ::File.size(data.path).to_s + metadata[:body] = data + metadata[:headers]['Content-Length'] = ::File.size(data.path) end # metadata[:headers]['Content-MD5'] = Base64.encode64(Digest::MD5.digest(metadata[:body])).strip metadata
[storage|rackspace] fix streaming bug. Bug was causing whole file to load to memory before upload thanks meskyanichi
fog_fog
train
rb
a04a4adb7eb0ae989f34d6363238dc809f0209bb
diff --git a/src/geo/ui/widgets/category/model.js b/src/geo/ui/widgets/category/model.js index <HASH>..<HASH> 100644 --- a/src/geo/ui/widgets/category/model.js +++ b/src/geo/ui/widgets/category/model.js @@ -85,7 +85,9 @@ module.exports = WidgetModel.extend({ applyCategoryColors: function() { this.set('categoryColors', true); - this.trigger('applyCategoryColors', this); + this.trigger('applyCategoryColors', this._data.map(function(m){ + return [ m.get('name'), m.get('color') ]; + }), this); }, cancelCategoryColors: function() {
When category colors are applied, trigger that change with categories + colors data
CartoDB_carto.js
train
js
378e54638d84a9020094e1ce1f78891cc9faa891
diff --git a/salt/grains/core.py b/salt/grains/core.py index <HASH>..<HASH> 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -970,7 +970,7 @@ def id_(): ''' return {'id': __opts__.get('id', '')} -_REPLACE_LINUX_RE = re.compile(r'linux', re.IGNORECASE) +_REPLACE_LINUX_RE = re.compile(r'\Wlinux', re.IGNORECASE) # This maps (at most) the first ten characters (no spaces, lowercased) of # 'osfullname' to the 'os' grain that Salt traditionally uses.
Only remove the word linux from distroname when its not part of the name This will now still replace "CentOS Linux" with "CentOS" while leaving "CloudLinux" unmodified. Fixes #<I>
saltstack_salt
train
py
bd5d4e953d1845afbeea88f1218027c45dd89333
diff --git a/form_error_reporting.py b/form_error_reporting.py index <HASH>..<HASH> 100644 --- a/form_error_reporting.py +++ b/form_error_reporting.py @@ -183,7 +183,8 @@ class GARequestErrorReportingMixin(GAErrorReportingMixin): request = self.get_ga_request() if not request: return query_dict - user_ip = request.META.get('REMOTE_ADDR') + user_ip = request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR', '')) + user_ip = user_ip.split(',')[0].strip() user_agent = request.META.get('HTTP_USER_AGENT') if user_ip: query_dict['uip'] = user_ip
Respect forwarded header when reporting user’s IP address
ministryofjustice_django-form-error-reporting
train
py
e08cc98f42b163dad8c6d292c3271154f135f67f
diff --git a/app/interactors/pavlov/interactor.rb b/app/interactors/pavlov/interactor.rb index <HASH>..<HASH> 100644 --- a/app/interactors/pavlov/interactor.rb +++ b/app/interactors/pavlov/interactor.rb @@ -1,4 +1,5 @@ require 'active_support/concern' +require 'active_support/inflector' module Pavlov module Interactor diff --git a/app/interactors/pavlov/operation.rb b/app/interactors/pavlov/operation.rb index <HASH>..<HASH> 100644 --- a/app/interactors/pavlov/operation.rb +++ b/app/interactors/pavlov/operation.rb @@ -9,7 +9,7 @@ module Pavlov end def raise_unauthorized - raise CanCan::AccessDenied + raise CanCan::AccessDenied, 'Unauthorized' end def check_authority
Bugfix, boyscout Added a require so tests can be run standalone Raise now with message, so it doesn't use the Class as message
Factlink_pavlov
train
rb,rb
bfdb7c39fc992b86f4ffe183e3100996f1e8cef1
diff --git a/start.py b/start.py index <HASH>..<HASH> 100755 --- a/start.py +++ b/start.py @@ -29,7 +29,7 @@ def main(): else: python_plugin_version = get_version() getgauge_version = version.LooseVersion(pkg_resources.get_distribution('getgauge').version) - if list(map(int, python_plugin_version.split(".")[0:2])) != getgauge_version.version[0:2]: + if (list(map(int, python_plugin_version.split(".")[0:3])) != getgauge_version.version[0:3]) or ('dev' in getgauge_version.version and 'nightly' not in python_plugin_version) or ('dev' not in getgauge_version.version and 'nightly' in python_plugin_version): show_error_exit(python_plugin_version, getgauge_version) if 'dev' in getgauge_version.version and 'nightly' in python_plugin_version: python_plugin_version.replace("-","")
Fixing getgauge and python version mismatch
getgauge_gauge-python
train
py
cb19ba547c51c542cf6244d3719a81d273d97982
diff --git a/lib/faker/internet.rb b/lib/faker/internet.rb index <HASH>..<HASH> 100644 --- a/lib/faker/internet.rb +++ b/lib/faker/internet.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 module Faker class Internet < Base class << self
Kill complaints about the utf characters in the file
stympy_faker
train
rb
21d36848a3c0fde18fc1ebcded62118521206c5b
diff --git a/flask_unchained/bundles/sqlalchemy/extensions/migrate.py b/flask_unchained/bundles/sqlalchemy/extensions/migrate.py index <HASH>..<HASH> 100644 --- a/flask_unchained/bundles/sqlalchemy/extensions/migrate.py +++ b/flask_unchained/bundles/sqlalchemy/extensions/migrate.py @@ -13,7 +13,7 @@ class Migrate(BaseMigrate): @unchained.inject('db') def init_app(self, app: FlaskUnchained, db=injectable): - alembic_config = app.config.get('ALEMBIC', {}) + alembic_config = app.config.setdefault('ALEMBIC', {}) alembic_config.setdefault('script_location', 'db/migrations') self.configure(Migrate.configure_alembic_template_directory)
make default setting of the alembic migrations folder to be accessible from current_app
briancappello_flask-unchained
train
py
8b3c7a2a5559430484980626ece4917fc395f70a
diff --git a/tests/runners/browser_test_runner_tests.js b/tests/runners/browser_test_runner_tests.js index <HASH>..<HASH> 100644 --- a/tests/runners/browser_test_runner_tests.js +++ b/tests/runners/browser_test_runner_tests.js @@ -300,7 +300,7 @@ describe('browser test runner', function() { it('allows to cancel the timeout', function(done) { launcher.settings.exe = 'node'; - launcher.settings.args = [path.join(__dirname, 'fixtures/processes/just-running.js')]; + launcher.settings.args = [path.join(__dirname, '../fixtures/processes/just-running.js')]; runner.start(function() { expect(reporter.results.length).to.eq(0); done(); diff --git a/tests/utils/reporter_tests.js b/tests/utils/reporter_tests.js index <HASH>..<HASH> 100644 --- a/tests/utils/reporter_tests.js +++ b/tests/utils/reporter_tests.js @@ -68,7 +68,9 @@ describe('Reporter', function() { sinon.match.any, sinon.match.any); - fs.unlinkSync('report.xml'); + return reporter.close().then(function() { + fs.unlinkSync('report.xml'); + }); }); });
Fix flaky tests Fix wrong fixture path causing a different stderr on slow environments. Ensure report file is closed before trying to remove it.
testem_testem
train
js,js
305e5909e17686533e1f6cf45f79cfe0174fb855
diff --git a/bundles/as2/lib/sprout/tasks/mtasc_task.rb b/bundles/as2/lib/sprout/tasks/mtasc_task.rb index <HASH>..<HASH> 100644 --- a/bundles/as2/lib/sprout/tasks/mtasc_task.rb +++ b/bundles/as2/lib/sprout/tasks/mtasc_task.rb @@ -155,6 +155,7 @@ EOF end add_param(:pack, :paths) do |p| + p.delimiter = ' ' p.description = "Compile all the files contained in specified package - not recursively (eg to compile files in c:\flash\code\my\app do mtasc -cp c:\flash\code -pack my/app)." end
Fixed pack delimiter for MTASCTask
lukebayes_project-sprouts
train
rb
81ae7a0c2a2afdca32bbb6a15c84106b2ced9b6b
diff --git a/src/PokeApi.php b/src/PokeApi.php index <HASH>..<HASH> 100644 --- a/src/PokeApi.php +++ b/src/PokeApi.php @@ -27,6 +27,13 @@ class PokeApi return $this->sendRequest($url); } + + public function berryFlavor($lookUp) + { + $url = $this->baseUrl.'berry-flavor/'.$lookUp; + + return $this->sendRequest($url); + } public function sendRequest($url) {
Update PokeApi.php
danrovito_pokephp
train
php
3c70969ac601da70ccec50304a1228b622f38879
diff --git a/tests/Mongolid/Serializer/Type/ObjectIDTest.php b/tests/Mongolid/Serializer/Type/ObjectIDTest.php index <HASH>..<HASH> 100644 --- a/tests/Mongolid/Serializer/Type/ObjectIDTest.php +++ b/tests/Mongolid/Serializer/Type/ObjectIDTest.php @@ -25,6 +25,7 @@ class ObjectIDTest extends TestCase */ public function setUp() { + parent::setUp(); $this->mongoId = new MongoObjectID($this->stringId); } diff --git a/tests/Mongolid/Serializer/Type/UTCDatetimeTest.php b/tests/Mongolid/Serializer/Type/UTCDatetimeTest.php index <HASH>..<HASH> 100644 --- a/tests/Mongolid/Serializer/Type/UTCDatetimeTest.php +++ b/tests/Mongolid/Serializer/Type/UTCDatetimeTest.php @@ -26,6 +26,7 @@ class UTCDateTimeTest extends TestCase */ public function setUp() { + parent::setUp(); $now = DateTime::createFromFormat('Y-m-d H:i:s', $this->formatedDate); $this->mongoDate = new MongoUTCDateTime($now->getTimestamp()*1000); }
Added missing parent::setUp calls
leroy-merlin-br_mongolid
train
php,php
9655c257d4cce33a304f0e169fc44fd9185a88f7
diff --git a/src/main/java/com/corundumstudio/socketio/protocol/Event.java b/src/main/java/com/corundumstudio/socketio/protocol/Event.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/corundumstudio/socketio/protocol/Event.java +++ b/src/main/java/com/corundumstudio/socketio/protocol/Event.java @@ -17,7 +17,7 @@ package com.corundumstudio.socketio.protocol; import java.util.List; -class Event { +public class Event { private String name; private List<Object> args;
Make "Event" class publish In order to create custom serialization code (using `JsonSupport`) I need to be able to create `Event` classes
mrniko_netty-socketio
train
java
f050434b23dc1f0f84506e3347610c96ead401c7
diff --git a/test/pem.js b/test/pem.js index <HASH>..<HASH> 100644 --- a/test/pem.js +++ b/test/pem.js @@ -15,7 +15,7 @@ suite( 'JSON Web Key', function() { } }) - test( 'parse a PEM encoded public key', function() { + test( 'parse a PEM encoded RSA public key', function() { var key = JSONWebKey.fromPEM( keys.rsa.public ) assert.deepEqual( key, JSONWebKey.fromJSON({ kty: 'RSA', @@ -24,7 +24,7 @@ suite( 'JSON Web Key', function() { })) }) - test( 'parse a PEM encoded private key', function() { + test( 'parse a PEM encoded RSA private key', function() { var key = JSONWebKey.fromPEM( keys.rsa.private ) assert.deepEqual( key, JSONWebKey.fromJSON({ kty: 'RSA',
Update test/pem: Enhance wording
jhermsmeier_node-json-web-key
train
js
182ace99a79a6a4704779b7bdcdd12bccf1b2b76
diff --git a/docs/src/modules/utils/generateMarkdown.js b/docs/src/modules/utils/generateMarkdown.js index <HASH>..<HASH> 100644 --- a/docs/src/modules/utils/generateMarkdown.js +++ b/docs/src/modules/utils/generateMarkdown.js @@ -366,7 +366,7 @@ ${pagesMarkdown } function generateImportStatement(reactAPI) { - const source = reactAPI.filename + const source = normalizePath(reactAPI.filename) // determine the published package name .replace( /\/packages\/material-ui(-(.+?))?\/src/,
[core] Fix markdown generation on Windows (#<I>)
mui-org_material-ui
train
js
b137056505f92ce5dce1f385e181903a30c381ad
diff --git a/lib/shelly/cli/deploy.rb b/lib/shelly/cli/deploy.rb index <HASH>..<HASH> 100644 --- a/lib/shelly/cli/deploy.rb +++ b/lib/shelly/cli/deploy.rb @@ -60,6 +60,7 @@ module Shelly desc "pending", "Show commits which haven't been deployed yet" def pending app = multiple_clouds(options[:cloud], "deploy pending") + app.git_fetch_remote if app.deployed? commits = app.pending_commits if commits.present? diff --git a/spec/shelly/cli/deploy_spec.rb b/spec/shelly/cli/deploy_spec.rb index <HASH>..<HASH> 100644 --- a/spec/shelly/cli/deploy_spec.rb +++ b/spec/shelly/cli/deploy_spec.rb @@ -115,6 +115,12 @@ describe Shelly::CLI::Deploy do hooks(@deploys, :pending).should include(:inside_git_repository?) end + it "should fetch git references from shelly" do + @app.should_receive(:git_fetch_remote) + @app.stub(:pending_commits => "commit") + invoke(@deploys, :pending) + end + context "when application has been deployed" do context "and has pending commits to deploy" do it "should display them" do
Fetch references before showing not deployed commits [#<I>]
Ragnarson_shelly
train
rb,rb
50fc57426f462e88651ea679cc98337e2d573aa3
diff --git a/service_configuration_lib/spark_config.py b/service_configuration_lib/spark_config.py index <HASH>..<HASH> 100644 --- a/service_configuration_lib/spark_config.py +++ b/service_configuration_lib/spark_config.py @@ -870,7 +870,7 @@ def _emit_resource_requirements( writer.send((metric_key, int(time.time()), required_quantity)) -def _get_spark_hourly_cost( +def get_spark_hourly_cost( clusterman_metrics, resources: Mapping[str, int], cluster: str, @@ -913,7 +913,7 @@ def send_and_calculate_resources_cost( cluster = spark_conf['spark.executorEnv.PAASTA_CLUSTER'] app_name = spark_conf['spark.app.name'] resources = get_resources_requested(spark_conf) - hourly_cost = _get_spark_hourly_cost(clusterman_metrics, resources, cluster, pool) + hourly_cost = get_spark_hourly_cost(clusterman_metrics, resources, cluster, pool) _emit_resource_requirements( clusterman_metrics, resources, app_name, spark_web_url, cluster, pool, )
Make api for spark hourly cost public
Yelp_service_configuration_lib
train
py
0f5f9517f9b5bb79e265bbf7d9ee8ce4633cf9b4
diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go index <HASH>..<HASH> 100644 --- a/plugins/jobs/plugin.go +++ b/plugins/jobs/plugin.go @@ -224,6 +224,7 @@ func (p *Plugin) Serve() chan error { //nolint:gocognit if err != nil { p.events.Push(events.JobEvent{ Event: events.EventJobError, + Error: err, ID: jb.ID(), Start: start, Elapsed: time.Since(start), @@ -248,6 +249,7 @@ func (p *Plugin) Serve() chan error { //nolint:gocognit p.events.Push(events.JobEvent{ Event: events.EventJobError, ID: jb.ID(), + Error: err, Start: start, Elapsed: time.Since(start), }) @@ -271,6 +273,7 @@ func (p *Plugin) Serve() chan error { //nolint:gocognit p.events.Push(events.JobEvent{ Event: events.EventJobError, ID: jb.ID(), + Error: err, Start: start, Elapsed: time.Since(start), }) @@ -295,6 +298,7 @@ func (p *Plugin) Serve() chan error { //nolint:gocognit Event: events.EventJobError, ID: jb.ID(), Start: start, + Error: err, Elapsed: time.Since(start), }) p.putPayload(exec)
Add error to the EventJobError event
spiral_roadrunner
train
go
0ed865efe40f7083a02a2118088564d5cbff3ce9
diff --git a/src/ol/geom/point.js b/src/ol/geom/point.js index <HASH>..<HASH> 100644 --- a/src/ol/geom/point.js +++ b/src/ol/geom/point.js @@ -13,6 +13,7 @@ goog.require('ol.geom.flat'); * @extends {ol.geom.SimpleGeometry} * @param {ol.geom.RawPoint} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @todo stability experimental */ ol.geom.Point = function(coordinates, opt_layout) { goog.base(this); @@ -55,6 +56,7 @@ ol.geom.Point.prototype.closestPointXY = /** * @return {ol.geom.RawPoint} Coordinates. + * @todo stability experimental */ ol.geom.Point.prototype.getCoordinates = function() { return this.flatCoordinates.slice(); @@ -86,6 +88,7 @@ ol.geom.Point.prototype.getType = function() { /** * @param {ol.geom.RawPoint} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout. + * @todo stability experimental */ ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) { if (goog.isNull(coordinates)) {
Add stability annotation to ol.geom.Point
openlayers_openlayers
train
js
0375675a9d05b7834607c133ce855bf6007ea056
diff --git a/test/unit/import/cat1/procedure_order_importer_test.rb b/test/unit/import/cat1/procedure_order_importer_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/import/cat1/procedure_order_importer_test.rb +++ b/test/unit/import/cat1/procedure_order_importer_test.rb @@ -12,6 +12,6 @@ class ProcedureOrderImporterTest < MiniTest::Unit::TestCase assert procedure_order.codes['CPT'].include?('90870') assert procedure_order.oid expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20110524094323') - assert_equal expected_start, procedure_order.start_time + assert_equal expected_start, procedure_order.time end end \ No newline at end of file
fixing test to reflect that procedure order should use time, not start_time.
projectcypress_health-data-standards
train
rb
a310df95d71c0e3248efb9322f6a62a19590402d
diff --git a/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java b/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java index <HASH>..<HASH> 100644 --- a/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java +++ b/hikaricp-common/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java @@ -109,7 +109,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy LOGGER.warn(String.format("Connection %s (%s) marked as broken because of SQLSTATE(%s), ErrorCode(%d).", delegate.toString(), parentPool.toString(), sqlState, sqle.getErrorCode()), sqle); } - else if (sqle.getNextException() instanceof SQLException) { + else if (sqle.getNextException() instanceof SQLException && sqle != sqle.getNextException()) { checkException(sqle.getNextException()); } }
Fix #<I> Guard against drivers that construct an SQLException where the 'cause' is self-referential. Hopefully the cycle is not multi-layers deep, because this check will only guard against one "loop".
brettwooldridge_HikariCP
train
java
287b7eb33f9eece0bc91f3ff9070561ac7d32291
diff --git a/Core/src/main/java/com/eden/orchid/api/generators/OrchidGenerators.java b/Core/src/main/java/com/eden/orchid/api/generators/OrchidGenerators.java index <HASH>..<HASH> 100644 --- a/Core/src/main/java/com/eden/orchid/api/generators/OrchidGenerators.java +++ b/Core/src/main/java/com/eden/orchid/api/generators/OrchidGenerators.java @@ -87,9 +87,18 @@ public final class OrchidGenerators { private void useGenerator(OrchidGenerator generator) { Clog.d("Using generator: #{$1}:[#{$2 | className}]", generator.getPriority(), generator); - generator.startGeneration((!EdenUtils.isEmpty(generator.getName())) - ? indexPages.get(generator.getName()) - : new ArrayList<>()); + + List<OrchidPage> generatorPages = null; + + if(!EdenUtils.isEmpty(generator.getName())) { + generatorPages = indexPages.get(generator.getName()); + } + + if(generatorPages == null) { + generatorPages = new ArrayList<>(); + } + + generator.startGeneration(generatorPages); } public boolean shouldUseGenerator(OrchidGenerator generator) {
Fix null list being sent to generators
JavaEden_Orchid
train
java
e49326fd80daa647f4b1f589d99a704f0e57f23e
diff --git a/salt/fileserver/__init__.py b/salt/fileserver/__init__.py index <HASH>..<HASH> 100644 --- a/salt/fileserver/__init__.py +++ b/salt/fileserver/__init__.py @@ -222,7 +222,9 @@ def reap_fileserver_cache_dir(cache_base, find_func): # This will only remove the directory on the second time # "_reap_cache" is called (which is intentional) if len(dirs) == 0 and len(files) == 0: - os.rmdir(root) + # only remove if empty directory is older than 60s + if time.time() - os.path.getctime(root) > 60: + os.rmdir(root) continue # if not, lets check the files in the directory for file_ in files:
Fix for issue #<I> This resolves issues when the freshly created directory is removed by fileserver.update.
saltstack_salt
train
py
4ea360a0d17c3bd81b77c1a142cd86bd828f8306
diff --git a/src/Vkontakte.php b/src/Vkontakte.php index <HASH>..<HASH> 100644 --- a/src/Vkontakte.php +++ b/src/Vkontakte.php @@ -165,10 +165,10 @@ class Vkontakte extends AbstractProvider } protected function createResourceOwner(array $response, AccessToken $token) { - $response = reset($response['response']); - $additional = $token->getValues(); - $response['email'] = !empty($additional['email']) ? $additional['email'] : null; - $response['id'] = !empty($additional['user_id']) ? $additional['user_id'] : null; + $response = reset($response['response']); + $additional = $token->getValues(); + if (!empty($additional['email'])) $response['email'] = $additional['email']; + if (!empty($additional['user_id'])) $response['id'] = $additional['user_id']; return new User($response, $response['id']); }
Fix bug when `id` and `email` was set to null even if they're was in user response
j4k_oauth2-vkontakte
train
php
1b96f0981eeb85d7899d1a6ffdb3b97b1cf98b39
diff --git a/src/useSprings.js b/src/useSprings.js index <HASH>..<HASH> 100644 --- a/src/useSprings.js +++ b/src/useSprings.js @@ -26,7 +26,7 @@ export const useSprings = (length, propsArg) => { [length] ) - const ref = springs[0].props.ref + const ref = springs[0] ? springs[0].props.ref : void 0 const { start, update, stop } = useMemo( () => ({ /** Apply any pending updates */
fix: useSprings "length" of 0 Reported by: <URL>
react-spring_react-spring
train
js
d54bc8d04c4ac2e6e19d48e360bd14bf7c813858
diff --git a/xbmcswift2/listitem.py b/xbmcswift2/listitem.py index <HASH>..<HASH> 100644 --- a/xbmcswift2/listitem.py +++ b/xbmcswift2/listitem.py @@ -212,11 +212,8 @@ class ListItem(object): listitem.set_property(key, val) if stream_info: - assert isinstance(stream_info, dict) - for stream_type in ('video', 'audio', 'subtitle'): - if stream_type in stream_info: - stream_values = stream_info[stream_type] - listitem.add_stream_info(stream_type, stream_values) + for stream_type, stream_values in stream_info.items(): + listitem.add_stream_info(stream_type, stream_values) if context_menu: listitem.add_context_menu_items(context_menu, replace_context_menu)
Don't allow stream_info to fail silently
jbeluch_xbmcswift2
train
py
2468678b1797c944162326c0b017f4bd0074d4c8
diff --git a/imgaug/augmenters/color.py b/imgaug/augmenters/color.py index <HASH>..<HASH> 100644 --- a/imgaug/augmenters/color.py +++ b/imgaug/augmenters/color.py @@ -282,6 +282,9 @@ class ChangeColorspace(Augmenter): # HSV "HSV2RGB": cv2.COLOR_HSV2RGB, "HSV2BGR": cv2.COLOR_HSV2BGR, + # HLS + "HLS2RGB": cv2.COLOR_HLS2RGB, + "HLS2BGR": cv2.COLOR_HLS2BGR, } def __init__(self, to_colorspace, from_colorspace="RGB", alpha=1.0, name=None, deterministic=False, random_state=None):
add HLS support for WithColorspace
aleju_imgaug
train
py
284979b5e099d964dabf267e88a89276f85c4501
diff --git a/kerncraft/models/benchmark.py b/kerncraft/models/benchmark.py index <HASH>..<HASH> 100644 --- a/kerncraft/models/benchmark.py +++ b/kerncraft/models/benchmark.py @@ -106,6 +106,7 @@ class Benchmark: sum(self.kernel._flops.values())/(time_per_repetition/iterations_per_repetition)/1e6 self.results['MEM BW [MByte/s]'] = float(result['Memory BW [MBytes/s]'][0]) self.results['Performance [MLUP/s]'] = (iterations_per_repetition/time_per_repetition)/1e6 + self.results['Performance[MIt/s]'] = (iterations_per_repetition/time_per_repetition)/1e6 def report(self): if self._args.verbose > 0: @@ -118,6 +119,7 @@ class Benchmark: self.results['MEM volume (per repetition) [B]']) print('Performance [MFLOP/s]', self.results['Performance [MFLOP/s]']) print('Performance [MLUP/s]', self.results['Performance [MLUP/s]']) + print('Performance [It/s]', self.results['Performance[MIt/s]']) if self._args.verbose > 0: print('MEM BW [MByte/s]:', self.results['MEM BW [MByte/s]']) print()
added output for It/s (although it was already present as LUP/s)
RRZE-HPC_kerncraft
train
py
55e459049c09572998cbbb8e277224cf91cd4102
diff --git a/src/Illuminate/Foundation/Exceptions/views/illustrated-layout.blade.php b/src/Illuminate/Foundation/Exceptions/views/illustrated-layout.blade.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Exceptions/views/illustrated-layout.blade.php +++ b/src/Illuminate/Foundation/Exceptions/views/illustrated-layout.blade.php @@ -1,4 +1,4 @@ -<!doctype html> +<!DOCTYPE html> <html lang="en"> <head> <title>@yield('title')</title>
Use consistent uppercase for DOCTYPE This is in line with the Google HTML guide and with other files in the framework. <URL>
laravel_framework
train
php
a087b861b09a429c563870a02a51188879521a15
diff --git a/src/utils/promise.js b/src/utils/promise.js index <HASH>..<HASH> 100644 --- a/src/utils/promise.js +++ b/src/utils/promise.js @@ -119,6 +119,7 @@ define( function () { } catch ( e ) { if ( !called ) { // 2.3.3.3.4.1 reject( e ); // 2.3.3.3.4.2 + called = true; return; } }
all tests in the Promises/A+ compliance suite pass! w<I>t!
ractivejs_ractive
train
js
1cbf936a7723c53880047359d9c174f7c2a74313
diff --git a/lib/megam/api/version.rb b/lib/megam/api/version.rb index <HASH>..<HASH> 100644 --- a/lib/megam/api/version.rb +++ b/lib/megam/api/version.rb @@ -1,5 +1,5 @@ module Megam class API - VERSION = "0.8.2" + VERSION = "0.9.0" end end
changed the version to <I>
megamsys_megam_api
train
rb
d6168cfed15b3a34464ebe2248aa80075e64b184
diff --git a/bin/wsdump.py b/bin/wsdump.py index <HASH>..<HASH> 100755 --- a/bin/wsdump.py +++ b/bin/wsdump.py @@ -59,7 +59,7 @@ class InteractiveConsole(code.InteractiveConsole): def write(self, data): sys.stdout.write("\033[2K\033[E") # sys.stdout.write("\n") - sys.stdout.write("\033[34m" + data + "\033[39m") + sys.stdout.write("\033[34m< " + data + "\033[39m") sys.stdout.write("\n> ") sys.stdout.flush() @@ -117,9 +117,9 @@ def main(): opcode, data = recv() msg = None if not args.verbose and opcode in OPCODE_DATA: - msg = "< %s" % data + msg = data elif args.verbose: - msg = "< %s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data) + msg = "%s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data) if msg is not None: console.write(msg)
console decoration of wsdump.py inside InteractiveConsole
websocket-client_websocket-client
train
py
0071218431ffe834a4489daaec4647275fff7206
diff --git a/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SecureRandomFactory.java b/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SecureRandomFactory.java index <HASH>..<HASH> 100644 --- a/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SecureRandomFactory.java +++ b/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/SecureRandomFactory.java @@ -8,14 +8,15 @@ import java.security.SecureRandom; */ public class SecureRandomFactory { public static SecureRandom getRandom() { - byte[] seed = SecureRandom.getSeed(512); - return getRandom(seed); + return getRandom(null); } public static SecureRandom getRandom(byte[] seed) { try { SecureRandom rnd = SecureRandom.getInstance("SHA1PRNG"); - rnd.setSeed(seed); + if (seed != null) { + rnd.setSeed(seed); + } return rnd; } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(e);
Apparently the generate seed method is stupidly slow.
httpcache4j_httpcache4j
train
java
3557db9a6f6c90484e4515a3a8dd62da88123c54
diff --git a/differentiate/diff.py b/differentiate/diff.py index <HASH>..<HASH> 100644 --- a/differentiate/diff.py +++ b/differentiate/diff.py @@ -9,11 +9,13 @@ def diff(x, y, x_only=False, y_only=False): :param y_only: Return only unique values from y :return: list of unique values """ - # Validate both lists, confirm either are empty + # Validate both lists, confirm neither are empty if len(x) == 0 and len(y) > 0: return y # All y values are unique if x is empty elif len(y) == 0 and len(x) > 0: return x # All x values are unique if y is empty + elif len(y) == 0 and len(x) == 0: + return [] # Convert dictionaries to lists of tuples if isinstance(x, dict):
Added condition to IF statement to check if both lists are empty
mrstephenneal_differentiate
train
py
6f5e8baf88447714336e1793995df6a21faaf784
diff --git a/net_transport.go b/net_transport.go index <HASH>..<HASH> 100644 --- a/net_transport.go +++ b/net_transport.go @@ -5,13 +5,13 @@ import ( "context" "errors" "fmt" - "github.com/hashicorp/go-hclog" "io" "net" "os" "sync" "time" + "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-msgpack/codec" ) @@ -122,7 +122,6 @@ type StreamLayer interface { type netConn struct { target ServerAddress conn net.Conn - r *bufio.Reader w *bufio.Writer dec *codec.Decoder enc *codec.Encoder @@ -344,12 +343,10 @@ func (n *NetworkTransport) getConn(target ServerAddress) (*netConn, error) { netConn := &netConn{ target: target, conn: conn, - r: bufio.NewReader(conn), + dec: codec.NewDecoder(bufio.NewReader(conn), &codec.MsgpackHandle{}), w: bufio.NewWriter(conn), } - // Setup encoder/decoders - netConn.dec = codec.NewDecoder(netConn.r, &codec.MsgpackHandle{}) netConn.enc = codec.NewEncoder(netConn.w, &codec.MsgpackHandle{}) // Done
Remove unused field from netConn
hashicorp_raft
train
go
4a1aaa894c782088472f9e1c33bbad3cc80a7aa3
diff --git a/src/main/java/eu/hansolo/tilesfx/skins/SunburstChartTileSkin.java b/src/main/java/eu/hansolo/tilesfx/skins/SunburstChartTileSkin.java index <HASH>..<HASH> 100644 --- a/src/main/java/eu/hansolo/tilesfx/skins/SunburstChartTileSkin.java +++ b/src/main/java/eu/hansolo/tilesfx/skins/SunburstChartTileSkin.java @@ -63,7 +63,6 @@ public class SunburstChartTileSkin extends TileSkin { TreeNode<ChartData> tree = tile.getSunburstChart().getTreeNode(); if (null == tree) { return; } tree.setOnTreeNodeEvent(e -> { - System.out.println("TreeNodeEvent"); EventType type = e.getType(); if (EventType.NODE_SELECTED == type) { TreeNode<ChartData> segment = e.getSource();
removed System.out.println
HanSolo_tilesfx
train
java
24029820aa6882bcad1738b80d842e10d9e959cd
diff --git a/lib/python/vdm/static/js/vdm.ui.js b/lib/python/vdm/static/js/vdm.ui.js index <HASH>..<HASH> 100644 --- a/lib/python/vdm/static/js/vdm.ui.js +++ b/lib/python/vdm/static/js/vdm.ui.js @@ -3365,13 +3365,27 @@ var loadPage = function() { e.stopPropagation() return; } + var role_with_space = $('#txtUserRole').val().split(','); + var roles = [] + + for(var i = 0; i < role_with_space.length; i++){ + role_trim = role_with_space[i].trim() + if(role_trim.indexOf(' ') > -1){ + $('#errorRole').show() + $('#errorRole').html('Only alphabets, numbers, _ and . are allowed.') + e.preventDefault() + e.stopPropagation() + return; + } + roles.push(role_trim) + } + role = roles.join() ShowSavingStatus(); var username = $('#txtOrgUser').val(); var newUsername = $('#txtUser').val(); var password = encodeURIComponent($('#txtPassword').val()); - var role = $('#txtUserRole').val(); var requestType = "POST"; var requestUser = ""; var database_id = 0;
VDM-<I> Modified code to handle issue while starting VDM after adding multiple user roles.
VoltDB_voltdb
train
js
b60101c9aa2ef123e7c38dc8397e4e415b34cb8c
diff --git a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java +++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java @@ -461,7 +461,7 @@ public class ColumnFamilyRecordReader extends RecordReader<ByteBuffer, SortedMap } // nothing new? reached the end - if (lastRow != null && (rows.get(0).key.equals(lastRow.key) || rows.get(0).columns.get(0).column.equals(startColumn))) + if (lastRow != null && (rows.get(0).key.equals(lastRow.key) || rows.get(0).columns.get(0).column.name.equals(startColumn))) { rows = null; return;
fix bad comparison in hadoop cf recorder reader patch by dbrosius; reviewed by jbellis for CASSANDRA-<I>
Stratio_stratio-cassandra
train
java
f35231a6f5c3534f3cbcac2b4dc3cf23fe91c824
diff --git a/uncompyle6/scanners/scanner26.py b/uncompyle6/scanners/scanner26.py index <HASH>..<HASH> 100755 --- a/uncompyle6/scanners/scanner26.py +++ b/uncompyle6/scanners/scanner26.py @@ -174,7 +174,7 @@ class Scanner26(scan.Scanner2): collection_type = op_name.split("_")[1] next_tokens = self.bound_collection_from_tokens( - tokens, t, i, "CONST_%s" % collection_type + tokens, t, len(tokens), "CONST_%s" % collection_type ) if next_tokens is not None: tokens = next_tokens
Correct bug in long literal replacement for <I>-7
rocky_python-uncompyle6
train
py
89e40987d8215516b97df31a551b2562d4e01493
diff --git a/lib/cancan/model_adapters/active_record_adapter.rb b/lib/cancan/model_adapters/active_record_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/cancan/model_adapters/active_record_adapter.rb +++ b/lib/cancan/model_adapters/active_record_adapter.rb @@ -99,7 +99,7 @@ module CanCan def override_scope conditions = @rules.map(&:conditions).compact - if conditions.any? { |c| c.kind_of?(ActiveRecord::Relation) } + if defined?(ActiveRecord::Relation) && conditions.any? { |c| c.kind_of?(ActiveRecord::Relation) } if conditions.size == 1 conditions.first else
make sure ActiveRecord::Relation is defined before checking conditions against it so Rails 2 is supported again - closes #<I>
ryanb_cancan
train
rb
c966a35bebda6f79c1c79a835367ba17f5d1a0d5
diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -702,11 +702,11 @@ class UpgradeShell extends Shell { * @return void */ protected function _findFiles($extensions = '') { + $this->_files = array(); foreach ($this->_paths as $path) { if (!is_dir($path)) { continue; } - $this->_files = array(); $Iterator = new RegexIterator( new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)), '/^.+\.(' . $extensions . ')$/i',
Fixed bug in UpgradeShell::findFiles(). $this->_files was reset on each loop through paths, which means, for example, if you still had the old 'views' directory kicking around the results from 'View' would be overwritten.
cakephp_cakephp
train
php
518cb73ce79c63d49ed5ad3a5290187331820a7e
diff --git a/termbox/compat.go b/termbox/compat.go index <HASH>..<HASH> 100644 --- a/termbox/compat.go +++ b/termbox/compat.go @@ -286,7 +286,10 @@ func makeEvent(tev tcell.Event) Event { return Event{Type: EventResize, Width: w, Height: h} case *tcell.EventKey: k := tev.Key() - ch := tev.Rune() + ch := rune(0) + if k == tcell.KeyRune { + ch = tev.Rune() + } mod := tev.Mod() return Event{ Type: EventKey,
fixes #<I> Emulation problem with control keys
gdamore_tcell
train
go
2d2b719a93dcf07c01a5100c0f94520d7ed93bea
diff --git a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/IgnoreInFlightDataITCase.java b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/IgnoreInFlightDataITCase.java index <HASH>..<HASH> 100644 --- a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/IgnoreInFlightDataITCase.java +++ b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/IgnoreInFlightDataITCase.java @@ -258,6 +258,17 @@ public class IgnoreInFlightDataITCase extends TestLogger { @Override public void snapshotState(FunctionSnapshotContext context) throws Exception { + Iterator<Integer> integerIterator = valueState.get().iterator(); + + if (!integerIterator.hasNext() + || integerIterator.next() < PARALLELISM + || (context.getCheckpointId() > 1 + && lastCheckpointValue.get().get() < PARALLELISM)) { + // Try to restart task. + throw new RuntimeException( + "Not enough data to guarantee the in-flight data were generated before the first checkpoint"); + } + if (context.getCheckpointId() > 2) { // It is possible if checkpoint was triggered too fast after restart. return; // Just ignore it.
[FLINK-<I>][tests] Fail IgnoreInFlightData test when there is not enough data for it for all checkpoints not only the first one
apache_flink
train
java
3da9a95b07681dfbfaccca4a33907d4639a97ede
diff --git a/jenetics.prog/src/main/java/io/jenetics/prog/op/MathOp.java b/jenetics.prog/src/main/java/io/jenetics/prog/op/MathOp.java index <HASH>..<HASH> 100644 --- a/jenetics.prog/src/main/java/io/jenetics/prog/op/MathOp.java +++ b/jenetics.prog/src/main/java/io/jenetics/prog/op/MathOp.java @@ -310,8 +310,23 @@ public enum MathOp implements Op<Double> { * * @see Math#tanh(double) */ - TANH("tanh", 1, v -> tanh(v[0])); + TANH("tanh", 1, v -> tanh(v[0])), + /* ************************************************************************* + * Conditional functions + * ************************************************************************/ + + /** + * Returns +1.0 if its first argument is greater than its second argument + * and returns -1.0 otherwise. + * + * @since !__version__! + */ + GT("gt", 2, v -> v[0] > v[1] ? 1.0 : -1.0); + + /* ************************************************************************* + * Additional mathematical constants. + * ************************************************************************/ /** * The double value that is closer than any other to pi, the ratio of the
#<I>: Add 'GT' function usable for Genetic Programming.
jenetics_jenetics
train
java
76ca2345ec3019a440696b59861d40333e2a1353
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index <HASH>..<HASH> 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2023,10 +2023,10 @@ class Project(GitlabObject): GitlabDeleteError: If the action cannot be done GitlabConnectionError: If the server cannot be reached. """ - url = "/projects/%s/star" % self.id - r = self.gitlab._raw_delete(url, **kwargs) - raise_error_from_response(r, GitlabDeleteError, [200, 304]) - return Project(self.gitlab, r.json()) if r.status_code == 200 else self + url = "/projects/%s/unstar" % self.id + r = self.gitlab._raw_post(url, **kwargs) + raise_error_from_response(r, GitlabDeleteError, [201, 304]) + return Project(self.gitlab, r.json()) if r.status_code == 201 else self def archive(self, **kwargs): """Archive a project.
[v4] Update project unstar endpoint
python-gitlab_python-gitlab
train
py
44a9f06ccf77cc74f75c664d4642dc8fbf80de85
diff --git a/test/test_connection.py b/test/test_connection.py index <HASH>..<HASH> 100644 --- a/test/test_connection.py +++ b/test/test_connection.py @@ -459,6 +459,11 @@ class TestConnection(unittest.TestCase, TestRequestMixin): c = get_connection() if is_mongos(c): raise SkipTest('fsync/lock not supported by mongos') + + res = c.admin.command('getCmdLineOpts') + if '--master' in res['argv'] and version.at_least(c, (2, 3, 0)): + raise SkipTest('SERVER-7714') + self.assertFalse(c.is_locked) # async flushing not supported on windows... if sys.platform not in ('cygwin', 'win32'):
Skip fsync_lock test with <I>.x master/slave.
mongodb_mongo-python-driver
train
py
af400b90c387302e07e9c48f8467a1058c903a05
diff --git a/spec.go b/spec.go index <HASH>..<HASH> 100644 --- a/spec.go +++ b/spec.go @@ -140,6 +140,7 @@ var specCommand = cli.Command{ Soft: uint64(1024), }, }, + NoNewPrivileges: true, }, } @@ -300,6 +301,7 @@ func createLibcontainerConfig(cgroupName string, spec *specs.LinuxSpec) (*config config.Sysctl = spec.Linux.Sysctl config.ProcessLabel = spec.Linux.SelinuxProcessLabel config.AppArmorProfile = spec.Linux.ApparmorProfile + config.NoNewPrivileges = spec.Linux.NoNewPrivileges for _, g := range spec.Process.User.AdditionalGids { config.AdditionalGroups = append(config.AdditionalGroups, strconv.FormatUint(uint64(g), 10)) }
Hook up the support to the OCI specification config
opencontainers_runc
train
go
a71489765335478d4f9080fcd32a91220059c656
diff --git a/src/ShapeFile.php b/src/ShapeFile.php index <HASH>..<HASH> 100644 --- a/src/ShapeFile.php +++ b/src/ShapeFile.php @@ -525,7 +525,7 @@ class ShapeFile */ private function _createDBFFile() { - if (!self::supports_dbase() || count($this->DBFHeader) == 0) { + if (!self::supports_dbase() || !is_array($this->DBFHeader) || count($this->DBFHeader) == 0) { $this->DBFFile = null; return true;
Check whether header is array prior to counting it
phpmyadmin_shapefile
train
php
126a4ba177c18fb5571e1cdbab789ed76c55f52c
diff --git a/src/drawEdge.js b/src/drawEdge.js index <HASH>..<HASH> 100644 --- a/src/drawEdge.js +++ b/src/drawEdge.js @@ -70,7 +70,7 @@ function _moveEdge(edge, x1, y1, x2, y2, attributes, options) { var shortening = options.shortening || 0; var arrowHeadLength = 10; var arrowHeadWidth = 7; - var margin = 0.174; + var margin = 0.1; var arrowHeadPoints = [ [0, -arrowHeadWidth / 2],
Adapt drawEdge() to conform to Graphviz version <I>
magjac_d3-graphviz
train
js
dd3defaefa57a1e6f1a2a44d8035e85e95c744a2
diff --git a/src/sap.ui.rta/src/sap/ui/rta/RuntimeAuthoring.js b/src/sap.ui.rta/src/sap/ui/rta/RuntimeAuthoring.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.rta/src/sap/ui/rta/RuntimeAuthoring.js +++ b/src/sap.ui.rta/src/sap/ui/rta/RuntimeAuthoring.js @@ -475,7 +475,8 @@ sap.ui.define([ return this._handlePersonalizationChangesOnStart() .then(function(bReloadTriggered){ if (bReloadTriggered) { - return Promise.reject(false); + // FLP Plugin reacts on this error string and doesn't the error on the UI + return Promise.reject("Reload triggered"); } // Take default plugins if no plugins handed over
[INTERNAL] sap.ui.rta: enhanced handling of rta start with pers changes now start function rejects the promise with a specific error, on which the FLP plugin reacts. Change-Id: If<I>f<I>b<I>bd<I>a2dc<I>d<I>bdf4dd
SAP_openui5
train
js
48724f6e7a9dcb5f460f07a69e94e86fef15cc35
diff --git a/src/ElasticSearch/Bulk.php b/src/ElasticSearch/Bulk.php index <HASH>..<HASH> 100644 --- a/src/ElasticSearch/Bulk.php +++ b/src/ElasticSearch/Bulk.php @@ -42,7 +42,7 @@ class Bulk { * _refresh_ *bool* If set to true, immediately refresh the shard after indexing * @return \Elasticsearch\Bulk */ - public function index($document, $id=false, $index, $type, array $options = array()) { + public function index($document, $id=null, $index, $type, array $options = array()) { $params = array( '_id' => $id, '_index' => $index, '_type' => $type);
The default "false" ID is stored with "false" ID: not with the auto-generated ID The default "null" ID is understood by ES as a no-ID
nervetattoo_elasticsearch
train
php
bf5d054d34a80a67251c0dd317ebeaa0093219f1
diff --git a/govc/library/info.go b/govc/library/info.go index <HASH>..<HASH> 100644 --- a/govc/library/info.go +++ b/govc/library/info.go @@ -89,7 +89,7 @@ Examples: govc library.info */ govc device.cdrom.insert -vm $vm -device cdrom-3000 $(govc library.info -L /lib1/item1/file1) govc library.info -json | jq . - govc library.info /lib1/item1 -json | jq .` + govc library.info -json /lib1/item1 | jq .` } type infoResultsWriter struct {
Fixed docs for govc library.info w/-json When -json comes after the "library/item" then it does not trigger JSON output.
vmware_govmomi
train
go
09954eee5c5a6bc5746607f01c1d8024861de279
diff --git a/server/errors.go b/server/errors.go index <HASH>..<HASH> 100644 --- a/server/errors.go +++ b/server/errors.go @@ -40,14 +40,14 @@ var ( // ErrReservedPublishSubject represents an error condition when sending to a reserved subject, e.g. _SYS.> ErrReservedPublishSubject = errors.New("reserved internal subject") - // ErrBadClientProtocol signals a client requested an invalud client protocol. + // ErrBadClientProtocol signals a client requested an invalid client protocol. ErrBadClientProtocol = errors.New("invalid client protocol") // ErrTooManyConnections signals a client that the maximum number of connections supported by the // server has been reached. ErrTooManyConnections = errors.New("maximum connections exceeded") - // ErrTooManyAccountConnections signals that an acount has reached its maximum number of active + // ErrTooManyAccountConnections signals that an account has reached its maximum number of active // connections. ErrTooManyAccountConnections = errors.New("maximum account active connections exceeded")
cleanup: fix word errors in errors.go
nats-io_gnatsd
train
go
dbc4f64e63c63ff7bd7ac4abc1a5277c4edd9b4d
diff --git a/moskito-core/src/main/java/net/anotheria/moskito/core/plugins/PluginRepository.java b/moskito-core/src/main/java/net/anotheria/moskito/core/plugins/PluginRepository.java index <HASH>..<HASH> 100644 --- a/moskito-core/src/main/java/net/anotheria/moskito/core/plugins/PluginRepository.java +++ b/moskito-core/src/main/java/net/anotheria/moskito/core/plugins/PluginRepository.java @@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentMap; * @author lrosenberg * @since 19.03.13 15:47 */ -public class PluginRepository { +public final class PluginRepository { /** * Logger. @@ -37,7 +37,7 @@ public class PluginRepository { /** * Returns plugin repository singleton instance. - * @return + * @return the instance of this repository. */ public static final PluginRepository getInstance(){ return PluginRepositoryHolder.instance; @@ -141,6 +141,9 @@ public class PluginRepository { * Singletonhelper. */ private static class PluginRepositoryHolder{ + /** + * Instance of the PluginRepository. + */ private static final PluginRepository instance = new PluginRepository(); static{ instance.setup();
javadoc/checkstyle/typos/removed commented code
anotheria_moskito
train
java
615e35505600d9df29d41489cdff3b5565d9f776
diff --git a/decode.go b/decode.go index <HASH>..<HASH> 100644 --- a/decode.go +++ b/decode.go @@ -152,6 +152,14 @@ func unify(data interface{}, rv reflect.Value) error { return unifyAnything(data, rv) } + // Special case. Handle time.Time values specifically. + // TODO: Remove this code when we decide to drop support for Go 1.1. + // This isn't necessary in Go 1.2 because time.Time satisfies the encoding + // interfaces. + if rv.Type().AssignableTo(rvalue(time.Time{}).Type()) { + return unifyDatetime(data, rv) + } + // Special case. Look for a value satisfying the TextUnmarshaler interface. if v, ok := rv.Interface().(TextUnmarshaler); ok { return unifyText(data, v)
Fix bug in Go <I> where time.Time values aren't decoded properly.
lytics_confl
train
go
65f756cdd46f4f72694f08666543dacac1fcf47b
diff --git a/src/main/java/com/marklogic/client/impl/DatabaseClientImpl.java b/src/main/java/com/marklogic/client/impl/DatabaseClientImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/marklogic/client/impl/DatabaseClientImpl.java +++ b/src/main/java/com/marklogic/client/impl/DatabaseClientImpl.java @@ -133,7 +133,7 @@ public class DatabaseClientImpl implements DatabaseClient { } // undocumented backdoor access to JerseyServices - public RESTServices getService() { + public RESTServices getServices() { return services; } }
correct rename on backdoor to get access to Jersey Services git-svn-id: svn+ssh://svn.marklogic.com/project/engsvn/client-api/java/trunk@<I> <I>cac<I>-8da6-<I>-9e9d-6dc<I>b<I>c
marklogic_java-client-api
train
java
96755682cbb2fd724b53083ab9fce5907450ec25
diff --git a/src/Generators/SchemaGenerator.php b/src/Generators/SchemaGenerator.php index <HASH>..<HASH> 100644 --- a/src/Generators/SchemaGenerator.php +++ b/src/Generators/SchemaGenerator.php @@ -470,7 +470,7 @@ class SchemaGenerator */ private function generateDeleteQuery(string $typeName, array $typeFields): string { - $query = ' ' . strtolower($typeName); + $query = ' delete' . $typeName; $arguments = []; //Loop through fields to find the 'ID' field.
add 'delete' to Delete query
deInternetJongens_Lighthouse-Utils
train
php
4c932961fa6de1a8ba59fa6546bd90141e0d466d
diff --git a/lib/columns-to-model.js b/lib/columns-to-model.js index <HASH>..<HASH> 100644 --- a/lib/columns-to-model.js +++ b/lib/columns-to-model.js @@ -85,7 +85,7 @@ function dataToType(data, name, options) { return { value: d, - length: d.length, + length: (d && d.toString) ? d.toString().length : null, kind: pickle(d, options) }; }); @@ -128,6 +128,10 @@ function dataToType(data, name, options) { else if ((kind === "INTEGER" || kind === "FLOAT") && knownID.test(name)) { return new Sequelize.STRING(Math.floor(maxLength * 2)); } + // Check for long integers + else if (kind === "INTEGER" && maxLength > 8) { + return Sequelize.BIGINT; + } else { return Sequelize[kind]; } @@ -142,7 +146,7 @@ function standardize(value) { // Determine if should index based on name function shouldIndex(name) { - var nameTest = /(^|_|\s)(id|name|key)($|_|\s)/g; + var nameTest = /(^|_|-|\s)(id|name|key|amount|amt)($|_|-|\s)/g; return nameTest.test(name); }
Fixing guessing to use larger integers if needed.
datanews_tables
train
js
5b0f5991244a278f9bcb5da9c8f8523c4a9580d4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ with open('requirements.txt') as requirements: setup( name='twitterscraper', - version='0.2.6', + version='0.2.7', description='Tool for scraping Tweets', url='https://github.com/taspinar/twitterscraper', author=['Ahmet Taspinar', 'Lasse Schuirmann'],
update version no in setup.py
taspinar_twitterscraper
train
py
d647418e4d30971d258df436344d4c30efe1493f
diff --git a/src/Entity/AbstractEntityTest.php b/src/Entity/AbstractEntityTest.php index <HASH>..<HASH> 100644 --- a/src/Entity/AbstractEntityTest.php +++ b/src/Entity/AbstractEntityTest.php @@ -148,6 +148,18 @@ abstract class AbstractEntityTest extends AbstractTest $meta = $entityManager->getClassMetadata($class); foreach ($meta->getFieldNames() as $f) { $method = 'get'.$f; + $reflectionMethod = new \ReflectionMethod($generated, $method); + if ($reflectionMethod->hasReturnType()) { + $returnType = $reflectionMethod->getReturnType(); + $allowsNull = $returnType->allowsNull(); + if ($allowsNull) { + // As we can't assert anything here so simply call + // the method and allow the type hint to raise any + // errors. + $generated->$method(); + continue; + } + } $this->assertNotEmpty($generated->$method(), "$f getter returned empty"); } $entityManager->persist($generated);
Update AbstractEntityTest to handle nullable fields
edmondscommerce_doctrine-static-meta
train
php
f2769c7ceb0a94c960856e43a75e940a1432ffe2
diff --git a/lib/validates_zipcode/validator.rb b/lib/validates_zipcode/validator.rb index <HASH>..<HASH> 100644 --- a/lib/validates_zipcode/validator.rb +++ b/lib/validates_zipcode/validator.rb @@ -27,7 +27,7 @@ module ValidatesZipcode alpha2 = @country_code || record.send(@country_code_attribute) unless ValidatesZipcode::Zipcode.new(zipcode: value.to_s, country_alpha2: alpha2).valid? - record.errors.add(attribute, I18n.t('errors.messages.invalid_zipcode', value: value, default: 'Zipcode is invalid')) + record.errors.add(attribute, :invalid_zipcode, message: I18n.t('errors.messages.invalid_zipcode', value: value, default: 'Zipcode is invalid')) end end end
Add "validator type" to error (dgilperez/validates_zipcode#<I>) One line fiddle, seems to work, all tests pass (ruby <I>).
dgilperez_validates_zipcode
train
rb
86885053e6ad818bf4d894736f7e9b523ac718a8
diff --git a/lib/rubocop/cop/mixin/trailing_comma.rb b/lib/rubocop/cop/mixin/trailing_comma.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/mixin/trailing_comma.rb +++ b/lib/rubocop/cop/mixin/trailing_comma.rb @@ -124,19 +124,25 @@ module RuboCop end def put_comma(node, items, kind) + return if avoid_autocorrect?(elements(node)) + last_item = items.last return if last_item.block_pass_type? - last_expr = last_item.source_range - ix = last_expr.source.rindex("\n") || 0 - ix += last_expr.source[ix..-1] =~ /\S/ - range = range_between(last_expr.begin_pos + ix, last_expr.end_pos) - autocorrect_range = avoid_autocorrect?(elements(node)) ? nil : range + range = autocorrect_range(last_item) - add_offense(autocorrect_range, range, + add_offense(range, range, format(MSG, 'Put a', format(kind, 'a multiline') + '.')) end + def autocorrect_range(item) + expr = item.source_range + ix = expr.source.rindex("\n") || 0 + ix += expr.source[ix..-1] =~ /\S/ + + range_between(expr.begin_pos + ix, expr.end_pos) + end + # By default, there's no reason to avoid auto-correct. def avoid_autocorrect?(_) false
Reduce complexity in TrailingComma mixin Extract `autocorrect_range` from `put_comma`.
rubocop-hq_rubocop
train
rb
ce7f73361930d9d97df1d370a8583fdc008259f4
diff --git a/Eloquent/Factories/Factory.php b/Eloquent/Factories/Factory.php index <HASH>..<HASH> 100644 --- a/Eloquent/Factories/Factory.php +++ b/Eloquent/Factories/Factory.php @@ -448,22 +448,22 @@ abstract class Factory protected function expandAttributes(array $definition) { return collect($definition) - ->map(function ($attribute, $key) { + ->map($evaluateRelations = function ($attribute) { if ($attribute instanceof self) { $attribute = $attribute->create()->getKey(); } elseif ($attribute instanceof Model) { $attribute = $attribute->getKey(); } - $definition[$key] = $attribute; - return $attribute; }) - ->map(function ($attribute, $key) use (&$definition) { + ->map(function ($attribute, $key) use (&$definition, $evaluateRelations) { if (is_callable($attribute) && ! is_string($attribute) && ! is_array($attribute)) { $attribute = $attribute($definition); } + $attribute = $evaluateRelations($attribute); + $definition[$key] = $attribute; return $attribute;
[9.x] Factory fails to eval models and factories when returned from closure (#<I>) * Add test to check a factory closure attribute returning a factory is resolved * Fix evaluation of factories and models when returned from a closure in factory definition
illuminate_database
train
php
844870038ec7f4407fd9c406ac6b794c734d8c37
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index <HASH>..<HASH> 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -541,6 +541,7 @@ Module.new do FileUtils.cp_r("#{assets_path}/config/webpack", "#{app_template_path}/config/webpack") FileUtils.ln_s("#{assets_path}/node_modules", "#{app_template_path}/node_modules") FileUtils.chdir(app_template_path) do + sh "yarn install" sh "bin/rails webpacker:binstubs" end
Run yarn install in template dir We want to yarn install in the template dir so that templates get a yarn.lock copied over.
rails_rails
train
rb
d175ef6773708afef5982d233ad600f18cf2cdc2
diff --git a/api/client/utils.go b/api/client/utils.go index <HASH>..<HASH> 100644 --- a/api/client/utils.go +++ b/api/client/utils.go @@ -102,6 +102,10 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m if cli.tlsConfig == nil { return serverResp, fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?\n* Is your docker daemon up and running?", err) } + if cli.tlsConfig != nil && strings.Contains(err.Error(), "remote error: bad certificate") { + return serverResp, fmt.Errorf("The server probably has client authentication (--tlsverify) enabled. Please check your TLS client certification settings: %v", err) + } + return serverResp, fmt.Errorf("An error occurred trying to connect: %v", err) }
Add better client error for client certificate failure (missing or denied) This adds a more meaningful error on the client side so the "bad certificate" error coming from the TLS dial code has some context for the user. Docker-DCO-<I>-
moby_moby
train
go
5a41024cf36dde3592c4a53dbcf0364ec93c3025
diff --git a/lib/Cake/Console/Templates/skel/Controller/PagesController.php b/lib/Cake/Console/Templates/skel/Controller/PagesController.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Console/Templates/skel/Controller/PagesController.php +++ b/lib/Cake/Console/Templates/skel/Controller/PagesController.php @@ -30,13 +30,6 @@ class PagesController extends AppController { /** - * Default helper - * - * @var array - */ - public $helpers = array('Html'); - -/** * This controller does not use a model * * @var array
Removing hardcoded helper from PagesController in skel
cakephp_cakephp
train
php
9b19589ec99acbacda7bfe1a3bf4f15a2a3d0781
diff --git a/src/javascript/lib/core/erlang_compat/maps.js b/src/javascript/lib/core/erlang_compat/maps.js index <HASH>..<HASH> 100644 --- a/src/javascript/lib/core/erlang_compat/maps.js +++ b/src/javascript/lib/core/erlang_compat/maps.js @@ -13,7 +13,8 @@ function is_non_primitive(key) { erlang.is_map(key) || erlang.is_pid(key) || erlang.is_reference(key) || - erlang.is_bitstring(key) + erlang.is_bitstring(key) || + erlang.is_tuple(key) ); }
Make sure to check for tuples
elixirscript_elixirscript
train
js
5ca5d11ad55df0b9910969873900b966c710d335
diff --git a/spec/dummy/spec/lib/punto_pagos_rails/transaction_service_spec.rb b/spec/dummy/spec/lib/punto_pagos_rails/transaction_service_spec.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/spec/lib/punto_pagos_rails/transaction_service_spec.rb +++ b/spec/dummy/spec/lib/punto_pagos_rails/transaction_service_spec.rb @@ -77,7 +77,7 @@ RSpec.describe TransactionService do allow(Ticket).to receive(:find).with(ticket.id).and_return(ticket) service.create expect(ticket.errors[:base]).to include( - I18n.t("activerecord.errors.models.ticket.attributes.base.invalid_puntopagos_response")) + I18n.t("punto_pagos_rails.errors.invalid_puntopagos_response")) end end
fix(test): compare with wrong error label
platanus_punto_pagos_rails
train
rb
1826120c9804cd82c2004eb54af76e11a0d663a3
diff --git a/php-binance-api.php b/php-binance-api.php index <HASH>..<HASH> 100644 --- a/php-binance-api.php +++ b/php-binance-api.php @@ -86,7 +86,7 @@ class API { } public function history($symbol, $limit = 500, $fromTradeId = 1) { return $this->httpRequest("v3/myTrades", "GET", ["symbol"=>$symbol, "limit"=>$limit, "fromId"=>$fromTradeId], true); - } + } public function useServerTime() { $serverTime = $this->httpRequest("v1/time")['serverTime']; $this->info['timeOffset'] = $serverTime - (microtime(true)*1000); @@ -123,7 +123,7 @@ class API { return $this->bookPriceData($this->httpRequest("v3/ticker/bookTicker")); } public function account() { - return $this->httpRequest("v3/account", true); + return $this->httpRequest("v3/account", "GET", [], true); } public function prevDay($symbol) { return $this->httpRequest("v1/ticker/24hr", "GET", ["symbol"=>$symbol]);
This closes #<I> Issue with missing signed request Many thanks to zth<I>
jaggedsoft_php-binance-api
train
php
f745be79a2ec2372986a2680fd8b72c078fea670
diff --git a/fleetspeak/src/e2etesting/balancer/balancer.go b/fleetspeak/src/e2etesting/balancer/balancer.go index <HASH>..<HASH> 100644 --- a/fleetspeak/src/e2etesting/balancer/balancer.go +++ b/fleetspeak/src/e2etesting/balancer/balancer.go @@ -18,6 +18,7 @@ import ( var ( serversFile = flag.String("servers_file", "", "File with server hosts") serverFrontendAddr = flag.String("frontend_address", "", "Frontend address for clients to connect") + useProxyProto = flag.Bool("use_proxy_proto", true, "Whether to forward client information using proxy proto") ) func copy(wc io.WriteCloser, r io.Reader) { @@ -64,9 +65,11 @@ func run() error { } } log.Printf("Connection accepted, server: %v\n", serverAddr) - err = proxyproto.WriteFirstProxyMessage(serverConn, lbConn.RemoteAddr().String(), serverAddr) - if err != nil { - return err + if *useProxyProto { + err = proxyproto.WriteFirstProxyMessage(serverConn, lbConn.RemoteAddr().String(), serverAddr) + if err != nil { + return err + } } go copy(serverConn, lbConn) go copy(lbConn, serverConn)
In e2e testing load balancer, make usage of proxyproto optional. (#<I>)
google_fleetspeak
train
go
eb1bb8d9696d6841159952290f9011ba969268e8
diff --git a/src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java b/src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java index <HASH>..<HASH> 100644 --- a/src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java +++ b/src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java @@ -337,7 +337,7 @@ public class CreateApplicationBundleMojo extends AbstractMojo { new File(binFolder, filename).setExecutable(true, false); } // creating fake folder if a JRE is used - File jdkDylibFolder = new File(jrePath, "Contents/Home/jre/jli/libjli.dylib"); + File jdkDylibFolder = new File(jrePath, "Contents/Home/jre/lib/jli/libjli.dylib"); if (!jdkDylibFolder.exists()) { getLog().info("Assuming that this is a JRE creating fake folder"); File fakeJdkFolder = new File(pluginsDirectory, "Contents/Home/jre/lib");
Missing lib in path added.
federkasten_appbundle-maven-plugin
train
java
476a32325dcaa3a88dc8a5102cbc7c766d15b2e7
diff --git a/psiturk/amt_services.py b/psiturk/amt_services.py index <HASH>..<HASH> 100644 --- a/psiturk/amt_services.py +++ b/psiturk/amt_services.py @@ -408,7 +408,7 @@ class MTurkServices(object): worker_data = [{ 'hitId': worker.HITId, 'assignmentId': worker.AssignmentId, - 'workerId': worker.Worker_id, + 'workerId': worker.WorkerId, 'submit_time': worker.SubmitTime, 'accept_time': worker.AcceptTime, 'status': worker.assignment_status @@ -422,7 +422,7 @@ class MTurkServices(object): try: bonus = MTurkConnection.get_price_as_price(amount) assignment = self.mtc.get_assignment(assignment_id)[0] - worker_id = assignment.Worker_id + worker_id = assignment.WorkerId self.mtc.grant_bonus(worker_id, assignment_id, bonus, reason) return True except MTurkRequestError as exception:
Fixes typo introduced in worker API
NYUCCL_psiTurk
train
py
0dca83e00182e429ffcb86f16d441394cdc40a57
diff --git a/test/cluster/client/client.go b/test/cluster/client/client.go index <HASH>..<HASH> 100644 --- a/test/cluster/client/client.go +++ b/test/cluster/client/client.go @@ -16,6 +16,7 @@ import ( type Client struct { *httpclient.Client cluster *tc.Cluster + size int } var ErrNotFound = errors.New("testcluster: resource not found") @@ -34,11 +35,12 @@ func NewClient(endpoint string) (*Client, error) { return nil, err } client.cluster = &cluster + client.size = cluster.Size() return client, nil } func (c *Client) Size() int { - return c.cluster.Size() + return c.size } func (c *Client) BackoffPeriod() time.Duration { @@ -62,6 +64,7 @@ func (c *Client) AddHost(ch chan *host.HostEvent, vanilla bool) (*tc.Instance, e select { case event := <-ch: if event.HostID == instance.ID { + c.size++ return &instance, nil } case <-time.After(60 * time.Second): @@ -71,6 +74,7 @@ func (c *Client) AddHost(ch chan *host.HostEvent, vanilla bool) (*tc.Instance, e } func (c *Client) RemoveHost(host *tc.Instance) error { + c.size-- return c.Delete("/" + host.ID) }
test: Fix testCluster.Size() TestOmniJobs uses testCluster.Size() to determine how many jobs to wait for, so it should not include hosts which have been removed.
flynn_flynn
train
go
c66ad962e6c4a9e71017506d731b7003e9b0b4f3
diff --git a/sources/scalac/transformer/AddConstructors.java b/sources/scalac/transformer/AddConstructors.java index <HASH>..<HASH> 100644 --- a/sources/scalac/transformer/AddConstructors.java +++ b/sources/scalac/transformer/AddConstructors.java @@ -63,7 +63,8 @@ public class AddConstructors extends Transformer { super(global); this.constructors = constructors; this.forINT = global.target == global.TARGET_INT; - this.forJVM = global.target == global.TARGET_JVM; + this.forJVM = (global.target == global.TARGET_JVM + || global.target == global.TARGET_JVM_BCEL); this.forMSIL = global.target == global.TARGET_MSIL; }
- bug fix: also set flag forJVM when generating... - bug fix: also set flag forJVM when generating JVM bytecodes with BCEL.
scala_scala
train
java
1c777842dafe7950b2a3630fedc6ce60eda4aac8
diff --git a/shablona/shablona.py b/shablona/shablona.py index <HASH>..<HASH> 100644 --- a/shablona/shablona.py +++ b/shablona/shablona.py @@ -2,15 +2,19 @@ import numpy as np import pandas as pd import scipy.optimize as opt from scipy.special import erf -from .due import due, Doi, BibTeX +from .due import due, Doi __all__ = ["Model", "Fit", "opt_err_func", "transform_data", "cumgauss"] # Use duecredit (duecredit.org) to provide a citation to relevant work to -# be cited. This does nothing, unless the user has duecredit installted, +# be cited. This does nothing, unless the user has duecredit installed, # And calls this with duecredit (as in `python -m duecredit script.py`): -due.cite(Doi("10.1167/13.9.30")) +due.cite(Doi("10.1167/13.9.30"), + description="Template project for small scientific Python projects", + tags=["reference-implementation"], + path='shablona') + def transform_data(data): """
ENH: extend duecredit's definition for shablona added description (so it lists nicely, otherwise how could we know what it is about?), tags to specify that this is the canonical reference (not just an implementation of what is cited in the url) and 'path' since that one is not deduced automagically removed unused import to please flake8
bids-standard_pybids
train
py
c426eb7876971fd723152e972da52efa674eddd6
diff --git a/lib/octave_formatter.rb b/lib/octave_formatter.rb index <HASH>..<HASH> 100644 --- a/lib/octave_formatter.rb +++ b/lib/octave_formatter.rb @@ -35,14 +35,16 @@ class OctaveFormatter hold on; plot(rate, reply_rate_stddev, '-kh'); hold on; - plot(rate, errors, '-r<'); + plot(rate, reply_time, '-g*'); + hold on; + plot(rate, errors, '-r*'); grid on; axis([0 #{rate.last} 0 #{rate.last}]); title('Hansel report for #{@data[:server]}:#{@data[:port]}#{@data[:uri]} (#{@data[:num_conns]} connections per run)') xlabel('Demanded Request Rate'); - legend('Request Rate', 'Connection Rate', 'Avg. reply rate', 'Max. reply rate', 'Reply rate StdDev', 'Errors'); + legend('Request Rate', 'Connection Rate', 'Avg. reply rate', 'Max. reply rate', 'Reply rate StdDev', 'Reply time', 'Errors'); print('#{@png_output}', '-dpng') EOS result = result.gsub ' ', ''
octave formatter: plot the reply time
xlymian_hansel
train
rb
f5ec7be750ae0ebf944b16a75ffa11343d5011eb
diff --git a/registration/model.py b/registration/model.py index <HASH>..<HASH> 100644 --- a/registration/model.py +++ b/registration/model.py @@ -42,10 +42,10 @@ class RegistrationModel(object): (k, v) = item return self.transformations[k].apply(v) - return images.map(apply, with_keys=True) + return images.map(apply, value_shape=images.value_shape, dtype=images.dtype, with_keys=True) def __repr__(self): s = self.__class__.__name__ s += '\nlength: %g' % len(self.transformations) s += '\nalgorithm: ' + self.algorithm - return s \ No newline at end of file + return s
skip shape and dtype check during transform
thunder-project_thunder-registration
train
py
0666b8a0985df2b3dbbb66f5c37ff8981028f05f
diff --git a/src/processor.js b/src/processor.js index <HASH>..<HASH> 100644 --- a/src/processor.js +++ b/src/processor.js @@ -107,9 +107,7 @@ function processRoom(roomId, intents, objects, terrain, gameTime, roomInfo, flag roomSpawns.push(object); } - if(!driver.config.emit('processObject',object, objects, terrain, gameTime, roomInfo, bulk, userBulk)) { - object._skip = true; - } + driver.config.emit('processObject',object, objects, terrain, gameTime, roomInfo, bulk, userBulk); });
refact(modding): replace callbacks with EventEmitters
screeps_engine
train
js
8140a262dd23e0a86c222229a94d29ed94108801
diff --git a/indra/databases/chembl_client.py b/indra/databases/chembl_client.py index <HASH>..<HASH> 100644 --- a/indra/databases/chembl_client.py +++ b/indra/databases/chembl_client.py @@ -145,7 +145,6 @@ def query_target(target_chembl_id): 'params': {'target_chembl_id': target_chembl_id, 'limit': 1}} res = send_query(query_dict) - assert(res['page_meta']['total_count'] == 1) target = res['targets'][0] return target diff --git a/indra/tests/test_chembl_client.py b/indra/tests/test_chembl_client.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_chembl_client.py +++ b/indra/tests/test_chembl_client.py @@ -39,7 +39,7 @@ def test_activity_query(): def test_target_query(): - target = query_target(braf_chembl_id) + target = chembl_client.query_target(braf_chembl_id) assert(target['target_type'] == 'SINGLE PROTEIN')
Do not assert in query_target_function
sorgerlab_indra
train
py,py
bf1a94c4e07010b1b30090790c3b88a57c43d1aa
diff --git a/packages/roc-package-module-dev/src/actions/build.js b/packages/roc-package-module-dev/src/actions/build.js index <HASH>..<HASH> 100644 --- a/packages/roc-package-module-dev/src/actions/build.js +++ b/packages/roc-package-module-dev/src/actions/build.js @@ -51,9 +51,9 @@ const buildWithBabel = (target, settings) => { /** * Builds source files based on the configuration using Babel. * - * @param {Object} rocCommandObject - A command object. + * @param {Object} settings - Roc settings object. * - * @returns {Promise} - Promise that is resolved when build is completed. + * @returns {Function} - A correct Roc action. */ export default (settings) => (targets) => { // If not at least on of the targets matches the valid ones it will ignore it. Makes it smarter when combining.
Fixed a small ESLint problem releasted to JSDoc
rocjs_extensions
train
js
ab7fcbd9b7366386ea87e1a1440024a1c253d7f4
diff --git a/gptools/utils.py b/gptools/utils.py index <HASH>..<HASH> 100644 --- a/gptools/utils.py +++ b/gptools/utils.py @@ -165,8 +165,18 @@ class UniformJointPrior(JointPrior): ---------- bounds : list of tuples, (`num_params`,) The bounds for each of the random variables. + ub : list of float, (`num_params`,), optional + The upper bounds for each of the random variables. If present, `bounds` + is then taken to be a list of float with the lower bounds. This gives + :py:class:`UniformJointPrior` a similar calling fingerprint as the other + :py:class:`JointPrior` classes. """ - def __init__(self, bounds): + def __init__(self, bounds, ub=None): + if ub is not None: + try: + bounds = zip(bounds, ub) + except TypeError: + bounds = [(bounds, ub)] self.bounds = bounds def __call__(self, theta):
Small tweaks to help profiletools.
markchil_gptools
train
py
b478a9cfaa22e8f5f0ac0df5b4eac7693ab94c7c
diff --git a/lib/identity_code/lv.rb b/lib/identity_code/lv.rb index <HASH>..<HASH> 100644 --- a/lib/identity_code/lv.rb +++ b/lib/identity_code/lv.rb @@ -68,6 +68,10 @@ module IdentityCode now.year - (birth_date.year + IdentityCode.age_correction(birth_date)) end + def sex + nil + end + private def century diff --git a/lib/identity_code/version.rb b/lib/identity_code/version.rb index <HASH>..<HASH> 100644 --- a/lib/identity_code/version.rb +++ b/lib/identity_code/version.rb @@ -1,3 +1,3 @@ module IdentityCode - VERSION = '0.2.4' + VERSION = '0.2.5' end
No sex in Latvia 🙈
defeed_identitycode
train
rb,rb
87db4b3ca583f9dca06d58982511b7e93f433351
diff --git a/holoviews/plotting/bokeh/util.py b/holoviews/plotting/bokeh/util.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/bokeh/util.py +++ b/holoviews/plotting/bokeh/util.py @@ -64,7 +64,10 @@ def mpl_to_bokeh(properties): elif k == 'marker': new_properties.update(markers.get(v, {'marker': v})) elif k == 'color' or k.endswith('_color'): - new_properties[k] = colors.ColorConverter.colors.get(v, v) + v = colors.ColorConverter.colors.get(v, v) + if isinstance(v, tuple): + v = colors.rgb2hex(v) + new_properties[k] = v else: new_properties[k] = v new_properties.pop('cmap', None)
Fixed color conversions in bokeh utility
pyviz_holoviews
train
py
9da971b2ed1e3120d9089385342ce33a9675497c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ BASE_DIR = os.path.join(os.path.expanduser("~"), ".indy") LOG_DIR = os.path.join(BASE_DIR, "log") CONFIG_FILE = os.path.join(BASE_DIR, "indy_config.py") -tests_require = ['pytest==3.4.1', 'pytest-xdist==1.22.1', 'python3-indy==1.3.1-dev-469'] +tests_require = ['pytest==3.3.1', 'pytest-xdist==1.22.1', 'python3-indy==1.3.1-dev-469'] setup( name='indy-node-dev',
[Test purpose] Decrease pytest version for _fixture_values using
hyperledger_indy-node
train
py
4339c5bc720864023fee8f68642a8347855833aa
diff --git a/src/components/seek_time/seek_time.js b/src/components/seek_time/seek_time.js index <HASH>..<HASH> 100644 --- a/src/components/seek_time/seek_time.js +++ b/src/components/seek_time/seek_time.js @@ -49,8 +49,8 @@ class SeekTime extends UIObject { var offsetX = event.pageX - $(event.target).offset().left var pos = offsetX / $(event.target).width() * 100 pos = Math.min(100, Math.max(pos, 0)) - var currentTime = pos * this.mediaControl.container.getDuration() / 100; - this.time = formatTime(currentTime); + this.currentTime = pos * this.mediaControl.container.getDuration() / 100; + this.time = formatTime(this.currentTime); this.$el.css('left', event.pageX - Math.floor((this.$el.width() / 2) + 6)); this.$el.removeClass('hidden'); this.render();
seek time: set currentTime as attribute
clappr_clappr
train
js
2549a924bbecb3037f25c92be7e34342d290dbf4
diff --git a/src/wavesurfer.js b/src/wavesurfer.js index <HASH>..<HASH> 100644 --- a/src/wavesurfer.js +++ b/src/wavesurfer.js @@ -95,6 +95,22 @@ var WaveSurfer = { this.drawer.progress(0); }, + /** + * Set the playback volume. + * + * newVolume A value between -1 and 1, -1 being no volume and 1 being full volume. + */ + setVolume: function(newVolume) { + + }, + + /** + * Toggle the volume on and off. + */ + mute: function() { + + }, + mark: function (options) { var my = this; var timings = this.timings(0);
Added setVolume and mute methods to the wavesurfer class as the main end points for controlling the playback volume. Implementation to follow.
katspaugh_wavesurfer.js
train
js
779607c173c6fb12d97f9a5bba99315a57ea3ee6
diff --git a/src/Transition.js b/src/Transition.js index <HASH>..<HASH> 100644 --- a/src/Transition.js +++ b/src/Transition.js @@ -51,7 +51,7 @@ export default class Transition extends Component { } } - pivot (props, first) { + pivot (props) { const { getKey, data,
Remove unused var (#<I>) Just taking out this unused "first" variable to avoid confusion.
react-tools_react-move
train
js
f6281fe76db519ac7a303df7c0970e4732b08738
diff --git a/slacker/__init__.py b/slacker/__init__.py index <HASH>..<HASH> 100644 --- a/slacker/__init__.py +++ b/slacker/__init__.py @@ -435,6 +435,13 @@ class Chat(BaseAPI): 'user_auth_url': user_auth_url, }) + def get_permalink(self, channel, message_ts): + return self.get('chat.getPermalink', + params={ + 'channel': channel, + 'message_ts': message_ts + }) + class IM(BaseAPI): def list(self):
Add the new method of chat.getPermalink
os_slacker
train
py
abd8b9de68cf0039d99f7bf237e2bb5076ecf2d8
diff --git a/src/components/navbar/messages.js b/src/components/navbar/messages.js index <HASH>..<HASH> 100644 --- a/src/components/navbar/messages.js +++ b/src/components/navbar/messages.js @@ -97,20 +97,16 @@ export default defineMessages({ id: 'NavBar.Discounts.add', defaultMessage: 'Add discount', }, - 'NavBar.ProjectSettings.title': { - id: 'NavBar.ProjectSettings.title', + 'NavBar.Settings.title': { + id: 'NavBar.Settings.title', defaultMessage: 'Settings', }, - 'NavBar.Taxes.title': { - id: 'NavBar.Taxes.title', - defaultMessage: 'Taxes', - }, - 'NavBar.International.title': { - id: 'NavBar.International.title', - defaultMessage: 'International', + 'NavBar.ProjectSettings.title': { + id: 'NavBar.ProjectSettings.title', + defaultMessage: 'Project settings', }, - 'NavBar.ShippingMethods.title': { - id: 'NavBar.ShippingMethods.title', - defaultMessage: 'Shipping methods', + 'NavBar.ProductTypes.title': { + id: 'NavBar.ProductTypes.title', + defaultMessage: 'Product types', }, });
refactor(Settings): move project-settings to sub-route, add product-types sub-route
commercetools_merchant-center-application-kit
train
js