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
77859dbc019a19222ada36ebccc849ba77649a86
add to unicode functions to all forum models
byteweaver/django-forums,byteweaver/django-forums,ckcnik/django-forums,ckcnik/django-forums
forums/models.py
forums/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User class Category(models.Model): name = models.CharField(_("Name"), max_length=255, unique=True) position = models.IntegerField(_("Position"), default=0) class Meta: orde...
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User class Category(models.Model): name = models.CharField(_("Name"), max_length=255, unique=True) position = models.IntegerField(_("Position"), default=0) class Meta: orde...
bsd-3-clause
Python
694df5ba69e4e7123009605e59c2b5417a3b52c5
Remove print statement about number of bins
fauzanzaid/IUCAA-GRB-detection-Feature-extraction
tools/fitsevt.py
tools/fitsevt.py
#! /usr/bin/python3 import sys import os import math from astropy.io import fits inputFolder = sys.argv[1] outputFolder = sys.argv[2] eLo = int(sys.argv[3]) eHi = int(sys.argv[4]) binSize = int(sys.argv[5]) fnames = os.listdir(inputFolder) for fname in fnames: print(fname) hdulist = fits.open(inputFolder+"/"+fna...
#! /usr/bin/python3 import sys import os import math from astropy.io import fits inputFolder = sys.argv[1] outputFolder = sys.argv[2] eLo = int(sys.argv[3]) eHi = int(sys.argv[4]) binSize = int(sys.argv[5]) fnames = os.listdir(inputFolder) for fname in fnames: print(fname) hdulist = fits.open(inputFolder+"/"+fna...
mit
Python
22a4644bd510a8b786d181c01c20f3dc522dac8d
Update corehq/apps/auditcare/migrations/0004_add_couch_id.py
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/auditcare/migrations/0004_add_couch_id.py
corehq/apps/auditcare/migrations/0004_add_couch_id.py
# Generated by Django 2.2.20 on 2021-05-21 17:32 from django.db import migrations, models ACCESS_INDEX = "audit_access_couch_10d1b_idx" ACCESS_TABLE = "auditcare_accessaudit" NAVIGATION_EVENT_INDEX = "audit_nav_couch_875bc_idx" NAVIGATION_EVENT_TABLE = "auditcare_navigationeventaudit" def _create_index_sql(table_n...
# Generated by Django 2.2.20 on 2021-05-21 17:32 from django.db import migrations, models ACCESS_INDEX = "audit_access_couch_10d1b_idx" ACCESS_TABLE = "auditcare_accessaudit" NAVIGATION_EVENT_INDEX = "audit_nav_couch_875bc_idx" NAVIGATION_EVENT_TABLE = "auditcare_navigationeventaudit" def _create_index_sql(table_n...
bsd-3-clause
Python
0c816aaa82ee9fee1ee244c6b96c1a2718ec836e
use default python command from the environment
Rio517/pledgeservice,Rio517/pledgeservice,MayOneUS/pledgeservice,MayOneUS/pledgeservice,Rio517/pledgeservice
testrunner.py
testrunner.py
#!/usr/bin/env python import os import sys import unittest USAGE = """%prog SDK_PATH TEST_PATH Run unit tests for App Engine apps.""" SDK_PATH_manual = '/usr/local/google_appengine' TEST_PATH_manual = '../unittests' def main(sdk_path, test_path): os.chdir('backend') sys.path.extend([sdk_path, '.', '../lib', '../...
#!/usr/bin/python import os import sys import unittest USAGE = """%prog SDK_PATH TEST_PATH Run unit tests for App Engine apps.""" SDK_PATH_manual = '/usr/local/google_appengine' TEST_PATH_manual = '../unittests' def main(sdk_path, test_path): os.chdir('backend') sys.path.extend([sdk_path, '.', '../lib', '../test...
apache-2.0
Python
ec2aaf86f2002b060f6e5b4d040961a37f89d06a
Update rearrange-string-k-distance-apart.py
kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,yiwen-luo/LeetCode,jaredkoontz/leetcode,yiwen-luo/LeetCode,jaredkoontz/leetcode,jaredkoontz/leetcode,jaredkoontz/leetcode,githubutilities/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015...
Python/rearrange-string-k-distance-apart.py
Python/rearrange-string-k-distance-apart.py
# Time: O(n) # Space: O(n) class Solution(object): def rearrangeString(self, str, k): """ :type str: str :type k: int :rtype: str """ cnts = [0] * 26; for c in str: cnts[ord(c) - ord('a')] += 1 sorted_cnts = [] for i in xrange(26...
# Time: O(nlogc), c is the count of unique characters. # Space: O(c) from collections import defaultdict from heapq import heappush, heappop class Solution(object): def rearrangeString(self, str, k): """ :type str: str :type k: int :rtype: str """ if k == 0: ...
mit
Python
392cf8f05b6c23600e7a61a51494771ab08f2274
add exceptions to should_curry
JNRowe/toolz,jcrist/toolz,karansag/toolz,berrytj/toolz,machinelearningdeveloper/toolz,whilo/toolz,jdmcbr/toolz,berrytj/toolz,quantopian/toolz,jdmcbr/toolz,bartvm/toolz,JNRowe/toolz,simudream/toolz,machinelearningdeveloper/toolz,obmarg/toolz,karansag/toolz,pombredanne/toolz,pombredanne/toolz,simudream/toolz,Julian-O/too...
toolz/curried.py
toolz/curried.py
""" Alternate namespece for toolz such that all functions are curried Currying provides implicit partial evaluation of all functions Example: Get usually requires two arguments, an index and a collection >>> from toolz.curried import get >>> get(0, ('a', 'b')) 'a' When we use it in higher order ...
""" Alternate namespece for toolz such that all functions are curried Currying provides implicit partial evaluation of all functions Example: Get usually requires two arguments, an index and a collection >>> from toolz.curried import get >>> get(0, ('a', 'b')) 'a' When we use it in higher order ...
bsd-3-clause
Python
778bab1b4f57eb03137c00203d7b5f32c018ca83
fix error
robinchenyu/imagepaste
ImagePaste.py
ImagePaste.py
# import sublime import sublime_plugin import os import sys package_file = os.path.normpath(os.path.abspath(__file__)) package_path = os.path.dirname(package_file) lib_path = os.path.join(package_path, "lib") if lib_path not in sys.path: sys.path.append(lib_path) print(sys.path) from PIL import ImageGrab from...
# import sublime import sublime_plugin import os package_file = os.path.normpath(os.path.abspath(__file__)) package_path = os.path.dirname(package_file) lib_path = os.path.join(package_path, "lib") if lib_path not in sys.path: sys.path.append(lib_path) print(sys.path) from PIL import ImageGrab from PIL import...
mit
Python
734457ed995a3dfcacf8556ed4e98e7536e63a66
Fix typos
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
nodeconductor/openstack/management/commands/initsecuritygroups.py
nodeconductor/openstack/management/commands/initsecuritygroups.py
from __future__ import unicode_literals from django.conf import settings from django.core.management.base import BaseCommand, CommandError from nodeconductor.openstack import models, executors, handlers class Command(BaseCommand): help_text = "Add default security groups with given names to all tenants." d...
from __future__ import unicode_literals from django.conf import settings from django.core.management.base import BaseCommand, CommandError from nodeconductor.openstack import models, executors, handlers class Command(BaseCommand): help_text = "Add default security groups with given names to all tenants to tenan...
mit
Python
8463c22898210990e911580d217559efdbbfe5d7
Make disk space test optional
tst-mswartz/earthenterprise,google/earthenterprise,tst-ppenev/earthenterprise,tst-mswartz/earthenterprise,tst-ccamp/earthenterprise,google/earthenterprise,tst-ccamp/earthenterprise,tst-ccamp/earthenterprise,google/earthenterprise,tst-mswartz/earthenterprise,tst-mswartz/earthenterprise,tst-lsavoie/earthenterprise,google...
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/geecheck_tests/user_tests/disk_space_test.py
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/geecheck_tests/user_tests/disk_space_test.py
#!/usr/bin/env python # # 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 ...
#!/usr/bin/env python # # 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 ...
apache-2.0
Python
a602ed873d71253723f07dfa043d959cd247d734
Add latest version of py-typing (#13287)
LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/py-typing/package.py
var/spack/repos/builtin/packages/py-typing/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyTyping(PythonPackage): """This is a backport of the standard library typing module to Py...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyTyping(PythonPackage): """This is a backport of the standard library typing module to Py...
lgpl-2.1
Python
6641fd1275c27dfb27787ed25b80af3b6ba14b9f
debug by further reduction
sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher
apdflash/scarecrowDreams.py
apdflash/scarecrowDreams.py
print "hellow world"
import sys,os sys.path.insert(0, '../helpers') from mpi4py import MPI
apache-2.0
Python
14b1f9bde45b66f8752778469f1daae77b49f4e0
Add comment
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
bluebottle/bb_orders/signals.py
bluebottle/bb_orders/signals.py
from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from django.dispatch.dispatcher import Signal from django_fsm.signals import post_transition from bluebottle.donations.models import Donation from bluebottle.payments.models import OrderPayment from bluebottle.payments.se...
from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from django.dispatch.dispatcher import Signal from django_fsm.signals import post_transition from bluebottle.donations.models import Donation from bluebottle.payments.models import OrderPayment from bluebottle.payments.se...
bsd-3-clause
Python
de6babf92252ea5828a9c17d76766357cff3e440
Extend _VALID_URL (Closes #10812)
steebchen/youtube-dl,erikdejonge/youtube-dl,hakatashi/youtube-dl,oskar456/youtube-dl,pim89/youtube-dl,jbuchbinder/youtube-dl,luceatnobis/youtube-dl,malept/youtube-dl,nickleefly/youtube-dl,dstftw/youtube-dl,remitamine/youtube-dl,longman694/youtube-dl,marcwebbie/youtube-dl,longman694/youtube-dl,yan12125/youtube-dl,malept...
youtube_dl/extractor/tvland.py
youtube_dl/extractor/tvland.py
# coding: utf-8 from __future__ import unicode_literals from .mtv import MTVServicesInfoExtractor class TVLandIE(MTVServicesInfoExtractor): IE_NAME = 'tvland.com' _VALID_URL = r'https?://(?:www\.)?tvland\.com/(?:video-clips|(?:full-)?episodes)/(?P<id>[^/?#.]+)' _FEED_URL = 'http://www.tvland.com/feeds/mr...
# coding: utf-8 from __future__ import unicode_literals from .mtv import MTVServicesInfoExtractor class TVLandIE(MTVServicesInfoExtractor): IE_NAME = 'tvland.com' _VALID_URL = r'https?://(?:www\.)?tvland\.com/(?:video-clips|episodes)/(?P<id>[^/?#.]+)' _FEED_URL = 'http://www.tvland.com/feeds/mrss/' _...
unlicense
Python
a34d08cec2cdcf259070ca51c69dcd425a04c5be
move use_container into execkwargs
dleehr/cwltool,common-workflow-language/cwltool,dleehr/cwltool,dleehr/cwltool,common-workflow-language/cwltool,common-workflow-language/cwltool,dleehr/cwltool
tests/util.py
tests/util.py
from __future__ import absolute_import import os import functools from pkg_resources import (Requirement, ResolutionError, # type: ignore resource_filename) import distutils.spawn import pytest from cwltool.utils import onWindows, windows_default_container_id from cwltool.factory import Fa...
from __future__ import absolute_import import os import functools from pkg_resources import (Requirement, ResolutionError, # type: ignore resource_filename) import distutils.spawn import pytest from cwltool.utils import onWindows, windows_default_container_id from cwltool.factory import Fa...
apache-2.0
Python
b06863b3bd9b12c47380362b3d4182167a6d2eaa
Update openssl.py
vadimkantorov/wigwam
wigs/openssl.py
wigs/openssl.py
class openssl(Wig): tarball_uri = 'https://github.com/openssl/openssl/archive/OpenSSL_$RELEASE_VERSION$.tar.gz' git_uri = 'https://github.com/openssl/openssl' last_release_version = 'v1_1_0e' def setup(self): self.configure_flags += [S.FPIC_FLAG] def gen_configure_snippet(self): return './config %s' % ' '....
class openssl(Wig): tarball_uri = 'https://github.com/openssl/openssl/archive/OpenSSL_$RELEASE_VERSION$.tar.gz' git_uri = 'https://github.com/openssl/openssl' last_release_version = 'v1_0_2d' def setup(self): self.configure_flags += [S.FPIC_FLAG] def gen_configure_snippet(self): return './config %s' % ' '.jo...
mit
Python
66c4b93ae78c98928946f0ceeee3a2c16be7655d
Add coding line
MichaelCurrin/twitterverse,MichaelCurrin/twitterverse
app/tests/integration/test_database.py
app/tests/integration/test_database.py
# -*- coding: utf-8 -*- """ Database tests. """ from __future__ import unicode_literals from __future__ import absolute_import from unittest import TestCase from lib import database from models.trends import Trend class TestDatabaseSetup(TestCase): """ Test the database library module. """ def tearD...
""" Database tests. """ from __future__ import unicode_literals from __future__ import absolute_import from unittest import TestCase from lib import database from models.trends import Trend class TestDatabaseSetup(TestCase): """ Test the database library module. """ def tearDown(self): datab...
mit
Python
005eea5e467c3a0aa6b942ce377a5c72b9177e21
Fix build_lines() - s/bw/image
ijks/textinator
textinator.py
textinator.py
import click from PIL import Image @click.command() @click.argument('image', type=click.File('rb')) @click.argument('out', type=click.File('wt'), default='-', required=False) @click.option('-p', '--palette', default='█▓▒░ ', help="A custom palette for rendering images. Goes from dark to b...
import click from PIL import Image @click.command() @click.argument('image', type=click.File('rb')) @click.argument('out', type=click.File('wt'), default='-', required=False) @click.option('-p', '--palette', default='█▓▒░ ', help="A custom palette for rendering images. Goes from dark to b...
mit
Python
1f130a8577f16809008bd301ab8c47aab4677750
Add build_lines function, move image generation there.
ijks/textinator
textinator.py
textinator.py
import click from PIL import Image def scale(val, src, dst): """ Scale the given value from the scale of src to the scale of dst. """ return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0] def value_to_char(value, palette, value_range=(0, 256)): palette_range = (0, len(palette)) ...
import click from PIL import Image def scale(val, src, dst): """ Scale the given value from the scale of src to the scale of dst. """ return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0] def value_to_char(value, palette, value_range=(0, 256)): palette_range = (0, len(palette)) ...
mit
Python
bf7fd4e606901fae6a434e4a375ac72bcbc66e00
Fix plugin
qiita-spots/qp-target-gene
tgp/plugin.py
tgp/plugin.py
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
Python
fe81916434e6aa04d9672589cb75fde3c676e19f
Fix revision chain
VinnieJohns/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,edofic/ggrc-core,kr41/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,jmakov/ggrc-core,jmakov/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,prasannav7/ggrc-core,josthkko/ggrc-core,ed...
src/ggrc/migrations/versions/20151216132037_5410607088f9_delete_background_tasks.py
src/ggrc/migrations/versions/20151216132037_5410607088f9_delete_background_tasks.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com """Delete background tasks Revision ID: 5410607088f9 Revises: 1ef8f4f504ae Crea...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com """Delete background tasks Revision ID: 5410607088f9 Revises: 504f541411a5 Crea...
apache-2.0
Python
07bda8adbeb798dfd100b63a784e14a00cf33927
add new views to urls
samitnuk/urlsaver_django,samitnuk/urlsaver_django
urlsaver/urls.py
urlsaver/urls.py
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.main_view, name='main'), url(r'^register/', views.register_view, name='register'), url(r'^login/', views.login_view, name='login'), url(r'^logout/', views.logout_view, name='logout'), ]
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.main_view, name='main'), ]
mit
Python
38d47061b6c1ea3250b99f7376d7479e970974a5
define cheakInradius
mrnonz/Toc-2
MonteCarlo.py
MonteCarlo.py
from math import * def checkInradius(x, y): z = x**2 + y**2 z = sqrt(z) if z < 1.0: return True else: return False N = int(raw_input('Insert your N (random) :: '))
from math import * N = int(raw_input('Insert your N (random) :: ')) print N
mit
Python
33c1db03e6b52d73ee6571f3f645f1b8d01e9a25
Comment to clarify the use of a custom field source
nimiq/test-django-rest
snippets/serializers.py
snippets/serializers.py
from django.forms import widgets from rest_framework import serializers from snippets.models import Snippet, LANGUAGE_CHOICES, STYLE_CHOICES from django.contrib.auth.models import User class UserSerializer(serializers.ModelSerializer): # Add a filed to diplsay a list of related snippets. snippets = serializer...
from django.forms import widgets from rest_framework import serializers from snippets.models import Snippet, LANGUAGE_CHOICES, STYLE_CHOICES from django.contrib.auth.models import User class UserSerializer(serializers.ModelSerializer): # Add a filed to diplsay a list of related snippets. snippets = serializer...
apache-2.0
Python
2b553e23791adaa9e333d6f8feded8e95fd348c9
Bump version to 0.2.0a0
sdispater/cachy
cachy/version.py
cachy/version.py
# -*- coding: utf-8 -*- VERSION = '0.2.0a0'
# -*- coding: utf-8 -*- VERSION = '0.1.1'
mit
Python
a9240cd8bcfced47b402fdbff0162ad939eaa631
Fix typo
choderalab/yank,choderalab/yank
Yank/multistate/__init__.py
Yank/multistate/__init__.py
#!/usr/local/bin/env python # ============================================================================== # MODULE DOCSTRING # ============================================================================== """ MultiState ========== Multistate Sampling simulation algorithms, specific variants, and analyzers This ...
#!/usr/local/bin/env python # ============================================================================== # MODULE DOCSTRING # ============================================================================== """ MultiState ========== Multistate Sampling simulation algorithms, specific variants, and analyzers This ...
mit
Python
8f1d2f0e821724f010291d340f30d5842ad32c76
add word2vec yahoo for shoes
mathrho/word2vec,mathrho/word2vec,mathrho/word2vec,mathrho/word2vec
extractVecMat_shoes.py
extractVecMat_shoes.py
#/datastore/zhenyang/bin/python import sys import os import gensim, logging import numpy as np import scipy.io as sio def main(): ############## logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) #pretrained_model = './vectors.bin' #pretrained_model = '../fr...
#/datastore/zhenyang/bin/python import sys import os import gensim, logging import numpy as np import scipy.io as sio def main(): ############## logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) #pretrained_model = './vectors.bin' #pretrained_model = '../fr...
apache-2.0
Python
d7e9264418cbe5574d7475094e2c06a878897c34
fix ALDC scraper
DemocracyClub/EveryElection,DemocracyClub/EveryElection,DemocracyClub/EveryElection
every_election/apps/election_snooper/snoopers/aldc.py
every_election/apps/election_snooper/snoopers/aldc.py
from datetime import datetime from .base import BaseSnooper from election_snooper.models import SnoopedElection class ALDCScraper(BaseSnooper): snooper_name = "ALDC" base_url = "https://www.aldc.org/" def get_all(self): url = "{}category/forthcoming-by-elections/".format(self.base_url) p...
from datetime import datetime from .base import BaseSnooper from election_snooper.models import SnoopedElection class ALDCScraper(BaseSnooper): snooper_name = "ALDC" base_url = "https://www.aldc.org/" def get_all(self): url = "{}category/forthcoming-by-elections/".format(self.base_url) p...
bsd-3-clause
Python
021ca057be4333d209454b043c79f9d6d327c3e0
Return the response for the main page without jinja rendering as AngularJS is doing the rendering
dedalusj/PaperChase,dedalusj/PaperChase
webapp/keepupwithscience/frontend/main.py
webapp/keepupwithscience/frontend/main.py
from flask import Blueprint, render_template, make_response bp = Blueprint('main', __name__) @bp.route('/') def index(): """Returns the main interface.""" return make_response(open('keepupwithscience/frontend/templates/main.html').read()) # return render_template('main.html')
from flask import Blueprint, render_template bp = Blueprint('main', __name__) @bp.route('/') def index(): """Returns the main interface.""" return render_template('main.html')
mit
Python
392e34a70bd2bccba268ec9de1752afc50cd1b35
Add the httlib dir to the build
cberry777/dd-agent,pfmooney/dd-agent,cberry777/dd-agent,brettlangdon/dd-agent,mderomph-coolblue/dd-agent,relateiq/dd-agent,joelvanvelden/dd-agent,JohnLZeller/dd-agent,ess/dd-agent,joelvanvelden/dd-agent,relateiq/dd-agent,Wattpad/dd-agent,jyogi/purvar-agent,c960657/dd-agent,takus/dd-agent,PagerDuty/dd-agent,a20012251/dd...
packaging/datadog-agent-lib/setup.py
packaging/datadog-agent-lib/setup.py
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import os, sys from distutils.command.install import INSTALL_SCHEMES def getVersion(): try: from con...
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import os, sys from distutils.command.install import INSTALL_SCHEMES def getVersion(): try: from con...
bsd-3-clause
Python
a9ff99f94938c5e50038b9d98200c5247e651c35
Fix AttributeError: module 'config' has no attribute 'expires'
wolfy1339/Python-IRC-Bot
utils/ignores.py
utils/ignores.py
import random import time import config import log as logging def check_ignored(host, channel): ignores = config.expires['global'] if channel in config.ignores['channel'].keys(): ignores.extend(config.expires['channel'][channel]) for i in ignores: for (uhost, expires) in i: #...
import random import time import config import log as logging def check_ignored(host, channel): ignores = config.expires['global'] if channel in config.expires['channel'].keys(): ignores.extend(config.expires['channel'][channel]) for i in ignores: for (uhost, expires) in i: #...
mit
Python
7de5d99866164c0f17aa85f8cdd910132ac35667
use re.split instead of string.split
hammerlab/topiary,hammerlab/topiary
topiary/rna/common.py
topiary/rna/common.py
# Copyright (c) 2015. Mount Sinai School of Medicine # # 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 o...
# Copyright (c) 2015. Mount Sinai School of Medicine # # 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 o...
apache-2.0
Python
ab505466859a5d2e5b397d1fb1fc3271977a2024
modify register validation
BugisDev/OrangBulukumba,BugisDev/OrangBulukumba
app/user/forms.py
app/user/forms.py
from flask_wtf import Form from wtforms import StringField, PasswordField, TextAreaField, SelectField, validators from wtforms.ext.sqlalchemy.fields import QuerySelectField from .models import User from app.post.models import Post_type from flask.ext.bcrypt import check_password_hash class LoginForm(Form): userna...
from flask_wtf import Form from wtforms import StringField, PasswordField, TextAreaField, SelectField, validators from wtforms.ext.sqlalchemy.fields import QuerySelectField from .models import User from app.post.models import Post_type from flask.ext.bcrypt import check_password_hash class LoginForm(Form): userna...
apache-2.0
Python
29e56ec30c13c5fbb562e77cdb2c660d5fc52842
remove debugging print
frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe,frePPLe/frePPLe
freppledb/common/management/commands/generatetoken.py
freppledb/common/management/commands/generatetoken.py
# # Copyright (C) 2021 by frePPLe bv # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This library is distri...
# # Copyright (C) 2021 by frePPLe bv # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This library is distri...
agpl-3.0
Python
9235d1aa35e6a597be3c497577de528425d6e046
comment cleanup
cubgs53/usaddress,frankleng/usaddress,yl2695/usaddress,markbaas/usaddress,ahlusar1989/probablepeople
training/parse_osm.py
training/parse_osm.py
from lxml import etree import ast import re # parse xml data, return a list of dicts representing addresses def xmlToAddrList(xml_file): tree = etree.parse(xml_file) root = tree.getroot() addr_list=[] for element in root: if element.tag == 'node' or element.tag =='way': address={} for x in element.iter('ta...
from lxml import etree import ast import re # parse xml data, return a list of dicts representing addresses def xmlToAddrList(xml_file): tree = etree.parse(xml_file) root = tree.getroot() addr_list=[] for element in root: if element.tag == 'node' or element.tag =='way': address={} for x in element.iter('ta...
mit
Python
d7bea2995fc54c15404b4b47cefae5fc7b0201de
FIX partner internal code compatibility with sign up
ingadhoc/partner
partner_internal_code/res_partner.py
partner_internal_code/res_partner.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api class pa...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import fields, models, api class pa...
agpl-3.0
Python
da05fe2d41a077276946c5d6c86995c60315e093
Make sure we load pyvisa-py when enumerating instruments.
BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex,BBN-Q/Auspex
src/auspex/instruments/__init__.py
src/auspex/instruments/__init__.py
import pkgutil import importlib import pyvisa instrument_map = {} for loader, name, is_pkg in pkgutil.iter_modules(__path__): module = importlib.import_module('auspex.instruments.' + name) if hasattr(module, "__all__"): globals().update((name, getattr(module, name)) for name in module.__all__) for name in module...
import pkgutil import importlib import pyvisa instrument_map = {} for loader, name, is_pkg in pkgutil.iter_modules(__path__): module = importlib.import_module('auspex.instruments.' + name) if hasattr(module, "__all__"): globals().update((name, getattr(module, name)) for name in module.__all__) for name in module...
apache-2.0
Python
4eb4a2eaa42cd71bf4427bdaaa1e853975432691
Allow keyword arguments in GeneralStoreManager.create_item method
PHB-CS123/graphene,PHB-CS123/graphene,PHB-CS123/graphene
graphene/storage/intermediate/general_store_manager.py
graphene/storage/intermediate/general_store_manager.py
from graphene.storage.id_store import * class GeneralStoreManager: """ Handles the creation/deletion of nodes to the NodeStore with ID recycling """ def __init__(self, store): """ Creates an instance of the GeneralStoreManager :param store: Store to manage :return: Ge...
from graphene.storage.id_store import * class GeneralStoreManager: """ Handles the creation/deletion of nodes to the NodeStore with ID recycling """ def __init__(self, store): """ Creates an instance of the GeneralStoreManager :param store: Store to manage :return: Ge...
apache-2.0
Python
ad47fb85e5c2deb47cbe3fc3478e1ae2da93adfe
Update h-index.py
yiwen-luo/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,githubutilities/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,githubutilities/LeetCode,jaredkoontz/leetcode,yiwen-luo/LeetCode,githubutilities/LeetCode,jaredkoontz/leetcode,tudennis/LeetCode---kamyu104-11-24-2015,jaredkoon...
Python/h-index.py
Python/h-index.py
# Time: O(n) # Space: O(n) # Given an array of citations (each citation is a non-negative integer) # of a researcher, write a function to compute the researcher's h-index. # # According to the definition of h-index on Wikipedia: # "A scientist has index h if h of his/her N papers have # at least h citations each, an...
# Time: O(nlogn) # Space: O(1) # Given an array of citations (each citation is a non-negative integer) # of a researcher, write a function to compute the researcher's h-index. # # According to the definition of h-index on Wikipedia: # "A scientist has index h if h of his/her N papers have # at least h citations each...
mit
Python
4fd6d20be257cca38f98d20df78b35d7c7bc3911
Fix factory_jst
watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder
feder/teryt/factory.py
feder/teryt/factory.py
from random import randint from .models import JednostkaAdministracyjna as JST from .models import Category def factory_jst(): category = Category.objects.create(name="X", level=1) return JST.objects.create(name="X", id=randint(0, 1000), category=category, ...
from autofixture import AutoFixture from .models import JednostkaAdministracyjna def factory_jst(): jst = AutoFixture(JednostkaAdministracyjna, field_values={'updated_on': '2015-02-12'}, generate_fk=True).create_one(commit=False) jst.rght = 0 jst.save() ret...
mit
Python
2eefaca1d7d27ebe2e9a489ab2c1dc2927e49b55
Bump version
thombashi/sqliteschema
sqliteschema/__version__.py
sqliteschema/__version__.py
__author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016, {}".format(__author__) __license__ = "MIT License" __version__ = "1.0.2" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
__author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016, {}".format(__author__) __license__ = "MIT License" __version__ = "1.0.1" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
bc904f3ab7cc9d697dc56058ac9cb578055c401f
raise exception rather than logging and returning
AniruddhaSAtre/dd-agent,ess/dd-agent,oneandoneis2/dd-agent,benmccann/dd-agent,Shopify/dd-agent,jamesandariese/dd-agent,jshum/dd-agent,eeroniemi/dd-agent,Wattpad/dd-agent,gphat/dd-agent,tebriel/dd-agent,jvassev/dd-agent,joelvanvelden/dd-agent,cberry777/dd-agent,jraede/dd-agent,oneandoneis2/dd-agent,takus/dd-agent,Anirud...
checks.d/hdfs.py
checks.d/hdfs.py
from checks import AgentCheck class HDFSCheck(AgentCheck): """Report on free space and space used in HDFS. """ def check(self, instance): try: import snakebite.client except ImportError: raise ImportError('HDFSCheck requires the snakebite module') if 'name...
from checks import AgentCheck class HDFSCheck(AgentCheck): """Report on free space and space used in HDFS. """ def check(self, instance): try: import snakebite.client except ImportError: raise ImportError('HDFSCheck requires the snakebite module') if 'name...
bsd-3-clause
Python
6a8c8bc0e407327e5c0e4cae3d4d6ace179a6940
Add team eligibility to API
siggame/webserver,siggame/webserver,siggame/webserver
webserver/codemanagement/serializers.py
webserver/codemanagement/serializers.py
from rest_framework import serializers from greta.models import Repository from competition.models import Team from .models import TeamClient, TeamSubmission class TeamSerializer(serializers.ModelSerializer): class Meta: model = Team fields = ('id', 'name', 'slug', 'eligible_to_win') class Rep...
from rest_framework import serializers from greta.models import Repository from competition.models import Team from .models import TeamClient, TeamSubmission class TeamSerializer(serializers.ModelSerializer): class Meta: model = Team fields = ('id', 'name', 'slug') class RepoSerializer(seriali...
bsd-3-clause
Python
d50daddde2186d54659a4f8dbf63622311ed6d22
remove service class
aacanakin/glim
glim/services.py
glim/services.py
from glim.core import Service class Config(Service): pass class Session(Service): pass class Router(Service): pass
# metaclass for Service class class DeflectToInstance(type): def __getattr__(selfcls, a): # selfcls in order to make clear it is a class object (as we are a metaclass) try: # first, inquiry the class itself return super(DeflectToInstance, selfcls).__getattr__(a) except Attrib...
mit
Python
72902ebcada7bdc7a889f8766b63afff82110182
Comment about recursion limit in categories.
dokterbob/django-shopkit,dokterbob/django-shopkit
webshop/extensions/category/__init__.py
webshop/extensions/category/__init__.py
# Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl> # # This file is part of django-webshop. # # django-webshop is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 2, or (at...
# Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl> # # This file is part of django-webshop. # # django-webshop is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 2, or (at...
agpl-3.0
Python
f5fad49e0b20e54e01fe4d9ae69be0694d7878f9
add docstring to test setup, and move to the top
xpansa/sale-workflow,kittiu/sale-workflow,thomaspaulb/sale-workflow,diagramsoftware/sale-workflow,adhoc-dev/sale-workflow,BT-cserra/sale-workflow,grap/sale-workflow,brain-tec/sale-workflow,BT-fgarbely/sale-workflow,Endika/sale-workflow,jabibi/sale-workflow,acsone/sale-workflow,kittiu/sale-workflow,brain-tec/sale-workfl...
sale_exception_nostock/tests/test_dropshipping_skip_check.py
sale_exception_nostock/tests/test_dropshipping_skip_check.py
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
agpl-3.0
Python
8fb97bc0b3a22b912958974636051447170a0b02
Add user_account to the user profile admin as a read-only field.
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
go/base/admin.py
go/base/admin.py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.translation import ugettext_lazy as _ from go.base.models import GoUser, UserProfile, UserOrganisation from go.base.forms import GoUserCreationForm, GoUserChangeForm class UserProfileInline(admin.StackedInline): mo...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.translation import ugettext_lazy as _ from go.base.models import GoUser, UserProfile, UserOrganisation from go.base.forms import GoUserCreationForm, GoUserChangeForm class UserProfileInline(admin.StackedInline): mo...
bsd-3-clause
Python
56d3db6aae71c88ff8b55bb1d173abc025be7e8c
Add test of a write command
prophile/jacquard,prophile/jacquard
jacquard/tests/test_cli.py
jacquard/tests/test_cli.py
import io import unittest.mock import contextlib import textwrap from jacquard.cli import main from jacquard.storage.dummy import DummyStore def test_smoke_cli_help(): try: output = io.StringIO() with contextlib.redirect_stdout(output): main(['--help']) except SystemExit: p...
import io import unittest.mock import contextlib import textwrap from jacquard.cli import main from jacquard.storage.dummy import DummyStore def test_smoke_cli_help(): try: output = io.StringIO() with contextlib.redirect_stdout(output): main(['--help']) except SystemExit: p...
mit
Python
1d31282a9781e8eef4aafc0549c01056d4fc03d0
Bump version.
armet/python-armet
armet/_version.py
armet/_version.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division __version_info__ = (0, 4, 22) __version__ = '.'.join(map(str, __version_info__))
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division __version_info__ = (0, 4, 21) __version__ = '.'.join(map(str, __version_info__))
mit
Python
cec594e525fb889029b85b1f92f89170ca330332
Remove unnecessary "is not supported" verbiage.
rht/zulip,punchagan/zulip,showell/zulip,zulip/zulip,punchagan/zulip,punchagan/zulip,showell/zulip,kou/zulip,kou/zulip,punchagan/zulip,eeshangarg/zulip,zulip/zulip,kou/zulip,eeshangarg/zulip,hackerkid/zulip,eeshangarg/zulip,andersk/zulip,andersk/zulip,kou/zulip,showell/zulip,zulip/zulip,andersk/zulip,showell/zulip,zulip...
zerver/webhooks/trello/view/__init__.py
zerver/webhooks/trello/view/__init__.py
# Webhooks for external integrations. from typing import Any, Mapping, Optional, Tuple import orjson from django.http import HttpRequest, HttpResponse from zerver.decorator import api_key_only_webhook_view, return_success_on_head_request from zerver.lib.request import REQ, has_request_variables from zerver.lib.respon...
# Webhooks for external integrations. from typing import Any, Mapping, Optional, Tuple import orjson from django.http import HttpRequest, HttpResponse from zerver.decorator import api_key_only_webhook_view, return_success_on_head_request from zerver.lib.request import REQ, has_request_variables from zerver.lib.respon...
apache-2.0
Python
67c40fff7813b91b874c5fada042bfc0c6990d52
Bump version
thombashi/typepy
typepy/__version__.py
typepy/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2017-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.3.2" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2017-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.3.1" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
7f774d08ecf9d64a732a8471dd6f36b9d0e2826a
Update entity_main.py
madhurilalitha/Python-Projects
EntityExtractor/src/entity_main.py
EntityExtractor/src/entity_main.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created by Lalitha Madhuri Putchala on Dec 10 2017 """ import spacy import docx2txt import re from docx import Document from utils import get_sentence_tokens, tag_text, highlight_text class Entity: def __init__(self): self.raw_data = docx2txt.process('Contrac...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created by Lalitha Madhuri Putchala on Dec 10 2017 """ import unittest from entity_main import Entity from docx import Document import docx2txt class TestEntity(unittest.TestCase): '''The below function verifies the basic sanity functionality of the program ...
mit
Python
4b14f12fa8bb6dca7ad91f187e7765bef27c0d65
Add some options
thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee
classes/admin.py
classes/admin.py
from django.contrib import admin from classes.models import Attendee from classes.models import Attendance from classes.models import Session from classes.models import WalkinClass class AttendanceInline(admin.TabularInline): model = Attendance extra = 1 verbose_name = 'Attendee' verbose_name_plural ...
from django.contrib import admin from classes.models import Attendee from classes.models import Attendance from classes.models import Session from classes.models import WalkinClass class AttendanceInline(admin.TabularInline): model = Attendance extra = 1 verbose_name = 'Attendee' verbose_name_plural ...
mit
Python
aa681b4a36ce36c53933f3834eec9c721d6029cf
Update docker images utils
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
polyaxon/docker_images/image_info.py
polyaxon/docker_images/image_info.py
import logging from typing import Any, Tuple import conf from constants.images_tags import LATEST_IMAGE_TAG _logger = logging.getLogger('polyaxon.dockerizer.images') def get_experiment_image_info(experiment: 'Experiment') -> Tuple[str, str]: """Return the image name and image tag for an experiment""" proj...
import logging from typing import Any, Tuple import conf from constants.images_tags import LATEST_IMAGE_TAG _logger = logging.getLogger('polyaxon.dockerizer.images') def get_experiment_image_info(experiment: 'Experiment') -> Tuple[str, str]: """Return the image name and image tag for an experiment""" proj...
apache-2.0
Python
7307a4b19b09f4408f569c580955f5c7d2af5f73
Update version number
auth0/auth0-python,auth0/auth0-python
auth0/__init__.py
auth0/__init__.py
__version__ = '2.0.0b4'
__version__ = '2.0.0b3'
mit
Python
443d56fdd2e588c11c2a1e3a685912b712e37d44
Make sure all fields are grabbed.
e-koch/canfar_scripts,e-koch/canfar_scripts
split/casanfar_split.py
split/casanfar_split.py
import os import numpy as np import sys SDM_name = str(sys.argv[4]) print "Inputted MS: "+SDM_name # SDM_name = '14B-088.sb30023144.eb30070731.57002.919034293984' # Set up some useful variables (these will be altered later on) msfile = SDM_name + '.ms' hisplitms = SDM_name + '.hi.ms' splitms = SDM_name + '.hi.src.sp...
import os import numpy as np import sys SDM_name = str(sys.argv[4]) print "Inputted MS: "+SDM_name # SDM_name = '14B-088.sb30023144.eb30070731.57002.919034293984' # Set up some useful variables (these will be altered later on) msfile = SDM_name + '.ms' hisplitms = SDM_name + '.hi.ms' splitms = SDM_name + '.hi.src.sp...
mit
Python
4e0d90fc157760606ae8503762f10bdef30bff8c
Remove trailing slashes
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
bluebottle/impact/urls/api.py
bluebottle/impact/urls/api.py
from django.conf.urls import url from bluebottle.impact.views import ( ImpactTypeList, ImpactGoalList, ImpactGoalDetail ) urlpatterns = [ url(r'^types$', ImpactTypeList.as_view(), name='impact-type-list'), url(r'^goals$', ImpactGoalList.as_view(), name='impact-goal-list'), url( r'^goal...
from django.conf.urls import url from bluebottle.impact.views import ( ImpactTypeList, ImpactGoalList, ImpactGoalDetail ) urlpatterns = [ url(r'^types/$', ImpactTypeList.as_view(), name='impact-type-list'), url(r'^goals/$', ImpactGoalList.as_view(), name='impact-goal-list'), url( r'^go...
bsd-3-clause
Python
0dd21b0f13aa7bf4cc3061dca216c65cf73975e5
Make registration reports filterable and harmonize URL
knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3,knowledgecommonsdc/kcdc3
kcdc3/apps/classes/urls.py
kcdc3/apps/classes/urls.py
from django.conf.urls import patterns, include, url from models import Event, Registration from views import EventListView, EventDetailView, ResponseTemplateView, EventArchiveView, SessionView, RegistrationListView, TeacherAdminListView, FilteredTeacherAdminListView urlpatterns = patterns('kcdc3.apps.classes.views', ...
from django.conf.urls import patterns, include, url from models import Event, Registration from views import EventListView, EventDetailView, ResponseTemplateView, EventArchiveView, SessionView, RegistrationListView, TeacherAdminListView, FilteredTeacherAdminListView urlpatterns = patterns('kcdc3.apps.classes.views', ...
mit
Python
80afbf3b5be1716553b93ee6ba57404d40e43a94
Remove multiple workers
haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcountr,haematologic/cellcounter,oghm2/hackdayoxford,haematologic/cellcounter,haematologic/cellcountr,oghm2/hackdayoxford
gunicorn_conf.py
gunicorn_conf.py
accesslog = '-' access_log_format = '%({Host}i)s %(h)s %(l)s "%({X-Remote-User-Id}o)s: %({X-Remote-User-Name}o)s" %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s'
accesslog = '-' access_log_format = '%({Host}i)s %(h)s %(l)s "%({X-Remote-User-Id}o)s: %({X-Remote-User-Name}o)s" %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s' workers = 3
mit
Python
67346a13eb40d605da498b0bdba25ca661f08dd1
Remove unused imports
makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek
geotrek/feedback/templatetags/feedback_tags.py
geotrek/feedback/templatetags/feedback_tags.py
import json from geotrek.feedback.models import PredefinedEmail, ReportStatus from django import template from django.conf import settings register = template.Library() @register.simple_tag def suricate_management_enabled(): return settings.SURICATE_MANAGEMENT_ENABLED @register.simple_tag def suricate_workflo...
import json from geotrek.feedback.models import PredefinedEmail, ReportStatus from mapentity.models import LogEntry from django import template from django.conf import settings register = template.Library() @register.simple_tag def suricate_management_enabled(): return settings.SURICATE_MANAGEMENT_ENABLED @re...
bsd-2-clause
Python
eb712d30a6231b416e33d02a125daddf5322d51e
Add API docs for the Exscript.util.syslog module.
maximumG/exscript,knipknap/exscript,maximumG/exscript,knipknap/exscript
src/Exscript/util/syslog.py
src/Exscript/util/syslog.py
# Copyright (C) 2007-2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANT...
import imp, socket # This way of loading a module prevents Python from looking in the # current directory. (We need to avoid it due to the syslog module # name collision.) syslog = imp.load_module('syslog', *imp.find_module('syslog')) def netlog(message, source = None, host = 'localhost', ...
mit
Python
e05243983cb9167303a19e85a3c88f74da8e2612
Convert ipLocation function name to all lowercase
gdestuynder/MozDef,jeffbryner/MozDef,jeffbryner/MozDef,mpurzynski/MozDef,mpurzynski/MozDef,gdestuynder/MozDef,Phrozyn/MozDef,jeffbryner/MozDef,mozilla/MozDef,gdestuynder/MozDef,mpurzynski/MozDef,mozilla/MozDef,mpurzynski/MozDef,Phrozyn/MozDef,Phrozyn/MozDef,mozilla/MozDef,jeffbryner/MozDef,mozilla/MozDef,gdestuynder/Mo...
bot/slack/commands/ip_info.py
bot/slack/commands/ip_info.py
import netaddr import os from mozdef_util.geo_ip import GeoIP def is_ip(ip): try: netaddr.IPNetwork(ip) return True except Exception: return False def ip_location(ip): location = "" try: geoip_data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../.....
import netaddr import os from mozdef_util.geo_ip import GeoIP def is_ip(ip): try: netaddr.IPNetwork(ip) return True except Exception: return False def ipLocation(ip): location = "" try: geoip_data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../...
mpl-2.0
Python
859d5cd5ac60785f64a87353ae8f9170f5e29100
Make uri absolute, add get_release_data api
rocketDuck/folivora,rocketDuck/folivora,rocketDuck/folivora
folivora/utils/pypi.py
folivora/utils/pypi.py
#-*- coding: utf-8 -*- """ folivora.utils.pypi ~~~~~~~~~~~~~~~~~~~ Utilities to access pypi compatible servers. """ import time import xmlrpclib def get_seconds(hours): """Get number of seconds since epoch from now minus `hours`""" return int(time.time() - (60 * 60) * hours) DEFAULT_SERVER = 'h...
#-*- coding: utf-8 -*- """ folivora.utils.pypi ~~~~~~~~~~~~~~~~~~~ Utilities to access pypi compatible servers. """ import time import xmlrpclib def get_seconds(hours): """Get number of seconds since epoch from now minus `hours`""" return int(time.time() - (60 * 60) * hours) XML_RPC_SERVER = 'h...
isc
Python
30b991e78158f8dee25a34565493b1ca582d51c5
Simplify attribute check (menu items)
bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia
cmsplugin_zinnia/cms_toolbar.py
cmsplugin_zinnia/cms_toolbar.py
"""Toolbar extensions for CMS""" from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool class ZinniaToolbar(CMSToolbar): def populate(self): user = self.request.user zi...
"""Toolbar extensions for CMS""" from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool class ZinniaToolbar(CMSToolbar): def populate(self): user = self.request.user zi...
bsd-3-clause
Python
b3f926e013e81bb88e6634d453b31c5c30aac997
Add constant to distance scoring functions
JungeAlexander/cocoscore
cocoscore/ml/distance_scores.py
cocoscore/ml/distance_scores.py
from math import exp def _distance_scorer(data_df, score_function): distance_column = 'distance' if distance_column not in data_df.columns: raise ValueError(f'The given data_df does not have a {distance_column} column.') distances = data_df.loc[:, distance_column] return distances.apply(score_...
from math import exp def _distance_scorer(data_df, score_function): distance_column = 'distance' if distance_column not in data_df.columns: raise ValueError(f'The given data_df does not have a {distance_column} column.') distances = data_df.loc[:, distance_column] return distances.apply(score_...
mit
Python
33dd1a78a5bfdf0eca593816b15b34b86860c36f
install pip to bypass rally installation problem
CiscoSystems/os-sqe,CiscoSystems/os-sqe,CiscoSystems/os-sqe
lab/runners/RunnerRally.py
lab/runners/RunnerRally.py
from lab.runners import Runner class RunnerRally(Runner): def sample_config(self): return {'cloud': 'cloud name', 'task-yaml': 'path to the valid task yaml file'} def __init__(self, config): from lab.WithConfig import read_config_from_file super(RunnerRally, self).__init__(config=co...
from lab.runners import Runner class RunnerRally(Runner): def sample_config(self): return {'cloud': 'cloud name', 'task-yaml': 'path to the valid task yaml file'} def __init__(self, config): from lab.WithConfig import read_config_from_file super(RunnerRally, self).__init__(config=co...
apache-2.0
Python
a390d2551a5e39ad35888c4b326f50212b60cabf
add description of exception
xsank/Pyeventbus,xsank/Pyeventbus
eventbus/exception.py
eventbus/exception.py
__author__ = 'Xsank' class EventTypeError(Exception): '''Event type is invalid!''' def __str__(self): return self.__doc__ class UnregisterError(Exception): '''No listener to unregister!''' def __str__(self): return self.__doc__
__author__ = 'Xsank' class EventTypeError(Exception): '''Event type is invalid!''' class UnregisterError(Exception): '''No listener to unregister!'''
mit
Python
0f1fdb93c8005a26fcea10f708252a9e5f358270
add compare string in JRC
SubhasisDutta/JRC-Name-Parser,SubhasisDutta/CAMEO-JRC-Database,SubhasisDutta/CAMEO-JRC-Database,SubhasisDutta/CAMEO-JRC-Database,SubhasisDutta/CAMEO-JRC-Database,SubhasisDutta/CAMEO-JRC-Database
src/JRCFileParserService.py
src/JRCFileParserService.py
''' Created on Jan 30, 2017 @author: Subhasis ''' import csv from MongoManager import MongoManager class JRCFileParserService(object): ''' This class takes care of reading the input file parsing the text line by line and pushing it into MongoDB. ''' def __init__(self, file_path, db_config, schema, t...
''' Created on Jan 30, 2017 @author: Subhasis ''' import csv from MongoManager import MongoManager class JRCFileParserService(object): ''' This class takes care of reading the input file parsing the text line by line and pushing it into MongoDB. ''' def __init__(self, file_path, db_config, schema, t...
apache-2.0
Python
0ff9ccacf20d2896353df906426db06ce8c24605
Update ASIC count from 7 to 10
archangdcc/avalon-extras,qinfengling/Avalon-extras,qinfengling/Avalon-extras,Canaan-Creative/Avalon-extras,qinfengling/Avalon-extras,archangdcc/avalon-extras,archangdcc/avalon-extras,Canaan-Creative/Avalon-extras,qinfengling/Avalon-extras,archangdcc/avalon-extras,Canaan-Creative/Avalon-extras,Canaan-Creative/Avalon-ext...
scripts/avalon3-a3233-modular-test.py
scripts/avalon3-a3233-modular-test.py
#!/usr/bin/env python2.7 # This simple script was for test A3255 modular. there are 128 cores in one A3255 chip. # If all cores are working the number should be 0. # If some of them not working the number is the broken cores count. from serial import Serial from optparse import OptionParser import binascii import sys...
#!/usr/bin/env python2.7 # This simple script was for test A3255 modular. there are 128 cores in one A3255 chip. # If all cores are working the number should be 0. # If some of them not working the number is the broken cores count. from serial import Serial from optparse import OptionParser import binascii import sys...
unlicense
Python
1b704c24eaeb412e0636e5a0111ce2ac990998fd
remove confirm_text option in example
shymonk/django-datatable,arambadk/django-datatable,shymonk/django-datatable,arambadk/django-datatable,shymonk/django-datatable,arambadk/django-datatable
example/app/tables.py
example/app/tables.py
#!/usr/bin/env python # coding: utf-8 from table.columns import Column, LinkColumn, Link from table.utils import A from table import Table from models import Person class PersonTable(Table): id = Column(field='id', header=u'序号', header_attrs={'width': '50%'}) name = Column(field='name', header=u'姓名', header_...
#!/usr/bin/env python # coding: utf-8 from table.columns import Column, LinkColumn, Link from table.utils import A from table import Table from models import Person class PersonTable(Table): id = Column(field='id', header=u'序号', header_attrs={'width': '50%'}) name = Column(field='name', header=u'姓名', header_...
mit
Python
cb34162de51f36e2d6b846cfbb6e9d6fe8801e48
implement send message
mlsteele/one-time-chat,mlsteele/one-time-chat,mlsteele/one-time-chat
client/client.py
client/client.py
class OTC_Client(object): def __init__(self): raise NotImplementedError("TODO: write a client") def send(message): payload = {'message':message} r = requets.post(self.server_address,data=payload) raise NotImplementedError("TODO: write send method") def recieve(): rai...
class OTC_Client(object): def __init__(self): raise NotImplementedError("TODO: write a client") def send(message): raise NotImplementedError("TODO: write send method") def recieve(): raise NotImplementedError("TODO: write recieve") def decrypt(message, pad_index=current_index): ...
mit
Python
f1ed9cf573ec8aaa61e9aefb124b453a5a353db4
fix pointe-claire
opencivicdata/scrapers-ca,opencivicdata/scrapers-ca
ca_qc_pointe_claire/people.py
ca_qc_pointe_claire/people.py
from pupa.scrape import Scraper from utils import lxmlize, CanadianLegislator as Legislator import re COUNCIL_PAGE = 'http://www.ville.pointe-claire.qc.ca/en/city-hall-administration/your-council/municipal-council.html' class PointeClairePersonScraper(Scraper): def get_people(self): page = lxmlize(COUNCIL_P...
from pupa.scrape import Scraper from utils import lxmlize, CanadianLegislator as Legislator import re COUNCIL_PAGE = 'http://www.ville.pointe-claire.qc.ca/en/city-hall-administration/your-council/municipal-council.html' class PointeClairePersonScraper(Scraper): def get_people(self): page = lxmlize(COUNCIL_P...
mit
Python
9a3081c58818ad28e216e9a14fc573c4a392f55f
Add method for getting csv Hours Worked reports for Jobs Board and Payment Plan
pkimber/invoice,pkimber/invoice,pkimber/invoice
invoice/management/commands/ticket_time_csv.py
invoice/management/commands/ticket_time_csv.py
# -*- encoding: utf-8 -*- import csv import os from django.core.management.base import BaseCommand from invoice.models import TimeRecord class Command(BaseCommand): help = "Export ticket time to a CSV file" def _jobs_board_tickets(self): return ( 732, 746, 7...
# -*- encoding: utf-8 -*- import csv import os from django.core.management.base import BaseCommand from invoice.models import TimeRecord class Command(BaseCommand): help = "Export ticket time to a CSV file" def handle(self, *args, **options): """Export ticket time to a CSV file. Columns: ...
apache-2.0
Python
8fa0ca6a307f7b23545d297d17f8eb05f037978f
fix one e2e test problem (#459)
kubeflow/kfserving-lts,kubeflow/kfserving-lts,kubeflow/kfserving-lts,kubeflow/kfserving-lts,kubeflow/kfserving-lts,kubeflow/kfserving-lts
test/e2e/utils.py
test/e2e/utils.py
# Copyright 2019 kubeflow.org. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# Copyright 2019 kubeflow.org. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
Python
49be60d27b5d5ce40c20847f79a8dd09f580a830
Update _var_dump.py
sha256/python-var-dump
var_dump/_var_dump.py
var_dump/_var_dump.py
from __future__ import print_function import sys try: from types import NoneType except: NoneType = type(None) if sys.version_info > (3,): long = int unicode = str __author__ = "Shamim Hasnath" __copyright__ = "Copyright 2013, Shamim Hasnath" __license__ = "BSD License" __version__ = "1.0.1" ...
from __future__ import print_function import sys try: from types import NoneType except: NoneType = type(None) if sys.version_info > (3,): long = int unicode = str __author__ = "Shamim Hasnath" __copyright__ = "Copyright 2013, Shamim Hasnath" __license__ = "BSD License" __version__ = "1.0.1" ...
bsd-3-clause
Python
206696e82f3e5be4a64e60abdb59ca51d2b1461e
Add a test for rgb+mp to verify that it continues to work.
deepmind/pysc2
pysc2/tests/multi_player_env_test.py
pysc2/tests/multi_player_env_test.py
#!/usr/bin/python # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
#!/usr/bin/python # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
Python
48e3dab4ce044554b0ff606dea340ff8b6e5d928
Update __init__.py
EldarAliiev/python-edbo-connector,ZimGreen/edbo-connector-py
edbo_connector/__init__.py
edbo_connector/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ edbo_connector Author: Eldar Aliiev Email: e.aliiev@vnmu.edu.ua """ from .client import EDBOWebApiClient __name__ = 'python-edbo-connector' __author__ = 'Eldar Aliiev' __copyright__ = 'Copyright 2018, National Pirogov Memorial Medical University, Vinnytsya' __credits...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ edbo_connector Author: Eldar Aliiev Email: e.aliiev@vnmu.edu.ua """ from .client import EDBOWebApiClient __name__ = 'python-edbo-connector' __author__ = 'Eldar Aliiev' __copyright__ = 'Copyright 2018, National Pirogov Memorial Medical University, Vinnytsya' __credits...
mit
Python
c95c222384c2c0d887d435017196c9af4137d1b2
set numba parallel option
IntelLabs/hpat,IntelLabs/hpat,IntelLabs/hpat,IntelLabs/hpat
hpat/__init__.py
hpat/__init__.py
from __future__ import print_function, division, absolute_import import numba from numba import * from .compiler import add_hpat_stages set_user_pipeline_func(add_hpat_stages) del add_hpat_stages def jit(signature_or_function=None, **options): # set nopython by default if 'nopython' not in options: o...
from __future__ import print_function, division, absolute_import import numba from numba import * from .compiler import add_hpat_stages set_user_pipeline_func(add_hpat_stages) del add_hpat_stages def jit(signature_or_function=None, **options): # set nopython by default if 'nopython' not in options: o...
bsd-2-clause
Python
77651861fc5a27d1d62293e3bc66d62ae193221d
add tolerance option to F.sqrt
niboshi/chainer,chainer/chainer,ronekko/chainer,niboshi/chainer,niboshi/chainer,hvy/chainer,okuta/chainer,niboshi/chainer,wkentaro/chainer,hvy/chainer,jnishi/chainer,wkentaro/chainer,hvy/chainer,ktnyt/chainer,ktnyt/chainer,jnishi/chainer,hvy/chainer,chainer/chainer,keisuke-umezawa/chainer,chainer/chainer,aonotas/chaine...
tests/chainer_tests/functions_tests/math_tests/test_sqrt.py
tests/chainer_tests/functions_tests/math_tests/test_sqrt.py
import unittest import numpy import chainer.functions as F from chainer import testing # sqrt def make_data(shape, dtype): x = numpy.random.uniform(0.1, 5, shape).astype(dtype) gy = numpy.random.uniform(-1, 1, shape).astype(dtype) ggx = numpy.random.uniform(-1, 1, shape).astype(dtype) return x, gy,...
import unittest import numpy import chainer.functions as F from chainer import testing # sqrt def make_data(shape, dtype): x = numpy.random.uniform(0.1, 5, shape).astype(dtype) gy = numpy.random.uniform(-1, 1, shape).astype(dtype) ggx = numpy.random.uniform(-1, 1, shape).astype(dtype) return x, gy,...
mit
Python
cc17390eada091da34fed92ee7e2090adc1fa87e
Fix for `plot_field` function failing on non-square grids #666
opesci/devito,opesci/devito
examples/cfd/tools.py
examples/cfd/tools.py
from mpl_toolkits.mplot3d import Axes3D # noqa import numpy as np from matplotlib import pyplot, cm def plot_field(field, xmax=2., ymax=2., zmax=None, view=None, linewidth=0): """Utility plotting routine for 2D data :param field: Numpy array with field data to plot :param xmax: (Optional) Length of the...
from mpl_toolkits.mplot3d import Axes3D # noqa import numpy as np from matplotlib import pyplot, cm def plot_field(field, xmax=2., ymax=2., zmax=None, view=None, linewidth=0): """Utility plotting routine for 2D data :param field: Numpy array with field data to plot :param xmax: (Optional) Length of the...
mit
Python
173317003a59afb639e6f4f5d5eca41a1f390979
Revise q05 to successfully use partial derivatives of u and v for gradient descent of E (error).
JMill/edX-Learning-From-Data-Explanations
hw05/hw05ex05.py
hw05/hw05ex05.py
# dE/du (u e^v - 2v e^(-u))^2 = 2 (u e^v - 2v e^(-u))(e^v + 2v e^(-u)) #from decimal import Decimal from math import sqrt, exp, fabs #natural exponent, e**x. and absolute value def calcEwrtu(u,v): ''' Given u and v, the hypothesis and the target function, return the partial deriv w.r.t. u for gradient des...
# dE/du (u e^v - 2v e^(-u))^2 = 2 (u e^v - 2v e^(-u))(e^v + 2v e^(-u)) #from decimal import Decimal from math import exp #natural exponent, e**x def calcE(u,v): return 2 * ( u*exp(v) - 2*v*exp(-u) ) * ( exp(v) + 2*v*exp(-u) ) i = 0 eta = 0.1 # u"\u03B7" #E = float(10^(-14)) #E = 10^(-14) #E = Decimal(0.0000000000...
apache-2.0
Python
c0eedfeca0e19a65e4484e63790319cf18433343
change optimizer in example
keras-team/keras,nebw/keras,kemaswill/keras,relh/keras,kuza55/keras,dolaameng/keras,DeepGnosis/keras,keras-team/keras
examples/mnist_mlp.py
examples/mnist_mlp.py
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist...
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist...
apache-2.0
Python
a5be3784d0cfce42c0cdb6bc83b37a07dff7a164
Implement accuracy on GPU
hidenori-t/chainer,hvy/chainer,niboshi/chainer,sinhrks/chainer,cupy/cupy,bayerj/chainer,woodshop/complex-chainer,okuta/chainer,okuta/chainer,benob/chainer,nushio3/chainer,kikusu/chainer,nushio3/chainer,truongdq/chainer,ttakamura/chainer,jnishi/chainer,wkentaro/chainer,ktnyt/chainer,aonotas/chainer,masia02/chainer,wkent...
chainer/functions/accuracy.py
chainer/functions/accuracy.py
import numpy from pycuda import gpuarray from chainer import cuda, Function class Accuracy(Function): """Compute accuracy within minibatch.""" def forward_cpu(self, inputs): y, t = inputs y = y.reshape(y.shape[0], y.size / y.shape[0]) # flatten pred = y.argmax(axis=1) return (...
import numpy from chainer import cuda, Function class Accuracy(Function): """Compute accuracy within minibatch.""" def forward_cpu(self, inputs): y, t = inputs y = y.reshape(y.shape[0], y.size / y.shape[0]) # flatten pred = y.argmax(axis=1) return (pred == t).mean(dtype=numpy....
mit
Python
f3c5a477141e5f3845641111f775ea90398be633
Add numpy.ndarray and cupy.ndarray as input type
hvy/chainer,wkentaro/chainer,tkerola/chainer,jnishi/chainer,keisuke-umezawa/chainer,chainer/chainer,okuta/chainer,niboshi/chainer,chainer/chainer,wkentaro/chainer,chainer/chainer,aonotas/chainer,niboshi/chainer,hvy/chainer,ktnyt/chainer,ronekko/chainer,rezoo/chainer,jnishi/chainer,ktnyt/chainer,ktnyt/chainer,jnishi/cha...
chainer/functions/math/erf.py
chainer/functions/math/erf.py
import math import warnings import numpy import chainer from chainer import cuda from chainer import function_node from chainer import utils from chainer.utils import type_check _erf_cpu = None class Erf(function_node.FunctionNode): @property def label(self): return 'erf' def check_type_forw...
import math import warnings import numpy import chainer from chainer import cuda from chainer import function_node from chainer import utils from chainer.utils import type_check _erf_cpu = None class Erf(function_node.FunctionNode): @property def label(self): return 'erf' def check_type_forw...
mit
Python
8c4a54690cb99b63a9cf825e2958bb2b48cd7e5d
Complete lc009_palindrome_number.py
bowen0701/algorithms_data_structures
lc009_palindrome_number.py
lc009_palindrome_number.py
"""Leetcode 9. Palindrome Number Easy Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121-. The...
"""Leetcode 9. Palindrome Number Easy Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121-. The...
bsd-2-clause
Python
9e9f831a757af01cc3b1edfe590e27f7ab53c2ce
define interfaces
mfcloud/python-zvm-sdk,mfcloud/python-zvm-sdk,mfcloud/python-zvm-sdk,mfcloud/python-zvm-sdk
zvmsdk/vmops.py
zvmsdk/vmops.py
from log import LOG import utils as zvmutils VMOPS = None def _get_vmops(): if VMOPS is None: VMOPS = VMOps() return VMOPS def run_instance(instance_name, image_id, cpu, memory, login_password, ip_addr): """Deploy and provision a virtual machine. Input parameters: :...
from log import LOG import utils as zvmutils class VMOps(object): def __init__(self): self._xcat_url = zvmutils.get_xcat_url() def _power_state(self, instance_name, method, state): """Invoke xCAT REST API to set/get power state for a instance.""" body = [state] url = self._x...
apache-2.0
Python
dfaa289465a2cdc837884718624b9a8a65e511b3
Improve proxy rax example
Dentosal/python-sc2
examples/proxy_rax.py
examples/proxy_rax.py
import random import sc2 from sc2 import Race, Difficulty from sc2.constants import * from sc2.player import Bot, Computer class ProxyRaxBot(sc2.BotAI): async def on_step(self, state, iteration): cc = self.units(COMMANDCENTER) if not cc.exists: target = self.known_enemy_structures.rand...
import random import sc2 from sc2 import Race, Difficulty from sc2.constants import * from sc2.player import Bot, Computer class ProxyRaxBot(sc2.BotAI): async def on_step(self, state, iteration): cc = self.units(COMMANDCENTER) if not cc.exists: target = self.known_enemy_structures.rand...
mit
Python
a4b7878880f5a8d275129949179b4b30044f0c86
Update __init__.py
jason-neal/eniric,jason-neal/eniric
eniric_scripts/__init__.py
eniric_scripts/__init__.py
__all__ = [ "bary_shift_atmmodel", "phoenix_precision", "precision_four_panel", "split_atmmodel", ]
__all__ = [ "bary_shift_atmmodel", "phoenix_precision.py", "precision_four_panel", "split_atmmodel", ]
mit
Python
10d5e90e65e792d0fae3879dd5f512bdc7b95da6
Add missing dependency to perl-xml-parser (#12903)
iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack
var/spack/repos/builtin/packages/perl-xml-parser/package.py
var/spack/repos/builtin/packages/perl-xml-parser/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # from spack import * class PerlXmlParser(PerlPackage): """XML::Parser - A perl module for parsing XML documents""" ...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # from spack import * class PerlXmlParser(PerlPackage): """XML::Parser - A perl module for parsing XML documents""" ...
lgpl-2.1
Python
ee75d9530bb6b9e409449c8e9d5ffb3a3578f5d8
Fix not coloring for new repositories
Brickstertwo/git-commands
bin/commands/stateextensions/status.py
bin/commands/stateextensions/status.py
import os import re import subprocess from colorama import Fore def title(): return 'status' def accent(**kwargs): new_repository = kwargs.get('new_repository', False) show_color = kwargs.get('show_color', 'always') if new_repository: status_title = '{no_color}({green}master{no_color})'.f...
import os import re import subprocess from colorama import Fore def title(): return 'status' def accent(**kwargs): new_repository = kwargs.get('new_repository', False) show_color = kwargs.get('show_color', 'always') if new_repository: status_title = '{no_color}({green}master{no_color})'.f...
mit
Python
c71730cf4f3d8937f0ef1608bf670c28ec44eb0b
Complete and prettified
KristinCovert/coding101
Challenge3.py
Challenge3.py
# Exercise 3 (and Solution) # Take a list, say for example this one: # a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] # and write a program that prints out all the elements of the list that are less than 5. # Extras: # Instead of printing the elements one by one, make a new list that has all the elements less than 5 ...
# Exercise 3 (and Solution) # Take a list, say for example this one: # a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] # and write a program that prints out all the elements of the list that are less than 5. # Extras: # Instead of printing the elements one by one, make a new list that has all the elements less than 5 ...
apache-2.0
Python
d4ee599fe9cd88315d129e036fb034111bfc2272
Add types to common url parameters (#50000)
thaim/ansible,thaim/ansible
lib/ansible/utils/module_docs_fragments/url.py
lib/ansible/utils/module_docs_fragments/url.py
# -*- coding: utf-8 -*- # Copyright: (c) 2018, John Barker <gundalow@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: url: description: -...
# (c) 2018, John Barker<gundalow@redhat.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
mit
Python
e9df15b0f084ed9e026a5de129b109a3c546f99c
Handle comments in parse tree.
andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper,andybalaam/pepper
src/libeeyore/parse_tree_to_cpp.py
src/libeeyore/parse_tree_to_cpp.py
from itertools import imap import builtins from cpp.cpprenderer import EeyCppRenderer from environment import EeyEnvironment from functionvalues import * from languagevalues import * from values import * def parse_tree_string_to_values( string ): return eval( string ) def remove_comments( ln ): i = ln.find( "#" )...
import builtins from cpp.cpprenderer import EeyCppRenderer from environment import EeyEnvironment from values import * def parse_tree_string_to_values( string ): return eval( string ) def non_empty_line( ln ): return ( ln.strip() != "" ) def parse_tree_to_cpp( parse_tree_in_fl, cpp_out_fl ): env = EeyEnvironmen...
mit
Python
7d09f713b929f60cd62ce48de2e2a8f27aa4de45
Fix unit tests.
qusp/orange3,kwikadi/orange3,marinkaz/orange3,qPCR4vir/orange3,kwikadi/orange3,marinkaz/orange3,kwikadi/orange3,kwikadi/orange3,cheral/orange3,cheral/orange3,marinkaz/orange3,marinkaz/orange3,qusp/orange3,qusp/orange3,marinkaz/orange3,qPCR4vir/orange3,cheral/orange3,qPCR4vir/orange3,qPCR4vir/orange3,cheral/orange3,cher...
Orange/tests/test_random_forest.py
Orange/tests/test_random_forest.py
import unittest import Orange.data import Orange.classification.random_forest as rf from Orange.evaluation import scoring, testing class RandomForestTest(unittest.TestCase): def test_RandomForest(self): table = Orange.data.Table('iris') forest = rf.RandomForestLearner() results = testing....
import unittest import Orange.data import Orange.classification.random_forest as rf from Orange.evaluation import scoring, testing class RandomForestTest(unittest.TestCase): def test_RandomForest(self): table = Orange.data.Table('titanic') forest = rf.RandomForestLearner() results = testi...
bsd-2-clause
Python
7041d2649b08d961cf5c7c4c663282e55526f2eb
Update pictures.py
haitaka/DroiTaka
cogs/pictures.py
cogs/pictures.py
from discord.ext import commands import copy import requests class Pic: """Мемасики и просто картинки.""" def __init__(self, bot): self.bot = bot self.pic_dir = 'pictures/' self.pic_dict = {} self.update_pics() def update_pics(self): file_list...
from discord.ext import commands import copy import requests class Pic: """Мемасики и просто картинки.""" def __init__(self, bot): self.bot = bot self.pic_dir = 'pictures/' self.pic_dict = {} self.update_pics() def update_pics(self): file_list...
mit
Python
a6a78260b47f3a632564e7a80ce25b3b75e242e9
Add sample code for API key authentication
timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug
examples/authentication.py
examples/authentication.py
'''A basic example of authentication requests within a hug API''' import hug # Several authenticators are included in hug/authentication.py. These functions # accept a verify_user function, which can be either an included function (such # as the basic username/bassword function demonstrated below), or logic of your # ...
'''A basic example of authentication requests within a hug API''' import hug # Several authenticators are included in hug/authentication.py. These functions # accept a verify_user function, which can be either an included function (such # as the basic username/bassword function demonstrated below), or logic of your # ...
mit
Python
6e660da290db674eebb0c353662e5400bc735397
Update backplane demo to be py3 only
sparkslabs/guild,sparkslabs/guild,sparkslabs/guild
examples/backplane_demo.py
examples/backplane_demo.py
#!/usr/bin/python import time from guild.actor import * from guild.components import Backplane, PublishTo, SubscribeTo, Printer class Producer(Actor): @process_method def process(self): self.output("hello") @late_bind_safe def output(self, value): pass Backplane("HELLO").start() p...
#!/usr/bin/python import time from guild.actor import * from guild.components import Backplane, PublishTo, SubscribeTo, Printer class Producer(Actor): @process_method def process(self): self.output("hello") @late_bind_safe def output(self, value): pass Backplane("HELLO").start() p...
apache-2.0
Python
0b37c0f1cba1a6e89a63f9597d61383b81b1a2d9
Fix typo
SahilTikale/haas,CCI-MOC/haas
haas/client/network.py
haas/client/network.py
import json from haas.client.base import ClientBase class Network(ClientBase): """Consists of calls to query and manipulate network related objects and relations. """ def list(self): """Lists all networks under HIL """ url = self.object_url('networks') ...
import json from haas.client.base import ClientBase class Network(ClientBase): """Consists of calls to query and manipulate network related objects and relations. """ def list(self): """Lists all projects under HIL """ url = self.object_url('networks') ...
apache-2.0
Python
56f6339401fe5f792915279d98f553f3415e2c62
Fix module docstring (#163)
balloob/netdisco
netdisco/discoverables/harmony.py
netdisco/discoverables/harmony.py
"""Discover Harmony Hub remotes.""" from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """Add support for discovering Harmony Hub remotes""" def get_entries(self): """Get all the Harmony uPnP entries.""" return self.find_by_device_description({ "manufacturer": "L...
"""Discover Netgear routers.""" from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """Add support for discovering Harmony Hub remotes""" def get_entries(self): """Get all the Harmony uPnP entries.""" return self.find_by_device_description({ "manufacturer": "Logit...
mit
Python
d3425693d245c9dfa5350017903fc02a11ecd881
use width/height as percent base for x/y
pureqml/qmlcore,pureqml/qmlcore,pureqml/qmlcore
compiler/lang.py
compiler/lang.py
import re def value_is_trivial(value): if value is None or not isinstance(value, str): return False if value[0] == '(' and value[-1] == ')': value = value[1:-1] if value == 'true' or value == 'false': return True try: float(value) return True except: pass if value[0] == '"' and value[-1] == '"': if...
import re def value_is_trivial(value): if value is None or not isinstance(value, str): return False if value[0] == '(' and value[-1] == ')': value = value[1:-1] if value == 'true' or value == 'false': return True try: float(value) return True except: pass if value[0] == '"' and value[-1] == '"': if...
mit
Python
08d11dc308db007750fe06ea906264a6ab9f44cd
Add logging when cloning repository
omarkhan/opencraft,open-craft/opencraft,open-craft/opencraft,omarkhan/opencraft,omarkhan/opencraft,open-craft/opencraft,brousch/opencraft,open-craft/opencraft,omarkhan/opencraft,brousch/opencraft,open-craft/opencraft,brousch/opencraft
instance/repo.py
instance/repo.py
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <xavier@opencraft.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Soft...
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <xavier@opencraft.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Soft...
agpl-3.0
Python