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 |
|---|---|---|---|---|---|---|---|
3f890a1c37d245af145896655e7c929db7a20d88 | handle rows with no votes | openelex/us/md/load.py | openelex/us/md/load.py | from os.path import exists, join
from openelex.base.load import BaseLoader
from openelex.us.md import fetch
from mongoengine import *
from openelex.models import Candidate, Result, Contest
import json
import csv
class LoadResults(BaseLoader):
def run(self, year):
files = self.filenames[str(year)]
... | Python | 0.000001 | @@ -206,16 +206,101 @@
rt csv%0A%0A
+%22%22%22%0AUsage:%0A%0Afrom openelex.us.md import load%0Al = load.LoadResults()%0Al.run(2012)%0A%22%22%22%0A%0A%0A
class Lo
@@ -1245,45 +1245,8 @@
ve'%0A
- # fix ' LEGS 26'%0A
@@ -1821,16 +1821,165 @@
reader:%0A
+ if not row%5B'Office... |
54198b6920d30bc9e1f5d0761a00a14a23453829 | Test suite improved | flask_mongo_sessions/tests/__init__.py | flask_mongo_sessions/tests/__init__.py | from __future__ import with_statement
import unittest
import uuid
import re
import time
from datetime import timedelta
import test_apps
class BaseTestCase(unittest.TestCase):
def setUp(self):
self.app = test_apps.create_app(self._db_interface)
self.client = self.app.test_client()
class ZeroCon... | Python | 0 | @@ -235,24 +235,28 @@
e_app(self._
+get_
db_interface
@@ -247,32 +247,34 @@
get_db_interface
+()
)%0A self.c
@@ -2851,19 +2851,8 @@
n %5B'
-pymongo', '
mong
@@ -2858,16 +2858,27 @@
goengine
+', 'pymongo
'%5D:%0A
@@ -2945,62 +2945,19 @@
def
-__init__(self, *args, **kwargs):%0A self.
+... |
7dc3ca92b33951ef712e463d650aaeb5c3ef7403 | Bump to version 0.1.5 | treecat/__init__.py | treecat/__init__.py | __version__ = '0.1.4'
| Python | 0 | @@ -16,7 +16,7 @@
0.1.
-4
+5
'%0A
|
452c69bd10c2c14a802bda903f200d98d46f1f5a | Use real final event time. | exp/viroscopy/model/HIVGraph.py | exp/viroscopy/model/HIVGraph.py | import numpy
import os
import zipfile
import logging
from apgl.graph.PySparseGraph import PySparseGraph
from exp.viroscopy.model.HIVVertices import HIVVertices
from apgl.util.Parameter import Parameter
from apgl.util.Util import Util
"""
A HIVGraph is a Graph except that its vertices are HIVIndividuals and
there are ... | Python | 0.000009 | @@ -707,16 +707,59 @@
t=10000)
+%0A %0A self.endEventTime = None
%0A%0A de
@@ -4938,32 +4938,33 @@
%22%22%22%0A
+#
vertexArray = se
@@ -5004,16 +5004,17 @@
+#
imin = n
@@ -5078,16 +5078,17 @@
+#
rmin = n
@@ -5154,32 +5154,33 @@
%0A
+#
return numpy... |
4d685772d0e75b92768180f62a1e5645e23a1b11 | fix bug in is_element (#882) | pymatgen/entries/computed_entries.py | pymatgen/entries/computed_entries.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
import json
from monty.json import MontyEncoder, MontyDecoder
from pymatgen.core.composition import Composition
from monty.json import MSONable
"""
This module implem... | Python | 0 | @@ -3135,22 +3135,18 @@
ion.
-num_atoms == 1
+is_element
%0A%0A
|
1966ed8226275719178f4792cd53d5091b76bf05 | Implement run method | orpsoc/simulator/verilator.py | orpsoc/simulator/verilator.py | import os
import shutil
import subprocess
from .simulator import Simulator
class Verilator(Simulator):
def __init__(self, system):
super(Verilator, self).__init__(system)
self.verilator_options = []
self.src_files = []
self.include_files = []
self.include_dirs = []
... | Python | 0.000001 | @@ -35,16 +35,41 @@
process%0A
+from orpsoc import utils%0A
from .si
@@ -4702,16 +4702,220 @@
%0A %0A
+ def run(self, args):%0A #TODO: Handle arguments parsing%0A utils.launch('./Vorpsoc_top',%0A args,%0A cwd=os.path.join(self.sim_root, 'obj_dir')... |
e34f33b4f6037579b75aa26927136f82c3aaefd7 | Make --repo-path an optional argument for db_recreate | trove/cmd/manage.py | trove/cmd/manage.py | # Copyright 2011 OpenStack Foundation
# 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 requ... | Python | 0.012566 | @@ -5979,16 +5979,18 @@
gument('
+--
repo_pat
|
ae0fd3d6288ba82202a153de91f6b6f91d1bfe5f | Remove unnecessary cast to dictionary. | website/conferences/message.py | website/conferences/message.py | # -*- coding: utf-8 -*-
import re
import hmac
import hashlib
import logging
from nameparser import HumanName
from werkzeug.utils import cached_property
from framework.flask import request
from website import settings
from website.conferences.exceptions import ConferenceError
logger = logging.getLogger(__name__)
... | Python | 0 | @@ -2245,26 +2245,16 @@
est.form
-.to_dict()
%0A%0A @c
|
e439827a022f32611732746a1d7dad9e1147d45e | version bump | __openerp__.py | __openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Jean Ventura (<http://venturasystems.net>).
#
# This program is free software: you can redistribute it and/or modify
# it under... | Python | 0.000001 | @@ -1045,17 +1045,17 @@
: %220.4.
-2
+3
%22,%0A %22
|
30f672456d81a2b093decd79148a97f9c54206f5 | purge queued task | frappe/utils/doctor.py | frappe/utils/doctor.py | from __future__ import unicode_literals
import json, base64, os
import frappe.utils
from frappe.celery_app import get_celery
from frappe.utils.file_lock import check_lock, LockTimeoutError
from frappe.utils.scheduler import is_scheduler_disabled
from collections import Counter
from operator import itemgetter
def get_r... | Python | 0.000001 | @@ -1148,79 +1148,299 @@
()%0A%09
-if
+%0A%09
event
-:%0A%09%09event_tasks = frappe.get_hooks()%5B'scheduler_events'%5D%5Bevent%5D
+_tasks = %5B%5D%0A%09for app in frappe.get_all_apps(True):%0A%09%09all_events = frappe.get_hooks(app_name=app).get('scheduler_events', %7B%7D)%0A%09%09if event:%0A%09%09%09event_tasks +... |
219ad3c9ed82e06c5af53cb0ff544a4dd1d87837 | Remove unused backrefs from NotificationSubscription | website/notifications/model.py | website/notifications/model.py | from modularodm import fields
from framework.mongo import StoredObject, ObjectId
from modularodm.exceptions import ValidationValueError
from website.project.model import Node
from website.notifications.constants import NOTIFICATION_TYPES
def validate_subscription_type(value):
if value not in NOTIFICATION_TYPES:... | Python | 0 | @@ -679,24 +679,8 @@
True
-, backref='none'
)%0A
@@ -737,32 +737,8 @@
True
-, backref='email_digest'
)%0A
@@ -802,39 +802,8 @@
True
-, backref='email_transactional'
)%0A%0A
|
8d519a811b05ffa6b63444ccbf85fb7c4e07f8ef | rename utils to math | algpy/math.py | algpy/math.py | """Summary."""
from __future__ import absolute_import
class Fraction(object):
"""docstring for Fraction."""
def __init__(self, numerator, denominator):
"""
Constructor.
Args:
numerator (int): The numerator or top part of the fraction
denominator (int): The den... | Python | 0.00145 | @@ -153,16 +153,34 @@
ominator
+=1, whole_number=0
):%0A
@@ -395,69 +395,489 @@
-self.numerator = numerator%0A self.denominator = denomin
+if denominator == 0:%0A raise ValueError(%22Denominator cannot be zero.%22)%0A%0A if not isinstance(numerator, int) or not isinstance(denominat... |
71ca8afa0271bcfbca29358fe08247d974dbe288 | remove un-used SocialProfileFilterSet | friend/api/v1/views.py | friend/api/v1/views.py | from functools import reduce
import operator
from django.db.models.query_utils import Q
from rest_condition import Or
from rest_framework import status
from rest_framework.decorators import api_view, permission_classes
from rest_framework.exceptions import ValidationError
from rest_framework.generics import get_object... | Python | 0 | @@ -673,16 +673,17 @@
elfOnly%0A
+#
from fri
|
ecb13c2a7ae411431b147be296778058d4068100 | Increase the worker detection timeout. | extension/reviewbotext/views.py | extension/reviewbotext/views.py | from __future__ import unicode_literals
import json
from django.contrib.auth.models import User
from django.db import IntegrityError, transaction
from django.http import (HttpResponse,
HttpResponseBadRequest,
HttpResponseForbidden)
from django.shortcuts import get_obj... | Python | 0 | @@ -7902,17 +7902,18 @@
timeout=
-2
+10
)%0A%0A
|
bcc9c398eafeaf2b1ae4b02c67e1f6b4260f9355 | Enable OrderedEnqueuer from keras in tf.keras. (#19183) | tensorflow/python/keras/utils/__init__.py | tensorflow/python/keras/utils/__init__.py | # Copyright 2016 The TensorFlow 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 applica... | Python | 0 | @@ -973,16 +973,97 @@
et_file%0A
+from tensorflow.python.keras._impl.keras.utils.data_utils import OrderedEnqueuer%0A
from ten
|
4963856156516689b0ae1a38c681d92f2c15ec6e | remove warnings by renaming variables/methods | sorter.py | sorter.py | def getfirstentryfromeachkeyasmap(changeentrymap):
firstentries = {}
for key in changeentrymap.keys():
changeentries = changeentrymap.get(key)
if changeentries:
firstentries[key] = changeentries[0]
return firstentries
def deleteentry(changeentrymap, changeentrytodelete):
fo... | Python | 0.000001 | @@ -799,26 +799,35 @@
change
-entrytoAdd
+setwithearliestdate
= getch
@@ -917,26 +917,35 @@
, change
-entrytoAdd
+setwithearliestdate
)%0A
@@ -974,18 +974,27 @@
ange
-entrytoAdd
+setwithearliestdate
)%0A%0A
|
4a272f19db4a9eec65d5d284088b64f1c96c43ad | Fix password rest done routing error | opentreemap/registration_backend/views.py | opentreemap/registration_backend/views.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django import forms
from django.core.exceptions import ValidationError
from django.contrib.auth.forms import AuthenticationForm
from django.utils.translation import ugettext_lazy a... | Python | 0 | @@ -500,24 +500,61 @@
ordResetView
+%0Afrom django.urls import reverse_lazy
%0A%0Afrom regis
@@ -7332,24 +7332,177 @@
ResetView):%0A
+ # Override the value of %60password_reset_done%60 set in the default%0A # PasswordResetView%0A success_url = reverse_lazy('auth_password_reset_done')%0A%0A
def post
|
767556b4fb307579a161fa44c06e2e7c2385eb2c | Rename variable from platf to platform_ | src/funfuzz/ccoverage/get_build.py | src/funfuzz/ccoverage/get_build.py | # coding=utf-8
#
# 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 https://mozilla.org/MPL/2.0/.
"""Downloads coverage builds and other coverage utilities, such as grcov.
"""
import io
import loggin... | Python | 0 | @@ -1201,16 +1201,20 @@
platf
+orm_
= fuzzf
@@ -1319,16 +1319,20 @@
s, platf
+orm_
)%0A ob
|
b7c447066058bbeadb7bb611f68746f3eca93ede | debug operation | edi_extract/wizard/import_wizard.py | edi_extract/wizard/import_wizard.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<https://micronaet.com>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebru... | Python | 0.000002 | @@ -2819,32 +2819,68 @@
: # TODO check%0A
+ pdb.set_trace()%0A
@@ -2911,32 +2911,32 @@
ow, col).value)%0A
-
@@ -2970,32 +2970,68 @@
: # TODO check%0A
+ pdb.set_trace()%0A
@@ -3062,32 +3062,32 @@
ow, col).value)%0A
-
... |
472c01fd75586be66d259231fc9273b7a3b390de | Add named arguments for lattice vectors | pybinding/lattice.py | pybinding/lattice.py | import _pybinding
class Lattice(_pybinding.Lattice):
def __init__(self, min_neighbours=1):
super().__init__(min_neighbours)
self.sub = dict()
self.names = []
def set_vectors(self, *vectors):
for vector in vectors:
self.add_vector(tuple(vector))
def create_subl... | Python | 0.000001 | @@ -212,16 +212,28 @@
lf,
-*vectors
+v1, v2=None, v3=None
):%0A
@@ -253,25 +253,69 @@
ctor in
-vectors:%0A
+(v1, v2, v3):%0A if vector is not None:%0A
|
2502447e05daedd0fc44443b92e67ce3bf40ff37 | fix pep8 on tamplate tag article (box), E302 expected ./opps/article/templatetags/article_tags.py:9:1: E302 expected 2 blank lines, found 1 | opps/article/templatetags/article_tags.py | opps/article/templatetags/article_tags.py | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from opps.article.models import ArticleBox
register = template.Library()
@register.inclusion_tag('article/articlebox_detail.html')
def get_articlebox(slug, channel_slug=None):
if channel_slug:
slug = slug + '-' + channel... | Python | 0.000005 | @@ -154,16 +154,17 @@
rary()%0A%0A
+%0A
@registe
|
7d731b32b1eb0b3552b8e679ec8489cc2149765d | Use same method signature used in subclasses | pybossa/importers.py | pybossa/importers.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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 version 3 of the License, or
# (at... | Python | 0 | @@ -1599,24 +1599,30 @@
f tasks(self
+, form
):%0A p
|
bae36161b2879a853d09bacf3a1543d037a03ef1 | Update `DefaultsMigrator` to support the `fatal` argument | src/gateway/migrations/defaults.py | src/gateway/migrations/defaults.py | # Copyright (C) 2022 OpenMotics BV
#
# 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 version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... | Python | 0 | @@ -1043,16 +1043,29 @@
rate(cls
+, fatal=False
): # ty
@@ -1069,16 +1069,20 @@
type: (
+bool
) -%3E Non
@@ -1451,16 +1451,60 @@
name__))
+%0A if fatal:%0A raise
%0A%0A @c
|
871ecd9ca0558cbca9a82c37fe5da6d4100c79ff | Remove old modular-metadata check conditions for IDs | website/search/share_search.py | website/search/share_search.py | from __future__ import unicode_literals
import json
from time import gmtime
from calendar import timegm
from datetime import datetime
import pytz
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from elasticsearch import Elasticsearch
from website import settings
share_es = Elas... | Python | 0.000001 | @@ -6949,25 +6949,8 @@
ID'%5D
- or result%5B'_id'%5D
,%0A
@@ -7031,59 +7031,8 @@
rl'%5D
- if result.get('id') else result%5B'links'%5D%5B0%5D%5B'url'%5D
,%0A
|
d1297cbbdbfb6f90fc703d1e9ae7820f4a81ebe9 | change contact email subject line to use project name in settings instead of harcoded name | sources/views.py | sources/views.py | from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.core.management import call_command
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render # , redirect
from django.template.context import RequestContext
from django.utils.encoding imp... | Python | 0 | @@ -511,24 +511,69 @@
#, ListView%0A
+from sourcelist.settings import PROJECT_NAME%0A
from sources
@@ -3357,26 +3357,31 @@
'
-DivSciSources
+%5B%7B%7D%5D Contact form
mess
+s
age
@@ -3392,24 +3392,38 @@
%7B%7D'.format(
+PROJECT_NAME,
name),%0A
|
a4d23fc10851ab0a65e235b2f1918907b1d591a3 | Fix linter problem | python/ambassador/fetch/k8sobject.py | python/ambassador/fetch/k8sobject.py | from __future__ import annotations
from typing import Any, Dict, Iterator, Optional
import collections.abc
import dataclasses
import enum
from ..config import Config
@dataclasses.dataclass(frozen=True)
class KubernetesGVK:
"""
Represents a Kubernetes resource type (API group, version and kind).
"""
... | Python | 0.000027 | @@ -3329,16 +3329,31 @@
amespace
+: Optional%5Bstr%5D
= self.
|
7ec3c34be0c57163840a8df0f7e2c174a7f0dd67 | Add batch command for sqlite files | alembic/env.py | alembic/env.py | # from https://github.com/virajkanwade/alembic-templates-pyramid/blob/master/pyramid/env.py
from alembic import context
from sqlalchemy import engine_from_config, pool
from paste.deploy import loadapp
from pyramid.paster import get_appsettings, setup_logging
#from logging.config import fileConfig
# this is the Alembic... | Python | 0 | @@ -2220,16 +2220,54 @@
metadata
+,%0A render_as_batch=True
%0A
|
b96aec1d6de11cc5c8839ceb92967e0a47cdad5b | Remove unneeded line. | pybtex/bibtex/bst.py | pybtex/bibtex/bst.py | # Copyright (c) 2007, 2008, 2009, 2010, 2011 Andrey Golovizin
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | Python | 0.000029 | @@ -2863,56 +2863,8 @@
me')
-%0A WHITESPACE = Pattern(ur'%5Cs+', 'whitespace')
%0A%0A
|
d0200f5246f471f98e2e011ac8d95bb43dee2b5f | add some about encoding | alfred/core.py | alfred/core.py | # -*- coding: utf-8 -*-
import os, sys, plistlib, time, subprocess
from feedback import Feedback
import util
_bundle_id = None
_CONFIG_FOLDER = os.path.expanduser('~/Library/Application Support/Alfred 2/Workflow Data/')
_CACHE_FOLDER = os.path.expanduser('~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data... | Python | 0.000054 | @@ -59,16 +59,35 @@
bprocess
+%0Aimport unicodedata
%0A%0Afrom f
@@ -896,16 +896,204 @@
dle_id%0A%0A
+def setDefaultEncodingUTF8():%0A reload(sys)%0A sys.setdefaultencoding('utf8')%0A del sys.setdefaultencoding%0A%0Adef decode(s):%0A return unicodedata.normalize(%22NFC%22, s.decode(%22utf-8%22))%0A%0A
d... |
d97fb445c64af796ed88025e3a243caeb62339b9 | Deal with multiple value filters | elasticsearch_dsl/faceted_search.py | elasticsearch_dsl/faceted_search.py | from datetime import timedelta, datetime
from six import iteritems, itervalues
from functools import partial
from .search import Search
from .filter import F
from .aggs import Terms, DateHistogram, Histogram
from .utils import AttrDict
from .result import Response
DATE_INTERVALS = {
'month': lambda d: (d+timedelt... | Python | 0 | @@ -834,34 +834,34 @@
, bucket%5B'key'%5D
-==
+in
filter),%0A Da
@@ -986,18 +986,18 @@
%5B'key'%5D
-==
+in
filter)
@@ -1689,20 +1689,18 @@
t(name,
-None
+()
)%0A
@@ -2047,23 +2047,18 @@
lters =
-filters
+%7B%7D
%0A
@@ -2364,16 +2364,60 @@
value%5D)%0A
+ self._raw_filters%5Bname... |
93e4fedfd159849a6d5afb60b1835033e1f4efea | Fix typo | gather/topic/models.py | gather/topic/models.py | # -*- coding:utf-8 -*-
from datetime import datetime
from gather.extensions import cache
from gather.account.models import Account
from gather.node.models import Node
from gather.extensions import db
class ReadTopic(db.Model):
__table_args__ = (
db.UniqueConstraint(
'user_id', 'topic_id', nam... | Python | 0.999999 | @@ -2613,16 +2613,17 @@
_list.ap
+p
end(user
|
d3f82c3ed1e4879dfc0a0885e35c848b6cf311fb | use dns cache for improved adress resolving | pycurl/tests/test.py | pycurl/tests/test.py | # $Id$
## System modules
import sys
import threading
import time
## PycURL module
import pycurl
class Test(threading.Thread):
def __init__(self, url, ofile):
threading.Thread.__init__(self)
self.curl = pycurl.init()
self.curl.setopt(pycurl.URL, url)
self.curl.setopt(pycurl.FILE,... | Python | 0 | @@ -464,16 +464,128 @@
DIRS, 5)
+%0A self.curl.setopt(pycurl.DNS_USE_GLOBAL_CACHE, 1)%0A self.curl.setopt(pycurl.DNS_CACHE_TIMEOUT, 10)
%0A%0A de
|
ba408df025136563c0eafe00551f23e44e9c2731 | Change version to 1.0.1 unstable | __openerp__.py | __openerp__.py | # -*- coding: utf-8 -*-
{
"name": "Account Credit Transfer",
"version": "1.0",
"author": "XCG Consulting",
"website": "http://www.openerp-experts.com",
"category": 'Accounting',
"description": """Account Voucher Credit Transfer Payment.
You need to set up some things before using it.
A ... | Python | 0.000001 | @@ -78,16 +78,18 @@
n%22: %221.0
+.1
%22,%0A %22
|
8ee4ecc6dfc851c03d452d26b9b8277fe8aed0fb | update map to list | pygeotools/filter.py | pygeotools/filter.py | #! /usr/bin/env python
"""
Command-line wrapper around raster filters in filtlib
"""
#Note: currently need to specify fn first, as -param accepts arbitrary number of arguments
#Need better way to record params than in filename - write history to header?
#Precision on float
import sys
import os
import argparse
import... | Python | 0 | @@ -2468,33 +2468,45 @@
param =
-map(
+%5B
float
-,
+(i) for i in
param
-)
+%5B1:%5D%5D
%0A
@@ -2691,33 +2691,45 @@
param =
-map(
+%5B
float
-,
+(i) for i in
param
-)
+%5B1:%5D%5D
%0A
@@ -2903,25 +2903,37 @@
m =
-map(
+%5B
float
-,
+(i) for i in
param
-)
+%5B1:%5D%5D
%0A
@@ -4528,18 +... |
f27fc83bf7a9c14b90cba1052d54397a211f7a24 | add a forward slash to the allowed regex pattern when making the repo slug | src/issuebranch/console_scripts.py | src/issuebranch/console_scripts.py | #!/usr/bin/env python
"""
create a new branch for the given redmine issue
"""
import argparse
import importlib
import os
import sh
import sys
from slugify import slugify
MAX_SLUG_LENGTH = 50
def make_branch(name):
command_l = 'git checkout -b {} master'.format(name).split()
getattr(sh, command_l[0])(*comman... | Python | 0 | @@ -1143,16 +1143,98 @@
bject)%0A%0A
+ # add the forward slash to the allowed regex%0A # default is: r'%5B%5E-a-z0-9%5D+'%0A
rege
@@ -1250,16 +1250,17 @@
= r'%5B%5E/
+%5C
-a-z0-9_
@@ -1356,41 +1356,8 @@
rn)%0A
- print('SLUG %7B%7D'.format(slug))
%0A
|
c1809cf217f268a5325b58513e4872a8ad44e231 | Add cross domain request support for server, incomplete. | webserver.py | webserver.py | """
This module is responsible for handling web requests using Flask.
Requests are of the form (start, end) in unix time and are passed on to the db
manager, which then returns the appropriate data to be sent back as JSON.
"""
#TODO: turn this into a daemon
from flask import Flask, request
import json
import db
imp... | Python | 0 | @@ -291,20 +291,67 @@
uest
-%0Aimport json
+, current_app, jsonify%0Afrom functools import update_wrapper
%0Aimp
@@ -461,25 +461,737 @@
g)%0A%0A
-@app.route(%22/data
+# Allow cross domain requests, see http://flask.pocoo.org/snippets/56/%0A# Simplified version.%0A#TODO: configure allowed origins etc. in this via con... |
7417829aefe911aaf9ec9592566d8f37021d9b2d | Remove outdated sentence from docstring. | pygments/__init__.py | pygments/__init__.py | # -*- coding: utf-8 -*-
"""
Pygments
~~~~~~~~
Pygments is a syntax highlighting package written in Python.
It is a generic syntax highlighter for general use in all kinds of software
such as forum systems, wikis or other applications that need to prettify
source code. Highlights are:
* a ... | Python | 0.999828 | @@ -2733,20 +2733,16 @@
ormatter
-%0A
%60%60forma
@@ -2752,79 +2752,8 @@
r%60%60.
- If %60%60filters%60%60 are given they will be applied%0A on the token stream.
%0A%0A
|
23c8748b5fa42753807a500a8b2406e1299f4e78 | Fix valid_name regex for SLexer | pygments/lexers/r.py | pygments/lexers/r.py | # -*- coding: utf-8 -*-
"""
pygments.lexers.r
~~~~~~~~~~~~~~~~~
Lexers for the R/S languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, do_insertions, bygroups
fr... | Python | 0.000002 | @@ -2758,17 +2758,17 @@
?:%5Ba-zA-
-z
+Z
%5D%7C%5B_.%5D%5B%5E
|
690f4e9bff4ffb88265ebac30d1915416c1ed29f | Remove unnecessary assertion | github/contributors.py | github/contributors.py | import json
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from tornado.log import app_log
from .base_filter import GitHubRepositoryFilter
from vizydrop.sdk.source import StreamingDataSource, SourceSchema
from vizydrop.fields import *
class GitHubContributorsStatsSource(StreamingDataSource)... | Python | 0.998709 | @@ -1835,46 +1835,8 @@
8'))
-%0A assert isinstance(data, list)
%0A%0A
|
76bc421ca453a86b271dda8fc1783438583ce916 | Update util.CropArray() to handle multi-dimensional input arrays. | glimpse/util/garray.py | glimpse/util/garray.py | """Miscellaneous functions for dealing with numpy arrays."""
# Copyright (c) 2011 Mick Thomure
# All rights reserved.
#
# Please see the file COPYING in this distribution for usage terms.
import Image
import math
import numpy as np
#: Element type for an array of Glimpse activation values.
ACTIVATION_DTYPE = np.floa... | Python | 0 | @@ -2874,44 +2874,301 @@
%22%0A
-assert np.all(np.array(data.
+if out_shape == None or len(out_shape) %3C 1:%0A return data%0A in_shape = data.shape%0A if len(out_shape) %3C len(in_shape):%0A out_shape = data.shape%5B:-len(out_shape)%5D + tuple(out_shape)%0A elif len(out_shape) %3E len(in_shape):%0A rais... |
41fca68440abf4b22b21d262b9a87d767c4edc23 | Move the code which used for reading text file into read_text_corpus() | pythainlp/corpus/__init__.py | pythainlp/corpus/__init__.py | # -*- coding: utf-8 -*-
import os
from typing import NoReturn, Union
from urllib.request import urlopen
import requests
from pythainlp.tools import get_full_data_path, get_pythainlp_path
from tinydb import Query, TinyDB
from tqdm import tqdm
# Remote and local corpus databases
_CORPUS_DIRNAME = "corpus"
_CORPUS_PAT... | Python | 0.982762 | @@ -815,24 +815,193 @@
S_DB_PATH%0A%0A%0A
+def read_text_corpus(path: str) -%3E list:%0A lines = %5B%5D%0A with open(path, %22r%22, encoding=%22utf-8-sig%22) as fh:%0A lines = fh.read().splitlines()%0A%0A return lines%0A%0A%0A
def get_corp
@@ -1150,32 +1150,32 @@
lines =
-%5B%5D%0A with open
+rea... |
f8055d603e54d850cc390e49c496f63163b95d41 | add import to show_graph.py | goldberg/show_graph.py | goldberg/show_graph.py | #! /usr/bin/python
# -*- coding: utf-8 -*-
import cPickle as pickle
import matplotlib.pyplot as plt
import numpy as np
import seaborn
import pandas as pd
import matplotlib.cm as cm
def pitch(height):
""" Calculate pitch of given height. """
cde_list = ["c","d","e","f","g","a","b"]
return cde_list[height %... | Python | 0 | @@ -174,16 +174,55 @@
m as cm%0A
+from mpl_toolkits.mplot3d import Axes3D
%0A%0Adef pi
|
8ceadefeec9a1e67998f07f43a299bf9802ff6cd | change custom recommendation query | src/db.py | src/db.py | from elasticsearch import Elasticsearch
import os
host = 'http://{}:{}@localhost:9200/'.format(os.environ['ELASTIC_USER'], os.environ['ELASTIC_PASSWORD'])
es = Elasticsearch([host])
def getRecommendations(topics):
"""
This will generate an elastisearch with a custom scoring script for the input topics.
For... | Python | 0.000001 | @@ -928,651 +928,174 @@
%22%22%22%0A
-%0A
-# The tf_string computes the term frequency of the query term%0A tf_string = %22%22%22_index%5B'topics'%5D%5B'%7B%7D'%5D.tf()%22%22%22%0A # Sum all the occurences of each topic%0A sum_frequencies_script = ' + '.join(%5B%0A tf_string.format(topic.lower())... |
c4187e804d3a0f2b9b0053acdc34d9868abd2b65 | Test git | python/02-HelloWorld/main.py | python/02-HelloWorld/main.py | # Making Sense of Sensors Workshop
# Educators Edition 2015
#
# 00-SampleIncludeFiles
# main.py
'''
@author: Dead Robot Society
'''
import actions as act
##################################
# main routine
##################################
'''
This routine controls everything that happens.
Remember to start w... | Python | 0.000001 | @@ -425,16 +425,20 @@
gramName
+Here
%22) # ch
|
b275ecf63c5650f02390fcf16e8672637bc09831 | Fix subprocess to work properly when frozen | gooey/gui/processor.py | gooey/gui/processor.py | import os
import re
import subprocess
from functools import partial
from multiprocessing.dummy import Pool
import sys
from gooey.gui.pubsub import pub
from gooey.gui.util.casting import safe_float
from gooey.gui.util.functional import unit, bind
from gooey.gui.util.taskkill import taskkill
class Pro... | Python | 0 | @@ -1083,16 +1083,39 @@
ss.PIPE,
+ stdin=subprocess.PIPE,
%0D%0A
|
ff7ddb9711b943fa9b93a930d0ab82ea58378bb5 | FIX not handler_name in log | wood/wood.py | wood/wood.py |
"""
Wood author: thislight
Copyright 2016 thislight
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.000002 | @@ -1472,16 +1472,43 @@
t(**info
+,handler_name=self.__name__
)%0A %0A
|
3ca66d7fe4c325ee6b607522b0fb544e1bdc78ec | Update pybind11_bazel from 26973c0ff320cb4b39e45bc3e4297b82bc3a6c09 to 72cbbf1fbc830e487e3012862b7b720001b70672. | third_party/pybind11_abseil/workspace.bzl | third_party/pybind11_abseil/workspace.bzl | """Provides the repo macro to import pybind11_abseil.
pybind11_abseil requires pybind11 (which is loaded in another rule) and pybind11_bazel.
See https://github.com/pybind/pybind11_abseil#installation.
"""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports pybind11_abseil.... | Python | 0.000002 | @@ -892,131 +892,131 @@
= %22
-72cbbf1fbc830e487e3012862b7b720001b70672%22%0A PB_SHA256 = %22516c1b3a10d87740d2b7de6f121f8e19dde2c372ecbfe59aef44cd1872c10
+26973c0ff320cb4b39e45bc3e4297b82bc3a6c09%22%0A PB_SHA256 = %228f546c03bdd55d0e88cb491ddfbabe5aeb087f87de2fbf441391d70483affe
39
-5
%22%0A
@@ -1256,48 +1... |
c9c4ac9cad24b691edd6848595edc85c608873fe | Patch mockito params matcher | pyshould/__init__.py | pyshould/__init__.py | """
pyshould - a should style wrapper for pyhamcrest
"""
from pyshould.dsl import *
__author__ = "Ivan -DrSlump- Montes"
__email__ = "drslump@pollinimini.net"
__license__ = "MIT"
# Override the list public symbols for a wildcard import
__all__ = [
'should',
'should_not',
'should_any',
'should_all',... | Python | 0 | @@ -409,8 +409,563 @@
_of',%0A%5D%0A
+%0A%0A# Patch mockito param matcher to use pyshould expectations%0Atry:%0A import mockito%0A from pyshould.expectation import Expectation%0A%0A original_method = mockito.invocation.MatchingInvocation.compare%0A%0A @staticmethod%0A def pyshould_compare(p1, p2):%0A ... |
5b0421a10497f89ab62e9c0f75e760be38eb5d27 | remove plot_curve in v2.__init__ to avoid importing matplotlib when test | python/paddle/v2/__init__.py | python/paddle/v2/__init__.py | # Copyright (c) 2016 PaddlePaddle 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 applic... | Python | 0.000005 | @@ -923,26 +923,8 @@
atch
-%0Aimport plot_curve
%0A%0A__
@@ -1126,22 +1126,8 @@
fer'
-, 'plot_curve'
%0A%5D%0A%0A
|
cc3dbf8fbb95c258caa8add27556f002e770e877 | fix for issue #22 wherein the stream stops sending new messages | gvas/actors/manager.py | gvas/actors/manager.py | # gvas.actors.manager
# Service for generalized actors, performs load balancing and maintains stage.
#
# Author: Benjamin Bengfort <bengfort@cs.umd.edu>
# Created: Wed Dec 09 22:10:28 2015 -0500
#
# Copyright (C) 2015 University of Maryland
# For license information, see LICENSE.txt
#
# ID: manager.py [] benjamin@be... | Python | 0 | @@ -2471,32 +2471,56 @@
ter%0A %22%22%22%0A
+ while True:%0A
# Phase
@@ -2559,32 +2559,36 @@
y actor%0A
+
+
for actor in sel
@@ -2633,32 +2633,36 @@
y):%0A
+
yield actor%0A%0A
@@ -2666,16 +2666,20 @@
+
+
# Otherw
@@ -2711,32 +2711,36 @@
n a... |
b8b4ffee30ca562f3748f885a53fd52dad247eea | Add env variable to configure logging level | hadoop_galaxy/utils.py | hadoop_galaxy/utils.py | # BEGIN_COPYRIGHT
#
# Copyright (C) 2014 CRS4.
#
# This file is part of hadoop-galaxy, released under the terms of the BSD
# 3-Clause License <http://opensource.org/licenses/BSD-3-Clause>.
#
# END_COPYRIGHT
import logging
import os
import subprocess
import sys
import urlparse
import pydoop
import pydoop.hdfs as phdfs... | Python | 0.000006 | @@ -315,16 +315,57 @@
phdfs%0A%0A
+EnvLogLevel = 'HADOOP_GALAXY_LOG_LEVEL'%0A%0A
def conf
@@ -405,91 +405,264 @@
if
-not log_level:%0A level=logging.INFO%0A elif isinstance(log_level, basestring
+isinstance(log_level, basestring):%0A level = getattr(logging, log_level.upper())%0A elif log_leve... |
be16b0064e35756087518325a00cb94bbce2cf14 | Update sensor.py | hcsr04sensor/sensor.py | hcsr04sensor/sensor.py | ''' Module for measuring distance or depth with an HCSRO4 Ultrasonic sound
sensor and a Raspberry Pi. Imperial and Metric measurements are available'''
# Al Audet
# MIT License
import time
import math
import RPi.GPIO as GPIO
class Measurement(object):
'''Create a measurement using a HC-SR04 Ultrasonic Sensor ... | Python | 0 | @@ -1993,22 +1993,147 @@
-GPIO.cleanup()
+# Only cleanup the pins used to prevent clobbering any others in use by the program%0A GPIO.cleanup(self.trig_pin, self.echo_pin)
%0A
|
261a1cccb13dafe3cb5ad151304acb4473e5514a | load find_compiler at options-time | hep-waftools-system.py | hep-waftools-system.py | # -*- python -*-
### imports -------------------------------------------------------------------
# stdlib imports ---
import os
import os.path as osp
import platform
import sys
# waf imports ---
from waflib.Configure import conf
import waflib.Context
import waflib.Logs as msg
import waflib.Utils
_heptooldir = osp.di... | Python | 0.000001 | @@ -739,16 +739,78 @@
ooldir)%0A
+ ctx.load('find_compiler', tooldir=_heptooldir)%0A
retu
|
4a878bc4cca45e3258a70dcd5e43d28d9eef9d96 | Implement slots for refreshed and edit_patch | quilt/cli/refresh.py | quilt/cli/refresh.py | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as publi... | Python | 0 | @@ -976,16 +976,65 @@
Refresh
+%0Afrom quilt.utils import SubprocessError, Process
%0A%0Aclass
@@ -1272,118 +1272,879 @@
-patch_name = None%0A if len(args) %3E 0:%0A patch_name = args%5B0%5D%0A%0A refresh.refresh(patch_name
+refresh.refreshed.connect(self.refreshed)%0A%0A if op... |
ed680f19822a3eef78793b05cc3581e913ff502f | fix typo | rasa/cli/scaffold.py | rasa/cli/scaffold.py | import argparse
import os
from typing import List, Text
import rasa.train
from rasa.cli.shell import shell
from rasa.cli.utils import create_output_path, print_success
from rasa.constants import DEFAULT_CONFIG_PATH, DEFAULT_DATA_PATH, DEFAULT_DOMAIN_PATH
# noinspection PyProtectedMember
def add_subparser(
subpar... | Python | 0.999991 | @@ -654,17 +654,18 @@
pts and
-o
+su
ppress w
|
5c301dc0313e477bece1b4b33b24aba3a33ff13e | Use fancy django crypto | readthedocs/donate/models.py | readthedocs/donate/models.py | import random
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.conf import settings
from redis import Redis
from readthedocs.donate.utils import get_ad_day
DISPLAY_CHOICES = (
('doc', 'Documentation Pages'),
('site... | Python | 0.000002 | @@ -1,19 +1,4 @@
-import random%0A%0A
from
@@ -21,16 +21,66 @@
t models
+%0Afrom django.utils.crypto import get_random_string
%0Afrom dj
@@ -2415,34 +2415,26 @@
h':
+get_
random
-.randint(0, 10000000
+_string(
)%7D%0A
|
6a18205d2ea8f97a9c8509e87e679ce98fdca00e | Update to version 0.7.5 | homeassistant/const.py | homeassistant/const.py | # coding: utf-8
""" Constants used by Home Assistant components. """
__version__ = "0.7.5.dev0"
# Can be used to specify a catch all when registering state or event listeners.
MATCH_ALL = '*'
# If no name is specified
DEVICE_DEFAULT_NAME = "Unnamed Device"
# #### CONFIG ####
CONF_LATITUDE = "latitude"
CONF_LONGITUD... | Python | 0 | @@ -87,13 +87,8 @@
.7.5
-.dev0
%22%0A%0A#
|
33bdd294a5dfc6aacae82581f8acd6aedfd37dab | Add documentation for PythonAction classes | hoomd/python_action.py | hoomd/python_action.py | from hoomd.operation import _TriggeredOperation
from hoomd.parameterdicts import ParameterDict
from hoomd.custom_action import _CustomAction
from hoomd.typeconverter import OnlyType
from hoomd.trigger import Trigger
from hoomd.util import trigger_preprocessing
from hoomd.logger import LoggerQuantity
from hoomd import _... | Python | 0 | @@ -359,24 +359,363 @@
Operation):%0A
+ %22%22%22Wrapper for user created %60%60Action%60%60s.%0A%0A A basic wrapper that allows for Python object inherenting from%0A :py:class:%60hoomd.custom_action.CustomAction%60 to be attached to a simulation.%0A To see how to implement a custom Python %60%60Action%60%... |
c6a36d2fab93d2d1995f153c54d75626fbd81d9b | split `serve_ui` into reusable helper functions | hoover/search/views.py | hoover/search/views.py | import json
from time import time
from urllib.parse import quote
import mimetypes
from pathlib import Path
from django.shortcuts import render, get_object_or_404
from django.http import (HttpResponse, HttpResponseRedirect, Http404,
FileResponse, JsonResponse)
from django.views.decorators.csrf import csrf_exempt
fro... | Python | 0.998198 | @@ -3533,26 +3533,25 @@
def
-serve_ui(request,
+_resolve_ui_file(
file
@@ -3627,25 +3627,24 @@
/ filename%0A
-%0A
if not (
@@ -3778,20 +3778,16 @@
%0A if
-not
file.is_
@@ -3807,78 +3807,67 @@
r
-aise Http404()%0A%0A return FileResponse(%0A file.open('rb'),%0A
+eturn file%0A%0A rai... |
77c7dca98807a4d483e80ad4af11b2d75fcc2fb9 | use the maximum action | rlvision/exps/ddpg_16_exp.py | rlvision/exps/ddpg_16_exp.py | """DDPG on 16x16 grid.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
import keras.backend as K
import rlvision
from rlvision import grid
from rlvision.ddpg import ActorNet, CriticNet, ReplayBuffer
# import matplotlib.py... | Python | 0.000006 | @@ -2094,16 +2094,88 @@
action =
+ np.argmax(a_t%5B0%5D)%0A # print (action)%0A # action =
np.rand
@@ -2211,16 +2211,46 @@
rob)%5B0%5D%0A
+ # print (action)%0A
|
29ce4983ef47c1d47b7208f6f625df9ade8a5f2e | Simplify map. | ieeg/mprov_listener.py | ieeg/mprov_listener.py | '''
Copyright 2019 Trustees of the University of Pennsylvania
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 ... | Python | 0.000002 | @@ -2427,20 +2427,21 @@
-info
+token
= self.
@@ -2495,12 +2495,13 @@
not
-info
+token
:%0A
@@ -2623,79 +2623,13 @@
%5D =
-%7B%0A 'token': token,%0A 'name': dataset_name%7D
+token
%0A%0A
@@ -6672,17 +6672,8 @@
_id%5D
-%5B'token'%5D
%0A%0A
|
ec94c78a2b2c3548e0222de17dfd492486df197d | Add call feature for testing | salt/modules/napalm_proxy.py | salt/modules/napalm_proxy.py | # -*- coding: utf-8 -*-
'''
NAPALM helpers
==============
Helpers for the NAPALM modules.
.. versionadded:: Nitrogen
'''
from __future__ import absolute_import
# Import python stdlib
import logging
log = logging.getLogger(__file__)
# import NAPALM utils
import salt.utils.napalm
from salt.utils.napalm import proxy_... | Python | 0 | @@ -4191,28 +4191,894 @@
ere:%0A return default_ret%0A
+%0A%0A@proxy_napalm_wrap%0Adef call(method, *args, **kwargs):%0A '''%0A Execute arbitrary methods from the NAPALM library.%0A To see the expected output, please consult the NAPALM documentation.%0A%0A .. note::%0A%0A This feature is not reco... |
6b5dd8c23bd3b9c17ce672b67da3c36e7d63981a | fix issue #61 (#2) | sandstone_spawner/spawner.py | sandstone_spawner/spawner.py | from jupyterhub.spawner import LocalProcessSpawner
from jupyterhub.utils import random_port
from subprocess import Popen
from tornado import gen
import pipes
import shutil
import os
# This is the path to the sandstone-jupyterhub script
APP_PATH = os.environ.get('SANDSTONE_APP_PATH')
SANDSTONE_SETTINGS = os.environ.... | Python | 0 | @@ -1821,8 +1821,275 @@
f.port)%0A
+%0A @gen.coroutine%0A def _signal(self, sig):%0A try:%0A os.killpg(os.getpgid(self.pid), sig)%0A except OSError as e:%0A if e.errno == errno.ESRCH:%0A return False%0A else:%0A raise%0A return T... |
fb88c29cf3789fe707f4276799d08690a16c8489 | Add compressed repodata.json.bz2 and use subdir instead of platform | sudoku.py | sudoku.py | import sys
from platform import machine
import os
import datetime
import json
# Taken from conda.config
_sys_map = {'linux2': 'linux', 'linux': 'linux',
'darwin': 'osx', 'win32': 'win'}
non_x86_linux_machines = {'armv6l', 'armv7l', 'ppc64le'}
platform = _sys_map.get(sys.platform, 'unknown')
bits = 8 * tup... | Python | 0 | @@ -71,16 +71,26 @@
rt json%0A
+import bz2
%0A%0A# Take
@@ -3909,24 +3909,22 @@
h.isdir(
-platform
+subdir
):%0A
@@ -3938,24 +3938,22 @@
akedirs(
-platform
+subdir
)%0A wi
@@ -3973,24 +3973,22 @@
th.join(
-platform
+subdir
, %22repod
@@ -4078,16 +4078,23 @@
%0A
+ data =
json.du
@@ -4099,14 +40... |
6f3769960ca7ddc6456a86ae94b21965e7443f36 | Rename number of processes argument. | survey.py | survey.py | #!/usr/bin/env python3
# surveyor
#
# Copyright 2016 ghostwords.
#
# 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/.
import argparse
import csv
import re
from datetime ... | Python | 0 | @@ -4079,23 +4079,24 @@
st='num_
-crawler
+processe
s', type
@@ -4116,32 +4116,31 @@
=20,
- help=(%0A %22how
+%0A help=%22use this
man
@@ -4155,15 +4155,8 @@
ses
-to use
in p
@@ -4179,33 +4179,32 @@
: %25(default)s)%22)
-)
%0A%0A parser.add
@@ -5631,23 +5631,24 @@
rgs.num_
-crawler
+pro... |
89b64ae2c83a0af7d103d1117efa89242dd669da | add rgb2ycc, ycc2rgb | src/image.py | src/image.py | #
# image.py
# Created by pira on 2017/07/28.
#
#coding: utf-8
import numpy as np
import cv2
def readImage(filename):
#imreadのflags flags>0(cv2.IMREAD_COLOR):3ChannelColors,flags=0(cv2.IMREAD_GRAYSCALE):GrayScale,flags<0(cv2.IMREAD_UNCHANGED):Original
#白黒画像でも強制的にRGBで扱う.
img = cv2.imread(filename, 1)
print('Read ... | Python | 0.000009 | @@ -527,8 +527,1126 @@
indows()
+%0A%0A%09def rgb2ycc(img):%0A%09u%22%22%22RGB to YCbCr.%0A%09@param img :3 dimension np.ndarray%5BHeight%5D%5BWidth%5D%5BRGB%5D%0A%09@return ycc_data:3 dimension np.ndarray%5BHeight%5D%5BWidth%5D%5BYCC%5D%0A%09%22%22%22%0A%09height = img.shape%5B0%5D%0A%09width = img.shape%5B1%5D... |
04b2358a7472c0db9886dd63b09732eaa4f22d16 | order correctly | target.py | target.py | import sys, os, time
from sqpyte.interpreter import Sqlite3DB, Sqlite3Query, SQPyteException
from rpython.rlib import jit
from sqpyte.capi import CConfig
from rpython.rtyper.lltypesystem import rffi
# testdb = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sqpyte/test/test.db")
testdb = os.path.join(os.path... | Python | 0.999717 | @@ -539,16 +539,28 @@
greens=%5B
+'printRes',
'query',
@@ -574,20 +574,8 @@
Res'
-, 'printRes'
%5D, %0A
|
38a9f75bc87dbfb698b852145b7d62e9913602b4 | Stop trying to be overly clever | tcldis.py | tcldis.py | from __future__ import print_function
def _tcldis_init():
import sys
import _tcldis
mod = sys.modules[__name__]
for key, value in _tcldis.__dict__.iteritems():
if not callable(value):
continue
mod.__dict__[key] = value
_tcldis_init()
| Python | 0.000004 | @@ -36,19 +36,22 @@
on%0A%0A
-def
+import
_tcldis
_ini
@@ -50,234 +50,85 @@
ldis
-_init():%0A import sys%0A import _tcldis%0A mod = sys.modules%5B__name__%5D%0A for key, value in _tcldis.__dict__.iteritems():%0A if not callable(value):%0A continue%0A mod.__dict__%5Bkey%5D = val... |
b2e98468337e98d7565f1a099802c84941341b78 | version in py2by | src/py2by.py | src/py2by.py | #! /usr/bin/python3
import os
import re
import argparse
import sys
def parse_indent_style_input(indentinput):
if not indentinput:
return " "
elif indentinput[0] == "1s":
return " "
elif indentinput[0] == "2s":
return " "
elif indentinput[0] == "4s":
return " "... | Python | 0.000001 | @@ -2339,16 +2339,123 @@
matter)%0A
+ argparser.add_argument(%22-v%22, %22--version%22, action=%22version%22, version=%22Bython v0.3%5CnMathias Lohne 2017%22)%0A
argp
|
63eba95bccaaecc497fecc9fb60766dc11c37c47 | update setup.py for upload to pypi | src/setup.py | src/setup.py | import setuptools
setuptools.setup(
name="nycdb",
version="0.1.0",
url="https://github.com/aepyornis/nyc-db",
author="ziggy",
author_email="ziggy@elephant-bird.net",
description="nyc housing database",
long_description=open('README.md').read(),
packages=setuptools.find_packages(exclu... | Python | 0 | @@ -159,32 +159,45 @@
il=%22
-ziggy@elephant-bird.net%22
+nycdb@riseup.net%22,%0A%0A license='GPL'
,%0A%0A
@@ -212,16 +212,28 @@
iption=%22
+database of
nyc hous
@@ -240,20 +240,16 @@
ing data
-base
%22,%0A l
@@ -308,100 +308,218 @@
ges=
-setuptools.find_packages(exclude=('tests', 'docs', 'data', 'venv')... |
8e975adac87c3cbeefaf3f892debd2621b95b571 | Add requests as dependency of wirecloud | src/setup.py | src/setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2013 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 Softwar... | Python | 0 | @@ -2199,16 +2199,28 @@
%3E=3.2.0'
+, 'requests'
),%0A t
|
9f1012d25dd21892ef9785632472154eed4a997a | allow scratch views to be targeted (scope, etc) | syntaxmgr.py | syntaxmgr.py | import sublime
import sublime_plugin
import re
class Sobj():
def __init__(self, S):
self.S = S
def apply(self, view):
settings = self.S["settings"] if "settings" in self.S else []
for key, value in settings.items():
view.settings().set(key, value)
def check_scopes(sel... | Python | 0 | @@ -1642,29 +1642,8 @@
if
-view.is_scratch() or
view
@@ -1933,16 +1933,199 @@
load%22)%0A%0A
+ def on_new(self, view):%0A # need a small delay here to give he view a chance to prepare%0A # itself%0A sublime.set_timeout(lambda: self.load_syntax_mgr(view), 0)%0A%0A
def
|
4294c286afda9126aed5497e2a1048fc9bbbb491 | Update test.py | test/test.py | test/test.py | # -*- coding: utf-8 -*-
"""
Testing script for travis
"""
from __future__ import division, absolute_import, print_function
import pytest
def tests():
# Check if all modules can be imported
import e13tools as e13
import e13tools.pyplot as e13plt
import e13tools.sampling as e13spl
if(__name__ == '__m... | Python | 0.000001 | @@ -294,16 +294,33 @@
e13spl%0A%0A
+ assert True%0A%0A
if(__nam
|
a8ae0398b4b24b051e01caf5b0323a26d38baa49 | add one example | test/test.py | test/test.py | #encoding=utf-8
import sys
sys.path.append("../")
import jieba
def cuttest(test_sent):
result = jieba.cut(test_sent)
for word in result:
print word, "/",
print ""
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙悟空,我爱北京,我爱Python和C++。")
cuttest("我不喜欢日本和服。")
cuttest("雷猴回归人间。")
cuttest("工信处女干事每月经过下属科室都要亲口... | Python | 0.008978 | @@ -2287,8 +2287,42 @@
%E5%9C%B0%E9%93%81%E5%92%8C%E5%B9%B3%E9%97%A8%E7%AB%99')
+%0A%09cuttest('%E5%BC%A0%E6%99%93%E6%A2%85%E5%8E%BB%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2%E5%81%9A%E4%BA%86%E4%B8%AAB%E8%B6%85%E7%84%B6%E5%90%8E%E5%8E%BB%E4%B9%B0%E4%BA%86%E4%BB%B6T%E6%81%A4')
|
badbd3dacf2204a6bd89335626c33aec471b439e | Change test to match.. must get those working locally! | test_load.py | test_load.py | from unittest import TestCase, main
from mock import Mock, patch
from datetime import date
import json
import os
from load import latest_status, is_newer_than, notify_by_text, get_history_from_spot
class TestLoad(TestCase):
@patch('load.get_history_from_s3')
def test_latest_status(self, get_history_from_s3... | Python | 0 | @@ -1106,17 +1106,17 @@
%5B'alerts
-.
+_
numbers'
|
fc0f739b63267dd0e66dc5e161a4ee65c711fd7d | Update test_main.py with refactoring. | test_main.py | test_main.py | #!/usr/bin/env python
""" This module contains some tests of code functionality. """
import logging
import os
import time
import cv2
import torch
from src import dp_controller, keylog, mk_downsampler, key2pad, helper, dataset_merger
from src.agents import state_model, mk_naive_agent, mk_nn
from src.agents.mk_nn_tra... | Python | 0 | @@ -351,16 +351,21 @@
.mk_rnn_
+lstm_
train im
|
0c8739457150e4ae6e47ffb42d43a560f607a141 | Add test re: hide kwarg | tests/run.py | tests/run.py | from spec import eq_, skip, Spec, raises, ok_
from invoke.run import run
from invoke.exceptions import Failure
class Run(Spec):
"""run()"""
def return_code_in_result(self):
r = run("echo 'foo'")
eq_(r.stdout, "foo\n")
eq_(r.return_code, 0)
eq_(r.exited, 0)
def nonzero_ret... | Python | 0 | @@ -38,16 +38,22 @@
ses, ok_
+, trap
%0A%0Afrom i
@@ -774,16 +774,27 @@
arn=True
+, hide=True
))%0A%0A
@@ -882,20 +882,154 @@
rn=True).exited, 1)%0A
+%0A @trap%0A def hide_kwarg_allows_hiding_output(self):%0A run(%22echo 'foo'%22, hide=True)%0A eq_(sys.stdall.getvalue(), %22%22)%0A
|
133c48e759a30135c4cd5fdf92b75a83f58205c9 | Update at 2017-07-22 21-38-49 | train_vgg.py | train_vgg.py | import json
from pathlib import Path
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
set_session(tf.Session(config=config))
from keras.models import Sequential, Model
from keras.pr... | Python | 0 | @@ -637,27 +637,8 @@
e(16
-, activation='relu'
)(x)
|
6b94d3622759a4851886e0a917551f3e6bb62fdb | Set log level to CRITICAL when not in verbose mode. Reason: We catch the important errors anyway. | twtxt/log.py | twtxt/log.py | """
twtxt.log
~~~~~~~~~
This module configures the logging module for twtxt.
:copyright: (c) 2016 by buckket.
:license: MIT, see LICENSE for more details.
"""
import logging
def init_logging(debug=False):
logger = logging.getLogger()
formatter = logging.Formatter("%(asctime)s %(name)-1... | Python | 0 | @@ -502,28 +502,80 @@
ger.setLevel(logging.DEBUG)%0A
+ else:%0A logger.setLevel(logging.CRITICAL)%0A
|
17630883d215b96026d8c1713240447032c510ce | fix another model error | drip/admin.py | drip/admin.py | import base64
import json
from django import forms
from django.contrib import admin
try:
from django.conf import settings
User = settings.AUTH_USER_MODEL
except AttributeError:
from django.contrib.auth.models import User
from drip.models import Drip, SentDrip, QuerySetRule
from drip.drips import configur... | Python | 0.000006 | @@ -1688,24 +1688,189 @@
id=drip_id)%0A
+%0A if isinstance(User, six.string_types):%0A app_label, model_name = User.split('.')%0A UserModel = models.get_model(app_label, model_name)%0A%0A
user
@@ -1894,16 +1894,21 @@
404(User
+Model
, id=use
|
ba02f5c306ee01f45ac3cb7ec4d0b2ad7589bee4 | use story class for google analytics integration tests | botstory/integrations/ga/tracker_test.py | botstory/integrations/ga/tracker_test.py | import aiohttp
import asyncio
import json
import pytest
from unittest import mock
from . import GAStatistics, tracker
from .. import fb, ga, mockdb, mockhttp
from ... import di, story, story_test, utils
from ..ga import tracker_test
def setup_function():
story.clear()
def teardown_function(function):
story... | Python | 0 | @@ -176,104 +176,34 @@
di,
-s
+S
tory,
-story_test, utils%0Afrom ..ga import tracker_test%0A%0A%0Adef setup_function():%0A story.clear()
+utils%0A%0Astory = None
%0A%0A%0Ad
@@ -234,24 +234,34 @@
ction):%0A
+story and
story.clear(
@@ -2012,24 +2012,62 @@
cker_mock):%0A
+ global story%0A story = Sto... |
cd8815c7d82d7c8b3e0c66622ab99762e54ae330 | Change models to allow for blank URLs | projects/models.py | projects/models.py | from django.db import models
class Project(models.Model):
'''
A open source/development project to be displayed on the Projects page
'''
PUBLIC = 'pub'
HIDDEN = 'hid'
PROJECT_STATUS = (
(PUBLIC, 'Public'),
(HIDDEN, 'Hidden'),
)
name = models.CharField(max_length=150)
... | Python | 0 | @@ -22,16 +22,61 @@
models%0A
+from django.core.urlresolvers import reverse%0A
%0A%0Aclass
@@ -532,24 +532,34 @@
ls.URLField(
+blank=True
)%0A gitlab
@@ -573,24 +573,34 @@
ls.URLField(
+blank=True
)%0A websit
@@ -615,24 +615,34 @@
ls.URLField(
+blank=True
)%0A slug =
@@ -655,28 +655,169 @@
s.SlugFie... |
c32b64c3d391f525e65bb43e6e24d6f3ea486e6e | Update urls.py | el/el/urls.py | el/el/urls.py | from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^$', 'el.views.home', ),
url(r'^link1$', 'el.views.link1', ),
url(r'^link2$', 'el.views.link2', ),
url(r'^link3$', 'el.views.link3', ),
url(r'^link4$', 'el.views.link4', ),
url(r'^home$', 'el.views.link5', ),
... | Python | 0 | @@ -201,21 +201,21 @@
url(r'%5E
-link3
+tokyo
$', 'el.
@@ -224,13 +224,13 @@
ews.
-link3
+tokyo
', )
|
0db41b3a4b2578a2ee738f5b619dd1dd09caea4a | Update runinterpret.py | bin/runinterpret.py | bin/runinterpret.py | #!usr/bin/python
import os
import numpy as np
import common
from interpret import qcfile, funcfile, analyzefiles
def runAll(args):
print('\n\n\nYou have requested to analyze CNV call data')
print('\tWARNING:')
print('\t\tIF USING ANY REFERENCES OTHER THAN THOSE I PROVIDE I CANNOT GUARANTEE RESULT ACCURACY... | Python | 0.000001 | @@ -2294,18 +2294,8 @@
t')%0A
-%09%09print x%0A
%09%09if
@@ -2484,147 +2484,33 @@
%0A%09%0A%09
-print analysisSamples%0A%09print ploidyDict%0A%09print genderDict%0A%09%0A%09%0A%09#FUnC: CNV filtering#%0A%09#sample, species, segmentDir, CNVdir, ploidy, gender%0A
+%0A%09%0A%09#FUnC: CNV filtering#
%0A%09fu
|
d58c644fde9009a0a0f2c84bd888dec2850a7db1 | Fix minor bug with signal checking exporters | promgen/signals.py | promgen/signals.py | import logging
from functools import wraps
from django.core.cache import cache
from django.db.models.signals import post_delete, post_save
from django.dispatch import Signal, receiver
from promgen import models, prometheus
logger = logging.getLogger(__name__)
write_config = Signal()
write_rules = Signal()
def mul... | Python | 0 | @@ -3210,32 +3210,41 @@
ect.exporter_set
+.exists()
:%0A wr
|
3d2890ce8a1e89b27f4a046c61a98bb51ad20323 | reset displays on startup | mpf/devices/segment_display.py | mpf/devices/segment_display.py | """Physical segment displays."""
from collections import namedtuple
from operator import attrgetter
from typing import List, TYPE_CHECKING
from mpf.core.placeholder_manager import TextTemplate
from mpf.core.system_wide_device import SystemWideDevice
TextStack = namedtuple("TextStack", ["text", "priority", "key"])
c... | Python | 0.000001 | @@ -1151,16 +1151,69 @@
umber'%5D)
+%0A # reset content%0A self._update_stack()
%0A%0A de
|
d3505ba895aa81daec77113faec21aab5be990f7 | Fix documentation of virStream recv | python/libvirt-override-virStream.py | python/libvirt-override-virStream.py | def __del__(self):
try:
if self.cb:
libvirtmod.virStreamEventRemoveCallback(self._o)
except AttributeError:
pass
if self._o != None:
libvirtmod.virStreamFree(self._o)
self._o = None
def _dispatchStreamEventCallback(self, events... | Python | 0 | @@ -3050,37 +3050,37 @@
es):%0A %22%22%22
-Write
+Reads
a series of byt
@@ -3074,34 +3074,36 @@
series of bytes
-to
+from
the stream. Thi
|
7fe3776a59de7a133c5e396cb43d9b4bcc476f7d | Fix the check if form is submitted | protocols/views.py | protocols/views.py | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render
from members.models import User
from .models import Protocol, Topic
from .forms import ProtocolForm, TopicForm, InstitutionForm
@login_required
def add(request):
data = request.POST ... | Python | 0.000663 | @@ -323,16 +323,21 @@
request
+.POST
else No
@@ -374,44 +374,8 @@
a)%0A%0A
- #import ipdb; ipdb.set_trace()%0A%0A
|
61c94ed7464f7db3bb7fc4d43b23f5842106f97d | version control via __init__, setup will look it up | rejson/__init__.py | rejson/__init__.py | """
rejson-py is a package that allows storing, updating and querying objects as
JSON documents in a [Redis](https://redis.io) database that is extended with the
[ReJSON module](https://github.com/redislabsmodules/rejson). The package extends
[redis-py](https://github.com/andymccurdy/redis-py)'s interface with ReJSON's... | Python | 0.000001 | @@ -3095,16 +3095,37 @@
%60%60%60%0A%22%22%22%0A
+__version__ = %220.1.0%22
%0Afrom .c
|
f53026455803bcd2171531faa48cc5a6bbdfcdd7 | Add note to tokenstorage about Windows permissions (#532) | src/globus_sdk/tokenstorage/base.py | src/globus_sdk/tokenstorage/base.py | import abc
import contextlib
import os
from typing import Any, Dict, Iterator, Optional
from globus_sdk.services.auth import OAuthTokenResponse
class StorageAdapter(metaclass=abc.ABCMeta):
@abc.abstractmethod
def store(self, token_response: OAuthTokenResponse) -> None:
"""
Store an `OAuthToke... | Python | 0 | @@ -1536,17 +1536,17 @@
-a
+A
context
@@ -1605,17 +1605,17 @@
-t
+T
his does
@@ -1757,16 +1757,271 @@
systems
+.%0A%0A .. note::%0A%0A On Windows, this has no effect. To control the permissions on files used for%0A token storage, use %60%60%25LOCALAPPDATA%25%60%60 o... |
d683f56c50587d346fa6891c20d6f68f37e2c9da | update imports | qmpy/web/views/materials/__init__.py | qmpy/web/views/materials/__init__.py | from entry import *
from structure import *
from composition import *
from discovery import *
from chem_pots import *
from deposit import *
def common_materials_view(request):
return render_to_response('materials/index.html', {})
| Python | 0 | @@ -107,24 +107,53 @@
ts import *%0A
+from element_groups import *%0A
from deposit
|
fd76177b0fa4e4ccc34179a95534755065bdb7fb | Revert "Less contention?" | idiotic/cluster.py | idiotic/cluster.py | from idiotic import config
from idiotic import block
import idiotic
import pysyncobj
import logging
import asyncio
import aiohttp
from aiohttp import web
from threading import RLock
import functools
import json
log = logging.Logger('idiotic.cluster')
class UnassignableBlock(Exception):
pass
class Cluster(pysyn... | Python | 0 | @@ -332,110 +332,8 @@
j):%0A
- config = None%0A block_owners = None%0A block_lock = None%0A resources = None%0A jobs = None%0A%0A
@@ -374,32 +374,32 @@
config.Config):%0A
+
super(Cl
@@ -626,196 +626,75 @@
)%0A
-%0A if self.config is None:%0A self.config = configurati... |
0f48f1e9570fb194a19f0d8faf8c23c879a61d8b | remove any associated .pyc file before loading a module from path; this may fix the config load problem in sasview | sasmodels/custom/__init__.py | sasmodels/custom/__init__.py | """
Custom Models
-------------
This is a place holder for the custom models namespace. When models are
loaded from a file by :func:`generate.load_kernel_module` they are loaded
as if they exist in *sasmodels.custom*. This package needs to exist for this
to occur without error.
"""
from __future__ import division, p... | Python | 0 | @@ -1069,130 +1069,252 @@
-module = imp.load_source(fullname, os.path.expanduser(path))%0A #os.unlink(path+%22c%22) # remove the automatic pyc file
+if path.endswith(%22.py%22) and os.path.exists(path) and os.path.exists(path+%22c%22):%0A # remove automatic pyc file before loading a py file%0A ... |
06a8550bfe472d168eabb30e8db563771766a55a | Update default RVO image | akvo/scripts/rvo/__init__.py | akvo/scripts/rvo/__init__.py | # -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from rest_framework.status import HTTP_... | Python | 0 | @@ -1102,89 +1102,105 @@
p://
-rsr.akvo.org/media/db/project/2898/Project_2898_current_image_2015-03-20_17.46.44
+www.rvo.nl/sites/default/files/styles/agnl_subject_thumbnail/public/2013/08/internationaal-search
.jpg
|
5650da77118b3c423c0ae72d1f1ba72ac3d3c1a8 | Fix duplicate tag pages in the sitemap | fluent_blogs/sitemaps.py | fluent_blogs/sitemaps.py | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.contrib.sitemaps import Sitemap
from fluent_blogs.models import get_entry_model, get_category_model
from fluent_blogs.urlresolvers import blog_reverse
from parler.models... | Python | 0.000082 | @@ -2875,127 +2875,42 @@
# U
-ntil https://github.com/alex/django-taggit/pull/86 is merged,%0A # better use the field names directly instead of
+se the same filters as TaggedItem.
bulk
@@ -2923,16 +2923,18 @@
p_kwargs
+()
%0A
@@ -3133,16 +3133,44 @@
)
+.order_by('slug').distinct()
%0A%0A ... |
96167530d37f5aab6ae91cc8ff4583a86740e3f4 | Update locustfile.py | locust_test/locustfile.py | locust_test/locustfile.py | """Generic locustfile used to load testing Zengenti sites."""
from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
@task(2)
def index(self):
self.client.get("/")
@task(1)
def where(self):
self.client.get("/location")
@task(1)
def what(self):
self.... | Python | 0.000001 | @@ -40,17 +40,8 @@
ing
-Zengenti
site
|
7c3d6d1d3d621cc9fd9ef8ba9e29da996c4fd675 | Rename the filename parameter to edit and document it | summoner.py | summoner.py | import subprocess
import sys
import os
home_dir = os.environ["HOME"]
SUMMONER_PATH = home_dir + "/.summoner"
REPO_PATH = home_dir + "/.summoner/summoner_repo"
# Public - creates the summoner repo
#
# has_hub - whether or not the user has the hub command
#
# Returns nothing
def create_repo(has_hub):
os.mkdir(SUM... | Python | 0 | @@ -2840,20 +2840,124 @@
e)%0A%0A
-def edit(fil
+# Public - edits a template%0A#%0A# templatename - the name of the template to edit%0A#%0A# Returns nothing%0Adef edit(templat
enam
|
7592ca157c74a8ee66cb0ce68956f473469ffc10 | Add areyoumyfriend | erasmus/cogs/misc.py | erasmus/cogs/misc.py | from __future__ import annotations
from discord.ext import commands
from ..context import Context
from ..erasmus import Erasmus
class Misc(commands.Cog[Context]):
def __init__(self, bot: Erasmus) -> None:
self.bot = bot
@commands.command(brief='Get the invite link for Erasmus')
@commands.cooldo... | Python | 0.000004 | @@ -582,16 +582,426 @@
)%0A%0A
+ @commands.command(hidden=True)%0A @commands.cooldown(rate=2, per=30.0, type=commands.BucketType.channel)%0A async def areyoumyfriend(self, ctx: Context) -%3E None:%0A if ctx.author.id in %7B547579430164365313, 139178723235594240%7D:%0A await ctx.send(f'N... |
9e9052dbeb2c45ef3fdd8037e14a37b9ecbca565 | Update test dump generator to also generate metadata. | etc/gen-test-dump.py | etc/gen-test-dump.py | #!/usr/bin/env python
import random
WORLDS = [None] * 8 + ['world', 'world_nether', 'creative', 'hardcore']
REGIONS = [None] * 20 + ['Region%d' % i for i in range(10)]
NUM_PLAYERS = 100
NUM_PERMISSIONS_PER_PLAYER = 50
NUM_GROUPS = (3, 13, 23, 31, 41)
NUM_PERMISSIONS_PER_GROUP = 50
NUM_PLAYERS_PER_GROUP = 50
P... | Python | 0 | @@ -348,92 +348,1313 @@
00%0A%0A
-%0Agroups_at_depth = %5B%5D%0Afor i in range(len(NUM_GROUPS)):%0A groups_at_depth.append(%5B%5D
+METADATA_TYPES = %5Bstr, int, float, bool%5D%0A%0ASTR_ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'%0A%0ANUM_METADATA_PER_PLAYER = 10%0A%0ANUM_METADATA_PER... |
9d908b1c59d02d32f1bcf425d6157e330ed0d11c | Fix codepoint-based-lookup (eg. .u 203D) in Python 3 | willie/modules/unicode_info.py | willie/modules/unicode_info.py | #coding: utf8
"""
codepoints.py - Willie Codepoints Module
Copyright 2013, Edward Powell, embolalia.net
Copyright 2008, Sean B. Palmer, inamidst.com
Licensed under the Eiffel Forum License 2.
http://willie.dfbta.net
"""
from __future__ import unicode_literals
import unicodedata
from willie.module import commands, exam... | Python | 0 | @@ -273,16 +273,27 @@
odedata%0A
+import sys%0A
from wil
@@ -342,21 +342,114 @@
IT%0A%0A
-%0A@commands('u
+if sys.version_info.major %3E= 3:%0A unichr = chr%0A%0A%0A@commands('u')%0A@example('.u %E2%80%BD', 'U+203D INTERROBANG (%E2%80%BD)
')%0A@
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.