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 |
|---|---|---|---|---|---|
83aebfbf05bda4dcd82d3de3bbecab203fadccaf | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -120,7 +120,7 @@ html_theme = 'default'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+#html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. | Comment out html_static_path | brutasse_django-password-reset | train | py |
4acbb6da9480ed35a22cd097949eb01c8c13fd4a | diff --git a/tests/unit/test_regressions.py b/tests/unit/test_regressions.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_regressions.py
+++ b/tests/unit/test_regressions.py
@@ -1568,3 +1568,20 @@ def spam():
)
== snippet
)
+
+
+def test_isort_shouldnt_add_extra_line_float_to_top_issue_1667():
+ assert isort.check_code(
+ """
+ import sys
+
+sys.path.insert(1, 'path/containing/something_else/..')
+
+import something_else # isort:skip
+
+# Some constant
+SOME_CONSTANT = 4
+""",
+ show_diff=True,
+ float_to_top=True,
+ ) | Create failing test for issue #<I> | timothycrosley_isort | train | py |
33e5188c6bd7a4c95569b93c7d5e271da99ed2d3 | diff --git a/404-server/server.go b/404-server/server.go
index <HASH>..<HASH> 100644
--- a/404-server/server.go
+++ b/404-server/server.go
@@ -21,6 +21,7 @@ import (
"flag"
"fmt"
"net/http"
+ "os"
)
var port = flag.Int("port", 8080, "Port number to serve default backend 404 page.")
@@ -36,4 +37,10 @@ func main() {
fmt.Fprint(w, "ok")
})
http.ListenAndServe(fmt.Sprintf(":%d", *port), nil)
+ // TODO: Use .Shutdown from Go 1.8
+ err := http.ListenAndServe(fmt.Sprintf(":%d", *port), nil)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "could not start http server: %s\n", err)
+ os.Exit(1)
+ }
} | Catch error from listenandserve
This change catches any potential errors from http.listenandserve
and ouputs to stderr. | kubernetes-retired_contrib | train | go |
4bc891a73a8766c8ac34b15706e8666b86b7cfb4 | diff --git a/modules/orionode/lib/cf/apps.js b/modules/orionode/lib/cf/apps.js
index <HASH>..<HASH> 100644
--- a/modules/orionode/lib/cf/apps.js
+++ b/modules/orionode/lib/cf/apps.js
@@ -767,6 +767,9 @@ function bindServices(req, appTarget){
async.each(manifestService, function(service, cb) {
return getServiceGuid(req.user.username, service, appTarget)
.then(function(serviceInstanceGUID){
+ if (!serviceInstanceGUID) {
+ return Promise.reject(new Error("Service instance " + service + " cannot be found in target space"));
+ }
return bindService(req.user.username, serviceInstanceGUID, appTarget);
}).then(function(){
return cb(); | London - Unable to deploy from Orion org-ids/roadmap#<I> | eclipse_orion.client | train | js |
b24af438488fcdbdc9a46acef7ac36285481c3db | diff --git a/freshen/stepregistry.py b/freshen/stepregistry.py
index <HASH>..<HASH> 100644
--- a/freshen/stepregistry.py
+++ b/freshen/stepregistry.py
@@ -17,7 +17,9 @@ class AmbiguousStepImpl(Exception):
self.step = step
self.impl1 = impl1
self.impl2 = impl2
- super(AmbiguousStepImpl, self).__init__('Ambiguous: "%s"\n %s, %s' % (step.match, impl1, impl2))
+ super(AmbiguousStepImpl, self).__init__('Ambiguous: "%s"\n %s\n %s' % (step.match,
+ impl1.get_location(),
+ impl2.get_location()))
class UndefinedStepImpl(Exception):
@@ -37,6 +39,10 @@ class StepImpl(object):
def match(self, match):
return self.re_spec.match(match)
+
+ def get_location(self):
+ code = self.func.func_code
+ return "%s:%d" % (code.co_filename, code.co_firstlineno)
class HookImpl(object): | Ambiguous step exception now shows location of step definitions | rlisagor_freshen | train | py |
50215d257e625d9b97f90e72b0e75f75d81622de | diff --git a/store.go b/store.go
index <HASH>..<HASH> 100644
--- a/store.go
+++ b/store.go
@@ -222,12 +222,7 @@ func (s Store) LoadFile(filename string) error {
return err
}
- err = Decode(s, buf)
- if err != nil {
- return err
- }
-
- return nil
+ return Decode(s, buf)
}
// LoadFile creates a store and loads any crypto primitives in the PEM encoded | Minor cleanup to LoadFile | knq_pemutil | train | go |
a740d50ef841081fb9487b5ed6cbdab5b0ab8dc5 | diff --git a/lib/ore/cli.rb b/lib/ore/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/ore/cli.rb
+++ b/lib/ore/cli.rb
@@ -10,6 +10,7 @@ module Ore
default_task :cut
map '-l' => :list
+ map '-u' => :update
map '-r' => :remove
desc 'list', 'List installed Ore templates'
@@ -54,6 +55,19 @@ module Ore
system('git','clone',uri,path)
end
+ desc 'update', 'Updates all installed templates'
+
+ #
+ # Updates all previously installed templates.
+ #
+ def update
+ Config.installed_templates do |path|
+ say "Updating #{File.basename(path)} ...", :green
+
+ Dir.chdir(path) { system('git','pull','-q') }
+ end
+ end
+
desc 'remove NAME', 'Removes an Ore template'
# | Added CLI#update. | ruby-ore_ore | train | rb |
1928d0c3faef02920d74706c8eab66fdcf879593 | diff --git a/test/test_arithmetic.rb b/test/test_arithmetic.rb
index <HASH>..<HASH> 100644
--- a/test/test_arithmetic.rb
+++ b/test/test_arithmetic.rb
@@ -134,7 +134,7 @@ class TestArithmetic < MiniTest::Test
val = connection.decr(uniq_id, 12, :initial => 0, :ttl => exp)
assert_equal 0, val
assert_equal 0, connection.get(uniq_id)
- sleep(2)
+ sleep(3)
assert_raises(Couchbase::Error::NotFound) do
connection.get(uniq_id)
end
diff --git a/test/test_view.rb b/test/test_view.rb
index <HASH>..<HASH> 100644
--- a/test/test_view.rb
+++ b/test/test_view.rb
@@ -91,4 +91,4 @@ class TestView < MiniTest::Test
}
end
-end
\ No newline at end of file
+end | changed delay for absolute ttl test | mje113_couchbase-jruby-client | train | rb,rb |
aed3e59fb9ac20944167c67fccee8295363a645f | diff --git a/pkg/k8s/synced/crd.go b/pkg/k8s/synced/crd.go
index <HASH>..<HASH> 100644
--- a/pkg/k8s/synced/crd.go
+++ b/pkg/k8s/synced/crd.go
@@ -53,6 +53,7 @@ var (
crdResourceName(v2.CNName),
crdResourceName(v2.CIDName),
crdResourceName(v2.CLRPName),
+ crdResourceName(v2.CEWName),
}
) | k8s: Add CEW CRD to CRD waiter
Add CiliumExternalWorkload CRD to the CRD waiter. Cilium agent does
not use CiliumExternalWorkload CRD but this is needed for the
clustermesh-apiserver, and including it also with Cilium agent does
not hurt. | cilium_cilium | train | go |
27e522e23df18edec74c003908f4b4be11182160 | diff --git a/AdvancedHTTPServer.py b/AdvancedHTTPServer.py
index <HASH>..<HASH> 100755
--- a/AdvancedHTTPServer.py
+++ b/AdvancedHTTPServer.py
@@ -494,7 +494,10 @@ class AdvancedHTTPServerRPCClient(object):
:param str method: The name of the remote procedure to execute.
:return: The return value from the remote function.
"""
- options = self.encode(dict(args=args, kwargs=kwargs))
+ if kwargs:
+ options = self.encode(dict(args=args, kwargs=kwargs))
+ else:
+ options = self.encode(args)
headers = {}
headers['Content-Type'] = self.serializer.content_type | Use the old RPC calling convention for compatibility | zeroSteiner_AdvancedHTTPServer | train | py |
1239c58e1d843e4eaf67a92de768f74f469aa2db | diff --git a/hack/preload-images/kubernetes.go b/hack/preload-images/kubernetes.go
index <HASH>..<HASH> 100644
--- a/hack/preload-images/kubernetes.go
+++ b/hack/preload-images/kubernetes.go
@@ -18,22 +18,27 @@ package main
import (
"context"
+ "strings"
"github.com/google/go-github/v36/github"
"k8s.io/klog/v2"
)
-// recentK8sVersions returns the most recent k8s version, usually around 30
+// recentK8sVersions returns the most recent k8s version, usually around 100.
func recentK8sVersions() ([]string, error) {
+ const k8s = "kubernetes"
client := github.NewClient(nil)
- k8s := "kubernetes"
- list, _, err := client.Repositories.ListReleases(context.Background(), k8s, k8s, &github.ListOptions{})
+ list, _, err := client.Repositories.ListReleases(context.Background(), k8s, k8s, &github.ListOptions{PerPage: 100})
if err != nil {
return nil, err
}
var releases []string
for _, r := range list {
+ // Exclude "alpha" releases.
+ if !strings.Contains(r.GetTagName(), "alpha") {
+ continue
+ }
releases = append(releases, r.GetTagName())
}
klog.InfoS("Got releases", "releases", releases) | Increase page size to <I> and omit "alpha" | kubernetes_minikube | train | go |
be83cd6be0bce3835fef881a226e3a1b2c593e74 | diff --git a/app/src/Bolt/Application.php b/app/src/Bolt/Application.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Application.php
+++ b/app/src/Bolt/Application.php
@@ -17,7 +17,7 @@ class Application extends Silex\Application
public function __construct(array $values = array())
{
$values['bolt_version'] = '1.6.0';
- $values['bolt_name'] = 'beta';
+ $values['bolt_name'] = 'beta 2';
parent::__construct($values); | Bumping version numver to "<I> beta 2" | bolt_bolt | train | php |
8c52825feff40a20117c939fda14c4a76397bb85 | diff --git a/backend/_callback_manager.py b/backend/_callback_manager.py
index <HASH>..<HASH> 100644
--- a/backend/_callback_manager.py
+++ b/backend/_callback_manager.py
@@ -21,6 +21,7 @@ class CallbackManager(threading.Thread):
return
task, callback, base_dict = self._waiting_job_data[jobid]
+ del self._waiting_job_data[jobid]
final_result = self._merge_emul_result(base_dict, result)
diff --git a/backend/job_manager.py b/backend/job_manager.py
index <HASH>..<HASH> 100644
--- a/backend/job_manager.py
+++ b/backend/job_manager.py
@@ -88,6 +88,10 @@ class JobManager(object):
print "Job Manager initialization done"
+ def get_waiting_jobs_count(self):
+ """Returns the total number of waiting jobs in the Job Manager"""
+ return len(self._running_job_data)
+
def new_job(self, task, inputdata, callback):
""" Add a new job. callback is a function that will be called asynchronously in the job manager's process. """
jobid = uuid.uuid4() | Restore the ability to get the number of waiting jobs | UCL-INGI_INGInious | train | py,py |
a8e4a30b18d7cfbe23a3491be99a106d3241337b | diff --git a/config.go b/config.go
index <HASH>..<HASH> 100644
--- a/config.go
+++ b/config.go
@@ -38,6 +38,12 @@ func (c *Config) Client(t *Token) *http.Client {
return NewClient(c, t)
}
+// GetClient returns an HTTP client authorized with the given token and
+// tokenSecret credentials.
+func (c *Config) GetClient(token, tokenSecret string) *http.Client {
+ return NewClient(c, NewToken(token, tokenSecret))
+}
+
// NewClient returns a new http Client which signs requests via OAuth1.
func NewClient(config *Config, token *Token) *http.Client {
transport := &Transport{
diff --git a/encode_test.go b/encode_test.go
index <HASH>..<HASH> 100644
--- a/encode_test.go
+++ b/encode_test.go
@@ -13,6 +13,8 @@ func TestPercentEncode(t *testing.T) {
{"An encoded string!", "An%20encoded%20string%21"},
{"Dogs, Cats & Mice", "Dogs%2C%20Cats%20%26%20Mice"},
{"☃", "%E2%98%83"},
+ {"%", "%25"},
+ {"-._", "-._"},
}
for _, c := range cases {
if output := PercentEncode(c.input); output != c.expected { | Add Config.GetClient method taking token as strings
* Useful for abstracting sources of OAuth1 authorized clients
as an interface in dependent libs | dghubble_oauth1 | train | go,go |
de509d4ccd36f32caa16d574f190275d18a0f957 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -41,7 +41,7 @@ class Widget extends Component {
};
this.setState(prevState => ({
messages: prevState.messages.concat([newMessage])
- }), this.props.handleNewUserMessage(text));
+ }), () => this.props.handleNewUserMessage(text));
}
handleMessageSubmit = (event) => { | add fix to new messages not showing when instance responses are sent | Wolox_react-chat-widget | train | js |
2ab07680912379dd65570e0e8196e3a1adcd43ce | diff --git a/lib/walmart_open/config.rb b/lib/walmart_open/config.rb
index <HASH>..<HASH> 100644
--- a/lib/walmart_open/config.rb
+++ b/lib/walmart_open/config.rb
@@ -22,10 +22,10 @@ module WalmartOpen
private
def prepare_params(params)
- params = (params || {}).reverse_merge(
+ params = {
api_key: api_key,
format: "json"
- )
+ }.merge(params || {})
pairs = params.map do |key, value|
key = key.to_s.gsub(/_([a-z])/i) { $1.upcase } | We don't have reverse_merge without Rails | listia_walmart_open | train | rb |
f7aaf3e4806d659492464275b153161868a9e7b9 | diff --git a/v2/apierror/apierror.go b/v2/apierror/apierror.go
index <HASH>..<HASH> 100644
--- a/v2/apierror/apierror.go
+++ b/v2/apierror/apierror.go
@@ -28,7 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Package apierror implements a wrapper error for parsing error details from
-// API calls. Currently, only errors representing a gRPC status are supported.
+// API calls. Both HTTP & gRPC status errors are supported.
package apierror
import ( | fix: update apierror docs with HTTP support (#<I>) | googleapis_gax-go | train | go |
7a0127d60e34f4d9bb7d550ec1a9d93b1b0c9e7c | diff --git a/lib/Client.js b/lib/Client.js
index <HASH>..<HASH> 100644
--- a/lib/Client.js
+++ b/lib/Client.js
@@ -137,10 +137,11 @@ Client.prototype.onMsg = function(msg) {
};
Client.prototype.emitErr = function(msg) {
+ var self = this;
this.emit.apply(self, ['error', msg]);
};
-function noop() {};
+function noop() {}
function _request(serviceName, data, opts) {
var self = this; | bind emit to correct this arg | prdn_pigato | train | js |
57457aa7722e15528b3332f122cb85314d21cd55 | diff --git a/src/test/java/picocli/ArgGroupTest.java b/src/test/java/picocli/ArgGroupTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/picocli/ArgGroupTest.java
+++ b/src/test/java/picocli/ArgGroupTest.java
@@ -2248,12 +2248,12 @@ public class ArgGroupTest {
static class CommandWithDefaultValue {
@ArgGroup(exclusive = false)
- Group1 initializedGroup = new Group1();
+ InitializedGroup initializedGroup = new InitializedGroup();
@ArgGroup(exclusive = false)
- Group2 declaredGroup;
+ DeclaredGroup declaredGroup;
- static class Group1 {
+ static class InitializedGroup {
@Option(names = "-staticX", arity = "0..1", defaultValue = "999", fallbackValue = "-88" )
static int staticX;
@@ -2261,7 +2261,7 @@ public class ArgGroupTest {
int instanceX;
}
- static class Group2 {
+ static class DeclaredGroup {
@Option(names = "-staticY", arity = "0..1", defaultValue = "999", fallbackValue = "-88" )
static Integer staticY;
@@ -2279,10 +2279,10 @@ public class ArgGroupTest {
cmd.parseArgs();
assertEquals(999, bean.initializedGroup.instanceX);
- assertEquals(999, CommandWithDefaultValue.Group1.staticX);
+ assertEquals(999, CommandWithDefaultValue.InitializedGroup.staticX);
assertNull(bean.declaredGroup);
- assertNull(CommandWithDefaultValue.Group2.staticY);
+ assertNull(CommandWithDefaultValue.DeclaredGroup.staticY);
}
static class Issue746 { | [#<I>] renamed inner class used in tests | remkop_picocli | train | java |
807603c58ffb88205aebff78b29fc9dd594d005d | diff --git a/lib/nodes/lib.js b/lib/nodes/lib.js
index <HASH>..<HASH> 100644
--- a/lib/nodes/lib.js
+++ b/lib/nodes/lib.js
@@ -398,17 +398,17 @@ registry.decl(SvnLibraryNodeName, ScmLibraryNodeName, /** @lends SvnLibraryNode.
},
getInitialCheckoutCmd: function(url, target) {
- return UTIL.format('svn co -q -r %s %s %s', this.revision, url, target);
+ return UTIL.format('svn co --non-interactive -q -r %s %s %s', this.revision, url, target);
},
getUpdateCmd: function(url, target) {
- return UTIL.format('svn up -q -r %s %s', this.revision, target);
+ return UTIL.format('svn up --non-interactive -q -r %s %s', this.revision, target);
},
getInfo: function(path) {
var _this = this,
- cmd = UTIL.format('svn info %s', PATH.resolve(this.root, this.target, path)),
+ cmd = UTIL.format('svn info --non-interactive %s', PATH.resolve(this.root, this.target, path)),
d = Q.defer();
this.log(cmd); | - use non interactive mode for svn commands (close #<I>) | bem-archive_bem-tools | train | js |
8e8b3e3455461caa23add370620c318ddeadeb92 | diff --git a/hszinc/parser.py b/hszinc/parser.py
index <HASH>..<HASH> 100644
--- a/hszinc/parser.py
+++ b/hszinc/parser.py
@@ -18,6 +18,7 @@ import re
URI_META = re.compile(r'\\([:/\?#\[\]@\\&=;"$])')
STR_META = re.compile(r'\\([\\"$])')
+GRID_SEP = re.compile(r'\n\n+')
def parse(zinc_str):
'''
@@ -26,7 +27,7 @@ def parse(zinc_str):
# Split the separate grids up, the grammar definition has trouble splitting
# them up normally. This will truncate the newline off the end of the last
# row.
- return list(map(parse_grid, zinc_str.split('\n\n')))
+ return list(map(parse_grid, GRID_SEP.split(zinc_str.rstrip())))
def parse_grid(grid_str):
if not grid_str.endswith('\n'): | parser: Handle trailing newlines after grids. | vrtsystems_hszinc | train | py |
e4028fa6a7ec69ac3e372519ef70856c548cf448 | diff --git a/pyrogram/client/methods/messages/send_poll.py b/pyrogram/client/methods/messages/send_poll.py
index <HASH>..<HASH> 100644
--- a/pyrogram/client/methods/messages/send_poll.py
+++ b/pyrogram/client/methods/messages/send_poll.py
@@ -123,7 +123,7 @@ class SendPoll(BaseClient):
for i in r.updates:
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage, types.UpdateNewScheduledMessage)):
- return pyrogram.Message._parse(
+ return await pyrogram.Message._parse(
self, i.message,
{i.id: i for i in r.users},
{i.id: i for i in r.chats}, | Add missing await (#<I>)
await client.send_poll(...) was returning a coroutine instead of the Message object | pyrogram_pyrogram | train | py |
3e963ec46bd60d97e6e66d0d52f2503e36c3e2b8 | diff --git a/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/core/GraphImpl.java b/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/core/GraphImpl.java
index <HASH>..<HASH> 100644
--- a/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/core/GraphImpl.java
+++ b/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/core/GraphImpl.java
@@ -118,7 +118,7 @@ public class GraphImpl implements Graph{
if( !contains( transition.getStartNode() ) ){
throw new WorkflowException( "Workflow " + name + ":" + version + " does not contain the start node of transition " + transition );
}
- if( !contains( transition.getStartNode() ) ){
+ if( !contains( transition.getEndNode() ) ){
throw new WorkflowException( "Workflow " + name + ":" + version + " does not contain the end node of transition " + transition );
}
Integer nodeId = transition.getStartNode().getId(); | Fixing a bug where transition validation didn't check the end node precence correctly | zutnop_telekom-workflow-engine | train | java |
534dc7fdec1c8f8af32f797c202b3962a11cccf0 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerCSVAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerCSVAbstract.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerCSVAbstract.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerCSVAbstract.java
@@ -548,6 +548,9 @@ public abstract class ORecordSerializerCSVAbstract extends ORecordSerializerStri
} else {
// EMBEDDED LITERAL
if (iLinkedType == null)
+ iLinkedType = getType(item);
+
+ if (iLinkedType == null)
throw new IllegalArgumentException(
"Linked type can't be null. Probably the serialized type has not stored the type along with data");
else if (iLinkedType == OType.CUSTOM) | Fixed issue about unmarshalling of embedded sets with strings | orientechnologies_orientdb | train | java |
7d57d4a157bbfabf53daaf38433e903109c29a82 | diff --git a/lib/middleman-s3_sync/extension.rb b/lib/middleman-s3_sync/extension.rb
index <HASH>..<HASH> 100644
--- a/lib/middleman-s3_sync/extension.rb
+++ b/lib/middleman-s3_sync/extension.rb
@@ -34,6 +34,26 @@ module Middleman
@caching_policies ||= Map.new
end
+ def aws_access_key_id
+ self[:aws_access_key_id] || ENV['AWS_ACCESS_KEY_ID']
+ end
+
+ def aws_secret_access_key
+ self[:aws_secret_access_key] || ENV['AWS_SECRET_ACCESS_KEY']
+ end
+
+ def delete
+ self[:delete].nil? ? true : self[:delete]
+ end
+
+ def after_build
+ self[:after_build].nil? ? false : self[:after_build]
+ end
+
+ def prefer_gzip
+ self[:prefer_gzip].nil? ? true : self[:prefer_gzip]
+ end
+
protected
class BrowserCachePolicy
attr_accessor :policies | Setting sensible defaults for s3_sync | fredjean_middleman-s3_sync | train | rb |
b377bc1077a3bb718b62be48bd1ef7ec312db5f6 | diff --git a/ucms_site/src/SiteStorage.php b/ucms_site/src/SiteStorage.php
index <HASH>..<HASH> 100644
--- a/ucms_site/src/SiteStorage.php
+++ b/ucms_site/src/SiteStorage.php
@@ -30,8 +30,18 @@ class SiteStorage
public function prepareInstance(Site $site)
{
$site->state = (int)$site->state;
- $site->ts_created = \DateTime::createFromFormat('Y-m-d H:i:s', $site->ts_created);
- $site->ts_changed = \DateTime::createFromFormat('Y-m-d H:i:s', $site->ts_changed);
+
+ if ($site->ts_created) {
+ $site->ts_created = \DateTime::createFromFormat('Y-m-d H:i:s', $site->ts_created);
+ } else {
+ $site->ts_created = new \DateTime();
+ }
+
+ if ($site->ts_changed) {
+ $site->ts_changed = \DateTime::createFromFormat('Y-m-d H:i:s', $site->ts_changed);
+ } else {
+ $site->ts_changed = new \DateTime();
+ }
}
/** | Site timestamps set to current time by default | makinacorpus_drupal-ucms | train | php |
c104621f964743844ad9612a7dabd634246ca93e | diff --git a/src/cjs.js b/src/cjs.js
index <HASH>..<HASH> 100644
--- a/src/cjs.js
+++ b/src/cjs.js
@@ -1704,6 +1704,22 @@ cjs.memoize = function(getter_fn, options) {
constraint.destroy();
}).destroy();
};
+ rv.set_cached_value = function() {
+ var args = slice(arguments, 0, arguments.length-1);
+ var value = last(arguments);
+
+ args_map.set_cached_value(args, value);
+ };
+ rv.initialize = function() {
+ var args = arguments,
+ my_context = options.context || this;
+ args_map.put(args, new Constraint(function() {
+ return getter_fn.apply(my_context, args);
+ }));
+ };
+ rv.has = function() {
+ return args_map.has(arguments);
+ };
return rv;
}; | Added more options to the memoize field | soney_constraintjs | train | js |
ea2ef21cd569044251d94fcb9c51622b7541dddb | diff --git a/salt/loader.py b/salt/loader.py
index <HASH>..<HASH> 100644
--- a/salt/loader.py
+++ b/salt/loader.py
@@ -120,8 +120,7 @@ def grains(opts):
opts['grains'] = {}
load = Loader(module_dirs, opts, 'grain')
grains = load.gen_grains()
- if 'grains' in opts:
- grains.update(opts['grains'])
+ grains.update(opts['grains'])
return grains | Do not check for 'grains' key in opts, it will always have a grains key | saltstack_salt | train | py |
041120061c8b1e7ef5f2c87882b39d50e3b2d860 | diff --git a/src/FrontendAsset.php b/src/FrontendAsset.php
index <HASH>..<HASH> 100755
--- a/src/FrontendAsset.php
+++ b/src/FrontendAsset.php
@@ -239,6 +239,19 @@ class FrontendAsset
}
/**
+ * Add a package.
+ *
+ * @param array $container_settings
+ * @param array $config
+ *
+ * @return void
+ */
+ public static function package($container_settings, $config = [])
+ {
+ self::loadContainer($container_settings, $config);
+ }
+
+ /**
* Add new asset after another asset in its array.
*
* @param array $container_settings
@@ -294,6 +307,9 @@ class FrontendAsset
}
if (!empty($config) && method_exists(self::$containers[$class_name], 'config')) {
+ if (!is_array($config)) {
+ $config = [$config];
+ }
self::$containers[$class_name]->config(...$config);
}
} | Added a method alias (more sensible name) | hnhdigital-os_laravel-frontend-asset-loader | train | php |
1de3b239fe0d8a08aa2ace3817f889a22d9a4271 | diff --git a/test/history_test.js b/test/history_test.js
index <HASH>..<HASH> 100644
--- a/test/history_test.js
+++ b/test/history_test.js
@@ -163,6 +163,18 @@ describe('History', function() {
assert.equal(lastEvent.state.is, 'end');
});
});
+
+ describe('synchronously', function() {
+ before(async function(done) {
+ await browser.visit('/');
+ done();
+ });
+
+ it('should make state changes available to the next line of code', function() {
+ browser.history.pushState({ is: 'start' }, null, '/start');
+ browser.assert.url('/start');
+ });
+ });
});
describe('replaceState', function() {
@@ -200,6 +212,18 @@ describe('History', function() {
assert(window.popstate);
});
});
+
+ describe('synchronously', function() {
+ before(async function(done) {
+ await browser.visit('/');
+ done();
+ });
+
+ it('should make state changes available to the next line of code', function() {
+ browser.history.replaceState({ is: 'start' }, null, '/start');
+ browser.assert.url('/start');
+ });
+ });
});
@@ -517,4 +541,3 @@ describe('History', function() {
browser.destroy();
});
});
- | Add failing tests for immediately-available pushState and replaceState results. | assaf_zombie | train | js |
b136ab4635b49a8e9d6933bd4b9c6011e668f8d9 | diff --git a/lib/runner/extensions/request.command.js b/lib/runner/extensions/request.command.js
index <HASH>..<HASH> 100644
--- a/lib/runner/extensions/request.command.js
+++ b/lib/runner/extensions/request.command.js
@@ -176,6 +176,7 @@ module.exports = {
if (!replayed && context.replay) {
pload = _.clone(payload);
+ pload.context = context;
// queue the request again
self.queue('request', pload);
return next((err && abortOnError) ? err : null, nextPayload, err); | provide the request context in the payload when replaying | postmanlabs_postman-runtime | train | js |
fcb9703d2700be50dd81c7d8d73a6436bdf5be73 | diff --git a/src/tinymce.js b/src/tinymce.js
index <HASH>..<HASH> 100644
--- a/src/tinymce.js
+++ b/src/tinymce.js
@@ -41,6 +41,7 @@ angular.module('ui.tinymce', [])
var args;
ed.on('init', function(args) {
ngModel.$render();
+ ngModel.$setPristine();
});
// Update model on button click
ed.on('ExecCommand', function (e) { | On initialization make sure model is pristine | angular-ui_ui-tinymce | train | js |
84e438caf4d7dff5c44cc6f779dc9d4703fcbe0e | diff --git a/i3pystatus/mpd.py b/i3pystatus/mpd.py
index <HASH>..<HASH> 100644
--- a/i3pystatus/mpd.py
+++ b/i3pystatus/mpd.py
@@ -114,7 +114,7 @@ class MPD(IntervalModule):
"bitrate": int(status.get("bitrate", 0)),
}
- if not fdict["title"]:
+ if not fdict["title"] and "file" in currentsong:
fdict["filename"] = '.'.join(
basename(currentsong["file"]).split('.')[:-1])
else: | Ensure currentsong dictionary has "file" key | enkore_i3pystatus | train | py |
23fbbd5c9a8aa209656bbd28519c1b454a354415 | diff --git a/lib/wordless/wordless_cli.rb b/lib/wordless/wordless_cli.rb
index <HASH>..<HASH> 100644
--- a/lib/wordless/wordless_cli.rb
+++ b/lib/wordless/wordless_cli.rb
@@ -29,8 +29,7 @@ module Wordless
Dir.chdir(name)
install_wordless
- create_theme(name)
- activate_theme(name)
+ create_and_activate_theme(name)
set_permalinks
end
@@ -107,10 +106,10 @@ module Wordless
WordPressTools::CLI.new.invoke('new', [name], options)
end
- def activate_theme(name)
+ def create_and_activate_theme(name)
at_wordpress_root do
info("Activating theme...")
- run_command("wp theme activate #{name}") || error("Cannot activate theme '#{name}'")
+ run_command("wp wordless theme create #{name}") || error("Cannot activate theme '#{name}'")
success("Done!")
end
end | use internal wordless commands to install and activate theme | welaika_wordless_gem | train | rb |
d913b10fd25cd76d6cca14ecc70bb0da11007b21 | diff --git a/lib/oj/version.rb b/lib/oj/version.rb
index <HASH>..<HASH> 100644
--- a/lib/oj/version.rb
+++ b/lib/oj/version.rb
@@ -1,5 +1,5 @@
module Oj
# Current version of the module.
- VERSION = '2.9.4'
+ VERSION = '2.9.5b1'
end | added monkey patch to Object for to_json and made JSON::ParseError not warn if already defined | ohler55_oj | train | rb |
569b7eaca0f07bcddfe2080227ef4684b961ad4c | diff --git a/hues/console.py b/hues/console.py
index <HASH>..<HASH> 100644
--- a/hues/console.py
+++ b/hues/console.py
@@ -8,10 +8,6 @@ from .huestr import Hues
CONFIG_FNAME = '.hues.yml'
-if sys.version_info.major == 2:
- class FileNotFoundError(IOError):
- '''Implement FileNotFoundError in Python 2'''
-
class InvalidConfiguration(Exception):
'''Raise when configuration is invalid.'''
@@ -39,7 +35,7 @@ class _Console(object):
if type(conf) is not dict:
raise InvalidConfiguration('Configuration at %s is not a dictionary.' % confl)
return conf
- except FileNotFoundError:
+ except EnvironmentError:
parent = os.path.dirname(cdir)
if recurse and parent != cdir:
return _load(parent, recurse=True) | Switch FileNotFoundError to EnvironmentError | prashnts_hues | train | py |
c000efc7b151e7f3f75c4b5a296ff104ac281659 | diff --git a/niworkflows/info.py b/niworkflows/info.py
index <HASH>..<HASH> 100644
--- a/niworkflows/info.py
+++ b/niworkflows/info.py
@@ -49,7 +49,8 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.5',
]
-REQUIRES = ['nipype', 'future', 'nilearn', 'sklearn', 'pandas', 'matplotlib']
+REQUIRES = ['nipype', 'future', 'nilearn', 'sklearn', 'pandas', 'matplotlib',
+ 'jinja2']
SETUP_REQUIRES = []
REQUIRES += SETUP_REQUIRES | add jinja2 as requirement | poldracklab_niworkflows | train | py |
cebfa1b1f91a9644f5dab898472cddc409ef7aca | diff --git a/formatter.js b/formatter.js
index <HASH>..<HASH> 100644
--- a/formatter.js
+++ b/formatter.js
@@ -198,7 +198,7 @@ function toWorksheet(sheetname, messageIE, depthMax) {
}
let worksheet = xlsx.utils.aoa_to_sheet(worksheet_data);
worksheet['!cols'] = [];
- for (let i = 0; i < depthMax - 1; i++) {
+ for (let i = 0; i < depthMax; i++) {
worksheet['!cols'].push({wch: 3});
}
for (let cell in styles) { | Fix wrong indexing for setting colum width | gsongsong_3gpp-message-formatter-ran2 | train | js |
6bcdaff76fed2b140e0f6906f19d97f285bef097 | diff --git a/spillway/forms/fields.py b/spillway/forms/fields.py
index <HASH>..<HASH> 100644
--- a/spillway/forms/fields.py
+++ b/spillway/forms/fields.py
@@ -123,8 +123,8 @@ class GeometryFileField(forms.FileField):
geoms = gdal.DataSource(fname)[0].get_geoms()
geom = reduce(lambda g1, g2: g1.union(g2), geoms)
if not geom.srs:
- raise gdal.OGRException('Cannot determine SRS')
- except (gdal.OGRException, gdal.OGRIndexError):
+ raise gdal.GDALException('Cannot determine SRS')
+ except (gdal.GDALException, IndexError):
raise forms.ValidationError(
GeometryField.default_error_messages['invalid_geom'],
code='invalid_geom')
@@ -159,7 +159,7 @@ class OGRGeometryField(forms.GeometryField):
value = Envelope(value.split(',')).polygon.ExportToWkt()
try:
geom = gdal.OGRGeometry(value, srs=getattr(sref, 'wkt', None))
- except (gdal.OGRException, TypeError, ValueError):
+ except (gdal.GDALException, TypeError, ValueError):
raise forms.ValidationError(self.error_messages['invalid_geom'],
code='invalid_geom')
if not geom.srs: | Use GDALException, OGRException is removed | bkg_django-spillway | train | py |
824ad4274a6de5bacb67bce892faaeb0094977b2 | diff --git a/api_test.go b/api_test.go
index <HASH>..<HASH> 100644
--- a/api_test.go
+++ b/api_test.go
@@ -1194,7 +1194,7 @@ func TestDeleteContainers(t *testing.T) {
func TestDeleteImages(t *testing.T) {
//FIXME: Implement this test
- t.Skip("Test not implemented")
+ t.Log("Test not implemented")
}
// Mocked types for tests | Change t.Skip to t.Log in tests for go<I> compatibility | moby_moby | train | go |
22c54484aca795004ce288c2cd2eb431d9fa2951 | diff --git a/tests/test_main.py b/tests/test_main.py
index <HASH>..<HASH> 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -6,12 +6,12 @@ from datetime import datetime
import pytest
-from mutmut import mutate, Context
from mutmut.__main__ import main, python_source_files, popen_streaming_output
from click.testing import CliRunner
pytestmark = [pytest.mark.skipif(sys.version_info < (3, 0), reason="Don't check Python 3 syntax in Python 2")]
+in_travis = os.environ['PATH'].startswith('/home/travis/')
file_to_mutate_lines = [
"def foo(a, b):",
@@ -107,6 +107,7 @@ def test_python_source_files():
assert list(python_source_files('.', ['./tests'])) == ['./foo.py']
+@pytest.mark.skipif(in_travis, reason='This test does not work on TravisCI')
def test_timeout():
start = datetime.now() | Skipped test that does not work on travis | boxed_mutmut | train | py |
1f600cbd17f7de0f3dff09e51297763c7a57ac38 | diff --git a/dataviews/dataviews.py b/dataviews/dataviews.py
index <HASH>..<HASH> 100644
--- a/dataviews/dataviews.py
+++ b/dataviews/dataviews.py
@@ -70,6 +70,21 @@ class DataCurves(DataLayer):
+class DataHistogram(DataLayer):
+
+ bin_labels = param.List(default=[])
+
+ def __init__(self, hist, edges, **kwargs):
+ self.hist = hist
+ self.edges = edges
+ super(DataHistogram, self).__init__(None, **kwargs)
+
+ @property
+ def ndims(self):
+ return len(self.edges)
+
+
+
class DataOverlay(DataLayer, Overlay):
"""
A DataOverlay can contain a number of DataLayer objects, which are to be | Added DataHistogram to dataviews | pyviz_holoviews | train | py |
452ca93af47bce477778d9682361353f276776b8 | diff --git a/magpie/handler/note.py b/magpie/handler/note.py
index <HASH>..<HASH> 100644
--- a/magpie/handler/note.py
+++ b/magpie/handler/note.py
@@ -53,7 +53,7 @@ class NoteHandler(BaseHandler):
note_contents = ''.join(tmp)
f = open(path, 'w')
- f.write(note_contents)
+ f.write(note_contents.encode('utf8'))
f.close()
self.application.git.add(path) | fixed bug preventing unicode characters in notes | charlesthomas_magpie | train | py |
bca61fc469b8730831fa1fe9a366aa5d49b97bab | diff --git a/galpy/potential/__init__.py b/galpy/potential/__init__.py
index <HASH>..<HASH> 100644
--- a/galpy/potential/__init__.py
+++ b/galpy/potential/__init__.py
@@ -48,6 +48,7 @@ from . import PerfectEllipsoidPotential
from . import IsothermalDiskPotential
from . import NumericalPotentialDerivativesMixin
from . import HomogeneousSpherePotential
+from . import interpSphericalPotential
#
# Functions
#
@@ -164,6 +165,7 @@ PerfectEllipsoidPotential= PerfectEllipsoidPotential.PerfectEllipsoidPotential
IsothermalDiskPotential= IsothermalDiskPotential.IsothermalDiskPotential
NumericalPotentialDerivativesMixin= NumericalPotentialDerivativesMixin.NumericalPotentialDerivativesMixin
HomogeneousSpherePotential= HomogeneousSpherePotential.HomogeneousSpherePotential
+interpSphericalPotential= interpSphericalPotential.interpSphericalPotential
#Wrappers
DehnenSmoothWrapperPotential= DehnenSmoothWrapperPotential.DehnenSmoothWrapperPotential
SolidBodyRotationWrapperPotential= SolidBodyRotationWrapperPotential.SolidBodyRotationWrapperPotential | Add interpSphericalPotential to top galpy.potential level | jobovy_galpy | train | py |
9fdf21af247f1b5e29feccf1a8eb28f5eb0ec1a2 | diff --git a/lottie/src/main/java/com/airbnb/lottie/parser/ContentModelParser.java b/lottie/src/main/java/com/airbnb/lottie/parser/ContentModelParser.java
index <HASH>..<HASH> 100644
--- a/lottie/src/main/java/com/airbnb/lottie/parser/ContentModelParser.java
+++ b/lottie/src/main/java/com/airbnb/lottie/parser/ContentModelParser.java
@@ -70,6 +70,9 @@ class ContentModelParser {
break;
case "mm":
model = MergePathsParser.parse(reader);
+ composition.addWarning("Animation contains merge paths. Merge paths are only " +
+ "supported on KitKat+ and must be manually enabled by calling " +
+ "enableMergePathsForKitKatAndAbove().");
break;
case "rp":
model = RepeaterParser.parse(reader, composition); | Added a warning for merge paths | airbnb_lottie-android | train | java |
760416219dc34751d30f0afcbf10a33cd004b066 | diff --git a/context_test.go b/context_test.go
index <HASH>..<HASH> 100644
--- a/context_test.go
+++ b/context_test.go
@@ -110,7 +110,9 @@ func TestLibsassError(t *testing.T) {
}
ctx.Cookies[0] = Cookie{
- "foo()", SampleCB, &ctx,
+ Sign: "foo()",
+ Fn: TestCallback,
+ Ctx: &ctx,
}
err := ctx.Compile(in, &out) | expressive, its where it's at :boom: | wellington_go-libsass | train | go |
7e4fd623e6132946412d74e244f602d63e0839cd | diff --git a/montblanc/impl/biro/v4/gpu/RimeGaussBSum.py b/montblanc/impl/biro/v4/gpu/RimeGaussBSum.py
index <HASH>..<HASH> 100644
--- a/montblanc/impl/biro/v4/gpu/RimeGaussBSum.py
+++ b/montblanc/impl/biro/v4/gpu/RimeGaussBSum.py
@@ -45,6 +45,7 @@ KERNEL_TEMPLATE = string.Template("""
#include <cstdio>
#include \"math_constants.h\"
#include <montblanc/include/abstraction.cuh>
+#include <montblanc/include/brightness.cuh>
#define NA ${na}
#define NBL ${nbl} | Include brightness.cuh in the Gauss B Sum kernel, which now contains all the create_brightness functions | ska-sa_montblanc | train | py |
4e9274aac781c83084156b24ed3a92f0d1630c51 | diff --git a/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/indexing/hierarchy/OntologyIndexImpl.java b/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/indexing/hierarchy/OntologyIndexImpl.java
index <HASH>..<HASH> 100644
--- a/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/indexing/hierarchy/OntologyIndexImpl.java
+++ b/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/indexing/hierarchy/OntologyIndexImpl.java
@@ -65,9 +65,11 @@ public class OntologyIndexImpl extends IndexedObjectCache implements
private void indexPredefined() {
// index predefined entities
// TODO: what to do if someone tries to delete them?
- this.indexedOwlThing = directAxiomInserter_
+ ElkAxiomIndexerVisitor tmpIndexer = new ElkAxiomIndexerVisitor(this, null, new DirectIndexUpdater(), true);
+
+ this.indexedOwlThing = tmpIndexer
.indexClassDeclaration(PredefinedElkClass.OWL_THING);
- this.indexedOwlNothing = directAxiomInserter_
+ this.indexedOwlNothing = tmpIndexer
.indexClassDeclaration(PredefinedElkClass.OWL_NOTHING);
} | fix NPE resulting from using the direct indexers before creating them | liveontologies_elk-reasoner | train | java |
b70c47f0da9c8a2d8fda8c32e39f273b8b73d34e | diff --git a/tests/test_prompt.py b/tests/test_prompt.py
index <HASH>..<HASH> 100755
--- a/tests/test_prompt.py
+++ b/tests/test_prompt.py
@@ -15,7 +15,6 @@ from cookiecutter.compat import patch, unittest
from cookiecutter import prompt
if 'windows' in platform.platform().lower():
-
old_stdin = sys.stdin
class X(object):
@@ -56,8 +55,10 @@ class TestPrompt(unittest.TestCase):
@patch('cookiecutter.prompt.read_response', lambda x=u'': u'\n')
def test_unicode_prompt_for_templated_config(self):
- context = {"cookiecutter": {"project_name": u"A New Project",
- "pkg_name": "{{ project_name|replace(' ', '')|lower }}"}}
+ context = {"cookiecutter": OrderedDict([
+ ("project_name", u"A New Project"),
+ ("pkg_name", u"{{ project_name|lower|replace(' ', '') }}")
+ ])}
cookiecutter_dict = prompt.prompt_for_config(context)
self.assertEqual(cookiecutter_dict, {"project_name": u"A New Project", | emulating JSON OrderedDict usage in test | audreyr_cookiecutter | train | py |
d40cde8503f49902f009eb218b9e48761dc9ebe9 | diff --git a/lib/socket.js b/lib/socket.js
index <HASH>..<HASH> 100644
--- a/lib/socket.js
+++ b/lib/socket.js
@@ -181,8 +181,17 @@ Socket.prototype.join = function (name, fn) {
*/
Socket.prototype.leave = function (name, fn) {
- var nsp = this.namespace.name;
- this.store.leave(this.id, (nsp === '' ? '' : (nsp + '/')) + name, fn);
+ var nsp = this.namespace.name
+ , name = (nsp === '' ? '' : (nsp + '/')) + name;
+
+ this.manager.onLeave(this.id, name);
+ this.manager.store.publish('leave', this.id, name);
+
+ if (fn) {
+ this.log.warn('Client#leave callback is deprecated');
+ fn();
+ }
+
return this;
}; | Refactored Socket#leave | socketio_socket.io | train | js |
d1b95c9d49a59051e0e931f0baa4c826e04515d1 | diff --git a/lib/rib/core/multiline.rb b/lib/rib/core/multiline.rb
index <HASH>..<HASH> 100644
--- a/lib/rib/core/multiline.rb
+++ b/lib/rib/core/multiline.rb
@@ -49,8 +49,11 @@ module Rib::Multiline
"syntax error, unexpected \\$end" ,
# rubinius
"expecting keyword_end" ,
+ "expecting keyword_then" ,
+ "expecting keyword_when" ,
+ "expecting keyword_do_cond" ,
"expecting \\$end" ,
- "expecting '?.+'?( or '.+')*" ,
+ "expecting '.+'( or '.+')*" ,
"missing '.+' for '.+' started on line \\d+"].join('|'))
when 'jruby'; Regexp.new(
[ # string or regexp | ok, i shouldn't be too lazy. should be all of for rubinius | godfat_rib | train | rb |
815d86a44692eb385df9be6fd4297f67052c1a5a | diff --git a/src/octant.js b/src/octant.js
index <HASH>..<HASH> 100644
--- a/src/octant.js
+++ b/src/octant.js
@@ -307,6 +307,8 @@ export class Octant {
split() {
+ const p = new THREE.Vector3();
+
const min = this.min;
const mid = this.center().clone();
const max = this.max;
@@ -342,20 +344,20 @@ export class Octant {
while(i >= 0) {
- v.fromArray(this.points[i]);
+ p.fromArray(this.points[i]);
if(this.dataSets[i].size > 0) {
// Unfold data aggregations. Each entry is one point.
for(data of this.dataSets[i].values()) {
- this.addToChild(v, data);
+ this.addToChild(p, data);
}
} else {
- this.addToChild(v);
+ this.addToChild(p);
} | Fixed static variable madness.
A static vector was used in the context-sensitive split method which
could lead to unexpected behaviour. | vanruesc_sparse-octree | train | js |
f2c99f3a6312ac20fe8eac2f802aceb754d51f78 | diff --git a/slackminion/plugin/base.py b/slackminion/plugin/base.py
index <HASH>..<HASH> 100644
--- a/slackminion/plugin/base.py
+++ b/slackminion/plugin/base.py
@@ -67,7 +67,7 @@ class BasePlugin(object):
else:
self._bot.send_message(channel, text, thread, reply_broadcast)
- def start_timer(self, duration, func, *args, **kwargs):
+ def start_timer(self, duration, func, *args):
"""
Schedules a function to be called after some period of time.
@@ -76,7 +76,7 @@ class BasePlugin(object):
* args - arguments to pass to the function
"""
if self._bot.runnable:
- t = threading.Timer(duration, self._timer_callback, (func, args, kwargs))
+ t = threading.Timer(duration, self._timer_callback, (func, args))
self._timer_callbacks[func] = t
self._bot.timers.append(t)
t.start()
@@ -96,9 +96,9 @@ class BasePlugin(object):
t.cancel()
del self._timer_callbacks[func]
- def _timer_callback(self, func, *args, **kwargs):
+ def _timer_callback(self, func, args):
try:
- func(*args, **kwargs)
+ func(*args)
except Exception as e:
self.log.exception("Caught exception executing function: {}".format(func))
finally: | revert kwargs change | arcticfoxnv_slackminion | train | py |
586259997aba2a18439ccf3b038ca6d49dd0a7dc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,5 +27,6 @@ setup(
'parsedatetime',
'PyYAML',
'lxml',
- 'python-magic',),
+ 'python-magic',
+ 'msgpack-python'),
) | Add messagepack to the list of dependencies, since runtime wont run without it. | armet_python-armet | train | py |
a2595a1f0f066390c5827818417f045b3b042164 | diff --git a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb
+++ b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb
@@ -1,5 +1,4 @@
require 'active_support/core_ext/object/blank'
-require 'active_support/core_ext/object/duplicable'
require 'active_support/core_ext/array/extract_options'
class Class | delegating_attributes.rb does not use duplicable | rails_rails | train | rb |
634fc6c3be32808e78809ed5b6689fc354d881a3 | diff --git a/packages/ember-handlebars-compiler/lib/main.js b/packages/ember-handlebars-compiler/lib/main.js
index <HASH>..<HASH> 100644
--- a/packages/ember-handlebars-compiler/lib/main.js
+++ b/packages/ember-handlebars-compiler/lib/main.js
@@ -33,11 +33,25 @@ Ember.assert("Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater. Includ
*/
Ember.Handlebars = objectCreate(Handlebars);
+function makeBindings(options) {
+ var hash = options.hash,
+ hashType = options.hashTypes;
+
+ for (var prop in hash) {
+ if (hashType[prop] === 'ID') {
+ hash[prop + 'Binding'] = hash[prop];
+ hashType[prop + 'Binding'] = 'STRING';
+ delete hash[prop];
+ delete hashType[prop];
+ }
+ }
+}
+
Ember.Handlebars.helper = function(name, value) {
if (Ember.View.detect(value)) {
Ember.Handlebars.registerHelper(name, function(options) {
Ember.assert("You can only pass attributes as parameters to a application-defined helper", arguments.length < 3);
- options.hash = Ember.Handlebars.resolveHash(this, options.hash, options);
+ makeBindings(options);
return Ember.Handlebars.helpers.view.call(this, value, options);
});
} else { | Make view helpers work with bindings | emberjs_ember.js | train | js |
6f27ffd4b8f29af55bfaa9fdbe121bb0d5ef1e6c | diff --git a/packages/jest-configurator-web/src/jest-configurator.js b/packages/jest-configurator-web/src/jest-configurator.js
index <HASH>..<HASH> 100644
--- a/packages/jest-configurator-web/src/jest-configurator.js
+++ b/packages/jest-configurator-web/src/jest-configurator.js
@@ -45,7 +45,7 @@ export default (cwd, options = {}) => {
},
globals: {
"ts-jest": {
- tsConfigFile: "../tsconfig.jest.json"
+ tsConfigFile: path.resolve(__dirname, "../tsconfig.jest.json")
}
},
transformIgnorePatterns: [ | feat(TDP-<I>): updated path again (#<I>) | newsuk_times-components | train | js |
9c839b64b72b0123a7462098ecbed15e804f20cb | diff --git a/src/main/java/org/freecompany/redline/header/Os.java b/src/main/java/org/freecompany/redline/header/Os.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/freecompany/redline/header/Os.java
+++ b/src/main/java/org/freecompany/redline/header/Os.java
@@ -23,5 +23,6 @@ public enum Os {
MINT,
OS390,
VMESA,
- LINUX390
+ LINUX390,
+ MACOSX
} | added new os type MACOSX (ref rpm-<I>) | craigwblake_redline | train | java |
220c3f66ed2db53a5f3b38ad2ece5015e9c00dbc | diff --git a/src/toil/batchSystems/abstractGridEngineBatchSystem.py b/src/toil/batchSystems/abstractGridEngineBatchSystem.py
index <HASH>..<HASH> 100644
--- a/src/toil/batchSystems/abstractGridEngineBatchSystem.py
+++ b/src/toil/batchSystems/abstractGridEngineBatchSystem.py
@@ -30,7 +30,11 @@ from bd2k.util.objects import abstractclassmethod
from toil.batchSystems.abstractBatchSystem import BatchSystemSupport
from toil.batchSystems import registry
-from toil.cwl import cwltoil
+try:
+ from toil.cwl.cwltoil import CWL_INTERNAL_JOBS
+except ImportError:
+ # CWL extra not installed
+ CWL_INTERNAL_JOBS = ()
logger = logging.getLogger(__name__)
@@ -311,7 +315,7 @@ class AbstractGridEngineBatchSystem(BatchSystemSupport):
def issueBatchJob(self, jobNode):
# Avoid submitting internal jobs to the batch queue, handle locally
- if jobNode.jobName.startswith(cwltoil.CWL_INTERNAL_JOBS):
+ if jobNode.jobName.startswith(CWL_INTERNAL_JOBS):
jobID = self.localBatch.issueBatchJob(jobNode)
else:
self.checkResourceRequest(jobNode.memory, jobNode.cores, jobNode.disk) | Fix GridEngine batchSystem when CWL extra isn't installed | DataBiosphere_toil | train | py |
3d570ecb2f92bf41ec7eb7693ed5de0f3998fb4e | diff --git a/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go b/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go
index <HASH>..<HASH> 100644
--- a/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go
+++ b/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go
@@ -203,7 +203,7 @@ func TestSchemaChange(t *testing.T) {
defer cluster.PanicHandler(t)
t.Run("create schema", func(t *testing.T) {
- assert.Equal(t, 2, len(clusterInstance.Keyspaces[0].Shards))
+ assert.Equal(t, 1, len(clusterInstance.Keyspaces[0].Shards))
testWithInitialSchema(t)
})
for i := 0; i < countIterations; i++ { | fixed test number of shards | vitessio_vitess | train | go |
1f906e359dd20692acd742da5b51d63e2e1044d4 | diff --git a/lib/http.js b/lib/http.js
index <HASH>..<HASH> 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -158,7 +158,7 @@ exports.found = function( res, data, status, location ){
**/
exports.seeOther = function( res, data, status ){
status = status || 303;
- res.status(status).send( data ||'See Other'),
+ res.status(status).send( data ||'See Other')
};
/**
@@ -479,4 +479,4 @@ exports.httpVersionNotSupported = function( res, data, status ){
exports.networkAuthenticationRequired = function( res, data, status ){
status = status || 511;
res.status(status).send( data ||'Network Authentication Required')
-};
\ No newline at end of file
+}; | fix a trailing comma | node-tastypie_tastypie | train | js |
955631f4c645aabb403c9425ad4f25a95d777ae3 | diff --git a/cherrypy/process/plugins.py b/cherrypy/process/plugins.py
index <HASH>..<HASH> 100644
--- a/cherrypy/process/plugins.py
+++ b/cherrypy/process/plugins.py
@@ -460,7 +460,7 @@ class BackgroundTask(threading.Thread):
it won't delay stopping the whole process.
"""
- def __init__(self, interval, function, args=[], kwargs={}, bus=None):
+ def __init__(self, interval, function, args=[], kwargs={}, bus=None, *, daemon=True):
threading.Thread.__init__(self)
self.interval = interval
self.function = function
@@ -468,6 +468,10 @@ class BackgroundTask(threading.Thread):
self.kwargs = kwargs
self.running = False
self.bus = bus
+ if daemon is not None:
+ self.daemon = daemon
+ else:
+ self.daemon = current_thread().daemon
def cancel(self):
self.running = False
@@ -487,9 +491,6 @@ class BackgroundTask(threading.Thread):
# Quit on first error to avoid massive logs.
raise
- def _set_daemon(self):
- return True
-
class Monitor(SimplePlugin):
"""WSPBus listener to periodically run a callback in its own thread.""" | Python<I> doesn't use setdaemon for initializing the daemon var anymore
So BackgroundTask would always use the current threads daemon mode on py<I>
--HG--
branch : cherrypy-<I>.x | cherrypy_cheroot | train | py |
4dfcdcfa2e7c7c187e9d482ce7ddcf68afe5f6e1 | diff --git a/angr/analyses/sse.py b/angr/analyses/sse.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/sse.py
+++ b/angr/analyses/sse.py
@@ -778,7 +778,7 @@ class SSE(Analysis):
# Perform a topological sort
sorted_nodes = networkx.topological_sort(graph)
- nodes = [ n for n in sorted_nodes if graph.in_degree(n) > 1 ]
+ nodes = [ n for n in sorted_nodes if graph.in_degree(n) > 1 and n.looping_times == 0 ]
# Reorder nodes based on post-dominance relations
nodes = sorted(nodes, | Fixed a bug that may crashes SSE | angr_angr | train | py |
d839f7eb2fc37f769b495204e1aa5bee3f54b56c | diff --git a/lib/redbooth-ruby/client.rb b/lib/redbooth-ruby/client.rb
index <HASH>..<HASH> 100644
--- a/lib/redbooth-ruby/client.rb
+++ b/lib/redbooth-ruby/client.rb
@@ -1,6 +1,7 @@
module RedboothRuby
class Client
- RESOURCES = [:me, :user, :task, :organization, :person, :project, :conversation, :membership]
+ RESOURCES = [:me, :user, :task, :organization, :person, :project,
+ :conversation, :membership, :comment]
attr_reader :session, :options | Registered comment in redbooth client as allowed endpoint | redbooth_redbooth-ruby | train | rb |
ae6f748a50e750fff4538e962418f4f06e6d25eb | diff --git a/stimela_misc/stimela-test-ngc417.py b/stimela_misc/stimela-test-ngc417.py
index <HASH>..<HASH> 100644
--- a/stimela_misc/stimela-test-ngc417.py
+++ b/stimela_misc/stimela-test-ngc417.py
@@ -572,7 +572,7 @@ recipe.add("cab/ddfacet", "ddfacet_test",
"Data-ChunkHours": 0.5,
"Data-Sort": True
},
- input=INPUT, output=OUTPUT, shared_memory="14gb",
+ input=INPUT, output=OUTPUT, shared_memory="36gb",
label="image_target_field_r0ddfacet:: Make a test image using ddfacet")
lsm0=PREFIX+'-LSM0' | Update stimela-test-ngc<I>.py
Give ddf more sharedmem | SpheMakh_Stimela | train | py |
758490cc7efdaa04579eb93dd3d0f91bf33c5da1 | diff --git a/housekeeper/store/api.py b/housekeeper/store/api.py
index <HASH>..<HASH> 100644
--- a/housekeeper/store/api.py
+++ b/housekeeper/store/api.py
@@ -5,6 +5,7 @@ from typing import List
from pathlib import Path
import alchy
+from sqlalchemy import func
from housekeeper.add.core import AddHandler
from . import models
@@ -68,7 +69,13 @@ class BaseHandler:
.filter(self.Bundle.name == bundle))
if tags:
- query = query.join(self.File.tags).filter(self.Tag.name.in_(tags))
+ # require records to match ALL tags
+ query = (
+ query.join(self.File.tags)
+ .filter(self.Tag.name.in_(tags))
+ .group_by(models.File.id)
+ .having(func.count(models.Tag.name) == len(tags))
+ )
if version:
query = query.join(self.File.version).filter(self.Version.id == version) | filter files that have ALL matching tags in api | Clinical-Genomics_housekeeper | train | py |
381ad415033ef79feb77e4fca2887a96b113fde9 | diff --git a/lib/Pomander/Builder.php b/lib/Pomander/Builder.php
index <HASH>..<HASH> 100644
--- a/lib/Pomander/Builder.php
+++ b/lib/Pomander/Builder.php
@@ -51,8 +51,8 @@ class Builder
$app->env->multi_role_support("db",$app);
});
- if($first) $this->inject_default($app);
require dirname(__DIR__).'/tasks/default.php';
+ if($first) $this->inject_default($app);
}
/* protected */ | fixed a bug where the development config is loaded before the default
tasks. | tamagokun_pomander | train | php |
9c932a04312120f612f6c6dc9623528ea2086c42 | diff --git a/sigh/lib/sigh/local_manage.rb b/sigh/lib/sigh/local_manage.rb
index <HASH>..<HASH> 100644
--- a/sigh/lib/sigh/local_manage.rb
+++ b/sigh/lib/sigh/local_manage.rb
@@ -77,7 +77,7 @@ module Sigh
UI.message ""
UI.message "Summary"
UI.message "#{profiles.count} installed profiles"
- UI.message "#{profiles_expired.count} are expired".red
+ UI.message "#{profiles_expired.count} are expired".red if profiles_expired.count > 0
UI.message "#{profiles_soon.count} are valid but will expire within 30 days".yellow
UI.message "#{profiles_valid.count} are valid".green | No need to print out a red warning when there is no expired provisioning profile | fastlane_fastlane | train | rb |
074c9a2c1267c31bf505400be7df5a01d3a456ec | diff --git a/lib/spidr/agent.rb b/lib/spidr/agent.rb
index <HASH>..<HASH> 100644
--- a/lib/spidr/agent.rb
+++ b/lib/spidr/agent.rb
@@ -165,8 +165,6 @@ module Spidr
@running == true
end
- alias start continue!
-
#
# Sets the history of links that were previously visited to the
# specified _new_history_. | Removed the alias from start to run. | postmodern_spidr | train | rb |
107f2f73fcd212add00678a93487d811f1fbb944 | diff --git a/src/Model/Behavior/FootprintBehavior.php b/src/Model/Behavior/FootprintBehavior.php
index <HASH>..<HASH> 100644
--- a/src/Model/Behavior/FootprintBehavior.php
+++ b/src/Model/Behavior/FootprintBehavior.php
@@ -2,6 +2,7 @@
namespace Muffin\Footprint\Model\Behavior;
use ArrayObject;
+use Cake\Database\Expression\IdentifierExpression;
use Cake\Event\Event;
use Cake\ORM\Behavior;
use Cake\ORM\Entity;
@@ -80,7 +81,18 @@ class FootprintBehavior extends Behavior
foreach (array_keys($config) as $field) {
$path = $this->config('propertiesMap.' . $field);
- if ($value = Hash::get((array)$options, $path)) {
+
+ $check = false;
+ $query->traverseExpressions(function ($expression) use (&$check, $field, $query) {
+ if ($expression instanceof IdentifierExpression) {
+ !$check && $check = $expression->getIdentifier() === $field;
+ return;
+ }
+ $alias = $this->_table->aliasField($field);
+ !$check && $check = preg_match('/' . $alias . '/', $expression->sql($query->valueBinder()));
+ });
+
+ if (!$check && $value = Hash::get((array)$options, $path)) {
$query->where([$this->_table->aliasField($field) => $value]);
}
} | Fix cases when identifier part of expression already
Sometimes, the field being using by the behavior is already part
of the find query which would cause an error or at the very least,
override the original intention. | UseMuffin_Footprint | train | php |
2b8f24998ebafe7257d50aa5ae90fa1a8ae5860f | diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -217,7 +217,7 @@ module ActiveRecord
end
def build_select(arel, selects)
- if selects.present?
+ unless selects.empty?
@implicit_readonly = false
# TODO: fix this ugly hack, we should refactor the callers to get an ARel compatible array.
# Before this change we were passing to ARel the last element only, and ARel is capable of handling an array | unless Array#empty? is faster than if Array#present? | rails_rails | train | rb |
a7510398179c51d357232ce9eda14d8e8741d0db | diff --git a/pkg/kvstore/etcd.go b/pkg/kvstore/etcd.go
index <HASH>..<HASH> 100644
--- a/pkg/kvstore/etcd.go
+++ b/pkg/kvstore/etcd.go
@@ -598,7 +598,7 @@ func connectEtcdClient(ctx context.Context, config *client.Config, cfgPath strin
lockSession: &ls,
firstSession: firstSession,
controllers: controller.NewManager(),
- latestStatusSnapshot: "No connection to etcd",
+ latestStatusSnapshot: "Waiting for initial connection to be established",
stopStatusChecker: make(chan struct{}),
extraOptions: opts,
limiter: rate.NewLimiter(rate.Limit(rateLimit), rateLimit), | kvstore: Improve initial status message
The initial status message of the etcd subsystem is:
```
KVStore: Ok No connection to etcd
```
This can be misleading as it does not indicate whether the etcd session
was ever established or not. Clarify this:
```
KVStore: Ok Waiting for initial connection to be established
``` | cilium_cilium | train | go |
642fe1b2482e8d5cb6c214ed629e4f134b038ead | diff --git a/lib/metro.rb b/lib/metro.rb
index <HASH>..<HASH> 100644
--- a/lib/metro.rb
+++ b/lib/metro.rb
@@ -59,8 +59,15 @@ module Metro
def load_game_files
$LOAD_PATH.unshift(Dir.pwd) unless $LOAD_PATH.include?(Dir.pwd)
- Dir['models/*.rb'].each {|model| require model }
- Dir['scenes/*.rb'].each {|scene| require scene }
+ load_paths 'models', 'scenes', 'lib'
+ end
+
+ def load_paths(*paths)
+ paths.flatten.compact.each {|path| load_path path }
+ end
+
+ def load_path(path)
+ Dir["#{path}/**/*.rb"].each {|model| require model }
end
def load_game_configuration(filename) | Games recurse for ruby files within model, scenes, and lib | burtlo_metro | train | rb |
3cfe078eb96efb7e9fb9470cfd52f770ec030556 | diff --git a/lib/dxruby_sdl/window.rb b/lib/dxruby_sdl/window.rb
index <HASH>..<HASH> 100644
--- a/lib/dxruby_sdl/window.rb
+++ b/lib/dxruby_sdl/window.rb
@@ -90,7 +90,7 @@ module DXRubySDL
option[:scale_x], option[:scale_y],
option[:center_x], option[:center_y],
x + option[:center_x], y + option[:center_y],
- SDL::Surface::TRANSFORM_SAFE)
+ 0)
end
def draw_font(x, y, string, font, hash = {}) | [fix #<I>] improved draw performance for Raspberry Pi. | takaokouji_dxruby_sdl | train | rb |
0d72d962d2eab38f261dc1cef1758587a3e20ee1 | diff --git a/src/satosa/frontends/saml2.py b/src/satosa/frontends/saml2.py
index <HASH>..<HASH> 100644
--- a/src/satosa/frontends/saml2.py
+++ b/src/satosa/frontends/saml2.py
@@ -322,7 +322,7 @@ class SAMLFrontend(FrontendModule):
valid_providers = valid_providers.lstrip("|")
parsed_endp = urlparse(endp)
url_map.append(("%s/%s$" % (valid_providers, parsed_endp.path),
- functools.partial(self.handle_authn_request, binding=binding)))
+ functools.partial(self.handle_authn_request, binding_in=binding)))
if "publish_metadata" in self.config:
metadata_path = urlparse(self.config["publish_metadata"])
@@ -496,6 +496,6 @@ class SAMLMirrorFrontend(SAMLFrontend):
valid_providers = valid_providers.lstrip("|")
parsed_endp = urlparse(endp)
url_map.append(("%s/[\s\S]+/%s/?.*$" % (valid_providers, parsed_endp.path),
- functools.partial(self.handle_authn_request, binding=binding)))
+ functools.partial(self.handle_authn_request, binding_in=binding)))
return url_map | Fix typo in keyword argument in partial function.
The correct arg name is 'binding_in', which if specified incorrectly as
'binding' will throw an exception. | IdentityPython_SATOSA | train | py |
af9fc899989c439aff45aecb24e65d7701b5d4d0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ setup(
'Programming Language :: Python :: 3',
],
install_requires=[
- "autobahn==17.5.1",
+ "autobahn==17.10.1",
],
tests_require=[
] | Updated autobahn requirement to match simpl-modelservice | simplworld_simpl-authenticator | train | py |
b479ece7b488e236418014f9dd1ff5db1877b522 | diff --git a/glymur/jp2k.py b/glymur/jp2k.py
index <HASH>..<HASH> 100644
--- a/glymur/jp2k.py
+++ b/glymur/jp2k.py
@@ -772,6 +772,19 @@ class Jp2k(Jp2kBox):
"""
self._subsampling_sanity_check()
+ # Must check the specified rlevel against the maximum.
+ if rlevel != 0:
+ # Must check the specified rlevel against the maximum.
+ codestream = self.get_codestream()
+ max_rlevel = codestream.segment[2].spcod[4]
+ if rlevel == -1:
+ # -1 is shorthand for the largest rlevel
+ rlevel = max_rlevel
+ elif rlevel < -1 or rlevel > max_rlevel:
+ msg = "rlevel must be in the range [-1, {0}] for this image."
+ msg = msg.format(max_rlevel)
+ raise IOError(msg)
+
with ExitStack() as stack:
try:
# Set decoding parameters. | Bring back check for bad rlevel. #<I>
OpenJPEG <I> needs the protection, it would seem. | quintusdias_glymur | train | py |
8ff728ed4d2c775b2664cb81e72fe7984a813917 | diff --git a/src/main/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSource.java b/src/main/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSource.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSource.java
+++ b/src/main/java/com/github/tomakehurst/wiremock/common/ssl/KeyStoreSource.java
@@ -1,12 +1,7 @@
package com.github.tomakehurst.wiremock.common.ssl;
import com.github.tomakehurst.wiremock.common.Source;
-import com.google.common.io.ByteStreams;
-import org.apache.commons.codec.digest.DigestUtils;
-import javax.xml.bind.DatatypeConverter;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyStore; | Removed some redundant imports that also break Java <I> compilation | tomakehurst_wiremock | train | java |
423944035106da39aa3788464e42c85b7275076c | diff --git a/pyap/source_US/data.py b/pyap/source_US/data.py
index <HASH>..<HASH> 100644
--- a/pyap/source_US/data.py
+++ b/pyap/source_US/data.py
@@ -100,9 +100,8 @@ In example below:
"Hoover Boulevard": "Hoover" is a street name
'''
street_name = r"""(?P<street_name>
- [a-zA-Z0-9\ \.]{0,31} # Seems like the longest US street is
- # 'Northeast Kentucky Industrial
- # Parkway'
+ [a-zA-Z0-9\ \.]{3,31} # Seems like the longest US street is
+ # 'Northeast Kentucky Industrial Parkway'
# https://atkinsbookshelf.wordpress.com/tag/longest-street-name-in-us/
)
""" | set the minimum street name length to 3 | vladimarius_pyap | train | py |
ab972a097619e905bfec6c359df825d09324e769 | diff --git a/src/helpers.js b/src/helpers.js
index <HASH>..<HASH> 100644
--- a/src/helpers.js
+++ b/src/helpers.js
@@ -14,11 +14,15 @@ module.exports.getDateTime = function () {
year, month, day, hour, min, sec;
year = date.getFullYear();
- month = (date.getMonth() + 1 < 10 ? '0' : '') + (date.getMonth() + 1);
- day = (date.getDate() < 10 ? '0' : '') + date.getDate();
- hour = (date.getHours() < 10 ? '0' : '') + date.getHours();
- min = (date.getMinutes() < 10 ? '0' : '') + date.getMinutes();
- sec = (date.getSeconds() < 10 ? '0' : '') + date.getSeconds();
+ month = this.pad(date.getMonth() + 1);
+ day = this.pad(date.getDate());
+ hour = this.pad(date.getHours());
+ min = this.pad(date.getMinutes());
+ sec = this.pad(date.getSeconds());
return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + sec;
+};
+
+module.exports.pad = function (value) {
+ return (value < 10 ? '0' : '') + value;
};
\ No newline at end of file | Improving code quality in helpers.js | SassDoc_sassdoc | train | js |
f5d554ffcac1b729d20c1938949051994af01967 | diff --git a/dusty/compiler/port_spec/__init__.py b/dusty/compiler/port_spec/__init__.py
index <HASH>..<HASH> 100644
--- a/dusty/compiler/port_spec/__init__.py
+++ b/dusty/compiler/port_spec/__init__.py
@@ -12,7 +12,7 @@ def _docker_compose_port_spec(host_forwarding_spec, host_port):
'mapped_host_port': str(host_port)}
def _virtualbox_port_spec(port):
- return {'guest_ip': LOCALHOST,
+ return {'guest_ip': '',
'guest_port': str(port),
'host_ip': LOCALHOST,
'host_port': str(port)}
@@ -72,5 +72,3 @@ def get_port_spec_document(expanded_active_specs):
add_host_names(host_forwarding_spec, port_spec, host_names)
forwarding_port += 1
return port_spec
-
- | Stop specifying guest IPs on port forwarding | gamechanger_dusty | train | py |
9bc91e25123ff7492d9feb3144ae41c3e3cfe1a7 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -73,6 +73,8 @@ function task_build_dattreact () {
.transform('reactify')
.transform(babelify, {presets: ['es2015', 'react'], sourceMaps: false})
.add(require.resolve('./react/index.js'), {entry: true})
+ .bundle()
+ .pipe(fs.createWriteStream(path.join(__dirname, 'build', process.env.DATT_REACT_JS_FILE)))
}
gulp.task('build-dattreact', task_build_dattreact) | fix react build by writing file
After all the rearchitecting of the build process, the dattreact file was not
actually being written. | moneybutton_yours-core | train | js |
d176107ffc764b26dec6bde5d077d1847804e4d1 | diff --git a/proxy.js b/proxy.js
index <HASH>..<HASH> 100644
--- a/proxy.js
+++ b/proxy.js
@@ -171,4 +171,4 @@
scope.Proxy['revocable'] = scope.Proxy.revocable;
scope['Proxy'] = scope.Proxy;
-})(typeof process !== "undefined" && {}.toString.call(process) === "[object process]" ? global : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : window);
+})(typeof process !== 'undefined' && {}.toString.call(process) == '[object process]' ? global : self); | Update to shortened version of environment detection. | GoogleChrome_proxy-polyfill | train | js |
fb310f0e32eef9bab9672a590f79e1f176e09b98 | diff --git a/core/graph.py b/core/graph.py
index <HASH>..<HASH> 100644
--- a/core/graph.py
+++ b/core/graph.py
@@ -110,6 +110,10 @@ def plotFCM(data, channel_names, transform=(None, None), plot2d_type='dot2d', ax
if len(channelIndexList) == 1:
# 1d so histogram plot
+ kwargs.setdefault('color', 'gray')
+ kwargs.setdefault('histtype', 'stepfilled')
+ #kwargs.setdefault('facecolor', 'green')
+
ch1i = channelIndexList[0]
pHandle = ax.hist(data[:, ch1i], **kwargs) | Updated defaults for histogram plots | eyurtsev_FlowCytometryTools | train | py |
1e896411c8f1fca0db488d5d7d4395e36d3c55b5 | diff --git a/src/stake-program.js b/src/stake-program.js
index <HASH>..<HASH> 100644
--- a/src/stake-program.js
+++ b/src/stake-program.js
@@ -646,6 +646,7 @@ export class StakeProgram {
keys: [
{pubkey: stakePubkey, isSigner: false, isWritable: true},
{pubkey: authorityBase, isSigner: true, isWritable: false},
+ {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},
],
programId: this.programId,
data, | fix: add Clock sysvar to AuthorizeWithSeed instruction | solana-labs_solana-web3.js | train | js |
6d63f3853d5d04549930ce946d4d555161336c2c | diff --git a/src/Api/Subscriptions.php b/src/Api/Subscriptions.php
index <HASH>..<HASH> 100644
--- a/src/Api/Subscriptions.php
+++ b/src/Api/Subscriptions.php
@@ -83,7 +83,7 @@ class Subscriptions extends Api
*/
public function reactivate($customerId, $subscriptionId)
{
- $subscription = $this->find($customerId, $subscription);
+ $subscription = $this->find($customerId, $subscriptionId);
return $this->update($customerId, $subscriptionId, [
'plan' => $subscription['plan']['id'], | Fix variable on the subscription reactivate method. | cartalyst_stripe | train | php |
81a5ff5de18a00e467982c28b61773a2d1724c26 | diff --git a/rootpy/plotting/axis.py b/rootpy/plotting/axis.py
index <HASH>..<HASH> 100644
--- a/rootpy/plotting/axis.py
+++ b/rootpy/plotting/axis.py
@@ -83,3 +83,11 @@ class Axis(NamedObject, QROOT.TAxis):
# no SetXmax() in ROOT
self.SetLimits(self.GetXmin(), value, update=False)
self.SetRangeUser(self.GetXmin(), value)
+
+ @property
+ def divisions(self):
+ return self.GetNdivisions()
+
+ @divisions.setter
+ def divisions(self, value):
+ self.SetNdivisions(value)
diff --git a/rootpy/plotting/hist.py b/rootpy/plotting/hist.py
index <HASH>..<HASH> 100644
--- a/rootpy/plotting/hist.py
+++ b/rootpy/plotting/hist.py
@@ -2473,6 +2473,13 @@ class HistStack(Plottable, NamedObject, QROOT.THStack):
clone.Add(hist.Clone())
return clone
+ def GetHistogram(self):
+ return asrootpy(super(HistStack, self).GetHistogram())
+
+ def GetZaxis(self):
+ # ROOT is missing this method...
+ return self.GetHistogram().zaxis
+
@snake_case_methods
class Efficiency(Plottable, NamelessConstructorObject, QROOT.TEfficiency): | add missing GetZaxis to HistStack and add divisions property to Axis | rootpy_rootpy | train | py,py |
2b26d544f9db855d67fdb34042abc31fa2ae3198 | diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php
index <HASH>..<HASH> 100755
--- a/code/model/UserDefinedForm.php
+++ b/code/model/UserDefinedForm.php
@@ -792,7 +792,7 @@ JS
$referrer = (isset($data['Referrer'])) ? '?referrer=' . urlencode($data['Referrer']) : "";
- return Director::redirect($this->Link() . 'finished' . $referrer);
+ return $this->redirect($this->Link() . 'finished' . $referrer);
}
/**
@@ -907,4 +907,4 @@ class UserDefinedForm_SubmittedFormEmail extends Email {
public function __construct() {
parent::__construct();
}
-}
\ No newline at end of file
+} | BUGFIX: Director::redirect is deprecated, use Controller. | silverstripe_silverstripe-userforms | train | php |
b857da2caea275c5772b26084c00d546eb316123 | diff --git a/src/Illuminate/Bus/Queueable.php b/src/Illuminate/Bus/Queueable.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Bus/Queueable.php
+++ b/src/Illuminate/Bus/Queueable.php
@@ -54,7 +54,7 @@ trait Queueable
/**
* Set the desired delay for the job.
*
- * @param int|null $delay
+ * @param \DateTime|int|null $delay
* @return $this
*/
public function delay($delay) | Add DateTime to possible param types for $delay variable in queue able delay function (#<I>) | laravel_framework | train | php |
0964632ab85a40c3710fa2d83cbbc6fac61428ab | diff --git a/src/FacadeTrait.php b/src/FacadeTrait.php
index <HASH>..<HASH> 100644
--- a/src/FacadeTrait.php
+++ b/src/FacadeTrait.php
@@ -21,6 +21,8 @@ use ReflectionClass;
*/
trait FacadeTrait
{
+ use HelperTrait;
+
/**
* Get the facade accessor.
* | Load the helper trait if not loaded already
Closes #3 | GrahamCampbell_Laravel-TestBench-Core | train | php |
4649d5ae8184b93c4bbd9a9e2c6fff6543c91eb8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -35,7 +35,7 @@ See documentation for a full list of supported platforms (yours is likely one of
package_dir={'uptime': 'src'},
packages=['uptime'],
ext_modules=[Extension('uptime._posix', sources=['src/_posix.c'])],
- classifiers=['Development Status :: 4 - Beta',
+ classifiers=['Development Status :: 5 - Production/Stable',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X', | VIP quality.
According to PyPI either <I> or <I> people have downloaded this
package, and I haven't had any complaints. I assume that means it's
working for other people too. | Cairnarvon_uptime | train | py |
98bda9fe7bbe9b100ccb474801e4e804d05063d8 | diff --git a/openquake/hazardlib/contexts.py b/openquake/hazardlib/contexts.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/contexts.py
+++ b/openquake/hazardlib/contexts.py
@@ -725,6 +725,7 @@ class Effect(object):
return dic
+# used in calculators/classical.py
def get_effect(mags, onesite, gsims_by_trt, maximum_distance, imtls):
"""
:returns: a dict magnitude-string -> array(#dists, #trts)
@@ -740,6 +741,7 @@ def get_effect(mags, onesite, gsims_by_trt, maximum_distance, imtls):
return dict(zip(['%.3f' % mag for mag in mags], gmv))
+# used in calculators/classical.py
def ruptures_by_mag_dist(sources, srcfilter, gsims, params, monitor):
"""
:returns: a dictionary trt -> mag string -> counts by distance | Added two comments [skip CI] | gem_oq-engine | train | py |
eca52b4a9bc0592626409a8e06766da89eb5b489 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -44,12 +44,13 @@ export const config = options => {
const schema = loadEnvironmentFile(options.schema, options.encoding, options.silent);
const config = options.includeProcessEnv ? Object.assign({}, configData, process.env) : configData;
const schemaKeys = Object.keys(schema);
+ const configOnlyKeys = Object.keys(configData);
const configKeys = Object.keys(config);
let missingKeys = schemaKeys.filter(function (key) {
return configKeys.indexOf(key) < 0;
});
- let extraKeys = configKeys.filter(function (key) {
+ let extraKeys = configOnlyKeys.filter(function (key) {
return schemaKeys.indexOf(key) < 0;
});
if (options.errorOnMissing && missingKeys.length) { | fix: check for extra keys needs to be specific to schema (closes #<I>) | keithmorris_node-dotenv-extended | train | js |
1544d6d26d17d4336991c2b7448e95a941e4ebe8 | diff --git a/app/assets/javascripts/component_guide/application.js b/app/assets/javascripts/component_guide/application.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/component_guide/application.js
+++ b/app/assets/javascripts/component_guide/application.js
@@ -1,4 +1,3 @@
//= require ./no_slimmer
-//= require govuk/modules
//= require_tree ./vendor
//= require_tree .
diff --git a/app/assets/javascripts/component_guide/no_slimmer.js b/app/assets/javascripts/component_guide/no_slimmer.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/component_guide/no_slimmer.js
+++ b/app/assets/javascripts/component_guide/no_slimmer.js
@@ -1,6 +1,7 @@
-// This adds in javascript that should only be included if slimmer middleware
-// is not running
+// This adds in javascript that initialiases components and dependencies
+// that would normally be provided by slimmer
//= require jquery/dist/jquery
+//= require govuk/modules
$(document).ready(function () {
'use strict' | Move govuk/modules initialisition to no_slimmer file
Since this is also something that is introduced via Slimmer/Static it
makes sense for it to be grouped into the no_slimmer JS file. | alphagov_govuk_publishing_components | train | js,js |
2e331c0cbacac3e63dcf4361c064670ac1340822 | diff --git a/hive/capabilities/ftp.py b/hive/capabilities/ftp.py
index <HASH>..<HASH> 100644
--- a/hive/capabilities/ftp.py
+++ b/hive/capabilities/ftp.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 Johnny Vestergaard <jkv@unixcluster.dk>
+# Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk>
#
# Rewritten by Aniket Panse <contact@aniketpanse.in>
# | updated date of copyright in ftp capability | honeynet_beeswarm | train | py |
d14b5bc12c5771026deb0f35184233fef05c4bd0 | diff --git a/ast_test.go b/ast_test.go
index <HASH>..<HASH> 100644
--- a/ast_test.go
+++ b/ast_test.go
@@ -2395,22 +2395,25 @@ var astTests = []testCase{
}
func fullProg(v interface{}) *File {
- f := &File{}
switch x := v.(type) {
case []*Stmt:
- f.Stmts = x
+ return &File{Stmts: x}
case *Stmt:
- f.Stmts = append(f.Stmts, x)
+ return &File{Stmts: []*Stmt{x}}
case []Command:
+ f := &File{}
for _, cmd := range x {
f.Stmts = append(f.Stmts, stmt(cmd))
}
+ return f
case *Word:
return fullProg(call(*x))
case Command:
return fullProg(stmt(x))
+ case nil:
+ return &File{}
}
- return f
+ return nil
}
func setPosRecurse(tb testing.TB, src string, v interface{}, to Pos, diff bool) { | ast_test: crash if the ast is of unknown type
Better than silently using an empty program. | mvdan_sh | train | go |
201c2342199af149c860e68b8f8812249cae7952 | diff --git a/src/vml/graphic.js b/src/vml/graphic.js
index <HASH>..<HASH> 100644
--- a/src/vml/graphic.js
+++ b/src/vml/graphic.js
@@ -1011,11 +1011,11 @@ if (!require('../core/env').canvasSupported) {
catch (e) {}
updateFillAndStroke(textVmlEl, 'fill', {
- fill: fromTextEl ? style.fill : style.textFill,
+ fill: style.textFill,
opacity: style.opacity
}, this);
updateFillAndStroke(textVmlEl, 'stroke', {
- stroke: fromTextEl ? style.stroke : style.textStroke,
+ stroke: style.textStroke,
opacity: style.opacity,
lineDash: style.lineDash
}, this); | Fix ecomfe/echarts#<I> (text color in vml) | ecomfe_zrender | train | js |
fb61433086eef68c0429e8b9c6c2ab1c0f2d02eb | diff --git a/mod/assign/submissionconfirmform.php b/mod/assign/submissionconfirmform.php
index <HASH>..<HASH> 100644
--- a/mod/assign/submissionconfirmform.php
+++ b/mod/assign/submissionconfirmform.php
@@ -47,7 +47,7 @@ class mod_assign_confirm_submission_form extends moodleform {
$data) = $this->_customdata;
if ($requiresubmissionstatement) {
- $mform->addElement('checkbox', 'submissionstatement', '', ' ' . $submissionstatement);
+ $mform->addElement('checkbox', 'submissionstatement', '', ' ' . format_text($submissionstatement));
$mform->addRule('submissionstatement', get_string('required'), 'required', null, 'client');
} | MDL-<I> assign: make submissionagreement usable on multilingual sites | moodle_moodle | train | php |
e0fce91c08881c08081bc8e1720c6df00f21c234 | diff --git a/spec/unit/cookbook_loader_spec.rb b/spec/unit/cookbook_loader_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/cookbook_loader_spec.rb
+++ b/spec/unit/cookbook_loader_spec.rb
@@ -173,7 +173,7 @@ describe Chef::CookbookLoader do
end
it "should emit deprecation warning if name is not in metadata" do
- Chef::Log.should_receive(:warn).exactly(6).with(/Inferring cookbook name from directory name \([^)]+\) is deprecated, please set a name in the metadata./)
+ Chef::Log.should_receive(:warn).at_least(:once).with(/Inferring cookbook name from directory name \([^)]+\) is deprecated, please set a name in the metadata./)
@cookbook_loader.load_cookbooks
end
end # load_cookbooks | CHEF-<I>: Stop trying to count instances of the warning
Everytime we add more tests we have to increment this number, and it's insane
to try to audit what it's supposed to be now | chef_chef | train | rb |
c7ac7263ce401b780c3b63cbf2f9806b20c67aeb | diff --git a/src/org/zaproxy/zap/spider/filters/DefaultParseFilter.java b/src/org/zaproxy/zap/spider/filters/DefaultParseFilter.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/spider/filters/DefaultParseFilter.java
+++ b/src/org/zaproxy/zap/spider/filters/DefaultParseFilter.java
@@ -18,6 +18,7 @@
package org.zaproxy.zap.spider.filters;
import org.parosproxy.paros.network.HttpMessage;
+import org.parosproxy.paros.network.HttpStatusCode;
/**
* The DefaultParseFilter is an implementation of a {@link ParseFilter} that is default for
@@ -48,6 +49,10 @@ public class DefaultParseFilter extends ParseFilter {
return true;
}
+ // If it's a redirection, accept it, as the SpiderRedirectParser will process it
+ if (HttpStatusCode.isRedirection(responseMessage.getResponseHeader().getStatusCode()))
+ return false;
+
// Check response type
if (!responseMessage.getResponseHeader().isText()) {
if (log.isDebugEnabled()) { | Small change to make sure the spider also accepts HTTP Redirect messages without a text body | zaproxy_zaproxy | 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.