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 |
|---|---|---|---|---|---|---|---|---|
f30d32d47b99a322ff440395cf63fbe012b52861 | Update WolframAlpha module | ajay-gandhi/jasper-client,ajay-gandhi/jasper-client | client/modules/WolframAlpha.py | client/modules/WolframAlpha.py | # -*- coding: utf-8-*-
import random
import re
import wolframalpha
import time
import sys
from sys import maxint
from client import jasperpath
WORDS = ["WHO", "WHAT", "HOW", "TELL", "ME", "ABOUT", "DEFINE"]
PRIORITY = -1
def handle(text, mic, profile):
app_id = profile['keys']['WOLFRAMALPHA']
client = wolfr... | # -*- coding: utf-8-*-
import random
import re
import wolframalpha
import time
import sys
from sys import maxint
from client import jasperpath
WORDS = ["WHO", "WHAT", "HOW", "TELL", "ME", "ABOUT"]
PRIORITY = -1
def handle(text, mic, profile):
app_id = profile['keys']['WOLFRAMALPHA']
client = wolframalpha.Cl... | mit | Python |
87d315b37aa5ed25ac30c16433b6115c073a6834 | test change | pyprism/Hiren-Vault,pyprism/Hiren-Vault,pyprism/Hiren-Pass,pyprism/Hiren-Pass,pyprism/Hiren-Pass,pyprism/Hiren-Vault | password/views.py | password/views.py | from django.shortcuts import render
from django.views.generic import View
from django.http import HttpResponse
'''
Date : 12 May, 2015
'''
# Create your views here.
class Authentication(View):
def get(self, request, *args, **kwargs):
return HttpResponse("test") | from django.shortcuts import render
from django.views.generic import View
from django.http import HttpResponse
'''
Date : 12 May, 2015
'''
# Create your views here.
class Authentication(View):
def get(self, request, *args, **kwargs):
return HttpResponse("sas") | mit | Python |
f9aa61893ea0b7e98dc4e5b25cbf63c2fffde672 | Add url logging in google shortener | sevazhidkov/leonard | libs/googleapis.py | libs/googleapis.py | import os
import time
import json
import requests
def get_timezone(lat, long):
response = requests.get('https://maps.googleapis.com/maps/api/timezone/json', params={
'location': '{},{}'.format(lat, long),
'timestamp': int(time.time()),
'key': os.environ['GOOGLE_API_TOKEN']
}).json()
... | import os
import time
import json
import requests
def get_timezone(lat, long):
response = requests.get('https://maps.googleapis.com/maps/api/timezone/json', params={
'location': '{},{}'.format(lat, long),
'timestamp': int(time.time()),
'key': os.environ['GOOGLE_API_TOKEN']
}).json()
... | mit | Python |
f8489f4ca0ddc046f498d22be08523d383f6508e | remove print | zingale/pyro2,harpolea/pyro2,harpolea/pyro2,zingale/pyro2 | compressible/timestep.py | compressible/timestep.py | from util import runparams
import eos
import numpy
"""
The timestep module computes the advective timestep (CFL) constraint.
The CFL constraint says that information cannot propagate further than
one zone per timestep.
We use the driver.cfl parameter to control what fraction of the CFL
step we actually take.
"""
SM... | from util import runparams
import eos
import numpy
"""
The timestep module computes the advective timestep (CFL) constraint.
The CFL constraint says that information cannot propagate further than
one zone per timestep.
We use the driver.cfl parameter to control what fraction of the CFL
step we actually take.
"""
SM... | bsd-3-clause | Python |
019e28006cabefe7bc10eb92d1f8273d7b4cb385 | Add /artist command for last.fm. | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | plumeria/plugins/lastfm.py | plumeria/plugins/lastfm.py | import io
from plumeria.command import commands, CommandError
from plumeria.message import Response
from plumeria.util import http
from plumeria.util.message import strip_html
from plumeria.util.ratelimit import rate_limit
from plumeria.middleware.api.lastfm import LastFm, default_api_key as api_key
lastfm = LastFm()... | from plumeria.command import commands, CommandError
from plumeria.message import Response
from plumeria.util.ratelimit import rate_limit
from plumeria.middleware.api.lastfm import LastFm
lastfm = LastFm()
@commands.register('lastfm', 'last scrobble', 'lastscrobble', category='Music')
@rate_limit()
async def lastscro... | mit | Python |
8fbbcf416c7397af1c33d6dfc2ed8872f65dfcce | add parameters, add second test | senin24/python_trainig | test_add_group.py | test_add_group.py | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
import unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unittest.TestCase):
def setUp(self):
self.wd = WebDriver(capab... | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
import unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unittest.TestCase):
def setUp(self):
self.wd = WebDriver(capab... | apache-2.0 | Python |
e65a2e22764552b692fd12d82ce7d1605765eed8 | Fix FS watcher if repos-dir is symlink | raxod502/straight.el,raxod502/straight.el | watcher/straight_watch_callback.py | watcher/straight_watch_callback.py | #!/usr/bin/env python3
import os
import pathlib
import sys
WATCHEXEC_VAR_COMMON = "WATCHEXEC_COMMON_PATH"
WATCHEXEC_VARS = [
"WATCHEXEC_CREATED_PATH",
"WATCHEXEC_REMOVED_PATH",
"WATCHEXEC_RENAMED_PATH",
"WATCHEXEC_WRITTEN_PATH",
"WATCHEXEC_META_CHANGED_PATH",
]
def die(message):
print(messag... | #!/usr/bin/env python3
import os
import pathlib
import sys
WATCHEXEC_VAR_COMMON = "WATCHEXEC_COMMON_PATH"
WATCHEXEC_VARS = [
"WATCHEXEC_CREATED_PATH",
"WATCHEXEC_REMOVED_PATH",
"WATCHEXEC_RENAMED_PATH",
"WATCHEXEC_WRITTEN_PATH",
"WATCHEXEC_META_CHANGED_PATH",
]
def die(message):
print(messag... | mit | Python |
e542a28dfa3fd21ac8b7edb3daa59064e3dc903f | Tweak to tesseroid recipe | rafaelmds/fatiando,mtb-za/fatiando,fatiando/fatiando,eusoubrasileiro/fatiando,victortxa/fatiando,drandykass/fatiando,eusoubrasileiro/fatiando,santis19/fatiando,eusoubrasileiro/fatiando_seismic,mtb-za/fatiando,drandykass/fatiando,eusoubrasileiro/fatiando_seismic,eusoubrasileiro/fatiando,cmeessen/fatiando,fatiando/fatian... | cookbook/gravmag_grav_tesseroid_parallel.py | cookbook/gravmag_grav_tesseroid_parallel.py | """
GravMag: Forward modeling of the gravity anomaly using tesseroids in parallel
using ``multiprocessing``
"""
import time
from multiprocessing import Pool
from fatiando import gravmag, gridder, logger, utils
from fatiando.mesher import Tesseroid
from fatiando.vis import mpl, myv
log = logger.get()
log.info(logger.he... | """
GravMag: Forward modeling of the gravity anomaly using tesseroids in parallel
using ``multiprocessing``
"""
import time
from multiprocessing import Pool
from fatiando import gravmag, gridder, logger, utils
from fatiando.mesher import Tesseroid
from fatiando.vis import mpl, myv
log = logger.get()
log.info(logger.he... | bsd-3-clause | Python |
abb55757564cd957840ab584765239f924233295 | Fix print for python 3 | foraliving/foraliving,foraliving/foraliving,foraliving/foraliving | pinax_theme_bootstrap/management/commands/copy_from_theme.py | pinax_theme_bootstrap/management/commands/copy_from_theme.py | import errno
import glob
import os
import shutil
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
def copy(src, dest):
if not os.path.exists(os.path.dirname(dest)):
os.makedirs(os.path.dirname(dest))
try:
shutil.copytree(sr... | import errno
import glob
import os
import shutil
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
def copy(src, dest):
if not os.path.exists(os.path.dirname(dest)):
os.makedirs(os.path.dirname(dest))
try:
shutil.copytree(sr... | mit | Python |
ea0a7dad948d4a758ac970fe8551ecfee5499399 | bump version | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | cupy/_version.py | cupy/_version.py | __version__ = '6.0.0rc1'
| __version__ = '6.0.0b3'
| mit | Python |
8537d109a04444310f13d880297f792383957b62 | Fix some test descriptions. | CWSL/access-om | test_basic_run.py | test_basic_run.py |
from __future__ import print_function
import shutil
import os
from nose.plugins.attrib import attr
from model_test_helper import ModelTestHelper
# FIXME: use a test generator here:
# http://nose.readthedocs.org/en/latest/writing_tests.html
class TestBasicRun(ModelTestHelper):
"""
Basic runs. Run and check ... |
from __future__ import print_function
import shutil
import os
from nose.plugins.attrib import attr
from model_test_helper import ModelTestHelper
# FIXME: use a test generator here:
# http://nose.readthedocs.org/en/latest/writing_tests.html
class TestBasicRun(ModelTestHelper):
"""
Basic runs. Run and check ... | apache-2.0 | Python |
9c66a4097e908e84150ed7fa073a7af66dec2108 | bump version | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | cupy/_version.py | cupy/_version.py | __version__ = '8.0.0b2'
| __version__ = '8.0.0b1'
| mit | Python |
e4ba9c842531a2551f686c0d8ffb62a20c22ca04 | add test case for a space-delimited region | keflavich/pyregion,keflavich/pyregion | pyregion/tests/test_ds9_region_parser.py | pyregion/tests/test_ds9_region_parser.py | from ..ds9_region_parser import RegionParser, Global
def test_regionLine():
test_string_1 = ["circle(109,253,28.950304) # comment 1",
"polygon(257,290,300.78944,271.78944,300.78944,178.21056,258,216,207.21056,178.21056)",
"polygon(273.98971,175.01029,274.01029,175.01029,... | from ..ds9_region_parser import RegionParser, Global
def test_regionLine():
test_string_1 = ["circle(109,253,28.950304) # comment 1",
"polygon(257,290,300.78944,271.78944,300.78944,178.21056,258,216,207.21056,178.21056)",
"polygon(273.98971,175.01029,274.01029,175.01029,... | mit | Python |
bcb4d817551d584965f252b7cb0df34bd19cc972 | Test commit (removed extra blank line) | llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Driver... | utils/lit/lit/LitFormats.py | utils/lit/lit/LitFormats.py | from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
| from TestFormats import GoogleTest, ShTest, TclTest
from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
| apache-2.0 | Python |
8345fa118084f50d9b034990e50e63b59d9552a9 | Update widgets.py | 20tab/django-political-map,20tab/django-political-map,20tab/django-political-map | politicalplaces/widgets.py | politicalplaces/widgets.py | from django.forms.widgets import TextInput
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from django.conf import settings
class PlaceWidget(TextInput):
def render(self, name, value, attrs=None, renderer=None):
template = 'place_field/place_widget.html'
... | from django.forms.widgets import TextInput
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from django.conf import settings
class PlaceWidget(TextInput):
def render(self, name, value, renderer=None, attrs=None):
template = 'place_field/place_widget.html'
... | mit | Python |
534e2542fe009216b8c61789c68c1b5831da1203 | Add Polymer class | szabba/applied-sims | polymer_states/__init__.py | polymer_states/__init__.py | # 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/.
import numpy
# Link states
UP, DOWN = (0, 1), (0, -1)
LEFT, RIGHT = (-1, 0), (1, 0)
SLACK = (0, 0)
class Polymer:... | # 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/.
# Link states
UP, DOWN = (0, 1), (0, -1)
LEFT, RIGHT = (-1, 0), (1, 0)
SLACK = (0, 0) | mpl-2.0 | Python |
e581e7671e4ed7fe2633deaa9f5c99fd83b2a54d | Integrate LLVM at llvm/llvm-project@18efa420da5f | Intel-tensorflow/tensorflow,karllessard/tensorflow,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tenso... | 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 = "18efa420da5fa065d88ba451cdcdbd950a2090c1"
LLVM_SHA256 = "44b8977a8a49a7a701e09f7963427bc2a6f025a41064ae7249d5631cd47fa244"
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 = "f951a6b2f37baf6ae832318fcca9ba4121c29529"
LLVM_SHA256 = "35030d60741c48b4254ac573661c21653e315e96d43479b3845ad92a74fcb8a5"
tf_http_archive(
... | apache-2.0 | Python |
faed056f873754457b5c05aed5a9739fcd6bf35c | Integrate LLVM at llvm/llvm-project@dd2362a8bab3 | paolodedios/tensorflow,paolodedios/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_li... | 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 = "dd2362a8bab312dffc42bfcb30ad1340840ef581"
LLVM_SHA256 = "2b80ad2a433cc4c28a234f3f690c82b72c5f95120af05a6cc143de8791923b80"
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 = "9a79b1b04c3a8134ef6ca6f57bc153501fca1098"
LLVM_SHA256 = "ecf9e5cfdfac49112b9f43103df9ae0e21a5f2cdef66085bea9b536100ce626e"
tf_http_archive(
... | apache-2.0 | Python |
7696c1a6b61b180d595b21b19183044e7d953fd0 | Integrate LLVM at llvm/llvm-project@593bf9b4ded3 | 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 = "593bf9b4ded318a1d14c9aacfcaa0cf8dd0d9b62"
LLVM_SHA256 = "2e4c2a769c3270de567d5426969a5f7e9d723360f6ee83ef0f32c8cf53b7ecd6"
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 = "76f734040a54622b847729e5acb4480e667d2c74"
LLVM_SHA256 = "28589869f5ae24e7ac1c7324e6965b4751c4823f306ebce8276c23cb84b9bc73"
tfrt_http_archive(
... | apache-2.0 | Python |
98d68b42e9ceb181d06a62ec56a7a7091df07113 | Integrate LLVM at llvm/llvm-project@19a3e24803a6 | Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,yongtang/tensorflow,karllessard/tensorflow,paolodedios... | 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 = "19a3e24803a69090f4163c20a6511213e1c07de6"
LLVM_SHA256 = "b0b6d1c48b9ccf5caba75e30444bef39fe402eca7b3f870ebd38a65dd33e5839"
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 = "79d13bf22c169cf83515e799d45db8d6424104fd"
LLVM_SHA256 = "34f43b811edb2f6e8da0533d79cb5fd22c8c41f9953260dd1a6c58937a062dda"
tf_http_archive(
... | apache-2.0 | Python |
83d3045fb5476bed115ae438871a228c1c682af1 | Integrate LLVM at llvm/llvm-project@4e94f6653150 | 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 = "4e94f6653150511de434fa7e29b684ae7f0e52b6"
LLVM_SHA256 = "f43b93071ad66a6ac52bf7c6beedc0be6cf41465739cdd02992961c401cf0f4d"
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 = "0538e5431afdb1fa05bdcedf70ee502ccfcd112a"
LLVM_SHA256 = "01f168b1a8798e652a04f1faecc3d3c631ff12828b89c65503f39b0a0d6ad048"
tfrt_http_archive(
... | apache-2.0 | Python |
c209cfd0fb4298a3f34397959bdb8e4df66dee79 | Integrate LLVM at llvm/llvm-project@1524b0154116 | 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 = "1524b0154116e2a404dba12c7f9f64c5c8533955"
LLVM_SHA256 = "6b16462b5ab4e6f99e89b5e0fbe1616e32a74bc61785912a22d954d53c84634b"
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 = "89786c2b992c3cb4c4a230542d2af34ec2915a08"
LLVM_SHA256 = "d6a6c9b67f6557dcdfd0e565d047b676a7cf8aeb70fa2bf8c0fa92ddc1a05cd5"
tfrt_http_archive(
... | apache-2.0 | Python |
5c704723a8e5b1246cef7d662ac7da338b447dce | Integrate LLVM at llvm/llvm-project@0d83e7203479 | tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,karlle... | 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 = "0d83e7203479d6bc7368d5b94351e4907c2afafc"
LLVM_SHA256 = "b010b650445f8811171c5d3b699f3fa60ca0558bce59f675bff00b32a412a445"
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 = "ac312a9d7c03f0be53834d3f295f1971aaf54649"
LLVM_SHA256 = "e1255347d9f085638e10cd362e3f60635d74c398f417f453e9ed3b80a0e87b6a"
tf_http_archive(
... | apache-2.0 | Python |
c78d6fc98c4605b552e0fc517218bf5103785f79 | Integrate LLVM at llvm/llvm-project@9b25d868f43e | gautam1858/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap... | 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 = "9b25d868f43e951eb93844d4861a85bdd66b10aa"
LLVM_SHA256 = "02b3dd75336ef3ee2d7247d510cd4195d5209e4226c602506669e5c820fd0747"
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 = "63e711549c7f20334e241d3143cd41d4b5508b44"
LLVM_SHA256 = "f27f0efa9b6f496f68f3892d0e9043956fc4504f09adf8999bb096ebe06d8eaa"
tf_http_archive(
... | apache-2.0 | Python |
3b7074750ce50358d88dbbbf8d13fe7302029a47 | Integrate LLVM at llvm/llvm-project@4504e1134c91 | 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 = "4504e1134c9118f3c322685f8a90129e09bab92c"
LLVM_SHA256 = "2b1d7a96ff37600cae12d2ed51b9f0554b1bbc6511ffe51ac7525928b29bab44"
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 = "0ad1d9fdf22dad41312e02b8bc990bf58ce1744c"
LLVM_SHA256 = "517db6d771cf24d9f0aea6d4fdd59591347c7eb9d86ef58521fe8cb929fbe82b"
tfrt_http_archive(
... | apache-2.0 | Python |
0bd9f04792952a6fa1509522553eae19fa578974 | Add sanity check that the relevant operators can be applied to items produced by the input generators | maxalbert/tohu | tohu/v6/set_special_methods.py | tohu/v6/set_special_methods.py | """
This module is not meant to be imported directly.
Its purpose is to patch the TohuBaseGenerator class
so that its special methods __add__, __mul__ etc.
support other generators as arguments.
"""
from .base import TohuBaseGenerator
from .primitive_generators import GeoJSONGeolocation, as_tohu_generator
from .derive... | """
This module is not meant to be imported directly.
Its purpose is to patch the TohuBaseGenerator class
so that its special methods __add__, __mul__ etc.
support other generators as arguments.
"""
from .base import TohuBaseGenerator
from .primitive_generators import GeoJSONGeolocation, as_tohu_generator
from .derive... | mit | Python |
9f73b2c67761ead7c2bfad73da6d4d698a5172d6 | Add defs.bzl to genproto.bzl | werkt/bazel,werkt/bazel,katre/bazel,bazelbuild/bazel,twitter-forks/bazel,meteorcloudy/bazel,ulfjack/bazel,dslomov/bazel,cushon/bazel,perezd/bazel,twitter-forks/bazel,davidzchen/bazel,ulfjack/bazel,bazelbuild/bazel,twitter-forks/bazel,safarmer/bazel,aehlig/bazel,werkt/bazel,safarmer/bazel,ButterflyNetwork/bazel,safarmer... | tools/build_rules/genproto.bzl | tools/build_rules/genproto.bzl | """
Copyright 2014 The Bazel 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 applicable law or agreed... | """
Copyright 2014 The Bazel 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 applicable law or agreed... | apache-2.0 | Python |
e1df35e117fd5e243874bf9db9224b7112e51b34 | mark imagediff as chromium code for stricter warnings. | Jonekee/chromium.src,rogerwang/chromium,Chilledheart/chromium,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,rogerwang/chromium,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,Fireblend/chromium-crosswalk,Pluto-tv/chromium-cross... | tools/imagediff/image_diff.gyp | tools/imagediff/image_diff.gyp | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'targets' : [
{
'target_name': 'image_diff',
'type': 'executable',
'msvs_guid': '... | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets' : [
{
'target_name': 'image_diff',
'type': 'executable',
'msvs_guid': '50B079C7-CD01-42D3-B8C4-9F8D9322E822',
... | bsd-3-clause | Python |
675bde20c55b4167a8de0e8c47035f11460f3141 | Fix missing module | makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile | reportlab/docs/reference/genreference.py | reportlab/docs/reference/genreference.py | #!/bin/env python
#copyright ReportLab Inc. 2001
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/docs/reference/genreference.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/docs/reference/genreference.py,v 1.7 2004/05/25 16:33:56 rgbecker Exp $
__version__=''' $Id: ge... | #!/bin/env python
#copyright ReportLab Inc. 2001
#see license.txt for license details
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/docs/reference/genreference.py?cvsroot=reportlab
#$Header: /tmp/reportlab/reportlab/docs/reference/genreference.py,v 1.6 2004/04/28 14:39:23 rgbecker Exp $
__version__=''' $Id: ge... | bsd-3-clause | Python |
266de0557a6e353f10fe57b81e24840cf7a7be66 | add name to pulls for UI | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/icds_reports/data_pull/data_pulls.py | custom/icds_reports/data_pull/data_pulls.py | from custom.icds_reports.data_pull.exceptions import UnboundDataPull
from custom.icds_reports.data_pull.queries import (
CBEConducted,
LunchAbove3Years,
LunchAbove5Years,
PSEAbove3Years,
PSEAbove5Years,
THRChildren,
THRLactating,
THRPregnant,
)
class BaseDataPull:
slug = ""
nam... | from custom.icds_reports.data_pull.exceptions import UnboundDataPull
from custom.icds_reports.data_pull.queries import (
CBEConducted,
LunchAbove3Years,
LunchAbove5Years,
PSEAbove3Years,
PSEAbove5Years,
THRChildren,
THRLactating,
THRPregnant,
)
class BaseDataPull:
slug = ""
que... | bsd-3-clause | Python |
1ba5c2bcbbb9902de8de8d711bce6b285dce43a2 | Remove unused imports | jazzband/django-axes | axes/middleware.py | axes/middleware.py | from typing import Callable
from django.conf import settings
from axes.helpers import get_lockout_response
class AxesMiddleware:
"""
Middleware that calculates necessary HTTP request attributes for attempt monitoring
and maps lockout signals into readable HTTP 403 Forbidden responses.
If a project ... | from typing import Callable
from django.conf import settings
from axes.helpers import (
get_lockout_response,
get_failure_limit,
get_client_username,
get_credentials,
)
from axes.handlers.proxy import AxesProxyHandler
class AxesMiddleware:
"""
Middleware that calculates necessary HTTP reque... | mit | Python |
9fcc935f325608700f78d30d0825a234fa70c69f | Exclude .ipython from flake8 | opesci/devito,opesci/devito | azure-pipelines.py | azure-pipelines.py | #!/usr/bin/env python
import os
import subprocess
err = []
def runStep(command, *args, **kwargs):
envCmd = kwargs.get('envCmd', "source activate devito; ")
global err
err.append(subprocess.run(
(envCmd + command),
shell=True).returncode)
if os.environ.get('testWithPip') == 'true':
... | #!/usr/bin/env python
import os
import subprocess
err = []
def runStep(command, *args, **kwargs):
envCmd = kwargs.get('envCmd', "source activate devito; ")
global err
err.append(subprocess.run(
(envCmd + command),
shell=True).returncode)
if os.environ.get('testWithPip') == 'true':
... | mit | Python |
93282e663a03c2a62fcf9731db3d152b3d2c32c7 | Add MD+CSS processing test to test module. | cpgillem/markdown_publisher,cpgillem/markdown_publisher | test_publisher.py | test_publisher.py | import publisher
test_pdf_filename = "test/test.pdf"
test_css_filename = "test/test.css"
test_md_filename = "test/test.md"
test_html_filename = "test/test.html"
test_md = "# Test heading\n\n- test item 1\n- test item 2"
def from_html_file():
print publisher.md_to_html(publisher.from_file(test_md_filename))
def ... | import publisher
def from_html_file():
source_file = "~/Projects/markdown-publisher/source_test.md"
print publisher.get_html_from_file(source_file)
def from_html():
test_source = "# Test heading\n\n- test item 1\n- test item 2"
print publisher.get_html(test_source)
def from_html_to_pdf():
test_ht... | mit | Python |
222497be8a9be2cabb55f95a169f2e9abf90a85b | use proper deletion for expired objects | murrown/cyder,murrown/cyder,murrown/cyder,akeym/cyder,drkitty/cyder,OSU-Net/cyder,OSU-Net/cyder,zeeman/cyder,zeeman/cyder,OSU-Net/cyder,akeym/cyder,drkitty/cyder,akeym/cyder,murrown/cyder,drkitty/cyder,drkitty/cyder,OSU-Net/cyder,zeeman/cyder,akeym/cyder,zeeman/cyder | cyder/management/commands/expire_objects.py | cyder/management/commands/expire_objects.py | from django.core.management.base import BaseCommand
from cyder.models import MODEL_LIST
from cyder.base.models import ExpirableMixin
from datetime import datetime
class Command(BaseCommand):
option_list = BaseCommand.option_list
def handle(self, *args, **options):
now = datetime.now()
for m... | from django.core.management.base import BaseCommand
from cyder.models import MODEL_LIST
from cyder.base.models import ExpirableMixin
from datetime import datetime
class Command(BaseCommand):
option_list = BaseCommand.option_list
def handle(self, *args, **options):
now = datetime.now()
for m... | bsd-3-clause | Python |
95eb8e4b21b1531801fd69b13e4414c6dfb65563 | Make relative imports py2/py3 compat | gisce/esios | esios/__init__.py | esios/__init__.py | try:
VERSION = __import__('pkg_resources') \
.get_distribution(__name__).version
except Exception as e:
VERSION = 'unknown'
from .service import Esios
| try:
VERSION = __import__('pkg_resources') \
.get_distribution(__name__).version
except Exception as e:
VERSION = 'unknown'
from service import Esios
| mit | Python |
19dc471889f88523181425b726d4b2f9f65e9898 | introduce permanent request cache | adaptive-learning/proso-apps,adaptive-learning/proso-apps,adaptive-learning/proso-apps | proso/django/cache.py | proso/django/cache.py | from django.core.cache.backends.locmem import LocMemCache
from django.views.decorators.cache import cache_page
from functools import wraps
from threading import currentThread
import logging
LOGGER = logging.getLogger('django.request')
_request_cache = {}
_request_permanent_cache = {}
_installed_middleware = False
... | from django.core.cache.backends.locmem import LocMemCache
from django.views.decorators.cache import cache_page
from functools import wraps
from threading import currentThread
from django.conf import settings
import logging
LOGGER = logging.getLogger('django.request')
_request_cache = {}
_installed_middleware = Fals... | mit | Python |
0689c0da567bcaecff61a0d76652b23d4c2371c6 | Remove stored messages before detecting a person | pschillinger/lamor15,marinaKollmitz/lamor15,pschillinger/lamor15,pschillinger/lamor15,marinaKollmitz/lamor15,marinaKollmitz/lamor15,pschillinger/lamor15,pschillinger/lamor15,marinaKollmitz/lamor15,marinaKollmitz/lamor15 | lamor_flexbe_states/src/lamor_flexbe_states/detect_person_state.py | lamor_flexbe_states/src/lamor_flexbe_states/detect_person_state.py | #!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait... | #!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait... | mit | Python |
61cc87940a802d56b438119eb70edff1ce4ba128 | Update talk_back plugin to use underquoted api v2 | ammartins/will,mike-love/will,mike-love/will,shadow7412/will,skoczen/will,jacobbridges/will,chillipeper/will,Ironykins/will,pcurry/will,woohgit/will,dmuntean/will,woohgit/will,Ironykins/will,jacobbridges/will,skoczen/will,shadow7412/will,brandonsturgeon/will,mvanbaak/will,dmuntean/will,fredsmith/will,mvanbaak/will,mvan... | will/plugins/friendly/talk_back.py | will/plugins/friendly/talk_back.py | import requests
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
class TalkBackPlugin(WillPlugin):
QUOTES_URL = "https://underquoted.herokuapp.com/api/v2/quotations/?random=true&limit=1"
def get_quote(self):
... | import requests
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
class TalkBackPlugin(WillPlugin):
QUOTES_URL = ("https://underquoted.herokuapp.com/api/v1/quotations/?"
"format=json&random=true&limit=1... | mit | Python |
fa64cd3e1064f968fe0e9083ee27153f4feda5cd | Fix errors editing Ruby files with no coverage data. | sentience/SublimeSimpleCov,sentience/SublimeSimpleCov | common/json_coverage_reader.py | common/json_coverage_reader.py | import os
import json
import re
class JsonCoverageReader:
"""
For any file in a project with JSON SimpleCov coverage data,
makes whole-file and line-specific coverage data available.
"""
def __init__(self, filename):
""" Load coverage data given the filename for any file in the project. ""... | import os
import json
import re
class JsonCoverageReader:
"""
For any file in a project with JSON SimpleCov coverage data,
makes whole-file and line-specific coverage data available.
"""
def __init__(self, filename):
""" Load coverage data given the filename for any file in the project. ""... | mit | Python |
1b6c49c6d74dcd31c8a0e51f82932866bc99adc2 | Fix bug: KeyError: 'HOME' in Windows. | pltrdy/files2rouge,pltrdy/files2rouge | setup_rouge.py | setup_rouge.py | #!/usr/bin/env python
"""
Utility to copy ROUGE script.
It has to be run before `setup.py`
"""
import os
import shutil
from files2rouge import settings
from six.moves import input
def copy_rouge():
if 'HOME' not in os.environ:
home = os.environ['HOMEPATH']
else:
home = os.environ['HO... | #!/usr/bin/env python
"""
Utility to copy ROUGE script.
It has to be run before `setup.py`
"""
import os
import shutil
from files2rouge import settings
from six.moves import input
def copy_rouge():
home = os.environ['HOME']
src_rouge_root = "./files2rouge/RELEASE-1.5.5/"
default_root = os.path... | mit | Python |
59aea802e97ea7ff0f3dd35b5a17d239f9cf6ed5 | test added to test requests exception | hootnot/oanda-api-v20 | tests/test_oandapyv20.py | tests/test_oandapyv20.py | import unittest
import json
from . import unittestsetup
from .unittestsetup import environment as environment
import requests_mock
try:
from nose_parameterized import parameterized
except:
print("*** Please install 'nose_parameterized' to run these tests ***")
exit(0)
import oandapyV20
from oandapyV20 im... | import unittest
import json
from . import unittestsetup
from .unittestsetup import environment as environment
import requests_mock
try:
from nose_parameterized import parameterized
except:
print("*** Please install 'nose_parameterized' to run these tests ***")
exit(0)
import oandapyV20
from oandapyV20 im... | mit | Python |
ab59fce0fe1ecbe3e60baa09bfc695986a12d0d8 | Test for Vagrant box selection | ViDA-NYU/reprozip,ViDA-NYU/reprozip,ViDA-NYU/reprozip,ViDA-NYU/reprozip,ViDA-NYU/reprozip | tests/test_parameters.py | tests/test_parameters.py | # Copyright (C) 2014-2016 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
from __future__ import print_function, unicode_literals
import json
import unittest
from reprounzip import parameters
from reprounzip.unpackers.do... | # Copyright (C) 2014-2016 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
from __future__ import print_function, unicode_literals
import json
import unittest
from reprounzip import parameters
from reprounzip.unpackers.do... | bsd-3-clause | Python |
d1cc0086bf30ec19ab920f54d52fa9c50ca63c54 | add test unit | neuropsychology/NeuroKit.py | tests/test_statistics.py | tests/test_statistics.py | import pytest
import doctest
import numpy as np
import pandas as pd
import neurokit as nk
import matplotlib
run_tests_in_local = False
#==============================================================================
# STATISTICS
#==============================================================================
def test_... | import pytest
import doctest
import numpy as np
import pandas as pd
import neurokit as nk
import matplotlib
run_tests_in_local = False
#==============================================================================
# STATISTICS
#==============================================================================
def test_... | mit | Python |
25a40677cc835b2946365b363b8b4360e59c0654 | Drop a "fix" for a bug that probably never existed | dmick/teuthology,yghannam/teuthology,dreamhost/teuthology,t-miyamae/teuthology,ceph/teuthology,dmick/teuthology,zhouyuan/teuthology,SUSE/teuthology,caibo2014/teuthology,caibo2014/teuthology,tchaikov/teuthology,michaelsevilla/teuthology,zhouyuan/teuthology,dreamhost/teuthology,yghannam/teuthology,dmick/teuthology,ivotro... | teuthology/repo_utils.py | teuthology/repo_utils.py | import logging
import os
import shutil
import subprocess
import time
log = logging.getLogger(__name__)
def checkout_repo(repo_url, dest_path, branch):
if not os.path.isdir(dest_path):
log.info("Cloning %s %s from upstream", repo_url, branch)
proc = subprocess.Popen(
('git', 'clone', '... | import logging
import os
import shutil
import subprocess
import time
log = logging.getLogger(__name__)
def checkout_repo(repo_url, dest_path, branch):
# if os.path.isdir(path):
# p = subprocess.Popen('git status', shell=True, cwd=path)
# if p.wait() == 128:
# log.info("Repo at %s appe... | mit | Python |
41ce02a53f8c4594d6987ca4221393330a38c56d | move login decorators into util | oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk,oss/shrunk | shrunk/util.py | shrunk/util.py | # shrunk - Rutgers University URL Shortener
"""Utility functions for shrunk."""
import logging
from shrunk.client import ShrunkClient
from flask import redirect, session
from functools import wraps
client=None
def get_db_client(app, g = None):
"""Gets a reference to a ShrunkClient for database operations.
... | # shrunk - Rutgers University URL Shortener
"""Utility functions for shrunk."""
import logging
from shrunk.client import ShrunkClient
def get_db_client(app, g):
"""Gets a reference to a ShrunkClient for database operations.
:Parameters:
- `app`: A Flask application object.
- `g`: Flask's magic... | mit | Python |
af205d0d7fff452bb577468c5e6ecc9c06e1b0fd | Fix arxiv reference. | csadorf/signac,csadorf/signac | signac/cite.py | signac/cite.py | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Functions to support citing this software."""
import sys
ARXIV_BIBTEX = """@online{signac,
author = {Carl S. Adorf and Paul M. Dodd and Sharon C. Glotzer},
... | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Functions to support citing this software."""
import sys
ARXIV_BIBTEX = """@online{signac,
author = {Carl S. Adorf and Paul M. Dodd and Sharon C. Glotzer},
... | bsd-3-clause | Python |
d8ff4f0f9db9c1442b49178c0921f79f9d99fa05 | Add Register View | brunoliveira8/managyment,brunoliveira8/managyment,brunoliveira8/managyment | project/gym_app/views.py | project/gym_app/views.py | from django.http import HttpResponse
from django.shortcuts import render
from gym_app.forms import UserForm
# Create your views here.
#This is the First Page's view.
def index(request):
# Construct a dictionary to pass to the template engine as its context.
# Note the key boldmessage is the same as {{ boldmessa... | from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
#This is the First Page's view.
def index(request):
# Construct a dictionary to pass to the template engine as its context.
# Note the key boldmessage is the same as {{ boldmessage }} in the template!
context_... | mit | Python |
c665e1ad69c9ee35caaa620d4cda032a7800e8b6 | add relative import | xiyuw123/Tax-Calculator,rkuchan/Tax-Calculator,jlyons871/Tax-Calculator,mcdeaton13/Tax-Calculator,xiyuw123/Tax-Calculator,mmessick/Tax-Calculator,rkuchan/Tax-Calculator,mcdeaton13/Tax-Calculator,jlyons871/Tax-Calculator,mmessick/Tax-Calculator | timer/timed_calculate.py | timer/timed_calculate.py | """
Replaces functions called in test.run() with versions decorated with '@time_this(main_timer)'
This calls a cumulative timer that is ran for each of the functions below,
raw calculation time can be printed by calling 'print(main_timer)' at the end of the testing script
"""
from taxcalc.calculate import *
from tax... | """
Replaces functions called in test.run() with versions decorated with '@time_this(main_timer)'
This calls a cumulative timer that is ran for each of the functions below,
raw calculation time can be printed by calling 'print(main_timer)' at the end of the testing script
"""
from taxcalc.calculate import *
from tax... | mit | Python |
dde17188857409e7be98aff9a53596019802d051 | Fix oauth unit test | toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity,toladata/TolaActivity | tola/tests/test_oauth.py | tola/tests/test_oauth.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from tola.settings.local import *
from django.test import Client
from oauth2_provider.models import Application
# TODO Extend OAuth tests
class OAuthTest(TestCase):
"""
Test cases for OAuth Provider interface
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from docs.api.Connection import TolaApiConnection
from tola.settings.local import *
from django.test import Client
from django.contrib.auth.models import User
from oauth2_provider.models import Application
# TODO Extend O... | apache-2.0 | Python |
6ce523416353d51a790c08efcc9e6e27ccb40c3d | Fix tool/cleanup_changes.py script | KeepSafe/aiohttp,KeepSafe/aiohttp,KeepSafe/aiohttp | tools/cleanup_changes.py | tools/cleanup_changes.py | #!/usr/bin/env python
# Run me after the backport branch release to cleanup CHANGES records
# that was backported and publiched.
import re
import subprocess
from pathlib import Path
ALLOWED_SUFFIXES = ["feature", "bugfix", "doc", "removal", "misc"]
PATTERN = re.compile(r"(\d+)\.(" + "|".join(ALLOWED_SUFFIXES) + r")(... | #!/usr/bin/env python
# Run me after the backport branch release to cleanup CHANGES records
# that was backported and publiched.
import subprocess
from pathlib import Path
def main():
root = Path(__file__).parent.parent
delete = []
changes = (root / "CHANGES.rst").read_text()
for fname in (root / "C... | apache-2.0 | Python |
d961c3183bd03794e2f55ae80adff3fb7f1939b3 | Remove repeats from convert-tcpdump | mirek2580/namebench | tools/convert-tcpdump.py | tools/convert-tcpdump.py | #!/usr/bin/env python
# Copyright 2009 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 2009 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 |
77b0ac8e4230663e0c0394366185ad32fb8ff6ba | Fix _get_version for tagged releases | yasserglez/configurator,yasserglez/configurator | configurator/__init__.py | configurator/__init__.py | """Adaptive configuration dialogs.
Attributes:
__version__: The current version string.
"""
import os
import subprocess
def _get_version(version=None): # overwritten by setup.py
if version is None:
pkg_dir = os.path.dirname(__file__)
src_dir = os.path.abspath(os.path.join(pkg_dir, os.pardir... | """Adaptive configuration dialogs.
Attributes:
__version__: The current version string.
"""
import os
import subprocess
def _get_version(version=None): # overwritten by setup.py
if version is None:
pkg_dir = os.path.dirname(__file__)
src_dir = os.path.abspath(os.path.join(pkg_dir, os.pardir... | apache-2.0 | Python |
d7a95e7467c6bc44b6b76e4d46b74cd01cf107a5 | Fix resolve-crashes.py for recent change | benlangmuir/swift,brentdax/swift,bitjammer/swift,tinysun212/swift-windows,felix91gr/swift,sschiau/swift,xedin/swift,ben-ng/swift,xwu/swift,shahmishal/swift,apple/swift,gmilos/swift,return/swift,arvedviehweger/swift,calebd/swift,zisko/swift,ben-ng/swift,uasys/swift,stephentyrone/swift,airspeedswift/swift,huonw/swift,Cod... | utils/resolve-crashes.py | utils/resolve-crashes.py | #!/usr/bin/env python
# A small utility to take the output of a Swift validation test run
# where some compiler crashers have been fixed, and move them into the
# "fixed" testsuite, removing the "--crash" in the process.
import os
import re
import sys
def execute_cmd(cmd):
print(cmd)
os.system(cmd)
# The r... | #!/usr/bin/env python
# A small utility to take the output of a Swift validation test run
# where some compiler crashers have been fixed, and move them into the
# "fixed" testsuite, removing the "--crash" in the process.
import os
import re
import sys
def execute_cmd(cmd):
print(cmd)
os.system(cmd)
# The r... | apache-2.0 | Python |
00482930ff5d752c133d76cecaed02defac5749a | Fix example | gmarkall/numba,gmarkall/numba,seibert/numba,numba/numba,cpcloud/numba,stuartarchibald/numba,jriehl/numba,stonebig/numba,stuartarchibald/numba,IntelLabs/numba,IntelLabs/numba,cpcloud/numba,sklam/numba,jriehl/numba,stonebig/numba,stonebig/numba,stuartarchibald/numba,stuartarchibald/numba,sklam/numba,sklam/numba,stonebig/... | examples/stack.py | examples/stack.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This example demonstrates jitclasses and deferred type.
This is an extension to the simpler singly-linked-list example in
``linkedlist.py``.
Here, we make a better interface in the Stack class that encapsuate the
underlying linked-list.
"""
from __future__ import print... | """
This example demonstrates jitclasses and deferred type.
This is an extension to the simpler singly-linked-list example in
``linkedlist.py``.
Here, we make a better interface in the Stack class that encapsuate the
underlying linked-list.
"""
from __future__ import print_function, absolute_import
from numba.utils im... | bsd-2-clause | Python |
61bd033ccf0f8bc26f43b317fecb6c3fff4f1cee | clean up keychain.py | blockstack/pybitcoin | pybitcoin/keychain.py | pybitcoin/keychain.py | from bitmerchant.wallet import Wallet as HDWallet
class PrivateKeychain():
def __init__(self, private_keychain=None):
if private_keychain:
if isinstance(private_keychain, HDWallet):
keychain = private_keychain
elif isinstance(private_keychain, (str, unicode)):
... | from bitmerchant.wallet import Wallet as HDWallet
class PrivateKeychain():
def __init__(self, private_keychain=None):
if private_keychain:
if isinstance(private_keychain, HDWallet):
keychain = private_keychain
elif isinstance(private_keychain, (str, unicode)):
... | mit | Python |
d1289a7fbcbe6db38a53d2fea715201de2f6be2d | Bump to v0.3.2.dev0. | matham/pyflycap2 | pyflycap2/__init__.py | pyflycap2/__init__.py | """PyFlyCap2 Library
====================
Project that provides python bindings for the FlyCapture2 library
by Point Gray.
"""
__version__ = '0.3.2.dev0'
import sys
import site
import os
from os.path import join
__all__ = ('dep_bins', )
dep_bins = []
'''A list of paths to the binaries used by the li... | """PyFlyCap2 Library
====================
Project that provides python bindings for the FlyCapture2 library
by Point Gray.
"""
__version__ = '0.3.1'
import sys
import site
import os
from os.path import join
__all__ = ('dep_bins', )
dep_bins = []
'''A list of paths to the binaries used by the library... | mit | Python |
3723963cc9ee7f42609dfbe002c0f910aab99bde | Bump version | cool-RR/PySnooper,alexmojaki/snoop,cool-RR/PySnooper,alexmojaki/snoop | pysnooper/__init__.py | pysnooper/__init__.py | # Copyright 2019 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
'''
PySnooper - Never use print for debugging again
Usage:
import pysnooper
@pysnooper.snoop()
def your_function(x):
...
A log will be written to stderr showing the lines executed and variables
ch... | # Copyright 2019 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
"""PySnooper - Never use print for debugging again
Usage:
import pysnooper
@pysnooper.snoop()
def number_to_bits(number):
...
A log will be written to stderr showing the lines executed and variabl... | mit | Python |
5a03cd340e5dc8a796c7d430128f0e22be17333e | Add helper URLs to qiime.sdk | biocore/qiime2,thermokarst/qiime2,ebolyen/qiime2,jakereps/qiime2,qiime2/qiime2,qiime2/qiime2,nervous-laughter/qiime2,biocore/qiime2,thermokarst/qiime2,jairideout/qiime2,jakereps/qiime2 | qiime/sdk/__init__.py | qiime/sdk/__init__.py | # ----------------------------------------------------------------------------
# Copyright (c) 2016--, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -----------------------------------------------... | # ----------------------------------------------------------------------------
# Copyright (c) 2016--, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -----------------------------------------------... | bsd-3-clause | Python |
2924bb6546cc72fbf1466dde95522d5b873d8860 | Enable exception format checking when testing. | gkotton/vmware-nsx,gkotton/vmware-nsx | quantum/tests/base.py | quantum/tests/base.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# 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/l... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# 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/l... | apache-2.0 | Python |
722b216573e35ddc6ef2fb17bcd56109af779e00 | Fix test | maralla/completor.vim,maralla/completor.vim | tests/__init__.py | tests/__init__.py | # -*- coding: utf-8 -*-
import mock
import sys
from copy import deepcopy
class Buffer(list):
def __init__(self, number, name=''):
self.name = name
self.number = number
self.valid = 1
class VimError(Exception):
pass
class List(object):
pass
class Vars(dict):
def __set__(... | # -*- coding: utf-8 -*-
import mock
import sys
from copy import deepcopy
class Buffer(list):
def __init__(self, number, name=''):
self.name = name
self.number = number
self.valid = 1
class VimError(Exception):
pass
class List(object):
pass
class Vars(dict):
def __set__(... | mit | Python |
b7bdad728d4e4ad15aaa48a575562120c45371be | Remove an unused import | mineo/sagbescheid,mineo/sagbescheid | sagbescheid/notifiers/loggingnotifier.py | sagbescheid/notifiers/loggingnotifier.py | #!/usr/bin/env python
# coding: utf-8
# Copyright © 2015, 2017 Wieland Hoffmann
# License: MIT, see LICENSE for details
import logging
from ..notifier import INotifier
from twisted.plugin import IPlugin
from zope.interface.declarations import implementer
@implementer(IPlugin, INotifier)
class LoggingNotifier(object... | #!/usr/bin/env python
# coding: utf-8
# Copyright © 2015, 2017 Wieland Hoffmann
# License: MIT, see LICENSE for details
import logging
from ..notifier import INotifier
from .. import state_helpers
from twisted.plugin import IPlugin
from zope.interface.declarations import implementer
@implementer(IPlugin, INotifier)... | mit | Python |
b4814d2f86a3b86ca4c7c02bee0c255275308b9a | Print installed packages in pytest | pfnet/chainer,hvy/chainer,chainer/chainer,chainer/chainer,hvy/chainer,hvy/chainer,hvy/chainer,chainer/chainer,chainer/chainer | tests/conftest.py | tests/conftest.py | import os
import subprocess
import sys
from chainer import testing
from chainer.testing import parameterized
_pairwise_parameterize = (
os.environ.get('CHAINER_TEST_PAIRWISE_PARAMETERIZATION', 'never'))
assert _pairwise_parameterize in ('never', 'always')
def _is_pip_installed():
try:
import pip #... | import os
from chainer import testing
from chainer.testing import parameterized
_pairwise_parameterize = (
os.environ.get('CHAINER_TEST_PAIRWISE_PARAMETERIZATION', 'never'))
assert _pairwise_parameterize in ('never', 'always')
def pytest_collection(session):
# Perform pairwise testing.
# TODO(kataoka):... | mit | Python |
458597ec6977056350bf266cbb80b4f5f294c10f | configure conftest to work with python 2 and 3 | GrahamDumpleton/wrapt,GrahamDumpleton/wrapt | tests/conftest.py | tests/conftest.py | import sys
import pytest
version = tuple(sys.version_info[:2])
class DummyCollector(pytest.File):
def collect(self):
return []
def pytest_pycollect_makemodule(path, parent):
if version < (3, 0):
if '_py27' in path.basename:
return DummyCollector(path, parent=parent)
else:
... | import sys
import pytest
version = tuple(sys.version_info[:2])
class DummyCollector(pytest.File):
def collect(self):
return []
def pytest_pycollect_makemodule(path, parent):
if '_py33' in path.basename and version < (3, 3):
return DummyCollector.from_parent(parent, fspath=path)
if '_py37... | bsd-2-clause | Python |
3fc6219cbaf9746c8ede70cfe01c74ddabd60165 | Update tests | achiku/sample-h2o-mruby,achiku/sample-h2o-mruby,achiku/sample-h2o-mruby | tests/conftest.py | tests/conftest.py | # -*- coding: utf-8 -*-
import os
import subprocess
import time
import pytest
@pytest.fixture(scope='session')
def h2o(request):
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(base_dir)
proc = subprocess.Popen(
['./h2o/h2o-2.0.0/h2o', '-c', './h2o.conf'], shell=Tr... | # -*- coding: utf-8 -*-
import os
import subprocess
import time
import pytest
@pytest.fixture(scope='session')
def h2o(request):
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(base_dir)
proc = subprocess.Popen(
['./h2o/h2o-1.5.0/h2o', '-c', './h2o.conf'], shell=Tr... | mit | Python |
b942b61c99bbd011d24b2398d6ceff3ed75d6aea | remove commented code from conftest | antonev/django-handlers | tests/conftest.py | tests/conftest.py | def pytest_configure():
import django
from django.conf import settings
settings.configure(
DEBUG_PROPAGATE_EXCEPTIONS=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
SITE_I... | def pytest_configure():
import django
from django.conf import settings
settings.configure(
DEBUG_PROPAGATE_EXCEPTIONS=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
},
SITE_I... | mit | Python |
ea780d8ef3dcd7db0f53c1bb736b97f8d8e8dc30 | Fix unused parameter warnings | shadowoneau/skylines,Turbo87/skylines,Turbo87/skylines,Harry-R/skylines,skylines-project/skylines,Harry-R/skylines,Turbo87/skylines,shadowoneau/skylines,skylines-project/skylines,shadowoneau/skylines,TobiasLohner/SkyLines,kerel-fs/skylines,snip/skylines,TobiasLohner/SkyLines,snip/skylines,RBE-Avionik/skylines,RBE-Avion... | tests/conftest.py | tests/conftest.py | import pytest
import config
from skylines import model, create_app, create_frontend_app
from tests import setup_app, setup_db, teardown_db, clean_db
from tests.data.bootstrap import bootstrap
@pytest.yield_fixture(scope="session")
def app():
"""Global skylines application fixture
Initialized with testing c... | import pytest
import config
from skylines import model, create_app, create_frontend_app
from tests import setup_app, setup_db, teardown_db, clean_db
from tests.data.bootstrap import bootstrap
@pytest.yield_fixture(scope="session")
def app():
"""Global skylines application fixture
Initialized with testing c... | agpl-3.0 | Python |
e3164d93c54e22ce9b17d10622a9b728f51299bd | set autocommit to True for unit tests | jameshy/libtree,conceptsandtraining/libtree | tests/fixtures.py | tests/fixtures.py | from libtree.config import config
from libtree.tree import insert_node
from libtree.persistance import PostgreSQLPersistance
import pytest
@pytest.fixture(scope='session')
def per(request):
per = PostgreSQLPersistance(config['postgres']['test_details'])
per.set_autocommit(True)
per.drop_tables()
per.... | from libtree.config import config
from libtree.tree import insert_node
from libtree.persistance import PostgreSQLPersistance
import pytest
@pytest.fixture(scope='session')
def per(request):
per = PostgreSQLPersistance(config['postgres']['test_details'])
per.drop_tables()
per.create_tables()
per.creat... | mit | Python |
d79b681f642dfc41fe636d6d875e9563b7495c35 | Fix pep8 | privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea | tests/mscamock.py | tests/mscamock.py | # -*- coding: utf-8 -*-
"""
2022-07-24 Cornelius Kölbel <cornelius.koelbel@netknights.it>
Move all MS CA mocking into this file.
"""
#
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENER... | # -*- coding: utf-8 -*-
"""
2022-07-24 Cornelius Kölbel <cornelius.koelbel@netknights.it>
Move all MS CA mocking into this file.
"""
#
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENER... | agpl-3.0 | Python |
e0c633eb712e220e9f21aa43bdadd241e38d467b | Fix database cache for in progress transactions. | SymbiFlow/symbiflow-arch-defs,SymbiFlow/symbiflow-arch-defs | xc7/utils/prjxray_db_cache.py | xc7/utils/prjxray_db_cache.py | """
This is a database cache. Its a kind of proxy object for Python sqlite3 connection
which operates on a memory copy of the database.
Upon object creation the database is "backed up" to memory. All subsequent
operations are then pefromed on this copy which yields in performance increase.
"""
import sqlite3
from prog... | """
This is a database cache. Its a kind of proxy object for Python sqlite3 connection
which operates on a memory copy of the database.
Upon object creation the database is "backed up" to memory. All subsequent
operations are then pefromed on this copy which yields in performance increase.
"""
import sqlite3
from prog... | isc | Python |
5233317f81ba1e03c927cefdfc4afae13caec542 | make StartupProgramFactory set an interest_level instead of "" | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/tests/factories/startup_program_interest_factory.py | accelerator/tests/factories/startup_program_interest_factory.py | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import swapper
from factory import (
DjangoModelFactory,
Sequence,
SubFactory,
)
from accelerator.apps import AcceleratorConfig
from accelerator.tests.factories.program_factory import ProgramFactory
from accele... | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import swapper
from factory import (
DjangoModelFactory,
SubFactory,
)
from accelerator.apps import AcceleratorConfig
from accelerator.tests.factories.program_factory import ProgramFactory
from accelerator.tests.fa... | mit | Python |
91f963eca028df4ce1458631ffb2ff3f538eebb9 | undo postgres password changes | nextcloud/appstore,nextcloud/appstore,nextcloud/appstore,nextcloud/appstore,nextcloud/appstore,nextcloud/appstore | scripts/development/settings/postgres.py | scripts/development/settings/postgres.py | DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql'
DATABASES['default']['NAME'] = 'nextcloudappstore'
DATABASES['default']['USER'] = 'postgres'
DATABASES['default']['PASSWORD'] = ''
DATABASES['default']['PORT'] = '5432'
DATABASES['default']['HOST'] = '127.0.0.1'
| DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql'
DATABASES['default']['NAME'] = 'nextcloudappstore'
DATABASES['default']['USER'] = 'nextcloudappstore'
DATABASES['default']['PASSWORD'] = 'nextcloudappstore'
DATABASES['default']['PORT'] = '5432'
DATABASES['default']['HOST'] = '127.0.0.1'
| agpl-3.0 | Python |
c5572a2af57a13949987ec24933372c7600e2e9a | use arrays | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | tests/cupy_tests/core_tests/test_ndarray_ufunc.py | tests/cupy_tests/core_tests/test_ndarray_ufunc.py | import unittest
import numpy as np
import cupy
from cupy import testing
@testing.gpu
class TestArrayUfunc(unittest.TestCase):
@testing.for_all_dtypes()
def test_unary_op(self, dtype):
a = cupy.array(np.array([0, 1, 2]), dtype=dtype)
outa = np.sin(a)
# numpy operation produced a cupy... | import unittest
import numpy as np
import cupy
from cupy import testing
@testing.gpu
class TestArrayUfunc(unittest.TestCase):
@testing.for_all_dtypes()
def test_unary_op(self, dtype):
a = cupy.array([0, 1, 2], dtype=dtype)
outa = np.sin(a)
# numpy operation produced a cupy array
... | mit | Python |
4b43a2f50740bbeab95f64137eb8993ed8ac4617 | Add another randomness into the password generator | TheAlgorithms/Python | other/password_generator.py | other/password_generator.py | import string
import random
letters = [letter for letter in string.ascii_letters]
digits = [digit for digit in string.digits]
symbols = [symbol for symbol in string.punctuation]
chars = letters + digits + symbols
random.shuffle(chars)
min_length = 8
max_length = 16
password = ''.join(random.choice(chars) for x in ran... | import string
from random import *
letters = string.ascii_letters
digits = string.digits
symbols = string.punctuation
chars = letters + digits + symbols
min_length = 8
max_length = 16
password = ''.join(choice(chars) for x in range(randint(min_length, max_length)))
print('Password: %s' % password)
print('[ If you are... | mit | Python |
c522665721b4f0404fb2a5747738f693611e7b06 | Update __init__.py | Syncplay/syncplay,NeverDecaf/syncplay,alby128/syncplay,Syncplay/syncplay,alby128/syncplay,NeverDecaf/syncplay | syncplay/__init__.py | syncplay/__init__.py | version = '1.2.9'
milestone = 'Pineapple, Pulverize and Destroy!'
projectURL = 'http://syncplay.pl/'
| version = '1.2.9'
milestone = 'Hammer'
projectURL = 'http://syncplay.pl/'
| apache-2.0 | Python |
809a1e5b1bc3beba0380e84d7ac998e30d5d2d56 | Update __init__.py | inkenbrandt/WellApplication | wellapplication/__init__.py | wellapplication/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.2.14'
__author__ = 'Paul Inkenbrandt'
__name__ = 'wellapplication'
from transport import transport
from usgsGis import usgs
from chem import WQP
from graphs import piper, fdc, gantt
import MannKendall
import avgMeths
| # -*- coding: utf-8 -*-
__version__ = '0.2.13'
__author__ = 'Paul Inkenbrandt'
__name__ = 'wellapplication'
from transport import transport
from usgsGis import usgs
from chem import WQP
from graphs import piper, fdc, gantt
import MannKendall
import avgMeths
| mit | Python |
a4908f0913847632d9fb6fe6840b03ef2449ed57 | Replace 'out_invoice' by 'in_refund' | rfhk/rqn-custom,rfhk/rqn-custom,rfhk/rqn-custom | purchase_order_sale_order_nrq/models/account_invoice_line.py | purchase_order_sale_order_nrq/models/account_invoice_line.py | # -*- coding: utf-8 -*-
# Copyright 2018 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
class AccountInvoice(models.Model):
_inherit = 'account.invoice.line'
sale_ids = fields.Many2many(
'sale.order',
compute="_compute_sa... | # -*- coding: utf-8 -*-
# Copyright 2018 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
class AccountInvoice(models.Model):
_inherit = 'account.invoice.line'
sale_ids = fields.Many2many(
'sale.order',
compute="_compute_sa... | agpl-3.0 | Python |
53157687c54e0beea41dd1bfc8d3194116c5cbae | fix test | apixandru/intellij-community,ol-loginov/intellij-community,clumsy/intellij-community,MichaelNedzelsky/intellij-community,adedayo/intellij-community,pwoodworth/intellij-community,fengbaicanhe/intellij-community,ibinti/intellij-community,ryano144/intellij-community,muntasirsyed/intellij-community,fnouama/intellij-communi... | python/testData/highlighting/unsupportedFeaturesInPython2.py | python/testData/highlighting/unsupportedFeaturesInPython2.py | <warning descr="Dictionary comprehension is not supported in Python 2">{k: v for k, v in stuff}</warning>
try:
pass
<warning descr="This Python version does not support this syntax">except a as name:
pass</warning>
class A(B):
def foo(self):
<warning descr="super() should have arguments in Python 2">super()... | <warning descr="Dictionary comprehension is not supported in Python 2">{k: v for k, v in stuff}</warning>
try:
pass
<warning descr="This Python version does not support this syntax">except a as name:
pass</warning>
class A(B):
def foo(self):
<warning descr="super() should have arguments in Python 2">super()... | apache-2.0 | Python |
10b39abd2ca67fab37db2f47c90c9a839d0bcf85 | update dev version after 0.10.0 tag [skip ci] | desihub/surveysim,desihub/surveysim | py/surveysim/_version.py | py/surveysim/_version.py | __version__ = '0.10.0.dev374'
| __version__ = '0.10.0'
| bsd-3-clause | Python |
5af4b1d4d2aa12f07e163e5c478710abc729b68f | Remove debug print statement | metachris/py2app,metachris/py2app,metachris/py2app,metachris/py2app | py2app/recipes/pygame.py | py2app/recipes/pygame.py | import os
def check(cmd, mf):
m = mf.findNode('pygame')
if m is None or m.filename is None:
return None
def addpath(f):
return os.path.join(os.path.dirname(m.filename), f)
RESOURCES = ['freesansbold.ttf', 'pygame_icon.tiff', 'pygame_icon.icns']
result = dict(
loader_files = [... | import os
def check(cmd, mf):
m = mf.findNode('pygame')
if m is None or m.filename is None:
return None
def addpath(f):
return os.path.join(os.path.dirname(m.filename), f)
RESOURCES = ['freesansbold.ttf', 'pygame_icon.tiff', 'pygame_icon.icns']
result = dict(
loader_files = [... | mit | Python |
1f35857a5ac8273afe90d2c23a4ca20cd8662d7a | Remove comparison to Python's JSON module | vishesh/pycket,samth/pycket,vishesh/pycket,krono/pycket,cderici/pycket,pycket/pycket,samth/pycket,magnusmorton/pycket,krono/pycket,magnusmorton/pycket,pycket/pycket,vishesh/pycket,pycket/pycket,samth/pycket,krono/pycket,cderici/pycket,cderici/pycket,magnusmorton/pycket | pycket/test/test_json.py | pycket/test/test_json.py |
import pytest
from pycket.json import loads
import json as pyjson
def _compare(string, expected):
json = loads(string)
val = json._unpack_deep()
assert val == expected
#assert val == pyjson.loads(string)
def test_simple():
_compare("1", 1)
_compare("\"abc\"", "abc")
_compare("1.2", 1.2)
... |
import pytest
from pycket.json import loads
import json as pyjson
def _compare(string, expected):
json = loads(string)
val = json._unpack_deep()
assert val == expected
assert val == pyjson.loads(string)
def test_simple():
_compare("1", 1)
_compare("\"abc\"", "abc")
_compare("1.2", 1.2)
d... | mit | Python |
3f4618e72350de14df8abb6b3e7c76c8fcbdd5d8 | Fix demo TwoContentLayout | j00bar/django-widgy,j00bar/django-widgy,j00bar/django-widgy | demo/demo_widgets/models.py | demo/demo_widgets/models.py | from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from widgy import registry
from widgy.db.fields import WidgyField
from widgy.contrib.page_builder.models import Layout, MainContent, Accordion
class TwoContentLayout(Layout):
default_children = [... | from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from widgy import registry
from widgy.db.fields import WidgyField
from widgy.contrib.page_builder.models import Layout, MainContent, Accordion
class TwoContentLayout(Layout):
default_children = [... | apache-2.0 | Python |
62e2f253baafb8ce0631bee4cdc0bc107b243b26 | Add Nyan | Aioxas/ax-cogs | longcat/longcat.py | longcat/longcat.py | import os
import time
from PIL import Image
from discord.ext import commands
class Longcat:
def __init__(self, bot):
self.bot = bot
self.path = "data/longcat/"
# 42 is the answer to everything
nreow = ["c"+"a"*i+"t" for i in range(2, 42)]
mya = ["ny"+"a"*i+"n" for i in range(1, 42)]
... | import os
import time
from PIL import Image
from discord.ext import commands
class Longcat:
def __init__(self, bot):
self.bot = bot
self.path = "data/longcat/"
# 42 is the answer to everything
nreow = ["c"+"a"*i+"t" for i in range(2, 42)]
@commands.command(pass_context=True, aliases=... | mit | Python |
2bbe3a44f348473ba719f403f3df5c324cb35d9e | Simplify description construction | numberoverzero/pyservice | pyservice/description.py | pyservice/description.py | import json
def build_field(obj, field, cls):
d = {}
if field not in obj:
obj[field] = dict()
for name, value in obj[field].items():
value["name"] = value.get("name", name)
d[name] = cls(value)
return d
class Description(object):
def __init__(self, json_obj, name=None):
... | import json
def default_field(obj, field, cls):
'''
If field isn't found in obj, instantiate a new cls and insert it into obj
'''
if field not in obj:
obj[field] = cls()
return obj[field]
def load_fields(obj, data, translations=None):
'''
translations is an optional mapping from ... | mit | Python |
9e02f92fc19b7f833b25d0273143e98261a3b484 | Hide unnecessary fields in the admins | vikoivun/kerrokantasi,stephawe/kerrokantasi,stephawe/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,vikoivun/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,vikoivun/kerrokantasi | democracy/admin/__init__.py | democracy/admin/__init__.py | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from nested_admin.nested import NestedAdmin, NestedStackedInline
from democracy import models
# Inlines
class HearingImageInline(NestedStackedInline):
model = models.HearingImage
extra = 0
exclude = ("public", "tit... | from django.contrib import admin
from nested_admin.nested import NestedAdmin, NestedStackedInline
from democracy import models
# Inlines
class HearingImageInline(NestedStackedInline):
model = models.HearingImage
extra = 0
class SectionImageInline(NestedStackedInline):
model = models.SectionImage
... | mit | Python |
4bdf329b42aaf373fddf3fd8242c4ab8c06edeee | Enhance error message. | bjarneo/Pytify,jaruserickson/spotiplay,bjarneo/Pytify | pytify/dbus/interface.py | pytify/dbus/interface.py | from __future__ import absolute_import, unicode_literals
import dbus
import sys
class Interface():
def factory(type):
try:
interface = dbus.Interface(
dbus.SessionBus().get_object(
'org.mpris.MediaPlayer2.spotify',
'/org/mpris/MediaPlayer... | from __future__ import absolute_import, unicode_literals
import dbus
import sys
class Interface():
def factory(type):
try:
interface = dbus.Interface(
dbus.SessionBus().get_object(
'org.mpris.MediaPlayer2.spotify',
'/org/mpris/MediaPlayer... | mit | Python |
19d33ca2854b89471600d556f80036a6fbc6dd14 | Bump up to 0.7 | hivelocity/djiki,hivelocity/djiki | djiki/__init__.py | djiki/__init__.py | __version__ = '0.7'
| __version__ = '0.6'
| bsd-2-clause | Python |
88d188b80043d661d4802d8185f4977d6a4af0f7 | add conditional to only pull from lists | bcicen/redis-scraper,bcicen/redis-scraper | redis_scraper/core.py | redis_scraper/core.py | #!/usr/bin/python
import os,redis,json,logging,time
from string import digits
log = logging.getLogger()
class ProcessRedisQ(object):
def __init__(self,redis_pool,log_dir,redis_port=6379,interval=10):
self.r_hosts = redis_pool
self.r_port = redis_port
self.log_dir = log_dir
self.i... | #!/usr/bin/python
import os,redis,json,logging,time
from string import digits
log = logging.getLogger()
class ProcessRedisQ(object):
def __init__(self,redis_pool,log_dir,redis_port=6379,interval=10):
self.r_hosts = redis_pool
self.r_port = redis_port
self.log_dir = log_dir
self.i... | mit | Python |
2969a4cbec2791e29ae2c3578b5a314cf260b43a | Update views.py | yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti | core/auth/local/views.py | core/auth/local/views.py | from flask import Blueprint, render_template, request, redirect, flash, abort
from flask_login import login_user, logout_user, current_user, login_required
from werkzeug.security import check_password_hash
from core.auth.local.user_management import authenticate, create_user, set_password
from core.user import User
fr... | from flask import Blueprint, render_template, request, redirect, flash, abort
from flask_login import login_user, logout_user, current_user, login_required
from werkzeug.security import check_password_hash
from core.auth.local.user_management import authenticate, create_user, set_password
from core.user import User
fr... | apache-2.0 | Python |
c3cc1274d16c7769a1a131e6741d9f8e276514e5 | Use new resource name | userzimmermann/robotframework-python3,userzimmermann/robotframework-python3,Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework,Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework | atest/genrunner.py | atest/genrunner.py | #!/usr/bin/env python
"""Script to generate atest runners based on data files.
Usage: %s path/to/data.file
"""
from __future__ import with_statement
import sys, os
if len(sys.argv) != 2:
print __doc__ % os.path.basename(sys.argv[0])
sys.exit(1)
inpath = os.path.abspath(sys.argv[1])
outpath = inpath.replac... | #!/usr/bin/env python
"""Script to generate atest runners based on data files.
Usage: %s path/to/data.file
"""
from __future__ import with_statement
import sys, os
if len(sys.argv) != 2:
print __doc__ % os.path.basename(sys.argv[0])
sys.exit(1)
inpath = os.path.abspath(sys.argv[1])
outpath = inpath.replac... | apache-2.0 | Python |
120637624e1b7d9acdcbca9de89b0f185bc86a32 | Decrease size of landmarks so that they do not obstruct the actual voxel that they indicate. | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | ui/transformations/Landmark.py | ui/transformations/Landmark.py | """
Landmark
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkProp3DFollower
from vtk import vtkTransform
from core.vtkDrawing import CreateSphere
from core.vtkDrawing import ColorActor
from core.vtkDrawing import CreateCircle
class Landmark(object):
"""
Landmark is a container for vtkProps for easier
mana... | """
Landmark
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkProp3DFollower
from vtk import vtkTransform
from core.vtkDrawing import CreateSphere
from core.vtkDrawing import ColorActor
from core.vtkDrawing import CreateCircle
class Landmark(object):
"""
Landmark is a container for vtkProps for easier
mana... | mit | Python |
4a4cdcd7db8d1bc39808876ea1e37b994402139d | bump to 0.4.6 | tsuru/varnishapi,tsuru/varnishapi | feaas/__init__.py | feaas/__init__.py | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.4.6"
| # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.4.5"
| bsd-3-clause | Python |
ca864f36dd89585e6cd322e4abb7761917c654a8 | Add support for building indy-sdk on Windows | Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/... | wrappers/nodejs/binding.gyp | wrappers/nodejs/binding.gyp | {
"targets": [
{
"target_name": "indynodejs",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"<(module_root_dir)/include",
"<(module_root_dir)/../../libindy/include"
],
"sources": [
"src/indy.cc"
],
"link_settings": {
"conditions": [... | {
"targets": [
{
"target_name": "indynodejs",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"<(module_root_dir)/include",
"<(module_root_dir)/../../libindy/include"
],
"sources": [
"src/indy.cc"
],
"link_settings": {
"libraries": [
... | apache-2.0 | Python |
8a4ec49cc881df32b94720f83ca1c355c1fc7442 | Join code | Hackfmi/Diaphanum,Hackfmi/Diaphanum | feedback/views.py | feedback/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import permission_required
from django.core.mail import send_mail
from .forms import FeedbackForm
def add(request):
data = request.POST if request.POST else None
if request.POST:
form = FeedbackF... | # -*- coding: utf-8 -*-
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import permission_required
from django.core.mail import send_mail
from .forms import FeedbackForm
def add(request):
data = request.POST if request.POST else None
if request.POST:
form = FeedbackF... | mit | Python |
2eeb32514b41c1a64d95497f39afd6346037c375 | update version | jhorey/ferry,jhorey/ferry,jhorey/ferry,jhorey/ferry | ferry/__init__.py | ferry/__init__.py | __version__ = '0.1.16'
| __version__ = '0.1.15'
| apache-2.0 | Python |
62ac170880034878bb12c57425e488bb8d4eb180 | Remove triage_message() from help bot. | vabs22/zulip,vaidap/zulip,zulip/zulip,mahim97/zulip,tommyip/zulip,hackerkid/zulip,mahim97/zulip,zulip/zulip,christi3k/zulip,christi3k/zulip,rht/zulip,verma-varsha/zulip,kou/zulip,brockwhittaker/zulip,zulip/zulip,showell/zulip,shubhamdhama/zulip,j831/zulip,jackrzhang/zulip,punchagan/zulip,j831/zulip,mahim97/zulip,timabb... | contrib_bots/bots/help/help.py | contrib_bots/bots/help/help.py | # See readme.md for instructions on running this code.
class HelpHandler(object):
def usage(self):
return '''
This plugin will give info about Zulip to
any user that types a message saying "help".
This is example code; ideally, you would flesh
this out for m... | # See readme.md for instructions on running this code.
class HelpHandler(object):
def usage(self):
return '''
This plugin will give info about Zulip to
any user that types a message saying "help".
This is example code; ideally, you would flesh
this out for m... | apache-2.0 | Python |
0dec215db3e8f6960c12eed62ef76d1535b34659 | Test the activation key reset. | rbarrois/django-registration,newvem/django-registration,QPmedia/django-registration,maraujop/django-registration,newvem/django-registration,rafaduran/django-pluggable-registration,AndrewLvov/django-registration,fedenko/django-registration,fedenko/django-registration,thedod/django-registration-hg-mirror,CoatedMoose/djan... | registration/tests.py | registration/tests.py | """
Unit tests for django-registration.
"""
from django.core import mail
from django.test import TestCase
from registration.models import RegistrationProfile
class DefaultBackendTestCase(TestCase):
"""
Test the default registration backend.
Running these tests successfull will require two templates to... | """
Unit tests for django-registration.
"""
from django.core import mail
from django.test import TestCase
from registration.models import RegistrationProfile
class DefaultBackendTestCase(TestCase):
"""
Test the default registration backend.
Running these tests successfull will require two templates to... | bsd-3-clause | Python |
d768b34f176306b86bde060852f781316f7a9155 | add 0.933, add misc programs to install (#16669) | LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack | var/spack/repos/builtin/packages/angsd/package.py | var/spack/repos/builtin/packages/angsd/package.py | # Copyright 2013-2020 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 Angsd(MakefilePackage):
"""Angsd is a program for analysing NGS data. The software can han... | # Copyright 2013-2020 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 Angsd(MakefilePackage):
"""Angsd is a program for analysing NGS data. The software can han... | lgpl-2.1 | Python |
0aa91a225a0057ba0be5d860a3f99cf34abcd6d3 | Update version | open-synergy/partner-contact,Endika/partner-contact,diagramsoftware/partner-contact,acsone/partner-contact,Therp/partner-contact | crm_job_position/__openerp__.py | crm_job_position/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Odoo Source Management Solution
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright ... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Odoo Source Management Solution
# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# Copyright ... | agpl-3.0 | Python |
c860d2214c9debd2d01461c8e27cc7fd46de423e | use pytest for state | pkulev/xoinvader,pankshok/xoinvader | xoinvader/tests/test_state.py | xoinvader/tests/test_state.py | """Tests for xoinvader.state module."""
import pytest
from xoinvader.state import State
def test_state():
"""Test xoinvader.state.State base class."""
state = State("owner")
assert state.owner == "owner"
assert state.actor is None
assert state.screen is None
with pytest.raises(NotImpleme... | """Tests for xoinvader.state module."""
import unittest
from xoinvader.state import State
class TestState(unittest.TestCase):
"""xoinvader.state.State"""
def test_base_class(self):
"""base_class"""
state = State("owner")
self.assertEqual(state.owner, "owner")
self.assertEq... | mit | Python |
d3fdddf00d00787e9a4b8ac58125c89059aef48b | remove unused imported(F401) | h2non/filetype.py | filetype/utils.py | filetype/utils.py | # -*- coding: utf-8 -*-
# Python 2.7 workaround
try:
import pathlib
except ImportError:
pass
_NUM_SIGNATURE_BYTES = 8192
def get_signature_bytes(path):
"""
Reads file from disk and returns the first 8192 bytes
of data representing the magic number header signature.
Args:
path: path... | # -*- coding: utf-8 -*-
from io import BufferedIOBase
# Python 2.7 workaround
try:
import pathlib
except ImportError:
pass
_NUM_SIGNATURE_BYTES = 8192
def get_signature_bytes(path):
"""
Reads file from disk and returns the first 8192 bytes
of data representing the magic number header signature.... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.