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
|
---|---|---|---|---|---|
cd3c460c24628e7dcc168dc965e96e7db31885fb
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -40,8 +40,8 @@ install_requires = [
'Werkzeug~=0.0,>=0.12.2',
'elasticsearch-dsl~=2.0,>=2.2.0',
'elasticsearch~=2.0,>=2.4.1',
- 'inspire-json-merger~=6.0,>=6.0.0',
- 'inspire-utils~=1.0,>=1.0.0',
+ 'inspire-json-merger~=7.0,>=7.0.0',
+ 'inspire-utils~=2.0,>=2.0.0',
'invenio-search>=1.0.0a10',
'six~=1.0,>=1.11.0',
]
|
setup: bump inspire-utils
Sem-ver: breaks compatibility
|
inspirehep_inspire-matcher
|
train
|
py
|
7b49acd7f00c43ccaa67d6c83102755d87bd05b0
|
diff --git a/test/karma.conf.js b/test/karma.conf.js
index <HASH>..<HASH> 100644
--- a/test/karma.conf.js
+++ b/test/karma.conf.js
@@ -16,8 +16,8 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
- "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js",
- "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular-mocks.js",
+ "bower_components/angular/angular.min.js",
+ "bower_components/angular-mocks/angular-mocks.js",
"src/paging.js",
"test/paging.spec.js"
],
|
Replace CDN angular files with bower_components files to support phantom JS testing
|
brantwills_Angular-Paging
|
train
|
js
|
586015aa2f736d6e2e0ecdd1e67053c1bcc15209
|
diff --git a/bg/vertex.py b/bg/vertex.py
index <HASH>..<HASH> 100644
--- a/bg/vertex.py
+++ b/bg/vertex.py
@@ -7,7 +7,6 @@ __status__ = "develop"
class BGVertex(object):
def __init__(self, name, info=None):
self.name = name
- self.info = {}
if info is None:
info = {}
self.info = info
\ No newline at end of file
|
finish polishing __init__method from statements that have no effect
|
aganezov_bg
|
train
|
py
|
09d51ae98b96e361b5a75e0af50ca41e0fe78109
|
diff --git a/pymatgen/util/provenance.py b/pymatgen/util/provenance.py
index <HASH>..<HASH> 100644
--- a/pymatgen/util/provenance.py
+++ b/pymatgen/util/provenance.py
@@ -239,7 +239,7 @@ class StructureNL(object):
# check remarks limit
for r in self.remarks:
- if len(r) > 140:
+ if len(r) > 280:
raise ValueError("The remark exceeds the maximum size of"
"140 characters: {}".format(r))
|
Update SNL remarks to <I>
|
materialsproject_pymatgen
|
train
|
py
|
d8cba678f95b546716efa6f2de49d2b457510e40
|
diff --git a/interact.js b/interact.js
index <HASH>..<HASH> 100755
--- a/interact.js
+++ b/interact.js
@@ -1865,7 +1865,9 @@ var document = window.document,
// interact, clear the cursor style
if (!styleCursor) {
for (i = 0; i < interactables.length; i++) {
- interactables[i]._element.style.cursor = '';
+ if (interactables[i]._element !== document) {
+ interactables[i]._element.style.cursor = '';
+ }
}
}
return interact;
|
Don't try to style the cursor of `document`
|
taye_interact.js
|
train
|
js
|
c029e60dd11157be81b1d628da075e9729b5f823
|
diff --git a/bg/__init__.py b/bg/__init__.py
index <HASH>..<HASH> 100644
--- a/bg/__init__.py
+++ b/bg/__init__.py
@@ -3,7 +3,7 @@ __author__ = "Sergey Aganezov"
__email__ = "aganezov(at)gwu.edu"
__status__ = "develop"
-version = "0.9.0.dev2"
+version = "1.0.0a"
__all__ = ["breakpoint_graph",
"vertex",
|
changing version of a package in anticipation of a first major release
|
aganezov_bg
|
train
|
py
|
8355d15ec2cbdf562c87407fe56fef781846de1e
|
diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb
index <HASH>..<HASH> 100644
--- a/test/fakefs_test.rb
+++ b/test/fakefs_test.rb
@@ -4,9 +4,14 @@ class FakeFSTest < Test::Unit::TestCase
include FakeFS
def setup
+ FakeFS.activate!
FileSystem.clear
end
+ def teardown
+ FakeFS.deactivate!
+ end
+
def test_can_be_initialized_empty
fs = FileSystem
assert_equal 0, fs.files.size
diff --git a/test/safe_test.rb b/test/safe_test.rb
index <HASH>..<HASH> 100644
--- a/test/safe_test.rb
+++ b/test/safe_test.rb
@@ -5,6 +5,10 @@ class FakeFSSafeTest < Test::Unit::TestCase
FakeFS.deactivate!
end
+ def teardown
+ FakeFS.activate!
+ end
+
def test_FakeFS_method_does_not_intrude_on_global_namespace
path = '/path/to/file.txt'
|
activate! & deactivate! state properly in tests (which allows easy replication of bug reported in #<I>)
|
fakefs_fakefs
|
train
|
rb,rb
|
25a6d16c8c33e2a185eb0bdb84c3575457377cb5
|
diff --git a/lewis/adapters/epics.py b/lewis/adapters/epics.py
index <HASH>..<HASH> 100644
--- a/lewis/adapters/epics.py
+++ b/lewis/adapters/epics.py
@@ -410,13 +410,12 @@ class PropertyExposingDriver(Driver):
return False
try:
- with self.lock:
- pv_object.value = value
- self.setParam(pv, pv_object.value)
+ pv_object.value = value
+ self.setParam(pv, pv_object.value)
return True
except (LimitViolationException, AccessViolationException):
- return False
+ self.log.exception('An error occurred when writing %s to PV %s', value, pv)
def process_pv_updates(self, force=False):
dt = seconds_since(self._last_update_call or datetime.now())
|
Remove testcode that accidentally ended up in epics module
|
DMSC-Instrument-Data_lewis
|
train
|
py
|
9023ff0b689c73036cba023e4f7b687e2b80ecf8
|
diff --git a/core/server/api/themes.js b/core/server/api/themes.js
index <HASH>..<HASH> 100644
--- a/core/server/api/themes.js
+++ b/core/server/api/themes.js
@@ -140,7 +140,7 @@ themes = {
// @TODO we should probably do this as part of saving the theme
// remove zip upload from multer
// happens in background
- Promise.promisify(fs.removeSync)(zip.path)
+ Promise.promisify(fs.remove)(zip.path)
.catch(function (err) {
logging.error(new errors.GhostError({err: err}));
});
@@ -149,7 +149,7 @@ themes = {
// remove extracted dir from gscan
// happens in background
if (checkedTheme) {
- Promise.promisify(fs.removeSync)(checkedTheme.path)
+ Promise.promisify(fs.remove)(checkedTheme.path)
.catch(function (err) {
logging.error(new errors.GhostError({err: err}));
});
|
😝 replace removeSync by sync (#<I>)
refs #<I>
- nothing to see here!
|
TryGhost_Ghost
|
train
|
js
|
4cb73014c014d53bb255c97e25e1ac6e7a1fff94
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -62,14 +62,12 @@ class Store {
commit (type, payload, options) {
// check object-style commit
- let mutation
if (isObject(type) && type.type) {
options = payload
- payload = mutation = type
+ payload = type
type = type.type
- } else {
- mutation = { type, payload }
}
+ const mutation = { type, payload }
const entry = this._mutations[type]
if (!entry) {
console.error(`[vuex] unknown mutation type: ${type}`)
diff --git a/test/unit/test.js b/test/unit/test.js
index <HASH>..<HASH> 100644
--- a/test/unit/test.js
+++ b/test/unit/test.js
@@ -674,8 +674,8 @@ describe('Vuex', () => {
expect(mutations.length).toBe(2)
expect(mutations[0].type).toBe(TEST)
expect(mutations[1].type).toBe(TEST)
- expect(mutations[0].payload.n).toBe(1) // normal dispatch
- expect(mutations[1].n).toBe(2) // object dispatch
+ expect(mutations[0].payload.n).toBe(1) // normal commit
+ expect(mutations[1].payload.n).toBe(2) // object commit
})
it('strict mode: warn mutations outside of handlers', function () {
|
object style commit should record mutation in the same format
|
vuejs_vuex
|
train
|
js,js
|
6767b439c57e74c995413b021e583533463a776e
|
diff --git a/moderngl/context.py b/moderngl/context.py
index <HASH>..<HASH> 100644
--- a/moderngl/context.py
+++ b/moderngl/context.py
@@ -1107,7 +1107,8 @@ def create_context(require=None) -> Context:
ctx.extra = None
if require is not None and ctx.version_code < require:
- raise ValueError('The version required is not provided')
+ raise ValueError('Requested OpenGL version {}, got version {}'.format(
+ require, ctx.version_code))
return ctx
|
State requeted and acquired gl version
When creating a context from an existing
opengl context we should state the requested
and aquired opengl version to make the
error message more clear.
|
moderngl_moderngl
|
train
|
py
|
f22ac196bb9227f8845e0a884b59b7d841b99534
|
diff --git a/commands/argument.go b/commands/argument.go
index <HASH>..<HASH> 100644
--- a/commands/argument.go
+++ b/commands/argument.go
@@ -10,9 +10,10 @@ const (
type Argument struct {
Name string
Type ArgumentType
- Required bool
- Variadic bool
- SupportsStdin bool
+ Required bool // error if no value is specified
+ Variadic bool // unlimited values can be specfied
+ SupportsStdin bool // can accept stdin as a value
+ Recursive bool // supports recursive file adding (with '-r' flag)
Description string
}
@@ -36,7 +37,20 @@ func FileArg(name string, required, variadic bool, description string) Argument
}
}
+// TODO: modifiers might need a different API?
+// e.g. passing enum values into arg constructors variadically
+// (`FileArg("file", ArgRequired, ArgStdin, ArgRecursive)`)
+
func (a Argument) EnableStdin() Argument {
a.SupportsStdin = true
return a
}
+
+func (a Argument) EnableRecursive() Argument {
+ if a.Type != ArgFile {
+ panic("Only ArgFile arguments can enable recursive")
+ }
+
+ a.Recursive = true
+ return a
+}
|
commands: Added Recursive modifier to Argument
|
ipfs_go-ipfs
|
train
|
go
|
991d5ceebf28eb59afe2d3bf6b35ed2945f7226e
|
diff --git a/src/controls/common/ProgressBar.js b/src/controls/common/ProgressBar.js
index <HASH>..<HASH> 100644
--- a/src/controls/common/ProgressBar.js
+++ b/src/controls/common/ProgressBar.js
@@ -1,6 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
-import ResizeObserver from 'resize-observer-polyfill';
import ProgressBarDisplay from './ProgressBarDisplay';
import PurePropTypesComponent from './PurePropTypesComponent';
|
ResizeObserver no longer imported to ProgressBar.
|
benwiley4000_cassette
|
train
|
js
|
361a1ba586338104524e313ba3eb844752d4d788
|
diff --git a/cmd/main/main.go b/cmd/main/main.go
index <HASH>..<HASH> 100644
--- a/cmd/main/main.go
+++ b/cmd/main/main.go
@@ -1,30 +1,31 @@
package main
import (
- "flag"
"fmt"
"log"
+ "os"
"github.com/robdimsdale/wundergo"
)
-var (
- accessToken = flag.String("accessToken", "", "Access Token")
- clientID = flag.String("clientID", "", "Client ID")
+const (
+ WL_CLIENT_ID = "WL_CLIENT_ID"
+ WL_ACCESS_TOKEN = "WL_ACCESS_TOKEN"
)
func main() {
- flag.Parse()
+ accessToken := os.Getenv(WL_ACCESS_TOKEN)
+ clientID := os.Getenv(WL_CLIENT_ID)
- if *accessToken == "" {
+ if accessToken == "" {
log.Fatal("Access Token must be provided")
}
- if *clientID == "" {
+ if clientID == "" {
log.Fatal("Client ID must be provided")
}
- client := wundergo.NewClient(*accessToken, *clientID)
+ client := wundergo.NewClient(accessToken, clientID)
user, err := client.User()
if err != nil {
log.Printf("Error getting user: %s\n", err.Error())
|
Obtain access token and client id from env variables.
- Instead of flags.
|
robdimsdale_wl
|
train
|
go
|
f1870c21d3ad1e349ed716ead620d385a901da5b
|
diff --git a/Controller/NodeController.php b/Controller/NodeController.php
index <HASH>..<HASH> 100644
--- a/Controller/NodeController.php
+++ b/Controller/NodeController.php
@@ -136,15 +136,16 @@ class NodeController extends AbstractModuleController
}
/**
- * @param NodeReferenceInterface $data
+ * @param Form $form
*/
- protected function persistData($data)
+ protected function persistData(Form $form)
{
- $node = $data->getNode();
+ /** @var NodeReferenceInterface $node */
+ $node = $form->getData()->getNode();
$node->setChanged(new \DateTime());
$em = $this->getDoctrine()->getManager();
- $em->persist($data);
+ $em->persist($form->getData());
$em->flush();
}
|
[Node] Reimplement interface.
|
Clastic_NodeBundle
|
train
|
php
|
e3248b786ad15f8f8f690a77055eea035e588739
|
diff --git a/troposphere/backup.py b/troposphere/backup.py
index <HASH>..<HASH> 100644
--- a/troposphere/backup.py
+++ b/troposphere/backup.py
@@ -32,6 +32,7 @@ class BackupRuleResourceType(AWSProperty):
props = {
"CompletionWindowMinutes": (double, False),
"CopyActions": ([CopyActionResourceType], False),
+ "EnableContinuousBackup": (bool, False),
"Lifecycle": (LifecycleResourceType, False),
"RecoveryPointTags": (dict, False),
"RuleName": (str, True),
|
AWS Backup: Add EnableContinuousBackup boolean to BackupRuleResourceType (#<I>)
|
cloudtools_troposphere
|
train
|
py
|
44c20b341296296d9dacfc2be32b556a7ecc9501
|
diff --git a/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java b/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java
index <HASH>..<HASH> 100644
--- a/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java
+++ b/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java
@@ -1,10 +1,9 @@
//
-// $Id: PlaylistPanel.java,v 1.4 2001/07/26 01:18:49 mdb Exp $
+// $Id: PlaylistPanel.java,v 1.5 2001/07/26 01:33:08 mdb Exp $
package robodj.chooser;
-import java.awt.Color;
-import java.awt.Font;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
@@ -319,8 +318,11 @@ public class PlaylistPanel
super.doLayout();
if (_target != null) {
- scrollRectToVisible(_target.getBounds());
+ Rectangle bounds = _target.getBounds();
_target = null;
+ // this seems to sometimes call layout(), so we need to
+ // prevent recursion
+ scrollRectToVisible(bounds);
}
}
|
Rearrange code to prevent recursion if scrollRectToVisible() results in a
call to doLayout() (which it seems to do in certain cases).
git-svn-id: <URL>
|
samskivert_samskivert
|
train
|
java
|
6fd8962acd94f5e691ed13274de17db9a4129adc
|
diff --git a/lib/callisto/thumbnail.rb b/lib/callisto/thumbnail.rb
index <HASH>..<HASH> 100644
--- a/lib/callisto/thumbnail.rb
+++ b/lib/callisto/thumbnail.rb
@@ -25,7 +25,7 @@ module Callisto
location = File.join(root_path, prefix)
return if File.exist?(save_path)
FileUtils.mkdir_p(location) unless File.directory?(location)
- task = Shell.new("convert", "#{file_path} -strip -quality 90 -resize #{size}#{flag} #{crop} #{save_path}")
+ task = Shell.new("convert", "#{file_path} -strip -quality #{quality || 90} -resize #{size}#{flag} #{crop} #{save_path}")
pid = Callisto::Pool.instance << task
Callisto::Pool.instance.wait(pid)
end
|
Allow the ability to set image quality.
|
viseztrance_callisto
|
train
|
rb
|
f7c4ae45bd34c510cb7325b15e9a0f9d1a353a12
|
diff --git a/colab/settings.py b/colab/settings.py
index <HASH>..<HASH> 100644
--- a/colab/settings.py
+++ b/colab/settings.py
@@ -243,6 +243,9 @@ MESSAGE_TAGS = {
messages.ERROR: 'alert-danger',
}
+# Colab Settings
+COLAB_HOME_URL = '/dashboard'
+
# Super Archives
SUPER_ARCHIVES_PATH = '/var/lib/mailman/archives/public'
SUPER_ARCHIVES_EXCLUDE = []
@@ -315,5 +318,3 @@ if FEEDZILLA_ENABLED:
proxied_apps = locals().get('PROXIED_APPS') or {}
for app_label in proxied_apps.keys():
INSTALLED_APPS += ('colab.proxy.{}'.format(app_label),)
-
-COLAB_HOME_URL = '/dashboard'
\ No newline at end of file
|
Moved COLAB_HOME_URL higher in the file
|
colab_colab
|
train
|
py
|
bc45b846fb7d7ed3cd9c976c99d1a1dd68ff6cdf
|
diff --git a/app/assets/javascripts/forms.js b/app/assets/javascripts/forms.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/forms.js
+++ b/app/assets/javascripts/forms.js
@@ -1,12 +1,24 @@
$(function() {
// If we restore Turbolinks, all of this should be wrapped in turbolinks:load
- $(".datepicker").datetimepicker({
- dateFormat: "dd/mm/yy"
+ $(".datepicker").datepicker({
+ dateFormat: "dd/mm/yy",
+ onSelect: function (date) {
+ if ($(".new_publish_state_button").length > 0) {
+ modifyButton();
+ }
+ }
});
- $(".datepicker").on("focus", function(ev){
+ $(".datepicker").on("focusout", function(ev){
if ($(this).val() == "") {
$(this).closest('div').addClass('is-dirty');
}
- })
+ });
});
+
+function modifyButton() {
+ var button = $(".new_publish_state_button");
+
+ button.val("schedule");
+ button.text("Schedule Post");
+}
|
Add JS for changing the Button Markup
|
cortex-cms_cortex
|
train
|
js
|
5bd3178f666892ef3e0f0aff1d5ea78247bccb25
|
diff --git a/webapps/client/scripts/pages/userEdit.js b/webapps/client/scripts/pages/userEdit.js
index <HASH>..<HASH> 100644
--- a/webapps/client/scripts/pages/userEdit.js
+++ b/webapps/client/scripts/pages/userEdit.js
@@ -152,7 +152,9 @@ define([ 'angular', 'require' ], function(angular, require) {
};
$scope.removeGroup = function(groupId) {
- var encodedGroupId = groupId.replace(/\//g, '%2F');
+ var encodedGroupId = groupId
+ .replace(/\//g, '%2F')
+ .replace(/\\/g, '%5C');
GroupMembershipResource.delete({'userId':$scope.encodedUserId, 'groupId': encodedGroupId}).$promise.then(
function(){
Notifications.addMessage({type:'success', status:'Success', message:'User '+$scope.user.id+' removed from group.'});
|
fix(groups): allow to remove group with backslashes from user
related to #CAM-<I>
|
camunda_camunda-bpm-platform
|
train
|
js
|
6e3439237d9ce622cbcfa3c6249b470a7dd59c48
|
diff --git a/cmd/gazelle/print.go b/cmd/gazelle/print.go
index <HASH>..<HASH> 100644
--- a/cmd/gazelle/print.go
+++ b/cmd/gazelle/print.go
@@ -16,6 +16,7 @@ limitations under the License.
package main
import (
+ "fmt"
"os"
"github.com/bazelbuild/bazel-gazelle/config"
@@ -23,6 +24,7 @@ import (
)
func printFile(c *config.Config, f *rule.File) error {
+ fmt.Printf(">>> %s\n", f.Path)
content := f.Format()
_, err := os.Stdout.Write(content)
return err
|
Add file name to -mode=print (#<I>)
|
bazelbuild_bazel-gazelle
|
train
|
go
|
7fba2e4a4dddabfe891355235fa1a1d0d8fddae9
|
diff --git a/lib/rugged/branch.rb b/lib/rugged/branch.rb
index <HASH>..<HASH> 100644
--- a/lib/rugged/branch.rb
+++ b/lib/rugged/branch.rb
@@ -16,7 +16,7 @@ module Rugged
#
# This is the same as calling Reference#name for the reference behind
# the path
- def cannonical_name
+ def canonical_name
super
end
|
branch: fix typo cannonical_name -> canonical_name
|
libgit2_rugged
|
train
|
rb
|
c5d231f390e01dedb82953abe0be382f1acca446
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -22,7 +22,7 @@ module.exports = function (opt) {
var options = merge({
bare: false,
- coffee: require('coffee-script'),
+ coffee: require('coffeescript'),
header: false,
sourceMap: !!file.sourceMap,
sourceRoot: false,
diff --git a/test/main.js b/test/main.js
index <HASH>..<HASH> 100644
--- a/test/main.js
+++ b/test/main.js
@@ -1,6 +1,6 @@
var coffee = require('../');
var should = require('should');
-var coffeescript = require('coffee-script');
+var coffeescript = require('coffeescript');
var gutil = require('gulp-util');
var fs = require('fs');
var path = require('path');
|
Update requires from 'coffee-script' to 'coffeescript'.
|
gulp-community_gulp-coffee
|
train
|
js,js
|
8e8258fd47f1999556d86eeb6393137fce8e8d0a
|
diff --git a/payu/__init__.py b/payu/__init__.py
index <HASH>..<HASH> 100644
--- a/payu/__init__.py
+++ b/payu/__init__.py
@@ -15,4 +15,4 @@
#
__author__ = 'Presslabs'
-__version__ = '1.0.1'
+__version__ = '1.0.2'
diff --git a/payu/urls.py b/payu/urls.py
index <HASH>..<HASH> 100644
--- a/payu/urls.py
+++ b/payu/urls.py
@@ -14,8 +14,8 @@
# limitations under the License.
#
-from django.conf.urls import patterns, url
+from django.conf.urls import url
-urlpatterns = patterns('payu.views',
+urlpatterns = [
url(r'^ipn/$', 'ipn', name='payu-ipn'),
-)
+]
|
Add support for django <I>
|
presslabs_django-payu-ro
|
train
|
py,py
|
f1fcaa7710c537fcaab44efeba840992943a12ab
|
diff --git a/src/feat/test/test_simulation_gui_driver.py b/src/feat/test/test_simulation_gui_driver.py
index <HASH>..<HASH> 100644
--- a/src/feat/test/test_simulation_gui_driver.py
+++ b/src/feat/test/test_simulation_gui_driver.py
@@ -5,8 +5,10 @@ from feat.test import common
from feat.agents.base import descriptor, agent
from feat.agencies import agency
+
try:
from feat.simulation.simgui.core import driver
+ SKIP_TEST = False
except ImportError, e:
SKIP_TEST = str(e)
|
Fix problem after the successful import of glib library.
|
f3at_feat
|
train
|
py
|
fcafc032c8f27d162a821da60789078e71056174
|
diff --git a/plugins/Referrers/Columns/ReferrerUrl.php b/plugins/Referrers/Columns/ReferrerUrl.php
index <HASH>..<HASH> 100644
--- a/plugins/Referrers/Columns/ReferrerUrl.php
+++ b/plugins/Referrers/Columns/ReferrerUrl.php
@@ -16,7 +16,7 @@ use Piwik\Tracker\Action;
class ReferrerUrl extends Base
{
protected $columnName = 'referer_url';
- protected $columnType = 'TEXT NULL';
+ protected $columnType = 'VARCHAR(4000) NULL';
protected $type = self::TYPE_TEXT;
protected $segmentName = 'referrerUrl';
protected $nameSingular = 'Live_Referrer_URL';
|
Change column type for referer_url from text to varchar (#<I>)
* Change column type for referer_url from text to varchar
refs <URL>
|
matomo-org_matomo
|
train
|
php
|
617a25432629c5b958a48df490235c4f8e73eaaa
|
diff --git a/core/CronArchive.php b/core/CronArchive.php
index <HASH>..<HASH> 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -981,7 +981,7 @@ class CronArchive
$request = new Request($url);
$request->before(function () use ($self, $url, $idSite, $period, $date) {
if ($self->isAlreadyArchivingUrl($url, $idSite, $period, $date)) {
- return Request::ABORT;
+ return Request::ABORT;
}
});
$urls[] = $request;
@@ -1006,7 +1006,7 @@ class CronArchive
$content = array_key_exists($index, $response) ? $response[$index] : null;
$success = $success && $this->checkResponse($content, $url);
- if ($noSegmentUrl === $url && $success) {
+ if ($noSegmentUrl == $url && $success) {
$stats = @unserialize($content);
if (!is_array($stats)) {
|
Fix test failue: climulti result now returns Request instances not strings.
|
matomo-org_matomo
|
train
|
php
|
6d9f24f69f4c651990b895ba27fe6d3c4ee4ff31
|
diff --git a/gubernator/github/classifier.py b/gubernator/github/classifier.py
index <HASH>..<HASH> 100644
--- a/gubernator/github/classifier.py
+++ b/gubernator/github/classifier.py
@@ -320,12 +320,13 @@ def distill_events(events, distilled_events=None):
relevant to determining user state.
"""
bots = [
+ 'google-oss-robot',
+ 'istio-testing',
'k8s-bot',
'k8s-ci-robot',
'k8s-merge-robot',
'k8s-oncall',
'k8s-reviewable',
- 'istio-testing',
]
skip_comments = get_skip_comments(events, bots)
|
PR dashboard should ignore google-oss-robot comments
|
kubernetes_test-infra
|
train
|
py
|
4fb291ee274fccccf46434ddc58d99e8300e6384
|
diff --git a/lib/acmesmith/authorization_service.rb b/lib/acmesmith/authorization_service.rb
index <HASH>..<HASH> 100644
--- a/lib/acmesmith/authorization_service.rb
+++ b/lib/acmesmith/authorization_service.rb
@@ -69,9 +69,30 @@ module Acmesmith
puts "=> Requesting validations..."
puts
processes.each do |process|
- print " * #{process.domain} (#{process.challenge.challenge_type}) ..."
- process.challenge.request_validation()
- puts " [ ok ]"
+ challenge = process.challenge
+ print " * #{process.domain} (#{challenge.challenge_type}) ..."
+ retried = false
+ begin
+ challenge.request_validation()
+ puts " [ ok ]"
+ rescue Acme::Client::Error::Malformed
+ # Rescue in case of requesting validation for a challenge which has already determined valid (asynchronously while we're receiving it).
+ # LE Boulder doesn't take this as an error, but pebble do.
+ # https://github.com/letsencrypt/boulder/blob/ebba443cad233111ee2b769ef09b32a13c3ba57e/wfe2/wfe.go#L1235
+ # https://github.com/letsencrypt/pebble/blob/b60b0b677c280ccbf63de55a26775591935c448b/wfe/wfe.go#L2166
+ challenge.reload
+ if process.valid?
+ puts " [ ok ] (turned valid in background)"
+ next
+ end
+
+ if retried
+ raise
+ else
+ retried = true
+ retry
+ end
+ end
end
puts
|
Skip requesting validation if it has automatically turned valid
Fix flaky integration test in CI.
|
sorah_acmesmith
|
train
|
rb
|
9f304d1573d809460bb47eb96905a30d504f91fd
|
diff --git a/models.py b/models.py
index <HASH>..<HASH> 100644
--- a/models.py
+++ b/models.py
@@ -65,7 +65,7 @@ from invenio.modules.access.models import \
AccARGUMENT, \
AccAuthorization, \
UserAccROLE
-from invenio.modules.oai_harvest.models import OaiREPOSITORY
+from invenio.modules.oaiharvester.models import OaiREPOSITORY
from invenio.ext.template import render_template_to_string
from invenio.modules.communities.signals import before_save_collection, \
after_save_collection, before_save_collections, after_save_collections, \
@@ -748,4 +748,4 @@ def signalresult2list(extra_colls):
replace = list(set(reduce(sum, map(lambda x: x[1].get('replace',[]) if x[1] else [], extra_colls or [(None, None)]))))
append = list(set(reduce(sum, map(lambda x: x[1].get('append',[]) if x[1] else [], extra_colls or [(None, None)]))))
- return (append, replace)
\ No newline at end of file
+ return (append, replace)
|
oiaharvester: move from oai_harvest
|
inveniosoftware_invenio-communities
|
train
|
py
|
48a047da94e0c9f88320647193145daead826f69
|
diff --git a/src/Stage/hooks.js b/src/Stage/hooks.js
index <HASH>..<HASH> 100644
--- a/src/Stage/hooks.js
+++ b/src/Stage/hooks.js
@@ -114,7 +114,7 @@ export default function createStageFunction() {
useImperativeHandle(ref, () => ({
_app: appRef,
- _canvas: appRef,
+ _canvas: canvasRef,
props: props,
}));
|
Fix reference to canvas element in Stage function component
|
michalochman_react-pixi-fiber
|
train
|
js
|
d1e29bc13eab36360c75c06d8de1ac78b366910d
|
diff --git a/tests/Message/CreateTokenRequestTest.php b/tests/Message/CreateTokenRequestTest.php
index <HASH>..<HASH> 100644
--- a/tests/Message/CreateTokenRequestTest.php
+++ b/tests/Message/CreateTokenRequestTest.php
@@ -9,7 +9,6 @@
namespace Omnipay\Stripe\Message;
-use Omnipay\Common\Exception\InvalidRequestException;
use Omnipay\Tests\TestCase;
class CreateTokenRequestTest extends TestCase
@@ -70,11 +69,12 @@ class CreateTokenRequestTest extends TestCase
$this->setMockHttpResponse('CreateTokenSuccess.txt');
$response = $this->request->send();
+ $data = $response->getData();
$this->assertTrue($response->isSuccessful());
$this->assertFalse($response->isRedirect());
$this->assertNull($response->getTransactionReference());
- $this->assertSame('tok_1AWDl1JqXiFraDuL2xOKEXKy', $response->getData()['id']);
- $this->assertSame('token', $response->getData()['object']);
+ $this->assertSame('tok_1AWDl1JqXiFraDuL2xOKEXKy', $data['id']);
+ $this->assertSame('token', $data['object']);
}
|
Removing access to array by reference (PHP <I> compatibility issue)
|
thephpleague_omnipay-stripe
|
train
|
php
|
500395e82e4a23c9a2f60483a9e34a18d8df1584
|
diff --git a/builder/tmpl.go b/builder/tmpl.go
index <HASH>..<HASH> 100644
--- a/builder/tmpl.go
+++ b/builder/tmpl.go
@@ -1,6 +1,6 @@
package builder
-var tmpl = `// Code generated by github.com/gobuffalo/packr. DO NOT EDIT
+var tmpl = `// Code generated by github.com/gobuffalo/packr. DO NOT EDIT.
package {{.Name}}
|
Comply with standard generated file header (#<I>)
The generated files almost complied with the generated file header, as defined in
<URL>
|
gobuffalo_packr
|
train
|
go
|
8dcdb600d4e69a10e44b922a1b7f80a7e4908b59
|
diff --git a/src/main/java/org/dynjs/exception/ThrowException.java b/src/main/java/org/dynjs/exception/ThrowException.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/dynjs/exception/ThrowException.java
+++ b/src/main/java/org/dynjs/exception/ThrowException.java
@@ -7,6 +7,7 @@ import org.dynjs.runtime.JSObject;
import org.dynjs.runtime.PropertyDescriptor;
import org.dynjs.runtime.StackElement;
import org.dynjs.runtime.StackGetter;
+import org.dynjs.runtime.Types;
public class ThrowException extends DynJSException {
@@ -52,11 +53,11 @@ public class ThrowException extends DynJSException {
if (value instanceof JSObject) {
String errorName = "<unknown>";
if (((JSObject) value).hasProperty(context, "name")) {
- errorName = (String) ((JSObject) value).get(context, "name");
+ errorName = Types.toString(context, ((JSObject) value).get(context, "name"));
}
String message = null;
if (((JSObject) value).hasProperty(context, "message")) {
- message = (String) ((JSObject) value).get(context, "message");
+ message = Types.toString(context, ((JSObject) value).get(context, "message"));
}
final String msg = message;
final String err = errorName;
|
Use Types.toString instead of a Java class cast to extract an exception's name and message.
It's possible for an exception to have a message property, but
for the value to be undefined, which is represented in Java by
Types.UNDEFINED, and doesn't cast directly to (String).
|
dynjs_dynjs
|
train
|
java
|
526e62fe44437883ce9dbaab93d2852edb583a07
|
diff --git a/law/parameter.py b/law/parameter.py
index <HASH>..<HASH> 100644
--- a/law/parameter.py
+++ b/law/parameter.py
@@ -301,6 +301,11 @@ class MultiCSVParameter(CSVParameter):
MULTI_CSV_SEP = ":"
+ def __init__(self, *args, **kwargs):
+ """ __init__(*args, cls=luigi.Parameter, unique=False, min_len=None, max_len=None, **kwargs)
+ """
+ super(MultiCSVParameter, self).__init__(*args, **kwargs)
+
def parse(self, inp):
""""""
if isinstance(inp, (tuple, list)) or is_lazy_iterable(inp):
|
Update MultiCSVParameter signature in docs.
|
riga_law
|
train
|
py
|
9d15bc5e962f6f2021cae19b50065a1780c2a5cb
|
diff --git a/config/csv_migrations.php b/config/csv_migrations.php
index <HASH>..<HASH> 100644
--- a/config/csv_migrations.php
+++ b/config/csv_migrations.php
@@ -1,4 +1,13 @@
<?php
+// get upload limit in bytes
+$uploadLimit = ini_get('upload_max_filesize');
+if (preg_match('/(\d+)K/i', $uploadLimit, $matches)) {
+ $uploadLimit = $matches[1] * 1024;
+} elseif (preg_match('/(\d+)M/i', $uploadLimit, $matches)) {
+ $uploadLimit = $matches[1] * 1024 * 1024;
+} elseif (preg_match('/(\d+)G/i', $uploadLimit, $matches)) {
+ $uploadLimit = $matches[1] * 1024 * 1024 * 1024;
+}
// CsvMigrations plugin configuration
return [
'CsvMigrations' => [
@@ -40,7 +49,8 @@ return [
],
'maxFileCount' => 30,
'fileSizeGetter' => true,
- 'maxFileSize' => 2000,
+ // this should always be set in kilobytes
+ 'maxFileSize' => (int)($uploadLimit / 1024),
],
'initialPreviewConfig' => [
'url' => "/api/file-storages/delete/"
|
Upload file limit
Set default value for upload file limit using `php.ini`
`upload-max-filesize` directive value.
|
QoboLtd_cakephp-csv-migrations
|
train
|
php
|
a85b0a45ab8a9ec82e341d7fb1f5e7a27b59d214
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup
setup(
name='plucky',
- version='0.4.1',
+ version='0.4.2',
description='Plucking (deep) keys/paths safely from python collections has never been easier.',
long_description=open('README.rst').read(),
author='Radomir Stevanovic',
|
release <I>
better iteration support, overall
|
randomir_plucky
|
train
|
py
|
061c32cba6adaf02a0c99e3240c9895f530cc170
|
diff --git a/src/main/java/org/threeten/bp/chrono/JapaneseEra.java b/src/main/java/org/threeten/bp/chrono/JapaneseEra.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/threeten/bp/chrono/JapaneseEra.java
+++ b/src/main/java/org/threeten/bp/chrono/JapaneseEra.java
@@ -286,8 +286,8 @@ public final class JapaneseEra
}
/**
- * Returns the start date of the era.
- * @return the start date
+ * Returns the end date of the era.
+ * @return the end date
*/
LocalDate endDate() {
int ordinal = ordinal(eraValue);
|
Fixed Javadoc for endDate() (was copy-pasta from startDate()).
|
ThreeTen_threetenbp
|
train
|
java
|
5869701941b9af476c44af19cc547e9375aa31ff
|
diff --git a/webpack/strategies/test.js b/webpack/strategies/test.js
index <HASH>..<HASH> 100644
--- a/webpack/strategies/test.js
+++ b/webpack/strategies/test.js
@@ -3,7 +3,7 @@ import _ from 'lodash';
export default (config, options) => {
if (options.test) {
config = _.extend({}, config, {
- devtool: 'inline-source-map',
+ devtool: 'eval',
entry: undefined,
output: {
pathinfo: true
|
Fix sourcemaps in test error stack traces
|
react-bootstrap_react-bootstrap
|
train
|
js
|
2ac1fcc4e9ac39fe1d6f1c7f1403b282653e393a
|
diff --git a/src/V2/Endpoint/Account/AccountEndpoint.php b/src/V2/Endpoint/Account/AccountEndpoint.php
index <HASH>..<HASH> 100644
--- a/src/V2/Endpoint/Account/AccountEndpoint.php
+++ b/src/V2/Endpoint/Account/AccountEndpoint.php
@@ -69,7 +69,7 @@ class AccountEndpoint extends Endpoint implements IAuthenticatedEndpoint {
}
/**
- * Get the account material storage.
+ * Get unlocked minis.
*
* @return MiniEndpoint
*/
|
fix comment block of AccountEndpoint->minis()
|
GW2Treasures_gw2api
|
train
|
php
|
bfd5e4f5efaf559ee1fb304acc49b052fa49d613
|
diff --git a/system_maintenance/tests/unit/test_views.py b/system_maintenance/tests/unit/test_views.py
index <HASH>..<HASH> 100644
--- a/system_maintenance/tests/unit/test_views.py
+++ b/system_maintenance/tests/unit/test_views.py
@@ -40,12 +40,7 @@ class CommonViewTests:
Test that a given URL resolves to the correct view.
"""
found = resolve(self.url)
-
- if django.VERSION < (1, 8):
- found_name = found.func.func_name
- else:
- found_name = found.func.__name__
-
+ found_name = found.func.__name__
self.assertEqual(found_name, getattr(self.view, '__name__', None))
def test_view_returns_correct_title(self):
|
Use the same method to test view name in Django <I> - <I>
|
mfcovington_django-system-maintenance
|
train
|
py
|
0c3f70f528bfcae25dc7084a5b71123e5470ad8a
|
diff --git a/lib/friendly_id/history.rb b/lib/friendly_id/history.rb
index <HASH>..<HASH> 100644
--- a/lib/friendly_id/history.rb
+++ b/lib/friendly_id/history.rb
@@ -95,7 +95,7 @@ method.
end
def slug_table_record(id)
- select(quoted_table_name + '.*').joins(:slugs).where(slug_history_clause(id)).order(Slug.arel_table[:created_at].desc).first
+ select(quoted_table_name + '.*').joins(:slugs).where(slug_history_clause(id)).order(Slug.arel_table[:id].desc).first
end
def slug_history_clause(id)
|
change sort to use ID, since it is guaranteed unique where created_at is not and we are looking for a single unique record
|
norman_friendly_id
|
train
|
rb
|
dc96e3e780358550d997e689bc695cbe19f79996
|
diff --git a/gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java b/gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java
index <HASH>..<HASH> 100644
--- a/gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java
+++ b/gobblin-modules/gobblin-kafka-08/src/main/java/org/apache/gobblin/metrics/kafka/KafkaKeyValueProducerPusher.java
@@ -59,6 +59,8 @@ public class KafkaKeyValueProducerPusher<K, V> implements Pusher<Pair<K, V>> {
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName());
props.put(ProducerConfig.ACKS_CONFIG, "all");
props.put(ProducerConfig.RETRIES_CONFIG, 3);
+ //To guarantee ordered delivery, the maximum in flight requests must be set to 1.
+ props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, 1);
// add the kafka scoped config. if any of the above are specified then they are overridden
if (kafkaConfig.isPresent()) {
|
[GOBBLIN-<I>][GOBBLIN-<I>] Ensure ordered delivery of Kafka events from KeyValueProducerPusher for kafka-<I>.[]
Closes #<I> from s<I>/kafkaOrderedRedux
|
apache_incubator-gobblin
|
train
|
java
|
5ed2742f646738bfe52eb64d4b85e18e8c3d4f82
|
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js b/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js
@@ -1138,9 +1138,11 @@ define([
return;
}
+ var settings = this._editorView.getSettings();
this._scrollPreviewAnimation = new mTextUtil.Animation({
window: window,
curve: [pixelY, 0],
+ duration: settings.scrollAnimation ? settings.scrollAnimationTimeout : 0,
onAnimate: function(x) {
var deltaY = pixelY - Math.floor(x);
this._previewWrapperDiv.scrollTop += deltaY;
@@ -1168,9 +1170,11 @@ define([
return;
}
+ var settings = this._editorView.getSettings();
this._scrollSourceAnimation = new mTextUtil.Animation({
window: window,
curve: [pixelY, 0],
+ duration: settings.scrollAnimation ? settings.scrollAnimationTimeout : 0,
onAnimate: function(x) {
var deltaY = pixelY - Math.floor(x);
textView.setTopPixel(textView.getTopPixel() + deltaY);
|
respect editor scroll animation settings when syncing panes in markdown editor
|
eclipse_orion.client
|
train
|
js
|
b2540fe5297c65ba93b6f9cf18f0051ec1ceffdf
|
diff --git a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
index <HASH>..<HASH> 100644
--- a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
+++ b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/EloquentPageRepository.php
@@ -963,7 +963,7 @@ class EloquentPageRepository implements PageRepositoryInterface {
$this->urls->delete('page', $page->id);
$page->delete();
- $this->logHistory('deleted', $page->id);
+ $this->logHistory('deleted', $page->id, ['page_name' => $page->name]);
}
else
{
|
Log the page name as part of the delete action, so we have a rough indication of the page which was removed.
|
CoandaCMS_coanda-core
|
train
|
php
|
c554297a0f46aa892488050a24eba168483849a9
|
diff --git a/test/high_availability/ha_tools.py b/test/high_availability/ha_tools.py
index <HASH>..<HASH> 100644
--- a/test/high_availability/ha_tools.py
+++ b/test/high_availability/ha_tools.py
@@ -114,8 +114,7 @@ def start_replica_set(members, auth=False, fresh=True):
try:
os.makedirs(dbpath)
- except OSError:
- exc = sys.exc_info()[1]
+ except OSError as exc:
print(exc)
print("\tWhile creating %s" % (dbpath,))
@@ -167,10 +166,9 @@ def start_replica_set(members, auth=False, fresh=True):
print('rs.initiate(%s)' % (config,))
c.admin.command('replSetInitiate', config)
- except pymongo.errors.OperationFailure:
+ except pymongo.errors.OperationFailure as exc:
# Already initialized from a previous run?
if ha_tools_debug:
- exc = sys.exc_info()[1]
print(exc)
expected_arbiters = 0
|
Modern exception-handling syntax in ha_tools.
Now that we've dropped support for Python <I>.
|
mongodb_mongo-python-driver
|
train
|
py
|
0704a4299e69f8b07a43b0e804b4fd71165a9e94
|
diff --git a/lib/tco/palette.rb b/lib/tco/palette.rb
index <HASH>..<HASH> 100644
--- a/lib/tco/palette.rb
+++ b/lib/tco/palette.rb
@@ -21,7 +21,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-
module Tco
class Colour
attr_reader :rgb, :lab
@@ -254,6 +253,8 @@ module Tco
def initialize(type)
set_type type
+ @cache = {}
+
# ANSI colours (the first 16) are configurable by users in most
# terminals. The palette bellow contains the definitions for xterm,
# which can be quite different from the colours of your terminal.
@@ -543,9 +544,18 @@ module Tco
when "ansi" then @palette[0,8]
end
- # TODO: This is too simple ... optimize (add caching?)
- distances = colours.map { |c| c - colour }
- distances.each_with_index.min[1]
+ if @cache.has_key? colour.to_s
+ @cache[colour.to_s]
+ else
+ distances = colours.map { |c| c - colour }
+ colour_index = distances.each_with_index.min[1]
+
+ # TODO: No cache eviction is currently in place
+ # It's not that much of a problem, because in many cases,
+ # applications don't use milions of different colours.
+ @cache[colour.to_s] = colour_index
+ colour_index
+ end
end
def colours
|
palette: Adding simple caching
Simple caching like this speeds up the processing quite a bit when
colouring lots of things at the same time.
|
pazdera_tco
|
train
|
rb
|
ae8fda89630f32cb36a98831b377e0e0d575648c
|
diff --git a/lib/svtplay_dl/output.py b/lib/svtplay_dl/output.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/output.py
+++ b/lib/svtplay_dl/output.py
@@ -114,13 +114,7 @@ def progressbar(total, pos, msg=""):
"""
width = 50 # TODO hardcoded progressbar width
rel_pos = int(float(pos)/total*width)
- bar = str()
-
- # FIXME ugly generation of bar
- for _ in range(0, rel_pos):
- bar += "="
- for _ in range(rel_pos, width):
- bar += "."
+ bar = ''.join(["=" * rel_pos, "." * (width - rel_pos)])
# Determine how many digits in total (base 10)
digits_total = len(str(total))
|
svtplay_dl.output: prettier progressbar generation
|
spaam_svtplay-dl
|
train
|
py
|
acd212a18dbfe61d608d2bd7b998ba321923451f
|
diff --git a/src/Form/FormCustom.js b/src/Form/FormCustom.js
index <HASH>..<HASH> 100644
--- a/src/Form/FormCustom.js
+++ b/src/Form/FormCustom.js
@@ -21,6 +21,7 @@ class FormCustom extends React.Component {// eslint-disable-line react/prefer-st
id: PropTypes.string,
name: PropTypes.string,
}),
+ defaultChecked: PropTypes.bool,
}
render() {
@@ -29,6 +30,7 @@ class FormCustom extends React.Component {// eslint-disable-line react/prefer-st
cssModule,
radio,
children,
+ defaultChecked,
...attributes
} = this.props;
@@ -39,9 +41,9 @@ class FormCustom extends React.Component {// eslint-disable-line react/prefer-st
), cssModule);
const CustomInput = radio ? (
- <Input type="radio" id={radio.id} name={radio.name} className="custom-control-input" />
+ <Input defaultChecked={defaultChecked} type="radio" id={radio.id} name={radio.name} className="custom-control-input" />
) : (
- <Input type="checkbox" className="custom-control-input" />
+ <Input defaultChecked={defaultChecked} type="checkbox" className="custom-control-input" />
);
return (
<Label className={classes} {...attributes}>
|
Update FormCustom component, defaultChecked props added
|
bootstrap-styled_v4
|
train
|
js
|
695b62ccd3c127d4370ff929159c7c44a90bf2fd
|
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -417,7 +417,6 @@ class BotBase(GroupMixin):
for name, member in members:
# register commands the cog has
if isinstance(member, Command):
- member.instance = cog
if member.parent is None:
self.add_command(member)
continue
@@ -465,7 +464,6 @@ class BotBase(GroupMixin):
for name, member in members:
# remove commands the cog has
if isinstance(member, Command):
- member.instance = None
if member.parent is None:
self.remove_command(member.name)
continue
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -160,6 +160,11 @@ class Command:
finally:
ctx.bot.dispatch('command_error', error, ctx)
+ def __get__(self, instance, owner):
+ if instance is not None:
+ self.instance = instance
+ return self
+
@asyncio.coroutine
def do_conversion(self, ctx, converter, argument):
if converter is bool:
|
[commands] Make Command a descriptor for #<I>.
|
Rapptz_discord.py
|
train
|
py,py
|
f4d615eea030bdc493088de4eec953e16fb8b79a
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ else:
deps.append('readline')
setup(
- name='yowsup2',
+ name='yowsup',
version=yowsup.__version__,
url='http://github.com/tgalal/yowsup/',
license='GPL-3+',
@@ -30,7 +30,7 @@ setup(
scripts = ['yowsup-cli'],
#cmdclass={'test': PyTest},
author_email='[email protected]',
- description='A WhatsApp python library',
+ description='The WhatsApp lib',
#long_description=long_description,
packages= find_packages(),
include_package_data=True,
|
[meta] update package name to yowsup
Was yowsup2, and updated package description
|
tgalal_yowsup
|
train
|
py
|
45d56e07c7ca861d4cdf9ca6bf576fd1c8b63422
|
diff --git a/Symfony/CS/Fixer/Symfony/PhpdocParamsFixer.php b/Symfony/CS/Fixer/Symfony/PhpdocParamsFixer.php
index <HASH>..<HASH> 100644
--- a/Symfony/CS/Fixer/Symfony/PhpdocParamsFixer.php
+++ b/Symfony/CS/Fixer/Symfony/PhpdocParamsFixer.php
@@ -44,11 +44,7 @@ class PhpdocParamsFixer extends AbstractFixer
{
$tokens = Tokens::fromCode($content);
- foreach ($tokens as $index => $token) {
- if (!$token->isGivenKind(T_DOC_COMMENT)) {
- continue;
- }
-
+ foreach ($tokens->findGivenKind(T_DOC_COMMENT) as $index => $token) {
$tokens[$index]->setContent($this->fixDocBlock($token->getContent()));
}
@@ -67,7 +63,7 @@ class PhpdocParamsFixer extends AbstractFixer
{
$lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $content));
- for ($i = 0, $l = count($lines); $i < $l; $i++) {
+ for ($i = 0, $l = count($lines); $i < $l; ++$i) {
$items = array();
if ($matches = $this->getMatches($lines[$i])) {
|
Minor improvements to the phpdoc_params fixer
|
FriendsOfPHP_PHP-CS-Fixer
|
train
|
php
|
bea2fea10dad7d2eb29a2e66b44c3588f2e5adff
|
diff --git a/src/Theme.php b/src/Theme.php
index <HASH>..<HASH> 100644
--- a/src/Theme.php
+++ b/src/Theme.php
@@ -24,6 +24,12 @@ class Theme extends \yii\base\Theme
const SKIN_BLUE_LIGHT = 'skin-blue-light';
const SKIN_GREEN = 'skin-green';
const SKIN_GREEN_LIGHT = 'skin-green-light';
+ const SKIN_YELLOW = 'skin-yellow';
+ const SKIN_YELLOW_LIGHT = 'skin-yellow-light';
+ const SKIN_RED = 'skin-red';
+ const SKIN_RED_LIGHT = 'skin-red-light';
+ const SKIN_PURPLE = 'skin-purple';
+ const SKIN_PURPLE_LIGHT = 'skin-purple-light';
/**
* @var string
|
Adding remaining skins (yellow,red,purple)
|
webtoolsnz_yii2-admin-lte
|
train
|
php
|
55079e92fe33dfc35000e9a7709e4f2f6522f357
|
diff --git a/src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php b/src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php
index <HASH>..<HASH> 100644
--- a/src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php
+++ b/src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php
@@ -266,6 +266,10 @@ class UnionTypeComparator
?Type\Union $input_type,
Type\Union $container_type
): bool {
+ if ($container_type->isMixed()) {
+ return true;
+ }
+
if (!$input_type) {
return false;
}
diff --git a/tests/MethodSignatureTest.php b/tests/MethodSignatureTest.php
index <HASH>..<HASH> 100644
--- a/tests/MethodSignatureTest.php
+++ b/tests/MethodSignatureTest.php
@@ -937,6 +937,22 @@ class MethodSignatureTest extends TestCase
use MyTrait;
}'
],
+ 'MixedParamInImplementation' => [
+ '<?php
+ interface I
+ {
+ /**
+ * @param mixed $a
+ */
+ public function a($a): void;
+ }
+
+
+ final class B implements I
+ {
+ public function a(mixed $a): void {}
+ }'
+ ],
];
}
|
Mixed contains everything (#<I>)
|
vimeo_psalm
|
train
|
php,php
|
93eb26ddc6400eb21700e55f15cf62fc1c5c8879
|
diff --git a/ricecooker/classes/nodes.py b/ricecooker/classes/nodes.py
index <HASH>..<HASH> 100644
--- a/ricecooker/classes/nodes.py
+++ b/ricecooker/classes/nodes.py
@@ -100,6 +100,7 @@ class Node(object):
def has_thumbnail(self):
from .files import ThumbnailFile
return any(f for f in self.files if isinstance(f, ThumbnailFile))
+ # TODO deep check: f.process_file() and check f.filename is not None
def set_thumbnail(self, thumbnail):
""" set_thumbnail: Set node's thumbnail
diff --git a/ricecooker/managers/tree.py b/ricecooker/managers/tree.py
index <HASH>..<HASH> 100644
--- a/ricecooker/managers/tree.py
+++ b/ricecooker/managers/tree.py
@@ -188,6 +188,7 @@ class ChannelManager:
Returns: link to uploadedchannel
"""
config.LOGGER.info(" Creating channel {0}".format(self.channel.title))
+ self.channel.truncate_fields()
payload = {
"channel_data":self.channel.to_dict(),
}
|
Fix for description length issue #<I>
|
learningequality_ricecooker
|
train
|
py,py
|
627af9d03b9e909951d29eeb4d6d2801867d5e3f
|
diff --git a/andes/core/discrete.py b/andes/core/discrete.py
index <HASH>..<HASH> 100644
--- a/andes/core/discrete.py
+++ b/andes/core/discrete.py
@@ -58,6 +58,23 @@ class Discrete(object):
return [f'{self.name}_{flag}' for flag in self.export_flags]
def get_tex_names(self):
+ """
+ Return tex_names of exported flags.
+
+ TODO: Fix the bug described in the warning below.
+
+ Warnings
+ --------
+ If underscore `_` appears in both flag tex_name and `self.tex_name` (for example, when this discrete is
+ within a block), the exported tex_name will become invalid for SymPy.
+ Variable name substitution will fail.
+
+ Returns
+ -------
+ list
+ A list of tex_names for all exported flags.
+ """
+
return [rf'{flag_tex}^{self.tex_name}' for flag_tex in self.export_flags_tex]
def get_values(self):
|
Described a bug for discrete tex_name when the discrete is used within a block.
|
cuihantao_andes
|
train
|
py
|
b03cbfad1fdc75f47479d26d19b8a6085ffb3e8d
|
diff --git a/gns3converter/converter.py b/gns3converter/converter.py
index <HASH>..<HASH> 100644
--- a/gns3converter/converter.py
+++ b/gns3converter/converter.py
@@ -305,7 +305,7 @@ class Converter():
self.links.append(self.calc_link(
tmp_node.node_temp['id'],
port_def['id'],
- tmp_node.node_temp['ports']['name'],
+ port_def['name'],
device,
destination))
elif item == 'cnfg':
|
Get the port name from the port_def instead of node structure
|
dlintott_gns3-converter
|
train
|
py
|
3d21a07c6cf9e7d8c5c43a00a1a07a5b44998792
|
diff --git a/src/server/queue/index.js b/src/server/queue/index.js
index <HASH>..<HASH> 100644
--- a/src/server/queue/index.js
+++ b/src/server/queue/index.js
@@ -38,26 +38,24 @@ class Queues {
const isBee = type === 'bee';
+ const options = {
+ redis: redis || url || redisHost
+ };
+ if (prefix) options.prefix = prefix;
+
let queue;
if (isBee) {
- const options = {
- redis: redis || url || redisHost,
+ _.extend(options, {
isWorker: false,
getEvents: false,
sendEvents: false,
storeJobs: false
- };
- if (prefix) options.prefix = prefix;
+ });
queue = new Bee(name, options);
queue.IS_BEE = true;
} else {
- const options = {
- redis: redis || redisHost
- };
- if (prefix) options.prefix = prefix;
-
- queue = new Bull(name, options || url);
+ queue = new Bull(name, options);
}
this._queues[queueHost] = this._queues[queueHost] || {};
|
Fix Bull queue construction so the url option is respected.
|
bee-queue_arena
|
train
|
js
|
5acb3f301fcb85b9b8a3feab89c1ff52ed3eb57e
|
diff --git a/src/main-node.js b/src/main-node.js
index <HASH>..<HASH> 100644
--- a/src/main-node.js
+++ b/src/main-node.js
@@ -14,7 +14,6 @@ module.exports = {
Register : require('./Register'),
Request : require('./Request'),
Response : require('./Response'),
- Sequence : require('./Sequence'),
Server : require('./Server'),
SocketServer : require('./SocketServer'),
Stream : require('./Stream'),
|
Removing Sequence.js to move to godsend-basics.
|
simplygreatwork_godsend
|
train
|
js
|
897b6561f137a965f435f8466591781339f96af9
|
diff --git a/generators/newapp/new.go b/generators/newapp/new.go
index <HASH>..<HASH> 100644
--- a/generators/newapp/new.go
+++ b/generators/newapp/new.go
@@ -146,21 +146,21 @@ services:
{{ end -}}
before_script:
- {{ if eq .dbType "postgres" -}}
- - psql -c 'create database {{.name}}_test;' -U postgres
- {{ end -}}
- - mkdir -p $TRAVIS_BUILD_DIR/public/assets
+{{ if eq .dbType "postgres" -}}
+ - psql -c 'create database {{.name}}_test;' -U postgres
+{{ end -}}
+ - mkdir -p $TRAVIS_BUILD_DIR/public/assets
go_import_path: {{.packagePath}}
install:
- go get github.com/gobuffalo/buffalo/buffalo
- {{ if .withDep -}}
+{{ if .withDep -}}
- go get github.com/golang/dep/cmd/dep
- dep ensure
- {{ else -}}
- - go get $(go list ./... | grep -v /vendor/)
- {{ end -}}
+{{ else -}}
+ - go get $(go list ./... | grep -v /vendor/)
+{{ end -}}
script: buffalo test
`
|
fix: remove mixed tabs and spaces from .travis.yml template
Travis CI builds for new projects fail because of tabs in the generated .travis.yml file
|
gobuffalo_buffalo
|
train
|
go
|
d5c617f0fe6f1d717a30e0d392279aa5dffd0a62
|
diff --git a/lark/parse_tree_builder.py b/lark/parse_tree_builder.py
index <HASH>..<HASH> 100644
--- a/lark/parse_tree_builder.py
+++ b/lark/parse_tree_builder.py
@@ -61,7 +61,10 @@ class ChildFilter:
filtered = []
for i, to_expand in self.to_include:
if to_expand:
- filtered += children[i].children
+ if filtered:
+ filtered += children[i].children
+ else: # Optimize for left-recursion
+ filtered = children[i].children
else:
filtered.append(children[i])
diff --git a/lark/tree.py b/lark/tree.py
index <HASH>..<HASH> 100644
--- a/lark/tree.py
+++ b/lark/tree.py
@@ -11,7 +11,7 @@ from .utils import inline_args
class Tree(object):
def __init__(self, data, children):
self.data = data
- self.children = list(children)
+ self.children = children
def __repr__(self):
return 'Tree(%s, %s)' % (self.data, self.children)
|
BUGFIX: Non-linearity in tree construction, causing performance issues for large inputs (Issue #<I>)
|
lark-parser_lark
|
train
|
py,py
|
ace2894f4694f78e425a1c1a1bd36e9b45c0f79f
|
diff --git a/lib/Widget/Db.php b/lib/Widget/Db.php
index <HASH>..<HASH> 100644
--- a/lib/Widget/Db.php
+++ b/lib/Widget/Db.php
@@ -254,6 +254,7 @@ class Db extends Base
if (!$this->pdo) {
$this->beforeConnect && call_user_func($this->beforeConnect, $this);
+ $dsn = $this->getDsn();
$attrs = $this->attrs + array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_STRINGIFY_FETCHES => true,
@@ -261,7 +262,6 @@ class Db extends Base
);
try {
- $dsn = $this->getDsn();
$this->pdo = new PDO($dsn, $this->user, $this->password, $attrs);
} catch (\PDOException $e) {
$this->connectFails && call_user_func($this->connectFails, $this, $e);
|
move getDsn out of try catch block
|
twinh_wei
|
train
|
php
|
63ef88560fa134df3b36ed33de30073fff626966
|
diff --git a/graphite_metrics/collectors/iptables_counts.py b/graphite_metrics/collectors/iptables_counts.py
index <HASH>..<HASH> 100644
--- a/graphite_metrics/collectors/iptables_counts.py
+++ b/graphite_metrics/collectors/iptables_counts.py
@@ -99,7 +99,7 @@ class IPTables(Collector):
log.warn(
( 'Detected changed netfilter rule (chain: {}, pos: {})'
' without corresponding rule_metrics file update: {}' )\
- .format(chain, chain_counts[chain], ' '.join(rule)) )
+ .format(chain, chain_counts[chain], rule) )
warnings[chain_counts[chain]] = True
if self.conf.discard_changed_rules: continue
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ pkg_root = os.path.dirname(__file__)
setup(
name = 'graphite-metrics',
- version = '12.04.22',
+ version = '12.04.23',
author = 'Mike Kazantsev',
author_email = '[email protected]',
license = 'WTFPL',
|
collectors.iptables_counts: fixed rule dump on metrics/tables disparity
|
mk-fg_graphite-metrics
|
train
|
py,py
|
899c56f6ada26821e8af12d9f35fa039100e838e
|
diff --git a/src/event.js b/src/event.js
index <HASH>..<HASH> 100644
--- a/src/event.js
+++ b/src/event.js
@@ -616,6 +616,7 @@ jQuery.each( {
shiftKey: true,
view: true,
"char": true,
+ code: true,
charCode: true,
key: true,
keyCode: true,
|
Event: Add "code" property to Event object
Fixes gh-<I>
Closes gh-<I>
|
jquery_jquery
|
train
|
js
|
ad527b1ccad815f5546345bb5f7f486843eca534
|
diff --git a/homie/property.py b/homie/property.py
index <HASH>..<HASH> 100644
--- a/homie/property.py
+++ b/homie/property.py
@@ -62,6 +62,9 @@ class BaseProperty:
)
def publish(self):
+ if self._value is None:
+ return
+
asyncio.create_task(
self.node.device.publish(
self.topic,
|
Do not publish property value if value is None
|
microhomie_microhomie
|
train
|
py
|
89933d210cc4f8d71e20e195cc40fb65f0a76188
|
diff --git a/route_wb_test.go b/route_wb_test.go
index <HASH>..<HASH> 100644
--- a/route_wb_test.go
+++ b/route_wb_test.go
@@ -1,10 +1,10 @@
package route
import (
- "testing"
"net/http"
"net/http/httptest"
"net/url"
+ "testing"
)
func TestRegisterHandlerWithStaticRoute(t *testing.T) {
diff --git a/router.go b/router.go
index <HASH>..<HASH> 100644
--- a/router.go
+++ b/router.go
@@ -1,9 +1,9 @@
package route
import (
+ "errors"
"net/http"
"strings"
- "errors"
)
type node struct {
|
go fmt on route_wb_test.go
|
jeromedoucet_route
|
train
|
go,go
|
b3e16880741144e9d14e8a82694a0baec9c3a053
|
diff --git a/urbansim/models/yamlmodelrunner.py b/urbansim/models/yamlmodelrunner.py
index <HASH>..<HASH> 100644
--- a/urbansim/models/yamlmodelrunner.py
+++ b/urbansim/models/yamlmodelrunner.py
@@ -161,7 +161,11 @@ def lcm_simulate(choosers, locations, cfgname, outdf, output_fname):
"""
print "Running location choice model simulation\n"
cfg = misc.config(cfgname)
- lcm = MNLLocationChoiceModel.from_yaml(str_or_buffer=cfg)
+ model_type = yaml.load(open(cfg))["model_type"]
+ if model_type == "locationchoice":
+ lcm = MNLLocationChoiceModel.from_yaml(str_or_buffer=cfg)
+ elif model_type == "segmented_locationchoice":
+ lcm = SegmentedMNLLocationChoiceModel.from_yaml(str_or_buffer=cfg)
movers = choosers[choosers[output_fname].isnull()]
new_units = lcm.predict(movers, locations)
print "Assigned %d choosers to new units" % len(new_units.index)
|
update lcm_simulate in yamlmodelrunner
|
UDST_urbansim
|
train
|
py
|
37f4f5d4e07bff016349f0a2019e3d8e59962389
|
diff --git a/lib/classes/API/V1/adapter.class.php b/lib/classes/API/V1/adapter.class.php
index <HASH>..<HASH> 100644
--- a/lib/classes/API/V1/adapter.class.php
+++ b/lib/classes/API/V1/adapter.class.php
@@ -1877,7 +1877,7 @@ class API_V1_adapter extends API_V1_Abstract
* @param \Entities\Basket $basket
* @return array
*/
- protected function list_basket(\Entities\Basket $basket)
+ public function list_basket(\Entities\Basket $basket)
{
$ret = array(
'basket_id' => $basket->getId(),
|
Change list_basket visibility to public
|
alchemy-fr_Phraseanet
|
train
|
php
|
90e36fd99a38c931ed6c89b6fc8157f8cfe3e4cc
|
diff --git a/lib/rubocop/result_cache.rb b/lib/rubocop/result_cache.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/result_cache.rb
+++ b/lib/rubocop/result_cache.rb
@@ -33,14 +33,20 @@ module RuboCop
puts "Removing the #{remove_count} oldest files from #{cache_root}"
end
sorted = files.sort_by { |path| File.mtime(path) }
- begin
- File.delete(*sorted[0, remove_count])
- dirs.each { |dir| Dir.rmdir(dir) if Dir["#{dir}/*"].empty? }
- rescue Errno::ENOENT
- # This can happen if parallel RuboCop invocations try to remove the
- # same files. No problem.
- puts $ERROR_INFO if verbose
- end
+ remove_files(sorted, dirs, remove_count, verbose)
+ end
+ end
+
+ class << self
+ private
+
+ def remove_files(files, dirs, remove_count, verbose)
+ File.delete(*files[0, remove_count])
+ dirs.each { |dir| Dir.rmdir(dir) if Dir["#{dir}/*"].empty? }
+ rescue Errno::ENOENT
+ # This can happen if parallel RuboCop invocations try to remove the
+ # same files. No problem.
+ puts $ERROR_INFO if verbose
end
end
|
Reduce complexity in ResultCache
Extract `.remove_files` from `.cleanup`.
|
rubocop-hq_rubocop
|
train
|
rb
|
44abbb9538e20b787e0ee982e65c12947197dba1
|
diff --git a/lib/blue_state_digital/constituent.rb b/lib/blue_state_digital/constituent.rb
index <HASH>..<HASH> 100644
--- a/lib/blue_state_digital/constituent.rb
+++ b/lib/blue_state_digital/constituent.rb
@@ -72,8 +72,8 @@ module BlueStateDigital
end
def build_constituent_phone(phone, cons)
- cons.to_hash.cons_phone do |cons_phone|
- phone.each do |key, value|
+ cons.cons_phone do |cons_phone|
+ phone.to_hash.each do |key, value|
eval("cons_phone.#{key}('#{value}')") unless value.blank?
end
end
@@ -81,7 +81,7 @@ module BlueStateDigital
def build_constituent_address(address, cons)
cons.to_hash.cons_addr do |cons_addr|
- address.each do |key, value|
+ address.to_hash.each do |key, value|
eval("cons_addr.#{key}('#{value}')") unless value.blank?
end
end
|
Fixed problem with to_xml for addresses
|
controlshift_blue_state_digital
|
train
|
rb
|
1951a4eb31bae506361c627cca40409deee80706
|
diff --git a/FloatingGroupExpandableListView/src/com/diegocarloslima/fgelv/lib/WrapperExpandableListAdapter.java b/FloatingGroupExpandableListView/src/com/diegocarloslima/fgelv/lib/WrapperExpandableListAdapter.java
index <HASH>..<HASH> 100644
--- a/FloatingGroupExpandableListView/src/com/diegocarloslima/fgelv/lib/WrapperExpandableListAdapter.java
+++ b/FloatingGroupExpandableListView/src/com/diegocarloslima/fgelv/lib/WrapperExpandableListAdapter.java
@@ -15,6 +15,10 @@ public class WrapperExpandableListAdapter extends BaseExpandableListAdapter {
mWrappedAdapter = adapter;
}
+ public BaseExpandableListAdapter getWrappedAdapter() {
+ return mWrappedAdapter;
+ }
+
@Override
public void registerDataSetObserver(DataSetObserver observer) {
mWrappedAdapter.registerDataSetObserver(observer);
|
Adding getter for wrapped adapter
|
diegocarloslima_FloatingGroupExpandableListView
|
train
|
java
|
67d85ec6323856709f9f33bcf8af469b9eb57020
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ setup(
"eth-utils>=0.7.1,<1.0.0",
"lru-dict>=1.1.6,<2.0.0",
"pysha3>=1.0.0,<2.0.0",
- "requests>=2.12.4,<3.0.0",
+ "requests>=2.16.0,<3.0.0",
"rlp>=0.4.7,<1.0.0",
"eth-tester>=0.1.0b11,<0.2.0",
],
|
Fix requests version of install_requires
fix to requests>=<I>,<<I> for solve dependency of idna
-----------------------------------
add idna package on install_requires,
to solve occur No module error on macOS high sierra, Python <I>
|
ethereum_web3.py
|
train
|
py
|
5d9899f36d9e70ff15f7e8f61e8064ee39792ff9
|
diff --git a/app/lib/Repository.php b/app/lib/Repository.php
index <HASH>..<HASH> 100755
--- a/app/lib/Repository.php
+++ b/app/lib/Repository.php
@@ -85,10 +85,14 @@ class Repository extends EntityRepository
}
if (isset($sort)) {
- if (!is_array($sort)) {
- $sort = [$sort, 'ASC'];
+ if ($sort == 'random') {
+ $query->addSelect('RAND() AS HIDDEN rand')->orderBy('rand');
+ } else {
+ if (!is_array($sort)) {
+ $sort = [$sort, 'ASC'];
+ }
+ $query->orderBy("{$this->_alias}.{$sort[0]}", $sort[1]);
}
- $query->orderBy("{$this->_alias}.{$sort[0]}", $sort[1]);
} else if (isset($criteria['ids'])) {
$query
->addSelect("FIELD({$this->_alias}.id, :ids) AS HIDDEN sort")
|
Support random sorting in repository query.
|
jacksleight_chalk
|
train
|
php
|
204d756353048b04fe84db9e8c23a6211dee2b93
|
diff --git a/freezegun/api.py b/freezegun/api.py
index <HASH>..<HASH> 100644
--- a/freezegun/api.py
+++ b/freezegun/api.py
@@ -25,7 +25,7 @@ class FakeTime(object):
def __call__(self):
shifted_time = self.time_to_freeze - datetime.timedelta(seconds=time.timezone)
- return time.mktime(shifted_time.timetuple())
+ return time.mktime(shifted_time.timetuple()) + shifted_time.microsecond / 1000000.0
class FakeDateMeta(type):
diff --git a/tests/test_datetimes.py b/tests/test_datetimes.py
index <HASH>..<HASH> 100644
--- a/tests/test_datetimes.py
+++ b/tests/test_datetimes.py
@@ -107,6 +107,12 @@ def test_tz_offset_with_time():
freezer.stop()
+def test_time_with_microseconds():
+ freezer = freeze_time(datetime.datetime(1970, 1, 1, 0, 0, 1, 123456))
+ freezer.start()
+ assert time.time() == 1.123456
+ freezer.stop()
+
def test_bad_time_argument():
try:
freeze_time("2012-13-14", tz_offset=-4)
|
Add fix for time.time() microseconds.
|
spulec_freezegun
|
train
|
py,py
|
5f8121abae6bf2adee2e634b5760eb523854cf13
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -48,8 +48,7 @@ setup(name='cwltool',
'rdflib >= 4.2.0, < 4.3.0',
'shellescape >= 3.4.1, < 3.5',
'schema-salad >= 2.2.20170111180227, < 3',
- 'typing >= 3.5.2, < 3.6',
- 'cwltest >= 1.0.20161227194859'
+ 'typing >= 3.5.2, < 3.6'
],
test_suite='tests',
tests_require=[],
|
cwltest is not required, don't depend on it
|
common-workflow-language_cwltool
|
train
|
py
|
467b916627badf8f6d7ac8855e8135bd10602164
|
diff --git a/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java b/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
index <HASH>..<HASH> 100755
--- a/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
+++ b/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
@@ -141,7 +141,7 @@ public abstract class SharedTreeModel<M extends SharedTreeModel<M,P,O>, P extend
// Override in subclasses to provide some top-level model-specific goodness
@Override protected boolean toJavaCheckTooBig() {
// If the number of leaves in a forest is more than N, don't try to render it in the browser as POJO code.
- return _output==null || _output._treeStats._num_trees * _output._treeStats._mean_leaves > 5000;
+ return _output==null || _output._treeStats._num_trees * _output._treeStats._mean_leaves > 1000000;
}
protected boolean binomialOpt() { return false; }
@Override protected SB toJavaInit(SB sb, SB fileContext) {
|
Increase limit for Tree model POJO preview.
|
h2oai_h2o-3
|
train
|
java
|
21e39ca98423780f0841524095b9fd57345d68dd
|
diff --git a/tests/RouterTest.php b/tests/RouterTest.php
index <HASH>..<HASH> 100644
--- a/tests/RouterTest.php
+++ b/tests/RouterTest.php
@@ -178,7 +178,7 @@ final class RouterTest extends TestCase
$this->assertContains(
'Response from services method',
- $router::dispatch()
+ $router->dispatch()
);
}
@@ -191,7 +191,7 @@ final class RouterTest extends TestCase
$_SERVER['REQUEST_URI'] = 'unknown';
- $this->assertFalse($router::dispatch());
+ $this->assertFalse($router->dispatch());
}
/**
|
Updated to <I> version
|
Josantonius_PHP-Router
|
train
|
php
|
1415c12c5a90f553f55a31d8a07b58c7e2adfa2c
|
diff --git a/framework/base/View.php b/framework/base/View.php
index <HASH>..<HASH> 100644
--- a/framework/base/View.php
+++ b/framework/base/View.php
@@ -72,23 +72,21 @@ class View extends Component
/**
* @var array a list of available renderers indexed by their corresponding supported file extensions.
* Each renderer may be a view renderer object or the configuration for creating the renderer object.
- * For example,
- *
- * ~~~
- * array(
- * 'tpl' => array(
- * 'class' => 'yii\renderers\SmartyRenderer',
- * ),
- * 'twig' => array(
- * 'class' => 'yii\renderers\TwigRenderer',
- * ),
- * )
- * ~~~
+ * The default setting supports both Smarty and Twig (their corresponding file extension is "tpl"
+ * and "twig" respectively. Please refer to [[SmartyRenderer]] and [[TwigRenderer]] on how to install
+ * the needed libraries for these template engines.
*
* If no renderer is available for the given view file, the view file will be treated as a normal PHP
* and rendered via [[renderPhpFile()]].
*/
- public $renderers = array();
+ public $renderers = array(
+ 'tpl' => array(
+ 'class' => 'yii\renderers\SmartyRenderer',
+ ),
+ 'twig' => array(
+ 'class' => 'yii\renderers\TwigRenderer',
+ ),
+ );
/**
* @var Theme|array the theme object or the configuration array for creating the theme object.
* If not set, it means theming is not enabled.
|
Changed default value of View::renderers.
|
yiisoft_yii2-debug
|
train
|
php
|
2160f437d6bbdcab652788717b1fc14dc2e384ba
|
diff --git a/src/Zizaco/Entrust/EntrustPermission.php b/src/Zizaco/Entrust/EntrustPermission.php
index <HASH>..<HASH> 100644
--- a/src/Zizaco/Entrust/EntrustPermission.php
+++ b/src/Zizaco/Entrust/EntrustPermission.php
@@ -23,6 +23,14 @@ class EntrustPermission extends Ardent
);
/**
+ * Many-to-Many relations with Roles
+ */
+ public function roles()
+ {
+ return $this->belongsToMany('Role', 'permission_role');
+ }
+
+ /**
* Before delete all constrained foreign relations
*
* @param bool $forced
|
Added roles method to get roles associated with a permission.
|
Zizaco_entrust
|
train
|
php
|
c871c733a37dbafba1f6aa7fc6cd8ea68767fcf5
|
diff --git a/src/directives/jf_multi_dropdown/jf_multi_dropdown.js b/src/directives/jf_multi_dropdown/jf_multi_dropdown.js
index <HASH>..<HASH> 100644
--- a/src/directives/jf_multi_dropdown/jf_multi_dropdown.js
+++ b/src/directives/jf_multi_dropdown/jf_multi_dropdown.js
@@ -138,6 +138,7 @@ class jfMultiDropdownController {
}
selectAll() {
+ if (this.disabled) return;
this.filter(this.items, this.filterText).forEach((item) => {
if (!item.disabled) {
item.isSelected = true;
@@ -147,6 +148,7 @@ class jfMultiDropdownController {
}
unSelectAll() {
+ if (this.disabled) return;
this.filter(this.items, this.filterText).forEach((item) => {
if (!item.disabled) {
item.isSelected = false;
@@ -161,7 +163,8 @@ class jfMultiDropdownController {
}
clearSelection() {
- if (this.textInputs) {
+ if (this.disabled) return;
+ if (this.textInputs) {
_.forEach(this.items, (item) => {
item.inputTextValue = '';
});
|
JFUIE-2: jf-multi-dropdown: Disable 'clear all' button when component is disabled
|
jfrog_jfrog-ui-essentials
|
train
|
js
|
91eab7b3180ae54d1171a822aaebe021d6e330ff
|
diff --git a/salt/modules/virt.py b/salt/modules/virt.py
index <HASH>..<HASH> 100644
--- a/salt/modules/virt.py
+++ b/salt/modules/virt.py
@@ -304,16 +304,6 @@ def _gen_xml(name,
serial_section = ''
data = data.replace('%%SERIAL%%', serial_section)
- boot_str = ''
- if 'boot_dev' in kwargs:
- for dev in kwargs['boot_dev']:
- boot_part = "<boot dev='%%DEV%%' />"
- boot_part = boot_part.replace('%%DEV%%', dev)
- boot_str += boot_part
- else:
- boot_str = '''<boot dev='hd'/>'''
- data = data.replace('%%BOOT%%', boot_str)
-
disk_t = '''
<disk type='file' device='disk'>
<source %%SOURCE%%/>
|
Remove redundant code block
The same code block is present a few lines above. Merge slip?
|
saltstack_salt
|
train
|
py
|
483308b165313541541e8436c0460d22e437fb3b
|
diff --git a/skorch/helper.py b/skorch/helper.py
index <HASH>..<HASH> 100644
--- a/skorch/helper.py
+++ b/skorch/helper.py
@@ -5,6 +5,7 @@ They should not be used in skorch directly.
"""
from functools import partial
from skorch.utils import _make_split
+from skorch.utils import _make_optimizer
class SliceDict(dict):
@@ -112,8 +113,7 @@ def filtered_optimizer(optimizer, filter_fn):
it to ``optimizer``.
"""
- from skorch.utils import make_optimizer
- return partial(make_optimizer, optimizer=optimizer, filter_fn=filter_fn)
+ return partial(_make_optimizer, optimizer=optimizer, filter_fn=filter_fn)
def predefined_split(dataset):
diff --git a/skorch/utils.py b/skorch/utils.py
index <HASH>..<HASH> 100644
--- a/skorch/utils.py
+++ b/skorch/utils.py
@@ -417,7 +417,7 @@ class FirstStepAccumulator:
return self.step
-def make_optimizer(pgroups, optimizer, filter_fn, **kwargs):
+def _make_optimizer(pgroups, optimizer, filter_fn, **kwargs):
"""Used by ``skorch.helper.filtered_optimizer`` to allow for pickling"""
return optimizer(filter_fn(pgroups), **kwargs)
|
RFC: Converts make_optimizer to a private func (#<I>)
|
skorch-dev_skorch
|
train
|
py,py
|
aa3ce1abaa9ab6e7e10dd9215bcad40e3dce4feb
|
diff --git a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
index <HASH>..<HASH> 100644
--- a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
+++ b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
@@ -175,7 +175,7 @@ public class IndexRecoveryImpl implements IndexRecovery, TopologyChangeListener
public Serializable execute(Serializable[] args) throws Throwable
{
String filePath = (String)args[0];
- int offset = (Integer)args[1];
+ long offset = (Long)args[1];
RandomAccessFile file = new RandomAccessFile(new File(indexDirectory, filePath), "r");
file.seek(offset);
@@ -333,7 +333,7 @@ public class IndexRecoveryImpl implements IndexRecovery, TopologyChangeListener
{
private final String filePath;
- private int fileOffset = 0;
+ private long fileOffset = 0;
private int bufferOffset = 0;
|
JCR-<I>: The problem with receive index file more than 2GB was fixed.
|
exoplatform_jcr
|
train
|
java
|
44a7b058c6265fc443f584c6a8999a81059a0959
|
diff --git a/auctioneer/auctioneer.go b/auctioneer/auctioneer.go
index <HASH>..<HASH> 100644
--- a/auctioneer/auctioneer.go
+++ b/auctioneer/auctioneer.go
@@ -49,5 +49,9 @@ func (a *auctionRunner) RunLRPStartAuction(auctionRequest auctiontypes.AuctionRe
}
result.BiddingDuration = time.Since(t)
+ if result.Winner == "" {
+ return result, auctiontypes.InsufficientResources
+ }
+
return result, nil
}
|
auction runner returns an error when the auction fails
|
cloudfoundry_auction
|
train
|
go
|
c6c59f22527c388bbbb1050a18ae9f1ee6ad6e73
|
diff --git a/Model/ImportExport/Processor/Import/Node.php b/Model/ImportExport/Processor/Import/Node.php
index <HASH>..<HASH> 100644
--- a/Model/ImportExport/Processor/Import/Node.php
+++ b/Model/ImportExport/Processor/Import/Node.php
@@ -69,7 +69,7 @@ class Node
): void {
foreach ($nodes as $nodeData) {
$node = $this->nodeFactory->create();
- $data = $this->dataProcessor->get($nodeData, $menuId, $level, $position++, $parentId);
+ $data = $this->dataProcessor->getData($nodeData, $menuId, $level, $position++, $parentId);
$node->setData($data);
$this->nodeRepository->save($node);
diff --git a/Model/ImportExport/Processor/Import/Node/DataProcessor.php b/Model/ImportExport/Processor/Import/Node/DataProcessor.php
index <HASH>..<HASH> 100644
--- a/Model/ImportExport/Processor/Import/Node/DataProcessor.php
+++ b/Model/ImportExport/Processor/Import/Node/DataProcessor.php
@@ -27,7 +27,7 @@ class DataProcessor
$this->typeContent = $typeContent;
}
- public function get(
+ public function getData(
array $data,
int $menuId,
int $level = 0,
|
[<I>] Rename node import data processor get method
|
SnowdogApps_magento2-menu
|
train
|
php,php
|
1e53ebf88223883b4b40daf2323a940d54505434
|
diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -94,9 +94,6 @@ module.exports = function(config) {
args: [{}],
},
- // web server port
- port: 9876,
-
// enable / disable colors in the output (reporters and logs)
colors: true,
@@ -198,12 +195,6 @@ module.exports = function(config) {
if (flagPresent('specFilter')) {
setClientArg(config, 'specFilter', getFlagValue('specFilter'));
}
-
- var hostname = getFlagValue('hostname');
- if (hostname !== null) {
- // Point the browsers to a hostname other than localhost.
- config.set({hostname: hostname});
- }
};
// Sets the value of an argument passed to the client.
|
Remove unnecessary config already set by default.
Change-Id: Iba<I>eb<I>c<I>c8efc6cc<I>ccbe<I>c2ca0a<I>
|
google_shaka-player
|
train
|
js
|
b94d266d09fd11ea94b6fa1e694986ba3b0f3153
|
diff --git a/src/Pyrite/Users.php b/src/Pyrite/Users.php
index <HASH>..<HASH> 100644
--- a/src/Pyrite/Users.php
+++ b/src/Pyrite/Users.php
@@ -472,17 +472,17 @@ class Users
if ($cleanId !== false) {
$out[] = $cleanId;
};
- } elseif (preg_match('/^[^@ ]+@[^@ .]+\.[^@ ]+$/', $email) == 1) {
+ } elseif (preg_match('/^[^@ ]+@[^@ .]+\.[^@ ]+$/', $id) == 1) {
$cleanId = $db->selectAtom('SELECT id FROM users WHERE email=?', array($id));
if ($cleanId !== false) {
$out[] = $cleanId;
} else {
- if (isset($userData[$email])) {
- $cols = $userData[$email];
+ if (isset($userData[$id])) {
+ $cols = $userData[$id];
} else {
$cols = array();
};
- $cols['email'] = $email;
+ $cols['email'] = $id;
$newbie = self::create($cols);
if ($newbie !== false) {
$out[] = $newbie[0];
|
Bugfix: forgot to rename a variable in refactor
|
vphantom_pyritephp
|
train
|
php
|
715d6047ce4a0c5f4e8d137a7a9d83655fde2fd1
|
diff --git a/test/TodoListTest.py b/test/TodoListTest.py
index <HASH>..<HASH> 100644
--- a/test/TodoListTest.py
+++ b/test/TodoListTest.py
@@ -223,7 +223,7 @@ class TodoListTester(TopydoTest):
todo = self.todolist.todo('t5c')
self.todolist.append(todo, "A")
- self.assertNotEquals(self.todolist.number(todo), 't5c')
+ self.assertNotEqual(self.todolist.number(todo), 't5c')
class TodoListDependencyTester(TopydoTest):
def setUp(self):
|
assertNotEquals -> assertNotEqual
|
bram85_topydo
|
train
|
py
|
f9f25f33c86d7223d86da0f1208cf139c65a4c41
|
diff --git a/lib/modules/swarm/index.js b/lib/modules/swarm/index.js
index <HASH>..<HASH> 100644
--- a/lib/modules/swarm/index.js
+++ b/lib/modules/swarm/index.js
@@ -95,7 +95,7 @@ class Swarm {
registerUploadCommand(cb) {
const self = this;
- this.embark.registerUploadCommand('ipfs', () => {
+ this.embark.registerUploadCommand('swarm', () => {
let upload_swarm = new UploadSwarm({
buildDir: self.buildDir || 'dist/',
storageConfig: self.storageConfig,
|
fix swarm upload cmd registration
|
embark-framework_embark
|
train
|
js
|
ad88a1886f2ae559fdf8589a9f1c11518556761d
|
diff --git a/tracer.go b/tracer.go
index <HASH>..<HASH> 100644
--- a/tracer.go
+++ b/tracer.go
@@ -52,9 +52,8 @@ func NewWithOptions(opts Options) opentracing.Tracer {
// New creates and returns a standard Tracer which defers completed Spans to
// `recorder`.
-// Spans created by this Tracer support the ext.SamplingPriority tag: Calling
-// SetTag(ext.SamplingPriority, nil) causes the Span to be Sampled from that
-// point on.
+// Spans created by this Tracer support the ext.SamplingPriority tag: Setting
+// ext.SamplingPriority causes the Span to be Sampled from that point on.
func New(recorder SpanRecorder) opentracing.Tracer {
opts := DefaultOptions()
opts.Recorder = recorder
|
Remove improper usage of external tag
and change ext.SamplingPriority to uint<I>.
|
opentracing_basictracer-go
|
train
|
go
|
31ebaee5b4ed8f98ad21bda3d88c9c9091f6326c
|
diff --git a/lib/ess/dtd.rb b/lib/ess/dtd.rb
index <HASH>..<HASH> 100644
--- a/lib/ess/dtd.rb
+++ b/lib/ess/dtd.rb
@@ -135,7 +135,9 @@ module ESS
:max_occurs => :inf,
:valid_values => [
'first','second','third',
- 'fourth','last' ] } },
+ 'fourth','last' ] },
+ :priority => { :mandatory => false,
+ :max_occurs => 1 } },
:tags => { :name => { :dtd => BASIC_ELEMENT,
:mandatory => true,
:max_occurs => 1 },
@@ -387,7 +389,9 @@ module ESS
:attributes => { :type => { :mandatory => true,
:max_occurs => 1,
:valid_vlaues => [
- 'alternative','related','enclosure'] } },
+ 'alternative','related','enclosure'] },
+ :priority => { :mandatory => false,
+ :max_occurs => 1 } },
:tags => { :name => { :dtd => BASIC_ELEMENT,
:mandatory => true,
:max_occurs => 1 },
|
Added missing priority attribute specs in DTD
|
essfeed_ruby-ess
|
train
|
rb
|
7f26d0f1e0686d6f2513769dab177cefba1c783a
|
diff --git a/wily/__main__.py b/wily/__main__.py
index <HASH>..<HASH> 100644
--- a/wily/__main__.py
+++ b/wily/__main__.py
@@ -66,7 +66,7 @@ def cli(ctx, debug, config, path):
@cli.command()
@click.option(
- "-h",
+ "-n",
"--max-revisions",
default=None,
type=click.INT,
|
rename the -h flag to -n (was a typo):
|
tonybaloney_wily
|
train
|
py
|
df60fd4a06af49a8ff9d3d6b6eaefd19e6a3ef4d
|
diff --git a/src/App.php b/src/App.php
index <HASH>..<HASH> 100644
--- a/src/App.php
+++ b/src/App.php
@@ -32,7 +32,7 @@ class App
/**
* 服务器对象
*
- * @var AbstractServer
+ * @var AbstractServer|\Swoft\Http\Server\Http\HttpServer|\Swoft\WebSocket\Server\WebSocketServer
*/
public static $server;
@@ -263,10 +263,10 @@ class App
}
/**
- * 注册别名
+ * Set alias
*
- * @param string $alias 别名
- * @param string $path 路径
+ * @param string $alias alias
+ * @param string $path path
*
* @throws \InvalidArgumentException
*/
@@ -309,7 +309,7 @@ class App
}
/**
- * 获取别名路径
+ * Get alias
*
* @param string $alias
*
@@ -339,6 +339,24 @@ class App
}
/**
+ * Is alias exist ?
+ *
+ * @param string $alias
+ *
+ * @return bool
+ * @throws \InvalidArgumentException
+ */
+ public static function hasAlias(string $alias): bool
+ {
+ // empty OR not an alias
+ if (!$alias || $alias[0] !== '@') {
+ return false;
+ }
+
+ return isset(self::$aliases[$alias]);
+ }
+
+ /**
* trace级别日志
*
* @param mixed $message 日志信息
|
ws-server: bug fixed for connection info lost. fix cannot connect to root path
|
swoft-cloud_swoft-framework
|
train
|
php
|
ecf68bd549d7a486f76cf6e71a6efdfd77ac4498
|
diff --git a/spyderlib/interpreter.py b/spyderlib/interpreter.py
index <HASH>..<HASH> 100644
--- a/spyderlib/interpreter.py
+++ b/spyderlib/interpreter.py
@@ -325,7 +325,7 @@ has the same effect as typing a particular string at the help> prompt.
The return value is True if more input is required, False if the line
was dealt with in some way (this is the same as runsource()).
"""
- return InteractiveConsole.push(self, line)
+ return InteractiveConsole.push(self, "#coding=utf-8\n" + line)
def resetbuffer(self):
"""Remove any unhandled source text from the input buffer"""
diff --git a/spyderlib/widgets/internalshell.py b/spyderlib/widgets/internalshell.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/internalshell.py
+++ b/spyderlib/widgets/internalshell.py
@@ -396,7 +396,7 @@ class InternalShell(PythonShellWidget):
else:
if history:
self.add_to_history(cmd)
- self.interpreter.stdin_write.write(cmd + '\n')
+ self.interpreter.stdin_write.write(cmd.encode("utf-8") + '\n')
if not self.multithreaded:
self.interpreter.run_line()
self.emit(SIGNAL("refresh()"))
|
Internal console: Add the possibility to introduce unicode characters
Update Issue <I>
Status: Fixed
|
spyder-ide_spyder
|
train
|
py,py
|
1965c91fc3ae83e16f970a90c84cf3053e078661
|
diff --git a/lib/rippleLibStorage.js b/lib/rippleLibStorage.js
index <HASH>..<HASH> 100644
--- a/lib/rippleLibStorage.js
+++ b/lib/rippleLibStorage.js
@@ -44,14 +44,14 @@ module.exports = function(opts) {
saveAccount: function(account_id, data) {
var data_str = JSON.stringify(data);
- RippleLibQueuedTx.find({
+ RippleLibQueuedTx.findAndCountAll({
where: { account_id: account_id }
- }).complete(function(err, account){
+ }).complete(function(err, res){
if (err) {
throw (new Error('Error connecting to RippleLibQueuedTx: ' + err));
}
- if (account && account.values && account.values.account_id === account_id) {
+ if (res.count > 0) {
RippleLibQueuedTx.update({
transactions: data_str
}, {
|
[CHORE] Using findAndCountAll instead of find
|
ripple_ripple-rest
|
train
|
js
|
6e9da8675f31957881ba925b5d963a704dfd8932
|
diff --git a/future/tests/test_import_star.py b/future/tests/test_import_star.py
index <HASH>..<HASH> 100644
--- a/future/tests/test_import_star.py
+++ b/future/tests/test_import_star.py
@@ -50,8 +50,16 @@ class TestImportStar(unittest.TestCase):
def test_python3_stdlib_imports(self):
# These should fail on Py2
- import queue
- import socketserver
+ try:
+ import queue
+ import socketserver
+ except ImportError:
+ if utils.PY3:
+ self.fail('Py3 modules failed to load')
+ else:
+ if utils.PY2:
+ self.fail('Py3 standard library modules should not import on Py2 without explicitly enabling them')
+ self.assertTrue(True)
def test_str(self):
self.assertIsNot(str, bytes) # Py2: assertIsNot only in 2.7
|
Fix a dodgy test: importing the stdlib without explictly enabling hooks
|
PythonCharmers_python-future
|
train
|
py
|
83ae512e0394204b348aad5ba567a0eb04999688
|
diff --git a/src/javascript/runtime/silverlight/image/Image.js b/src/javascript/runtime/silverlight/image/Image.js
index <HASH>..<HASH> 100644
--- a/src/javascript/runtime/silverlight/image/Image.js
+++ b/src/javascript/runtime/silverlight/image/Image.js
@@ -66,6 +66,10 @@ define("moxie/runtime/silverlight/image/Image", [
info.name = rawInfo.name;
return info;
+ },
+
+ resize: function(rect, ratio, opts) {
+ this.getRuntime().shimExec.call(this, 'Image', 'resize', rect.x, rect.y, rect.width, rect.height, ratio, opts.preserveHeaders, opts.resample);
}
}));
});
\ No newline at end of file
|
Image, Silverlight: Put an adapter for new resize method.
|
moxiecode_moxie
|
train
|
js
|
1968db8fe5528d5c06ced1ba3d3d29d1ec289768
|
diff --git a/lxd/db/instances.go b/lxd/db/instances.go
index <HASH>..<HASH> 100644
--- a/lxd/db/instances.go
+++ b/lxd/db/instances.go
@@ -766,17 +766,16 @@ INSERT INTO instances_profiles (instance_id, profile_id, apply_order)
// use it for new code.
func (c *Cluster) LegacyContainersList() ([]string, error) {
q := fmt.Sprintf("SELECT name FROM instances WHERE type=? ORDER BY name")
- inargs := []interface{}{instancetype.Container}
- var container string
- outfmt := []interface{}{container}
- result, err := queryScan(c, q, inargs, outfmt)
- if err != nil {
- return nil, err
- }
var ret []string
- for _, container := range result {
- ret = append(ret, container[0].(string))
+
+ err := c.Transaction(func(tx *ClusterTx) error {
+ var err error
+ ret, err = query.SelectStrings(tx.tx, q, instancetype.Container)
+ return err
+ })
+ if err != nil {
+ return nil, err
}
return ret, nil
|
lxd/db: Use query.SelectStrings helper in LegacyContainersList
|
lxc_lxd
|
train
|
go
|
da16bfa296c0f017ea78b847bf5151ce6d4d06d9
|
diff --git a/shinken/objects/item.py b/shinken/objects/item.py
index <HASH>..<HASH> 100644
--- a/shinken/objects/item.py
+++ b/shinken/objects/item.py
@@ -235,7 +235,10 @@ Like temporary attributes such as "imported_from", etc.. """
def get_templates(self):
if hasattr(self, 'use') and self.use != '':
- return self.use.split(',')
+ if isinstance(self.use, list):
+ return self.use
+ else:
+ return self.use.split(',')
else:
return []
@@ -1003,7 +1006,7 @@ class Items(object):
comandcall['poller_tag']=prop.poller_tag
elif hasattr(prop, 'reactionner_tag'):
comandcall['reactionner_tag']=prop.reactionner_tag
-
+
return CommandCall(**comandcall)
# Link one command property
@@ -1013,7 +1016,7 @@ class Items(object):
command = getattr(i, prop).strip()
if command != '':
cmdCall = self.create_commandcall(i, commands, command)
-
+
# TODO: catch None?
setattr(i, prop, cmdCall)
else:
|
Fixed get_template function.
The parameter 'use' is defined as ListProp, and may be a list. In such a
case, get_templates functnions fails.
|
Alignak-monitoring_alignak
|
train
|
py
|
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.