text
stringlengths
17
1.47k
positive
stringlengths
673
4.43k
negative
stringlengths
677
2.81k
Make tests green to build on Hudson. Need to check warnings from checkstyle plugin.
package ua.yandex.shad; public class DoubleArray { /** * The default capacity of new DoubleArrays. */ private static final int DEFAULT_CAPACITY = 10; /** * Storage for data. */ private double[] data; /** * Actual size of array. */ private int size; /** ...
package ua.yandex.shad; public class DoubleArray { /** * The default capacity of new DoubleArrays. */ private static final int DEFAULT_CAPACITY = 10; /** * Storage for data. */ private double[] data; /** * Actual size of array. */ private int size; /** ...
Hide overlay on ajax error
jQuery(document).ready(function($) { var container = $('#splashing_images'); $.LoadingOverlaySetup({ color : "rgba(241,241,241,0.8)", maxSize : "80px", minSize : "20px", resizeInterval : 0, size : "30%" }); $('a.upload').clic...
jQuery(document).ready(function($) { var container = $('#splashing_images'); $.LoadingOverlaySetup({ color : "rgba(241,241,241,0.8)", maxSize : "80px", minSize : "20px", resizeInterval : 0, size : "30%" }); $('a.upload').clic...
Include editUser relationship when editing posts. Closes flarum/core#214. Hopefully. :)
<?php namespace Flarum\Api\Actions\Posts; use Flarum\Core\Posts\Commands\EditPost; use Flarum\Api\Actions\SerializeResourceAction; use Flarum\Api\JsonApiRequest; use Illuminate\Contracts\Bus\Dispatcher; use Tobscure\JsonApi\Document; class UpdateAction extends SerializeResourceAction { /** * @var Dispatcher ...
<?php namespace Flarum\Api\Actions\Posts; use Flarum\Core\Posts\Commands\EditPost; use Flarum\Api\Actions\SerializeResourceAction; use Flarum\Api\JsonApiRequest; use Illuminate\Contracts\Bus\Dispatcher; use Tobscure\JsonApi\Document; class UpdateAction extends SerializeResourceAction { /** * @var Dispatcher ...
Fix google undefined error (sentry js error)
$(document).ready(function () { function setMapByCoords(lng, lat) { var myLatLng = new google.maps.LatLng(lat, lng); if (typeof google === 'undefined') { return; } var map = new google.maps.Map(document.getElementById('map'), { zoom: 17, ...
$(document).ready(function () { function setMapByCoords(lng, lat) { var myLatLng = new google.maps.LatLng(lat, lng); var map = new google.maps.Map(document.getElementById('map'), { zoom: 17, center: myLatLng, mapTypeId: google.maps.MapTyp...
Save compiled JavaScript into the build/js directory
/* browserify task --------------- Bundle javascripty things with browserify! If the watch task is running, this uses watchify instead of browserify for faster bundling using caching. */ var browserify = require('browserify'); var watchify = require('watchify'); var bundleLogger = require('../util/b...
/* browserify task --------------- Bundle javascripty things with browserify! If the watch task is running, this uses watchify instead of browserify for faster bundling using caching. */ var browserify = require('browserify'); var watchify = require('watchify'); var bundleLogger = require('../util/b...
Support yield alias of block
<?php namespace Phug\Lexer\Scanner; use Phug\Lexer\ScannerInterface; use Phug\Lexer\State; use Phug\Lexer\Token\BlockToken; class BlockScanner implements ScannerInterface { public function scan(State $state) { foreach ($state->scanToken( BlockToken::class, '(?:block|yield)(?:[...
<?php namespace Phug\Lexer\Scanner; use Phug\Lexer\ScannerInterface; use Phug\Lexer\State; use Phug\Lexer\Token\BlockToken; class BlockScanner implements ScannerInterface { public function scan(State $state) { foreach ($state->scanToken( BlockToken::class, 'block(?:[\t ]+(?<mo...
Support Wagtail 1.0 -> 1.3.x
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='wagtailpress', version='0.1', packages=['wagtailpress'], ...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='wagtailpress', version='0.1', packages=['wagtailpress'], ...
Fix minor bug in length comparison.
#!/usr/bin/env python from __future__ import absolute_import, print_function # Standard library from os import walk from os.path import exists, isdir, join # Local library from .util import is_py_file from .diff import diff_files def main(): import sys if len(sys.argv) < 3: print('Usage: %s <packa...
#!/usr/bin/env python from __future__ import absolute_import, print_function # Standard library from os import walk from os.path import exists, isdir, join # Local library from .util import is_py_file from .diff import diff_files def main(): import sys if sys.argv < 3: print('Usage: %s <module1> <...
Add py3.3 to trove classifiers
import multiprocessing # stop tests breaking tox from setuptools import setup import tvrenamr requires = ('pyyaml', 'requests') packages = ('tvrenamr',) setup_requires = ('minimock', 'mock', 'nose', 'pyyaml') setup( name = tvrenamr.__title__, version = tvrenamr.__version__, description = 'Rename tv sh...
import multiprocessing # stop tests breaking tox from setuptools import setup import tvrenamr requires = ('pyyaml', 'requests') packages = ('tvrenamr',) setup_requires = ('minimock', 'mock', 'nose', 'pyyaml') setup( name = tvrenamr.__title__, version = tvrenamr.__version__, description = 'Rename tv sh...
BAP-12479: Create new widget controller buttonsAction - CR fixes
<?php namespace Oro\Bundle\ScopeBundle\Tests\Functional; use Oro\Bundle\ScopeBundle\Entity\Scope; use Oro\Bundle\ScopeBundle\Tests\Unit\Stub\StubScope; use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase; use Oro\Component\PropertyAccess\PropertyAccessor; class AbstractScopeProviderTestCase extends WebTestCase { ...
<?php namespace Oro\Bundle\ScopeBundle\Tests\Functional; use Oro\Bundle\ScopeBundle\Entity\Scope; use Oro\Bundle\ScopeBundle\Tests\Unit\Stub\StubScope; use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase; class AbstractScopeProviderTestCase extends WebTestCase { protected function setUp() { $this->in...
Add support for creating snapshots for program owner
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> scope = "Private Program" description = """ User with authorization to peform administrative tasks such as associating users to roles within the scope of of a program.<br/><br/>When a person creates a ...
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> scope = "Private Program" description = """ User with authorization to peform administrative tasks such as associating users to roles within the scope of of a program.<br/><br/>When a person creates a ...
Tweak watch task configs: separate linting from help generation, and add the templates to the files that trigger help generation
module.exports = function(grunt) { grunt.initConfig({ jshint: { all: ['**/*.js', '!**/node_modules/**'], options: { newcap: false } }, generation: { docs: { src: ['lib/components/*.js'], docs: { markdown: { byName: {dest: 'docs/markdo...
module.exports = function(grunt) { grunt.initConfig({ jshint: { all: ['**/*.js', '!**/node_modules/**'], options: { newcap: false } }, generation: { all: { src: ['lib/components/*.js'], docs: { markdown: { byName: {dest: 'docs/markdow...
Add SITE_ID to test settings since contrib.sites is in INSTALLED_APPS.
#!/usr/bin/env python from os.path import dirname, abspath import sys from django.conf import settings if not settings.configured: from django import VERSION settings_dict = dict( INSTALLED_APPS=( 'localeurl', 'localeurl.tests', 'django.contrib.sites', # for sitema...
#!/usr/bin/env python from os.path import dirname, abspath import sys from django.conf import settings if not settings.configured: from django import VERSION settings_dict = dict( INSTALLED_APPS=( 'localeurl', 'localeurl.tests', 'django.contrib.sites', # for sitema...
Make dust recipes actually give 40 dust
package com.agilemods.materiamuto.common.core; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; public class MMRecipes { public static void initialize() { ItemStack dustLow = new ItemStack(MMItems.cov...
package com.agilemods.materiamuto.common.core; import com.agilemods.materiamuto.common.core.MMItems; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; public class MMRecipes { public static void initialize() {...
Remove the hard coded process name now that the process name has been set.
(function (module) { module.controller('ProjectHomeController', ProjectHomeController); ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state", "Restangular"]; function ProjectHomeController(project, mcmodal, templates, $state, Restangular) { var ctrl = this; ctrl.pro...
(function (module) { module.controller('ProjectHomeController', ProjectHomeController); ProjectHomeController.$inject = ["project", "mcmodal", "templates", "$state", "Restangular"]; function ProjectHomeController(project, mcmodal, templates, $state, Restangular) { var ctrl = this; ctrl.pro...
Bump up to version 1.0.4
#!/usr/bin/env python import os import sys import setuptools.command.egg_info as egg_info_cmd import shutil from setuptools import setup, find_packages SETUP_DIR = os.path.dirname(__file__) README = os.path.join(SETUP_DIR, 'README.rst') try: import gittaggers tagger = gittaggers.EggInfoFromGit except Import...
#!/usr/bin/env python import os import sys import setuptools.command.egg_info as egg_info_cmd import shutil from setuptools import setup, find_packages SETUP_DIR = os.path.dirname(__file__) README = os.path.join(SETUP_DIR, 'README.rst') try: import gittaggers tagger = gittaggers.EggInfoFromGit except Import...
Make py_version and assertion more readable
"""Tests for correctly generated, working setup.""" from os import system from sys import version_info from . import pytest_generate_tests # noqa, pylint: disable=unused-import # pylint: disable=too-few-public-methods class TestTestSetup(object): """ Tests for verifying generated test setups of this cookiec...
"""Tests for correctly generated, working setup.""" from os import system from sys import version_info from . import pytest_generate_tests # noqa, pylint: disable=unused-import # pylint: disable=too-few-public-methods class TestTestSetup(object): """ Tests for verifying generated test setups of this cookiec...
Correct adding of statusmanager to endpoints
export default [ 'config', 'hs.common.laymanService', function (config, laymanService) { const me = this; function getItemsPerPageConfig(ds) { return angular.isDefined(ds.paging) && angular.isDefined(ds.paging.itemsPerPage) ? ds.paging.itemsPerPage : config.dsPaging || 20; ...
export default [ 'config', 'hs.common.laymanService', function (config, laymanService) { const me = this; function getItemsPerPageConfig(ds) { return angular.isDefined(ds.paging) && angular.isDefined(ds.paging.itemsPerPage) ? ds.paging.itemsPerPage : config.dsPaging || 20; ...
Make deprecation warning in doc string bold
import warnings import functools __all__ = ['deprecated'] class deprecated(object): """Decorator to mark deprecated functions with warning. Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>. Parameters ---------- alt_func : str If given, tell user what function to use i...
import warnings import functools __all__ = ['deprecated'] class deprecated(object): """Decorator to mark deprecated functions with warning. Adapted from <http://wiki.python.org/moin/PythonDecoratorLibrary>. Parameters ---------- alt_func : str If given, tell user what function to use i...
Use 2D array instead of 1D to keep track of which edges have been drawn TODO: this probably isn't necessary
import turtle import math import sys class Paley: def __init__(self, p, radius = 290): self.p = p self.radius = radius """Return coordinates of ith vertex""" def getVertex(self, i): angle = i * 2 * math.pi / self.p return (self.radius * math.cos(angle), self.radius * math....
import turtle import math import sys class Paley: def __init__(self, p, radius = 290): self.p = p self.radius = radius """Return coordinates of ith vertex""" def getVertex(self, i): angle = i * 2 * math.pi / self.p return (self.radius * math.cos(angle), self.radius * math....
Use the newer PostUpdate instead of PostMedia
import twitter from django.core.management.base import BaseCommand from django.conf import settings from core.models import Tweet class Command(BaseCommand): help = "Send out tweets." def handle(self, *args, **options): for tweet in Tweet.objects.filter(was_sent=False, failed_trails__lte=5): ...
import twitter from django.core.management.base import BaseCommand from django.conf import settings from core.models import Tweet class Command(BaseCommand): help = "Send out tweets." def handle(self, *args, **options): for tweet in Tweet.objects.filter(was_sent=False, failed_trails__lte=5): ...
Load from the pre processed data
from __future__ import division import gzip try: from BytesIO import BytesIO except ImportError: from io import BytesIO try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import hdfs import pandas as pd from mrjob.job import MRJob from mrjob.protocol import JSON...
from __future__ import division import gzip try: from BytesIO import BytesIO except ImportError: from io import BytesIO try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import hdfs import pandas as pd from mrjob.job import MRJob from mrjob.protocol import JSON...
Remove unused S3 config vars.
<?php return [ /* |-------------------------------------------------------------------------- | Default Filesystem Disk |-------------------------------------------------------------------------- | | Here you may specify the default filesystem disk that should be used | by the framework. A...
<?php return [ /* |-------------------------------------------------------------------------- | Default Filesystem Disk |-------------------------------------------------------------------------- | | Here you may specify the default filesystem disk that should be used | by the framework. A...
Fix duplicate linking with iframes.
window.addEventListener("load", function load() { window.removeEventListener("load", load, false); gBrowser.addEventListener("DOMContentLoaded", function(e) { var document = e.originalTarget, reGist = /^https?\:\/\/gist\.github\.com\/(\d*)/i, reRel = /^\/?(\d+)$/, gist = reGist.test(docu...
window.addEventListener("load", function(e) { var run = function() { var document = content.document; var reGist = /^https?\:\/\/gist\.github\.com\/(\d*)/i, reRel = /^\/?(\d+)$/, gist = reGist.test(document.location.href), anchors = document.querySelectorAll("a[href]"), anchor,...
Fix file inclusion and make new release.
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', ...
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', ...
Update date change for build
import React, {Component} from "react"; import RaisedButton from "material-ui/RaisedButton"; const styles = { button: { margin: 12, }, } class Home extends Component { render() { return ( <div className="buttons"> <h1>Gregory N. Katchmar</h1> <h2>JavaScript Developer</h2> ...
import React, {Component} from "react"; import RaisedButton from "material-ui/RaisedButton"; const styles = { button: { margin: 12, }, } class Home extends Component { render() { return ( <div className="buttons"> <h1>Gregory N. Katchmar</h1> <h2>JavaScript Developer</h2> ...
Fix overlooked use case for workdir.
import datetime import multiprocessing from lobster.cmssw.plotting import Plotter logger = multiprocessing.get_logger() class DummyQueue(object): def start(*args): pass def put(*args): pass def get(*args): return None class Actions(object): def __init__(self, config): ...
import datetime import multiprocessing from lobster.cmssw.plotting import Plotter logger = multiprocessing.get_logger() class DummyQueue(object): def start(*args): pass def put(*args): pass def get(*args): return None class Actions(object): def __init__(self, config): ...
Fix crash when requesting geocoder for invalid lat/lon coordinates
package org.owntracks.android.support; import android.content.Context; import android.location.Address; import org.owntracks.android.injection.qualifier.AppContext; import java.io.IOException; import java.util.List; import java.util.Locale; import timber.log.Timber; public class GeocoderGoogle implements Geocoder ...
package org.owntracks.android.support; import android.content.Context; import android.location.Address; import org.owntracks.android.injection.qualifier.AppContext; import java.io.IOException; import java.util.List; import java.util.Locale; import timber.log.Timber; public class GeocoderGoogle implements Geocoder ...
Fix for text truncation where null or undefined descriptions are used.
(function () { angular .module('GVA.Common') .directive('truncatedText', truncatedText); truncatedText.$inject = ['$parse']; function truncatedText($parse) { function truncateText(text, limit) { var words = text.split(' '); var truncatedtext = words.redu...
(function () { angular .module('GVA.Common') .directive('truncatedText', truncatedText); truncatedText.$inject = ['$parse']; function truncatedText($parse) { function truncateText(text, limit) { var words = text.split(' '); var truncatedtext = words.redu...
Use LRUCache correctly (minimal improvement)
from pyramid.threadlocal import manager from sqlalchemy.util import LRUCache class ManagerLRUCache(object): """ Override capacity in settings. """ def __init__(self, name, default_capacity=100, threshold=.5): self.name = name self.default_capacity = default_capacity self.threshold ...
from pyramid.threadlocal import manager from sqlalchemy.util import LRUCache class ManagerLRUCache(object): """ Override capacity in settings. """ def __init__(self, name, default_capacity=100, threshold=.5): self.name = name self.default_capacity = default_capacity self.threshold ...
Make sure the opened workflow file gets closed after it's been loaded
#!/usr/bin/env python import argparse from bioblend import galaxy import json def main(): """ This script uses bioblend to import .ga workflow files into a running instance of Galaxy """ parser = argparse.ArgumentParser() parser.add_argument("-w", "--workflow_path", help='Path to workflow file...
#!/usr/bin/env python import argparse from bioblend import galaxy import json def main(): """ This script uses bioblend to import .ga workflow files into a running instance of Galaxy """ parser = argparse.ArgumentParser() parser.add_argument("-w", "--workflow_path", help='Path to workflow file...
Remove useless default from migration - wal-26
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import nodeconductor.core.fields class Migration(migrations.Migration): dependencies = [ ('openstack', '0022_volume_device'), ('structure', '0037_remove_customer_billing_backend_id'), ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import nodeconductor.core.fields class Migration(migrations.Migration): dependencies = [ ('openstack', '0022_volume_device'), ('structure', '0037_remove_customer_billing_backend_id'), ...
Fix logoutLink key in AJAX catch for Redux
import axios from 'axios' let links export default async function AJAX({ url, resource, id, method = 'GET', data = {}, params = {}, headers = {}, }) { try { const basepath = window.basepath || '' let response url = `${basepath}${url}` if (!links) { const linksRes = (response = ...
import axios from 'axios' let links export default async function AJAX({ url, resource, id, method = 'GET', data = {}, params = {}, headers = {}, }) { try { const basepath = window.basepath || '' let response url = `${basepath}${url}` if (!links) { const linksRes = (response = ...
Change to empty port in hapi-auth-hawk
/** * Created by Omnius on 6/15/16. */ 'use strict'; const Boom = require('boom'); exports.register = (server, options, next) => { server.auth.strategy('hawk-login-auth-strategy', 'hawk', { getCredentialsFunc: (sessionId, callback) => { const redis = server.app.redis; const met...
/** * Created by Omnius on 6/15/16. */ 'use strict'; const Boom = require('boom'); exports.register = (server, options, next) => { server.auth.strategy('hawk-login-auth-strategy', 'hawk', { getCredentialsFunc: (sessionId, callback) => { const redis = server.app.redis; const met...
Fix loaded page name is empty
<?php class Loader { private $instance = array(); public function page($name, $method='index') { if ($name==='') { $name = 'home'; } $page = $this->loadClass($name, 'Page'); if ($page === false || method_exis...
<?php class Loader { private $instance = array(); public function page($name, $method='index') { $page = $this->loadClass($name, 'Page'); if ($page === false || method_exists($page, $method) === false) { not_found(); } ...
Remove some complexity caused by refactorings
<?php namespace Lily\Test\Usage; use Symfony\Component\DomCrawler\Crawler; use Lily\Application\MiddlewareApplication; use Lily\Application\RoutedApplication; use Lily\Util\Request; use Lily\Util\Response; class DescribeTestingTest extends \PHPUnit_Framework_TestCase { private function applicationToTest() ...
<?php namespace Lily\Test\Usage; use Symfony\Component\DomCrawler\Crawler; use Lily\Application\MiddlewareApplication; use Lily\Application\RoutedApplication; use Lily\Util\Request; use Lily\Util\Response; class DescribeTestingTest extends \PHPUnit_Framework_TestCase { private function applicationToTest() ...
Fix rendering an article list
import React from 'react'; import ArticleShort from '../articleShort.react'; import ArticleStore from '../../stores/ArticleStore'; import PageCount from './PageCount.react'; export default class List extends React.Component { constructor(props) { super(props); self.displayName = 'ArticleL...
import React from 'react'; import ArticleShort from '../articleShort.react'; import ArticleStore from '../../stores/ArticleStore'; import PageCount from './PageCount.react'; export default class List extends React.Component { constructor(props) { super(props); self.displayName = 'ArticleL...
Use different blog for test data.
from . import google_drive from grow.pods import pods from grow.pods import storage from grow.testing import testing import cStringIO import csv import json import unittest import yaml class BloggerTestCase(testing.TestCase): def test_run(self): pod = testing.create_pod() fields = { '...
from . import google_drive from grow.pods import pods from grow.pods import storage from grow.testing import testing import cStringIO import csv import json import unittest import yaml class BloggerTestCase(testing.TestCase): def test_run(self): pod = testing.create_pod() fields = { '...
Make this into a partial to get the protocol correctly.
""" Asphalt framework mixin for Kyokai. """ import logging import asyncio from functools import partial from typing import Union from asphalt.core import Component, resolve_reference, Context from typeguard import check_argument_types from kyokai.app import Kyokai from kyokai.protocol import KyokaiProtocol from kyok...
""" Asphalt framework mixin for Kyokai. """ import logging import asyncio from functools import partial from typing import Union from asphalt.core import Component, resolve_reference, Context from typeguard import check_argument_types from kyokai.app import Kyokai from kyokai.protocol import KyokaiProtocol from kyok...
Add 3 second delay to application submission
import React, { Component } from 'react' import PropTypes from 'prop-types' import api from 'api' import { LargeButton } from '@hackclub/design-system' class SubmitButton extends Component { static propTypes = { status: PropTypes.oneOf(['incomplete', 'complete', 'submitted']).isRequired, applicationId: PropT...
import React, { Component } from 'react' import PropTypes from 'prop-types' import api from 'api' import { LargeButton } from '@hackclub/design-system' class SubmitButton extends Component { static propTypes = { status: PropTypes.oneOf(['incomplete', 'complete', 'submitted']).isRequired, applicationId: PropT...
Fix bug with exists property
<?php namespace ThibaudDauce\MoloquentInheritance; use ReflectionClass; trait MoloquentInheritanceTrait { public $parentClasses; /** * Boot the moloquent inheritance for a model. * * @return void */ public static function bootMoloquentInheritanceTrait() { static::addGloba...
<?php namespace ThibaudDauce\MoloquentInheritance; use ReflectionClass; trait MoloquentInheritanceTrait { public $parentClasses; /** * Boot the moloquent inheritance for a model. * * @return void */ public static function bootMoloquentInheritanceTrait() { static::addGloba...
Call the CM to mask stderr output properly
import inspect import sys import unittest from contextlib import contextmanager import kafka.tools.assigner.actions from kafka.tools.assigner.arguments import set_up_arguments from kafka.tools.assigner.modules import get_modules from kafka.tools.assigner.plugins import PluginModule @contextmanager def redirect_err...
import inspect import sys import unittest from contextlib import contextmanager import kafka.tools.assigner.actions from kafka.tools.assigner.arguments import set_up_arguments from kafka.tools.assigner.modules import get_modules from kafka.tools.assigner.plugins import PluginModule @contextmanager def redirect_err...
Fix lv2 effect builder for travis build
import os import json from pluginsmanager.model.lv2.lv2_plugin import Lv2Plugin from pluginsmanager.model.lv2.lv2_effect import Lv2Effect class Lv2EffectBuilder(object): """ Generates lv2 audio plugins instance (as :class:`Lv2Effect` object). .. note:: In the current implementation, the data pl...
import os import json from pluginsmanager.model.lv2.lv2_plugin import Lv2Plugin from pluginsmanager.model.lv2.lv2_effect import Lv2Effect class Lv2EffectBuilder(object): """ Generates lv2 audio plugins instance (as :class:`Lv2Effect` object). .. note:: In the current implementation, the data pl...
Fix the media manual updates unit test to account for the new ext dir page. My previous change for the extension directory manual updates page broke the unit tests. The existing test for the upload directory didn't take into account that the extension directory would also now be needed. The test was fixed and renamed ...
from django.conf import settings from django.test import TestCase from reviewboard.admin import checks class UpdateTests(TestCase): """Tests for update required pages""" def tearDown(self): # Make sure we don't break further tests by resetting this fully. checks.reset_check_cache() def ...
from django.conf import settings from django.test import TestCase from reviewboard.admin import checks class UpdateTests(TestCase): """Tests for update required pages""" def tearDown(self): # Make sure we don't break further tests by resetting this fully. checks.reset_check_cache() def ...
fix(redux): Clear board on new request
import * as types from '../types' import initialState from '../initialState'; import { createReducer, mergeState } from '~/utils/redux'; export default createReducer(initialState.board, { [types.BOARD_REQUESTED]: (state, action) => mergeState(state, { isFetching: true, didInvalidate...
import * as types from '../types' import initialState from '../initialState'; import { createReducer, mergeState } from '~/utils/redux'; export default createReducer(initialState.board, { [types.BOARD_REQUESTED]: (state, action) => mergeState(state, { isFetching: true, didInvalidate...
Increase the unit test coverage for the binary search tree
import unittest from pyalgs.data_structures.commons.binary_search_tree import BinarySearchTree class BinarySearchTreeUnitTest(unittest.TestCase): def test_binarySearchTree(self): bst = BinarySearchTree.create() bst.put("one", 1) bst.put("two", 2) bst.put("three", 3) bst.p...
import unittest from pyalgs.data_structures.commons.binary_search_tree import BinarySearchTree class BinarySearchTreeUnitTest(unittest.TestCase): def test_binarySearchTree(self): bst = BinarySearchTree.create() bst.put("one", 1) bst.put("two", 2) bst.put("three", 3) bst.p...
Change version number to 0.2.x
/** * Configuration for denkmap application */ Ext.define('Denkmap.util.Config', { singleton: true, config: { /** * @cfg {String} version Current version number of application **/ version: '0.2.{BUILD_NR}', leafletMap: { zoom: 15, getTileLaye...
/** * Configuration for denkmap application */ Ext.define('Denkmap.util.Config', { singleton: true, config: { /** * @cfg {String} version Current version number of application **/ version: '0.1.{BUILD_NR}', leafletMap: { zoom: 15, getTileLaye...
Change timestamps columns to protected
<?php namespace Maatwebsite\Usher\Traits; use Doctrine\ORM\Mapping as ORM; use Maatwebsite\Usher\Domain\Shared\Embeddables\CreatedAt; use Maatwebsite\Usher\Domain\Shared\Embeddables\UpdatedAt; trait Timestamps { /** * @ORM\Embedded(class = "Maatwebsite\Usher\Domain\Shared\Embeddables\CreatedAt", columnPrefi...
<?php namespace Maatwebsite\Usher\Traits; use Doctrine\ORM\Mapping as ORM; use Maatwebsite\Usher\Domain\Shared\Embeddables\CreatedAt; use Maatwebsite\Usher\Domain\Shared\Embeddables\UpdatedAt; trait Timestamps { /** * @ORM\Embedded(class = "Maatwebsite\Usher\Domain\Shared\Embeddables\CreatedAt", columnPrefi...
Allow user creation from script.
<?php namespace solutionweb\gatekeeper\utils\commands; /** * Command to create a user. * * @author Bert Peters <bert.ljpeters@gmail.com> */ class CreateUserCommand extends GatekeeperCommand { protected $commandInformation = [ "description" => "Create a new user.", "options" => [ "n...
<?php namespace solutionweb\gatekeeper\utils\commands; /** * Command to create a user. * * @author Bert Peters <bert.ljpeters@gmail.com> */ class CreateUserCommand extends GatekeeperCommand { protected $commandInformation = [ "description" => "Create a new user.", "options" => [ "n...
Fix NameError: name 'README' is not defined Traceback (most recent call last): File "<string>", line 20, in <module> File "/tmp/pip-g43cf6a2-build/setup.py", line 9, in <module> long_description=README, NameError: name 'README' is not defined
#!/usr/bin/env python from distutils.core import setup setup( name='wagtail_embed_videos', version='0.0.5', description='Embed Videos for Wagtail CMS.', long_description=( 'Simple app that works similar to wagtailimages,' 'but for embedding YouTube and Vimeo videos and music from Soun...
#!/usr/bin/env python from distutils.core import setup setup( name='wagtail_embed_videos', version='0.0.5', description='Embed Videos for Wagtail CMS.', long_description=README, author='Diogo Marques', author_email='doriva.marques.29@gmail.com', maintainer='Diogo Marques', maintainer_e...
Add Default Value For Timepicker When Focus
let React = require("react") let cx = require("classnames") let {Focusable} = require("frig").HigherOrderComponents let popup = React.createFactory(require("./timepicker_popup")) let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") let {savedNotification} = require("../util.js") let {div, input} ...
let React = require("react") let cx = require("classnames") let {Focusable} = require("frig").HigherOrderComponents let popup = React.createFactory(require("./timepicker_popup")) let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") let {savedNotification} = require("../util.js") let {div, input} ...
Add input for reject application
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateApplicationsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('applicatio...
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateApplicationsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('applicatio...
Fix Tiny MCE menu bug
<?php namespace PHPOrchestra\BackofficeBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Class TinymceCompilerPass */ class TinymceCompilerPass implements CompilerPassInterface { /** ...
<?php namespace PHPOrchestra\BackofficeBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Class TinymceCompilerPass */ class TinymceCompilerPass implements CompilerPassInterface { /** ...
Set mocha tests timeout to 5s.
'use strict'; module.exports = function (grunt) { // Show elapsed time at the end require('time-grunt')(grunt); // Load all grunt tasks require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ jshint: { options: { jshintrc: '.jshintrc', reporter: require('...
'use strict'; module.exports = function (grunt) { // Show elapsed time at the end require('time-grunt')(grunt); // Load all grunt tasks require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ jshint: { options: { jshintrc: '.jshintrc', reporter: require('...
Fix bug where hasSentResponse would not be reset stalling further requests.
var express = require('express'); function createMethodWrapper(app, verb) { var original = app[verb]; return function (route, handler) { original.call(app, route, function (req, res, next) { // must be places here in order that it is cleared on every request var hasSentResponse...
var express = require('express'); function createMethodWrapper(app, verb) { var original = app[verb]; return function (route, handler) { var hasSentResponse = false; original.call(app, route, function (req, res, next) { handler(req, { setHeader: function () { ...
ENH: Add very basic tests for codata and constants. git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@6563 d6536bca-fef9-0310-8506-e4c0a848fbcf
import warnings import codata import constants from scipy.constants import find from numpy.testing import assert_equal, run_module_suite def test_find(): warnings.simplefilter('ignore', DeprecationWarning) keys = find('weak mixing', disp=False) assert_equal(keys, ['weak mixing angle']) keys = fin...
import warnings from scipy.constants import find from numpy.testing import assert_equal, run_module_suite def test_find(): warnings.simplefilter('ignore', DeprecationWarning) keys = find('weak mixing', disp=False) assert_equal(keys, ['weak mixing angle']) keys = find('qwertyuiop', disp=False) ...
Handle arrays in post input
<?php class Inputs { protected static $_instance = Null; public static function instance() { if (!self::$_instance) self::$_instance = new self; return self::$_instance; } public function input($key, $default = Null) { switch (Router::instance()->method) { ...
<?php class Inputs { protected static $_instance = Null; public static function instance() { if (!self::$_instance) self::$_instance = new self; return self::$_instance; } public function input($key, $default = Null) { switch (Router::instance()->method) { ...
Fix project name in urlconf
import watson from cms.apps.pages.models import ContentBase from cms.models import HtmlField, SearchMetaBase from django.db import models class Careers(ContentBase): # The heading that the admin places this content under. classifier = "apps" # The urlconf used to power this content's views. urlconf ...
import watson from cms.apps.pages.models import ContentBase from cms.models import HtmlField, SearchMetaBase from django.db import models class Careers(ContentBase): # The heading that the admin places this content under. classifier = "apps" # The urlconf used to power this content's views. urlconf ...
Add children to debug str
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. class MutableTree: def __init__ (self, value = None): self.child = None self.children = [ ] self.value = value ...
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. class MutableTree: def __init__ (self, value = None): self.child = None self.children = [ ] self.value = value ...
Set SymPy version req to 0.7.4.1 (required only for Theano).
#!/usr/bin/env python from setuptools import setup, find_packages from pydy_code_gen import __version__ setup( name='pydy-code-gen', version=__version__, author='Jason K. Moore', author_email='moorepants@gmail.com', url="https://github.com/PythonDynamics/pydy-code-gen/", description='Code gen...
#!/usr/bin/env python from setuptools import setup, find_packages from pydy_code_gen import __version__ setup( name='pydy-code-gen', version=__version__, author='Jason K. Moore', author_email='moorepants@gmail.com', url="https://github.com/PythonDynamics/pydy-code-gen/", description='Code gen...
Make sure that the admin widget also supports Django 2
from django.forms.widgets import Input, ClearableFileInput from django.template.loader import render_to_string class CIImgWidget(ClearableFileInput): def render(self, name, value, attrs=None, renderer=None, **kwargs): try: attrs["data-value"] = getattr(value, "url", "") except ValueEr...
from django.forms.widgets import Input, ClearableFileInput from django.template.loader import render_to_string class CIImgWidget(ClearableFileInput): def render(self, name, value, attrs=None): try: attrs["data-value"] = getattr(value, "url", "") except ValueError: # attribute has no f...
mongoose(deprecation): Add a new key/pair to mongoose connect options to fix deprecation warning
"use strict"; /* eslint-disable import/no-unresolved */ /* eslint-disable no-console */ import mongoose from 'mongoose'; import chalk from 'chalk'; import bluebird from 'bluebird'; const connectDB = () => { mongoose.Promise = bluebird; if (process.env.NODE_ENV !== 'test') { // Connect to MongoDB mongoose....
"use strict"; /* eslint-disable import/no-unresolved */ /* eslint-disable no-console */ import mongoose from 'mongoose'; import chalk from 'chalk'; import bluebird from 'bluebird'; const connectDB = () => { mongoose.Promise = bluebird; if (process.env.NODE_ENV !== 'test') { // Connect to MongoDB mongoose....
Rename offlineevent to offlineevents route
from django.utils.translation import ugettext_lazy as _ from meinberlin.apps.dashboard2 import DashboardComponent from meinberlin.apps.dashboard2 import content from . import views from .apps import Config class OfflineEventsComponent(DashboardComponent): app_label = Config.label label = 'offlineevents' ...
from django.utils.translation import ugettext_lazy as _ from meinberlin.apps.dashboard2 import DashboardComponent from meinberlin.apps.dashboard2 import content from . import views from .apps import Config class OfflineEventsComponent(DashboardComponent): app_label = Config.label label = 'offlineevents' ...
Use more explicit variable names.
#!/usr/bin/env python import os import subprocess import sys def build(pkgpath): os.chdir(pkgpath) targets = [ 'build', 'package', 'install', 'clean', 'clean-depends', ] for target in targets: p = subprocess.Popen( ['bmake', target], ...
#!/usr/bin/env python import os import subprocess import sys def build(pkgpath): os.chdir(pkgpath) targets = [ 'build', 'package', 'install', 'clean', 'clean-depends', ] for target in targets: p = subprocess.Popen( ['bmake', target], ...
Check if total is set
import parallel from 'async/parallel'; import defaults from 'lodash-es/defaults'; import handleEtag from '../helper/etag'; import keyFactory from '../helper/key'; export default function setList(cache, options = {}) { options = defaults({}, options, { etag: true, list: null, total: ['where'] }); con...
import parallel from 'async/parallel'; import defaults from 'lodash-es/defaults'; import handleEtag from '../helper/etag'; import keyFactory from '../helper/key'; export default function setList(cache, options = {}) { options = defaults({}, options, { etag: true, list: null, total: ['where'] }); con...
Add ability to customize error message styles
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { Form, Label, Input } from 'semantic-ui-react'; class FormInput extends Component { componentWillReceiveProps(nextProps) { const { input: { value, onChange }, meta: { visited }, defaultValue } = nextProps; ...
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { Form, Label, Input } from 'semantic-ui-react'; class FormInput extends Component { componentWillReceiveProps(nextProps) { const { input: { value, onChange }, meta: { visited }, defaultValue } = nextProps; ...
Change so that users are redirected to new landing page
import React from 'react'; import Utility from '../../shared/util/Utility'; import * as Security from '../../shared/reducers/Security'; import * as Lessons from '../../shared/reducers/Lessons'; export const Reducers = [Security, Lessons]; export function requireAuthentication(Component) { class AuthenticatedCompon...
import React from 'react'; import Utility from '../../shared/util/Utility'; import * as Security from '../../shared/reducers/Security'; import * as Lessons from '../../shared/reducers/Lessons'; export const Reducers = [Security, Lessons]; export function requireAuthentication(Component) { class AuthenticatedCompon...
Improve by using breadth search instead of depth search
<?php class AlgorithmConnectedComponents extends Algorithm{ /** * * @var Graph */ private $graph; /** * * @param Graph $graph */ public function __construct(Graph $graph){ $this->graph = $graph; } /** * check whether this graph consist...
<?php class AlgorithmConnectedComponents extends Algorithm{ /** * * @var Graph */ private $graph; /** * * @param Graph $graph */ public function __construct(Graph $graph){ $this->graph = $graph; } /** * check whether this graph consist...
Remove a redundant line from get_class
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(obj...
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(obj...
Convert Non-strict to strict equality checking Convert non-strict equality checking, using `==`, to the strict version, using `===`.
module.exports = { link: async function(library, destinations, deployer) { let eventArgs; // Validate name if (library.contract_name == null) { eventArgs = { type: "noLibName" }; const message = await deployer.emitter.emit("error", eventArgs); throw new Error(message); ...
module.exports = { link: async function(library, destinations, deployer) { let eventArgs; // Validate name if (library.contract_name == null) { eventArgs = { type: "noLibName" }; const message = await deployer.emitter.emit("error", eventArgs); throw new Error(message); ...
Modify variables passing in in dummy app.
import Ember from 'ember'; import CommentableMixin from 'ember-osf/mixins/commentable'; import TaggableMixin from 'ember-osf/mixins/taggable-mixin'; import NodeActionsMixin from 'ember-osf/mixins/node-actions'; import KeenTrackerMixin from 'ember-osf/mixins/keen-tracker'; export default Ember.Controller.extend(Comment...
import Ember from 'ember'; import CommentableMixin from 'ember-osf/mixins/commentable'; import TaggableMixin from 'ember-osf/mixins/taggable-mixin'; import NodeActionsMixin from 'ember-osf/mixins/node-actions'; import KeenTrackerMixin from 'ember-osf/mixins/keen-tracker'; export default Ember.Controller.extend(Comment...
fix: Use new relative import within directory See also: PSOBAT-1197
"""Generate base64 encoded User Data.""" import base64 from .get_template import get_template def generate_encoded_user_data(env='dev', region='us-east-1', app_name='', group_name=''): r"""Generate base64 encoded User Da...
"""Generate base64 encoded User Data.""" import base64 from ..utils import get_template def generate_encoded_user_data(env='dev', region='us-east-1', app_name='', group_name=''): r"""Generate base64 encoded User Data. ...
Fix missing import in merge conflict resolution
var _ = require('lodash'), AuthLoader = require('../authorizer/index').AuthLoader, createAuthInterface = require('../authorizer/auth-interface'), util = require('../authorizer/util'); module.exports = [ // Post authorization. function (context, run, done) { // if no response is provided, ...
var AuthLoader = require('../authorizer/index').AuthLoader, createAuthInterface = require('../authorizer/auth-interface'), util = require('../authorizer/util'); module.exports = [ // Post authorization. function (context, run, done) { // if no response is provided, there's nothing to do, and p...
Refactoring: Replace loop by dictionary comprehension
from excerptconverter.baseexcerptconverter import BaseExcerptConverter class ConverterManager: @staticmethod def converter_configuration(): return {Converter.__name__: Converter.converter_configuration() for Converter in BaseExcerptConverter.available_converters} def __init__(self...
from excerptconverter.baseexcerptconverter import BaseExcerptConverter class ConverterManager: @staticmethod def converter_configuration(): export_options = {} for Converter in BaseExcerptConverter.available_converters: export_options[Converter.__name__] = Converter.converter_confi...
Allow email and label to be null
Ext.define('SlateAdmin.model.person.progress.NoteRecipient', { extend: 'Ext.data.Model', groupField: 'RelationshipGroup', fields: [ { name: 'PersonID', type: 'integer' }, { name: 'FullName', type: 'string' }, { ...
Ext.define('SlateAdmin.model.person.progress.NoteRecipient', { extend: 'Ext.data.Model', groupField: 'RelationshipGroup', fields: [ { name: 'PersonID', type: 'integer' }, { name: 'FullName', type: 'string' }, { ...
Add source links for tweets
# coding=utf-8 # picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions # this file implements twitter-related functionality # Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org> import time import tweepy from . import logger class Client(object): name = "twi...
# coding=utf-8 # picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions # this file implements twitter-related functionality # Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org> import time import tweepy from . import logger class Client(object): name = "twi...
Fix instance variable in graph sync job
import datetime from cucoslib.models import Analysis, Package, Version, Ecosystem from cucoslib.workers import GraphImporterTask from .base import BaseHandler class SyncToGraph(BaseHandler): """ Sync all finished analyses to Graph DB """ def execute(self): start = 0 while True: re...
import datetime from cucoslib.models import Analysis, Package, Version, Ecosystem from cucoslib.workers import GraphImporterTask from .base import BaseHandler class SyncToGraph(BaseHandler): """ Sync all finished analyses to Graph DB """ def execute(self): start = 0 while True: re...
meta-iotqa: Remove Edison specific command from Bluetooth test The platform isn't supported anymore and the command isn't needed with current devices. Signed-off-by: Simo Kuusela <4755938158c3c622d3884e9a75ed20dc865bc695@intel.com>
import time from oeqa.oetest import oeRuntimeTest from oeqa.utils.decorators import tag @tag(TestType="FVT", FeatureID="IOTOS-453") class CommBluetoothTest(oeRuntimeTest): """ @class CommBluetoothTest """ log = "" def setUp(self): self.target.run('connmanctl enable bluetooth') time...
import time from oeqa.oetest import oeRuntimeTest from oeqa.utils.decorators import tag @tag(TestType="FVT", FeatureID="IOTOS-453") class CommBluetoothTest(oeRuntimeTest): """ @class CommBluetoothTest """ log = "" def setUp(self): self.target.run('connmanctl enable bluetooth') time...
Update German, French, Spanish, and Portugese-Brasil Translations All pulled by changing system language on PS4 and accessing Destiny in a different language.
(function() { "use strict"; // See https://angular-translate.github.io/docs/#/guide angular.module('dimApp') .config(['$translateProvider', function($translateProvider) { $translateProvider.useSanitizeValueStrategy('escape'); $translateProvider .translations('en', { Level: "Lev...
(function() { "use strict"; // See https://angular-translate.github.io/docs/#/guide angular.module('dimApp') .config(['$translateProvider', function($translateProvider) { $translateProvider.useSanitizeValueStrategy('escape'); $translateProvider .translations('en', { Level: "Lev...
Fix incompatibility with php 5.5 in tests
<?php namespace Eole\Sandstone\Tests\Unit\Websocket; use Eole\Sandstone\Serializer\ServiceProvider as SerializerServiceProvider; use Eole\Sandstone\Websocket\Routing\TopicRouter; use Eole\Sandstone\Websocket\Application as WebsocketApplication; use Eole\Sandstone\Application; class ApplicationTest extends \PHPUnit_F...
<?php namespace Eole\Sandstone\Tests\Unit\Websocket; use Eole\Sandstone\Serializer\ServiceProvider as SerializerServiceProvider; use Eole\Sandstone\Websocket\Routing\TopicRouter; use Eole\Sandstone\Websocket\Application as WebsocketApplication; use Eole\Sandstone\Application; class ApplicationTest extends \PHPUnit_F...
Add an answers function for state token strategy [rev: alex.scown]
/* * Copyright 2016 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define(['underscore'], function(_) { 'use strict'; const baseParams = function(queryModel) { return { text...
/* * Copyright 2016 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define(['underscore'], function(_) { 'use strict'; const baseParams = function(queryModel) { return { text...
Use latest build schema commit -> ref
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
from django.core.exceptions import ObjectDoesNotExist from db.models.repos import CodeReference def get_internal_code_reference(instance, commit=None): project = instance.project if not project.has_code: return None repo = project.repo if commit: try: return CodeReferen...
Fix warning on double sampleEnd (which is not true)
package com.googlecode.jmeter.plugins.webdriver.sampler; import org.apache.jmeter.samplers.SampleResult; import org.apache.jorphan.logging.LoggingManager; import org.apache.log.Logger; public class SampleResultWithSubs extends SampleResult { private static final Logger log = LoggingManager.getLoggerForClass(); ...
package com.googlecode.jmeter.plugins.webdriver.sampler; import org.apache.jmeter.samplers.SampleResult; import org.apache.jorphan.logging.LoggingManager; import org.apache.log.Logger; public class SampleResultWithSubs extends SampleResult { private static final Logger log = LoggingManager.getLoggerForClass(); ...
Fix error when setting JSON value to be `None` Previously this would raise an attribute error as `None` does not have the `coerce` attribute.
from sqlalchemy.ext.mutable import ( Mutable, MutableDict) from sqlalchemy_utils.types.json import JSONType from . track import ( TrackedDict, TrackedList) __all__ = 'MutableJson', 'NestedMutableJson' class NestedMutableDict(TrackedDict, Mutable): @classmethod def coerce(cls, key, value): ...
from sqlalchemy.ext.mutable import ( Mutable, MutableDict) from sqlalchemy_utils.types.json import JSONType from . track import ( TrackedDict, TrackedList) __all__ = 'MutableJson', 'NestedMutableJson' class NestedMutableDict(TrackedDict, Mutable): @classmethod def coerce(cls, key, value): ...
Fix loading error on API level 16 and 17
package com.wonderkiln.camerakit; import android.graphics.Rect; import java.nio.ByteBuffer; public class JpegTransformer { private ByteBuffer mHandler; public JpegTransformer(byte[] jpeg) { mHandler = jniStoreJpeg(jpeg, jpeg.length); } public byte[] getJpeg() { return jniCommit(mHa...
package com.wonderkiln.camerakit; import android.graphics.Rect; import java.nio.ByteBuffer; public class JpegTransformer { private ByteBuffer mHandler; public JpegTransformer(byte[] jpeg) { mHandler = jniStoreJpeg(jpeg, jpeg.length); } public byte[] getJpeg() { return jniCommit(mHa...
[REF] openacademy: Add domain or and ilike
# -*- coding: utf-8 -*- from openerp import fields, models ...
# -*- coding: utf-8 -*- from openerp import fields, models ...
Make future OSS test failures easier to debug Summary: Show test output on failure. Reviewed By: jstrizich Differential Revision: D6914371 fbshipit-source-id: 668feaefd80c3f0253787b89783cb615fe69bf9b
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals 'fbcode_builder steps to build & test Bistro' import specs.fbthrift as fbthrift import specs.folly as folly import specs.proxygen as proxygen from ...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals 'fbcode_builder steps to build & test Bistro' import specs.fbthrift as fbthrift import specs.folly as folly import specs.proxygen as proxygen from ...
Correct error in namespace declaration
<?php namespace DMS\Bundle\TwigExtensionBundle\Twig\Text; /** * Adds support for Padding a String in Twig */ class PadStringExtension extends \Twig_Extension { /** * Name of Extension * * @return string */ public function getName() { return 'PadStringExtension'; } /**...
<?php namespace DMS\Bundle\TwigExtensionBundle\Twig\Date; /** * Adds support for Padding a String in Twig */ class PadStringExtension extends \Twig_Extension { /** * Name of Extension * * @return string */ public function getName() { return 'PadStringExtension'; } /**...
Add black lines to hud cross
var ForgePlugins = ForgePlugins || {}; /** */ ForgePlugins.EditorHUD = function(editor) { this._editor = editor; this._canvas = null; this._options = { cross: true }; this._boot(); }; ForgePlugins.EditorHUD.prototype = { _boot: function() { this._canvas = this._editor.plugin.crea...
var ForgePlugins = ForgePlugins || {}; /** */ ForgePlugins.EditorHUD = function(editor) { this._editor = editor; this._canvas = null; this._options = { cross: true }; this._boot(); }; ForgePlugins.EditorHUD.prototype = { _boot: function() { this._canvas = this._editor.plugin.crea...
Add sort by downlaods for hex accuracy
<?php namespace WillFarrell\AlfredPkgMan; require_once('Cache.php'); require_once('Repo.php'); class Hex extends Repo { protected $id = 'hex'; protected $kind = 'components'; protected $url = 'https://hex.pm'; protected $search_url = 'https://hex.pm/api/packages?sort=downloads&sea...
<?php namespace WillFarrell\AlfredPkgMan; require_once('Cache.php'); require_once('Repo.php'); class Hex extends Repo { protected $id = 'hex'; protected $kind = 'components'; protected $url = 'https://hex.pm'; protected $search_url = 'https://hex.pm/api/packages?search='; pub...
Move transaction commit outside try block.
<?php /** * Copyright 2014 SURFnet bv * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
<?php /** * Copyright 2014 SURFnet bv * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
Add static factory method for settings.
package com.zygon.htm.core; import com.google.common.util.concurrent.AbstractScheduledService; import java.util.concurrent.TimeUnit; /** * * @author zygon */ public abstract class AbstractScheduledServiceImpl extends AbstractScheduledService { public static final class Settings { public static Setti...
package com.zygon.htm.core; import com.google.common.util.concurrent.AbstractScheduledService; import java.util.concurrent.TimeUnit; /** * * @author zygon */ public abstract class AbstractScheduledServiceImpl extends AbstractScheduledService { public static final class Settings { private...
Add nginx rules for pretty URLs
from __future__ import absolute_import, division, print_function, unicode_literals from os import path from nib import Resource, Processor, after apache_redirects = b""" RewriteCond %{DOCUMENT_ROOT}/$1/index.html -f RewriteRule ^(.*)$ /$1/index.html [L] RewriteCond %{DOCUMENT_ROOT}/$1.html -f RewriteRule ^(.*)$ /$1...
from __future__ import absolute_import, division, print_function, unicode_literals from os import path from nib import Resource, Processor, after apache_redirects = b""" RewriteCond %{DOCUMENT_ROOT}/$1/index.html -f RewriteRule ^(.*)$ /$1/index.html [L] RewriteCond %{DOCUMENT_ROOT}/$1.html -f RewriteRule ^(.*)$ /$1...
feat: Add function to remove reacted to urls
from . import parser from . import printer from . import firebase as fb from . import reaction as react def is_empty(events): return ((events is None) or (len(events) == 0)) def is_url(url_cache): return url_cache is not None def is_reaction(index): return index is not None def remove_url_from(url_c...
from . import parser from . import printer from . import firebase as fb from . import reaction as react def is_empty(events): return ((events is None) or (len(events) == 0)) def is_url(url_cache): return url_cache is not None def is_reaction(index): return index is not None def event_consumer(expect...
FIX Typo in requirements call to TreeDropdownField javascript resource
<?php namespace SilverStripe\Subsites\Forms; use SilverStripe\Control\Controller; use SilverStripe\Control\HTTPRequest; use SilverStripe\Forms\TreeDropdownField; use SilverStripe\View\Requirements; use SilverStripe\Subsites\State\SubsiteState; /** * Wraps around a TreedropdownField to add ability for temporary * s...
<?php namespace SilverStripe\Subsites\Forms; use SilverStripe\Control\Controller; use SilverStripe\Control\HTTPRequest; use SilverStripe\Forms\TreeDropdownField; use SilverStripe\View\Requirements; use SilverStripe\Subsites\State\SubsiteState; /** * Wraps around a TreedropdownField to add ability for temporary * s...
Replace depricated array helper method
<?php namespace SocialiteProviders\Manager; use Illuminate\Support\Arr; use SocialiteProviders\Manager\Contracts\ConfigInterface; trait ConfigTrait { /** * @var array */ protected $config; /** * @param \SocialiteProviders\Manager\Contracts\OAuth1\ProviderInterface|\SocialiteProviders\Mana...
<?php namespace SocialiteProviders\Manager; use SocialiteProviders\Manager\Contracts\ConfigInterface; trait ConfigTrait { /** * @var array */ protected $config; /** * @param \SocialiteProviders\Manager\Contracts\OAuth1\ProviderInterface|\SocialiteProviders\Manager\Contracts\OAuth2\Provide...
Reformat code to PEP-8 standards
# # Copyright 2014-2015 Boundary, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# # Copyright 2014-2015 Boundary, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Add set status text to java file
package seedu.watodo.ui; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Region; import seedu.watodo.model.task.ReadOnlyTask; public class TaskCard extends UiPart<Region> { private static final String FXM...
package seedu.watodo.ui; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Region; import seedu.watodo.model.task.ReadOnlyTask; public class TaskCard extends UiPart<Region> { private static final String FXM...
Add CSS class for button group items.
<?php // check if groups are not empty foreach ($groups as $key => $group) { $exists = false; foreach ($group as $action => $config) { $subaction = is_array($config) ? $action : $config; if (array_key_exists($subaction, $links)) { $exists = true; } } if (!$exists) { ...
<?php // check if groups are not empty foreach ($groups as $key => $group) { $exists = false; foreach ($group as $action => $config) { $subaction = is_array($config) ? $action : $config; if (array_key_exists($subaction, $links)) { $exists = true; } } if (!$exists) { ...
Fix that the logger was lost
<?php /* * (c) webfactory GmbH <info@webfactory.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Webfactory\ContentMapping\SourceAdapter\Propel; use Psr\Log\LoggerInterface; /** * Automagically implementation of the ...
<?php /* * (c) webfactory GmbH <info@webfactory.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Webfactory\ContentMapping\SourceAdapter\Propel; use Psr\Log\LoggerInterface; /** * Automagically implementation of the ...