commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
94af46d678055a667220e1a28da509bf507c91dd | change version | docxxslt/__init__.py | docxxslt/__init__.py | import logging
from . import engines, package
__version__ = '0.1.0'
class DocxXsltTemplate(object):
"""Docx template renderer"""
main_document = 'word/document.xml'
def __init__(self, filename):
self.package = package.Package(filename)
self.package.read()
def save(self, filename=N... | import logging
from . import engines, package
__version__ = '0.0.2'
class DocxXsltTemplate(object):
"""Docx template renderer"""
main_document = 'word/document.xml'
def __init__(self, filename):
self.package = package.Package(filename)
self.package.read()
def save(self, filename=N... | Python | 0.000001 |
d23ffcf338162ad78c646a69f91e4ff36c894a05 | bump to 0.78.1 | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.78.1"
def _generate_version(base_version):
"""Generate a versio... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.78.0"
def _generate_version(base_version):
"""Generate a versio... | Python | 0.000007 |
43a833dec24f4e0a7dc1d8494a5ad1b44113db15 | bump to 0.40.0 | dvc/version.py | dvc/version.py | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.40.0"
def _generate_version(base_version):
"""Generate a versio... | # Used in setup.py, so don't pull any additional dependencies
#
# Based on:
# - https://github.com/python/mypy/blob/master/mypy/version.py
# - https://github.com/python/mypy/blob/master/mypy/git.py
import os
import subprocess
_BASE_VERSION = "0.35.7"
def _generate_version(base_version):
"""Generate a versio... | Python | 0.000005 |
df26ac758c6a38f2e0128e3511db009f0764947f | Bump version to 2.0.0b6 | pyquil/__init__.py | pyquil/__init__.py | __version__ = "2.0.0b6"
from pyquil.quil import Program
from pyquil.api import list_quantum_computers, get_qc
| __version__ = "2.0.0b6.dev0"
from pyquil.quil import Program
from pyquil.api import list_quantum_computers, get_qc
| Python | 0 |
77db5c329dff3e76284efd5f7a70e993ca35e9a6 | correct filters to find users | corehq/apps/users/management/commands/add_multi_location_property.py | corehq/apps/users/management/commands/add_multi_location_property.py | from django.core.management.base import BaseCommand
from corehq.apps.es import filters, UserES, users as user_filters
from corehq.apps.users.models import CouchUser
from corehq.apps.users.util import user_location_data
from corehq.util.couch import iter_update, DocUpdate
from corehq.util.log import with_progress_bar
... | from django.core.management.base import BaseCommand
from corehq.apps.es import UserES, users as user_filters
from corehq.apps.users.models import CouchUser
from corehq.apps.users.util import user_location_data
from corehq.util.couch import iter_update, DocUpdate
from corehq.util.log import with_progress_bar
class Co... | Python | 0.000002 |
d7c5ca1a627ef1c31ffddba06cce63da768954ec | Use logging instead of print | pystatsd/statsd.py | pystatsd/statsd.py | # statsd.py
# Steve Ivy <steveivy@gmail.com>
# http://monkinetic.com
import logging
import socket
import random
# Sends statistics to the stats daemon over UDP
class Client(object):
def __init__(self, host='localhost', port=8125):
"""
Create a new Statsd client.
* host: the host wher... | # statsd.py
# Steve Ivy <steveivy@gmail.com>
# http://monkinetic.com
import socket
import random
# Sends statistics to the stats daemon over UDP
class Client(object):
def __init__(self, host='localhost', port=8125):
"""
Create a new Statsd client.
* host: the host where statsd is lis... | Python | 0.000001 |
45807fba2127612f2e7083250bf87720acc511c0 | Define codename for editor. | plugin/floo/editor.py | plugin/floo/editor.py | import sys
from collections import defaultdict
import time
import vim
try:
from .common import shared as G
from .common import msg
except (ImportError, ValueError):
import common.shared as G
from common import msg
timeouts = defaultdict(list)
top_timeout_id = 0
cancelled_timeouts = set()
calling_tim... | import sys
from collections import defaultdict
import time
import vim
try:
from .common import shared as G
from .common import msg
except (ImportError, ValueError):
import common.shared as G
from common import msg
timeouts = defaultdict(list)
top_timeout_id = 0
cancelled_timeouts = set()
calling_tim... | Python | 0.000001 |
eed8d2b6da6e812cf50f83cf6776c8f0fe63d0f2 | correct naming of services | restservice/__init__.py | restservice/__init__.py | SERVICE_CHOICES = ((u'f2dhis2', u'f2dhis2'),(u'generic_json', u'JSON POST'),
(u'generic_xml', u'XML POST'),)
| SERVICE_CHOICES = ((u'f2dhis2', u'f2dhis2'),(u'json', u'json_exports'),(u'xml', u'xml_exports'),) | Python | 0.001925 |
700d7ad5a43e8483c11e19089636323c09879d80 | Add kwargs for __init__ | drivetestbed/http.py | drivetestbed/http.py | # mock http service that intercepts calls to allow Drive to work locally
import json
from urlparse import urlparse, parse_qs
from httplib2 import Response
from drivetestbed.services import ServiceDirectory
from routes import Mapper
class TestbedHttp(object):
def __init__(self, files=None, **kwargs):
self... | # mock http service that intercepts calls to allow Drive to work locally
import json
from urlparse import urlparse, parse_qs
from httplib2 import Response
from drivetestbed.services import ServiceDirectory
from routes import Mapper
class TestbedHttp(object):
def __init__(self, files=None):
self._services... | Python | 0.000002 |
1ee501468b07951ccceb263f91d5624f679f0321 | Update outputs store setup | polyaxon_client/stores/stores/outputs_store.py | polyaxon_client/stores/stores/outputs_store.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from polyaxon_client.stores.exceptions import PolyaxonStoresException
from polyaxon_client.stores.stores.base_store import Store
class OutputsStore(object):
"""
A convenient class to store experiment/job outputs to a giv... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from polyaxon_client.stores.exceptions import PolyaxonStoresException
from polyaxon_client.stores.stores.base_store import Store
class OutputsStore(object):
"""
A convenient class to store experiment/job outputs to a giv... | Python | 0.000001 |
c37f1ca0f8fc73da95d32082ed8dfb8967e38a1c | Check status method | dvhb_hybrid/tests.py | dvhb_hybrid/tests.py | class BaseTestApi:
"""Base class to test API"""
API_KEY = 'API-KEY'
def __init__(self, client, user):
self.client = client
self.user = user
self.headers = {'content-type': 'application/json'}
@staticmethod
async def check_status(result, response=HTTPOk):
assert resu... | class BaseTestApi:
"""Base class to test API"""
API_KEY = 'API-KEY'
def __init__(self, client, user):
self.client = client
self.user = user
self.headers = {'content-type': 'application/json'}
@staticmethod
async def prepare_result(r):
data = None
if 'applica... | Python | 0.000001 |
2acc441e70d67d035d7e1363ae8987e3117cb9ac | Rebuild FOV map rather than recreate it | roglick/systems/view.py | roglick/systems/view.py | from roglick.lib import libtcod
from roglick.engine import event
from roglick.engine.ecs import System
from roglick.components import PositionComponent,FoVComponent
from roglick.events import NewMapEvent,MapChangedEvent
class FoVSystem(System):
def __init__(self):
self._fov_algo = 0
self._light_wa... | from roglick.lib import libtcod
from roglick.engine import event
from roglick.engine.ecs import System
from roglick.components import PositionComponent,FoVComponent
from roglick.events import NewMapEvent,MapChangedEvent
class FoVSystem(System):
def __init__(self):
self._fov_algo = 0
self._light_wa... | Python | 0 |
2641b64a712b3e766448d93cd11c097aa90cfdc5 | apply comments (def set_... --> def ...) | rootpy/plotting/func.py | rootpy/plotting/func.py | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
from .. import QROOT
from ..decorators import snake_case_methods
from .base import Plottable
from ..base import NameOnlyObject
__all__ = [
'F1',
'F2',
'F3',
]
cla... | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from __future__ import absolute_import
from .. import QROOT
from ..decorators import snake_case_methods
from .base import Plottable
from ..base import NameOnlyObject
__all__ = [
'F1',
'F2',
'F3',
]
cla... | Python | 0.000002 |
b14de33367ddf82d39ee5fe1671bc2526a5280b6 | correct module version | pos_mobile_restaurant/__manifest__.py | pos_mobile_restaurant/__manifest__.py | {
"name": """POS Mobile UI for Waiters""",
"summary": """Your Restaurant in the Mobile Version""",
"category": "Point of Sale",
"live_test_url": "http://apps.it-projects.info/shop/product/pos-mobile-ui?version=11.0",
"images": ["images/pos_mobile_restaurant.png"],
"version": "11.0.1.3.8",
"a... | {
"name": """POS Mobile UI for Waiters""",
"summary": """Your Restaurant in the Mobile Version""",
"category": "Point of Sale",
"live_test_url": "http://apps.it-projects.info/shop/product/pos-mobile-ui?version=11.0",
"images": ["images/pos_mobile_restaurant.png"],
"version": "10.0.1.3.8",
"a... | Python | 0 |
99bb951cbbb670edb3d3361cc12a60f3cb04387d | correction to inf. probability | ndlib/models/epidemics/SIRModel.py | ndlib/models/epidemics/SIRModel.py | from ..DiffusionModel import DiffusionModel
import numpy as np
import networkx as nx
import future.utils
__author__ = "Giulio Rossetti"
__license__ = "BSD-2-Clause"
__email__ = "giulio.rossetti@gmail.com"
class SIRModel(DiffusionModel):
"""
Model Parameters to be specified via ModelConfig
:param b... | from ..DiffusionModel import DiffusionModel
import numpy as np
import networkx as nx
import future.utils
__author__ = "Giulio Rossetti"
__license__ = "BSD-2-Clause"
__email__ = "giulio.rossetti@gmail.com"
class SIRModel(DiffusionModel):
"""
Model Parameters to be specified via ModelConfig
:param b... | Python | 0.999999 |
669fa4443e9e4b551613ac1bb6b69c8818f382fc | Fix tweet format | twiboozer.py | twiboozer.py | # -*- encoding: utf-8 -*-
# TODO вынести, оформить как package
import os
import datetime
import random
import textwrap
from pymarkovchain import MarkovChain
from twibot import TwiBot
def format_tweet(tweet):
"""Format tweet after generation."""
max_len = 140
if len(tweet) > max_len:
tweet = te... | # -*- encoding: utf-8 -*-
# TODO вынести, оформить как package
import os
import datetime
import random
import textwrap
from pymarkovchain import MarkovChain
from twibot import TwiBot
def format_tweet(tweet):
"""Format tweet after generation."""
if tweet[-1] not in ".?!":
tweet = "{0}{1}".format(tw... | Python | 0.999999 |
ef1248dc4e150e72b9a347120f73b01909ff7522 | remove site requirement in pages app | pages/views.py | pages/views.py | from auslan.pages.models import Page
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from django.utils.safe... | from auslan.pages.models import Page
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from django.utils.safe... | Python | 0 |
39d1217643ab67b1ef3931fc5a21d32d663fb5a0 | update min versions #35732 (#35733) | pandas/compat/_optional.py | pandas/compat/_optional.py | import distutils.version
import importlib
import types
import warnings
# Update install.rst when updating versions!
VERSIONS = {
"bs4": "4.6.0",
"bottleneck": "1.2.1",
"fsspec": "0.7.4",
"fastparquet": "0.3.2",
"gcsfs": "0.6.0",
"lxml.etree": "4.3.0",
"matplotlib": "2.2.3",
"numexpr": ... | import distutils.version
import importlib
import types
import warnings
# Update install.rst when updating versions!
VERSIONS = {
"bs4": "4.6.0",
"bottleneck": "1.2.1",
"fsspec": "0.7.4",
"fastparquet": "0.3.2",
"gcsfs": "0.6.0",
"lxml.etree": "3.8.0",
"matplotlib": "2.2.2",
"numexpr": ... | Python | 0 |
3b3418592331059f560bb641704a184d64734fc7 | fix evals | rubberband/constants.py | rubberband/constants.py | INFINITY_KEYS = ("separating/flowcover/maxslackroot", "separating/flowcover/maxslack",
"heuristics/undercover/maxcoversizeconss")
INFINITY_MASK = -1
ZIPPED_SUFFIX = ".gz"
FILES_DIR = "files/"
STATIC_FILES_DIR = FILES_DIR + "static/"
ALL_SOLU = STATIC_FILES_DIR + "all.solu"
IPET_EVALUATIONS = {
... | INFINITY_KEYS = ("separating/flowcover/maxslackroot", "separating/flowcover/maxslack",
"heuristics/undercover/maxcoversizeconss")
INFINITY_MASK = -1
ZIPPED_SUFFIX = ".gz"
FILES_DIR = "files/"
STATIC_FILES_DIR = FILES_DIR + "static/"
ALL_SOLU = STATIC_FILES_DIR + "all.solu"
IPET_EVALUATIONS = {
... | Python | 0.000003 |
9011b359bdf164994734f8d6890a2d5acb5fa865 | Replace joins with list_to_number in 32 | project_euler/solutions/problem_32.py | project_euler/solutions/problem_32.py | from itertools import permutations
from ..library.base import list_to_number
def solve() -> int:
pandigital = []
for permutation in permutations(range(1, 10)):
result = list_to_number(permutation[:4])
for i in range(1, 4):
left = list_to_number(permutation[4:4 + i])
... | from itertools import permutations
def solve() -> int:
pandigital = []
for permutation in permutations(range(1, 10)):
result = int(''.join(str(digit) for digit in permutation[:4]))
for i in range(1, 4):
left = int(''.join(str(digit) for digit in permutation[4:4 + i]))
... | Python | 0.001525 |
dc333069f4536fdc978d76924b098d10a1a8a50a | Fix error on status for last line in file. | ruby_coverage_status.py | ruby_coverage_status.py | import os
import sublime
import sublime_plugin
import json
import re
from .common.json_coverage_reader import JsonCoverageReader
STATUS_KEY = 'ruby-coverage-status'
class RubyCoverageStatusListener(sublime_plugin.EventListener):
"""Show coverage statistics in status bar."""
def on_load(self, view):
... | import os
import sublime
import sublime_plugin
import json
import re
from .common.json_coverage_reader import JsonCoverageReader
STATUS_KEY = 'ruby-coverage-status'
class RubyCoverageStatusListener(sublime_plugin.EventListener):
"""Show coverage statistics in status bar."""
def on_load(self, view):
... | Python | 0 |
921bdcc5d6f6ac4be7dfd0015e5b5fd6d06e6486 | Raise exception when --debug is specified to main script | runcommands/__main__.py | runcommands/__main__.py | import sys
from .config import RawConfig, RunConfig
from .exc import RunCommandsError
from .run import run, partition_argv, read_run_args
from .util import printer
def main(argv=None):
debug = None
try:
all_argv, run_argv, command_argv = partition_argv(argv)
cli_args = run.parse_args(RawConfi... | import sys
from .config import RawConfig, RunConfig
from .exc import RunCommandsError
from .run import run, partition_argv, read_run_args
from .util import printer
def main(argv=None):
try:
all_argv, run_argv, command_argv = partition_argv(argv)
cli_args = run.parse_args(RawConfig(run=RunConfig()... | Python | 0 |
5ca0e0683a663271c40d728e5f88ee19a26eca61 | Add ProfileSummary to defaults | devserver/settings.py | devserver/settings.py | DEVSERVER_MODULES = (
'devserver.modules.sql.SQLRealTimeModule',
'devserver.modules.profile.ProfileSummaryModule',
# 'devserver.modules.cache.CacheSummaryModule',
)
# This variable gets set to True when we're running the devserver
DEVSERVER_ACTIVE = False | DEVSERVER_MODULES = (
'devserver.modules.sql.SQLRealTimeModule',
'devserver.modules.cache.CacheSummaryModule',
)
# This variable gets set to True when we're running the devserver
DEVSERVER_ACTIVE = False | Python | 0 |
75ac453e873727675ba18e1f45b5bc0cfda26fd7 | Increment the version number | angel/__init__.py | angel/__init__.py | __title__ = 'angel'
__version__ = '0.0.2'
__author__ = 'Bugra Akyildiz'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 Bugra Akyildiz'
| __title__ = 'angel'
__version__ = '0.0.1'
__author__ = 'Bugra Akyildiz'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 Bugra Akyildiz'
| Python | 0.999999 |
c39d6494d1bc27dedb2141970cdd7a51382f0af4 | Update version 0.5.0.dev1 -> 0.5.0 | dimod/package_info.py | dimod/package_info.py | __version__ = '0.5.0'
__author__ = 'D-Wave Systems Inc.'
__authoremail__ = 'acondello@dwavesys.com'
__description__ = 'A shared API for binary quadratic model samplers.'
| __version__ = '0.5.0.dev1'
__author__ = 'D-Wave Systems Inc.'
__authoremail__ = 'acondello@dwavesys.com'
__description__ = 'A shared API for binary quadratic model samplers.'
| Python | 0 |
ff504057223cd71f8ebbb7e7a53dc7982a9422a8 | Add stream logger config convenience function | boto3/__init__.py | boto3/__init__.py | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Python | 0 |
c88d5b0935f9cba8b3d76face5cf40098ef5a87b | Move difference file to build directory | preprint/latexdiff.py | preprint/latexdiff.py | #!/usr/bin/env python
# encoding: utf-8
"""
Command for running latexdiff.
"""
import logging
import os
import subprocess
import codecs
import shutil
import git
from preprint.textools import inline, inline_blob, remove_comments
from preprint.gittools import read_git_blob
from cliff.command import Command
class Dif... | #!/usr/bin/env python
# encoding: utf-8
"""
Command for running latexdiff.
"""
import logging
import os
import subprocess
import codecs
import git
from preprint.textools import inline, inline_blob, remove_comments
from preprint.gittools import read_git_blob
from cliff.command import Command
class Diff(Command):
... | Python | 0 |
3e6508e4036def376f1a41943499a30f034e665c | Fix __sub__ | rwrtrack/core/record.py | rwrtrack/core/record.py | from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import aliased
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.ext.hybrid import hybrid_property
from .db import DeclarativeBase, sesh
from .derivedstats import DerivedStats
from .exceptions import NoRecordError
class Record(... | from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import aliased
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.ext.hybrid import hybrid_property
from .db import DeclarativeBase, sesh
from .derivedstats import DerivedStats
from .exceptions import NoRecordError
class Record(... | Python | 0.00023 |
7b071f3ccacd87f6dcb0e9a570d8ce386dbf7a4f | change FULLNAME to AUTHOR_FULLNAME | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
AUTHOR_FULLNAME = u'Jon Chen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = './theme'
# plugins
PLUGIN_PATH = './plugins'
PLU... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'jchen'
FULLNAME = u'Jon Chen'
SITENAME = u'BURRITO 4 LYFE'
SITEURL = ''
TIMEZONE = 'ETC/UTC'
DEFAULT_LANG = u'en'
CSS_FILE = 'style.css'
# theme stuff
THEME = './theme'
# plugins
PLUGIN_PATH = './plugins'
PLUGINS = ... | Python | 0.999663 |
a3c582df681aae77034e2db08999c89866cd6470 | Refactor earth mover's distance implementation | utilities.py | utilities.py | import collections
def each(function, iterable):
for item in iterable:
function(item)
def each_unpack(function, iterable):
for item in iterable:
function(*item)
def minmax(*args):
min = None
max = None
for x in args:
if max < x:
max = x
if x > min:
min = x
return min, max
... | import collections
def each(function, iterable):
for item in iterable:
function(item)
def each_unpack(function, iterable):
for item in iterable:
function(*item)
def minmax(*args):
min = None
max = None
for x in args:
if max < x:
max = x
if x > min:
min = x
return min, max
... | Python | 0 |
f7b964b2ce42d8c5cb6707cd571cca5eeadb2ff7 | Implement feedback on final state of firmware | confluent_server/confluent/firmwaremanager.py | confluent_server/confluent/firmwaremanager.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
#
# 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... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
#
# 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... | Python | 0 |
26cb100e7e4782cdc4d7a55f6a096a9da2db2b5c | fix bug 1495003: add search to GraphicsDeviceAdmin | webapp-django/crashstats/crashstats/admin.py | webapp-django/crashstats/crashstats/admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION
from crashstats.crashstats.models import (
GraphicsDevice,
Signature,
)
# Fix the Django Admin User list display so it shows the columns we care about
... | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION
from crashstats.crashstats.models import (
GraphicsDevice,
Signature,
)
# Fix the Django Admin User list display so it shows the columns we care about
... | Python | 0 |
0d2079b1dcb97708dc55c32d9e2c1a0f12595875 | Replace string substitution with string formatting | salt/runners/launchd.py | salt/runners/launchd.py | # -*- coding: utf-8 -*-
'''
Manage launchd plist files
'''
# Import python libs
import os
import sys
def write_launchd_plist(program):
'''
Write a launchd plist for managing salt-master or salt-minion
CLI Example:
.. code-block:: bash
salt-run launchd.write_launchd_plist salt-master
''... | # -*- coding: utf-8 -*-
'''
Manage launchd plist files
'''
# Import python libs
import os
import sys
def write_launchd_plist(program):
'''
Write a launchd plist for managing salt-master or salt-minion
CLI Example:
.. code-block:: bash
salt-run launchd.write_launchd_plist salt-master
''... | Python | 0.001018 |
d967505ea9db8af0286abe1959a8fcba556b2d7a | add setting the slave of a specified master on a sentinel | salt/states/redismod.py | salt/states/redismod.py | # -*- coding: utf-8 -*-
'''
Management of Redis server
==========================
.. versionadded:: 2014.7.0
:depends: - redis Python module
:configuration: See :py:mod:`salt.modules.redis` for setup instructions.
.. code-block:: yaml
key_in_redis:
redis.string:
- value: string data
The redis s... | # -*- coding: utf-8 -*-
'''
Management of Redis server
==========================
.. versionadded:: 2014.7.0
:depends: - redis Python module
:configuration: See :py:mod:`salt.modules.redis` for setup instructions.
.. code-block:: yaml
key_in_redis:
redis.string:
- value: string data
The redis s... | Python | 0.000001 |
a2fff1b9613d6c4349fea5001313bf9e0d1cc052 | remove unnecessary import | pergenie/lib/utils/demo.py | pergenie/lib/utils/demo.py | from uuid import uuid4
from datetime import timedelta
from django.utils import timezone
from django.conf import settings
from apps.authentication.models import User
from apps.genome.models import Genome
from lib.utils import clogging
log = clogging.getColorLogger(__name__)
# TODO: @transaction.atomic
def create_dem... | from uuid import uuid4
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from django.db import models, transaction
from django.utils import timezone
from django.conf import settings
from apps.authentication.models import User
from apps.genome.models import Genome
from li... | Python | 0.000037 |
a2a6b336295e65d29881e83ba45e1758c4582bbb | add available filters | corehq/apps/reports/standard/users/reports.py | corehq/apps/reports/standard/users/reports.py | from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from memoized import memoized
from corehq.apps.reports.datatables import DataTablesColumn, DataTablesHeader
from corehq.apps.reports.dispatcher import UserManagementReportDispatcher
from corehq.apps.reports.generic i... | from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from memoized import memoized
from corehq.apps.reports.datatables import DataTablesColumn, DataTablesHeader
from corehq.apps.reports.dispatcher import UserManagementReportDispatcher
from corehq.apps.reports.generic i... | Python | 0 |
e1f6e98d7e3a1840567b1b5e379f87ec1e0aa9dc | add two more views | connector8/__openerp__.py | connector8/__openerp__.py | # -*- coding: utf-8 -*-
{'name': 'Connector8',
'version': '0.1',
'author': 'Openerp Connector Core Editors and Amdeb',
'license': 'AGPL-3',
'category': 'Generic Modules',
'description': """
This is a port of OCA connector to Odoo 8.0
""",
'depends': ['mail'
],
'data': ['security/connector_security.... | # -*- coding: utf-8 -*-
{'name': 'Connector8',
'version': '0.1',
'author': 'Openerp Connector Core Editors and Amdeb',
'license': 'AGPL-3',
'category': 'Generic Modules',
'description': """
This is a port of OCA connector to Odoo 8.0
""",
'depends': ['mail'
],
'data': ['security/connector_security.... | Python | 0 |
7369244fbfcda67e1b14ebedd9fb9467fe5d8870 | Update module list wizard should not miss search view of Modules | bin/addons/base/module/wizard/wizard_update_module.py | bin/addons/base/module/wizard/wizard_update_module.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Python | 0 |
199f0f3e8e02f53f570e5463cc4350568771395f | Refactor tasks.py | edx_shopify/tasks.py | edx_shopify/tasks.py | from celery import Task
from celery.utils.log import get_task_logger
from .models import Order, OrderItem
from .utils import auto_enroll_email
logger = get_task_logger(__name__)
class ProcessOrder(Task):
"""Process a newly received order, and enroll learners in courses
using their email address.
On fai... | from celery import Task
from celery.utils.log import get_task_logger
from .models import Order, OrderItem
from .utils import auto_enroll_email
logger = get_task_logger(__name__)
class ProcessOrder(Task):
"""
Process order creation event.
"""
def run(self, data):
logger.debug('Processing ord... | Python | 0 |
fe96f6539b40a880e88f7efe8502279cea1de506 | update test | corehq/apps/accounting/tests/test_model_validation.py | corehq/apps/accounting/tests/test_model_validation.py | from datetime import date
from django.core.exceptions import ValidationError
from corehq.apps.accounting.models import (
BillingAccount,
CreditAdjustment,
Invoice,
LineItem,
Subscriber,
Subscription,
)
from corehq.apps.accounting.tests import generator
from corehq.apps.accounting.tests.base_te... | from datetime import date
from django.core.exceptions import ValidationError
from django.test import TransactionTestCase
from corehq.apps.accounting.models import (
BillingAccount,
CreditAdjustment,
Invoice,
LineItem,
Subscriber,
Subscription,
)
from corehq.apps.accounting.tests import generat... | Python | 0.000001 |
7c46287f7f7b0b18d671dc91e69668961c98adee | update test_flake8 | _unittests/ut_module/test_flake8.py | _unittests/ut_module/test_flake8.py | """
@brief test log(time=0s)
"""
import sys
import os
import unittest
import warnings
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if path not ... | """
@brief test log(time=0s)
"""
import sys
import os
import unittest
import warnings
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if path not ... | Python | 0.000001 |
c2f3ca6c2e3c2810b3c881e09cc613bfe15e598c | Fix up some small coding errors | alerts/geomodel_alert.py | alerts/geomodel_alert.py | #!/usr/bin/env python
# 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/.
# Copyright (c) 2015 Mozilla Corporation
import json
import os
import sys
import traceback
from... | #!/usr/bin/env python
# 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/.
# Copyright (c) 2015 Mozilla Corporation
import json
import os
import sys
import traceback
from... | Python | 0.999999 |
4f040d1d7730ee611f0c4a6768ecc181c6a43ff7 | Fix broken view test for select seats | karspexet/ticket/tests/test_views.py | karspexet/ticket/tests/test_views.py | # coding: utf-8
from django.shortcuts import reverse
from django.test import TestCase, RequestFactory
from django.utils import timezone
from karspexet.show.models import Show, Production
from karspexet.ticket import views
from karspexet.venue.models import Venue, SeatingGroup
import pytest
class TestHome(TestCase)... | # coding: utf-8
from django.shortcuts import reverse
from django.test import TestCase, RequestFactory
from django.utils import timezone
from karspexet.show.models import Show, Production
from karspexet.ticket import views
from karspexet.venue.models import Venue, SeatingGroup
import pytest
class TestHome(TestCase)... | Python | 0.000001 |
e57e4152229132c9a8a8a13bf0904b58f7edf6f8 | Update send_email.py | keepercommander/custom/send_email.py | keepercommander/custom/send_email.py | # _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2022 Keeper Security Inc.
# Contact: commander@keepersecurity.com
#
# Example code to run a BreachWatch status report for
# all users, and send users an email reminde... | # _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2022 Keeper Security Inc.
# Contact: commander@keepersecurity.com
#
# Example code to retrieve the password for a record
# stored in the vault. This example also pull... | Python | 0.000001 |
14f0ed32b62e2d00443e99428516a2d17a68bc58 | Use COMPLEX_TEST_STRING for testing | coalib/tests/processes/communication/LogMessageTest.py | coalib/tests/processes/communication/LogMessageTest.py | """
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT... | """
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT... | Python | 0.000001 |
7cbf46b1c44791b6a1466b08e049b568d32cf2d3 | fix soil.tests.test_download_base:TestBlobDownload | corehq/ex-submodules/soil/tests/test_download_base.py | corehq/ex-submodules/soil/tests/test_download_base.py | from __future__ import absolute_import
from __future__ import unicode_literals
from io import BytesIO
from uuid import uuid4
from django.test import TestCase
from soil import BlobDownload
from soil.util import expose_blob_download
from corehq.blobs.tests.util import new_meta, TemporaryFilesystemBlobDB
class TestBlo... | from __future__ import absolute_import
from __future__ import unicode_literals
from io import BytesIO
from uuid import uuid4
from django.test import TestCase
from soil import BlobDownload
from soil.util import expose_blob_download
from corehq.blobs.tests.util import new_meta, TemporaryFilesystemBlobDB
class TestBlo... | Python | 0.000001 |
b15450fb774b8c6dbb1b1c181555b29f5846bc40 | test mqttclient | ambulances/mqttupdate.py | ambulances/mqttupdate.py | import atexit, sys, os, time
from rest_framework.parsers import JSONParser
from rest_framework.renderers import JSONRenderer
from .mqttclient import BaseClient, MQTTException
from .models import client, Ambulance, Equipment, \
HospitalEquipment, Hospital
from .serializers import AmbulanceSerializer, HospitalSer... | import atexit, sys, os, time
from rest_framework.parsers import JSONParser
from rest_framework.renderers import JSONRenderer
from .mqttclient import BaseClient, MQTTException
from .models import client, Ambulance, Equipment, \
HospitalEquipment, Hospital
from .serializers import AmbulanceSerializer, HospitalSer... | Python | 0.000001 |
c3367eaa7bccf5843abd12a438e14518d533cdbe | Allow API on Windows | platformio_api/__init__.py | platformio_api/__init__.py | # Copyright 2014-present Ivan Kravets <me@ikravets.com>
#
# 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... | # Copyright 2014-present Ivan Kravets <me@ikravets.com>
#
# 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... | Python | 0.000001 |
7169cbb9aff103854cad7e8167446c56c7bcc5f4 | Revise to internal helper function _findKth() | lc004_median_of_two_sorted_arrays.py | lc004_median_of_two_sorted_arrays.py | """Leetcode 4. Median of Two Sorted Arrays
Hard
There are two sorted arrays nums1 and nums2 of size m and n respectively.
Find the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n)).
You may assume nums1 and nums2 cannot be both empty.
Example 1:
nums1 = [1, 3]
nums2 = [2]
The ... | """Leetcode 4. Median of Two Sorted Arrays
Hard
There are two sorted arrays nums1 and nums2 of size m and n respectively.
Find the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n)).
You may assume nums1 and nums2 cannot be both empty.
Example 1:
nums1 = [1, 3]
nums2 = [2]
The ... | Python | 0.000804 |
dc743c63c52c7ef0bcab73d7b4fcf8f3f4a54ea6 | make median transmittance optional in plot_mean_transmittance. | plot_mean_transmittance.py | plot_mean_transmittance.py | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
import common_settings
import mean_transmittance
import median_transmittance
lya_center = 1215.67
settings = common_settings.Settings()
enable_median_transmittance = False
def do_plot():
m = mean_transmittance.MeanTransmittance.fr... | import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import host_subplot
import common_settings
import mean_transmittance
import median_transmittance
lya_center = 1215.67
settings = common_settings.Settings()
def do_plot():
m = mean_transmittance.MeanTransmittance.from_file(settings.get_mean_transmitta... | Python | 0.000001 |
4173221d72356fc336be63273a7252c81831fd54 | fix datetime_to_string | ephim/utils.py | ephim/utils.py | from datetime import datetime
import string
def to_base(num, b, numerals=string.digits + string.ascii_lowercase):
return ((num == 0) and numerals[0]) or (to_base(num // b, b, numerals).lstrip(numerals[0]) + numerals[num % b])
def datetime_to_string(dt: datetime):
delta = dt - datetime.utcfromtimestamp(0)
... | from datetime import datetime
import string
def to_base(num, b, numerals=string.digits + string.ascii_lowercase):
return ((num == 0) and numerals[0]) or (to_base(num // b, b, numerals).lstrip(numerals[0]) + numerals[num % b])
def datetime_to_string(dt: datetime):
delta = dt - datetime.fromtimestamp(0)
... | Python | 0.004109 |
a4e14854339cc8f0677e32390d9a974266007c01 | Refactor, split into functions | django_smoke_tests/management/commands/smoke_tests.py | django_smoke_tests/management/commands/smoke_tests.py | import random
import string
from django.core.management import BaseCommand, call_command
try:
from django.urls import get_resolver
except ImportError:
from django.core.urlresolvers import get_resolver
from ...tests import SmokeTests
class Command(BaseCommand):
help = "Smoke"
METHODS_TO_TEST = ['GE... | from django.core.management import BaseCommand, call_command
try:
from django.urls import get_resolver
except ImportError:
from django.core.urlresolvers import get_resolver
from ...tests import SmokeTests
def _test_generator(url, method, detail_url=False):
def test(self):
if method == 'GET':
... | Python | 0.999773 |
f96cb9a60882bc19fef5f7b3be4a8063f2e99fa2 | Add exception handling to scheduler start experiment | api/spawner/scheduler.py | api/spawner/scheduler.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import logging
import uuid
from django.conf import settings
from kubernetes.client.rest import ApiException
from polyaxon_schemas.utils import TaskType
from rest_framework import fields
from api.utils import config
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import uuid
from django.conf import settings
from polyaxon_schemas.utils import TaskType
from rest_framework import fields
from api.utils import config
from experiments.serializers import ExperimentJobSerializer
fr... | Python | 0.000001 |
58ab8c5ebafad2109b8d8f19c44adbb11fe18c02 | Fix broken or_else implementation | pygow/maybe.py | pygow/maybe.py | class Just:
a = None
def __init__(self, a):
self.a = a
def __eq__(self, other):
return (isinstance(other, self.__class__)
and self.a == other.a)
def __ne__(self, other):
return not self.__eq__(other)
def __str__(self):
return 'Just(%s)' % self.a
def is... | class Just:
a = None
def __init__(self, a):
self.a = a
def __eq__(self, other):
return (isinstance(other, self.__class__)
and self.a == other.a)
def __ne__(self, other):
return not self.__eq__(other)
def __str__(self):
return 'Just(%s)' % self.a
def is... | Python | 0.000003 |
2aca9f77b6f5b8171ec33906a66cd805f57937a0 | Fix mistake with previous commit. | localeurl/templatetags/localeurl_tags.py | localeurl/templatetags/localeurl_tags.py | # Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
from django import template
from django.template import Node, Token, TemplateSyntaxError
from django.template import resolve_variable, defaulttags
from django.template.defaultfilters import stringfilter
from django.conf i... | # Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
from django import template
from django.template import Node, Token, TemplateSyntaxError
from django.template import resolve_variable, defaulttags
from django.template.defaultfilters import stringfilter
from django.conf i... | Python | 0.999999 |
f18d675f2877e8f9356dc64a96bf8fba364cddd3 | Add search field to admin Terms. | controlled_vocabularies/admin.py | controlled_vocabularies/admin.py | from django.contrib import admin
from django import forms
from controlled_vocabularies.models import Vocabulary, Term, Property
class PropertyInline(admin.TabularInline):
model = Property
fk_name = "term_key"
extra = 1
class VocabularyAdmin(admin.ModelAdmin):
""" Vocabulary class that determines how... | from django.contrib import admin
from django import forms
from controlled_vocabularies.models import Vocabulary, Term, Property
class PropertyInline(admin.TabularInline):
model = Property
fk_name = "term_key"
extra = 1
class VocabularyAdmin(admin.ModelAdmin):
""" Vocabulary class that determines how... | Python | 0 |
d68f3251c7605220da13a308ebc794a35a0c12e6 | This is 0.9.1 | rb/__init__.py | rb/__init__.py | """
rb
~~
The redis blaster.
:copyright: (c) 2015 Functional Software Inc.
:license: Apache License 2.0, see LICENSE for more details.
"""
from rb.cluster import Cluster
from rb.clients import RoutingClient, MappingClient, FanoutClient
from rb.router import BaseRouter, ConsistentHashingRouter, Par... | """
rb
~~
The redis blaster.
:copyright: (c) 2015 Functional Software Inc.
:license: Apache License 2.0, see LICENSE for more details.
"""
from rb.cluster import Cluster
from rb.clients import RoutingClient, MappingClient, FanoutClient
from rb.router import BaseRouter, ConsistentHashingRouter, Par... | Python | 0.999998 |
d3677042d17d3bc641c84981d5332f7fd0ddfe5d | Update process-schedules.py | cron/process-schedules.py | cron/process-schedules.py | #!/usr/bin/env python
import MySQLdb
#import datetime
#import urllib2
#import os
import datetime
servername = "localhost"
username = "pi"
password = "password"
dbname = "pi_heating_db"
now = datetime.datetime.now()
cnx = MySQLdb.connect(host=servername, user=username, passwd=password, db=dbname)
cursorselect = ... | #!/usr/bin/env python
import MySQLdb
#import datetime
#import urllib2
#import os
import datetime
servername = "localhost"
username = "pi"
password = "password"
dbname = "pi_heating_db"
now = datetime.datetime.now()
cnx = MySQLdb.connect(host=servername, user=username, passwd=password, db=dbname)
cursorselect = ... | Python | 0.000001 |
e60ce628029e3100d6f2a8a8f7260e2ed229e6ac | Add helper method to retrieve review count per user in a skeleton | django/applications/catmaid/control/review.py | django/applications/catmaid/control/review.py | from collections import defaultdict
from catmaid.models import Review
from django.db import connection
def get_treenodes_to_reviews(treenode_ids=None, skeleton_ids=None,
umap=lambda r: r):
""" Returns a dictionary that contains all reviewed nodes of the
passed <treenode_ids> and... | from collections import defaultdict
from catmaid.models import Review
def get_treenodes_to_reviews(treenode_ids=None, skeleton_ids=None,
umap=lambda r: r):
""" Returns a dictionary that contains all reviewed nodes of the
passed <treenode_ids> and/or <skeleton_ids> lists as keys. ... | Python | 0 |
a36a7a0eb6560156c5be6f0cc5523c17e79591e4 | fix import errors | deepchem/models/tests/test_normalizing_flow_pytorch.py | deepchem/models/tests/test_normalizing_flow_pytorch.py | """
Test for Pytorch Normalizing Flow model and its transformations
"""
import pytest
import numpy as np
import unittest
try:
import torch
from torch.distributions import MultivariateNormal
from deepchem.models.torch_models.layers import Affine
has_torch = True
except:
has_torch = False
@unittest.skipIf(... | """
Test for Pytorch Normalizing Flow model and its transformations
"""
import pytest
import numpy as np
import unittest
try:
import torch
from torch.distributions import MultivariateNormal
from deepchem.models.torch_models.normalizing_flows_pytorch import Affine
has_torch = True
except:
has_torch = False
... | Python | 0.000025 |
3dc54a1c845cf0b99fd0dfc6fd454659895ba888 | Fix import. | django_elasticsearch/contrib/restframework/__init__.py | django_elasticsearch/contrib/restframework/__init__.py | from rest_framework import VERSION
from django_elasticsearch.contrib.restframework.base import AutoCompletionMixin
if int(VERSION[0]) < 3:
from django_elasticsearch.contrib.restframework.restframework2 import IndexableModelMixin
from django_elasticsearch.contrib.restframework.restframework2 import Elasticsear... | from rest_framework import VERSION
from django_elasticsearch.contrib.restframework.restframework import AutoCompletionMixin
if int(VERSION[0]) < 3:
from django_elasticsearch.contrib.restframework.restframework2 import IndexableModelMixin
from django_elasticsearch.contrib.restframework.restframework2 import El... | Python | 0 |
03ee56092d7f258dd37016ac06b6daf2439811f3 | change article abstract count to limit to in_doaj only | portality/models/search.py | portality/models/search.py | from portality.dao import DomainObject
from portality.models.cache import Cache
from portality.models import Journal, Article
class JournalArticle(DomainObject):
__type__ = 'journal,article'
__readonly__ = True # TODO actually heed this attribute in all DomainObject methods which modify data
@classmetho... | from portality.dao import DomainObject
from portality.models.cache import Cache
from portality.models import Journal, Article
class JournalArticle(DomainObject):
__type__ = 'journal,article'
__readonly__ = True # TODO actually heed this attribute in all DomainObject methods which modify data
@classmetho... | Python | 0 |
df553c4e0c536f7deaa180076658ba61e3af66b6 | Rework parsers to use subparsers | refresh/cli.py | refresh/cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2013 Thanh Ha
#
# 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 wi... | # -*- coding: utf-8 -*-
'''
The MIT License (MIT)
Copyright (c) 2013 Thanh Ha
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 righ... | Python | 0 |
89dac8b14610f08b12db0ab6e00b7432b527fd89 | Remove trailing whitespace | python/balcaza/activity/local/text.py | python/balcaza/activity/local/text.py | from balcaza.t2types import *
from balcaza.t2activity import BeanshellCode
ByteArrayToString = BeanshellCode(
'''if ((bytes == void) || (bytes == null)) {
throw new RuntimeException("The 'bytes' parameter must be specified");
}
if (encoding == void) {
string = new String(bytes);
} else {
string = new String(bytes, ... | from balcaza.t2types import *
from balcaza.t2activity import BeanshellCode
ByteArrayToString = BeanshellCode(
'''if ((bytes == void) || (bytes == null)) {
throw new RuntimeException("The 'bytes' parameter must be specified");
}
if (encoding == void) {
string = new String(bytes);
} else {
string = new String(bytes, ... | Python | 0.999999 |
b324031ee683005be0307e3b323c4709ce3a01eb | Disable those new requirements because pip requires gcc to install them | python_apps/airtime_analyzer/setup.py | python_apps/airtime_analyzer/setup.py | from setuptools import setup
from subprocess import call
import sys
# Allows us to avoid installing the upstart init script when deploying airtime_analyzer
# on Airtime Pro:
if '--no-init-script' in sys.argv:
data_files = []
sys.argv.remove('--no-init-script') # super hax
else:
data_files = [('/etc/init', ... | from setuptools import setup
from subprocess import call
import sys
# Allows us to avoid installing the upstart init script when deploying airtime_analyzer
# on Airtime Pro:
if '--no-init-script' in sys.argv:
data_files = []
sys.argv.remove('--no-init-script') # super hax
else:
data_files = [('/etc/init', ... | Python | 0.000002 |
2c1811fad85d6bacf8d3fcaf1299994bfc5efb78 | Support serializer path instead of "self" keyword | drf_extra_fields/relations.py | drf_extra_fields/relations.py | from collections import OrderedDict
from django.utils.module_loading import import_string
from rest_framework.relations import PrimaryKeyRelatedField, SlugRelatedField
class PresentableRelatedFieldMixin(object):
def __init__(self, **kwargs):
self.presentation_serializer = kwargs.pop("presentation_seriali... | from collections import OrderedDict
from rest_framework.relations import PrimaryKeyRelatedField, SlugRelatedField
class PresentableRelatedFieldMixin(object):
def __init__(self, **kwargs):
self.presentation_serializer = kwargs.pop("presentation_serializer", None)
self.presentation_serializer_kwarg... | Python | 0 |
461b7c5bf5541fc3a56039d6756262d6b99e8428 | Add null count. | problem/column_explorer/column_explorer.py | problem/column_explorer/column_explorer.py | #! /usr/bin/env python3
# Copyright 2019 John Hanley.
#
# 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, modify, m... | #! /usr/bin/env python3
# Copyright 2019 John Hanley.
#
# 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, modify, m... | Python | 0.000001 |
f65c2466cf58c4024584423da3d927ad9522eec9 | Fix __repr__ if no person linked | indico/modules/events/contributions/models/persons.py | indico/modules/events/contributions/models/persons.py | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0.00004 |
2943d0f68340bc16ab29a42072751b263cf76192 | Fix deleting images/pages with a legacy mapping | indico/modules/events/layout/models/legacy_mapping.py | indico/modules/events/layout/models/legacy_mapping.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0.000006 |
272d40aa83a1adbb54ad129ce17790cc9301b6f7 | Set properties to the file. | lib/python/mod_python/FileSession.py | lib/python/mod_python/FileSession.py | #
# Copyright 2004 Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | #
# Copyright 2004 Apache Software Foundation
#
# 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 ... | Python | 0 |
86d088835a88c00af69090b6b7f1bae42ff5c09a | remove monetdb typo | lib/sqlalchemy/databases/__init__.py | lib/sqlalchemy/databases/__init__.py | # __init__.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__all__ = [
'sqlite', 'postgres', 'mysql', 'oracle', 'mssql', 'firebird',
'sybase', 'acc... | # __init__.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__all__ = [
'sqlite', 'postgres', 'mysql', 'oracle', 'mssql', 'firebird',
'sybase', 'acc... | Python | 0.999923 |
4dc1f2b85c7728102a6cc4b149fb5200a0ffa736 | Fix get_user_command to comply with new AirWatch logic TelekomLabs-DCO-1.1-Signed-off-by: Łukasz Biernot <lukasz.biernot@gmail.com> (github: ElmoVanKielmo) | src/tenants/management/commands/get_user.py | src/tenants/management/commands/get_user.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs)
#
# 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/lice... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs)
#
# 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/lice... | Python | 0 |
71b2fcdd85187520a38ead5736d1b64b1e69afa4 | Fix hedu enrolled, entrant and graduate columns | app/models/hedu.py | app/models/hedu.py | from sqlalchemy import Column, Integer, String, func
from app import db
class Hedu(db.Model):
__tablename__ = 'hedu'
year = Column(Integer, primary_key=True)
region = Column(String(1), primary_key=True)
mesoregion = Column(String(4), primary_key=True)
... | from sqlalchemy import Column, Integer, String, func
from app import db
class Hedu(db.Model):
__tablename__ = 'hedu'
year = Column(Integer, primary_key=True)
region = Column(String(1), primary_key=True)
mesoregion = Column(String(4), primary_key=True)
... | Python | 0.000001 |
4956868cd605faa085ae2fc4ab44076760a4fd80 | Add some more auto_meta tests | metafunctions/tests/test_pipe.py | metafunctions/tests/test_pipe.py | import operator
import unittest
from metafunctions.tests.util import BaseTestCase
from metafunctions.decorators import pipe_node
class TestIntegration(BaseTestCase):
def test_basic_usage(self):
self.assertEqual(a('_'), '_a')
def test_wraps(self):
@pipe_node
def d():
'a do... | import operator
import unittest
from metafunctions.tests.util import BaseTestCase
from metafunctions.decorators import pipe_node
class TestUnit(BaseTestCase):
def test_basic_usage(self):
self.assertEqual(a('_'), '_a')
def test_wraps(self):
@pipe_node
def d():
'a docstring... | Python | 0 |
a4f475245c3af8470337fe0c25b136e58189a607 | Update griddy to use CoordinatorEntity (#39392) | homeassistant/components/griddy/sensor.py | homeassistant/components/griddy/sensor.py | """Support for August sensors."""
import logging
from homeassistant.const import ENERGY_KILO_WATT_HOUR
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import CONF_LOADZONE, DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass, config_entry, async_add_enti... | """Support for August sensors."""
import logging
from homeassistant.const import ENERGY_KILO_WATT_HOUR
from homeassistant.helpers.entity import Entity
from .const import CONF_LOADZONE, DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up th... | Python | 0 |
8021b027ae4a617712741d1e9a0668817bad9193 | Fix import | experiments/tests/test_admin.py | experiments/tests/test_admin.py | from __future__ import absolute_import
import json
from django.contrib.auth.models import User, Permission
from django.urls import reverse import reverse
from django.test import TestCase
from experiments.models import Experiment, CONTROL_STATE, ENABLED_STATE
from experiments.utils import participant
class AdminTest... | from __future__ import absolute_import
import json
from django.contrib.auth.models import User, Permission
from django.core.urlresolvers import reverse
from django.test import TestCase
from experiments.models import Experiment, CONTROL_STATE, ENABLED_STATE
from experiments.utils import participant
class AdminTestCa... | Python | 0.000002 |
86679c5b1a31d9125ebc3f55785cb9219e41ed27 | Add mechanism to validate backends against buckets | edgedb/lang/common/buckets.py | edgedb/lang/common/buckets.py | ##
# Copyright (c) 2012, 2013 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
import weakref
from metamagic.utils import abc, config
class BucketMeta(abc.AbstractMeta, config.ConfigurableMeta):
def __new__(mcls, name, bases, dct):
cls = super().__new__(mcls, name, bases, dct)
... | ##
# Copyright (c) 2012, 2013 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
import weakref
from metamagic.utils import abc, config
class BucketMeta(abc.AbstractMeta, config.ConfigurableMeta):
def __new__(mcls, name, bases, dct):
cls = super().__new__(mcls, name, bases, dct)
... | Python | 0.000002 |
331f5b0a951e13f816e752609ac348df272e1b1e | Update conf_template.py | docs/conf_template.py | docs/conf_template.py | # Statement for enabling the development environment
DEBUG = True
# Define the application directory
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# Define the database - we are working with
# SQLite for this example
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'app.db')
DATABASE_... | # Statement for enabling the development environment
DEBUG = True
# Define the application directory
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# Define the database - we are working with
# SQLite for this example
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'app.db')
DATABASE_... | Python | 0.000002 |
67f9a47c3476c189543bffba369d791035e0f159 | add per-link logs | empower/apps/survey/survey.py | empower/apps/survey/survey.py | #!/usr/bin/env python3
#
# Copyright (c) 2016 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | #!/usr/bin/env python3
#
# Copyright (c) 2016 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | Python | 0.000001 |
dc7158048d491e28322af443c7918ffd0de0d22d | Use logger instead of stdout and stderr | speeches/management/import_commands.py | speeches/management/import_commands.py | import logging
import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from instances.models import Instance
logger = logging.getLogger(__name__)
class ImportCommand(BaseCommand):
importer_class = None
document_extension = ''
option_list = BaseComm... | import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from instances.models import Instance
class ImportCommand(BaseCommand):
importer_class = None
document_extension = ''
option_list = BaseCommand.option_list + (
make_option('--commit', ac... | Python | 0.000019 |
fe56573f318578b6359d06d0454af6992f344c20 | load optimizer from config | hypergan/trainers/simultaneous_trainer.py | hypergan/trainers/simultaneous_trainer.py | import numpy as np
import torch
import hyperchamber as hc
import inspect
from hypergan.gan_component import ValidationException, GANComponent
from hypergan.trainers.base_trainer import BaseTrainer
from hypergan.optimizers.adamirror import Adamirror
TINY = 1e-12
class SimultaneousTrainer(BaseTrainer):
""" Steps G... | import numpy as np
import torch
import hyperchamber as hc
import inspect
from hypergan.trainers.base_trainer import BaseTrainer
from hypergan.optimizers.adamirror import Adamirror
TINY = 1e-12
class SimultaneousTrainer(BaseTrainer):
""" Steps G and D simultaneously """
def _create(self):
self.optimiz... | Python | 0 |
30db4b3ae377669b3b598c9d4d22b5fbff2082ab | Fix typo on model | app/backend/aquifers/serializers.py | app/backend/aquifers/serializers.py | """
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, software
distri... | """
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, software
distri... | Python | 0.000585 |
306f597faad120ad5b5327544b40537fd0724f96 | stop url render errors failing the plugin | flexget/plugins/output/prowl.py | flexget/plugins/output/prowl.py | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from requests import RequestException
from flexget import plugin
from flexget.event import event
from flexget.utils.template import RenderError
log = logging.g... | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from requests import RequestException
from flexget import plugin
from flexget.event import event
from flexget.utils.template import RenderError
log = logging.g... | Python | 0.000001 |
2954d63dbd4f48eb6141fdb1298290c2adaf5814 | Fix installed-unit builder. | flocker/provision/_rackspace.py | flocker/provision/_rackspace.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Rackspace provisioner.
"""
from characteristic import attributes, Attribute
from ._libcloud import get_size, get_image
from ._install import provision
# _node isn't immutable, since libcloud provides new instances
# with updated data.
@attributes([Att... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Rackspace provisioner.
"""
from libcloud.compute.providers import get_driver, Provider
from characteristic import attributes, Attribute
from ._libcloud import get_size, get_image
from ._install import provision
# _node isn't immutable, since libcloud ... | Python | 0 |
96bc8bdec2736a1f86528d55331e935ecf13a529 | np nan validator | pycqed/instrument_drivers/pq_parameters.py | pycqed/instrument_drivers/pq_parameters.py | from qcodes.instrument.parameter import ManualParameter
from qcodes.utils.validators import Validator, Strings
import numpy as np
class NP_NANs(Validator):
is_numeric = True
def __init__(self):
self._valid_values = [np.nan]
def __repr__(self):
return '<nan>'
def validate(self, value... | from qcodes.instrument.parameter import ManualParameter
from qcodes.utils.validators import Validator, Strings
import numpy as np
class NP_NANs(Validator):
is_numeric = True
def __init__(self):
pass
def __repr__(self):
return '<nan>'
def validate(self, value, context=''):
tr... | Python | 0.999504 |
8995d7314bddcf4418a08cb39b2fabbc8704706e | Use conservative defaults for local facebook settings. | pykeg/src/pykeg/contrib/facebook/models.py | pykeg/src/pykeg/contrib/facebook/models.py | import datetime
from django.db import models
from django.db.models.signals import post_save
from socialregistration import models as sr_models
PRIVACY_CHOICES = (
('EVERYONE', 'Everyone'),
('ALL_FRIENDS', 'Friends'),
('FRIENDS_OF_FRIENDS', 'Friends of Friends'),
('NETWORK_FRIENDS', 'Networks and Friends'),
#... | import datetime
from django.db import models
from django.db.models.signals import post_save
from socialregistration import models as sr_models
PRIVACY_CHOICES = (
('EVERYONE', 'Everyone'),
('ALL_FRIENDS', 'Friends'),
('FRIENDS_OF_FRIENDS', 'Friends of Friends'),
('NETWORK_FRIENDS', 'Networks and Friends'),
#... | Python | 0 |
50d11a45ddbd2b535111de2307a0c6a1b0443577 | Fix imports | motobot/core_plugins/privmsg_handlers.py | motobot/core_plugins/privmsg_handlers.py | from motobot import hook
from time import strftime, localtime
import re
@hook('PRIVMSG')
def __handle_privmsg(bot, message):
""" Handle the privmsg commands.
Will send the reply back to the channel the command was sent from,
or back to the user whom sent it in the case of a private message.
Commands... | from motobot import hook
from time import strftime, localtime
@hook('PRIVMSG')
def __handle_privmsg(bot, message):
""" Handle the privmsg commands.
Will send the reply back to the channel the command was sent from,
or back to the user whom sent it in the case of a private message.
Commands (prefixed... | Python | 0.000002 |
cfb7e2a4659d8537b8026c2928c5a635e16070ee | Speed up the user admin page | apps/auth/admin.py | apps/auth/admin.py | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 ... | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 ... | Python | 0.999004 |
eff9a7fa2c25739926a8c583c51f30fee66185c9 | return plugin name changed at loading | keystoneauth_oidc_refreshtoken/loading.py | keystoneauth_oidc_refreshtoken/loading.py | # coding=utf-8
# Copyright 2017 JOSÉ JOAQUÍN ESCOBAR GÓMEZ
# File: loading.py
# Description:
#
# 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/... | # coding=utf-8
# Copyright 2017 JOSÉ JOAQUÍN ESCOBAR GÓMEZ
# File: loading.py
# Description:
#
# 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/... | Python | 0 |
b978d2a1f2f9cc9942971a6e252ccd1209a9269b | remove message (#8163) | pytorch_lightning/metrics/__init__.py | pytorch_lightning/metrics/__init__.py | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | Python | 0 |
d6b9cc4acb4800aa63cc91957c05c75312a081e5 | update language_by_size from trunk r9110, add new sq-site | pywikibot/families/wikinews_family.py | pywikibot/families/wikinews_family.py | # -*- coding: utf-8 -*-
from pywikibot import family
__version__ = '$Id$'
# The Wikimedia family that is known as Wikinews
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikinews'
self.languages_by_size = [
'sr', 'en', 'pl', 'de', ... | # -*- coding: utf-8 -*-
from pywikibot import family
__version__ = '$Id$'
# The Wikimedia family that is known as Wikinews
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikinews'
self.languages_by_size = [
'sr', 'en', 'pl', 'de', ... | Python | 0 |
06a851590f32acad0bc1e5b0d87cc4b1148b644c | Add unique index to patient_numbers | radar/radar/models/patient_numbers.py | radar/radar/models/patient_numbers.py | from sqlalchemy import Column, Integer, ForeignKey, String, Index
from sqlalchemy.orm import relationship
from radar.database import db
from radar.models import MetaModelMixin
from radar.models.common import uuid_pk_column, patient_id_column, patient_relationship
class PatientNumber(db.Model, MetaModelMixin):
__... | from sqlalchemy import Column, Integer, ForeignKey, String, Index
from sqlalchemy.orm import relationship
from radar.database import db
from radar.models import MetaModelMixin
from radar.models.common import uuid_pk_column, patient_id_column, patient_relationship
class PatientNumber(db.Model, MetaModelMixin):
__... | Python | 0.998605 |
e44115c6785fcc80f378e61e98e4ccd32cc9498f | Renames `update_step()` to `train_step()`. | flax/training/train_state.py | flax/training/train_state.py | # Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | # Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 0.999865 |
10a8946a18c953d64648639b5a545ec8fa5da6e8 | Update print_format.py | frappe/utils/print_format.py | frappe/utils/print_format.py | from __future__ import unicode_literals
import frappe, os, copy, json, re
from frappe import _
from frappe.modules import get_doc_path
from jinja2 import TemplateNotFound
from frappe.utils import cint, strip_html
from frappe.utils.pdf import get_pdf,cleanup
import cups
from PyPDF2 import PdfFileWriter, PdfFileReader
... | from __future__ import unicode_literals
import frappe, os, copy, json, re
from frappe import _
from frappe.modules import get_doc_path
from jinja2 import TemplateNotFound
from frappe.utils import cint, strip_html
from frappe.utils.pdf import get_pdf,cleanup
import cups
from PyPDF2 import PdfFileWriter, PdfFileReader
... | Python | 0.000011 |
ab2d635f6f52c6cbc6c59d3fa887176852e186ff | Move Ko-Fi notifications to private channels. | KofiFriend_Brain.py | KofiFriend_Brain.py | import traceback
import json
import util_functions
from discord.ext import commands
import discord
import sys
import re
import os
import asyncio
from aiohttp import web
import datetime
botToken = os.environ.get('botToken')
def run_app(app, *, host='0.0.0.0', port=None, shutdown_timeout=60.0, ssl_context=None, print=p... | import traceback
import json
import util_functions
from discord.ext import commands
import discord
import sys
import re
import os
import asyncio
from aiohttp import web
import datetime
botToken = os.environ.get('botToken')
def run_app(app, *, host='0.0.0.0', port=None, shutdown_timeout=60.0, ssl_context=None, print=p... | Python | 0 |
b980d69fe3d2da87814a915c6a85ef930d832860 | Change simple_blend to simply average the predictions | scripts/simple_blend.py | scripts/simple_blend.py | import numpy as np
import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
from utils.data_paths import SUBMISSIONS_DIR_PATH
OUTPUT_FILE_PATH = os.path.join(SUBMISSIONS_DIR_PATH, 'simple_blend.dta')
PREDICTION_FILE_PATHS = [os.path.join(SUBMISSIONS_DIR_PATH, 'predictions1.dt... | import numpy as np
import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
from utils.data_paths import SUBMISSIONS_DIR_PATH
OUTPUT_FILE_PATH = os.path.join(SUBMISSIONS_DIR_PATH, 'simple_blend.dta')
PREDICTION_FILE_PATHS = [os.path.join(SUBMISSIONS_DIR_PATH, 'predictions1.dt... | Python | 0.000001 |
4657a4fafb1218fe73b76d142c554bd8f347d81f | Make the correct None check | regserver/regulations/views/chrome.py | regserver/regulations/views/chrome.py | from django.conf import settings
from django.http import Http404
from django.views.generic.base import TemplateView
from regulations.generator import generator
from regulations.generator.versions import fetch_grouped_history
from regulations.views import utils
from regulations.views.partial import *
from regulations.v... | from django.conf import settings
from django.http import Http404
from django.views.generic.base import TemplateView
from regulations.generator import generator
from regulations.generator.versions import fetch_grouped_history
from regulations.views import utils
from regulations.views.partial import *
from regulations.v... | Python | 0.999589 |
e09d1f7f3b078b6de0f87b05939d776bc43ee483 | Comment about hack | pax/pax.py | pax/pax.py | import logging
import inspect
import pprint
import configparser
from pax import units
import os
from pluginbase import PluginBase
from pax import units
def EvaluateConfiguration(config):
evaled_config = {}
for key, value in config.items():
#Eval value with globals = everything from units...
... | import logging
import inspect
import pprint
import configparser
from pax import units
import os
from pluginbase import PluginBase
from pax import units
def EvaluateConfiguration(config):
evaled_config = {}
for key, value in config.items():
evaled_config[key] = eval(value, {
name : getatt... | Python | 0 |
2779fdd14279e017f35780fe343b1c7243898397 | Fix extension description and remove unused exception | neutron/extensions/l3_ext_gw_mode.py | neutron/extensions/l3_ext_gw_mode.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira Networks, 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.apac... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Nicira Networks, 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.apac... | Python | 0 |
aaa6142718827ea6d568eccc75c624598b0bc9c9 | Update __init__.py | pymeasure/instruments/thorlabs/__init__.py | pymeasure/instruments/thorlabs/__init__.py | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2020 PyMeasure Developers
#
# 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 limit... | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2020 PyMeasure Developers
#
# 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 limit... | Python | 0.000072 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.