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
|
---|---|---|---|---|---|
79d9bffab26e6d3ecbe8a139a454ff817c99c53b | diff --git a/nbp/src/main/java/jlibs/nbp/Stream.java b/nbp/src/main/java/jlibs/nbp/Stream.java
index <HASH>..<HASH> 100644
--- a/nbp/src/main/java/jlibs/nbp/Stream.java
+++ b/nbp/src/main/java/jlibs/nbp/Stream.java
@@ -46,9 +46,21 @@ public class Stream{
begin = end = lookAhead.end = 0;
}
+ private String toString(int length){
+ StringBuilder buff = new StringBuilder();
+ for(int i=0; i<length; i++){
+ int data = charAt(i);
+ if(data==-1)
+ buff.append("<EOF>");
+ else
+ buff.appendCodePoint(data);
+ }
+ return buff.toString();
+ }
+
@Override
public String toString(){
- return new String(chars, begin, length());
+ return toString(length());
}
public LookAhead lookAhead = new LookAhead();
@@ -104,7 +116,7 @@ public class Stream{
@Override
public String toString(){
- return new String(chars, begin, length());
+ return Stream.this.toString(length());
}
}
} | EOF can be inside stream. so toString() should handle that | santhosh-tekuri_jlibs | train | java |
7670fa5bc14d1d225ac72ae53234df2d4baf88f9 | diff --git a/openquake/engine/engine.py b/openquake/engine/engine.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/engine.py
+++ b/openquake/engine/engine.py
@@ -88,6 +88,8 @@ def expose_outputs(dstore):
rlzs = list(dstore['realizations'])
except KeyError:
rlzs = []
+ if oq.ground_motion_fields:
+ dskeys.add('gmf_data')
if 'scenario' not in calcmode: # export sourcegroups.csv
dskeys.add('sourcegroups')
if 'hcurves' in dstore: | Made sure that gmf_data is exposed by the engine
Former-commit-id: bdf<I>bae<I>b<I>c<I>af<I>a<I>af9aea2 | gem_oq-engine | train | py |
2d67c8322cc1f627d99590133bf1a292154b7555 | diff --git a/ieml/script/script.py b/ieml/script/script.py
index <HASH>..<HASH> 100644
--- a/ieml/script/script.py
+++ b/ieml/script/script.py
@@ -135,6 +135,12 @@ class Script(TreeStructure):
def _compute_singular_sequences(self):
pass
+ def __contains__(self, item):
+ if not isinstance(item, Script):
+ return False
+
+ return set(item.singular_sequences).issubset(set(self.singular_sequences))
+
@property
def singular_sequences(self):
if self._singular_sequences: | Add contains to script to test inclusion in paradigm. | IEMLdev_ieml | train | py |
06aa4a5c0711c90d7206b0a65637a6d1573d74e6 | diff --git a/src/diagrams/sequence/svgDraw.js b/src/diagrams/sequence/svgDraw.js
index <HASH>..<HASH> 100644
--- a/src/diagrams/sequence/svgDraw.js
+++ b/src/diagrams/sequence/svgDraw.js
@@ -106,7 +106,7 @@ export const drawActivation = function (elem, bounds, verticalPos, conf, actorAc
const g = bounds.anchored
rect.x = bounds.startx
rect.y = bounds.starty
- rect.class = 'activation' + actorActivations
+ rect.class = 'activation' + (actorActivations % 3) // Will evaluate to 0, 1 or 2
rect.width = bounds.stopx - bounds.startx
rect.height = verticalPos - bounds.starty
drawRect(g, rect) | prevent deeply nested activations from calling classes that don't exist (by limiting to 3) | knsv_mermaid | train | js |
e03e2dfb9a11b1b98e8739e112b471a0dbc42a84 | diff --git a/FlowCal/io.py b/FlowCal/io.py
index <HASH>..<HASH> 100644
--- a/FlowCal/io.py
+++ b/FlowCal/io.py
@@ -1536,10 +1536,7 @@ class FCSData(np.ndarray):
# CytekP03G, ... for channels 1, 2, 3, ...
if channel_amp_gain is None and 'CREATOR' in fcs_file.text and \
'FlowJoCollectorsEdition' in fcs_file.text.get('CREATOR'):
- try:
- channel_amp_gain = fcs_file.text['CytekP{:02d}G'.format(i)]
- except KeyError:
- pass
+ channel_amp_gain = fcs_file.text.get('CytekP{:02d}G'.format(i))
amplifier_gain.append(channel_amp_gain)
amplifier_gain = [float(agi) if agi is not None else None
for agi in amplifier_gain] | Replaced amp gain try-except with dict.get() | taborlab_FlowCal | train | py |
784a4eba95c6af2b5c6fc58190cfeb6a725b2d5b | diff --git a/src/Traits/ParsedownExtensibility.php b/src/Traits/ParsedownExtensibility.php
index <HASH>..<HASH> 100644
--- a/src/Traits/ParsedownExtensibility.php
+++ b/src/Traits/ParsedownExtensibility.php
@@ -17,7 +17,7 @@ trait ParsedownExtensibility
public function extendBlock($blockName, Closure $closure)
{
$blockName = ucfirst(strtolower($blockName));
- $methodName = camel_case("block_{$blockName}");
+ $methodName = Str::camel("block_{$blockName}");
return $this->bindElementClosure($methodName, $closure);
} | Missed a deprecated function call. | infinity-next_eightdown | train | php |
776d84f2a3ba318b52914a123f7816a2c8368e53 | diff --git a/spec/expeditor/circuit_break_function_spec.rb b/spec/expeditor/circuit_break_function_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/expeditor/circuit_break_function_spec.rb
+++ b/spec/expeditor/circuit_break_function_spec.rb
@@ -116,7 +116,7 @@ RSpec.describe Expeditor::Command do
end
command.start
- expect(command.get).to eq(result)
+ expect(command.get).to equal(result)
expect(reason).to be_instance_of(Expeditor::CircuitBreakError)
service.shutdown
end | Use `equal` to make the test more clear | cookpad_expeditor | train | rb |
797ae827f1dfb925f056977a67b10f436f7e2ea2 | diff --git a/src/Administration/Resources/administration/src/app/component/form/sw-datepicker/index.js b/src/Administration/Resources/administration/src/app/component/form/sw-datepicker/index.js
index <HASH>..<HASH> 100644
--- a/src/Administration/Resources/administration/src/app/component/form/sw-datepicker/index.js
+++ b/src/Administration/Resources/administration/src/app/component/form/sw-datepicker/index.js
@@ -325,7 +325,6 @@ export default {
// emit a new value if the value has changed during instance recreation
this.$nextTick(() => {
if (this.value !== this.flatpickrInstance.input.defaultValue) {
- this.resetFormError();
this.$emit('input', this.flatpickrInstance.input.defaultValue);
}
}); | Remove error reset in datepicker created method | shopware_platform | train | js |
62b4ec7a753ac76f334780d225c05ed1706043a9 | diff --git a/include/setup.php b/include/setup.php
index <HASH>..<HASH> 100644
--- a/include/setup.php
+++ b/include/setup.php
@@ -5,7 +5,7 @@ if ( ! isset($CFG) ) die_with_error_log("Please configure this product using con
// upgrade checking - don't change this unless you want to trigger
// database upgrade messages it should be the max of all versions in
// all database.php files.
-$CFG->dbversion = 201706101015;
+$CFG->dbversion = 201706111750;
// Just turn this off to avoid security holes due to XML parsing
if ( function_exists ( 'libxml_disable_entity_loader' ) ) libxml_disable_entity_loader(); | Make deleted NOT NULL DEFAULT 0 | tsugiproject_tsugi-php | train | php |
d3762e1697e381126d2650c9710e89c8c790c618 | diff --git a/lib/plugins.js b/lib/plugins.js
index <HASH>..<HASH> 100644
--- a/lib/plugins.js
+++ b/lib/plugins.js
@@ -8,7 +8,7 @@ let _ = require('lodash');
let pkg = require('../package.json');
let domain = require('domain');
let Joi = require('joi');
-let findup = require('findup');
+let findup = Promise.promisify(require('findup'));
let fs = require('fs');
let digsUtil = require('digs-common/digs-util'); | don't forget to promifisy findup... | digsjs_digs | train | js |
457d3b955aff3e41128f1d43ab110505abdf2a5c | diff --git a/graphs/base/pairs.py b/graphs/base/pairs.py
index <HASH>..<HASH> 100644
--- a/graphs/base/pairs.py
+++ b/graphs/base/pairs.py
@@ -77,7 +77,7 @@ class EdgePairGraph(Graph):
mask = np.zeros_like(flat_add, dtype=bool)
mask[idx] = True
flat_add = flat_add[mask]
- to_add = to_add[~np.in1d(flat_add, flat_inds)]
+ to_add = to_add[np.in1d(flat_add, flat_inds, invert=True)]
if len(to_add) > 0:
self._pairs = np.vstack((self._pairs, to_add))
return self | Use the invert kwarg for speed | all-umass_graphs | train | py |
3d9fe3893f550e2d97608ac933580560c5544172 | diff --git a/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelAssemblerSupport.java b/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelAssemblerSupport.java
index <HASH>..<HASH> 100755
--- a/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelAssemblerSupport.java
+++ b/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelAssemblerSupport.java
@@ -34,7 +34,7 @@ import org.springframework.util.Assert;
* @author Oliver Gierke
* @author Greg Turnquist
*/
-public abstract class RepresentationModelAssemblerSupport<T, D extends RepresentationModel<D>>
+public abstract class RepresentationModelAssemblerSupport<T, D extends RepresentationModel<?>>
implements RepresentationModelAssembler<T, D> {
private final Class<?> controllerClass;
@@ -109,7 +109,7 @@ public abstract class RepresentationModelAssemblerSupport<T, D extends Represent
return BeanUtils.instantiateClass(this.resourceType);
}
- static class Builder<T, D extends RepresentationModel<D>> {
+ static class Builder<T, D extends RepresentationModel<?>> {
private final Iterable<? extends T> entities;
private final RepresentationModelAssemblerSupport<T, D> resourceAssembler; | #<I> - Fixed generics declaration in RepresentationModelAssemblerSupport.
We constrained the RepresentationModel type parameter in a way that non of the RepresentationModel subclasses we provide aren't usable with it. That's now fixed by loosing that restriction to an arbitrary type. | spring-projects_spring-hateoas | train | java |
9b3154051713bcdb4833675f87fbd69728391027 | diff --git a/textx/model.py b/textx/model.py
index <HASH>..<HASH> 100644
--- a/textx/model.py
+++ b/textx/model.py
@@ -253,15 +253,17 @@ class RefRulePosition(object):
name(str): A name of the target object.
ref_pos_start(int): Reference starting position
ref_pos_end(int): Reference ending position
+ def_file_name(str): Definition's model file name
def_pos_start(int): Starting position of referenced object
def_pos_end(int): Ending position of referenced object
"""
def __init__(self, name, ref_pos_start, ref_pos_end,
- def_pos_start, def_pos_end):
+ def_file_name, def_pos_start, def_pos_end):
self.name = name
self.ref_pos_start = ref_pos_start
self.ref_pos_end = ref_pos_end
+ self.def_file_name = def_file_name
self.def_pos_start = def_pos_start
self.def_pos_end = def_pos_end
@@ -1078,6 +1080,7 @@ class ReferenceResolver:
ref_pos_start=crossref.position,
ref_pos_end=crossref.position + len(
resolved.name),
+ def_file_name=get_model(resolved)._tx_filename,
def_pos_start=resolved._tx_position,
def_pos_end=resolved._tx_position_end)) | Added def_file_name to RefRulePosition | textX_textX | train | py |
2748c05c9d9bef64a0ec3ad4b119b1119833c408 | diff --git a/config/auth.php b/config/auth.php
index <HASH>..<HASH> 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -35,7 +35,7 @@ return [
*/
'guards' => [
- 'api' => ['driver' => 'api'],
+ 'api' => ['driver' => 'token'],
],
/* | 'API' isn't a supported driver | laravel_lumen-framework | train | php |
46a573da4409adaa3249fda6e3e75380523c78f8 | diff --git a/spec/unit/resource/dsc_resource_spec.rb b/spec/unit/resource/dsc_resource_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/resource/dsc_resource_spec.rb
+++ b/spec/unit/resource/dsc_resource_spec.rb
@@ -59,6 +59,16 @@ describe Chef::Resource::DscResource do
dsc_test_resource.property('Foo', dsc_test_property_value)
}.to raise_error(TypeError)
end
+
+ context "when using DelayedEvaluators" do
+ it "allows setting a dsc property with a property name of type Symbol" do
+ dsc_test_resource.property(dsc_test_property_name, Chef::DelayedEvaluator.new {
+ dsc_test_property_value
+ })
+ expect(dsc_test_resource.property(dsc_test_property_name)).to eq(dsc_test_property_value)
+ expect(dsc_test_resource.properties[dsc_test_property_name]).to eq(dsc_test_property_value)
+ end
+ end
end
end
end | spec for delayed evaluator in dsc_resource | chef_chef | train | rb |
1dda26699fb7a10bcbef7605dacf55778f3732b0 | diff --git a/server_test.go b/server_test.go
index <HASH>..<HASH> 100644
--- a/server_test.go
+++ b/server_test.go
@@ -28,8 +28,21 @@ func TestMain(m *testing.M) {
os.Exit(m.Run())
}
+// On the CI server, we can't be guaranteed that the port will be
+// released immediately after the server is shut down. Instead, use
+// a unique port for each test. As long as we don't have an insane number
+// of integration tests, we should be fine.
+var HttpAddrPort = 8127
+
+var localHandler http.Handler
+
+
+
// set up a boilerplate local config for later use
func localConfig() Config {
+ port := HttpAddrPort
+ HttpAddrPort++
+
return Config{
APIHostname: "http://localhost",
Debug: DebugMode,
@@ -42,7 +55,7 @@ func localConfig() Config {
Percentiles: []float64{.5, .75, .99},
ReadBufferSizeBytes: 2097152,
UDPAddr: "localhost:8126",
- HTTPAddr: "localhost:8127",
+ HTTPAddr: fmt.Sprintf("localhost:%d", port),
ForwardAddr: "http://localhost",
NumWorkers: 96, | Increment HTTP ports for build server | stripe_veneur | train | go |
991587fe848f20e0465cce1da4789fee75a5af20 | diff --git a/copystructure_test.go b/copystructure_test.go
index <HASH>..<HASH> 100644
--- a/copystructure_test.go
+++ b/copystructure_test.go
@@ -238,3 +238,16 @@ func TestCopy_aliased(t *testing.T) {
t.Fatalf("bad: %#v", result)
}
}
+
+func TestCopy_panicSliceWithNil(t *testing.T) {
+ v := [](*int){nil}
+
+ result, err := Copy(v)
+ if err != nil {
+ t.Fatalf("err: %s", err)
+ }
+
+ if !reflect.DeepEqual(result, v) {
+ t.Fatalf("bad: %#v", result)
+ }
+} | Add failing test for slice with nil pointer | mitchellh_copystructure | train | go |
395bffa681635074564999f2f5c2d6f1ba8ea8c7 | diff --git a/fedmsg/consumers/__init__.py b/fedmsg/consumers/__init__.py
index <HASH>..<HASH> 100644
--- a/fedmsg/consumers/__init__.py
+++ b/fedmsg/consumers/__init__.py
@@ -286,7 +286,7 @@ class FedmsgConsumer(moksha.hub.api.consumer.Consumer):
# Pass along headers if present. May be useful to filters or
# fedmsg.meta routines.
- if 'headers' in message.__dict__ and 'body' in message.__dict__:
+ if isinstance(message, dict) and 'headers' in message and 'body' in message:
message['body']['headers'] = message['headers']
if hasattr(self, "replay_name"): | Only add headers if the message is a dict
This is a short-term fix for #<I>. We don't know what type of object is
being passed as a message.
See <URL> | fedora-infra_fedmsg | train | py |
e98cb4799ca66d15fecafd90384e480934575b91 | diff --git a/metal/mmtl/trainer.py b/metal/mmtl/trainer.py
index <HASH>..<HASH> 100644
--- a/metal/mmtl/trainer.py
+++ b/metal/mmtl/trainer.py
@@ -747,7 +747,10 @@ class MultitaskTrainer(object):
self.task_scheduler = StagedScheduler(model, tasks, "train")
elif self.config["task_scheduler"] == "superstaged":
if self.config["lr_scheduler"] is not None:
- msg = "When using task_scheduler=='superstaged', lr_scheduler should be None"
+ msg = (
+ "When using task_scheduler=='superstaged', lr_scheduler should be "
+ "None"
+ )
warnings.warn(msg)
self.task_scheduler = SuperStagedScheduler(
model, tasks, self.config["n_epochs"], "train" | Wrap a string to not exceed line length | HazyResearch_metal | train | py |
6d52565a275439bb11d5c29489fccbe26964c9d6 | diff --git a/Swat/SwatPagination.php b/Swat/SwatPagination.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatPagination.php
+++ b/Swat/SwatPagination.php
@@ -104,8 +104,6 @@ class SwatPagination extends SwatControl
/**
* The next page to display
*
- * The value is zero based.
- *
* @var integer
*/
protected $next_page = 0;
@@ -113,8 +111,6 @@ class SwatPagination extends SwatControl
/**
* The previous page to display
*
- * The value is zero based.
- *
* @var integer
*/
protected $prev_page = 0;
@@ -435,15 +431,15 @@ class SwatPagination extends SwatControl
$this->total_pages = ceil($this->total_records / $this->page_size);
if (($this->total_pages <= 1) ||
- ($this->total_pages - 1 == $this->current_page))
- $this->next_page = -1;
+ ($this->total_pages == $this->current_page))
+ $this->next_page = 0;
else
$this->next_page = $this->current_page + 1;
if ($this->current_page > 0)
$this->prev_page = $this->current_page - 1;
else
- $this->prev_page = -1;
+ $this->prev_page = 0;
}
// }}} | Fix next/prev values from old zero-based system (thanks for pointing that our
mike)
svn commit r<I> | silverorange_swat | train | php |
4eed14f8190c3357ecae48ef7f9ea05a3f02303b | diff --git a/Resources/Private/JavaScript/Host/Containers/OffCanvas/index.js b/Resources/Private/JavaScript/Host/Containers/OffCanvas/index.js
index <HASH>..<HASH> 100644
--- a/Resources/Private/JavaScript/Host/Containers/OffCanvas/index.js
+++ b/Resources/Private/JavaScript/Host/Containers/OffCanvas/index.js
@@ -39,9 +39,22 @@ export default class OffCanvas extends Component {
icon: 'file',
title: 'Content',
children: [{
- icon: 'file',
+ icon: 'globe',
title: 'test'
}]
+ }, {
+ icon: 'briefcase',
+ title: 'Management',
+ children: [{
+ icon: 'th-large',
+ title: 'Workspaces'
+ }, {
+ icon: 'camera',
+ title: 'Media'
+ }, {
+ icon: 'calendar',
+ title: 'History'
+ }]
}];
return staticMenuData.map((item, index) => this.renderMenuItem(item, index)); | [TASK] Add more static items for the NeosMenu OffCanvas navigation | neos_neos-ui | train | js |
9727f140611439cc09934c12e99258c3cf916d6f | diff --git a/lib/component.js b/lib/component.js
index <HASH>..<HASH> 100644
--- a/lib/component.js
+++ b/lib/component.js
@@ -337,17 +337,31 @@
// Facade method to bypass the `mixin` usage. For use cases such as ES6
// classes or else. It binds any `Backbone.Model` and `Backbone.Collection`
- // instance found inside `backboneInstances` (single instance or an object
- // of them)
+ // instance found inside `backboneInstances.models` and
+ // `backboneInstances.collections` (single instances or objects of them)
mixin.on = function (component, backboneInstances) {
if (!component.wrapper) {
var wrapper = new Wrapper(component);
- wrapper.setModels(backboneInstances);
- wrapper.setCollections(backboneInstances);
+ if (backboneInstances.models) {
+ wrapper.setModels(backboneInstances.models);
+ }
+ if (backboneInstances.collections) {
+ wrapper.setCollections(backboneInstances.collections);
+ }
component.wrapper = wrapper;
}
};
+ // Shortcut method to bind a model or multiple models
+ mixin.onModel = function (component, models) {
+ mixin.on(component, {models: models});
+ };
+
+ // Shortcut method to bind a collection or multiple collections
+ mixin.onCollection = function (component, collections) {
+ mixin.on(component, {collections: collections});
+ };
+
// Facade method to dispose of a `component.wrapper`
mixin.off = function (component, modelOrCollection) {
if (arguments.length === 2) { | on api change, onModel and onCollection shortcut methods #<I> | magalhas_backbone-react-component | train | js |
66390c16a622dab8113ca7a9fb277cc87b11d336 | diff --git a/lib/nexpose/common.rb b/lib/nexpose/common.rb
index <HASH>..<HASH> 100644
--- a/lib/nexpose/common.rb
+++ b/lib/nexpose/common.rb
@@ -313,21 +313,18 @@ module Nexpose
attr_accessor :blackout_start
# The amount of time, in minutes, a blackout period should last.
attr_accessor :blackout_duration
- # The timezone in which the blackout will start
- attr_accessor :blackout_timezone
- def initialize(start, enabled=true, duration, timezone, type, interval)
+ def initialize(start, enabled=true, duration, type, interval)
@blackout_start = start
@enabled =enabled
@blackout_duration = duration.to_i
- @blackout_timezone = timezone
@blackout_type = type
@blackout_interval = interval.to_i
end
def self.from_hash(hash)
repeat_blackout_hash = hash[:repeat_blackout]
- blackout = new(hash[:start_date], hash[:blackout_duration], hash[:timezone], repeat_blackout_hash[:type], repeat_blackout_hash[:interval])
+ blackout = new(hash[:start_date], hash[:blackout_duration], repeat_blackout_hash[:type], repeat_blackout_hash[:interval])
blackout
end
@@ -336,7 +333,6 @@ module Nexpose
start_date: @blackout_start,
enabled: @enabled,
blackout_duration: @blackout_duration,
- timezone: @blackout_timezone
}
repeat_hash= {
type: @blackout_type, | removing timezones from blackouts | rapid7_nexpose-client | train | rb |
e05b6f0c4d571a985b895119cacba3fab8897401 | diff --git a/src/app/Classes/Form.php b/src/app/Classes/Form.php
index <HASH>..<HASH> 100644
--- a/src/app/Classes/Form.php
+++ b/src/app/Classes/Form.php
@@ -227,7 +227,7 @@ class Form
private function needsValidation()
{
- return app()->environment() === 'local'
+ return ! app()->environment('production')
|| config('enso.datatable.validations') === 'always';
}
} | refactors needsValidation | laravel-enso_FormBuilder | train | php |
b8bbe535999931a504e13e66f915a22f27b3ae11 | diff --git a/modularodm/storedobject.py b/modularodm/storedobject.py
index <HASH>..<HASH> 100644
--- a/modularodm/storedobject.py
+++ b/modularodm/storedobject.py
@@ -706,6 +706,8 @@ class StoredObject(object):
),
storage_data,
)
+ if obj:
+ obj._dirty = True
if not saved:
cls._clear_caches(obj._storage_key)
else:
diff --git a/modularodm/tests/queries/test_update_queries.py b/modularodm/tests/queries/test_update_queries.py
index <HASH>..<HASH> 100644
--- a/modularodm/tests/queries/test_update_queries.py
+++ b/modularodm/tests/queries/test_update_queries.py
@@ -7,14 +7,14 @@ from modularodm.tests import ModularOdmTestCase
class UpdateQueryTestCase(ModularOdmTestCase):
- def define_test_objects(self):
+ def define_objects(self):
class Foo(StoredObject):
_id = fields.IntegerField(primary=True)
modified = fields.BooleanField(default=False)
return Foo,
- def set_up_test_objects(self):
+ def set_up_objects(self):
self.foos = []
for idx in xrange(5): | fix failing tests: remove _test_methods in tests; mark updated objects as dirty | cos-archives_modular-odm | train | py,py |
6408594eb3817a1f695a9d5efca67b6eb90ba3d9 | diff --git a/lib/www_applet.rb b/lib/www_applet.rb
index <HASH>..<HASH> 100644
--- a/lib/www_applet.rb
+++ b/lib/www_applet.rb
@@ -313,7 +313,11 @@ class WWW_Applet
when :html
if h[:tag] == :style
- return hash_to_text(type: :styles, value: h[:attrs])
+ return %^
+ <style type="text/css">
+ #{hash_to_text(type: :styles, value: h[:attrs])}
+ </style>
+ ^
end
html = h[:childs].map { |c|
@@ -418,6 +422,7 @@ class WWW_Applet
if [email protected]?
@head[:childs] << new_html(:style, @style)
end
+
Document_Template.
sub('!BODY', hash_to_text(@body)).
sub('!HEAD', array_to_text(@head[:childs]))
@@ -428,9 +433,9 @@ class WWW_Applet
utf_8 = Escape_Escape_Escape.clean_utf8(final)
@html_page = if is_doc?
- Sanitize.document( utf_8 , WWW_Applet::Sanitize_Config)
+ Sanitize.document( utf_8 , WWW_Applet::Sanitize_Config )
else
- Sanitize.fragment( utf_8 , WWW_Applet::Sanitize_Config)
+ Sanitize.fragment( utf_8 , WWW_Applet::Sanitize_Config )
end
end # === def to_html | Added: html with inner styles, style tag | da99_www_app | train | rb |
31a23b7c1085f437e218e60416a9abf856552ecb | diff --git a/src/publish.js b/src/publish.js
index <HASH>..<HASH> 100644
--- a/src/publish.js
+++ b/src/publish.js
@@ -60,7 +60,10 @@ function publish (publishCommand, publishTag) {
const spawnPromise = module.exports.testMode ?
Promise.resolve() :
- spawn(command).then(() => console.log('\n', emoji.tada, emoji.tada, emoji.tada));
+ spawn(command).then(res => {
+ console.log('\n', emoji.tada, emoji.tada, emoji.tada);
+ return res || true;
+ });
return spawnPromise.then(() => command);
} | hotfix: against merge request #<I>: it do not run postpublish script even if confirmation success (#<I>) | inikulin_publish-please | train | js |
41763a7a400b1e8c79aa92bd5336c429767c4515 | diff --git a/autocompletefile.go b/autocompletefile.go
index <HASH>..<HASH> 100644
--- a/autocompletefile.go
+++ b/autocompletefile.go
@@ -56,7 +56,7 @@ func (f *auto_complete_file) process_data(data []byte) {
cur, filedata, block := rip_off_decl(data, f.cursor)
file, err := parser.ParseFile(f.fset, "", filedata, 0)
if err != nil && *g_debug {
- log.Printf("Error parsing input file: %s", err)
+ log.Printf("Error parsing input file (outer block): %s", err)
}
f.package_name = package_name(file)
@@ -75,7 +75,10 @@ func (f *auto_complete_file) process_data(data []byte) {
}
if block != nil {
// process local function as top-level declaration
- decls, _ := parse_decl_list(f.fset, block)
+ decls, err := parse_decl_list(f.fset, block)
+ if err != nil && *g_debug {
+ log.Printf("Error parsing input file (inner block): %s", err)
+ }
for _, d := range decls {
anonymify_ast(d, 0, f.filescope) | Report parsing errors for inner code block as well. | nsf_gocode | train | go |
008343097677954f6dda7bad1a3f8a8556c8cfd1 | diff --git a/eth/utils/bls.py b/eth/utils/bls.py
index <HASH>..<HASH> 100644
--- a/eth/utils/bls.py
+++ b/eth/utils/bls.py
@@ -61,6 +61,9 @@ def sqrt_fq2(x):
def hash_to_G2(m):
+ """
+ WARNING: this function has not been standardized yet.
+ """
if m in CACHE:
return CACHE[m]
k2 = m | Added warnining to hash_to_G2 | ethereum_py-evm | train | py |
c3b0f5982f8ebdefcaab7f3a590109ed46d280c1 | diff --git a/mr/awsome/ezjail/__init__.py b/mr/awsome/ezjail/__init__.py
index <HASH>..<HASH> 100644
--- a/mr/awsome/ezjail/__init__.py
+++ b/mr/awsome/ezjail/__init__.py
@@ -432,10 +432,10 @@ def get_massagers():
return massagers
-def get_masters(main_config):
- masters = main_config.get('ez-master', {})
+def get_masters(aws):
+ masters = aws.config.get('ez-master', {})
for master, master_config in masters.iteritems():
- yield Master(main_config, master, master_config)
+ yield Master(aws, master, master_config)
plugin = dict( | Update to new get_masters interface. | ployground_ploy_ezjail | train | py |
5aeae31fa2553eedfdf11d1bbde7892184164f73 | diff --git a/src/you_get/extractors/bilibili.py b/src/you_get/extractors/bilibili.py
index <HASH>..<HASH> 100644
--- a/src/you_get/extractors/bilibili.py
+++ b/src/you_get/extractors/bilibili.py
@@ -14,6 +14,8 @@ class Bilibili(VideoExtractor):
stream_types = [
{'id': 'hdflv2_8k', 'quality': 127, 'audio_quality': 30280,
'container': 'FLV', 'video_resolution': '4320p', 'desc': '超高清 8K'},
+ {'id': 'hdflv2_dolby', 'quality': 126, 'audio_quality': 30280,
+ 'container': 'FLV', 'video_resolution': '3840p', 'desc': '杜比视界'},
{'id': 'hdflv2', 'quality': 125, 'audio_quality': 30280,
'container': 'FLV', 'video_resolution': '3840p', 'desc': '真彩 HDR'},
{'id': 'hdflv2_4k', 'quality': 120, 'audio_quality': 30280, | [bilibili] Add Dolby Vision video download support | soimort_you-get | train | py |
fb2c48a0869fd8588f7820f9b96169837654bbb2 | diff --git a/src/js/navitron.js b/src/js/navitron.js
index <HASH>..<HASH> 100644
--- a/src/js/navitron.js
+++ b/src/js/navitron.js
@@ -140,7 +140,7 @@
var $button = $(this);
// Slide out current level
- plugin._hidePane(this.$currentPane, $button);
+ plugin._hidePane(plugin.$currentPane, $button);
});
},
@@ -172,6 +172,8 @@
$pane.focus();
plugin._trigger('slid');
+
+ plugin._setCurrentPane($pane);
}
})
);
@@ -270,11 +272,16 @@
.attr('aria-expanded', 'false');
plugin._trigger('shifted');
+ plugin._setCurrentPane($targetPane);
}
})
);
},
+ _setCurrentPane: function ($pane) {
+ this.$currentPane = $pane;
+ },
+
_getTargetPane: function(pane) {
return this.$navitron.find(selectors.PANE + '[data-level="' + pane + '"]');
}, | Corrected the setting of the current pane | mobify_navitron | train | js |
dda9d128d54dfd7baa42e3f3df993ee5c26727f6 | diff --git a/s3-fs-cp.go b/s3-fs-cp.go
index <HASH>..<HASH> 100644
--- a/s3-fs-cp.go
+++ b/s3-fs-cp.go
@@ -40,6 +40,8 @@ func startBar(size int64) *pb.ProgressBar {
// Colorize
infoCallback(s)
}
+ // Feels like wget
+ bar.Format("[=> ]")
return bar
}
@@ -144,7 +146,7 @@ func doFsCopy(c *cli.Context) {
if err != nil {
fatal(err.Error())
}
- bar.Add(int(downloadedSize))
+ bar.Set(int(downloadedSize))
}
// Start the bar now
bar.Start() | add wget style format and also use Set() current position instead of 'Add()' | minio_mc | train | go |
ec978ca3c58a850c818c0a6d5b4333a0fa44d341 | diff --git a/lib/webpacker/compiler.rb b/lib/webpacker/compiler.rb
index <HASH>..<HASH> 100644
--- a/lib/webpacker/compiler.rb
+++ b/lib/webpacker/compiler.rb
@@ -59,7 +59,7 @@ class Webpacker::Compiler
def run_webpack
logger.info "Compiling…"
- sterr, stdout, status = Open3.capture3(webpack_env, "#{RbConfig.ruby} ./bin/webpack")
+ stdout, sterr , status = Open3.capture3(webpack_env, "#{RbConfig.ruby} ./bin/webpack")
if status.success?
logger.info "Compiled all packs in #{config.public_output_path}" | From the open3 docs: (#<I>) | rails_webpacker | train | rb |
9351d0879eb4e5a785ffdd359c72781905e6b4fc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='algorithmia',
- version='1.3.0',
+ version='1.4.0',
description='Algorithmia Python Client',
long_description='Algorithmia Python Client is a client library for accessing Algorithmia from python code. This library also gets bundled with any Python algorithms in Algorithmia.',
url='http://github.com/algorithmiaio/algorithmia-python',
@@ -25,7 +25,7 @@ setup(
],
include_package_data=True,
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License', | Update minor version, and remove beta classification (#<I>) | algorithmiaio_algorithmia-python | train | py |
75b5b1043843129df7f448a2478f45df1e6e80f2 | diff --git a/wagtailmodelchooser/edit_handlers.py b/wagtailmodelchooser/edit_handlers.py
index <HASH>..<HASH> 100644
--- a/wagtailmodelchooser/edit_handlers.py
+++ b/wagtailmodelchooser/edit_handlers.py
@@ -19,6 +19,16 @@ class ModelChooserPanel(BaseChooserPanel):
if filter_name is not None:
FILTERS[filter_name] = filter
+ def clone(self):
+ return self.__class__(
+ field_name=self.field_name,
+ filter_name=self.filter_name,
+ widget=self.widget if hasattr(self, 'widget') else None,
+ heading=self.heading,
+ classname=self.classname,
+ help_text=self.help_text
+ )
+
def widget_overrides(self):
return {self.field_name: AdminModelChooser(
model=self.target_model, filter_name=self.filter_name)} | Bug fix for loss of filter name on clone | neon-jungle_wagtailmodelchooser | train | py |
e1cec337e0778adbc75efe6c226242cb7df62d61 | diff --git a/src/main/java/io/reactivex/Completable.java b/src/main/java/io/reactivex/Completable.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/reactivex/Completable.java
+++ b/src/main/java/io/reactivex/Completable.java
@@ -1694,7 +1694,10 @@ public abstract class Completable implements CompletableSource {
*/
public final TestSubscriber<Void> test(boolean cancelled) {
TestSubscriber<Void> ts = new TestSubscriber<Void>();
- ts.dispose();
+
+ if (cancelled) {
+ ts.cancel();
+ }
subscribe(new SubscriberCompletableObserver<Void>(ts));
return ts;
} | 2.x: Completable.test cancel TestSubscriber when wanted (#<I>) | ReactiveX_RxJava | train | java |
b7a23c44f043bc2be18731fda64f50a332c9ff8a | diff --git a/app_runner_test.go b/app_runner_test.go
index <HASH>..<HASH> 100644
--- a/app_runner_test.go
+++ b/app_runner_test.go
@@ -34,7 +34,7 @@ var _ = Describe("AppRunner", func() {
//make and upload a droplet
var dropletFiles = []zip_helper.ArchiveFile{
{
- Name: "run",
+ Name: "app/run",
Body: `#!/bin/bash
echo hello world
`, | Changed app manager test fixture to match real droplet layout. | cloudfoundry_inigo | train | go |
72e4555b3dc41b0028b9d624afe8d00d29a8d732 | diff --git a/edisgo/grid/network.py b/edisgo/grid/network.py
index <HASH>..<HASH> 100644
--- a/edisgo/grid/network.py
+++ b/edisgo/grid/network.py
@@ -1405,6 +1405,11 @@ class StorageControl:
logging.error(message)
raise KeyError(message)
+ # update pypsa representation
+ if self.network.pypsa is not None:
+ pypsa_io.update_pypsa_storage(
+ self.network.pypsa, storages=[storage], storages_lines=[line])
+
def _check_timeindex(self, timeseries):
"""
Raises an error if time index of battery time series does not | Add update of pypsa in StorageControl | openego_eDisGo | train | py |
c33d112550e41946b4b8397e9862ff2f9d3237d6 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -790,7 +790,7 @@ def managed(name,
)
# Gather the source file from the server
- sfn, source_sum, comment = __salt__['file.get_managed'](
+ sfn, source_sum, comment_ = __salt__['file.get_managed'](
name,
template,
source,
@@ -803,8 +803,8 @@ def managed(name,
defaults,
**kwargs
)
- if comment and contents is None:
- return _error(ret, comment)
+ if comment_ and contents is None:
+ return _error(ret, comment_)
else:
return __salt__['file.manage_file'](name,
sfn, | file state: comment -> comment_, to avoid shadowing outer func | saltstack_salt | train | py |
86671436d6f03c7f2849a7e432246b00b12bf84a | diff --git a/vault/request_handling.go b/vault/request_handling.go
index <HASH>..<HASH> 100644
--- a/vault/request_handling.go
+++ b/vault/request_handling.go
@@ -293,13 +293,13 @@ func (c *Core) HandleRequest(httpCtx context.Context, req *logical.Request) (res
ctx, cancel := context.WithCancel(c.activeContext)
defer cancel()
- go func() {
+ go func(ctx context.Context, httpCtx context.Context) {
select {
case <-ctx.Done():
case <-httpCtx.Done():
cancel()
}
- }()
+ }(ctx, httpCtx)
// Allowing writing to a path ending in / makes it extremely difficult to
// understand user intent for the filesystem-like backends (kv, | Pass the ctx value to make the race detector happy (#<I>) | hashicorp_vault | train | go |
5d54c7d5001f8a06321f05174b13a5d839ac5240 | diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py
index <HASH>..<HASH> 100644
--- a/searx/engines/dailymotion.py
+++ b/searx/engines/dailymotion.py
@@ -6,16 +6,18 @@ categories = ['videos']
locale = 'en_US'
# see http://www.dailymotion.com/doc/api/obj-video.html
-search_url = 'https://api.dailymotion.com/videos?fields=title,description,duration,url,thumbnail_360_url&sort=relevance&limit=25&page=1&{query}' # noqa
+search_url = 'https://api.dailymotion.com/videos?fields=title,description,duration,url,thumbnail_360_url&sort=relevance&limit=25&page={pageno}&{query}' # noqa
# TODO use video result template
content_tpl = '<a href="{0}" title="{0}" ><img src="{1}" /></a><br />'
+paging = True
+
def request(query, params):
- global search_url
params['url'] = search_url.format(
- query=urlencode({'search': query, 'localization': locale}))
+ query=urlencode({'search': query, 'localization': locale}),
+ pageno=params['pageno'])
return params | [enh] paging support for dailymotion | asciimoo_searx | train | py |
be32b6168b7222474e145c26a7a8db8b850a63fb | diff --git a/spec/thinking_sphinx/active_record/sql_source_spec.rb b/spec/thinking_sphinx/active_record/sql_source_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/thinking_sphinx/active_record/sql_source_spec.rb
+++ b/spec/thinking_sphinx/active_record/sql_source_spec.rb
@@ -57,7 +57,7 @@ describe ThinkingSphinx::ActiveRecord::SQLSource do
}
it "loads the processor with the adapter" do
- processor_class.should_receive(:try).with(:new, adapter).
+ processor_class.should_receive(:try).with(:new, adapter, {}).
and_return processor
source.delta_processor | Fix ThinkingSphinx::ActiveRecord::SQLSource#delta_processor spec to pass with delta_options | pat_thinking-sphinx | train | rb |
e35ba9abbc894cb1650ff264d1c5ab039efa2eb5 | diff --git a/picasso/src/main/java/com/squareup/picasso3/DrawableLoader.java b/picasso/src/main/java/com/squareup/picasso3/DrawableLoader.java
index <HASH>..<HASH> 100644
--- a/picasso/src/main/java/com/squareup/picasso3/DrawableLoader.java
+++ b/picasso/src/main/java/com/squareup/picasso3/DrawableLoader.java
@@ -17,7 +17,8 @@ package com.squareup.picasso3;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
+import android.support.annotation.Nullable;
public interface DrawableLoader {
- Drawable load(@DrawableRes int resId);
-}
\ No newline at end of file
+ @Nullable Drawable load(@DrawableRes int resId);
+} | Mark DrawableLoader return value as nullable. | square_picasso | train | java |
9266d5461513129723c919901480b81628b88975 | diff --git a/jrugged-aspects/src/main/java/org/fishwife/jrugged/aspects/CircuitBreakerAspect.java b/jrugged-aspects/src/main/java/org/fishwife/jrugged/aspects/CircuitBreakerAspect.java
index <HASH>..<HASH> 100644
--- a/jrugged-aspects/src/main/java/org/fishwife/jrugged/aspects/CircuitBreakerAspect.java
+++ b/jrugged-aspects/src/main/java/org/fishwife/jrugged/aspects/CircuitBreakerAspect.java
@@ -74,7 +74,7 @@ public class CircuitBreakerAspect {
* org.fishwife.jrugged.aspects.CircuitBreaker} annotation that
* actually wrapped the method
* @throws Throwable if the method invocation itself or the wrapping
- * {@link org.jrugged.fishwife.CircuitBreaker} throws one during
+ * {@link org.fishwife.jrugged.CircuitBreaker} throws one during
* execution
*/
@Around("@annotation(circuitTag)") | - Commited against Issue <I> registered by Anshu. Many Thanks. | Comcast_jrugged | train | java |
de18313f2f8a3941796700869a88f414c720a210 | diff --git a/api/dial.go b/api/dial.go
index <HASH>..<HASH> 100644
--- a/api/dial.go
+++ b/api/dial.go
@@ -22,15 +22,11 @@ var KeepAlive = 10 * time.Second
// MaxRetries indicates how often clients should retry dialing a component
var MaxRetries = 100
-// Timeout for connections
-var Timeout = 2 * time.Second
-
// DialOptions to use in TTN gRPC
var DialOptions = []grpc.DialOption{
WithTTNDialer(),
grpc.WithBlock(),
grpc.FailOnNonTempDialError(true),
- grpc.WithTimeout(Timeout),
}
func dial(address string, tlsConfig *tls.Config, fallback bool) (conn *grpc.ClientConn, err error) { | Remove gRPC timeout from api.Dial | TheThingsNetwork_ttn | train | go |
2a0d858deff6b4526e3fcee21f928d755a40dc40 | diff --git a/partition.go b/partition.go
index <HASH>..<HASH> 100644
--- a/partition.go
+++ b/partition.go
@@ -133,6 +133,10 @@ func (buf *Partition) Write(p []byte) (n int, err error) {
}
func (buf *Partition) WriteAt(p []byte, off int64) (n int, err error) {
+ if off > buf.Len() {
+ return 0, bytes.ErrTooLarge
+ }
+
index := 0
for off > 0 && index < len(buf.BufferList) {
buffer := buf.BufferList[index] | Partition WriterAt has extra protection | djherbis_buffer | train | go |
ac5d5176e9e3d28ed3dd7b54b1401778e00959fe | diff --git a/src/js/utilities/subpx.js b/src/js/utilities/subpx.js
index <HASH>..<HASH> 100644
--- a/src/js/utilities/subpx.js
+++ b/src/js/utilities/subpx.js
@@ -82,7 +82,7 @@ Crocodoc.addUtility('subpx', function (framework) {
if (!subpixelRenderingIsSupported) {
if (document.body.style.zoom !== undefined) {
var $wrap = $('<div>').addClass(CSS_CLASS_SUBPX_FIX);
- $(el).children().wrapAll($wrap);
+ $(el).wrap($wrap);
}
}
return el; | Modify the subpx util to wrap around text layer instead of inside
This is a bug fix for annotations, because text selection serializes
differently with/out the subpx layer when using .crocodoc-page-text as
the reference element. | box_viewer.js | train | js |
4938893faeaa244236b6d3aab0acb5c6d5bd7638 | diff --git a/djangoautoconf/management/commands/create_default_super_user.py b/djangoautoconf/management/commands/create_default_super_user.py
index <HASH>..<HASH> 100644
--- a/djangoautoconf/management/commands/create_default_super_user.py
+++ b/djangoautoconf/management/commands/create_default_super_user.py
@@ -6,8 +6,8 @@ from web_manage_tools.user_creator import create_admin
def create_default_admin():
- super_username = get_local_key("admin_account.admin_username", "djangoautoconf.keys_default")
- super_password = get_local_key("admin_account.admin_password", "djangoautoconf.keys_default")
+ super_username = get_default_admin_username()
+ super_password = get_default_admin_password()
if not User.objects.filter(username=super_username).exists():
create_admin(super_username, super_password, "[email protected]")
print "default admin created"
@@ -15,6 +15,14 @@ def create_default_admin():
print "default admin already created"
+def get_default_admin_password():
+ return get_local_key("admin_account.admin_password", "djangoautoconf.keys_default")
+
+
+def get_default_admin_username():
+ return get_local_key("admin_account.admin_username", "djangoautoconf.keys_default")
+
+
class Command(BaseCommand):
args = ''
help = 'Create command cache for environment where os.listdir is not working' | Added default user account utils. | weijia_djangoautoconf | train | py |
e887717d07833360c5d981c213c1a71688c652bb | diff --git a/src/Warden/Http/Controllers/Controller.php b/src/Warden/Http/Controllers/Controller.php
index <HASH>..<HASH> 100755
--- a/src/Warden/Http/Controllers/Controller.php
+++ b/src/Warden/Http/Controllers/Controller.php
@@ -138,4 +138,12 @@ abstract class Controller extends BaseController
return $returnable;
}
+
+ protected function emptyModel($request)
+ {
+ if ($request->ajax()) {
+ return response()->json(['message' => 'No resource found!', 'code' => 404], 404);
+ }
+ return response(redirect('404'), 404);
+ }
} | Add a few methods for data validation | austinkregel_Warden | train | php |
f34edbe0c458a6e886d81e1ce1b00d65c3400a15 | diff --git a/js/huobi.js b/js/huobi.js
index <HASH>..<HASH> 100644
--- a/js/huobi.js
+++ b/js/huobi.js
@@ -1354,20 +1354,16 @@ module.exports = class huobi extends Exchange {
const request = {};
let fieldName = 'symbol';
let method = 'spotPublicGetMarketDetailMerged';
- if (market['future']) {
- if (market['inverse']) {
+ if (market['linear']) {
+ method = 'contractPublicGetLinearSwapExMarketDetailMerged';
+ fieldName = 'contract_code';
+ } else if (market['inverse']) {
+ if (market['future']) {
method = 'contractPublicGetMarketDetailMerged';
- } else if (market['linear']) {
- method = 'contractPublicGetLinearSwapExMarketDetailMerged';
- fieldName = 'contract_code';
- }
- } else if (market['swap']) {
- if (market['inverse']) {
+ } else if (market['swap']) {
method = 'contractPublicGetSwapExMarketDetailMerged';
- } else if (market['linear']) {
- method = 'contractPublicGetLinearSwapExMarketDetailMerged';
+ fieldName = 'contract_code';
}
- fieldName = 'contract_code';
}
request[fieldName] = market['id'];
const response = await this[method] (this.extend (request, params)); | huobi fetchTicker inverse/linear contracts edits | ccxt_ccxt | train | js |
23b104034c903395d60536c4f732fad8c5206df2 | diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Validation/Validator.php
+++ b/src/Illuminate/Validation/Validator.php
@@ -1647,7 +1647,14 @@ class Validator implements MessageProviderInterface {
*/
protected function replaceBefore($message, $attribute, $rule, $parameters)
{
- return str_replace(':date', $parameters[0], $message);
+ if ( ! ($date = strtotime($parameters[0])))
+ {
+ return str_replace(':date', $this->getAttribute($parameters[0]), $message);
+ }
+ else
+ {
+ return str_replace(':date', $parameters[0], $message);
+ }
}
/**
@@ -1661,7 +1668,14 @@ class Validator implements MessageProviderInterface {
*/
protected function replaceAfter($message, $attribute, $rule, $parameters)
{
- return str_replace(':date', $parameters[0], $message);
+ if ( ! ($date = strtotime($parameters[0])))
+ {
+ return str_replace(':date', $this->getAttribute($parameters[0]), $message);
+ }
+ else
+ {
+ return str_replace(':date', $parameters[0], $message);
+ }
}
/** | use translation for attribute for replaceAfter and replaceBefore | laravel_framework | train | php |
999e1a1f22471eece30a1582387b23dcc1521a6c | diff --git a/lib/jcr/parser.rb b/lib/jcr/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/jcr/parser.rb
+++ b/lib/jcr/parser.rb
@@ -73,9 +73,8 @@ module JCR
#! eol = CR / LF
#!
- rule(:root_rule) { primitive_rule | array_rule | object_rule | member_rule | group_rule } # N.B. Not target_rule_name
- #! root_rule = primitive_rule / array_rule / object_rule /
- #! member_rule / group_rule
+ rule(:root_rule) { value_rule | member_rule | group_rule } # N.B. Not target_rule_name
+ #! root_rule = value_rule / member_rule / group_rule
#!
rule(:rule) { ( rule_name >> spcCmnt? >> rule_def ).as(:rule) } | Replaced "primitive_rule | array_rule | object_rule" with "value_rule" in "root_rule" | arineng_jcrvalidator | train | rb |
a856167bed8f8bd018a3df68aa58492bb31d8f87 | diff --git a/assembla/__init__.py b/assembla/__init__.py
index <HASH>..<HASH> 100644
--- a/assembla/__init__.py
+++ b/assembla/__init__.py
@@ -1,3 +1,3 @@
from .api import *
-__VERSION__ = '2.3.0'
\ No newline at end of file
+__VERSION__ = '2.3.1'
\ No newline at end of file | Bumping the version to <I> | markfinger_assembla | train | py |
bdadcea5a1fde50f26e28b1bd197052043e9d759 | diff --git a/tests/class-wp-test-json-controller-testcase.php b/tests/class-wp-test-json-controller-testcase.php
index <HASH>..<HASH> 100644
--- a/tests/class-wp-test-json-controller-testcase.php
+++ b/tests/class-wp-test-json-controller-testcase.php
@@ -15,6 +15,12 @@ abstract class WP_Test_JSON_Controller_Testcase extends WP_Test_JSON_TestCase {
abstract public function test_get_item();
+ abstract public function test_create_item();
+
+ abstract public function test_update_item();
+
+ abstract public function test_delete_item();
+
abstract public function test_prepare_item();
} | Require CRUD tests for all controllers | WP-API_WP-API | train | php |
5716cf3d092680a9a7a4d9baa9bef230d9750ea6 | diff --git a/lib/engineyard-serverside/deploy.rb b/lib/engineyard-serverside/deploy.rb
index <HASH>..<HASH> 100644
--- a/lib/engineyard-serverside/deploy.rb
+++ b/lib/engineyard-serverside/deploy.rb
@@ -388,7 +388,7 @@ WRAP
# task
def symlink(release_to_link=c.release_path)
shell.status "Symlinking code."
- run "rm -f #{c.current_path} && ln -nfs #{release_to_link} #{c.current_path} && sudo find #{c.current_path} -not -user #{c.user} -or -not -group #{c.group} -exec chown #{c.user}:#{c.group} {} +"
+ run "rm -f #{c.current_path} && ln -nfs #{release_to_link} #{c.current_path} && find #{c.current_path} -not -user #{c.user} -or -not -group #{c.group} -exec chown #{c.user}:#{c.group} {} +"
@symlink_changed = true
rescue Exception
sudo "rm -f #{c.current_path} && ln -nfs #{c.previous_release(release_to_link)} #{c.current_path} && chown -R #{c.user}:#{c.group} #{c.current_path}" | Don't sudo chown because we didn't previously. | engineyard_engineyard-serverside | train | rb |
646f7b14b58df2480da30f1fcb6a4ebcda3c2d6c | diff --git a/test/src/Api/Data/CustomObjectTest.php b/test/src/Api/Data/CustomObjectTest.php
index <HASH>..<HASH> 100644
--- a/test/src/Api/Data/CustomObjectTest.php
+++ b/test/src/Api/Data/CustomObjectTest.php
@@ -44,4 +44,4 @@ class CustomObjectTest extends TestCase {
protected function getApiClass() {
return 'Eloqua\Api\Data\CustomObject';
}
-}
\ No newline at end of file
+} | Newline at end of file CustomObjectTest | tableau-mkt_elomentary | train | php |
9bd1d91aa5444cd3d6da9d9e95550076b962737e | diff --git a/loaders/glTF.js b/loaders/glTF.js
index <HASH>..<HASH> 100644
--- a/loaders/glTF.js
+++ b/loaders/glTF.js
@@ -438,9 +438,9 @@ function handlePrimitive(primitive, gltf, ctx) {
indices: {
buffer: indicesAccessor._bufferView._indexBuffer,
offset: indicesAccessor.byteOffset,
- type: indicesAccessor.componentType,
- count: indicesAccessor.count
- }
+ type: indicesAccessor.componentType
+ },
+ count: indicesAccessor.count
}
} else {
geometryProps = { | Move indices count out of indexBuffer to comply with pex-context api | pex-gl_pex-renderer | train | js |
9a1bad17dff14d23076b19a2d976675cfc94d725 | diff --git a/impl/src/main/java/com/buschmais/cdo/impl/bootstrap/CdoUnitFactory.java b/impl/src/main/java/com/buschmais/cdo/impl/bootstrap/CdoUnitFactory.java
index <HASH>..<HASH> 100644
--- a/impl/src/main/java/com/buschmais/cdo/impl/bootstrap/CdoUnitFactory.java
+++ b/impl/src/main/java/com/buschmais/cdo/impl/bootstrap/CdoUnitFactory.java
@@ -82,7 +82,6 @@ public class CdoUnitFactory {
}
private void getCdoUnits(Cdo cdo) {
- cdoUnits = new HashMap<>();
for (CdoUnitType cdoUnitType : cdo.getCdoUnit()) {
String name = cdoUnitType.getName();
String description = cdoUnitType.getDescription(); | #7 fixed support for multiple cdo.xml descriptors | buschmais_extended-objects | train | java |
f659d17101790fb9b7714b2548fdadab57abdab7 | diff --git a/test/write.spec.js b/test/write.spec.js
index <HASH>..<HASH> 100644
--- a/test/write.spec.js
+++ b/test/write.spec.js
@@ -493,8 +493,23 @@ describe('write', function () {
})
})
+ // https://github.com/ipld/js-ipld/issues/157
it.skip('writes a file with a different CID version to the parent', () => {
+ const directory = '/cid-versions'
+ const fileName = `${directory}/file.txt`
+ const expectedBytes = Buffer.from([0, 1, 2, 3])
+ return mfs.mkdir(directory, {
+ cidVersion: 0
+ })
+ .then(() => mfs.write(fileName, expectedBytes, {
+ create: true,
+ cidVersion: 1
+ }))
+ .then(() => mfs.read(fileName))
+ .then(actualBytes => {
+ expect(actualBytes).to.deep.equal(expectedBytes)
+ })
})
it.skip('writes a file with a different hash function to the parent', () => { | test: adds test for different CID versions
License: MIT | ipfs_js-ipfs-mfs | train | js |
9664afecab2c4dea21fb55e219e244570d29668f | diff --git a/nanocomp/version.py b/nanocomp/version.py
index <HASH>..<HASH> 100644
--- a/nanocomp/version.py
+++ b/nanocomp/version.py
@@ -1 +1 @@
-__version__ = "1.10.0"
+__version__ = "1.10.1" | version bump after merging PR
[skip ci] | wdecoster_nanocomp | train | py |
e67fbc6cf9b14a6b617f87891de343e59a665db0 | diff --git a/mess/iters.py b/mess/iters.py
index <HASH>..<HASH> 100644
--- a/mess/iters.py
+++ b/mess/iters.py
@@ -26,7 +26,7 @@ def lines(strings):
:Example:
- >>> list(lines(['a\n', 'b\n', 'c']))
+ >>> list(lines(['a\\n', 'b\\n', 'c']))
['a', 'b', 'c']
"""
for s in strings:
@@ -62,7 +62,7 @@ def groupby(iterable, key=None):
returns the element unchanged.
:Example:
- >>> dict(groupby([0, 1, 2, 3], key=lambda x: x % 2 == 0)
+ >>> dict(groupby([0, 1, 2, 3], key=lambda x: x % 2 == 0))
{True: [0, 2], False: [0, 1]}
"""
groups = defaultdict(list) | Fix docstrings
Use double-backslash instead of single backslash - single backslash was
interpreted by doctest as interactive backslash: joining of the next line into current.
Also balance parens. | alexandershov_mess | train | py |
1b33d7c330cd40ffc1489f3829a9a8afed3d73ec | diff --git a/mautrix/appservice/state_store/abstract.py b/mautrix/appservice/state_store/abstract.py
index <HASH>..<HASH> 100644
--- a/mautrix/appservice/state_store/abstract.py
+++ b/mautrix/appservice/state_store/abstract.py
@@ -95,4 +95,5 @@ class StateStore(ABC):
def has_power_level(self, room_id: RoomID, user_id: UserID, event_type: EventType) -> bool:
room_levels = self.get_power_levels(room_id)
- return room_levels.get_user_level(user_id) >= room_levels.get_event_level(event_type)
+ # FIXME: Is this the right defaults?
+ return room_levels.get('users', {}).get(user_id, 0) >= room_levels.get('events', {}).get(event_type, 0) | It looks like there's some missing code for a room_level object type, fixed just enough to make it work | tulir_mautrix-python | train | py |
27d94902f7d4ce80ab1f8df9d3cdb49e2a75138b | diff --git a/packages/roc-package-webpack-web-dev/src/builder/index.js b/packages/roc-package-webpack-web-dev/src/builder/index.js
index <HASH>..<HASH> 100644
--- a/packages/roc-package-webpack-web-dev/src/builder/index.js
+++ b/packages/roc-package-webpack-web-dev/src/builder/index.js
@@ -77,7 +77,8 @@ export default ({ previousValue: rocBuilder }) => (target) => {
*/
buildConfig.plugins.push(
new builder.DefinePlugin({
- __CLIENT__: true
+ __WEB__: true,
+ __NODE__: false
})
); | Made builds aware that they are in not in node | rocjs_extensions | train | js |
3a5f71f0ee1713fa50a313c9c0d5f38a17feb5d0 | diff --git a/core/optimization/src/main/java/it/unibz/inf/ontop/iq/transformer/impl/DefaultTermTypeTermVisitingTreeTransformer.java b/core/optimization/src/main/java/it/unibz/inf/ontop/iq/transformer/impl/DefaultTermTypeTermVisitingTreeTransformer.java
index <HASH>..<HASH> 100644
--- a/core/optimization/src/main/java/it/unibz/inf/ontop/iq/transformer/impl/DefaultTermTypeTermVisitingTreeTransformer.java
+++ b/core/optimization/src/main/java/it/unibz/inf/ontop/iq/transformer/impl/DefaultTermTypeTermVisitingTreeTransformer.java
@@ -198,6 +198,8 @@ public class DefaultTermTypeTermVisitingTreeTransformer
&& (((ImmutableFunctionalTerm) term).getFunctionSymbol() instanceof RDFTermTypeFunctionSymbol)) {
return ((ImmutableFunctionalTerm) term).getTerm(0);
}
+ else if ((term instanceof Constant) && term.isNull())
+ return term;
else
throw new MinorOntopInternalBugException("Unexpected definition for RDFTermType term");
} | DefaultTermTypeTermVisitingTreeTransformer now works with nulls. | ontop_ontop | train | java |
50d8c87b8d7569e2a3c910b96232c1029b95d683 | diff --git a/Console/MakeAuthCommand.php b/Console/MakeAuthCommand.php
index <HASH>..<HASH> 100644
--- a/Console/MakeAuthCommand.php
+++ b/Console/MakeAuthCommand.php
@@ -71,12 +71,12 @@ class MakeAuthCommand extends Command
*/
protected function createDirectories()
{
- if (! is_dir(base_path('resources/views/layouts'))) {
- mkdir(base_path('resources/views/layouts'), 0755, true);
+ if (! is_dir(resource_path('views/layouts'))) {
+ mkdir(resource_path('views/layouts'), 0755, true);
}
- if (! is_dir(base_path('resources/views/auth/passwords'))) {
- mkdir(base_path('resources/views/auth/passwords'), 0755, true);
+ if (! is_dir(resource_path('views/auth/passwords'))) {
+ mkdir(resource_path('views/auth/passwords'), 0755, true);
}
}
@@ -90,7 +90,7 @@ class MakeAuthCommand extends Command
foreach ($this->views as $key => $value) {
copy(
__DIR__.'/stubs/make/views/'.$key,
- base_path('resources/views/'.$value)
+ resource_path('views/'.$value)
);
}
} | Use resource_path helper instead of hardcoded path (#<I>) | illuminate_auth | train | php |
e58de739429715d7fc99818cb16e6def5e270b35 | diff --git a/src/Liip/Registry/Adaptor/Lucene/ElasticaAdaptor.php b/src/Liip/Registry/Adaptor/Lucene/ElasticaAdaptor.php
index <HASH>..<HASH> 100644
--- a/src/Liip/Registry/Adaptor/Lucene/ElasticaAdaptor.php
+++ b/src/Liip/Registry/Adaptor/Lucene/ElasticaAdaptor.php
@@ -153,16 +153,22 @@ class ElasticaAdaptor implements AdaptorInterface
if (!$document instanceof Document) {
if (is_object($document)) {
-
- if (!method_exists($document, 'toArray')) {
-
- throw new \LogicException(
- 'The given object representing a document value have to implement a toArray() method in order ' .
- 'to be able to store it in elasticsearch.'
- );
+ if (get_class($document) == 'stdClass') {
+ $obj = $document;
+ $document = array();
+ foreach ($obj as $property => $value) {
+ $document[$property] = $value;
+ }
+ } else {
+ if (!method_exists($document, 'toArray')) {
+
+ throw new \LogicException(
+ 'The given object representing a document value have to implement a toArray() method in order ' .
+ 'to be able to store it in elasticsearch.'
+ );
+ }
+ $document = $document->toArray();
}
-
- $document = $document->toArray();
}
$document = $this->decorator->normalizeValue($document); | Fixed: trancodeDataToDocument should also handle stdClass objects. | liip_LiipRegistryAdaptor | train | php |
ff8f2ece91020225b312acf13f2bb5dab82f19c1 | diff --git a/provider/ec2/local_test.go b/provider/ec2/local_test.go
index <HASH>..<HASH> 100644
--- a/provider/ec2/local_test.go
+++ b/provider/ec2/local_test.go
@@ -100,6 +100,7 @@ func (t *localLiveSuite) SetUpSuite(c *gc.C) {
t.TestConfig = localConfigAttrs
t.restoreEC2Patching = patchEC2ForTesting(c)
imagetesting.PatchOfficialDataSources(&t.BaseSuite.CleanupSuite, "test:")
+ t.BaseSuite.PatchValue(&imagemetadata.SimplestreamsImagesPublicKey, sstesting.SignedMetadataPublicKey)
t.srv.createRootDisks = true
t.srv.startServer(c)
} | Found a missing PatchValue.
Still are missing a call to ToolsFixture.SetUpTest for localServerSuite. | juju_juju | train | go |
1b25bfe7df2ae31121e02135117dfef147d5dea9 | diff --git a/assets/entidades.js b/assets/entidades.js
index <HASH>..<HASH> 100644
--- a/assets/entidades.js
+++ b/assets/entidades.js
@@ -292,7 +292,7 @@ function getSelectInput(val) {
function checkRequiresFields() {
var type = getType();
- return (type !== "" && $("#nome").val().length > 1 && (["extend", "extend_mult", "list", "list_mult"].indexOf(type) < 0 || $("#relation").val() !== null));
+ return (type !== "" && $("#nome").val().length > 1 && $("#nome").val() !== "id" && (["extend", "extend_mult", "list", "list_mult"].indexOf(type) < 0 || $("#relation").val() !== null));
}
function checkFieldsOpenOrClose() { | attr with 2 char name | edineibauer_entity-form | train | js |
08ec989fd0b4d4fa8d386fb1b77f8eafbc19ad83 | diff --git a/lib/filelib.php b/lib/filelib.php
index <HASH>..<HASH> 100644
--- a/lib/filelib.php
+++ b/lib/filelib.php
@@ -16,7 +16,9 @@ function download_file_content($url) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
if (!empty($CFG->proxyhost)) {
- curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
+ // don't CONNECT for non-https connections
+ curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
+
if (empty($CFG->proxyport)) {
curl_setopt($ch, CURLOPT_PROXY, $CFG->proxyhost);
} else {
@@ -27,6 +29,12 @@ function download_file_content($url) {
}
}
$result = curl_exec($ch);
+
+ if (curl_errno($ch)) {
+ $curlerror = "CURL request for \"$url\" failed with: ". curl_error($ch);
+ debugging($curlerror, DEBUG_DEVELOPER);
+ }
+
curl_close($ch);
return $result;
} | MDL-<I> - curl was set to use CONNECTs for all http requests. This is disallowed
by most http proxies to prevent tunneling. Added some debugging in case of failure.
Merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
b7c4315ad77d965f1a7e2baa4b16b8418a8d3126 | diff --git a/lib/gruff/line.rb b/lib/gruff/line.rb
index <HASH>..<HASH> 100644
--- a/lib/gruff/line.rb
+++ b/lib/gruff/line.rb
@@ -71,9 +71,10 @@ class Gruff::Line < Gruff::Base
data_row[DATA_VALUES_INDEX].each_with_index do |data_point, index|
new_x = @graph_left + (@x_increment * index)
- next if data_point.nil?
-
+
draw_label(new_x, index)
+
+ next if data_point.nil?
new_y = @graph_top + (@graph_height - data_point * @graph_height) | seems silly to not let the labels get drawn for columns that don't have data points. the x labels would still be valid i would think in most situations. only fixed for line graphs | topfunky_gruff | train | rb |
bf29d1b7c161db09135f6919e2513dac4868263a | diff --git a/gwpy/plot/tests/test_colors.py b/gwpy/plot/tests/test_colors.py
index <HASH>..<HASH> 100644
--- a/gwpy/plot/tests/test_colors.py
+++ b/gwpy/plot/tests/test_colors.py
@@ -57,3 +57,7 @@ def test_format_norm():
assert norm is n
assert norm.vmin == 10
assert norm.vmax == 1000
+
+ # check clim=None is honoured
+ norm, kwargs = plot_colors.format_norm({'clim': None})
+ assert norm.vmin is None and norm.vmax is None | gwpy.plot: added regression test
see eecac5aa1b<I>c3f3af3ea<I>f<I>af9 | gwpy_gwpy | train | py |
b9c6400f9be569efb1e54dae4e7a4c7c49d1ceb7 | diff --git a/lib/ronin/extensions/kernel.rb b/lib/ronin/extensions/kernel.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/extensions/kernel.rb
+++ b/lib/ronin/extensions/kernel.rb
@@ -18,6 +18,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
+require 'extlib'
+
module Kernel
#
# Calls the given block and ignores any raised exceptions.
@@ -95,4 +97,36 @@ module Kernel
path = File.expand_path(File.join('',sub_path))
require File.join(directory,path)
end
+
+ #
+ # Requires the given path and finds the constant defined in the file.
+ #
+ # @param [String] path
+ # The path to require.
+ #
+ # @return [Class, Module, nil]
+ # The constant defined by the file. If `nil` is returned, then either
+ # the file could not be loaded or the constant could not be found.
+ #
+ # @example
+ # require_const 'ronin/exploits/exploit'
+ # # => Ronin::Exploits::Exploit
+ #
+ # @since 0.1.0
+ #
+ def require_const(path)
+ begin
+ require path
+ rescue Gem::LoadError => e
+ raise(e)
+ rescue ::LoadError
+ return nil
+ end
+
+ begin
+ return Object.full_const_get(path.to_const_name)
+ rescue NameError
+ return nil
+ end
+ end
end | Added Kernel#require_const. | ronin-ruby_ronin-support | train | rb |
2e47838fa21363d431f17a6d9f0263adbe2a5380 | diff --git a/pbxproj/pbxcli/pbxproj_file.py b/pbxproj/pbxcli/pbxproj_file.py
index <HASH>..<HASH> 100644
--- a/pbxproj/pbxcli/pbxproj_file.py
+++ b/pbxproj/pbxcli/pbxproj_file.py
@@ -53,7 +53,7 @@ def _add(project, args):
else:
header_scope = args['--header-scope']
- parent_group=None
+ parent_group = None
if args['--parent']:
parent_group = project.get_or_create_group(args['--parent'])
@@ -63,12 +63,8 @@ def _add(project, args):
embed_framework=not args['--no-embed'],
code_sign_on_copy=args['--sign-on-copy'],
header_scope=header_scope.title())
- build_files = None
- if parent_group:
- build_files = project.add_file(args['<path>'], tree=args['--tree'], force=False, target_name=args['--target'],
+ build_files = project.add_file(args['<path>'], tree=args['--tree'], force=False, target_name=args['--target'],
parent=parent_group, file_options=options)
- else:
- build_files = project.add_file(args['<path>'], tree=args['--tree'], force=False, target_name=args['--target'],
file_options=options)
# print some information about the build files created. | Apply suggestions from code review
Apply fixes as suggested during review | kronenthaler_mod-pbxproj | train | py |
3c7163ef66daa946f960961aeff2f555d753d6e9 | diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -1,11 +1,17 @@
package sarama
-import "runtime/debug"
+import (
+ "runtime/debug"
+ "sync"
+)
-var v string
+var (
+ v string
+ vOnce sync.Once
+)
func version() string {
- if v == "" {
+ vOnce.Do(func() {
bi, ok := debug.ReadBuildInfo()
if ok {
v = bi.Main.Version
@@ -15,6 +21,6 @@ func version() string {
// the version
v = "dev"
}
- }
+ })
return v
} | Fix a potential data race on a global variable | Shopify_sarama | train | go |
09240e681dc2ce0530993b2b5c9aaa1838e02740 | diff --git a/src/Foundation/Core/Models/Post.php b/src/Foundation/Core/Models/Post.php
index <HASH>..<HASH> 100644
--- a/src/Foundation/Core/Models/Post.php
+++ b/src/Foundation/Core/Models/Post.php
@@ -48,7 +48,6 @@ class Post extends Model
//'publish' => 'time',
];
-
/**
* The attributes that should be mutated to dates.
*
@@ -58,10 +57,9 @@ class Post extends Model
'created_at',
'updated_at',
'deleted_at',
- 'publish'
+ 'publish',
];
-
/**
* Get the route key for the model.
*
diff --git a/src/Foundation/Core/Models/Role.php b/src/Foundation/Core/Models/Role.php
index <HASH>..<HASH> 100644
--- a/src/Foundation/Core/Models/Role.php
+++ b/src/Foundation/Core/Models/Role.php
@@ -37,7 +37,6 @@ class Role extends Model implements RoleInterface
'permissions' => 'array',
];
-
/**
* Get the route key for the model.
* | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | orchidsoftware_platform | train | php,php |
a6fae6da3d7775ed0cf779b0884f4e6c3ded9960 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -44,11 +44,7 @@ gulp.task('js', function() {
.pipe(gulp.dest(distDir + '/js'))
// Minified
- .pipe(uglify({
- mangle: {
- except: 'Tether'
- }
- }))
+ .pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(distDir + '/js'));
}); | Fixes gulp pipeline
- Removes mangling exemption for Tether to fix undefined function call | shipshapecode_shepherd | train | js |
f1c3b7aed050cf4acaa17721f5ed165fec3121a1 | diff --git a/public/scripts/repository.js b/public/scripts/repository.js
index <HASH>..<HASH> 100644
--- a/public/scripts/repository.js
+++ b/public/scripts/repository.js
@@ -12,7 +12,6 @@ var RepositoryViewModel = function(main, repoPath) {
this.repoPath = repoPath;
this.staging = new StagingViewModel(this);
this.gerritIntegration = ko.observable(null);
- if (ungit.config.gerrit) this.gerritIntegration(new GerritIntegrationViewModel(this));
this.isFetching = ko.observable(false);
this.graph = new GitGraphViewModel(this);
this.updateStatus();
@@ -31,6 +30,9 @@ var RepositoryViewModel = function(main, repoPath) {
self.main.dialog().askForCredentials(callback);
}
});
+ if (ungit.config.gerrit) {
+ self.gerritIntegration(new GerritIntegrationViewModel(self));
+ }
}
});
} | Wait for ok status before loading gerrit integration | FredrikNoren_ungit | train | js |
734d9f32a3515680419e5b6cd9e24869a99b5e96 | diff --git a/src/utils/utils.js b/src/utils/utils.js
index <HASH>..<HASH> 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -5,26 +5,14 @@
import { validate } from 'jsonschema'
-function validateObject (object: any, schema: any) {
+export function validateObject (object: any, schema: any) {
let result = null
try {
result = validate(object, schema)
} catch (e) {
- console.log(e)
+ console.error(e)
return false
}
- if (result && result.errors && result.errors.length === 0) {
- return true
- } else {
- if (result.errors) {
- for (const n in result.errors) {
- const errMsg = result.errors[n].message
- console.log('ERROR: validateObject:' + errMsg)
- }
- }
- return false
- }
+ return result && result.errors && result.errors.length === 0
}
-
-export { validateObject } | Remove extra logging
These are not real errors, since the only purpose is to detect whether data is valid or not. Therefore, do not spew useless noise. If having bad data is a crime, then somebody else had better log the actual error. | EdgeApp_edge-currency-bitcoin | train | js |
0a517b51cda071a5d2271b1e79751b11e75a05d7 | diff --git a/packages/babel-traverse/src/path/index.js b/packages/babel-traverse/src/path/index.js
index <HASH>..<HASH> 100644
--- a/packages/babel-traverse/src/path/index.js
+++ b/packages/babel-traverse/src/path/index.js
@@ -7,6 +7,7 @@ import traverse from "../index";
import Scope from "../scope";
import * as t from "@babel/types";
import { path as pathCache } from "../cache";
+import generator from "@babel/generator";
// NodePath is split across many files.
import * as NodePath_ancestry from "./ancestry";
@@ -146,6 +147,10 @@ export default class NodePath {
if (!debug.enabled) return;
debug(`${this.getPathLocation()} ${this.type}: ${message}`);
}
+
+ toString() {
+ return generator(this.node).code;
+ }
}
Object.assign( | Added custom NodePath.prototype.toString method as debug utility (#<I>) | babel_babel | train | js |
0cafeb7ce6521d0b5852af4c09d139ec47a24aef | diff --git a/runcommands/runners/remote.py b/runcommands/runners/remote.py
index <HASH>..<HASH> 100644
--- a/runcommands/runners/remote.py
+++ b/runcommands/runners/remote.py
@@ -9,9 +9,8 @@ try:
except ImportError:
paramiko = None
else:
- from paramiko.agent import Agent as SSHAgent
from paramiko.client import AutoAddPolicy, SSHClient
- from paramiko.ssh_exception import AuthenticationException, SSHException
+ from paramiko.ssh_exception import SSHException
from ..util import Hide, printer
from .base import Runner | Remove unused imports from runners.remote | wylee_runcommands | train | py |
fb19d25ee5ac131b07d740c6bf995b5914d99975 | diff --git a/command/rpc.go b/command/rpc.go
index <HASH>..<HASH> 100644
--- a/command/rpc.go
+++ b/command/rpc.go
@@ -9,12 +9,12 @@ import (
// RPCAddrFlag returns a pointer to a string that will be populated
// when the given flagset is parsed with the RPC address of the Serf.
func RPCAddrFlag(f *flag.FlagSet) *string {
- rpcAddr := os.Getenv("SERF_RPC_ADDR")
- if rpcAddr != "" {
- return &rpcAddr
+ defaultRpcAddr := os.Getenv("SERF_RPC_ADDR")
+ if defaultRpcAddr == "" {
+ defaultRpcAddr = "127.0.0.1:7373"
}
- return f.String("rpc-addr", "127.0.0.1:7373",
+ return f.String("rpc-addr", defaultRpcAddr,
"RPC address of the Serf agent")
} | command-line args takes precedence over the environment | hashicorp_serf | train | go |
cf1024af5c81fea128f6186e791f5541047ce0e9 | diff --git a/dockermap/map/dep.py b/dockermap/map/dep.py
index <HASH>..<HASH> 100644
--- a/dockermap/map/dep.py
+++ b/dockermap/map/dep.py
@@ -81,6 +81,9 @@ class BaseDependencyResolver(with_metaclass(ABCMeta, object)):
def __init__(self, initial=None):
self._deps = _dependency_dict(initial)
+ def __contains__(self, item):
+ return item in self._deps
+
def merge_dependency(self, item, resolve_parent, parent):
"""
Called by :meth:`~BaseDependencyResolver.get_dependencies` once on each node. The result is cached for
@@ -121,6 +124,19 @@ class BaseDependencyResolver(with_metaclass(ABCMeta, object)):
return _get_sub_dependency(item)
+ def get(self, item, default=()):
+ """
+ Returns the direct dependencies or dependents of a single item. Does not follow the entire dependency path.
+
+ :param item: Node to return dependencies for.
+ :param default: Default value to return in case the item is not stored.
+ :return: Immediate dependencies or dependents.
+ """
+ e = self._deps.get(item)
+ if e is None:
+ return default
+ return e.parent
+
def reset(self):
"""
Resets all cached nodes. | Additional methods for dependency resolvers. | merll_docker-map | train | py |
2a519b2b47fc55456c751addb19366a636621f6f | diff --git a/activejdbc/src/main/java/org/javalite/activejdbc/Base.java b/activejdbc/src/main/java/org/javalite/activejdbc/Base.java
index <HASH>..<HASH> 100644
--- a/activejdbc/src/main/java/org/javalite/activejdbc/Base.java
+++ b/activejdbc/src/main/java/org/javalite/activejdbc/Base.java
@@ -362,7 +362,7 @@ public class Base {
* @param ps <code>java.sql.PreparedStatement</code> with which a batch has been executed. If null, this is a no-op.
*/
public static void closePreparedStatement(PreparedStatement ps) {
- new DB(DB.DEFAULT_NAME).closeBatch(ps);
+ new DB(DB.DEFAULT_NAME).closePreparedStatement(ps);
}
/**
* Attaches a database connection to current thread under a default name. | And updated the call from one to the other... | javalite_activejdbc | train | java |
0b425530f47d0785d1c2c6124bf952b895511abe | diff --git a/Menu/Menu.php b/Menu/Menu.php
index <HASH>..<HASH> 100644
--- a/Menu/Menu.php
+++ b/Menu/Menu.php
@@ -79,7 +79,7 @@ class Menu implements MenuInterface
$request = $this->requestStack->getCurrentRequest();
- $currentUrl = null !== $request ? $request->getPathInfo() : null;
+ $currentUrl = null !== $request ? $request->getRequestUri() : '';
foreach ($this->itemFactories as $itemFactory) {
foreach ($itemFactory->getItems() as $item) {
@@ -101,7 +101,7 @@ class Menu implements MenuInterface
continue;
}
- if ($item->getIndexUrl() === $currentUrl || $item->getNewUrl() === $currentUrl) {
+ if (0 === strpos($currentUrl, (string)$item->getIndexUrl())) {
$item->setActive(true);
} | Mark parent menu item as active if any it's child is active. | DarvinStudio_DarvinAdminBundle | train | php |
adc561b38fd127ba9ca055455be2ede05f5ffff2 | diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Layer/Grid.js
+++ b/lib/OpenLayers/Layer/Grid.js
@@ -148,7 +148,9 @@ OpenLayers.Layer.Grid.prototype =
} else {
if (!this.grid || zoomChanged) {
this._initTiles();
- } else {
+ } else if (this.getGridBounds().containsBounds(bounds, true) == false) {
+ this._initTiles();
+ } else {
var i = 0;
while (this.getGridBounds().bottom > bounds.bottom) {
this.insertRow(false); | When panning by large distances, OpenLayers previously created all the grid
space inbetween. This no longer happens -- instead, the grid will re-init if
the bounds is not at least partially contained by the existing box.
git-svn-id: <URL> | openlayers_openlayers | train | js |
4993c7c94185608510cc9e349bbc74f75f4a7fdc | diff --git a/airflow/utils/db.py b/airflow/utils/db.py
index <HASH>..<HASH> 100644
--- a/airflow/utils/db.py
+++ b/airflow/utils/db.py
@@ -86,6 +86,7 @@ REVISION_HEADS_MAP = {
"2.2.2": "7b2661a43ba3",
"2.2.3": "be2bfac3da23",
"2.2.4": "587bdf053233",
+ "2.2.5": "587bdf053233",
} | Add <I> to revision heads map (#<I>)
This is necessary to allow for downgrade to <I> | apache_airflow | train | py |
cc672fe3c12cfb9f00c1b1f9b3a373f6794dbd5f | diff --git a/nxtools/__init__.py b/nxtools/__init__.py
index <HASH>..<HASH> 100644
--- a/nxtools/__init__.py
+++ b/nxtools/__init__.py
@@ -10,4 +10,6 @@ from .common import *
from .files import *
from .logging import *
from .text import *
-from .timeutils import *
\ No newline at end of file
+from .timeutils import *
+from .media import *
+from .caspar import *
\ No newline at end of file | added caspar and media to default exports | immstudios_nxtools | train | py |
9f8f6d467f5c73659d1362e5d70232d89a1a49c7 | diff --git a/openquake/engine/__init__.py b/openquake/engine/__init__.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/__init__.py
+++ b/openquake/engine/__init__.py
@@ -50,7 +50,7 @@ along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.
import os
import subprocess
-
+from openquake import commonlib
def git_suffix():
"""
@@ -117,3 +117,8 @@ def set_django_settings_module():
os.environ['DJANGO_SETTINGS_MODULE'] = 'openquake.engine.settings'
set_django_settings_module()
+
+commonlib_version = map(int, commonlib.__version__.split('.'))
+if commonlib_version < [0, 2, 0]:
+ raise RuntimeError(
+ 'You have an old version of commonlib: ' + commonlib.__version__) | Added check on the version of commonlib | gem_oq-engine | train | py |
4c516ea92feffef1f5966f7d6a78956e25769a9b | diff --git a/lib/Sabre/DAV/Tree/TemporaryFileFilter.php b/lib/Sabre/DAV/Tree/TemporaryFileFilter.php
index <HASH>..<HASH> 100644
--- a/lib/Sabre/DAV/Tree/TemporaryFileFilter.php
+++ b/lib/Sabre/DAV/Tree/TemporaryFileFilter.php
@@ -73,12 +73,12 @@ class Sabre_DAV_Tree_TemporaryFileFilter extends Sabre_DAV_Tree_Filter {
$tempPath = basename($path);
$tempFiles = array(
- '/^._(.*)$/', // OS/X resource forks
+ '/^\._(.*)$/', // OS/X resource forks
'/^.DS_Store$/', // OS/X custom folder settings
'/^desktop.ini$/', // Windows custom folder settings
'/^Thumbs.db$/', // Windows thumbnail cache
'/^.(.*).swp$/', // ViM temporary files
- '/.dat(.*)$/', // Smultron seems to create these
+ '/\.dat(.*)$/', // Smultron seems to create these
);
$match = false; | Fixed regexes, data-loss could occur otherwise
We didn't excape the period, resulting in matching 'any' character | sabre-io_dav | train | php |
f11b8df2a47fd1725dbe8a7f0bbf01a2438a323b | diff --git a/.gitignore b/.gitignore
index <HASH>..<HASH> 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-gcsfuse
-
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
diff --git a/time_eq_test.go b/time_eq_test.go
index <HASH>..<HASH> 100644
--- a/time_eq_test.go
+++ b/time_eq_test.go
@@ -18,7 +18,7 @@ import (
"testing"
"time"
- "github.com/googlecloudplatform/gcsfuse/timeutil"
+ "github.com/jacobsa/timeutil"
. "github.com/jacobsa/oglematchers"
. "github.com/jacobsa/ogletest"
)
diff --git a/time_near_test.go b/time_near_test.go
index <HASH>..<HASH> 100644
--- a/time_near_test.go
+++ b/time_near_test.go
@@ -18,7 +18,7 @@ import (
"testing"
"time"
- "github.com/googlecloudplatform/gcsfuse/timeutil"
+ "github.com/jacobsa/timeutil"
. "github.com/jacobsa/oglematchers"
. "github.com/jacobsa/ogletest"
) | Updated gcsfuse references. | jacobsa_timeutil | train | gitignore,go,go |
04a6736f36a286ad984673f9dca69f9f3d53418e | diff --git a/zipline/assets/asset_writer.py b/zipline/assets/asset_writer.py
index <HASH>..<HASH> 100644
--- a/zipline/assets/asset_writer.py
+++ b/zipline/assets/asset_writer.py
@@ -66,7 +66,7 @@ _equities_defaults = {
'symbol': None,
'asset_name': None,
'start_date': 0,
- 'end_date': 2 ** 62 - 1,
+ 'end_date': np.iinfo(np.int64).max,
'first_traded': None,
'auto_close_date': None,
# the canonical exchange name, like "NYSE"
@@ -81,7 +81,7 @@ _futures_defaults = {
'root_symbol': None,
'asset_name': None,
'start_date': 0,
- 'end_date': 2 ** 62 - 1,
+ 'end_date': np.iinfo(np.int64).max,
'first_traded': None,
'exchange': None,
'notice_date': None,
@@ -110,7 +110,7 @@ _equity_supplementary_mappings_defaults = {
'value': None,
'field': None,
'start_date': 0,
- 'end_date': 2 ** 62 - 1,
+ 'end_date': np.iinfo(np.int64).max,
} | MAINT: Define default end_date in assets.db as max int<I>, for clarity | quantopian_zipline | train | py |
839d92c4d736f00a1ca886d4d98f027981e47476 | diff --git a/socketio/server.py b/socketio/server.py
index <HASH>..<HASH> 100644
--- a/socketio/server.py
+++ b/socketio/server.py
@@ -30,7 +30,7 @@ class SocketIOServer(WSGIServer):
:param policy_server: Boolean describing whether or not to use the
Flash policy server. Default True.
- :param policy_listener : A tuple containing (host, port) for the
+ :param policy_listener: A tuple containing (host, port) for the
policy server. This is optional and used only if policy server
is set to true. The default value is 0.0.0.0:843 | docs: Little space that affected the layout in the rendered docs. | abourget_gevent-socketio | train | py |
25fe9882c973b925febb790649c24916048f0dca | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ requires = [
setup(
name='amaasutils',
- version='1.2.8',
+ version='1.2.9',
description='Asset Management as a Service - Utils',
license='Apache License 2.0',
url='https://github.com/amaas-fintech/amaas-utils-python', | AMAAS-<I> Updating package version | amaas-fintech_amaas-utils-python | train | py |
0d8310cbec57ab3846f7b8310f42268c95a42f18 | diff --git a/tests/unit/states/test_mac_assistive.py b/tests/unit/states/test_mac_assistive.py
index <HASH>..<HASH> 100644
--- a/tests/unit/states/test_mac_assistive.py
+++ b/tests/unit/states/test_mac_assistive.py
@@ -1,12 +1,4 @@
-# -*- coding: utf-8 -*-
-
-# Import Python libs
-from __future__ import absolute_import, print_function, unicode_literals
-
-# Import Salt Libs
import salt.states.mac_assistive as assistive
-
-# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase | Drop Py2 and six on tests/unit/states/test_mac_assistive.py | saltstack_salt | train | py |
f2788c7d040ce35453368b86bf3bbb0a6e7056d7 | diff --git a/src/Generator.php b/src/Generator.php
index <HASH>..<HASH> 100644
--- a/src/Generator.php
+++ b/src/Generator.php
@@ -129,4 +129,31 @@ class Generator
return $min + abs($rand % ($max - $min + 1));
}
+ public static function uuid()
+ {
+ $hash = bin2hex(static::bytes(16));
+
+ $timeHiVersion = substr($hash, 12, 4);
+ $timeHiVersion = hexdec($timeHiVersion) & 0x0fff;
+ $timeHiVersion &= ~(0xf000);
+ $timeHiVersion |= 4 << 12; // version is 4
+ $timeHiVersion = sprintf('%04x', $timeHiVersion);
+ $clockHi = hexdec(substr($hash, 16, 2));
+ $clockHi = $clockHi & 0x3f;
+ $clockHi &= ~(0xc0);
+ $clockHi |= 0x80;
+ $clockHi = sprintf('%02x', $clockHi);
+
+ return vsprintf(
+ '%08s-%04s-%04s-%02s%02s-%012s',
+ [
+ substr($hash, 0, 8),
+ substr($hash, 8, 4),
+ $timeHiVersion,
+ $clockHi,
+ substr($hash, 18, 2),
+ substr($hash, 20, 12)
+ ]
+ );
+ }
} | Added uuid() method for <I> UUIDs | vakata_random | train | php |
53e8e49552211e0cd8873aa9c5826aab96f1475a | diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java
index <HASH>..<HASH> 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java
@@ -98,6 +98,7 @@ public abstract class TestJarCreator {
writeEntry(jarOutputStream, "META-INF/versions/11/multi-release.dat", 11);
writeEntry(jarOutputStream, "META-INF/versions/12/multi-release.dat", 12);
writeEntry(jarOutputStream, "META-INF/versions/13/multi-release.dat", 13);
+ writeEntry(jarOutputStream, "META-INF/versions/14/multi-release.dat", 14);
}
else {
writeEntry(jarOutputStream, "3.dat", 3); | Fix JarFileTests for multi-release JARs on JDK<I>
See gh-<I> | spring-projects_spring-boot | train | java |
68a5feb4f9e560cb049e13cc2fbbbb2fef57e5e9 | diff --git a/main/src/main/java/tachyon/master/MasterInfo.java b/main/src/main/java/tachyon/master/MasterInfo.java
index <HASH>..<HASH> 100644
--- a/main/src/main/java/tachyon/master/MasterInfo.java
+++ b/main/src/main/java/tachyon/master/MasterInfo.java
@@ -502,8 +502,7 @@ public class MasterInfo implements ImageWriter {
if (delInode.equals(mRoot)) {
continue;
}
- InodeFolder parent = (InodeFolder) mInodes.get(delInode.getParentId());
- parent.removeChild(delInode);
+
if (delInode.isFile()) {
String checkpointPath = ((InodeFile) delInode).getCheckpointPath();
if (!checkpointPath.equals("")) {
@@ -535,6 +534,9 @@ public class MasterInfo implements ImageWriter {
}
}
+ InodeFolder parent = (InodeFolder) mInodes.get(delInode.getParentId());
+ parent.removeChild(delInode);
+
if (mRawTables.exist(delInode.getId())) {
succeed = succeed && mRawTables.delete(delInode.getId());
} | Moved checkpoint deletion before InodeFolder deletion | Alluxio_alluxio | train | java |
d7478fc53194d22b4580d7d47153e0e5dfdea07c | diff --git a/lib/activedirectory.js b/lib/activedirectory.js
index <HASH>..<HASH> 100755
--- a/lib/activedirectory.js
+++ b/lib/activedirectory.js
@@ -447,8 +447,7 @@ function search(baseDN, opts, callback) {
pendingReferrals.push(referralClient);
var referral = Url.parse(referralUrl);
- referral.pathname = referral.pathname || '/'; // make sure substring doesn't explode
- var referralBaseDn = referral.pathname.substring(1);
+ var referralBaseDn = (referral.pathname || '/').substring(1);
referralClient.search(referralBaseDn, getLdapOpts(opts), controls, function(err, res) {
/**
* Occurs when a error is encountered with the referral client. | cleanup: remove extra / unnecessary variable assignment | gheeres_node-activedirectory | train | js |
82409ea4056a41355736a397bc567d35d93fcf0a | diff --git a/src/Route.php b/src/Route.php
index <HASH>..<HASH> 100644
--- a/src/Route.php
+++ b/src/Route.php
@@ -28,12 +28,14 @@ namespace Aura\Router;
*
* @property-read array $attributes Attribute values added by the rules.
*
- * @property-read array $tokens Plceholder token names and regexes.
+ * @property-read array $tokens Placeholder token names and regexes.
*
* @property-read string $wildcard The name of the wildcard token.
*
* @property-read array $accept
*
+ * @property-read mixed $auth The auth value.
+ *
* @property-read array $extras
*
* @property-read bool $secure | Added missing $auth property annotation | auraphp_Aura.Router | train | php |
Subsets and Splits