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 |
|---|---|---|---|---|---|
483399550800b7478ac304031ba16cd830b28861 | diff --git a/Tests/DependencyInjection/EasyAdminExtensionTest.php b/Tests/DependencyInjection/EasyAdminExtensionTest.php
index <HASH>..<HASH> 100644
--- a/Tests/DependencyInjection/EasyAdminExtensionTest.php
+++ b/Tests/DependencyInjection/EasyAdminExtensionTest.php
@@ -47,7 +47,7 @@ class EasyAdminExtensionTest extends CommonPhpUnitTestCase
$parsedConfiguration = $this->parseConfigurationFile($inputFixtureFilepath);
$expectedConfiguration = file_get_contents($outputFixtureFilepath);
- $expectedConfiguration = str_replace("\r", '', $expectedConfiguration);// Prevents bugs from different git crlf config
+ $expectedConfiguration = str_replace("\r", '', $expectedConfiguration); // Prevents bugs from different git crlf config
$this->assertEquals($expectedConfiguration, $parsedConfiguration, sprintf('%s configuration is correctly parsed into %s', $inputFixtureFilepath, $outputFixtureFilepath));
} | Fixed a spacing issue in one test | EasyCorp_EasyAdminBundle | train | php |
fe35956bf7b51bc533850449bd9135cc269da2ac | diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb
index <HASH>..<HASH> 100644
--- a/lib/arel/select_manager.rb
+++ b/lib/arel/select_manager.rb
@@ -151,6 +151,10 @@ module Arel
}
end
+ def join_sources
+ @ctx.source.right
+ end
+
def joins manager
if $VERBOSE
warn "joins is deprecated and will be removed in 3.0.0"
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb
index <HASH>..<HASH> 100644
--- a/test/test_select_manager.rb
+++ b/test/test_select_manager.rb
@@ -47,6 +47,12 @@ module Arel
end
describe 'select manager' do
+ def test_join_sources
+ manager = Arel::SelectManager.new Table.engine
+ manager.join_sources << Arel::Nodes::StringJoin.new('foo')
+ assert_equal "SELECT FROM 'foo'", manager.to_sql
+ end
+
describe 'backwards compatibility' do
describe 'project' do
it 'accepts symbols as sql literals' do | adding join_sources so we can access the join sources of the select core | rails_rails | train | rb,rb |
b1bf16acbfe2e45fcbf6faa4d14e00cf4adcf4a1 | diff --git a/nlppln/utils.py b/nlppln/utils.py
index <HASH>..<HASH> 100644
--- a/nlppln/utils.py
+++ b/nlppln/utils.py
@@ -1,5 +1,6 @@
"""NLP pipeline utility functionality"""
import os
+import itertools
MODULE_PATH = os.path.dirname(os.path.realpath(__file__))
CWL_PATH = os.path.abspath(os.path.join(MODULE_PATH, 'cwl'))
@@ -55,13 +56,11 @@ def get_files(directory, recursive=False):
files_out = []
if recursive:
for root, dirs, files in os.walk(os.path.abspath(directory)):
- for f in files:
- files_out.append(os.path.join(root, f))
+ files_out.append(files)
+ files_out = list(itertools.chain(*files_out))
else:
- for f in os.listdir(directory):
- fi = os.path.join(directory, f)
- if os.path.isfile(fi):
- files_out.append(fi)
+ files_out = [os.path.join(directory, f) for f in os.listdir(directory)]
+ files_out = list(filter(lambda f: os.path.isfile(f), files_out))
# order alphabetically on file name
return sorted(files_out) | Make get_files faster
By using itertools and filter. | nlppln_nlppln | train | py |
5613867b3b5d7cbb44acbc3f80f80ff4c333f4e4 | diff --git a/pkg/codegen/docs/gen_kubernetes.go b/pkg/codegen/docs/gen_kubernetes.go
index <HASH>..<HASH> 100644
--- a/pkg/codegen/docs/gen_kubernetes.go
+++ b/pkg/codegen/docs/gen_kubernetes.go
@@ -32,7 +32,11 @@ func isKubernetesPackage(pkg *schema.Package) bool {
}
func (mod *modContext) isKubernetesOverlayModule() bool {
- return strings.HasPrefix(mod.mod, "helm") || strings.HasPrefix(mod.mod, "yaml")
+ // The CustomResource overlay resource is directly under the apiextensions module
+ // and not under a version, so we include that. The resources under helm and yaml are
+ // always under a version.
+ return mod.mod == "apiextensions" ||
+ strings.HasPrefix(mod.mod, "helm") || strings.HasPrefix(mod.mod, "yaml")
}
// getKubernetesOverlayPythonFormalParams returns the formal params to render | [codegen/docs] Add apiextensions as a k8s overlay resource (#<I>)
* Add apiextensions as a k8s overlay. Add comment. | pulumi_pulumi | train | go |
57a89be198b99a13df043a4d48e8956d9a9e8a92 | diff --git a/src/com/google/javascript/rhino/Node.java b/src/com/google/javascript/rhino/Node.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/rhino/Node.java
+++ b/src/com/google/javascript/rhino/Node.java
@@ -3302,7 +3302,7 @@ public class Node implements Serializable {
* i.e. first byte will be the lower 7 bits with a continuation bit set and second byte will
* consist of the upper 7 bits with the continuation bit unset.
*
- * This encoding aims to reduce the serialized footprint for the most commong values, reducing the
+ * This encoding aims to reduce the serialized footprint for the most common values, reducing the
* footprint for all positive values that are smaller than 2^21 (~2000000):
* 0 - 127 are encoded in one byte
* 128 - 16384 are encoded in two bytes | Fix a typo in the comment for variable length encoding
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
f09c475a909e629c75734781a57b66e4031735bb | diff --git a/generators/i18n_locale/lib/cldr.rb b/generators/i18n_locale/lib/cldr.rb
index <HASH>..<HASH> 100644
--- a/generators/i18n_locale/lib/cldr.rb
+++ b/generators/i18n_locale/lib/cldr.rb
@@ -98,9 +98,9 @@ module I18nLocaleGeneratorModule
private
def summaries
- @summaries = [load_cldr_data(@locale_name.tr('-', '_'))]
+ s = [load_cldr_data(@locale_name.tr('-', '_'))]
if @locale_name =~ /^[a-zA-Z]{2}[-_][a-zA-Z]{2}$/
- @summaries << load_cldr_data(@locale_name.to(1))
+ s << load_cldr_data(@locale_name.to(1))
end
end
memoize :summaries | Fix the variant name to let memoize work | amatsuda_i18n_generators | train | rb |
aaa0492e49498ab5ceb6c83ffdaa68115c43748c | diff --git a/closure/goog/module/loader.js b/closure/goog/module/loader.js
index <HASH>..<HASH> 100644
--- a/closure/goog/module/loader.js
+++ b/closure/goog/module/loader.js
@@ -147,7 +147,7 @@ goog.module.Loader.prototype.init = function(baseUrl, opt_urlFunction) {
goog.exportSymbol(goog.module.Loader.LOAD_CALLBACK,
goog.module.Loader.loaderEval_);
- this.urlBase_ = baseUrl.replace('.js', '');
+ this.urlBase_ = baseUrl.replace(/\.js$/, '');
if (opt_urlFunction) {
this.getModuleUrl_ = opt_urlFunction;
}
@@ -185,7 +185,7 @@ goog.module.Loader.prototype.require = function(module, symbol, callback) {
pending[module] = [[symbol, callback]]; // Yes, really [[ ]].
// Defer loading to initialization if Loader is not yet
// initialized, otherwise load the module.
- if (this.urlBase_) {
+ if (goog.isString(this.urlBase_)) {
this.load_(module);
} else {
this.pendingBeforeInit_.push(module); | Fix small bugs in handling of module base URLs.
- Remove ".js" as a suffix of the base URL, not as a substring.
- Allow applications to set the base URL to an empty string.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
0986f327a1d58dc63b3aee66944d52aa9186ce06 | diff --git a/src/python/dxpy/scripts/dx_build_report_html.py b/src/python/dxpy/scripts/dx_build_report_html.py
index <HASH>..<HASH> 100755
--- a/src/python/dxpy/scripts/dx_build_report_html.py
+++ b/src/python/dxpy/scripts/dx_build_report_html.py
@@ -40,7 +40,7 @@ def _image_to_data(img):
Does the work of encoding an image into Base64
"""
# If the image is already encoded in Base64, we have nothing to do here
- if not img["src"] or re.match("data:", img["src"]):
+ if not "src" in img or re.match("data:", img["src"]):
return
elif re.match("http[s]://", img["src"]):
img_data = _load_url(img["src"]).read() | Fixed error in case where img tag has no src attribute | dnanexus_dx-toolkit | train | py |
e5098bf4af208f2a90408e1d450d59632010a485 | diff --git a/src/Check/Drush/UpdateDBStatus.php b/src/Check/Drush/UpdateDBStatus.php
index <HASH>..<HASH> 100644
--- a/src/Check/Drush/UpdateDBStatus.php
+++ b/src/Check/Drush/UpdateDBStatus.php
@@ -27,7 +27,7 @@ class UpdateDBStatus extends Check {
}
if (count($output) === 1) {
$output = reset($output);
- if (strpos($output, 'No database updates required') === 0) {
+ if (strpos($output, 'No database updates required') === 0 || empty($output)) {
return TRUE;
}
} | Fix updates appearing in StdErr when there are none. | drutiny_drutiny | train | php |
440670577ca1d65689525fb040a7867784d23c15 | diff --git a/yarl/__init__.py b/yarl/__init__.py
index <HASH>..<HASH> 100644
--- a/yarl/__init__.py
+++ b/yarl/__init__.py
@@ -1,5 +1,5 @@
from ._url import URL, cache_clear, cache_configure, cache_info
-__version__ = "1.5.1"
+__version__ = "1.6.0a0"
__all__ = ("URL", "cache_clear", "cache_configure", "cache_info") | Mark again as <I>a0 | aio-libs_yarl | train | py |
db0e25480a969520551c011b772a8a0310cc0b02 | diff --git a/lib/et-orbi.rb b/lib/et-orbi.rb
index <HASH>..<HASH> 100644
--- a/lib/et-orbi.rb
+++ b/lib/et-orbi.rb
@@ -359,9 +359,6 @@ module EtOrbi
def utc_offset
- #@zone.period_for_utc(utc).utc_offset
- #@zone.period_for_utc(utc).utc_total_offset
- #@zone.period_for_utc(utc).std_offset
@zone.period_for_utc(utc).utc_offset
end
@@ -374,9 +371,11 @@ module EtOrbi
def ==(o)
- o.is_a?(EoTime) && o.seconds == @seconds && o.zone == @zone
+ o.is_a?(EoTime) &&
+ o.seconds == @seconds &&
+ (o.zone == @zone || o.zone.current_period == @zone.current_period)
end
- #alias eq? == # FIXME see Object#== (ri)
+ #alias eql? == # FIXME see Object#== (ri)
def >(o); @seconds > _to_f(o); end
def >=(o); @seconds >= _to_f(o); end | Loosen EoTime equality for UTC == Etc/UTC, gh-5 | floraison_et-orbi | train | rb |
ca405c957e2ee375ad03e11a3344e2fed7f38211 | diff --git a/platform/html5/html.js b/platform/html5/html.js
index <HASH>..<HASH> 100644
--- a/platform/html5/html.js
+++ b/platform/html5/html.js
@@ -509,8 +509,8 @@ exports.init = function(ctx) {
ctx.fullscreen = state
}
- new Array('webkitfullscreenchange', 'mozfullscreenchange', 'fullscreenchange').forEach(function(name) {
- div.on(name, onFullscreenChanged)
+ new Array('webkitfullscreenchange', 'mozfullscreenchange', 'fullscreenchange', 'MSFullscreenChange').forEach(function(name) {
+ div.on(name, onFullscreenChanged, true)
})
win.on('keydown', function(event) { | added MSFullscreenChange event | pureqml_qmlcore | train | js |
d18bdbc708951933643147b434a734a7b778c279 | diff --git a/bunq/sdk/context.py b/bunq/sdk/context.py
index <HASH>..<HASH> 100644
--- a/bunq/sdk/context.py
+++ b/bunq/sdk/context.py
@@ -428,8 +428,15 @@ class UserContext(object):
self._user_company = None
self._primary_monetary_account = None
- user_object = endpoint.User.list().value[0].get_referenced_object()
- self._set_user(user_object)
+ self._set_user(self.__get_user_object())
+
+ @staticmethod
+ def __get_user_object():
+ """
+ :rtype: core.BunqModel
+ """
+
+ return endpoint.User.list().value[0].get_referenced_object()
def _set_user(self, user):
if isinstance(user, endpoint.UserPerson):
@@ -478,6 +485,10 @@ class UserContext(object):
return self._user_company is not None and self._user_person is not None
+ def refresh_user_context(self):
+ self._set_user(self.__get_user_object())
+ self.init_main_monetary_account()
+
@property
def user_company(self):
""" | Added method to refresh user context data. (bunq/sdk_python#<I>) | bunq_sdk_python | train | py |
e5160af495f6c58b8315736bbaa2e57ea7e78c51 | diff --git a/src/shader.js b/src/shader.js
index <HASH>..<HASH> 100644
--- a/src/shader.js
+++ b/src/shader.js
@@ -151,7 +151,7 @@ Shader.prototype.uniforms = function(uniforms) {
Shader.prototype.draw = function(mesh, mode) {
this.drawBuffers(mesh.vertexBuffers,
mesh.indexBuffers[mode == gl.LINES ? 'lines' : 'triangles'],
- mode || gl.TRIANGLES);
+ arguments.length < 2 ? gl.TRIANGLES : mode);
};
// ### .drawBuffers(vertexBuffers, indexBuffer, mode) | change to allow drawing with gl.POINTS | evanw_lightgl.js | train | js |
3db8d44f419954c756694e282800f9b4a0f6d0f2 | diff --git a/spec/integration/admin/snippets_integration_spec.rb b/spec/integration/admin/snippets_integration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/admin/snippets_integration_spec.rb
+++ b/spec/integration/admin/snippets_integration_spec.rb
@@ -17,6 +17,14 @@ describe 'Snippets' do
submit_form :snippet => {:name => 'Mine', :content => 'Me Snippet'}
end.should change(Snippet, :count).by(1)
end
+
+ it "should display form errors" do
+ navigate_to '/admin/snippets/new'
+ lambda do
+ submit_form :snippet => {:content => 'Me snippet'}
+ end.should_not change(Snippet, :count)
+ response.should have_tag("#error")
+ end
it "should redisplay the edit screen on 'Save & Continue Editing'" do
navigate_to '/admin/snippets/new' | Add case of invalid form to snippets integration spec. | radiant_radiant | train | rb |
3c5476f411a21d82d31ce08685a2a119db4f6c7e | diff --git a/test/unit/baseControllerSpec.js b/test/unit/baseControllerSpec.js
index <HASH>..<HASH> 100644
--- a/test/unit/baseControllerSpec.js
+++ b/test/unit/baseControllerSpec.js
@@ -800,7 +800,6 @@ describe('"BaseCtrl"', function () {
$scope.delete();
$httpBackend.flush();
expect($dialog.messageBox).toHaveBeenCalled();
- dump($scope.delete);
}); | moved controller to allow unit tests to test controller methods | forms-angular_forms-angular | train | js |
9c0d9ae532c0801f4abc1732b53c44244f04a1ab | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,6 +7,8 @@ try:
except ImportError:
pass
+import jicimagelib
+
# Define the test runner.
# See also:
# http://fgimian.github.io/blog/2014/04/27/running-nose-tests-with-plugins-using-the-python-setuptools-test-command/ | Fixed setup.py; re-intorduced accidentally removed import statement. | JIC-CSB_jicimagelib | train | py |
7a0278f3c982dc47f09eb436a3b3589761d63d0f | diff --git a/examples/lstm_chime.py b/examples/lstm_chime.py
index <HASH>..<HASH> 100644
--- a/examples/lstm_chime.py
+++ b/examples/lstm_chime.py
@@ -52,7 +52,7 @@ def batches(dataset):
e = theanets.Experiment(
theanets.recurrent.Classifier,
- layers=(39, ('lstm', 100), ('lstm', 200), ('lstm', 78), 51),
+ layers=(39, ('lstm', 156), ('lstm', 300), ('lstm', 102), 51),
recurrent_error_start=0,
output_activation='softmax',
hidden_activation='tanh', | Update LSTM example to match benchmark configuration. | lmjohns3_theanets | train | py |
760fc58a75a7d97a097b27c9df2a2d5cabcc8ec9 | diff --git a/lib/oid.js b/lib/oid.js
index <HASH>..<HASH> 100644
--- a/lib/oid.js
+++ b/lib/oid.js
@@ -1,4 +1,5 @@
-var git = require('../');
+var git = require('../'),
+ success = require('./utilities').success;
/**
* Convenience Oid constructor.
@@ -9,6 +10,8 @@ var git = require('../');
var Oid = function(rawOid) {
if(rawOid instanceof git.raw.Oid) {
this.rawOid = rawOid;
+ } else {
+ this.rawOid = new git.raw.Oid();
}
};
@@ -33,7 +36,7 @@ Oid.prototype.fromString = function(sha, callback) {
*/
var self = this;
self.rawOid.fromString(sha, function(error, rawOid) {
- if (success(error, rawOid)) {
+ if (success(error, callback)) {
self.rawOid = rawOid;
callback(null, self);
} | Fixed minor bugs in oid | nodegit_nodegit | train | js |
3436fbe8a6fad4c42034fba78dcfe88e85ff9e4b | diff --git a/tools/kit_tools/build_kits.py b/tools/kit_tools/build_kits.py
index <HASH>..<HASH> 100755
--- a/tools/kit_tools/build_kits.py
+++ b/tools/kit_tools/build_kits.py
@@ -58,7 +58,7 @@ def buildCommunity():
run("pwd")
run("git status")
run("git describe --dirty")
- run("ant clean default dist")
+ run("ant -Djmemcheck=NO_MEMCHECK clean default dist")
################################################
# BUILD THE ENTERPRISE VERSION
@@ -69,7 +69,7 @@ def buildPro():
run("pwd")
run("git status")
run("git describe --dirty")
- run("VOLTCORE=../voltdb ant -f mmt.xml -Dallowreplication=true -Dlicensedays=%d clean dist.pro" % defaultlicensedays)
+ run("VOLTCORE=../voltdb ant -f mmt.xml -Djmemcheck=NO_MEMCHECK -Dallowreplication=true -Dlicensedays=%d clean dist.pro" % defaultlicensedays)
################################################
# MAKE AN ENTERPRISE TRIAL LICENSE | ENG-<I>. Turn off java memcheck on volt0 kit builds. | VoltDB_voltdb | train | py |
ddbc6e91619bd64c920fc92dcdd84defbe15e686 | diff --git a/src/I18n.php b/src/I18n.php
index <HASH>..<HASH> 100644
--- a/src/I18n.php
+++ b/src/I18n.php
@@ -63,7 +63,9 @@ class I18n extends Adapter
}
if ($this->detectClientLocale) {
$this->_setLocale($this->request->getBestLanguage());
+ return;
}
+ $this->loadLocale($this->currentLocale = $this->defaultLocale);
}
protected function _setLocale($locale) | fix(i<I>n): restore default locale if no client locale matched | phwoolcon_phwoolcon | train | php |
41e682d72498c3888e23191c8a0c9ff6a1d458a7 | diff --git a/code/libraries/koowa/components/com_koowa/user/provider.php b/code/libraries/koowa/components/com_koowa/user/provider.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/components/com_koowa/user/provider.php
+++ b/code/libraries/koowa/components/com_koowa/user/provider.php
@@ -78,6 +78,8 @@ final class ComKoowaUserProvider extends KUserProvider
'username' => $user->username,
'password' => $user->password,
'salt' => '',
+ 'groups' => JAccess::getGroupsByUser($user->id),
+ 'roles' => JAccess::getAuthorisedViewLevels($user->id),
'authentic' => !$user->guest,
'enabled' => !$user->block,
'expired' => (bool) $user->activation, | Set groups and roles when fetching users. | joomlatools_joomlatools-framework | train | php |
b84c7f4ce3712d1bdc35bcf727576ec6c1e187c0 | diff --git a/Doctrine/adodb-hack/adodb.inc.php b/Doctrine/adodb-hack/adodb.inc.php
index <HASH>..<HASH> 100644
--- a/Doctrine/adodb-hack/adodb.inc.php
+++ b/Doctrine/adodb-hack/adodb.inc.php
@@ -42,9 +42,9 @@ function NewDataDictionary(PDO $conn) {
return $dict;
}
class ADOFieldObject {
- var $name = '';
- var $max_length=0;
- var $type="";
+ public $name = '';
+ public $max_length=0;
+ public $type="";
} | pookey: standards complience change | doctrine_annotations | train | php |
c78ecd90d22c76e38a0a0ef54b09aa0157ed90bb | diff --git a/openquake/logs.py b/openquake/logs.py
index <HASH>..<HASH> 100644
--- a/openquake/logs.py
+++ b/openquake/logs.py
@@ -95,7 +95,9 @@ def init_logs_stdout(level):
hdlr.setFormatter(logging.Formatter(logging.BASIC_FORMAT, None))
LOG.addHandler(hdlr)
- logging.getLogger("amqplib").setLevel(logging.ERROR)
+ amqp_log = logging.getLogger("amqplib")
+ amqp_log.setLevel(logging.ERROR)
+ amqp_log.propagate = False
LOG.setLevel(logging_level)
RISK_LOG.setLevel(logging_level) | Avoid infinite recursion by telling amqplib not to use the AMQP log handler.
Former-commit-id: <I>cdb<I>b<I>d5f<I>cdec<I>ff6f<I>a | gem_oq-engine | train | py |
acd522ea41b707926967fb539fa52d5906dedd24 | diff --git a/src/donatj/Ini/Builder.php b/src/donatj/Ini/Builder.php
index <HASH>..<HASH> 100644
--- a/src/donatj/Ini/Builder.php
+++ b/src/donatj/Ini/Builder.php
@@ -43,18 +43,14 @@ class Builder {
$position = 0;
foreach( $data as $key => $val ) {
-
if( is_array($val) ) {
-
if( $depth == 0 ) {
- echo "[{$key}]\n";
+ $output .= "[{$key}]\n";
$output .= $this->build($val, $depth + 1);
} else {
$output .= $this->build($val, $depth + 1, $key);
}
-
} else {
-
$valStr = $this->valEscape($val);
if( $prevKey !== false ) {
@@ -73,7 +69,6 @@ class Builder {
$output .= "{$key} = {$valStr}\n";
}
}
-
}
return $output; | Fixed an issue with section names coming out in the wrong order | donatj_PhpIniBuilder | train | php |
459f796693df74ba6f159bb82b61a6cec40e831e | diff --git a/build/yield_handler.js b/build/yield_handler.js
index <HASH>..<HASH> 100644
--- a/build/yield_handler.js
+++ b/build/yield_handler.js
@@ -271,10 +271,12 @@ function streamToPromise( stream ) {
} else {
return new Promise( function( resolve, reject ) {
function onFinish() {
+ cleanup();
resolve.apply( undefined, arguments );
}
function onError( err ) {
+ cleanup();
reject( err );
}
diff --git a/src/yield_handler.js b/src/yield_handler.js
index <HASH>..<HASH> 100644
--- a/src/yield_handler.js
+++ b/src/yield_handler.js
@@ -237,10 +237,12 @@ function streamToPromise( stream ) {
} else {
return new Promise( ( resolve, reject ) => {
function onFinish( ...args ) {
+ cleanup();
resolve( ...args );
}
function onError( err ) {
+ cleanup();
reject( err );
} | src: Actually cleanup listeners on completion for writable streams. | novacrazy_bluebird-co | train | js,js |
7c97318ce660e289a22ea9c111766374bc0ae075 | diff --git a/code/forms/MemberProfileValidator.php b/code/forms/MemberProfileValidator.php
index <HASH>..<HASH> 100644
--- a/code/forms/MemberProfileValidator.php
+++ b/code/forms/MemberProfileValidator.php
@@ -67,7 +67,7 @@ class MemberProfileValidator extends RequiredFields {
}
// Create a dummy member as this is required for custom password validators
- if($data['Password'] !== "") {
+ if(isset($data['Password']) && $data['Password'] !== "") {
if(is_null($member)) $member = Member::create();
if($validator = $member::password_validator()) { | fix(MemberProfileValidator): Fix bug where Password still has validation, even though its set 'Hidden' | symbiote_silverstripe-memberprofiles | train | php |
c18050559808c75ab23a8dd76000fe90cbf8ed3a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,8 +7,6 @@ import subprocess
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py
-from pyguetzli.version import VERSION
-
class CustomBuildPy(build_py):
@@ -26,7 +24,7 @@ elif os.path.isfile("README.md"):
setup(
name="pyguetzli",
- version=VERSION,
+ version="0.0.0",
description="Python bindings for Google's Guetzli, a JPEG encoder that optimises JPEG compression",
url="https://github.com/wanadev/pyguetzli",
license="Apache-2.0", | setup.py: do not read version from package | wanadev_pyguetzli | train | py |
7d10b27b6ff805a596d9b9d122565c4155fb9a01 | diff --git a/AGEpy/AGEpy.py b/AGEpy/AGEpy.py
index <HASH>..<HASH> 100644
--- a/AGEpy/AGEpy.py
+++ b/AGEpy/AGEpy.py
@@ -1288,7 +1288,8 @@ def CellPlot(df, output_file=None, gene_expression="log2FC", figure_title="CellP
# f=maxFC
#if float(f) < minFC:
# f=minFC
- ax1.barh(pos, w, left=p, color=cmap(norm(float(f))), edgecolor='black')
+ #ax1.barh(pos, w, left=p, color=cmap(norm(float(f))), edgecolor='black')
+ ax1.barh(pos, w, left=p, color=cmap(norm(float(f))), edgecolor=cmap(norm(float(f))))
p=p+w
if pvalCol:
if df.ix[i,pvalCol] < 0.05:
@@ -1423,7 +1424,7 @@ def SymPlot(df,output_file=None,figure_title="SymPlot",pvalCol="elimFisher"):
p=float(maxAn-ann)/2
else:
p=0
- ax2.barh(pos, ann, left=p, color=cmap(norm(float(f))),edgecolor='black')#
+ ax2.barh(pos, ann, left=p, color=cmap(norm(float(f))),edgecolor=cmap(norm(float(f))))#
fcs=df.ix[i,'log2fc'].split(",")
fcs=pd.DataFrame(fcs) | cellplots: changed inner boxes to heatmap color | mpg-age-bioinformatics_AGEpy | train | py |
37bbedd7ab681b3c7a7e13f5356637bb0375a8ed | diff --git a/prettycron.js b/prettycron.js
index <HASH>..<HASH> 100644
--- a/prettycron.js
+++ b/prettycron.js
@@ -175,7 +175,7 @@ if ((!moment || !later) && (typeof require !== 'undefined')) {
var getNext = function(cronspec, sixth) {
var schedule = cronParser(cronspec, sixth);
return moment(
- later.schedule(schedule).next(60)
+ later.schedule(schedule).next()
).calendar();
}; | Get only next date in schedule to avoid 'Invalid date' bug from last commit | azza-bazoo_prettycron | train | js |
4da4dfe438cbec3959a3bcdf6c8a206ee7753142 | diff --git a/src/pythonfinder/pythonfinder.py b/src/pythonfinder/pythonfinder.py
index <HASH>..<HASH> 100644
--- a/src/pythonfinder/pythonfinder.py
+++ b/src/pythonfinder/pythonfinder.py
@@ -317,4 +317,4 @@ class Finder(object):
resolved_path = path.path.absolute()
if not path_map.get(resolved_path.as_posix()):
path_map[resolved_path.as_posix()] = path
- return list(path_map.values())
+ return path_list | Return a list that preserves order | sarugaku_pythonfinder | train | py |
da6caf896fe99203301e3852d86bdfbd09517587 | diff --git a/src/pycrunchbase/resource/relationship.py b/src/pycrunchbase/resource/relationship.py
index <HASH>..<HASH> 100644
--- a/src/pycrunchbase/resource/relationship.py
+++ b/src/pycrunchbase/resource/relationship.py
@@ -46,8 +46,15 @@ class Relationship(object):
self.items = [PageItem.build(item) for item in data.get('items')]
def buildPageItem(self, item):
+ # could be a list, e.g.
+ # the investments rs of a funding round has investors rs
+ if isinstance(item, list):
+ self.items = [PageItem.build(i) for i in item]
+ return
+
if not item or not hasattr(item, 'get'):
return NonePageItemSingleton
+
node = PageItem.build(item)
self.items = [node]
for prop in node.KNOWN_PROPERTIES: | Handle nested relationships when building PageItem | ngzhian_pycrunchbase | train | py |
d83c652b7252d0adc2ee05c5ac1795de9a79cfcb | diff --git a/tests/IterableTest.php b/tests/IterableTest.php
index <HASH>..<HASH> 100755
--- a/tests/IterableTest.php
+++ b/tests/IterableTest.php
@@ -123,13 +123,29 @@ class IterableTest extends CollectionsTestCase
3
], $this->coll->toArray());
- $coll3 = new Dictionary(['key1' => 'value1', 'key2' => 'wrongValue']);
- $coll4 = new Dictionary(['key2' => 'value2']);
+ $coll3 = new Dictionary([
+ 'key1' => 'value1',
+ 'key2' => 'wrongValue',
+ 'key3' => [
+ 'key31' => 'value31',
+ ]
+ ]);
+
+ $coll4 = new Dictionary([
+ 'key2' => 'value2',
+ 'key3' => [
+ 'key32' => 'value32'
+ ]
+ ]);
$coll3->concat($coll4);
$this->assertEquals([
'key1' => 'value1',
- 'key2' => 'value2'
+ 'key2' => 'value2',
+ 'key3' => [
+ 'key31' => 'value31',
+ 'key32' => 'value32'
+ ]
], $coll3->toArray());
}
-}
\ No newline at end of file
+} | Added more complex test for concat | italolelis_collections | train | php |
ce5247ce37bfe3e1dc45f47e966e7800d10f48ef | diff --git a/response_writer.go b/response_writer.go
index <HASH>..<HASH> 100644
--- a/response_writer.go
+++ b/response_writer.go
@@ -53,7 +53,6 @@ func (rw *responseWriter) Write(b []byte) (int, error) {
if !rw.Written() {
// The status will be StatusOK if WriteHeader has not been called yet
rw.WriteHeader(http.StatusOK)
- rw.wroteHeader = true
}
size, err := rw.ResponseWriter.Write(b)
rw.size += size | Remove redundant set of `wroteHeader`
Already set by rw.WriteHeader | urfave_negroni | train | go |
4632aa6cb7862387053fb12d5b5d0f509f7b0045 | diff --git a/fedora_messaging/twisted/protocol.py b/fedora_messaging/twisted/protocol.py
index <HASH>..<HASH> 100644
--- a/fedora_messaging/twisted/protocol.py
+++ b/fedora_messaging/twisted/protocol.py
@@ -537,19 +537,22 @@ class FedoraMessagingProtocolV2(TwistedProtocolConnection):
user does not have permissions to create the object.
"""
channel = yield self._allocate_channel()
+ result_queues = []
try:
for queue in queues:
args = queue.copy()
args.setdefault("passive", config.conf["passive_declares"])
try:
- yield channel.queue_declare(**args)
+ frame = yield channel.queue_declare(**args)
except pika.exceptions.ChannelClosed as e:
raise BadDeclaration("queue", args, e)
+ result_queues.append(frame.method.queue)
finally:
try:
channel.close()
except pika.exceptions.AMQPError:
pass # pika doesn't handle repeated closes gracefully
+ defer.returnValue(result_queues)
@defer.inlineCallbacks
def bind_queues(self, bindings): | Have `declare_queues()` return the queue names from the server response | fedora-infra_fedora-messaging | train | py |
058285e0b9d19327f3d50220f2053195630b5cea | diff --git a/ReactNativeClient/lib/registry.js b/ReactNativeClient/lib/registry.js
index <HASH>..<HASH> 100644
--- a/ReactNativeClient/lib/registry.js
+++ b/ReactNativeClient/lib/registry.js
@@ -44,7 +44,7 @@ reg.syncTarget = (syncTargetId = null) => {
}
reg.scheduleSync = async (delay = null) => {
- if (delay === null) delay = 1000 * 30;
+ if (delay === null) delay = 1000 * 10;
let promiseResolve = null;
const promise = new Promise((resolve, reject) => { | All: Made scheduled sync delay slightly shorter | laurent22_joplin | train | js |
c45a49f22dfe28b396b0b7d619b3ac66f0e33546 | diff --git a/flask_rdf/flask_decorator.py b/flask_rdf/flask_decorator.py
index <HASH>..<HASH> 100644
--- a/flask_rdf/flask_decorator.py
+++ b/flask_rdf/flask_decorator.py
@@ -40,5 +40,5 @@ def flask_rdf(view):
@wraps(view)
def decorated(*args, **kwargs):
output = view(*args, **kwargs)
- return flask_format_output(output, request.headers['Accept'])
+ return output_flask(output, request.headers['Accept'])
return decorated
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ requirements = open('requirements.txt').read().split('\n')
test_requirements = open('requirements.test.txt').read().split('\n')
setup(name='flask_rdf',
- version='0.1.2',
+ version='0.1.3',
description='Flask decorator to output RDF using content negotiation',
author='Walter Huf',
url='https://github.com/hufman/flask_rdf', | Makes the flask decorator actually work | hufman_flask_rdf | train | py,py |
68e2832e2a6f43ecb2df69e9c1d95aa88dd44b18 | diff --git a/wicken/dogma.py b/wicken/dogma.py
index <HASH>..<HASH> 100755
--- a/wicken/dogma.py
+++ b/wicken/dogma.py
@@ -109,7 +109,7 @@ class MetaReligion(type):
# store old name
teaching['original_name'] = origbelief
- doc = teaching['desc']
+ doc = teaching.get('desc', '')
teaching = teaching['query']
else:
doc = cls._create_doc(belief, teaching) | Safe access to desc (may not be defined) | ioos_wicken | train | py |
5d512400429fde7e45cd8f59f0daff6a11fd94f3 | diff --git a/tests/__init__.py b/tests/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,6 +1,8 @@
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
+import imp
+import os
import unittest
@@ -29,6 +31,12 @@ def test_classes():
A list of unittest.TestCase classes
"""
+ # Make sure the module is loaded from this source folder
+ module_name = 'ocspbuilder'
+ src_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
+ module_info = imp.find_module(module_name, [src_dir])
+ imp.load_module(module_name, *module_info)
+
from .test_ocsp_response_builder import OCSPResponseBuilderTests
from .test_ocsp_request_builder import OCSPRequestBuilderTests | Ensure module is being loaded from source dir when tests are imported elsewhere | wbond_ocspbuilder | train | py |
0b18ad43e6827f1fbeb3df304e314dd3f915786e | diff --git a/torment/fixtures/__init__.py b/torment/fixtures/__init__.py
index <HASH>..<HASH> 100644
--- a/torment/fixtures/__init__.py
+++ b/torment/fixtures/__init__.py
@@ -238,6 +238,9 @@ class Fixture(object):
'''
+ if hasattr(self, '_last_resolver_exception'):
+ logger.warning('last exception from %s.%s:', self.__class__.__name__, self._last_resolver_exception[0], exc_info = self._last_resolver_exception[1])
+
self.setup()
self.run()
self.check()
@@ -419,6 +422,8 @@ def _resolve_functions(functions: Dict[str, Callable[[Any], Any]], fixture: Fixt
logger.warning('unprocessed Fixture properties: %s', ','.join(functions.keys()))
logger.warning('last exception from %s.%s:', fixture.name, last_function, exc_info = exc_info)
+ setattr(fixture, '_last_resolver_exception', ( last_function, exc_info, ))
+
for name, function in copy.copy(functions).items():
setattr(fixture, name, function) | add later logging of function exceptions in fixture
When debugging possibly misbehaving fixtures, the logging for function
resolution occurs before the test case begins (it occurs during module
load). This allows us to again log it during the test run so it's part
of the debugging for that particular test case.
* fixes #<I> | racker_torment | train | py |
935137af0d7c74fe04a94ef197f6ec0d3e22c97f | diff --git a/tests/Go/Functional/BaseFunctionalTest.php b/tests/Go/Functional/BaseFunctionalTest.php
index <HASH>..<HASH> 100644
--- a/tests/Go/Functional/BaseFunctionalTest.php
+++ b/tests/Go/Functional/BaseFunctionalTest.php
@@ -11,6 +11,7 @@
namespace Go\Functional;
use Go\Core\AspectContainer;
+use Go\Instrument\PathResolver;
use Go\PhpUnit\ClassIsNotWovenConstraint;
use Go\PhpUnit\ClassWovenConstraint;
use Go\PhpUnit\ClassAdvisorIdentifier;
@@ -57,9 +58,10 @@ abstract class BaseFunctionalTest extends TestCase
protected function clearCache()
{
$filesystem = new Filesystem();
-
- if ($filesystem->exists($this->configuration['cacheDir'])) {
- $filesystem->remove($this->configuration['cacheDir']);
+ // We need to normalize path to prevent Windows 260-length filename trouble
+ $absoluteCacheDir = PathResolver::realpath($this->configuration['cacheDir']);
+ if ($filesystem->exists($absoluteCacheDir)) {
+ $filesystem->remove($absoluteCacheDir);
}
} | Normalize path to prevent error with long filename on Windows | goaop_framework | train | php |
a27d2d74f25110e4ebd8d44dc7fd1f44c103ca9e | diff --git a/railties/test/generators/argv_scrubber_test.rb b/railties/test/generators/argv_scrubber_test.rb
index <HASH>..<HASH> 100644
--- a/railties/test/generators/argv_scrubber_test.rb
+++ b/railties/test/generators/argv_scrubber_test.rb
@@ -5,7 +5,11 @@ require 'tempfile'
module Rails
module Generators
- class ARGVScrubberTest < ActiveSupport::TestCase
+ class ARGVScrubberTest < ActiveSupport::TestCase # :nodoc:
+ # Future people who read this... These tests are just to surround the
+ # current behavior of the ARGVScrubber, they do not mean that the class
+ # *must* act this way, I just want to prevent regressions.
+
def test_version
['-v', '--version'].each do |str|
scrubber = ARGVScrubber.new [str] | add a comment to people of the future | rails_rails | train | rb |
67541ae46b79b0ec12a8874636d8ff3f9f8fc2a2 | diff --git a/lib/utils/config.js b/lib/utils/config.js
index <HASH>..<HASH> 100644
--- a/lib/utils/config.js
+++ b/lib/utils/config.js
@@ -71,7 +71,12 @@ function hasSchema(obj, name){
function validateOperation(schema, job) {
var config = convict(schema);
- config.load(job).validate(/*{strict: true}*/);
+ config.load(job);
+
+ if( _context.cluster.isMaster) {
+ config.validate(/*{strict: true}*/);
+ }
+
return config.getProperties();
} | job validation errors throw in master only resolves #<I> | terascope_teraslice | train | js |
7aaec12475100fed9a0d66051f189c858e919b9c | diff --git a/src/Core/DataMapper.php b/src/Core/DataMapper.php
index <HASH>..<HASH> 100644
--- a/src/Core/DataMapper.php
+++ b/src/Core/DataMapper.php
@@ -198,7 +198,7 @@ class DataMapper implements IDataMapper
$getters = $this->mapper->getGetters();
if (isset($getters[$name])) {
- $value = $getters[$name]($value);
+ $value = $getters[$name]($value, $this);
}
return $this->columns[$name] = $value;
@@ -226,7 +226,7 @@ class DataMapper implements IDataMapper
$setters = $this->mapper->getSetters();
if (isset($setters[$name])) {
- $value = $setters[$name]($value);
+ $value = $setters[$name]($value, $this);
}
if (isset($casts[$name])) { | Added IDataMapper as an argument to setter & getter callbacks | opis_orm | train | php |
0d57849b5fd90903e6c2c69b4b7be7fa804df01a | diff --git a/spyderlib/widgets/editor.py b/spyderlib/widgets/editor.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/editor.py
+++ b/spyderlib/widgets/editor.py
@@ -320,8 +320,11 @@ class FileInfo(QObject):
self.filename)
if textlist:
completion_text = re.split(r"[^a-zA-Z0-9_]", text)[-1]
- self.editor.show_completion_list(textlist, completion_text,
- automatic)
+ if text.lstrip().startswith('#') and text.endswith('.'):
+ return
+ else:
+ self.editor.show_completion_list(textlist, completion_text,
+ automatic)
return
def trigger_calltip(self, position, auto=True): | Editor: Don't trigger code completion on comments if text ends with a dot
If automatic code completion is enabled, then writing comments was quite
unpleasant because the widget appeared on every dot. | spyder-ide_spyder | train | py |
7fd54e42cf6c50d96f8389058336b6c7e3242994 | diff --git a/lib/m.rb b/lib/m.rb
index <HASH>..<HASH> 100644
--- a/lib/m.rb
+++ b/lib/m.rb
@@ -25,9 +25,7 @@
# gem.add_development_dependency "m", "~> 1.3.0"
# end
#
-#`m` is Ruby 1.9+ only. Sorry, but `method_source`, `sourcify`, and `ruby_parser`
-#all have trouble with 1.8 so I'm giving up and only supporting 1.9 for now.
-#Patches are welcome!
+#`m` works on Ruby 1.9+ only.
#
### Usage
# | m works on Ruby <I> only. Closes #<I> | qrush_m | train | rb |
0ae44cc4320c9d6d70fc3a72a1ebb936d63851ef | diff --git a/src/main/java/com/cloudbees/jenkins/support/api/Component.java b/src/main/java/com/cloudbees/jenkins/support/api/Component.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/cloudbees/jenkins/support/api/Component.java
+++ b/src/main/java/com/cloudbees/jenkins/support/api/Component.java
@@ -37,6 +37,10 @@ import java.util.Set;
/**
* Represents a component of a support bundle.
*
+ * <p>
+ * This is the unit of user consent; when creating a support bundle, the user would enable/disable
+ * individual components.
+ *
* @author Stephen Connolly
*/
public abstract class Component extends ExtensionPoint { | Typo fix and rewording | jenkinsci_support-core-plugin | train | java |
f7174150c99062608dba8f71a4d16e6bf8a5186f | diff --git a/lib/handlebars_assets/engine.rb b/lib/handlebars_assets/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/handlebars_assets/engine.rb
+++ b/lib/handlebars_assets/engine.rb
@@ -2,9 +2,10 @@ module HandlebarsAssets
# NOTE: must be an engine because we are including assets in the gem
class Engine < ::Rails::Engine
initializer "handlebars_assets.assets.register", :group => :all do |app|
- ::HandlebarsAssets::register_extensions(app.assets)
+ sprockets_env = app.assets || Sprockets
+ ::HandlebarsAssets::register_extensions(sprockets_env)
if Gem::Version.new(Sprockets::VERSION) < Gem::Version.new('3')
- ::HandlebarsAssets::add_to_asset_versioning(app.assets)
+ ::HandlebarsAssets::add_to_asset_versioning(sprockets_env)
end
end
end | Handle when asset compilation is off in rails. | leshill_handlebars_assets | train | rb |
5a9a4e761869474bbaff14e0ae045676985c3e21 | diff --git a/indra/sources/eidos/processor.py b/indra/sources/eidos/processor.py
index <HASH>..<HASH> 100644
--- a/indra/sources/eidos/processor.py
+++ b/indra/sources/eidos/processor.py
@@ -289,12 +289,15 @@ class EidosProcessor(object):
return None
entries = []
- for entry in grounding.get('values', []):
- ont_concept = entry.get('ontologyConcept')
- value = entry.get('value')
- if ont_concept is None or value is None:
- continue
- entries.append((ont_concept, value))
+ values = grounding.get('values', [])
+ # Values could still have been a None entry here
+ if values:
+ for entry in values:
+ ont_concept = entry.get('ontologyConcept')
+ value = entry.get('value')
+ if ont_concept is None or value is None:
+ continue
+ entries.append((ont_concept, value))
return entries
# Save raw text and Eidos scored groundings as db_refs | Handle a None entry in processor | sorgerlab_indra | train | py |
8701d3a9444cf161e56fdeda4dd9073569d7e28c | diff --git a/featureflow/__init__.py b/featureflow/__init__.py
index <HASH>..<HASH> 100644
--- a/featureflow/__init__.py
+++ b/featureflow/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '2.12.0'
+__version__ = '2.12.1'
from model import BaseModel, ModelExistsError
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ import subprocess
try:
long_description = subprocess.check_output(
'pandoc --to rst README.md', shell=True)
-except(IOError, ImportError):
+except(IOError, ImportError, subprocess.CalledProcessError):
long_description = open('README.md').read()
with open('featureflow/__init__.py', 'r') as fd: | New release with non-buggy pandoc usage | JohnVinyard_featureflow | train | py,py |
cf1bfdfb619f9ed9b59de1cf1bef9779fbea7f10 | diff --git a/model/model.go b/model/model.go
index <HASH>..<HASH> 100644
--- a/model/model.go
+++ b/model/model.go
@@ -209,9 +209,11 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo {
// Returns statistics about each node
func (m *Model) NodeStatistics() map[string]stats.NodeStatistics {
var res = make(map[string]stats.NodeStatistics)
+ m.rmut.RLock()
for _, node := range m.cfg.Nodes {
res[node.NodeID.String()] = m.nodeStatRefs[node.NodeID].GetStatistics()
}
+ m.rmut.RUnlock()
return res
} | Hold rmut read lock when looking at nodeStatRefs | syncthing_syncthing | train | go |
eb6f65931e61bccbfb61ce62a89d86e413807f1e | diff --git a/lib/amoeba_deploy_tools/config.rb b/lib/amoeba_deploy_tools/config.rb
index <HASH>..<HASH> 100644
--- a/lib/amoeba_deploy_tools/config.rb
+++ b/lib/amoeba_deploy_tools/config.rb
@@ -38,52 +38,6 @@ class AmoebaDeployTools
self
end
- def [](k)
- chain = k.split('.')
- cur = self
-
- return super if chain.count < 1
-
- for c in chain[0..-2]
- if cur and cur.key? c
- cur = cur.regular_reader(c)
- else
- return
- end
- end
-
- cur[chain[-1]]
- end
-
- def []=(k, v)
- chain = k.split('.')
- cur = self
-
- return super if chain.count < 1
-
- for c in chain[0..-2]
- cur = cur.initializing_reader(c)
- end
-
- cur[chain[-1]] = v
- end
-
- def flatten
- flat = {}
-
- each do |k1, v1|
- if v1.class == self.class
- v1.flatten.each do |k2, v2|
- flat["#{k1}.#{k2}"] = v2
- end
- else
- flat[k1] = v1
- end
- end
-
- flat
- end
-
def to_s
to_hash.to_s
end | Removed Config flatten method needed for INI format. | AmoebaLabs_amoeba_deploy_tools | train | rb |
0fadbb5976ef52777946e9346b85a53ccc4efd42 | diff --git a/lib/eu_central_bank.rb b/lib/eu_central_bank.rb
index <HASH>..<HASH> 100644
--- a/lib/eu_central_bank.rb
+++ b/lib/eu_central_bank.rb
@@ -157,7 +157,7 @@ class EuCentralBank < Money::Bank::VariableExchange
currency_string = currency.to_s
return true if currency_string == "EUR"
return true if CURRENCIES.include?(currency_string)
- raise CurrencyUnavailable, "No rates available for #{@currency_string}"
+ raise CurrencyUnavailable, "No rates available for #{currency_string}"
end
protected | Fix wrong variable access in check_currency_available. (#<I>) | RubyMoney_eu_central_bank | train | rb |
cc4fa5f83fa688ae24c8de3a591b2024c48672ba | diff --git a/lib/discordrb/commands/command_bot.rb b/lib/discordrb/commands/command_bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/commands/command_bot.rb
+++ b/lib/discordrb/commands/command_bot.rb
@@ -61,7 +61,7 @@ module Discordrb::Commands
@prefix = attributes[:prefix]
@attributes = {
# Whether advanced functionality such as command chains are enabled
- advanced_functionality: attributes[:advanced_functionality].nil? ? true : attributes[:advanced_functionality],
+ advanced_functionality: attributes[:advanced_functionality].nil? ? false : attributes[:advanced_functionality],
# The name of the help command (that displays information to other commands). Nil if none should exist
help_command: attributes[:help_command] || :help, | Disable advanced_functionality by default | meew0_discordrb | train | rb |
d56c9c3647408fa19ba5cfa6e7adc77f2fcd946b | diff --git a/lib/transproc/composer.rb b/lib/transproc/composer.rb
index <HASH>..<HASH> 100644
--- a/lib/transproc/composer.rb
+++ b/lib/transproc/composer.rb
@@ -11,6 +11,7 @@ module Transproc
def <<(other)
fns.concat(Array(other).compact)
+ self
end
def to_fn
diff --git a/spec/integration/composer_spec.rb b/spec/integration/composer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/composer_spec.rb
+++ b/spec/integration/composer_spec.rb
@@ -7,8 +7,8 @@ describe Transproc::Composer do
def fn
compose do |fns|
- fns << t(:map_array, t(:symbolize_keys))
- fns << t(:map_array, t(:map_key, :age, t(:to_integer)))
+ fns << t(:map_array, t(:symbolize_keys)) <<
+ t(:map_array, t(:map_key, :age, t(:to_integer)))
end
end
end.new | Update composer to return self from `<<` | solnic_transproc | train | rb,rb |
b2e118a805b7991c160fb705122b89fef3d6b7e2 | diff --git a/cellbase-app/src/main/java/org/opencb/cellbase/app/transform/variation/VariationParser.java b/cellbase-app/src/main/java/org/opencb/cellbase/app/transform/variation/VariationParser.java
index <HASH>..<HASH> 100644
--- a/cellbase-app/src/main/java/org/opencb/cellbase/app/transform/variation/VariationParser.java
+++ b/cellbase-app/src/main/java/org/opencb/cellbase/app/transform/variation/VariationParser.java
@@ -238,8 +238,9 @@ public class VariationParser extends CellBaseParser {
} catch (JsonProcessingException e) {
logger.warn("Variant {} annotation cannot be serialized to Json: {}", id, e.getMessage());
}
- VariantAnnotation variantAnnotation = new VariantAnnotation(null, null, null, null, ancestralAllele, null, null, null,
- displayConsequenceType, null, null, minorAllele, minorAlleleFreq, null, null, null, null, null, null, additionalAttributes);
+ VariantAnnotation variantAnnotation = new VariantAnnotation(null, null, null, null, ancestralAllele, id, xrefs, hgvs,
+ displayConsequenceType, conseqTypes, null, minorAllele, minorAlleleFreq, null, null, null, null, null, null,
+ additionalAttributes);
variant.setAnnotation(variantAnnotation);
variant.setStrand(strand); | VariationParser: ensembl annotation added as default annotation | opencb_cellbase | train | java |
81cd2703421fdb0b2a2869458d3bf5ee844f8948 | diff --git a/go/kbfs/libkbfs/folder_block_manager.go b/go/kbfs/libkbfs/folder_block_manager.go
index <HASH>..<HASH> 100644
--- a/go/kbfs/libkbfs/folder_block_manager.go
+++ b/go/kbfs/libkbfs/folder_block_manager.go
@@ -1063,7 +1063,6 @@ func (fbm *folderBlockManager) doReclamation(timer *time.Timer) (err error) {
if !fbm.isQRNecessary(ctx, head) {
// Nothing has changed since last time, or the current head is
// too new, so no need to do any QR.
- fbm.log.CDebugf(ctx, "QR NOT NEEDED")
return nil
}
var complete bool
@@ -1117,7 +1116,6 @@ func (fbm *folderBlockManager) doReclamation(timer *time.Timer) (err error) {
return err
}
if head.Revision() <= lastGCRev {
- fbm.log.CDebugf(ctx, "QR NOT NEEDED %d", lastGCRev)
// TODO: need a log level more fine-grained than Debug to
// print out that we're not doing reclamation.
complete = true | folder_block_manager: remove test debugging statements
Suggested by jzila.
Issue: #<I> | keybase_client | train | go |
1185b06d1794591b789cafcd416c28f3ae027d5a | diff --git a/lib/serverkit/resources/symlink.rb b/lib/serverkit/resources/symlink.rb
index <HASH>..<HASH> 100644
--- a/lib/serverkit/resources/symlink.rb
+++ b/lib/serverkit/resources/symlink.rb
@@ -16,6 +16,13 @@ module Serverkit
def check
check_command_from_identifier(:check_file_is_linked_to, source, destination)
end
+
+ private
+
+ # @note Override
+ def default_id
+ source
+ end
end
end
end | Change symlink default_id so that only source is displayed | serverkit_serverkit | train | rb |
f8df88910c4979cee528292e47c5a58635be1abc | diff --git a/tests/DrupalCodeBuilderTestBase.php b/tests/DrupalCodeBuilderTestBase.php
index <HASH>..<HASH> 100644
--- a/tests/DrupalCodeBuilderTestBase.php
+++ b/tests/DrupalCodeBuilderTestBase.php
@@ -21,7 +21,7 @@ abstract class DrupalCodeBuilderTestBase extends PHPUnit_Framework_TestCase {
protected function setupDrupalCodeBuilder($version) {
$environment = new \DrupalCodeBuilder\Environment\TestsSampleLocation;
$version_helper = new \DrupalCodeBuilder\Environment\VersionHelperTestsPHPUnit;
- $version_helper->setFakeCoreMajorVersion(7);
+ $version_helper->setFakeCoreMajorVersion($version);
\DrupalCodeBuilder\Factory::setEnvironment($environment, $version_helper);
} | Fixed test base class helper setup method not passing core version to environment. | drupal-code-builder_drupal-code-builder | train | php |
44c245f527a53377ff70a88e7e37e390c0936748 | diff --git a/lib/eMapper/Mapper.php b/lib/eMapper/Mapper.php
index <HASH>..<HASH> 100644
--- a/lib/eMapper/Mapper.php
+++ b/lib/eMapper/Mapper.php
@@ -565,7 +565,7 @@ class Mapper {
}
}
}
- elseif (!is_null($mapped_result)) {
+ elseif (!is_null($mapped_result) && $mapping_callback[1] != 'mapList') {
$mapper->evaluateFirstOrderAttributes($mapped_result, $copy);
if ($evaluateSecondOrder) { | Fix: Check for empty lists before evaluating dynamic attributes. | emaphp_eMapper | train | php |
a4bdeed4e4e978f97c7e1f788df87e4c95572464 | diff --git a/src/supy/util/_plot.py b/src/supy/util/_plot.py
index <HASH>..<HASH> 100644
--- a/src/supy/util/_plot.py
+++ b/src/supy/util/_plot.py
@@ -110,7 +110,7 @@ def plot_comp(df_var, fig=None, ax=None):
sns.regplot(
x="Obs",
y="Sim",
- data=df_var,
+ data=df_var_fit,
ax=ax,
fit_reg=True,
line_kws={
@@ -122,7 +122,7 @@ def plot_comp(df_var, fig=None, ax=None):
+ "\n"
+ "MAE={0:.2f}".format(mae)
+ "\n"
- + "n={}".format(df_var.shape[0])
+ + "n={}".format(df_var_fit.shape[0])
},
) | fix issue in comparison plotting, #<I> | sunt05_SuPy | train | py |
9777a81a2417aaf2b4e63cf9607119630913f64a | diff --git a/client/cmd/cas/lib/common.go b/client/cmd/cas/lib/common.go
index <HASH>..<HASH> 100644
--- a/client/cmd/cas/lib/common.go
+++ b/client/cmd/cas/lib/common.go
@@ -66,12 +66,17 @@ func (c *commonFlags) Parse() error {
if logtostderr == nil {
return errors.Reason("logtostderr flag for glog not found").Err()
}
+ if err := logtostderr.Value.Set("true"); err != nil {
+ return errors.Annotate(err, "failed to set logstderr to true").Err()
+ }
+
v := flag.Lookup("v")
if v == nil {
return errors.Reason("v flag for glog not found").Err()
}
- logtostderr.Value.Set("true")
- v.Value.Set("9")
+ if err := v.Value.Set("9"); err != nil {
+ return errors.Annotate(err, "failed to set verbosity level to 9").Err()
+ }
}
if err := c.profiler.Start(); err != nil { | cas: check returned error
This is to upload new cas binary from 3pp builder.
Change-Id: Ic<I>e<I>d<I>b<I>c3b<I>b<I>a6fc5eb
Reviewed-on: <URL> | luci_luci-go | train | go |
b337749a5ac60b442c8e6eb0bfbbfbdb91c7876e | diff --git a/apps/wpcom-block-editor/src/wpcom/features/tracking.js b/apps/wpcom-block-editor/src/wpcom/features/tracking.js
index <HASH>..<HASH> 100644
--- a/apps/wpcom-block-editor/src/wpcom/features/tracking.js
+++ b/apps/wpcom-block-editor/src/wpcom/features/tracking.js
@@ -324,8 +324,11 @@ const trackInnerBlocksReplacement = ( rootClientId, blocks ) => {
trackBlocksHandler( blocks, 'wpcom_block_inserted', ( { name } ) => ( {
block_name: name,
blocks_replaced: true,
- // isInsertingPageTemplate filter is set by Starter Page Templates
- from_template_selector: applyFilters( 'isInsertingPageTemplate', false ),
+ // isInsertingPagePattern filter is set by Starter Page Templates.
+ // Also support isInsertingPageTemplate filter as this was used in older ETK versions.
+ from_template_selector:
+ applyFilters( 'isInsertingPagePattern', false ) ||
+ applyFilters( 'isInsertingPageTemplate', false ),
} ) );
}; | Editor Stats - Fix `from_template_selector` property for insert block events. (#<I>)
* fix filter string id
* support old filter | Automattic_wp-calypso | train | js |
522bace0829362793ff29022eb136a8bab9f7d48 | diff --git a/panels/_version.py b/panels/_version.py
index <HASH>..<HASH> 100644
--- a/panels/_version.py
+++ b/panels/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.0.63"
+__version__ = "0.0.64" | Update version number to <I> | chaoss_grimoirelab-sigils | train | py |
f000ae8e5e0f9ab288419d3c2454061a7a741b18 | diff --git a/test/csvconverter/commands/test_command_csv2strings.rb b/test/csvconverter/commands/test_command_csv2strings.rb
index <HASH>..<HASH> 100644
--- a/test/csvconverter/commands/test_command_csv2strings.rb
+++ b/test/csvconverter/commands/test_command_csv2strings.rb
@@ -33,6 +33,7 @@ class TestCommand < Test::Unit::TestCase
end
def test_csv2strings_with_fetch_google_doc
+ omit
options = {
:filename => "my_trads",
:langs => {"English" => "en", "French" => "fr"},
diff --git a/test/csvconverter/test_bins.rb b/test/csvconverter/test_bins.rb
index <HASH>..<HASH> 100644
--- a/test/csvconverter/test_bins.rb
+++ b/test/csvconverter/test_bins.rb
@@ -2,6 +2,7 @@ require 'test_helper'
class TestBins < Test::Unit::TestCase
def test_csv2strings_with_google_doc
+ omit
assert_nothing_raised do
system("./bin/csv2strings --fetch --filename test.csv")
end | Omit tests on google_drive while not mocking | netbe_Babelish | train | rb,rb |
182bcdf7d2d3876944405f1f34d2857db7d903be | diff --git a/tests/main_url_conf.py b/tests/main_url_conf.py
index <HASH>..<HASH> 100644
--- a/tests/main_url_conf.py
+++ b/tests/main_url_conf.py
@@ -9,5 +9,6 @@ urlpatterns = [
url(U / 'included', view_include(included_views)),
url(U / 'included', view_include(included_views, namespace='named')),
url(U / 'string', view_include('tests.included_app.views',
- namespace='string_import'))
+ namespace='string_import')),
+ url(U, view_include(included_views, namespace='wild_card')),
]
diff --git a/tests/test_urljects.py b/tests/test_urljects.py
index <HASH>..<HASH> 100755
--- a/tests/test_urljects.py
+++ b/tests/test_urljects.py
@@ -146,3 +146,10 @@ class TestAPP(unittest.TestCase):
self.assertEqual(reverse(viewname='string_import:IncludedView'),
u'/string/IncludedView')
+
+ def test_wild_card(self):
+ self.assertEqual(reverse(viewname='wild_card:included_view'),
+ u'/included_view')
+
+ self.assertEqual(reverse(viewname='wild_card:IncludedView'),
+ u'/IncludedView')
\ No newline at end of file | tests for wild card urls
prep for #6 | Visgean_urljects | train | py,py |
6b270fec64e6bbf15802f93b5b5d5797110b9f7e | diff --git a/sockeye/data_io.py b/sockeye/data_io.py
index <HASH>..<HASH> 100644
--- a/sockeye/data_io.py
+++ b/sockeye/data_io.py
@@ -93,9 +93,9 @@ def get_data_iter(data_source: str, data_target: str,
assert len(source_sentences) == len(target_sentences)
eos_id = vocab_target[C.EOS_SYMBOL]
- length_ratio = sum(len(s) / float(len(t)) for s, t in zip(source_sentences, target_sentences)) / len(
- source_sentences)
- logger.info("Average length ratio between src & trg: %.2f", length_ratio)
+ length_ratio = sum(len(t) / float(len(s)) for t, s in zip(target_sentences, source_sentences)) / len(
+ target_sentences)
+ logger.info("Average target/source length ratio: %.2f", length_ratio)
buckets = define_parallel_buckets(max_seq_len, bucket_width, length_ratio) if bucketing else [
(max_seq_len, max_seq_len)] | Bugfix: correct target/source length computation for bucket sizing (#<I>) | awslabs_sockeye | train | py |
cd6967b4ac3bf386a5b99a9cee36088354ef85e9 | diff --git a/timeside/server/models.py b/timeside/server/models.py
index <HASH>..<HASH> 100644
--- a/timeside/server/models.py
+++ b/timeside/server/models.py
@@ -221,7 +221,7 @@ class Task(BaseResource):
if not os.path.exists(settings.MEDIA_ROOT + os.sep + path):
os.makedirs(settings.MEDIA_ROOT + os.sep + path)
- pipe = timeside.decoder.FileDecoder(item.file.path, sha1=item.sha1)
+ pipe = timeside.decoder.file.FileDecoder(item.file.path, sha1=item.sha1)
presets = {}
for preset in self.experience.presets.all(): | Update server/models to new API | Parisson_TimeSide | train | py |
3ab88bfe197662759cc5d8aaaf0a2d722c5f0449 | diff --git a/ssllabs-scan.go b/ssllabs-scan.go
index <HASH>..<HASH> 100644
--- a/ssllabs-scan.go
+++ b/ssllabs-scan.go
@@ -283,6 +283,16 @@ func invokeGetRepeatedly(url string) (*http.Response, []byte, error) {
}
}
}
+
+ if logLevel >= LOG_NOTICE {
+ for key, values := range resp.Header {
+ if strings.ToLower(key) == "x-message" {
+ for _, value := range values {
+ log.Printf("[NOTICE] Server message: %v\n", value)
+ }
+ }
+ }
+ }
// Adjust maximum concurrent requests. | Show server messages at NOTICE level. | ssllabs_ssllabs-scan | train | go |
abcb264f7d3100301b11519cb5e9aeb321377317 | diff --git a/go/vt/vtgate/evalengine/comparisons.go b/go/vt/vtgate/evalengine/comparisons.go
index <HASH>..<HASH> 100644
--- a/go/vt/vtgate/evalengine/comparisons.go
+++ b/go/vt/vtgate/evalengine/comparisons.go
@@ -446,7 +446,7 @@ func NullsafeCompare(v1, v2 sqltypes.Value, collationID collations.ID) (int, err
}
switch {
- case typ == sqltypes.VarChar:
+ case typ == sqltypes.VarChar || typ == sqltypes.Text:
v1Bytes := v1.Raw()
v2Bytes := v2.Raw() | Treat TEXT and VARCHAR fields the same way for comparisons
We already do this for BLOB and VARBINARY | vitessio_vitess | train | go |
58bb91716a41a397725a87668afd4405df92e7c0 | diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -15,13 +15,6 @@ var db = module.parent.require('./database'),
posts = module.parent.require('./posts'),
utils = require('./lib/utils'),
- // This method is necessary until solr-client 0.3.x is released
- escapeSpecialChars = function(s) {
- return s.replace(/([\+\-&\|!\(\)\{\}\[\]\^"~\*\?:\\\ ])/g, function(match) {
- return '\\' + match;
- });
- },
-
Solr = {
/*
Defaults configs:
@@ -221,7 +214,7 @@ Solr.searchTopic = function(data, callback) {
pids = pids.map(function(pid) { return '"post:' + pid + '"'; });
// Populate Query
- fields[Solr.config.contentField || 'description_t'] = escapeSpecialChars(term);
+ fields[Solr.config.contentField || 'description_t'] = term;
fields.id = '(' + pids.join(' OR ') + ')';
query = Solr.client.createQuery().q(fields); | removed invocation of no-longer-needed helper method | julianlam_nodebb-plugin-solr | train | js |
bfd415f94fe1865a262a28d3905e6e5dd9e61133 | diff --git a/py/test/selenium/webdriver/common/alerts_tests.py b/py/test/selenium/webdriver/common/alerts_tests.py
index <HASH>..<HASH> 100644
--- a/py/test/selenium/webdriver/common/alerts_tests.py
+++ b/py/test/selenium/webdriver/common/alerts_tests.py
@@ -99,8 +99,7 @@ def testShouldGetTextOfAlertOpenedInSetTimeout(driver, pages):
@pytest.mark.xfail_chrome(
- condition=sys.platform == 'darwin',
- reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=26',
+ reason='https://bugs.chromium.org/p/chromedriver/issues/detail?id=26 and https://bugs.chromium.org/p/chromedriver/issues/detail?id=1500',
run=False)
@pytest.mark.xfail_phantomjs(
reason='https://github.com/detro/ghostdriver/issues/20', | Disabling Alert test because of another reason for it to fail. Hopefully this will stabilise Chrome | SeleniumHQ_selenium | train | py |
fe8074c74df80445f9180664a766c508e8e2e883 | diff --git a/src/org/zaproxy/zap/extension/api/NodeJSAPIGenerator.java b/src/org/zaproxy/zap/extension/api/NodeJSAPIGenerator.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/extension/api/NodeJSAPIGenerator.java
+++ b/src/org/zaproxy/zap/extension/api/NodeJSAPIGenerator.java
@@ -35,7 +35,7 @@ public class NodeJSAPIGenerator extends AbstractAPIGenerator {
/**
* Default output directory in zap-api-nodejs project.
*/
- private static final String DEFAULT_OUTPUT_DIR = "../zap-api-nodejs/src/zapv2/";
+ private static final String DEFAULT_OUTPUT_DIR = "../zap-api-nodejs/src/";
private final String HEADER =
"/* Zed Attack Proxy (ZAP) and its related class files.\n" + | Removed the zapv2 dir path I forgot about | zaproxy_zaproxy | train | java |
198c7b49590d015a370a8da53ffcdb0a17f14ef0 | diff --git a/lib/scorm_engine/faraday/request.rb b/lib/scorm_engine/faraday/request.rb
index <HASH>..<HASH> 100644
--- a/lib/scorm_engine/faraday/request.rb
+++ b/lib/scorm_engine/faraday/request.rb
@@ -20,7 +20,8 @@ module ScormEngine
private
def request(method, path, options, body = nil)
- path = "#{tenant}/#{path}"
+ # "more" pagination urls are fully qualified
+ path = "#{tenant}/#{path}" unless path =~ %r{\Ahttps?://}
options = coerce_options(options) | some urls returned from scorm are already fully qualified so don't prefix tenant to them | instructure-bridge_scorm_engine | train | rb |
03884794025b32721cfd5470beee0602f03549d8 | diff --git a/hgdistver.py b/hgdistver.py
index <HASH>..<HASH> 100644
--- a/hgdistver.py
+++ b/hgdistver.py
@@ -71,13 +71,12 @@ def version_from_hg15_parents(root, cachefile=None):
def version_from_hg_log_with_tags(root, cachefile=None):
if os.path.isdir(os.path.join(root, '.hg')):
node = getoutput('hg id -i', root).strip()
- cmd = r'log -r %s:0 --template "{tags} \n"'
+ cmd = r'hg log -r %s:0 --template "{tags} \n"'
cmd = cmd % node.rstrip('+')
- proc = subprocess.Popen(hg_prefix + cmd,
+ proc = subprocess.Popen(cmd,
cwd=root,
shell=True,
stdout=subprocess.PIPE,
- env={'ew':'why'},
)
dist = -1 # no revs vs one rev is tricky | dont screw up the env of the tag scraper | pypa_setuptools_scm | train | py |
7ed6fe1229828d8a6fbf28802467d8db2a3431a0 | diff --git a/project/project.go b/project/project.go
index <HASH>..<HASH> 100644
--- a/project/project.go
+++ b/project/project.go
@@ -83,10 +83,6 @@ func (p *Project) Deploy(names []string) error {
}()
for err := range errs {
- if err == ErrNotFound {
- continue
- }
-
if err != nil {
return err
}
@@ -97,11 +93,18 @@ func (p *Project) Deploy(names []string) error {
// deploy function by `name`.
func (p *Project) deploy(name string) error {
- if fn, err := p.FunctionByName(name); err != nil {
+ fn, err := p.FunctionByName(name)
+
+ if err == ErrNotFound {
+ p.Log.Warnf("function %q does not exist", name)
+ return nil
+ }
+
+ if err != nil {
return err
- } else {
- return fn.Deploy()
}
+
+ return fn.Deploy()
}
// Clean up function build artifacts. | refactor Project.deploy with warning log if a function is missing | apex_apex | train | go |
64e0ef3b73c0748177ee03c53ef9735b5a96b5a5 | diff --git a/src/Leevel/Seccode/Seccode.php b/src/Leevel/Seccode/Seccode.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Seccode/Seccode.php
+++ b/src/Leevel/Seccode/Seccode.php
@@ -180,10 +180,8 @@ class Seccode
create_directory(dirname($outPath));
imagepng($resImage, $outPath, 9);
} else {
- // @codeCoverageIgnoreStart
- // set header `Content-type: image/png`
+ // Need set header `Content-type: image/png`
imagepng($resImage);
- // @codeCoverageIgnoreEnd
}
imagedestroy($resImage);
@@ -271,12 +269,6 @@ class Seccode
*/
protected function makeTtfFont(&$resImage): void
{
- if (!function_exists('imagettftext')) {
- // @codeCoverageIgnoreStart
- throw new InvalidArgumentException('Function imagettftext is not exits.');
- // @codeCoverageIgnoreEnd
- }
-
list($font, $code, $widthTotal) = $this->getFontOption();
$width = $this->normalizeWidth();
$height = $this->normalizeHeight(); | refactor(seccode): remove @ codeCoverageIgnore | hunzhiwange_framework | train | php |
9922f4258810f8e8f2cb0571a00bb1f4ac55841e | diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index <HASH>..<HASH> 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -52,7 +52,6 @@ gulp.task('lint-src', function() {
}))
.pipe(eslint.format())
.pipe(eslint.failAfterError())
- .pipe(gulp.dest('src'));
});
gulp.task('lint-test', function() {
@@ -61,7 +60,6 @@ gulp.task('lint-test', function() {
}))
.pipe(eslint.format())
.pipe(eslint.failAfterError())
- .pipe(gulp.dest('test'));
});
gulp.task('karma', ['lint'], function (done) { | Do not pipe out eslint result, causes a bug which deletes file contents | paypal_paypal-checkout-components | train | js |
6aa5dd9dfc56a64038c0131ddbbb9b6d15ed2a7e | diff --git a/tasks/install.php b/tasks/install.php
index <HASH>..<HASH> 100644
--- a/tasks/install.php
+++ b/tasks/install.php
@@ -31,6 +31,13 @@ class FluxBB_Install_Task extends Task
public function run($arguments = array())
{
+ $this->structure();
+
+ $this->seed();
+ }
+
+ public function structure()
+ {
foreach (new FilesystemIterator($this->path()) as $file)
{
$migration = basename($file->getFileName(), '.php'); | Seed the database, too, when installing. | fluxbb_core | train | php |
8541c719ec5c2ee077f457934d298b46ba65bb67 | diff --git a/lib/MongoLite/Database.php b/lib/MongoLite/Database.php
index <HASH>..<HASH> 100644
--- a/lib/MongoLite/Database.php
+++ b/lib/MongoLite/Database.php
@@ -227,10 +227,10 @@ class UtilArrayQuery {
$_fn = array();
foreach($value as $v) {
- $_fn[] = '('.self::buildCondition($v, ' && ').')';
+ $_fn[] = self::buildCondition($v, ' && ');
}
- $fn[] = implode(' || ', $_fn);
+ $fn[] = '('.implode(' && ', $_fn).')';
break;
case '$or':
@@ -238,10 +238,10 @@ class UtilArrayQuery {
$_fn = array();
foreach($value as $v) {
- $_fn[] = '('.self::buildCondition($v, ' || ').')';
+ $_fn[] = self::buildCondition($v, ' && ');
}
- $fn[] = implode(' || ', $_fn);
+ $fn[] = '('.implode(' || ', $_fn).')';
break;
default: | conditions builder fix for $or + $and | agentejo_cockpit | train | php |
9fe75deb13ae8291afd92f085bcc67965f5eb8d5 | diff --git a/sexpr/loaders.py b/sexpr/loaders.py
index <HASH>..<HASH> 100644
--- a/sexpr/loaders.py
+++ b/sexpr/loaders.py
@@ -35,12 +35,13 @@ def load_file(path, options = None):
return load_string(f.read(), options)
-def load_string(string, options):
+def load_string(string, options = None):
return load_dict(yaml.load(string, Loader=yamlloader.ordereddict.Loader), options)
-def load_dict(dictionary, options):
- # for k, v in dictionary['rules'].items():
- # print('%s: %s' % (k, v))
- # print('---------------------------')
+def load_dict(dictionary, options = None):
+ options = options or {}
+ if 'root' in dictionary and not 'root' in options:
+ # Move 'root' from source to options.
+ options.update(root = dictionary['root'])
return Grammar(dictionary, options) | Move 'root' value from source dict to options dict on load | IwoHerka_sexpr | train | py |
4cfde174d86419846be12fce475cda946e238564 | diff --git a/demag_gui.py b/demag_gui.py
index <HASH>..<HASH> 100755
--- a/demag_gui.py
+++ b/demag_gui.py
@@ -4954,7 +4954,7 @@ self.mean_fit not in map(lambda x: x.name, self.pmag_results_data['specimens'][s
tmax_index=self.tmax_box.GetSelection()
max_index = len(self.Data[specimen]['zijdblock_steps'])-1
- while (self.Data[specimen]['measurement_flag'][tmin_index] == 'b' and \
+ while (self.Data[specimen]['measurement_flag'][max_index] == 'b' and \
max_index-1 > 0):
max_index -= 1
@@ -5464,7 +5464,7 @@ class EditFitFrame(wx.Frame):
print('can not select fit of type: ' + str(type(new_fit)))
self.logger.SetItemBackgroundColour(self.current_fit_index,"WHITE")
self.current_fit_index = i
- self.update_logger_entry(self.current_fit_index)
+ self.logger.SetItemBackgroundColour(self.current_fit_index,"LIGHT BLUE")
def logger_focus(self,i): | demag_gui.py
working on measurement logger had some bugs in edge cases | PmagPy_PmagPy | train | py |
9b32a10052178218db163b60ad0f4e3d6d519119 | diff --git a/replaylib/stubs.py b/replaylib/stubs.py
index <HASH>..<HASH> 100644
--- a/replaylib/stubs.py
+++ b/replaylib/stubs.py
@@ -13,11 +13,8 @@ class RecordingHTTPResponse(httplib.HTTPResponse):
def init_recording(self, req_hash):
self.record_handle = replaylib.current.start_response(req_hash)
-
- def begin(self):
- httplib.HTTPResponse.begin(self)
self.record_handle.rec_start(self.version, self.status, self.reason, self.msg)
-
+
def read(self, amt):
s = httplib.HTTPResponse.read(self, amt)
self.record_handle.rec_body(s) | move recording start out of response.begin | storborg_replaylib | train | py |
1cfa902e313e848732976ac6e538f3f72c135d90 | diff --git a/js/scrollspy.js b/js/scrollspy.js
index <HASH>..<HASH> 100644
--- a/js/scrollspy.js
+++ b/js/scrollspy.js
@@ -36,7 +36,13 @@
}
ScrollSpy.prototype.refresh = function () {
- var offsetMethod = this.$scrollElement[0] == window ? 'offset' : 'position'
+ var offsetMethod = 'offset'
+ var offsetBase = 0
+
+ if (!$.isWindow(this.$scrollElement[0])) {
+ offsetMethod = 'position'
+ offsetBase = this.$scrollElement.scrollTop()
+ }
this.offsets = []
this.targets = []
@@ -54,7 +60,7 @@
return ($href
&& $href.length
&& $href.is(':visible')
- && [[$href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href]]) || null
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () { | refactor scrollspy refresh method
Closes #<I> by merging a rebased version of it. | twbs_bootstrap | train | js |
bf845f2b30d4654dbe2446e1f9789b234b3ae2ef | diff --git a/user/index.php b/user/index.php
index <HASH>..<HASH> 100644
--- a/user/index.php
+++ b/user/index.php
@@ -194,6 +194,7 @@
print_user($teacher, $course);
}
} else {
+ $countrysort = (strpos($sortclause, 'country') !== false);
foreach ($teachers as $teacher) {
if ($teacher->lastaccess) {
@@ -201,13 +202,25 @@
} else {
$lastaccess = $strnever;
}
+
+ if (empty($teacher->country)) {
+ $country = '';
+ }
+ else {
+ if($countrysort) {
+ $country = '('.$teacher->country.') '.$countries[$teacher->country];
+ }
+ else {
+ $country = $countries[$teacher->country];
+ }
+ }
$table->add_data(array (
//'<input type="checkbox" name="userid[]" value="'.$teacher->id.'" />',
print_user_picture($teacher->id, $course->id, $teacher->picture, false, true),
'<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$teacher->id.'&course='.$course->id.'">'.fullname($teacher, $isteacher).'</a></strong>',
$teacher->city,
- $teacher->country ? $countries[$teacher->country] : '',
+ $country,
$lastaccess));
} | Merging from STABLE:
Forgot to prepend country codes to the teacher list as well when sorting. | moodle_moodle | train | php |
24f914d1813f9ac962b94376452ed1432f3b7d0d | diff --git a/src/Prettus/Repository/Eloquent/BaseRepository.php b/src/Prettus/Repository/Eloquent/BaseRepository.php
index <HASH>..<HASH> 100644
--- a/src/Prettus/Repository/Eloquent/BaseRepository.php
+++ b/src/Prettus/Repository/Eloquent/BaseRepository.php
@@ -457,7 +457,7 @@ abstract class BaseRepository implements RepositoryInterface, RepositoryCriteria
/**
* Retrieve all data of repository, paginated
*
- * @param null $limit
+ * @param null|int $limit
* @param array $columns
* @param string $method
*
@@ -478,7 +478,7 @@ abstract class BaseRepository implements RepositoryInterface, RepositoryCriteria
/**
* Retrieve all data of repository, simple paginated
*
- * @param null $limit
+ * @param null|int $limit
* @param array $columns
*
* @return mixed | Add param type (#<I>)
This matches the Eloquent Builder method param and fixes phpstan errors when using the parameter as expected. | andersao_l5-repository | train | php |
fcd45063ddf634df7fbadc268fe639cfe3efcfb1 | diff --git a/src/Parser.php b/src/Parser.php
index <HASH>..<HASH> 100644
--- a/src/Parser.php
+++ b/src/Parser.php
@@ -2238,7 +2238,7 @@ class Parser {
}
private function scanParagraph() {
- $xsp;
+ $xsp = null;
if ($this->scanInlineElement()) {
return true;
} | small fixes for hhvm | koara_koara-php | train | php |
3f47d12ed18b9a0f14a018e6302713b36bfc595d | diff --git a/example/config/development.conf.js b/example/config/development.conf.js
index <HASH>..<HASH> 100644
--- a/example/config/development.conf.js
+++ b/example/config/development.conf.js
@@ -5,12 +5,11 @@
var config = require('vuex-cli-webpack/lib/config')
module.exports = {
- compiler_public_path: `http://${config.server_host}:${config.server_port}/`,
- proxy: {
- enabled: false,
- options: {
- host: 'http://cnodejs.org/',
- match: /^\/api\/.*/
- }
- }
-}
\ No newline at end of file
+ proxy: {
+ enabled: false,
+ options: {
+ host: null,
+ match: /^\/api\/.*/
+ }
+ }
+} | [build] <I>-beta2 | sokis_vuex-cli-webpack | train | js |
9cbca1cef9d9c40d12576e72f73d40d3d22043d6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -246,7 +246,7 @@ if (not (_ROOT / 'asyncpg' / 'protocol' / 'protocol.c').exists() or
setuptools.setup(
name='asyncpg',
version=VERSION,
- description='An asyncio PosgtreSQL driver',
+ description='An asyncio PostgreSQL driver',
long_description=readme,
classifiers=[
'Development Status :: 5 - Production/Stable', | Fix typo in "PostgreSQL" in project description | MagicStack_asyncpg | train | py |
59592c42a836febcb8657fbf366433671213a756 | diff --git a/presto-main/src/main/java/com/facebook/presto/operator/Operator.java b/presto-main/src/main/java/com/facebook/presto/operator/Operator.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/operator/Operator.java
+++ b/presto-main/src/main/java/com/facebook/presto/operator/Operator.java
@@ -33,19 +33,6 @@ public interface Operator
List<Type> getTypes();
/**
- * Notifies the operator that no more pages will be added and the
- * operator should finish processing and flush results. This method
- * will not be called if the Task is already failed or canceled.
- */
- void finish();
-
- /**
- * Is this operator completely finished processing and no more
- * output pages will be produced.
- */
- boolean isFinished();
-
- /**
* Returns a future that will be completed when the operator becomes
* unblocked. If the operator is not blocked, this method should return
* {@code NOT_BLOCKED}.
@@ -73,6 +60,19 @@ public interface Operator
Page getOutput();
/**
+ * Notifies the operator that no more pages will be added and the
+ * operator should finish processing and flush results. This method
+ * will not be called if the Task is already failed or canceled.
+ */
+ void finish();
+
+ /**
+ * Is this operator completely finished processing and no more
+ * output pages will be produced.
+ */
+ boolean isFinished();
+
+ /**
* This method will always be called before releasing the Operator reference.
*/
@Override | Reorder methods in Operator to match lifecycle | prestodb_presto | train | java |
5cb3b12fc10133f011782ca2b781d145523f9627 | diff --git a/lib/dbus/logger.rb b/lib/dbus/logger.rb
index <HASH>..<HASH> 100644
--- a/lib/dbus/logger.rb
+++ b/lib/dbus/logger.rb
@@ -11,9 +11,21 @@
require 'logger'
module DBus
+ # Get the logger for the DBus module.
+ # The default one logs to STDERR,
+ # with DEBUG if $DEBUG is set, otherwise INFO.
def logger
- @logger ||= Logger.new(STDERR)
+ unless @logger
+ @logger = Logger.new(STDERR)
+ @logger.level = $DEBUG ? Logger::DEBUG : Logger::INFO
+ end
+ @logger
end
-
module_function :logger
+
+ # Set the logger for the DBus module
+ def logger=(logger)
+ @logger = logger
+ end
+ module_function :logger=
end | Log debug messages only if $DEBUG is set. | mvidner_ruby-dbus | train | rb |
1b0f122d0f20cc5c95e0b07e8eb0566bad0a04f7 | diff --git a/controller/frontend/src/Controller/Frontend/Iface.php b/controller/frontend/src/Controller/Frontend/Iface.php
index <HASH>..<HASH> 100644
--- a/controller/frontend/src/Controller/Frontend/Iface.php
+++ b/controller/frontend/src/Controller/Frontend/Iface.php
@@ -13,11 +13,18 @@ namespace Aimeos\Controller\Frontend;
/**
- * Decorator interface for controller.
+ * Common interface for controller
*
* @package Controller
* @subpackage Frontend
*/
interface Iface
{
+ /**
+ * Injects the reference of the outmost object
+ *
+ * @param \Aimeos\Controller\Frontend\Iface $object Reference to the outmost controller or decorator
+ * @return \Aimeos\Controller\Frontend\Iface Controller object for chaining method calls
+ */
+ public function setObject( \Aimeos\Controller\Frontend\Iface $object );
} | Added setObject() to common controller interface | aimeos_ai-controller-frontend | train | php |
e3d8e54e6566c2537720906eda56528cd2fe09a8 | diff --git a/drools-planner-core/src/main/java/org/drools/planner/core/solver/DefaultSolver.java b/drools-planner-core/src/main/java/org/drools/planner/core/solver/DefaultSolver.java
index <HASH>..<HASH> 100644
--- a/drools-planner-core/src/main/java/org/drools/planner/core/solver/DefaultSolver.java
+++ b/drools-planner-core/src/main/java/org/drools/planner/core/solver/DefaultSolver.java
@@ -59,6 +59,10 @@ public class DefaultSolver implements Solver {
protected AtomicBoolean solving = new AtomicBoolean(false);
protected DefaultSolverScope solverScope = new DefaultSolverScope();
+
+ public long getRandomSeed() {
+ return this.randomSeed;
+ }
public void setRandomSeed(long randomSeed) {
this.randomSeed = randomSeed; | Add a getter for random seed. | kiegroup_optaplanner | train | java |
e33b5471f1bda43e1f91b95132feb60eab39cde5 | diff --git a/seravo-plugin.php b/seravo-plugin.php
index <HASH>..<HASH> 100644
--- a/seravo-plugin.php
+++ b/seravo-plugin.php
@@ -1,7 +1,7 @@
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/**
* Plugin Name: Seravo Plugin
- * Version: 1.9.17
+ * Version: 1.9.18
* Plugin URI: https://github.com/Seravo/seravo-plugin
* Description: Enhances WordPress with Seravo.com specific features and integrations.
* Author: Seravo Oy | Bump to version <I> | Seravo_seravo-plugin | train | php |
0e3309716b8de68ccdaa432ff3d485775057e1ff | diff --git a/lib/Server.js b/lib/Server.js
index <HASH>..<HASH> 100644
--- a/lib/Server.js
+++ b/lib/Server.js
@@ -54,6 +54,7 @@ function Server(compiler, options) {
});
app.get("/webpack-dev-server/*", function(req, res) {
+ res.setHeader("Content-Type", "text/html");
this.livePage.pipe(res);
}.bind(this)); | Make live.html work on PS4 browser by adding Content-Type
The PS4 web browser refuses to open web pages without a Content-Type header. | webpack_webpack-dev-server | train | js |
1a404849897db916d58fc112d74660f96f7d888e | diff --git a/lib/parse/model/pointer.rb b/lib/parse/model/pointer.rb
index <HASH>..<HASH> 100644
--- a/lib/parse/model/pointer.rb
+++ b/lib/parse/model/pointer.rb
@@ -156,6 +156,17 @@ module Parse
end
alias_method :eql?, :==
+ # Compute a hash-code for this object. It is calculated
+ # by combining the Parse class name, the {Parse::Object#id} field and
+ # any pending changes.
+ #
+ # Two objects with the same content will have the same hash code
+ # (and will compare using eql?).
+ # @return [Fixnum]
+ def hash
+ "#{parse_class}#{id}#{changes.to_s}".hash
+ end
+
# @return [Boolean] true if instance has a Parse class and an id.
def present?
parse_class.present? && @id.present? | Modifies the hash method to support ruby operations. | modernistik_parse-stack | train | rb |
79f22a7f8d0c07e76991d75370db172d5ce7d324 | diff --git a/test/test_en_casual.js b/test/test_en_casual.js
index <HASH>..<HASH> 100644
--- a/test/test_en_casual.js
+++ b/test/test_en_casual.js
@@ -265,4 +265,17 @@ test('Test - Random negative text', function() {
var text = "xyesterday";
var results = chrono.parse(text);
ok(results.length == 0, JSON.stringify(results) )
+
+ var text = "nowhere";
+ var results = chrono.parse(text);
+ ok(results.length == 0, JSON.stringify(results) )
+
+ var text = "noway";
+ var results = chrono.parse(text);
+ ok(results.length == 0, JSON.stringify(results) )
+
+ var text = "knowledge";
+ var results = chrono.parse(text);
+ ok(results.length == 0, JSON.stringify(results) )
+
}) | Negative tests: nowhere, noway, knowledge | wanasit_chrono | train | js |
a5da48d231bf1e4041e149a8d052d8450e41a4e9 | diff --git a/railties/lib/generators/rails/app/templates/config/boot.rb b/railties/lib/generators/rails/app/templates/config/boot.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/generators/rails/app/templates/config/boot.rb
+++ b/railties/lib/generators/rails/app/templates/config/boot.rb
@@ -5,13 +5,4 @@ rescue LoadError
require 'rubygems'
require 'bundler'
Bundler.setup
-
- # To use 2.x style vendor/rails and RubyGems
- #
- # vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
- # if File.exist?(vendor_rails)
- # Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
- # end
- #
- # require 'rubygems'
end | vendor/rails doesn't work anymore, remove it from the blank slate suggestion | rails_rails | train | rb |
16034af1e026260965cbfa241861973ffaaac3ba | diff --git a/test/test_big_phi.py b/test/test_big_phi.py
index <HASH>..<HASH> 100644
--- a/test/test_big_phi.py
+++ b/test/test_big_phi.py
@@ -56,7 +56,8 @@ def test_null_concept(s, flushdb):
phi=0, direction=DIRECTIONS[FUTURE], mechanism=(), purview=s.nodes,
partition=None, partitioned_repertoire=None))
assert (s.null_concept ==
- models.Concept(mechanism=(), phi=0, cause=cause, effect=effect))
+ models.Concept(mechanism=(), phi=0, cause=cause, effect=effect,
+ subsystem=s))
def test_concept_nonexistent(s, flushdb): | test_big_phi: Update for new concept.subsystem attribute | wmayner_pyphi | train | py |
89d9a4b9602675626607bd50309da1f636800024 | diff --git a/arthur/_version.py b/arthur/_version.py
index <HASH>..<HASH> 100644
--- a/arthur/_version.py
+++ b/arthur/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.1.9"
+__version__ = "0.1.11" | Update version number to <I> | chaoss_grimoirelab-kingarthur | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.