text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Split too long funcall chain | package alita
import (
"bufio"
"fmt"
"io"
"strings"
)
type Aligner struct {
w io.Writer
Margin *Margin
Delimiter *Delimiter
Padding *Padding
lines [][]string
}
func NewAligner(w io.Writer) *Aligner {
return &Aligner{
w: w,
Margin: NewMargin(),
Delimiter: NewDelimiter(),
... | package alita
import (
"bufio"
"fmt"
"io"
"strings"
)
type Aligner struct {
w io.Writer
Margin *Margin
Delimiter *Delimiter
Padding *Padding
lines [][]string
}
func NewAligner(w io.Writer) *Aligner {
return &Aligner{
w: w,
Margin: NewMargin(),
Delimiter: NewDelimiter(),
... |
Enable touch events on old React versions | 'use strict';
var require = typeof require === 'undefined' ? function() {} : require;
var React = window.React || require('react');
var ReactDom = window.ReactDOM || require('react-dom') || React;
var ElementPan = React.createFactory(window.reactElementPan || require('react-element-pan'));
if (React.initializeTouchE... | 'use strict';
var require = typeof require === 'undefined' ? function() {} : require;
var React = window.React || require('react');
var ReactDom = window.ReactDOM || require('react-dom') || React;
var ElementPan = React.createFactory(window.reactElementPan || require('react-element-pan'));
// Simple image demo
React... |
Update deprecated excel kwarg in pandas | import pandas as pd
def _params_dict_to_dataframe(d):
s = pd.Series(d)
s.index.name = 'parameters'
f = pd.DataFrame({'values': s})
return f
def write_excel(filename, **kwargs):
"""Write data tables to an Excel file, using kwarg names as sheet names.
Parameters
----------
filenam... | import pandas as pd
def _params_dict_to_dataframe(d):
s = pd.Series(d)
s.index.name = 'parameters'
f = pd.DataFrame({'values': s})
return f
def write_excel(filename, **kwargs):
"""Write data tables to an Excel file, using kwarg names as sheet names.
Parameters
----------
filenam... |
Remove useless import of Entity | import fp from 'mostly-func';
// 返回值定制
export default function responder () {
return function (hook) {
// If it was an internal call then skip this hook
if (!hook.params.provider) {
return hook;
}
let metadata = {};
let data = hook.result;
let message = '';
if (hook.result && hook... | import Entity from 'mostly-entity';
import fp from 'mostly-func';
// 返回值定制
export default function responder () {
return function (hook) {
// If it was an internal call then skip this hook
if (!hook.params.provider) {
return hook;
}
let metadata = {};
let data = hook.result;
let messag... |
Add the simplest of simple `alert` error handling | "use strict";
var saveRow = require('../templates/save_row.html')();
module.exports = {
events: {
'click .save-item': '_handleSave'
},
render: function () {
this.$el.append(saveRow)
},
toggleLoaders: function (state) {
this.$('.save-item').prop('disabled', state);
this.$('.loader').toggle(st... | "use strict";
var saveRow = require('../templates/save_row.html')();
module.exports = {
events: {
'click .save-item': '_handleSave'
},
render: function () {
this.$el.append(saveRow)
},
toggleLoaders: function (state) {
this.$('.save-item').prop('disabled', state);
this.$('.loader').toggle(st... |
Add import for constants_from_enum to be able to use @gin.constants_from_enum
PiperOrigin-RevId: 198401971 | # coding=utf-8
# Copyright 2018 The Gin-Config Authors.
#
# 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 la... | # coding=utf-8
# Copyright 2018 The Gin-Config Authors.
#
# 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 la... |
Define handler for tracking log files | import sys
import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
class TrackingLogHandler(PatternMatchingEventHandler):
def on_created(self, event):
print event.__repr__()
print event.event_type, event.is_directory, event.src_path
if __name_... | import sys
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class TrackingEventHandler(FileSystemEventHandler):
def on_created(self, event):
pass
def on_moved(self, event):
pass
if __name__ == "__main__":
if len(sys.argv) > 1:
... |
Allow negative numbers in the GEOS string
The regular expression for parsing the GEOS string did not accept
negative numbers. This means if you selected a location in most parts of
the world the retrieve would fail and the map would center around the
default location.
Add optional hypen symbol to the GEOS regular exp... | import re
geos_ptrn = re.compile(
"^SRID=([0-9]{1,});POINT\((-?[0-9\.]{1,})\s(-?[0-9\.]{1,})\)$"
)
def geosgeometry_str_to_struct(value):
'''
Parses a geosgeometry string into struct.
Example:
SRID=5432;POINT(12.0 13.0)
Returns:
>> [5432, 12.0, 13.0]
'''
result = geos_pt... | import re
geos_ptrn = re.compile(
"^SRID=([0-9]{1,});POINT\(([0-9\.]{1,})\s([0-9\.]{1,})\)$"
)
def geosgeometry_str_to_struct(value):
'''
Parses a geosgeometry string into struct.
Example:
SRID=5432;POINT(12.0 13.0)
Returns:
>> [5432, 12.0, 13.0]
'''
result = geos_ptrn.m... |
Set targe class on csv document | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def read(self):
with open(self.path, 'rb') as infile:
reader = csv.reader(infile)
header = reader.next()
rows = []
for row in reader:
... |
Hide logout message on login | (function() {
'use strict';
var app = angular.module('radar.store');
function unauthorizedResponseFactory($q, session, notificationService, $state, $rootScope) {
var notification = null;
// Hide logout notification on login
$rootScope.$on('sessions.login', function() {
if (notification !== nu... | (function() {
'use strict';
var app = angular.module('radar.store');
function unauthorizedResponseFactory($q, session, notificationService, $state) {
return function(promise) {
return promise['catch'](function(response) {
// API endpoint requires login (token may have expired)
if (resp... |
Add preRemove callbcok for user to change email | <?php
namespace NyroDev\NyroCmsBundle\Model\Entity;
use NyroDev\NyroCmsBundle\Model\User as UserModel;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* User.
*
* @ORM\Table(name="user")
* @ORM\Entity(repositoryClass="NyroDev\NyroCmsBundle\Repository\Orm\UserRepository")
* @Gedmo\Log... | <?php
namespace NyroDev\NyroCmsBundle\Model\Entity;
use NyroDev\NyroCmsBundle\Model\User as UserModel;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* User.
*
* @ORM\Table(name="user")
* @ORM\Entity(repositoryClass="NyroDev\NyroCmsBundle\Repository\Orm\UserRepository")
* @Gedmo\Log... |
Fix navigation bar title display. | const product = require('../../utils/product.js')
Page({
data: {
toastAddProduct: true,
title: '',
id: 0,
quantity: 1,
product: {}
},
onLoad (params) {
var id = params.id
var product = wx.getStorageSync('products').find(function(i){
return i.id === id
})
this.setData({... | const product = require('../../utils/product.js')
Page({
data: {
toastAddProduct: true,
title: '',
id: 0,
quantity: 1,
product: {}
},
onLoad (params) {
var id = params.id
var product = wx.getStorageSync('products').find(function(i){
return i.id === id
})
this.setData({... |
Add 'addSynset' and 'getSynset' method declarations. | package com.github.semres;
import org.eclipse.rdf4j.repository.Repository;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
public class Database {
private List<SynsetSerializer> synsetSerializers;
private Repository repository;
private String baseIri... | package com.github.semres;
import org.eclipse.rdf4j.repository.Repository;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
public class Database {
private List<SynsetSerializer> synsetSerializers;
private Repository repository;
private String baseIri... |
dist/docker: Fix typo in "--overprovisioned" help text
Reported by Mathias Bogaert (@analytically).
Message-Id: <13c4d4f57d8c59965d44b353c9e1b869295d4df3@scylladb.com> | import argparse
def parse():
parser = argparse.ArgumentParser()
parser.add_argument('--developer-mode', default='1', choices=['0', '1'], dest='developerMode')
parser.add_argument('--seeds', default=None, help="specify seeds - if left empty will use container's own IP")
parser.add_argument('--cpuset', ... | import argparse
def parse():
parser = argparse.ArgumentParser()
parser.add_argument('--developer-mode', default='1', choices=['0', '1'], dest='developerMode')
parser.add_argument('--seeds', default=None, help="specify seeds - if left empty will use container's own IP")
parser.add_argument('--cpuset', ... |
Revert "id removed from the form"
This reverts commit 73764a51bae2973524a823df89495e4334ce14a2. | @push('js')
<script src="{{ asset('components/ckeditor4/ckeditor.js') }}"></script>
<script src="{{ asset('components/ckeditor4/config-full.js') }}"></script>
@endpush
@component('core::admin._buttons-form', ['model' => $model])
@endcomponent
{!! BootForm::hidden('id') !!}
<file-manager></file-manager>
<file... | @push('js')
<script src="{{ asset('components/ckeditor4/ckeditor.js') }}"></script>
<script src="{{ asset('components/ckeditor4/config-full.js') }}"></script>
@endpush
@component('core::admin._buttons-form', ['model' => $model])
@endcomponent
<file-manager></file-manager>
<file-field type="image" field="image... |
Allow steps to be placed in subdirectories | var Yadda = require('yadda'),
config = require('./configure'),
language = Yadda.localisation[upperCaseFirstLetter(config.language)],
fs = require('fs'),
glob = require('glob'),
path = require('path'),
chai = require('chai');
module.exports = (function () {
var library = language.library(),
... | var Yadda = require('yadda'),
config = require('./configure'),
language = Yadda.localisation[upperCaseFirstLetter(config.language)],
fs = require('fs'),
path = require('path'),
chai = require('chai');
module.exports = (function () {
var library = language.library(),
dictionary = new Yad... |
Use find_packages to ensure template library gets installed | from setuptools import setup, find_packages
setup(
name='twitter-text-py',
version='1.0.3',
description='A library for auto-converting URLs, mentions, hashtags, lists, etc. in Twitter text. Also does tweet validation and search term highlighting.',
author='Daniel Ryan',
author_email='dryan@dryan.c... | from setuptools import setup
setup(
name='twitter-text-py',
version='1.0.3',
description='A library for auto-converting URLs, mentions, hashtags, lists, etc. in Twitter text. Also does tweet validation and search term highlighting.',
author='Daniel Ryan',
author_email='dryan@dryan.com',
url='h... |
Set the navbar to reload, no matter the url. | /*
* @flow
*/
import React from 'react';
export default function Navbar() {
return (
<nav className="navbar navbar-default navbar-fixed-top navbar-inverse">
<div className="container-fluid">
<div className="navbar-header">
<a className="navbar-brand" href="/" onClick={(e) => {
... | /*
* @flow
*/
import React from 'react';
export default function Navbar() {
return (
<nav className="navbar navbar-default navbar-fixed-top navbar-inverse">
<div className="container-fluid">
<div className="navbar-header">
<a className="navbar-brand" href="/">
Bonsai - Trim... |
Fix syntax error for PHP 5.3 | <?php
namespace Concise\Console;
use Concise\Services\SyntaxRenderer;
use DateTime;
class TestColors
{
public function renderAll()
{
$renderer = new SyntaxRenderer();
$lines = array(
$renderer->render('? is null', array(null)),
$renderer->render('? does not equal ?', a... | <?php
namespace Concise\Console;
use Concise\Services\SyntaxRenderer;
use DateTime;
class TestColors
{
public function renderAll()
{
$renderer = new SyntaxRenderer();
$lines = array(
$renderer->render('? is null', array(null)),
$renderer->render('? does not equal ?', a... |
Use fractional seconds to compare | package org.jboss.msc.bench;
import java.util.concurrent.CountDownLatch;
import org.jboss.msc.registry.ServiceDefinition;
import org.jboss.msc.registry.ServiceRegistrationBatchBuilder;
import org.jboss.msc.registry.ServiceRegistry;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceContainer;
im... | package org.jboss.msc.bench;
import java.util.concurrent.CountDownLatch;
import org.jboss.msc.registry.ServiceDefinition;
import org.jboss.msc.registry.ServiceRegistrationBatchBuilder;
import org.jboss.msc.registry.ServiceRegistry;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceContainer;
im... |
Add support for CSS requires, and support to output json when required | var loaderUtils = require('loader-utils');
var sizeOf = require('image-size');
var fs = require('fs');
var path = require('path');
module.exports = function(content) {
this.cacheable && this.cacheable(true);
if(!this.emitFile) throw new Error('emitFile is required from module system');
this.addDependency(this.r... | var sizeOf = require('image-size');
var loaderUtils = require('loader-utils');
module.exports = function(content) {
this.cacheable && this.cacheable();
if(!this.emitFile) throw new Error('emitFile is required from module system');
this.addDependency(this.resourcePath);
var query = loaderUtils.parseQuery(this... |
Update now that ints aren't nullable | package service
import (
"strconv"
"github.com/rancher/norman/types"
"github.com/rancher/norman/types/convert"
v3 "github.com/rancher/types/client/project/v3"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/intstr"
)
func New(store types.Store) types.Store {
return &Store{
store,
}
}
type Store... | package service
import (
"strconv"
"github.com/rancher/norman/types"
"github.com/rancher/norman/types/convert"
v3 "github.com/rancher/types/client/project/v3"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/intstr"
)
func New(store types.Store) types.Store {
return &Store{
store,
}
}
type Store... |
Update BoardgameListComponent to accept more input | import React, { Component, PropTypes } from 'react';
export default class BoardgameListItem extends Component {
static propTypes = {
name: PropTypes.string.isRequired,
year: PropTypes.number,
thumbnail: PropTypes.string,
score: PropTypes.number
}
render() {
const { name, year, thumbnail, sco... | import React, { Component, PropTypes } from 'react';
export default class BoardgameListItem extends Component {
static propTypes = {
name: PropTypes.string.isRequired,
year: PropTypes.string
}
render() {
const { name, year } = this.props;
return (
<div className="media">
<div class... |
Use array for search columns | <?php
namespace WP_CLI\Fetchers;
use WP_User;
/**
* Fetch a WordPress user based on one of its attributes.
*/
class User extends Base {
/**
* The message to display when an item is not found.
*
* @var string
*/
protected $msg = "Invalid user ID, email or login: '%s'";
/**
* Get a user object by one ... | <?php
namespace WP_CLI\Fetchers;
use WP_User;
/**
* Fetch a WordPress user based on one of its attributes.
*/
class User extends Base {
/**
* The message to display when an item is not found.
*
* @var string
*/
protected $msg = "Invalid user ID, email or login: '%s'";
/**
* Get a user object by one ... |
Use HTTPS url for MathJax script | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.environ.get('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'))
MA... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2012
import os.path
# Some common constants and functions
(LANGUAGE_HOME_PAGE, MODULE_HOME_PAGE, SYNTAX_DOCUMENTATION) = range(3)
CONFIGURATION_DIR = (os.environ.get('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'))
MA... |
Check NCCL existence in test decorators | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... | import unittest
from cupy import cuda
from cupy.testing import attr
@unittest.skipUnless(cuda.nccl_enabled, 'nccl is not installed')
class TestNCCL(unittest.TestCase):
@attr.gpu
def test_single_proc_ring(self):
id = cuda.nccl.get_unique_id()
comm = cuda.nccl.NcclCommunicator(1, id, 0)
... |
Fix variabel naems in go unique chars. | package uniq_chars
import "fmt"
func IsAllUniqueChars (strings ...string) bool {
//Save Time
fmt.Println(strings)
//Iterate all runes and keep track of each we've seen O(n)
//MAP {runeVal: seen before}
charCounts := make(map[rune] bool)
for _, string := range strings {
for _, letterRune := range string {
... | package uniq_chars
import "fmt"
func IsAllUniqueChars (strings ...string) bool {
//Save Time
fmt.Println(strings)
//Iterate all runes and keep track of each we've seen O(n)
//MAP {runeVal: seen before}
charCounts := make(map[rune] bool)
for i, e := range strings {
for _, letterRune := range e {
if (charC... |
Call npm command line instead of using module. | module.exports = function(grunt) {
var fs = require("fs");
var path = require("path");
var SubProcess = require("../../utils/subprocess");
grunt.registerMultiTask("npm-install", "Runs npm install.", function() {
var options = this.options({
dest: "./out"
});
// Only install npm if modules ... | module.exports = function(grunt) {
var path = require("path");
grunt.registerMultiTask("npm-install", "Runs npm install.", function() {
var done = this.async();
var fs = require("fs");
var npm = require("npm");
var options = this.options({
dest: "./out"
});
// Only instal... |
Revert to "Updated daily" msg. | 'use strict';
var app = require('../../util/app');
var viewLocals = require('../../middleware/view-locals');
var siteNav = require('../../middleware/site-navigation');
var battlegroundData = require('../data/').battlegroundData;
var forecastData = require('../data/').forecastData;
var parties = require('uk-political-p... | 'use strict';
var app = require('../../util/app');
var viewLocals = require('../../middleware/view-locals');
var siteNav = require('../../middleware/site-navigation');
var battlegroundData = require('../data/').battlegroundData;
var forecastData = require('../data/').forecastData;
var parties = require('uk-political-p... |
Remove duplicate check on redux.reducer | import { each } from 'lodash';
import mergeConfigs from '../bin/merge-configs';
function validateConfig(config) {
const errors = [];
if (!config) {
errors.push('==> ERROR: No configuration supplied.');
}
if (config.server) {
if (!config.server.host) {
errors.push('==> ERROR: No host param... | import { each } from 'lodash';
import mergeConfigs from '../bin/merge-configs';
function validateConfig(config) {
const errors = [];
if (!config) {
errors.push('==> ERROR: No configuration supplied.');
}
if (config.server) {
if (!config.server.host) {
errors.push('==> ERROR: No host param... |
Add nullable to corecontentlistner methods parameters | package it.near.sdk.Utils;
import android.content.Intent;
import android.support.annotation.Nullable;
import it.near.sdk.Reactions.Content.Content;
import it.near.sdk.Reactions.Coupon.Coupon;
import it.near.sdk.Reactions.CustomJSON.CustomJSON;
import it.near.sdk.Reactions.Feedback.Feedback;
import it.near.sdk.Reactio... | package it.near.sdk.Utils;
import android.content.Intent;
import it.near.sdk.Reactions.Content.Content;
import it.near.sdk.Reactions.Coupon.Coupon;
import it.near.sdk.Reactions.CustomJSON.CustomJSON;
import it.near.sdk.Reactions.Feedback.Feedback;
import it.near.sdk.Reactions.Poll.Poll;
import it.near.sdk.Reactions.S... |
Change russian language string to "ru_RU" | 'use strict';
angular.module('yaru22.angular-timeago').config(function(timeAgoSettings) {
timeAgoSettings.strings['ru_RU'] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: 'назад',
suffixFromNow: null,
seconds: 'меньше минуты',
minute: 'около минуты',
minutes: '%d мин.',
hour: 'ок... | 'use strict';
angular.module('yaru22.angular-timeago').config(function(timeAgoSettings) {
timeAgoSettings.strings['ru'] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: 'назад',
suffixFromNow: null,
seconds: 'меньше минуты',
minute: 'около минуты',
minutes: '%d мин.',
hour: 'около... |
Change webserver-ext status to beta. | package org.develnext.jphp.ext.webserver;
import org.develnext.jphp.ext.webserver.classes.PWebRequest;
import org.develnext.jphp.ext.webserver.classes.PWebResponse;
import org.develnext.jphp.ext.webserver.classes.PWebServer;
import php.runtime.env.CompileScope;
import php.runtime.ext.support.Extension;
import javax.s... | package org.develnext.jphp.ext.webserver;
import org.develnext.jphp.ext.webserver.classes.PWebRequest;
import org.develnext.jphp.ext.webserver.classes.PWebResponse;
import org.develnext.jphp.ext.webserver.classes.PWebServer;
import php.runtime.env.CompileScope;
import php.runtime.ext.support.Extension;
import javax.s... |
Send X-Requested-With header if app is extension |
define([
'jquery',
'underscore',
'backbone',
'helpers/app'
], function ($, _, Backbone, AppHelper) {
var Search = Backbone.Collection.extend ({
query: '',
url: function () {
return AppHelper.urlPrefix + 'autocomplete/query?q=' +
escape (this.query);
},
parse: function ... |
define([
'jquery',
'underscore',
'backbone',
'helpers/app'
], function ($, _, Backbone, AppHelper) {
var Search = Backbone.Collection.extend ({
query: '',
url: function () {
return AppHelper.urlPrefix + 'autocomplete/query?q=' +
escape (this.query);
},
parse: function ... |
Update public keyword regular expression. | 'use strict';
const matchPublic = /^\s*public\s*(.*)$/;
class Controller {
constructor() {
this.commands = [];
}
addCommand( name ) {
const Command = require( './command/' + name );
const instance = new Command( this );
this.commands.push( instance );
}
handleRequest( request ) {
const values = matc... | 'use strict';
const matchPublic = /^\s*public\s*(\S*)$/;
class Controller {
constructor() {
this.commands = [];
}
addCommand( name ) {
const Command = require( './command/' + name );
const instance = new Command( this );
this.commands.push( instance );
}
handleRequest( request ) {
const values = mat... |
Add Triangle to shape tests | import pytest
from unittest import TestCase
from stylo.shape import Ellipse, Circle, Rectangle, Square, Triangle
from stylo.testing.shape import BaseShapeTest
@pytest.mark.shape
class TestEllipse(TestCase, BaseShapeTest):
"""Tests for the :code:`Ellipse` shape."""
def setUp(self):
self.shape = Ellip... | import pytest
from unittest import TestCase
from stylo.shape import Ellipse, Circle, Rectangle, Square
from stylo.testing.shape import BaseShapeTest
@pytest.mark.shape
class TestEllipse(TestCase, BaseShapeTest):
"""Tests for the :code:`Ellipse` shape."""
def setUp(self):
self.shape = Ellipse(0, 0, 1... |
Revert "chore: disable sauce tests for now"
This reverts commit 28a0a9db5263bb5408507f520b6fe6aa7404b13b. | const options = {
frameworks: ['kocha', 'browserify'],
files: [
'packages/karma-kocha/__tests__/*.js'
],
preprocessors: {
'packages/karma-kocha/__tests__/*.js': ['browserify']
},
browserify: { debug: true },
reporters: ['progress'],
browsers: ['Chrome'],
singleRun: true,
plugins: [
requi... | const options = {
frameworks: ['kocha', 'browserify'],
files: [
'packages/karma-kocha/__tests__/*.js'
],
preprocessors: {
'packages/karma-kocha/__tests__/*.js': ['browserify']
},
browserify: { debug: true },
reporters: ['progress'],
browsers: ['Chrome'],
singleRun: true,
plugins: [
requi... |
Update the PyPI version to 0.2.20. | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.20',
packages=['todoist', 'todoist.managers'],
author='Doist Team... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.19',
packages=['todoist', 'todoist.managers'],
author='Doist Team... |
Add new fxn to null out chars in str range | /**
* Find indices of all occurance of elem in arr. Uses 'indexOf'.
* @param {array} arr - Array-like element (works with strings too!).
* @param {array_element} elem - Element to search for in arr.
* @return {array} indices - Array of indices where elem occurs in arr.
*/
var findAllIndices = function(arr, elem) {... | /**
* Find indices of all occurance of elem in arr. Uses 'indexOf'.
* @param {array} arr - Array-like element (works with strings too!).
* @param {array_element} elem - Element to search for in arr.
* @return {array} indices - Array of indices where elem occurs in arr.
*/
var findAllIndices = function(arr, elem) {... |
Remove reference to non-existent js file. | <!DOCTYPE html>
<html lang="en">
<head>
<title><?=$page_title || "Simple Paste" ?> by EpochWolf</title>
<meta charset="utf-8">
<meta http_equiv="X-UA-Compatible" content="IE=edge;chrome=1">
<meta name="author" content="epochwolf">
<meta name="viewport" content="width=device-width, initial-scale=... | <!DOCTYPE html>
<html lang="en">
<head>
<title><?=$page_title || "Simple Paste" ?> by EpochWolf</title>
<meta charset="utf-8">
<meta http_equiv="X-UA-Compatible" content="IE=edge;chrome=1">
<meta name="author" content="epochwolf">
<meta name="viewport" content="width=device-width, initial-scale=... |
Add notice in the example of servers-side scripting with Lua. | <?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require 'SharedConfigurations.php';
// This example will not work with version... | <?php
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require 'SharedConfigurations.php';
// Additionally to the EVAL command define... |
Switch order of login post-processing
To try to close re-submit window? See #4784 | 'use strict';
app.directive('loginForm', [
'$route', 'modelService', 'routerService', '$timeout',
function ($route, models, router, $timeout) { return {
restrict: 'E',
templateUrl: 'party/loginForm.html',
link: function ($scope) {
var form = $scope.loginForm;
form.data = {};
form.su... | 'use strict';
app.directive('loginForm', [
'$route', 'modelService', 'routerService', '$timeout',
function ($route, models, router, $timeout) { return {
restrict: 'E',
templateUrl: 'party/loginForm.html',
link: function ($scope) {
var form = $scope.loginForm;
form.data = {};
form.su... |
Add the documentation to the web site. | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = 'bgware-subscribe@lists.em.ca'
... | # Template makedist.py file
# Set WEBSITE to the name of the web site that this package will be
# deposited in. The URL will always be:
# http://$WEBSITE/$PACKAGE/
WEBSITE = 'untroubled.org'
# If LISTSUB is set, makedist will add a note regarding mailing list
# subscription.
LISTSUB = 'bgware-subscribe@lists.em.ca'
... |
Update for 1.6.0 - TODO: add Windows | from setuptools import setup
setup(
name = 'brunnhilde',
version = '1.6.0',
url = 'https://github.com/timothyryanwalsh/brunnhilde',
author = 'Tim Walsh',
author_email = 'timothyryanwalsh@gmail.com',
py_modules = ['brunnhilde'],
scripts = ['brunnhilde.py'],
description = 'A Siegfried-bas... | from setuptools import setup
setup(
name = 'brunnhilde',
version = '1.5.3',
url = 'https://github.com/timothyryanwalsh/brunnhilde',
author = 'Tim Walsh',
author_email = 'timothyryanwalsh@gmail.com',
py_modules = ['brunnhilde'],
scripts = ['brunnhilde.py'],
description = 'A Siegfried-bas... |
[TACHYON-1559] Fix checkstyle errors originating out of changes | /*
* Licensed to the University of California, Berkeley under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may no... | /*
* Licensed to the University of California, Berkeley under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may no... |
Use a constant for the 'HASHBROWN_SWITCH_DEFAULTS' settings key so it is easier to re-use. | from django.conf import settings
from .models import Switch
SETTINGS_KEY = 'HASHBROWN_SWITCH_DEFAULTS'
def is_active(label, user=None):
defaults = getattr(settings, SETTINGS_KEY, {})
globally_active = defaults[label].get(
'globally_active',
False) if label in defaults else False
descri... | from django.conf import settings
from .models import Switch
def is_active(label, user=None):
defaults = getattr(settings, 'HASHBROWN_SWITCH_DEFAULTS', {})
globally_active = defaults[label].get(
'globally_active',
False) if label in defaults else False
description = defaults[label].get(
... |
Python: Refactor PyYAML tests a bit | import yaml
# Unsafe:
yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput
yaml.load(payload, yaml.Loader) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput
yaml.unsafe_load(payload) # $ decodeInput=payload decodeOutput=Attri... | import yaml
from yaml import SafeLoader
yaml.load(payload) # $decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML decodeMayExecuteInput
yaml.load(payload, SafeLoader) # $ decodeInput=payload decodeOutput=Attribute() decodeFormat=YAML
yaml.load(payload, Loader=SafeLoader) # $decodeInput=payload decodeOutp... |
Add _all__ to the module. | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
Fix name of register mime encoder function | // Copyright © 2009--2013 The Web.go Authors
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package web
import (
"encoding/json"
"encoding/xml"
"io"
)
// Encode arbitrary data to a response
type Encoder interface {
Encode(data interface{}) error
}
type Mi... | // Copyright © 2009--2013 The Web.go Authors
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package web
import (
"encoding/json"
"encoding/xml"
"io"
)
// Encode arbitrary data to a response
type Encoder interface {
Encode(data interface{}) error
}
type Mi... |
Fix the tests by mocking the response | from talks.settings import *
INSTALLED_APPS += ('django_nose',)
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
DEBUG = True
RAVEN_CONFIG = {}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backe... | from talks.settings import *
INSTALLED_APPS += ('django_nose',)
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
DEBUG = True
RAVEN_CONFIG = {}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backe... |
Add tests for all builtins | import pytest
import sncosmo
from sncosmo.bandpasses import _BANDPASSES, _BANDPASS_INTERPOLATORS
from sncosmo.magsystems import _MAGSYSTEMS
from sncosmo.models import _SOURCES
bandpasses = [i['name'] for i in _BANDPASSES.get_loaders_metadata()]
bandpass_interpolators = [i['name'] for i in
... | import pytest
import sncosmo
@pytest.mark.might_download
def test_hst_bands():
""" check that the HST and JWST bands are accessible """
for bandname in ['f606w', 'uvf606w', 'f125w', 'f127m',
'f115w']: # jwst nircam
sncosmo.get_bandpass(bandname)
@pytest.mark.might_download
de... |
Fix ChildPages_Teaser for invisible page | <?php
class Kwc_List_ChildPages_Teaser_Generator extends Kwf_Component_Generator_Table
{
protected $_hasNumericIds = false;
protected $_idColumn = 'child_id';
protected $_useComponentId = true;
protected function _formatConfig($parentData, $row)
{
$ret = parent::_formatConfig($parentData, $... | <?php
class Kwc_List_ChildPages_Teaser_Generator extends Kwf_Component_Generator_Table
{
protected $_hasNumericIds = false;
protected $_idColumn = 'child_id';
protected $_useComponentId = true;
protected function _formatConfig($parentData, $row)
{
$ret = parent::_formatConfig($parentData, $... |
Add option that fixes slow Selenium webdriver startup on systems with low entropy (e.g. VMs). | exports.config = {
capabilities: {'browserName': 'chrome'},
/*multiCapabilities: [
{'browserName': 'chrome'},
{'browserName': 'firefox'},
{'browserName': 'opera'},
{'browserName': 'safari'}
],*/
framework: 'jasmine2',
jasmineNodeOpts: {
showColors: true
},... | exports.config = {
capabilities: {'browserName': 'chrome'},
/*multiCapabilities: [
{'browserName': 'chrome'},
{'browserName': 'firefox'},
{'browserName': 'opera'},
{'browserName': 'safari'}
],*/
framework: 'jasmine2',
jasmineNodeOpts: {
showColors: true
},... |
[studio-hints] Fix position of toggleSidecarButton in the navbar | /* eslint-disable prefer-template */
import React from 'react'
import {
isSidecarOpenSetting,
toggleSidecarOpenState
} from 'part:@sanity/default-layout/sidecar-datastore'
import Button from 'part:@sanity/components/buttons/default'
import HelpCircleIcon from 'part:@sanity/base/help-circle-icon'
export default cl... | /* eslint-disable prefer-template */
import React from 'react'
import {
isSidecarOpenSetting,
toggleSidecarOpenState
} from 'part:@sanity/default-layout/sidecar-datastore'
import Button from 'part:@sanity/components/buttons/default'
import HelpCircleIcon from 'part:@sanity/base/help-circle-icon'
export default cl... |
Check for 2.8, not 1.8 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005 Fluendo, S.L. (www.fluendo.com). All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Fou... | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005 Fluendo, S.L. (www.fluendo.com). All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Fou... |
Store the dictItem keys in a map to avoid searching the dict for objects with matching keys (this cut performance tests from 5000ms to 150ms) | 'use strict';
var markovDictionaryBuilder = (function() {
function buildDict(wordSet, chainSize) {
console.log("building dictionary from " + wordSet.length + " words with a chain size of " + chainSize);
var map = [];
var dict = [];
for (var i = 0, len = wordSet.length - chainSize; i < len; i++) {
va... | 'use strict';
var markovDictionaryBuilder = (function() {
function buildDict(wordSet, chainSize) {
console.log("building dictionary from " + wordSet.length + " words with a chain size of " + chainSize);
var dict = [];
for (var i = 0, len = wordSet.length - chainSize; i < len; i++) {
var end = i + parse... |
Fix spacing in demo for FileUpload. | package to.etc.domuidemo.pages.overview.allcomponents;
import to.etc.domui.component.layout.ContentPanel;
import to.etc.domui.component.upload.FileUpload2;
import to.etc.domui.component.upload.FileUploadMultiple;
import to.etc.domui.component2.form4.FormBuilder;
import to.etc.domui.dom.html.Div;
import to.etc.domui.do... | package to.etc.domuidemo.pages.overview.allcomponents;
import to.etc.domui.component.upload.FileUpload2;
import to.etc.domui.component.upload.FileUploadMultiple;
import to.etc.domui.component2.form4.FormBuilder;
import to.etc.domui.dom.html.Div;
import to.etc.domui.dom.html.HTag;
/**
* @author <a href="mailto:jal@et... |
Set 10.11.0 as minimum macOS version in the .app bundle | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... |
Switch to local JS/CSS assets - bump version. | from setuptools import setup, find_packages
setup(
name='wagtailcodeblock',
version="0.2.3",
description='Wagtail Code Block provides PrismJS syntax highlighting in Wagtail.',
long_description='A work-in-progress alpha of a Wagtail Streamfield block for source code with real-time syntax highlighting.',
... | from setuptools import setup, find_packages
setup(
name='wagtailcodeblock',
version="0.2.2",
description='Wagtail Code Block provides PrismJS syntax highlighting in Wagtail.',
long_description='A work-in-progress alpha of a Wagtail Streamfield block for source code with real-time syntax highlighting.',
... |
Make sure to load the current module, not some other global one. | #!/usr/bin/env node
/**
Provide mdb-aggregate, a MongoDB style aggregation pipeline, to NodeJS.
Copyright (C) 2014 Charles J. Ezell III
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either... | #!/usr/bin/env node
/**
Provide mdb-aggregate, a MongoDB style aggregation pipeline, to NodeJS.
Copyright (C) 2014 Charles J. Ezell III
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either... |
Add target to open in a new tab | import React from 'react';
import styled from 'styled-components';
import generalInfos from '../../globals/data/general-info';
const Infos = styled.section`
text-align: center;
margin: 0.67em 0;
`;
const Name = styled.h1`
font-size: 2.5rem;
@media (max-width: 600px) {
font-size: 2.2rem;
}
`;
const Info... | import React from 'react';
import styled from 'styled-components';
import generalInfos from '../../globals/data/general-info';
const Infos = styled.section`
text-align: center;
margin: 0.67em 0;
`;
const Name = styled.h1`
font-size: 2.5rem;
@media (max-width: 600px) {
font-size: 2.2rem;
}
`;
const Info... |
Make batch less, because sqlite cannot handle big batches | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... |
Change NB timeout to 2 minutes, was 10 seconds | /* Copyright 2017 Telstra Open Source
*
* 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 la... | /* Copyright 2017 Telstra Open Source
*
* 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 la... |
Set `include css: true` option for Stylus |
module.exports = function(gulp, config) {
return function(done) {
if(!config.styles) return done()
var c = require('better-console')
c.info('~ styles')
var cssmin = require('gulp-cssmin')
var gulpFilter = require('gulp-filter')
var nib = require('nib')
var path = require('path')
var plumber = requir... |
module.exports = function(gulp, config) {
return function(done) {
if(!config.styles) return done()
var c = require('better-console')
c.info('~ styles')
var cssmin = require('gulp-cssmin')
var gulpFilter = require('gulp-filter')
var nib = require('nib')
var path = require('path')
var plumber = requir... |
Use custom endpoint url in AWS_HOST_URL variable | from django.conf import settings
AWS_ACCESS_KEY_ID = getattr(settings, 'AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = getattr(settings, 'AWS_SECRET_ACCESS_KEY')
AWS_STATIC_BUCKET_NAME = getattr(settings, 'AWS_STATIC_BUCKET_NAME')
AWS_MEDIA_ACCESS_KEY_ID = getattr(
settings, 'AWS_MEDIA_ACCESS_KEY_ID', AWS_ACCESS_KE... | from django.conf import settings
AWS_ACCESS_KEY_ID = getattr(settings, 'AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = getattr(settings, 'AWS_SECRET_ACCESS_KEY')
AWS_STATIC_BUCKET_NAME = getattr(settings, 'AWS_STATIC_BUCKET_NAME')
AWS_MEDIA_ACCESS_KEY_ID = getattr(
settings, 'AWS_MEDIA_ACCESS_KEY_ID', AWS_ACCESS_KE... |
Remove Contexts for now so we don't step in to dependency hell | define(['underscore', 'jquery'], function(_, $) {
return function(app) {
app.components.before('initialize', function() {
"use strict";
if (this.require && this.require.paths) {
var dfd = $.Deferred();
var requireConfig = this.require;
var localRequire = require.config(_.extend... | define(['underscore', 'jquery'], function(_, $) {
return function(app) {
app.components.before('initialize', function() {
"use strict";
if (this.require && this.require.paths) {
var dfd = $.Deferred();
var requireConfig = this.require;
var localRequire = require.config(_.extend... |
Use find_packages instead of listing them manually. | # coding: utf-8
from setuptools import find_packages, setup
# lets prepare our initial setup
setup_dict = {'name': 'PYSCSI',
'version': '1.0',
'license': 'LGPLv2.1',
'author': 'Ronnie Sahlberg',
'author_email': 'ronniesahlberg@gmail.com',
'descript... | # coding: utf-8
from setuptools import setup
# lets prepare our initial setup
setup_dict = {'name': 'PYSCSI',
'version': '1.0',
'license': 'LGPLv2.1',
'author': 'Ronnie Sahlberg',
'author_email': 'ronniesahlberg@gmail.com',
'description': 'Module f... |
Add link to geolocation example into sitemap | import Ember from "ember";
export default Ember.Controller.extend({
sitemap: {
nodes: [
{ link: "index", title: "Home" },
{
title: "Admin panel",
children: [
{ link: "suggestionTypes", title: "Suggestion Types" },
{ link: "users", title: "Application Users" }
... | import Ember from 'ember';
export default Ember.Controller.extend({
sitemap: {
nodes: [
{
link: 'index',
title: 'Home',
children: null
},
{
link: null,
title: 'Admin panel',
children: [
{
link: 'suggestionTypes',
... |
Remove an import that deprecated and unused | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from tabledata import DataError, InvalidHeaderNameError, InvalidTableNameError
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._constant impo... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from tabledata import (
DataError,
EmptyDataError,
InvalidDataError,
InvalidHeaderNameError,
InvalidTableNameError,
)
from .__version__ import __author__, __copyright_... |
Fix raw md content rendering | # -*- coding: utf-8 -*-
from markdown2 import markdown, markdown_path
from weasyprint import HTML, CSS
from .exceptions import ValidationError
__title__ = 'md2pdf'
__version__ = '0.2.1'
__author__ = 'Julien Maupetit'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 Julien Maupetit'
def md2pdf(pdf_file_path, md_... | # -*- coding: utf-8 -*-
from markdown2 import markdown, markdown_path
from weasyprint import HTML, CSS
from .exceptions import ValidationError
__title__ = 'md2pdf'
__version__ = '0.2.1'
__author__ = 'Julien Maupetit'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 Julien Maupetit'
def md2pdf(pdf_file_path, md_... |
Update import to correct path for Django 1.4->1.6 compatibility | from django.utils.functional import Promise
from django.utils.encoding import force_unicode
def resolve_promise(o):
if isinstance(o, dict):
for k, v in o.items():
o[k] = resolve_promise(v)
elif isinstance(o, (list, tuple)):
o = [resolve_promise(x) for x in o]
elif isinstance(o, ... | from django.utils.functional import Promise
from django.utils.translation import force_unicode
def resolve_promise(o):
if isinstance(o, dict):
for k, v in o.items():
o[k] = resolve_promise(v)
elif isinstance(o, (list, tuple)):
o = [resolve_promise(x) for x in o]
elif isinstance... |
Clean up data table value-based row classes | <?php
namespace ATPViz\Widget;
class DataTable extends \ATPViz\Widget\AbstractWidget
{
public function __construct()
{
parent::__construct();
$this->setTemplate('atp-viz/widget/dataTable.phtml');
}
public function getClasses($row)
{
$classes = array();
if(isset($this->classFields))
... | <?php
namespace ATPViz\Widget;
class DataTable extends \ATPViz\Widget\AbstractWidget
{
public function __construct()
{
parent::__construct();
$this->setTemplate('atp-viz/widget/dataTable.phtml');
}
public function getClasses($row)
{
$classes = array();
if(isset($this->classFields))
... |
[FIX] module_auto_update: Rollback cursor if param exists
Without this patch, when upgrading after you have stored the deprecated features parameter, the cursor became broken and no more migrations could happen. You got this error:
Traceback (most recent call last):
File "/usr/local/bin/odoo", line 6, in <mod... | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... |
Set urls for bucketlist items endpoints | from flask_restful import Api
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from app import app, db
from app.auth import Register, Login
from app.bucketlist_api import BucketLists, BucketListSingle
from app.bucketlist_items import BucketListItems, BucketListItemSingle
migrate = Mig... | from flask_restful import Api
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from app import app
from app import db
from app.auth import Register, Login
from app.bucketlist_api import BucketList, BucketListEntry
from app.bucketlist_items import BucketListItems, BucketListItemSingle
... |
Fix preflight fn to match request path against preflight config path, not the other way around | /**
* Module dependencies.
*/
var _ = require('lodash');
var pathToRegexp = require('path-to-regexp');
/**
* @optional {Dictionary} _routeCorsConfig
*
* @optional {Boolean} isOptionsRoute
* if set, use the `access-control-request-method` header
* as the method when looking up the route... | /**
* Module dependencies.
*/
var _ = require('lodash');
var pathToRegexp = require('path-to-regexp');
/**
* @optional {Dictionary} _routeCorsConfig
*
* @optional {Boolean} isOptionsRoute
* if set, use the `access-control-request-method` header
* as the method when looking up the route... |
Set parameter name for flag | package main
import (
"flag"
"fmt"
"os"
"github.com/glaslos/tlsh"
)
var (
// VERSION is set by the makefile
VERSION = "v0.0.0"
// BUILDDATE is set by the makefile
BUILDDATE = ""
)
func main() {
var file = flag.String("f", "", "path to the `file` to be hashed")
var raw = flag.Bool("r", false, "set to get o... | package main
import (
"flag"
"fmt"
"os"
"github.com/glaslos/tlsh"
)
var (
// VERSION is set by the makefile
VERSION = "v0.0.0"
// BUILDDATE is set by the makefile
BUILDDATE = ""
)
func main() {
var file = flag.String("f", "", "path to the file to be hashed")
var raw = flag.Bool("r", false, "set to get onl... |
Stop the host on window unload | const {
getQueryStringParam,
substanceGlobals,
platform
} = window.substance
const {
StencilaDesktopApp
} = window.stencila
const ipc = require('electron').ipcRenderer
const darServer = require('dar-server')
const { FSStorageClient } = darServer
const url = require('url')
const path = require('path')
const re... | const {
getQueryStringParam,
substanceGlobals,
platform
} = window.substance
const {
StencilaDesktopApp
} = window.stencila
const ipc = require('electron').ipcRenderer
const darServer = require('dar-server')
const { FSStorageClient } = darServer
const url = require('url')
const path = require('path')
const re... |
Fix bug in ticker widget width set | /**
* Shows arbitrary text in a news ticker-like fashion.
*
* The widget is designed to have a very small height in comparison to its width. This can be
* achieved by increasing the granularity of the widget sizes in the config, e.g. by setting the
* `dim[1]` of the grid to a high value and scaling accordingly the... | /**
* Shows arbitrary text in a news ticker-like fashion.
*
* The widget is designed to have a very small height in comparison to its width. This can be
* achieved by increasing the granularity of the widget sizes in the config, e.g. by setting the
* `dim[1]` of the grid to a high value and scaling accordingly the... |
Refactor region utils a bit and add a method | import assert from 'assert'
const TYPE_TO_PREFIX = {
municipality: 'K',
borough: 'B',
county: 'F',
commerceRegion: 'N'
}
const PREFIX_TO_TYPE = Object.keys(TYPE_TO_PREFIX).reduce((acc, key) => {
acc[TYPE_TO_PREFIX[key]] = key
return acc
}, {})
const REGION_TYPE_TO_ID_FIELD_MAPPING = {
municipality: 'kom... | import assert from 'assert'
const TYPE_TO_PREFIXES = {
municipality: 'K',
borough: 'B',
county: 'F',
commerceRegion: 'N'
}
// we might need this reverse mapping at some point later
//const PREFIX_TO_TYPE = Object.keys(TYPE_TO_PREFIXES).reduce((acc, key) => {
// acc[TYPE_TO_PREFIXES[key]] = key
// return acc
... |
Use search.rnacentral.org as the sequence search endpoint | """
Copyright [2009-2019] EMBL-European Bioinformatics Institute
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 a... | """
Copyright [2009-2019] EMBL-European Bioinformatics Institute
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 a... |
Revert "Added ip address in order to access the debug toolbar"
This reverts commit 59832b211b7ddefe84f723bac08849a4feda0798. | <?php
use Symfony\Component\Debug\Debug;
$filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']);
if (php_sapi_name() === 'cli-server' && is_file($filename)) {
return false;
}
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel f... | <?php
use Symfony\Component\Debug\Debug;
$filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']);
if (php_sapi_name() === 'cli-server' && is_file($filename)) {
return false;
}
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel f... |
chore: Update to Inheritance Inversion HOC | // core
import React, { PropTypes, Component } from 'react';
import { BackAndroid } from 'react-native';
// utils
import isAndroid from '../utils/isAndroid.js';
export default function hardwareBackPress(MyComponent) {
if (isAndroid()) {
return class EnhancedComponent extends MyComponent {
static contextTyp... | // core
import React, { PropTypes, Component } from 'react';
import { BackAndroid } from 'react-native';
// utils
import isAndroid from '../utils/isAndroid.js';
export default function hardwareBackPress(MyComponent) {
if (isAndroid()) {
class EnhancedComponent extends Component {
static contextTypes = {
... |
Increase apk size limit to 4.5MB | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Check APK file size for limit
from os import path, listdir, stat
from sys import exit
SIZE_LIMIT = 4500000
PATH = pa... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Check APK file size for limit
from os import path, listdir, stat
from sys import exit
SIZE_LIMIT = 4194304
PATH = pa... |
Remove extra double quote from docstring
The extra " was visible on
http://docs.openstack.org/developer/python-swiftclient/swiftclient.html
Change-Id: I7d61c8259a4f13464c11ae7e3fa28eb3a58e4baa | # -*- encoding: utf-8 -*-
# Copyright (c) 2012 Rackspace
# flake8: noqa
# 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 ... | # -*- encoding: utf-8 -*-
# Copyright (c) 2012 Rackspace
# flake8: noqa
# 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 ... |
Fix job timer during build. | /* eslint-disable no-console */
const writeLine = (line) => console.log(line);
/* eslint-enable no-console */
const runTask = async (task) => {
const startTime = Date.now();
writeLine(`Starting ${task.name}`);
return new Promise(task)
.catch((err) => {
writeLine(err);
proc... | /* eslint-disable no-console */
const writeLine = (line) => console.log(line);
/* eslint-enable no-console */
const runTask = async (task) => {
const startTime = Date.now();
writeLine(`Starting ${task.name}`);
await new Promise(task)
.catch((err) => {
writeLine(err);
proce... |
Fix long_description, bump to 2.0.1 | #!/usr/bin/env python
import pathlib
from setuptools import setup
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "README.rst").read_text(encoding='utf-8')
setup(
name='od',
version='2.0.1',
description='Shorthand syntax for building OrderedDicts',
long_description=long_de... | #!/usr/bin/env python
from setuptools import setup
setup(
name='od',
version='2.0.0',
description='Shorthand syntax for building OrderedDicts',
license='MIT',
url='https://github.com/epsy/od',
author='Yann Kaiser',
author_email='kaiser.yann@gmail.com',
py_modules=('od', 'test_od'),
... |
Update Arch package to 2.7 | #
# Biicode Arch Linux package settings.
#
# Check PKGBUILD_template docs for those settings and
# what they mean.
#
def settings():
return { "version": "2.7",
"release_number": "1",
"arch_deps": ["cmake>=3.0.2",
"zlib",
"glibc",
"sqlite",
... | #
# Biicode Arch Linux package settings.
#
# Check PKGBUILD_template docs for those settings and
# what they mean.
#
def settings():
return { "version": "2.6.1",
"release_number": "1",
"arch_deps": ["cmake>=3.0.2",
"zlib",
"glibc",
"sqlite",
... |
Add TASK_QUEUED to default notifier events | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [
NotifierEvent.TASK_QUEUED,
NotifierEvent.TASK_STARTED,
NotifierEvent.TASK... | from __future__ import absolute_import
__all__ = ['Notifier', 'NotifierEvent']
class NotifierEvent(object):
TASK_STARTED = 0
TASK_FINISHED = 1
TASK_QUEUED = 2
class Notifier(object):
DEFAULT_EVENTS = [NotifierEvent.TASK_STARTED, NotifierEvent.TASK_FINISHED]
def get_default_options(self):
... |
:bug: Make output path relative of file path | 'use strict'
const FS = require('fs')
const Path = require('path')
const Base = require('./base')
class GenericPlugin extends Base {
constructor() {
super()
this.registerTag(['Compiler-Include'], function(name, value) {
return new Promise(function(resolve, reject) {
FS.readFile(value, function... | 'use strict'
const FS = require('fs')
const Base = require('./base')
class GenericPlugin extends Base {
constructor() {
super()
this.registerTag(['Compiler-Include'], function(name, value) {
return new Promise(function(resolve, reject) {
FS.readFile(value, function (err, data) {
if (... |
Handle error responses from API | const path = require('path')
const { posterImagePath } = require('../../config')
const request = require('../shared/request')
const BASE_URL = 'https://us-central1-test-firebase-functions-82b96.cloudfunctions.net/getMovieMetadata'
module.exports = {
// External API.
// Pass in the title of the movie.
// Returns ... | const path = require('path')
const { posterImagePath } = require('../../config')
const request = require('../shared/request')
const BASE_URL = 'https://us-central1-test-firebase-functions-82b96.cloudfunctions.net/getMovieMetadata'
module.exports = {
// External API.
// Pass in the title of the movie.
// Returns ... |
Fix function object has no attribute __func__
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me> | from builtins import object
import unittest
from gaphas.state import reversible_pair, observed, _reverse
class SList(object):
def __init__(self):
self.l = list()
def add(self, node, before=None):
if before: self.l.insert(self.l.index(before), node)
else: self.l.append(node)
add = o... | from builtins import object
import unittest
from gaphas.state import reversible_pair, observed, _reverse
class SList(object):
def __init__(self):
self.l = list()
def add(self, node, before=None):
if before: self.l.insert(self.l.index(before), node)
else: self.l.append(node)
add = o... |
Add support for trwikivoyage to Pywikibot
Bug: T271263
Change-Id: I96597f57522147d26e9b0a86f89c67ca8959c5a2 | """Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2020
#
# Distributed under the terms of the MIT license.
#
# The new Wikivoyage family that is hosted at Wikimedia
from pywikibot import family
class Family(family.SubdomainFamily, family.WikimediaFamily):
"""Family class for Wikivoyage."""
na... | """Family module for Wikivoyage."""
#
# (C) Pywikibot team, 2012-2020
#
# Distributed under the terms of the MIT license.
#
# The new Wikivoyage family that is hosted at Wikimedia
from pywikibot import family
class Family(family.SubdomainFamily, family.WikimediaFamily):
"""Family class for Wikivoyage."""
na... |
Revert "commiting failing dummytest to test CI-setup"
This reverts commit eaac3ef8430d0a0c02ebaed82e1e8d27889124a6. | #!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# © 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Skarphed.
#
# Skarphed is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as ... | #!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# © 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Skarphed.
#
# Skarphed is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as ... |
requireLineFeedAtFileEnd: Test to ensure IIFE case still reports
Ref #1568 | var Checker = require('../../../lib/checker');
var assert = require('assert');
describe('rules/require-line-feed-at-file-end', function() {
var checker;
beforeEach(function() {
checker = new Checker();
checker.registerDefaultRules();
checker.configure({ requireLineFeedAtFileEnd: true }... | var Checker = require('../../../lib/checker');
var assert = require('assert');
describe('rules/require-line-feed-at-file-end', function() {
var checker;
beforeEach(function() {
checker = new Checker();
checker.registerDefaultRules();
});
it('should report no line feed at file end', func... |
Fix null case for event details | from database.dict_converters.converter_base import ConverterBase
class EventDetailsConverter(ConverterBase):
SUBVERSIONS = { # Increment every time a change to the dict is made
3: 0,
}
@classmethod
def convert(cls, event_details, dict_version):
CONVERTERS = {
3: cls.even... | from database.dict_converters.converter_base import ConverterBase
class EventDetailsConverter(ConverterBase):
SUBVERSIONS = { # Increment every time a change to the dict is made
3: 0,
}
@classmethod
def convert(cls, event_details, dict_version):
CONVERTERS = {
3: cls.even... |
Fix thinko in file mode test. | package termite
import (
"io/ioutil"
"os"
"syscall"
"testing"
)
func TestFileAttrReadFrom(t *testing.T) {
dir, _ := ioutil.TempDir("", "termite")
ioutil.WriteFile(dir+"/file.txt", []byte{42}, 0644)
attr := FileAttr{FileInfo: &os.FileInfo{Mode: syscall.S_IFDIR}}
attr.ReadFromFs(dir)
if attr.NameModeMap == ni... | package termite
import (
"io/ioutil"
"os"
"syscall"
"testing"
)
func TestFileAttrReadFrom(t *testing.T) {
dir, _ := ioutil.TempDir("", "termite")
ioutil.WriteFile(dir+"/file.txt", []byte{42}, 0644)
attr := FileAttr{FileInfo: &os.FileInfo{Mode: syscall.S_IFDIR}}
attr.ReadFromFs(dir)
if attr.NameModeMap == ni... |
Exclude optimized folder from optimization :D | ({
appDir: "../../",
dir : "../../optimized",
mainConfigFile : "config.js",
baseUrl: "static",
generateSourceMaps: true,
removeCombined : true,
keepBuildDir : true,
optimize: 'uglify2',
skipDirOptimize : true,
fileExclusionRegExp: /^optimized/,
preserveLicenseComments : false... | ({
appDir: "../../",
dir : "../../optimized",
mainConfigFile : "config.js",
baseUrl: "static",
generateSourceMaps: true,
removeCombined : true,
keepBuildDir : true,
optimize: 'uglify2',
skipDirOptimize : true,
preserveLicenseComments : false,
modules: [
{
name: ... |
Solve issue of blank/undefined answers. | module.exports = function(question, callback) {
var apiai = require('apiai');
var app = apiai("76ccb7c7acea4a6884834f6687475222", "8b3e68f16ac6430cb8c40d49c315aa7a");
var request = app.textRequest(question);
request.on('response', function(response) {
var kantSucks = require('./deontologyYo')(respon... | module.exports = function(question, callback) {
var apiai = require('apiai');
var app = apiai("76ccb7c7acea4a6884834f6687475222", "8b3e68f16ac6430cb8c40d49c315aa7a");
var request = app.textRequest(question);
request.on('response', function(response) {
var kantSucks = require('./deontologyYo')(respon... |
Revert "Allow passing config as lazy-evaluated function"
This reverts commit 1819cf67d3f24ebe055b4c54b4e037a6621b3734. | import fs from 'fs'
import _ from 'lodash'
import postcss from 'postcss'
import stylefmt from 'stylefmt'
import defaultConfig from './defaultConfig'
import mergeConfig from './util/mergeConfig'
import generateUtilities from './lib/generateUtilities'
import substituteHoverableAtRules from './lib/substituteHoverableAtR... | import fs from 'fs'
import _ from 'lodash'
import postcss from 'postcss'
import stylefmt from 'stylefmt'
import defaultConfig from './defaultConfig'
import mergeConfig from './util/mergeConfig'
import generateUtilities from './lib/generateUtilities'
import substituteHoverableAtRules from './lib/substituteHoverableAtR... |
Add ScrollableDropdown import to ipywidgets | from .widget import Widget, CallbackDispatcher, register, widget_serialization
from .domwidget import DOMWidget
from .trait_types import Color, EventfulDict, EventfulList
from .widget_bool import Checkbox, ToggleButton, Valid
from .widget_button import Button
from .widget_box import Box, FlexBox, Proxy, PlaceProxy, H... | from .widget import Widget, CallbackDispatcher, register, widget_serialization
from .domwidget import DOMWidget
from .trait_types import Color, EventfulDict, EventfulList
from .widget_bool import Checkbox, ToggleButton, Valid
from .widget_button import Button
from .widget_box import Box, FlexBox, Proxy, PlaceProxy, H... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.