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 |
|---|---|---|---|---|---|---|---|
c88314f935d9bf1e65c2a4f6d3eb6931fee5c4f5 | fix evaluate.py | Utils/py/BallDetection/RegressionNetwork/evaluate.py | Utils/py/BallDetection/RegressionNetwork/evaluate.py | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
from pathlib import Path
DATA_DIR = Path(Path(__file__).parent.absolute() / "data").resolve()
MODEL_DIR = Path(Path(__file__).parent.absolute() / "models/best_models").resolve()
if __name__ == '__main__':
par... | #!/usr/bin/env python3
import argparse
import pickle
import tensorflow.keras as keras
import numpy as np
parser = argparse.ArgumentParser(description='Train the network given ')
parser.add_argument('-b', '--database-path', dest='imgdb_path',
help='Path to the image database containing test data.'... | Python | 0.000002 |
cc7e3e5ef9d9c59b6b1ac80826445839ede73092 | Revert mast dev host change | astroquery/mast/__init__.py | astroquery/mast/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
MAST Query Tool
===============
This module contains various methods for querying the MAST Portal.
"""
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.mast`.
"""
... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
MAST Query Tool
===============
This module contains various methods for querying the MAST Portal.
"""
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.mast`.
"""
... | Python | 0 |
3ef82203daebd532af2f8effebe8fa31cec11e76 | fix error message encoding | atest/robot/tidy/TidyLib.py | atest/robot/tidy/TidyLib.py | from __future__ import with_statement
import os
from os.path import abspath, dirname, join
from subprocess import call, STDOUT
import tempfile
from robot.utils.asserts import assert_equals
ROBOT_SRC = join(dirname(abspath(__file__)), '..', '..', '..', 'src')
class TidyLib(object):
def __init__(self, interpret... | from __future__ import with_statement
import os
from os.path import abspath, dirname, join
from subprocess import call, STDOUT
import tempfile
from robot.utils.asserts import assert_equals
ROBOT_SRC = join(dirname(abspath(__file__)), '..', '..', '..', 'src')
class TidyLib(object):
def __init__(self, interpret... | Python | 0.000001 |
3904a7ac75318de08452fcea1a49b6d6e681da4e | remove debug. | lib/acli/output/route53.py | lib/acli/output/route53.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, print_function, unicode_literals)
from acli.output import (output_ascii_table, dash_if_none)
def output_route53_list(output_media=None, zones=None):
"""
@type output_media: unicode
@type zones: list | dict
"""
if isinstance(zones, di... | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, print_function, unicode_literals)
from acli.output import (output_ascii_table, dash_if_none)
def output_route53_list(output_media=None, zones=None):
"""
@type output_media: unicode
@type zones: list | dict
"""
if isinstance(zones, di... | Python | 0 |
fe67796130854d83b3dfaa085d67d9eabe35a155 | Allow getdate for Energy Point Rule condition | frappe/social/doctype/energy_point_rule/energy_point_rule.py | frappe/social/doctype/energy_point_rule/energy_point_rule.py | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import frappe.cache_manager
from frappe.model.document import Document
from frappe.social.doctype.energy_point_... | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import frappe.cache_manager
from frappe.model.document import Document
from frappe.social.doctype.energy_point_... | Python | 0 |
6236ee8344add06f6adbfef9df5ab224ea19b1fe | Remove unused import | moocng/courses/backends.py | moocng/courses/backends.py | # Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.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
#
# ... | # Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.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
#
# ... | Python | 0.000001 |
6a2a0667179a78e2c56dff551b0d010db6ed0150 | fix imports | chainerrl/initializers/__init__.py | chainerrl/initializers/__init__.py | from chainerrl.initializers.constant import VarianceScalingConstant # NOQA
from chainerrl.initializers.normal import LeCunNormal # NOQA
from chainerrl.initializers.uniform import VarianceScalingUniform # NOQA
| from chainerrl.initializers.constant import VarianceScalingConstant # NOQA
from chainerrl.initializers.normal import LeCunNormal # NOQA
| Python | 0.000002 |
fb19411797ae7ac00e022a9409459c0f42969a91 | Remove unused code | backend/api/helpers/i18n.py | backend/api/helpers/i18n.py | from typing import Optional
from django.conf import settings
from django.utils import translation
def make_localized_resolver(field_name: str):
def resolver(root, info, language: Optional[str] = None) -> str:
language = language or translation.get_language() or settings.LANGUAGE_CODE
return geta... | from typing import Optional
from django.conf import settings
from django.utils import translation
def make_localized_resolver(field_name: str):
def resolver(root, info, language: Optional[str] = None) -> str:
language = language or translation.get_language() or settings.LANGUAGE_CODE
return geta... | Python | 0.000006 |
2af841027c17256964ce92b0459d32a9c210e357 | remove unneeded check | mythril/analysis/solver.py | mythril/analysis/solver.py | from z3 import Solver, simplify, sat, unknown, FuncInterp, UGE
from mythril.exceptions import UnsatError
from mythril.laser.ethereum.transaction.transaction_models import (
ContractCreationTransaction,
)
import logging
def get_model(constraints):
s = Solver()
s.set("timeout", 100000)
for constraint i... | from z3 import Solver, simplify, sat, unknown, FuncInterp, UGE
from mythril.exceptions import UnsatError
from mythril.laser.ethereum.transaction.transaction_models import (
ContractCreationTransaction,
)
import logging
def get_model(constraints):
s = Solver()
s.set("timeout", 100000)
for constraint i... | Python | 0.000001 |
4563e383962690cc196f4551f217d488501b660e | support for mysql as well | bin/count_users_in_rooms.py | bin/count_users_in_rooms.py | import sys
import os
import yaml
import redis
dino_env = sys.argv[1]
dino_home = sys.argv[2]
if dino_home is None:
raise RuntimeError('need environment variable DINO_HOME')
if dino_env is None:
raise RuntimeError('need environment variable DINO_ENVIRONMENT')
def load_secrets_file(config_dict: dict) -> dict... | import sys
import os
import yaml
import redis
import psycopg2
dino_env = sys.argv[1]
dino_home = sys.argv[2]
if dino_home is None:
raise RuntimeError('need environment variable DINO_HOME')
if dino_env is None:
raise RuntimeError('need environment variable DINO_ENVIRONMENT')
def load_secrets_file(config_dic... | Python | 0 |
dbcbd5aed6abcc58a65d63653b7a3f41b429369b | clean up and format | bin/spritz.py | bin/spritz.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import sys
import time
import math
import fileinput
def to_unicode(text, encoding='utf-8'):
"""Convert ``text`` to unicode using ``encoding``.
:param text: string object to convert to ``unicode``
:type ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import fileinput
import time
import math
def ORP(n):
percentage = 0.45
return int(math.ceil(n * 0.45))
def calculate_spaces(word, maxLength):
maxOrp = ORP(maxLength) # index + 1
orp = ORP(len(word)) # index + 1
prefixSpace = maxOrp - orp
... | Python | 0.0002 |
952a342cc160f7b994e7a06c7836d1319414a30e | Fix bitcointxn.disassemble so it actually works | bitcointxn.py | bitcointxn.py | from bitcoinvarlen import varlenDecode, varlenEncode
from util import dblsha
from struct import pack, unpack
_nullprev = b'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'
class Txn:
def __init__(self, data=None):
if data:
self.data = data
self.idhash()
@classmethod
def new(cls):
o = c... | from bitcoinvarlen import varlenDecode, varlenEncode
from util import dblsha
from struct import pack, unpack
_nullprev = b'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'
class Txn:
def __init__(self, data=None):
if data:
self.data = data
self.idhash()
@classmethod
def new(cls):
o = c... | Python | 0.000001 |
81de62d46d7daefb2e1eef0d0cc4f5ca5c8aef2f | Use GCBV queryset to get PostGetMixin obj. | blog/utils.py | blog/utils.py | from django.shortcuts import get_object_or_404
from .models import Post
class PostGetMixin:
date_field = 'pub_date'
model = Post
month_url_kwarg = 'month'
year_url_kwarg = 'year'
errors = {
'url_kwargs':
"Generic view {} must be called with "
"year, month, and slu... | from django.shortcuts import get_object_or_404
from .models import Post
class PostGetMixin:
date_field = 'pub_date'
month_url_kwarg = 'month'
year_url_kwarg = 'year'
errors = {
'url_kwargs':
"Generic view {} must be called with "
"year, month, and slug.",
}
d... | Python | 0 |
2b419d499c37597094379f524d8347f35eeda57c | Fix tinycss css validator | src/checker/plugin/checkers/tinycss_css_validator_plugin.py | src/checker/plugin/checkers/tinycss_css_validator_plugin.py | from common import PluginType
import tinycss
from yapsy.IPlugin import IPlugin
import logging
class CssValidator(IPlugin):
category = PluginType.CHECKER
id = "tinycss"
def __init__(self):
self.journal = None
def setJournal(self, journal):
self.journal = journal
def... | from common import PluginType
import tinycss
from yapsy.IPlugin import IPlugin
import logging
class CssValidator(IPlugin):
category = PluginType.CHECKER
id = "tinycss"
def __init__(self):
self.journal = None
def setJournal(self, journal):
self.journal = journal
def... | Python | 0.000209 |
08f9575a0de95432729cbf1a9649148998030e17 | fix error output on windows (#50) | cmake/legacy/wafstyleout.py | cmake/legacy/wafstyleout.py | #!/usr/bin/env python
import subprocess
import sys
import os
import argparse
import platform
def unicodeWrite(out, str):
try:
out.write(str)
except UnicodeEncodeError:
bytes = str.encode(out.encoding or 'ascii', 'replace')
if hasattr(sys.stdout, 'buffer'):
out.buffer.write(... | #!/usr/bin/env python
import subprocess
import sys
import os
import argparse
def unicodeWrite(out, str):
try:
out.write(str)
except UnicodeEncodeError:
bytes = str.encode(out.encoding or 'ascii', 'replace')
if hasattr(sys.stdout, 'buffer'):
out.buffer.write(bytes)
e... | Python | 0 |
88dd48eab612e89b956dea5600a999c78c61d5fb | fix lpproj algorithm | lpproj/lpproj.py | lpproj/lpproj.py | import numpy as np
from scipy import linalg
from sklearn.neighbors import kneighbors_graph, NearestNeighbors
from sklearn.utils import check_array
from sklearn.base import BaseEstimator, TransformerMixin
class LocalityPreservingProjection(BaseEstimator, TransformerMixin):
def __init__(self, n_neighbors=5, n_comp... | import numpy as np
from sklearn.neighbors import kneighbors_graph
from sklearn.utils import check_array
from sklearn.base import BaseEstimator, TransformerMixin
class LocalityPreservingProjection(BaseEstimator, TransformerMixin)::
def __init__(self, n_neighbors=5, n_components=2, eigen_solver='auto',
... | Python | 0.000012 |
8e58d7cccb837254cc433c7533bff119cc19645d | Use json instead of django.utils.simplejson. | javascript_settings/templatetags/javascript_settings_tags.py | javascript_settings/templatetags/javascript_settings_tags.py | import json
from django import template
from javascript_settings.configuration_builder import \
DEFAULT_CONFIGURATION_BUILDER
register = template.Library()
@register.tag(name='javascript_settings')
def do_javascript_settings(parser, token):
"""
Returns a node with generated configuration.
"""
... | from django import template
from django.utils import simplejson
from javascript_settings.configuration_builder import \
DEFAULT_CONFIGURATION_BUILDER
register = template.Library()
@register.tag(name='javascript_settings')
def do_javascript_settings(parser, token):
"""
Returns a node with generated c... | Python | 0 |
afafb47d77fd673abf8d8ce9baa9824b985a943a | Add create_class_wrapper and class_wrapper | undecorate.py | undecorate.py | """Allow your decorations to be un-decorated.
In some cases, such as when testing, it can be useful to access the
decorated class or function directly, so as to not to use the behavior
or interface that the decorator might introduce.
Example:
>>> from functools import wraps
>>> from undecorate import unwrap, unwrapp... | """Allow your decorations to be un-decorated.
In some cases, such as when testing, it can be useful to access the
decorated class or function directly, so as to not to use the behavior
or interface that the decorator might introduce.
Example:
>>> from functools import wraps
>>> from undecorate import unwrap, unwrapp... | Python | 0.000021 |
551c4b971f1d18e232ba193cf486300d3490224b | add log | api/photo2song.py | api/photo2song.py | import asyncio
from collections import Counter
from api.bluemix_vision_recognition import VisionRecognizer
from api.echonest import Echonest
from api.spotify import Spotify
from machines.machine_loader import MachineLoader
import machines.photo_mood
def convert(image_urls):
vr = VisionRecognizer()
ec = Echone... | import asyncio
from collections import Counter
from api.bluemix_vision_recognition import VisionRecognizer
from api.echonest import Echonest
from api.spotify import Spotify
from machines.machine_loader import MachineLoader
import machines.photo_mood
def convert(image_urls):
vr = VisionRecognizer()
ec = Echone... | Python | 0.000002 |
c59c0911c5022291b38774bf407ca83557c78cc5 | test login and logout views. | user/tests.py | user/tests.py | from django.test import TestCase
class ViewsTest(TestCase):
"""
TestCase to test all exposed views for anonymous users.
"""
def setUp(self):
pass
def testHome(self):
response = self.client.get('/user/')
self.assertEquals(response.status_code, 200)
def testLogin(self)... | from django.test import TestCase
class ViewsTest(TestCase):
"""
TestCase to test all exposed views for anonymous users.
"""
def setUp(self):
pass
def testHome(self):
response = self.client.get('/user/')
self.assertEquals(response.status_code, 200)
def testLogin(self)... | Python | 0 |
c6536da7fc1eda82922b286c096412e4371f6d4c | Bump version | graphysio/__init__.py | graphysio/__init__.py | """Graphical time series visualizer and analyzer."""
__version__ = '2021.07.14.1'
__all__ = [
'algorithms',
'dialogs',
'exporter',
'legend',
'mainui',
'puplot',
'tsplot',
'utils',
'types',
'ui',
'transformations',
]
| """Graphical time series visualizer and analyzer."""
__version__ = '2021.07.14'
__all__ = [
'algorithms',
'dialogs',
'exporter',
'legend',
'mainui',
'puplot',
'tsplot',
'utils',
'types',
'ui',
'transformations',
]
| Python | 0 |
23cdb0d62e44797f84aee61f1a4c2909df8221b0 | Fix settings import and add an option to DjangoAppEngineMiddleware to allow setting up of signals on init | main/__init__.py | main/__init__.py | import logging
import os
from django.utils.importlib import import_module
def validate_models():
"""
Since BaseRunserverCommand is only run once, we need to call
model valdidation here to ensure it is run every time the code
changes.
"""
from django.core.management.validation import get_validat... | import logging
import os
def validate_models():
"""
Since BaseRunserverCommand is only run once, we need to call
model valdidation here to ensure it is run every time the code
changes.
"""
from django.core.management.validation import get_validation_errors
try:
from cStringIO import... | Python | 0 |
e4ad2863236cd36e5860f1d17a06ca05e30216d5 | Store more stuff about songs in the queue | make_database.py | make_database.py | import sqlite3
CREATE_SONG_QUEUE = '''
CREATE TABLE IF NOT EXISTS
jukebox_song_queue (
spotify_uri TEXT,
has_played INTEGER DEFAULT 0,
name TEXT,
artist_name TEXT,
artist_uri TEXT,
artist_image TEXT,
album_name TEXT,
album_uri TEXT,
album_image TEXT
);
'''
if __name__ == '__main... | import sqlite3
CREATE_SONG_QUEUE = '''
CREATE TABLE IF NOT EXISTS
jukebox_song_queue (
spotify_uri TEXT,
has_played INTEGER DEFAULT 0
);
'''
if __name__ == '__main__':
conn = sqlite3.connect('jukebox.db')
cursor = conn.cursor()
cursor.execute(CREATE_SONG_QUEUE)
conn.commit()
conn.close... | Python | 0 |
939ba609e6e7a527ef3325c4dd5b0a51c97d1af9 | fix #29 | djangocms_reversion2/signals.py | djangocms_reversion2/signals.py | # -*- coding: utf-8 -*-
from cms.operations import REVERT_PAGE_TRANSLATION_TO_LIVE
from django.db.models import signals
def make_page_version_dirty(page, language):
pv = page.page_versions.filter(active=True, language=language)
if pv.count() > 0:
pv = pv.first()
if not pv.dirty:
... | # -*- coding: utf-8 -*-
from django.db.models import signals
def make_page_version_dirty(page, language):
pv = page.page_versions.filter(active=True, language=language)
if pv.count() > 0:
pv = pv.first()
if not pv.dirty:
pv.dirty = True
pv.save()
def mark_title_dirt... | Python | 0.000001 |
70448c7f4ea132376a6d3547edb99ec616501171 | Implement Gref#parents in terms of Gref#direct_parents | groundstation/gref.py | groundstation/gref.py | import os
import groundstation.objects.object_factory as object_factory
from groundstation.objects.update_object import UpdateObject
from groundstation.objects.root_object import RootObject
import logger
log = logger.getLogger(__name__)
class Gref(object):
def __init__(self, store, channel, identifier):
... | import os
import groundstation.objects.object_factory as object_factory
from groundstation.objects.update_object import UpdateObject
from groundstation.objects.root_object import RootObject
import logger
log = logger.getLogger(__name__)
class Gref(object):
def __init__(self, store, channel, identifier):
... | Python | 0.002283 |
f3195d0d41232c7655250dea15ba4ecbe1a7b036 | append http:// if protocol is missing, sanitize the return value | Commands/Slurp.py | Commands/Slurp.py | # -*- coding: utf-8 -*-
"""
Created on Aug 31, 2015
@author: Tyranic-Moron
"""
import HTMLParser
import re
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from CommandInterface import CommandInterface
from Utils import WebUtils
from bs4 import BeautifulSoup
class Slurp(CommandI... | # -*- coding: utf-8 -*-
"""
Created on Aug 31, 2015
@author: Tyranic-Moron
"""
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from CommandInterface import CommandInterface
from Utils import WebUtils
from bs4 import BeautifulSoup
class Slurp(CommandInterface):
triggers = ['... | Python | 0.000015 |
ed97f1cdbcc5a00c2bf597ad921b17da652b0b07 | add annotations to _pytesttester.py | bottleneck/_pytesttester.py | bottleneck/_pytesttester.py | """
Generic test utilities.
Based on scipy._libs._testutils
"""
import os
import sys
from typing import Optional, List
__all__ = ["PytestTester"]
class PytestTester(object):
"""
Pytest test runner entry point.
"""
def __init__(self, module_name: str) -> None:
self.module_name = module_nam... | """
Generic test utilities.
Based on scipy._libs._testutils
"""
from __future__ import division, print_function, absolute_import
import os
import sys
__all__ = ["PytestTester"]
class PytestTester(object):
"""
Pytest test runner entry point.
"""
def __init__(self, module_name):
self.modul... | Python | 0.000002 |
075c06a6360d8b88745e3bffd4883beead36c59b | Add orders_script | config_example.py | config_example.py | CHROMEDRIVER_PATH = '/usr/lib/chromium-browser/chromedriver'
FACEBOOK = {
'email': '',
'password': '',
}
HIPMENU = {
'restaurant_url': 'https://www.hipmenu.ro/#p1/rg/cluj-prod/group/98254//',
}
SKYPE = {
'username': '',
'password': '',
'conversation_title': '',
}
NEXMO = {
'api_key': '',... | CHROMEDRIVER_PATH = '/usr/lib/chromium-browser/chromedriver'
FACEBOOK = {
'email': '',
'password': '',
}
HIPMENU = {
'restaurant_url': 'https://www.hipmenu.ro/#p1/rg/cluj-prod/group/98254//',
}
SKYPE = {
'username': '',
'password': '',
'conversation_title': '',
}
NEXMO = {
'api_key': '',... | Python | 0.000001 |
60890b614132a8cfd48be3e001114275752e9ac4 | fix typo | megnet/config.py | megnet/config.py | """Data types"""
import numpy as np
import tensorflow as tf
DTYPES = {'float32': {'numpy': np.float32, 'tf': tf.float32},
'float16': {'numpy': np.float16, 'tf': tf.float16},
'int32': {'numpy': np.int32, 'tf': tf.int32},
'int16': {'numpy': np.int16, 'tf': tf.int16}}
class DataType:
... | """Data types"""
import numpy as np
import tensorflow as tf
DTYPES = {'float32': {'numpy': np.float32, 'tf': tf.float32},
'float16': {'numpy': np.float16, 'tf': tf.float16},
'int32': {'numpy': np.int32, 'tf': tf.int32},
'int16': {'numpy': np.int32, 'tf': tf.int32}}
class DataType:
... | Python | 0.999991 |
5eb2c6f7e1bf0cc1b73b167a08085fccf77974fe | Tidy up and doc-comment AWSInstanceEnv class | app/config/aws.py | app/config/aws.py | # -*- coding: utf-8 -*-
"""
Dictionary-like class for config settings from AWS credstash
"""
from boto import ec2, utils
import credstash
class AWSIntanceEnv(object):
def __init__(self):
metadata = utils.get_instance_metadata()
self.instance_id = metadata['instance-id']
self.region = met... | from boto import ec2, utils
import credstash
class AWSIntanceEnv(object):
def __init__(self):
metadata = utils.get_instance_metadata()
self.instance_id = metadata['instance-id']
self.region = metadata['placement']['availability-zone'][:-1]
conn = ec2.connect_to_region(self.region... | Python | 0 |
9642b8f3d2f14b3a61054f68f05f4ef8eaca0803 | add validation | molo/core/management/commands/add_translated_pages_to_pages.py | molo/core/management/commands/add_translated_pages_to_pages.py | from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from molo.core.models import PageTranslation, SiteLanguage, Page
class Command(BaseCommand):
def handle(self, *args, **options):
# first add all the translations to the main language Page
... | from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand
from molo.core.models import PageTranslation, SiteLanguage, Page
class Command(BaseCommand):
def handle(self, *args, **options):
# first add all the translations to the main language Page
... | Python | 0.000001 |
cb4c91e3d109c939236f9581691f837fa0709108 | Delete manage hackathon detail router | open-hackathon-client/src/client/views/route_manage.py | open-hackathon-client/src/client/views/route_manage.py | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
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 res... | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
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 res... | Python | 0 |
58d7592c603509f2bb625e4e2e5cb31ada4a8194 | Change test for make_kernel(kerneltype='airy') from class to function | astropy/nddata/convolution/tests/test_make_kernel.py | astropy/nddata/convolution/tests/test_make_kernel.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_allclose
from ....tests.helper import pytest
from ..make_kernel import make_kernel
try:
import scipy
HAS_SCIPY = True
except ImportError:
HAS_SCIPY = False
@pytest.mark.skipif('not HAS_SCI... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from ....tests.helper import pytest
from ..make_kernel import make_kernel
try:
import scipy
HAS_SCIPY = True
except ImportError:
HAS_SCIPY = False
class TestMakeKern... | Python | 0.000001 |
e7647da318b2fc5f973080446882347a287aec3a | use same cache for custom domain redirect | openedx/core/djangoapps/appsembler/sites/middleware.py | openedx/core/djangoapps/appsembler/sites/middleware.py | from django.conf import settings
from django.core.cache import cache, caches
from django.contrib.redirects.models import Redirect
from django.shortcuts import redirect
from .models import AlternativeDomain
import logging
log = logging.getLogger(__name__)
class CustomDomainsRedirectMiddleware(object):
def proce... | from django.conf import settings
from django.core.cache import cache
from django.contrib.redirects.models import Redirect
from django.shortcuts import redirect
from .models import AlternativeDomain
import logging
log = logging.getLogger(__name__)
class CustomDomainsRedirectMiddleware(object):
def process_reque... | Python | 0 |
21850d8ab44981b2bb02cb50386db717aacc730b | Fix poor coverage | paystackapi/tests/test_product.py | paystackapi/tests/test_product.py | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.product import Product
class TestProduct(BaseTestCase):
@httpretty.activate
def test_product_create(self):
"""Method defined to test product creation."""
httpretty.register_uri(
httpretty.... | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.product import Product
class TestProduct(BaseTestCase):
@httpretty.activate
def test_product_create(self):
"""Method defined to test product creation."""
httpretty.register_uri(
httpretty.... | Python | 0.002037 |
69ac1eb2f125e93444c134346dca954d8c040d42 | Implement the API to get system running status | paradrop/src/paradrop/backend/system_status.py | paradrop/src/paradrop/backend/system_status.py | '''
Get system running status including CPU load, memory usage, network traffic.
'''
import psutil
import time
class SystemStatus(object):
def __init__(self):
self.timestamp = time.time()
self.cpu_load = []
self.mem = dict(total = 0,
available = 0,
... | '''
Get system running status including CPU load, memory usage, network traffic.
'''
class SystemStatus(object):
def __init__(self):
pass
def getStatus(self):
test = {
'cpuload': 10
}
return test
def refreshCpuLoad(self):
pass
def refreshMemory... | Python | 0.000001 |
c11b5b2181434651e1979c6db328ba81ed19566d | Add debug to see why test-meson-helloworld. | meson_install.py | meson_install.py | #!/usr/bin/env python3
# Copyright 2015 wink saville
#
# 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 ... | #!/usr/bin/env python3
# Copyright 2015 wink saville
#
# 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 |
396fbb31fdfe212da9c531e5aa6240c554f0d86f | Refactor logging to use recommended pylint format | xboxapi/client.py | xboxapi/client.py | #-*- coding: utf-8 -*-
import requests
import logging
import json
import os
# Local libraries
from .gamer import Gamer
import xboxapi
logging.basicConfig()
class Client(object):
def __init__(self, api_key=None, timeout=None, lang=None):
self.api_key = api_key
self.timeout = timeout
s... | #-*- coding: utf-8 -*-
import requests
import logging
import json
import os
# Local libraries
from .gamer import Gamer
import xboxapi
logging.basicConfig()
class Client(object):
def __init__(self, api_key=None, timeout=None, lang=None):
self.api_key = api_key
self.timeout = timeout
s... | Python | 0 |
2726ec1c400a212b1cac13f20d65c1b43eb042b0 | Fix formatting in download-google-smart-card-client-library.py | example_js_standalone_smart_card_client_app/download-google-smart-card-client-library.py | example_js_standalone_smart_card_client_app/download-google-smart-card-client-library.py | #!/usr/bin/env python
# Copyright 2017 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 ... | #!/usr/bin/env python
# Copyright 2017 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 ... | Python | 0.999998 |
83549f9549a253fb7a86e8c051bd24fab91a0f5f | Make the output a little better | conda_build/main_inspect.py | conda_build/main_inspect.py | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
import sys
import argparse
from colle... | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
import sys
import argparse
from colle... | Python | 0.999998 |
ff9e3c6ef604a47a616e111ee2a90fda77692977 | Bump version to 3.3.2 | src/jukeboxmaya/__init__.py | src/jukeboxmaya/__init__.py | __author__ = 'David Zuber'
__email__ = 'zuber.david@gmx.de'
__version__ = '3.3.2'
STANDALONE_INITIALIZED = None
"""After calling :func:`init` this is True, if maya standalone
has been initialized or False, if you are running
from within maya.
It is None, if initialized has not been called yet.
"""
| __author__ = 'David Zuber'
__email__ = 'zuber.david@gmx.de'
__version__ = '3.3.1'
STANDALONE_INITIALIZED = None
"""After calling :func:`init` this is True, if maya standalone
has been initialized or False, if you are running
from within maya.
It is None, if initialized has not been called yet.
"""
| Python | 0.000002 |
a9c7a6e441159bdf1fd13d70bcc91617dee93f03 | revert revert. | lib/kodi65/selectdialog.py | lib/kodi65/selectdialog.py | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
import xbmcgui
import xbmc
from kodi65 import addon
C_LIST_SIMPLE = 3
C_LIST_DETAIL = 6
C_BUTTON_GET_MORE = 5
C_LABEL_HEADER = 1
class SelectDialog(xbmcgui.WindowXMLDialo... | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
import xbmcgui
import xbmc
from kodi65 import addon
C_LIST_SIMPLE = 3
C_LIST_DETAIL = 6
C_BUTTON_GET_MORE = 5
C_LABEL_HEADER = 1
class SelectDialog(xbmcgui.WindowXMLDialo... | Python | 0.00001 |
7a83a9be7e2a986979cc898c3fd3aa3bb49442cc | modify dx model | cea/technologies/direct_expansion_units.py | cea/technologies/direct_expansion_units.py | # -*- coding: utf-8 -*-
"""
direct expansion units
"""
from __future__ import division
from scipy.interpolate import interp1d
from math import log, ceil
import pandas as pd
import numpy as np
from cea.constants import HEAT_CAPACITY_OF_WATER_JPERKGK
__author__ = "Shanshan Hsieh"
__copyright__ = "Copyright 2015, Archit... | # -*- coding: utf-8 -*-
"""
direct expansion units
"""
from __future__ import division
from scipy.interpolate import interp1d
from math import log, ceil
import pandas as pd
from cea.constants import HEAT_CAPACITY_OF_WATER_JPERKGK
__author__ = "Shanshan Hsieh"
__copyright__ = "Copyright 2015, Architecture and Building... | Python | 0 |
8b359d97e59d759bfd7711c8aacf9abc657fe457 | fix demo | pipeline/demo/pipeline-homo-data-split-demo.py | pipeline/demo/pipeline-homo-data-split-demo.py | from pipeline.component.homo_data_split import HomoDataSplit
from pipeline.backend.config import Backend
from pipeline.backend.config import WorkMode
from pipeline.backend.pipeline import PipeLine
from pipeline.component.dataio import DataIO
from pipeline.component.input import Input
from pipeline.interface.data impor... | from pipeline.component.homo_data_split import HomoDataSplit
from pipeline.backend.config import Backend
from pipeline.backend.config import WorkMode
from pipeline.backend.pipeline import PipeLine
from pipeline.component.dataio import DataIO
from pipeline.component.input import Input
from pipeline.interface.data impor... | Python | 0 |
7ad707e722eabefc989cfa41fbf17c8315d948fd | Add optional parameters for Django fields. | oauth2client/django_orm.py | oauth2client/django_orm.py | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python | 0 |
ed48555984886ff5ade23aeb23ad5f85e77e5b69 | fix docs | chainercv/transforms/image/pca_lighting.py | chainercv/transforms/image/pca_lighting.py | import numpy
def pca_lighting(img, sigma, eigen_value=None, eigen_vector=None):
"""Alter the intensities of input image using PCA.
This is used in training of AlexNet [Krizhevsky]_.
.. [Krizhevsky] Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. \
ImageNet Classification with Deep Convolutional... | import numpy
def pca_lighting(img, sigma, eigen_value=None, eigen_vector=None):
"""Alter the intensities of input image using PCA.
This is used in training of AlexNet [Krizhevsky]_.
.. [Krizhevsky] Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. \
ImageNet Classification with Deep Convolutional... | Python | 0.000001 |
6f04f1ed35635c08836f1eee67983abf9735f5db | handle more exceptions | channelstream/wsgi_views/error_handlers.py | channelstream/wsgi_views/error_handlers.py | from pyramid.view import exception_view_config
@exception_view_config(context='marshmallow.ValidationError', renderer='json')
def marshmallow_invalid_data(context, request):
request.response.status = 422
return context.messages
@exception_view_config(context='itsdangerous.BadTimeSignature', renderer='json')... | from pyramid.view import exception_view_config
@exception_view_config(context='marshmallow.ValidationError', renderer='json')
def marshmallow_invalid_data(context, request):
request.response.status = 422
return context.messages
@exception_view_config(context='itsdangerous.BadTimeSignature', renderer='json')... | Python | 0.000002 |
155fd9ae952a4eba53521739589d5e3462108ed2 | remove default statement per Gunther's comment | chatterbot/ext/django_chatterbot/models.py | chatterbot/ext/django_chatterbot/models.py | from django.db import models
class Statement(models.Model):
"""A short (<255) chat message, tweet, forum post, etc"""
text = models.CharField(
unique=True,
blank=False,
null=False,
max_length=255
)
def __str__(self):
if len(self.text.strip()) > 60:
... | from django.db import models
class Statement(models.Model):
"""A short (<255) chat message, tweet, forum post, etc"""
text = models.CharField(
unique=True,
blank=False,
null=False,
default='<empty>',
max_length=255
)
def __str__(self):
if len(self.text... | Python | 0 |
4d81c88627b0f71c765112b9a814fe876239bcc5 | Print stats for constant points to. | src/main/copper/analysis.py | src/main/copper/analysis.py | import os
from .project import ProjectManager
from .analysis_steps import *
from .analysis_stats import AnalysisStatisticsBuilder as StatBuilder
class Analysis(object):
def __init__(self, config, projects=ProjectManager()):
self.logger = logging.getLogger(__name__)
self._config = config
se... | import os
from .project import ProjectManager
from .analysis_steps import *
from .analysis_stats import AnalysisStatisticsBuilder as StatBuilder
class Analysis(object):
def __init__(self, config, projects=ProjectManager()):
self.logger = logging.getLogger(__name__)
self._config = config
se... | Python | 0 |
4a1b670cd49f458c44bed638e2f9ecace211883a | fix and update first user as admin | websitemixer/plugins/Install/Setup.py | websitemixer/plugins/Install/Setup.py | import os
from flask import render_template, request, redirect
from websitemixer import app, db, models
@app.route('/setup/step1/')
def setup1():
return render_template("Install/step1.html")
@app.route('/setup/step2/',methods=['POST'])
def setup2():
secretkey = os.urandom(24).encode('hex')
appname = reque... | import os
from flask import render_template, request, redirect
from websitemixer import app, db, models
@app.route('/setup/step1/')
def setup1():
return render_template("Install/step1.html")
@app.route('/setup/step2/',methods=['POST'])
def setup2():
secretkey = os.urandom(24).encode('hex')
appname = reque... | Python | 0 |
9fec79f71f6dbf80d11989fbbfc2bed43668b75d | Use skimage for circle definition | python/thunder/extraction/feature/methods/localmax.py | python/thunder/extraction/feature/methods/localmax.py | from numpy import cos, sin, pi, array, sqrt
from thunder.extraction.feature.base import FeatureMethod, FeatureAlgorithm
from thunder.extraction.feature.creators import MeanFeatureCreator
from thunder.extraction.source import SourceModel, Source
class LocalMax(FeatureMethod):
def __init__(self, **kwargs):
... | from numpy import cos, sin, pi, array, sqrt
from thunder.extraction.feature.base import FeatureMethod, FeatureAlgorithm
from thunder.extraction.feature.creators import MeanFeatureCreator
from thunder.extraction.source import SourceModel, Source
class LocalMax(FeatureMethod):
def __init__(self, **kwargs):
... | Python | 0 |
40fe16d058d18d2384be464ecefed1028edace17 | Fix error on SASL PLAIN authentication | txircd/modules/ircv3_sasl_plain.py | txircd/modules/ircv3_sasl_plain.py | from txircd.modbase import Module
from base64 import b64decode
class SaslPlainMechanism(Module):
def authenticate(self, user, authentication):
try:
authenticationID, authorizationID, password = b64decode(authentication[0]).split("\0")
except TypeError:
user.sendMessage(irc.ERR_SASLFAILED, ":SASL authenticat... | from txircd.modbase import Module
from base64 import b64decode
class SaslPlainMechanism(Module):
def authenticate(self, user, authentication):
try:
authenticationID, authorizationID, password = b64decode(authentication[0]).split("\0")
except TypeError:
user.sendMessage(irc.ERR_SASLFAILED, ":SASL authenticat... | Python | 0.000003 |
026db0e635f0c82e1b24884cb768d53b7fadfc0c | use lots of connections for the pool | feedly/storage/cassandra/connection.py | feedly/storage/cassandra/connection.py | from pycassa.pool import ConnectionPool
def get_cassandra_connection(keyspace_name, hosts):
if get_cassandra_connection._connection is None:
get_cassandra_connection._connection = ConnectionPool(
keyspace_name, hosts, pool_size=len(hosts)*24,
prefill=False, timeout=10)
return g... | from pycassa.pool import ConnectionPool
def get_cassandra_connection(keyspace_name, hosts):
if get_cassandra_connection._connection is None:
get_cassandra_connection._connection = ConnectionPool(
keyspace_name, hosts)
return get_cassandra_connection._connection
get_cassandra_connection._c... | Python | 0 |
4e2affde042fab083ec24ec8d6e04ba2f45d1f7d | add utcnow to if conditional evaluation | flexget/plugins/filter/if_condition.py | flexget/plugins/filter/if_condition.py | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves import builtins
import logging
import datetime
from copy import copy
from jinja2 import UndefinedError
from flexget import plugin
from flexget.event imp... | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves import builtins
import logging
import datetime
from copy import copy
from jinja2 import UndefinedError
from flexget import plugin
from flexget.event imp... | Python | 0.000001 |
fb4b9e4570c4053204304fc934d0fe816d4c056d | add new split dictionary and dependencies | tests/resources/dictionaries/transaction_dictionary.py | tests/resources/dictionaries/transaction_dictionary.py | # -*- coding: utf-8 -*-
from tests.resources.dictionaries import card_dictionary
from tests.resources.dictionaries import customer_dictionary
from tests.resources.dictionaries import recipient_dictionary
from tests.resources import pagarme_test
from pagarme import recipient
BOLETO_TRANSACTION = {'amount': '10000', 'p... | # -*- coding: utf-8 -*-
from tests.resources.dictionaries import card_dictionary
from tests.resources.dictionaries import customer_dictionary
from tests.resources import pagarme_test
BOLETO_TRANSACTION = {'amount': '10000', 'payment_method': 'boleto'}
CALCULATE_INTALLMENTS_AMOUNT = {'amount': '10000', 'free_installm... | Python | 0 |
fa23d59a66cfc192bcfed6cdbb8426479487ccca | Add unit tests | tests/unit/synapseutils/unit_test_synapseutils_walk.py | tests/unit/synapseutils/unit_test_synapseutils_walk.py | import json
import uuid
import pytest
from unittest.mock import patch, call
import synapseclient
import synapseutils.walk_functions
def test_helpWalk_not_container(syn):
"""Test if entry entity isn't a container"""
entity = {"id": "syn123", "concreteType": "File"}
with patch.object(syn, "get", return_va... | import json
import uuid
import pytest
from unittest.mock import patch, call
import synapseclient
import synapseutils.walk_functions
def test_helpWalk_not_container(syn):
"""Test if entry entity isn't a container"""
entity = {"id": "syn123", "concreteType": "File"}
with patch.object(syn, "get", return_va... | Python | 0.000001 |
d2fe267359feec48888469909bec3b432d1f4a93 | Fix `BundleIntegrationTest`. (#4953) | tests/python/pants_test/engine/legacy/test_bundle_integration.py | tests/python/pants_test/engine/legacy/test_bundle_integration.py | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | Python | 0 |
1bccf48e6e142e6c62374dd9d7dc94330f15c650 | Update ipc_lista1.3.py | lista1/ipc_lista1.3.py | lista1/ipc_lista1.3.py | #ipc_lista1.3
#Professor: Jucimar Junior
#Any Mendes Carvalho - 161531004
#
#
#
#
#Faça um programa que peça dois números e imprima a soma.
number1 = input("Digite o primeiro: ")
number2 = input("Digite o segundo número: ")
print(number1+number2)
| #ipc_lista1.3
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que peça dois números e imprima a soma.
number1 = input("Digite o primeiro: ")
number2 = input("Digite o segundo número: ")
print(number1+number2)
| Python | 0 |
4e6fc94fde8eace1b461eba59dc4a56611664877 | Update ipc_lista1.7.py | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
| #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: "
| Python | 0 |
950e9f82be8b3a02ce96db47061cf828da231be9 | Update ipc_lista1.8.py | lista1/ipc_lista1.8.py | lista1/ipc_lista1.8.py | #ipc_lista1.8
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês.
#Calcule e mostre o total do seu salário no referido mês.
QntHora = input("Entre com o valor de seu rendimento por hora: ")
hT = input("E... | #ipc_lista1.8
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês.
#Calcule e mostre o total do seu salário no referido mês.
QntHora = input("Entre com o valor de seu rendimento por hora: ")
hT = input
| Python | 0 |
26c781807937038ec2c4fbfd4413ae2c60decd1b | add stdint.h for c++ default header include. | src/py/cpp_fragment_tmpl.py | src/py/cpp_fragment_tmpl.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
hpp_tmpl="""#ifndef __FRAGMENT_HPP__
#define __FRAGMENT_HPP__
#include <string>
#include <vector>
#include <map>
#include <list>
// linux int type define; should be remore/add by system dependent in the future version.
#include <stdint.h>
{includes}
void fragment_cont... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
hpp_tmpl="""#ifndef __FRAGMENT_HPP__
#define __FRAGMENT_HPP__
#include <string>
#include <vector>
#include <map>
#include <list>
{includes}
void fragment_container();
#endif
"""
cpp_tmpl="""#include "{head_file}"
#include <iostream>
#include <stdio.h>
void fragment_co... | Python | 0 |
5e21c7d0fa46e2b290368533cc6dc741b1d366e2 | correct src path in settings | functional-tests/clickerft/settings.py | functional-tests/clickerft/settings.py | from os.path import dirname, realpath
BASEDIR = dirname(dirname(dirname(realpath(__file__))))
HOME = "file://" + BASEDIR + "/src/"
| import os
BASEDIR = os.path.dirname(os.getcwd())
HOME = "file://" + BASEDIR + "/src/"
| Python | 0.000001 |
54563933a265a7c70adce3996d0a31eb9c915203 | Use kwarg normally in piratepad.controllers.Form | addons/piratepad/controllers.py | addons/piratepad/controllers.py | from openobject.tools import expose
from openerp.controllers import form
from openerp.utils import rpc, TinyDict
import cherrypy
class Form(form.Form):
_cp_path = "/piratepad/form"
@expose('json', methods=('POST',))
def save(self, pad_name):
params, data = TinyDict.split(cherrypy.session['params']... | from openobject.tools import expose
from openerp.controllers import form
from openerp.utils import rpc, common, TinyDict
import cherrypy
class Form(form.Form):
_cp_path = "/piratepad/form"
@expose('json', methods=('POST',))
def save(self, **kwargs):
params, data = TinyDict.split(cherrypy.session['... | Python | 0 |
31aa44ef336c497be9f545c9bd4af64aac250748 | Fix remote coverage execution | python/helpers/coverage_runner/run_coverage.py | python/helpers/coverage_runner/run_coverage.py | """Coverage.py's main entrypoint."""
import os
import sys
bundled_coverage_path = os.getenv('BUNDLED_COVERAGE_PATH')
if bundled_coverage_path:
sys_path_backup = sys.path
sys.path = [p for p in sys.path if p != bundled_coverage_path]
from coverage.cmdline import main
sys.path = sys_path_backup
else:
... | """Coverage.py's main entrypoint."""
import os
import sys
bundled_coverage_path = os.getenv('BUNDLED_COVERAGE_PATH')
if bundled_coverage_path:
sys_path_backup = sys.path
sys.path = [p for p in sys.path if p != bundled_coverage_path]
from coverage.cmdline import main
sys.path = sys_path_backup
else:
... | Python | 0.000001 |
1f6a154967ecd74c538f9ddda3f4a83018a6eef7 | Attempt to fix iris_val_based_early_stopping test. Change: 127441610 | tensorflow/examples/skflow/iris_val_based_early_stopping.py | tensorflow/examples/skflow/iris_val_based_early_stopping.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | Python | 0.999225 |
c109728986a3a583fe037780c88bdaa458e663c4 | Bump 2.1.1 | appium/version.py | appium/version.py | version = '2.1.1'
| version = '2.1.0'
| Python | 0.000011 |
05140304c1ef08e7e291eec92de4091320bdfc0e | Add acceleration to example | encoder/examples/encoder_lcd.py | encoder/examples/encoder_lcd.py | # -*- coding: utf-8 -*-
"""Read encoder and print position value to LCD."""
from machine import sleep_ms
from pyb_encoder import Encoder
from hd44780 import HD44780
class STM_LCDShield(HD44780):
_default_pins = ('PD2','PD1','PD6','PD5','PD4','PD3')
def main():
lcd.set_string("Value: ")
lastval = 0
... | # -*- coding: utf-8 -*-
"""Read encoder and print position value to LCD."""
from machine import sleep_ms
from pyb_encoder import Encoder
from hd44780 import HD44780
class STM_LCDShield(HD44780):
_default_pins = ('PD2','PD1','PD6','PD5','PD4','PD3')
def main():
lcd.set_string("Value: ")
lastval = 0
... | Python | 0 |
2268ebdc47b1d9221c06622a7b1992cae14013c2 | Test endpoint for the web server | web/server.py | web/server.py | import http.client
import os
from flask import Flask
from pymongo import MongoClient
MONGO_URL = os.environ.get('MONGO_URL', 'mongodb://mongo:27017/')
MONGO_DATABASE = os.environ.get('MONGO_DATABASE', 'whistleblower')
DATABASE = MongoClient(MONGO_URL)[MONGO_DATABASE]
app = Flask(__name__)
@app.route('/')
def hello_... | import http.client
import os
from flask import Flask
from pymongo import MongoClient
MONGO_URL = os.environ.get('MONGO_URL', 'mongodb://mongo:27017/')
MONGO_DATABASE = os.environ.get('MONGO_DATABASE', 'whistleblower')
DATABASE = MongoClient(MONGO_URL)[MONGO_DATABASE]
app = Flask(__name__)
@app.route('/facebook_webh... | Python | 0 |
db40a42c2825b157017e6730a2b5c95371bbe598 | Allow user to adjust nyquist freq and freq spacing in cp_utils.py | arfit/cp_utils.py | arfit/cp_utils.py | import carmcmc as cm
from gatspy.periodic import LombScargleFast
import matplotlib.pyplot as plt
import numpy as np
def csample_from_files(datafile, chainfile, p, q):
data = np.loadtxt(datafile)
times, tind = np.unique(data[:,0], return_index=True)
data = data[tind, :]
chain = np.loadtxt(chainfil... | import carmcmc as cm
from gatspy.periodic import LombScargleFast
import matplotlib.pyplot as plt
import numpy as np
def csample_from_files(datafile, chainfile, p, q):
data = np.loadtxt(datafile)
times, tind = np.unique(data[:,0], return_index=True)
data = data[tind, :]
chain = np.loadtxt(chainfil... | Python | 0 |
4fd80a9a593a4f9100899e96a383782c68a41af1 | Fix to subtract USDT withdrawals from balance | poloniex_apis/api_models/deposit_withdrawal_history.py | poloniex_apis/api_models/deposit_withdrawal_history.py | from collections import defaultdict
from poloniex_apis.api_models.ticker_price import TickerData
class DWHistory:
def __init__(self, history):
self.withdrawals = defaultdict(float)
self.deposits = defaultdict(float)
self.history = history
def get_dw_history(self):
for deposit... | from collections import defaultdict
from poloniex_apis.api_models.ticker_price import TickerData
class DWHistory:
def __init__(self, history):
self.withdrawals = defaultdict(float)
self.deposits = defaultdict(float)
self.history = history
def get_dw_history(self):
for deposit... | Python | 0.000007 |
1e16048c7ceb50377fdfdda3a39ef9910d2021bb | Bump version to 0.2 | wagtail_simple_gallery/__init__.py | wagtail_simple_gallery/__init__.py | __version__ = '0.2' | __version__ = '0.1' | Python | 0.000001 |
7e9d3b3d2c4e46c2b16595b7acc6aa670ece9e6e | use correct API to save to bucket. | astrobin/tasks.py | astrobin/tasks.py | from django.conf import settings
from celery.decorators import task
from celery.task.sets import subtask
from PIL import Image as PILImage
from subprocess import call
import StringIO
import os
import os.path
from image_utils import *
from s3 import *
from notifications import *
@task()
def solve_image(image, callba... | from django.conf import settings
from celery.decorators import task
from celery.task.sets import subtask
from PIL import Image as PILImage
from subprocess import call
import StringIO
import os
import os.path
from image_utils import *
from s3 import *
from notifications import *
@task()
def solve_image(image, callba... | Python | 0 |
70f137998b2cc3b9c873a57e17a435c6ca181192 | improve code for getting the pricelist | product_supplier_intercompany/models/purchase_order.py | product_supplier_intercompany/models/purchase_order.py | # Copyright 2021 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, fields, models
from odoo.exceptions import UserError
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
... | # Copyright 2021 Akretion (https://www.akretion.com).
# @author Sébastien BEAU <sebastien.beau@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, models
from odoo.exceptions import UserError
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
def _p... | Python | 0 |
590ba3c9d645f6eac41687bee9f12f7c914858d6 | revert to http for loading clusters | progressivis/datasets/__init__.py | progressivis/datasets/__init__.py | import os
from progressivis import ProgressiveError
from .random import generate_random_csv
from .wget import wget_file
DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../data'))
def get_dataset(name, **kwds):
if not os.path.isdir(DATA_DIR):
os.mkdir(DATA_DIR)
if name == 'bigfi... | import os
from progressivis import ProgressiveError
from .random import generate_random_csv
from .wget import wget_file
DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../data'))
def get_dataset(name, **kwds):
if not os.path.isdir(DATA_DIR):
os.mkdir(DATA_DIR)
if name == 'bigfi... | Python | 0 |
0658934a7a7a1581c6f1d871c192f49b42144b09 | fix issue with ControlPlayer on mac | pyforms/gui/Controls/ControlPlayer/VideoQt5GLWidget.py | pyforms/gui/Controls/ControlPlayer/VideoQt5GLWidget.py | from pyforms.gui.Controls.ControlPlayer.AbstractGLWidget import AbstractGLWidget
from PyQt5 import QtGui
from PyQt5.QtWidgets import QOpenGLWidget
from PyQt5 import QtCore
class VideoQt5GLWidget(AbstractGLWidget, QOpenGLWidget):
def initializeGL(self):
self.gl = self.context().versionFunctions()
self.gl.initi... | from pyforms.gui.Controls.ControlPlayer.AbstractGLWidget import AbstractGLWidget
from PyQt5 import QtGui
from PyQt5.QtWidgets import QOpenGLWidget
from PyQt5 import QtCore
class VideoQt5GLWidget(AbstractGLWidget, QOpenGLWidget):
def initializeGL(self):
self.gl = self.context().versionFunctions()
self.gl.initi... | Python | 0 |
d0ed8aeb2126a4b14b8413bd8c6d54952451e890 | Update version number. | libcloud/__init__.py | libcloud/__init__.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Python | 0.000021 |
b999240903bb71e14818fb3f2d8eb12bda75ada2 | Bump tensorflow to 2.1.0 (#721) | tensorflow_io/core/python/ops/version_ops.py | tensorflow_io/core/python/ops/version_ops.py | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 |
ce0a3a4b13b8257fa95c95376a043b02958e73f2 | Fix exception parameters | src/sentry_gitlab/plugin.py | src/sentry_gitlab/plugin.py | """
sentry_gitlab.plugin
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django import forms
from sentry.plugins.bases.issue import IssuePlugin
from django.utils.translation import ugettext_lazy as _
from gitlab import *... | """
sentry_gitlab.plugin
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django import forms
from sentry.plugins.bases.issue import IssuePlugin
from django.utils.translation import ugettext_lazy as _
from gitlab import *... | Python | 0.000011 |
f45cd2ff52cb672068e4bcf31b9c260cd43032ee | Use timeout decorator with use_signals=False | paasta_tools/remote_git.py | paasta_tools/remote_git.py | # Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | # Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | Python | 0.023608 |
a9cd7d6eaa7ea70e962cf4d1c9e4aa53a2845968 | Bump version number | lillebror/version.py | lillebror/version.py | # Copyright 2012 Loop Lab
#
# 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, sof... | # Copyright 2012 Loop Lab
#
# 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, sof... | Python | 0.000002 |
d9f445796599bf1ecb48e21a53f3188925012053 | Correct order of synced/desynced subtitles in calc_correction | linear-correction.py | linear-correction.py | #!/usr/bin/env python
import srt
import datetime
import utils
def timedelta_to_milliseconds(delta):
return delta.days * 86400000 + \
delta.seconds * 1000 + \
delta.microseconds / 1000
def parse_args():
def srt_timestamp_to_milliseconds(parser, arg):
try:
delta = srt... | #!/usr/bin/env python
import srt
import datetime
import utils
def timedelta_to_milliseconds(delta):
return delta.days * 86400000 + \
delta.seconds * 1000 + \
delta.microseconds / 1000
def parse_args():
def srt_timestamp_to_milliseconds(parser, arg):
try:
delta = srt... | Python | 0.000001 |
3fea814461d2a51e0cc13c4981fa6f4cdfca75e9 | Correct broken import, this could never have worked. | providers/moviedata/filmtipset.py | providers/moviedata/filmtipset.py | from providers.moviedata.provider import MoviedataProvider
from urllib import urlencode
from access_keys import ACCESS_KEYS
from application import APPLICATION as APP
IDENTIFIER = "Filmtipset"
class Provider(MoviedataProvider):
def get_url(self, movie):
options = {
"action": "search",
... | from providers.moviedata.provider import MoviedataProvider
from urllib import urlencode
from settings import ACCESS_KEYS
from application import APPLICATION as APP
IDENTIFIER = "Filmtipset"
class Provider(MoviedataProvider):
def get_url(self, movie):
options = {
"action": "search",
... | Python | 0 |
ca49d4b27407812e2afcd5a20e546db85706d538 | refactor operator append | calculator.py | calculator.py | import re
from collections import deque
class Calculator:
supported_operators = {
"*": {"precedence": 3, "assoc": "left"},
"/": {"precedence": 3, "assoc": "left"},
"+": {"precedence": 2, "assoc": "left"},
"-": {"precedence": 2, "assoc": "left"}
}
def calculate(self, input_s... | import re
from collections import deque
class Calculator:
supported_operators = {
"*": {"precedence": 3, "assoc": "left"},
"/": {"precedence": 3, "assoc": "left"},
"+": {"precedence": 2, "assoc": "left"},
"-": {"precedence": 2, "assoc": "left"}
}
def calculate(self, input_s... | Python | 0.000014 |
00d9ee19790e0cd1bfdab0765e4c0e858d5f22bd | fix bug in use of 'media' | localcrawler/core.py | localcrawler/core.py | from urlparse import urlparse
from BeautifulSoup import BeautifulSoup
from django.conf import settings
from django.test.client import Client
import sys
__all__ = ['Crawler']
class Crawler(object):
def __init__(self, entry_point='/',
img=True, media=True, # Media is deprecated: Use img
... | from urlparse import urlparse
from BeautifulSoup import BeautifulSoup
from django.conf import settings
from django.test.client import Client
import sys
__all__ = ['Crawler']
class Crawler(object):
def __init__(self, entry_point='/',
img=True, media=True, # Media is deprecated: Use img
... | Python | 0 |
b8241c2ff0cff4a0bc96e6d229c80029cdbcb71c | Change contact email. | luminoth/__init__.py | luminoth/__init__.py | from .cli import cli # noqa
__version__ = '0.0.1.dev0'
__title__ = 'Luminoth'
__description__ = 'Computer vision toolkit based on TensorFlow'
__uri__ = 'http://luminoth.ai'
__doc__ = __description__ + ' <' + __uri__ + '>'
__author__ = 'Tryolabs'
__email__ = 'luminoth@tryolabs.com'
__license__ = 'BSD 3-Clause Licen... | from .cli import cli # noqa
__version__ = '0.0.1.dev0'
__title__ = 'Luminoth'
__description__ = 'Computer vision toolkit based on TensorFlow'
__uri__ = 'http://luminoth.ai'
__doc__ = __description__ + ' <' + __uri__ + '>'
__author__ = 'Tryolabs'
__email__ = 'hello@tryolabs.com'
__license__ = 'BSD 3-Clause License'... | Python | 0 |
df3441a2c98fffbb18c11d3660acb86d2e31e5fa | Fix main run | src/ultros/core/__main__.py | src/ultros/core/__main__.py | # coding=utf-8
import argparse
import asyncio
from ultros.core.ultros import Ultros
"""
Ultros - Module runnable
"""
__author__ = "Gareth Coles"
__version__ = "0.0.1"
def start(arguments):
u = Ultros(arguments.config, arguments.data)
u.start()
def init(arguments):
pass
if __name__ == "__main__":
... | # coding=utf-8
import argparse
import asyncio
from ultros.core.ultros import Ultros
"""
Ultros - Module runnable
"""
__author__ = "Gareth Coles"
__version__ = "0.0.1"
def start(args):
u = Ultros(args.config, args.data)
# Gonna have to be a coroutine if we're AIO-based. Probably.
asyncio.get_event_loop(... | Python | 0.000733 |
4300cf8c6e98081c429fcbed44ed387af7735aa4 | Add a link to python-markdown-math extension | markups/mdx_mathjax.py | markups/mdx_mathjax.py | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2015
# Maintained in https://github.com/mitya57/python-markdown-math
'''
Math extension for Python-Markdown
==================================
Adds support for displaying math formulas using [MathJax](http://www.mathjax.org... | # This file is part of python-markups module
# License: BSD
# Copyright: (C) Dmitry Shachnev, 2015
'''
Math extension for Python-Markdown
==================================
Adds support for displaying math formulas using [MathJax](http://www.mathjax.org/).
Author: 2015, Dmitry Shachnev <mitya57@gmail.com>.
'''
from... | Python | 0 |
5229bf4a16d468a3a337db65c478671409d6d898 | Update summery.py | metric-consumer/summary.py | metric-consumer/summary.py | #!/usr/bin/python
import os
import argparse
import re
def cumulative_moving_average(new_value, old_mean, total_items):
return old_mean + (new_value - old_mean) / total_items
def print_file_summary(path):
cma = 0
n = 0
with open(path, 'r') as csv_file:
all_lines = csv_file.readlines()
for line in all_line... | #!/usr/bin/python
import os
import argparse
import re
def cumulative_moving_average(new_value, old_mean, total_items):
return old_mean + (new_value - old_mean) / total_items
def print_file_summary(path):
cma = 0
n = 0
with open(path, 'r') as csv_file:
all_lines = csv_file.readlines()
for line in all_line... | Python | 0.000001 |
4395fb9d6c1f7c4c48618a13681eae16e5e41ae6 | Fix docs | xpathwebdriver/default_settings.py | xpathwebdriver/default_settings.py | # -*- coding: utf-8 -*-
'''
Smoothtest
Copyright (c) 2014 Juju. Inc
Code Licensed under MIT License. See LICENSE file.
'''
import logging
import json
class Settings(object):
def __init__(self):
if self.webdriver_remote_credentials_path:
with open(self.webdriver_remote_credentials_path, 'r') a... | # -*- coding: utf-8 -*-
'''
Smoothtest
Copyright (c) 2014 Juju. Inc
Code Licensed under MIT License. See LICENSE file.
'''
import logging
import json
class Settings(object):
def __init__(self):
if self.webdriver_remote_credentials_path:
with open(self.webdriver_remote_credentials_path, 'r') a... | Python | 0.000003 |
4eb71abf71823a5a065d1b593ca8b624d17a35c9 | prepare for 1.6 | src/pyckson/__init__.py | src/pyckson/__init__.py | from pyckson.decorators import *
from pyckson.json import *
from pyckson.parser import parse
from pyckson.parsers.base import Parser
from pyckson.serializer import serialize
from pyckson.serializers.base import Serializer
from pyckson.dates.helpers import configure_date_formatter
__version__ = '1.6'
| from pyckson.decorators import *
from pyckson.json import *
from pyckson.parser import parse
from pyckson.parsers.base import Parser
from pyckson.serializer import serialize
from pyckson.serializers.base import Serializer
from pyckson.dates.helpers import configure_date_formatter
__version__ = '1.5'
| Python | 0.000001 |
63ae7b4caf877cb043b2c2d4861e6ab5bb5f5390 | fix flake8 | memote/suite/runner.py | memote/suite/runner.py | # -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | # -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | Python | 0 |
ea2852a2a1219ecc23bcbb04c4120a6432f67d0d | Support for ffmpeg showifo filter and collecting frame details. | src/python/video_scripts/frames.py | src/python/video_scripts/frames.py | # (c) Patryk Czarnik
# Distributed under MIT License. See LICENCE file in the root directory for details.
# This module defines classes and functions to identify and search for individual frames of videos.
from subprocess import call
import re
import sys
from typing import List
pv = re.compile(r"\[Parsed_showinfo.*\... | # (c) Patryk Czarnik
# Distributed under MIT License. See LICENCE file in the root directory for details.
# This module defines classes and functions to identify and search for individual frames of videos.
from typing import List
class Frame:
'''Abstract class representing a frame in a multimedia file.'''
de... | Python | 0 |
3fc6a711146afa79794ec884f560f1ea43e4565a | Update the latest version | src/site/sphinx/conf.py | src/site/sphinx/conf.py | # -*- coding: utf-8 -*-
import sys, os, re
import xml.etree.ElementTree as etree
from datetime import date
from collections import defaultdict
def etree_to_dict(t):
t.tag = re.sub(r'\{[^\}]*\}', '', t.tag)
d = {t.tag: {} if t.attrib else None}
children = list(t)
if children:
dd = defaultdict(li... | # -*- coding: utf-8 -*-
import sys, os, re
import xml.etree.ElementTree as etree
from datetime import date
from collections import defaultdict
def etree_to_dict(t):
t.tag = re.sub(r'\{[^\}]*\}', '', t.tag)
d = {t.tag: {} if t.attrib else None}
children = list(t)
if children:
dd = defaultdict(li... | Python | 0 |
521c71c38d4e6edc242afb76daf330d9aec8e9ff | remove ipdb | scripts/dataverse/connect_external_accounts.py | scripts/dataverse/connect_external_accounts.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
from website.addons.dataverse.model import AddonDataverseNodeSettings
logger = logging... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
from website.addons.dataverse.model import AddonDataverseNodeSettings
logger = logging... | Python | 0.000016 |
9cdd86499013c1deac7caeb8320c34294789f716 | Add _kill_and_join to async actor stub | py/garage/garage/asyncs/actors.py | py/garage/garage/asyncs/actors.py | """Asynchronous support for garage.threads.actors."""
__all__ = [
'StubAdapter',
]
from garage.asyncs import futures
class StubAdapter:
"""Wrap all method calls, adding FutureAdapter on their result.
While this simple adapter does not work for all corner cases, for
common cases, it should work fine... | """Asynchronous support for garage.threads.actors."""
__all__ = [
'StubAdapter',
]
from garage.asyncs import futures
class StubAdapter:
"""Wrap all method calls, adding FutureAdapter on their result.
While this simple adapter does not work for all corner cases, for
common cases, it should work fine... | Python | 0.000001 |
16381d4fafe743c3feb1de7ec27b6cbf95f617f1 | Add state and conf to interactive namespace by default | pyexperiment/utils/interactive.py | pyexperiment/utils/interactive.py | """Provides helper functions for interactive prompts
Written by Peter Duerr
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from pyexperiment import state
from pyexperiment import conf
def embed_interactive(**kw... | """Provides helper functions for interactive prompts
Written by Peter Duerr
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
def embed_interactive(**kwargs):
"""Embed an interactive terminal into a running py... | Python | 0 |
6cd34697334ddd8ada1daeee9a2c8b9522257487 | Remove unused function | pyramda/iterable/for_each_test.py | pyramda/iterable/for_each_test.py | try:
# Python 3
from unittest import mock
except ImportError:
# Python 2
import mock
from .for_each import for_each
def test_for_each_nocurry_returns_the_original_iterable():
assert for_each(mock.MagicMock(), [1, 2, 3]) == [1, 2, 3]
def test_for_each_curry_returns_the_original_iterable():
a... |
try:
# Python 3
from unittest import mock
except ImportError:
# Python 2
import mock
from .for_each import for_each
def print_x_plus_5(x):
print(x + 5)
def test_for_each_nocurry_returns_the_original_iterable():
assert for_each(mock.MagicMock(), [1, 2, 3]) == [1, 2, 3]
def test_for_each_c... | Python | 0.000004 |
4f2b7e5601e9f241868f86743eacb0e432be7495 | fix settings of cache in UT | source/jormungandr/tests/integration_tests_settings.py | source/jormungandr/tests/integration_tests_settings.py | # encoding: utf-8
START_MONITORING_THREAD = False
SAVE_STAT = True
# désactivation de l'authentification
PUBLIC = True
LOGGER = {
'version': 1,
'disable_existing_loggers': False,
'formatters':{
'default': {
'format': '[%(asctime)s] [%(levelname)5s] [%(process)5s] [%(name)10s] %(messag... | # encoding: utf-8
START_MONITORING_THREAD = False
SAVE_STAT = True
# désactivation de l'authentification
PUBLIC = True
LOGGER = {
'version': 1,
'disable_existing_loggers': False,
'formatters':{
'default': {
'format': '[%(asctime)s] [%(levelname)5s] [%(process)5s] [%(name)10s] %(messag... | Python | 0 |
26c4effd8741d2511bb0b3bd46cca12d37b0e01b | Add file magic | examples/python/scheme_timer.py | examples/python/scheme_timer.py | #! /usr/bin/env python
"""
Checks the execution time of repeated calls to the Scheme API from Python
Runs an empty Scheme command NUMBER_OF_ITERATIONS times and displays the
total execution time
"""
__author__ = 'Cosmo Harrigan'
NUMBER_OF_ITERATIONS = 100
from opencog.atomspace import AtomSpace, TruthValue, types,... | """
Checks the execution time of repeated calls to the Scheme API from Python
Runs an empty Scheme command NUMBER_OF_ITERATIONS times and displays the
total execution time
"""
__author__ = 'Cosmo Harrigan'
NUMBER_OF_ITERATIONS = 100
from opencog.atomspace import AtomSpace, TruthValue, types, get_type_name
from open... | Python | 0.000001 |
075e7ea4e6be57cb618fcc26484456bf24db99c9 | add button for pyjd to load slides | examples/slideshow/Slideshow.py | examples/slideshow/Slideshow.py | import pyjd
from pyjamas.ui.Button import Button
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HTML import HTML
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui import HasAlignment
from pyjamas.ui.Hyperlink import Hyperlink
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.Scrol... | from pyjamas.ui.Button import Button
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HTML import HTML
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui import HasAlignment
from pyjamas.ui.Hyperlink import Hyperlink
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.ScrollPanel import... | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.