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
f7377fb09ae990d0f4553bd17ba105127062c755
diff --git a/lib/deep_unrest.rb b/lib/deep_unrest.rb index <HASH>..<HASH> 100644 --- a/lib/deep_unrest.rb +++ b/lib/deep_unrest.rb @@ -388,7 +388,7 @@ module DeepUnrest record = res[:record] errors = record&.errors&.messages if errors - base_key = "#{record.class.to_s.underscore.pluralize}[#{i}]" + base_key = "#{record.class.to_s.camelize(:lower).pluralize}[#{i}]" errors.keys.map do |attr| if record.respond_to? attr errors["#{base_key}.#{attr}".to_sym] = errors.delete(attr)
[bugfix] casing of error key on root resource errors
graveflex_deep_unrest
train
rb
ac309095068a598c1ac9dc284c19c43e78ccd462
diff --git a/ospd/parser.py b/ospd/parser.py index <HASH>..<HASH> 100644 --- a/ospd/parser.py +++ b/ospd/parser.py @@ -91,6 +91,10 @@ def create_args_parser(description: str) -> ParserType: return string parser.add_argument( + '--version', action='store_true', help='Print version then exit.' + ) + + parser.add_argument( '-p', '--port', default=DEFAULT_PORT, @@ -141,9 +145,6 @@ def create_args_parser(description: str) -> ParserType: '-l', '--log-file', type=filename, help='Path to the logging file.' ) parser.add_argument( - '--version', action='store_true', help='Print version then exit.' - ) - parser.add_argument( '--niceness', default=DEFAULT_NICENESS, type=int,
Move version switch to the top Display version switch info as second item if help is displayed.
greenbone_ospd
train
py
1fe518ff7073f01dc039756f43b384caf49ab7ab
diff --git a/buildbot_travis/loader.py b/buildbot_travis/loader.py index <HASH>..<HASH> 100644 --- a/buildbot_travis/loader.py +++ b/buildbot_travis/loader.py @@ -34,7 +34,7 @@ class Loader(object): slaves = [s.slavename for s in self.config['slaves']] return slaves[1:] - def define_travis_builder(self, name, repository, vcs_type=None, username=None, password=None, browserlink=None): + def define_travis_builder(self, name, repository, vcs_type=None, username=None, password=None): job_name = "%s-job" % name spawner_name = name @@ -112,6 +112,5 @@ class Loader(object): split_file = svnpoller.split_file_branches, svnuser = username, svnpasswd = password, - revlinktmpl = browserlink, ))
Use buildbot.revlinks instead of doing this.
buildbot_buildbot_travis
train
py
c0eeb78f2893ed74d5fe491f14fd16c4e86b4081
diff --git a/jacquard/vcf.py b/jacquard/vcf.py index <HASH>..<HASH> 100644 --- a/jacquard/vcf.py +++ b/jacquard/vcf.py @@ -228,7 +228,7 @@ class VcfRecord(object): #pylint: disable=too-many-instance-attributes try: return int(string) except ValueError: - return sys.maxint + return sys.maxsize #TODO: (cgates): Could we make filter an OrderedSet #TODO: (cgates) adjust info field to be stored as dict only instead of string #pylint: disable=too-many-arguments
(jebene) changed maxint to maxsize
umich-brcf-bioinf_Jacquard
train
py
833159988d048d7cab42d23c3d126e911a7c8239
diff --git a/twosheds/twosheds.py b/twosheds/twosheds.py index <HASH>..<HASH> 100644 --- a/twosheds/twosheds.py +++ b/twosheds/twosheds.py @@ -61,11 +61,6 @@ class Shell(object): def eval(self, line): if line: exit_code = call(line, shell=True) - if exit_code != 0: - # hide the error - self._raise_cursor() - self._clear_line() - return run_python(line, self.env) def interact(self): while True: @@ -120,6 +115,18 @@ class Shell(object): readline.write_history_file(histfile) +class PythonShell(Shell): + def eval(self, line): + if line: + exit_code = call(line, shell=True) + if exit_code != 0: + # hide the error + self._raise_cursor() + self._clear_line() + return run_python(line, self.env) + + + def coroutine(func): def start(*args, **kwargs): cr = func(*args, **kwargs)
Separate Python from Shell `Shell` should just be a regular shell so as to not commit users to any particular customizations.
Ceasar_twosheds
train
py
927700251d5d2bbbab9aadbe612bd0204790f79e
diff --git a/pgmpy/tests/test_factors/test_discrete/test_Factor.py b/pgmpy/tests/test_factors/test_discrete/test_Factor.py index <HASH>..<HASH> 100644 --- a/pgmpy/tests/test_factors/test_discrete/test_Factor.py +++ b/pgmpy/tests/test_factors/test_discrete/test_Factor.py @@ -558,7 +558,6 @@ class TestTabularCPDMethods(unittest.TestCase): [0.1, 0.7, 0.1, 0.7, 0.2, 0.2, 0.6, 0.6]], evidence=['A', 'B', 'C'], evidence_card=[2, 2, 2]) - def test_marginalize_1(self): self.cpd.marginalize(['diff']) self.assertEqual(self.cpd.variable, 'grade')
Fix erroneously added whitespace
pgmpy_pgmpy
train
py
f1d10af28b8549b5d0e7bca02fa270cadeb8a72f
diff --git a/tests/events/test_events_cme.py b/tests/events/test_events_cme.py index <HASH>..<HASH> 100644 --- a/tests/events/test_events_cme.py +++ b/tests/events/test_events_cme.py @@ -15,7 +15,7 @@ from unittest import TestCase import pandas as pd -from test_events import StatefulRulesTests, StatelessRulesTests, \ +from .test_events import StatefulRulesTests, StatelessRulesTests, \ minutes_for_days from zipline.utils.events import AfterOpen diff --git a/tests/events/test_events_nyse.py b/tests/events/test_events_nyse.py index <HASH>..<HASH> 100644 --- a/tests/events/test_events_nyse.py +++ b/tests/events/test_events_nyse.py @@ -22,7 +22,7 @@ from zipline.utils.events import NDaysBeforeLastTradingDayOfWeek, AfterOpen, \ BeforeClose from zipline.utils.events import NthTradingDayOfWeek -from test_events import StatelessRulesTests, StatefulRulesTests, \ +from .test_events import StatelessRulesTests, StatefulRulesTests, \ minutes_for_days T = partial(pd.Timestamp, tz='UTC')
TST: Need relative imports in py3
quantopian_zipline
train
py,py
a8346baa329e94cb06894b497dde2b4500731c0e
diff --git a/js/dsx.js b/js/dsx.js index <HASH>..<HASH> 100644 --- a/js/dsx.js +++ b/js/dsx.js @@ -887,7 +887,6 @@ module.exports = class dsx extends Exchange { }, orders[id])); result.push (order); } - console.log(`result: ${result.length}`, {symbol, since, limit}) return this.filterBySymbolSinceLimit (result, symbol, since, limit); }
[dsx] oops!
ccxt_ccxt
train
js
c1489a7cedb76c2114da27831a95f82bf41e000b
diff --git a/docs/src/ComponentsPage.js b/docs/src/ComponentsPage.js index <HASH>..<HASH> 100644 --- a/docs/src/ComponentsPage.js +++ b/docs/src/ComponentsPage.js @@ -1,4 +1,4 @@ -/* eslint no-path-concat: 0, react/no-did-mount-set-state: 0 */ +/* eslint react/no-did-mount-set-state: 0 */ import React from 'react';
Remove extraneous eslint disabling comment.
react-bootstrap_react-bootstrap
train
js
ca65875063451b0688b54f826b9ff21a4c354c00
diff --git a/src/svg/graphic.js b/src/svg/graphic.js index <HASH>..<HASH> 100644 --- a/src/svg/graphic.js +++ b/src/svg/graphic.js @@ -159,7 +159,7 @@ function pathDataToString(path) { var clockwise = data[i++]; var dThetaPositive = Math.abs(dTheta); - var isCircle = isAroundZero(dThetaPositive % PI2) + var isCircle = isAroundZero(dThetaPositive - PI2) && !isAroundZero(dThetaPositive); var large = false;
fix(svg): rendering circle bug due to svg arc fix and close ecomfe/echarts#<I>
ecomfe_zrender
train
js
9ebee3fd5f336a1a4219f7c4b320e6fcdbdb2b94
diff --git a/lib/router/metatag.js b/lib/router/metatag.js index <HASH>..<HASH> 100644 --- a/lib/router/metatag.js +++ b/lib/router/metatag.js @@ -70,7 +70,7 @@ module.exports = { '" />'; } - if (res.locals.data.avatar) { + if (res.locals.data.avatar && res.locals.data.avatar[0]) { var img = res.locals.data.avatar[0]; res.locals.metatag +=
add check to skip error in user image metatag without avatar
wejs_we-core
train
js
b35546157f404b86c1da990903ab63922735de1d
diff --git a/uncompyle6/parser.py b/uncompyle6/parser.py index <HASH>..<HASH> 100644 --- a/uncompyle6/parser.py +++ b/uncompyle6/parser.py @@ -442,6 +442,7 @@ class PythonParser(GenericASTBuilder): def p_expr(self, args): ''' expr ::= _mklambda + expr ::= LOAD_ASSERT expr ::= LOAD_FAST expr ::= LOAD_NAME expr ::= LOAD_CONST diff --git a/uncompyle6/verify.py b/uncompyle6/verify.py index <HASH>..<HASH> 100755 --- a/uncompyle6/verify.py +++ b/uncompyle6/verify.py @@ -321,6 +321,9 @@ def cmp_code_objects(version, is_pypy, code_obj1, code_obj2, elif tokens1[i1].type == 'LOAD_GLOBAL' and tokens2[i2].type == 'LOAD_NAME' \ and tokens1[i1].pattr == tokens2[i2].pattr: pass + elif tokens1[i1].type == 'LOAD_ASSERT' and tokens2[i2].type == 'LOAD_NAME' \ + and tokens1[i1].pattr == tokens2[i2].pattr: + pass elif (tokens1[i1].type == 'RETURN_VALUE' and tokens2[i2].type == 'RETURN_END_IF'): pass
LOAD_ASSERT can also be an expr This may have the undesirable property that assert statements might get tagged with equivalant low-level Python code that uses "raise AssertionError", but so be it. Fixes #<I>
rocky_python-uncompyle6
train
py,py
230dad2f40022ed197089a19744eeda979955cfa
diff --git a/lib/util/simple-hint.js b/lib/util/simple-hint.js index <HASH>..<HASH> 100644 --- a/lib/util/simple-hint.js +++ b/lib/util/simple-hint.js @@ -2,6 +2,10 @@ CodeMirror.simpleHint = function(editor, getHints) { // We want a single cursor position. if (editor.somethingSelected()) return; + //don't show completion if the token is empty + var tempToken = editor.getTokenAt(editor.getCursor()); + if(!(/[\S]/gi.test(tempToken.string))) return; + var result = getHints(editor); if (!result || !result.list.length) return; var completions = result.list;
bug fix - don't show autocompletion hints if the token is empty
codemirror_CodeMirror
train
js
8e6b98d08eacf0ea9a9ad0f8639180b4b2fbdaed
diff --git a/lib/fog/aws/models/rds/subnet_group.rb b/lib/fog/aws/models/rds/subnet_group.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/models/rds/subnet_group.rb +++ b/lib/fog/aws/models/rds/subnet_group.rb @@ -12,8 +12,11 @@ module Fog attribute :vpc_id, :aliases => 'VpcId' attribute :subnet_ids, :aliases => 'Subnets' - # TODO: ready? - # + def ready? + requires :status + status == 'Complete' + end + def save requires :description, :id, :subnet_ids service.create_db_subnet_group(id, subnet_ids, description)
[aws|rds] Implement `ready?` for subnet group.
fog_fog
train
rb
5067cdc0e44f39f9d8822169dde30b8b22c06eb9
diff --git a/spyder/widgets/tests/test_pathmanager.py b/spyder/widgets/tests/test_pathmanager.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/tests/test_pathmanager.py +++ b/spyder/widgets/tests/test_pathmanager.py @@ -36,6 +36,10 @@ def test_pathmanager(qtbot): def test_check_uncheck_path(qtbot): + """ + Test that checking and unchecking a path in the PathManager correctly + update the not active path list. + """ pathmanager = setup_pathmanager(qtbot, None, pathlist=sys.path[:-10], ro_pathlist=sys.path[-10:])
Added a description for the test
spyder-ide_spyder
train
py
07c04abd1c4c56ebb5e5de59ff147c595e9ba746
diff --git a/vexbot/commands/create_vexdir.py b/vexbot/commands/create_vexdir.py index <HASH>..<HASH> 100644 --- a/vexbot/commands/create_vexdir.py +++ b/vexbot/commands/create_vexdir.py @@ -1,14 +1,26 @@ from os import path, mkdir -def get_vexdir_filepath(): +def _get_config_dir(): home_direct = path.expanduser("~") - vexdir = path.abspath(path.join(home_direct, '.vexbot')) + config = path.abspath(path.join(home_direct, + '.config')) + + return config + +def get_vexdir_filepath(): + vexdir = path.join(_get_config_dir(), + 'vexbot') + return vexdir def create_vexdir(): + config_dir = _get_config_dir() vexdir = get_vexdir_filepath() + + if not path.isdir(config_dir): + mkdir(config_dir) if not path.isdir(vexdir): mkdir(vexdir)
moved vedir to `.config` in home directory
benhoff_vexbot
train
py
0c3453815c5834fe24cad3013172a1a08082d45a
diff --git a/starlette/responses.py b/starlette/responses.py index <HASH>..<HASH> 100644 --- a/starlette/responses.py +++ b/starlette/responses.py @@ -107,7 +107,7 @@ class Response: cookie[key]["secure"] = True # type: ignore if httponly: cookie[key]["httponly"] = True # type: ignore - cookie_val = cookie.output(header="") + cookie_val = cookie.output(header="").strip() self.raw_headers.append((b"set-cookie", cookie_val.encode("latin-1"))) def delete_cookie(self, key: str, path: str = "/", domain: str = None) -> None:
fixed issue <I>,trailing spaces not allowed in header (#<I>)
encode_starlette
train
py
ea2aedf398263a18ebda9343e97127686a2f61d9
diff --git a/servers/src/main/java/tachyon/worker/block/BlockWorker.java b/servers/src/main/java/tachyon/worker/block/BlockWorker.java index <HASH>..<HASH> 100644 --- a/servers/src/main/java/tachyon/worker/block/BlockWorker.java +++ b/servers/src/main/java/tachyon/worker/block/BlockWorker.java @@ -117,7 +117,7 @@ public class BlockWorker { mThriftServer = createThriftServer(); mWorkerNetAddress = new NetAddress(BlockWorkerUtils.getWorkerAddress(mTachyonConf).getAddress() - .getCanonicalHostName(), thriftServerPort, mDataServer.getPort()); + .getHostAddress(), thriftServerPort, mDataServer.getPort()); // Set up web server int webPort = mTachyonConf.getInt(Constants.WORKER_WEB_PORT, Constants.DEFAULT_WORKER_WEB_PORT);
use raw ip instead of canonical hostname as worker address to fix spark locality issue
Alluxio_alluxio
train
java
9500116c3d60900ea0253573b362b5633cc4c6c0
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 @@ -201,8 +201,7 @@ module Discordrb # The bot's OAuth application. # @return [Application, nil] The bot's application info. Returns `nil` if bot is not a bot account. def bot_application - gateway_check - return nil unless @type == :bot + return unless @type == :bot response = API.oauth_application(token) Application.new(JSON.parse(response), self) end
remove gateway_check from Bot#bot_application
meew0_discordrb
train
rb
60840a27675443e880cece090f09ef74632fb881
diff --git a/src/Repository.php b/src/Repository.php index <HASH>..<HASH> 100644 --- a/src/Repository.php +++ b/src/Repository.php @@ -12,7 +12,7 @@ use RudyMas\PDOExt\DBconnect; * @author Rudy Mas <rudy.mas@rmsoft.be> * @copyright 2017-2018, rmsoft.be. (http://www.rmsoft.be/) * @license https://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) - * @version 2.1.3.32 + * @version 2.2.1.34 * @package EasyMVC\Repository */ class Repository @@ -72,7 +72,7 @@ class Repository public function getByIndex(int $id) { foreach ($this->data as $value) { - if ($value->getId() === $id) { + if ($value->getData('id') === $id) { return $value; } } @@ -80,6 +80,8 @@ class Repository } /** + * This function needs following function to be inside the Model Class + * * @param string $field * @param string $search * @return array @@ -88,7 +90,7 @@ class Repository { $output = []; foreach ($this->data as $value) { - if ($value[$field] == $search) { + if ($value->getData($field) == $search) { $output[] = $value; } }
Updated functions getByIndex & getBy for new Model-structure
RudyMas_Emvc_Repository
train
php
40fb49cbdbb174ef53a12e3fd6d01d0614a582dd
diff --git a/client/v2/shield/auth.go b/client/v2/shield/auth.go index <HASH>..<HASH> 100644 --- a/client/v2/shield/auth.go +++ b/client/v2/shield/auth.go @@ -73,6 +73,19 @@ type AuthID struct { Name string `json:"name"` Role string `json:"role"` } `json:"tenant"` + + Is struct { + System struct { + Admin bool `json:"admin"` + Manager bool `json:"manager"` + Engineer bool `json:"engineer"` + } `json:"system"` + Tenants map[string]struct { + Admin bool `json:"admin"` + Engineer bool `json:"engineer"` + Operator bool `json:"operator"` + } `json:"tenant"` + } `json:"is"` } func (c *Client) AuthID() (*AuthID, error) {
Provide Grants in AuthID() response (client lib)
starkandwayne_shield
train
go
489706ec8b21c6be40d3f0163a25bea900a3bcec
diff --git a/esteid/digidocservice/service.py b/esteid/digidocservice/service.py index <HASH>..<HASH> 100644 --- a/esteid/digidocservice/service.py +++ b/esteid/digidocservice/service.py @@ -135,13 +135,15 @@ class DigiDocService(object): if wsdl_url == 'https://tsp.demo.sk.ee/dds.wsdl': # pragma: no branch assert service_name == 'Testimine', 'When using Test DigidocService the service name must be `Testimine`' + the_transport = transport or Transport(cache=SqliteCache()) + if ZeepSettings is not None: # pragma: no branch settings = ZeepSettings(strict=False) - self.client = Client(wsdl_url, transport=transport or Transport(cache=SqliteCache()), settings=settings) + self.client = Client(wsdl_url, transport=the_transport, settings=settings) else: - self.client = Client(wsdl_url, transport=transport or Transport(cache=SqliteCache()), strict=False) + self.client = Client(wsdl_url, transport=the_transport, strict=False) def start_session(self, b_hold_session, sig_doc_xml=None, datafile=None): """Start a DigidocService session
Digidocservice: Make Client transport creation more DRY
thorgate_django-esteid
train
py
0a19ee3144b529e89f9df8c0f1b89aaac17860ab
diff --git a/custodian/qchem/handlers.py b/custodian/qchem/handlers.py index <HASH>..<HASH> 100644 --- a/custodian/qchem/handlers.py +++ b/custodian/qchem/handlers.py @@ -253,7 +253,7 @@ class QChemErrorHandler(ErrorHandler): if len(old_strategy_text) > 0: comments = scf_pattern.sub(strategy_text, comments) else: - comments = strategy_text + comments += "\n" + strategy_text self.fix_step.params["comment"] = comments return method @@ -314,7 +314,7 @@ class QChemErrorHandler(ErrorHandler): if len(old_strategy_text) > 0: comments = geom_pattern.sub(strategy_text, comments) else: - comments = strategy_text + comments += "\n" + strategy_text self.fix_step.params["comment"] = comments return method
additional fix info should be append to the current title rather than replace
materialsproject_custodian
train
py
74de1758ab752bd6c7b65cffd93b8e8b2e4c5be5
diff --git a/src/post.js b/src/post.js index <HASH>..<HASH> 100644 --- a/src/post.js +++ b/src/post.js @@ -34,7 +34,7 @@ return function () }; return_val = { - postMessage: function send_message(str) + postMessage: function send_message(str, sync) { function ccall() { @@ -47,7 +47,11 @@ return function () cmds.push(str); - wait(ccall, 1); + if (sync) { + ccall(); + } else { + wait(ccall, 1); + } } }; @@ -120,7 +124,7 @@ return function () stockfish = STOCKFISH(); onmessage = function(event) { - stockfish.postMessage(event.data); + stockfish.postMessage(event.data, true); }; stockfish.onmessage = function onlog(line)
Don't delay ccalls in Web Workers.
nmrugg_stockfish.js
train
js
34586dd4e8d32a0801f29d564252913bfb6ccd2d
diff --git a/integration/integration_test.go b/integration/integration_test.go index <HASH>..<HASH> 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -5173,6 +5173,9 @@ func testSessionStartContainsAccessRequest(t *testing.T, suite *integrationTestS userRole, err := types.NewRole(userRoleName, types.RoleSpecV4{ Options: types.RoleOptions{}, Allow: types.RoleConditions{ + Logins: []string{ + suite.me.Username, + }, Request: &types.AccessRequestConditions{ Roles: []string{requestedRoleName}, },
Fixed TestSessionStartContainsAccessRequest. Fixed issue with TestSessionStartContainsAccessRequest where the login was not being injected into the user role.
gravitational_teleport
train
go
e9fae9a0c8639ebfd86474bba9a46243a24b09c1
diff --git a/js-modules/numberLines.js b/js-modules/numberLines.js index <HASH>..<HASH> 100644 --- a/js-modules/numberLines.js +++ b/js-modules/numberLines.js @@ -30,7 +30,7 @@ function numberLines(node, startLineNum, isPreformatted) { function walk(node) { var type = node.nodeType; if (type == 1 && !nocode.test(node.className)) { // Element - if ('br' === node.nodeName) { + if ('br' === node.nodeName.toLowerCase()) { breakAfter(node); // Discard the <BR> since it is now flush against a </LI>. if (node.parentNode) {
element nodeName is case sensitive (fix #<I>) this fixes a failing test in numberLines_test.html
google_code-prettify
train
js
0cbe139b578e0c11162eae0d71d92b77bd18bff4
diff --git a/lib/polisher/cli/bin/missing_deps.rb b/lib/polisher/cli/bin/missing_deps.rb index <HASH>..<HASH> 100644 --- a/lib/polisher/cli/bin/missing_deps.rb +++ b/lib/polisher/cli/bin/missing_deps.rb @@ -22,10 +22,11 @@ end def check_missing_deps(source) source.dependency_tree(:recursive => true, - :dev_deps => conf[:devel_deps]) do |gem, dep, resolved_dep| - versions = Polisher::VersionChecker.matching_versions(dep) - alt = Polisher::VersionChecker.versions_for(dep.name) - puts "#{gem.name} #{gem.version} missing dep #{dep.name} #{dep.requirement} - alt versions: #{alt}" if versions.empty? + :dev_deps => conf[:devel_deps]) do |source, dep, resolved_dep| + versions = Polisher::VersionChecker.matching_versions(dep) + alt = Polisher::VersionChecker.versions_for(dep.name) + source_str = source.is_a?(Polisher::Gemfile) ? "Gemfile" : "#{source.name} #{source.version}" + puts "#{source_str} missing dep #{dep.name} #{dep.requirement} - alt versions: #{alt}" if versions.empty? end end
Handle both Gem/Gemfile parsing edge cases in output
ManageIQ_polisher
train
rb
f1c649a6702947d8223c2d7e92d511f5082893d4
diff --git a/openquake/job/__init__.py b/openquake/job/__init__.py index <HASH>..<HASH> 100644 --- a/openquake/job/__init__.py +++ b/openquake/job/__init__.py @@ -33,6 +33,7 @@ from openquake import flags from openquake import java from openquake import kvs from openquake import logs +from openquake import OPENQUAKE_ROOT from openquake import shapes from openquake.supervising import supervisor from openquake.db.alchemy.db_utils import get_db_session @@ -91,6 +92,9 @@ def spawn_job_supervisor(job_id, pid): LOG.warn('If you want to run supervised jobs it\'s better ' 'to set [logging] backend=amqp in openquake.cfg') + if not os.path.isabs(exe): + exe = os.path.join(OPENQUAKE_ROOT, exe) + cmd = [exe, str(job_id), str(pid)] supervisor_pid = subprocess.Popen(cmd, env=os.environ).pid
Made explicit the root of a relative path to the supervisor executable. Former-commit-id: 2bd<I>fec<I>b<I>ad9f<I>bcc<I>ec<I>d4e5
gem_oq-engine
train
py
bf1868717afb50f9598cefc3b711990c8c77543b
diff --git a/overpy/__init__.py b/overpy/__init__.py index <HASH>..<HASH> 100644 --- a/overpy/__init__.py +++ b/overpy/__init__.py @@ -469,6 +469,7 @@ class Element(object): self._result = result self.attributes = attributes + self.id = None self.tags = tags
src - All elements must have an ID
DinoTools_python-overpy
train
py
37d5258e1fc01d5d54345137621c96d3eed860da
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -511,6 +511,10 @@ func _main(ctx context.Context) error { // ExchangeBot var xcBot *exchanges.ExchangeBot + if cfg.EnableExchangeBot && activeChain.Name != "mainnet" { + log.Warnf("disabling exchange monitoring. only available on mainnet") + cfg.EnableExchangeBot = false + } if cfg.EnableExchangeBot { botCfg := exchanges.ExchangeBotConfig{ BtcIndex: cfg.ExchangeCurrency,
exchanges: disable exchanges on testnet
decred_dcrdata
train
go
6cbe0e60966d77037e691a8e4de8a05e3a77edad
diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index <HASH>..<HASH> 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -1018,7 +1018,7 @@ class DruidDatasource(Model, BaseDatasource): del qry['dimensions'] qry['metric'] = list(qry['aggregations'].keys())[0] client.topn(**qry) - elif len(groupby) > 1 or having_filters or not order_desc: + else: # If grouping on multiple fields or using a having filter # we have to force a groupby query if timeseries_limit and is_timeseries:
Fixed branching condition with dimension spec (#<I>)
apache_incubator-superset
train
py
fc91461a812fd6c8f87ae87218106ae0b811b28d
diff --git a/Logger/ApiCallLogger.php b/Logger/ApiCallLogger.php index <HASH>..<HASH> 100644 --- a/Logger/ApiCallLogger.php +++ b/Logger/ApiCallLogger.php @@ -2,7 +2,7 @@ namespace Lsw\ApiCallerBundle\Logger; -use Symfony\Component\HttpKernel\Log\LoggerInterface; +use Psr\Log\LoggerInterface; use Lsw\ApiCallerBundle\Call\ApiCallInterface; /**
replaced Symfony LoggerInterface by Psr LoggerInterface, compatibility to symfony <I>
LeaseWeb_LswApiCallerBundle
train
php
9124c1f2d3365096a3b1dd5ef60b9059cb773d4c
diff --git a/theme/clean/layout/secure.php b/theme/clean/layout/secure.php index <HASH>..<HASH> 100644 --- a/theme/clean/layout/secure.php +++ b/theme/clean/layout/secure.php @@ -14,6 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. +// Get the HTML for the settings bits. +$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE); + echo $OUTPUT->doctype() ?> <html <?php echo $OUTPUT->htmlattributes(); ?>> <head>
MDL-<I> theme_clean: Layout "secure.php" missing settings.
moodle_moodle
train
php
3ba9f4a38014228f0ab2d8d19e8584848146f275
diff --git a/lib/plugin/variable-collector.js b/lib/plugin/variable-collector.js index <HASH>..<HASH> 100644 --- a/lib/plugin/variable-collector.js +++ b/lib/plugin/variable-collector.js @@ -60,9 +60,9 @@ VariableCollector.prototype = { for (var name in this.mVariables) { if (this.mVariables.hasOwnProperty(name)) { var oVar = this.mVariables[name]; - var dirname = path.dirname(oVar.filename); - var baseFileName = path.basename(oVar.rootFilename); // usually library.source.less - var libraryBaseFile = path.normalize(path.join(dirname, baseFileName)); + var dirname = path.posix.dirname(oVar.filename); + var baseFileName = path.posix.basename(oVar.rootFilename); // usually library.source.less + var libraryBaseFile = path.posix.normalize(path.posix.join(dirname, baseFileName)); // Only add variable if the corresponding library "base file" has been imported if (aImports.indexOf(libraryBaseFile) > -1 || libraryBaseFile === oVar.rootFilename) {
Changed paths in variable collector to posix variant. Since they are already posix, it does not work on windows machines.
SAP_less-openui5
train
js
b4aa6effb8772ca4a1e81d8889ea962ebf76a67c
diff --git a/bin/post-install.js b/bin/post-install.js index <HASH>..<HASH> 100755 --- a/bin/post-install.js +++ b/bin/post-install.js @@ -28,7 +28,7 @@ function gruntBuildHandlebars(){ function gruntBuildRebound(){ console.log("Starting Grunt Build"); ps = spawn('grunt', ['build'], {stdio: "inherit", cwd: filepath}); - spawn.on('error', function (err) { + ps.on('error', function (err) { console.log('Error Running Grunt Build:', err); }) }
testing in travis env. something is different...
reboundjs_rebound
train
js
a59dc85aa49e3f2bb00a42f73bb3b4a4b324ad94
diff --git a/holoviews/core/pprint.py b/holoviews/core/pprint.py index <HASH>..<HASH> 100644 --- a/holoviews/core/pprint.py +++ b/holoviews/core/pprint.py @@ -228,7 +228,7 @@ class InfoPrinter(object): @classmethod def options_info(cls, plot_class, ansi=False, pattern=None): if plot_class.style_opts: - backend_name = plot_class.renderer.backend + backend_name = plot_class.backend style_info = ("\n(Consult %s's documentation for more information.)" % backend_name) style_keywords = '\t%s' % ', '.join(plot_class.style_opts) style_msg = '%s\n%s' % (style_keywords, style_info)
Small fix for Plot pprint
pyviz_holoviews
train
py
69276e0073739361616c65fc13c9d3e259980597
diff --git a/doradus-server/src/com/dell/doradus/search/aggregate/Aggregate.java b/doradus-server/src/com/dell/doradus/search/aggregate/Aggregate.java index <HASH>..<HASH> 100644 --- a/doradus-server/src/com/dell/doradus/search/aggregate/Aggregate.java +++ b/doradus-server/src/com/dell/doradus/search/aggregate/Aggregate.java @@ -1059,7 +1059,7 @@ class PathEntry { for (int i=0; i < branches.size(); i++){ if (branches.get(i).name.equals(name)){ branch = branches.get(i); - mergeParameters(this, branch); + mergeParameters(branch, entry); break; } } @@ -1088,12 +1088,17 @@ class PathEntry { if (entry1.query != null){ AndQuery query = new AndQuery(); query.subqueries.add(entry1.query); - query.subqueries.add(entry1.query); + query.subqueries.add(entry2.query); entry1.query = query; } else { entry1.query = entry2.query; + if (USEQUERYCACHE) { + entry1.queryCache = new LRUCache<ObjectID, Boolean>(QUERYCACHECAPACITY); + } } + QueryExecutor qe = new QueryExecutor(entry1.tableDef); + entry1.filter = qe.filter(entry1.query); } }
Fixed BD-<I>: Spider: multi-level aggregate query with filtering causes NPE
QSFT_Doradus
train
java
277127fdc1e5fc2a6aeb62b1557f1d2615956873
diff --git a/src/Operation/FindOne.php b/src/Operation/FindOne.php index <HASH>..<HASH> 100644 --- a/src/Operation/FindOne.php +++ b/src/Operation/FindOne.php @@ -33,7 +33,6 @@ use MongoDB\Exception\UnsupportedException; class FindOne implements Executable { private $find; - private $options; /** * Constructs a find command for finding a single document. @@ -105,8 +104,6 @@ class FindOne implements Executable $filter, ['limit' => 1] + $options ); - - $this->options = $options; } /**
Remove unused $options property in FindOne
mongodb_mongo-php-library
train
php
829a9af93cb095bc38005644f15dd6c9bc5f8cbe
diff --git a/mama_cas/models.py b/mama_cas/models.py index <HASH>..<HASH> 100644 --- a/mama_cas/models.py +++ b/mama_cas/models.py @@ -215,8 +215,8 @@ class ServiceTicketManager(TicketManager): if gevent: size = getattr(settings, 'MAMA_CAS_ASYNC_CONCURRENCY', 2) pool = Pool(size) if size else None - requests = [spawn(t, pool=pool) for t in tickets] - gevent.joinall(requests) + sign_out_requests = [spawn(t, pool=pool) for t in tickets] + gevent.joinall(sign_out_requests) else: for ticket in tickets: ticket.request_sign_out()
Refactor variable within request_sign_out()
jbittel_django-mama-cas
train
py
904bb76d1f4fe77bf3e0905f3adf189e766ef0c3
diff --git a/jquery.uniform.js b/jquery.uniform.js index <HASH>..<HASH> 100644 --- a/jquery.uniform.js +++ b/jquery.uniform.js @@ -355,6 +355,7 @@ Enjoy! // suspends tiemouts until after the file has been selected. bindMany($el, { "click": function () { + $el.trigger("change"); setTimeout(filenameUpdate, 0); } });
Fire a "change" event after the file get selected
AudithSoftworks_Uniform
train
js
1e3b71825b028a2f6b210081cd319fe575aa2943
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,6 @@ sponsor_url = "https://github.com/sponsors/fabiocaccamo/" twitter_url = "https://twitter.com/fabiocaccamo" package_name = "django-admin-interface" package_url = "{}/{}".format(github_url, package_name) -package_issues_url = "{}/issues".format(github_url) package_path = os.path.abspath(os.path.dirname(__file__)) long_description_file_path = os.path.join(package_path, "README.md") long_description_content_type = "text/markdown" @@ -39,8 +38,8 @@ setup( url=package_url, download_url="{}/archive/{}.tar.gz".format(package_url, __version__), project_urls={ - "Documentation": package_url, - "Issues": package_issues_url, + "Documentation": "{}#readme".format(package_url), + "Issues": "{}/issues".format(package_url), "Funding": sponsor_url, "Twitter": twitter_url, },
Corrected wrong PyPI project urls.
fabiocaccamo_django-admin-interface
train
py
c663eae31d808dcd7ded19eb04cba3cafebf1afc
diff --git a/gwpy/tests/test_plotter.py b/gwpy/tests/test_plotter.py index <HASH>..<HASH> 100644 --- a/gwpy/tests/test_plotter.py +++ b/gwpy/tests/test_plotter.py @@ -287,7 +287,7 @@ class TestPlot(PlottingTestBase): assert not isinstance(mappable.norm, LogNorm) # add colorbar and check everything went through - cbar = fig.add_colorbar(log=True, label='Test label', cmap='plasma') + cbar = fig.add_colorbar(log=True, label='Test label', cmap='YlOrRd') assert len(fig.axes) == 2 assert cbar in fig.colorbars assert cbar.ax in fig._coloraxes @@ -295,7 +295,7 @@ class TestPlot(PlottingTestBase): assert cbar.get_clim() == mappable.get_clim() == (1, 119) assert isinstance(mappable.norm, LogNorm) assert isinstance(cbar.formatter, CombinedLogFormatterMathtext) - assert cbar.get_cmap().name == 'plasma' + assert cbar.get_cmap().name == 'YlOrRd' assert cbar.ax.get_ylabel() == 'Test label' self.save_and_close(fig) assert ax.get_position().width < width
tests: use older colormap for tests allows testing with an older version of matplotlib
gwpy_gwpy
train
py
1de2ec00c9f501fa482f8978a9bfbe6493c24702
diff --git a/ambry/metadata/schema.py b/ambry/metadata/schema.py index <HASH>..<HASH> 100644 --- a/ambry/metadata/schema.py +++ b/ambry/metadata/schema.py @@ -81,10 +81,6 @@ class Build(VarDictGroup): """Build parameters""" -class Requirements(VarDictGroup): - """Requirements parameters""" - - class ExtDocTerm(DictTerm): url = ScalarTerm() title = ScalarTerm()
redundant requirements definition removed. CivicKnowledge/ambry#<I>.
CivicSpleen_ambry
train
py
c3b9b4a3e9b4e545f862899af1f4705b920a6130
diff --git a/src/main/java/nl/hsac/fitnesse/junit/JUnitTeamcityReporter.java b/src/main/java/nl/hsac/fitnesse/junit/JUnitTeamcityReporter.java index <HASH>..<HASH> 100644 --- a/src/main/java/nl/hsac/fitnesse/junit/JUnitTeamcityReporter.java +++ b/src/main/java/nl/hsac/fitnesse/junit/JUnitTeamcityReporter.java @@ -35,7 +35,7 @@ public class JUnitTeamcityReporter extends RunListener { println("##teamcity[testSuiteStarted flowId='%s' name='%s']", flowId, testClassName); currentTestClassName = testClassName; } - println("##teamcity[testStarted flowId='%s' name='%s' captureStandardOutput='true']", flowId, testClassName, testName); + println("##teamcity[testStarted flowId='%s' name='%s' captureStandardOutput='true']", flowId, testName); } @Override
Oops, should not have passed test class name for that message...
fhoeben_hsac-fitnesse-fixtures
train
java
fc4f111bb7776725741712e0dc979b120410624d
diff --git a/multilingual/translation.py b/multilingual/translation.py index <HASH>..<HASH> 100644 --- a/multilingual/translation.py +++ b/multilingual/translation.py @@ -93,6 +93,17 @@ def fill_translation_cache(instance): translation = instance._meta.translation_model(**field_data) instance._translation_cache[language_id] = translation + # In some situations an (existing in the DB) object is loaded + # without using the normal QuerySet. In such case fallback to + # loading the translations using a separate query. + + # Unfortunately, this is indistinguishable from the situation when + # an object does not have any translations. Oh well, we'll have + # to live with this for the time being. + if len(instance._translation_cache.keys()) == 0: + for translation in instance.get_translation_set().all(): + instance._translation_cache[translation.language_id] = translation + class TranslatedFieldProxy(object): def __init__(self, field_name, alias, field, language_id=None): self.field_name = field_name
Added a fallback to the translation cache to load translations using normal mechanisms if an object is created without using its standard QuerySet. This fixes the problem with admin log. git-svn-id: <URL>
ojii_django-multilingual-ng
train
py
3e8f6f6a24cb366efe8006bbe923e2d7c4d998bd
diff --git a/src/NafUtil.js b/src/NafUtil.js index <HASH>..<HASH> 100644 --- a/src/NafUtil.js +++ b/src/NafUtil.js @@ -50,4 +50,4 @@ module.exports.now = function() { return Date.now(); }; -module.exports.delimiter = '|||'; \ No newline at end of file +module.exports.delimiter = '---';
use Firebase-friendly delimiter; note that Firebase does not like . or # which are in almost all selectors
networked-aframe_networked-aframe
train
js
d3bd421988e1b5c1dfed87c66f3d726ebe18a8cb
diff --git a/src/Tonic/Request.php b/src/Tonic/Request.php index <HASH>..<HASH> 100644 --- a/src/Tonic/Request.php +++ b/src/Tonic/Request.php @@ -97,7 +97,8 @@ class Request $uri = $this->getOption($options, 'uri'); if (!$uri) { // use given URI in config options if (isset($_SERVER['REDIRECT_URL']) && isset($_SERVER['SCRIPT_NAME'])) { // use redirection URL from Apache environment - $uri = substr($_SERVER['REDIRECT_URL'], strlen(dirname($_SERVER['SCRIPT_NAME']))); + $dirname = dirname($_SERVER['SCRIPT_NAME']); + $uri = substr($_SERVER['REDIRECT_URL'], strlen($dirname == '/' ? '' : $dirname)); } elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['SCRIPT_NAME'])) { // use PHP_SELF from Apache environment $uri = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])); } else { // fail @@ -106,7 +107,7 @@ class Request } // get mimetype - $parts = explode('/', $uri); + $parts = explode('/', rtrim($uri, '/')); $lastPart = array_pop($parts); $uri = join('/', $parts);
Fix for issue #<I> for when application root is "/"
peej_tonic
train
php
a1a6327b164d908172e35ccc03a647b91d15634b
diff --git a/lib/linkscape/response.rb b/lib/linkscape/response.rb index <HASH>..<HASH> 100644 --- a/lib/linkscape/response.rb +++ b/lib/linkscape/response.rb @@ -12,7 +12,7 @@ module Linkscape class Flags def initialize(bitfield, type) @value = bitfield - @flags = Linkscape::Constants::LinkMetrics::ResponseFlags.to_a.collect{|k,vv| k if (@value & vv[:flag]).nonzero?}.compact if type == :link + @flags = Linkscape::Constants::LinkMetrics::ResponseFlags.to_a.collect{|k,vv| k if (@value & vv[:flag]) == vv[:flag]}.compact if type == :link end def [](key); @flags.include? key.to_sym; end def to_a; @flags; end
Being more paranoid about flags
seomoz_linkscape-gem
train
rb
6c24f4fc14a48bb537dce8ea2e8b82e8eb643470
diff --git a/Util/Inflector.php b/Util/Inflector.php index <HASH>..<HASH> 100644 --- a/Util/Inflector.php +++ b/Util/Inflector.php @@ -100,7 +100,7 @@ class Inflector * * @return string */ - public static function classify($string, $singularize = true) + public static function classify($string, $singularize = false) { $class = ($singularize) ? static::singularize($string) : $string; return static::camelize($class);
Changed the `Inflector::classify()` method to not singularize by default.
nirix_radium
train
php
54ce372724d50bb94b51e0a95d6d5b7b2e5603cf
diff --git a/src/finalisers/umd.js b/src/finalisers/umd.js index <HASH>..<HASH> 100644 --- a/src/finalisers/umd.js +++ b/src/finalisers/umd.js @@ -51,7 +51,7 @@ export default function umd ( bundle, magicString, { exportMode, indentString }, var exports = factory(${globalDeps}); global.${options.moduleName} = exports; exports.noConflict = function() { global.${options.moduleName} = current; return exports; }; - })()` : `(${defaultExport}factory(${globalDeps}))` + })()` : `(${defaultExport}factory(${globalDeps}))`; const intro = `(function (global, factory) {
delint - oops missed a semi
rollup_rollup
train
js
6fc2ff0927f2f296ae72996140cf99dfe2cfb868
diff --git a/vault/token_store_test.go b/vault/token_store_test.go index <HASH>..<HASH> 100644 --- a/vault/token_store_test.go +++ b/vault/token_store_test.go @@ -935,7 +935,7 @@ func TestTokenStore_RevokeSelf(t *testing.T) { t.Fatalf("err: %v\nresp: %#v", err, resp) } - time.Sleep(200 * time.Millisecond) + time.Sleep(1000 * time.Millisecond) lookup := []string{ent1.ID, ent2.ID, ent3.ID, ent4.ID} for _, id := range lookup {
Give more time for the self revocation test to run
hashicorp_vault
train
go
84bd03bd0891a57cf2fe26c20402c5d98a96d41f
diff --git a/service/http/request.go b/service/http/request.go index <HASH>..<HASH> 100644 --- a/service/http/request.go +++ b/service/http/request.go @@ -151,7 +151,7 @@ func (r *Request) Payload() (p *roadrunner.Payload, err error) { // contentType returns the payload content type. func (r *Request) contentType() int { - if r.Method == "GET" || r.Method == "HEAD" || r.Method == "OPTIONS" { + if r.Method == "HEAD" || r.Method == "OPTIONS" { return contentNone }
handle body content on http GET method
spiral_roadrunner
train
go
3a2061f94609b01e1bf2f12c7e6b56f8f98f61ab
diff --git a/pyang/plugins/tree.py b/pyang/plugins/tree.py index <HASH>..<HASH> 100644 --- a/pyang/plugins/tree.py +++ b/pyang/plugins/tree.py @@ -237,7 +237,7 @@ def emit_tree(ctx, modules, fd, depth, llen, path): if not section_delimiter_printed: fd.write('\n') section_delimiter_printed = True - fd.write(" grouping %s\n" % g.arg) + fd.write(" grouping %s:\n" % g.arg) print_children(g.i_children, m, fd, ' ', path, 'grouping', depth, llen, ctx.opts.tree_no_expand_uses,
Fixes #<I> - as per RFC <I>, added : to grouping header
mbj4668_pyang
train
py
bcf9fba76681b7a0f2957cefbd3bb3b17205f871
diff --git a/classes/phing/tasks/ext/ParallelTask.php b/classes/phing/tasks/ext/ParallelTask.php index <HASH>..<HASH> 100755 --- a/classes/phing/tasks/ext/ParallelTask.php +++ b/classes/phing/tasks/ext/ParallelTask.php @@ -22,10 +22,6 @@ * @package phing.tasks.ext */ -require_once 'DocBlox/Parallel/Manager.php'; -require_once 'DocBlox/Parallel/Worker.php'; -require_once 'DocBlox/Parallel/WorkerPipe.php'; - /** * Uses the DocBlox_Parallel library to run nested Phing tasks concurrently. * @@ -61,6 +57,16 @@ class ParallelTask extends SequentialTask public function main() { + @include_once 'DocBlox/Parallel/Manager.php'; + @include_once 'DocBlox/Parallel/Worker.php'; + @include_once 'DocBlox/Parallel/WorkerPipe.php'; + if (!class_exists('DocBlox_Parallel_Worker')) { + throw new BuildException( + 'ParallelTask depends on DocBlox being installed and on include_path.', + $this->getLocation() + ); + } + foreach ($this->nestedTasks as $task) { $worker = new DocBlox_Parallel_Worker( function($task) { $task->perform(); },
Don't require_once DocBlox as it may not be available (re #<I>)
phingofficial_phing
train
php
c2fa8ed4b37ca5895679e417e3ef8717f5a34e91
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -8,14 +8,6 @@ module.exports = { __express: renderFile, renderFile: renderFile, render: getParser().compileSync, - /** - * @deprecated Since version "0.0.66". Will be deleted in version "1.0.0". Use 'render' instead. - */ - compileSync: function () { - console.warn("The 'compileSync' method is deprecated. Will be deleted in version '1.0.0'. Use 'render' instead."); - var parser = getParser(); - parser.compileSync.apply(parser, arguments); - }, register: registerRazorEngine, handleErrors: handleErrors };
- Depricated method removal.
DevelAx_RazorExpress
train
js
a1ab233a9765437c7bfa8d1cd1145f8751a0003d
diff --git a/Filter/Filter.php b/Filter/Filter.php index <HASH>..<HASH> 100644 --- a/Filter/Filter.php +++ b/Filter/Filter.php @@ -24,7 +24,7 @@ abstract class Filter extends BaseFilter public function apply($queryBuilder, $value) { $this->value = $value; - if(is_array($value) && array_key_exists("value", $value)) { + if(is_array($value) && array_key_exists('value', $value)) { list($alias, $field) = $this->association($queryBuilder, $value); $this->filter($queryBuilder, $alias, $field, $value);
Fix double quotes to single quotes in Filter.php
sonata-project_SonataDoctrineORMAdminBundle
train
php
2d6be5425f662895c781e6975eb3c019816ad22e
diff --git a/python/src/cm_api_tests/test_yarn.py b/python/src/cm_api_tests/test_yarn.py index <HASH>..<HASH> 100644 --- a/python/src/cm_api_tests/test_yarn.py +++ b/python/src/cm_api_tests/test_yarn.py @@ -15,13 +15,17 @@ # limitations under the License. import datetime -import json import unittest from cm_api.endpoints.clusters import * from cm_api.endpoints.services import * from cm_api.endpoints.types import * from cm_api_tests import utils +try: + import json +except ImportError: + import simplejson as json + class TestYarn(unittest.TestCase): def test_get_yarn_applications(self):
[python tests] Make test_yarn consistent with respect to importing 'json' It's unclear if this is futile or not. I don't believe the library works on Python < <I> any more, and I'm very sure unit tests don't work on Python < <I>.
cloudera_cm_api
train
py
4dae05821917f18bcf8a594a851529e841a8fa22
diff --git a/findbugsTestCases/src/java/nullnessAnnotations/packageDefault/TestNonNull2.java b/findbugsTestCases/src/java/nullnessAnnotations/packageDefault/TestNonNull2.java index <HASH>..<HASH> 100644 --- a/findbugsTestCases/src/java/nullnessAnnotations/packageDefault/TestNonNull2.java +++ b/findbugsTestCases/src/java/nullnessAnnotations/packageDefault/TestNonNull2.java @@ -10,8 +10,13 @@ class TestNonNull2 extends TestNonNull1 implements Interface1 { f(null); // should get a NonNull warning from TestNonNull1 } - @ExpectWarning("NP") +// @ExpectWarning("NP") void report2() { + // + // FindBugs doesn't produce a warning here because the g() + // method in TestNonNull1 explicitly marks its parameter + // as @Nullable. So, we shouldn't expect a warning. (?) + // g(null); // should get a NonNull warning from Interface1 }
I don't think we really are supposed to expect a warning in report2(). git-svn-id: <URL>
spotbugs_spotbugs
train
java
608f64b71088bb6bffd6591b9f74447e927ab6ce
diff --git a/tilequeue/worker.py b/tilequeue/worker.py index <HASH>..<HASH> 100644 --- a/tilequeue/worker.py +++ b/tilequeue/worker.py @@ -116,7 +116,8 @@ def _ack_coord_handle( stop_time = convert_seconds_to_millis(time.time()) tile_proc_logger.log_processed_pyramid( parent_tile, start_time, stop_time) - stats_handler.processed_pyramid(start_time, stop_time) + stats_handler.processed_pyramid( + parent_tile, start_time, stop_time) else: tile_queue.job_partially_done(queue_handle.handle) except Exception as e:
Correct stats processed_pyramid call
tilezen_tilequeue
train
py
58259e321721300ce9d6b32258654e81970d62f4
diff --git a/mod/journal/lib.php b/mod/journal/lib.php index <HASH>..<HASH> 100644 --- a/mod/journal/lib.php +++ b/mod/journal/lib.php @@ -1,6 +1,12 @@ <?PHP // $Id$ +if (!isset($CFG->journal_showrecentactivity)) { + set_config("journal_showrecentactivity", true); +} + + + // STANDARD MODULE FUNCTIONS ///////////////////////////////////////////////////////// function journal_user_outline($course, $user, $mod, $journal) { @@ -174,6 +180,10 @@ function journal_cron () { function journal_print_recent_activity($course, $isteacher, $timestart) { global $CFG; + if (empty($CFG->journal_showrecentactivity)) { // Don't even bother + return false; + } + $content = false; $journals = NULL;
Can use $CFG->journal_showrecentactivity to hide recent activity for journals
moodle_moodle
train
php
a1c1d0d7d21e76958163055eaac9f548898ad27d
diff --git a/web/src/main/javascript/webpack.config.js b/web/src/main/javascript/webpack.config.js index <HASH>..<HASH> 100644 --- a/web/src/main/javascript/webpack.config.js +++ b/web/src/main/javascript/webpack.config.js @@ -46,7 +46,7 @@ module.exports = { module: { loaders: [ - {test: /expression-atlas\w+\/(((?!node_modules).)*)\.js$/, loader: 'babel', query: {presets: ['es2015']}, exclude: /node-libs-browser/}, + {test: /expression-atlas[\w-]+\/(((?!node_modules).)*)\.js$/, loader: 'babel', query: {presets: ['es2015']}, exclude: /node-libs-browser/}, {test: /\.jsx$/, loader: 'babel', query: {presets: ['es2015', 'react']}}, {test: /\.css$/, loader: 'style-loader!css-loader'}, {test: /\.less$/, loader: 'style-loader!css-loader!less-loader'},
Fix regex - \w does not match -
ebi-gene-expression-group_atlas
train
js
55c8f93978115fd08ea3d3e764fd90c08fc394d2
diff --git a/quart/cli.py b/quart/cli.py index <HASH>..<HASH> 100644 --- a/quart/cli.py +++ b/quart/cli.py @@ -56,8 +56,11 @@ class ScriptInfo: import_name = module_path.with_suffix('').name try: module = import_module(import_name) - except ModuleNotFoundError: - raise NoAppException() + except ModuleNotFoundError as error: + if error.name == import_name: # type: ignore + raise NoAppException() + else: + raise try: self._app = eval(app_name, vars(module)) @@ -126,6 +129,7 @@ class QuartGroup(AppGroup): for the inbuilt commands to be overridden. """ info = ctx.ensure_object(ScriptInfo) + command = None try: command = info.load_app().cli.get_command(ctx, name) except NoAppException:
Fix minor CLI bugs Notably unassigned variable and only raise NoAppExceptions if the exception relates to the import tried. This ensures that if the import fails due to a missing module within the imported file it shows a different error than NoApp.
pgjones_quart
train
py
f2b123e670df7aabd94eaf911d1d162a533f20ee
diff --git a/includes/functions-formatting.php b/includes/functions-formatting.php index <HASH>..<HASH> 100644 --- a/includes/functions-formatting.php +++ b/includes/functions-formatting.php @@ -18,7 +18,7 @@ function yourls_int2string( $num, $chars = null ) { $num = bcdiv( $num, $len ); $string = $chars[ $mod ] . $string; } - $string = $chars[ $num ] . $string; + $string = $chars[ intval( $num ) ] . $string; return yourls_apply_filter( 'int2string', $string, $num, $chars ); }
Remove notice that has probably been here for decades. <b>Warning</b>: Illegal string offset '<I>' in <b>D:\yourls\includes\functions-formatting.php</b> on line <b><I></b>
YOURLS_YOURLS
train
php
a8554df0779dc11a7a4e58c69e1aa4a259c90b70
diff --git a/cake/console/shells/testsuite.php b/cake/console/shells/testsuite.php index <HASH>..<HASH> 100644 --- a/cake/console/shells/testsuite.php +++ b/cake/console/shells/testsuite.php @@ -280,8 +280,7 @@ class TestSuiteShell extends Shell { if (empty($testCases)) { $this->out(__("No test cases available \n\n")); - $this->help(); - $this->_stop(); + return $this->out($this->OptionParser->help()); } $this->out($title);
Fixing call to a help method that doesn't exist.
cakephp_cakephp
train
php
0b372bdf8210658b1ee383e865c1ea1130fa3af3
diff --git a/lib/will_filter/extensions/action_controller_extension.rb b/lib/will_filter/extensions/action_controller_extension.rb index <HASH>..<HASH> 100644 --- a/lib/will_filter/extensions/action_controller_extension.rb +++ b/lib/will_filter/extensions/action_controller_extension.rb @@ -46,17 +46,17 @@ module WillFilter # only if the filters need to be if WillFilter::Config.user_filters_enabled? begin - wf_current_user = eval(WillFilter::Config.current_user_method) + wf_current_user = self.send(WillFilter::Config.current_user_method) rescue Exception => ex - raise WillFilter::FilterException.new("will_filter cannot be initialized because #{WillFilter::Config.current_user_method} failed with: #{ex.message}") + wf_current_user = nil end end if WillFilter::Config.project_filters_enabled? begin - wf_current_project = eval(WillFilter::Config.current_project_method) + wf_current_project = self.send(WillFilter::Config.current_project_method) rescue Exception => ex - raise WillFilter::FilterException.new("will_filter cannot be initialized because #{WillFilter::Config.current_project_method} failed with: #{ex.message}") + wf_current_project = nil end end
current_user and project should not be mandatory
berk_will_filter
train
rb
f2d5a1fd19bd1b336e80aa2eb96efc42aa644dac
diff --git a/quickplots/charts.py b/quickplots/charts.py index <HASH>..<HASH> 100644 --- a/quickplots/charts.py +++ b/quickplots/charts.py @@ -88,6 +88,10 @@ class AxisChart(Chart): return list(self._all_series) + def series(self): + return self._all_series[0] + + def add_series(self, series): if not isinstance(series, Series): raise TypeError("'%s' is not a Series" % str(series)) diff --git a/tests/test_axis_charts.py b/tests/test_axis_charts.py index <HASH>..<HASH> 100644 --- a/tests/test_axis_charts.py +++ b/tests/test_axis_charts.py @@ -91,6 +91,13 @@ class AxisChartPropertyTests(AxisChartTest): self.assertEqual(chart.all_series(), [self.series1]) + def test_series_refers_to_first_series(self): + chart = AxisChart(self.series1) + self.assertIs(chart.series(), self.series1) + chart = AxisChart(self.series1, self.series2, self.series3) + self.assertIs(chart.series(), self.series1) + + def test_can_update_axis_labels(self): chart = AxisChart(self.series1) chart.x_label("Input")
Add Series property to refer to first Series
samirelanduk_quickplots
train
py,py
17e976550e751b5490f06f7a79724ca6b7920869
diff --git a/src/main/java/com/j256/ormlite/dao/ForeignCollection.java b/src/main/java/com/j256/ormlite/dao/ForeignCollection.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/j256/ormlite/dao/ForeignCollection.java +++ b/src/main/java/com/j256/ormlite/dao/ForeignCollection.java @@ -102,4 +102,14 @@ public interface ForeignCollection<T> extends Collection<T>, CloseableIterable<T * @return The number of objects loaded into the new collection. */ public int refreshCollection() throws SQLException; + + /** + * Adds the object to the collection. This will also add it to the database by calling through to [@link + * {@link Dao#create(Object)}. If the object has already been created in the database then you just need to set the + * foreign field on the object and call {@link Dao#update(Object)}. If you add it here the DAO will try to create it + * in the database again which will most likely cause an error. + * + * @see Collection#add(Object) + */ + public boolean add(T obj); }
Added more docs around adding to the collection.
j256_ormlite-core
train
java
069d5eae2dc9e9eb0f96f1e63926968bb52a260d
diff --git a/code/model/TrackedManyManyList.php b/code/model/TrackedManyManyList.php index <HASH>..<HASH> 100644 --- a/code/model/TrackedManyManyList.php +++ b/code/model/TrackedManyManyList.php @@ -34,7 +34,7 @@ class TrackedManyManyList extends ManyManyList if (class_exists($addingToClass)) { $onItem = $addingToClass::get()->byID($addingTo); if ($onItem) { - if ($item && !$item instanceof DataObject) { + if ($item && !($item instanceof DataObject)) { $class = $this->dataClass; $item = $class::get()->byID($item); }
style(TrackedManyManyList): Add brackets around instanceof check
symbiote_silverstripe-datachange-tracker
train
php
c5049125f8855b43d0c4b29cece2499a532439db
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -38,7 +38,7 @@ const ( defaultPeerPort = 9735 defaultRPCHost = "localhost" defaultMaxPendingChannels = 1 - defaultNumChanConfs = 1 + defaultNumChanConfs = 3 defaultNoEncryptWallet = false defaultTrickleDelay = 30 * 1000 ) diff --git a/networktest.go b/networktest.go index <HASH>..<HASH> 100644 --- a/networktest.go +++ b/networktest.go @@ -178,6 +178,7 @@ func (l *lightningNode) genArgs() []string { args = append(args, "--bitcoin.simnet") args = append(args, "--nobootstrap") args = append(args, "--debuglevel=debug") + args = append(args, "--defaultchanconfs=1") args = append(args, fmt.Sprintf("--bitcoin.rpchost=%v", l.cfg.Bitcoin.RPCHost)) args = append(args, fmt.Sprintf("--bitcoin.rpcuser=%v", l.cfg.Bitcoin.RPCUser)) args = append(args, fmt.Sprintf("--bitcoin.rpcpass=%v", l.cfg.Bitcoin.RPCPass))
config+test: increase default num confs for funding flows to 3 In this commit, we increase the default number of confirmations we require for funding flows from 1 to 3. The value of 1 was rather unstable on testnet due to the frequent multi-block re-orgs. Additionally, a value of 3 ensures our funding transaction is sufficiently buried before we deem is usable.
lightningnetwork_lnd
train
go,go
149918e4c3f1b874c5013b5138b7c5a6308b490c
diff --git a/test/tc_collections.rb b/test/tc_collections.rb index <HASH>..<HASH> 100644 --- a/test/tc_collections.rb +++ b/test/tc_collections.rb @@ -352,24 +352,18 @@ class TestCollections < MiniTest::Unit::TestCase def test_row_equality rv = RowValueTest.new - rv.run_bg - rv.sync_do { - rv.t1 <+ [[5, 10], - [6, 11]] - rv.t2 <+ [[5, 10], - [6, 15], - [7, 12]] - } - - rv.sync_do { - assert_equal(1, rv.t3.length) - assert_equal(2, rv.t4.length) - - cnt = rv.t4.select {|t| t == [5, 10, 15]} - assert_equal([], cnt) - } - - rv.stop + rv.t1 <+ [[5, 10], + [6, 11]] + rv.t2 <+ [[5, 10], + [6, 15], + [7, 12]] + rv.tick + + assert_equal(1, rv.t3.length) + assert_equal(2, rv.t4.length) + + cnt = rv.t4.select {|t| t == [5, 10, 15]} + assert_equal([], cnt) end def test_types
Simplify a test case slightly.
bloom-lang_bud
train
rb
10479141285c885fcd77571a9b2397d684ecf826
diff --git a/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java b/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java index <HASH>..<HASH> 100644 --- a/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java +++ b/contrib/pig/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java @@ -502,7 +502,7 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface, Lo return DoubleType.instance.decompose((Double)o); if (o instanceof UUID) return ByteBuffer.wrap(UUIDGen.decompose((UUID) o)); - return null; + return ByteBuffer.wrap(((DataByteArray) o).get()); } public void putNext(Tuple t) throws ExecException, IOException
Add catch-all cast back to CassandraStorage. Patch by brandonwilliams reviewed by xedin for CASSANDRA-<I>
Stratio_stratio-cassandra
train
java
06d5840bd58664108b16b093b8d54e1e46eaf42a
diff --git a/lib/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php b/lib/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php index <HASH>..<HASH> 100644 --- a/lib/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php +++ b/lib/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php @@ -96,7 +96,7 @@ class PolicyInformation implements \Countable, \IteratorAggregate * @return PolicyQualifierInfo[] */ public function qualifiers() { - return $this->_qualifiers; + return array_values($this->_qualifiers); } /**
Fix qualifiers method to strip array keys
sop_x509
train
php
e248cb79a065f79b02fd41a7af3b493f333c7e3e
diff --git a/src/main/java/edu/washington/cs/knowitall/commonlib/regex/Expression.java b/src/main/java/edu/washington/cs/knowitall/commonlib/regex/Expression.java index <HASH>..<HASH> 100644 --- a/src/main/java/edu/washington/cs/knowitall/commonlib/regex/Expression.java +++ b/src/main/java/edu/washington/cs/knowitall/commonlib/regex/Expression.java @@ -310,7 +310,7 @@ public interface Expression<E> extends Predicate<E> { * @param <E> */ static abstract class BaseExpression<E> implements Expression<E> { - private final String source; + public final String source; public BaseExpression(String source) { this.source = source;
Made the source field of BaseExpression public.
knowitall_common-java
train
java
cb1ed20787431bcf0bff8efc4a687b650c38e52b
diff --git a/flux_led/models_db.py b/flux_led/models_db.py index <HASH>..<HASH> 100755 --- a/flux_led/models_db.py +++ b/flux_led/models_db.py @@ -935,7 +935,7 @@ MODELS = [ model_num=0x33, # 'AK001-ZJ100' == v3 - WIFI370 version # 'AK001-ZJ210' == v6.37 - Seen on the outdoor string lights from Lytworx - # 'AK001-ZJ2104' == v7 supports turning on by effect/levels set + # 'AK001-ZJ2104' == v7.07 - Seen on usb fairy lights - supports turning on by effect/levels set # 'AK001-ZJ2134' == v8.02 - seen on the water proof controllers for outdoor garden light # 'AK001-ZJ2101' == v8.61, 8.62 (44 key) - no dimmable effects confirmed, confirmed auto on # "AK001-ZJ2145" == v9 # no rf support!
Add minor version to 0x<I> v7 in db (#<I>)
Danielhiversen_flux_led
train
py
b3e1f6598f9f70a07bc35e46a629b3097151125f
diff --git a/rest-client.js b/rest-client.js index <HASH>..<HASH> 100644 --- a/rest-client.js +++ b/rest-client.js @@ -105,12 +105,11 @@ return /******/ (function(modules) { // webpackBootstrap if (args) url += '?' + toQuery(args); var xhr = new XMLHttpRequest(); + xhr.open(method, url, true); var contentType = 'application/json'; if (method == 'POST') contentType = 'application/x-www-form-urlencoded'; - xhr.setRequestHeader('Content-Type', contentType); - xhr.open(method, url, true); this.prerequest(xhr); diff --git a/src/rest-client.js b/src/rest-client.js index <HASH>..<HASH> 100644 --- a/src/rest-client.js +++ b/src/rest-client.js @@ -32,13 +32,12 @@ class RestClient { url += '?' + toQuery(args); let xhr = new XMLHttpRequest(); + xhr.open(method, url, true); let contentType = 'application/json'; if (method == 'POST') contentType = 'application/x-www-form-urlencoded'; - xhr.setRequestHeader('Content-Type', contentType); - xhr.open(method, url, true); this.prerequest(xhr);
Fixed wrong xhr open and header setting order
Amareis_another-rest-client
train
js,js
d420a29e9f3af35412624e4068e90f80427fa672
diff --git a/src/BulkTools/HTTPBulkToolsResponse.php b/src/BulkTools/HTTPBulkToolsResponse.php index <HASH>..<HASH> 100644 --- a/src/BulkTools/HTTPBulkToolsResponse.php +++ b/src/BulkTools/HTTPBulkToolsResponse.php @@ -334,7 +334,7 @@ class HTTPBulkToolsResponse extends HTTPResponse ); foreach ($this->successRecords as $record) { - $data = array('id' => $record->ID, 'class' => $record->ClassName); + $data = array('id' => $record->ID, 'class' => str_replace('\\', '\\\\', $record->ClassName)); if (!$this->removesRows) { $data['row'] = $this->getRecordGridfieldRow($record); }
FIX Row updating broken in SilverStripe 4 (#<I>) Row updating is broken in SilverStripe 4 when for example using the PublishHandler or UnPublishHandler actions. This is due to unescaped backslashes in the fully qualified class name in json data, which when parsed in javascript treats the backslash as an escape character. This can be fixed by escaping the backslash character in HTTPBulkToolsResponse.
colymba_GridFieldBulkEditingTools
train
php
fada86e7b5693c16d275e6ddd6d28f6de5d5b9af
diff --git a/python/mxnet/module/module.py b/python/mxnet/module/module.py index <HASH>..<HASH> 100644 --- a/python/mxnet/module/module.py +++ b/python/mxnet/module/module.py @@ -170,7 +170,11 @@ class Module(BaseModule): """Internal helper for parameter initialization""" if cache is not None: if cache.has_key(name): - cache[name].copyto(arr) + cache_arr = cache[name] + + # just in case the cached array is just the target itself + if cache_arr is not arr: + cache_arr.copyto(arr) else: assert allow_missing initializer(name, arr)
add a guard to avoid copying to itself in setting parameters
apache_incubator-mxnet
train
py
27d9c373047b2c5fa22373d523ed6667f51eb76a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -75,7 +75,7 @@ install_requires = [ setup( name='pyrpo', - version='0.1.0', + version='0.1.1', description=( 'A shell command wrapper for hg, git, bzr, svn'), long_description=build_long_description(),
RLS: setup.py: version number to <I>
westurner_pyrpo
train
py
9c1768fa29a9bb7de735b3c4eabdfa9aaf56270c
diff --git a/zengine/settings.py b/zengine/settings.py index <HASH>..<HASH> 100644 --- a/zengine/settings.py +++ b/zengine/settings.py @@ -41,7 +41,12 @@ RIAK_PORT = os.environ.get('RIAK_PORT', 8098) REDIS_SERVER = os.environ.get('REDIS_SERVER', '127.0.0.1:6379') -ALLOWED_ORIGINS = ['http://127.0.0.1:8080', 'http://127.0.0.1:9001', 'http://ulakbus.net'] +ALLOWED_ORIGINS = [ + 'http://127.0.0.1:8080', + 'http://127.0.0.1:9001', + 'http://ulakbus.net', + 'http://www.ulakbus.net' +] ENABLED_MIDDLEWARES = [ 'zengine.middlewares.CORS',
add www subdomain of ulakbus net to ALLOWED_ORIGINS
zetaops_zengine
train
py
f881de7ce1a407f7acdde6e92c512990aa96f3d9
diff --git a/src/org/zaproxy/zap/extension/ascan/ActiveScanAPI.java b/src/org/zaproxy/zap/extension/ascan/ActiveScanAPI.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/extension/ascan/ActiveScanAPI.java +++ b/src/org/zaproxy/zap/extension/ascan/ActiveScanAPI.java @@ -712,8 +712,13 @@ public class ActiveScanAPI extends ApiImplementor { } try { - node = SessionStructure - .find(Model.getSingleton().getSession().getSessionId(), new URI(url, false), method, postData); + long sessionId = Model.getSingleton().getSession().getSessionId(); + node = SessionStructure.find(sessionId, startURI, method, postData); + if (node == null && "GET".equalsIgnoreCase(method)) { + // Check if there's a non-leaf node that matches the URI, to scan the subtree. + // (GET is the default method, but non-leaf nodes do not have any method.) + node = SessionStructure.find(sessionId, startURI, null, postData); + } } catch (Exception e) { throw new ApiException(ApiException.Type.INTERNAL_ERROR, e); }
Allow to use non-leaf nodes with ascan API Change ActiveScanAPI to use the non-leaf node (URL) to start the scan, if the provided URL does not match an existing leaf node. Fix #<I> - Active Scan API - Allow to start the scans with non-leaf nodes
zaproxy_zaproxy
train
java
160a14567f093a7406fd7713c1c644d6c0533dd3
diff --git a/tests/pay_to_test.py b/tests/pay_to_test.py index <HASH>..<HASH> 100755 --- a/tests/pay_to_test.py +++ b/tests/pay_to_test.py @@ -152,5 +152,10 @@ class ScriptTypesTest(unittest.TestCase): tx2.sign(hash160_lookup=hash160_lookup, p2sh_lookup=p2sh_lookup) self.assertEqual(tx2.bad_signature_count(), 0) + def test_weird_tx(self): + # this is from tx 12a8d1d62d12307eac6e62f2f14d7e826604e53c320a154593845aa7c8e59fbf + st = script_obj_from_script(b'Q') + self.assertNotEqual(st, None) + if __name__ == "__main__": unittest.main()
Add a new (failing) test.
richardkiss_pycoin
train
py
567fcfa395faef6bc980da79151302b259fe7344
diff --git a/ast.go b/ast.go index <HASH>..<HASH> 100644 --- a/ast.go +++ b/ast.go @@ -58,17 +58,6 @@ func Parse(sql string) (Statement, error) { return tokenizer.ParseTree, nil } -func ParseFromTokenizer(tokenizer *Tokenizer) (Statement, error) { - if yyParse(tokenizer) != 0 { - if tokenizer.partialDDL != nil { - tokenizer.ParseTree = tokenizer.partialDDL - return tokenizer.ParseTree, nil - } - return nil, tokenizer.LastError - } - return tokenizer.ParseTree, nil -} - // ParseStrictDDL is the same as Parse except it errors on // partially parsed DDL statements. func ParseStrictDDL(sql string) (Statement, error) {
Remove a function that is not upstream and no longer needed.
xwb1989_sqlparser
train
go
b9663cef21e16d9e49cb5d05baccf5a96b1e831a
diff --git a/enforcer_synced.go b/enforcer_synced.go index <HASH>..<HASH> 100644 --- a/enforcer_synced.go +++ b/enforcer_synced.go @@ -92,6 +92,13 @@ func (e *SyncedEnforcer) SetWatcher(watcher persist.Watcher) error { return watcher.SetUpdateCallback(func(string) { _ = e.LoadPolicy() }) } +// LoadModel reloads the model from the model CONF file. +func (e *SyncedEnforcer) LoadModel() error { + e.m.Lock() + defer e.m.Unlock() + return e.Enforcer.LoadModel() +} + // ClearPolicy clears all policy. func (e *SyncedEnforcer) ClearPolicy() { e.m.Lock()
fix: LoadModel is not synchronized (#<I>)
casbin_casbin
train
go
5e8dddaaec4d38004385cd515670282ea8dbf84e
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -22,7 +22,7 @@ describe('timeout()', function(){ describe('when above the timeout', function(){ describe('with no response made', function(){ - it('should respond with 408 Request timeout', function(done){ + it('should respond with 503 Request timeout', function(done){ var app = connect() .use(timeout(300)) .use(function(req, res){
tests: fix test description closes #8
expressjs_timeout
train
js
377d7e42715be5725d4fba813aba741e5d1d6245
diff --git a/core/server/api/v2/utils/serializers/output/utils/members.js b/core/server/api/v2/utils/serializers/output/utils/members.js index <HASH>..<HASH> 100644 --- a/core/server/api/v2/utils/serializers/output/utils/members.js +++ b/core/server/api/v2/utils/serializers/output/utils/members.js @@ -47,6 +47,7 @@ const forPost = (attrs, frame) => { if (!origInclude || !origInclude.includes('tags')) { delete attrs.tags; + attrs.primary_tag = null; } }
Removed serving primary_tag when members is enabled no issue - Content API v2 served primary_tag by default if members flag is enabled - reference: <URL>
TryGhost_Ghost
train
js
572a84ae4fe7ce464fe66b6462a80b09b20f8f1c
diff --git a/fireplace/cards/gvg/neutral_epic.py b/fireplace/cards/gvg/neutral_epic.py index <HASH>..<HASH> 100644 --- a/fireplace/cards/gvg/neutral_epic.py +++ b/fireplace/cards/gvg/neutral_epic.py @@ -9,3 +9,24 @@ class GVG_104: def OWN_CARD_PLAYED(self, card): if card.type == CardType.MINION and card.atk == 1: return [Buff(card, "GVG_104a")] + + +# Piloted Sky Golem +class GVG_105: + def deathrattle(self): + return [Summon(CONTROLLER, randomCollectible(type=CardType.MINION, cost=4))] + + +# Junkbot +class GVG_106: + def OWN_MINION_DESTROY(self, minion): + if minion.race == Race.MECHANICAL: + return [Buff(SELF, "GVG_106e")] + + +# Enhance-o Mechano +class GVG_107: + def action(self): + for target in self.controller.field: + tag = random.choice((GameTag.WINDFURY, GameTag.TAUNT, GameTag.DIVINE_SHIELD)) + yield SetTag(target, {tag: True})
Implement Piloted Sky Golem, Junkbot and Enhance-o Mechano
jleclanche_fireplace
train
py
173d2b618b1dc9a163db139c7f298730619dc82a
diff --git a/shared/api/instance_state.go b/shared/api/instance_state.go index <HASH>..<HASH> 100644 --- a/shared/api/instance_state.go +++ b/shared/api/instance_state.go @@ -182,4 +182,12 @@ type InstanceStateNetworkCounters struct { // Number of packets sent // Example: 964 PacketsSent int64 `json:"packets_sent" yaml:"packets_sent"` + + // Number of errors received + // Example: 14 + ErrorsReceived int64 `json:"errors_received" yaml:"errors_received"` + + // Number of errors sent + // Example: 41 + ErrorsSent int64 `json:"errors_sent" yaml:"errors_sent"` }
shared/api: Add Errors{Received,Sent} to network counters
lxc_lxd
train
go
c8c3a3ca7074a3ce6ac584b87acabb008972886d
diff --git a/Queue.js b/Queue.js index <HASH>..<HASH> 100644 --- a/Queue.js +++ b/Queue.js @@ -82,6 +82,9 @@ class Queue { // queue size of non-mature elements only schedSize (callback) {callback (null, 0);} + // queue size of reserved elements only + resvSize (callback) {callback (null, null);} + // Date of next next_t (callback) {callback (null, null);}
added commom Queue.resvSize()
pepmartinez_keuss
train
js
7615414d7f3dac343f3636cabe9766c4cf2147af
diff --git a/go/galeraautofix/mariadb/mariadb.go b/go/galeraautofix/mariadb/mariadb.go index <HASH>..<HASH> 100644 --- a/go/galeraautofix/mariadb/mariadb.go +++ b/go/galeraautofix/mariadb/mariadb.go @@ -36,6 +36,7 @@ func ForceStop(ctx context.Context) error { } exec.Command(`pkill`, `-9`, `-f`, `mysqld`).Run() + exec.Command(`pkill`, `-9`, `-f`, `socat`).Run() return nil }
kill any socat that is still running when force stopping MariaDB in galera-autofix
inverse-inc_packetfence
train
go
6e1d4933ca7de9798230fd1ef9f05b12dcf8619b
diff --git a/indra/assemblers/graph/assembler.py b/indra/assemblers/graph/assembler.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/graph/assembler.py +++ b/indra/assemblers/graph/assembler.py @@ -142,6 +142,7 @@ class GraphAssembler(): self._add_complex(stmt.members) elif all([ag is not None for ag in stmt.agent_list()]): self._add_stmt_edge(stmt) + return self.get_string() def get_string(self): """Return the assembled graph as a string. diff --git a/indra/tests/test_graph_assembler.py b/indra/tests/test_graph_assembler.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_graph_assembler.py +++ b/indra/tests/test_graph_assembler.py @@ -8,7 +8,8 @@ def test_phosphorylation(): st = [Phosphorylation(Agent('MAP2K1'), Agent('MAPK1'))] ga = GraphAssembler() ga.add_statements(st) - ga.make_model() + model = ga.make_model() + assert 'MAP2K1' in model assert len(ga.graph.nodes()) == 2 assert len(ga.graph.edges()) == 1
Return agraph string when assembling graph
sorgerlab_indra
train
py,py
1cff39fca0dd06fc56e39665d8fbb5dc48262814
diff --git a/dbt/adapters/redshift.py b/dbt/adapters/redshift.py index <HASH>..<HASH> 100644 --- a/dbt/adapters/redshift.py +++ b/dbt/adapters/redshift.py @@ -37,7 +37,7 @@ class RedshiftAdapter(PostgresAdapter): @classmethod def dist_qualifier(cls, dist): - dist_key = dist_key.strip().lower() + dist_key = dist.strip().lower() if dist_key in ['all', 'even']: return 'diststyle({})'.format(dist_key) @@ -53,8 +53,10 @@ class RedshiftAdapter(PostgresAdapter): .format(sort_type, valid_sort_types) ) - if type(sort_keys) == str: - sort_keys = [sort_keys] + if type(sort) == str: + sort_keys = [sort] + else: + sort_keys = sort formatted_sort_keys = ['"{}"'.format(sort_key) for sort_key in sort_keys]
fix typos in sort/dist key generator
fishtown-analytics_dbt
train
py
ad4e580a03a53c8febbee1ffb2a329e02e516fa0
diff --git a/builtin/providers/aws/resource_aws_elasticsearch_domain.go b/builtin/providers/aws/resource_aws_elasticsearch_domain.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_elasticsearch_domain.go +++ b/builtin/providers/aws/resource_aws_elasticsearch_domain.go @@ -381,7 +381,7 @@ func resourceAwsElasticSearchDomainUpdate(d *schema.ResourceData, meta interface return err } - err = resource.Retry(50*time.Minute, func() *resource.RetryError { + err = resource.Retry(60*time.Minute, func() *resource.RetryError { out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ DomainName: aws.String(d.Get("domain_name").(string)), }) @@ -417,7 +417,7 @@ func resourceAwsElasticSearchDomainDelete(d *schema.ResourceData, meta interface } log.Printf("[DEBUG] Waiting for ElasticSearch domain %q to be deleted", d.Get("domain_name").(string)) - err = resource.Retry(60*time.Minute, func() *resource.RetryError { + err = resource.Retry(90*time.Minute, func() *resource.RetryError { out, err := conn.DescribeElasticsearchDomain(&elasticsearch.DescribeElasticsearchDomainInput{ DomainName: aws.String(d.Get("domain_name").(string)), })
provider/aws: Bump `aws_elasticsearch_domain` timeout values Fixes #<I> The Update timeout and delete timeouts were a little short. Bumped them to <I> mins and <I> mins respectively. I have been on the receiving of the timeout for the Delete function
hashicorp_terraform
train
go
d36606a0168480e8b6f1259b7c848b47f42dcbc4
diff --git a/app_generators/ahn/ahn_generator.rb b/app_generators/ahn/ahn_generator.rb index <HASH>..<HASH> 100644 --- a/app_generators/ahn/ahn_generator.rb +++ b/app_generators/ahn/ahn_generator.rb @@ -72,6 +72,5 @@ EOS components/simon_game/lib components/simon_game/test config - helpers ) end \ No newline at end of file
Rubigen would still create a helpers directory when creating a new project. Fixed git-svn-id: <URL>
adhearsion_adhearsion
train
rb
cecd90f52418458d7ef146846fa6efabeddc3f7c
diff --git a/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go b/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go +++ b/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go @@ -122,8 +122,13 @@ func WithPriorityAndFairness( served = true innerCtx := context.WithValue(ctx, priorityAndFairnessKey, classification) innerReq := r.Clone(innerCtx) + + // We intentionally set the UID of the flow-schema and priority-level instead of name. This is so that + // the names that cluster-admins choose for categorization and priority levels are not exposed, also + // the names might make it obvious to the users that they are rejected due to classification with low priority. w.Header().Set(flowcontrol.ResponseHeaderMatchedPriorityLevelConfigurationUID, string(classification.PriorityLevelUID)) w.Header().Set(flowcontrol.ResponseHeaderMatchedFlowSchemaUID, string(classification.FlowSchemaUID)) + handler.ServeHTTP(w, innerReq) } digest := utilflowcontrol.RequestDigest{RequestInfo: requestInfo, User: user}
add comment to describe why we set the UID in the response headers
kubernetes_kubernetes
train
go
664d417e8fb0e1455593dee549e02fb8113f9de6
diff --git a/lib/engineyard-serverside/dependency_manager/composer.rb b/lib/engineyard-serverside/dependency_manager/composer.rb index <HASH>..<HASH> 100644 --- a/lib/engineyard-serverside/dependency_manager/composer.rb +++ b/lib/engineyard-serverside/dependency_manager/composer.rb @@ -13,7 +13,7 @@ module EY shell.status "Installing composer packages (composer.#{lock_or_json} detected)" composer_install else - raise EY::Serverside::RemoteFailure.new("Composer not available!") + raise EY::Serverside::RemoteFailure.new("composer.#{lock_or_json} detected but composer not available!") end end
Slightly more verbose error message.
engineyard_engineyard-serverside
train
rb
0b350ee2d81546074786133992d28b595d79397a
diff --git a/gseapy/stats.py b/gseapy/stats.py index <HASH>..<HASH> 100644 --- a/gseapy/stats.py +++ b/gseapy/stats.py @@ -75,8 +75,9 @@ def calc_pvalues(query, gene_sets, background=20000, **kwargs): # p(X >= hitCounts) pval = hypergeom.sf(x-1, bg, m, k) #oddr, pval2 = odds_ratio_calc(bg, k, m, x) - expect_count = k*m/bg - oddr= x / expect_count + # expect_count = k*m/bg + # oddr= x / expect_count + oddr= (x*(bg-m))/(m*(k-x)) # thanks to @sreichl. vals.append((s, pval, oddr, x, m, hits)) return zip(*vals)
odds ratio correction, #<I>
zqfang_GSEApy
train
py
451ddb3d45a126cedb22cf97cf9dca87ed469049
diff --git a/src/server/pkg/collection/collection.go b/src/server/pkg/collection/collection.go index <HASH>..<HASH> 100644 --- a/src/server/pkg/collection/collection.go +++ b/src/server/pkg/collection/collection.go @@ -213,6 +213,12 @@ func (c *readWriteCollection) Delete(key string) error { } func (c *readWriteCollection) DeleteAll() { + for _, index := range c.indexes { + // Delete indexes + indexDir := c.prefix + indexDir = strings.TrimRight(indexDir, "/") + c.stm.DelAll(fmt.Sprintf("%s__index_%s/", indexDir, index)) + } c.stm.DelAll(c.prefix) }
Delete indexes in DeleteAll
pachyderm_pachyderm
train
go
65f233689c2b20769d786d2e638fa11c7938615d
diff --git a/blackbird/test/configread_test/global_section_test.py b/blackbird/test/configread_test/global_section_test.py index <HASH>..<HASH> 100644 --- a/blackbird/test/configread_test/global_section_test.py +++ b/blackbird/test/configread_test/global_section_test.py @@ -32,8 +32,7 @@ class TestSetModuleDir(ConfigReaderBase): config = ConfigReader(infile=cfg_lines).config check_value = os.path.abspath('plugins') - print os.path.abspath(os.path.curdir) - + os.path.abspath(os.path.curdir) ok_(check_value in config['global']['module_dir'], msg=('Doesn\'t insert default "module_dir" value.' 'All config value: {0}'.format(config) diff --git a/blackbird/test/test_configread/test_global/test_module_dir.py b/blackbird/test/test_configread/test_global/test_module_dir.py index <HASH>..<HASH> 100644 --- a/blackbird/test/test_configread/test_global/test_module_dir.py +++ b/blackbird/test/test_configread/test_global/test_module_dir.py @@ -41,7 +41,6 @@ class TestConfigReaderAddDefaultModuleDir(object): infile=infile ) module_dirs = test_config.config['global']['module_dir'] - print module_dirs nose.tools.ok_( ( len(module_dirs) == 2
Oooops!:scream_cat: Forgot removing print debug
Vagrants_blackbird
train
py,py
64375c92fded2f262faa75b2c519302a0070095c
diff --git a/src/joint.dia.graph.js b/src/joint.dia.graph.js index <HASH>..<HASH> 100644 --- a/src/joint.dia.graph.js +++ b/src/joint.dia.graph.js @@ -954,20 +954,20 @@ joint.dia.Graph = Backbone.Model.extend({ // Return bounding box of all elements. - getBBox: function(cells) { - return this.getCellsBBox(cells || this.getElements()); + getBBox: function(cells, opt) { + return this.getCellsBBox(cells || this.getElements(), opt); }, // Return the bounding box of all cells in array provided. // Links are being ignored. - getCellsBBox: function(cells) { + getCellsBBox: function(cells, opt) { return _.reduce(cells, function(memo, cell) { if (cell.isLink()) return memo; if (memo) { - return memo.union(cell.getBBox()); + return memo.union(cell.getBBox(opt)); } else { - return cell.getBBox(); + return cell.getBBox(opt); } }, null); },
Added options support to graph.getBBox in order to match the ones of cell.getBBox
clientIO_joint
train
js
9c7ba045c9611be9a84e952c849a5d81b2ffe053
diff --git a/src/widgets/remote/reaction/reaction.js b/src/widgets/remote/reaction/reaction.js index <HASH>..<HASH> 100644 --- a/src/widgets/remote/reaction/reaction.js +++ b/src/widgets/remote/reaction/reaction.js @@ -72,9 +72,9 @@ let state = $.ajaxResponseGet ( res, 'state' ); - if ( _.isUndefined ( state ) ) return; + if ( _.isNull ( state ) ) return; - this._remoteState ( resj ); + this._remoteState ( state ); }
RemoteReaction: fixed leftover refactoring
svelto_svelto
train
js