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
|
|---|---|---|---|---|---|
4217eb864ee1acb08968172bb1f94aedbe2faf82
|
diff --git a/lib/unexpectedMessy.js b/lib/unexpectedMessy.js
index <HASH>..<HASH> 100644
--- a/lib/unexpectedMessy.js
+++ b/lib/unexpectedMessy.js
@@ -134,7 +134,7 @@ function getUpgradedBody(message) {
}
}
return body;
-};
+}
function upgradeOrDowngradeMessageBodyToMatchSpecBody(message, spec) {
var messageBody = message.body,
@@ -180,7 +180,7 @@ function upgradeOrDowngradeMessageBodyToMatchSpecBody(message, spec) {
messageBody: messageBody,
specBody: specBody
};
-};
+}
function bufferCanBeInterpretedAsUtf8(buffer) {
// Hack: Since Buffer.prototype.toString('utf-8') is very forgiving, convert the buffer to a string
|
Removed accidentally added unnecessary semicolons.
|
unexpectedjs_unexpected-messy
|
train
|
js
|
6d8fdab2a6032de32c82932e678509bef11f7391
|
diff --git a/python/turbodbc/cursor.py b/python/turbodbc/cursor.py
index <HASH>..<HASH> 100644
--- a/python/turbodbc/cursor.py
+++ b/python/turbodbc/cursor.py
@@ -65,9 +65,7 @@ class Cursor(object):
self.impl.prepare(sql)
if parameters:
buffer = make_parameter_set(self.impl)
- # TODO: The list call here is probably inefficient
- # will go once the translation layer is better
- buffer.add_set(list(parameters))
+ buffer.add_set(parameters)
buffer.flush()
self.impl.execute()
self.rowcount = self.impl.get_row_count()
@@ -86,9 +84,7 @@ class Cursor(object):
if parameters:
buffer = make_parameter_set(self.impl)
for parameter_set in parameters:
- # TODO: The list call here is probably inefficient
- # will go once the translation layer is better
- buffer.add_set(list(parameter_set))
+ buffer.add_set(parameter_set)
buffer.flush()
self.impl.execute()
|
Remove list workaround in cursor (no longer needed because translation layer got better)
|
blue-yonder_turbodbc
|
train
|
py
|
f0a3f30da4bde0d3493f5151e6598cd4405cacb0
|
diff --git a/Command/CreateUserFromCsvCommand.php b/Command/CreateUserFromCsvCommand.php
index <HASH>..<HASH> 100644
--- a/Command/CreateUserFromCsvCommand.php
+++ b/Command/CreateUserFromCsvCommand.php
@@ -87,7 +87,7 @@ class CreateUserFromCsvCommand extends ContainerAwareCommand
//@todo add an authentication source
$userManager = $this->getContainer()->get('claroline.manager.user_manager');
- $userManager->importUsers($users, null, false, function ($message) use ($output) {
+ $userManager->importUsers($users, false, function ($message) use ($output) {
$output->writeln($message);
});
}
|
[CoreBundle] Fixing command line csv import logs.
|
claroline_Distribution
|
train
|
php
|
0d56beba0a82e1bbf4873ec47c0d36f6196ecd69
|
diff --git a/web/webkit/src/main/resources/toserve/lift.js b/web/webkit/src/main/resources/toserve/lift.js
index <HASH>..<HASH> 100644
--- a/web/webkit/src/main/resources/toserve/lift.js
+++ b/web/webkit/src/main/resources/toserve/lift.js
@@ -619,7 +619,7 @@
},
extend: function(obj1, obj2) {
for (var item in obj2) {
- if (hasOwnProperty.call(obj2, item) {
+ if (hasOwnProperty.call(obj2, item)) {
obj1[item] = obj2[item];
}
}
|
A missing paren is what you get when you don't test >_>
|
lift_framework
|
train
|
js
|
3ed9fa3e2cfaba90f654a2f7876d47cf4ddfe1d9
|
diff --git a/dipper/models/Assoc.py b/dipper/models/Assoc.py
index <HASH>..<HASH> 100644
--- a/dipper/models/Assoc.py
+++ b/dipper/models/Assoc.py
@@ -89,7 +89,7 @@ class Assoc:
#TODO remove this warning, it's annoying
#print("WARN:", self.sub, '+', self.obj, 'has no evidence code')
else:
- self.addEvidence(g,self.annot_id,self.evidence)
+ self.addEvidence(g,self.evidence,self.annot_id)
# Check if publications are in list form
if self.pub_list is not None:
|
fixed addEvidence call (params were in wrong order)
|
monarch-initiative_dipper
|
train
|
py
|
995196eeb1414c334a58d2aed5b6e1dde2c393a3
|
diff --git a/spec/unit/provider_spec.rb b/spec/unit/provider_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/provider_spec.rb
+++ b/spec/unit/provider_spec.rb
@@ -189,12 +189,4 @@ describe Chef::Provider do
end
end
-
- context "when using use_inline_resources" do
- it "should log a deprecation warning" do
- pending Chef::VERSION.start_with?("14.1")
- expect(Chef).to receive(:deprecated).with(:use_inline_resources, kind_of(String))
- Class.new(described_class) { use_inline_resources }
- end
- end
end
|
Remove pending test for use_inline_resources (#<I>)
|
chef_chef
|
train
|
rb
|
a2354ab8422db3394ef3edc6e42e24c144b16cbd
|
diff --git a/structr-ui/src/main/resources/structr/js/elements.js b/structr-ui/src/main/resources/structr/js/elements.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/elements.js
+++ b/structr-ui/src/main/resources/structr/js/elements.js
@@ -380,7 +380,7 @@ var _Elements = {
elementsSlideout.append('<div class="ver-scrollable" id="elementsArea"></div>');
elements = $('#elementsArea', elementsSlideout);
- elements.append('<button class="btn action disabled" id="delete-all-unattached-nodes" disabled>Loading </button>');
+ elements.before('<button class="btn action disabled" id="delete-all-unattached-nodes" disabled>Loading </button>');
var btn = $('#delete-all-unattached-nodes');
Structr.loaderIcon(btn, {
|
Bugfix: Prevent delete button in unused elements from being draggable
|
structr_structr
|
train
|
js
|
ad1818c0eb9eaa5990b00b6ee06236178183c119
|
diff --git a/distob/arrays.py b/distob/arrays.py
index <HASH>..<HASH> 100644
--- a/distob/arrays.py
+++ b/distob/arrays.py
@@ -369,10 +369,11 @@ class DistArray(object):
nonconstant_ix_axes = []
for j in range(idim):
n = distix.shape[j]
- partix = np.split(distix, n, axis=j)
- if not all(np.array_equal(
- partix[0], partix[i]) for i in range(1, n)):
- nonconstant_ix_axes.append(j)
+ if n > 0:
+ partix = np.split(distix, n, axis=j)
+ if not all(np.array_equal(
+ partix[0], partix[i]) for i in range(1, n)):
+ nonconstant_ix_axes.append(j)
if len(nonconstant_ix_axes) <= 1:
# then we can apply the indexing without moving data
if len(nonconstant_ix_axes) is 0:
|
fix edge case of an index array with an axis of length zero
|
mattja_distob
|
train
|
py
|
612766bb91e4018315600efed64b976d584c19cc
|
diff --git a/cumulusci/tasks/salesforce/InstallPackageVersion.py b/cumulusci/tasks/salesforce/InstallPackageVersion.py
index <HASH>..<HASH> 100644
--- a/cumulusci/tasks/salesforce/InstallPackageVersion.py
+++ b/cumulusci/tasks/salesforce/InstallPackageVersion.py
@@ -48,7 +48,7 @@ class InstallPackageVersion(Deploy):
or self.options["namespace"]
)
if "retries" not in self.options:
- self.options["retries"] = 5
+ self.options["retries"] = 10
if "retry_interval" not in self.options:
self.options["retry_interval"] = 5
if "retry_interval_add" not in self.options:
|
Double number of package install retries
|
SFDO-Tooling_CumulusCI
|
train
|
py
|
ab35598e153c891a2401c63e900472bf880ea11d
|
diff --git a/src/java/org/apache/cassandra/cli/CliClient.java b/src/java/org/apache/cassandra/cli/CliClient.java
index <HASH>..<HASH> 100644
--- a/src/java/org/apache/cassandra/cli/CliClient.java
+++ b/src/java/org/apache/cassandra/cli/CliClient.java
@@ -2093,6 +2093,7 @@ public class CliClient extends CliUserHelp
inAgreement = true;
break; // all nodes are in agreement no need to loop
}
+ start = System.currentTimeMillis();
}
if (!inAgreement)
|
Fix Cassandra cli to respect timeout if schema does not settle patch by goffinet; reviewed by jbellis for CASSANDRA-<I>
git-svn-id: <URL>
|
Stratio_stratio-cassandra
|
train
|
java
|
9f13cd403309904915a9b69d9dc85ccede7eebda
|
diff --git a/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/GrammalecteRule.java b/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/GrammalecteRule.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/GrammalecteRule.java
+++ b/languagetool-language-modules/fr/src/main/java/org/languagetool/rules/fr/GrammalecteRule.java
@@ -96,6 +96,7 @@ public class GrammalecteRule extends Rule {
"typo_espace_manquant_après3", // false alarm in file names (e.g. 'La teaser.zip')
"typo_tiret_incise2", // picky
"eepi_écriture_épicène_singulier",
+ "g1__bs_vidéoprotection__b1_a1_1",
"g1__eleu_élisions_manquantes__b1_a1_1" // picky
));
|
[fr] turn off rule considered too political
|
languagetool-org_languagetool
|
train
|
java
|
a7141be6518ddc310f7d3ec3f4672513ba9488ef
|
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index <HASH>..<HASH> 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -597,7 +597,8 @@ def install(name=None,
pkgs=None,
sources=None,
downloadonly=None,
- version=None, **kwargs):
+ version=None,
+ **kwargs):
'''
Install the passed package(s), add refresh=True to run 'zypper refresh'
before package is installed.
|
Put 'kwargs' on its own line according to the common pattern
|
saltstack_salt
|
train
|
py
|
840c1f6135d4c9d3278a3311caaa97b24982024e
|
diff --git a/bin/cli.js b/bin/cli.js
index <HASH>..<HASH> 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -85,6 +85,6 @@ function outputUpgradeWarning (latest) {
'This version is outdated! Latest version: ' + colors.bold.green(latest),
'To upgrade, run: ' + colors.grey('npm install -g ' + pkg.name + '@' + latest)
]
- let warning = format.boxMessage(lines, { borderChar: colors.blue('*') })
+ var warning = format.boxMessage(lines, { borderChar: colors.blue('*') })
winston.warn('\n\n' + warning + '\n')
}
|
change es6 let declaration for var
|
blockchain_service-my-wallet-v3
|
train
|
js
|
9bf82f12921aae17ef321f30eb613aa3678ca513
|
diff --git a/__init__.py b/__init__.py
index <HASH>..<HASH> 100644
--- a/__init__.py
+++ b/__init__.py
@@ -10,4 +10,4 @@ used from a setup script as
__revision__ = "$Id$"
-__version__ = "0.8.1"
+__version__ = "0.8.2"
|
Bumped version to <I>.
|
pypa_setuptools
|
train
|
py
|
c353d92a3cf29ead53c744d7ad264576a2d5aa5a
|
diff --git a/connection/pool.js b/connection/pool.js
index <HASH>..<HASH> 100644
--- a/connection/pool.js
+++ b/connection/pool.js
@@ -287,7 +287,6 @@ function connectionFailureHandler(self, event) {
// Flush all work Items on this connection
while (this.workItems.length > 0) {
var workItem = this.workItems.shift();
- // if(workItem.cb) workItem.cb(err);
if (workItem.cb) workItem.cb(err);
}
diff --git a/wireprotocol/2_6_support.js b/wireprotocol/2_6_support.js
index <HASH>..<HASH> 100644
--- a/wireprotocol/2_6_support.js
+++ b/wireprotocol/2_6_support.js
@@ -106,8 +106,6 @@ WireProtocol.prototype.killCursor = function(bson, ns, cursorState, pool, callba
} catch (err) {
callback(err, null);
}
-
- return;
}
// Callback
|
fix(wire-protocol): <I> killCursor should not way for reply
NODE-<I>
|
mongodb_node-mongodb-native
|
train
|
js,js
|
7f78dc19cb46d5e1858dce7bcdcf557354d4ef51
|
diff --git a/src/Objects/BatchModification.php b/src/Objects/BatchModification.php
index <HASH>..<HASH> 100644
--- a/src/Objects/BatchModification.php
+++ b/src/Objects/BatchModification.php
@@ -43,6 +43,16 @@ class BatchModification
}
/**
+ * Returns the original value of the attribute before modification.
+ *
+ * @return mixed
+ */
+ public function getOriginal()
+ {
+ return $this->original;
+ }
+
+ /**
* Sets the attribute of the modification.
*
* @param string $attribute
@@ -53,6 +63,16 @@ class BatchModification
}
/**
+ * Returns the attribute of the modification.
+ *
+ * @return string
+ */
+ public function getAttribute()
+ {
+ return $this->attribute;
+ }
+
+ /**
* Sets the values of the modification.
*
* @param array $values
@@ -63,6 +83,16 @@ class BatchModification
}
/**
+ * Returns the values of the modification.
+ *
+ * @return array
+ */
+ public function getValues()
+ {
+ return $this->values;
+ }
+
+ /**
* Sets the type of the modification.
*
* @param int $type
@@ -73,6 +103,16 @@ class BatchModification
}
/**
+ * Returns the type of the modification.
+ *
+ * @return int
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
* Builds the current batch modification.
*
* @return void
|
Added getters for attribute, values and type
|
Adldap2_Adldap2
|
train
|
php
|
6c2d16bb3cc378f30065cd8b03f4c8565db07ace
|
diff --git a/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/diagram/ProcessDiagramRetrievalTest.java b/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/diagram/ProcessDiagramRetrievalTest.java
index <HASH>..<HASH> 100644
--- a/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/diagram/ProcessDiagramRetrievalTest.java
+++ b/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/diagram/ProcessDiagramRetrievalTest.java
@@ -193,7 +193,7 @@ public class ProcessDiagramRetrievalTest {
FileUtils.writeStringToFile(htmlFile, html);
fail("The assertions of this test only work if ProcessDiagramRetrievalTest#OVERWRITE_EXPECTED_HTML_FILES is set to false.");
}
- assertEquals(FileUtils.readFileToString(htmlFile), html);
+ assertEquals(FileUtils.readFileToString(htmlFile).replace("\r", ""), html); // remove carriage returns in case the files have been fetched via Git on Windows
}
private static String generateHtmlCode(String imageUrl, Map<String, Bounds> mapOfBoundsForImage, String highlightedActivityId) {
|
Process Diagram API: Removing carriage returns to make the test green when fetched with Git on Windows
|
camunda_camunda-bpm-platform
|
train
|
java
|
eac8c4b692e2142c1be7b1559cc912059fb3d83a
|
diff --git a/parsl/tests/test_ipp/test_multiline_bash.py b/parsl/tests/test_ipp/test_multiline_bash.py
index <HASH>..<HASH> 100644
--- a/parsl/tests/test_ipp/test_multiline_bash.py
+++ b/parsl/tests/test_ipp/test_multiline_bash.py
@@ -35,7 +35,7 @@ def run_test():
outputs=['{0}/hello.txt'.format(outdir),
'{0}/this.txt'.format(outdir),
'{0}/cat.txt'.format(outdir)])
- print(f[0].result())
+ print(f.result())
time.sleep(0.1)
assert 'hello.txt' in os.listdir(outdir), "hello.txt is missing"
|
Fix `'AppFuture' object does not support indexing`
Fixes #<I>.
|
Parsl_parsl
|
train
|
py
|
f10f19c5b898c0ebb2d5ca9a20ef16f9dbb8e509
|
diff --git a/packages/create-powerbi-visual/src/create-powerbi-visual.js b/packages/create-powerbi-visual/src/create-powerbi-visual.js
index <HASH>..<HASH> 100755
--- a/packages/create-powerbi-visual/src/create-powerbi-visual.js
+++ b/packages/create-powerbi-visual/src/create-powerbi-visual.js
@@ -11,8 +11,8 @@ const visualName = process.argv[2];
const BUNDLE_URL = 'https://essexpbipublic.blob.core.windows.net/create-powerbi-visual-bundles/newvizbundle.tar.gz';
const imageFileName = path.join(process.cwd(), "essex-pbi-visual.tar.gz");
const visualPath = path.join(process.cwd(), visualName);
-const visualGuid = Guid.raw().replace("-", "");
-console.log("Creating Essex PowerBI Visual: %s", visualName);
+const visualGuid = Guid.raw().replace(/-/g, '');
+console.log("Creating Essex PowerBI Visual: %s", visualName, visualGuid);
function downloadNewVisualImage() {
return new Promise((resolve, reject) => {
|
remove hyphens from guid
|
Microsoft_Essex-PowerBI-visuals-base
|
train
|
js
|
c33d04fb54b216b7350d1d09178776db427727c0
|
diff --git a/etcdserver/server.go b/etcdserver/server.go
index <HASH>..<HASH> 100644
--- a/etcdserver/server.go
+++ b/etcdserver/server.go
@@ -265,7 +265,22 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) {
bepath := path.Join(cfg.SnapDir(), databaseFilename)
beExist := fileutil.Exist(bepath)
- be := backend.NewDefaultBackend(bepath)
+
+ var be backend.Backend
+ beOpened := make(chan struct{})
+ go func() {
+ be = backend.NewDefaultBackend(bepath)
+ beOpened <- struct{}{}
+ }()
+
+ select {
+ case <-beOpened:
+ case <-time.After(time.Second):
+ plog.Warningf("another etcd process is running with the same data dir and holding the file lock.")
+ plog.Warningf("waiting for it to exit before starting...")
+ <-beOpened
+ }
+
defer func() {
if err != nil {
be.Close()
|
etcdserver: print out warning when waiting for file lock
|
etcd-io_etcd
|
train
|
go
|
dc3a6451bd8fa08e8c38223cb73995ebd8189bb1
|
diff --git a/src/db/clients/index.js b/src/db/clients/index.js
index <HASH>..<HASH> 100644
--- a/src/db/clients/index.js
+++ b/src/db/clients/index.js
@@ -12,6 +12,9 @@ export const CLIENTS = [
key: 'mysql',
name: 'MySQL',
defaultPort: 3306,
+ disabledFeatures: [
+ 'server:schema',
+ ],
},
{
key: 'postgresql',
@@ -33,6 +36,7 @@ export const CLIENTS = [
'server:socketPath',
'server:user',
'server:password',
+ 'server:schema',
'scriptCreateTable',
],
},
|
feat: add schema to disabledFeatures list (#<I>)
|
falcon-client_falcon-core
|
train
|
js
|
97a27d687721458d410587d3b75506605cd3ec5d
|
diff --git a/WORTHWHILE_VERSION b/WORTHWHILE_VERSION
index <HASH>..<HASH> 100644
--- a/WORTHWHILE_VERSION
+++ b/WORTHWHILE_VERSION
@@ -1 +1 @@
-0.1.1
+0.1.2
diff --git a/lib/worthwhile/version.rb b/lib/worthwhile/version.rb
index <HASH>..<HASH> 100644
--- a/lib/worthwhile/version.rb
+++ b/lib/worthwhile/version.rb
@@ -1,3 +1,3 @@
module Worthwhile
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
end
diff --git a/worthwhile-models/lib/worthwhile/models/version.rb b/worthwhile-models/lib/worthwhile/models/version.rb
index <HASH>..<HASH> 100644
--- a/worthwhile-models/lib/worthwhile/models/version.rb
+++ b/worthwhile-models/lib/worthwhile/models/version.rb
@@ -1,5 +1,5 @@
module Worthwhile
module Models
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
end
end
|
Preparing for <I> release
|
samvera_hyrax
|
train
|
WORTHWHILE_VERSION,rb,rb
|
727174cf1592beed782f9ed41fc3a5a3bee69a74
|
diff --git a/src/core/options.js b/src/core/options.js
index <HASH>..<HASH> 100644
--- a/src/core/options.js
+++ b/src/core/options.js
@@ -3,7 +3,10 @@ function invalidOpt(a) {
}
function invalidContent(c) {
- return !($.isFunction(c) || c && c.attr) || c.length || $.type(c) === 'object' && (c.jquery || c.then);
+ return !($.isFunction(c) ||
+ c && c.attr ||
+ c.length ||
+ $.type(c) === 'object' && (c.jquery || c.then));
}
// Option object sanitizer
|
Fix #<I> invalidContent function to support text fields
This fixes the invalidContent function to support text fields like it used to
|
qTip2_qTip2
|
train
|
js
|
ab3596b8155de6ec3a1b412c45c18fbe248998c4
|
diff --git a/src/Illuminate/Database/Concerns/ManagesTransactions.php b/src/Illuminate/Database/Concerns/ManagesTransactions.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Database/Concerns/ManagesTransactions.php
+++ b/src/Illuminate/Database/Concerns/ManagesTransactions.php
@@ -41,11 +41,13 @@ trait ManagesTransactions
}
try {
+ if ($this->transactions == 1) {
+ $this->getPdo()->commit();
+ }
+
$this->transactions = max(0, $this->transactions - 1);
if ($this->transactions == 0) {
- $this->getPdo()->commit();
-
optional($this->transactionsManager)->commit($this->getName());
}
} catch (Throwable $e) {
@@ -187,12 +189,14 @@ trait ManagesTransactions
{
if ($this->transactions == 1) {
$this->getPdo()->commit();
-
- optional($this->transactionsManager)->commit($this->getName());
}
$this->transactions = max(0, $this->transactions - 1);
+ if ($this->transactions == 0) {
+ optional($this->transactionsManager)->commit($this->getName());
+ }
+
$this->fireConnectionEvent('committed');
}
|
keep the counter (#<I>)
|
laravel_framework
|
train
|
php
|
55e74e4375959ec81806bbf29a053f9c16e3b36c
|
diff --git a/compiler/natives/src/os/os.go b/compiler/natives/src/os/os.go
index <HASH>..<HASH> 100644
--- a/compiler/natives/src/os/os.go
+++ b/compiler/natives/src/os/os.go
@@ -18,10 +18,11 @@ func runtime_args() []string { // not called on Windows
func init() {
if process := js.Global.Get("process"); process != js.Undefined {
- argv := process.Get("argv")
- Args = make([]string, argv.Length()-1)
- for i := 0; i < argv.Length()-1; i++ {
- Args[i] = argv.Index(i + 1).String()
+ if argv := process.Get("argv"); argv != js.Undefined {
+ Args = make([]string, argv.Length()-1)
+ for i := 0; i < argv.Length()-1; i++ {
+ Args[i] = argv.Index(i + 1).String()
+ }
}
}
if len(Args) == 0 {
|
Work around undefined process.argv
React Native has process object but it doesn't contain argv.
|
gopherjs_gopherjs
|
train
|
go
|
c1b4cda2f36afc40cebfbb18b08ac38105d11c2a
|
diff --git a/panphon/distance.py b/panphon/distance.py
index <HASH>..<HASH> 100644
--- a/panphon/distance.py
+++ b/panphon/distance.py
@@ -576,6 +576,29 @@ class Distance(object):
self.fm.word_to_vector_list(source),
self.fm.word_to_vector_list(target))
+ def jt_weighted_feature_edit_distance(self, source, target):
+ """String edit distance with weighted features
+
+ The cost of changine an articulatory feature is weighted according to
+ the the class of the feature and the subjective probability of the
+ feature changing in phonological alternation and loanword contexts.
+ These weights are stored in `Distance.weights`.
+
+ Args:
+ source (unicode): source string
+ target (uniocde): target string
+
+ Returns:
+ float: feature weighted string edit distance between `source` and
+ `target`
+ """
+ return self.min_edit_distance(partial(self.weighted_deletion_cost, gl_wt=0.25),
+ partial(self.weighted_insertion_cost, gl_wt=0.25),
+ self.weighted_substitution_cost,
+ [[]],
+ self.fm.word_to_vector_list(source),
+ self.fm.word_to_vector_list(target))
+
def weighted_feature_edit_distance_div_maxlen(self, source, target):
"""String edit distance with weighted features, divided by maxlen
|
Added JT-adjusted weigthed ft ed dist
|
dmort27_panphon
|
train
|
py
|
0d58da635e5443b63271455534d29031ab4b090b
|
diff --git a/tests/test-json-plugin.php b/tests/test-json-plugin.php
index <HASH>..<HASH> 100644
--- a/tests/test-json-plugin.php
+++ b/tests/test-json-plugin.php
@@ -19,7 +19,7 @@ class WP_Test_JSON_Plugin extends WP_UnitTestCase {
* The plugin should be installed and activated.
*/
function test_plugin_activated() {
- $this->assertTrue( class_exists( 'WP_JSON_Posts' ) );
+ $this->assertTrue( class_exists( 'WP_JSON_Posts_Controller' ) );
}
/**
|
Fix plugin activated test to use new controller class
|
WP-API_WP-API
|
train
|
php
|
b3c6209c9d2f099db5e781bb79016ef6a02240d2
|
diff --git a/lib/Extension/ClassMover/Application/ClassMover.php b/lib/Extension/ClassMover/Application/ClassMover.php
index <HASH>..<HASH> 100644
--- a/lib/Extension/ClassMover/Application/ClassMover.php
+++ b/lib/Extension/ClassMover/Application/ClassMover.php
@@ -2,6 +2,8 @@
namespace Phpactor\Extension\ClassMover\Application;
+use Exception;
+use Phpactor\ClassFileConverter\Exception\NoMatchingSourceException;
use Phpactor\ClassFileConverter\PathFinder;
use Phpactor\ClassMover\ClassMover as ClassMoverFacade;
use Phpactor\ClassMover\Domain\Name\FullyQualifiedName;
@@ -49,9 +51,14 @@ class ClassMover
public function getRelatedFiles(string $src): array
{
+ try {
return array_filter($this->pathFinder->destinationsFor($src), function (string $filePath) {
return (bool) file_exists($filePath);
});
+ } catch (NoMatchingSourceException $e) {
+ // TODO: Make pathfinder return it's own exception here, this is the class-to-file exception
+ return [];
+ }
}
/**
|
Temporary fix for "class mover" find references exception
The caught exception here is from class-to-file, not the path-finder
library. The path-finder library should catch this exception.
|
phpactor_phpactor
|
train
|
php
|
654487ec646405544f006122034c3a00fb6cf742
|
diff --git a/test/phonopy/phonon/test_moment.py b/test/phonopy/phonon/test_moment.py
index <HASH>..<HASH> 100644
--- a/test/phonopy/phonon/test_moment.py
+++ b/test/phonopy/phonon/test_moment.py
@@ -85,6 +85,7 @@ class TestMoment(unittest.TestCase):
phonon.produce_force_constants()
filename_born = os.path.join(data_dir, "../BORN_NaCl")
nac_params = parse_BORN(phonon.get_primitive(), filename=filename_born)
+ nac_params['method'] = 'wang'
phonon.set_nac_params(nac_params)
return phonon
|
Test failed due to the change of default NAC method. This is fixed.
|
atztogo_phonopy
|
train
|
py
|
dd317dcb542df287ac50c3ce1d93eb64877da0f4
|
diff --git a/pkg/policy/rule_l4.go b/pkg/policy/rule_l4.go
index <HASH>..<HASH> 100644
--- a/pkg/policy/rule_l4.go
+++ b/pkg/policy/rule_l4.go
@@ -188,7 +188,7 @@ func (l4 *L4Policy) GetModel() *models.L4Policy {
egress := []string{}
for _, v := range l4.Egress {
- ingress = append(ingress, v.String())
+ egress = append(egress, v.String())
}
return &models.L4Policy{
|
policy: Fix incorrect reporting of egress L4 rules as ingress
|
cilium_cilium
|
train
|
go
|
3a4c8da32d12ae40477db37859e70e8c04ed35f7
|
diff --git a/lib/cli/options.js b/lib/cli/options.js
index <HASH>..<HASH> 100644
--- a/lib/cli/options.js
+++ b/lib/cli/options.js
@@ -27,8 +27,13 @@ class UnknownError extends Error {
}
}
-module.exports = function () {
- return parse(process.argv.slice(2), {
+/**
+ * Make sense of an input string.
+ * @param {Array} arr Input argument segments
+ * @return {Object}
+ */
+module.exports = function (arr) {
+ return parse(arr || process.argv.slice(2), {
default: {
pwd: '.',
mode: 'serial'
|
allow cli.options to accept input directly
- fallback to process slicing
|
lukeed_taskr
|
train
|
js
|
8927bd107cd854ad9f3a73daf1af0e28d41c74b5
|
diff --git a/src/python/dxpy/__init__.py b/src/python/dxpy/__init__.py
index <HASH>..<HASH> 100644
--- a/src/python/dxpy/__init__.py
+++ b/src/python/dxpy/__init__.py
@@ -134,8 +134,7 @@ from . import exceptions
from requests.auth import AuthBase
from requests.packages import urllib3
from requests.packages.urllib3.packages.ssl_match_hostname import match_hostname
-from .compat import USING_PYTHON2, expanduser, BadStatusLine
-import StringIO
+from .compat import USING_PYTHON2, expanduser, BadStatusLine, StringIO
from threading import Lock
try:
from urllib.parse import urlsplit
|
Correct import of StringIO package, it has a different binding depending on the python version (2 or 3)
|
dnanexus_dx-toolkit
|
train
|
py
|
03253dad2fa58a031524032d0395bdb07f5f5c49
|
diff --git a/Tests/Form/Admin/ReviewFormBuilderTest.php b/Tests/Form/Admin/ReviewFormBuilderTest.php
index <HASH>..<HASH> 100755
--- a/Tests/Form/Admin/ReviewFormBuilderTest.php
+++ b/Tests/Form/Admin/ReviewFormBuilderTest.php
@@ -25,9 +25,9 @@ class ReviewFormBuilderTest extends AbstractFormBuilderTestCase
{
return $this->container->get('review.form_builder.admin');
}
-
- protected function getFactoryService()
+
+ protected function getDefaultFormData()
{
- return $this->container->get('review.factory');
+ return $this->container->get('review.manager')->initResource();
}
}
|
Changed form test cases to use manager instead of factory
|
WellCommerce_WishlistBundle
|
train
|
php
|
149ea9a3ff4175467eadc60c8e01f26d312222bb
|
diff --git a/app/Dates/DateFactory.php b/app/Dates/DateFactory.php
index <HASH>..<HASH> 100644
--- a/app/Dates/DateFactory.php
+++ b/app/Dates/DateFactory.php
@@ -72,6 +72,6 @@ class DateFactory
*/
public function createNormalized($format, $time)
{
- return $this->create($format, $time)->setTimezone($this->appTimezone);
+ return Date::createFromFormat($format, $time)->setTimezone($this->appTimezone);
}
}
|
Fixed bug in the createNormalized function
|
CachetHQ_Cachet
|
train
|
php
|
d302be7b32ed3898ac36570f32fb75c2ccd817d0
|
diff --git a/src/components/carousel/Carousel.js b/src/components/carousel/Carousel.js
index <HASH>..<HASH> 100644
--- a/src/components/carousel/Carousel.js
+++ b/src/components/carousel/Carousel.js
@@ -112,6 +112,7 @@ export class Carousel extends Component {
this.remainingItems = 0;
this.allowAutoplay = !!this.props.autoplayInterval;
this.circular = this.props.circular || this.allowAutoplay;
+ this.swipeThreshold = 20;
this.id = this.props.id || UniqueComponentId();
}
@@ -305,11 +306,13 @@ export class Carousel extends Component {
}
changePageOnTouch(e, diff) {
- if (diff < 0) { // left
- this.navForward(e);
- }
- else { // right
- this.navBackward(e);
+ if (Math.abs(diff) > this.swipeThreshold) {
+ if (diff < 0) { // left
+ this.navForward(e);
+ }
+ else { // right
+ this.navBackward(e);
+ }
}
}
|
Fixed #<I> - Carousel - Button inside carousel-item is not clickable in mobile phones
|
primefaces_primereact
|
train
|
js
|
f576bc74dfc1eba1177c2ce264addb91dfef38fd
|
diff --git a/nhlib/geo/surface/complex_fault.py b/nhlib/geo/surface/complex_fault.py
index <HASH>..<HASH> 100644
--- a/nhlib/geo/surface/complex_fault.py
+++ b/nhlib/geo/surface/complex_fault.py
@@ -158,10 +158,15 @@ class ComplexFaultSurface(BaseSurface):
the surface projection of the complex fault.
"""
# collect lons and lats of all the vertices of all the edges
- lons, lats = numpy.array(
- [[[point.longitude, point.latitude] for point in edge]
- for edge in edges], dtype=float
- ).reshape((-1, 2)).transpose()
+ lons = []
+ lats = []
+ for edge in edges:
+ for point in edge:
+ lons.append(point.longitude)
+ lats.append(point.latitude)
+ lons = numpy.array(lons, dtype=float)
+ lats = numpy.array(lats, dtype=float)
+
return Mesh(lons, lats, depths=None).get_convex_hull()
def get_width(self):
|
geo/surface/complex_fault:
Refactored the way the surface projection mesh in computed, to allow
for sets of fault edges with a non-uniform length.
We found this bug when trying to run a calculation with the following
scenario:
A complex fault with
- a top edge containing <I> points
- a bottom edge containing <I> points
|
gem_oq-engine
|
train
|
py
|
a8a1c161a681f99570d9bb52b5e5243708af7619
|
diff --git a/views/cypress/utils/selectors.js b/views/cypress/utils/selectors.js
index <HASH>..<HASH> 100755
--- a/views/cypress/utils/selectors.js
+++ b/views/cypress/utils/selectors.js
@@ -4,6 +4,6 @@ export default {
moveConfirmSelector: 'button[data-control="ok"]',
assetForm: 'form[action="/taoMediaManager/MediaManager/editInstance"]',
assetClassForm: 'form[action="/taoMediaManager/MediaManager/editClassLabel"]',
- deleteConfirm: '[data-control="delete"]',
+ deleteConfirm: 'button[data-control="ok"]',
root: '[data-uri="http://www.tao.lu/Ontologies/TAOMedia.rdf#Media"]'
};
|
chore: Small fix on xpath button
|
oat-sa_extension-tao-mediamanager
|
train
|
js
|
6c1c0a37be56d98f64f6d681c1110c1561cb418f
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -156,7 +156,7 @@ module.exports = MultiStream
// Normalize stream destroy w/ callback.
function destroy (stream, err, cb) {
- if (!stream.destroy) {
+ if (!stream.destroy || stream.destroyed) {
cb(err)
} else {
const callback = once(er => cb(er || err))
|
fixup: return early for pre destroyed
|
feross_multistream
|
train
|
js
|
69b4520593def90d8851c0ba5b8c94a01d69ae30
|
diff --git a/core/src/main/java/hudson/security/LDAPSecurityRealm.java b/core/src/main/java/hudson/security/LDAPSecurityRealm.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/security/LDAPSecurityRealm.java
+++ b/core/src/main/java/hudson/security/LDAPSecurityRealm.java
@@ -199,7 +199,7 @@ public class LDAPSecurityRealm extends SecurityRealm {
*/
private void correctAuthoritiesPopulator(WebApplicationContext appContext) {
DeferredCreationLdapAuthoritiesPopulator factory = (DeferredCreationLdapAuthoritiesPopulator) appContext.getBean("authoritiesPopulator");
- factory.setGroupSearchBase(groupSearchBase==null ? "ou=groups" : groupSearchBase);
+ factory.setGroupSearchBase(groupSearchBase==null ? "" : groupSearchBase);
}
/**
|
ou=groups is not a mandatory convention, and indeed at Zilics Information Systems that I went for a trouble-shooting, it was using another name.
So just search from a broader base by default.
git-svn-id: <URL>
|
jenkinsci_jenkins
|
train
|
java
|
d2fcd1ab356af2e2a2a7fbf5ba0679e90f501db0
|
diff --git a/salt/config.py b/salt/config.py
index <HASH>..<HASH> 100644
--- a/salt/config.py
+++ b/salt/config.py
@@ -742,15 +742,11 @@ def cloud_config(path, env_var='SALT_CLOUD_CONFIG', defaults=None,
Read in the salt cloud config and return the dict
'''
# Load the cloud configuration
- try:
- overrides = salt.config.load_config(path, env_var, '/etc/salt/cloud')
- except TypeError:
- log.warning(
- 'Salt version is lower than 0.16.0, as such, loading '
- 'configuration from the {0!r} environment variable will '
- 'fail'.format(env_var)
- )
- overrides = salt.config.load_config(path, env_var)
+ overrides = salt.config.load_config(
+ path,
+ env_var,
+ os.path.join(syspaths.CONFIG_DIR, 'cloud')
+ )
if defaults is None:
defaults = CLOUD_CONFIG_DEFAULTS
|
Remove deprecated code and make use of `syspaths`.
|
saltstack_salt
|
train
|
py
|
00152a599684b3530bb300ac1592272c7746db2f
|
diff --git a/src/main/java/net/ravendb/client/documents/session/DocumentSession.java b/src/main/java/net/ravendb/client/documents/session/DocumentSession.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/ravendb/client/documents/session/DocumentSession.java
+++ b/src/main/java/net/ravendb/client/documents/session/DocumentSession.java
@@ -187,7 +187,7 @@ public class DocumentSession extends InMemoryDocumentSessionOperations implement
GetRequest req = pendingLazyOperations.get(i).createRequest();
if (req == null) {
pendingLazyOperations.remove(i);
- i++; // so we'll recheck this index
+ i--; // so we'll recheck this index
continue;
}
requests.add(req);
|
RDBC-<I> bug in java's executeAllPendingLazyOperations
|
ravendb_ravendb-jvm-client
|
train
|
java
|
1f72348345d0c90991e950daa7c834cfec5989b6
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ reqs = [str(ir.req) for ir in install_reqs]
setup(
name="pybind",
- version="0.1.34",
+ version="0.1.35",
packages=find_packages(),
author="Brocade Comm",
description="pyBind Library for use with pySwitchLib",
|
Updating version to push to pypi
|
StackStorm_pybind
|
train
|
py
|
f807571322f01e8374f97479849c83329bad268f
|
diff --git a/src/main/java/us/monoid/web/AbstractResource.java b/src/main/java/us/monoid/web/AbstractResource.java
index <HASH>..<HASH> 100644
--- a/src/main/java/us/monoid/web/AbstractResource.java
+++ b/src/main/java/us/monoid/web/AbstractResource.java
@@ -45,7 +45,13 @@ public abstract class AbstractResource extends Resty {
// so that keep alive can keep doing its work
if (anUrlConnection instanceof HttpURLConnection) {
HttpURLConnection conn = (HttpURLConnection) anUrlConnection;
- InputStream es = new BufferedInputStream(conn.getErrorStream());
+ InputStream es;
+ if ("gzip".equals(conn.getContentEncoding())) {
+ es = new BufferedInputStream(new GZIPInputStream(conn.getErrorStream()));
+ }
+ else {
+ es = new BufferedInputStream(conn.getErrorStream());
+ }
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
|
Modified AbstractResource.fill to handle compressed error stream too
Added check to exception handler in AbstractResource.fill to handle a
compressed error stream.
|
beders_Resty
|
train
|
java
|
eff5a309a75d7e7ae1facfe3353e321873703adb
|
diff --git a/src/you_get/extractors/tumblr.py b/src/you_get/extractors/tumblr.py
index <HASH>..<HASH> 100644
--- a/src/you_get/extractors/tumblr.py
+++ b/src/you_get/extractors/tumblr.py
@@ -23,7 +23,7 @@ def tumblr_download(url, output_dir = '.', merge = True, info_only = False):
title = unescape_html(r1(r'<meta property="og:title" content="([^"]*)" />', html) or
r1(r'<meta property="og:description" content="([^"]*)" />', html) or
- r1(r'<title>([^<\n]*)', html)).replace('\n', '')
+ r1(r'<title>([^<\n]*)', html) or url.split("/")[4]).replace('\n', '')
type, ext, size = url_info(real_url)
|
[Tumblr] fix for videos with no title
|
soimort_you-get
|
train
|
py
|
55a7a5cd33e97f9a8370083dcb041c5552f10ac9
|
diff --git a/test/server_timeout.test.js b/test/server_timeout.test.js
index <HASH>..<HASH> 100644
--- a/test/server_timeout.test.js
+++ b/test/server_timeout.test.js
@@ -7,6 +7,7 @@ const Agent = require('..');
describe('test/server_timeout.test.js', () => {
let port;
let server;
+ let timer;
before(done => {
server = http.createServer((req, res) => {
if (server.keepAliveTimeout) {
@@ -24,6 +25,10 @@ describe('test/server_timeout.test.js', () => {
});
});
+ after(() => {
+ clearInterval(timer);
+ });
+
it('should handle Keep-Alive header and not throw reset error', done => {
const keepaliveAgent = new Agent({
keepAlive: true,
@@ -67,7 +72,7 @@ describe('test/server_timeout.test.js', () => {
req.end();
}
- setInterval(request, server.keepAliveTimeout);
+ timer = setInterval(request, server.keepAliveTimeout);
request();
});
});
|
test: stop timer after test end
|
node-modules_agentkeepalive
|
train
|
js
|
7d379e8c6dd01d0c44c7553d70c24064245c8408
|
diff --git a/kite-morphlines/kite-morphlines-avro/src/main/java/org/kitesdk/morphline/avro/WriteAvroToByteArrayBuilder.java b/kite-morphlines/kite-morphlines-avro/src/main/java/org/kitesdk/morphline/avro/WriteAvroToByteArrayBuilder.java
index <HASH>..<HASH> 100644
--- a/kite-morphlines/kite-morphlines-avro/src/main/java/org/kitesdk/morphline/avro/WriteAvroToByteArrayBuilder.java
+++ b/kite-morphlines/kite-morphlines-avro/src/main/java/org/kitesdk/morphline/avro/WriteAvroToByteArrayBuilder.java
@@ -155,6 +155,7 @@ public final class WriteAvroToByteArrayBuilder implements CommandBuilder {
Preconditions.checkNotNull(attachment);
GenericContainer datum = (GenericContainer) attachment;
schema = getSchema(datum, schema);
+ assert schema != null;
datumWriter.setSchema(schema);
if (encoder == null) { // init
if (format == Format.containerlessJSON) {
@@ -162,6 +163,7 @@ public final class WriteAvroToByteArrayBuilder implements CommandBuilder {
} else {
encoder = EncoderFactory.get().binaryEncoder(dst, null);
}
+ assert encoder != null;
}
datumWriter.write(datum, encoder);
}
|
add some asserts for better readability
|
kite-sdk_kite
|
train
|
java
|
49f49a63f264a9f4db2364c67997ee41a1c43e24
|
diff --git a/lib/mongoose.js b/lib/mongoose.js
index <HASH>..<HASH> 100644
--- a/lib/mongoose.js
+++ b/lib/mongoose.js
@@ -60,6 +60,11 @@ var MongooseService = Proto.extend({
_connect: function(options) {
var connectionString = options.connectionString;
+ if (options.connection) {
+ this.store = options.connection;
+ return;
+ }
+
if(!connectionString) {
var config = _.extend({
host: 'localhost',
|
adding the ability to pass an existing mongoose connection
|
feathersjs-ecosystem_feathers-mongoose
|
train
|
js
|
5022a6d56d8c4ebce7290de29885016589a98153
|
diff --git a/samalg/__init__.py b/samalg/__init__.py
index <HASH>..<HASH> 100644
--- a/samalg/__init__.py
+++ b/samalg/__init__.py
@@ -1760,24 +1760,7 @@ class SAM(object):
return markers
- def load(self, n, recalc_avg=True):
- """Loads SAM attributes from a Pickle file.
-
- Loads all SAM attributes from the specified Pickle file into the SAM
- object.
-
- Parameters
- ----------
- n - string
- The path of the Pickle file.
- """
- f = open(n, "rb")
- pick_dict = pickle.load(f)
- for i in range(len(pick_dict)):
- self.__dict__[list(pick_dict.keys())[i]] = pick_dict[
- list(pick_dict.keys())[i]
- ]
- f.close()
-
- if recalc_avg:
- self.dispersion_ranking_NN()
+ def SamPlot(self):
+ from samalg.gui import SAMGUI
+ self.SamPlot = SAMGUI(self).SamPlot
+ return self.SamPlot
\ No newline at end of file
|
added SAM.SamPlot function to set GUI instances as attributes of SAM objects for easy recall
|
atarashansky_self-assembling-manifold
|
train
|
py
|
f0ca1a547c62ea2bee91db0e66720d77ccde8d35
|
diff --git a/mapchete/formats/__init__.py b/mapchete/formats/__init__.py
index <HASH>..<HASH> 100644
--- a/mapchete/formats/__init__.py
+++ b/mapchete/formats/__init__.py
@@ -169,12 +169,12 @@ def driver_from_file(input_file, quick=True):
# brute force by trying to open file with rasterio and fiona:
try:
logger.debug("try to open %s with rasterio...", input_file)
- with rasterio.open(input_file):
+ with rasterio.open(input_file): # pragma: no cover
return "raster_file"
except Exception as rio_exception:
try:
logger.debug("try to open %s with fiona...", input_file)
- with fiona.open(input_file):
+ with fiona.open(input_file): # pragma: no cover
return "vector_file"
except Exception as fio_exception:
if path_exists(input_file):
|
omit rasterio and fiona cases from test coverage
|
ungarj_mapchete
|
train
|
py
|
4b5a614f4b6fd656fa363e6c48820701bac993c3
|
diff --git a/main.js b/main.js
index <HASH>..<HASH> 100755
--- a/main.js
+++ b/main.js
@@ -49,6 +49,9 @@ exports.init = function (config) {
if (info.cwd && info.cwd.indexOf("~") === 0) {
info.cwd = info.cwd.replace('~', homedir);
}
+ if (info.cmd && info.cmd.indexOf("~") === 0) {
+ info.cmd = info.cmd.replace('~', homedir);
+ }
var process = new Process(info)
, fatal = true
, fatalTimerId
|
Added code to replace the home dir character ~ into a full path
|
Crafity_crafity-process
|
train
|
js
|
95772dc59562736649181f65298a36c041f92727
|
diff --git a/src/Builder/InsertOnDuplicateKeyBuilder.php b/src/Builder/InsertOnDuplicateKeyBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Builder/InsertOnDuplicateKeyBuilder.php
+++ b/src/Builder/InsertOnDuplicateKeyBuilder.php
@@ -115,7 +115,8 @@ class InsertOnDuplicateKeyBuilder
*/
BelongsToMany::macro('attachIgnore', function ($id, array $attributes = [], $touch = true) {
$this->newPivotStatement()->insertIgnore($this->formatAttachRecords(
- $this->parseIds($id), $attributes
+ $this->parseIds($id),
+ $attributes
));
if ($touch) {
$this->touchIfTouching();
@@ -131,7 +132,8 @@ class InsertOnDuplicateKeyBuilder
*/
BelongsToMany::macro('attachOnDuplicateKey', function ($id, array $attributes = [], $touch = true) {
$this->newPivotStatement()->insertOnDuplicateKey($this->formatAttachRecords(
- $this->parseIds($id), $attributes
+ $this->parseIds($id),
+ $attributes
));
if ($touch) {
|
Apply fixes from StyleCI (#6)
|
Napp_dbalcore
|
train
|
php
|
efe66600ac7e5d3e47643c7b3be2ba92e1197f00
|
diff --git a/templatefield/fields.py b/templatefield/fields.py
index <HASH>..<HASH> 100644
--- a/templatefield/fields.py
+++ b/templatefield/fields.py
@@ -15,6 +15,7 @@ class TemplateTextField(models.TextField):
# Return the rendered template
template = Template(value)
- context_dict = context.get('tmpl_context', {})
+ context_dict = {}
context_dict.update(settings.TEMPLATE_FIELD_CONTEXT)
+ context_dict.update(context.get('tmpl_context', {}))
return template.render(Context(context_dict))
|
Qs context can override settings context.
|
orcasgit_django-template-field
|
train
|
py
|
5a2bc155ba413527497979bddb3f14a972a161c5
|
diff --git a/src/zoom.js b/src/zoom.js
index <HASH>..<HASH> 100644
--- a/src/zoom.js
+++ b/src/zoom.js
@@ -74,9 +74,7 @@ export function translateZoomBehaviorTransform(selection) {
// Set the original zoom transform to the translation specified in
// the selection's data.
- if (selection.datum().translation) {
- this._originalTransform = zoomIdentity.translate(selection.datum().translation.x, selection.datum().translation.y);
- }
+ this._originalTransform = zoomIdentity.translate(selection.datum().translation.x, selection.datum().translation.y);
}
export function resetZoom(transition) {
|
Removed unused stuff
This particular stuff is unused since there is no need to check if the
data contains a translation field, because the
translateZoomBehaviorTransform function is always called for elements
that have a transform attribute, such as the 'g' elements that
graphviz is known to generate, for which the translation field is
always generated.
|
magjac_d3-graphviz
|
train
|
js
|
7e648a5ea7808010ccea311394ecbfabd58ab3b4
|
diff --git a/sprd/entity/BendingTextConfiguration.js b/sprd/entity/BendingTextConfiguration.js
index <HASH>..<HASH> 100644
--- a/sprd/entity/BendingTextConfiguration.js
+++ b/sprd/entity/BendingTextConfiguration.js
@@ -94,6 +94,12 @@ define(["sprd/entity/DesignConfigurationBase", "sprd/entity/Size", "sprd/entity/
}
})
.seq(function() {
+ var printType = self.$.printType;
+ if (printType) {
+ self.setColor(null, printType.getClosestPrintColor(properties.fill))
+ }
+ })
+ .seq(function() {
if (properties.text) {
var fontFamily = this.vars.fontFamily,
@@ -155,6 +161,7 @@ define(["sprd/entity/DesignConfigurationBase", "sprd/entity/Size", "sprd/entity/
ret.properties.fontWeight = font.$.weight;
ret.properties.fontStyle = font.$.style;
ret.properties.fontSize = this.$.fontSize;
+ ret.properties.fill = this.$.printColors.at(0).toHexString();
ret.properties.path = this.$.path;
ret.properties.scale = this.$.scale.x;
ret.properties.size = this.$._size.$;
|
DEV-<I> saving fill of bending in the properties now
|
spreadshirt_rAppid.js-sprd
|
train
|
js
|
a21143320a94060ac1bbd347a7bc41f318533f6a
|
diff --git a/mdata/notifierKafka/cfg.go b/mdata/notifierKafka/cfg.go
index <HASH>..<HASH> 100644
--- a/mdata/notifierKafka/cfg.go
+++ b/mdata/notifierKafka/cfg.go
@@ -124,8 +124,6 @@ func ConfigProcess(instance string) {
partitionLogSize = make(map[int32]*stats.Gauge64)
partitionLag = make(map[int32]*stats.Gauge64)
- // when booting up, we will delay consuming metrics until we have
- // caught up to these offsets.
for _, part := range partitions {
// metric cluster.notifier.kafka.partition.%d.offset is the current offset for the partition (%d) that we have consumed
partitionOffset[part] = stats.NewGauge64(fmt.Sprintf("cluster.notifier.kafka.partition.%d.offset", part))
|
Removed old comment that does not apply anylonger
|
grafana_metrictank
|
train
|
go
|
f1ce10785f61d8a65aaa8d03ce3257a073d1ecd0
|
diff --git a/python/jsbeautifier/__init__.py b/python/jsbeautifier/__init__.py
index <HASH>..<HASH> 100644
--- a/python/jsbeautifier/__init__.py
+++ b/python/jsbeautifier/__init__.py
@@ -137,17 +137,12 @@ def beautify(string, opts = default_options() ):
return b.beautify(string, opts)
def beautify_file(file_name, opts = default_options() ):
-
if file_name == '-': # stdin
- f = sys.stdin
+ stream = sys.stdin
else:
- try:
- f = open(file_name)
- except Exception as ex:
- return 'The file could not be opened'
+ stream = open(file_name)
- b = Beautifier()
- return b.beautify(''.join(f.readlines()), opts)
+ return beautify(''.join(stream.readlines()), opts);
def usage(stream=sys.stdout):
|
Python beautify_file should throw on error
When you get an error, you should throw an exception, not return
an invalid value.
|
beautify-web_js-beautify
|
train
|
py
|
17d56a278ad39a4fa2a8661932a155c19da10bbc
|
diff --git a/lib/xbee-api.js b/lib/xbee-api.js
index <HASH>..<HASH> 100644
--- a/lib/xbee-api.js
+++ b/lib/xbee-api.js
@@ -141,7 +141,7 @@ XBeeAPI.prototype.parseRaw = function(buffer) {
var S = this.parseState;
for(var i = 0; i < buffer.length; i++) {
S.b = buffer[i];
- if (S.b === C.START_BYTE) {
+ if (S.waiting && S.b === C.START_BYTE) {
S.buffer = Buffer.alloc(128);
S.length = 0;
S.total = 0;
|
Don't interpret 0x7E as the start of a packet unless waiting==True
|
jankolkmeier_xbee-api
|
train
|
js
|
acfd2463bc5010d50e3330302841f6bd0f79a264
|
diff --git a/lib/less/parser.js b/lib/less/parser.js
index <HASH>..<HASH> 100644
--- a/lib/less/parser.js
+++ b/lib/less/parser.js
@@ -178,7 +178,7 @@ less.Parser = function Parser(env) {
// the individual nodes in the tree.
this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
- this.env.filename = this.env.filename || __filename;
+ this.env.filename = this.env.filename || null;
//
// The Parser
|
don't use __filename if no filename
|
less_less.js
|
train
|
js
|
651671992551c6c5c939e055c05c5165cc358d12
|
diff --git a/symfit/core/argument.py b/symfit/core/argument.py
index <HASH>..<HASH> 100644
--- a/symfit/core/argument.py
+++ b/symfit/core/argument.py
@@ -126,7 +126,7 @@ class Parameter(Argument):
else:
if equal:
return self.min == other.min and self.max == other.max \
- and self.fixed == other.fixed
+ and self.fixed == other.fixed and self.value == other.value
else:
return False
|
Added checking of value to value checking.
|
tBuLi_symfit
|
train
|
py
|
dd238fda61c04867462414595bd92cbdc9757cc0
|
diff --git a/lib/spreewald/web_steps.rb b/lib/spreewald/web_steps.rb
index <HASH>..<HASH> 100644
--- a/lib/spreewald/web_steps.rb
+++ b/lib/spreewald/web_steps.rb
@@ -146,9 +146,9 @@ end
# Checks that an input field contains some value (allowing * as wildcard character)
-Then /^the "([^"]*)" field should (not )?contain "([^"]*)"$/ do |field, negate, expected_string|
+Then /^the "([^"]*)" field should (not )?contain "([^"]*)"$/ do |label, negate, expected_string|
patiently do
- field = find_field(field)
+ field = find_field(label)
field_value = ((field.tag_name == 'textarea') && field.text.present?) ? field.text.strip : field.value
field_value.send(negate ? :should_not : :should, contain_with_wildcards(expected_string))
|
make "field should contain xy" step not crash when it needs to be repeated
|
makandra_spreewald
|
train
|
rb
|
2d507b162e3b4fe33daba004ca296cb51003f98f
|
diff --git a/plugins/connect.geoip.js b/plugins/connect.geoip.js
index <HASH>..<HASH> 100644
--- a/plugins/connect.geoip.js
+++ b/plugins/connect.geoip.js
@@ -182,7 +182,7 @@ exports.lookup_geoip = function (next, connection) {
}
plugin.calculate_distance(connection, r.ll, function (err, distance) {
- show.push(r.distance+'km');
+ show.push(distance+'km');
connection.results.add(plugin, {human: show.join(', '), emit:true});
return next();
});
|
Fix distance reporting to X-Haraka-GeoIP for geoip-lite
|
haraka_Haraka
|
train
|
js
|
bcc126d6d823b555b693618b5d0100e5b352fba1
|
diff --git a/johnny/middleware.py b/johnny/middleware.py
index <HASH>..<HASH> 100755
--- a/johnny/middleware.py
+++ b/johnny/middleware.py
@@ -42,7 +42,6 @@ class LocalStoreClearMiddleware(object):
"""
def process_exception(self, *args, **kwargs):
cache.local.clear()
- raise
def process_response(self, req, resp):
cache.local.clear()
|
Fixed bug in LocalStoreClearMiddleware.process_exception
The 'process_exception' middleware method should not re-rsie exception ever!
|
jmoiron_johnny-cache
|
train
|
py
|
666987bf52127a454c8db9d8218d3d283f0118d0
|
diff --git a/algoliasearch/types_rule.go b/algoliasearch/types_rule.go
index <HASH>..<HASH> 100644
--- a/algoliasearch/types_rule.go
+++ b/algoliasearch/types_rule.go
@@ -1,10 +1,11 @@
package algoliasearch
type Rule struct {
- ObjectID string `json:"objectID,omitempty"`
- Condition RuleCondition `json:"condition"`
- Consequence RuleConsequence `json:"consequence"`
- Description string `json:"description,omitempty"`
+ ObjectID string `json:"objectID,omitempty"`
+ Condition RuleCondition `json:"condition"`
+ Consequence RuleConsequence `json:"consequence"`
+ Description string `json:"description,omitempty"`
+ HighlightResult Map `json:"_highlightResult,omitempty"`
}
// RuleCondition is the part of an Algolia Rule which describes the condition
|
fix: Add missing _highlightResult field for Query Rules answers
|
algolia_algoliasearch-client-go
|
train
|
go
|
fe8def6a2602b30c9d4a24cba36a28d1406f08a1
|
diff --git a/packages/scientist/JATSImporter.js b/packages/scientist/JATSImporter.js
index <HASH>..<HASH> 100644
--- a/packages/scientist/JATSImporter.js
+++ b/packages/scientist/JATSImporter.js
@@ -10,6 +10,7 @@ var UnsupportedNodeJATSConverter = require('../unsupported/UnsupportedNodeJATSCo
var inBrowser = require('substance/util/inBrowser');
function JATSImporter(config) {
+ config.enableInlineWrapper = true;
JATSImporter.super.call(this, config);
this.state = new JATSImporter.State();
}
|
Enable InlineWrappers.
|
substance_texture
|
train
|
js
|
43f2fe71a6178ed83214f4ce59f2a64db36b00a2
|
diff --git a/scdl/__init__.py b/scdl/__init__.py
index <HASH>..<HASH> 100644
--- a/scdl/__init__.py
+++ b/scdl/__init__.py
@@ -4,7 +4,7 @@
import os
-__version__ = 'v1.5.0'
+__version__ = 'v1.5.0-1'
dir_path_to_conf = os.path.join(os.path.expanduser('~'), '.config/scdl')
file_path_to_conf = os.path.join(
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@
# -*- encoding: utf-8 -*-
from setuptools import setup, find_packages
+import pypandoc
import scdl
@@ -12,7 +13,7 @@ setup(
author='FlyinGrub',
author_email='flyinggrub@gmail.com',
description='Download Music from Souncloud',
- long_description=open('README.md').read(),
+ long_description=pypandoc.convert('README.md', 'rst'),
install_requires=[
'docopt',
'mutagen',
|
Try to have a correct pipy page
|
flyingrub_scdl
|
train
|
py,py
|
1fd42815306702fbc2917892239a0ab8b91cd92b
|
diff --git a/webpack/prod.config.js b/webpack/prod.config.js
index <HASH>..<HASH> 100755
--- a/webpack/prod.config.js
+++ b/webpack/prod.config.js
@@ -12,7 +12,7 @@ var assetsPath = path.join(__dirname, relativeAssetsPath);
// https://github.com/halt-hammerzeit/webpack-isomorphic-tools
var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin');
-var webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin(require('./webpack-isomorphic-tools'));
+var webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin(require('./webpack-isomorphic-tools-config'));
module.exports = {
devtool: 'source-map',
|
missed prod config in rename
|
bdefore_universal-redux
|
train
|
js
|
71ec732a501e8abb4a9149f3a10c73a87dbc57cf
|
diff --git a/kernel/content/action.php b/kernel/content/action.php
index <HASH>..<HASH> 100644
--- a/kernel/content/action.php
+++ b/kernel/content/action.php
@@ -114,7 +114,11 @@ if ( $http->hasPostVariable( 'NewButton' ) || $module->isCurrentAction( 'NewObje
}
else
{
- if ( $hasClassInformation )
+ include_once( 'kernel/classes/ezcontentlanguage.php' );
+ $allLanguages = eZContentLanguage::prioritizedLanguages();
+ // Only show language selection if there are more than 1 languages.
+ if ( count( $allLanguages ) > 1 &&
+ $hasClassInformation )
{
include_once( 'kernel/common/template.php' );
$tpl =& templateInit();
|
- Fixed: No language selection page when there is only one language and no
language was specified.
git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
|
ezsystems_ezpublish-legacy
|
train
|
php
|
6784bd63910b7b70edd2b065bbae0c7651c89a73
|
diff --git a/core/lib/stats2.js b/core/lib/stats2.js
index <HASH>..<HASH> 100644
--- a/core/lib/stats2.js
+++ b/core/lib/stats2.js
@@ -209,7 +209,7 @@ Stats.prototype.histogram = function(name, n) {
return this.summary(name, n);
};
-Stats.prototype.counter = function(name, value) {
+Stats.prototype.counter = function(name, value = 1) {
if (!this._counters[name]) {
this._counters[name] = 0;
}
|
feat(stats): Default to adding one in counter()
|
artilleryio_artillery
|
train
|
js
|
c38b9fb76e1d36cbc88d3d906e167ed6253506a2
|
diff --git a/app/Views/welcome_message.php b/app/Views/welcome_message.php
index <HASH>..<HASH> 100644
--- a/app/Views/welcome_message.php
+++ b/app/Views/welcome_message.php
@@ -18,6 +18,9 @@
font-size: 16px;
margin: 0;
padding: 0;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ text-rendering: optimizeLegibility;
}
header {
background-color: #f7f8f9;
@@ -56,7 +59,7 @@
header .heroe {
margin: 0 auto;
max-width: 1100px;
- padding: 0.5rem 1.75rem 2rem 1.75rem;
+ padding: 0.5rem 1.75rem 2rem 1.75rem;
}
header .heroe h1 {
font-size: 2.5rem;
|
Added antialiasing optimizations for the text
|
codeigniter4_CodeIgniter4
|
train
|
php
|
41ab69a39b7c30a4b42a5a35888588c2bbf02030
|
diff --git a/src/library.global.php b/src/library.global.php
index <HASH>..<HASH> 100644
--- a/src/library.global.php
+++ b/src/library.global.php
@@ -65,7 +65,7 @@ return array(
),
'boldgrid-backup' => array(
'slug' => 'boldgrid-backup',
- 'file' => '//wordpress.org/plugins/boldgrid-backup/',
+ 'link' => '//wordpress.org/plugins/boldgrid-backup/',
'priority' => 40,
),
'wpforms-lite' => array(
|
Updating boldgrid-backup link in config
|
BoldGrid_library
|
train
|
php
|
90295dd58cca5d748c2de1cc5ad45846e92ea4a6
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -87,6 +87,7 @@ Kerouac.prototype.defaultConfiguration = function() {
// implicit middleware
this.use(require('./middleware/init')());
+ this.use(middleware.absoluteURL());
}
/**
@@ -488,12 +489,14 @@ Kerouac.prototype.handle = function(page, cb) {
//console.log('# ' + page.path);
//console.log(this);
+ /*
page.once('close', function() {
// page closed. clear `cb` in case any middleware calls `next` after `page.end`
var done = cb;
cb = function() {};
done();
});
+ */
var self = this
, stack = this._stack
|
Dont trigger next on page close.
|
jaredhanson_kerouac
|
train
|
js
|
044b4a09359f9ac37dbd914f2dca434e656c90f0
|
diff --git a/dataviews/testing.py b/dataviews/testing.py
index <HASH>..<HASH> 100644
--- a/dataviews/testing.py
+++ b/dataviews/testing.py
@@ -111,7 +111,7 @@ class ViewTestCase(unittest.TestCase):
if el1[0] != el2[0]:
raise self.failureException("Mismatched annotation types.")
if el1[0] in ['vline', 'hline']:
- self.compare_arrays(el1[1], el2[1])
+ self.compare_arrays(el1[1], el2[1], 'V/H line position')
if (el1[2], el2[2]) == (None,None):
continue
elif None in (el1[2], el2[2]):
@@ -125,11 +125,11 @@ class ViewTestCase(unittest.TestCase):
if None in [i1s, i2s]:
self.assertEqual(i1s, i2s)
else:
- self.compare_arrays(i1s, i2s)
+ self.compare_arrays(i1s, i2s, 'Interval start')
if None in [i1e, i2e]:
self.assertEqual(i1e, i2e)
else:
- self.compare_arrays(i1e, i2e)
+ self.compare_arrays(i1e, i2e, 'Interval end')
else:
raise NotImplementedError
|
Fixed incorrect calls to compare_arrays
|
pyviz_holoviews
|
train
|
py
|
3c1ca619fe8869e14f92eff65c8d33babab31a90
|
diff --git a/src/autocompleters/prefixes.js b/src/autocompleters/prefixes.js
index <HASH>..<HASH> 100644
--- a/src/autocompleters/prefixes.js
+++ b/src/autocompleters/prefixes.js
@@ -34,6 +34,7 @@ module.exports = function(yasqe) {
var appendPrefixIfNeeded = function() {
if (!yasqe.autocompleters.getTrie('prefixes'))
return;// no prefixed defined. just stop
+ if (!yasqe.options.autocompleters || yasqe.options.autocompleters.indexOf("prefixes") == -1) return;//this autocompleter is disabled
var cur = yasqe.getCursor();
var token = yasqe.getTokenAt(cur);
|
do not autoappend prefix completer when it is disabled
|
OpenTriply_YASGUI.YASQE
|
train
|
js
|
fc21c0e258c18d5f15b745d8b738a4a9f2b68232
|
diff --git a/lazysignup/migrations/0002_auto_20150430_1100.py b/lazysignup/migrations/0002_auto_20150430_1100.py
index <HASH>..<HASH> 100644
--- a/lazysignup/migrations/0002_auto_20150430_1100.py
+++ b/lazysignup/migrations/0002_auto_20150430_1100.py
@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='lazyuser',
name='user',
- field=models.OneToOneField(to=settings.AUTH_USER_MODEL),
+ field=models.OneToOneField(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
]
|
Migration 2 needs on_delete param set too
|
danfairs_django-lazysignup
|
train
|
py
|
8b1dc585b30350283ede4247d36beecebc9fc16d
|
diff --git a/core/lib/engine_http.js b/core/lib/engine_http.js
index <HASH>..<HASH> 100644
--- a/core/lib/engine_http.js
+++ b/core/lib/engine_http.js
@@ -594,7 +594,6 @@ HttpEngine.prototype._handleResponse = function(url, res, ee, context, maybeCall
}
HttpEngine.prototype.setInitialContext = function(initialContext) {
- let self = this;
initialContext._successCount = 0;
initialContext._jar = new tough.CookieJar();
@@ -605,10 +604,10 @@ HttpEngine.prototype.setInitialContext = function(initialContext) {
initialContext._enableCookieJar = true;
}
- if (self.config.http && typeof self.config.http.pool !== 'undefined') {
+ if (this.config.http && typeof this.config.http.pool !== 'undefined') {
// Reuse common agents (created in the engine instance constructor)
- initialContext._httpAgent = self._httpAgent;
- initialContext._httpsAgent = self._httpsAgent;
+ initialContext._httpAgent = this._httpAgent;
+ initialContext._httpsAgent = this._httpsAgent;
} else {
// Create agents just for this VU
const agentOpts = Object.assign(DEFAULT_AGENT_OPTIONS, {
|
refactor(http): remove unnecessary reassignment of this
|
artilleryio_artillery
|
train
|
js
|
9e0af6ff45268d5f7ac3b819032f9c847ef11179
|
diff --git a/journal/main.py b/journal/main.py
index <HASH>..<HASH> 100644
--- a/journal/main.py
+++ b/journal/main.py
@@ -12,12 +12,14 @@ JOURNAL_DEST = ".journal"
def parse_args():
#parsing
- parser = argparse.ArgumentParser(
- description='Simple CLI tool to help with keeping a work/personal journal',
- version=__version__)
+ parser = argparse.ArgumentParser(description='Simple CLI tool to help with keeping a work/personal journal')
parser.add_argument('entry',
action="store",
help="Text to make an entry in your journal")
+ parser.add_argument('-v', '--version',
+ action="version",
+ version=__version__,
+ help="show program's version number and exit")
return parser, parser.parse_args()
def check_journal_dest():
|
Changing argparse setup to be compatable with older versions of argparse
|
askedrelic_journal
|
train
|
py
|
b96edd3072a1063eda61d3dc5c27b78568cc9ef6
|
diff --git a/src/python/grpcio_tests/tests/_runner.py b/src/python/grpcio_tests/tests/_runner.py
index <HASH>..<HASH> 100644
--- a/src/python/grpcio_tests/tests/_runner.py
+++ b/src/python/grpcio_tests/tests/_runner.py
@@ -183,7 +183,6 @@ class Runner(object):
pass
try_set_handler('SIGINT', sigint_handler)
- try_set_handler('SIGSEGV', fault_handler)
try_set_handler('SIGBUS', fault_handler)
try_set_handler('SIGABRT', fault_handler)
try_set_handler('SIGFPE', fault_handler)
|
Stop trying to handle SIGSEGV
|
grpc_grpc
|
train
|
py
|
72237fb0fdf2aff6dd6fc429cbc791d8dd3480c3
|
diff --git a/lib/betterp.rb b/lib/betterp.rb
index <HASH>..<HASH> 100644
--- a/lib/betterp.rb
+++ b/lib/betterp.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require 'digest'
+require 'pathname'
require 'paint'
diff --git a/lib/betterp/output.rb b/lib/betterp/output.rb
index <HASH>..<HASH> 100644
--- a/lib/betterp/output.rb
+++ b/lib/betterp/output.rb
@@ -25,7 +25,7 @@ module Betterp
return '' unless @raw.include?(':')
path, line, *_rest = @raw.split(':')
- return '' unless File.file?(path) && line.to_i.positive?
+ return '' unless Pathname.new(path).readable? && line.to_i.positive?
Paint % [
+'%{open}%{code}%{close}',
|
Use Pathname and make sure it is required
Pathname was not required by default which would cause breakage if host
application doesn't coincidentally require it.
|
bobf_betterp
|
train
|
rb,rb
|
2d8e26c24c360148083cacb3468a58c99320198a
|
diff --git a/src/structures/Guild.js b/src/structures/Guild.js
index <HASH>..<HASH> 100644
--- a/src/structures/Guild.js
+++ b/src/structures/Guild.js
@@ -114,8 +114,18 @@ class Guild extends Base {
this.large = Boolean('large' in data ? data.large : this.large);
/**
- * An array of guild features
- * @type {string[]}
+ * An array of enabled guild features, here are the possible values:
+ * * INVITE_SPLASH
+ * * MORE_EMOJI
+ * * VERIFIED
+ * * VIP_REGIONS
+ * * VANITY_URL
+ * @typedef {string} Features
+ */
+
+ /**
+ * An array of guild features partnered guilds have enabled
+ * @type {Features[]}
*/
this.features = data.features;
|
docs: add Guild#features type (#<I>)
* docs: add Guild#features type
* fixed spacing
* make it a list, and add MORE_EMOJI
|
discordjs_discord.js
|
train
|
js
|
1bead9924169bee570fd0edd573676670b54ebdd
|
diff --git a/core/src/main/java/io/grpc/internal/ClientTransportFactory.java b/core/src/main/java/io/grpc/internal/ClientTransportFactory.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/grpc/internal/ClientTransportFactory.java
+++ b/core/src/main/java/io/grpc/internal/ClientTransportFactory.java
@@ -68,8 +68,8 @@ public interface ClientTransportFactory extends Closeable {
public static final class ClientTransportOptions {
private String authority = "unknown-authority";
private Attributes eagAttributes = Attributes.EMPTY;
- private @Nullable String userAgent;
- private @Nullable HttpConnectProxiedSocketAddress connectProxiedSocketAddr;
+ @Nullable private String userAgent;
+ @Nullable private HttpConnectProxiedSocketAddress connectProxiedSocketAddr;
public String getAuthority() {
return authority;
|
core: Place Nullable annotation before modifiers
Since Nullable is not a type annotation, it is normal to put it before any
modifiers (like "private"). This fixes a lint failure.
|
grpc_grpc-java
|
train
|
java
|
a8f2a14fc64e18936be3c8714012def1646b3e84
|
diff --git a/panwid/datatable/datatable.py b/panwid/datatable/datatable.py
index <HASH>..<HASH> 100644
--- a/panwid/datatable/datatable.py
+++ b/panwid/datatable/datatable.py
@@ -177,6 +177,7 @@ class DataTable(urwid.WidgetWrap, urwid.listbox.ListWalker):
self.filters = None
self.filtered_rows = list()
+ self.last_row_count = None
if self.divider:
self._columns = list(intersperse_divider(self._columns, self.divider))
@@ -1262,7 +1263,9 @@ class DataTable(urwid.WidgetWrap, urwid.listbox.ListWalker):
offset = (self.page)*self.limit
# logger.debug(f"offset: {offset}, row count: {self.row_count()}")
if (self.row_count() is not None
+ and self.last_row_count != self.row_count()
and len(self) >= self.row_count()):
+ self.last_row_count = self.row_count()
self._emit("end", self.row_count())
return False
|
Fix bug when load_more doesn't return any more records
|
tonycpsu_panwid
|
train
|
py
|
1f3124f48a0af43492b5aecf1bf9a1d0d5371634
|
diff --git a/routing/router.go b/routing/router.go
index <HASH>..<HASH> 100644
--- a/routing/router.go
+++ b/routing/router.go
@@ -130,7 +130,7 @@ type Config struct {
// forward a fully encoded payment to the first hop in the route
// denoted by its public key. A non-nil error is to be returned if the
// payment was unsuccessful.
- SendToSwitch func(firstHop *btcec.PublicKey, htlcAdd *lnwire.UpdateAddHTLC,
+ SendToSwitch func(firstHop [33]byte, htlcAdd *lnwire.UpdateAddHTLC,
circuit *sphinx.Circuit) ([sha256.Size]byte, error)
// ChannelPruneExpiry is the duration used to determine if a channel
|
routing: use [<I>]byte instead of *btcutil.Publickey for SendToSwitch
With this change, we can avoid unnecessarily serializing a public key.
|
lightningnetwork_lnd
|
train
|
go
|
f687832d4c8d8dc4f9939e6bbbc0c5acd1da3270
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -4,5 +4,6 @@ var config = require('./jsreport.config.js')
module.exports = function (options) {
config.options = options
config.main = main
+ config.directory = __dirname
return config
}
|
add support for jsreport.use
|
jsreport_jsreport-phantom-pdf
|
train
|
js
|
05a5f2df0ee73581ce3cc28866117fc964108635
|
diff --git a/tests/calculators/hazard/event_based/core_test.py b/tests/calculators/hazard/event_based/core_test.py
index <HASH>..<HASH> 100644
--- a/tests/calculators/hazard/event_based/core_test.py
+++ b/tests/calculators/hazard/event_based/core_test.py
@@ -253,7 +253,6 @@ class EventBasedHazardCalculatorTestCase(unittest.TestCase):
# check that the parameters are read correctly from the files
self.assertEqual(hc.ses_per_logic_tree_path, 5)
- self.assertEqual(job.calc.n_sources, 4)
# Check that we have the right number of gmf_sets.
# The correct number is (num_real * ses_per_logic_tree_path).
|
tests/calcs/hazard/event_based/core_test:
Removed an assertion referencing the `n_sources` variable, which has been
deleted.
Former-commit-id: bc7e<I>d<I>ca<I>acc<I>c8bd<I>ad<I>c4c1
|
gem_oq-engine
|
train
|
py
|
6ed354abbeb2824cef1cf11f8733aecadb050d4b
|
diff --git a/src/resources/views/admin/_form.blade.php b/src/resources/views/admin/_form.blade.php
index <HASH>..<HASH> 100644
--- a/src/resources/views/admin/_form.blade.php
+++ b/src/resources/views/admin/_form.blade.php
@@ -6,7 +6,7 @@
@component('core::admin._buttons-form', ['model' => $model])
@endcomponent
-<filepicker related-table="{{ $model->getTable() }}" :related-id="{{ $model->id ?? 0 }}"></filepicker>
+<file-manager related-table="{{ $model->getTable() }}" :related-id="{{ $model->id ?? 0 }}"></file-manager>
{!! BootForm::hidden('id') !!}
|
<file-manager> in place of <filepicker>
|
TypiCMS_Blocks
|
train
|
php
|
562754a451e024c03ad8041276907bf55b91abf0
|
diff --git a/eppy/idfreader.py b/eppy/idfreader.py
index <HASH>..<HASH> 100644
--- a/eppy/idfreader.py
+++ b/eppy/idfreader.py
@@ -31,12 +31,14 @@ def iddversiontuple(afile):
except TypeError:
fhandle = afile
line1 = fhandle.readline()
+ if line1 == '':
+ line1 = fhandle.buf.split('\n')[0]
try:
line1 = line1.decode('ISO-8859-2')
except AttributeError:
pass
line = line1.strip()
- if line1 == '':
+ if line == '':
return (0,)
vers = line.split()[-1]
return versiontuple(vers)
|
Make iddversiontuple function find version number in string buffer
Previously this only worked with a filehandle.
|
santoshphilip_eppy
|
train
|
py
|
e2784f4b664d11cd7efa8679730f41b0e802bd97
|
diff --git a/ctx.go b/ctx.go
index <HASH>..<HASH> 100644
--- a/ctx.go
+++ b/ctx.go
@@ -231,8 +231,8 @@ func (c *Ctx) SignalHandlerLoop(sigCh chan os.Signal) {
// termbox.Close() here. Calling termbox.Close() twice in our
// context actually BLOCKS. Can you believe it? IT BLOCKS.
//
- // So if in main(), defer termbox.Close() blocks if we also
- // call termbox.Close() here. Not cool.
+ // So if we called termbox.Close() here, and then in main()
+ // defer termbox.Close() blocks. Not cool.
c.Finish()
return
}
|
Ambiguous comments annoy me (bad, bad me!)
|
peco_peco
|
train
|
go
|
b349854c1ce7e803aca3cf8ace255295b50f2c55
|
diff --git a/osrparse/replay.py b/osrparse/replay.py
index <HASH>..<HASH> 100644
--- a/osrparse/replay.py
+++ b/osrparse/replay.py
@@ -144,7 +144,7 @@ class Replay(object):
if(self.game_version >= VERSION_THRESHOLD):
if(self.play_data[-1].time_since_previous_action != -12345):
- raise Exception("The RNG seed value was expected in the last frame, but was not found!"
+ print("The RNG seed value was expected in the last frame, but was not found!"
"Please notify the devs with the following information:"
"\nGame Version: {}, version threshold: {}, replay hash: {}, mode: {}".format(self.game_version, VERSION_THRESHOLD, self.replay_hash, "osr"))
else:
|
print instead of harshly erroring when replay seed is not found
|
kszlim_osu-replay-parser
|
train
|
py
|
89bd62426b44cdd26e083eb3b800897e9b3e3241
|
diff --git a/src/Lodge/Postcode/Postcode.php b/src/Lodge/Postcode/Postcode.php
index <HASH>..<HASH> 100644
--- a/src/Lodge/Postcode/Postcode.php
+++ b/src/Lodge/Postcode/Postcode.php
@@ -68,6 +68,7 @@ class Postcode {
$postcode == $this->mutatePostcode($component->long_name))
{
$address_data = $current_address->address_components;
+ break 2;
}
}
}
|
stops the foreach as soon as the postcode matches, returning all the available information.
|
Daursu_postcode-lookup
|
train
|
php
|
7610ecfe5f35470bddb7a95a1937f729fc0e2c8a
|
diff --git a/lib/kubeclient/common.rb b/lib/kubeclient/common.rb
index <HASH>..<HASH> 100644
--- a/lib/kubeclient/common.rb
+++ b/lib/kubeclient/common.rb
@@ -516,6 +516,9 @@ module Kubeclient
@entities = {}
fetch_entities['resources'].each do |resource|
next if resource['name'].include?('/')
+ # Not a regular entity, special functionality covered by `process_template`.
+ # https://github.com/openshift/origin/issues/21668
+ next if resource['kind'] == 'Template' && resource['name'] == 'processedtemplates'
resource['kind'] ||=
Kubeclient::Common::MissingKindCompatibility.resource_kind(resource['name'])
entity = ClientMixin.parse_definition(resource['kind'], resource['name'])
|
Don't try to create methods for `processedtemplates` pseudo-entity
|
abonas_kubeclient
|
train
|
rb
|
c716d0bc39575288fb95e6f917300472f4b8a51b
|
diff --git a/src/ColumnManager.php b/src/ColumnManager.php
index <HASH>..<HASH> 100644
--- a/src/ColumnManager.php
+++ b/src/ColumnManager.php
@@ -198,7 +198,7 @@ class ColumnManager
/**
* Returns the name of the column for ordering.
*
- * @return string
+ * @return \Illuminate\Support\Collection
*/
public function getOrderColumns()
{
|
Fix return type of "getOrderBy" method from "ColumnManager" class.
|
freshbitsweb_laratables
|
train
|
php
|
2191fc3060c8656a3d5d4f3efd551cbcac80401f
|
diff --git a/bcbio/variation/population.py b/bcbio/variation/population.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/population.py
+++ b/bcbio/variation/population.py
@@ -206,7 +206,8 @@ def _has_gemini(data):
and os.path.exists(os.path.join(os.path.dirname(gemini_dir), "gemini-config.yaml")))
def do_db_build(samples, need_bam=True, gresources=None):
- """Confirm we should build a gemini database: need gemini + human samples + not in tool_skip.
+ """Confirm we should build a gemini database: need gemini + human samples +
+ hg19/GRCh37 + not in tools_off.
"""
genomes = set()
for data in samples:
@@ -218,6 +219,7 @@ def do_db_build(samples, need_bam=True, gresources=None):
if not gresources:
gresources = samples[0]["genome_resources"]
return (tz.get_in(["aliases", "human"], gresources, False)
+ and genomes.issubset(("hg19", "GRCh37"))
and _has_gemini(samples[0]))
else:
return False
|
GEMINI supports only human genome build hg<I>/GRCh<I> for now.
|
bcbio_bcbio-nextgen
|
train
|
py
|
a133dc5c0acc1c5148e01c7795a1b768d7f6c44d
|
diff --git a/testsuite/compat/src/test/java/org/jboss/as/test/compat/jpa/openjpa/OpenJPASharedModuleProviderTestCase.java b/testsuite/compat/src/test/java/org/jboss/as/test/compat/jpa/openjpa/OpenJPASharedModuleProviderTestCase.java
index <HASH>..<HASH> 100644
--- a/testsuite/compat/src/test/java/org/jboss/as/test/compat/jpa/openjpa/OpenJPASharedModuleProviderTestCase.java
+++ b/testsuite/compat/src/test/java/org/jboss/as/test/compat/jpa/openjpa/OpenJPASharedModuleProviderTestCase.java
@@ -33,7 +33,6 @@ import org.jboss.shrinkwrap.api.spec.WebArchive;
import javax.naming.InitialContext;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -44,7 +43,6 @@ import org.junit.runner.RunWith;
* @author Antti Laisi
*/
@RunWith(Arquillian.class)
-@Ignore("WFLY-10340")
public class OpenJPASharedModuleProviderTestCase {
private static final String ARCHIVE_NAME = "openjpa_module_test";
|
WFLY-<I> Enable OpenJPA integration tests for Java <I>, as the test passes for me locally with jdk<I>.
|
wildfly_wildfly
|
train
|
java
|
39cb1b1206c7ff8b3578fe0ccd8241494bf37f21
|
diff --git a/src/pusher.js b/src/pusher.js
index <HASH>..<HASH> 100644
--- a/src/pusher.js
+++ b/src/pusher.js
@@ -111,7 +111,7 @@ Pusher.prototype = {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
- var data = JSON.parse(xhr.responseText);
+ var data = Pusher.parser(xhr.responseText);
self.trigger('pusher:subscribe', {
channel: channel_name,
auth: data.auth
@@ -163,7 +163,7 @@ Pusher.prototype = {
},
onmessage: function(evt) {
- var params = JSON.parse(evt.data);
+ var params = Pusher.parser(evt.data);
if (params.socket_id && params.socket_id == this.socket_id) return;
var event_name = params.event,
|
It was still using JSON.parse (instead of Pusher.parser) in a few places, not sure why.
|
pusher_pusher-js
|
train
|
js
|
5f55ae255683b7f5afa06793843e02107770bcf5
|
diff --git a/biojava3-structure/src/main/java/org/biojava/bio/structure/align/ce/CeCPMain.java b/biojava3-structure/src/main/java/org/biojava/bio/structure/align/ce/CeCPMain.java
index <HASH>..<HASH> 100644
--- a/biojava3-structure/src/main/java/org/biojava/bio/structure/align/ce/CeCPMain.java
+++ b/biojava3-structure/src/main/java/org/biojava/bio/structure/align/ce/CeCPMain.java
@@ -309,11 +309,7 @@ public class CeCPMain extends CeMain {
blockRotMat[block] = blockRotMat[block].inverse();
Calc.rotate(shiftVec[block],blockRotMat[block]);
- try {
- shiftVec[block] = Calc.invert(shiftVec[block]);
- } catch (StructureException e) {
- // Never thrown
- }
+ shiftVec[block] = Calc.invert(shiftVec[block]);
}
}
}
|
Fixing minor compile error from merge
|
biojava_biojava
|
train
|
java
|
bef8011dd3fef8988b2afbc2a1995de3eb0be216
|
diff --git a/src/GitHub_Updater/Messages.php b/src/GitHub_Updater/Messages.php
index <HASH>..<HASH> 100644
--- a/src/GitHub_Updater/Messages.php
+++ b/src/GitHub_Updater/Messages.php
@@ -39,7 +39,7 @@ class Messages extends Base {
if (
! in_array( $pagenow, array_merge( $update_pages, $settings_pages ) ) ||
- ( in_array( $pagenow, $settings_pages ) && 'github-updater' !== $_GET['page'] )
+ ( in_array( $pagenow, $settings_pages ) && ( ! isset($_GET['page']) || 'github-updater' !== $_GET['page'] ) )
) {
return false;
}
|
csx: fixes error message in Messages.php: 'unknown index page in line <I>'. This is b/c ['page'] is not checked if it exists.
|
afragen_github-updater
|
train
|
php
|
a353a55a3a9c68692bb336c7c91d632d9b37bb5b
|
diff --git a/implementations/micrometer-registry-wavefront/src/main/java/io/micrometer/wavefront/WavefrontMeterRegistry.java b/implementations/micrometer-registry-wavefront/src/main/java/io/micrometer/wavefront/WavefrontMeterRegistry.java
index <HASH>..<HASH> 100644
--- a/implementations/micrometer-registry-wavefront/src/main/java/io/micrometer/wavefront/WavefrontMeterRegistry.java
+++ b/implementations/micrometer-registry-wavefront/src/main/java/io/micrometer/wavefront/WavefrontMeterRegistry.java
@@ -325,7 +325,8 @@ public class WavefrontMeterRegistry extends PushMeterRegistry {
*/
public static WavefrontClient.Builder getDefaultSenderBuilder(WavefrontConfig config) {
return new WavefrontClient.Builder(getWavefrontReportingUri(config),
- config.apiToken()).batchSize(config.batchSize());
+ config.apiToken()).batchSize(config.batchSize())
+ .flushIntervalSeconds((int) config.step().getSeconds());
}
public static Builder builder(WavefrontConfig config) {
|
Honor configured step duration when building Wavefront senders. (#<I>)
|
micrometer-metrics_micrometer
|
train
|
java
|
331b237eb671929a3789abbdfb09e2b55a8e7643
|
diff --git a/calendar-bundle/src/Resources/contao/ModuleEventlist.php b/calendar-bundle/src/Resources/contao/ModuleEventlist.php
index <HASH>..<HASH> 100644
--- a/calendar-bundle/src/Resources/contao/ModuleEventlist.php
+++ b/calendar-bundle/src/Resources/contao/ModuleEventlist.php
@@ -148,7 +148,16 @@ class ModuleEventlist extends Events
// Get all events
$arrAllEvents = $this->getAllEvents($this->cal_calendar, $strBegin, $strEnd);
- ($this->cal_order == 'descending') ? krsort($arrAllEvents) : ksort($arrAllEvents);
+ $sort = ($this->cal_order == 'descending') ? 'krsort' : 'ksort';
+
+ // Sort the days
+ $sort($arrAllEvents);
+
+ // Sort the events
+ foreach (array_keys($arrAllEvents) as $key)
+ {
+ $sort($arrAllEvents[$key]);
+ }
$arrEvents = array();
$dateBegin = date('Ymd', $strBegin);
|
[Calendar] Descending sorting of the event list did not reverse the event order (#<I>)
|
contao_contao
|
train
|
php
|
5ee7689019274563369767154bc50ccf26df9657
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -14,7 +14,6 @@ export function on(eventName) {
* Return a decorator function
*/
return function(target, name, descriptor){
- console.log(target, name, descriptor);
if(!target.events) {
target.events = {};
}
|
Remove console log from decorator.
^^ This was for debugging. my bad
|
jakejarrett_marionette-component
|
train
|
js
|
93ec400e07ffdce89f6f51ef8dd26a7b7ff04e0b
|
diff --git a/actionpack/lib/action_controller/metal/request_forgery_protection.rb b/actionpack/lib/action_controller/metal/request_forgery_protection.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/metal/request_forgery_protection.rb
+++ b/actionpack/lib/action_controller/metal/request_forgery_protection.rb
@@ -74,7 +74,7 @@ module ActionController #:nodoc:
# The actual before_filter that is used. Modify this to change how you handle unverified requests.
def verify_authenticity_token
unless verified_request?
- logger.warn "WARNING: Can't verify CSRF token authenticity" if logger
+ logger.warn "Can't verify CSRF token authenticity" if logger
handle_unverified_request
end
end
|
removed warning because logger.warn differentiate the warings
|
rails_rails
|
train
|
rb
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.