commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
cb8a840e65beea7cfe55fdd98e5ce6881f9e11b3 | Update inline.py | inline.py | inline.py | # -*- coding: utf-8 -*-
import json
def make_url(self):
keyboard = {}
ia = []
for i in self:
ia.append(i)
keyboard['inline_keyboard'] = ia
return json.dumps(keyboard) | Python | 0.000003 | @@ -72,18 +72,19 @@
%7B%7D%0A
-i
a
+dd
= %5B%5D%0A%0A
@@ -109,18 +109,19 @@
-i
a
+dd
.append(
@@ -162,10 +162,11 @@
%5D =
-i
a
+dd
%0A
@@ -193,8 +193,9 @@
eyboard)
+%0A
|
ea99bdc94af28f9f8261c819eb131b465cda686f | add disambiguated data to invpat file | get_invpat.py | get_invpat.py | from lib import alchemy
import pandas as pd
session_generator = alchemy.session_generator
session = session_generator()
#res = session.execute('select rawinventor.name_first, rawinventor.name_last, rawlocation.city, rawlocation.state, \
# rawlocation.country, rawinventor.sequence, patent.id, \
# ... | Python | 0 | @@ -1014,35 +1014,32 @@
ntor.name_last,
-raw
location.city, r
@@ -1029,35 +1029,32 @@
location.city,
-raw
location.state,
@@ -1063,35 +1063,32 @@
-raw
location.country
@@ -1337,16 +1337,25 @@
inventor
+,location
%5C%0A
@@ -1525,32 +1525,92 @@
cation_id and %5C%0A
+ loc... |
a264a79202f202750be319a500ba7e4200e84336 | Address PEP8 warnings. | src/opencmiss/utils/zinc/general.py | src/opencmiss/utils/zinc/general.py | """
General utilities for working with the OpenCMISS-Zinc library.
"""
from opencmiss.zinc.context import Context
class AbstractNodeDataObject(object):
def __init__(self, field_names, time_sequence=None, time_sequence_field_names=None):
self._field_names = field_names
self._time_sequence = time_s... | Python | 0 | @@ -1678,16 +1678,23 @@
_(self,
+change_
object):
@@ -1721,16 +1721,23 @@
:param
+change_
object:
@@ -1819,16 +1819,23 @@
bject =
+change_
object%0A%0A
|
1aace55e5fee613c2365531a277601fb8442cfba | Change ownership; adjustments for non-ssh setup of repo | launch_instance.py | launch_instance.py | # License under the MIT License - see LICENSE
import boto.ec2
import os
import time
def launch(key_name, region='us-west-2', image_id='ami-5189a661',
instance_type='t2.micro', group_names='launch-wizard-1',
install_packages=False, kwargs={}):
'''
'''
if install_packages:
my... | Python | 0 | @@ -2064,24 +2064,62 @@
mkdir code
+%0A sudo chown ubuntu:ubuntu code
%0A%0A cd
@@ -2194,16 +2194,250 @@
ller.git
+%0A cd aws_controller%0A sed -i 's/git@github.com:/https:%5C/%5C/github.com%5C//' .gitmodules%0A sed -i 's/git@github.com:/https:%5C/%5C/github.com%5C//' .git/config... |
cde272222ef3889d6f9e92f9c3be32de0b661dfd | Add DeprecationWarning for tours when fetched | gapipy/resources/tour/tour.py | gapipy/resources/tour/tour.py | # Python 2 and 3
from __future__ import unicode_literals
from ..base import Resource
from .departure import Departure
from .tour_dossier import TourDossier
class Tour(Resource):
_resource_name = 'tours'
_is_parent_resource = True
_as_is_fields = ['id', 'href', 'product_line']
_date_fields = ['depar... | Python | 0 | @@ -49,16 +49,32 @@
literals
+%0Aimport warnings
%0A%0Afrom .
@@ -489,16 +489,341 @@
ture)%5D%0A%0A
+ def __init__(self, *args, **kwargs):%0A warnings.warn(%22%22%22%0A The %60tours%60 resource will be deprecated in the near%0A future in favour of %60tour_dossiers%60. Please reference... |
0e16de91a117e825a26a980b04df5c83be2717f2 | Remove unnecessary imports. | agate/utils.py | agate/utils.py | #!/usr/bin/env python
"""
This module contains a collection of utility classes and functions used in
agate.
"""
from collections import OrderedDict, Sequence
import datetime
from functools import wraps
import json
import string
try:
from cdecimal import Decimal, ROUND_FLOOR, ROUND_CEILING
except ImportError: #pr... | Python | 0.000001 | @@ -157,24 +157,8 @@
nce%0A
-import datetime%0A
from
@@ -185,20 +185,8 @@
aps%0A
-import json%0A
impo
|
6d874d3d7cf8da2f0566d275f1703497a3c5ccfd | Revert "REST: added no client side caching" | adagios/rest/views.py | adagios/rest/views.py | # Create your views here.
from django.shortcuts import render_to_response, redirect
from django.core import serializers
from django.http import HttpResponse, HttpResponseServerError
from django.utils import simplejson
#from django.core.context_processors import csrf
from django.views.decorators.csrf import csrf_exempt
... | Python | 0 | @@ -360,62 +360,8 @@
ext%0A
-from django.views.decorators.cache import never_cache%0A
%0A%0Aim
@@ -584,21 +584,8 @@
mpt%0A
-@never_cache%0A
def
|
7241c957b8fc77f7a14b8b6f5f8ae3b825a36e42 | Version increment | webgen.py | webgen.py | # -*- coding: utf-8 -*-
__version__ = (1, 2, 6)
__author__ = "Thomas Skowron (thomersch)"
import util.rssgen as rssgen
from util.progressbar import AnimatedProgressBar
import sys
import os
import json
import shutil
from datetime import datetime
import distutils.dir_util as du
import markdown
from jinja2 import File... | Python | 0.000001 | @@ -39,17 +39,17 @@
(1, 2,
-6
+7
)%0A__auth
|
1a562638097638a6a4a5fed8caf7de7faa6a9ef5 | Fix bugs with bracket-delimiter interpreter | interp.py | interp.py | import sys
mapping = [("=", "_EQOP", "IM_EQOP"),
("]", "_ARSCR", "IM_ARSCR"),
("[", "_ARSCL", "IM_ARSCL"),
(")", "_PARR", "IM_PARR"),
("(", "_PARL", "IM_PARL")]
sem = {"delim": "_SEMDELIM"}
indentation = 0
inp = sys.stdin
buildup = ''
prompt_normal = ">- "
prompt_indent =... | Python | 0.000001 | @@ -841,76 +841,136 @@
'%7B')
-:%0A indentation += 1%0A buildup += line%5B:-1%5D + ':' + '%5Cn'
+ and not line.startswith('%7D'):%0A buildup += (' ' * indentation) + line%5B:-1%5D.lstrip() + ':' + '%5Cn'%0A indentation += 1
%0A
@@ -1344,24 +1344,354 @@
tation -= 1%0A
+ if li... |
420e5a12daf45841cce581e5359c5214e3e0895b | switch to generic GLSL attributes | visualize.py | visualize.py | from __future__ import division, print_function
from OpenGL.GL import *
from OpenGL.GL import shaders
from OpenGL.GLUT import *
from OpenGL.GLU import *
from parse_bg import parse_bg, PRIM_TRIANGLE_STRIP, PRIM_TRIANGLES
import time
window = 0
width, height = 500, 400
gl_types = {
PRIM_TRIANGLES: GL_TRIANGLES,
... | Python | 0 | @@ -891,24 +891,30 @@
glVertex
+Attrib
Pointer(
4, GL_FL
@@ -901,24 +901,36 @@
tribPointer(
+vertex_loc,
4, GL_FLOAT,
@@ -929,16 +929,23 @@
L_FLOAT,
+ False,
vertsiz
@@ -981,60 +981,79 @@
able
-ClientState(GL_VERTEX_ARRAY)%0A glColorPointer(
+VertexAttribArray(vertex_loc)%0A glVertexAttribPointe... |
5366c1c61062ee5c83f82a1b4db36b9da56e15b4 | Fix to updateOrgs.py | admin/updateOrgs.py | admin/updateOrgs.py | import configparser
import pymysql
import urllib.request
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictC... | Python | 0 | @@ -629,16 +629,29 @@
%22Other%22%0A
+ try:%0A
emai
@@ -688,16 +688,41 @@
%22@%22)%5B1%5D%0A
+ except:%0A pass%0A
for
|
06c842dba14b940234abe75f89d1a395342b79de | Fix path | agent/agent.py | agent/agent.py | #!/usr/bin/env python
#http://www.acmesystems.it/python_httpd
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import json, subprocess, os, time
HELLO_MESSAGE = {'message':'hello, please use JSON via POST!'}
ERROR_JSON_MESSAGE = {'message':'POST content type must be application/json!'}
ERROR_BADJSON_MESSA... | Python | 0.000018 | @@ -578,16 +578,19 @@
th(r'../
+../
chrome-w
|
8dbbd7c8799c18ee5de67310db1de4b0f9579995 | update ignore strategy | tpl/core.py | tpl/core.py | # -*- coding:utf-8 -*-
import os
from tpl.render import render
from candy.path.helper import get_parent_path
from candy.path.iter import list_dirs, list_files
class Template(object):
IGNORE_FILES = [
'constructor.sh',
'constructor.py'
]
IGNORE_DIRS = [
'__pycache__',
'.vsc... | Python | 0.000001 | @@ -57,16 +57,75 @@
render%0A
+from tpl.ignore import IgnoreRule, parse_rules, is_ignored%0A
from can
@@ -249,20 +249,20 @@
IGNORE_
-FILE
+RULR
S = %5B%0A
@@ -272,96 +272,38 @@
'
-constructor.sh',%0A 'constructor.py'%0A %5D%0A IGNORE_DIRS = %5B%0A '__pycache__
+__pycache__',%0A '.... |
d57407a37d788719f93757b7345acce7fda185b0 | Make _find_wheels(), and this `pip cache {list,remove}` behave more predictably. | src/pip/_internal/commands/cache.py | src/pip/_internal/commands/cache.py | from __future__ import absolute_import
import logging
import os
import textwrap
import pip._internal.utils.filesystem as filesystem
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.exceptions import CommandError, PipError
from pip._interna... | Python | 0 | @@ -4241,24 +4241,25 @@
ptions)%0A
+%0A
return f
@@ -4254,47 +4254,874 @@
-return filesystem.find_files(wheel_dir,
+# The wheel filename format, as specified in PEP 427, is:%0A # %7Bdistribution%7D-%7Bversion%7D(-%7Bbuild%7D)?-%7Bpython%7D-%7Babi%7D-%7Bplatform%7D.whl%0A #%0A ... |
3c3e7a68b3fd2f8c600995c4fb65a3ebaf7ef2f5 | Allow auth_strategy to be toggled | ripcord/api/app.py | ripcord/api/app.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
# Copyright © 2012 New Dream Network, LLC (DreamHost)
# Copyright (C) 2013 PolyBeacon, 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 cop... | Python | 0.999796 | @@ -2047,16 +2047,111 @@
(self):%0A
+ pc = get_pecan_config()%0A pc.app.enable_acl = (CONF.auth_strategy == 'keystone')%0A
@@ -2170,16 +2170,31 @@
tup_app(
+pecan_config=pc
)%0A%0A d
|
297af67c2010b6bb9b5b5b072a4b7bf727d5ced8 | Bump version. | wessex.py | wessex.py | import urllib
import urllib2
import urlparse
__all__ = ['Harold']
__version__ = '1.3.1'
class Harold(object):
def __init__(self, host, secret, port=80, timeout=3):
self.host = host
self.port = port
self.secret = secret
self.timeout = timeout
def _post_to_harold(self, path, da... | Python | 0 | @@ -81,11 +81,11 @@
'1.
-3.1
+4.0
'%0A%0A%0A
|
646835d292d808dd5e60e86793f3a01e3adb7413 | Throw error with missing `cluster_synced_files`. (#9965) | python/ray/autoscaler/util.py | python/ray/autoscaler/util.py | import collections
import hashlib
import json
import jsonschema
import os
import threading
from typing import Any, Dict
import ray
import ray.services as services
from ray.autoscaler.node_provider import get_default_config
from ray.autoscaler.docker import dockerize_if_needed
REQUIRED, OPTIONAL = True, False
RAY_SCHE... | Python | 0 | @@ -1689,16 +1689,687 @@
m None%0A%0A
+ # Detect out of date defaults. This happens when the autoscaler that filled%0A # out the default values is older than the version of the autoscaler that%0A # is running on the cluster.%0A if %22cluster_synced_files%22 not in config:%0A raise RuntimeError(%0A ... |
acfffbacde7e09c5d0edf2aef7cdb72b9e39a500 | update init file to recognize myconfig | rlglue/__init__.py | rlglue/__init__.py | Python | 0 | @@ -0,0 +1,3 @@
+%0A%0A%0A
| |
5625fe9b09dad59b4500c7b3f455db8658d1f5a2 | Add 2016nano. | agent_paths.py | agent_paths.py | #!/usr/bin/env python3
from argparse import ArgumentParser
import json
import os.path
import re
import sys
from simplestreams.generate_simplestreams import json_dump
def main():
parser = ArgumentParser()
parser.add_argument('input')
parser.add_argument('output')
args = parser.parse_args()
paths_h... | Python | 0.000006 | @@ -735,16 +735,23 @@
2)?%7C2016
+(nano)?
%7C7%7C8%7C81%7C
@@ -760,22 +760,10 @@
)-',
- '-windows-',
%0A
+
@@ -775,24 +775,36 @@
+'-windows-',
path)%0A
|
f380b886b5461a21de73175eedd019c2237d457a | Fix payment config page | indico/modules/payment/views.py | indico/modules/payment/views.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0.000001 | @@ -1263,11 +1263,12 @@
_get
-Tab
+Page
Cont
|
9396b09ee4c2d78ad02f660581a2a14cd733518c | Send bundleId and objectId to javascript | src/sugar3/activity/webactivity.py | src/sugar3/activity/webactivity.py | # Copyright (C) 2013 Daniel Narvaez
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distrib... | Python | 0 | @@ -756,16 +756,28 @@
, USA.%0A%0A
+import json%0A
import o
@@ -1133,16 +1133,59 @@
vity_id%0A
+ self._object_id = handle.object_id%0A
@@ -2492,202 +2492,378 @@
-script = %22%22%22%0A var environment = %7BapiSocketKey: %22%25s%22,%0A a... |
50ffa93d46f7fe45489b171af48e026a561508c2 | Add basic settings for DRF | pinry/settings/base.py | pinry/settings/base.py | import os
from django.contrib.messages import constants as messages
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessi... | Python | 0 | @@ -380,24 +380,46 @@
aticfiles',%0A
+ 'rest_framework',%0A
'taggit'
@@ -3615,16 +3615,293 @@
O_DELETE = True%0A
+%0A# Rest Framework%0AREST_FRAMEWORK = %7B%0A # Use Django's standard %60django.contrib.auth%60 permissions,%0A # or allow read-only access for unauthenticated users.%0A 'DEFAULT_PERMISSI... |
041bddfcd5c9bbc7fb145ccb4a0708f8961c045b | fix returning task when starting reloader | aioreloader.py | aioreloader.py | """
Port of tornado reloader to asyncio.
Reloads your asyncio-based application automatically
when you modify the source code.
https://github.com/and800/aioreloader
"""
import sys
import os
import subprocess
import asyncio
from types import ModuleType
__version__ = '0.0.0'
try:
ensure_future = asyncio.ensure_fu... | Python | 0.000004 | @@ -443,20 +443,19 @@
arted =
-Fals
+Non
e%0A_reloa
@@ -552,28 +552,36 @@
t = 0.5) -%3E
-None
+asyncio.Task
:%0A %22%22%22%0A
@@ -886,16 +886,20 @@
%0A if
+not
_started
@@ -908,40 +908,8 @@
- return%0A _started = True%0A%0A
@@ -930,22 +930,30 @@
%7B%7D%0A
-return
+ _started ... |
ad4c77f1dd392513ad3900a250feeba51b9ca3c4 | Append config_server to all items in task list | glazier/lib/config/builder.py | glazier/lib/config/builder.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# 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 ag... | Python | 0.000001 | @@ -3537,16 +3537,83 @@
Path())%0A
+ config_server = copy.deepcopy(self._build_info.ConfigServer())%0A
self
@@ -3723,24 +3723,57 @@
t%5D%0A %7D
+,%0A 'server': config_server
%0A %7D)%0A
@@ -4316,16 +4316,51 @@
%7D
+,%0A 'server': config_server
%0A %7D
@@ -6336,80 +... |
db2ed7a6b2686290e237286b2eeb6ac759cfd204 | fix migration | alembic/env.py | alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from data_news import app
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
config.set_ma... | Python | 0.000001 | @@ -644,16 +644,17 @@
etadata%0A
+%0A
from dat
@@ -664,23 +664,114 @@
ews.
-models import *
+user import User, Role%0Afrom data_news.frontend import Item, Vote%0Afrom data_news.background import Twitter%0A
%0Afro
|
e570dac3c6ebd8ee4dd421ebe3cbc432502d5fe7 | fix type error | letsencrypt/le_util.py | letsencrypt/le_util.py | """Utilities for all Let's Encrypt."""
import collections
import errno
import logging
import os
import re
import subprocess
import stat
from letsencrypt import errors
logger = logging.getLogger(__name__)
Key = collections.namedtuple("Key", "file pem")
# Note: form is the type of data, "pem" or "der"
CSR = collecti... | Python | 0.000004 | @@ -2565,17 +2565,17 @@
ssions %25
-d
+s
%22 %25 (dir
|
993d6be40e11121609b7e9592956e1060a0cb6f7 | Fix "ImportError: No module named application" | alembic/env.py | alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from application import app, db
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Ov... | Python | 0.000003 | @@ -146,16 +146,142 @@
Config%0A%0A
+import sys%0Aimport os.path%0Asys.path.append(%0A os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))%0A %0A
from app
|
4d0ef33c43b0ef3d23f0c7991a86c1c08d486b43 | remove unused import | crate_project/apps/packages/templatetags/package_tags.py | crate_project/apps/packages/templatetags/package_tags.py | import datetime
from django import template
from django.db.models import F, Sum
from packages.models import Package, Release, ReleaseFile
register = template.Library()
@register.assignment_tag
def package_download_count(package_name=None):
# @@@ Cache this to cut down on queries
count = 0
if package_na... | Python | 0.000001 | @@ -1,21 +1,4 @@
-import datetime%0A%0A
from
|
73a0b444ba5850d15092314364b5930a046cf76d | add class mapping and shortened date strings | gfsad/tasks/classifications.py | gfsad/tasks/classifications.py | from gfsad import celery
from gfsad.models import db, Image
from flask import current_app
import StringIO
import boto
from boto.s3.key import Key
import datetime
import gzip
import json
@celery.task
def compute_image_classification_statistics(image_id):
image = Image.query.get(image_id)
classification_count ... | Python | 0.000002 | @@ -1421,17 +1421,575 @@
ds.org'%0A
+ classes = %5B%0A %7B'id': 0, 'label': 'Unknown', 'description': 'Not cropland is...'%7D,%0A %7B'id': 1, 'label': 'Cropland', 'description': 'Cropland is...'%7D,%0A %7B'id': 2, 'label': 'Forest', 'description': 'Forest is ...'%7D,%0A %... |
b81068b32f4cb691644ee986b7854135aff88b0e | Change interarrival_rate formula and add interarrival_time properties | pygraphc/clustering/ClusterUtility.py | pygraphc/clustering/ClusterUtility.py | from itertools import combinations
from datetime import datetime
class ClusterUtility(object):
"""A class contains some utilities to do clustering algorithm.
"""
@staticmethod
def get_geometric_mean(weights):
"""Get geometric mean or intensity in a clique. A clique can be a k-clique or maximal... | Python | 0.000001 | @@ -3366,19 +3366,19 @@
arrival
-tim
+rat
e of eve
@@ -3461,32 +3461,147 @@
s in a cluster.%0A
+ density : density of a cluster.%0A interarrival_time : inter-arrival time in a cluster.%0A
%22%22%22%0A
@@ -4903,17 +4903,98 @@
val_
-rat
+tim
e'%5D =
+interarrival%0A ... |
a8874b98057202c0710265c213010a937d681013 | optimize getting the latest versions of a package to cache it's values | crate_project/apps/packages/templatetags/package_tags.py | crate_project/apps/packages/templatetags/package_tags.py | from django import template
from django.core.cache import cache
from django.db.models import Sum
from packages.models import Package, Release, ReleaseFile, ChangeLog
register = template.Library()
@register.assignment_tag
def package_download_count(package_name=None):
if package_name is None:
cached = ca... | Python | 0 | @@ -2444,24 +2444,135 @@
num=None):%0A
+ KEY = %22crate:packages:package_versions:%25s%22 %25 package_name%0A%0A qs = cache.get(KEY)%0A%0A if qs is None:%0A
qs = Rel
@@ -2664,16 +2664,50 @@
order%22)%0A
+ cache.set(KEY, list(qs))%0A%0A
if n
|
6bc3454bb647a4fc49f8be85adf64ec7eaac0a47 | Update acceptance.py | settings/labels/mutale/acceptance.py | settings/labels/mutale/acceptance.py | from settings.labels.mutale.base import *
import dj_database_url
from themes import secrets
DEBUG = False
ALLOWED_HOSTS = ['mutale.herokuapp.com',
'127.0.0.1', 'localhost',
'mutale-acc.herokuapp.com',
'mutale-dev.herokuapp.com']
DATABASE_URL = 'postgres://oogcsuzgf... | Python | 0.000001 | @@ -39,57 +39,47 @@
t *%0A
-import dj_database_url%0A%0Afrom themes import secret
+from themes.secrets import read_mailpas
s%0A%0AD
@@ -132,33 +132,16 @@
pp.com',
-%0A
'127.0.
@@ -158,33 +158,16 @@
alhost',
-%0A
'mutale
@@ -171,11 +171,13 @@
ale-
-acc
+dev-a
.her
@@ -214,19 +21... |
9e90bb1b4e88523efe338734185d4bd17c61596a | Allow slashes in dates | heufybot/modules/commands/log.py | heufybot/modules/commands/log.py | from twisted.plugin import IPlugin
from heufybot.moduleinterface import IBotModule
from heufybot.modules.commandinterface import BotCommand
from zope.interface import implements
from datetime import date, timedelta
import os
class LogCommand(BotCommand):
implements(IPlugin, IBotModule)
name = "Log"
def ... | Python | 0 | @@ -947,16 +947,31 @@
rofdays%3E
+, %3Cyyyy/mm/dd%3E,
or %3Cyyy
@@ -1398,32 +1398,126 @@
try:%0A
+ for symbol in %5B%22/%22, %22-%22%5D:%0A if symbol in params%5B0%5D:%0A
@@ -1552,13 +1552,24 @@
lit(
-%22-%22)%0A
+symbol)%0A
@@ -1... |
2b7fda645cb922a451d384aca22e8fb7414959b8 | Make it clear that items_in_stock cannot currently be changed through the product admin | plata/product/admin.py | plata/product/admin.py | from django import forms
from django.contrib import admin
from django.forms.models import BaseInlineFormSet
from django.utils.translation import ugettext_lazy as _
from . import models
class ProductPriceInline(admin.TabularInline):
model = models.ProductPrice
extra = 0
class ProductImageInline(admin.Tabular... | Python | 0.000001 | @@ -3983,32 +3983,74 @@
et%0A extra = 0
+%0A readonly_fields = ('items_in_stock',)
%0A%0Aclass OptionIn
|
2ba15ced496f8513a17bc5cd00312b4e31844b23 | Modify XML-fetching script to build zips from corpus backup | src/test/python/fetcharticlezip.py | src/test/python/fetcharticlezip.py | #!/usr/bin/python2
# Copyright (c) 2013 by Public Library of Science
# http://plos.org
# http://ambraproject.org
#
# 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... | Python | 0 | @@ -1787,16 +1787,83 @@
%0A )%0A%0A
+CORPUS_PATH = '/home/rskonnord/corpus/' # TODO Remove hard-coding%0A%0A
OUTPUT_P
@@ -2014,16 +2014,48 @@
i=doi))%0A
+ xml_filename = doi + '.xml'%0A
xml_
@@ -2087,28 +2087,28 @@
T_PATH,
-doi + '.xml'
+xml_filename
)%0A wi
@@ -2191,44 +2191,8 @@
t)%0A%0A
- com... |
a8b1a6f2a2c379cf4d421fb6b5cf04f21bd0fa20 | Set all window properties before actually showing it. Also resize the window on every update to keep it the right size. | window.py | window.py | import logging
import time
import pygtk
pygtk.require('2.0')
import gtk
from gtk import gdk
import gobject
import pango
class NotifyWindow:
def __init__(self, config):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event)
self.window.connect("... | Python | 0 | @@ -994,16 +994,40 @@
%0A
+ self.window.resize(1,1)
# Shrin
@@ -1046,15 +1046,8 @@
to
-be the
widt
@@ -1080,26 +1080,54 @@
.window.
-resize(1,1
+set_position(gtk.WIN_POS_CENTER_ALWAYS
)%0A
@@ -1141,20 +1141,34 @@
window.s
-how(
+et_keep_above(True
)%0A
@@ -1185,15 +1185,12 @@
dow.
-prese... |
a6ccd03d373f478c4501010b7efa6c3df43283d8 | add prefix for print namew | src/etu/payeasy.py | src/etu/payeasy.py | import requests
import sqlite3
import payeasyDB
import payEasyClass
import time
import re
from BeautifulSoup import BeautifulSoup
def getCategoryList():
# crawled = ['29664','29652' , '29654' , '29656' , '29658' , '29659' , '29660' , '29662' , '29663' , '29989' , '30704' ]
crawled = []
# getCatego... | Python | 0.000024 | @@ -1965,16 +1965,32 @@
print
+ %22ProductName: %22
pp.p_de
|
d8459cf4d51cdff43b8887b382e25246428730a0 | Add docs for which case type each repeater requires | custom/enikshay/integrations/ninetyninedots/repeaters.py | custom/enikshay/integrations/ninetyninedots/repeaters.py | from corehq.toggles import NINETYNINE_DOTS
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from corehq.form_processor.models import CommCareCaseSQL
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.xml.parser import CaseUpdateAction
from core... | Python | 0.000001 | @@ -906,16 +906,36 @@
stration
+ (episode case type)
%22)%0A%0A
@@ -2098,16 +2098,35 @@
t Update
+ (person case type)
%22)%0A%0A
|
cf071ad83431868bc8889284d069a108b388a87d | Add columns,rows method and dont reset terminal palette | ubuntui/ev.py | ubuntui/ev.py | import urwid
import asyncio
import uuid
import logging
log = logging.getLogger('eventloop')
class EventLoopException(Exception):
""" Problem with eventloop
"""
pass
class EventLoop:
""" Abstracts out event loop
"""
loop = None
alarms = {}
@classmethod
def build_loop(cls, ui, p... | Python | 0 | @@ -257,32 +257,132 @@
%0A alarms = %7B%7D
+%0A extra_opts = %7B%0A 'screen': urwid.raw_display.Screen(),%0A 'handle_mouse': True%0A %7D
%0A%0A @classmeth
@@ -485,124 +485,12 @@
-extra_opts = %7B%0A 'screen': urwid.raw_display.Screen(),%0A 'handle_mouse': True%0A ... |
1b718c62a34784bbdd6e15d18b409fe59239e6fd | Fix bug in wemo discovery caused by voluptuous addition. (#3027) | homeassistant/components/wemo.py | homeassistant/components/wemo.py | """
Support for WeMo device discovery.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wemo/
"""
import logging
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_WEMO
from homeassistant.helpers import discovery
from homeas... | Python | 0 | @@ -2409,16 +2409,20 @@
F_STATIC
+, %5B%5D
))%0A%0A
|
b4cb77fb0f3215190779c390218ecbd03ae506e8 | Add docstrings | git-lang-guesser/guess_lang.py | git-lang-guesser/guess_lang.py | from collections import Counter
LANGUAGE_KEY = "language"
def count_languages(repos, filter_none=True):
langs = (repo.get(LANGUAGE_KEY, None) for repo in repos)
# filter out None
if filter_none:
langs = filter(lambda x: x is not None, langs)
# a Counter does all the heavy lifting for us
... | Python | 0.000005 | @@ -109,269 +109,896 @@
-langs = (repo.get(LANGUAGE_KEY, None) for repo in repos)%0A%0A # filter out None%0A if filter_none:%0A langs = filter(lambda x: x is not None, langs)%0A%0A # a Counter does all the heavy lifting for us%0A return Counter(langs)%0A%0A%0Adef guess_favourite(repos):
+%22%22... |
ae93499a37bdd9f7099b3c645ae36b7ed658f205 | add failing test for interface meta | graphene/types/tests/test_interface.py | graphene/types/tests/test_interface.py | from ..field import Field
from ..interface import Interface
from ..objecttype import ObjectType
from ..scalars import String
from ..schema import Schema
from ..unmountedtype import UnmountedType
class MyType:
pass
class MyScalar(UnmountedType):
def get_type(self):
return MyType
def test_generate_i... | Python | 0 | @@ -580,24 +580,77 @@
ith_meta():%0A
+ class MyFirstInterface(Interface):%0A pass%0A%0A
class My
@@ -663,32 +663,32 @@
ace(Interface):%0A
-
class Me
@@ -770,16 +770,60 @@
ntation%22
+%0A interfaces = %5BMyFirstInterface%5D
%0A%0A as
@@ -864,32 +864,32 @@
OtherInterface%22%0A
-... |
fb352c20d9205778830196597c968eda495dbac4 | Update wink.py (#3957) | homeassistant/components/wink.py | homeassistant/components/wink.py | """
Support for Wink hubs.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wink/
"""
import logging
import json
import voluptuous as vol
from homeassistant.helpers import discovery
from homeassistant.const import CONF_ACCESS_TOKEN, ATTR_BATTERY_LEVEL, ... | Python | 0 | @@ -1669,16 +1669,105 @@
EXTRA)%0A%0A
+WINK_COMPONENTS = %5B%0A 'binary_sensor', 'sensor', 'light', 'switch', 'lock', 'cover'%0A%5D%0A%0A
%0Adef set
@@ -2682,481 +2682,29 @@
nent
-_name, func_exists in (%0A ('light', pywink.get_bulbs),%0A ('switch', lambda: pywink.get_switches or pywink.get_... |
1ff7d8ecc964a99278a5511f45a66b7d55654395 | Fix thanks to Joel for spotting it | web-uwsgi.py | web-uwsgi.py | import uwsgi
import zmq
import struct
COMMON_HEADERS = [('Content-Type', 'application/json'), ('Access-Control-Allow-Origin', '*'), ('Access-Control-Allow-Headers', 'Requested-With,Content-Type')]
context = zmq.Context()
def light(environ, start_response):
if environ['PATH_INFO'] in ['/favicon.ico']:
sta... | Python | 0 | @@ -849,37 +849,36 @@
start_response('
-5
+2
00
-N
OK', COMMON_HEAD
|
5eb38ec2b30786cb9d406c35a0255ac0bd155473 | Add James to the privileged list | globalvars.py | globalvars.py | import os
from datetime import datetime
from ChatExchange.chatexchange.client import Client
import HTMLParser
import md5
class GlobalVars:
false_positives = []
whitelisted_users = []
blacklisted_users = []
ignored_posts = []
auto_ignored_posts = []
startup_utc = datetime.utcnow().strftime("%H:... | Python | 0.000044 | @@ -1761,16 +1761,26 @@
%22279182%22
+, %22271104%22
%5D%7D%0A s
|
b1f5c87007540421f8cb73f1e8b67d5d8375496b | document the challenge parameter for assertUnauthorized | agar/test/web_test.py | agar/test/web_test.py | import webtest
from unittest2 import TestCase
class WebTest(TestCase):
"""
A base class for testing web requests. Provides a wrapper around
the `WebTest`_ package that is mostly compatable with `gaetestbed`_'s.
To use, inherit from :py:class:`WebTest` and define a class-level
variable called ``APP... | Python | 0 | @@ -2711,26 +2711,132 @@
was 401
-Not Found.
+Unauthorized.%0A%0A :param challenge: assert that the %60%60WWW-Authenticate%60%60 header matches this value, if provided
%0A
|
601b14cf7efef9b1126d52caff9d9bc751352f02 | Change client.stt loglevel to INFO, so that users can see what was transcribed without having to use --debug | jasper.py | jasper.py | #!/usr/bin/env python2
# -*- coding: utf-8-*-
import os
import sys
import shutil
import logging
import yaml
import argparse
from client import tts, stt, jasperpath, diagnose
# Add jasperpath.LIB_PATH to sys.path
sys.path.append(jasperpath.LIB_PATH)
from client.conversation import Conversation
parser = argparse.Arg... | Python | 0 | @@ -4760,16 +4760,73 @@
Logger()
+%0A logger.getChild(%22client.stt%22).setLevel(logging.INFO)
%0A%0A if
|
cf9c643ca005d024e1d54e69dc66eccb7c3ec2bb | Remove unused import | usr/openmv.py | usr/openmv.py | #!/usr/bin/env python
# This file is part of the OpenMV project.
# Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>
# This work is licensed under the MIT license, see the file LICENSE for details.
#
# Openmv module.
import struct
import sys,time
import serial
import platform
import numpy as np
from ... | Python | 0.000001 | @@ -335,82 +335,8 @@
ge%0A%0A
-#import pydfu on Linux%0Aif platform.system() == %22Linux%22:%0A import pydfu%0A%0A
__se
@@ -347,17 +347,16 @@
= None%0A
-%0A
__FB_HDR
|
bb434f82f0883f2a85992f6b41a042d08ddb6449 | Update __init__.py | hsgame/cards/minions/__init__.py | hsgame/cards/minions/__init__.py | __author__ = 'Daniel'
from hsgame.cards.minions.neutral import (
BloodfenRaptor,
IronbeakOwl,
NoviceEngineer,
StonetuskBoar,
WarGolem,
MogushanWarden,
OasisSnapjaw,
FaerieDragon,
KoboldGeomancer,
ElvenArcher,
IronfurGrizzly,
ArgentSquire,
SilvermoonGuardian,
Twil... | Python | 0.000072 | @@ -454,16 +454,121 @@
OgreMagi
+,%0A BloodmageThalnos,%0A LootHoarder,%0A MoltenGiant,%0A SeaGiant,%0A MountainGiant,%0A LeperGnome
%0A)%0A%0Afrom
|
9fd368564f76fea4b48ddfe0b84c6676253eafeb | Fix normalization of Baes & Dejonghe | galpy/df/constantbetaHernquistdf.py | galpy/df/constantbetaHernquistdf.py | # Class that implements the anisotropic spherical Hernquist DF with constant
# beta parameter
import numpy
import scipy.special
import scipy.integrate
from ..util import conversion
from ..potential import evaluatePotentials,HernquistPotential
from .constantbetadf import constantbetadf
class constantbetaHernquistdf(con... | Python | 0.000002 | @@ -1238,17 +1238,16 @@
f._beta)
-/
%5C%0A
@@ -1256,10 +1256,9 @@
-(
+/
scip
@@ -1287,17 +1287,31 @@
f._beta)
-*
+%5C%0A /
scipy.sp
@@ -1337,17 +1337,57 @@
f._beta)
-
+%5C%0A /self._GMa**(1.5-self._beta
)%0A %0A
|
03ea65721a2a0979c6b42dfcec8737f9f438d6f0 | Bump to version 0.11.0 (#212) | aiodocker/__init__.py | aiodocker/__init__.py | from .docker import Docker
__version__ = '0.11.0a0'
__all__ = ("Docker", )
| Python | 0 | @@ -47,10 +47,8 @@
11.0
-a0
'%0A%0A%0A
|
85269dda0369f1575ffaddee83cd63c5d468e3b2 | remove debug | autonetkit/plugins/naming.py | autonetkit/plugins/naming.py | def network_hostname(node):
print node.dump()
print "%s_%s" % (node.Network, node.label)
return "%s_%s" % (node.Network, node.label)
| Python | 0.000002 | @@ -25,30 +25,8 @@
e):%0A
- print node.dump()%0A
|
620d2b04f6632779cb0015558bcab035a3aefecd | support config_local.py | chukchi/config/__init__.py | chukchi/config/__init__.py | # This file is part of Chukchi, the free web-based RSS aggregator
#
# Copyright (C) 2013 Edward Toroshchin <chukchi-project@hades.name>
#
# Chukchi 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, eith... | Python | 0.000006 | @@ -821,16 +821,205 @@
faults%0A%0A
+try:%0A import config_local%0A for key in config_local.__dict__:%0A if key.upper() == key:%0A setattr(config, key, getattr(config_local, key))%0Aexcept ImportError:%0A pass%0A%0A
# vi: sw
|
a085fe370ec698618981088a4cc417fcb9a3d519 | Standardize some args | tensorflow_gan/examples/self_attention_estimator/train_experiment_main.py | tensorflow_gan/examples/self_attention_estimator/train_experiment_main.py | # coding=utf-8
# Copyright 2019 The TensorFlow GAN 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 applicabl... | Python | 0.999977 | @@ -2701,17 +2701,17 @@
_eval',
-5
+1
000,%0A
|
e6158e2aa542f1f13a1b795fa894f141163c3e81 | fix modifying dict while iterating over it | src/rosdistro/distribution_cache.py | src/rosdistro/distribution_cache.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2013, Open Source Robotics Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... | Python | 0 | @@ -4851,32 +4851,37 @@
for pkg_name in
+list(
self.release_pac
@@ -4896,16 +4896,17 @@
s.keys()
+)
:%0A
|
0f3ce188fee12c07dbd56aa6a459c04b5ed07778 | update to execute headder | robotcontroller.py | robotcontroller.py | '''
Author: Michael Asquith, Aaron Gruneklee
Created: 2014.12.12
Last Modified: 2014.12.23
The brain of the robot. Has access to the robot's I/O, interpreter and
instructions
'''
from interpreter import Interpreter
from robotio import RobotIO
from codeblock import CodeBlock
from maze import Maze
class RobotControll... | Python | 0 | @@ -499,24 +499,37 @@
Program(self
+, programfile
):%0A %22
|
dd78f68ed0e6dcecc66f1b87972f73f887edfb3e | Add exception handling | dbaas/integrations/monitoring/manager.py | dbaas/integrations/monitoring/manager.py | from dbaas_dbmonitor.provider import DBMonitorProvider
from dbaas_zabbix.provider import ZabbixProvider
import logging
LOG = logging.getLogger(__name__)
class MonitoringManager():
@classmethod
def create_monitoring(cls, databaseinfra):
LOG.info("Creating monitoring...")
ZabbixProvider().c... | Python | 0.000005 | @@ -236,32 +236,49 @@
databaseinfra):%0A
+ try:%0A
LOG.info
@@ -296,32 +296,36 @@
monitoring...%22)%0A
+
ZabbixPr
@@ -374,32 +374,36 @@
einfra)%0A
+
+
return DBMonitor
@@ -448,32 +448,127 @@
(databaseinfra)%0A
+ except Exception, e:%0A LOG.warn(%22Exce... |
32db10f40693d5ace65226c46b0f67d75045e440 | Bump version to 0.2.2 | aiosqlite/__init__.py | aiosqlite/__init__.py | # Copyright 2017 John Reese
# Licensed under the MIT license
'''asyncio bridge to sqlite3'''
from sqlite3 import sqlite_version, sqlite_version_info
from .core import connect, Connection, Cursor
__version__ = '0.2.0'
__all__ = [
'__version__',
'sqlite_version',
'sqlite_version_info',
'connect',
... | Python | 0.000002 | @@ -211,17 +211,17 @@
= '0.2.
-0
+2
'%0A__all_
|
7ea56c7e87da0b374644f196e1f2a1c9b788a13f | Change GoMetricsWorker to use the new way of specifying configs (involved using GoWorkerMixin and GoWorkerConfigMixin) | go/vumitools/metrics_worker.py | go/vumitools/metrics_worker.py | # -*- test-case-name: go.vumitools.tests.test_metrics_worker -*-
from twisted.internet.defer import inlineCallbacks
from twisted.internet.task import LoopingCall
from vumi import log
from vumi.service import Worker
from go.vumitools.api import VumiApi, VumiApiCommand
class GoMetricsWorker(Worker):
"""A metrics... | Python | 0 | @@ -192,23 +192,22 @@
umi.
-service
+worker
import
Work
@@ -202,22 +202,60 @@
import
+Base
Worker
+%0Afrom vumi.config import ConfigInt
%0A%0Afrom g
@@ -305,38 +305,351 @@
and%0A
-%0A%0Aclass GoMetricsWorker(Worker
+from go.vumitools.app_worker import GoWorkerConfigMixin, GoWorkerMixin%0A%0A%0Aclass GoMetric... |
6b368da36b254afac5a42da7ecb2ab36bbc1d348 | Use shell mode for caretaker setup script | engage/adapter_pkg/datablox_engage_adapter/djm_server.py | engage/adapter_pkg/datablox_engage_adapter/djm_server.py | """Adapter layer to distributed job manager server api
"""
import os
import os.path
import logging
import datetime
from file_locator import FileLocator
from dist_job_mgr.client import get_local_connection
from dist_job_mgr.version import VERSION
import dist_job_mgr.common as common
class DjmAdapterError(Exception):
... | Python | 0 | @@ -5829,16 +5829,73 @@
ker.sh%22%5D
+,%0A shell=True
)%0A
|
edbb19de1a3bb0d4b06069bd498e2b41346c7b74 | fix ArrayVal._isFullVld | hwt/hdlObjects/types/arrayVal.py | hwt/hdlObjects/types/arrayVal.py | from hwt.hdlObjects.operator import Operator
from hwt.hdlObjects.operatorDefs import AllOps
from hwt.hdlObjects.types.defs import BOOL, INT
from hwt.hdlObjects.types.slice import Slice
from hwt.hdlObjects.types.typeCast import toHVal
from hwt.hdlObjects.value import Value
from hwt.synthesizer.param import evalParam
fro... | Python | 0.000016 | @@ -1319,32 +1319,54 @@
y._isFullVld():%0A
+ v.val = 0%0A
v.vl
@@ -1394,16 +1394,76 @@
turn v%0A%0A
+ def _isFullVld(self):%0A return self.vldMask == 1%0A%0A
def
|
6be7a88edf0cff942236799907c177775041a349 | Fix flake8 errors | albertyw.com/utils.py | albertyw.com/utils.py | import datetime
import os
import dotenv
from getenv import env
import markdown2
import pytz
root_path = os.path.dirname(os.path.realpath(__file__)) + '/../'
dotenv.read_dotenv(os.path.join(root_path, '.env'))
# See https://github.com/trentm/python-markdown2/wiki/Extras
MARKDOWN_EXTRAS = [
'code-friendly',
'f... | Python | 0.000004 | @@ -370,16 +370,17 @@
es',%0A%5D%0A%0A
+%0A
def prun
@@ -1457,16 +1457,29 @@
arkdown(
+%0A
%22%5Cn%22.joi
@@ -1490,16 +1490,28 @@
te%5B2:%5D),
+%0A
extras=
@@ -1525,16 +1525,26 @@
N_EXTRAS
+,%0A
)%0A
|
f4a123f1bdc02df483ff0c199625be9d17b1d32a | fix override of logging methods | hwt/simulator/vcdHdlSimConfig.py | hwt/simulator/vcdHdlSimConfig.py | from datetime import datetime
from pprint import pprint
import sys
from hwt.hdlObjects.types.bits import Bits
from hwt.hdlObjects.types.boolean import Boolean
from hwt.simulator.hdlSimConfig import HdlSimConfig
from hwt.simulator.vcdWritter import VcdWritter
from hwt.hdlObjects.types.enum import Enum
class VcdHdlSim... | Python | 0.000001 | @@ -436,35 +436,8 @@
t):%0A
- super().__init__()%0A
|
f929d80c5a4363994968248d87a892b1c2ef61d4 | Use actual sha for static:debug image (and update static:latest) (#1804) | go/static.bzl | go/static.bzl | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# 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... | Python | 0 | @@ -864,34 +864,33 @@
circa 2021-0
-3-14 11:14
+4-07 9:30
-0400%0A %22
@@ -909,72 +909,72 @@
256:
-359e0c5c9a1364d82f567db01e1419dead4dfc04d33271248f9c713007d0c22e
+acbec568a18bc35f06f95878bcc4b1aa82991824a60174b2233408bd97e25dab
%22,%0A
@@ -1028,18 +1028,17 @@
21-0
-3-14 11:14
+4-07 9:30
-04
@@ -1066,72 +1... |
55dd2477ac0c06846ddcc549f4fd0c174736acbd | Remove deprecated asyncio.coroutine | growler/middleware/session.py | growler/middleware/session.py | #
# growler/middleware/session.py
#
"""
The standard growler session module which contains code for setting up
a typical client 'Session', allowing client data to be saved on the
server.
The Middleware ``SessionStorage`` should be added to the application
chain somewhere before the main web routes.
The typical action ... | Python | 0.000001 | @@ -3222,30 +3222,13 @@
-@
async
-io.coroutine%0A
def
@@ -3252,18 +3252,13 @@
-yield from
+await
sel
|
2e54f7f657af3b6bdbb6304f6ad878ad41af77f9 | Add help text to make it clear that font sizes are CSS labels. | alerts/main/models.py | alerts/main/models.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# 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 applica... | Python | 0.000001 | @@ -1584,32 +1584,93 @@
, max_length=255
+, help_text=%22Use CSS font sizes, e.g. '64px'%22, default=%2264px%22
)%0A font_color
|
f294fe77e30298aa606fe603a8c8851c0120b283 | make integrate work on bulk data | integrate.py | integrate.py | #!/usr/bin/env python
"""
Takes in a CSV file that represents the output of the disambiguation engine:
Patent Number, Firstname, Lastname, Unique_Inventor_ID
Groups by Unique_Inventor_ID and then inserts them into the Inventor table using
lib.alchemy.match
"""
import sys
import lib.alchemy as alchemy
from lib.util.c... | Python | 0 | @@ -465,16 +465,63 @@
pickle%0A
+import linecache%0Afrom datetime import datetime%0A
%0A%0Adef in
@@ -532,24 +532,39 @@
ate(filename
+, disambiginput
):%0A block
@@ -593,20 +593,66 @@
-for line in
+print 'Gathering blocks'%0A for index, line in enumerate(
read
@@ -666,18 +666,203 @@
ilename)
+)
:%0... |
84474912b98362a068cdf8735a0c2a7d1fcd5a2f | Fix task args order when harvesting by source ID. | share/management/commands/harvest.py | share/management/commands/harvest.py | import pendulum
import datetime
from django.apps import apps
from django.core.management.base import BaseCommand
from django.conf import settings
from share.models import ShareUser
from share.tasks import HarvesterTask, NormalizerTask
from share.provider import ProviderAppConfig
class Command(BaseCommand):
def... | Python | 0.000001 | @@ -4002,16 +4002,25 @@
_async((
+user.id,
config.l
@@ -4028,17 +4028,8 @@
bel,
- user.id,
raw
|
ec785103f7dcc2df8ee31acb1325c2181f65698c | bump version to 3.1.0 | root_numpy/info.py | root_numpy/info.py | """
_
_ __ ___ ___ | |_ _ __ _ _ _ __ ___ _ __ _ _
| '__/ _ \ / _ \| __| | '_ \| | | | '_ ` _ \| '_ \| | | |
| | | (_) | (_) | |_ | | | | |_| | | | | | | |_) | |_| |
|_| \___/ \___/ \__|___|_| |_|\__,_|_| |_| |_| .__/ \__, | {0}
|_____| |_| ... | Python | 0 | @@ -344,11 +344,11 @@
'3.
-0.2
+1.0
.dev
|
fa021dea98adc40a7effa50754ccfd49284ff950 | Implement wind range | weathergenerator.py | weathergenerator.py | from random import choice, randint
degrees = chr(0xBA) + "C"
wind_directions = [chr(0x2B06) + chr(0xFE0F), # N
chr(0x27A1) + chr(0xFE0F), # E
chr(0x2B05) + chr(0xFE0F), # W
chr(0x2B07) + chr(0xFE0F), # S
chr(0x2197) + chr(0xFE0F), # ... | Python | 0.000007 | @@ -935,16 +935,86 @@
nd_speed
+, %5C%0A self.__min_wind_speed_offset, self.__max_wind_speed_offset
= %5C%0A
@@ -1524,16 +1524,20 @@
nd_speed
+_min
= randi
@@ -1585,16 +1585,168 @@
_speed)%0A
+ wind_speed_max = wind_speed_min + %5C%0A randint(self.__min_wind_speed_offset,%0A ... |
dbdfac3f7a003ac33ae1149d8b03dc57ac721918 | Remove lvalue member of ILValue | il_gen.py | il_gen.py | """Objects used for the AST -> IL phase of the compiler."""
from errors import CompilerError
class CType:
"""Represents a C type, like `int` or `double` or a struct.
size (int) - The result of sizeof on this type.
"""
# Integer CType
INTEGER = 0
# Function CTYPE
FUNCTION = 1
# Poin... | Python | 0 | @@ -4413,60 +4413,8 @@
lue.
-%0A lvalue (bool) - Whether this value is an lvalue
%0A%0A
@@ -4452,22 +4452,8 @@
type
-, lvalue=False
):%0A
@@ -4517,37 +4517,8 @@
ype%0A
- self.lvalue = lvalue%0A
%0A%0Acl
@@ -6320,14 +6320,8 @@
type
-, True
)%0A
|
665caf95a6477cff9cd4faf2b4337b30a2a7e599 | Correct ptpr method | acspy/control.py | acspy/control.py | # -*- coding: utf-8 -*-
"""
This module contains an [incomplete] object for communicating with an ACS controller.
"""
from __future__ import division, print_function
from acspy import acsc
class Controller(object):
def __init__(self, contype="simulator"):
self.contype = contype
self.axisdefs = {}
... | Python | 0.000128 | @@ -2437,39 +2437,39 @@
e, coordinates=%22
-absolut
+relativ
e%22, wait=wait)%0A
|
6220714eb53cf5dd8334e508430d04a8ee3e7406 | Add kwargs | saleor/cart/forms.py | saleor/cart/forms.py | from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ObjectDoesNotExist, NON_FIELD_ERRORS
from django.forms.formsets import BaseFormSet, DEFAULT_MAX_NUM
from django.utils.translation import pgettext_lazy, ugettext_lazy
from satchless.item import InsufficientStock
class ... | Python | 0.000005 | @@ -515,16 +515,26 @@
nitial=1
+, **kwargs
)%0A%0A%0Aclas
|
1d1001b2eee9a19c904f46db09eac7cddbbe70b6 | Clear canvas, multiple sets (color) | plugins/point_cloud.py | plugins/point_cloud.py | import numpy as np
import tkinter as tk
import tkinter.ttk as ttk
import plugin_base
#~ TODO padding
class Uniform_Window(tk.Toplevel):
def __init__(self, parent):
super().__init__(parent)
self.title('Data from uniform distribution')
self.resizable(tk.FALSE, tk.FALSE)
self.protocol('WM_DELETE_WINDOW', self... | Python | 0.000188 | @@ -2615,50 +2615,63 @@
elf.
-register_event_handler('redraw', self.draw
+program.data_frame.add_action('Clear', 'pq_clear', None
)%0A%09%09
@@ -2734,16 +2734,121 @@
niform)%0A
+%09%09self.register_event_handler('pq_clear', self.clear)%0A%09%09self.register_event_handler('redraw', self.draw)%0A
%09%0A%09def n
@@ -3... |
ec74d02b09b110df2a4e7be20e9b852a77771c8d | Create form to create Professor | simplemooc/accounts/forms.py | simplemooc/accounts/forms.py | from django import forms
# from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
from simplemooc.core.utils import generate_hash_key
from simplemooc.core.mail import send_mail_template
from simplemooc.accounts.models import PasswordReset
User = get_user_model()
class ... | Python | 0 | @@ -278,17 +278,28 @@
ordReset
+, Professor
%0A
-
%0A%0AUser =
@@ -1095,24 +1095,150 @@
odelForm):%0A%0A
+ is_professor = forms.BooleanField(%0A label='Voc%C3%AA %C3%A9 professor?',%0A initial=False,%0A required=False%0A )%0A
password
@@ -1253,24 +1253,33 @@
s.CharField(
+%0A ... |
624baee346bbb24d06b25e3f7c07ef8138dda174 | Remove unused imports from vyconf.types.dummy | libraries/vyconf/types/dummy/dummy.py | libraries/vyconf/types/dummy/dummy.py | # vyconf.types.dummy: dummy type validators for demonstration and testing
#
# Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Founda... | Python | 0.000001 | @@ -870,34 +870,8 @@
SA%0A%0A
-import sys%0Aimport inspect%0A
from
@@ -1969,10 +1969,8 @@
.name))%0A
-%0A%0A
|
0c82bcbe25dd20096b3e9029b3ff4c7c1cd6a8ce | Add django-inline as option to watcher program | hamlpy/hamlpy_watcher.py | hamlpy/hamlpy_watcher.py | from __future__ import print_function, unicode_literals
# haml-watcher.py
# Author: Christian Stefanescu (st.chris@gmail.com)
#
# Watch a folder for files with the given extensions and call the HamlPy
# compiler if the modified time has changed since the last check.
from time import strftime
import argparse
import sys... | Python | 0.000001 | @@ -2241,16 +2241,230 @@
phe).%22)%0A
+arg_parser.add_argument('--django-inline', dest='django_inline', type=bool, default=True, action='store',%0A help=%22Whether to support =%7B...%7D syntax for inline variables in addition to #%7B...%7D%22)%0A
arg_pars
@@ -3771,16 +3771,110 @@
_wrapper
+%0A... |
a25aaf3c58831c03b2987e7827c6d91aa6868b45 | Clarify test in add_caching_to_response | gratipay/utils/cache_static.py | gratipay/utils/cache_static.py | """
Handles caching of static resources.
"""
import os
from calendar import timegm
from email.utils import parsedate
from wsgiref.handlers import format_date_time
from aspen import Response
def version_is_available(version, path):
"""Return a boolean, whether we have the version they asked for.
"""
retur... | Python | 0.00002 | @@ -2530,27 +2530,8 @@
if
-request is None or
disp
@@ -2597,16 +2597,100 @@
e failed
+%0A assert request is not None # we can't have a dispatch_result without a request
%0A%0A ur
|
dcd195bacea6e1c3cbc04faabb2a811273540716 | remove donation link | alexBot/cogs/utils.py | alexBot/cogs/utils.py | # -*- coding: utf-8 -*-
import datetime
import humanize
import discord
from discord.ext import commands
from ..tools import Cog
DATEFORMAT = "%a, %e %b %Y %H:%M:%S (%-I:%M %p)"
class Utils(Cog):
"""The description for Utils goes here."""
@commands.command(aliases=['p'])
async def ping(self, ctx):
... | Python | 0 | @@ -4603,167 +4603,8 @@
%22)%0A%0A
- @commands.command()%0A async def donate(self, ctx):%0A await ctx.send(%22thanks for the thought! heres a paypal link: %3Chttps://paypal.me/mralext20%3E%22)%0A%0A
%0Adef
|
fb319e32fcfa47c35a547fcbb316f5521a0325dd | Make return fields and sort by optional | pybomb/clients/games_client.py | pybomb/clients/games_client.py | """
Client for the Games resource of GiantBomb
http://www.giantbomb.com/api/documentation#toc-0-15
"""
from pybomb.clients.base_client import BaseClient
class GamesClient(BaseClient):
"""
Client for the 'games' API resource
"""
RESOURCE_NAME = 'games'
RESPONSE_FIELD_MAP = {
'aliases': (T... | Python | 0 | @@ -1030,16 +1030,21 @@
n_fields
+=None
, sort_b
@@ -1044,16 +1044,21 @@
sort_by
+=None
, desc=T
@@ -1073,16 +1073,31 @@
it=None,
+%0A
offset=
@@ -1553,202 +1553,394 @@
se
-lf._validate_return_fields(return_fields)%0A self._validate_sort_field(sort_by)%0A%0A search_filter = self._... |
81e68ca702e4b6ef559bf034033817475a0b4bdc | add StaticApplication to root package | clastic/__init__.py | clastic/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
clastic
~~~~~~~
A functional Python web framework that streamlines explicit
development practices while eliminating global state.
:copyright: (c) 2012 by Mahmoud Hashemi
:license: BSD, see LICENSE for more details.
"""
import server
from cor... | Python | 0 | @@ -323,21 +323,16 @@
import (
-%0A
RESERVED
@@ -338,16 +338,30 @@
D_ARGS,%0A
+
Appl
@@ -365,24 +365,38 @@
pplication,%0A
+
SubAppli
@@ -411,18 +411,27 @@
+
Route
-%0A
)%0A%0Af
@@ -583,16 +583,53 @@
lication
+%0Afrom static import StaticApplicatio... |
9b31b0233922350324c52e293dab5e7d5fd75d8f | Remove force syndication | ckanext/syndicate/utils.py | ckanext/syndicate/utils.py | # -*- coding: utf-8 -*-
from __future__ import annotations
import json
import warnings
import logging
from collections import defaultdict
from itertools import zip_longest
from typing import Iterable, Iterator, Type
import ckan.model as ckan_model
import ckan.plugins.toolkit as tk
from ckan.plugins import get_plugin
... | Python | 0.000002 | @@ -2853,99 +2853,8 @@
urn%0A
- for profile in get_syndicate_profiles():%0A pkg.extras%5Bprofile.field_id%5D = %22true%22%0A
|
e6b4aa512bb408aa0071f6b12be0479aff0a4b63 | Don't allow single quotes in the web_cache because it breaks find/xargs | web_cache.py | web_cache.py | #!/usr/bin/env python3
from datetime import datetime
import hashlib
import re
import os
import requests
import sys
import time
import threading
import util
WEB_CACHE_DIR = os.path.dirname(__file__) + "/web_cache"
POST_REQUEST_SLEEP_TIME = 2.0
_lock = None
def set_fs_lock(lock):
global _lock
_lock = lock
_... | Python | 0.999981 | @@ -440,10 +440,8 @@
%5D%5C;%5C
-'%5C
,%5C.%5D
|
86439befc1a06597f5b8ff96c7e34424de6c0b97 | add alert service to slack | plugins/slack/slack.py | plugins/slack/slack.py |
import json
import requests
from alerta.app import app
from alerta.plugins import PluginBase
LOG = app.logger
SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/INSERT/YOUR/KEY'
SLACK_ATTACHMENTS = True
class ServiceIntegration(PluginBase):
def pre_receive(self, alert):
return alert
def post... | Python | 0 | @@ -746,16 +746,23 @@
#FF0000%22
+ # red
%0A
@@ -823,16 +823,26 @@
#FFA500%22
+ # orange
%0A
@@ -903,16 +903,26 @@
#FFFF00%22
+ # yellow
%0A
@@ -1100,16 +1100,21 @@
t/%25s%7C%25s%3E
+ %25s -
%25s%22 %25 (
@@ -1154,16 +1154,29 @@
t=True),
+ alert.event,
alert.t
@@ -2056,13 +2056,15 @@... |
59e31ecf0e23eadfb064baf1e50269795e1ecd45 | test times | pymatgen/io/gwwrapper/tests/test_times.py | pymatgen/io/gwwrapper/tests/test_times.py | #!/usr/bin/env python
__author__ = 'setten'
import timeit
import os
def test_write():
"""file write test function"""
l = []
for i in range(100000):
l.append(i)
f = open('test', 'w')
f.write(str(l))
f.close()
def test_read():
f = open('test', mode='r')
line = f.read()
f.... | Python | 0.000004 | @@ -328,24 +328,29 @@
%0A%0A%0Adef test_
+make_
folders():%0A
@@ -356,17 +356,144 @@
for
-n
+i in range(0, 100, 1):%0A os.mkdir('test_folder_%25s' %25 i)%0A os.rmdir('test_folder_%25s' %25 i)%0A%0A%0A%0Adef test_cd():%0A for i
in rang
@@ -527,33 +527,40 @@
dir('test_folder
-'
+_%25s' %25 i
... |
f5f6df4ae07ad5b51ff8335a6d65459c437f03dd | Modernize the code a bit: use re module use .split() string method | Demo/comparisons/sortingtest.py | Demo/comparisons/sortingtest.py | #! /usr/bin/env python
# 2) Sorting Test
#
# Sort an input file that consists of lines like this
#
# var1=23 other=14 ditto=23 fred=2
#
# such that each output line is sorted WRT to the number. Order
# of output lines does not change. Resolve collisions using the
# variable name. e.g.
#
# ... | Python | 0.999686 | @@ -749,19 +749,16 @@
mport re
-gex
%0Aimport
@@ -805,11 +805,8 @@
= re
-gex
.com
@@ -816,16 +816,13 @@
e('%5E
-%5C
(.*
-%5C
)=
-%5C
(%5B-+
@@ -833,9 +833,8 @@
-9%5D+
-%5C
)')%0A
@@ -875,18 +875,23 @@
-if
+match =
prog.ma
@@ -903,13 +903,25 @@
tem)
- %3E= 0
+%0A if match
:%0A
@@ -941,2... |
72a7a9390d3ae31c3cc7b1a54f921fcfd57c7786 | Set open status flags to `wontfix` (#1721) | auto_nag/scripts/close_intermittents.py | auto_nag/scripts/close_intermittents.py | # 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/.
from auto_nag.bzcleaner import BzCleaner
class Intermittents(BzCleaner):
def description(self):
return "In... | Python | 0 | @@ -419,16 +419,59 @@
ams = %7B%0A
+ %22include_fields%22: %5B%22_custom%22%5D,%0A
@@ -1701,50 +1701,333 @@
def
-get_autofix_change(self):%0A return %7B
+handle_bug(self, bug, data):%0A bugid = str(bug%5B%22id%22%5D)%0A%0A status_flags = %7B%0A field: %22wontfix%2... |
53a011471e449c16bf3e6e77177792f3cdd9d27c | Fix issue with partial quantities | shuup/front/basket/update_methods.py | shuup/front/basket/update_methods.py | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import six
from django.co... | Python | 0.000001 | @@ -2626,12 +2626,8 @@
y =
-int(
pars
@@ -2653,61 +2653,8 @@
lue)
-) # TODO: The quantity could be a non-integral value
%0A
|
b483754ad3713d1033c88d7f5031850b65d310b7 | Use new enums in sma (#62439) | homeassistant/components/sma/sensor.py | homeassistant/components/sma/sensor.py | """SMA Solar Webconnect interface."""
from __future__ import annotations
import logging
from typing import Any
import pysma
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
SensorEntity,
)
from homeassistant... | Python | 0 | @@ -221,64 +221,42 @@
S
-TATE_CLASS_MEASUREMENT,%0A STATE_CLASS_TOTAL_INCREASING
+ensorDeviceClass,%0A SensorEntity
,%0A
@@ -263,22 +263,26 @@
Sensor
-Entity
+StateClass
,%0A)%0Afrom
@@ -485,57 +485,8 @@
SL,%0A
- DEVICE_CLASS_ENERGY,%0A DEVICE_CLASS_POWER,%0A
@@ -4724,27 +4724,32 @@
lass ... |
9d24a11956ba687ac1324968ec85863938607bf4 | implement proper last_master_contact calculation | pyfarm/agent/http/api/state.py | pyfarm/agent/http/api/state.py | # No shebang line, this module is meant to be imported
#
# Copyright 2014 Oliver Palmer
#
# 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
#
# Unle... | Python | 0.000682 | @@ -2322,191 +2322,85 @@
#
-TODO: remove try block once master_reannounce is merged%0A # Calculate the last time we talked to or head from the master%0A try:%0A contacted = datetime.utcnow() -
+Determine the last time we talked to the master (if ever)%0A contacted =
con
@@ -2420,33... |
db6eb696b4e7c9798687350a0ca01db4734f5762 | set nice table name for answers | backend/src/backend/questions/models.py | backend/src/backend/questions/models.py | """SQLAlchemy models for questions and quest completions."""
import backend
db = backend.db
QUESTION_TYPES = ('upload', 'text')
class Answer(db.Model):
"""An answer to a question. Answers are submitted by learners and
evaluated by mentors.
"""
id = db.Column(db.Integer, primary_key=True, nullable=... | Python | 0.000001 | @@ -251,24 +251,55 @@
rs.%0A %22%22%22%0A
+ __tablename__ = 'answers'%0A%0A
id = db.
|
5407be4df6120e305a305eec59aa2a91ad11bef9 | exit when failures are reported | client-webserver/client.py | client-webserver/client.py | #!/usr/bin/env python
from chocolate_protocol_pb2 import chocolatemessage
from Crypto.Hash import SHA256
import M2Crypto
import urllib2, os, sys, time, random, CSR
def sha256(m):
return SHA256.new(m).hexdigest()
try:
upstream = "https://%s/chocolate.py" % os.environ["CHOCOLATESERVER"]
except KeyError:
pr... | Python | 0 | @@ -157,16 +157,21 @@
dom, CSR
+, sys
%0A%0Adef sh
|
2e1a816d1f2af12fa4e97ab249bbb58e02fb10a6 | switch to LiteEthPHY and simplify Ethernet/Etherbone. | litex_boards/targets/pano_logic_g2.py | litex_boards/targets/pano_logic_g2.py | #!/usr/bin/env python3
# This file is Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# License: BSD
import os
import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex_boards.platforms import pano_logic_g2
from litex.soc.cores.clock import *
from lite... | Python | 0 | @@ -470,20 +470,16 @@
teEthPHY
-GMII
%0A%0A# CRG
@@ -2012,28 +2012,28 @@
thernet
-------------
+/ Etherbone
--------
@@ -2110,32 +2110,50 @@
if with_ethernet
+ or with_etherbone
:%0A se
@@ -2177,36 +2177,32 @@
phy = LiteEthPHY
-GMII
(%0A
@@ -2348,169 +2348,85 @@
-with_hw_init_r... |
2187561b705d384f4ff4107bdc410f95ad9dffe6 | Fix player URL extraction in bloomberg plugin | src/streamlink/plugins/bloomberg.py | src/streamlink/plugins/bloomberg.py | from functools import partial
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate
from streamlink.stream import HDSStream, HLSStream, HTTPStream
from streamlink.utils import parse_json, update_scheme
class Bloomberg(Plugin):
VOD_API_URL = 'https://www.bloomberg.com/api... | Python | 0 | @@ -899,16 +899,17 @@
mpile(r'
+%7B
APP_BUND
|
1daa0333d32d20b392a015d5f06e24ab361b2c03 | fix bug in list_exports() with similar lines | salt/modules/nfs3.py | salt/modules/nfs3.py | # -*- coding: utf-8 -*-
'''
Module for managing NFS version 3.
'''
from __future__ import absolute_import
# Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def __virtual__():
'''
Only work on POSIX-like systems
'''
if not salt.utils.which('sh... | Python | 0 | @@ -867,16 +867,122 @@
split()%0A
+%0A # Handle the case where the same path is given twice%0A if not comps%5B0%5D in ret:%0A
@@ -1000,24 +1000,25 @@
ps%5B0%5D%5D = %5B%5D%0A
+%0A
|
ce261e4afe230c103159ff8f846324ce956ecc60 | Fix CSV logger warning (#4419) | pytorch_lightning/loggers/csv_logs.py | pytorch_lightning/loggers/csv_logs.py | # Copyright The PyTorch Lightning team.
#
# 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 i... | Python | 0.000002 | @@ -1560,24 +1560,53 @@
elf.log_dir)
+ and os.listdir(self.log_dir)
:%0A
|
f63e7769aa6c33062f651547f14a295f0f81921e | Patch for Issue #222 better handling of unicode strings in BaseEncryptedField | django_extensions/db/fields/encrypted.py | django_extensions/db/fields/encrypted.py | from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django import forms
from django.conf import settings
import warnings
try:
from keyczar import keyczar
except ImportError:
raise ImportError('Using an encrypted field requires the Keyczar module. '
'Y... | Python | 0 | @@ -1060,16 +1060,180 @@
ength))%0A
+ # TODO: Re-examine if this logic will actually make a large-enough%0A # max-length for unicode strings that have non-ascii characters in them.%0A
@@ -1270,16 +1270,16 @@
_length%0A
-
%0A
@@ -1531,16 +1531,126 @@
= value%0A
+ # This ... |
67ce14f2c3650033714461ef95c38a54c6817a2a | add tests | pygam/tests/test_GAM_params.py | pygam/tests/test_GAM_params.py | # -*- coding: utf-8 -*-
import numpy as np
import pytest
from pygam import *
def test_lam_non_neg_array_like(cake_X_y):
"""
lambda must be a non-negative float or array of floats
"""
X, y = cake_X_y
try:
gam = LinearGAM(lam=-1).fit(X, y)
except ValueError:
assert(True)
... | Python | 0 | @@ -1431,46 +1431,93 @@
+GAM
should
-be able to do linear regression
+collect model statistics after optimization ends even if it didnt converge
%0A
@@ -1629,16 +1629,653 @@
cs_'))%0A%0A
+def test_easy_plural_arguments(wage_X_y):%0A %22%22%22%0A it should easy to set global term arguments%0A %22%... |
3b0c721afbe8b8d86174378fea4b81fc2dc24aba | Include subsecond ticking times | gui_player.py | gui_player.py |
from kivy.clock import Clock
import audio as a_m
from defines import *
class GuiPlayer(object):
def __init__(self, colour, widget, game):
self.colour = colour
self.player = game.get_player(colour)
self.widget = widget
self.game = game
total_time = game.get_total_time()
... | Python | 0.000001 | @@ -24,16 +24,28 @@
Clock%0A%0A
+import time%0A
import a
@@ -409,32 +409,74 @@
.ticking = False
+%0A self.last_tick_time = time.time()
%0A%0A def prompt
@@ -684,16 +684,195 @@
timers%0A
+ elapsed = time.time() - self.last_tick_time %0A # In case of leap seconds, time changes etc.%0A ... |
8f70fcda62fc2c34ecf15b6a7cca7a3c72232931 | Mark IPUZ_MANDATORY_FIELDS as 'private' to avoid use outside this library | ipuz/core.py | ipuz/core.py | import json
from ipuz.exceptions import IPUZException
from ipuz.puzzlekinds import IPUZ_PUZZLEKINDS
from ipuz.validators import (
IPUZ_FIELD_VALIDATORS,
validate_version,
get_version_number,
get_kind_version_number,
)
# The versions of the ipuz standard that this library supports
IPUZ_VERSIONS = list(... | Python | 0 | @@ -514,16 +514,17 @@
ersion%22%0A
+_
IPUZ_MAN
@@ -918,24 +918,25 @@
or field in
+_
IPUZ_MANDATO
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.