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
|
---|---|---|---|---|---|
f160b87f662916ba1a584600c9161813255b6529 | diff --git a/lib/fog/vcloud_director/parsers/compute/vm.rb b/lib/fog/vcloud_director/parsers/compute/vm.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/vcloud_director/parsers/compute/vm.rb
+++ b/lib/fog/vcloud_director/parsers/compute/vm.rb
@@ -22,6 +22,7 @@ module Fog
@response[:vm].merge!(vm_attrs.reject {|key,value| ![:href, :name, :status, :type, :deployed].include?(key)})
@response[:vm][:id] = @response[:vm][:href].split('/').last
@response[:vm][:status] = human_status(@response[:vm][:status])
+ @response[:vm][:deployed] = @response[:vm][:deployed] == 'true'
else
parse_start_element name, attributes, @response[:vm]
end | Adding 'deployed' status to model so that one can decide whether to undeploy. | fog_fog | train | rb |
cefd51c50cc08be8146c1151544495968ce8f2ad | diff --git a/src/transformers/data/processors/glue.py b/src/transformers/data/processors/glue.py
index <HASH>..<HASH> 100644
--- a/src/transformers/data/processors/glue.py
+++ b/src/transformers/data/processors/glue.py
@@ -80,11 +80,15 @@ def glue_convert_examples_to_features(
features = []
for (ex_index, example) in enumerate(examples):
- if ex_index % 10000 == 0:
- logger.info("Writing example %d/%d" % (ex_index, len(examples)))
+ len_examples = 0
if is_tf_dataset:
example = processor.get_example_from_tensor_dict(example)
example = processor.tfds_map(example)
+ len_examples = tf.data.experimental.cardinality(examples)
+ else:
+ len_examples = len(examples)
+ if ex_index % 10000 == 0:
+ logger.info("Writing example %d/%d" % (ex_index, len_examples))
inputs = tokenizer.encode_plus(example.text_a, example.text_b, add_special_tokens=True, max_length=max_length,)
input_ids, token_type_ids = inputs["input_ids"], inputs["token_type_ids"] | Fix glue processor failing on tf datasets | huggingface_pytorch-pretrained-BERT | train | py |
89008c423047f6cf9b5f4c5ed696e395c8c13429 | diff --git a/tests/test_iam/test_iam.py b/tests/test_iam/test_iam.py
index <HASH>..<HASH> 100644
--- a/tests/test_iam/test_iam.py
+++ b/tests/test_iam/test_iam.py
@@ -1,4 +1,5 @@
import json
+import sys
import boto3
import csv
@@ -15,6 +16,7 @@ import pytest
from datetime import datetime
from uuid import uuid4
from urllib import parse
+from unittest import SkipTest
from moto.s3.responses import DEFAULT_REGION_NAME
@@ -3728,6 +3730,10 @@ def test_role_config_dict():
@mock_iam
@mock_config
def test_role_config_client():
+ if sys.version_info < (3, 7):
+ raise SkipTest(
+ "Cannot test this in Py3.6; outdated botocore dependencies do not have all regions"
+ )
from moto.iam.utils import random_resource_id
CONFIG_REGIONS = boto3.Session().get_available_regions("config")
@@ -4172,6 +4178,10 @@ def test_policy_config_dict():
@mock_iam
@mock_config
def test_policy_config_client():
+ if sys.version_info < (3, 7):
+ raise SkipTest(
+ "Cannot test this in Py3.6; outdated botocore dependencies do not have all regions"
+ )
from moto.iam.utils import random_policy_id
CONFIG_REGIONS = boto3.Session().get_available_regions("config") | Tech Debt: Skip some tests in Py<I>, as we do not have access to all regions (#<I>) | spulec_moto | train | py |
2bead9f50838e2455890ea542c73b28d6bec10fc | diff --git a/seleniumbase/js_code/recorder_js.py b/seleniumbase/js_code/recorder_js.py
index <HASH>..<HASH> 100755
--- a/seleniumbase/js_code/recorder_js.py
+++ b/seleniumbase/js_code/recorder_js.py
@@ -201,14 +201,18 @@ var getBestSelector = function(el) {
contains_tags.push('h5');
contains_tags.push('li');
contains_tags.push('td');
+ contains_tags.push('th');
contains_tags.push('code');
contains_tags.push('mark');
contains_tags.push('label');
contains_tags.push('button');
contains_tags.push('legend');
contains_tags.push('strong');
+ contains_tags.push('summary');
all_by_tag = [];
- inner_text = el.innerText.trim();
+ inner_text = '';
+ if (el.innerText)
+ inner_text = el.innerText.trim();
for (var i = 0; i < contains_tags.length; i++) {
if (tag_name == contains_tags[i] &&
inner_text.length >= 2 && inner_text.length <= 64) | Recorder: Add "th" & "summary" tags for selector-generation | seleniumbase_SeleniumBase | train | py |
f40a683b419bc7e6316d74a7459533faf847defd | diff --git a/Generator/Module7.php b/Generator/Module7.php
index <HASH>..<HASH> 100644
--- a/Generator/Module7.php
+++ b/Generator/Module7.php
@@ -34,6 +34,9 @@ class Module7 extends Module {
'component_type' => 'RouterItem',
];
+ $component_data_definition['settings_form']['format'] = 'boolean';
+ unset($component_data_definition['settings_form']['cardinality']);
+
return $component_data_definition;
} | Fixed admin settings form on Drupal 7 and earlier. | drupal-code-builder_drupal-code-builder | train | php |
3923e72ec69bc82525b436de0ff601e0b53b366f | diff --git a/core/src/main/java/com/nesscomputing/event/InternalEventDispatcher.java b/core/src/main/java/com/nesscomputing/event/InternalEventDispatcher.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/nesscomputing/event/InternalEventDispatcher.java
+++ b/core/src/main/java/com/nesscomputing/event/InternalEventDispatcher.java
@@ -56,8 +56,13 @@ class InternalEventDispatcher implements NessEventDispatcher
else {
for (final NessEventReceiver receiver : eventReceivers) {
- if (receiver.accept(event)) {
- receiver.receive(event);
+ try {
+ if (receiver.accept(event)) {
+ receiver.receive(event);
+ }
+ } catch (Exception e) {
+ // don't reraise. We prefer to not disrupt event handling by other receievers
+ LOG.error(e, "Exception during event handling by %s of event %s", receiver, event);
}
}
} | Don't allow exceptions in receivers to stop other receivers from handling events. | NessComputing_components-ness-event | train | java |
adbc9967d1e3fdc1c3c9d5d50208399cd8ff4067 | diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -215,9 +215,10 @@ Widget.renderRecentTopicsWidget = async function (widget) {
};
Widget.renderCategories = async function (widget) {
- const data = await categories.getCategoriesByPrivilege('cid:0:children', widget.uid, 'find');
+ const categoryData = await categories.getCategoriesByPrivilege('categories:cid', widget.uid, 'find');
+ const tree = categories.getTree(categoryData, 0);
widget.html = await app.renderAsync('widgets/categories', {
- categories: data,
+ categories: tree,
relative_path: nconf.get('relative_path'),
});
return widget; | feat: load children catories for widget | NodeBB_nodebb-widget-essentials | train | js |
9e0340a63d3e9825d858febde141672fa5174c9e | diff --git a/etc/build.py b/etc/build.py
index <HASH>..<HASH> 100755
--- a/etc/build.py
+++ b/etc/build.py
@@ -153,6 +153,16 @@ def run_generate():
logging.info("Time taken: {}s".format((end_time - start_time).total_seconds()))
return True
+def make_clean():
+ """Generate static assets.
+ """
+ start_time = datetime.utcnow()
+ run("make clean", shell=True, print_output=True)
+ end_time = datetime.utcnow()
+ logging.info("Time taken: {}s".format((end_time - start_time).total_seconds()))
+ return True
+
+
def go_get(branch, update=False, no_uncommitted=False):
"""Retrieve build dependencies or restore pinned dependencies.
"""
@@ -743,6 +753,10 @@ def main(args):
logging.info("Moving to git commit: {}".format(args.commit))
run("git checkout {}".format(args.commit), print_output=True)
+ if args.clean:
+ if not make_clean():
+ return 1
+
if not args.no_get:
if not go_get(args.branch, update=args.update, no_uncommitted=args.no_uncommitted):
return 1 | Update build to run make clean on --clean | influxdata_influxdb | train | py |
90230ee0c8941e09f7f287495306a0460162f54f | diff --git a/SimpleAudioIndexer/__init__.py b/SimpleAudioIndexer/__init__.py
index <HASH>..<HASH> 100755
--- a/SimpleAudioIndexer/__init__.py
+++ b/SimpleAudioIndexer/__init__.py
@@ -534,7 +534,7 @@ class SimpleAudioIndexer(object):
self._prepare_audio(audio_basename)
if name is not None and audio_name == name:
break
- for staging_audio_name in self.list_audio_files(sub_dir="staging"):
+ for staging_audio_name in self._list_audio_files(sub_dir="staging"):
original_audio_name = ''.join(
staging_audio_name.split('.')[:-1]
)[:-3] | Renaming the missed _list_audio_files within index_audio that was mocked | aalireza_SimpleAudioIndexer | train | py |
fb043bb45880d54d634456f4efed2cc25cddb8ed | diff --git a/src/Plugin.php b/src/Plugin.php
index <HASH>..<HASH> 100644
--- a/src/Plugin.php
+++ b/src/Plugin.php
@@ -68,6 +68,7 @@ class Plugin extends AbstractPlugin implements LoopAwareInterface
{
return array(
'http.request' => 'makeHttpRequest',
+ //'http.streamingRequest' => 'makeStreamingHttpRequest',
);
}
diff --git a/tests/WyriHaximus/Phergie/Plugin/Http/PluginTest.php b/tests/WyriHaximus/Phergie/Plugin/Http/PluginTest.php
index <HASH>..<HASH> 100644
--- a/tests/WyriHaximus/Phergie/Plugin/Http/PluginTest.php
+++ b/tests/WyriHaximus/Phergie/Plugin/Http/PluginTest.php
@@ -26,6 +26,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase
$this->assertInternalType('array', $subscribedEvents);
$this->assertSame(array(
'http.request' => 'makeHttpRequest',
+ //'http.streamingRequest' => 'makeStreamingHttpRequest',
), $subscribedEvents);
} | Going to add a normal HTTP request method and a streaming one | WyriHaximus_PhergieHttp | train | php,php |
61ca12dec1cbe85ebb112449827fe87d4685af31 | diff --git a/rest_framework_json_api/relations.py b/rest_framework_json_api/relations.py
index <HASH>..<HASH> 100644
--- a/rest_framework_json_api/relations.py
+++ b/rest_framework_json_api/relations.py
@@ -141,7 +141,7 @@ class ResourceRelatedField(PrimaryKeyRelatedField):
return super(ResourceRelatedField, self).to_internal_value(data['id'])
def to_representation(self, value):
- if self.pk_field is not None:
+ if getattr(self, 'pk_field', None) is not None:
pk = self.pk_field.to_representation(value.pk)
else:
pk = value.pk | DRF <I> does not have self.pk_field in PrimaryKeyRelatedField | django-json-api_django-rest-framework-json-api | train | py |
4c73f10ef52504ad994f1d62be629fc7aff0f060 | diff --git a/spec/support/raise_spec_error_helper.rb b/spec/support/raise_spec_error_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/support/raise_spec_error_helper.rb
+++ b/spec/support/raise_spec_error_helper.rb
@@ -38,7 +38,7 @@ got:
#{actual_msg}
Diff:
-#{RSpec::Expectations::Differ.new.diff_as_string(actual_msg,expected_exception_msg.to_s)}
+#{RSpec::Support::Differ.new.diff_as_string(actual_msg,expected_exception_msg.to_s)}
MSG
elsif catched_exception
"expected RSpec::Expectations::ExpectationNotMetError, but was #{catched_exception.inspect}" | Fix failure message diff
In Rspec 3 RSpec::Expectations::Differ has been moved to
RSpec::Support::Differ. | kucaahbe_rspec-html-matchers | train | rb |
dac6256b5f6c31797e307fa058747629ee8adfb5 | diff --git a/lib/LineMessageView.js b/lib/LineMessageView.js
index <HASH>..<HASH> 100644
--- a/lib/LineMessageView.js
+++ b/lib/LineMessageView.js
@@ -44,7 +44,11 @@ LineMessageView.content = function () {
LineMessageView.prototype.goToLine = function () {
var char = (this.character !== undefined) ? this.character - 1 : 0;
- var activeFile = Path.relative( atom.project.rootDirectory.path, atom.workspace.getActiveEditor().getUri() );
+ var activeFile;
+ var activeEditor = atom.workspace.getActiveEditor();
+ if (typeof activeEditor !== "undefined" && activeEditor !== null) {
+ activeFile = Path.relative( atom.project.rootDirectory.path, activeEditor.getUri() );
+ }
if (this.file !== undefined && this.file !== activeFile) {
atom.workspace.open(this.file, {initialLine: this.line - 1}); | Support file change when no active editors are open | tcarlsen_atom-message-panel | train | js |
b85d034a987968628fbfac5616400fbdec640932 | diff --git a/examples/example-2.js b/examples/example-2.js
index <HASH>..<HASH> 100644
--- a/examples/example-2.js
+++ b/examples/example-2.js
@@ -29,9 +29,9 @@ const obj = {
const log = Log.child('silly')
log.level = 'silly'
log.silly('hello')
-log.silly('hello', { name: 'evan' })
-log.silly('hello', { name: 'evan' }, true)
-log.silly('hello', { name: 'evan' }, true, 5)
+log.silly('hello', {name: 'evan'})
+log.silly('hello', {name: 'evan'}, true)
+log.silly('hello', {name: 'evan'}, true, 5)
log.silly(obj)
log.verbose('hello')
log.info('hello') | examples: fix linting in example-2 | evanlucas_kittie | train | js |
b9a05e297c694fd410b0636ad8f97cc60ebce81c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ with open('requirements.txt') as f:
setuptools.setup(
name="luthor-for-lex",
- version='0.0.10',
+ version='0.0.11.dev0',
author="Troy Larson",
author_email="[email protected]",
description="Easy Lex bot manager", | Back to development: <I> | troylar_luthor-for-lex | train | py |
6fc42b681c2f4bc297f095e291e9896d77ec1c46 | diff --git a/ledgerblue/checkGenuine.py b/ledgerblue/checkGenuine.py
index <HASH>..<HASH> 100644
--- a/ledgerblue/checkGenuine.py
+++ b/ledgerblue/checkGenuine.py
@@ -103,11 +103,11 @@ def getDeployedSecretV2(dongle, masterPrivate, targetId, issuerKey):
secret = last_pub_key.ecdh(binascii.unhexlify(ephemeralPrivate.serialize()))
if targetId&0xF == 0x2:
return secret[0:16]
- elif targetId&0xF == 0x3:
+ elif targetId&0xF >= 0x3:
ret = {}
ret['ecdh_secret'] = secret
ret['devicePublicKey'] = devicePublicKey
- return ret
+ return ret
if __name__ == '__main__':
from .ecWrapper import PrivateKey, PublicKey | Fix genuine check for newer firmware versions | LedgerHQ_blue-loader-python | train | py |
154ce016cca9d9955192b692f057766b63a2ee24 | diff --git a/src/Chart.Core.js b/src/Chart.Core.js
index <HASH>..<HASH> 100755
--- a/src/Chart.Core.js
+++ b/src/Chart.Core.js
@@ -825,7 +825,7 @@
},
stop : function(){
// Stops any current animation loop occuring
- helpers.cancelAnimFrame(this.animationFrame);
+ cancelAnimFrame(this.animationFrame);
return this;
},
resize : function(callback){ | Ensure cancelAnimFrame has no function context | chartjs_Chart.js | train | js |
042fb505484b848cd57402ef7874b22ec87914c2 | diff --git a/src/meshio/medit/_medit.py b/src/meshio/medit/_medit.py
index <HASH>..<HASH> 100644
--- a/src/meshio/medit/_medit.py
+++ b/src/meshio/medit/_medit.py
@@ -277,12 +277,13 @@ def read_ascii_buffer(f):
).reshape(num_edge_on_geometric_edge, 2)
elif items[0] == "Identifier" or items[0] == "Geometry":
f.readline()
- elif items[0] in ["RequiredVertices", "TangentAtVertices", "Tangents",
- "Ridges"]:
- msg = ("Meshio doesn't know keyword {}. Skipping.").format(items[0])
+ elif items[0] in ["RequiredVertices", "TangentAtVertices",
+ "Tangents", "Ridges"]:
+ msg = f"Meshio doesn't know keyword {items[0]}. Skipping."
logging.warning(msg)
num_to_pass = int(f.readline())
- for i in range(num_to_pass): f.readline()
+ for i in range(num_to_pass):
+ f.readline()
else:
if items[0] != "End":
raise ReadError(f"Unknown keyword '{items[0]}'.") | Break tool long line and use f-string | nschloe_meshio | train | py |
2407d5b65384e38204392fffb983d954e444d6f9 | diff --git a/graylog2-server/src/main/java/org/graylog/events/rest/EventDefinitionsResource.java b/graylog2-server/src/main/java/org/graylog/events/rest/EventDefinitionsResource.java
index <HASH>..<HASH> 100644
--- a/graylog2-server/src/main/java/org/graylog/events/rest/EventDefinitionsResource.java
+++ b/graylog2-server/src/main/java/org/graylog/events/rest/EventDefinitionsResource.java
@@ -188,6 +188,7 @@ public class EventDefinitionsResource extends RestResource implements PluginRest
@PUT
@Path("{definitionId}/schedule")
+ @Consumes(MediaType.WILDCARD)
@ApiOperation("Enable event definition")
@AuditEvent(type = EventsAuditEventTypes.EVENT_DEFINITION_UPDATE)
public void schedule(@ApiParam(name = "definitionId") @PathParam("definitionId") @NotBlank String definitionId) {
@@ -197,6 +198,7 @@ public class EventDefinitionsResource extends RestResource implements PluginRest
@PUT
@Path("{definitionId}/unschedule")
+ @Consumes(MediaType.WILDCARD)
@ApiOperation("Disable event definition")
@AuditEvent(type = EventsAuditEventTypes.EVENT_DEFINITION_UPDATE)
public void unschedule(@ApiParam(name = "definitionId") @PathParam("definitionId") @NotBlank String definitionId) { | Reset Consumes annotation to accept everything for (un)schedule (#<I>)
Since these endpoints don't accept a request body, we can just accept
any content-type. This unbreaks calling these endpoints with our swagger
API browser. | Graylog2_graylog2-server | train | java |
fb8787567f71bef6c58a717ec2ce374d54d2cdb8 | diff --git a/src/main/java/de/digitalcollections/iiif/model/jackson/serialization/ResourceSerializer.java b/src/main/java/de/digitalcollections/iiif/model/jackson/serialization/ResourceSerializer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/digitalcollections/iiif/model/jackson/serialization/ResourceSerializer.java
+++ b/src/main/java/de/digitalcollections/iiif/model/jackson/serialization/ResourceSerializer.java
@@ -116,7 +116,7 @@ public class ResourceSerializer extends JsonSerializer<Resource> {
break;
case ID_ONLY:
// Resources with only an identifier should be a string
- gen.writeObject(value.getIdentifier().toString());
+ gen.writeString(value.getIdentifier().toString());
break;
default:
// Otherwise delegate to default serializer | Fix ResourceSerializer performance problem (fixes #<I>) | dbmdz_iiif-apis | train | java |
e4266c0ffb76d535e01906adff4ce243e4d6a957 | diff --git a/src/Console/Crypt/DecryptCommand.php b/src/Console/Crypt/DecryptCommand.php
index <HASH>..<HASH> 100755
--- a/src/Console/Crypt/DecryptCommand.php
+++ b/src/Console/Crypt/DecryptCommand.php
@@ -105,7 +105,7 @@ class DecryptCommand extends Command
));
}
- $ciphertext = file_get_contents($file);
+ $ciphertext = trim(file_get_contents($file));
}
$this->injectOutputIntoLogger($output, $this->logger);
diff --git a/src/Console/Crypt/EncryptCommand.php b/src/Console/Crypt/EncryptCommand.php
index <HASH>..<HASH> 100755
--- a/src/Console/Crypt/EncryptCommand.php
+++ b/src/Console/Crypt/EncryptCommand.php
@@ -105,7 +105,7 @@ class EncryptCommand extends Command
));
}
- $message = file_get_contents($file);
+ $message = trim(file_get_contents($file));
}
$this->injectOutputIntoLogger($output, $this->logger); | Added whitespace trimming when dealing with files for crypt | conductorphp_conductor-core | train | php,php |
49bf3c9012c70bf887c4933b0e915512b31a5bd2 | diff --git a/wagtailmarkdown/mdx/linkers/document.py b/wagtailmarkdown/mdx/linkers/document.py
index <HASH>..<HASH> 100644
--- a/wagtailmarkdown/mdx/linkers/document.py
+++ b/wagtailmarkdown/mdx/linkers/document.py
@@ -10,7 +10,10 @@
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
-from wagtail import wagtaildocs
+try: # wagtail < 2.0
+ from wagtail.wagtaildocs.models import Document
+except ImportError: # wagtail >= 2.0
+ from wagtail.documents.models import Document
from markdown.util import etree
@@ -22,7 +25,7 @@ class Linker(object):
if len(optstr):
text = optstr[0]
- doc = wagtaildocs.models.Document.objects.get(title=name)
+ doc = Document.objects.get(title=name)
url = doc.url
a = etree.Element('a')
a.set('href', url) | make document link valid in lastes wagtail version | torchbox_wagtail-markdown | train | py |
06a15fd62d9ae7a27b85c5063da08aac232781a4 | diff --git a/spec/unit/pdk/module/template_dir_spec.rb b/spec/unit/pdk/module/template_dir_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/pdk/module/template_dir_spec.rb
+++ b/spec/unit/pdk/module/template_dir_spec.rb
@@ -1,4 +1,3 @@
-
require 'spec_helper'
require 'yaml' | (MAINT) Resolve rubocop Layout/LeadingBlankLines | puppetlabs_pdk | train | rb |
736b1a451872a487659c8906e1fe81d33e7bf79a | diff --git a/cobra/test/flux_analysis.py b/cobra/test/flux_analysis.py
index <HASH>..<HASH> 100644
--- a/cobra/test/flux_analysis.py
+++ b/cobra/test/flux_analysis.py
@@ -160,6 +160,8 @@ class TestCobraFluxAnalysis(TestCase):
'5DGLCNt2rpp': {'minimum': 0.0, 'maximum': 0.0},
'ACALD': {'minimum': 3.35702, 'maximum': 7.49572}}
+ infeasible_model = create_test_model()
+ infeasible_model.reactions.get_by_id("EX_glyc_e").lower_bound = 0
for solver in solver_dict:
cobra_model = create_test_model()
initialize_growth_medium(cobra_model, 'LB')
@@ -168,6 +170,9 @@ class TestCobraFluxAnalysis(TestCase):
for the_reaction, the_range in iteritems(fva_out):
for k, v in iteritems(the_range):
self.assertAlmostEqual(fva_results[the_reaction][k], v, places=5)
+ # ensure that an infeasible model does not run FVA
+ self.assertRaises(ValueError, flux_variability_analysis,
+ infeasible_model, solver=solver)
# make a test suite to run all of the tests
loader = TestLoader() | add test for #<I> with fva on infeasible model | opencobra_cobrapy | train | py |
3693d606e458c3fbba01d50ec6802720703a0e9c | diff --git a/tzlocal/darwin.py b/tzlocal/darwin.py
index <HASH>..<HASH> 100644
--- a/tzlocal/darwin.py
+++ b/tzlocal/darwin.py
@@ -7,6 +7,10 @@ _cache_tz = None
def _get_localzone():
tzname = os.popen("systemsetup -gettimezone").read().replace("Time Zone: ", "").strip()
+ if not tzname or tzname not in pytz.all_timezones_set:
+ # link will be something like /usr/share/zoneinfo/America/Los_Angeles.
+ link = os.readlink("/etc/localtime")
+ tzname = link[link.rfind('/', 0, link.rfind('/'))+1:]
return pytz.timezone(tzname)
def get_localzone():
@@ -21,4 +25,4 @@ def reload_localzone():
global _cache_tz
_cache_tz = _get_localzone()
return _cache_tz
-
\ No newline at end of file
+ | Failsafe for OS X without admin privileges | regebro_tzlocal | train | py |
13665075a9d0f9a6f3c85a083994217920f0436b | diff --git a/isort/isort.py b/isort/isort.py
index <HASH>..<HASH> 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -229,6 +229,10 @@ class SortImports(object):
"""If the current line is an import line it will return its type (from or straight)"""
if "isort:skip" in line:
return
+ if ";" in line:
+ for part in (part.strip() for part in line.split(";")):
+ if part and not part.startswith("from ") and not part.startswith("import "):
+ return
elif line.startswith('import '):
return "straight"
elif line.startswith('from '): | Handle import pdb/nose common single import line use case | timothycrosley_isort | train | py |
97cc5ff4611d60daf8eec46a37c187e54e4a7f14 | diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -121,6 +121,16 @@ class Client
}
/**
+ * Return the Manager.
+ *
+ * @return Manager
+ */
+ public function getManager()
+ {
+ return $this->manager;
+ }
+
+ /**
* List databases.
*
* @see ListDatabases::__construct() for supported options
diff --git a/src/Collection.php b/src/Collection.php
index <HASH>..<HASH> 100644
--- a/src/Collection.php
+++ b/src/Collection.php
@@ -577,6 +577,16 @@ class Collection
}
/**
+ * Return the Manager.
+ *
+ * @return Manager
+ */
+ public function getManager()
+ {
+ return $this->manager;
+ }
+
+ /**
* Return the collection namespace.
*
* @see https://docs.mongodb.org/manual/reference/glossary/#term-namespace
diff --git a/src/Database.php b/src/Database.php
index <HASH>..<HASH> 100644
--- a/src/Database.php
+++ b/src/Database.php
@@ -229,6 +229,16 @@ class Database
}
/**
+ * Return the Manager.
+ *
+ * @return Manager
+ */
+ public function getManager()
+ {
+ return $this->manager;
+ }
+
+ /**
* Returns information for all collections in this database.
*
* @see ListCollections::__construct() for supported options | PHPLIB-<I>: Implement Manager accessors for core classes | mongodb_mongo-php-library | train | php,php,php |
29a92e098fcc8d71d1501727daa79ef85dfecb04 | diff --git a/util/taskcluster.py b/util/taskcluster.py
index <HASH>..<HASH> 100644
--- a/util/taskcluster.py
+++ b/util/taskcluster.py
@@ -147,7 +147,9 @@ def main():
maybe_download_tc(target_dir=args.target, tc_url=get_tc_url(args.arch, args.artifact, args.branch))
if args.artifact == "convert_graphdef_memmapped_format":
- subprocess.check_call(['chmod', '+x', os.path.join(args.target, args.artifact)])
+ convert_graph_file = os.path.join(args.target, args.artifact)
+ final_stat = os.stat(convert_graph_file)
+ os.chmod(convert_graph_file, final_stat.st_mode | stat.S_IEXEC)
if '.tar.' in args.artifact:
subprocess.check_call(['tar', 'xvf', os.path.join(args.target, args.artifact), '-C', args.target]) | Update taskcluster.py
I copied ``maybe_download_tc_bin`` syntax in order to make the code easier to follow. | mozilla_DeepSpeech | train | py |
f7d5471e581fa1c0f9e1db7d74dfbde2520eb900 | diff --git a/behaviors/YwPlugin.php b/behaviors/YwPlugin.php
index <HASH>..<HASH> 100644
--- a/behaviors/YwPlugin.php
+++ b/behaviors/YwPlugin.php
@@ -12,17 +12,36 @@ class YwPlugin extends CBehavior
{
protected $_assetsUrl;
+ protected static $_api;
+
+ /**
+ * Returns
+ * @param $path
+ * @return mixed
+ */
public function getAssetsUrl($path)
{
if (isset($this->_assetsUrl))
return $this->_assetsUrl;
else
{
- $forceCopyAssets = Yii::app()->getComponent('yiiwheels')->getCore()->forceCopyAssets;
+ $forceCopyAssets = $this->getApi()->forceCopyAssets;
$assetsUrl = Yii::app()->assetManager->publish($path, false, -1, $forceCopyAssets);
return $this->_assetsUrl = $assetsUrl;
}
}
+
+ /**
+ * @return TbApi
+ */
+ public function getApi()
+ {
+ if(self::$_api === null)
+ {
+ self::$_api = Yii::app()->getComponent('yiiwheels')->getApi();
+ }
+ return self::$_api;
+ }
}
\ No newline at end of file | added helper method to access the api | 2amigos_yiiwheels | train | php |
8f1ee7d7b2fe604ee4a3d64701454db98e94e9fe | diff --git a/js/angular.cloudinary.js b/js/angular.cloudinary.js
index <HASH>..<HASH> 100644
--- a/js/angular.cloudinary.js
+++ b/js/angular.cloudinary.js
@@ -93,16 +93,26 @@
// The linking function will add behavior to the template
link : function(scope, element, attrs) {
var attributes = {};
+ var publicId = null;
+
$.each(attrs, function(name, value){attributes[cloudinaryAttr(name)] = value});
if (scope.transformations) {
attributes.transformation = scope.transformations;
}
- attrs.$observe('publicId', function(publicId){
- if (!publicId) return;
- var url = $.cloudinary.url(publicId, attributes);
- element.attr('src', url);
+ // store public id and load image
+ attrs.$observe('publicId', function(value){
+ if (!value) return;
+ publicId = value
+ loadImage();
+ });
+
+ // observe and update version attribute
+ attrs.$observe('version', function(value){
+ if (!value) return;
+ attributes['version'] = value;
+ loadImage();
});
if (attrs.htmlWidth) {
@@ -116,6 +126,11 @@
element.removeAttr("height");
}
+ var loadImage = function() {
+ var url = $.cloudinary.url(publicId, attributes);
+ element.attr('src', url);
+ }
+
}
};
}); | Observe version attribute, reload image on change | cloudinary_cloudinary_angular | train | js |
9d488173d915e0ed1560124a23af05086ed881db | diff --git a/library/src/pivotal-ui-react/back-to-top/back-to-top.js b/library/src/pivotal-ui-react/back-to-top/back-to-top.js
index <HASH>..<HASH> 100644
--- a/library/src/pivotal-ui-react/back-to-top/back-to-top.js
+++ b/library/src/pivotal-ui-react/back-to-top/back-to-top.js
@@ -38,9 +38,10 @@ class BackToTop extends mixin(React.Component).with(Animation) {
};
render() {
+ const {alwaysVisible, ...others} = this.props;
var {visible: visibleState} = this.state;
- var visible = this.props.alwaysVisible || visibleState;
- var props = mergeProps(this.props,
+ var visible = alwaysVisible || visibleState;
+ var props = mergeProps(others,
{
className: 'back-to-top',
style: {display: 'inline', opacity: this.animate('opacity', visible ? 1 : 0, BackToTop.FADE_DURATION)} | Fix(React): Fix React validation warning in back-to-top component
[#<I>] | pivotal-cf_pivotal-ui | train | js |
2e0a8cbf588dcfe4ac900ee8d1ad0c762133d2cd | diff --git a/resources/views/multilingual/input-hidden-bread-edit-add.blade.php b/resources/views/multilingual/input-hidden-bread-edit-add.blade.php
index <HASH>..<HASH> 100644
--- a/resources/views/multilingual/input-hidden-bread-edit-add.blade.php
+++ b/resources/views/multilingual/input-hidden-bread-edit-add.blade.php
@@ -4,5 +4,9 @@
data-i18n="true"
name="{{ $row->field }}_i18n"
id="{{ $row->field }}_i18n"
- value="{{ get_field_translations($dataTypeContent, $row->field) }}">
+ @if(!empty(session()->getOldInput($row->field.'_i18n') && is_null($dataTypeContent->id)))
+ value="{{ session()->getOldInput($row->field.'_i18n') }}"
+ @else
+ value="{{ get_field_translations($dataTypeContent, $row->field) }}"
+ @endif>
@endif | Retain old values of input during Add. (#<I>)
Previously old values of multilingual input fields will not be "saved" during add if there are errors in the message bag. This changes will return the old values of multilingual input fields. | the-control-group_voyager | train | php |
a3c9ce3a8c1a406376deecc38429d4df169fc6e3 | diff --git a/tests/Collection/BoolTypeTest.php b/tests/Collection/BoolTypeTest.php
index <HASH>..<HASH> 100644
--- a/tests/Collection/BoolTypeTest.php
+++ b/tests/Collection/BoolTypeTest.php
@@ -16,8 +16,6 @@ final class BoolTypeTest extends TestCase
{
$set = new BoolCollection([true, true, false, false]);
- $a = $set->toArray();
-
static::assertSame(
[true, true, false, false],
$set->toArray() | [-]: clean-up a phpstorm generics test
... currently it's not working as expected :/ | voku_Arrayy | train | php |
37c5b6ecb976f2db603d110fc83dd02dd636ecf3 | diff --git a/bcbio/ngsalign/bwa.py b/bcbio/ngsalign/bwa.py
index <HASH>..<HASH> 100644
--- a/bcbio/ngsalign/bwa.py
+++ b/bcbio/ngsalign/bwa.py
@@ -62,7 +62,9 @@ def _get_bwa_mem_cmd(data, out_file, ref_file, fastq1, fastq2=""):
alt_file = ref_file + ".alt"
if utils.file_exists(alt_file):
bwakit_dir = os.path.dirname(os.path.realpath(utils.which("run-bwamem")))
- alt_cmd = (" | {bwakit_dir}/k8 {bwakit_dir}/bwa-postalt.js -p {out_file}.hla {alt_file}")
+ hla_base = os.path.join(utils.safe_makedir(os.path.join(os.path.dirname(out_file), "hla")),
+ os.path.basename(out_file) + ".hla")
+ alt_cmd = (" | {bwakit_dir}/k8 {bwakit_dir}/bwa-postalt.js -p {hla_base} {alt_file}")
else:
alt_cmd = ""
bwa = config_utils.get_program("bwa", data["config"]) | Place HLA outputs from hg<I> into separate alignment subdirectory | bcbio_bcbio-nextgen | train | py |
86b9f3f37264f18d537cee645c2de085b566a733 | diff --git a/test/express.js b/test/express.js
index <HASH>..<HASH> 100644
--- a/test/express.js
+++ b/test/express.js
@@ -156,6 +156,27 @@ describe('monoxide.express.*', function() {
});
});
+ it('should query widgets via ReST ($nin + array notation)', function(finish) {
+ superagent.get(url + '/api/widgets')
+ .query({
+ select: '_id,color',
+ color: {$nin: ['red']},
+ sort: 'color',
+ })
+ .end(function(err, res) {
+ expect(err).to.be.not.ok;
+
+ var widgets = res.body;
+ expect(widgets).to.be.an.array;
+ expect(widgets).to.have.length(2);
+
+ expect(widgets[0]).to.have.property('color', 'blue');
+ expect(widgets[1]).to.have.property('color', 'blue');
+
+ finish();
+ });
+ });
+
it('should query groups via ReST', function(finish) {
superagent.get(url + '/api/groups')
.query({ | Added ReST + $nin test | hash-bang_Monoxide | train | js |
7418dd3fbff7e612b167664a915dedb266e33ad3 | diff --git a/src/Rcm/Controller/StateApiController.php b/src/Rcm/Controller/StateApiController.php
index <HASH>..<HASH> 100644
--- a/src/Rcm/Controller/StateApiController.php
+++ b/src/Rcm/Controller/StateApiController.php
@@ -17,7 +17,11 @@ class StateApiController extends EntityMgrAwareController
$states=array();
foreach($stateEntities as $state){
- $states[$state->getState()]=$state->getName();
+ $name=$state->getName();
+ if(empty($name)){
+ $name=$state->getState();
+ }
+ $states[$state->getState()]=$name;
}
if (!count($states)) { | make code put state NAMES in selector if they exist | reliv_Rcm | train | php |
8fa565230d9d8304b45fd4695b64477c8a52478d | diff --git a/power/__init__.py b/power/__init__.py
index <HASH>..<HASH> 100644
--- a/power/__init__.py
+++ b/power/__init__.py
@@ -27,6 +27,8 @@ from power.common import *
try:
if platform.startswith('darwin'):
from power.darwin import PowerManagement
+ elif platform.startswith('freebsd'):
+ from power.freebsd import PowerManagement
elif platform.startswith('win32'):
from power.win32 import PowerManagement
elif platform.startswith('linux'): | Added PowerManagement load for FreeBSD platform. | Kentzo_Power | train | py |
6b8f5ae3d03997376616de96403ff118b056f6c6 | diff --git a/sunspot_rails/lib/sunspot_rails.rb b/sunspot_rails/lib/sunspot_rails.rb
index <HASH>..<HASH> 100644
--- a/sunspot_rails/lib/sunspot_rails.rb
+++ b/sunspot_rails/lib/sunspot_rails.rb
@@ -1,7 +1,11 @@
# This needs to be loaded before sunspot/search/paginated_collection
# or #to_json gets defined in Object breaking delegation to Array via
# method_missing
-require 'active_support/core_ext/object/to_json'
+if Rails::VERSION::MAJOR >= 4 && Rails::VERSION::MINOR >= 1
+ require 'active_support/core_ext/object/json'
+else
+ require 'active_support/core_ext/object/to_json'
+end
require 'sunspot/rails'
require 'sunspot/rails/railtie' | ActiveSupport JSON support file name changes in Rails <I> | sunspot_sunspot | train | rb |
0b449fda7d993575cc141a2d822721fde4fcb0a4 | diff --git a/pkg/server/fsm.go b/pkg/server/fsm.go
index <HASH>..<HASH> 100644
--- a/pkg/server/fsm.go
+++ b/pkg/server/fsm.go
@@ -1019,6 +1019,13 @@ func (h *fsmHandler) recvMessageWithError() (*fsmMsg, error) {
case bgp.BGP_MSG_ROUTE_REFRESH:
fmsg.MsgType = fsmMsgRouteRefresh
case bgp.BGP_MSG_UPDATE:
+ // if the length of h.holdTimerResetCh
+ // isn't zero, the timer will be reset
+ // soon anyway.
+ select {
+ case h.holdTimerResetCh <- true:
+ default:
+ }
body := m.Body.(*bgp.BGPUpdate)
isEBGP := h.fsm.pConf.IsEBGPPeer(h.fsm.gConf)
isConfed := h.fsm.pConf.IsConfederationMember(h.fsm.gConf) | Update the hold timer when a BGP Update message is received
According to RFC<I>,
The calculated value indicates the maximum number of
seconds that may elapse between the receipt of successive
KEEPALIVE and/or UPDATE messages from the sender.
This change will reset the hold timer in the update FSM case.
(note, I am super new with Go. I'm not quite sure how to craft a good test case for this.) | osrg_gobgp | train | go |
8aaa9d57be84009ccaae8fd94a30f1c4233c37da | diff --git a/grade/report/user/index.php b/grade/report/user/index.php
index <HASH>..<HASH> 100644
--- a/grade/report/user/index.php
+++ b/grade/report/user/index.php
@@ -88,9 +88,6 @@ if ($access) {
// Create a report instance
$report = new grade_report_user($courseid, $gpr, $context, $userid);
- $gradetotal = 0;
- $gradesum = 0;
-
// print the page
print_heading(get_string('modulename', 'gradereport_user'). ' - '.fullname($report->user)); | MDL-<I> minor cleanup | moodle_moodle | train | php |
d5e4753f6338efcefd2688b4db44834015b6f1f6 | diff --git a/python/dllib/test/dev/diff.py b/python/dllib/test/dev/diff.py
index <HASH>..<HASH> 100755
--- a/python/dllib/test/dev/diff.py
+++ b/python/dllib/test/dev/diff.py
@@ -32,7 +32,7 @@ def extract_scala_class(class_path):
"SplitAndSelect", "StrideSlice", "Scheduler",
"StaticGraph", "DynamicGraph", "DynamicContainer",
"SplitHeads", "CombineHeads", "VectorProduct", "Pooler",
- "MaskHead", "MaskPostProcessor"]) # noqa
+ "MaskHead", "MaskPostProcessor", "BoxHead", "BoxPostProcessor"]) # noqa
include_key_words = set(["Module", "Criterion", "Container", "Cell", "TensorNumeric"]) # noqa
content = "\n".join([line for line in open(class_path).readlines() if all([key not in line for key in exclude_key_words])]) # noqa
match = re.search(r"class ([\w]+)[^{]+", content) | [New feature] Add Boxhead (#<I>)
* add boxhead
* add SerialTest
* meet pr comments | intel-analytics_BigDL | train | py |
206b47842fb32d89b1b947aee1e1450156177fe3 | diff --git a/app/controllers/rubygems_controller.rb b/app/controllers/rubygems_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/rubygems_controller.rb
+++ b/app/controllers/rubygems_controller.rb
@@ -8,7 +8,7 @@ class RubygemsController < ApplicationController
respond_to do |format|
format.html do
@letter = Rubygem.letterize(params[:letter])
- @gems = Rubygem.letter(@letter).paginate(page: @page)
+ @gems = Rubygem.letter(@letter).by_downloads.paginate(page: @page)
end
format.atom do
@versions = Version.published(20) | Gems page order by downloads count. | rubygems_rubygems.org | train | rb |
e1cda224752b2df9bda84d3485d13cd7910d27bc | diff --git a/src/js/select2/selection/single.js b/src/js/select2/selection/single.js
index <HASH>..<HASH> 100644
--- a/src/js/select2/selection/single.js
+++ b/src/js/select2/selection/single.js
@@ -16,7 +16,7 @@ define([
$selection.addClass('select2-selection--single');
$selection.html(
- '<span class="select2-selection__rendered"></span>' +
+ '<span class="select2-selection__rendered" role="textbox" aria-readonly="true"></span>' +
'<span class="select2-selection__arrow" role="presentation">' +
'<b role="presentation"></b>' +
'</span>' | Add role and aria-readonly attributes to single selection dropdown selected value | select2_select2 | train | js |
1cefa8865efead46ef2cdb8a9b17b813a1372690 | diff --git a/spec/ImageDiffSpec.js b/spec/ImageDiffSpec.js
index <HASH>..<HASH> 100644
--- a/spec/ImageDiffSpec.js
+++ b/spec/ImageDiffSpec.js
@@ -146,28 +146,22 @@ describe('ImageUtils', function() {
});
});
- it('should convert Image to ImageData', function () {
-
- var
- result;
-
+ beforeAll(function (done) {
image.src = 'images/checkmark.png';
- waitsFor(function () {
- return image.complete;
- }, 'image not loaded.', 1000);
-
- runs(function () {
- var
- canvas = imagediff.createCanvas(image.width, image.height),
- context = canvas.getContext('2d');
-
- context.drawImage(image, 0, 0);
- imageData = context.getImageData(0, 0, image.width, image.height);
+ while (!image.complete) {}
+ done();
+ });
+ it('should convert Image to ImageData', function () {
+ var
+ canvas = imagediff.createCanvas(image.width, image.height),
+ context = canvas.getContext('2d'),
result = imagediff.toImageData(image);
- expect(result).toBeImageData();
- expect(result).toImageDiffEqual(imageData);
- });
+
+ context.drawImage(image, 0, 0);
+ imageData = context.getImageData(0, 0, image.width, image.height);
+ expect(result).toBeImageData();
+ expect(result).toImageDiffEqual(imageData);
});
it('should convert Canvas to ImageData', function () { | Fix async image loading in Conversion suite. | HumbleSoftware_js-imagediff | train | js |
3ccfd2e9e1ab3b3f01454ac97790ccdffa78f3c2 | diff --git a/spec/sneakers/publisher_spec.rb b/spec/sneakers/publisher_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/sneakers/publisher_spec.rb
+++ b/spec/sneakers/publisher_spec.rb
@@ -3,6 +3,11 @@ require 'sneakers'
describe Sneakers::Publisher do
describe '#publish' do
+ before do
+ Sneakers.clear!
+ Sneakers.configure(:log => 'sneakers.log')
+ end
+
it 'should publish a message to an exchange' do
xchg = Object.new
mock(xchg).publish('test msg', routing_key: 'downloads') | Spec publishers: explicitly log to a file | jondot_sneakers | train | rb |
b99c73351229cd808bf3d0ee1bf10ab45267e559 | diff --git a/lib/Saml2/Settings.php b/lib/Saml2/Settings.php
index <HASH>..<HASH> 100644
--- a/lib/Saml2/Settings.php
+++ b/lib/Saml2/Settings.php
@@ -88,7 +88,7 @@ class OneLogin_Saml2_Settings
/**
* Setting errors.
*
- * @var array
+ * @var bool
*/
private $_spValidationOnly = false;
@@ -98,6 +98,7 @@ class OneLogin_Saml2_Settings
* - Loads settings info from settings file or array/object provided
*
* @param array|object|null $settings SAML Toolkit Settings
+ * @param bool $spValidationOnly
*
* @throws OneLogin_Saml2_Error If any settings parameter is invalid
* @throws Exception If OneLogin_Saml2_Settings is incorrectly supplied | $spValidationOnly is a boolean and not an array | onelogin_php-saml | train | php |
3f6cbe92db6245edaf6e0221d6144a889c7d6f4c | diff --git a/client/extensions/woocommerce/store-sidebar/store-ground-control.js b/client/extensions/woocommerce/store-sidebar/store-ground-control.js
index <HASH>..<HASH> 100644
--- a/client/extensions/woocommerce/store-sidebar/store-ground-control.js
+++ b/client/extensions/woocommerce/store-sidebar/store-ground-control.js
@@ -26,9 +26,9 @@ const StoreGroundControl = ( { site, translate } ) => {
className="store-sidebar__ground-control-back"
disabled={ isPlaceholder }
href={ backLink }
- aria-label={ translate( 'Go back' ) }
+ aria-label={ translate( 'Close Store' ) }
>
- <Gridicon icon="chevron-left" />
+ <Gridicon icon="cross" />
</Button>
<div className="store-sidebar__ground-control-site">
<Site site={ site } indicator={ false } homeLink externalLink /> | Change sidebar back from chevron to cross. (#<I>) | Automattic_wp-calypso | train | js |
5f7629bb8b7d4dc853134a3d831ab4d4d411780a | diff --git a/core/src/main/java/hudson/tasks/LogRotator.java b/core/src/main/java/hudson/tasks/LogRotator.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/tasks/LogRotator.java
+++ b/core/src/main/java/hudson/tasks/LogRotator.java
@@ -187,6 +187,10 @@ public class LogRotator extends BuildDiscarder {
LOGGER.log(FINER, "{0} is not to be removed or purged of artifacts because it’s the last stable build", r);
return true;
}
+ if (r.isBuilding()) {
+ LOGGER.log(FINER, "{0} is not to be removed or purged of artifacts because it’s still building", r);
+ return true;
+ }
return false;
} | prevent removing artifact when build isn’t completed yet | jenkinsci_jenkins | train | java |
f3b040a92a041530d5375255d76ad3e76f67222e | diff --git a/tests/cases/core/LibrariesTest.php b/tests/cases/core/LibrariesTest.php
index <HASH>..<HASH> 100644
--- a/tests/cases/core/LibrariesTest.php
+++ b/tests/cases/core/LibrariesTest.php
@@ -87,10 +87,12 @@ class LibrariesTest extends \lithium\test\Unit {
$all = Libraries::find('lithium', array('recursive' => true));
$result = array_values(preg_grep('/^lithium\\\\tests\\\\cases\\\\/', $all));
$this->assertIdentical($tests, $result);
-
- $tests = Libraries::find('app', array('recursive' => true, 'path' => '/tests/cases'));
- $result = preg_grep('/^app\\\\tests\\\\cases\\\\/', $tests);
- $this->assertIdentical($tests, $result);
+
+ if ($this->hasApp) {
+ $tests = Libraries::find('app', array('recursive' => true, 'path' => '/tests/cases'));
+ $result = preg_grep('/^app\\\\tests\\\\cases\\\\/', $tests);
+ $this->assertIdentical($tests, $result);
+ }
}
/** | Fixing a thrown exception in testPathFiltering, because the missing app folder | UnionOfRAD_lithium | train | php |
0843b9499668d2a8e4c7c34fc78475c4fefbdf58 | diff --git a/xtuml/__init__.py b/xtuml/__init__.py
index <HASH>..<HASH> 100644
--- a/xtuml/__init__.py
+++ b/xtuml/__init__.py
@@ -16,6 +16,7 @@ from .persist import serialize_class
from .persist import serialize_instances
from .persist import serialize_instance
+from .model import Association
from .model import AssociationLink
from .model import SingleAssociationLink
from .model import ManyAssociationLink | xtuml: expose association class defintion to xtuml package | xtuml_pyxtuml | train | py |
36477f3dd3195dd117a5da7e5ed4d7bb169541b0 | diff --git a/shared/actions/wallets.js b/shared/actions/wallets.js
index <HASH>..<HASH> 100644
--- a/shared/actions/wallets.js
+++ b/shared/actions/wallets.js
@@ -506,7 +506,7 @@ const changeDisplayCurrency = (state, action) =>
currency: action.payload.code, // called currency, though it is a code
},
Constants.changeDisplayCurrencyWaitingKey
- )
+ ).then(_ => WalletsGen.createLoadDisplayCurrency({accountID: action.payload.accountID}))
const changeAccountName = (state, action) =>
RPCStellarTypes.localChangeWalletAccountNameLocalRpcPromise( | Fix showing new display currency after a change (#<I>) | keybase_client | train | js |
65c13f2af5ec3b66c525fea52c0e1bbe3c9c4ee7 | diff --git a/lib/rango/controller.rb b/lib/rango/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/rango/controller.rb
+++ b/lib/rango/controller.rb
@@ -95,7 +95,9 @@ module Rango
if (300..399).include?(status)
exception = Redirection.new(absolute_uri(location))
exception.status = status
- exception.headers["Set-Cookie"] = response["Set-Cookie"] # otherwise it don't save cookies
+ if response["Set-Cookie"]
+ exception.headers["Set-Cookie"] = response["Set-Cookie"] # otherwise it don't save cookies
+ end
block.call(exception) unless block.nil?
raise exception
else | Do not set cookies if there aren't any | botanicus_rango | train | rb |
27eefb21d96778cbd509c3194c640767e262ac35 | diff --git a/go/systests/home_test.go b/go/systests/home_test.go
index <HASH>..<HASH> 100644
--- a/go/systests/home_test.go
+++ b/go/systests/home_test.go
@@ -146,7 +146,6 @@ func pollForTrue(t *testing.T, g *libkb.GlobalContext, poller func(i int) bool)
}
func TestHome(t *testing.T) {
- t.Skip()
tt := newTeamTester(t)
defer tt.cleanup() | unskip test (#<I>) | keybase_client | train | go |
14deb3da438b33a2857e24bedc83839549560c5a | diff --git a/lib/meme_captain/server.rb b/lib/meme_captain/server.rb
index <HASH>..<HASH> 100644
--- a/lib/meme_captain/server.rb
+++ b/lib/meme_captain/server.rb
@@ -42,7 +42,10 @@ module MemeCaptain
meme_img.to_blob {
self.quality = 100
- self.format = 'PNG' if current_format == 'GIF'
+ # convert non-animated gifs to png
+ if current_format == 'GIF' and meme_img.size == 1
+ self.format = 'PNG'
+ end
}
} | convert only non-animated gifs to png | mmb_meme_captain | train | rb |
3ff1cfb8dcc52e6532936c8726dd3e50c3f2856a | diff --git a/lib/config/index.js b/lib/config/index.js
index <HASH>..<HASH> 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -2,5 +2,6 @@
module.exports = {
'0-8-recommended': require('./0-8-recommended'),
+ octane: require('./octane'),
recommended: require('./recommended'),
}; | Add 'octane' config to export list so it can be found (fixes #<I>) | ember-template-lint_ember-template-lint | train | js |
b2a4edb8541c7bc7e2ad08c20a7814e66c766ecf | diff --git a/src/main/java/org/minimalj/application/Application.java b/src/main/java/org/minimalj/application/Application.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/minimalj/application/Application.java
+++ b/src/main/java/org/minimalj/application/Application.java
@@ -245,7 +245,7 @@ public abstract class Application {
} else if (Application.class.getName().equals(mainClass)) {
logger.severe("and starting the Application class doesn't work at all. Nothing started.");
} else {
- Swing.main(mainClass);
+ NanoWebServer.main(mainClass);
}
} | Application: start web server by default (not swing) | BrunoEberhard_minimal-j | train | java |
53dca59e6ce82b682b2ebe70f22d9b324a62c21f | diff --git a/alphalens/utils.py b/alphalens/utils.py
index <HASH>..<HASH> 100644
--- a/alphalens/utils.py
+++ b/alphalens/utils.py
@@ -200,7 +200,8 @@ def compute_forward_returns(factor_idx,
# if the period length is not consistent across the factor index then
# it must be a trading/business day calendar
#
- time_diffs = delta.index.to_series().diff(period)
+ time_diffs = prices.index.to_series().diff(period)
+ time_diffs = time_diffs.reindex(factor_idx)
if time_diffs.min() != time_diffs.max():
custom_calendar = True | BUG: fix regression introduced event study | quantopian_alphalens | train | py |
eafb4d197b722d33789fd4dcea66dd9a31b9f6f7 | diff --git a/bridgesupport.js b/bridgesupport.js
index <HASH>..<HASH> 100644
--- a/bridgesupport.js
+++ b/bridgesupport.js
@@ -20,19 +20,30 @@ var fs = require('fs')
/**
- * Architecture-specific function that returns the Obj-C type from one of
- * these BridgeSupport XML nodes.
+ * Architecture-specific functions that return the Obj-C type or value from one
+ * of these BridgeSupport XML nodes.
*/
-var getType;
-if (process.arch == 'x64')
+var getType
+ , getValue
+if (process.arch == 'x64') {
+ // 64-bit specific functions
getType = function (node) {
- var a = node.attributes;
- return a.type64 || a.type;
+ var a = node.attributes
+ return a.type64 || a.type
}
-else
+ getValue = function (node) {
+ var a = node.attributes
+ return a.value64 || a.value
+ }
+} else {
+ // 32-bit / ARM specific functions
getType = function (node) {
- return node.attributes.type;
+ return node.attributes.type
+ }
+ getValue = function (node) {
+ return node.attributes.value
}
+}
/**
* Attempts to retrieve the BridgeSupport files for the given framework. | Add a 'getValue()' function in the bridgesupport module. It has a <I>-bit variant. | TooTallNate_NodObjC | train | js |
cf00548d89b4c5652f18d370dab158da50d12740 | diff --git a/src/com/google/javascript/jscomp/ConvertToTypedInterface.java b/src/com/google/javascript/jscomp/ConvertToTypedInterface.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/ConvertToTypedInterface.java
+++ b/src/com/google/javascript/jscomp/ConvertToTypedInterface.java
@@ -557,7 +557,9 @@ class ConvertToTypedInterface implements CompilerPass {
Preconditions.checkArgument(nameNode.isQualifiedName());
JSType type = nameNode.getJSType();
if (type == null) {
- compiler.report(JSError.make(nameNode, CONSTANT_WITHOUT_EXPLICIT_TYPE));
+ if (!nameNode.isFromExterns()) {
+ compiler.report(JSError.make(nameNode, CONSTANT_WITHOUT_EXPLICIT_TYPE));
+ }
return getConstJSDoc(oldJSDoc, new Node(Token.STAR));
} else {
return getConstJSDoc(oldJSDoc, type.toNonNullAnnotationString()); | Don't warn about @const inference in externs.
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
61906dc332b526538269c42ca0b40898d718985a | diff --git a/tests/acceptance/seller/ClientSidebarMenuCest.php b/tests/acceptance/seller/ClientSidebarMenuCest.php
index <HASH>..<HASH> 100644
--- a/tests/acceptance/seller/ClientSidebarMenuCest.php
+++ b/tests/acceptance/seller/ClientSidebarMenuCest.php
@@ -21,7 +21,6 @@ class ClientSidebarMenuCest
'Clients' => '@client/index',
'Contacts' => '@contact/index',
'Documents' => '@document/index',
- 'Mailing preparation' => '/mailing/prepare/index',
]);
}
} | tests: deleted Mailing Preferences button (#<I>) | hiqdev_hipanel-module-client | train | php |
076d91b48f1c632999e93af585a10546994c2711 | diff --git a/modelx/serialize/__init__.py b/modelx/serialize/__init__.py
index <HASH>..<HASH> 100644
--- a/modelx/serialize/__init__.py
+++ b/modelx/serialize/__init__.py
@@ -38,7 +38,7 @@ def _get_model_serializer(model_path):
except FileNotFoundError:
return _get_serializer(1)
- return _get_serializer(params["version"])
+ return _get_serializer(params["serializer_version"])
def write_model(model, model_path, backup=True, version=None):
@@ -91,7 +91,7 @@ def write_model(model, model_path, backup=True, version=None):
_increment_backups(path, max_backups)
path.mkdir()
with open(path / "_system.json", "w", encoding="utf-8") as f:
- json.dump({"version": version}, f)
+ json.dump({"serializer_version": version}, f)
serializer = _get_serializer(version) | FAC: Rename version to serializer_version | fumitoh_modelx | train | py |
4fb3efa2af86bada7bfc1f06bf4b85d95a31112c | diff --git a/lib/Doctrine/DBAL/Schema/Table.php b/lib/Doctrine/DBAL/Schema/Table.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/DBAL/Schema/Table.php
+++ b/lib/Doctrine/DBAL/Schema/Table.php
@@ -331,7 +331,7 @@ class Table extends AbstractAsset
* @param string $oldColumnName
* @param string $newColumnName
*
- * @return self
+ * @deprecated
*
* @throws DBALException
*/ | Fix return type and mark as deprecated for Table::renameColumn | doctrine_dbal | train | php |
75d20f48675547e6d8a5e265d99e82b7ef3efa6d | diff --git a/pysnmp/entity/config.py b/pysnmp/entity/config.py
index <HASH>..<HASH> 100644
--- a/pysnmp/entity/config.py
+++ b/pysnmp/entity/config.py
@@ -113,7 +113,9 @@ def __cookV3UserInfo(snmpEngine, securityName, securityEngineId):
def addV3User(snmpEngine, securityName,
authProtocol=usmNoAuthProtocol, authKey=None,
privProtocol=usmNoPrivProtocol, privKey=None,
- contextEngineId=None, securityEngineId=None):
+ securityEngineId=None,
+ # deprecated parameters follow
+ contextEngineId=None):
if securityEngineId is None: # backward compatibility
securityEngineId = contextEngineId
( snmpEngineID, usmUserEntry, tblIdx1,
@@ -181,8 +183,11 @@ def addV3User(snmpEngine, securityName,
(pysnmpUsmSecretEntry.name + (3,) + tblIdx2, privKey),)
)
-def delV3User(snmpEngine, securityName, contextEngineId=None,
- securityEngineId=None):
+def delV3User(snmpEngine,
+ securityName,
+ securityEngineId=None,
+ # deprecated parameters follow
+ contextEngineId=None):
if securityEngineId is None: # backward compatibility
securityEngineId = contextEngineId
( snmpEngineID, usmUserEntry, tblIdx1, | replace contextEngineId with securityEngineId as addV3User() | etingof_pysnmp | train | py |
cf5760c8e91b9deebcf7abc6d35450f396300530 | diff --git a/src/jspdf.js b/src/jspdf.js
index <HASH>..<HASH> 100644
--- a/src/jspdf.js
+++ b/src/jspdf.js
@@ -2445,7 +2445,7 @@ var jsPDF = (function (global) {
* @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page.
* @param {Object} [options] - Collection of settings signaling how the text must be encoded.
* @param {string} [options.align=left] - The alignment of the text, possible values: left, center, right, justify.
- * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle.
+ * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle, hanging
* @param {string} [options.angle=0] - Rotate the text clockwise or counterclockwise. Expects the angle in degree.
* @param {string} [options.rotationDirection=1] - Direction of the rotation. 0 = clockwise, 1 = counterclockwise.
* @param {string} [options.charSpace=0] - The space between each letter. | Update jspdf.js (#<I>) | MrRio_jsPDF | train | js |
5162e311a1f0357cc1610b1ad600e4f828676d0c | diff --git a/src/js/form-builder.js b/src/js/form-builder.js
index <HASH>..<HASH> 100644
--- a/src/js/form-builder.js
+++ b/src/js/form-builder.js
@@ -394,6 +394,7 @@
opacity: 0.9,
connectWith: $sortableFields,
cursor: 'move',
+ scroll: false,
placeholder: 'ui-state-highlight',
start: _helpers.startMoving,
stop: _helpers.stopMoving, | Disable scroll on ControlBox fields (#<I>)
When creating really long forms (<I>-<I> fields) the drag event from the ControlBox auto scrolls to the bottom. This makes it impossible to drop fields into the middle of a form. Simple fix, minimal impact. | kevinchappell_formBuilder | train | js |
c8e7b5f3283461e6e24187fd17c22a08e44b171e | diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js
index <HASH>..<HASH> 100644
--- a/guacamole/src/main/webapp/scripts/client-ui.js
+++ b/guacamole/src/main/webapp/scripts/client-ui.js
@@ -1171,13 +1171,6 @@ GuacUI.Client.connect = function() {
var optimal_width = window.innerWidth * pixel_density;
var optimal_height = window.innerHeight * pixel_density;
- // Scale width/height to be at least 600x600
- if (optimal_width < 600 || optimal_height < 600) {
- var scale = Math.max(600 / optimal_width, 600 / optimal_height);
- optimal_width = optimal_width * scale;
- optimal_height = optimal_height * scale;
- }
-
// Get entire query string, and pass to connect().
// Normally, only the "id" parameter is required, but
// all parameters should be preserved and passed on for | GUAC-<I>: Just send actual dimensions as the optimal size. Do not force <I>x<I>. | glyptodon_guacamole-client | train | js |
e7c8571e68c5429f12b9291332805064dd15f606 | diff --git a/tests/index_test.js b/tests/index_test.js
index <HASH>..<HASH> 100644
--- a/tests/index_test.js
+++ b/tests/index_test.js
@@ -43,9 +43,6 @@
},
'Getting a default value in a script': function(test) {
process.env['tangle_config'] = configFile;
- console.log('---------configfile');
- console.log(configFile);
- console.log('---------configfile');
test.expect(1);
test.equals('default_value', config.getConf().get('test:get_default_value'));
return test.done(); | Removes erroneous logging | tanglejs_config | train | js |
6152b17993955c457e323e3d4e625d45d22d5b4b | diff --git a/ccbridge/stager_test.go b/ccbridge/stager_test.go
index <HASH>..<HASH> 100644
--- a/ccbridge/stager_test.go
+++ b/ccbridge/stager_test.go
@@ -91,7 +91,7 @@ EOF
cell = ginkgomon.Invoke(grouper.NewParallel(os.Kill, grouper.Members{
{"exec", componentMaker.Executor("-memoryMB=1024")},
- {"rep", componentMaker.Rep("-heartbeatRetryInterval", "10s")},
+ {"rep", componentMaker.Rep()},
}))
brain = ginkgomon.Invoke(grouper.NewParallel(os.Kill, grouper.Members{ | Use the default retry
- Now that we race consul, its important we retry every 1s | cloudfoundry_inigo | train | go |
747c9483e224fed7e37bf75358a4cd1f19e7e780 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -113,7 +113,7 @@ module.exports = function (zoteroData) {
update(cslObject, getCreators(val, typeMap));
break;
case 'date':
- cslObject.issued = { raw: val };
+ if (val) cslObject.issued = { raw: val };
break;
default:
field = getCSLField(key, typeMap); | Only add date to converted CSL object if it's present | editorsnotes_zotero-to-csl | train | js |
42dd2f2ee8dad155ec566fe8405980dea7b2196f | diff --git a/tests/Composer/Test/Util/ErrorHandlerTest.php b/tests/Composer/Test/Util/ErrorHandlerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Composer/Test/Util/ErrorHandlerTest.php
+++ b/tests/Composer/Test/Util/ErrorHandlerTest.php
@@ -38,7 +38,7 @@ class ErrorHandlerTest extends TestCase
*/
public function testErrorHandlerCaptureWarning()
{
- $this->setExpectedException('\ErrorException', 'array_merge(): Argument #2 is not an array');
+ $this->setExpectedException('\ErrorException', 'array_merge');
ErrorHandler::register(); | Check only part of the error message as it's different in hhvm | mothership-ec_composer | train | php |
76b985e60e0ee7a3016b26a3e00288b65894fb82 | diff --git a/packages/bonde-styleguide/src/cards/Panel/Panel.js b/packages/bonde-styleguide/src/cards/Panel/Panel.js
index <HASH>..<HASH> 100644
--- a/packages/bonde-styleguide/src/cards/Panel/Panel.js
+++ b/packages/bonde-styleguide/src/cards/Panel/Panel.js
@@ -67,7 +67,7 @@ const Panel = ({
<Card title={sectionTitle} minHeight={minHeight}>
<Image src={image} height={185} />
<Flexbox padding={{ x: 16, y: 14 }}>
- <Title.H3>{title}</Title.H3>
+ <Title.H4>{title}</Title.H4>
<Text fontSize={16} lineHeight={1.31} color={textColor} margin={{ y: 8 }}>
{description}
</Text> | chore(styleguide): adjust panel title to h4 | nossas_bonde-client | train | js |
70d41ffbaf9c905e8d41d24fcdf8231a31f01359 | diff --git a/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java b/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java
index <HASH>..<HASH> 100755
--- a/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java
+++ b/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedStorage.java
@@ -1028,7 +1028,7 @@ public class ODistributedStorage implements OStorage, OFreezableStorage, OAutosh
if (previousContent.getResult() == null)
// DELETED
- throw new OTransactionException("Cannot update record '" + rid + "' because has been deleted");
+ throw new ORecordNotFoundException("Cannot update record '" + rid + "' because has been deleted");
final ORecordVersion v = executionModeSynch ? record.getRecordVersion() : record.getRecordVersion().copy(); | Use a more accurate exception when a distributed record couldn't be updated because it has been deleted, so clients can react accordingly | orientechnologies_orientdb | train | java |
5a519c2348d3e47505f5c1723a2b3ad0cd876b92 | diff --git a/src/TestSuite/ComponentTestCase.php b/src/TestSuite/ComponentTestCase.php
index <HASH>..<HASH> 100644
--- a/src/TestSuite/ComponentTestCase.php
+++ b/src/TestSuite/ComponentTestCase.php
@@ -30,16 +30,23 @@ abstract class ComponentTestCase extends TestCase
protected $Component;
/**
+ * If `true`, a mock instance of the shell will be created
+ * @var bool
+ */
+ protected $autoInitializeClass = true;
+
+ /**
* Called before every test method
* @return void
* @uses $Component
+ * @uses $autoInitializeClass
*/
public function setUp()
{
parent::setUp();
//Tries to retrieve the component
- if (!$this->Component) {
+ if (!$this->Component && $this->autoInitializeClass) {
$this->Component = $this->getMockForComponent($this->getOriginClassName($this), null);
}
} | added `$autoInitializeClass` property | mirko-pagliai_me-tools | train | php |
51cf2e8a8650f529cd9ba5bbb09bac5ce100670e | diff --git a/lib/savon/element.rb b/lib/savon/element.rb
index <HASH>..<HASH> 100644
--- a/lib/savon/element.rb
+++ b/lib/savon/element.rb
@@ -10,12 +10,12 @@ class Savon
attr_accessor :parent, :name, :namespace, :form
- # Public: Whether this is element is a simple type.
+ # Public: Whether this element is a simple type.
def simple_type?
!!base_type
end
- # Public: Whether this is element is a complex type.
+ # Public: Whether this element is a complex type.
def complex_type?
!simple_type?
end | fixed typos in tomdoc [ci skip] | savonrb_savon | train | rb |
1d5b6fe7c78c8d069049fd2c9abc316b15781852 | diff --git a/seamless-immutable.development.js b/seamless-immutable.development.js
index <HASH>..<HASH> 100644
--- a/seamless-immutable.development.js
+++ b/seamless-immutable.development.js
@@ -203,7 +203,7 @@
*
* @param {array} keysToRemove - A list of strings representing the keys to exclude in the return value. Instead of providing a single array, this method can also be called by passing multiple strings as separate arguments.
*/
- function without(keysToRemove) {
+ function without(remove) {
// Calling .without() with no arguments is a no-op. Don't bother cloning.
if (arguments.length === 0) {
return this; | fixup! Don't bother making a separate variable for remove. | rtfeldman_seamless-immutable | train | js |
4a17ea95444eae0aae62ae3fa0c7c27cb5009cd1 | diff --git a/lib/probe_dock_rspec/meta_parser.rb b/lib/probe_dock_rspec/meta_parser.rb
index <HASH>..<HASH> 100644
--- a/lib/probe_dock_rspec/meta_parser.rb
+++ b/lib/probe_dock_rspec/meta_parser.rb
@@ -16,7 +16,7 @@ module ProbeDockRSpec
options[:fingerprint] = Digest::SHA1.hexdigest name_parts.join('|||')
# TODO: remove once Probe Dock has been migrated to use fingerprints
- options[:data][:fingerprint] = options[:fingerprint]
+ options[:data]['fingerprint'] = options[:fingerprint]
options
end | Replaced symbol by string to avoid serialization issues with current ruby lib. | probedock_probedock-rspec | train | rb |
ff62123168df555f8a4ac8c9907887800a4c6464 | diff --git a/pyprophet/runner.py b/pyprophet/runner.py
index <HASH>..<HASH> 100644
--- a/pyprophet/runner.py
+++ b/pyprophet/runner.py
@@ -95,6 +95,8 @@ ORDER BY RUN_ID,
FEATURE.EXP_RT ASC;
''', con)
elif level == "transition":
+ if not check_sqlite_table(con, "SCORE_MS2"):
+ raise click.ClickException("Transition-level scoring requires prior MS2 or MS1MS2-level scoring.")
if not check_sqlite_table(con, "FEATURE_TRANSITION"):
raise click.ClickException("Transition-level feature table not present in file.") | [FIX] Better reporting of missing MS2 scores | PyProphet_pyprophet | train | py |
45ccee43b7cd3e8ca202487f77486ba2acf3dc87 | diff --git a/src/Illuminate/Foundation/Console/Kernel.php b/src/Illuminate/Foundation/Console/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Console/Kernel.php
+++ b/src/Illuminate/Foundation/Console/Kernel.php
@@ -223,7 +223,7 @@ class Kernel implements KernelContract
$command = $namespace.str_replace(
['/', '.php'],
['\\', ''],
- Str::after($command->getPathname(), realpath(app_path()).DIRECTORY_SEPARATOR)
+ Str::after($command->getRealPath(), realpath(app_path()).DIRECTORY_SEPARATOR)
);
if (is_subclass_of($command, Command::class) && | [8.x] Use `getRealPath` to ensure class name is resolved (#<I>)
When trying to register a new path in the `Kernel` class of your application, and the path contains `..`, the classname isn't generated correctly in <URL> | laravel_framework | train | php |
07aff67365f3b27124f1f8957701b579150b337e | diff --git a/grunt/grunt-generate-doc.js b/grunt/grunt-generate-doc.js
index <HASH>..<HASH> 100644
--- a/grunt/grunt-generate-doc.js
+++ b/grunt/grunt-generate-doc.js
@@ -64,7 +64,7 @@ module.exports = function(grunt) {
if (widget.include) {
result.push("Includes ");
result.push(widget.include.map(function(widget) {
- var title = widget.title || widget.type;
+ var title = widget.type || widget.title;
return "[" + title + "](#" + title.toLowerCase().replace(/\s/g, "-") + ")";
}).join(", "));
result.push("\n"); | Fix broken include links in generated doc
Not sure if we still need the "title" attribute at all, however, this
is a small and obvious change to fix the issue.
Fix #<I>
Change-Id: Ic1ea<I>ca0dc<I>c<I>af<I>cc8e2ae6af<I>a4 | eclipsesource_tabris-js | train | js |
b53dd1ac515f52acbe6784c2f9bc4af82a61357a | diff --git a/src/make-defaults-func.js b/src/make-defaults-func.js
index <HASH>..<HASH> 100644
--- a/src/make-defaults-func.js
+++ b/src/make-defaults-func.js
@@ -4,7 +4,7 @@ module.exports = function(deep, merge) {
Object.entries(obj).forEach((entry) => {
if (typeof sourceObj[entry[0]] === 'undefined') {
sourceObj[entry[0]] = entry[1];
- } else if (deep && [entry[1], sourceObj[entry[0]]].every(val => val && typeof val === 'object' && !Array.isArray(val))) {
+ } else if (deep && [entry[1], sourceObj[entry[0]]].every(val => val && typeof val === 'object' && val.constructor.name === 'Object')) {
sourceObj[entry[0]] = defaults(sourceObj[entry[0]], entry[1]);
} else if (merge && [entry[1], sourceObj[entry[0]]].every(val => val && typeof val === 'object' && Array.isArray(val))) {
sourceObj[entry[0]] = merge(sourceObj[entry[0]], entry[1]); | fix bug causing non-plain objects to get replaced | gryphonmyers_defaults-es6 | train | js |
90157740c20af7dfc194423b71d9b86c33f6716d | diff --git a/parser/parse.go b/parser/parse.go
index <HASH>..<HASH> 100644
--- a/parser/parse.go
+++ b/parser/parse.go
@@ -458,6 +458,9 @@ func (b *Builder) findTypesIn(pkgPath importPathString, u *types.Universe) error
for _, f := range b.parsed[pkgPath] {
if strings.HasSuffix(f.name, "/doc.go") {
tp := u.Package(string(pkgPath))
+ // findTypesIn might be called multiple times. Clean up tp.Comments
+ // to avoid repeatedly fill same comments to it.
+ tp.Comments = []string{}
for i := range f.file.Comments {
tp.Comments = append(tp.Comments, splitLines(f.file.Comments[i].Text())...)
}
diff --git a/types/types.go b/types/types.go
index <HASH>..<HASH> 100644
--- a/types/types.go
+++ b/types/types.go
@@ -101,10 +101,11 @@ type Package struct {
// 'package x' line.
Name string
- // DocComments from doc.go, if any.
+ // The comment right above the package declaration in doc.go, if any.
DocComments []string
- // Comments from doc.go, if any.
+ // All comments from doc.go, if any.
+ // TODO: remove Comments and use DocComments everywhere.
Comments []string
// Types within this package, indexed by their name (*not* including | fix a bug in gengo that parses comments in doc.go multiple times | kubernetes_gengo | train | go,go |
553ca366a42f66cd00638028d337989acf5792b5 | diff --git a/azurerm/internal/services/cosmos/cosmosdb_cassandra_table_resource.go b/azurerm/internal/services/cosmos/cosmosdb_cassandra_table_resource.go
index <HASH>..<HASH> 100644
--- a/azurerm/internal/services/cosmos/cosmosdb_cassandra_table_resource.go
+++ b/azurerm/internal/services/cosmos/cosmosdb_cassandra_table_resource.go
@@ -256,7 +256,7 @@ func resourceCosmosDbCassandraTableRead(d *schema.ResourceData, meta interface{}
throughputResp, err := client.GetCassandraTableThroughput(ctx, id.ResourceGroup, id.DatabaseAccountName, id.CassandraKeyspaceName, id.TableName)
if err != nil {
if !utils.ResponseWasNotFound(throughputResp.Response) {
- return fmt.Errorf("Error reading Throughput on Cosmos Cassandra Table %q (Account: %q, Keyspace: %q): %+v", id.TableName, id.DatabaseAccountName, id.CassandraKeyspaceName, err)
+ return fmt.Errorf("retrieving Throughput for %s: %+v", *id, err)
} else {
d.Set("throughput", nil)
d.Set("autoscale_settings", nil) | Update azurerm/internal/services/cosmos/cosmosdb_cassandra_table_resource.go | terraform-providers_terraform-provider-azurerm | train | go |
f9deefc92b399044957bb2e81cf561447adf3154 | diff --git a/lib/limits.js b/lib/limits.js
index <HASH>..<HASH> 100644
--- a/lib/limits.js
+++ b/lib/limits.js
@@ -45,9 +45,7 @@ module.exports = function limits(deis) {
return callback(errors.Error('Only cpu and memory limits are valid'));
}
- commons.post(format('/%s/apps/%s/config/', deis.version, appName), {
- values: keyValues
- },function(err, result) {
+ commons.post(format('/%s/apps/%s/config/', deis.version, appName), keyValues, function(err, result) {
callback(err, result ? result.values : null);
});
} | fix(js): set limit | aledbf_deis-api | train | js |
c371c4343dfa29819d50328b28414e8d5dc71b76 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@
import os
import sys
+import pip
from setuptools import setup, find_packages
from pip.req import parse_requirements
@@ -19,10 +20,12 @@ packages = find_packages(exclude=package_exclude)
with open("README.md") as f:
readme = f.read()
-requires = parse_requirements("requirements/install.txt")
+requires = parse_requirements("requirements/install.txt",
+ session=pip.download.PipSession())
install_requires = [str(ir.req) for ir in requires]
-requires = parse_requirements("requirements/tests.txt")
+requires = parse_requirements("requirements/tests.txt",
+ session=pip.download.PipSession())
tests_require = [str(ir.req) for ir in requires]
long_description = """ | Added proposed fix for pip crash | Frojd_Fabrik | train | py |
300e488b7e9ce0ebe40a2ea6a196c17eef3490a5 | diff --git a/testing/junit-ext/src/java/com/google/j2objc/testing/JUnitTestRunner.java b/testing/junit-ext/src/java/com/google/j2objc/testing/JUnitTestRunner.java
index <HASH>..<HASH> 100644
--- a/testing/junit-ext/src/java/com/google/j2objc/testing/JUnitTestRunner.java
+++ b/testing/junit-ext/src/java/com/google/j2objc/testing/JUnitTestRunner.java
@@ -381,13 +381,15 @@ public class JUnitTestRunner {
private int numTests = 0;
private int numFailures = 0;
+ private final int numUnexpected = 0; // Never changes, but required in output.
private Failure testFailure;
private double testStartTime;
@Override
public void testRunFinished(Result result) throws Exception {
- out.printf("Executed %d tests, with %d failures\n", numTests, numFailures);
+ out.printf("Executed %d tests, with %d failures (%d unexpected)\n", numTests, numFailures,
+ numUnexpected);
}
@Override | Include "(0 unexpected)" in j2objc's JUnitTestRunner output, since some
build systems use a regular expression to detect overall test success/failure. | google_j2objc | train | java |
7883a618a3691a17adf0bc9362cdc20b1e6043e9 | diff --git a/director/lib/director/client.rb b/director/lib/director/client.rb
index <HASH>..<HASH> 100644
--- a/director/lib/director/client.rb
+++ b/director/lib/director/client.rb
@@ -59,14 +59,20 @@ module Bosh::Director
result["value"]
end
- def wait_until_ready(poll_interval = 1.0)
+ def wait_until_ready(deadline = 300)
old_timeout = @timeout
- @timeout = poll_interval
+ @timeout = 1.0
+ @deadline = Time.now.to_i + deadline
begin
ping
- rescue TimeoutException
- retry
+ rescue TimeoutException => e
+ @timeout = [@timeout * 2, 30].min
+ if @deadline - Time.now.to_i > 0
+ retry
+ else
+ raise(e)
+ end
ensure
@timeout = old_timeout
end | make wait_until_ready timeout after 5 minutes
instead of an indefinite wait | cloudfoundry_bosh | train | rb |
c5cc7ea83a867d3078217b7d692ea78917e22d72 | diff --git a/samples/call_compute_service.py b/samples/call_compute_service.py
index <HASH>..<HASH> 100644
--- a/samples/call_compute_service.py
+++ b/samples/call_compute_service.py
@@ -1,5 +1,6 @@
# To be used to test GoogleCredentials.get_application_default()
# from local machine and GCE.
+# The GCE virtual machine needs to have the Compute API enabled.
from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials | GCE VM needs the Compute API enabled
Added a comment emphasizing that the GCE VM needs to have the Compute API enabled. | googleapis_oauth2client | train | py |
e143c96f5c2d51b3a311e3e8b8c1b1c3c8aead10 | diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/FilePath.java
+++ b/core/src/main/java/hudson/FilePath.java
@@ -220,7 +220,7 @@ public final class FilePath implements Serializable {
return rel.startsWith("/") || DRIVE_PATTERN.matcher(rel).matches();
}
- private static final Pattern DRIVE_PATTERN = Pattern.compile("[A-Za-z]:\\\\.+");
+ private static final Pattern DRIVE_PATTERN = Pattern.compile("[A-Za-z]:\\\\.*");
/**
* Checks if the remote path is Unix. | [FIXED HUDSON-<I>] update DRIVE_PATTERN so a path like C:\ is recognized as absolute
git-svn-id: <URL> | jenkinsci_jenkins | train | java |
f266854e016e444b47ff67cfa1ba6515e89a6bfe | diff --git a/src/engine/GoalTree.js b/src/engine/GoalTree.js
index <HASH>..<HASH> 100644
--- a/src/engine/GoalTree.js
+++ b/src/engine/GoalTree.js
@@ -109,6 +109,20 @@ let resolveStateConditions = function resolveStateConditions(program, clause, po
return;
}
+ let instanceVariables = instance.getVariables();
+
+ subLiteralThetas = subLiteralThetas.map((tupleArg) => {
+ let tuple = tupleArg;
+ let newTheta = {};
+ instanceVariables.forEach((varName) => {
+ if (tuple.theta[varName] !== undefined) {
+ newTheta[varName] = tuple.theta[varName];
+ };
+ });
+ tuple.theta = newTheta;
+ return tuple;
+ });
+
literalThetas = literalThetas.concat(subLiteralThetas);
});
if (numSubstitutionFailure === substitutedInstances.length) { | update resolveStateCondition theta update | lps-js_lps.js | train | js |
d1354f73a8555d7aca8e8f9096b8c2c8b3e0a3bf | diff --git a/src/EventServiceProvider.php b/src/EventServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/EventServiceProvider.php
+++ b/src/EventServiceProvider.php
@@ -24,10 +24,12 @@ class EventServiceProvider extends BaseEventServiceProvider
private function getUnauthorizedOwnerListeners(): array
{
+ $listeners = array();
+
if (Config::listenUnauthorizedOwnerEventForLogger()) {
$listeners[] = WriteUnauthorizedLog::class;
}
- return $listeners ?? [];
+ return $listeners;
}
} | Initialize $listeners in EventServiceProvider | eneav_laravel-authorization | train | php |
6a1196040f14f51eb27575a4d45ef7ef7901ab78 | diff --git a/rapcom/__init__.py b/rapcom/__init__.py
index <HASH>..<HASH> 100644
--- a/rapcom/__init__.py
+++ b/rapcom/__init__.py
@@ -1,2 +1,2 @@
-__version_info__ = (0, 0, 2, 'dev')
+__version_info__ = (0, 1, 0, 'dev')
__version__ = '.'.join(map(str, __version_info__))
diff --git a/rapcom/display.py b/rapcom/display.py
index <HASH>..<HASH> 100644
--- a/rapcom/display.py
+++ b/rapcom/display.py
@@ -52,7 +52,6 @@ def hidden_cursor():
@contextlib.contextmanager
def display_status():
"""Display an OK or FAILED message for the context block."""
-
def print_status(msg, color):
"""Print the status message.
@@ -93,7 +92,6 @@ def timed_display(msg):
Args:
msg: The header message to print at the beginning of the timed block.
"""
-
def print_header(msg, newline=True):
"""Print a header line. | Update version to <I>.dev and fix minor linter errors. | contains-io_rcli | train | py,py |
f78104be53a6b6cefd6b6b6cbb0c93bf7748e601 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -152,7 +152,9 @@ function createDb (cb) {
execCommands(db, config, function (err, data) {
if(err) throw err
console.log(JSON.stringify(data, null, 2))
- process.exit()
+ db.close(function () {
+ process.exit()
+ })
})
// }) | close db on exit (so that some cleanup can be done) | dominictarr_npmd | train | js |
5c45e08e112ed333eb924e6c073b5b8dc3e20015 | diff --git a/tooltipmenu.js b/tooltipmenu.js
index <HASH>..<HASH> 100644
--- a/tooltipmenu.js
+++ b/tooltipmenu.js
@@ -97,7 +97,7 @@ class TooltipMenu {
let coords = node ? this.nodeSelectionCoords() : this.selectionCoords(), $from
let showBlock = this.selectedBlockMenu &&
($from = this.pm.doc.resolve(from)).parentOffset == 0 &&
- $from.end($from.depth) == to
+ $from.end() == to
return () => this.show(showBlock ? this.selectedBlockContent : this.inlineContent, coords)
}
} else if (this.selectedBlockMenu && this.pm.doc.resolve(from).parent.content.size == 0) { | Allow null and negative numbers being passed as depths to ResolvedPos
Shorten a bunch of code | ProseMirror_prosemirror-menu | train | js |
422017a52d4bb062854471e12f922ba18e896353 | diff --git a/packages/aragon-wrapper/src/index.js b/packages/aragon-wrapper/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/aragon-wrapper/src/index.js
+++ b/packages/aragon-wrapper/src/index.js
@@ -242,7 +242,7 @@ export default class Aragon {
const REORG_SAFETY_BLOCK_AGE = 100
const currentBlock = await this.web3.eth.getBlockNumber()
- const cacheBlockHeight = currentBlock - REORG_SAFETY_BLOCK_AGE
+ const cacheBlockHeight = Math.max(currentBlock - REORG_SAFETY_BLOCK_AGE, 0) // clamp to 0 for safety
// Check if we have cached ACL for this address
// Cache object for an ACL: { permissions, blockNumber } | wrapper: clamp ACL cached block height to 0 for safety in local chains (#<I>) | aragon_aragon.js | train | js |
82996df086b7853a14df09a1e6e2fe560099a9ad | diff --git a/Controller/NodeController.php b/Controller/NodeController.php
index <HASH>..<HASH> 100644
--- a/Controller/NodeController.php
+++ b/Controller/NodeController.php
@@ -10,7 +10,7 @@
namespace Clastic\NodeBundle\Controller;
use Clastic\BackofficeBundle\Controller\AbstractModuleController;
-use Clastic\CoreBundle\Node\NodeManager;
+use Clastic\NodeBundle\Node\NodeManager;
use Clastic\NodeBundle\Node\NodeReferenceInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -150,19 +150,6 @@ class NodeController extends AbstractModuleController
}
/**
- * @param NodeReferenceInterface $data
- *
- * @return string
- */
- protected function getFormSuccessUrl($data)
- {
- return $this->generateUrl('clastic_node_form', array(
- 'type' => $this->getType(),
- 'id' => $data->getNode()->getId(),
- ));
- }
-
- /**
* @return NodeManager
*/
private function getNodeManager() | [Node] Fix redirect after save.
Fixes #<I> | Clastic_NodeBundle | train | php |
a438a7bc5eec410b4e55b31f977c2e7066b6285e | diff --git a/lib/poolparty/base_packages/haproxy.rb b/lib/poolparty/base_packages/haproxy.rb
index <HASH>..<HASH> 100644
--- a/lib/poolparty/base_packages/haproxy.rb
+++ b/lib/poolparty/base_packages/haproxy.rb
@@ -33,6 +33,7 @@ module PoolParty
has_package "haproxy" do
stops get_service("apache2"), :immediately
+ starts get_service("apache2")
end
has_exec "reloadhaproxy", | fixes #<I>. cloud-provision will now start apache when haproxy is enabled.
a second cloud-configure is no longer needed | auser_poolparty | train | rb |
512acaedc552407ab53c9d729e621b1e66f51bc8 | diff --git a/spec/support/i18n.rb b/spec/support/i18n.rb
index <HASH>..<HASH> 100644
--- a/spec/support/i18n.rb
+++ b/spec/support/i18n.rb
@@ -4,8 +4,10 @@ RSpec.configure do |config|
def with_translations(locale, translations)
original_backend = I18n.backend
- I18n.backend = I18n::Backend::KeyValue.new({}, true)
- I18n.backend.store_translations(locale, translations)
+ new_backend = I18n::Backend::KeyValue.new({}, true)
+ new_backend.store_translations(locale, translations)
+
+ I18n.backend = I18n::Backend::Chain.new(original_backend, new_backend)
yield
ensure | Merge the existing translations before testing. (#<I>)
`with_translations` is used to test that a view does actually implement
a given translation. Previously, we were resetting the known
translations to only use the one under test. We now have many more
translations so this approach will fail when visiting a page because of
"missing translations".
Example: <URL> | thoughtbot_administrate | train | rb |
5b42994406f977907fccfdce6e85f5d32d9cd84d | diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/environment.rb
+++ b/lib/vagrant/environment.rb
@@ -181,12 +181,18 @@ module Vagrant
# If this isn't a directory then it isn't a provider
next if !provider_folder.directory?
- # If this machine doesn't have an ID, then ignore
- next if !provider_folder.join("id").file?
+ # If this machine doesn't have an ID, then remove the
+ # directory because it shouldn't exist, and ignore.
+ if !provider_folder.join("id").file?
+ provider_folder.rmtree
+ next
+ end
provider = provider_folder.basename.to_s.to_sym
result << [name, provider]
end
+
+ name_folder.rmtree if name_folder.children.empty?
end
# Return the results | core: better cleanup of ".vagrant" | hashicorp_vagrant | train | rb |
3ff8dff7dc04d98be3f6e8cf7c2367ca8691905f | diff --git a/lib/paper_trail/has_paper_trail.rb b/lib/paper_trail/has_paper_trail.rb
index <HASH>..<HASH> 100644
--- a/lib/paper_trail/has_paper_trail.rb
+++ b/lib/paper_trail/has_paper_trail.rb
@@ -106,7 +106,7 @@ module PaperTrail
end
def record_destroy
- if switched_on?
+ if switched_on? and not new_record?
versions.create merge_metadata(:event => 'destroy',
:object => object_to_string(item_before_change),
:whodunnit => PaperTrail.whodunnit) | Fix don't create trail on destroy if record was not persisted | paper-trail-gem_paper_trail | train | rb |
562461980cc41748b8920f5e2ee1db55a9e54aa5 | diff --git a/WrightTools/data/_data.py b/WrightTools/data/_data.py
index <HASH>..<HASH> 100644
--- a/WrightTools/data/_data.py
+++ b/WrightTools/data/_data.py
@@ -1239,7 +1239,7 @@ class Data:
ai = Ai(axi.points)
Mi = mi(ai)
# apply Mi to channel
- self.channels[i].values /= Mi
+ self.channels[channel].values /= Mi
# invert back out of the transpose
t_inv = [t_order.index(j) for j in range(len(t_order))]
if verbose: | M-factor fix
data.m now normalizes the correct channel. resolves #<I> | wright-group_WrightTools | train | py |
Subsets and Splits