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
e8eb02cf1c0d5584b90815a81f74e78440418cde
diff --git a/src/Models/Tag.php b/src/Models/Tag.php index <HASH>..<HASH> 100644 --- a/src/Models/Tag.php +++ b/src/Models/Tag.php @@ -106,7 +106,7 @@ class Tag extends BaseTag $this->setTable(config('rinvex.tags.tables.tags')); $this->setRules([ - 'slug' => 'required|alpha_dash|max:150|unique_model:'.config('rinvex.tags.models.tag').',slug', + 'slug' => 'required|alpha_dash|max:150|unique:'.config('rinvex.tags.tables.tags').',slug', 'name' => 'required|string|max:150', 'description' => 'nullable|string|max:10000', 'sort_order' => 'nullable|integer|max:10000000',
Revert unique & exists validation rules to native after overriding presence verifier to use eloquent by default
rinvex_cortex-tags
train
php
ec144d024e3fae70382fffb65193afe94c666a4d
diff --git a/test/create.js b/test/create.js index <HASH>..<HASH> 100644 --- a/test/create.js +++ b/test/create.js @@ -25,6 +25,7 @@ describe('create cli', function() { }); it('installs dependencies', function (done) { + this.timeout(60000); spawnCliInSandbox(['create', 'cli', 'test-app']) .run(function(err) { if (err) done(err); diff --git a/test/example.js b/test/example.js index <HASH>..<HASH> 100644 --- a/test/example.js +++ b/test/example.js @@ -7,7 +7,7 @@ var sandbox = require('./helpers/sandbox.js'); var spawnCliInSandbox = require('./helpers/runner.js').spawnCliInSandbox; describe('suite example', function() { - this.timeout(5000); + this.timeout(60000); before(function(done) { sandbox.reset();
Increase git/npm timeouts npm install and git clone can be very slow, increase the timeouts to <I> secs to avoid ephemeral irrelevant failures.
strongloop_strongloop
train
js,js
fa797df0c7689ae023cbeb5ab06bf7100e6201bd
diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index <HASH>..<HASH> 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -8,6 +8,11 @@ require 'pygments' require 'yaml' module Linguist + # DEPRECATED Avoid mixing into Blob classes. Prefer functional interfaces + # like `Language.detect` over `Blob#language`. + # + # Avoid adding additional bloat to this module. + # # BlobHelper is a mixin for Blobish classes that respond to "name", # "data" and "size" such as Grit::Blob. module BlobHelper
Note that BlobHelper is a turd
github_linguist
train
rb
1e9e617bbe26b827633ceb27a281edbee2a08ea5
diff --git a/src/DataTables/AbstractDataTable.php b/src/DataTables/AbstractDataTable.php index <HASH>..<HASH> 100644 --- a/src/DataTables/AbstractDataTable.php +++ b/src/DataTables/AbstractDataTable.php @@ -313,7 +313,7 @@ CDATA; * Map ajax response to columns definition. * * @param array|\Illuminate\Support\Collection $columns - * @param string $type + * @param string $type * * @return array */
Apply fixes from StyleCI (#<I>)
rinvex_cortex-foundation
train
php
4c82c9e393bae152ff17bc3fe7ba6ab9a869bcc6
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -271,7 +271,7 @@ module.exports = function (grunt) { wrap: { start: '/*! Console-only distribution */\n' + '(function(root, rootDefine, rootRequire, rootModule) {\n', - end: 'require(["./woodman"], function (woodman) {\n' + + end: 'require(["./woodman-console"], function (woodman) {\n' + ' if (rootDefine) rootDefine(woodman);\n' + ' if (root) root.woodman = woodman;\n' + ' if (rootModule) rootModule.exports = woodman;\n' +
Fixed console distribution wrapping code The newly introduced "console" distribution did not work because of an invalid require code in the initial wrapping code.
joshfire_woodman
train
js
790d98366499fa0a37ae1a261a377835022d2522
diff --git a/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java b/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java +++ b/src/main/java/net/bootsfaces/component/ajax/AJAXRenderer.java @@ -562,7 +562,11 @@ public class AJAXRenderer extends CoreRenderer { } else { process = ExpressionResolver.getComponentIDs(context, (UIComponent) component, process); } - update = ExpressionResolver.getComponentIDs(context, (UIComponent) component, update); + if (update==null) { + update=""; + } else { + update = ExpressionResolver.getComponentIDs(context, (UIComponent) component, update); + } cJS.append(encodeClick((UIComponent)component)).append("BsF.ajax.callAjax(this, event") .append(update == null ? ",''" : (",'" + update + "'")) .append(process == null ? ",'@this'" : (",'" + process.trim() + "'"));
#<I> and #<I> the default value of the update attribute is always @none
TheCoder4eu_BootsFaces-OSP
train
java
316f790b375d5598253d0929b4183b491ccfb4bb
diff --git a/lib/atomy/pattern/attribute.rb b/lib/atomy/pattern/attribute.rb index <HASH>..<HASH> 100644 --- a/lib/atomy/pattern/attribute.rb +++ b/lib/atomy/pattern/attribute.rb @@ -14,7 +14,8 @@ class Atomy::Pattern end def assign(scope, val) - @receiver.send(:"#{@attribute}=", val) + # don't use send; Generator implements #send, other things might too. + @receiver.__send__(:"#{@attribute}=", val) end end end diff --git a/spec/atomy/pattern/attribute_spec.rb b/spec/atomy/pattern/attribute_spec.rb index <HASH>..<HASH> 100644 --- a/spec/atomy/pattern/attribute_spec.rb +++ b/spec/atomy/pattern/attribute_spec.rb @@ -31,5 +31,14 @@ describe Atomy::Pattern::Attribute do subject.assign(Rubinius::VariableScope.current, 42) expect(receiver.abc).to eq(42) end + + context "when the receiver implements #send" do + before { allow(receiver).to receive(:send).and_raise("hell") } + + it "still assigns the correct attribute" do + subject.assign(Rubinius::VariableScope.current, 42) + expect(receiver.abc).to eq(42) + end + end end end
attribute pattern uses #__send__, not #send ...because some things override that, which is very confusing (e.g. CodeTools::Generator)
vito_atomy
train
rb,rb
33df26144702067d1f525ef75219cc92ffd14dc4
diff --git a/src/JWKConverter.php b/src/JWKConverter.php index <HASH>..<HASH> 100644 --- a/src/JWKConverter.php +++ b/src/JWKConverter.php @@ -22,7 +22,7 @@ class JWKConverter /** @var Base64UrlDecoder */ private $base64UrlDecoder; - public function __construct(?Base64UrlDecoder $base64UrlDecoder = null) + public function __construct(Base64UrlDecoder $base64UrlDecoder = null) { $this->base64UrlDecoder = $base64UrlDecoder ?? new Base64UrlDecoder(); }
Remove nullable type for PHP >=<I> support
acodercat_php-jwk-to-pem
train
php
372dea0ec0a3d7e122447b9b9f4e5f726c7ef64c
diff --git a/test/support/tcp_proxy.rb b/test/support/tcp_proxy.rb index <HASH>..<HASH> 100644 --- a/test/support/tcp_proxy.rb +++ b/test/support/tcp_proxy.rb @@ -91,7 +91,7 @@ class TCPProxy dst.send(data, 0) end elsif disabled? && pause_behavior == :return - clean_data = data.encode("UTF-8", invalid: :replace, undef: :replace, replace: "") + clean_data = data.gsub(/[^\w. ]/, '').strip if schema_query?(clean_data) dst.send(data, 0) @@ -108,6 +108,10 @@ class TCPProxy # FIXME: We should not allow fetching schema information from the primary DB. def schema_query?(data) data.include?("information_schema.tables") || + data.include?("information_schema.statistics") || + data.include?("information_schema.key_column_usage") || + data.include?("SHOW TABLES") || + data.include?("SHOW CREATE TABLE") || data.include?("SHOW FULL FIELDS FROM") end
Include more schema-loading code, to fix tests There are more schema related queries than I first assumed. This commit adds three more things to look when determining whether a query is (temporarily) allowed to bypass the paused TCP Proxy and have the query sent to a primary database.
zendesk_active_record_shards
train
rb
9eeebf520f937989962c96985107c121ae3897cc
diff --git a/javascript/firefox-driver/js/wrappedElement.js b/javascript/firefox-driver/js/wrappedElement.js index <HASH>..<HASH> 100644 --- a/javascript/firefox-driver/js/wrappedElement.js +++ b/javascript/firefox-driver/js/wrappedElement.js @@ -83,6 +83,7 @@ WebElement.clickElement = function(respond, parameters) { if (!isOption && this.enableNativeEvents && nativeMouse && node && useNativeClick && thmgr_cls) { fxdriver.logging.info('Using native events for click'); + element.scrollIntoView(); var inViewAfterScroll = bot.action.scrollIntoView( unwrapped, new goog.math.Coordinate(elementHalfWidth, elementHalfHeight));
Fixing one of the tests broken by recent atoms update (scrolling to an element in a frame that is out of view)
SeleniumHQ_selenium
train
js
ed1020ab271d0d367d0698121ec6dc910b0cabde
diff --git a/tests/test_fast/test_timeout.py b/tests/test_fast/test_timeout.py index <HASH>..<HASH> 100644 --- a/tests/test_fast/test_timeout.py +++ b/tests/test_fast/test_timeout.py @@ -112,7 +112,13 @@ def test_stop_wait(): proc = EasyProcess(["python", "-c", ignore_term]).start() time.sleep(1) proc.stop(timeout=1) - assert proc.is_alive() is True + # On windows, Popen.terminate actually behaves like kill, + # so don't check that our hanging process code is actually hanging. + # The end result is still what we want. On other platforms, leave + # this assertion to make sure we are correctly testing the ability + # to stop a hung process + if not sys.platform.startswith("win"): + assert proc.is_alive() is True proc.stop(kill_after=1) assert proc.is_alive() is False assert proc.return_code != 0
Remove hung process assertion on windows where it is unneeded
ponty_EasyProcess
train
py
4c25afa23ff1bba205ad5454762664317a0571cc
diff --git a/src/Exscriptd/Order.py b/src/Exscriptd/Order.py index <HASH>..<HASH> 100644 --- a/src/Exscriptd/Order.py +++ b/src/Exscriptd/Order.py @@ -64,7 +64,7 @@ class Order(DBObject): descr_node = order_node.find('description') order = Order(order_node.get('service')) order.id = order_node.get('id') - order.status = order_node.get('status') + order.status = order_node.get('status', order.status) order.created_by = order_node.get('created-by', order.created_by) created = order_node.get('created') closed = order_node.get('closed')
Exscriptd.Order: default status to 'new' if the XML does not contain one.
knipknap_exscript
train
py
c405dbc0de56f5c6dd619ae872bcbd44f35a48a6
diff --git a/firetv/__init__.py b/firetv/__init__.py index <HASH>..<HASH> 100644 --- a/firetv/__init__.py +++ b/firetv/__init__.py @@ -86,6 +86,8 @@ class FireTV: def app_state(self, app): """ Informs if application is running """ + if self.state != STATE_PLAYING: + return STATE_OFF if len(self._ps(app)) > 0: return STATE_ON return STATE_OFF
Change so that apps arnt on unless firetv is playing
happyleavesaoc_python-firetv
train
py
bf42120a38cc8de3467d467a7dbf636e44010cc7
diff --git a/src/Factories/Entity/Environment.php b/src/Factories/Entity/Environment.php index <HASH>..<HASH> 100644 --- a/src/Factories/Entity/Environment.php +++ b/src/Factories/Entity/Environment.php @@ -30,13 +30,20 @@ class Environment extends AbstractEntity public $accountId; /** - * Current state of container + * Current state of environment * * @var string */ public $state; /** + * Current health of environment + * + * @var string + */ + public $healthState; + + /** * The docker-compose.yml file * for the Environment *
Expose the health state of an Environment
benmag_laravel-rancher
train
php
4769bbf6e96e105ec78fedff53ae1609a7a06003
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -86,7 +86,7 @@ var torrentStream = function(link, opts) { var engine = new events.EventEmitter(); var swarm = pws(infoHash, opts.id, {size:opts.connections || opts.size}); - var torrentPath = path.join(opts.path, 'cache.torrent'); + var torrentPath = path.join(opts.path, infoHash + '.torrent'); var wires = swarm.wires; var critical = [];
Include infoHash in torrent cache file path
mafintosh_torrent-stream
train
js
f2f69e6f7bdf58d63322949323c77406500511f3
diff --git a/builder/amazon/ebs/step_stop_instance.go b/builder/amazon/ebs/step_stop_instance.go index <HASH>..<HASH> 100644 --- a/builder/amazon/ebs/step_stop_instance.go +++ b/builder/amazon/ebs/step_stop_instance.go @@ -34,8 +34,7 @@ func (s *stepStopInstance) Run(state map[string]interface{}) multistep.StepActio Refresh: awscommon.InstanceStateRefreshFunc(ec2conn, instance), StepState: state, } - instanceRaw, err := awscommon.WaitForState(&stateChange) - instance = instanceRaw.(*ec2.Instance) + _, err = awscommon.WaitForState(&stateChange) if err != nil { err := fmt.Errorf("Error waiting for instance to stop: %s", err) state["error"] = err
builder/amazon/ebs: don't need this variable
hashicorp_packer
train
go
604562b876af92fffd3e1e5cfbaa6419c92a9853
diff --git a/api/src/main/java/org/jboss/arquillian/persistence/ApplyScriptAfter.java b/api/src/main/java/org/jboss/arquillian/persistence/ApplyScriptAfter.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/org/jboss/arquillian/persistence/ApplyScriptAfter.java +++ b/api/src/main/java/org/jboss/arquillian/persistence/ApplyScriptAfter.java @@ -26,7 +26,7 @@ import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** - * Defines SQL scripts applied on test database before test method execution. + * Defines SQL scripts applied on test database after test method execution. * <br /> * If files are not specified explicitly, following strategy is applied: * <ul>
JavaDoc mistake corrected (#<I>)
arquillian_arquillian-extension-persistence
train
java
d7110727583c91a4e158a0bf5f4e99909d0e1426
diff --git a/apps/pattern-lab/src/index.js b/apps/pattern-lab/src/index.js index <HASH>..<HASH> 100644 --- a/apps/pattern-lab/src/index.js +++ b/apps/pattern-lab/src/index.js @@ -1,10 +1,10 @@ import 'core-js/modules/es6.string.starts-with'; import 'iframe-resizer/js/iframeResizer.contentWindow.min.js'; -// automatically remove the min-height default set to the body element when viewing PL pages from inside an iframe on the docs site. +// automatically remove the min-height default set to the body element when viewing PL pages from inside an iframe on the docs site, but via a utility class window.iFrameResizer = { readyCallback() { - document.body.setAttribute('style', 'min-height: 0;'); + document.body.classList.add('u-bolt-min-height-none'); }, };
refactor: update previous iframe resize logic to handle via a utility class vs inline style
bolt-design-system_bolt
train
js
1eddc19d8ee325affa516442c5802061d4052f24
diff --git a/memote/support/basic.py b/memote/support/basic.py index <HASH>..<HASH> 100644 --- a/memote/support/basic.py +++ b/memote/support/basic.py @@ -253,6 +253,7 @@ def find_unique_metabolites(model): return set(met.id.split("_", 1)[0] for met in model.metabolites) +@lrudecorator(size=2) def find_duplicate_metabolites_in_compartments(model): """ Return list of metabolites with duplicates in the same compartment. @@ -273,14 +274,15 @@ def find_duplicate_metabolites_in_compartments(model): A list of tuples of duplicate metabolites. """ + unique_identifiers = ["inchikey", "inchi"] duplicates = [] - for compartment in model.compartments: - ann_mets = [(met, met.annotation) for met in model.metabolites - if met.compartment == compartment and - "inchikey" in met.annotation] - for a, b in combinations(ann_mets, 2): - if a[1]["inchikey"] == b[1]["inchikey"]: - duplicates.append((a[0].id, b[0].id)) + for met_1, met_2 in combinations(model.metabolites, 2): + if met_1.compartment == met_2.compartment: + for key in unique_identifiers: + if key in met_1.annotation and key in met_2.annotation: + if met_1.annotation[key] == met_2.annotation[key]: + duplicates.append((met_1.id, met_2.id)) + break return duplicates
refactor: expand find_duplicate_metabolites to include inchi strings
opencobra_memote
train
py
99f65c1cf092c9b29eefb0bee51f9faba18b972b
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,12 +6,13 @@ module.exports = { "mocha": true }, "rules": { + "import/no-unresolved": 0, // fails at travis + "import/extensions": 0, // fails at travis "prefer-arrow-callback": 0, // mocha tests (recommendation) "func-names": 0, // mocha tests (recommendation) "comma-dangle": ["error", "never"], // personal preference - "no-param-reassign": 0, // consider enabling this again - "no-underscore-dangle": 0, // implementation detail (_highlights etc.) + "no-param-reassign": 0, // the plugin needs this (webpack design :( ) "no-use-before-define": 0, // personal preference - "no-console": 0 // Allow logging + "no-console": 0 // allow logging } };
chore - Simplify eslint rules
webpack-contrib_purifycss-webpack
train
js
15f0934c00b4a647447c90b21edd31307f1970dd
diff --git a/test/spec/LiveDevelopment-test.js b/test/spec/LiveDevelopment-test.js index <HASH>..<HASH> 100644 --- a/test/spec/LiveDevelopment-test.js +++ b/test/spec/LiveDevelopment-test.js @@ -880,6 +880,9 @@ define(function (require, exports, module) { // Edit a JavaScript doc jsdoc.setText("window.onload = function () {document.getElementById('testId').style.backgroundColor = '#090'}"); + // Make sure the live development dirty dot shows + expect(LiveDevelopment.status).toBe(LiveDevelopment.STATUS_OUT_OF_SYNC); + // Save changes to the test file loadEventPromise = saveAndWaitForLoadEvent(jsdoc); });
Add unit test for <I> (JS portion)
adobe_brackets
train
js
531ce8b3323dfdae2e8c4edba90b3cc93287c5e4
diff --git a/sources/EngineWorks/DBAL/Pager.php b/sources/EngineWorks/DBAL/Pager.php index <HASH>..<HASH> 100644 --- a/sources/EngineWorks/DBAL/Pager.php +++ b/sources/EngineWorks/DBAL/Pager.php @@ -31,7 +31,7 @@ class Pager /** @var string SQL to query the data */ private $queryData; - /** @var string|false SQL to query the count */ + /** @var string SQL to query the count */ private $queryCount; /** @var int */ @@ -92,7 +92,7 @@ class Pager $this->totalRecords = null; $this->recordset = null; // request - $page = min($this->getTotalPages(), max(1, intval($requestedPage))); + $page = (int) min($this->getTotalPages(), max(1, intval($requestedPage))); $query = $this->dbal->sqlLimit($this->getQueryData(), $page, $this->getPageSize()); $recordset = $this->dbal->queryRecordset($query); if (! $recordset instanceof Recordset) {
docblock: $queryCount cannot be false
eclipxe13_engineworks-dbal
train
php
dd521c0573acb10da8840d993dc873c10df02c73
diff --git a/http3/server.go b/http3/server.go index <HASH>..<HASH> 100644 --- a/http3/server.go +++ b/http3/server.go @@ -709,19 +709,20 @@ func ListenAndServe(addr, certFile, keyFile string, handler http.Handler) error tlsConn := tls.NewListener(tcpConn, config) defer tlsConn.Close() + if handler == nil { + handler = http.DefaultServeMux + } // Start the servers - httpServer := &http.Server{} quicServer := &Server{ TLSConfig: config, + Handler: handler, } - - if handler == nil { - handler = http.DefaultServeMux + httpServer := &http.Server{ + Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + quicServer.SetQuicHeaders(w.Header()) + handler.ServeHTTP(w, r) + }), } - httpServer.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - quicServer.SetQuicHeaders(w.Header()) - handler.ServeHTTP(w, r) - }) hErr := make(chan error) qErr := make(chan error)
http3: fix listening on both QUIC and TCP (#<I>)
lucas-clemente_quic-go
train
go
de8686f1d5ce0e07e294484072a61b83467ddf18
diff --git a/zappa/cli.py b/zappa/cli.py index <HASH>..<HASH> 100644 --- a/zappa/cli.py +++ b/zappa/cli.py @@ -147,7 +147,7 @@ class ZappaCLI(object): # Version requires no arguments if args.version: # pragma: no cover self.print_version() - sys.exit(-1) + sys.exit(0) # Parse the input command_env = vargs['command_env']
print version should be exit code 0. fix #<I>
Miserlou_Zappa
train
py
68e58fb247d19923c932b840647afe9fafe05833
diff --git a/sessions/startup.go b/sessions/startup.go index <HASH>..<HASH> 100644 --- a/sessions/startup.go +++ b/sessions/startup.go @@ -6,10 +6,7 @@ import ( "os" ) -const ( - startupSessionIDKey = "BUGSNAG_STARTUP_SESSION_ID" - startupSessionTimestampKey = "BUGSNAG_STARTUP_SESSION_TIMESTAMP" -) +const startupSessionIDKey = "BUGSNAG_STARTUP_SESSION_ID" // SendStartupSession is called by Bugsnag on startup, which will send a // session to Bugsnag and return a context to represent the session of the main @@ -36,6 +33,5 @@ func isApplicationProcess(session *Session) bool { // the monitoring process runs envID := os.Getenv(startupSessionIDKey) os.Setenv(startupSessionIDKey, session.ID.String()) - os.Setenv(startupSessionTimestampKey, session.StartedAt.String()) return envID == "" }
[chore] Simplify process check
bugsnag_bugsnag-go
train
go
27b2d3709cfb1ac8575f6b2febd0d35ec0da2910
diff --git a/lib/webspicy.rb b/lib/webspicy.rb index <HASH>..<HASH> 100644 --- a/lib/webspicy.rb +++ b/lib/webspicy.rb @@ -89,9 +89,9 @@ module Webspicy module_function :test_case def handle_finitio_error(ex, scope) - # msg = "#{ex.message}:\n #{ex.root_cause.message}" - # msg = Support::Colorize.colorize_error(msg, scope.config) - # fatal(msg) + msg = "#{ex.message}:\n #{ex.root_cause.message}" + msg = Support::Colorize.colorize_error(msg, scope.config) + fatal(msg) raise end module_function :handle_finitio_error
Show root cause when specification cannot be loaded.
enspirit_webspicy
train
rb
2d4eabb89dea40759c74dcfc72401d4b85650fde
diff --git a/src/V5/DTO/Report/Payload.php b/src/V5/DTO/Report/Payload.php index <HASH>..<HASH> 100644 --- a/src/V5/DTO/Report/Payload.php +++ b/src/V5/DTO/Report/Payload.php @@ -7,9 +7,9 @@ use JMS\Serializer\Annotation as Serializer; class Payload { /** - * @var string + * @var int * - * @Serializer\Type("string") + * @Serializer\Type("integer") */ private $fiscalReceiptNumber;
Fix Payload $fiscalReceiptNumber serialized type in V5
lamoda_atol-client
train
php
cf2c26beb31e2b7452012c037bca1ed2d66282a9
diff --git a/Kwf/Setup.php b/Kwf/Setup.php index <HASH>..<HASH> 100644 --- a/Kwf/Setup.php +++ b/Kwf/Setup.php @@ -164,6 +164,7 @@ class Kwf_Setup switch (php_sapi_name()) { case 'apache2handler': $requestPath = $_SERVER['REQUEST_URI']; + $requestPath = strtok($requestPath, '?'); break; case 'cli': $requestPath = false;
Fix REQUEST_URI usage, it also contains query parameters Simply cut them off Fixes bug introduced with <I>d9e<I>c<I>b<I>ba<I>cecabb<I>d<I>fb<I>
koala-framework_koala-framework
train
php
09a15bf3ba728509310749554c43653982326a27
diff --git a/packages/teraslice/lib/cluster/storage/backends/elasticsearch_store.js b/packages/teraslice/lib/cluster/storage/backends/elasticsearch_store.js index <HASH>..<HASH> 100644 --- a/packages/teraslice/lib/cluster/storage/backends/elasticsearch_store.js +++ b/packages/teraslice/lib/cluster/storage/backends/elasticsearch_store.js @@ -243,23 +243,16 @@ module.exports = function elasticsearchStorage(backendConfig) { } async function bulkSend(bulkRequest) { - let recordCount = 0; - await pRetry(async () => { - const results = await elasticsearch.bulkSend(bulkRequest); - recordCount = results.items.length; - }, { + const recordCount = (bulkRequest.length / 2); + + await pRetry(async () => elasticsearch.bulkSend(bulkRequest), { reason: `Failure to bulk create "${recordType}"`, logError: logger.warn, delay: isTest ? 100 : 1000, backoff: 5, retries: 100, }); - // since this library only supports bulk updates by pairs - // we can log when the expected count is different - const expectedCount = (bulkRequest.length / 2); - if (recordCount !== expectedCount) { - logger.warn(`expected to bulk send ${expectedCount} records but got ${count}`); - } + return recordCount; }
Avoid being too smart with the bulk result count since bulkSend may not send all of the records when partially retrying
terascope_teraslice
train
js
1ec9d3b5d7a2fdfd6e7d0e763c95e1a3117cd96d
diff --git a/django_user_agents/middleware.py b/django_user_agents/middleware.py index <HASH>..<HASH> 100644 --- a/django_user_agents/middleware.py +++ b/django_user_agents/middleware.py @@ -1,9 +1,10 @@ from django.utils.functional import SimpleLazyObject +from django.utils.deprecation import MiddlewareMixin from .utils import get_user_agent -class UserAgentMiddleware(object): +class UserAgentMiddleware(MiddlewareMixin): # A middleware that adds a "user_agent" object to request def process_request(self, request): request.user_agent = SimpleLazyObject(lambda: get_user_agent(request))
Update middleware to be django<I>-compatible
selwin_django-user_agents
train
py
ebde5e38fc067070d6432c62f455bc81ef8e7295
diff --git a/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/service/ServerEndpointControlMBeanTest.java b/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/service/ServerEndpointControlMBeanTest.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/service/ServerEndpointControlMBeanTest.java +++ b/dev/com.ibm.ws.kernel.boot_fat/fat/src/com/ibm/ws/kernel/service/ServerEndpointControlMBeanTest.java @@ -127,7 +127,7 @@ public class ServerEndpointControlMBeanTest { if (restoreSavedConfig) { server.setMarkToEndOfLog(); server.updateServerConfiguration(savedConfig); - assertNotNull("Didn't get expected config update log messages", server.waitForConfigUpdateInLogUsingMark(null, true)); + assertNotNull("Didn't get expected config update log messages", server.waitForConfigUpdateInLogUsingMark(null)); } Log.exiting(c, METHOD_NAME);
A previous change removed a feature update, so don't wait for it anymore
OpenLiberty_open-liberty
train
java
b5c343078a5d89b66bee39e1748070eb56d2ff86
diff --git a/lib/parenting/boss.rb b/lib/parenting/boss.rb index <HASH>..<HASH> 100644 --- a/lib/parenting/boss.rb +++ b/lib/parenting/boss.rb @@ -79,7 +79,7 @@ module Parenting # watch the children, and assign new chores if any get free until self.done? - sleep 0.25 + sleep 0.05 self.handle_complaints self.check_children
shorten sleep to <I> ms
emcien_parenting
train
rb
c8a1d6c4bd636779cdf3c3b93d0b149472278070
diff --git a/Eloquent/Builder.php b/Eloquent/Builder.php index <HASH>..<HASH> 100755 --- a/Eloquent/Builder.php +++ b/Eloquent/Builder.php @@ -351,10 +351,12 @@ class Builder { $instance = $this->newModelInstance(); - return $instance->newCollection(array_map(function ($item) use ($instance) { + return $instance->newCollection(array_map(function ($item) use ($items, $instance) { $model = $instance->newFromBuilder($item); - $model->preventsLazyLoading = Model::preventsLazyLoading(); + if (count($items) > 1) { + $model->preventsLazyLoading = Model::preventsLazyLoading(); + } return $model; }, $items));
relax the lazy loading restrictions (#<I>)
illuminate_database
train
php
51a1e561e567ba235ba41026e44dceb21e793cc0
diff --git a/classes/Gems/Auth.php b/classes/Gems/Auth.php index <HASH>..<HASH> 100644 --- a/classes/Gems/Auth.php +++ b/classes/Gems/Auth.php @@ -152,11 +152,12 @@ class Gems_Auth extends Zend_Auth } else { if ($values['gula_failed_logins']) { // MUtil_Echo::track($result->getCode(), self::ERROR_PASSWORD_DELAY); - // Only increment when we have no password delay - // if ($result->getCode() <> self::ERROR_PASSWORD_DELAY) { + // Only increment when we have no password delay as the right password + // will not be accepted when we are in the delay. + if ($result->getCode() <> self::ERROR_PASSWORD_DELAY) { $values['gula_failed_logins'] += 1; $values['gula_last_failed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP'); - // } + } } else { $values['gula_failed_logins'] = 1; $values['gula_last_failed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
No extra delay when auth fails because of delay
GemsTracker_gemstracker-library
train
php
7f7dc99ab986e2ba2d8e648302f409a8581c81ab
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -22,6 +22,9 @@ module.exports = (argv = {}) => ({ libraryTarget: 'umd', umdNamedDefine: true, }, + resolve: { + extensions: ['.js'], + }, module: { rules: [ {
Webpack: resolve .js extension
adriancmiranda_dotcfg
train
js
ac08aaac6ed8fc997266cf63eaa99446156817fb
diff --git a/snide/models.py b/snide/models.py index <HASH>..<HASH> 100644 --- a/snide/models.py +++ b/snide/models.py @@ -41,7 +41,3 @@ class Slide(object): 'config': self.config, } - -def parse_slide(slide): - slide = Slide(slide) - return slide diff --git a/tests/test_snide.py b/tests/test_snide.py index <HASH>..<HASH> 100644 --- a/tests/test_snide.py +++ b/tests/test_snide.py @@ -25,10 +25,17 @@ class TestDeck(BaseTestCase): class TestSlide(BaseTestCase): + def setUp(self): + self.expected_slide = Slide('# first slide\n\n- and\n- then\n- this') + def test_slide(self): - pass - def test_slide_parse(self): + slide_text = '# first slide\n\n- and\n- then\n- this' + self.assertEquals( + self.expected_slide.to_json(), + Slide(slide_text).to_json() + ) + pass def test_slide_render(self):
Remove parse_slide and test slide construction
michaeljoseph_snide
train
py,py
c3f2f20a863f1394b392243fe63cba83cff4edcb
diff --git a/backend/views/product/add-video.php b/backend/views/product/add-video.php index <HASH>..<HASH> 100644 --- a/backend/views/product/add-video.php +++ b/backend/views/product/add-video.php @@ -51,6 +51,16 @@ use yii\widgets\ActiveForm; <?= $video->file_name; ?> </td> <td class="text-center"> + <?php if ($video->resource == 'youtube') : ?> + <iframe width="100%" height="200" src="https://www.youtube.com/embed/<?=$video->file_name; ?>" frameborder="0" allowfullscreen></iframe> + <?php elseif ($video->resource == 'vimeo') : ?> + <iframe src="https://player.vimeo.com/video/<?=$video->file_name; ?>" width="100%" height="200" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> + <?php elseif ($video->resource == 'videofile') : ?> + <video width="100%" height="200" controls> + <source src="/video/<?=$video->file_name; ?>" type="video/mp4"> + Your browser does not support the video tag. + </video> + <?php endif; ?> </td> <td class="text-center"> <a href="<?= Url::toRoute(['delete-video', 'id' => $video->id]); ?>"
Video players added for product editing page.
black-lamp_blcms-shop
train
php
140cc4cd502209cbabed784cf0cbea692fbf0cf4
diff --git a/src/main/java/com/stratio/qa/specs/ThenGSpec.java b/src/main/java/com/stratio/qa/specs/ThenGSpec.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/stratio/qa/specs/ThenGSpec.java +++ b/src/main/java/com/stratio/qa/specs/ThenGSpec.java @@ -370,8 +370,6 @@ public class ThenGSpec extends BaseGSpec { try { if (exitStatus != null) { assertThat(commonspec.getRemoteSSHConnection().getExitStatus()).isEqualTo(exitStatus); - } else { - assertThat(commonspec.getRemoteSSHConnection().getExitStatus()).isEqualTo(0); } assertThat(commonspec.getCommandResult()).as("Contains " + search + ".").contains(search); found = true;
[QATM-<I>] Remove check status 0 by default (#<I>)
Stratio_bdt
train
java
b0e79d962f840b4af8df52c70c17b3c31c104545
diff --git a/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java b/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java +++ b/core/src/main/java/jenkins/security/QueueItemAuthenticatorProvider.java @@ -2,6 +2,7 @@ package jenkins.security; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; +import hudson.ExtensionList; import hudson.ExtensionPoint; import jenkins.model.Jenkins; @@ -32,10 +33,7 @@ public abstract class QueueItemAuthenticatorProvider implements ExtensionPoint { private Iterator<QueueItemAuthenticator> delegate = null; private IteratorImpl() { - final Jenkins jenkins = Jenkins.getInstanceOrNull(); - providers = new ArrayList<QueueItemAuthenticatorProvider>(jenkins == null - ? Collections.<QueueItemAuthenticatorProvider>emptyList() - : jenkins.getExtensionList(QueueItemAuthenticatorProvider.class)).iterator(); + providers = ExtensionList.lookup(QueueItemAuthenticatorProvider.class).iterator(); } @Override
Should have been using `ExtensionList.lookup(Class)` anyway
jenkinsci_jenkins
train
java
337b2e0a928ad96497096261322884c745de19f1
diff --git a/tests/resource/server_test.php b/tests/resource/server_test.php index <HASH>..<HASH> 100644 --- a/tests/resource/server_test.php +++ b/tests/resource/server_test.php @@ -67,7 +67,7 @@ class Resource_Server_test extends PHPUnit_Framework_TestCase { function test_init_header() { // Test with authorisation header - //$this->markTestIncomplete('Authorisation header test has not been implemented yet.'); + $this->markTestIncomplete('Authorisation header test has not been implemented yet.'); } /**
Marked test_init_header as incomplete
thephpleague_oauth2-server
train
php
6f6727b11c14fc8fc2e849d36ea7c8863c4abe3d
diff --git a/libkbfs/init.go b/libkbfs/init.go index <HASH>..<HASH> 100644 --- a/libkbfs/init.go +++ b/libkbfs/init.go @@ -713,6 +713,10 @@ func doInit( } config.SetMDServer(mdServer) + // Must do this after setting the md server, since it depends on + // being able to fetch MDs. + go kbfsOps.initSyncedTlfs() + // Initialize KeyServer connection. MDServer is the KeyServer at the // moment. keyServer, err := makeKeyServer(config, params.MDServerAddr, log) diff --git a/libkbfs/kbfs_ops.go b/libkbfs/kbfs_ops.go index <HASH>..<HASH> 100644 --- a/libkbfs/kbfs_ops.go +++ b/libkbfs/kbfs_ops.go @@ -78,7 +78,6 @@ func NewKBFSOpsStandard(appStateUpdater env.AppStateUpdater, config Config) *KBF } kops.currentStatus.Init() go kops.markForReIdentifyIfNeededLoop() - go kops.initSyncedTlfs() return kops }
kbfs_ops: fix race when initing TLFs before mdserver is set
keybase_client
train
go,go
3febeb93f553be0dceec81591a6e0ba578b42a12
diff --git a/registry.go b/registry.go index <HASH>..<HASH> 100644 --- a/registry.go +++ b/registry.go @@ -279,6 +279,9 @@ func (graph *Graph) PullRepository(stdout io.Writer, remote, askedTag string, re return err } defer res.Body.Close() + if res.StatusCode == 401 { + return fmt.Errorf("Please login first (HTTP code %d)", res.StatusCode) + } // TODO: Right now we're ignoring checksums in the response body. // In the future, we need to use them to check image validity. if res.StatusCode != 200 {
Added help message to invite to login when getting a <I>
moby_moby
train
go
e28317ca6e794b5885d3d73692123d4f4f265caa
diff --git a/addon/components/date-picker-month.js b/addon/components/date-picker-month.js index <HASH>..<HASH> 100644 --- a/addon/components/date-picker-month.js +++ b/addon/components/date-picker-month.js @@ -355,7 +355,7 @@ export default Component.extend({ actions: { selectDate(date) { - let action = get(this, 'attrs.selectDate'); + let action = get(this, 'selectDate'); if (action) { action(date); } diff --git a/addon/components/date-picker.js b/addon/components/date-picker.js index <HASH>..<HASH> 100644 --- a/addon/components/date-picker.js +++ b/addon/components/date-picker.js @@ -598,7 +598,7 @@ export default Component.extend({ * @private */ _sendAction() { - let action = get(this, 'attrs.action'); + let action = get(this, 'action'); let vals = get(this, '_dates'); let isRange = get(this, 'range'); @@ -703,7 +703,7 @@ export default Component.extend({ }, _sendCloseAction() { - let action = get(this, 'attrs.closeAction'); + let action = get(this, 'closeAction'); let vals = get(this, '_dates'); let isRange = get(this, 'range');
Stop using attrs on component
mydea_ember-date-components
train
js,js
c826bffd7cde9aa22a2765b511e7589257514ab1
diff --git a/lib/install.js b/lib/install.js index <HASH>..<HASH> 100644 --- a/lib/install.js +++ b/lib/install.js @@ -31,7 +31,7 @@ module.exports = co.wrap(function* (version) { // extract both zip and tarball const from = `${cacheDir}/${version}.${ext}` if (os.platform === 'linux') { - exec(`tar -xzvf ${from}`, {silent: true}) + exec(`tar -xzvf ${from} -C ${cacheDir}`, {silent: true}) } else { yield pify(extract)(from, {dir: cacheDir}) }
extract to cacheDir, fixed #8
egoist_nwjs
train
js
8210aa09b0c0a608354a772859cb644ea009295e
diff --git a/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java b/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java index <HASH>..<HASH> 100644 --- a/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java +++ b/core/server/src/main/java/alluxio/master/file/FileSystemMaster.java @@ -2490,6 +2490,10 @@ public final class FileSystemMaster extends AbstractMaster { if ((ownerGroupChanged || permissionChanged) && inode.isPersisted()) { MountTable.Resolution resolution = mMountTable.resolve(inodePath.getUri()); String ufsUri = resolution.getUri().toString(); + if (CommonUtils.isUfsObjectStorage(ufsUri)) { + throw new AccessControlException( + "setOwner/setMode is not supported to object storage UFS via Alluxio. UFS: " + ufsUri); + } UnderFileSystem ufs = resolution.getUfs(); if (ownerGroupChanged) { try {
check the object storage UFS for setOwner/setMode
Alluxio_alluxio
train
java
7adb3ab7fffdc547b0a79bc68a7227427a016e0f
diff --git a/awesomplete.js b/awesomplete.js index <HASH>..<HASH> 100644 --- a/awesomplete.js +++ b/awesomplete.js @@ -12,6 +12,8 @@ var _ = function (input, o) { // Setup + this.isOpened = false; + this.input = $(input); this.input.setAttribute("autocomplete", "off"); this.input.setAttribute("aria-autocomplete", "list"); @@ -143,7 +145,7 @@ _.prototype = { }, get opened() { - return !this.ul.hasAttribute("hidden"); + return this.isOpened; }, close: function (o) { @@ -152,6 +154,7 @@ _.prototype = { } this.ul.setAttribute("hidden", ""); + this.isOpened = false; this.index = -1; $.fire(this.input, "awesomplete-close", o || {}); @@ -159,6 +162,7 @@ _.prototype = { open: function () { this.ul.removeAttribute("hidden"); + this.isOpened = true; if (this.autoFirst && this.index === -1) { this.goto(0);
Change getter for opened to use instance variable
LeaVerou_awesomplete
train
js
b80151bec4b61b2414fa4ba7e42d9c09239189ad
diff --git a/code/cms/ShopConfig.php b/code/cms/ShopConfig.php index <HASH>..<HASH> 100644 --- a/code/cms/ShopConfig.php +++ b/code/cms/ShopConfig.php @@ -34,6 +34,11 @@ class ShopConfig extends DataObjectDecorator{ $countriestab->setTitle("Allowed Countries"); } + /** + * Get list of allowed countries + * @param boolean $prefixisocode - prefix the country code + * @return array + */ function getCountriesList($prefixisocode = false){ $countries = Geoip::getCountryDropDown(); if($allowed = $this->owner->AllowedCountries){ @@ -49,4 +54,13 @@ class ShopConfig extends DataObjectDecorator{ return $countries; } + /** + * Alias function for getting SiteConfig + * @return SiteConfig + */ + static function current($locale = null){ + return SiteConfig::current_site_config($locale); + } + + } \ No newline at end of file
API: created alias ShopConfig::current() which is just SiteConfig::current_site_config()
silvershop_silvershop-core
train
php
f7d92c51f94c101bf68fa199e618f78bd3b47f9f
diff --git a/infra/aws/cluster/ips.js b/infra/aws/cluster/ips.js index <HASH>..<HASH> 100644 --- a/infra/aws/cluster/ips.js +++ b/infra/aws/cluster/ips.js @@ -104,7 +104,7 @@ const ips = { }); let params = { - AllocationId: options.params.id + AllocationId: options.params.name }; ec2.releaseAddress(params, cb);
slight modification in deletepublicip for aws
soajs_soajs.core.drivers
train
js
4d248051bc5e694948d8fd18b3a19dc2d9dbac0c
diff --git a/fireplace/card.py b/fireplace/card.py index <HASH>..<HASH> 100644 --- a/fireplace/card.py +++ b/fireplace/card.py @@ -664,7 +664,8 @@ class Aura(BaseCard): if self.isValidTarget(target): if not target in self._buffed: self._buff(target) - for target in self._buffed: + # Make sure to copy the list as it can change during iteration + for target in self._buffed[:]: # Remove auras no longer valid if not self.isValidTarget(target): for buff in self._buffs:
Fix an error due to aura list changing during iteration
jleclanche_fireplace
train
py
e3f9885cddb99a623d5092519b657533368c2b0e
diff --git a/web3/solidity/ureal.py b/web3/solidity/ureal.py index <HASH>..<HASH> 100644 --- a/web3/solidity/ureal.py +++ b/web3/solidity/ureal.py @@ -8,8 +8,10 @@ class SolidityTypeUReal(types.SolidityType): self._inputFormatter = f.formatInputReal self._outputFormatter = f.formatOutputReal + @classmethod def isType(self, name): return re.match(r"^ureal([0-9]*)?(\[([0-9]*)\])*$", name) is not None + @classmethod def staticPartLength(self, name): return 32 * self.staticArrayLength(name) \ No newline at end of file
Make isType, staticPartLength classmethods
ethereum_web3.py
train
py
4000106ab2decb3bf947fbb524e70bf13c16067c
diff --git a/app/medication/edit/route.js b/app/medication/edit/route.js index <HASH>..<HASH> 100644 --- a/app/medication/edit/route.js +++ b/app/medication/edit/route.js @@ -30,8 +30,7 @@ export default AbstractEditRoute.extend(FulfillRequest, InventoryLocations, Pati setupController: function(controller, model) { this._super(controller, model); var inventoryQuery = { - startkey: ['Medication','inventory_'], - endkey: ['Medication','inventory_\uffff'], + key: 'Medication', include_docs: true, }; var inventoryItem = model.get('inventoryItem'), diff --git a/app/procedures/edit/route.js b/app/procedures/edit/route.js index <HASH>..<HASH> 100644 --- a/app/procedures/edit/route.js +++ b/app/procedures/edit/route.js @@ -9,8 +9,7 @@ export default AbstractEditRoute.extend(ChargeRoute, { setupController: function(controller, model) { this._super(controller, model); var medicationQuery = { - startkey: ['Medication','inventory_'], - endkey: ['Medication','inventory_\uffff'], + key: 'Medication', include_docs: true, }; this.controllerFor('pouchdb').queryMainDB(medicationQuery, 'inventory_by_type').then(function(result) {
Updated inventory_by_type view
HospitalRun_hospitalrun-frontend
train
js,js
8c1c197e43d9c55393ac4324112aa8f9221105fd
diff --git a/course/modedit.php b/course/modedit.php index <HASH>..<HASH> 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -345,9 +345,9 @@ } foreach ($items as $itemid=>$unused) { $items[$itemid]->set_parent($fromform->gradecat); - if ($item->id == $grade_item->id) { + if ($itemid == $grade_item->id) { // use updated grade_item - $grade_item = $item; + $grade_item = $items[$itemid]; } } }
MDL-<I> Fixed the bug in modedit.php; Merging from MOODLE_<I>_STABLE
moodle_moodle
train
php
0bd89e550fc34bd04c2b3a57e6a43ac579f864c7
diff --git a/check50.py b/check50.py index <HASH>..<HASH> 100755 --- a/check50.py +++ b/check50.py @@ -537,6 +537,8 @@ class Child(object): pass except EOF: break + except UnicodeDecodeError: + raise Error("output not valid ASCII text") else: self.output.append(bytes) else:
Catch UnicodeDecodeError in wait
cs50_check50
train
py
3243b90ca3bf4fdbc7c478426082a7f958a5ed82
diff --git a/satsearch/scene.py b/satsearch/scene.py index <HASH>..<HASH> 100644 --- a/satsearch/scene.py +++ b/satsearch/scene.py @@ -70,7 +70,7 @@ class Scene(object): @property def assets(self): """ Return dictionary of assets """ - return self.feature['assets'] + return self.feature.get('assets', {}) #prefix = os.path.commonprefix(files) #keys = [os.path.splitext(f[len(prefix):])[0] for f in files] #links = dict(zip(keys, files)) @@ -78,7 +78,7 @@ class Scene(object): @property def links(self): """ Return dictionary of links """ - return self.feature['links'] + return self.feature.get('links', {}) @property def eobands(self):
default to empty dictionary if links or assets does not exist
sat-utils_sat-search
train
py
62bdcb398acbf515d3adddbb45becbf197ac76ee
diff --git a/genmodel/manager.py b/genmodel/manager.py index <HASH>..<HASH> 100644 --- a/genmodel/manager.py +++ b/genmodel/manager.py @@ -250,9 +250,15 @@ def run_job(job_description, job_id, job_name, labeled_data_fname, playbook_fnam hosts_string={} -e job_id={} -e job_name={}'.format( playbook_fname, hosts_string, job_id, job_name) logger.info(ansible_command) + # subprocess.call is blocking, and this is IMPORTANT. + # if we switch to Popen, make sure the call is blocking. subprocess.call(shlex.split(ansible_command)) logger.info("droplets working, job {}-{} started successfully".format( job_name, job_id)) + + logger.info('removing temporary files created for this job') + os.remove(playbook_fname) + os.remove(labeled_data_fname) except psycopg2.Error as e: ref = 'https://www.postgresql.org/docs/current/static/errcodes-appendix.html' logger.error('pgcode {}'.format(e.pgcode) + ref)
remove temporary playbook and labeled data files created for this job
empirical-org_Quill-NLP-Tools-and-Datasets
train
py
e6d4b5420aec12940fbce21852a44c248deb4340
diff --git a/src/registrations.js b/src/registrations.js index <HASH>..<HASH> 100644 --- a/src/registrations.js +++ b/src/registrations.js @@ -52,7 +52,7 @@ export class SingletonRegistration { let resolver = new StrategyResolver(1, fn); if (!this.registerInChild && container !== container.root) { - this.targetContainer = container.root; + resolver.targetContainer = container.root; } return resolver;
fix(registrations): move configuration to correct instance
aurelia_dependency-injection
train
js
35eba8ff9d8bc2b1b8e21955260c42eb3b52ddab
diff --git a/tests/test_compile_to_code.py b/tests/test_compile_to_code.py index <HASH>..<HASH> 100644 --- a/tests/test_compile_to_code.py +++ b/tests/test_compile_to_code.py @@ -99,7 +99,7 @@ def test_compile_to_code_custom_format(): assert exc.value.message == "data must be my-format" -def test_compile_to_code_custom_format_with_refs(): +def test_compile_to_code_custom_format_with_refs(tmp_path, monkeypatch): schema = { 'type': 'object', 'properties': { @@ -115,9 +115,12 @@ def test_compile_to_code_custom_format_with_refs(): } formats = {'my-format': str.isidentifier} code = compile_to_code(schema, formats=formats) - with open('temp/schema_4.py', 'w') as f: - f.write(code) - from temp.schema_4 import validate + + (tmp_path / "schema_4.py").write_text(code) + with monkeypatch.context() as m: + m.syspath_prepend(tmp_path) + from schema_4 import validate + assert validate({"a": ["identifier"]}, formats) is not None with pytest.raises(JsonSchemaValueException) as exc: validate({"a": ["identifier", "not-valid"]}, formats)
Use temporary dir in tests for compiled code
horejsek_python-fastjsonschema
train
py
dedd5134a7de61ed2392831eaff6fcf4e2f80163
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,8 @@ try: # test for 2.7-included packages, add to requirements if not available install_requires = ['six', 'python-dateutil>=2.7'] + python_requires='>=3.6' + # Additional dependencies from requirements.txt that should be installed # for full mtools feature support. These are optional dependencies to # simplify the default install experience, particularly where a build
Fix #<I>: require minimum of Python <I> in setup.py
rueckstiess_mtools
train
py
1fc54d92ec0ad024c03ded4c22820abbf3263ba0
diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index <HASH>..<HASH> 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -313,8 +313,8 @@ web3._extend({ params: 2 }), new web3._extend.Method({ - name: 'setMutexProfileRate', - call: 'debug_setMutexProfileRate', + name: 'setMutexProfileFraction', + call: 'debug_setMutexProfileFraction', params: 1 }), new web3._extend.Method({
internal/web3ext: fix method name for enabling mutex profiling (#<I>)
ethereum_go-ethereum
train
go
714d5f30bbef51ba113c0ef96d362c8c26e7aea9
diff --git a/src/PhpSlackBot/Command/PokerPlanningCommand.php b/src/PhpSlackBot/Command/PokerPlanningCommand.php index <HASH>..<HASH> 100644 --- a/src/PhpSlackBot/Command/PokerPlanningCommand.php +++ b/src/PhpSlackBot/Command/PokerPlanningCommand.php @@ -105,7 +105,9 @@ class PokerPlanningCommand extends BaseCommand { } $message .= '------------------'."\n"; $message .= 'Average score : '.$this->getAverageScore()."\n"; - $message .= 'Median score : '.$this->getMedianScore(); + $message .= 'Median score : '.$this->getMedianScore()."\n"; + $message .= 'Max score : '.$this->getMaxScore()."\n"; + $message .= 'Min score : '.$this->getMinScore(); } $this->send($this->getCurrentChannel(), null, $message); $this->status = 'free'; @@ -163,4 +165,12 @@ class PokerPlanningCommand extends BaseCommand { return array(0, 1, 2, 3, 5, 8, 13, 20, 40, 100); } + private function getMaxScore() { + return max($this->scores); + } + + private function getMinScore() { + return min($this->scores); + } + } \ No newline at end of file
Add max and min scores on pokerp end (#7)
jclg_php-slack-bot
train
php
55ea2320dd7d667221ae295388c5ecf43ff5a008
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -82,6 +82,7 @@ class BuildProtoCommand(Command): print ('This could be due to missing helper files. On many Linux ' 'systems, this is fixed by installing the ' '"libprotobuf-dev" package.') + raise else: print 'Found no proto files to build.'
Re-raise when protoc fails during build_proto
google_openhtf
train
py
244eccac46c9c489fa1747856779b44493fc16ee
diff --git a/tests/test_actions_class.py b/tests/test_actions_class.py index <HASH>..<HASH> 100644 --- a/tests/test_actions_class.py +++ b/tests/test_actions_class.py @@ -44,3 +44,10 @@ class ActionsClassTests(TestCase): @rule_action(params={'foo': 'blah'}) def some_action(self): pass + + def test_rule_action_with_no_params_or_label(self): + """ A rule action should not have to specify paramers or label. """ + @rule_action() + def some_action(self): pass + + self.assertTrue(some_action.is_rule_action)
Add test for no label or params on rule_action decorator
venmo_business-rules
train
py
24c4edb7f56cedaeba806eada2ab423140758798
diff --git a/test/unit/model.js b/test/unit/model.js index <HASH>..<HASH> 100644 --- a/test/unit/model.js +++ b/test/unit/model.js @@ -146,11 +146,37 @@ describe('ConvexModel', function () { .with.property('id', 1); }); - it('can handle data with new nested objects'); + it('can handle data with new nested objects', function () { + model.$set({ + rel1: { + foo: 'bar' + } + }); + expect(model.rel1).to.have.property('foo', 'bar'); + expect(model.rel1).to.have.property('id'); + }); - it('can handle data with foreign keys and new nested objects'); + it('can handle data with foreign keys and new nested objects', function () { + model.$set({ + rel1_id: 1, + rel1: { + id: 1, + foo: 'bar' + } + }); + }); - it('can handle models with existing nested objects'); + it('can handle models with existing nested objects', function () { + model.rel1 = { + id: 1 + }; + model.$set({ + rel1: { + foo: 'bar' + } + }); + expect(model.rel1).to.have.property('id'); + }); });
Add failing tests for deep related object merge behavior of $set
bendrucker_convex
train
js
e36aed04e30ac73dd8c03259fc178ccc883fcff1
diff --git a/newsletter-bundle/contao/ModuleSubscribe.php b/newsletter-bundle/contao/ModuleSubscribe.php index <HASH>..<HASH> 100644 --- a/newsletter-bundle/contao/ModuleSubscribe.php +++ b/newsletter-bundle/contao/ModuleSubscribe.php @@ -266,8 +266,8 @@ class ModuleSubscribe extends Module // Activation e-mail $objEmail = new Email(); - $strText = str_replace('##token##', $strToken, $strText); - $strText = str_replace('##domain##', $this->Environment->host, $this->nl_subscribe); + $strText = str_replace('##token##', $strToken, $this->nl_subscribe); + $strText = str_replace('##domain##', $this->Environment->host, $strText); $strText = str_replace('##link##', $this->Environment->base . $this->Environment->request . (($GLOBALS['TL_CONFIG']['disableAlias'] || strpos($this->Environment->request, '?') !== false) ? '&' : '?') . 'token=' . $strToken, $strText); $strText = str_replace(array('##channel##', '##channels##'), implode("\n", $objChannel->fetchEach('title')), $strText);
[Newsletter] Added the wildcard ##token## to the newsletter subscription module (#<I>)
contao_contao
train
php
206ec4c7a5040563bc81616aa377e9f476e1134e
diff --git a/acorn/src/tokenize.js b/acorn/src/tokenize.js index <HASH>..<HASH> 100644 --- a/acorn/src/tokenize.js +++ b/acorn/src/tokenize.js @@ -316,7 +316,7 @@ pp.readToken_question = function() { // '?' pp.readToken_numberSign = function() { // '#' const ecmaVersion = this.options.ecmaVersion - let code = "#" + let code = 35 // '#' if (ecmaVersion >= 13) { ++this.pos code = this.fullCharCodeAtPos() diff --git a/test/tests-class-features-2022.js b/test/tests-class-features-2022.js index <HASH>..<HASH> 100644 --- a/test/tests-class-features-2022.js +++ b/test/tests-class-features-2022.js @@ -1755,6 +1755,9 @@ test("class C { #𩸽 }", { "sourceType": "script" }, {ecmaVersion: 13}) +// old ecma version +testFail("class C { #aaa }", "Unexpected character '#' (1:10)", {ecmaVersion: 12}) + // Unexpected character testFail("class C { # aaa }", "Unexpected character ' ' (1:11)", {ecmaVersion: 13}) testFail("class C { #+aaa }", "Unexpected character '+' (1:11)", {ecmaVersion: 13})
fix `code` with code point
acornjs_acorn
train
js,js
640844e826074e6eaa5a7934eec34a27bbf63035
diff --git a/modules/newsadmin/models/Article.php b/modules/newsadmin/models/Article.php index <HASH>..<HASH> 100644 --- a/modules/newsadmin/models/Article.php +++ b/modules/newsadmin/models/Article.php @@ -78,7 +78,7 @@ class Article extends \admin\ngrest\base\Model $config->update->field('file_list', 'Datei Liste')->fileArray(); $config->update->extraField('tags', 'Tags')->checkboxRelation(\newsadmin\models\Tag::className(), 'news_article_tag', 'article_id', 'tag_id'); - $config->create->copyFrom('update', ['id']); + $config->create->copyFrom('update'); return $config; }
fixed: Unable to remove field 'id' from 'update' config. The field does not exists.
luyadev_luya
train
php
d64e146ec9c27d6c0de91fd7d13e6f600bde1c42
diff --git a/lib/devise/orm/data_mapper.rb b/lib/devise/orm/data_mapper.rb index <HASH>..<HASH> 100644 --- a/lib/devise/orm/data_mapper.rb +++ b/lib/devise/orm/data_mapper.rb @@ -24,9 +24,10 @@ module Devise def apply_schema(name, type, options={}) SCHEMA_OPTIONS.each do |old_key, new_key| next unless options.key?(old_key) - options[new_key] = !options.delete(old_key) + options[new_key] = options.delete(old_key) end + options.delete(:default) property name, type, options end end @@ -81,6 +82,6 @@ module Devise end DataMapper::Model.class_eval do - extend Devise::Orm::DataMapper::Hook include Devise::Models + include Devise::Orm::DataMapper::Hook end
Modified the datamapper orm so that it actually works with devise
plataformatec_devise
train
rb
0f5fde8f9538a1c3d86e17cb0f4f8d73aab18028
diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/deployment/WebParsingDeploymentProcessor.java b/undertow/src/main/java/org/wildfly/extension/undertow/deployment/WebParsingDeploymentProcessor.java index <HASH>..<HASH> 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/deployment/WebParsingDeploymentProcessor.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/deployment/WebParsingDeploymentProcessor.java @@ -118,7 +118,7 @@ public class WebParsingDeploymentProcessor implements DeploymentUnitProcessor { warMetaData.setWebMetaData(webMetaData); } catch (XMLStreamException e) { - throw new DeploymentUnitProcessingException(MESSAGES.failToParseXMLDescriptor(webXml, e.getLocation().getLineNumber(), e.getLocation().getColumnNumber())); + throw new DeploymentUnitProcessingException(MESSAGES.failToParseXMLDescriptor(webXml, e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()), e); } catch (IOException e) { throw new DeploymentUnitProcessingException(MESSAGES.failToParseXMLDescriptor(webXml), e); } finally {
WFLY-<I> Don't lose the original parsing exception when throwing the DeploymentUnitProcessingException
wildfly_wildfly
train
java
1b91031679c985e99cb79412bb340e142cb9a569
diff --git a/chatterbot/adapters/io/io.py b/chatterbot/adapters/io/io.py index <HASH>..<HASH> 100644 --- a/chatterbot/adapters/io/io.py +++ b/chatterbot/adapters/io/io.py @@ -7,6 +7,15 @@ class IOAdapter(object): that all input-output adapters should implement. """ + def __init__(self, **kwargs): + pass + + def process_input(self): + """ + Returns data retrieved from the input source. + """ + raise AdapterNotImplementedError() + def process_response(self, input_value): """ Takes an input value. diff --git a/chatterbot/chatterbot.py b/chatterbot/chatterbot.py index <HASH>..<HASH> 100644 --- a/chatterbot/chatterbot.py +++ b/chatterbot/chatterbot.py @@ -26,7 +26,7 @@ class ChatBot(object): self.logic = LogicAdapter() IOAdapter = import_module(io_adapter) - self.io = IOAdapter() + self.io = IOAdapter(**kwargs) self.trainer = None
Kwargs are now passed to io adapter.
gunthercox_ChatterBot
train
py,py
a4770fb4f616ca3ff1b661622241154b37d18f0a
diff --git a/src/calmjs/cli.py b/src/calmjs/cli.py index <HASH>..<HASH> 100644 --- a/src/calmjs/cli.py +++ b/src/calmjs/cli.py @@ -44,6 +44,8 @@ def _get_bin_version(bin_path, version_flag='-v', _from=None, _to=None): class Cli(object): + indent = 4 + def __init__(self, node_bin=NODE, npm_bin=NPM, node_path=None): """ @@ -82,7 +84,7 @@ class Cli(object): package_name, filename=PACKAGE_JSON) with open(PACKAGE_JSON, 'w') as fd: - json.dump(package_json, fd) + json.dump(package_json, fd, indent=self.indent) call([self.npm_bin, 'install'])
Make the npm --init output also indented to 4.
calmjs_calmjs
train
py
2e097e94d013f7b0ad36f9ab520ccf617da12d32
diff --git a/src/data.js b/src/data.js index <HASH>..<HASH> 100644 --- a/src/data.js +++ b/src/data.js @@ -1145,7 +1145,7 @@ var data = { obj.fire("beforeDataSync"); this.callback !== null ? client.jsonp(this.uri, success, failure, {callback: this.callback}) - : client.request(this.uri, "GET", success, failure, utility.merge({withCredentials: this.credentials}, this.headers)); + : client.request(this.uri, "GET", success, failure, null, utility.merge({withCredentials: this.credentials}, this.headers)); return this; },
Fixing a regression in `data.sync()` caused by call stack optimization where HTTP headers were being passed as the request body
avoidwork_abaaso
train
js
02b743ec67543f082988e9a3c1a1c43208035bbd
diff --git a/pippo-core/src/main/java/ro/pippo/core/Response.java b/pippo-core/src/main/java/ro/pippo/core/Response.java index <HASH>..<HASH> 100644 --- a/pippo-core/src/main/java/ro/pippo/core/Response.java +++ b/pippo-core/src/main/java/ro/pippo/core/Response.java @@ -1150,6 +1150,28 @@ public final class Response { } } + /** + * This method resets the response. + */ + public void reset() { + checkCommitted(); + + // reset all headers + headers = new HashMap<>(); + // reset all cookies + cookies = new HashMap<>(); + // reset all locales + locals = new HashMap<>(); + // set status to 0 or INT MAX + status = 0; + + try { + httpServletResponse.reset(); + } catch (Exception e) { + throw new PippoRuntimeException(e); + } + } + public static Response get() { RouteContext routeContext = RouteDispatcher.getRouteContext();
feat(Response): expose method to reset the response
pippo-java_pippo
train
java
d88d014a62d8d1051471f51beb6d215c2c72d661
diff --git a/chef/lib/chef/resource.rb b/chef/lib/chef/resource.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/resource.rb +++ b/chef/lib/chef/resource.rb @@ -71,8 +71,8 @@ F end - FORBIDDEN_IVARS = [:@run_context, :@node, :@not_if, :@only_if] - HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name, :@node, :@not_if, :@only_if, :@elapsed_time] + FORBIDDEN_IVARS = [:@run_context, :@node, :@not_if, :@only_if, :@enclosing_provider] + HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name, :@node, :@not_if, :@only_if, :@elapsed_time, :@enclosing_provider] include Chef::Mixin::CheckHelper include Chef::Mixin::ParamsValidate
avoid puking enclosing_provider and the entire run_context...
chef_chef
train
rb
a6118bbc18d7109d604e9b90b2aca2145704a52d
diff --git a/spec/integration/veritas/self_referential/many_to_many_spec.rb b/spec/integration/veritas/self_referential/many_to_many_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/veritas/self_referential/many_to_many_spec.rb +++ b/spec/integration/veritas/self_referential/many_to_many_spec.rb @@ -30,6 +30,8 @@ describe 'Relationship - Self referential Many To Many' do end it 'loads all followed people' do + pending if RUBY_VERSION < '1.9' + people = DM_ENV[person_model].include(:followed_people).to_a john = people[0] @@ -41,6 +43,8 @@ describe 'Relationship - Self referential Many To Many' do end it 'loads all followers' do + pending if RUBY_VERSION < '1.9' + people = DM_ENV[person_model].include(:followers).to_a john = people[0]
Remove <I> from travis' allowed failures
rom-rb_rom
train
rb
eb3ce5fdf58ad93cbb3cf10c37ddd46c2d813f8d
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -926,9 +926,9 @@ var CodeMirror = (function() { function updateCursor() { var head = sel.inverted ? sel.from : sel.to, lh = textHeight(); var pos = localCoords(head, true); - var globalY = pos.y + displayOffset * textHeight(); - inputDiv.style.top = Math.max(Math.min(globalY, scroller.offsetHeight), 0) + "px"; - inputDiv.style.left = pos.x + "px"; + var wrapOff = eltOffset(wrapper), lineOff = eltOffset(lineDiv); + inputDiv.style.top = (pos.y + lineOff.top - wrapOff.top) + "px"; + inputDiv.style.left = (pos.x + lineOff.left - wrapOff.left) + "px"; if (posEq(sel.from, sel.to)) { cursor.style.top = pos.y + "px"; cursor.style.left = (options.lineWrapping ? Math.min(pos.x, lineSpace.offsetWidth) : pos.x) + "px";
Be more precise about hidden input placement This reduces scrolling artifacts caused by the input being scrolled into view.
codemirror_CodeMirror
train
js
038169d676a96fa9258ed95d749b371ae04e6696
diff --git a/src/sap.m/src/sap/m/IconTabHeader.js b/src/sap.m/src/sap/m/IconTabHeader.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/IconTabHeader.js +++ b/src/sap.m/src/sap/m/IconTabHeader.js @@ -343,9 +343,9 @@ sap.ui.define(['jquery.sap.global', './library', 'sap/ui/core/Control', 'sap/ui/ if (oItem.getVisible()) { //click on already selected item leads to expanding/collapsing of the content (if expandable enabled) - if (this.oSelectedItem === oItem && !bAPIchange) { + if (this.oSelectedItem === oItem) { //if content is not expandable nothing should happen otherwise content will be expanded/collapsed - if (bIsParentIconTabBar && oParent.getExpandable()) { + if (!bAPIchange && bIsParentIconTabBar && oParent.getExpandable()) { oParent._toggleExpandCollapse(); } //click on other item leads to showing the right content of this item
[FIX] sap.m.IconTabBar: setSelectedItem method is working correctly now Change-Id: I1adac0aad<I>d<I>dfa9a2e<I>c<I>bb<I>a<I> BCP: <I>
SAP_openui5
train
js
5ae347624f3ba049a6af02270f8e454091906f52
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -114,8 +114,6 @@ module Rails puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}" puts "=> Rails #{Rails.version} application starting in #{Rails.env} on #{url}" puts "=> Run `rails server -h` for more startup options" - - puts "=> Ctrl-C to shutdown server" unless options[:daemonize] end def create_cache_file
Delete CTRL-C message as is duplicates Puma
rails_rails
train
rb
cc3db95243e0c865baee333a31895a835a7d69ff
diff --git a/resolwe/flow/executors/run.py b/resolwe/flow/executors/run.py index <HASH>..<HASH> 100644 --- a/resolwe/flow/executors/run.py +++ b/resolwe/flow/executors/run.py @@ -248,13 +248,8 @@ class BaseFlowExecutor: if process_rc > 0: log_file.close() json_file.close() - await self._send_manager_command( - ExecutorProtocol.FINISH, - extra_fields={ - ExecutorProtocol.FINISH_PROCESS_RC: process_rc - }, - ) - return + + return {ExecutorProtocol.FINISH_PROCESS_RC: process_rc} # Debug output # Not referenced in Data object
Unify return path of executor's run method
genialis_resolwe
train
py
410d53064b20381f4eaa737b5b8b330a8e974e18
diff --git a/ModuleBuilderFactory.php b/ModuleBuilderFactory.php index <HASH>..<HASH> 100644 --- a/ModuleBuilderFactory.php +++ b/ModuleBuilderFactory.php @@ -60,7 +60,8 @@ class Factory { // Create the environment handler and set it on the factory. $environment_class = '\ModuleBuilder\Environment\\' . $environment_class; - self::$environment = new $environment_class; + + self::setEnvironment(new $environment_class); return self::$environment; } @@ -68,10 +69,10 @@ class Factory { /** * Set the environment object. * - * @param $environment + * @param \ModuleBuilder\Environment\EnvironmentInterface $environment * An environment object to set. */ - public static function setEnvironment($environment) { + public static function setEnvironment(\ModuleBuilder\Environment\EnvironmentInterface $environment) { self::$environment = new $environment; }
Added interface to method; change wrapper method to call setEnvironment() so interface is checked.
drupal-code-builder_drupal-code-builder
train
php
86144ddcb4fce1d51fcbf1b59f1065dd8cd7d27d
diff --git a/release.py b/release.py index <HASH>..<HASH> 100755 --- a/release.py +++ b/release.py @@ -95,6 +95,7 @@ def tag_and_push(): def pypi(): print("--- PYPI ---------------------------------------------------------") + system("rm -rf build") system("python3 setup.py sdist bdist_wheel") system("twine check dist/*") system("twine upload --skip-existing --sign dist/*")
Work around stale files in wheel (closes #<I>)
niklasf_python-chess
train
py
09db20e9fcd78df64c4882a6bf0ba1de152f46ef
diff --git a/httprunner/utils.py b/httprunner/utils.py index <HASH>..<HASH> 100644 --- a/httprunner/utils.py +++ b/httprunner/utils.py @@ -597,12 +597,19 @@ def dump_tests(tests_mapping, tag_name): file_name, file_suffix = os.path.splitext(os.path.basename(test_path)) dump_file_path = os.path.join(dir_path, "{}.{}.json".format(file_name, tag_name)) - tests_to_dump = { - "project_mapping": { - key: project_mapping[key] for key in project_mapping if key != "functions" - }, - "testcases": tests_mapping["testcases"] - } + tests_to_dump = {} + + for key in project_mapping: + if key != "functions": + tests_to_dump[key] = project_mapping[key] + continue + + if project_mapping["functions"]: + debugtalk_py_path = os.path.join(dir_path, "debugtalk.py") + tests_to_dump["debugtalk.py"] = debugtalk_py_path + + tests_to_dump["testcases"] = tests_mapping["testcases"] + with open(dump_file_path, 'w', encoding='utf-8') as outfile: json.dump(tests_to_dump, outfile, indent=4, separators=(',', ': '))
save tests: add debugtalk.py file path
HttpRunner_HttpRunner
train
py
da50911cb60b11ac717f2be50aecfe328662e9c2
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,7 @@ /** * Pon task to execute commands * @module pon-task-command - * @version 1.0.3 + * @version 1.0.4 */ 'use strict'
[ci skip] Travis CI committed after build
realglobe-Inc_pon-task-command
train
js
92d0747ec46b62b4edd14d1faf91cedce31b3d6e
diff --git a/src/directives/list/table/directive.js b/src/directives/list/table/directive.js index <HASH>..<HASH> 100644 --- a/src/directives/list/table/directive.js +++ b/src/directives/list/table/directive.js @@ -5,9 +5,8 @@ export default () => { return { restrict: 'E', templateUrl: 'monad/src/directives/list/table/template.html', - scope: {module: '=', items: '=', columns: '='}, + scope: {module: '=', items: '=', columns: '=', path: '='}, controller, - controllerAs: 'table', bindToController: true }; };
nevermind controllerAs for now, it's in an isolate scope anyway
monomelodies_monad
train
js
17276793273dd19f31a6e52de675fb8222918ff4
diff --git a/client/lib/abtest/active-tests.js b/client/lib/abtest/active-tests.js index <HASH>..<HASH> 100644 --- a/client/lib/abtest/active-tests.js +++ b/client/lib/abtest/active-tests.js @@ -1,7 +1,7 @@ /** @format */ export default { multiyearSubscriptions: { - datestamp: '20180417', + datestamp: '20180601', variations: { show: 50, hide: 50,
[2 year plans] Update the timestamp on multiyearSubscriptions test (#<I>)
Automattic_wp-calypso
train
js
cf5e3f95bc5606991360f1220b60e7570ee14f53
diff --git a/tests/test_serializer.py b/tests/test_serializer.py index <HASH>..<HASH> 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -79,7 +79,6 @@ class TestCase(unittest.TestCase): def test_serializer(): for filename in glob.glob('serializer/*.test'): - if filename.find('core')<0: continue tests = simplejson.load(file(filename)) for test in tests['tests']: yield test
Remove line that was accidentally committed --HG-- extra : convert_revision : svn%3Aacbfec<I>-<I>-<I>-a<I>-<I>a<I>e<I>e0/trunk%<I>
html5lib_html5lib-python
train
py
17390a2030faa4818bf9e478bf96e22ea8226cdd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -46,5 +46,5 @@ setup( "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", ], package_data = {'flat':['templates/*.html','style/*'], 'flat.modes.structureeditor':['templates/*.html'], 'flat.modes.viewer':['templates/*.html'], 'flat.modes.editor':['templates/*.html'], 'flat.modes.metadata':['templates/*.html'] }, - install_requires=['pynlpl >= 1.1.1','Django >= 1.8','requests'] + extradeps + install_requires=['pynlpl >= 1.0.7','Django >= 1.8','requests'] + extradeps )
downgrading pynlpl dependency for <I> release
proycon_flat
train
py
fad4da42aeb3c1e0d15b9d4dc94b06453eaa0f34
diff --git a/src/models/Entity.php b/src/models/Entity.php index <HASH>..<HASH> 100644 --- a/src/models/Entity.php +++ b/src/models/Entity.php @@ -93,10 +93,14 @@ class Entity extends Eloquent { { if ($this->hidden[static::ANCESTOR] === null) { - $this->hidden[static::ANCESTOR] = $this->buildClosuretableQuery() + $closure = $this->buildClosuretableQuery() ->where(static::DEPTH, '=', $this->getDepth()) - ->first() - ->{static::ANCESTOR}; + ->first(); + + if ($closure !== null) + { + $this->hidden[static::ANCESTOR] = $closure->{static::ANCESTOR}; + } } return $this->hidden[static::ANCESTOR]; @@ -121,10 +125,14 @@ class Entity extends Eloquent { { if ($this->hidden[static::DESCENDANT] === null) { - $this->hidden[static::DESCENDANT] = $this->buildClosuretableQuery() + $closure = $this->buildClosuretableQuery() ->where(static::DEPTH, '=', $this->getDepth()) - ->first() - ->{static::DESCENDANT}; + ->first(); + + if ($closure !== null) + { + $this->hidden[static::DESCENDANT] = $closure->{static::DESCENDANT}; + } } return $this->hidden[static::DESCENDANT];
fixed errors while creating new Entity via create() method
soda-framework_eloquent-closure
train
php
ddd84c4f505e2e51b0a05c0e9d02e48851a7397d
diff --git a/bonobo/examples/environ.py b/bonobo/examples/environ.py index <HASH>..<HASH> 100644 --- a/bonobo/examples/environ.py +++ b/bonobo/examples/environ.py @@ -1,26 +1,26 @@ +""" +This transformation extracts the environment and prints it, sorted alphabetically, one item per line. + +Used in the bonobo tests around environment management. + +""" import os import bonobo def extract_environ(): + """Yield all the system environment.""" yield from sorted(os.environ.items()) def get_graph(): - """ - This function builds the graph that needs to be executed. - - :return: bonobo.Graph - - """ graph = bonobo.Graph() graph.add_chain(extract_environ, print) return graph -# The __main__ block actually execute the graph. if __name__ == '__main__': parser = bonobo.get_argument_parser() with bonobo.parse_args(parser):
[examples] comments.
python-bonobo_bonobo
train
py
1b80a504182f728e3d8461e63b7b6891c64b888b
diff --git a/user/index.php b/user/index.php index <HASH>..<HASH> 100644 --- a/user/index.php +++ b/user/index.php @@ -351,6 +351,8 @@ if (!isset($hiddenfields['lastaccess'])) { $table->sortable(true, 'lastaccess', SORT_DESC); + } else { + $table->sortable(true, 'firstname', SORT_ASC); } $table->no_sorting('roles');
MDL-<I> Course Making user lists sortable when lastacess field is hidden
moodle_moodle
train
php
bc0b788f702c02eeeaad73d4cb625a68bfdfe25f
diff --git a/lib/fog/bin/aws.rb b/lib/fog/bin/aws.rb index <HASH>..<HASH> 100644 --- a/lib/fog/bin/aws.rb +++ b/lib/fog/bin/aws.rb @@ -79,6 +79,8 @@ class AWS < Fog::Bin Fog::AWS::ELB.new when :emr Fog::AWS::EMR.new + when :glacier + Fog::AWS::Glacier.new when :iam Fog::AWS::IAM.new when :rds
[AWS] Adding missing :glacier case for AWS.collections
fog_fog
train
rb
64873654be9d6db53b8a82d58c158ba3cd5c0f13
diff --git a/lib/onebox/engine/soundcloud_onebox.rb b/lib/onebox/engine/soundcloud_onebox.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/soundcloud_onebox.rb +++ b/lib/onebox/engine/soundcloud_onebox.rb @@ -9,7 +9,7 @@ module Onebox def to_html oembed_data = get_oembed_data[:html] - oembed_data.gsub!('height="400"', 'height="250"') || oembed_data + oembed_data.gsub!('visual=true', 'visual=false') || oembed_data end def placeholder_html @@ -18,8 +18,16 @@ module Onebox private + def set? + url =~ /\/sets\// + end + def get_oembed_data - Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}").body)) + if set? + Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}").body)) + else + Onebox::Helpers.symbolize_keys(::MultiJson.load(Onebox::Helpers.fetch_response("https://soundcloud.com/oembed.json?url=#{url}&maxheight=166").body)) + end end end end
UX: better SoundCloud onebox
discourse_onebox
train
rb
43bc588cb3e713a5ce1e79bc27e42dff1818f7eb
diff --git a/modules/custom/activity_creator/src/ActivityFactory.php b/modules/custom/activity_creator/src/ActivityFactory.php index <HASH>..<HASH> 100644 --- a/modules/custom/activity_creator/src/ActivityFactory.php +++ b/modules/custom/activity_creator/src/ActivityFactory.php @@ -124,7 +124,7 @@ class ActivityFactory extends ControllerBase { $value = $message->getText(NULL); // Text for aggregated activities. if (!empty($value[1]) && !empty($arguments)) { - $text = t($value[1], $arguments); + $text = str_replace('@count', $arguments['@count'], $value[1]); } // Text for default activities. else {
DS-<I> by ribel: Fix replacing '@count' string in output text for aggregated activities
goalgorilla_open_social
train
php
5994c89a99c6e9266f77c1e257ed235d974c4b9a
diff --git a/test/fixture/js/index-actual.js b/test/fixture/js/index-actual.js index <HASH>..<HASH> 100644 --- a/test/fixture/js/index-actual.js +++ b/test/fixture/js/index-actual.js @@ -8,4 +8,8 @@ module.exports = function(config){ // But just in case... // bower:css // endbower + "scripts/app/app.js" + ]; // END config.files + + // Mentioning bower inside a comment should have no effect. };
Thought to include a comment that might break...
taptapship_wiredep
train
js
abdcfc657d5b87ec3332042343099b4ec645a9f6
diff --git a/Library/Operators/Comparison/EqualsOperator.php b/Library/Operators/Comparison/EqualsOperator.php index <HASH>..<HASH> 100644 --- a/Library/Operators/Comparison/EqualsOperator.php +++ b/Library/Operators/Comparison/EqualsOperator.php @@ -32,6 +32,8 @@ class EqualsOperator extends ComparisonBaseOperator protected $_zvalLongOperator = 'ZEPHIR_IS_LONG'; + protected $_zvalLongNegOperator = 'ZEPHIR_IS_LONG'; + protected $_zvalStringOperator = 'ZEPHIR_IS_STRING'; protected $_zvalBoolTrueOperator = 'ZEPHIR_IS_TRUE'; diff --git a/Library/Operators/Comparison/IdenticalOperator.php b/Library/Operators/Comparison/IdenticalOperator.php index <HASH>..<HASH> 100644 --- a/Library/Operators/Comparison/IdenticalOperator.php +++ b/Library/Operators/Comparison/IdenticalOperator.php @@ -31,6 +31,8 @@ class IdenticalOperator extends ComparisonBaseOperator protected $_zvalLongOperator = 'ZEPHIR_IS_LONG'; + protected $_zvalLongNegOperator = 'ZEPHIR_IS_LONG'; + protected $_zvalStringOperator = 'ZEPHIR_IS_STRING'; protected $_zvalBoolTrueOperator = 'ZEPHIR_IS_TRUE';
Fixing comparison of var(int) with var(dynamic)
phalcon_zephir
train
php,php
8ed6a91e5d7f72a3a27dafed7f3f5c822c69b1eb
diff --git a/charge.go b/charge.go index <HASH>..<HASH> 100644 --- a/charge.go +++ b/charge.go @@ -73,7 +73,7 @@ type Charge struct { Invoice *Invoice `json:"invoice"` Live bool `json:"livemode"` Meta map[string]string `json:"metadata"` - Outcome *Outcome `json:"outcome"` + Outcome *ChargeOutcome `json:"outcome"` Paid bool `json:"paid"` Refunded bool `json:"refunded"` Refunds *RefundList `json:"refunds"` @@ -94,7 +94,7 @@ type FraudDetails struct { // Outcome is the charge's outcome that details whether a payment // was accepted and why. -type Outcome struct { +type ChargeOutcome struct { NetworkStatus string `json:"network_status"` Reason string `json:"reason"` SellerMessage string `json:"seller_message"`
charge: rename top-level Outcome to ChargeOutcome
stripe_stripe-go
train
go
84b8f2de2279a10b4fd403e9ca29cf70fb3c9f4b
diff --git a/lib/assertions.js b/lib/assertions.js index <HASH>..<HASH> 100644 --- a/lib/assertions.js +++ b/lib/assertions.js @@ -198,9 +198,23 @@ module.exports = function (expect) { } catch (e) { if (e._isUnexpected && this.flags.not) { e.createDiff = function () { - return expect.diff(subject, subject.replace(new RegExp(args.map(function (arg) { + var output = expect.output.clone(); + var lastIndex = 0; + function flushUntilIndex(i) { + if (i > lastIndex) { + output.text(subject.substring(lastIndex, i)); + lastIndex = i; + } + } + subject.replace(new RegExp(args.map(function (arg) { return utils.escapeRegExpMetaChars(String(arg)); - }).join('|'), 'g'), '')); + }).join('|'), 'g'), function ($0, index) { + flushUntilIndex(index); + lastIndex += $0.length; + output.text($0, 'red'); + }); + flushUntilIndex(subject.length); + return {diff: output}; }; } expect.fail(e);
not to contain: Implemented diff for the string case.
unexpectedjs_unexpected
train
js
eaa563aefabf53e40ac8b2591dc976d9ca314cbe
diff --git a/src/Illuminate/Container/ContextualBindingBuilder.php b/src/Illuminate/Container/ContextualBindingBuilder.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Container/ContextualBindingBuilder.php +++ b/src/Illuminate/Container/ContextualBindingBuilder.php @@ -21,6 +21,13 @@ class ContextualBindingBuilder implements ContextualBindingBuilderContract protected $concrete; /** + * The abstract target. + * + * @var string + */ + protected $needs; + + /** * Create a new contextual binding builder. * * @param \Illuminate\Container\Container $container
Declare undeclared class property.
laravel_framework
train
php
b0b640e4fe9b73df96407f501718be4dba7d441e
diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/servererrors/ReadTimeoutException.java b/core/src/main/java/com/datastax/oss/driver/api/core/servererrors/ReadTimeoutException.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/datastax/oss/driver/api/core/servererrors/ReadTimeoutException.java +++ b/core/src/main/java/com/datastax/oss/driver/api/core/servererrors/ReadTimeoutException.java @@ -45,7 +45,8 @@ public class ReadTimeoutException extends QueryConsistencyException { this( coordinator, String.format( - "Cassandra timeout during read query at consistency %s (%s)", + "Cassandra timeout during read query at consistency %s (%s). " + + "In case this was generated during read repair, the consistency level is not representative of the actual consistency.", consistencyLevel, formatDetails(received, blockFor, dataPresent)), consistencyLevel, received,
Update log message to inform about incorrect CL for read repair (#<I>)
datastax_java-driver
train
java
2e002c95aec35ec68284522d45dbfc62621816e5
diff --git a/lib/ticketmaster/systems/github.rb b/lib/ticketmaster/systems/github.rb index <HASH>..<HASH> 100644 --- a/lib/ticketmaster/systems/github.rb +++ b/lib/ticketmaster/systems/github.rb @@ -41,6 +41,8 @@ module TicketMaster def self.tickets(project) repo = Octopi::Repository.find(project.owner, project.name) + # @todo: Does it also return an array when there's only one + # issue? issues = [] repo.issues.each do |issue| issues << TicketMaster::Ticket.new(issue.title, {
Added todo for Github::Project#tickets
hybridgroup_taskmapper
train
rb
4e7bf85fbc97f1b2e95be8124fbf8c065452bba2
diff --git a/src/function/algebra/decomposition/qr.js b/src/function/algebra/decomposition/qr.js index <HASH>..<HASH> 100644 --- a/src/function/algebra/decomposition/qr.js +++ b/src/function/algebra/decomposition/qr.js @@ -53,7 +53,7 @@ function factory (type, config, load, typed) { * * See also: * - * lusolve + * lup, lusolve * * @param {Matrix | Array} A A two dimensional matrix or array * for which to get the QR decomposition.
docs: add link to lup in qr
josdejong_mathjs
train
js