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 |
|---|---|---|---|---|---|---|---|---|
062cfed0264814af6a1068f19b1ea329db093117 | Integrate LLVM at llvm/llvm-project@335f94bfef0e | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "335f94bfef0e9a53a44de2f0a2a62b29e2c593e9"
LLVM_SHA256 = "e632c07e4b056cdef3178087b7333ef9153e797c12c3aa520ae90b88e4c5d6c9"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "d8415b02a519f222ecf71b069c96cc85ac635de3"
LLVM_SHA256 = "05fffac826b16218bbc0f882204734e68566fd0b61a1196f12c16a58b0b8af58"
tfrt_http_archive(
... | apache-2.0 | Python |
093ed77f7d50f75b376f40a71ea86e08cedb8b80 | Integrate LLVM at llvm/llvm-project@1cb299165c85 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "1cb299165c859533e22f2ed05eb2abd5071544df"
LLVM_SHA256 = "5a19ab6de4b0089fff456c0bc406b37ba5f95c76026e6bec294ec28dc28e4cb9"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "8de84198ce2bc703bf2854cf12df97e8ff9fa3f0"
LLVM_SHA256 = "48dfec5b1a5ee14d50229e983179ec4eb0017dd75738f8f685e28b8cd8069ab7"
tfrt_http_archive(
... | apache-2.0 | Python |
ad1d01eba9930838529417d3b258bf5d5b4b951e | Integrate LLVM at llvm/llvm-project@db1978b67431 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "db1978b67431ca3462ad8935bf662c15750b8252"
LLVM_SHA256 = "6dc8e5c2bcc89c5494b2dda15ea406d08ccfff2f4937ac8664f685cb76224d74"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "1a20252978c76cf2518aa45b175a9e5d6d36c4f0"
LLVM_SHA256 = "93ab49d80b8fc6c3ae2c748f2d08c0b3f83ef8f5c3e818dec4da7eab8399d600"
tfrt_http_archive(
... | apache-2.0 | Python |
abec2a627b4f6eb9bb7bbf2f669339f5b2065e61 | Integrate LLVM at llvm/llvm-project@8e82bc840de5 | Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-py... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "8e82bc840de5b2264875a5f0967845867833ccfb"
LLVM_SHA256 = "683e8d615013efe0abafd3098c05e7f348d829fd0adfcdcf441236780bdff074"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "89e7e59621bfd899beaac76f9066e731df5e6d20"
LLVM_SHA256 = "a25b6e0ba8f59568e726d4630a64e8cd21fe40c02c8db3bae54866bf8166fb09"
tf_http_archive(
... | apache-2.0 | Python |
74b657b760fce2bc87041702d5b121e0d1ce8110 | Integrate LLVM at llvm/llvm-project@6c6dff7e2c27 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "6c6dff7e2c27c5a9ea9466d49f61a1edc82bc364"
LLVM_SHA256 = "6d4fa7eca507694b4d5d5b6f200d3a362df677b6348371e94a76472de6785ee4"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "7ded25c0cb298f474ffc1d9691a7d7c57c08c9f6"
LLVM_SHA256 = "7dc4720857512aa6bb3c00900a5fc79df2f9f3b97ae5a0627f66648ea6a18a2f"
tfrt_http_archive(
... | apache-2.0 | Python |
7aafddeaabdade04ce0d5588f4f26d0ffdb6a0e5 | Integrate LLVM at llvm/llvm-project@8ae9cf550b60 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "8ae9cf550b60f25be8d7bb21ee61af2fce5e317b"
LLVM_SHA256 = "21e8371ba788287e4ad8b6253f70201b0b7623ab19ab802bf3fb870026c8a22d"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "cd20a1828605887699579789b5433111d5bc0319"
LLVM_SHA256 = "0a9e582ec4f4743668b16e24345845161170a3a2aaf362b9ccc8a2cf1b12c870"
tfrt_http_archive(
... | apache-2.0 | Python |
86533a165eec3ec1ed63b188206c70f16c27145b | Integrate LLVM at llvm/llvm-project@1a20252978c7 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "1a20252978c76cf2518aa45b175a9e5d6d36c4f0"
LLVM_SHA256 = "93ab49d80b8fc6c3ae2c748f2d08c0b3f83ef8f5c3e818dec4da7eab8399d600"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "4191de262f19a65e3e5690f9780753f26fc649c9"
LLVM_SHA256 = "c916ec0a7daea6e5e18e85b959bb0bf0fdc4465beff4e8648e426558bc729367"
tfrt_http_archive(
... | apache-2.0 | Python |
0ed4b1d8c382680bc53e1b407a4024b244b1a2b1 | Integrate LLVM at llvm/llvm-project@e07a7040d9c6 | google/tsl,google/tsl,google/tsl | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "e07a7040d9c6dbdd71e55d1153bfe1357079e511"
LLVM_SHA256 = "004147901d4725b45eaa724b2cb511989eb2d031146f876ba1b4327b5a5e053f"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "625796f408cc733f64aadd76171f13390217c201"
LLVM_SHA256 = "5ade1521fc3a4f025644707e25aaee7055b4ffdf95bbef5094c2cf624f7479bd"
tf_http_archive(
... | apache-2.0 | Python |
e9af3915714b108c1109c7360f9c548f933a5b12 | add a function | amccreight/mochitest-logs | plusplus.py | plusplus.py | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Analyze the ++/-- DOMWINDOW in a TBPL log.
import re
import sys
winPatt = re.compile('\d\d:\d\d:\... | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Analyze the ++/-- DOMWINDOW in a TBPL log.
import re
import sys
winPatt = re.compile('\d\d:\d\d:\... | mpl-2.0 | Python |
e09eba0d08ca9923a39991d0f2cbe3be82bcd3d8 | Fix all E303 | JensRantil/rewind,JensRantil/rewind-client | rewind/test/test_code.py | rewind/test/test_code.py | """Test code format and coding standards."""
import os
import pep8
import unittest
class TestCodeFormat(unittest.TestCase):
@staticmethod
def _get_all_pyfiles():
pyfiles = []
for dirpath, _, filenames in os.walk('rewind'):
pyfiles.extend([os.path.join(dirpath, filename)
... | """Test code format and coding standards."""
import os
import pep8
import unittest
class TestCodeFormat(unittest.TestCase):
@staticmethod
def _get_all_pyfiles():
pyfiles = []
for dirpath, _, filenames in os.walk('rewind'):
pyfiles.extend([os.path.join(dirpath, filename)
... | agpl-3.0 | Python |
54b3b69d152611d55ce7db66c2c34dc2b1140cc7 | Remove code that was causing a problem running syncdb. Code seems to be redundant anyway. | jcarbaugh/django-wellknown | wellknown/models.py | wellknown/models.py | from django.db import models
from django.db.models.signals import post_save
import mimetypes
import wellknown
#
# create default host-meta handler
#
from wellknown.resources import HostMeta
wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml')
#
# resource model
#
class Resource(mo... | from django.db import models
from django.db.models.signals import post_save
import mimetypes
import wellknown
#
# create default host-meta handler
#
from wellknown.resources import HostMeta
wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml')
#
# resource model
#
class Resource(mo... | bsd-3-clause | Python |
1e3d6d840d184fe49342d93391d041f8547a7756 | Add solveset, linsolve, and linear_eq_to_matrix from solveset to __init__.py | lindsayad/sympy,rahuldan/sympy,ahhda/sympy,oliverlee/sympy,drufat/sympy,ga7g08/sympy,aktech/sympy,ChristinaZografou/sympy,aktech/sympy,postvakje/sympy,hargup/sympy,madan96/sympy,ahhda/sympy,drufat/sympy,sampadsaha5/sympy,kaushik94/sympy,kaushik94/sympy,skidzo/sympy,chaffra/sympy,kaushik94/sympy,Arafatk/sympy,yashsharan... | sympy/solvers/__init__.py | sympy/solvers/__init__.py | """A module for solving all kinds of equations.
Examples
========
>>> from sympy.solvers import solve
>>> from sympy.abc import x
>>> solve(x**5+5*x**4+10*x**3+10*x**2+5*x+1,x)
[-1]
"""
from .solvers import solve, solve_linear_system, solve_linear_system_LU, \
solve_undetermined_coeffs, ns... | """A module for solving all kinds of equations.
Examples
========
>>> from sympy.solvers import solve
>>> from sympy.abc import x
>>> solve(x**5+5*x**4+10*x**3+10*x**2+5*x+1,x)
[-1]
"""
from .solvers import solve, solve_linear_system, solve_linear_system_LU, \
solve_undetermined_coeffs, ns... | bsd-3-clause | Python |
657ab9ba9d0b1afda959267d05479983ce8bfaa4 | Put some DEBUG logging in lockutils.py so we can debug roomlocks | matrix-org/synapse,howethomas/synapse,matrix-org/synapse,illicitonion/synapse,matrix-org/synapse,rzr/synapse,matrix-org/synapse,matrix-org/synapse,howethomas/synapse,rzr/synapse,rzr/synapse,TribeMedia/synapse,rzr/synapse,iot-factory/synapse,TribeMedia/synapse,illicitonion/synapse,TribeMedia/synapse,iot-factory/synapse,... | synapse/util/lockutils.py | synapse/util/lockutils.py | # -*- coding: utf-8 -*-
# Copyright 2014 matrix.org
#
# 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... | # -*- coding: utf-8 -*-
# Copyright 2014 matrix.org
#
# 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... | apache-2.0 | Python |
821f1e0fd429f1a2378a8ec6c8b98420db1cb01d | Add tests for the 'normal' FileSystem. | rbarrois/uconf | tests/test_fs.py | tests/test_fs.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Raphaël Barrois
import io
import functools
import os
import tempfile
import unittest
from confmgr import fs
def with_tempfile(fun):
"""Decorator providing a temporary file name to the decorated method.
The tempfile will be created before c... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Raphaël Barrois
import io
import functools
import os
import tempfile
import unittest
from confmgr import fs
def with_tempfile(fun):
"""Decorator providing a temporary file name to the decorated method.
The tempfile will be created before c... | bsd-2-clause | Python |
d9a7fac5744ca3b3bd99bc4e3eea07ae5c6ad87f | update hq test | karec/oct,TheGhouls/oct,TheGhouls/oct,karec/oct,TheGhouls/oct | tests/test_hq.py | tests/test_hq.py | import os
import unittest
import shutil
import json
from multiprocessing import Process
from oct_turrets.turret import Turret
from oct_turrets.utils import load_file, validate_conf
from oct.utilities.run import run
from oct.utilities.newproject import create_project
BASE_DIR = os.path.dirname(os.path.realpath(__file_... | import os
import unittest
import shutil
import json
from multiprocessing import Process
from oct_turrets.turret import Turret
from oct_turrets.utils import load_file, validate_conf
from oct.utilities.run import run
from oct.utilities.newproject import create_project
BASE_DIR = os.path.dirname(os.path.realpath(__file_... | mit | Python |
5a8ff5ac4f85d93f033a452a65ff337cc2a6eda8 | add mutability of rc test | gidden/aneris,gidden/aneris | tests/test_io.py | tests/test_io.py | import pytest
from aneris import io
_defaults = {
'config': {
'default_luc_method': 'reduce_ratio_2150_cov',
'cov_threshold': 20,
},
}
def test_default_rc():
exp = _defaults
obs = io.RunControl()
for k in exp.keys():
assert k in obs
assert exp[k] == obs[k]
def t... |
from aneris import io
_defaults = {
'config': {
'default_luc_method': 'reduce_ratio_2150_cov',
'cov_threshold': 20,
},
}
def test_default_rc():
exp = _defaults
obs = io.RunControl()
for k in exp.keys():
assert k in obs
assert exp[k] == obs[k]
def test_nondefault... | apache-2.0 | Python |
19392ce71bddf6922941f90df7a7eb2ed804ed91 | fix test module imports | dhain/greennet | tests/testall.py | tests/testall.py | import unittest
import doctest
def mod_import(name):
mod = __import__(name)
components = name.split('.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod
modules = (
'greennet',
'greennet.hub',
'greennet.queue',
'greennet.ssl',
'greennet.util',
)
test_modu... | import unittest
import doctest
def mod_import(name):
mod = __import__(name)
components = name.split('.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod
modules = (
'greennet',
'greennet.hub',
'greennet.queue',
'greennet.ssl',
'greennet.util',
)
test_modu... | mit | Python |
2b52e2cf95e180c7dda53ed02cbec5992954bcba | Enhance the OSRM wrapper to work directly with strings | e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server | emission/net/ext_service/routing/osrm.py | emission/net/ext_service/routing/osrm.py | import logging
import json
import requests
import polyline.codec as pc
try:
osrm_file = open("conf/net/ext_service/osrm.json")
osrm_config = json.load(osrm_file)
OSRM_HOST = osrm_config["routing_host"]
OSRM_ROUTES = osrm_config["paths"]
except Exception as e:
print("OSRM not configured, routing is ... | import logging
import json
import requests
import polyline.codec as pc
try:
osrm_file = open("conf/net/ext_service/osrm.json")
osrm_config = json.load(osrm_file)
OSRM_HOST = osrm_config["routing_host"]
OSRM_ROUTES = osrm_config["paths"]
except Exception as e:
print("OSRM not configured, routing is ... | bsd-3-clause | Python |
5a7f6aad0928a09aa747f0ddaf2882c9d002b019 | Delete obsolete imports | SebNickel/garrick | new_card.py | new_card.py | import card_repository
from card import Card
from get_timestamp import get_timestamp
def read_input():
lines = []
while True:
try:
line = input('>>> ')
lines.append(line)
except KeyboardInterrupt:
return None
except EOFError:
print(end =... | import sys
import db_connection
import card_repository
from card import Card
from get_timestamp import get_timestamp
def read_input():
lines = []
while True:
try:
line = input('>>> ')
lines.append(line)
except KeyboardInterrupt:
return None
except EOF... | mit | Python |
a1eda035733da60e55796b2829b04ebfe6258f74 | Fix syntax error in accounts/models.py | m1k3r/gvi-accounts,m1k3r/gvi-accounts,m1k3r/gvi-accounts | gvi/accounts/models.py | gvi/accounts/models.py | from django.db import models
import datetime
class Currency(models.Model):
name = models.CharField(max_length=25)
contraction = models.CarField(max_length=5)
def __str__(self):
return self.name
class Account(models.Model):
DEFAULT_CURRENCY_ID = 1 # pounds ?
BANK = 'b'
CASH = 'c'
... | from django.db import models
import datetime
class Currency(models.Model):
name = models.CharField(max_length=25)
contraction = models.CarField(max_length=5)
def __str__(self):
return self.name
class Account(models.Model):
DEFAULT_CURRENCY_ID = 1 # pounds ?
BANK = 'b'
CASH = 'c'
... | mit | Python |
1eb5748c3b4b89dd3c1a065855547137511ffade | update sanitize.py | oicebot/xlsx_parse | sanitize.py | sanitize.py | #!/usr/bin/python3
# -*- coding:utf-8 -*-
#
# filename: sanitize.py
#
# 运行方法,用 Python IDLE 打开,按 F5 运行
#
import argparse
from openpyxl import load_workbook
import os
# 导入调试用工具,彩色打印,区分 print 打印 debug 打印 exception 打印
def parse_command():
parser = argparse.ArgumentParser(
prog="python3 sanitize.py",
... | #!/usr/bin/python3
# -*- coding:utf-8 -*-
#
# filename: sanitize.py
#
# 运行方法,用 Python IDLE 打开,按 F5 运行
#
import argparse
from openpyxl import load_workbook
# 导入调试用工具,彩色打印,区分 print 打印 debug 打印 exception 打印
def parse_command():
parser = argparse.ArgumentParser(
prog="python3 sanitize.py",
descripti... | mit | Python |
bc108169e11d0925bf52b5cfceacfacfd9bf37e7 | Debug fix | panoptes/PAWS,panoptes/PAWS,panoptes/PAWS,panoptes/PAWS | handlers/websockets.py | handlers/websockets.py | from tornado.websocket import WebSocketHandler
from zmq.eventloop.zmqstream import ZMQStream
from pocs.utils.logger import get_logger
clients = []
class PanWebSocket(WebSocketHandler):
def open(self, channel):
""" Client opening connection to unit """
self.logger = get_logger(self)
if ... | from tornado.websocket import WebSocketHandler
from zmq.eventloop.zmqstream import ZMQStream
from pocs.utils.logger import get_logger
clients = []
class PanWebSocket(WebSocketHandler):
def open(self, channel):
""" Client opening connection to unit """
self.logger = get_logger(self)
if ... | mit | Python |
45c3446bac9382554c032a25dbc8d5442703061d | Update get_top3_articles | GideonFlynn/Logs-analysis-FSND-Project | newsdata.py | newsdata.py | import psycopg2
DBNAME = "news"
"""
Querying neatly formatted information from a (postgreSQL) news database.
This file enables you to look at data in different ways.
To achieve any of these queryes, views have been made to simplyfy things.
You can read more about the views used here, in the DB-Views.md file.
"""
d... | import psycopg2
DBNAME = "news"
"""
Querying neatly formatted information from a (postgreSQL) news database.
This file enables you to look at data in different ways.
To achieve any of these queryes, views have been made to simplyfy things.
You can read more about the views used here, in the DB-Views.md file.
"""
d... | unlicense | Python |
93f2a711372300145303e5a7261263f7bdb5395c | Add missing dependecy | open-synergy/opnsynid-l10n-indonesia | l10n_id_djbc_lap_pemakaian_bahan_baku/__openerp__.py | l10n_id_djbc_lap_pemakaian_bahan_baku/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Indonesia - Lap. Pemakaian Bahan Baku for DJBC Reporting",
"version": "8.0.1.0.0",
"category": "localization",
"website": "https://opensynergy-indonesia.com",
"au... | # -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Indonesia - Lap. Pemakaian Bahan Baku for DJBC Reporting",
"version": "8.0.1.0.0",
"category": "localization",
"website": "https://opensynergy-indonesia.com",
"au... | agpl-3.0 | Python |
1f96647d6ac2c00c82999ab3b1196f826b9b1c76 | remove py3.7 check | cole/aiosmtplib | aiosmtplib/typing.py | aiosmtplib/typing.py | import enum
import os
from typing import Union
__all__ = ("Default", "SMTPStatus", "SocketPathType", "_default")
SocketPathType = Union[str, bytes, os.PathLike]
class Default(enum.Enum):
"""
Used for type hinting kwarg defaults.
"""
token = 0
_default = Default.token
@enum.unique
class SMTPSt... | import enum
import os
import sys
from typing import Union
__all__ = ("Default", "SMTPStatus", "SocketPathType", "_default")
if sys.version_info >= (3, 7):
SocketPathType = Union[str, bytes, os.PathLike]
else:
SocketPathType = Union[str, bytes]
class Default(enum.Enum):
"""
Used for type hinting kw... | mit | Python |
29c1888343344673accfa44af0e780bfbaa1464c | Bump to 0.2.0 | aio-libs/aiohttp_jinja2 | aiohttp_jinja2/__init__.py | aiohttp_jinja2/__init__.py | __version__ = '0.1.0'
import asyncio
import functools
import jinja2
from aiohttp import web
__all__ = ('setup', 'get_env', 'render_template', 'template')
APP_KEY = 'aiohttp_jinja2_environment'
def setup(app, *args, app_key=APP_KEY, **kwargs):
env = jinja2.Environment(*args, **kwargs)
app[app_key] = env
... | __version__ = '0.0.1'
import asyncio
import functools
import jinja2
from aiohttp import web
__all__ = ('setup', 'get_env', 'render_template', 'template')
APP_KEY = 'aiohttp_jinja2_environment'
def setup(app, *args, app_key=APP_KEY, **kwargs):
env = jinja2.Environment(*args, **kwargs)
app[app_key] = env
... | apache-2.0 | Python |
676ece4dac575da7fb54e2c5904b453aca1f0beb | Install bin files | dsas/dotfiles,dsas/dotfiles | install.py | install.py | #!/usr/bin/env python
# Install the files contained in this dir as symlinks
# NIH'd from https://github.com/holman/dotfiles/
# It's quick and dirty.
import glob, os, shutil
def symlink_file(from_file, to_file):
to_exists = os.path.exists(to_file)
if not to_exists:
create_symlink = True
elif not os.path.samefil... | #!/usr/bin/env python
# Install the files contained in this dir as symlinks
# NIH'd from https://github.com/holman/dotfiles/
import glob, os, shutil
for from_file in glob.glob('*.symlink'):
to_file = "%(home)s/.%(tofile)s" % {"home": os.getenv('HOME'), "tofile": from_file.replace(".symlink", "")}
full_from_file = ... | mit | Python |
5d5db35f87da73d27cb60d382eb348f5779b0836 | remove uninstall_hook | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | addons/sale_timesheet_purchase/__manifest__.py | addons/sale_timesheet_purchase/__manifest__.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Sales Timesheet Purchase',
'category': 'Hidden',
'summary': 'Bridge module between Sales Timesheet and Purchase',
'description': """
Allows to access purchase orders from Project Overview
=====... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Sales Timesheet Purchase',
'category': 'Hidden',
'summary': 'Bridge module between Sales Timesheet and Purchase',
'description': """
Allows to access purchase orders from Project Overview
=====... | agpl-3.0 | Python |
4e7917ab5a2e112af8c69b89805af6b097eed97e | Remove `EOF` -- update examples | igordejanovic/parglare,igordejanovic/parglare | examples/custom_table_caching/grammar.py | examples/custom_table_caching/grammar.py | from parglare import Grammar
grammar = Grammar.from_string("""
start: ab;
ab: "a" ab "b" | EMPTY;
""")
start_symbol = 'start'
| from parglare import Grammar
grammar = Grammar.from_string("""
start: ab EOF;
ab: "a" ab "b" | EMPTY;
""")
start_symbol = 'start'
| mit | Python |
22d1b60d8d3195944f3428c6b3122b91042d5f34 | Rename loop -> global_loop | waltermoreira/tartpy | eventloop.py | eventloop.py | import queue
import threading
def individual_loop(queue, actor):
while True:
message = queue.get()
actor.behavior(message)
def global_loop_step(queue, block=False):
actor, message = queue.get(block=block)
actor.behavior(message)
def global_loop(queue):
while True:
... | import queue
import threading
def individual_loop(queue, actor):
while True:
message = queue.get()
actor.behavior(message)
def loop_step(queue, block=False):
actor, message = queue.get(block=block)
actor.behavior(message)
def global_loop(queue):
while True:
loop_step(queue,... | mit | Python |
75289980c658e081fec2d7e34651837c4629d4b7 | Fix the placeholder for better understanding | iraquitan/udacity-fsnd-p4-conference-app,iraquitan/udacity-fsnd-p4-conference-app,iraquitan/udacity-fsnd-p4-conference-app | settings.py | settings.py | # -*- coding: utf-8 -*-
"""
* Project: udacity-fsnd-p4-conference-app
* Author name: Iraquitan Cordeiro Filho
* Author login: iraquitan
* File: settings
* Date: 3/23/16
* Time: 12:16 AM
"""
# Replace the following lines with client IDs obtained from the APIs
# Console or Cloud Console.
WEB_CLIENT_ID = 'your-web-c... | # -*- coding: utf-8 -*-
"""
* Project: udacity-fsnd-p4-conference-app
* Author name: Iraquitan Cordeiro Filho
* Author login: iraquitan
* File: settings
* Date: 3/23/16
* Time: 12:16 AM
"""
# Replace the following lines with client IDs obtained from the APIs
# Console or Cloud Console.
WEB_CLIENT_ID = 'your-app-i... | mit | Python |
de92969a402da1ae070ca76efd8721138f46f376 | Add automagic DPIO register support | dlespiau/checkmate-test-igt,tiagovignatti/intel-gpu-tools,tiagovignatti/intel-gpu-tools,dlespiau/checkmate-test-igt,mv0/intel-gpu-tools,rib/intel-gpu-tools,dlespiau/checkmate-test-igt,yipdw/intel-gpu-tools,chenxianqin/intel-gpu-tools,erikarn/intel-gpu-tools,erikarn/intel-gpu-tools,yipdw/intel-gpu-tools,rib/intel-gpu-to... | tools/quick_dump/quick_dump.py | tools/quick_dump/quick_dump.py | #!/usr/bin/env python3
import argparse
import os
import sys
import ast
import subprocess
import chipset
import reg_access as reg
def parse_file(file):
print('{0:^10s} | {1:^28s} | {2:^10s}'. format('offset', file.name, 'value'))
print('-' * 54)
for line in file:
register = ast.literal_eval(line)
if register[2]... | #!/usr/bin/env python3
import argparse
import os
import sys
import ast
import subprocess
import chipset
import reg_access as reg
def parse_file(file):
print('{0:^10s} | {1:^28s} | {2:^10s}'. format('offset', file.name, 'value'))
print('-' * 54)
for line in file:
register = ast.literal_eval(line)
val = reg.read... | mit | Python |
68b52fedf5b22891a4fc9cf121417ced38d0ea00 | Fix import of Callable for Python 3.9 | vintasoftware/django-role-permissions | rolepermissions/utils.py | rolepermissions/utils.py | from __future__ import unicode_literals
import re
try:
from collections.abc import Callable
except ImportError:
from collections import Callable
def user_is_authenticated(user):
if isinstance(user.is_authenticated, Callable):
authenticated = user.is_authenticated()
else:
authenticated... | from __future__ import unicode_literals
import re
import collections
def user_is_authenticated(user):
if isinstance(user.is_authenticated, collections.Callable):
authenticated = user.is_authenticated()
else:
authenticated = user.is_authenticated
return authenticated
def camelToSnake(s)... | mit | Python |
bcc6394baf901e5bfcd53b4ffbaa8d46b1505e75 | Add newline to services test file | pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine | tests/scoring_engine/web/views/test_services.py | tests/scoring_engine/web/views/test_services.py | from tests.scoring_engine.web.web_test import WebTest
from tests.scoring_engine.helpers import generate_sample_model_tree
class TestServices(WebTest):
def set_team_color(self, team, color):
team.color = color
self.session.add(team)
self.session.commit()
def set_blue_team(self, team):... | from tests.scoring_engine.web.web_test import WebTest
from tests.scoring_engine.helpers import generate_sample_model_tree
class TestServices(WebTest):
def set_team_color(self, team, color):
team.color = color
self.session.add(team)
self.session.commit()
def set_blue_team(self, team):... | mit | Python |
371ca73c324e21ab062d287ade87632783f7f4c8 | correct ALLOWED_HOSTS | samuelcolvin/ci-donkey,samuelcolvin/ci-donkey,samuelcolvin/ci-donkey,samuelcolvin/ci-donkey | settings.py | settings.py | import os
BASE_DIR = os.path.dirname(__file__)
SECRET_KEY = '!!! change me in localsettings.py !!!'
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# you should set this in localsettings.py
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'd... | import os
BASE_DIR = os.path.dirname(__file__)
SECRET_KEY = '!!! change me in localsettings.py !!!'
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = []
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.... | mit | Python |
62b1851a4b1a753cac02e3c72cfe6acaec7780b4 | Bump version to 3.0.5-a1 | mar10/wsgidav,mar10/wsgidav,mar10/wsgidav,mar10/wsgidav | wsgidav/__init__.py | wsgidav/__init__.py | # -*- coding: utf-8 -*-
"""
Current WsgiDAV version number.
See https://www.python.org/dev/peps/pep-0440
Examples
Pre-releases (alpha, beta, release candidate):
'3.0.0a1', '3.0.0b1', '3.0.0rc1'
Final Release:
'3.0.0'
Developmental release (to mark 3.0.0 as 'used'. Don't publish this):
... | # -*- coding: utf-8 -*-
"""
Current WsgiDAV version number.
See https://www.python.org/dev/peps/pep-0440
Examples
Pre-releases (alpha, beta, release candidate):
'3.0.0a1', '3.0.0b1', '3.0.0rc1'
Final Release:
'3.0.0'
Developmental release (to mark 3.0.0 as 'used'. Don't publish this):
... | mit | Python |
076c8f5ca50763da4b8815bab111b75da97d3bc1 | test ignore 6 | redebian/documentation,redebian/documentation,redebian/documentation | settings.py | settings.py | # Django settings for tutorial project.
import os
from djangoappengine.settings_base import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
(),
)
MANAGERS = ADMINS
TIME_ZONE = ''
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA_ROOT = os.path.normpath( os.path.join( os.path.dirname (... | # Django settings for tutorial project.
import os
from djangoappengine.settings_base import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
(),
)
MANAGERS = ADMINS
TIME_ZONE = ''
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA_ROOT = os.path.normpath( os.path.join( os.path.dirname ... | bsd-3-clause | Python |
7f7fd4e7547af3a6d7e3cd4da025c2b0ab24508b | Remove dependency for ReviewedVersionTracker in migrations | j00bar/django-widgy,j00bar/django-widgy,j00bar/django-widgy | widgy/contrib/widgy_mezzanine/migrations/0001_initial.py | widgy/contrib/widgy_mezzanine/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import widgy.db.fields
import django.db.models.deletion
import widgy.contrib.widgy_mezzanine.models
class Migration(migrations.Migration):
dependencies = [
('pages', '__first__'),
('widgy', '... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import widgy.db.fields
import django.db.models.deletion
import widgy.contrib.widgy_mezzanine.models
class Migration(migrations.Migration):
dependencies = [
('pages', '__first__'),
('review_qu... | apache-2.0 | Python |
adb1580f71780f37471733d7eb2b9a7d4713fc25 | Make test Windows compatible | JIC-CSB/dtoolcore | tests/test_create_dataset_helpers_functional.py | tests/test_create_dataset_helpers_functional.py | """Test the helper functions and classes for creating datasets."""
import os
from . import tmp_dir_fixture # NOQA
from . import TEST_SAMPLE_DATA
from dtoolcore.utils import (
IS_WINDOWS,
generous_parse_uri,
windows_to_unix_path,
)
def test_create_proto_dataset(tmp_dir_fixture): # NOQA
import dtoo... | """Test the helper functions and classes for creating datasets."""
import os
from . import tmp_dir_fixture # NOQA
from . import TEST_SAMPLE_DATA
def test_create_proto_dataset(tmp_dir_fixture): # NOQA
import dtoolcore
name = "my-test-ds"
readme_content = "---\ndescription: a test dataset"
creator_... | mit | Python |
e9dc10532a0357bc90ebaa2655b36822f9249673 | Remove uvloop from test run. | mayfield/cellulario | test/__init__.py | test/__init__.py | from cellulario import iocell
iocell.DEBUG = True
| from cellulario import iocell
import asyncio
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
iocell.DEBUG = True
| mit | Python |
0ebd51a7e7bec6251ca82f74fe08b5490b6e5f36 | Simplify local settings management | Nadeflore/dakara-player-vlc | settings.py | settings.py | KARA_FOLDER_PATH = ""
SERVER_URL = "http://127.0.0.1:8000/"
CREDENTIALS = ()
LOGGING_LEVEL = "INFO"
DELAY_BETWEEN_REQUESTS = 1
REQUESTS_LOGGING_DISABLED = True
try:
from local_settings import *
except ImportError:
pass
| KARA_FOLDER_PATH = ""
SERVER_URL = "http://127.0.0.1:8000/"
CREDENTIALS = ()
LOGGING_LEVEL = "INFO"
DELAY_BETWEEN_REQUESTS = 1
REQUESTS_LOGGING_DISABLED = True
try:
import local_settings
if hasattr(local_settings, 'KARA_FOLDER_PATH'):
KARA_FOLDER_PATH = local_settings.KARA_FOLDER_PATH
if hasattr(lo... | mit | Python |
8d70235e6758e5432cc19e5b497987ed0d1f66d3 | improve createacts command | ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide | calebasse/agenda/management/commands/createacts.py | calebasse/agenda/management/commands/createacts.py | from datetime import date, timedelta, datetime, time
from django.core.management.base import BaseCommand
from django.db.transaction import commit_on_success
from django.db.models import Q
from ... import models
from ....actes.models import Act
class Command(BaseCommand):
help = 'Create acts for events in the follo... | from datetime import date, timedelta
from django.core.management.base import BaseCommand
from django.db.transaction import commit_on_success
from ... import models
from ....actes.models import Act
class Command(BaseCommand):
help = 'Create acts for events in the following days'
@commit_on_success
def hand... | agpl-3.0 | Python |
d32d139a24369f9a73a226bcb78332b1a8969e35 | Fix typo in cached_db sessions backed import | SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas | horas/settings_prod.py | horas/settings_prod.py | import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# django-secure settings
PROTOCOL = 'https'
SESSION_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True
SECURE_HSTS_SECONDS = 3153... | import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# django-secure settings
PROTOCOL = 'https'
SESSION_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True
SECURE_HSTS_SECONDS = 3153... | mit | Python |
4636b4dcc2a722723a3ecaa4c6cff3b73cb1c814 | disable debug mode | pirate/nicksweeting.com,pirate/nicksweeting.com | ios/ios.py | ios/ios.py | from pyicloud import PyiCloudService
from flask import Flask, jsonify, request, abort, render_template
api = PyiCloudService('nikisweeting@gmail.com')
app = Flask(__name__)
def get_devices_list():
"""safely get the devices list, and handle api disconnections gracefully"""
global api
try:
retur... | from pyicloud import PyiCloudService
from flask import Flask, jsonify, request, abort, render_template
api = PyiCloudService('nikisweeting@gmail.com')
app = Flask(__name__)
def get_devices_list():
"""safely get the devices list, and handle api disconnections gracefully"""
global api
try:
retur... | mit | Python |
518589879a08e2239a31cae1b9631eb6a0b09e3e | add strokes.cpp | csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia | gyp/gm.gyp | gyp/gm.gyp | # GYP file to build the "gm" (golden master) executable.
#
# To build and run on Linux:
# ./gyp_skia gm.gyp && make
# out/Debug/gm -r ../gm/base-linux
#
# Building on other platforms not tested yet.
#
{
'includes': [
'apptype_console.gypi',
'target_defaults.gypi',
],
'targets': [
{
'target_nam... | # GYP file to build the "gm" (golden master) executable.
#
# To build and run on Linux:
# ./gyp_skia gm.gyp && make
# out/Debug/gm -r ../gm/base-linux
#
# Building on other platforms not tested yet.
#
{
'includes': [
'apptype_console.gypi',
'target_defaults.gypi',
],
'targets': [
{
'target_nam... | bsd-3-clause | Python |
d468dfe93092c82b518644e1b757b0045788ca02 | Exit if usage is printed. | dattlabs/datt-metadatt,dattlabs/datt-metadatt,dattlabs/datt-metadatt,dattlabs/datt-metadatt,johanatan/datt-metadatt,johanatan/datt-metadatt,johanatan/datt-metadatt,johanatan/datt-metadatt | make.py | make.py | #!/usr/bin/env python
from sys import argv, exit
from subprocess import call
import glob
import os
isContainerPath = lambda p: os.path.isfile("%s/Dockerfile" % p)
def single(lst):
if not len(lst) == 1:
raise RuntimeError('single expects a list containing one item: %s' % lst)
return lst[0]
trimstart = lambda... | #!/usr/bin/env python
from sys import argv, exit
from subprocess import call
import glob
import os
isContainerPath = lambda p: os.path.isfile("%s/Dockerfile" % p)
def single(lst):
if not len(lst) == 1:
raise RuntimeError('single expects a list containing one item: %s' % lst)
return lst[0]
trimstart = lambda... | apache-2.0 | Python |
df846243a3718db6b5fa1c0b7374dcedfc48cb6a | fix helper to not force all words in input text | seinberg/deep-learning,seinberg/deep-learning | tv-script-generation/helper.py | tv-script-generation/helper.py | import os
import pickle
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, "r") as f:
data = f.read()
return data
def preprocess_and_save_data(dataset_path, token_lookup, create_lookup_tables):
"""
Preprocess Text Data
... | import os
import pickle
def load_data(path):
"""
Load Dataset from File
"""
input_file = os.path.join(path)
with open(input_file, "r") as f:
data = f.read()
return data
def preprocess_and_save_data(dataset_path, token_lookup, create_lookup_tables):
"""
Preprocess Text Data
... | mit | Python |
218b09285fc1571ebc6d42742e977a0a42867b6e | Fix IT data source (#55) | GoogleCloudPlatform/covid-19-open-data,GoogleCloudPlatform/covid-19-open-data | src/pipelines/epidemiology/it_authority.py | src/pipelines/epidemiology/it_authority.py | # Copyright 2020 Google LLC
#
# 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, ... | # Copyright 2020 Google LLC
#
# 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, ... | apache-2.0 | Python |
f3341aa1c3278e597b46d48a95fc3ec3bb0d5435 | Fix indent | silvermullet/oh-bot,silvermullet/oh-bot,silvermullet/oh-bot | handler.py | handler.py | import boto3
import time
import decimal
client = boto3.client('dynamodb')
# Helper class to convert a DynamoDB item to JSON.
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
if o % 1 > 0:
return float(o)
else:
... | import boto3
import time
import decimal
client = boto3.client('dynamodb')
# Helper class to convert a DynamoDB item to JSON.
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
if o % 1 > 0:
return float(o)
else:
... | mit | Python |
bd77f43b243170723f66b3df64572bcb6e4ccd34 | Fix GenericNetworkReceiver (#35) | ManiacalLabs/BiblioPixelAnimations,rec/BiblioPixelAnimations | BiblioPixelAnimations/receivers/GenericNetworkReceiver.py | BiblioPixelAnimations/receivers/GenericNetworkReceiver.py | from bibliopixel.animation.receiver import BaseReceiver
import bibliopixel.drivers.network_receiver as net
from bibliopixel import LEDMatrix, LEDStrip
class GenericNetworkReceiver(BaseReceiver):
def __init__(self, layout, port=3142, interface='0.0.0.0', raw=False, width=None, height=None):
super(GenericNe... | from bibliopixel.receiver_anim import BaseReceiver
import bibliopixel.drivers.network_receiver as net
from bibliopixel import LEDMatrix, LEDStrip
class GenericNetworkReceiver(BaseReceiver):
def __init__(self, layout, port=3142, interface='0.0.0.0', raw=False, width=None, height=None):
super(GenericNetwork... | mit | Python |
2112f0ef4805872765b505c83e5bcab2713429ac | Fix for <random> | CHT5/program-y,CHT5/program-y,CHT5/program-y,JustArchi/program-y,dkamotsky/program-y,dkamotsky/program-y,JustArchi/program-y,JustArchi/program-y,dkamotsky/program-y | src/programy/parser/template/nodes/rand.py | src/programy/parser/template/nodes/rand.py | """
Copyright (c) 2016 Keith Sterling
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,... | """
Copyright (c) 2016 Keith Sterling
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,... | mit | Python |
818e2e51b222425b6b05597c9255033abed01a9e | change locals to local net | derwolfe/teiler,derwolfe/teiler | src/actions/locate.py | src/actions/locate.py | import netifaces
# """
# The module is intended to be an abstraction that helps the user find the
# local ip address that will be used for broadcasting. As windows, linux/mac
# handle their interfaces differently, we want the correct IP address found and used.
# """
def get_live_interface():
"""will return a lis... | import netifaces
# """
# The module is intended to be an abstraction that helps the user find the
# local ip address that will be used for broadcasting. As windows, linux/mac
# handle their interfaces differently, we want the correct IP address found and used.
# eth0 will be given precedence over broadcast(wifi).
# "... | mit | Python |
4d7226e56128637041bcd35e27b147d6559c59be | Add latest version of py-pytest-httpbin (#13301) | iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/py-pytest-httpbin/package.py | var/spack/repos/builtin/packages/py-pytest-httpbin/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPytestHttpbin(PythonPackage):
"""Easily test your HTTP library against a local copy of h... | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPytestHttpbin(PythonPackage):
"""Easily test your HTTP library against a local copy of h... | lgpl-2.1 | Python |
86b61d25c48688c7939208424bc649f72f7c15d3 | Update create_output_from_dir.py | NZRS/wavetrace | create_output_from_dir.py | create_output_from_dir.py |
# Author: chris guest
# run splat script for QTH files in current dir starting with specified prefix.
import sys
import create_output
import os
import glob, getopt
receive_sensitivity = -110
definition='sd'
try:
opts, args = getopt.getopt(sys.argv[1:],"s:h",["sensitivity="])
except getopt.GetoptError:
sys.ex... |
# Author: chris guest
# run splat script for QTH files in current dir starting with specified prefix.
import sys
import create_output
import os
import glob, getopt
receive_sensitivity = '-110'
definition='sd'
try:
opts, args = getopt.getopt(sys.argv[1:],"s:h",["sensitivity="])
except getopt.GetoptError:
sys.... | agpl-3.0 | Python |
9d0d61abd143fe1744053c2ecda28b98022aab83 | Add missing blank lines in __init__.py | ddico/rma,damdam-s/rma,open-synergy/rma,open-synergy/rma,Endika/rma,Endika/rma,raycarnes/rma,eezee-it/rma,eezee-it/rma,ddico/rma | crm_claim_rma/__init__.py | crm_claim_rma/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2015 Eezee-It
# Copyright 2013 Camptocamp
# Copyright 2009-2013 Akretion,
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau,
# Joel Grand-Guillaume
#
# This program is fre... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2015 Eezee-It
# Copyright 2013 Camptocamp
# Copyright 2009-2013 Akretion,
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau,
# Joel Grand-Guillaume
#
# This program is fre... | agpl-3.0 | Python |
2c4983dc7c12792d5365d1f2047c8135dead7612 | Fix import in test | mpi4py/mpi4py,pressel/mpi4py,pressel/mpi4py,pressel/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py,pressel/mpi4py | test/test_mem.py | test/test_mem.py | from mpi4py import MPI
import mpiunittest as unittest
class TestMemory(unittest.TestCase):
def testMemory1(self):
for size in range(0, 10000, 100):
if size == 0: size = 1
try:
mem1 = MPI.Alloc_mem(size)
self.assertEqual(len(mem1), size)
... | import unittest
from mpi4py import MPI
class TestMemory(unittest.TestCase):
def testMemory1(self):
for size in range(0, 10000, 100):
if size == 0: size = 1
try:
mem1 = MPI.Alloc_mem(size)
self.assertEqual(len(mem1), size)
MPI.Free_mem... | bsd-2-clause | Python |
60458c8ae7c3d99a4dd408bc7fbced3b4a8cd7de | Implement custom context manager for changing CWD | vdemeester/compose,thaJeztah/compose,thaJeztah/compose,vdemeester/compose | tests/helpers.py | tests/helpers.py | from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import os
from compose.config.config import ConfigDetails
from compose.config.config import ConfigFile
from compose.config.config import load
BUSYBOX_IMAGE_NAME = 'busybox'
BUSYBOX_DEFAULT_TAG = '1.31.0-uclibc'
BUSYBOX_I... | from __future__ import absolute_import
from __future__ import unicode_literals
import os
from compose.config.config import ConfigDetails
from compose.config.config import ConfigFile
from compose.config.config import load
BUSYBOX_IMAGE_NAME = 'busybox'
BUSYBOX_DEFAULT_TAG = '1.31.0-uclibc'
BUSYBOX_IMAGE_WITH_TAG = '{... | apache-2.0 | Python |
1572c501bb55fff3b0fca12c8ad1c6a6b20626d8 | abort apply_along_axis-based interpolate | dgketchum/MT_Rsense | utils/landsat.py | utils/landsat.py | import os
import numpy as np
import rasterio
import requests
import xarray as xr
import rioxarray
from scipy.interpolate import RegularGridInterpolator as rgi
import dask
from dask.array import map_blocks
from pandas import DataFrame, to_datetime
QA_VALUES = [322.0, 324.0, 328.0, 336.0, 352.0, 368.0, 386.0, 388.0,
... | import os
import numpy as np
import rasterio
import requests
import xarray as xr
import rioxarray
import dask
from dask.array import map_blocks
from pandas import DataFrame, to_datetime
QA_VALUES = [322.0, 324.0, 328.0, 336.0, 352.0, 368.0, 386.0, 388.0,
392.0, 400.0, 416.0, 432.0, 480.0, 834.0, 836.0, ... | apache-2.0 | Python |
16369ed6a11aaa39e94479b06ed78eb75f5b33e1 | Fix --crx arg error reporting. | ghostwords/chameleon-crawler,ghostwords/chameleon-crawler,ghostwords/chameleon-crawler | src/args.py | src/args.py | #!/usr/bin/env python3
# chameleon-crawler
#
# Copyright 2014 ghostwords.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from glob import glob
from os import path
... | #!/usr/bin/env python3
# chameleon-crawler
#
# Copyright 2014 ghostwords.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from argparse import ArgumentParser
from gl... | mpl-2.0 | Python |
d70c5fc18c9efa4d16c3ea8bfc59cb4eef8b6c8d | update bump | swbooking/RobotMaria | src/bump.py | src/bump.py | #!/usr/bin/env python
### Class to control the two front bump sensors ###
import Adafruit_BBIO.GPIO as GPIO
import time
class BumpSensor(sensorState.Sensor):
def __init__(self, inName, inDefaultPriority=3, black_pin = "P8_7", tan_pin = "P8_26", **kwargs):
# boilerplate bookkeeping
Sensor.__init__(self, inN... | #!/usr/bin/env python
### Class to control the two front bump sensors ###
import Adafruit_BBIO.GPIO as GPIO
import time
class BumpSensor(sensorState.Sensor):
def __init__(self, inName, inDefaultPriority=3, black_pin = "P8_7", tan_pin = "P8_26", **kwargs):
# boilerplate bookkeeping
Sensor.__init__(self, inN... | mit | Python |
6762ba54129cd85ee694cb49685fa0869fcf0b5b | Update scandium.py | jarle/scandium | scandium.py | scandium.py | import os
import glob
import gzip
import subprocess
import shutil
WORKDIR = "temp/"
def app_is_system(filename):
with open(filename) as app_properties:
for line in app_properties:
if "app_is_system=1" == line.rstrip():
return True
return False
def unzip_application(arc... | import os
import glob
import gzip
import subprocess
import shutil
WORKDIR = "temp/"
def app_is_system(filename):
with open(filename) as app_properties:
for line in app_properties:
if "app_is_system=1" == line.rstrip():
return True
return False
def unzip_application(arc... | mit | Python |
314c7d3507ffce7c37539f42e87c13dee46ece33 | Update till_my_death.py | hidenori-t/snippet | till_my_death.py | till_my_death.py | # coding: utf-8
# 参考 http://meganezumi.seesaa.net / article / 391262919.html
import tkinter as Tk
import time
import datetime
# 寿命を残り20年,54歳までとする
my_time = (datetime.datetime(2039, 1, 28) -
datetime.datetime.now()).total_seconds()
WIDTH = 10
class Timer(Tk.Frame):
def __init__(self, master=None): ... | # coding: utf-8
# 参考 http://meganezumi.seesaa.net / article / 391262919.html
import tkinter as Tk
import time
import datetime
my_time = (datetime.datetime(2069, 1, 28) -
datetime.datetime.now()).total_seconds()
WIDTH = 10
class Timer(Tk.Frame):
def __init__(self, master=None): # 各ボタンの配置
Tk... | mit | Python |
09cea4d95731956d9a23ed96ae90d4c85e3f64ae | add relieflessness to make the panel example look like a normal panel plugin. | cr33dog/pyxfce,cr33dog/pyxfce,cr33dog/pyxfce | examples/panel/testplugin1/testplugin.py | examples/panel/testplugin1/testplugin.py | #!/usr/bin/env python
import pygtk
pygtk.require("2.0")
import gtk
import xfce4.panel
class MyPlugin(xfce4.panel.Plugin):
def __init__(self):
xfce4.panel.Plugin.__init__(self)
button1 = gtk.Button("test")
button1.set_relief(gtk.RELIEF_NONE)
button1.show()
self.add(button1)
l1 = dir(self)
l2 =... | #!/usr/bin/env python
import pygtk
pygtk.require("2.0")
import gtk
import xfce4.panel
class MyPlugin(xfce4.panel.Plugin):
def __init__(self):
xfce4.panel.Plugin.__init__(self)
button1 = gtk.Button("test")
button1.show()
self.add(button1)
l1 = dir(self)
l2 = dir(gtk.Window)
for item in l1:
... | bsd-3-clause | Python |
7bf8524fd0ef83bbbb3ed26df9ec058ba297fa16 | Remove this. | concordusapps/alchemist | alchemist/commands/test.py | alchemist/commands/test.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, division
from flask.ext.script import Command, Option
from alchemist import app
import pytest
from os import path
from importlib import import_module
class Test(Command):
name = 'test'
option_list = [
Option(dest='name... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, division
from flask.ext.script import Command, Option
from alchemist import app
import pytest
from os import path
from importlib import import_module
class Test(Command):
name = 'test'
option_list = [
Option(dest='name... | mit | Python |
fa5a77ae18c414729aca3e8be9563b6cc6836f3e | Fix a bug in the scheduler. | OpenGazettes/aleph,OpenGazettes/aleph,pudo/aleph,gazeti/aleph,pudo/aleph,alephdata/aleph,gazeti/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,gazeti/aleph,OpenGazettes/aleph,gazeti/aleph,OpenGazettes/aleph,alephdata/aleph | aleph/crawlers/schedule.py | aleph/crawlers/schedule.py | import logging
from datetime import timedelta, datetime
from aleph.model import Document
log = logging.getLogger(__name__)
class CrawlerSchedule(object):
def __init__(self, name, **delta):
self.name = name
self.delta = timedelta(**delta)
def check_due(self, crawler_id):
# should th... | import logging
from datetime import timedelta, datetime
from aleph.model import Document
log = logging.getLogger(__name__)
class CrawlerSchedule(object):
def __init__(self, name, **delta):
self.name = name
self.delta = timedelta(**delta)
def check_due(self, crawler_id):
# should th... | mit | Python |
034aa493c9d143799fcb937d09a0149907138025 | Remove unused command line arguments | benmishkanian/ASF-JIRA-mine,benmishkanian/ASF-JIRA-mine,benmishkanian/ASF-JIRA-mine | examples/argumentParser.py | examples/argumentParser.py | from jiradb.database import EMAIL_GH_LOGIN_TABLE_NAME
def getArguments():
# Parse script arguments. Returns a dict.
import argparse
parser = argparse.ArgumentParser(description='Mine ASF JIRA data.')
parser.add_argument('-c', '--cached', dest='cached', action='store_true', help='Mines data from the ca... | import getpass
from jiradb.database import EMAIL_GH_LOGIN_TABLE_NAME
def getArguments():
# Parse script arguments. Returns a dict.
import argparse
parser = argparse.ArgumentParser(description='Mine ASF JIRA data.')
parser.add_argument('-c', '--cached', dest='cached', action='store_true', help='Mines ... | mit | Python |
a98ac785047f2dedfdccb3254bec8ed6badf3098 | Correct typo in stats.py | AdrienGuille/TOM,AdrienGuille/TOM | tom_lib/stats.py | tom_lib/stats.py | # coding: utf-8
import numpy
import numpy as np
import scipy.stats as stats
__author__ = "Adrien Guille"
__email__ = "adrien.guille@univ-lyon2.fr"
def symmetric_kl(distrib_p, distrib_q):
return numpy.sum([stats.entropy(distrib_p, distrib_q), stats.entropy(distrib_p, distrib_q)])
def myjaccard(r_i, r_j):
re... | # coding: utf-8
import numpy
import numpy as np
import scipy.stats as stats
__author__ = "Adrien Guille"
__email__ = "adrien.guille@univ-lyon2.fr"
def symmetric_kl(distrib_p, distrib_q):
return numpy.sum([stats.entropy(distrib_p, distrib_q), stats.entropy(distrib_p, distrib_q)])
def myjaccard(r_i, r_j):
re... | mit | Python |
c775d591927b20b6459ff984580b08a4e5c4f1ce | change comment and generate code based django-1.11. (commonalize 0.6.x branch) | dictoss/active-task-summary,dictoss/active-task-summary,dictoss/active-task-summary,dictoss/active-task-summary | toolproj/wsgi.py | toolproj/wsgi.py | """
WSGI config for toolproj project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | """
WSGI config for toolproj project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toolproj.settings")
from django.core... | bsd-2-clause | Python |
ffde73d2e0be6a299613fb9f7c903ead798ab6ad | add more phases (waiting for user input) for figure8_canned | USC-ACTLab/crazyswarm,USC-ACTLab/crazyswarm,USC-ACTLab/crazyswarm,USC-ACTLab/crazyswarm | ros_ws/src/crazyswarm/scripts/figure8_canned.py | ros_ws/src/crazyswarm/scripts/figure8_canned.py | #!/usr/bin/env python
import numpy as np
from pycrazyswarm import *
if __name__ == "__main__":
swarm = Crazyswarm()
timeHelper = swarm.timeHelper
allcfs = swarm.allcfs
TRIALS = 1
for i in range(TRIALS):
allcfs.takeoff(targetHeight=1.0, duration=2.0)
timeHelper.sleep(2.0)
... | #!/usr/bin/env python
import numpy as np
from pycrazyswarm import *
if __name__ == "__main__":
swarm = Crazyswarm()
timeHelper = swarm.timeHelper
allcfs = swarm.allcfs
TRIALS = 1
for i in range(TRIALS):
allcfs.takeoff(targetHeight=1.0, duration=2.0)
timeHelper.sleep(2.0)
... | mit | Python |
af99409521fa19a8d0a124b93e83727696c658df | use flow accessor. | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | pykeg/core/kegbot_unittest.py | pykeg/core/kegbot_unittest.py | #!/usr/bin/env python
"""Unittest for kegbot module"""
import commands
import time
import logging
import socket
import unittest
import kegbot
from django.test import TestCase
from pykeg.core import defaults
from pykeg.core import models
from pykeg.core import kb_common
from pykeg.scripts import gentestdata
class K... | #!/usr/bin/env python
"""Unittest for kegbot module"""
import commands
import time
import logging
import socket
import unittest
import kegbot
from django.test import TestCase
from pykeg.core import defaults
from pykeg.core import models
from pykeg.core import kb_common
from pykeg.scripts import gentestdata
class K... | mit | Python |
fe1421b496d2b605c5bdb942b83e1244fd675075 | add doc | BrightnessMonitor/BrightnessMonitorClient,BrightnessMonitor/BrightnessMonitorClient | src/brightnessmonitorclient/api_client/update.py | src/brightnessmonitorclient/api_client/update.py | from datetime import datetime
import requests
import json
from brightnessmonitorclient.config.read_config import read_config
def upload(value, time):
'''
Upload the value & time to the website
Args:
value: The value witch should be upload
time: The datetime witch should be upload
... | from datetime import datetime
import requests
import json
from brightnessmonitorclient.config.read_config import read_config
def upload(value, dateNow):
'''
Args:
value: The value witch should be upload
datetime: The datetime witch should be upload
Returns:
'''
config = rea... | mit | Python |
424960c794484dc4895c91cd148b2a59314a7437 | Fix comment | pyQode/pyqode.core,zwadar/pyqode.core,pyQode/pyqode.core | pyqode/core/modes/indenter.py | pyqode/core/modes/indenter.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Colin Duquesnoy
#
# This file is part of pyQode.
#
# pyQode is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the Licen... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Colin Duquesnoy
#
# This file is part of pyQode.
#
# pyQode is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the Licen... | mit | Python |
66b63ef21f6c5188acb2e06401fd605023fb3ab4 | Add STEC to __init__.py | achabotl/pambox | pambox/speech/__init__.py | pambox/speech/__init__.py | """
The :mod:`pambox.speech` module gather speech intelligibility
models.
"""
from __future__ import absolute_import
from .sepsm import Sepsm
from .mrsepsm import MrSepsm
from .sii import Sii
from .stec import Stec
from .material import Material
from .experiment import Experiment
__all__ = [
'Sepsm',
'MrSepsm... | """
The :mod:`pambox.speech` module gather speech intelligibility
models.
"""
from __future__ import absolute_import
from .sepsm import Sepsm
from .mrsepsm import MrSepsm
from .sii import Sii
from .material import Material
from .experiment import Experiment
__all__ = [
'Sepsm',
'MrSepsm',
'Sii',
'Mate... | bsd-3-clause | Python |
3738d8215d207cc30bef4b1e60cbc5a4f701b5f2 | Update run-dev to prefix match messages/latest. | voidException/zulip,jeffcao/zulip,EasonYi/zulip,paxapy/zulip,Qgap/zulip,esander91/zulip,ikasumiwt/zulip,wangdeshui/zulip,isht3/zulip,Jianchun1/zulip,johnnygaddarr/zulip,ericzhou2008/zulip,akuseru/zulip,ashwinirudrappa/zulip,levixie/zulip,Gabriel0402/zulip,seapasulli/zulip,shaunstanislaus/zulip,KingxBanana/zulip,easyfmx... | tools/run-dev.py | tools/run-dev.py | #!/usr/bin/env python
import optparse
import subprocess
import signal
import traceback
import os
from os import path
from twisted.internet import reactor
from twisted.web import proxy, server, resource
parser = optparse.OptionParser(r"""
Starts the app listening on localhost, for local development.
This script... | #!/usr/bin/env python
import optparse
import subprocess
import signal
import traceback
import os
from os import path
from twisted.internet import reactor
from twisted.web import proxy, server, resource
parser = optparse.OptionParser(r"""
Starts the app listening on localhost, for local development.
This script... | apache-2.0 | Python |
d2e9a0563efccdd3a4a4c9e22f0d3ee9b49b1905 | Make abstract class for camera; gphoto2 and indi both inherit from it; NOTE: indi class will need some work on the multiple inheritance | panoptes/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,joshwalawender/POCS,AstroHuntsman/POCS,joshwalawender/POCS,AstroHuntsman/POCS,panoptes/POCS | panoptes/camera/camera.py | panoptes/camera/camera.py | from ..utils.indi import PanIndiDevice
from ..utils.logger import has_logger
from ..utils import error
from ..utils import listify
import shutil
import subprocess
@has_logger
class AbstractCamera(object):
""" Base class for both INDI and gphoto2 cameras """
def __init__(self, config):
self.config ... | from ..utils.indi import PanIndiDevice
from ..utils.logger import has_logger
from ..utils import error
from ..utils import listify
import shutil
import subprocess
@has_logger
class AbstractIndiCamera(PanIndiDevice):
""" Abstract Camera class that uses INDI.
Args:
config(Dict): Config key/value p... | mit | Python |
f97f1cc746007fcaf3e6a3e43d6e6b8feb4d6c35 | bump paramiko in /contrib/test/usrp_emb | EttusResearch/meta-ettus,EttusResearch/meta-ettus,EttusResearch/meta-ettus,EttusResearch/meta-ettus,EttusResearch/meta-ettus,EttusResearch/meta-ettus | contrib/test/usrp_emb/setup.py | contrib/test/usrp_emb/setup.py | #!/usr/bin/env python3
from setuptools import setup
setup(
name='usrp_emb',
version='0.0.1',
description='USRP Embedded Tools',
long_description='USRP Embedded Tools',
url='https://github.com/EttusResearch',
author='Michael Auchter',
author_email='michael.auchter@ni.com',
license='MIT'... | #!/usr/bin/env python3
from setuptools import setup
setup(
name='usrp_emb',
version='0.0.1',
description='USRP Embedded Tools',
long_description='USRP Embedded Tools',
url='https://github.com/EttusResearch',
author='Michael Auchter',
author_email='michael.auchter@ni.com',
license='MIT'... | mit | Python |
3366b6494ee9c6185e9dd1cceda4acc6273e04aa | Customize scripts to work with menu | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ibmcnx/menu/cnxmenu.py | ibmcnx/menu/cnxmenu.py | ######
# Menu for Community Scripts
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# History: Changed by Jan Alderlieste
import sys
impo... | ######
# Menu for Community Scripts
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# History: Changed by Jan Alderlieste
import sys
impo... | apache-2.0 | Python |
e8e5267131f654068624b5b346e484490fe4c4be | Add more Mastodon servers. | obsidianforensics/unfurl,obsidianforensics/unfurl | parsers/parse_mastodon.py | parsers/parse_mastodon.py | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
78675420e9d23d9978f68ed002de0fc1284d3d0c | Add forward function declaration to Class Node | YabinHu/miniflow | node.py | node.py | class Node(object):
def __init__(self):
# Node(s) from which this Node receives values
self.inbound_nodes = inbound_nodes
# Node(s) to which this Node passes values
self.outbound_nodes = []
# For each inbound Node here, add this Node as an outbound to that Node.
for n in self.inbound_nodes:
... | class Node(object):
def __init__(self):
# Node(s) from which this Node receives values
self.inbound_nodes = inbound_nodes
# Node(s) to which this Node passes values
self.outbound_nodes = []
# For each inbound Node here, add this Node as an outbound to that Node.
for n in self.inbound_nodes:
... | mit | Python |
b50815d04a6aa7235bbf80fe6b8bfcbeb30667ab | Update mqtt-message-sample.py | enableiot/iotkit-samples,enableiot/iotkit-samples,enableiot/iotkit-samples,enableiot/iotkit-samples | python/mqtt-message-sample.py | python/mqtt-message-sample.py | #!/usr/bin/env python
# Copyright © 2013 enableiot.com
# All rights reserved under the copyright laws
# of the United States and applicable international
# laws, treaties, and conventions.
# You may freely redistribute and use this sample
# code, with or without modification, provided you
# include the original co... | #!/usr/bin/env python
#
# This script publish a random MQTT messages in specified cadence
#
import random
import time
import mosquitto
# Replace with environment variables
cadence = int(6)
broker = '127.0.0.1'
port = 1883
topic = 'data/mark/device-py1'
message = {
"msg_type": "metrics_msg",
... | bsd-2-clause | Python |
b2367bb02b5497740492d353c4553e0c1d5bb58b | print out when reprompt | Secured-Pi/raspberry-pi-client | src/main.py | src/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from lock import RPiLock
from user import User
import logging
import getpass
logging.getLogger('socketIO-client').setLevel(logging.DEBUG)
SERVER, PORT = '52.43.75.183', 8000
def verify_user(server, port=None):
while True:
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from lock import RPiLock
from user import User
import logging
import getpass
logging.getLogger('socketIO-client').setLevel(logging.DEBUG)
SERVER, PORT = '52.43.75.183', 8000
def verify_user(server, port=None):
while True:
... | mit | Python |
974f7d3a91e2ed41f7f3fcc13ade4af3d720b888 | Fix failures when zmq is not available. | ozamiatin/oslo.messaging,dukhlov/oslo.messaging,dims/oslo.messaging,ozamiatin/oslo.messaging,apporc/oslo.messaging,dukhlov/oslo.messaging,dims/oslo.messaging,apporc/oslo.messaging | oslo_messaging/_drivers/zmq_driver/zmq_names.py | oslo_messaging/_drivers/zmq_driver/zmq_names.py | # Copyright 2015 Mirantis, 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 ... | # Copyright 2015 Mirantis, 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 ... | apache-2.0 | Python |
88f6da66663c49f04f980b5f216d93a8e277036a | fix missing import | rbanffy/testable_appengine,rbanffy/testable_appengine | src/main.py | src/main.py | import webapp2
import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
class SampleIndex(webapp2.RequestHandler):
"Stub request handler"
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write("helloworld")
application = webapp2.WSGIAppl... | import webapp2
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
class SampleIndex(webapp2.RequestHandler):
"Stub request handler"
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write("helloworld")
application = webapp2.WSGIApplication([
... | apache-2.0 | Python |
437b24377db6fb74256c41431bde25b350e6711c | Use shotachan booru for shota command | BeatButton/beattie,BeatButton/beattie-bot | nsfw.py | nsfw.py | import io
import random
from discord.ext import commands
from lxml import etree
class NSFW:
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=['gel'], hidden=True)
async def gelbooru(self, ctx, *, tags):
async with ctx.typing():
url = await self.booru('http://... | import io
import random
from discord.ext import commands
from lxml import etree
class NSFW:
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=['gel'], hidden=True)
async def gelbooru(self, ctx, *, tags):
async with ctx.typing():
url = await self.booru('http://... | mit | Python |
1d8107d321def2efa5005a66be41e913c0579c56 | Allow setting home page to ''. | CorralPeltzer/newTrackon | trackon/admin.py | trackon/admin.py | from google.appengine.api import memcache as MC
from google.appengine.api import datastore as DS
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from mako.template import Template
from mako.lookup import TemplateLookup
from trackon.gaeutils import logmsg, ge... | from google.appengine.api import memcache as MC
from google.appengine.api import datastore as DS
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from mako.template import Template
from mako.lookup import TemplateLookup
from trackon.gaeutils import logmsg, ge... | mit | Python |
e5fdf8cb44f10d53bb4ca8cbfd5904a9e336bb07 | Revert "Step name should be a basestring instead of str." | luci/recipes-py,shishkander/recipes-py,luci/recipes-py,shishkander/recipes-py | recipe_modules/step/config.py | recipe_modules/step/config.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
from slave.recipe_config import List
from slave.recipe_config import config_item_context, ConfigGroup, Dict, Single
from slave.recipe_con... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
from slave.recipe_config import List
from slave.recipe_config import config_item_context, ConfigGroup, Dict, Single
from slave.recipe_con... | apache-2.0 | Python |
07e08e57a883298807d7fe2110c56350d8c4a7fa | Bump version to 1.5.2 | AltSchool/dynamic-rest,AltSchool/dynamic-rest,sanoma/dynamic-rest,sanoma/dynamic-rest | dynamic_rest/constants.py | dynamic_rest/constants.py | APP_NAME = "dynamic_rest"
AUTHOR = "Anthony Leontiev"
AUTHOR_EMAIL = "ant@altschool.com, ryo@altschool.com"
DESCRIPTION = "Adds Dynamic API support to Django REST Framework."
REPO_NAME = "dynamic-rest"
PROJECT_NAME = "Dynamic REST"
ORG_NAME = "AltSchool"
VERSION = "1.5.2"
| APP_NAME = "dynamic_rest"
AUTHOR = "Anthony Leontiev"
AUTHOR_EMAIL = "ant@altschool.com, ryo@altschool.com"
DESCRIPTION = "Adds Dynamic API support to Django REST Framework."
REPO_NAME = "dynamic-rest"
PROJECT_NAME = "Dynamic REST"
ORG_NAME = "AltSchool"
VERSION = "1.5.0"
| mit | Python |
14b74886ba6cd211d03b8a90813d210777587812 | change sequence identifier and timing attributes of body | ebu/ebu-tt-live-toolkit,bbc/ebu-tt-live-toolkit,bbc/ebu-tt-live-toolkit,bbc/ebu-tt-live-toolkit,ebu/ebu-tt-live-toolkit,ebu/ebu-tt-live-toolkit | ebu_tt_live/node/delay.py | ebu_tt_live/node/delay.py |
from .base import Node
from datetime import timedelta
from ebu_tt_live.bindings._ebuttdt import LimitedClockTimingType
import time
import random
class FixedDelayNode(Node):
_reference_clock = None
_sequence = None
_document_queue = Queue()
def __init__(self, node_id, carriage_impl, reference_clock... | from .base import Node
class FixedDelayNode(Node):
_reference_clock = None
_sequence = None
def __init__(self, node_id, carriage_impl, reference_clock):
super(FixedDelayNode, self).__init__(node_id, carriage_impl)
self._reference_clock = reference_clock
def process_document(self, document):
pass | bsd-3-clause | Python |
2271d2f9ebc66174232ee85d2bd0edf4c1c1aebb | verify add method | gbanegas/KissECC | twistedcurves.py | twistedcurves.py | import collections,sys
from numpy.testing import assert_almost_equal
from ecc import EC
Coord = collections.namedtuple("Coord", ["x", "y"])
class TwistedEC(EC):
def __init__(self, a, b, q):
EC.__init__(self, a, b, q)
"""Twisted curve as: (a*x**2 + y**2 = 1 + dx**2y**2) mod
- a, b: params o... | import collections,sys
from numpy.testing import assert_almost_equal
from ecc import EC
Coord = collections.namedtuple("Coord", ["x", "y"])
class TwistedEC(EC):
def __init__(self, a, b, q):
EC.__init__(self, a, b, q)
"""Twisted curve as: (a*x**2 + y**2 = 1 + dx**2y**2) mod
- a, b: params o... | apache-2.0 | Python |
67fffdcfa9bf0880150022a845aeca8e4f5928ae | Replace _normal with an empty string in twitter profile pic URLs | p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc | twitter/views.py | twitter/views.py | from django import http
from django.conf import settings
import json
from twitter import utils
def get_data(request):
if request.method == 'POST' and 'twitter_handle' in request.POST.keys():
twitter_handle = request.POST.get('twitter_handle')
creds = (settings.TWITTER_ACCESS_TOKEN, settings.TWITT... | from django import http
from django.conf import settings
import json
from twitter import utils
def get_data(request):
if request.method == 'POST' and 'twitter_handle' in request.POST.keys():
twitter_handle = request.POST.get('twitter_handle')
creds = (settings.TWITTER_ACCESS_TOKEN, settings.TWITT... | mit | Python |
291b7e849aeb1d8ffa77ef39394978f922fc1bb4 | Add patches for lxml and beautifulsoup4 | recipy/recipy,recipy/recipy | recipy/PatchBaseScientific.py | recipy/PatchBaseScientific.py | import sys
from .PatchImporter import PatchImporter
from .PatchSimple import PatchSimple
import wrapt
from .log import log_input, log_output
from recipyCommon.utils import create_wrapper, multiple_insert
class PatchPandas(PatchSimple):
modulename = 'pandas'
input_functions = ['read_csv', 'read_table', 'read_e... | import sys
from .PatchImporter import PatchImporter
from .PatchSimple import PatchSimple
import wrapt
from .log import log_input, log_output
from recipyCommon.utils import create_wrapper, multiple_insert
class PatchPandas(PatchSimple):
modulename = 'pandas'
input_functions = ['read_csv', 'read_table', 'read_e... | apache-2.0 | Python |
eec5e3290bd9390c0f7b5bb65edd6a1f5c7702e5 | Return dashboard after archive | hudl/redash,easytaxibr/redash,pubnative/redash,moritz9/redash,imsally/redash,useabode/redash,stefanseifert/redash,hudl/redash,stefanseifert/redash,amino-data/redash,crowdworks/redash,44px/redash,guaguadev/redash,imsally/redash,EverlyWell/redash,alexanderlz/redash,guaguadev/redash,44px/redash,easytaxibr/redash,akariv/re... | redash/handlers/dashboards.py | redash/handlers/dashboards.py | from flask import request
from flask.ext.restful import abort
from flask_login import current_user
from funcy import distinct
from itertools import chain
from redash import models
from redash.wsgi import api
from redash.permissions import require_permission
from redash.handlers.base import BaseResource
class Dashbo... | from flask import request
from flask.ext.restful import abort
from flask_login import current_user
from funcy import distinct
from itertools import chain
from redash import models
from redash.wsgi import api
from redash.permissions import require_permission
from redash.handlers.base import BaseResource
class Dashbo... | bsd-2-clause | Python |
794a14511131ada8b785222fcefd69b16e0008db | Fix comment | GluuFederation/oxExternal | uma_authorization_policy/sample/SampleScript.py | uma_authorization_policy/sample/SampleScript.py | from org.xdi.model.custom.script.type.uma import AuthorizationPolicyType
from org.xdi.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayList
from org.xdi.oxauth.service.uma.authorization import AuthorizationContext
import java
class AuthorizationPolicy(AuthorizationPolicyType):
def __init__... | from org.xdi.model.custom.script.type.uma import AuthorizationPolicyType
from org.xdi.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayList
from org.xdi.oxauth.service.uma.authorization import AuthorizationContext
import java
class AuthorizationPolicy(AuthorizationPolicyType):
def __init__... | mit | Python |
4ad0fad73b1739ebd1c7a78a6e5bca2e6e6d54e5 | fix custom module loader (#1931) | lonelycode/tyk,lonelycode/tyk,lonelycode/tyk | coprocess/python/tyk/loader.py | coprocess/python/tyk/loader.py | import imp, sys, os
from gateway import TykGateway as tyk
class MiddlewareLoader():
def __init__(self, mw=None):
self.mw = mw
self.bundle_root_path = mw.bundle_root_path
def find_module(self, module_name, package_path):
module_filename = "{0}.py".format(module_name)
self.base_path ... | import imp, sys, os
from gateway import TykGateway as tyk
class MiddlewareLoader():
def __init__(self, mw=None):
self.mw = mw
self.bundle_root_path = mw.bundle_root_path
def find_module(self, module_name, package_path):
module_filename = "{0}.py".format(module_name)
self.base_path ... | mpl-2.0 | Python |
f2e3808f4d989acdc5ae1b64dc47d0c1d6c28228 | add test ko to check if drone works | Guismo1/roomfinder,Guismo1/roomfinder,GuillaumeMorini/roomfinder,Guismo1/roomfinder,GuillaumeMorini/roomfinder,GuillaumeMorini/roomfinder | testing.py | testing.py | import unittest
import sys
sys.path.append('roomfinder_web/roomfinder_web')
import web_server
class FlaskTestCase(unittest.TestCase):
def setUp(self):
sys.stderr.write('Setup testing.')
web_server.app.config['TESTING'] = True
self.app = demoapp.app.test_client()
def test_correct_http... | import unittest
import sys
sys.path.append('roomfinder_web/roomfinder_web')
import web_server
class FlaskTestCase(unittest.TestCase):
def setUp(self):
sys.stderr.write('Setup testing.')
web_server.app.config['TESTING'] = True
self.app = demoapp.app.test_client()
def test_correct_http... | apache-2.0 | Python |
4ea9fddf13f9ddce48724997bd5c24efd509b97f | Add Bootstrap4 specifc defaults into its own subfolder | haricot/djangocms-bs4forcascade,haricot/djangocms-bs4forcascade | cmsplugin_bs4forcascade/bootstrap4/settings.py | cmsplugin_bs4forcascade/bootstrap4/settings.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
from cmsplugin_cascade.extra_fields.config import PluginExtraFieldsConfig
CASCADE_PLUGINS = getat... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
CASCADE_PLUGINS = getattr(settings, 'BS4_CASCADE_PLUGINS',
['buttons', 'carousel', 'accordion... | mit | Python |
4233b22ea08cc4c256d995193b24db94a4c7cb5b | Add pin read/write methods | projectweekend/Pi-Pin-Manager | pins.py | pins.py | import yaml
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
class PinNotDefinedError(Exception):
pass
class PinConfigurationError(Exception):
pass
class PinManager(object):
def __init__(self, config_file):
self.config_file = config_file
self._load_config()
self._gpio = GPIO
se... | import os
import yaml
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
class PinManager(object):
def __init__(self, config_file):
self.config_file = config_file
self._load_config()
self._gpio = GPIO
self._initialize_pins()
def _load_config(self):
with open(self.config_file) as fi... | mit | Python |
e1d399819c085b31fb9aa243086af55ae007e064 | Use strip() properly | perfsonar/pscheduler,mfeit-internet2/pscheduler-dev,perfsonar/pscheduler,perfsonar/pscheduler,mfeit-internet2/pscheduler-dev,perfsonar/pscheduler | python-pscheduler/pscheduler/pscheduler/exitstatus.py | python-pscheduler/pscheduler/pscheduler/exitstatus.py | """
Functions for exiting scripts in a standard way.
"""
import json
import sys
def fail(*args):
"""
Exit with failure with optional commentary to stderr.
"""
message = ''
for arg in args:
message += arg
sys.stderr.write(message.strip() + '\n')
exit(1)
def fail_other(status, *ar... | """
Functions for exiting scripts in a standard way.
"""
import json
import sys
def fail(*args):
"""
Exit with failure with optional commentary to stderr.
"""
message = ''
for arg in args:
message += arg
sys.stderr.write(message.strip() + '\n')
exit(1)
def fail_other(status, *ar... | apache-2.0 | Python |
d5bcdbd92684308d456498595a5800eb33c95c3b | Fix typo. | AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT... | python_scripts/extractor_python_readability_server.py | python_scripts/extractor_python_readability_server.py | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTranspor... | #!/usr/bin/python
import sys
import os
import glob
#sys.path.append(os.path.join(os.path.dirname(__file__), "gen-py"))
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTranspor... | agpl-3.0 | Python |
cfb2ea773ecf52a97a1d29db64fa166eff52aa3b | implement calculate_transaction_fee test | PeerAssets/pypeerassets | test/test_transactions.py | test/test_transactions.py | import pytest
from decimal import Decimal, getcontext
getcontext().prec = 6
from pypeerassets.transactions import *
@pytest.mark.parametrize("tx_size", [181, 311])
def test_calculate_transaction_fee(tx_size):
assert round(calculate_tx_fee(tx_size), 2) == round(Decimal(0.01), 2)
| import pytest
from binascii import unhexlify, hexlify
from pypeerassets.transactions import *
| bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.