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 |
|---|---|---|---|---|---|---|---|
7c9a4b72f59d902ab5daa43b7675641a2e81ebb7 | Switch to "templates" terminology for VM images/templates. | xblock_skytap/skytap.py | xblock_skytap/skytap.py | """
"""
# Imports ###########################################################
from __future__ import absolute_import
import skytap as skytap_library
from xblock.core import XBlock
from xblock.fields import Scope, String
from xblock.fragment import Fragment
from xblockutils.resources import ResourceLoader
from xbloc... | Python | 0 | @@ -725,23 +725,23 @@
def get_
-vm_imag
+templat
es():%0A
@@ -773,20 +773,23 @@
('Dummy
-imag
+templat
e A', 'D
@@ -793,20 +793,23 @@
'Dummy
-imag
+templat
e B', 'D
@@ -813,20 +813,23 @@
'Dummy
-imag
+templat
e C')%0A%0A%0A
@@ -1530,26 +1530,16 @@
to pull
-VM images/
template
@@ -1619,23 +1619,23 @@
... |
a76a42b195e3f729b7f3f6ef8389e76a72728c62 | add fluentd-elasticsearch addon | src/seedbox/config_renderer/charts.py | src/seedbox/config_renderer/charts.py | import io
import os
import re
import tarfile
import requests
from jinja2 import Environment
from seedbox import config
NOT_SPECIFIED = object()
jinja_var_env = Environment(autoescape=False)
jinja_env = Environment(keep_trailing_newline=True, autoescape=False)
class Addon:
base_url = 'https://github.com/kuberne... | Python | 0 | @@ -4875,16 +4875,426 @@
%0A %7D,%0A
+ 'fluentd-elasticsearch': %7B%0A '1.6': Addon('fluentd-elasticsearch', '1.6', %5B%0A 'es-controller.yaml',%0A 'es-service.yaml',%0A 'fluentd-es-ds.yaml',%0A 'kibana-controller.yaml',%0A 'kibana-service.yaml',%0A ... |
87d792fda8763f49d83ce274015f3a436a0c89cc | send message after stuff is started | dusty/commands/run.py | dusty/commands/run.py |
from ..compiler import (compose as compose_compiler, nginx as nginx_compiler,
port_spec as port_spec_compiler, spec_assembler)
from ..systems import compose, hosts, nginx, virtualbox
def start_local_env():
""" This command will use the compilers to get compose specs
will pass those spe... | Python | 0 | @@ -968,16 +968,67 @@
compose_config)%0A
+%0A yield %22Your local environment is now started%22%0A
|
7f2ac925b2343e57ad7f4a6d79ee24e14c8f4d78 | Add a Bazel rule assignment_notebook(). | exercises/defs.bzl | exercises/defs.bzl | # TODO(salikh): Implement the automatic tar rules too
def assignment_notebook_macro(
name,
srcs,
language = None,
visibility = ["//visibility:private"]):
"""
Defines a rule for student notebook and autograder
generation from a master notebook.
Arguments:
name:
srcs: the file name of the inp... | Python | 0 | @@ -1048,20 +1048,2308 @@
/assign%22,%0A%09%5D,%0A )%0A
+%0Adef _assignment_notebook_impl(ctx):%0A print(%22src = %22, ctx.attr.src)%0A print(%22src.path = %22, ctx.file.src.path)%0A outs = %5B%5D%0A languages = ctx.attr.languages%0A inputs = %5Bctx.file.src%5D%0A preamble_opt = %22%22%0A if ctx.file.preambl... |
36fde4f2795d95d18a2862ba1d8d343f1ebe3185 | add interfaces_ip filter | library/napalm_get_facts.py | library/napalm_get_facts.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
(c) 2016 Elisa Jasinska <elisa@bigwaveit.org>
This file is part of Ansible
Ansible 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, ... | Python | 0.000001 | @@ -4878,32 +4878,176 @@
aces'%5D = result%0A
+ elif filter == 'interfaces_ip':%0A result = device.get_interfaces_ip()%0A facts%5B'interfaces_ip'%5D = result%0A
elif
|
fd92c0b2964bce5d56b9bf41e84bfde24fec0b78 | raise default post limit to 25q | djangofeeds/managers.py | djangofeeds/managers.py | from datetime import timedelta, datetime
from django.db import models
from django.db.models.query import QuerySet
from django.core.exceptions import MultipleObjectsReturned
from djangofeeds.utils import truncate_field_data
""" .. data:: DEFAULT_POST_LIMIT
The default limit of number of posts to keep in a feed.
... | Python | 0 | @@ -363,16 +363,17 @@
LIMIT =
+2
5%0A%0A%0Adef
|
27e67bf1311512e83978bb82606ef73127efece1 | version number | emcee/__init__.py | emcee/__init__.py | # -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
__version__ = "3.0.0.dev0"
__bibtex__ = """
@article{emcee,
author = {{Foreman-Mackey}, D. and {Hogg}, D.~W. and {Lang}, D. and {Goodman}, J.},
title = {emcee: The MCMC Hammer},
journal = {PASP},
year = 2013,
volume = 125,... | Python | 0.000291 | @@ -96,15 +96,11 @@
%223.0
-.0.dev0
+rc1
%22%0A__
|
f274f927d600989db1d485212d116166695e6edd | Use keyword arguments for readability | scell/core.py | scell/core.py | """
scell.core
~~~~~~~~~~
Provides abstractions over lower level APIs and
file objects and their interests.
"""
from select import select as _select
from collections import namedtuple
def select(rl, wl, timeout=None):
"""
Returns the file objects ready for reading/writing
from the read-... | Python | 0.000001 | @@ -1478,32 +1478,35 @@
le,%0A
+fp=
monitored.fp,%0A
@@ -1507,32 +1507,41 @@
fp,%0A
+callback=
monitored.callba
@@ -1552,24 +1552,30 @@
+ready=
ready,%0A
|
e7cce08f32516bc8b15df7eee0c285eebe795cab | Make it easier to filter on multiple field values | explorer/search.py | explorer/search.py | from . import config
from .document import Document
import requests
from time import time
def perform_search(**params):
response = requests.get(
config.GOVUK_SEARCH_API,
params=params,
auth=config.AUTH,
)
return response.json()
def fetch_documents(scope):
documents = perform_... | Python | 0.000001 | @@ -1384,19 +1384,28 @@
ope:
-all
+exclude_field
_filter
-s
%22%0A
|
82bb3688354334f61cf23a7c380506528d059a0f | Add a configuration variable for the email 'From' field | comments.py | comments.py | #!/usr/bin/env python
"""
CGI script that takes takes a POST to the address ./add_comment (normally from
a comment form) and sends that comment formatted in yaml to the email address
set in COMMENT_EMAIL.
The resulting yaml file is meant to be used with Jekyll::StaticComments. See
https://github.com/mpalmer/jekyll-sta... | Python | 0.99993 | @@ -580,16 +580,51 @@
le.com%22%0A
+FROM_EMAIL = %22noreply@example.com%22%0A
MAX_SIZE
@@ -5421,27 +5421,18 @@
%5D =
-'noreply@emont.org'
+FROM_EMAIL
%0A
|
10d0b7c452c8d9d5893cfe612e0beaa738f61628 | Add to template builtins only if add_to_buitlins is available (Django <= 1.8) | easy_pjax/__init__.py | easy_pjax/__init__.py | #-*- coding: utf-8 -*-
"""
Register filter so it is available for use in the `extends` template tag
(The `extends` tag must come first in a template, so regular `load` is not
an option).
"""
from __future__ import absolute_import, division, print_function, unicode_literals
__version__ = "1.2.0"
try:
from djang... | Python | 0 | @@ -293,16 +293,42 @@
1.2.0%22%0A%0A
+has_add_to_builtins = True
%0Atry:%0A
@@ -393,16 +393,29 @@
tError:%0A
+ try:%0A
# im
@@ -439,24 +439,28 @@
in 1.8%0A
+
+
from django.
@@ -496,17 +496,105 @@
uiltins%0A
-%0A
+ except ImportError:%0A has_add_to_builtins = False%0A%0Aif has_add_... |
5b33794ce7a3c40c4fe1912be78d628ac5673536 | sort WEO issues in chronological order | dlstats/fetchers/IMF.py | dlstats/fetchers/IMF.py | # -*- coding: utf-8 -*-
from dlstats.fetchers._skeleton import Skeleton, Category, Series, Dataset, Provider, CodeDict
from dlstats.fetchers.make_elastic_index import ElasticIndex
import urllib
import xlrd
import csv
import codecs
from datetime import datetime
import pandas
import pprint
from collections import Ordere... | Python | 0.999332 | @@ -2768,22 +2768,90 @@
-return
+# we need to handle the issue in chronological order%0A return(sorted
(output)
%0A
@@ -2846,16 +2846,17 @@
(output)
+)
%0A
|
e145ef6ca54c9615f038601da17daf16550196d6 | Use environment variables to locate Windows GStreamer includes | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "gstreamer-superficial",
"sources": [ "gstreamer.cpp", "GLibHelpers.cpp", "GObjectWrap.cpp", "Pipeline.cpp" ],
"include_dirs": [
"<!(node -e \"require('nan')\")"
],
"cflags": [
"-Wno-cast-function-type"
],
"conditions" : [
["OS=='linux'", {
"in... | Python | 0 | @@ -1183,44 +1183,52 @@
%09%09%09%22
-X:/gstreamer-sdk/1.0/x
+%3C!(echo %25GSTREAMER_1_0_ROOT_X
86_64
-/
+%25)
include
-/
+%5C
gstr
@@ -1248,44 +1248,116 @@
%09%09%09%22
-X:/gstreamer-sdk/1.0/x
+%3C!(echo %25GSTREAMER_1_0_ROOT_X86_64%25)lib%5Cglib-2.0%5Cinclude%22,%0A%09%09%09%09%22%3C!(echo %25GSTREAMER_1_0_ROOT_... |
55dd6cb9dfb72fcbff89b10ccdd0d68c309d9aa9 | Enable RTTI on OS X to fix exception handling (gh issue #106) | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "oracle_bindings",
"sources": [ "src/connection.cpp",
"src/oracle_bindings.cpp",
"src/executeBaton.cpp",
"src/reader.cpp",
"src/statement.cpp",
"src/outParam.cpp" ],
"... | Python | 0 | @@ -422,16 +422,49 @@
PTIONS%22:
+ %22YES%22,%0A%09%09%09%22GCC_ENABLE_CPP_RTTI%22:
%22YES%22%0A
|
043a0ad774964d2608ee1c8bd8ba1abc5b2ed0b4 | Tweak binding.gyp so it doesn't error out on Windows | binding.gyp | binding.gyp | {
'conditions': [
['OS!="win"', {
'targets': [{
'target_name': 'pty',
'include_dirs' : [
'<!(node -e "require(\'nan\')")'
],
'sources': [
'src/unix/pty.cc'
],
'libraries': [
'-lutil',
'-L/usr/lib',
'-L/usr/loca... | Python | 0 | @@ -1,48 +1,6 @@
%7B%0A
- 'conditions': %5B%0A %5B'OS!=%22win%22', %7B%0A
't
@@ -15,20 +15,16 @@
%5B%7B%0A
-
-
'target_
@@ -37,16 +37,58 @@
'pty',%0A
+ 'conditions': %5B%0A %5B'OS!=%22win%22', %7B%0A
@@ -724,13 +724,14 @@
-%7D
%5D%0A
-%5D
+%7D%5D,
%0A%7D%0A
|
5a6f748981554cb4d4aa0b5500a9b86bd09eb1b5 | Add Linux static bindings | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'zmq',
'sources': [ 'binding.cc' ],
'include_dirs' : [
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="win"', {
'win_delay_load_hook': 'true',
'include_dirs': ['windows/include'],
'link_settings'... | Python | 0 | @@ -1473,24 +1473,92 @@
%22linux%22', %7B%0A
+ 'libraries': %5B '%3C(PRODUCT_DIR)/../../zmq/lib/libzmq.a' %5D,%0A
%7D%5D,%0A
|
777bb37f9ac4457dca79a07953356ce46b941a30 | change '-std=c++11' to '-std=c++0x' for linux | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'eigen',
'sources': [
'src/EigenJS.cpp'
],
'include_dirs': [
'deps',
"<!(node -e \"require('nan')\")"
],
'conditions': [
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
... | Python | 0.000023 | @@ -559,18 +559,18 @@
-std=c++
-11
+0x
' %5D,%0A
|
4d117703e8a33ab628feba96aa5f2a35dd175ef6 | Allow null event dates | web/whim/core/models.py | web/whim/core/models.py | from datetime import datetime, timedelta, timezone
from django.db import models
from django.dispatch import receiver
from django.contrib.postgres.fields import ArrayField
from django.utils.text import slugify
from django.urls import reverse
from whim.core.time import zero_time_with_timezone
class BaseModel(models.M... | Python | 0.000259 | @@ -3423,28 +3423,38 @@
Field(blank=
-Fals
+True, null=Tru
e)%0A end_d
@@ -4256,73 +4256,4 @@
me)%0A
- instance.status = Event.STATUS_PENDING # default to pending%0A
|
786e7d83672ad5ff2718c9a440dbd180f8e7b24a | make addon buildable as static library (#119) | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'kerberos',
'include_dirs': [ '<!(node -e "require(\'nan\')")' ],
'sources': [
'src/kerberos.cc'
],
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.12',
'OTHER_CFLAGS': [
"-std=c++11",
"-stdlib=libc++"
... | Python | 0.000001 | @@ -49,16 +49,49 @@
beros',%0A
+ 'type': 'loadable_module',%0A
'i
@@ -702,33 +702,257 @@
%5D%0A %7D
+,%0A 'conditions': %5B%0A %5B'_type==%22static_library%22', %7B%0A 'link_settings': %7B%0A 'libraries': %5B%0A '-lcom_err'%0A ... |
4b0df9b01431e670012398fae580de567f4e6199 | Make a few imports start with leading underscore | src/dynmen/common.py | src/dynmen/common.py | # -*- coding: utf-8 -*-
import logging as _logging
from dynmen import Menu, ValidationError, Default
from collections import (namedtuple as _ntupl,
OrderedDict as _OrderedDict)
try:
from functools import lru_cache
from inspect import signature
except ImportError: # for Pytho... | Python | 0.000014 | @@ -227,32 +227,46 @@
import lru_cache
+ as _lru_cache
%0A from inspec
@@ -283,16 +283,30 @@
ignature
+ as _signature
%0Aexcept
@@ -376,32 +376,46 @@
import lru_cache
+ as _lru_cache
%0A from funcsi
@@ -433,16 +433,30 @@
ignature
+ as _signature
%0A%0A%0A_logr
@@ -640,16 +640,17 @@
elds)%0A%0A@
+_
lru_... |
b8df30e7a879049997b49aace09501d0dd809e8f | change output of --show-folders | norless/run.py | norless/run.py | import sys
import json
import fcntl
import os.path
import argparse
import threading
from mailbox import Maildir, MaildirMessage
from collections import Counter
from .config import IniConfig
from .state import State, connect, create_tables
get_maildir_lock = threading.Lock()
class ConcurentMaildir(Maildir):
def ... | Python | 0.000001 | @@ -5072,21 +5072,42 @@
'
-', f,
+ %5B%7B%7D%5D %7B%7D%5Ct(%7B%7D)'.format(
s, name
+, f)
%0A%0Ade
|
1df655ac5a2bc31c693411c8f6a31e421c817c7d | fix typo | src/c3nav/control/views.py | src/c3nav/control/views.py | from functools import wraps
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator
from django.db import transaction
from django.db.models i... | Python | 0.999991 | @@ -2493,17 +2493,24 @@
ons.
-can_
grant
+_all_access
or
|
f7f9e5ec0889db742c1014f07ddad7f2a16b8a80 | Update NewsblurConnector.py | src/connectors/NewsblurConnector.py | src/connectors/NewsblurConnector.py | import json
import requests
import requests.exceptions
import rollbar
from bs4 import BeautifulSoup
from datadog import statsd
from ddtrace import patch
from ddtrace import tracer
from time import sleep
from utility import nb_logging
patch(requests=True)
logger = nb_logging.setup_logger('NewsblurConnector')
class... | Python | 0 | @@ -5483,32 +5483,115 @@
equests.count')%0A
+ %09%09statsd.increment('nb.http_requests.status_' + str(resp.status_code))%0A
@@ -5949,16 +5949,62 @@
TART'))%0A
+%09%09 sleep(self.config.get('BACKOFF_START'))%0A
|
8d2805107bc765ab0c171adebaeed9c0379b10da | Add -f, --fork to run in the background | notable/app.py | notable/app.py | """Notable - a simple not taking application"""
# Python imports
import logging
import optparse
import os
import sys
import threading
import time
import webbrowser
try:
import urllib2
except ImportError:
from urllib import request as urllib2
root = os.path.abspath(os.path.dirname(__file__))
sys.path = [os.pat... | Python | 0.000001 | @@ -59,16 +59,31 @@
imports%0A
+import httplib%0A
import l
@@ -115,16 +115,34 @@
port os%0A
+import subprocess%0A
import s
@@ -651,18 +651,8 @@
e__)
-%0Aup = 'up'
%0A%0A@b
@@ -2104,19 +2104,18 @@
t('/
-wor
+pi
d')%0Adef
word
@@ -2110,19 +2110,18 @@
d')%0Adef
-wor
+pi
d():%0A
@@ -2128,18 +2128,32 @@
re... |
b6208c1f9b6f0afca1dff40a66d2c915594b1946 | Add exception hook to help diagnose server test errors in python3 gui mode | blaze/io/server/tests/start_simple_server.py | blaze/io/server/tests/start_simple_server.py | """
Starts a Blaze server for tests.
$ start_test_server.py /path/to/catalog_config.yaml <portnumber>
"""
import sys, os
import blaze
from blaze.io.server.app import app
blaze.catalog.load_config(sys.argv[1])
app.run(port=int(sys.argv[2]), use_reloader=False)
| Python | 0 | @@ -115,16 +115,696 @@
sys, os%0A
+%0Aif os.name == 'nt':%0A old_excepthook = sys.excepthook%0A%0A # Exclude this from our autogenerated API docs.%0A undoc = lambda func: func%0A%0A @undoc%0A def gui_excepthook(exctype, value, tb):%0A try:%0A import ctypes, traceback%0A MB_I... |
bde944941aa74eb8b7bc1150366b8f7cfedff93c | fix test coverage | etcd/test_etcd.py | etcd/test_etcd.py | # (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest
@attr(requires='etcd')
class CheckEtcdTest(AgentCheckTest):
CHECK_NAME = "etcd"
STORE_METRICS = [
... | Python | 0.000002 | @@ -4318,16 +4318,93 @@
/test'%5D)
+%0A self.assertServiceCheckUnknown(self.check.HEALTH_SERVICE_CHECK_NAME)
%0A%0A
|
826698c9894ce94c625718eb041ce817eb6ab5ef | Update config.dist.py | boiler/boiler_template/config/config.dist.py | boiler/boiler_template/config/config.dist.py | from project.backend import config
class DefaultConfig(config.DefaultConfig):
""" Local development config """
# set this for offline mode
SERVER_NAME = None
SECRET_KEY = None
class DevConfig(config.DevConfig, DefaultConfig):
""" Local development config """
pass
class TestingConfig(config... | Python | 0.000002 | @@ -378,14 +378,23 @@
fig %22%22%22%0A
+ pass%0A
%0A%0A%0A%0A%0A%0A
|
5d5f0ff3a9514e723497b7238f1c24a8baaf85e8 | Specifying the number of places past the decimal point | detector.py | detector.py | import os, math, random, sys
from ngram import Ngram
class Detector:
def __init__(self, test_docs_dir="./test"):
self.test_docs_dir = test_docs_dir
self.files = [d for d in os.listdir(test_docs_dir) if os.path.isfile(os.path.join(test_docs_dir, d)) and d[0] != "." ]
self.ngrams = [] # ... | Python | 0.949914 | @@ -4100,18 +4100,24 @@
alue
-=%25
+ of %250.3
f.%22 %25 (f
ile1
@@ -4112,26 +4112,20 @@
f.%22 %25 (f
-ile
1, f
-ile
2, jacca
|
2e2eb70663efa66532ee61dd9b3923751865cf06 | Add ElasticQuery.timeout(timeout) | elasticquery/query.py | elasticquery/query.py | # ElasticQuery
# File: query.py
# Desc: ElasticQuery itself
import json
from .exception import NoESClient, NoIndexName, NoDocType # , InvalidField
class ElasticQuery(object):
'''A class for building ES queries'''
__es__ = None
__index__ = None
__doc_type__ = None
__mapping__ = None
def __in... | Python | 0.000001 | @@ -1748,32 +1748,171 @@
return self%0A%0A
+ def timeout(self, timeout):%0A '''Set a timeout on the query.'''%0A self.structure%5B'timeout'%5D = timeout%0A return self%0A%0A
def sort(sel
|
4c4b1e6a4bde5edb9e11942245a21437e73fe6df | fix link creation | archivebox/index/sql.py | archivebox/index/sql.py | __package__ = 'archivebox.index'
from io import StringIO
from typing import List, Tuple, Iterator
from .schema import Link
from ..util import enforce_types
from ..config import setup_django, OUTPUT_DIR
### Main Links Index
@enforce_types
def parse_sql_main_index(out_dir: str=OUTPUT_DIR) -> Iterator[Link]:
setu... | Python | 0 | @@ -901,16 +901,21 @@
ate(url=
+link.
url, def
|
7c7b7316843c9ae20073878485e6d68a6813a756 | remove useless rack checking code | bvalosek_MF_Twister/TwisterControlSurface.py | bvalosek_MF_Twister/TwisterControlSurface.py | from _Framework.ButtonMatrixElement import ButtonMatrixElement
from _Framework.ControlSurface import ControlSurface
from _Framework.InputControlElement import MIDI_CC_TYPE
from _Framework.Layer import Layer
from _Framework.MixerComponent import MixerComponent
from _Framework.ModesComponent import LayerMode
from _Framew... | Python | 0 | @@ -1945,448 +1945,8 @@
s%5B0%5D
-%0A%0A # if its a drum rack without macros, try to set the device to chain%0A # instead in order to have the focus be on the selected / last played%0A # pad's chain%0A rack = device.can_have_drum_pads%0A if rack and not device.has_macro_mappings and ... |
1f75ecb06a8bb463648e3b7689de043f0bab0d16 | Remove unneeded users.json fixtures from readout tests. | apps/dashboards/tests/test_readouts.py | apps/dashboards/tests/test_readouts.py | from datetime import datetime
from functools import partial
from nose.tools import eq_
from dashboards.readouts import (UnreviewedReadout,
TemplateTranslationsReadout,
MostVisitedTranslationsReadout)
from sumo.tests import TestCase
from wiki.models imp... | Python | 0 | @@ -778,39 +778,8 @@
%22%22%22%0A
- fixtures = %5B'users.json'%5D%0A%0A
@@ -2243,39 +2243,8 @@
%22%22%22%0A
- fixtures = %5B'users.json'%5D%0A%0A
@@ -4599,38 +4599,8 @@
t%22%22%22
-%0A fixtures = %5B'users.json'%5D
%0A%0A
|
01c1466487a9802f4c3d3c21390587ae6d3a7122 | Fix bug in tasks.sync_notes | everbean/tasks.py | everbean/tasks.py | # coding=utf-8
from __future__ import (
with_statement,
absolute_import,
unicode_literals
)
import time
from datetime import datetime
from flask import current_app as app
from flask.ext.mail import Message
from everbean.core import mail, db, celery
from everbean.models import User, Note
from everbean.ext.do... | Python | 0.000021 | @@ -3868,22 +3868,16 @@
er.books
-.all()
%0A # n
|
efdf4a4898cc3b5217ac5e45e75a74e19eee95d4 | bump version | evojax/version.py | evojax/version.py | __version__ = "0.1.0-13"
| Python | 0 | @@ -19,7 +19,7 @@
.0-1
-3
+4
%22%0A
|
155c953f7bf8590b4a11547369bee29baa5ea5f6 | Fix typo. | isaactest/tests/numeric_q_all_correct.py | isaactest/tests/numeric_q_all_correct.py | import time
from ..utils.log import log, INFO, ERROR, PASS
from ..utils.isaac import answer_numeric_q
from ..utils.i_selenium import assert_tab, image_div
from ..utils.i_selenium import wait_for_xpath_element
from ..tests import TestWithDependency
from selenium.common.exceptions import TimeoutException, NoSuchElementEx... | Python | 0.001604 | @@ -557,17 +557,17 @@
%22%22Test i
-s
+f
numeric
|
aabc4bc60f0c8b6db21453dd6fad387773b18e55 | Fix a print | openquake/commands/__main__.py | openquake/commands/__main__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2018 GEM Foundation
#
# OpenQuake 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 ... | Python | 0.999999 | @@ -1108,16 +1108,27 @@
print('
+Deprecation
Warning:
|
be06ba33aff25995c9323e251003c9bea09aa9de | update UI | MellPlayer/ui.py | MellPlayer/ui.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Netease Music UI
Created on 2017-02-21
@author: Mellcap
'''
import os
SONG_CATEGORIES = (
'流行', '摇滚', '民谣', '说唱', '轻音乐', '乡村', '古典', 'R&B/Soul', '电子', '另类/独立',\
'学习', '工作', '午休',\
'华语', '欧美', '日语', '韩语', '粤语', '小语种',\
'怀旧', '清新', '浪漫', '性感', '治愈', '... | Python | 0.000001 | @@ -1085,20 +1085,292 @@
e =
-'MellPlayer'
+self._get_title()%0A%0A def _get_title(self):%0A player_name = '%5C033%5B1m%25s' %25 self.gen_color('MellPlayer', 'blue')%0A netease = self.gen_color('%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90', 'red')%0A divider = self.gen_color(data=r'%5C%5C', ... |
df8848beffeb952f8da034c13d22245ce123f576 | fix 677: Error on enum type during manage.py migrations | shop/models/fields.py | shop/models/fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import enum
import six
from django.conf import settings
from django.db import models
from django.utils.six import python_2_unicode_compatible, string_types
from django.utils.translation import ugettext_lazy as _, ugettext
postgresql_engine_names = [
... | Python | 0 | @@ -3104,135 +3104,20 @@
-if isinstance(state, int):%0A return state%0A raise ValueError(%22Value must be of type %7B%7D%22.format(self.enum_type))
+return state
%0A%0A
|
c916f4c379fe2b7035da46bc194f010e1795f9ef | Remove some debug. | cool-bot.py | cool-bot.py | #!/usr/bin/env/ python
import os
import sys
import string
import socket
HOST='0.0.0.0'
PORT=6667
NICK='cool-bot'
REALNAME='cool bot'
CHANNEL='#cool-bot'
def connected(fn):
def deco(self, *args, **kwargs):
try:
fn(self, *args, **kwargs)
except socket.error, err:
## Removing ... | Python | 0 | @@ -556,72 +556,8 @@
s):%0A
- print %22SENDING: %25s%22 %25 (%22%25s %25s%22 %25 (cmd, ' '.join(args)))%0A
|
8b69b3af8b7ed9dcbd00f2b22a47828627dc7c78 | fix setup | zgres/tests/test_apt.py | zgres/tests/test_apt.py | import os
from unittest import mock
import asyncio
from subprocess import check_output, check_call
import pytest
import psycopg2
from . import FakeSleeper
def have_root():
destroy = os.environ.get('ZGRES_DESTROY_MACHINE', 'false').lower()
if destroy in ['t', 'true']:
user = check_output(['whoami']).de... | Python | 0.000001 | @@ -951,16 +951,55 @@
ter_name
+,%0A create_superuser=True
))%0A f
|
2a13f4d21085228a1ef615eec8a3e42110c315d3 | Make test pass | benchmarker/modules/problems/cnn2d_toy/pytorch.py | benchmarker/modules/problems/cnn2d_toy/pytorch.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from benchmarker.modules.problems.helpers_torch import Net4Inference, Net4Train
class Net(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=2)
self.conv2 =... | Python | 0.000225 | @@ -60,16 +60,17 @@
al as F%0A
+%0A
from ben
@@ -734,13 +734,8 @@
nel(
-net,
para
@@ -755,24 +755,40 @@
args=None):%0A
+ net = Net()%0A
if param
|
f6e93144a2471ef22883f4db935a499463a76824 | fix sytanx errors | will/0003/into_redis.py | will/0003/into_redis.py | # 第 0003 题: 将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。
import random, string, time, math, uuid, redis
chars = string.ascii_letters + string.digits
def gen1():
key = ''.join(random.sample(chars, 10))
#key2 = ''.join(random.choice(chars) for i in range(10))
return key
def gen2():
key = math.modf(ti... | Python | 0.000031 | @@ -387,17 +387,16 @@
%0Aif
-'
__name__
' ==
@@ -391,17 +391,16 @@
__name__
-'
== '__m
|
3b564cdd4adbf3185d2f18ec6eedbf4b87057cf5 | Add virus fixture to conftest | conftest.py | conftest.py | from virtool.tests.fixtures.db import *
from virtool.tests.fixtures.documents import *
from virtool.tests.fixtures.client import *
from virtool.tests.fixtures.core import *
from virtool.tests.fixtures.hmm import *
from virtool.tests.fixtures.users import *
def pytest_addoption(parser):
parser.addoption("--quick",... | Python | 0 | @@ -250,16 +250,61 @@
mport *%0A
+from virtool.tests.fixtures.viruses import *%0A
%0A%0Adef py
|
769783bc46ecd4b8def05e3cf664a3844aa6dec5 | Use a regex to parse the version | bazelisk.py | bazelisk.py | #!/usr/bin/env python3
'''
Copyright 2018 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.00001 | @@ -684,16 +684,26 @@
os.path%0A
+import re%0A
import s
@@ -3426,712 +3426,390 @@
ine_
-release_or_rc(version):%0A parts = version.lower().split(%22rc%22)%0A if len(parts) == 1:%0A # e.g. (%220.20.0%22, %22release%22) for 0.20.0%0A return (version, %22release%22)%0A elif len(parts) == 2:%0A # e.g. (%220.... |
8b2827a87927e60cefb83f273b58d9aba9f9600d | improve error representation for doctests with cython | conftest.py | conftest.py | # -*- coding: utf-8 -*-
import os
import pytest
from sphinx.application import Sphinx
import imgui
PROJECT_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sphinx = None
def project_path(*paths):
return os.path.join(PROJECT_ROOT_DIR, *paths)
class SphinxDoc(pytest.File):
def __init__(self, path, par... | Python | 0 | @@ -26,16 +26,27 @@
mport os
+%0Aimport sys
%0A%0Aimport
@@ -53,16 +53,63 @@
pytest%0A
+from inspect import currentframe, getframeinfo%0A
from sph
@@ -1341,26 +1341,8 @@
e)%0A%0A
- @staticmethod%0A
@@ -1358,16 +1358,22 @@
snippet(
+self,
source):
@@ -1420,16 +1420,65 @@
'exec')
+%0A frameinfo... |
ed74c8f8cae53ee81d196ec85ede70597fd2d571 | Troubleshoot diff_drv.py | diff_drv.py | diff_drv.py |
# diff_drv.py
# Rover differential drive class
# Using Raspberry Pi GPIO software PWM
# Using two DRV8838 Single Brushed DC Motor Driver Carriers
# www.pololu.com/product/2990
import RPi.GPIO as GPIO
class diff_drv:
"""Rover differential drive class for two DRV8838 Motor Drivers"""
# Signal Mnemonics
L... | Python | 0.000004 | @@ -2300,32 +2300,75 @@
iff_drv.ENABLE%0A%0A
+ # Zero Trim%0A self.trim = 0%0A%0A
def drive(se
|
f4498880ad8bd1b30f6439e82ac906034927b3df | Add local memcache config | microweb/settings.py | microweb/settings.py | import os
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
# Do not change these! Override them in local_settings.py if necessary.
DEBUG = False
TEMPLATE_DEBUG = False
ADMINS = ()
MANAGERS = ADMINS
# Test runner gets unhappy if there's no database defined.
DATABASES = {
'default': {
'ENGINE': '... | Python | 0 | @@ -4558,16 +4558,66 @@
OST = ''
+%0AMEMCACHE_HOST = '127.0.0.1'%0AMEMCACHE_PORT = 11211
%0A%0APAGE_S
|
900de7c14607fbe2936fa682d03747916337f075 | Fix the reactor_pytest fixture. | conftest.py | conftest.py | from pathlib import Path
import pytest
def _py_files(folder):
return (str(p) for p in Path(folder).rglob('*.py'))
collect_ignore = [
# not a test, but looks like a test
"scrapy/utils/testsite.py",
# contains scripts to be run by tests/test_crawler.py::CrawlerProcessSubprocess
*_py_files("tests/... | Python | 0 | @@ -960,24 +960,37 @@
est.fixture(
+scope='class'
)%0Adef reacto
@@ -1004,24 +1004,82 @@
t(request):%0A
+ if not request.cls:%0A # doctests%0A return%0A
request.
|
8dddafe0ddfcca04a5293033dc8f81dae89e2e96 | Update cli.py | src/flask_rq2/cli.py | src/flask_rq2/cli.py | # -*- coding: utf-8 -*-
"""
flask_rq2.cli
~~~~~~~~~~~~~
Support for the Click based Flask CLI via Flask-CLI.
"""
import operator
import os
from functools import update_wrapper
import click
from rq.cli import cli as rq_cli
try:
from flask.cli import AppGroup, ScriptInfo
except ImportError: # pragma:... | Python | 0 | @@ -3594,32 +3594,45 @@
-ttl', type=int,
+ default=420,
%0A h
@@ -3661,32 +3661,47 @@
meout to be used
+ (default: 420)
')%0A@click.option
|
bcb0d5b3c0a90db3eb1e70b27185c4f511e9ab57 | Add relu6 as alias to clipped_relu | chainer/functions/activation/clipped_relu.py | chainer/functions/activation/clipped_relu.py | import numpy
import chainer
from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
_mode = cuda.cuda.cudnn.CUDNN_ACTIVATION_CLIPPED_RELU # type: ignore
class ClippedReLU(function_node.Func... | Python | 0 | @@ -4607,8 +4607,467 @@
eturn y%0A
+%0Adef relu6(x):%0A %22%22%22Rectifier Unit function clipped at 6.%0A%0A It computes%0A%0A .. math:: %5C%5Ctext%7BReLU6%7D(x) = %5C%5Cmin(%5C%5Cmax(0, x), 6).%0A%0A Args:%0A x (:class:%60~chainer.Variable%60 or :ref:%60ndarray%60):%0A Input variable. A ... |
7059622c5787f06027ae2cf978beb69df4e5cabd | Send googler profiling data. | breakpad.py | breakpad.py | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Breakpad for Python.
Sends a notification when a process stops on an exception.
It is only enabled when all these conditions are met:
1. hostname ... | Python | 0 | @@ -498,22 +498,45 @@
%0Aimport
-urllib
+socket%0Aimport sys%0Aimport time
%0Aimport
@@ -548,38 +548,38 @@
back%0Aimport
-socket
+urllib
%0Aimport
sys%0A%0A%0A# Conf
@@ -566,19 +566,23 @@
%0Aimport
-sys
+urllib2
%0A%0A%0A# Con
@@ -656,17 +656,8 @@
.com
-/breakpad
'%0A%0A_
@@ -676,16 +676,346 @@
False%0A... |
01d4279b40eb9e3029f857bf9d81d66d0314532d | Bump version to 1.5.1 | enlighten/__init__.py | enlighten/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2017 - 2020 Avram Lubkin, All Rights Reserved
# 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/.
"""
**Enlighten Progress Bar**
Provi... | Python | 0 | @@ -505,17 +505,17 @@
= '1.5.
-0
+1
'%0A__all_
|
5c27ebd8e69802cce4afe51b917df233dcf4d972 | Add D3DCompiler_46.dll to ignore list Review URL: https://codereview.chromium.org/12217044 | site_config/config.py | site_config/config.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Declares a number of site-dependent variables for use by scripts.
A typical use of this module would be
import chromium_config as config
v8_url... | Python | 0 | @@ -1960,16 +1960,38 @@
43.dll',
+ 'D3DCompiler_46.dll',
'xinput
@@ -1999,16 +1999,22 @@
_3.dll',
+%0A
'FlashP
|
46a6656ae1841841ec97c7e583f3595d737bef45 | Update preprocessing.py (#1068) | autokeras/hypermodels/preprocessing.py | autokeras/hypermodels/preprocessing.py | import numpy as np
from tensorflow.keras.layers.experimental import preprocessing
from tensorflow.python.util import nest
from autokeras import adapters
from autokeras import keras_layers
from autokeras.engine import block as block_module
class Normalization(block_module.Block):
""" Perform basic image transform... | Python | 0 | @@ -1,16 +1,45 @@
+from typing import Optional%0A%0A
import numpy as
@@ -1474,17 +1474,34 @@
e_length
-=
+: Optional%5Bint%5D =
None,%0A
|
8ef11bf983705540973badb40f7daf5a14c1173a | Fix typo | astrobin/permissions.py | astrobin/permissions.py | # Django
from django.db.models import Q
# Third party apps
from pybb.permissions import DefaultPermissionHandler
# AstroBin apps
from astrobin_apps_groups.models import Group
class CustomForumPermissions(DefaultPermissionHandler):
# Disable forum polls
def may_create_poll(self, user):
return False
... | Python | 0.999999 | @@ -1901,17 +1901,16 @@
rum.grou
-o
p.owner
|
cf07d8d7dd4449cae983a6a038fa8fabaa990f2a | switch on/off alerts | ott/otp_client/trip_planner.py | ott/otp_client/trip_planner.py | import sys
import simplejson as json
import urllib
import logging
log = logging.getLogger(__file__)
from ott.utils import json_utils
from ott.utils import object_utils
from ott.utils import html_utils
from ott.otp_client import otp_to_ott
from ott.utils.parse import TripParamParser
from ott.geocoder.geosolr import ... | Python | 0.000002 | @@ -458,34 +458,12 @@
url=
-%22http://localhost/adverts%22
+None
, ad
|
367e760bc49045dd3460122392557089f052d802 | create mmap functin | word2vec/wordvectors.py | word2vec/wordvectors.py | import numpy as np
from word2vec.utils import unitvec
class WordVectors(object):
def __init__(self, vocab, vectors=None, l2norm=None, save_memory=True):
"""
Initialize a WordVectors class based on vocabulary and vectors
This initializer precomputes the l2norm of the vectors
Para... | Python | 0.000002 | @@ -6788,28 +6788,110 @@
s, save_memory=save_memory)%0A
+%0A @classmethod%0A def from_mmap(cls, vocab_fname, l2norm_fname):%0A pass%0A
|
b54d7b8079bf414b1fe79061b33e41c6350707d6 | use integer instead of string | mopidy_rotaryencoder/__init__.py | mopidy_rotaryencoder/__init__.py | from __future__ import unicode_literals
import logging
import os
from mopidy import config, ext
__version__ = '0.1.0'
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = 'Mopidy-RotaryEncoder'
ext_name = 'rotaryencoder'
version = __version__
def get_default_config(sel... | Python | 0.027486 | @@ -548,38 +548,39 @@
apin'%5D = config.
-String
+Integer
()%0A schem
@@ -592,38 +592,39 @@
kpin'%5D = config.
-String
+Integer
()%0A schem
@@ -647,14 +647,15 @@
fig.
-String
+Integer
()%0A
|
c01c691761de3b4c976a68865905fd981ea4c165 | handle range/xrange | autodiff/ast_context.py | autodiff/ast_context.py | import logging
import meta
import ast as ast_module
import numpy as np
import theano
import theano.tensor as T
logger = logging.getLogger('pyautodiff')
# XXX FIXME This will not do - seed must be exposed.
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
global_randomstreams = RandomStreams(seed... | Python | 0.000005 | @@ -2885,16 +2885,137 @@
ano_fn%0A%0A
+ elif func.__name__ in ('range', 'xrange'):%0A return lambda *args : func(*(unshadow(a) for a in args))%0A%0A
|
c2a79d8cbbb174530991d8b59578169ee9b2be44 | use absolute paths for external scripts in Spidermonkey wrapper | wrapper_spidermonkey.py | wrapper_spidermonkey.py | #!/usr/bin/env python
"""
wrapper for JSLint
requires Spidermonkey
Usage:
$ wrapper_spidermonkey.py <filepath>
TODO:
* support for JSLint options
"""
import sys
import spidermonkey
from simplejson import loads as json
lint_path = "fulljslint.js"
json_path = "json2.js"
def main(args=None):
filepath = args[1... | Python | 0 | @@ -159,16 +159,26 @@
port sys
+%0Aimport os
%0A%0Aimport
@@ -235,19 +235,55 @@
n%0A%0A%0A
-lint_path =
+cwd = sys.path%5B0%5D%0Alint_path = os.path.join(cwd,
%22fu
@@ -294,16 +294,17 @@
lint.js%22
+)
%0Ajson_pa
@@ -312,18 +312,75 @@
h =
-%22json2.js%22
+os.path.join(cwd, %22json2.js%22) # XXX: built in from S... |
2271131d5c2794eeba256a9d9547fa925f7bdf73 | bump __version__ | matplotlib2tikz/__init__.py | matplotlib2tikz/__init__.py | # -*- coding: utf-8 -*-
#
'''Script to convert Matplotlib generated figures into TikZ/PGFPlots figures.
'''
__author__ = 'Nico Schlömer'
__email__ = 'nico.schloemer@gmail.com'
__copyright__ = 'Copyright (c) 2010-2016, %s <%s>' % (__author__, __email__)
__credits__ = []
__license__ = 'MIT License'
__version__ = '0.5.6'... | Python | 0.000017 | @@ -311,17 +311,17 @@
= '0.5.
-6
+7
'%0A__main
|
35d3284a1242bdeb6ea3aec128deb92b3138106b | Add the ability to specify the Cakefile parent directory. | flask_cake/cake.py | flask_cake/cake.py | from __future__ import absolute_import
import os
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class Cake(object):
def __init__(self, app=None, tasks=["build"]):
"""Initalize a new instance of Flask-Cake.
:param app: The Flask app
... | Python | 0 | @@ -222,16 +222,37 @@
%22build%22%5D
+, cakeparent=%22coffee%22
):%0A
@@ -517,32 +517,337 @@
%60%60cake build%60%60.
+%0A :param str cakeparent: The directory where the Cakefile is located%0A relative to Flask's %60static_path%60. By default,%0A ... |
cd25fd1bd40a98886b92f5e3b357ee0ab2796c7b | add /query route, with plain text for mongo | flaskr/__init__.py | flaskr/__init__.py | #!/usr/bin/python3
# -*- coding: latin-1 -*-
import os
import sys
# import psycopg2
import json
from bson import json_util
from pymongo import MongoClient
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
def create_app():
app = Flask(__name__)
return app
a... | Python | 0 | @@ -1578,32 +1578,416 @@
urn %22no query%22%0A%0A
+@app.route(%22/query%22)%0Adef ruta_query():%0A query = request.args.get(%22query%22)%0A if not query is None:%0A results = eval('mongodb.'+query)%0A results = json_util.dumps(results, sort_keys=True, indent=4)%0A if %22find%22 in query:%0A ... |
af4b53a85aec95c9ec7bf20b1c019ec0f397eacb | Bump version to 0.2.2 | flavio/_version.py | flavio/_version.py | __version__='0.2.1'
| Python | 0.000002 | @@ -14,8 +14,8 @@
0.2.
-1
+2
' %0A
|
3d90dcd652fcfa47a5350a1ddb8cc562b0f3d676 | Rename a base class | pathvalidate/_base.py | pathvalidate/_base.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import abc
import itertools
import os
import re
from typing import Any, List, Optional, Tuple, cast
from ._common import PathType, Platform, PlatformType, normalize_platform, unprintable_ascii_chars
from ._const import _NTFS_RESERVED_FILE_NAMES
f... | Python | 0.000943 | @@ -378,16 +378,20 @@
ass Base
+File
:%0A _I
@@ -3306,24 +3306,28 @@
lidator(Base
+File
, metaclass=
@@ -3767,16 +3767,20 @@
zer(Base
+File
, metacl
|
94bbae75b2ef5147fdb55c3a4b62910552e5fb5d | update instances of iterations to reps in stratified_permutationtest | permute/stratified.py | permute/stratified.py | # -*- coding: utf-8 -*-
"""
Stratified permutation tests.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from .utils import get_prng, permute_within_groups
def corrcoef(x, y, group):
"""
Calculates sum of Spearman correlations between x and y,
computed separate... | Python | 0 | @@ -2164,94 +2164,29 @@
ups=
-np.unique(group), %0A conditions=np.unique(condition)
+None, conditions=None
):%0A
@@ -3061,32 +3061,165 @@
atistic%0A %22%22%22%0A
+ if(groups is None):%0A groups = np.unique(group)%0A if(conditions is None):%0A conditions = np... |
b2b5e91649cdfadda63e11dcfe5ef5c105d28f23 | Add timeout cli arg | pg_bawler/listener.py | pg_bawler/listener.py | #!/usr/bin/env python
'''
Listen on given channel for notification.
$ python -m pg_bawler.listener mychannel
If you installed notification trigger with ``pg_bawler.gen_sql`` then
channel is the same as ``tablename`` argument.
'''
import argparse
import asyncio
import importlib
import logging
import sys
import pg... | Python | 0.000001 | @@ -1026,20 +1026,20 @@
efault='
-info
+INFO
',%0A
@@ -1070,52 +1070,52 @@
of:
-fatal, cirtical, error, warning, info, debug
+FATAL, CIRTICAL, ERROR, WARNING, INFO, DEBUG
')%0A
@@ -1178,16 +1178,39 @@
='DSN',%0A
+ required=True,%0A
@@ -1286,32 +1286,287 @@
r.add_argument(%0A
+ '--ti... |
8602d984a9caf73dc40168e0e7937c9e930d035b | Stop $PYTHONPATH from messing up the search path for DLLs. CURA-3418 Cura build on Win 64 fails due to $PYTHONPATH | cura_app.py | cura_app.py | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import os
import sys
import platform
from UM.Platform import Platform
#WORKAROUND: GITHUB-88 GITHUB-385 GITHUB-612
if Platform.isLinux(): # Needed for platform.linux_distribution, which is not avail... | Python | 0 | @@ -807,16 +807,235 @@
LOBAL)%0A%0A
+# When frozen, i.e. installer version, don't let PYTHONPATH mess up the search path for DLLs.%0Aif Platform.isWindows() and hasattr(sys, %22frozen%22):%0A try:%0A del os.environ%5B%22PYTHONPATH%22%5D%0A except KeyError: pass%0A%0A
#WORKARO
|
90571c86f39fee14fafcc9c030de66d4255c5d82 | Change naming style | lexos/interfaces/statistics_interface.py | lexos/interfaces/statistics_interface.py | from flask import request, session, render_template, Blueprint
from lexos.helpers import constants as constants
from lexos.managers import utility, session_manager as session_manager
from lexos.interfaces.base_interface import detect_active_docs
# this is a flask blue print
# it helps us to manage groups of views
# s... | Python | 0.000002 | @@ -121,130 +121,130 @@
xos.
-managers import utility, session_manager as session_manager%0Afrom lexos.interfaces.base_interface import detect_active_docs
+interfaces.base_interface import detect_active_docs%0Afrom lexos.managers import utility, session_manager as session_manager
%0A%0A#
@@ -1704,19 +1704,19 @@
le_... |
009cdf804f0f730ed081c6003eedb1015283948f | update to test for non categorized event publishing | lg_replay/test/offline/test_lg_replay.py | lg_replay/test/offline/test_lg_replay.py | #!/usr/bin/env python
PKG = 'lg_replay'
NAME = 'test_lg_replay'
import rospy
import unittest
import json
from evdev import InputEvent
from lg_replay import DeviceReplay
from interactivespaces_msgs.msg import GenericMessage
class MockDevice:
def __init__(self):
self.events = [
InputEvent(144... | Python | 0 | @@ -1904,12 +1904,8 @@
ge%5B'
-scan
code
@@ -1951,79 +1951,18 @@
ge%5B'
-keystate'%5D, 0)%0A self.assertEqual(message%5B'keycode'%5D, 'BTN_TOUCH'
+value'%5D, 0
)%0A%0Ai
|
41548ba9efb1d47c823696adeb13560bdbb73878 | allow update of IP to timeout without quitting loop | dyndnsc/updater/base.py | dyndnsc/updater/base.py | # -*- coding: utf-8 -*-
import logging
import requests
from ..common.subject import Subject
from ..common.events import IP_UPDATE_SUCCESS, IP_UPDATE_ERROR
log = logging.getLogger(__name__)
class UpdateProtocol(Subject):
"""
base class for all update protocols that use the dyndns2 update protocol
"""
... | Python | 0 | @@ -1429,32 +1429,53 @@
protocol(self):%0A
+ timeout = 60%0A
params =
@@ -1523,16 +1523,33 @@
stname%7D%0A
+ try:%0A
@@ -1597,16 +1597,45 @@
=params,
+%0A
auth=(s
@@ -1674,12 +1674,256 @@
out=
-60)%0A
+timeout)%0A except requests.exceptions.T... |
25f57a023f978fca94bbeb9655a4d90f0b2d95f0 | Fix typo | pints/toy/__init__.py | pints/toy/__init__.py | #
# Root of the toy module.
# Provides a number of toy models and logpdfs for tests of Pints' functions.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future_... | Python | 0.999999 | @@ -1756,17 +1756,17 @@
logistic
-
+_
model im
|
e0ea0d4df4d56da14f8f65b75122867d39d1bd45 | Remove flake comment and register the product views | pitchfork/__init__.py | pitchfork/__init__.py | # Copyright 2014 Dave Kludt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -1245,16 +1245,49 @@
iews
- # noqa
+%0Aproduct_views.ProductsView.register(app)
%0A%0A%0A@
|
5b120e5b89c06a0a5c01f8c710f85a4a179f56f7 | Change HTML theme to match BIND ARM, add copyright, EPUB info | doc/conf.py | doc/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | Python | 0 | @@ -1,8 +1,537 @@
+############################################################################%0A# Copyright (C) Internet Systems Consortium, Inc. (%22ISC%22)%0A#%0A# This Source Code Form is subject to the terms of the Mozilla Public%0A# License, v. 2.0. If a copy of the MPL was not distributed with this%0A# file, yo... |
807e5069c269e915dcecb66dab50881c3b87846f | Add extra path to documentation configuration. | doc/conf.py | doc/conf.py | import sys
import os
sys.path.append(os.path.abspath('../../music_essentials/'))
# -*- coding: utf-8 -*-
#
# music_essentials documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 7 10:47:21 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Not... | Python | 0 | @@ -74,16 +74,61 @@
ials/'))
+%0Asys.path.insert(0, os.path.abspath('../..'))
%0A%0A# -*-
|
6366fe6da78cd0e910b52352b918ff18d89f25c4 | update tests_forms | myideas/core/tests/test_forms.py | myideas/core/tests/test_forms.py | from django.test import TestCase
from django.shortcuts import resolve_url as r
from registration.forms import RegistrationForm
from myideas.core.forms import IdeasForm, IdeasFormUpdate
class IdeasFormTest(TestCase):
def setUp(self):
self.form = IdeasForm()
def test_form_has_fields(self):
""... | Python | 0.000001 | @@ -204,33 +204,32 @@
Test(TestCase):%0A
-%0A
def setUp(se
@@ -1081,33 +1081,32 @@
Test(TestCase):%0A
-%0A
def setUp(se
|
82b87b05068a8fb56f2983714c08c0b822b5dde5 | Remove settings leftover from sphinx-releases | doc/conf.py | doc/conf.py | # -*- coding: utf-8 -*-
import os
import sys
import alagitpull
# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")))
# package data
about = ... | Python | 0 | @@ -558,219 +558,8 @@
%0A%5D%0A%0A
-releases_unstable_prehistory = True%0Areleases_document_name = %5B%22history%22%5D%0Areleases_issue_uri = %22https://github.com/cihai/unihan-db/issues/%25s%22%0Areleases_release_uri = %22https://github.com/cihai/unihan-db/tree/v%25s%22%0A%0A
issu
|
3c2fa8716d82e6f7bb7ed2b381a58c2a5a6f6440 | Fix releases_document_name | doc/conf.py | doc/conf.py | # -*- coding: utf-8 -*-
import inspect
import os
import sys
from os.path import dirname, relpath
import alagitpull
import unihan_etl
# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
sys.path.append(os.path.abspath(os.p... | Python | 0.000005 | @@ -791,16 +791,17 @@
_name =
+%5B
%22history
@@ -801,16 +801,17 @@
history%22
+%5D
%0Arelease
|
b3dfb211d0d81210dcaa317a0d6f79b6ad249816 | Update netlogo_example.py | ema_workbench/examples/netlogo_example.py | ema_workbench/examples/netlogo_example.py | '''
This example is a proof of principle for how NetLogo models can be
controlled using pyNetLogo and the ema_workbench. Note that this
example uses the NetLogo 6 version of the predator prey model that
comes with NetLogo. If you are using NetLogo 5, replace the model file
with the one that comes with NetLogo.
'''
fr... | Python | 0.000001 | @@ -1,11 +1,11 @@
-'''
+%22%22%22
%0A%0AThis e
@@ -311,11 +311,31 @@
o.%0A%0A
-'''
+%22%22%22%0Aimport numpy as np%0A
%0Afro
@@ -385,16 +385,31 @@
logging,
+ ScalarOutcome,
%0A
@@ -1318,26 +1318,22 @@
omes = %5B
-TimeSeries
+Scalar
Outcome(
@@ -1339,16 +1339,99 @@
('sheep'
+, variable_name='count sheep',... |
8c6f178782b6470b98536a2384391970e0cbafb9 | Update config file | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Edwin Khoo'
SITENAME = 'Edwin Khoo'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/New_York'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = No... | Python | 0.000001 | @@ -444,16 +444,189 @@
CIAL = (
+('GitHub', 'https://github.com/edwinksl'),%0A ('Bitbucket', 'https://bitbucket.org/edwinksl'),%0A ('Facebook', 'https://www.facebook.com/edwinksl'),%0A
('Twitte
@@ -674,22 +674,24 @@
('
-GitHub
+LinkedIn
', 'http
@@ -690,35 +690,44 @@
', 'https://
... |
5bfdeb94d64ffe7cbcb750dda2edc48f5a1d23b2 | add a link to python course 2018 | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
from pathlib import Path
AUTHOR = u'Python Group'
SITENAME = u'Python Group UEA'
SITEURL = ''
PATH = 'content'
STATIC_PATHS = ['extra', 'extra/robots.txt', 'pdfs', 'figures',
'extra/favicon.ico', 'extra/custom.css'... | Python | 0 | @@ -2024,16 +2024,103 @@
INKS = (
+%0A ('Python Course 2018', 'https://ueapy.github.io/pythoncourse2018'),%0A
('Python
|
5cf5c6028bd7007a867691af966f89574f02de1f | clean up setup | mojolicious/setup.py | mojolicious/setup.py | import subprocess
import sys
#import setup_util
import json
from os.path import expanduser
import os
import getpass
home = expanduser("~")
def start(args, logfile, errfile):
# setup_util.replace_text("mojolicious/app.pl", "localhost", ""+ args.database_host +"")
# str(args.max_threads)
conf = {
'database_h... | Python | 0.000002 | @@ -26,27 +26,8 @@
sys%0A
-#import setup_util%0A
impo
@@ -154,125 +154,8 @@
e):%0A
- # setup_util.replace_text(%22mojolicious/app.pl%22, %22localhost%22, %22%22+ args.database_host +%22%22)%0A # str(args.max_threads)%0A
co
@@ -181,16 +181,17 @@
se_host'
+
: args.d
@@ -217,16 +217,23 @@
workers'
+
: ... |
8efa9c14685026acd143c385de51ccc57606842d | add molopage proxy | molo/polls/models.py | molo/polls/models.py | from django.db import models
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailcore.models import Page
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, MultiFieldPanel, FieldRowPanel,
)
from molo.core.utils import generate_slug
from molo.c... | Python | 0 | @@ -453,16 +453,68 @@
copy,%0A)%0A
+from molo.core.molo_wagtail_models import MoloPage%0A%0A
%0ASection
@@ -677,16 +677,20 @@
dexPage(
+Molo
Page, Pr
@@ -1492,32 +1492,36 @@
xinNotRoutable,
+Molo
Page):%0A paren
@@ -5227,16 +5227,20 @@
utable,
+Molo
Page):%0A
|
2faae3fc05e1b6562546e382b9c5c5afff6d8377 | Add debug timing to loading library and building browse cache | mopidy/local/json.py | mopidy/local/json.py | from __future__ import absolute_import, unicode_literals
import collections
import gzip
import json
import logging
import os
import re
import sys
import tempfile
import mopidy
from mopidy import local, models
from mopidy.local import search, translator
logger = logging.getLogger(__name__)
# TODO: move to load and ... | Python | 0 | @@ -155,16 +155,28 @@
tempfile
+%0Aimport time
%0A%0Aimport
@@ -2337,24 +2337,395 @@
.values()%0A%0A%0A
+# TODO: make this available to other code?%0Aclass DebugTimer(object):%0A def __init__(self, msg):%0A self.msg = msg%0A self.start = None%0A%0A def __enter__(self):%0A self.start = time... |
8d935a2141b8f5c080d922189df7d79bb838b3a0 | Use default router implementation | mopidy_lux/router.py | mopidy_lux/router.py | import os
from tinydb import TinyDB
from tinydb.storages import JSONStorage
from tinydb.middlewares import CachingMiddleware
import tornado.web
class LuxRouter(object):
def __init__(self, _config):
self.config = _config
self._db = TinyDB(
self.config['lux']['db_file'],
sto... | Python | 0 | @@ -143,96 +143,109 @@
eb%0A%0A
-%0Aclass LuxRouter(object):%0A def __init__(self, _config):%0A self.config = _config
+from mopidy import http%0A%0A%0Aclass LuxRouter(http.Router):%0A name = 'lux'%0A%0A def setup_routes(self):
%0A
@@ -249,22 +249,16 @@
-self._
db = Tin
@@ -369,37 +369,8 ... |
32481a906e00a1c5d301e6227ab43cf8feba31e0 | fix double-import trap | json5/__init__.py | json5/__init__.py | # Copyright 2014 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.000212 | @@ -666,27 +666,8 @@
%22%22%0A%0A
-from . import tool%0A
from
@@ -816,18 +816,6 @@
s',%0A
- 'tool',%0A
%5D%0A
|
4c86f347347cd3b9289bfa2e26e75f429ba9cba5 | Disable win_delay_load_hook to avoid issues with node10 | binding.gyp | binding.gyp | {
"includes": ["common.gypi"],
"variables": {
"shared_gdal%": "false",
"runtime_link%": "shared",
"enable_logging%": "false"
},
"targets": [
{
"target_name": "gdal",
"type": "loadable_module",
"product_prefix": "",
"product_extension": "node",
"sources": [
"src/utils/fast_buffer.cpp",
... | Python | 0 | @@ -200,24 +200,59 @@
le_module%22,%0A
+%09%09%09%22win_delay_load_hook%22: %22false%22,%0A
%09%09%09%22product_
|
b2e7eeafb263c12a333056e6a8239d2534833a22 | Allow specifying --couchbase-root | binding.gyp | binding.gyp | {
'targets': [{
'target_name': 'couchbase_impl',
'defines': ['LCBUV_EMBEDDED_SOURCE'],
'conditions': [
[ 'OS=="win"', {
'variables': {
'couchbase_root%': 'C:/couchbase'
},
'include_dirs': [
'<(couchbase_root)/include/',
],
'link_settings': ... | Python | 0 | @@ -975,32 +975,105 @@
%5B'OS!=%22win%22', %7B%0A
+ 'variables' : %7B%0A 'couchbase_root%25' : '%22%22'%0A %7D,%0A%0A
'link_se
@@ -2189,24 +2189,41 @@
'./',%0A
+ './src/io'%0A
%5D,%0A %7D%5D%0A
|
c91147dee9d9910cfc8e6c2e078d388f19d6ab1e | fix build error in FreeBSD (#25) | binding.gyp | binding.gyp | {
"targets": [{
"target_name": "node_snap7",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"./src"
],
"sources": [
"./src/node_snap7.cpp",
"./src/node_snap7_client.cpp",
"./src/node_snap7_server.cpp",
"./sr... | Python | 0 | @@ -1523,16 +1523,33 @@
='linux'
+ or OS=='freebsd'
%22, %7B%0A
|
95bde4f783a4d11627d8bc64e24b383e945bdf01 | Revert local CDN location set by Jodok | src/web/tags.py | src/web/tags.py | # -*- coding: utf-8 -*-
# vim: set fileencodings=utf-8
__docformat__ = "reStructuredText"
import json
import datetime
from django.template.base import Library
from django.utils.safestring import mark_safe
register = Library()
#CDN_URL = 'https://cdn.crate.io'
CDN_URL = 'http://localhost:8001'
def media(context, m... | Python | 0 | @@ -224,17 +224,16 @@
rary()%0A%0A
-#
CDN_URL
@@ -260,42 +260,8 @@
.io'
-%0ACDN_URL = 'http://localhost:8001'
%0A%0Ade
|
06f328b5843d83946b353697745ec82c7741ee3e | Allow colons in record label URLs (for timestamps such as '2013-02-13_08:42:00'). | src/web/urls.py | src/web/urls.py | """
Define URL dispatching for the Sumatra web interface.
"""
from django.conf.urls.defaults import *
from django.views.generic import list_detail
from django.conf import settings
from sumatra.web.views import Timeline
P = {
'project': r'(?P<project>\w+[\w ]*)',
'label': r'(?P<label>\w+[\w|\-\.]*)',
}
urlpat... | Python | 0.000007 | @@ -298,16 +298,17 @@
%5B%5Cw%7C%5C-%5C.
+:
%5D*)',%0A%7D%0A
@@ -1298,12 +1298,13 @@
': True%7D),%0A)
+%0A
|
07c4b2cc8ea3da02ae88c8ee5df8d211c775ad87 | fix minor issues | juliet/builder.py | juliet/builder.py | #!/usr/bin/python3
import os, logging, shutil
from distutils.dir_util import copy_tree
from jinja2 import Template, FileSystemLoader
from juliet import paths
class Builder:
def __init__(self, jinja_env, build_args, src, dest, noclean):
""" Constructor for class Builder. Takes a jinja Environment and the
... | Python | 0.000024 | @@ -1983,22 +1983,20 @@
-assets
+data
_path =
@@ -2031,19 +2031,61 @@
ths.
-ASSET
+THEME
S_PATH
+, self.build_args%5B%22site%22%5D%5B%22theme%22%5D, %22data%22
)%0A
@@ -2082,36 +2082,38 @@
%22data%22)%0A
-data
+assets
_path = os.path.
@@ -2140,64 +2140,66 @@
ths.
-THEME
+ASSET
S_PATH
-, sel... |
10f787963b82422abd47b167b6b3ec9e40842e29 | update check_online | fabfile/hadoop.py | fabfile/hadoop.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import os
import yaml
from fabric.api import task, run, sudo, put, task, \
parallel, execute, env
from cuisine import file_exists, file_write, file_append, \
text_strip_margin, mode_sudo, file_update, ssh_keygen, \
ssh_... | Python | 0.000002 | @@ -5697,75 +5697,8 @@
):%0A%0A
- sudo('cat .ssh/authorized_keys %3E /root/.ssh/authorized_keys')%0A%0A
|
977481ed9fab0eb703fe721b25702bba9c53223b | test update sites | fabfile/hadoop.py | fabfile/hadoop.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import yaml
from fabric.api import task, run, sudo, put, task, \
parallel, execute, env
from cuisine import file_exists, file_write, file_append, \
text_strip_margin, mode_sudo, file_update
@task
def install():
yml_path ... | Python | 0 | @@ -993,42 +993,93 @@
-@parallel%0A execute(file_update,
+execute(update_env_sh,hosts=hosts)%0A%0A@task%0A@parallel%0Adef update_env_sh():%0A%0A file =
'/us
@@ -1110,17 +1110,44 @@
-env.sh'
-,
+%0A file_update(file, _sub_
update_e
@@ -1155,27 +1155,20 @@
v_sh
-,hosts=hosts
)%0A%0Adef
+_sub_
upda
|
5baa2075d7f12d5123542dca31f430e7e112631b | test update sites | fabfile/hadoop.py | fabfile/hadoop.py | #!/usr/bin/env python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import yaml
from fabric.api import task, run, sudo, put, task, \
parallel, execute, env
from cuisine import file_exists, file_write, file_append, \
text_strip_margin, mode_sudo
@task
def install():
yml_path = __file__.re... | Python | 0 | @@ -763,24 +763,131 @@
osts=hosts)%0A
+ sites = %5B'core-site',%0A 'hdfs-site',%0A 'mapred-site'%5D%0A for site in sites:%0A
execute(
@@ -909,27 +909,20 @@
fg_name=
-'core-
site
-'
,cfg_lis
@@ -927,27 +927,20 @@
ist=cfg%5B
-'core-
site
-'
%5D,hosts=
|
485a363cf0ff10b0c4a3b4836e629474791f5374 | remove intermediate assignments to `text_width` | ftfy/formatting.py | ftfy/formatting.py | from unicodedata import east_asian_width, combining, category, normalize
def character_width(char):
"""
Determine the width that a character is likely to be displayed as in
a monospaced terminal. The width will always be 0, 1, or 2.
We are assuming that the character will appear in a modern, Unicode-... | Python | 0.000316 | @@ -3645,48 +3645,8 @@
1%22)%0A
- text_width = monospaced_width(text)%0A
@@ -3666,34 +3666,46 @@
(0, width -
-text_width
+monospaced_width(text)
)%0A return
@@ -4548,48 +4548,8 @@
1%22)%0A
- text_width = monospaced_width(text)%0A
@@ -4569,34 +4569,46 @@
(0, width -
-text_width
+monospaced_wi... |
a1cbeb7f7a03d0618ec9f60f65308168e521af18 | Add encodings for imul instructions to RISC-V. | meta/isa/riscv/encodings.py | meta/isa/riscv/encodings.py | """
RISC-V Encodings.
"""
from __future__ import absolute_import
from cretonne import base
from .defs import RV32, RV64
from .recipes import OPIMM, OPIMM32, OP, OP32, R, Rshamt, I
# Basic arithmetic binary instructions are encoded in an R-type instruction.
for inst, inst_imm, f3, f7 in [
(bas... | Python | 0.000003 | @@ -172,16 +172,44 @@
shamt, I
+%0Afrom .settings import use_m
%0A%0A# Basi
@@ -1785,20 +1785,301 @@
t, OPIMM32(f3, f7))%0A
+%0A# %22M%22 Standard Extension for Integer Multiplication and Division.%0A# Gated by the %60use_m%60 flag.%0ARV32.enc(base.imul.i32, R, OP(0b000, 0b0000001), isap=use_m)%0ARV64.enc(base.imul.... |
baea8c22208ea26c7ed59d82caed3fa9def4e699 | Version 1.1.0 | fedora/release.py | fedora/release.py | '''
Information about this python-fedora release
'''
NAME = 'python-fedora'
VERSION = '1.0.0'
DESCRIPTION = 'Python modules for interacting with Fedora Services'
LONG_DESCRIPTION = '''
The Fedora Project runs many different services. These services help us to
package software, develop new programs, and generally put... | Python | 0 | @@ -84,17 +84,17 @@
ON = '1.
-0
+1
.0'%0ADESC
|
a639e3cd15d52947bba44c0efa0f96a4247d961a | Change Lines import to lace | blmath/geometry/primitives/polyline.py | blmath/geometry/primitives/polyline.py | import numpy as np
from blmath.util.decorators import setter_property
class Polyline(object):
'''
Represent the geometry of a polygonal chain in 3-space. The
chain may be open or closed, and there are no constraints on the
geometry. For example, the chain may be simple or
self-intersecting, and the... | Python | 0 | @@ -1426,21 +1426,12 @@
rom
-bodylabs.mesh
+lace
.lin
|
8000607b4e0b4a65f020f233ed112f0554cc5d42 | remove fxn untested | database.py | database.py | from pymongo import MongoClient
from bson.objectid import ObjectId
from datetime import datetime
connection = MongoClient()
db = connection['database']
def create_student(student_name, student_email):
students = db['students']
if students.find_one({'student_email': student_email}) == None:
new_student... | Python | 0.000339 | @@ -2711,24 +2711,129 @@
t('_id')%7D%7D)%0A
+def delete_class(class_id):%0A classes = db%5B'classes'%5D%0A return classes.remove(%7B'_id': class_id%7D)%0A
%0Adef find_cl
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.