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 |
|---|---|---|---|---|---|
7b79e70223fcabcdd84c3ff8cafeac6cb3bda39d | diff --git a/src/main/java/com/googlecode/objectify/impl/translate/CreateContext.java b/src/main/java/com/googlecode/objectify/impl/translate/CreateContext.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/googlecode/objectify/impl/translate/CreateContext.java
+++ b/src/main/java/com/googlecode/objectify/impl/translate/CreateContext.java
@@ -35,7 +35,7 @@ public class CreateContext
*/
@SuppressWarnings("unchecked")
public <P> Populator<P> getPopulator(Class<P> clazz, Path path) {
- if (clazz.equals(Object.class)) {
+ if (clazz == null || clazz.equals(Object.class)) {
return (Populator<P>)NullPopulator.INSTANCE;
} else {
ClassTranslator<P> classTranslator = (ClassTranslator<P>)this.<P, PropertyContainer>getTranslator(new TypeKey<P>(clazz), this, path); | Allow for null superclass
Apparently possible to have a null superclass without hitting Object
via bytecode manipulation.
Fixes issue #<I> | objectify_objectify | train | java |
98682841175bd99030a49527fa86e1189ec961f2 | diff --git a/src/Document.php b/src/Document.php
index <HASH>..<HASH> 100644
--- a/src/Document.php
+++ b/src/Document.php
@@ -22,7 +22,7 @@ use ChapterThree\AppleNews\Document\Layouts\ComponentLayout;
*/
class Document extends Base {
- protected $version = '0.10.1';
+ protected $version = '0.10.13';
protected $identifier;
protected $title;
protected $language; | Update document version to <I>. | chapter-three_AppleNewsAPI | train | php |
23b1769ac05f9aa5cd6ea11087efac85a70f5438 | diff --git a/lib/api/add.js b/lib/api/add.js
index <HASH>..<HASH> 100644
--- a/lib/api/add.js
+++ b/lib/api/add.js
@@ -27,7 +27,7 @@ module.exports = function(API) {
}
// ampersand
for(var prop in props) {
- if(prop.charAt(0) === "&") {
+ if(/&/g.test(prop)) {
props[prop] = false;
}
}
diff --git a/tests/bugs/ampersand.and.plugin.spec.js b/tests/bugs/ampersand.and.plugin.spec.js
index <HASH>..<HASH> 100644
--- a/tests/bugs/ampersand.and.plugin.spec.js
+++ b/tests/bugs/ampersand.and.plugin.spec.js
@@ -11,6 +11,9 @@ describe("Fixing bug with ampersand inside a plugin", function() {
".ie8 &": {
color: "blue"
}
+ },
+ ".ie8 &": {
+ color: "#eee"
}
};
});
@@ -32,6 +35,9 @@ a:hover {\n\
}\n\
.ie8 a:hover {\n\
color: blue;\n\
+}\n\
+.ie8 a {\n\
+ color: #eee;\n\
}\n");
done();
}); | Fix: Ampersand operator in any position in selector issue in plugins
- changed ampersand operator clearing condition with regex test | krasimir_absurd | train | js,js |
30dfdfc4f913a0075cc35002c41bb8480a688182 | diff --git a/cmd/cmd.go b/cmd/cmd.go
index <HASH>..<HASH> 100644
--- a/cmd/cmd.go
+++ b/cmd/cmd.go
@@ -282,11 +282,14 @@ func setup(app *ccli.App) {
(*cmd.DefaultCmd.Options().Store).Init(opts...)
}
- // add the system rules
- for role, resources := range inauth.SystemRules {
- for _, res := range resources {
- if err := (*cmd.DefaultCmd.Options().Auth).Grant(role, res); err != nil {
- return err
+ // add the system rules if we're using the JWT implementation
+ // which doesn't have access to the rules in the auth service
+ if (*cmd.DefaultCmd.Options().Auth).String() == "jwt" {
+ for role, resources := range inauth.SystemRules {
+ for _, res := range resources {
+ if err := (*cmd.DefaultCmd.Options().Auth).Grant(role, res); err != nil {
+ return err
+ }
}
}
} | Only create internal rules for JWT | micro_micro | train | go |
b040085769f0e938ed3f320d6d0110090d2bb97d | diff --git a/javalite-templator/src/main/java/org/javalite/templator/BuiltIn.java b/javalite-templator/src/main/java/org/javalite/templator/BuiltIn.java
index <HASH>..<HASH> 100644
--- a/javalite-templator/src/main/java/org/javalite/templator/BuiltIn.java
+++ b/javalite-templator/src/main/java/org/javalite/templator/BuiltIn.java
@@ -12,7 +12,12 @@ package org.javalite.templator;
*
* <p></p>
*
- * Subclasses must be stateless.
+ * Think of a built-in as a function that will do the last minute formatting of a value before merging it into
+ * a template.
+ *
+ * <p></p>
+ *
+ * <strong>Subclasses must be stateless.</strong>
*
* @author Igor Polevoy on 1/15/15.
*/ | #<I> Implement a built-in function mechanism for MergeTag | javalite_activejdbc | train | java |
0d6305eb24cf601d85df3c060fce718b0b80c087 | diff --git a/django_extensions/management/commands/admin_generator.py b/django_extensions/management/commands/admin_generator.py
index <HASH>..<HASH> 100644
--- a/django_extensions/management/commands/admin_generator.py
+++ b/django_extensions/management/commands/admin_generator.py
@@ -166,7 +166,8 @@ class AdminModel(UnicodeMixin):
def _process_many_to_many(self, meta):
raw_id_threshold = self.raw_id_threshold
for field in meta.local_many_to_many:
- related_objects = field.related.parent_model.objects.all()
+ related_model = getattr(field.related, 'related_model', field.related.model)
+ related_objects = related_model.objects.all()
if(related_objects[:raw_id_threshold].count() < raw_id_threshold):
yield field.name
@@ -181,7 +182,8 @@ class AdminModel(UnicodeMixin):
raw_id_threshold = self.raw_id_threshold
list_filter_threshold = self.list_filter_threshold
max_count = max(list_filter_threshold, raw_id_threshold)
- related_count = field.related.parent_model.objects.all()
+ related_model = getattr(field.related, 'related_model', field.related.model)
+ related_count = related_model.objects.all()
related_count = related_count[:max_count].count()
if related_count >= raw_id_threshold: | Fixed issue with Django <I> | django-extensions_django-extensions | train | py |
321b33d3b6e2bcca11a9ffd462220cca0fb4b757 | diff --git a/public/javascripts/administration.js b/public/javascripts/administration.js
index <HASH>..<HASH> 100644
--- a/public/javascripts/administration.js
+++ b/public/javascripts/administration.js
@@ -331,7 +331,6 @@ function edSpell(which) {
function edToolbar(which) {
document.write('<div id="ed_toolbar_' + which + '" class="btn-toolbar">');
- document.write('<div class="btn-group">');
for (i = 0; i < extendedStart; i++) {
edShowButton(which, edButtons[i], i);
}
@@ -351,7 +350,7 @@ function edToolbar(which) {
edShowButton(which, edButtons[i], i);
}
// edShowLinks();
- document.write('</div></div>');
+ document.write('</div>');
edOpenTags[which] = new Array();
} | Fixes issue #<I>. Used to be visually nicer but I can't do anything else yet. Will come back when we redesign the editor | publify_publify | train | js |
3a2222594bc1c4f31cb5ef5a39b61b047738e359 | diff --git a/spec/refile/test_app.rb b/spec/refile/test_app.rb
index <HASH>..<HASH> 100644
--- a/spec/refile/test_app.rb
+++ b/spec/refile/test_app.rb
@@ -28,7 +28,6 @@ require "capybara/rails"
require "capybara/rspec"
require "refile/spec_helper"
require "refile/active_record_helper"
-require "refile/image_processing"
require "capybara/poltergeist"
if ENV["SAUCE_BROWSER"] | Don’t require image processing in tests | refile_refile | train | rb |
95970524ca715fb1d535a0ec93843e3381589bf3 | diff --git a/mirrormaker/mirror_maker.go b/mirrormaker/mirror_maker.go
index <HASH>..<HASH> 100644
--- a/mirrormaker/mirror_maker.go
+++ b/mirrormaker/mirror_maker.go
@@ -91,7 +91,7 @@ func parseAndValidateArgs() *kafka.MirrorMakerConfig {
config.KeyDecoder = kafka.NewKafkaAvroDecoder(*schemaRegistryUrl)
config.ValueDecoder = kafka.NewKafkaAvroDecoder(*schemaRegistryUrl)
}
- config.Timings = *timingsProducerConfig
+ config.TimingsProducerConfig = *timingsProducerConfig
return config
} | re #<I> added separate producer for timings, added timings producer parameter | elodina_go_kafka_client | train | go |
879fcfd0dd7ce7d75073d3585930fae0eb0b6446 | diff --git a/rb/spec/integration/selenium/client/api/screenshot_spec.rb b/rb/spec/integration/selenium/client/api/screenshot_spec.rb
index <HASH>..<HASH> 100644
--- a/rb/spec/integration/selenium/client/api/screenshot_spec.rb
+++ b/rb/spec/integration/selenium/client/api/screenshot_spec.rb
@@ -13,7 +13,7 @@ describe "Screenshot" do
page.capture_screenshot tempfile
File.exists?(tempfile).should be_true
- File.open(tempfile, "r") do |io|
+ File.open(tempfile, "rb") do |io|
magic = io.read(4)
magic.should == "\211PNG"
end | Encoding fix for RC screenshot spec for Ruby <I> | SeleniumHQ_selenium | train | rb |
fbfdbf7a31dfff585904e90f2ccb0e477bfaa40e | diff --git a/parser.go b/parser.go
index <HASH>..<HASH> 100644
--- a/parser.go
+++ b/parser.go
@@ -146,6 +146,8 @@ func (p *Parser) ParseArgs(args []string) ([]string, error) {
}
if !argumentIsOption(arg) {
+ // Note: this also sets s.err, so we can just check for
+ // nil here and use s.err later
if p.parseNonOption(s) != nil {
break
} | Added clarifying comment for parseNonOption | jessevdk_go-flags | train | go |
fe418f27ad50450ad5608c38d63793d4da12365f | diff --git a/ipyrad/analysis/vcf_to_hdf5.py b/ipyrad/analysis/vcf_to_hdf5.py
index <HASH>..<HASH> 100644
--- a/ipyrad/analysis/vcf_to_hdf5.py
+++ b/ipyrad/analysis/vcf_to_hdf5.py
@@ -75,7 +75,7 @@ class VCFtoHDF5(object):
self.build_chunked_matrix()
# report on new database
- with h5py.File(self.database) as io5:
+ with h5py.File(self.database, 'r') as io5:
self.nscaffolds = io5["snpsmap"][-1, 0]
# self.nlinkagegroups = io5["snpsmap"][-1, 3]
@@ -487,9 +487,9 @@ def get_genos(gstr):
def return_g(gstr, i):
"returns the genotype str from vcf at one position (0/1) -> 0"
gen = gstr.split(":")[0]
- if gen != ".":
- return int(gstr[i])
- else:
+ try:
+ return int(gen[i])
+ except:
return 9 | Fix oops handling missing data in vcf to hdf5 | dereneaton_ipyrad | train | py |
685780d82a0e1f95a17016f8f77495509f76d7e8 | diff --git a/lib/Condorcet/Condorcet.php b/lib/Condorcet/Condorcet.php
index <HASH>..<HASH> 100644
--- a/lib/Condorcet/Condorcet.php
+++ b/lib/Condorcet/Condorcet.php
@@ -739,9 +739,10 @@ class Condorcet
$vote_r['tag'][0] = $this->_nextVoteTag++ ;
// Vote identifiant
+ $tag = $this->tagsConvert($tag);
if ($tag !== null)
{
- $vote_r['tag'] = array_merge($vote_r['tag'], $this->tagsConvert($tag)) ;
+ $vote_r['tag'] = array_merge($vote_r['tag'], $tag) ;
} | Bugfix with custom tag from last commit | julien-boudry_Condorcet | train | php |
2f1dd84f389f5e0bbcbdb8261745f9a21bd90f2e | diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py
index <HASH>..<HASH> 100644
--- a/python/ccxt/base/exchange.py
+++ b/python/ccxt/base/exchange.py
@@ -876,8 +876,8 @@ class Exchange(object):
return _urlencode.unquote(Exchange.urlencode(params))
@staticmethod
- def encode_uri_component(uri):
- return _urlencode.quote(uri, safe="~()*!.'")
+ def encode_uri_component(uri, safe="~()*!.'"):
+ return _urlencode.quote(uri, safe=safe)
@staticmethod
def omit(d, *args): | exchange.py encode_uri_component safe symbols made configurable #<I> | ccxt_ccxt | train | py |
0632ec67777e396e1cccfdec103f49336ea3d766 | diff --git a/src/tad/scripts/request-script-bootstrap.php b/src/tad/scripts/request-script-bootstrap.php
index <HASH>..<HASH> 100644
--- a/src/tad/scripts/request-script-bootstrap.php
+++ b/src/tad/scripts/request-script-bootstrap.php
@@ -5,6 +5,8 @@ include __DIR__ . '/support-functions.php';
include __DIR__ . '/filters.php';
include __DIR__ . '/pluggable-functions-override.php';
+global $argv;
+
$indexFile = $argv[1];
$env = unserialize(base64_decode($argv[2])); | fix(scripts) explicitly define $argv as global | lucatume_wp-browser | train | php |
bd7180fcf9efc6d0695f230cbb02b8a7ba621cfb | diff --git a/daemon/cluster/controllers/plugin/controller.go b/daemon/cluster/controllers/plugin/controller.go
index <HASH>..<HASH> 100644
--- a/daemon/cluster/controllers/plugin/controller.go
+++ b/daemon/cluster/controllers/plugin/controller.go
@@ -34,7 +34,6 @@ type Controller struct {
pluginID string
serviceID string
- taskID string
// hook used to signal tests that `Wait()` is actually ready and waiting
signalWaitReady func() | cluster/controllers/plugin: remove unused Controller.taskID (unused)
```
daemon/cluster/controllers/plugin/controller.go:<I>:2: U<I>: field `taskID` is unused (unused)
``` | moby_moby | train | go |
12e1af0c3dfcada167264faa113f2407a44f2091 | diff --git a/test/bson/test_helper.rb b/test/bson/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/bson/test_helper.rb
+++ b/test/bson/test_helper.rb
@@ -1,5 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'bson')
require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT']
+gem 'test-unit' if RUBY_VERSION > '1.9.0'
require 'test/unit'
def silently
diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,6 +1,7 @@
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT']
require 'mongo'
+gem 'test-unit' if RUBY_VERSION > '1.9.0'
require 'test/unit'
def silently | minor: tests now prefer test-unit gem in ruby <I>.x | mongodb_mongo-ruby-driver | train | rb,rb |
13a05cce7ac5094f5f2c1d58f77b103c0b7db868 | diff --git a/src/picker.js b/src/picker.js
index <HASH>..<HASH> 100644
--- a/src/picker.js
+++ b/src/picker.js
@@ -221,7 +221,7 @@ angular.module("ion-datetime-picker", ["ionic"])
} else
if ($scope.onlyValid.before){
- var beforeDate = createDate($scope.onlyValid.after);
+ var beforeDate = createDate($scope.onlyValid.before);
if ($scope.onlyValid.inclusive) {
isValid = currentDate <= beforeDate; | Fix unable to select before date. | katemihalikova_ion-datetime-picker | train | js |
c1c9eef2864a456e792da5414ee69b0a127cd249 | diff --git a/packages/core/parcel-bundler/src/builtins/hmr-runtime.js b/packages/core/parcel-bundler/src/builtins/hmr-runtime.js
index <HASH>..<HASH> 100644
--- a/packages/core/parcel-bundler/src/builtins/hmr-runtime.js
+++ b/packages/core/parcel-bundler/src/builtins/hmr-runtime.js
@@ -17,7 +17,7 @@ module.bundle.Module = Module;
var parent = module.bundle.parent;
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
var hostname = process.env.HMR_HOSTNAME || location.hostname;
- var protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
+ var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
var ws = new WebSocket(protocol + '://' + hostname + ':' + process.env.HMR_PORT + '/');
ws.onmessage = function(event) {
var data = JSON.parse(event.data); | remove call to window.location (fix #<I>) (#<I>)
Removed call to window.location | parcel-bundler_parcel | train | js |
da9006136b488fd717ab57cd4f671c7fbf628476 | diff --git a/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java b/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java
index <HASH>..<HASH> 100644
--- a/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java
+++ b/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java
@@ -421,9 +421,7 @@ public class JLanguageTool {
* @param ruleId the id of the rule to enable
*/
public void enableRule(String ruleId) {
- if (disabledRules.contains(ruleId)) {
- disabledRules.remove(ruleId);
- }
+ disabledRules.remove(ruleId);
}
/**
@@ -434,9 +432,7 @@ public class JLanguageTool {
* @since 3.3
*/
public void enableRuleCategory(CategoryId id) {
- if (disabledRuleCategories.contains(id)) {
- disabledRuleCategories.remove(id);
- }
+ disabledRuleCategories.remove(id);
}
/** | minor code refactoring
Remove unnecessary check. | languagetool-org_languagetool | train | java |
492e899a4b4f89e4e4a0dd723ed27abbb49d1998 | diff --git a/src/Yaml.php b/src/Yaml.php
index <HASH>..<HASH> 100644
--- a/src/Yaml.php
+++ b/src/Yaml.php
@@ -42,8 +42,6 @@ class Yaml
self::addConfig($content, $resource);
}
-
- //self::$parameters->resolve();
}
}
@@ -95,10 +93,6 @@ class Yaml
protected function addConfig($content, $resource)
{
- if (self::$slim === null) {
- self::$slim = Slim::getInstance();
- }
-
foreach ($content as $key => $value) {
$value = self::$parameters[$resource]->resolveValue($value);
@@ -133,7 +127,10 @@ class Yaml
return $content;
}
- private function __construct() { }
+ private function __construct() {
+ self::$slim = Slim::getInstance();
+ }
+
private function __clone(){}
private function __wakeup(){}
} | Cleaned up code, we now get the Slim instance on construct | techsterx_slim-config-yaml | train | php |
3e5fbc0c8645aaae3f2f528ce53196762a2ed788 | diff --git a/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java b/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java
index <HASH>..<HASH> 100644
--- a/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java
+++ b/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PersistenceUtils.java
@@ -84,7 +84,6 @@ final class PersistenceUtils {
Resource pageResource = resolver.create(parentResource, pageName, props);
props = new HashMap<String, Object>();
props.put(JcrConstants.JCR_PRIMARYTYPE, "cq:PageContent");
- props.put(JcrConstants.JCR_TITLE, pageName);
resolver.create(pageResource, JcrConstants.JCR_CONTENT, props);
}
catch (PersistenceException ex) { | do not store jcr:title for page | wcm-io_wcm-io-caconfig | train | java |
8b286dbf789a4112069547743a4dccd281d952eb | diff --git a/src/host/browser.js b/src/host/browser.js
index <HASH>..<HASH> 100644
--- a/src/host/browser.js
+++ b/src/host/browser.js
@@ -3,7 +3,6 @@
/*global _GPF_HOST_BROWSER*/ // gpf.HOST_BROWSER
/*global _gpfHost*/ // Host type
/*global _gpfExit:true*/ // Exit function
-/*global _gpfMainContext:true*/ // Main context object
/*global _gpfInBrowser:true*/ // The current host is a browser like
/*#endif*/
@@ -12,7 +11,6 @@
if (_GPF_HOST_BROWSER === _gpfHost) {
- _gpfMainContext = window;
_gpfInBrowser = true;
_gpfExit = function (code) {
window.location = "https://arnaudbuchholz.github.io/gpf/exit.html?" + (code || 0); | Appears to be useless (done in boot) | ArnaudBuchholz_gpf-js | train | js |
32785118b5f58f39ea56486b204a2807a2a8f5fb | diff --git a/app/assets/javascripts/sufia/batch_select_all.js b/app/assets/javascripts/sufia/batch_select_all.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/sufia/batch_select_all.js
+++ b/app/assets/javascripts/sufia/batch_select_all.js
@@ -5,10 +5,10 @@
var n = $(".batch_toggle:checked").length;
if ((n>0) || (forceOn)) {
$('.batch-select-all').show();
- $('.button_to').show();
+ $('#batch-edit').show();
} else if ( otherPage){
$('.batch-select-all').hide();
- $('.button_to').hide();
+ $('#batch-edit').hide();
}
$("body").css("cursor", "auto");
} | Changing to not use .button_to to hide show the batch edit button so that other button_to will still show | samvera_hyrax | train | js |
38befcbbf9dee0c20b8539a1655a2e02dfb29f37 | diff --git a/src/modal/modal.js b/src/modal/modal.js
index <HASH>..<HASH> 100644
--- a/src/modal/modal.js
+++ b/src/modal/modal.js
@@ -275,7 +275,7 @@ function Modal(api)
}
// Undelegate focus handler
- docBody.undelegate('*', 'focusin'+namespace);
+ docBody.unbind('focusin'+namespace);
}
// Remove bound events | fixed issue with modal stealing input even after it is destroyed | qTip2_qTip2 | train | js |
2c4e48b301ddef1ea26454a694220d56c98a644f | diff --git a/dist.py b/dist.py
index <HASH>..<HASH> 100644
--- a/dist.py
+++ b/dist.py
@@ -16,6 +16,7 @@ from distutils.errors import *
from distutils.fancy_getopt import FancyGetopt, translate_longopt
from distutils.util import check_environ, strtobool, rfc822_escape
from distutils import log
+from distutils.core import DEBUG
# Regex to define acceptable Distutils command names. This is not *quite*
# the same as a Python NAME -- I don't allow leading underscores. The fact
@@ -305,7 +306,6 @@ class Distribution:
def parse_config_files (self, filenames=None):
from ConfigParser import ConfigParser
- from distutils.core import DEBUG
if filenames is None:
filenames = self.find_config_files()
@@ -771,7 +771,6 @@ class Distribution:
object for 'command' is in the cache, then we either create and
return it (if 'create' is true) or return None.
"""
- from distutils.core import DEBUG
cmd_obj = self.command_obj.get(command)
if not cmd_obj and create:
if DEBUG:
@@ -802,8 +801,6 @@ class Distribution:
supplied, uses the standard option dictionary for this command
(from 'self.command_options').
"""
- from distutils.core import DEBUG
-
command_name = command_obj.get_command_name()
if option_dict is None:
option_dict = self.get_option_dict(command_name) | Use module-level import of DEBUG instead of many function-level imports. | pypa_setuptools | train | py |
cb55ec530bef94f44b459d97f8984a24b21c772a | diff --git a/core.js b/core.js
index <HASH>..<HASH> 100644
--- a/core.js
+++ b/core.js
@@ -73,6 +73,9 @@ var ffi = require('node-ffi')
})
, msgSendCache = {}
+// export core to the struct module
+require('./struct')._core = exports;
+
exports.__proto__ = objc;
// Expose `node-ffi` stuff so we don't have to require node-ffi elsewhere | Export core.js to the Struct module. | TooTallNate_NodObjC | train | js |
eb586dc1dfbe44456431ab4953cef007b90ae79e | diff --git a/db/seeds/main.go b/db/seeds/main.go
index <HASH>..<HASH> 100644
--- a/db/seeds/main.go
+++ b/db/seeds/main.go
@@ -59,6 +59,7 @@ var (
&models.Setting{},
&adminseo.MySEOSetting{},
&models.Article{},
+ &models.MediaLibrary{},
&asset_manager.AssetManager{},
&i18n_database.Translation{}, | seed: auto migrate media_library tables | qor_qor-example | train | go |
be5cf79679f4ab3acfdc4d139e262ca236cfdbb2 | diff --git a/js/ftx.js b/js/ftx.js
index <HASH>..<HASH> 100644
--- a/js/ftx.js
+++ b/js/ftx.js
@@ -1514,9 +1514,6 @@ module.exports = class ftx extends Exchange {
if (marketId !== undefined) {
request['market'] = marketId;
}
- if (limit !== undefined) {
- request['limit'] = limit;
- }
if (since !== undefined) {
request['start_time'] = parseInt (since / 1000);
request['end_time'] = this.seconds (); | ftx fetchMyTrades removed limit from the query fix #<I> | ccxt_ccxt | train | js |
574b3bf70dd0530d5109cd5e814e42a3a392f049 | diff --git a/setuptools_rust/tomlgen.py b/setuptools_rust/tomlgen.py
index <HASH>..<HASH> 100644
--- a/setuptools_rust/tomlgen.py
+++ b/setuptools_rust/tomlgen.py
@@ -128,6 +128,11 @@ class tomlgen_rust(setuptools.Command):
# The directory where the extension's manifest is located
tomldir = os.path.dirname(ext.path)
+ # If the RustExtension was not created by `find_rust_extensions`
+ # the `lib.rs` file is expected to be located near `Cargo.toml`
+ if not hasattr(ext, 'libfile'):
+ ext.libfile = ext.path.replace('Cargo.toml', 'lib.rs')
+
# Create a small package section
toml.add_section("package")
toml.set("package", "name", quote(ext.name)) | Make sure `tomlgen_rust` works for manually defined extensions | PyO3_setuptools-rust | train | py |
0aacaa91669f769d9096a5cbf3761b4da1dd4ef7 | diff --git a/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php b/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
+++ b/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
@@ -142,7 +142,7 @@ class CreateSchemaSqlCollector extends AbstractVisitor
foreach (array_keys($this->createTableQueries) as $namespace) {
if ($this->platform->supportsSchemas() && $this->platform->schemaNeedsCreation($namespace)) {
$query = $this->platform->getCreateSchemaSQL($namespace);
- array_push($sql, $query);
+ $sql[] = $query;
}
} | Remove instance of array_push() | doctrine_dbal | train | php |
f759ab272da4a9bd3b9a2d64e4ff6cacebcc100c | diff --git a/art/decor_dic.py b/art/decor_dic.py
index <HASH>..<HASH> 100644
--- a/art/decor_dic.py
+++ b/art/decor_dic.py
@@ -1,2 +1,5 @@
# -*- coding: utf-8 -*-
"""Decorations data."""
+wave1 = "▁ ▂ ▄ ▅ ▆ ▇ █"
+chess1 = "▀▄▀▄▀▄"
+barcode1 = "▌│█║▌║▌║ "
\ No newline at end of file | add : new decorations added to decor_dic.py | sepandhaghighi_art | train | py |
d2a5f381b47c61ef9259f6ebf415c0eaaf8cc7fc | diff --git a/api/product_server.go b/api/product_server.go
index <HASH>..<HASH> 100644
--- a/api/product_server.go
+++ b/api/product_server.go
@@ -31,7 +31,7 @@ func (api *ProductServerAPI) GetBySpec(core, memGB int, gen sacloud.PlanGenerati
// GetBySpecCommitment 指定のコア数/メモリサイズ/世代のプランを取得
func (api *ProductServerAPI) GetBySpecCommitment(core, memGB int, gen sacloud.PlanGenerations, commitment sacloud.ECommitment) (*sacloud.ProductServer, error) {
- plans, err := api.Reset().Find()
+ plans, err := api.Reset().Limit(1000).Find()
if err != nil {
return nil, err
} | Fix GetBySpecCommitment - set search limit to <I> | sacloud_libsacloud | train | go |
e9e42c1e764c1c08e5df56400a687969f899f63c | diff --git a/bookshelf/api_v1.py b/bookshelf/api_v1.py
index <HASH>..<HASH> 100644
--- a/bookshelf/api_v1.py
+++ b/bookshelf/api_v1.py
@@ -1,4 +1,4 @@
-# vim: ai ts=4 sts=4 et sw=4 ft=python fdm=indent et foldlevel=0
+# vim: ai ts=4 sts=4 et sw=4 ft=python fdm=indent et
import boto.ec2
import json | don't autofold on vim | pyBookshelf_bookshelf | train | py |
c0ac3913a129ab6a60f1445edcac271c63ff7d29 | diff --git a/pkg/utils/hwaddr/hwaddr_test.go b/pkg/utils/hwaddr/hwaddr_test.go
index <HASH>..<HASH> 100644
--- a/pkg/utils/hwaddr/hwaddr_test.go
+++ b/pkg/utils/hwaddr/hwaddr_test.go
@@ -42,6 +42,10 @@ var _ = Describe("Hwaddr", func() {
ip: net.ParseIP("172.17.0.2"),
expectedMAC: (net.HardwareAddr)(append(hwaddr.PrivateMACPrefix, 0xac, 0x11, 0x00, 0x02)),
},
+ {
+ ip: net.IPv4(byte(172), byte(17), byte(0), byte(2)),
+ expectedMAC: (net.HardwareAddr)(append(hwaddr.PrivateMACPrefix, 0xac, 0x11, 0x00, 0x02)),
+ },
}
for _, tc := range testCases { | pkg/utils/hwaddr tests: cover v4 in v6 addr | containernetworking_cni | train | go |
7f269b61f81258e370281d4e72fae808ed2d908c | diff --git a/runtests.py b/runtests.py
index <HASH>..<HASH> 100755
--- a/runtests.py
+++ b/runtests.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import os
import sys
+import warnings
import django
from django.conf import settings
@@ -47,6 +48,7 @@ def runtests():
MIDDLEWARE_CLASSES=(),
)
+ warnings.simplefilter('always', DeprecationWarning)
if django.VERSION >= (1, 7):
django.setup()
failures = call_command( | Added DeprecationWarning display. | deschler_django-modeltranslation | train | py |
f25167802a7c2ca1c2488b34a05ef283bf85c876 | diff --git a/tests/integration/shell/key.py b/tests/integration/shell/key.py
index <HASH>..<HASH> 100644
--- a/tests/integration/shell/key.py
+++ b/tests/integration/shell/key.py
@@ -33,16 +33,9 @@ class KeyTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
'''
data = self.run_key('-L --json-out')
expect = [
- '{',
- ' "unaccepted": [], ',
- ' "accepted": [',
- ' "minion", ',
- ' "sub_minion"',
- ' ], ',
- ' "rejected": []',
- '}',
+ '{"unaccepted": [], "accepted": ["minion", "sub_minion"], "rejected": []}',
''
- ]
+ ]
self.assertEqual(data, expect)
def test_list_yaml_out(self): | fix test that broke because of output changes | saltstack_salt | train | py |
77c9ac177d4b61338df31ff9921fcb2827043aa5 | diff --git a/yoke/deploy.py b/yoke/deploy.py
index <HASH>..<HASH> 100644
--- a/yoke/deploy.py
+++ b/yoke/deploy.py
@@ -262,4 +262,7 @@ class Deployment(object):
def _format_vpc_config(self):
# todo(ryandub): Add VPC support
- return {}
+ return {
+ 'SecurityGroupIds': [],
+ 'SubnetIds': [],
+ } | Update VpcConfig format
AWS introduced a bug to the Lambda API that resulted in error messages
if VpcConfig was passed as an empty dict. Adding the SecurityGroupIds
and SubnetIds as empty arrays should workaround this bug. See
<URL> | rackerlabs_yoke | train | py |
43f1486fd53c6820b03212866cbcbbf90efe953b | diff --git a/test/gateway.go b/test/gateway.go
index <HASH>..<HASH> 100644
--- a/test/gateway.go
+++ b/test/gateway.go
@@ -5,27 +5,18 @@ package test
import jwt "github.com/dgrijalva/jwt-go"
-type location struct {
- Longitude float64 `json:"lng"`
- Latitude float64 `json:"lat"`
-}
-
// GatewayClaims creates a jwt.Claims that represents the gateway
-func GatewayClaims(id, frequencyPlan string, lat, lng float64, locationPublic, statusPublic bool) jwt.Claims {
+func GatewayClaims(id, locationPublic, statusPublic bool) jwt.Claims {
return jwt.MapClaims{
"iss": Issuer,
"sub": id,
- "frequency_plan": frequencyPlan,
+ "type": "gateway",
"location_public": locationPublic,
"status_public": statusPublic,
- "location": location{
- Longitude: lng,
- Latitude: lat,
- },
}
}
// GatewayToken creates a token that is singed by PrivateKey, and has the GatewayClaims
-func GatewayToken(id, frequencyPlan string, lat, lng float64, locationPublic, statusPublic bool) string {
- return TokenFromClaims(GatewayClaims(id, frequencyPlan, lat, lng, locationPublic, statusPublic))
+func GatewayToken(id, locationPublic, statusPublic bool) string {
+ return TokenFromClaims(GatewayClaims(id, locationPublic, statusPublic))
} | Reduce the number of things in gateway claims | TheThingsNetwork_go-account-lib | train | go |
6c3968f3336e08faeea174ad555dc09ad9a5dd0e | diff --git a/src/main/java/org/primefaces/component/autocomplete/AutoCompleteRenderer.java b/src/main/java/org/primefaces/component/autocomplete/AutoCompleteRenderer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/component/autocomplete/AutoCompleteRenderer.java
+++ b/src/main/java/org/primefaces/component/autocomplete/AutoCompleteRenderer.java
@@ -366,8 +366,9 @@ public class AutoCompleteRenderer extends InputRenderer {
writer.writeAttribute("name", inputId, null);
writer.writeAttribute("autocomplete", "off", null);
if(disabled) writer.writeAttribute("disabled", "disabled", "disabled");
- if(tabindex != null) writer.writeAttribute("tabindex", tabindex, null);
- if(ac.getMaxlength() != Integer.MIN_VALUE)writer.writeAttribute("maxlength", ""+ac.getMaxlength(),null);
+
+ renderPassThruAttributes(context, ac, HTML.INPUT_TEXT_ATTRS_WITHOUT_EVENTS);
+ renderDomEvents(context, ac, HTML.INPUT_TEXT_EVENTS);
writer.endElement("input");
writer.endElement("li"); | Added events and attributes to multi autocomplete | primefaces_primefaces | train | java |
6279b5a40b7e9260e0b644c466545c005eefe226 | diff --git a/lib/ronin/cache/extension_cache.rb b/lib/ronin/cache/extension_cache.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/cache/extension_cache.rb
+++ b/lib/ronin/cache/extension_cache.rb
@@ -37,7 +37,7 @@ module Ronin
hash[name] = load_extension(key.to_s)
end
- catch('EXIT') do
+ at_exit do
each_extension { |ext| ext.perform_teardown }
end | Use at_exit instead of catch. | ronin-ruby_ronin | train | rb |
fb72bcd1b8feee4bc54be2314e303e941a2d252f | diff --git a/tasks/yabs.js b/tasks/yabs.js
index <HASH>..<HASH> 100644
--- a/tasks/yabs.js
+++ b/tasks/yabs.js
@@ -136,7 +136,7 @@ module.exports = function(grunt) {
grunt.verbose.writeln('Running: ' + cmd);
var result = shell.exec(cmd, {silent: silent});
if (extra.checkResultCode !== false && result.code !== 0) {
- grunt.fail.warn('Error (' + result.code + ') ' + result.output);
+ grunt.fail.warn('exec(' + cmd + ') failed with code ' + result.code + ':\n' + result.output);
}else{
return result;
} | Improve log for exec faults | mar10_grunt-yabs | train | js |
876c2c1ee26a40de4ec3620da7913f6b916589aa | diff --git a/examples/js/examples/basic-bars-stacked.js b/examples/js/examples/basic-bars-stacked.js
index <HASH>..<HASH> 100644
--- a/examples/js/examples/basic-bars-stacked.js
+++ b/examples/js/examples/basic-bars-stacked.js
@@ -10,7 +10,8 @@ Flotr.ExampleList.add({
key : 'basic-stacked-horizontal',
name : 'Stacked Horizontal Bars',
args : [true],
- callback : bars_stacked
+ callback : bars_stacked,
+ tolerance : 5
});
function bars_stacked (container, horizontal) {
diff --git a/examples/js/examples/basic-bars.js b/examples/js/examples/basic-bars.js
index <HASH>..<HASH> 100644
--- a/examples/js/examples/basic-bars.js
+++ b/examples/js/examples/basic-bars.js
@@ -10,7 +10,8 @@ Flotr.ExampleList.add({
key : 'basic-bars-horizontal',
name : 'Horizontal Bars',
args : [true],
- callback : basic_bars
+ callback : basic_bars,
+ tolerance : 5
});
function basic_bars (container, horizontal) { | Added small tolerance to bars to pass tests after transformations. | HumbleSoftware_Flotr2 | train | js,js |
a93d72ccfb18e460081bf18fe59af4ff97e3b95a | diff --git a/examples/using-jquery-for-ajax.js b/examples/using-jquery-for-ajax.js
index <HASH>..<HASH> 100644
--- a/examples/using-jquery-for-ajax.js
+++ b/examples/using-jquery-for-ajax.js
@@ -26,15 +26,6 @@ var v1 = new v1sdk.V1Meta({
headers: headerObj, // Include provided authorization headers { Authorization: 'Basic: .....' }
dataType: 'json' // SDK only supports JSON from the V1 Server
});
- },
- get: function (url, data) {
- return $.ajax({
- url: url,
- method: 'GET',
- data: data,
- dataType: 'json' // SDK only supports JSON from the V1 Server
-
- });
}
}); | Update the documentation to reflect the changes in removing get param to the V1Meta constructor. | versionone_VersionOne.SDK.JavaScript | train | js |
487da84d8764300e1218601480e0be2020c020fa | diff --git a/mlbgame/__init__.py b/mlbgame/__init__.py
index <HASH>..<HASH> 100644
--- a/mlbgame/__init__.py
+++ b/mlbgame/__init__.py
@@ -228,8 +228,9 @@ def game_events(game_id):
return [mlbgame.events.Inning(data[x], x) for x in data]
-def important_dates(year=datetime.now().year):
+def important_dates(year=None):
"""Return ImportantDates object that contains MLB important dates"""
+ year = datetime.now().year if not year else year
data = mlbgame.info.important_dates(year)
return mlbgame.info.ImportantDates(data) | Don't calculate year at import time | panzarino_mlbgame | train | py |
700274270b909ee8ff716e760c2473cd7ed734f1 | diff --git a/tests/test_web_websocket_functional.py b/tests/test_web_websocket_functional.py
index <HASH>..<HASH> 100644
--- a/tests/test_web_websocket_functional.py
+++ b/tests/test_web_websocket_functional.py
@@ -41,7 +41,7 @@ class TestWebWebSocketFunctional(unittest.TestCase):
return app, srv, url
@asyncio.coroutine
- def connect_ws(self, url, protocol='chat'):
+ def connect_ws(self, url, protocol=''):
sec_key = base64.b64encode(os.urandom(16))
conn = aiohttp.TCPConnector(loop=self.loop) | Cleanup tests: drop extra warning about chat websocket protocol | aio-libs_aiohttp | train | py |
414ec66097b7cfdc354eaf413650baf7171610bd | diff --git a/drools-core/src/main/java/org/drools/common/DefaultAgenda.java b/drools-core/src/main/java/org/drools/common/DefaultAgenda.java
index <HASH>..<HASH> 100644
--- a/drools-core/src/main/java/org/drools/common/DefaultAgenda.java
+++ b/drools-core/src/main/java/org/drools/common/DefaultAgenda.java
@@ -1410,7 +1410,7 @@ public class DefaultAgenda
try {
this.knowledgeHelper.setActivation( activation );
- System.out.println( activation.getRule().getName() );
+ //System.out.println( activation.getRule().getName() );
activation.getConsequence().evaluate( this.knowledgeHelper,
this.workingMemory );
this.knowledgeHelper.cancelRemainingPreviousLogicalDependencies(); | Removing spurious System.out | kiegroup_drools | train | java |
a9351cf7938edaf1bbd87c81b534e27bf1f00b13 | diff --git a/barf/barf/barf.py b/barf/barf/barf.py
index <HASH>..<HASH> 100644
--- a/barf/barf/barf.py
+++ b/barf/barf/barf.py
@@ -145,6 +145,7 @@ class BARF(object):
self.smt_translator = SmtTranslator(self.smt_solver, self.arch_info.address_size)
self.ir_emulator.set_arch_registers(self.arch_info.registers_gp_all)
+ self.ir_emulator.set_arch_flags(self.arch_info.registers_flags)
self.ir_emulator.set_arch_registers_size(self.arch_info.registers_size)
self.ir_emulator.set_arch_alias_mapper(self.arch_info.alias_mapper) | Fix missing emulator native flags set up. | programa-stic_barf-project | train | py |
3bc63b9229d8dadfa237340eaabc606f88716446 | diff --git a/libraries/TeamSpeak3/Node/Client.php b/libraries/TeamSpeak3/Node/Client.php
index <HASH>..<HASH> 100644
--- a/libraries/TeamSpeak3/Node/Client.php
+++ b/libraries/TeamSpeak3/Node/Client.php
@@ -324,6 +324,8 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
$groups[] = $this->getParent()->serverGroupGetById($sgid);
}
+ uasort($groups, array(__CLASS__, "sortGroupList"));
+
return $groups;
} | sort client groups in memberOf() | planetteamspeak_ts3phpframework | train | php |
960111adcff51a9ae846510c6844ee173ff07a56 | diff --git a/dwave/system/package_info.py b/dwave/system/package_info.py
index <HASH>..<HASH> 100644
--- a/dwave/system/package_info.py
+++ b/dwave/system/package_info.py
@@ -14,7 +14,7 @@
__all__ = ['__version__', '__author__', '__authoremail__', '__description__']
-__version__ = '1.6.0.dev0'
+__version__ = '1.6.0'
__author__ = 'D-Wave Systems Inc.'
__authoremail__ = 'acondello@dwavesys.com'
__description__ = 'All things D-Wave System.' | Release <I>
Fixes
---
- Updated sphinx and docs conf (#<I>)
- Documented samplers async behavior (#<I>)
- Added more properties to `MockDWaveSampler` (#<I>)
- CI refactored; leaner integration tests (#<I>)
Changes
---
- Dropped Python <I> support (#<I>) | dwavesystems_dwave-system | train | py |
ad97d8a8d33bbfeda47677089737014468677551 | diff --git a/lib/dm-core/query.rb b/lib/dm-core/query.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-core/query.rb
+++ b/lib/dm-core/query.rb
@@ -625,7 +625,9 @@ module DataMapper
properties = Set.new
each_comparison do |comparison|
- properties << comparison.subject if comparison.subject.kind_of?(Property)
+ next unless comparison.respond_to?(:subject)
+ subject = comparison.subject
+ properties << subject if subject.kind_of?(Property)
end
properties | Filter out non-comparison objects from Query#condition_properties | datamapper_dm-core | train | rb |
a494c36e0312b977c2e8bd0c99032f1aefcf3443 | diff --git a/spec/mongoid/tree_spec.rb b/spec/mongoid/tree_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mongoid/tree_spec.rb
+++ b/spec/mongoid/tree_spec.rb
@@ -32,7 +32,7 @@ describe Mongoid::Tree do
describe 'when new' do
it "should not require a saved parent when adding children" do
root = Node.new(:name => 'root'); child = Node.new(:name => 'child')
- expect { root.children << child; root.save! }.to_not raise_error(Mongoid::Errors::DocumentNotFound)
+ expect { root.children << child; root.save! }.to_not raise_error
child.should be_persisted
end
@@ -409,7 +409,7 @@ describe Mongoid::Tree do
it 'should not raise a NoMethodError' do
node = NodeWithEmbeddedDocument.new
document = node.build_embedded_document
- expect { node.save }.to_not raise_error NoMethodError
+ expect { node.save }.to_not raise_error
end
end | Removes specific error classes from .not_to raise_error expectations | benedikt_mongoid-tree | train | rb |
56669a8f1cd8b82acff27dcad0e30677f51d8c9b | diff --git a/experimental/plugins/Imexam.py b/experimental/plugins/Imexam.py
index <HASH>..<HASH> 100644
--- a/experimental/plugins/Imexam.py
+++ b/experimental/plugins/Imexam.py
@@ -154,8 +154,6 @@ class Imexam(GingaPlugin.LocalPlugin):
hbox.add_widget(Widgets.Label(''), stretch=1)
top.add_widget(hbox, stretch=0)
- top.add_widget(hbox, stretch=0)
-
hbox = Widgets.HBox()
lbl = Widgets.Label("Keys active:")
hbox.add_widget(lbl)
@@ -237,7 +235,6 @@ class Imexam(GingaPlugin.LocalPlugin):
def start(self):
self.instructions()
- # start ruler drawing operation
p_canvas = self.fitsimage.get_canvas()
if not p_canvas.has_object(self.canvas):
p_canvas.add(self.canvas, tag=self.layertag) | Fixed an issue with adding a widget twice into a container | ejeschke_ginga | train | py |
3ffff99e0c36d98aa394266864471035c1a50f9c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
setup(name='botometer',
- version='1.4',
+ version='1.5',
description='Check Twitter accounts for bot behavior',
url='https://github.com/IUNetSci/botometer-python',
download_url='https://github.com/IUNetSci/botometer-python/archive/1.0.zip', | Bump botometer-python version | IUNetSci_botometer-python | train | py |
bb7555e2bdf47ff39c49c07bf9772141afb53248 | diff --git a/werkzeug/wrappers.py b/werkzeug/wrappers.py
index <HASH>..<HASH> 100644
--- a/werkzeug/wrappers.py
+++ b/werkzeug/wrappers.py
@@ -550,7 +550,7 @@ class BaseRequest(object):
@cached_property
def url(self):
- """The reconstructed current URL"""
+ """The reconstructed current URL as IRI."""
return get_current_url(self.environ,
trusted_hosts=self.trusted_hosts)
@@ -562,13 +562,15 @@ class BaseRequest(object):
@cached_property
def url_root(self):
- """The full URL root (with hostname), this is the application root."""
+ """The full URL root (with hostname), this is the application
+ root as IRI.
+ """
return get_current_url(self.environ, True,
trusted_hosts=self.trusted_hosts)
@cached_property
def host_url(self):
- """Just the host with scheme."""
+ """Just the host with scheme as IRI."""
return get_current_url(self.environ, host_only=True,
trusted_hosts=self.trusted_hosts) | Documented URLs being IRIs in wrappers. | pallets_werkzeug | train | py |
14ec578cef7ffb4d9ee752f181e4d635ec74a17c | diff --git a/scripts/release.js b/scripts/release.js
index <HASH>..<HASH> 100644
--- a/scripts/release.js
+++ b/scripts/release.js
@@ -115,10 +115,8 @@ const release = async () => {
'--dist-tag',
distTag
]
- // keep packages' minor version in sync
- if (releaseType !== 'patch') {
- lernaArgs.push('--force-publish')
- }
+ // keep all packages' versions in sync
+ lernaArgs.push('--force-publish')
if (cliOptions['local-registry']) {
lernaArgs.push('--no-git-tag-version', '--no-commit-hooks', '--no-push', '--yes') | workflow: keep all packages' versions in sync to reduce cognitive load | vuejs_vue-cli | train | js |
5b3da03bceb2969f2788608dbd70f883f31eb36e | diff --git a/avatar/views.py b/avatar/views.py
index <HASH>..<HASH> 100644
--- a/avatar/views.py
+++ b/avatar/views.py
@@ -95,6 +95,7 @@ def img(request, email_hash, resize_method=Image.ANTIALIAS):
def change(request, extra_context={}, next_override=None):
if request.method == "POST":
dirname = os.path.join(settings.MEDIA_ROOT, 'avatars')
+ os.makedirs(dirname)
filename = "%s.jpg" % request.user.avatar.email_hash
full_filename = os.path.join(dirname, filename)
(destination, destination_path) = tempfile.mkstemp() | Make sure to make the directories before uploading, too.
git-svn-id: <URL> | GeoNode_geonode-avatar | train | py |
1f7407ed3f20098cfcfc8bbbc86dd58b201c0e80 | diff --git a/archivex.go b/archivex.go
index <HASH>..<HASH> 100644
--- a/archivex.go
+++ b/archivex.go
@@ -296,18 +296,18 @@ func (t *TarFile) AddAll(dir string, includeCurrentFolder bool) error {
// Close the file Tar
func (t *TarFile) Close() error {
+ err := t.Writer.Close()
+ if err != nil {
+ return err
+ }
+
if t.Compressed {
- err := t.GzWriter.Close()
+ err = t.GzWriter.Close()
if err != nil {
return err
}
}
- err := t.Writer.Close()
- if err != nil {
- return err
- }
-
return err
} | the file was being closed in the wrong order | jhoonb_archivex | train | go |
5d1eeb7e16a905ab333e153c5871351bbff6d8c7 | diff --git a/memcache/memcache_test.go b/memcache/memcache_test.go
index <HASH>..<HASH> 100644
--- a/memcache/memcache_test.go
+++ b/memcache/memcache_test.go
@@ -113,6 +113,12 @@ func testWithClient(t *testing.T, c *Client) {
t.Errorf("get(foo) Flags = %v, want 123", it.Flags)
}
+ // Get non-existant
+ _, err = c.Get("not-exists")
+ if err != ErrCacheMiss {
+ t.Errorf("get(not-exists): expecting %v, got %v instead", ErrCacheMiss, err)
+ }
+
// Add
bar := &Item{Key: "bar", Value: []byte("barval")}
err = c.Add(bar) | In tests, check that getting a non-existant key works | rainycape_memcache | train | go |
dbee38e30e90e0d0165b1c42a47af699665cb02a | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -26,11 +26,12 @@ module.exports = function (onSelect) {
})
if(''+sel === ''+selection) return
d.selected = selection = sel
+ if(onSelect) onSelect(selection)
return sel
}
var d = h('div.hypertabs.column', Menu(content, function () {
- getSelection() && onSelect && onSelect(selection)
+ getSelection()
}), h('div.column', content))
var selection = d.selected = []
@@ -92,3 +93,4 @@ module.exports = function (onSelect) {
+ | always call onSelect when the selection changes | hyperhype_hypertabs | train | js |
c1edc6daef65231c61f1030f16f44e5172f4f63c | diff --git a/js/browser.js b/js/browser.js
index <HASH>..<HASH> 100644
--- a/js/browser.js
+++ b/js/browser.js
@@ -1738,6 +1738,7 @@ Browser.prototype.realMakeTier = function(source) {
this.tierHolder.appendChild(viewport);
this.tiers.push(tier); // NB this currently tells any extant knownSpace about the new tier.
this.refreshTier(tier);
+ this.arrangeTiers();
}
Browser.prototype.removeTier = function(tier) {
diff --git a/js/tier.js b/js/tier.js
index <HASH>..<HASH> 100644
--- a/js/tier.js
+++ b/js/tier.js
@@ -19,7 +19,7 @@ function DasTier(browser, source, viewport, background)
this.viewport = viewport;
this.background = background;
this.req = null;
- this.layoutHeight = 50;
+ this.layoutHeight = 25;
this.bumped = true;
if (this.dasSource.collapseSuperGroups) {
this.bumped = false; | Ensure newly-added tiers show up even if it takes a while for the data to arrive. | dasmoth_dalliance | train | js,js |
cde446df030f49bdaf1e5949d51387c2d7a2be61 | diff --git a/src/api/http/api.go b/src/api/http/api.go
index <HASH>..<HASH> 100644
--- a/src/api/http/api.go
+++ b/src/api/http/api.go
@@ -89,7 +89,7 @@ func (self *HttpServer) registerEndpoint(p *pat.PatternServeMux, method string,
version := self.clusterConfig.GetLocalConfiguration().Version
switch method {
case "get":
- p.Get(pattern, HeaderHandler(f, version))
+ p.Get(pattern, CompressionHeaderHandler(f, version))
case "post":
p.Post(pattern, HeaderHandler(f, version))
case "del": | Enable compression on all GET requests | influxdata_influxdb | train | go |
f7fe6466a8efe94915a0933a340ff087972ff8cf | diff --git a/util.go b/util.go
index <HASH>..<HASH> 100644
--- a/util.go
+++ b/util.go
@@ -335,8 +335,7 @@ func CheckSha256(filePath, expectedSha256 string) error {
}
func downloadFile(url, destFile string) error {
- client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyFromEnvironment}}
- resp, err := client.Get(url)
+ resp, err := http.Get(url)
if err != nil {
return err
} | Revert to using http.Get whose default client respects proxy settings | cloudfoundry_libbuildpack | train | go |
0d28869e77d47d7d8b42a1b3adda389bc3b809af | diff --git a/lib/qunited/runner.rb b/lib/qunited/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/qunited/runner.rb
+++ b/lib/qunited/runner.rb
@@ -1,9 +1,12 @@
module QUnited
class Runner
+
+ # The drivers in order of which to use first when not otherwise specified
+ DRIVERS = [:PhantomJs, :Rhino].map { |driver| ::QUnited::Driver.const_get(driver) }.freeze
+
def self.run(js_source_files, js_test_files)
- js_runner_klass = self.js_runner
- # TODO: test that this JsRunner can run with current environment
- runner = js_runner_klass.new(js_source_files, js_test_files)
+ driver_class = self.best_available_driver
+ runner = driver_class.new(js_source_files, js_test_files)
puts "\n# Running JavaScript tests with #{runner.name}:\n\n"
@@ -13,11 +16,8 @@ module QUnited
end
# Get the runner that we will be using to run the JavaScript tests.
- #
- # Right now we only have one JavaScript runner, but when we have multiple we will have to
- # determine which one we will used unless explicitly configured.
- def self.js_runner
- ::QUnited::JsRunner::Rhino
+ def self.best_available_driver
+ DRIVERS.find { |driver| driver.available? }
end
end
end | Added PhantomJS as a priority driver over Rhino | aaronroyer_qunited | train | rb |
e102b76c058dd05c7f1e4d32ad5d76714fd6e5a3 | diff --git a/troposphere/cloudwatch.py b/troposphere/cloudwatch.py
index <HASH>..<HASH> 100644
--- a/troposphere/cloudwatch.py
+++ b/troposphere/cloudwatch.py
@@ -3,7 +3,7 @@
#
# See LICENSE file for full license.
-from . import AWSObject, AWSProperty
+from . import AWSObject, AWSProperty, Tags
from .validators import (boolean, double, exactly_one, json_checker,
positive_integer, integer)
@@ -156,6 +156,7 @@ class InsightRule(AWSObject):
'RuleBody': (basestring, True),
'RuleName': (basestring, True),
'RuleState': (basestring, True),
+ 'Tags': (Tags, False),
} | Adding AWS::CloudWatch::InsightRule props, per April 2, <I> update | cloudtools_troposphere | train | py |
30d9fd9b00e2f2cb62aefae1e5ebc9d69ee326d5 | diff --git a/juju/osenv/home.go b/juju/osenv/home.go
index <HASH>..<HASH> 100644
--- a/juju/osenv/home.go
+++ b/juju/osenv/home.go
@@ -49,15 +49,15 @@ func JujuHomePath(names ...string) string {
// JujuHome returns the directory where juju should store application-specific files
func JujuHomeDir() string {
- JujuHomeEnvKey := os.Getenv(JujuHomeEnvKey)
- if JujuHomeEnvKey == "" {
+ JujuHomeDir := os.Getenv(JujuHomeEnvKey)
+ if JujuHomeDir == "" {
if runtime.GOOS == "windows" {
- JujuHomeEnvKey = jujuHomeWin()
+ JujuHomeDir = jujuHomeWin()
} else {
- JujuHomeEnvKey = jujuHomeLinux()
+ JujuHomeDir = jujuHomeLinux()
}
}
- return JujuHomeEnvKey
+ return JujuHomeDir
}
// jujuHomeLinux returns the directory where juju should store application-specific files on Linux.
diff --git a/utils/apt.go b/utils/apt.go
index <HASH>..<HASH> 100644
--- a/utils/apt.go
+++ b/utils/apt.go
@@ -11,8 +11,9 @@ import (
"regexp"
"strings"
- "launchpad.net/juju-core/juju/osenv"
"launchpad.net/loggo"
+
+ "launchpad.net/juju-core/juju/osenv"
)
var ( | Made changes from axw's review. | juju_juju | train | go,go |
73b57a994277af4ce69fa8e1585ea2e9f63700a0 | diff --git a/lib/open_namespace/open_namespace.rb b/lib/open_namespace/open_namespace.rb
index <HASH>..<HASH> 100644
--- a/lib/open_namespace/open_namespace.rb
+++ b/lib/open_namespace/open_namespace.rb
@@ -17,7 +17,7 @@ module OpenNamespace
# @since 0.3.0
#
def OpenNamespace.constant_path(name)
- path = name.to_s
+ path = name.to_s.dup
# back-ported from extlib's String#to_const_path
path.gsub!(/::/,'/')
@@ -27,8 +27,8 @@ module OpenNamespace
path.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
path.gsub!(/([a-z])([A-Z])/, '\1_\2')
end
- path.downcase!
+ path.downcase!
return path
end
end | Prevent the constant name from being modified when constructing the path. | postmodern_open_namespace | train | rb |
5e0137e555fec9c5338cdfc6412e080b0d1292e6 | diff --git a/src/lib/cloud.js b/src/lib/cloud.js
index <HASH>..<HASH> 100644
--- a/src/lib/cloud.js
+++ b/src/lib/cloud.js
@@ -47,8 +47,8 @@ export default {
return devices.filter(d => d.connected);
case (filter === 'offline'):
return devices.filter(d => !d.connected);
- case (Object.keys(platformsByName).indexOf(filter) >= 0):
- return devices.filter(d => d.platform_id === platformsByName[filter]);
+ case (Object.keys(platformsByName).indexOf(filter.toLowerCase()) >= 0):
+ return devices.filter(d => d.platform_id === platformsByName[filter.toLowerCase()]);
default:
return devices.filter(d => d.name === filter || d.id === filter);
} | case-insensitive match to platforms for list filter | particle-iot_particle-cli | train | js |
b8cec8ff124d0e75b08e84c218672938604167cf | diff --git a/src/HtmlPageCrawler.php b/src/HtmlPageCrawler.php
index <HASH>..<HASH> 100644
--- a/src/HtmlPageCrawler.php
+++ b/src/HtmlPageCrawler.php
@@ -808,7 +808,7 @@ class HtmlPageCrawler extends Crawler
/** @var \DOMNode $newnode */
$newnode = static::importNewnode($newnode, $parent);
- $parent->appendChild($newnode);
+ $newnode = $parent->insertBefore($newnode,$this->getNode(0));
$content->clear();
$content->add($newnode); | Wrapped nodes retains position of first node in list | wasinger_htmlpagedom | train | php |
3ea80f7618d6f4b5a0343870fe4ccdb9377f1d5c | diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php
index <HASH>..<HASH> 100644
--- a/cake/libs/model/behaviors/translate.php
+++ b/cake/libs/model/behaviors/translate.php
@@ -229,8 +229,6 @@ class TranslateBehavior extends ModelBehavior {
if(isset($model->data[$model->name][$field])) {
$tempData[$field] = $model->data[$model->name][$field];
unset($model->data[$model->name][$field]);
- } else {
- $tempData[$field] = '';
}
}
$this->runtime[$model->name]['beforeSave'] = $tempData; | Adding patch from Ticket #<I>, fixes TranslateBehavior doesn't work with Model::saveField()
git-svn-id: <URL> | cakephp_cakephp | train | php |
126977d7e79d306307247f0a60e2718e74dabd6d | diff --git a/src/LogEvent.php b/src/LogEvent.php
index <HASH>..<HASH> 100644
--- a/src/LogEvent.php
+++ b/src/LogEvent.php
@@ -141,21 +141,8 @@ class LogEvent extends \ArrayObject implements ILogger
$context['time'] = microtime(true);
}
- // Set formatted UTC timestamp (Seriously PHP?)
- $timeParts = explode('.', $context['time']);
-
- // If you're lucky and PHP returns the exact second...
- if (count($timeParts) === 1) {
- $timeParts[1] = '0000';
- }
-
- // Add some padding if needed
- $timeParts[1] = str_pad($timeParts[1], 4, '0');
-
- $datetime = new \DateTime();
- $datetime->setTimezone(new \DateTimeZone('UTC'));
- $datetime->setTimestamp($timeParts[0]);
- return $datetime->format('Y-m-d\TH:i:s.') . $timeParts[1] . 'Z';
+ $datetime = \DateTime::createFromFormat('U.u', sprintf('%.4F', $context['time']), new \DateTimeZone('UTC'));
+ return $datetime->format('Y-m-d\TH:i:s.') . substr($datetime->format('u'), 0, 4) . 'Z';
}
/** | Made the timestamp creation a bit easier | zalora_punyan | train | php |
843ca2a7c5896f77b7ab49ed8f40f2a961760202 | diff --git a/application/Espo/Repositories/EmailAddress.php b/application/Espo/Repositories/EmailAddress.php
index <HASH>..<HASH> 100644
--- a/application/Espo/Repositories/EmailAddress.php
+++ b/application/Espo/Repositories/EmailAddress.php
@@ -288,7 +288,7 @@ class EmailAddress extends \Espo\Core\ORM\Repositories\RDB
".$pdo->quote($entity->id).",
".$pdo->quote($entity->getEntityName()).",
".$pdo->quote($emailAddress->id).",
- ".$pdo->quote($address === $primary)."
+ ".$pdo->quote((int)($address === $primary))."
)
";
$sth = $pdo->prepare($query); | fix email address primary pdo quote | espocrm_espocrm | train | php |
16b9ddfec026ff48248f45fb9a333b71b7bbe502 | diff --git a/src/Primer/Primer.php b/src/Primer/Primer.php
index <HASH>..<HASH> 100644
--- a/src/Primer/Primer.php
+++ b/src/Primer/Primer.php
@@ -336,9 +336,8 @@ class Primer
public function getTemplates()
{
$templates = array();
- $path = Primer::$BASE_PATH . '/patterns/templates';
- if ($handle = opendir($path)) {
+ if ($handle = opendir(Primer::$PATTERN_PATH . '/templates')) {
while (false !== ($entry = readdir($handle))) {
if (substr($entry, 0, 1) !== '.') {
$templates[] = array( | Bug fix with hardcoded ref to pattern path | Rareloop_primer-core | train | php |
a1b19cc560176c88cd7a0be2d857dc2e38c175c2 | diff --git a/lfs/diff_index_scanner.go b/lfs/diff_index_scanner.go
index <HASH>..<HASH> 100644
--- a/lfs/diff_index_scanner.go
+++ b/lfs/diff_index_scanner.go
@@ -135,6 +135,7 @@ func (s *DiffIndexScanner) Scan() bool {
}
s.next, s.err = s.scan(s.from.Text())
+ s.err = errors.Wrap(s.err, "diff-index scan")
return s.err == nil
} | lfs: re-wrap errors from `DiffIndexScanner.Scan()` | git-lfs_git-lfs | train | go |
ddf838dbd132558624486ba253aa5bbb83241b4a | diff --git a/tensorflow_probability/python/distributions/geometric.py b/tensorflow_probability/python/distributions/geometric.py
index <HASH>..<HASH> 100644
--- a/tensorflow_probability/python/distributions/geometric.py
+++ b/tensorflow_probability/python/distributions/geometric.py
@@ -86,13 +86,13 @@ class Geometric(distribution.Distribution):
if (probs is None) == (logits is None):
raise ValueError('Must pass probs or logits, but not both.')
with tf.name_scope(name) as name:
+ dtype = dtype_util.common_dtype([logits, probs], dtype_hint=tf.float32)
self._probs = tensor_util.convert_nonref_to_tensor(
- probs, dtype_hint=tf.float32, name='probs')
+ probs, dtype=dtype, name='probs')
self._logits = tensor_util.convert_nonref_to_tensor(
- logits, dtype_hint=tf.float32, name='logits')
+ logits, dtype=dtype, name='logits')
super(Geometric, self).__init__(
- dtype=(self._logits.dtype if self._probs is None
- else self._probs.dtype),
+ dtype=dtype,
reparameterization_type=reparameterization.NOT_REPARAMETERIZED,
validate_args=validate_args,
allow_nan_stats=allow_nan_stats, | Use common_dtype to ensure we get a base dtype rather than a float<I>_ref.
PiperOrigin-RevId: <I> | tensorflow_probability | train | py |
18c459efd87388269ad460fba850a4831ca10c1c | diff --git a/spec/unit/lib/web_page_spec.rb b/spec/unit/lib/web_page_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/lib/web_page_spec.rb
+++ b/spec/unit/lib/web_page_spec.rb
@@ -31,6 +31,7 @@ RSpec.describe 'WebPage' do
let(:page) { double }
subject { WebPage.instance.title }
before do
+ # allow_any_instance_of(WebPage).to receive(:check_validations_are_defined!) { true }
allow(WebPage.instance).to receive(:current_url) { 'google.com' }
end
it do
@@ -125,6 +126,23 @@ RSpec.describe 'WebPage' do
end
end
+ describe '#initialize' do
+ subject { WebPage.instance }
+ before do
+ allow_any_instance_of(WebPage).to receive(:check_validations_are_defined!) { true }
+ allow_any_instance_of(WebPage).to receive_message_chain('page.driver.browser.manage.window.maximize')
+ end
+ context 'when maximized window' do
+ before do
+ allow(settings).to receive(:maximized_window) { true }
+ end
+ it do
+ allow_any_instance_of(WebPage).to receive_message_chain('page.driver.browser.manage.window.maximize')
+ subject
+ end
+ end
+ end
+
describe 'inherited callback' do
let!(:page_class) do
Howitzer::Utils::PageValidator.instance_variable_set(:@pages, []) | Added unit test for window maximization | strongqa_howitzer | train | rb |
4425b1bdb7cf8ecec30acee74fe794955d46dcd6 | diff --git a/composer.go b/composer.go
index <HASH>..<HASH> 100644
--- a/composer.go
+++ b/composer.go
@@ -584,6 +584,8 @@ func (c *Composer) processKey(ev Event) {
func ProcessEvent(ev Event) {
switch ev.Type {
+ case EventCloseWindow:
+ comp.closeTopWindow()
case EventRedraw:
RefreshScreen()
case EventResize:
diff --git a/consts.go b/consts.go
index <HASH>..<HASH> 100644
--- a/consts.go
+++ b/consts.go
@@ -286,6 +286,8 @@ const (
EventDialogClose
// Close application
EventQuit
+ // Close top window - or application is there is only one window
+ EventCloseWindow
)
// ConfirmationDialog and SelectDialog exit codes | add event for composer to close the top window | VladimirMarkelov_clui | train | go,go |
597f3891f731e29683c7c43a83e200689d2ce12b | diff --git a/library/CM/FormField/Location.js b/library/CM/FormField/Location.js
index <HASH>..<HASH> 100644
--- a/library/CM/FormField/Location.js
+++ b/library/CM/FormField/Location.js
@@ -62,7 +62,7 @@ var CM_FormField_Location = CM_FormField_SuggestOne.extend({
}
})
.catch(function(error) {
- cm.window.hint('Unable to detect location');
+ cm.window.hint(cm.language.get('Unable to detect location'));
})
.finally(function() {
self.$('.detect-location').removeClass('waiting');
diff --git a/resources/translations/en.php b/resources/translations/en.php
index <HASH>..<HASH> 100644
--- a/resources/translations/en.php
+++ b/resources/translations/en.php
@@ -54,4 +54,5 @@ return function (CM_Model_Language $language) {
$language->setTranslation('{$file} has an invalid extension. Only {$extensions} are allowed.', '{$file} has an invalid extension. Only {$extensions} are allowed.',
array('file', 'extensions'));
$language->setTranslation('An unexpected connection problem occurred.', 'An unexpected connection problem occurred.');
+ $language->setTranslation('Unable to detect location', 'Unable to detect location');
}; | Translation of 'Unable to detect location'. | cargomedia_cm | train | js,php |
4285b7ff71ff730ba7d7362acc071b2743decdf2 | diff --git a/python/herald/shell.py b/python/herald/shell.py
index <HASH>..<HASH> 100644
--- a/python/herald/shell.py
+++ b/python/herald/shell.py
@@ -132,13 +132,17 @@ class HeraldCommands(object):
"""
lines = []
lines.append("Peer {0}".format(peer.uid))
- lines.append("\t- UID : {0}".format(peer.uid))
- lines.append("\t- Name: {0}".format(peer.name))
+ lines.append("\t- UID......: {0}".format(peer.uid))
+ lines.append("\t- Name.....: {0}".format(peer.name))
lines.append("\t- Node UID.: {0}".format(peer.node_uid))
lines.append("\t- Node Name: {0}".format(peer.node_name))
- lines.append("\t- Groups:")
+ lines.append("\t- Groups...:")
for group in sorted(peer.groups):
lines.append("\t\t- {0}".format(group))
+ lines.append("\t- Accesses.:")
+ for access in sorted(peer.get_accesses()):
+ lines.append("\t\t- {0}: {1}"
+ .format(access, peer.get_access(access)))
lines.append("")
io_handler.write("\n".join(lines)) | Show accesses when printing a Peer bean | cohorte_cohorte-herald | train | py |
3255e2cbe8e5e027e06f52bf7989dda2640b2aa3 | diff --git a/closure/goog/fx/dragger.js b/closure/goog/fx/dragger.js
index <HASH>..<HASH> 100644
--- a/closure/goog/fx/dragger.js
+++ b/closure/goog/fx/dragger.js
@@ -321,7 +321,10 @@ goog.fx.Dragger.prototype.enableRightPositioningForRtl =
* @template T
*/
goog.fx.Dragger.prototype.getHandler = function() {
- return this.eventHandler_;
+ // TODO(user): templated "this" values currently result in "this" being
+ // "unknown" in the body of the function.
+ var self = /** @type {goog.fx.Dragger} */ (this);
+ return self.eventHandler_;
}; | Fix unknown "this" warning.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
09a61ad74f965bf3e75849c05c253ef7a48de3da | diff --git a/src/frontend/org/voltdb/client/ClientConfig.java b/src/frontend/org/voltdb/client/ClientConfig.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/client/ClientConfig.java
+++ b/src/frontend/org/voltdb/client/ClientConfig.java
@@ -256,9 +256,9 @@ public class ClientConfig {
}
/**
- * <p>Attempts to reconnect to a node with retry after connection loss. See the {@link ReconnectStatusListener}.</p>
+ * <p>Experimental: Attempts to reconnect to a node with retry after connection loss. See the {@link ReconnectStatusListener}.</p>
*
- * @param on Enable or disable the reconnection feature.
+ * @param on Enable or disable the reconnection feature. Default is off.
*/
public void setReconnectOnConnectionLoss(boolean on) {
this.m_reconnectOnConnectionLoss = on; | Add "Experimental" to the ClientConfig reconnect on connection loss method.
Also explained that it's turned off by default. | VoltDB_voltdb | train | java |
e9fee3aa92beebfee3774aa906e7db3942c78583 | diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py
index <HASH>..<HASH> 100644
--- a/rest_auth/registration/views.py
+++ b/rest_auth/registration/views.py
@@ -7,7 +7,7 @@ from allauth.account.views import SignupView, ConfirmEmailView
from allauth.account.utils import complete_signup
from allauth.account import app_settings
-from ..serializers import UserDetailsSerializer
+from rest_auth.app_settings import UserDetailsSerializer
from rest_auth.registration.serializers import SocialLoginSerializer
from rest_auth.views import Login | Support custom UserDetailsSerializer for registration | Tivix_django-rest-auth | train | py |
61e9ef2ec02de4b62683b60a84f3cced32f70c71 | diff --git a/thunder/images/readers.py b/thunder/images/readers.py
index <HASH>..<HASH> 100644
--- a/thunder/images/readers.py
+++ b/thunder/images/readers.py
@@ -374,7 +374,8 @@ def fromtif(path, ext='tif', start=None, stop=None, recursive=False, nplanes=Non
pageCount = pageCount - extra
logging.getLogger('thunder').warn('Ignored %d pages in file %s' % (extra, fname))
else:
- raise ValueError("nplanes '%d' does not evenly divide '%d'" % (nplanes, pageCount))
+ raise ValueError("nplanes '%d' does not evenly divide '%d in file %s'" % (nplanes, pageCount,
+ fname))
values = [ary[i:(i+nplanes)] for i in range(0, pageCount, nplanes)]
else:
values = [ary] | Add file name to error message when multi page tif has wrong number of planes and discard_extra is False | thunder-project_thunder | train | py |
c76e34489a4a19980997838935310bfc068617fa | diff --git a/src/Controller/SettingsController.php b/src/Controller/SettingsController.php
index <HASH>..<HASH> 100644
--- a/src/Controller/SettingsController.php
+++ b/src/Controller/SettingsController.php
@@ -70,6 +70,7 @@ class SettingsController extends AppController
if (!$key) {
$key = 'App';
}
+ $this->Menu->active($this->prefixes[$key]);
if (!$this->__prefixExists($key)) {
throw new NotFoundException("The prefix-setting " . $key . " could not be found"); | Activated selected settings in navigation bar
Activated selected settings in navigation bar by using the Menu component | cakemanager_cakephp-cakeadmin | train | php |
fa6b47c83c57c02bd8a522333ae90a51d9854c2b | diff --git a/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php b/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php
+++ b/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php
@@ -48,7 +48,7 @@ trait ValidatesWhenResolvedTrait
}
/**
- * Deteremine if the request passes the authorization check.
+ * Determine if the request passes the authorization check.
*
* @return bool
*/ | [<I>] Fixed typo
Corrects a typo in ValidatesWhenResolvedTrait | laravel_framework | train | php |
094b58130a420f5d6cccb96d0981af1d1aa5b545 | diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php
+++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php
@@ -84,9 +84,10 @@ class SelfupgradeCommand extends Command
$this->setupConsole($input, $output);
$this->upgrader = new Upgrader($this->input->getOption('force'));
+
+
$local = $this->upgrader->getLocalVersion();
$remote = $this->upgrader->getRemoteVersion();
- $update = $this->upgrader->getAssets()->{'grav-update'};
$release = strftime('%c', strtotime($this->upgrader->getReleaseDate()));
if (!$this->upgrader->isUpgradable()) {
@@ -94,6 +95,8 @@ class SelfupgradeCommand extends Command
exit;
}
+ $update = $this->upgrader->getAssets()->{'grav-update'};
+
$questionHelper = $this->getHelper('question');
$skipPrompt = $this->input->getOption('all-yes'); | Fix for issue #<I> - latest version check out of order | getgrav_grav | train | php |
fe5b0f158ebe0b721d39e72bb282216cbff5aca7 | diff --git a/lib/stealth/server.rb b/lib/stealth/server.rb
index <HASH>..<HASH> 100644
--- a/lib/stealth/server.rb
+++ b/lib/stealth/server.rb
@@ -41,7 +41,7 @@ module Stealth
dispatcher = Stealth::Dispatcher.new(
service: params[:service],
params: params,
- headers: request.env
+ headers: get_helpers_from_request(request)
)
dispatcher.coordinate
@@ -49,5 +49,13 @@ module Stealth
status 202
end
+ private
+
+ def get_helpers_from_request(request)
+ request.env.reject do |header, value|
+ header.match(/rack\.|puma\.|sinatra\./)
+ end
+ end
+
end
end | Drop infrastructure specific headers
These are fairly large and unneccessary at the service level. | hellostealth_stealth | train | rb |
3d1afa47bcf13c1f3ab10e18db30519b50b3c359 | diff --git a/src/Collection/LastHelper.php b/src/Collection/LastHelper.php
index <HASH>..<HASH> 100644
--- a/src/Collection/LastHelper.php
+++ b/src/Collection/LastHelper.php
@@ -49,6 +49,23 @@ class LastHelper implements HelperInterface
throw new \InvalidArgumentException('Wrong type of the argument in the "last" helper.');
}
- return end($collection);
+ if (is_array($collection)) {
+ return end($collection);
+ }
+
+ // "end" function does not work with \Traversable in HHVM. Thus we
+ // need to get the element manually.
+ while ($collection instanceof \IteratorAggregate) {
+ $collection = $collection->getIterator();
+ }
+
+ $collection->rewind();
+ $item = false;
+ while ($collection->valid()) {
+ $item = $collection->current();
+ $collection->next();
+ }
+
+ return $item;
}
} | Fix "last" helper for HHVM | JustBlackBird_handlebars.php-helpers | train | php |
aea39f726ea64bfadaba6ca7a53687c180b440fa | diff --git a/lib/travis/model/repository.rb b/lib/travis/model/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/model/repository.rb
+++ b/lib/travis/model/repository.rb
@@ -76,8 +76,10 @@ class Repository < ActiveRecord::Base
def find_by(params)
if id = params[:repository_id] || params[:id]
self.find(id)
- else
+ elsif params.key?(:name) && params.key?(:owner_name)
self.where(params.slice(:name, :owner_name)).first || raise(ActiveRecord::RecordNotFound)
+ else
+ raise(ActiveRecord::RecordNotFound)
end
end | make sure Repository.find_by requires necessary params | travis-ci_travis-core | train | rb |
76dc3201c47c77c79394a6179e787409206839ec | diff --git a/lib/jdbc_adapter/jdbc_derby.rb b/lib/jdbc_adapter/jdbc_derby.rb
index <HASH>..<HASH> 100644
--- a/lib/jdbc_adapter/jdbc_derby.rb
+++ b/lib/jdbc_adapter/jdbc_derby.rb
@@ -90,7 +90,7 @@ module ::JdbcSpec
# Override default -- fix case where ActiveRecord passes :default => nil, :null => true
def add_column_options!(sql, options)
options.delete(:default) if options.has_key?(:default) && options[:default].nil?
- options.delete(:null) if options.has_key?(:null) && (options[:null].nil? || options[:null].true?)
+ options.delete(:null) if options.has_key?(:null) && (options[:null].nil? || options[:null] == true)
super
end | <I>, JRUBY-<I>: Since when did I think that there was a #true? method on Object?
git-svn-id: svn+ssh://rubyforge.org/var/svn/jruby-extras/trunk/activerecord-jdbc@<I> 8ba<I>d5-0c1a-<I>-<I>a6-a<I>dfc1b<I>a6 | jruby_activerecord-jdbc-adapter | train | rb |
b8d706f60d7b9eaa0f5d1ed5240a911364946e68 | diff --git a/src/test/java/org/jolokia/docker/maven/assembly/DockerAssemblyConfigurationSourceTest.java b/src/test/java/org/jolokia/docker/maven/assembly/DockerAssemblyConfigurationSourceTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/jolokia/docker/maven/assembly/DockerAssemblyConfigurationSourceTest.java
+++ b/src/test/java/org/jolokia/docker/maven/assembly/DockerAssemblyConfigurationSourceTest.java
@@ -77,7 +77,7 @@ public class DockerAssemblyConfigurationSourceTest {
assertFalse(source.isIgnorePermissions());
- String outputDir = params.getOutputDirectory();
+ String outputDir = new File(params.getOutputDirectory()).getPath();
assertTrue(startsWithDir(outputDir, source.getOutputDirectory()));
assertTrue(startsWithDir(outputDir, source.getWorkingDirectory()));
assertTrue(startsWithDir(outputDir, source.getTemporaryRootDirectory())); | Fix unit test on windows
Path issues, as always. | fabric8io_docker-maven-plugin | train | java |
9a56c9603c78d26aaf67a9ae8efda9b31d94eaae | diff --git a/saspy/sasproccommons.py b/saspy/sasproccommons.py
index <HASH>..<HASH> 100644
--- a/saspy/sasproccommons.py
+++ b/saspy/sasproccommons.py
@@ -486,8 +486,11 @@ class SASProcCommons:
else:
inputs = {'interval': input_list}
- kwargs['input'] = inputs
- kwargs['target'] = target
+ if any(v is not None for v in inputs.values()):
+ kwargs['input'] = inputs
+ if any(v is not None for v in target.values()):
+ kwargs['target'] = target
+
return kwargs | minor fix to not add nominal dictionaries that are None | sassoftware_saspy | train | py |
bf7105e4dcb4616f4481b41b1fc9f229b72b5e61 | diff --git a/DataFixtures/ORM/LoadShopData.php b/DataFixtures/ORM/LoadShopData.php
index <HASH>..<HASH> 100644
--- a/DataFixtures/ORM/LoadShopData.php
+++ b/DataFixtures/ORM/LoadShopData.php
@@ -15,6 +15,7 @@ namespace WellCommerce\Bundle\ShopBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use WellCommerce\Bundle\CoreBundle\DataFixtures\AbstractDataFixture;
use WellCommerce\Bundle\AppBundle\Entity\MailerConfiguration;
+use WellCommerce\Bundle\CurrencyBundle\DataFixtures\ORM\LoadCurrencyData;
/**
* Class LoadShopData | Finished restructurisation of bundles
(cherry picked from commit 7fa<I>b1af<I>e1d2bcf9ad5b4a<I>bfe<I>c) | WellCommerce_WishlistBundle | train | php |
1670748961fd0efa6c62b0231d3e86a3576816a7 | diff --git a/clients/js/manners/index.js b/clients/js/manners/index.js
index <HASH>..<HASH> 100644
--- a/clients/js/manners/index.js
+++ b/clients/js/manners/index.js
@@ -65,6 +65,9 @@ InteractionGroup.prototype.setup = function (readyFn) {
fn(err);
}
};
+ var cleanup = function () {
+ return axios.delete(cfg.baseUrl + '/interactions', axiosCfg);
+ };
return axios
.put(cfg.baseUrl + '/interactions', { interactions: this._interactions }, axiosCfg)
@@ -85,9 +88,15 @@ InteractionGroup.prototype.setup = function (readyFn) {
var msg = 'Verification failed with error:\n' + JSON.stringify(err.data.error, null, 2);
throw new ProviderError(msg);
}))
- .then(function () {
- return axios.delete(cfg.baseUrl + '/interactions', axiosCfg);
- })
+ .then(
+ function () {
+ return cleanup();
+ }, function (err) {
+ return cleanup().then(function () {
+ throw err;
+ });
+ }
+ )
.catch(rethrow(function (err) {
throw new ProviderError('Cleaning up interactions failed');
})) | Add cleanup of interactions after in case of faulty test | damienklinnert_manners | train | js |
4d3a3f08846f8bf00e5635b906cf9bdb012b8c55 | diff --git a/test/test_messaging.py b/test/test_messaging.py
index <HASH>..<HASH> 100644
--- a/test/test_messaging.py
+++ b/test/test_messaging.py
@@ -565,9 +565,9 @@ class TestConsumerDisconnections(object):
publish(msg)
assert result.get() == msg
- def test_downstream_blackhole( # pragma: no cover
+ def test_downstream_blackhole(
self, container, publish, toxiproxy
- ):
+ ): # pragma: no cover
""" Verify we detect and recover from sockets losing data.
This failure mode means that all data sent from the rabbit broker to | put pragma in the right place | nameko_nameko | train | py |
834a30a51a366a94f3bee60503c8126dbea1becc | diff --git a/pybromo/diffusion.py b/pybromo/diffusion.py
index <HASH>..<HASH> 100644
--- a/pybromo/diffusion.py
+++ b/pybromo/diffusion.py
@@ -784,7 +784,14 @@ class ParticlesSimulation(object):
# Load emission in chunks, and save only the final timestamps
bg_rates = [None] * (len(max_rates) - 1) + [bg_rate]
+ prev_time = 0
for i_start, i_end in iter_chunk_index(timeslice_size, t_chunksize):
+
+ curr_time = np.around(i_start * self.t_step, decimals=1)
+ if curr_time > prev_time:
+ print(' %.1fs' % curr_time, end='', flush=True)
+ prev_time = curr_time
+
em_chunk = self.emission[:, i_start:i_end]
times_chunk_s, par_index_chunk_s = \ | Print time during timestamps simulation | tritemio_PyBroMo | train | py |
68040608b853037a14e724d37d01d6883bc0089d | diff --git a/android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingTitleBar.java b/android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingTitleBar.java
index <HASH>..<HASH> 100644
--- a/android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingTitleBar.java
+++ b/android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingTitleBar.java
@@ -97,10 +97,12 @@ public class CollapsingTitleBar extends TitleBar implements View.OnTouchListener
@Override
protected void setBackground(StyleParams params) {
- titleBarBackground = createBackground(params,
- params.collapsingTopBarParams.expendedTitleBarColor,
- params.collapsingTopBarParams.scrimColor);
- setBackground(titleBarBackground);
+ if (titleBarBackground == null) {
+ titleBarBackground = createBackground(params,
+ params.collapsingTopBarParams.expendedTitleBarColor,
+ params.collapsingTopBarParams.scrimColor);
+ setBackground(titleBarBackground);
+ }
}
private TitleBarBackground createBackground(StyleParams styleParams, StyleParams.Color expendedColor, StyleParams.Color collapsedColor) { | Set CollapsingTitleBar background only once
This is a quick hack to address issue where the expended color was
set after pop even if screen was collapsed. | wix_react-native-navigation | train | java |
8f751521af702e5ddae3cb1b70db2d7ea4b28388 | diff --git a/lib/app/controllers/offline_mirror/group_base_controller.rb b/lib/app/controllers/offline_mirror/group_base_controller.rb
index <HASH>..<HASH> 100644
--- a/lib/app/controllers/offline_mirror/group_base_controller.rb
+++ b/lib/app/controllers/offline_mirror/group_base_controller.rb
@@ -26,7 +26,7 @@ module OfflineMirror
end
def load_down_mirror_file(group, data)
- ensure_group_offline(group)
+ ensure_group_offline(group) if group
raise PluginError.new("Cannot accept down mirror file when app is in online mode") if OfflineMirror::app_online?
mirror_data = MirrorData.new(group, [data, "r"])
mirror_data.load_downwards_data
diff --git a/test/unit/group_controller_test.rb b/test/unit/group_controller_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/group_controller_test.rb
+++ b/test/unit/group_controller_test.rb
@@ -106,4 +106,8 @@ class GroupControllerTest < ActionController::TestCase
post :upload_up_mirror, "id" => @online_group.id, "mirror_data" => gen_up_mirror_data(@online_group)
end
end
+
+ offline_test "can load initial down mirror files by supplying nil as group" do
+ # TODO Implement
+ end
end
\ No newline at end of file | Nice-looking test app: Implemented the rest of the mirroring interface (still untested though) | DavidMikeSimon_offroad | train | rb,rb |
32bffb1977f685fe1062b37d11120e49b9991c84 | diff --git a/dice-roller.js b/dice-roller.js
index <HASH>..<HASH> 100644
--- a/dice-roller.js
+++ b/dice-roller.js
@@ -601,9 +601,12 @@
// output the rolls
rolls.forEach(function(roll, rIndex, array){
+ // get the roll value to compare to (If penetrating and not the first roll, add 1, to compensate for the penetration)
+ var rollVal = (item.penetrate && (rIndex > 0)) ? roll + 1 : roll;
+
output += roll;
- if(item.explode && isComparePoint(item.comparePoint, roll)){
+ if(item.explode && isComparePoint(item.comparePoint, rollVal)){
// this die roll exploded (Either matched the explode value or is greater than the max - exploded and compounded)
output += '!' + (item.compound ? '!' : '') + (item.penetrate ? 'p' : '');
} | Penetrating dice has correct notation when penetrating multiple times
References #<I> | GreenImp_rpg-dice-roller | train | js |
ee921bd5c758cfe28f87fe1e4838fd70c5377d43 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/db/record/ODatabaseRecordAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/db/record/ODatabaseRecordAbstract.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/db/record/ODatabaseRecordAbstract.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/db/record/ODatabaseRecordAbstract.java
@@ -788,11 +788,11 @@ public abstract class ODatabaseRecordAbstract extends ODatabaseWrapperAbstract<O
if (!OHookThreadLocal.INSTANCE.push(id))
return false;
- final ORecord<?> rec = id.getRecord();
- if (rec == null)
- return false;
-
try {
+ final ORecord<?> rec = id.getRecord();
+ if (rec == null)
+ return false;
+
boolean recordChanged = false;
for (ORecordHook hook : hooks)
if (hook.onTrigger(iType, rec)) | Fixed issue <I> with the contribution of Stefan Liebig | orientechnologies_orientdb | train | java |
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.