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
e3fa8f8cf414e40b158cc00ba38369286e64af3b
diff --git a/tohu/base_NEW.py b/tohu/base_NEW.py index <HASH>..<HASH> 100644 --- a/tohu/base_NEW.py +++ b/tohu/base_NEW.py @@ -176,13 +176,13 @@ class ClonedGenerator(TohuUltraBaseGenerator): self.parent = parent self.gen = parent.spawn(dependency_mapping=dict()) - def __repr__(self): - return textwrap.dedent(f""" - <ClonedGenerator (id={id(self)}): - parent generator: {self.parent} - internal clone: {self.gen} - > - """).strip() + def __format__(self, fmt): + if fmt == 'long': + return f'ClonedGenerator(parent={self.parent}) (id={self.tohu_id})' + elif fmt == '' or fmt == 'short': + return f'ClonedGenerator (id={self.tohu_id})' + else: + raise ValueError(f"Invalid format spec: '{fmt}'. Valid values are: 'short', 'long'") def __next__(self): return next(self.gen)
Tweak format method for ClonedGenerator (support short/long format)
maxalbert_tohu
train
py
80869d400315f336d30a333023850a8ed52ce1de
diff --git a/src/kundera-cassandra/cassandra-pelops/src/test/java/com/impetus/kundera/query/KunderaQueryTest.java b/src/kundera-cassandra/cassandra-pelops/src/test/java/com/impetus/kundera/query/KunderaQueryTest.java index <HASH>..<HASH> 100644 --- a/src/kundera-cassandra/cassandra-pelops/src/test/java/com/impetus/kundera/query/KunderaQueryTest.java +++ b/src/kundera-cassandra/cassandra-pelops/src/test/java/com/impetus/kundera/query/KunderaQueryTest.java @@ -143,7 +143,9 @@ public class KunderaQueryTest } catch (JPQLParseException e) { - Assert.fail(); + Assert.assertEquals( + "Bad query format FROM clause is mandatory for SELECT queries. For details, see: http://openjpa.apache.org/builds/1.0.4/apache-openjpa-1.0.4/docs/manual/jpa_langref.html#jpa_langref_bnf", + e.getMessage()); } try {
fixed testcases for jpql expression query
Impetus_Kundera
train
java
a6992e8d3608c01753e77cfd95d1ca687918edb4
diff --git a/test/Select-test.js b/test/Select-test.js index <HASH>..<HASH> 100644 --- a/test/Select-test.js +++ b/test/Select-test.js @@ -2051,8 +2051,6 @@ describe('Select', () => { { value: 'four', label: 'Four' } ]; - onChange.reset(); - // Render an instance of the component wrapper = createControlWithWrapper({ value: '',
Don't need to reset onChange spy
HubSpot_react-select-plus
train
js
dc3e346fc73ddabcbbec1ff47122e89ceecf0b9c
diff --git a/sksurv/__init__.py b/sksurv/__init__.py index <HASH>..<HASH> 100644 --- a/sksurv/__init__.py +++ b/sksurv/__init__.py @@ -2,6 +2,6 @@ from pkg_resources import get_distribution, DistributionNotFound try: __version__ = get_distribution('scikit-survival').version -except DistributionNotFound: +except DistributionNotFound: # pragma: no cover # package is not installed __version__ = 'unknown'
Exclude unknown __version__ from coverage
sebp_scikit-survival
train
py
fa5542e3fa8b3e638792b610f70dfcd4970532f6
diff --git a/backtrader/brokers/bbroker.py b/backtrader/brokers/bbroker.py index <HASH>..<HASH> 100644 --- a/backtrader/brokers/bbroker.py +++ b/backtrader/brokers/bbroker.py @@ -476,7 +476,7 @@ class BackBroker(bt.BrokerBase): def _ocoize(self, order, oco): oref = order.ref if oco is None: - self._ocos[oref] = None # no parent + self._ocos[oref] = oref # current order is parent self._ocol[oref].append(oref) # create ocogroup else: ocoref = self._ocos[oco.ref] # ref to group leader
Fix OCO child order cancel (#<I>)
backtrader_backtrader
train
py
14b2a61a184a1cc6df864eeda577e276cfa58bad
diff --git a/src/Route.php b/src/Route.php index <HASH>..<HASH> 100644 --- a/src/Route.php +++ b/src/Route.php @@ -320,7 +320,9 @@ class Route { $getModified = true; } } - $this->path = rtrim($this->path, '/'); + if ($this->path != '/') { + $this->path = rtrim($this->path, '/'); + } $this->get = $_GET; }
let root keep trailing (only) forward slash
ryan-mahoney_Route
train
php
5bbd10857250a2c9bf5559ebd9bdc8aa2f144bc1
diff --git a/internal/lang/funcs/crypto.go b/internal/lang/funcs/crypto.go index <HASH>..<HASH> 100644 --- a/internal/lang/funcs/crypto.go +++ b/internal/lang/funcs/crypto.go @@ -248,6 +248,7 @@ func makeFileHashFunction(baseDir string, hf func() hash.Hash, enc func([]byte) if err != nil { return cty.UnknownVal(cty.String), err } + defer f.Close() h := hf() _, err = io.Copy(h, f) diff --git a/internal/lang/funcs/filesystem.go b/internal/lang/funcs/filesystem.go index <HASH>..<HASH> 100644 --- a/internal/lang/funcs/filesystem.go +++ b/internal/lang/funcs/filesystem.go @@ -377,6 +377,7 @@ func readFileBytes(baseDir, path string) ([]byte, error) { } return nil, err } + defer f.Close() src, err := ioutil.ReadAll(f) if err != nil {
funcs: defer close file in funcs Files opened by these two functions were not being closed, leaking file descriptors. Close files that were opened when the function exist.
hashicorp_terraform
train
go,go
7e1605c74f7b465d4079e766359ee5092a190aaf
diff --git a/src/utils.js b/src/utils.js index <HASH>..<HASH> 100644 --- a/src/utils.js +++ b/src/utils.js @@ -17,10 +17,10 @@ function getCollatorComparator() { function sortCompare(order) { return (a, b) => { - if (a.data === null) a.data = ''; - if (b.data === null) b.data = ''; + var aData = (a.data === null || typeof a.data === 'undefined') ? '' : a.data; + var bData = (b.data === null || typeof b.data === 'undefined') ? '' : b.data; return ( - (typeof a.data.localeCompare === 'function' ? a.data.localeCompare(b.data) : a.data - b.data) * + (typeof aData.localeCompare === 'function' ? aData.localeCompare(bData) : aData - bData) * (order === 'asc' ? 1 : -1) ); };
fix sort error (#<I>)
gregnb_mui-datatables
train
js
9c6e899334c8511f0a8ab668de58b77690749369
diff --git a/usr/share/lib/img_proof/tests/SLES/conftest.py b/usr/share/lib/img_proof/tests/SLES/conftest.py index <HASH>..<HASH> 100644 --- a/usr/share/lib/img_proof/tests/SLES/conftest.py +++ b/usr/share/lib/img_proof/tests/SLES/conftest.py @@ -511,7 +511,8 @@ BASE_15_SP4_HPC = [ if 'Python2' not in repo ] SLE_15_SP4_X86_64_MODULES = [ - repo.replace('SP3', 'SP4') for repo in SLE_15_SP3_X86_64_MODULES + repo.replace('SP3', 'SP4') for repo in SLE_15_SP3_X86_64_MODULES \ + if 'CAP' not in repo ] PYTHON3_MODULE = [
Update repo test for <I> SP4 - CAP has been dropped as a product and the related module that provided tools in SLES is no longer released.
SUSE-Enceladus_ipa
train
py
a45c84ca88e482ac1485427cfb30571b831828a1
diff --git a/lib/copymitter.js b/lib/copymitter.js index <HASH>..<HASH> 100644 --- a/lib/copymitter.js +++ b/lib/copymitter.js @@ -143,7 +143,7 @@ fs.stat(from, function(error, stat) { if (!is(error)) fs.unlink(to, function(error) { - if (error && /^E(ISDIR|NOENT$)/.test(error.code)) + if (error && !/^E(ISDIR|NOENT)$/.test(error.code)) fn(error); else make(stat.mode);
fix(copymitter) unlink: regexp
coderaiser_node-copymitter
train
js
e465666ab12014ebedf5f94ca3c0eb65a7a6ab19
diff --git a/src/request/Uri.php b/src/request/Uri.php index <HASH>..<HASH> 100644 --- a/src/request/Uri.php +++ b/src/request/Uri.php @@ -26,6 +26,7 @@ declare(strict_types=1); namespace froq\http\request; +use froq\util\Arrays; use froq\common\interfaces\Stringable; use froq\collection\ComponentCollection; use froq\http\request\UriException; @@ -65,7 +66,7 @@ final class Uri extends ComponentCollection implements Stringable public function __construct(string $source) { // Set component names. - parent::__construct(['scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment']); + parent::__construct(['path', 'query', 'fragment']); $this->source = $source; @@ -74,9 +75,14 @@ final class Uri extends ComponentCollection implements Stringable throw new UriException('Invalid URI source'); } + // Use self component names only. + $components = Arrays::include($components, $this->names()); + foreach ($components as $name => $value) { $this->set($name, $value); } + + // Lock. $this->readOnly(true); }
request.Uri: drop non-used components.
froq_froq-http
train
php
a670c9d32dbd3775e6001eecde064d9cc8b12848
diff --git a/src/commands/helpers/defaultPrompt.js b/src/commands/helpers/defaultPrompt.js index <HASH>..<HASH> 100644 --- a/src/commands/helpers/defaultPrompt.js +++ b/src/commands/helpers/defaultPrompt.js @@ -3,23 +3,23 @@ */ export default [{ type: 'input', - name: 'rocAppName', - message: 'What\'s the name of your application?', - default: 'my-roc-app', + name: 'rocName', + message: 'What\'s the name of your project?', + default: 'my-roc-project', filter: (input) => input.toLowerCase().split(' ').join('-') }, { type: 'input', - name: 'rocAppDesc', - message: 'What\'s the description for the application?', - default: 'My Roc Application' + name: 'rocDescription', + message: 'What\'s the description for the project?', + default: 'My Roc Project' }, { type: 'input', - name: 'rocAppAuthor', - message: 'Who\'s the author of the application?', + name: 'rocAuthor', + message: 'Who\'s the author of the project?', default: 'John Doe' }, { type: 'input', - name: 'rocAppLicense', - message: 'What\'s the license for the application?', + name: 'rocLicense', + message: 'What\'s the license for the project?', default: 'MIT' }];
Renamed the default variable names for templates and better text
rocjs_roc
train
js
362ff069841b878a9e1d6a346480d62a1da5949b
diff --git a/config.php b/config.php index <HASH>..<HASH> 100644 --- a/config.php +++ b/config.php @@ -34,7 +34,6 @@ return [ ], 'services' => [ 'database' => ConnectionManager::class, - 'errors' => ErrorStack::class, 'model_driver' => ModelDriver::class, 'auth' => Auth::class, 'mailer' => MailerService::class,
remove deprecated error stack service from test bench
infusephp_auth
train
php
23d14d4b3ec5fdbe2872b5cdb640af9c01e8ecee
diff --git a/theanets/feedforward.py b/theanets/feedforward.py index <HASH>..<HASH> 100644 --- a/theanets/feedforward.py +++ b/theanets/feedforward.py @@ -284,7 +284,7 @@ class Network(object): k = len(self.layers) // 2 encode = np.asarray(self.layers[:k]) decode = np.asarray(self.layers[k+1:]) - assert np.allclose(encode - decode[::-1], 0), error + assert (encode == decode[::-1]).all(), error sizes = self.layers[:k+1] return sizes
Use equality with all() for palindrome check.
lmjohns3_theanets
train
py
583ac7960b73ca08dba0fa2efdfa6e7943ef2bdc
diff --git a/ReactNativeClient/lib/components/screens/config.js b/ReactNativeClient/lib/components/screens/config.js index <HASH>..<HASH> 100644 --- a/ReactNativeClient/lib/components/screens/config.js +++ b/ReactNativeClient/lib/components/screens/config.js @@ -447,7 +447,7 @@ class ConfigScreenComponent extends BaseScreenComponent { if (this.state.profileExportStatus === 'prompt') { const profileExportPrompt = ( - <View style={this.styles().settingContainer}> + <View style={this.styles().settingContainer} key="profileExport"> <Text style={this.styles().settingText}>Path:</Text> <TextInput style={{ ...this.styles().textInput, paddingRight: 20 }} onChange={(event) => this.setState({ profileExportPath: event.nativeEvent.text })} value={this.state.profileExportPath} placeholder="/path/to/sdcard" keyboardAppearance={theme.keyboardAppearance}></TextInput> <Button title="OK" onPress={this.exportProfileButtonPress2_}></Button>
Mobile: Dev fix: Add missing key
laurent22_joplin
train
js
1ee194afa76a0eecc3bc7424f62ebdd025c9b24c
diff --git a/extensions/DOMAPI/DOMAPI.moonshine.js b/extensions/DOMAPI/DOMAPI.moonshine.js index <HASH>..<HASH> 100644 --- a/extensions/DOMAPI/DOMAPI.moonshine.js +++ b/extensions/DOMAPI/DOMAPI.moonshine.js @@ -28,7 +28,8 @@ mt = new shine.Table({ __index: function (t, key) { - var property = obj[key]; + var property = obj[key], + i, children, child; // Bind methods to object and convert args and return values if (typeof property == 'function' || (property && property.prototype && typeof property.prototype.constructor == 'function')) { // KLUDGE: Safari reports native constructors as objects, not functions :-s @@ -40,6 +41,15 @@ return [retval]; }; + // Add static methods, etc + if (Object.getOwnPropertyNames) { + children = Object.getOwnPropertyNames(property); + + for (i = 0; child = children[i]; i++) { + f[child] = property[child]; + } + } + // Add a new method for instantiating classes f.new = function () { var args = convertArguments(arguments, luaToJS),
Fix to add constructors' static methods to proxy functions.
gamesys_moonshine
train
js
35565f1031fbfd8b4908430f4ec568ef19a34c42
diff --git a/namedstruct/namedstruct.py b/namedstruct/namedstruct.py index <HASH>..<HASH> 100644 --- a/namedstruct/namedstruct.py +++ b/namedstruct/namedstruct.py @@ -1771,8 +1771,8 @@ class nstruct(typedef): lastinline_properties = [] seqs = [] endian = arguments.get('endian', '>') - if not members and self.base is None and self.sizefunc is None: - raise ValueError('Struct cannot be empty') + if not members: + self.inlineself = False mrest = len(members) for m in members: mrest -= 1 diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ except: pass from setuptools import setup, find_packages -VERSION = '1.0.0' +VERSION = '1.0.1' setup(name='nstruct', version=VERSION,
BUG FIX: allow empty structs, automatically set inline = False
hubo1016_namedstruct
train
py,py
c7542d81fcaeb442c0ab6f331884e2247813a709
diff --git a/chirptext/leutile.py b/chirptext/leutile.py index <HASH>..<HASH> 100755 --- a/chirptext/leutile.py +++ b/chirptext/leutile.py @@ -135,10 +135,13 @@ class Counter(PythonCounter): order_list.append([x, self[x]]) return order_list - def summarise(self, report=None, byfreq=True): + def summarise(self, report=None, byfreq=True, limit=None): if not report: report = TextReport() - for k, v in self.get_report_order(): + items = self.most_common() if byfreq else self.get_report_order() + if limit: + items = items[:limit] + for k, v in items: report.writeline("%s: %d" % (k, v)) def group_by_count(self):
fixed: byfreq doesn't work in Counter.summarise(). added kwarg limit
letuananh_chirptext
train
py
412f5cd8edb9077c98d7f0b570a4ad3e5344166e
diff --git a/features/support/custom_main.rb b/features/support/custom_main.rb index <HASH>..<HASH> 100644 --- a/features/support/custom_main.rb +++ b/features/support/custom_main.rb @@ -6,7 +6,11 @@ require 'stringio' class CustomMain def initialize(argv, stdin, stdout, stderr, kernel) - @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel + @argv = argv + @stdin = stdin + @stdout = stdout + @stderr = stderr + @kernel = kernel end def execute! diff --git a/lib/aruba/api.rb b/lib/aruba/api.rb index <HASH>..<HASH> 100644 --- a/lib/aruba/api.rb +++ b/lib/aruba/api.rb @@ -1087,7 +1087,8 @@ module Aruba class Announcer def initialize(session, options = {}) - @session, @options = session, options + @session = session + @options = options end def stdout(content)
Fixed offenses for Performance/ParallelAssignment
cucumber_aruba
train
rb,rb
601a4f27a022c01159725bc6e74a367a2cacfa0a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( tests_require=[ "Django>=1.7", "django-reversion>=1.8.1", - "pinax-invitations>=4.0.0", + "pinax-invitations>=4.0.1", "unicode-slugify>=0.1.1", "Pillow>=2.3.0", "django-user-accounts>=1.3", @@ -32,7 +32,7 @@ setup( install_requires=[ "Django>=1.7", "django-reversion>=1.8.1", - "pinax-invitations>=4.0.0", + "pinax-invitations>=4.0.1", "unicode-slugify>=0.1.1", "Pillow>=2.3.0", "django-user-accounts>=1.3",
Bump to corrected pinax-invitations
pinax_pinax-teams
train
py
2230a670d06ef01e337b0f4474670e6415c08451
diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index <HASH>..<HASH> 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -327,7 +327,7 @@ def installed(name, ret['comment'] = ' '.join(comments) else: if not prefix: - pkg_list = [] + pkg_list = {} else: pkg_list = __salt__['pip.list']( prefix, bin_env, user=user, cwd=cwd
despite the name, pkg_list is a dict; initialize accordingly
saltstack_salt
train
py
5ee6c6e816824e92115509766afec3daed1d5a43
diff --git a/Core/Router/Router.php b/Core/Router/Router.php index <HASH>..<HASH> 100755 --- a/Core/Router/Router.php +++ b/Core/Router/Router.php @@ -96,7 +96,7 @@ class Router extends \AltoRouter implements \ArrayAccess * * @see \AltoRouter::generate() */ - public function generate(string $routeName, array $params = []) + public function generate($routeName, array $params = array()) { $url = parent::generate($routeName, $params);
Corrects signature of generate() to match with parent class
tekkla_core-router
train
php
c64b2239b13b78cdfdd573a009b8adb8eb40fcf0
diff --git a/spyder/plugins/variableexplorer/plugin.py b/spyder/plugins/variableexplorer/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/variableexplorer/plugin.py +++ b/spyder/plugins/variableexplorer/plugin.py @@ -37,7 +37,7 @@ dependencies.add("pympler", "pympler", _("Development tool to measure, monitor and analyze the" " memory behavior of Python objects in a running Python" " application."), - required_version=NUMPY_REQVER, optional=True) + required_version=PYMPLER_REQVER, optional=True) class VariableExplorer(SpyderPluginWidget):
PR: Correct Pimpler REQVER Correct PR #<I> error
spyder-ide_spyder
train
py
021d1c5cbdd08cac5aba76cf56f8d5c630c33593
diff --git a/jsftp.js b/jsftp.js index <HASH>..<HASH> 100644 --- a/jsftp.js +++ b/jsftp.js @@ -492,7 +492,7 @@ var Ftp = module.exports = function(cfg) { // 'STAT' command. We use 'LIST' instead. if (err && data.code === 502) self.list(filePath, function(err, data) { - entriesToList(err, data.text) + entriesToList(err, data) }); else entriesToList(err, data.text);
Fixed bug in 'list' command fallback in ls method.
sergi_jsftp
train
js
824c70ae87232a0f0149e7a3b6da5d95aed3886a
diff --git a/src/ai/backend/common/types.py b/src/ai/backend/common/types.py index <HASH>..<HASH> 100644 --- a/src/ai/backend/common/types.py +++ b/src/ai/backend/common/types.py @@ -18,6 +18,8 @@ import uuid import attr +from .docker import ImageRef + __all__ = ( 'aobject', 'DeviceId', @@ -580,6 +582,7 @@ class KernelCreationConfig(TypedDict): environ: Mapping[str, str] mounts: Sequence[str] # list of mount expressions mount_map: Mapping[str, str] # Mapping of vfolder custom mount path + package_directory: Sequence[str] idle_timeout: int bootstrap_script: Optional[str] startup_command: Optional[str]
Add package_directory to KernelCreationConfig
lablup_backend.ai-common
train
py
d3cfda5fe1bdb29fe10fe37132476aa0579e778c
diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index <HASH>..<HASH> 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -119,7 +119,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP $headerState = $gridField->State->GridFieldSortableHeader; $state = $gridField->State->GridFieldSortableRows; if ((!is_bool($state->sortableToggle) || $state->sortableToggle==false) && $headerState && !empty($headerState->SortColumn)) { - return $dataList->sort($this->sortColumn); + return $dataList->sort($headerState->SortColumn); } if ($state->sortableToggle == true) { @@ -676,4 +676,4 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP } } } -?> \ No newline at end of file +?>
Use Sort of GridField Header (#<I>) When not in 'Drag&Drop reordering' mode ('sortableToggle' is false) and a SortColumn is set by GridField's header, this last one should be used; otherwise, when the user clicks on a sortable header, the list is reloaded and the header shows a up/down sorting arrow, but this doesn't reflect the actual sorting.
UndefinedOffset_SortableGridField
train
php
593913c6843b62fc5c3c66dc24d0d8c635feb620
diff --git a/tests/iacli/test_ia_search.py b/tests/iacli/test_ia_search.py index <HASH>..<HASH> 100644 --- a/tests/iacli/test_ia_search.py +++ b/tests/iacli/test_ia_search.py @@ -15,8 +15,8 @@ def test_ia_search(): stdout, stderr = proc.communicate() assert proc.returncode == 0 - cmd = 'ia search iacli-test-item --number-found' + cmd = 'ia search "identifier:iacli-test-item" --number-found' proc = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE) stdout, stderr = proc.communicate() - assert stdout == '2\n' + assert stdout == '1\n' assert proc.returncode == 0
Fixed search query to return an expected number of results found.
jjjake_internetarchive
train
py
b3dec2193068c45f4522e53460919b7590066903
diff --git a/vext/install/__init__.py b/vext/install/__init__.py index <HASH>..<HASH> 100644 --- a/vext/install/__init__.py +++ b/vext/install/__init__.py @@ -18,7 +18,7 @@ DEFAULT_PTH_CONTENT = """\ # # Lines beginning with 'import' are executed, so import sys to get # going. -import os; import sys; exec("try:\n from vext.gatekeeper import install_importer;install_importer()\nexcept:sys.stderr.write('An error occured while enabling VEXT'); raise;") +import os; from vext.gatekeeper import install_importer; install_importer() """
Another attempt at updating the pth
stuaxo_vext
train
py
168af30c3aa02ec3e4f1baccadd341e6ac74bfe8
diff --git a/src/views/pages-manage/edit.php b/src/views/pages-manage/edit.php index <HASH>..<HASH> 100644 --- a/src/views/pages-manage/edit.php +++ b/src/views/pages-manage/edit.php @@ -75,7 +75,9 @@ $form = \yii\bootstrap\ActiveForm::begin([ 'ajax' => [ 'url' => $url, 'dataType' => 'json', - 'data' => new JsExpression('function(params) { return {q:params.term}; }') + 'data' => new JsExpression('function(params) { return {q:params.term}; }'), + 'delay' => '400', + 'error' => new JsExpression('function(error) {alert(error.responseText);}'), ], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(parent) { return parent.text; }'),
some features * added an alert with error message * added a delay before ajax request
DevGroup-ru_dotplant-content
train
php
7e7f4a1fb3a3bc6793324af47ba8b0d04d3573bb
diff --git a/src/search/QuickOpen.js b/src/search/QuickOpen.js index <HASH>..<HASH> 100644 --- a/src/search/QuickOpen.js +++ b/src/search/QuickOpen.js @@ -950,7 +950,7 @@ define(function (require, exports, module) { exports.addQuickOpenPlugin = addQuickOpenPlugin; exports.highlightMatch = highlightMatch; - // accessing these from this module will ultimately be deprecated + // Convenience exports for functions that most QuickOpen plugins would need. exports.stringMatch = StringMatch.stringMatch; exports.SearchResult = StringMatch.SearchResult; exports.basicMatchSort = StringMatch.basicMatchSort;
Add clarifying comment for re-exported StringMatch functions in Quick Open.
adobe_brackets
train
js
fedf80da4a5581c4dd1303e22c43f2df8b8a1459
diff --git a/styleguide.config.js b/styleguide.config.js index <HASH>..<HASH> 100644 --- a/styleguide.config.js +++ b/styleguide.config.js @@ -1,5 +1,4 @@ -``const path = require('path'); - +const path = require('path'); const isProd = process.env.NODE_ENV === 'production'; const webpackConfig = isProd ? require('./webpack.config.base.js') :
Removed rogue quotes breaking build
policygenius_athenaeum
train
js
98a62102c017983f3fc9486bbbbfc71a6c005183
diff --git a/bin/dbs3DASAccess.py b/bin/dbs3DASAccess.py index <HASH>..<HASH> 100755 --- a/bin/dbs3DASAccess.py +++ b/bin/dbs3DASAccess.py @@ -29,7 +29,7 @@ api_call_name = das_query.keys()[0] api_call = getattr(api, api_call_name) query = das_query[api_call_name] -timing = {'stats':{'query' : str(query), 'api' : api_call_name}} +timing = {'stats':{'query' : str(query).replace(' ', '+'), 'api' : api_call_name}} with TimingStat(timing, stat_client) as timer: result = api_call(**das_query[api_call_name])
Bug fix insert query dicts to sqlite
dmwm_DBS
train
py
cf6a99c7b81cb6562e52a771fa24edad5a4d9ab3
diff --git a/misc/plugin/makerss.rb b/misc/plugin/makerss.rb index <HASH>..<HASH> 100644 --- a/misc/plugin/makerss.rb +++ b/misc/plugin/makerss.rb @@ -104,7 +104,7 @@ class MakeRssFull def file f = @conf['makerss.file'] || 'index.rdf' f = 'index.rdf' if f.empty? - f + "#{TDiary.document_root}/#{f}" end def writable?
puts rss file to the public directory if the Rack environment
tdiary_tdiary-core
train
rb
275fbfc45625a3f9ff097c84477c9fb1279deccd
diff --git a/src/configure-webpack/loaders/javascript.js b/src/configure-webpack/loaders/javascript.js index <HASH>..<HASH> 100644 --- a/src/configure-webpack/loaders/javascript.js +++ b/src/configure-webpack/loaders/javascript.js @@ -27,7 +27,7 @@ export default { // Disables ES6 module transformation // which Webpack2 can understand - modules: false, + modules: action === actions.TEST_UNIT ? 'commonjs' : false, targets: { // Unfortunately we are bound to what UglifyJS
Transplile modules to commonjs while running the tests to fix inject-loader support
saguijs_sagui
train
js
eba5e651d0600607974e0e8209327ae6d7a55fca
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -43,10 +43,11 @@ module.exports = function createReaddirStream (dir, opts) { } stream.files.forEach(function (fp, idx) { - stream.push(new utils.File({ + var config = utils.extend(opts, { cwd: opts.cwd, path: path.join(dir, fp) - })) + }) + stream.push(new utils.File(config)) if ((idx + 1) === stream.files.length) { stream.push(null)
fix(index.js): allow passing options/config to each Vinyl file which is created
tunnckoCore_create-readdir-stream
train
js
7b6f971434fab1fb418e8f4bc625e4dabb5418db
diff --git a/kaybee/plugins/articles/author.py b/kaybee/plugins/articles/author.py index <HASH>..<HASH> 100644 --- a/kaybee/plugins/articles/author.py +++ b/kaybee/plugins/articles/author.py @@ -4,4 +4,6 @@ from kaybee.plugins.articles.base_article_reference import BaseArticleReference @kb.resource('author') class Author(BaseArticleReference): - pass + def headshot_thumbnail(self, usage): + prop = self.find_prop_item('images', 'usage', usage) + return prop.filename
chg: usr: Make it easier to get an author's headshot.
pauleveritt_kaybee
train
py
6515f018003635108915d0a6e19c354494e92659
diff --git a/middleman-core/lib/middleman-core/extension.rb b/middleman-core/lib/middleman-core/extension.rb index <HASH>..<HASH> 100644 --- a/middleman-core/lib/middleman-core/extension.rb +++ b/middleman-core/lib/middleman-core/extension.rb @@ -81,7 +81,7 @@ module Middleman end end - protected + private def setup_options(options_hash) @options = self.class.config.dup @@ -151,7 +151,6 @@ module Middleman end end end - end end end
Extension setup methods should be private, not protected
middleman_middleman
train
rb
c0498abed395412afd7069ab17790c8d54c64716
diff --git a/bigchaindb/commands/utils.py b/bigchaindb/commands/utils.py index <HASH>..<HASH> 100644 --- a/bigchaindb/commands/utils.py +++ b/bigchaindb/commands/utils.py @@ -151,6 +151,10 @@ base_parser.add_argument('-c', '--config', help='Specify the location of the configuration file ' '(use "-" for stdout)') +base_parser.add_argument('-l', '--log-level', + choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], + help='Log level') + base_parser.add_argument('-y', '--yes', '--yes-please', action='store_true', help='Assume "yes" as answer to all prompts and run '
Add log-level option for all CLI commands
bigchaindb_bigchaindb
train
py
0c4bf1dfb0925522d1b3a70873d49ece841e1655
diff --git a/go/engine/common_test.go b/go/engine/common_test.go index <HASH>..<HASH> 100644 --- a/go/engine/common_test.go +++ b/go/engine/common_test.go @@ -30,7 +30,7 @@ func NewFakeUser(prefix string) (fu *FakeUser, err error) { return } username := fmt.Sprintf("%s_%s", prefix, hex.EncodeToString(buf)) - email := fmt.Sprintf("%s@email.com", username) + email := fmt.Sprintf("%s@noemail.keybase.io", username) buf = make([]byte, 12) if _, err = rand.Read(buf); err != nil { return
don't send email to @email.com
keybase_client
train
go
a6921b8a89bebf7046f57962e68732944200f343
diff --git a/mpd/tests.py b/mpd/tests.py index <HASH>..<HASH> 100755 --- a/mpd/tests.py +++ b/mpd/tests.py @@ -685,14 +685,13 @@ class TestMPDClient(unittest.TestCase): # MPD client tests which do not mock the socket, but rather replace it # with a real socket from a socket +@unittest.skipIf(not hasattr(socket, "socketpair"), + "Socketpair is not supported on this platform") class TestMPDClientSocket(unittest.TestCase): longMessage = True def setUp(self): - if not hasattr(socket, "socketpair"): - self.skipTest("Socketpair is not supported on this platform") - self.connect_patch = mock.patch("mpd.MPDClient._connect_unix") self.connect_mock = self.connect_patch.start()
Use decorator for conditionally skipping socketpair tests
Mic92_python-mpd2
train
py
791a0d3e6cc17f826c7389ad14fa13d1f5d67bd3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,9 +15,9 @@ from setuptools import setup packages = ['textblob_de'] if sys.version_info[0] == 2: - requires = ["textblob>=0.8.0"] -else: requires = ["textblob>=0.8.0", "pattern>=2.6.0"] +else: + requires = ["textblob>=0.8.0"] PUBLISH_CMD = "python setup.py register sdist bdist_wheel upload" TEST_PUBLISH_CMD = 'python setup.py register -r test sdist bdist_wheel upload -r test'
corrected Py2/3 requirements in setup.py
markuskiller_textblob-de
train
py
8de9d5265a1da3cb6f0f1b53eb618421ea21412f
diff --git a/spec/node-spec.js b/spec/node-spec.js index <HASH>..<HASH> 100644 --- a/spec/node-spec.js +++ b/spec/node-spec.js @@ -336,7 +336,7 @@ describe('node feature', () => { }) it('includes the electron version in process.versions', () => { - assert(/^\d+\.\d+\.\d+$/.test(process.versions.electron)) + assert(/^\d+\.\d+\.\d+(\S)?$/.test(process.versions.electron)) }) it('includes the chrome version in process.versions', () => {
:construction_worker: Fix the spec
electron_electron
train
js
3bd49bf4f9da6f551cc92145cd0b06e850c3f0ab
diff --git a/test/example-test.js b/test/example-test.js index <HASH>..<HASH> 100644 --- a/test/example-test.js +++ b/test/example-test.js @@ -366,7 +366,7 @@ helpers.makeTests("can-component examples", function(doc) { }); var viewModel = new SimulatedScope(); - var renderer = stache("<grid deferreddata:bind='viewModel.deferredData'>" + + var renderer = stache("<grid deferreddata:bind='viewModel.deferredData()'>" + "{{#each items}}" + "<tr>" + "<td width='40%'>{{first}}</td>" +
Fix deferred grid test <I> doesn’t automatically call functions in `bind`
canjs_can-component
train
js
e4effc64ec99bcf88257cf2374c5df9b6bb22f3b
diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index <HASH>..<HASH> 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -677,7 +677,7 @@ class LdapCherry(object): key = self.attributes.get_key() username = params['attrs'][key] sess = cherrypy.session - admin = sess.get(SESSION_KEY, None) + admin = sess.get(SESSION_KEY, 'unknown') cherrypy.log.error( msg="user '" + username + "' added by '" + admin + "'", @@ -774,7 +774,7 @@ class LdapCherry(object): ) sess = cherrypy.session - admin = sess.get(SESSION_KEY, None) + admin = sess.get(SESSION_KEY, 'unknown') cherrypy.log.error( msg="user '" + username + "' modified by '" + admin + "'", @@ -860,7 +860,7 @@ class LdapCherry(object): def _deleteuser(self, username): sess = cherrypy.session - admin = sess.get(SESSION_KEY, None) + admin = sess.get(SESSION_KEY, 'unknown') for b in self.backends: try:
fixing log errors in auth "none" mode replacing None by unknown as a default value in order to avoid error in generating log msg because None is not a string
kakwa_ldapcherry
train
py
ec7bbb45db293666cafe255eb78cb4c4619b5dc0
diff --git a/lib/Rx/Observable/BaseObservable.php b/lib/Rx/Observable/BaseObservable.php index <HASH>..<HASH> 100644 --- a/lib/Rx/Observable/BaseObservable.php +++ b/lib/Rx/Observable/BaseObservable.php @@ -524,9 +524,9 @@ abstract class BaseObservable implements ObservableInterface /** * @return \Rx\Observable\AnonymousObservable */ - public function never() + public static function never() { - return $this->lift(new NeverOperator()); + return (new EmptyObservable())->lift(new NeverOperator()); } /**
changed never to static on BaseObservable
ReactiveX_RxPHP
train
php
10d041569a0b19dee2024001f7aae310ddd89dca
diff --git a/tests/unit/components/compiler-test.js b/tests/unit/components/compiler-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/components/compiler-test.js +++ b/tests/unit/components/compiler-test.js @@ -20,3 +20,11 @@ test('precompile disabled flags', function(assert) { assert.equal(this.$().text().trim(), ''); }); + +test('precompile else block', function(assert) { + this.render(hbs` + {{#if-flag-ENABLE_BAR}}Bar{{else}}Baz{{/if-flag-ENABLE_BAR}} + `); + + assert.equal(this.$().text().trim(), 'Baz'); +});
Add test for {{else}} block
minichate_ember-cli-conditional-compile
train
js
86d0b704bc355bc33a3b97920cd2769e9d7fadd0
diff --git a/src/Brendt/Stitcher/Parser/YamlParser.php b/src/Brendt/Stitcher/Parser/YamlParser.php index <HASH>..<HASH> 100644 --- a/src/Brendt/Stitcher/Parser/YamlParser.php +++ b/src/Brendt/Stitcher/Parser/YamlParser.php @@ -26,7 +26,7 @@ class YamlParser extends AbstractArrayParser } public function parse($path = '*.yml') { - if (!strpos($path, '.yml')) { + if (!strpos($path, '.yml') && !strpos($path, '.yaml')) { $path .= '.yml'; }
Add .yaml check as fallback extension in YamlParser
pageon_stitcher-core
train
php
70fae3b10270a2a5db4ee495ee1d9733bf5a8285
diff --git a/versionner/version.py b/versionner/version.py index <HASH>..<HASH> 100644 --- a/versionner/version.py +++ b/versionner/version.py @@ -63,7 +63,7 @@ class Version: """ if field not in self.VALID_UP_FIELDS: - raise ValueError("Incorrect value of \"type\"") + raise ValueError("Invalid field: %s" % field) if not value: value = 1
changed (unified) error mesage on incorrect field
msztolcman_versionner
train
py
95795f90ef11ad91c70877bbc64a28dbfd68ab19
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -44,18 +44,25 @@ function CacheModule(cacheItem) { return cacheItem.map; }; source.node = function() { - n = SourceNode.fromStringWithSourceMap( + var node = SourceNode.fromStringWithSourceMap( cacheItem.source, new SourceMapConsumer(cacheItem.map) ); - // Rehydrate source keys - var sources = Object.keys(n.sourceContents); + // Rehydrate source keys, webpack 1 uses source-map 0.4 which needs an + // appended $. webpack 2 uses source-map 0.5 which may append $. Either way + // setSourceContent will provide the needed behaviour. This is pretty round + // about and ugly but this is less prone to failure than trying to determine + // whether we're in webpack 1 or 2 and if they are using webpack-core or + // webpack-sources and the version of source-map in that. + var setSourceContent = new RawModule('').source().node().setSourceContent; + var sources = Object.keys(node.sourceContents); for (var i = 0; i < sources.length; i++) { var key = sources[i]; - n.sourceContents['$' + key] = n.sourceContents[key]; - delete n.sourceContents[key]; + var content = node.sourceContents[key]; + delete node.sourceContents[key]; + setSourceContent.call(node, key, content); } - return n; + return node; }; source.listMap = function() { return fromStringWithSourceMap(cacheItem.source, cacheItem.map);
Improve source content key hydration webpack 1 and 2 depend on different source-map versions which have different source content name behaviour. To resolve this when rehydrating the SourceNode for the Source.node method we reach into RawModule's returned RawSource instance which will come from webpack-core for webpack 1 and webpack-sources for webpack 2. We can then get a SourceNode from RawSource and steal SourceNode's setSourceContent function which will perform the right rehydration behaviour for the active version of webpack.
mzgoddard_hard-source-webpack-plugin
train
js
2236a7347d46417749a2316bce84be1da544c0f7
diff --git a/tests/Go/Aop/Framework/ClosureStaticMethodInvocationTest.php b/tests/Go/Aop/Framework/ClosureStaticMethodInvocationTest.php index <HASH>..<HASH> 100644 --- a/tests/Go/Aop/Framework/ClosureStaticMethodInvocationTest.php +++ b/tests/Go/Aop/Framework/ClosureStaticMethodInvocationTest.php @@ -132,7 +132,7 @@ class ClosureStaticMethodInvocationTest extends \PHPUnit_Framework_TestCase return array( array('staticSelfPublic', T_PUBLIC), array('staticSelfProtected', T_PROTECTED), - // array('staticSelfPrivate', T_PRIVATE), // This will give a Fatal Error for scope + array('staticSelfPublicAccessPrivate', T_PRIVATE), ); }
#<I> important test to check scope access and LSB
goaop_framework
train
php
f785cec68b2b008e83975451b346d07d65f3a421
diff --git a/edeposit/amqp/daemonwrapper.py b/edeposit/amqp/daemonwrapper.py index <HASH>..<HASH> 100644 --- a/edeposit/amqp/daemonwrapper.py +++ b/edeposit/amqp/daemonwrapper.py @@ -47,7 +47,7 @@ class DaemonRunnerWrapper(object): sys.exit(0) def onIsRunning(self): - if "stop" not in sys.argv or "restart" not in sys.argv: + if "stop" not in sys.argv and "restart" not in sys.argv: print 'It looks like a daemon is already running!' sys.exit(1)
Fixed bug which blocked stopping the daemon.
edeposit_edeposit.amqp
train
py
60e93b4bec9608e8516e034e48e9c0ec5bff1a0f
diff --git a/Slim/Http/Request.php b/Slim/Http/Request.php index <HASH>..<HASH> 100644 --- a/Slim/Http/Request.php +++ b/Slim/Http/Request.php @@ -189,6 +189,10 @@ class Request extends Message implements ServerRequestInterface return simplexml_load_string($input); }); + $this->registerMediaTypeParser('text/xml', function ($input) { + return simplexml_load_string($input); + }); + $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { parse_str($input, $data); return $data;
Register text/xml in Request
slimphp_Slim
train
php
0835807b4e21c75e55fd14cf6cdc3db1c0f7b84d
diff --git a/utils/seed-classes.js b/utils/seed-classes.js index <HASH>..<HASH> 100644 --- a/utils/seed-classes.js +++ b/utils/seed-classes.js @@ -1,4 +1,4 @@ -import appendStatus from './append-status'; +import appendStatus from './append-status' export default function(base, statuses = {}, classes = {}) { if (classes[base]) base = classes[base]; @@ -24,7 +24,7 @@ export default function(base, statuses = {}, classes = {}) { function addStatuses(sx, arr = []) { for (var s in sx) { - arr.push('-' + appendStatus(sx[s], s)); + arr.push('-' + appendStatus(sx[s], s.replace('@', sx[s]))); } return arr; }
replace @ with value of prop This allows us to pass a prop value as a status and have it return only one class
ui-kit_ui-kit
train
js
21bafccc96b9c442d85d3d8080195ade0022dac5
diff --git a/dvc/progress.py b/dvc/progress.py index <HASH>..<HASH> 100644 --- a/dvc/progress.py +++ b/dvc/progress.py @@ -20,7 +20,7 @@ class TqdmThreadPoolExecutor(ThreadPoolExecutor): Creates a blank initial dummy progress bar if needed so that workers are forced to create "nested" bars. """ - blank_bar = Tqdm(bar_format="Multi-Threaded:", leave=False) + blank_bar = Tqdm(bar_format="", leave=False) if blank_bar.pos > 0: # already nested - don't need a placeholder bar blank_bar.close()
Remove multi-threaded prefix before progress bar(#<I>)
iterative_dvc
train
py
78f7c0d61f2a5d04ed2b450e90a131f42a5bda70
diff --git a/riscvmodel/model.py b/riscvmodel/model.py index <HASH>..<HASH> 100644 --- a/riscvmodel/model.py +++ b/riscvmodel/model.py @@ -1,4 +1,5 @@ from random import randrange +import sys from .variant import * from .types import Register, RegisterFile, TracePC, TraceIntegerRegister, TraceMemory @@ -111,7 +112,9 @@ class Model(object): self.state = State(variant) self.environment = environment if environment is not None else Environment() self.verbose = verbose - self.asm_tpl = "{{:{}}} | [{{}}]".format(asm_width) + if self.verbose is not False: + self.verbose_file = sys.stdout if verbose is True else open(self.verbose, "w") + self.asm_tpl = "{{:{}}} | [{{}}]\n".format(asm_width) def issue(self, insn): self.state.pc += 4 @@ -119,8 +122,8 @@ class Model(object): insn.execute(self) trace = self.state.changes() - if self.verbose: - print(self.asm_tpl.format(str(insn), ", ".join([str(t) for t in trace]))) + if self.verbose is not False: + self.verbose_file.write(self.asm_tpl.format(str(insn), ", ".join([str(t) for t in trace]))) self.state.commit() return trace
Allow to write verbose trace to file
wallento_riscv-python-model
train
py
f20c5fc3a6af0d2c42613368310b5ccae877aae5
diff --git a/salt/modules/ebuild.py b/salt/modules/ebuild.py index <HASH>..<HASH> 100644 --- a/salt/modules/ebuild.py +++ b/salt/modules/ebuild.py @@ -317,7 +317,7 @@ def depclean(pkg=None): CLI Example:: - salt '*' ebuild.depclean <package name> + salt '*' pkg.depclean <package name> ''' ret_pkgs = [] old_pkgs = list_pkgs()
Corrected doc for depclean
saltstack_salt
train
py
424e1d1b136d73a4872431ec0d13329cb17abd79
diff --git a/geomdl/utilities.py b/geomdl/utilities.py index <HASH>..<HASH> 100644 --- a/geomdl/utilities.py +++ b/geomdl/utilities.py @@ -536,8 +536,8 @@ def make_triangle_mesh(points, size_u, size_v, **kwargs): v_range = 1.0 / float(size_v - 1) # for computing vertex parametric v value # Vertex array size (also used for traversing triangulation loop) - varr_size_u = int(round((size_u / vertex_spacing) + 10e-8)) - varr_size_v = int(round((size_v / vertex_spacing) + 10e-8)) + varr_size_u = int(round((float(size_u) / float(vertex_spacing)) + 10e-8)) + varr_size_v = int(round((float(size_v) / float(vertex_spacing)) + 10e-8)) # Start vertex generation loop vertices = [Vertex() for _ in range(varr_size_v * varr_size_u)]
Fix Python 2 compatibility issue for int division
orbingol_NURBS-Python
train
py
f6219be4586d7ea367e65c4882a1a18368680957
diff --git a/spec/active_record/events_spec.rb b/spec/active_record/events_spec.rb index <HASH>..<HASH> 100644 --- a/spec/active_record/events_spec.rb +++ b/spec/active_record/events_spec.rb @@ -42,17 +42,9 @@ RSpec.describe ActiveRecord::Events do expect(Task.not_completed).to include(task) end - it 'allows overriding methods defined by the gem' do - task.class.class_eval do - def complete - super - end - end - - task.complete - + it 'allows overriding methods' do + task.complete! expect(task.completed?).to eq(true) - expect(task.not_completed?).to eq(false) end end diff --git a/spec/dummy/app/models/task.rb b/spec/dummy/app/models/task.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/app/models/task.rb +++ b/spec/dummy/app/models/task.rb @@ -1,3 +1,9 @@ class Task < ActiveRecord::Base has_event :complete + + def complete! + super + logger = Logger.new(STDOUT) + logger.info("Task #{id} has been completed") + end end
Override the complete! task method
pienkowb_active_record-events
train
rb,rb
ce74c96e0bdefaf1d1d1ec74a955d216e13b5169
diff --git a/photutils/datasets/make.py b/photutils/datasets/make.py index <HASH>..<HASH> 100644 --- a/photutils/datasets/make.py +++ b/photutils/datasets/make.py @@ -59,7 +59,7 @@ def make_gaussian_image(shape, table): for source in table: aperture = CircularAperture((source['x_0'], source['y_0']), 3 * source['sigma']) - aperture.plot(color='white', fill=False) + aperture.plot(color='white') """ y, x = np.indices(shape)
Removed plot fill keyword in make_gaussian_image example
astropy_photutils
train
py
7512611e0fd2241e29e40904661bee7370104fff
diff --git a/Lib/glyphsLib/parser.py b/Lib/glyphsLib/parser.py index <HASH>..<HASH> 100644 --- a/Lib/glyphsLib/parser.py +++ b/Lib/glyphsLib/parser.py @@ -116,8 +116,9 @@ class Parser: i += len(parsed) return res, i - # glyphs only supports octal escapes between \000 and \077 - _unescape_re = re.compile(r'(\\0[0-7]{2})|(\\U[0-9a-fA-F]{4,6})') + # glyphs only supports octal escapes between \000 and \077 and hexadecimal + # escapes between \U0000 and \UFFFF + _unescape_re = re.compile(r'(\\0[0-7]{2})|(\\U[0-9a-fA-F]{4})') @staticmethod def _unescape_fn(m):
[parser] Only parse hex values up to 0xFFFF For consistency with Glyphs.
googlefonts_glyphsLib
train
py
ac5c8ca5929670f2e3b0543e65eaa9ebfee8967f
diff --git a/builder/builder_test.go b/builder/builder_test.go index <HASH>..<HASH> 100644 --- a/builder/builder_test.go +++ b/builder/builder_test.go @@ -9,6 +9,7 @@ import ( "path" "path/filepath" "strings" + "time" . "github.com/cloudfoundry-incubator/buildpack_app_lifecycle/Godeps/_workspace/src/github.com/onsi/ginkgo" . "github.com/cloudfoundry-incubator/buildpack_app_lifecycle/Godeps/_workspace/src/github.com/onsi/gomega" @@ -113,7 +114,7 @@ var _ = Describe("Building", func() { }) JustBeforeEach(func() { - Eventually(builder()).Should(gexec.Exit(0)) + Eventually(builder(), 5*time.Second).Should(gexec.Exit(0)) }) Describe("the contents of the output tgz", func() { @@ -221,7 +222,7 @@ start_command: the start command Context("when the app has a Procfile", func() { Context("with web defined", func() { JustBeforeEach(func() { - Eventually(builder()).Should(gexec.Exit(0)) + Eventually(builder() * time.Second).Should(gexec.Exit(0)) }) BeforeEach(func() {
wait a bit longer for builder to execute & finish
cloudfoundry_buildpackapplifecycle
train
go
094172647c506e4548b794bc82b595ec47fc3a5d
diff --git a/go/libkb/api.go b/go/libkb/api.go index <HASH>..<HASH> 100644 --- a/go/libkb/api.go +++ b/go/libkb/api.go @@ -568,7 +568,7 @@ func (a *InternalAPIEngine) fixHeaders(arg APIArg, req *http.Request) error { if a.G().Env.GetTorMode().UseHeaders() { req.Header.Set("User-Agent", UserAgent) - identifyAs := GoClientID + " v" + VersionString() + " " + runtime.GOOS + identifyAs := GoClientID + " v" + VersionString() + " " + GetPlatformString() req.Header.Set("X-Keybase-Client", identifyAs) if a.G().Env.GetDeviceID().Exists() { req.Header.Set("X-Keybase-Device-ID", a.G().Env.GetDeviceID().String())
fix iOS stats (#<I>)
keybase_client
train
go
6481de4876d3d345b0561cd06a4fa839be9b8edf
diff --git a/spring-dbunit-test/src/main/java/com/excilys/ebi/spring/dbunit/test/TestConfigurationProcessor.java b/spring-dbunit-test/src/main/java/com/excilys/ebi/spring/dbunit/test/TestConfigurationProcessor.java index <HASH>..<HASH> 100644 --- a/spring-dbunit-test/src/main/java/com/excilys/ebi/spring/dbunit/test/TestConfigurationProcessor.java +++ b/spring-dbunit-test/src/main/java/com/excilys/ebi/spring/dbunit/test/TestConfigurationProcessor.java @@ -118,6 +118,7 @@ public class TestConfigurationProcessor implements ConfigurationProcessor<TestCo .withDbType(annotation.dbType())/**/ .withDataSourceSpringName(StringUtils.hasText(annotation.dataSourceSpringName()) ? annotation.dataSourceSpringName() : null)/**/ .withDataSetResourceLocations(dataSetResourceLocations)/**/ + .withEscapePattern(annotation.escapePattern()) .build(); }
support escapePattern of @DataSet annotation
e-biz_spring-dbunit
train
java
93fdadf8053614a5e69530a09208867563abe250
diff --git a/modin/engines/ray/pandas_on_ray/io.py b/modin/engines/ray/pandas_on_ray/io.py index <HASH>..<HASH> 100644 --- a/modin/engines/ray/pandas_on_ray/io.py +++ b/modin/engines/ray/pandas_on_ray/io.py @@ -51,7 +51,8 @@ def _read_parquet_columns(path, columns, num_splits, kwargs): # pragma: no cove """ import pyarrow.parquet as pq - df = pq.read_pandas(path, columns=columns, **kwargs).to_pandas() + df = pq.ParquetDataset(path, **kwargs).read(columns=columns).to_pandas() + # Append the length of the index here to build it externally return _split_result_for_readers(0, num_splits, df) + [len(df.index)]
Replace read_pandas with ParquetDataset to support predicate pushdown (#<I>) * Replace read_pandas with ParquetDataset to support predicate pushdown on parquet * reformatted as per black
modin-project_modin
train
py
49352cae54eed2ddd44173705226e72a04128d33
diff --git a/jptsmeta.py b/jptsmeta.py index <HASH>..<HASH> 100644 --- a/jptsmeta.py +++ b/jptsmeta.py @@ -428,9 +428,14 @@ class JPTSMeta(object): def getSupplementaryMaterial(self): """ - - """ - return None + <supplementary-material> is an optional element, 0 or more, in + <article-meta> to be used to 'alert to the existence of + supplementary material and so that it can be accessed from the + article'. The use cases will depend heavily on publishers and it will + take some effort to fully support. For now, the nodes will merely be + collected. + """ + return self.getChildrenByTagName('supplementary-material', self.article_meta) def getChildrenByTagName(self, searchterm, node): """
fleshed out docstrings and method for getProduct() and getSupplementaryMaterial()
SavinaRoja_OpenAccess_EPUB
train
py
12edc3d592715e04cb829e37bc8e12b1822b3e01
diff --git a/src/Tokenizer/Tokens.php b/src/Tokenizer/Tokens.php index <HASH>..<HASH> 100644 --- a/src/Tokenizer/Tokens.php +++ b/src/Tokenizer/Tokens.php @@ -313,13 +313,14 @@ class Tokens extends \SplFixedArray if (!$this[$index] || !$this[$index]->equals($newval)) { $this->changed = true; - } - if (isset($this[$index])) { - $this->unregisterFoundToken($this[$index]); + if (isset($this[$index])) { + $this->unregisterFoundToken($this[$index]); + } + + $this->registerFoundToken($newval); } - $this->registerFoundToken($newval); parent::offsetSet($index, $newval); }
DX: Tokens - do not unregister/register found tokens when it is the same token
FriendsOfPHP_PHP-CS-Fixer
train
php
e80e69b04eaf341efc49c6bd2e2f2e626cd7217f
diff --git a/shutit_main.py b/shutit_main.py index <HASH>..<HASH> 100755 --- a/shutit_main.py +++ b/shutit_main.py @@ -735,7 +735,7 @@ def shutit_main(): ]) digraph = digraph + '\n}' if cfg['action']['show_depgraph']: - shutit.log(digraph, force_stdout=True) + shutit.log('\n' + digraph, force_stdout=True) shutit.log('\nAbove is the digraph for this shutit invocation. Use graphviz to render into an image, eg\n\n\tshutit depgraph -m library | dot -Tpng -o depgraph.png', force_stdout=True) # Set build completed cfg['build']['completed'] = True
digraph always computed ready to write out to a file
ianmiell_shutit
train
py
af52e0b6ef8ab5f574145dde60b0110717253127
diff --git a/lib/agent/index.js b/lib/agent/index.js index <HASH>..<HASH> 100644 --- a/lib/agent/index.js +++ b/lib/agent/index.js @@ -247,9 +247,7 @@ var Agent = self = { logger.off(); - if (matches = string.match(/get (\w+) report/)) - this.get_report(matches[1]); - else if (matches = string.match(/get (\w+)/)) + if (matches = string.match(/get (\w+)/)) this.get_data(matches[1]); else if (matches = string.match(/[start|stop] (\w+)/)) this.start_action_by_name(matches[1])
Removed 'get [what] report' command from agent, not really needed.
prey_prey-node-client
train
js
e53cf5cee05358513a0b8512046fcb54f0725469
diff --git a/init.rb b/init.rb index <HASH>..<HASH> 100644 --- a/init.rb +++ b/init.rb @@ -1,2 +1 @@ require 'attachment_saver' -ActiveRecord::Base.send(:extend, AttachmentSaver::BaseMethods) diff --git a/lib/attachment_saver.rb b/lib/attachment_saver.rb index <HASH>..<HASH> 100644 --- a/lib/attachment_saver.rb +++ b/lib/attachment_saver.rb @@ -166,4 +166,6 @@ module AttachmentSaver return [filename[0..pos - 1], filename[pos + 1..-1]] end end -end \ No newline at end of file +end + +ActiveRecord::Base.send(:extend, AttachmentSaver::BaseMethods)
move ActiveRecord extend call to attachment_saver.rb in preparation for gemifying
willbryant_attachment_saver
train
rb,rb
782b6a0c83fbb9ba8934073d3a53f6b49b1eab4b
diff --git a/parsyfiles/plugins_base/support_for_objects.py b/parsyfiles/plugins_base/support_for_objects.py index <HASH>..<HASH> 100644 --- a/parsyfiles/plugins_base/support_for_objects.py +++ b/parsyfiles/plugins_base/support_for_objects.py @@ -83,9 +83,9 @@ class MissingMandatoryAttributeFiles(FileNotFoundError): """ return MissingMandatoryAttributeFiles('Multifile object ' + str(obj) + ' cannot be built from constructor of ' - 'type, ' + str(obj_type) + - 'mandatory constructor argument \'' + arg_name + '\'was not found on ' - 'filesystem') + 'type ' + get_pretty_type_str(obj_type) + + ', mandatory constructor argument \'' + arg_name + '\'was not found on ' + 'filesystem') class InvalidAttributeNameForConstructorError(Exception):
Improved error message for MissingMandatoryAttributeFiles in dict_to_object
smarie_python-parsyfiles
train
py
4bd0a556a61f5a615e691fefc5a18a0065de4367
diff --git a/py3status/modules/mpris.py b/py3status/modules/mpris.py index <HASH>..<HASH> 100644 --- a/py3status/modules/mpris.py +++ b/py3status/modules/mpris.py @@ -310,7 +310,7 @@ class Py3status: self._kill = True def _name_owner_changed(self, *args): - player_add = args[5][2] + player_add = args[5][0] player_remove = args[5][1] if player_add: self._add_player(player_add) @@ -382,7 +382,7 @@ class Py3status: if not p['name'] and p['identity'] in self._mpris_names: p['name'] = self._mpris_names[p['identity']] p['full_name'] = u'{} {}'.format(p['name'], p['index']) - return + return False status = player.PlaybackStatus state_priority = WORKING_STATES.index(status) identity = player.Identity @@ -395,7 +395,7 @@ class Py3status: self._player_monitor(player_id) ) except: - return + return False self._mpris_players[player_id] = { '_dbus_player': player, @@ -408,6 +408,7 @@ class Py3status: 'status': status, 'subscription': subscription, } + return True def _remove_player(self, player_id):
Detect players starting after py3status
ultrabug_py3status
train
py
f14a62b3290080ea79a42322760bd3b9a5847ff2
diff --git a/cherrypy/lib/static.py b/cherrypy/lib/static.py index <HASH>..<HASH> 100644 --- a/cherrypy/lib/static.py +++ b/cherrypy/lib/static.py @@ -148,6 +148,10 @@ def serve_file(path, contentType=None, disposition=None, name=None): response.body = bodyfile return response.body +def serve_download(path, name=None): + """Serve 'path' as an application/x-download attachment.""" + # This is such a common idiom I felt it deserved its own wrapper. + return serve_file(path, "application/x-download", "attachment", name) def _attempt(filename, content_types):
New static.serve_download function (sugar for serve_file with application/x-download attachment).
cherrypy_cheroot
train
py
fc497536ed884b4d18860f6db644d4143412c2f5
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index <HASH>..<HASH> 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -1143,7 +1143,7 @@ public class ClassSymbol extends TypeSymbol { other.constructor.setInfo(constructor.info()); other.mangled = mangled; other.module = module; - other.thisSym = thisSym; + if (thisSym != this) other.setTypeOfThis(typeOfThis()); return other; }
- bug fix: cloneSymbol in ClassSymbol correctly... - bug fix: cloneSymbol in ClassSymbol correctly sets thisSym for the new symbol
scala_scala
train
java
cbfffa20947e821f7e1f340a89309663de06ad7f
diff --git a/addon/components/bs-switch.js b/addon/components/bs-switch.js index <HASH>..<HASH> 100755 --- a/addon/components/bs-switch.js +++ b/addon/components/bs-switch.js @@ -24,7 +24,7 @@ var bsSwitchComponent = Ember.Component.extend({ var that = this; // Ensure bootstrap-switch is loaded... - Ember.assert("bootstrap-switch has to exist on Ember.$.fn.bootstrapSwitch", Ember.$.fn.bootstrapSwitch); + Ember.assert("bootstrap-switch has to exist on Ember.$.fn.bootstrapSwitch", typeof Ember.$.fn.bootstrapSwitch === "function" ); // console.log('this.$(input):', this.$('input')); this.$('input').bootstrapSwitch({
Fix the issue of Ember <I> compatibility.
vsymguysung_ember-cli-bootstrap-switch
train
js
6ac4fda29a51e1716adca1245cd3c9340ffeb7b6
diff --git a/src/application/application.js b/src/application/application.js index <HASH>..<HASH> 100644 --- a/src/application/application.js +++ b/src/application/application.js @@ -95,7 +95,7 @@ class Application { */ reset() { // point to the current active stage "default" camera - var current = state.current(); + var current = state.get(); if (typeof current !== "undefined") { this.viewport = current.cameras.get("default"); }
use `get()` for better code clarity
melonjs_melonJS
train
js
59a4daa0534be0cad76832a6e99a3620321efa45
diff --git a/lib/telegram_bot/version.rb b/lib/telegram_bot/version.rb index <HASH>..<HASH> 100644 --- a/lib/telegram_bot/version.rb +++ b/lib/telegram_bot/version.rb @@ -1,3 +1,3 @@ module TelegramBot - VERSION = "0.0.1" + VERSION = "0.0.2" end
bumped version to <I>
eljojo_telegram_bot
train
rb
362299ca54ac0a914a659bb1480e28673fdeada1
diff --git a/gohll.go b/gohll.go index <HASH>..<HASH> 100644 --- a/gohll.go +++ b/gohll.go @@ -117,17 +117,18 @@ func NewHLL(p uint8) (*HLL, error) { // Hasher function func (h *HLL) Add(value string) { hash := h.Hasher(value) - switch h.format { - case NORMAL: - h.addNormal(hash) - case SPARSE: - h.addSparse(hash) - } + h.AddHash(hash) } -// Add will add the given string value to the HLL using the specified hasher function. +// AddWithHasher will add the given string value to the HLL using the specified +// hasher function. func (h *HLL) AddWithHasher(value string, hasher func(string) uint64) { hash := hasher(value) + h.AddHash(hash) +} + +// AddHash will add the given uint64 hash to the HLL +func (h *HLL) AddHash(hash uint64) { switch h.format { case NORMAL: h.addNormal(hash)
Added AddHash method to resolve #7
mynameisfiber_gohll
train
go
945a1b5581228c4d5ce97b3bd529a840003936d8
diff --git a/spec/functional/mongoid/safety_spec.rb b/spec/functional/mongoid/safety_spec.rb index <HASH>..<HASH> 100644 --- a/spec/functional/mongoid/safety_spec.rb +++ b/spec/functional/mongoid/safety_spec.rb @@ -137,6 +137,10 @@ describe Mongoid::Safety do Mongoid.persist_in_safe_mode = true end + after do + Mongoid.persist_in_safe_mode = false + end + describe ".create" do before do
Don't polute other tests with persist_in_safe_mode setting.
mongodb_mongoid
train
rb
3a294596cca6931a06b6604637f35f875d0ffdc5
diff --git a/client/my-sites/themes/index.node.js b/client/my-sites/themes/index.node.js index <HASH>..<HASH> 100644 --- a/client/my-sites/themes/index.node.js +++ b/client/my-sites/themes/index.node.js @@ -12,5 +12,6 @@ export default function( router ) { if ( config.isEnabled( 'manage/themes' ) ) { router( '/design', makeLayout ); router( '/design/type/:tier', makeLayout ); + router( '/design/*', makeLayout ); // Needed so direct hits don't result in a 404. } }
Themes: Add catch-all route to avoid <I> for single-site view
Automattic_wp-calypso
train
js
0c3c8f733f746a85b5dfd387aa81a613d6904c3a
diff --git a/topydo/lib/PrettyPrinterFilter.py b/topydo/lib/PrettyPrinterFilter.py index <HASH>..<HASH> 100644 --- a/topydo/lib/PrettyPrinterFilter.py +++ b/topydo/lib/PrettyPrinterFilter.py @@ -71,7 +71,7 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter): p_todo_str) # tags - p_todo_str = re.sub(r'\b\S+:[^/\s]\S+\b', + p_todo_str = re.sub(r'\b\S+:[^/\s]\S*\b', metadata_color + r'\g<0>' + color, p_todo_str)
Highlight tags when the value is one character long. Tags with a value of length 1 were not highlighted with the metadata color. Compare: <URL>
bram85_topydo
train
py
ec9f0b11560e5a31f4115d448c4eb685ce12702d
diff --git a/picoweb/__init__.py b/picoweb/__init__.py index <HASH>..<HASH> 100644 --- a/picoweb/__init__.py +++ b/picoweb/__init__.py @@ -17,11 +17,12 @@ def get_mime_type(fname): return "text/plain" def sendstream(writer, f): + buf = bytearray(64) while True: - buf = f.read(512) - if not buf: + l = f.readinto(buf) + if not l: break - yield from writer.awrite(buf) + yield from writer.awrite(buf, 0, l) def jsonify(writer, dict):
picoweb: sendstream: Use readinto/3-arg awrite. Also, optimize buffer size for low-heap systems like esp<I> (need to make adaptive in the future).
pfalcon_picoweb
train
py
be15406f6651e80fdf2fce34c279528fd257b800
diff --git a/src/DateTime.php b/src/DateTime.php index <HASH>..<HASH> 100644 --- a/src/DateTime.php +++ b/src/DateTime.php @@ -44,7 +44,13 @@ class DateTime extends DT implements JsonSerializable switch (gettype($time)) { case 'object': if ($time instanceof \DateTimeInterface) { - parent::__construct($time->format(\DateTimeInterface::ATOM), $timezone); + if($timezone!==null){ + throw new InvalidArgumentException('Time zone must be null when passing DateTime object.'); + } + parent::__construct( + $time->format(self::STRING_IO_FORMAT_MICRO), + $time->getTimezone() + ); break; } // no break, fall through if not instance of DateTimeInterface
Fixed constructor handling of DateTime object.
diskerror_Typed
train
php
bc0796736c077a18eeab8a7513da791a35d80ccd
diff --git a/test/rql_test/drivers/driver.js b/test/rql_test/drivers/driver.js index <HASH>..<HASH> 100644 --- a/test/rql_test/drivers/driver.js +++ b/test/rql_test/drivers/driver.js @@ -543,7 +543,7 @@ function err_regex(err_name, err_pat, err_frames) { err_frames, err_name + "(\""+err_pat+"\")"); } -function err_predicate(err_name, err_predicate, err_frames, desc) { +function err_predicate(err_name, err_pred, err_frames, desc) { var err_frames = null; // TODO: test for frames var fun = function(other) { if (!(other instanceof Error)) return false; @@ -553,7 +553,7 @@ function err_predicate(err_name, err_predicate, err_frames, desc) { other.msg = other.msg.replace(/:\n([\r\n]|.)*/m, "."); other.msg = other.msg.replace(/\nFailed assertion([\r\n]|.)*/m, ""); - if (!err_predicate(other.msg)) return false; + if (!err_pred(other.msg)) return false; if (err_frames && !(eq_test(other.frames, err_frames))) return false; return true; }
Make function not have the same name as its parameter.
rethinkdb_rethinkdb
train
js
e7e9f14735a7f3a008a756e62734478020954600
diff --git a/pygubudesigner/previewer.py b/pygubudesigner/previewer.py index <HASH>..<HASH> 100644 --- a/pygubudesigner/previewer.py +++ b/pygubudesigner/previewer.py @@ -157,8 +157,8 @@ class Preview: self.canvas.itemconfigure(self.shapes['window'], window=canvas_window) canvas_window.update_idletasks() canvas_window.grid_propagate(0) - self.w = self.min_w = preview_widget.winfo_width() - self.h = self.min_h = preview_widget.winfo_height() + self.w = self.min_w = preview_widget.winfo_reqwidth() + self.h = self.min_h = preview_widget.winfo_reqheight() self.resize_to(self.w, self.h)
Set correct width and height of widget preview.
alejandroautalan_pygubu
train
py
baa4769ce47b4919c5110ce962a0a6f6ddd58ed6
diff --git a/src/components/UrlRule.php b/src/components/UrlRule.php index <HASH>..<HASH> 100644 --- a/src/components/UrlRule.php +++ b/src/components/UrlRule.php @@ -42,9 +42,10 @@ class UrlRule extends \luya\base\UrlRule $composition = new \luya\collection\PrefixComposition(); $composition->set($compositionKeys); - Yii::$app->collection->composition = $composition; + yii::$app->collection->composition = $composition; - /* new get default url route @ 07.01.2015 */ + // set the yii app language param based on the composition fullUrl + yii::$app->language = $composition->getFull(); $parts = explode("/", $request->getPathInfo()); // can be deleted after reshuffle array
added the yii app language during luya urlrule "boot".
luyadev_luya
train
php
194e4c3bc55c3c90ad631a9ec0bc678052350eb6
diff --git a/eac.rb b/eac.rb index <HASH>..<HASH> 100644 --- a/eac.rb +++ b/eac.rb @@ -6,9 +6,8 @@ module EAC class << self def parse(content) xml_doc = Nokogiri::XML(content) - namespaces = xml_doc.collect_namespaces entity_types = xml_doc.xpath("//ns:cpfDescription/ns:identity/ns:entityType", - ns:namespaces['xmlns']) + ns:'urn:isbn:1-931666-33-4') if entity_types.nil? || entity_types.length < 1 raise ArgumentError.new("entityType not found") end
explicit namespace, since it is referred to in the schema
ultrasaurus_eac
train
rb
d2bd6a4b2990d4f9406f41a066fc5890a936a9c4
diff --git a/pyinfra/cli.py b/pyinfra/cli.py index <HASH>..<HASH> 100644 --- a/pyinfra/cli.py +++ b/pyinfra/cli.py @@ -142,7 +142,7 @@ def setup_logging(log_level): def print_facts_list(): - print(json.dumps(list(get_fact_names()), indent=4)) + print(json.dumps(list(get_fact_names()), indent=4, default=json_encode)) def print_fact(fact_data): @@ -214,7 +214,7 @@ def print_meta(state): def print_data(inventory): for host in inventory: print('[{0}]'.format(colored(host.name, attrs=['bold']))) - print(json.dumps(host.data.dict(), indent=4)) + print(json.dumps(host.data.dict(), indent=4, default=json_encode)) print() @@ -529,11 +529,13 @@ def make_inventory( # Read the files locals into a dict file_data = import_locals(data_filename) - # Strip out any pseudo module imports + # Strip out any pseudo module imports and _prefixed variables data.update({ key: value for key, value in six.iteritems(file_data) if not isinstance(value, PseudoModule) + and not key.startswith('_') + and key.islower() }) # Attach to group object
Only accept data attributes which are lowercase and don't start `_`.
Fizzadar_pyinfra
train
py
a6773ec725d8c586123b691f8c475693300f29ff
diff --git a/Console/Command/AssetCompressShell.php b/Console/Command/AssetCompressShell.php index <HASH>..<HASH> 100644 --- a/Console/Command/AssetCompressShell.php +++ b/Console/Command/AssetCompressShell.php @@ -113,11 +113,25 @@ class AssetCompressShell extends AppShell { $this->err('No ' . $ext . ' build files defined, skipping'); return; } + $this->_clearPath(TMP, $themes, $targets); + $path = $this->_Config->cachePath($ext); if (!file_exists($path)) { $this->err('Build directory ' . $path . ' for ' . $ext . ' does not exist.'); return; } + $this->_clearPath($path, $themes, $targets); + } + +/** + * Clear a path of build targets. + * + * @param string $path The path to clear. + * @param array $themes The themes to clear. + * @param array $targets The build targets to clear. + * @return void + */ + protected function _clearPath($path, $themes, $targets) { $dir = new DirectoryIterator($path); foreach ($dir as $file) { $name = $base = $file->getFilename();
Have console tool clear new temporary cache files too. The clear command should clear all the temp files too. Its only polite really.
markstory_asset_compress
train
php
3def6e7de602f068f18b2ebf252d8ae35d6a77fe
diff --git a/src/Internal/ErrorHandler.php b/src/Internal/ErrorHandler.php index <HASH>..<HASH> 100644 --- a/src/Internal/ErrorHandler.php +++ b/src/Internal/ErrorHandler.php @@ -99,7 +99,7 @@ class ErrorHandler } $addContent('Message', $message, true, true); $addContent('Simple trace', implode("\n", $simpleTrace), true, true); - //$addContent('Full trace', print_r($trace, true), false, true); + $addContent('Full trace', print_r($trace, true), false, true); } $addContent('Request', $app->request->method . ' ' . $app->request->base . $app->request->path, true, true); $addContent('PHP variables', print_r([
Added full trace to the detailed error log.
bearframework_bearframework
train
php
d606b1ba510493af6ba1ce30340358b753c3df6e
diff --git a/src/com/opera/core/systems/scope/services/ums/OperaExec.java b/src/com/opera/core/systems/scope/services/ums/OperaExec.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/scope/services/ums/OperaExec.java +++ b/src/com/opera/core/systems/scope/services/ums/OperaExec.java @@ -231,17 +231,9 @@ public class OperaExec extends AbstractService implements IOperaExec { public void key(String key, boolean up) { if (up) { - if (!keys.contains(key)) { - throw new WebDriverException("Impossible to release key " + key - + " while it's not down"); - } action("_keyup", key); keys.remove(key); } else { - if (keys.contains(key)) { - throw new WebDriverException("Impossible to push " + key - + " while it's down"); - } action("_keydown", key); keys.add(key); }
Remove check for pressing already pressed key. There are no adverse effects, isn't required by the Se test suite, and will make some future changes easier.
operasoftware_operaprestodriver
train
java
6b18ba17ce3881ac9d1a193272cbc7fcf91ade69
diff --git a/js/southxchange.js b/js/southxchange.js index <HASH>..<HASH> 100644 --- a/js/southxchange.js +++ b/js/southxchange.js @@ -8,7 +8,6 @@ let { ExchangeError } = require ('./base/errors'); // --------------------------------------------------------------------------- module.exports = class southxchange extends Exchange { - describe () { return this.deepExtend (super.describe (), { 'id': 'southxchange', @@ -251,4 +250,4 @@ module.exports = class southxchange extends Exchange { let response = await this.fetch2 (path, api, method, params, headers, body); return response; } -} +};
southxchange: linting
ccxt_ccxt
train
js
0729ad15accb7fac64086ccd8e7f740026a7661e
diff --git a/h2o-py/h2o/group_by.py b/h2o-py/h2o/group_by.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/group_by.py +++ b/h2o-py/h2o/group_by.py @@ -2,7 +2,7 @@ from __future__ import print_function from __future__ import absolute_import from past.builtins import basestring from .expr import ExprNode -from . import h2o +import h2o class GroupBy: diff --git a/h2o-py/h2o/h2o.py b/h2o-py/h2o/h2o.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/h2o.py +++ b/h2o-py/h2o/h2o.py @@ -511,7 +511,7 @@ def download_pojo(model,path="", get_jar=True): print("Filepath: {}".format(filepath)) if path == "": print(java.text) else: - with open(filepath, 'wb') as f: + with open(filepath, 'w') as f: f.write(java.text) if get_jar and path!="": url = H2OConnection.make_url("h2o-genmodel.jar")
stupid relative imports don't work in py2
h2oai_h2o-3
train
py,py
46f3b4f950af5171d178c1c535fdc16fb52fe73e
diff --git a/lib/espresso-runner.js b/lib/espresso-runner.js index <HASH>..<HASH> 100644 --- a/lib/espresso-runner.js +++ b/lib/espresso-runner.js @@ -143,11 +143,18 @@ class EspressoRunner { async buildNewModServer () { let buildConfiguration = {}; if (this.espressoBuildConfig) { - logger.info(`Using build configuration JSON from: '${this.espressoBuildConfig}'`); + let buildConfigurationStr; + if (await fs.exists(this.espressoBuildConfig)) { + logger.info(`Loading the build configuration from '${this.espressoBuildConfig}'`); + buildConfigurationStr = await fs.readFile(this.espressoBuildConfig, 'utf8'); + } else { + logger.info(`Loading the build configuration from 'espressoBuildConfig' capability`); + buildConfigurationStr = this.espressoBuildConfig; + } try { - buildConfiguration = JSON.parse(await fs.readFile(this.espressoBuildConfig, 'utf8')); + buildConfiguration = JSON.parse(buildConfigurationStr); } catch (e) { - logger.error('Failed to parse build configuration JSON', e); + logger.error('Cannot parse the build configuration JSON', e); throw e; } }
feat: Make it possible to provide a build config directly from capabilities (#<I>)
appium_appium-espresso-driver
train
js
08e7f3d7d1571aaa0e6fb90c219806ccd9a65285
diff --git a/pkg/hubble/relay/pool/manager.go b/pkg/hubble/relay/pool/manager.go index <HASH>..<HASH> 100644 --- a/pkg/hubble/relay/pool/manager.go +++ b/pkg/hubble/relay/pool/manager.go @@ -200,7 +200,6 @@ func (m *Manager) manageConnections() { } m.mu.Unlock() for _, p := range retry { - m.disconnect(p) m.connect(p, false) } }
hubble/relay: do not call disconnect before connection attempt This is not necessary as the connect function closes pre-existing connections.
cilium_cilium
train
go
be9ae36376e98aa6ee9eebb311217e15868198a7
diff --git a/jest/base.config.js b/jest/base.config.js index <HASH>..<HASH> 100644 --- a/jest/base.config.js +++ b/jest/base.config.js @@ -1,6 +1,9 @@ const path = require('path') module.exports = { + collectCoverage: true, + coverageDirectory: '<rootDir>/coverage', + coverageReporters: ['lcov'], modulePathIgnorePatterns: ['<rootDir>/scripts/'], rootDir: path.resolve(__dirname, '..'), setupFiles: ['raf/polyfill', '<rootDir>/jest/setup.js']
feat: test coverage output; just because
pluralsight_design-system
train
js
05f2bc945010e9ff3b7151d3a5e9f93e0cde3483
diff --git a/daemon/daemon.go b/daemon/daemon.go index <HASH>..<HASH> 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -520,8 +520,6 @@ func (d *Daemon) compileBase() error { args[initArgMode] = mode args[initArgDevice] = option.Config.Device - - args = append(args, option.Config.Device) } else { if option.Config.IsLBEnabled() && strings.ToLower(option.Config.Tunnel) != "disabled" { //FIXME: allow LBMode in tunnel
daemon: Remove unnecessary and unsafe arg append for init.sh The append was adding Device beyond initArgMax which was not used by init.sh
cilium_cilium
train
go
2814ff3716a8512518bee705a0f91425ce06b27b
diff --git a/devil/devil/android/device_utils.py b/devil/devil/android/device_utils.py index <HASH>..<HASH> 100644 --- a/devil/devil/android/device_utils.py +++ b/devil/devil/android/device_utils.py @@ -3045,7 +3045,11 @@ class DeviceUtils(object): Raises: CommandTimeoutError on timeout. """ - return self.GetProp('ro.product.cpu.abilist', cache=True).split(',') + supported_abis = self.GetProp('ro.product.cpu.abilist', cache=True) + return [ + supported_abi for supported_abi in supported_abis.split(',') + if supported_abi + ] @decorators.WithTimeoutAndRetriesFromInstance() def GetFeatures(self, timeout=None, retries=None):
Filter empty strings out of the list returned by GetSupportedABIs. Bug: chromium:<I> Change-Id: Ie<I>b<I>c<I>c8c<I>b<I>dbbf7 Reviewed-on: <URL>
catapult-project_catapult
train
py
7b088366514029df7650b5f44f7bb9fac7ec4e81
diff --git a/src/java/net/jpountz/lz4/LZ4FrameOutputStream.java b/src/java/net/jpountz/lz4/LZ4FrameOutputStream.java index <HASH>..<HASH> 100644 --- a/src/java/net/jpountz/lz4/LZ4FrameOutputStream.java +++ b/src/java/net/jpountz/lz4/LZ4FrameOutputStream.java @@ -43,8 +43,8 @@ import java.util.Locale; */ public class LZ4FrameOutputStream extends FilterOutputStream { - protected static final int INTEGER_BYTES = Integer.SIZE >>> 3; // or Integer.BYTES in Java 1.8 - protected static final int LONG_BYTES = Long.SIZE >>> 3; // or Long.BYTES in Java 1.8 + static final int INTEGER_BYTES = Integer.SIZE >>> 3; // or Integer.BYTES in Java 1.8 + static final int LONG_BYTES = Long.SIZE >>> 3; // or Long.BYTES in Java 1.8 static final int MAGIC = 0x184D2204; static final int LZ4_MAX_HEADER_LENGTH = @@ -392,7 +392,7 @@ public class LZ4FrameOutputStream extends FilterOutputStream { } } - public static class FrameInfo { + static class FrameInfo { private final FLG flg; private final BD bd; private final StreamingXXHash32 streamHash;
Change the accessibility of INTEGER_BYTES, LONG_BYTES, and FrameInfo to package, because external classes do not need them
lz4_lz4-java
train
java
947f3df94da2d7f82467a33d135c9c81715a63a3
diff --git a/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/converter/VariantContextToVariantConverter.java b/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/converter/VariantContextToVariantConverter.java index <HASH>..<HASH> 100644 --- a/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/converter/VariantContextToVariantConverter.java +++ b/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/converter/VariantContextToVariantConverter.java @@ -139,7 +139,13 @@ public class VariantContextToVariantConverter implements Converter<VariantContex + ":" + StringUtils.join(variantContext.getAlternateAlleles(), ",")); Map<String, String> attributes = new HashMap<>(); for (String key : variantContext.getAttributes().keySet()) { - attributes.put(key, variantContext.getAttributeAsString(key, "")); + // Do not use "getAttributeAsString" for lists. + // It will add brackets surrounding the values + if (variantContext.getAttribute(key, "") instanceof List) { + attributes.put(key, StringUtils.join(variantContext.getAttributeAsList(key), VCFConstants.INFO_FIELD_ARRAY_SEPARATOR)); + } else { + attributes.put(key, variantContext.getAttributeAsString(key, "")); + } } // QUAL
tools: Bugfix while parsing INFO column. Htsjdk adds brackets to fields that are read as lists when they are obtained with getAttributeAsString.
opencb_biodata
train
java
d700e35b4ca42b6dd75e4b3e768aa54f634b7856
diff --git a/test/has_scope_test.rb b/test/has_scope_test.rb index <HASH>..<HASH> 100644 --- a/test/has_scope_test.rb +++ b/test/has_scope_test.rb @@ -44,6 +44,16 @@ class TreesController < ApplicationController alias :edit :show protected + # Silence deprecations in the test suite, except for the actual deprecated String if/unless options. + # TODO: remove with the deprecation. + def apply_scopes(*) + if params[:eval_plant] + super + else + ActiveSupport::Deprecation.silence { super } + end + end + def restrict_to_only_tall_trees? true end
Silence deprecations temporarily in the test suite They are very noisy in all other methods that don't need it.
plataformatec_has_scope
train
rb