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
232e2d1d6107757734b74fd68f775c6acbef78fa
diff --git a/lib/moped/query.rb b/lib/moped/query.rb index <HASH>..<HASH> 100644 --- a/lib/moped/query.rb +++ b/lib/moped/query.rb @@ -99,7 +99,16 @@ module Moped # @return [Hash] the first document that matches the selector. def first - limit(-1).each.first + reply = session.context.query( + operation.database, + operation.collection, + operation.selector, + fields: operation.fields, + flags: operation.flags, + skip: operation.skip, + limit: -1 + ) + reply.documents.first end alias one first
Query#first uses session context for query
mongoid_moped
train
rb
e86fefa709965ccaf67cef371ca2041786161b17
diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -350,7 +350,12 @@ class ContainerBuilder extends Container implements TaggedContainerInterface $this->loading[$id] = true; - $service = $this->createService($definition, $id); + try { + $service = $this->createService($definition, $id); + } catch (\Exception $e) { + unset($this->loading[$id]); + throw $e; + } unset($this->loading[$id]);
Unset loading[$id] in ContainerBuilder on exception
symfony_symfony
train
php
78e6e1e53e77158d2dadb9ffd7e739a71a915fed
diff --git a/src/test/java/software/coolstuff/springframework/owncloud/service/AbstractOwncloudResourceServiceTest.java b/src/test/java/software/coolstuff/springframework/owncloud/service/AbstractOwncloudResourceServiceTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/software/coolstuff/springframework/owncloud/service/AbstractOwncloudResourceServiceTest.java +++ b/src/test/java/software/coolstuff/springframework/owncloud/service/AbstractOwncloudResourceServiceTest.java @@ -333,6 +333,7 @@ public abstract class AbstractOwncloudResourceServiceTest { byte[] actual = IOUtils.toByteArray(input); byte[] expected = owncloudFileResource.getTestFileContent().getBytes(); assertThat(actual).isEqualTo(expected); + input.close(); // Call Close twice to check, if we don't get any Thread-Deadlocks } check_getInputStream_OK(); } @@ -384,6 +385,7 @@ public abstract class AbstractOwncloudResourceServiceTest { prepare_getOutputStream_OK(owncloudFileResource); try (OutputStream output = resourceService.getOutputStream(owncloudFileResource)) { IOUtils.write(owncloudFileResource.getTestFileContent(), output, Charset.forName("utf8")); + output.close(); // Call Close twice to check, if we don't get any Thread-Deadlocks } finally { check_getOutputStream_OK(owncloudFileResource); }
test call close() on SynchronizedPiped*Stream twice
coolstuffsoftware_owncloud-spring-boot-starter
train
java
ff9187e9fa3c4d523227e00bef4a99acc2fb56c5
diff --git a/lib/sass/script/parser.rb b/lib/sass/script/parser.rb index <HASH>..<HASH> 100644 --- a/lib/sass/script/parser.rb +++ b/lib/sass/script/parser.rb @@ -295,11 +295,26 @@ RUBY end def arglist + if kw_args = keyword_arglist + return [kw_args] + end return unless e = interpolation return [e] unless try_tok(:comma) [e, *assert_expr(:arglist)] end + def keyword_arglist + return unless var = try_tok(:const) + unless try_tok(:colon) + return_tok! + return + end + name = var[1] + value = interpolation + return {name => value} unless try_tok(:comma) + {name => value}.merge(assert_expr(:keyword_arglist)) + end + def raw return special_fun unless tok = try_tok(:raw) node(Script::String.new(tok.value))
Parse mixin includes with keyword style argument lists
sass_ruby-sass
train
rb
893efd6fcd4488ba9ce07279765380746e69f423
diff --git a/spec/support/rollbar_api.rb b/spec/support/rollbar_api.rb index <HASH>..<HASH> 100644 --- a/spec/support/rollbar_api.rb +++ b/spec/support/rollbar_api.rb @@ -1,10 +1,15 @@ require 'rack/request' class RollbarAPI + + UNAUTHORIZED_ACCESS_TOKEN = 'unauthorized' + def call(env) request = Rack::Request.new(env) json = JSON.parse(request.body.read) + return unauthorized(json) unless authorized?(json) + return bad_request(json) unless invalid_data?(json) success(json) @@ -12,6 +17,10 @@ class RollbarAPI protected + def authorized?(json) + json['access_token'] != UNAUTHORIZED_ACCESS_TOKEN + end + def response_headers { 'Content-Type' => 'application/json' @@ -22,6 +31,10 @@ class RollbarAPI !!json['access_token'] end + def unauthorized(json) + [401, response_headers, [unauthorized_body]] + end + def bad_request(json) [400, response_headers, [bad_request_body]] end @@ -30,6 +43,10 @@ class RollbarAPI [200, response_headers, [success_body(json)]] end + def unauthorized_body + result(1, nil, 'invalid access token') + end + def bad_request_body result(1, nil, 'bad request') end
<I>: add support for unauthorized access token simulation
rollbar_rollbar-gem
train
rb
2c00a6a647a402084bf59d1c9ebf7728c2492944
diff --git a/lib/cide/cli.rb b/lib/cide/cli.rb index <HASH>..<HASH> 100644 --- a/lib/cide/cli.rb +++ b/lib/cide/cli.rb @@ -69,7 +69,7 @@ module CIDE create_tmp_file DOCKERFILE, config.to_dockerfile - docker :build, '--force-rm', '-t', tag, '.' + docker :build, '--force-rm', '-f', DOCKERFILE, '-t', tag, '.' return unless config.export diff --git a/lib/cide/constants.rb b/lib/cide/constants.rb index <HASH>..<HASH> 100644 --- a/lib/cide/constants.rb +++ b/lib/cide/constants.rb @@ -1,6 +1,6 @@ module CIDE DIR = File.expand_path('..', __FILE__) - DOCKERFILE = 'Dockerfile' + DOCKERFILE = 'Dockerfile.cide' TEMP_SSH_KEY = 'id_rsa.tmp' SSH_CONFIG_FILE = 'ssh_config' SSH_CONFIG_PATH = File.join(DIR, 'cide', SSH_CONFIG_FILE)
Avoid name clashes with projects who have a Dockerfile already
pusher_cide
train
rb,rb
e70de9ce4db46cf3a4c0eb8d6a3a3e80ebe47aa7
diff --git a/metrique/client/cubes/basesql.py b/metrique/client/cubes/basesql.py index <HASH>..<HASH> 100644 --- a/metrique/client/cubes/basesql.py +++ b/metrique/client/cubes/basesql.py @@ -322,7 +322,7 @@ class BaseSql(BaseCube): ''' if id_delta: if type(id_delta) is list: - id_delta = ','.join(map(str, id_delta)) + id_delta = ','.join(map(str, set(id_delta))) return ["(%s.%s IN (%s))" % (table, column, id_delta)] else: return [] @@ -369,7 +369,7 @@ class BaseSql(BaseCube): table = self.get_property('table') _id = self.get_property('column') - sql = """SELECT %s.%s FROM %s.%s + sql = """SELECT DISTINCT %s.%s FROM %s.%s WHERE %s""" % (table, _id, db, table, ' OR '.join(filters)) rows = self.proxy.fetchall(sql)
id_delta should be distinct set of object ids
kejbaly2_metrique
train
py
fd24072763fc98c5fde1c29c9af592ba23c66afd
diff --git a/refcycle/__init__.py b/refcycle/__init__.py index <HASH>..<HASH> 100644 --- a/refcycle/__init__.py +++ b/refcycle/__init__.py @@ -116,7 +116,6 @@ def snapshot(): [ obj for obj in all_objects if obj is not this_frame - if obj is not all_objects ] ) del this_frame, all_objects
Remove an unnecessary 'if' clause from 'snapshot'.
mdickinson_refcycle
train
py
17dbe502e706c349412f12fd880669d99921269e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ setup( 'pytz==2015.7', 'python-dateutil==2.5.3', 'django-bootstrap-form==3.2.1', - 'seed-services-client>=0.15.0', + 'seed-services-client>=0.17.0', 'go-http==0.3.0', 'openpyxl==2.4.0', 'attrs==16.3.0',
New version of seed-services-client for inbound message listing
praekeltfoundation_seed-control-interface
train
py
98b88ea25e8ba84ad5222b78ee598f32e4d72020
diff --git a/Tests/Fixtures/FOSUser.php b/Tests/Fixtures/FOSUser.php index <HASH>..<HASH> 100644 --- a/Tests/Fixtures/FOSUser.php +++ b/Tests/Fixtures/FOSUser.php @@ -56,7 +56,7 @@ class FOSUser extends BaseUser public function getRoles() { - return []; + return ['ROLE_USER']; } public function getPassword() diff --git a/Tests/Fixtures/User.php b/Tests/Fixtures/User.php index <HASH>..<HASH> 100644 --- a/Tests/Fixtures/User.php +++ b/Tests/Fixtures/User.php @@ -29,7 +29,7 @@ class User implements UserInterface public function getRoles() { - return []; + return ['ROLE_USER']; } public function getPassword()
Add roles in tests users Symfony changed and now does not authorize users without roles.
hwi_HWIOAuthBundle
train
php,php
09629b68d34f743f23430e3d6cccb05ac47d9b5d
diff --git a/src/config.js b/src/config.js index <HASH>..<HASH> 100644 --- a/src/config.js +++ b/src/config.js @@ -21,7 +21,7 @@ var defaults = module.exports = { styles: '$STYLES$', strings: { - button: 'Check Out with <img src="http://minicartjs.com/images/paypal_65x18.png" width="65" height="18" alt="PayPal" />', + button: 'Check Out with <img src="//cdnjs.cloudflare.com/ajax/libs/minicart/3.0.1/paypal_65x18.png" width="65" height="18" alt="PayPal" />', subtotal: 'Subtotal:', discount: 'Discount:', processing: 'Processing...'
Using cdnjs button image for HTTP/S support; #<I>
jeffharrell_minicart
train
js
9f3acfc73658b59341f88f6a76b92f008b0a8cb2
diff --git a/lib/merb-core/core_ext/hash.rb b/lib/merb-core/core_ext/hash.rb index <HASH>..<HASH> 100644 --- a/lib/merb-core/core_ext/hash.rb +++ b/lib/merb-core/core_ext/hash.rb @@ -400,6 +400,18 @@ end class ToHashParser # :nodoc: def self.from_xml(xml) + if defined?(Hpricot) + # TODO: actually use Hpricot which is + # many times faster than REXML + # and is not cracked up in recent + # Ruby 1.8.x branch releases. + self.from_xml_with_rexml(xml) + else + self.from_xml_with_rexml(xml) + end + end + + def self.from_xml_with_rexml(xml) stack = [] parser = REXML::Parsers::BaseParser.new(xml)
Refactor ToHashParser#from_xml a bit to be able to use parser faster than REXML. It is planned to support Hpricot and fall back to REXML.
wycats_merb
train
rb
f5e8998aaa80540aae94b39f2e7ad9ece4dd5c4a
diff --git a/xchange-cryptsy/src/main/java/com/xeiam/xchange/cryptsy/CryptsyAdapters.java b/xchange-cryptsy/src/main/java/com/xeiam/xchange/cryptsy/CryptsyAdapters.java index <HASH>..<HASH> 100644 --- a/xchange-cryptsy/src/main/java/com/xeiam/xchange/cryptsy/CryptsyAdapters.java +++ b/xchange-cryptsy/src/main/java/com/xeiam/xchange/cryptsy/CryptsyAdapters.java @@ -211,7 +211,7 @@ public final class CryptsyAdapters { tradesList.add(adaptTrade(trade, currencyPair)); } } - trades.put(currencyPair, new Trades(tradesList, lastTradeId, TradeSortType.SortByTimestamp)); + trades.put(currencyPair, new Trades(tradesList, lastTradeId, TradeSortType.SortByID)); } return trades;
Change cryptsy public trade sorting back to by id.
knowm_XChange
train
java
4e9848948a9fab30a538080081d8f61d0d7bba76
diff --git a/jupytext/cli.py b/jupytext/cli.py index <HASH>..<HASH> 100644 --- a/jupytext/cli.py +++ b/jupytext/cli.py @@ -416,7 +416,7 @@ def jupytext(args=None): for pattern in args.notebooks: if "*" in pattern or "?" in pattern: # Exclude the .jupytext.py configuration file - notebooks.extend(glob.glob(pattern)) + notebooks.extend(glob.glob(pattern, recursive=True)) else: notebooks.append(pattern)
feat: add recursive glob option (#<I>) Sure that will be useful! Thank you @b4nst
mwouts_jupytext
train
py
4ef429f47997e3f0558104659af54db89ba8d699
diff --git a/lib/jenkins_api_client/client.rb b/lib/jenkins_api_client/client.rb index <HASH>..<HASH> 100644 --- a/lib/jenkins_api_client/client.rb +++ b/lib/jenkins_api_client/client.rb @@ -35,7 +35,7 @@ require 'logger' # module JenkinsApi # This is the client class that acts as the bridge between the subclasses and - # Jnekins. This class contains methods that performs GET and POST requests + # Jenkins. This class contains methods that performs GET and POST requests # for various operations. # class Client @@ -101,7 +101,7 @@ module JenkinsApi end end if args.is_a? Hash - # Server IP or Server URL must be specifiec + # Server IP or Server URL must be specific unless @server_ip || @server_url raise ArgumentError, "Server IP or Server URL is required to connect" + " to Jenkins" @@ -263,6 +263,7 @@ module JenkinsApi http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end + http.read_timeout = @timeout response = http.request(request) case response
Use the client timeout setting as http read_timeout
arangamani_jenkins_api_client
train
rb
e3ac302ecb861958c372cff13a699090d79dfa9e
diff --git a/cmd/open.go b/cmd/open.go index <HASH>..<HASH> 100644 --- a/cmd/open.go +++ b/cmd/open.go @@ -6,12 +6,37 @@ package cmd -import "github.com/tsuru/tsuru/exec" +import ( + "fmt" + "strings" + "golang.org/x/sys/unix" + "github.com/tsuru/tsuru/exec" +) + +func isWSL() bool { + var u unix.Utsname + err := unix.Uname(&u) + if err != nil { + fmt.Println(err) + return false + } + release := strings.ToLower(string(u.Release[:])) + return strings.Contains(release, "microsoft") +} func open(url string) error { + + cmd := "xdg-open" + args := []string{url} + + if(isWSL()){ + cmd = "powershell.exe" + args = []string{"-c", "start", url} + } + opts := exec.ExecuteOptions{ - Cmd: "xdg-open", - Args: []string{url}, + Cmd: cmd, + Args: args, } return executor().Execute(opts) }
feat: Adding WSL2 oauth support
tsuru_tsuru
train
go
54cb2370fdf39db1cb084a8bf4a1c92546eab6a4
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ var randomBytes = require('randombytes') var unorm = require('unorm') var DEFAULT_WORDLIST = require('./wordlists/en.json') +var JAPANESE_WORDLIST = require('./wordlists/ja.json') function mnemonicToSeed(mnemonic, password) { var mnemonicBuffer = new Buffer(mnemonic, 'utf8') @@ -124,6 +125,7 @@ module.exports = { generateMnemonic: generateMnemonic, validateMnemonic: validateMnemonic, wordlists: { - EN: DEFAULT_WORDLIST + EN: DEFAULT_WORDLIST, + JA: JAPANESE_WORDLIST } }
Expose Japanese wordlist for use
bitcoinjs_bip39
train
js
7187bc3cf51d5c4db3982b44bb51c24574559484
diff --git a/tests/unit/core/oxarticleTest.php b/tests/unit/core/oxarticleTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/core/oxarticleTest.php +++ b/tests/unit/core/oxarticleTest.php @@ -2103,6 +2103,25 @@ class Unit_Core_oxArticleTest extends OxidTestCase $this->assertEquals(1, count($oAmPriceList)); } + public function testLoadAmountPriceInfoToGetBruttoAndNetto() + { + /** @var oxBase $item */ + $item = oxNew('oxBase'); + + /** @var oxAmountPriceList $amountPriceList */ + $amountPriceList = oxNew('oxAmountPriceList'); + $amountPriceList->assign(array($item)); + + /** @var oxArticle|PHPUnit_Framework_TestCase $article */ + $article = oxNew('oxArticle'); + $article->setAmountPriceList($amountPriceList); + $article->oxarticles__oxprice = new oxField(10, oxField::T_RAW); + $priceList = $article->loadAmountPriceInfo(); + + $this->assertEquals('10,00', $priceList[0]->fbrutprice, 'Brut price was not loaded.'); + $this->assertEquals('10,00', $priceList[0]->fnetprice, 'Net price was not loaded.'); + } + /** * Test get sql active snippet. *
Add unit test for PR #<I> Add unit tests which checks if brutto and netto prices are set when loadAmountPriceInfo is called.
OXID-eSales_oxideshop_ce
train
php
9ec7073febacc39ca9e3fdd02e401226218e0422
diff --git a/abilian/web/admin/panels/login_sessions.py b/abilian/web/admin/panels/login_sessions.py index <HASH>..<HASH> 100644 --- a/abilian/web/admin/panels/login_sessions.py +++ b/abilian/web/admin/panels/login_sessions.py @@ -25,7 +25,7 @@ class LoginSessionsPanel(AdminPanel): for session in sessions: country = "Country unknown" - if geoip: + if geoip and session.ip_address: country = geoip.country_name_by_addr(session.ip_address) or country session.country = country
admin panel login sessions: don't break when ip_address is unknown
abilian_abilian-core
train
py
1ad1c08c4f7ee09fcdd3dca31f8f31db7cacd3b0
diff --git a/androidsvg/src/main/java/com/caverock/androidsvg/utils/SVGParserImpl.java b/androidsvg/src/main/java/com/caverock/androidsvg/utils/SVGParserImpl.java index <HASH>..<HASH> 100644 --- a/androidsvg/src/main/java/com/caverock/androidsvg/utils/SVGParserImpl.java +++ b/androidsvg/src/main/java/com/caverock/androidsvg/utils/SVGParserImpl.java @@ -3789,6 +3789,7 @@ class SVGParserImpl implements SVGParser } path.lineTo(x, currentY); currentX = lastControlX = x; + lastControlY = currentY; break; // Vertical line @@ -3803,6 +3804,7 @@ class SVGParserImpl implements SVGParser y += currentY; } path.lineTo(currentX, y); + lastControlX = currentX; currentY = lastControlY = y; break;
Issue <I> S/s and T/t path commands were not being handled correctly if they were preceded by a V/v or H/h command. The cause was due to the lastControlX/lastControlY variables not being updated correctly in the V/v/H/h command handling.
BigBadaboom_androidsvg
train
java
47aeec301d9c28ff7ea53428fdd51a3f6a4cbbf8
diff --git a/tasker/ui.js b/tasker/ui.js index <HASH>..<HASH> 100644 --- a/tasker/ui.js +++ b/tasker/ui.js @@ -20,6 +20,7 @@ gulp.task('ui:compile', function (cb) { cb(); }); +// DEPRECATED gulp.task('ui:compileui', function (cb) { utils.error('Task \'ui:compileui\' no longer exists. It has been replaced by `ui:compile`.'); utils.log('Please run `fp ui:compile` or better yet, `fp update`.');
added "DEPRECATED" comment
electric-eloquence_fepper-npm
train
js
467d7de4e5e1d2fab8c9dbce2ff48acea482ce8b
diff --git a/tests/unit/modules/pip_test.py b/tests/unit/modules/pip_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/pip_test.py +++ b/tests/unit/modules/pip_test.py @@ -345,6 +345,16 @@ class PipTestCase(TestCase): cwd=None ) + def test_extra_index_url_argument_in_resulting_command(self): + mock = MagicMock(return_value={'retcode': 0, 'stdout': ''}) + with patch.dict(pip.__salt__, {'cmd.run_all': mock}): + pip.install('pep8', extra_index_url='http://foo.tld') + mock.assert_called_once_with( + 'pip install --extra-index-url=\'http://foo.tld\' pep8', + runas=None, + cwd=None + ) + if __name__ == '__main__': from integration import run_tests run_tests(PipTestCase, needs_daemon=False)
Added a mocked test case for `--extra-index-url` passing to `pip install`.
saltstack_salt
train
py
5c2b2fcf03a29fe3b351753be2162e438c540c10
diff --git a/tools.py b/tools.py index <HASH>..<HASH> 100644 --- a/tools.py +++ b/tools.py @@ -9,6 +9,17 @@ class Tool(object): def __init__(self, command_executor): self.executor = command_executor + def process_line(self, line): + return [] + + def get_file_extension(self): + """ + Returns a list of file extensions this tool should run against. + + eg: ['.py', '.js'] + """ + return [''] + def invoke(self, dirname, filenames=set()): """ Returns results in the format of:
A maybe-start to a better API?
justinabrahms_imhotep
train
py
d3b160010e220e7c95dde1f81428ed1654ff4570
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index <HASH>..<HASH> 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -687,6 +687,14 @@ def server_jobspec(language, docker_image, insecure=False, manual_cmd_log=None): itertools.chain.from_iterable(('-p', str(_DEFAULT_SERVER_PORT + i)) for i in range( len(_HTTP2_BADSERVER_TEST_CASES)))) + # Enable docker's healthcheck mechanism. + # This runs a Python script inside the container every second. The script + # pings the http2 server to verify it is ready. The 'health-retries' flag + # specifies the number of consecutive failures before docker will report + # the container's status as 'unhealthy'. Prior to the first 'health_retries' + # failures or the first success, the status will be 'starting'. 'docker ps' + # or 'docker inspect' can be used to see the health of the container on the + # command line. docker_args += [ '--health-cmd=python test/http2_test/http2_server_health_check.py ' '--server_host=%s --server_port=%d'
add comments for health check docker flags
grpc_grpc
train
py
b6a2c1c721507ac17aa68206c7adda363d7e9c3f
diff --git a/lib/lwm2m.js b/lib/lwm2m.js index <HASH>..<HASH> 100644 --- a/lib/lwm2m.js +++ b/lib/lwm2m.js @@ -145,9 +145,6 @@ export default function(RED) { }); if (self.internalEventBus.emit('resolveClientName', { clientName: self.clientName, - serverId: self.serverId, - serverHost: self.serverHost, - serverPort: self.serverPort, enableDTLS: self.enableDTLS })) { self.log(`Resolving ClientName...`); @@ -210,10 +207,7 @@ export default function(RED) { this.warn(e); } if (this.internalEventBus) { - this.internalEventBus.emit(ev, { - serverHost: this.serverHost, - serverPort: this.serverPort, - }); + this.internalEventBus.emit(ev); } }); });
Strip server host and port from event arguments as they're not correct when bootstrap is enabled
CANDY-LINE_node-red-contrib-lwm2m
train
js
e9d0706f8d07c2e939bc064036012d5bd8e16a0c
diff --git a/src/Hal/Application/Config/Validator.php b/src/Hal/Application/Config/Validator.php index <HASH>..<HASH> 100644 --- a/src/Hal/Application/Config/Validator.php +++ b/src/Hal/Application/Config/Validator.php @@ -36,7 +36,7 @@ class Validator $config->set('exclude', array_filter(explode(',', $config->get('exclude')))); // parameters with values - $keys = ['report-html', 'report-csv', 'report-violation', 'extensions']; + $keys = ['report-html', 'report-csv', 'report-violation', '--report-json', 'extensions']; foreach ($keys as $key) { $value = $config->get($key); if ($config->has($key) && empty($value) || true === $value) {
added the key --report-json to validator
phpmetrics_PhpMetrics
train
php
55c8d4dff14b26291af62f86e96b324716f75e01
diff --git a/tests/test_oauth_client.py b/tests/test_oauth_client.py index <HASH>..<HASH> 100644 --- a/tests/test_oauth_client.py +++ b/tests/test_oauth_client.py @@ -68,7 +68,7 @@ class TestOAuthClient(unittest.TestCase): c = OAuthClient(instance="test", client_id="test1", client_secret="test2", session="testsess", user="testuser", password="testpass") - self.assertIsInstance(c.session, OAuth2Session) + self.assertEqual(isinstance(c.session, OAuth2Session), True) self.assertEqual(c._user, None) self.assertEqual(c._password, None) @@ -86,7 +86,7 @@ class TestOAuthClient(unittest.TestCase): c.set_token(self.mock_token) self.assertEqual(c.token, self.mock_token) - self.assertIsInstance(c.session, OAuth2Session) + self.assertEqual(isinstance(c.session, OAuth2Session), True) def test_request_without_token(self): """OauthClient should raise MissingToken when creating query if no token has been set"""
Replaced assertIsInstance() with assertEqual() with isinstance for python <I> compatibility
rbw_pysnow
train
py
dcb18134be75f4d815f369eadec8734c4f24b3a3
diff --git a/server/cells.go b/server/cells.go index <HASH>..<HASH> 100644 --- a/server/cells.go +++ b/server/cells.go @@ -45,7 +45,7 @@ func newCellResponse(dID chronograf.DashboardID, cell chronograf.DashboardCell) for _, lbl := range []string{"x", "y", "y2"} { if _, found := newAxes[lbl]; !found { newAxes[lbl] = chronograf.Axis{ - Bounds: []string{}, + Bounds: []string{"", ""}, } } } @@ -354,6 +354,13 @@ func (s *Service) ReplaceDashboardCell(w http.ResponseWriter, r *http.Request) { return } + for i, a := range cell.Axes { + if len(a.Bounds) == 0 { + a.Bounds = []string{"", ""} + cell.Axes[i] = a + } + } + if err := ValidDashboardCellRequest(&cell); err != nil { invalidData(w, err, s.Logger) return
make empty axes bounds [,] instead of []
influxdata_influxdb
train
go
567831a9c640914520e63896fbd9baf3ef63cf08
diff --git a/lib/Slackbot_worker.js b/lib/Slackbot_worker.js index <HASH>..<HASH> 100755 --- a/lib/Slackbot_worker.js +++ b/lib/Slackbot_worker.js @@ -163,6 +163,7 @@ module.exports = function(botkit, config) { pingIntervalId = setInterval(function() { if (lastPong && lastPong + 12000 < Date.now()) { var err = new Error('Stale RTM connection, closing RTM'); + botkit.log.error(err) bot.closeRTM(err); return; }
Log the error when the ping/pong times out
howdyai_botkit
train
js
765a015008774903d3b2210b00bf78567cfe5b79
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,8 @@ module.exports = function (source, destination, methods) { methods = Object.keys(source) } + if (typeof source === 'function') destination = thenify(source) + methods.forEach(function (name) { // promisify only if it's a function if (typeof source[name] === 'function') destination[name] = thenify(source[name])
add check if `source` is function, then thenify it
thenables_thenify-all
train
js
bc2cc00f3b181c02549edca0320ef1c53984091b
diff --git a/examples/active-links/app.js b/examples/active-links/app.js index <HASH>..<HASH> 100644 --- a/examples/active-links/app.js +++ b/examples/active-links/app.js @@ -44,6 +44,7 @@ class Users extends React.Component { return ( <div> <h2>Users</h2> + {this.props.children} </div> ) }
Render user information when under user route I find that when it match the route "/users/ryan", it should show the user's id, but it won't. I think the "Users" should render its children node, so I add some code to achieve this.
taion_rrtr
train
js
cd5a87de4d0240cd78b2f3e88258840862d92aaf
diff --git a/ceph_deploy/tests/unit/test_conf.py b/ceph_deploy/tests/unit/test_conf.py index <HASH>..<HASH> 100644 --- a/ceph_deploy/tests/unit/test_conf.py +++ b/ceph_deploy/tests/unit/test_conf.py @@ -127,3 +127,21 @@ class TestConfGetList(object): """)) cfg.readfp(conf_file) assert cfg.get_list('foo', 'key') == ['1', '3', '4'] + + def test_get_default_repo(self): + cfg = conf.cephdeploy.Conf() + conf_file = StringIO(dedent(""" + [foo] + default = True + """)) + cfg.readfp(conf_file) + assert cfg.get_default_repo() == 'foo' + + def test_get_default_repo_fails_non_truthy(self): + cfg = conf.cephdeploy.Conf() + conf_file = StringIO(dedent(""" + [foo] + default = 0 + """)) + cfg.readfp(conf_file) + assert cfg.get_default_repo() is False
add a few tests for the truthy default
ceph_ceph-deploy
train
py
95e04984fc58c75b7c6dd1ceeab5aa0baf63cc18
diff --git a/allauth/socialaccount/fields.py b/allauth/socialaccount/fields.py index <HASH>..<HASH> 100644 --- a/allauth/socialaccount/fields.py +++ b/allauth/socialaccount/fields.py @@ -58,10 +58,3 @@ class JSONField(models.TextField): def value_from_object(self, obj): """Return value dumped to string.""" return self.get_prep_value(self._get_val_from_obj(obj)) - - -try: - from south.modelsinspector import add_introspection_rules - add_introspection_rules([], ["^allauth\.socialaccount\.fields\.JSONField"]) -except: - pass diff --git a/allauth/socialaccount/migrations/__init__.py b/allauth/socialaccount/migrations/__init__.py index <HASH>..<HASH> 100644 --- a/allauth/socialaccount/migrations/__init__.py +++ b/allauth/socialaccount/migrations/__init__.py @@ -1,5 +0,0 @@ -try: - from django.db import migrations # noqa -except ImportError: - from django.core.exceptions import ImproperlyConfigured - raise ImproperlyConfigured('Please upgrade to south >= 1.0')
chore: Remove obsolete references to south (#<I>)
pennersr_django-allauth
train
py,py
45132c3075fe09eae5fcbe4d4dc7938150f29272
diff --git a/utils/htmlWriter.js b/utils/htmlWriter.js index <HASH>..<HASH> 100644 --- a/utils/htmlWriter.js +++ b/utils/htmlWriter.js @@ -61,7 +61,9 @@ function writeResourceHtml (resource, endpoints) { } function writeEndpointHtml (endpoint) { - var cssEndpoint = endpoint.endpoint.split('/').concat(endpoint.method).join('-'); + var cssEndpoint = endpoint.endpoint.split('/').map(function (elem) { + return elem.split('?')[0]; + }).concat(endpoint.method).join('-'); return htmlHelpers.wrapInDiv( htmlHelpers.wrapInDivWithProps( htmlHelpers.wrapInSubtitle(
removing query params from endpoint when creating css endpoint class
Wolox_dictum.js
train
js
c3ae56565bbe05c9809c5ad1192fcfc3ae717114
diff --git a/util/errors/errors.go b/util/errors/errors.go index <HASH>..<HASH> 100644 --- a/util/errors/errors.go +++ b/util/errors/errors.go @@ -16,6 +16,13 @@ import ( argoerrs "github.com/argoproj/argo-workflows/v3/errors" ) +func IgnoreContainerNotFoundErr(err error) error { + if err != nil && strings.Contains(err.Error(), "container not found") { + return nil + } + return err +} + func IsTransientErr(err error) bool { if err == nil { return false diff --git a/workflow/controller/controller.go b/workflow/controller/controller.go index <HASH>..<HASH> 100644 --- a/workflow/controller/controller.go +++ b/workflow/controller/controller.go @@ -552,7 +552,7 @@ func (wfc *WorkflowController) signalContainers(namespace string, podName string if c.State.Terminated != nil { continue } - if err := signal.SignalContainer(wfc.restConfig, pod, c.Name, sig); err != nil { + if err := signal.SignalContainer(wfc.restConfig, pod, c.Name, sig); errorsutil.IgnoreContainerNotFoundErr(err) != nil { return 0, err } }
fix: Do not log container not found (#<I>)
argoproj_argo
train
go,go
ccfd2160b9342646df9d229d08617b68e2a49049
diff --git a/db/migrate/20100321134138_base.rb b/db/migrate/20100321134138_base.rb index <HASH>..<HASH> 100644 --- a/db/migrate/20100321134138_base.rb +++ b/db/migrate/20100321134138_base.rb @@ -45,7 +45,7 @@ class Base < ActiveRecord::Migration create_table :elements_text_element_translations do |t| t.references :"#{Humpyard::config.table_name_prefix}elements_text_element" t.string :locale - t.text :text + t.text :content t.timestamps end end
Fixed another migration issue Arg - should run tests when playing with db migrate ;)
humpyard_humpyard
train
rb
64cf5de06fa5c35f2df999ca9fa3e43ee88dc0fa
diff --git a/tiebreaker.js b/tiebreaker.js index <HASH>..<HASH> 100644 --- a/tiebreaker.js +++ b/tiebreaker.js @@ -80,7 +80,9 @@ var updateSeedAry = function (seedAry, match) { // Interface //------------------------------------------------------------------ -function TieBreaker(oldRes, posAry, limit) { +// TODO: opts.nonStrict default false +// TODO: opts.mode default FFA (should be able to GS replace if nonStrict) +function TieBreaker(oldRes, posAry, limit, opts) { if (!(this instanceof TieBreaker)) { return new TieBreaker(oldRes, limit); }
an idea that could make TieBreaker a very very general way to solve all this shit
clux_tiebreaker
train
js
0206252c25e2ad90b6e6d76c39e28cfd9b0a9a78
diff --git a/src/test/java/org/roaringbitmap/buffer/TestMemoryMapping.java b/src/test/java/org/roaringbitmap/buffer/TestMemoryMapping.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/roaringbitmap/buffer/TestMemoryMapping.java +++ b/src/test/java/org/roaringbitmap/buffer/TestMemoryMapping.java @@ -269,9 +269,8 @@ public class TestMemoryMapping { ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); RoaringBitmap newr = new RoaringBitmap(); newr.deserialize(new DataInputStream(bis)); - int[] content = newr.toArray(); - int[] oldcontent = rr.toArray(); - Assert.assertTrue(Arrays.equals(content, oldcontent)); + RoaringBitmap rrasroaring = rr.toRoaringBitmap(); + Assert.assertEquals(newr,rrasroaring); } } @@ -475,7 +474,7 @@ public class TestMemoryMapping { static MappedByteBuffer out; - static ArrayList<MutableRoaringBitmap> rambitmaps = new ArrayList<MutableRoaringBitmap>(); +// static ArrayList<MutableRoaringBitmap> rambitmaps = new ArrayList<MutableRoaringBitmap>(); static File tmpfile; }
Rewrote unit test slightly differently to reduce memory usage.
RoaringBitmap_RoaringBitmap
train
java
17130cddf31c4eeec5f63845f22f9b7313599a01
diff --git a/lib/fake_web.rb b/lib/fake_web.rb index <HASH>..<HASH> 100644 --- a/lib/fake_web.rb +++ b/lib/fake_web.rb @@ -110,11 +110,11 @@ module FakeWeb # Passing <tt>:status</tt> as a two-value array will set the response code # and message. The defaults are <tt>200</tt> and <tt>OK</tt>, respectively. # Example: - # FakeWeb.register_uri("http://www.example.com/", :body => "Go away!", :status => [404, "Not Found"]) + # FakeWeb.register_uri(:get, "http://example.com", :body => "Go away!", :status => [404, "Not Found"]) # <tt>:exception</tt>:: # The argument passed via <tt>:exception</tt> will be raised when the # specified URL is requested. Any +Exception+ class is valid. Example: - # FakeWeb.register_uri('http://www.example.com/', :exception => Net::HTTPError) + # FakeWeb.register_uri(:get, "http://example.com", :exception => Net::HTTPError) # # If you're using the <tt>:body</tt> response type, you can pass additional # options to specify the HTTP headers to be used in the response. Example:
Update RDoc to use the non-deprecated #register_uri syntax
chrisk_fakeweb
train
rb
c1f90fb1c005a417c0b75f1118b12945ba7a3f60
diff --git a/lib/feed2email/feed_data_file.rb b/lib/feed2email/feed_data_file.rb index <HASH>..<HASH> 100644 --- a/lib/feed2email/feed_data_file.rb +++ b/lib/feed2email/feed_data_file.rb @@ -32,7 +32,7 @@ module Feed2Email end def path - @path ||= File.join(CONFIG_DIR, filename) + File.join(CONFIG_DIR, filename) end def filename
Do not memoize path since @uri may change This fixes a bug where @uri had changed and upon syncing, data was written to the old (memoized) path.
agorf_feed2email
train
rb
0d61dae945844c8487c12bc424e888c75079aed3
diff --git a/modules/isPrefixedProperty.js b/modules/isPrefixedProperty.js index <HASH>..<HASH> 100644 --- a/modules/isPrefixedProperty.js +++ b/modules/isPrefixedProperty.js @@ -2,5 +2,5 @@ const regex = /^(Webkit|Moz|O|ms)/ export default function isPrefixedProperty(property: string): boolean { - return property.match(regex) !== null + return regex.test(property) } diff --git a/modules/isPrefixedValue.js b/modules/isPrefixedValue.js index <HASH>..<HASH> 100644 --- a/modules/isPrefixedValue.js +++ b/modules/isPrefixedValue.js @@ -2,5 +2,5 @@ const regex = /-webkit-|-moz-|-ms-/ export default function isPrefixedValue(value: any): boolean { - return typeof value === 'string' && value.match(regex) !== null + return typeof value === 'string' && regex.test(value) }
Use regex.test(str) instead of str.match(regex) In both of these places, we really care about a boolean regex match so we can use the much faster regex.test instead of str.match. <URL>
rofrischmann_css-in-js-utils
train
js,js
306bf45f9961f8e8bb8799d91ea54c0080ecc99f
diff --git a/src/Google/Service/CloudMonitoring.php b/src/Google/Service/CloudMonitoring.php index <HASH>..<HASH> 100644 --- a/src/Google/Service/CloudMonitoring.php +++ b/src/Google/Service/CloudMonitoring.php @@ -353,7 +353,7 @@ class Google_Service_CloudMonitoring_Timeseries_Resource extends Google_Service_ * be (youngest - 4 hours, youngest]. * @opt_param string aggregator The aggregation function that will reduce the * data points in each window to a single point. This parameter is only valid - * for non-cumulative metric types. + * for non-cumulative metrics with a value type of INT64 or DOUBLE. * @opt_param string labels A collection of labels for the matching time series, * which are represented as: - key==value: key equals the value - key=~value: * key regex matches the value - key!=value: key does not equal the value - @@ -443,7 +443,7 @@ class Google_Service_CloudMonitoring_TimeseriesDescriptors_Resource extends Goog * be (youngest - 4 hours, youngest]. * @opt_param string aggregator The aggregation function that will reduce the * data points in each window to a single point. This parameter is only valid - * for non-cumulative metric types. + * for non-cumulative metrics with a value type of INT64 or DOUBLE. * @opt_param string labels A collection of labels for the matching time series, * which are represented as: - key==value: key equals the value - key=~value: * key regex matches the value - key!=value: key does not equal the value -
Updated CloudMonitoring.php This change has been generated by a script that has detected changes in the discovery doc of the API. Check <URL>
googleapis_google-api-php-client
train
php
d07d98b67f6273ac2a6991f4de07046699d623c9
diff --git a/lib/riemann/tools.rb b/lib/riemann/tools.rb index <HASH>..<HASH> 100644 --- a/lib/riemann/tools.rb +++ b/lib/riemann/tools.rb @@ -28,6 +28,7 @@ module Riemann opt :host, "Riemann host", :default => '127.0.0.1' opt :port, "Riemann port", :default => 5555 + opt :event_host, "Event hostname", :type => String opt :interval, "Seconds between updates", :default => 5 opt :tag, "Tag to add to events", :type => String, :multi => true opt :ttl, "TTL for events", :type => Integer @@ -62,6 +63,8 @@ module Riemann event[:ttl] = options[:ttl] end + event[:host] ||= options[:event_host] + riemann << event end
Allow the event host to be set on the command line Useful when trying `riemann-health` on a box to which you don't have access to change the hostname—like Heroku where `hostname` returns a GUID that's meaningless to you.
riemann_riemann-tools
train
rb
c923b297c3328b11c14a7f5b58466d09ff42653b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,15 +19,15 @@ except Exception as e: tests_require = [ 'coverage==4.2', - 'flake8==2.5.4', + 'flake8==3.2.0', 'hypothesis==3.6.0', 'hypothesis-pytest==0.19.0', 'py==1.4.31', - 'pydocstyle==1.0.0', + 'pydocstyle==1.1.1', 'pytest==3.0.4', 'pytest-benchmark==3.0.0', - 'pytest-cov==2.2.1', - 'Sphinx==1.4.4', + 'pytest-cov==2.4.0', + 'Sphinx==1.4.8', ] setup(
upgrade to latest flake8, pydocstyle, pytest-cov, and sphinx dependencies
jab_bidict
train
py
f70ccdb4d299542cdabfbae6eeef11db996006eb
diff --git a/api/catalog.go b/api/catalog.go index <HASH>..<HASH> 100644 --- a/api/catalog.go +++ b/api/catalog.go @@ -6,12 +6,13 @@ type Node struct { } type CatalogService struct { - Node string - Address string - ServiceID string - ServiceName string - ServiceTags []string - ServicePort int + Node string + Address string + ServiceID string + ServiceName string + ServiceAddress string + ServiceTags []string + ServicePort int } type CatalogNode struct {
Add 'ServiceAddress' field to 'CatalogService's truct
hashicorp_consul
train
go
593a06d0e09d9e493ba36aaf0ec6296eeb349e1a
diff --git a/components/auth/iframe-flow.js b/components/auth/iframe-flow.js index <HASH>..<HASH> 100644 --- a/components/auth/iframe-flow.js +++ b/components/auth/iframe-flow.js @@ -23,7 +23,7 @@ export default class IFrameFlow { const authRequest = await this._requestBuilder.prepareAuthRequest( // eslint-disable-next-line camelcase {request_credentials: 'required', auth_mode: 'bypass_to_login'}, - {nonRedirect: true} + {nonRedirect: false} ); return new Promise((resolve, reject) => {
JPS-<I> fix infinite loading when logging in via Google or Github This error caused by "nonRedirect" param. But it is OK to have it "false" and even redirect in iframe because it will actually close as soon as token get into localStorage
JetBrains_ring-ui
train
js
0e4cf8bdddfd791bb456f4cf242561290148f048
diff --git a/pyhomematic/devicetypes/misc.py b/pyhomematic/devicetypes/misc.py index <HASH>..<HASH> 100644 --- a/pyhomematic/devicetypes/misc.py +++ b/pyhomematic/devicetypes/misc.py @@ -142,14 +142,14 @@ DEVICETYPES = { "HmIP-BRC2": Remote, "HmIP-WRC6": RemoteBatteryIP, "HmIP-WRCD": RemoteBatteryIP, - "HmIP-KRCA": Remote, - "HmIP-KRC4": Remote, + "HmIP-KRCA": RemoteBatteryIP, + "HmIP-KRC4": RemoteBatteryIP, "HM-SwI-3-FM": RemotePress, "ZEL STG RM FSS UP3": RemotePress, "263 144": RemotePress, "HM-SwI-X": RemotePress, "HMW-RCV-50": RemoteVirtual, "HmIP-RCV-50": RemoteVirtual, - "HmIP-RC8": Remote, + "HmIP-RC8": RemoteBatteryIP, "HmIP-DBB": RemoteBatteryIP, }
Switch type for some HmIP remotes to RemoteBatteryIP (#<I>)
danielperna84_pyhomematic
train
py
e3516c2185c195a0e9f6e6a94e4e6120fe4afaf1
diff --git a/src/Models/AssetUploader.php b/src/Models/AssetUploader.php index <HASH>..<HASH> 100644 --- a/src/Models/AssetUploader.php +++ b/src/Models/AssetUploader.php @@ -51,7 +51,7 @@ class AssetUploader extends Model * Uploads the file/files or asset by creating the * asset that is needed to upload the files too. * - * @param $files + * @param string $files * @param null $filename * @param bool $keepOriginal * @return \Illuminate\Support\Collection|null|Asset @@ -83,7 +83,7 @@ class AssetUploader extends Model * * @param $files * @param Asset $asset - * @param null $filename + * @param boolean $filename * @param bool $keepOriginal * @return null|Asset * @throws \Spatie\MediaLibrary\Exceptions\FileCannotBeAdded diff --git a/src/Traits/AssetTrait.php b/src/Traits/AssetTrait.php index <HASH>..<HASH> 100644 --- a/src/Traits/AssetTrait.php +++ b/src/Traits/AssetTrait.php @@ -2,7 +2,6 @@ namespace Thinktomorrow\AssetLibrary\Traits; -use Illuminate\Support\Collection; use Thinktomorrow\AssetLibrary\Models\Asset; use Thinktomorrow\AssetLibrary\Models\AssetUploader; use Thinktomorrow\Locale\Locale;
Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on <URL>
thinktomorrow_assetlibrary
train
php,php
0317c218b7be110bced878e6da353ca82ddc27e3
diff --git a/Library/Installation/Updater/Updater021200.php b/Library/Installation/Updater/Updater021200.php index <HASH>..<HASH> 100644 --- a/Library/Installation/Updater/Updater021200.php +++ b/Library/Installation/Updater/Updater021200.php @@ -76,14 +76,23 @@ class Updater021200 /** @var \CLaroline\CoreBundle\Entity\User[] $users */ $users = $userRepository->findByPublicUrl(null); + $this->log('User to update ' . count($users) . ' - ' . date('Y/m/d H:i:s')); + /** @var \Claroline\CoreBundle\Manager\UserManager $userManager */ $userManager = $this->container->get('claroline.manager.user_manager'); + $nbUsers = 0; + foreach ($users as $user) { $publicUrl = $userManager->generatePublicUrl($user); $user->setPublicUrl($publicUrl); $this->objectManager->persist($user); $this->objectManager->flush(); + $nbUsers++; + if (200 === $nbUsers) { + $this->log(' ' . $nbUsers . ' updated users - ' . date('Y/m/d H:i:s')); + $nbUsers = 0; + } } $this->log('Public url for users updated.');
[CoreBundle] Add log on the updater that assign public url to users
claroline_Distribution
train
php
13ac57c3f41bea4e29257cd762844154ce66ac94
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,14 +22,16 @@ long_description = read('README.md', 'CHANGES.md') try: import pypandoc - long_description = pypandoc.convert('README.md', 'rst')\ - + pypandoc.convert('CHANGES.md', 'rst') + long_description = "\r\n".join((pypandoc.convert('README.md', 'rst'), + pypandoc.convert('CHANGES.md', 'rst'))) + except (IOError, ImportError): pass setup(name='time2words', version=time2words.__version__, - description='Converts from numerical to textual representation of time.', + description='A Python library for converting numerical representation ' + 'of time to text.', long_description=long_description, url='https://github.com/YavorPaunov/time2words', author='Yavor Paunov',
Added a new line between readme and changelog in the long description.
YavorPaunov_time2words
train
py
c6a98c9ff6ceb47f427fb1df0423fc8a3980f2e5
diff --git a/src/main/java/org/takes/facets/fork/FkTypes.java b/src/main/java/org/takes/facets/fork/FkTypes.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/takes/facets/fork/FkTypes.java +++ b/src/main/java/org/takes/facets/fork/FkTypes.java @@ -84,10 +84,13 @@ public final class FkTypes implements Fork { private static MediaTypes accepted(final Request req) throws IOException { MediaTypes list = new MediaTypes(); final Iterable<String> headers = new RqHeaders.Base(req) - .header("Accept"); + .header("Accept"); for (final String hdr : headers) { list = list.merge(new MediaTypes(hdr)); } + if (list.isEmpty()) { + list = new MediaTypes("text/html"); + } return list; }
#<I> FkTypes fixed
yegor256_takes
train
java
43d0f5505960b8f5e73e7ea281581046fe5a5cff
diff --git a/lib/gemsmith/cli.rb b/lib/gemsmith/cli.rb index <HASH>..<HASH> 100644 --- a/lib/gemsmith/cli.rb +++ b/lib/gemsmith/cli.rb @@ -54,7 +54,7 @@ module Gemsmith rails: "5.1" }, generate: { - bundler_audit: false, + bundler_audit: true, circle_ci: false, cli: false, code_climate: false, diff --git a/spec/lib/gemsmith/cli_spec.rb b/spec/lib/gemsmith/cli_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/gemsmith/cli_spec.rb +++ b/spec/lib/gemsmith/cli_spec.rb @@ -261,7 +261,7 @@ RSpec.describe Gemsmith::CLI do rails: "5.1" }, generate: { - bundler_audit: false, + bundler_audit: true, circle_ci: false, cli: false, code_climate: false,
Updated Bundler Audit option to be enabled by default. Ensures good security practices are in place for gem dependencies.
bkuhlmann_gemsmith
train
rb,rb
0f7bf40587ba5fc983d0772fc65628e00f2855c7
diff --git a/src/ScrollWatch.js b/src/ScrollWatch.js index <HASH>..<HASH> 100644 --- a/src/ScrollWatch.js +++ b/src/ScrollWatch.js @@ -270,7 +270,7 @@ var checkElements = function(eventType) { } else { - if (el.classList.contains(inViewClass)) { + if (el.classList.contains(inViewClass) || eventType === initEvent) { // Remove the class hook and fire a callback for every // element that just went out of view.
Call onElementOutOfView during initialization
edull24_ScrollWatch
train
js
6c36336e9fc45048ad43e4ff494c9d1ffc14fc49
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- extensions = [ - 'sphinx.ext.autodoc', - 'jaraco.packaging.sphinx', - 'rst.linker', + 'sphinx.ext.autodoc', + 'jaraco.packaging.sphinx', + 'rst.linker', ] master_doc = 'index'
Normalize indentation in docs/conf.py
yougov_vr.runners
train
py
3d2a1b8b2912017282408d03afd537e73cc35ab0
diff --git a/static/term.js b/static/term.js index <HASH>..<HASH> 100644 --- a/static/term.js +++ b/static/term.js @@ -565,13 +565,13 @@ Term.prototype.write = function(str) { // CSI Ps F // Cursor Preceding Line Ps Times (default = 1) (CNL). - case 69: + case 70: this.cursorPrecedingLine(this.params); break; // CSI Ps G // Cursor Character Absolute [column] (default = [row,1]) (CHA). - case 70: + case 71: this.cursorCharAbsolute(this.params); break; @@ -686,8 +686,9 @@ Term.prototype.write = function(str) { break; default: - console.log('Unknown CSI code: %s', - String.fromCharCode(ch), this.params); + console.log( + 'Unknown CSI code: %s', + str[i], this.params); break; } }
fix csi F and G
IonicaBizau_web-term
train
js
5606b91ee3ecdd559ec629a61279123f5cae596e
diff --git a/djcelery/admin.py b/djcelery/admin.py index <HASH>..<HASH> 100644 --- a/djcelery/admin.py +++ b/djcelery/admin.py @@ -16,7 +16,7 @@ from celery import current_app from celery import states from celery import registry from celery.task.control import broadcast, revoke, rate_limit -from celery.utils import abbrtask +from celery.utils.text import abbrtask from . import loaders from .admin_utils import action, display_field, fixedwidth
Fixes import error Import turns out to be broken since commit f5f8b<I>d<I> in celery
celery_django-celery
train
py
2eaeaf3130c307fee052c845be8d585512e46dce
diff --git a/parler/tests/test_forms.py b/parler/tests/test_forms.py index <HASH>..<HASH> 100644 --- a/parler/tests/test_forms.py +++ b/parler/tests/test_forms.py @@ -158,7 +158,7 @@ class FormTests(AppTestCase): r1 = RegularModel.objects.create(original_field='r1') a = ForeignKeyTranslationModel.objects.create(translated_foreign=r1, shared='EN') - # same way as TranslatableAdmin.get_object() inicializing translation, when user swich to new translation language + # same way as TranslatableAdmin.get_object() inicializing translation, when user switch to new translation language a.set_current_language('fr', initialize=True) # inicialize form
docs: Fix simple typo, swich -> switch There is a small typo in parler/tests/test_forms.py. Should read `switch` rather than `swich`.
django-parler_django-parler
train
py
e944854e173f14fcacff21349babe5bd9cf9b1f2
diff --git a/lib/hydra_attribute/version.rb b/lib/hydra_attribute/version.rb index <HASH>..<HASH> 100644 --- a/lib/hydra_attribute/version.rb +++ b/lib/hydra_attribute/version.rb @@ -1,3 +1,3 @@ module HydraAttribute - VERSION = '0.5.0.beta' + VERSION = '0.5.0.rc1' end
Set version to <I>.rc1
kostyantyn_hydra_attribute
train
rb
9305f06e03403132feb1ea73629305cd7bab49b2
diff --git a/controller/jobs/src/Controller/Jobs/Media/Scale/Standard.php b/controller/jobs/src/Controller/Jobs/Media/Scale/Standard.php index <HASH>..<HASH> 100644 --- a/controller/jobs/src/Controller/Jobs/Media/Scale/Standard.php +++ b/controller/jobs/src/Controller/Jobs/Media/Scale/Standard.php @@ -74,7 +74,9 @@ class Standard $search->slice( $start ); $items = $manager->search( $search ); - $process->start( $fcn, [$context, $items] ); + if( !$items->isEmpty() ) { + $process->start( $fcn, [$context, $items] ); + } $count = count( $items ); $start += $count;
Don't start new processes without items available
aimeos_ai-controller-jobs
train
php
2f6713fde2ec2d402dad84b93258950b13c892c9
diff --git a/pmagpy/ipmag.py b/pmagpy/ipmag.py index <HASH>..<HASH> 100755 --- a/pmagpy/ipmag.py +++ b/pmagpy/ipmag.py @@ -4656,7 +4656,7 @@ is the percent cooling rate factor to apply to specimens from this sample, DA-CR else: MagRec[key] = "" - # the following keys are cab be defined here as "Not Specified" : + # the following keys, if blank, used to be defined here as "Not Specified" : for key in ["sample_class", "sample_lithology", "sample_type"]: if key in list(OrRec.keys()) and OrRec[key] != "" and OrRec[key] != "Not Specified": @@ -4664,7 +4664,7 @@ is the percent cooling rate factor to apply to specimens from this sample, DA-CR elif key in list(Prev_MagRec.keys()) and Prev_MagRec[key] != "" and Prev_MagRec[key] != "Not Specified": MagRec[key] = Prev_MagRec[key] else: - MagRec[key] = "Not Specified" + MagRec[key] = ""#"Not Specified" # (rshaar) From here parse new information and replace previous, if exists: #
fix another commit that was munched by <I>a1b<I>ae<I>bfabccab4bb3ffdf<I>d3ab
PmagPy_PmagPy
train
py
9ee8e2be12dd5d2d648e62918fcb40f6a597cd34
diff --git a/activity_monitor/signals.py b/activity_monitor/signals.py index <HASH>..<HASH> 100755 --- a/activity_monitor/signals.py +++ b/activity_monitor/signals.py @@ -8,7 +8,7 @@ def create_or_update(sender, **kwargs): """ Create or update an Activity Monitor item from some instance. """ - now = datetime.datetime.utcnow() + now = datetime.datetime.now() offset = now - datetime.timedelta(days=3) # I can't explain why this import fails unless it's here.
timezone's gonna go stink up the joint?
tBaxter_activity-monitor
train
py
8481f1c2a614f920f10859fcf5a44fd0d08e0ed8
diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index <HASH>..<HASH> 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -2,17 +2,17 @@ namespace UniMapper; -use UniMapper\Mapper, - UniMapper\Reflection, +use UniMapper\Reflection, UniMapper\Exceptions\QueryBuilderException; /** - * @method \UniMapper\Query\FindAll findAll() - * @method \UniMapper\Query\FindOne findOne($primaryValue) - * @method \UniMapper\Query\Insert insert(array $data) - * @method \UniMapper\Query\Update update(array $data) - * @method \UniMapper\Query\Delete delete() - * @method \UniMapper\Query\Count count() + * @method \UniMapper\Query\FindAll findAll() + * @method \UniMapper\Query\FindOne findOne($primaryValue) + * @method \UniMapper\Query\Insert insert(array $data) + * @method \UniMapper\Query\Update update(array $data) + * @method \UniMapper\Query\UpdateOne updateOne($primaryValue, array $data) + * @method \UniMapper\Query\Delete delete() + * @method \UniMapper\Query\Count count() */ class QueryBuilder {
QueryBuilder: docblock update
unimapper_unimapper
train
php
0a68d5efd84714035030ae891fea165a1497e898
diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -754,8 +754,10 @@ LEFT JOIN all_cons_columns r_cols 'long' => 'string', 'clob' => 'text', 'nclob' => 'text', + 'raw' => 'text', + 'long raw' => 'text', 'rowid' => 'string', - 'urowid' => 'string' + 'urowid' => 'string', ); }
DBAL-<I> - Add oracle raw/long-raw support (for legacy databases)
doctrine_dbal
train
php
4637586b90c2ac524e25c4738a07d384ae317dea
diff --git a/app/models/build.rb b/app/models/build.rb index <HASH>..<HASH> 100644 --- a/app/models/build.rb +++ b/app/models/build.rb @@ -19,6 +19,8 @@ class Build < ActiveRecord::Base after_create { update_incremental_id } + validate :one_job_cannot_have_more_than_two_builds, on: :create + paginates_per 10 def self.latest @@ -75,4 +77,10 @@ class Build < ActiveRecord::Base def update_incremental_id update_attributes(incremental_id: job.builds_count) end + + def one_job_cannot_have_more_than_two_builds + if job.builds.unfinished.any? + errors.add(:id, "One job cannot have more than two builds") + end + end end
Keep a job has only 1 build Close #4.
r7kamura_altria
train
rb
e88ecbbbfdb2ae39f7ee1632d8f037733afc683d
diff --git a/src/Symfony/Component/Form/AbstractType.php b/src/Symfony/Component/Form/AbstractType.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Form/AbstractType.php +++ b/src/Symfony/Component/Form/AbstractType.php @@ -24,7 +24,7 @@ abstract class AbstractType implements FormTypeInterface /** * Builds the form. * - * This method gets called for each type in the hierarchy starting form the + * This method gets called for each type in the hierarchy starting from the * top most type. * Type extensions can further modify the form. * @@ -40,7 +40,7 @@ abstract class AbstractType implements FormTypeInterface /** * Builds the form view. * - * This method gets called for each type in the hierarchy starting form the + * This method gets called for each type in the hierarchy starting from the * top most type. * Type extensions can further modify the view. * @@ -56,7 +56,7 @@ abstract class AbstractType implements FormTypeInterface /** * Builds the form view. * - * This method gets called for each type in the hierarchy starting form the + * This method gets called for each type in the hierarchy starting from the * top most type. * Type extensions can further modify the view. *
[Form] Fixed a typo in AbstractType phpdoc
symfony_symfony
train
php
88bb08fa4e25e596d8665f1ed9647578d93c42a0
diff --git a/tests/Nsautoload/Tests/CacheTest.php b/tests/Nsautoload/Tests/CacheTest.php index <HASH>..<HASH> 100644 --- a/tests/Nsautoload/Tests/CacheTest.php +++ b/tests/Nsautoload/Tests/CacheTest.php @@ -13,6 +13,12 @@ class CacheTest extends \PHPUnit_Framework_TestCase if (!class_exists('Symfony\Component\ClassLoader\ApcClassLoader')) { $this->markTestSkipped('Class loader not found'); } + + if (!extension_loaded('apc')) { + $this->markTestSkipped('APC not enabled'); + } + + apc_clear_cache('user'); } /**
Check if apc is enabled during test setup
korstiaan_nsautoload
train
php
0f75cf85f98286865ce36362129b8e1231716ed6
diff --git a/model.js b/model.js index <HASH>..<HASH> 100644 --- a/model.js +++ b/model.js @@ -94,12 +94,11 @@ module.exports = Backbone.Model.extend({ } function makeNested(obj, key, level) { - var attrs = level || _.has(obj, key) ? obj : attributes; + var attrs = (level || _.has(obj, key) ? obj : attributes)[key]; obj = obj[key] = {}; - // copy nested attributes - _.some(attrs[key], function(val, key) { + _.some(attrs, function(val, key) { // check that we are not iterating an array-like object if (typeof key == 'number') return true; obj[key] = val;
Fixed unflatten for dotNotation with level > 2.
thecodebureau_ridge
train
js
b278146f5f0859c932e18f94a78411bc7460d2b9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -260,7 +260,7 @@ def get_version_info(): # If this is a release or another kind of source distribution of PyCBC except: - version = '1.6.6' + version = '1.6.7' release = 'True' date = hash = branch = tag = author = committer = status = builder = build_date = ''
Set for <I> release (#<I>)
gwastro_pycbc
train
py
32166f4becd4e950d691755cf9790a456fbfb865
diff --git a/src/Tomahawk/HttpKernel/Kernel.php b/src/Tomahawk/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Tomahawk/HttpKernel/Kernel.php +++ b/src/Tomahawk/HttpKernel/Kernel.php @@ -41,12 +41,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $paths = array(); protected $routePaths = array(); - const VERSION = '1.1.7'; - const VERSION_ID = '10107'; + const VERSION = '1.2.0'; + const VERSION_ID = '10200'; const MAJOR_VERSION = '1'; - const MINOR_VERSION = '1'; - const RELEASE_VERSION = '7'; - const EXTRA_VERSION = ''; + const MINOR_VERSION = '2'; + const RELEASE_VERSION = '0'; + const EXTRA_VERSION = 'a1'; /** * Constructor.
Update kernel to version <I>-a1
tomahawkphp_framework
train
php
9141812b47f11096e840b376388fa528110e0e05
diff --git a/ui/webpack/devConfig.js b/ui/webpack/devConfig.js index <HASH>..<HASH> 100644 --- a/ui/webpack/devConfig.js +++ b/ui/webpack/devConfig.js @@ -25,6 +25,15 @@ module.exports = { }, }, module: { + noParse: [ + path.resolve( + __dirname, + '..', + 'node_modules', + 'memoizerific', + 'memoizerific.js' + ), + ], preLoaders: [ { test: /\.js$/,
Fix prebuilt warning with webpacks noParse
influxdata_influxdb
train
js
89ea3ff62b937ec6b376eb815eb91937e626afe6
diff --git a/estnltk/__init__.py b/estnltk/__init__.py index <HASH>..<HASH> 100644 --- a/estnltk/__init__.py +++ b/estnltk/__init__.py @@ -8,3 +8,5 @@ from estnltk.layer.enveloping_span import EnvelopingSpan from estnltk.layer.layer import SpanList from estnltk.layer.layer import Layer from estnltk.text import Text + +from estnltk.taggers.tagger import Tagger
added Tagger to estnltk main imports
estnltk_estnltk
train
py
e3a761de0559c3d5f1f6d5965a5191053e5efeaa
diff --git a/core-bundle/contao/library/Contao/Controller.php b/core-bundle/contao/library/Contao/Controller.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/library/Contao/Controller.php +++ b/core-bundle/contao/library/Contao/Controller.php @@ -761,6 +761,11 @@ abstract class Controller extends \System } break; + // Line break + case 'br': + $arrCache[$strTag] = '<br' . ($objPage->outputFormat == 'xhtml' ? ' />' : '>'); + break; + // E-mail addresses case 'email': case 'email_open':
[Core] Add the "br" insert tag to insert line breaks (see #<I>)
contao_contao
train
php
000b9333ce91ddbb87b12f15694ad8cd0561855c
diff --git a/app/assets/javascripts/comfortable_mexican_sofa/application.js b/app/assets/javascripts/comfortable_mexican_sofa/application.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/comfortable_mexican_sofa/application.js +++ b/app/assets/javascripts/comfortable_mexican_sofa/application.js @@ -195,7 +195,7 @@ $.CMS = function(){ xhr.open('POST', action, true); xhr.setRequestHeader('Accept', 'application/javascript'); xhr.setRequestHeader('X-CSRF-Token', $('meta[name=csrf-token]').attr('content')); - xhr.setRequestHeader('Content-Type', file.content_type); + xhr.setRequestHeader('Content-Type', file.content_type || file.type); xhr.setRequestHeader('X-File-Name', file.name); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.send(file); @@ -220,4 +220,4 @@ $.CMS = function(){ }); } } -}(); \ No newline at end of file +}();
handling file.type as well as file.content_type when ajax uploading files
comfy_comfortable-mexican-sofa
train
js
f64cfabddd2337274098c638c8e440a1094ca410
diff --git a/lib/prepare.js b/lib/prepare.js index <HASH>..<HASH> 100644 --- a/lib/prepare.js +++ b/lib/prepare.js @@ -26,7 +26,7 @@ module.exports = function (assetsOrigin) { var pkg = pkgs[pkgName]; pkg.name = pkgName; - var option = util.merge(optionGlobal, util.extend({ + var option = util.merge(clone(optionGlobal), util.extend({ mode: ['copy', -1], hash: [0, -1], export: [true, -1]
Fix: prevent global option from changing when merging
arrowrowe_tam
train
js
af3825d9d9208de9b140973e2f8424c6049ab751
diff --git a/src/Event/MailListenerTrait.php b/src/Event/MailListenerTrait.php index <HASH>..<HASH> 100644 --- a/src/Event/MailListenerTrait.php +++ b/src/Event/MailListenerTrait.php @@ -11,7 +11,10 @@ trait MailListenerTrait { use ListenerAggregateTrait; - public function attach(EventManagerInterface $events, $priority = 1) // phpcs:ignore + /** + * @param int $priority + */ + public function attach(EventManagerInterface $events, $priority = 1): void // phpcs:ignore { $this->listeners[] = $events->attach(MailEvent::EVENT_MAIL_PRE_RENDER, [$this, 'onPreRender'], $priority); $this->listeners[] = $events->attach(MailEvent::EVENT_MAIL_PRE_SEND, [$this, 'onPreSend'], $priority);
Fixed return typehint removed by mistake
acelaya_ZF-AcMailer
train
php
3ebc79b166b66db7261f311144a0971f7d0cb94b
diff --git a/src/Term_Meta_Command.php b/src/Term_Meta_Command.php index <HASH>..<HASH> 100644 --- a/src/Term_Meta_Command.php +++ b/src/Term_Meta_Command.php @@ -1,7 +1,7 @@ <?php /** - * Manage term custom fields. + * Adds, updates, deletes, and lists term custom fields. * * ## EXAMPLES *
Use a more descriptive base summary for what actions are possible for term meta subcommands.
wp-cli_entity-command
train
php
6a5784350ac73a67076e0f8a0834f5dc6c032592
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -2471,7 +2471,7 @@ function Monoxide() { } // }}} // Apply map {{{ - if (_.isFunction(settings.map)) { + if (!err && _.isFunction(settings.map)) { rows = rows.map(settings.map); } // }}}
BUGFIX: Yet more halting behaviour when there is an internal Mongo error
hash-bang_Monoxide
train
js
e5e0dc3fae3e36c729fb20960a47a505d245ec83
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name="tensor", - version='0.3.4', + version='0.3.5', url='http://github.com/calston/tensor', license='MIT', description="A Twisted based monitoring agent for Riemann",
We should bump the minor version if we're changing the way the Event API works
calston_tensor
train
py
7b2f164b3b0053ccd54d106bdb1a3d0d7a66afd3
diff --git a/code/libraries/joomlatools/library/dispatcher/authenticator/origin.php b/code/libraries/joomlatools/library/dispatcher/authenticator/origin.php index <HASH>..<HASH> 100644 --- a/code/libraries/joomlatools/library/dispatcher/authenticator/origin.php +++ b/code/libraries/joomlatools/library/dispatcher/authenticator/origin.php @@ -61,12 +61,8 @@ class KDispatcherAuthenticatorOrigin extends KDispatcherAuthenticatorAbstract $source = KHttpUrl::fromString($origin)->getHost(); // Check if the source matches the target - if($target !== $source) - { - // Special case - check if the source is a subdomain of the target origin - if ('.'.$target !== substr($source, -1 * (strlen($target)+1))) { - throw new KControllerExceptionRequestInvalid('Origin or referer target not valid'); - } + if($target !== $source) { + throw new KControllerExceptionRequestInvalid('Origin or referer target not valid'); } }
#<I> - Do not allow subdomain origin targets
joomlatools_joomlatools-framework
train
php
d1b77fb8924f809b257440e8dd7541d9e8f2532b
diff --git a/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCommandPass.php b/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCommandPass.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCommandPass.php +++ b/lib/Thelia/Core/DependencyInjection/Compiler/RegisterCommandPass.php @@ -26,7 +26,12 @@ class RegisterCommandPass implements CompilerPassInterface $commands = []; } - foreach ($container->findTaggedServiceIds('thelia.command') as $id => $tag) { + foreach ( + array_merge( + $container->findTaggedServiceIds('thelia.command'), + $container->findTaggedServiceIds('console.command') + ) as $id => $tag + ) { $commandDefinition = $container->getDefinition($id); $commandDefinition->setPublic(true); $commands[] = $id;
Add base symfony commands and Bundles command to compiler pass
thelia_core
train
php
34f7a14f388cadbbf38271f8cbef50c2d3e3796d
diff --git a/gio/handler.go b/gio/handler.go index <HASH>..<HASH> 100644 --- a/gio/handler.go +++ b/gio/handler.go @@ -7,6 +7,7 @@ import ( "os" "strconv" "strings" + "sync" ) type MapperId string @@ -29,8 +30,10 @@ func init() { } var ( - mappers map[string]Mapper - reducers map[string]Reducer + mappers map[string]Mapper + reducers map[string]Reducer + mappersLock sync.Mutex + reducersLock sync.Mutex ) func init() { @@ -40,12 +43,18 @@ func init() { // RegisterMapper register a mapper function to process a command func RegisterMapper(fn Mapper) MapperId { + mappersLock.Lock() + defer mappersLock.Unlock() + mapperName := fmt.Sprintf("m%d", len(mappers)+1) mappers[mapperName] = fn return MapperId(mapperName) } func RegisterReducer(fn Reducer) ReducerId { + reducersLock.Lock() + defer reducersLock.Unlock() + reducerName := fmt.Sprintf("r%d", len(reducers)+1) reducers[reducerName] = fn return ReducerId(reducerName)
just in case any race condition during init()
chrislusf_gleam
train
go
212c6b3a4154c13c8d7800aae3010c54090bea99
diff --git a/window.go b/window.go index <HASH>..<HASH> 100644 --- a/window.go +++ b/window.go @@ -226,9 +226,13 @@ func (c *Window) ProcessEvent(ev Event) bool { } return true case EventKey: - if ev.Key == term.KeyTab { + if ev.Key == term.KeyTab || ev.Key == term.KeyArrowUp || ev.Key == term.KeyArrowDown { + if SendEventToChild(c, ev) { + return true + } + aC := ActiveControl(c) - nC := NextControl(c, aC, true) + nC := NextControl(c, aC, ev.Key != term.KeyArrowUp) if nC != aC { if aC != nil { aC.SetActive(false)
clui: control selection Implements the control selection with keyUp and keyDown besides the KeyTab selection.
VladimirMarkelov_clui
train
go
8dc8b2a0003a054af9a1a09887dd4461d6885b12
diff --git a/src/test/java/com/couchbase/client/CouchbasePropertiesTest.java b/src/test/java/com/couchbase/client/CouchbasePropertiesTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/couchbase/client/CouchbasePropertiesTest.java +++ b/src/test/java/com/couchbase/client/CouchbasePropertiesTest.java @@ -22,6 +22,7 @@ package com.couchbase.client; +import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -38,6 +39,8 @@ public class CouchbasePropertiesTest { assertEquals("cbclient", namespace); assertFalse(CouchbaseProperties.hasFileProperties()); + System.clearProperty("viewmode"); + System.clearProperty("cbcclient.viewmode"); assertNull(CouchbaseProperties.getProperty("viewmode")); assertNull(CouchbaseProperties.getProperty("viewmode", true)); assertEquals("default", @@ -60,6 +63,7 @@ public class CouchbasePropertiesTest { public void testPropertiesThroughFile() { assertFalse(CouchbaseProperties.hasFileProperties()); + System.clearProperty("throttler"); assertNull(CouchbaseProperties.getProperty("throttler")); CouchbaseProperties.setPropertyFile("cbclient-test.properties"); assertEquals("demo_throttler",
Reset system properties before running the PropertyTests. Change-Id: I<I>a8bb4db3fd5b6f<I>e2d<I>fa3e9cf<I>c Reviewed-on: <URL>
couchbase_couchbase-java-client
train
java
d32a8610dd499f73c5eecd0d8735d39db674af90
diff --git a/lib/puppet/gettext/config.rb b/lib/puppet/gettext/config.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/gettext/config.rb +++ b/lib/puppet/gettext/config.rb @@ -4,7 +4,7 @@ require 'puppet/file_system' module Puppet::GettextConfig LOCAL_PATH = File.absolute_path('../../../locales', File.dirname(__FILE__)) POSIX_PATH = File.absolute_path('../../../../../share/locale', File.dirname(__FILE__)) - WINDOWS_PATH = File.absolute_path('../../../../../../../puppet/share/locale', File.dirname(__FILE__)) + WINDOWS_PATH = File.absolute_path('../../../../../../puppet/share/locale', File.dirname(__FILE__)) # This is the only domain name that won't be a symbol, making it unique from environments. DEFAULT_TEXT_DOMAIN = 'default-text-domain'
(PA-<I>) Update Windows locale path In puppet6, install paths for puppet agent are updated to build all all of the agent components with the same prefix, instead of giving each one its own directory. This adjusts the search path for locale files so that it matches the new structure.
puppetlabs_puppet
train
rb
224d818877154e671d89932ebde52a91671f171d
diff --git a/plugin/src/android/EstimoteBeacons.java b/plugin/src/android/EstimoteBeacons.java index <HASH>..<HASH> 100644 --- a/plugin/src/android/EstimoteBeacons.java +++ b/plugin/src/android/EstimoteBeacons.java @@ -30,7 +30,10 @@ public class EstimoteBeacons extends CordovaPlugin private static final String ESTIMOTE_SAMPLE_REGION_ID = "EstimoteSampleRegion"; private BeaconManager mBeaconManager; + private boolean mIsConnected = false; + + // Maps that keep track of Cordova callbacks. private HashMap<String, CallbackContext> mRangingCallbackContexts = new HashMap<String, CallbackContext>(); private HashMap<String, CallbackContext> mMonitoringCallbackContexts = @@ -65,7 +68,11 @@ public class EstimoteBeacons extends CordovaPlugin @Override public void onReset() { Log.i(LOGTAG, "onReset"); + disconnectBeaconManager(); + + mRangingCallbackContexts = new HashMap<String, CallbackContext>(); + mMonitoringCallbackContexts = new HashMap<String, CallbackContext>(); } /** @@ -286,6 +293,7 @@ public class EstimoteBeacons extends CordovaPlugin callbackContext.error("startMonitoring RemoteException"); } } + /** * Stop monitoring for region. */
Fixed bug related to reloading code on Android when using Evothings Studio, ranging and monitoring are now cleaned up on resetting the plugin.
evothings_phonegap-estimotebeacons
train
java
1494bb68e6f78f4af1af99f3482fcbf2aafbad16
diff --git a/umap/umap_.py b/umap/umap_.py index <HASH>..<HASH> 100644 --- a/umap/umap_.py +++ b/umap/umap_.py @@ -1210,6 +1210,7 @@ class UMAP(BaseEstimator): target_metric_kwds=None, target_weight=0.5, transform_seed=42, + force_approximation_algorithm=False, verbose=False, ): @@ -1241,6 +1242,7 @@ class UMAP(BaseEstimator): self.target_metric_kwds = target_metric_kwds self.target_weight = target_weight self.transform_seed = transform_seed + self.force_approximation_algorithm = force_approximation_algorithm self.verbose = verbose self.a = a @@ -1396,7 +1398,7 @@ class UMAP(BaseEstimator): print("Construct fuzzy simplicial set") # Handle small cases efficiently by computing all distances - if X.shape[0] < 4096: + if X.shape[0] < 4096 and not self.force_approximation_algorithm: self._small_data = True if self.metric in ("ll_dirichlet", "hellinger"):
Allow user to force approximation algorithm even for small data (useful for testing)
lmcinnes_umap
train
py
84d0afae3b6e2bdd9659cbef19bda1fede14957e
diff --git a/eZ/Publish/Core/FieldType/Keyword/KeywordStorage/Gateway/LegacyStorage.php b/eZ/Publish/Core/FieldType/Keyword/KeywordStorage/Gateway/LegacyStorage.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/FieldType/Keyword/KeywordStorage/Gateway/LegacyStorage.php +++ b/eZ/Publish/Core/FieldType/Keyword/KeywordStorage/Gateway/LegacyStorage.php @@ -332,6 +332,9 @@ class LegacyStorage extends Gateway /** * Deletes all orphaned keywords. * + * @todo using two queries because zeta Database does not support joins in delete query. + * That could be avoided if the feature is implemented there. + * * Keyword is orphaned if it is not linked to a content attribute through ezkeyword_attribute_link table. * * @return void
Added TODO reminder for some time in future
ezsystems_ezpublish-kernel
train
php
949d6c5d78f31cfb9f0a957ede934e2303acc159
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -3,7 +3,7 @@ * This file is part of the Bruery Platform. * * (c) Viktore Zara <[email protected]> - * (c) Mell Zamorw <[email protected]> + * (c) Mell Zamora <[email protected]> * * Copyright (c) 2016. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. */
Added dependecy for bruery-platform.
bruery_doctrine-orm-admin-bundle
train
php
a75b0422703fc313ac496af39da089eb5de12dc8
diff --git a/pymatgen/io/vaspio/vasp_input.py b/pymatgen/io/vaspio/vasp_input.py index <HASH>..<HASH> 100644 --- a/pymatgen/io/vaspio/vasp_input.py +++ b/pymatgen/io/vaspio/vasp_input.py @@ -312,7 +312,9 @@ class Poscar(PMGSONable): selective_dynamics.append([tok.upper()[0] == "T" for tok in toks[3:6]]) - struct = Structure(lattice, atomic_symbols, coords, False, False, cart) + struct = Structure(lattice, atomic_symbols, coords, + to_unit_cell=False, validate_proximity=False, + coords_are_cartesian=cart) #parse velocities if any velocities = []
Make the arguments to Poscar structure generation explicit for clarity. Former-commit-id: <I>aa<I>ac<I>df8b<I>d<I>cf<I>f [formerly abbe<I>a<I>cc<I>ffd<I>c<I>ce<I>e4fb] Former-commit-id: cde<I>cf<I>d<I>d<I>e
materialsproject_pymatgen
train
py
9fd3c9164baa71f7f72a6f0dba36ee632608a2d9
diff --git a/packages/wpcom.js/example/index.js b/packages/wpcom.js/example/index.js index <HASH>..<HASH> 100644 --- a/packages/wpcom.js/example/index.js +++ b/packages/wpcom.js/example/index.js @@ -12,6 +12,15 @@ var WPCONN = require('../'); var wpapp = require('../test/data'); +/** + * Create a WPCONN instance + */ + +var wpconn = WPCONN(); + +// set token app +wpconn.token(wpapp.token); + // Path to our public directory var pub = __dirname + '/public'; @@ -26,7 +35,20 @@ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.get('/', function(req, res){ - res.render('layout'); + // set site id + wpconn.site.id(wpapp.public_site); + + // get site info + wpconn.site.info(function(err, site){ + if (err) return console.log(err); + + // get lastest post + wpconn.site.posts({ number: 10 }, function(err, posts) { + if (err) return console.log(err); + + res.render('layout', { site: site, posts: posts }); + }); + }); }); app.listen(3000);
core: get posts and info from blog
Automattic_wp-calypso
train
js
3f39f6c83d1ccda902e021785dd3ee1ea54cd3ef
diff --git a/cmd/xurls/main.go b/cmd/xurls/main.go index <HASH>..<HASH> 100644 --- a/cmd/xurls/main.go +++ b/cmd/xurls/main.go @@ -23,6 +23,7 @@ func main() { re = xurls.Email } scanner := bufio.NewScanner(os.Stdin) + scanner.Split(bufio.ScanWords) for scanner.Scan() { line := scanner.Text() matches := re.FindAllString(line, -1)
Split input by words, not lines Urls will never contain spaces, so reading line by line instead of word by word doesn't make much sense. This way we also don't have to worry about very long lines that contain many words.
mvdan_xurls
train
go
f20038b9c81c05258d7fc3d8ee0fd8a4c399014b
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -29,7 +29,7 @@ return array( 'label' => 'Delivery Management', 'description' => 'Manages deliveries using the ontology', 'license' => 'GPL-2.0', - 'version' => '8.6.0', + 'version' => '9.0.0', 'author' => 'Open Assessment Technologies SA', 'requires' => array( 'generis' => '>=12.5.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -258,6 +258,6 @@ class Updater extends \common_ext_ExtensionUpdater { $this->setVersion('7.6.0'); } - $this->skip('7.6.0', '8.6.0'); + $this->skip('7.6.0', '9.0.0'); } }
TTD-<I> changed major version
oat-sa_extension-tao-delivery-rdf
train
php,php
4cbf04d029c3c478313c1ce3613523475c473b4c
diff --git a/src/ol/control/FullScreen.js b/src/ol/control/FullScreen.js index <HASH>..<HASH> 100644 --- a/src/ol/control/FullScreen.js +++ b/src/ol/control/FullScreen.js @@ -52,7 +52,6 @@ const FullScreenEventType = { * when full-screen is active. * @property {string} [inactiveClassName=className + '-false'] CSS class name for the button * when full-screen is inactive. - * Instead of text, also an element (e.g. a `span` element) can be used. * @property {string} [tipLabel='Toggle full-screen'] Text label to use for the button tip. * @property {boolean} [keys=false] Full keyboard access. * @property {HTMLElement|string} [target] Specify a target if you want the
Update typeDefs for Fullscreen Options Remove line stating that a 'span' is also a valid inactiveClassName value.
openlayers_openlayers
train
js
1ba1bf009bd8f3e69ca391a8e2179f535c9c9a11
diff --git a/sqlbridge/scripts/basicrouter.py b/sqlbridge/scripts/basicrouter.py index <HASH>..<HASH> 100644 --- a/sqlbridge/scripts/basicrouter.py +++ b/sqlbridge/scripts/basicrouter.py @@ -96,7 +96,7 @@ connection.onopen = function (session) { connection.onclose = function (details) { console.log('Session to database closed', connection); - console.log('will_retry ', details.isRetrying); + console.log('will_retry ', details.will_retry); if(details.will_retry == true) { document.getElementById("info").innerHTML = '<p>Autobahn Connection Closed (retrying)</p>'; } else {
using details.will_rety, doesn't seem to work?
lgfausak_sqlbridge
train
py
78438fb6e379def506e7da1dfc5b09793416d997
diff --git a/wallace/heroku/clock.py b/wallace/heroku/clock.py index <HASH>..<HASH> 100644 --- a/wallace/heroku/clock.py +++ b/wallace/heroku/clock.py @@ -34,7 +34,7 @@ session = db.session scheduler = BlockingScheduler() [email protected]_job('interval', minutes=0.25) [email protected]_job('interval', minutes=0.5) def check_db_for_missing_notifications(): aws_access_key_id = os.environ['aws_access_key_id'] aws_secret_access_key = os.environ['aws_secret_access_key']
change clock to run every <I>s
berkeley-cocosci_Wallace
train
py
e9e966a84e9b41c3112d697b2e8a762b19c9566b
diff --git a/concrete/src/Editor/EditorServiceProvider.php b/concrete/src/Editor/EditorServiceProvider.php index <HASH>..<HASH> 100644 --- a/concrete/src/Editor/EditorServiceProvider.php +++ b/concrete/src/Editor/EditorServiceProvider.php @@ -21,7 +21,15 @@ class EditorServiceProvider extends ServiceProvider $pluginManager = new PluginManager(); $selectedPlugins = $config->get('editor.ckeditor4.plugins.selected'); if (!is_array($selectedPlugins)) { - $selectedPlugins = array_merge($config->get('editor.ckeditor4.plugins.selected_default'), $config->get('editor.ckeditor4.plugins.selected_hidden')); + $defaultPlugins = []; + $selectedHiddenPlugins = []; + if (is_array($config->get('editor.ckeditor4.plugins.selected_default'))) { + $defaultPlugins = $config->get('editor.ckeditor4.plugins.selected_default'); + } + if (is_array($config->get('editor.ckeditor4.plugins.selected_hidden'))) { + $selectedHiddenPlugins = $config->get('editor.ckeditor4.plugins.selected_hidden'); + } + $selectedPlugins = array_merge($defaultPlugins, $selectedHiddenPlugins); } $pluginManager->select($selectedPlugins); $this->registerCkeditorPlugins($pluginManager);
Fix error where EditorServiceProvider was complaining about array_merge not being a valid array
concrete5_concrete5
train
php
5698ac431974abcbdaa51f030eba6a7145f0a79a
diff --git a/lib/sfn/planner/aws.rb b/lib/sfn/planner/aws.rb index <HASH>..<HASH> 100644 --- a/lib/sfn/planner/aws.rb +++ b/lib/sfn/planner/aws.rb @@ -169,7 +169,12 @@ module Sfn # @param value [Array<String,Array<String>>] # @return [String] def fn_join(value) - value.last.join(value.first) + unless(value.last.is_a?(Array)) + val = value.last.to_s.split(',') + else + val = value.last + end + val.join(value.first) end # Lookup value in mappings
Only split and join in planner if value is not an array
sparkleformation_sfn
train
rb
8c07f49647cb1929b69f1aa9a8d27a0509188030
diff --git a/tests/test-json-users-controller.php b/tests/test-json-users-controller.php index <HASH>..<HASH> 100644 --- a/tests/test-json-users-controller.php +++ b/tests/test-json-users-controller.php @@ -87,6 +87,19 @@ class WP_Test_JSON_Users_Controller extends WP_Test_JSON_Controller_Testcase { $this->assertErrorResponse( 'json_user_cannot_list', $response, 403 ); } + public function test_get_item_published_author() { + $this->author_id = $this->factory->user->create( array( + 'role' => 'author', + ) ); + $this->post_id = $this->factory->post->create( array( + 'post_author' => $this->author_id + )); + wp_set_current_user( 0 ); + $request = new WP_JSON_Request( 'GET', sprintf( '/wp/users/%d', $this->author_id ) ); + $response = $this->server->dispatch( $request ); + $this->check_get_user_response( $response, 'embed' ); + } + public function test_get_user_with_edit_context() { $user_id = $this->factory->user->create(); wp_set_current_user( $this->user );
Basic details should be exposed about published authors
WP-API_WP-API
train
php
1c973330c68e0c653a19f4408a373741107eb0e3
diff --git a/src/core/services/theming/theming.js b/src/core/services/theming/theming.js index <HASH>..<HASH> 100644 --- a/src/core/services/theming/theming.js +++ b/src/core/services/theming/theming.js @@ -439,6 +439,10 @@ function generateThemes($injector) { THEME_COLOR_TYPES.forEach(function(colorType) { styleString += parseRules(theme, colorType, rulesByType[colorType] + ''); }); + if (theme.colors.primary.name == theme.colors.accent.name) { + console.warn("$mdThemingProvider: Using the same palette for primary and" + + "accent. This violates the material design spec."); + } }); // Insert our newly minted styles into the DOM
feat(theming): warn for same palette as primary and accent closes #<I>
angular_material
train
js
60b3b2e290b165848d8333efd784aecea1b33412
diff --git a/svtplay_dl.py b/svtplay_dl.py index <HASH>..<HASH> 100755 --- a/svtplay_dl.py +++ b/svtplay_dl.py @@ -25,7 +25,7 @@ import struct import binascii from datetime import timedelta -__version__ = "0.9.2013.02.22" +__version__ = "0.9.2013.02.26" class Options: """ @@ -404,7 +404,7 @@ def download_hls(options, url, baseurl=None): streams[int(i[1]["BANDWIDTH"])] = i[0] test = select_quality(options, streams) - if baseurl and test[1:4] != "http": + if baseurl and test[0:4] != "http": test = "%s%s" % (baseurl, test) m3u8 = get_http_data(test) globaldata, files = parsem3u(m3u8)
download_hls: we are checking for http and not ttp.
spaam_svtplay-dl
train
py