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 |
|---|---|---|---|---|---|
41331a33c66752f55c0d6698bcb25ac276274363 | 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
@@ -55,7 +55,7 @@ repo_name = u"dtool-create"
# built documents.
#
# The short X.Y version.
-version = u"0.3.0"
+version = u"0.4.0"
# The full version, including alpha/beta/rc tags.
release = version
diff --git a/dtool_create/__init__.py b/dtool_create/__init__.py
index <HASH>..<HASH> 100644
--- a/dtool_create/__init__.py
+++ b/dtool_create/__init__.py
@@ -1,3 +1,3 @@
"""dtool-create package."""
-__version__ = "0.3.0"
+__version__ = "0.4.0"
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
url = "https://github.com/jic-dtool/dtool-create"
-version = "0.3.0"
+version = "0.4.0"
readme = open('README.rst').read()
setup( | Update version number to <I> | jic-dtool_dtool-create | train | py,py,py |
6a56d42079f59fd7468a683fd90a1cb17e20eede | diff --git a/src/java/com/threerings/jme/JmeApp.java b/src/java/com/threerings/jme/JmeApp.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/jme/JmeApp.java
+++ b/src/java/com/threerings/jme/JmeApp.java
@@ -27,6 +27,8 @@ import com.samskivert.util.Queue;
import com.samskivert.util.RunQueue;
import com.samskivert.util.StringUtil;
+import org.lwjgl.opengl.Display;
+
import com.jme.renderer.Camera;
import com.jme.renderer.ColorRGBA;
import com.jme.renderer.Renderer;
@@ -160,6 +162,10 @@ public class JmeApp
processEvents(frameStart);
_failures = 0;
+ // cap our frame rate at 60 if we're not visible and thus don't
+ // automatically cap due to being vsynced
+ Display.sync(60);
+
} catch (Throwable t) {
Log.logStackTrace(t);
// stick a fork in things if we fail too many times in a row | Use an LWJGL support function to cap our frame rate at <I> when we're not
visible and can't rely on the vsync doing it for us.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1 | threerings_narya | train | java |
db0cd7fe6a9937d96ee3c0442476f39150fa38e8 | diff --git a/hearthstone/hslog/parser.py b/hearthstone/hslog/parser.py
index <HASH>..<HASH> 100644
--- a/hearthstone/hslog/parser.py
+++ b/hearthstone/hslog/parser.py
@@ -212,6 +212,7 @@ class LogWatcher(LogBroadcastMixin):
def action_start(self, ts, entity, type, index, target):
entity = self.parse_entity(entity)
type = parse_enum(enums.PowSubType, type)
+ target = self.parse_entity(target)
action = Action(entity, type, index, target)
action.parent = self.current_action
if self.current_action: | hslog: Parse the action target as an entity | HearthSim_python-hearthstone | train | py |
9ee8b2f92332cb8c7e332d02107c6fe514e3e2ba | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ readme_note = '''\
.. note::
For the latest source, issues and discussion, etc, please visit the
- `GitHub repository <https://github.com/samuell/sciluigi>`_\n\n
+ `GitHub repository <https://github.com/pharmbio/sciluigi>`_\n\n
'''
with open('README.rst') as fobj:
@@ -22,7 +22,7 @@ setup(
description='Helper library for writing dynamic, flexible workflows in luigi',
long_description=long_description,
author='Samuel Lampa',
- author_email='samuel.lampa@farmbio.uu.se',
+ author_email='samuel.lampa@rilnet.com',
url='https://github.com/pharmbio/sciluigi',
license='MIT',
keywords='workflows workflow pipeline luigi',
@@ -30,7 +30,9 @@ setup(
'sciluigi',
],
install_requires=[
- 'luigi'
+ 'luigi',
+ 'psycopg2',
+ 'boto3'
],
classifiers=[
'Development Status :: 4 - Beta', | Add missing deps and fix wrong info in setup.py | pharmbio_sciluigi | train | py |
8cbaea6e3951c5874ea34feda8c6e68cff201d28 | diff --git a/cli.js b/cli.js
index <HASH>..<HASH> 100755
--- a/cli.js
+++ b/cli.js
@@ -63,16 +63,24 @@ if (!commands.hasOwnProperty(command)) {
// if there is an output file present, write to the file. Otherwise write to stdout
const output = argv.output ? fs.createWriteStream(argv.output) : process.stdout
+const serialize = ndjson.serialize()
+
// stream the input file into the seq parser
fs.createReadStream(argv.input)
.pipe(ndjson.parse())
.pipe(through.obj(function (data, enc, cb) {
console.log('chunk', data)
+ this.push(commands[command](data.seq))
// get next object in stream
cb()
}))
+ .pipe(serialize)
.pipe(output)
.on('error', function (err) {
console.log('There was an error:\n', err)
})
+ .on('end', function () {
+ serialize.end()
+ output.close()
+ }) | Properly serializes the object now. Can run commands where seq is the only parameter. | bionode_bionode-seq | train | js |
ef59238007df40f784a5040a5f3e08f3f71c1787 | diff --git a/cmd/globals.go b/cmd/globals.go
index <HASH>..<HASH> 100644
--- a/cmd/globals.go
+++ b/cmd/globals.go
@@ -42,6 +42,15 @@ const (
// Global error exit status.
globalErrorExitStatus = 1
+
+ // Global CTRL-C (SIGINT, #2) exit status.
+ globalCancelExitStatus = 130
+
+ // Global SIGKILL (#9) exit status.
+ globalKillExitStatus = 137
+
+ // Global SIGTERM (#15) exit status
+ globalTerminatExitStatus = 143
)
var (
diff --git a/cmd/signals.go b/cmd/signals.go
index <HASH>..<HASH> 100644
--- a/cmd/signals.go
+++ b/cmd/signals.go
@@ -32,13 +32,24 @@ func trapSignals(sig ...os.Signal) {
signal.Notify(sigCh, sig...)
// Wait for the signal.
- <-sigCh
+ s := <-sigCh
// Once signal has been received stop signal Notify handler.
-
signal.Stop(sigCh)
// Cancel the global context
globalCancel()
+ var exitCode int
+ switch s.String() {
+ case "interrupt":
+ exitCode = globalCancelExitStatus
+ case "killed":
+ exitCode = globalKillExitStatus
+ case "terminated":
+ exitCode = globalTerminatExitStatus
+ default:
+ exitCode = globalErrorExitStatus
+ }
+ os.Exit(exitCode)
} | Adds error exit codes for SIGINT, SIGTERM and SIGKILL (#<I>) | minio_mc | train | go,go |
a3be77a4ba58f6a102217a39a35f56b641e82e0e | diff --git a/bolt/organizations.go b/bolt/organizations.go
index <HASH>..<HASH> 100644
--- a/bolt/organizations.go
+++ b/bolt/organizations.go
@@ -20,6 +20,7 @@ type OrganizationsStore struct {
client *Client
}
+// Migrate sets the default organization at runtime
func (s *OrganizationsStore) Migrate(ctx context.Context) error {
o := chronograf.Organization{
ID: 0,
@@ -27,6 +28,10 @@ func (s *OrganizationsStore) Migrate(ctx context.Context) error {
}
return s.client.db.Update(func(tx *bolt.Tx) error {
b := tx.Bucket(OrganizationsBucket)
+ v := b.Get(u64tob(o.ID))
+ if v != nil {
+ return nil
+ }
if v, err := internal.MarshalOrganization(&o); err != nil {
return err
} else if err := b.Put(u64tob(o.ID), v); err != nil { | Fix Migrate Organizations to not overwrite name | influxdata_influxdb | train | go |
3810c99abb066c8751e69181a7be005a42519c16 | diff --git a/lib/jboss-cloud/appliance-image.rb b/lib/jboss-cloud/appliance-image.rb
index <HASH>..<HASH> 100644
--- a/lib/jboss-cloud/appliance-image.rb
+++ b/lib/jboss-cloud/appliance-image.rb
@@ -107,6 +107,7 @@ module JBossCloud
@log.debug "Applying APR/HTTPD workaround..."
guestfs.sh( "yum -y remove apr" )
guestfs.sh( "yum -y install mod_cluster --disablerepo=updates" )
+ guestfs.sh( "/sbin/chkconfig --level 234 httpd on" )
@log.debug "Workaround applied."
end | add httpd to boot after APR reinstall | boxgrinder_boxgrinder-build | train | rb |
9bc71357087daf3d674e1b9f62537902f8b0d73b | diff --git a/intlekt/django/ieml/global/settings.py b/intlekt/django/ieml/global/settings.py
index <HASH>..<HASH> 100644
--- a/intlekt/django/ieml/global/settings.py
+++ b/intlekt/django/ieml/global/settings.py
@@ -28,7 +28,7 @@ SECRET_KEY = '1j8ai(ft))a6)*fyp5+qd1i6fs+fb62pu_&nbe+%aemihe)#xc'
DEBUG = True
ALLOWED_HOSTS = ['*']
-
+CORS_ORIGIN_ALLOW_ALL = True
# Application definition
@@ -48,9 +48,9 @@ INSTALLED_APPS = [
]
MIDDLEWARE = [
+ 'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
- 'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', | Add allow from everywhere cors headers. | IEMLdev_ieml | train | py |
ffc9210187d4c958b0e0bc2d557dd4b100ed6e7e | diff --git a/flask_sqlalchemy/__init__.py b/flask_sqlalchemy/__init__.py
index <HASH>..<HASH> 100644
--- a/flask_sqlalchemy/__init__.py
+++ b/flask_sqlalchemy/__init__.py
@@ -42,7 +42,7 @@ except ImportError:
_app_ctx_stack = None
-__version__ = '1.1-dev'
+__version__ = '2.0-dev'
# Which stack should we use? _app_ctx_stack is new in 0.9
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ from setuptools import setup
setup(
name='Flask-SQLAlchemy',
- version='1.1-dev',
+ version='2.0-dev',
url='http://github.com/mitsuhiko/flask-sqlalchemy',
license='BSD',
author='Armin Ronacher', | This is going to be <I> | pallets_flask-sqlalchemy | train | py,py |
b99506ada766c4656044add5a4779111287d414b | diff --git a/path.py b/path.py
index <HASH>..<HASH> 100644
--- a/path.py
+++ b/path.py
@@ -702,8 +702,10 @@ class path(unicode):
:example:
- >>> for chunk in path("file.txt").chunk(8192):
- ... print(chunk)
+ >>> import hashlib
+ >>> hash = hashlib.md5()
+ >>> for chunk in path("path.py").chunks(8192, mode='rb'):
+ ... hash.update(chunk)
This will read the file by chunks of 8192 bytes.
""" | Update doctest in .chunks for correctness and so it actually passes. | jaraco_path.py | train | py |
8e234f57a4fe7d15de228395faca814a060aa865 | diff --git a/nodeshot/core/base/cache.py b/nodeshot/core/base/cache.py
index <HASH>..<HASH> 100755
--- a/nodeshot/core/base/cache.py
+++ b/nodeshot/core/base/cache.py
@@ -17,7 +17,7 @@ def cache_by_group(view_instance, view_method, request, args, kwargs):
"""
Cache view response by media type and user group.
The cache_key is constructed this way: "{view_name:path.group.media_type}"
- EG: "/api/v1/menu/.public.application/json"
+ EG: "MenuList:/api/v1/menu/.public.application/json"
Possible groups are:
* public
* superuser | minor doc fix in base.cache docstring | ninuxorg_nodeshot | train | py |
033182f2e9eed925280f25f400c64e0b74cf2030 | diff --git a/util.js b/util.js
index <HASH>..<HASH> 100644
--- a/util.js
+++ b/util.js
@@ -24,6 +24,8 @@ function isVisible(el) {
}
function setInvisible(el) {
+ if (el.style.visibility === 'hidden') return
+
//store scroll position in data-attribute
el.dataset.scrollTop = el.scrollTop | skip store of position if tab is already hidden | hyperhype_hypertabs | train | js |
eab9cb2f0ee26c0cd7965ccea9cbf6eace873d29 | diff --git a/src/Orm/EntityRepository.php b/src/Orm/EntityRepository.php
index <HASH>..<HASH> 100755
--- a/src/Orm/EntityRepository.php
+++ b/src/Orm/EntityRepository.php
@@ -460,6 +460,18 @@ class EntityRepository {
return $this;
}
+ public function addOrderByFieldAsString($sql) {
+ $this->order_fields[] = [
+ 'table' => false,
+ 'field' => $sql,
+ 'direction' => false,
+ 'do_not_use_table_in_sql' => true,
+ 'type' => 'string'
+ ];
+
+ return $this;
+ }
+
/**
* @param $searchable_string
* @param $field | Can add order by as sql string | devp-eu_tmcms-core | train | php |
d79c051f948c5be0e9a6528f5ddd8121f366e131 | diff --git a/test/e2e/upgrade/service/service.go b/test/e2e/upgrade/service/service.go
index <HASH>..<HASH> 100644
--- a/test/e2e/upgrade/service/service.go
+++ b/test/e2e/upgrade/service/service.go
@@ -49,7 +49,7 @@ func (t *UpgradeTest) Setup(f *framework.Framework) {
infra, err := configClient.ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{})
framework.ExpectNoError(err)
// ovirt does not support service type loadbalancer because it doesn't program a cloud.
- if infra.Status.PlatformStatus.Type == configv1.OvirtPlatformType || infra.Status.PlatformStatus.Type == configv1.KubevirtPlatformType || infra.Status.PlatformStatus.Type == configv1.LibvirtPlatformType {
+ if infra.Status.PlatformStatus.Type == configv1.OvirtPlatformType || infra.Status.PlatformStatus.Type == configv1.KubevirtPlatformType || infra.Status.PlatformStatus.Type == configv1.LibvirtPlatformType || infra.Status.PlatformStatus.Type == configv1.VSpherePlatformType {
t.unsupportedPlatform = true
}
if t.unsupportedPlatform { | test: add vsphere to unsupported platforms for LB service | openshift_origin | train | go |
be212605fed0acc41c69e3c99df10834bc6d78a7 | diff --git a/src/oauth.class.php b/src/oauth.class.php
index <HASH>..<HASH> 100644
--- a/src/oauth.class.php
+++ b/src/oauth.class.php
@@ -188,10 +188,12 @@
}
// function accessToken(). Returns / sets the current access token.
- public function accessToken($token = null) {
+ public function accessToken($token = null, $session = true) {
if(is_string($token)) {
$this->token = $token;
- $this->session("token", $token);
+ if($session == true) $this->session("token", $token);
+ } elseif($token == false) {
+ $this->token = null;
} else return $this->token;
} | Update oauth.class.php
Allows disabling updating the access token in the session when setting the access token by setting the $session attribute of OAuth::accessToken() to false. | samuelthomas2774_oauth-client | train | php |
37469988c3d68f396ed9667a124039def96550d6 | diff --git a/lib/env/env.rb b/lib/env/env.rb
index <HASH>..<HASH> 100644
--- a/lib/env/env.rb
+++ b/lib/env/env.rb
@@ -17,7 +17,7 @@ module Env
# # => "/bin/bash"
#
def Env.[](name)
- env_hash[name.to_s]
+ env[name.to_s]
end
#
@@ -33,7 +33,7 @@ module Env
# The String value of the environment variable.
#
def Env.[]=(name,value)
- env_hash[name.to_s] = value.to_s
+ env[name.to_s] = value.to_s
end
protected | Use the env method in Env.[] and Env.[]=. | postmodern_env | train | rb |
1e01a14850fcc3513019c7cec94ed643a5a25d44 | diff --git a/livebridge/controller.py b/livebridge/controller.py
index <HASH>..<HASH> 100644
--- a/livebridge/controller.py
+++ b/livebridge/controller.py
@@ -58,6 +58,7 @@ class Controller(object):
is_changed = await self.control_data.check_control_change(self.control_file)
if is_changed is True:
asyncio.ensure_future(self.run())
+ logger.info("Stopped watching for control data changes.")
return True
await self.sleep(self.check_control_interval) | Added log message when ending control data watcher. | dpa-newslab_livebridge | train | py |
1cd87d5705677c1120cab5987487b9e525583c9c | diff --git a/lib/mortar/command.rb b/lib/mortar/command.rb
index <HASH>..<HASH> 100644
--- a/lib/mortar/command.rb
+++ b/lib/mortar/command.rb
@@ -30,11 +30,17 @@ module Mortar
def execute
signal_usage_error("#{src} does not exist") unless File.exist?(src)
resources = process_overlays
+
if output?
puts resources_output(resources)
exit
end
+ if resources.empty?
+ warn 'nothing to do!'
+ exit
+ end
+
K8s::Stack.new(
name, resources,
debug: debug?, | Warn when there is nothing to do (#<I>)
* Warn when there is nothing to do
* Unnecessary parenthesis | kontena_mortar | train | rb |
d650d1240deab43f9facd67c8df15a042c81cb4e | diff --git a/src/main/java/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java b/src/main/java/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java
+++ b/src/main/java/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java
@@ -447,7 +447,7 @@ public class HtmlUnitWebElement implements WrapsDriver,
return "";
}
- final Object slotVal = element.getScriptObject().get(name);
+ final Object slotVal = element.getScriptableObject().get(name);
if (slotVal instanceof String) {
String strVal = (String) slotVal;
if (!Strings.isNullOrEmpty(strVal)) { | Fixing use of deprecated method | SeleniumHQ_htmlunit-driver | train | java |
ff5d18b327eda0a9b807bb6d39a4b5bc6262c3b7 | diff --git a/dipper/utils/GraphUtils.py b/dipper/utils/GraphUtils.py
index <HASH>..<HASH> 100644
--- a/dipper/utils/GraphUtils.py
+++ b/dipper/utils/GraphUtils.py
@@ -63,7 +63,7 @@ class GraphUtils:
def add_property_axioms(graph, properties):
ontology_graph = ConjunctiveGraph()
GH = 'https://raw.githubusercontent.com'
- OBO = 'https://purl.obolibrary.org/obo'
+ OBO = 'http://purl.obolibrary.org/obo'
ontologies = [
OBO + '/sepio.owl',
OBO + '/geno.owl', | OBO url https -> http (the former apparently doesn't resolve, causes multiple ingest failures | monarch-initiative_dipper | train | py |
86ce6cb8aecc6a6c2b4bd1b48bb28bf2fe3ca452 | diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/type/cron.rb
+++ b/lib/puppet/type/cron.rb
@@ -111,7 +111,7 @@ Puppet::Type.newtype(:cron) do
def should_to_s(value = @should)
if value
- if name == :command || (value.is_a?(Array) && value[0].is_a?(Symbol))
+ if value.is_a?(Array) && (name == :command || value[0].is_a?(Symbol))
value = value[0]
end
super(value)
@@ -122,7 +122,7 @@ Puppet::Type.newtype(:cron) do
def is_to_s(value = @is)
if value
- if name == :command || (value.is_a?(Array) && value[0].is_a?(Symbol))
+ if value.is_a?(Array) && (name == :command || value[0].is_a?(Symbol))
value = value[0]
end
super(value) | (PUP-<I>) Fix regression in crontab property formatting
This commit fixes a regression in the way `is` and `should` values
were formatted in case the name was `:command` and value was not
an `Array`. | puppetlabs_puppet | train | rb |
47f5a5752a7215305354dd91265695213ff37088 | diff --git a/src/Process.php b/src/Process.php
index <HASH>..<HASH> 100644
--- a/src/Process.php
+++ b/src/Process.php
@@ -56,13 +56,6 @@ class Process
protected $process;
/**
- * Whether the process should be stopped on the instance destruction or kept alive.
- *
- * @var bool
- */
- protected $stopProcessOnDestruction = true;
-
- /**
* The process delegate.
*
* @var \ExtractrIo\Rialto\ShouldHandleProcessDelegation;
@@ -99,7 +92,7 @@ class Process
* Destructor.
*/
public function __destruct() {
- if ($this->process !== null && $this->stopProcessOnDestruction) {
+ if ($this->process !== null) {
$this->process->stop($this->options['stop_timeout']);
}
}
@@ -128,18 +121,6 @@ class Process
}
/**
- * Keep the process alive even if the PHP instance is destroyed.
- *
- * @return int The PID of the process.
- */
- public function keepProcessAlive(): int
- {
- $this->stopProcessOnDestruction = false;
-
- return $this->process->getPid();
- }
-
- /**
* Check if the process is still running without errors.
*
* @throws \Symfony\Component\Process\Exception\ProcessFailedException | Remove the keepProcessAlive method | nesk_rialto | train | php |
da8669f3e2474d8f51c9b7baa2bdf5a9b57d8e36 | diff --git a/tsdb/shard.go b/tsdb/shard.go
index <HASH>..<HASH> 100644
--- a/tsdb/shard.go
+++ b/tsdb/shard.go
@@ -1278,7 +1278,7 @@ func (a Shards) createSeriesIterator(ctx context.Context, opt query.IteratorOpti
}
if sfile == nil {
- return nil, errors.New("createSeriesIterator: no series file")
+ return nil, nil
}
return NewSeriesPointIterator(IndexSet{Indexes: idxs, SeriesFile: sfile}, opt) | Remove error for series file when no shards exist | influxdata_influxdb | train | go |
875c5b73176ebd55b28c953c5ded2c2a37ec5131 | diff --git a/node/container.go b/node/container.go
index <HASH>..<HASH> 100644
--- a/node/container.go
+++ b/node/container.go
@@ -146,11 +146,6 @@ func (a *HostAgent) StartContainer(cancel <-chan interface{}, partialSvc *servic
// Update the service with the complete image name
evaluatedService.ImageID = imageName
- if len(tenantID) == 0 && len(evaluatedService.Volumes) > 0 {
- // FIXME: find a better way of handling this error condition
- logger.Fatal("Could not get tenant ID and need to mount a volume")
- }
-
// get the system user
systemUser, err := masterClient.GetSystemUser()
if err != nil { | Remove unnecesary check - we should always have a tenantID at that point | control-center_serviced | train | go |
c77988db6dfed53bd4011b7ac1be9e9018b96b96 | diff --git a/synapse/lib/layer.py b/synapse/lib/layer.py
index <HASH>..<HASH> 100644
--- a/synapse/lib/layer.py
+++ b/synapse/lib/layer.py
@@ -14,7 +14,7 @@ import synapse.lib.msgpack as s_msgpack
logger = logging.getLogger(__name__)
-FAIR_ITERS = 5000 # every this many rows, yield CPU to other tasks
+FAIR_ITERS = 10 # every this many rows, yield CPU to other tasks
class Encoder(collections.defaultdict):
def __missing__(self, name): | Make regex lookups more fair (#<I>) | vertexproject_synapse | train | py |
96f569d5b2bcfff53ffeac99bef126f73d90ec6c | diff --git a/pyemma/msm/__init__.py b/pyemma/msm/__init__.py
index <HASH>..<HASH> 100644
--- a/pyemma/msm/__init__.py
+++ b/pyemma/msm/__init__.py
@@ -153,23 +153,18 @@ class _RedirectMSMToolsImport(object):
_sys.modules[name] = module
return module
-
+"""
_sys.meta_path.append(_RedirectMSMToolsImport('pyemma.msm.analysis',
'pyemma.msm.estimation',
'pyemma.msm.generation',
'pyemma.msm.dtraj',
'pyemma.msm.io',
'pyemma.msm.flux'))
-
+"""
# backward compatibility to PyEMMA 1.2.x
-from . import analysis
-from . import estimation
-from . import generation
-from . import dtraj
-# backward compatibility
+from msmtools import analysis, estimation, generation, dtraj, flux
+from msmtools.flux import ReactiveFlux
io = dtraj
-from . import flux
-from .flux import ReactiveFlux
#####################################################
# Estimators and models | [msm] disabled import hook (nose succeeds) | markovmodel_PyEMMA | train | py |
0e4ef00d34f7f17a5e46d6e8f540e550740b0edd | diff --git a/core/src/com/google/zxing/oned/rss/expanded/decoders/FieldParser.java b/core/src/com/google/zxing/oned/rss/expanded/decoders/FieldParser.java
index <HASH>..<HASH> 100644
--- a/core/src/com/google/zxing/oned/rss/expanded/decoders/FieldParser.java
+++ b/core/src/com/google/zxing/oned/rss/expanded/decoders/FieldParser.java
@@ -183,7 +183,8 @@ final class FieldParser {
{ "8100", 6},
{ "8101", 10},
{ "8102", 2},
- { "8110", VARIABLE_LENGTH, 30},
+ { "8110", VARIABLE_LENGTH, 70},
+ { "8200", VARIABLE_LENGTH, 70},
};
private FieldParser() { | Issue <I> errata from GS1 spec and support for additional var length product field <I>
git-svn-id: <URL> | zxing_zxing | train | java |
335f6a604fd73c61dc742f990e6f3129e14d4527 | diff --git a/spec/e2e/active_rel/persistence/query_factory_spec.rb b/spec/e2e/active_rel/persistence/query_factory_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/e2e/active_rel/persistence/query_factory_spec.rb
+++ b/spec/e2e/active_rel/persistence/query_factory_spec.rb
@@ -76,12 +76,12 @@ describe Neo4j::ActiveRel::Persistence::QueryFactory do
describe 'subclassed' do
before do
- stub_active_node_class('ParentClass') do
+ superclass = stub_active_node_class('ParentClass') do
property :created_at, type: Integer
property :updated_at, type: Integer
end
- class FromClass < ParentClass
+ stub_named_class('FromClass', superclass) do
has_many :out, :to_classes, type: 'HAS_REL'
end | Figured out how to stub normal classes properly :-/ | neo4jrb_neo4j | train | rb |
0c8a7c1ea3470f1ba647a9ea891b4e0204cc5ac6 | diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
index <HASH>..<HASH> 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
@@ -53,11 +53,6 @@ import static org.apache.flink.util.Preconditions.checkState;
* <p>The RecordWriter wraps the runtime's {@link ResultPartitionWriter} and takes care of
* serializing records into buffers.
*
- * <p><strong>Important</strong>: it is necessary to call {@link #flushAll()} after
- * all records have been written with {@link #emit(IOReadableWritable)}. This
- * ensures that all produced records are written to the output stream (incl.
- * partially filled ones).
- *
* @param <T> the type of the record that can be emitted with this record writer
*/
public abstract class RecordWriter<T extends IOReadableWritable> implements AvailabilityProvider { | [hotfix] Remove outdated description in Javadoc of RecordWriter
This closes #<I> | apache_flink | train | java |
ee3618b25345e30444dba35c7e38fc42200e5cd4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ with open('./README.md', 'r') as file:
# version string
-__version__ = '0.6.5.post1'
+__version__ = '0.6.5.post2'
# set-up script for pip distribution | New distribution [<I>.post2] | JarryShaw_DictDumper | train | py |
11fbd85c99797e4098fd518f73641280d3d7a541 | diff --git a/phy/cluster/manual/session.py b/phy/cluster/manual/session.py
index <HASH>..<HASH> 100644
--- a/phy/cluster/manual/session.py
+++ b/phy/cluster/manual/session.py
@@ -620,6 +620,8 @@ class Session(BaseSession):
@vm.view.connect
def on_draw(event):
+ # OPTIM: put this when the model or the view is closed instead
+ # No need to run this at every draw!
sf = vm.view.box_scale[1] / vm.view.visual.default_box_scale[1]
sf = sf * vm.scale_factor
self.set_internal_settings(sf_name, sf)
diff --git a/phy/cluster/manual/view_model.py b/phy/cluster/manual/view_model.py
index <HASH>..<HASH> 100644
--- a/phy/cluster/manual/view_model.py
+++ b/phy/cluster/manual/view_model.py
@@ -132,6 +132,9 @@ class WaveformViewModel(BaseViewModel):
n = len(clusters)
self.view.visual.cluster_colors = _selected_clusters_colors(n)
+ def on_cluster(self, up):
+ self.view.visual.spike_clusters = self.model.spike_clusters
+
def on_close(self):
self.view.visual.spike_clusters = []
self.view.visual.channel_positions = [] | WIP: update view model on cluster. | kwikteam_phy | train | py,py |
ef2344dd009632e98abc0791fbd36fb908061b6e | diff --git a/lib/MwbExporter/Formatter/Zend/DbTable/Model/Table.php b/lib/MwbExporter/Formatter/Zend/DbTable/Model/Table.php
index <HASH>..<HASH> 100644
--- a/lib/MwbExporter/Formatter/Zend/DbTable/Model/Table.php
+++ b/lib/MwbExporter/Formatter/Zend/DbTable/Model/Table.php
@@ -118,7 +118,7 @@ class Table extends \MwbExporter\Core\Model\Table
// var_dump($dependentTables);
- $return[] = ' /* @var array $_dependentTables ';
+ $return[] = ' /* @var array $_dependentTables */';
$return[] = ' protected $_dependentTables = array();';
$return[] = '';
return implode("\n", $return);
@@ -134,7 +134,7 @@ class Table extends \MwbExporter\Core\Model\Table
{
$return = array();
- $return[] = ' /* @var array $_referenceMap';
+ $return[] = ' /* @var array $_referenceMap */';
if (count($this->getForeignKeys()) > 0) {
$return[] = ' protected $_referenceMap = array('; | Add end comment to the PHPDoc and attributes | mysql-workbench-schema-exporter_mysql-workbench-schema-exporter | train | php |
cbd63a8abc95e9418cc1b4f53c3523f74d942ea4 | diff --git a/atomic_reactor/plugins/pre_fetch_maven_artifacts.py b/atomic_reactor/plugins/pre_fetch_maven_artifacts.py
index <HASH>..<HASH> 100644
--- a/atomic_reactor/plugins/pre_fetch_maven_artifacts.py
+++ b/atomic_reactor/plugins/pre_fetch_maven_artifacts.py
@@ -14,6 +14,7 @@ import os
import requests
from atomic_reactor import util
+from atomic_reactor.constants import DEFAULT_DOWNLOAD_BLOCK_SIZE
from atomic_reactor.koji_util import create_koji_session
from atomic_reactor.plugin import PreBuildPlugin
from collections import namedtuple
@@ -206,7 +207,7 @@ class FetchMavenArtifactsPlugin(PreBuildPlugin):
request = requests.get(download.url, stream=True)
request.raise_for_status()
with open(dest_path, 'wb') as f:
- for chunk in request.iter_content():
+ for chunk in request.iter_content(chunk_size=DEFAULT_DOWNLOAD_BLOCK_SIZE):
f.write(chunk)
for checksum in checksums.values():
checksum.update(chunk) | Increase chunk for fetch_maven_artifacts downloads
By default requests module uses 1 byte chunks when iterating
over streamed content. This is optimal for responsive use
cases, not so much for downloading large files. The chunk size
is now set to <I>Mb to improve throughput. | projectatomic_atomic-reactor | train | py |
5042d60fd6e91a10d6b69efe7baefddf1cbdaa9d | diff --git a/src/kg/apc/jmeter/vizualizers/ChartRowsTable.java b/src/kg/apc/jmeter/vizualizers/ChartRowsTable.java
index <HASH>..<HASH> 100644
--- a/src/kg/apc/jmeter/vizualizers/ChartRowsTable.java
+++ b/src/kg/apc/jmeter/vizualizers/ChartRowsTable.java
@@ -27,6 +27,11 @@ public class ChartRowsTable
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
getTableHeader().setDefaultRenderer(new HeaderAsTextRenderer());
getTableHeader().addMouseListener(new HeaderClickCheckAllListener());
+ getTableHeader().setReorderingAllowed(false);
+ getColumnModel().getColumn(0).setPreferredWidth(100);
+ getColumnModel().getColumn(1).setPreferredWidth(100);
+ getColumnModel().getColumn(2).setPreferredWidth(500);
+
}
private void initializeTableModel() | Fix collumn swaping crash and set size | undera_jmeter-plugins | train | java |
89647036881d77219324b2c3ca6844207e059f43 | diff --git a/Venmo/src/main/java/com/braintreepayments/api/VenmoRequest.java b/Venmo/src/main/java/com/braintreepayments/api/VenmoRequest.java
index <HASH>..<HASH> 100644
--- a/Venmo/src/main/java/com/braintreepayments/api/VenmoRequest.java
+++ b/Venmo/src/main/java/com/braintreepayments/api/VenmoRequest.java
@@ -11,7 +11,7 @@ public class VenmoRequest {
private final @VenmoPaymentMethodUsage int paymentMethodUsage;
/**
- * Request to tokenize an existing Venmo account.
+ * Request to tokenize a Venmo account.
*
* @param paymentMethodUsage {@link VenmoPaymentMethodUsage} for the tokenized Venmo account: either multi-use or single use.
*/
@@ -71,4 +71,3 @@ public class VenmoRequest {
}
}
}
- | Update Venmo/src/main/java/com/braintreepayments/api/VenmoRequest.java | braintree_braintree_android | train | java |
da3e6c62aed644b14505c0f151edf9b119fac95f | diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index <HASH>..<HASH> 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -701,7 +701,7 @@ class X509Req(object):
"""
Get extensions to the request.
- :return: A list of X509Extension objects.
+ :return: A :py:class:`list` of :py:class:`X509Extension` objects.
"""
exts = []
native_exts_obj = _lib.X509_REQ_get_extensions(self._req) | rstify the docstring a little more | pyca_pyopenssl | train | py |
a0d60926488ffcbdc4ecc0c0ccc6e9394cbfd2ee | 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
@@ -404,7 +404,7 @@ end
::ActiveSupport::Deprecation.silenced = false
-Rspec.configure do |config|
+RSpec.configure do |config|
config.before(:all) do
DeferredGarbageCollection.start
end | Rspec => RSpec in spec_helper | justinfrench_formtastic | train | rb |
4c9ef8f90bb116a7303b45e12dee2526e43cf067 | diff --git a/mustache.js b/mustache.js
index <HASH>..<HASH> 100644
--- a/mustache.js
+++ b/mustache.js
@@ -632,7 +632,7 @@
if (tagIndex == 0 && indentation) {
indentedValue = this.indentPartial(value, indentation);
}
- return this.renderTokens(this.parse(indentedValue, tags), context, partials, value);
+ return this.renderTokens(this.parse(indentedValue, tags), context, partials, indentedValue);
}
}; | Bugfix for wrong functions output in partials with indentation (#<I>)
This small change fixes the output of functions used in partials with
indentation. Bug reports has shown that the functions output is shifted
with the amount of indentation the partial has.
The bug itself is best illustrated in the tests added in <I>ae<I>b0ef<I>f5c8f2aab4c5e<I>b0d<I>e.
Closes <URL> | janl_mustache.js | train | js |
da402c5ff7b698fc50c6ef736a4060a62d0f7605 | diff --git a/lib_common/src/d1_common/types/exceptions.py b/lib_common/src/d1_common/types/exceptions.py
index <HASH>..<HASH> 100644
--- a/lib_common/src/d1_common/types/exceptions.py
+++ b/lib_common/src/d1_common/types/exceptions.py
@@ -190,7 +190,7 @@ def _get_trace_information_content(err_pyxb):
try:
return '\n'.join(err_pyxb.traceInformation.content())
except TypeError:
- return d1_common.xml.serialize_to_str(
+ return d1_common.xml.serialize_to_xml_str(
err_pyxb.traceInformation, strip_prolog=True
) | Improve formatting when DataONEException is serialized for display | DataONEorg_d1_python | train | py |
bd595a21aae5ceff4ab783c37a4a40c7f07cc8b2 | diff --git a/src/Models/User.php b/src/Models/User.php
index <HASH>..<HASH> 100644
--- a/src/Models/User.php
+++ b/src/Models/User.php
@@ -80,8 +80,9 @@ class User extends UserRelatableObject
*/
public static function getCurrent()
{
- if (Session::get('user') && Session::get('user') instanceof User) {
- return self::search()->where('user_id', Session::get('user')->user_id)->execOne();
+ $class = get_called_class();
+ if (Session::get('user')) {
+ return $class::search()->where('user_id', Session::get('user')->user_id)->execOne();
}
return false;
} | Support overriding the User object. | Thruio_TigerKit | train | php |
e6fefc6f6e1937b0a45edbdab70a78a7163b9d17 | diff --git a/lib/symmetric/encryption.rb b/lib/symmetric/encryption.rb
index <HASH>..<HASH> 100644
--- a/lib/symmetric/encryption.rb
+++ b/lib/symmetric/encryption.rb
@@ -1,3 +1,4 @@
+# coding: US-ASCII
require 'digest/sha1'
require 'openssl' | Fix build for ruby <I>
[#<I>] | cloudfoundry_loggregator_emitter | train | rb |
8fb54c183aa48ee719cd9b3da9835a9ac21604a6 | diff --git a/danmaku.js b/danmaku.js
index <HASH>..<HASH> 100644
--- a/danmaku.js
+++ b/danmaku.js
@@ -2,6 +2,7 @@
'use strict';
function Danmaku() {
+ this.paused = true;
this.isHide = false;
this.ttl = 4;
this.requestID = 0;
@@ -57,12 +58,14 @@ Danmaku.prototype.init = function(opt) {
return this;
};
Danmaku.prototype.show = function() {
+ if (!this.isHide) return this;
this.isHide = false;
this._seek();
this._play();
return this;
};
Danmaku.prototype.hide = function() {
+ if (this.isHide) return this;
this._pause();
this._clear();
this.isHide = true;
@@ -95,7 +98,8 @@ Danmaku.prototype.emit = function(cmt) {
return this;
};
Danmaku.prototype._play = function() {
- if (this.isHide) return;
+ if (this.isHide || !this.paused) return;
+ this.paused = false;
var that = this;
function check() {
var ct = that.isMedia ?
@@ -150,7 +154,8 @@ Danmaku.prototype._play = function() {
this.requestID = RAF(check);
};
Danmaku.prototype._pause = function() {
- if (this.isHide) return;
+ if (this.isHide || this.paused) return;
+ this.paused = true;
CAF(this.requestID);
this.requestID = 0;
}; | avoid to call two or more requestAnimationFrame() | weizhenye_Danmaku | train | js |
dc15fee8c82948c4fcf0821cfa1fd9979edb181f | diff --git a/chef/lib/chef/application/client.rb b/chef/lib/chef/application/client.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/application/client.rb
+++ b/chef/lib/chef/application/client.rb
@@ -179,8 +179,8 @@ class Chef::Application::Client < Chef::Application
option :enable_reporting,
:short => "-R",
:long => "--enable-reporting",
- :description => "Disable reporting data collection for chef runs",
- :boolean => false
+ :description => "Enable reporting data collection for chef runs",
+ :boolean => true
attr_reader :chef_client_json | Fix description and option type for reporting flag. | chef_chef | train | rb |
ee9f5066ba8618010f1a0e6e92f6e063d033d645 | diff --git a/lib/main.js b/lib/main.js
index <HASH>..<HASH> 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -66,7 +66,7 @@ exports.initialise = exports.initialize = function (scripts, callback) {
});
// when the phantom process connects, we keep the same socket
- // throughout the paginatron life cycle
+ // throughout the ectoplasm life cycle
socketServer.sockets.on("connection", function (socket) {
socketConnection = socket;
socketConnection.on("output", function (id, args) { | fixed comment referring to previous incarnation of this project | andrey-p_ectoplasm-js | train | js |
691e5d262c244532c819a7eac6b598dfa7a8f4dd | diff --git a/fetchSync/client/index.js b/fetchSync/client/index.js
index <HASH>..<HASH> 100644
--- a/fetchSync/client/index.js
+++ b/fetchSync/client/index.js
@@ -145,6 +145,7 @@ function fetchSync_init (options = null) {
.catch((err) => {
hasStartedInit = false
console.warn('fetchSync initialisation failed: ' + err.message)
+ throw err
})
.then(() => commsChannel.promise)
} | Throw err on failed init | sdgluck_fetch-sync | train | js |
8b26f4c88b4275441763b7459c4e7811c9a697d1 | diff --git a/router/routertest/router_test.go b/router/routertest/router_test.go
index <HASH>..<HASH> 100644
--- a/router/routertest/router_test.go
+++ b/router/routertest/router_test.go
@@ -301,12 +301,12 @@ func (s *S) TestAddBackendOpts(c *check.C) {
r := OptsRouter
err := r.AddBackendOpts("myapp", map[string]string{"opt1": "val1"})
c.Assert(err, check.IsNil)
- c.Assert(r.Opts, check.DeepEquals, map[string]string{"opt1": "val1"})
+ c.Assert(r.Opts["myapp"], check.DeepEquals, map[string]string{"opt1": "val1"})
}
func (s *S) TestUpdateBackendOpts(c *check.C) {
r := OptsRouter
err := r.UpdateBackendOpts("myapp", map[string]string{"opt1": "val1"})
c.Assert(err, check.IsNil)
- c.Assert(r.Opts, check.DeepEquals, map[string]string{"opt1": "val1"})
+ c.Assert(r.Opts["myapp"], check.DeepEquals, map[string]string{"opt1": "val1"})
} | router/routertest: fixes opts router test | tsuru_tsuru | train | go |
eb5b269aa1b92120748641f01f4a6a27938ab25e | diff --git a/gnsq/reader.py b/gnsq/reader.py
index <HASH>..<HASH> 100644
--- a/gnsq/reader.py
+++ b/gnsq/reader.py
@@ -487,7 +487,7 @@ class Reader(object):
# first set RDY 0 to all connections that have not received a message
# within a configurable timeframe (low_ready_idle_timeout).
- for conn in self.conns:
+ for conn in list(self.conns):
if conn.ready_count == 0:
continue | Handle changing connections during redistribute ready | wtolson_gnsq | train | py |
972f44d32896aa3e8284f5e793c3f40dc0d62b20 | diff --git a/lib/FrameManager.js b/lib/FrameManager.js
index <HASH>..<HASH> 100644
--- a/lib/FrameManager.js
+++ b/lib/FrameManager.js
@@ -715,7 +715,7 @@ class WaitTask {
}
// Ignore timeouts in pageScript - we track timeouts ourselves.
- if (!error && !(await success.jsonValue())) {
+ if (!error && await this._frame.evaluate(s => !s, success)) {
await success.dispose();
return;
}
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -703,6 +703,9 @@ describe('Page', function() {
it('should return the success value as a JSHandle', async({page}) => {
expect(await (await page.waitForFunction(() => 5)).jsonValue()).toBe(5);
});
+ it('should return the window as a success value', async({ page }) => {
+ expect(await page.waitForFunction(() => window)).toBeTruthy();
+ });
it('should accept ElementHandle arguments', async({page}) => {
await page.setContent('<div></div>');
const div = await page.$('div'); | fix: avoid calling jsonValue from waitFor (#<I>)
If the success value of `waitForFunction` was not serializable, checking whether it was truthy with `.jsonValue()` might fail. Now I check whether it was truthy inside the page.
Fixes #<I>. | GoogleChrome_puppeteer | train | js,js |
ddd8c0c608b881ed721b5c31a865e758c0ed125f | diff --git a/lib/mongoid/associations/has_many.rb b/lib/mongoid/associations/has_many.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/associations/has_many.rb
+++ b/lib/mongoid/associations/has_many.rb
@@ -38,7 +38,7 @@ module Mongoid #:nodoc:
#
# Returns the newly created object.
def build(attributes)
- object = @klass.new(attributes)
+ object = @klass.instantiate(attributes)
object.parentize(@parent, @association_name)
push(object)
object | Build calls instantiate on has many | mongodb_mongoid | train | rb |
8b531ed4240b99c28e4f5c4c74981c26dfde98f2 | diff --git a/lib/rib.rb b/lib/rib.rb
index <HASH>..<HASH> 100644
--- a/lib/rib.rb
+++ b/lib/rib.rb
@@ -16,13 +16,13 @@ module Rib
end
def shell
- @shell ||= begin
- load_rc
+ shells.last || begin
+ require_rc
(shells << Shell.new(config)).last
end
end
- def load_rc
+ def require_rc
config[:config] &&
File.exist?(rc = File.expand_path(config[:config])) &&
require(rc) | fix Rib.shell, which should always refer to the last shell | godfat_rib | train | rb |
4df929234689d4a10bc27edd8e7d95c9fc0dfde4 | diff --git a/components/list/list.js b/components/list/list.js
index <HASH>..<HASH> 100644
--- a/components/list/list.js
+++ b/components/list/list.js
@@ -232,12 +232,9 @@ export default class List extends Component {
}
componentDidUpdate(prevProps) {
- if (prevProps.data !== this.props.data) {
+ if (this.virtualizedList && prevProps.data !== this.props.data) {
this._cache.clearAll();
-
- if (this.virtualizedList) {
- this.virtualizedList.recomputeRowHeights();
- }
+ this.virtualizedList.recomputeRowHeights();
}
this.checkOverflow(); | RG-<I> - code review refactoring | JetBrains_ring-ui | train | js |
3b08dd20f42e7f2bd4b4290aec08c1571262f619 | diff --git a/msg/scratch_msgs.js b/msg/scratch_msgs.js
index <HASH>..<HASH> 100644
--- a/msg/scratch_msgs.js
+++ b/msg/scratch_msgs.js
@@ -7302,7 +7302,7 @@ Blockly.ScratchMsgs.locales["hy"] =
"MOTION_SETX": "x -ը՝ %1 ",
"MOTION_CHANGEYBY": "փոխել y -ը %1 -ով",
"MOTION_SETY": "y -ը՝ %1 ",
- "MOTION_IFONEDGEBOUNCE": "եթե եզին է, հրվել",
+ "MOTION_IFONEDGEBOUNCE": "եթե եզրին է, հրվել",
"MOTION_SETROTATIONSTYLE": "պտույտի ձևը՝ %1",
"MOTION_SETROTATIONSTYLE_LEFTRIGHT": "ձախ-աջ",
"MOTION_SETROTATIONSTYLE_DONTROTATE": "չպտտել", | [skip ci] Update translations from transifex | LLK_scratch-blocks | train | js |
c0687cd5fa118d807f1a7593abc5abbdfbe764f4 | diff --git a/src/Symfony/Component/Routing/RouteCollection.php b/src/Symfony/Component/Routing/RouteCollection.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Routing/RouteCollection.php
+++ b/src/Symfony/Component/Routing/RouteCollection.php
@@ -163,7 +163,10 @@ class RouteCollection implements \IteratorAggregate, \Countable
public function remove($name)
{
// just for BC
- $root = $this->getRoot();
+ $root = $this;
+ while ($root->parent) {
+ $root = $root->parent;
+ }
foreach ((array) $name as $n) {
unset($root->routes[$n]); | remove() should not use deprecated getParent() so it does not trigger deprecation internally | symfony_symfony | train | php |
2cf1c9a30a5fa624cf5c5860c35839f63b5b6453 | diff --git a/lib/app/field_type/date_field_type.js b/lib/app/field_type/date_field_type.js
index <HASH>..<HASH> 100644
--- a/lib/app/field_type/date_field_type.js
+++ b/lib/app/field_type/date_field_type.js
@@ -39,5 +39,6 @@ DateFieldType.setMethod(function cast(value) {
return null;
}
- return (new Date(value)).stripTime();
+ // Leave the time in
+ return Date.create(value);
});
\ No newline at end of file | Don't strip the time from date-only fields | skerit_alchemy | train | js |
e924e7b628bd38ce81c7a047eb1390b6a50eb4c4 | diff --git a/src/python/dxpy/utils/exec_utils.py b/src/python/dxpy/utils/exec_utils.py
index <HASH>..<HASH> 100644
--- a/src/python/dxpy/utils/exec_utils.py
+++ b/src/python/dxpy/utils/exec_utils.py
@@ -300,7 +300,7 @@ class DXExecDependencyInstaller(object):
print(message)
def generate_shellcode(self, dep_group):
- base_apt_shellcode = "apt-get install --yes --no-install-recommends {p}"
+ base_apt_shellcode = "export DEBIAN_FRONTEND=noninteractive && apt-get install --yes --no-install-recommends {p}"
dx_apt_update_shellcode = "apt-get update -o Dir::Etc::sourcelist=sources.list.d/nucleus.list -o Dir::Etc::sourceparts=- -o APT::Get::List-Cleanup=0"
change_apt_archive = r"sed -i -e s?http://.*.ec2.archive.ubuntu.com?http://us.archive.ubuntu.com? /etc/apt/sources.list"
apt_err_msg = "APT failed, retrying with full update against ubuntu.com" | PTFM-<I> Force noninteractive frontend in apt-get | dnanexus_dx-toolkit | train | py |
4d09756f72a161ce4ddeda5702057d3dd20aa568 | diff --git a/qiskit/extensions/standard/s.py b/qiskit/extensions/standard/s.py
index <HASH>..<HASH> 100644
--- a/qiskit/extensions/standard/s.py
+++ b/qiskit/extensions/standard/s.py
@@ -58,7 +58,7 @@ class SdgGate(Gate):
definition = []
q = QuantumRegister(1, "q")
rule = [
- (U1Gate(-pi/2), q[0], [])
+ (U1Gate(-pi/2), [q[0]], [])
]
for inst in rule:
definition.append(inst) | fix sdg definition (#<I>) | Qiskit_qiskit-terra | train | py |
4490f98ad41e7b3d386ba3541fc0394a509404e5 | diff --git a/src/Autosuggest.js b/src/Autosuggest.js
index <HASH>..<HASH> 100644
--- a/src/Autosuggest.js
+++ b/src/Autosuggest.js
@@ -121,7 +121,8 @@ export default class Autosuggest extends Component {
this.suggestionsContainer = this.autowhatever.itemsContainer;
}
- componentWillReceiveProps(nextProps) {
+ // eslint-disable-next-line camelcase, react/sort-comp
+ UNSAFE_componentWillReceiveProps(nextProps) {
if (shallowEqualArrays(nextProps.suggestions, this.props.suggestions)) {
if (
nextProps.highlightFirstSuggestion && | Support React <I> (#<I>)
componentWillReceiveProps => UNSAFE_componentWillReceiveProps | moroshko_react-autosuggest | train | js |
f790ddf5b4f267d1125b274bcc01ea9ffbfa31b4 | diff --git a/spec/unit/startup_spec.rb b/spec/unit/startup_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/startup_spec.rb
+++ b/spec/unit/startup_spec.rb
@@ -265,7 +265,7 @@ RSpec.describe ChefApply::Startup do
expect(ChefApply::Log).to receive(:setup).
with(log_path, log_level)
expect(Chef::Log).to receive(:init).
- with(ChefApply::Log)
+ with(ChefApply::Log.location)
subject.setup_logging
expect(ChefConfig.logger).to eq(ChefApply::Log)
end | Fixed the missing spec to match behaviour | chef_chef-apply | train | rb |
daf252d55d3f59f87b2b07cf6ecbbb80a4273dc5 | diff --git a/zpool.go b/zpool.go
index <HASH>..<HASH> 100644
--- a/zpool.go
+++ b/zpool.go
@@ -1,5 +1,17 @@
package zfs
+// ZFS zpool states, which can indicate if a pool is online, offline,
+// degraded, etc. More information regarding zpool states can be found here:
+// https://docs.oracle.com/cd/E19253-01/819-5461/gamno/index.html.
+const (
+ ZpoolOnline = "ONLINE"
+ ZpoolDegraded = "DEGRADED"
+ ZpoolFaulted = "FAULTED"
+ ZpoolOffline = "OFFLINE"
+ ZpoolUnavail = "UNAVAIL"
+ ZpoolRemoved = "REMOVED"
+)
+
// Zpool is a ZFS zpool. A pool is a top-level structure in ZFS, and can
// contain many descendent datasets.
type Zpool struct { | Add zpool state constants, for easier health checking | mistifyio_go-zfs | train | go |
22e266bd88d9ed3c9d7dc3104811d861943a1c4c | diff --git a/src/main/java/reactor/core/test/TestSubscriber.java b/src/main/java/reactor/core/test/TestSubscriber.java
index <HASH>..<HASH> 100644
--- a/src/main/java/reactor/core/test/TestSubscriber.java
+++ b/src/main/java/reactor/core/test/TestSubscriber.java
@@ -733,8 +733,8 @@ public class TestSubscriber<T> extends DeferredSubscription implements Subscribe
* @return this
*/
public final TestSubscriber<T> assertFusionEnabled() {
- if (establishedFusionMode == Fuseable.SYNC
- || establishedFusionMode == Fuseable.ASYNC) {
+ if (establishedFusionMode != Fuseable.SYNC
+ && establishedFusionMode != Fuseable.ASYNC) {
throw new AssertionError("Fusion was not enabled");
}
return this; | Fix TestSubscriber assertFusionEnabled | reactor_reactor-core | train | java |
4ea310adcfb8fe061faf5acc732522e366dc01b1 | diff --git a/holoviews/core/data/xarray.py b/holoviews/core/data/xarray.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/data/xarray.py
+++ b/holoviews/core/data/xarray.py
@@ -207,6 +207,26 @@ class XArrayInterface(GridInterface):
"for all defined kdims, %s coordinates not found."
% not_found, cls)
+ for vdim in vdims:
+ if packed:
+ continue
+ da = data[vdim.name]
+ # Do not enforce validation for irregular arrays since they
+ # not need to be canonicalized
+ if any(len(da.coords[c].shape) > 1 for c in da.coords):
+ continue
+ undeclared = [
+ c for c in da.coords if c not in kdims and len(da[c].shape) == 1 and
+ da[c].shape[0] > 1]
+ if undeclared:
+ raise DataError(
+ 'The coordinates on the %r DataArray do not match the '
+ 'provided key dimensions (kdims). The following coords '
+ 'were left unspecified: %r. If you are requesting a '
+ 'lower dimensional view such as a histogram cast '
+ 'the xarray to a columnar format using the .to_dataframe '
+ 'or .to_dask_dataframe methods before providing it to '
+ 'HoloViews.' % (vdim.name, undeclared))
return data, {'kdims': kdims, 'vdims': vdims}, {} | Validate dimensionality of xarray interface data (#<I>) | pyviz_holoviews | train | py |
c7cf33cce1b048eee6cef5466ab2d76004da9ce3 | diff --git a/src/SilexAssetic/Assetic/Dumper.php b/src/SilexAssetic/Assetic/Dumper.php
index <HASH>..<HASH> 100644
--- a/src/SilexAssetic/Assetic/Dumper.php
+++ b/src/SilexAssetic/Assetic/Dumper.php
@@ -66,13 +66,12 @@ class Dumper
throw new \LogicException('Twig environment not set');
}
- $finder = new Finder();
$twigNamespaces = $this->loader->getNamespaces();
foreach ($twigNamespaces as $ns) {
if ( count($this->loader->getPaths($ns)) > 0 ) {
- $iterator = $finder->files()->in($this->loader->getPaths($ns));
+ $iterator = Finder::create()->files()->in($this->loader->getPaths($ns));
foreach ($iterator as $file) {
$resource = new TwigResource($this->loader, '@' . $ns . '/' . $file->getRelativePathname()); | Avoid reevaluating namespace paths
Previously each time this method called the finder instance the namespace paths would get appended to the iterator meaning that each time through the loop $iterator would keep growing and referencing paths from the previous loops. | mheap_Silex-Assetic | train | php |
656651817785b865fc6025644b2b57c4c6675b19 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -102,7 +102,7 @@ TransportStream.prototype._write = function _write(info, enc, callback) {
return this.log(transformed, callback);
}
-
+ this._writableState.sync = false;
return callback(null);
}; | Memory leak fix: do not wait `process.nextTick` (#<I>)
Addresses the memory leak identified here:
<URL> | winstonjs_winston-transport | train | js |
d2db4639f2b5eb923d22862e09008d48d4b22a74 | diff --git a/lib/core.js b/lib/core.js
index <HASH>..<HASH> 100644
--- a/lib/core.js
+++ b/lib/core.js
@@ -234,13 +234,13 @@ RECESS.prototype = {
if (this.options.format && this.options.format == 'compact') {
formatter = function (err) {
- that.log(that.path + ':' + err.line + ':' + err.message)
- }
+ that.log(that.path + ':' + err.line + ':' + err.message)
+ }
} else {
formatter = function (err) {
- that.log(err.message)
- err.extract && that.log(err.extract + '\n')
- }
+ that.log(err.message)
+ err.extract && that.log(err.extract + '\n')
+ }
}
// iterate through each definition | Fix indent in closures. | twitter_recess | train | js |
fa0f25693a612561f9d784499f3b2c3d3cc992d8 | diff --git a/peercoin_rpc/peercoin_rpc.py b/peercoin_rpc/peercoin_rpc.py
index <HASH>..<HASH> 100644
--- a/peercoin_rpc/peercoin_rpc.py
+++ b/peercoin_rpc/peercoin_rpc.py
@@ -90,12 +90,7 @@ class Client:
data = json.dumps(batch_data)
response = self.session.post(self.url, data=data).json()
-
- for r in response:
- if r['error'] is not None:
- return 'Request %i failed with error %i: %s' % (r['id'], r['error']['code'], r['error']['message'])
- else:
- return response
+ return response
## RPC methods
### general syntax is req($method, [array_of_parameters]) | return all batch data even if one of many requests returns an error | peercoin_peercoin_rpc | train | py |
92494cd9ed01b12826b2fddb25cde221ea34f155 | diff --git a/peewee.py b/peewee.py
index <HASH>..<HASH> 100644
--- a/peewee.py
+++ b/peewee.py
@@ -2234,6 +2234,9 @@ class CompoundSelectQuery(SelectBase):
if ctx.scope == SCOPE_COLUMN:
return self.apply_column(ctx)
+ # Call parent method to handle any CTEs.
+ super(CompoundSelectQuery, self).__sql__(ctx)
+
outer_parens = ctx.subquery or (ctx.scope == SCOPE_SOURCE)
with ctx(parentheses=outer_parens):
# Should the left-hand query be wrapped in parentheses? | Support CTEs bound to compound queries.
Refs #<I> | coleifer_peewee | train | py |
060f9d4de371027a91ce892831bb5f39864dbe75 | diff --git a/tests/UuidTypeTest.php b/tests/UuidTypeTest.php
index <HASH>..<HASH> 100644
--- a/tests/UuidTypeTest.php
+++ b/tests/UuidTypeTest.php
@@ -63,6 +63,18 @@ class UuidTypeTest extends TestCase
}
/**
+ * @covers Ramsey\Uuid\Doctrine\UuidType::convertToDatabaseValue
+ */
+ public function testUuidStringConvertsToDatabaseValue()
+ {
+ $uuid = 'ff6f8cb0-c57d-11e1-9b21-0800200c9a66';
+
+ $actual = $this->type->convertToDatabaseValue($uuid, $this->platform);
+
+ $this->assertEquals($uuid, $actual);
+ }
+
+ /**
* @expectedException Doctrine\DBAL\Types\ConversionException
* @covers Ramsey\Uuid\Doctrine\UuidType::convertToDatabaseValue
*/ | assert a string can still be converted to database value | ramsey_uuid-doctrine | train | php |
c278ff0d51b73b5e0ee399a4aa6b40b575a1ecd2 | diff --git a/lib/EarthIT/CMIPREST/RESTer.php b/lib/EarthIT/CMIPREST/RESTer.php
index <HASH>..<HASH> 100644
--- a/lib/EarthIT/CMIPREST/RESTer.php
+++ b/lib/EarthIT/CMIPREST/RESTer.php
@@ -585,7 +585,7 @@ class EarthIT_CMIPREST_RESTer
}
if( $matches ) {
if( $this->keyByIds ) {
- $relations[$k] =& $relevantRestObjects[$path][$tk];
+ $relations[$tk] =& $relevantRestObjects[$path][$tk];
} else {
$relations[] =& $relevantRestObjects[$path][$tk];
} | Fix nested search result assembly when keyByIds = true. | EarthlingInteractive_PHPCMIPREST | train | php |
853752327f9f9df59e8570c42607c34bc17e4a01 | diff --git a/email_reader.php b/email_reader.php
index <HASH>..<HASH> 100644
--- a/email_reader.php
+++ b/email_reader.php
@@ -40,12 +40,18 @@ class Email_Reader
}
}
- // move the message to a new folder
- function move($uid, $folder = 'INBOX.Processed')
+ // move the message to a folder
+ function move($uid, $folder)
{
- if ( imap_mail_move($this->stream, $uid, $folder, CP_UID) ) {
- imap_expunge($this->stream);
- return true;
+ $tries = 0;
+
+ while ( $tries++ < 3 ) {
+ if ( imap_mail_move($this->stream, $uid, $folder, CP_UID) ) {
+ imap_expunge($this->stream);
+ return true;
+ } else {
+ sleep(1);
+ }
}
return false; | introduce retries if imap mail move does not succeed. also make mandatory to specify folder; nothing is assumed. | optimumweb_php-email-reader-parser | train | php |
429790245c57ab5eab7865ef75160c8e88a6dfad | diff --git a/lib/deferred.js b/lib/deferred.js
index <HASH>..<HASH> 100644
--- a/lib/deferred.js
+++ b/lib/deferred.js
@@ -63,7 +63,7 @@ end = function (handler) {
module.exports = deferred = function () {
var o = {
pending: [],
- timeout: setTimeout(noop, Infinity)
+ timeout: setTimeout(noop, 1e13)
};
((o.promise = then.bind(o)).then = o.promise).end = end.bind(o); | Fix for <I>x - <I>.x node.js branch | medikoo_deferred | train | js |
00c7e91182fb3e6995d8b208ac5bd9f3429cf81a | diff --git a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
+++ b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
@@ -71,8 +71,7 @@ class ExceptionListener
'_controller' => $this->controller,
'exception' => $flattenException,
'logger' => $logger,
- // when using CLI, we force the format to be TXT
- 'format' => 0 === strncasecmp(PHP_SAPI, 'cli', 3) ? 'txt' : $request->getRequestFormat(),
+ 'format' => $request->getRequestFormat(),
);
$request = $request->duplicate(null, null, $attributes); | [HttpKernel] removed special case when using the CLI
* This special case means that functional tests run from the CLI behave differently
* It means that web servers created in PHP behave differently | symfony_symfony | train | php |
ac3377a6fde0b1132a454ad664a8dc3b470a61f8 | diff --git a/Classes/ErrorHandling/FileStorage.php b/Classes/ErrorHandling/FileStorage.php
index <HASH>..<HASH> 100644
--- a/Classes/ErrorHandling/FileStorage.php
+++ b/Classes/ErrorHandling/FileStorage.php
@@ -20,7 +20,6 @@ use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\RuntimeException;
*/
class FileStorage implements ErrorStorageInterface
{
-
public function __construct()
{
if (!file_exists(FLOW_PATH_DATA . 'Logs/Elasticsearch')) {
@@ -37,7 +36,6 @@ class FileStorage implements ErrorStorageInterface
*/
public function logErrorResult(array $errorResult): string
{
-
$referenceCode = date('YmdHis', $_SERVER['REQUEST_TIME']) . substr(md5((string)rand()), 0, 6);
$filename = FLOW_PATH_DATA . 'Logs/Elasticsearch/' . $referenceCode . '.txt';
@@ -61,5 +59,4 @@ class FileStorage implements ErrorStorageInterface
$error = json_encode($errorResult, JSON_PRETTY_PRINT);
return sprintf("Error:\n=======\n\n%s\n\n", $error);
}
-
} | TASJ: Fix CGL issues | Flowpack_Flowpack.ElasticSearch.ContentRepositoryAdaptor | train | php |
5707c0b78bec470a536c3d1638ac0e95294bf758 | diff --git a/samples/processing_citygml/splitting_features/src/SplittingFeature.java b/samples/processing_citygml/splitting_features/src/SplittingFeature.java
index <HASH>..<HASH> 100644
--- a/samples/processing_citygml/splitting_features/src/SplittingFeature.java
+++ b/samples/processing_citygml/splitting_features/src/SplittingFeature.java
@@ -129,27 +129,22 @@ public class SplittingFeature {
String prefix = "ID_";
String defaultPrefix = prefix;
- @Override
public String generateUUID() {
return prefix + (++counter);
}
- @Override
public String getDefaultPrefix() {
return defaultPrefix;
}
- @Override
public String getPrefix() {
return prefix;
}
- @Override
public void setPrefix(String prefix) {
this.prefix = prefix;
}
- @Override
public String generateUUID(String prefix) {
return prefix + (++counter);
} | made sample class SplittingFeature.java Java5 compliant | citygml4j_citygml4j | train | java |
1811465abbd7246c2d0354214fde8164a814383d | diff --git a/lib/linguist/generated.rb b/lib/linguist/generated.rb
index <HASH>..<HASH> 100644
--- a/lib/linguist/generated.rb
+++ b/lib/linguist/generated.rb
@@ -67,6 +67,7 @@ module Linguist
compiled_cython_file? ||
generated_protocol_buffer_go? ||
generated_protocol_buffer? ||
+ generated_apache_thrift? ||
generated_jni_header? ||
vcr_cassette?
end
@@ -248,6 +249,13 @@ module Linguist
return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
end
+
+ # Internal: Is the blob generated by Apache Thrift compiler?
+ #
+ # Returns true or false
+ def generated_apache_thrift?
+ return lines[0].include?("Autogenerated by Thrift Compiler") || lines[1].include?("Autogenerated by Thrift Compiler")
+ end
# Internal: Is the blob a C/C++ header generated by the Java JNI tool javah?
# | Add Apache thrift support to generated? check | github_linguist | train | rb |
e1e54e937889de785d9d7cbe6cbb363725c94560 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,9 +9,9 @@ except:
from distutils.core import setup
MAJOR = 0
-MINOR = 1
+MINOR = 2
MICRO = 0
-ISRELEASED = True
+ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = '' | Change setup.py version to <I>-dev | pydata_xarray | train | py |
77f697986938537d985591746179bc6a5ad1d0b8 | diff --git a/bcbio/variation/freebayes.py b/bcbio/variation/freebayes.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/freebayes.py
+++ b/bcbio/variation/freebayes.py
@@ -107,7 +107,7 @@ def _run_freebayes_paired(align_bams, items, ref_file, assoc_files,
# reads in the germline to call somatic) is not used as it is
# too stringent
compress_cmd = "| bgzip -c" if out_file.endswith("gz") else ""
- cl = ("{freebayes} --pooled-discrete --pvar 0.7"
+ cl = ("{freebayes} --pooled-discrete"
" --genotype-qualities {opts} {paired.tumor_bam}"
" {paired.normal_bam} | {vcfsamplediff} VT"
" {paired.normal_name} {paired.tumor_name}" | Remove the pvar option, let hard filtering do the selection (like germline calling) | bcbio_bcbio-nextgen | train | py |
bca915eaed38bf161b27517d950fb976d7a8788c | diff --git a/src/core/utils/index.js b/src/core/utils/index.js
index <HASH>..<HASH> 100644
--- a/src/core/utils/index.js
+++ b/src/core/utils/index.js
@@ -201,6 +201,17 @@ export const debounce = (fn: () => any, wait: number = 0, immediate: boolean = f
};
};
+export const appendRule = (rule, rules) => {
+ if (typeof rules === 'string') {
+ return `${rules}|${rule}`;
+ }
+
+ return {
+ ...rules,
+ ...normalizeRules(rule)
+ };
+};
+
/**
* Normalizes the given rules expression.
*/ | added a rule append utility function | baianat_vee-validate | train | js |
ffe18e05049eb816a4b910d369106ec8cc88579c | diff --git a/dp_tornado/engine/cache.py b/dp_tornado/engine/cache.py
index <HASH>..<HASH> 100644
--- a/dp_tornado/engine/cache.py
+++ b/dp_tornado/engine/cache.py
@@ -570,6 +570,8 @@ class Decorator(object):
if not identifier:
identifier = _engine_.helper.datetime.mtime()
self._cache(identifier_key, identifier)
+ else:
+ identifier = identifier['val']
return identifier | fixed identifier duplicated issue. | why2pac_dp-tornado | train | py |
1c9a69930a60c051caebe17181066f44c4c4b541 | diff --git a/bokeh/plot_object.py b/bokeh/plot_object.py
index <HASH>..<HASH> 100644
--- a/bokeh/plot_object.py
+++ b/bokeh/plot_object.py
@@ -12,6 +12,7 @@ from six import add_metaclass, iteritems
from six.moves.urllib.parse import urlsplit
from .properties import HasProps, MetaHasProps, Instance
+from .utils import get_ref, convert_references, dump
class Viewable(MetaHasProps):
""" Any plot object (Data Model) which has its own View Model in the
@@ -247,7 +248,13 @@ class PlotObject(HasProps):
attrs = self.vm_props()
attrs['id'] = self._id
return attrs
-
+
+ def dump(self, docid=None):
+ """convert all references to json
+ """
+ models = self.references()
+ return dump(models, docid=docid)
+
def update(self, **kwargs):
for k,v in kwargs.items():
setattr(self, k, v) | forgot to add dump to plot_object | bokeh_bokeh | train | py |
f8c66037e8ceb40f73faa14b4892d2108c91aa1e | diff --git a/lib/vault.rb b/lib/vault.rb
index <HASH>..<HASH> 100644
--- a/lib/vault.rb
+++ b/lib/vault.rb
@@ -12,7 +12,7 @@ module Vault
end
def latest_index
- Version.latest.map(&:to_index)
+ Version.latest.release.map(&:to_index)
end
def prerelease_index | latest_specs index should only have release versions | rubygems_rubygems.org | train | rb |
85711a6d7be38d4bc97cfc8dbbb74c97a3cf6283 | diff --git a/src/Franzose/ClosureTable/Generators/stubs/migrations/entity.php b/src/Franzose/ClosureTable/Generators/stubs/migrations/entity.php
index <HASH>..<HASH> 100644
--- a/src/Franzose/ClosureTable/Generators/stubs/migrations/entity.php
+++ b/src/Franzose/ClosureTable/Generators/stubs/migrations/entity.php
@@ -12,6 +12,7 @@ class {{entity_class}} extends Migration {
$table->integer('parent_id')->unsigned();
$table->integer('position', false, true);
$table->integer('real_depth', false, true);
+ $table->softDeletes();
$table->foreign('parent_id')->references('id')->on('{{entity_table}}');
}); | added deleted_at column to stub to match the Entity softDeletes property | soda-framework_eloquent-closure | train | php |
79ba5ff40924dc8da69b8d3441f2dcb4607185cb | diff --git a/src/defaults.js b/src/defaults.js
index <HASH>..<HASH> 100644
--- a/src/defaults.js
+++ b/src/defaults.js
@@ -6,12 +6,12 @@ exports.host = 'ws.pusherapp.com';
exports.ws_port = 80;
exports.wss_port = 443;
// DEPRECATED: SockJS fallback parameters
-exports.sockjs_host = 'sockjs.exports.com';
+exports.sockjs_host = 'sockjs.pusher.com';
exports.sockjs_http_port = 80;
exports.sockjs_https_port = 443;
exports.sockjs_path = "/pusher";
// DEPRECATED: Stats
-exports.stats_host = 'stats.exports.com';
+exports.stats_host = 'stats.pusher.com';
// DEPRECATED: Other settings
exports.channel_auth_endpoint = '/pusher/auth';
exports.channel_auth_transport = 'ajax'; | Set default hosts to the pusher.com cluster | pusher_pusher-js | train | js |
8870a78489600831b599ffa0c225b6caa5f1bdc0 | diff --git a/src/Helper/Route/Route.php b/src/Helper/Route/Route.php
index <HASH>..<HASH> 100644
--- a/src/Helper/Route/Route.php
+++ b/src/Helper/Route/Route.php
@@ -84,6 +84,8 @@ class Route implements ViewHelperInterface
$uri = $this->uri();
$originalRequest = $this->environment->getRequest();
+ $originalMatchedRouteName = $this->environment->getMatchedRouteName();
+ $originalMatchedRouteParams = $this->environment->getMatchedRouteParams();
$post = $_POST;
$_POST = [];
@@ -106,6 +108,8 @@ class Route implements ViewHelperInterface
$response = $this->dispatcher->dispatch($request, new Response(), $suppressErrors);
$this->environment->setRequest($originalRequest);
+ $this->environment->setMatchedRouteName($originalMatchedRouteName);
+ $this->environment->setMatchedRouteParams($originalMatchedRouteParams);
$_POST = $post;
$_GET = $get; | hmvc: recover matched route name and params after sub request is done | gobline_view | train | php |
036df84af35e406663196c11aa698d48e0179a08 | diff --git a/wal_e/wal_e.py b/wal_e/wal_e.py
index <HASH>..<HASH> 100755
--- a/wal_e/wal_e.py
+++ b/wal_e/wal_e.py
@@ -443,10 +443,12 @@ class S3Backup(object):
is_cluster_toplevel = (os.path.abspath(root) ==
os.path.abspath(pg_cluster_dir))
- # Don't care about WAL, only heap.
+ # Do not capture any WAL files, although we do want to
+ # capture the WAL directory or symlink
if is_cluster_toplevel:
if 'pg_xlog' in dirnames:
dirnames.remove('pg_xlog')
+ matches.append(os.path.join(root, 'pg_xlog'))
for filename in filenames:
if is_cluster_toplevel and filename in ('postmaster.pid', | Capture WAL directory or symlink in a tar (but not contents)
Per GH-2 | wal-e_wal-e | train | py |
bc2382babcd220046347078896c4c8e1dca83b9e | diff --git a/src/test/org/openscience/cdk/modulesuites/MstandardTests.java b/src/test/org/openscience/cdk/modulesuites/MstandardTests.java
index <HASH>..<HASH> 100644
--- a/src/test/org/openscience/cdk/modulesuites/MstandardTests.java
+++ b/src/test/org/openscience/cdk/modulesuites/MstandardTests.java
@@ -36,6 +36,7 @@ import org.openscience.cdk.fingerprint.GraphOnlyFingerprinterTest;
import org.openscience.cdk.fingerprint.HybridizationFingerprinterTest;
import org.openscience.cdk.geometry.BondToolsTest;
import org.openscience.cdk.geometry.CrystalGeometryToolsTest;
+import org.openscience.cdk.geometry.volume.VABCVolumeTest;
import org.openscience.cdk.graph.BFSShortestPathTest;
import org.openscience.cdk.graph.BiconnectivityInspectorTest;
import org.openscience.cdk.graph.ConnectivityCheckerTest;
@@ -186,7 +187,7 @@ import org.openscience.cdk.validate.ProblemMarkerTest;
CDKHueckelAromaticityDetectorTest.class,
HOSECodeGeneratorTest.class,
LonePairElectronCheckerTest.class ,
- StereoToolTest.class
-
+ StereoToolTest.class,
+ VABCVolumeTest.class
})
public class MstandardTests {} | Run the tests as part of the full test suite | cdk_cdk | train | java |
ec6f8264bf84f139369e782312dbd8a7f7925e3f | diff --git a/builder/googlecompute/step_create_windows_password.go b/builder/googlecompute/step_create_windows_password.go
index <HASH>..<HASH> 100644
--- a/builder/googlecompute/step_create_windows_password.go
+++ b/builder/googlecompute/step_create_windows_password.go
@@ -13,6 +13,7 @@ import (
"os"
"time"
+ commonhelper "github.com/hashicorp/packer/helper/common"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
)
@@ -112,6 +113,7 @@ func (s *StepCreateWindowsPassword) Run(_ context.Context, state multistep.State
}
state.Put("winrm_password", data.password)
+ commonhelper.SetSharedState("winrm_password", data.password)
return multistep.ActionContinue
} | fix winrm password access in google compute | hashicorp_packer | train | go |
c645c060c4f381902c2005eefe5b3a7bfa63cdcc | diff --git a/lib/reporter.js b/lib/reporter.js
index <HASH>..<HASH> 100644
--- a/lib/reporter.js
+++ b/lib/reporter.js
@@ -49,7 +49,12 @@ var createReporters = function(names, config, emitter, injector) {
try {
reporters.push(injector.createChild([locals], ['reporter:' + name]).get('reporter:' + name));
} catch(e) {
- log.warn('Reporter "%s" is not registered!', name);
+ if (e.message.indexOf('No provider for "reporter:' + name + '"') !== -1) {
+ log.warn('Can not load "%s", it is not registered!\n ' +
+ 'Perhaps you are missing some plugin?', name);
+ } else {
+ log.warn('Can not load "%s"!\n ' + e.stack, name);
+ }
}
}); | fix(reporter): better errors when loading reporters | karma-runner_karma | train | js |
291e99c0aefeed995056fe481c7bb15fa8ded30e | diff --git a/test/e2e/lib/gutenberg/gutenberg-editor-component.js b/test/e2e/lib/gutenberg/gutenberg-editor-component.js
index <HASH>..<HASH> 100644
--- a/test/e2e/lib/gutenberg/gutenberg-editor-component.js
+++ b/test/e2e/lib/gutenberg/gutenberg-editor-component.js
@@ -239,7 +239,7 @@ export default class GutenbergEditorComponent extends AsyncBaseContainer {
}
async ensureSaved() {
- await driverHelper.clickIfPresent( this.driver, By.css( '.editor-post-save-draft' ) );
+ await driverHelper.clickWhenClickable( this.driver, By.css( '.editor-post-save-draft' ) );
const savedSelector = By.css( 'span.is-saved' );
return await driverHelper.waitTillPresentAndDisplayed( this.driver, savedSelector ); | Change click method (#<I>) | Automattic_wp-calypso | train | js |
c922299fafaffe029224d9b24da26a43e8ab6272 | diff --git a/lib/youtube-dl/video.rb b/lib/youtube-dl/video.rb
index <HASH>..<HASH> 100644
--- a/lib/youtube-dl/video.rb
+++ b/lib/youtube-dl/video.rb
@@ -51,7 +51,7 @@ module YoutubeDL
#
# @return [Hash] metadata information
def information
- @information || get_information
+ @information ||= get_information
end
# Method missing for pulling metadata from @information
@@ -61,8 +61,8 @@ module YoutubeDL
# @param block [Proc] implicit block given
# @return [Object] the value of method in the metadata store
def method_missing(method, *args, &block)
- if information.has_key? method
- information.fetch(method)
+ if @information.has_key? method
+ @information.fetch(method)
else
super
end | Trying to not get too yo dawg | layer8x_youtube-dl.rb | train | rb |
4854f6a8848edc524fed86f0f4c6065ffb96fa2e | diff --git a/identify/extensions.py b/identify/extensions.py
index <HASH>..<HASH> 100644
--- a/identify/extensions.py
+++ b/identify/extensions.py
@@ -96,6 +96,7 @@ EXTENSIONS = {
'proto': {'text', 'proto'},
'purs': {'text', 'purescript'},
'py': {'text', 'python'},
+ 'pyi': {'text', 'pyi'},
'r': {'text', 'r'},
'rb': {'text', 'ruby'},
'rs': {'text', 'rust'}, | Identify PEP<I> pyi stubs | chriskuehl_identify | train | py |
e0e0560799e2f147db93bd3a59f3ae0ddf9f4452 | diff --git a/spec/routine_spec.rb b/spec/routine_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/routine_spec.rb
+++ b/spec/routine_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
-describe Routine do
+describe Lev::Routine do
-end
\ No newline at end of file
+end | Fix NameError: uninitialized constant Routine in routine_spec.rb | lml_lev | train | rb |
43df6be7258ee440fcbed99afeef45db14f828ac | diff --git a/lib/avocado/controller.rb b/lib/avocado/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/avocado/controller.rb
+++ b/lib/avocado/controller.rb
@@ -13,7 +13,7 @@ module Avocado
end
def documentable?
- !!JSON.parse(response.body) || response.body.empty?
+ response.body.empty? || !!JSON.parse(response.body)
rescue
false
end | Checking empty body first to shortcircuit the || operator to not throw an exception | metova_avocado | train | rb |
a17ed28e682ca0e9d4876423ac0d9aec1b9047bd | diff --git a/lib/bolt/version.rb b/lib/bolt/version.rb
index <HASH>..<HASH> 100644
--- a/lib/bolt/version.rb
+++ b/lib/bolt/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Bolt
- VERSION = '3.7.0'
+ VERSION = '3.7.1'
end | (GEM) update bolt version to <I> | puppetlabs_bolt | train | rb |
0b69018ff0e0dc3ebceaf7f35fe92543ac54f653 | diff --git a/salt/modules/apt.py b/salt/modules/apt.py
index <HASH>..<HASH> 100644
--- a/salt/modules/apt.py
+++ b/salt/modules/apt.py
@@ -268,7 +268,7 @@ def list_pkgs(regex_string=""):
# If ret is empty at this point, check to see if the package is virtual.
# We also need aptitude past this point.
if not ret and __salt__['cmd.has_exec']('aptitude'):
- cmd = ('aptitude search "{} ?virtual ?reverse-provides(?installed)"'
+ cmd = ('aptitude search "{0} ?virtual ?reverse-provides(?installed)"'
.format(regex_string))
out = __salt__['cmd.run_stdout'](cmd) | {} in .format() is only valid in <I>, it seems | saltstack_salt | train | py |
479fe51454409dadfa23bb9af7b76ffc22af9a93 | diff --git a/protocols/raft/src/test/java/io/atomix/protocols/raft/storage/log/AbstractLogTest.java b/protocols/raft/src/test/java/io/atomix/protocols/raft/storage/log/AbstractLogTest.java
index <HASH>..<HASH> 100644
--- a/protocols/raft/src/test/java/io/atomix/protocols/raft/storage/log/AbstractLogTest.java
+++ b/protocols/raft/src/test/java/io/atomix/protocols/raft/storage/log/AbstractLogTest.java
@@ -94,6 +94,7 @@ public abstract class AbstractLogTest {
.withMaxEntriesPerSegment(MAX_ENTRIES_PER_SEGMENT)
.withMaxSegmentSize(MAX_SEGMENT_SIZE)
.withIndexDensity(.2)
+ .withCacheSize(1)
.build();
} | Use a single cached entry in Raft log tests. | atomix_atomix | train | java |
e099608b4ef7eebb867dad9d23ba0e49aff27d02 | diff --git a/djangocms_installer/main.py b/djangocms_installer/main.py
index <HASH>..<HASH> 100644
--- a/djangocms_installer/main.py
+++ b/djangocms_installer/main.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
import logging
+import os
+import shutil
import six
import sys
@@ -40,6 +42,9 @@ def execute():
print("Get into '%s' directory and type 'python manage.py runserver' "
"to start your project" % config_data.project_directory)
except Exception as e:
+ # Clean up your own mess
+ if os.path.exists(config_data.project_directory):
+ shutil.rmtree(config_data.project_directory)
if six.PY3:
tb = sys.exc_info()[2]
raise EnvironmentError("%s\nDocumentation available at http://djangocms-installer.rtfd.org" % e).with_traceback(tb) | Remove created project dir if something goes wrong. | nephila_djangocms-installer | train | py |
817d1e8124599208992f86a9f99a69fa756edb0c | diff --git a/tools/dev-doctor/rootcmd.go b/tools/dev-doctor/rootcmd.go
index <HASH>..<HASH> 100644
--- a/tools/dev-doctor/rootcmd.go
+++ b/tools/dev-doctor/rootcmd.go
@@ -187,7 +187,8 @@ func rootCmdRun(cmd *cobra.Command, args []string) {
ifNotFound: checkError,
versionArgs: []string{"--version"},
versionRegexp: regexp.MustCompile(`hub\s+version\s+(\d+.\d+\.\d+)`),
- minVersion: &semver.Version{Major: 2, Minor: 0, Patch: 0},
+ minVersion: &semver.Version{Major: 2, Minor: 14, Patch: 0},
+ hint: `Download the latest version from https://github.com/github/hub/releases.`,
},
&envVarCheck{
name: "GITHUB_TOKEN", | dev-doctor: Bump minimum hub version requirement for backporting
Backporting scripts need a version of github.com/github/hub that support
the api command. The version of hub distributed with Ubuntu <I> LTS is
<I>, which is too old. Bump the minimum hub version to <I> as this is
definitely new enough and was released <I> months ago. | cilium_cilium | train | go |
016d348af743d127466c7d149b28964d11f40d0d | diff --git a/openquake/calculators/risk/scenario_damage/core.py b/openquake/calculators/risk/scenario_damage/core.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/risk/scenario_damage/core.py
+++ b/openquake/calculators/risk/scenario_damage/core.py
@@ -28,7 +28,7 @@ from openquake import logs
from openquake.calculators.risk import general
from openquake import kvs
from openquake.db.models import Output, FragilityModel, DmgDistPerAsset
-from openquake.db.models import ExposureData, DmgDistPerAssetData
+from openquake.db.models import DmgDistPerAssetData
from openquake.db.models import inputs4job
from django.contrib.gis import geos
@@ -99,8 +99,6 @@ class ScenarioDamageRiskCalculator(general.BaseRiskCalculator):
output_type="dmg_dist_per_asset")
[dds] = DmgDistPerAsset.objects.filter(output=output)
- [em_input] = inputs4job(oq_job.id, input_type="exposure")
- [em] = em_input.exposuremodel_set.all()
lss = list(fm.lss) | Deleted useless queries
Former-commit-id: <I>efb<I>a7b<I>a<I>ac<I>a3dac<I> | gem_oq-engine | train | py |
832d2c40df31db7dd6b679b85644089518810638 | diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -610,7 +610,7 @@ module ActionDispatch
if app.respond_to?(:railtie_name)
app.railtie_name
else
- class_name = app.class.is_a?(Class) ? app.name : app.class.name
+ class_name = app.is_a?(Class) ? app.name : app.class.name
ActiveSupport::Inflector.underscore(class_name).tr("/", "_")
end
end | we should be checking if the app is a class
Hopefully `object.class` always returns something that is_a?(Class), so
the previous logic didn't really make sense. | rails_rails | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.