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
6c072815393aefbb7a1153db694e95cf156c6556
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ except (IOError, ImportError): long_description = f.read() -version = '0.1.7' +version = '0.1.8' class TestCommand(Command):
Update version number to <I>
chaoss_grimoirelab-perceval-puppet
train
py
70a265d0c1e02279179cf00225e05a101e491c44
diff --git a/lib/cli/index.js b/lib/cli/index.js index <HASH>..<HASH> 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -8,16 +8,13 @@ module.exports = function (options) { if (/version:/.test(string) || /warning:/.test(string)) { return; } - string = string.replace(/ember-cli(?!.com)/g, 'candycane-cli'); - string = string.replace(/ember(?!-cli.com)/g, 'candycane'); + write.apply(process.stdout, arguments) } })(process.stdout.write); process.stderr.write = (function(write) { return function(string, encoding, fd) { - string = string.replace(/ember-cli(?!.com)/g, 'candycane-cli'); - string = string.replace(/ember(?!-cli.com)/g, 'candycane'); write.apply(process.stdout, arguments) } })(process.stderr.write);
Don't squash ember-cli errors
candycanejs_candycane-cli
train
js
827dd852b7cfd07887622c36c741e06bbaddb9d2
diff --git a/lib/motion-addressbook/version.rb b/lib/motion-addressbook/version.rb index <HASH>..<HASH> 100644 --- a/lib/motion-addressbook/version.rb +++ b/lib/motion-addressbook/version.rb @@ -1,5 +1,5 @@ module Motion module Addressbook - VERSION = "1.7.2" + VERSION = "1.7.3" end end
Update version.rb version bump to get latest PR
alexrothenberg_motion-addressbook
train
rb
390155d7c37e5736de48119a26c916e855aebb53
diff --git a/hydpy/cythons/modelutils.py b/hydpy/cythons/modelutils.py index <HASH>..<HASH> 100644 --- a/hydpy/cythons/modelutils.py +++ b/hydpy/cythons/modelutils.py @@ -183,15 +183,19 @@ class Cythonizer(object): sys.argv = argv dirinfos = os.walk(self.buildpath) next(dirinfos) + system_dependend_filename = None for dirinfo in dirinfos: - try: + for filename in dirinfo[2]: + if (filename.startswith(self.cyname) and + filename.endswith(dllextension)): + system_dependend_filename = filename + break + if system_dependend_filename: shutil.move(os.path.join(dirinfo[0], - self.cyname+dllextension), + system_dependend_filename), os.path.join(self.cydirpath, self.cyname+dllextension)) break - except BaseException: - pass else: raise OSError('After trying to cythonize module %s, it was not ' 'possible to copy the final cython module %s from '
try to move files like "c_hbranch.cpython-<I>m-x<I>_<I>-linux-gnu.so"
hydpy-dev_hydpy
train
py
6473e07ea748f6798e78046cdef26d599c2f6b35
diff --git a/pymongo/common.py b/pymongo/common.py index <HASH>..<HASH> 100644 --- a/pymongo/common.py +++ b/pymongo/common.py @@ -14,6 +14,7 @@ """Functions and classes common to multiple pymongo modules.""" +import sys import warnings from pymongo import read_preferences @@ -28,6 +29,11 @@ except ImportError: HAS_SSL = False +# Jython 2.7 includes an incomplete ssl module. See PYTHON-498. +if sys.platform.startswith('java'): + HAS_SSL = False + + def raise_config_error(key, dummy): """Raise ConfigurationError with the given key name.""" raise ConfigurationError("Unknown option %s" % (key,))
Jython <I>'s ssl module is incomplete.
mongodb_mongo-python-driver
train
py
cf8a2f44daa444e2cd91d5fc71c330a5c7842c74
diff --git a/modules/orionode/lib/tasks.js b/modules/orionode/lib/tasks.js index <HASH>..<HASH> 100644 --- a/modules/orionode/lib/tasks.js +++ b/modules/orionode/lib/tasks.js @@ -82,7 +82,9 @@ var TaskStoreMongoDB = function() { }); this._orionTask = this._mongoose.model("orionTask", taskSchema); -// this._mongoose.connect('mongodb://localhost/orion_tasks'); + if (!this._mongoose.connection.readyState) { + this._mongoose.connect('mongodb://localhost/orion_multitenant'); + } }; TaskStoreMongoDB.prototype = {
Bug <I> - persist long-running tasks on node server such that they're available to multiple server instances (attempt connect to Mongo iff needed)
eclipse_orion.client
train
js
ca2d23367077f8ecf6eb286a850ca80d7f5f0691
diff --git a/sensor.go b/sensor.go index <HASH>..<HASH> 100644 --- a/sensor.go +++ b/sensor.go @@ -81,24 +81,24 @@ func InitSensor(options *Options) { sensor = newSensor(options) - // enable auto-profiling - if options.EnableAutoProfile { - autoprofile.SetLogger(sensor.logger) - autoprofile.SetOptions(autoprofile.Options{ - IncludeProfilerFrames: options.IncludeProfilerFrames, - MaxBufferedProfiles: options.MaxBufferedProfiles, - }) + // configure auto-profiling + autoprofile.SetLogger(sensor.logger) + autoprofile.SetOptions(autoprofile.Options{ + IncludeProfilerFrames: options.IncludeProfilerFrames, + MaxBufferedProfiles: options.MaxBufferedProfiles, + }) - autoprofile.SetSendProfilesFunc(func(profiles []autoprofile.Profile) error { - if !sensor.agent.Ready() { - return errors.New("sender not ready") - } + autoprofile.SetSendProfilesFunc(func(profiles []autoprofile.Profile) error { + if !sensor.agent.Ready() { + return errors.New("sender not ready") + } - sensor.logger.Debug("sending profiles to agent") + sensor.logger.Debug("sending profiles to agent") - return sensor.agent.SendProfiles(profiles) - }) + return sensor.agent.SendProfiles(profiles) + }) + if options.EnableAutoProfile { autoprofile.Enable() }
Always preconfigure AutoProfile even if it's disabled
instana_go-sensor
train
go
c74d071ef91f2f7497b0a905e09631de53e1503c
diff --git a/runner.go b/runner.go index <HASH>..<HASH> 100644 --- a/runner.go +++ b/runner.go @@ -54,6 +54,8 @@ func (m *Runner) readMessage(msg *Message) (shutdown bool) { m.step = -1 m.runNextStep() shutdown = false + } else if msg.Type == COMMAND && msg.Body == "update" { + m.sendUpdate() } else if len(m.method.Steps) != 0 && msg.Type == UPDATE { m.checkUpdate(msg) shutdown = false @@ -65,6 +67,16 @@ func (m *Runner) readMessage(msg *Message) (shutdown bool) { return shutdown } +func (m *Runner) sendUpdate() { + m.method.Step = m.step + msg := Message{ + Sender: m.GetUID(), + Type: UPDATE, + Method: m.method, + } + m.out<- msg +} + func (m *Runner) checkUpdate(msg *Message) { if (m.stepChecker != nil && m.stepChecker(msg)) { m.stepChecker = nil
runner now responds to update command
cswank_gogadgets
train
go
5ebbff32574ef089ce091ec6b87f7d7adbb429e6
diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -245,7 +245,7 @@ module Discordrb end user.status = status user.game = Discordrb::Games.find_game(data['game_id']) - @users[user_id] = user + user end # Internal handler for VOICE_STATUS_UPDATE
Don't reassign the user as it caused things to fail
meew0_discordrb
train
rb
bf2af1c9e913939e511773d6149d03b8af4c18f1
diff --git a/play.py b/play.py index <HASH>..<HASH> 100755 --- a/play.py +++ b/play.py @@ -5,13 +5,27 @@ import pyshell + # The subshell classes must be defined before being referenced. class KarShell(pyshell.Shell): """The KarShell. This message shows up when you type 'help' """ - pass + + # Overwrite the parser to apply a different lexing rule. + # The exact interface is documented in the parse_line() method. + def parse_line(self, line): + return line[0], line[1:] + + # The 'p' command uses a different lexing rule than other shells. + # To visualize the difference in the lexing rule, try the following input, + # (actual characters are enclosed within a pair of single quotes): + # ' p didj -dd jidd jvi' + @pyshell.command('p') + def do_p(self, cmd, arg): + print("cmd = '{}', arg = '{}'".format(cmd, arg)) + class FooShell(pyshell.Shell): @@ -21,9 +35,11 @@ class FooShell(pyshell.Shell): def do_kar(self, cmd, args): return 'karPROMPT' + '@'.join(args) + class BarShell(pyshell.Shell): pass + class MyShell(pyshell.Shell): def preloop(self):
Add examples of overloading lexer
qzmfranklin_easyshell
train
py
5e2b5b3f4f3b77ba141b2785db32141a1b73eae6
diff --git a/oa-oauth/spec/omniauth/strategies/oauth_spec.rb b/oa-oauth/spec/omniauth/strategies/oauth_spec.rb index <HASH>..<HASH> 100644 --- a/oa-oauth/spec/omniauth/strategies/oauth_spec.rb +++ b/oa-oauth/spec/omniauth/strategies/oauth_spec.rb @@ -15,7 +15,7 @@ def app provider :oauth, :twitter, 'abc', 'def', :site => 'https://api.twitter.com' provider :oauth, :linked_in, 'abc', 'def', :site => 'https://api.linkedin.com' end - run lambda { |env| [200, {'Content-Type' => 'text/plain'}, Rack::Request.new(env).params.key?('auth').to_s] } + run lambda { |env| [200, {'Content-Type' => 'text/plain'}, [Rack::Request.new(env).params.key?('auth').to_s]] } }.to_app end
changed Rack endpoint in OAuth spec to return an enumerable body as per the Rack specification
omniauth_omniauth
train
rb
751b371d1dbb4696012a4585a4b155582ce0d931
diff --git a/Storage/Processor/Image.php b/Storage/Processor/Image.php index <HASH>..<HASH> 100644 --- a/Storage/Processor/Image.php +++ b/Storage/Processor/Image.php @@ -33,6 +33,9 @@ class Image $contents = fread($handle, $length); fclose($handle); + if ($contents === false) { + throw new \RuntimeException('Could not read file'); + } if (!$image = @imagecreatefromstring($contents)) { throw new \InvalidArgumentException('could not make image'); }
bug(param-type): imagecreatefromstring first param cannot be false
ems-project_EMSCommonBundle
train
php
832a3ffe73102cdf48159a6c5cf478c99851a43c
diff --git a/tests/test_ss.py b/tests/test_ss.py index <HASH>..<HASH> 100644 --- a/tests/test_ss.py +++ b/tests/test_ss.py @@ -194,7 +194,8 @@ def test_script_main(): """ proc = subprocess.Popen(['ss'], shell=True, stdout=subprocess.PIPE) output, _ = proc.communicate() - assert proc.returncode == 0 + # different return codes for windows/linux, weird + assert proc.returncode in (0, 1) assert 'Usage: ss [options]' in output if __name__ == '__main__':
Accepting more than one return code Different return code between linux/windows, don't know why
nicoddemus_ss
train
py
6181e5b9d046353413b1fded19dac874350325fd
diff --git a/daemon/logs.go b/daemon/logs.go index <HASH>..<HASH> 100644 --- a/daemon/logs.go +++ b/daemon/logs.go @@ -7,6 +7,7 @@ import ( "time" "github.com/docker/docker/daemon/logger" + "github.com/docker/docker/pkg/stdcopy" "github.com/golang/glog" "github.com/hyperhq/runv/hypervisor/types" ) @@ -43,6 +44,11 @@ func (daemon *Daemon) GetContainerLogs(container string, config *ContainerLogsCo return err } + if !pod.spec.Containers[cidx].Tty { + outStream = stdcopy.NewStdWriter(outStream, stdcopy.Stdout) + errStream = stdcopy.NewStdWriter(config.OutStream, stdcopy.Stderr) + } + err = pod.getLogger(daemon) if err != nil { return err
for non-tty container, write log should use stdcopy This is the behavior compatible to docker(tm). However, because hyperctl always try using stream as tty terminal. Need further modification on hyperctl. should we do the further improvement in another PR?
hyperhq_hyperd
train
go
97b5e41ea9a29c3eb4c5db6143c9c8f834f8e041
diff --git a/spec/influxdb/cases/write_points_spec.rb b/spec/influxdb/cases/write_points_spec.rb index <HASH>..<HASH> 100644 --- a/spec/influxdb/cases/write_points_spec.rb +++ b/spec/influxdb/cases/write_points_spec.rb @@ -81,6 +81,32 @@ describe InfluxDB::Client do specify { expect(subject.write_point("seriez", data)).to be_a(Net::HTTPOK) } end + context "multiple series" do + let(:body) do + [ + { + "name" => "seriez", + "points" => [[87, "juan"]], + "columns" => %w(age name) + }, + { + "name" => "seriez_2", + "points" => [[nil, "jack"], [true, "john"]], + "columns" => %w(active name) + } + ] + end + + let(:data) do + [ + { name: "seriez", data: { name: "juan", age: 87 } }, + { name: "seriez_2", data: [{ name: "jack" }, { name: "john", active: true }] } + ] + end + + specify { expect(subject.write_points(data)).to be_a(Net::HTTPOK) } + end + context "data dump" do it "dumps a hash point value to json" do prefs = [{ 'favorite_food' => 'lasagna' }]
Add Client#write_points specs
influxdata_influxdb-ruby
train
rb
795cc0d3895e4bb79e5f3e3c7c771fea2d314472
diff --git a/holoviews/ipython/magics.py b/holoviews/ipython/magics.py index <HASH>..<HASH> 100644 --- a/holoviews/ipython/magics.py +++ b/holoviews/ipython/magics.py @@ -188,13 +188,10 @@ class OutputMagic(OptionsMagic): def missing_dependency_exception(value, keyword, allowed): - if value in ['mp4', 'webm']: - raise Exception("Format %r does not appear to be supported.\n" - "Please ensure that FFMPEG/AVCONV is installed." % value) - elif value == 'gif': - raise Exception("Format %r does not appear to be supported.\n" - "Please ensure that ImageMagick is installed." % value) - raise Exception('%s %s %s' % (value, keyword, allowed)) + errors = getattr(Store.renderer, 'HOLOMAP_FORMAT_ERROR_MESSAGES', {}) + msg = ("Format %r does not appear to be supported." % value) + error_msg = ('\nMessage: %s' % errors[value]) if value in errors else '' + raise Exception(msg+error_msg) custom_exceptions = {'holomap':missing_dependency_exception}
The OutputMagic now more helpful when holomap formats are unsupported Attempting to use a holomap format that not supported on your system (e.g ffmpeg is missing) now generates a more useful message that helps diagnose the problem (e.g missing optional dependencies)
pyviz_holoviews
train
py
274524e456eb7d22d9c7539394448d87ea848ce8
diff --git a/lib/chain_manager.js b/lib/chain_manager.js index <HASH>..<HASH> 100644 --- a/lib/chain_manager.js +++ b/lib/chain_manager.js @@ -6,6 +6,7 @@ ChainManager = function() { this.chainManagerConfig = {}; this.currentChain = {}; this.file = ""; + this.web3 = null; } ChainManager.prototype.loadConfigFile = function(filename) { @@ -34,6 +35,7 @@ ChainManager.prototype.init = function(env, config) { } this.currentChain = this.chainManagerConfig[chainId]; + this.web3 = web3; } ChainManager.prototype.addContract = function(contractName, code, args, address) {
Sometimes it's nice to get beneath the framework and work with web3 directly.
embark-framework_embark
train
js
b317c3f7169b81fa89ee8ad8d882be4e8d82dc64
diff --git a/src/main/java/net/troja/eve/esi/ApiClient.java b/src/main/java/net/troja/eve/esi/ApiClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/troja/eve/esi/ApiClient.java +++ b/src/main/java/net/troja/eve/esi/ApiClient.java @@ -736,6 +736,11 @@ public class ApiClient { } } + //Workaround for content-length not set if body is null + if (body == null) { + body = ""; + } + Entity<?> entity = serialize(body, formParams, contentType); Response response;
content-length header fix (#<I>) Workaround for content-length header not set if body is null
burberius_eve-esi
train
java
3cfff0ed7efbed34c0a6e5b1439d41229eed2149
diff --git a/src/Services/QueuedJobService.php b/src/Services/QueuedJobService.php index <HASH>..<HASH> 100644 --- a/src/Services/QueuedJobService.php +++ b/src/Services/QueuedJobService.php @@ -10,7 +10,6 @@ use SilverStripe\Control\Session; use SilverStripe\Core\Config\Config; use SilverStripe\Core\Convert; use SilverStripe\Core\Injector\Injector; -use SilverStripe\Core\Object; use SilverStripe\Dev\SapphireTest; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; @@ -406,7 +405,7 @@ class QueuedJobService { // create the job class $impl = $jobDescriptor->Implementation; - $job = Object::create($impl); + $job = Injector::inst()->create($impl); /* @var $job QueuedJob */ if (!$job) { throw new Exception("Implementation $impl no longer exists"); @@ -903,7 +902,7 @@ class QueuedJobService \Subsite::changeSubsite(0); } if (Controller::has_curr()) { - Session::clear('loggedInAs'); + Controller::curr()->getRequest()->getSession()->clear('loggedInAs'); } else { unset($_SESSION['loggedInAs']); }
FIX, correcting some references that are no longer valid with SS4.
symbiote_silverstripe-queuedjobs
train
php
80c5059c3e5fe9865688b733335d15961633080a
diff --git a/world/components.go b/world/components.go index <HASH>..<HASH> 100644 --- a/world/components.go +++ b/world/components.go @@ -1160,7 +1160,8 @@ func (maker v0ComponentMaker) RepN(n int, _ ...func(*repconfig.RepConfig)) *gink "-bbsClientKey", maker.bbsSSL.ClientKey, "-caFile", maker.repSSL.CACert, "-cachePath", cachePath, - "-cellID", "the-cell-id-" + strconv.Itoa(GinkgoParallelNode()) + "-" + strconv.Itoa(n), + "-cellID", "cell_z1" + "-" + strconv.Itoa(n) + "-" + strconv.Itoa(GinkgoParallelNode()), + "--zone", "z1", "-certFile", maker.repSSL.ServerCert, "-consulCluster", maker.ConsulCluster(), "-containerMaxCpuShares", "1024",
Change v0 Rep configuration to allow v0 vizzini to pass cells_test.go [#<I>]
cloudfoundry_inigo
train
go
258aa6acf757433d9d70e71b4ea2ab046e4a4bd0
diff --git a/salt/states/pcs.py b/salt/states/pcs.py index <HASH>..<HASH> 100644 --- a/salt/states/pcs.py +++ b/salt/states/pcs.py @@ -6,6 +6,8 @@ Management of Pacemaker/Corosync clusters with PCS A state module to manage Pacemaker/Corosync clusters with the Pacemaker/Corosync configuration system(PCS) +.. versionadded:: Carbon + :depends: pcs Walkthrough of a complete pcs cluster setup:
Add version tag to new pcs state module (#<I>)
saltstack_salt
train
py
e521fcda142020ecf7856c8b32dd896743b74181
diff --git a/test/constructor.js b/test/constructor.js index <HASH>..<HASH> 100644 --- a/test/constructor.js +++ b/test/constructor.js @@ -165,8 +165,7 @@ module.exports = { 'path and query params merging WITH overriding existing path params'); }, - // @todo issue #1 - 'POST request body building' : function() { + 'request body building' : function() { var QUERY_OBJECT = { world : '2', rainbow : 'unicorn' @@ -175,12 +174,10 @@ module.exports = { QUERY_STRING = 'world=2&rainbow=unicorn', requestQueryObject = new Asker({ - method : 'POST', body : QUERY_OBJECT }), requestQueryString = new Asker({ - method : 'POST', body : QUERY_STRING });
request body compilation test fixed after #1 fix
nodules_asker
train
js
1ef640a2916625b13907b90b9fd5057463234e59
diff --git a/properties/array.py b/properties/array.py index <HASH>..<HASH> 100644 --- a/properties/array.py +++ b/properties/array.py @@ -55,7 +55,7 @@ class Array(Property): raise Exception('Must be a float or an int: {}'.format(data.dtype)) data_file = tempfile.NamedTemporaryFile('rb+', suffix='.dat') - data_file.write(data.astype(use_dtype).tobytes()) + data.astype(use_dtype).tofile(data_file.name) data_file.seek(0) return FileProp(data_file, use_dtype)
use tofile instead of tobytes for <I> compatibility
seequent_properties
train
py
8c07c7cd4e337c40a9a597c3eca6ac72c584587b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import setup import sys import os @@ -11,6 +11,7 @@ if sys.argv[-3] == 'tag': pwd = sys.argv[-1] print(version) os.system('git tag -a %s -m "version %s" ' % (version, version)) + os.system('git tag -d $(git tag --list "jenkins*")') # os.system('git commit -m "version updated via setup.py tag"') os.system('git push https://%s:%[email protected]/Openergy/oplus.git --tags' % (user, pwd)) sys.exit()
added jenkins file deleting workaround
openergy_oplus
train
py
0d1850d94f1cb9ab298e029c012e376b895f1863
diff --git a/test/BasicTest.php b/test/BasicTest.php index <HASH>..<HASH> 100644 --- a/test/BasicTest.php +++ b/test/BasicTest.php @@ -1,5 +1,7 @@ <?php use ParagonIE\CSPBuilder\CSPBuilder; +use Psr\Http\Message\MessageInterface; + /** * */ @@ -43,4 +45,22 @@ class BasicTest extends PHPUnit_Framework_TestCase ] ); } + + public function testInjectCSPHeaderWithoutLegacy() + { + $modifiedMessage = $this->getMock(MessageInterface::class, ['withAddedHeader']); + $message = $this->getMock(MessageInterface::class, ['withAddedHeader']); + $basic = CSPBuilder::fromFile(__DIR__.'/vectors/basic-csp.json'); + + $header = $basic + ->disableOldBrowserSupport() + ->compile(); + $message + ->expects(self::once()) + ->method('withAddedHeader') + ->with('Content-Security-Policy', $header) + ->willReturn($modifiedMessage); + + self::assertSame($modifiedMessage, $basic->injectCSPHeader($message)); + } }
#5 - Testing injection of CSP headers into a PSR-7 request (no legacy support)
paragonie_csp-builder
train
php
58268ddb4717a300fba0a9772de78a82eced9aff
diff --git a/lib/slimmer/test_helpers/shared_templates.rb b/lib/slimmer/test_helpers/shared_templates.rb index <HASH>..<HASH> 100644 --- a/lib/slimmer/test_helpers/shared_templates.rb +++ b/lib/slimmer/test_helpers/shared_templates.rb @@ -1,6 +1,15 @@ module Slimmer module TestHelpers module SharedTemplates + def stub_shared_component_locales + stub_request(:get, /https:\/\/\S+.gov.uk\/templates\/locales\/.+/). + with(headers: { 'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby' }). + to_return(status: 400, headers: {}) + stub_request(:get, /https:\/\/\S+.gov.uk\/templates\/locales\/en/). + with(headers: { 'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => ' gzip, deflate', 'User-Agent' => 'Ruby' }). + to_return(status: 200, body: '{}', headers: {}) + end + def shared_component_selector(name) "#{Slimmer::ComponentResolver::TEST_TAG_NAME}[data-template='govuk_component-#{name}']" end
Add shared test helper for frontend app to use Allows frontend apps to stub component locales for example ```ruby class ActiveSupport::TestCase include Slimmer::TestHelpers::SharedTemplates def setup stub_shared_component_locales end end ```
alphagov_slimmer
train
rb
114cc597072ec93fc4401bbfcf10d52a9b782464
diff --git a/src/Behat/Behat/ApplicationFactory.php b/src/Behat/Behat/ApplicationFactory.php index <HASH>..<HASH> 100644 --- a/src/Behat/Behat/ApplicationFactory.php +++ b/src/Behat/Behat/ApplicationFactory.php @@ -39,7 +39,7 @@ use Behat\Testwork\Suite\ServiceContainer\SuiteExtension; */ class ApplicationFactory extends BaseFactory { - const VERSION = '3.0.0RC1'; + const VERSION = '3.0-dev'; /** * Returns application name.
Specify <I>-dev as an application version
Behat_Behat
train
php
85b646175e1bf1afa0448ba8ada16b9816b43407
diff --git a/lib/transports/mailgun/processAddress.js b/lib/transports/mailgun/processAddress.js index <HASH>..<HASH> 100644 --- a/lib/transports/mailgun/processAddress.js +++ b/lib/transports/mailgun/processAddress.js @@ -10,9 +10,9 @@ function processAddress (data) { if (typeof data === 'object') { // support { name: { first: 'Jed', last: 'Watson' }, email: '[email protected]' } if (typeof data.name === 'object') { + rtn.firstName = data.name.first; + rtn.lastName = data.name.last; data.name = [data.name.first, data.name.last].filter(truthy).join(' '); - rtn.firstName = rtn.name.first; - rtn.lastName = rtn.name.last; } // process { name: 'Jed Watson', email: '[email protected]' } into 'name <email>' format if (data.name && data.email) {
Add firstName and lastName to rtn before data.name is reset
keystonejs_keystone-email
train
js
471e72beb2e0319a541030d7b297b5ca285bafbf
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ * @author Alejandro Mostajo <[email protected]> * @copyright 10 Quality * @license MIT - * @version 1.2.3 + * @version 1.3.0 */ /** diff --git a/tests/test.js b/tests/test.js index <HASH>..<HASH> 100644 --- a/tests/test.js +++ b/tests/test.js @@ -1,6 +1,6 @@ /** * Test unit. - * @version 1.1.0 + * @version 1.3.0 */ var assert = require('assert'); var fs = require('fs');
Prep release candidate <I>
10quality_gulp-wpmvc
train
js,js
4503de53ab7f31e1cc930c72f4865d30375f8f8a
diff --git a/Document.js b/Document.js index <HASH>..<HASH> 100644 --- a/Document.js +++ b/Document.js @@ -172,6 +172,45 @@ }; + Document.prototype.highlight = function (elem, code) { + if (!elem) return; + + // default value is ERR + switch (code) { + case 'OK': + var color = 'green'; + break; + case 'WARN': + var color = 'yellow'; + break; + default: + var color = 'red'; + } + + return this.addBorder(elem,color); + }; + + Document.prototype.addBorder = function (elem, color, witdh, type) { + if (!elem) return; + + var color = color || 'red'; + var width = width || '5px'; + var type = type || 'solid'; + + var properties = { border: width + ' ' + type + ' ' + color } + return this.style(elem,properties); + }; + + Document.prototype.style = function (elem, properties) { + if (!elem || !properties) return; + + var style = ''; + for (var i in properties) { + style += i + ': ' + properties[i] + '; '; + }; + return elem.setAttribute('style',style); + }; + // TODO: Potentially unsafe // Works only with Chrome Document.prototype.loadFile = function (container,file) {
Widgets (controls) can get highlighted. GameStorage join operation in progress
nodeGame_nodegame-window
train
js
8ca82d29355075d0bebef92d242211a9bd5f4eef
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/UserMenu.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/UserMenu.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/UserMenu.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/UserMenu.js @@ -27,7 +27,7 @@ define(['i18n!orion/widgets/nls/messages', 'require', 'orion/webui/littlelib', ' this.authenticatedServices = {}; this.unauthenticatedServices = {}; - if( options.signOut ){ + if( options.signOut !== undefined ){ this._displaySignOut = options.signOut; } },
Fixing a problem with the user menu to show display of sign-out or not
eclipse_orion.client
train
js
2f8902f78797a83aa72b353b86bedb00794d533d
diff --git a/go/install/install_windows.go b/go/install/install_windows.go index <HASH>..<HASH> 100644 --- a/go/install/install_windows.go +++ b/go/install/install_windows.go @@ -378,7 +378,7 @@ func LsofMount(mountDir string, log Log) ([]CommonLsofResult, error) { func deleteDeprecatedFileIfPresent() { // this file is no longer how we do things, and if it's present (which it shouldn't be) it could // cause unexpected behavior - if appDataDir, err := libkb.AppDataDir(); err != nil { + if appDataDir, err := libkb.AppDataDir(); err == nil { autostartLinkPath := filepath.Join(appDataDir, "Microsoft\\Windows\\Start Menu\\Programs\\Startup\\KeybaseStartup.lnk") _ = os.Remove(autostartLinkPath) }
go/install: fix error conditional in unlikely old autostart removal case (#<I>)
keybase_client
train
go
0143d7c9008302092389e89d9f4bd024e9acd286
diff --git a/calais.js b/calais.js index <HASH>..<HASH> 100755 --- a/calais.js +++ b/calais.js @@ -44,7 +44,7 @@ iniparser.parse(home + '/.calais', function(err, data) { var file = argv['_'][0] - path.exists(file, function(exists) { + fs.exists(file, function(exists) { if (exists) {
[fix] path.exists was moved to fs.exists
mcantelon_node-calais
train
js
453b7d0dcb7e69105af6a9c30ff62f0eecdf1b8f
diff --git a/tests/test_customer.py b/tests/test_customer.py index <HASH>..<HASH> 100644 --- a/tests/test_customer.py +++ b/tests/test_customer.py @@ -5,6 +5,7 @@ import decimal from copy import deepcopy from unittest.mock import ANY, patch +import pytest from django.contrib.auth import get_user_model from django.test import TestCase, override_settings from django.utils import timezone @@ -565,7 +566,20 @@ class TestCustomer(AssertStripeFksMixin, TestCase): ) def test_can_charge(self): - self.assertTrue(self.customer.can_charge()) + with pytest.warns(DeprecationWarning) as record: + self.assertTrue(self.customer.can_charge()) + + # check that the message matches + assert "Customer.can_charge() is misleading" in record[0].message.args[0] + + def test_has_valid_source(self): + + assert self.customer.default_source + with pytest.warns(DeprecationWarning) as record: + self.assertTrue(self.customer.has_valid_source()) + + # check that the message matches + assert "Customer.has_valid_source() is deprecated" in record[0].message.args[0] @patch( "stripe.Customer.retrieve", return_value=deepcopy(FAKE_CUSTOMER), autospec=True
Add some customer tests for deprecated methods * Updated test_can_charge to ensure the expected warning gets raised * Added missing test for test_has_valid_source
dj-stripe_dj-stripe
train
py
7d9052d5c31a30eba289817372870c90361ca91f
diff --git a/app/lib/quasar-config.js b/app/lib/quasar-config.js index <HASH>..<HASH> 100644 --- a/app/lib/quasar-config.js +++ b/app/lib/quasar-config.js @@ -386,7 +386,8 @@ class QuasarConfig { // special case where a component can be designated for a framework > config prop if (cfg.framework.importStrategy === 'auto' && cfg.framework.config && cfg.framework.config.loading) { const component = cfg.framework.config.loading.spinner - if (component !== void 0) { + // Is a component and is a QComponent + if (component !== void 0 && /^(Q[A-Z]|q-)/.test(component) === true) { cfg.framework.components.push(component) } }
fix(app): Custom Loading not working in the newest version #<I> (#<I>)
quasarframework_quasar
train
js
7e3f0b8f9bdeb891678ddd697b3aada8c6e87377
diff --git a/app/templates/Gruntfile.js b/app/templates/Gruntfile.js index <HASH>..<HASH> 100644 --- a/app/templates/Gruntfile.js +++ b/app/templates/Gruntfile.js @@ -98,13 +98,6 @@ module.exports = function(grunt) { } }); - // only watch templates files - grunt.registerTask('watch', function(target) { - grunt.task.run([ - 'watch:livereload' - ]); - }); - // load jshint grunt.registerTask('lint', function(target) { grunt.task.run([ @@ -125,4 +118,4 @@ module.exports = function(grunt) { grunt.task.run(['serve:' + target]); }); -}; \ No newline at end of file +};
Update Gruntfile.js task 'watch' has conflict so I remove the registerTask for 'watch'
keystonejs_generator-keystone
train
js
77fd12a35c1557742fafeac1eb47e759570c7489
diff --git a/TYPO3.Neos/Resources/Public/JavaScript/Content/Components/PublishMenu.js b/TYPO3.Neos/Resources/Public/JavaScript/Content/Components/PublishMenu.js index <HASH>..<HASH> 100644 --- a/TYPO3.Neos/Resources/Public/JavaScript/Content/Components/PublishMenu.js +++ b/TYPO3.Neos/Resources/Public/JavaScript/Content/Components/PublishMenu.js @@ -117,7 +117,7 @@ define( } if (this.get('_label')) { - return new Ember.Handlebars.SafeString(I18n.translate('TYPO3.Neos:Main:publishTo', '', 'TYPO3.Neos', 'Main', [this.get('_label')]) + ' <span class="badge">' + this.get('_numberOfChanges') + '</span>'); + return new Ember.Handlebars.SafeString(I18n.translate('TYPO3.Neos:Main:publishTo', '', 'TYPO3.Neos', 'Main', [this.get('_label')]) + ' <span class="neos-badge">' + this.get('_numberOfChanges') + '</span>'); } else { return I18n.translate('TYPO3.Neos:Main:publish') + ' (' + this.get('_numberOfChanges') + ')'; }
BUGFIX: Use neos- prefixed class for publish button count badge
neos_neos-development-collection
train
js
28b392bb485adb191177037c143f38ae6166c673
diff --git a/src/ox_modules/module-mob/commands/click.js b/src/ox_modules/module-mob/commands/click.js index <HASH>..<HASH> 100644 --- a/src/ox_modules/module-mob/commands/click.js +++ b/src/ox_modules/module-mob/commands/click.js @@ -22,9 +22,10 @@ module.exports = async function(locator, timeout) { var el = await this.helpers.getElement(locator, false, timeout); - // if the element is outside the viewport - try to scroll it into the view first - if (await this.isWebViewContext()) { - await el.isClickable(); + // if the element is outside the viewport - check interactability and try to scroll it into the view first + if (await this.isWebViewContext() && !(await el.isClickable())) { + // if not visible, center is overlapped with another element, or disabled + throw new this.OxError(this.errHelper.errorCode.ELEMENT_NOT_VISIBLE); } await el.click();
Throw proper error on mob.click in webview context if element is not interactable
oxygenhq_oxygen
train
js
95b433063e8f9fab383ac8547eddd3ab09f9b117
diff --git a/lib/celerity/viewer_connection.rb b/lib/celerity/viewer_connection.rb index <HASH>..<HASH> 100644 --- a/lib/celerity/viewer_connection.rb +++ b/lib/celerity/viewer_connection.rb @@ -19,6 +19,10 @@ module Celerity send_data({'method' => 'save', 'path' => path}.to_json) end + def close + @socket.close + end + private def send_data(data)
Add ViewerConnection#close
jarib_celerity
train
rb
4909865e29eb4002a39488b630789a517faf6b49
diff --git a/sharding-proxy/sharding-proxy-bootstrap/src/main/java/org/apache/shardingsphere/shardingproxy/Bootstrap.java b/sharding-proxy/sharding-proxy-bootstrap/src/main/java/org/apache/shardingsphere/shardingproxy/Bootstrap.java index <HASH>..<HASH> 100644 --- a/sharding-proxy/sharding-proxy-bootstrap/src/main/java/org/apache/shardingsphere/shardingproxy/Bootstrap.java +++ b/sharding-proxy/sharding-proxy-bootstrap/src/main/java/org/apache/shardingsphere/shardingproxy/Bootstrap.java @@ -113,8 +113,6 @@ public final class Bootstrap { Authentication authentication = new AuthenticationYamlSwapper().swap(yamlAuthenticationConfig); logAndInitContext(authentication, properties); initMetrics(metricsConfiguration); - Map<String, Map<String, YamlDataSourceParameter>> schemaRules = getDataSourceParameterMap(ruleConfigs); - startProxy(schemaRules.keySet(), port, schemaRules, getRuleConfigurations(ruleConfigs)); Map<String, Map<String, YamlDataSourceParameter>> schemaDataSources = getDataSourceParameterMap(ruleConfigs); startProxy(schemaDataSources.keySet(), port, schemaDataSources, getRuleConfigurations(ruleConfigs)); }
fix start proxy (#<I>)
apache_incubator-shardingsphere
train
java
b6f8d3d661f9607b8b12de9afce02f4ef33ce6ff
diff --git a/mpv.js b/mpv.js index <HASH>..<HASH> 100644 --- a/mpv.js +++ b/mpv.js @@ -24,7 +24,7 @@ function mpv(){ // --input-ipc-server IPC socket to communicate with mpv // --idle always run in the background // -quite no console prompts. Buffer will overflow otherwise - var defaultArgs = ['--no-video', '--input-ipc-server=' + socketFile, '-idle', '-quiet']; + var defaultArgs = ['--no-video', '--no-audio-display', '--input-ipc-server=' + socketFile, '-idle', '-quiet']; // set up socket this.socket = new ipcConnection(socketFile); @@ -76,6 +76,11 @@ function mpv(){ }.bind(this)); + // if spawn fails to start mpv player + this.mpvPlayer.on('error', function(error) { + console.log("mov player not found"); + }); + } mpv.prototype = { @@ -134,9 +139,3 @@ mpv.prototype = { } } -player = new mpv(); - -player.loadStream('https://www.youtube.com/watch?v=PJ7E40Ec5ec'); - -player.observeProperty("volume", 1); -player.observeProperty("mute", 1);
Handled error when spawn fails to load mpv
00SteinsGate00_Node-MPV
train
js
48f83e208ecc9fbf6b407e9935404669dcfddf75
diff --git a/example/pure/run.js b/example/pure/run.js index <HASH>..<HASH> 100644 --- a/example/pure/run.js +++ b/example/pure/run.js @@ -1,5 +1,5 @@ var browser = require("../../lib/jsdom/browser/index"); -var dom = new browser.browserAugmentation(require("../../lib/jsdom/level1/core").dom.level1.core); +var dom = new browser.browserAugmentation(require("../../lib/jsdom/level2/core").dom.level2.core); var sax = require("./sax"); var sys = require("sys"); diff --git a/example/sizzle/run.js b/example/sizzle/run.js index <HASH>..<HASH> 100644 --- a/example/sizzle/run.js +++ b/example/sizzle/run.js @@ -1,5 +1,5 @@ var browser = require("../../lib/jsdom/browser"); -var dom = browser.browserAugmentation(require("../../lib/jsdom/level1/core").dom.level1.core); +var dom = browser.browserAugmentation(require("../../lib/jsdom/level2/core").dom.level2.core); var sys = require("sys");
Example requires level 2 as it uses document.getElementById
jsdom_jsdom
train
js,js
93825d965cb722d9fec475b2f23e5428fe420cf5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,8 @@ def load_version(filename='./virtualbox/version.py'): setup( name="pyvbox", version=load_version(), - packages=["virtualbox"], + packages=["virtualbox", + "virtualbox._library_ext"], author="Michael Dorman", author_email="[email protected]", url="https://github.com/mjdorma/pyvbox",
moved extension code under _library_ext package
sethmlarson_virtualbox-python
train
py
2ba345a1f2a8a592b04b19ed88e9b16919b32d25
diff --git a/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java b/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java index <HASH>..<HASH> 100644 --- a/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java +++ b/extensions/robospice-ui-spicelist-parent/robospice-ui-spicelist/src/main/java/com/octo/android/robospice/spicelist/SpiceListView.java @@ -45,6 +45,7 @@ public class SpiceListView extends ListView { /** * {@inheritDoc} + * * @param l The listener to register with the ListView, or {@code null} to unregister an existing one. */ @Override
Attended comments about commit eb2b8b<I>e0ff<I>f<I>da8f6d<I>e4d<I>a1a5d2e.
stephanenicolas_robospice
train
java
3be3e440f09a9c4bbbcf6d23a682783dcbf634e8
diff --git a/lib/stairway/stairs.rb b/lib/stairway/stairs.rb index <HASH>..<HASH> 100644 --- a/lib/stairway/stairs.rb +++ b/lib/stairway/stairs.rb @@ -35,6 +35,12 @@ module Stairway end end + def run_step(name, context={}, options={}) + notify(context, options) + + @steps[name].run + end + protected def notify(context, options)
Add run_step to run a single step at once
garno_stairway
train
rb
ee89e15fb741bf77ef0a911271163ce420ae973c
diff --git a/services/datalad/datalad_service/common/annex.py b/services/datalad/datalad_service/common/annex.py index <HASH>..<HASH> 100644 --- a/services/datalad/datalad_service/common/annex.py +++ b/services/datalad/datalad_service/common/annex.py @@ -7,6 +7,8 @@ import io import stat import subprocess +from sentry_sdk import capture_exception + from datalad.config import ConfigManager @@ -110,8 +112,8 @@ def parse_rmet_line(remote, rmetLine): slash = '' if remote['url'][-1] == '/' else '/' s3version, path = remoteData.split('#') return '{}{}{}?versionId={}'.format(remote['url'], slash, path, s3version) - except ValueError: - # TODO - Log this error + except: + capture_exception() return None
Log prase_rmet_line errors to Sentry to debug the missing cases.
OpenNeuroOrg_openneuro
train
py
aa5722bbc4cccc2ea6e4a4c87e0dd66931c7f715
diff --git a/armstrong/core/arm_wells/models.py b/armstrong/core/arm_wells/models.py index <HASH>..<HASH> 100644 --- a/armstrong/core/arm_wells/models.py +++ b/armstrong/core/arm_wells/models.py @@ -12,7 +12,7 @@ from .managers import WellManager class Well(models.Model): title = models.CharField(max_length=100) pub_date = models.DateTimeField() - expires = models.DateTimeField(null=True) + expires = models.DateTimeField(null=True, blank=True) active = models.BooleanField(default=True) objects = WellManager()
make sure that expires isn't required in the admin
armstrong_armstrong.core.arm_wells
train
py
e689011fd6e1b319c82cbe8897e75b41e578e3f3
diff --git a/src/python/tmclient/api.py b/src/python/tmclient/api.py index <HASH>..<HASH> 100644 --- a/src/python/tmclient/api.py +++ b/src/python/tmclient/api.py @@ -117,11 +117,15 @@ def check_imagemagick_supported_format(fmt): fmt = fmt.lower() if not fmt.startswith('.'): fmt = '.' + fmt - delegate = SUPPORTED_IMAGE_FORMATS[fmt] + try: + delegate = SUPPORTED_IMAGE_FORMATS[fmt] + except KeyError: + logger.error("Image format `%s` not supported by `tm_client`.") + return False if delegate in supported: return True else: - logger.error("Format `%s` not in ImageMagick's `convert` delegates.") + logger.error("Image format `%s` not in ImageMagick's `convert` delegates.") return False @@ -1145,9 +1149,9 @@ class TmClient(HttpClient): ) if convert: # FIXME: This checks that `convert` can handle the - # *destination* image format, but it could be lack support - # for the *source* image format... But the source images - # are many and, in principle, they could be of many + # *destination* image format, but it could be lacking + # support for the *source* image format... But the source + # images are many and, in principle, they could be of many # different formats... if not check_imagemagick_supported_format(convert): logger.fatal(
Catch and correctly report error when the format for option `--convert` is not supported by `tm_client`. Previous code would only report error if the format was not apparently supported by ImageMagick, and just dump a Python `KeyError` if the format was not in `tm_client`'s hard-coded list.
TissueMAPS_TmClient
train
py
a1851a6d3e69d67bfc4e6bfdec85ba58293351b9
diff --git a/graphdriver/btrfs/btrfs.go b/graphdriver/btrfs/btrfs.go index <HASH>..<HASH> 100644 --- a/graphdriver/btrfs/btrfs.go +++ b/graphdriver/btrfs/btrfs.go @@ -206,6 +206,8 @@ func (d *Driver) Get(id string) (string, error) { } func (d *Driver) Put(id string) { + // Get() creates no runtime resources (like e.g. mounts) + // so this doesn't need to do anything. } func (d *Driver) Exists(id string) bool {
btrfs: Add comment to Put() Document why we don't need to do anything in Put(). Docker-DCO-<I>-
moby_moby
train
go
b404f1895fc047fc0f9226ad0bfbbc276c93f4f2
diff --git a/lib/netsuite/records/item_fulfillment.rb b/lib/netsuite/records/item_fulfillment.rb index <HASH>..<HASH> 100644 --- a/lib/netsuite/records/item_fulfillment.rb +++ b/lib/netsuite/records/item_fulfillment.rb @@ -11,7 +11,7 @@ module NetSuite fields :tran_date, :tran_id, :shipping_cost, :memo, :ship_company, :ship_attention, :ship_addr1, :ship_addr2, :ship_city, :ship_state, :ship_zip, :ship_phone, :ship_is_residential, - :ship_status, :last_modified_date, :created_date + :ship_status, :last_modified_date, :created_date, :status read_only_fields :handling_cost
Add the status field to ItemFulfillments
NetSweet_netsuite
train
rb
682d9fba03a7967b6c3048de93530f9d766699a9
diff --git a/shared/network.go b/shared/network.go index <HASH>..<HASH> 100644 --- a/shared/network.go +++ b/shared/network.go @@ -180,10 +180,10 @@ func WebsocketSendStream(conn *websocket.Conn, r io.Reader, bufferSize int) chan return ch } -func WebsocketRecvStream(w io.WriteCloser, conn *websocket.Conn) chan bool { +func WebsocketRecvStream(w io.Writer, conn *websocket.Conn) chan bool { ch := make(chan bool) - go func(w io.WriteCloser, conn *websocket.Conn) { + go func(w io.Writer, conn *websocket.Conn) { for { mt, r, err := conn.NextReader() if mt == websocket.CloseMessage {
relax constraints on WebsocketRecvStream args We don't use the Close method any more, so let's make these Writers, not WriteClosers.
lxc_lxd
train
go
bf50d1dfb602a8f4f7f144d36bfd2648e3c849e1
diff --git a/doradus-server/src/com/dell/doradus/olap/builder/SegmentBuilder.java b/doradus-server/src/com/dell/doradus/olap/builder/SegmentBuilder.java index <HASH>..<HASH> 100644 --- a/doradus-server/src/com/dell/doradus/olap/builder/SegmentBuilder.java +++ b/doradus-server/src/com/dell/doradus/olap/builder/SegmentBuilder.java @@ -109,6 +109,7 @@ public class SegmentBuilder { } private void add(OlapDocument document) { + Utils.require(document.id != null, "_ID field is not set for a document"); TableDefinition tableDef = application.getTableDef(document.table); Utils.require(tableDef != null, "Table '" + document.table + "' does not exist"); TableBuilder b = getTable(document.table);
fixed NPE if _ID field is not set in a document in OLAP batch
QSFT_Doradus
train
java
10f77878f110182036eb5fb0822a304cc55399cf
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -51,6 +51,7 @@ for (let id in config) markets[id][key] = config[id][key] markets['gdax'].urls['api'] = 'https://api-public.sandbox.gdax.com' +markets['lakebtc'].proxy = proxies[1] var countryName = function (code) { return ((typeof countries[code] !== 'undefined') ? countries[code] : code)
added proxy for lakebtc in test.js
ccxt_ccxt
train
js
5df127d26e168415edd90feee7c703d88515df22
diff --git a/daemon/pod.go b/daemon/pod.go index <HASH>..<HASH> 100644 --- a/daemon/pod.go +++ b/daemon/pod.go @@ -476,6 +476,20 @@ func (p *Pod) PrepareServices() error { return err } +/*** + PrepareDNS() Set the resolv.conf of host to each container, except the following cases: + + - if the pod has a `dns` field with values, the pod will follow the dns setup, and daemon + won't insert resolv.conf file into any containers + - if the pod has a `file` which source is uri "file:///etc/resolv.conf", this mean the user + will handle this file by himself/herself, daemon won't touch the dns setting even if the file + is not referenced by any containers. This could be a method to prevent the daemon from unwanted + setting the dns configuration + - if a container has a file config in the pod spec with `/etc/resolv.conf` as target `path`, + then this container won't be set as the file from hosts. Then a user can specify the content + of the file. + + */ func (p *Pod) PrepareDNS() (err error) { err = nil var (
add comments to describe the dns insert behavior
hyperhq_hyperd
train
go
352430569944217018c266668ed799bcf08cc42d
diff --git a/luigi/task.py b/luigi/task.py index <HASH>..<HASH> 100644 --- a/luigi/task.py +++ b/luigi/task.py @@ -561,6 +561,7 @@ class Task(object): This method gets called when :py:meth:`run` completes without raising any exceptions. The returned value is json encoded and sent to the scheduler as the `expl` argument. Default behavior is to send an None value""" + pass def externalize(task):
Add missing `pass` keyword I have no idea why this compiled before.
spotify_luigi
train
py
58f68aee9f247751357bf63db88eda8ef82629f5
diff --git a/deployer/db/task/db:copy.php b/deployer/db/task/db:copy.php index <HASH>..<HASH> 100644 --- a/deployer/db/task/db:copy.php +++ b/deployer/db/task/db:copy.php @@ -46,6 +46,6 @@ task('db:copy', function () { } else { runLocally("{{local/bin/deployer}} db:upload $targetInstanceName --dumpcode=$dumpCode", 0); run("cd " . $targetInstanceEnv->get('deploy_path') . "/current && " . $targetInstanceEnv->get('bin/php') . - $targetInstanceEnv->get('bin/deployer') . " -q db:import --dumpcode=" . $dumpCode); + ' ' . $targetInstanceEnv->get('bin/deployer') . " -q db:import --dumpcode=" . $dumpCode); } })->desc('Synchronize database between instances.');
[BUGFIX] Refactor db:copy task - fix for wrong path on import command
sourcebroker_deployer-extended-database
train
php
b06a3dec4340423a220e55201c51be471fff5604
diff --git a/pydevd.py b/pydevd.py index <HASH>..<HASH> 100644 --- a/pydevd.py +++ b/pydevd.py @@ -79,7 +79,7 @@ connected = False bufferStdOutToServer = False bufferStdErrToServer = False remote = False -inside_fork = False +forked = False file_system_encoding = getfilesystemencoding() @@ -1233,8 +1233,8 @@ def _locked_settrace( while not debugger.ready_to_run: time.sleep(0.1) # busy wait until we receive run command - global inside_fork - if frame_eval_func is not None and not inside_fork: + global forked + if frame_eval_func is not None and not forked: # Disable frame evaluation for Remote Debug Server debugger.frame_eval_func = None @@ -1377,8 +1377,8 @@ def settrace_forked(): if port is not None: global connected connected = False - global inside_fork - inside_fork = True + global forked + forked = True custom_frames_container_init()
Renaming after review (PY-<I>) (cherry picked from commit <I>d<I>)
fabioz_PyDev.Debugger
train
py
ccb6778f7f470befb890f43d0e1cc897ced5bbc2
diff --git a/network/default.go b/network/default.go index <HASH>..<HASH> 100644 --- a/network/default.go +++ b/network/default.go @@ -585,6 +585,11 @@ func (n *network) processCtrlChan(client transport.Client, listener tunnel.Liste } events = append(events, e) } + // if no events are eligible for processing continue + if len(events) == 0 { + log.Debugf("Network no events to be processed by router: %s", n.options.Id) + continue + } // create an advert and process it advert := &router.Advert{ Id: pbRtrAdvert.Id,
Skip processing Advert which carries no events
micro_go-micro
train
go
d91abb80da0c48c79a06abbceb95c5dbeb0095e4
diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/dockertools/docker_manager.go b/vendor/k8s.io/kubernetes/pkg/kubelet/dockertools/docker_manager.go index <HASH>..<HASH> 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/dockertools/docker_manager.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/dockertools/docker_manager.go @@ -862,7 +862,7 @@ func (dm *DockerManager) IsImagePresent(image kubecontainer.ImageSpec) (bool, er // Removes the specified image. func (dm *DockerManager) RemoveImage(image kubecontainer.ImageSpec) error { // TODO(harryz) currently Runtime interface does not provide other remove options. - _, err := dm.client.RemoveImage(image.Image, dockertypes.ImageRemoveOptions{}) + _, err := dm.client.RemoveImage(image.Image, dockertypes.ImageRemoveOptions{PruneChildren: true}) return err }
UPSTREAM: <I>: Kubelet: Set PruneChildren when removing image
openshift_origin
train
go
80cefe7308276314c30a66c8d1f20b5e42d004d2
diff --git a/src/EventExport/FileWriter/JSONLDFileWriter.php b/src/EventExport/FileWriter/JSONLDFileWriter.php index <HASH>..<HASH> 100644 --- a/src/EventExport/FileWriter/JSONLDFileWriter.php +++ b/src/EventExport/FileWriter/JSONLDFileWriter.php @@ -24,7 +24,7 @@ class JSONLDFileWriter implements FileWriterInterface } fwrite($this->f, '['); - $this->eventFormatter = new JSONLDEventFormatter($inlcude); + $this->eventFormatter = new JSONLDEventFormatter($include); $this->first = true; }
III-<I>: Pass the correct variable to the event formatter
cultuurnet_udb3-php
train
php
5c674cdd07c871c0ab4b883417a84a6d55e41151
diff --git a/upload/admin/controller/marketplace/marketplace.php b/upload/admin/controller/marketplace/marketplace.php index <HASH>..<HASH> 100644 --- a/upload/admin/controller/marketplace/marketplace.php +++ b/upload/admin/controller/marketplace/marketplace.php @@ -853,7 +853,6 @@ class Marketplace extends \Opencart\System\Engine\Controller { curl_close($curl); if (isset($response_info['download'])) { - if (substr($response_info['filename'], -10) == '.ocmod.zip') { $handle = fopen(DIR_STORAGE . 'marketplace/' . $response_info['filename'], 'w'); @@ -1100,4 +1099,4 @@ class Marketplace extends \Opencart\System\Engine\Controller { $this->response->setOutput($this->load->view('marketplace/marketplace_reply', $data)); } -} \ No newline at end of file +}
Cleaned up one line of code.
opencart_opencart
train
php
5cbbbb5e288951d7b12d3ecb9559a3875cc72cd3
diff --git a/plugins/provisioners/ansible/provisioner/base.rb b/plugins/provisioners/ansible/provisioner/base.rb index <HASH>..<HASH> 100644 --- a/plugins/provisioners/ansible/provisioner/base.rb +++ b/plugins/provisioners/ansible/provisioner/base.rb @@ -114,7 +114,7 @@ module VagrantPlugins # Verify if host range patterns exist and warn if config.groups.any? do |gm| - gm.to_s[/(?:\[[a-z]:[a-z]\]|\[[0-9]+?:[0-9]+?\])/] + gm.to_s[/(?:\[[a-z]:[a-z]\]|\[[0-9]+?:[0-9]+?\])/] end @machine.ui.warn(I18n.t("vagrant.provisioners.ansible.ansible_host_pattern_detected")) end
#<I> - Can't use alphanumeric patterns for box names in ansible.groups: Changed iteration logic for warning message and fixed regex typo
hashicorp_vagrant
train
rb
4bb82d95ae34592fcf861cdaf02faeca0c6a6249
diff --git a/websockets/client.py b/websockets/client.py index <HASH>..<HASH> 100644 --- a/websockets/client.py +++ b/websockets/client.py @@ -124,10 +124,6 @@ def connect(uri, *, It raises :exc:`~websockets.uri.InvalidURI` if ``uri`` is invalid and :exc:`~websockets.handshake.InvalidHandshake` if the handshake fails. - - Clients shouldn't close the WebSocket connection. Instead, they should - wait until the server performs the closing handshake by yielding from the - protocol's :attr:`worker` attribute. """ if loop is None: loop = asyncio.get_event_loop()
Remove a misunderstanding of the specification. As explained properly in the remainder of the library, clients are allowed to start the WebSocket closing handshake. It's the TCP connection that should be closed by the server (to allow reuse).
aaugustin_websockets
train
py
6c8e327be7509f86b336c417a70a82b33130077f
diff --git a/tests/contrib/test_cache.py b/tests/contrib/test_cache.py index <HASH>..<HASH> 100644 --- a/tests/contrib/test_cache.py +++ b/tests/contrib/test_cache.py @@ -181,14 +181,16 @@ class TestFileSystemCache(CacheTests): assert len(cache_files) <= THRESHOLD def test_filesystemcache_clear(self, c): - # Makre sure we start out empty - c.clear() assert c.set('foo', 'bar') cache_files = os.listdir(c._path) - assert len(cache_files) == 1 + # count = 2 because of the count file + assert len(cache_files) == 2 assert c.clear() + + # The only file remaining is the count file cache_files = os.listdir(c._path) - assert len(cache_files) == 0 + assert os.listdir(c._path) == [ + os.path.basename(c._get_filename(c._fs_count_file))] # Don't use pytest marker
Fixed the file system test that was broken
pallets_werkzeug
train
py
f257c8f85d01c2c77f7ac48c5c14cda15b72c4f6
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -38,7 +38,7 @@ extensions = [ 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx', 'sphinx.ext.githubpages', - 'nbsphinx', +# 'nbsphinx', # 'sphinx_autodoc_typehints', ]
rm nbsphinx for now (include here + in requirements when needed)
theislab_scvelo
train
py
e02e4370103672c6d57dedfc1a2448a12ea917d8
diff --git a/src/Command/Humbug.php b/src/Command/Humbug.php index <HASH>..<HASH> 100644 --- a/src/Command/Humbug.php +++ b/src/Command/Humbug.php @@ -185,8 +185,8 @@ class Humbug extends Command if ($chDir !== null) { $this->container->setTestRunDirectory($chDir); } - $this->jsonLogFile = $newConfig->getLogsJson(); - $this->textLogFile = $newConfig->getLogsText(); + $this->jsonLogFile = $input->getOption('log-json') ?: $newConfig->getLogsJson(); + $this->textLogFile = $input->getOption('log-text') ?: $newConfig->getLogsText(); $this->builder = new MutantBuilder(); $this->builder->setLogFiles($this->textLogFile, $this->jsonLogFile); @@ -251,6 +251,18 @@ class Humbug extends Command InputOption::VALUE_NONE, 'Enable incremental mutation testing by relying on cached results.' ) + ->addOption( + 'log-json', + null, + InputOption::VALUE_REQUIRED, + 'Generate log file in JSON format.' + ) + ->addOption( + 'log-text', + null, + InputOption::VALUE_REQUIRED, + 'Generate log file in text format.' + ) ; }
Implemented command line configuration of log files
humbug_humbug
train
php
1127bd649d907a602b53008bfbd20438f40a3e14
diff --git a/src/Adapter/DbTable/CallbackCheckAdapter.php b/src/Adapter/DbTable/CallbackCheckAdapter.php index <HASH>..<HASH> 100644 --- a/src/Adapter/DbTable/CallbackCheckAdapter.php +++ b/src/Adapter/DbTable/CallbackCheckAdapter.php @@ -89,7 +89,7 @@ class CallbackCheckAdapter extends AbstractAdapter $this->credentials = $request->getAttribute(DbCredentials::class, null); if($this->credentials && !$this->credentials instanceof DbCredentials) { - throw new \RuntimeException(sprintf("CallbackCheck adapter needs credentials to be provided as an instance of %s", + throw new RuntimeException(sprintf("CallbackCheck adapter needs credentials to be provided as an instance of %s", DbCredentials::class)); } }
changed a thrown exception to be authentication specific
dotkernel_dot-authentication-service
train
php
d585420c7b82d1896d29b02f55e6cae33ced8138
diff --git a/subconvert/cli/MainApp.py b/subconvert/cli/MainApp.py index <HASH>..<HASH> 100644 --- a/subconvert/cli/MainApp.py +++ b/subconvert/cli/MainApp.py @@ -157,6 +157,9 @@ class SubApplication: outputFormat = self.getOutputFormat() converter = SubConverter() + if len(self._args.files) == 0: + log.warning(_("No files selected.")) + for filePath in self._args.files: log.info(_("Starting a job for file: %s") % filePath) try:
Added a warning when no files were selected in CLI mode.
mgoral_subconvert
train
py
cdb07fef988a9f90f5c6ef201db7414a1b0066a9
diff --git a/phoebe/atmospheres/limbdark.py b/phoebe/atmospheres/limbdark.py index <HASH>..<HASH> 100644 --- a/phoebe/atmospheres/limbdark.py +++ b/phoebe/atmospheres/limbdark.py @@ -3795,6 +3795,14 @@ def download_atm(atm=None): destin_folder = get_paths()[0] + # Does the directory exist? + if not os.path.isdir(destin_folder): + direcs = os.sep.split(destin_folder) + level1 = os.path.join(direcs[:-1]) + if not os.path.isdir(level1): + os.mkdir(level1) + os.mkdir(destin_folder) + # Perhaps we need to be sudo? print("Copying to destination folder {}".format(destin_folder)) if not os.access(destin_folder, os.W_OK):
fixed bug in plotting lcobs if no errorbars are available
phoebe-project_phoebe2
train
py
e08478a6db1a9df34f0e31956a8f4a6d14e42db8
diff --git a/elifetools/json_rewrite.py b/elifetools/json_rewrite.py index <HASH>..<HASH> 100644 --- a/elifetools/json_rewrite.py +++ b/elifetools/json_rewrite.py @@ -812,8 +812,10 @@ def rewrite_elife_editors_json(json_content, doi): # Remove affiliations with no name value for i, ref in enumerate(json_content): - if ref.get("affiliations") and not "name" in ref.get("affiliations"): - del(json_content[i]["affiliations"]) + if ref.get("affiliations"): + for aff in ref.get("affiliations"): + if "name" not in aff: + del(json_content[i]["affiliations"]) # Add editor role editor_roles = {}
Fix bad rewrite rule that did not pass tests.
elifesciences_elife-tools
train
py
90f1648af452599970f145747f641384b8aa4dc7
diff --git a/rets/session.py b/rets/session.py index <HASH>..<HASH> 100644 --- a/rets/session.py +++ b/rets/session.py @@ -114,7 +114,7 @@ class Session(object): parser.parse(response.text) parser.parse_headers(response.headers) - self.session_id = response.cookies['RETS-Session-ID'] + self.session_id = response.cookies.get('RETS-Session-ID', '') if parser.headers.get('RETS-Version') is not None and parser.headers.get('RETS-Version') != self.version: logger.info("The server returned a RETS version of {0!s}. This is different than supplied version of {1!s}."
Correct hashing for user agent auth.
refindlyllc_rets
train
py
a72f53d1fb214f9300d0acf12fce7ef774c07e67
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -150,7 +150,7 @@ setup(name='motor', 'pymongo == 2.8.0', ], license='http://www.apache.org/licenses/LICENSE-2.0', - classifiers=filter(None, classifiers.split('\n')), + classifiers=[c for c in classifiers.split('\n') if c], keywords=[ "mongo", "mongodb", "pymongo", "gridfs", "bson", "motor", "tornado", "asyncio",
Fix classifiers in setup.py.
mongodb_motor
train
py
b1852c2481f5a42c3d7d20c5a16188d352528423
diff --git a/src/layouts/Flow/fields/flowField.js b/src/layouts/Flow/fields/flowField.js index <HASH>..<HASH> 100644 --- a/src/layouts/Flow/fields/flowField.js +++ b/src/layouts/Flow/fields/flowField.js @@ -48,6 +48,7 @@ export default (FieldComponent) => class FlowField extends React.Component { visited: PropTypes.bool, warning: PropTypes.string, }), + extraProps: PropTypes.object, }; static defaultProps = { @@ -59,6 +60,7 @@ export default (FieldComponent) => class FlowField extends React.Component { choices: null, description: null, type: null, + extraProps: {}, }; hasFlexibleContent = FieldComponent === TextArea; @@ -87,9 +89,11 @@ export default (FieldComponent) => class FlowField extends React.Component { choices, description, type, + extraProps, } = this.props; const passedProps = { + ...extraProps, ...input, ...meta, error: !!meta.error,
add extraProps to flowField creator
Bandwidth_shared-components
train
js
0b19689b005bfd873bdc5cc97d9c9d5f5df66c6e
diff --git a/src/core/core.js b/src/core/core.js index <HASH>..<HASH> 100755 --- a/src/core/core.js +++ b/src/core/core.js @@ -21,6 +21,8 @@ module.exports = function() { me.ctx = context; me.canvas = context.canvas; + context.canvas.style.display = context.canvas.style.display || 'block'; + // Figure out what the size of the chart will be. // If the canvas has a specified width and height, we use those else // we look to see if the canvas node has a CSS width and height.
style canvas element `display: block` by default
chartjs_Chart.js
train
js
a9ef423c210f4fb2e6381fc1989dd849af0799e3
diff --git a/buffalo/cmd/setup.go b/buffalo/cmd/setup.go index <HASH>..<HASH> 100644 --- a/buffalo/cmd/setup.go +++ b/buffalo/cmd/setup.go @@ -62,7 +62,11 @@ func updateGoDepsCheck(app meta.App) error { return run(c) } if app.WithDep { - // use github.com/golang/dep + if _, err := exec.LookPath("dep"); err != nil { + if err := run(exec.Command(envy.Get("GO_BIN", "go"), "get", "github.com/golang/dep/cmd/dep")); err != nil { + return errors.WithStack(err) + } + } args := []string{"ensure"} if setupOptions.verbose { args = append(args, "-v")
install dep if missing during buffalo setup for dep app (#<I>)
gobuffalo_buffalo
train
go
d1ab46d6e4fbc955352335182a4759ff2c1bf368
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,6 +27,8 @@ ActiveRecord::Base.establish_connection( adapter: 'mysql2', database: 'active_record_filter_factory_test' ) + +# create mysql table if not exists ActiveRecord::Base.connection.execute('DROP TABLE IF EXISTS ar_posts') ActiveRecord::Base.connection.create_table(:ar_posts) do |t| t.string :title
Add some comments to spec_helper.
hck_filter_factory
train
rb
b66f5d4d70380c005c4b915ab03af32534f19e64
diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java index <HASH>..<HASH> 100755 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java @@ -1972,7 +1972,7 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy { synchronized (serverURLs) { if (!serverURLs.contains(host)) { serverURLs.add(host); - OLogManager.instance().info(this, "Registered the new available server '%s'", host); + OLogManager.instance().debug(this, "Registered the new available server '%s'", host); } }
Minor: removed message about the new server address
orientechnologies_orientdb
train
java
a6a57de64621a123396f0f3f2b9bf24ab4320d84
diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -2161,6 +2161,9 @@ func (kl *Kubelet) generatePodStatus(pod *api.Pod) (api.PodStatus, error) { glog.V(4).Infof("Cannot get host IP: %v", err) } else { podStatus.HostIP = hostIP.String() + if pod.Spec.HostNetwork && podStatus.PodIP == "" { + podStatus.PodIP = hostIP.String() + } } }
Assign host's IPAddress to podIP when pod shares the host's network
kubernetes_kubernetes
train
go
2ff7054326df1c5d6eef13b22951c2b66ca1bee8
diff --git a/container/src/main/java/org/jboss/forge/container/modules/AddonModuleLoader.java b/container/src/main/java/org/jboss/forge/container/modules/AddonModuleLoader.java index <HASH>..<HASH> 100644 --- a/container/src/main/java/org/jboss/forge/container/modules/AddonModuleLoader.java +++ b/container/src/main/java/org/jboss/forge/container/modules/AddonModuleLoader.java @@ -45,13 +45,13 @@ public class AddonModuleLoader extends ModuleLoader { this.repository = repository; moduleProviders = ServiceLoader.load(ModuleSpecProvider.class, loader); - installMBeanServer(); + installModuleMBeanServer(); } /** * Installs the MBeanServer. */ - private void installMBeanServer() + private void installModuleMBeanServer() { try {
Changed installMBeanServer name to avoid conflict with super
forge_core
train
java
daf5eadcdba26f37a958ed943e6fde06ce645972
diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java @@ -89,6 +89,21 @@ public class StorableIntrospector { private static Map<Class<?>, Reference<StorableInfo<?>>> cCache = new WeakIdentityMap(); /** + * Test program which examines candidate Storable classes. If any fail, an + * exception is thrown. + * + * @param args names of classes to examine + * @throws MalformedTypeException if Storable type is invalid + */ + public static void main(String[] args) throws Exception { + for (String arg : args) { + Class clazz = Class.forName(arg); + System.out.println("Examining " + clazz.getName()); + examine(clazz); + } + } + + /** * Examines the given class and returns a StorableInfo describing it. A * MalformedTypeException is thrown for a variety of reasons if the given * class is an invalid Storable type.
Added command-line introspector.
Carbonado_Carbonado
train
java
18db87172cffbe48b92e30b70249e304863a70f9
diff --git a/src/event.js b/src/event.js index <HASH>..<HASH> 100644 --- a/src/event.js +++ b/src/event.js @@ -101,8 +101,6 @@ function on( elem, types, selector, data, fn, one ) { */ jQuery.event = { - global: {}, - add: function( elem, types, handler, data, selector ) { var handleObjIn, eventHandle, tmp, @@ -210,9 +208,6 @@ jQuery.event = { } else { handlers.push( handleObj ); } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; } }, diff --git a/test/data/testrunner.js b/test/data/testrunner.js index <HASH>..<HASH> 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -80,7 +80,6 @@ QUnit.testDone( function() { supportjQuery( "#qunit-fixture-iframe" ).remove(); // Reset internal jQuery state - jQuery.event.global = {}; if ( ajaxSettings ) { jQuery.ajaxSettings = jQuery.extend( true, {}, ajaxSettings ); } else {
Event: remove jQuery.event.global jQuery.event.global has been write-only in the jQuery source for the past few years; reading from it was removed in c2d<I>de<I>a<I>f<I>baebc<I>f<I>e<I>ece6d2 when fixing the trac-<I> bug. Closes gh-<I>
jquery_jquery
train
js,js
4e73e4632f84874d24e188005cf90dec299567da
diff --git a/spec/user_spec.rb b/spec/user_spec.rb index <HASH>..<HASH> 100644 --- a/spec/user_spec.rb +++ b/spec/user_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/spec_helper.rb' -describe "Twitter::Base" do +describe "Twitter::User" do before do @base = Twitter::Base.new('foo', 'bar') end
fixed typo in describe of user spec
sferik_twitter
train
rb
bbdaaf8beaa76ebbd8977b53f38f742ac9e9bd79
diff --git a/nodeconductor/iaas/tests/factories.py b/nodeconductor/iaas/tests/factories.py index <HASH>..<HASH> 100644 --- a/nodeconductor/iaas/tests/factories.py +++ b/nodeconductor/iaas/tests/factories.py @@ -34,7 +34,7 @@ class TemplateFactory(factory.DjangoModelFactory): monthly_fee = factory.fuzzy.FuzzyDecimal(0.5, 20.0, 3) -class LicenseFactory(factory.DjangoModelFactory): +class TemplateLicenseFactory(factory.DjangoModelFactory): class Meta(object): model = models.License @@ -74,6 +74,16 @@ class InstanceFactory(factory.DjangoModelFactory): ssh_public_key = factory.SubFactory(SshPublicKeyFactory) +class InstanceLicenseFactory(factory.DjangoModelFactory): + class Meta(object): + model = models.InstanceLicense + + instance = factory.SubFactory(InstanceFactory) + template_license = factory.SubFactory(TemplateFactory) + setup_fee = factory.fuzzy.FuzzyDecimal(10.0, 50.0, 3) + monthly_fee = factory.fuzzy.FuzzyDecimal(0.5, 20.0, 3) + + class PurchaseFactory(factory.DjangoModelFactory): class Meta(object): model = models.Purchase
InstanceLicenseFactory
opennode_waldur-core
train
py
cc4db26a068a31b4a9a77e6595bb50ad073b2538
diff --git a/parser.go b/parser.go index <HASH>..<HASH> 100644 --- a/parser.go +++ b/parser.go @@ -6,10 +6,6 @@ import ( "strings" ) -type IFilteredEvaluator interface { - IEvaluator -} - type IEvaluator interface { Evaluate(*ExecutionContext) (*Value, error) FilterApplied(name string) bool
Removed an interface added by accident.
flosch_pongo2
train
go
75328a078e32831f694ae48c568ea192310bb9d6
diff --git a/go/libkb/json.go b/go/libkb/json.go index <HASH>..<HASH> 100644 --- a/go/libkb/json.go +++ b/go/libkb/json.go @@ -62,6 +62,11 @@ func (f *JSONFile) Load(warnOnNotFound bool) error { } if os.IsPermission(err) { + // Let's just panic and die here on mobile, there is no reason to continue, since the user + // will either need to enter a password or force kill the app anyway + if f.G().GetAppType() == MobileAppType { + panic("permission denied on mobile app reading config file, thats it!") + } f.G().Log.Warning("Permission denied opening %s file %s", f.which, f.filename) return nil }
just bail out of the app if we cant read local files on mobile (#<I>)
keybase_client
train
go
d0f3f26fffccd16e349518f9a5f83dcce4e37d12
diff --git a/testing/test_capture.py b/testing/test_capture.py index <HASH>..<HASH> 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -134,12 +134,22 @@ def test_capturing_bytes_in_utf8_encoding(testdir, method): def test_collect_capturing(testdir): p = testdir.makepyfile( """ + import sys + print("collect %s failure" % 13) + sys.stderr.write("collect %s_stderr failure" % 13) import xyz42123 """ ) result = testdir.runpytest(p) - result.stdout.fnmatch_lines(["*Captured stdout*", "*collect 13 failure*"]) + result.stdout.fnmatch_lines( + [ + "*Captured stdout*", + "collect 13 failure", + "*Captured stderr*", + "collect 13_stderr failure", + ] + ) class TestPerTestCapturing(object):
test_collect_capturing: cover captured stderr
pytest-dev_pytest
train
py
4fdc4fc5f6fb20de3483766712c4800c3e77f4a5
diff --git a/src/Core/ContentManager/Generator/Taxonomy/TaxonomyGenerator.php b/src/Core/ContentManager/Generator/Taxonomy/TaxonomyGenerator.php index <HASH>..<HASH> 100644 --- a/src/Core/ContentManager/Generator/Taxonomy/TaxonomyGenerator.php +++ b/src/Core/ContentManager/Generator/Taxonomy/TaxonomyGenerator.php @@ -183,7 +183,7 @@ class TaxonomyGenerator implements GeneratorInterface protected function normalizeTerm($term) { - return mb_strtolower($term, 'UTF-8'); + return (new StringWrapper($term))->lower(); } protected function getAttributesResolver(ItemInterface $templateItem)
`normalizeTerm` method uses lower method from StringWrapper class
spress_spress
train
php
ca6179d6b7b08e0f9f5aa1e08720c613f000f105
diff --git a/go/api-frontend/aaa/authorization.go b/go/api-frontend/aaa/authorization.go index <HASH>..<HASH> 100644 --- a/go/api-frontend/aaa/authorization.go +++ b/go/api-frontend/aaa/authorization.go @@ -21,10 +21,11 @@ type adminRoleMapping struct { role string } +const ALLOW_ANY = "*" + var pathAdminRolesMap = []adminRoleMapping{ - // TODO: handle wildcard role which is no-authz needed, just auth - adminRoleMapping{prefix: apiPrefix + "/preference/", role: "*"}, - adminRoleMapping{prefix: apiPrefix + "/preferences", role: "*"}, + adminRoleMapping{prefix: apiPrefix + "/preference/", role: ALLOW_ANY}, + adminRoleMapping{prefix: apiPrefix + "/preferences", role: ALLOW_ANY}, adminRoleMapping{prefix: apiPrefix + "/node/", role: "NODES"}, adminRoleMapping{prefix: apiPrefix + "/nodes", role: "NODES"}, @@ -212,6 +213,10 @@ func (tam *TokenAuthorizationMiddleware) isAuthorizedAdminActions(ctx context.Co return false, errors.New(msg) } + if baseAdminRole == ALLOW_ANY { + return true, nil + } + adminRole := baseAdminRole + suffix if _, ok := roles[adminRole]; ok {
handle wildcard for admin role for preferences
inverse-inc_packetfence
train
go
e6d6e73255d4952cf14b13ec80d2d1541287ef10
diff --git a/src/FeedIo/Parser/JsonParser.php b/src/FeedIo/Parser/JsonParser.php index <HASH>..<HASH> 100644 --- a/src/FeedIo/Parser/JsonParser.php +++ b/src/FeedIo/Parser/JsonParser.php @@ -30,8 +30,8 @@ class JsonParser extends ParserAbstract $data = $document->getJsonAsArray(); $feed->setTitle($this->readOffset($data, 'title')); $feed->setDescription($this->readOffset($data, 'description')); - $feed->setLink($this->readOffset($data, 'feed_url')); - $feed->setUrl($this->readOffset($data, 'home_page_url')); + $feed->setLink($this->readOffset($data, 'home_page_url')); + $feed->setUrl($this->readOffset($data, 'feed_url')); $feed->setLogo($this->readOffset($data, 'icon')); $this->readAuthor($feed, $data);
Fix home_page_url / feed_url confusion
alexdebril_feed-io
train
php
169d53b6ac5857fc6181c38e868a2d1f13250317
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -import ace from 'ace'; // eslint-disable-line +import ace from 'brace'; // eslint-disable-line import extend from 'lodash/extend'; import debounce from 'lodash/debounce'; import DiffMatchPatch from 'diff-match-patch'; diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -28,7 +28,7 @@ module.exports = { ], }, externals: { - ace: { + brace: { commonjs: 'brace', commonjs2: 'brace', amd: 'brace',
chore(build): use brace as a default package
ace-diff_ace-diff
train
js,js
a57ad3b96f914e1ea3842edf47fde425d92e8be7
diff --git a/lib/grape/dsl/settings.rb b/lib/grape/dsl/settings.rb index <HASH>..<HASH> 100644 --- a/lib/grape/dsl/settings.rb +++ b/lib/grape/dsl/settings.rb @@ -126,7 +126,6 @@ module Grape # next, within a namespace. def route_end inheritable_setting.route_end - reset_validations! end # Execute the block within a context where our inheritable settings are forked
No longer resetting validations twice
ruby-grape_grape
train
rb
5e4974de5e00082af336df264d132cb2f4809b37
diff --git a/djstripe/models.py b/djstripe/models.py index <HASH>..<HASH> 100644 --- a/djstripe/models.py +++ b/djstripe/models.py @@ -239,7 +239,7 @@ class Transfer(StripeObject): event = models.ForeignKey(Event, related_name="transfers") amount = models.DecimalField(decimal_places=2, max_digits=7) status = models.CharField(max_length=25) - date = models.DateTimeField() + date = models.DateTimeField(help_text="Date the transfer is scheduled to arrive at destination") description = models.TextField(null=True, blank=True) adjustment_count = models.IntegerField() adjustment_fees = models.DecimalField(decimal_places=2, max_digits=7) @@ -734,6 +734,10 @@ class CurrentSubscription(TimeStampedModel): class Invoice(StripeObject): + # + # Stripe API_VERSION: model fields and methods audited to 2015-07-28 - @wahuneke + # + stripe_api_name = "Invoice" customer = models.ForeignKey(Customer, related_name="invoices")
Merge branch 'refactor_common_stripeobject_code' into issue_<I> Conflicts: djstripe/models.py
dj-stripe_dj-stripe
train
py
c28d871d934a135df0094e7a38d3f3414e5b0f79
diff --git a/src/registry/whitelist.js b/src/registry/whitelist.js index <HASH>..<HASH> 100644 --- a/src/registry/whitelist.js +++ b/src/registry/whitelist.js @@ -14,5 +14,7 @@ module.exports = [ 'org.apache.cordova.device', 'org.apache.cordova.contacts', 'org.apache.cordova.console', - 'org.apache.cordova.camera' + 'org.apache.cordova.camera', + 'org.apache.cordova.device-motion', + 'org.apache.cordova.battery-status' ]
added battery-status + device-motion to whitelist
apache_cordova-plugman
train
js
501ba9427140a419309b17a73fed7e3dd6f76fb9
diff --git a/library/src/com/handmark/pulltorefresh/library/PullToRefreshListView.java b/library/src/com/handmark/pulltorefresh/library/PullToRefreshListView.java index <HASH>..<HASH> 100644 --- a/library/src/com/handmark/pulltorefresh/library/PullToRefreshListView.java +++ b/library/src/com/handmark/pulltorefresh/library/PullToRefreshListView.java @@ -282,7 +282,7 @@ public class PullToRefreshListView extends PullToRefreshAdapterViewBase<ListView } - class InternalListViewSDK9 extends InternalListView { + final class InternalListViewSDK9 extends InternalListView { public InternalListViewSDK9(Context context, AttributeSet attrs) { super(context, attrs); @@ -300,8 +300,11 @@ public class PullToRefreshListView extends PullToRefreshAdapterViewBase<ListView final int newY = (deltaY + scrollY); if (newY != 0) { - // We're overscrolling so set scroll Y - setHeaderScroll(PullToRefreshListView.this.getScrollY() + newY); + // Check the mode supports the overscroll direction, and + // then move scroll + if ((mode.canPullDown() && newY < 0) || (mode.canPullUp() && newY > 0)) { + setHeaderScroll(PullToRefreshListView.this.getScrollY() + newY); + } } else { // Means we've stopped overscrolling, so scroll back to 0 smoothScrollTo(0, SMOOTH_SCROLL_LONG_DURATION_MS);
Revert previous change to make over scroll work everywhere.
chrisbanes_Android-PullToRefresh
train
java
038a11914ae972076e8e5e3ad5b3ceac17b6cd35
diff --git a/bin/test.py b/bin/test.py index <HASH>..<HASH> 100755 --- a/bin/test.py +++ b/bin/test.py @@ -1,30 +1,6 @@ #!/usr/bin/env python -import os import nose -import sys -sys.path.append("") - -# setup cassandra -from cqlengine import connection - -try: - CASSANDRA_VERSION = int(os.environ["CASSANDRA_VERSION"]) -except: - print("CASSANDRA_VERSION must be set as an environment variable. One of (12, 20, 21)") - raise - -if os.environ.get('CASSANDRA_TEST_HOST'): - CASSANDRA_TEST_HOST = os.environ['CASSANDRA_TEST_HOST'] -else: - CASSANDRA_TEST_HOST = 'localhost' - -if CASSANDRA_VERSION < 20: - protocol_version = 1 -else: - protocol_version = 2 - -connection.setup([CASSANDRA_TEST_HOST], protocol_version=protocol_version, default_keyspace='cqlengine_test') nose.main()
remove connecting to cassandra in test script since nose handles it in setup_package
cqlengine_cqlengine
train
py
88a226b82ec47c04a06b321063e5fa862ac2d75e
diff --git a/ghost/admin/views/editor.js b/ghost/admin/views/editor.js index <HASH>..<HASH> 100644 --- a/ghost/admin/views/editor.js +++ b/ghost/admin/views/editor.js @@ -254,7 +254,7 @@ // Add the container view for the Publish Bar this.addSubview(new PublishBar({el: "#publish-bar", model: this.model})).render(); - this.$('#entry-title').val(this.model.get('title')); + this.$('#entry-title').val(this.model.get('title')).focus(); this.$('#entry-markdown').html(this.model.get('markdown')); this.initMarkdown();
Automatically focus title on editor closes #<I>
TryGhost_Ghost
train
js
871979abd6cb170315b926696fd26e4894e503c8
diff --git a/src/ocrmypdf/pipeline.py b/src/ocrmypdf/pipeline.py index <HASH>..<HASH> 100644 --- a/src/ocrmypdf/pipeline.py +++ b/src/ocrmypdf/pipeline.py @@ -1055,9 +1055,8 @@ def metadata_fixup( _do_merge_ghostscript([layers_file, ps], output_file, log, context) elif fitz: _do_merge_mupdf([layers_file], metadata_file, output_file, log, context) - #re_symlink(layers_file, output_file, log) else: - pass + re_symlink(layers_file, output_file, log) def _do_merge_ghostscript(
Temporarily unbreak without fitz mode
jbarlow83_OCRmyPDF
train
py
8ccb80bcea43fe2d1dee422aaf8ec761253152a5
diff --git a/drivers/docker/docklog/docker_logger_test.go b/drivers/docker/docklog/docker_logger_test.go index <HASH>..<HASH> 100644 --- a/drivers/docker/docklog/docker_logger_test.go +++ b/drivers/docker/docklog/docker_logger_test.go @@ -21,12 +21,20 @@ func TestDockerLogger(t *testing.T) { t.Skip("docker unavailable:", err) } + err = client.PullImage(docker.PullImageOptions{ + Repository: "alpine", + Tag: "latest", + }, docker.AuthConfiguration{}) + if err != nil { + t.Fatalf("failed to pull image: %v", err) + } + containerConf := docker.CreateContainerOptions{ Config: &docker.Config{ Cmd: []string{ "/bin/ash", "-c", "touch /tmp/docklog; tail -f /tmp/docklog", }, - Image: "alpine", + Image: "alpine:latest", }, Context: context.Background(), }
pull alpine image needed for test The test requires the image to be present locally, so importing it as part of setup.
hashicorp_nomad
train
go
bbc8b01f88bccc70d5d327db6f638636a89081f2
diff --git a/decoder.go b/decoder.go index <HASH>..<HASH> 100644 --- a/decoder.go +++ b/decoder.go @@ -72,7 +72,8 @@ func (r *Decoder) readSlice(delim byte) (data []byte, err error) { return } -// DecodeNext returns the next available object stored in the rencode stream +// DecodeNext returns the next available object stored in the rencode stream. +// If no more objects are available, an io.EOF error will be returned. func (r *Decoder) DecodeNext() (interface{}, error) { typeCode, err := r.readByte() if err != nil {
Add precisation about termination of stream of objects (pmezard)
gdm85_go-rencode
train
go
b2feaee3cd07e19600cf1e920fcc1a2bb884839f
diff --git a/tests/Unit/Drivers/VarDriverTest.php b/tests/Unit/Drivers/VarDriverTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/Drivers/VarDriverTest.php +++ b/tests/Unit/Drivers/VarDriverTest.php @@ -61,6 +61,15 @@ class VarDriverTest extends TestCase '', ]); + if (version_compare(PHP_VERSION, '7.3.0') >= 0) { + $expected = implode(PHP_EOL, [ + '<?php return (object) array(', + " 'foo' => 'bar',", + ');', + '', + ]); + } + $this->assertEquals($expected, $driver->serialize((object) ['foo' => 'bar'])); }
Update VarDriverTest for PHP <I> Update using version compare for greater than <I>
spatie_phpunit-snapshot-assertions
train
php