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
|
---|---|---|---|---|---|
b24d0c9f8ce7f85f3df0263df5b8f4aca53d4328 | diff --git a/pysat/_instrument.py b/pysat/_instrument.py
index <HASH>..<HASH> 100644
--- a/pysat/_instrument.py
+++ b/pysat/_instrument.py
@@ -271,6 +271,7 @@ class Instrument(object):
# use Instrument definition of MetaLabels over the Metadata declaration
self.meta_labels = labels
self.meta = pysat.Meta(labels=self.meta_labels)
+ self.meta.mutable = False
self.labels = pysat.MetaLabels(metadata=self.meta, **labels)
# function processing class, processes data on load | BUG: Ensured meta object immutable upon Instrument instantiation | rstoneback_pysat | train | py |
97e6bd2219599b1f752219fa7ff8ee47ddf8c5b0 | diff --git a/tests/integration/states/test_ansiblegate.py b/tests/integration/states/test_ansiblegate.py
index <HASH>..<HASH> 100644
--- a/tests/integration/states/test_ansiblegate.py
+++ b/tests/integration/states/test_ansiblegate.py
@@ -16,13 +16,14 @@ import salt.utils.path
# Import testing libraries
from tests.support.case import ModuleCase
-from tests.support.helpers import destructiveTest
+from tests.support.helpers import destructiveTest, requires_sshd_server
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.runtests import RUNTIME_VARS
from tests.support.unit import skipIf
@destructiveTest
+@requires_sshd_server
@skipIf(not salt.utils.path.which('ansible-playbook'), 'ansible-playbook is not installed')
class AnsiblePlaybooksTestCase(ModuleCase, SaltReturnAssertsMixin):
''' | only run ansible tests if sshd was started | saltstack_salt | train | py |
552acfba95b2a966975b8ffdf596494a7ccb5c5b | diff --git a/test/test_indexdata/test_views.py b/test/test_indexdata/test_views.py
index <HASH>..<HASH> 100644
--- a/test/test_indexdata/test_views.py
+++ b/test/test_indexdata/test_views.py
@@ -39,16 +39,27 @@ try:
# only available in 1.8 +
from django.test.utils import override_settings
except ImportError:
- # dummy do-nothing decator for override settings
+
+ # supply replacement for override settings
def override_settings(*args, **kwargs):
def wrap(f):
- with patch(settings) as mocksettings:
- for key, val in kwargs.iteritems():
- setattr(mocksettings, key, val)
-
+ # patch django settings using mock if we have django
+ # but not override_settings
+ if django is not None:
+ with patch(settings) as mocksettings:
+ for key, val in kwargs.iteritems():
+ setattr(mocksettings, key, val)
+
+ def wrapped_f(*args, **kwargs):
+ f(*args, **kwargs)
+ return wrapped_f
+
+ # otherwise, do nothing
+ else:
def wrapped_f(*args, **kwargs):
f(*args, **kwargs)
return wrapped_f
+
return wrap | Clean up override_settings replacement for no django and older django | emory-libraries_eulfedora | train | py |
5cf318a6dea6ea49e45b321e80e4e06f86ffeeed | diff --git a/AlphaTwirl/WritePandasDataFrameToFile.py b/AlphaTwirl/WritePandasDataFrameToFile.py
index <HASH>..<HASH> 100755
--- a/AlphaTwirl/WritePandasDataFrameToFile.py
+++ b/AlphaTwirl/WritePandasDataFrameToFile.py
@@ -11,6 +11,7 @@ class WritePandasDataFrameToFile(object):
f.write(" ".join([i for i in results.columns]) + "\n")
else:
results.to_string(f, index = False)
+ f.write("\n")
self._close(f)
def _open(self, path): return open(path, 'w')
diff --git a/tests/test_WritePandasDataFrameToFile.py b/tests/test_WritePandasDataFrameToFile.py
index <HASH>..<HASH> 100644
--- a/tests/test_WritePandasDataFrameToFile.py
+++ b/tests/test_WritePandasDataFrameToFile.py
@@ -35,7 +35,7 @@ class TestWritePandasDataFrameToFile(unittest.TestCase):
delivery.deliver(results)
- expected = " v1 n nvar\n 1 4 6\n 2 3 9\n 3 2 3"
+ expected = " v1 n nvar\n 1 4 6\n 2 3 9\n 3 2 3\n"
self.assertEqual(expected, out.getvalue())
def test_deliver_empty_dataframe(self): | make WritePandasDataFrameToFile write the line break at the end of file | alphatwirl_alphatwirl | train | py,py |
5971535ef0d5bdbb54619bff086e3fa4cf1e7657 | diff --git a/src/OptionDbTrait.php b/src/OptionDbTrait.php
index <HASH>..<HASH> 100644
--- a/src/OptionDbTrait.php
+++ b/src/OptionDbTrait.php
@@ -49,7 +49,7 @@ trait OptionDbTrait
{
$parts = parse_url($url);
- $this->database['name'] = $parts['path'];
+ $this->database['name'] = trim($parts['path'], '/');
$this->database['user'] = $parts['user'];
$this->database['pass'] = $parts['pass'];
$this->database['host'] = $parts['host']; | trim the leading slash remaining from parsing URL - forgot this last commit | simplisti_jasper-starter | train | php |
b41c4045387d9caf5429d3c86b858125f54f3b32 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -85,6 +85,7 @@ var processJSONencodedBody = function (body) {
var key, value;
var result = {
+ properties: {},
mp: {},
};
@@ -99,6 +100,14 @@ var processJSONencodedBody = function (body) {
}
}
+
+ for (key in body.properties) {
+ if (['url'].indexOf(key) !== -1) {
+ result[key] = result[key] || [].concat(body.properties[key])[0];
+ delete body.properties[key];
+ }
+ }
+
cleanEmptyKeys(result);
return result;
diff --git a/test/micropub.spec.js b/test/micropub.spec.js
index <HASH>..<HASH> 100644
--- a/test/micropub.spec.js
+++ b/test/micropub.spec.js
@@ -67,6 +67,22 @@ describe('Micropub Parse', function () {
});
});
+ it('should convert URL-property to top-level property', function () {
+ micropub.processJSONencodedBody({
+ type: ['h-entry'],
+ properties: {
+ content: ['hello world'],
+ url: ['http://example.com/'],
+ },
+ }).should.deep.equal({
+ type: ['h-entry'],
+ url: 'http://example.com/',
+ properties: {
+ content: ['hello world'],
+ },
+ });
+ });
+
});
}); | fix(main): ensure URL is always top level property | voxpelli_node-micropub-express | train | js,js |
70923ddce4e45192ed1ce50d307c67853ea36956 | diff --git a/Bundle/WidgetBundle/Model/WidgetManager.php b/Bundle/WidgetBundle/Model/WidgetManager.php
index <HASH>..<HASH> 100644
--- a/Bundle/WidgetBundle/Model/WidgetManager.php
+++ b/Bundle/WidgetBundle/Model/WidgetManager.php
@@ -350,7 +350,6 @@ class WidgetManager
$this->widgetMapManager->overwrite($view, $originalWidgetMap, $widgetCopy);
- $this->widgetMapBuilder->build($view);
return $widgetCopy;
} | do not build widgetMap as unnecesary | Victoire_victoire | train | php |
6105bcdd8a49220657dd798eaf03f6afe0117944 | diff --git a/fsps/fsps.py b/fsps/fsps.py
index <HASH>..<HASH> 100644
--- a/fsps/fsps.py
+++ b/fsps/fsps.py
@@ -366,7 +366,7 @@ class StellarPopulation(object):
:param dust1_index: (default: -1.0)
Power law index of the attenuation curve affecting stars younger than
- dust_tesc corresponding to ``dust1``. Only used when ``dust_type=0``.
+ dust_tesc corresponding to ``dust1``. Used for all dust types.
:param mwr: (default: 3.1)
The ratio of total to selective absorption which characterizes the MW | Edited dust1_index docstring to reflect usage
Previously, the docstring (and therefore documentation on the
website) stated that dust1_index is only used when dust_type=0.
This is not the case, dust1_index is used for all dust types,
as can be seen in the Fortran FSPS documentation. I have also
verified this in in python-fsps. This commit changes the docstring
to correct this. | dfm_python-fsps | train | py |
59ef1669ddf377d5bfbdf178305f5e1ef63218db | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ requires = [
'zope.sqlalchemy',
'cryptacular',
- 'requests',
+ 'requests < 1.0.0',
'docutils',
'IPython', | Force requests version for users using proxy
Lastest version looks not working | mardiros_pyshop | train | py |
ca683ddf4c59424dd589aa21b770dd044b94c375 | diff --git a/webstack_django_sorting/common.py b/webstack_django_sorting/common.py
index <HASH>..<HASH> 100644
--- a/webstack_django_sorting/common.py
+++ b/webstack_django_sorting/common.py
@@ -11,7 +11,9 @@ def render_sort_anchor(request, field_name, title):
sort_by = get_params.get("sort", None)
if sort_by == field_name:
# Render anchor link to next direction
- current_direction = SORT_DIRECTIONS[get_params.get("dir", "")]
+ current_direction = SORT_DIRECTIONS.get(
+ get_params.get("dir", ""), SORT_DIRECTIONS[""]
+ )
icon = current_direction["icon"]
next_direction_code = current_direction["next"]
else: | templatetags.common: fix sorting direction with invalid params
sorting by an invalid direction shouldn't fail and use ASC order | webstack_webstack-django-sorting | train | py |
0a00a7b158238cbbd0f052032c61fa4d33dc42fa | diff --git a/phonopy/phonon/band_structure.py b/phonopy/phonon/band_structure.py
index <HASH>..<HASH> 100644
--- a/phonopy/phonon/band_structure.py
+++ b/phonopy/phonon/band_structure.py
@@ -38,11 +38,9 @@ from phonopy.units import VaspToTHz
def estimate_band_connection(prev_eigvecs, eigvecs, prev_band_order):
metric = np.abs(np.dot(prev_eigvecs.conjugate().T, eigvecs))
connection_order = []
- indices = range(len(metric))
- indices.reverse()
for overlaps in metric:
maxval = 0
- for i in indices:
+ for i in reversed(range(len(metric))):
val = overlaps[i]
if i in connection_order:
continue | Fix reversing range for py3. | atztogo_phonopy | train | py |
725730a125fe6955e478afc23d7c0b7d5cc36394 | diff --git a/src/Monitor/Monitor.php b/src/Monitor/Monitor.php
index <HASH>..<HASH> 100644
--- a/src/Monitor/Monitor.php
+++ b/src/Monitor/Monitor.php
@@ -6,7 +6,6 @@ use stdClass;
class Monitor
{
-
/**
* The array $_SERVER[] contains a bunch of server and execution
* environment information. | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | orchidsoftware_platform | train | php |
bc51506aa8e16ca5b104eea1f89f0ff1449866d0 | diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/web/valve/ValveUtil.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/web/valve/ValveUtil.java
index <HASH>..<HASH> 100644
--- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/web/valve/ValveUtil.java
+++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/web/valve/ValveUtil.java
@@ -103,7 +103,6 @@ public class ValveUtil {
ModelNode op = new ModelNode();
op.get(OP).set("read-attribute");
op.get(OP_ADDR).add("path", "jboss.home.dir");
- op.get(NAME).set("name");
op.get("name").set("path");
ModelNode result = client.execute(new OperationBuilder(op).build());
if (result.hasDefined("outcome") && "success".equals(result.get("outcome").asString())) { | get ride of useless line of code. | wildfly_wildfly | train | java |
194dca95a2f39046399ebc109c157829757d6e51 | diff --git a/cluster/calcium/build_image.go b/cluster/calcium/build_image.go
index <HASH>..<HASH> 100644
--- a/cluster/calcium/build_image.go
+++ b/cluster/calcium/build_image.go
@@ -47,6 +47,7 @@ ADD launcher /usr/local/bin/launcher
ADD launcheroot /usr/local/bin/launcheroot
WORKDIR /{{.Appname}}
RUN useradd -u %s -d /nonexistent -s /sbin/nologin -U {{.Appname}}
+RUN chown -R %s /{{.Appname}}
{{with .Build}}
{{range $index, $value := .}}
RUN {{$value}}
@@ -278,7 +279,7 @@ func createDockerfile(buildDir, uid, reponame string, specs types.Specs) error {
}
defer f.Close()
- dockerFileFormatted := fmt.Sprintf(dockerFile, reponame, uid)
+ dockerFileFormatted := fmt.Sprintf(dockerFile, reponame, uid, uid)
t := template.New("docker file template")
parsedTemplate, err := t.Parse(dockerFileFormatted)
if err != nil { | chown on /APPNAME inside container | projecteru2_core | train | go |
54501425959cf18b48ad6e5f035ab9ba61d01ff6 | diff --git a/nodes/fire-event/ui-fire-event.js b/nodes/fire-event/ui-fire-event.js
index <HASH>..<HASH> 100644
--- a/nodes/fire-event/ui-fire-event.js
+++ b/nodes/fire-event/ui-fire-event.js
@@ -15,7 +15,7 @@ RED.nodes.registerType('ha-fire-event', {
server: { value: '', type: 'server', required: true },
event: { value: '' },
data: { value: '' },
- dataType: { value: 'json' },
+ dataType: { value: 'jsonata' },
},
oneditprepare: function () {
const node = this; | refactor(fire-event): Change default type of the data field to JSONata | zachowj_node-red-contrib-home-assistant-websocket | train | js |
daa1101b3a587922f6b15334eaa927cb9f33e9a2 | diff --git a/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/ajax-requests.js b/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/ajax-requests.js
index <HASH>..<HASH> 100644
--- a/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/ajax-requests.js
+++ b/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/ajax-requests.js
@@ -37,6 +37,7 @@ $(document).ready(function () {
$(this).removeClass('selected');
renderRequestTab(rootRequestTrace);
renderCallTree(rootRequestTrace);
+ doRenderPageLoadTime();
}
});
function addToolbar() { | Render page load time when ajax request is deselected | stagemonitor_stagemonitor | train | js |
29c0640a64d87bc63ec20cdc68899b95e4155ef0 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -314,7 +314,13 @@ groups.Groups = function(optionsArg, callback) {
req.extras.oneGroup = true;
}
}
- return self._people.get(req, criteria, { permalink: req.bestPage }, function(err, results) {
+ var options = {};
+ if (req.query.letter) {
+ options.letter = req.query.letter;
+ req.extras.letter = req.query.letter;
+ }
+ options.permalink = req.bestPage;
+ return self._people.get(req, criteria, options, function(err, results) {
if (err) {
return callback(err);
} | added support for a letter query that filters last names A-Z | apostrophecms-legacy_apostrophe-groups | train | js |
3e442359b069f8646e5003c650976f2cc62a8cad | diff --git a/docs/webpack.config.js b/docs/webpack.config.js
index <HASH>..<HASH> 100644
--- a/docs/webpack.config.js
+++ b/docs/webpack.config.js
@@ -80,7 +80,7 @@ const sassConfig = `outputStyle=${env.development ? 'expanded&sourceMap=true' :
const jsLoader = `${env.development ? 'react-hot!' : ''}babel`;
if(env.development) {
const host = 'localhost';
- const port = 3000;
+ const port = 8080;
const DEV_URL = `http://${host}:${port}`;
config.devtool = 'eval';
config.entry = config.entry.concat([ | Changed devport to <I> | mlaursen_react-md | train | js |
84d171fe8654d0ecd5d11bcd30c91dc8f6c5ad8a | diff --git a/pkg/controller/cloud/node_controller.go b/pkg/controller/cloud/node_controller.go
index <HASH>..<HASH> 100644
--- a/pkg/controller/cloud/node_controller.go
+++ b/pkg/controller/cloud/node_controller.go
@@ -313,18 +313,18 @@ func (cnc *CloudNodeController) MonitorNode() {
func (cnc *CloudNodeController) AddCloudNode(obj interface{}) {
node := obj.(*v1.Node)
- instances, ok := cnc.cloud.Instances()
- if !ok {
- utilruntime.HandleError(fmt.Errorf("failed to get instances from cloud provider"))
- return
- }
-
cloudTaint := getCloudTaint(node.Spec.Taints)
if cloudTaint == nil {
glog.V(2).Infof("This node %s is registered without the cloud taint. Will not process.", node.Name)
return
}
+ instances, ok := cnc.cloud.Instances()
+ if !ok {
+ utilruntime.HandleError(fmt.Errorf("failed to get instances from cloud provider"))
+ return
+ }
+
err := clientretry.RetryOnConflict(UpdateNodeSpecBackoff, func() error {
curNode, err := cnc.kubeClient.CoreV1().Nodes().Get(node.Name, metav1.GetOptions{})
if err != nil { | Avoid call to get cloud instances
if a node does not have the taint, we really don't need to make calls
to get the list of instances from the cloud provider | kubernetes_kubernetes | train | go |
5c5522b7c047b7f3df0a577a85a6caa419a64a4f | diff --git a/manifest.go b/manifest.go
index <HASH>..<HASH> 100644
--- a/manifest.go
+++ b/manifest.go
@@ -66,6 +66,9 @@ func BuildManifest(root string, includeFn filepath.WalkFunc) (*pb.Manifest, erro
if fi.Mode().IsRegular() {
entry.Size = uint64(fi.Size())
+
+ // TODO(stevvooe): The nlinks technique is not always reliable on
+ // certain filesystems. Must use the dev, inode to join them.
if sysStat.Nlink < 2 {
dgst, err := hashPath(p)
if err != nil {
@@ -191,6 +194,10 @@ func BuildManifest(root string, includeFn filepath.WalkFunc) (*pb.Manifest, erro
}, nil
}
+func ApplyManifest(root string, manifest *pb.Manifest) error {
+ panic("not implemented")
+}
+
// sanitize and clean the path relative to root.
func sanitize(root, p string) (string, error) {
sanitized, err := filepath.Rel(root, p) | Add comment about links counting and specify ApplyManifest | containerd_continuity | train | go |
1322ef5108d9a6a364a6c6b83a475ef1f78751ab | diff --git a/tests/test_fields.py b/tests/test_fields.py
index <HASH>..<HASH> 100644
--- a/tests/test_fields.py
+++ b/tests/test_fields.py
@@ -7,6 +7,7 @@ from marshmallow.fields import Int
from marshmallow_jsonapi import Schema
from marshmallow_jsonapi.fields import Str, DocumentMeta, Meta, ResourceMeta, Relationship
+from marshmallow_jsonapi.utils import _MARSHMALLOW_VERSION_INFO
class TestGenericRelationshipField:
@@ -254,6 +255,10 @@ class TestGenericRelationshipField:
field.deserialize({})
assert excinfo.value.args[0] == 'Must include a `data` key'
+ @pytest.mark.skipif(
+ _MARSHMALLOW_VERSION_INFO[0] < 3,
+ reason='deserialize does not handle missing skeleton',
+ )
def test_deserialize_missing(self):
field = Relationship(
related_url='/posts/{post_id}/comments',
@@ -263,6 +268,10 @@ class TestGenericRelationshipField:
result = field.deserialize(missing_)
assert result is missing_
+ @pytest.mark.skipif(
+ _MARSHMALLOW_VERSION_INFO[0] < 3,
+ reason='deserialize does not handle missing skeleton',
+ )
def test_deserialize_missing_with_missing_param(self):
field = Relationship(
related_url='/posts/{post_id}/comments', | Skip missing skeleton tests for ma version < 3 | marshmallow-code_marshmallow-jsonapi | train | py |
e2907f1503e82596bb89972a77edb27d303bd9d2 | diff --git a/openquake/engine/utils/tasks.py b/openquake/engine/utils/tasks.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/utils/tasks.py
+++ b/openquake/engine/utils/tasks.py
@@ -75,7 +75,7 @@ class OqTaskManager(TaskManager):
result = result_dict['result']
if isinstance(result, BaseException):
raise result
- self.received += len(result)
+ self.received.append(len(result))
acc = agg(acc, result.unpickle())
if amqp_backend:
# work around a celery bug | Updated .received to be a list | gem_oq-engine | train | py |
4d5066e07308817b9156b326d635a6db3afde4c7 | diff --git a/defaults.go b/defaults.go
index <HASH>..<HASH> 100644
--- a/defaults.go
+++ b/defaults.go
@@ -1,6 +1,7 @@
package defaults
import (
+ "encoding/json"
"errors"
"reflect"
"strconv"
@@ -104,8 +105,18 @@ func setField(field reflect.Value, defaultVal string) {
case reflect.String:
field.Set(reflect.ValueOf(defaultVal))
case reflect.Slice:
- field.Set(reflect.MakeSlice(field.Type(), 0, 0))
+ val := reflect.New(field.Type())
+ val.Elem().Set(reflect.MakeSlice(field.Type(), 0, 0))
+ json.Unmarshal([]byte(defaultVal), val.Interface())
+ field.Set(val.Elem())
case reflect.Map:
- field.Set(reflect.MakeMap(field.Type()))
+ val := reflect.New(field.Type())
+ val.Elem().Set(reflect.MakeMap(field.Type()))
+ json.Unmarshal([]byte(defaultVal), val.Interface())
+ field.Set(val.Elem())
+ case reflect.Struct:
+ val := reflect.New(field.Type())
+ json.Unmarshal([]byte(defaultVal), val.Interface())
+ field.Set(val.Elem())
}
} | Initialize slice/map/struct with json | creasty_defaults | train | go |
dd05d48f6dbd0e193d6a77640b34d753d9e1c323 | diff --git a/lib/utils.js b/lib/utils.js
index <HASH>..<HASH> 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -64,6 +64,14 @@ utils.blacklist = [
utils.parseArgs = function(argv) {
var parse = utils.macros('generate-macro-store');
var obj = parse(argv, utils.opts);
+
+ for (var key in obj) {
+ var val = obj[key];
+ if (/^no\w/.test(key)) {
+ obj[key.slice(2)] = !val;
+ }
+ }
+
if (obj.init) {
obj._.push('init');
delete obj.init; | ensure the reverse of a negative flag is set on options
e.g. when `--nofoo` is set, it adds `nofoo: true` to the options. This ensures that `foo: false` is also added
resolves <URL> | generate_generate | train | js |
a3cdc67b958ed21b0df5354696d31d087704f526 | diff --git a/conversation.go b/conversation.go
index <HASH>..<HASH> 100644
--- a/conversation.go
+++ b/conversation.go
@@ -84,6 +84,11 @@ func (c *Conversation) wrapMessageHeader(msgType byte, msg []byte) (messageWithH
return append(header, msg...), nil
}
+// DefaultFingerprintFor returns the default fingerprint for the given key
+func (c *Conversation) DefaultFingerprintFor(pk PublicKey) []byte {
+ return pk.DefaultFingerprint(c.version)
+}
+
// IsEncrypted returns true if the current conversation is private
func (c *Conversation) IsEncrypted() bool {
return c.msgState == encrypted | Add support for getting fingerprints from Conversation | coyim_otr3 | train | go |
86dc93e63a8b1d319935bde7853a842c012f64d3 | diff --git a/app/src/Bolt/Controllers/Upload.php b/app/src/Bolt/Controllers/Upload.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Controllers/Upload.php
+++ b/app/src/Bolt/Controllers/Upload.php
@@ -95,6 +95,8 @@ class Upload implements ControllerProviderInterface, ServiceProviderInterface
$response = false;
foreach($handler as $destination) {
list($namespace, $prefix) = $parser($destination);
+ $app['upload.namespace']=$namespace;
+ $app['upload.prefix'] = $prefix;
$res = $controller->uploadFile($app, $request, $namespace);
if(!$response) {
$response = $res; | rearranged the logic in array loop to fix | bolt_bolt | train | php |
4e497a81b3f6eb2823af22ef69dbd1b8d22790a1 | diff --git a/test/unit/sources/freeproxylists.js b/test/unit/sources/freeproxylists.js
index <HASH>..<HASH> 100644
--- a/test/unit/sources/freeproxylists.js
+++ b/test/unit/sources/freeproxylists.js
@@ -102,7 +102,7 @@ describe('source.freeproxylists', function() {
it('should get list data given a list URL', function(done) {
- this.timeout(5000);
+ this.timeout(10000);
var startingPageUrl = 'http://www.freeproxylists.com/socks.html'; | Increased timeout for freeproxylists test | chill117_proxy-lists | train | js |
ce02b19d217bc7cf15fef47be2961fda2db42033 | diff --git a/src/components/picker/PickerItem.js b/src/components/picker/PickerItem.js
index <HASH>..<HASH> 100644
--- a/src/components/picker/PickerItem.js
+++ b/src/components/picker/PickerItem.js
@@ -145,6 +145,7 @@ function createStyles() {
...Typography.text70,
color: Colors.dark10,
flex: 1,
+ textAlign: 'left',
},
labelTextDisabled: {
color: Colors.dark60, | fixed rtl bug in Picker.Item (#<I>) | wix_react-native-ui-lib | train | js |
b2e29f4dc2a614779fa006c63bb552954d334693 | diff --git a/Adapter/PlentymarketsAdapter/ResponseParser/Media/MediaResponseParser.php b/Adapter/PlentymarketsAdapter/ResponseParser/Media/MediaResponseParser.php
index <HASH>..<HASH> 100644
--- a/Adapter/PlentymarketsAdapter/ResponseParser/Media/MediaResponseParser.php
+++ b/Adapter/PlentymarketsAdapter/ResponseParser/Media/MediaResponseParser.php
@@ -99,8 +99,10 @@ class MediaResponseParser implements MediaResponseParserInterface
Media::TYPE
);
+ $entry['identifier'] = $identity->getObjectIdentifier();
+
$media = new Media();
- $media->setIdentifier($identity->getObjectIdentifier());
+ $media->setIdentifier($entry['identity']);
$media->setMediaCategoryIdentifier($entry['mediaCategoryIdentifier']);
$media->setLink($entry['link']);
$media->setFilename($entry['filename']); | include all media fields for the media hash | plentymarkets_plentymarkets-shopware-connector | train | php |
694dd627e05cb0afc21acda13df4228c8425d004 | diff --git a/lib/xport/common.php b/lib/xport/common.php
index <HASH>..<HASH> 100644
--- a/lib/xport/common.php
+++ b/lib/xport/common.php
@@ -68,7 +68,7 @@ abstract class XportCommon {
case self::ENC_XML:
lib('array2xml');
try {
- $response = array_shift(XML2Array::createArray($response));
+ $response = mda_shift(XML2Array::createArray($response));
} catch(Exception $e){
throw new Exception('Response is not valid XML: '.$response);
} | upgraded to work with php E_STRICT on and upgraded transport handling of exceptions | nullivex_lib-xport | train | php |
2b8af9e79ee2e3f54be98710f3f245940dffee1a | diff --git a/src/config/android/findAndroidAppFolder.js b/src/config/android/findAndroidAppFolder.js
index <HASH>..<HASH> 100644
--- a/src/config/android/findAndroidAppFolder.js
+++ b/src/config/android/findAndroidAppFolder.js
@@ -1,6 +1,10 @@
const fs = require('fs');
const path = require('path');
+/**
+ * @param {String} folder Folder to seek in
+ * @return {String}
+ */
module.exports = function findAndroidAppFolder(folder) {
if (!fs.existsSync(path.join(folder, 'android'))) {
return null; | Added coments to findAndroidAppFolder | rnpm_rnpm | train | js |
2701de50d21bdb151a776f3dc93a792667e795e2 | diff --git a/ui/stories/components/table.stories.js b/ui/stories/components/table.stories.js
index <HASH>..<HASH> 100644
--- a/ui/stories/components/table.stories.js
+++ b/ui/stories/components/table.stories.js
@@ -29,6 +29,7 @@ function injectRoutedController(controllerClass) {
this.route('storybook');
});
+ /* eslint-disable-next-line ember/no-private-routing-service */
let router = container.lookup('router:main');
router.initialURL = 'storybook';
router.startRouting(true); | ui: storybook accesses private routing service | hashicorp_nomad | train | js |
6f41e0901438b55680fc139fc0b37c4612ad521e | diff --git a/src/Adapter.php b/src/Adapter.php
index <HASH>..<HASH> 100644
--- a/src/Adapter.php
+++ b/src/Adapter.php
@@ -156,6 +156,7 @@ class Adapter
*
* @param string $dbname
* @return Adapter
+ * @throws UnknownDatabaseException
*/
public function setDatabase($dbname)
{ | Docblock change
Changed to document the type of exception thrown. | phlib_db | train | php |
b8586e762fb32f8095f020c8f5d7ceb11eb5e9f6 | diff --git a/src/Twig/Template.php b/src/Twig/Template.php
index <HASH>..<HASH> 100644
--- a/src/Twig/Template.php
+++ b/src/Twig/Template.php
@@ -56,10 +56,11 @@ abstract class Template extends Twig_Template
/** @var \Illuminate\View\Factory $factory */
$env = $context['__env'];
+ $view_name = empty($this->name) ? $this->getTemplateName() : $this->name;
$view = new View(
$env,
$env->getEngineResolver()->resolve('twig'),
- $this->name,
+ $view_name,
null,
$context
); | Update Template.php
The name is not always set, meaning the composer and creators are not being called correctly. If no name the use getTemplateName() | rcrowe_TwigBridge | train | php |
5b4ff9820881e4f6d9a41922c70b27f6d411ab5c | diff --git a/js/bitmex.js b/js/bitmex.js
index <HASH>..<HASH> 100644
--- a/js/bitmex.js
+++ b/js/bitmex.js
@@ -548,11 +548,13 @@ module.exports = class bitmex extends Exchange {
return false;
}
- async withdraw (currency, amount, address, tag = undefined, params = {}) {
+ async withdraw (code, amount, address, tag = undefined, params = {}) {
this.checkAddress (address);
await this.loadMarkets ();
- if (currency !== 'BTC')
+ // let currency = this.currency (code);
+ if (code !== 'BTC') {
throw new ExchangeError (this.id + ' supoprts BTC withdrawals only, other currencies coming soon...');
+ }
let request = {
'currency': 'XBt', // temporarily
'amount': amount, | bitmex withdraw() signature unified | ccxt_ccxt | train | js |
688363ad53ae1f29b5e4f67bbb4b1b96e0238ad5 | diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go
index <HASH>..<HASH> 100644
--- a/pkg/kubectl/describe.go
+++ b/pkg/kubectl/describe.go
@@ -27,6 +27,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
+ "github.com/GoogleCloudPlatform/kubernetes/pkg/types"
"github.com/golang/glog"
)
@@ -366,7 +367,14 @@ func (d *NodeDescriber) Describe(namespace, name string) (string, error) {
pods = append(pods, pod)
}
- events, _ := d.Events(namespace).Search(node)
+ var events *api.EventList
+ if ref, err := api.GetReference(node); err != nil {
+ glog.Errorf("Unable to construct reference to '%#v': %v", node, err)
+ } else {
+ // TODO: We haven't decided the namespace for Node object yet.
+ ref.UID = types.UID(ref.Name)
+ events, _ = d.Events("").Search(ref)
+ }
return describeNode(node, pods, events)
} | Kubectl describe nodes id with events. | kubernetes_kubernetes | train | go |
7b96ea9d8aa2715159b66c7b56ffbb24e1ed8ab4 | diff --git a/lib/rvm/environment/utility.rb b/lib/rvm/environment/utility.rb
index <HASH>..<HASH> 100644
--- a/lib/rvm/environment/utility.rb
+++ b/lib/rvm/environment/utility.rb
@@ -52,23 +52,25 @@ module RVM
# Lets you build a command up, without needing to see the output.
# As an example,
#
- # rvm :use, "ree@rails3", :install => true
+ # rvm :use, "ree@rails3", :install => true, :rvm_by_path => true
#
# Will call the following:
#
- # rvm use ree@rails3 --install
+ # $rvm_path/bin/rvm use ree@rails3 --install
#
def rvm(*args)
options = extract_options!(args)
silent = options.delete(:silent)
+ rvm_by_path = options.delete(:rvm_by_path)
rearrange_options!(args, options)
args += hash_to_options(options)
args.map! { |a| a.to_s }
+ program = rvm_by_path ? "#{self.class.default_rvm_path}/bin/rvm" : "rvm"
if silent
- run_silently('rvm', *args)
+ run_silently(program, *args)
else
- run('rvm', *args)
+ run(program, *args)
end
end | Add :rvm_by_path option to #rvm method to invoke rvm with full path. | rvm_rvm-gem | train | rb |
63022392bbead0acca33d17121dac7fa69736363 | diff --git a/src/Config/FileConfig.php b/src/Config/FileConfig.php
index <HASH>..<HASH> 100644
--- a/src/Config/FileConfig.php
+++ b/src/Config/FileConfig.php
@@ -16,7 +16,7 @@ class FileConfig extends SimpleConfig
* @param Loader\FileLoader $fileLoader
*
* @api
- */куафсещкrre
+ */
public function __construct(Loader\FileLoader $fileLoader)
{
parent::__construct(); | issue #<I>, fix critical mistake | octolabot_Common | train | php |
e1b7279acebfb69867241b41511209e0679d8478 | diff --git a/src/widgets/AjaxModal.php b/src/widgets/AjaxModal.php
index <HASH>..<HASH> 100644
--- a/src/widgets/AjaxModal.php
+++ b/src/widgets/AjaxModal.php
@@ -216,7 +216,7 @@ class AjaxModal extends \yii\bootstrap\Modal
jQuery('#$this->id').modal('hide');
new PNotify({
text: "{$this->successText}",
- type: 'info',
+ type: 'success',
buttons: {
sticker: false
}, | Changed color of flash from `info` to `success` | hiqdev_hipanel-core | train | php |
435733797ca07a710de5d782c20e37a6649a3e26 | diff --git a/packages/core/lib/segment_emitter.js b/packages/core/lib/segment_emitter.js
index <HASH>..<HASH> 100644
--- a/packages/core/lib/segment_emitter.js
+++ b/packages/core/lib/segment_emitter.js
@@ -122,7 +122,7 @@ var SegmentEmitter = {
var client = this.socket;
var formatted = segment.format();
var data = PROTOCOL_HEADER + PROTOCOL_DELIMITER + formatted;
- var message = new Buffer(data);
+ var message = Buffer.from(data);
var short = '{"trace_id:"' + segment.trace_id + '","id":"' + segment.id + '"}';
var type = segment.type === 'subsegment' ? 'Subsegment' : 'Segment'; | Changes "New Buffer(data)" to Buffer.from(data) (#<I>) | aws_aws-xray-sdk-node | train | js |
0b3bee7d103606632cad408db3f3c94b6c3d06fe | diff --git a/src/search/search-action/index.js b/src/search/search-action/index.js
index <HASH>..<HASH> 100644
--- a/src/search/search-action/index.js
+++ b/src/search/search-action/index.js
@@ -4,6 +4,8 @@ import _builder from './builder';
import _parser from './parser';
import dispatcher from '../../dispatcher';
import {manageResponseErrors} from '../../network/error-parsing';
+import {isString} from 'lodash/lang';
+
const ALL = 'ALL';
const STAR = '*';
@@ -67,7 +69,7 @@ module.exports = function searchActionBuilder(config){
group: groupingKey || ''
};
//Different call depending on the scope.
- if(scope && scope.toUpperCase() === ALL) {
+ if(isString(scope) && scope.toUpperCase() === ALL) {
//Call the search action.
config.service.unscoped({urlData: urlData, data: postData})
.then(_parser.unscopedResponse) | take pierr s comments in account | KleeGroup_focus-core | train | js |
6289188091f032526617a3071accce0ab9ddb1d1 | diff --git a/controller/api/models.py b/controller/api/models.py
index <HASH>..<HASH> 100644
--- a/controller/api/models.py
+++ b/controller/api/models.py
@@ -863,7 +863,12 @@ def _etcd_publish_domains(**kwargs):
def _etcd_purge_domains(**kwargs):
app = kwargs['instance'].app
- _etcd_client.delete('/deis/domains/{}'.format(app))
+ app_domains = app.domain_set.all()
+ if app_domains:
+ _etcd_client.write('/deis/domains/{}'.format(app),
+ ' '.join(str(d.domain) for d in app_domains))
+ else:
+ _etcd_client.delete('/deis/domains/{}'.format(app))
# Log significant app-related events | fix(controller): handle partial deletion of domains | deis_deis | train | py |
aaf91727b4489ec4e83b697263453cb1c51973f0 | diff --git a/lib/dassets/version.rb b/lib/dassets/version.rb
index <HASH>..<HASH> 100644
--- a/lib/dassets/version.rb
+++ b/lib/dassets/version.rb
@@ -1,3 +1,3 @@
module Dassets
- VERSION = "0.4.1"
+ VERSION = "0.5.0"
end | version to <I>
* more forgiving Dassets initialization (#<I>) | redding_dassets | train | rb |
816230e584686345a4c73ec59d7aee1607e204c9 | diff --git a/lib/utilities.js b/lib/utilities.js
index <HASH>..<HASH> 100644
--- a/lib/utilities.js
+++ b/lib/utilities.js
@@ -1,6 +1,6 @@
const getQuasiValue = ({ value }) => {
if (value && typeof value === 'object') {
- return value.raw.trim()
+ return value.raw.trimRight()
}
return ''
diff --git a/tests/lib/rules/uses-vars.js b/tests/lib/rules/uses-vars.js
index <HASH>..<HASH> 100644
--- a/tests/lib/rules/uses-vars.js
+++ b/tests/lib/rules/uses-vars.js
@@ -105,6 +105,19 @@ ruleTester.run('rule "uses-vars" (no-unused-vars)', ruleNoUnusedVars, {
\`
`,
},
+ {
+ code: `
+ /* eslint uses-vars: 1 */
+ pug\`
+ if true
+ = first
+ else if true
+ = second
+ else
+ = third
+ \`
+ `,
+ },
],
invalid: [
{ | Add supporting of more than one roots in template | ezhlobo_eslint-plugin-react-pug | train | js,js |
a715f46c9cc0022b5f412883360a448198aec0c1 | diff --git a/spec/uia/element_spec.rb b/spec/uia/element_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/uia/element_spec.rb
+++ b/spec/uia/element_spec.rb
@@ -127,7 +127,7 @@ describe Uia::Element do
end
end
- context '#select' do
+ context '#filter' do
context 'control_type' do
When(:buttons) { element.filter(control_type: :radio_button) }
Then { buttons.map(&:control_type) == [:radio_button] * 3 } | rename #filter spec appropriately | northwoodspd_uia | train | rb |
ae3bdabac28e897f4888f8c11526a6f170606247 | diff --git a/hazelcast/src/main/java/com/hazelcast/map/MapContainer.java b/hazelcast/src/main/java/com/hazelcast/map/MapContainer.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/map/MapContainer.java
+++ b/hazelcast/src/main/java/com/hazelcast/map/MapContainer.java
@@ -35,7 +35,6 @@ import com.hazelcast.nio.serialization.Data;
import com.hazelcast.query.impl.IndexService;
import com.hazelcast.spi.NodeEngine;
import com.hazelcast.util.ExceptionUtil;
-import com.hazelcast.util.UuidUtil;
import com.hazelcast.wan.WanReplicationPublisher;
import com.hazelcast.wan.WanReplicationService;
@@ -248,13 +247,17 @@ public class MapContainer extends MapContainerSupport {
}
public String addInterceptor(MapInterceptor interceptor) {
- String id = UuidUtil.buildRandomUuidString();
- interceptorMap.put(id, interceptor);
- interceptors.add(interceptor);
+ String id = interceptor.getClass().getName();
+
+ addInterceptor(id, interceptor);
+
return id;
}
public void addInterceptor(String id, MapInterceptor interceptor) {
+
+ removeInterceptor(id);
+
interceptorMap.put(id, interceptor);
interceptors.add(interceptor);
} | fix for issues #<I> and #<I> | hazelcast_hazelcast | train | java |
053608df09e280aa1098e71486c13b78f43deb1e | diff --git a/test/Runner/MediaInfoCommandRunnerTest.php b/test/Runner/MediaInfoCommandRunnerTest.php
index <HASH>..<HASH> 100644
--- a/test/Runner/MediaInfoCommandRunnerTest.php
+++ b/test/Runner/MediaInfoCommandRunnerTest.php
@@ -126,7 +126,7 @@ class MediaInfoCommandRunnerTest extends \PHPUnit_Framework_TestCase
// do some stuff in between, count to 5
$i = 0;
do {
- ++$i;
+ $i++;
} while ($i < 5);
// block and complete operation | Apply fixes from StyleCI (#<I>) | mhor_php-mediainfo | train | php |
d57a5bad4b3d19128af6e3f2acc18026473ee2ab | diff --git a/bokeh/charts/donut.py b/bokeh/charts/donut.py
index <HASH>..<HASH> 100644
--- a/bokeh/charts/donut.py
+++ b/bokeh/charts/donut.py
@@ -18,14 +18,10 @@ It also add a new chained stacked method.
#-----------------------------------------------------------------------------
from math import pi, cos, sin
-import numpy as np
import pandas as pd
from ._chartobject import ChartObject, DataAdapter
-from .bar import Bar
-from ..objects import ColumnDataSource, FactorRange, Range1d, DataRange1d
-from bokeh.glyphs import Wedge, AnnularWedge, ImageURL, Text
-from bokeh.colors import Color
+from ..objects import ColumnDataSource, Range1d
#-----------------------------------------------------------------------------
# Classes and functions | clean Donut code (unused imports) | bokeh_bokeh | train | py |
3affe78cda8259242bba77a8ab8973347c827ef8 | diff --git a/src/java/org/apache/cassandra/db/Table.java b/src/java/org/apache/cassandra/db/Table.java
index <HASH>..<HASH> 100644
--- a/src/java/org/apache/cassandra/db/Table.java
+++ b/src/java/org/apache/cassandra/db/Table.java
@@ -121,15 +121,6 @@ public class Table
return Collections.unmodifiableCollection(columnFamilyStores.values());
}
- public ColumnFamilyStore getColumnFamilyStore(int cfId)
- {
- return columnFamilyStores.get(cfId);
- }
-
- /**
- * @Deprecated Use getColumnFamilyStore(id) instead.
- */
- @Deprecated
public ColumnFamilyStore getColumnFamilyStore(String cfName)
{
Integer id = CFMetaData.getId(name, cfName); | remove T.getCFS(id). Patch by Gary Dusbabek, reviewed by Stu Hood. CASSANDRA-<I>
git-svn-id: <URL> | Stratio_stratio-cassandra | train | java |
85c904e95292570376dad94325f6d1a46c4d643e | diff --git a/src/Event/BeforeEntityDeletedEvent.php b/src/Event/BeforeEntityDeletedEvent.php
index <HASH>..<HASH> 100644
--- a/src/Event/BeforeEntityDeletedEvent.php
+++ b/src/Event/BeforeEntityDeletedEvent.php
@@ -7,6 +7,8 @@ namespace EasyCorp\Bundle\EasyAdminBundle\Event;
*/
final class BeforeEntityDeletedEvent
{
+ use StoppableEventTrait;
+
private $entityInstance;
public function __construct($entityInstance) | Add missing isPropagationStopped to BeforeEntityDeletedEvent | EasyCorp_EasyAdminBundle | train | php |
e2bd4a255d901f6e267f4f26955dc1f1d2126d19 | diff --git a/lib/podio/models/item.rb b/lib/podio/models/item.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/models/item.rb
+++ b/lib/podio/models/item.rb
@@ -88,8 +88,10 @@ class Podio::Item < ActivePodio::Base
class << self
# @see https://developers.podio.com/doc/items/get-item-22360
- def find(id)
- member Podio.connection.get("/item/#{id}").body
+ def find(id, options = {})
+ member Podio.connection.get { |req|
+ req.url("/item/#{id}", options)
+ }.body
end
def find_by_app_item_id(app_id, app_item_id) | Added support for supplying options to Item.find | podio_podio-rb | train | rb |
5673cb4936cd149c1848df160045feeadcb17103 | diff --git a/test/integration_test.py b/test/integration_test.py
index <HASH>..<HASH> 100644
--- a/test/integration_test.py
+++ b/test/integration_test.py
@@ -59,6 +59,7 @@ class IntegrationTests(BaseIntegrationTest):
def test_integration_default(self):
self._run(private_token=None, **self.default_kwargs)
+ @skipUnlessModule("pycurl")
def test_integration_curl(self):
self._run(private_token=None, transport="curl", **self.default_kwargs) | Skip curl integration test if pycurl cannot be imported. | galaxyproject_pulsar | train | py |
43f55d6a54b329ad13e2837db37863425b4b03fe | diff --git a/tools/c7n_mailer/c7n_mailer/utils.py b/tools/c7n_mailer/c7n_mailer/utils.py
index <HASH>..<HASH> 100644
--- a/tools/c7n_mailer/c7n_mailer/utils.py
+++ b/tools/c7n_mailer/c7n_mailer/utils.py
@@ -58,6 +58,7 @@ def get_rendered_jinja(target, sqs_message, resources, logger):
recipient=target,
resources=resources,
account=sqs_message.get('account', ''),
+ account_id=sqs_message.get('account_id', ''),
event=sqs_message.get('event', None),
action=sqs_message['action'],
policy=sqs_message['policy'],
@@ -85,6 +86,7 @@ def get_message_subject(sqs_message):
jinja_template = jinja2.Template(subject)
subject = jinja_template.render(
account=sqs_message.get('account', ''),
+ account_id=sqs_message.get('account_id', ''),
region=sqs_message.get('region', '')
)
return subject | tools/c7n_mailer - add account_id to template variables. (#<I>) | cloud-custodian_cloud-custodian | train | py |
e198dffcaff1ae25e5a2f03c43bcbf57df0967aa | diff --git a/src/main/java/spark/HaltException.java b/src/main/java/spark/HaltException.java
index <HASH>..<HASH> 100644
--- a/src/main/java/spark/HaltException.java
+++ b/src/main/java/spark/HaltException.java
@@ -30,18 +30,21 @@ public class HaltException extends RuntimeException {
private String body = null;
HaltException() {
- super();
+ super(null, null, false, false);
}
HaltException(int statusCode) {
+ this();
this.statusCode = statusCode;
}
HaltException(String body) {
+ this();
this.body = body;
}
HaltException(int statusCode, String body) {
+ this();
this.statusCode = statusCode;
this.body = body;
} | HaltException: disable stack traces and suppression. (#<I>) | perwendel_spark | train | java |
778340abd52ff87da2dff20ce4bb197595e40176 | diff --git a/mtools/mloginfo/sections/query_section.py b/mtools/mloginfo/sections/query_section.py
index <HASH>..<HASH> 100644
--- a/mtools/mloginfo/sections/query_section.py
+++ b/mtools/mloginfo/sections/query_section.py
@@ -64,7 +64,7 @@ class QuerySection(BaseSection):
# no queries in the log file
if len(grouping) < 1:
- raise SystemExit('nothing to print.')
+ return
titles = ['namespace', 'pattern', 'count', 'min (ms)', 'max (ms)', 'mean (ms)', '95%-ile (ms)', 'sum (ms)']
table_rows = [] | don't exit if queries are not found in log file. see #<I> | rueckstiess_mtools | train | py |
ca8cb06493ad73a87c3614a4586ed3cb731844f4 | diff --git a/Module.php b/Module.php
index <HASH>..<HASH> 100644
--- a/Module.php
+++ b/Module.php
@@ -91,7 +91,7 @@ class Module
//Logout if requested
if (!empty($_GET['logout'])) {
$session->destroy();
- header('Location: \\');
+ header('Location: /');
exit;
}
} | add vip cart adder, fix logout url issue | reliv_Rcm | train | php |
853a15614724086145467ea264674f02ca0766ab | diff --git a/value.go b/value.go
index <HASH>..<HASH> 100644
--- a/value.go
+++ b/value.go
@@ -363,10 +363,11 @@ func (v *Value) Iterate(fn func(idx, count int, key, value *Value) bool, empty f
}
return // done
case reflect.String:
- runeCount := v.getResolvedValue().Len()
- if runeCount > 0 {
- for i := 0; i < runeCount; i++ {
- if !fn(i, runeCount, &Value{v.getResolvedValue().Slice(i, i+1)}, nil) {
+ // TODO: Not utf8-compatible (utf8-decoding neccessary)
+ charCount := v.getResolvedValue().Len()
+ if charCount > 0 {
+ for i := 0; i < charCount; i++ {
+ if !fn(i, charCount, &Value{v.getResolvedValue().Slice(i, i+1)}, nil) {
return
}
} | TODO: String slicing still not utf8-compatible yet. | flosch_pongo2 | train | go |
0e905e3609236e665836b39f92692673e810dda8 | diff --git a/src/Adapter/CPDF.php b/src/Adapter/CPDF.php
index <HASH>..<HASH> 100644
--- a/src/Adapter/CPDF.php
+++ b/src/Adapter/CPDF.php
@@ -113,7 +113,7 @@ class CPDF implements Canvas
/**
* Instance of Cpdf class
*
- * @var Cpdf
+ * @var \Dompdf\Cpdf
*/
protected $_pdf;
@@ -203,11 +203,11 @@ class CPDF implements Canvas
$this->_pdf = new \Dompdf\Cpdf(
$size,
true,
- $dompdf->getOptions()->getFontCache(),
- $dompdf->getOptions()->getTempDir()
+ $this->_dompdf->getOptions()->getFontCache(),
+ $this->_dompdf->getOptions()->getTempDir()
);
- $this->_pdf->addInfo("Producer", sprintf("%s + CPDF", $dompdf->version));
+ $this->_pdf->addInfo("Producer", sprintf("%s + CPDF", $this->_dompdf->version));
$time = substr_replace(date('YmdHisO'), '\'', -2, 0) . '\'';
$this->_pdf->addInfo("CreationDate", "D:$time");
$this->_pdf->addInfo("ModDate", "D:$time"); | Fix instantiating CPDF Adapter without Dompdf | dompdf_dompdf | train | php |
b4b44862576c4da456f855fdfb71cfae1a074527 | diff --git a/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php b/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php
index <HASH>..<HASH> 100644
--- a/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php
+++ b/src/Tokenizer/Analyzer/Analysis/TypeAnalysis.php
@@ -33,7 +33,7 @@ final class TypeAnalysis implements StartEndTokenAwareAnalysis
'bool',
'callable',
'int',
- 'iteratable',
+ 'iterable',
'float',
'mixed',
'numeric',
diff --git a/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php b/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php
index <HASH>..<HASH> 100644
--- a/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php
+++ b/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php
@@ -68,7 +68,7 @@ final class TypeAnalysisTest extends TestCase
['bool', true],
['callable', true],
['int', true],
- ['iteratable', true],
+ ['iterable', true],
['float', true],
['mixed', true],
['numeric', true], | Fix iterable not being detected as a reserved type in TypeAnalysis | FriendsOfPHP_PHP-CS-Fixer | train | php,php |
3a45cadeb34ad808c4bc0cb7a9a8465ae78947df | diff --git a/src/pouch.replicate.js b/src/pouch.replicate.js
index <HASH>..<HASH> 100644
--- a/src/pouch.replicate.js
+++ b/src/pouch.replicate.js
@@ -43,6 +43,12 @@ if (typeof module !== 'undefined' && module.exports) {
var diff = {};
diff[change.id] = change.changes.map(function(x) { return x.rev; });
target.revsDiff(diff, function(err, diffs) {
+ if (err) {
+ if (continuous)
+ replicateRet.cancel();
+ call(callback, err, null);
+ return;
+ }
if (Object.keys(diffs).length === 0) {
pending--;
isCompleted(); | Catch errors retrieving revisions during replication | pouchdb_pouchdb | train | js |
f9205cd3210ca6ba6503319f50982a73211572cc | diff --git a/test/glassfish/tasks/base_task_test.rb b/test/glassfish/tasks/base_task_test.rb
index <HASH>..<HASH> 100644
--- a/test/glassfish/tasks/base_task_test.rb
+++ b/test/glassfish/tasks/base_task_test.rb
@@ -117,6 +117,9 @@ class Redfish::Tasks::Glassfish::BaseTaskTest < Redfish::TestCase
data['config'] = {}
data['config']['diff_on_completion'] = false
+ data['domain'] ||= {}
+
+ data['jvm_options'] ||= {}
data['jvm_options']['managed'] = true
Redfish::Interpreter::PreInterpreter.mark_as_unmanaged(data) if add_excludes_unless_defined | Make sure configuration for domain and jvm_properties exists | realityforge_redfish | train | rb |
171c400d5e8d88e2ceb81e0ce78fc6cf105582de | diff --git a/money.js b/money.js
index <HASH>..<HASH> 100644
--- a/money.js
+++ b/money.js
@@ -6,7 +6,7 @@
if (typeof exports !== "undefined") {
- var BigInteger = require("jsbn");
+ var BigInteger = require("jsbn").BigInteger;
factory(root, exports, BigInteger);
} else {
var BigInt = root.BigInteger ? root.BigInteger : root.jsbn.BigInteger; | Change to the new jsbn API | ikr_money-math | train | js |
cbcbdb16afe074bdadfc90efa6144e6b1256b269 | diff --git a/lib/rest_adapter.rb b/lib/rest_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/rest_adapter.rb
+++ b/lib/rest_adapter.rb
@@ -1,5 +1,5 @@
require 'rubygems'
-gem 'dm-core', '=0.9.1'
+gem 'dm-core', '=0.9.2'
require 'dm-core'
require 'extlib'
require 'dm-serializer' | Upgrading to <I> -- here comes the pain | datamapper_dm-rest-adapter | train | rb |
24dab21fdb658cd28c04bb668fb6d6d0be9043b6 | diff --git a/src/ChunkReader.php b/src/ChunkReader.php
index <HASH>..<HASH> 100644
--- a/src/ChunkReader.php
+++ b/src/ChunkReader.php
@@ -78,14 +78,14 @@ class ChunkReader
});
}
+ $jobs->push($afterImportJob);
+
if ($import instanceof ShouldQueue) {
return new PendingDispatch(
(new QueueImport($import))->chain($jobs->toArray())
);
}
- $jobs->push($afterImportJob);
-
$jobs->each(function ($job) {
try {
dispatch_now($job); | Fixes #<I> (#<I>) | Maatwebsite_Laravel-Excel | train | php |
bad33da5620f14fe56825dce37af868592cb30c5 | diff --git a/tweepy/streaming.py b/tweepy/streaming.py
index <HASH>..<HASH> 100644
--- a/tweepy/streaming.py
+++ b/tweepy/streaming.py
@@ -404,7 +404,7 @@ class Stream(object):
self._start(async)
def filter(self, follow=None, track=None, async=False, locations=None,
- stall_warnings=False, languages=None, encoding='utf8'):
+ stall_warnings=False, languages=None, encoding='utf8', filter_level=None):
self.body = {}
self.session.headers['Content-type'] = "application/x-www-form-urlencoded"
if self.running:
@@ -423,6 +423,8 @@ class Stream(object):
self.body['stall_warnings'] = stall_warnings
if languages:
self.body['language'] = u','.join(map(str, languages))
+ if filter_level:
+ self.body['filter_level'] = filter_level
self.session.params = {'delimited': 'length'}
self.host = 'stream.twitter.com'
self._start(async) | Added basic support for filter_level parameter for the streaming API | tweepy_tweepy | train | py |
8bc043065a8d7d50861cb2d2dcf15cf10297a7c4 | diff --git a/PHPCI/Command/RunCommand.php b/PHPCI/Command/RunCommand.php
index <HASH>..<HASH> 100644
--- a/PHPCI/Command/RunCommand.php
+++ b/PHPCI/Command/RunCommand.php
@@ -68,7 +68,7 @@ class RunCommand extends Command
// For verbose mode we want to output all informational and above
// messages to the symphony output interface.
- if ($input->getOption('verbose')) {
+ if ($input->hasOption('verbose')) {
$this->logger->pushHandler(
new OutputLogHandler($this->output, Logger::INFO)
); | Check for option verbose instead of get it.
This avoid crashing when called by daemonise command. | dancryer_PHPCI | train | php |
0f59ccfc06e182d39005aeecb53caefb2f834e2c | diff --git a/src/actions/utils/middleware/log.js b/src/actions/utils/middleware/log.js
index <HASH>..<HASH> 100644
--- a/src/actions/utils/middleware/log.js
+++ b/src/actions/utils/middleware/log.js
@@ -13,7 +13,8 @@ const blacklist = [
"MAP_SCOPES",
"MAP_FRAMES",
"ADD_SCOPES",
- "IN_SCOPE_LINES"
+ "IN_SCOPE_LINES",
+ "REMOVE_BREAKPOINT"
];
function cloneAction(action) { | [mochi] stop logging remove breakpoint data (#<I>) | firefox-devtools_debugger | train | js |
46ccde79a80c5a1d9181cc0d1b29c48a7ceebc93 | diff --git a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/GetViewDefinitionGeneratorDB2.java b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/GetViewDefinitionGeneratorDB2.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/GetViewDefinitionGeneratorDB2.java
+++ b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/GetViewDefinitionGeneratorDB2.java
@@ -27,7 +27,7 @@ public class GetViewDefinitionGeneratorDB2 extends GetViewDefinitionGenerator {
if (database instanceof Db2zDatabase) {
return new Sql[] {
- new UnparsedSql("select STATEMENT AS view_definition from SYSIBM.SYSVIEWS where NAME='" + statement.getViewName() + "' and (PATHSCHEMAS LIKE '%" + schema.getSchemaName() + "%' OR CREATOR = '" + schema.getSchemaName() + "')")
+ new UnparsedSql("select STATEMENT AS view_definition from SYSIBM.SYSVIEWS where NAME='" + statement.getViewName() + "' and CREATOR = '" + schema.getSchemaName() + "'")
};
}
return new Sql[] { | Fix query for snapshotting views on DB2/Z (#<I>)
DB2/Z: The view definition may only be fetched by the name and creator. The search with PATHSCHEMAS is ambiguous and may lead to multiple results.
Fix issue <I> | liquibase_liquibase | train | java |
8528e1f97ba6d9df56341257933036ef72e966f7 | diff --git a/ramda.js b/ramda.js
index <HASH>..<HASH> 100644
--- a/ramda.js
+++ b/ramda.js
@@ -385,9 +385,6 @@
}
if (arglen < 2) {
return function _merge(list2) {
- if (arguments.length < 1) {
- return _merge;
- }
return (isEmpty(list1)) ? clone(list2) : list1.concat(list2);
};
}
@@ -1699,19 +1696,7 @@
// Returns a function that when supplied an object returns the indicated property of that object, if it exists.
var prop = R.prop = function (p, obj) {
- var arglen = arguments.length;
- if (arglen < 1) {
- return prop;
- }
- if (arglen < 2) {
- return function _prop(obj) {
- if (arguments.length < 1) {
- return _prop;
- }
- return obj[p];
- };
- }
- return obj[p];
+ return arguments.length < 2 ? function (obj) { return obj[p]; } : obj[p];
};
aliasFor("prop").is("get"); // TODO: are we sure? Matches some other libs, but might want to reserve for other use. | revise some 2ary fns | ramda_ramda | train | js |
caef0bf262a53072b6700a84b87a9e40f3a75e90 | diff --git a/lib/merb-core/plugins.rb b/lib/merb-core/plugins.rb
index <HASH>..<HASH> 100644
--- a/lib/merb-core/plugins.rb
+++ b/lib/merb-core/plugins.rb
@@ -1,5 +1,5 @@
module Merb
-
+
module Plugins
# ==== Returns
@@ -9,17 +9,29 @@ module Merb
def self.config
@config ||= File.exists?(Merb.root / "config" / "plugins.yml") ? YAML.load(File.read(Merb.root / "config" / "plugins.yml")) || {} : {}
end
-
+
# ==== Returns
- # Array:: All Rakefiles for plugins.
+ # Array(String):: All Rakefile load paths Merb uses for plugins.
def self.rakefiles
Merb.rakefiles
end
# ==== Parameters
# *rakefiles:: Rakefiles to add to the list of plugin Rakefiles.
+ #
+ # ==== Notes
+ #
+ # This is a recommended way to register your plugin's Raketasks
+ # in Merb.
+ #
+ # ==== Examples
+ # From merb_sequel plugin:
+ #
+ # if defined(Merb::Plugins)
+ # Merb::Plugins.add_rakefiles "merb_sequel" / "merbtasks"
+ # end
def self.add_rakefiles(*rakefiles)
Merb.add_rakefiles *rakefiles
end
end
-end
\ No newline at end of file
+end | Example (from merb_sequel) and corrections to the way Merb finds out plugins Rakefiles. | wycats_merb | train | rb |
f7090e7350d2a816e4ba60d5344b88a92ed84c7d | diff --git a/src/plugins/FakeModal.js b/src/plugins/FakeModal.js
index <HASH>..<HASH> 100644
--- a/src/plugins/FakeModal.js
+++ b/src/plugins/FakeModal.js
@@ -28,6 +28,13 @@ export default class FakeModal extends Plugin {
}
prepareTarget (callerPlugin) {
+ console.log(callerPlugin.type)
+
+ if (callerPlugin.type !== 'selecter' || callerPlugin.type !== 'progress') {
+ this.core.log('Error: Modal can only be used by plugins of type `selecter` or `progress`')
+ return
+ }
+
const callerPluginName = callerPlugin.constructor.name
// add tab panel
@@ -56,8 +63,6 @@ export default class FakeModal extends Plugin {
</a></li>
`
- console.log('yoyoyoyoy')
-
this.initEvents()
return document.querySelector(`#${callerPluginName}`) | Make sure that only selecter or progress can access modal | transloadit_uppy | train | js |
1b7f398448563c7584487a4a43a050c8b3af59ea | diff --git a/src/Rules.php b/src/Rules.php
index <HASH>..<HASH> 100644
--- a/src/Rules.php
+++ b/src/Rules.php
@@ -74,21 +74,6 @@ class Rules implements \ArrayAccess, \IteratorAggregate
protected $filter = array();
/**
- * @var Rules
- */
- protected static $_rules;
-
- /**
- * @var string
- */
- protected static $locale = 'en';
-
- /**
- * @var string
- */
- protected static $dir;
-
- /**
* @var string
*/
private $type;
@@ -102,13 +87,10 @@ class Rules implements \ArrayAccess, \IteratorAggregate
*/
public function __construct($locale = null, $dir = null)
{
- if (!$locale) {
- $locale = static::$locale;
- }
- if (!$dir) {
- $dir = static::$dir ?: __DIR__ . '/Locale/';
- }
- $dir .= $locale . '/';
+ $locale = $locale ?: 'en';
+ $dir = $dir ?: __DIR__ . '/Locale/';
+ $dir .= $locale . '/';
+
/** @noinspection PhpIncludeInspection */
$this->baseFilters = include($dir . "validation.filters.php");
$this->filter = $this->baseFilters; | removing static properties and methods from Rules class. | WScore_Validation | train | php |
5a6ecee200956677a80f0c00241aa1ea4f369cd8 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -22,6 +22,8 @@ require 'capybara/rspec'
require 'capybara/rails'
require 'mocha'
+Resque.inline = Rails.env.test?
+
FactoryGirl.definition_file_paths = [File.expand_path("../factories", __FILE__)]
FactoryGirl.find_definitions | Run resque jobs synchronously for testing | samvera_hyrax | train | rb |
b8155bd5bead29bf116aeea9159563e1a6409c41 | diff --git a/cli/command/formatter/disk_usage.go b/cli/command/formatter/disk_usage.go
index <HASH>..<HASH> 100644
--- a/cli/command/formatter/disk_usage.go
+++ b/cli/command/formatter/disk_usage.go
@@ -26,7 +26,7 @@ const (
uniqueSizeHeader = "UNIQUE SiZE"
)
-// DiskUsageContext contains disk usage specific information required by the formater, encapsulate a Context struct.
+// DiskUsageContext contains disk usage specific information required by the formatter, encapsulate a Context struct.
type DiskUsageContext struct {
Context
Verbose bool
diff --git a/cli/command/formatter/image.go b/cli/command/formatter/image.go
index <HASH>..<HASH> 100644
--- a/cli/command/formatter/image.go
+++ b/cli/command/formatter/image.go
@@ -20,7 +20,7 @@ const (
digestHeader = "DIGEST"
)
-// ImageContext contains image specific information required by the formater, encapsulate a Context struct.
+// ImageContext contains image specific information required by the formatter, encapsulate a Context struct.
type ImageContext struct {
Context
Digest bool | correct all the formate to formatter | moby_moby | train | go,go |
3ba7268f0886465d967629492fd56946d6996ebb | diff --git a/attack.go b/attack.go
index <HASH>..<HASH> 100644
--- a/attack.go
+++ b/attack.go
@@ -139,7 +139,7 @@ func attack(opts *attackOpts) (err error) {
res := atk.Attack(tr, opts.rate, opts.duration)
enc := gob.NewEncoder(out)
sig := make(chan os.Signal, 1)
- signal.Notify(sig, os.Interrupt, os.Kill)
+ signal.Notify(sig, os.Interrupt)
for {
select {
diff --git a/report.go b/report.go
index <HASH>..<HASH> 100644
--- a/report.go
+++ b/report.go
@@ -52,7 +52,7 @@ func report(reporter, inputs, output string) error {
var results vegeta.Results
res, errs := vegeta.Collect(srcs...)
sig := make(chan os.Signal, 1)
- signal.Notify(sig, os.Interrupt, os.Kill)
+ signal.Notify(sig, os.Interrupt)
outer:
for { | cmds: Don't subscribe to os.Kill signals | tsenart_vegeta | train | go,go |
7fe8cbac7423ddea18354f70e6692d25ff6b8503 | diff --git a/examples/server-kitchen-sink/.storybook/main.js b/examples/server-kitchen-sink/.storybook/main.js
index <HASH>..<HASH> 100644
--- a/examples/server-kitchen-sink/.storybook/main.js
+++ b/examples/server-kitchen-sink/.storybook/main.js
@@ -1,5 +1,5 @@
module.exports = {
- stories: ['../stories/**/*.stories.json'],
+ stories: ['../stories/**/*.stories.@(json|yaml)'],
logLevel: 'debug',
addons: [
'@storybook/addon-docs', | Add `yaml` extension to the stories glob | storybooks_storybook | train | js |
56b26768a2da9b3733d8a82f4a47e049c576855d | diff --git a/bin/runImport.php b/bin/runImport.php
index <HASH>..<HASH> 100644
--- a/bin/runImport.php
+++ b/bin/runImport.php
@@ -21,8 +21,9 @@ $xml = file_get_contents(__DIR__ . '/../tests/shared-fixture/catalog.xml');
$queue->add(new CatalogImportDomainEvent($xml));
$consumer = $factory->createDomainEventConsumer();
-$numberOfMessages = 13;
-$consumer->process($numberOfMessages);
+while ($queue->count() > 0) {
+ $consumer->process(1);
+}
$messages = $factory->getLogger()->getMessages();
if (count($messages)) { | Issue #<I>: Make import script process messages until queue is empty | lizards-and-pumpkins_catalog | train | php |
fcdbab675541895349a90ce4095ffebdbac51746 | diff --git a/classes/fields/currency.php b/classes/fields/currency.php
index <HASH>..<HASH> 100644
--- a/classes/fields/currency.php
+++ b/classes/fields/currency.php
@@ -93,7 +93,8 @@ class PodsField_Currency extends PodsField {
array(
'usd' => '$ (USD)',
'cad' => '$ (CAD)',
- 'euro' => '€ (Euro)'
+ 'euro' => '€ (Euro)',
+ 'gbp' => '£ (GBP)'
)
)
), | Add GBP to built-in currencies for currency field type | pods-framework_pods | train | php |
e0f2478ef431cccb1d30d92d2d0c47d6f195675b | diff --git a/lib/plugins/filter/post_permalink.js b/lib/plugins/filter/post_permalink.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/filter/post_permalink.js
+++ b/lib/plugins/filter/post_permalink.js
@@ -1,6 +1,5 @@
'use strict';
-const defaults = require('lodash/defaults');
const { Permalink, slugize } = require('hexo-util');
const { basename } = require('path');
let permalink;
@@ -33,8 +32,7 @@ function postPermalinkFilter(data) {
const keys = Object.keys(data);
- for (let i = 0, len = keys.length; i < len; i++) {
- const key = keys[i];
+ for (const key of keys) {
if (Object.prototype.hasOwnProperty.call(meta, key)) continue;
// Use Object.getOwnPropertyDescriptor to copy getters to avoid "Maximum call
@@ -42,7 +40,7 @@ function postPermalinkFilter(data) {
Object.defineProperty(meta, key, Object.getOwnPropertyDescriptor(data, key));
}
- return permalink.stringify(defaults(meta, config.permalink_defaults));
+ return permalink.stringify(Object.assign(meta, config.permalink_defaults));
}
module.exports = postPermalinkFilter; | refactor: drop lodash for post_permalink filter (#<I>) | hexojs_hexo | train | js |
ad9f62e9b844e4828240861cd59b8f9288118ca7 | diff --git a/pywal/export_colors.py b/pywal/export_colors.py
index <HASH>..<HASH> 100755
--- a/pywal/export_colors.py
+++ b/pywal/export_colors.py
@@ -25,6 +25,8 @@ def template(colors, input_file):
with open(export_file, "w") as file:
file.write(template_data)
+ print(f"export: Exported {input_file}.")
+
def export_all_templates(colors):
"""Export all template files.""" | general: Added back printing of export. | dylanaraps_pywal | train | py |
4a58c9f6475162e01c179067834711afa9c6de09 | diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/install.py
+++ b/ceph_deploy/install.py
@@ -17,7 +17,7 @@ def sanitize_args(args):
not well suited for.
"""
if args.release is None:
- args.release = 'jewel'
+ args.release = 'luminous'
args.default_release = True
# XXX This whole dance is because --stable is getting deprecated | [RM-<I>] install default to luminous | ceph_ceph-deploy | train | py |
93a29c561c97769b3ab297ebfb5c33b5d0c80b62 | diff --git a/opbeat/contrib/django/middleware/__init__.py b/opbeat/contrib/django/middleware/__init__.py
index <HASH>..<HASH> 100644
--- a/opbeat/contrib/django/middleware/__init__.py
+++ b/opbeat/contrib/django/middleware/__init__.py
@@ -59,7 +59,7 @@ class OpbeatAPMMiddleware(object):
if hasattr(self.thread_local.view_func, '__name__'):
view_name = self.thread_local.view_func.__name__
else: # Fall back if there's no __name__
- view_name = self.thread_local.view_func._class__.__name__
+ view_name = self.thread_local.view_func.__class__.__name__
return "{0}.{1}".format(module, view_name) | Bug in view_name fallback. | elastic_apm-agent-python | train | py |
92fb738d8aabaa477bd9d0d49223f4ae25ecfe7e | diff --git a/core/src/main/java/com/google/errorprone/refaster/ControlFlowVisitor.java b/core/src/main/java/com/google/errorprone/refaster/ControlFlowVisitor.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/errorprone/refaster/ControlFlowVisitor.java
+++ b/core/src/main/java/com/google/errorprone/refaster/ControlFlowVisitor.java
@@ -51,14 +51,14 @@ import javax.lang.model.element.Name;
*
* @author [email protected] (Louis Wasserman)
*/
-class ControlFlowVisitor extends SimpleTreeVisitor<Result, BreakContext> {
+public class ControlFlowVisitor extends SimpleTreeVisitor<Result, BreakContext> {
public static final ControlFlowVisitor INSTANCE = new ControlFlowVisitor();
/**
* The state of whether a sequence of statements may return, break out of the visited statements,
* or neither.
*/
- enum Result {
+ public enum Result {
NEVER_EXITS {
@Override
Result or(Result other) { | Add an analysis of switch statements for research on expression switches.
RELNOTES: n/a
-------------
Created by MOE: <URL> | google_error-prone | train | java |
02d762d2af73badb2d6d936cb64f2d0fcbf62a74 | diff --git a/biojava3-genome/src/main/java/org/biojava3/genome/parsers/gff/FeatureList.java b/biojava3-genome/src/main/java/org/biojava3/genome/parsers/gff/FeatureList.java
index <HASH>..<HASH> 100644
--- a/biojava3-genome/src/main/java/org/biojava3/genome/parsers/gff/FeatureList.java
+++ b/biojava3-genome/src/main/java/org/biojava3/genome/parsers/gff/FeatureList.java
@@ -236,6 +236,8 @@ public class FeatureList extends ArrayList<FeatureI> {
/**
* Create a list of all features that include the specified attribute key/value pair.
+ * This method now properly supports adding the index before or after adding the features.
+ * Adding features, then then index, then more features is still not supported.
*
* @param key The key to consider.
* @param value The value to consider. | Update method comment to indicate legal calling sequences for using
attribute features. | biojava_biojava | train | java |
2af475d9a2dec911d3515bd111d70416a13a8d00 | diff --git a/jax/_src/numpy/lax_numpy.py b/jax/_src/numpy/lax_numpy.py
index <HASH>..<HASH> 100644
--- a/jax/_src/numpy/lax_numpy.py
+++ b/jax/_src/numpy/lax_numpy.py
@@ -850,7 +850,7 @@ def fmod(x1, x2):
_check_arraylike("fmod", x1, x2)
if issubdtype(_dtype(x1, x2), integer):
x2 = where(x2 == 0, 1, x2)
- return lax.rem(*_promote_args(np.fmod, x1, x2))
+ return lax.rem(*_promote_args("fmod", x1, x2))
@_wraps(np.cbrt) | Cleanup: pass function name rather than function object | tensorflow_probability | train | py |
cd3051f0e6657fd39e5c221568d1c73898295083 | diff --git a/lib/panda/base.rb b/lib/panda/base.rb
index <HASH>..<HASH> 100644
--- a/lib/panda/base.rb
+++ b/lib/panda/base.rb
@@ -38,6 +38,10 @@ module Panda
create || errors.last.raise!
end
+ def to_json
+ attributes.to_json
+ end
+
private
def load(attributes) | Adding to_json method which returns only a json of attributes | pandastream_panda_gem | train | rb |
2c81b6fbcba65173c247cafe0f016495f060730b | diff --git a/lib/perpetuity/postgres/serialized_data.rb b/lib/perpetuity/postgres/serialized_data.rb
index <HASH>..<HASH> 100644
--- a/lib/perpetuity/postgres/serialized_data.rb
+++ b/lib/perpetuity/postgres/serialized_data.rb
@@ -31,6 +31,17 @@ module Perpetuity
combined
end
+
+ def any?
+ values.any?
+ end
+
+ def map
+ data = values.first
+ mapped = Array.new(column_names.size)
+ column_names.each_with_index { |column, index| mapped[index] = yield(column, data[index]) }
+ mapped
+ end
end
end
end
diff --git a/spec/perpetuity/postgres/serialized_data_spec.rb b/spec/perpetuity/postgres/serialized_data_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/perpetuity/postgres/serialized_data_spec.rb
+++ b/spec/perpetuity/postgres/serialized_data_spec.rb
@@ -38,6 +38,15 @@ module Perpetuity
serialized_multiple.to_s.should == "(name,age) VALUES ('Jamie',31),('Jessica',23),('Kevin',22)"
end
end
+
+ it 'checks whether there are any objects' do
+ serialized.any?.should be_true
+ end
+
+ it 'maps values like a hash' do
+ serialized.map { |attr, value| [attr, value] }.should ==
+ [['name', "'Jamie'"], ['age', 31]]
+ end
end
end
end | Add #map and #any? to Postgres::SerializedData
Ideally, it should be fully Enumerable-compliant. Maybe later. | jgaskins_perpetuity-postgres | train | rb,rb |
8a24dc0c6d879026011415a2d4d1d80bfe2d7f37 | diff --git a/osbs/api.py b/osbs/api.py
index <HASH>..<HASH> 100644
--- a/osbs/api.py
+++ b/osbs/api.py
@@ -831,6 +831,8 @@ class OSBS(object):
logs = self.get_build_logs(build_id=build_id, follow=follow,
wait_if_missing=wait_if_missing, decode=True)
+ if logs is None:
+ return
if isinstance(logs, GeneratorType):
for entries in logs:
for entry in entries.splitlines():
diff --git a/tests/test_api.py b/tests/test_api.py
index <HASH>..<HASH> 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -947,6 +947,12 @@ class TestOSBS(object):
assert isinstance(content, six.string_types)
assert content == u" líne 1"
+ def test_orchestrator_build_logs_no_logs(self, osbs): # noqa:F811
+ flexmock(osbs).should_receive('get_build_logs').and_return(None)
+ logs = osbs.get_orchestrator_build_logs(TEST_BUILD)
+ assert isinstance(logs, GeneratorType)
+ assert list(logs) == []
+
# osbs is a fixture here
def test_pause_builds(self, osbs): # noqa
osbs.pause_builds() | Check logs is not None before performing string operation | projectatomic_osbs-client | train | py,py |
fea2ede77472f0a5f5b254f839adf13311e3b6c2 | diff --git a/aws/resource_aws_kinesisanalyticsv2_application.go b/aws/resource_aws_kinesisanalyticsv2_application.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_kinesisanalyticsv2_application.go
+++ b/aws/resource_aws_kinesisanalyticsv2_application.go
@@ -143,6 +143,7 @@ func resourceAwsKinesisAnalyticsV2Application() *schema.Resource {
"application_configuration": {
Type: schema.TypeList,
Optional: true,
+ Computed: true,
MaxItems: 1,
Elem: &schema.Resource{ | r/aws_kinesisanalyticsv2_application: Make 'application_configuration' computed. | terraform-providers_terraform-provider-aws | train | go |
52f4c9bac545b39ea6620b2444f805dabca6ff3a | diff --git a/lib/ruby_speech/grxml/builtins.rb b/lib/ruby_speech/grxml/builtins.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby_speech/grxml/builtins.rb
+++ b/lib/ruby_speech/grxml/builtins.rb
@@ -57,7 +57,7 @@ module RubySpeech::GRXML::Builtins
# @option options [#to_i] :maxlength Maximum length for the string of digits.
# @option options [#to_i] :length Absolute length for the string of digits.
#
- # @return [RubySpeech::GRXML::Grammar] a grammar for interpreting a boolean response.
+ # @return [RubySpeech::GRXML::Grammar] a grammar for interpreting an integer response.
#
# @raise [ArgumentError] if any of the length attributes logically conflict
# | [DOC] update method description for digits builtin | adhearsion_ruby_speech | train | rb |
4452b44b9062f71363d593e7ed506c702722ad63 | diff --git a/examples/ner/run_ner.py b/examples/ner/run_ner.py
index <HASH>..<HASH> 100644
--- a/examples/ner/run_ner.py
+++ b/examples/ner/run_ner.py
@@ -586,6 +586,8 @@ def main():
config = config_class.from_pretrained(
args.config_name if args.config_name else args.model_name_or_path,
num_labels=num_labels,
+ id2label={str(i): label for i, label in enumerate(labels)},
+ label2id={label: i for i, label in enumerate(labels)},
cache_dir=args.cache_dir if args.cache_dir else None,
)
tokenizer = tokenizer_class.from_pretrained( | Labels are now added to model config under id2label and label2id (#<I>) | huggingface_pytorch-pretrained-BERT | train | py |
4e1ba79db476ef7a1a54a38a63620f7c30315abf | diff --git a/backbone.localStorage.js b/backbone.localStorage.js
index <HASH>..<HASH> 100644
--- a/backbone.localStorage.js
+++ b/backbone.localStorage.js
@@ -125,6 +125,8 @@ _.extend(Backbone.LocalStorage.prototype, {
(_.chain || _)(local).keys()
.filter(function (k) { return itemRe.test(k); })
.each(function (k) { local.removeItem(k); });
+
+ this.records.length = 0;
},
// Size of localStorage.
@@ -177,7 +179,7 @@ Backbone.LocalStorage.sync = window.Store.sync = Backbone.localSync = function(m
if (syncDfd) {
syncDfd.resolve(resp);
}
-
+
} else {
errorMessage = errorMessage ? errorMessage
: "Record Not Found"; | empty this.records while cleaning | jeromegn_Backbone.localStorage | train | js |
bd79c1dcb4668a9e9da9a7bf1520b1a275b98f6f | diff --git a/src/Place/MarkAsDuplicateCommandHandler.php b/src/Place/MarkAsDuplicateCommandHandler.php
index <HASH>..<HASH> 100644
--- a/src/Place/MarkAsDuplicateCommandHandler.php
+++ b/src/Place/MarkAsDuplicateCommandHandler.php
@@ -35,6 +35,7 @@ class MarkAsDuplicateCommandHandler extends Udb3CommandHandler
$this->repository->save($placeToMarkAsMaster);
} catch (CannotMarkPlaceAsMaster | CannotMarkPlaceAsDuplicate $e) {
// TODO: rollback transaction
+ throw $e;
}
// TODO: commit transaction | Re-throw exception to make sure we interrupt the flow | cultuurnet_udb3-php | train | php |
8eda30f4210466ca04260ad53d4bdccbe36a6f1f | diff --git a/pylsdj/kit_instrument.py b/pylsdj/kit_instrument.py
index <HASH>..<HASH> 100644
--- a/pylsdj/kit_instrument.py
+++ b/pylsdj/kit_instrument.py
@@ -1,5 +1,4 @@
from instrument import Instrument
-from bread_spec import INSTRUMENT_TYPE_CODE
from instrument_mixins import VibratoMixin
@@ -140,7 +139,7 @@ class KitInstrument(Instrument, VibratoMixin):
self.data.half_speed = value
def import_lsdinst(self, lsdinst_struct):
- super(PulseInstrument, self).import_lsdinst(lsdinst_struct)
+ super(KitInstrument, self).import_lsdinst(lsdinst_struct)
self.volume = lsdinst_struct['data']['volume'] | Fix KitInstrument calling wrong method on invalid superclass. | alexras_pylsdj | train | py |
1b9ef0e52dea6b02ed070092de31422c4b67fe45 | diff --git a/miner/worker.go b/miner/worker.go
index <HASH>..<HASH> 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -263,6 +263,7 @@ func (self *worker) wait() {
}
block := result.Block
+ self.current.state.Sync()
if self.fullValidation {
if _, err := self.chain.InsertChain(types.Blocks{block}); err != nil {
glog.V(logger.Error).Infoln("mining err", err)
@@ -489,7 +490,6 @@ func (self *worker) commitNewWork() {
// commit state root after all state transitions.
core.AccumulateRewards(self.current.state, header, uncles)
current.state.SyncObjects()
- self.current.state.Sync()
header.Root = current.state.Root()
} | miner: moved state sync
Moved the state sync so it only syncs the state when the block mining yield a possitive result | ethereum_go-ethereum | train | go |
338a3e3bc0c3d84fd3fff7db59793a550b02fd04 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -11,6 +11,7 @@ require_relative "helpers/fakefs_helper"
require_relative "helpers/social_snippet_helper"
require "social_snippet/rspec/test_document"
require "social_snippet/rspec/test_storage"
+require "social_snippet/rspec/test_driver"
RSpec.configure do |config|
config.before(:example, :without_fakefs => true) do | test: load rspec/test_driver | social-snippet_social-snippet | train | rb |
3a7f0eadb6f2e64d8b74b567ae5bc2957c952d2b | diff --git a/dropbox-v2/server-validators/babel_data_types.py b/dropbox-v2/server-validators/babel_data_types.py
index <HASH>..<HASH> 100644
--- a/dropbox-v2/server-validators/babel_data_types.py
+++ b/dropbox-v2/server-validators/babel_data_types.py
@@ -204,7 +204,7 @@ class List(PrimitiveType):
self.max_items = max_items
def validate(self, val):
- if not isinstance(val, types.ListType):
+ if not isinstance(val, list):
raise ValidationError('%r is not a valid list' % val)
elif self.max_items is not None and len(val) > self.max_items:
raise ValidationError('%r has more than %s items' | Changed isinstance() check for lists to use "list" rather than
types.ListType. | dropbox_stone | train | py |
8f36891996d1fc623cb284e7b3c6f787197fd7f9 | diff --git a/packages/ui-link/src/Link/styles.js b/packages/ui-link/src/Link/styles.js
index <HASH>..<HASH> 100644
--- a/packages/ui-link/src/Link/styles.js
+++ b/packages/ui-link/src/Link/styles.js
@@ -79,7 +79,8 @@ const generateStyle = (componentTheme, props, state) => {
? componentTheme.textDecorationWithinText
: componentTheme.textDecorationOutsideText,
'&:focus': {
- color: componentTheme.color
+ color: componentTheme.color,
+ outlineColor: componentTheme.focusOutlineColor
},
'&:hover, &:active': {
color: componentTheme.hoverColor, | fix(ui-link): fix link not displaying outline on focus | instructure_instructure-ui | train | js |
a6d66d60ebd7b988dcca7af49573f8576a7b4905 | diff --git a/lib/types/urlencoded.js b/lib/types/urlencoded.js
index <HASH>..<HASH> 100644
--- a/lib/types/urlencoded.js
+++ b/lib/types/urlencoded.js
@@ -47,7 +47,7 @@ function UrlEncoded(boy, cfg) {
UrlEncoded.prototype.write = function(data, cb) {
if (this._fields === this.fieldsLimit) {
- if (!boy.hitFieldsLimit) {
+ if (!this.boy.hitFieldsLimit) {
this.boy.hitFieldsLimit = true;
this.boy.emit('fieldsLimit');
} | urlencoded: fix reference | mscdex_busboy | train | js |
10dac9149786c6d797fe57bdeee7fa3b8f1e1364 | diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py
index <HASH>..<HASH> 100644
--- a/pylint/__pkginfo__.py
+++ b/pylint/__pkginfo__.py
@@ -57,6 +57,7 @@ classifiers = ['Development Status :: 4 - Beta',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy', | Will support <I> as well | PyCQA_pylint | train | py |
Subsets and Splits