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 |
|---|---|---|---|---|---|
ffe7ab4d54cf01f4caa3ab07e92cf0e21408d048 | diff --git a/varcode/variant_collection.py b/varcode/variant_collection.py
index <HASH>..<HASH> 100644
--- a/varcode/variant_collection.py
+++ b/varcode/variant_collection.py
@@ -253,3 +253,25 @@ class VariantCollection(Collection):
self.__class__ == other.__class__ and
len(self) == len(other) and
all(x.exactly_equal(y) for (x, y) in zip(self, other)))
+
+ @classmethod
+ def union(cls, variant_collections, merge_metadata=True):
+ """
+ Returns the union of variants in a several VariantCollection objects.
+
+ By default the metadata dictionaries are merged by mapping each variant
+ to a list of tuples, where the first element is a VariantCollection's
+ path and the second element is its associated metadata.
+ """
+ pass
+
+ @classmethod
+ def intersection(cls, variant_collections, merge_metadata=True):
+ """
+ Returns the intersection of variants in several VariantCollection objects.
+
+ By default the metadata dictionaries are merged by mapping each variant
+ to a list of tuples, where the first element is a VariantCollection's
+ path and the second element is its associated metadata.
+ """
+ pass | added union and intersection method skeletons | openvax_varcode | train | py |
3032b5ffe0970fb91606acb6f9fb701ce8c15f6a | diff --git a/angr/project.py b/angr/project.py
index <HASH>..<HASH> 100644
--- a/angr/project.py
+++ b/angr/project.py
@@ -444,8 +444,21 @@ class Project(object):
if type(symbol_name) not in (int, long):
sym = self.loader.find_symbol(symbol_name)
if sym is None:
- l.error("Could not find symbol %s", symbol_name)
- return None
+ # it could be a previously unresolved weak symbol..?
+ new_sym = None
+ for reloc in self.loader.find_relevant_relocations(symbol_name):
+ if not reloc.symbol.is_weak:
+ raise Exception("Symbol is strong but we couldn't find its resolution? Report to @rhelmot.")
+ if new_sym is None:
+ new_sym = self.loader.extern_object.make_extern(symbol_name)
+ reloc.resolve(new_sym)
+ reloc.relocate([])
+
+ if new_sym is None:
+ l.error("Could not find symbol %s", symbol_name)
+ return None
+ sym = new_sym
+
basic_addr = sym.rebased_addr
else:
basic_addr = symbol_name | Make hook_symbol work correctly when the symbol is weak and auto_load_libs=False | angr_angr | train | py |
7be4380ed52d483ba4eb6110783e1e34d59a0fbe | diff --git a/daemon/pod.go b/daemon/pod.go
index <HASH>..<HASH> 100644
--- a/daemon/pod.go
+++ b/daemon/pod.go
@@ -489,7 +489,7 @@ func (p *Pod) PrepareServices() error {
then this container won't be set as the file from hosts. Then a user can specify the content
of the file.
- */
+*/
func (p *Pod) PrepareDNS() (err error) {
err = nil
var ( | fix comments format, caused by #<I> | hyperhq_hyperd | train | go |
8a1007b6b3dfa428314e0a172e9f73eca3cc316a | diff --git a/core/server/master/src/main/java/alluxio/master/file/LostFileDetector.java b/core/server/master/src/main/java/alluxio/master/file/LostFileDetector.java
index <HASH>..<HASH> 100644
--- a/core/server/master/src/main/java/alluxio/master/file/LostFileDetector.java
+++ b/core/server/master/src/main/java/alluxio/master/file/LostFileDetector.java
@@ -51,7 +51,7 @@ final class LostFileDetector implements HeartbeatExecutor {
inode.setPersistenceState(PersistenceState.LOST);
}
} catch (FileDoesNotExistException e) {
- LOG.error("Exception trying to get inode from inode tree", e);
+ LOG.warn("Exception trying to get inode from inode tree", e);
}
}
} | Downgraded log level to warning when a lost file does not exist | Alluxio_alluxio | train | java |
cc04c7f446d055270e72a59ee06dfb1ba27b6d5b | diff --git a/lib/fog/openstack/requests/image/list_public_images_detailed.rb b/lib/fog/openstack/requests/image/list_public_images_detailed.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/openstack/requests/image/list_public_images_detailed.rb
+++ b/lib/fog/openstack/requests/image/list_public_images_detailed.rb
@@ -3,16 +3,18 @@ module Fog
class OpenStack
class Real
def list_public_images_detailed(attribute=nil, query=nil)
+ path = 'images/detail'
if attribute
- path = "images/detail?#{attribute}=#{URI::encode(query)}"
+ query = { attribute => URI::encode(query) }
else
- path = 'images/detail'
+ query = {}
end
request(
:expects => [200, 204],
:method => 'GET',
- :path => path
+ :path => path,
+ :query => query
)
end
end # class Real
@@ -23,8 +25,8 @@ module Fog
response.status = [200, 204][rand(1)]
response.body = {'images' => self.data[:images].values}
response
- end # def list_tenants
+ end # def list_public_images_detailed
end # class Mock
end # class OpenStack
- end # module Identity
+ end # module Image
end # module Fog | Fix path with contained query
Query inside path is not allowed, it should be under
separate key :query.
Putting query inside path leads to error:
URI::InvalidComponentError Exception: bad
component(expected absolute path component):
/<I>/images/detail?limit=<I>
Caused most probably by this comparison:
URI::parser.regexp[:ABS_PATH] !~ v | fog_fog | train | rb |
6bfcd0d471f6399e06e5342972d062705fd98b5b | diff --git a/cherrypy/config.py b/cherrypy/config.py
index <HASH>..<HASH> 100644
--- a/cherrypy/config.py
+++ b/cherrypy/config.py
@@ -152,7 +152,7 @@ def getAll(key):
for n in xrange(1, len(pathList)):
path = '/'.join(pathList[0:n+1])
try:
- results.append(path, configMap[path][key])
+ results.append((path, configMap[path][key]))
except KeyError:
pass | config.getAll was broken ... | cherrypy_cheroot | train | py |
90e201ee15ef5f1930e782e3361876907b4721ae | diff --git a/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java b/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java
index <HASH>..<HASH> 100644
--- a/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java
+++ b/okdownload/src/main/java/com/liulishuo/okdownload/core/breakpoint/BreakpointStoreOnCache.java
@@ -75,7 +75,7 @@ public class BreakpointStoreOnCache implements BreakpointStore {
BreakpointInfo newInfo = new BreakpointInfo(id, task.getUrl(), task.getParentPath(),
task.getFilename());
- synchronized (this){
+ synchronized (this) {
storedInfos.put(id, newInfo);
unStoredTasks.remove(id);
}
@@ -117,7 +117,7 @@ public class BreakpointStoreOnCache implements BreakpointStore {
@Override
public void onTaskEnd(int id, @NonNull EndCause cause, @Nullable Exception exception) {
if (cause == EndCause.COMPLETED) {
- synchronized (this){
+ synchronized (this) {
storedInfos.remove(id);
if (unStoredTasks.get(id) == null) sortedOccupiedIds.remove(Integer.valueOf(id));
} | chore: fix style check issue on store-on-cache | lingochamp_okdownload | train | java |
b258ade544a0f6857297c8d1930fe560019ffa3b | diff --git a/threads/src/main/java/org/jboss/as/threads/ThreadFactoryAdd.java b/threads/src/main/java/org/jboss/as/threads/ThreadFactoryAdd.java
index <HASH>..<HASH> 100644
--- a/threads/src/main/java/org/jboss/as/threads/ThreadFactoryAdd.java
+++ b/threads/src/main/java/org/jboss/as/threads/ThreadFactoryAdd.java
@@ -115,7 +115,6 @@ public class ThreadFactoryAdd extends AbstractAddStepHandler implements Descript
*/
@Override
public ModelNode getModelDescription(Locale locale) {
- System.out.println("ThreadFactoryAdd.getModelDescription");
return ThreadsSubsystemProviders.ADD_THREAD_FACTORY_DESC.getModelDescription(locale);
} | removed mistakenly introduced System.out.println | wildfly_wildfly | train | java |
1992b6b636defedbface2c52cfd0f9285238a636 | diff --git a/server/src/main/java/com/orientechnologies/orient/server/OServer.java b/server/src/main/java/com/orientechnologies/orient/server/OServer.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/com/orientechnologies/orient/server/OServer.java
+++ b/server/src/main/java/com/orientechnologies/orient/server/OServer.java
@@ -363,7 +363,7 @@ public class OServer {
return;
String type;
- for (OServerStorageConfiguration stg : OServerMain.server().getConfiguration().storages)
+ for (OServerStorageConfiguration stg : configuration.storages)
if (stg.loadOnStartup) {
// @COMPATIBILITY
if (stg.userName == null) | Fixed bug on server cfg loading reported in ML by Gail | orientechnologies_orientdb | train | java |
cb83d892751c856a99a570b9ac261a187691a84b | diff --git a/ollie/src/main/java/ollie/Model.java b/ollie/src/main/java/ollie/Model.java
index <HASH>..<HASH> 100644
--- a/ollie/src/main/java/ollie/Model.java
+++ b/ollie/src/main/java/ollie/Model.java
@@ -23,46 +23,22 @@ public abstract class Model {
}
public final void load(Cursor cursor) {
- beforeLoad();
Ollie.load(this, cursor);
Ollie.putEntity(this);
- afterLoad();
}
public final Long save() {
- beforeSave();
id = Ollie.save(this);
Ollie.putEntity(this);
notifyChange();
- afterSave();
return id;
}
public final void delete() {
- beforeDelete();
Ollie.delete(this);
Ollie.removeEntity(this);
notifyChange();
id = null;
- afterDelete();
- }
-
- protected void beforeLoad() {
- }
-
- protected void afterLoad() {
- }
-
- protected void beforeSave() {
- }
-
- protected void afterSave() {
- }
-
- protected void beforeDelete() {
- }
-
- protected void afterDelete() {
}
private void notifyChange() { | Remove model callbacks for now. | pardom-zz_Ollie | train | java |
e8cfc501a0740d58b400b9658ecec00e6e159720 | diff --git a/system/Router/Router.php b/system/Router/Router.php
index <HASH>..<HASH> 100644
--- a/system/Router/Router.php
+++ b/system/Router/Router.php
@@ -369,7 +369,9 @@ class Router implements RouterInterface
// assign it to the Request.
if (isset($localeSegment))
{
- $this->detectedLocale = (explode('/', $uri))[$localeSegment];
+ // The following may be inefficient, but doesn't upset NetBeans :-/
+ $temp = (explode('/', $uri));
+ $this->detectedLocale = $temp[$localeSegment];
unset($localeSegment);
} | Silly fix to make NetBeans happy | codeigniter4_CodeIgniter4 | train | php |
5d30b30aa32684599289e6d10b5095ef0eac0d2b | diff --git a/packages/aragon-client/src/index.js b/packages/aragon-client/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/aragon-client/src/index.js
+++ b/packages/aragon-client/src/index.js
@@ -209,3 +209,6 @@ export default class AragonApp {
)
}
}
+
+// Re-export the Aragon RPC providers
+export { providers } from '@aragon/messenger' | Client: re-export providers from messenger | aragon_aragon.js | train | js |
fae52f2541715847ece0acbb9e1c0d02e15e0ec1 | diff --git a/lib/AV.js b/lib/AV.js
index <HASH>..<HASH> 100644
--- a/lib/AV.js
+++ b/lib/AV.js
@@ -635,7 +635,7 @@ Foscam.prototype.snapPicture = function() {
* @returns {Promise<Object>} A promise to the response. jpeg image data directly.
*/
Foscam.prototype.snapPicture2 = function() {
- return this.getRaw(this.url, {qs: {cmd: 'snapPicture2'}});
+ return this.get('snapPicture2');
};
/**
diff --git a/test/AV.spec.js b/test/AV.spec.js
index <HASH>..<HASH> 100644
--- a/test/AV.spec.js
+++ b/test/AV.spec.js
@@ -282,7 +282,7 @@ describe('Foscam: AV', function() {
it('snapPicture2', function() {
cam.snapPicture2();
- assertCalledWith(cam.getRaw, cam.url, {qs: {cmd: 'snapPicture2'}});
+ assertCalledWith(cam.get, 'snapPicture2');
});
describe('config', function() { | snapPicture2 should call this.get instead of this.getRaw, in order to return the raw JPEG data | lightswitch05_foscam-client | train | js,js |
0d02cd2c35c8c08f39096d671ad7853832be5702 | diff --git a/gromacs/setup.py b/gromacs/setup.py
index <HASH>..<HASH> 100644
--- a/gromacs/setup.py
+++ b/gromacs/setup.py
@@ -94,7 +94,6 @@ The following functions are provided for the user:
Helper functions (mainly of use to developers):
.. autofunction:: make_main_index
-.. autofunction:: trj_compact_main
.. autofunction:: add_mdp_includes
.. autofunction:: _setup_MD | fixed: cannot have gomacs command autofunction
git-svn-id: svn+ssh://gonzo.med.jhmi.edu/scratch/svn/woolf_repository/users/oliver/Library/GromacsWrapper@<I> df5ba8eb-4b0b-<I>-8c<I>-c<I>f<I>b<I>c | Becksteinlab_GromacsWrapper | train | py |
d0419a5f6827ca5ec4b5a24d63c03f34f50431e0 | diff --git a/visidata/loaders/http.py b/visidata/loaders/http.py
index <HASH>..<HASH> 100644
--- a/visidata/loaders/http.py
+++ b/visidata/loaders/http.py
@@ -9,7 +9,7 @@ class HttpPath(PathFd):
def __init__(self, url, req):
from urllib.parse import urlparse
obj = urlparse(url)
- super().__init__(obj.path, req)
+ super().__init__(url, req)
self.req = req | [HttpPath] stringify as whole url | saulpw_visidata | train | py |
4860ccea42412297c0bc8dbaea06a4d6add9368b | diff --git a/modules/citrus-core/src/main/java/com/consol/citrus/server/AbstractServer.java b/modules/citrus-core/src/main/java/com/consol/citrus/server/AbstractServer.java
index <HASH>..<HASH> 100644
--- a/modules/citrus-core/src/main/java/com/consol/citrus/server/AbstractServer.java
+++ b/modules/citrus-core/src/main/java/com/consol/citrus/server/AbstractServer.java
@@ -49,7 +49,7 @@ public abstract class AbstractServer extends AbstractEndpoint implements Server,
private Thread thread;
/** Monitor for startup and running lifecycle */
- private Object runningLock = new Object();
+ private final Object runningLock = new Object();
/** Spring bean factory injected */
private BeanFactory beanFactory; | Synchronized lock object should be final | citrusframework_citrus | train | java |
2ffd5c3591ef49c2411ee4442e6e6a79cdf4b032 | diff --git a/lib/simpletest/testnavigationlib.php b/lib/simpletest/testnavigationlib.php
index <HASH>..<HASH> 100644
--- a/lib/simpletest/testnavigationlib.php
+++ b/lib/simpletest/testnavigationlib.php
@@ -692,6 +692,7 @@ class limited_global_navigation_test extends UnitTestCase {
$this->assertEqual($node1->get('initcall')->text, 'load_for_activity_1');
}
+ /* Disabled as there is a context check occuring
$node2 = clone($this->mocknode);
$fakecontext = new stdClass;
$this->cache->coursecontext2 = $fakecontext;
@@ -700,6 +701,7 @@ class limited_global_navigation_test extends UnitTestCase {
if ($node2->get('initcall')) {
$this->assertEqual($node2->get('initcall')->text, 'load_for_category_2');
}
+ */
$node3 = clone($this->mocknode);
$node3->initialise(navigation_node::TYPE_COURSE, 3); | navigation MDL-<I> Fixed notificiation regarding missing context during simpletest | moodle_moodle | train | php |
9de6ebd3a8edb4979e2373b741b21108017df190 | diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/models/page_spec.rb
+++ b/spec/models/page_spec.rb
@@ -994,6 +994,7 @@ module Alchemy
end
describe '#get_language_root' do
+ before { language_root }
subject { public_page.get_language_root }
it "returns the language root page" do | Reference :language_root before trying to create a :public_page
Otherwise, AR barfs because of the language_root page being already
there. | AlchemyCMS_alchemy_cms | train | rb |
a4baaaf6c29b8da4f3d9026552719039d2600ca9 | diff --git a/scanpy/tools/rank_genes_groups.py b/scanpy/tools/rank_genes_groups.py
index <HASH>..<HASH> 100644
--- a/scanpy/tools/rank_genes_groups.py
+++ b/scanpy/tools/rank_genes_groups.py
@@ -87,7 +87,10 @@ def rank_genes_groups(
adata.uns['rank_genes_groups_params'] = np.array(
(group_by, reference, test_type, use_raw),
dtype=[('group_by', 'U50'), ('reference', 'U50'), ('test_type', 'U50'), ('use_raw', np.bool_)])
-
+
+ # adata_comp mocks an AnnData object if use_raw is True
+ # otherwise it's just the AnnData object
+ adata_comp = adata
if adata.raw is not None and use_raw:
adata_comp = adata.raw
X = adata_comp.X | fixed bug in rank_genes_groups | theislab_scanpy | train | py |
f1583a8977f8ac4f72ebe92a90ac9843211c4153 | diff --git a/openaps/reports/show.py b/openaps/reports/show.py
index <HASH>..<HASH> 100644
--- a/openaps/reports/show.py
+++ b/openaps/reports/show.py
@@ -35,7 +35,7 @@ class Formatter (object):
found = config.get(act.dest)
if type(act) is argparse._StoreFalseAction:
expected = True
- found = not found
+ found = found
if expected != found:
params.append(act.option_strings[0]) | blargh try fixing yet again | openaps_openaps | train | py |
7c68668e4ebfd2d41fc7706dad90507b262d20d6 | diff --git a/contrib/externs/chrome_extensions.js b/contrib/externs/chrome_extensions.js
index <HASH>..<HASH> 100644
--- a/contrib/externs/chrome_extensions.js
+++ b/contrib/externs/chrome_extensions.js
@@ -2709,7 +2709,7 @@ chrome.tabs.move = function(tabId, moveProperties, opt_callback) {};
* highlighted: (boolean|undefined),
* currentWindow: (boolean|undefined),
* lastFocusedWindow: (boolean|undefined),
- * status: (!chrome.tabs.TabStatus|undefined),
+ * status: (!chrome.tabs.TabStatus|string|undefined),
* title: (string|undefined),
* url: (!Array<string>|string|undefined),
* windowId: (number|undefined), | Add the possibility that the param status in QueryInfo be a string.
-------------
Created by MOE: <URL> | google_closure-compiler | train | js |
30664e9054f6f9641933dd6c16bd0e27bb28e0b7 | diff --git a/library/Bootstrap/UnitBootstrap.php b/library/Bootstrap/UnitBootstrap.php
index <HASH>..<HASH> 100755
--- a/library/Bootstrap/UnitBootstrap.php
+++ b/library/Bootstrap/UnitBootstrap.php
@@ -76,7 +76,7 @@ namespace {
function getShopBasePath()
{
$shopDirectory = OX_BASE_PATH;
- if (class_exists('oxConfig', false)) {
+ if (class_exists('oxConfig', false) && class_exists('oxDb', false)) {
$configShopDir = \oxRegistry::getConfig()->getConfigParam('sShopDir');
$shopDirectory = $configShopDir ? $configShopDir : $shopDirectory;
} | Check if oxDb is already loaded
Allow overwriting of sShopDir only when oxConfig class is loaded in getShopBasePath, otherwise it can cause troubles with pure unit tests.
(cherry picked from commit 1d7c8d4) | OXID-eSales_testing_library | train | php |
202a2db3cff9c7080cbc24e90074f97f180fe020 | diff --git a/chalice/deployer.py b/chalice/deployer.py
index <HASH>..<HASH> 100644
--- a/chalice/deployer.py
+++ b/chalice/deployer.py
@@ -445,10 +445,10 @@ class LambdaDeploymentPackager(object):
p.communicate()
python_dir = os.listdir(os.path.join(venv_dir, 'lib'))[0]
if os.name == 'nt':
+ deps_dir = os.path.join(venv_dir, 'Lib', 'site-packages')
+ else:
deps_dir = os.path.join(venv_dir, 'lib', python_dir,
'site-packages')
- else:
- deps_dir = os.path.join(venv_dir, 'Lib', 'site-packages')
assert os.path.isdir(deps_dir)
# Now we need to create a zip file and add in the site-packages
# dir first, followed by the app_dir contents next. | Mistake, the order of if-else was incorrect. | aws_chalice | train | py |
0dbdc35a95e2da54782d3a08d11e127c03dc3e85 | diff --git a/js/dsx.js b/js/dsx.js
index <HASH>..<HASH> 100644
--- a/js/dsx.js
+++ b/js/dsx.js
@@ -113,6 +113,9 @@ module.exports = class dsx extends liqui {
let symbol = undefined;
if (market)
symbol = market['symbol'];
+ let average = this.safeFloat (ticker, 'avg');
+ if (typeof average !== 'undefined')
+ average = 1 / average;
return {
'symbol': symbol,
'timestamp': timestamp,
@@ -128,7 +131,7 @@ module.exports = class dsx extends liqui {
'last': this.safeFloat (ticker, 'last'),
'change': undefined,
'percentage': undefined,
- 'average': 1 / this.safeFloat (ticker, 'avg'),
+ 'average': average,
'baseVolume': this.safeFloat (ticker, 'vol'),
'quoteVolume': this.safeFloat (ticker, 'vol_cur'),
'info': ticker, | proper fix to dsx for zero division #<I> | ccxt_ccxt | train | js |
f4aec4afca0376e67b768c55b9aae6043510681f | diff --git a/lib/tml/version.rb b/lib/tml/version.rb
index <HASH>..<HASH> 100644
--- a/lib/tml/version.rb
+++ b/lib/tml/version.rb
@@ -31,7 +31,7 @@
#++
module Tml
- VERSION = '5.2.6'
+ VERSION = '5.2.7'
def self.full_version
"tml-ruby v#{Tml::VERSION} (Faraday v#{Faraday::VERSION})" | Updated version to <I> | translationexchange_tml-ruby | train | rb |
cdc83bc43a9e8398c05e586457e818c0305ebcfa | diff --git a/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java b/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java
+++ b/core/src/main/java/org/infinispan/persistence/manager/PersistenceManagerImpl.java
@@ -359,7 +359,6 @@ public class PersistenceManagerImpl implements PersistenceManager {
public void purgeExpired() {
if (!enabled)
return;
-
long start = -1;
try {
if (trace) {
@@ -370,6 +369,10 @@ public class PersistenceManagerImpl implements PersistenceManager {
storesMutex.readLock().lock();
try {
Consumer<CacheWriter> purgeWriter = writer -> {
+ // ISPN-6711 Shared stores should only be purged by the coordinator
+ if (configMap.get(writer).shared() && !cache.getCacheManager().isCoordinator())
+ return;
+
if (writer instanceof AdvancedCacheExpirationWriter) {
((AdvancedCacheExpirationWriter)writer).purge(persistenceExecutor, advancedListener);
} else if (writer instanceof AdvancedCacheWriter) {
@@ -393,7 +396,6 @@ public class PersistenceManagerImpl implements PersistenceManager {
}
}
-
@Override
public void clearAllStores(AccessMode mode) {
storesMutex.readLock().lock(); | ISPN-<I>: Shared stores should only be purged from coordinator. | infinispan_infinispan | train | java |
b15fd2b7e58b4861268077cee12c8277e27c494d | diff --git a/demo.js b/demo.js
index <HASH>..<HASH> 100644
--- a/demo.js
+++ b/demo.js
@@ -226,6 +226,8 @@ var lines = [
// advance terminal to next line
'next_line:',
+ 'LDA #0',
+ 'STA chargen', // clear cursor
'INC row',
'LDA #0',
'STA col', | Fix cursor remnant when advancing to next line with enter | thirdcoder_cpu3502 | train | js |
5b8db35ca71107a8834cab5829c35299b2066a0d | diff --git a/test/build.test.js b/test/build.test.js
index <HASH>..<HASH> 100644
--- a/test/build.test.js
+++ b/test/build.test.js
@@ -11,6 +11,8 @@ const mockBinDir = join(__dirname, 'bin');
describe(command, function() {
+ this.timeout(10000);
+
let cwd, env, opts;
beforeEach(function() { | Increase mocha timeout
Spawning Tabris CLI might take more than 2s in a shared resource
environment. Increase mocha timeout to prevent test failure on our
build infrastructure.
Change-Id: I1b9b<I>eaee1cd<I>c<I>df<I>d<I>a<I>e<I>e | eclipsesource_tabris-js-cli | train | js |
3853efdca3499158ae7060c8660d81a269e9ddd9 | diff --git a/spec/dummy/config/initializers/doorkeeper.rb b/spec/dummy/config/initializers/doorkeeper.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/initializers/doorkeeper.rb
+++ b/spec/dummy/config/initializers/doorkeeper.rb
@@ -12,4 +12,10 @@ Doorkeeper.configure do
# admin_authenticator do
# Admin.find_by_id(session[:admin_id]) || redirect_to main_app.new_admin_session_path
# end
+ #
+ #
+ authorization_scopes do
+ scope :public, :default => true, :description => "The public one"
+ scope :write, :description => "Updating information"
+ end
end | Add authorization scopes to dummy app | doorkeeper-gem_doorkeeper | train | rb |
72621b2ab260e0f3318af1849f4d245b8808f199 | diff --git a/azurerm/resource_arm_app_service_test.go b/azurerm/resource_arm_app_service_test.go
index <HASH>..<HASH> 100644
--- a/azurerm/resource_arm_app_service_test.go
+++ b/azurerm/resource_arm_app_service_test.go
@@ -65,6 +65,8 @@ func TestAccAzureRMAppService_basic(t *testing.T) {
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(resourceName),
+ resource.TestCheckResourceAttrSet(resourceName, "outbound_ip_addresses"),
+ resource.TestCheckResourceAttrSet(resourceName, "possible_outbound_ip_addresses"),
),
},
{ | Add assertions for ip props in basic resource tests | terraform-providers_terraform-provider-azurerm | train | go |
2170e750dae47ad4042ba1e2508d568c74cc3843 | diff --git a/lib/bicho/client.rb b/lib/bicho/client.rb
index <HASH>..<HASH> 100644
--- a/lib/bicho/client.rb
+++ b/lib/bicho/client.rb
@@ -32,6 +32,8 @@ require 'bicho/logging'
# Helper IO device that forwards to the logger, we use it
# to debug XMLRPC by monkey patching it
+#
+# @private
class Bicho::LoggerIODevice
def <<(msg)
Bicho::Logging.logger.debug(msg)
@@ -39,6 +41,8 @@ class Bicho::LoggerIODevice
end
# monkey patch XMLRPC
+#
+# @private
class XMLRPC::Client
def set_debug
@http.set_debug_output(Bicho::LoggerIODevice.new); | hide internal helper classes from docs | dmacvicar_bicho | train | rb |
05a1b594d8845a957a57e7d22a7c8337c87dd6b8 | diff --git a/WordPress/Sniff.php b/WordPress/Sniff.php
index <HASH>..<HASH> 100644
--- a/WordPress/Sniff.php
+++ b/WordPress/Sniff.php
@@ -390,6 +390,19 @@ abstract class Sniff implements PHPCS_Sniff {
);
/**
+ * Token which when they preceed code indicate the value is safely casted.
+ *
+ * @since 1.1.0
+ *
+ * @var array
+ */
+ protected $safe_casts = array(
+ \T_INT_CAST => true,
+ \T_DOUBLE_CAST => true,
+ \T_BOOL_CAST => true,
+ );
+
+ /**
* Functions that format strings.
*
* These functions are often used for formatting values just before output, and
@@ -1560,8 +1573,12 @@ abstract class Sniff implements PHPCS_Sniff {
true
);
+ if ( false === $prev ) {
+ return false;
+ }
+
// Check if it is a safe cast.
- return \in_array( $this->tokens[ $prev ]['code'], array( \T_INT_CAST, \T_DOUBLE_CAST, \T_BOOL_CAST ), true );
+ return isset( $this->safe_casts[ $this->tokens[ $prev ]['code'] ] );
}
/** | Sniff::is_safe_casted(): minor efficiency fixes | WordPress-Coding-Standards_WordPress-Coding-Standards | train | php |
1cc2412e6ae8fb6366ddf5a3e86b1c71224e5861 | diff --git a/api/payments.js b/api/payments.js
index <HASH>..<HASH> 100644
--- a/api/payments.js
+++ b/api/payments.js
@@ -227,16 +227,24 @@ function getPathFind($, req, res, next) {
};
function findPath(pathfind_params, callback) {
- remote.requestRipplePathFind(pathfind_params, function(err, path_res) {
- if (err) {
- return callback(err);
- }
+ var request = remote.requestRipplePathFind(pathfind_params);
- path_res.source_account = pathfind_params.src_account;
- path_res.source_currencies = pathfind_params.src_currencies;
+ request.once('error', callback);
+
+ request.once('success', function(path_res) {
+ path_res.source_account = pathfind_params.src_account;
+ path_res.source_currencies = pathfind_params.src_currencies;
path_res.destination_amount = pathfind_params.dst_amount;
+
callback(null, path_res);
});
+
+ request.timeout(1000 * 15, function() {
+ request.removeAllListeners();
+ res.json(502, { success: false, message: 'Path request timeout' });
+ });
+
+ request.request();
};
function checkAddXRPPath(path_res, callback) { | Set pathfind request timeout of <I>s | ripple_ripple-rest | train | js |
ac87bdd7366c4b39001e364eb46a923fdd4d1a86 | diff --git a/extensions-contrib/materialized-view-selection/src/main/java/org/apache/druid/query/materializedview/MaterializedViewUtils.java b/extensions-contrib/materialized-view-selection/src/main/java/org/apache/druid/query/materializedview/MaterializedViewUtils.java
index <HASH>..<HASH> 100644
--- a/extensions-contrib/materialized-view-selection/src/main/java/org/apache/druid/query/materializedview/MaterializedViewUtils.java
+++ b/extensions-contrib/materialized-view-selection/src/main/java/org/apache/druid/query/materializedview/MaterializedViewUtils.java
@@ -65,7 +65,7 @@ public class MaterializedViewUtils
dimensions.add(dim);
}
} else {
- throw new UnsupportedOperationException("Method getRequeiredFields only support TopNQuery/TimeseriesQuery/GroupByQuery");
+ throw new UnsupportedOperationException("Method getRequiredFields only supports TopNQuery/TimeseriesQuery/GroupByQuery");
}
return dimensions;
} | fix typo in materialized view (#<I>) | apache_incubator-druid | train | java |
13170cd6fbadcab8c16de1986ad80b2564b7d238 | diff --git a/src/main/java/org/roaringbitmap/IntIterator.java b/src/main/java/org/roaringbitmap/IntIterator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/roaringbitmap/IntIterator.java
+++ b/src/main/java/org/roaringbitmap/IntIterator.java
@@ -5,7 +5,10 @@
package org.roaringbitmap;
/**
- * A simple iterator over integer values
+ * A simple iterator over integer values.
+ * Using an IntIterator instead of Java's Iterator<Integer>
+ * avoids the overhead of the Interger class: on some tests,
+ * IntIterator is nearly twice as fast as Iterator<Integer>.
*/
public interface IntIterator extends Cloneable {
/** | Justifying IntIterator. | RoaringBitmap_RoaringBitmap | train | java |
4f89218bad54044e17268984a95d2a12fb58e017 | diff --git a/dallinger/deployment.py b/dallinger/deployment.py
index <HASH>..<HASH> 100644
--- a/dallinger/deployment.py
+++ b/dallinger/deployment.py
@@ -36,7 +36,7 @@ from dallinger.utils import get_base_url
from dallinger.utils import GitClient
from faker import Faker
-config = get_config()
+
fake = Faker()
@@ -72,6 +72,7 @@ def new_webbrowser_profile():
]
return new_firefox
elif sys.platform == "darwin":
+ config = get_config()
chrome_path = config.get("chrome-path")
if os.path.exists(chrome_path):
return _make_chrome(chrome_path)
diff --git a/tests/test_deployment.py b/tests/test_deployment.py
index <HASH>..<HASH> 100644
--- a/tests/test_deployment.py
+++ b/tests/test_deployment.py
@@ -751,6 +751,7 @@ class TestDebugServer(object):
return debugger
def test_startup(self, debugger):
+ debugger.no_browsers = True
debugger.run()
"Server is running" in str(debugger.out.log.call_args_list[0]) | Fix test interdependency problem, and run test without opening dashboard browser window | Dallinger_Dallinger | train | py,py |
6d1a195613b91a6562363347bfd79014323da8b5 | diff --git a/lib/eztemplate/classes/eztemplatecompiler.php b/lib/eztemplate/classes/eztemplatecompiler.php
index <HASH>..<HASH> 100644
--- a/lib/eztemplate/classes/eztemplatecompiler.php
+++ b/lib/eztemplate/classes/eztemplatecompiler.php
@@ -1556,13 +1556,13 @@ class eZTemplateCompiler
/*!
Creates a variable data element for the data \a $staticData and returns it.
The type of element depends on the type of the data, strings and booleans
- are returned as EZ_TEMPLATE_TYPE_TEXT and eZTemplate::TYPE_NUMERIC while other
- types are turned into text and returned as EZ_TEMPLATE_TYPE_TEXT.
+ are returned as eZTemplate::TYPE_STRING and eZTemplate::TYPE_NUMERIC while other
+ types are turned into text and returned as eZTemplate::TYPE_STRING.
*/
static function createStaticVariableData( $tpl, $staticData, $variableItemPlacement )
{
if ( is_string( $staticData ) )
- return array( EZ_TEMPLATE_TYPE_TEXT,
+ return array( eZTemplate::TYPE_STRING,
$staticData,
$variableItemPlacement );
else if ( is_bool( $staticData ) )
@@ -1578,7 +1578,7 @@ class eZTemplateCompiler
$staticData,
$variableItemPlacement );
else
- return array( EZ_TEMPLATE_TYPE_TEXT,
+ return array( eZTemplate::TYPE_STRING,
"$staticData",
$variableItemPlacement );
} | EZ_TEMPLATE_TYPE_TEXT is an unknown constant | ezsystems_ezpublish-legacy | train | php |
160d4e43cad1b7c091ba0f2ac4ac6e8fce83ce19 | diff --git a/pilight/__init__.py b/pilight/__init__.py
index <HASH>..<HASH> 100644
--- a/pilight/__init__.py
+++ b/pilight/__init__.py
@@ -1,3 +1,12 @@
# http://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package
-from pkg_resources import get_distribution
-__version__ = get_distribution('pilight').version
\ No newline at end of file
+from pkg_resources import get_distribution, DistributionNotFound
+
+__project__ = 'pilight'
+__version__ = None # required for initial installation
+
+try:
+ __version__ = get_distribution(__project__).version
+except DistributionNotFound:
+ VERSION = __project__ + '-' + '(local)'
+else:
+ VERSION = __project__ + '-' + __version__
\ No newline at end of file | BUG: determine version without exception, addressing #1 | DavidLP_pilight | train | py |
7a6f56ee7889f8b03f7f2593210548f0101316ee | diff --git a/exampleProg.py b/exampleProg.py
index <HASH>..<HASH> 100644
--- a/exampleProg.py
+++ b/exampleProg.py
@@ -47,14 +47,16 @@ s = input('--> ')
if (s == "y" or s == "Y"):
- ## Read all documents for example author
+ ## Read all documents for example author, then write to disk
if myAuth.readDocs(myCl):
print ("myAuth.doc_list has " + str(len(myAuth.doc_list)) + " items.")
+ myAuth.writeDocs()
else:
print ("Read docs for author failed.")
- ## Read all documents for example affiliation
+ ## Read all documents for example affiliation, then write to disk
if myAff.readDocs(myCl):
print ("myAff.doc_list has " + str(len(myAff.doc_list)) + " items.")
+ myAff.writeDocs()
else:
print ("Read docs for affiliation failed.") | Add document list write-to-disk example. | ElsevierDev_elsapy | train | py |
9dae158524371385519eb4022ca9d1109c0dc35d | diff --git a/library/src/net/simonvt/widget/MenuDrawer.java b/library/src/net/simonvt/widget/MenuDrawer.java
index <HASH>..<HASH> 100644
--- a/library/src/net/simonvt/widget/MenuDrawer.java
+++ b/library/src/net/simonvt/widget/MenuDrawer.java
@@ -769,7 +769,8 @@ public class MenuDrawer extends ViewGroup {
*/
public Parcelable saveState() {
Bundle state = new Bundle();
- state.putBoolean(STATE_MENU_VISIBLE, mMenuVisible);
+ final boolean menuVisible = mDrawerState == STATE_OPEN || mDrawerState == STATE_OPENING;
+ state.putBoolean(STATE_MENU_VISIBLE, menuVisible);
return state;
} | Use current drawer state when saving instance state. Ref #2. | SimonVT_android-menudrawer | train | java |
c30f3191477bd7e4d039ed53b1cb69fa288b2be1 | diff --git a/jre_emul/android/libcore/luni/src/main/java/java/lang/ref/ReferenceQueue.java b/jre_emul/android/libcore/luni/src/main/java/java/lang/ref/ReferenceQueue.java
index <HASH>..<HASH> 100644
--- a/jre_emul/android/libcore/luni/src/main/java/java/lang/ref/ReferenceQueue.java
+++ b/jre_emul/android/libcore/luni/src/main/java/java/lang/ref/ReferenceQueue.java
@@ -29,6 +29,9 @@ public class ReferenceQueue<T> {
private Reference<? extends T> head;
+ // j2objc: Use a sentinel to avoid the "reference.queueNext = reference" leak.
+ private final Reference<? extends T> SENTINEL = new WeakReference<>(null, null);
+
/**
* Constructs a new instance of this class.
*/
@@ -52,7 +55,7 @@ public class ReferenceQueue<T> {
ret = head;
- if (head == head.queueNext) {
+ if (SENTINEL == head.queueNext) {
head = null;
} else {
head = head.queueNext;
@@ -134,7 +137,7 @@ public class ReferenceQueue<T> {
*/
synchronized void enqueue(Reference<? extends T> reference) {
if (head == null) {
- reference.queueNext = reference;
+ reference.queueNext = SENTINEL;
} else {
reference.queueNext = head;
} | Fix cyclic reference leaks in ReferenceQueue | google_j2objc | train | java |
fffd5bbed5b38eb2e0b5c4824f7abebb37c77060 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,6 +24,7 @@ testpkgs=[
install_requires=[
"sqlalchemy",
+ "psycopg2",
"zope.sqlalchemy >= 0.4",
"pandas",
"numpy", | Added postgres driver psycopg2 to setup.py | hydraplatform_hydra-base | train | py |
13f480a5e0e9687a3b54e21ff4e307e7f192e603 | diff --git a/beautify.php b/beautify.php
index <HASH>..<HASH> 100644
--- a/beautify.php
+++ b/beautify.php
@@ -438,7 +438,7 @@ function get_next_token(&$pos)
if (!$whitespace) $whitespace = make_array("\n\r\t ");
if (!$wordchar) $wordchar = make_array('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$');
- if (!$punct) $punct = explode(' ', '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> <<< >>= <<= && | || ! !! , : ?');
+ if (!$punct) $punct = explode(' ', '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> <<< >>= <<= && | || ! !! , : ? ^ ^= |=');
$n_newlines = 0;
do { | ^= ^ |= added to operators | beautify-web_js-beautify | train | php |
627427b0e69a68c93ccd12fb8c49f9eedd48830f | diff --git a/WeatherStation.py b/WeatherStation.py
index <HASH>..<HASH> 100755
--- a/WeatherStation.py
+++ b/WeatherStation.py
@@ -115,7 +115,7 @@ def _decode(raw, format):
result = raw[pos]
else:
raise IOError('unknown type %s' % type)
- if scale:
+ if scale and result:
result = float(result) * scale
return result
def findDevice(idVendor, idProduct): | Corrected bug in scaling of raw data when data missing | jim-easterbrook_pywws | train | py |
dda18491e0348ab13254c107d152a5f53a1f9f7c | diff --git a/telemetry/telemetry/unittest/tab_test_case.py b/telemetry/telemetry/unittest/tab_test_case.py
index <HASH>..<HASH> 100644
--- a/telemetry/telemetry/unittest/tab_test_case.py
+++ b/telemetry/telemetry/unittest/tab_test_case.py
@@ -45,6 +45,9 @@ class TabTestCase(unittest.TestCase):
while len(self._browser.tabs) > 1:
self._browser.tabs[0].Close()
else:
+ if not self._browser.tabs:
+ self.tearDownClass()
+ self.setUpClass()
self._tab = self._browser.tabs[0]
self._tab.Navigate('about:blank')
self._tab.WaitForDocumentReadyStateToBeInteractiveOrBetter() | [Telemetry] Fix android unittests that run after testRendererCrash.
Looks like we have to restart the browser if a tab crashes in a browser that
doesn't support tab control.
BUG=<I>
Review URL: <URL> | catapult-project_catapult | train | py |
7fe14ba48d7ab19d8803e227d38741646124ea06 | diff --git a/fetcher.go b/fetcher.go
index <HASH>..<HASH> 100644
--- a/fetcher.go
+++ b/fetcher.go
@@ -35,14 +35,14 @@ func (f *fetch) Fetch() {
f.processOldMessages()
go (func(c chan string) {
+ conn := Config.Pool.Get()
+ defer conn.Close()
+
for {
if f.Closed() {
break
}
- conn := Config.Pool.Get()
- defer conn.Close()
-
message, err := redis.String(conn.Do("brpoplpush", f.manager.queue, f.inprogressQueue(), 1))
if err != nil {
diff --git a/scheduled.go b/scheduled.go
index <HASH>..<HASH> 100644
--- a/scheduled.go
+++ b/scheduled.go
@@ -30,7 +30,6 @@ func (s *scheduled) poll(continuing bool) {
}
conn := Config.Pool.Get()
- defer conn.Close()
now := time.Now().Unix()
@@ -51,6 +50,7 @@ func (s *scheduled) poll(continuing bool) {
}
}
+ conn.Close()
if continuing {
time.Sleep(POLL_INTERVAL * time.Second)
s.poll(true) | Don't open so many connections to redis | jrallison_go-workers | train | go,go |
8c574108bb029f34aceeb31a09d2756a8d80b960 | diff --git a/photutils/psf/photometry.py b/photutils/psf/photometry.py
index <HASH>..<HASH> 100644
--- a/photutils/psf/photometry.py
+++ b/photutils/psf/photometry.py
@@ -347,7 +347,9 @@ class BasicPSFPhotometry:
raise ValueError('Finder cannot be None if init_guesses are '
'not given.')
sources = self.finder(image, mask=mask)
- if len(sources) > 0:
+ if sources is None:
+ return None
+ else:
positions = np.transpose((sources['xcentroid'],
sources['ycentroid']))
apertures = CircularAperture(positions, | Fix check if no sources are found | astropy_photutils | train | py |
fa90e174510f37ea2c13c2651cc3ecaf5605593a | diff --git a/inferno/utils.py b/inferno/utils.py
index <HASH>..<HASH> 100644
--- a/inferno/utils.py
+++ b/inferno/utils.py
@@ -36,9 +36,10 @@ def to_tensor(X, use_cuda=False):
Handles the cases:
* Variable
* PackedSequence
- * dict
* numpy array
* torch Tensor
+ * list or tuple of one of the former
+ * dict of one of the former
"""
if isinstance(X, (Variable, nn.utils.rnn.PackedSequence)):
@@ -47,6 +48,9 @@ def to_tensor(X, use_cuda=False):
if isinstance(X, dict):
return {key: to_tensor(val) for key, val in X.items()}
+ if isinstance(X, (list, tuple)):
+ return [to_tensor(x) for x in X]
+
if isinstance(X, np.ndarray):
X = torch.from_numpy(X)
@@ -59,6 +63,12 @@ def to_tensor(X, use_cuda=False):
def to_numpy(X):
+ if isinstance(X, np.ndarray):
+ return X
+
+ if is_pandas_ndframe(X):
+ return X.values
+
if X.is_cuda:
X = X.cpu()
try: | Add more cases to to_tensor and to_numpy. | skorch-dev_skorch | train | py |
97e87a42eaeb78b1d2193df8bd6fbb26324d8226 | diff --git a/lib/iterator.js b/lib/iterator.js
index <HASH>..<HASH> 100644
--- a/lib/iterator.js
+++ b/lib/iterator.js
@@ -96,5 +96,16 @@ module.exports = function BlastIterator(Blast, Collection) {
return {done: true};
});
+ /**
+ * Reset the iterator, go back to the beginning
+ *
+ * @author Jelle De Loecker <jelle@codedor.be>
+ * @since 0.1.4
+ * @version 0.1.4
+ */
+ Iterator.setMethod(function reset() {
+ this._iterNextIndex = 0;
+ });
+
Blast.defineClass('Iterator', Iterator);
};
\ No newline at end of file | feat: add Iterator#reset, to go back to the beginning | skerit_protoblast | train | js |
b428bcc39839dd155549ec111e5344b54ba2758c | diff --git a/lib/svtplay_dl/postprocess/__init__.py b/lib/svtplay_dl/postprocess/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/postprocess/__init__.py
+++ b/lib/svtplay_dl/postprocess/__init__.py
@@ -232,7 +232,7 @@ class postprocess:
os.rename(tempfile, orig_filename)
def _streams(self, output):
- return re.findall(r"Stream \#\d:(\d)\[[^\[]+\]([\(\)\w]+)?: (Video|Audio): (.*)", output)
+ return re.findall(r"Stream \#\d:(\d)[\[\(][^\[]+[\]\)]([\(\)\w]+)?: (Video|Audio): (.*)", output)
def _getcodec(self, streams, number):
for stream in streams: | postprocess: fix a crash during remuxing because it could not find tracks
fixes: #<I> | spaam_svtplay-dl | train | py |
a138004ec365d5b11f35dbb79160fcbe796b4324 | diff --git a/lib/faye/websocket.js b/lib/faye/websocket.js
index <HASH>..<HASH> 100644
--- a/lib/faye/websocket.js
+++ b/lib/faye/websocket.js
@@ -40,7 +40,7 @@ var WebSocket = function(request, socket, head) {
this.bufferedAmount = 0;
var Parser = getParser(request);
- this._parser = new Parser(this, this._stream);
+ this._parser = new Parser(this);
var handshake = this._parser.handshakeResponse(head);
try { this._stream.write(handshake, 'binary') } catch (e) {}
diff --git a/lib/faye/websocket/client.js b/lib/faye/websocket/client.js
index <HASH>..<HASH> 100644
--- a/lib/faye/websocket/client.js
+++ b/lib/faye/websocket/client.js
@@ -19,7 +19,7 @@ var Client = function(url) {
? tls.connect(this._uri.port || 443, this._uri.hostname, onConnect)
: net.createConnection(this._uri.port || 80, this._uri.hostname);
- this._parser = new Protocol8Parser(this, connection, {masking: true});
+ this._parser = new Protocol8Parser(this, {masking: true});
this._stream = connection;
if (!secure) connection.addListener('connect', onConnect); | Don't pass TCP socket in when constructing a parser. | faye_websocket-driver-node | train | js,js |
7555787e9b259790802f71cf0ef96245249e0c4d | diff --git a/btrfs/test_btrfs.py b/btrfs/test_btrfs.py
index <HASH>..<HASH> 100644
--- a/btrfs/test_btrfs.py
+++ b/btrfs/test_btrfs.py
@@ -2,9 +2,13 @@
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
+# 3p
+from nose.plugins.attrib import attr
+
# project
from tests.checks.common import AgentCheckTest
+@attr('unix')
class TestBtrfs(AgentCheckTest):
"""Basic Test for btrfs integration."""
CHECK_NAME = 'btrfs' | [btrfs] this is a unix test, skip on appveyor. | DataDog_integrations-core | train | py |
eb992f755c8cd9bb7a1bd376fa103b82d48fb7c8 | diff --git a/holoviews/plotting/plot.py b/holoviews/plotting/plot.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/plot.py
+++ b/holoviews/plotting/plot.py
@@ -956,6 +956,7 @@ class LayoutPlot(CompositePlot):
# Options common for any subplot
override_opts = {}
+ sublabel_opts = {}
if pos == 'main':
own_params = self.get_param_values(onlychanged=True)
sublabel_opts = {k: v for k, v in own_params | Fixed for sublabels on LayoutPlot | pyviz_holoviews | train | py |
1410d331fd5bfb71af2cff96420dc011da331d4c | diff --git a/lib/tty/progressbar.rb b/lib/tty/progressbar.rb
index <HASH>..<HASH> 100644
--- a/lib/tty/progressbar.rb
+++ b/lib/tty/progressbar.rb
@@ -94,6 +94,7 @@ module TTY
#
# @api public
def advance(progress = 1, tokens = {})
+ handle_signals
return if @done
if progress.respond_to?(:to_hash)
@@ -285,14 +286,25 @@ module TTY
#
# @api private
def register_callbacks
- callback = proc do
- adjusted_width = width < max_columns ? width : max_columns
- send(:resize, adjusted_width)
- end
- Signal.trap('WINCH', &callback)
+ @signals = []
+ trap(:WINCH) {
+ @signals << :winch
+ }
+
+ trap(:EXIT) {
+ @signals << :exit
+ }
+ end
- EXIT_SIGS.each do |sig|
- Signal.trap(sig) { finish && fail(Interrupt) }
+ def handle_signals
+ while signal = @signals.shift
+ case signal
+ when :winch
+ adjusted_width = width < max_columns ? width : max_columns
+ send(:resize, adjusted_width)
+ when :exit
+ finish && fail(Interrupt)
+ end
end
end
end # ProgressBar | move handling of event to prevent thread crash | piotrmurach_tty-progressbar | train | rb |
2e97f534ee9c5b13dcbcd918ae4bb7c07100cce9 | diff --git a/src/BaseRepo/RepoTrait.php b/src/BaseRepo/RepoTrait.php
index <HASH>..<HASH> 100644
--- a/src/BaseRepo/RepoTrait.php
+++ b/src/BaseRepo/RepoTrait.php
@@ -15,7 +15,16 @@ trait RepoTrait
*/
public function getBy($key, $value, $operator = '=', array $with = array())
{
- return $this->make($with)->where($key, $operator, $value)->get();
+ $operator = strtolower($operator);
+ switch ($operator) {
+ case '=':
+ case '>':
+ return $this->make($with)->where($key, $operator, $value)->get();
+ break;
+ case 'like':
+ return $this->make($with)->where($key, 'LIKE', '%' . $value . '%')->get();
+ break;
+ }
}
public function count() | updated whre method to accept the operator | shekarsiri_baserepo | train | php |
f91e03a6ca8473b5333eb9d482302763cbca9d0a | diff --git a/lib/vim-epidemic.rb b/lib/vim-epidemic.rb
index <HASH>..<HASH> 100644
--- a/lib/vim-epidemic.rb
+++ b/lib/vim-epidemic.rb
@@ -1,6 +1,7 @@
# encoding: UTF-8
require 'paint'
require 'which_works'
+require 'fileutils'
module VimEpidemic
VERSION = '0.0.2'
diff --git a/lib/vim-epidemic/config.rb b/lib/vim-epidemic/config.rb
index <HASH>..<HASH> 100644
--- a/lib/vim-epidemic/config.rb
+++ b/lib/vim-epidemic/config.rb
@@ -1,4 +1,3 @@
-require 'fileutils'
module VimEpidemic
diff --git a/lib/vim-epidemic/plugin.rb b/lib/vim-epidemic/plugin.rb
index <HASH>..<HASH> 100644
--- a/lib/vim-epidemic/plugin.rb
+++ b/lib/vim-epidemic/plugin.rb
@@ -1,4 +1,3 @@
-require 'uri'
module VimEpidemic
@@ -17,6 +16,7 @@ module VimEpidemic
end
def install
+ FileUtils.mkdir_p @config.bundle_dir
if File.exists? dir
Dir.chdir dir
`git pull` | Create bundle directory if it does not exist. | AlphaHydrae_vim-epidemic | train | rb,rb,rb |
f9f4c9da8370efae5d3cd7c27ce8f10ed810127f | diff --git a/src/httpDecorator.js b/src/httpDecorator.js
index <HASH>..<HASH> 100644
--- a/src/httpDecorator.js
+++ b/src/httpDecorator.js
@@ -21,10 +21,6 @@ function httpEtagHttpDecorator ($delegate, httpEtag) {
var isCachable = hasConfig && isCacheableMethod
var httpPromise
- if (hasConfig && !isCacheableMethod && console && console.warn) {
- console.warn('Cannot cache HTTP ' + httpConfig.method + ' requests')
- }
-
if (isCachable) {
var etagCacheConfig = processHttpConfigEtagValue(httpConfig)
if (etagCacheConfig) { | Remove console warn on attempts to cache uncachable methods
Inconsistent warning since shortcut methods are passed directory to the
$http service. Warning would have only shown when using $http() | shaungrady_angular-http-etag | train | js |
e399e9f8e2ee93d46985ff6679a1ac5ec72d2c19 | diff --git a/tensor2tensor/layers/discretization.py b/tensor2tensor/layers/discretization.py
index <HASH>..<HASH> 100644
--- a/tensor2tensor/layers/discretization.py
+++ b/tensor2tensor/layers/discretization.py
@@ -706,7 +706,7 @@ def vq_nearest_neighbor(x, means, soft_em=False, num_samples=10):
x_means_idx = tf.multinomial(-dist, num_samples=num_samples)
x_means_hot = tf.one_hot(
x_means_idx, depth=common_layers.shape_list(means)[0])
- x_means_hot = tf.reduce_sum(x_means_hot, axis=1)
+ x_means_hot = tf.reduce_mean(x_means_hot, axis=1)
else:
x_means_idx = tf.argmax(-dist, axis=-1)
x_means_hot = tf.one_hot(x_means_idx, bottleneck_size) | Fix bug, change to reduce_mean for em discretization
PiperOrigin-RevId: <I> | tensorflow_tensor2tensor | train | py |
6642978fc7756d66c34b73c6892805ffe19b6988 | diff --git a/lib/client-metrics/ttl-list.test.js b/lib/client-metrics/ttl-list.test.js
index <HASH>..<HASH> 100644
--- a/lib/client-metrics/ttl-list.test.js
+++ b/lib/client-metrics/ttl-list.test.js
@@ -16,7 +16,6 @@ test.cb('should emit expire', t => {
list.on('expire', entry => {
list.destroy();
t.true(entry.n === 1);
- console.log('here');
t.end();
}); | Remove log-message in test | Unleash_unleash | train | js |
8a0acf89d327833503ed81b23f28be17fc5d25cf | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -74,7 +74,6 @@ def requirements(filename):
# use pytest instead.
def run_tests(self):
raise SystemExit(__import__('pytest').main(['-v']))
-test.run_tests = run_tests
# replace files which are incompatible with the current python version.
@@ -86,6 +85,9 @@ def replace_incompatible_files():
code = INCOMPATIBLE_PYTHON_VERSION_PLACEHOLDER.format(version=version)
with open(filename, 'w') as f:
f.write(code)
+
+
+test.run_tests = run_tests
run_install = install.run
install.run = lambda x: (replace_incompatible_files(), run_install(x)) | Fix flake8 erorrs on setup.py | what-studio_profiling | train | py |
716b2f3ee12c81bd297dfd3e6aed73d548f0053c | diff --git a/lib/rules/sort-object-keys.js b/lib/rules/sort-object-keys.js
index <HASH>..<HASH> 100644
--- a/lib/rules/sort-object-keys.js
+++ b/lib/rules/sort-object-keys.js
@@ -202,8 +202,8 @@ module.exports = {
});
})
.reduce(function(flattenedProperties, propertiesGroup) {
- return flattenedProperties.concat(propertiesGroup), [];
- })
+ return flattenedProperties.concat(propertiesGroup);
+ }, [])
.map(function(property) {
return property.nodeText;
}) | Fix the reduce silently removing all the things! | rapid7_eslint-plugin-rapid7 | train | js |
b3264aa5f0abcb3f72da387cd7b111fb6077244f | diff --git a/spacy/_ml.py b/spacy/_ml.py
index <HASH>..<HASH> 100644
--- a/spacy/_ml.py
+++ b/spacy/_ml.py
@@ -409,12 +409,14 @@ def build_tagger_model(nr_class, **cfg):
else:
tok2vec = Tok2Vec(token_vector_width, embed_size,
pretrained_dims=pretrained_dims)
+ softmax = with_flatten(Softmax(nr_class, token_vector_width))
model = (
tok2vec
- >> with_flatten(Softmax(nr_class, token_vector_width))
+ >> softmax
)
model.nI = None
model.tok2vec = tok2vec
+ model.softmax
return model | Expose the softmax layer in the tagger model, to allow setting tensors | explosion_spaCy | train | py |
59c468c96caf3b932f0ab3bc7ed1affeaff101be | diff --git a/lib/marked.js b/lib/marked.js
index <HASH>..<HASH> 100644
--- a/lib/marked.js
+++ b/lib/marked.js
@@ -39,8 +39,8 @@ block.html = (function() {
html = html
.replace('comment', /<!--[^\0]*?-->/.source)
.replace('closed', /<(?!elements)(\w+)[^\0]+?<\/\1>/.source)
- .replace('closing', /<\w+(?!:\/|@)\b(?:"[^"]*"|'[^']*'|[^>])*>/.source)
- .replace('elements', elements());
+ .replace('closing', /<(?!elements)\w+(?!:\/|@)\b(?:"[^"]*"|'[^']*'|[^>])*>/.source)
+ .replace(/elements/g, elements());
return new RegExp(html);
})(); | ignore inline elements for self-closing block-level html tags | remarkjs_remark | train | js |
a72c3f3d47c55cd40a833e9f57053fa607155a61 | diff --git a/js/gdax.js b/js/gdax.js
index <HASH>..<HASH> 100644
--- a/js/gdax.js
+++ b/js/gdax.js
@@ -29,6 +29,7 @@ module.exports = class gdax extends Exchange {
'fetchOrder': true,
'fetchOrderTrades': true,
'fetchOrders': true,
+ 'fetchTime': true,
'fetchTransactions': true,
'withdraw': true,
}, | gdax: set hasFetchTime to true | ccxt_ccxt | train | js |
f1c82ac71f770312de733bce3fc3d56f820b3d2e | diff --git a/ddl/reorg.go b/ddl/reorg.go
index <HASH>..<HASH> 100644
--- a/ddl/reorg.go
+++ b/ddl/reorg.go
@@ -63,7 +63,7 @@ func (d *ddl) runReorgJob(job *model.Job, f func() error) error {
// we will wait 2 * lease outer and try checking again,
// so we use a very little timeout here.
if d.lease > 0 {
- waitTimeout = 1 * time.Millisecond
+ waitTimeout = 50 * time.Millisecond
}
// wait reorganization job done or timeout
diff --git a/ddl/reorg_test.go b/ddl/reorg_test.go
index <HASH>..<HASH> 100644
--- a/ddl/reorg_test.go
+++ b/ddl/reorg_test.go
@@ -64,7 +64,7 @@ func (s *testDDLSuite) TestReorg(c *C) {
rowCount := int64(10)
f := func() error {
d.setReorgRowCount(rowCount)
- time.Sleep(4 * testLease)
+ time.Sleep(20 * testLease)
return nil
}
job := &model.Job{} | ddl: update reorg wait time (#<I>) | pingcap_tidb | train | go,go |
161ab79eb356256b8041d78073f5ac47ebdf488c | diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py
index <HASH>..<HASH> 100644
--- a/pyrogram/client/filters/filters.py
+++ b/pyrogram/client/filters/filters.py
@@ -109,6 +109,9 @@ class Filters:
video = create("Video", lambda _, m: bool(m.video))
"""Filter messages that contain :obj:`Video <pyrogram.Video>` objects."""
+ media_group = create("MediaGroup", lambda _, m: bool(m.media_group_id))
+ """Filter messages containing photos or videos being part of an album."""
+
voice = create("Voice", lambda _, m: bool(m.voice))
"""Filter messages that contain :obj:`Voice <pyrogram.Voice>` note objects.""" | Add Filters.media_group for photos or videos being part of an album. | pyrogram_pyrogram | train | py |
06ae57361e4f527f6141ac88b21742512fcb4e79 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -18,8 +18,7 @@ setup(
install_requires=['boto', 'boto3', 'ujson', 'requests', 'protobuf==3.1.0',
'expiringdict', 'functools32', 'futures', 'py4j',
'pandas>=0.14.1', 'numpy>=1.8.2', 'findspark',
- 'happybase>=1.0.0', 'PyYAML', 'python-snappy'],
- dependency_links=['https://github.com/wbolster/happybase/archive/33b7700375ba59f1810c30c8cd531577b0718498.zip#egg=happybase-1.0.1'],
+ 'happybase==1.1.0', 'PyYAML', 'python-snappy'],
setup_requires=['pytest-runner', 'setuptools_scm'],
# put pytest last to workaround this bug
# https://bitbucket.org/pypa/setuptools/issues/196/tests_require-pytest-pytest-cov-breaks | Bug <I> - Depend on happybase <I>
Also remove the deprecated use of dependency_links in the setup file
(which didn't work without a special command-line option). | mozilla_python_moztelemetry | train | py |
b0e110a33bfdacaa59ba22fb94645e4eeb67f7a0 | diff --git a/SteamID.php b/SteamID.php
index <HASH>..<HASH> 100644
--- a/SteamID.php
+++ b/SteamID.php
@@ -128,7 +128,7 @@ class SteamID
$this->SetAccountID( $AccountID );
}
// SetFromSteam3String
- else if( preg_match( '/^\\[([AGMPCgcLTIUai]):([0-4]):([0-9]{1,10})(:([0-9]+))?\\]$/', $Value, $Matches ) === 1 )
+ else if( preg_match( '/^\\[([AGMPCgcLTIUa]):([0-4]):([0-9]{1,10})(:([0-9]+))?\\]$/', $Value, $Matches ) === 1 )
{
$AccountID = $Matches[ 3 ];
@@ -231,7 +231,7 @@ class SteamID
$AccountType = $this->GetAccountType();
$AccountTypeChar = isset( self::$AccountTypeChars[ $AccountType ] ) ?
self::$AccountTypeChars[ $AccountType ] :
- 'i';
+ 'I';
$RenderInstance = false; | 'i' is not a valid account type | xPaw_SteamID.php | train | php |
c84c51c051e6f92d91f60add5ceb83872a991466 | diff --git a/src/config/babel.js b/src/config/babel.js
index <HASH>..<HASH> 100644
--- a/src/config/babel.js
+++ b/src/config/babel.js
@@ -7,6 +7,7 @@ module.exports = {
require.resolve('babel-preset-stage-2'),
],
plugins: [
+ [require.resolve('babel-plugin-styled-components'), { ssr: true }],
// TODO - Verify that we don't need babel-plugin-transform-runtime anymore
// require.resolve("babel-plugin-transform-runtime")
], | Add babel-plugin-styled-components | ProAI_react-kickstarter | train | js |
8d10cd527094deca5fa47b4028370b6078218f33 | diff --git a/lib/jets/base_model.rb b/lib/jets/base_model.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/base_model.rb
+++ b/lib/jets/base_model.rb
@@ -1,4 +1,7 @@
module Jets
class BaseModel
+ def db
+ @db ||= Aws::DynamoDB::Client.new
+ end
end
end | add db method to base model | tongueroo_jets | train | rb |
04ed908e8329a3c00730c8d74fde60f6d655b92b | diff --git a/ftests/core/src/main/java/org/commonjava/indy/ftest/core/content/RemoteRepoTimeoutDisablesThenReEnabledTest.java b/ftests/core/src/main/java/org/commonjava/indy/ftest/core/content/RemoteRepoTimeoutDisablesThenReEnabledTest.java
index <HASH>..<HASH> 100644
--- a/ftests/core/src/main/java/org/commonjava/indy/ftest/core/content/RemoteRepoTimeoutDisablesThenReEnabledTest.java
+++ b/ftests/core/src/main/java/org/commonjava/indy/ftest/core/content/RemoteRepoTimeoutDisablesThenReEnabledTest.java
@@ -63,6 +63,8 @@ public class RemoteRepoTimeoutDisablesThenReEnabledTest
final String repo1 = "repo1";
final String path = "org/foo/bar/maven-metadata.xml";
+ server.expect( server.formatUrl( "repo1/" ), 200, "OK" );
+
server.expect( "GET", server.formatUrl( repo1, path ), (req,resp)->{
try
{ | Fixing expectation now that we're validating urls for all remote repositories. | Commonjava_indy | train | java |
7e17b0ec8e5d91d782a2a46bc77266bbb3dbbcc6 | diff --git a/lib/virtualbox.js b/lib/virtualbox.js
index <HASH>..<HASH> 100644
--- a/lib/virtualbox.js
+++ b/lib/virtualbox.js
@@ -186,7 +186,7 @@ function snapshotList(vmname, callback) {
var s;
var snapshots = [];
var currentSnapshot;
- var lines = (stdout || '').split('\n');
+ var lines = (stdout || '').split(require('os').EOL);
lines.forEach(function(line) {
line.replace(/^(CurrentSnapshotUUID|SnapshotName|SnapshotUUID).*\="(.*)"$/, function(l, k, v) { | use EOL constant
snapshotList fails on windows, cause of different line endings | Node-Virtualization_node-virtualbox | train | js |
7853a285efa28cc98ed88b7fc2020da116ea26fd | diff --git a/admin/index.php b/admin/index.php
index <HASH>..<HASH> 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -172,7 +172,7 @@ if ( isset( $_GET['u'] ) ) {
switch ( $_GET['share'] ) {
case 'twitter':
// share with Twitter
- $destination = sprintf( "https://twitter.com/intent/tweet?url=%s&text=%s", $return['shorturl'], $_GET['t'] );
+ $destination = sprintf( "https://twitter.com/intent/tweet?url=%s&text=%s", urlencode( $return['shorturl'] ), urlencode( $_GET['t'] ) );
yourls_redirect( $destination, 303 );
// Deal with the case when redirection failed:
@@ -183,7 +183,7 @@ if ( isset( $_GET['u'] ) ) {
case 'facebook':
// share with Facebook
- $destination = sprintf( "https://www.facebook.com/sharer/sharer.php?u=%s&t=%s", $return['shorturl'], $_GET['t'] );
+ $destination = sprintf( "https://www.facebook.com/sharer/sharer.php?u=%s&t=%s", urlencode( $return['shorturl'] ), urlencode( $_GET['t'] ) );
yourls_redirect( $destination, 303 );
// Deal with the case when redirection failed: | Encode URL & titles in social bookmarklets | YOURLS_YOURLS | train | php |
b63204f6aab8065e4e635627dd19925513f9d51e | diff --git a/tests/includes/tests-traversal.php b/tests/includes/tests-traversal.php
index <HASH>..<HASH> 100644
--- a/tests/includes/tests-traversal.php
+++ b/tests/includes/tests-traversal.php
@@ -1063,7 +1063,7 @@ namespace Pods_Unit_Tests;
} elseif ( 'taxonomy' == $pod_type ) {
$metadata_type = 'term';
} else {
- $metadata_type = 'post';
+ $metadata_type = $pod_type;
}
// @todo other field type coverage for relational | Quick fix in `_test_field_traversal`. `Test_Traversal` Now passes all tests. | pods-framework_pods | train | php |
04d9512f3019ceef251b6c119290071c9ed3bccf | diff --git a/lib/devise/rails/routes.rb b/lib/devise/rails/routes.rb
index <HASH>..<HASH> 100644
--- a/lib/devise/rails/routes.rb
+++ b/lib/devise/rails/routes.rb
@@ -398,13 +398,13 @@ module ActionDispatch::Routing
providers = Regexp.union(mapping.to.omniauth_providers.map(&:to_s))
- get "#{path_prefix}/:provider",
+ match "#{path_prefix}/:provider",
:constraints => { :provider => providers },
:to => "#{controllers[:omniauth_callbacks]}#passthru",
:as => :omniauth_authorize,
:via => [:get, :post]
- get "#{path_prefix}/:action/callback",
+ match "#{path_prefix}/:action/callback",
:constraints => { :action => providers },
:to => controllers[:omniauth_callbacks],
:as => :omniauth_callback, | We need to do match via [get, post] | plataformatec_devise | train | rb |
a055adae577f1078e7709439c79451cba4137bf7 | diff --git a/tests/unit/components/em-form-test.js b/tests/unit/components/em-form-test.js
index <HASH>..<HASH> 100644
--- a/tests/unit/components/em-form-test.js
+++ b/tests/unit/components/em-form-test.js
@@ -166,6 +166,34 @@ test('a form display errors when field is focused', function(assert) {
});
});
+test('a form update inputs on model change', function(assert) {
+ var component = this.subject({
+ targetObject: FormController.create(),
+ model: somePerson,
+ template: Ember.HTMLBars.compile('{{em-input property="name"}}')
+ });
+
+ this.render();
+
+ var input = Ember.$(component.element).find('input');
+ assert.equal(input.length, 1, "Found input");
+ input = Ember.$(input[0]);
+ assert.equal(input.val(), 'my-name', "Input has original model value");
+
+ Ember.run(() => {
+ somePerson.set('name', 'joseph');
+ });
+
+ assert.equal(input.val(), 'joseph', "Input has new model value");
+
+ Ember.run(() => {
+ somePerson.set('name', 'my-name');
+ });
+
+ assert.equal(input.val(), 'my-name', "Input has original model value again");
+
+});
+
test('form cannot be submitted if model is invalid', function(assert) {
assert.expect(0);
var component = this.subject({ | Test for model updates also update view. | piceaTech_ember-rapid-forms | train | js |
342f17f06ea777f73e8bf2988d6204d5bc6c2c54 | diff --git a/core/common/src/main/java/alluxio/extensions/ExtensionsClassLoader.java b/core/common/src/main/java/alluxio/extensions/ExtensionsClassLoader.java
index <HASH>..<HASH> 100644
--- a/core/common/src/main/java/alluxio/extensions/ExtensionsClassLoader.java
+++ b/core/common/src/main/java/alluxio/extensions/ExtensionsClassLoader.java
@@ -14,8 +14,10 @@ package alluxio.extensions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.util.Enumeration;
/**
* An isolated {@link ClassLoader} for loading extensions to core Alluxio. This class loader first
@@ -82,4 +84,15 @@ public class ExtensionsClassLoader extends URLClassLoader {
return mDefaultClassloader.loadClass(name, resolve);
}
}
+
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException {
+ Enumeration<URL> resources = super.getResources(name);
+ // Falls back to default class loader if not found in the URL class loader
+ if (!resources.hasMoreElements()) {
+ LOG.debug("Falling back to default class loader for loading resource {}", name);
+ return mDefaultClassloader.getResources(name);
+ }
+ return resources;
+ }
} | Add resource loading fallback logic to ExtensionClassLoader
Some extensions perform resource loading during initialization which can
fail in the URLClassLoader logic. This change adds a fallback logic to
look for resource in the default class loader.
pr-link: Alluxio/alluxio#<I>
change-id: cid-b<I>af6afc4b<I>fd7a7f<I>bf<I>de<I>c4f<I>c1c | Alluxio_alluxio | train | java |
ece89d8b1b55c795e1de3e8842e22ca3eebd3f3d | diff --git a/core.py b/core.py
index <HASH>..<HASH> 100644
--- a/core.py
+++ b/core.py
@@ -98,13 +98,15 @@ def setup (**attrs):
dist.run_commands ()
except KeyboardInterrupt:
raise SystemExit, "interrupted"
- except IOError, exc:
+ except (OSError, IOError), exc:
# arg, try to work with Python pre-1.5.2
if hasattr (exc, 'filename') and hasattr (exc, 'strerror'):
raise SystemExit, \
"error: %s: %s" % (exc.filename, exc.strerror)
else:
raise SystemExit, str (exc)
+ except DistutilsExecError, msg:
+ raise SystemExit, "error: " + str (msg)
# setup () | Beefed up error-handling in 'setup()' a smidge:
handle OSError and DistutilsExecError now. | pypa_setuptools | train | py |
3f1255057060038c8419d4da231d3070ce9b462b | diff --git a/dragnet/content_extraction_model.py b/dragnet/content_extraction_model.py
index <HASH>..<HASH> 100644
--- a/dragnet/content_extraction_model.py
+++ b/dragnet/content_extraction_model.py
@@ -60,12 +60,20 @@ class ContentExtractionModel(object):
self._threshold = thres
def analyze(self, s, blocks=False, encoding=None, parse_callback=None):
- """s = HTML string
- returns the content as a string, or if `block`, then the blocks
- themselves are returned.
-
- if encoding is not None, then this specifies the HTML string encoding.
- If None, then try to guess it.
+ """
+ Given an HTML string, extract just its main content or content+comments
+ and return it as a string or as a sequence of blocks.
+
+ Args:
+ s (str): a single HTML document as a string
+ blocks (bool): if True, return sequence of ``Block`` objects; if
+ False, return combined text from all blocks
+ encoding (str): the encoding used for ``s``; if None, the encoding
+ is guessed based on the HTML's content
+ parse_callback (Callable)
+
+ Returns:
+ str or List[``Block``]
"""
# blockify html into blocks
blocks_ = self._blockifier.blockify( | Updated docstring for main API method, .analyze() | dragnet-org_dragnet | train | py |
9bf3398ef5cfcbda03621d9e4685fd0e065d2678 | diff --git a/src/Horizon/Exception/PostTransactionException.php b/src/Horizon/Exception/PostTransactionException.php
index <HASH>..<HASH> 100644
--- a/src/Horizon/Exception/PostTransactionException.php
+++ b/src/Horizon/Exception/PostTransactionException.php
@@ -43,7 +43,8 @@ class PostTransactionException extends HorizonException
$ex->type = $horizonException->getType();
$ex->httpStatusCode = $horizonException->getHttpStatusCode();
$ex->detail = $horizonException->getDetail();
- $ex->resultCodes = $horizonException->getResultCodes();
+ $ex->operationResultCodes = $horizonException->getOperationResultCodes();
+ $ex->transactionResultCode = $horizonException->getTransactionResultCode();
$ex->message = $horizonException->getMessage();
$ex->raw = $horizonException->getRaw();
$ex->clientException = $horizonException->getClientException(); | PostTransactionException is now aware of transactionResultCode and operationResultCodes | zulucrypto_stellar-api | train | php |
57035ce4e5d20173908f94e214cdb78ffee26fec | diff --git a/main/src/main/java/com/google/android/apps/muzei/render/GLColorOverlay.java b/main/src/main/java/com/google/android/apps/muzei/render/GLColorOverlay.java
index <HASH>..<HASH> 100644
--- a/main/src/main/java/com/google/android/apps/muzei/render/GLColorOverlay.java
+++ b/main/src/main/java/com/google/android/apps/muzei/render/GLColorOverlay.java
@@ -109,7 +109,4 @@ class GLColorOverlay {
public void setColor(int color) {
mColor = color;
}
-
- public void destroy() {
- }
} | Remove empty destroy() method from GLColorOverlay | romannurik_muzei | train | java |
5a5a765ec251d4942dfb7e18c5be4ed881d07c27 | diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/environments/development.rb
+++ b/spec/dummy/config/environments/development.rb
@@ -6,8 +6,8 @@ Dummy::Application.configure do
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
+ config.eager_load = false
+ config.i18n.enforce_available_locales = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
@@ -19,16 +19,6 @@ Dummy::Application.configure do
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
- # Only use best-standards-support built into browsers
- config.action_dispatch.best_standards_support = :builtin
-
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
-
- # Log the query plan for queries taking more than this (works
- # with SQLite, MySQL, and PostgreSQL)
- config.active_record.auto_explain_threshold_in_seconds = 0.5
-
# Do not compress assets
config.assets.compress = false | Works with Rails<I> in development environment
This does not affect garage users but affects only garage development. | cookpad_garage | train | rb |
ddd2ca2c9f23388ecadfe558deb61dc95bdfa961 | diff --git a/ziggurat_foundations/ext/pyramid/get_user.py b/ziggurat_foundations/ext/pyramid/get_user.py
index <HASH>..<HASH> 100644
--- a/ziggurat_foundations/ext/pyramid/get_user.py
+++ b/ziggurat_foundations/ext/pyramid/get_user.py
@@ -17,13 +17,14 @@ def includeme(config):
session_provider_callable_config = settings.get(
"%s.session_provider_callable" % CONFIG_KEY
)
+ try_global_session = False
if not session_provider_callable_config:
def session_provider_callable(request):
return get_db_session()
- test_session_callable = None
+ try_global_session = True
else:
if callable(session_provider_callable_config):
session_provider_callable = session_provider_callable_config
@@ -31,14 +32,13 @@ def includeme(config):
parts = session_provider_callable_config.split(":")
_tmp = importlib.import_module(parts[0])
session_provider_callable = getattr(_tmp, parts[1])
- test_session_callable = "session exists"
# This function is bundled into the request, so for each request you can
# do request.user
def get_user(request):
userid = request.unauthenticated_userid
- if test_session_callable is None:
- # set db_session to none to pass to the UserModel.by_id
+ if try_global_session:
+ # set db_session to none to pass to the UserModel.by_id so it can try to autodiscover
db_session = None
else:
# Else assign the request.session | pyramid.ext.get_user: fixes for db session callable and readibility | ergo_ziggurat_foundations | train | py |
c78ecbaefe8434531ca9a36fa4a55621bac8baf3 | diff --git a/pyof/v0x04/common/action.py b/pyof/v0x04/common/action.py
index <HASH>..<HASH> 100644
--- a/pyof/v0x04/common/action.py
+++ b/pyof/v0x04/common/action.py
@@ -4,7 +4,8 @@ from enum import Enum
# Local source tree imports
from pyof.foundation.base import GenericStruct
-from pyof.foundation.basic_types import Pad, UBInt8, UBInt16, UBInt32
+from pyof.foundation.basic_types import (FixedTypeList, Pad, UBInt8, UBInt16,
+ UBInt32)
# Third-party imports
@@ -341,3 +342,18 @@ class ActionSetQueue(GenericStruct):
"""
super().__init__()
self.queue_id = queue_id
+
+
+class ListOfActions(FixedTypeList):
+ """List of actions.
+
+ Represented by instances of ActionHeader and used on ActionHeader objects.
+ """
+
+ def __init__(self, items=None):
+ """The constructor just assings parameters to object attributes.
+
+ Args:
+ items (ActionHeader): Instance or a list of instances.
+ """
+ super().__init__(pyof_class=ActionHeader, items=items) | [v0x<I>] Adding ListOfActions into action module | kytos_python-openflow | train | py |
9149fad29f920a2a26997c91cd680fbb24e34d32 | diff --git a/test/init.js b/test/init.js
index <HASH>..<HASH> 100644
--- a/test/init.js
+++ b/test/init.js
@@ -14,6 +14,8 @@ import firebaseConfig from './firebaseConfig.json';
let firebaseApp;
beforeAll(() => {
+ jest.setTimeout(10000);
+
// Initialize firebase
firebaseApp = firebase.initializeApp(firebaseConfig);
const firestore = firebase.firestore(); | Increased jest timeout to <I>sec, so firestore tests don’t bork as often | IjzerenHein_firestorter | train | js |
ed033bf7a249577809ea5e066c3655dd2aaa4035 | diff --git a/src/Application.php b/src/Application.php
index <HASH>..<HASH> 100644
--- a/src/Application.php
+++ b/src/Application.php
@@ -30,7 +30,7 @@ class Application extends Silex\Application
public function __construct(array $values = array())
{
$values['bolt_version'] = '2.2.0';
- $values['bolt_name'] = 'alpha';
+ $values['bolt_name'] = 'alpha1';
$values['bolt_released'] = false; // `true` for stable releases, `false` for alpha, beta and RC.
/** @internal Parameter to track a deprecated PHP version */ | Up $app['bolt_name'] to alpha1 to force cache dump | bolt_bolt | train | php |
8b7e0b27f229f30cb9d27dfd03b2444627a1eea7 | diff --git a/modules/uadetector-core/src/test/java/net/sf/uadetector/datastore/AbstractDataStoreTest3.java b/modules/uadetector-core/src/test/java/net/sf/uadetector/datastore/AbstractDataStoreTest3.java
index <HASH>..<HASH> 100644
--- a/modules/uadetector-core/src/test/java/net/sf/uadetector/datastore/AbstractDataStoreTest3.java
+++ b/modules/uadetector-core/src/test/java/net/sf/uadetector/datastore/AbstractDataStoreTest3.java
@@ -79,7 +79,7 @@ public class AbstractDataStoreTest3 {
@Test(expected = CanNotOpenStreamException.class)
public void construct_unreachable_url() {
final DataReader reader = new XmlDataReader();
- final String unreachable = "http://unreachable,local";
+ final String unreachable = "http://unreachable.local";
new TestDataStore(reader, unreachable, unreachable, CHARSET);
} | Changed unreachable URL for testing purposes (during errors on other
development system) | before_uadetector | train | java |
c8bc8ac892994a76f5c4ea2fdebc69694e5ba1f4 | diff --git a/Services/PaymentEventDispatcher.php b/Services/PaymentEventDispatcher.php
index <HASH>..<HASH> 100644
--- a/Services/PaymentEventDispatcher.php
+++ b/Services/PaymentEventDispatcher.php
@@ -13,7 +13,7 @@
namespace Mmoreram\PaymentCoreBundle\Services;
-use Symfony\Component\EventDispatcher\EventDispatcher;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Mmoreram\PaymentCoreBundle\Services\Interfaces\CartWrapperInterface;
use Mmoreram\PaymentCoreBundle\Services\Interfaces\PaymentBridgeInterface;
@@ -31,7 +31,7 @@ class PaymentEventDispatcher
{
/**
- * @var EventDispatcher
+ * @var EventDispatcherInterface
*
* Event dispatcher
*/
@@ -41,9 +41,9 @@ class PaymentEventDispatcher
/**
* Construct method
*
- * @param EventDispatcher $eventDispatcher Event dispatcher
+ * @param EventDispatcherInterface $eventDispatcher Event dispatcher
*/
- public function __construct(EventDispatcher $eventDispatcher)
+ public function __construct(EventDispatcherInterface $eventDispatcher)
{
$this->eventDispatcher = $eventDispatcher;
} | Updated casting for EventDispatcher
* Set as interface | PaymentSuite_paymentsuite | train | php |
36e958c979ad09bd0aa3e60d73c8ba8a0daca3b5 | diff --git a/unleash/unleash.py b/unleash/unleash.py
index <HASH>..<HASH> 100644
--- a/unleash/unleash.py
+++ b/unleash/unleash.py
@@ -102,7 +102,6 @@ class Unleash(object):
'commit': rcommit,
'opts': opts,
'info': info,
- 'issues': rissues.channel('collect'),
'log': log,
} | Removed useless dict value in context initialization. | mbr_unleash | train | py |
0c8d893ac547174155ce20e2014e1eb54b082feb | diff --git a/credentials/backends.py b/credentials/backends.py
index <HASH>..<HASH> 100644
--- a/credentials/backends.py
+++ b/credentials/backends.py
@@ -14,7 +14,10 @@ class JsonFileBackend(object):
self._path = path
def load(self, key):
- with open(self._path, 'r') as f:
- doc = json.load(f)
+ try:
+ with open(self._path, 'r') as f:
+ doc = json.load(f)
- return doc.get(key, None)
+ return doc.get(key, None)
+ except IOError:
+ return None | Do not fail if creds file is absent. | OniOni_credentials | train | py |
9456531a48f204d16fc8d30c01d0f93e421194b2 | diff --git a/tests/helpers.py b/tests/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -71,7 +71,7 @@ class YodaTestHelper(unittest.TestCase):
def assert_config_file_contains(self, config_file, expected):
"""Custom assert to check content of config_file."""
file = open(config_file)
- config = yaml.load(file.read())
+ config = yaml.safe_load(file.read())
file.close()
self.assertEqual(config, expected)
diff --git a/yoda/config.py b/yoda/config.py
index <HASH>..<HASH> 100644
--- a/yoda/config.py
+++ b/yoda/config.py
@@ -30,7 +30,7 @@ class Config(dict):
self.write()
else:
file = open(self.config_file)
- config = yaml.load(file.read())
+ config = yaml.safe_load(file.read())
file.close()
if config is not None:
self.update(config) | #<I> Switch to yaml.safe_load | Numergy_yoda | train | py,py |
9b6f0f70ce8265f44a65265b0192d34c11b1a4b7 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -234,7 +234,7 @@ gulp.task('demo:deploy', ['demo'], function () {
return gulp.src(path.join(config.tmp.demo, '/**/*'))
.pipe(ghPages({
cacheDir: config.tmp.deployDemo,
- remoteUrl: 'https://github.com/zalando/brand-solutions-dress-code.git'
+ remoteUrl: 'https://github.com/zalando/dress-code.git'
}));
});
@@ -325,7 +325,7 @@ gulp.task('dist:bower:deploy', ['dist:bower'], function () {
.pipe(ghPages({
cacheDir: config.tmp.deployBower,
branch: 'master',
- remoteUrl: 'git@github.com:zalando/brand-solutions-dress-code-bower'
+ remoteUrl: 'git@github.com:zalando/dress-code-bower'
}));
}); | refactor(project-name): updates the gulpfile fix #<I> | zalando_dress-code | train | js |
07a5ad86643fc14a944148d4af63dfe4ad2592e0 | diff --git a/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java b/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java
+++ b/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java
@@ -373,8 +373,8 @@ public class ArtifactoryGradleConfigurator extends BuildWrapper implements Deplo
if (getReleaseWrapper() != null) {
List<Action> actions = new ArrayList<Action>();
actions.addAll(action);
- actions.add(new GradleReleaseAction(project));
- actions.add(new GradleReleaseApiAction(project));
+ actions.add(new GradleReleaseAction((FreeStyleProject) project));
+ actions.add(new GradleReleaseApiAction((FreeStyleProject) project));
return actions;
}
return action; | HAP-<I> - support multi-configuration projects | jenkinsci_artifactory-plugin | train | java |
080699f7df86f472a99d181c46605391dfd99967 | diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go
index <HASH>..<HASH> 100644
--- a/cmd/swarm/main.go
+++ b/cmd/swarm/main.go
@@ -254,13 +254,11 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
boot := func(ctx *node.ServiceContext) (node.Service, error) {
var client *ethclient.Client
- if ethapi == "" {
- err = fmt.Errorf("use ethapi flag to connect to a an eth client and talk to the blockchain")
- } else {
+ if len(ethapi) > 0 {
client, err = ethclient.Dial(ethapi)
- }
- if err != nil {
- utils.Fatalf("Can't connect: %v", err)
+ if err != nil {
+ utils.Fatalf("Can't connect: %v", err)
+ }
}
return swarm.NewSwarm(ctx, client, bzzconfig, swapEnabled, syncEnabled)
} | cmd/swarm: ethapi not required | ethereum_go-ethereum | train | go |
92cfb3c72ea26781cca1e2ce493647bea4a22f7b | diff --git a/driver/src/test/acceptance/com/mongodb/acceptancetest/index/AddIndexAcceptanceTest.java b/driver/src/test/acceptance/com/mongodb/acceptancetest/index/AddIndexAcceptanceTest.java
index <HASH>..<HASH> 100644
--- a/driver/src/test/acceptance/com/mongodb/acceptancetest/index/AddIndexAcceptanceTest.java
+++ b/driver/src/test/acceptance/com/mongodb/acceptancetest/index/AddIndexAcceptanceTest.java
@@ -21,6 +21,7 @@ import com.mongodb.client.MongoCollection;
import com.mongodb.client.model.CreateIndexOptions;
import com.mongodb.operation.OrderBy;
import org.bson.Document;
+import org.junit.Ignore;
import org.junit.Test;
import static com.mongodb.operation.OrderBy.ASC;
@@ -199,6 +200,7 @@ public class AddIndexAcceptanceTest extends DatabaseTestCase {
}
@Test
+ @Ignore("Ingore until SERVER-16274 if resolved")
public void shouldCreateABackgroundIndex() {
collection.createIndex(new Document("theField", 1), new CreateIndexOptions().background(true)); | Temporarily ignoring test until SERVER-<I> is resolved, as this test causes a crash in a <I> replica set | mongodb_mongo-java-driver | train | java |
d16ba571455e9759824de951a68636a88ca5da2e | diff --git a/src/collectors/mountstats/mountstats.py b/src/collectors/mountstats/mountstats.py
index <HASH>..<HASH> 100755
--- a/src/collectors/mountstats/mountstats.py
+++ b/src/collectors/mountstats/mountstats.py
@@ -80,7 +80,7 @@ class MountStatsCollector(diamond.collector.Collector):
def get_default_config(self):
config = super(MountStatsCollector, self).get_default_config()
config.update({
- 'enabled': 'True',
+ 'enabled': 'False',
'exclude_filters': [],
'path': 'mountstats',
'method': 'Threaded' | removed auto-enable for mountstats collector | python-diamond_Diamond | train | py |
339d97a002a0d7743f2b45ebbbaa8f1acf0c36f6 | diff --git a/types/types.go b/types/types.go
index <HASH>..<HASH> 100644
--- a/types/types.go
+++ b/types/types.go
@@ -304,7 +304,7 @@ type VolumesListResponse struct {
}
// VolumeCreateRequest contains the response for the remote API:
-// POST "/volumes"
+// POST "/volumes/create"
type VolumeCreateRequest struct {
Name string // Name is the requested name of the volume
Driver string // Driver is the name of the driver that should be used to create the volume | rename `POST /volumes` to `POST /volumes/create` to be consistent with the other `POST /.../create` endpoints
see #<I> | docker_engine-api | train | go |
e32556257fab7cdf24dadf26fe2ffed9c8eb5493 | diff --git a/packages/ember-metal/lib/mixin.js b/packages/ember-metal/lib/mixin.js
index <HASH>..<HASH> 100644
--- a/packages/ember-metal/lib/mixin.js
+++ b/packages/ember-metal/lib/mixin.js
@@ -128,7 +128,7 @@ function giveDescriptorSuper(meta, key, property, values, descs) {
// it on the original object.
superProperty = superProperty || meta.descs[key];
- if (!superProperty || !(superProperty instanceof ComputedProperty)) {
+ if (superProperty === undefined || !(superProperty instanceof ComputedProperty)) {
return property;
}
@@ -155,7 +155,7 @@ function giveMethodSuper(obj, key, method, values, descs) {
superMethod = superMethod || obj[key];
// Only wrap the new method if the original method was a function
- if ('function' !== typeof superMethod) {
+ if (superMethod === undefined || 'function' !== typeof superMethod) {
return method;
} | micro-perf: out of <I>/<I> calls superMethod is undefined. | emberjs_ember.js | train | js |
fefbd223f4808b0193fed1a2741123ad23d6a1d0 | diff --git a/lib/UniAlteri/States/bootstrap.php b/lib/UniAlteri/States/bootstrap.php
index <HASH>..<HASH> 100644
--- a/lib/UniAlteri/States/bootstrap.php
+++ b/lib/UniAlteri/States/bootstrap.php
@@ -71,6 +71,7 @@ $diContainer->registerInstance(Loader\LoaderInterface::DI_LOADER_INSTANCE, $load
//Register autoload function in the spl autoloader stack
spl_autoload_register(
array($loader, 'loadClass'),
+ true,
true
); | register autoloader of states at top of the list | TeknooSoftware_states | train | php |
4e96c019a8eec59441fdc881f192cc6d46e18471 | diff --git a/base62.go b/base62.go
index <HASH>..<HASH> 100644
--- a/base62.go
+++ b/base62.go
@@ -6,12 +6,9 @@ package base62
import (
"errors"
"fmt"
- u "github.com/araddon/gou"
"io"
)
-var _ = u.EMPTY
-
// Encodings
type Encoding struct {
encode string | gou is not used.
This prevents gae usage as gou imports syscall | lytics_base62 | train | go |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.