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
|
---|---|---|---|---|---|
b65163d3f1576233f90b9e3cc897a8333bbe5440 | diff --git a/pyoram/tree/virtualheap.py b/pyoram/tree/virtualheap.py
index <HASH>..<HASH> 100644
--- a/pyoram/tree/virtualheap.py
+++ b/pyoram/tree/virtualheap.py
@@ -1,7 +1,9 @@
import os
+import sys
import subprocess
import random
import string
+import tempfile
from six.moves import range
@@ -386,18 +388,20 @@ class SizedVirtualHeap(VirtualHeap):
import os
if not filename.endswith('.pdf'):
filename = filename+'.pdf'
- with open('%s.dot' % filename, 'w') as f:
+ tmpfd, tmpname = tempfile.mkstemp(suffix='dot')
+ with open(tmpname, 'w') as f:
self.WriteAsDot(f, data=data, max_levels=max_levels)
+ os.close(tmpfd)
try:
subprocess.call(['dot',
- ('%s.dot'%filename),
+ tmpname,
'-Tpdf',
'-o',
('%s'%filename)])
except OSError:
sys.stderr.write(
"DOT -> PDF conversion failed. See DOT file: %s\n"
- % (filename+".dot"))
+ % (tmpname))
return False
- os.remove('%s.dot' % (filename))
+ os.remove(tmpname)
return True | more fixes for when dot is not available | ghackebeil_PyORAM | train | py |
4497a35b0df68efb2ba9c9eade65073f532c20e2 | diff --git a/src/Session.php b/src/Session.php
index <HASH>..<HASH> 100644
--- a/src/Session.php
+++ b/src/Session.php
@@ -293,13 +293,22 @@ class Session
* @return bool
* @throws Exceptions\CapabilityUnavailable
*/
- public function Disconnect()
+ public function Logout()
{
- $response = $this->request('Logout');
+ $this->request('Logout');
return true;
}
/**
+ * @return bool
+ * @throws Exceptions\CapabilityUnavailable
+ */
+ public function Disconnect()
+ {
+ return $this->Logout();
+ }
+
+ /**
* @param $capability
* @param array $options
* @param bool $is_retry | add Logout method to match RETS spec (#<I>) | troydavisson_PHRETS | train | php |
ff2b9fb09d6cb848a0ce035c8aa7ee16bbc99044 | diff --git a/src/python/approxeng/input/__init__.py b/src/python/approxeng/input/__init__.py
index <HASH>..<HASH> 100644
--- a/src/python/approxeng/input/__init__.py
+++ b/src/python/approxeng/input/__init__.py
@@ -247,7 +247,7 @@ class Controller(object):
def check_presses(self):
"""
Return the set of Buttons which have been pressed since this call was last made, clearing it as we do. This is
- a shortcut do doing 'buttons.get_and_clear_button_press_history'
+ a shortcut to doing 'buttons.get_and_clear_button_press_history'
:return:
A ButtonPresses instance which contains buttons which were pressed since this call was last made. | Fix small typo in ControllerStream's check_presses: do doing -> to doing | ApproxEng_approxeng.input | train | py |
a55b6e09fe4d84a5901842d48adfd1ad6ea28b44 | diff --git a/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java b/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java
+++ b/src/main/java/org/codehaus/groovy/reflection/ParameterTypes.java
@@ -268,7 +268,8 @@ public class ParameterTypes {
return false;
for (int i = 0; i < size; i++) {
- if (args[i] != null && !parameterTypes[i].isAssignableFrom(args[i].getClass())) {
+ final Object arg = args[i];
+ if (arg != null && !parameterTypes[i].isAssignableFrom(arg.getClass())) {
return false;
}
}
@@ -283,7 +284,8 @@ public class ParameterTypes {
return false;
for (int i = 0; i < size; i++) {
- if (args[i] != null && !parameterTypes[i].isAssignableFrom(args[i])) {
+ final Class arg = args[i];
+ if (arg != null && !parameterTypes[i].isAssignableFrom(arg)) {
return false;
}
} | Trivial refactoring: extract variables | apache_groovy | train | java |
1f13bba90a843668d733c0d5c9168b1b15643025 | diff --git a/commands/pr.go b/commands/pr.go
index <HASH>..<HASH> 100644
--- a/commands/pr.go
+++ b/commands/pr.go
@@ -8,13 +8,14 @@ import (
"github.com/github/hub/utils"
)
-var cmdPr = &Command{
- Run: pr,
- Usage: "pr <PULLREQ-NUMBER> [<BRANCH>]",
- Long: `Check out the head of a pull request as a local branch.
+var (
+ cmdPr = &Command{
+ Run: pr,
+ Usage: "pr checkout <PULLREQ-NUMBER> [<BRANCH>]",
+ Long: `Check out the head of a pull request as a local branch.
## Examples:
- $ hub pr 73
+ $ hub pr checkout 73
> git fetch origin pull/73/head:jingweno-feature
> git checkout jingweno-feature
@@ -22,10 +23,17 @@ var cmdPr = &Command{
hub-merge(1), hub(1), hub-checkout(1)
`,
-}
+ }
+
+ cmdCheckoutPr = &Command{
+ Key: "checkout",
+ Run: pr,
+ }
+)
func init() {
CmdRunner.Use(cmdPr)
+ cmdPr.Use(cmdCheckout)
}
func pr(command *Command, args *Args) { | Make a "hub pr checkout" subcommand
WARNINGS:
* Entirely untested
* "hub pr" currently works as a synonym for "hub checkout", it should
do something else | github_hub | train | go |
7f98e8bec8e88f9be8d0569d53b4f5cb470ea2bc | diff --git a/lib/fabrication/syntax/make.rb b/lib/fabrication/syntax/make.rb
index <HASH>..<HASH> 100644
--- a/lib/fabrication/syntax/make.rb
+++ b/lib/fabrication/syntax/make.rb
@@ -29,18 +29,4 @@ module Fabrication
end
end
-if Object.const_defined?("Sequel")
- Sequel::Model.extend Fabrication::Syntax::Make
-end
-
-if Object.const_defined?("ActiveRecord")
- ActiveRecord::Base.extend Fabrication::Syntax::Make
-end
-
-if Object.const_defined?("Mongoid")
- module Mongoid::Document
- def self.included(base)
- base.send :extend, Fabrication::Syntax::Make
- end
- end
-end
+Object.extend Fabrication::Syntax::Make | Extend Object with make syntax support | paulelliott_fabrication | train | rb |
41586b1e8f61e42b613b679ffd4ee945bee96607 | diff --git a/scriptine/__init__.py b/scriptine/__init__.py
index <HASH>..<HASH> 100644
--- a/scriptine/__init__.py
+++ b/scriptine/__init__.py
@@ -1,6 +1,6 @@
from scriptine._path import path
from scriptine.command import run
-__version__ = '0.1.0'
+__version__ = '0.2.0a1'
__all__ = ['path', 'run']
\ No newline at end of file | bumped version to <I>a1 | olt_scriptine | train | py |
be0a428e7d61e0dc61e859e1819f207490b7d5a2 | diff --git a/sysconfig.py b/sysconfig.py
index <HASH>..<HASH> 100644
--- a/sysconfig.py
+++ b/sysconfig.py
@@ -21,6 +21,15 @@ from warnings import warn
# to avoid this module to shadow it
_sysconfig = __import__('sysconfig')
+# names defined here to keep backward compatibility
+# for APIs that were relocated
+get_python_version = _sysconfig.get_python_version
+get_config_h_filename = _sysconfig.get_config_h_filename
+parse_config_h = _sysconfig.parse_config_h
+get_config_vars = _sysconfig.get_config_vars
+get_config_var = _sysconfig.get_config_var
+from distutils.ccompiler import customize_compiler
+
_DEPRECATION_MSG = ("distutils.sysconfig.%s is deprecated. "
"Use the APIs provided by the sysconfig module instead")
diff --git a/util.py b/util.py
index <HASH>..<HASH> 100644
--- a/util.py
+++ b/util.py
@@ -17,6 +17,10 @@ from distutils.errors import DistutilsByteCompileError
_sysconfig = __import__('sysconfig')
+# kept for backward compatibility
+# since this API was relocated
+get_platform = _sysconfig.get_platform
+
def convert_path(pathname):
"""Return 'pathname' as a name that will work on the native filesystem. | reintroduced the names in Distutils for APIs that were relocated | pypa_setuptools | train | py,py |
ddf7edebf906311fabd94116793f117d1fbc7545 | diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/ZuulHandlerMapping.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/ZuulHandlerMapping.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/ZuulHandlerMapping.java
+++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/ZuulHandlerMapping.java
@@ -70,7 +70,7 @@ public class ZuulHandlerMapping extends AbstractUrlHandlerMapping implements
}
}
- @RequestMapping(value = "routes", method = RequestMethod.POST)
+ @RequestMapping(method = RequestMethod.POST)
@ResponseBody
@ManagedOperation
public Map<String, String> reset() {
@@ -79,7 +79,7 @@ public class ZuulHandlerMapping extends AbstractUrlHandlerMapping implements
return routes;
}
- @RequestMapping(value = "routes", method = RequestMethod.GET)
+ @RequestMapping(method = RequestMethod.GET)
@ResponseBody
@ManagedAttribute
public Map<String, String> getRoutes() {
@@ -88,7 +88,7 @@ public class ZuulHandlerMapping extends AbstractUrlHandlerMapping implements
@Override
public String getPath() {
- return "/proxy";
+ return "/route";
}
@Override | /proxy/routes -> /routes | spring-cloud_spring-cloud-netflix | train | java |
06498630a291d959a9a814ddc71d404fc8737248 | diff --git a/src/main/java/org/dasein/cloud/digitalocean/models/rest/DigitalOceanModelFactory.java b/src/main/java/org/dasein/cloud/digitalocean/models/rest/DigitalOceanModelFactory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/dasein/cloud/digitalocean/models/rest/DigitalOceanModelFactory.java
+++ b/src/main/java/org/dasein/cloud/digitalocean/models/rest/DigitalOceanModelFactory.java
@@ -76,7 +76,7 @@ public class DigitalOceanModelFactory {
HttpResponse response;
String responseBody;
try {
- response = sendRequest(method, token, endpoint, timeout, action);
+ response = sendRequest(method, token, strUrl, timeout, action);
responseBody = IOUtils.toString(response.getEntity().getContent());
if( wire.isDebugEnabled() ) {
wire.debug(responseBody); | FB<I>: Temporarily request up to <I> results per page, only a single page is handled | greese_dasein-cloud-digitalocean | train | java |
e2f22035c315dc2a23b78ece2d5c59e9e17b7be1 | diff --git a/peewee_mssql.py b/peewee_mssql.py
index <HASH>..<HASH> 100644
--- a/peewee_mssql.py
+++ b/peewee_mssql.py
@@ -1,7 +1,7 @@
from peewee import Database, ImproperlyConfigured, OP, QueryCompiler, CompoundSelect, SQL, Clause, CommaClause
from playhouse.db_url import register_database
-from setup import __version__
+from version import __version__
try:
import pymssql | Update peewee_mssql.py | COUR4G3_peewee-mssql | train | py |
48c83bb6e1664e3384f0f2cfa490902df1a313ff | diff --git a/src/ossos/core/ossos/planning/plotting/parameters.py b/src/ossos/core/ossos/planning/plotting/parameters.py
index <HASH>..<HASH> 100644
--- a/src/ossos/core/ossos/planning/plotting/parameters.py
+++ b/src/ossos/core/ossos/planning/plotting/parameters.py
@@ -9,7 +9,7 @@ L7MODEL = '/Users/bannisterm/Dropbox/OSSOS/Release_summaries/L7model-3.0-9.0' #
L7_HOME = '/Users/bannisterm/Dropbox/OSSOS/Release_summaries/'
REAL_KBO_AST_DIR = '/Users/bannisterm/Dropbox/OSSOS/measure3/ossin/'
# REAL_KBO_AST_DIR = 'vos:OSSOS/dbaseclone/ast/'
-RELEASE_VERSION = 6
+RELEASE_VERSION = 'current'
first_quarter = '/Users/bannisterm/Dropbox/Papers in progress/OSSOS/First_quarter/'
RELEASE_DETECTIONS = { | Use the 'current' data release as the default when plotting data.
There is lots of hard-coded paths in here. This files gets used by two different systems (obs_planner and plot_aei) and likely we should split this stuff out. | OSSOS_MOP | train | py |
9a930aed42fbf603f6242be926e3b9484c36bc95 | diff --git a/ieml/calculation/distance.py b/ieml/calculation/distance.py
index <HASH>..<HASH> 100644
--- a/ieml/calculation/distance.py
+++ b/ieml/calculation/distance.py
@@ -259,7 +259,7 @@ def build_graph(object_set_a, object_set_b, intersection):
return graph
-def parents(usl_a, usl_b, index='EO'):
+def parents_index(usl_a, usl_b, index="EO"):
parents_a, parents_b = get_parents(usl_a, usl_b) | Changes the name of parents to parents_index | IEMLdev_ieml | train | py |
da22274401f7de40622bea5cc5209b7d3ccd8540 | diff --git a/src/python/grpcio_tests/tests/http2/negative_http2_client.py b/src/python/grpcio_tests/tests/http2/negative_http2_client.py
index <HASH>..<HASH> 100644
--- a/src/python/grpcio_tests/tests/http2/negative_http2_client.py
+++ b/src/python/grpcio_tests/tests/http2/negative_http2_client.py
@@ -31,6 +31,7 @@
import argparse
import grpc
+import time
from src.proto.grpc.testing import test_pb2
from src.proto.grpc.testing import messages_pb2
@@ -75,6 +76,7 @@ def _goaway(stub):
first_response = stub.UnaryCall(_SIMPLE_REQUEST)
_validate_payload_type_and_length(first_response, messages_pb2.COMPRESSABLE,
_RESPONSE_SIZE)
+ time.sleep(1)
second_response = stub.UnaryCall(_SIMPLE_REQUEST)
_validate_payload_type_and_length(second_response,
messages_pb2.COMPRESSABLE, _RESPONSE_SIZE) | Add sleep(1) to Python negative http2 client
client now conforms to spec. See
<URL> | grpc_grpc | train | py |
b95df893b38c180659d13450dcfbe9d5d3631406 | diff --git a/demos/crud2.php b/demos/crud2.php
index <HASH>..<HASH> 100644
--- a/demos/crud2.php
+++ b/demos/crud2.php
@@ -5,3 +5,4 @@ require 'database.php';
$g = $layout->add(['CRUD']);
$g->setModel(new Stat($db));
+$g->addDecorator('project_code', 'Link');
diff --git a/tests/DemoTest.php b/tests/DemoTest.php
index <HASH>..<HASH> 100644
--- a/tests/DemoTest.php
+++ b/tests/DemoTest.php
@@ -47,6 +47,7 @@ class DemoTest extends \atk4\core\PHPUnit_AgileTestCase
['multitable.php'],
['grid.php'],
['crud.php'],
+ ['crud2.php'],
['view.php'],
['field.php'], | Fix issues caused by upgrading Agile Core (#<I>)
* resolve #<I>
* Apply fixes from StyleCI
* add crud2 test which includes decorators
* include test for add decorator | atk4_ui | train | php,php |
44f75e8939c3355d382b041614f396832014230a | diff --git a/src/CodeAnalysisTasks.php b/src/CodeAnalysisTasks.php
index <HASH>..<HASH> 100644
--- a/src/CodeAnalysisTasks.php
+++ b/src/CodeAnalysisTasks.php
@@ -189,7 +189,7 @@ trait CodeAnalysisTasks
$this->options->analyzedDir,
$this->options->isSavedToFiles ? 'xml' : 'text',
escapePath($this->config->path('phpmd.standard')),
- 'sufixxes' => 'php',
+ 'suffixes' => 'php',
$this->options->ignore->phpmd()
);
if ($this->options->isSavedToFiles) { | Fix phpmd command arg typo | EdgedesignCZ_phpqa | train | php |
0b4334af37b2914d0f5a69401d6c2548704c05ad | diff --git a/Bugsnag/ClientLoader.php b/Bugsnag/ClientLoader.php
index <HASH>..<HASH> 100755
--- a/Bugsnag/ClientLoader.php
+++ b/Bugsnag/ClientLoader.php
@@ -70,6 +70,12 @@ class ClientLoader
}
$metaData['Symfony']['Route'] = $request->get('_route');
+
+ // Json types transmit params differently.
+ if ($request->getContentType() == 'json') {
+ $metaData['request']['params'] = $request->request->all();
+ }
+
$this->bugsnagClient->setMetaData($metaData);
}
} | Make sure that json content types bass over their parameters properly. | evolution7_Evolution7BugsnagBundle | train | php |
5dfc837eb87f38910b40cacb4b4a8be83d54bc83 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -100,7 +100,8 @@ class ExtensionBuilder(distutils.command.build_ext.build_ext, build_ext_options)
else:
platform_name = 'linux'
for e in self.extensions:
- e.libraries.append('pthreads')
+ if platform_name == 'windows':
+ e.libraries.append('pthreads')
e.include_dirs.append(numpy.get_include())
e.include_dirs.append(os.path.join(INCLUDE, '%s-%s' % (platform_name, arch)))
e.extra_objects = list(objects)
@@ -162,6 +163,7 @@ class ExtensionBuilder(distutils.command.build_ext.build_ext, build_ext_options)
command.extend(flags)
command.extend(macros)
command.extend(include)
+ print(' '.join(command))
subprocess.check_call(command, cwd=BLIS_DIR)
return target | Only link to pthreads on Windows | explosion_cython-blis | train | py |
a4a8b5c222d11b70ac53ffab7f99c54f0a318050 | diff --git a/src/Core/ObjectRegistry.php b/src/Core/ObjectRegistry.php
index <HASH>..<HASH> 100644
--- a/src/Core/ObjectRegistry.php
+++ b/src/Core/ObjectRegistry.php
@@ -70,6 +70,7 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
* @param string $objectName The name/class of the object to load.
* @param array $config Additional settings to use when loading the object.
* @return mixed
+ * @throws \Exception If the class cannot be found.
*/
public function load($objectName, $config = [])
{ | Include missing exception
The controllers loadComponent has an exception docblock, but the method which causes that does not. This pull request addresses that inconsistency. | cakephp_cakephp | train | php |
12b7085e8bb6b5722c92055190de2dddfc91ea1f | diff --git a/lib/rspec-puppet/coverage.rb b/lib/rspec-puppet/coverage.rb
index <HASH>..<HASH> 100644
--- a/lib/rspec-puppet/coverage.rb
+++ b/lib/rspec-puppet/coverage.rb
@@ -1,3 +1,15 @@
+unless defined?(RSpec::Core::NullReporter)
+ module RSpec::Core
+ class NullReporter
+ private
+
+ def method_missing(_method, *_args, &_block)
+ #noop
+ end
+ end
+ end
+end
+
module RSpec::Puppet
class Coverage
@@ -91,7 +103,7 @@ module RSpec::Puppet
coverage_results = coverage_test.example("Must be at least #{coverage_desired}% of code coverage") {
expect( coverage_actual.to_f ).to be >= coverage_desired.to_f
}
- coverage_test.run
+ coverage_test.run(RSpec::Core::NullReporter.new)
passed = coverage_results.execution_result.status == :passed
RSpec.configuration.reporter.example_failed coverage_results unless passed | Explicitly use the NullReporter for coverage tests | rodjek_rspec-puppet | train | rb |
82514c86ff1b37eb29aa979fe51238846857935d | diff --git a/package_bin.go b/package_bin.go
index <HASH>..<HASH> 100644
--- a/package_bin.go
+++ b/package_bin.go
@@ -111,10 +111,17 @@ func (p *gc_bin_parser) parse_export(callback func(string, ast.Decl)) {
// read version specific flags - extend as necessary
switch p.version {
- // case 3:
+ // case 4:
// ...
// fallthrough
- case 2, 1:
+ case 3, 2, 1:
+ // Support for Go 1.8 type aliases will be added very
+ // soon (Oct 2016). In the meantime, we make a
+ // best-effort attempt to read v3 export data, failing
+ // if we encounter a type alias. This allows the
+ // automated builders to make progress since
+ // type aliases are not yet used in practice.
+ // TODO(gri): add support for type aliases.
p.debugFormat = p.rawStringln(p.rawByte()) == "debug"
p.trackAllTypes = p.int() != 0
p.posInfoFormat = p.int() != 0 | package_bin: read v3 export data not containing type aliases
- original commit message
This is a short-term stop-gap to keep the builders happy.
- backport of <URL> | nsf_gocode | train | go |
783395890dbb479c6e9352a18f0c013a45ce1b8a | diff --git a/cltk/phonology/syllabify.py b/cltk/phonology/syllabify.py
index <HASH>..<HASH> 100644
--- a/cltk/phonology/syllabify.py
+++ b/cltk/phonology/syllabify.py
@@ -202,7 +202,7 @@ class Syllabifier:
Additionally, you can utilize the language parameter:
- >>> s = Syllabifier(language='middle high german')
+ >>> s = Syllabifier(language='middle_high_german')
>>> s.syllabify('lobebæren')
['lo', 'be', 'bæ', 'ren'] | fixed doctest to use middle_high_german key | cltk_cltk | train | py |
d9ad8cfac0fbc759cfabda1ec671d738ca1f1f12 | diff --git a/pkg/api/v1beta1/conversion.go b/pkg/api/v1beta1/conversion.go
index <HASH>..<HASH> 100644
--- a/pkg/api/v1beta1/conversion.go
+++ b/pkg/api/v1beta1/conversion.go
@@ -196,6 +196,18 @@ func init() {
out.PodIP = in.PodIP
return nil
},
+ func(in *newer.PodSpec, out *PodState, s conversion.Scope) error {
+ if err := s.Convert(&in, &out.Manifest, 0); err != nil {
+ return err
+ }
+ return nil
+ },
+ func(in *PodState, out *newer.PodSpec, s conversion.Scope) error {
+ if err := s.Convert(&in.Manifest, &out, 0); err != nil {
+ return err
+ }
+ return nil
+ },
// Convert all to the new PodPhase constants
func(in *newer.PodPhase, out *PodStatus, s conversion.Scope) error { | Conversions missing from v1beta1
They were in v1beta2, not sure how they got removed. | kubernetes_kubernetes | train | go |
fbf4491ef0cb1b749860e9ce04396185600cd0af | diff --git a/h2o-py/tests/testdir_algos/deeplearning/pyunit_autoencoderDeepLearning_large.py b/h2o-py/tests/testdir_algos/deeplearning/pyunit_autoencoderDeepLearning_large.py
index <HASH>..<HASH> 100644
--- a/h2o-py/tests/testdir_algos/deeplearning/pyunit_autoencoderDeepLearning_large.py
+++ b/h2o-py/tests/testdir_algos/deeplearning/pyunit_autoencoderDeepLearning_large.py
@@ -56,7 +56,7 @@ def deeplearning_autoencoder(ip, port):
cm.show()
# 10% error +/- 0.001
- assert abs(cm.cell_values[10][10] - 0.082) < 0.001, "Error. Expected 0.082, but got {0}".format(cm.cell_values[10][10])
+ assert abs(cm.cell_values[10][10] - 0.1079) < 0.001, "Error. Expected 0.1079, but got {0}".format(cm.cell_values[10][10])
if __name__ == '__main__':
tests.run_test(sys.argv, deeplearning_autoencoder) | update tolerance in pyunit, which will probably have to be updated again when currents is merged with master. | h2oai_h2o-3 | train | py |
689a5624baa39a30a6b92229e3c5c820c100d9af | diff --git a/ripe/atlas/cousteau/request.py b/ripe/atlas/cousteau/request.py
index <HASH>..<HASH> 100644
--- a/ripe/atlas/cousteau/request.py
+++ b/ripe/atlas/cousteau/request.py
@@ -274,10 +274,10 @@ class AtlasResultsRequest(AtlasRequest):
url_params = {}
if self.start:
- url_params.update({"start": time.mktime(self.start.timetuple())})
+ url_params.update({"start": int(time.mktime(self.start.timetuple()))})
if self.stop:
- url_params.update({"stop": time.mktime(self.stop.timetuple())})
+ url_params.update({"stop": int(time.mktime(self.stop.timetuple()))})
if self.probe_ids:
url_params.update({"prb_id": ",".join(map(str, self.probe_ids))}) | v2 API doesnt accept floats as timestamps | RIPE-NCC_ripe-atlas-cousteau | train | py |
924f78d5c31fb5c7ad3ce5ff01285e4fe8f01f58 | diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -7,6 +7,7 @@
require_once(__DIR__ . '/../Item.php');
require_once(__DIR__ . '/../ItemList.php');
require_once(__DIR__ . '/../PackedBox.php');
+ require_once(__DIR__ . '/../PackedBoxList.php');
require_once(__DIR__ . '/../Packer.php');
class TestBox implements Box { | Fixup test runner
(tests still run locally for some reason!) | dvdoug_BoxPacker | train | php |
9216f6a630455a3932b28ea289920be2c2f263db | diff --git a/scripts/run-all.js b/scripts/run-all.js
index <HASH>..<HASH> 100644
--- a/scripts/run-all.js
+++ b/scripts/run-all.js
@@ -77,7 +77,7 @@ const checkDirsLength = (dirs, errMessage) => {
}
const mapTasks = (cmd, packages) => {
- const colors = 'green yellow blue magenta cyan white gray bgGreen bgYellow bgBlue bgMagenta bgCyan bgWhite'.split(' ')
+ const colors = 'green yellow blue magenta cyan white gray bgGreen bgBlue bgMagenta bgCyan bgYellow bgWhite'.split(' ')
let runCommand | rearranged bg colors for build process so that bgYellow is slated later. | cypress-io_cypress | train | js |
0f32ffd59ddfbe14f7384cfa1431b5c76ee22a3e | diff --git a/js/coinexchangeio.js b/js/coinexchangeio.js
index <HASH>..<HASH> 100644
--- a/js/coinexchangeio.js
+++ b/js/coinexchangeio.js
@@ -17,10 +17,12 @@ module.exports = class coinexchangeio extends Exchange {
'rateLimit': 1000,
// obsolete metainfo interface
'hasPrivateAPI': false,
+ 'hasFetchTrades': false,
'hasFetchCurrencies': true,
'hasFetchTickers': true,
// new metainfo interface
'has': {
+ 'fetchTrades': false,
'fetchCurrencies': true,
'fetchTickers': true,
}, | coinexchangeio: hasFetchTrades = false | ccxt_ccxt | train | js |
30a98f224fd3913014ad43a4b250a38657cc21cb | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -6,7 +6,7 @@ const execSync = require('child_process').execSync;
const fs = require('fs');
const ghpages = require('gh-pages');
const ncp = require('ncp').ncp;
-const packageJson = require('../../package.json');
+const packageJson = require('./package.json');
const path = require('path');
const repository = packageJson['homepage'] || null;
const webpackSimpleTemplate = packageJson['wst'] || null; | fix wrong filepath for package.json | KieferSivitz_vue-gh-pages | train | js |
1ca55a5f8eec81a9754db65f263342edfc9ac057 | diff --git a/ngJsTree.js b/ngJsTree.js
index <HASH>..<HASH> 100644
--- a/ngJsTree.js
+++ b/ngJsTree.js
@@ -1,5 +1,4 @@
(function (angular) {
- 'use strict';
//// JavaScript Code ////
function jsTreeCtrl($scope) { | Update ngJsTree.js | ezraroi_ngJsTree | train | js |
d407a7057fbd5268a708bbe32b4597087d1fb930 | diff --git a/src/main/java/io/muserver/ContextHandlerBuilder.java b/src/main/java/io/muserver/ContextHandlerBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/muserver/ContextHandlerBuilder.java
+++ b/src/main/java/io/muserver/ContextHandlerBuilder.java
@@ -13,6 +13,11 @@ public class ContextHandlerBuilder implements MuHandlerBuilder<ContextHandler> {
return this;
}
+ public static ContextHandlerBuilder context(String path) {
+ return new ContextHandlerBuilder()
+ .withPath(path);
+ }
+
public static ContextHandlerBuilder context(String path, MuHandler... handlers) {
return new ContextHandlerBuilder()
.withPath(path) | Added context builder static method that takes no parameters so context builders can be created more easily | 3redronin_mu-server | train | java |
0ca7fdde016c6ddb05d0585f39b62b6dd4d15e46 | diff --git a/output/html/php_errors.php b/output/html/php_errors.php
index <HASH>..<HASH> 100644
--- a/output/html/php_errors.php
+++ b/output/html/php_errors.php
@@ -261,9 +261,18 @@ class QM_Output_Html_PHP_Errors extends QM_Output_Html {
$data = $this->collector->get_data();
$count = 0;
+ $types = array(
+ 'suppressed',
+ 'silenced',
+ 'errors',
+ );
- foreach ( $data['errors'] as $errors ) {
- $count += array_sum( wp_list_pluck( $errors, 'calls' ) );
+ foreach ( $types as $type ) {
+ if ( ! empty( $data[ $type ] ) ) {
+ foreach ( $data[ $type ] as $errors ) {
+ $count += array_sum( wp_list_pluck( $errors, 'calls' ) );
+ }
+ }
}
$menu[ $this->collector->id() ]['title'] = esc_html( sprintf( | Ensure all error types are accounted for when populating the panel menu error count. Fixes #<I>. | johnbillion_query-monitor | train | php |
98f8ca87fceb22385e44c3260ceac6897cd03f93 | diff --git a/code/png.py b/code/png.py
index <HASH>..<HASH> 100755
--- a/code/png.py
+++ b/code/png.py
@@ -1355,12 +1355,16 @@ class Reader:
self.atchunk = None
if _guess is not None:
- if isarray(_guess):
- kw["bytes"] = _guess
- elif isinstance(_guess, str):
- kw["filename"] = _guess
- elif isinstance(_guess, file) or str(_guess.__class__)=='StringIO.StringIO':
- kw["file"] = _guess
+ try:
+ if isarray(_guess):
+ kw["bytes"] = _guess
+ elif isinstance(_guess, str):
+ kw["filename"] = _guess
+ elif isinstance(_guess, file) or str(_guess.__class__)=='StringIO.StringIO':
+ kw["file"] = _guess
+ except:
+ pass
+ # End try/except
if "filename" in kw:
self.file = open(kw["filename"], "rb") | Added try/except around detection. | drj11_pypng | train | py |
61fdde3969fb168a6c4b014d2233aca1c1b5667b | diff --git a/src/org/opencms/search/CmsSearchIndex.java b/src/org/opencms/search/CmsSearchIndex.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/search/CmsSearchIndex.java
+++ b/src/org/opencms/search/CmsSearchIndex.java
@@ -2169,14 +2169,14 @@ public class CmsSearchIndex implements I_CmsConfigurationParameterHandler {
// check if the resource exits in the VFS,
// this will implicitly check read permission and if the resource was deleted
- String contextPath = cms.getRequestContext().removeSiteRoot(doc.getPath());
-
CmsResourceFilter filter = CmsResourceFilter.DEFAULT;
if (isRequireViewPermission()) {
filter = CmsResourceFilter.DEFAULT_ONLY_VISIBLE;
}
try {
- return cms.readResource(contextPath, filter);
+ CmsObject clone = OpenCms.initCmsObject(cms);
+ clone.getRequestContext().setSiteRoot("");
+ return clone.readResource(doc.getPath(), filter);
} catch (CmsException e) {
// Do nothing
} | Improved search result permission check for resource that belong to
another site then the current one. | alkacon_opencms-core | train | java |
624cef85e0e5039b742af7abdd92d00d83e88a1d | diff --git a/src/core/fontwatchrunner.js b/src/core/fontwatchrunner.js
index <HASH>..<HASH> 100644
--- a/src/core/fontwatchrunner.js
+++ b/src/core/fontwatchrunner.js
@@ -115,7 +115,7 @@ webfont.FontWatchRunner.prototype.sizeMatches_ = function(size, genericFontFamil
webfont.FontWatchRunner.prototype.sizesMatchGenericFontSizes_ = function(a, b) {
for (var genericFontFamily in webfont.FontWatchRunner.GenericFontFamily) {
if (webfont.FontWatchRunner.GenericFontFamily.hasOwnProperty(genericFontFamily)) {
- if (this.sizeMatches_(a, genericFontFamily) && this.sizeMatches_(b, genericFontFamily)) {
+ if (this.sizeMatches_(a, webfont.FontWatchRunner.GenericFontFamily[genericFontFamily]) && this.sizeMatches_(b, webfont.FontWatchRunner.GenericFontFamily[genericFontFamily])) {
return true;
}
} | Fixed incorrect indexing of the generic font family lookup. | typekit_webfontloader | train | js |
411a23e053c9fe77b0972bf038f65988e7ca173c | diff --git a/src/Component/Doctrine/Migrations/AbstractMigration.php b/src/Component/Doctrine/Migrations/AbstractMigration.php
index <HASH>..<HASH> 100644
--- a/src/Component/Doctrine/Migrations/AbstractMigration.php
+++ b/src/Component/Doctrine/Migrations/AbstractMigration.php
@@ -28,7 +28,7 @@ abstract class AbstractMigration extends DoctrineAbstractMigration
* @param array $params
* @param array $types
* @param \Doctrine\DBAL\Cache\QueryCacheProfile|null $qcp
- * @return \Doctrine\DBAL\Driver\ResultStatement
+ * @return \Doctrine\DBAL\Result
*/
public function sql($query, array $params = [], $types = [], ?QueryCacheProfile $qcp = null)
{ | AbstractMigration: fix return type
- \Doctrine\DBAL\Driver\ResultStatement has been renamed to \Doctrine\DBAL\Result
- see <URL> | shopsys_migrations | train | php |
2be37262b94f8cf75ea898a106e421610d886fe0 | diff --git a/lib/sfn/command/update.rb b/lib/sfn/command/update.rb
index <HASH>..<HASH> 100644
--- a/lib/sfn/command/update.rb
+++ b/lib/sfn/command/update.rb
@@ -50,18 +50,18 @@ module Sfn
end
ui.info " -> #{stack_info}"
- apply_stacks!(stack)
-
if(file)
if(config[:print_only])
ui.puts _format_json(translate_template(file))
return
end
- populate_parameters!(file, :current_parameters => stack.parameters)
stack.template = translate_template(file)
+ apply_stacks!(stack)
+ populate_parameters!(file, :current_parameters => stack.parameters)
stack.parameters = config_root_parameters
stack.template = Sfn::Utils::StackParameterScrubber.scrub!(stack.template)
else
+ apply_stacks!(stack)
populate_parameters!(stack.template, :current_parameters => stack.parameters)
stack.parameters = config_root_parameters
end | [fix] Apply stacks after modified template has been set on update (#<I>) | sparkleformation_sfn | train | rb |
5353cb7f409aa07ccd84c9384d25c5f7248c9426 | diff --git a/lib/all.js b/lib/all.js
index <HASH>..<HASH> 100644
--- a/lib/all.js
+++ b/lib/all.js
@@ -1,33 +1,36 @@
'use strict';
-const { forEach } = require('./internal/util');
const { InnerReceiver } = require('./internal/receiver');
const { internal } = require('./internal/util');
module.exports = function(Promise, callResolve, callReject) {
return function all(array) {
- let size = array.length;
+ const size = array.length;
const result = Array(size);
if (size === 0) {
return Promise.resolve(result);
}
const promise = new Promise(internal);
- let called = false;
+ let called = 0;
const _callResolve = (value, index) => {
result[index] = value;
- if (--size === 0) {
+ if (++called === size) {
callResolve(promise, result);
}
};
+ let err;
const _callReject = reason => {
- if (called) {
+ if (err) {
return;
}
- called = true;
+ err = reason;
callReject(promise, reason);
};
- forEach(array, iterator);
+ let index = -1;
+ while (++index < size) {
+ iterator(array[index], index);
+ }
return promise;
function iterator(p, index) { | refactor(all): fix not to use `forEach` | suguru03_aigle | train | js |
8e85a36e3754329a0549758dba8fca0095c17ae9 | diff --git a/src/Symfony/Bundle/FrameworkBundle/RequestListener.php b/src/Symfony/Bundle/FrameworkBundle/RequestListener.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/FrameworkBundle/RequestListener.php
+++ b/src/Symfony/Bundle/FrameworkBundle/RequestListener.php
@@ -19,7 +19,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
-use Symfony\Component\Routing\Exception\NotFoundException;
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Routing\RequestContext;
@@ -107,7 +107,7 @@ class RequestListener
}
$request->attributes->add($parameters);
- } catch (NotFoundException $e) {
+ } catch (ResourceNotFoundException $e) {
$message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getPathInfo());
if (null !== $this->logger) {
$this->logger->err($message); | [FrameworkBundle] fixed renamed routing exception | symfony_symfony | train | php |
9ec7e592dfa0a17fe792db3b405f0c5e49f7d67f | diff --git a/Event/GearmanClientCallbackExceptionEvent.php b/Event/GearmanClientCallbackExceptionEvent.php
index <HASH>..<HASH> 100644
--- a/Event/GearmanClientCallbackExceptionEvent.php
+++ b/Event/GearmanClientCallbackExceptionEvent.php
@@ -8,11 +8,12 @@
namespace Mmoreram\GearmanBundle\Event;
+use Symfony\Component\EventDispatcher\Event;
/**
* GearmanClientCallbackExceptionEvent
*/
-class GearmanClientCallbackExceptionEvent
+class GearmanClientCallbackExceptionEvent extends Event
{
-}
\ No newline at end of file
+} | Resolving issue #<I> - GearmanClientCallbackExceptionEvent extends Event | mmoreram_GearmanBundle | train | php |
c2dbd9f5c4adf8e3d317a1e93d99980cd2b53d1f | diff --git a/lib/WebRtcPeer.js b/lib/WebRtcPeer.js
index <HASH>..<HASH> 100644
--- a/lib/WebRtcPeer.js
+++ b/lib/WebRtcPeer.js
@@ -243,7 +243,7 @@ function WebRtcPeer(mode, options, callback)
callback = (callback || noop).bind(this)
- if(mode !== 'recvonly' && !videoStream)
+ if(mode !== 'recvonly' && !videoStream && !audioStream)
{
mediaConstraints = recursive(
{ | Don't call getUserMedia() when an audioStream to send is defined
Change-Id: I<I>eb<I>fefbf1ba<I>cf<I>f<I> | Kurento_kurento-utils-js | train | js |
e10740ae6a001519e68c69bbb40f7bf789fa2094 | diff --git a/src/Admin/AdminInterface.php b/src/Admin/AdminInterface.php
index <HASH>..<HASH> 100644
--- a/src/Admin/AdminInterface.php
+++ b/src/Admin/AdminInterface.php
@@ -377,7 +377,7 @@ interface AdminInterface extends TaggedAdminInterface, AccessRegistryInterface,
/**
* Returns SourceIterator.
*
- * @return SourceIteratorInterface<array<mixed>>
+ * @return SourceIteratorInterface
*/
public function getDataSourceIterator();
diff --git a/src/Exporter/DataSourceInterface.php b/src/Exporter/DataSourceInterface.php
index <HASH>..<HASH> 100644
--- a/src/Exporter/DataSourceInterface.php
+++ b/src/Exporter/DataSourceInterface.php
@@ -20,8 +20,6 @@ interface DataSourceInterface
{
/**
* @param string[] $fields
- *
- * @return SourceIteratorInterface<array<mixed>>
*/
public function createIterator(ProxyQueryInterface $query, array $fields): SourceIteratorInterface;
} | Fix phpstan build (#<I>) | sonata-project_SonataAdminBundle | train | php,php |
45944f83a89b23b134a8326171e490e551e8ca50 | diff --git a/core/src/main/java/hudson/logging/LogRecorder.java b/core/src/main/java/hudson/logging/LogRecorder.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/logging/LogRecorder.java
+++ b/core/src/main/java/hudson/logging/LogRecorder.java
@@ -199,7 +199,7 @@ public class LogRecorder extends AbstractModelObject implements Saveable {
// Disable logging for all our targets,
// then reenable all other loggers in case any also log the same targets
for (Target t : targets)
- t.getLogger().setLevel(Level.OFF);
+ t.getLogger().setLevel(null);
for (LogRecorder log : getParent().logRecorders.values())
for (Target t : log.targets)
t.enable(); | To revert, instead of to disable, set level to null to inherit from the parent.
Note that this is still incomplete, as these loggers might have been already pre-configured outside Hudson.
git-svn-id: <URL> | jenkinsci_jenkins | train | java |
a54e002f364a2ca76abb39f1b3d6386b8dbe3e9f | diff --git a/panphon/_panphon.py b/panphon/_panphon.py
index <HASH>..<HASH> 100644
--- a/panphon/_panphon.py
+++ b/panphon/_panphon.py
@@ -179,3 +179,12 @@ class FeatureTable(object):
if m in table:
return True
return False
+
+ def fts_count(self, fts, inv):
+ """Returns the count of segments in an inventory matching a give
+ feature mask.
+
+ fts -- feature mask given as a set of <val, name> tuples
+ inv -- inventory of segments (as Unicode IPA strings)
+ """
+ return len(filter(lambda s: self.ft_match(fts, s), inv)) | Added fts_count | dmort27_panphon | train | py |
397e17feac957fee9c75d004158cdc7d2f3da79f | diff --git a/s_tui/Sources/TemperatureSource.py b/s_tui/Sources/TemperatureSource.py
index <HASH>..<HASH> 100644
--- a/s_tui/Sources/TemperatureSource.py
+++ b/s_tui/Sources/TemperatureSource.py
@@ -76,7 +76,7 @@ class TemperatureSource(Source):
# Support for Ryzen 1700X
if last_value <= 0:
try:
- last_value = psutil.sensors_temperatures()['it8686'][2].current
+ last_value = psutil.sensors_temperatures()['k10temp'][0].current
except:
last_value = 0
# Support for Ryzen 7 + asus
diff --git a/s_tui/TempSensorsMenu.py b/s_tui/TempSensorsMenu.py
index <HASH>..<HASH> 100644
--- a/s_tui/TempSensorsMenu.py
+++ b/s_tui/TempSensorsMenu.py
@@ -62,7 +62,11 @@ class TempSensorsMenu:
title = urwid.Text(('bold text', u" Available Temperature Sensors \n"), 'center')
self.available_sensors = []
- sensors_dict = psutil.sensors_temperatures()
+ sensors_dict = dict()
+ try:
+ sensors_dict = psutil.sensors_temperatures()
+ except IOError:
+ logging.debug("Unable to create sensors dict")
for key,value in sensors_dict.items():
sensor_name = key
for itr in range(len(value)): | Add try catch to temp sensors menu creation
+ Add k<I>temp to default temperature sensors. Should fix #<I>
+ Add IOError exception to sensors menu to fix #<I> | amanusk_s-tui | train | py,py |
ca45a9d273c6614fd998020582c018c7c1d1dfdc | diff --git a/src/main/java/com/plaid/client/response/TransactionsGetResponse.java b/src/main/java/com/plaid/client/response/TransactionsGetResponse.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/plaid/client/response/TransactionsGetResponse.java
+++ b/src/main/java/com/plaid/client/response/TransactionsGetResponse.java
@@ -41,6 +41,7 @@ public final class TransactionsGetResponse extends BaseResponse {
private String pendingTransactionId;
private String transactionId;
private String transactionType;
+ private String accountOwner;
public String getTransactionId() {
return transactionId;
@@ -94,6 +95,10 @@ public final class TransactionsGetResponse extends BaseResponse {
return originalDescription;
}
+ public String getAccountOwner() {
+ return accountOwner;
+ }
+
public final class PaymentMeta {
private String byOrderOf;
private String payee; | transactions: add account_owner field (#<I>) | plaid_plaid-java | train | java |
aeaee5b157a0c0b07c8e443d6cb52350777a40f3 | diff --git a/src/iframeResizer.js b/src/iframeResizer.js
index <HASH>..<HASH> 100644
--- a/src/iframeResizer.js
+++ b/src/iframeResizer.js
@@ -6,7 +6,7 @@
* Contributor: Jure Mav - [email protected]
*/
( function() {
- 'use strict';
+ 'use strict';
var
count = 0,
@@ -53,12 +53,8 @@
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
}
- // If not supported then just call callback
if (!(window.requestAnimationFrame)){
log(' RequestAnimationFrame not supported');
- window.requestAnimationFrame = function(callback){
- callback();
- };
}
}
@@ -109,7 +105,8 @@
throw new Error(
'Unexpected message received from: ' + origin +
' for ' + messageData.iframe.id +
- '. Message was: ' + event.data
+ '. Message was: ' + event.data +
+ '. This error can be disabled by adding the checkOrigin: false option.'
);
}
}
@@ -223,7 +220,7 @@
}
function syncResize(func,messageData,doNotSync){
- if(doNotSync!==messageData.type){
+ if(doNotSync!==messageData.type && window.requestAnimationFrame){
log(' Requesting animation frame');
window.requestAnimationFrame(func);
} else { | Deconflict requestAnimationFrame | davidjbradshaw_iframe-resizer | train | js |
3af07b4e44e6ef239dfdd61ccdabed3d5fe6fc79 | diff --git a/liquibase-core/src/main/java/liquibase/snapshot/jvm/ColumnSnapshotGenerator.java b/liquibase-core/src/main/java/liquibase/snapshot/jvm/ColumnSnapshotGenerator.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/snapshot/jvm/ColumnSnapshotGenerator.java
+++ b/liquibase-core/src/main/java/liquibase/snapshot/jvm/ColumnSnapshotGenerator.java
@@ -370,6 +370,12 @@ public class ColumnSnapshotGenerator extends JdbcSnapshotGenerator {
}
+ if (database instanceof DB2Database) {
+ if (columnMetadataResultSet.get("COLUMN_DEF") != null && ((String) columnMetadataResultSet.get("COLUMN_DEF")).equalsIgnoreCase("NULL")) {
+ columnMetadataResultSet.set("COLUMN_DEF", null);
+ }
+ }
+
return SqlUtil.parseValue(database, columnMetadataResultSet.get("COLUMN_DEF"), columnInfo.getType());
} | DB2 sees empty string default values as "NULL", especially in oracle-compatibility mode. | liquibase_liquibase | train | java |
815420534c87e90ba018d420415ccc0ba13dd17f | diff --git a/openquake/calculators/event_based_risk.py b/openquake/calculators/event_based_risk.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/event_based_risk.py
+++ b/openquake/calculators/event_based_risk.py
@@ -283,11 +283,10 @@ class EbrPostCalculator(base.RiskCalculator):
loss_curve_dt = scientific.build_loss_curve_dt(
cr, oq.conditional_loss_poes, oq.insured_losses)
cb_inputs = self.cb_inputs('agg_loss_table')
- I = oq.insured_losses + 1
R = len(weights)
# NB: using the Processmap since celery is hanging; the computation
# is fast anyway and this part will likely be removed in the future
- result = parallel.Sequential.apply(
+ result = parallel.Processmap.apply(
build_agg_curve, (cb_inputs, self.monitor('')),
concurrent_tasks=self.oqparam.concurrent_tasks).reduce()
agg_curve = numpy.zeros(R, loss_curve_dt) | Restore Processmap as it was
Former-commit-id: 2efb<I>f<I>fe<I>e0bca<I>b<I>a8f<I>e<I>f<I> | gem_oq-engine | train | py |
6bc6811df993ba5a9020f372abf92af0bfbbc96b | diff --git a/driver-compat/src/test/com/mongodb/DBTest.java b/driver-compat/src/test/com/mongodb/DBTest.java
index <HASH>..<HASH> 100644
--- a/driver-compat/src/test/com/mongodb/DBTest.java
+++ b/driver-compat/src/test/com/mongodb/DBTest.java
@@ -16,8 +16,10 @@
package com.mongodb;
+import category.ReplicaSet;
import org.junit.Ignore;
import org.junit.Test;
+import org.junit.experimental.categories.Category;
import static com.mongodb.DBObjectMatchers.hasFields;
import static com.mongodb.DBObjectMatchers.hasSubdocument;
@@ -66,7 +68,7 @@ public class DBTest extends DatabaseTestCase {
final String[] collectionNames = {"c1", "c2", "c3"};
- for (String name : collectionNames) {
+ for (final String name : collectionNames) {
database.createCollection(name, new BasicDBObject());
}
@@ -151,6 +153,7 @@ public class DBTest extends DatabaseTestCase {
}
@Test
+ @Category(ReplicaSet.class)
public void shouldExecuteCommandWithReadPreference() {
final CommandResult commandResult = database.command(new BasicDBObject("dbStats", 1).append("scale", 1), 0, ReadPreference.secondary());
assertThat(commandResult, hasFields(new String[]{"collections", "avgObjSize", "indexes", "db", "indexSize", "storageSize"})); | Added ReplicaSet annotation to test in driver-compat. | mongodb_mongo-java-driver | train | java |
6c997c3c39094aa5df773d0808023031507ca627 | diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index <HASH>..<HASH> 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -937,7 +937,7 @@ module ActiveRecord #:nodoc:
# Both calls delete the affected posts all at once with a single DELETE statement. If you need to destroy dependent
# associations or call your <tt>before_*</tt> or +after_destroy+ callbacks, use the +destroy_all+ method instead.
def delete_all(conditions = nil)
- active_relation.where(construct_conditions(conditions, current_scoped_methods)).delete_all
+ where(conditions).delete_all
end
# Returns the result of an SQL statement that should only include a COUNT(*) in the SELECT part. | Simplify Model.delete_all | rails_rails | train | rb |
62095d1f6f711304ab92ad05734395c5fe284a9c | diff --git a/funky/funky.py b/funky/funky.py
index <HASH>..<HASH> 100644
--- a/funky/funky.py
+++ b/funky/funky.py
@@ -226,9 +226,10 @@ def hash(obj):
def unique(collection, mapper=hash):
- return type(collection)({
- mapper(v): v for v in collection
- }.values())
+ return type(collection)(dict(
+ (mapper(v), v)
+ for v in collection
+ ).values())
def true_only(iterable): | Remove dict comprehensions for <I> compatibility, fixes #1 | FriendCode_funky | train | py |
9a367d9d06db6f6cf22121d0397c464ae36e7089 | diff --git a/hugolib/template_test.go b/hugolib/template_test.go
index <HASH>..<HASH> 100644
--- a/hugolib/template_test.go
+++ b/hugolib/template_test.go
@@ -190,10 +190,6 @@ func TestTemplateLookupOrder(t *testing.T) {
},
} {
- if i != 9 {
- continue
- }
-
cfg, fs = newTestCfg()
th = testHelper{cfg, fs, t} | hugolib: Fix broken TestTemplateLookupOrder
It looks like we left some debugging code in place that caused all but
one test case to run. | gohugoio_hugo | train | go |
166fd5d9f1e0ee7fc3cb494addb5564452e6aa7b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import setuptools
setuptools.setup(
name="Mongothon",
- version="0.7.13",
+ version="0.7.14",
author="Tom Leach",
author_email="[email protected]",
description="A MongoDB object-document mapping layer for Python",
@@ -14,6 +14,6 @@ setuptools.setup(
long_description="Mongothon is a MongoDB object-document mapping " +
"API for Python, loosely based on the awesome " +
"mongoose.js library.",
- install_requires=['pymongo>=2.5.0', 'inflection==0.2.0', 'schemer==0.2.2'],
+ install_requires=['pymongo>=2.5.0', 'inflection==0.2.0', 'schemer==0.2.3'],
tests_require=['mock', 'nose']
) | Use version <I> of schemer and bump the version number to <I> in the process | gamechanger_mongothon | train | py |
0f7b6444a796d0b5f4ca19bc4b69a31e731be036 | diff --git a/jax/lib/xla_bridge.py b/jax/lib/xla_bridge.py
index <HASH>..<HASH> 100644
--- a/jax/lib/xla_bridge.py
+++ b/jax/lib/xla_bridge.py
@@ -62,7 +62,8 @@ flags.DEFINE_bool(
'optimization is greater than that of running a less-optimized program.')
-def get_compile_options(num_replicas, num_partitions, device_assignment=None):
+def get_compile_options(num_replicas, num_partitions, device_assignment=None,
+ use_spmd_partitioning=True):
"""Returns the compile options to use, as derived from flag values.
Args:
@@ -72,10 +73,14 @@ def get_compile_options(num_replicas, num_partitions, device_assignment=None):
logical replicas to physical devices (default inherited from
xla_client.CompileOptions). Must be consistent with `num_replicas` and
`num_partitions`.
+ use_spmd_partitioning: boolean indicating whether to enable SPMD or MPMD
+ partitioning in XLA.
"""
compile_options = xla_client.CompileOptions()
compile_options.num_replicas = num_replicas
compile_options.num_partitions = num_partitions
+ build_options = compile_options.executable_build_options
+ build_options.use_spmd_partitioning = use_spmd_partitioning
if device_assignment is not None:
logging.vlog(
2, | Enable XLA SPMD partitioning by default. (#<I>)
This option is needed for sharded_jit. Future APIs may use MPMD partitioning instead. | tensorflow_probability | train | py |
1e1260702fc9180d99a968ad16ee578c009074e3 | diff --git a/signing/tests/test_ecdsa.py b/signing/tests/test_ecdsa.py
index <HASH>..<HASH> 100644
--- a/signing/tests/test_ecdsa.py
+++ b/signing/tests/test_ecdsa.py
@@ -29,7 +29,7 @@ class TestPKRecover(unittest.TestCase):
"""
# This key has a small public key value which tests padding
wifstr = '5JtMb6tmM9vT6QHyM7RR8pjMViqccukgMFNCPvG5xhLVf6CMoGx'
- priv = pbt.decode_privkey(wifstr, 'wif')
+ priv = pbt.encode_privkey(pbt.decode_privkey(wifstr, 'wif'), 'hex')
msg = 'foo'
sig = pbt.ecdsa_sign(msg, priv)
native_recovered = pbct_nativerecover.recover_pubkey(msg, sig) | Re-encode decoded privkey when loading wif
This works for both pybitcointools and bitcoin libraries. | hyperledger_sawtooth-core | train | py |
41e8be21e1feeb36b76783e0a3cc9a716b988eb1 | diff --git a/openquake/engine/bin/openquake_cli.py b/openquake/engine/bin/openquake_cli.py
index <HASH>..<HASH> 100755
--- a/openquake/engine/bin/openquake_cli.py
+++ b/openquake/engine/bin/openquake_cli.py
@@ -212,18 +212,14 @@ def list_calculations(job_type):
:param job_type: 'hazard' or 'risk'
"""
- jobs = models.OqJob.objects.filter(
- user_name=getpass.getuser())
- if job_type == 'hazard':
- jobs = jobs.filter(hazard_calculation__isnull=True)
- else: # risk
- jobs = jobs.filter(hazard_calculation__isnull=False)
- jobs = jobs.order_by('start_time')
+ jobs = [job for job in models.OqJob.objects.filter(
+ user_name=getpass.getuser()).order_by('start_time')
+ if job.job_type == job_type]
if len(jobs) == 0:
print 'None'
else:
- print ('job_id | status | start_time | '
+ print ('job_id | status | start_time | '
' description')
for job in jobs:
descr = job.description | Fixed list_calculations
Former-commit-id: e0ec2ab7e<I>da0c<I>a1cac5eb7a<I>e<I>c | gem_oq-engine | train | py |
275dd4515f3f23f5cc09bef718818a693529b1d3 | diff --git a/src/walker/rebuild_stree.js b/src/walker/rebuild_stree.js
index <HASH>..<HASH> 100644
--- a/src/walker/rebuild_stree.js
+++ b/src/walker/rebuild_stree.js
@@ -257,6 +257,7 @@ sre.RebuildStree.prototype.postProcess = function(snode, collapsed) {
var line = this.createNode(id[0]);
line.type = sre.SemanticAttr.Type.LINE;
line.role = sre.SemanticAttr.Role.BINOMIAL;
+ line.parent = snode;
line.embellished = snode.embellished;
line.fencePointer = snode.fencePointer;
children.push(line); | Adds missing parent pointer for binomial coefficients. | zorkow_speech-rule-engine | train | js |
48b2831496129f88bb5d80faa7b8b0ac19011651 | diff --git a/EventListener/TranslatableSubscriber.php b/EventListener/TranslatableSubscriber.php
index <HASH>..<HASH> 100644
--- a/EventListener/TranslatableSubscriber.php
+++ b/EventListener/TranslatableSubscriber.php
@@ -11,6 +11,7 @@
namespace Darvin\AdminBundle\EventListener;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
+use Doctrine\ORM\Id\IdentityGenerator;
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
use Doctrine\ORM\Mapping\ClassMetadata;
use Knp\DoctrineBehaviors\ORM\Translatable\TranslatableSubscriber as BaseTranslatableSubscriber;
@@ -131,6 +132,8 @@ class TranslatableSubscriber extends BaseTranslatableSubscriber
{
if (!$meta->hasField('id')) {
(new ClassMetadataBuilder($meta))->createField('id', 'integer')->generatedValue('IDENTITY')->makePrimaryKey()->build();
+
+ $meta->setIdGenerator(new IdentityGenerator());
}
if (!$meta->hasAssociation('translatable')) {
$translatable = $meta->getReflectionClass()->getMethod('getTranslatableEntityClass')->invoke(null); | Set translation entity ID generator in the translatable event subscriber. | DarvinStudio_DarvinAdminBundle | train | php |
3bce32cf1b7b29a121098a641c41341c226bc209 | diff --git a/ayrton/__init__.py b/ayrton/__init__.py
index <HASH>..<HASH> 100644
--- a/ayrton/__init__.py
+++ b/ayrton/__init__.py
@@ -151,7 +151,7 @@ def polute (d):
'_k', '_p', '_r', '_s', '_u', '_w', '_x', '_L',
'_N', '_S', '_nt', '_ot' ],
'ayrton.expansion': [ 'bash', ],
- 'ayrton.functions': [ 'cd', 'export', 'option', 'remote', 'run',
+ 'ayrton.functions': [ 'cd', ('cd', 'chdir'), 'export', 'option', 'remote', 'run',
'shift', 'source', 'unset', ],
'ayrton.execute': [ 'o', 'Capture', 'CommandFailed', 'CommandNotFound',
'Pipe', ], | [+] chdir() is an alias of cd(). | StyXman_ayrton | train | py |
110fab3e5473425399a0f53021f7bff6b6ea8df4 | diff --git a/lib/blockdevice.js b/lib/blockdevice.js
index <HASH>..<HASH> 100644
--- a/lib/blockdevice.js
+++ b/lib/blockdevice.js
@@ -58,16 +58,27 @@ BlockDevice.prototype = {
/**
* Opens a file descriptor for this device
+ * @param {Function} callback
* @return {BlockDevice}
*/
- open: function() {
+ open: function( callback ) {
+
+ var self = this
// Close a previously opened handle
- if( this.fd != null )
- this.close()
+ if( this.fd != null ) {
+ return this.close( function( error ) {
+ if( error != null )
+ return callback.call( self, error )
+ self.open( self.path, self.mode, callback )
+ })
+ }
// Open a new fd handle
- this.fd = this.fs.openSync( this.path, this.mode )
+ this.fs.open( this.path, this.mode, function( error, fd ) {
+ self.fd = fd
+ callback.call( self, error, fd )
+ })
return this | Updated lib: Made device.open(cb) async | jhermsmeier_node-blockdevice | train | js |
9f501cdbea72ef574764ed1027a83a85a959bc24 | diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupCountTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupCountTest.java
index <HASH>..<HASH> 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupCountTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupCountTest.java
@@ -159,7 +159,7 @@ public abstract class GroupCountTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_V_filterXfalseX_groupCount() {
+ public void g_V_hasXnoX_groupCount() {
final Traversal<Vertex, Map<Object, Long>> traversal = get_g_V_hasXnoX_groupCount();
printTraversalForm(traversal);
assertCommonC(traversal); | Remove an old test that is no longer relevant. CTR | apache_tinkerpop | train | java |
ad267f24dc24ce5252b11fec6c01a31967027dd9 | diff --git a/lib/mongoid_atomic_votes/atomic_votes.rb b/lib/mongoid_atomic_votes/atomic_votes.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid_atomic_votes/atomic_votes.rb
+++ b/lib/mongoid_atomic_votes/atomic_votes.rb
@@ -1,4 +1,5 @@
module Mongoid
+ # Module implements voting functionality
module AtomicVotes
class << self
def included(base)
@@ -81,6 +82,8 @@ module Mongoid
false
end
+ # Class methods which are added to the document/model class
+ # Provides possibility to customize vote range for a model
module ClassMethods
attr_reader :vote_range
diff --git a/lib/mongoid_atomic_votes/vote.rb b/lib/mongoid_atomic_votes/vote.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid_atomic_votes/vote.rb
+++ b/lib/mongoid_atomic_votes/vote.rb
@@ -1,3 +1,4 @@
+# Vote class which stores information about particular vote mark
class Mongoid::AtomicVotes::Vote
include Mongoid::Document
include Mongoid::Timestamps::Created | Add top-level comments to classes/modules. | hck_mongoid_atomic_votes | train | rb,rb |
777f5488205900b239255ed6f005cf74fa9d46ca | diff --git a/py/h2o.py b/py/h2o.py
index <HASH>..<HASH> 100644
--- a/py/h2o.py
+++ b/py/h2o.py
@@ -1053,6 +1053,7 @@ class H2O(object):
if self.java_heap_GB is not None:
if (1 > self.java_heap_GB > 63):
raise Exception('java_heap_GB <1 or >63 (GB): %s' % (self.java_heap_GB))
+ args += [ '-Xms%dG' % self.java_heap_GB ]
args += [ '-Xmx%dG' % self.java_heap_GB ]
if self.java_extra_args is not None: | apparently tomas says we need Xms specified also for java heap? seeing parse hangs | h2oai_h2o-2 | train | py |
b2a4d3fca73f47259fc3bc833c2be0cb67eddf0e | diff --git a/src/test/java/com/ebay/web/cors/TestConfigs.java b/src/test/java/com/ebay/web/cors/TestConfigs.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/ebay/web/cors/TestConfigs.java
+++ b/src/test/java/com/ebay/web/cors/TestConfigs.java
@@ -35,6 +35,20 @@ public class TestConfigs {
allowedOrigins, exposedHeaders, supportCredentials,
preflightMaxAge);
}
+
+ public static FilterConfig getFilterConfigInvalidMaxPreflightAge() {
+ final String allowedHttpHeaders = "Content-Type";
+ final String allowedHttpMethods = "GET,POST,HEAD,OPTIONS";
+ final String allowedOrigins = HTTPS_WWW_APACHE_ORG + ","
+ + HTTP_TOMCAT_APACHE_ORG;
+ final String exposedHeaders = "Content-Encoding";
+ final String supportCredentials = "true";
+ final String preflightMaxAge = "abc";
+
+ return generateFilterConfig(allowedHttpHeaders, allowedHttpMethods,
+ allowedOrigins, exposedHeaders, supportCredentials,
+ preflightMaxAge);
+ }
private static FilterConfig generateFilterConfig(
final String allowedHttpHeaders, final String allowedHttpMethods, | Added test config for NFE | eBay_cors-filter | train | java |
4aa2c5b45cfdede5b7bd62856ff5e76ea7ce734a | diff --git a/plugins/products/cloudfoundry/cmd/cloudfoundry/main.go b/plugins/products/cloudfoundry/cmd/cloudfoundry/main.go
index <HASH>..<HASH> 100644
--- a/plugins/products/cloudfoundry/cmd/cloudfoundry/main.go
+++ b/plugins/products/cloudfoundry/cmd/cloudfoundry/main.go
@@ -1,4 +1,4 @@
-package cloudfoundry
+package main
import (
"github.com/enaml-ops/omg-cli/pluginlib/product"
diff --git a/plugins/products/redis/cmd/redis/main.go b/plugins/products/redis/cmd/redis/main.go
index <HASH>..<HASH> 100644
--- a/plugins/products/redis/cmd/redis/main.go
+++ b/plugins/products/redis/cmd/redis/main.go
@@ -1,4 +1,4 @@
-package redis
+package main
import (
"github.com/enaml-ops/omg-cli/pluginlib/product"
diff --git a/plugins/products/vault/cmd/vault/main.go b/plugins/products/vault/cmd/vault/main.go
index <HASH>..<HASH> 100644
--- a/plugins/products/vault/cmd/vault/main.go
+++ b/plugins/products/vault/cmd/vault/main.go
@@ -1,4 +1,4 @@
-package vault
+package main
import (
"github.com/enaml-ops/omg-cli/pluginlib/product" | fixed issue with plugin main.go not in main package | enaml-ops_omg-cli | train | go,go,go |
384abfd26f27a1588d2abd20ec3af964b21b1ced | diff --git a/remote/common/src/java/org/openqa/selenium/remote/DesiredCapabilities.java b/remote/common/src/java/org/openqa/selenium/remote/DesiredCapabilities.java
index <HASH>..<HASH> 100644
--- a/remote/common/src/java/org/openqa/selenium/remote/DesiredCapabilities.java
+++ b/remote/common/src/java/org/openqa/selenium/remote/DesiredCapabilities.java
@@ -24,6 +24,7 @@ import java.util.Map;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.Platform;
+import org.openqa.selenium.browserlaunchers.CapabilityType;
import static org.openqa.selenium.browserlaunchers.CapabilityType.BROWSER_NAME;
import static org.openqa.selenium.browserlaunchers.CapabilityType.PLATFORM;
@@ -157,7 +158,10 @@ public class DesiredCapabilities implements Serializable, Capabilities {
}
public static DesiredCapabilities internetExplorer() {
- return new DesiredCapabilities("internet explorer", "", Platform.WINDOWS);
+ DesiredCapabilities capabilities = new DesiredCapabilities(
+ "internet explorer", "", Platform.WINDOWS);
+ capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);
+ return capabilities;
}
public static DesiredCapabilities htmlUnit() { | SimonStewart: Make the IE driver consistent with the chrome and firefox drivers
r<I> | SeleniumHQ_selenium | train | java |
4b355c977ca007ec9b21762e80ae5329acad255a | diff --git a/src/Test/TestUtil.php b/src/Test/TestUtil.php
index <HASH>..<HASH> 100644
--- a/src/Test/TestUtil.php
+++ b/src/Test/TestUtil.php
@@ -43,7 +43,7 @@ final class TestUtil
// symlink to another directory (e.g. /var => /private/var on some Macs)
// We want to know the real path to avoid comparison failures with
// code that uses real paths only
- $systemTempDir = realpath(sys_get_temp_dir());
+ $systemTempDir = str_replace('\\', '/', realpath(sys_get_temp_dir()));
$basePath = $systemTempDir.'/'.$namespace.'/'.$shortClass;
while (false === @mkdir($tempDir = $basePath.rand(10000, 99999), 0777, true)) { | Ensuring that windows paths are normalized, when running tests
This is effectively re-introducing `Path::normalize()` from `webmozart/path-util`, but without the dependency requirement | webmozart_glob | train | php |
5b0576271f57a1f44ea71d709b43c6f2273f7f37 | diff --git a/Generator/Module.php b/Generator/Module.php
index <HASH>..<HASH> 100644
--- a/Generator/Module.php
+++ b/Generator/Module.php
@@ -112,6 +112,7 @@ class Module extends RootComponent {
return ucwords(str_replace('_', ' ', $component_data['root_name']));
},
'required' => FALSE,
+ 'process_default' => TRUE,
),
'short_description' => array(
'label' => 'Module .info file description', | Added process default to module readable name. | drupal-code-builder_drupal-code-builder | train | php |
2ac8e8d0b11e5e7fb1b987e74a5f20ae03e64765 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ setup(
"Topic :: Utilities",
],
install_requires=[
- 'Django>=1.3',
+ 'Django>=1.2',
],
include_package_data=True,
zip_safe = False, | Seems it works with django <I> as well | KristianOellegaard_django-health-check | train | py |
1be155ab8c0ebd67b5c8f1290727bab74c7604c7 | diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpFoundation/Response.php
+++ b/src/Symfony/Component/HttpFoundation/Response.php
@@ -989,6 +989,10 @@ class Response
*/
public function isNotModified(Request $request)
{
+ if (!$request->isMethodSafe()) {
+ return false;
+ }
+
$lastModified = $request->headers->get('If-Modified-Since');
$notModified = false;
if ($etags = $request->getEtags()) { | [HttpFoundation] never send a <I> for non-safe HTTP methods | symfony_symfony | train | php |
d6748bf81f17976fd1f75d9050065acadd7b843d | diff --git a/cohorts/load.py b/cohorts/load.py
index <HASH>..<HASH> 100644
--- a/cohorts/load.py
+++ b/cohorts/load.py
@@ -207,6 +207,8 @@ class Cohort(Collection):
A list of `Patient`s for this cohort.
cache_dir : str
Path to store cached results, e.g. cached variant effects.
+ ensembl_version : int
+ Cached release version to use from pyensembl e.g. for Kallisto
cache_results : bool
Whether or not to cache results.
extra_df_loaders : List
diff --git a/test/test_basic.py b/test/test_basic.py
index <HASH>..<HASH> 100644
--- a/test/test_basic.py
+++ b/test/test_basic.py
@@ -51,6 +51,7 @@ def make_simple_cohort(merge_type="union", **kwargs):
return Cohort(
patients=patients,
+ ensembl_version=75,
responder_pfs_equals_os=True,
merge_type=merge_type,
cache_dir=generated_data_path("cache")) | added ensemble_version comment to Cohort.__init__; added ensembl_version to make_simple_cohort | hammerlab_cohorts | train | py,py |
e40c86c16e0fac99a55d63a9a6bf1e2c91dec11d | diff --git a/lib/gds_api/panopticon/registerer.rb b/lib/gds_api/panopticon/registerer.rb
index <HASH>..<HASH> 100644
--- a/lib/gds_api/panopticon/registerer.rb
+++ b/lib/gds_api/panopticon/registerer.rb
@@ -20,7 +20,7 @@ module GdsApi
description: record.description,
live: record.live
}
- [:need_id, :section, :indexable_content].each do |attr_name|
+ [:need_id, :section, :indexable_content, :paths, :prefixes].each do |attr_name|
if record.respond_to? attr_name
hash[attr_name] = record.send(attr_name)
end | Pass on paths/prefixes to Panopticon registration | alphagov_gds-api-adapters | train | rb |
142efb1e6e982d690f431e50df283565b740c6a0 | diff --git a/ActiveQuery.php b/ActiveQuery.php
index <HASH>..<HASH> 100644
--- a/ActiveQuery.php
+++ b/ActiveQuery.php
@@ -9,7 +9,6 @@ namespace yii\mongodb;
use yii\db\ActiveQueryInterface;
use yii\db\ActiveQueryTrait;
-use yii\db\ActiveRelationInterface;
use yii\db\ActiveRelationTrait;
/**
@@ -60,7 +59,7 @@ use yii\db\ActiveRelationTrait;
* @author Paul Klimov <[email protected]>
* @since 2.0
*/
-class ActiveQuery extends Query implements ActiveQueryInterface, ActiveRelationInterface
+class ActiveQuery extends Query implements ActiveQueryInterface
{
use ActiveQueryTrait;
use ActiveRelationTrait;
diff --git a/file/ActiveQuery.php b/file/ActiveQuery.php
index <HASH>..<HASH> 100644
--- a/file/ActiveQuery.php
+++ b/file/ActiveQuery.php
@@ -9,7 +9,6 @@ namespace yii\mongodb\file;
use yii\db\ActiveQueryInterface;
use yii\db\ActiveQueryTrait;
-use yii\db\ActiveRelationInterface;
use yii\db\ActiveRelationTrait;
/**
@@ -36,7 +35,7 @@ use yii\db\ActiveRelationTrait;
* @author Paul Klimov <[email protected]>
* @since 2.0
*/
-class ActiveQuery extends Query implements ActiveQueryInterface, ActiveRelationInterface
+class ActiveQuery extends Query implements ActiveQueryInterface
{
use ActiveQueryTrait;
use ActiveRelationTrait; | merged ActiveQueryInterface and ActiveRelatioInterface | yiisoft_yii2-mongodb | train | php,php |
3e2d82765a7fc27c6db74474d186701ac7284de7 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -11,17 +11,19 @@ module.exports = {
name: 'ember-auto-import',
included() {
- this._depFinder = new DepFinder(this.project);
- this.import('ember-auto-imports/ember-auto-imports.js');
- this.import('ember-auto-imports/ember-auto-imports-test.js', { type: 'test' });
+ this._depFinder = new DepFinder(this.parent);
+ this.import(`${this.parent.pkg.name}/ember-auto-imports.js`);
+ if (this.project === this.parent) {
+ this.import(`${this.parent.pkg.name}/ember-auto-imports-test.js`, { type: 'test' });
+ }
},
postprocessTree: function(type, tree){
let outputFile;
if (type === 'js'){
- outputFile = 'ember-auto-imports/ember-auto-imports.js';
+ outputFile = `${this.parent.pkg.name}/ember-auto-imports.js`;
} else if (type === 'test') {
- outputFile = 'ember-auto-imports/ember-auto-imports-test.js';
+ outputFile = `${this.parent.pkg.name}/ember-auto-imports-test.js`;
}
if (outputFile) { | locate dependencies relative to each addon's parent | ef4_ember-auto-import | train | js |
2c7a85cb988fdccccf36cae13e2c3a555cdd56d3 | diff --git a/lib/informer.js b/lib/informer.js
index <HASH>..<HASH> 100644
--- a/lib/informer.js
+++ b/lib/informer.js
@@ -992,7 +992,7 @@ module.exports = function BlastInformer(Blast, Collection) {
*
* @author Jelle De Loecker <[email protected]>
* @since 0.1.3
- * @version 0.1.9
+ * @version 0.6.3
*
* @param {String|Object} type
*/
@@ -1067,15 +1067,23 @@ module.exports = function BlastInformer(Blast, Collection) {
tasks = [];
subtasks = [];
- listeners.forEach(function eachListener(list, index) {
+ if (this.constructor.name == 'Note') {
+ console.log('There are', listeners.length, 'listeners')
+ console.log(listeners, this.forward_targets);
+ }
- var listener,
- context,
- config,
- octx;
+ for (let index = 0; index < listeners.length; index++) {
// Skip the first 2 items
- if (index < 2) return;
+ if (index < 2) {
+ continue;
+ }
+
+ let listener,
+ context,
+ config,
+ octx,
+ list = listeners[index];
listener = list[0];
octx = context = list[2];
@@ -1142,7 +1150,7 @@ module.exports = function BlastInformer(Blast, Collection) {
// those callbacks will be caught later
next();
};
- });
+ }
// Run the functions (but do it immediately, `series` should use
// Blast.callNow instead of setImmediate) | Use let in Informer#emit() | skerit_protoblast | train | js |
3e3d8dc9981ec564c6d4a88c3cc5ecf7b4bea1d8 | diff --git a/helios-testing/src/main/java/com/spotify/helios/testing/TemporaryJobs.java b/helios-testing/src/main/java/com/spotify/helios/testing/TemporaryJobs.java
index <HASH>..<HASH> 100644
--- a/helios-testing/src/main/java/com/spotify/helios/testing/TemporaryJobs.java
+++ b/helios-testing/src/main/java/com/spotify/helios/testing/TemporaryJobs.java
@@ -492,7 +492,7 @@ public class TemporaryJobs implements TestRule {
}
private Builder(final String profile, final Config preConfig) {
- log.debug("Using profile: " + profile);
+ log.info("Using profile: " + profile);
if (profile != null) {
final String key = HELIOS_TESTING_PROFILES + profile;
if (preConfig.hasPath(key)) { | Log "Using profile" as info instead of debug
I usually log at info level because debug is noisy, but I'd
still like to see which profile I'm using. | spotify_helios | train | java |
170da4ab07cf16800b6abd8c6cfe621c99360950 | diff --git a/lib/createObjProperties.js b/lib/createObjProperties.js
index <HASH>..<HASH> 100644
--- a/lib/createObjProperties.js
+++ b/lib/createObjProperties.js
@@ -2,6 +2,8 @@ var util = require('util');
function createProperties(d, a, obj) {
+ obj = obj || d;
+
function addDescriptors(d, o, p) {
if (p.key) {
var key = p.key;
@@ -42,7 +44,7 @@ function createProperties(d, a, obj) {
};
return addDescriptors(d[p.key], o, p.key);
});
- d[p.key] = createProperties(d[p.key], props, d[p.key]);
+ d[p.key] = createProperties(d[p.key], props);
}
o = addDescriptors(d, o, p); | assign obj on undef | jkutianski_meetup-api | train | js |
e844cbc85c5266dcbef2848b8d246d3d7b6bc384 | diff --git a/src/test/org/openscience/cdk/modeling/builder3d/FurtherAtomPlacer3DTest.java b/src/test/org/openscience/cdk/modeling/builder3d/FurtherAtomPlacer3DTest.java
index <HASH>..<HASH> 100644
--- a/src/test/org/openscience/cdk/modeling/builder3d/FurtherAtomPlacer3DTest.java
+++ b/src/test/org/openscience/cdk/modeling/builder3d/FurtherAtomPlacer3DTest.java
@@ -347,7 +347,7 @@ public class FurtherAtomPlacer3DTest extends AtomPlacer3DTest {
String id1 = molecule.getAtom(2).getAtomTypeName();
String id2 = molecule.getAtom(3).getAtomTypeName();
double bondlength = atomPlacer3d.getBondLengthValue(id1, id2);
- Assert.assertEquals(1.482, bondlength, 0.001);
+ Assert.assertEquals(1.451, bondlength, 0.001);
} | corrected assertion, refer to data added in: commit deebfaba<I>
Change-Id: I<I>b<I>b<I>df<I>fbfc<I>ea0b<I>dcfc<I> | cdk_cdk | train | java |
281b4561ab4c4ee627b181f404f9e74a3d2960ad | diff --git a/spec/heroku/command/base_spec.rb b/spec/heroku/command/base_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/heroku/command/base_spec.rb
+++ b/spec/heroku/command/base_spec.rb
@@ -25,12 +25,14 @@ module Heroku::Command
it "confirms the app interactively via ask" do
@base.stub(:app).and_return("myapp")
@base.stub(:ask).and_return("myapp")
+ Heroku::Command.stub(:current_options).and_return({})
@base.confirm_command.should be_true
end
it "fails if the interactive confirm doesn't match" do
@base.stub(:app).and_return("myapp")
@base.stub(:ask).and_return("badresponse")
+ Heroku::Command.stub(:current_options).and_return({})
capture_stderr do
lambda { @base.confirm_command }.should raise_error(SystemExit)
end.should == <<-STDERR | fixes for intermitent error around confirm_command tests | heroku_legacy-cli | train | rb |
38def14bcb7cb4728874a7c5ece4fe0c60ec135e | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -60,9 +60,11 @@ author = 'Nicholas Bishop'
# built documents.
#
# The short X.Y version.
-version = '0.7.2'
+from tools import version_util
+version_xy = version_util.load_version_as_list()[:2]
+version = version_util.format_version_string(version_xy)
# The full version, including alpha/beta/rc tags.
-release = '0.7.2'
+release = version_util.load_version_as_string()
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. | Automate version in sphinx | nicholasbishop_shaderdef | train | py |
ab01ac99e3669db772f9e5a0a561aef6ba55b971 | diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php
index <HASH>..<HASH> 100644
--- a/code/Controllers/CMSMain.php
+++ b/code/Controllers/CMSMain.php
@@ -2144,6 +2144,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
return $this->batchactions()->batchActionList();
}
+ /**
+ * @deprecated 5.0 Please use custom logic for this
+ * @param $request
+ * @return HTTPResponse|string|void
+ */
public function publishall($request)
{
if (!Permission::check('ADMIN')) {
@@ -2195,7 +2200,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
__CLASS__ . '.PUBALLFUN2',
'Pressing this button will do the equivalent of going to every page and pressing "publish". '
. 'It\'s intended to be used after there have been massive edits of the content, such as when '
- . 'the site was first built.'
+ . 'the site was first built. '
+ . 'For large websites, this task might not be able to run through to completion. '
+ . 'In this case, we recommend talking to your developers to create a custom task'
);
$response .= '<h1>' . _t(__CLASS__ . '.PUBALLFUN', '"Publish All" functionality') . '</h1>
<p>' . $publishAllDescription . '</p> | API Deprecated CMSMain->publishall()
The current implementation doesn't scale,
and due to the proliferation of versioned objects
no longer fully works (e.g. doesn't publish all files).
Fixes <URL> | silverstripe_silverstripe-cms | train | php |
52e5a7a2a3e3996baa0f4b155453a3807ea8241a | diff --git a/google-cloud-spanner/lib/google/cloud/spanner/pool.rb b/google-cloud-spanner/lib/google/cloud/spanner/pool.rb
index <HASH>..<HASH> 100644
--- a/google-cloud-spanner/lib/google/cloud/spanner/pool.rb
+++ b/google-cloud-spanner/lib/google/cloud/spanner/pool.rb
@@ -86,11 +86,11 @@ module Google
end
def checkin_session session
- unless all_sessions.include? session
- fail ArgumentError, "Cannot checkin session"
- end
-
@mutex.synchronize do
+ unless all_sessions.include? session
+ fail ArgumentError, "Cannot checkin session"
+ end
+
session_queue.push session
@resource.signal
@@ -144,11 +144,11 @@ module Google
end
def checkin_transaction tx
- unless all_sessions.include? tx.session
- fail ArgumentError, "Cannot checkin session"
- end
-
@mutex.synchronize do
+ unless all_sessions.include? tx.session
+ fail ArgumentError, "Cannot checkin session"
+ end
+
transaction_queue.push tx
@resource.signal | Synchonize session check
Make sure that the check that the resource belongs to the Pool is made
in a synchonize block to make sure the latest known sessions are available. | googleapis_google-cloud-ruby | train | rb |
cf098a989d4381b80b405a2aa64597a69bae976a | diff --git a/app/controllers/rooms.js b/app/controllers/rooms.js
index <HASH>..<HASH> 100644
--- a/app/controllers/rooms.js
+++ b/app/controllers/rooms.js
@@ -195,6 +195,10 @@ module.exports = function() {
var userIds = core.presence.rooms
.getOrAdd(room._id, room.slug).getUserIds();
+ if (!userIds.length) {
+ return req.io.respond([]);
+ }
+
User.find({ _id: { $in: userIds } }, function(err, users) {
if (err) {
// Something bad happened | Don't query the database for users, if no users are in the room! | sdelements_lets-chat | train | js |
ff8ab621bc5f2ecac56c296a27949ea88063345d | diff --git a/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/HorizontalChangeHandler.java b/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/HorizontalChangeHandler.java
index <HASH>..<HASH> 100755
--- a/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/HorizontalChangeHandler.java
+++ b/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/HorizontalChangeHandler.java
@@ -46,7 +46,7 @@ public class HorizontalChangeHandler extends AnimatorChangeHandler {
}
if (to != null) {
// Allow this to have a nice transition when coming off an aborted push animation
- float fromLeft = from != null ? from.getX() : 0;
+ float fromLeft = from != null ? from.getTranslationX() : 0;
animatorSet.play(ObjectAnimator.ofFloat(to, View.TRANSLATION_X, fromLeft - to.getWidth(), 0));
}
} | From controller’s initial position now correctly based on translationX in HorizontalChangeHandler. Fixes #<I> | bluelinelabs_Conductor | train | java |
033cd414c3447dbfa4b26e001c41c381f66cd4d0 | diff --git a/lib/Skeleton/Transaction/Transaction.php b/lib/Skeleton/Transaction/Transaction.php
index <HASH>..<HASH> 100644
--- a/lib/Skeleton/Transaction/Transaction.php
+++ b/lib/Skeleton/Transaction/Transaction.php
@@ -24,6 +24,13 @@ abstract class Transaction {
use \Skeleton\Object\Delete;
/**
+ * Non-persistent rescheduled flag
+ *
+ * @var boolean
+ */
+ private $rescheduled = false;
+
+ /**
* Run transaction
*
* @abstract
@@ -147,6 +154,10 @@ abstract class Transaction {
}
$this->save();
+
+ // Keep a non-persistent flag, so we know not to mark this as completed
+ // later on.
+ $this->rescheduled = true;
}
/**
@@ -216,6 +227,11 @@ abstract class Transaction {
* @param string $date
*/
public function mark_completed($output, $date = null) {
+ // Don't mark this transaction as completed if it has been rescheduled.
+ if ($this->rescheduled) {
+ return;
+ }
+
$transaction_log = new \Skeleton\Transaction\Log();
$transaction_log->transaction_id = $this->id;
$transaction_log->output = $output; | Keep track of calls to schedule()
If a transaction gets rescheduled at runtime, it shouldn't be marked
as completed when done. | tigron_skeleton-transaction | train | php |
3b04c7c3ca480c43d2d5eace21a48e87b8b551bd | diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js
index <HASH>..<HASH> 100644
--- a/js/bootstrap-select.js
+++ b/js/bootstrap-select.js
@@ -293,7 +293,7 @@
};
}
- if (!HTMLSelectElement.prototype.hasOwnProperty('selectedOptions')) {
+ if (HTMLSelectElement && !HTMLSelectElement.prototype.hasOwnProperty('selectedOptions')) {
Object.defineProperty(HTMLSelectElement.prototype, 'selectedOptions', {
get: function () {
return this.querySelectorAll(':checked'); | check for HTMLSelectElement to fix issues with server-side rendering (#<I>) | snapappointments_bootstrap-select | train | js |
03f81136e02b86a84b6bf950f7489be08b52d134 | diff --git a/lib/IpaReader.js b/lib/IpaReader.js
index <HASH>..<HASH> 100644
--- a/lib/IpaReader.js
+++ b/lib/IpaReader.js
@@ -5,7 +5,7 @@ var plist = require('./plistParser');
var PNGReader = require('isomorphic-png.js');
var PLIST_REG = new RegExp('payload\/.+?\.app\/info.plist$', 'i');
-var PROVISION_REG = /\bembedded.mobileprovision/;
+var PROVISION_REG = /payload\/.+?\.app\/embedded.mobileprovision/;
var DEFAULT_OPTIONS = {
withIcon: false, | fix more than one embedded.mobileprovision file bug | xiaoyuze88_isomorphic-pkg-reader | train | js |
01e17006ca6733354ad6bf8587c4c2b44c84a583 | diff --git a/app/helpers/rails_admin/form_builder.rb b/app/helpers/rails_admin/form_builder.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/rails_admin/form_builder.rb
+++ b/app/helpers/rails_admin/form_builder.rb
@@ -38,13 +38,12 @@ module RailsAdmin
end
def field_wrapper_for(field, nested_in)
+ # do not show nested field if the target is the origin
+ return if nested_field_association?(field, nested_in)
@template.content_tag(:div, class: "form-group control-group #{field.type_css_class} #{field.css_class} #{'error' if field.errors.present?}", id: "#{dom_id(field)}_field") do
if field.label
- # do not show nested field if the target is the origin
- unless nested_field_association?(field, nested_in)
- label(field.method_name, capitalize_first_letter(field.label), class: 'col-sm-2 control-label') +
- (field.nested_form ? field_for(field) : input_for(field))
- end
+ label(field.method_name, capitalize_first_letter(field.label), class: 'col-sm-2 control-label') +
+ (field.nested_form ? field_for(field) : input_for(field))
else
field.nested_form ? field_for(field) : input_for(field)
end | Hide association input for deeply nested fields | sferik_rails_admin | train | rb |
85bd38ba8d1473d5ab623f1de5584b7d8294359d | diff --git a/lib/searchkick.rb b/lib/searchkick.rb
index <HASH>..<HASH> 100644
--- a/lib/searchkick.rb
+++ b/lib/searchkick.rb
@@ -47,7 +47,7 @@ module Searchkick
Elasticsearch::Client.new({
url: ENV["ELASTICSEARCH_URL"],
transport_options: {request: {timeout: timeout}, headers: {content_type: "application/json"}}
- }.merge(client_options)) do |f|
+ }.deep_merge(client_options)) do |f|
f.use Searchkick::Middleware
f.request :aws_signers_v4, {
credentials: Aws::Credentials.new(aws_credentials[:access_key_id], aws_credentials[:secret_access_key]), | Use deep_merge for client_options [skip ci] | ankane_searchkick | train | rb |
f42d6d2a89d9bd81ec43a47bdb7457a028029c85 | diff --git a/src/main/java/org/citygml4j/model/appearance/AbstractTextureParameterization.java b/src/main/java/org/citygml4j/model/appearance/AbstractTextureParameterization.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/citygml4j/model/appearance/AbstractTextureParameterization.java
+++ b/src/main/java/org/citygml4j/model/appearance/AbstractTextureParameterization.java
@@ -26,6 +26,10 @@ import org.xmlobjects.gml.model.common.LocalProperties;
public abstract class AbstractTextureParameterization extends GMLObject implements CityGMLObject {
private LocalProperties localProperties;
+ public boolean hasLocalProperties() {
+ return localProperties != null;
+ }
+
public LocalProperties getLocalProperties() {
if (localProperties == null)
localProperties = new LocalProperties(); | added hasLocalProperties method | citygml4j_citygml4j | train | java |
ca3eba86d3ede422cd6c80297a98eeed456745b5 | diff --git a/src/testkit/RestClientDriver.js b/src/testkit/RestClientDriver.js
index <HASH>..<HASH> 100644
--- a/src/testkit/RestClientDriver.js
+++ b/src/testkit/RestClientDriver.js
@@ -88,6 +88,6 @@ export default class RestClientDriver {
_nock = _nock.query(query);
_nock = _nock.delayConnection(delay);
_nock = _nock.times(-1);
- _nock.reply(status, response);
+ _nock.reply(status, response, { 'Access-Control-Allow-Origin': '*' });
}
} | add cors response header, for testing in browser environment | wix_wix-restaurants-js-sdk | train | js |
1476e25bd3c93e03f96434dc30a62451b7cca8ea | diff --git a/timber-starter-theme/functions.php b/timber-starter-theme/functions.php
index <HASH>..<HASH> 100644
--- a/timber-starter-theme/functions.php
+++ b/timber-starter-theme/functions.php
@@ -2,7 +2,7 @@
if (!class_exists('Timber')){
add_action( 'admin_notices', function(){
- echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="/wp-admin/plugins.php#timber">/wp-admin/plugins.php</a></p></div>';
+ echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . admin_url() . 'plugins.php#timber">' . admin_url() . 'plugins.php</a></p></div>';
});
return;
} | Use admin_url() in 'Timber not activated' message in case WP installed at custom path | timber_timber | train | php |
9e6548187a6ec258ef3c7c4289fb740077ef5416 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@
from __future__ import with_statement
import re
+import sys
try:
import setuptools as impl
@@ -18,6 +19,8 @@ with open('path.py') as path_mod:
pattern = re.compile(r'''__version__ = ['"](?P<version>[\d.]+)['"]''')
version = pattern.search(source).group('version')
+sphinx_req = ['sphinx'] if 'build_sphinx' in sys.argv else []
+
setup_params = dict(
name="path.py",
version=version,
@@ -42,6 +45,7 @@ setup_params = dict(
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules'
],
+ setup_requires=sphinx_req,
) | Add support for sphinx_build command. | jaraco_path.py | train | py |
ceeaa611b63a670d71ad9097ef98537900f5c88a | diff --git a/python/nanotime.py b/python/nanotime.py
index <HASH>..<HASH> 100644
--- a/python/nanotime.py
+++ b/python/nanotime.py
@@ -4,7 +4,7 @@ import calendar
__author__ = '[email protected]'
-__version__ = '0.5.1'
+__version__ = '0.5.2'
__doc__ = '''
@@ -68,7 +68,11 @@ class nanotime(object):
return self._ns
def __str__(self):
- return '%s%s' % (self.datetime(), str(self._ns)[-3:])
+ frac = str(self._ns)[-9:]
+ # when microseconds == 000000, datetime doesnt print them.
+ if frac[:6] == '000000':
+ return '%s.%s' % (self.datetime(), frac)
+ return '%s%s' % (self.datetime(), frac[-3:])
def __repr__(self):
return 'nanotime.nanotime(%d)' % self._ns | Bugfix: printing nanotimes with 0 microseconds do not rely on str(datetime) | jbenet_nanotime | train | py |
0715d794462e8d49388316b8118a3b911a22eed8 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -17,6 +17,7 @@ testit('passes', function () {
passes('\npublic');
passes('abc // my comment', {lineComment: true});
passes('() => a');
+ passes('function (a = "default") {"use strict";}');
});
function error(src, line, col, options) {
@@ -43,4 +44,5 @@ testit('fails', function () {
error('\npublic', 2, 0, {strict: true});
error('abc // my comment', 1, 4);
error('() => a', 1, 1, {ecmaVersion: 5});
+ error('function (a = "default") {"use strict";}', 1, 26, {ecmaVersion: 7});
}); | Add a test case for ES<I> features | pugjs_is-expression | train | js |
7754c35de9eac59b3369f4e712e0ee4909a8473d | diff --git a/lib/rspec_api_documentation/dsl.rb b/lib/rspec_api_documentation/dsl.rb
index <HASH>..<HASH> 100644
--- a/lib/rspec_api_documentation/dsl.rb
+++ b/lib/rspec_api_documentation/dsl.rb
@@ -1,3 +1,4 @@
+require "rspec_api_documentation"
require "rspec_api_documentation/dsl/resource"
require "rspec_api_documentation/dsl/endpoint"
require "rspec_api_documentation/dsl/callback" | requiring dsl should require the whole library | zipmark_rspec_api_documentation | train | rb |
cb0d3bc4e732a5b93bf52c6b31850c94a5d3696d | diff --git a/assembla/__init__.py b/assembla/__init__.py
index <HASH>..<HASH> 100644
--- a/assembla/__init__.py
+++ b/assembla/__init__.py
@@ -1,3 +1,3 @@
from .api import *
-__VERSION__ = '2.3.1'
\ No newline at end of file
+__VERSION__ = '2.4.0'
\ No newline at end of file | Bumping the version to <I> | markfinger_assembla | train | py |
63ec8bf84917fb5ff8079bdac832832775c74710 | diff --git a/icstask.py b/icstask.py
index <HASH>..<HASH> 100644
--- a/icstask.py
+++ b/icstask.py
@@ -31,7 +31,7 @@ from vobject import iCalendar, readOne
class IcsTask:
"""Represents a collection of Tasks"""
- def __init__(self, data_location=expanduser('~/.task'), localtz=None, task_projects=[]):
+ def __init__(self, data_location=expanduser('~/.task'), localtz=None, task_projects=[], start_task=True):
"""Constructor
data_location -- Path to the Taskwarrior data directory
@@ -39,6 +39,7 @@ class IcsTask:
self._data_location = data_location
self._localtz = localtz if localtz else get_localzone()
self._task_projects = task_projects
+ self._start_task = start_task
self._lock = Lock()
self._mtime = 0
self._tasks = {}
@@ -246,7 +247,7 @@ class IcsTask:
if hasattr(vtodo, 'status'):
if vtodo.status.value == 'IN-PROCESS':
task['status'] = 'pending'
- if 'start' not in task:
+ if self._start_task and 'start' not in task:
task['start'] = self._tw_timestamp(vtodo.dtstamp.value)
elif vtodo.status.value == 'NEEDS-ACTION':
task['status'] = 'pending' | Add start_task option to optionally don't start tasks | jspricke_python-icstask | train | py |
eeb1853d3775aa3b0d66e41778665688013ecfbe | diff --git a/includes/functions/functions_db.php b/includes/functions/functions_db.php
index <HASH>..<HASH> 100644
--- a/includes/functions/functions_db.php
+++ b/includes/functions/functions_db.php
@@ -454,9 +454,9 @@ function get_indilist_indis($surn='', $salpha='', $galpha='', $marnm=false, $fam
} elseif ($salpha) {
// Match a surname initial, with or without a given initial
if ($galpha) {
- $where[]="n_sort LIKE ".WT_DB::quote("{$s}%,{$g}%");
+ $where[]="n_sort LIKE ".WT_DB::quote("{$salpha}%,{$galpha}%");
} else {
- $where[]="n_sort LIKE ".WT_DB::quote("{$s}%");
+ $where[]="n_sort LIKE ".WT_DB::quote("{$salpha}%");
}
} elseif ($galpha) {
// Match all surnames with a given initial | Fix: searching for indis beginning with a letter | fisharebest_webtrees | train | php |
Subsets and Splits