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
d1e99d9a7e1bd6f204054f60af8587cf6e68acdf
diff --git a/src/OData.js b/src/OData.js index <HASH>..<HASH> 100644 --- a/src/OData.js +++ b/src/OData.js @@ -8,7 +8,7 @@ class OData extends Component { const queryString = buildQuery(query); return ( - <Fetch url={`${baseUrl}?${queryString}`} {...rest} /> + <Fetch url={baseUrl + queryString} {...rest} /> ) } }
No longer add “?” manually in url (it’s added by odata-query now as of <I>).
techniq_react-odata
train
js
ce84a4c31ab150abe468ac0cea39fb9a81774e4d
diff --git a/wfe/web-front-end.go b/wfe/web-front-end.go index <HASH>..<HASH> 100644 --- a/wfe/web-front-end.go +++ b/wfe/web-front-end.go @@ -225,16 +225,9 @@ func (wfe *WebFrontEndImpl) sendError(response http.ResponseWriter, details stri problemDoc = []byte("{\"detail\": \"Problem marshalling error message.\"}") } - switch problem.Type { - case ServerInternalProblem: + if problem.Type == ServerInternalProblem { // AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3 wfe.log.Audit(fmt.Sprintf("Internal error - %s - %s", details, debug)) - case MalformedProblem: - // AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64 - wfe.log.Audit(fmt.Sprintf("Improper HTTP request - %s - %s", details, debug)) - case UnauthorizedProblem: - // AUDIT[ Improper Messages ] 0786b6f2-91ca-4f48-9883-842a19084c64 - wfe.log.Audit(fmt.Sprintf("Unauthorized HTTP request - %s - %s", details, debug)) } // Paraphrased from
Only audit log internal server errors in WFE
letsencrypt_boulder
train
go
85fff3e4bcf51ea1d619501e73723caaeb5aac06
diff --git a/pyang/plugins/restconf.py b/pyang/plugins/restconf.py index <HASH>..<HASH> 100644 --- a/pyang/plugins/restconf.py +++ b/pyang/plugins/restconf.py @@ -47,7 +47,7 @@ restconf_stmts = [ # (<argument type name | None>, <substmts>), # <list of keywords where <keyword> can occur>) - ('yang-data', '?', + ('yang-data', '*', ('identifier', grammar.data_def_stmts), ['module', 'submodule']),
Fixes #<I> - yang-data may occur multiple times
mbj4668_pyang
train
py
250f78be945efa997f8d315bed1edd82b2d2a2a1
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3314,16 +3314,17 @@ function print_richedit_javascript($form, $name, $source='no') { * @param string $name Form element to replace with HTMl editor by name */ function use_html_editor($name='', $editorhidebuttons='') { + $editor = 'editor_'.md5($name); //name might contain illegal characters echo '<script language="javascript" type="text/javascript" defer="defer">'."\n"; - echo "edit_$name = new HTMLArea('edit-$name');\n"; - echo "var config = edit_$name.config;\n"; + echo "$editor = new HTMLArea('edit-$name');\n"; + echo "var config = $editor.config;\n"; echo print_editor_config($editorhidebuttons); if (empty($name)) { - echo "\nHTMLArea.replaceAll(edit_$name.config);\n"; + echo "\nHTMLArea.replaceAll($editor.config);\n"; } else { - echo "\nedit_$name.generate();\n"; + echo "\n$editor.generate();\n"; } echo '</script>'."\n"; }
Bug #<I> - HTML editor and brackets - fixes lesson problems; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
b630723322a1a78ce116e8a2f3ef7fb3c74a5818
diff --git a/lib/nominet-epp/notification.rb b/lib/nominet-epp/notification.rb index <HASH>..<HASH> 100644 --- a/lib/nominet-epp/notification.rb +++ b/lib/nominet-epp/notification.rb @@ -18,6 +18,7 @@ module NominetEPP parse_response end + undef id undef to_s def type diff --git a/lib/nominet-epp/responses/contact/info_response.rb b/lib/nominet-epp/responses/contact/info_response.rb index <HASH>..<HASH> 100644 --- a/lib/nominet-epp/responses/contact/info_response.rb +++ b/lib/nominet-epp/responses/contact/info_response.rb @@ -9,6 +9,8 @@ module NominetEPP ext_inf_data end + undef id + def name @response.id end
Nuke #id method to quit Ruby <I> from complaining
m247_nominet-epp
train
rb,rb
f3d32c052dae360b9f0d7342357fd5cd28e79c89
diff --git a/lib/core.js b/lib/core.js index <HASH>..<HASH> 100644 --- a/lib/core.js +++ b/lib/core.js @@ -2449,7 +2449,7 @@ module.exports = function reglCore ( var ELEMENTS var scope = outer if (defn) { - if (!defn.batchStatic) { + if ((defn.contextDep && args.contextDynamic) || defn.propDep) { scope = inner } ELEMENTS = defn.append(env, scope) @@ -2469,7 +2469,7 @@ module.exports = function reglCore ( var COUNT var scope = outer if (defn) { - if (!defn.batchStatic) { + if ((defn.contextDep && args.contextDynamic) || defn.propDep) { scope = inner } COUNT = defn.append(env, scope) @@ -2491,10 +2491,10 @@ module.exports = function reglCore ( function emitValue (name) { var defn = drawOptions[name] if (defn) { - if (defn.batchStatic) { - return defn.append(env, outer) - } else { + if ((defn.contextDep && args.contextDynamic) || defn.propDep) { return defn.append(env, inner) + } else { + return defn.append(env, outer) } } else { return outer.def(DRAW_STATE, '.', name)
fixed bug with draw properties incorrectly lowering in batch mode
regl-project_regl
train
js
5bcde183c942079efc6c6a15a15df808eac2c51b
diff --git a/src/KV/KVClient.php b/src/KV/KVClient.php index <HASH>..<HASH> 100644 --- a/src/KV/KVClient.php +++ b/src/KV/KVClient.php @@ -154,7 +154,7 @@ class KVClient extends AbstractClient { public function keys(string $prefix = '', QueryOptions $options = null): array { $r = new Request('GET', sprintf('v1/kv/%s', $prefix), $this->config); $r->setQueryOptions($options); - $r->Params->set('keys', 'true'); + $r->Params->set('keys', ''); /** @var \Psr\Http\Message\ResponseInterface $response */ list($duration, $response, $err) = $this->requireOK($this->doRequest($r));
removing 'true' from 'keys' param on KVClient::list
dcarbone_php-consul-api
train
php
b0e64b5b0455c4d609d732fc97ec73cabd4ffea4
diff --git a/tests/Unit/GoogleFeedItemTest.php b/tests/Unit/GoogleFeedItemTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/GoogleFeedItemTest.php +++ b/tests/Unit/GoogleFeedItemTest.php @@ -4,6 +4,7 @@ namespace Tests\ProductFeed\GoogleBundle\Unit; use PHPUnit\Framework\TestCase; use Shopsys\FrameworkBundle\Component\Domain\Config\DomainConfig; +use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Component\Money\Money; use Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency; use Shopsys\FrameworkBundle\Model\Pricing\Currency\CurrencyFacade; @@ -67,7 +68,7 @@ class GoogleFeedItemTest extends TestCase ); $this->defaultCurrency = $this->createCurrencyMock(1, 'EUR'); - $this->defaultDomain = $this->createDomainConfigMock(1, 'https://example.com', 'en', $this->defaultCurrency); + $this->defaultDomain = $this->createDomainConfigMock(Domain::FIRST_DOMAIN_ID, 'https://example.com', 'en', $this->defaultCurrency); $this->defaultProduct = $this->createMock(Product::class); $this->defaultProduct->method('getId')->willReturn(1);
use constants instead of hard-coded domain IDs (#<I>)
shopsys_product-feed-google
train
php
050835e660e43580f0fade8c6d8e0d0c19856d01
diff --git a/twython/twython.py b/twython/twython.py index <HASH>..<HASH> 100644 --- a/twython/twython.py +++ b/twython/twython.py @@ -348,9 +348,9 @@ class Twython(object): return Twython.construct_api_url(base_url, params) @staticmethod - def construct_api_url(base_url, params): + def construct_api_url(base_url, params=None): querystring = [] - params, _ = _transparent_params(params) + params, _ = _transparent_params(params or {}) params = requests.utils.to_key_val_list(params) for (k, v) in params: querystring.append(
construct_api_url params as kwarg Sometimes params isn't doesn't have to be passed [ci skip]
ryanmcgrath_twython
train
py
0853d5e1bd4cc43282b363faeac88f3562b700cd
diff --git a/moco-runner/src/main/java/com/github/dreamhead/moco/parser/model/websocket/WebsocketSetting.java b/moco-runner/src/main/java/com/github/dreamhead/moco/parser/model/websocket/WebsocketSetting.java index <HASH>..<HASH> 100644 --- a/moco-runner/src/main/java/com/github/dreamhead/moco/parser/model/websocket/WebsocketSetting.java +++ b/moco-runner/src/main/java/com/github/dreamhead/moco/parser/model/websocket/WebsocketSetting.java @@ -15,7 +15,7 @@ public class WebsocketSetting { private List<PingpongSession> pingpongs; private List<WebsocketSession> sessions; - public String getUri() { + public final String getUri() { return this.uri; } @@ -29,7 +29,7 @@ public class WebsocketSetting { } } - public void bind(final WebSocketServer webSocketServer) { + public final void bind(final WebSocketServer webSocketServer) { if (connected != null) { webSocketServer.connected(connected.asResource()); }
added missing final to websocket setting
dreamhead_moco
train
java
eda84f1c466d4d71d6a1692dc8a3720d53a44ed7
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -742,7 +742,8 @@ if (typeof parent !== 'function') { if (!parent.hasOwnProperty(prop)) { throw new RuntimeError(prop + - ' is not defined in the context data'); + ' is not defined in the context data', + entry); } return [null, parent[prop]]; }
Pass current entry information to RuntimeErrors in propertyExpressions
l20n_l20n.js
train
js
149a02c7b812ad887679fe6473983b28632b0559
diff --git a/lib/pundit.rb b/lib/pundit.rb index <HASH>..<HASH> 100644 --- a/lib/pundit.rb +++ b/lib/pundit.rb @@ -34,11 +34,13 @@ module Pundit if respond_to?(:helper_method) helper_method :policy_scope helper_method :policy + helper_method :pundit_user end if respond_to?(:hide_action) hide_action :authorize hide_action :verify_authorized hide_action :verify_policy_scoped + hide_action :pundit_user end end
pundit_user should be a helper and hidden as an action
varvet_pundit
train
rb
6f88c589d4d7260571fa5b0f9a401d4ca184232e
diff --git a/src/main/java/org/threeten/extra/chrono/PaxDate.java b/src/main/java/org/threeten/extra/chrono/PaxDate.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/threeten/extra/chrono/PaxDate.java +++ b/src/main/java/org/threeten/extra/chrono/PaxDate.java @@ -46,7 +46,6 @@ import java.time.Clock; import java.time.DateTimeException; import java.time.Instant; import java.time.LocalDate; -import java.time.Period; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.chrono.ChronoLocalDate; @@ -573,7 +572,7 @@ public final class PaxDate extends AbstractDate implements ChronoLocalDate, Seri final PaxDate sameYearEnd = end.plusYears(years); final int months = (int) monthsUntil(sameYearEnd); final int days = (int) daysUntil(sameYearEnd.plusMonths(months)); - return Period.of(Math.toIntExact(years), months, days); + return getChronology().period(Math.toIntExact(years), months, days); } @Override
Get chronology-sepecific period builder.
ThreeTen_threeten-extra
train
java
9a0d3c60adb613ab8b5b99f9bafa8fee40a45764
diff --git a/app/main.js b/app/main.js index <HASH>..<HASH> 100644 --- a/app/main.js +++ b/app/main.js @@ -4,9 +4,12 @@ const electron = require('electron') const {app, BrowserWindow} = electron const {ServerManager} = require('./servermanager.js') +const {getLogger} = require('./logging.js') + let serverManager = new ServerManager() +const mainLogger = getLogger('electron-main') let mainWindow @@ -20,7 +23,17 @@ function createWindow () { }) } -app.on('ready', () => {serverManager.start(); setTimeout(createWindow, 2000)}) +function startUp() { + serverManager.start(); + setTimeout(createWindow, 2000) + process.on('uncaughtException', function(error) { + if (process.listeners("uncaughtException").length > 1) { + main.info(error); + } + }); +} + +app.on('ready', startUp) app.on('quit', function(){ serverManager.shutdown(); diff --git a/server/main.py b/server/main.py index <HASH>..<HASH> 100755 --- a/server/main.py +++ b/server/main.py @@ -108,4 +108,8 @@ logging.basicConfig( ) if __name__ == "__main__": - socketio.run(app, debug=True, port=5000) + socketio.run( + app, + debug=os.environ.get('DEBUG', False), + port=5000 + )
refactor electron startup, logger; remove debug mode from flask server
Opentrons_opentrons
train
js,py
a28589203f3a4535689173a8927d397336094a15
diff --git a/framework/web/ErrorHandler.php b/framework/web/ErrorHandler.php index <HASH>..<HASH> 100644 --- a/framework/web/ErrorHandler.php +++ b/framework/web/ErrorHandler.php @@ -126,7 +126,7 @@ class ErrorHandler extends \yii\base\ErrorHandler if ($exception instanceof HttpException) { $array['status'] = $exception->statusCode; } - if (YII_DEBUG) { + if (YII_DEBUG && !$exception instanceof UserException) { $array['file'] = $exception->getFile(); $array['line'] = $exception->getLine(); $array['stack-trace'] = explode("\n", $exception->getTraceAsString());
do not show debug info for UserException
yiisoft_yii2
train
php
a2598e649de8b41727084749527aa0bc27965856
diff --git a/rpc/http.go b/rpc/http.go index <HASH>..<HASH> 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -6,6 +6,7 @@ import ( "io" "io/ioutil" "net/http" + "strings" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger/glog" @@ -39,7 +40,7 @@ func Start(pipe *xeth.XEth, config RpcConfig) error { if len(config.CorsDomain) > 0 { var opts cors.Options opts.AllowedMethods = []string{"POST"} - opts.AllowedOrigins = []string{config.CorsDomain} + opts.AllowedOrigins = strings.Split(config.CorsDomain, " ") c := cors.New(opts) handler = newStoppableHandler(c.Handler(JSONRPC(pipe)), l.stop)
Permit multiple CORS domains Separated by spaces
ethereum_go-ethereum
train
go
c00adcb4f5882f7c47e7612b199ca68d39225ea8
diff --git a/lib/jsduck/meta_tag.rb b/lib/jsduck/meta_tag.rb index <HASH>..<HASH> 100644 --- a/lib/jsduck/meta_tag.rb +++ b/lib/jsduck/meta_tag.rb @@ -16,8 +16,9 @@ module JsDuck # # It gets passed an array of contents gathered from all meta-tags # of given type. It should return an HTML string to inject into - # document. For help in that it can use the #markdown method to - # easily support markdown inside the meta-tag. + # document. For help in that it can use the #format method to + # easily support Markdown and {@link/img} tags inside the contents + # of meta-tag. # # By default the method returns nil, which means the tag will not # be rendered at all. @@ -27,8 +28,10 @@ module JsDuck # This is used to inject the formatter object for #markdown method attr_accessor :formatter - # Helper method to format the text - def markdown(text) + # Helper method to format the text in standard JsDuck way. + # This means running it through Markdown engine and expanding + # {@link} and {@img} tags. + def format(text) @formatter.format(text) end
Rename MetaTag#markdown to #format. More accurate, as it's not only Markdown. If one desires doing Markdown-only, then he can include RDiscount by himself and do whatever he wants.
senchalabs_jsduck
train
rb
c569537cf658163b0346daf2a941c2075d924023
diff --git a/session.go b/session.go index <HASH>..<HASH> 100644 --- a/session.go +++ b/session.go @@ -1646,12 +1646,12 @@ func (t *traceWriter) Trace(traceId []byte) { elapsed int ) - fmt.Fprintf(t.w, "Tracing session %016x (coordinator: %s, duration: %v):\n", - traceId, coordinator, time.Duration(duration)*time.Microsecond) - t.mu.Lock() defer t.mu.Unlock() + fmt.Fprintf(t.w, "Tracing session %016x (coordinator: %s, duration: %v):\n", + traceId, coordinator, time.Duration(duration)*time.Microsecond) + iter = t.session.control.query(`SELECT event_id, activity, source, source_elapsed FROM system_traces.events WHERE session_id = ?`, traceId)
tracing: ensure we hold the lock when writing to the writer (#<I>)
gocql_gocql
train
go
50d1242133bf2c9f500635068e942451e55bbd81
diff --git a/test/cr_complex_test.go b/test/cr_complex_test.go index <HASH>..<HASH> 100644 --- a/test/cr_complex_test.go +++ b/test/cr_complex_test.go @@ -740,6 +740,7 @@ func TestCrUnmergedSetMtimeOfRemovedDir(t *testing.T) { ) } +/* TODO: Investigate and enable this. // bob moves and sets the mtime of a file that was written by alice func TestCrConflictMoveAndSetMtimeWrittenFile(t *testing.T) { targetMtime := time.Now().Add(1 * time.Minute) @@ -770,3 +771,4 @@ func TestCrConflictMoveAndSetMtimeWrittenFile(t *testing.T) { ), ) } +*/
test: Disable TestCrConflictMoveAndSetMtimeWrittenFile for now
keybase_client
train
go
116a8b0f8689f6b14a3f509cca28950299ba74b3
diff --git a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCollapserTest.java b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCollapserTest.java index <HASH>..<HASH> 100644 --- a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCollapserTest.java +++ b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCollapserTest.java @@ -1086,7 +1086,7 @@ public class HystrixCollapserTest { } if (request.getArgument().equals("TIMEOUT")) { try { - Thread.sleep(200); + Thread.sleep(800); } catch (InterruptedException e) { e.printStackTrace(); }
Increased sleep time to make Timeout work as expected in HystrixCollapserTest
Netflix_Hystrix
train
java
19b034b71872213ed6639e44a9c8f467cf1981dd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from distutils.core import setup setup(name='pep381client', version='1.0', description='Mirroring tool that implements the client (mirror) side of PEP 381', - author=u'Martin v. Löwis', + author=u'Martin v. Löwis'.encode("utf-8"), author_email='martin@v.loewis.de', url='http://bitbucket.org/loewis/pep381client/', packages=['pep381client'],
Make sure sdist succeeds on Python <I>.
pypa_bandersnatch
train
py
94c816079c7480b53daae9d70b9aafa1c631da14
diff --git a/holoviews/element/tabular.py b/holoviews/element/tabular.py index <HASH>..<HASH> 100644 --- a/holoviews/element/tabular.py +++ b/holoviews/element/tabular.py @@ -289,11 +289,11 @@ class TableConversion(object): def heatmap(self, kdims=None, vdims=None, **kwargs): from .raster import HeatMap - return self._conversion(kdims, value_dimensions, HeatMap, **kwargs) + return self._conversion(kdims, vdims, HeatMap, **kwargs) def points(self, kdims=None, vdims=None, **kwargs): from .chart import Points - return self._conversion(kdims, value_dimensions, Points, **kwargs) + return self._conversion(kdims, vdims, Points, **kwargs) def scatter(self, kdims=None, vdims=None, **kwargs): from .chart import Scatter
TableConversion kdims/vdims arguments missed previously
pyviz_holoviews
train
py
fae093bbe20400f51c15ea11c059ecd604321a7e
diff --git a/pkg/services/ngalert/state/cache.go b/pkg/services/ngalert/state/cache.go index <HASH>..<HASH> 100644 --- a/pkg/services/ngalert/state/cache.go +++ b/pkg/services/ngalert/state/cache.go @@ -47,6 +47,8 @@ func (c *cache) getOrCreate(alertRule *ngModels.AlertRule, result eval.Result) * if _, ok := c.states[alertRule.OrgID]; !ok { c.states[alertRule.OrgID] = make(map[string]map[string]*State) + } + if _, ok := c.states[alertRule.OrgID][alertRule.UID]; !ok { c.states[alertRule.OrgID][alertRule.UID] = make(map[string]*State) }
Alerting: Fix state cache getOrCreate panic (#<I>)
grafana_grafana
train
go
f487456d91763fb06ab0960f81309222a3bd441a
diff --git a/bin/dbChangeManager.php b/bin/dbChangeManager.php index <HASH>..<HASH> 100755 --- a/bin/dbChangeManager.php +++ b/bin/dbChangeManager.php @@ -14,7 +14,7 @@ if (!isset($opts['c'])) { } if (!file_exists($opts['c'])) { - echo 'Configuration file not found! Please create db.ini', "\n"; + echo 'Configuration file not found! Please check that [', $opts['c'], '] exists or create it', "\n"; exit(1); }
Fix which file is specified in case the user has specified a custom one.
zimzat_db-changeset-manager
train
php
330fee13506ebd98f9a18e54042942ff51aee7dc
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index <HASH>..<HASH> 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -196,13 +196,6 @@ const ( // intended to be used for service account token verification. ServiceAccountIssuerDiscovery featuregate.Feature = "ServiceAccountIssuerDiscovery" - // owner: @krmayankk - // beta: v1.14 - // ga: v1.21 - // - // Enables control over the primary group ID of containers' init processes. - RunAsGroup featuregate.Feature = "RunAsGroup" - // owner: @saad-ali // ga: v1.10 // @@ -816,7 +809,6 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS VolumeCapacityPriority: {Default: false, PreRelease: featuregate.Alpha}, PreferNominatedNode: {Default: false, PreRelease: featuregate.Alpha}, ProbeTerminationGracePeriod: {Default: false, PreRelease: featuregate.Alpha}, - RunAsGroup: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 PodDeletionCost: {Default: true, PreRelease: featuregate.Beta}, TopologyAwareHints: {Default: false, PreRelease: featuregate.Alpha}, PodAffinityNamespaceSelector: {Default: false, PreRelease: featuregate.Alpha},
remove the RunAsGroup feature-gate
kubernetes_kubernetes
train
go
35ee2701c242d6b62e9230ec280071d79203bd61
diff --git a/app/models/shipit/stack.rb b/app/models/shipit/stack.rb index <HASH>..<HASH> 100644 --- a/app/models/shipit/stack.rb +++ b/app/models/shipit/stack.rb @@ -143,6 +143,18 @@ module Shipit end def trigger_deploy(*args, **kwargs) + if changed? + # If this is the first deploy since the spec changed it's possible the record will be dirty here, meaning we + # cant lock. In this one case persist the changes, otherwise log a warning and let the lock raise, so we + # can debug what's going on here. We don't expect anything other than the deploy spec to dirty the model + # instance, because of how that field is serialised. + if changes.keys == ['cached_deploy_spec'] + save! + else + Rails.logger.warning("#{changes.keys} field(s) were unexpectedly modified on stack #{id} while deploying") + end + end + run_now = kwargs.delete(:run_now) deploy = with_lock do deploy = build_deploy(*args, **kwargs)
Save the stack before locking if only the spec has changed
Shopify_shipit-engine
train
rb
d9c4f125cf5c0adc9cfc3a385ea0ba9264ddc438
diff --git a/config/config.php b/config/config.php index <HASH>..<HASH> 100644 --- a/config/config.php +++ b/config/config.php @@ -85,7 +85,7 @@ return [ ], // Laravel HTTP middleware - 'middleware' => [], + 'middleware' => null, // An array of middlewares, overrides the global ones 'execution_middleware' => null,
[skip ci] readme: default to `null` for the middleware Otherwise it would override the parent with an empty middleware set
rebing_graphql-laravel
train
php
3eebf207cc42199febf7a28c58b4b0dcaf4635e1
diff --git a/framework/core/src/Core/Post.php b/framework/core/src/Core/Post.php index <HASH>..<HASH> 100755 --- a/framework/core/src/Core/Post.php +++ b/framework/core/src/Core/Post.php @@ -37,6 +37,7 @@ use Illuminate\Database\Eloquent\Builder; * @property User|null $user * @property User|null $editUser * @property User|null $hideUser + * @property string $ip_address */ class Post extends AbstractModel {
fixes flarum/core#<I> phpdoc for ip_address on Post model
flarum_core
train
php
99b9c78b0034194d8ee27b9917e4d01fac8fb47f
diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -203,7 +203,13 @@ class NativeSessionStorage implements SessionStorageInterface $this->metadataBag->stampNew(); } - return session_regenerate_id($destroy); + $isRegenerated = session_regenerate_id($destroy); + + // The reference to $_SESSION in session bags is lost in PHP7 and we need to re-create it. + // @see https://bugs.php.net/bug.php?id=70013 + $this->loadSession(); + + return $isRegenerated; } /**
[HttpFoundation] Reload the session after regenerating its id
symfony_symfony
train
php
c04718b792aac000f769d3513c701062afaac056
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -25,6 +25,5 @@ setuptools.setup( "Development Status :: 2 - Pre-Alpha", "Programming Language :: Python :: 3.6", ], - include_package_data=True, python_requires='~=3.6', )
Ensure all resource files are included in sdist. Removed include_package_data since it is used to either include what is in the manifest or _everything_ in under version control, but seemingly only CVS or Subversion, not Git. Once removed, the package_data tag properly adds the stylesheet to the sdist.
nion-software_nionswift-instrumentation-kit
train
py
c795fbf042331e3d1a6cc72ad8342005f49655cc
diff --git a/cilium/cmd/policy_trace.go b/cilium/cmd/policy_trace.go index <HASH>..<HASH> 100644 --- a/cilium/cmd/policy_trace.go +++ b/cilium/cmd/policy_trace.go @@ -246,12 +246,12 @@ func getSecIDFromK8s(podName string) (string, error) { p, err := k8sClient.CoreV1().Pods(namespace).Get(pod, meta_v1.GetOptions{}) if err != nil { - return "", fmt.Errorf("unable to get pod %s in namespace %s", namespace, pod) + return "", fmt.Errorf("unable to get pod %s in namespace %s", pod, namespace) } secID := p.GetAnnotations()[common.CiliumIdentityAnnotation] if secID == "" { - return "", fmt.Errorf("cilium-identity annotation not set for pod %s in namespace %s", namespace, pod) + return "", fmt.Errorf("cilium-identity annotation not set for pod %s in namespace %s", pod, namespace) } return secID, nil
cilium/cmd: fix order of strings in error messages The "pod" and "namespace" fields were in the incorrect order in some error messages.
cilium_cilium
train
go
3f9e5dca25da81aa786b4568fbc3998b7d32b98d
diff --git a/xpathdebug.js b/xpathdebug.js index <HASH>..<HASH> 100644 --- a/xpathdebug.js +++ b/xpathdebug.js @@ -61,11 +61,11 @@ NodeTestAny.prototype.parseTree = function(indent) { return indent + '[nodetest] ' + this.toString() + '\n'; } -NodeTestElement.prototype.toString = function() { +NodeTestElementOrAttribute.prototype.toString = function() { return '*'; } -NodeTestElement.prototype.parseTree = NodeTestAny.prototype.parseTree; +NodeTestElementOrAttribute.prototype.parseTree = NodeTestAny.prototype.parseTree; NodeTestText.prototype.toString = function() { return 'text()';
Fix script error in xpathdebug; it's "NodeTestElementOrAttribute" now, not just "NodeTestElement".
fiduswriter_xslt-processor
train
js
850ebe57dc578b51a8d72982f8a39a1080484156
diff --git a/tests/PubSub/RedisDriverTest.php b/tests/PubSub/RedisDriverTest.php index <HASH>..<HASH> 100644 --- a/tests/PubSub/RedisDriverTest.php +++ b/tests/PubSub/RedisDriverTest.php @@ -2,10 +2,7 @@ namespace BeyondCode\LaravelWebSockets\Tests\PubSub; -use BeyondCode\LaravelWebSockets\PubSub\Drivers\RedisClient; use BeyondCode\LaravelWebSockets\Tests\TestCase; -use React\EventLoop\Factory as LoopFactory; -use BeyondCode\LaravelWebSockets\Tests\Mocks\RedisFactory; class RedisDriverTest extends TestCase {
Apply fixes from StyleCI (#<I>)
beyondcode_laravel-websockets
train
php
4ea00217a85a0b5067b47c54d6417c457bcee749
diff --git a/src/MvcCore/Router.php b/src/MvcCore/Router.php index <HASH>..<HASH> 100644 --- a/src/MvcCore/Router.php +++ b/src/MvcCore/Router.php @@ -795,7 +795,7 @@ class Router implements IRouter * founded, complete `\MvcCore\Router::$currentRoute` with new empty automaticly created route * targeting default controller and action by configuration in application instance (`Index:Index`) * and route type create by configured `\MvcCore\Application::$routeClass` class name. - * - Return `TRUE` if `\MvcCore\Router::$currentRoute` is route instance or `FALSE` for redirection. + * - Return `TRUE` if routing has no redirection or `FALSE` for redirection. * * This method is always called from core routing by: * - `\MvcCore\Application::Run();` => `\MvcCore\Application::routeRequest();`.
routers refactoring before implementing domain routing
mvccore_mvccore
train
php
268bb576370e3af1644ccd38f4bc4130e3d0e653
diff --git a/src/core/viz/expressions/buckets.js b/src/core/viz/expressions/buckets.js index <HASH>..<HASH> 100644 --- a/src/core/viz/expressions/buckets.js +++ b/src/core/viz/expressions/buckets.js @@ -59,7 +59,7 @@ let bucketUID = 0; * * @param {Number|String|Property} property - The property to be evaluated and interpolated * @param {Number[]|String[]} breakpoints - Numeric expression containing the different breakpoints. - * @return {Category} + * @return {Number} * * @memberof carto.expressions * @name buckets diff --git a/src/core/viz/expressions/ramp.js b/src/core/viz/expressions/ramp.js index <HASH>..<HASH> 100644 --- a/src/core/viz/expressions/ramp.js +++ b/src/core/viz/expressions/ramp.js @@ -9,7 +9,7 @@ import { customPalette } from '../functions'; * This expression will asign a color to every possible value in the property. * If there are more values than colors in the palette, new colors will be generated by linear interpolation. * -* @param {Category|Property} input - The input expression to give a color +* @param {Number|String|Property} input - The input expression to give a color * @param {Palette|Color[]|Number[]} palette - The color palette that is going to be used * @return {Number|Color} *
Update types for buckets/ramps
CartoDB_carto-vl
train
js,js
1f1aff6c5e872dbfd0a864cdcfc47cdc96a085cb
diff --git a/wal_e/cmd.py b/wal_e/cmd.py index <HASH>..<HASH> 100755 --- a/wal_e/cmd.py +++ b/wal_e/cmd.py @@ -32,7 +32,7 @@ from wal_e.exception import UserException from wal_e.operator import s3_operator from wal_e.piper import popen_sp from wal_e.worker.psql_worker import PSQL_BIN, psql_csv_run -from wal_e.pipeline import LZOP_BIN, MBUFFER_BIN +from wal_e.pipeline import LZOP_BIN, MBUFFER_BIN, GPG_BIN # TODO: Make controllable from userland log_help.configure( @@ -286,6 +286,9 @@ def main(argv=None): subcommand = args.subcommand + if gpg_key_id is not None: + external_program_check([GPG_BIN]) + try: if subcommand == 'backup-fetch': external_program_check([LZOP_BIN])
Check for the GPG binary if we need to
wal-e_wal-e
train
py
68da13d0e5064c6d959010298135428c9e91f1e3
diff --git a/docx2html/tests/test_xml.py b/docx2html/tests/test_xml.py index <HASH>..<HASH> 100644 --- a/docx2html/tests/test_xml.py +++ b/docx2html/tests/test_xml.py @@ -593,3 +593,33 @@ class StylesParsingTestCase(_TranslationTestCase): styles_xml = etree.fromstring(xml) styles_dict = get_style_dict(styles_xml) self.assertEqual(styles_dict['heading 1']['header'], 'h2') + + +class MangledIlvlTestCase(_TranslationTestCase): + expected_output = ''' + <html> + <ol data-list-type="decimal"> + <li>AAA</li> + </ol> + <ol data-list-type="decimal"> + <li>BBB + <ol data-list-type="decimal"> + <li>CCC</li> + </ol> + </li> + </ol> + </html> + ''' + + def get_xml(self): + li_text = [ + ('AAA', 0, 2), + ('BBB', 1, 1), + ('CCC', 0, 1), + ] + lis = '' + for text, ilvl, numId in li_text: + lis += DXB.li(text=text, ilvl=ilvl, numId=numId) + + xml = DXB.xml(lis) + return etree.fromstring(xml)
refs #<I>: added a test showing the incorrect behaviour
PolicyStat_docx2html
train
py
24bedcba1ca0bb51ff196ddf224bc08fe7177bca
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -127,22 +127,6 @@ class Collection implements Countable, IteratorAggregate, ArrayAccess return null; } - /** - * @see containsKey() - */ - public function __isset($key) - { - return $this->containsKey($key); - } - - /** - * @see remove() - */ - public function __unset($key) - { - return $this->remove($key); - } - /* ArrayAccess implementation */ /**
[<I>] More test coverage
doctrine_collections
train
php
c300f61809be344df26dcb2b9a9f98fd1d575c09
diff --git a/thali/NextGeneration/thaliMobileNativeWrapper.js b/thali/NextGeneration/thaliMobileNativeWrapper.js index <HASH>..<HASH> 100644 --- a/thali/NextGeneration/thaliMobileNativeWrapper.js +++ b/thali/NextGeneration/thaliMobileNativeWrapper.js @@ -434,8 +434,9 @@ module.exports.killConnections = function () { */ module.exports.emitter = new EventEmitter(); -if (typeof Mobile !== 'undefined' && !Mobile.iAmAMock) { -/* +// Currently skipping the Mobile calls since they are not +// implemented yet +if (false) { Mobile('PeerAvailabilityChange').registerToNative(function (peers) { // do stuff! }); @@ -457,7 +458,6 @@ if (typeof Mobile !== 'undefined' && !Mobile.iAmAMock) { function (portNumber) { // do stuff! }); -*/ } else { module.exports.emitter.on('networkChangedNonTCP', function (networkChangedValue) { // The value needs to be assigned here to nonTCPNetworkStatus
Skip Mobile calls that aren't implemented yet
thaliproject_Thali_CordovaPlugin
train
js
7f6bc124e5b88ad4727b80e4d1727288b5bfcda6
diff --git a/lib/forma/auto_initialize.rb b/lib/forma/auto_initialize.rb index <HASH>..<HASH> 100644 --- a/lib/forma/auto_initialize.rb +++ b/lib/forma/auto_initialize.rb @@ -11,6 +11,8 @@ module Forma def method_missing(method_name, *args, &block) if method_name.to_s[-1] == '=' @opts[ method_name.to_s.chop.to_sym ] = args[0] + elsif args.length == 1 + @opts[ method_name ] = args[0] else @opts[ method_name ] end diff --git a/spec/autoinit_spec.rb b/spec/autoinit_spec.rb index <HASH>..<HASH> 100644 --- a/spec/autoinit_spec.rb +++ b/spec/autoinit_spec.rb @@ -6,9 +6,11 @@ RSpec.describe Forma::AutoInitialize do before(:all) do @user = User.new(first_name: 'Dimitri', last_name: 'Kurashvili') @user.username = '555666777' + @user.number 42 end specify{ expect(@user.first_name).to eq('Dimitri') } specify{ expect(@user.last_name).to eq('Kurashvili') } specify{ expect(@user.username).to eq('555666777') } + specify{ expect(@user.number).to eq(42) } end
extend autoinit if we pass property value to the object like this: object.property value # without `=`! then property should be assigned
dimakura_forma
train
rb,rb
467d694d7ae3fdf1e9dd8ffa47e87a9559be666e
diff --git a/src/Bank/Engine/Zarinpal.php b/src/Bank/Engine/Zarinpal.php index <HASH>..<HASH> 100644 --- a/src/Bank/Engine/Zarinpal.php +++ b/src/Bank/Engine/Zarinpal.php @@ -95,7 +95,7 @@ class Bank_Engine_Zarinpal extends Bank_Engine if (isset($answer['Authority'])) { $receipt->setMeta('Authority', $answer['Authority']); - $receipt->callUrl = 'https://www.zarinpal.com/pg/StartPay/' . + $receipt->callURL= 'https://www.zarinpal.com/pg/StartPay/' . $answer['Authority']; return; }
Bug fixed: setting call url.
pluf_bank
train
php
7cc8dbe06f1b68f686266b218157f62ff4831786
diff --git a/tests/json-schema-test-suite-v4.js b/tests/json-schema-test-suite-v4.js index <HASH>..<HASH> 100644 --- a/tests/json-schema-test-suite-v4.js +++ b/tests/json-schema-test-suite-v4.js @@ -13,6 +13,22 @@ var should = require('should') ; var BLACKLISTED_TESTS = { + + 'zeroTerminatedFloats.json': { + '*': 'optional feature that can\'t be implemented in JavaScript' + }, + + 'format.json': { + 'validation of regular expressions': { + '*': 'Draft v3 feature removed from Draft v4, incorrectly remains in ' + + 'tests' + } + }, + + 'jsregex.json': { + '*': 'Draft v3 feature removed from Draft v4, incorrectly remains in tests' + } + }; function shouldSkip(jsonFile, testGroup, test) {
blacklist tests for "format": "regex", which is a v3 feature removed from v4 Now passes all remaining tests.
natesilva_jayschema
train
js
372ff147855d581d2b384e231e1e20a7c1a06181
diff --git a/lib/attr_encrypted/adapters/active_record.rb b/lib/attr_encrypted/adapters/active_record.rb index <HASH>..<HASH> 100644 --- a/lib/attr_encrypted/adapters/active_record.rb +++ b/lib/attr_encrypted/adapters/active_record.rb @@ -56,7 +56,11 @@ if defined?(ActiveRecord::Base) # We add accessor methods of the db columns to the list of instance # methods returned to let ActiveRecord define the accessor methods # for the db columns - if table_exists? + + # Use with_connection so the connection doesn't stay pinned to the thread. + connected = ::ActiveRecord::Base.connection_pool.with_connection(&:active?) rescue false + + if connected && table_exists? columns_hash.keys.inject(super) {|instance_methods, column_name| instance_methods.concat [column_name.to_sym, :"#{column_name}="]} else super
Only lookup ActiveRecord column names when connected to the DB.
attr-encrypted_attr_encrypted
train
rb
5664138fa5dafc2cffff9f5f416ff0d43907c193
diff --git a/django_ses/signals.py b/django_ses/signals.py index <HASH>..<HASH> 100644 --- a/django_ses/signals.py +++ b/django_ses/signals.py @@ -1,7 +1,6 @@ from django.dispatch import Signal -bounce_received = Signal(providing_args=["mail_obj", "bounce_obj", "raw_message"]) - -complaint_received = Signal(providing_args=["mail_obj", "complaint_obj", "raw_message"]) - -delivery_received = Signal(providing_args=["mail_obj", "delivery_obj", "raw_message"]) +# The following fields are used from the 3 signals below: mail_obj, bounce_obj, raw_message +bounce_received = Signal() +complaint_received = Signal() +delivery_received = Signal()
Removed `providing_args` for signals referring to deprecation warning… (#<I>) * Removed `providing_args` for signals referring to deprecation warning in django <I> * Added comment about the removed variable for the signals
django-ses_django-ses
train
py
40b5a3f167af30d082094a9dad7d34b57d3ae544
diff --git a/lib/thinreports/report/internal.rb b/lib/thinreports/report/internal.rb index <HASH>..<HASH> 100644 --- a/lib/thinreports/report/internal.rb +++ b/lib/thinreports/report/internal.rb @@ -96,6 +96,8 @@ module Thinreports end def init_layout(filename, id = nil) + filename = filename.to_path if filename.is_a?(Pathname) + Thinreports::Layout.new(filename, id: id) end end diff --git a/test/units/report/test_internal.rb b/test/units/report/test_internal.rb index <HASH>..<HASH> 100644 --- a/test/units/report/test_internal.rb +++ b/test/units/report/test_internal.rb @@ -20,6 +20,11 @@ class Thinreports::Report::TestInternal < Minitest::Test assert_equal internal.default_layout.filename, @layout_file.path end + def test_pathname_layout_specified_in_new_method_should_be_defined_as_default_layout + internal = Report::Internal.new(report, layout: Pathname(@layout_file.path)) + assert_equal internal.default_layout.filename, @layout_file.path + end + def test_register_layout_should_be_set_as_default_layout_when_options_are_omitted internal = Report::Internal.new(report, {}) internal.register_layout(@layout_file.path)
Support Pathname layout option on Thinreports::Report
thinreports_thinreports-generator
train
rb,rb
5a11d25b80925d2178e255d66da46273f64cfaa1
diff --git a/lib/confuse/config.rb b/lib/confuse/config.rb index <HASH>..<HASH> 100644 --- a/lib/confuse/config.rb +++ b/lib/confuse/config.rb @@ -14,8 +14,8 @@ module Confuse def initialize(*paths) load_namespaces(self.class.namespaces) - read_files(self.class.config_path) - read_files(paths) + read_files(self.class.config_path.flatten) + read_files(paths.flatten) end def config
flatten arrays in initialization, so we can pass multiple files at once
mediasp_confuse
train
rb
b53f7b1204b727da2e9c1de3a21b4f3dadd293a1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ setup( description="a liking app for Django", name="pinax-likes", long_description=LONG_DESCRIPTION, - version="2.2.2", + version="3.0.0", url="http://github.com/pinax/pinax-likes/", license="MIT", packages=find_packages(),
Updating version in set.py
pinax_pinax-likes
train
py
98e0b5ca7d7109a6c26a1199d254e1bc1aa2b849
diff --git a/nosedjangotests/polls/tests/test0.py b/nosedjangotests/polls/tests/test0.py index <HASH>..<HASH> 100644 --- a/nosedjangotests/polls/tests/test0.py +++ b/nosedjangotests/polls/tests/test0.py @@ -60,13 +60,6 @@ class FixtureBleedThroughTestCase(TestCase): class NonFixtureBleedThroughTestCase(TestCase): - @contextmanager - def set_autocommit(self, value): - old_value = transaction.get_autocommit() - transaction.set_autocommit(value) - yield - transaction.set_autocommit(old_value) - def test_AAA_create_a_poll(self): with set_autocommit(True): with atomic(): @@ -77,3 +70,11 @@ class NonFixtureBleedThroughTestCase(TestCase): def test_BBB_no_polls_in_the_db(self): self.assertEqual(Poll.objects.count(), 0) + + +class FixtureBleedThroughWithoutTransactionManagementTestCase(FixtureBleedThroughTestCase): # noqa + use_transaction_isolation = False + + +class NonFixtureBleedThroughWithoutTransactionManagementTestCase(NonFixtureBleedThroughTestCase): # noqa + use_transaction_isolation = False
refs #<I>: Added more tests.
nosedjango_nosedjango
train
py
8e0cc7859b5865bf1382bf1284e4f7a894f58dac
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,8 @@ setup( 'Documentation': 'https://bitsets.readthedocs.io', 'Changelog': 'https://bitsets.readthedocs.io/en/latest/changelog.html', 'Issue Tracker': 'https://github.com/xflr6/bitsets/issues', + 'CI': 'https://travis-ci.org/xflr6/bitsets', + 'Coverage': 'https://codecov.io/gh/xflr6/bitsets', }, packages=find_packages(), platforms='any',
add Travis CI and Codecov to project_urls
xflr6_bitsets
train
py
8117bd4d6d50c6b87b73bfe2f5846e2e76f9d75a
diff --git a/spec/factories/pd_regime_bags.rb b/spec/factories/pd_regime_bags.rb index <HASH>..<HASH> 100644 --- a/spec/factories/pd_regime_bags.rb +++ b/spec/factories/pd_regime_bags.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :pd_regime_bag do bag_type - volume 1 + volume 200 per_week 3 monday true tuesday false
Adjusted pd_regime_bag 'volume' to meet validation max/min values.
airslie_renalware-core
train
rb
75765bedae8a8511260d43ec7f46edc994899c7c
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -21,7 +21,7 @@ describe Oxidized::CLI do File.expects(:expand_path) Kernel.expects(:exit) - assert_output("#{Oxidized::VERSION}\n") { Oxidized::CLI.new } + assert_output("#{Oxidized::VERSION_FULL}\n") { Oxidized::CLI.new } end end end
fix cli_spec.rb to reflect new version output
ytti_oxidized
train
rb
56754e6de34da6a4102ee5011b3f61cf86c4ef16
diff --git a/panphon/distance.py b/panphon/distance.py index <HASH>..<HASH> 100644 --- a/panphon/distance.py +++ b/panphon/distance.py @@ -560,7 +560,7 @@ class Distance(object): float: sum of weighted feature difference for each feature pair in zip(v1, v2) """ - return sum([abs(ft1 - ft2) / 2 * w + return sum([abs(ft1 - ft2) * w for (w, ft1, ft2) in zip(self.fm.weights, v1, v2)]) * gl_wt
Removed erroneous divsor
dmort27_panphon
train
py
9f7e6605b508f3c40fcf86ebcb6d4d50ae7dd7b8
diff --git a/local_settings/loader.py b/local_settings/loader.py index <HASH>..<HASH> 100644 --- a/local_settings/loader.py +++ b/local_settings/loader.py @@ -24,7 +24,7 @@ class Loader(Base): parser = self._make_parser() with open(self.file_name) as fp: parser.read_file(fp) - extends = parser[self.section].pop('extends', None) + extends = parser[self.section].get('extends') settings = OrderedDict() if extends: extends = self._parse_setting(extends, expand_vars=True) @@ -87,6 +87,7 @@ class Loader(Base): self.registry[curr_v] = name obj[name] = v settings.move_to_end(names[0]) + settings.pop('extends', None) self._do_interpolation(settings, settings) return settings
Change where `extends` is removed from loaded settings Popping `extends` from the ConfigParser section can cause a KeyError in some circumstances. Refs 0f<I>b0ff<I>b<I>f3e7f<I>c<I>f<I>
PSU-OIT-ARC_django-local-settings
train
py
d8217c41946c8bd147623cc500718f03d7643b79
diff --git a/analyzers/DShield/DShield_lookup.py b/analyzers/DShield/DShield_lookup.py index <HASH>..<HASH> 100755 --- a/analyzers/DShield/DShield_lookup.py +++ b/analyzers/DShield/DShield_lookup.py @@ -15,6 +15,15 @@ class DShieldAnalyzer(Analyzer): r = requests.get(url) return json.loads(r.text) + def artifacts(self, raw): + artifacts = [] + if 'as' in raw: + artifacts.append({'type':'autonomous-system','value':str(raw['as'])}) + + if 'asabusecontact' in raw: + artifacts.append({'type': 'email', 'value':str(raw['asabusecontact'])}) + return artifacts + def summary(self, raw): taxonomies = [] value = "-"
#<I> add extraction of observables AS and asabusecontact
TheHive-Project_Cortex-Analyzers
train
py
3af581d3d98bc6fe2d8afa10ed34317b328600d2
diff --git a/src/cr/cube/crunch_cube.py b/src/cr/cube/crunch_cube.py index <HASH>..<HASH> 100644 --- a/src/cr/cube/crunch_cube.py +++ b/src/cr/cube/crunch_cube.py @@ -152,7 +152,8 @@ class CrunchCube(DataTable): i - dim_offset in include_transforms_for_dims) if dim.type == 'multiple_response': dim_offset += 1 - if not transform or dim.type in ITEM_DIMENSION_TYPES: + if (not transform or + dim.type in ITEM_DIMENSION_TYPES or dim.is_selections): continue # Perform transformations insertions = self._insertions(res, dim, i) diff --git a/src/cr/cube/dimension.py b/src/cr/cube/dimension.py index <HASH>..<HASH> 100644 --- a/src/cr/cube/dimension.py +++ b/src/cr/cube/dimension.py @@ -179,6 +179,9 @@ class Dimension(object): @lazyproperty def hs_indices(self): '''Headers and Subtotals indices.''' + if self.is_selections: + return [] + eid = self.elements_by_id indices = []
Guard against H&S in MR
Crunch-io_crunch-cube
train
py,py
52382cbe6f238e3507a059e05ec51a047c25ad78
diff --git a/server.py b/server.py index <HASH>..<HASH> 100644 --- a/server.py +++ b/server.py @@ -156,7 +156,8 @@ def rs_member_add(rs_id): if json_data: data = json.loads(json_data) try: - result = RS().rs_member_add(rs_id, data) + if RS().rs_member_add(rs_id, data): + result = RS().rs_members(rs_id) except StandardError as e: print repr(e) return send_result(400)
return list of all members after successfully added new member
10gen_mongo-orchestration
train
py
c620fa0139cbcf41d7d6404c40908c5b075ef468
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -14,10 +14,6 @@ var usbtiny = function(options) { this.device = {}; this.log = options.log || function(){}; this.options = options; - - if (process.platform.toLowerCase() === 'darwin') { - fixOSX.call(this); - } }; function fixOSX() { @@ -37,6 +33,11 @@ usbtiny.prototype.open = function(cb){ var device = usb.findByIds(this.options.vid, this.options.pid); self.device = device; + + if (process.platform.toLowerCase() === 'darwin') { + fixOSX.call(this); + } + self.device.open(cb); };
move osx usb fix to after device is created
jacobrosenthal_usbtinyisp
train
js
f1093d9e65e844fa2167f0bd4576bf3d97c74d52
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ install_requires = [ "django-cms==3.1.0.b1", "django-filer==0.9.9", 'django-friendly-tag-loader==1.2', - "django-lab-members>=0.2.0,<0.3.0", + "django-lab-members>=0.2.4,<0.3.0", "django-mptt==0.6.1", "django-polymorphic==0.6.1", "django-reversion==1.8.5",
Bump required version of django-lab-members to <I>
mfcovington_djangocms-lab-members
train
py
0721d594150d0dc05e18667960206dfd19177d4a
diff --git a/packages/builder/src/link.js b/packages/builder/src/link.js index <HASH>..<HASH> 100644 --- a/packages/builder/src/link.js +++ b/packages/builder/src/link.js @@ -50,14 +50,15 @@ try { process.exit(1) } -const skpmConfig = getSkpmConfigFromPackageJSON(packageJSON) +const skpmConfig = getSkpmConfigFromPackageJSON(packageJSON, argv) if (!skpmConfig.main) { - console.warn( - `${chalk.yellow( - 'warning' + console.error( + `${chalk.red( + 'error' )} Missing "skpm.main" fields in the package.json. Should point to the ".sketchplugin" file` ) + process.exit(1) } if (!skpmConfig.name) {
Added the argv in the getSkpmConfigFromPackageJSON Also reverted the skpm.main check
skpm_skpm
train
js
2d0c48e91b1b219d613c5a77d22e9a0560bcfd5b
diff --git a/src/main/java/net/finmath/marketdata/model/curves/CurveFromInterpolationPoints.java b/src/main/java/net/finmath/marketdata/model/curves/CurveFromInterpolationPoints.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/finmath/marketdata/model/curves/CurveFromInterpolationPoints.java +++ b/src/main/java/net/finmath/marketdata/model/curves/CurveFromInterpolationPoints.java @@ -137,6 +137,11 @@ public class CurveFromInterpolationPoints extends AbstractCurve implements Seria } @Override + public String toString() { + return "Point [time=" + time + ", value=" + value + ", isParameter=" + isParameter + "]"; + } + + @Override public Object clone() { return new Point(time,value,isParameter); }
Added toString to CurveFromInterpolationPoints.Point Useful for debugging.
finmath_finmath-lib
train
java
4ea402d2b05a4fa0ac8e5034ef6f9ff205676744
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -58,11 +58,9 @@ def pyusb_scm_version(): } -# workaround: -# sdist installs with callables were broken between -# "setuptools_scm >=1.8, <=1.10.1" and of course ubuntu 16.04 ships -# with setuptools_scm==1.10.1 ... -# since we're not using "root" we can just noop +# workaround: sdist installs with callables were broken between "setuptools_scm +# >=1.8, <=1.10.1" and Ubuntu 16.04 ships with 1.10.1; since we're not using +# "root" we can just noop (see pypa/setuptools_scm@ff948dcd99) pyusb_scm_version.pop = lambda *_: None
Link workaround to corresponding setuptools_scm bug fix
pyusb_pyusb
train
py
278687d1383d61fe559603dad018befb9ece1b75
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,7 +32,7 @@ sys.path.insert(0, os.path.abspath('../')) # ones. extensions = [ 'sphinx.ext.autodoc', - 'sphinx.ext.githubpages', +# 'sphinx.ext.githubpages', ] # Add any paths that contain templates here, relative to this directory.
Minor change to conf.py
Parsl_parsl
train
py
e73219cdcc51866ddac2a82c810bda8c8046d743
diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb index <HASH>..<HASH> 100644 --- a/lib/chef/util/windows/net_user.rb +++ b/lib/chef/util/windows/net_user.rb @@ -138,8 +138,11 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows ptr = 0.chr * PTR_SIZE rc = NetUserGetInfo.call(nil, @name, 3, ptr) - raise Chef::Exceptions::UserIDNotFound, get_last_error(rc) if rc == NERR_UserNotFound - raise ArgumentError, get_last_error(rc) if rc != NERR_Success + if rc == NERR_UserNotFound + raise Chef::Exceptions::UserIDNotFound, get_last_error(rc) + elsif rc != NERR_Success + raise ArgumentError, get_last_error(rc) + end ptr = ptr.unpack('L')[0] buffer = 0.chr * SIZEOF_USER_INFO_3
unpack the conditionals a little for readability
chef_chef
train
rb
4c832158329593dc7a97dde5dde65d342add5c84
diff --git a/lib/cisco_node_utils/client/utils.rb b/lib/cisco_node_utils/client/utils.rb index <HASH>..<HASH> 100644 --- a/lib/cisco_node_utils/client/utils.rb +++ b/lib/cisco_node_utils/client/utils.rb @@ -151,7 +151,7 @@ class Cisco::Client end return final end - fail "No key \"#{filter}\" in #{data}" if data[filter].nil? + fail "No key \"#{filter}\" in #{data}" unless data.key?(filter) data = data[filter] end end diff --git a/lib/cisco_node_utils/node.rb b/lib/cisco_node_utils/node.rb index <HASH>..<HASH> 100644 --- a/lib/cisco_node_utils/node.rb +++ b/lib/cisco_node_utils/node.rb @@ -122,7 +122,10 @@ module Cisco value = value.is_a?(Hash) ? [value] : value data = nil value.each do |row| - data = row[data_key] if row[row_key].to_s[/#{row_index}/] + if row[row_key].to_s[/#{row_index}/] + data = row[data_key] + data = data.nil? ? '' : data + end end return value if data.nil? if regexp_filter
Structured output needs to handle nil value cases
cisco_cisco-network-node-utils
train
rb,rb
5e37596a844e4a9e2ed370475b1f543cb42758e4
diff --git a/lib/smart_titles/helper.rb b/lib/smart_titles/helper.rb index <HASH>..<HASH> 100644 --- a/lib/smart_titles/helper.rb +++ b/lib/smart_titles/helper.rb @@ -29,7 +29,7 @@ module SmartTitles # * Set custom title for the current page if it is passed. Otherwise the title will be automatically set # * Return the title passed or looked up from locale wrapped into h1 tag def title(custom_title = nil) - provide(:page_title, custom_title) + provide(:page_title, custom_title || page_title) content_tag(:h1, page_title) if page_title end
Fix bug Calling just #title without arguments causes head_title use default title instead of translated. Couldn't reproduce this in test :-(
semaperepelitsa_smart_titles
train
rb
ca94993a0a0b30e63c3ac5f83113836261b9b38a
diff --git a/photutils/aperture/core.py b/photutils/aperture/core.py index <HASH>..<HASH> 100644 --- a/photutils/aperture/core.py +++ b/photutils/aperture/core.py @@ -720,7 +720,7 @@ def _prepare_photometry_input(data, error, pixelwise_error, mask, wcs, unit): unit = None if isinstance(data, u.Quantity): - if data.unit != unit: + if unit is not None and data.unit != unit: warnings.warn('The input unit does not agree with the data ' 'unit.', AstropyUserWarning) else:
Fix units if hdu has unit but no input input
astropy_photutils
train
py
7b379aecef364003e54fbbe823a232185d474f30
diff --git a/shoebot/grammar/grammar.py b/shoebot/grammar/grammar.py index <HASH>..<HASH> 100644 --- a/shoebot/grammar/grammar.py +++ b/shoebot/grammar/grammar.py @@ -170,6 +170,7 @@ class Grammar(object): ## TODO: Not used when running as a bot, possibly should not be available in ## this case self._canvas.flush(self._frame) + self._canvas.sink.finish() #### Variables def _addvar(self, v):
bot.finish() does what it should when running as a python module
shoebot_shoebot
train
py
aaa1263e348ee8e54f0621a1814491c52362925b
diff --git a/simplefix/constants.py b/simplefix/constants.py index <HASH>..<HASH> 100644 --- a/simplefix/constants.py +++ b/simplefix/constants.py @@ -963,9 +963,9 @@ SESSIONREJECTREASON_OTHER = b'99' # Tag 423 TAG_PRICETYPE = b'423' -PRICETYPE_PERCENTAGE= b'1' -PRICETYPE_PER_UNIT= b'2' -PRICETYPE_FIXED_AMOUNT= b'3' +PRICETYPE_PERCENTAGE = b'1' +PRICETYPE_PER_UNIT = b'2' +PRICETYPE_FIXED_AMOUNT = b'3' # Tag 434 TAG_CXLREJRESPONSETO = b'434'
Add missing spaces (via deepsource).
da4089_simplefix
train
py
dbca64f47d15357f0901656a022c713194900390
diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -2,7 +2,6 @@ const spawn = require('child_process').spawn; const path = require('path'); -const pkginfo = require('pkginfo'); const camelcase = require('camelcase'); const stringSimilarity = require('string-similarity'); @@ -341,6 +340,7 @@ module.exports = { checkVersion(parent) { // Load parent module try { + const pkginfo = require('pkginfo'); pkginfo(parent); } catch (err) { // Do nothing, but version could not be aquired
Require pkginfo only if needed (#<I>)
leo_args
train
js
9399edce776c0d8e760bc3c486ca9266ce757c7c
diff --git a/pykitti/raw.py b/pykitti/raw.py index <HASH>..<HASH> 100644 --- a/pykitti/raw.py +++ b/pykitti/raw.py @@ -173,7 +173,6 @@ class raw: # Find all the data files oxts_path = os.path.join(self.data_path, 'oxts', 'data', '*.txt') oxts_files = sorted(glob.glob(oxts_path)) - print(oxts_files) # Subselect the chosen range of frames, if any if self.frame_range:
Removed extraneous print statement
utiasSTARS_pykitti
train
py
838f0625ba471f64132b25f95c248de55cf83c53
diff --git a/code/libraries/koowa/template/helper/helper.php b/code/libraries/koowa/template/helper/helper.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/template/helper/helper.php +++ b/code/libraries/koowa/template/helper/helper.php @@ -31,7 +31,7 @@ class KTemplateHelper //Create the template helper try { - if(is_string($identifier) && strpos($identifier, '.') === false ) { + if(is_string($identifier) && strpos($identifier, 'com.') === false ) { $identifier = 'com.default.template.helper.'.trim($identifier); }
Fixed issue with partial helper identifiers. Partials are of the format 'helper.function'. Check for the existence of 'com.' to determine of the identifier is complete or not.
joomlatools_joomlatools-framework
train
php
90710fc4359ea16b4ae65ce60bae64d84e51f58c
diff --git a/kuyruk/master.py b/kuyruk/master.py index <HASH>..<HASH> 100644 --- a/kuyruk/master.py +++ b/kuyruk/master.py @@ -232,7 +232,7 @@ def parse_queues_str(s): :param s: Command line or configuration queues string :return: list of queue names """ - queues = (q.strip() for q in s.split(',')) + queues = filter(None, [q.strip() for q in s.split(',')]) return list(itertools.chain.from_iterable(expand_count(q) for q in queues)) diff --git a/kuyruk/worker.py b/kuyruk/worker.py index <HASH>..<HASH> 100644 --- a/kuyruk/worker.py +++ b/kuyruk/worker.py @@ -51,6 +51,9 @@ class Worker(KuyrukProcess): """ def __init__(self, kuyruk, queue_name): + if not queue_name: + raise ValueError("empty queue name") + super(Worker, self).__init__(kuyruk) self.channel = self.kuyruk.channel() is_local = queue_name.startswith('@')
do not allow empty queue name in worker
cenkalti_kuyruk
train
py,py
579bf8ef2dbe18a8afbcba4330a4d7b8eb675ebd
diff --git a/source/index.node.js b/source/index.node.js index <HASH>..<HASH> 100644 --- a/source/index.node.js +++ b/source/index.node.js @@ -1 +1,7 @@ +const { getSharedAppEnv } = require("./env/core/singleton.js"); +const { applyNativeConfiguration } = require("./env/native/index.js"); + +const appEnv = getSharedAppEnv(); +applyNativeConfiguration(appEnv); + module.exports = require("./index.common.js"); diff --git a/source/index.web.js b/source/index.web.js index <HASH>..<HASH> 100644 --- a/source/index.web.js +++ b/source/index.web.js @@ -1 +1,7 @@ +const { getSharedAppEnv } = require("./env/core/singleton.js"); +const { applyWebConfiguration } = require("./env/web/index.js"); + +const appEnv = getSharedAppEnv(); +applyWebConfiguration(appEnv); + module.exports = require("./index.common.js");
Execute app env from indexes
buttercup_buttercup-core
train
js,js
7f477585faccf1d26b20f5217f99c279544f2cf2
diff --git a/manage.py b/manage.py index <HASH>..<HASH> 100644 --- a/manage.py +++ b/manage.py @@ -1,10 +1,10 @@ -import sys +#!/usr/bin/env python import os +import sys -os.environ['DJANGO_SETTINGS_MODULE'] = 'django_mailbox.tests.settings' +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") -from django.core import management + from django.core.management import execute_from_command_line -if len(sys.argv) > 1 and sys.argv[1] == 'test': - management.execute_from_command_line() - sys.exit() \ No newline at end of file + execute_from_command_line(sys.argv)
Update manage.py to Python3 compatibility
coddingtonbear_django-mailbox
train
py
ddc7cb8cc6ab31a872f54f423de87558de125e16
diff --git a/host/analysis/plotting/plotting.py b/host/analysis/plotting/plotting.py index <HASH>..<HASH> 100644 --- a/host/analysis/plotting/plotting.py +++ b/host/analysis/plotting/plotting.py @@ -4,6 +4,7 @@ from matplotlib import colors, cm def make_occupancy(cols, rows, max_occ = None): + plt.clf() H, xedges, yedges = np.histogram2d(rows, cols, bins = (336, 80), range = [[1,336], [1,80]]) #print xedges, yedges extent = [yedges[0]-0.5, yedges[-1]+0.5, xedges[-1]+0.5, xedges[0]-0.5] @@ -18,9 +19,12 @@ def make_occupancy(cols, rows, max_occ = None): plt.ylabel('Row') plt.colorbar(boundaries = bounds, cmap = cmap, norm = norm, ticks = bounds) -def plot_occupancy(cols, rows, max_occ = None): +def plot_occupancy(cols, rows, max_occ = None, filename = None): make_occupancy(cols, rows, max_occ) - plt.show() + if filename is None: + plt.show() + else: + plt.savefig(filename) def save_occupancy(filename, cols, rows, max_occ = None): make_occupancy(cols, rows, max_occ)
WORKING RELEASE backup copy just in case
SiLab-Bonn_pyBAR
train
py
702bbb608446f74895748ae06aa18d43c1b00376
diff --git a/src/indexeddb.js b/src/indexeddb.js index <HASH>..<HASH> 100644 --- a/src/indexeddb.js +++ b/src/indexeddb.js @@ -359,6 +359,10 @@ } }.bind(this); event.resolve = makeResolver(local, path); + }, + + closeDB: function() { + this.db.close(); } }; @@ -410,7 +414,10 @@ return 'indexedDB' in global; } - RS.IndexedDB._rs_cleanup = function() { + RS.IndexedDB._rs_cleanup = function(remoteStorage) { + if(remoteStorage.local) { + remoteStorage.local.closeDB(); + } var promise = promising(); RS.IndexedDB.clean(DEFAULT_DB_NAME, function() { promise.fulfill();
indexeddb: close database before attempting to delete it
remotestorage_remotestorage.js
train
js
e0f7cade5a085a68d9db69403bac0671cceb35c4
diff --git a/eZ/Bundle/EzPublishDebugBundle/Collector/TemplateDebugInfo.php b/eZ/Bundle/EzPublishDebugBundle/Collector/TemplateDebugInfo.php index <HASH>..<HASH> 100644 --- a/eZ/Bundle/EzPublishDebugBundle/Collector/TemplateDebugInfo.php +++ b/eZ/Bundle/EzPublishDebugBundle/Collector/TemplateDebugInfo.php @@ -91,6 +91,7 @@ class TemplateDebugInfo { // Ignore the exception thrown by legacy kernel as this would break debug toolbar (and thus debug info display). // Furthermore, some legacy kernel handlers don't support runCallback (e.g. ezpKernelTreeMenu) + $templateStats = array(); } foreach ( $templateStats as $tplInfo )
EZP-<I>: Avoid PHP notice because of uninitialized variable
ezsystems_ezpublish-kernel
train
php
b5039f5d15e302708867d3fce6afb8b5d999bcef
diff --git a/backup/restorelib.php b/backup/restorelib.php index <HASH>..<HASH> 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -593,12 +593,10 @@ delete_records('block_instance', 'pageid', $restore->course_id, 'pagetype', PAGE_COURSE_VIEW); if (empty($backup_block_format)) { // This is a backup from Moodle < 1.5 if (empty($blockinfo)) { - echo ' (pre 1.3)'; //debug // Looks like it's from Moodle < 1.3. Let's give the course default blocks... $newpage = page_create_object(PAGE_COURSE_VIEW, $restore->course_id); blocks_repopulate_page($newpage); } else { - echo ' (1.3-1.4)'; //debug // We just have a blockinfo field, this is a legacy 1.4 or 1.3 backup $blockrecords = get_records_select('block', '', '', 'name, id'); $temp_blocks_l = array(); @@ -633,7 +631,6 @@ } } } else if($backup_block_format == 'instances') { - echo ' (1.5)'; //debug $status = restore_create_block_instances($restore,$xml_file); }
Removing some diagnostic output that had been forgotten.
moodle_moodle
train
php
377ff15d8b930f42bb9c8c95ddda4ff43238cca3
diff --git a/sprinter/formula/perforce.py b/sprinter/formula/perforce.py index <HASH>..<HASH> 100644 --- a/sprinter/formula/perforce.py +++ b/sprinter/formula/perforce.py @@ -125,11 +125,12 @@ class PerforceFormula(FormulaBase): self.logger.info("Writing p4settings...") root_dir = os.path.expanduser(config.get('root_path')) p4settings_path = os.path.join(root_dir, ".p4settings") - if not os.path.exists(p4settings_path) or self.target.get('overwrite_p4settings', False): - self.logger.info("Overwriting existing p4settings...") - os.remove(p4settings_path) - else: - return + if os.path.exists(p4settings_path): + if self.target.get('overwrite_p4settings', False): + self.logger.info("Overwriting existing p4settings...") + os.remove(p4settings_path) + else: + return with open(p4settings_path, "w+") as p4settings_file: p4settings_file.write(p4settings_template % config.to_dict()) if config.get('write_password_p4settings'):
Fixing boolean logic on perforce
toumorokoshi_sprinter
train
py
89387b1b26667c2dce5e2b796d1c1c30bb2ffcbc
diff --git a/tests/js/browser/browser-forgot-test.js b/tests/js/browser/browser-forgot-test.js index <HASH>..<HASH> 100644 --- a/tests/js/browser/browser-forgot-test.js +++ b/tests/js/browser/browser-forgot-test.js @@ -67,7 +67,7 @@ fluid.defaults("gpii.express.user.tests.forgot.client.caseHolder", { { event: "{testEnvironment}.browser.events.onWaitComplete", listener: "{testEnvironment}.browser.evaluate", - args: [gpii.tests.browser.tests.elementMatches, ".reset-error", "The passwords you have entered don't match."] + args: [gpii.tests.browser.tests.elementMatches, ".fieldError", "The 'confirm' field must match the 'password' field."] }, { event: "{testEnvironment}.browser.events.onEvaluateComplete",
GPII-<I>: Updated tests to match new JSON Schema validation output rather than legacy message.
GPII_gpii-express-user
train
js
f4fd94570c2020d0832d65aad2ae02e908d21e26
diff --git a/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb b/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb index <HASH>..<HASH> 100644 --- a/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb +++ b/acceptance/setup/aio/pre-suite/020_AIO_Workarounds.rb @@ -8,3 +8,20 @@ step "(PUP-4004) Set permissions on puppetserver directories that currently live end on master, "chown -R puppet:puppet /opt/puppetlabs/puppet/cache" on master, "chmod -R 750 /opt/puppetlabs/puppet/cache" + +# The AIO puppet-agent package does not create the puppet user or group, but +# puppet-server does. However, some puppet acceptance tests assume the user +# is present. This is a temporary setup step to create the puppet user and +# group, but only on nodes that are agents and not the master +test_name '(PUP-3997) Puppet User and Group on agents only' do + agents.each do |agent| + if agent == master + step "Skipping creating puppet user and group on #{agent}" + else + step "Ensure puppet user and group added to #{agent}" do + on agent, puppet("resource user puppet ensure=present") + on agent, puppet("resource group puppet ensure=present") + end + end + end +end
(maint) Create the puppet user and group on agents Our acceptance tests assume the puppet user and group exist on both master and agent. This commit adds a setup step for aio to ensure it exists on agent-only hosts. It is not necessary to create on the master because the puppetserver package does that. Ticket PUP-<I> was filed to update acceptance the tests to not require the puppet user and group, at which time this change can be reverted.
puppetlabs_puppet
train
rb
2e11213d62f25d41ccf77b3d0f5b69aad0bf165b
diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -119,5 +119,5 @@ end # Has to set the RAILS_ENV before config/application is required if ARGV.first && !ARGV.first.index("-") && env = ARGV.first - ENV['RAILS_ENV'] = %w(production development test).find { |e| e.index(env) } || env + ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env end
"rails dbconsole t" must not load "production" but "test" [#<I> state:committed]
rails_rails
train
rb
75ed529051247f54e93cd28dd7de434e8bf30793
diff --git a/demangle.go b/demangle.go index <HASH>..<HASH> 100644 --- a/demangle.go +++ b/demangle.go @@ -2182,6 +2182,7 @@ func (st *state) unresolvedName() AST { if len(st.str) > 0 && st.str[0] == 'I' { args := st.templateArgs() n = &Template{Name: n, Args: args} + st.subs.add(n) } return n default: @@ -2598,6 +2599,7 @@ func (st *state) substitution(forPrefix bool) AST { if len(st.str) > 0 && st.str[0] == 'B' { a = st.taggedName(a) + st.subs.add(a) } return a
demangle: add a couple of substitution candidates This is based on reading the ABI. It doesn't affect any existing test cases, and I don't have any new test cases.
ianlancetaylor_demangle
train
go
05bc7103d071ff2a0b9a03faa46bb42fe4f9da5e
diff --git a/src/Laravel/LaragramServiceProvider.php b/src/Laravel/LaragramServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Laravel/LaragramServiceProvider.php +++ b/src/Laravel/LaragramServiceProvider.php @@ -15,14 +15,11 @@ class LaragramServiceProvider extends ServiceProvider */ public function boot() { -// $this->package('williamson/laragram', null, __DIR__); - -// $loader = AliasLoader::getInstance(); -// $aliases = Config::get('app.aliases'); -// if (empty($aliases['TG'])) -// { -// $loader->alias('TG', 'Williamson\Laragram\Facades\LaragramFacade'); -// } + $loader = AliasLoader::getInstance(); + $aliases = Config::get('app.aliases'); + if (empty($aliases['TG'])) { + $loader->alias('TG', 'Williamson\Laragram\Facades\LaragramFacade'); + } } /**
Register the TG facade in the service provider boot method
jonnywilliamson_laragram
train
php
82d0a86eb4e0cf020e6dbfbb5712d9158905c398
diff --git a/src/de/mrapp/android/preference/activity/parser/PreferenceHeaderParser.java b/src/de/mrapp/android/preference/activity/parser/PreferenceHeaderParser.java index <HASH>..<HASH> 100644 --- a/src/de/mrapp/android/preference/activity/parser/PreferenceHeaderParser.java +++ b/src/de/mrapp/android/preference/activity/parser/PreferenceHeaderParser.java @@ -339,7 +339,8 @@ public final class PreferenceHeaderParser { * or -1, if no icon id is defined by the given typed array */ private static int parseIconId(final TypedArray typedArray) { - return typedArray.getInt(R.styleable.PreferenceHeader_android_icon, -1); + return typedArray.getResourceId( + R.styleable.PreferenceHeader_android_icon, -1); } /**
Bugfix: The icon id is now correctly parsed.
michael-rapp_AndroidPreferenceActivity
train
java
ab79a841a45dc02163d77bc6db95065ccdef06d2
diff --git a/lib/launcher.js b/lib/launcher.js index <HASH>..<HASH> 100644 --- a/lib/launcher.js +++ b/lib/launcher.js @@ -13,7 +13,7 @@ const { Backend } = require('./backend.js'); process.on('unhandledRejection', error => { if (error.message.includes('Protocol error') && error.message.includes('Target closed')) process.exit(1); - console.log('unhandledRejection', error.message); + console.log('unhandledRejection', error.stack || error.message); }); async function launch() {
Log the stack for unhandledRejections For internal errors the message alone is not very helpful. For example I got net::ERR_NAME_NOT_RESOLVED at <url>, but I have no idea where this came from or why. With the call stack I can see the issue is in FrameManager.navigate().
GoogleChromeLabs_ndb
train
js
26d4393dc09866354cabdb84d797aedb9e99a7b5
diff --git a/spec/fixtures/features.rb b/spec/fixtures/features.rb index <HASH>..<HASH> 100644 --- a/spec/fixtures/features.rb +++ b/spec/fixtures/features.rb @@ -25,13 +25,14 @@ feature :floyd, :description => 'just for floyd', :condition => :dynamic_is_floy feature :philip, :description => 'just for philip', :condition => lambda { FLIPPER_ENV[:dynamic] == 'philip' } # feature depending on array of a static condition, a predefined condition and a dynamic condition (lambda) -feature :patti, :description => 'just for patti', :condition => [ +# given in :conditions (can be both :condition/:conditions) +feature :patti, :description => 'just for patti', :conditions => [ FLIPPER_ENV[:changing] == 'patti', :dynamic_is_floyd, lambda { FLIPPER_ENV[:changing] == 'gavin'} ] -# feature with a complex combination of dynamic and predifined conditions -feature :sue, :description => 'just for sue', :condition => (Proc.new do +# feature with a complex combination of dynamic and predifined conditions given as a block +feature :sue, :description => 'just for sue' do (active?(:static_is_cherry) || active?(:dynamic_is_floyd)) && FLIPPER_ENV[:changing] == 'sue' -end) +end
adjusted examples in features.rb to reflect new syntax possibilities
blaulabs_ruby_flipper
train
rb
0f224491e942d96b8561409337aa7adfb2ca65eb
diff --git a/elasticsearch-model/examples/activerecord_associations.rb b/elasticsearch-model/examples/activerecord_associations.rb index <HASH>..<HASH> 100644 --- a/elasticsearch-model/examples/activerecord_associations.rb +++ b/elasticsearch-model/examples/activerecord_associations.rb @@ -98,6 +98,22 @@ module Searchable module Indexing + #Index only the specified fields + settings do + mappings dynamic: false do + indexes :categories, type: :object do + indexes :title + end + indexes :authors, type: :object do + indexes :full_name + indexes :department + end + indexes :comments, type: :object do + indexes :text + end + end + end + # Customize the JSON serialization for Elasticsearch def as_indexed_json(options={}) self.as_json(
Add nested mapping for ActiveRecord associations (#<I>)
elastic_elasticsearch-rails
train
rb
af0fc05f5e25b0b3237c452c4cfea26a78e10e02
diff --git a/http/telegraf.go b/http/telegraf.go index <HASH>..<HASH> 100644 --- a/http/telegraf.go +++ b/http/telegraf.go @@ -485,7 +485,15 @@ func (s *TelegrafService) CreateTelegrafConfig(ctx context.Context, tc *platform // UpdateTelegrafConfig updates a single telegraf config. // Returns the new telegraf config after update. func (s *TelegrafService) UpdateTelegrafConfig(ctx context.Context, id platform.ID, tc *platform.TelegrafConfig, userID platform.ID) (*platform.TelegrafConfig, error) { - panic("not implemented") + var teleResp platform.TelegrafConfig + err := s.client. + PutJSON(tc, prefixTelegraf, id.String()). + DecodeJSON(&teleResp). + Do(ctx) + if err != nil { + return nil, err + } + return &teleResp, nil } // DeleteTelegrafConfig removes a telegraf config by ID.
fix(http): provide support for telegraf update in http client
influxdata_influxdb
train
go
b1ff4f09a8a720815625d23d290a94c78fa0ccfc
diff --git a/src/main/java/com/jayway/maven/plugins/android/common/DeviceHelper.java b/src/main/java/com/jayway/maven/plugins/android/common/DeviceHelper.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/jayway/maven/plugins/android/common/DeviceHelper.java +++ b/src/main/java/com/jayway/maven/plugins/android/common/DeviceHelper.java @@ -11,7 +11,6 @@ public class DeviceHelper { private static final String MANUFACTURER_PROPERTY = "ro.product.manufacturer"; private static final String MODEL_PROPERTY = "ro.product.model"; - private static final char[] ILLEGAL_CHARACTERS = { '/', '\n', '\r', '\t', '\0', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':' }; /** * Get a device identifier string that is suitable for filenames as well as log messages.
removed unused stmt
simpligility_android-maven-plugin
train
java
a2d80b672d20b5be11a0ef50ca85e266be65b9b7
diff --git a/docs/pages/components/dropdown/api/dropdown.js b/docs/pages/components/dropdown/api/dropdown.js index <HASH>..<HASH> 100644 --- a/docs/pages/components/dropdown/api/dropdown.js +++ b/docs/pages/components/dropdown/api/dropdown.js @@ -78,6 +78,13 @@ export default [ type: 'Boolean, Array', values: '<code>escape</code>, <code>outside</code>', default: '<code>true</code>' + }, + { + name: '<code>close-on-click</code>', + description: 'Close dropdown when content is clicked', + type: 'Boolean', + values: '—', + default: '<code>true</code>' } ], slots: [
Add "close-on-click" prop to docs for dropdown (#<I>)
buefy_buefy
train
js
ecf160ae7c7677a24ca68ea7002451bda6c0ae9a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -56,9 +56,12 @@ setup(name='gitberg', 'cairocffi==0.8.0', 'pycparser==2.17', 'cryptography==1.7.2', + 'pyepub', ], test_suite='nose.collector', - tests_require=['nose'], + tests_require=[ + 'nose', + ], classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', @@ -67,4 +70,7 @@ setup(name='gitberg', # 'Programming Language :: Python :: 3.4', ], keywords="books ebooks gitenberg gutenberg epub metadata", + dependency_links=[ + "https://github.com/Gluejar/pyepub/archive/master.zip#egg=pyepub-0.3.1", + ], )
Add pyepub dependency for tests to setup.py With this, `python setup.py test` works in a clean virtualenv.
gitenberg-dev_gitberg
train
py
6ef2a437375b7553c6f31ff731d44ea8ee8c7484
diff --git a/cobe/utils.py b/cobe/utils.py index <HASH>..<HASH> 100644 --- a/cobe/utils.py +++ b/cobe/utils.py @@ -24,9 +24,9 @@ def itime(iterable, seconds): occurred. """ - end = time.time() + seconds - items = iter(iterable) + + end = time.time() + seconds yield items.next() for item in itertools.takewhile(lambda _: time.time() < end, items):
Get the end time for itime() when iteration starts This doesn't track the time it takes to make the iterator, which is more in line with the function's intent.
pteichman_cobe
train
py
f831dd811999d2c5866aeeffd9378bd5b5534b6d
diff --git a/test_path.py b/test_path.py index <HASH>..<HASH> 100644 --- a/test_path.py +++ b/test_path.py @@ -263,11 +263,13 @@ class TestScratchDir: # atime isn't tested because on Windows the resolution of atime # is something like 24 hours. + threshold = 1 + d = Path(tmpdir) f = d / 'test.txt' - t0 = time.time() - 3 + t0 = time.time() - threshold f.touch() - t1 = time.time() + 3 + t1 = time.time() + threshold assert f.exists() assert f.isfile() @@ -277,15 +279,15 @@ class TestScratchDir: ct = f.ctime assert t0 <= ct <= t1 - time.sleep(5) + time.sleep(threshold*2) fobj = open(f, 'ab') fobj.write('some bytes'.encode('utf-8')) fobj.close() - time.sleep(5) - t2 = time.time() - 3 + time.sleep(threshold*2) + t2 = time.time() - threshold f.touch() - t3 = time.time() + 3 + t3 = time.time() + threshold assert t0 <= t1 < t2 <= t3 # sanity check
Set a tighter threshold for faster tests
jaraco_path.py
train
py
a6dba9f09ad1fb9cae0935196943416c8a5a1518
diff --git a/client/src/views/record/merge.js b/client/src/views/record/merge.js index <HASH>..<HASH> 100644 --- a/client/src/views/record/merge.js +++ b/client/src/views/record/merge.js @@ -164,10 +164,10 @@ Espo.define('views/record/merge', 'view', function (Dep) { this.fields = differentFieldList; this.fields.forEach(function (field) { - var type = Espo.Utils.upperCaseFirst(this.models[0].getFieldParam(field, 'type')); + var type = this.models[0].getFieldParam(field, 'type'); this.models.forEach(function (model) { - var viewName = model.getFieldParam(name, 'view') || this.getFieldManager().getViewName(type); + var viewName = model.getFieldParam(field, 'view') || this.getFieldManager().getViewName(type); this.createView(model.id + '-' + field, viewName, { model: model,
fix view name resolving for custom field types in merge action (#<I>)
espocrm_espocrm
train
js
08930b9c8800eeaf7c0bfc9e85e20f09994c1084
diff --git a/iothrottler.go b/iothrottler.go index <HASH>..<HASH> 100644 --- a/iothrottler.go +++ b/iothrottler.go @@ -85,6 +85,10 @@ func NewIOThrottlerPool(bandwidth Bandwidth) *IOThrottlerPool { // Since we have bandwidth to allocate we can select on // the bandwidth allocator chan thisBandwidthAllocatorChan = bandwidthAllocatorChan + } else { + // We've allocate all out bandwidth so we need to wait for + // more + thisBandwidthAllocatorChan = nil } } @@ -125,11 +129,7 @@ func NewIOThrottlerPool(bandwidth Bandwidth) *IOThrottlerPool { if Unlimited != totalbandwidth { totalbandwidth -= allocationSize - if totalbandwidth <= 0 { - // We've allocate all out bandwidth so we need to wait for - // more - thisBandwidthAllocatorChan = nil - } + recalculateAllocationSize() } // Get unused bandwidth back from client
Recalculate allocation on bandwidth is allocation. By recalculating the bandwidth allocation size every time bandwidth is allocated we prevent a situation where a few clients temporarily get all the bandwidth and the rest get none. We slowly decrease the amount allocated instead of keeping the same allocation even though the total bandwidth available has decreased. The allocation size will increase when we get more bandwidth.
efarrer_iothrottler
train
go
d0442dbba5f6141cb7bbcb274ab527195b78573a
diff --git a/command/token/helper_internal.go b/command/token/helper_internal.go index <HASH>..<HASH> 100644 --- a/command/token/helper_internal.go +++ b/command/token/helper_internal.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "os" + "path/filepath" "strings" homedir "github.com/mitchellh/go-homedir" @@ -25,7 +26,7 @@ func (i *InternalTokenHelper) populateTokenPath() { if err != nil { panic(fmt.Sprintf("error getting user's home directory: %v", err)) } - i.tokenPath = homePath + "/.vault-token" + i.tokenPath = filepath.Join(homePath, ".vault-token") } func (i *InternalTokenHelper) Path() string {
Use proper pathSeparator for the operating system (#<I>) * Use proper pathSeparator for the operating system When running on Windows use the backslash as the path separator, other wise use the forward slash
hashicorp_vault
train
go
614cf1d7e38f1d2994d6015d6f19216afc4d6403
diff --git a/salt/__init__.py b/salt/__init__.py index <HASH>..<HASH> 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -3,6 +3,8 @@ Make me some salt! ''' +from __future__ import absolute_import + # Import python libs import os import sys @@ -206,7 +208,7 @@ class Minion(parsers.MinionOptionParser): 'udp://', 'file://')): # Logfile is not using Syslog, verify - current_umask = os.umask(0077) + current_umask = os.umask(0o077) verify_files([logfile], self.config['user']) os.umask(current_umask) except OSError as err:
make salt package importable in python3
saltstack_salt
train
py
87f26c231e36399a4fb2333a7b6f5010370257a0
diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -353,7 +353,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { var minCols = Math.ceil(viewSize.w/this.tileSize.w) + Math.max(1, 2 * this.buffer); - var extent = this.map.getMaxExtent(); + var extent = this.maxExtent; var resolution = this.map.getResolution(); var tileLayout = this.calculateGridLayout(bounds, extent, resolution); @@ -719,7 +719,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * {<OpenLayers.Bounds>} Bounds of the tile at the given pixel location. */ getTileBounds: function(viewPortPx) { - var maxExtent = this.map.getMaxExtent(); + var maxExtent = this.maxExtent; var resolution = this.getResolution(); var tileMapWidth = resolution * this.tileSize.w; var tileMapHeight = resolution * this.tileSize.h;
Use the maxExtent of the layer in Grid layers instead of the maxExtent of the map (since the two can differ). Patch from kleptog. (Closes #<I>) git-svn-id: <URL>
openlayers_openlayers
train
js
febde10a28c5c127a6d88f98c629113b372eeec8
diff --git a/tests/integration/helpers/liquid-outlet-test.js b/tests/integration/helpers/liquid-outlet-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/helpers/liquid-outlet-test.js +++ b/tests/integration/helpers/liquid-outlet-test.js @@ -172,12 +172,12 @@ module('Integration: liquid-outlet', function (hooks) { ); let state = this.makeRoute({ - template: hbs`C{{liquid-outlet "a"}}D{{liquid-outlet "b"}}E`, + template: hbs`C{{liquid-outlet}}DE`, }); this.setState(state); assert.dom().hasText('ACDEB'); - state.setChild('a', { template: hbs`foo` }); + state.setChild('main', { template: hbs`foo` }); this.setState(state); assert.dom().hasText('ACfooDEB'); });
remove a named outlet usage from a test
ember-animation_liquid-fire
train
js