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
|
---|---|---|---|---|---|
a6222bc62bd24504d518dab01de81878c159bcc9 | diff --git a/mungegithub/mungers/release-note-label.go b/mungegithub/mungers/release-note-label.go
index <HASH>..<HASH> 100644
--- a/mungegithub/mungers/release-note-label.go
+++ b/mungegithub/mungers/release-note-label.go
@@ -22,11 +22,12 @@ import (
"k8s.io/contrib/mungegithub/features"
"k8s.io/contrib/mungegithub/github"
+ "regexp"
+ "strings"
+
"github.com/golang/glog"
githubapi "github.com/google/go-github/github"
"github.com/spf13/cobra"
- "regexp"
- "strings"
)
const (
@@ -168,9 +169,7 @@ func determineReleaseNoteLabel(obj *github.MungeObject) string {
func getReleaseNote(body string) string {
noteMatcher := regexp.MustCompile("Release note.*```(.+)```")
potentialMatch := noteMatcher.FindStringSubmatch(body)
- glog.Infof("Found %v as the release note", potentialMatch)
if potentialMatch == nil {
- glog.Infof("The release note section was probably deleted")
return ""
}
return potentialMatch[1] | mungegithub: Remove extreme verbosity from release-note | kubernetes-retired_contrib | train | go |
f95e342b8f5db53b12e50352b3ef65149c40613f | diff --git a/lib/leaflet-rails/view_helpers.rb b/lib/leaflet-rails/view_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/leaflet-rails/view_helpers.rb
+++ b/lib/leaflet-rails/view_helpers.rb
@@ -68,7 +68,14 @@ module Leaflet
if geojsons
geojsons.each do |geojson|
_output = "L.geoJSON(#{geojson[:geojson]}"
- _output << "," + geojson[:options].to_json if geojson[:options]
+ if geojson[:options]
+ options = geojson[:options]
+ on_each_feature = options.delete(:onEachFeature)
+ if on_each_feature
+ options[:onEachFeature] = ':onEachFeature'
+ end
+ _output << "," + options.to_json.gsub('":onEachFeature"', on_each_feature)
+ end
_output << ").addTo(map);"
output << _output.gsub(/\n/,'')
end | Allow onEachFeature function to be given in option | axyjo_leaflet-rails | train | rb |
1c78ede423727fb09e572213194395022a5a0fe8 | diff --git a/lib/jdbc_adapter.rb b/lib/jdbc_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/jdbc_adapter.rb
+++ b/lib/jdbc_adapter.rb
@@ -22,7 +22,7 @@ if RUBY_PLATFORM =~ /java/
if defined?(RAILS_ROOT)
to_file = File.expand_path(File.join(RAILS_ROOT, 'lib', 'tasks', 'jdbc_databases.rake'))
from_file = File.expand_path(File.join(__FILE__, 'tasks', 'jdbc_databases.rake'))
- if !File.exists(to_file) || (File.mtime(to_file) < File.mtime(from_file))
+ if !File.exist?(to_file) || (File.mtime(to_file) < File.mtime(from_file))
require 'fileutils'
FileUtils.cp from_file, to_file, :verbose => true
end | Foo. I'm slightly stupid sometimes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/jruby-extras/trunk/activerecord-jdbc@<I> 8ba<I>d5-0c1a-<I>-<I>a6-a<I>dfc1b<I>a6 | jruby_activerecord-jdbc-adapter | train | rb |
059eb3d82efe822d294ce88b2800b36c21b61ba1 | diff --git a/src/styles/global.js b/src/styles/global.js
index <HASH>..<HASH> 100644
--- a/src/styles/global.js
+++ b/src/styles/global.js
@@ -10,7 +10,7 @@ module.exports = `
color: ${ DARK }
}
- @media (max-width: 600px) {
+ @media (max-width: 900px) {
html {
font-size: 87.5%;
} | Smaller size at <I>px | Malvid_Malvid | train | js |
960bfe05d25402861af8dbbaa161459e650cc439 | diff --git a/simple_history/models.py b/simple_history/models.py
index <HASH>..<HASH> 100755
--- a/simple_history/models.py
+++ b/simple_history/models.py
@@ -1,10 +1,7 @@
import copy
import datetime
-
from django.db import models
-
-from chapter11.current_user import models as current_user
-from chapter11.history import manager
+from manager import HistoryDescriptor
class HistoricalRecords(object):
def contribute_to_class(self, cls, name):
@@ -21,7 +18,7 @@ class HistoricalRecords(object):
models.signals.post_delete.connect(self.post_delete, sender=sender,
weak=False)
- descriptor = manager.HistoryDescriptor(history_model)
+ descriptor = HistoryDescriptor(history_model)
setattr(sender, self.manager_name, descriptor)
def create_history_model(self, model):
@@ -70,7 +67,6 @@ class HistoricalRecords(object):
return {
'history_id': models.AutoField(primary_key=True),
'history_date': models.DateTimeField(default=datetime.datetime.now),
- 'history_user': current_user.CurrentUserField(related_name=rel_nm),
'history_type': models.CharField(max_length=1, choices=(
('+', 'Created'),
('~', 'Changed'), | removed current_user because it wasn't thread safe at Martys request | treyhunner_django-simple-history | train | py |
16de071992080eadbf6168b445c175560ebd0dbe | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -151,8 +151,6 @@
rule: function(name) {
var rule;
return this.done(function(string, descriptor) {
- if (!string)
- return false;
if (!rule) {
rule = this.rules[name];
if (!rule) | debug .rule with empty string | nomocas_elenpi | train | js |
17ed01006061e4f85220c123073cdb50d79c5cd3 | diff --git a/core-bundle/contao/library/Contao/System.php b/core-bundle/contao/library/Contao/System.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/library/Contao/System.php
+++ b/core-bundle/contao/library/Contao/System.php
@@ -424,7 +424,7 @@ abstract class System
}
elseif (file_exists(TL_ROOT . '/' . $strFile . '.php'))
{
- $objCacheFallback->append(static::readPhpFileWithoutTags($strFile . '.php'));
+ $objCacheFile->append(static::readPhpFileWithoutTags($strFile . '.php'));
}
} | [Core] Fixed an issue with the language cache files not being generated correctly | contao_contao | train | php |
ba9be4b5a929185eff9041ba68b4565522a7dbe8 | diff --git a/lib/extension.api.js b/lib/extension.api.js
index <HASH>..<HASH> 100644
--- a/lib/extension.api.js
+++ b/lib/extension.api.js
@@ -125,9 +125,10 @@ module.exports = function (Aquifer) {
// Callback defaults to empty.
callback = callback || function () {};
- // If the extension is installed but not downloaded, download.
+ // If the extension is installed but not downloaded,
+ // tell the user to reload the extensions.
if (self.installed && !self.downloaded) {
- callback('Some extensions are have not been downloaded. Please run "aquifer extensions-load".');
+ callback('Some installed extensions have not been downloaded. Please run "aquifer extensions-load".');
return;
} | Improve out-of-sync extensions message | aquifer_aquifer | train | js |
1b2475e22f9b198b8e3aa8e5b851567ef470e960 | diff --git a/src/prebid.js b/src/prebid.js
index <HASH>..<HASH> 100644
--- a/src/prebid.js
+++ b/src/prebid.js
@@ -223,6 +223,9 @@ $$PREBID_GLOBAL$$.renderAd = function (doc, id) {
const { height, width, ad, mediaType, adUrl, renderer } = bid;
+ const creativeComment = document.createComment(`Creative ${bid.creativeId} served by ${bid.bidder} Prebid.js Header Bidding`);
+ utils.insertElement(creativeComment, doc, 'body');
+
if (renderer && renderer.url) {
renderer.render(bid);
} else if ((doc === document && !utils.inIframe()) || mediaType === 'video') { | Add debug info to DOM for prebid creatives (#<I>) | prebid_Prebid.js | train | js |
3f2d1ce6bbcfe507432818348f5dc01dba84037d | diff --git a/src/Traits/HashidsTrait.php b/src/Traits/HashidsTrait.php
index <HASH>..<HASH> 100644
--- a/src/Traits/HashidsTrait.php
+++ b/src/Traits/HashidsTrait.php
@@ -19,7 +19,7 @@ trait HashidsTrait
{
$obscure = property_exists($this, 'obscure') && is_array($this->obscure) ? $this->obscure : config('cortex.foundation.obscure');
- return in_array(request()->route('accessarea'), $obscure['areas'])
+ return in_array(app('request.accessarea'), $obscure['areas'])
? Hashids::encode($this->getAttribute($this->getKeyName()), $obscure['rotate'] ? random_int(1, 999) : 1)
: $this->getAttribute($this->getRouteKeyName());
}
@@ -36,7 +36,7 @@ trait HashidsTrait
{
$obscure = property_exists($this, 'obscure') && is_array($this->obscure) ? $this->obscure : config('cortex.foundation.obscure');
- return in_array(request()->route('accessarea'), $obscure['areas'])
+ return in_array(app('request.accessarea'), $obscure['areas'])
? $this->where($field ?? $this->getKeyName(), optional(Hashids::decode($value))[0])->first()
: $this->where($field ?? $this->getRouteKeyName(), $value)->first();
} | Refactor route parameters to container service binding | rinvex_laravel-support | train | php |
c2037fc8a1dc8f338f68d90114ee1ccad6578d85 | diff --git a/TodoList.py b/TodoList.py
index <HASH>..<HASH> 100644
--- a/TodoList.py
+++ b/TodoList.py
@@ -280,6 +280,11 @@ class TodoList(object):
def todos(self):
return self._todos
+ def set_todo_completed(self, p_number):
+ todo = self.todo(p_number)
+ todo.set_completed()
+ self.dirty = True
+
def __str__(self):
return '\n'.join(pretty_print(self._todos))
diff --git a/test/TodoListTest.py b/test/TodoListTest.py
index <HASH>..<HASH> 100644
--- a/test/TodoListTest.py
+++ b/test/TodoListTest.py
@@ -142,6 +142,10 @@ class TodoListTester(unittest.TestCase):
self.assertIsInstance(todo, Todo.Todo)
self.assertEquals(todo.text(), "No number")
+ def test_todo_complete(self):
+ self.todolist.set_todo_completed(1)
+ self.assertTrue(self.todolist.todo(1).is_completed())
+
class TodoListDependencyTester(unittest.TestCase):
def setUp(self):
self.todolist = TodoList.TodoList([]) | Add method to mark a list as completed from TodoList.
This will mark the todo list dirty. | bram85_topydo | train | py,py |
0d156b6717dc9f906f059ff0cedefb211f8f8a84 | diff --git a/drivers/python/rethinkdb/net.py b/drivers/python/rethinkdb/net.py
index <HASH>..<HASH> 100644
--- a/drivers/python/rethinkdb/net.py
+++ b/drivers/python/rethinkdb/net.py
@@ -50,6 +50,7 @@ class Cursor(object):
self.responses = [ ]
self.outstanding_requests = 0
self.end_flag = False
+ self.connection_closed = False
def _extend(self, response):
self.end_flag = response.type != p.Response.SUCCESS_PARTIAL
@@ -60,6 +61,8 @@ class Cursor(object):
def __iter__(self):
while True:
+ if len(self.responses) == 0 and self.connection_closed:
+ raise RqlDriverError("Connection closed, cannot read cursor")
if len(self.responses) == 0 and not self.end_flag:
self.conn._continue_cursor(self)
if len(self.responses) == 1 and not self.end_flag:
@@ -148,6 +151,9 @@ class Connection(object):
pass
self.socket.close()
self.socket = None
+ for (token, cursor) in self.cursor_cache.iteritems():
+ cursor.end_flag = True
+ cursor.connection_closed = True
self.cursor_cache = { }
def noreply_wait(self): | adding better error message when using an incomplete cursor on a closed connection | rethinkdb_rethinkdb | train | py |
ff7a5a1ff629cfdbd26d4d708c51fde739ffbf3d | diff --git a/domain_models/__init__.py b/domain_models/__init__.py
index <HASH>..<HASH> 100644
--- a/domain_models/__init__.py
+++ b/domain_models/__init__.py
@@ -1,3 +1,3 @@
"""Domain models."""
-VERSION = '0.0.7'
+VERSION = '0.0.8' | Increment version to <I> | ets-labs_python-domain-models | train | py |
b795835f36ae630ff2b39b62aa61e0738e3a0296 | diff --git a/pyes/facets.py b/pyes/facets.py
index <HASH>..<HASH> 100644
--- a/pyes/facets.py
+++ b/pyes/facets.py
@@ -167,7 +167,7 @@ class StatisticalFacet(Facet):
class TermFacet(Facet):
_internal_name = "terms"
- def __init__(self, field, name=None, size=10,
+ def __init__(self, field=None, fields=None, name=None, size=10,
order=None, exclude=None,
regex=None, regex_flags="DOTALL",
script=None, **kwargs):
@@ -184,7 +184,14 @@ class TermFacet(Facet):
self.script = script
def serialize(self):
- data = {'field':self.field}
+ if self.fields:
+ data = {'fields':self.fields}
+ else:
+ if self.field:
+ data = {'field':self.field}
+ else:
+ raise RuntimeError("Field or Fields is required:%s" % self.order)
+
if self.size:
data['size'] = self.size | Added MultiFields support to TermFacet, now field isn't mandatory; instead either field or fields has to be supplied | aparo_pyes | train | py |
114642d78c1d0167d9e328061b1876b1c01fa210 | diff --git a/superset/viz.py b/superset/viz.py
index <HASH>..<HASH> 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1719,7 +1719,7 @@ class ChordViz(BaseViz):
qry = super().query_obj()
fd = self.form_data
qry["groupby"] = [fd.get("groupby"), fd.get("columns")]
- qry["metrics"] = [utils.get_metric_name(fd.get("metric"))]
+ qry["metrics"] = [fd.get("metric")]
return qry
def get_data(self, df: pd.DataFrame) -> VizData: | fix adhoc metric bug in chord diagram (#<I>) | apache_incubator-superset | train | py |
23589bad72ee085e0ca7f61264612474115f1062 | diff --git a/Bootstrap.php b/Bootstrap.php
index <HASH>..<HASH> 100644
--- a/Bootstrap.php
+++ b/Bootstrap.php
@@ -1154,10 +1154,10 @@ class Shopware_Plugins_Backend_PlentyConnector_Bootstrap extends Shopware_Compon
*/
public function onOrderSaveOrderProcessDetails(Enlight_Event_EventArgs $arguments)
{
- $OrderResoure = new \Shopware\Components\Api\Resource\Order();
- $OrderResoure->setManager(Shopware()->Models());
+ $orderResource = new \Shopware\Components\Api\Resource\Order();
+ $orderResource->setManager(Shopware()->Models());
- $orderId = $OrderResoure->getIdFromNumber($arguments->getSubject()->sOrderNumber);
+ $orderId = $orderResource->getIdFromNumber($arguments->getSubject()->sOrderNumber);
Shopware()->Db()->query('
INSERT INTO plenty_order | [TASK] Correct spelling
Corrects the spelling of a variable.
Old: "$OrderResoure"
New: "$orderResource" | plentymarkets_plentymarkets-shopware-connector | train | php |
b66f7b0b30ef67e5501c247e17453dfa7965601c | diff --git a/js/metro-locale.js b/js/metro-locale.js
index <HASH>..<HASH> 100644
--- a/js/metro-locale.js
+++ b/js/metro-locale.js
@@ -83,10 +83,23 @@
buttons: [
"Oggi", "Cancella"
]
+ },
+ 'de': {
+ months: [
+ "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember",
+ "Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"
+ ],
+ days: [
+ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag",
+ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
+ ],
+ buttons: [
+ "Heute", "zurücksetzten"
+ ]
}
};
$.Metro.setLocale = function(locale, data){
$.Metro.Locale[locale] = data;
};
-})(jQuery);
\ No newline at end of file
+})(jQuery); | Update metro-locale.js
German Translation | olton_Metro-UI-CSS | train | js |
37127b7a591b99ee80994a784429c8cd3285e85d | diff --git a/modules/react/src/deckgl.js b/modules/react/src/deckgl.js
index <HASH>..<HASH> 100644
--- a/modules/react/src/deckgl.js
+++ b/modules/react/src/deckgl.js
@@ -148,6 +148,10 @@ const DeckGL = forwardRef((props, ref) => {
onInteractionStateChange: handleInteractionStateChange
};
+ // The defaultValue for _customRender is null, which would overwrite the definition
+ // of _customRender. Remove to avoid frequently redeclaring the method here.
+ delete forwardProps._customRender;
+
if (thisRef.deck) {
thisRef.deck.setProps(forwardProps);
} | Fix regression in DeckGL React component not syncing base map (#<I>) | uber_deck.gl | train | js |
ec5e0c6cf830a4df7abb5f048672dcde78eb5024 | diff --git a/mtools/mlaunch/mlaunch.py b/mtools/mlaunch/mlaunch.py
index <HASH>..<HASH> 100755
--- a/mtools/mlaunch/mlaunch.py
+++ b/mtools/mlaunch/mlaunch.py
@@ -48,7 +48,8 @@ def wait_for_host(port, interval=1, timeout=30, to_start=True, queue=None):
try:
# make connection and ping host
con = Connection(host)
- con.admin.command('ping')
+ if not con.alive():
+ raise Exception
if to_start:
if queue:
queue.put_nowait((port, True))
diff --git a/mtools/test/test_mlaunch.py b/mtools/test/test_mlaunch.py
index <HASH>..<HASH> 100644
--- a/mtools/test/test_mlaunch.py
+++ b/mtools/test/test_mlaunch.py
@@ -52,7 +52,8 @@ class TestMLaunch(object):
ports = self.tool.get_tagged(['all', 'running'])
processes = self.tool._get_processes().values()
for p in processes:
- p.kill()
+ p.terminate()
+ p.wait(10)
self.tool.wait_for(ports, to_start=False) | use con.alive() instead of ping command in wait_for_host. more lightweight.
use p.terminate() instead of p.kill() and wait for process to die in test_mlaunch.py | rueckstiess_mtools | train | py,py |
769f7f8b491bcbcc4ed3af9ee9365a529c1ec373 | diff --git a/src/Tests/Doctrine/Migration/DriverBasedMigrationTest.php b/src/Tests/Doctrine/Migration/DriverBasedMigrationTest.php
index <HASH>..<HASH> 100644
--- a/src/Tests/Doctrine/Migration/DriverBasedMigrationTest.php
+++ b/src/Tests/Doctrine/Migration/DriverBasedMigrationTest.php
@@ -61,7 +61,7 @@ class DriverBasedMigrationTest extends \PHPUnit_Framework_TestCase
$property = $reflection->getProperty('connection');
$property->setAccessible(true);
}
- return array_map(function (Driver $driver, $dbms) use ($reflection, $property) {
+ return array_map(function(Driver $driver, $dbms) use ($reflection, $property) {
$migration = $reflection->newInstanceWithoutConstructor();
$property->setValue($migration, new Connection([], $driver));
return [$migration, new Schema(), $dbms]; | Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on <URL> | octolabot_Common | train | php |
59795ea684eb9d16be30b4ec711ae008f5c185fb | diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/interpreter/impl/XbaseInterpreter.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/interpreter/impl/XbaseInterpreter.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/interpreter/impl/XbaseInterpreter.java
+++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/interpreter/impl/XbaseInterpreter.java
@@ -1204,8 +1204,12 @@ public class XbaseInterpreter implements IExpressionInterpreter {
}
protected Object _doEvaluate(XAssignment assignment, IEvaluationContext context, CancelIndicator indicator) {
+ JvmIdentifiableElement feature = assignment.getFeature();
+ if (feature instanceof JvmOperation && ((JvmOperation) feature).isVarArgs()) {
+ return _doEvaluate((XAbstractFeatureCall) assignment, context, indicator);
+ }
Object value = internalEvaluate(assignment.getValue(), context, indicator);
- Object assign = assignValueTo(assignment.getFeature(), assignment, value, context, indicator);
+ Object assign = assignValueTo(feature, assignment, value, context, indicator);
return assign;
} | [bug <I>] Fixed assignment of a single value as a varargs argument
Change-Id: I<I>c<I>fc<I>e<I>e<I>c<I>a<I>b0fe<I>fbb<I>e | eclipse_xtext-extras | train | java |
d6a8f6a1e1733c8d825a0891935c9796da822f9a | diff --git a/lib/Ogone/PaymentRequest.php b/lib/Ogone/PaymentRequest.php
index <HASH>..<HASH> 100644
--- a/lib/Ogone/PaymentRequest.php
+++ b/lib/Ogone/PaymentRequest.php
@@ -30,6 +30,7 @@ class PaymentRequest
'Aurore' => 'CreditCard',
'Bank transfer' => 'Bank transfer',
'BCMC' => 'CreditCard',
+ 'Belfius Direct Net' => 'Belfius Direct Net',
'Billy' => 'CreditCard',
'cashU' => 'cashU',
'CB' => 'CreditCard', | Add support for Payment Brand Belfius Direct Net | marlon-be_marlon-ogone | train | php |
367c05a4c35c8c321e66573d10837822f69dbef2 | diff --git a/test/migration/DatabaseMigratorSpec.js b/test/migration/DatabaseMigratorSpec.js
index <HASH>..<HASH> 100644
--- a/test/migration/DatabaseMigratorSpec.js
+++ b/test/migration/DatabaseMigratorSpec.js
@@ -168,7 +168,7 @@ describe("DatabaseMigrator", () => {
}).catch(error => fail(error))
})
- fit("should allow usage of plain objects as schema descriptors", (done) => {
+ it("should allow usage of plain objects as schema descriptors", (done) => {
DBFactory.open(DB_NAME, {
version: 1,
objectStores: [ | removed a "this test only" flag | jurca_indexed-db.es6 | train | js |
73444771cf4dab163fdd97dac46832838bc26d6f | diff --git a/lib/waterline/utils/query/normalize-value-to-set.js b/lib/waterline/utils/query/normalize-value-to-set.js
index <HASH>..<HASH> 100644
--- a/lib/waterline/utils/query/normalize-value-to-set.js
+++ b/lib/waterline/utils/query/normalize-value-to-set.js
@@ -191,8 +191,14 @@ module.exports = function normalizeValueToSet(value, supposedAttrName, modelIden
//
// > Only relevant if this value actually matches an attribute definition.
if (!correspondingAttrDef) {
+
// If this value doesn't match a recognized attribute def, then don't validate it
// (it means this model must have `schema: false`)
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ // FUTURE: In this case, validate/coerce this as `type: 'json'`.
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
}//‡
else { | Add note for future about potentially validating/coercing extraneous values (i.e. that don't match a recognized attribute def) as JSON. For the time being, they're passed through as refs. | balderdashy_waterline | train | js |
e0722b7e02f579e84589edc37bece137a2bf7bc8 | diff --git a/eyap/core/comments.py b/eyap/core/comments.py
index <HASH>..<HASH> 100644
--- a/eyap/core/comments.py
+++ b/eyap/core/comments.py
@@ -179,7 +179,7 @@ class CommentThread(object):
"""
# Regular expression for what consistutes a hashtag.
- hashtag_re = '(#[-.a-zA-Z_/]+[a-zA-Z_])'
+ hashtag_re = r'\s+(#[-.a-zA-Z_/]+[a-zA-Z_])'
# Regular expression for valid attachment location
valid_attachment_loc_re = '^[-.a-zA-Z0-9_,/]+$' | Fix hashtag_re to not match unless whitespace before hashtag | emin63_eyap | train | py |
c1949a4e2d57534d764d5d166e73f50f8facb2d4 | diff --git a/emiz/weather/avwx.py b/emiz/weather/avwx.py
index <HASH>..<HASH> 100644
--- a/emiz/weather/avwx.py
+++ b/emiz/weather/avwx.py
@@ -207,7 +207,7 @@ class AVWX:
'options': 'info,speech,summary'
}
result = AVWX._query(f'https://avwx.rest/api/parse/metar', params=params)
- intro = f'Automated weather bulletin for {result.info["City"]} {result.info["Name"]}.'
+ intro = f'Automated traffic information service for {result.info["City"]} {result.info["Name"]}.'
identifier = f'Advise you have information {PHONETIC[random_string(1, string.ascii_uppercase)]}.'
speech = f'{intro} {result.speech}. {identifier}'
LOGGER.debug(f'resulting speech: {speech}') | chg: change ATIS intro speech | etcher-be_emiz | train | py |
d17a7f04d45bc95e95eeeb97d87fb86aac5c2508 | diff --git a/test/unit/callbacks.js b/test/unit/callbacks.js
index <HASH>..<HASH> 100644
--- a/test/unit/callbacks.js
+++ b/test/unit/callbacks.js
@@ -203,3 +203,21 @@ jQuery.each( tests, function( strFlags, resultString ) {
});
})();
+
+test( "jQuery.Callbacks( options ) - options are copied", function() {
+
+ expect( 1 );
+
+ var options = {
+ memory: true
+ },
+ cb = jQuery.Callbacks( options );
+
+ options.memory = false;
+
+ cb.fire( "hello" );
+
+ cb.add(function( hello ) {
+ strictEqual( hello, "hello", "options are copied internally" );
+ });
+}); | Adds a unit test to control options are being copied by jQuery.Callbacks internally. | jquery_jquery | train | js |
3a0a068502bd33af25b280c96f1544c6ddfd92fc | diff --git a/lib/merchant/billing/Gateway.php b/lib/merchant/billing/Gateway.php
index <HASH>..<HASH> 100644
--- a/lib/merchant/billing/Gateway.php
+++ b/lib/merchant/billing/Gateway.php
@@ -46,7 +46,7 @@ abstract class Merchant_Billing_Gateway extends Merchant_Billing_Expect
return $ref->getStaticPropertyValue('homepage_url');
}
- public function gateway_key()
+ public function factory_name()
{
$class = str_replace('Merchant_Billing_', '', get_class($this));
return Inflect::underscore($class); | Renaming `gateway_key()` to `factory_name()` | akDeveloper_Aktive-Merchant | train | php |
64597a002f6d28a3396095cab647b5b8b759c4e0 | diff --git a/term/index.js b/term/index.js
index <HASH>..<HASH> 100644
--- a/term/index.js
+++ b/term/index.js
@@ -91,14 +91,16 @@ define(module, function(exports, require) {
},
keypress: function(handler) {
- process.stdin.setRawMode(true);
- process.stdin.setEncoding('utf8');
- process.stdin.on('data', chr => {
- var key = get_key(chr);
- if (key === 'ETX') process.exit(0);
- handler(key, chr);
- });
- process.stdin.resume();
+ if (process.stdin.setRawMode) {
+ process.stdin.setRawMode(true);
+ process.stdin.setEncoding('utf8');
+ process.stdin.on('data', chr => {
+ var key = get_key(chr);
+ if (key === 'ETX') process.exit(0);
+ handler(key, chr);
+ });
+ process.stdin.resume();
+ }
},
/* USER INPUT */ | guard setRawMode for env without it | cjr--_qp-library | train | js |
08a6c0a4c7f99ef2e86844839870b6811cb08550 | diff --git a/lib/heroku/command/apps.rb b/lib/heroku/command/apps.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/command/apps.rb
+++ b/lib/heroku/command/apps.rb
@@ -175,7 +175,7 @@ class Heroku::Command::Apps < Heroku::Command::Base
# $ heroku apps:create myapp-staging --remote staging
#
def create
- name = shift_argument || options[:app]
+ name = shift_argument || options[:app] || ENV['HEROKU_APP']
validate_arguments!
info = api.post_app({ "name" => name, "stack" => options[:stack] }).body | allow HEROKU_APP to be used with apps:create
closes #<I> | heroku_legacy-cli | train | rb |
ef3db7af1e5d618e43f5b7be951623d3742099ab | diff --git a/packages/node_modules/pouchdb-utils/src/guardedConsole.js b/packages/node_modules/pouchdb-utils/src/guardedConsole.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/pouchdb-utils/src/guardedConsole.js
+++ b/packages/node_modules/pouchdb-utils/src/guardedConsole.js
@@ -1,6 +1,6 @@
function guardedConsole(method) {
/* istanbul ignore else */
- if (console !== 'undefined' && method in console) {
+ if (typeof console !== 'undefined' && typeof console[method] === 'function') {
var args = Array.prototype.slice.call(arguments, 1);
console[method].apply(console, args);
} | (#<I>) - Make guardedConsole checks safer | pouchdb_pouchdb | train | js |
cbad8269f001cb22dd5f0c16505c1549b0cb2d17 | diff --git a/better_exchook.py b/better_exchook.py
index <HASH>..<HASH> 100644
--- a/better_exchook.py
+++ b/better_exchook.py
@@ -433,7 +433,7 @@ def str_visible_len(s):
"""
import re
# via: https://github.com/chalk/ansi-regex/blob/master/index.js
- s = re.sub("[\x1b\x9b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]", "", s)
+ s = re.sub("[\x1b\x9b][\\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]", "", s)
return len(s) | fix FutureWarning: Possible nested set at position 5 | albertz_py_better_exchook | train | py |
af607f1403c1b51c9cf86774a3d8dd373d2c7fe0 | diff --git a/src/main/ruby/delayed/sleep_calculator.rb b/src/main/ruby/delayed/sleep_calculator.rb
index <HASH>..<HASH> 100644
--- a/src/main/ruby/delayed/sleep_calculator.rb
+++ b/src/main/ruby/delayed/sleep_calculator.rb
@@ -12,7 +12,7 @@ module Delayed
def calc_sleep_time(time)
count = thread_count rescue nil
- return time if count && count <= 1 || time <= 0
+ return time if ! count || count <= 1 || time <= 0
last = @@last.get_and_set now = java.lang.System.current_time_millis
return time if ( now - last ) > time * 1000 | do not calculate sleep-time when thread_count not available/fails
... also false.to_f might have allways failed! | kares_jruby-rack-worker | train | rb |
280d919da96686f3df8e870336fe5cbc6880a039 | diff --git a/lib/nio/selector.rb b/lib/nio/selector.rb
index <HASH>..<HASH> 100644
--- a/lib/nio/selector.rb
+++ b/lib/nio/selector.rb
@@ -98,7 +98,12 @@ module NIO
selected.size
end
- # Wake up other threads waiting on this selector
+ # Wake up a thread that's in the middle of selecting on this selector, if
+ # any such thread exists.
+ #
+ # Invoking this method more than once between two successive select calls
+ # has the same effect as invoking it just once. In other words, it provides
+ # level-triggered behavior.
def wakeup
# Send the selector a signal in the form of writing data to a pipe
@waker << "\0" | Notes on wakeup's behavior | socketry_nio4r | train | rb |
4476bd302aca47c10b9ff399bcac0c929a00b862 | diff --git a/README.rst b/README.rst
index <HASH>..<HASH> 100644
--- a/README.rst
+++ b/README.rst
@@ -76,6 +76,8 @@ more details.
Changelog
---------
+* v.2.0.9 Fixed multi-subscription with livestreaming (2014-06-25)
+
* v.2.0.8 Bumped to release stable version (2014-06-04)
* v.2.0.7 Small bugfix for livestreaming (2014-05-09)
diff --git a/datasift/__init__.py b/datasift/__init__.py
index <HASH>..<HASH> 100644
--- a/datasift/__init__.py
+++ b/datasift/__init__.py
@@ -44,8 +44,8 @@ more details.
__author__ = "[email protected]"
__status__ = "stable"
-__version__ = "2.0.8"
-__date__ = "4th Jun 2014"
+__version__ = "2.0.9"
+__date__ = "25th Jun 2014"
#-----------------------------------------------------------------------------
# Module constants
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ import os.path
setup(
name="datasift",
- version="2.0.8",
+ version="2.0.9",
author="DataSift",
author_email="[email protected]",
maintainer="DataSift", | bumped to <I> for a release | datasift_datasift-python | train | rst,py,py |
637109226f04852e7362091062645a920009f4f4 | diff --git a/src/main/java/no/finn/unleash/FakeUnleash.java b/src/main/java/no/finn/unleash/FakeUnleash.java
index <HASH>..<HASH> 100644
--- a/src/main/java/no/finn/unleash/FakeUnleash.java
+++ b/src/main/java/no/finn/unleash/FakeUnleash.java
@@ -86,6 +86,7 @@ public final class FakeUnleash implements Unleash {
disableAll = false;
enableAll = false;
features.clear();
+ variants.clear();
}
public void enable(String... features) { | Fix: FakeUnleash resetAll should also reset variants (#<I>) | Unleash_unleash-client-java | train | java |
a6008f41e2b7f34356792c87575b6c9c13dffb53 | diff --git a/clientv3/txn.go b/clientv3/txn.go
index <HASH>..<HASH> 100644
--- a/clientv3/txn.go
+++ b/clientv3/txn.go
@@ -143,11 +143,12 @@ func (txn *txn) Commit() (*TxnResponse, error) {
return (*TxnResponse)(resp), nil
}
- if txn.isWrite {
+ if isRPCError(err) {
return nil, err
}
- if isRPCError(err) {
+ if txn.isWrite {
+ go kv.switchRemote(err)
return nil, err
} | clientv3: retry remote connection on txn write failure | etcd-io_etcd | train | go |
5022a50f2ba7a022d7eb1e236945f6c61b34b6d6 | diff --git a/Job/ShareNewsItem.php b/Job/ShareNewsItem.php
index <HASH>..<HASH> 100755
--- a/Job/ShareNewsItem.php
+++ b/Job/ShareNewsItem.php
@@ -130,14 +130,6 @@ class ShareNewsItem implements JobActionInterface
$newsItem->setUrl($response['updateUrl']);
$newsItem->setUpdateKey($response['updateKey']);
- if ($isCompanyPageShare) {
- $statistics = $connection->getCompanyUpdate($activity, $newsItem);
- } else {
- $statistics = $connection->getUserUpdate($activity, $newsItem);
- }
- $newsItem->setLinkedinData($statistics);
-
-
// Set Operation to closed.
$newsItem->getOperation()->setStatus(Action::STATUS_CLOSED); | don’t get the statistic as that time it will be empty and it’s not part
of the publication | CampaignChain_operation-linkedin | train | php |
98b610c39e2798bc9c9916da1a1fb267413f37da | diff --git a/lib/Bitbucket/API/Http/Client.php b/lib/Bitbucket/API/Http/Client.php
index <HASH>..<HASH> 100644
--- a/lib/Bitbucket/API/Http/Client.php
+++ b/lib/Bitbucket/API/Http/Client.php
@@ -207,6 +207,18 @@ class Client implements ClientInterface
}
/**
+ * Check if specified API version is the one currently in use
+ *
+ * @access public
+ * @param float $version
+ * @return bool
+ */
+ public function isApiVersion($version)
+ {
+ return (abs($this->options['api_version'] - $version) < 0.00001);
+ }
+
+ /**
* {@inheritDoc}
*/
public function getApiBaseUrl() | added isApiVersion() method in http client | gentlero_bitbucket-api | train | php |
4102f998d6a3d146f3162315b341dd8f4c999e7c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name='instana',
- version='0.6.2',
+ version='0.6.3',
download_url='https://github.com/instana/python-sensor',
url='https://www.instana.com/',
license='MIT', | Bump package version to <I> | instana_python-sensor | train | py |
2f59c21e4fd4ada20e98b9b733d9a599a1c3b5f9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -55,7 +55,7 @@ install_requires = [
'Flask>=0.11.1',
'Flask-Alembic>=2.0.1',
'Flask-SQLAlchemy>=2.1',
- 'SQLAlchemy>=1.0',
+ 'SQLAlchemy>=1.1.0',
'SQLAlchemy-Utils>=0.33.1',
] | setup: bumps SQLAlchemy version | inveniosoftware_invenio-db | train | py |
9ace604b63045ebbb066cab5e8508b51d0900a05 | diff --git a/staging/src/k8s.io/client-go/tools/cache/reflector.go b/staging/src/k8s.io/client-go/tools/cache/reflector.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/client-go/tools/cache/reflector.go
+++ b/staging/src/k8s.io/client-go/tools/cache/reflector.go
@@ -322,7 +322,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
initTrace.Step("Objects listed", trace.Field{Key: "error", Value: err})
if err != nil {
klog.Warningf("%s: failed to list %v: %v", r.name, r.expectedTypeName, err)
- return fmt.Errorf("failed to list %v: %v", r.expectedTypeName, err)
+ return fmt.Errorf("failed to list %v: %w", r.expectedTypeName, err)
}
// We check if the list was paginated and if so set the paginatedResult based on that. | fix: reflector to return wrapped list errors
This fix allows Reflector/Informer callers to detect API errors using the standard Go errors.As unwrapping methods used by the apimachinery helper methods. Combined with a custom WatchErrorHandler, this can be used to stop an informer that encounters specific errors, like resource not found or forbidden. | kubernetes_kubernetes | train | go |
4cbe06bf36cba087c0393c7bfcf29d201b5c60c6 | diff --git a/controller/scheduler/scheduler.go b/controller/scheduler/scheduler.go
index <HASH>..<HASH> 100644
--- a/controller/scheduler/scheduler.go
+++ b/controller/scheduler/scheduler.go
@@ -148,9 +148,14 @@ func main() {
logger.SetHandler(log15.LvlFilterHandler(log15.LvlInfo, log15.StdoutHandler))
log := logger.New("fn", "main")
+ // Use a low timeout for HTTP requests to avoid blocking the main loop.
+ //
+ // TODO: make all HTTP calls asynchronous
+ // (see https://github.com/flynn/flynn/issues/1920)
+ httpClient := &http.Client{Timeout: 10 * time.Second}
+
log.Info("creating cluster and controller clients")
- hc := &http.Client{Timeout: 5 * time.Second}
- clusterClient := utils.ClusterClientWrapper(cluster.NewClientWithHTTP(nil, hc))
+ clusterClient := utils.ClusterClientWrapper(cluster.NewClientWithHTTP(nil, httpClient))
controllerClient, err := controller.NewClient("", os.Getenv("AUTH_KEY"))
if err != nil {
log.Error("error creating controller client", "err", err) | scheduler: Increase HTTP timeout to <I>s
This timeout prevents HTTP requests from blocking the main scheduler
loop, but setting it too low causes HTTP requests to be cancelled when
they in fact just take a little longer than 5s. | flynn_flynn | train | go |
01789bfae66a17cdb1ca83b966271a966e9117ec | diff --git a/txmongo/__init__.py b/txmongo/__init__.py
index <HASH>..<HASH> 100644
--- a/txmongo/__init__.py
+++ b/txmongo/__init__.py
@@ -13,9 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from bson import ObjectId, SON
from pymongo.uri_parser import parse_uri
-from twisted.internet import defer, reactor, task
+from twisted.internet import defer, reactor
from twisted.internet.protocol import ReconnectingClientFactory
from txmongo.database import Database
from txmongo.protocol import MongoProtocol
@@ -116,19 +115,24 @@ class ConnectionPool(object):
def uri(self):
return self.__uri
-class Connection(ConnectionPool):
- pass
+Connection = ConnectionPool
+
+###
+# Begin Legacy Wrapper
+###
-# FOR LEGACY REASONS
class MongoConnection(Connection):
def __init__(self, host, port, pool_size=1):
uri = 'mongodb://%s:%d/' % (host, port)
Connection.__init__(self, uri, pool_size=pool_size)
-
lazyMongoConnectionPool = MongoConnection
lazyMongoConnection = MongoConnection
MongoConnectionPool = MongoConnection
+###
+# End Legacy Wrapper
+###
+
if __name__ == '__main__':
import sys
from twisted.python import log | txmongo: Just a little cleanup. | twisted_txmongo | train | py |
f5b58d02ebb8fc2dba6e4863f146d117eda0360f | diff --git a/scripts/views/choropleth.js b/scripts/views/choropleth.js
index <HASH>..<HASH> 100644
--- a/scripts/views/choropleth.js
+++ b/scripts/views/choropleth.js
@@ -50,7 +50,7 @@ module.exports = Backbone.View.extend({
this.$('.filters').text(filters).parent().toggle(filters ? true : false);
},
render: function() {
- this.map = L.map(this.$('.card').get(0)).setView([39.95, -75.1667], 11);
+ this.map = L.map(this.$('.card').get(0));//.setView([39.95, -75.1667], 13);
L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
subdomains: 'abcd',
@@ -94,6 +94,9 @@ module.exports = Backbone.View.extend({
});
}
}).addTo(this.map);
+
+ // Zoom to boundaries of new layer
+ this.map.fitBounds((L.featureGroup([this.layer])).getBounds());
}
},
/** | Map zooms to extent of boundaries. Closes #<I> | timwis_vizwit | train | js |
d92a5385f15795ed9d781f2daeb9369815eec87b | diff --git a/lib/multiarray/rgb.rb b/lib/multiarray/rgb.rb
index <HASH>..<HASH> 100644
--- a/lib/multiarray/rgb.rb
+++ b/lib/multiarray/rgb.rb
@@ -22,7 +22,7 @@ module Hornetseye
class << self
def generic?( value )
- value.is_a? Numeric
+ value.is_a?( Numeric ) or value.is_a?( GCCValue )
end
def define_unary_op( op )
@@ -103,9 +103,9 @@ module Hornetseye
def ==( other )
if other.is_a? RGB
- ( @r == other.r ).and( @g == other.g ).and( @b == other.b )
+ @r.eq( other.r ).and( @g.eq( other.g ) ).and( @b.eq( other.b ) )
elsif RGB.generic? other
- ( @r == other ).and( @g == other ).and( @b == other )
+ @r.eq( other ).and( @g.eq( other ) ).and( @b.eq( other ) )
else
false
end | Working on compiling RGB expressions | wedesoft_multiarray | train | rb |
f98fa66d735b644f7b785f9356cfac0082ea2cda | diff --git a/lib/atomy/module.rb b/lib/atomy/module.rb
index <HASH>..<HASH> 100644
--- a/lib/atomy/module.rb
+++ b/lib/atomy/module.rb
@@ -71,7 +71,7 @@ module Atomy
name)
end
- def define_macro(pattern, body, file)
+ def define_macro(pattern, body, file = @file)
macro_definer(pattern, body).evaluate(
Binding.setup(
TOPLEVEL_BINDING.variables, | tweak Atomy::Module#define_macro to have a file default | vito_atomy | train | rb |
23140fb95b7f1bcbb730a2caeaacdaac493c24da | diff --git a/schema/SchemaTypes.php b/schema/SchemaTypes.php
index <HASH>..<HASH> 100644
--- a/schema/SchemaTypes.php
+++ b/schema/SchemaTypes.php
@@ -1420,7 +1420,17 @@ class SchemaTypes
case 'enumeration':
- $content['values'][] = (string) $node->attributes()->value;
+ $attribs = $node->attributes();
+ $enum = array( 'value' => (string) $attribs->value );
+ if ( property_exists( $attribs, 'id' ) )
+ {
+ $enum['id'] = (string)$attribs->id;
+ $name = \XBRL::GUID();
+ $this->typeIds[ $enum['id'] ] = array( 'name' => $name, 'istype' => true );
+ $this->AddSimpleType( $prefix, $name );
+ }
+
+ $content['values'][] = $enum;
break;
case 'pattern': | Updated to record the ids and types of complex type enumerations | bseddon_xml | train | php |
b220dd4315ecb49b009f199bb05538825d4c1901 | diff --git a/lib/api/api-base.js b/lib/api/api-base.js
index <HASH>..<HASH> 100644
--- a/lib/api/api-base.js
+++ b/lib/api/api-base.js
@@ -151,12 +151,8 @@ module.exports = function(grasshopper) {
* @returns {boolean}
*/
base.userCan = function(userObj, minPriviledge){
- //[TODO] Need to validate token and make sure that user has permissions to execute this request.
var userPrivLevel = base.AVAILABLE_PRIVILEGES[userObj.profile.role.toUpperCase()];
- console.log("########## ##########");
- console.log(userPrivLevel + '<=' + minPriviledge);
- console.log("####################");
return (userPrivLevel <= parseInt(minPriviledge, 10));
}; | Removed debugging code and [TODO] | grasshopper-cms_grasshopper-api-js | train | js |
9211a1daa73244cec8bfb5e099fe5b45c5ab4442 | diff --git a/services/content/store.go b/services/content/store.go
index <HASH>..<HASH> 100644
--- a/services/content/store.go
+++ b/services/content/store.go
@@ -115,6 +115,7 @@ func (rs *remoteStore) Writer(ctx context.Context, ref string, size int64, expec
}
return &remoteWriter{
+ ref: ref,
client: wrclient,
offset: offset,
}, nil
diff --git a/services/content/writer.go b/services/content/writer.go
index <HASH>..<HASH> 100644
--- a/services/content/writer.go
+++ b/services/content/writer.go
@@ -16,14 +16,6 @@ type remoteWriter struct {
digest digest.Digest
}
-func newRemoteWriter(client contentapi.Content_WriteClient, ref string, offset int64) (*remoteWriter, error) {
- return &remoteWriter{
- ref: ref,
- client: client,
- offset: offset,
- }, nil
-}
-
// send performs a synchronous req-resp cycle on the client.
func (rw *remoteWriter) send(req *contentapi.WriteRequest) (*contentapi.WriteResponse, error) {
if err := rw.client.Send(req); err != nil { | Set the remote writer ref on writer creation
Ensures that status calls to the remote writer correctly
sets the ref. | containerd_containerd | train | go,go |
def6c85401e468ef316fc267083e664ee476c20b | diff --git a/service/runtime/server/handler/handler.go b/service/runtime/server/handler/handler.go
index <HASH>..<HASH> 100644
--- a/service/runtime/server/handler/handler.go
+++ b/service/runtime/server/handler/handler.go
@@ -123,6 +123,7 @@ func (r *Runtime) Logs(ctx context.Context, req *pb.LogsRequest, stream pb.Runti
case <-ctx.Done():
// stop the stream once done
logStream.Stop()
+ return
}
}
}() | return after stopping log stream (#<I>) | micro_micro | train | go |
4bebcef6ef3e1b77092de2ea646c6eb75c7ee0ab | diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb
index <HASH>..<HASH> 100644
--- a/lib/linguist/heuristics.rb
+++ b/lib/linguist/heuristics.rb
@@ -18,9 +18,8 @@ module Linguist
data = blob.data
@heuristics.each do |heuristic|
- if heuristic.matches?(languages)
- language = heuristic.call(data)
- return [language] if language
+ if heuristic.matches?(languages) && result = heuristic.call(data)
+ return Array(result)
end
end | Allow disambiguate to return an Array | github_linguist | train | rb |
14dab16ee9b522daf3dd40f48ba15d8a96d26f5f | diff --git a/LiSE/util.py b/LiSE/util.py
index <HASH>..<HASH> 100644
--- a/LiSE/util.py
+++ b/LiSE/util.py
@@ -5,6 +5,9 @@
"""
from collections import Mapping
from copy import deepcopy
+from gorm.xjson import JSONReWrapper, JSONListReWrapper, json_deepcopy
+from gorm.reify import reify
+from collections import MutableMapping, MutableSequence
def dispatch(d, key, *args):
@@ -192,11 +195,6 @@ def path_len(graph, path, weight=None):
# ==Caching==
-from gorm.xjson import JSONWrapper, JSONListWrapper
-from gorm.reify import reify
-from collections import MutableMapping, MutableSequence
-
-
def _keycache(self, keycache, k, meth): | JSONRe*Wrapper and json_deepcopy live in gorm now
Also move imports to top of util.py | LogicalDash_LiSE | train | py |
5e261e47f3b819905433cc87be9b6d45bf4dca14 | diff --git a/epiceditor/js/epiceditor.js b/epiceditor/js/epiceditor.js
index <HASH>..<HASH> 100644
--- a/epiceditor/js/epiceditor.js
+++ b/epiceditor/js/epiceditor.js
@@ -443,7 +443,7 @@
}
// Fucking Safari's native fullscreen works terribly
- // REMOVE THIS IF SAFARI 6 WORKS BETTER
+ // REMOVE THIS IF SAFARI 7 WORKS BETTER
if (_isSafari()) {
nativeFs = false;
}
diff --git a/src/editor.js b/src/editor.js
index <HASH>..<HASH> 100644
--- a/src/editor.js
+++ b/src/editor.js
@@ -443,7 +443,7 @@
}
// Fucking Safari's native fullscreen works terribly
- // REMOVE THIS IF SAFARI 6 WORKS BETTER
+ // REMOVE THIS IF SAFARI 7 WORKS BETTER
if (_isSafari()) {
nativeFs = false;
} | Ticket #6 - Yes. Safari 6's Fullscreen API still doesn't work like everyone elses, so update the comment to recheck when Safari 7 comes out. | OscarGodson_EpicEditor | train | js,js |
8b5f79b53448fc4d820abae9b38f2e964a2eecfd | diff --git a/jmock/core/src/test/jmock/core/testsupport/MockDynamicMock.java b/jmock/core/src/test/jmock/core/testsupport/MockDynamicMock.java
index <HASH>..<HASH> 100644
--- a/jmock/core/src/test/jmock/core/testsupport/MockDynamicMock.java
+++ b/jmock/core/src/test/jmock/core/testsupport/MockDynamicMock.java
@@ -23,13 +23,13 @@ public class MockDynamicMock
return getMockedTypeResult;
}
- public ExpectationCounter addCalls = new ExpectationCounter("add #calls");
- public ExpectationValue addInvokable = new ExpectationValue("add invokable");
+ public ExpectationCounter addInvokableCalls = new ExpectationCounter("addInvokable #calls");
+ public ExpectationValue addInvokable = new ExpectationValue("addInvokable invokable");
public void addInvokable(Invokable invokable) {
AssertMo.assertNotNull("invokable", invokable);
addInvokable.setActual(invokable);
- addCalls.inc();
+ addInvokableCalls.inc();
}
public ExpectationValue setDefaultStub = new ExpectationValue("setDefaultStub"); | [np] Fixed names of expectations | jmock-developers_jmock-library | train | java |
5fe7ae348a7c18b170251965a0a9ac1e6fbae3bf | diff --git a/tests/PHPUnit/System/BlobReportLimitingTest.php b/tests/PHPUnit/System/BlobReportLimitingTest.php
index <HASH>..<HASH> 100755
--- a/tests/PHPUnit/System/BlobReportLimitingTest.php
+++ b/tests/PHPUnit/System/BlobReportLimitingTest.php
@@ -29,12 +29,6 @@ class BlobReportLimitingTest extends SystemTestCase
*/
public static $fixture = null; // initialized below class definition
- public static function setUpBeforeClass()
- {
- self::setUpConfigOptions();
- parent::setUpBeforeClass();
- }
-
public function setUp()
{
Cache::getTransientCache()->flushAll();
@@ -103,6 +97,8 @@ class BlobReportLimitingTest extends SystemTestCase
*/
public function testApi($api, $params)
{
+ self::setUpConfigOptions();
+
$this->runApiTests($api, $params);
}
@@ -186,5 +182,4 @@ class BlobReportLimitingTest extends SystemTestCase
}
}
-BlobReportLimitingTest::$fixture = new ManyVisitsWithMockLocationProvider();
-BlobReportLimitingTest::$fixture->createConfig = false;
\ No newline at end of file
+BlobReportLimitingTest::$fixture = new ManyVisitsWithMockLocationProvider();
\ No newline at end of file | Fixing BlobReportLimitingTest. Fixture::createConfig has no effect now, and setting config must be done after environment is created. | matomo-org_matomo | train | php |
6c4d73608e18979539fa4a2364f55bf785db48d5 | diff --git a/tests/basic.js b/tests/basic.js
index <HASH>..<HASH> 100644
--- a/tests/basic.js
+++ b/tests/basic.js
@@ -43,16 +43,6 @@ describe('Unirest', function () {
})
});
- it('should correctly handle cookie data.', function (done) {
- var CookieJar = unirest.jar();
- CookieJar.add(unirest.cookie('another cookie=23'));
-
- unirest.get('http://google.com').jar(CookieJar).end(function (response) {
- response.cookie('another cookie').should.exist;
- done();
- });
- });
-
it('should be able to look like unirest-php', function (done) {
unirest.get('http://httpbin.org/gzip', { 'Accept': 'gzip' }, 'Hello World', function (response) {
should(response.status).equal(200); | wait for someone >httpbin< to support returning a cookie header. | Kong_unirest-nodejs | train | js |
c2a84a858442396e3702e80259f2dcedfbd941b9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(name='cwltool',
'rdflib >= 4.1.0',
'rdflib-jsonld >= 0.3.0',
'shellescape',
- 'schema-salad >= 1.18',
+ 'schema-salad >= 1.18.20160930145650',
'typing >= 3.5.2',
'cwltest >= 1.0.20160907111242'],
test_suite='tests', | Bump schema-salad version for validation performance fixes. (#<I>) | common-workflow-language_cwltool | train | py |
b1f19cd8306a3d658c91309648a5e5fc1b6a77ff | diff --git a/pybar/scans/scan_crosstalk.py b/pybar/scans/scan_crosstalk.py
index <HASH>..<HASH> 100644
--- a/pybar/scans/scan_crosstalk.py
+++ b/pybar/scans/scan_crosstalk.py
@@ -16,11 +16,11 @@ class CrosstalkScan(ThresholdScan):
"scan_parameters": [('PlsrDAC', [None, 100])], # the PlsrDAC range
"step_size": 1, # step size of the PlsrDAC during scan
"use_enable_mask": False, # if True, use Enable mask during scan, if False, all pixels will be enabled
- "enable_shift_masks": ["Enable",], # enable masks shifted during scan
+ "enable_shift_masks": ["Enable"], # enable masks shifted during scan
"disable_shift_masks": ["C_High", "C_Low"], # disable masks shifted during scan
"pulser_dac_correction": False # PlsrDAC correction for each double column
})
if __name__ == "__main__":
- RunManager('../configuration.yaml').run_run(ThresholdScan)
+ RunManager('../configuration.yaml').run_run(CrosstalkScan) | MAINT: fix preliminary xtalk scan | SiLab-Bonn_pyBAR | train | py |
e653ebe6351161abd9f13afc91a7c1fea63af6c2 | diff --git a/Kwf/Controller/Action/Auto/Grid.php b/Kwf/Controller/Action/Auto/Grid.php
index <HASH>..<HASH> 100644
--- a/Kwf/Controller/Action/Auto/Grid.php
+++ b/Kwf/Controller/Action/Auto/Grid.php
@@ -854,7 +854,17 @@ abstract class Kwf_Controller_Action_Auto_Grid extends Kwf_Controller_Action_Aut
$csvRows = array();
foreach ($data as $row => $cols) {
$cols = str_replace('"', '""', $cols);
- $csvRows[] = '"'. implode('";"', $cols) .'"';
+ //check if charset is forced in config
+ $importCols = array();
+ if (Kwf_Registry::get('config')->csvWindowsCharset) {
+ foreach ($cols as $col) {
+ $col = mb_convert_encoding($col, 'Windows-1252', 'UTF-8');
+ $importCols[] = $col;
+ }
+ } else {
+ $importCols = $cols;
+ }
+ $csvRows[] = '"'. implode('";"', $importCols) .'"';
$this->_progressBar->next(1, trlKwf('Writing data'));
} | charset for csv export can now be forced to windows charset in config | koala-framework_koala-framework | train | php |
8ca7f947dd3d4bc8f5e5a65b5e74a8a8735296de | diff --git a/app/src/main/java/org/jboss/hal/client/management/AddExtensionWizard.java b/app/src/main/java/org/jboss/hal/client/management/AddExtensionWizard.java
index <HASH>..<HASH> 100644
--- a/app/src/main/java/org/jboss/hal/client/management/AddExtensionWizard.java
+++ b/app/src/main/java/org/jboss/hal/client/management/AddExtensionWizard.java
@@ -117,6 +117,7 @@ class AddExtensionWizard {
.unboundFormItem(urlItem, 0, resources.messages().extensionUrl())
.addOnly()
.build();
+ registerAttachable(form);
}
@Override | Add missing attach call in AddExtensionWizard | hal_console | train | java |
2b7b08c7032a9b7a05350a6f933ebf4b9941d57b | diff --git a/lxd/storage/drivers/load.go b/lxd/storage/drivers/load.go
index <HASH>..<HASH> 100644
--- a/lxd/storage/drivers/load.go
+++ b/lxd/storage/drivers/load.go
@@ -46,18 +46,10 @@ func Load(state *state.State, driverName string, name string, config map[string]
return d, nil
}
-// supportedDrivers cache of supported drivers to avoid inspecting the storage layer every time.
-var supportedDrivers []Info
-
-// SupportedDrivers returns a list of supported storage drivers.
+// SupportedDrivers returns a list of supported storage drivers by loading each storage driver and running its
+// compatibility inspection process. This can take a long time if a driver is not supported.
func SupportedDrivers(s *state.State) []Info {
- // Return cached list if available.
- if supportedDrivers != nil {
- return supportedDrivers
- }
-
- // Initialise fresh cache and populate.
- supportedDrivers = make([]Info, 0, len(drivers))
+ supportedDrivers := make([]Info, 0, len(drivers))
for driverName := range drivers {
driver, err := Load(s, driverName, "", nil, nil, nil, nil) | lxd/storage/drivers/load: Removes SupportedDrivers caching and updates comment
No need for caching now (and more important no need for cache invalidation!) as RemoteDriverNames() is being changed to not need to load the driver. | lxc_lxd | train | go |
ab49331330fa8a6b85a1dc85622d36cd7bd66775 | diff --git a/lib/fog/ibm/models/compute/server.rb b/lib/fog/ibm/models/compute/server.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/ibm/models/compute/server.rb
+++ b/lib/fog/ibm/models/compute/server.rb
@@ -51,8 +51,8 @@ module Fog
def initialize(new_attributes={})
super(new_attributes)
self.name ||= 'fog-instance'
- self.image_id ||= '20025202'
- self.location_id ||= '82'
+ self.image_id ||= '20015393'
+ self.location_id ||= '101'
self.instance_type ||= 'COP32.1/2048/60'
self.key_name ||= 'fog'
end | [ibm] Change default location and image ID | fog_fog | train | rb |
0429916d920cd081d8b51d8cf4a2f5b23e9928f4 | diff --git a/src/main.js b/src/main.js
index <HASH>..<HASH> 100644
--- a/src/main.js
+++ b/src/main.js
@@ -18,7 +18,7 @@ define(
* @param {[type]} target [target description]
* @return {[type]} [return description]
*/
- function ext( target ) {
+ function extend( target ) {
for ( var i = 1, len = arguments.length; i < len; i++ ) {
var source = arguments[ i ];
for ( var key in source ) {
@@ -189,7 +189,7 @@ define(
subClass.prototype = new F();
subClass.prototype.constructor = subClass;
- ext( subClass.prototype, subClassPrototype );
+ extend( subClass.prototype, subClassPrototype );
}
var defaultFilters = {
@@ -686,10 +686,10 @@ debugger
commandClose: '-->'
};
- ext( this.options, options );
+ extend( this.options, options );
this.masters = {};
this.targets = {};
- this.filters = ext({}, defaultFilters);
+ this.filters = extend({}, defaultFilters);
}
/** | rename ext -> extend | ecomfe_etpl | train | js |
19fe1486f37cd1494e39a4b9280b4229a61594a2 | diff --git a/lib/clearance/authentication.rb b/lib/clearance/authentication.rb
index <HASH>..<HASH> 100644
--- a/lib/clearance/authentication.rb
+++ b/lib/clearance/authentication.rb
@@ -18,6 +18,13 @@ module Clearance
@_current_user ||= user_from_cookie
end
+ # Set the current user
+ #
+ # @param [User]
+ def current_user=(user)
+ @_current_user = user
+ end
+
# Is the current user signed in?
#
# @return [true, false]
@@ -53,6 +60,7 @@ module Clearance
:value => user.remember_token,
:expires => 1.year.from_now.utc
}
+ current_user = user
end
end
@@ -62,6 +70,7 @@ module Clearance
# sign_out
def sign_out
cookies.delete(:remember_token)
+ current_user = nil
end
# Store the current location.
diff --git a/shoulda_macros/clearance.rb b/shoulda_macros/clearance.rb
index <HASH>..<HASH> 100644
--- a/shoulda_macros/clearance.rb
+++ b/shoulda_macros/clearance.rb
@@ -227,7 +227,6 @@ module Clearance
module Shoulda
module Helpers
def sign_in_as(user)
- @controller.class_eval { attr_accessor :current_user }
@controller.current_user = user
return user
end
@@ -237,7 +236,6 @@ module Clearance
end
def sign_out
- @controller.class_eval { attr_accessor :current_user }
@controller.current_user = nil
end | current_user= accessor method. call it on sign_in to avoid the 'extra request cycle' problem with cookies. use it in shoulda macros to get cleaner. | thoughtbot_clearance | train | rb,rb |
ff1dc00ce6910a8161567e43030e64ec36ee903a | diff --git a/dominoes/search.py b/dominoes/search.py
index <HASH>..<HASH> 100644
--- a/dominoes/search.py
+++ b/dominoes/search.py
@@ -17,6 +17,10 @@ def make_moves(game, player=dominoes.players.identity):
made. The identity
player is the default.
'''
+ # game is over - do not yield anything
+ if game.result is not None:
+ return
+
# determine the order in which to make moves
player(game) | handling game over case in make_moves | abw333_dominoes | train | py |
e927d421b371844ae59ae53117161caaf79ce0ab | diff --git a/Kwf_js/EyeCandy/Lightbox/Lightbox.js b/Kwf_js/EyeCandy/Lightbox/Lightbox.js
index <HASH>..<HASH> 100644
--- a/Kwf_js/EyeCandy/Lightbox/Lightbox.js
+++ b/Kwf_js/EyeCandy/Lightbox/Lightbox.js
@@ -215,6 +215,8 @@ Kwf.EyeCandy.Lightbox.Lightbox.prototype = {
}
Kwf.EyeCandy.Lightbox.currentOpen = this;
+ this.showOptions = options;
+
this.lightboxEl.addClass('kwfLightboxOpen');
if (this.fetched) {
if (!this.lightboxEl.isVisible()) { | store showOptions in lightbox object
can be used to change lightbox content using javascript depending on the link
that opened it.
If the lightbox was opened by reloading the page, it will be undefined. | koala-framework_koala-framework | train | js |
9b30da500d1199a7a21f44a4ddcda72f331ae8ef | diff --git a/terraform/diff.go b/terraform/diff.go
index <HASH>..<HASH> 100644
--- a/terraform/diff.go
+++ b/terraform/diff.go
@@ -554,12 +554,10 @@ func (d *InstanceDiff) blockDiff(path []string, attrs map[string]string, schema
}
// this must be a diff to keep
-
keep = true
break
}
if !keep {
-
delete(candidateKeys, k)
}
}
@@ -772,7 +770,7 @@ func (d *InstanceDiff) applyCollectionDiff(path []string, attrs map[string]strin
// Don't trust helper/schema to return a valid count, or even have one at
// all.
- result[idx] = countFlatmapContainerValues(name+"."+idx, result)
+ result[name+"."+idx] = countFlatmapContainerValues(name+"."+idx, result)
return result, nil
} | missing prefix in recounted map
Missing prefix in map recount. This generally passes tests since the
actual count should already be there and be correct, then ethe extra key
is ignored by the shims. | hashicorp_terraform | train | go |
b707ea83a6e430b77292f83fb5a0dbf0923a2f31 | diff --git a/lib/AcmeService.php b/lib/AcmeService.php
index <HASH>..<HASH> 100644
--- a/lib/AcmeService.php
+++ b/lib/AcmeService.php
@@ -234,6 +234,10 @@ class AcmeService {
}
private function doRequestCertificate(KeyPair $keyPair, array $domains) {
+ if (empty($domains)) {
+ throw new AcmeException('$domains array is empty!');
+ }
+
if (!$privateKey = openssl_pkey_get_private($keyPair->getPrivate())) {
// TODO: Improve error message
throw new AcmeException("Couldn't use private key.");
@@ -507,4 +511,4 @@ EOL;
return new AcmeException("Invalid response: {$body}.\nRequest URI: {$uri}.", $status);
}
-}
\ No newline at end of file
+} | Prevent a misleading message due to programming mistake | kelunik_acme | train | php |
56b1b2dd34b90220fa68231f174306ac75126ab3 | diff --git a/mastodon-lite.js b/mastodon-lite.js
index <HASH>..<HASH> 100644
--- a/mastodon-lite.js
+++ b/mastodon-lite.js
@@ -24,6 +24,8 @@ var Mastodon = function(config) {
self.config = config;
};
+var verbose = !console.log || function () {};
+
function receive (incoming, callback) {
var data = '';
incoming.on('data', function (chunk) { data += chunk; });
@@ -51,9 +53,9 @@ Mastodon.prototype.post = function (message, callback) {
'Content-Length': message.length
};
- if (undefined === callback) {
+ if (!callback) {
callback = function (data) {
- console.log(data);
+ verbose(data);
};
}
@@ -81,7 +83,7 @@ Mastodon.prototype.get = function (path, callback) {
if (undefined === callback) {
callback = function (data) {
- console.log(data);
+ console.verbose(data);
};
}
http.request(config, function (res) { | example: Make silent callback
This was polluting moziot adapter's log
Change-Id: I6fa<I>be<I>da<I>baa<I>f5d1a<I>cbb<I>a<I> | rzr_mastodon-lite | train | js |
b5ce7736fa5bbe783e5989ce7ff15994c381ffa6 | diff --git a/isort/settings.py b/isort/settings.py
index <HASH>..<HASH> 100644
--- a/isort/settings.py
+++ b/isort/settings.py
@@ -81,7 +81,8 @@ default = {'force_to_top': [],
'balanced_wrapping': False,
'order_by_type': False,
'atomic': False,
- 'lines_after_imports': -1}
+ 'lines_after_imports': -1,
+ 'combine_as_imports': False}
@lru_cache() | Add setting needed to support issue #<I> | timothycrosley_isort | train | py |
9a6313c2918c4af504f7da54c5613bc8d26f1baf | diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/people_helper.rb
+++ b/app/helpers/people_helper.rb
@@ -8,7 +8,7 @@ module PeopleHelper
end
def profile_image_tag(person, options = {})
- source = person.image.try(:medium) || 'medium_no_photo.png'
+ source = person.profile_image.try(:medium) || 'medium_no_photo.png'
content_tag(:div, class: 'maginot') {
image_tag(source, options.merge(alt: "Current photo of #{ person }")) +
content_tag(:div, class: 'barrier') {}
diff --git a/app/models/person.rb b/app/models/person.rb
index <HASH>..<HASH> 100644
--- a/app/models/person.rb
+++ b/app/models/person.rb
@@ -40,7 +40,13 @@ class Person < ActiveRecord::Base
profile_photo.crop crop_x, crop_y, crop_w, crop_h if crop_x.present?
end
- delegate :image, to: :profile_photo, allow_nil: true
+ def profile_image
+ if profile_photo
+ profile_photo.image
+ else
+ nil
+ end
+ end
validates :given_name, presence: true, on: :update
validates :surname, presence: true | Rename photo to avoid masking image attribute
In order to make legacy images work, we need to access the 'image'
attribute on Person. | ministryofjustice_peoplefinder | train | rb,rb |
416c2af8844a41cfd078e80c38be96f15f76ee9e | diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js
index <HASH>..<HASH> 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js
@@ -65,12 +65,17 @@ export default class Conditions extends React.PureComponent {
onDeleteCondition
} = this.props;
- const sortedConditions = sortBy(conditions, condition => {
- return metrics.find(metric => metric.key === condition.metric).name;
- });
+ const existingConditions = conditions.filter(condition =>
+ metrics.find(metric => metric.key === condition.metric)
+ );
+
+ const sortedConditions = sortBy(
+ existingConditions,
+ condition => metrics.find(metric => metric.key === condition.metric).name
+ );
const duplicates = [];
- const savedConditions = conditions.filter(condition => condition.id != null);
+ const savedConditions = existingConditions.filter(condition => condition.id != null);
savedConditions.forEach(condition => {
const sameCount = savedConditions.filter(
sample => sample.metric === condition.metric && sample.period === condition.period | SONAR-<I> Quality Gate cannot be displayed directly if it includes a custom metric that was deleted | SonarSource_sonarqube | train | js |
1520ea4e60b32f7e06d9ea9f2a5b477df09b8dfa | diff --git a/Session/Storage/Handler/RedisSessionHandler.php b/Session/Storage/Handler/RedisSessionHandler.php
index <HASH>..<HASH> 100644
--- a/Session/Storage/Handler/RedisSessionHandler.php
+++ b/Session/Storage/Handler/RedisSessionHandler.php
@@ -251,7 +251,8 @@ class RedisSessionHandler extends AbstractSessionHandler
end
LUA;
- $this->redis->eval($script, array($this->getRedisKey($this->lockKey), $this->token), 1);
+ $token = $this->redis->_serialize($this->token);
+ $this->redis->eval($script, array($this->getRedisKey($this->lockKey), $token), 1);
} else {
$this->redis->getProfile()->defineCommand('sncFreeSessionLock', 'Snc\RedisBundle\Session\Storage\Handler\FreeLockCommand');
$this->redis->sncFreeSessionLock($this->getRedisKey($this->lockKey), $this->token); | #<I> token serialization while lock remove (#<I>)
* serialization token key on lock remove
* typo
(cherry picked from commit 6e<I>a) | snc_SncRedisBundle | train | php |
add068ba35479f6cccf3859e42b8ec4833217d14 | diff --git a/lib/autofill.js b/lib/autofill.js
index <HASH>..<HASH> 100644
--- a/lib/autofill.js
+++ b/lib/autofill.js
@@ -33,9 +33,13 @@ module.exports = (browser) => (target, input, options) => {
function completeFileField(element, name) {
const value = getValue(name, 'file');
if (value) {
- debug(`Uploading file: ${value} into field: ${name}`);
- return browser
- .addValue(`input[name="${name}"]`, value);
+ debug(`Uploading file: ${value}`);
+ return browser.uploadFile(value)
+ .then(response => {
+ debug(`Uploaded file: ${value} - remote path ${response.value}`);
+ return browser
+ .addValue(`input[name="${name}"]`, response.value);
+ });
}
debug(`No file specified for input ${name} - ignoring`);
} | Upload files to remote test runners for file inputs
This allows the tests to run on a test runner environment other than the local machine - in particular when running against a containerised selenium instance in CI. | UKHomeOfficeForms_hof-util-autofill | train | js |
6ce253000391fdefca01676b5b877b3d192b98de | diff --git a/write/batcher.go b/write/batcher.go
index <HASH>..<HASH> 100644
--- a/write/batcher.go
+++ b/write/batcher.go
@@ -99,6 +99,7 @@ func (b *Batcher) write(ctx context.Context, org, bucket platform.ID, lines <-ch
}
buf := make([]byte, 0, maxBytes)
+ r := bytes.NewReader(buf)
var line []byte
var more = true
@@ -111,7 +112,7 @@ func (b *Batcher) write(ctx context.Context, org, bucket platform.ID, lines <-ch
}
// write if we exceed the max lines OR read routine has finished
if len(buf) >= maxBytes || (!more && len(buf) > 0) {
- r := bytes.NewReader(buf)
+ r.Reset(buf)
if err := b.Service.Write(ctx, org, bucket, r); err != nil {
errC <- err
return
@@ -121,7 +122,7 @@ func (b *Batcher) write(ctx context.Context, org, bucket platform.ID, lines <-ch
case <-time.After(flushInterval):
// TODO: worry about timer garbage collection
if len(buf) > 0 {
- r := bytes.NewReader(buf)
+ r.Reset(buf)
if err := b.Service.Write(ctx, org, bucket, r); err != nil {
errC <- err
return | refactor(write): reuse bytes readers | influxdata_influxdb | train | go |
4cb823bfa52f6c76227b457b049710b484dfc965 | diff --git a/test/ng-currency.test.js b/test/ng-currency.test.js
index <HASH>..<HASH> 100644
--- a/test/ng-currency.test.js
+++ b/test/ng-currency.test.js
@@ -475,7 +475,7 @@ describe('ngCurrency directive tests', function() {
})
);
- it('New for version 0.9.3 - Display zeroes when display-zeroes is true',
+ /* it('New for version 0.9.3 - Display zeroes when display-zeroes is true',
inject(function($rootScope,$compile) {
scope.testModel = 0;
elem = $compile(elemdisplayzeroes)(scope);
@@ -499,7 +499,7 @@ describe('ngCurrency directive tests', function() {
expect(scope.testModel).toEqual(0);
expect(elem.val()).toEqual('');
})
- );
+ ); */
it('Issue #59 - Parse a string value as a float on focus',
inject(function($rootScope,$compile) { | Commenting test cases for PR #<I> | salte-io_ng-currency | train | js |
1065255e857bf4736e23b742595144202660a9a8 | diff --git a/src/basis/ui/popup.js b/src/basis/ui/popup.js
index <HASH>..<HASH> 100644
--- a/src/basis/ui/popup.js
+++ b/src/basis/ui/popup.js
@@ -355,7 +355,7 @@
hideOnKey: false,
hideOnScroll: true,
ignoreClickFor: null,
- trackRelElement: true,
+ trackRelElement: false,
trackRelElementTimer_: null,
init: function(){ | basis.ui.popup: don't track rel element by default | basisjs_basisjs | train | js |
a26772f63774b05e5b810da1e92f847d18fd9f6f | diff --git a/src/saml2/soap.py b/src/saml2/soap.py
index <HASH>..<HASH> 100644
--- a/src/saml2/soap.py
+++ b/src/saml2/soap.py
@@ -56,6 +56,10 @@ def parse_soap_enveloped_saml_authentication_request(text):
expected_tag = '{%s}AuthenticationRequest' % SAMLP_NAMESPACE
return parse_soap_enveloped_saml_thingy(text, [expected_tag])
+def parse_soap_enveloped_saml_artifact_resolve(text):
+ expected_tag = '{%s}ArtifactResolve' % SAMLP_NAMESPACE
+ return parse_soap_enveloped_saml_thingy(text, [expected_tag])
+
#def parse_soap_enveloped_saml_logout_response(text):
# expected_tag = '{%s}LogoutResponse' % SAMLP_NAMESPACE
# return parse_soap_enveloped_saml_thingy(text, [expected_tag]) | Started to add support for artifact handling. | IdentityPython_pysaml2 | train | py |
c3c94363341469ed6eeb523cb5cf70e7bf659965 | diff --git a/lib/Cake/I18n/I18n.php b/lib/Cake/I18n/I18n.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/I18n/I18n.php
+++ b/lib/Cake/I18n/I18n.php
@@ -171,6 +171,7 @@ class I18n {
$_this->domain = $domain . '_' . $_this->l10n->lang;
if (!isset($_this->_domains[$domain][$_this->_lang])) {
+ $_this->_domains[$domain][$_this->_lang] = [];
$_this->_domains[$domain][$_this->_lang] = Cache::read($_this->domain, '_cake_core_');
} | Prevent infinite recursion with cache is not writable.
By setting the language data to [] we prevent infinite errors when
the file path the cache is trying to use cannot be read/written from/to.
Without this change the error triggered by FileEngine, enters an
infinite loop as the message is translated which hits the cache, causing
the loop. | cakephp_cakephp | train | php |
5486adc4a02efb6f153b135cfe20697e3763ae51 | diff --git a/sprd/model/DesignCategory.js b/sprd/model/DesignCategory.js
index <HASH>..<HASH> 100644
--- a/sprd/model/DesignCategory.js
+++ b/sprd/model/DesignCategory.js
@@ -1,9 +1,12 @@
-define(["sprd/data/SprdModel", "sprd/model/Design", "js/data/Collection"], function (Model, Design, Collection) {
+define(["sprd/data/SprdModel", "sprd/model/Design", "js/data/Collection", "js/core/List"], function (Model, Design, Collection, List) {
var DesignCategory = Model.inherit('sprd.model.DesignCategory', {
schema: {
designs: Collection.of(Design)
},
+ defaults: {
+ designCategories: List
+ },
isMarketPlace: function () {
return this.$.type === "MARKETPLACE"; | DEV-<I> - Shop designs not loading when shop don't have shop designs | spreadshirt_rAppid.js-sprd | train | js |
238d3e70cd4f69ddba4a1de1fa09e30bec374075 | diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py
index <HASH>..<HASH> 100644
--- a/salt/utils/jinja.py
+++ b/salt/utils/jinja.py
@@ -103,10 +103,10 @@ class SaltCacheLoader(BaseLoader):
# If there was no file_client passed to the class, create a cache_client
# and use that. This avoids opening a new file_client every time this
# class is instantiated
- if self._file_client is None:
+ if self._file_client is None or self._file_client.opts != self.opts:
attr = "_cached_pillar_client" if self.pillar_rend else "_cached_client"
cached_client = getattr(self, attr, None)
- if cached_client is None:
+ if cached_client is None or cached_client.opts != self.opts:
cached_client = salt.fileclient.get_file_client(
self.opts, self.pillar_rend
)
@@ -119,7 +119,8 @@ class SaltCacheLoader(BaseLoader):
Cache a file from the salt master
"""
saltpath = salt.utils.url.create(template)
- return self.file_client().get_file(saltpath, "", True, self.saltenv)
+ fcl = self.file_client()
+ return fcl.get_file(saltpath, "", True, self.saltenv)
def check_cache(self, template):
""" | prevent reuse of fileclient if options have changed | saltstack_salt | train | py |
12ea2e278829bc52cec14e7d1367aeb1a4326681 | diff --git a/tests/Unit/CommandBuilderTest.php b/tests/Unit/CommandBuilderTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/CommandBuilderTest.php
+++ b/tests/Unit/CommandBuilderTest.php
@@ -305,27 +305,6 @@ class CommandBuilderTest extends ptlisShellCommandTestcase
);
}
- public function testSetCwd(): void
- {
- $path = './tests/commands/unix/test_binary';
- $arguments = [
- '--foo bar',
- 'baz'
- ];
- $builder = new CommandBuilder(new UnixEnvironment());
-
- $command = $builder
- ->setCommand($path)
- ->addArguments($arguments)
- ->setCwd('/bob')
- ->buildCommand();
-
- $this->assertSame(
- '/bob',
- TestCase::readAttribute($command, 'cwd')
- );
- }
-
public function testTimeout(): void
{
$path = './tests/commands/unix/test_binary'; | Remove unit test that has been replaced with integration test | ptlis_shell-command | train | php |
11741aac62ab36b88a83db5de0ab511f042cd4a7 | diff --git a/salt/grains/core.py b/salt/grains/core.py
index <HASH>..<HASH> 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -1044,6 +1044,12 @@ def os_data():
grains['osfinger'] = '{os}-{ver}'.format(
os=grains['osfullname'],
ver=grains['osrelease'])
+ elif grains['osfullname'] == "Debian":
+ grains['osmajorrelease'] = grains['osrelease'].split('.', 1)[0]
+
+ grains['osfinger'] = '{os}-{ver}'.format(
+ os=grains['osfullname'],
+ ver=grains['osrelease'].partition('.')[0])
if grains.get('osrelease', ''):
osrelease_info = grains['osrelease'].split('.') | set the osfinger grain for Debian | saltstack_salt | train | py |
8f36467107d623e94638e2dd4c625e34f670384d | diff --git a/runtime_test.go b/runtime_test.go
index <HASH>..<HASH> 100644
--- a/runtime_test.go
+++ b/runtime_test.go
@@ -396,7 +396,7 @@ func TestAllocateTCPPortLocalhost(t *testing.T) {
}
buf := make([]byte, 16)
read := 0
- conn.SetReadDeadline(time.Now().Add(2 * time.Second))
+ conn.SetReadDeadline(time.Now().Add(4 * time.Second))
read, err = conn.Read(buf)
if err != nil {
t.Fatal(err)
@@ -421,7 +421,7 @@ func TestAllocateUDPPortLocalhost(t *testing.T) {
input := bytes.NewBufferString("well hello there\n")
buf := make([]byte, 16)
- for i := 0; i != 10; i++ {
+ for i := 0; i != 20; i++ {
_, err := conn.Write(input.Bytes())
if err != nil {
t.Fatal(err) | Raise the timeouts for the TCP/UDP localhost proxy tests
Sometimes these tests fail, let's see if that improves the situation. | moby_moby | train | go |
960dc298571c42ef589797094760a01caad703a3 | diff --git a/webservice/rest/simpleserver.php b/webservice/rest/simpleserver.php
index <HASH>..<HASH> 100644
--- a/webservice/rest/simpleserver.php
+++ b/webservice/rest/simpleserver.php
@@ -115,7 +115,9 @@ class webservice_rest_server extends webservice_base_server {
protected function send_response() {
$this->send_headers();
$xml = '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
+ $xml .= '<RESPONSE>'."\n";
$xml .= self::xmlize_result($this->returns, $this->function->returns_desc);
+ $xml .= '</RESPONSE>'."\n";
echo $xml;
}
@@ -177,7 +179,7 @@ class webservice_rest_server extends webservice_base_server {
foreach ($desc->keys as $key=>$subdesc) {
if (!array_key_exists($key, $returns)) {
if ($subdesc->rewquired) {
- // TODO: Huston, we have a problem! maybe we should better throw coding_exception
+ $single .= '<ERROR>Missing key</ERROR>';
continue;
} else {
//optional field | MDL-<I> minor improvement in return value validation | moodle_moodle | train | php |
917050c5728f2fb9958ccb3ab66a23766f741adc | diff --git a/daemon/logger/journald/journald.go b/daemon/logger/journald/journald.go
index <HASH>..<HASH> 100644
--- a/daemon/logger/journald/journald.go
+++ b/daemon/logger/journald/journald.go
@@ -112,9 +112,10 @@ func (s *journald) Log(msg *logger.Message) error {
}
line := string(msg.Line)
+ source := msg.Source
logger.PutMessage(msg)
- if msg.Source == "stderr" {
+ if source == "stderr" {
return journal.Send(line, journal.PriErr, vars)
}
return journal.Send(line, journal.PriInfo, vars)
diff --git a/daemon/logger/syslog/syslog.go b/daemon/logger/syslog/syslog.go
index <HASH>..<HASH> 100644
--- a/daemon/logger/syslog/syslog.go
+++ b/daemon/logger/syslog/syslog.go
@@ -133,8 +133,9 @@ func New(info logger.Info) (logger.Logger, error) {
func (s *syslogger) Log(msg *logger.Message) error {
line := string(msg.Line)
+ source := msg.Source
logger.PutMessage(msg)
- if msg.Source == "stderr" {
+ if source == "stderr" {
return s.writer.Err(line)
}
return s.writer.Info(line) | Fix stderr logging for journald and syslog
logger.PutMessage, added in #<I> (<I>-ce), clears msg.Source. So journald
and syslog were treating stderr messages as if they were stdout. | moby_moby | train | go,go |
49d0b236c22dd21d80ddedb43b4e48443aea22c4 | diff --git a/src/ReactServer/ReactServer.php b/src/ReactServer/ReactServer.php
index <HASH>..<HASH> 100644
--- a/src/ReactServer/ReactServer.php
+++ b/src/ReactServer/ReactServer.php
@@ -49,7 +49,7 @@ class ReactServer extends EventEmitter {
//bubble the event up
$newClient->on('login_success', function(AuthClient $client) {
- $this->emit('login_success', [$client]);
+ $this->emit('login_success', [$client->getUsername(), $client->getUUID()]);
});
$connection->on('close', function(Connection $connection) use (&$newClient) { | make the event return UUID/username instead of the client object | Eluinhost_minecraft-auth | train | php |
ec5379db6771658c6c3cabb4507b605a08e25458 | diff --git a/lib/prey/plugins/drivers/console/index.js b/lib/prey/plugins/drivers/console/index.js
index <HASH>..<HASH> 100644
--- a/lib/prey/plugins/drivers/console/index.js
+++ b/lib/prey/plugins/drivers/console/index.js
@@ -30,7 +30,7 @@ var ConsoleDriver = function(options){
this.load_prompt();
this.load_hooks();
this.emit('loaded');
- // common.logger.off();
+ common.logger.off();
};
this.load_prompt = function(){ | Turn logging back off in Console driver. | prey_prey-node-client | train | js |
67e7d90d2b5f6dad9b0a7a70676df3c2fe3e5859 | diff --git a/demo/demo/settings.py b/demo/demo/settings.py
index <HASH>..<HASH> 100644
--- a/demo/demo/settings.py
+++ b/demo/demo/settings.py
@@ -82,6 +82,7 @@ MIDDLEWARE_CLASSES = (
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
+ 'django.middleware.locale.LocaleMiddleware',
'userena.middleware.UserenaLocaleMiddleware',
) | Add localization middleware in demo project | bread-and-pepper_django-userena | train | py |
5dbf566ac36dcc34478a30b05418216001286460 | diff --git a/intranet/apps/eighth/models.py b/intranet/apps/eighth/models.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/eighth/models.py
+++ b/intranet/apps/eighth/models.py
@@ -949,6 +949,11 @@ class EighthScheduledActivity(AbstractBaseEighthModel):
# Check if the user is already stickied into an activity
in_stickie = (EighthSignup.objects.filter(user=user, scheduled_activity__activity__sticky=True,
scheduled_activity__block__in=all_blocks).exists())
+
+ if not in_stickie:
+ in_stickie = (EighthSignup.objects.filter(user=user, scheduled_activity__sticky=True,
+ scheduled_activity__block__in=all_blocks).exists())
+
if in_stickie:
exception.Sticky = True | fix sticky on scheduled activity level when signing up for another activity | tjcsl_ion | train | py |
615dc294475d637c42ec551011e6cbcf24714c53 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -47,7 +47,7 @@ function compileLESSPipeline(options) {
function addLESSReporter() {
var autoprefix;
-
+
if (typeof config.autoprefix === 'object') {
autoprefix = new LessPluginAutoPrefix(config.autoprefix);
} else { | KEY-<I>: Solved build issue | kenzanlabs_pipeline-compile-less | train | js |
83d878aef7d60c18906abb243db3778409212156 | diff --git a/src/parser.js b/src/parser.js
index <HASH>..<HASH> 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -186,12 +186,14 @@ module.exports = function(engine) {
this.ast = ['program', []];
while(this.token != EOF) {
var node = this.read_start();
- if (typeof node[0] !== 'string') {
- node.forEach(function(item) {
- this.ast[1].push(item);
- }.bind(this));
- } else {
- this.ast[1].push(node);
+ if (node !== null) {
+ if (typeof node[0] !== 'string') {
+ node.forEach(function(item) {
+ this.ast[1].push(item);
+ }.bind(this));
+ } else {
+ this.ast[1].push(node);
+ }
}
}
return this.ast; | avoid notice when null returned (with empty ';' statements for example) | glayzzle_php-parser | train | js |
a608fbe861a66f40a772a7cc46e7c3c2f3f1b3a6 | diff --git a/ratcave/utils/gl.py b/ratcave/utils/gl.py
index <HASH>..<HASH> 100644
--- a/ratcave/utils/gl.py
+++ b/ratcave/utils/gl.py
@@ -35,7 +35,7 @@ def vec(data, dtype=float):
if el < 0:
raise ValueError("integer ratcave.vec arrays are unsigned--negative values are not supported.")
- return (gl_dtype * len(data))(*list(data))
+ return (gl_dtype * len(data))(*data) | removed extra data processing step in vec() | ratcave_ratcave | train | py |
ccacab3fc921bae60b7038933a7617a822769599 | diff --git a/spyder/utils/encoding.py b/spyder/utils/encoding.py
index <HASH>..<HASH> 100644
--- a/spyder/utils/encoding.py
+++ b/spyder/utils/encoding.py
@@ -171,6 +171,13 @@ def encode(text, orig_coding):
if orig_coding == 'utf-8-bom':
return BOM_UTF8 + text.encode("utf-8"), 'utf-8-bom'
+ # Try saving with original encoding
+ if orig_coding:
+ try:
+ return text.encode(orig_coding), orig_coding
+ except UnicodeError:
+ pass
+
# Try declared coding spec
coding = get_coding(text)
if coding: | Save file with original encoding if possible | spyder-ide_spyder | train | py |
0ee13a58336be823679d77689c3a5347bdb76388 | diff --git a/hwt/serializer/verilog/ops.py b/hwt/serializer/verilog/ops.py
index <HASH>..<HASH> 100644
--- a/hwt/serializer/verilog/ops.py
+++ b/hwt/serializer/verilog/ops.py
@@ -43,6 +43,9 @@ class ToHdlAstVerilog_ops():
_, tmpVar = self.tmpVars.create_var_cached("tmp_concat_", operand._dtype, def_val=operand)
# HdlAssignmentContainer(tmpVar, operand, virtual_only=True)
operand = tmpVar
+ elif operator.operator == AllOps.INDEX and i == 0 and self._operandIsAnotherOperand(operand):
+ _, tmpVar = self.tmpVars.create_var_cached("tmp_index_", operand._dtype, def_val=operand)
+ operand = tmpVar
oper = operator.operator
width = None | verilog: rewrite indexing on expression as tmp var | Nic30_hwt | train | py |
4f19602c70d3391a6600b196f395efb1c93c944e | diff --git a/src/main/java/org/primefaces/extensions/component/exporter/PDFExporter.java b/src/main/java/org/primefaces/extensions/component/exporter/PDFExporter.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/extensions/component/exporter/PDFExporter.java
+++ b/src/main/java/org/primefaces/extensions/component/exporter/PDFExporter.java
@@ -111,7 +111,7 @@ public class PDFExporter extends Exporter {
}
if (tableTitle != null && !tableTitle.isEmpty() && !tableId.contains("" + ",")) {
- Font tableTitleFont = FontFactory.getFont(FontFactory.TIMES, "UTF-8", Font.DEFAULTSIZE, Font.BOLD);
+ Font tableTitleFont = FontFactory.getFont(FontFactory.TIMES, encodingType, Font.DEFAULTSIZE, Font.BOLD);
Paragraph title = new Paragraph(tableTitle, tableTitleFont);
document.add(title); | Exporter encoding applied for tableTitle | primefaces-extensions_core | train | java |
be46ddef9acbb1bd5efe1c3a6b113e84de4feaa1 | diff --git a/jieba/__init__.py b/jieba/__init__.py
index <HASH>..<HASH> 100644
--- a/jieba/__init__.py
+++ b/jieba/__init__.py
@@ -15,10 +15,7 @@ from hashlib import md5
from ._compat import *
from . import finalseg
-if os.name == 'nt':
- from shutil import move as _replace_file
-else:
- _replace_file = os.rename
+from shutil import move as _replace_file
_get_module_path = lambda path: os.path.normpath(os.path.join(os.getcwd(),
os.path.dirname(__file__), path)) | use shutil.move for all platforms in case of different filesystems | fxsjy_jieba | train | py |
cda24917a06ce6878bb71246b0af2f3ad6e9b8dd | diff --git a/parse.go b/parse.go
index <HASH>..<HASH> 100644
--- a/parse.go
+++ b/parse.go
@@ -483,9 +483,9 @@ func (p *parser) invalidStmtStart() {
switch {
case p.peekAny(SEMICOLON, AND, OR, LAND, LOR):
p.curErr("%s can only immediately follow a statement", p.tok)
- case p.peekAny(RBRACE):
+ case p.peek(RBRACE):
p.curErr("%s can only be used to close a block", p.val)
- case p.peekAny(RPAREN):
+ case p.peek(RPAREN):
p.curErr("%s can only be used to close a subshell", p.tok)
default:
p.curErr("%s is not a valid start for a statement", p.tok)
@@ -742,7 +742,7 @@ func (p *parser) gotStmtAndOr(s *Stmt, addRedir func()) bool {
return false
}
p.gotEnd = end
- if p.gotAny(OR) {
+ if p.got(OR) {
left := *s
*s = Stmt{
Position: left.Position, | Simplify a few *Any() calls | mvdan_sh | train | go |
5ff9ef8e08232ecca28ad828510bafc254d455a2 | diff --git a/tests/unit/core/oxutilsfileTest.php b/tests/unit/core/oxutilsfileTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/core/oxutilsfileTest.php
+++ b/tests/unit/core/oxutilsfileTest.php
@@ -16,7 +16,7 @@
* along with OXID eShop Community Edition. If not, see <http://www.gnu.org/licenses/>.
*
* @link http://www.oxid-esales.com
- * @copyright (C) OXID eSales AG 2003-2014
+ * @copyright (C) OXID eSales AG 2003-2015
* @version OXID eShop CE
*/
@@ -119,7 +119,9 @@ class Unit_Core_oxUtilsFileTest extends OxidTestCase
$oUtilsFile = new oxUtilsFile();
$this->assertFalse($oUtilsFile->urlValidate("test"));
$this->assertFalse($oUtilsFile->urlValidate("http://www.gggdddzzzfff.com"));
- $this->assertTrue($oUtilsFile->urlValidate("http://localhost/?param=value"));
+
+ $shopUrl = $this->getTestConfig()->getShopUrl();
+ $this->assertTrue($oUtilsFile->urlValidate($shopUrl ."?param=value"));
}
public function testCheckFile() | Use shop url for testing url validation
Localhost can be unreachable in some cases, so shop url will be used instead. | OXID-eSales_oxideshop_ce | train | php |
Subsets and Splits