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
7f9ca64313fff0716143cf7d56075a565f35d60f
add docstring describing public API (#2140)
tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard,tensorflow/tensorboard
tensorboard/plugins/hparams/api.py
tensorboard/plugins/hparams/api.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
a68bb0d268861d30c26647523991ed215853cdfe
add Reeve post
opencivicdata/scrapers-ca,opencivicdata/scrapers-ca
ca_ab_grande_prairie_county_no_1/people.py
ca_ab_grande_prairie_county_no_1/people.py
from pupa.scrape import Scraper from utils import lxmlize, CanadianLegislator as Legislator import re COUNCIL_PAGE = 'http://www.countygp.ab.ca/EN/main/government/council.html' REEVE_URL = 'http://www.countygp.ab.ca/EN/main/government/council/reeve-message.html' class GrandePrairieCountyNo1PersonScraper(Scraper): ...
from pupa.scrape import Scraper from utils import lxmlize, CanadianLegislator as Legislator import re COUNCIL_PAGE = 'http://www.countygp.ab.ca/EN/main/government/council.html' class GrandePrairieCountyNo1PersonScraper(Scraper): # @todo The Reeve is also a Councillor. def get_people(self): page = lxmlize(C...
mit
Python
9c7dda9f55369109831eb53f4ed1da5fe82cfc7b
Fix test for observation_aggregator
niboshi/chainer,niboshi/chainer,wkentaro/chainer,pfnet/chainer,hvy/chainer,chainer/chainer,niboshi/chainer,wkentaro/chainer,wkentaro/chainer,wkentaro/chainer,hvy/chainer,niboshi/chainer,hvy/chainer,chainer/chainer,hvy/chainer,chainer/chainer,chainer/chainer
tests/chainermn_tests/extensions_tests/test_observation_aggregator.py
tests/chainermn_tests/extensions_tests/test_observation_aggregator.py
import unittest import numpy as np import chainer import chainer.testing from chainer.training import extension import chainermn from chainermn.extensions.observation_aggregator import observation_aggregator class DummyChain(chainer.Chain): def __init__(self): super(DummyChain, self).__init__() de...
import unittest import numpy as np import chainer import chainer.testing from chainer.training import extension import chainermn from chainermn.extensions.observation_aggregator import observation_aggregator class DummyChain(chainer.Chain): def __init__(self): super(DummyChain, self).__init__() de...
mit
Python
c3a251588868ace81e8e4e0bbe29828495d759d9
fix command line arguments
FidoProject/Hardware,FidoProject/Hardware,FidoProject/Hardware,FidoProject/Hardware
ThingThree/Code/Dotstar/strandtest.py
ThingThree/Code/Dotstar/strandtest.py
#!/usr/bin/python import time, math, sys from dotstar import Adafruit_DotStar numPixels = 24 dataPin = 17 clockPin = 27 strip = Adafruit_DotStar(numPixels, dataPin, clockPin) strip.begin() strip.setBrightness(255) def scale(color, brightness): str_hex = hex(color)[2:].zfill(6) r,g,b = (int(str_hex[2*x:2*x...
#!/usr/bin/python import time, math, sys from dotstar import Adafruit_DotStar numPixels = 24 dataPin = 17 clockPin = 27 strip = Adafruit_DotStar(numPixels, dataPin, clockPin) strip.begin() strip.setBrightness(255) def scale(color, brightness): str_hex = hex(color)[2:].zfill(6) r,g,b = (int(str_hex[2*x:2*x...
apache-2.0
Python
a171595f029b43af27d14a125e68647e2206c6d5
Update __init__.py
r0h4n/commons,Tendrl/commons
tendrl/commons/objects/node_alert_counters/__init__.py
tendrl/commons/objects/node_alert_counters/__init__.py
from tendrl.commons import objects class NodeAlertCounters(objects.BaseObject): def __init__( self, warn_count=0, node_id=None, *args, **kwargs ): super(NodeAlertCounters, self).__init__(*args, **kwargs) self.warning_count = warn_count self.node_...
from tendrl.commons import objects class NodeAlertCounters(objects.BaseObject): def __init__( self, warn_count=0, node_id=None, *args, **kwargs ): super(NodeAlertCounters, self).__init__(*args, **kwargs) self.warning_count = warn_count self.node_...
lgpl-2.1
Python
dd7e0d18a15195cf67af44af8c15918a5cf068e4
add header information
changbinwang/bookinfo,changbinwang/bookinfo
douban_book_api.py
douban_book_api.py
from douban_client.api.error import DoubanAPIError import requests import simplejson from douban_client import DoubanClient __author__ = 'owen2785' baseurl = 'https://api.douban.com/v2/book/isbn/' def getbyisbn_without_auth(isbn): r = requests.get(baseurl+str(isbn),headers=headers) print r.headers print...
from douban_client.api.error import DoubanAPIError import requests import simplejson from douban_client import DoubanClient __author__ = 'owen2785' baseurl = 'https://api.douban.com/v2/book/isbn/' def getbyisbn_without_auth(isbn): r = requests.get(baseurl+str(isbn)) return r.json()
apache-2.0
Python
396ab20874a0c3492482a8ae03fd7d61980917a5
Update closest match adapter docstring.
Reinaesaya/OUIRL-ChatBot,vkosuri/ChatterBot,gunthercox/ChatterBot,Gustavo6046/ChatterBot,maclogan/VirtualPenPal,Reinaesaya/OUIRL-ChatBot,davizucon/ChatterBot
chatterbot/adapters/logic/closest_match.py
chatterbot/adapters/logic/closest_match.py
# -*- coding: utf-8 -*- from fuzzywuzzy import fuzz from .base_match import BaseMatchAdapter class ClosestMatchAdapter(BaseMatchAdapter): """ The ClosestMatchAdapter logic adapter selects a known response to an input by searching for a known statement that most closely matches the input based on the L...
# -*- coding: utf-8 -*- from fuzzywuzzy import fuzz from .base_match import BaseMatchAdapter class ClosestMatchAdapter(BaseMatchAdapter): """ The ClosestMatchAdapter logic adapter creates a response by using fuzzywuzzy's process class to extract the most similar response to the input. This adapter s...
bsd-3-clause
Python
2947fe97d466872de05ada289d9172f41895969c
Update GOV.UK Frontend/Jinja lib test
alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin
tests/templates/components/test_radios_with_images.py
tests/templates/components/test_radios_with_images.py
import json from importlib import metadata from packaging.version import Version def test_govuk_frontend_jinja_overrides_on_design_system_v3(): with open("package.json") as package_file: package_json = json.load(package_file) govuk_frontend_version = Version(package_json["dependencies"]["govuk-fr...
import json def test_govuk_frontend_jinja_overrides_on_design_system_v3(): with open("package.json") as package_file: package_json = json.load(package_file) assert package_json["dependencies"]["govuk-frontend"].startswith("3."), ( "After upgrading the Design System, manually validate that " ...
mit
Python
f4a80c720d0164eb8a942e3ad1b5244d30800e5a
Add --allow-nacl-socket-api for the chromoting functional test.
krieger-od/nwjs_chromium.src,markYoungH/chromium.src,dednal/chromium.src,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,anirudhSK...
chrome/test/functional/chromoting_basic.py
chrome/test/functional/chromoting_basic.py
#!/usr/bin/env python # Copyright (c) 2012 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 os import pyauto_functional # Must come before chromoting and pyauto. import chromoting import pyauto class ChromotingBa...
#!/usr/bin/env python # Copyright (c) 2012 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 os import pyauto_functional # Must come before chromoting and pyauto. import chromoting import pyauto class ChromotingBa...
bsd-3-clause
Python
0b366a3f4c23b644f885ed649edc577242ae90ee
Fix genreflex rootmap files to not contain stray spaces after "string" Corrsponds to v5-22-00-patches r27408
karies/root,thomaskeck/root,mkret2/root,sawenzel/root,smarinac/root,0x0all/ROOT,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,Duraznos/root,krafczyk/root,beniz/root,mhuwiler/rootauto,strykejern/TTreeReader,vukasinmilosevic/root,arch1tect0r/root,sbinet/cxx-root,lgiommi/root,omazapa/root,esakellari/my_root_for_test,...
cint/reflex/python/genreflex/genrootmap.py
cint/reflex/python/genreflex/genrootmap.py
# Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved. # # Permission to use, copy, modify, and distribute this software for any # purpose is hereby granted without fee, provided that this copyright and # permissions notice appear in all copies and derivatives. # # This software is provided "as is" withou...
# Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved. # # Permission to use, copy, modify, and distribute this software for any # purpose is hereby granted without fee, provided that this copyright and # permissions notice appear in all copies and derivatives. # # This software is provided "as is" withou...
lgpl-2.1
Python
b2e6a7a8df1ede0118838ce494e1679eea0eb578
Decrease cert expiration alerting threshold from 2 years to 1 year. (#1002)
scalyr/scalyr-agent-2,scalyr/scalyr-agent-2,scalyr/scalyr-agent-2,scalyr/scalyr-agent-2
scripts/check-bundled-ca-certs-expirations.py
scripts/check-bundled-ca-certs-expirations.py
#!/usr/bin/env python # Copyright 2014-2020 Scalyr 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 ...
#!/usr/bin/env python # Copyright 2014-2020 Scalyr 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 ...
apache-2.0
Python
1be539f68019435b2d09b1a46e4786a09e59edf2
Allow for multiple SEPA payment methods with different versions (#493) (#496)
CompassionCH/bank-payment,CompassionCH/bank-payment
account_banking_pain_base/models/account_payment_method.py
account_banking_pain_base/models/account_payment_method.py
# -*- coding: utf-8 -*- # © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, _ from odoo.exceptions import UserError class AccountPaymentMethod(models.Model): _inherit = 'account.payment.meth...
# -*- coding: utf-8 -*- # © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, _ from odoo.exceptions import UserError class AccountPaymentMethod(models.Model): _inherit = 'account.payment.meth...
agpl-3.0
Python
4697bb9bb7a3708f1c35b795c02db329d3142703
Add script to collect metrics in samples of a case into a single vector
jesusbriales/rgbd_benchmark_tools
src/rgbd_benchmark_tools/h5_collectSamples.py
src/rgbd_benchmark_tools/h5_collectSamples.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on Thu Sep 17 09:02:31 2015 @author: jesus """ import argparse import numpy as np import h5py if __name__ == '__main__': parser = argparse.ArgumentParser(description=''' This script collects the metrics and results from several samples of an experiment ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on Thu Sep 17 09:02:31 2015 @author: jesus """ import argparse import numpy as np import h5py if __name__ == '__main__': parser = argparse.ArgumentParser(description=''' This script collects the metrics and results from several samples of an experiment ...
bsd-2-clause
Python
0f295d0ee8c29361bd4f80dbc947da65dd7fbbe6
move raindrops
neiesc/Problem-solving,neiesc/Problem-solving,neiesc/Problem-solving,neiesc/Problem-solving
Exercism/python/raindrops/raindrops.py
Exercism/python/raindrops/raindrops.py
def convert(number): raindrops = ((3, "Pling"), (5, "Plang"), (7, "Plong")) raindrop_result = [raindrop[1] for raindrop in raindrops if number % raindrop[0] == 0] return "".join(raindrop_result) or str(number)
raindrops = ((3, "Pling"), (5, "Plang"), (7, "Plong")) def convert(number): raindrop_result = [raindrop[1] for raindrop in raindrops if number % raindrop[0] == 0] return "".join(raindrop_result) or str(number)
mit
Python
15ae458f7cf1a8257967b2b3b0ceb812547c4766
Test more edge cases of the highlighting parser
ipython/ipython,ipython/ipython
IPython/utils/tests/test_pycolorize.py
IPython/utils/tests/test_pycolorize.py
# coding: utf-8 """Test suite for our color utilities. Authors ------- * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING.txt, d...
"""Test suite for our color utilities. Authors ------- * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING.txt, distributed as pa...
bsd-3-clause
Python
1eee9dfa6f7ea359f0dc4d0bf7450b3c96d3731d
Remove unnecessary var
reunition/reunition,reunition/reunition,reunition/reunition
reunition/apps/reunions/management/commands/setalumniusersfromrsvps.py
reunition/apps/reunions/management/commands/setalumniusersfromrsvps.py
from django.core.management.base import NoArgsCommand from django.db.models.fields import related from reunition.apps.alumni import models as alumni_m from reunition.apps.reunions import models as reunions_m class Command(NoArgsCommand): help = 'Associate reunions.Rsvp.created_by to alumni.Person.user when not ...
from django.core.management.base import NoArgsCommand from django.db.models.fields import related from reunition.apps.alumni import models as alumni_m from reunition.apps.reunions import models as reunions_m class Command(NoArgsCommand): help = 'Associate reunions.Rsvp.created_by to alumni.Person.user when not ...
mit
Python
5fc54a2120fbc9151073c9b247e3fd7e8e79a9fa
Remove premature attribute from migration script (Fixes #283)
phihag/adhocracy,SysTheron/adhocracy,alkadis/vcv,liqd/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,SysTheron/adhocracy,alkadis/vcv,liqd/adhocracy,DanielNeugebauer/adhocracy,SysTheron/adhocracy,liqd/adhocracy,phihag/adhocracy,DanielNeugebauer/adhocracy,phihag/adhocracy,DanielNeugebauer/adh...
src/adhocracy/migration/versions/054_add_hierachical_categorybadges.py
src/adhocracy/migration/versions/054_add_hierachical_categorybadges.py
from datetime import datetime from sqlalchemy import Column, ForeignKey, MetaData, Table from sqlalchemy import Boolean, Integer, DateTime, String, Unicode, LargeBinary metadata = MetaData() #table to update badge_table = Table( 'badge', metadata, #common attributes Column('id', Integer, primary_key=True)...
from datetime import datetime from sqlalchemy import Column, ForeignKey, MetaData, Table from sqlalchemy import Boolean, Integer, DateTime, String, Unicode, LargeBinary metadata = MetaData() #table to update badge_table = Table( 'badge', metadata, #common attributes Column('id', Integer, primary_key=True)...
agpl-3.0
Python
b06687b1e78645a055a314be4b1af693e2c3be05
remove obsolete arguments
StegSchreck/RatS,StegSchreck/RatS,StegSchreck/RatS
RatS/filmaffinity/filmaffinity_site.py
RatS/filmaffinity/filmaffinity_site.py
import time from RatS.base.base_site import Site from selenium.webdriver.common.by import By class FilmAffinity(Site): def __init__(self, args): login_form_selector = "//form[@id='login-form']" self.LOGIN_USERNAME_SELECTOR = login_form_selector + "//input[@name='username']" self.LOGIN_PAS...
import time from RatS.base.base_site import Site from selenium.webdriver.common.by import By class FilmAffinity(Site): def __init__(self, args): login_form_selector = "//form[@id='login-form']" self.LOGIN_USERNAME_SELECTOR = login_form_selector + "//input[@name='username']" self.LOGIN_PAS...
agpl-3.0
Python
c79c3b7f920f4bcf5fb69cf74b224e6ff37a709b
test triggering travis
Lenijas/test-travisci,Lenijas/test-travisci,Lenijas/test-travisci
fabre_test.py
fabre_test.py
#!/usr/bin/env python # coding=UTF-8 import pytest import sys # content of test_assert1.py def f(): return 3 def test_function(): assert f() == 4 test_function()
#!/usr/bin/env python # coding=UTF-8 import pytest import sys sys.exit(0)
bsd-3-clause
Python
0fb800cd42f1545e8d5e744af1ff81922c930448
Add Google analytics ID
glasslion/zha-beta,glasslion/zha-beta,glasslion/zha-beta,glasslion/zha,glasslion/zha,glasslion/zha
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals from datetime import datetime import os import sys BASE_DIR = os.path.dirname(__file__) # Clone the official plugin repo to the `official_plugins` dir # (https://github.com/getpelican/pelican-plugins) sys.path.append(os.path.join(...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals from datetime import datetime import os import sys BASE_DIR = os.path.dirname(__file__) # Clone the official plugin repo to the `official_plugins` dir # (https://github.com/getpelican/pelican-plugins) sys.path.append(os.path.join(...
cc0-1.0
Python
6a1176d547694b535bc581d5a0af87230d533caf
set to version 3.305.533
UmSenhorQualquer/pythonVideoAnnotator
base/pythonvideoannotator/pythonvideoannotator/__init__.py
base/pythonvideoannotator/pythonvideoannotator/__init__.py
# !/usr/bin/python3 # -*- coding: utf-8 -*- __version__ = "3.305.533" __author__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", "Hugo Cachitas"] __credits__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", "Hugo Cachitas"] __license__ = "Attribution-NonCommercial-ShareAlike 4.0 International" __maintainer__ = ["Ricardo...
# !/usr/bin/python3 # -*- coding: utf-8 -*- __version__ = "3.305.532" __author__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", "Hugo Cachitas"] __credits__ = ["Ricardo Ribeiro", "Carlos Mao de Ferro", "Hugo Cachitas"] __license__ = "Attribution-NonCommercial-ShareAlike 4.0 International" __maintainer__ = ["Ricardo...
mit
Python
d82c37a85e3522f7cf7e26a220eb5946aec66ffe
Create docs from numpy
datamicroscopes/lda,datamicroscopes/lda,datamicroscopes/lda
test/test_data_utils.py
test/test_data_utils.py
import numpy as np from cStringIO import StringIO from nose.tools import raises from microscopes.lda import utils def test_docs_from_document_term_matrix(): dtm = [[2, 1], [3, 2]] docs = [[0, 0, 1], [0, 0, 0, 1, 1]] assert utils.docs_from_document_term_matrix(dtm) == docs def test_docs_from_numpy_dtp()...
from cStringIO import StringIO from nose.tools import raises from microscopes.lda import utils def test_docs_from_document_term_matrix(): dtm = [[2, 1], [3, 2]] docs = [[0, 0, 1], [0, 0, 0, 1, 1]] assert utils.docs_from_document_term_matrix(dtm) == docs def test_docs_from_ldac_simple(): stream = Str...
bsd-3-clause
Python
36ed44e94916d6abe3458645c957dd9715cbc532
set STATIC_ROOT
joaoleveiga/django-wsgi-example,joaoleveiga/django-wsgi-example
myproj/myproj/settings.py
myproj/myproj/settings.py
""" Django settings for myproj project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
""" Django settings for myproj project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
mit
Python
566ceb81a14685c201f3c92668dc0530a1a91176
fix path
Ircam-Web/mezzanine-organization,Ircam-Web/mezzanine-organization
organization/projects/management/commands/project_inject_content.py
organization/projects/management/commands/project_inject_content.py
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
Python
70004e7caf332e55d40b4f1f757138c4cd35a3fe
fix path
Ircam-Web/mezzanine-organization,Ircam-Web/mezzanine-organization
organization/projects/management/commands/project_inject_content.py
organization/projects/management/commands/project_inject_content.py
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
Python
2e4ec0fea35722fbdbab36ce326e664249e3eaf7
Add support jinja2
beni55/nacho,beni55/nacho,avelino/nacho
nacho/controllers/base.py
nacho/controllers/base.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from tornado.web import RequestHandler from jinja2 import Environment, FileSystemLoader, TemplateNotFound class ApplicationController(RequestHandler): def render(self, template_name, **kwargs): kwargs.update({ 'settings': self.settings, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from cyclone.web import RequestHandler class ApplicationController(RequestHandler): pass
mit
Python
45c86ade944d9afe7bc8e627e25fa861489cd4b6
fix a typo so that email is sent to the correct host
crateio/crate.web,crateio/crate.web
crate_project/settings/production/gondor.py
crate_project/settings/production/gondor.py
import os from .base import * from local_settings import * # Instance specific settings (in deploy.settings_[INSTANCE_NAME])) # Fix Email Settings SERVER_EMAIL = "server@crate.io" DEFAULT_FROM_EMAIL = "support@crate.io" CACHES = { "default": { "BACKEND": "redis_cache.RedisCache", "LOCATION": ":...
import os from .base import * from local_settings import * # Instance specific settings (in deploy.settings_[INSTANCE_NAME])) # Fix Email Settings SERVER_EMAIL = "server@crate.io" DEFAULT_FROM_EMAIL = "support@crate.io" CACHES = { "default": { "BACKEND": "redis_cache.RedisCache", "LOCATION": ":...
bsd-2-clause
Python
2a1407b34187cfba6c968a7b95e58ec1c115a8f6
Print functions
datacommonsorg/api-python,datacommonsorg/api-python
datacommons/examples/population_analysis.py
datacommons/examples/population_analysis.py
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
d74b15485a0756ac1702fafd640f616f022b3f58
bump verions
rygwdn/equals,toddsifleet/equals
equals/__init__.py
equals/__init__.py
from __future__ import absolute_import __version__ = '0.0.21' import numbers import collections from equals.equals import Equals as instance_of from equals.constraints.anything_true import AnythingTrue from equals.constraints.anything_false import AnythingFalse anything = instance_of() try: any_string = instanc...
from __future__ import absolute_import __version__ = '0.0.2' import numbers import collections from equals.equals import Equals as instance_of from equals.constraints.anything_true import AnythingTrue from equals.constraints.anything_false import AnythingFalse anything = instance_of() try: any_string = instance...
mit
Python
9c2d1e9e841014dbc986b6e509b19f7f881969c4
Fix silly typo
spendb/spendb,openspending/spendb,spendb/spendb,pudo/spendb,pudo/spendb,USStateDept/FPA_Core,CivicVision/datahub,johnjohndoe/spendb,spendb/spendb,CivicVision/datahub,CivicVision/datahub,johnjohndoe/spendb,openspending/spendb,USStateDept/FPA_Core,pudo/spendb,nathanhilbert/FPA_Core,nathanhilbert/FPA_Core,johnjohndoe/spen...
openspending/lib/csvexport.py
openspending/lib/csvexport.py
import csv import sys from datetime import datetime from openspending import model from openspending.mongo import DBRef, ObjectId def write_csv(entries, response): response.content_type = 'text/csv' # NOTE: this should be a streaming service but currently # I see no way to know the full set of keys with...
import csv import sys from datetime import datetime from openspending import model from openspending.mongo import DBRef, ObjectId def write_csv(entries, response): response.content_type = 'text/csv' # NOTE: this should be a streaming service but currently # I see no way to know the full set of keys with...
agpl-3.0
Python
ab35f508375c760770884882acaea79079a1a976
remove unnesecary print
natemara/python-erlang
erlang/__init__.py
erlang/__init__.py
from __future__ import division def extended_b_lines(usage, blocking): ''' Uses the Extended Erlang B formula to calcluate the ideal number of lines for the given usage in erlangs and the given blocking rate. Usage: extended_b_lines(usage, blocking) ''' line_count = 1 while extended_b(usage, line_count) > b...
from __future__ import division def extended_b_lines(usage, blocking): ''' Uses the Extended Erlang B formula to calcluate the ideal number of lines for the given usage in erlangs and the given blocking rate. Usage: extended_b_lines(usage, blocking) ''' line_count = 1 while extended_b(usage, line_count) > b...
mit
Python
c40a07e4ba1bfefd977bc9eea71abe5fcaf97370
Use custom exception in place of NotImplemented
gwhigs/digital-manifesto,gwhigs/digital-manifesto,gwhigs/digital-manifesto,gwhigs/digital-manifesto
manifestos/twitter.py
manifestos/twitter.py
import re from django.conf import settings import tweepy TWITTER_CONSUMER_KEY = settings.TWITTER_CONSUMER_KEY TWITTER_CONSUMER_SECRET = settings.TWITTER_CONSUMER_SECRET TWITTER_ACCESS_KEY = settings.TWITTER_ACCESS_KEY TWITTER_ACCESS_SECRET = settings.TWITTER_ACCESS_SECRET class TwitterBotException(Exception): p...
import re from django.conf import settings import tweepy TWITTER_CONSUMER_KEY = settings.TWITTER_CONSUMER_KEY TWITTER_CONSUMER_SECRET = settings.TWITTER_CONSUMER_SECRET TWITTER_ACCESS_KEY = settings.TWITTER_ACCESS_KEY TWITTER_ACCESS_SECRET = settings.TWITTER_ACCESS_SECRET class TwitterBot(object): """ Creat...
mit
Python
4b4b689463c0e6d0db783a10fcf74b21fea60a68
Fix double repr.
nex3/pygments,Khan/pygments,dbrgn/pygments-mirror,dbrgn/pygments-mirror,kirbyfan64/pygments-unofficial,dbrgn/pygments-mirror,nex3/pygments,dbrgn/pygments-mirror,nsfmc/pygments,nsfmc/pygments,nsfmc/pygments,kirbyfan64/pygments-unofficial,Khan/pygments,kirbyfan64/pygments-unofficial,Khan/pygments,nsfmc/pygments,dbrgn/pyg...
pygments/formatters/other.py
pygments/formatters/other.py
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: 2006 by Georg Brandl, Armin Ronacher. :license: BSD, see LICENSE for more details. """ from pygments.formatter import Formatter __all__ = ['NullFormatt...
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: 2006 by Georg Brandl, Armin Ronacher. :license: BSD, see LICENSE for more details. """ from pygments.formatter import Formatter __all__ = ['NullFormatt...
bsd-2-clause
Python
2a7aee189dff539fe3cf8049319a2b09c6a0fbb1
add new filter to dataset config
matthias-k/pysaliency,matthias-k/pysaliency
pysaliency/dataset_config.py
pysaliency/dataset_config.py
from .datasets import read_hdf5 from .filter_datasets import ( filter_fixations_by_number, filter_stimuli_by_number, filter_stimuli_by_size, train_split, validation_split, test_split ) from schema import Schema, Optional dataset_config_schema = Schema({ 'stimuli': str, 'fixations': st...
from .datasets import read_hdf5 from .filter_datasets import filter_fixations_by_number, filter_stimuli_by_number, train_split, validation_split, test_split from schema import Schema, Optional dataset_config_schema = Schema({ 'stimuli': str, 'fixations': str, Optional('filters', default=[]): [{ '...
mit
Python
46e21ff57d47f1860d639972dc4eed1994a6cd50
remove print statements
crowd-course/scholars,crowd-course/scholars,crowd-course/scholars
scholars/authentication/pipeline.py
scholars/authentication/pipeline.py
import hashlib from social_core.exceptions import AuthAlreadyAssociated, AuthException def auto_logout(*args, **kwargs): """Do not compare current user with new one""" return {'user': None} def check_email_present(backend, uid, user=None, *args, **kwargs): if not kwargs['details'].get('email'): ...
import hashlib from social_core.exceptions import AuthAlreadyAssociated, AuthException def auto_logout(*args, **kwargs): """Do not compare current user with new one""" return {'user': None} def check_email_present(backend, uid, user=None, *args, **kwargs): if not kwargs['details'].get('email'): ...
mit
Python
28917935e5086ff6a03964babbb5c2e09957b582
Bump version
thombashi/pytablewriter
pytablewriter/__version__.py
pytablewriter/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.47.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.46.3" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
f5b8b4bafabc06504e2ee2e0571f2d8571db17bb
Update for v1.5.4
maxmind/MaxMind-DB-Reader-python,maxmind/MaxMind-DB-Reader-python,maxmind/MaxMind-DB-Reader-python
maxminddb/__init__.py
maxminddb/__init__.py
# pylint:disable=C0111 import os import maxminddb.reader try: import maxminddb.extension except ImportError: maxminddb.extension = None from maxminddb.const import ( MODE_AUTO, MODE_MMAP, MODE_MMAP_EXT, MODE_FILE, MODE_MEMORY, MODE_FD, ) from maxminddb.decoder import InvalidDatabaseEr...
# pylint:disable=C0111 import os import maxminddb.reader try: import maxminddb.extension except ImportError: maxminddb.extension = None from maxminddb.const import ( MODE_AUTO, MODE_MMAP, MODE_MMAP_EXT, MODE_FILE, MODE_MEMORY, MODE_FD, ) from maxminddb.decoder import InvalidDatabaseEr...
apache-2.0
Python
5f9da62f28e61636f33495058f3ea4a98a9d3c19
add invalid separators to test
geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend
tests/inside_worker_test/cast_to_float_or_null_test.py
tests/inside_worker_test/cast_to_float_or_null_test.py
import pytest import sqlalchemy from tests.inside_worker_test.conftest import slow @pytest.fixture(params=[2, 2.2, 3.898986, 0.6, 0]) def valid_float_representation(request): return request.param @pytest.fixture(params=["a2", "10b", "3.898986c", "3d.898986", "e6.9", "f0,9" "0,g9" "0,9h", "0,6", "123'456", "1 2...
import pytest import sqlalchemy from tests.inside_worker_test.conftest import slow @pytest.fixture(params=[2, 2.2, 3.898986, "3.898986", "6", "0.2", 0.6]) def valid_float_representation(request): return request.param @pytest.fixture(params=["a2", "10b", "3.898986k", "3k.898986", "l6.9"]) def invalid_floats(req...
mit
Python
b3e1b6bd9f79427142ebfe4b57892d1cf3a89e86
Implement the latest test spec for update which requires most of the parameters found in an example usage of mlab-ns against npad.
m-lab/ooni-support,hellais/ooni-support,m-lab/ooni-support,hellais/ooni-support
mlab-ns-simulator/mlabsim/update.py
mlab-ns-simulator/mlabsim/update.py
""" This approximates the mlab-ns slice information gathering. The actual system uses nagios and we're not certain about the details. This much simplified version is just a web URL anyone may PUT data into. Warning: This doesn't have any security properties! We need a way to prevent the addition of malicious entrie...
""" This approximates the mlab-ns slice information gathering. The actual system uses nagios and we're not certain about the details. This much simplified version is just a web URL anyone may PUT data into. Warning: This doesn't have any security properties! We need a way to prevent the addition of malicious entrie...
apache-2.0
Python
45a24fae9f5e1ee24c2e0283746224e51f718cc2
Remove redundant test of permissions parameter
simonjbeaumont/planex,djs55/planex,simonjbeaumont/planex,djs55/planex,simonjbeaumont/planex,djs55/planex
planex/tree.py
planex/tree.py
""" In-memory 'filesystem' library """ import os class Tree(object): """ An in-memory 'filesystem' which accumulates file changes to be written later. """ def __init__(self): self.tree = {} def append(self, filename, contents=None, permissions=None): """ Append conten...
""" In-memory 'filesystem' library """ import os class Tree(object): """ An in-memory 'filesystem' which accumulates file changes to be written later. """ def __init__(self): self.tree = {} def append(self, filename, contents=None, permissions=None): """ Append conten...
lgpl-2.1
Python
7ad7f0231bc50c58f9b606cbab36d6cd98e141ec
Make the error message clearer (#944)
akaszynski/vtkInterface
pyvista/plotting/__init__.py
pyvista/plotting/__init__.py
"""Plotting routines.""" from .colors import (color_char_to_word, get_cmap_safe, hex_to_rgb, hexcolors, string_to_rgb, PARAVIEW_BACKGROUND) from .export_vtkjs import export_plotter_vtkjs, get_vtkjs_url from .helpers import plot, plot_arrows, plot_compare_four, plot_itk from .itkplotter import Plot...
"""Plotting routines.""" from .colors import (color_char_to_word, get_cmap_safe, hex_to_rgb, hexcolors, string_to_rgb, PARAVIEW_BACKGROUND) from .export_vtkjs import export_plotter_vtkjs, get_vtkjs_url from .helpers import plot, plot_arrows, plot_compare_four, plot_itk from .itkplotter import Plot...
mit
Python
f53e7452676e6ee903a4d8c350fa356a718a5fcc
Add a test for file: and path: searches for non-ASCII things.
pelmers/dxr,pelmers/dxr,pelmers/dxr,pelmers/dxr,pelmers/dxr,pelmers/dxr,pelmers/dxr
tests/test_path_file_filters/test_path_file_filters.py
tests/test_path_file_filters/test_path_file_filters.py
# -*- coding: utf-8 -*- from nose.tools import raises from dxr.testing import DxrInstanceTestCase class PathAndFileFilterTests(DxrInstanceTestCase): """Basic tests for functionality of the 'path:' and 'file:' filters""" def test_basic_path_results(self): """Check that a 'path:' result includes both ...
from nose.tools import raises from dxr.testing import DxrInstanceTestCase class PathAndFileFilterTests(DxrInstanceTestCase): """Basic tests for functionality of the 'path:' and 'file:' filters""" def test_basic_path_results(self): """Check that a 'path:' result includes both file and folder matches....
mit
Python
d22bd8970b973fb58f1358b62cf8c27f826aa407
update example
hhatto/pgmagick,hhatto/pgmagick,hhatto/pgmagick
example/gravity.py
example/gravity.py
from pgmagick import Image, Geometry, Color, TypeMetric, \ DrawableText, DrawableList, DrawableGravity, GravityType im = Image(Geometry(600, 600), Color("transparent")) im.fontPointsize(30) im.fillColor(Color("#f010f0")) im.strokeColor(Color("transparent")) im.font("Vera.ttf") dl = DrawableList()...
from pgmagick import Image, Geometry, Color, TypeMetric, \ DrawableText, DrawableList, DrawableGravity, GravityType im = Image(Geometry(600, 600), Color("transparent")) im.fontPointsize(30) im.fillColor(Color("#f010f0")) im.strokeColor(Color("transparent")) im.font("Vera.ttf") dl = DrawableList()...
mit
Python
73e99078b3bce587e059b1a15dbb7f94be70dd8d
enable the possibility of success
open-power/op-test-framework,open-power/op-test-framework,open-power/op-test-framework
testcases/OpalMsglog.py
testcases/OpalMsglog.py
#!/usr/bin/python2 # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # 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...
#!/usr/bin/python2 # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # 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...
apache-2.0
Python
6cb0822aade07999d54e5fcd19eb2c7322abc80a
Improve performance @ Measurement Admin
sigurdsa/angelika-api
measurement/admin.py
measurement/admin.py
from django.contrib import admin from .models import Measurement class MeasurementAdmin(admin.ModelAdmin): model = Measurement def get_queryset(self, request): return super(MeasurementAdmin, self).get_queryset(request).select_related('patient__user') admin.site.register(Measurement, MeasurementAdmin...
from django.contrib import admin from .models import Measurement admin.site.register(Measurement)
mit
Python
24b2509b1605dfd6d3eb325ed946c3d23441b969
use Python's QT stuff
visionegg/visionegg,visionegg/visionegg,visionegg/visionegg,visionegg/visionegg,visionegg/visionegg
demo/quicktime.py
demo/quicktime.py
#!/usr/bin/env python """Display quicktime movie.""" import os, sys import VisionEgg from VisionEgg.Core import * from VisionEgg.Text import * from VisionEgg.Textures import * from VisionEgg.QuickTime import new_movie_from_filename, MovieTexture screen = get_default_screen() screen.set(bgcolor=(0,0,0)) if len(sys.ar...
#!/usr/bin/env python """Display quicktime movie.""" import os import VisionEgg from VisionEgg.Core import * from VisionEgg.Text import * from VisionEgg.Textures import * from VisionEgg.QuickTime import * screen = get_default_screen() screen.set(bgcolor=(0,0,0)) filename = os.path.join(VisionEgg.config.VISIONEGG_SYS...
lgpl-2.1
Python
c92caa1f00c984cf839ccf7c645d207e100eb874
Add test_invalid_image to test_image_validation module
mozilla-services/pageshot,mozilla-services/screenshots,mozilla-services/screenshots,mozilla-services/pageshot,mozilla-services/screenshots,mozilla-services/pageshot,mozilla-services/pageshot,mozilla-services/screenshots
test/server/test_image_validation.py
test/server/test_image_validation.py
from urlparse import urljoin from clientlib import ( make_example_shot, make_random_id, screenshots_session, example_images ) import random, string # Hack to make this predictable: random.seed(0) def test_invalid_image_url(): with screenshots_session() as user: shot_id = make_random_id() ...
from urlparse import urljoin from clientlib import ( make_example_shot, make_random_id, screenshots_session, example_images ) import random # Hack to make this predictable: random.seed(0) def test_invalid_image_url(): with screenshots_session() as user: shot_id = make_random_id() + "/test...
mpl-2.0
Python
33121b74419e9913e46e183914805d4a9db8f742
fix test to look for email instead of username
nicole-a-tesla/meetup.pizza,nicole-a-tesla/meetup.pizza
meetuppizza/tests.py
meetuppizza/tests.py
from django.test import TestCase from django.contrib.auth.models import User from django.test import Client from meetuppizza.forms import RegistrationForm import pdb class Test(TestCase): def setUp(self): self.params = { 'username':'Bjorn', 'email':'bjorn@bjorn.com', 'password1':'bjornbjor...
from django.test import TestCase from django.contrib.auth.models import User from django.test import Client from meetuppizza.forms import RegistrationForm import pdb class Test(TestCase): def setUp(self): self.params = { 'username':'Bjorn', 'email':'bjorn@bjorn.com', 'password1':'bjornbjor...
mit
Python
bf4cf008fb8eadd5a0b8b23a330a49fdea272314
Convert exception to string
Kitware/cumulus,Kitware/cumulus
tests/cases/cloud_provider_test.py
tests/cases/cloud_provider_test.py
import unittest import os from cumulus.ansible.tasks.providers import CloudProvider, EC2Provider class CloudProviderTestCase(unittest.TestCase): def setup(self): pass def tearDown(self): pass def test_empty_profile(self): with self.assertRaises(AssertionError) as context: ...
import unittest import os from cumulus.ansible.tasks.providers import CloudProvider, EC2Provider class CloudProviderTestCase(unittest.TestCase): def setup(self): pass def tearDown(self): pass def test_empty_profile(self): with self.assertRaises(AssertionError) as context: ...
apache-2.0
Python
0ac1cdfd59199d3c36ddbccc7c5004261b57f7be
Add api.python.failing_step
shishkander/recipes-py,shishkander/recipes-py,luci/recipes-py,luci/recipes-py
recipe_modules/python/api.py
recipe_modules/python/api.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. from slave import recipe_api from slave import recipe_util import textwrap class PythonApi(recipe_api.RecipeApi): def __call__(self, name, script, args=N...
# 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. from slave import recipe_api from slave import recipe_util import textwrap class PythonApi(recipe_api.RecipeApi): def __call__(self, name, script, args=N...
bsd-3-clause
Python
b1653d7a9589766a86141034865d9023b1f75fad
Fix as_tensor_test
ajbouh/tfi
tests/as_tensor_test.py
tests/as_tensor_test.py
import unittest from tfi.as_tensor import as_tensor from functools import partialmethod class AsTensorTest(unittest.TestCase): pass _FIXTURES = [ ('string', 'string', [], str, 'string'), ('list', ['string'], [None], str, ['string']), ('list', ['string'], [1], str, ['string']), ('generator', (s f...
import unittest from as_tensor import as_tensor class AsTensorTest(unittest.TestCase): pass _FIXTURES = [ ('string', 'string', [], 'string'), ('list', ['string'], [None], ['string']), ('list', ['string'], [1], ['string']), ('generator', (s for s in ['string']), [1], ['string']), ('emptylist',...
mit
Python
55726db079313570fb9889ae91a4664f2e2daa98
add buttons to choose task
mesenev/top_bot_lyceum
methods/homeworks.py
methods/homeworks.py
from enum import Enum, auto from telegram.ext import CommandHandler, MessageHandler, Filters from telegram.ext.conversationhandler import ConversationHandler from telegram.message import Message from telegram.replykeyboardmarkup import ReplyKeyboardMarkup from telegram.update import Update from lyceum_api import get_c...
from enum import Enum, auto from telegram.ext import CommandHandler, MessageHandler, Filters from telegram.ext.conversationhandler import ConversationHandler from telegram.message import Message from telegram.update import Update from lyceum_api import get_check_queue from lyceum_api.issue import QueueTask from method...
mit
Python
fd61f3cfbcd520b1b5fc9208c553ee946cced517
Remove duplicates from compression levels tests
python-lz4/python-lz4,python-lz4/python-lz4
tests/frame/conftest.py
tests/frame/conftest.py
import pytest # import random import lz4.frame as lz4frame @pytest.fixture( params=[ (lz4frame.BLOCKSIZE_DEFAULT), (lz4frame.BLOCKSIZE_MAX64KB), (lz4frame.BLOCKSIZE_MAX256KB), (lz4frame.BLOCKSIZE_MAX1MB), (lz4frame.BLOCKSIZE_MAX4MB), ] ) def block_size(request): retu...
import pytest # import random import lz4.frame as lz4frame @pytest.fixture( params=[ (lz4frame.BLOCKSIZE_DEFAULT), (lz4frame.BLOCKSIZE_MAX64KB), (lz4frame.BLOCKSIZE_MAX256KB), (lz4frame.BLOCKSIZE_MAX1MB), (lz4frame.BLOCKSIZE_MAX4MB), ] ) def block_size(request): retu...
bsd-3-clause
Python
1c6ed4130baacf0d0f662b6aa056630dd7fd383d
Fix vocab splitting
psmit/kaldi-recipes,psmit/kaldi-recipes,phsmit/kaldi-recipes,psmit/kaldi-recipes,phsmit/kaldi-recipes
spraakbanken/s5/spr_local/make_recog_vocab.py
spraakbanken/s5/spr_local/make_recog_vocab.py
#!/usr/bin/env python3 import sys import collections def main(in_vocab, size, out_vocab,): counter = collections.Counter() size = int(size) for line in open(in_vocab, encoding='utf-8'): word, count = line.rstrip("\n").split(" ") if any(x.isdigit() for x in word): continue ...
#!/usr/bin/env python3 import sys import collections def main(in_vocab, size, out_vocab,): counter = collections.Counter() size = int(size) for line in open(in_vocab, encoding='utf-8'): word, count = line.strip().split() if any(x.isdigit() for x in word): continue p...
apache-2.0
Python
7be728d551d7d2becd70b575f95facbbd561e69b
Add latest version of libsigsegv (#3449)
iulian787/spack,krafczyk/spack,skosukhin/spack,krafczyk/spack,tmerrick1/spack,krafczyk/spack,EmreAtes/spack,krafczyk/spack,TheTimmy/spack,LLNL/spack,mfherbst/spack,lgarren/spack,EmreAtes/spack,TheTimmy/spack,EmreAtes/spack,matthiasdiener/spack,lgarren/spack,TheTimmy/spack,EmreAtes/spack,matthiasdiener/spack,tmerrick1/s...
var/spack/repos/builtin/packages/libsigsegv/package.py
var/spack/repos/builtin/packages/libsigsegv/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
20a89ca326712058f3f22621eed725c0f510bee3
Add branch with bugfix (#8355)
mfherbst/spack,iulian787/spack,mfherbst/spack,krafczyk/spack,tmerrick1/spack,krafczyk/spack,tmerrick1/spack,mfherbst/spack,iulian787/spack,iulian787/spack,matthiasdiener/spack,iulian787/spack,tmerrick1/spack,LLNL/spack,krafczyk/spack,matthiasdiener/spack,LLNL/spack,krafczyk/spack,tmerrick1/spack,mfherbst/spack,matthias...
var/spack/repos/builtin/packages/meraculous/package.py
var/spack/repos/builtin/packages/meraculous/package.py
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
5d608a855132f0a378e44b3c0c7dbba1f4f4dace
fix corehq.messaging.smsbackends.twilio.tests.test_log_call:TwilioLogCallTestCase.test_log_call
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/messaging/smsbackends/twilio/tests/test_log_call.py
corehq/messaging/smsbackends/twilio/tests/test_log_call.py
from __future__ import absolute_import from __future__ import unicode_literals import corehq.apps.ivr.tests.util as util from corehq.apps.ivr.models import Call from corehq.messaging.smsbackends.twilio.models import SQLTwilioBackend from corehq.messaging.smsbackends.twilio.views import IVR_RESPONSE from django.test imp...
from __future__ import absolute_import from __future__ import unicode_literals import corehq.apps.ivr.tests.util as util from corehq.apps.ivr.models import Call from corehq.messaging.smsbackends.twilio.models import SQLTwilioBackend from corehq.messaging.smsbackends.twilio.views import IVR_RESPONSE from django.test imp...
bsd-3-clause
Python
968f0f3d41a546c4c6614d24be3e077ba1ee37b9
Reorganiza imports de xml_utils
scieloorg/packtools,scieloorg/packtools,scieloorg/packtools
packtools/sps/utils/xml_utils.py
packtools/sps/utils/xml_utils.py
import logging import re from copy import deepcopy from lxml import etree from packtools.sps import exceptions from packtools.sps.utils import file_utils logger = logging.getLogger(__name__) class LoadToXMLError(Exception): ... def fix_xml(xml_str): return fix_namespace_prefix_w(xml_str) def fix_namesp...
import logging import re from lxml import etree from dsm.utils.files import read_file logger = logging.getLogger(__name__) class LoadToXMLError(Exception): ... def fix_xml(xml_str): return fix_namespace_prefix_w(xml_str) def fix_namespace_prefix_w(content): """ Convert os textos cujo padrão é `...
bsd-2-clause
Python
713fd67b4aa0d3a614ca149f86deeb2d5e913d12
fix installation on linux (#24706)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/py-keyring/package.py
var/spack/repos/builtin/packages/py-keyring/package.py
# Copyright 2013-2021 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 PyKeyring(PythonPackage): """The Python keyring library provides an easy way to access the...
# Copyright 2013-2021 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 PyKeyring(PythonPackage): """The Python keyring library provides an easy way to access the...
lgpl-2.1
Python
f06a4689fab32d7d2f4c848019978665656a5cdf
Implement hexfile record types used by GNU ld
thotypous/mikroe-uhb
mikroeuhb/hexfile.py
mikroeuhb/hexfile.py
import struct, logging from binascii import unhexlify from util import bord logger = logging.getLogger(__name__) def load(f, devkit): """Load a Intel HEX File from a file object into a devkit. The devkit must implement a write(address,data) method.""" lineno = 0 base_addr = 0 for line in f.xread...
import struct, logging from binascii import unhexlify from util import bord logger = logging.getLogger(__name__) def load(f, devkit): """Load a Intel HEX File from a file object into a devkit. The devkit must implement a write(address,data) method.""" lineno = 0 base_addr = 0 for line in f.xread...
mit
Python
b9b3837937341e6b1b052bbfdd979e3bb57d87c4
Fix SSL security provider integration tests
rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective,rafaduran/python-mcollective
tests/integration/test_with_ssl.py
tests/integration/test_with_ssl.py
import os from pymco.test import ctxt from . import base FIXTURES_PATH = os.path.join(ctxt.ROOT, 'fixtures') class SSLTestCase(base.IntegrationTestCase): '''RabbitMQ integration test case.''' CTXT = { 'plugin.activemq.pool.1.port': 61614, 'plugin.activemq.pool.1.password': 'marionette', ...
from . import base class SSLTestCase(base.IntegrationTestCase): '''RabbitMQ integration test case.''' CTXT = { 'plugin.activemq.pool.1.port': 61614, 'plugin.activemq.pool.1.password': 'marionette', 'plugin.ssl_server_public': 'tests/fixtures/server-public.pem', 'plugin.ssl_clie...
bsd-3-clause
Python
dcc07355786f94da36d938239c5c60d5302e4d42
test for identity link
dandesousa/drf-collection-json
testapp/tests/test_renderer_infer.py
testapp/tests/test_renderer_infer.py
#!/usr/bin/env python # encoding: utf-8 from django.test import TestCase from collection_json import Collection from testapp.models import Person try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse class DictionaryTest(TestCase): """tests when the response contains a...
#!/usr/bin/env python # encoding: utf-8 from django.test import TestCase from collection_json import Collection from testapp.models import Person class DictionaryTest(TestCase): """tests when the response contains a dictionary""" def test_no_serializer_view(self): with self.assertRaises(TypeError): ...
cc0-1.0
Python
943ecc39af2b152bc8d5fed55bdafe5332a33d75
remove xfail (#4458)
kubeflow/kubeflow,kubeflow/kubeflow,kubeflow/kubeflow,kubeflow/kubeflow,kubeflow/kubeflow,kubeflow/kubeflow
testing/kfctl/endpoint_ready_test.py
testing/kfctl/endpoint_ready_test.py
import datetime import json import logging import os import subprocess import tempfile import uuid from retrying import retry import pytest from kubeflow.testing import util from testing import deploy_utils from testing import gcp_util # There's really no good reason to run test_endpoint during presubmits. # We shou...
import datetime import json import logging import os import subprocess import tempfile import uuid from retrying import retry import pytest from kubeflow.testing import util from testing import deploy_utils from testing import gcp_util # TODO(https://github.com/kubeflow/kfctl/issues/42): # Test is failing pretty con...
apache-2.0
Python
291681041f434a981a54371bb7f9f1fa9637afb7
improve comment collapse
dresl/django_choice_and_question,dresl/django_choice_and_question
polls/admin.py
polls/admin.py
from django.contrib import admin from polls.models import Choice, Question class ChoiceInline(admin.TabularInline): model = Choice extra = 3 class QuestionAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['question_text']}), ('Date information', {'fields': ['pub_date'...
from django.contrib import admin from polls.models import Choice, Question class ChoiceInline(admin.TabularInline): model = Choice extra = 3 class QuestionAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['question_text']}), ('Date information', {'fields': ['pub_date'...
apache-2.0
Python
05e496de4f6ebbb9e77c6cb1796cc1050a41a181
Adjust whitespace for pep8
tswicegood/wsgi-pratchett
pratchett/__init__.py
pratchett/__init__.py
HEADER = ("X-Clacks-Overhead", "GNU Terry Pratchett") class GNUTerryPratchett(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): def clacker(status, headers, *args, **kwargs): if HEADER not in headers: headers.append(HEADE...
HEADER = ("X-Clacks-Overhead", "GNU Terry Pratchett") class GNUTerryPratchett(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): def clacker(status, headers, *args, **kwargs): if HEADER not in headers: headers.append(HEADE...
apache-2.0
Python
ddb4ed6701808ed5c4e928d042b84e0c84490e58
Bump version 0.0.4
gengo/memsource-wrap,gengo/memsource-wrap
memsource/__init__.py
memsource/__init__.py
__author__ = 'Gengo' __version__ = '0.0.4' __license__ = 'MIT'
__author__ = 'Gengo' __version__ = '0.0.3' __license__ = 'MIT'
mit
Python
949c7b55e295b4d87f2d7a1bb98242cb055129d1
Solve No.140 in Python with problems
jonathanxqs/lintcode,jonathanxqs/lintcode
140.py
140.py
class Solution: """ @param a, b, n: 32bit integers @return: An integer """ def fastPower(self, a, b, n): ans = 1 while b > 0: if b % 2==1: ans = ans * a % n a = a * a % n b = b / 2 return ans % n # WA because of l...
class Solution: """ @param a, b, n: 32bit integers @return: An integer """ def fastPower(self, a, b, n): ans = 1 while b > 0: if b % 2==1: ans = ans * a % n a = a * a % n b = b / 2 return ans % n # WA
mit
Python
d10bb3695ee93ffd8b91d4d82adaf484de9e9bf1
Rename NeuronNetwork to NeuralNetwork
tysonzero/py-ann
ANN.py
ANN.py
from random import uniform class Neuron: def __init__(self, parents=[]): self.parents = [{ 'neuron': parent, 'weight': uniform(-1, 1), 'slope': uniform(-1, 1), } for parent in parents] def calculate(self, increment=0): self.output = sum([parent['neu...
from random import uniform class Neuron: def __init__(self, parents=[]): self.parents = [{ 'neuron': parent, 'weight': uniform(-1, 1), 'slope': uniform(-1, 1), } for parent in parents] def calculate(self, increment=0): self.output = sum([parent['neu...
mit
Python
4f219c4a05a251d9958543d24891955d640bc07f
Add more realistic responses for audit logs in tests.
fulcrumapp/fulcrum-python
tests/test_audit_log.py
tests/test_audit_log.py
import httpretty from fulcrum.exceptions import NotFoundException, InternalServerErrorException from tests import FulcrumTestCase from tests.valid_objects import form as valid_form class AuditLogTest(FulcrumTestCase): @httpretty.activate def test_all(self): httpretty.register_uri(httpretty.GET, self...
import httpretty from fulcrum.exceptions import NotFoundException, InternalServerErrorException from tests import FulcrumTestCase from tests.valid_objects import form as valid_form class AuditLogTest(FulcrumTestCase): @httpretty.activate def test_all(self): httpretty.register_uri(httpretty.GET, self...
apache-2.0
Python
f2cc74d79abf42c0f199c48ef9110bce6cec45b4
Update alcatel_sros_ssh.py
jumpojoy/netmiko,isidroamv/netmiko,ktbyers/netmiko,fooelisa/netmiko,rdezavalia/netmiko,rdezavalia/netmiko,ktbyers/netmiko,shamanu4/netmiko,shamanu4/netmiko,fooelisa/netmiko,isidroamv/netmiko,jumpojoy/netmiko,shsingh/netmiko,shsingh/netmiko
netmiko/alcatel/alcatel_sros_ssh.py
netmiko/alcatel/alcatel_sros_ssh.py
''' Alcatel-Lucent SROS support ''' from netmiko.ssh_connection import SSHConnection class AlcatelSrosSSH(SSHConnection): ''' SROS support ''' def session_preparation(self): self.disable_paging(command="environment no more\n") def enable(self): pass
''' Alcatel-Lucent SROS support ''' from netmiko.ssh_connection import SSHConnection class AlcatelSrosSSH(SSHConnection): ''' SROS support ''' def session_preparation(self): self.disable_paging(command="\environment no more\n") def enable(self): pass
mit
Python
91ff2ed96dc3ba197f71be935ac23796d40ef5dc
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/812a20bfa97f7b56eb3340c2f75358db58483974.
Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,gautam1858/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,te...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "812a20bfa97f7b56eb3340c2f75358db58483974" TFRT_SHA256 = "8235d34c674a842fb08f5fc7f7b6136a1af1dbb20a2ec7...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "c442a283246c2060d139d4cadb0f8ff59ee7e7da" TFRT_SHA256 = "649107aabf7a242678448c44d4a51d5355904222de7d45...
apache-2.0
Python
49ad9b8162a9113f3c4c69818553de2cb6bf66df
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/da541333433f74881d8f44947369756d40d5e7fe.
tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_stat...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "da541333433f74881d8f44947369756d40d5e7fe" TFRT_SHA256 = "df492c902908141405e88af81c4b...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "bdb99de6e7e5fcd5a7e55895bb1c658ea0336136" TFRT_SHA256 = "a251c274cf0bbd805e221677cf49...
apache-2.0
Python
be0e9cf9a195f44a033bb8b3aeb13febf3cea9cf
Remove check in token credential (#14134)
yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/storage/oauth_token_util.py
src/azure-cli/azure/cli/command_modules/storage/oauth_token_util.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
Python
a8a0e24d9ee90676601a52c564eadb7ff264d5cd
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/356740e3a2bf884abd27b2ca362fe8108a7cd257.
karllessard/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,sarvex/tensorflow,yongtang/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,tensorflow/...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "356740e3a2bf884abd27b2ca362fe8108a7cd257" TFRT_SHA256 = "c5c806b5f5acb345eca8db4bc49053df60d0b368193f5b...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "b570a1921c9e55ac53c8972bd2bfd37cd0eb510d" TFRT_SHA256 = "01295fc2a90aa2d665890adbe8701e2ae2372028d3b826...
apache-2.0
Python
ce977d24d49b7e03b6db5b5590e8fc0ddf8e9127
fix the deploy order in the daemon. closes #862
nprapps/elections14,nprapps/elections14,nprapps/elections14,nprapps/elections14
fabfile/daemons.py
fabfile/daemons.py
#!/usr/bin/env python from time import sleep, time from fabric.api import execute, task, env import app_config import sys import traceback def safe_execute(*args, **kwargs): """ Wrap execute() so that all exceptions are caught and logged. """ try: execute(*args, **kwargs) except: ...
#!/usr/bin/env python from time import sleep, time from fabric.api import execute, task, env import app_config import sys import traceback def safe_execute(*args, **kwargs): """ Wrap execute() so that all exceptions are caught and logged. """ try: execute(*args, **kwargs) except: ...
mit
Python
7e95e0b8adb4315c8f8a0c5aa8c6ccc588cbee18
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0d8bae2de531db2e4e4efd3a4e168b39795458b9.
tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,tensorflo...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "0d8bae2de531db2e4e4efd3a4e168b39795458b9" TFRT_SHA256 = "fa7cd1e72eec99562bf916e07122...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "4b2fe81ea82e4c33783b5b62973fbe84dbc6f484" TFRT_SHA256 = "f0e6e0fd3e5245d993cd4146d824...
apache-2.0
Python
e2d066811a5e943600c170aba0cf797c104d1588
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/5f6e52142a3592d0cfa058dbfd140cad49ed451a.
google/tsl,google/tsl,google/tsl
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "5f6e52142a3592d0cfa058dbfd140cad49ed451a" TFRT_SHA256 = "8e1efbd7df0fdeb5186b178d7c8b...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "736eeebfb56c6d0de138f4a29286140d8c26d927" TFRT_SHA256 = "b584ee5ce5ecaadf289b0997987d...
apache-2.0
Python
a70e0abdf409d770ddbb9faf3cc66c26fc03b076
fix fbproject tests following new pystan version
Kaggle/docker-python,Kaggle/docker-python
tests/test_fbprophet.py
tests/test_fbprophet.py
import unittest import numpy as np import pandas as pd from fbprophet import Prophet class TestFbProphet(unittest.TestCase): def test_fit(self): train = pd.DataFrame({ 'ds': np.array(['2012-05-18', '2012-05-20']), 'y': np.array([38.23, 21.25]) }) forecaster = Prop...
import unittest import numpy as np import pandas as pd from fbprophet import Prophet class TestFbProphet(unittest.TestCase): def test_fit(self): train = pd.DataFrame({ 'ds': np.array(['2012-05-18', '2012-05-20']), 'y': np.array([38.23, 21.25]) }) forecaster = Prop...
apache-2.0
Python
7461c7b6b729c38194ebb5e88b33e7bcc73b4c9c
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/53604b1779bdbea70bed75fe1695b503e06be323.
tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,karllessard/tensorflow,t...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "53604b1779bdbea70bed75fe1695b503e06be323" TFRT_SHA256 = "b2ce14585f2707ec56b013323fde0ff10ddecdf608854d...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "1c915c952cea8e5d290d241b3a0178856a9ec35b" TFRT_SHA256 = "97f8ad0010b924f8489ca04e8e5aa5aea4a69013293e65...
apache-2.0
Python
0fe76a38aff965aca9f672b48ed4a4933ee10161
add an argument taskid to EventLoopProgressReportWriter.write()
TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl
AlphaTwirl/EventReader/EventLoopProgressReportWriter.py
AlphaTwirl/EventReader/EventLoopProgressReportWriter.py
# Tai Sakuma <tai.sakuma@cern.ch> from AlphaTwirl.ProgressBar import ProgressReport ##____________________________________________________________________________|| class EventLoopProgressReportWriter(object): def write(self, taskid, component, event): return ProgressReport( name = component.na...
# Tai Sakuma <tai.sakuma@cern.ch> from AlphaTwirl.ProgressBar import ProgressReport ##____________________________________________________________________________|| class EventLoopProgressReportWriter(object): def write(self, component, event): return ProgressReport(name = component.name, done = event.iEve...
bsd-3-clause
Python
662cc443f7c32182aaef89e5b61e90797b7e3e58
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/81d27bd006f86cc3fd3d78a7193583ab9d18367a.
tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,yongtang/tensorflow,Intel-tensorflow/tensorflow,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow,paolodedios/tens...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "81d27bd006f86cc3fd3d78a7193583ab9d18367a" TFRT_SHA256 = "f7cafc8d2b512ff3be61dc5a3d8a3a5bcc3e749b213c1a...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "bd4c5dc54997aaffe6f37a802b106c3ac88f150f" TFRT_SHA256 = "a3ee3c259c5d7ea631177a75195b35bbfb695d69ad70ad...
apache-2.0
Python
f0d76cae236cded0bfa6cc0f6486efb04daeb133
convert latency to int before posting to cbmonitor
couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner
cbagent/collectors/secondary_latency.py
cbagent/collectors/secondary_latency.py
import os.path from cbagent.collectors import Collector class SecondaryLatencyStats(Collector): COLLECTOR = "secondaryscan_latency" def _get_secondaryscan_latency(self): stats = {} if os.path.isfile(self.secondary_statsfile): with open(self.secondary_statsfile, 'rb') as fh: ...
import os.path from cbagent.collectors import Collector class SecondaryLatencyStats(Collector): COLLECTOR = "secondaryscan_latency" def _get_secondaryscan_latency(self): stats = {} if os.path.isfile(self.secondary_statsfile): with open(self.secondary_statsfile, 'rb') as fh: ...
apache-2.0
Python
69c9322827ed95ce845b49119bc58aa4f36d82bb
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ecf8607212b519546828e3fcc66f68985597a622.
gautam1858/tensorflow,Intel-Corporation/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-C...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "ecf8607212b519546828e3fcc66f68985597a622" TFRT_SHA256 = "545c097a241ff80701e54d1e088762f27a7494980f01c0...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "078534d79809852ea069d23bbacd2483ade18c11" TFRT_SHA256 = "55905ff389c5294ac1ce4be5e3f0af2d171e6061aa886f...
apache-2.0
Python
66284e57accec5977d606fc91a0b28177b352eb4
Add end-to-end integration testing for all compression types
dpkp/kafka-python,ohmu/kafka-python,Yelp/kafka-python,ohmu/kafka-python,zackdever/kafka-python,Aloomaio/kafka-python,DataDog/kafka-python,Aloomaio/kafka-python,wikimedia/operations-debs-python-kafka,mumrah/kafka-python,scrapinghub/kafka-python,mumrah/kafka-python,dpkp/kafka-python,Yelp/kafka-python,scrapinghub/kafka-py...
test/test_producer.py
test/test_producer.py
import pytest from kafka import KafkaConsumer, KafkaProducer from test.conftest import version from test.testutil import random_string @pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set") @pytest.mark.parametrize("compression", [None, 'gzip', 'snappy', 'lz4']) def test_end_to_end(kafka_broker, compressi...
import pytest from kafka import KafkaConsumer, KafkaProducer from test.conftest import version from test.testutil import random_string @pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set") def test_end_to_end(kafka_broker): connect_str = 'localhost:' + str(kafka_broker.port) producer = KafkaProdu...
apache-2.0
Python
7c12b82cb410540dfa3b65150ce39924b5793bce
handle package.json exceptions
piton-package-manager/piton
python_package_manager/utils/package_json.py
python_package_manager/utils/package_json.py
import os import json def get_dependencies(): package_file_path = os.path.join(os.getcwd(), 'package.json') try: with open(package_file_path, 'r') as infile: package_dict = json.load(infile) dependencies = package_dict.get("pythonDependencies", []) dependencies_dev = package_dict.get("pythonDevDependencie...
import os import json def get_dependencies(): package_file_path = os.path.join(os.getcwd(), 'package.json') with open(package_file_path, 'r') as infile: package_dict = json.load(infile) dependencies = package_dict.get("pythonDependencies", []) dependencies_dev = package_dict.get("pythonDevDependencies", []) r...
mit
Python
b0dd18d4e4e18dafae9d93848f633afc396c91b4
remove outdated/misguided meta __variables__, https://mail.python.org/pipermail/python-dev/2001-March/013328.html
fastly/fastly-py,fastly/fastly-py
fastly/__init__.py
fastly/__init__.py
from fastly import *
""" """ from fastly import * __author__ = 'Tyler McMullen <tbmcmullen@gmail.com>' __copyright__ = 'Copyright (c) 2012 Fastly Inc' __license__ = 'BSD' __version__ = '0.0.1' __url__ = 'http://www.fastly.com/docs/fastly-py'
mit
Python
bc02e845f4a8b726f7474efa77753c7de6fe600b
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/300e7ac61cda0eb2ddb13b7f2ad850d80646adcd.
gautam1858/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,tensorflow/tensorflow-experimental...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "300e7ac61cda0eb2ddb13b7f2ad850d80646adcd" TFRT_SHA256 = "2b79ada8dbacd5de1b868121822ffde58564a1f8749c4f...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "ed6f666ac14b939d7303607c950b88b7d5607c46" TFRT_SHA256 = "b99fed746abe39cb0b072e773af53a4c7189056737fc01...
apache-2.0
Python
42a147b0dcc24ea51207cca020d2bfc6fa7bde46
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/926650aa8e303d62814e45f709d16673501d96bc.
tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,yongtang/...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "926650aa8e303d62814e45f709d16673501d96bc" TFRT_SHA256 = "f178d137127c3a67962362f596b8...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "d50aae4b79fb4aa5a3c4dd280004313c7f1fda51" TFRT_SHA256 = "3d02021cbd499d749eeb4e3e6bdc...
apache-2.0
Python
4cbbe7c3ab891a11492f368d780a1416d37358ff
Change the method of generating content of GUID element
feedzilla/feedzilla,feedzilla/feedzilla,feedzilla/feedzilla
feedzilla/syndication.py
feedzilla/syndication.py
# -*- coding: utf-8 -*- # Copyright: 2011, Grigoriy Petukhov # Author: Grigoriy Petukhov (http://lorien.name) # License: BSD from django.contrib.syndication.views import Feed from django.conf import settings from feedzilla.models import Post class PostFeed(Feed): title_template = 'feedzilla/feed/post_title.html...
# -*- coding: utf-8 -*- # Copyright: 2011, Grigoriy Petukhov # Author: Grigoriy Petukhov (http://lorien.name) # License: BSD from django.contrib.syndication.views import Feed from django.conf import settings from feedzilla.models import Post class PostFeed(Feed): title_template = 'feedzilla/feed/post_title.html...
bsd-3-clause
Python
4e942272c00c943eb2402a94b86f2c5a0c778ac0
update post_sync tests
adorton-adobe/user-sync.py,adorton-adobe/user-sync.py,adobe-apiplatform/user-sync.py,adobe-apiplatform/user-sync.py
tests/test_post_sync.py
tests/test_post_sync.py
import pytest from user_sync.post_sync.manager import PostSyncData @pytest.fixture def example_user(): return { 'type': 'federatedID', 'username': 'user@example.com', 'domain': 'example.com', 'email': 'user@example.com', 'firstname': 'Example', 'lastname': 'User', ...
import pytest from user_sync.post_sync import manager PostSyncManager = manager.PostSyncManager @pytest.fixture def example_user(): return { 'identity_type': 'federatedID', 'username': 'user@example.com', 'domain': 'example.com', 'email': 'user@example.com', 'firstname': 'E...
mit
Python
20dc4b6d80842579740ed91ebb848446a0cecdbf
fix test_settings
eloquence/unisubs,wevoice/wesub,ujdhesa/unisubs,norayr/unisubs,ReachingOut/unisubs,ReachingOut/unisubs,pculture/unisubs,pculture/unisubs,norayr/unisubs,norayr/unisubs,norayr/unisubs,ofer43211/unisubs,ujdhesa/unisubs,eloquence/unisubs,wevoice/wesub,ReachingOut/unisubs,ofer43211/unisubs,ofer43211/unisubs,eloquence/unisub...
test_settings.py
test_settings.py
from settings import * __import__('dev-settings', globals(), locals(), ['*'], -1) ROOT_URLCONF = 'urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': rel('mirosubs.sqlite3'), } } INSTALLED_APPS += ('django_nose', ) INSTALLED_APPS = list(INSTALLED_APPS) INSTALLED_...
from settings import * ROOT_URLCONF = 'urls' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': rel('mirosubs.sqlite3'), } } INSTALLED_APPS += ('django_nose', ) INSTALLED_APPS = list(INSTALLED_APPS) INSTALLED_APPS.remove('mirosubs') TEST_RUNNER = 'django_nose.NoseTest...
agpl-3.0
Python
555981d288b1e3970e2cb9432db3e72f57ba48b4
deal with zero args corner case and return correct type
FInAT/FInAT
finat/pyop2_interface.py
finat/pyop2_interface.py
try: from pyop2.pyparloop import Kernel except: Kernel = None from .interpreter import evaluate def pyop2_kernel(kernel, kernel_args, interpreter=False): """Return a :class:`pyop2.Kernel` from the recipe and kernel data provided. :param kernel: The :class:`~.utils.Kernel` to map to PyOP2. :pa...
try: from pyop2.pyparloop import Kernel except: Kernel = None from .interpreter import evaluate def pyop2_kernel(kernel, kernel_args, interpreter=False): """Return a :class:`pyop2.Kernel` from the recipe and kernel data provided. :param kernel: The :class:`~.utils.Kernel` to map to PyOP2. :pa...
mit
Python
12a85a17194610f81c9ff0c73ea69f4adfc2b307
remove old routine
fireeye/flare-floss,fireeye/flare-floss
floss/render/sanitize.py
floss/render/sanitize.py
import string def sanitize_string_for_printing(s: str) -> str: """ Return sanitized string for printing to cli. """ sanitized_string = s.replace("\\\\", "\\") # print single backslashes sanitized_string = "".join(c for c in sanitized_string if c in string.printable) return sanitized_string
import string def sanitize_string_for_printing(s: str) -> str: """ Return sanitized string for printing to cli. """ sanitized_string = s.replace("\\\\", "\\") # print single backslashes sanitized_string = "".join(c for c in sanitized_string if c in string.printable) return sanitized_string ...
apache-2.0
Python
8379d56ac1be68c9c1d255893644813df8300ed8
add verbose name
manducku/awesomepose,manducku/awesomepose,manducku/awesomepose,manducku/awesomepose
awesomepose/categories/models/category.py
awesomepose/categories/models/category.py
from django.db import models from mptt.models import MPTTModel, TreeForeignKey class Category(MPTTModel): name = models.CharField(max_length=50, unique=True) parent = TreeForeignKey('self', null=True, blank=True, related_name="children", db_index=True) class MPTTMeta: order_insertion_by = ['name'...
from django.db import models from mptt.models import MPTTModel, TreeForeignKey class Category(models.Model): name = models.CharField(max_length=50, unique=True) parent = TreeForeignKey('self', null=True, blank=True, related_name="children", db_index=True) class MPTTMeta: order_insertion_by = ['na...
mit
Python
bcd8d27194131e48d73d843bdae9930e6720130f
Update Vartype
oneklc/dimod,oneklc/dimod
dimod/vartypes.py
dimod/vartypes.py
""" Enumeration of valid variable types for binary quadratic models. Examples: This example shows easy access to different Vartypes, which are in the main namespace. >>> vartype = dimod.SPIN >>> print(vartype) Vartype.SPIN >>> vartype = dimod.BINARY >>> print(vartype) Vartype.BINARY ...
""" Vartype is an enumeration of the valid types for variables in a binary quadratic models. Examples: >>> vartype = dimod.Vartype.SPIN >>> print(vartype) Vartype.SPIN >>> isinstance(vartype, dimod.Vartype) True Access can also be by value or name. >>> print(dimod.Vartype({0, 1})) Var...
apache-2.0
Python
0cb9b65fc0030922fea122a82451fef0d6d3653b
update version 1.0.0
bird-house/flyingpigeon
flyingpigeon/__init__.py
flyingpigeon/__init__.py
from .wsgi import application from .demo import main __version__ = "1.0.0"
from .wsgi import application from .demo import main __version__ = "0.11.0"
apache-2.0
Python
cfc6083c58d151934403ccf55444b122fec46604
Resolve here
takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web
takeyourmeds/utils/test.py
takeyourmeds/utils/test.py
from django.test import TestCase from django.shortcuts import resolve_url from django.contrib.auth import get_user_model User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, status_code, fn, urlconf, *args, **kwargs): ...
from django.test import TestCase from django.shortcuts import resolve_url from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, ...
mit
Python
d9ca3d7113423a84026ad59e1369321baa54d532
Add a simple neutron_hanler
fs714/drcontroller
drcontroller/replication/controller/neutron_handler.py
drcontroller/replication/controller/neutron_handler.py
import logging import base_handler class NeutronHandler(base_handler.BaseHandler): def __init__(self, set_conf, handle_type): ''' set_conf: the configuration file path of keystone authorization handle_type: the handle service type, eg, glance, nova, neutron ''' self.logger =...
import logging def post_handle(message): pass def delete_handle(message): pass def put_handle(mesage): pass class NeutronHandler(object): def __init__(self): self.logger = logging.getLogger("NeutronHandler") self.logger.info('Init NeutronHandler') def accept(self, *req, **kwarg...
apache-2.0
Python
ca8622f5af66ef01c9c185065f2e77fca30bef79
Remove unused update method
kylef/irctk
irctk/nick.py
irctk/nick.py
import re class Nick(object): IRC_USERHOST_REGEX = re.compile(r'^(.*)!(.*)@(.*)$') @classmethod def parse(cls, client, userhost): m = cls.IRC_USERHOST_REGEX.match(userhost) if m: return cls(client, m.group(1), m.group(2), m.group(3)) return cls(client, host=userhost) ...
import re class Nick(object): IRC_USERHOST_REGEX = re.compile(r'^(.*)!(.*)@(.*)$') @classmethod def parse(cls, client, userhost): m = cls.IRC_USERHOST_REGEX.match(userhost) if m: return cls(client, m.group(1), m.group(2), m.group(3)) return cls(client, host=userhost) ...
bsd-3-clause
Python
52c17672d73a9461771c3ec09465d91992160fc5
Fix quota init migration
opennode/nodeconductor-saltstack
src/nodeconductor_saltstack/exchange/migrations/0004_init_quotas.py
src/nodeconductor_saltstack/exchange/migrations/0004_init_quotas.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models, migrations GLOBAL_MAILBOX_SIZE_QUOTA = 'global_mailbox_size' USER_COUNT_QUOTA = 'user_count' def convert_mailbox_size_to_mb(apps, schema_e...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models, migrations GLOBAL_MAILBOX_SIZE_QUOTA = 'global_mailbox_size' USER_COUNT_QUOTA = 'user_count' def convert_mailbox_size_to_mb(apps, schema_e...
mit
Python