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 |
|---|---|---|---|---|---|
cf3be87b68260d9d7e9f3480d9aefeb8bad69e2e | diff --git a/src/core/instance/proxy.js b/src/core/instance/proxy.js
index <HASH>..<HASH> 100644
--- a/src/core/instance/proxy.js
+++ b/src/core/instance/proxy.js
@@ -15,9 +15,11 @@ if (process.env.NODE_ENV !== 'production') {
const warnNonPresent = (target, key) => {
warn(
- `Property or method "${key}" is not defined on the instance but ` +
- `referenced during render. Make sure to declare reactive data ` +
- `properties in the data option.`,
+ `Property or method "${key}" is not defined on the instance but` +
+ 'referenced during render. Make sure that this property is reactive, ' +
+ 'either in the data option, or for class-based components, by ' +
+ 'initializing the property.' +
+ 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
target
)
} | refactor: improve error msg for non-reactive properties (#<I>)
close #<I> | kaola-fed_megalo | train | js |
0b06267afec6f3f9f5468dd76d7cc28d75a03b5c | diff --git a/src/ol/renderer/WebGL.js b/src/ol/renderer/WebGL.js
index <HASH>..<HASH> 100644
--- a/src/ol/renderer/WebGL.js
+++ b/src/ol/renderer/WebGL.js
@@ -236,6 +236,11 @@ ol.renderer.WebGL.prototype.draw = function(layers, center, resolution, animate)
for (j = 0; j < row.length; ++j) {
tile = row[j];
if (!tile.isLoaded()) {
+ if (!tile.isLoading()) {
+ tile.register('load', this.handleTileLoad, this);
+ tile.register('destroy', this.handleTileDestroy, this);
+ tile.load();
+ }
continue;
}
tileBounds = tile.getBounds(); | Trigger redraws on tile loads. | openlayers_openlayers | train | js |
bf4381e61d3bdb5ce0a8ba729388106e4460b399 | diff --git a/djangoratings/views.py b/djangoratings/views.py
index <HASH>..<HASH> 100644
--- a/djangoratings/views.py
+++ b/djangoratings/views.py
@@ -86,5 +86,5 @@ class AddRatingFromModel(AddRatingView):
except ContentType.DoesNotExist:
raise Http404('Invalid `model` or `app_label`.')
- return super(AddRatingFromLabels, self).__call__(request, content_type.id,
+ return super(AddRatingFromModel, self).__call__(request, content_type.id,
object_id, field_name, score)
\ No newline at end of file | Quick fix for AddRatingFromModel | dcramer_django-ratings | train | py |
1b5cf75d613fd410e7c4a7bf771a0fd1a0e76b64 | diff --git a/jaraco/test/services.py b/jaraco/test/services.py
index <HASH>..<HASH> 100644
--- a/jaraco/test/services.py
+++ b/jaraco/test/services.py
@@ -328,7 +328,7 @@ class MongoDBFinder(paths.PathFinder):
# be found.
env_paths = [
os.path.join(os.environ[key], 'bin')
- for key in 'MONGODB_HOME'
+ for key in ['MONGODB_HOME']
if key in os.environ
]
candidate_paths = env_paths or heuristic_paths | Replace string constant with a list containing the string
Previously, the list comprehension would iterate over the
characters in the string, which is not the desired behavior.
--HG--
branch : fix-mongodbfinder | jaraco_jaraco.services | train | py |
ae0047e41e0d51d1b1f06539d99720c8854f46b1 | diff --git a/lib/ohai/plugins/os.rb b/lib/ohai/plugins/os.rb
index <HASH>..<HASH> 100644
--- a/lib/ohai/plugins/os.rb
+++ b/lib/ohai/plugins/os.rb
@@ -18,10 +18,11 @@
provides "os", "os_version"
-require_plugin 'ruby'
+require 'rbconfig'
+
require_plugin 'kernel'
-case languages[:ruby][:host_os]
+case ::Config::CONFIG['host_os']
when /darwin(.+)$/
os "darwin"
when /linux/
@@ -42,7 +43,7 @@ when /mswin|mingw32|windows/
# subsystems.
os "windows"
else
- os languages[:ruby][:host_os]
+ os ::Config::CONFIG['host_os']
end
os_version kernel[:release] | OHAI-<I>: Dont use the ruby plugin to guess running OS.
We now directly use rbconfig, as does the ruby plugin. This allows ohai to run without a $PATH environment variable (but some plugins will not be accurate, as they need $PATH, as the ruby one). | chef_ohai | train | rb |
be3aef2ca96d6384166937290a3167f471a96523 | diff --git a/src/tests/test_acts_inspection.py b/src/tests/test_acts_inspection.py
index <HASH>..<HASH> 100644
--- a/src/tests/test_acts_inspection.py
+++ b/src/tests/test_acts_inspection.py
@@ -54,7 +54,7 @@ class PylintTest(unittest.TestCase):
assert parts[0] == 'pylint', "pylint is actually called"
assert '--reports=n' in parts, "no pylint reports by default"
assert '--rcfile=project.d/pylint.cfg' in parts, "pylint config is loaded"
- assert any(i.endswith('/src/tests/conftest.py"') for i in parts), "test files in pylint command: " + repr(parts)
+ assert '"src/tests/conftest.py"' in parts, "test files in pylint command: " + repr(parts)
assert '"setup.py"' in parts, "root files in pylint command: " + repr(parts)
def test_pylint_can_skip_test_files(self): | adapted test to new cwd path shortening | jhermann_rituals | train | py |
1e4af5d072a4e4817c86df03458f579ec93a4451 | diff --git a/ghost/admin/app/helpers/gh-format-post-time.js b/ghost/admin/app/helpers/gh-format-post-time.js
index <HASH>..<HASH> 100644
--- a/ghost/admin/app/helpers/gh-format-post-time.js
+++ b/ghost/admin/app/helpers/gh-format-post-time.js
@@ -3,7 +3,7 @@ import moment from 'moment';
import {assert} from '@ember/debug';
import {inject as service} from '@ember/service';
-export function formatPostTime(timeago, {timezone = 'ect/UTC', draft, scheduled, published}) {
+export function formatPostTime(timeago, {timezone = 'etc/UTC', draft, scheduled, published}) {
if (draft) {
// No special handling for drafts, just use moment.from
return moment(timeago).from(moment.utc()); | Fixed typo in default UTC timezone of `{{gh-format-post-time}}` helper
no issue
- was throwing errors from Moment.js in tests but not causing failures | TryGhost_Ghost | train | js |
d70fe9ca6b6a54491170c64dbe4fc067f007cba6 | diff --git a/system_maintenance/admin.py b/system_maintenance/admin.py
index <HASH>..<HASH> 100644
--- a/system_maintenance/admin.py
+++ b/system_maintenance/admin.py
@@ -68,11 +68,11 @@ class MaintenanceAdmin(admin.ModelAdmin):
]
list_filter = [
+ 'status',
'system',
'maintenance_type',
'hardware',
'software',
- 'status',
'sys_admin',
] | Move 'status' to top of maintenance record list filter | mfcovington_django-system-maintenance | train | py |
078a22a1417a04203767f5f886d76bbad71a8452 | diff --git a/src/test/java/net/openhft/chronicle/map/StatelessMapClientTest.java b/src/test/java/net/openhft/chronicle/map/StatelessMapClientTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/net/openhft/chronicle/map/StatelessMapClientTest.java
+++ b/src/test/java/net/openhft/chronicle/map/StatelessMapClientTest.java
@@ -27,8 +27,8 @@ public class StatelessMapClientTest extends TestCase {
testReadValueWriteValue(new MyTestClass(3));
testReadValueWriteValue(new MyTestClassMarshallable(3));
- // testReadValueWriteValue(new MyTestClassExternalizable(3));
- // testReadValueWriteValue(new MyTestClassObjectGraph(3));
+ testReadValueWriteValue(new MyTestClassExternalizable(3));
+ testReadValueWriteValue(new MyTestClassObjectGraph(3));
}
@@ -165,14 +165,14 @@ public class StatelessMapClientTest extends TestCase {
public static class MyTestClassObjectGraph implements Serializable {
- MyTestClassMarshallable delegate;
+ MyTestClass delegate;
public MyTestClassObjectGraph() {
}
MyTestClassObjectGraph(int a) {
- delegate = new MyTestClassMarshallable(a);
+ delegate = new MyTestClass(a);
}
@Override | HCOLL-<I> Created a stateless map - added tests | OpenHFT_Chronicle-Map | train | java |
2fe3898df5d2ce39e3378d646408151cdfaed675 | diff --git a/luigi/static/visualiser/js/visualiserApp.js b/luigi/static/visualiser/js/visualiserApp.js
index <HASH>..<HASH> 100644
--- a/luigi/static/visualiser/js/visualiserApp.js
+++ b/luigi/static/visualiser/js/visualiserApp.js
@@ -245,8 +245,9 @@ function visualiserApp(luigi) {
updateSidebar(tabId);
}
- function showErrorTrace(error) {
- $("#errorModal").empty().append(renderTemplate("errorTemplate", decodeError(error)));
+ function showErrorTrace(data) {
+ data.error = decodeError(data.error)
+ $("#errorModal").empty().append(renderTemplate("errorTemplate", data));
$("#errorModal").modal({});
} | Display decoded error message in graphs.
Error message was incorrectly passed to decodeError function. | spotify_luigi | train | js |
a520f040455aba9cb5a3096be39b3b8e76d2432e | diff --git a/packages/babel-preset-pob-env/lib/index.js b/packages/babel-preset-pob-env/lib/index.js
index <HASH>..<HASH> 100644
--- a/packages/babel-preset-pob-env/lib/index.js
+++ b/packages/babel-preset-pob-env/lib/index.js
@@ -119,7 +119,10 @@ module.exports = function (context, opts) {
switch (targetOption) {
case 'node':
if (versionOption === 'current') {
- targetPreset = ['latest-node', { modules, loose, target: 'current' }];
+ targetPreset = [
+ resolvePreset('babel-preset-latest-node'),
+ { modules, loose, target: 'current' },
+ ];
} else {
// targetPreset = ['@babel/preset-env', { modules, loose, targets: { node: versionOption } }];
targetPreset = [ | fix(babel-preset-pob-env): resolve babel-preset-latest-node when version is current | christophehurpeau_pob-lerna | train | js |
445abe4ed63719706862f0ff0a52e8adc6323349 | diff --git a/library/CM/FormField/File.js b/library/CM/FormField/File.js
index <HASH>..<HASH> 100644
--- a/library/CM/FormField/File.js
+++ b/library/CM/FormField/File.js
@@ -71,6 +71,13 @@ var CM_FormField_File = CM_FormField_Abstract.extend({
field.error(data.result.error.msg);
}
if (inProgressCount === 0) {
+ var cardinality = field.getOption("cardinality");
+ if (cardinality > 0) {
+ var $previews = field.$('.previews .preview');
+ if ($previews.length > cardinality) {
+ $previews.slice(0, $previews.length - cardinality).remove();
+ }
+ }
field.trigger("uploadComplete", data.files);
}
}, | Bring back cardinality check to CM_FormField_File | cargomedia_cm | train | js |
1046d2d83a6e768dab3dfdd94d2409a26e530ff0 | diff --git a/ocrd_models/ocrd_page_user_methods/id.py b/ocrd_models/ocrd_page_user_methods/id.py
index <HASH>..<HASH> 100644
--- a/ocrd_models/ocrd_page_user_methods/id.py
+++ b/ocrd_models/ocrd_page_user_methods/id.py
@@ -1,5 +1,5 @@
@property
def id(self):
if hasattr(self, 'pcGtsId'):
- return self.pcGtsId
+ return self.pcGtsId or ''
return self.imageFilename | handle unset pcGtsId | OCR-D_core | train | py |
be3a3e9be19788a448889074de495f2438dd87cf | diff --git a/src/Http/Controllers/AppointmentController.php b/src/Http/Controllers/AppointmentController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/AppointmentController.php
+++ b/src/Http/Controllers/AppointmentController.php
@@ -12,7 +12,6 @@ class AppointmentController extends AbstractController
public function __construct(BaseAdapterInterface $appointmentAdapter)
{
$this->appointmentAdapter = $appointmentAdapter;
- $this->middleware('auth:api');
}
public function index(Request $request = null)
diff --git a/src/Http/Controllers/PatientController.php b/src/Http/Controllers/PatientController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/PatientController.php
+++ b/src/Http/Controllers/PatientController.php
@@ -14,7 +14,6 @@ class PatientController extends AbstractController
public function __construct( BaseAdapterInterface $patientAdapter )
{
$this->patientAdapter = $patientAdapter;
- $this->middleware('auth:api');
}
public function index(Request $request = null) | removed unused auth lines of code | LibreHealthIO_lh-ehr-fhir-api | train | php,php |
4afb0190800a9d0352b566ad4fb2295b42fe5e16 | diff --git a/master/setup.py b/master/setup.py
index <HASH>..<HASH> 100755
--- a/master/setup.py
+++ b/master/setup.py
@@ -165,7 +165,6 @@ setup_args = {
'packages': [
"buildbot",
- "buildbot.buildslave",
"buildbot.configurators",
"buildbot.worker",
"buildbot.worker.protocols", | Don't build buildbot.buildslave package | buildbot_buildbot | train | py |
e86ab18ce4385925d8ff0c33558510c24d2f91e5 | diff --git a/src/Option.php b/src/Option.php
index <HASH>..<HASH> 100644
--- a/src/Option.php
+++ b/src/Option.php
@@ -383,14 +383,6 @@ class Option
return $this->defaultValue;
}
- /*
- * set option spec key for saving option result
- */
- public function setKey($key)
- {
- $this->key = $key;
- }
-
/**
* get readable spec for printing.
* | setKey is not used, so it's removed | c9s_GetOptionKit | train | php |
b46ee0a9512cb0a375e3bcd0c4fbc6c05bdf3843 | diff --git a/conn.go b/conn.go
index <HASH>..<HASH> 100644
--- a/conn.go
+++ b/conn.go
@@ -28,6 +28,7 @@ type ConnConfig struct {
Password string
TLSConfig *tls.Config // config for TLS connection -- nil disables TLS
Logger Logger
+ KeepAlive uint16 // keep-alive period for the connetion (0 disables KeepAlive)
}
// Conn is a PostgreSQL connection handle. It is not safe for concurrent usage.
@@ -132,7 +133,11 @@ func Connect(config ConnConfig) (c *Conn, err error) {
}
} else {
c.logger.Info(fmt.Sprintf("Dialing PostgreSQL server at host: %s:%d", c.config.Host, c.config.Port))
- c.conn, err = net.Dial("tcp", fmt.Sprintf("%s:%d", c.config.Host, c.config.Port))
+ var d net.Dialer
+ if c.config.KeepAlive != 0 {
+ d.KeepAlive = time.Duration(c.config.KeepAlive) * time.Second
+ }
+ c.conn, err = d.Dial("tcp", fmt.Sprintf("%s:%d", c.config.Host, c.config.Port))
if err != nil {
c.logger.Error(fmt.Sprintf("Connection failed: %v", err))
return nil, err | Add keep-alive option by creating a dialer first, then setting KeepAlive option | jackc_pgx | train | go |
c6ef5891395461059a528cd7e5f38f0388dbecc9 | diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php
index <HASH>..<HASH> 100644
--- a/cake/console/libs/testsuite.php
+++ b/cake/console/libs/testsuite.php
@@ -44,6 +44,9 @@ class TestSuiteShell extends Shell {
))->addArgument('file', array(
'help' => __('file name with folder prefix and without the test.php suffix.'),
'required' => true,
+ ))->addOption('filter', array(
+ 'help' => __('Filter which tests to run.'),
+ 'default' => false
));
return $parser;
}
@@ -106,6 +109,7 @@ class TestSuiteShell extends Shell {
$options = array();
$params = $this->params;
unset($params['help']);
+ $params = array_filter($params);
foreach ($params as $param => $value) {
$options[] = '--' . $param;
if (is_string($value)) { | Adding filter option to the testsuite, seems I forgot it. | cakephp_cakephp | train | php |
b6aa67e865e7abb67b64af19cf8cbe99ef0d7264 | diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js
index <HASH>..<HASH> 100644
--- a/plugins/CoreHome/javascripts/broadcast.js
+++ b/plugins/CoreHome/javascripts/broadcast.js
@@ -315,6 +315,15 @@ var broadcast = {
}
}
+ var updatedUrl = new RegExp('&updated=([0-9]+)');
+ var updatedCounter = updatedUrl.exec(currentSearchStr);
+ if (!updatedCounter) {
+ currentSearchStr += '&updated=1';
+ } else {
+ updatedCounter = 1 + parseInt(updatedCounter[1]);
+ currentSearchStr = currentSearchStr.replace(new RegExp('(&updated=[0-9]+)'), '&updated=' + updatedCounter);
+ }
+
if (strHash && currentHashStr.length != 0) {
var params_hash_vals = strHash.split("&");
for (var i = 0; i < params_hash_vals.length; i++) { | make sure to reload page when requesting a new page | matomo-org_matomo | train | js |
b428f0d30d3313eff626e5e6e513230264f58cc1 | diff --git a/lib/ronin/support/inflector.rb b/lib/ronin/support/inflector.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/support/inflector.rb
+++ b/lib/ronin/support/inflector.rb
@@ -22,7 +22,7 @@ module Ronin
# The Inflectors supported by ronin-support
INFLECTORS = {
:datamapper => {
- :path => 'dm-core/support/inflector',
+ :path => 'dm-core',
:const => 'DataMapper::Inflector'
},
:active_support => { | Require 'dm-core' for DataMapper::Support::Inflector.
* In dm-core edge they have removed 'dm-core/support/inflector.rb'. | ronin-ruby_ronin-support | train | rb |
876982f6dbb1c3fed042e23d2da2b3fe4b6cedd7 | diff --git a/events_test.go b/events_test.go
index <HASH>..<HASH> 100644
--- a/events_test.go
+++ b/events_test.go
@@ -29,4 +29,5 @@ func TestEventDebounce(t *testing.T) {
if eventCount != eventsSeen {
t.Fatalf("expected to see %d events but got %d", eventCount, eventsSeen)
}
+ debouncer.stop()
} | Fix leaking goroutine in events_test.go | gocql_gocql | train | go |
44155d992a5349d347219fa7130e3c5b84bef901 | diff --git a/mpop/satin/hdfeos_l1b.py b/mpop/satin/hdfeos_l1b.py
index <HASH>..<HASH> 100644
--- a/mpop/satin/hdfeos_l1b.py
+++ b/mpop/satin/hdfeos_l1b.py
@@ -91,7 +91,7 @@ class ModisReader(Reader):
if isinstance(kwargs.get("filename"), (list, set, tuple)):
# we got the entire dataset.
for fname in kwargs["filename"]:
- if fnmatch(fname, "M?D02?km*"):
+ if fnmatch(os.path.basename(fname), "M?D02?km*"):
resolution = self.res[os.path.basename(fname)[5]]
self.datafiles[resolution] = fname
else: | Fix name matching in hdfeos_l1b
The full name didn't work with fnmatch, take basename instead. | pytroll_satpy | train | py |
ae251ae076bab2e749f9fe52eb6f9220ff212d8d | diff --git a/pyqode/core/icons.py b/pyqode/core/icons.py
index <HASH>..<HASH> 100644
--- a/pyqode/core/icons.py
+++ b/pyqode/core/icons.py
@@ -15,7 +15,7 @@ except ImportError:
qta = None
#: This flag controls qtawesome icons should be preferred to theme/qrc icons.
-USE_QTAWESOME = True
+USE_QTAWESOME = False
#: Default options used for rendering an icon from qtawesome.
#: Options cannot be changed after the icon has been rendered so make sure | Set USE_QTAWESOME to False by default | pyQode_pyqode.core | train | py |
1dd1af2443157e28860ab18708e2d9563960b1bb | diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php
index <HASH>..<HASH> 100644
--- a/PHPCI/Command/InstallCommand.php
+++ b/PHPCI/Command/InstallCommand.php
@@ -323,8 +323,8 @@ class InstallCommand extends Command
{
$output->write(Lang::get('setting_up_db'));
- $phinxBinary = escapeshellarg(PHPCI_DIR . 'vendor/bin/phinx');
- $phinxScript = escapeshellarg(PHPCI_DIR . 'phinx.php');
+ $phinxBinary = escapeshellarg(PHPCI_DIR . 'vendor/bin/phinx');
+ $phinxScript = escapeshellarg(PHPCI_DIR . 'phinx.php');
shell_exec($phinxBinary . ' migrate -c ' . $phinxScript);
$output->writeln('<info>'.Lang::get('ok').'</info>'); | Switching tabs to spaces as per style guide.
No functional changes. | dancryer_PHPCI | train | php |
46acb955c82216b586a07ae2f78e53868c60f1ba | diff --git a/providence-tools-rpc/src/main/java/net/morimekta/providence/tools/rpc/RPCOptions.java b/providence-tools-rpc/src/main/java/net/morimekta/providence/tools/rpc/RPCOptions.java
index <HASH>..<HASH> 100644
--- a/providence-tools-rpc/src/main/java/net/morimekta/providence/tools/rpc/RPCOptions.java
+++ b/providence-tools-rpc/src/main/java/net/morimekta/providence/tools/rpc/RPCOptions.java
@@ -204,7 +204,8 @@ public class RPCOptions extends CommonOptions {
.collect(Collectors.toSet()));
throw new ArgumentException(
- "Unknown service %s in %s.\nFound %s",
+ "Unknown service %s in %s.\n" +
+ "Found %s",
service, namespace,
services.size() == 0 ? "none" : Strings.join(", ", services));
} | Exception nitpick in RPC tool. | morimekta_providence | train | java |
fc80e1de2a00be5504cbca3811f4eb1055055854 | diff --git a/geomet/wkt.py b/geomet/wkt.py
index <HASH>..<HASH> 100644
--- a/geomet/wkt.py
+++ b/geomet/wkt.py
@@ -5,6 +5,9 @@ except ImportError:
import tokenize
+INVALID_WKT_FMT = 'Invalid WKT: `%s`'
+
+
def dump(obj, dest_file):
pass
@@ -125,7 +128,7 @@ def __load_point(tokens, string):
A GeoJSON `dict` representation of the WKT ``string``.
"""
if not tokens.next() == '(':
- raise ValueError('Invalid WKT: `%s`' % string)
+ raise ValueError(INVALID_WKT_FMT % string)
coords = []
try:
@@ -134,7 +137,7 @@ def __load_point(tokens, string):
break
coords.append(float(t))
except tokenize.TokenError:
- raise ValueError('Invalid WKT: `%s`' % string)
+ raise ValueError(INVALID_WKT_FMT % string)
return dict(type='Point', coordinates=coords) | wkt:
Defined a common/generic error message as a constant. | geomet_geomet | train | py |
acb7e4020f227f6607d1e7619ad5c05b1ba7b477 | diff --git a/core/src/main/java/net/automatalib/automata/base/fast/AbstractFastMutableNondet.java b/core/src/main/java/net/automatalib/automata/base/fast/AbstractFastMutableNondet.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/net/automatalib/automata/base/fast/AbstractFastMutableNondet.java
+++ b/core/src/main/java/net/automatalib/automata/base/fast/AbstractFastMutableNondet.java
@@ -16,6 +16,7 @@
package net.automatalib.automata.base.fast;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -73,7 +74,8 @@ public abstract class AbstractFastMutableNondet<S extends AbstractFastNondetStat
@Override
public Collection<T> getTransitions(S state, I input) {
int inputIdx = inputAlphabet.getSymbolIndex(input);
- return state.getTransitions(inputIdx);
+ final Collection<T> result = state.getTransitions(inputIdx);
+ return result == null ? Collections.emptySet() : result;
}
@Override | core: fix NPE on partial NFAs
(cherry picked from commit a<I>e<I>d<I>b<I>b<I>ae4d1c8e<I>dad8d) | LearnLib_automatalib | train | java |
b98e9941ae260241099e468a3daa1966adcb65ef | diff --git a/instaloader/structures.py b/instaloader/structures.py
index <HASH>..<HASH> 100644
--- a/instaloader/structures.py
+++ b/instaloader/structures.py
@@ -1182,7 +1182,11 @@ class Hashtag:
self._has_full_metadata = True
def _asdict(self):
- return self._node
+ json_node = self._node.copy()
+ # remove posts
+ json_node.pop("edge_hashtag_to_top_posts", None)
+ json_node.pop("edge_hashtag_to_media", None)
+ return json_node
def __repr__(self):
return "<Hashtag #{}>".format(self.name) | Omit media when saving Hashtag JSON | instaloader_instaloader | train | py |
93d5c62b25e84413f44ba3ebcad731b1c143ce82 | diff --git a/libdokan/folderlist.go b/libdokan/folderlist.go
index <HASH>..<HASH> 100644
--- a/libdokan/folderlist.go
+++ b/libdokan/folderlist.go
@@ -56,15 +56,15 @@ func (fl *FolderList) reportErr(ctx context.Context,
// Dir.open as necessary.
func (fl *FolderList) open(ctx context.Context, oc *openContext, path []string) (f dokan.File, isDir bool, err error) {
fl.fs.log.CDebugf(ctx, "FL Lookup %#v", path)
+ if len(path) == 0 {
+ return oc.returnDirNoCleanup(fl)
+ }
+
defer func() {
fl.reportErr(ctx, libkbfs.ReadMode,
libkbfs.CanonicalTlfName(path[0]), err)
}()
- if len(path) == 0 {
- return oc.returnDirNoCleanup(fl)
- }
-
for oc.reduceRedirectionsLeft() {
name := path[0] | libdokan: Fix crash in github issue <I> | keybase_client | train | go |
d02e3558b3fe467240b30c1bd1c9c46afc8815c9 | diff --git a/gaugetest.py b/gaugetest.py
index <HASH>..<HASH> 100644
--- a/gaugetest.py
+++ b/gaugetest.py
@@ -4,7 +4,6 @@ import gc
import operator
import pickle
import random
-import sys
import time
import types
import weakref
@@ -820,8 +819,9 @@ def test_hypergauge_past_bugs(zigzag, bidir):
def test_randomly():
+ maxint = 2 ** 64 / 2
for y in range(100):
- seed = random.randint(0, sys.maxint)
+ seed = random.randrange(maxint)
g = random_gauge(seed)
for t, v in g.determine():
assert \ | don't use sys.maxint (deprecated at Python 3) | what-studio_gauge | train | py |
bcc81cef80ab32c879aa2b698dcbe5e4ab46e3ac | diff --git a/salt/pillar/consul_pillar.py b/salt/pillar/consul_pillar.py
index <HASH>..<HASH> 100644
--- a/salt/pillar/consul_pillar.py
+++ b/salt/pillar/consul_pillar.py
@@ -114,9 +114,7 @@ from __future__ import absolute_import
# Import python libs
import logging
-
import re
-
import yaml
from salt.exceptions import CommandExecutionError
@@ -261,6 +259,10 @@ def get_conn(opts, profile):
pillarenv = opts_merged.get('pillarenv') or 'base'
params['dc'] = _resolve_datacenter(params['dc'], pillarenv)
+ consul_host = params.get('host')
+ consul_port = params.get('port')
+ consul_token = params.get('token')
+
if HAS_CONSUL:
# Sanity check. ACL Tokens are supported on python-consul 0.4.7 onwards only.
if CONSUL_VERSION >= '0.4.7': | Add consul host, port, and token values back in with conf.get() | saltstack_salt | train | py |
31725ac9f7c9f8fa718f65fc096a1cdcdc69a5de | diff --git a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/ModelManager.java b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/ModelManager.java
index <HASH>..<HASH> 100644
--- a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/ModelManager.java
+++ b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/ModelManager.java
@@ -43,7 +43,7 @@ public class ModelManager {
public void registerWellKnownNamespaces() {
if (namespaceManager != null) {
- if (namespaceManager.getNamespaceInfoFromUri("http://hl7.org/fhir") != null) {
+ if (namespaceManager.getNamespaceInfoFromUri("http://hl7.org/fhir") == null) {
namespaceManager.ensureNamespaceRegistered(new NamespaceInfo("FHIR", "http://hl7.org/fhir"));
}
namespaceManager.ensureNamespaceRegistered(new NamespaceInfo("ecqi.healthit.gov", "urn:healthit-gov")); | Added exception for FHIR as a well known namespace if the namespace manager is already aware of the namespace. | cqframework_clinical_quality_language | train | java |
779c453a7567af909fd0abb5124b485b94305a13 | diff --git a/lib/assets/models/index.js b/lib/assets/models/index.js
index <HASH>..<HASH> 100644
--- a/lib/assets/models/index.js
+++ b/lib/assets/models/index.js
@@ -17,7 +17,7 @@ if (config.use_env_variable) {
fs
.readdirSync(__dirname)
.filter(function(file) {
- return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) !== '.js');
+ return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js');
})
.forEach(function(file) {
var model = sequelize['import'](path.join(__dirname, file)); | [Fixed] Filtering of js files in models/index.js | sequelize_cli | train | js |
db95112b61882d7027b5d49d9fcc9d9ee0a10df0 | diff --git a/cache.go b/cache.go
index <HASH>..<HASH> 100644
--- a/cache.go
+++ b/cache.go
@@ -4,6 +4,7 @@ import (
"reflect"
"sync"
"sync/atomic"
+ "strings"
)
type cachedField struct {
@@ -76,6 +77,10 @@ func (s *structCacheMap) parseStruct(mode Mode, current reflect.Value, key refle
continue
}
+ if commaIndex := strings.Index(name, ","); commaIndex != -1 {
+ name = name[:commaIndex]
+ }
+
if mode == ModeExplicit && len(name) == 0 {
continue
} | get correct field name in struct tag that contain comma, such as json tag | go-playground_form | train | go |
d929e3cf906424001a6c7a54d23e3f20d023d94c | diff --git a/src/Rezzza/JobFlow/Scheduler/JobFlow.php b/src/Rezzza/JobFlow/Scheduler/JobFlow.php
index <HASH>..<HASH> 100644
--- a/src/Rezzza/JobFlow/Scheduler/JobFlow.php
+++ b/src/Rezzza/JobFlow/Scheduler/JobFlow.php
@@ -115,7 +115,7 @@ class JobFlow
$result = $this->runJob($msg);
- //$this->handleMessage($result);
+ $this->handleMessage($result);
}
return $result; | fix comment forgotten to close issue #9 | rezzza_jobflow | train | php |
ec20dca4cb5fddbc7b1e88e3f0116dfab8114cad | diff --git a/shared/common-adapters/button.js b/shared/common-adapters/button.js
index <HASH>..<HASH> 100644
--- a/shared/common-adapters/button.js
+++ b/shared/common-adapters/button.js
@@ -26,7 +26,7 @@ export type Props = {
const Progress = ({small}) => (
<Box style={progress}>
- <ProgressIndicator style={progressStyle(small)} white={false} />
+ <ProgressIndicator style={progressStyle(small)} white={true} />
</Box>
) | button waiting state -> white (#<I>) | keybase_client | train | js |
bd26d932ff9f53affe060eb07420df92d78b0499 | diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php
index <HASH>..<HASH> 100644
--- a/grade/edit/tree/lib.php
+++ b/grade/edit/tree/lib.php
@@ -273,12 +273,6 @@ class grade_edit_tree {
$root = true;
}
- $row_count_offset = 0;
-
- if (empty($category_total_item) && !$this->moving) {
- $row_count_offset = -1;
- }
-
$levelclass = "level$level";
$courseclass = '';
@@ -297,7 +291,7 @@ class grade_edit_tree {
$headercell->scope = 'row';
$headercell->attributes['title'] = $object->stripped_name;
$headercell->attributes['class'] = 'cell rowspan ' . $levelclass;
- $headercell->rowspan = $row_count+1+$row_count_offset;
+ $headercell->rowspan = $row_count + 1;
$row->cells[] = $headercell;
foreach ($this->columns as $column) { | MDL-<I> core_grade: removing some code that is messing up the categories and items screen when no grade categories are used | moodle_moodle | train | php |
1498f1931c6420122b3a3b3df99cef563672e1b4 | diff --git a/locale/zh_CN.js b/locale/zh_CN.js
index <HASH>..<HASH> 100644
--- a/locale/zh_CN.js
+++ b/locale/zh_CN.js
@@ -19,7 +19,13 @@ const messages = {
image: (field) => `${field}不是一张有效的图片`,
included: (field) => `${field}不是一个有效值`,
ip: (field) => `${field}不是一个有效的地址`,
- length: (field, [minLength, maxLength]) => `${field}长度必须在${minLength}到${maxLength}之间`,
+ length: (field, [length, max]) => {
+ if (max) {
+ return `${field}长度必须在${length}到${max}之间`
+ }
+
+ return `${field}长度必须为${length}`
+ },
max: (field, [length]) => `${field}不能超过${length}个字符`,
max_value: (field, [max]) => `${field}必须小于或等于${max}`,
mimes: (field) => `${field}不是一个有效的文件类型`, | fix zh_CN message for length rule (#<I>)
* fix zh_CN message for length rule
* forget return | baianat_vee-validate | train | js |
c44c3e0c37466bd2b5e025d838e161d0d420d5dd | diff --git a/symfit/core/fit.py b/symfit/core/fit.py
index <HASH>..<HASH> 100644
--- a/symfit/core/fit.py
+++ b/symfit/core/fit.py
@@ -729,7 +729,7 @@ class Constraint(Model):
# raise Exception(model)
if isinstance(constraint, Relational):
self.constraint_type = type(constraint)
- if isinstance(model, Model):
+ if isinstance(model, BaseModel):
self.model = model
else:
raise TypeError('The model argument must be of type Model.')
@@ -2269,4 +2269,4 @@ class ODEModel(CallableModel):
bound_arguments = self.__signature__.bind(*args, **kwargs)
Ans = namedtuple('Ans', [var.name for var in self])
ans = Ans(*self.eval_components(**bound_arguments.arguments))
- return ans
\ No newline at end of file
+ return ans | Constraint object work with all models now | tBuLi_symfit | train | py |
f6df78168b45186ad0f135aa660ba27ac336d3f8 | diff --git a/examples/authorization/routes/index.js b/examples/authorization/routes/index.js
index <HASH>..<HASH> 100644
--- a/examples/authorization/routes/index.js
+++ b/examples/authorization/routes/index.js
@@ -17,7 +17,7 @@ exports.login = function login(req, res) {
//
var user = db.getUser(req.body.username);
- if (!user) return res.send(401, { message: 'Bad credentials' });
+ if (!user) return res.status(401).send({ message: 'Bad credentials' });
//
// Check user's password and if it is correct return an authorization token.
@@ -28,7 +28,7 @@ exports.login = function login(req, res) {
return res.send(500, { message: 'Internal error' });
}
- if (user.key !== key) return res.send(401, { message: 'Bad credentials' });
+ if (user.key !== key) return res.status(401).send({ message: 'Bad credentials' });
var timestamp = Date.now(); | [example] Suppress a deprecation warning in the authorization example | primus_primus | train | js |
1ca0fb46afd4b3398f73573e4eeb80fb45276f7f | diff --git a/lib/simple_form/form_builder.rb b/lib/simple_form/form_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/simple_form/form_builder.rb
+++ b/lib/simple_form/form_builder.rb
@@ -527,7 +527,7 @@ module SimpleForm
case input_type
when :timestamp
:datetime
- when :string, nil
+ when :string, :citext, nil
case attribute_name.to_s
when /password/ then :password
when /time_zone/ then :time_zone | Set citext field type to email when field name is email | plataformatec_simple_form | train | rb |
8d857b02b897d53cfe93c75bfde03bfb934a2539 | diff --git a/alignak/objects/hostdependency.py b/alignak/objects/hostdependency.py
index <HASH>..<HASH> 100644
--- a/alignak/objects/hostdependency.py
+++ b/alignak/objects/hostdependency.py
@@ -261,6 +261,9 @@ class Hostdependencies(Items):
getattr(hostdep, 'dependent_host_name', None) is None:
continue
+ if hostdep.host_name not in hosts or hostdep.dependent_host_name not in hosts:
+ continue
+
hosts.add_act_dependency(hostdep.dependent_host_name, hostdep.host_name,
hostdep.notification_failure_criteria,
getattr(hostdep, 'dependency_period', ''), | Closes #<I>: host dependency exception when host not found | Alignak-monitoring_alignak | train | py |
37750814b99c8103e669b134deb2ec48d15c8c64 | diff --git a/pytest/test_grammar.py b/pytest/test_grammar.py
index <HASH>..<HASH> 100644
--- a/pytest/test_grammar.py
+++ b/pytest/test_grammar.py
@@ -46,6 +46,7 @@ def test_grammar():
unused_rhs.add("mkfunc_annotate")
unused_rhs.add("dict_comp")
unused_rhs.add("classdefdeco1")
+ unused_rhs.add("tryelsestmtl")
if PYTHON_VERSION >= 3.5:
expect_right_recursive.add((('l_stmts',
('lastl_stmt', 'come_froms', 'l_stmts')))) | Adjust grammar checking...
More conditional rules were added | rocky_python-uncompyle6 | train | py |
5df09b142c0c0effb643d206c38cd06ed4e33a30 | diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Database/DetectsLostConnections.php
+++ b/src/Illuminate/Database/DetectsLostConnections.php
@@ -51,6 +51,7 @@ trait DetectsLostConnections
'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.',
'Temporary failure in name resolution',
'SSL: Broken pipe',
+ 'SQLSTATE[08S01]: Communication link failure',
]);
}
} | Add WSREP communication link failure for lost connection detection (#<I>) | laravel_framework | train | php |
7b80d1d53d0d4b1d0d55067f0becd4386a61e6c8 | diff --git a/examples/sample3/scene/stage1.go b/examples/sample3/scene/stage1.go
index <HASH>..<HASH> 100644
--- a/examples/sample3/scene/stage1.go
+++ b/examples/sample3/scene/stage1.go
@@ -96,6 +96,7 @@ func (scene *Stage1) Initialize() {
// OnTouchBegin is called when Stage1 scene is Touched.
func (scene *Stage1) OnTouchBegin(x, y float32) {
scene.isTouching = true
+
}
// OnTouchMove is called when Stage1 scene is Touched and moved.
@@ -107,7 +108,9 @@ func (scene *Stage1) OnTouchMove(x, y float32) {
func (scene *Stage1) OnTouchEnd(x, y float32) {
scene.isTouching = false
- if scene.gamestate == readyToRestart {
+ if scene.gamestate == readyToStart {
+ scene.gamestate = started
+ } else if scene.gamestate == readyToRestart {
// TODO: methodize
scene.resetPosition()
scene.views.restart()
@@ -277,6 +280,8 @@ func (scene *Stage1) registerModels() {
// This is used to update sprites position.
// This will be called 60 times per sec.
func (scene *Stage1) Drive() {
- scene.models.Progress(scene.isTouching)
- scene.views.Progress(scene.isTouching)
+ if scene.gamestate == started {
+ scene.models.Progress(scene.isTouching)
+ scene.views.Progress(scene.isTouching)
+ }
} | [#<I>] temporary commit. | pankona_gomo-simra | train | go |
bfe28bdbfd9a5a1b5470663f7ed470b4d46f0b19 | diff --git a/pymzn/mzn/solvers.py b/pymzn/mzn/solvers.py
index <HASH>..<HASH> 100644
--- a/pymzn/mzn/solvers.py
+++ b/pymzn/mzn/solvers.py
@@ -116,7 +116,7 @@ class Solver:
seed : int
The random number generator seed to pass to the solver.
"""
- args = []
+ args = ['-s', '-v']
if all_solutions:
args.append('-a')
if num_solutions is not None: | solvers: put back statistics and verbose options | paolodragone_pymzn | train | py |
f9a18882fbc1503c8ca2c3b4015d2d5c2b4affde | diff --git a/seneca.js b/seneca.js
index <HASH>..<HASH> 100644
--- a/seneca.js
+++ b/seneca.js
@@ -184,7 +184,7 @@ module.exports = function init (seneca_options, more_options) {
var seneca = make_seneca(_.extend({}, seneca_options, more_options))
var options = seneca.options()
- seneca.log.info({kind: 'notice', notice: 'hello'})
+ seneca.log.info({kind: 'notice', notice: 'seneca started'})
// The 'internal' key of options is reserved for objects and functions
// that provide functionality, and are thus not really printable | Update seneca.js
Changed 'hello' to 'seneca started' based on user feedback | senecajs_seneca | train | js |
addb967d4096f174a1a55aba6c8c7e9845cb9adb | diff --git a/salt/states/network.py b/salt/states/network.py
index <HASH>..<HASH> 100644
--- a/salt/states/network.py
+++ b/salt/states/network.py
@@ -276,8 +276,8 @@ def routes(name, **kwargs):
kwargs['test'] = __opts__['test']
# Build interface routes
try:
- old = __salt__['ip.get_routes'](**kwargs)
- new = __salt__['ip.build_routes'](**kwargs)
+ old = __salt__['ip.get_routes'](name)
+ new = __salt__['ip.build_routes'](name, **kwargs)
if __opts__['test']:
if old == new:
return ret
@@ -306,7 +306,7 @@ def routes(name, **kwargs):
# Apply interface routes
if apply_net_settings:
try:
- __salt__['ip.apply_network_routes'](**kwargs)
+ __salt__['ip.apply_network_settings'](**kwargs)
except AttributeError as error:
ret['result'] = False
ret['comment'] = error.message | Sync compatibility between network state and ip module | saltstack_salt | train | py |
17dacd31f4ab9365befe2f3669254a4322971013 | diff --git a/core/dbt/compilation.py b/core/dbt/compilation.py
index <HASH>..<HASH> 100644
--- a/core/dbt/compilation.py
+++ b/core/dbt/compilation.py
@@ -46,8 +46,10 @@ def print_compile_stats(stats):
results = {k: 0 for k in names.keys()}
results.update(stats)
- stat_line = ", ".join(
- [dbt.utils.pluralize(ct, names.get(t)) for t, ct in results.items()])
+ stat_line = ", ".join([
+ dbt.utils.pluralize(ct, names.get(t)) for t, ct in results.items()
+ if t in names
+ ])
logger.info("Found {}".format(stat_line))
diff --git a/core/dbt/logger.py b/core/dbt/logger.py
index <HASH>..<HASH> 100644
--- a/core/dbt/logger.py
+++ b/core/dbt/logger.py
@@ -315,7 +315,7 @@ class HookMetadata(NodeMetadata):
]
-class TimestampNamed(JsonOnly):
+class TimestampNamed(logbook.Processor):
def __init__(self, name: str):
self.name = name
super().__init__() | fix for stdout logging of on-run- hooks | fishtown-analytics_dbt | train | py,py |
a5bd2f1b6135e41e567a7fbe4e27c128cb17fdab | diff --git a/rdfunit-core/src/main/java/org/aksw/rdfunit/validate/wrappers/RDFUnitStaticValidator.java b/rdfunit-core/src/main/java/org/aksw/rdfunit/validate/wrappers/RDFUnitStaticValidator.java
index <HASH>..<HASH> 100644
--- a/rdfunit-core/src/main/java/org/aksw/rdfunit/validate/wrappers/RDFUnitStaticValidator.java
+++ b/rdfunit-core/src/main/java/org/aksw/rdfunit/validate/wrappers/RDFUnitStaticValidator.java
@@ -65,6 +65,7 @@ public final class RDFUnitStaticValidator {
final boolean enableRDFUnitLogging = false;
final SimpleTestExecutorMonitor testExecutorMonitor = new SimpleTestExecutorMonitor(enableRDFUnitLogging);
+ testExecutorMonitor.setExecutionType(executionType);
final TestExecutor testExecutor = TestExecutorFactory.createTestExecutor(executionType);
checkNotNull(testExecutor, "TestExecutor should not be null"); | bug: add test execution type in monitor | AKSW_RDFUnit | train | java |
3509654ac339d123f87150b6ae9cc2e2148c836f | diff --git a/lib/cool.io/dsl.rb b/lib/cool.io/dsl.rb
index <HASH>..<HASH> 100644
--- a/lib/cool.io/dsl.rb
+++ b/lib/cool.io/dsl.rb
@@ -43,7 +43,7 @@ module Coolio
raise NameError, "No connection type registered for #{connection_name.inspect}"
end
- Cool.io::TCPServer.new host, port, klass, initializer_args
+ Cool.io::TCPServer.new host, port, klass, *initializer_args
end
# Create a new Cool.io::TCPSocket class | Blah, missing splat :( | tarcieri_cool.io | train | rb |
2d3b07eb48d0ea8f6fa9a1f531f0faef54062e38 | diff --git a/Generator/Column.php b/Generator/Column.php
index <HASH>..<HASH> 100644
--- a/Generator/Column.php
+++ b/Generator/Column.php
@@ -252,6 +252,9 @@ class Column
return $this->filterOn = $filterOn;
}
+ /**
+ * @param string $text
+ */
private function humanize($text)
{
return ucfirst(str_replace('_', ' ', $text)); | Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on <URL> | symfony2admingenerator_GeneratorBundle | train | php |
450b3ec16fb6f647e97d6043ccd433253bdf5675 | diff --git a/source/source.go b/source/source.go
index <HASH>..<HASH> 100644
--- a/source/source.go
+++ b/source/source.go
@@ -23,6 +23,7 @@ import (
"bufio"
"os/exec"
"syscall"
+ "sync"
)
type Sourcer interface {
@@ -30,12 +31,12 @@ type Sourcer interface {
}
type Source struct {
- command string
- args []string
+ Command string
+ Args []string
}
func (s *Source) Generate(out chan interface{}, ech chan error) {
- cmd := exec.Command(s.command, s.args...)
+ cmd := exec.Command(s.Command, s.Args...)
reader, err := cmd.StdoutPipe()
if err != nil {
@@ -46,13 +47,14 @@ func (s *Source) Generate(out chan interface{}, ech chan error) {
scanner := bufio.NewScanner(reader)
- done := make(chan bool)
+ var done sync.WaitGroup
+ done.Add(1)
go func() {
for scanner.Scan() {
out <- scanner.Text()
}
close(out)
- done <- true
+ done.Done()
}()
if err = cmd.Start(); err != nil {
@@ -61,7 +63,7 @@ func (s *Source) Generate(out chan interface{}, ech chan error) {
return
}
- <-done
+ done.Wait()
status := cmd.Wait()
var waitStatus syscall.WaitStatus | Wait group added instread of blocking send | intelsdi-x_snap-plugin-utilities | train | go |
84fa35b1b8afae147c9e5baf24a7ebab6e793e9e | diff --git a/app/models/user_notifier/base.rb b/app/models/user_notifier/base.rb
index <HASH>..<HASH> 100644
--- a/app/models/user_notifier/base.rb
+++ b/app/models/user_notifier/base.rb
@@ -1,5 +1,6 @@
class UserNotifier::Base < ActiveRecord::Base
self.abstract_class = true
+ after_commit :deliver
def self.notify_once(template_name, user, source = nil, params = {})
notify(template_name, user, source, params) if is_unique?(template_name, {self.user_association_name => user})
@@ -14,7 +15,7 @@ class UserNotifier::Base < ActiveRecord::Base
from_name: UserNotifier.from_name,
source: source,
self.user_association_name => user
- }.merge(params)).tap{|n| n.deliver }
+ }.merge(params))
end
def deliver | call deliver after commit changes to tha database | diogob_user_notifier | train | rb |
21f1115a811322a30f0acc48a4beacd6dc90405c | diff --git a/puz.py b/puz.py
index <HASH>..<HASH> 100644
--- a/puz.py
+++ b/puz.py
@@ -14,6 +14,8 @@ maskstring = 'ICHEATED'
ACROSSDOWN = 'ACROSS&DOWN'
BLACKSQUARE = '.'
+ENCODING = 'ISO-8859-1'
+
extension_header_format = '< 4s H H '
def enum(**enums):
@@ -302,9 +304,8 @@ class PuzzleBuffer:
wraps a data buffer ('' or []) and provides .puz-specific methods for
reading and writing data
"""
- def __init__(self, data=None, enc='ISO-8859-1'):
+ def __init__(self, data=None):
self.data = data or []
- self.enc = enc
self.pos = 0
def can_read(self, bytes=1):
@@ -329,7 +330,7 @@ class PuzzleBuffer:
def read_until(self, c):
start = self.pos
self.seek_to(c, 1) # read past
- return unicode(self.data[start:self.pos-1], self.enc)
+ return unicode(self.data[start:self.pos-1], ENCODING)
def seek(self, pos):
self.pos = pos
@@ -348,7 +349,7 @@ class PuzzleBuffer:
def write_string(self, s):
s = s or ''
- self.data.append(s.encode(self.enc) + '\0')
+ self.data.append(s.encode(ENCODING) + '\0')
def pack(self, format, *values):
self.data.append(struct.pack(format, *values)) | Refactored encoding to be a module constant as we'll need it elsewhere | alexdej_puzpy | train | py |
8f61b427126e139240f75314fb058038bb7409bc | diff --git a/views/errors.blade.php b/views/errors.blade.php
index <HASH>..<HASH> 100644
--- a/views/errors.blade.php
+++ b/views/errors.blade.php
@@ -1,3 +1,3 @@
-@if ( $errors->any() )
+@if ( isset($errors) && $errors->any() )
@include('notice::message', ['class' => 'alert-danger', 'message' => implode('',$errors->all('<p>:message</p>'))])
@endif
\ No newline at end of file | Updated errors view to check if $errors variable available | papertank_origami-notice | train | php |
68084382e5c666be85ec3ed0a7f60366f5217cef | diff --git a/Manager/LogManager.php b/Manager/LogManager.php
index <HASH>..<HASH> 100644
--- a/Manager/LogManager.php
+++ b/Manager/LogManager.php
@@ -657,7 +657,7 @@ class LogManager
$userSearch = null;
if (array_key_exists('filter', $data)) {
- $decodeFilter = json_decode(urldecode($data['filter']));
+ $decodeFilter = json_decode(urldecode($data['filter']), true);
if ($decodeFilter !== null) {
$action = $decodeFilter->action;
$range = $dateRangeToTextTransformer->reverseTransform($decodeFilter->range); | [CoreBundle] Fixing log manager. | claroline_Distribution | train | php |
73b0e6c37bccc910042c22bd1911c9f09cf8bb32 | diff --git a/pkg/services/sqlstore/migrations/migrations_test.go b/pkg/services/sqlstore/migrations/migrations_test.go
index <HASH>..<HASH> 100644
--- a/pkg/services/sqlstore/migrations/migrations_test.go
+++ b/pkg/services/sqlstore/migrations/migrations_test.go
@@ -6,6 +6,7 @@ import (
"github.com/go-xorm/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
+ "github.com/inconshreveable/log15"
. "github.com/smartystreets/goconvey/convey"
)
@@ -28,7 +29,7 @@ func TestMigrations(t *testing.T) {
sqlutil.CleanDB(x)
mg := NewMigrator(x)
- //mg.LogLevel = log.DEBUG
+ mg.Logger.SetHandler(log15.DiscardHandler())
AddMigrations(mg)
err = mg.Start() | feat(logging): disable migrator logging during test | grafana_grafana | train | go |
10a8dbae0670148ac5690603b3e46a868c9403f8 | diff --git a/bcbio/structural/plot.py b/bcbio/structural/plot.py
index <HASH>..<HASH> 100644
--- a/bcbio/structural/plot.py
+++ b/bcbio/structural/plot.py
@@ -30,12 +30,13 @@ def breakpoints_by_caller(bed_files):
merged = concat(bed_files)
if not merged:
return []
- grouped_start = merged.groupby(g=[1, 2, 2], c=4, o=["distinct"])
- grouped_end = merged.groupby(g=[1, 3, 3], c=4, o=["distinct"])
+ grouped_start = merged.groupby(g=[1, 2, 2], c=4, o=["distinct"]).filter(lambda r: r.end > r.start).saveas()
+ grouped_end = merged.groupby(g=[1, 3, 3], c=4, o=["distinct"]).filter(lambda r: r.end > r.start).saveas()
together = concat([grouped_start, grouped_end])
- final = together.expand(c=4)
- final = final.sort()
- return final
+ if together:
+ final = together.expand(c=4)
+ final = final.sort()
+ return final
def _get_sv_callers(items):
""" | Handle plotting edge cases with missing or out of order breakends | bcbio_bcbio-nextgen | train | py |
77a4c3e0fb7cde12a34a6165c13fdf6d5d26ea44 | diff --git a/worker/buildbot_worker/test/test_util_hangcheck.py b/worker/buildbot_worker/test/test_util_hangcheck.py
index <HASH>..<HASH> 100644
--- a/worker/buildbot_worker/test/test_util_hangcheck.py
+++ b/worker/buildbot_worker/test/test_util_hangcheck.py
@@ -186,6 +186,9 @@ def reportUnhandledErrors(case, d):
Make sure that any unhandled errors from the
given deferred are reported when the test case
ends.
+
+ :param case: The test case that will handle cleanup.
+ :param Deferred d: The deferred to check for unhandled errors.
"""
def cleanup():
if isinstance(d.result, Failure):
@@ -198,6 +201,10 @@ def listen(case, endpoint, factory):
"""
Listen on an endpoint and cleanup when the
test case ends.
+
+ :param case: The test case that will handle cleanup.
+ :param IStreamServerEndpoint endpoint: The endpoint to listen on.
+ :param IProtocolFactory factory: The factory for the server protocol.
"""
d = endpoint.listen(factory) | Add some more docstrings. | buildbot_buildbot | train | py |
589674c65cfe6b3c96a916c769dcb6d7621f0bc9 | diff --git a/session_security/static/session_security/script.js b/session_security/static/session_security/script.js
index <HASH>..<HASH> 100644
--- a/session_security/static/session_security/script.js
+++ b/session_security/static/session_security/script.js
@@ -83,8 +83,8 @@ yourlabs.SessionSecurity.prototype = {
// Throttle these checks to once per second
return;
+ var idleFor = Math.floor((now - this.lastActivity) / 1000);
this.lastActivity = now;
- var idleFor = Math.floor((new Date() - this.lastActivity) / 1000);
if (this.$warning.is(':visible')) {
// Inform the server that the user came back manually, this should | Check idleFor with lastActivity
When checking activity it should always compare the time vs how long the session has been idle and check it against the expire time that has been set. | yourlabs_django-session-security | train | js |
7e6eaf94915a99ef20c235d0cd1770614eb6880f | diff --git a/test/clone.js b/test/clone.js
index <HASH>..<HASH> 100644
--- a/test/clone.js
+++ b/test/clone.js
@@ -45,6 +45,7 @@ var URLS = [
'https://github.com/mafintosh/swap-to-level.git',
'https://github.com/mafintosh/telephone.git',
'https://github.com/mafintosh/what-line-is-this.git',
+ 'https://github.com/maxogden/dat-core',
'https://github.com/maxogden/standard-format.git',
// 'https://github.com/ngoldman/gh-release.git', // still using standard v2
'https://github.com/ngoldman/magnet-link.git', | tests: maxogden/dat-core is standard | standard_standard-engine | train | js |
d14e7302467f310f980141172c6c8a8c364a49ab | diff --git a/src/pyprinttags.py b/src/pyprinttags.py
index <HASH>..<HASH> 100755
--- a/src/pyprinttags.py
+++ b/src/pyprinttags.py
@@ -42,7 +42,7 @@ def script():
inputFunction = raw_input
else:
inputFunction = input
- if not args.batch and inputFunction("remove unsupported properties? [yN] ") in "yY":
+ if not args.batch and inputFunction("remove unsupported properties? [yN] ").lower() in ["y", "yes"]:
audioFile.removeUnsupportedProperties(audioFile.unsupported)
audioFile.save() | fix bug resulting in accidental data loss | supermihi_pytaglib | train | py |
43c20cebe68af0f91a9458d29678fbe596584e08 | diff --git a/api/api_v1.py b/api/api_v1.py
index <HASH>..<HASH> 100644
--- a/api/api_v1.py
+++ b/api/api_v1.py
@@ -330,7 +330,7 @@ def search_people():
@app.route('/v1/transactions', methods=['POST'])
-@auth_required()
+#@auth_required()
@parameters_required(['signed_hex'])
@crossdomain(origin='*')
def broadcast_tx():
@@ -355,8 +355,8 @@ def broadcast_tx():
@app.route('/v1/addresses/<address>/unspents', methods=['GET'])
-@auth_required(exception_paths=[
- '/v1/addresses/19bXfGsGEXewR6TyAV3b89cSHBtFFewXt6/unspents'])
+#@auth_required(exception_paths=[
+# '/v1/addresses/19bXfGsGEXewR6TyAV3b89cSHBtFFewXt6/unspents'])
@crossdomain(origin='*')
def get_address_unspents(address): | remove the auth requirements from the unspents endpoint and the transaction posting endpoint | blockstack_blockstack-core | train | py |
dadad5a0df38a4f1da70a592290fe535a27fd2d9 | diff --git a/spec/models/concerns/storable/collection_spec.rb b/spec/models/concerns/storable/collection_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/models/concerns/storable/collection_spec.rb
+++ b/spec/models/concerns/storable/collection_spec.rb
@@ -74,7 +74,7 @@ describe Concerns::Storable::Collection do
describe 'read from db' do
it 'db contains string' do
page = create(:page)
- create(:store, storable_type: 'Page', storable_id: page.id, name: 'foo', value: 'baz')
+ create(:store, storable_type: 'Page', storable_id: page.id, klass: 'string', name: 'foo', value: 'baz')
@config.add :foo, :string
collection = model.new(page, @config)
@@ -83,7 +83,7 @@ describe Concerns::Storable::Collection do
it 'db contains something else' do
page = create(:page)
- create(:store, storable_type: 'Page', storable_id: page.id, name: 'foo', value: 1337)
+ create(:store, storable_type: 'Page', storable_id: page.id, klass: 'string', name: 'foo', value: 1337)
@config.add :foo, :string
collection = model.new(page, @config) | Explicitly define the store klass as string. | udongo_udongo | train | rb |
17358f29a582152d8fe4af8b135bac98f13b8e33 | diff --git a/lib/DoctrineExtensions/Taggable/TagManager.php b/lib/DoctrineExtensions/Taggable/TagManager.php
index <HASH>..<HASH> 100644
--- a/lib/DoctrineExtensions/Taggable/TagManager.php
+++ b/lib/DoctrineExtensions/Taggable/TagManager.php
@@ -173,6 +173,10 @@ class TagManager
->delete($this->taggingClass, 't')
->where('t.tag_id')
->where($builder->expr()->in('t.tag', $tagsToRemove))
+ ->andWhere('t.resourceType = :resourceType')
+ ->setParameter('resourceType', $resource->getTaggableType())
+ ->andWhere('t.resourceId = :resourceId')
+ ->setParameter('resourceId', $resource->getTaggableId())
->getQuery()
->getResult()
; | [saveTagging method] add clause in doctrine query to delete only tagging of the resource given in parameter | FabienPennequin_DoctrineExtensions-Taggable | train | php |
66d9041c042327ba1eda29a4e6d38aa4ee804ebf | diff --git a/src/Configuration.php b/src/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/Configuration.php
+++ b/src/Configuration.php
@@ -342,8 +342,8 @@ class Configuration implements ConfigurationInterface, ListenerAwareConfiguratio
* The array with the custom header mappings.
*
* @var array
- * @Type("array")
* @SerializedName("header-mappings")
+ * @Type("array<string, array<string, string>>")
*/
protected $headerMappings = array();
@@ -1042,17 +1042,7 @@ class Configuration implements ConfigurationInterface, ListenerAwareConfiguratio
*/
public function getHeaderMappings()
{
-
- // initialize the array for the custom header mappings
- $headerMappings = array();
-
- // try to load the configured header mappings
- if ($headerMappingsAvailable = reset($this->headerMappings)) {
- $headerMappings = $headerMappingsAvailable;
- }
-
- // return the custom header mappings
- return $headerMappings;
+ return $this->headerMappings;
}
/**
@@ -1062,17 +1052,7 @@ class Configuration implements ConfigurationInterface, ListenerAwareConfiguratio
*/
public function getImageTypes()
{
-
- // initialize the array for the custom image types
- $imageTypes = array();
-
- // try to load the configured image types
- if ($imageTypesAvailable = reset($this->imageTypes)) {
- $imageTypes = $imageTypesAvailable;
- }
-
- // return the custom image types
- return $imageTypes;
+ return $this->imageTypes;
}
/** | Refactor header-mappings structure | techdivision_import-configuration-jms | train | php |
083fd01d6e7a3c5f56e3f69574363b45b3affb4b | diff --git a/src/de/lmu/ifi/dbs/elki/visualization/batikutil/ThumbnailRegistryEntry.java b/src/de/lmu/ifi/dbs/elki/visualization/batikutil/ThumbnailRegistryEntry.java
index <HASH>..<HASH> 100644
--- a/src/de/lmu/ifi/dbs/elki/visualization/batikutil/ThumbnailRegistryEntry.java
+++ b/src/de/lmu/ifi/dbs/elki/visualization/batikutil/ThumbnailRegistryEntry.java
@@ -226,7 +226,7 @@ public class ThumbnailRegistryEntry extends AbstractRegistryEntry implements URL
@Override
public ParsedURLData parseURL(String urlStr) {
if(logger.isDebuggingFinest()) {
- logger.debugFinest("parseURL: " + urlStr, new Throwable());
+ logger.debugFinest("parseURL: " + urlStr);
}
if(urlStr.startsWith(INTERNAL_PREFIX)) {
InternalParsedURLData ret = new InternalParsedURLData(urlStr.substring(INTERNAL_PREFIX.length())); | Less verbose logging. The tracebacks aren't that useful anymore. | elki-project_elki | train | java |
2a128893cc3e7686a97d5d15d9ebb77c947f7b7d | diff --git a/tests/integration/test_record_mode.py b/tests/integration/test_record_mode.py
index <HASH>..<HASH> 100644
--- a/tests/integration/test_record_mode.py
+++ b/tests/integration/test_record_mode.py
@@ -87,6 +87,22 @@ def test_new_episodes_record_mode_two_times(tmpdir):
response = urlopen('http://httpbin.org/').read()
+def test_once_mode_after_new_episodes(tmpdir):
+ testfile = str(tmpdir.join('recordmode.yml'))
+ with vcr.use_cassette(testfile, record_mode="new_episodes"):
+ # cassette file doesn't exist, so create.
+ response1 = urlopen('http://httpbin.org/').read()
+
+ with vcr.use_cassette(testfile, record_mode="once") as cass:
+ # make the same request again
+ response = urlopen('http://httpbin.org/').read()
+
+ # now that we are back in once mode, this should raise
+ # an error.
+ with pytest.raises(Exception):
+ response = urlopen('http://httpbin.org/').read()
+
+
def test_all_record_mode(tmpdir):
testfile = str(tmpdir.join('recordmode.yml')) | Adds a test to ensure that the cassette created with "new_episodes" has different expected behavior when opened with "once". | kevin1024_vcrpy | train | py |
acf3c7cc17717083500ca2add3d0a3e91a3580ad | diff --git a/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java b/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java
+++ b/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java
@@ -615,7 +615,7 @@ public abstract class AbstractJavaGeneratorMojo extends AbstractJaxbMojo {
if ("file".equalsIgnoreCase(current.getProtocol())) {
unwrappedSourceXSDs.add(FileSystemUtilities.relativize(
current.getPath(),
- getProject().getBasedir()));
+ new File(System.getProperty("user.dir"))));
} else {
unwrappedSourceXSDs.add(current.toString());
} | Fixes #5 XSD files computed relative to current directory | mojohaus_jaxb2-maven-plugin | train | java |
f7dd828e25651f3508517e4b567f16656d6c70e6 | diff --git a/lib/unparser/buffer.rb b/lib/unparser/buffer.rb
index <HASH>..<HASH> 100644
--- a/lib/unparser/buffer.rb
+++ b/lib/unparser/buffer.rb
@@ -30,7 +30,7 @@ module Unparser
if @content[-1] == NL
prefix
end
- @content << string
+ write(string)
self
end
@@ -43,7 +43,7 @@ module Unparser
# @api private
#
def append_without_prefix(string)
- @content << string
+ write(string)
self
end
@@ -76,7 +76,7 @@ module Unparser
# @api private
#
def nl
- @content << NL
+ write(NL)
self
end
@@ -127,7 +127,15 @@ module Unparser
# @api private
#
def prefix
- @content << INDENT_SPACE * @indent
+ write(INDENT_SPACE * @indent)
+ end
+
+ # Write to content buffer
+ #
+ # @param [String] fragment
+ #
+ def write(fragment)
+ @content << fragment
end
end # Buffer | Centralize buffer writes
* Makes it easier to inject debug statements. | mbj_unparser | train | rb |
f8520fce4ee1bfb97722a1398ff85eb06e8ba066 | diff --git a/datasource-decorator-spring-boot-autoconfigure/src/main/java/com/github/gavlyukovskiy/cloud/sleuth/TracingJdbcEventListener.java b/datasource-decorator-spring-boot-autoconfigure/src/main/java/com/github/gavlyukovskiy/cloud/sleuth/TracingJdbcEventListener.java
index <HASH>..<HASH> 100644
--- a/datasource-decorator-spring-boot-autoconfigure/src/main/java/com/github/gavlyukovskiy/cloud/sleuth/TracingJdbcEventListener.java
+++ b/datasource-decorator-spring-boot-autoconfigure/src/main/java/com/github/gavlyukovskiy/cloud/sleuth/TracingJdbcEventListener.java
@@ -120,6 +120,7 @@ public class TracingJdbcEventListener extends SimpleJdbcEventListener {
public void onAfterResultSetClose(ResultSetInformation resultSetInformation, SQLException e) {
Span statementSpan = tracer.getCurrentSpan();
statementSpan.logEvent(Span.CLIENT_RECV);
+ tracer.addTag(SleuthListenerConfiguration.SPAN_ROW_COUNT_TAG_NAME, String.valueOf(resultSetInformation.getCurrRow()));
if (e != null) {
tracer.addTag(Span.SPAN_ERROR_TAG_NAME, ExceptionUtils.getExceptionMessage(e));
} | Added row-count tag from ResultSet statements | gavlyukovskiy_spring-boot-data-source-decorator | train | java |
65ef922b0e70c1adf5e66982af26e67940ffbb64 | diff --git a/minium-script-rhinojs/src/main/java/minium/script/rhinojs/RhinoWebModules.java b/minium-script-rhinojs/src/main/java/minium/script/rhinojs/RhinoWebModules.java
index <HASH>..<HASH> 100644
--- a/minium-script-rhinojs/src/main/java/minium/script/rhinojs/RhinoWebModules.java
+++ b/minium-script-rhinojs/src/main/java/minium/script/rhinojs/RhinoWebModules.java
@@ -26,7 +26,6 @@ import minium.web.internal.expression.Expressionizer;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
-import org.mozilla.javascript.NativeObject;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.json.JsonParser;
import org.mozilla.javascript.json.JsonParser.ParseException;
@@ -69,7 +68,7 @@ public class RhinoWebModules {
try {
Context cx = Context.enter();
if (obj instanceof String) {
- return new JsonParser(cx, new NativeObject()).parseValue((String) obj);
+ return new JsonParser(cx, cx.initStandardObjects()).parseValue((String) obj);
}
return obj;
} catch (ParseException e) { | a simple NativeObject() was not sufficient to Rhino JsonParser, we had to pass cx.initStandardObjects() | viltgroup_minium | train | java |
288c4da18bdb1e72650ae2141955d136f6a14ff7 | diff --git a/lib/audited/rspec_matchers.rb b/lib/audited/rspec_matchers.rb
index <HASH>..<HASH> 100644
--- a/lib/audited/rspec_matchers.rb
+++ b/lib/audited/rspec_matchers.rb
@@ -76,6 +76,8 @@ module Audited
"Did not expect #{@expectation}"
end
+ alias_method :failure_message_when_negated, :negative_failure_message
+
def description
description = "audited"
description += " associated with #{@options[:associated_with]}" if @options.key?(:associated_with)
@@ -149,6 +151,8 @@ module Audited
"Expected #{model_class} to not have associated audits"
end
+ alias_method :failure_message_when_negated, :negative_failure_message
+
def description
"has associated audits"
end | Alias RSpec matcher methods for RSpec 3
Similar to pull #<I>, this pull should eliminate the deprecation
warnings RSpec emits when using the audited RSpec matchers. Aliasing
the methods should leave it compatible with earlier versions of RSpec
as well. | collectiveidea_audited | train | rb |
3cf34eaa7f1da5d2532a62df498d2a5f522cc51b | diff --git a/scraper/code_gov/__init__.py b/scraper/code_gov/__init__.py
index <HASH>..<HASH> 100644
--- a/scraper/code_gov/__init__.py
+++ b/scraper/code_gov/__init__.py
@@ -46,7 +46,7 @@ def process_config(config, compute_labor_hours=True):
code_gov_metadata['releases'].append(code_gov_project)
# Parse config for GitLab repositories
- gitlab_instances = config.get('Gitlab', [])
+ gitlab_instances = config.get('GitLab', [])
for instance in gitlab_instances:
url = instance.get('url')
# orgs = instance.get('orgs', []) | Fixed GitLab object name expected in config file | LLNL_scraper | train | py |
5a2fc8dab8780e9ad1724bae402c47f610fa754b | diff --git a/devices/tuya.js b/devices/tuya.js
index <HASH>..<HASH> 100644
--- a/devices/tuya.js
+++ b/devices/tuya.js
@@ -1797,7 +1797,7 @@ module.exports = [
],
},
{
- fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_4fjiwweb'}],
+ fingerprint: [{modelID: 'TS004F', manufacturerName: '_TZ3000_4fjiwweb'}, {modelID: 'TS004F', manufacturerName: '_TZ3000_uri7ongn'}],
model: 'ERS-10TZBVK-AA',
vendor: 'TuYa',
description: 'Smart knob', | Add _TZ<I>_uri7ongn to ERS-<I>TZBVK-AA (#<I>)
I seem to have a different revision of this device, with different fingerprint. | Koenkk_zigbee-shepherd-converters | train | js |
258b4049d26918344ba444dd8c0ae20418fbe00b | diff --git a/ChromeController/manager_base.py b/ChromeController/manager_base.py
index <HASH>..<HASH> 100644
--- a/ChromeController/manager_base.py
+++ b/ChromeController/manager_base.py
@@ -17,7 +17,7 @@ class ChromeInterface():
"""
- def __init__(self, binary=None, dbg_port=None, use_execution_manager=None, *args, **kwargs):
+ def __init__(self, binary, dbg_port, use_execution_manager, *args, **kwargs):
"""
Base chromium transport initialization. | Whoops, force those parameters to be passed. | fake-name_ChromeController | train | py |
cfc883f87c837c8801d3e5c23ebde36b2e4116d4 | diff --git a/src/Service/InstallHelperService.php b/src/Service/InstallHelperService.php
index <HASH>..<HASH> 100644
--- a/src/Service/InstallHelperService.php
+++ b/src/Service/InstallHelperService.php
@@ -639,7 +639,16 @@ class InstallHelperService implements ServiceLocatorAwareInterface
if (isset($serverPackages['packages']) && $serverPackages['packages']) {
foreach ($serverPackages['packages'] as $package) {
- if ($package['packageIsActive']) {
+ /**
+ * If type is 1 (for site)
+ * we must check if the site is active
+ */
+ if($type == 1){
+ if ($package['packageIsActive']) {
+ if (!in_array(strtolower(trim($package['packageModuleName'])), $moduleExceptions))
+ $packages[] = $package;
+ }
+ }else{
if (!in_array(strtolower(trim($package['packageModuleName'])), $moduleExceptions))
$packages[] = $package;
} | Fixed problem on displaying non active site | melisplatform_melis-installer | train | php |
dab8969b86bf174a42432ea1b902189815762d04 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1460,7 +1460,7 @@
//. Function wrapper for [`fantasy-land/invert`][].
//.
//. ```javascript
- //. invert(Sum(5))
+ //. > invert(Sum(5))
//. Sum(-5)
//. ```
function invert(group) { | documentation: add missing ‘>’ on input line | sanctuary-js_sanctuary-type-classes | train | js |
3b40a47cbc36be8cf2428e30d983dddd95be81db | diff --git a/GPy/core/parameterized.py b/GPy/core/parameterized.py
index <HASH>..<HASH> 100644
--- a/GPy/core/parameterized.py
+++ b/GPy/core/parameterized.py
@@ -195,7 +195,7 @@ class Parameterized(object):
def constrain_negative(self, regexp):
""" Set negative constraints. """
- self.constrain(regexp, transformations.Negative_logexp())
+ self.constrain(regexp, transformations.NegativeLogexp())
def constrain_positive(self, regexp):
""" Set positive constraints. """
diff --git a/GPy/core/transformations.py b/GPy/core/transformations.py
index <HASH>..<HASH> 100644
--- a/GPy/core/transformations.py
+++ b/GPy/core/transformations.py
@@ -43,7 +43,7 @@ class Logexp(Transformation):
def __str__(self):
return '(+ve)'
-class Negative_logexp(Transformation):
+class NegativeLogexp(Transformation):
domain = NEGATIVE
def f(self, x):
return -Logexp.f(x) # np.log(1. + np.exp(x)) | NegativeLogexp Pep8ted | SheffieldML_GPy | train | py,py |
e579aab5529f080d88aed35656b66d80a2065a64 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -66,12 +66,18 @@ Spec::Runner.configure do |config|
$tmpfiles.clear
end
end
-end
-# Set the confdir and vardir to gibberish so that tests
-# have to be correctly mocked.
-Puppet[:confdir] = "/dev/null"
-Puppet[:vardir] = "/dev/null"
+ config.prepend_before :each do
+ # these globals are set by Application
+ $puppet_application_mode = nil
+ $puppet_application_name = nil
+
+ # Set the confdir and vardir to gibberish so that tests
+ # have to be correctly mocked.
+ Puppet[:confdir] = "/dev/null"
+ Puppet[:vardir] = "/dev/null"
+ end
+end
# We need this because the RAL uses 'should' as a method. This
# allows us the same behaviour but with a different method name. | maint: spec_helper should reset settings directories on *every* test
Previously, spec_helper's attempts to set :confdir, and :vardir to
/dev/null were getting thwarted by the Settings.clear in after_all | puppetlabs_puppet | train | rb |
2cf88a5c963b0a73456f0667b7ec31fc0f745e8e | diff --git a/solr/solr.go b/solr/solr.go
index <HASH>..<HASH> 100644
--- a/solr/solr.go
+++ b/solr/solr.go
@@ -198,16 +198,9 @@ func (si *SolrInterface) Schema() (*Schema, error) {
// Return 'status' and QTime from solr, if everything is fine status should have value 'OK'
// QTime will have value -1 if can not determine
func (si *SolrInterface) Ping() (status string, qtime int, err error) {
- var path string
params := &url.Values{}
params.Add("wt", "json")
- if si.conn.core != "" {
- path = fmt.Sprintf("%s/%s/admin/ping?%s", si.conn.url.String(), si.conn.core, params.Encode())
- } else {
- path = fmt.Sprintf("%s/admin/ping?%s", si.conn.url.String(), params.Encode())
- }
-
- r, err := HTTPGet(path, nil, si.conn.username, si.conn.password)
+ r, err := HTTPGet(fmt.Sprintf("%s/%s/admin/ping?%s", si.conn.url.String(), si.conn.core, params.Encode()), nil, si.conn.username, si.conn.password)
if err != nil {
return "", -1, err
} | We should have a core in this case | vanng822_go-solr | train | go |
14c18c76ac00360dfb6e4e6fadfa3665b5b3ee8a | diff --git a/nougat/context/request.py b/nougat/context/request.py
index <HASH>..<HASH> 100644
--- a/nougat/context/request.py
+++ b/nougat/context/request.py
@@ -39,7 +39,12 @@ class Request:
@cached_property
def cookies(self):
- return SimpleCookie(self.headers.get('Cookies', ''))
+ _cookies = {}
+ cookies = SimpleCookie(self.headers.get('Cookie', ''))
+ for cookie in cookies.values():
+ _cookies[cookie.key] = cookie.value
+
+ return _cookies
def __body_format(self, body):
""" | fixed: formatted cookies into dict. | Riparo_nougat | train | py |
39dd9b6483159aa7f39af7dda63cc95f5445464d | diff --git a/cmd/iam.go b/cmd/iam.go
index <HASH>..<HASH> 100644
--- a/cmd/iam.go
+++ b/cmd/iam.go
@@ -672,8 +672,10 @@ func (sys *IAMSys) DeletePolicy(policyName string) error {
if pset.Contains(policyName) {
cr, ok := sys.iamUsersMap[u]
if !ok {
- // This case cannot happen
- return errNoSuchUser
+ // This case can happen when an temporary account
+ // is deleted or expired, removed it from userPolicyMap.
+ delete(sys.iamUserPolicyMap, u)
+ continue
}
pset.Remove(policyName)
// User is from STS if the cred are temporary | fix: do not return an error on expired credentials (#<I>)
policy might have an associated mapping with an expired
user key, do not return an error during DeletePolicy
for such situations - proceed normally as its an
expected situation. | minio_minio | train | go |
557d5498e5b1839dc3007e30cb781ad08118d959 | diff --git a/src/components/BaseModal.js b/src/components/BaseModal.js
index <HASH>..<HASH> 100644
--- a/src/components/BaseModal.js
+++ b/src/components/BaseModal.js
@@ -229,7 +229,7 @@ class BaseModal extends Component<ModalProps, State> {
basFooter: !!footer,
}}
>
- <View style={[styles.container, hidden]}>
+ <View pointerEvents={this.isSwipingOut ? 'none' : 'auto'} style={[styles.container, hidden]}>
<DraggableView
style={StyleSheet.flatten([styles.draggableView, style])}
onMove={this.handleMove} | Disable pointer events on modal when swiping out | jacklam718_react-native-popup-dialog | train | js |
b908001366a39b00aa32080af575dbe44443c770 | diff --git a/quota/lock.go b/quota/lock.go
index <HASH>..<HASH> 100644
--- a/quota/lock.go
+++ b/quota/lock.go
@@ -13,12 +13,13 @@ type multiLocker struct {
func (l *multiLocker) Lock(name string) {
l.mut.Lock()
- defer l.mut.Unlock()
- _, ok := l.m[name]
+ mutex, ok := l.m[name]
if !ok {
- l.m[name] = new(sync.Mutex)
+ mutex = new(sync.Mutex)
+ l.m[name] = mutex
}
- l.m[name].Lock()
+ l.mut.Unlock()
+ mutex.Lock()
}
func (l *multiLocker) Unlock(name string) {
diff --git a/quota/lock_test.go b/quota/lock_test.go
index <HASH>..<HASH> 100644
--- a/quota/lock_test.go
+++ b/quota/lock_test.go
@@ -6,6 +6,7 @@ package quota
import (
"launchpad.net/gocheck"
+ "runtime"
"sync"
)
@@ -37,6 +38,7 @@ func (Suite) TestMultiLockerUsage(c *gocheck.C) {
locker.Unlock("user@tsuru.io")
wg.Done()
}()
+ runtime.Gosched()
c.Assert(count, gocheck.Equals, 0)
locker.Unlock("user@tsuru.io")
wg.Wait() | quota: fix dead lock on multiLocker
Apparently, I'm stupid... | tsuru_tsuru | train | go,go |
d2f7a240c52e79d78fa037c1555935718d471898 | diff --git a/src/edu/jhu/hltcoe/util/cplex/CplexUtils.java b/src/edu/jhu/hltcoe/util/cplex/CplexUtils.java
index <HASH>..<HASH> 100644
--- a/src/edu/jhu/hltcoe/util/cplex/CplexUtils.java
+++ b/src/edu/jhu/hltcoe/util/cplex/CplexUtils.java
@@ -218,6 +218,9 @@ public class CplexUtils {
* problem where we can do early stopping as we do in RLT. Then we could
* compare against the objective value given by the dual simplex algorithm,
* which (it turns out) is exactly what we want anyway.
+ *
+ * This might help:
+ * http://www.or-exchange.com/questions/1113/cplex-attributing-dual-values-to-lhsrhs-constraints
*/
@Deprecated
public static double getDualObjectiveValue(IloCplex cplex, IloLPMatrix mat) throws IloException { | Adding potentially useful website
git-svn-id: svn+ssh://external.hltcoe.jhu.edu/home/hltcoe/mgormley/public/repos/dep_parse_filtered/trunk@<I> <I>f-cb4b-<I>-8b<I>-c<I>bcb<I> | mgormley_pacaya | train | java |
25a83331a667bc3fad0827acc02892be9dc4aca7 | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -187,6 +187,9 @@ htmlhelp_basename = 'ROGUEdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
+ 'classoptions': ',openany,onside',
+ 'babel': '\\usepackage[english]{babel}'
+}
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
@@ -195,7 +198,7 @@ latex_elements = {
# Additional stuff for the LaTeX preamble.
#'preamble': '',
-}
+
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, | Updated config for docs
This eliminates many of the blank pages when generating a pdf. | ROGUE-JCTD_rogue_geonode | train | py |
ae8b2c622d5c91c1e3bc91cee1e960d518d7a921 | diff --git a/ravel.py b/ravel.py
index <HASH>..<HASH> 100644
--- a/ravel.py
+++ b/ravel.py
@@ -236,7 +236,7 @@ class Connection(dbus.TaskKeeper) :
for node, child in level.children.items() :
remove_listeners(child, path + [node])
#end for
- for interface in level.interfaces :
+ for interface in level.interfaces.values() :
for rulestr in interface.listening :
ignore = dbus.Error.init()
self.connection.bus_remove_match(rulestr, ignore) | Want to iterate over interface objects, not their names (H/T @joell) | ldo_dbussy | train | py |
5ac8dbce1489a709561cf10d01ffd58205c7a898 | diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/TestResource.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/TestResource.java
index <HASH>..<HASH> 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/TestResource.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/TestResource.java
@@ -181,7 +181,6 @@ public class TestResource extends JaxRsResourceBase {
final ClockMock testClock = getClockMock();
if (requestedClockDate == null) {
- log.info("************ RESETTING CLOCK to " + clock.getUTCNow());
testClock.resetDeltaFromReality();
} else {
final DateTime newTime = DATE_TIME_FORMATTER.parseDateTime(requestedClockDate).toDateTime(DateTimeZone.UTC); | jaxrs: remove confusing log line
The time displayed was wrong when resetting the clock. The right log line
is now printed in killbill-commons. | killbill_killbill | train | java |
5158c6e6b9aa16a901851bcc3f739d5f5fc5bc3d | diff --git a/patoolib/programs/py_zipfile.py b/patoolib/programs/py_zipfile.py
index <HASH>..<HASH> 100644
--- a/patoolib/programs/py_zipfile.py
+++ b/patoolib/programs/py_zipfile.py
@@ -16,6 +16,7 @@
"""Archive commands for the zipfile Python module."""
from patoolib import util
import zipfile
+import os
READ_SIZE_BYTES = 1024*1024
@@ -59,7 +60,18 @@ def create_zip (archive, compression, cmd, *args, **kwargs):
zfile = zipfile.ZipFile(archive, 'w')
try:
for filename in args:
- zfile.write(filename)
+ if os.path.isdir(filename):
+ write_directory(zfile, filename)
+ else:
+ zfile.write(filename)
finally:
zfile.close()
return None
+
+
+def write_directory (zfile, directory):
+ """Write recursively all directories and filenames to zipfile instance."""
+ for dirpath, dirnames, filenames in os.walk(directory):
+ zfile.write(dirpath)
+ for filename in filenames:
+ zfile.write(os.path.join(dirpath, filename)) | Fix creating zip files with directories. | wummel_patool | train | py |
199d40857a0558c1093ec2eff20a9a02cb0ac07f | diff --git a/salt/client/ssh/wrapper/__init__.py b/salt/client/ssh/wrapper/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/client/ssh/wrapper/__init__.py
+++ b/salt/client/ssh/wrapper/__init__.py
@@ -30,7 +30,7 @@ class FunctionWrapper(dict):
super(FunctionWrapper, self).__init__()
self.wfuncs = wfuncs if isinstance(wfuncs, dict) else {}
self.opts = opts
- self.mods = mods
+ self.mods = mods if isinstance(mods, dict) else {}
self.kwargs = {'id_': id_,
'host': host}
self.kwargs.update(kwargs) | Add some safetly to mods | saltstack_salt | train | py |
35239ccecec97c5339f2ee5cf408259c5a272eb3 | diff --git a/java/calcite/src/main/java/com/mapd/parser/extension/ddl/heavydb/HeavyDBGeo.java b/java/calcite/src/main/java/com/mapd/parser/extension/ddl/heavydb/HeavyDBGeo.java
index <HASH>..<HASH> 100644
--- a/java/calcite/src/main/java/com/mapd/parser/extension/ddl/heavydb/HeavyDBGeo.java
+++ b/java/calcite/src/main/java/com/mapd/parser/extension/ddl/heavydb/HeavyDBGeo.java
@@ -1,3 +1,3 @@
package com.mapd.parser.extension.ddl.heavydb;
-public enum HeavyDBGeo { POINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON }
+public enum HeavyDBGeo { POINT, LINESTRING, POLYGON, MULTIPOLYGON, MULTILINESTRING } | Preserve original order in HeavyDBGeo enum, append instead of insert | omnisci_mapd-core | train | java |
93729c50b2535eb5dfe5b76be14614d26b5a58aa | diff --git a/test/Robots.js b/test/Robots.js
index <HASH>..<HASH> 100644
--- a/test/Robots.js
+++ b/test/Robots.js
@@ -11,7 +11,7 @@ function testRobots(url, contents, allowed, disallowed) {
});
disallowed.forEach(function (url) {
- expect(robots.isAllowed(url)).to.equal(false);
+ expect(robots.isDisallowed(url)).to.equal(true);
});
}
@@ -211,6 +211,7 @@ describe('Robots', function () {
expect(robots.getCrawlDelay('b')).to.equal(undefined);
expect(robots.getCrawlDelay('c')).to.equal(10);
expect(robots.getCrawlDelay('d')).to.equal(10);
+ expect(robots.getCrawlDelay()).to.equal(undefined);
done();
});
@@ -377,4 +378,4 @@ describe('Robots', function () {
done();
});
-});
\ No newline at end of file
+}); | Extended tests to cover <I>% | samclarke_robots-parser | train | js |
3593884057456c3dba67a88b599b22534e7b6ceb | diff --git a/src/View/Input/Button.php b/src/View/Input/Button.php
index <HASH>..<HASH> 100644
--- a/src/View/Input/Button.php
+++ b/src/View/Input/Button.php
@@ -53,7 +53,7 @@ class Button implements InputInterface {
*
* Any other keys provided in $data will be converted into HTML attributes.
*
- * @param array $data The data to build an input with.
+ * @param array $data The data to build a button with.
* @return string
*/
public function render(array $data) {
diff --git a/src/View/Input/File.php b/src/View/Input/File.php
index <HASH>..<HASH> 100644
--- a/src/View/Input/File.php
+++ b/src/View/Input/File.php
@@ -45,7 +45,7 @@ class File implements InputInterface {
* Unlike other input objects the `val` property will be specifically
* ignored.
*
- * @param array $data The data to build a textarea with.
+ * @param array $data The data to build a file input with.
* @return string HTML elements.
*/
public function render(array $data) { | Correct Button and File widget docblocks | cakephp_cakephp | train | php,php |
30c4fd7b1cb2fc4c32fc13995d63cdad7aa7e106 | diff --git a/pybars/_compiler.py b/pybars/_compiler.py
index <HASH>..<HASH> 100644
--- a/pybars/_compiler.py
+++ b/pybars/_compiler.py
@@ -199,6 +199,8 @@ class Scope:
return self.last
if name == 'this':
return self.context
+ if isinstance(name, str) and hasattr(self.context, name):
+ return getattr(self.context, name)
try:
return self.context[name]
diff --git a/pybars/tests/test_acceptance.py b/pybars/tests/test_acceptance.py
index <HASH>..<HASH> 100644
--- a/pybars/tests/test_acceptance.py
+++ b/pybars/tests/test_acceptance.py
@@ -606,6 +606,17 @@ class TestAcceptance(TestCase):
self.assertEqual("goodbye! Goodbye! GOODBYE! cruel world!",
render(source, context))
+ def test_context_with_attrs(self):
+ class TestContext():
+ @property
+ def text(self):
+ return 'Goodbye'
+
+ source = u"{{#each .}}{{text}}! {{/each}}cruel world!"
+ context = [TestContext()]
+ self.assertEqual("Goodbye! cruel world!",
+ render(source, context))
+
def test_each(self):
source = u"{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!"
context = {'goodbyes': | Added support for using object attributes in scopes | wbond_pybars3 | train | py,py |
992093732cafea60ca4f2fba5b162f41addd8568 | diff --git a/components/utils/scripts/proxy.js b/components/utils/scripts/proxy.js
index <HASH>..<HASH> 100644
--- a/components/utils/scripts/proxy.js
+++ b/components/utils/scripts/proxy.js
@@ -25,7 +25,10 @@ elation.require(['utils.events'], function() {
function executeCallback(fn, target, args) {
try {
if (elation.utils.isString(fn)) {
- eval(fn);
+ (function(fn) {
+ var event = args[0];
+ return eval(fn);
+ }).call(self._proxyobj, fn);
} else if (fn instanceof Function) {
fn.apply(target, args);
} | Event callback "this" and "event" scope bindings | jbaicoianu_elation | train | js |
8c63b88f3085177a9fb34ff471b1e71dfb70c407 | diff --git a/jenetics/src/main/java/io/jenetics/util/SeqView.java b/jenetics/src/main/java/io/jenetics/util/SeqView.java
index <HASH>..<HASH> 100644
--- a/jenetics/src/main/java/io/jenetics/util/SeqView.java
+++ b/jenetics/src/main/java/io/jenetics/util/SeqView.java
@@ -83,4 +83,14 @@ final class SeqView<T> implements Seq<T> {
return ISeq.<T>of(_list).prepend(values);
}
+ @Override
+ public Object[] toArray() {
+ return _list.toArray();
+ }
+
+ @Override
+ public <B> B[] toArray(final B[] array) {
+ return _list.toArray(array);
+ }
+
} | #<I>: Override 'toArray' methods. | jenetics_jenetics | train | java |
988cac1b4dc5042475ae32618c786e71183e6cc8 | diff --git a/src/forms/drop.js b/src/forms/drop.js
index <HASH>..<HASH> 100644
--- a/src/forms/drop.js
+++ b/src/forms/drop.js
@@ -222,10 +222,12 @@ d3plus.forms.drop = function(vars,styles,timing) {
.parent(vars.tester)
.id(vars.id)
.timing(0)
+ .large(9999)
.draw()
var w = button.width()
drop_width = d3.max(w)
+ drop_width += styles.stroke*2
button.remove()
if (vars.dev) d3plus.console.timeEnd("calculating width")
@@ -470,7 +472,7 @@ d3plus.forms.drop = function(vars,styles,timing) {
text = "text"
}
- var large = timing ? vars.large : 0
+ var large = vars.data.array.length < vars.large ? vars.large : 0
var buttons = d3plus.forms(style)
.dev(vars.dev) | fixed auto-width of drop down menus | alexandersimoes_d3plus | train | js |
180516839c4a03697142570e37537e5e433f0537 | diff --git a/lib/byebug/helpers/parse.rb b/lib/byebug/helpers/parse.rb
index <HASH>..<HASH> 100644
--- a/lib/byebug/helpers/parse.rb
+++ b/lib/byebug/helpers/parse.rb
@@ -10,7 +10,7 @@ module Byebug
# If either +min+ or +max+ is nil, that value has no bound.
#
def get_int(str, cmd, min = nil, max = nil)
- if str !~ /\A[0-9]+\z/
+ if str !~ /\A-?[0-9]+\z/
err = pr('parse.errors.int.not_number', cmd: cmd, str: str)
return nil, errmsg(err)
end | make frame cmd work with negative arg | deivid-rodriguez_byebug | 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.