commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
1a089c634bc608e5862ce549ed598e50c02b8d09 | Bump version | mishbahr/django-users2,mishbahr/django-users2 | users/__init__.py | users/__init__.py | __version__ = '0.1.3'
| __version__ = '0.1.2'
| bsd-3-clause | Python |
44202d1c178d76c5db22a9b9ce4e7138a0cb73c7 | upgrade to v3.9.4 | rainmattertech/pykiteconnect | kiteconnect/__version__.py | kiteconnect/__version__.py | __title__ = "kiteconnect"
__description__ = "The official Python client for the Kite Connect trading API"
__url__ = "https://kite.trade"
__download_url__ = "https://github.com/zerodhatech/pykiteconnect"
__version__ = "3.9.4"
__author__ = "Zerodha Technology Pvt ltd. (India)"
__author_email__ = "talk@zerodha.tech"
__lic... | __title__ = "kiteconnect"
__description__ = "The official Python client for the Kite Connect trading API"
__url__ = "https://kite.trade"
__download_url__ = "https://github.com/zerodhatech/pykiteconnect"
__version__ = "3.9.2"
__author__ = "Zerodha Technology Pvt ltd. (India)"
__author_email__ = "talk@zerodha.tech"
__lic... | mit | Python |
f1217f04f17daa3d77c9a3197b33d87b8f775056 | Replace OpenERP by Odoo | guewen/l10n-switzerland,open-net-sarl/l10n-switzerland,cyp-opennet/ons_cyp_github,cyp-opennet/ons_cyp_github,BT-aestebanez/l10n-switzerland,BT-fgarbely/l10n-switzerland,eLBati/l10n-switzerland,CompassionCH/l10n-switzerland,CompassionCH/l10n-switzerland,open-net-sarl/l10n-switzerland,BT-fgarbely/l10n-switzerland,BT-ojos... | l10n_ch_zip/__openerp__.py | l10n_ch_zip/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Nicolas Bessi. Copyright Camptocamp SA
# Contributor: WinGo SA
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Nicolas Bessi. Copyright Camptocamp SA
# Contributor: WinGo SA
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all... | agpl-3.0 | Python |
b37988c7d6b260793cc8e88e0057f1a59d2fcc0b | fix migration file | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds_reports/migrations/0060_added_phone_number_to_views.py | custom/icds_reports/migrations/0060_added_phone_number_to_views.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-10 14:05
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templa... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-10 14:05
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templa... | bsd-3-clause | Python |
c5f2b65aa172b10206950a5981a06afef5742173 | Improve reliability of galera_consistency.py | andymcc/rpc-openstack,jacobwagner/rpc-openstack,claco/rpc-openstack,jpmontez/rpc-openstack,jacobwagner/rpc-openstack,cfarquhar/rpc-openstack,sigmavirus24/rpc-openstack,cloudnull/rpc-openstack,busterswt/rpc-openstack,briancurtin/rpc-maas,prometheanfire/rpc-openstack,robb-romans/rpc-openstack,cloudnull/rpc-maas,BjoernT/r... | galera_consistency.py | galera_consistency.py | import io
import optparse
import subprocess
def table_checksum(user, password, host):
"""Run pt-table-checksum with the user, password, and host specified."""
args = ['/usr/bin/pt-table-checksum', '-u', user, '-p', password]
if host:
args.extend(['-h', host])
out = io.StringIO()
err = io.... | import optparse
import subprocess
def table_checksum(user, password, host):
args = ['/usr/bin/pt-table-checksum', '-u', user, '-p', password]
if host:
args.extend(['-h', host])
proc = subprocess.Popen(args, stderr=subprocess.PIPE)
(out, err) = proc.communicate()
return (proc.return_code, ... | apache-2.0 | Python |
1b2fa45766b1ea5945f246d74bc4adf0114abe84 | Fix typo in description of config item | imbasimba/astroquery,ceb8/astroquery,imbasimba/astroquery,ceb8/astroquery | astroquery/splatalogue/__init__.py | astroquery/splatalogue/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Splatalogue Catalog Query Tool
-----------------------------------
:Author: Adam Ginsburg (adam.g.ginsburg@gmail.com)
:Originally contributed by:
Magnus Vilhelm Persson (magnusp@vilhelm.nu)
"""
from astropy import config as _config
class Conf... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Splatalogue Catalog Query Tool
-----------------------------------
:Author: Adam Ginsburg (adam.g.ginsburg@gmail.com)
:Originally contributed by:
Magnus Vilhelm Persson (magnusp@vilhelm.nu)
"""
from astropy import config as _config
class Conf... | bsd-3-clause | Python |
a1c60939302bd60d0e7708d19b7eee3d2970bbfb | Fix minion state assertions - multiple keys possible | dincamihai/salt-toaster,dincamihai/salt-toaster | assertions.py | assertions.py | import re
import shlex
import subprocess
from config import SALT_KEY_CMD
def has_expected_state(expected_state, mapping, env):
assert expected_state in mapping
cmd = shlex.split(SALT_KEY_CMD.format(**env))
cmd.append("-L")
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env)
output, un... | import re
import shlex
import subprocess
from config import SALT_KEY_CMD
def assert_minion_key_state(env, expected_state):
STATES_MAPPING = dict(
unaccepted=re.compile("Unaccepted Keys:\n{HOSTNAME}".format(**env)),
accepted=re.compile("Accepted Keys:\n{HOSTNAME}".format(**env))
)
assert ex... | mit | Python |
f3ec85cd7baf65036ed76a2c4ab4fe935b81b805 | introduce logging | fuzzy-id/midas,fuzzy-id/midas,fuzzy-id/midas | midas/scripts/md_config.py | midas/scripts/md_config.py | # -*- coding: utf-8 -*-
import logging
import sys
from midas.scripts import MDCommand
import midas.config as md_cfg
logger = logging.getLogger(__name__)
class MDConfig(MDCommand):
""" Read all configuration files, print the final configuration
and exit.
This can be used to see how a configuration fil... | # -*- coding: utf-8 -*-
import sys
from midas.scripts import MDCommand
import midas.config as md_cfg
class MDConfig(MDCommand):
""" Read all configuration files, print the final configuration
and exit.
This can be used to see how a configuration file (e.g. a job file)
alters the whole configuratio... | bsd-3-clause | Python |
8790eec0fdd94beeb4d0ceac8b24a1de77bd3eee | Update sql2rf.py | victoriamorris/iams2rf | bin/sql2rf.py | bin/sql2rf.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""Script to search for records within an SQL database created using snapshot2sql
and convert to Researcher Format."""
# Import required modules
# import datetime
import getopt
# import sys
from iams2rf import *
__author__ = 'Victoria Morris'
__license__ = 'M... | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""Script to search for records within an SQL database created using snapshot2sql
and convert to Researcher Format."""
# Import required modules
# import datetime
import getopt
# import sys
from iams2rf import *
__author__ = 'Victoria Morris'
__license__ = 'M... | mit | Python |
7c382a33fa3f691fcbf89621b48c0c9e3a921d03 | update version number | PytLab/VASPy,PytLab/VASPy | vaspy/__init__.py | vaspy/__init__.py | __version__ = '0.1.1' # add d-band center calculation
class VasPy(object):
def __init__(self, filename):
"Base class to be inherited by all classes in VASPy."
self.filename = filename
class CarfileValueError(Exception):
"Exception raised for errors in the CONTCAR-like file."
pass
clas... | __version__ = '0.1.0' # add electro module
class VasPy(object):
def __init__(self, filename):
"Base class to be inherited by all classes in VASPy."
self.filename = filename
class CarfileValueError(Exception):
"Exception raised for errors in the CONTCAR-like file."
pass
class Unmatched... | mit | Python |
4d63320c2bf077e90cffb98286e0354dcab1fc64 | Make runTestCases.py possible to run independently | paleyss/incubator-mnemonic,lql5083psu/incubator-mnemonic,johnugeorge/incubator-mnemonic,paleyss/incubator-mnemonic,johnugeorge/incubator-mnemonic,NonVolatileComputing/incubator-mnemonic,yzz127/incubator-mnemonic,NonVolatileComputing/incubator-mnemonic,lql5083psu/incubator-mnemonic,yzz127/incubator-mnemonic,lql5083psu/i... | build-tools/runTestCases.py | build-tools/runTestCases.py | #! /usr/bin/env python
#
# 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 "L... | #! /usr/bin/env python
#
# 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 "L... | apache-2.0 | Python |
e977d997ab66196b519c60dea34e360dfa4fb15d | Complete decreasing pivot swap reverse sol | bowen0701/algorithms_data_structures | lc0031_next_permutation.py | lc0031_next_permutation.py | """Leetcode 31. Next Permutation
Medium
URL: https://leetcode.com/problems/next-permutation/
Implement next permutation, which rearranges numbers into the lexicographically
next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible
order (ie, sorted in ascen... | """Leetcode 31. Next Permutation
Medium
URL: https://leetcode.com/problems/next-permutation/
Implement next permutation, which rearranges numbers into the lexicographically
next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible
order (ie, sorted in ascen... | bsd-2-clause | Python |
587c4603d3ab379e4ee22f2dcda7d7798cd35dcf | fix spacing around arguments | damonsauve/db-credentials | db_credentials/DBCredentials.py | db_credentials/DBCredentials.py | #! /usr/local/bin/python
import sys
import re
class DBCredentials:
def __init__(self):
self.creds = {
'host':'',
'port':'',
'username':'',
'password':'',
'database':'',
}
return;
# Load credentials from a file: no input va... | #! /usr/local/bin/python
import sys
import re
class DBCredentials:
def __init__( self ):
self.creds = {
'host':'',
'port':'',
'username':'',
'password':'',
'database':'',
}
return;
# Load credentials from a file: no input ... | mit | Python |
b939558f3d4bd0fa90f3f467ca85f698c4813046 | Update __init__.py | caktus/django-comps,caktus/django-comps | comps/__init__.py | comps/__init__.py | """
A simple application that provides an entry point for integrating
front end designers into a django project
"""
__version__ = '0.3.0'
| """
A simple application that provides an entry point for integrating
front end designers into a django project
"""
__version__ = '0.2.0'
| bsd-3-clause | Python |
86f143863fd9f0786fe83a5038b970b4782306ce | Check table exist | indictranstech/erpnext,gsnbng/erpnext,njmube/erpnext,Aptitudetech/ERPNext,indictranstech/erpnext,gsnbng/erpnext,gsnbng/erpnext,indictranstech/erpnext,geekroot/erpnext,geekroot/erpnext,geekroot/erpnext,njmube/erpnext,gsnbng/erpnext,njmube/erpnext,geekroot/erpnext,njmube/erpnext,indictranstech/erpnext | erpnext/patches/v7_0/update_missing_employee_in_timesheet.py | erpnext/patches/v7_0/update_missing_employee_in_timesheet.py | from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.table_exists("Time Log"):
timesheet = frappe.db.sql("""select tl.employee as employee, ts.name as name,
tl.modified as modified, tl.modified_by as modified_by, tl.creation as creation, tl.owner as owner
from
`tabTimesheet`... | from __future__ import unicode_literals
import frappe
def execute():
timesheet = frappe.db.sql("""select tl.employee as employee, ts.name as name,
tl.modified as modified, tl.modified_by as modified_by, tl.creation as creation, tl.owner as owner
from
`tabTimesheet` ts, `tabTimesheet Detail` tsd, `tabTime Log... | agpl-3.0 | Python |
b8c05a7ea6abefa3014f8703864031876c211679 | Add link for total malaria cases for year 2015 for Indonesia | DataKind-SG/healthcare_ASEAN | src/data/download_scripts/ID_malaria_down.py | src/data/download_scripts/ID_malaria_down.py | # This script downloads yearly malaria statistics from data.go.id
# It uses urllib and is compatible with both Python 2 and 3
import os
import sys
import logging #logs what goes on
DIRECTORY = '../../Data/raw/disease_ID'
OUTFILE = "yearly-malaria.csv"
URL = "http://data.go.id/dataset/cef9b348-91a9-4270-be1d-3cf64eb9d... | # This script downloads yearly malaria statistics from data.go.id
# It uses urllib and is compatible with both Python 2 and 3
import os
import sys
import logging #logs what goes on
DIRECTORY = '../../Data/raw/disease_ID'
OUTFILE = "yearly-malaria.csv"
URL = "http://data.go.id/dataset/cef9b348-91a9-4270-be1d-3cf64eb9d... | mit | Python |
193cc8025910b92f764e6e1339ce2ec213b20cc5 | Fix duck punching unit test. | RobinD42/pyside,gbaty/pyside2,IronManMark20/pyside2,qtproject/pyside-pyside,BadSingleton/pyside2,M4rtinK/pyside-android,M4rtinK/pyside-bb10,PySide/PySide,qtproject/pyside-pyside,enthought/pyside,M4rtinK/pyside-android,IronManMark20/pyside2,M4rtinK/pyside-bb10,RobinD42/pyside,IronManMark20/pyside2,BadSingleton/pyside2,R... | tests/qtcore/duck_punching_test.py | tests/qtcore/duck_punching_test.py | #!/usr/bin/python
'''Test case for duck punching new implementations of C++ virtual methods into object instances.'''
import unittest
import types
from PySide.QtCore import QObject, QEvent
from helper import UsesQCoreApplication
class Duck(QObject):
def __init__(self):
QObject.__init__(self)
def chil... | #!/usr/bin/python
'''Test case for duck punching new implementations of C++ virtual methods into object instances.'''
import unittest
import types
from PySide.QtCore import QObject, QEvent
from helper import UsesQCoreApplication
class Duck(QObject):
def __init__(self):
QObject.__init__(self)
def chil... | lgpl-2.1 | Python |
3d237a6bf3a3dff684e08496f800a8957a9e3352 | Fix pep error. | VitalPet/hr,VitalPet/hr,yelizariev/hr,feketemihai/hr,charbeljc/hr,yelizariev/hr,acsone/hr,damdam-s/hr,thinkopensolutions/hr,vrenaville/hr,Endika/hr,microcom/hr,iDTLabssl/hr,abstract-open-solutions/hr,Antiun/hr,raycarnes/hr,Vauxoo/hr,feketemihai/hr,acsone/hr,Endika/hr,iDTLabssl/hr,alanljj/oca_hr,Vauxoo/hr,raycarnes/hr,x... | hr_contract_hourly_rate/models/hr_hourly_rate_class.py | hr_contract_hourly_rate/models/hr_hourly_rate_class.py | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | agpl-3.0 | Python |
c88314f935d9bf1e65c2a4f6d3eb6931fee5c4f5 | fix evaluate.py | BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH | 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.'... | apache-2.0 | Python |
cc7e3e5ef9d9c59b6b1ac80826445839ede73092 | Revert mast dev host change | imbasimba/astroquery,ceb8/astroquery,imbasimba/astroquery,ceb8/astroquery | 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`.
"""
... | bsd-3-clause | Python |
3ef82203daebd532af2f8effebe8fa31cec11e76 | fix error message encoding | jaloren/robotframework,jaloren/robotframework,kurtdawg24/robotframework,Colorfulstan/robotframework,suvarnaraju/robotframework,ashishdeshpande/robotframework,SivagnanamCiena/robotframework,jorik041/robotframework,snyderr/robotframework,userzimmermann/robotframework,edbrannin/robotframework,joongh/robotframework,stasiek... | 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... | apache-2.0 | Python |
fe67796130854d83b3dfaa085d67d9eabe35a155 | Allow getdate for Energy Point Rule condition | yashodhank/frappe,yashodhank/frappe,frappe/frappe,saurabh6790/frappe,almeidapaulopt/frappe,adityahase/frappe,almeidapaulopt/frappe,saurabh6790/frappe,almeidapaulopt/frappe,adityahase/frappe,StrellaGroup/frappe,vjFaLk/frappe,mhbu50/frappe,frappe/frappe,yashodhank/frappe,adityahase/frappe,mhbu50/frappe,vjFaLk/frappe,mhbu... | 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_... | mit | Python |
6a2a0667179a78e2c56dff551b0d010db6ed0150 | fix imports | toslunar/chainerrl,toslunar/chainerrl | 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
| mit | Python |
fb19411797ae7ac00e022a9409459c0f42969a91 | Remove unused code | patrick91/pycon,patrick91/pycon | 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... | mit | Python |
4563e383962690cc196f4551f217d488501b660e | support for mysql as well | thenetcircle/dino,thenetcircle/dino,thenetcircle/dino,thenetcircle/dino | 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... | apache-2.0 | Python |
81de62d46d7daefb2e1eef0d0cc4f5ca5c8aef2f | Use GCBV queryset to get PostGetMixin obj. | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | 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... | bsd-2-clause | Python |
2b419d499c37597094379f524d8347f35eeda57c | Fix tinycss css validator | eghuro/crawlcheck | 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... | mit | Python |
88dd48eab612e89b956dea5600a999c78c61d5fb | fix lpproj algorithm | jakevdp/lpproj | 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',
... | bsd-3-clause | Python |
8e58d7cccb837254cc433c7533bff119cc19645d | Use json instead of django.utils.simplejson. | pozytywnie/django-javascript-settings | 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... | mit | Python |
afafb47d77fd673abf8d8ce9baa9824b985a943a | Add create_class_wrapper and class_wrapper | ryanhiebert/undecorate | 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... | mit | Python |
551c4b971f1d18e232ba193cf486300d3490224b | add log | icoxfog417/music_hack_day_onpasha,icoxfog417/music_hack_day_onpasha | 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... | mit | Python |
c59c0911c5022291b38774bf407ca83557c78cc5 | test login and logout views. | aneumeier/userprofile,aneumeier/userprofile,aneumeier/userprofile | 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)... | mit | Python |
c6536da7fc1eda82922b286c096412e4371f6d4c | Bump version | jaj42/GraPhysio,jaj42/dyngraph,jaj42/GraPhysio | 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',
]
| isc | Python |
23cdb0d62e44797f84aee61f1a4c2909df8221b0 | Fix settings import and add an option to DjangoAppEngineMiddleware to allow setting up of signals on init | potatolondon/djangoappengine-1-4,potatolondon/djangoappengine-1-4 | 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... | bsd-3-clause | Python |
e4ad2863236cd36e5860f1d17a06ca05e30216d5 | Store more stuff about songs in the queue | projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox,projectweekend/Pi-Jukebox | 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... | mit | Python |
ed97f1cdbcc5a00c2bf597ad921b17da652b0b07 | add annotations to _pytesttester.py | pydata/bottleneck,pydata/bottleneck,kwgoodman/bottleneck,pydata/bottleneck,kwgoodman/bottleneck,kwgoodman/bottleneck | 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... | bsd-2-clause | Python |
075c06a6360d8b88745e3bffd4883beead36c59b | Add orders_script | g4b1nagy/hipmenu-autoorder,g4b1nagy/hipmenu-autoorder | 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': '',... | unlicense | Python |
60890b614132a8cfd48be3e001114275752e9ac4 | fix typo | materialsvirtuallab/megnet,materialsvirtuallab/megnet,materialsvirtuallab/megnet,materialsvirtuallab/megnet,materialsvirtuallab/megnet | 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:
... | bsd-3-clause | Python |
5eb2c6f7e1bf0cc1b73b167a08085fccf77974fe | Tidy up and doc-comment AWSInstanceEnv class | crossgovernmentservices/csd-notes,crossgovernmentservices/csd-notes,crossgovernmentservices/csd-notes | 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... | mit | Python |
9642b8f3d2f14b3a61054f68f05f4ef8eaca0803 | add validation | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | 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
... | bsd-2-clause | Python |
58d7592c603509f2bb625e4e2e5cb31ada4a8194 | Change test for make_kernel(kerneltype='airy') from class to function | AustereCuriosity/astropy,astropy/astropy,lpsinger/astropy,MSeifert04/astropy,larrybradley/astropy,StuartLittlefair/astropy,dhomeier/astropy,kelle/astropy,joergdietrich/astropy,mhvk/astropy,kelle/astropy,joergdietrich/astropy,StuartLittlefair/astropy,tbabej/astropy,dhomeier/astropy,StuartLittlefair/astropy,mhvk/astropy,... | 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... | bsd-3-clause | Python |
21850d8ab44981b2bb02cb50386db717aacc730b | Fix poor coverage | andela-sjames/paystack-python | 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.... | mit | Python |
69ac1eb2f125e93444c134346dca954d8c040d42 | Implement the API to get system running status | ParadropLabs/Paradrop,ParadropLabs/Paradrop,ParadropLabs/Paradrop | 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... | apache-2.0 | Python |
2726ec1c400a212b1cac13f20d65c1b43eb042b0 | Fix formatting in download-google-smart-card-client-library.py | googlechromelabs/chromeos_smart_card_connector,GoogleChromeLabs/chromeos_smart_card_connector,googlechromelabs/chromeos_smart_card_connector,GoogleChromeLabs/chromeos_smart_card_connector,googlechromelabs/chromeos_smart_card_connector,GoogleChromeLabs/chromeos_smart_card_connector,googlechromelabs/chromeos_smart_card_c... | 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 ... | apache-2.0 | Python |
ff9e3c6ef604a47a616e111ee2a90fda77692977 | Bump version to 3.3.2 | JukeboxPipeline/jukeboxmaya,JukeboxPipeline/jukeboxmaya | 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.
"""
| bsd-3-clause | Python |
a9c7a6e441159bdf1fd13d70bcc91617dee93f03 | revert revert. | phil65/script.module.kodi65 | 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... | lgpl-2.1 | Python |
7a83a9be7e2a986979cc898c3fd3aa3bb49442cc | modify dx model | architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS | 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... | mit | Python |
8b359d97e59d759bfd7711c8aacf9abc657fe457 | fix demo | FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE | 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... | apache-2.0 | Python |
ed48555984886ff5ade23aeb23ad5f85e77e5b69 | fix docs | yuyu2172/chainercv,yuyu2172/chainercv,chainer/chainercv,chainer/chainercv,pfnet/chainercv | 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... | mit | Python |
6f04f1ed35635c08836f1eee67983abf9735f5db | handle more exceptions | AppEnlight/channelstream,AppEnlight/channelstream,AppEnlight/channelstream | 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')... | bsd-3-clause | Python |
155fd9ae952a4eba53521739589d5e3462108ed2 | remove default statement per Gunther's comment | Gustavo6046/ChatterBot,Reinaesaya/OUIRL-ChatBot,davizucon/ChatterBot,gunthercox/ChatterBot,vkosuri/ChatterBot,maclogan/VirtualPenPal,Reinaesaya/OUIRL-ChatBot | 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... | bsd-3-clause | Python |
4d81c88627b0f71c765112b9a814fe876239bcc5 | Print stats for constant points to. | plast-lab/llvm-datalog,plast-lab/cclyzer | 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... | mit | Python |
40fe16d058d18d2384be464ecefed1028edace17 | Fix error on SASL PLAIN authentication | ElementalAlchemist/txircd,Heufneutje/txircd,DesertBus/txircd | 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... | bsd-3-clause | Python |
026db0e635f0c82e1b24884cb768d53b7fadfc0c | use lots of connections for the pool | SergioChan/Stream-Framework,izhan/Stream-Framework,izhan/Stream-Framework,nikolay-saskovets/Feedly,smuser90/Stream-Framework,Anislav/Stream-Framework,nikolay-saskovets/Feedly,izhan/Stream-Framework,SergioChan/Stream-Framework,smuser90/Stream-Framework,turbolabtech/Stream-Framework,nikolay-saskovets/Feedly,Architizer/Fe... | 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... | bsd-3-clause | Python |
fb4b9e4570c4053204304fc934d0fe816d4c056d | add new split dictionary and dependencies | pagarme/pagarme-python | 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... | mit | Python |
1bccf48e6e142e6c62374dd9d7dc94330f15c650 | Update ipc_lista1.3.py | any1m1c/ipc20161 | 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)
| apache-2.0 | Python |
4e6fc94fde8eace1b461eba59dc4a56611664877 | Update ipc_lista1.7.py | any1m1c/ipc20161 | 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: "
| apache-2.0 | Python |
950e9f82be8b3a02ce96db47061cf828da231be9 | Update ipc_lista1.8.py | any1m1c/ipc20161 | 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
| apache-2.0 | Python |
26c781807937038ec2c4fbfd4413ae2c60decd1b | add stdint.h for c++ default header include. | aceway/cppite,aceway/cppite,aceway/cppite | 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... | mit | Python |
5e21c7d0fa46e2b290368533cc6dc741b1d366e2 | correct src path in settings | Victory/clicker-me-bliss,Victory/clicker-me-bliss,Victory/clicker-me-bliss,Victory/clicker-me-bliss | 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/"
| mit | Python |
54563933a265a7c70adce3996d0a31eb9c915203 | Use kwarg normally in piratepad.controllers.Form | hifly/OpenUpgrade,ingadhoc/odoo,MarcosCommunity/odoo,NeovaHealth/odoo,odootr/odoo,rahuldhote/odoo,Ernesto99/odoo,OpenPymeMx/OCB,kittiu/odoo,shivam1111/odoo,sve-odoo/odoo,ramadhane/odoo,ihsanudin/odoo,syci/OCB,nhomar/odoo-mirror,QianBIG/odoo,fossoult/odoo,takis/odoo,eino-makitalo/odoo,guewen/OpenUpgrade,sergio-incaser/o... | 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['... | agpl-3.0 | Python |
31aa44ef336c497be9f545c9bd4af64aac250748 | Fix remote coverage execution | xfournet/intellij-community,asedunov/intellij-community,idea4bsd/idea4bsd,xfournet/intellij-community,allotria/intellij-community,apixandru/intellij-community,idea4bsd/idea4bsd,apixandru/intellij-community,semonte/intellij-community,ibinti/intellij-community,da1z/intellij-community,suncycheng/intellij-community,allotri... | 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:
... | apache-2.0 | Python |
c109728986a3a583fe037780c88bdaa458e663c4 | Bump 2.1.1 | appium/python-client,appium/python-client | appium/version.py | appium/version.py | version = '2.1.1'
| version = '2.1.0'
| apache-2.0 | Python |
05140304c1ef08e7e291eec92de4091320bdfc0e | Add acceleration to example | SpotlightKid/micropython-stm-lib | 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
... | mit | Python |
2268ebdc47b1d9221c06622a7b1992cae14013c2 | Test endpoint for the web server | datasciencebr/whistleblower | 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... | unlicense | Python |
db40a42c2825b157017e6730a2b5c95371bbe598 | Allow user to adjust nyquist freq and freq spacing in cp_utils.py | farr/arfit | 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... | mit | Python |
4fd80a9a593a4f9100899e96a383782c68a41af1 | Fix to subtract USDT withdrawals from balance | BenjiLee/PoloniexAnalyzer | 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... | mit | Python |
1e16048c7ceb50377fdfdda3a39ef9910d2021bb | Bump version to 0.2 | Temeez/wagtail-simple-gallery,Temeez/wagtail-simple-gallery | wagtail_simple_gallery/__init__.py | wagtail_simple_gallery/__init__.py | __version__ = '0.2' | __version__ = '0.1' | mit | Python |
7e9d3b3d2c4e46c2b16595b7acc6aa670ece9e6e | use correct API to save to bucket. | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | 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... | agpl-3.0 | Python |
70f137998b2cc3b9c873a57e17a435c6ca181192 | improve code for getting the pricelist | OCA/multi-company,OCA/multi-company | 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... | agpl-3.0 | Python |
590ba3c9d645f6eac41687bee9f12f7c914858d6 | revert to http for loading clusters | jdfekete/progressivis,jdfekete/progressivis,jdfekete/progressivis,jdfekete/progressivis,jdfekete/progressivis | 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... | bsd-2-clause | Python |
0658934a7a7a1581c6f1d871c192f49b42144b09 | fix issue with ControlPlayer on mac | UmSenhorQualquer/pyforms | 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... | mit | Python |
d0ed8aeb2126a4b14b8413bd8c6d54952451e890 | Update version number. | aviweit/libcloud,vongazman/libcloud,mgogoulos/libcloud,DimensionDataCBUSydney/libcloud,aviweit/libcloud,wuyuewen/libcloud,lochiiconnectivity/libcloud,dcorbacho/libcloud,mistio/libcloud,andrewsomething/libcloud,Cloud-Elasticity-Services/as-libcloud,t-tran/libcloud,ZuluPro/libcloud,apache/libcloud,sgammon/libcloud,sahild... | 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 ... | apache-2.0 | Python |
b999240903bb71e14818fb3f2d8eb12bda75ada2 | Bump tensorflow to 2.1.0 (#721) | tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io,tensorflow/io | 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... | apache-2.0 | Python |
a9cd7d6eaa7ea70e962cf4d1c9e4aa53a2845968 | Bump version number | looplab/lillebror | 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... | apache-2.0 | Python |
3fea814461d2a51e0cc13c4981fa6f4cdfca75e9 | Correct broken import, this could never have worked. | EmilStenstrom/nephele | 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",
... | mit | Python |
b8241c2ff0cff4a0bc96e6d229c80029cdbcb71c | Change contact email. | tryolabs/luminoth,tryolabs/luminoth,tryolabs/luminoth | 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'... | bsd-3-clause | Python |
df3441a2c98fffbb18c11d3660acb86d2e31e5fa | Fix main run | UltrosBot/Ultros3K,UltrosBot/Ultros3K | 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(... | artistic-2.0 | Python |
5229bf4a16d468a3a337db65c478671409d6d898 | Update summery.py | tinypony/testing-utils,tinypony/testing-utils,tinypony/testing-utils | 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... | mit | Python |
4eb71abf71823a5a065d1b593ca8b624d17a35c9 | prepare for 1.6 | antidot/Pyckson | 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'
| lgpl-2.1 | Python |
521c71c38d4e6edc242afb76daf330d9aec8e9ff | remove ipdb | haoyuchen1992/osf.io,samanehsan/osf.io,mattclark/osf.io,kwierman/osf.io,KAsante95/osf.io,saradbowman/osf.io,jmcarp/osf.io,rdhyee/osf.io,jnayak1/osf.io,brandonPurvis/osf.io,caseyrollins/osf.io,mfraezz/osf.io,aaxelb/osf.io,emetsger/osf.io,chennan47/osf.io,ckc6cz/osf.io,hmoco/osf.io,aaxelb/osf.io,Johnetordoff/osf.io,emets... | 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... | apache-2.0 | Python |
9cdd86499013c1deac7caeb8320c34294789f716 | Add _kill_and_join to async actor stub | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | 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... | mit | Python |
16381d4fafe743c3feb1de7ec27b6cbf95f617f1 | Add state and conf to interactive namespace by default | kinverarity1/pyexperiment,DeercoderResearch/pyexperiment,DeercoderResearch/pyexperiment,kinverarity1/pyexperiment,DeercoderResearch/pyexperiment,kinverarity1/pyexperiment,shaunstanislaus/pyexperiment,duerrp/pyexperiment,shaunstanislaus/pyexperiment,DeercoderResearch/pyexperiment,shaunstanislaus/pyexperiment,duerrp/pyex... | 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... | mit | Python |
6cd34697334ddd8ada1daeee9a2c8b9522257487 | Remove unused function | jackfirth/pyramda | 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... | mit | Python |
4f2b7e5601e9f241868f86743eacb0e432be7495 | fix settings of cache in UT | patochectp/navitia,kinnou02/navitia,pbougue/navitia,Tisseo/navitia,xlqian/navitia,xlqian/navitia,TeXitoi/navitia,VincentCATILLON/navitia,is06/navitia,kinnou02/navitia,lrocheWB/navitia,ballouche/navitia,xlqian/navitia,datanel/navitia,francois-vincent/navitia,CanalTP/navitia,kadhikari/navitia,is06/navitia,TeXitoi/navitia... | 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... | agpl-3.0 | Python |
26c4effd8741d2511bb0b3bd46cca12d37b0e01b | Add file magic | ceefour/opencog,printedheart/opencog,eddiemonroe/atomspace,yantrabuddhi/opencog,Selameab/atomspace,anitzkin/opencog,gavrieltal/opencog,virneo/opencog,inflector/opencog,MarcosPividori/atomspace,cosmoharrigan/atomspace,sanuj/opencog,gaapt/opencog,rohit12/atomspace,eddiemonroe/opencog,anitzkin/opencog,gaapt/opencog,tim777... | 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... | agpl-3.0 | Python |
9f1a4977e34dc01a0489655df826b63b84f7d3be | Use SunPy sample data for Solar Cycle example. | Alex-Ian-Hamilton/sunpy,Alex-Ian-Hamilton/sunpy,dpshelio/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy,dpshelio/sunpy | examples/solar_cycle_example.py | examples/solar_cycle_example.py | """
===============
The Solar Cycle
===============
This example shows the current and possible next solar cycle.
"""
import datetime
import matplotlib.pyplot as plt
import sunpy.lightcurve as lc
from sunpy.data.sample import NOAAINDICES_LIGHTCURVE, NOAAPREDICT_LIGHTCURVE
############################################... | """
===============
The Solar Cycle
===============
This example shows the current and possible next solar cycle.
"""
import datetime
import matplotlib.pyplot as plt
import sunpy.lightcurve as lc
###############################################################################
# Let's download the latest data from NOA... | bsd-2-clause | Python |
ca57e29c15ad02dee3cdad0d2159cbe33c15d6e0 | fix expire cache | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/app_manager/signals.py | corehq/apps/app_manager/signals.py | from __future__ import absolute_import
from __future__ import unicode_literals
from django.dispatch.dispatcher import Signal
from corehq.apps.callcenter.app_parser import get_call_center_config_from_app
from corehq.apps.domain.models import Domain
from dimagi.utils.logging import notify_exception
def create_app_stru... | from __future__ import absolute_import
from __future__ import unicode_literals
from django.dispatch.dispatcher import Signal
from corehq.apps.callcenter.app_parser import get_call_center_config_from_app
from corehq.apps.domain.models import Domain
from dimagi.utils.logging import notify_exception
def create_app_stru... | bsd-3-clause | Python |
a7b9c9a120aebe270ea200f3be0b2d3468f911cf | Bump version | ckirby/django-modelqueryform | modelqueryform/__init__.py | modelqueryform/__init__.py | __version__ = "2.2"
| __version__ = "2.1"
| bsd-2-clause | Python |
4d40e9db4bd6b58787557e8d5547f69eb67c9b96 | Add additional coverage to author build list | wfxiang08/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes | tests/changes/api/test_author_build_index.py | tests/changes/api/test_author_build_index.py | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | from uuid import uuid4
from changes.config import db
from changes.models import Author
from changes.testutils import APITestCase
class AuthorBuildListTest(APITestCase):
def test_simple(self):
fake_author_id = uuid4()
self.create_build(self.project)
path = '/api/0/authors/{0}/builds/'.fo... | apache-2.0 | Python |
03aebd7eff51be1847866d9920b8520cee72348f | fix failure in test_global_pinger_memo | jtrobec/pants,foursquare/pants,UnrememberMe/pants,cevaris/pants,15Dkatz/pants,lahosken/pants,baroquebobcat/pants,twitter/pants,benjyw/pants,foursquare/pants,baroquebobcat/pants,ericzundel/pants,dbentley/pants,dbentley/pants,ericzundel/pants,lahosken/pants,foursquare/pants,jsirois/pants,qma/pants,megaserg/pants,cevaris/... | tests/python/pants_test/cache/test_pinger.py | tests/python/pants_test/cache/test_pinger.py | # coding=utf-8
# Copyright 2015 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 threading
imp... | # coding=utf-8
# Copyright 2015 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 threading
imp... | apache-2.0 | Python |
932fccc77fb10ece61c3feeb47a28225216c7c0d | add two more authors for gemeinfrei_2021.py | the-it/WS_THEbotIT,the-it/WS_THEbotIT | service/ws_re/scanner/tasks/gemeinfrei_2021.py | service/ws_re/scanner/tasks/gemeinfrei_2021.py | import pywikibot
from service.ws_re.register.authors import Authors
from service.ws_re.scanner.tasks.base_task import ReScannerTask
from service.ws_re.template.article import Article
from tools.bots.pi import WikiLogger
class GF21Task(ReScannerTask):
def __init__(self, wiki: pywikibot.Site, logger: WikiLogger, d... | import pywikibot
from service.ws_re.register.authors import Authors
from service.ws_re.scanner.tasks.base_task import ReScannerTask
from service.ws_re.template.article import Article
from tools.bots.pi import WikiLogger
class GF21Task(ReScannerTask):
def __init__(self, wiki: pywikibot.Site, logger: WikiLogger, d... | mit | Python |
d56382a87068e7d43b3333b6ea3dc2fd0a80d929 | Use dict instead of list | dustalov/watset,dustalov/watset | 10-disambiguate.py | 10-disambiguate.py | #!/usr/bin/env python
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
import csv
import gc
import sys
from collections import defaultdict
from sklearn.feature_extraction import DictVectorizer
from sklearn.metrics.pairwise import cosine_similarity as sim
from operator import itemgetter
from multip... | #!/usr/bin/env python
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
import csv
import gc
import sys
from collections import defaultdict
from sklearn.feature_extraction import DictVectorizer
from sklearn.metrics.pairwise import cosine_similarity as sim
from operator import itemgetter
from multip... | mit | Python |
72df22e62806e64e05b3bbb6eca0efd958c7c8bb | make btcnet_wrapper fail in a more instructive manner | c00w/bitHopper,c00w/bitHopper | btcnet_wrapper.py | btcnet_wrapper.py | from git import Repo
try:
repo = Repo("btcnet_info")
except:
repo = Repo.init("btcnet_info")
repo = repo.clone("git://github.com/c00w/btcnet_info.git")
origin = repo.create_remote('origin', 'git://github.com/c00w/btcnet_info.git')
origin = repo.remotes.origin
origin.fetch()
origin.pull('master')
... | from git import Repo
try:
repo = Repo("btcnet_info")
except:
repo = Repo.init("btcnet_info")
repo = repo.clone("git://github.com/c00w/btcnet_info.git")
origin = repo.create_remote('origin', 'git://github.com/c00w/btcnet_info.git')
origin = repo.remotes.origin
origin.fetch()
origin.pull('master')
... | mit | Python |
1ac423e9127631eeb78868c47cf6fee12bf36a12 | Fix bug in handling get/post, should work now | acdha/django-test-utils,frac/django-test-utils,acdha/django-test-utils,ericholscher/django-test-utils,frac/django-test-utils,ericholscher/django-test-utils | test_utils/middleware/testmaker.py | test_utils/middleware/testmaker.py | from django.conf import settings
from django.test import Client
from django.test.utils import setup_test_environment
import logging, re
from django.utils.encoding import force_unicode
log = logging.getLogger('testmaker')
print "Loaded Testmaker Middleware"
#Remove at your own peril
debug = getattr(settings, 'DEBUG', ... | from django.conf import settings
from django.test import Client
from django.test.utils import setup_test_environment
import logging, re
from django.utils.encoding import force_unicode
log = logging.getLogger('testmaker')
print "Loaded Testmaker Middleware"
#Remove at your own peril
debug = getattr(settings, 'DEBUG', ... | mit | Python |
e4a5dd51829df198a07232afc06afdff6089ae6c | fix wmt datatype checking (#1259) | facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI | parlai/tasks/wmt/agents.py | parlai/tasks/wmt/agents.py | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
fr... | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
fr... | mit | Python |
226b27ad6e66c7d512ce6cad300b7f96de5ccfa7 | Introduce cache feature to GoogleDrive base logic. | supistar/Botnyan | model/googledrive.py | model/googledrive.py | # -*- encoding:utf8 -*-
import os
import httplib2
from oauth2client.client import SignedJwtAssertionCredentials
from apiclient.discovery import build
from model.cache import Cache
class GoogleDrive(object):
@classmethod
def retrieve_content(cls, **kwargs):
document_id = kwargs.get('document_id')
... | # -*- encoding:utf8 -*-
import os
import httplib2
from oauth2client.client import SignedJwtAssertionCredentials
from apiclient.discovery import build
class GoogleDrive(object):
@classmethod
def retrieve_content(cls, **kwargs):
document_id = kwargs.get('document_id')
export_type = kwargs.get(... | mit | Python |
4c4499dcb86ae16a7d3822feab4390adca89d348 | Bump version to 0.12.1 | thombashi/pingparsing,thombashi/pingparsing | pingparsing/__version__.py | pingparsing/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright {}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.12.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright {}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.12.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
12995be9490bde60c92e6f962b748832c083fe45 | use API and HTTP HEAD instead | sammdot/circa | modules/subreddit.py | modules/subreddit.py | import re
import urllib.request as req
import urllib.error as err
class SubredditModule:
subre = re.compile(r"^(?:.* )?/r/([A-Za-z0-9][A-Za-z0-9_]{2,20})")
def __init__(self, circa):
self.circa = circa
self.events = {
"message": [self.findsub]
}
def findsub(self, fr, to, msg, m):
for sub in self.subr... | import re
import urllib.request as req
class SubredditModule:
subre = re.compile(r"^(?:.* )?/r/([A-Za-z0-9][A-Za-z0-9_]{2,20})")
def __init__(self, circa):
self.circa = circa
self.events = {
"message": [self.findsub]
}
def findsub(self, fr, to, msg, m):
for sub in self.subre.findall(msg):
url = "htt... | bsd-3-clause | Python |
c1e84bd196f28c35b032a609a3edb5f596216f71 | fix for document.iter | mylokin/mongoext | mongoext/document.py | mongoext/document.py | from __future__ import absolute_import
import mongoext.collection
import mongoext.scheme
import mongoext.exc
class MetaDocument(type):
def __new__(cls, name, bases, attrs):
fields = {}
for base in bases:
for name, obj in vars(base).iteritems():
if issubclass(type(obj),... | from __future__ import absolute_import
import collections
import mongoext.collection
import mongoext.scheme
import mongoext.exc
class MetaDocument(type):
def __new__(cls, name, bases, attrs):
fields = {}
for base in bases:
for name, obj in vars(base).iteritems():
if i... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.