text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
DNS: Change name value to "Answer". Add error checking of api_result. | (function(env){
'use strict';
env.ddg_spice_dns = function(api_result) {
if (!api_result || !DDG.getProperty(api_result, 'response.records').length) {
return Spice.failed('dns');
}
api_result.response.records.sort(function(a, b) {
if (a.type < b.type)
... | (function(env){
'use strict';
env.ddg_spice_dns = function(api_result) {
var records = DDG.getProperty(api_result, 'response.records');
if (!records.length) {
return Spice.failed('dns');
}
api_result.response.records.sort(function(a, b) {
if (a.type... |
Remove class in SpringBooTest annotation | package io.github.web.springtest;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.By;
import org.... | package io.github.web.springtest;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.By;
import org.... |
Upgrade tangled 1.0a11 => 1.0a12 | from setuptools import setup, PEP420PackageFinder
setup(
name='tangled.web',
version='1.0a13.dev0',
description='RESTful Web Framework',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.web/tags',
author='Wy... | from setuptools import setup, PEP420PackageFinder
setup(
name='tangled.web',
version='1.0a13.dev0',
description='RESTful Web Framework',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.web/tags',
author='Wy... |
Fix error in delete button in dashboard page | angular.module('zoomableApp').factory('servicesAPI', function($http, $q, Upload, $timeout) {
return {
createVideo : function(video) {
return $http.post('/api/video', video);
},
createAccount : function(accountData) {
return $http.post('/api/user/signup', accountData);
},
get : function... | angular.module('zoomableApp').factory('servicesAPI', function($http, $q, Upload, $timeout) {
return {
createVideo : function(video) {
return $http.post('/api/video', video);
},
createAccount : function(accountData) {
return $http.post('/api/user/signup', accountData);
},
get : function... |
Fix login issue with token | LoginController.$inject = ['$rootScope', '$location', 'auth',
'role', 'toaster', 'TbUtils'];
function LoginController ($rootScope, $location, auth, role, toaster, TbUtils) {
var vm = this;
vm.username = "";
vm.password = "";
vm.login = login;
vm.loading = false;
... | LoginController.$inject = ['$rootScope', '$location', 'auth',
'role', 'toaster', 'TbUtils'];
function LoginController ($rootScope, $location, auth, role, toaster, TbUtils) {
var vm = this;
vm.username = "";
vm.password = "";
vm.login = login;
vm.loading = false;
... |
Check if the file exists before doing anything else. | #!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
import argparse
import gzip
import os
def _parser():
parser = argparse.ArgumentParser(description='Prepare the data downloaded '
'from VALD.')
parser.add_argument('input', help='input compressed file', type=str)
... | #!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
import argparse
import gzip
def _parser():
parser = argparse.ArgumentParser(description='Prepare the data downloaded '
'from VALD.')
parser.add_argument('input', help='input compressed file')
parser.add_argumen... |
USe payout amount to calculate total | from babel.numbers import get_currency_name, get_currency_symbol
from bluebottle.utils.exchange_rates import convert
from django.db.models import Sum
from djmoney.money import Money
from bluebottle.funding.models import PaymentProvider
def get_currency_settings():
result = []
for provider in PaymentProvider.... | from babel.numbers import get_currency_name, get_currency_symbol
from bluebottle.utils.exchange_rates import convert
from django.db.models import Sum
from djmoney.money import Money
from bluebottle.funding.models import PaymentProvider
def get_currency_settings():
result = []
for provider in PaymentProvider.... |
Add newline to end of output. | <?php
/*
+------------------------------------------------------------------------+
| dd |
+------------------------------------------------------------------------+
| Copyright (c) 2016 Phalcon Team (https://www.phalconphp.com) |
+-----... | <?php
/*
+------------------------------------------------------------------------+
| dd |
+------------------------------------------------------------------------+
| Copyright (c) 2016 Phalcon Team (https://www.phalconphp.com) |
+-----... |
CRM-1974: Introduce transport settings - fixed flush of selected value | /*global define*/
define(['jquery', 'underscore', 'backbone'
], function ($, _, Backbone) {
'use strict';
/**
* @export oroemail/js/email/template/view
* @class oroemail.email.template.View
* @extends Backbone.View
*/
return Backbone.View.extend({
events: {
'c... | /*global define*/
define(['jquery', 'underscore', 'backbone'
], function ($, _, Backbone) {
'use strict';
/**
* @export oroemail/js/email/template/view
* @class oroemail.email.template.View
* @extends Backbone.View
*/
return Backbone.View.extend({
events: {
'c... |
Use new name of README. | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-authority',
version='0.7',
description=(
"A Django app that provides generic per-object-permissions "
"for Django's auth app."
... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-authority',
version='0.7',
description=(
"A Django app that provides generic per-object-permissions "
"for Django's auth app."
... |
Fix bad ref, forgot the __salt__ :P | '''
Disk monitoring state
Monitor the state of disk resources
'''
def status(name, max=None, min=None):
'''
Return the current disk usage stats for the named device
'''
# Monitoring state, no changes will be made so no test interface needed
ret = {'name': name,
'result': False,
... | '''
Disk monitoring state
Monitor the state of disk resources
'''
def status(name, max=None, min=None):
'''
Return the current disk usage stats for the named device
'''
# Monitoring state, no changes will be made so no test interface needed
ret = {'name': name,
'result': False,
... |
Add missing tests for interfaces | import unittest
import aiozmq
class ZmqTransportTests(unittest.TestCase):
def test_interface(self):
tr = aiozmq.ZmqTransport()
self.assertRaises(NotImplementedError, tr.write, [b'data'])
self.assertRaises(NotImplementedError, tr.abort)
self.assertRaises(NotImplementedError, tr.get... | import unittest
import aiozmq
class ZmqTransportTests(unittest.TestCase):
def test_interface(self):
tr = aiozmq.ZmqTransport()
self.assertRaises(NotImplementedError, tr.write, [b'data'])
self.assertRaises(NotImplementedError, tr.abort)
self.assertRaises(NotImplementedError, tr.get... |
Fix unicode error when showing voucher error message | from django import forms
from django.utils.translation import pgettext_lazy
from .models import Voucher, NotApplicable
class VoucherField(forms.ModelChoiceField):
default_error_messages = {
'invalid_choice': pgettext_lazy(
'voucher', pgettext_lazy(
'voucher', 'Discount code i... | from django import forms
from django.utils.translation import pgettext_lazy
from .models import Voucher, NotApplicable
class VoucherField(forms.ModelChoiceField):
default_error_messages = {
'invalid_choice': pgettext_lazy(
'voucher', pgettext_lazy(
'voucher', 'Discount code i... |
Handle missing title localisation file. | /**
* i18n plugin
* register handlebars handler which looks up translations in a dictionary
*/
var path = require("path");
var fs = require("fs");
var handlebars = require("handlebars");
module.exports = function makePlugin() {
return function (opts) {
var data = {
"en": {}
... | /**
* i18n plugin
* register handlebars handler which looks up translations in a dictionary
*/
var path = require("path");
var fs = require("fs");
var handlebars = require("handlebars");
module.exports = function makePlugin() {
return function (opts) {
var data = {
"en": {}
... |
Remove atFile entries when we remove files | <?php
namespace Concrete\Core\Entity\Attribute\Value\Value;
use Concrete\Core\File\FileProviderInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="atFile")
*/
class ImageFileValue extends AbstractValue implements FileProviderInterface
{
/**
* @ORM\ManyToOne(targetEntity="\Conc... | <?php
namespace Concrete\Core\Entity\Attribute\Value\Value;
use Concrete\Core\File\FileProviderInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="atFile")
*/
class ImageFileValue extends AbstractValue implements FileProviderInterface
{
/**
* @ORM\ManyToOne(targetEntity="\Conc... |
Add user key for names | const Router = require("falcor-router");
const $ref = require('falcor').Model.ref;
const User = require("./models/User");
const mock = {
content: 'content',
sub: 'subtitle',
};
module.exports = new Router([
{
route: "title",
get: (path) => {
console.log('path:', path);
return { path: [ "titl... | const Router = require("falcor-router");
const $ref = require('falcor').Model.ref;
const User = require("./models/User");
const mock = {
content: 'content',
sub: 'subtitle',
};
module.exports = new Router([
{
route: "title",
get: (path) => {
console.log('path:', path);
return { path: [ "titl... |
Stop including sourcemap for production mode | const path = require('path');
const webpack = require('webpack');
const nodeEnv = process.env.NODE_ENV || 'development';
const { VueLoaderPlugin } = require('vue-loader');
const config = {
mode: nodeEnv,
entry: "./src/entries/dist.js",
devtool: (nodeEnv === 'production') ? undefined : 'inline-source-map',
outp... | const path = require('path');
const webpack = require('webpack');
const nodeEnv = process.env.NODE_ENV || 'development';
const { VueLoaderPlugin } = require('vue-loader');
const config = {
mode: nodeEnv,
entry: "./src/entries/dist.js",
output: {
path: path.join(__dirname, 'dist'),
filename: "h5p-audio-re... |
Add get_property, set_property and delete_property functions | from devicehive.handler import Handler
from devicehive.device_hive import DeviceHive
class ApiCallHandler(Handler):
"""Api call handler class."""
def __init__(self, api, call, *call_args, **call_kwargs):
super(ApiCallHandler, self).__init__(api)
self._call = call
self._call_args = cal... | from devicehive.handler import Handler
from devicehive.device_hive import DeviceHive
class ApiCallHandler(Handler):
"""Api call handler class."""
def __init__(self, api, call, *call_args, **call_kwargs):
super(ApiCallHandler, self).__init__(api)
self._call = call
self._call_args = cal... |
[CONSISTENCY] Add newline between different phpdoc tag in docBlock | <?php
/**
* @author Pierre-Henry Soria <hello@ph7cms.com>
* @copyright (c) 2018-2019, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Core / Class
*/
namespac... | <?php
/**
* @author Pierre-Henry Soria <hello@ph7cms.com>
* @copyright (c) 2018-2019, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @package PH7 / App / System / Core / Class
*/
namespac... |
Set cov-core dependency to 1.8 | import setuptools
setuptools.setup(name='pytest-cov',
version='1.6',
description='py.test plugin for coverage reporting with '
'support for both centralised and distributed testing, '
'including subprocesses and multiprocessing',
long... | import setuptools
setuptools.setup(name='pytest-cov',
version='1.6',
description='py.test plugin for coverage reporting with '
'support for both centralised and distributed testing, '
'including subprocesses and multiprocessing',
long... |
Add help text to enterprise settings | hqDefine("accounting/js/enterprise_settings", [
'jquery',
'knockout',
'underscore',
'hqwebapp/js/assert_properties',
'hqwebapp/js/initial_page_data',
], function(
$,
ko,
_,
assertProperties,
initialPageData
) {
var settingsFormModel = function(options) {
assertPropert... | hqDefine("accounting/js/enterprise_settings", [
'jquery',
'knockout',
'underscore',
'hqwebapp/js/assert_properties',
'hqwebapp/js/initial_page_data',
], function(
$,
ko,
_,
assertProperties,
initialPageData
) {
var settingsFormModel = function(options) {
assertPropert... |
Set classes for showing the lists horizontally | import React from 'react';
import { List, ListSubHeader, ListCheckbox } from 'react-toolbox/lib/list';
const SponsorAffinities = () => {
return (
<div className="horizontal">
<List selectable ripple className="horizontalChild">
<ListSubHeader caption='list_a' />
<ListCheckbox
... | import React from 'react';
import { List, ListSubHeader, ListCheckbox } from 'react-toolbox/lib/list';
const SponsorAffinities = () => {
return (
<div>
<List selectable ripple>
<ListSubHeader caption='list_a' />
<ListCheckbox
caption='affinity'
ch... |
Add support for partial JSON messages from the server. | 'use strict';
var React = require('react');
var WebSocket = require('ws');
module.exports = React.createClass({
propTypes: {
url: React.PropTypes.string.isRequired,
onMessage: React.PropTypes.func.isRequired,
debug: React.PropTypes.bool
},
getDefaultProps: function () {
r... | 'use strict';
var React = require('react');
var WebSocket = require('ws');
module.exports = React.createClass({
propTypes: {
url: React.PropTypes.string.isRequired,
onMessage: React.PropTypes.func.isRequired,
debug: React.PropTypes.bool
},
getDefaultProps: function () {
r... |
Set object id and initiate parent_ids array | (function (tree) {
tree.Extend = function Extend(selector, option, index) {
this.selector = selector;
this.option = option;
this.index = index;
this.object_id = tree.Extend.next_id++;
this.parent_ids = [this.object_id];
switch(option) {
case "all":
this.allowBefore = true;
... | (function (tree) {
tree.Extend = function Extend(selector, option, index) {
this.selector = selector;
this.option = option;
this.index = index;
switch(option) {
case "all":
this.allowBefore = true;
this.allowAfter = true;
break;
default:
this... |
Add implemented interfaces to rule history | /**
* @license
* Copyright 2019 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'foam.nanos.ruler',
name: 'RuleHistory',
documentation: 'Represents rule execution history.',
implements: [
'foam.nanos.auth.CreatedAware',
'foam.nanos.auth.... | /**
* @license
* Copyright 2019 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'foam.nanos.ruler',
name: 'RuleHistory',
documentation: 'Represents rule execution history.',
properties: [
{
class: 'Long',
name: 'id',
visibil... |
Create an HTTP with a coordinator. | #!/usr/bin/env/node
/*
Provide a command-line interface for `reconfigure`.
___ greeting, usage ___ en_US ___
usage: node.bin.js
___ serve, usage ___ en_US ___
usage: node bin.js reconfigure server
options:
-l, --listen [string] IP and port to bind to.
-i, --id [string] reconfigu... | #!/usr/bin/env/node
/*
Provide a command-line interface for `reconfigure`.
___ greeting, usage ___ en_US ___
usage: node.bin.js
___ serve, usage ___ en_US ___
usage: node bin.js reconfigure server
options:
-l, --listen [string] IP and port to bind to.
-i, --id [string] reconfigu... |
Add link for domains section | import React from 'react';
import { c } from 'ttag';
import {
useEventManager,
useOrganization,
useDomains,
SubTitle,
Alert,
PrimaryButton,
Button,
Block,
useModal
} from 'react-components';
import DomainModal from './DomainModal';
import DomainsTable from './DomainsTable';
const D... | import React from 'react';
import { c } from 'ttag';
import {
useEventManager,
useOrganization,
useDomains,
SubTitle,
Alert,
PrimaryButton,
Button,
Block,
useModal
} from 'react-components';
import DomainModal from './DomainModal';
import DomainsTable from './DomainsTable';
const D... |
Add some `toString` conversions (required by MongoDB) | module.exports = function(sugar, schemas, assert, api) {
return function(cb) {
api.create(null, function(err, d) {
var name = d.name + d.name;
d.name = name;
sugar.update(schemas.Author, d._id, d, function(err, d) {
assert.equal(d.name, name);
... | module.exports = function(sugar, schemas, assert, api) {
return function(cb) {
api.create(null, function(err, d) {
var name = d.name + d.name;
d.name = name;
sugar.update(schemas.Author, d._id, d, function(err, d) {
assert.equal(d.name, name);
... |
Replace all occurances of $graph->getNumberOfEdges()
replaced with count($graph->getEdges()) | <?php
use Fhaculty\Graph\Algorithm\Complete;
use Fhaculty\Graph\Algorithm\Directed;
use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Loader\CompleteGraph;
class CompleteGraphTest extends TestCase
{
public function testOne()
{
$loader = new CompleteGraph(1);
$graph = $loader->createGraph();
... | <?php
use Fhaculty\Graph\Algorithm\Complete;
use Fhaculty\Graph\Algorithm\Directed;
use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Loader\CompleteGraph;
class CompleteGraphTest extends TestCase
{
public function testOne()
{
$loader = new CompleteGraph(1);
$graph = $loader->createGraph();
... |
Move app name log to timestamp | 'use strict';
const winston = require('winston');
// Setup winston default instance
const LOGGER_LEVEL = process.env.LOGGER_LEVEL || 'info';
const LOGGER_TIMESTAMP = !(process.env.LOGGER_TIMESTAMP === 'false');
const LOGGER_COLORIZE = !(process.env.LOGGER_COLORIZE === 'false');
const LOGGER_PRETTY_PRINT = !(process.e... | 'use strict';
const winston = require('winston');
// Setup winston default instance
const LOGGER_LEVEL = process.env.LOGGER_LEVEL || 'info';
const LOGGER_TIMESTAMP = !(process.env.LOGGER_TIMESTAMP === 'false');
const LOGGER_COLORIZE = !(process.env.LOGGER_COLORIZE === 'false');
const LOGGER_PRETTY_PRINT = !(process.e... |
Make cities a property, set inside constructor | <?php
namespace SepomexPhp;
class Locations implements \IteratorAggregate, \Countable
{
/** @var Location[] */
private $collection;
/** @var Cities */
private $cities;
public function __construct(Location ...$location)
{
$this->collection = $location;
$this->cities = $this->ex... | <?php
namespace SepomexPhp;
class Locations implements \IteratorAggregate, \Countable
{
/** @var Location[] */
private $collection;
public function __construct(Location ...$location)
{
$this->collection = $location;
public static function extractUniqueCities(Location ...$locations): Citie... |
Tag searching now really works! | module.exports = function (models) {
const {
Photo,
User
} = models;
return {
searchPhotos(pattern) {
let regex = new RegExp(pattern, 'i');
return new Promise((resolve, reject) => {
Photo.find({
$or: [{
... | module.exports = function (models) {
const {
Photo,
User
} = models;
return {
searchPhotos(pattern) {
let regex = new RegExp(pattern, 'i');
return new Promise((resolve, reject) => {
Photo.find({
$or: [{
... |
Update: Remove unused variable and import | var minimatch = require('minimatch');
var cheerio = require('cheerio');
var marked = require('marked');
var config = require('../config/marked');
marked.setOptions(config);
function plugin(opts) {
return function(files, metalsmith, done) {
// Get global metadata.
var metadata = metalsmith.metadata();
//... | var minimatch = require('minimatch');
var cheerio = require('cheerio');
var extend = require('extend');
var marked = require('marked');
var config = require('../config/marked');
marked.setOptions(config);
function plugin(opts) {
return function(files, metalsmith, done) {
// Get global metadata.
var metadata... |
Exit early if MySql is not present. Fixes MySql not installed message being displayed when database creation was successful. | <?php
namespace App\Actions;
use App\Shell\Shell;
use Symfony\Component\Process\ExecutableFinder;
class CreateDatabase
{
use LamboAction;
protected $finder;
protected $shell;
public function __construct(Shell $shell, ExecutableFinder $finder)
{
$this->finder = $finder;
$this->sh... | <?php
namespace App\Actions;
use App\Shell\Shell;
use Symfony\Component\Process\ExecutableFinder;
class CreateDatabase
{
use LamboAction;
protected $finder;
protected $shell;
public function __construct(Shell $shell, ExecutableFinder $finder)
{
$this->finder = $finder;
$this->sh... |
Include enum class name when using flags. | package wge3.game.entity.creatures;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import wge3.game.engine.constants.StateFlag;
import static wge3.game.engine.constants.Team.PlayerTeam;
public final class Player ... | package wge3.game.entity.creatures;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import static wge3.game.engine.constants.StateFlag.PICKS_UP_ITEMS;
import static wge3.game.engine.constants.Team.PlayerTeam;
publ... |
fix(Build): Stop cssnano from removing needed vendor prefixes.
cssnano was removing `-webkit` properties that were needed to support older versions of iOS. This
commit passes a list of supported browsers to cssnano so that such prefixed properties make it into
the nano-ified CSS. | (function () {
'use strict';
module.exports = function (gulp, plugins, config) {
return function () {
var supported =
['last 10 Chrome versions',
'last 10 Firefox versions',
'Safari >= 9',
'ie >= 9',
'Edge >= 1',
'iOS >= 8',
'Android >= 4.4'];... | (function () {
'use strict';
module.exports = function (gulp, plugins, config) {
return function () {
var source = gulp.src([config.patternsPath + '/**/*.scss', config.templatesPath + '/scss/**/*.scss'])
.pipe(plugins.plumber({ errorHandler: plugins.notify.onError('Error: <%= error.message %>') }... |
Add decimal types to Garmin PGRME fields. | # Garmin
from decimal import Decimal
from ... import nmea
class GRM(nmea.ProprietarySentence):
sentence_types = {}
def __new__(_cls, manufacturer, data):
name = manufacturer + data[0]
cls = _cls.sentence_types.get(name, _cls)
return super(GRM, cls).__new__(cls)
def... | # Garmin
from ... import nmea
class GRM(nmea.ProprietarySentence):
sentence_types = {}
def __new__(_cls, manufacturer, data):
name = manufacturer + data[0]
cls = _cls.sentence_types.get(name, _cls)
return super(GRM, cls).__new__(cls)
def __init__(self, manufacturer, d... |
Remove l2 from lm_default_config since it is currently unused | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... | lm_default_config = {
### GENERAL
'seed': None,
'verbose': True,
'show_plots': True,
### TRAIN
'train_config': {
# Classifier
# Class balance (if learn_class_balance=False, fix to class_balance)
'learn_class_balance': False,
# Class balance initialization / p... |
Fix SerialConnection.close() with invalid device. | from serial import serial_for_url
from .connection import BufferTooShort, Connection, TimeoutError
class SerialConnection(Connection):
__serial = None
def __init__(self, url, timeout=None):
self.__serial = serial_for_url(url, baudrate=19200, timeout=timeout)
def close(self):
if self.__... | from serial import serial_for_url
from .connection import BufferTooShort, Connection, TimeoutError
class SerialConnection(Connection):
def __init__(self, url, timeout=None):
self.__serial = serial_for_url(url, baudrate=19200, timeout=timeout)
def close(self):
self.__serial.close()
def r... |
Update user plugin to use deduped kolibri module. | const KolibriModule = require('kolibri.coreModules.kolibriModule');
const coreActions = require('kolibri.coreVue.vuex.actions');
const router = require('kolibri.coreVue.router');
const Vue = require('kolibri.lib.vue');
const RootVue = require('./vue');
const actions = require('./actions');
const store = require('./st... | const KolibriModule = require('kolibri_module');
const coreActions = require('kolibri.coreVue.vuex.actions');
const router = require('kolibri.coreVue.router');
const Vue = require('kolibri.lib.vue');
const RootVue = require('./vue');
const actions = require('./actions');
const store = require('./state/store');
const ... |
Remove warning about lizmap_search
Quick fix FTW! | <?php
/**
* Lizmap FTS searcher.
*
* @author 3liz
* @copyright 2017 3liz
*
* @see http://3liz.com
*
* @license Mozilla Public License : http://www.mozilla.org/MPL/
*/
class lizmapFtsSearchListener extends jEventListener
{
public function onsearchServiceItem($event)
{
// Check if need... | <?php
/**
* Lizmap FTS searcher.
*
* @author 3liz
* @copyright 2017 3liz
*
* @see http://3liz.com
*
* @license Mozilla Public License : http://www.mozilla.org/MPL/
*/
class lizmapFtsSearchListener extends jEventListener
{
public function onsearchServiceItem($event)
{
// Check if need... |
Remove redundant array check found by Psalm | <?php
/*
* This file is a part of dflydev/dot-access-data.
*
* (c) Dragonfly Development Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Dflydev\DotAccessData;
class Util
{
/**
* Test if array is an assoc... | <?php
/*
* This file is a part of dflydev/dot-access-data.
*
* (c) Dragonfly Development Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Dflydev\DotAccessData;
class Util
{
/**
* Test if array is an assoc... |
Fix migration rollback for ban_reason_improvements - is_default still exists | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class BanReasonImprovements extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('mship_note_type', function(Blueprint $table) {
... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class BanReasonImprovements extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('mship_note_type', function(Blueprint $table) {
... |
Add the GitHub issue number as a new line in the commitMessage field. | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... | # -*- coding: utf-8 -*-
from AbstractVisitor import AbstractVisitor
from duralex.alinea_parser import *
from github import Github
class AddGitHubIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.github = Github(args.github_token)
self.repo = self.github.get_repo(args.github_repositor... |
Add broadcasting of login event for non-github login | angular.module('codebrag.auth')
.factory('authService', function($http, httpRequestsBuffer, $q, $rootScope, events) {
var authService = {
loggedInUser: undefined,
login: function(user) {
var loginRequest = $http.post('rest/users', user, {bypassQueue: true});
... | angular.module('codebrag.auth')
.factory('authService', function($http, httpRequestsBuffer, $q, $rootScope, events) {
var authService = {
loggedInUser: undefined,
login: function(user) {
var loginRequest = $http.post('rest/users', user, {bypassQueue: true});
... |
Use random_element instead of random.choice | # -*- coding: utf-8 -*-
from faker.providers import BaseProvider
from .mimetypes import mime_types
class WebProvider(BaseProvider):
"""
A Provider for web-related test data.
>>> from faker import Faker
>>> from faker_web import WebProvider
>>> fake = Faker()
>>> fake.add_provider(WebProvider... | # -*- coding: utf-8 -*-
from random import choice
from faker.providers import BaseProvider
from .mimetypes import mime_types
class WebProvider(BaseProvider):
"""
A Provider for web-related test data.
>>> from faker import Faker
>>> from faker_web import WebProvider
>>> fake = Faker()
>>> fa... |
Add JSONP notice to API | from flask import jsonify, request
from functools import wraps
import json
jsonp_notice = """
// MediaCrush supports Cross Origin Resource Sharing requests.
// There is no reason to use JSONP; please use CORS instead.
// For more information, see https://mediacru.sh/docs/api"""
def json_output(f):
@wraps(f)
d... | from flask import jsonify, request
from functools import wraps
import json
def json_output(f):
@wraps(f)
def wrapper(*args, **kwargs):
def jsonify_wrap(obj):
callback = request.args.get('callback', False)
jsonification = jsonify(obj)
if callback:
jso... |
Update the zip task to dist and correct api task | 'use strict';
module.exports = function (grunt) {
// Load the project's grunt tasks from a directory
require('grunt-config-dir')(grunt, {
configDir: require('path').resolve('tasks')
});
/*
* Register group tasks
*/
//npm install
grunt.registerTask('npm_install', 'install d... | 'use strict';
module.exports = function (grunt) {
// Load the project's grunt tasks from a directory
require('grunt-config-dir')(grunt, {
configDir: require('path').resolve('tasks')
});
/*
* Register group tasks
*/
//npm install
grunt.registerTask('npm_install', 'install d... |
Update enum value to an is-instance check | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... | from __future__ import absolute_import
from enum import Enum
from typing import TypeVar, Optional, Any, Type # noqa
from odin.exceptions import ValidationError
from . import Field
__all__ = ("EnumField",)
ET = TypeVar("ET", Enum, Enum)
class EnumField(Field):
"""
Field for handling Python enums.
"""... |
Move ViewExceptionMapper to an ExtendedExceptionMapper | package io.dropwizard.views;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.glassfish.jersey.spi.ExtendedExceptionMapper;
import org.slf4j.Logger;
imp... | package io.dropwizard.views;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An {@link ExceptionMapper} that return... |
Fix a bad call to "writeInfo()" in "bin/phd stop" with no PHABRICATOR_INSTANCE defined
Summary: See <https://discourse.phabricator-community.org/t/phd-status-calls-to-undefined-method-when-theres-no-instance/2918>. This call should be `logInfo()`.
Test Plan:
- Purged `PHABRICATOR_INSTANCE` from my environment. In a... | <?php
final class PhabricatorDaemonManagementStatusWorkflow
extends PhabricatorDaemonManagementWorkflow {
protected function didConstruct() {
$this
->setName('status')
->setSynopsis(pht('Show daemon processes on this host.'));
}
public function execute(PhutilArgumentParser $args) {
$proce... | <?php
final class PhabricatorDaemonManagementStatusWorkflow
extends PhabricatorDaemonManagementWorkflow {
protected function didConstruct() {
$this
->setName('status')
->setSynopsis(pht('Show daemon processes on this host.'));
}
public function execute(PhutilArgumentParser $args) {
$proce... |
Fix typo in SeedMixin.tearDownClass name | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... | # -*- coding: utf-8 -*-
"""
sqlalchemy_seed.seed_mixin
~~~~~~~~~~~~~~~~~~~~~~~~~~
Mixin class for unittest.
:copyright: (c) 2017 Shinya Ohyanagi, All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from . import (
create_table,
drop_table,
load_fixture_files,
loa... |
Fix crash on game creation | import Queue
import json
import EBQP
from . import world
from . import types
from . import consts
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request... | import Queue
import json
import EBQP
from . import world
from . import types
from . import consts
class GameRequestHandler:
def __init__(self):
self.world = None
self.responses = {
EBQP.new: self.respond_new,
}
def process(self, request):
request_pieces = request... |
fix: Create tmp dir inside homedir | const chalk = require('chalk');
const fs = require('mz/fs');
const run = require('./run');
const homedir = require('os').homedir();
async function importFromGit({
db,
repo,
branch = 'master',
tmpDir = `${homedir}/__tmp-mongo-git-backup`,
checkout,
}) {
console.log(chalk.yellow('Starting mongo... | const chalk = require('chalk');
const fs = require('mz/fs');
const run = require('./run');
async function importFromGit({
db,
repo,
branch = 'master',
tmpDir = `${__dirname}/__tmp`,
checkout,
}) {
console.log(chalk.yellow('Starting mongodb import'));
console.log(chalk.cyan('Cleaning up (i... |
Fix optional duration for connection accesses | const { DataTypes } = require('sequelize');
module.exports = function (sequelize) {
const ConnectionAccesses = sequelize.define(
'ConnectionAccesses',
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
connectionId: {
type: DataTypes.S... | const { DataTypes } = require('sequelize');
module.exports = function (sequelize) {
const ConnectionAccesses = sequelize.define(
'ConnectionAccesses',
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
connectionId: {
type: DataTypes.S... |
Allow specification of GALAPAGOS bands | # coding: utf-8
def galapagos_to_pandas(in_filename='/home/ppzsb1/quickdata/GAMA_9_all_combined_gama_only_bd6.fits',
out_filename=None, bands='RUGIZYJHK'):
"""Convert a GALAPAGOS multi-band catalogue to a pandas-compatible HDF5 file"""
from astropy.io import fits
import pandas as pd... | # coding: utf-8
def galapagos_to_pandas(in_filename='/home/ppzsb1/quickdata/GAMA_9_all_combined_gama_only_bd6.fits',
out_filename=None):
"""Convert a GALAPAGOS multi-band catalogue to a pandas-compatible HDF5 file"""
from astropy.io import fits
import pandas as pd
import re
... |
indexes: Fix acceptance test for MongoDB 2.0
There were some minor changes for the test to work properly
with 2.0:
- The index versions are now 1 instead of 0
Don't bother checking the version of index since scalymongo has no
control over it.
- The `unique` key is now only provided when ``True`` | from tests.acceptance.base_acceptance_test import BaseAcceptanceTest
from scalymongo import Document
class IndexTestDocument(Document):
structure = {
'number': int,
'name': unicode,
'descending': int,
'ascending': int,
}
indexes = [
{'fields': 'number'},
{'f... | from tests.acceptance.base_acceptance_test import BaseAcceptanceTest
from scalymongo import Document
class IndexTestDocument(Document):
structure = {
'number': int,
'name': unicode,
'descending': int,
'ascending': int,
}
indexes = [
{'fields': 'number'},
{'f... |
Raise RuntimeError if __version__ is not found | from setuptools import setup
def get_version():
import re
with open('lastpass/__init__.py', 'r') as f:
for line in f:
m = re.match(r'__version__ = [\'"]([^\'"]*)[\'"]', line)
if m:
return m.group(1)
raise RuntimeError('Cannot find version information')
set... | from setuptools import setup
def get_version():
import re
with open('lastpass/__init__.py', 'r') as f:
for line in f:
m = re.match(r'__version__ = [\'"]([^\'"]*)[\'"]', line)
if m:
return m.group(1)
return ''
setup(
name='lastpass-python',
version=... |
Change that line to see if maybe that's the culprit | <h3>Change Access</h3>
<form class="form-horizontal">
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-8 control-label" for="access-type">Select Access Type</label>
<div class="col-md-8">
<?php
$types = $dal->getAccessTypes();
$selected_user = $_GET['for'];
$curr ... | <h3>Change Access</h3>
<form class="form-horizontal">
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-8 control-label" for="access-type">Select Access Type</label>
<div class="col-md-8">
<?php
$types = $dal->getAccessTypes();
$selected_user = $_GET['for'];
$curr ... |
Clean up response to no queries. | """
This prints the state of a facet query.
It is used for debugging the faceting system.
"""
from django.core.management.base import BaseCommand
from haystack.query import SearchQuerySet
from hs_core.discovery_parser import ParseSQ
class Command(BaseCommand):
help = "Print debugging information about logical fi... | """
This prints the state of a facet query.
It is used for debugging the faceting system.
"""
from django.core.management.base import BaseCommand
from haystack.query import SearchQuerySet
from hs_core.discovery_parser import ParseSQ
class Command(BaseCommand):
help = "Print debugging information about logical fi... |
Update script for explicit call to EM algorithm optimization | #!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import pipeline
from ddb_ngsflow.rna import salmon
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_a... | #!/usr/bin/env python
# Standard packages
import sys
import argparse
# Third-party packages
from toil.job import Job
# Package methods
from ddb import configuration
from ddb_ngsflow import pipeline
from ddb_ngsflow.rna import salmon
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_a... |
Create or recreate sequence counters for Monogo database objects | // Create (or recreate) ID counters for our various entities
db.counters.insert(
{
_id: "cemetery",
seq: 0,
}
)
db.counters.insert(
{
_id: "geolocation",
seq: 0, ... | db.counters.insert(
{
_id: "cemetery",
seq: 0,
}
)
db.counters.insert(
{
_id: "geolocation",
seq: 0,
}
)
db.counters.insert(
{ ... |
Fix NOTICE error on PHP 7.4: Trying to access array offset on value of type null | <?php
namespace Hmaus\Reynaldo\Elements;
class HttpResponseElement extends BaseElement implements ApiElement, ApiHttpResponse
{
public function getStatusCode()
{
return isset($this->attributes['statusCode']) ? (int)$this->attributes['statusCode'] : 0;
}
public function getHeaders()
{
... | <?php
namespace Hmaus\Reynaldo\Elements;
class HttpResponseElement extends BaseElement implements ApiElement, ApiHttpResponse
{
public function getStatusCode()
{
return (int)$this->attributes['statusCode'];
}
public function getHeaders()
{
$headersFromAttributes = $this->getAttrib... |
Set a starting point for the datatables | <?php
namespace MindOfMicah\LaravelDatatables;
use Illuminate\Http\JsonResponse;
class Datatable
{
protected $model;
protected $columns;
public function __construct($a) {
$this->a = $a;
}
public function asJsonResponse()
{
$data = [];
$total = $amount_displayed = 0;
... | <?php
namespace MindOfMicah\LaravelDatatables;
use Illuminate\Http\JsonResponse;
class Datatable
{
protected $model;
protected $columns;
public function __construct($a) {
$this->a = $a;
}
public function asJsonResponse()
{
$data = [];
$total = $amount_displayed = 0;
... |
Fix: Add missing $ before parameter name in docblock | <?php
namespace League\Route;
trait RouteConditionTrait
{
/**
* @var string
*/
protected $host;
/**
* @var string
*/
protected $name;
/**
* @var string
*/
protected $scheme;
/**
* Get the host.
*
* @return string
*/
public function g... | <?php
namespace League\Route;
trait RouteConditionTrait
{
/**
* @var string
*/
protected $host;
/**
* @var string
*/
protected $name;
/**
* @var string
*/
protected $scheme;
/**
* Get the host.
*
* @return string
*/
public function g... |
Include logger name for java util log handler
When using the log4j java util logger bridge handler, logs now show
`asciidoctor` instead of `unknown.jul.logger` for logger name.
fixes #833 | package org.asciidoctor.jruby.log.internal;
import org.asciidoctor.log.LogHandler;
import org.asciidoctor.log.LogRecord;
import org.asciidoctor.log.Severity;
import java.util.logging.Level;
import java.util.logging.Logger;
public class JULLogHandler implements LogHandler {
private final static String LOGGER_NAM... | package org.asciidoctor.jruby.log.internal;
import org.asciidoctor.log.LogHandler;
import org.asciidoctor.log.LogRecord;
import org.asciidoctor.log.Severity;
import java.util.logging.Level;
import java.util.logging.Logger;
public class JULLogHandler implements LogHandler {
private final static Logger LOGGER = L... |
Repair some merge errors before do somethink. | <?php
use yii\helpers\Html;
//use yii\widgets\ActiveForm;
use kartik\form\ActiveForm;
/* @var $this yii\web\View */
/* @var $model frontend\models\Queen */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="queen-form">
<?php $form = ActiveForm::begin(); ?>
<div class="row">
<div class="c... | <?php
use yii\helpers\Html;
//use yii\widgets\ActiveForm;
use kartik\form\ActiveForm;
/* @var $this yii\web\View */
/* @var $model frontend\models\Queen */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="queen-form">
<?php $form = ActiveForm::begin(); ?>
<div class="row">
<div class="c... |
Check for badly formatted props | 'use strict'
module.exports = {
description: "A basic React component",
generateReplacements(args) {
let propTypes = "";
let defaultProps = "";
if(args.length) {
propTypes = "__name__.propTypes = {";
defaultProps = "\n getDefaultProps: function() {";
... | 'use strict'
module.exports = {
description: "A basic React component",
generateReplacements(args) {
let propTypes = "";
let defaultProps = "";
if(args.length) {
propTypes = "__name__.propTypes = {";
defaultProps = "\n getDefaultProps: function() {";
... |
Fix possible problem with middleware | from functools import update_wrapper, wraps
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.decorators import available_attrs
from django.utils.http import urlquote
def facebook_required(function=None, redirect_field_name=REDIRECT... | from functools import update_wrapper, wraps
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.decorators import available_attrs
from django.utils.http import urlquote
def facebook_required(function=None, redirect_field_name=REDIRECT... |
TST: Clean up parent temporary directory | # coding: utf-8
import logging
import os
import shutil
import sys
import tempfile
import unittest
import six
import fiona
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
class UnicodePathTest(unittest.TestCase):
def setUp(self):
tempdir = tempfile.mkdtemp()
self.dir = os.path.join(... | # coding: utf-8
import logging
import os
import shutil
import sys
import tempfile
import unittest
import six
import fiona
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
class UnicodePathTest(unittest.TestCase):
def setUp(self):
tempdir = tempfile.mkdtemp()
self.dir = os.path.join(... |
Fix decision unsupported operation on execute | package com.uxxu.konashi.lib.action;
import android.bluetooth.BluetoothGattService;
import com.uxxu.konashi.lib.KonashiErrorType;
import java.util.UUID;
import info.izumin.android.bletia.BletiaErrorType;
import info.izumin.android.bletia.BletiaException;
import info.izumin.android.bletia.action.WriteCharacteristicA... | package com.uxxu.konashi.lib.action;
import android.bluetooth.BluetoothGattService;
import com.uxxu.konashi.lib.KonashiErrorType;
import java.util.UUID;
import info.izumin.android.bletia.BletiaErrorType;
import info.izumin.android.bletia.BletiaException;
import info.izumin.android.bletia.action.WriteCharacteristicA... |
Fix and readd old tests | "use strict";
var assert = require('chai').assert;
var xdTesting = require('../../lib/index')
var templates = require('../../lib/templates');
describe('MultiDevice - WebdriverIO commands', function () {
var test = this;
test.baseUrl = "http://localhost:8090/";
it('should be supported on multiple devices... | "use strict";
var assert = require('chai').assert;
var xdTesting = require('../../lib/index')
var templates = require('../../lib/templates');
describe.skip('MultiDevice - WebdriverIO commands', function () {
var test = this;
test.devices = {};
test.baseUrl = "http://localhost:8090/";
afterEach(funct... |
Add update user income to server | 'use strict';
module.exports = function(data) {
return {
getUserAccountsDetails(req, res) {
let currentUserId = req.user.id;
return data.getAccountsByUserId(currentUserId)
.then((accountsData) => {
if (accountsData.accounts.length == 0) {
... | 'use strict';
module.exports = function(data) {
return {
getUserAccountsDetails(req, res) {
let currentUserId = req.user.id;
return data.getAccountsByUserId(currentUserId)
.then((accountsData) => {
if (accountsData.accounts.length == 0) {
... |
Add verify of current user id on email verification | <?php
namespace Illuminate\Foundation\Auth;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Request;
use Illuminate\Auth\Events\Verified;
trait VerifiesEmails
{
use RedirectsUsers;
/**
* Show the email verification notice.
*
* @param \Illuminate\Http\Request $request
... | <?php
namespace Illuminate\Foundation\Auth;
use Illuminate\Http\Request;
use Illuminate\Auth\Events\Verified;
trait VerifiesEmails
{
use RedirectsUsers;
/**
* Show the email verification notice.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
... |
Change order of operations within migration so breaking schema changes come last | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-01 16:41
from __future__ import unicode_literals
from django.db import migrations, models
import temba.utils.models
class Migration(migrations.Migration):
dependencies = [
('msgs', '0093_populate_translatables'),
]
operations = [
... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-01 16:41
from __future__ import unicode_literals
from django.db import migrations, models
import temba.utils.models
class Migration(migrations.Migration):
dependencies = [
('msgs', '0093_populate_translatables'),
]
operations = [
... |
Fix exception on api login | "use strict";
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const usr = require('../models/user');
// Passport session set-up
passport.serializeUser((user, done) => {
done(null, user.user_id);
});
passport.deserializeUser(async (req, id, done) => {
const query... | "use strict";
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const usr = require('../models/user');
// Passport session set-up
passport.serializeUser((user, done) => {
done(null, user.user_id);
});
passport.deserializeUser(async (req, id, done) => {
const query... |
Stop watchnig so many files, fixes errors | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'lib/**/*.js',
'public/javascripts... | module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'lib/**/*.js',
'public/javascripts... |
Fix very 1st startup when user has no data: there is no _rev to dereference. | /*! Task Slayer | (c) 2014 Eric Mountain | https://github.com/EricMountain/TaskSlayer */
// LocalStorage layer
define(["angular"],
function() {
(function(window, angular, undefined) {
'use strict';
angular.module('localstorage', [])
.factory('localstorage', ['$ht... | /*! Task Slayer | (c) 2014 Eric Mountain | https://github.com/EricMountain/TaskSlayer */
// LocalStorage layer
define(["angular"],
function() {
(function(window, angular, undefined) {
'use strict';
angular.module('localstorage', [])
.factory('localstorage', ['$ht... |
Change wrong variable name cv_term_id to correct one type_cvterm_id | <?php
namespace ajax\listing;
use \PDO as PDO;
/**
* Web Service.
* Returns Trait informatio
*/
class Traits extends \WebService {
/**
* @param $querydata[]
* @returns array of traits
*/
public function execute($querydata) {
global $db;
$search = "%%";
if(in_array('... | <?php
namespace ajax\listing;
use \PDO as PDO;
/**
* Web Service.
* Returns Trait informatio
*/
class Traits extends \WebService {
/**
* @param $querydata[]
* @returns array of traits
*/
public function execute($querydata) {
global $db;
$search = "%%";
if(in_array('... |
Add pretend to the test requirements | import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outsi... | import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outsi... |
Add index for image metainformation | import uuid
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.contrib.postgres.indexes import GinIndex
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ..models import UpdatedMixin
from .storages import image_storage
class Imag... | import uuid
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ..models import UpdatedMixin
from .storages import image_storage
class Image(UpdatedMixin, models.Model):
author = models.Fo... |
Fix format in linechat code | import React, {Component} from 'react';
import {connect} from 'react-redux';
import {Avatar, Chip} from 'material-ui';
const mapStateToProps = (state, ownProps) => ({
line: ownProps.line,
user: state.auth.user,
});
const LineChat = ({line, user}) => {
return (
<div>
{user.id === line.studentid ? (
... | import React, {Component} from 'react';
import {connect} from 'react-redux';
import {Avatar, Chip} from 'material-ui';
const mapStateToProps = (state, ownProps) => ({
line: ownProps.line,
user: state.auth.user,
});
const LineChat = ({line, user}) => {
const divStyleRight = {
float: 'rigth',
color: 'red... |
Update setdefault to ensure commit is called | import yaml
class _Storage:
def __getitem__(self, key):
pass
def __setitem__(self, key, value):
pass
def __delitem__(self, key):
pass
class _DictionaryStorage(_Storage):
def __init__(self):
self.data = {}
def __del__(self):
self.commit()
def commit... | import yaml
class _Storage:
def __getitem__(self, key):
pass
def __setitem__(self, key, value):
pass
def __delitem__(self, key):
pass
class _DictionaryStorage(_Storage):
def __init__(self):
self.data = {}
def __del__(self):
self.commit()
def commit... |
Use range instead of xrange | import os
import tempfile
from subprocess import call
class SlidePresenter(object):
def __init__(self):
pass
def present(self, slides):
for sno, slide in enumerate(slides):
with open(os.path.join(tempfile.gettempdir(), str(sno)+".md"), 'w') as f:
f.write(slide)
... | import os
import tempfile
from subprocess import call
class SlidePresenter(object):
def __init__(self):
pass
def present(self, slides):
for sno, slide in enumerate(slides):
with open(os.path.join(tempfile.gettempdir(), str(sno)+".md"), 'w') as f:
f.write(slide)
... |
Include template snippets and retab code | <!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<meta http-equiv="x-ua-compatible"... | <!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<meta http-equiv="x-ua-compatible" content="ie=edge"... |
Add semver version limit due to compat changes
The semver library stopped working for legacy Python versions after the
2.9.1 release. This adds a less than 2.10 restriction to the abstract
dependency requirements so that folks don't need to all add a pin to
their requirements.txt. | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.23.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... | """Setuptools configuration for rpmvenv."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='rpmvenv',
version='0.23.0',
url='https://github.com/kevinconway/rpmvenv',
description='RPM packager f... |
Update Axe Cop plugin for 1.7.9 compatibility | <?php
class Af_AxeCop extends Plugin {
function about() {
return array(0.1, "Fetch image from the Axe Cop webcomic", "Markus Wiik");
}
function init($host) {
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
}
function hook_article_filter($article) {
$owner_uid = $articl... | <?php
class Af_AxeCop extends Plugin {
function about() {
return array(0.1, "Fetch image from the Axe Cop webcomic", "Markus Wiik");
}
function init($host) {
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
}
function hook_article_filter($article) {
$owner_uid = $articl... |
Remove unecessary imported component makeStyles | import React from 'react'
import { Box, Grid, Typography, Card, CardContent } from '@material-ui/core'
import { Edit, Delete } from '@material-ui/icons'
export default function TravelObject(props) {
let content = null;
switch (props.type) {
case 'event':
content = <Typography variant="h4" g... | import React from 'react'
import { Box, Grid, Typography, Card, CardContent } from '@material-ui/core'
import { makeStyles } from '@material-ui/core/styles'
import { Edit, Delete } from '@material-ui/icons'
export default function TravelObject(props) {
let content = null;
switch (props.type) {
case 'ev... |
Set default lambda value to 0 | #!/usr/bin/python3
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np
DATASET_PATH = 'data/fashion'
def load_dataset():
"""Loads fashion dataset
Returns:
Datasets object
"""
data = input_data.read_data_sets(DATASET_PATH, one_hot=True)
r... | #!/usr/bin/python3
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np
DATASET_PATH = 'data/fashion'
def load_dataset():
"""Loads fashion dataset
Returns:
Datasets object
"""
data = input_data.read_data_sets(DATASET_PATH, one_hot=True)
r... |
Check that fullpath is a regular file before continuing | # This file is part of the File Deduper project. It is subject to
# the the revised 3-clause BSD license terms as set out in the LICENSE
# file found in the top-level directory of this distribution. No part of this
# project, including this file, may be copied, modified, propagated, or
# distributed except according to... | # This file is part of the File Deduper project. It is subject to
# the the revised 3-clause BSD license terms as set out in the LICENSE
# file found in the top-level directory of this distribution. No part of this
# project, including this file, may be copied, modified, propagated, or
# distributed except according to... |
Add access to list of elements | package com.grayben.riskExtractor.htmlScorer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ScoredText {
private List<ScoredTextElement> text;
public ScoredText() {
super();
text = new ArrayList<>();
}
@Override
public String toString() {
StringBuilder sb =... | package com.grayben.riskExtractor.htmlScorer;
import java.util.ArrayList;
import java.util.List;
public class ScoredText {
private List<ScoredTextElement> text;
public ScoredText() {
super();
text = new ArrayList<>();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (S... |
Refactor occurrence of name to description | package seedu.emeraldo.model.task;
import seedu.emeraldo.commons.exceptions.IllegalValueException;
/**
* Represents a Task's description in Emeraldo.
* Guarantees: immutable; is valid as declared in {@link #isValidDescription(String)}
*/
public class Description {
public static final String MESSAGE_DESCRIPTIO... | package seedu.emeraldo.model.task;
import seedu.emeraldo.commons.exceptions.IllegalValueException;
/**
* Represents a Task's description in Emeraldo.
* Guarantees: immutable; is valid as declared in {@link #isValidDescription(String)}
*/
public class Description {
public static final String MESSAGE_NAME_CONST... |
Enable the user confirmation by default | <?php
return [
'route' => [
'prefix' => 'authorization',
],
'database' => [
'connection' => config('database.default'),
],
'users' => [
'table' => 'users',
'model' => Arcanesoft\Auth\Models\User::class,
],
'roles' ... | <?php
return [
'route' => [
'prefix' => 'authorization',
],
'database' => [
'connection' => config('database.default'),
],
'users' => [
'table' => 'users',
'model' => Arcanesoft\Auth\Models\User::class,
],
'roles' ... |
Add esdoc documentation and change the github change job to run once an hour | /** @ignore */
const Job = require('./Job');
/** @ignore */
const request = require('request');
/**
* Github change job, this job runs once an hour, every cycle
* the job will fetch the latest commits from the public
* github repository and store them in the file cache.
*
* @extends {Job}
*/
class GithubChange... | /** @ignore */
const Job = require('./Job');
/** @ignore */
const request = require('request');
class GithubChangeJob extends Job {
/**
* This method determines when the job should be execcuted.
*
* @param {RecurrenceRule} rule A node-schedule CRON recurrence rule instance
* @return {mixed}... |
Stop hard-coding the navigation level in the extension | from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender
class ZivinetzNavigationExtension(NavigationExtension):
name = _('Zivinetz navigation extension')
def children(self, page, *... | from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender
class ZivinetzNavigationExtension(NavigationExtension):
name = _('Zivinetz navigation extension')
def children(self, page, *... |
Adjust deleting cascade for planned liquid transfers | """
Planned worklist member table.
"""
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import Table
from sqlalchemy.schema import PrimaryKeyConstraint
__docformat__ = 'reStructuredText en'
__all__ = ['create_table']
def create_table(metadata, planned_wor... | """
Planned worklist member table.
"""
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import Table
from sqlalchemy.schema import PrimaryKeyConstraint
__docformat__ = 'reStructuredText en'
__all__ = ['create_table']
def create_table(metadata, planned_wor... |
Use helpers instead of facade | <?php
namespace Lio\Exceptions;
use Bugsnag;
use Exception;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
*... | <?php
namespace Lio\Exceptions;
use Auth;
use Bugsnag;
use Exception;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
... |
Add back unknown platform type | 'use strict'
module.exports = function (sequelize, DataTypes) {
let Rescue = sequelize.define('Rescue', {
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4
},
active: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
},
... | 'use strict'
module.exports = function (sequelize, DataTypes) {
let Rescue = sequelize.define('Rescue', {
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4
},
active: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
},
... |
Put back changes in observer after unsuccessful commit. | const expect = require('chai').expect;
import { TopicObserver } from "../topic-observer";
describe('topic observer', () => {
const observer = new TopicObserver();
const fn1 = () => {};
it('should observe all', function() {
observer.observe(fn1);
expect(observer.observers['__all__'].leng... | const expect = require('chai').expect;
import { TopicObserver } from "../topic-observer";
describe('topic observer', () => {
const observer = new TopicObserver();
const fn1 = () => {};
it('should observe all', function() {
observer.observe(fn1);
expect(observer.observers['__all__'].leng... |
Add random key to generated nodes to simple get same it or not | beforeEach(function() {
function genViewHTML(id, view) {
var html = '';
var clazz = 'ns-view-' + id;
if (view.async) {
clazz += ' ns-async';
}
if (view.collection) {
clazz += ' ns-view-container-desc';
}
if (view.placeholder) {
... | beforeEach(function() {
function genViewHTML(id, view) {
var html = '';
var clazz = 'ns-view-' + id;
if (view.async) {
clazz += ' ns-async';
}
if (view.collection) {
clazz += ' ns-view-container-desc';
}
if (view.placeholder) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.