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
aa8fe2e04f60819a802e1d85cef25a3d90d705ce
diff --git a/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java b/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java +++ b/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java @@ -135,7 +135,21 @@ public class WunderBoss { shutdownWorkerPool(); } - public static void addShutdownAction(Runnable action) { + public synchronized static void addShutdownAction(Runnable action) { + if (!shutdownHook) { + if (!inContainer()) { + Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { + public void run() { + try { + shutdownAndReset(); + } catch (Throwable t) { + log.warn("Error in WunderBoss shutdown hook", t); + } + } + })); + } + shutdownHook = true; + } shutdownActions.add(action); } @@ -259,5 +273,5 @@ public class WunderBoss { private static DynamicClassLoader classLoader; private static ExecutorService workerExecutor; private static final Logger log = logger(WunderBoss.class); - + private static boolean shutdownHook = false; }
Run shutdown actions in Runtime shutdown hook [IMMUTANT-<I>] Only when out-of-container, as actions are already run when app is undeployed. The primary motivation for this (other than I thought we already were) is to drain requests-in-progress with Undertow's GracefulShutdownHandler before the JVM exits.
projectodd_wunderboss-release
train
java
d92f256fb252760760214716a89f57a67ef4d081
diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py index <HASH>..<HASH> 100644 --- a/src/marshmallow/schema.py +++ b/src/marshmallow/schema.py @@ -467,15 +467,12 @@ class BaseSchema(base.SchemaABC): Renamed from ``marshal``. """ if many and obj is not None: - self._pending = True - ret = [ + return [ self._serialize( d, fields_dict, many=False, dict_class=dict_class, accessor=accessor ) for d in obj ] - self._pending = False - return ret ret = self.dict_class() for attr_name, field_obj in fields_dict.items(): if getattr(field_obj, "load_only", False): @@ -586,7 +583,6 @@ class BaseSchema(base.SchemaABC): error_store.store_error([self.error_messages["type"]], index=index) ret = [] else: - self._pending = True ret = [ self._deserialize( d, @@ -601,7 +597,6 @@ class BaseSchema(base.SchemaABC): ) for idx, d in enumerate(data) ] - self._pending = False return ret ret = dict_class() # Check data is a dict
Remove unused _pending attribute (#<I>)
marshmallow-code_marshmallow
train
py
406509e93e0e239ecb3f1344d33d6fd0563e8964
diff --git a/cmd/influxd/run/server.go b/cmd/influxd/run/server.go index <HASH>..<HASH> 100644 --- a/cmd/influxd/run/server.go +++ b/cmd/influxd/run/server.go @@ -371,7 +371,7 @@ func (s *Server) reportServer() { json := fmt.Sprintf(`[{ "name":"reports", - "columns":["os", "arch", "version", "server_id", "id", "num_series", "num_measurements", "num_databases"], + "columns":["os", "arch", "version", "server_id", "cluster_id", "num_series", "num_measurements", "num_databases"], "points":[["%s", "%s", "%s", "%x", ",%x", "%d", "%d", "%d"]] }]`, runtime.GOOS, runtime.GOARCH, s.Version, s.MetaStore.NodeID(), clusterID, numSeries, numMeasurements, numDatabases)
Remove rogue ID field from reporting
influxdata_influxdb
train
go
06fbed0d8207f22c7764480803c6529bc9709629
diff --git a/LeanMapper/Repository.php b/LeanMapper/Repository.php index <HASH>..<HASH> 100644 --- a/LeanMapper/Repository.php +++ b/LeanMapper/Repository.php @@ -81,11 +81,12 @@ abstract class Repository ->where('%n = ?', $primaryKey, $entity->$idField) ->execute(); $entity->markAsUpdated(); - - return $result; } } $this->persistHasManyChanges($entity); + if (isset($result)) { + return $result; + } } /**
Fixed place where Repository::persistHasManyChanges is called
Tharos_LeanMapper
train
php
6ee80be90edc8c6d067b07ae01bf5439315d44af
diff --git a/plugins/compression.js b/plugins/compression.js index <HASH>..<HASH> 100644 --- a/plugins/compression.js +++ b/plugins/compression.js @@ -4,18 +4,21 @@ module.exports = compressionPlugin function compressionPlugin() { return { - decompress: decompress, - compress: compress, + get: get, + set: set, } - function decompress(_, key) { - var val = this.get(key) - if (!val) return val - return JSON.parse(LZString.decompress(val)) + function get(super_fn, key, raw) { + var val = super_fn(key) + if (!val || raw) return val + var decompressed = LZString.decompress(val) + // fallback to existing values that are not compressed + return (decompressed == null) ? val : JSON.parse(decompressed) } - function compress(_, key, val) { + function set(super_fn, key, val, raw) { + if (raw) return super_fn(key, val) var compressed = LZString.compress(JSON.stringify(val)) - this.set(key, compressed) + super_fn(key, compressed) } }
update plugin to use get/set methods
marcuswestin_store.js
train
js
27247b726742ea5a0852274f228323f51af072d0
diff --git a/src/components/link.js b/src/components/link.js index <HASH>..<HASH> 100644 --- a/src/components/link.js +++ b/src/components/link.js @@ -105,7 +105,7 @@ export default { function guardEvent (e) { // don't redirect with control keys - if (e.metaKey || e.ctrlKey || e.shiftKey) return + if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return // don't redirect when preventDefault called if (e.defaultPrevented) return // don't redirect on right click
Fix Link component to guard the event if alt key is pressed (#<I>)
vuejs_vue-router
train
js
8ae3dce967996f9cac0824eaa16f9d70e0bb19e7
diff --git a/pymzn/mzn/solvers.py b/pymzn/mzn/solvers.py index <HASH>..<HASH> 100644 --- a/pymzn/mzn/solvers.py +++ b/pymzn/mzn/solvers.py @@ -142,6 +142,13 @@ class Optimathsat(Solver): def __init__(self, solver_id='optimathsat'): super().__init__(solver_id) + def args( + self, all_solutions=False, num_solutions=None, free_search=False, + parallel=None, seed=None, **kwargs + ): + args = ['-input=fzn'] + return args + class Parser(Solver.Parser): _line_comm_p = re.compile('%.*')
solvers: add basic Optimathsat args
paolodragone_pymzn
train
py
f41ad9984c8be4c1ce3a0a1c64e08a7b07536354
diff --git a/lib/pyfrc/wpilib/__init__.py b/lib/pyfrc/wpilib/__init__.py index <HASH>..<HASH> 100644 --- a/lib/pyfrc/wpilib/__init__.py +++ b/lib/pyfrc/wpilib/__init__.py @@ -1,2 +1,2 @@ from .core import * - +from ..main import run
Add run function to wpilib so robot code can get at it
robotpy_pyfrc
train
py
e9e063d6f37bc9ffadd33e494dccfda772f8f122
diff --git a/lxd/containers.go b/lxd/containers.go index <HASH>..<HASH> 100644 --- a/lxd/containers.go +++ b/lxd/containers.go @@ -798,7 +798,6 @@ func newLxdContainer(name string, daemon *Daemon) (*lxdContainer, error) { return nil, err } logfile := shared.VarPath("lxc", name, "log") - fmt.Println(logfile) err = c.SetConfigItem("lxc.logfile", logfile) if err != nil { return nil, err
Don't print the logfile location all the time
lxc_lxd
train
go
23d4ac1aa7c2f83fd78d8d6aa621e799775e294d
diff --git a/validator/testcases/content.py b/validator/testcases/content.py index <HASH>..<HASH> 100644 --- a/validator/testcases/content.py +++ b/validator/testcases/content.py @@ -272,7 +272,8 @@ def _process_file(err, xpi_package, name, file_data, name_lower, is_subpackage else PACKAGE_THEME) err.set_tier(1) - supported_versions = err.supported_versions + supported_versions = (err.supported_versions.copy() + if err.supported_versions else None) if is_subpackage: testendpoint_validator.test_inner_package(err, sub_xpi)
Preserve initial supported apps dict for later restoration
mozilla_amo-validator
train
py
267f7458ff4dce80557d9bb0684573b07cf3778b
diff --git a/src/Pho/Framework/AclCore.php b/src/Pho/Framework/AclCore.php index <HASH>..<HASH> 100644 --- a/src/Pho/Framework/AclCore.php +++ b/src/Pho/Framework/AclCore.php @@ -50,6 +50,26 @@ class AclCore { } /** + * Getter for the Creator object. + * + * @return Actor + */ + public function creator(): Actor + { + return $this->creator; + } + + /** + * Getter for the Context object. + * + * @return ContextInterface + */ + public function context(): ContextInterface + { + return $this->context; + } + + /** * Converts the object into a portable PHP array * * Useful for custom serialization.
minor improvements; added getter methods for core properties
phonetworks_pho-framework
train
php
f6c8f2365c5beca6616c24891aab9f422af6f7cf
diff --git a/openfisca_core/formulas.py b/openfisca_core/formulas.py index <HASH>..<HASH> 100644 --- a/openfisca_core/formulas.py +++ b/openfisca_core/formulas.py @@ -17,7 +17,7 @@ from . import holders, periods from .parameters import ParameterNotFound from .periods import MONTH, YEAR, ETERNITY from .commons import empty_clone, stringify_array -from .indexed_enums import Enum +from .indexed_enums import Enum, EnumArray log = logging.getLogger(__name__) @@ -515,11 +515,12 @@ class Formula(object): nan_count).encode('utf-8')) except TypeError: pass + + if self.holder.variable.value_type == Enum and not isinstance(array, EnumArray): + array = self.holder.variable.possible_values.encode(array) + if array.dtype != variable.dtype: - if self.holder.variable.value_type == Enum: - self.holder.variable.possible_values.encode(array) - else: - array = array.astype(variable.dtype) + array = array.astype(variable.dtype) self.clean_cycle_detection_data() if max_nb_cycles is not None:
Encode enums when formula result is an int array
openfisca_openfisca-core
train
py
01d80fefe4ffd32edc79809acd84a871625c6e7c
diff --git a/keanu-project/src/main/java/io/improbable/keanu/plating/loop/Loop.java b/keanu-project/src/main/java/io/improbable/keanu/plating/loop/Loop.java index <HASH>..<HASH> 100644 --- a/keanu-project/src/main/java/io/improbable/keanu/plating/loop/Loop.java +++ b/keanu-project/src/main/java/io/improbable/keanu/plating/loop/Loop.java @@ -128,7 +128,7 @@ public class Loop { if (throwWhenMaxCountIsReached) { throw new LoopException(errorMessage); } else { - log.warn(errorMessage); + log.info(errorMessage); } } }
logger should only give INFO (not WARN) if max count has been reached but the user told it not to throw
improbable-research_keanu
train
java
2d44017f40ed95c0653d440b16fc58e0f3558226
diff --git a/packages/express/lib/serve.js b/packages/express/lib/serve.js index <HASH>..<HASH> 100644 --- a/packages/express/lib/serve.js +++ b/packages/express/lib/serve.js @@ -13,7 +13,7 @@ module.exports = (mode, { configureServer }) => { { phases } ); const router = new Router(); - const app = configureServer(express().use(router), middlewares, mode); + const app = configureServer(express(), middlewares, mode).use(router); debug(middlewares); phases.forEach((phase) => middlewares[phase].forEach((middleware) =>
fix(express): reinstate previous behaviour, broken in #<I>
untool_untool
train
js
7547f4c1f802deae11ad528536ae086bcb5e89ee
diff --git a/tests/ResourceGeneratorTest.php b/tests/ResourceGeneratorTest.php index <HASH>..<HASH> 100644 --- a/tests/ResourceGeneratorTest.php +++ b/tests/ResourceGeneratorTest.php @@ -87,7 +87,7 @@ class ResourceGeneratorTest extends TestCase public function tearDown() { parent::tearDown(); - //$this->rmdir($this->temporaryDirectory); + $this->rmdir($this->temporaryDirectory); } protected function rmdir(string $dir)
Clean up tmp directory after running tests
php-api-clients_resource-generator
train
php
26196921a01998172dc3c1f45bcc1d1be75cf981
diff --git a/kik_unofficial/datatypes/xmpp/group_adminship.py b/kik_unofficial/datatypes/xmpp/group_adminship.py index <HASH>..<HASH> 100644 --- a/kik_unofficial/datatypes/xmpp/group_adminship.py +++ b/kik_unofficial/datatypes/xmpp/group_adminship.py @@ -45,7 +45,7 @@ class UnbanRequest(XMPPElement): data = ('<iq type="set" id="{}">' '<query xmlns="kik:groups:admin">' '<g jid="{}">' - '<b r="1">{}</m>' + '<b r="1">{}</b>' '</g>' '</query>' '</iq>').format(self.message_id, self.group_jid, self.peer_jid) @@ -62,7 +62,7 @@ class BanMemberRequest(XMPPElement): data = ('<iq type="set" id="{}">' '<query xmlns="kik:groups:admin">' '<g jid="{}">' - '<b>{}</m>' + '<b>{}</b>' '</g>' '</query>' '</iq>').format(self.message_id, self.group_jid, self.peer_jid)
Fix malformed XML for (un)ban requests
tomer8007_kik-bot-api-unofficial
train
py
5a620da29a11dbf6f7432568c0721a6b643152e4
diff --git a/go/vt/vttablet/tabletmanager/vreplication/engine.go b/go/vt/vttablet/tabletmanager/vreplication/engine.go index <HASH>..<HASH> 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/engine.go +++ b/go/vt/vttablet/tabletmanager/vreplication/engine.go @@ -60,8 +60,6 @@ const ( table_name varbinary(128), lastpk varbinary(2000), primary key (vrepl_id, table_name))` - - warmUpQuery = "select 1 from _vt.vreplication limit 1" ) var withDDL *withddl.WithDDL @@ -151,9 +149,6 @@ func (vre *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) { return binlogplayer.NewDBClient(dbcfgs.FilteredWithDB()) } vre.dbName = dbcfgs.DBName - - // Ensure the schema is created as early as possible - go vre.Exec(warmUpQuery) } // NewTestEngine creates a new Engine for testing.
engine's early schema creation did not work as expected. Not improtant on this branch's radar
vitessio_vitess
train
go
e5621f8c39ed620e5d972e292812d50ca0e6113a
diff --git a/web/concrete/authentication/concrete/controller.php b/web/concrete/authentication/concrete/controller.php index <HASH>..<HASH> 100644 --- a/web/concrete/authentication/concrete/controller.php +++ b/web/concrete/authentication/concrete/controller.php @@ -2,6 +2,7 @@ namespace Concrete\Authentication\Concrete; use \Concrete\Core\Authentication\AuthenticationTypeController; use User; +use Loader; class Controller extends AuthenticationTypeController { public $apiMethods = array('forgot_password', 'change_password');
fixed missing loader that broke my first login Former-commit-id: a<I>c<I>f<I>a<I>c2ebb<I>d<I>b<I>a2b5c1ed<I>c
concrete5_concrete5
train
php
d45ce359233266d765fc972b5506464db9dee283
diff --git a/lib/Predis/Connection/PhpiredisConnection.php b/lib/Predis/Connection/PhpiredisConnection.php index <HASH>..<HASH> 100644 --- a/lib/Predis/Connection/PhpiredisConnection.php +++ b/lib/Predis/Connection/PhpiredisConnection.php @@ -236,10 +236,10 @@ class PhpiredisConnection extends AbstractConnection $host = $parameters->host; if (ip2long($host) === false) { - if (($address = gethostbyname($host)) === $host) { + if (($addresses = gethostbynamel($host)) === false) { $this->onConnectionError("Cannot resolve the address of $host"); } - return $address; + return $addresses[array_rand($addresses)]; } return $host;
Use a random IP when a host has several IPs. Using gethostbyname, we will reuse the same (first) IP address for each request. Here, we choose the IP we use randomly. This is practical in a case where we have multiple redis read-only slaves that can't invidually support the full application load, but are accessible through a single hostname.
imcj_predis
train
php
31fce1d6925f459e3bec7a42d70bce1a61b9bc08
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index <HASH>..<HASH> 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -1232,6 +1232,7 @@ class MainWindow(QMainWindow): plugin.dockwidget.raise_() # Hide Python console until we remove it + self.extconsole.close_console() self.extconsole.toggle_view_action.setChecked(False) # Show history file if no console is visible diff --git a/spyder/plugins/externalconsole.py b/spyder/plugins/externalconsole.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/externalconsole.py +++ b/spyder/plugins/externalconsole.py @@ -888,9 +888,8 @@ class ExternalConsole(SpyderPluginWidget): if isinstance(sw, pythonshell.ExternalPythonShell): consoles = True break - # Don't create consoles by default - #if not consoles: - # self.open_interpreter() + if not consoles: + self.open_interpreter() else: self.dockwidget.hide()
Python console: Fix error while creating history log file at startup
spyder-ide_spyder
train
py,py
6ad6e4e1d9251a9fddcbed80bdaad18ed07c66ae
diff --git a/pandas/core/series.py b/pandas/core/series.py index <HASH>..<HASH> 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -103,11 +103,11 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, """ One-dimensional ndarray with axis labels (including time series). - Labels need not be unique but must be any hashable type. The object + Labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Statistical methods from ndarray have been overridden to automatically exclude - missing data (currently represented as NaN) + missing data (currently represented as NaN). Operations between Series (+, -, /, *, **) align values based on their associated index values-- they need not be the same length. The result @@ -118,8 +118,8 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, data : array-like, dict, or scalar value Contains data stored in Series index : array-like or Index (1d) - Values must be unique and hashable, same length as data. Index - object (or other iterable of same length as data) Will default to + Values must be hashable and have the same length as `data`. + Non-unique index values are allowed. Will default to RangeIndex(len(data)) if not provided. If both a dict and index sequence are used, the index will override the keys found in the dict.
DOC: Correct uniqueness of index for Series (#<I>)
pandas-dev_pandas
train
py
beb8a8ce90d08e9796ab06585192e5484cf517f9
diff --git a/src/fng-ui-select.js b/src/fng-ui-select.js index <HASH>..<HASH> 100644 --- a/src/fng-ui-select.js +++ b/src/fng-ui-select.js @@ -265,7 +265,7 @@ defaultPlaceholder = 'Start typing...' } // set up the ui-select directives - var select = '<ui-select ' + multiStr + buildingBlocks.common + requiredStr + disabledStr + ' theme="' + theme + '" style="width:300px;">' + var select = '<ui-select ' + multiStr + buildingBlocks.common + requiredStr + disabledStr + ' theme="' + theme + '" style="min-width:18em;">' select += '<ui-select-match' + allowClearStr + ' placeholder="' + (processedAttr.info.placeholder || defaultPlaceholder) + '">';
Change hard coded width to min-width
forms-angular_fng-ui-select
train
js
c28df4c18154af4770e9adb84732b278208cb872
diff --git a/lib/Clever/Student.php b/lib/Clever/Student.php index <HASH>..<HASH> 100644 --- a/lib/Clever/Student.php +++ b/lib/Clever/Student.php @@ -27,6 +27,7 @@ class CleverStudent extends CleverApiResource 'school' => array(), 'district' => array(), 'teachers' => array(), + 'contacts' => array(), 'events' => array()); } public function __call($method, $args)
Added the 'contacts' API endpoint to the Student object
Clever_clever-php
train
php
57559dadc839bb3144f3fc012de4414e44ca8448
diff --git a/packages/material-ui/src/StepLabel/StepLabel.js b/packages/material-ui/src/StepLabel/StepLabel.js index <HASH>..<HASH> 100644 --- a/packages/material-ui/src/StepLabel/StepLabel.js +++ b/packages/material-ui/src/StepLabel/StepLabel.js @@ -79,6 +79,7 @@ const StepLabel = React.forwardRef(function StepLabel(props, ref) { classes, className, error = false, + icon: iconProp, optional, StepIconComponent: StepIconComponentProp, StepIconProps, @@ -86,7 +87,8 @@ const StepLabel = React.forwardRef(function StepLabel(props, ref) { } = props; const { alternativeLabel, orientation } = React.useContext(StepperContext); - const { active, disabled, completed, icon } = React.useContext(StepContext); + const { active, disabled, completed, icon: iconContext } = React.useContext(StepContext); + const icon = iconProp || iconContext; let StepIconComponent = StepIconComponentProp;
[Stepper] Fix the icon prop support in StepLabel (#<I>)
mui-org_material-ui
train
js
3350ab0d82f7cf0c88a16b0365ff365d77507ea6
diff --git a/fileutil/fileutil.go b/fileutil/fileutil.go index <HASH>..<HASH> 100644 --- a/fileutil/fileutil.go +++ b/fileutil/fileutil.go @@ -122,7 +122,7 @@ func ReadStringFromFile(pth string) (string, error) { // this is the "permissions" info, which can be passed directly to // functions like WriteBytesToFileWithPermission or os.OpenFile func GetFileModeOfFile(pth string) (os.FileMode, error) { - finfo, err := os.Stat(pth) + finfo, err := os.Lstat(pth) if err != nil { return 0, err } diff --git a/pathutil/pathutil.go b/pathutil/pathutil.go index <HASH>..<HASH> 100644 --- a/pathutil/pathutil.go +++ b/pathutil/pathutil.go @@ -39,7 +39,7 @@ func genericIsPathExists(pth string) (os.FileInfo, bool, error) { if pth == "" { return nil, false, errors.New("No path provided") } - fileInf, err := os.Stat(pth) + fileInf, err := os.Lstat(pth) if err == nil { return fileInf, true, nil }
Use `Lstat` instead of `Stat` in `genericIsPathExists` & `GetFileModeOfFile` The difference is symbolic links. `Lstat`: If the file is a symbolic link, the returned FileInfo describes the symbolic link. Lstat makes no attempt to follow the link.
bitrise-io_go-utils
train
go,go
5f03ae86d97402fa35cf3645c9a8b484cb0071f9
diff --git a/km3pipe/pumps/tests/test_evt.py b/km3pipe/pumps/tests/test_evt.py index <HASH>..<HASH> 100644 --- a/km3pipe/pumps/tests/test_evt.py +++ b/km3pipe/pumps/tests/test_evt.py @@ -81,7 +81,7 @@ class TestEvtParser(TestCase): "end_event:" )) - self.pump = EvtPump() + self.pump = EvtPump(None) self.pump.blob_file = StringIO(self.valid_evt_header) def tearDown(self):
Fixes broken test due to new positional argument 'filename' in pumps
tamasgal_km3pipe
train
py
53841e02bd0d6910e6faa8bdde9d9aeda695cab0
diff --git a/app/main.go b/app/main.go index <HASH>..<HASH> 100644 --- a/app/main.go +++ b/app/main.go @@ -83,7 +83,7 @@ func (r *realize) Increase() { rLimit.Cur = r.Limit err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { - fmt.Println(c.Red("Error Setting Rlimit "), err) + log.Fatal(c.Red("Error Setting Rlimit "), err) } }
fatal error if the system can't set a rlimit
oxequa_realize
train
go
760e4680f0c6d7198c8acfd757ba5638c8d5fc2a
diff --git a/pyrsistent.py b/pyrsistent.py index <HASH>..<HASH> 100644 --- a/pyrsistent.py +++ b/pyrsistent.py @@ -6,7 +6,6 @@ from numbers import Integral import sys import six -import warnings def _bitcount(val): @@ -706,13 +705,6 @@ class PMap(object): evolver.remove(key) return evolver.pmap() - def merge(self, *maps): - """ - Deprecated, use update() instead! - """ - warnings.warn("Deprecated! Use update() instead!", DeprecationWarning) - return self.update(*maps) - def update(self, *maps): """ Return a new PMap with the items in Mappings inserted. If the same key is present in multiple @@ -724,13 +716,6 @@ class PMap(object): """ return self.update_with(lambda l, r: r, *maps) - def merge_with(self, merge_fn, *maps): - """ - Deprecated, use update_with() instead! - """ - warnings.warn("Deprecated! Use update_with() instead!", DeprecationWarning) - return self.update_with(merge_fn, *maps) - def update_with(self, update_fn, *maps): """ Return a new PMap with the items in Mappings maps inserted. If the same key is present in multiple
Removed deprecated merge and merge_with on PMap
tobgu_pyrsistent
train
py
a9dafe73c79bfe29638c794398f7968861482830
diff --git a/indra/sources/geneways/__init__.py b/indra/sources/geneways/__init__.py index <HASH>..<HASH> 100644 --- a/indra/sources/geneways/__init__.py +++ b/indra/sources/geneways/__init__.py @@ -1 +1 @@ -from .geneways_api import process_geneways_files +from .api import process_geneways_files
Refactor: geneways_api to api
sorgerlab_indra
train
py
96a9725297e7edaba6da9e1f2c0b4aa48785dc5a
diff --git a/Eloquent/Relations/MorphTo.php b/Eloquent/Relations/MorphTo.php index <HASH>..<HASH> 100644 --- a/Eloquent/Relations/MorphTo.php +++ b/Eloquent/Relations/MorphTo.php @@ -151,7 +151,11 @@ class MorphTo extends BelongsTo { $class = Model::getActualClassNameForMorph($type); - return new $class; + return tap(new $class, function ($instance) { + if (! $instance->getConnectionName()) { + $instance->setConnection($this->getConnection()->getName()); + } + }); } /**
Set relation connection on eager loaded MorphTo
illuminate_database
train
php
22699c0f450fe46932b47ed3763f98a424151595
diff --git a/src/python/atomistica/mdcore_io.py b/src/python/atomistica/mdcore_io.py index <HASH>..<HASH> 100644 --- a/src/python/atomistica/mdcore_io.py +++ b/src/python/atomistica/mdcore_io.py @@ -121,7 +121,9 @@ def read_atoms(fn, cycfn=None, pos_only=False, conv=1.0): l2 = f.readline() l3 = f.readline() - this.set_cell( [ map(float, l1.split()), map(float, l2.split()), map(float, l3.split()) ] ) + this.set_cell( [ [float(x) for x in l1.split()], + [float(x) for x in l2.split()], + [float(x) for x in l3.split()] ] ) l = None @@ -131,7 +133,7 @@ def read_atoms(fn, cycfn=None, pos_only=False, conv=1.0): while l and l[0] not in [ '<', '#' ]: s = l.split() - aux += [ map(float, s) ] + aux += [ [float(x) for x in s] ] l = f.readline().strip()
MAINT: Python-3 compatibility.
Atomistica_atomistica
train
py
18f7772a9b768e5703f3f7dc83a40638dea414b2
diff --git a/lib/arjdbc/db2/adapter.rb b/lib/arjdbc/db2/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/db2/adapter.rb +++ b/lib/arjdbc/db2/adapter.rb @@ -424,8 +424,9 @@ module ArJdbc end end - def remove_index(table_name, options = { }) - execute "DROP INDEX #{quote_column_name(index_name(table_name, options))}" + # @override + def remove_index!(table_name, index_name) + execute "DROP INDEX #{quote_column_name(index_name)}" end # http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.dbobj.doc/doc/t0020130.html
[DB2] Fix error on named index removing
jruby_activerecord-jdbc-adapter
train
rb
08a2065119b00f57a12549affd242d7f2e18f9a3
diff --git a/thefuck/rules/no_such_file.py b/thefuck/rules/no_such_file.py index <HASH>..<HASH> 100644 --- a/thefuck/rules/no_such_file.py +++ b/thefuck/rules/no_such_file.py @@ -3,7 +3,9 @@ import re patterns = ( r"mv: cannot move '[^']*' to '([^']*)': No such file or directory", + r"mv: cannot move '[^']*' to '([^']*)': Not a directory", r"cp: cannot create regular file '([^']*)': No such file or directory", + r"cp: cannot create regular file '([^']*)': Not a directory", )
Add missing cases for the `no_such_file` rule
nvbn_thefuck
train
py
a893540b667c302ae3267d3968628b19f8aca4ec
diff --git a/libnetwork/drivers/ipvlan/ipvlan_network.go b/libnetwork/drivers/ipvlan/ipvlan_network.go index <HASH>..<HASH> 100644 --- a/libnetwork/drivers/ipvlan/ipvlan_network.go +++ b/libnetwork/drivers/ipvlan/ipvlan_network.go @@ -38,7 +38,6 @@ func (d *driver) CreateNetwork(nid string, option map[string]interface{}, nInfo if err != nil { return err } - config.ID = nid err = config.processIPAM(nid, ipV4Data, ipV6Data) if err != nil { return err @@ -212,6 +211,7 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err config.Internal = true } } + config.ID = id return config, nil }
libnetwork: ipvlan: set network ID as part of parseNetworkOptions
moby_moby
train
go
0074324b107c1736914c20f570258b474e4caadb
diff --git a/core/server/data/migrations/versions/3.22/02-settings-key-renames.js b/core/server/data/migrations/versions/3.22/02-settings-key-renames.js index <HASH>..<HASH> 100644 --- a/core/server/data/migrations/versions/3.22/02-settings-key-renames.js +++ b/core/server/data/migrations/versions/3.22/02-settings-key-renames.js @@ -16,7 +16,11 @@ const renameMappings = [{ from: 'brand', to: 'accent_color', getToValue: (fromValue) => { - return JSON.parse(fromValue).primaryColor || ''; + try { + return JSON.parse(fromValue).primaryColor || ''; + } catch (err) { + return ''; + } }, getFromValue: (toValue) => { return JSON.stringify({
Fixed migration when brand setting is null refs #<I> This would throw if the setting was null, we catch and use the default instead.
TryGhost_Ghost
train
js
010a7f8eff2895eae831ea89072333b71fa7c135
diff --git a/integration_tests/test_files.py b/integration_tests/test_files.py index <HASH>..<HASH> 100644 --- a/integration_tests/test_files.py +++ b/integration_tests/test_files.py @@ -13,7 +13,7 @@ class Test_make_unreadable_file(unittest.TestCase): def test(self): path = os.path.join(self.tmp, "unreadable") make_unreadable_file(path) - with self.assertRaises(OSError): + with self.assertRaises(IOError): read_file(path) def tearDown(self):
Really fix in compatibility with python <I>
andreafrancia_trash-cli
train
py
1a0cbe80885942a3e97af26dfd61d3de141acf20
diff --git a/web/concrete/blocks/image/view.php b/web/concrete/blocks/image/view.php index <HASH>..<HASH> 100644 --- a/web/concrete/blocks/image/view.php +++ b/web/concrete/blocks/image/view.php @@ -26,7 +26,7 @@ if (is_object($f)) { <? } ?> <script> $(function() { - $('.bID-<?php echo $bID;?>') + $('.bID-<?php print $bID;?>') .mouseover(function(e){$(this).attr("src", '<?php print $imgPath["hover"];?>');}) .mouseout(function(e){$(this).attr("src", '<?php print $imgPath["default"];?>');}); });
amended echo to print for consistency in view.php Former-commit-id: 4b<I>a8cd<I>c<I>ed<I>e<I>f7abd4aff5f
concrete5_concrete5
train
php
2374717c15fa402d689dd755ba0f933f9ee9b445
diff --git a/kv/service.go b/kv/service.go index <HASH>..<HASH> 100644 --- a/kv/service.go +++ b/kv/service.go @@ -77,7 +77,9 @@ func NewService(log *zap.Logger, kv Store, configs ...ServiceConfig) *Service { if len(configs) > 0 { s.Config = configs[0] - } else { + } + + if s.Config.SessionLength == 0 { s.Config.SessionLength = influxdb.DefaultSessionLength }
refactor(kv): when no session length is set, use the default In the past, the default was only being set if a service config wasn't provided. But if a service config was provided and gave a zero value, it would not fill in the default value. This changes the code so that it will always set the default value if the session length is set to zero.
influxdata_influxdb
train
go
71bb8392c97a43f3e33df0dcfc2efa4a6c905438
diff --git a/js/btcmarkets.js b/js/btcmarkets.js index <HASH>..<HASH> 100644 --- a/js/btcmarkets.js +++ b/js/btcmarkets.js @@ -44,7 +44,7 @@ module.exports = class btcmarkets extends Exchange { 'www': 'https://btcmarkets.net', 'doc': [ 'https://api.btcmarkets.net/doc/v3#section/API-client-libraries', - 'https://github.com/BTCMarkets/API' + 'https://github.com/BTCMarkets/API', ], }, 'api': {
btcmarkets dangling comma
ccxt_ccxt
train
js
cd1292f78a3a0363b28211eacd7f3eb1850eddc7
diff --git a/lib/jumpstart_auth.rb b/lib/jumpstart_auth.rb index <HASH>..<HASH> 100644 --- a/lib/jumpstart_auth.rb +++ b/lib/jumpstart_auth.rb @@ -8,6 +8,25 @@ class JumpstartAuth :consumer_secret => "M0XkT6GeBnjxdlWHcSGYX1JutMVS9D5ISlkqRfShg" } + def self.client_class + @client_class ||= Class.new(Twitter::Client) do + def update(message) + if message.match(/^d\s/i) then + d, name, *rest = message.chomp.split + message.sub!(/.*#{name}\s/, '') + + begin + Twitter.direct_message_create(name, message) + rescue Twitter::Error::Forbidden + end + else + super(message) + end + end + end + end + private_class_method :client_class + def self.twitter setup_oauth unless load_settings Twitter.configure do |config| @@ -17,7 +36,7 @@ class JumpstartAuth config.oauth_token_secret = @@credentials[:oauth_secret] end - return Twitter::Client.new + return client_class.new end private @@ -47,4 +66,4 @@ private @@credentials[:oauth_secret] = access_token.secret write_settings end -end \ No newline at end of file +end
Simulate previous DM behavior Previously, Twitter updates with leading 'd' were interpreted as DMs. Simulating that via subclassing the client class.
JumpstartLab_jumpstart_auth
train
rb
d784bf9467bbaf8ffb37621c13fa30dfbb98e4d8
diff --git a/stratosphere-core/src/main/java/eu/stratosphere/core/fs/FileSystem.java b/stratosphere-core/src/main/java/eu/stratosphere/core/fs/FileSystem.java index <HASH>..<HASH> 100644 --- a/stratosphere-core/src/main/java/eu/stratosphere/core/fs/FileSystem.java +++ b/stratosphere-core/src/main/java/eu/stratosphere/core/fs/FileSystem.java @@ -200,7 +200,8 @@ public abstract class FileSystem { } catch (URISyntaxException e) { // we tried to repair it, but could not. report the scheme error - throw new IOException("FileSystem: Scheme is null. file:// or hdfs:// are example schemes."); + throw new IOException("FileSystem: Scheme is null. file:// or hdfs:// are example schemes. " + + "Failed for " + uri.toString() + "."); } } @@ -213,7 +214,8 @@ public abstract class FileSystem { // Try to create a new file system if (!FSDIRECTORY.containsKey(uri.getScheme())) { - throw new IOException("No file system found with scheme " + uri.getScheme()); + throw new IOException("No file system found with scheme " + uri.getScheme() + + ". Failed for " + uri.toString() + "."); } Class<? extends FileSystem> fsClass = null;
FS.get(): Add URI causing exception to message.
apache_flink
train
java
ea18f3e92079448fe3d783fc404dfbe8800f6a4d
diff --git a/mongo_connector/connector.py b/mongo_connector/connector.py index <HASH>..<HASH> 100644 --- a/mongo_connector/connector.py +++ b/mongo_connector/connector.py @@ -66,6 +66,17 @@ class Connector(threading.Thread): LOG.warning('No doc managers specified, using simulator.') self.doc_managers = (simulator.DocManager(),) + if not pymongo.has_c(): + warning = ('pymongo version %s was installed without the C ' + 'extensions. "InvalidBSON: Date value out of ' + 'range" errors may occur if there are documents ' + 'with BSON Datetimes that represent times outside of ' + 'Python\'s datetime.datetime limit.') % ( + pymongo.__version__,) + # Print and warn to make it extra noticeable + print(warning) + LOG.warning(warning) + # Password for authentication self.auth_key = kwargs.pop('auth_key', None)
Log a warning regarding missing pymongo C extensions. (#<I>)
yougov_mongo-connector
train
py
7d61982ad01700ec819dcac72aad8ac3902fb67c
diff --git a/core/ViewDataTable/Sparkline.php b/core/ViewDataTable/Sparkline.php index <HASH>..<HASH> 100644 --- a/core/ViewDataTable/Sparkline.php +++ b/core/ViewDataTable/Sparkline.php @@ -108,7 +108,10 @@ class Sparkline extends ViewDataTable $columns = $this->viewProperties['columns_to_display']; $columnToPlot = false; if (!empty($columns)) { - $columnToPlot = $columns[0]; + $columnToPlot = reset($columns); + if ($columnToPlot == 'label') { + $columnToPlot = next($columns); + } } $values = false; // a Set is returned when using the normal code path to request data from Archives, in all core plugins diff --git a/plugins/MultiSites/Controller.php b/plugins/MultiSites/Controller.php index <HASH>..<HASH> 100644 --- a/plugins/MultiSites/Controller.php +++ b/plugins/MultiSites/Controller.php @@ -226,7 +226,6 @@ class Controller extends \Piwik\Controller $api = "Goals.get"; } $view = $this->getLastUnitGraph($this->pluginName, __FUNCTION__, $api); - $view->columns_to_display = $columns; return $this->renderView($view, $fetch); } }
Fix regression in MultiSites controller (sparklines would not display).
matomo-org_matomo
train
php,php
8c01ea0ea613ab7615ca52e8c671f426e0635437
diff --git a/unyt/array.py b/unyt/array.py index <HASH>..<HASH> 100644 --- a/unyt/array.py +++ b/unyt/array.py @@ -357,7 +357,8 @@ class unyt_array(np.ndarray): set, input_units *must* be a valid unit object. Defaults to False. name : string The name of the array. Defaults to None. This attribute does not propagate - through operations. + through mathematical operations, but is preserved under indexing + and unit conversions. Examples -------- @@ -545,7 +546,7 @@ class unyt_array(np.ndarray): # it's a str. units = Unit(input_units, registry=registry) - # Attach the units + # Attach the units and name obj.units = units obj.name = name return obj @@ -1957,7 +1958,8 @@ class unyt_quantity(unyt_array): The dtype of the array data. name : string The name of the scalar. Defaults to None. This attribute does not propagate - through operations. + through mathematical operations, but is preserved under indexing + and unit conversions. Examples --------
address review comments - in array.py, clarify name attribute docstring and comment
yt-project_unyt
train
py
5d6e697d75391a2909880dc3b65000f1852c02fd
diff --git a/template.go b/template.go index <HASH>..<HASH> 100644 --- a/template.go +++ b/template.go @@ -210,8 +210,10 @@ func (p *Package) writeHeader(w io.Writer) error { fmt.Fprintf(&buf, "package %s\n", p.Name) // Write deduped imports. - var decls = make(map[string]*ast.ImportSpec) + var decls = map[string]bool{`:"fmt"`: true, `:"io"`: true} fmt.Fprint(&buf, "import (\n") + fmt.Fprintln(&buf, `"fmt"`) + fmt.Fprintln(&buf, `"io"`) for _, d := range f.Decls { d, ok := d.(*ast.GenDecl) if !ok || d.Tok != token.IMPORT { @@ -227,9 +229,10 @@ func (p *Package) writeHeader(w io.Writer) error { id += ":" + s.Path.Value // Ignore any imports which have already been imported. - if decls[id] != nil { + if decls[id] { continue } + decls[id] = true // Otherwise write it. if s.Name == nil {
Automatically include fmt and io packages.
benbjohnson_ego
train
go
d4897b7b75f82dc1ace0ea01f4005955e9960d6f
diff --git a/wpull/version.py b/wpull/version.py index <HASH>..<HASH> 100644 --- a/wpull/version.py +++ b/wpull/version.py @@ -32,5 +32,5 @@ def get_version_tuple(string): return (major, minor, patch, level, serial) -__version__ = '0.34a1' +__version__ = '0.35a1' version_info = get_version_tuple(__version__)
Bumps version to <I>a1. [ci skip]
ArchiveTeam_wpull
train
py
7faa259e314282e1433ec8d3a5bd2eaf81c19e75
diff --git a/ayrton/__init__.py b/ayrton/__init__.py index <HASH>..<HASH> 100644 --- a/ayrton/__init__.py +++ b/ayrton/__init__.py @@ -198,5 +198,6 @@ def run (code, globals, locals): runner.run () def main (script=None, file=None, **kwargs): + global runner runner= Ayrton (script=script, file=file, **kwargs) runner.run ()
@ revert reference to global.
StyXman_ayrton
train
py
d1d8b15583ec479ee7a71d1b58600a1077cd7e8e
diff --git a/core-bundle/src/Composer/ScriptHandler.php b/core-bundle/src/Composer/ScriptHandler.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Composer/ScriptHandler.php +++ b/core-bundle/src/Composer/ScriptHandler.php @@ -85,7 +85,7 @@ class ScriptHandler $phpPath, $event->getIO()->isDecorated() ? ' --ansi' : '', $cmd, - static::getVerbosityFlag($event) + self::getVerbosityFlag($event) ) );
[Core] Fix an issue found by Scrutinizer.
contao_contao
train
php
c4b5e6225a3a9c0049487693886106a0c2e10431
diff --git a/src/Screen/Fields/Cropper.php b/src/Screen/Fields/Cropper.php index <HASH>..<HASH> 100644 --- a/src/Screen/Fields/Cropper.php +++ b/src/Screen/Fields/Cropper.php @@ -30,6 +30,7 @@ namespace Orchid\Screen\Fields; * @method Cropper popover(string $value = null) * @method Cropper title(string $value = null) * @method Cropper maxFileSize($value = true) + * @method Cropper storage($value = null) */ class Cropper extends Picture { diff --git a/src/Screen/Fields/Picture.php b/src/Screen/Fields/Picture.php index <HASH>..<HASH> 100644 --- a/src/Screen/Fields/Picture.php +++ b/src/Screen/Fields/Picture.php @@ -21,6 +21,7 @@ use Orchid\Support\Init; * @method Picture popover(string $value = null) * @method Picture title(string $value = null) * @method Picture maxFileSize($value = true) + * @method Picture storage($value = null) */ class Picture extends Field {
add storage to Cropper and Image metadata (#<I>) Add storage method to metadata
orchidsoftware_platform
train
php,php
bdf4c06e8cba0650f01280fb550141686c056941
diff --git a/lib/server-code/services/api-server.js b/lib/server-code/services/api-server.js index <HASH>..<HASH> 100644 --- a/lib/server-code/services/api-server.js +++ b/lib/server-code/services/api-server.js @@ -154,7 +154,7 @@ class ApiServerService { return this.sendRequest('services/debug', opts) .then(res => { if (res.statusCode === 200) { - logger.info(`Service ${service.name} successfully deployed`); + logger.info(`Service ${service.name} successfully registered`); } else { throw failureRespError(res, `register service ${service.name}`); }
fix (log) confusing msg 'service deployed' in debug mode
Backendless_JS-Code-Runner
train
js
c943d850193a476be1bc37ed922d1954cf040948
diff --git a/peer.go b/peer.go index <HASH>..<HASH> 100644 --- a/peer.go +++ b/peer.go @@ -535,6 +535,9 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) ( FeeRate: selfPolicy.FeeProportionalMillionths, TimeLockDelta: uint32(selfPolicy.TimeLockDelta), } + if forwardingPolicy.MaxHTLC > MaxPaymentMSat { + forwardingPolicy.MaxHTLC = MaxPaymentMSat + } } else { peerLog.Warnf("Unable to find our forwarding policy "+ "for channel %v, using default values", @@ -1866,6 +1869,9 @@ out: FeeRate: defaultPolicy.FeeRate, TimeLockDelta: defaultPolicy.TimeLockDelta, } + if forwardingPolicy.MaxHTLC > MaxPaymentMSat { + forwardingPolicy.MaxHTLC = MaxPaymentMSat + } // Create the link and add it to the switch. err = p.addLink(
peer: clamp a link's max HTLC forwarding policy to current max HTLC pay size In this commit, we start to clamp the max HTLC forwarding policy to the current register max HTLC payment size. By doing this, we ensure that any links that have a advertised max HTLC transit size above the max payment size will reject any incoming or outgoing attempts for such large payments.
lightningnetwork_lnd
train
go
4b29c490ed3502fed0d9a7652797cdf6232de14e
diff --git a/src/formatters/json.js b/src/formatters/json.js index <HASH>..<HASH> 100644 --- a/src/formatters/json.js +++ b/src/formatters/json.js @@ -1,7 +1,7 @@ /*eslint no-console: "off"*/ function printResults(results) { - console.log(JSON.stringify(results)); + console.error(JSON.stringify(results)); } module.exports = { diff --git a/src/formatters/stylish.js b/src/formatters/stylish.js index <HASH>..<HASH> 100644 --- a/src/formatters/stylish.js +++ b/src/formatters/stylish.js @@ -64,12 +64,12 @@ function printResults(results) { results.forEach(function(result) { if (result.errors.length > 0) { - console.log(stylizeFilePath(result.filePath)); + console.error(stylizeFilePath(result.filePath)); result.errors.forEach(function(error) { - console.log(stylizeError(error, maxErrorMsgLength, maxLineChars)); + console.error(stylizeError(error, maxErrorMsgLength, maxLineChars)); }); - console.log('\n'); + console.error('\n'); } }); }
fix: use console.error instead of console.log this fixes e.g. output in a Jenkins console, since normal console.log statements are mapped to INFO instead of ERROR
vsiakka_gherkin-lint
train
js,js
86a6a983cba9a548c7232feee1756d290920502a
diff --git a/cruzdb/__init__.py b/cruzdb/__init__.py index <HASH>..<HASH> 100644 --- a/cruzdb/__init__.py +++ b/cruzdb/__init__.py @@ -109,7 +109,6 @@ class Genome(object): _direction=None): assert _direction in (None, "up", "down") - # they sent in a feature if start is None: assert end is None @@ -125,14 +124,15 @@ class Genome(object): qstart, qend = start, end res = self.bin_query(table, chrom, qstart, qend) - change = 400 + i, change = 1, 350 while res.count() < k: if _direction in (None, "up"): if qstart == 0 and _direction == "up": break qstart = max(0, qstart - change) if _direction in (None, "down"): qend += change - change *= 2 + i += 1 + change *= (i + 5) res = self.bin_query(table, chrom, qstart, qend) def dist(f): d = 0
heurisitic to improve query speed
brentp_cruzdb
train
py
ca05c89cf370aef514f14f1ee902a0cfc207c951
diff --git a/freshroastsr700/__init__.py b/freshroastsr700/__init__.py index <HASH>..<HASH> 100644 --- a/freshroastsr700/__init__.py +++ b/freshroastsr700/__init__.py @@ -220,6 +220,8 @@ class freshroastsr700(object): self.state_transition_func() else: self.idle() + else: + time.sleep(0.01) def get_roaster_state(self): """Returns a string based upon the current state of the roaster. Will
Put a small sleep in the timer function else case To prevent high CPU usage, adding a small sleep in the else logic. This should also alleviate some UI lag issues in Openroast once you plug the roaster in. I found that the tight loop in the timer thread was taking so much CPU that the UI responsiveness would drop to about one second for a click on my machine.
Roastero_freshroastsr700
train
py
8f0005b286c34b43e9c77946b59d39ec01f98a09
diff --git a/grpc/src/main/java/com/linecorp/armeria/internal/grpc/ArmeriaMessageFramer.java b/grpc/src/main/java/com/linecorp/armeria/internal/grpc/ArmeriaMessageFramer.java index <HASH>..<HASH> 100644 --- a/grpc/src/main/java/com/linecorp/armeria/internal/grpc/ArmeriaMessageFramer.java +++ b/grpc/src/main/java/com/linecorp/armeria/internal/grpc/ArmeriaMessageFramer.java @@ -160,7 +160,7 @@ public class ArmeriaMessageFramer implements AutoCloseable { return compressed; } - private ByteBuf writeUncompressed(ByteBuf message) throws IOException { + private ByteBuf writeUncompressed(ByteBuf message) { int messageLength = message.readableBytes(); if (maxOutboundMessageSize >= 0 && messageLength > maxOutboundMessageSize) { throw Status.RESOURCE_EXHAUSTED
[Trivial] ArmeriaMessageFramer#writeUncompressed does not throw IOException anymore (#<I>)
line_armeria
train
java
8f3adc4b273f0fb2265409a1afde234ee4bc7d9c
diff --git a/public/js/chrome/analytics.js b/public/js/chrome/analytics.js index <HASH>..<HASH> 100644 --- a/public/js/chrome/analytics.js +++ b/public/js/chrome/analytics.js @@ -93,7 +93,7 @@ var analytics = { archive: function (url) { analytics.track('button', 'archive', url); }, - unarchive: function () { + unarchive: function (url) { analytics.track('button', 'unarchive', url); }, loadGist: function (id) {
Fixed #<I> Analytics was throwing exception
jsbin_jsbin
train
js
20b28a75ebf4ea6bbed64fce3b8dda5e1450f7bc
diff --git a/lib/web_translate_it/tasks.rb b/lib/web_translate_it/tasks.rb index <HASH>..<HASH> 100755 --- a/lib/web_translate_it/tasks.rb +++ b/lib/web_translate_it/tasks.rb @@ -85,10 +85,7 @@ private WELCOME_SCREEN = <<-EO_WELCOME -<banner>Web Translate It for Ruby on Rails</banner> -Should you need help, please visit: -<b>*</b> https://webtranslateit.com/help -<b>*</b> https://webtranslateit.com/forum +<banner>Web Translate It</banner> EO_WELCOME
Gem, not plugin. Also makes banner less annoying
AtelierConvivialite_webtranslateit
train
rb
4d54f41c50715afda285a776081e7a123d884222
diff --git a/lib/build.py b/lib/build.py index <HASH>..<HASH> 100644 --- a/lib/build.py +++ b/lib/build.py @@ -22,7 +22,7 @@ import distorm3 try: from PyInstaller import main as PyInstallerMain except ImportError: - logging.error("PyInstaller missing") + logging.warn("PyInstaller missing") from grr.lib import config_lib from grr.lib import rdfvalue
Lowered severity of PyInstaller import error
google_grr
train
py
d5b15dd6612f7d66183a4fa95788453fdd9b29d0
diff --git a/core/block_svg.js b/core/block_svg.js index <HASH>..<HASH> 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -998,8 +998,9 @@ Blockly.BlockSvg.prototype.updatePreviews = function(closestConnection, // Remove an insertion marker if needed. For Scratch-Blockly we are using // grayed-out blocks instead of highlighting the connection; for compatibility // with Web Blockly the name "highlightedConnection" will still be used. - if (Blockly.highlightedConnection_ && - Blockly.highlightedConnection_ != closestConnection) { + if (Blockly.highlightedConnection_ && Blockly.localConnection_ && + (Blockly.highlightedConnection_ != closestConnection || + Blockly.localConnection_ != localConnection)) { if (Blockly.insertionMarker_ && Blockly.insertionMarkerConnection_) { Blockly.BlockSvg.disconnectInsertionMarker(); }
Allow moving an insertion marker leftwards, take 2 By recognising an insertion marker as invalid if localConnection has changed, not just if highlightedConnection has changed.
LLK_scratch-blocks
train
js
7594c890dea0a9c3183d3faaddfa9c469ae5d072
diff --git a/generator/sbpg/generator.py b/generator/sbpg/generator.py index <HASH>..<HASH> 100755 --- a/generator/sbpg/generator.py +++ b/generator/sbpg/generator.py @@ -88,10 +88,15 @@ def main(): "Invalid output directory: %s. Exiting!" % output_dir # Ingest, parse, and validate. test_mode = args.test_c + if test_mode: file_index = yaml.resolve_test_deps(*yaml.get_files(input_file)) else: file_index = yaml.resolve_deps(*yaml.get_files(input_file)) + + # Sort the files - we need them to be in a stable order for some test generation + file_index_items = sorted(file_index.items(), key=lambda f: f[0]) + if verbose: print "Reading files..." pprint.pprint(file_index.keys()) @@ -102,7 +107,7 @@ def main(): else: spec_no = 0 all_specs = [] - for fname, spec in file_index.items(): + for fname, spec in file_index_items: spec_no = spec_no + 1 if test_mode: parsed = yaml.parse_test_spec(fname, spec, spec_no)
Sort spec files before generating code - this should prevent files from being reordered arbitrarily when Make is run on different machines
swift-nav_libsbp
train
py
d26bb58a9190166bfa81bb80c62b639e8b18f373
diff --git a/lib/roma/async_process.rb b/lib/roma/async_process.rb index <HASH>..<HASH> 100644 --- a/lib/roma/async_process.rb +++ b/lib/roma/async_process.rb @@ -749,6 +749,15 @@ module Roma if count>0 @log.info("#{__method__}:#{count} keys deleted.") end + + # delete @rttable.logs + if @stats.gui_run_gather_logs || @rttable.logs.empty? + false + else + gathered_time = @rttable.logs[0] + # delete gathering log data after 5min + @rttable.logs.clear if gathered_time.to_i < Time.now.to_i - (60 * 5) + end ensure @log.info("#{__method__}:stop") end @@ -962,7 +971,8 @@ module Roma } @rttable.logs = target_logs -# set expiration date + # set gathered date for expiration + @rttable.logs.unshift(Time.now) @log.debug("#{__method__} has done.") rescue =>e
add gathered date for expiration in clean_up process
roma_roma
train
rb
3889ba2be00308ea9012742bf3185b3bde7cc40b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ setuptools.setup( tests_require=tests_require, cmdclass=setup.get_cmdclass(), include_package_data=False, - packages=setuptools.find_packages('.'), + packages=setuptools.find_packages(exclude=['tests', 'tests.*']), package_data=PackageData, eager_resources=EagerResources, entry_points={
Exclude top level 'tests dir' from packages. In 8fbe6d we moved 'tests' to be top level. As such it makes since to now exclude it from quantumclient packages. Change-Id: I<I>b0bd4f<I>b<I>c<I>ff<I>b8e<I>cba<I>ce<I>a5
rackerlabs_rackspace-python-neutronclient
train
py
a58e3556b7bf254a95fefc54feadc9d06878944e
diff --git a/lib/ace/renderloop.js b/lib/ace/renderloop.js index <HASH>..<HASH> 100644 --- a/lib/ace/renderloop.js +++ b/lib/ace/renderloop.js @@ -37,7 +37,7 @@ define(function(require, exports, module) { -var event = require("ace/lib/event") +var event = require("ace/lib/event").event; var RenderLoop = function(onRender) { this.onRender = onRender;
fix path left behind due to changeset clash
joewalker_gcli
train
js
c485349eae2dd7754e87b33f8e5befb89b191a82
diff --git a/nfc/clf.py b/nfc/clf.py index <HASH>..<HASH> 100644 --- a/nfc/clf.py +++ b/nfc/clf.py @@ -549,7 +549,10 @@ class ContactlessFrontend(object): raise IOError(errno.ENODEV, os.strerror(errno.ENODEV)) with self.lock: - return self.dev.exchange(send_data, timeout) + log.debug(">>> %s %.3fs" % (str(send_data).encode("hex"), timeout)) + rcvd_data = self.dev.exchange(send_data, timeout) + log.debug("<<< %s" % str(rcvd_data).encode("hex")) + return rcvd_data def set_communication_mode(self, brm, **kwargs): """Set the hardware communication mode. The effect of calling
debug log tx/rx data in clf exchange method
nfcpy_nfcpy
train
py
beafa1c3761a6409ee5024d4a900c9d53bcb2ba3
diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index <HASH>..<HASH> 100644 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -567,6 +567,13 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu // Create status submitted event. $event = \mod_scorm\event\status_submitted::create($data); } + // Fix the missing track keys when the SCORM track record already exists, see $trackdata in datamodel.php. + // There, for performances reasons, columns are limited to: element, id, value, timemodified. + // Missing fields are: userid, scormid, scoid, attempt. + $track->userid = $userid; + $track->scormid = $scormid; + $track->scoid = $scoid; + $track->attempt = $attempt; // Trigger submitted event. $event->add_record_snapshot('scorm_scoes_track', $track); $event->add_record_snapshot('course_modules', $cm);
MDL-<I> mod_scorm: Fixed the missing keys when updating a record. Thanks to Rajesh Taneja for his testing.
moodle_moodle
train
php
42c2f306261a07e3107faae0f06cf6943b3638a3
diff --git a/lib/node.js b/lib/node.js index <HASH>..<HASH> 100644 --- a/lib/node.js +++ b/lib/node.js @@ -28,6 +28,7 @@ var node = module.exports = { } var txn = this._safeBatch(); var node = txn.save(obj); + if (obj[this.options.id] != null) node = txn.read(obj); txn.label(node, label); return this._safeBatchCommit(txn, function(err, result) { if (err) callback(err);
support updating nodes with a label. closes #<I>
brikteknologier_seraph
train
js
d6513c180add0e4cebfabc5f2d05c39112ce3bb6
diff --git a/sprinter/recipes/git.py b/sprinter/recipes/git.py index <HASH>..<HASH> 100644 --- a/sprinter/recipes/git.py +++ b/sprinter/recipes/git.py @@ -33,8 +33,8 @@ class GitRecipe(RecipeStandard): call("git pull origin %s" % (config['branch'] if 'branch' in config else 'master')) def __clone_repo(self, repo_url, target_directory, branch=None): - call("git clone %s %s" % (repo_url, target_directory)) + self.logger.info(call("git clone %s %s" % (repo_url, target_directory))) if branch: os.chdir(target_directory) - call("git fetch origin %s" % branch) - call("git checkout %s" % branch) + self.logger.info(call("git fetch origin %s" % branch)) + self.logger.info(call("git checkout %s" % branch))
making git recipe more verbose
toumorokoshi_sprinter
train
py
041a4970ceb8d3dd929ad7c628ddbf2190f4b81c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import setuptools setuptools.setup( name='brozzler', - version='1.1b3', + version='1.1b4.dev59', description='Distributed web crawling with browsers', url='https://github.com/internetarchive/brozzler', author='Noah Levitt',
back to a dev version number
internetarchive_brozzler
train
py
40b6a9ad81996672482745129e890bc83feb3c51
diff --git a/neurom/io/neurolucida.py b/neurom/io/neurolucida.py index <HASH>..<HASH> 100644 --- a/neurom/io/neurolucida.py +++ b/neurom/io/neurolucida.py @@ -88,7 +88,7 @@ def _get_tokens(morph_fd): Note: this also strips newlines and comments ''' - for line in morph_fd.readlines(): + for line in morph_fd: line = line.rstrip() # remove \r\n line = line.split(';', 1)[0] # strip comments squash_token = [] # quoted strings get squashed into one token @@ -263,7 +263,7 @@ def read(morph_file, data_wrapper=DataWrapper): warnings.warn(msg) L.warning(msg) - with open(morph_file) as morph_fd: + with open(morph_file, encoding='utf-8', errors='replace') as morph_fd: sections = _parse_sections(morph_fd) raw_data = _sections_to_raw_data(sections) return data_wrapper(raw_data, 'NL-ASCII')
Encoding error handling in NeuroLucida reader Use error='replace' when opening the file. This causes unknown bytes to be replaced by '?' instead of having the reader crashing
BlueBrain_NeuroM
train
py
ad6aac4f84d5e7b5bcfc2eed618dc3dbb81d5d79
diff --git a/python_modules/libraries/dagster-mysql/dagster_mysql/schedule_storage/schedule_storage.py b/python_modules/libraries/dagster-mysql/dagster_mysql/schedule_storage/schedule_storage.py index <HASH>..<HASH> 100644 --- a/python_modules/libraries/dagster-mysql/dagster_mysql/schedule_storage/schedule_storage.py +++ b/python_modules/libraries/dagster-mysql/dagster_mysql/schedule_storage/schedule_storage.py @@ -45,7 +45,7 @@ class MySQLScheduleStorage(SqlScheduleStorage, ConfigurableClass): ) table_names = retry_mysql_connection_fn(db.inspect(self._engine).get_table_names) - if "schedules" not in table_names or "jobs" not in table_names: + if "jobs" not in table_names: with self.connect() as conn: alembic_config = mysql_alembic_config(__file__) retry_mysql_creation_fn(lambda: ScheduleStorageSqlMetadata.create_all(conn))
[dagster-mysql] Fixing schedule storage stamp_alembic_rev error Summary: `stamp_alembic_rev` was erroring out when using `dagster-daemon run` since it was being called incorrectly.
dagster-io_dagster
train
py
980492cb76d0d72a005269a4fb9c1ec9767c10de
diff --git a/symfit/api.py b/symfit/api.py index <HASH>..<HASH> 100644 --- a/symfit/api.py +++ b/symfit/api.py @@ -3,7 +3,7 @@ import symfit.core.operators # Expose useful objects. from symfit.core.fit import ( - Fit, Model, Constraint, ODEModel, ModelError, CallableModel, + Fit, Model, ODEModel, ModelError, CallableModel, CallableNumericalModel, GradientModel ) from symfit.core.fit_results import FitResults
Remove Constraint objects from the API
tBuLi_symfit
train
py
00a428655149c349d29b9351dbc345a3b8025a58
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/inflector.rb +++ b/activesupport/lib/active_support/inflector.rb @@ -257,7 +257,7 @@ module ActiveSupport # <%= link_to(@person.name, person_path %> # # => <a href="/person/1-donald-e-knuth">Donald E. Knuth</a> def parameterize(string, sep = '-') - string.chars.normalize(:kd).to_s.gsub(/[^\x00-\x7F]+/, '').gsub(/[^a-z0-9_\-]+/i, sep).downcase + string.mb_chars.normalize(:kd).to_s.gsub(/[^\x00-\x7F]+/, '').gsub(/[^a-z0-9_\-]+/i, sep).downcase end # Create the name of a table like Rails does for models to table names. This method
Change call to String#chars in inflector to String#mb_chars.
rails_rails
train
rb
7579cba134f644b2623fa708c02bc4be114bc52c
diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -175,7 +175,7 @@ class Validator implements ValidatorContract * * @var array */ - protected $sizeRules = ['Size', 'Between', 'Min', 'Max', 'greater_than', 'less_than', 'greater_than_or_equal', 'less_than_or_equal']; + protected $sizeRules = ['Size', 'Between', 'Min', 'Max', 'GreaterThan', 'LessThan', 'GreaterThanOrEqual', 'LessThanOrEqual']; /** * The numeric related validation rules.
Fix rules declaration in numericRules array of the validator class
laravel_framework
train
php
2e94eee025b2f5a7db4532fd81d88ba5c5921b32
diff --git a/src/Plugin/Node/Config/routes.php b/src/Plugin/Node/Config/routes.php index <HASH>..<HASH> 100644 --- a/src/Plugin/Node/Config/routes.php +++ b/src/Plugin/Node/Config/routes.php @@ -33,7 +33,7 @@ if (!empty($node_types)) { } Router::connect( - '/search/:criteria/*', + '/find/:criteria/*', [ 'plugin' => 'node', 'controller' => 'serve',
site url "/search/*" is now "/find/*"
quickapps_cms
train
php
11c0c0a01aded34eaede9a222c31f6be2f5d6327
diff --git a/devices/ikea.js b/devices/ikea.js index <HASH>..<HASH> 100644 --- a/devices/ikea.js +++ b/devices/ikea.js @@ -194,10 +194,8 @@ module.exports = [ model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E14/E26/E27 600 lumen, dimmable, color, opal white', - extend: extend.light_onoff_brightness_color(), - ota: ota.tradfri, + extend: tradfriExtend.light_onoff_brightness_colortemp_color(), meta: {supportsHueAndSaturation: false}, - onEvent: bulbOnEvent, }, { zigbeeModel: ['TRADFRI bulb E26 CWS 800lm', 'TRADFRI bulb E27 CWS 806lm'],
Update LED<I>G9 to support white spectrum (#<I>) Product should support both color and white spectrum controls. Changed in ikea.js to reflect the change and remove code that became unnecessary, as it is included in tradfriExtend. Unsure about if the meta -> supportsHueAndSaturation line <I> is still required, as it is not on any other lamp and I am unsure of its purpose.
Koenkk_zigbee-shepherd-converters
train
js
05e8fe3f7116b100a2f1ed5f412a2d336c0419cb
diff --git a/resources/cca/ra/src/main/java/org/mobicents/slee/resource/diameter/cca/CreditControlMessageFactoryImpl.java b/resources/cca/ra/src/main/java/org/mobicents/slee/resource/diameter/cca/CreditControlMessageFactoryImpl.java index <HASH>..<HASH> 100644 --- a/resources/cca/ra/src/main/java/org/mobicents/slee/resource/diameter/cca/CreditControlMessageFactoryImpl.java +++ b/resources/cca/ra/src/main/java/org/mobicents/slee/resource/diameter/cca/CreditControlMessageFactoryImpl.java @@ -82,7 +82,7 @@ public class CreditControlMessageFactoryImpl implements CreditControlMessageFact // _ids.add(Avp.DESTINATION_REALM); //_ids.add(Avp.DESTINATION_HOST); //{ Auth-Application-Id } - _ids.add(Avp.AUTH_APPLICATION_ID); + //_ids.add(Avp.AUTH_APPLICATION_ID); //{ Service-Context-Id } _ids.add(CreditControlAVPCodes.Service_Context_Id); //{ CC-Request-Type }
change: - fix answer creation, it pushed two Auth-App-Id avps. git-svn-id: <URL>
RestComm_jdiameter
train
java
7f3d2e5c00413e1c124ea83adf553a03055ceb08
diff --git a/lib/mail_interceptor.rb b/lib/mail_interceptor.rb index <HASH>..<HASH> 100644 --- a/lib/mail_interceptor.rb +++ b/lib/mail_interceptor.rb @@ -52,11 +52,7 @@ module MailInterceptor end def forward_emails_to_empty? - if forward_emails_to.is_a? Array - forward_emails_to.reject(&:blank?).blank? - else - forward_emails_to.blank? - end + Array.wrap(forward_emails_to).reject(&:blank?).empty? end def production? diff --git a/test/mail_interceptor_test.rb b/test/mail_interceptor_test.rb index <HASH>..<HASH> 100644 --- a/test/mail_interceptor_test.rb +++ b/test/mail_interceptor_test.rb @@ -63,7 +63,7 @@ class MailInterceptorTest < Minitest::Test assert_equal "[wheel] Forgot password", @message.subject end - def test_error_if_foward_emails_to_is_empty + def test_error_if_forward_emails_to_is_empty message = "forward_emails_to should not be empty" exception = assert_raises(RuntimeError) do
Refactor 'forward_emails_to_empty?' and typo fix.
bigbinary_mail_interceptor
train
rb,rb
617fea23741b2d37c66493d1a409274cfd513ef1
diff --git a/astroplan/tests/test_constraints.py b/astroplan/tests/test_constraints.py index <HASH>..<HASH> 100644 --- a/astroplan/tests/test_constraints.py +++ b/astroplan/tests/test_constraints.py @@ -127,6 +127,8 @@ def test_compare_airmass_constraint_and_observer(): assert all(always_from_observer == always_from_constraint) +# xfail can be removed when #141 is finished and merged +@pytest.mark.xfail def test_sun_separation(): time = Time('2003-04-05 06:07:08') apo = Observer.at_site("APO")
temporarily xfail test_sun_separation() until #<I> is merged
astropy_astroplan
train
py
21af486f111f751b7737a0901d57d59969dd6b01
diff --git a/lib/avatax/configuration.rb b/lib/avatax/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/avatax/configuration.rb +++ b/lib/avatax/configuration.rb @@ -31,7 +31,7 @@ module AvaTax DEFAULT_LOGGER = false DEFAULT_PROXY = nil DEFAULT_FARADAY_RESPONSE = false - DEFAULT_RESPONSE_BIG_DECIMAL_CONVERSION = true + DEFAULT_RESPONSE_BIG_DECIMAL_CONVERSION = false attr_accessor *VALID_OPTIONS_KEYS
very little use case for big_decimal, change default to false
avadev_AvaTax-REST-V2-Ruby-SDK
train
rb
489bf5673dfc2b1fa3988a4f2222f9ed1df6c193
diff --git a/lib/pwf.js b/lib/pwf.js index <HASH>..<HASH> 100644 --- a/lib/pwf.js +++ b/lib/pwf.js @@ -951,17 +951,13 @@ */ var v = function() { - var allowed = true; + if (typeof console != 'undefined' && ((pwf.status('config') && pwf.config.get('debug.frontend')) || !pwf.status('config'))) { + var args = Array.prototype.slice.call(arguments); - if ((pwf.status('config') && pwf.config.get('debug.frontend')) || !pwf.status('config')) { - if (typeof console != 'undefined') { - var args = Array.prototype.slice.call(arguments); - - if (args.length > 1) { - console.log(args); - } else { - console.log(args[0]); - } + if (args.length > 1) { + console.log(args); + } else { + console.log(args[0]); } } };
Dump method v(), shorter form
just-paja_pwf.js
train
js
d40f9a91f7656fb259bd751f2c569e32ff1e85ce
diff --git a/openstack_dashboard/dashboards/admin/flavors/tables.py b/openstack_dashboard/dashboards/admin/flavors/tables.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/dashboards/admin/flavors/tables.py +++ b/openstack_dashboard/dashboards/admin/flavors/tables.py @@ -20,6 +20,7 @@ from django.core.urlresolvers import reverse from django.template import defaultfilters as filters from django.utils.http import urlencode from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ungettext_lazy from horizon import tables @@ -27,8 +28,21 @@ from openstack_dashboard import api class DeleteFlavor(tables.DeleteAction): - data_type_singular = _("Flavor") - data_type_plural = _("Flavors") + @staticmethod + def action_present(count): + return ungettext_lazy( + u"Delete Flavor", + u"Delete Flavors", + count + ) + + @staticmethod + def action_past(count): + return ungettext_lazy( + u"Deleted Flavor", + u"Deleted Flavors", + count + ) def delete(self, request, obj_id): api.nova.flavor_delete(request, obj_id)
Remove concatenation from Delete Flavors Fix concatenation and pluralization problems with the Delete Flavors action Change-Id: I<I>f0b6cf0e<I>dd<I>fae<I>e<I>c<I>be partial-bug: <I>
openstack_horizon
train
py
6c804a403cc94a72ab63a961dc276704cfff6f5c
diff --git a/lib/alchemy/essence.rb b/lib/alchemy/essence.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/essence.rb +++ b/lib/alchemy/essence.rb @@ -160,6 +160,7 @@ module Alchemy #:nodoc: if preview_text_method.blank? self.send(preview_text_column).to_s[0..maxlength] else + return "" if ingredient.blank? ingredient.send(preview_text_method).to_s[0..maxlength] end end
Returning empt string if ingredient from essence is nil in preview text
AlchemyCMS_alchemy_cms
train
rb
325eb6804a29727294d35c524b52c961f3fa1425
diff --git a/src/CatLab/CursorPagination/CursorPaginationBuilder.php b/src/CatLab/CursorPagination/CursorPaginationBuilder.php index <HASH>..<HASH> 100644 --- a/src/CatLab/CursorPagination/CursorPaginationBuilder.php +++ b/src/CatLab/CursorPagination/CursorPaginationBuilder.php @@ -369,8 +369,14 @@ class CursorPaginationBuilder implements PaginationBuilder * @param array $properties * @return PaginationBuilder */ - private function setFirst(array $properties) : PaginationBuilder + public function setFirst($properties) : PaginationBuilder { + if (!ArrayHelper::hasArrayAccess($properties)) { + throw new InvalidArgumentException( + "Could not read properties: properties must have ArrayAccess." + ); + } + $this->first = $properties; return $this; } @@ -379,8 +385,14 @@ class CursorPaginationBuilder implements PaginationBuilder * @param array $properties * @return PaginationBuilder */ - private function setLast(array $properties) : PaginationBuilder + public function setLast($properties) : PaginationBuilder { + if (!ArrayHelper::hasArrayAccess($properties)) { + throw new InvalidArgumentException( + "Could not read properties: properties must have ArrayAccess." + ); + } + $this->last = $properties; return $this; }
A few changes to the interfaces.
CatLabInteractive_cursor-pagination
train
php
194d5846913bffbf6c96ee9f28c4fe962da9fa97
diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -14,7 +14,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -import conu from click.testing import CliRunner from colin.cli.colin import check, list_checks, list_rulesets, info @@ -130,12 +129,9 @@ def test_info(): assert __version__ in output[0] assert "cli/colin.py" in output[1] - assert output[3].startswith("conu") - assert conu.version in output[3] - assert output[3].endswith("/conu") - assert output[4].startswith("podman") - assert output[5].startswith("skopeo") - assert output[6].startswith("ostree") + assert output[3].startswith("podman") + assert output[4].startswith("skopeo") + assert output[5].startswith("ostree") def test_env():
Fix conu in 'colin info' tests
user-cont_colin
train
py
29090933f5f5d85647f0a3053b1278d5cefbbdd6
diff --git a/dispatch/migrations/0100_publishable_constraints.py b/dispatch/migrations/0100_publishable_constraints.py index <HASH>..<HASH> 100644 --- a/dispatch/migrations/0100_publishable_constraints.py +++ b/dispatch/migrations/0100_publishable_constraints.py @@ -3,7 +3,7 @@ from django.db import migrations, models -from dispatch.models import Article, Page +from dispatch.models import Article, Page, Author def fix_latest_head(model, item): latest = model.objects. \ @@ -17,10 +17,14 @@ def fix_latest_head(model, item): latest.head = True latest.save(revision=False) - duplicates = model.objects. \ - filter(slug=item.slug). \ - exclude(parent=item.parent). \ - delete() + try: + duplicates = model.objects. \ + filter(slug=item.slug). \ + exclude(parent=item.parent). \ + delete() + except Exception as e: + print("Error encountered while trying to delete duplicates!\n") + print(e) def fix_latest_published(model, item): latest_items = model.objects. \
attempt workaround for buggy migration - exception
ubyssey_dispatch
train
py
7cca419538ebb87c689c0f8354c2a37c9f00d022
diff --git a/src/main/java/com/buschmais/jqassistant/scm/maven/ServerMojo.java b/src/main/java/com/buschmais/jqassistant/scm/maven/ServerMojo.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/buschmais/jqassistant/scm/maven/ServerMojo.java +++ b/src/main/java/com/buschmais/jqassistant/scm/maven/ServerMojo.java @@ -16,6 +16,8 @@ package com.buschmais.jqassistant.scm.maven; +import static edu.emory.mathcs.backport.java.util.Collections.emptyMap; + import java.io.IOException; import java.util.Set; @@ -37,7 +39,7 @@ public class ServerMojo extends AbstractAnalysisMojo { @Override protected void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException { - Server server = new DefaultServerImpl((EmbeddedGraphStore) store); + Server server = new DefaultServerImpl((EmbeddedGraphStore) store, getScannerPluginRepository(store, emptyMap()), getRulePluginRepository()); server.start(); getLog().info("Running server for module " + baseProject.getGroupId() + ":" + baseProject.getArtifactId() + ":" + baseProject.getVersion()); getLog().info("Press <Enter> to finish.");
allow injection of plugin repositories into server
buschmais_jqa-maven-plugin
train
java
def256f3ee6ac784ebac5c468d3bbd3035c85d3b
diff --git a/src/tagify.js b/src/tagify.js index <HASH>..<HASH> 100644 --- a/src/tagify.js +++ b/src/tagify.js @@ -16,7 +16,7 @@ function Tagify( input, settings ){ if( !input ){ console.warn('Tagify:', 'input element not found', input) // return an empty mock of all methods, so the code using tagify will not break - // because it might be calling methods even though the input element does not exists + // because it might be calling methods even though the input element does not exist const mockInstance = new Proxy(this, { get(){ return () => mockInstance } }) return mockInstance }
Fixing typo (#<I>)
yairEO_tagify
train
js
5653d28c23fbdc25f125986be824437407092445
diff --git a/ui/app/components/job-dispatch.js b/ui/app/components/job-dispatch.js index <HASH>..<HASH> 100644 --- a/ui/app/components/job-dispatch.js +++ b/ui/app/components/job-dispatch.js @@ -54,7 +54,7 @@ export default class JobDispatch extends Component { name: x, required, title: titleCase(noCase(x)), - value: this.args.job.meta ? this.args.job.meta[x] : '', + value: this.args.job.meta ? this.args.job.meta.get(x) : '', }) );
ui: use `get` to access job meta value (#<I>)
hashicorp_nomad
train
js
a3103577937c355a39bc736f7fecb765487e309f
diff --git a/network/tls_wrapper.go b/network/tls_wrapper.go index <HASH>..<HASH> 100644 --- a/network/tls_wrapper.go +++ b/network/tls_wrapper.go @@ -62,6 +62,10 @@ func RegisterTLSBaseArgs(){ flag.StringVar(&tlsKey,"tls_key", "", "Path to private key that will be used for TLS connections") flag.StringVar(&tlsCert,"tls_cert", "", "Path to certificate") flag.IntVar(&tlsAuthType,"tls_auth", int(tls.RequireAndVerifyClientCert), "Set authentication mode that will be used in TLS connection. Values in range 0-4 that set auth type (https://golang.org/pkg/crypto/tls/#ClientAuthType). Default is tls.RequireAndVerifyClientCert") +} + +// RegisterTLSClientArgs register CLI args tls_server_sni used by TLS client's connection +func RegisterTLSClientArgs(){ flag.StringVar(&tlsServerName, "tls_server_sni", "", "Server name used as sni value") }
separate client's tls args from base
cossacklabs_acra
train
go
4a3e1574bfc545bbdc967eab61a3dbdc174ecf22
diff --git a/tests/Common/ComponentsPublishTest.php b/tests/Common/ComponentsPublishTest.php index <HASH>..<HASH> 100644 --- a/tests/Common/ComponentsPublishTest.php +++ b/tests/Common/ComponentsPublishTest.php @@ -25,6 +25,18 @@ class ComponentsPublishTest extends StorageApiTestCase $components->deleteConfiguration($component['id'], $configuration['id']); } } + + // erase all deleted configurations + $index = $this->_client->indexAction(); + foreach ($index['components'] as $component) { + $listOptions = new ListComponentConfigurationsOptions(); + $listOptions->setComponentId($component['id']); + $listOptions->setIsDeleted(true); + + foreach ($components->listComponentConfigurations($listOptions) as $configuration) { + $components->deleteConfiguration($component['id'], $configuration['id']); + } + } } public function testConfigurationPublish()
fix tests - delete deleted configurations
keboola_storage-api-php-client
train
php
438274cb6f48a5838b9b96bae6d416f935ed7e63
diff --git a/examples/index.php b/examples/index.php index <HASH>..<HASH> 100644 --- a/examples/index.php +++ b/examples/index.php @@ -6,4 +6,7 @@ $forecastPhp = new \Nwidart\ForecastPhp\Forecast('3da43a66de8ca36593e0f44324f496 $info = $forecastPhp->get('40.7324296', '-73.9977264'); +// Fetch weather at a given time +// $info = $forecastPhp->get('40.7324296', '-73.9977264', '2013-05-06T12:00:00-0400'); + var_dump($info);
Adding example for a given time
nWidart_forecast-php
train
php
165765db3fd9951262e85376f20fe1e35f6cc25d
diff --git a/packages/react-dev-utils/printHostingInstructions.js b/packages/react-dev-utils/printHostingInstructions.js index <HASH>..<HASH> 100644 --- a/packages/react-dev-utils/printHostingInstructions.js +++ b/packages/react-dev-utils/printHostingInstructions.js @@ -39,7 +39,7 @@ function printHostingInstructions( console.log(); console.log('Find out more about deployment here:'); console.log(); - console.log(` ${chalk.yellow('https://bit.ly/CRA-deploy')}`); + console.log(` ${chalk.yellow('https://create-react-app.dev/docs/deployment')}`); console.log(); }
chore: Fix broken link for CRA deployment (#<I>)
facebook_create-react-app
train
js
f0fb1fc197d2b8650af6f0896ce5564b2d64e357
diff --git a/src/HttpController.php b/src/HttpController.php index <HASH>..<HASH> 100644 --- a/src/HttpController.php +++ b/src/HttpController.php @@ -7,6 +7,7 @@ use Zend\Diactoros\ServerRequest; use Zend\Diactoros\ServerRequestFactory; use Psr\Http\Message\ResponseInterface; use Zend\Diactoros\Response\SapiEmitter; +use Zend\Diactoros\Response\EmptyResponse; use League\Pipeline\Pipeline; use League\Pipeline\PipelineBuilder; use Exception; @@ -35,8 +36,11 @@ class HttpController public function run() { $this->pipeline->build() - ->pipe(new Stage(function (ResponseInterface $response) { + ->pipe(new Stage(function (ResponseInterface $response = null) { $emitter = new SapiEmitter; + if (is_null($response)) { + $response = new EmptyResponse(404); + } return $emitter->emit($response); })) ->process(ServerRequestFactory::fromGlobals());
if this ends up with null, emit a <I> instead of erroring out
monolyth-php_frontal
train
php
d200dbc8e456d2e778455240819f9bb0ef0f40db
diff --git a/src/toil/worker.py b/src/toil/worker.py index <HASH>..<HASH> 100644 --- a/src/toil/worker.py +++ b/src/toil/worker.py @@ -147,7 +147,7 @@ def workerScript(jobStore, config, jobName, jobStoreID, redirectOutputToLogFile= except OSError: pass # Exit without doing any of Toil's cleanup - os._exit() + os._exit(0) # We don't need to reap the child. Either it kills us, or we finish # before it does. Either way, init will have to clean it up for us.
Send an argument to exit, as it is required
DataBiosphere_toil
train
py
ecfb5b5402a7b5cb9a616a4a59da459ba93d239d
diff --git a/export.js b/export.js index <HASH>..<HASH> 100644 --- a/export.js +++ b/export.js @@ -25,7 +25,9 @@ function commonExportTests(exportFn, expectedFn, expectedErrorsFn) { let _specs; let checkExpected = function(expected) { expect(exportFn(_specs)).to.eql(expected.result); - expect(err.errors().length).to.equal(expected.errors.length); + if (err.errors().length !== expected.errors.length) { + expect(err.errors()).to.deep.equal(expected.errors); + } for (let i=0; i < expected.errors.length; i++) { const expErr = expected.errors[i]; const actErr = err.errors()[i];
Incorrect error messages are now displayed.
standardhealth_shr-test-helpers
train
js
7aae7aa9f5f6465806148c31111318595a9f8722
diff --git a/Test/Case/AllRatchetTestsTest.php b/Test/Case/AllRatchetTestsTest.php index <HASH>..<HASH> 100644 --- a/Test/Case/AllRatchetTestsTest.php +++ b/Test/Case/AllRatchetTestsTest.php @@ -13,6 +13,9 @@ CakePlugin::loadAll(array( 'AssetCompress' => array( 'bootstrap' => true ), + 'Ratchet' => array( + 'bootstrap' => true + ), )); class AllRatchetTestsTest extends PHPUnit_Framework_TestSuite {
The bootstrap for Ratchet also has to be loaded before the test can run as it depends on configuration values from bootstrap.php
WyriHaximus_Ratchet
train
php
1e9f4c98e3d7a7988a89bb5b4da15b499e0717fb
diff --git a/cache/classes/loaders.php b/cache/classes/loaders.php index <HASH>..<HASH> 100644 --- a/cache/classes/loaders.php +++ b/cache/classes/loaders.php @@ -647,10 +647,11 @@ class cache implements cache_loader { $this->static_acceleration_set($data[$key]['key'], $value); } } - if ($this->perfdebug) { - cache_helper::record_cache_set($this->storetype, $this->definition->get_id()); + $successfullyset = $this->store->set_many($data); + if ($this->perfdebug && $successfullyset) { + cache_helper::record_cache_set($this->storetype, $this->definition->get_id(), $successfullyset); } - return $this->store->set_many($data); + return $successfullyset; } /** @@ -2037,10 +2038,11 @@ class cache_session extends cache { 'value' => $value ); } - if ($this->perfdebug) { - cache_helper::record_cache_set($this->storetype, $definitionid); + $successfullyset = $this->get_store()->set_many($data); + if ($this->perfdebug && $successfullyset) { + cache_helper::record_cache_set($this->storetype, $definitionid, $successfullyset); } - return $this->get_store()->set_many($data); + return $successfullyset; } /**
MDL-<I> cache: added stats logging to set_many methods
moodle_moodle
train
php
aef3d295fd6be70e905ed4605701662eb0f90991
diff --git a/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java b/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java +++ b/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java @@ -547,11 +547,29 @@ public abstract class NeighbourhoodSearch<SolutionType extends Solution> extends } /** + * Increase the number of accepted moves with the given value. + * + * @param inc value with which the number of accepted moves is increased + */ + protected void incNumAcceptedMoves(long inc){ + numAcceptedMoves += inc; + } + + /** * Indicate that a move was rejected. This method only updates the rejected move counter. If this method * is called for every rejected move, the number of rejected moves will be correctly reported. */ protected void rejectMove(){ - numRejectedMoves++; + incNumRejectedMoves(1); + } + + /** + * Increase the number of rejected moves with the given value. + * + * @param inc value with which the number of rejected moves is increased + */ + protected void incNumRejectedMoves(long inc){ + numRejectedMoves += inc; } }
added inc methods from accepted/rejected moves
hdbeukel_james-core
train
java
0180119c69f8f3945c96c5f0e1efb92252c6d170
diff --git a/scripts/dts.js b/scripts/dts.js index <HASH>..<HASH> 100644 --- a/scripts/dts.js +++ b/scripts/dts.js @@ -20,8 +20,7 @@ let result = [ ` * Licensed under the MIT License. See License.txt in the project root for license information.`, ` *--------------------------------------------------------------------------------------------*/`, ``, - `declare namespace monaco.languages.json {`, - `` + `declare namespace monaco.languages.json {` ]; for (let line of lines) { if (/^import/.test(line)) { @@ -31,8 +30,8 @@ for (let line of lines) { line = line.replace(/export declare/g, 'export'); if (line.length > 0) { line = `\t${line}`; + result.push(line); } - result.push(line); } result.push(`}`); result.push(``);
Avoid having diffs in `monaco.d.ts`
Microsoft_monaco-json
train
js
683aae7aa402ef13c394aa33ad13faf0df9be3df
diff --git a/trezor_agent/gpg/encode.py b/trezor_agent/gpg/encode.py index <HASH>..<HASH> 100644 --- a/trezor_agent/gpg/encode.py +++ b/trezor_agent/gpg/encode.py @@ -249,6 +249,7 @@ def _make_signature(signer_func, data_to_sign, public_algo, log.debug('hashing %d bytes', len(data_to_hash)) digest = hashlib.sha256(data_to_hash).digest() + log.info('SHA256 digest to sign: %s', util.hexlify(digest)) sig = signer_func(digest=digest) return bytes(header + hashed + unhashed +
gpg: add logging for digest
romanz_trezor-agent
train
py