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 |
|---|---|---|---|---|---|---|---|---|
eed57633fa0165e50925649246074d0c6ead1be7 | Add response y mimetypes | DavidGSola/Basic-RESTful-Service-with-FLASK,DavidGSola/Basic-RESTful-Service-with-FLASK,DavidGSola/Basic-RESTful-Service-with-FLASK | practica1.py | practica1.py | # -*- coding: utf-8 -*-
from flask import Flask, url_for, render_template, Response
import random
app = Flask(__name__)
@app.route('/')
def api_root():
mensaje = 'Welcome'
return Response(mensaje, status=200, mimetype='text/plain')
@app.route('/hola')
def api_home():
mensaje = 'Hola -cañón-'
return Response(mens... | # -*- coding: utf-8 -*-
from flask import Flask, url_for, render_template
import random
app = Flask(__name__)
@app.route('/')
def api_root():
return 'Welcome'
@app.route('/hola')
def api_home():
return 'Hola -cañón-'
@app.route('/imagen')
def api_imagen():
return '<img src=' + url_for('static',filename='img/imag... | apache-2.0 | Python |
1af34fa1e249e87f2045f0e12f7b2d7c49680fc9 | Update update.py | AeonDave/tilt | lib/update.py | lib/update.py | #!/usr/bin/python
"""
Copyright (c) 2014 tilt (https://github.com/AeonDave/tilt)
See the file 'LICENSE' for copying permission
"""
import sys, os
from lib.logger import logger
from subprocess import PIPE
from subprocess import Popen
from settings import ROOTDIR
def update():
if not os.path.exists(os.path.join(RO... | #!/usr/bin/python
"""
Copyright (c) 2014 tilt (https://github.com/AeonDave/tilt)
See the file 'LICENSE' for copying permission
"""
import sys, os
from lib.logger import logger
from subprocess import PIPE
from subprocess import Popen
from settings import ROOTDIR
def update():
if not os.path.exists(os.path.join(RO... | mit | Python |
39e6a0b3a0d78b291bbb8478ceea37181af1fc36 | change to PerfKitBenchmarker Authors | kivio/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,mateusz-blaszkowski/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,mateusz-blaszkowski/PerfKitBenchmarker,kivio/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker,GoogleCloudPlatform/PerfK... | perfkitbenchmarker/alicloud/__init__.py | perfkitbenchmarker/alicloud/__init__.py | # Copyright 2015 PerfKitBenchmarker 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 appli... | # Copyright 2015 Alibaba 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 applicable law or ag... | apache-2.0 | Python |
5d52e507c59b36cd3babc12ac1aa61d225329940 | Apply this task asynchronously | gmauro/presta,gmauro/presta | presta/qc.py | presta/qc.py | from presta.app.tasks import copy_qc_dirs
class qcWorkflow(object):
def __init__(self, args=None, logger=None):
self.logger = logger
self.dspath = args.ds_path
self.exportpath = args.export_path
def run(self):
self.logger.info('Coping qc dirs from {} to {}'.format(self.dspath,... | from presta.app.tasks import copy_qc_dirs
class qcWorkflow(object):
def __init__(self, args=None, logger=None):
self.logger = logger
self.dspath = args.ds_path
self.exportpath = args.export_path
def run(self):
self.logger.info('Coping qc dirs from {} to {}'.format(self.dspath,... | mit | Python |
54cfb9864256b27b9f4cd411f170cc12d47727e5 | Add enum field for vSphere backend | luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py | appengine/components/components/machine_provider/dimensions.py | appengine/components/components/machine_provider/dimensions.py | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Dimensions for the Machine Provider."""
from protorpc import messages
class Backend(messages.Enum):
"""Lists valid backends."""
DUMMY = 0
GCE = 1... | # Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Dimensions for the Machine Provider."""
from protorpc import messages
class Backend(messages.Enum):
"""Lists valid backends."""
DUMMY = 0
GCE = 1... | apache-2.0 | Python |
020b2518efce2d973093a366e0a9abfadbd602fd | Add help_text and required=False to the PIN field | m4tx/usos-id-mapper,m4tx/usos-id-mapper | main/forms.py | main/forms.py | from django import forms
class IndexForm(forms.Form):
usos_auth_pin = forms.IntegerField(
label='USOS Authorization PIN',
help_text='If not filled out, then only the cache is used. Note that '
'this means that some IDs may fail to be looked up.',
required=False)
id_li... | from django import forms
class IndexForm(forms.Form):
usos_auth_pin = forms.IntegerField(label='USOS Authorization PIN')
id_list = forms.CharField(
widget=forms.Textarea, label='ID List',
help_text='List of students IDs to query, one per line.')
student_id_regex = forms.CharField(
... | mit | Python |
78e6df5de1862b5e79ea19481ca5e92e3f4aa74f | update try_pandas.py | hanhanwu/Hanhan_Data_Science_Practice,hanhanwu/Hanhan_Data_Science_Practice,hanhanwu/Hanhan_Data_Science_Practice,hanhanwu/Hanhan_Data_Science_Practice | try_pandas.py | try_pandas.py | # I'm using Spark Cloud Community Edition, sicne my own machine cannot have the right numpy for pandas...
# So, in this code, so features could only be used in Spark Cloud Python Notebook
# Try pandas :)
# cell 1 - load the data (I upload the .csv into Spark Cloud first)
import pandas as pd
import numpy as np
## The ... | # I'm using Spark Cloud Community Edition, sicne my own machine cannot have the right numpy for pandas...
# So, in this code, so features could only be used in Spark Cloud Python Notebook
# Try pandas :)
# cell 1 - load the data (I upload the .csv into Spark Cloud first)
import pandas as pd
import numpy as np
## The ... | mit | Python |
b0660993cb7ac0a00e4f08f398ebad6c1a400c05 | Complete the parseHeader method | njanik/ols-parser | ols_parser.py | ols_parser.py |
class OlsFileParser:
inputFile = ''
olsData = None
def __init__(self, inputFile):
self.olsData = OlsData()
self.inputFile = inputFile
self.parseHeader()
def parseHeader(self):
with open(self.inputFile, "r") as file:
for line in file:
... |
class OlsFileParser:
inputFile = ''
olsData = None
def __init__(self, inputFile):
self.olsData = OlsData()
self.inputFile = inputFile
self.parseHeader()
def parseHeader(self):
with open(self.inputFile, "r") as file:
for line in file:
... | mit | Python |
eef4ab2c7556d0d4893920001cba098a08cbe982 | fix errors | banchee/pirobot,banchee/pirobot | TankController/switch.py | TankController/switch.py | import RPi.GPIO as gpio
class switch(object):
def __init__(self, vccpin=0, ch1=0, ch2=0):
self.vccpin = vccpin
self.ch1 = ch1
self.ch2 = ch2
gpio.setmode(GPIO.BOARD)
self.gpioSetup
def gpioSetup(self):
gpio.setup(self.vccpin, gpio.OUT)
gpio.setup(self.ch1, gpio.OUT)
gpio.setup(self... | import RPi.GPIO as gpio
GPIO.setmode(GPIO.BOARD)
class switch(object):
def __init__(self, vccpin=0, ch1=0, ch2=0):
self.vccpin = vccpin
self.ch1 = ch1
self.ch2 = ch2
self.gpioSetup
def gpioSetup(self):
gpio.setup(self.vccpin, gpio.OUT)
gpio.setup(self.ch1, gpio.OUT)
gpio.setup(self.c... | mit | Python |
2b31cab4edd720a017ebd21343a5fbb226af1a16 | Enable HighlightMagics in slides exporter | ipython/ipython,ipython/ipython | IPython/nbconvert/exporters/slides.py | IPython/nbconvert/exporters/slides.py | """
Contains slide show exporter
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------... | """
Contains slide show exporter
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------... | bsd-3-clause | Python |
74c1756a74835985dba101805774df507df8b3b2 | Sort imports | Mebus/pyresticd,Mebus/pyresticd | pyresticd.py | pyresticd.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import getpass
import time
from subprocess import Popen
from twisted.internet import reactor, task
# Configuration
timeout = 3600*24*3 # Period
restic_executable = 'restic'
restic_args = ''
restic_password = ''
# Program
def do_restic_backup(password):
print('Startin... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import getpass
import time
from subprocess import Popen
from twisted.internet import task
from twisted.internet import reactor
# Configuration
timeout = 3600*24*3 # Period
restic_executable = 'restic'
restic_args = ''
restic_password = ''
# Program
def do_restic_backup(p... | mit | Python |
3cab988017a694491d9faa2dc0d41fdcb5a923ea | set volume to max | conradstorz/OldTimeRadio | play_radio.py | play_radio.py | import os
import sys
from time import sleep
import random
import pygame
def play(directory):
file = random.choice(os.listdir(directory))
pygame.init()
pygame.mixer.init()
pygame.set_volume(1)
pygame.mixer.music.load(directory + file)
print 'Playing: ', file
pygame.mixer.music.play()
while... | import os
import sys
from time import sleep
import random
import pygame
def play(directory):
file = random.choice(os.listdir(directory))
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load(directory + file)
print 'Playing: ', file
pygame.mixer.music.play()
while True:
playcount = 20... | apache-2.0 | Python |
6bde303be7c52990194e04752a455b70fb1ff45d | bump to 6.2.1dev0 | praw-dev/praw,gschizas/praw,leviroth/praw,gschizas/praw,praw-dev/praw,leviroth/praw | praw/const.py | praw/const.py | """PRAW constants."""
from .endpoints import API_PATH # noqa: F401
__version__ = "6.2.1dev0"
USER_AGENT_FORMAT = "{} PRAW/" + __version__
MAX_IMAGE_SIZE = 512000
MIN_JPEG_SIZE = 128
MIN_PNG_SIZE = 67
JPEG_HEADER = b"\xff\xd8\xff"
PNG_HEADER = b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"
| """PRAW constants."""
from .endpoints import API_PATH # noqa: F401
__version__ = "6.2.0"
USER_AGENT_FORMAT = "{} PRAW/" + __version__
MAX_IMAGE_SIZE = 512000
MIN_JPEG_SIZE = 128
MIN_PNG_SIZE = 67
JPEG_HEADER = b"\xff\xd8\xff"
PNG_HEADER = b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"
| bsd-2-clause | Python |
3e1408affa823af2ed95decf52b002614d060a26 | Add tests for active_class templatetag | hzj123/56th,geoffkilpin/pombola,hzj123/56th,geoffkilpin/pombola,mysociety/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,geoffkilpin/pombola,hzj123/56th,patricmutwiri/pombola,patricmutwiri/pombola,mysociety/pombola,geoffkilpin/pombola,patricmutwiri/pombola,ken-muturi/pombola,ken-muturi/pombola,mysociety/pombola,ken-... | pombola/core/tests/test_templatetags.py | pombola/core/tests/test_templatetags.py |
from django.test import TestCase
from ..templatetags.breadcrumbs import breadcrumbs
from ..templatetags.active_class import active_class
class BreadcrumbTest(TestCase):
def test_breadcrumbs(self):
"""Check that the breadcrumbs are generated as expected"""
home_li = '<li><a href="/" title="Bre... |
from django.test import TestCase
from ..templatetags.breadcrumbs import breadcrumbs
class BreadcrumbTest(TestCase):
def test_breadcrumbs(self):
"""Check that the breadcrumbs are generated as expected"""
home_li = '<li><a href="/" title="Breadcrumb link to the homepage.">Home</a> <span class="... | agpl-3.0 | Python |
e66a2db0ed2710a7ec9a6ae9708183befa4da5de | add missing public items to __all__ | jayvdb/mwparserfromhell,earwig/mwparserfromhell,earwig/mwparserfromhell,jayvdb/mwparserfromhell,earwig/mwparserfromhell,jayvdb/mwparserfromhell,jayvdb/mwparserfromhell | mwparserfromhell/nodes/__init__.py | mwparserfromhell/nodes/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | mit | Python |
1d5387319eeec90cd1119e95fc776c8f65671da7 | remove infer_path from main | alfredodeza/merfi | merfi/main.py | merfi/main.py | import os
import sys
from tambo import Transport
from merfi import logger
from merfi import backends
import merfi
from merfi.decorators import catches
class Merfi(object):
_help = """
merfi: A utility to find Release files and sign them with a given backend
signature engine like rpm-sign or gpg.
Version: %s
Gl... | import os
import sys
from tambo import Transport
from merfi import logger
from merfi import backends
import merfi
from merfi.decorators import catches
class Merfi(object):
_help = """
merfi: A utility to find Release files and sign them with a given backend
signature engine like rpm-sign or gpg.
Version: %s
Gl... | mit | Python |
8b6f765147edfc49f1532b07ea8e6884f9eb10a0 | Fix PyYAML warning (see #86). | aepyornis/nyc-db,aepyornis/nyc-db | src/nycdb/utility.py | src/nycdb/utility.py | import os
import yaml
from pathlib import Path
def read_yml(file):
"""Reads a yaml file and outputs a Dictionary"""
with open(file, 'r') as yaml_file:
return yaml.load(yaml_file, Loader=yaml.FullLoader)
def mkdir(file_path):
""" Creates directories for the file path"""
Path(os.path.dirname(f... | import os
import yaml
from pathlib import Path
def read_yml(file):
"""Reads a yaml file and outputs a Dictionary"""
with open(file, 'r') as yaml_file:
return yaml.load(yaml_file)
def mkdir(file_path):
""" Creates directories for the file path"""
Path(os.path.dirname(file_path)).mkdir(parents... | agpl-3.0 | Python |
657745c315ba6a61984b66f168f9c34b3a7e2108 | Fix documentation typo (#446) | ros2/launch,ros2/launch,ros2/launch | launch/launch/conditions/evaluate_condition_expression_impl.py | launch/launch/conditions/evaluate_condition_expression_impl.py | # Copyright 2018 Open Source Robotics Foundation, 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... | # Copyright 2018 Open Source Robotics Foundation, 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 |
6217c6e3610ce19e3a3b603b7889de7d466afcab | increment version | thatneat/petl,alimanfoo/petl,psnj/petl,Marketing1by1/petl | src/petl/__init__.py | src/petl/__init__.py | """
The `petl` module.
"""
from __future__ import absolute_import, print_function, division
from petl.util import header, fieldnames, data, records, rowcount, look, see, \
itervalues, values, iterdata, valuecounter, valuecounts, \
valueset, isunique, lookup, lookupone, recordlookup, recordlookupone, \
... | """
The `petl` module.
"""
from __future__ import absolute_import, print_function, division
from petl.util import header, fieldnames, data, records, rowcount, look, see, \
itervalues, values, iterdata, valuecounter, valuecounts, \
valueset, isunique, lookup, lookupone, recordlookup, recordlookupone, \
... | mit | Python |
88ba66820fa34b4d73c563a95d8aed4edb1aa9c0 | Update get_sunset.py | StackStorm/st2contrib,StackStorm/st2contrib,StackStorm/st2contrib | packs/astral/actions/get_sunset.py | packs/astral/actions/get_sunset.py | """
Copyright 2016 Brocade Communications Systems, 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 i... | """
Copyright 2016 Brocade Communications Systems, 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 i... | apache-2.0 | Python |
978e22132b40bc9b9ddbe4514ed95d13975e3626 | Remove debug print statement | Princeton-CDH/django-pucas,Princeton-CDH/django-pucas | pucas/management/commands/ldapsearch.py | pucas/management/commands/ldapsearch.py | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from pucas.ldap import LDAPSearch, LDAPSearchException
class Command(BaseCommand):
help = 'Look up one or more users in LDAP by netid'
def add_arguments(self, parser):
parser.add_argument('netid', narg... | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from pucas.ldap import LDAPSearch, LDAPSearchException
class Command(BaseCommand):
help = 'Look up one or more users in LDAP by netid'
def add_arguments(self, parser):
parser.add_argument('netid', narg... | apache-2.0 | Python |
84392bd1452a2f67612b1cb01c6c6a4d2bfbf6df | update content process file | horizon3385/websiteClassifier,horizon3385/websiteClassifier | parseRawData/pageContentProcess.py | parseRawData/pageContentProcess.py | # -*- coding: utf -*-
"""
webpage content process class
process webpage content cleaning
html elements feature extract
natual language stemming and words count
return a dict object
"""
import re
from bs4 import BeautifulSoup
from collections import Counter
import nltk
from nltk import word_tokenize
from nltk import ... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
class PageContentProcessor(object):
"""
GET url content and extract text from content.
process `<p>` text with natural language process technology
"""
tags_extract = ['p', 'a', 'article']
tags_count = ['p... | mit | Python |
d8e2a7e59b8dff5c273067c640a97cfadc6ad8a1 | Change function parameter name | RyanDavison/RandomRepo,RyanDavison/RandomRepo | RandomGithubRepo.py | RandomGithubRepo.py | #-----------------------------------------------------------------
# RandomGithubRepo.py
#
# Find a truly random repository from within the githubisphere.
# Side effects of use may include uncovering and reading really bad repo README
# files that just say things like "My code examples" or "Collection of various
# scri... | #-----------------------------------------------------------------
# RandomGithubRepo.py
#
# Find a truly random repository from within the githubisphere
# Typical useage includes uncovering and reading really bad repo README files that
# just say things like "My code examples" or "Collection of various scripts"
#
# Co... | mit | Python |
36b3305480859c4f90655403e3e92bc6055b3896 | Make this simpler. | nbeaver/cmd-oysters,nbeaver/cmd-oysters | new_oyster.py | new_oyster.py | #! /usr/bin/env python
from __future__ import print_function
import datetime
import os
import sys
import json
import uuid
def get_year():
now = datetime.datetime.now()
return now.year
if len(sys.argv) > 1:
invocation = sys.argv[1]
else:
sys.stderr.write("Usage: python "+sys.argv[0]+" 'command-invocat... | #! /usr/bin/env python
from __future__ import print_function
import datetime
import os
import sys
import json
import uuid
def get_year():
now = datetime.datetime.now()
return now.year
def get_username():
try:
# POSIX only
import pwd
gecos_field = pwd.getpwuid(os.getuid()).pw_geco... | mit | Python |
1e1df2d7c254a583e18eef430ca6cf5887d072c0 | Remove pseudo code placeholders | marshki/pyWipe,marshki/pyWipe | printTest.py | printTest.py | #!/bin/py
"""
Python 2.7 disk wiping utility for use on Linux OSs.
When you do a wipe (also sometimes called a secure delete), you are telling the operating system to not only update its file records, but also immediately overwrite the disk space with either zeros or random data, making it much harder to recover any... | #!/bin/py
"""
Python 2.7 disk wiping utility for use on Linux OSs.
When you do a wipe (also sometimes called a secure delete), you are telling the operating system to not only update its file records, but also immediately overwrite the disk space with either zeros or random data, making it much harder to recover any... | mit | Python |
1f04e7038aa3b13f4fa5bb6363566c7ed7ed07da | add debug info for Job | moonfruit/yysite,moonfruit/yysite,moonfruit/yysite | yyfeed/cron/base.py | yyfeed/cron/base.py | # -*- coding: utf-8 -*-
import logging
from abc import ABCMeta, abstractmethod
from django.conf import settings
from yyfeed.fetcher import Fetcher
from yyfeed.models import Feed
from yyutil.code import build
logger = logging.getLogger(__name__)
cache = build(settings.YYFEED_CACHE)
class FetcherJob(metaclass=ABCMet... | # -*- coding: utf-8 -*-
import logging
from abc import ABCMeta, abstractmethod
from django.conf import settings
from yyfeed.fetcher import Fetcher
from yyfeed.models import Feed
from yyutil.code import build
logger = logging.getLogger(__name__)
cache = build(settings.YYFEED_CACHE)
class FetcherJob(metaclass=ABCMet... | mit | Python |
19bbed55d11376be417e3a6f6c7bea20a37a339e | Move get_type function from zeit.find where it belongs | ZeitOnline/zeit.cms,ZeitOnline/zeit.cms,ZeitOnline/zeit.cms,ZeitOnline/zeit.cms | src/zeit/cms/type.py | src/zeit/cms/type.py | # Copyright (c) 2009-2011 gocept gmbh & co. kg
# See also LICENSE.txt
import StringIO
import logging
import lxml.etree
import zeit.cms.interfaces
import zeit.connector.interfaces
import zeit.connector.resource
import zope.interface
log = logging.getLogger(__name__)
# Marker object to indicate no add form.
SKIP_ADD =... | # Copyright (c) 2009-2011 gocept gmbh & co. kg
# See also LICENSE.txt
import StringIO
import logging
import lxml.etree
import zeit.cms.interfaces
import zeit.connector.interfaces
import zeit.connector.resource
log = logging.getLogger(__name__)
# Marker object to indicate no add form.
SKIP_ADD = object()
class Type... | bsd-3-clause | Python |
b7bfcde7b2f9573178a16e314daefbbbc961dc2d | Write 1.5m iterations, grab/pass version to sstablesplit | bdeggleston/cassandra-dtest,mambocab/cassandra-dtest,bdeggleston/cassandra-dtest,iamaleksey/cassandra-dtest,pauloricardomg/cassandra-dtest,thobbs/cassandra-dtest,snazy/cassandra-dtest,aweisberg/cassandra-dtest,spodkowinski/cassandra-dtest,mambocab/cassandra-dtest,iamaleksey/cassandra-dtest,blerer/cassandra-dtest,thobbs... | sstablesplit_test.py | sstablesplit_test.py | from dtest import Tester, debug
from assertions import *
from tools import *
from os.path import getsize
import time
class TestCounters(Tester):
def split_test(self):
"""
Check that after running compaction, sstablessplit can succesfully split
The resultant sstable. Check that split is r... | from dtest import Tester, debug
from assertions import *
from tools import *
from os.path import getsize
import time
class TestCounters(Tester):
def split_test(self):
"""
Check that after running compaction, sstablessplit can succesfully split
The resultant sstable. Check that split is r... | apache-2.0 | Python |
f50ce151218fb7b45c40019510996e55d2ea67a8 | add shell usage example to docstring | hobson/pug,hobson/pug,hobson/pug,hobson/pug | pug/debug.py | pug/debug.py | """Import this module to invoke the interractive python debugger, ipydb, on any exception
Resources:
Based on http://stackoverflow.com/a/242531/623735
Examples:
>>> import debug
>>> x=[]
>>> x[0]
"""
# # from http://stackoverflow.com/a/242514/623735
# # Only works if you have a main function in ... | """Import this module to invoke the interractive python debugger, ipydb, on any exception
Resources:
Based on http://stackoverflow.com/a/242531/623735
Examples:
>>> import debug
>>> x=[][0]
"""
# # from http://stackoverflow.com/a/242514/623735
# # Only works if you have a main function in your app
#... | mit | Python |
94dbd90b30f32b36483130032a7c7977bd50c2df | Remove blank line | scottx611x/refinery-higlass-docker,scottx611x/refinery-higlass-docker,scottx611x/refinery-higlass-docker | on_startup.py | on_startup.py | import glob
import json
import logging
import requests
from requests.exceptions import RequestException
import django
from django.core.management import call_command
logger = logging.getLogger(__name__)
def populate_higlass_data_directory(data_dir):
"""
Download remote files specified by urls in the input.j... | import glob
import json
import logging
import requests
from requests.exceptions import RequestException
import django
from django.core.management import call_command
logger = logging.getLogger(__name__)
def populate_higlass_data_directory(data_dir):
"""
Download remote files specified by urls in the input.j... | mit | Python |
925750e4207535cf21a478ec75cfcbc5a8a2bef5 | Validate all config values used by core server modules | Heufneutje/txircd,ElementalAlchemist/txircd | txircd/modules/server/autoconnect.py | txircd/modules/server/autoconnect.py | from twisted.internet.task import LoopingCall
from twisted.plugin import IPlugin
from txircd.config import ConfigValidationError
from txircd.module_interface import IModuleData, ModuleData
from txircd.utils import durationToSeconds
from zope.interface import implements
class ServerAutoconnect(ModuleData):
implements(... | from twisted.internet.task import LoopingCall
from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from txircd.utils import durationToSeconds
from zope.interface import implements
class ServerAutoconnect(ModuleData):
implements(IPlugin, IModuleData)
name = "ServerAutoconne... | bsd-3-clause | Python |
4441c1611f8640df215b87ea15669fa77d12c6c8 | Add show option in array2image() | ronrest/convenience_py,ronrest/convenience_py | convenience/ml/array2image.py | convenience/ml/array2image.py | from matplotlib import pyplot as plt
__author__ = 'ronny'
# ==============================================================================
# ARRAY2IMAGE
# ==============================================================================
def array2image(... | from matplotlib import pyplot as plt
__author__ = 'ronny'
# ==============================================================================
# ARRAY2IMAGE
# ==============================================================================
def array2image(x... | apache-2.0 | Python |
f9bde6973a9e85d9fa51e1cdcb28d4c48099282a | Fix pep8 | marcore/pok-eco,marcore/pok-eco | xapi/utils.py | xapi/utils.py | import datetime
from dateutil.parser import parse
import pytz
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from django.contrib.auth.models import User
from django.test.c... | import datetime
from dateutil.parser import parse
import pytz
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from django.contrib.auth.models import User
from django.test.c... | agpl-3.0 | Python |
1421dd89b74bf753cf0b52a5e6fe200d221922b5 | Fix 'path' function: use main's file as project root | piotrekw/pirx | pirx/utils.py | pirx/utils.py | import os
def setting(name):
return name.upper()
def path(subpath):
import __main__
project_root = os.path.dirname(os.path.realpath(__main__.__file__))
return os.path.join(project_root, subpath)
| import os
def setting(name):
return name.upper()
def path(subpath):
project_root = os.path.dirname(os.path.realpath(__file__))
return os.path.join(project_root, subpath)
| mit | Python |
52388996a4cba3c803a7d74706624565330f7641 | divide in two plots | marioyc/RL-algorithms,marioyc/RL-algorithms | plot_atari.py | plot_atari.py | import matplotlib.pyplot as plt
import common.file_utils as file_utils
GAME = 'space_invaders'
AGENT = 'SARSALambda'
stats = file_utils.load_stats('{}-{}.npz'.format(GAME, AGENT))
f, axarr = plt.subplots(2, sharex=True)
#rewards, = axarr[0].plot(stats['rewards'], label='reward')
avg_all, = axarr[0].plot(stats['avg... | import matplotlib.pyplot as plt
import common.file_utils as file_utils
GAME = 'space_invaders'
AGENT = 'SARSALambda'
stats = file_utils.load_stats('{}-{}.npz'.format(GAME, AGENT))
f, axarr = plt.subplots(4, sharex=True)
rewards, = axarr[0].plot(stats['rewards'], label='reward')
avg_all, = axarr[0].plot(stats['avg_... | mit | Python |
3c45058cfafee473f0399ac0129484d576d4ab09 | remove unused variable | nojhan/weboob-devel,eirmag/weboob,frankrousseau/weboob,willprice/weboob,sputnick-dev/weboob,frankrousseau/weboob,yannrouillard/weboob,Boussadia/weboob,franek/weboob,RouxRC/weboob,Boussadia/weboob,Boussadia/weboob,RouxRC/weboob,RouxRC/weboob,Konubinix/weboob,franek/weboob,sputnick-dev/weboob,nojhan/weboob-devel,laurent-... | weboob/backends/minutes20/backend.py | weboob/backends/minutes20/backend.py | # -*- coding: utf-8 -*-
# Copyright(C) 2011 Julien Hebert
#
# This program 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, version 3 of the License.
#
# This program is distributed in the hope that it will b... | # -*- coding: utf-8 -*-
# Copyright(C) 2011 Julien Hebert
#
# This program 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, version 3 of the License.
#
# This program is distributed in the hope that it will b... | agpl-3.0 | Python |
3d0b63e1bd07b4af97fd1e8a21c22676c55ee6ff | Update for first of month | goyal-sidd/BLT,goyal-sidd/BLT,goyal-sidd/BLT,Bugheist/website,goyal-sidd/BLT,Bugheist/website,Bugheist/website,Bugheist/website | website/management/commands/email.py | website/management/commands/email.py | from django.core.management.base import BaseCommand, CommandError
from website.models import Points, Domain, Issue
from django.contrib.auth.models import User
import datetime
from django.template.loader import render_to_string
from django.db.models import Sum, Count
from itertools import chain
from itertools import gro... | from django.core.management.base import BaseCommand, CommandError
from website.models import Points, Domain, Issue
from django.contrib.auth.models import User
import datetime
from django.template.loader import render_to_string
from django.db.models import Sum, Count
from itertools import chain
from itertools import gro... | agpl-3.0 | Python |
57ba87926c99ad947460508d58adb24df9730774 | Revert "Update .westpa_gen.py to use PREFIX" | westpa/westpa | .westpa_gen.py | .westpa_gen.py | import os
template = '''\
# source this file to set the environment variables in your shell.
export WEST_ROOT={WESTROOT}
export WEST_BIN={WESTBIN}
export WEST_PYTHON={WESTPYTHON}
export PATH=$WEST_BIN:$PATH
\n'''
with open('westpa.sh', 'w') as f:
f.write(template.format(WESTROOT=os.environ.get('PWD'),
... | import os
template = '''\
# source this file to set the environment variables in your shell.
export WEST_ROOT={WESTROOT}
export WEST_BIN={WESTBIN}
export WEST_PYTHON={WESTPYTHON}
export PATH=$WEST_BIN:$PATH
\n'''
with open('westpa.sh', 'w') as f:
f.write(template.format(WESTROOT=os.environ.get('PREFIX'),
... | mit | Python |
24b4010fa1e8be495839ab2430e0d1acba8ba6d2 | Remove random back-ticks - how did this work? | xia2/xia2,xia2/xia2 | core/Python/Examples/CCP4/Cad.py | core/Python/Examples/CCP4/Cad.py | #!/usr/bin/env python
# Cad.py
#
# Copyright (C) 2006 CCLRC, Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# 31st May 2006
#
# A wrapper for the CCP4 program cad
#
import os
import sys
if not os.environ.has_key('XIA2CORE_... | #!/usr/bin/env python
# Cad.py
#
# Copyright (C) 2006 CCLRC, Graeme Winter
#
# This code is distributed under the BSD license, a copy of which is
# included in the root directory of this package.
#
# 31st May 2006
#
# A wrapper for the CCP4 program cad
#
import os
import sys
if not os.environ.has_key('XIA2CORE_... | bsd-3-clause | Python |
3f05ab891aeb9644e913fc004642a394adaf1820 | fix bug | abc612008/QQAnalyzer | qqanalyzer.py | qqanalyzer.py | import os
import sys
import re
import time
class message:
time=""
name=""
qq=""
content=[]
def __init__(self):
self.time,self.name,self.qq,self.content=("","","",[])
class messages:
name=""
msgs=[]
user_qq_name={}
def __init__(self, file_content):
# define some constants, use the array index
GROUP_NAME... | import os
import sys
import re
class message:
time=""
name=""
qq=""
content=[]
def __init__(self):
self.time,self.name,self.qq,self.content=("","","",[])
class messages:
name=""
msgs=[]
def __init__(self, file_content):
# define some constants, use the array index
GROUP_NAME_LINE=5
START_LINE=8
# i... | mit | Python |
bd7cc3e2d220a795578c67b7c0b97c3db5c62a0a | Move logging to stderr (#1059) | cloudify-cosmo/cloudify-system-tests,cloudify-cosmo/cloudify-system-tests | cosmo_tester/framework/logger.py | cosmo_tester/framework/logger.py | import logging
import sys
# Separated from util to allow test-config tool to run in under 2 seconds
def get_logger(name):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
ch = logging.StreamHandler(sys.stderr)
ch.setLevel(logging.INFO)
formatter = logging.Formatter(fmt='%(asctime)s [... | import logging
import sys
# Separated from util to allow test-config tool to run in under 2 seconds
def get_logger(name):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.INFO)
formatter = logging.Formatter(fmt='%(asctime)s [... | apache-2.0 | Python |
a83fb9d5957c679106f097b4ea4e4fc9854786ec | Update dapper/mods/L96s/Grudzien2020.py | nansencenter/DAPPER,nansencenter/DAPPER | dapper/mods/L96s/Grudzien2020.py | dapper/mods/L96s/Grudzien2020.py | ###############
# Description #
###############
"""Settings as in `bib.grudzien2020numerical`.
Set-up with three different `step` functions, using different SDE integrators.
The truth twin is generated by the order 2.0 Taylor scheme,
for accuracy with respect to convergence in the strong sense.
"""
################... | ###############
# Description #
###############
"""Settings as in `bib.grudzien2020numerical`.
A similar HMM is used with additive noise as a nonlinear map in various other
papers, whereas in this setting the model can be considered a random diffeomorphism,
giving a perfect-random model configuration. This uses two d... | mit | Python |
86ac3925cc5c5a434f4547908f84a08533577a70 | Update for Python3 | JmPotato/Pomash,JmPotato/Pomash | Pomash/libs/utils.py | Pomash/libs/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import string
import random
import dropbox
import hashlib
import pygments
import datetime
def to_md5(word):
return hashlib.md5(word.encode('utf-8')).hexdigest()
def make_token(username):
key = ''.join(random.sample(string.ascii_letters+strin... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import string
import random
import dropbox
import hashlib
import pygments
import datetime
def to_md5(word):
return hashlib.md5(word).hexdigest()
def make_token(username):
key = ''.join(random.sample(string.letters+string.digits, 20))
ret... | mit | Python |
e237f6a287db819d400d15c5fd71a37643979e0a | Update Huffman tests. | fredthomsen/hyper,plucury/hyper,jdecuyper/hyper,Lukasa/hyper,lawnmowerlatte/hyper,masaori335/hyper,fredthomsen/hyper,irvind/hyper,jdecuyper/hyper,masaori335/hyper,Lukasa/hyper,lawnmowerlatte/hyper,plucury/hyper,irvind/hyper | test/test_huffman.py | test/test_huffman.py | from hyper.http20.huffman import HuffmanDecoder, HuffmanEncoder
from hyper.http20.huffman_constants import REQUEST_CODES,REQUEST_CODES_LENGTH
class TestHuffman(object):
def test_request_huffman_decoder(self):
decoder = HuffmanDecoder(REQUEST_CODES,REQUEST_CODES_LENGTH)
assert decoder.decode(b'\xe7... | from hyper.http20.huffman import HuffmanDecoder, HuffmanEncoder
from hyper.http20.huffman_constants import REQUEST_CODES,REQUEST_CODES_LENGTH,REQUEST_CODES,REQUEST_CODES_LENGTH
class TestHuffman(object):
def test_request_huffman_decoder(self):
decoder = HuffmanDecoder(REQUEST_CODES,REQUEST_CODES_LENGTH)
... | mit | Python |
e5b156e4c7f80a5c7fdd20e670718c6344a608b4 | update test cases | pengmeng/PyCrawler,ymero/PyCrawler,pengmeng/PyCrawler | test/test_scraper.py | test/test_scraper.py | __author__ = 'mengpeng'
from unittest import TestCase
from pycrawler.scraper import Scraper
from pycrawler.scraper import DefaultScraper
from pycrawler.exception import ScraperException
from pycrawler.logger import Logger
class TestScraper(TestCase):
def test_register(self):
self.assertRaises(ScraperExcep... | __author__ = 'mengpeng'
from unittest import TestCase
from pycrawler.scraper import Scraper
from pycrawler.scraper import DefaultScraper
from pycrawler.exception import ScraperException
class TestScraper(TestCase):
def test_register(self):
self.assertRaises(ScraperException, Scraper.register, 0)
s... | mit | Python |
1ff35c2df315b54c503e29912530cb3c6c48c227 | add some comments | Unidata/netcdf4-python,Unidata/netcdf4-python,Unidata/netcdf4-python | test/tst_refcount.py | test/tst_refcount.py | import unittest, netCDF4, tempfile, os
file_name = tempfile.mktemp(".nc")
class RefCountTestCase(unittest.TestCase):
def setUp(self):
nc = netCDF4.Dataset(file_name, mode='w', format='NETCDF4')
d = nc.createDimension('fred', 2000)
v = nc.createVariable('frank','f',('fred',))
self.... | import unittest, netCDF4, tempfile, os
file_name = tempfile.mktemp(".nc")
class RefCountTestCase(unittest.TestCase):
def setUp(self):
nc = netCDF4.Dataset(file_name, mode='w', format='NETCDF4')
d = nc.createDimension('fred', 2000)
v = nc.createVariable('frank','f',('fred',))
self.... | mit | Python |
08ed69e8b8422dd70d7a3ee8d2df2fd21a5f79b0 | Update SD-SeGrid-Execute.py | benhastings/SeGrid_EC2,benhastings/SeGrid_EC2,benhastings/SeGrid_EC2 | SD-SeGrid-Execute.py | SD-SeGrid-Execute.py | from subprocess import Popen
import sys
import urllib2
import time
# Find hostname to use for passing to webdriver
resp=urllib2.urlopen('http://169.254.169.254/latest/meta-data/public-hostname')
PHOST=resp.read()
# Poll Hub interface to determine free/busy status of resources
def freeCheck():
try:
response=u... | from subprocess import Popen
import sys
import urllib2
import time
# Find hostname to use for passing to webdriver
resp=urllib2.urlopen('http://169.254.169.254/latest/meta-data/public-hostname')
PHOST=resp.read()
# Poll Hub interface to determine free/busy status of resources
def freeCheck():
try:
response=u... | bsd-3-clause | Python |
d664d3f8a3d080d90a2934555d979737d18aca92 | Test __main__ for pyproject without setuptools_scm | RonnyPfannschmidt/setuptools_scm,pypa/setuptools_scm,RonnyPfannschmidt/setuptools_scm,pypa/setuptools_scm | testing/test_main.py | testing/test_main.py | import os.path
import sys
import textwrap
import pytest
def test_main():
mainfile = os.path.join(
os.path.dirname(__file__), "..", "src", "setuptools_scm", "__main__.py"
)
with open(mainfile) as f:
code = compile(f.read(), "__main__.py", "exec")
exec(code)
@pytest.fixture
def re... | import os.path
import sys
import textwrap
import pytest
def test_main():
mainfile = os.path.join(
os.path.dirname(__file__), "..", "src", "setuptools_scm", "__main__.py"
)
with open(mainfile) as f:
code = compile(f.read(), "__main__.py", "exec")
exec(code)
@pytest.fixture
def re... | mit | Python |
143a3f349c121c6d548d32c55eefdfa8b6cda39a | Duplicate characters in the original domain | nccgroup/typofinder,nccgroup/typofinder,nccgroup/typofinder | TypoMagic/typogen.py | TypoMagic/typogen.py | #
# Typofinder for domain typo discovery
#
# Released as open source by NCC Group Plc - http://www.nccgroup.com/
#
# Developed by Ollie Whitehouse, ollie dot whitehouse at nccgroup dot com
#
# http://www.github.com/nccgroup/typofinder
#
# Released under AGPL see LICENSE for more information#
#
class typogen(object):... | #
# Typofinder for domain typo discovery
#
# Released as open source by NCC Group Plc - http://www.nccgroup.com/
#
# Developed by Ollie Whitehouse, ollie dot whitehouse at nccgroup dot com
#
# http://www.github.com/nccgroup/typofinder
#
# Released under AGPL see LICENSE for more information#
#
class typogen(object):... | agpl-3.0 | Python |
081765cc414f4bebf487e2293c977df1b22395f8 | Fix time elapsed bug | BuildmLearn/University-Campus-Portal-UCP,BuildmLearn/University-Campus-Portal-UCP,BuildmLearn/University-Campus-Portal-UCP | UCP/UCP/functions.py | UCP/UCP/functions.py | """
functions.py file
contains functions common to all apps
"""
import thread
from django.core.mail import send_mail
from django.utils import timezone
from login.models import UserProfile
from login.serializers import UserProfileFullSerializer
from UCP.settings import EMAIL_HOST_USER
def get_time_elapsed_string(da... | """
functions.py file
contains functions common to all apps
"""
import thread
from django.core.mail import send_mail
from django.utils import timezone
from login.models import UserProfile
from login.serializers import UserProfileFullSerializer
from UCP.settings import EMAIL_HOST_USER
def get_time_elapsed_string(da... | bsd-3-clause | Python |
be99423438e91ac9c7fdc208949813cedf8169c7 | write test output to its own file for easy diff. | steenzout/python-sphinx | tests/sphinx_test.py | tests/sphinx_test.py | # -*- coding: utf-8 -*-
"""Tests for the steenzout.sphinx package."""
import unittest
from steenzout.sphinx import ResourceGenerator
class ResourceGeneratorTestCase(unittest.TestCase):
"""Tests for the steenzout.sphinx.ResourceGenerator class."""
@staticmethod
def _compare_output(filename, output):
... | # -*- coding: utf-8 -*-
"""Tests for the steenzout.sphinx package."""
import unittest
from steenzout.sphinx import ResourceGenerator
class ResourceGeneratorTestCase(unittest.TestCase):
"""Tests for the steenzout.sphinx.ResourceGenerator class."""
@staticmethod
def _compare_output(expected, output):
... | apache-2.0 | Python |
88f1996382f52303f1837cf6f6e043c83f1c25d0 | add id string | p/pycurl-archived,p/pycurl-archived,pycurl/pycurl,p/pycurl-archived,pycurl/pycurl,pycurl/pycurl | tests/xmlrpc_curl.py | tests/xmlrpc_curl.py | # $Id$
import xmlrpclib, pycurl, cStringIO
class CURLTransport(xmlrpclib.Transport):
"""Handles an HTTP transaction to an XML-RPC server."""
xmlrpc_headers = [
"User-Agent: PycURL XML-RPC", "Content-Type: text/xml"
]
def __init__(self, username=None, password=None):
self.c = pycu... | import xmlrpclib, pycurl, cStringIO
class CURLTransport(xmlrpclib.Transport):
"""Handles an HTTP transaction to an XML-RPC server."""
xmlrpc_headers = [
"User-Agent: PycURL XML-RPC", "Content-Type: text/xml"
]
def __init__(self, username=None, password=None):
self.c = pycurl.init(... | lgpl-2.1 | Python |
fb142e0a163acc98e4e477f8e961987f78c3eb63 | Fix package_dir | Tacha-S/dotfiles,Tacha-S/dotfiles | update_extra_path.py | update_extra_path.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import ast
import json
import pathlib
import re
srcs = pathlib.Path('src')
my_extra_paths = []
for setup_file in srcs.glob('**/setup.py'):
if '.venv' in str(setup_file):
continue
if (setup_file.parent / 'CATKIN_IGNORE').exists():
continue
confi... | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import ast
import json
import pathlib
srcs = pathlib.Path('src')
my_extra_paths = []
for setup_file in srcs.glob('**/setup.py'):
if '.venv' in str(setup_file):
continue
if (setup_file.parent / 'CATKIN_IGNORE').exists():
continue
config = setup_... | mit | Python |
434535b9e4c113e1261d9d54f66990c6990219d7 | Send group emails in batches | p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc | mail/email.py | mail/email.py | from django.conf import settings
from django.template.loader import render_to_string
from mail import models as mail_api
from groups import models as group_api
from mailgun import api as mailgun_api
from sequence import models as sequence_api
def send_email( email_uri ):
""" Send the email to the intended target ... | from django.conf import settings
from django.template.loader import render_to_string
from mail import models as mail_api
from groups import models as group_api
from mailgun import api as mailgun_api
from sequence import models as sequence_api
def send_email( email_uri ):
""" Send the email to the intended target ... | mit | Python |
04541918979c02b6dcd07d2c960cd24b9a745d10 | Fix incorrect models field name for MailgunLog | p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc | mailgun/db.py | mailgun/db.py | from django.db import models
class MailgunLog(models.Model):
log_hash = models.CharField(max_length=64, unique=True)
data = models.TextField()
timestamp = models.DateTimeField()
| from django.db import models
class MailgunLog(models.Model):
log_hash = models.CharField(max_length=64, unique=True)
data = models.TextField()
timestamp = models.DateTime()
| mit | Python |
ab93a1bcd2b8f6e28535a9f50ec0b59b71940cfa | Rename birthdate to date_of_birth so it reads better | evanepio/dotmanca,evanepio/dotmanca,evanepio/dotmanca | main/views.py | main/views.py | import datetime
from django.views import generic
from news.models import NewsArticle
def get_age(date_of_birth, today):
try:
birthday = datetime.date(today.year, date_of_birth.month, date_of_birth.day)
except ValueError:
# Raised when person was born on 29 February and the current
# ... | import datetime
from django.views import generic
from news.models import NewsArticle
def get_age(date_of_birth, today):
try:
birthday = datetime.date(today.year, date_of_birth.month, date_of_birth.day)
except ValueError:
# Raised when person was born on 29 February and the current
# ... | mit | Python |
9fe96ae9bad88a429f0ce74f29bca091a39fb697 | drop points with NAs | corbt/city-weather | map_points.py | map_points.py | import os
import folium, vincent
import pandas as pd
import calendar,datetime
def popup_chart(station):
months = [i+1 for i in xrange(12)]
mins = list(station[[str(num)+'_tmin' for num in months]])
maxes = list(station[[str(num)+'_tmax' for num in months]])
avgs = list(station[[str(num)+'_tavg' for num... | import os
import folium, vincent
import pandas as pd
import calendar,datetime
def popup_chart(station):
months = [i+1 for i in xrange(12)]
mins = list(station[[str(num)+'_tmin' for num in months]])
maxes = list(station[[str(num)+'_tmax' for num in months]])
avgs = list(station[[str(num)+'_tavg' for num... | mit | Python |
8490469ea3a65446f60fe53503daa2089820328d | bump version | brentp/cyvcf2,brentp/cyvcf2,brentp/cyvcf2 | cyvcf2/__init__.py | cyvcf2/__init__.py | from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
par_het)
Reader = VCFReader = VCF
__version__ = "0.30.1"
| from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
par_het)
Reader = VCFReader = VCF
__version__ = "0.30.0"
| mit | Python |
4153708963946f0562872cefe173552533046bf0 | update ntgear | ramrom/haus | netgearrtr.py | netgearrtr.py | #!/usr/local/bin/python
import pdb
import pynetgear # https://github.com/balloob/pynetgear
# do dir(object) to get list of public methods
def buildclient(password = 'password', user = 'admin', hostname = 'routerlogin.net', port = 80):
return pynetgear.Netgear(password, hostname, user, port)
if __name__ == "__ma... | #!/usr/local/bin/python
import pdb
import pynetgear
def buildclient(password = 'password', user = 'admin', hostname = 'routerlogin.net', port = 80):
return pynetgear.Netgear(password, hostname, user, port)
if __name__ == "__main__":
#if len(sys.argv) > 1 and sys.argv[1] == '1':
pdb.set_trace()
| mit | Python |
662046497abfa6f7f6553aeb266a261637ba6407 | Clean up old test, pass all tests | jriehl/numba,jriehl/numba,stefanseefeld/numba,seibert/numba,gdementen/numba,sklam/numba,pitrou/numba,stefanseefeld/numba,stuartarchibald/numba,stonebig/numba,numba/numba,GaZ3ll3/numba,ssarangi/numba,sklam/numba,cpcloud/numba,sklam/numba,ssarangi/numba,stonebig/numba,gdementen/numba,pombredanne/numba,GaZ3ll3/numba,seibe... | numba/postpasses.py | numba/postpasses.py | # -*- coding: utf-8 -*-
"""
Postpasses over the LLVM IR.
The signature of each postpass is postpass(env, ee, lmod, lfunc) -> lfunc
"""
from __future__ import print_function, division, absolute_import
from numba.support.math_support import linking, libs
default_postpasses = {}
def register_default(name):
def de... | # -*- coding: utf-8 -*-
"""
Postpasses over the LLVM IR.
The signature of each postpass is postpass(env, ee, lmod, lfunc) -> lfunc
"""
from __future__ import print_function, division, absolute_import
from numba.support.math_support import math_support, libs
default_postpasses = {}
def register_default(name):
d... | bsd-2-clause | Python |
b44b0f68a2dd00df1ec074cf39a66ce81cd0dae2 | Update error output for app not open/song not playing | kshvmdn/nowplaying | nowplaying.py | nowplaying.py | #!/usr/bin/env python
from termcolor import colored
from appscript import *
from track import Track
def main():
print(get_song())
def get_song():
itunes_open = bool(app('System Events').processes[its.name == 'iTunes'].count())
if itunes_open: # check if application open
itunes = app('iTunes')
... | #!/usr/bin/env python
from termcolor import colored
from appscript import *
from track import Track
def main():
print(get_song())
def get_song():
itunes_open = bool(app('System Events').processes[its.name == 'iTunes'].count())
if itunes_open: # check if application open
itunes = app('iTunes')
... | mit | Python |
5fef15285060b384ec2fd56b328e9848a63d1be0 | Remove comment from zabbix integration | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/integrations/monitoring/manager.py | dbaas/integrations/monitoring/manager.py | from dbaas_dbmonitor.provider import DBMonitorProvider
from dbaas_zabbix.provider import ZabbixProvider
import logging
LOG = logging.getLogger(__name__)
class MonitoringManager():
@classmethod
def create_monitoring(cls, databaseinfra):
try:
LOG.info("Creating monitoring...")
... | from dbaas_dbmonitor.provider import DBMonitorProvider
from dbaas_zabbix.provider import ZabbixProvider
import logging
LOG = logging.getLogger(__name__)
class MonitoringManager():
@classmethod
def create_monitoring(cls, databaseinfra):
try:
LOG.info("Creating monitoring...")
... | bsd-3-clause | Python |
e477cf33b4efd3d898b3698dacac5bbf0112d93c | Implement secure RBAC for tenant policies | openstack/designate,openstack/designate,openstack/designate | designate/common/policies/tenant.py | designate/common/policies/tenant.py | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python |
5aa6212e1babf0ac29ee98495a41cb7ba77a9551 | remove implicit relative module loads for python3 | opentok/Opentok-Python-SDK | opentok/__init__.py | opentok/__init__.py | from .OpenTokSDK import OpenTokSDK
# see: http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers
__version__ = '2.2.0a0'
| from OpenTokSDK import OpenTokSDK
# see: http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers
__version__ = '2.2.0a0'
| mit | Python |
614c2233752b6416743fb35dd0a4296b13030c46 | Update P1_sendingEmail.py added docstring and wrapped in main function | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | pythontutorials/books/AutomateTheBoringStuff/Ch16/P1_sendingEmail.py | pythontutorials/books/AutomateTheBoringStuff/Ch16/P1_sendingEmail.py | """Sending email
This program uses :py:mod:`smtplib` to send emails.
Notes:
* ``smtp_info`` file has each item on a separate line.
* Email address used is specially created for this chapter.
* Use :func:`input` for password to prevent storing in unencrypted file.
"""
def main():
# Connecting to an ... | # This program uses the smtplib module to send emails
#
# Note:
# - smtp_info file has each item on separate line
# - email address used is specially created for this chapter
# - use input() for password to prevent storing in unencrypted file
# Connecting to an SMTP Server
import smtplib
with open('smtp_info') as con... | mit | Python |
3c8067a1b8fb3463fa4c45a6f03c8dc0fbf918b3 | Declare Meta class in Tag model. [skip ci] | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | organizer/models.py | organizer/models.py | from django.db import models
# Model Field Reference
# https://docs.djangoproject.com/en/1.8/ref/models/fields/
class Tag(models.Model):
name = models.CharField(
max_length=31, unique=True)
slug = models.SlugField(
max_length=31,
unique=True,
help_text='A label for URL config... | from django.db import models
# Model Field Reference
# https://docs.djangoproject.com/en/1.8/ref/models/fields/
class Tag(models.Model):
name = models.CharField(
max_length=31, unique=True)
slug = models.SlugField(
max_length=31,
unique=True,
help_text='A label for URL config... | bsd-2-clause | Python |
f7ce9313c721aa38b260e520c8e03c7e780bf166 | Update models and permissions | semorale/backend-test,semorale/backend-test,semorale/backend-test | django_backend_test/noras_menu/models.py | django_backend_test/noras_menu/models.py | # -*- encoding: utf-8 -*-
#STDLIB imports
import uuid
#Core Django Imports
from django.db import models
#Third Party apps imports
#Imports local apps
class Menu(models.Model):
""" Set of option for the lunch of the day."""
menu_uuid = models.UUIDField(default=uuid.uuid4,unique=True,editable=False)
day = models.D... | # -*- encoding: utf-8 -*-
#STDLIB imports
#Core Django Imports
from django.db import models
#Third Party apps imports
#Imports local apps
class Menu(models.Model):
""" Set of option for the lunch of the day."""
day = models.DateField(primary_key=True)
class MenuItems(models.Model):
"""Options of meals in the m... | mit | Python |
70dfb27ffc7974287274ff3d8b9bd64972e9ea17 | Fix openExchange json parsing | artursmet/django-prices-openexchangerates,mirumee/django-prices-openexchangerates | django_prices_openexchangerates/tasks.py | django_prices_openexchangerates/tasks.py | from __future__ import division
from __future__ import unicode_literals
from decimal import Decimal
import requests
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .models import ConversionRate
BASE_URL = r'http://openexchangerates.org/api'
ENDPOINT_LATEST = BASE_URL + ... | from __future__ import division
from __future__ import unicode_literals
from decimal import Decimal
import requests
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .models import ConversionRate
BASE_URL = r'http://openexchangerates.org/api'
ENDPOINT_LATEST = BASE_URL + ... | bsd-3-clause | Python |
d54f3e32fca2cb469e97d381bbc80b43a42d8b87 | fix docs? | m4rx9/rna-pdb-tools,m4rx9/rna-pdb-tools | rna_pdb_tools/utils/rna_alignment/rna_align_get_ss_from_alignment.py | rna_pdb_tools/utils/rna_alignment/rna_align_get_ss_from_alignment.py | #!/usr/bin/env python
"""Input as a file::
>ade
GCU-U-CAUAUAAUCCUAAUGAUAUGG-UUUGGGA-GUUUCUACCAAGAG-CC--UUAAA-CUCUU---GAUUAUG-AAGU-
(((.(.((((,,,(((((((_______.))))))).,,,,,,,,(((((((__.._____))))))...),,)))).)))).
to get::
>ade
GCUUCAUAUAAUCCUAAUGAUAUGGUUUGGGAGUUUCUACCAAGAGCCUUAAACUCUUGAUUAUGAAGU
((((((... | #!/usr/bin/env python
"""Input as a file::
>ade
GCU-U-CAUAUAAUCCUAAUGAUAUGG-UUUGGGA-GUUUCUACCAAGAG-CC--UUAAA-CUCUU---GAUUAUG-AAGU-
(((.(.((((,,,(((((((_______.))))))).,,,,,,,,(((((((__.._____))))))...),,)))).)))).
to get::
>ade
GCUUCAUAUAAUCCUAAUGAUAUGGUUUGGGAGUUUCUACCAAGAGCCUUAAACUCUUGAUUAUGAAGU
((((((... | mit | Python |
b3b0b7fd2cb4cb48f3c4767a01034d3011a35dd7 | Update docstring. | tombooth/django-field-cryptography,incuna/django-field-cryptography | django_field_cryptography/fields.py | django_field_cryptography/fields.py | from django.conf import settings
from django.db import models
from django.utils.encoding import force_bytes, force_str
from django.utils.six import with_metaclass
from cryptography.fernet import Fernet, InvalidToken
fernet = Fernet(settings.FERNET_KEY)
class EncryptedTextField(with_metaclass(models.SubfieldBase, m... | from django.conf import settings
from django.db import models
from django.utils.encoding import force_bytes, force_str
from django.utils.six import with_metaclass
from cryptography.fernet import Fernet, InvalidToken
fernet = Fernet(settings.FERNET_KEY)
class EncryptedTextField(with_metaclass(models.SubfieldBase, m... | bsd-2-clause | Python |
b5333c7f85a2c1fa3e90e95f597a07c40018abfc | Update to comply with pep8 | danirus/django-comments-xtd,danirus/django-comments-xtd,danirus/django-comments-xtd,danirus/django-comments-xtd | django_comments_xtd/conf/defaults.py | django_comments_xtd/conf/defaults.py | from __future__ import unicode_literals
from django.conf import settings
COMMENT_MAX_LENGTH = 3000
# Extra key to salt the XtdCommentForm.
COMMENTS_XTD_SALT = b""
# Whether comment posts should be confirmed by email.
COMMENTS_XTD_CONFIRM_EMAIL = True
# From email address.
COMMENTS_XTD_FROM_EMAIL = settings.DEFAULT... | from __future__ import unicode_literals
from django.conf import settings
COMMENT_MAX_LENGTH = 3000
# Extra key to salt the XtdCommentForm.
COMMENTS_XTD_SALT = b""
# Whether comment posts should be confirmed by email.
COMMENTS_XTD_CONFIRM_EMAIL = True
# From email address.
COMMENTS_XTD_FROM_EMAIL = settings.DEFAULT... | bsd-2-clause | Python |
564029a57fe1757176b28aa34cd536d3186c29e6 | add unflatten to namespace | shikil/sympy,debugger22/sympy,Titan-C/sympy,Designist/sympy,sahmed95/sympy,shipci/sympy,rahuldan/sympy,VaibhavAgarwalVA/sympy,jbbskinny/sympy,moble/sympy,hrashk/sympy,aktech/sympy,Mitchkoens/sympy,debugger22/sympy,ChristinaZografou/sympy,sahmed95/sympy,VaibhavAgarwalVA/sympy,mafiya69/sympy,Davidjohnwilson/sympy,Christi... | sympy/utilities/__init__.py | sympy/utilities/__init__.py | """This module contains some general purpose utilities that are used across
SymPy.
"""
from iterables import (flatten, group, take, subsets,
variations, numbered_symbols, cartes, capture, dict_merge,
postorder_traversal, preorder_traversal, interactive_traversal,
prefixes, postfixes, sift, topological_sort,... | """This module contains some general purpose utilities that are used across
SymPy.
"""
from iterables import (flatten, group, take, subsets,
variations, numbered_symbols, cartes, capture, dict_merge,
postorder_traversal, preorder_traversal, interactive_traversal,
prefixes, postfixes, sift, topological_sort)... | bsd-3-clause | Python |
f02fe06dad6760bb7ba88fbbf1e32b90f2c1d22e | Fix default price list item synchronization for OpenStack flavor [SENTRY-2030] Previously invalid resource content type has been used. | opennode/nodeconductor-openstack | src/waldur_openstack/openstack_tenant/utils.py | src/waldur_openstack/openstack_tenant/utils.py | from django.contrib.contenttypes.models import ContentType
from waldur_core.cost_tracking import ConsumableItem
from waldur_core.cost_tracking.models import DefaultPriceListItem
from . import models, PriceItemTypes
def get_consumable_item(flavor_name):
return ConsumableItem(item_type=PriceItemTypes.FLAVOR, key=... | from django.contrib.contenttypes.models import ContentType
from waldur_core.cost_tracking import ConsumableItem
from waldur_core.cost_tracking.models import DefaultPriceListItem
from . import models, PriceItemTypes
def get_consumable_item(flavor_name):
return ConsumableItem(item_type=PriceItemTypes.FLAVOR, key=... | mit | Python |
8532c5056b61cb11384115cc061939d2292afee9 | Update super_gluu_ro_session.py | GluuFederation/community-edition-setup,GluuFederation/community-edition-setup,GluuFederation/community-edition-setup | static/radius/scripts/super_gluu_ro_session.py | static/radius/scripts/super_gluu_ro_session.py | # Super Gluu Radius Dynamic Scope
# Copyright (c) 2019 Gluu Inc.
from org.gluu.model.custom.script.type.scope import DynamicScopeType
from org.gluu.oxauth.security import Identity
from org.gluu.service.cdi.util import CdiUtil
import java
class DynamicScope(DynamicScopeType):
def __init__(self, currentTimeMillis... | # Super Gluu Radius Dynamic Scope
# Copyright (c) 2019 Gluu Inc.
from org.gluu.model.custom.script.type.scope import DynamicScopeType
from org.gluu.oxauth.security import Identity
from org.gluu.service.cdi.util import CdiUtil
import java
class DynamicScope(DynamicScopeType):
def __init__(self, currentTimeMillis... | mit | Python |
0588b1db3e3b36ed5931f8f4be59cbf4bf21849f | fix form error msg | TailorDev/pauling,TailorDev/pauling,TailorDev/pauling,TailorDev/pauling,TailorDev/pauling,TailorDev/pauling | api/forms.py | api/forms.py | from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import StringField, TextAreaField
from wtforms.fields.html5 import URLField, EmailField
from wtforms.validators import InputRequired, URL, Regexp
class NewLinkForm(FlaskForm):
source_url = URLField('source... | from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import StringField, TextAreaField
from wtforms.fields.html5 import URLField, EmailField
from wtforms.validators import InputRequired, URL, Regexp
class NewLinkForm(FlaskForm):
source_url = URLField('source... | mit | Python |
9f88e6922a20b33be2238636d4a7adc92216778c | Use default port on the mosquitto server | pfe-asr-2014/tsp-mooc-subscriber | app/agent.py | app/agent.py | import signal
import sys
import yaml
import paho.mqtt.client as mqtt
import urllib
import urllib2
import json
"""Get the authentication token"""
def get_token(url, username, password):
query = {'username': username, 'password': password, 'service': 'mem'}
encoded = urllib.urlencode(query)
token = urllib2.u... | import signal
import sys
import yaml
import paho.mqtt.client as mqtt
import urllib
import urllib2
import json
"""Get the authentication token"""
def get_token(url, username, password):
query = {'username': username, 'password': password, 'service': 'mem'}
encoded = urllib.urlencode(query)
token = urllib2.u... | mit | Python |
252a572a70f20f143490fdd2d48882993d4dff74 | fix form importness | voltaire/minecraft-site,voltaire/minecraft-site,voltaire/minecraft-site | app/forms.py | app/forms.py | from flask.ext.wtf import Form, RecaptchaField
from wtforms import TextField, BooleanField, PasswordField, HiddenField, \
IntegerField, TextAreaField
from wtforms.validators import ValidationError, IPAddress, Required, Length, \
Email, NumberRange, Regexp
from flask import request
import urllib
class mcHasPaid... | from flask.ext.wtf import Form
from wtforms import TextField, BooleanField, PasswordField, HiddenField, \
RecaptchaField, IntegerField, TextAreaField
from wtforms.validators import ValidationError, IPAddress, Required, Length, \
Email, NumberRange
from flask import request
import urllib
class mcHasPaid(object)... | bsd-3-clause | Python |
a7ca6c4bb0f132109325bb245bd3ffd762c0aa0d | Update URLs | barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django | project/urls.py | project/urls.py | # Django
from django.conf.urls import (
include,
url,
)
from django.contrib import admin
from django.http import HttpResponse
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/', include('apps.api.urls')),
url(r'^api-auth/', include('rest_framework.urls')),
url(r'^robots.txt$', lambd... | # Third-Party
from rest_framework_jwt import views
# Django
from django.conf import settings
from django.conf.urls import (
include,
url,
)
from django.conf.urls.static import static
from django.contrib import admin
from django.http import HttpResponse
urlpatterns = [
url(r'^admin/doc/', include('django.c... | bsd-2-clause | Python |
776d5a686445712c6b3b1a4da72c45f2a1664e64 | Rename the 'contain' TestCase to TestContain | taoenator/robber.py,vesln/robber.py | tests/matchers/test_contain.py | tests/matchers/test_contain.py | import unittest
from robber import expect
from robber.matchers.contain import Contain
class TestContain(unittest.TestCase):
def test_matches(self):
expect(Contain({'key': 'value'}, 'key').matches()) == True
expect(Contain([1, 2, 3], 2).matches()) == True
expect(Contain((1, 2, 3), 3).matches... | import unittest
from robber import expect
from robber.matchers.contain import Contain
class TestAbove(unittest.TestCase):
def test_matches(self):
expect(Contain({'key': 'value'}, 'key').matches()) == True
expect(Contain([1, 2, 3], 2).matches()) == True
expect(Contain((1, 2, 3), 3).matches()... | mit | Python |
2b6948abd62a83301780b7e304291d802ee5a140 | Add test for `nanshe_converter.main` separately from `tests/tiff_file_format.py`. | DudLab/nanshe,nanshe-org/nanshe,jakirkham/nanshe,nanshe-org/nanshe,jakirkham/nanshe,DudLab/nanshe | tests/test_nanshe_converter.py | tests/test_nanshe_converter.py | __author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Mar 30, 2015 08:25:33 EDT$"
import collections
import itertools
import json
import os
import os.path
import shutil
import tempfile
import numpy
import h5py
import vigra
import vigra.impex
import nanshe.nanshe.additional_generators
import nanshe.n... | __author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Mar 30, 2015 08:25:33 EDT$"
| bsd-3-clause | Python |
c7d51c17f1aca5dda6560757be92fe6bc2f5d1d9 | Refactor package check (commented out). | matteoicardi/mpltools,tonysyu/mpltools | doc/tools/build_modref_templates.py | doc/tools/build_modref_templates.py | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os, sys
# local imports
from apigen import ApiDocWriter
# version comparison
from distutils.version import LooseVersion as V
#*****************************************************************************
def abort(error):
... | #!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os, sys
# local imports
from apigen import ApiDocWriter
# version comparison
from distutils.version import LooseVersion as V
#*****************************************************************************
def abort(error):
... | bsd-3-clause | Python |
cd89ecbcd799b88227f7302f749b31753b16d729 | Integrate LLVM at llvm/llvm-project@9c6a2f29660b | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "9c6a2f29660b886044a267bb4de662cd801079bc"
LLVM_SHA256 = "158b4474d55f745cf3996a18814381de6f1260cb03785ce599cae0046326a9a1"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "7272a8c23ceb218b3bd6f0dd303c6df2c773cc74"
LLVM_SHA256 = "a6c7081387e63778f7c05902c1e155352ec595bbe489ceb453c76086958a61cb"
tfrt_http_archive(
... | apache-2.0 | Python |
3aa665116825bb47894067e01b2145a7672e35a6 | Integrate LLVM at llvm/llvm-project@2675c4167131 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "2675c41671315da867c56276160e70905c59d11f"
LLVM_SHA256 = "50e14228719ddc526a47ecffbf54334ac54a76ce08b383af5ea9431228ad5852"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "ea26ed1f9c37465e0123c3357e459dd819c7d402"
LLVM_SHA256 = "56ae781d876210e67266d4d8ecfdb4bacbc15b61463a326bb665f54054500a03"
tfrt_http_archive(
... | apache-2.0 | Python |
102eb34805bdfd80b3ccdaa8c87ee2ff2808f51c | Integrate LLVM at llvm/llvm-project@4c1023b4b790 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "4c1023b4b7900db3ddeec16e16018c1413ecc3db"
LLVM_SHA256 = "c0a42a040fa6c5da3e15ced41289820c7fdbb87cfd4372c67a971350e1b163d6"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "1613ab8a4a3e6f8ab74fadd7e9a2dfe2219e3b43"
LLVM_SHA256 = "6d023ce0100d994db918dddf54334d2bf3ced989866acd131f5f4bdb4a88453a"
tfrt_http_archive(
... | apache-2.0 | Python |
ebe33c9a19032b12cb3707597c981bae1c93b577 | Integrate LLVM at llvm/llvm-project@e2e1a78abcef | yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,sarvex/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_... | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "e2e1a78abcefb396ea1c08990f4cf20ae5068ef8"
LLVM_SHA256 = "e1d0682790c8ed155681cb877f44a6632bd3ae708168022fc1dd629f4d5d7a20"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "ab5ff154abe59d04f77035587c6a169c15168b2f"
LLVM_SHA256 = "b2e529d6a3c9533c91b15ce1dba19d419f671ea576fcc6329fe1a5d34fbc867b"
tf_http_archive(
... | apache-2.0 | Python |
c933672fd44adae01df3453e53f8de3f8355dbeb | Integrate LLVM at llvm/llvm-project@9ba661f91276 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "9ba661f91276dd8cc728f9b2e82905b78c0119b4"
LLVM_SHA256 = "f89c033b0e8e6d4e6ff5ce3883aadc82a502b063a830cd685672cec4bea3dfb1"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "5b158093e2469dec16a070019c6432d26bf7be9b"
LLVM_SHA256 = "c1f9db9086e5813eeb9f989a59227577cbb9ab980bad9b37a02ab22202f0abd0"
tfrt_http_archive(
... | apache-2.0 | Python |
a23045374c61cc6bf3bdf1a32c7e59dd384c6576 | Integrate LLVM at llvm/llvm-project@96ad51e3ebaf | google/tsl,google/tsl,google/tsl | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "96ad51e3ebafdaed345a699d752ee4d96b00d82c"
LLVM_SHA256 = "e30ecbd64b9ee076ce90ddb728cd26559f4b8046f330bd1ccdd693c49bb69cad"
tf_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "304f1d59ca41872c094def3aee0a8689df6aa398"
LLVM_SHA256 = "34eabf01675b1bc0ea707793d78d502128eefe79afff1e51fbee7ab9cd683bf1"
tf_http_archive(
... | apache-2.0 | Python |
7c99aeadacee949f4de11eafe7e83bae80358791 | Integrate LLVM at llvm/llvm-project@d61840c168a3 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "d61840c168a34339aa8e602adf5aba98924a6f61"
LLVM_SHA256 = "3c387fa75ec9c48712d811f711a465c177933fc709c26584acae074a8e812ff0"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "913d78c40c37c9c3428285d868ce454b058e40f3"
LLVM_SHA256 = "aa78537ebcd3a8878fe29c59d44e776807e4289e6ba3545aac58e9652f48201d"
tfrt_http_archive(
... | apache-2.0 | Python |
9d85b63c3bd3999bf805ba7642cad0ce577bbf34 | Make a fix in the providers delegation example | rmk135/objects,rmk135/dependency_injector,ets-labs/python-dependency-injector,ets-labs/dependency_injector | examples/providers/factory_delegation.py | examples/providers/factory_delegation.py | """`Factory` providers delegation example."""
import collections
import dependency_injector.providers as providers
Photo = collections.namedtuple('Photo', [])
class User:
"""Example user model."""
def __init__(self, photos_factory):
"""Initialize instance."""
self.photos_factory = photos_... | """`Factory` providers delegation example."""
import collections
import dependency_injector.providers as providers
Photo = collections.namedtuple('Photo', [])
class User:
"""Example user model."""
def __init__(self, photos_factory):
"""Initialize instance."""
self.photos_factory = photos_... | bsd-3-clause | Python |
385fdddaede68cae713dab1f3adf36fb2f46cfa9 | Convert kwargs into normal arguments | onitake/Uranium,onitake/Uranium | UM/Operations/TranslateOperation.py | UM/Operations/TranslateOperation.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Scene.SceneNode import SceneNode
from . import Operation
## An operation that moves a scene node.
#
# This has nothing to do with languages. It is a linear transformation on
# geometry.
class TranslateOper... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Scene.SceneNode import SceneNode
from . import Operation
## An operation that moves a scene node.
#
# This has nothing to do with languages. It is a linear transformation on
# geometry.
class TranslateOper... | agpl-3.0 | Python |
f18c9d73d016e6480cdbb8dc33599472acb98bb1 | change captureMove | 0xD34D/PyMouse,pepijndevos/PyMouse,fragglet/PyMouse,0xD34D/PyMouse,pepijndevos/PyMouse | pymouse/base.py | pymouse/base.py | # -*- coding: iso-8859-1 -*-
# Copyright 2010 Pepijn de Vos
#
# 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... | # -*- coding: iso-8859-1 -*-
# Copyright 2010 Pepijn de Vos
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 | Python |
7a5a70de03f096c2387cf0e57f5551fb666e1830 | add common selftest | Zex/juicemachine,Zex/juicemachine,Zex/juicemachine | python/basic.py | python/basic.py | #!/usr/bin/python
# basic.py
# Common definition
#
# Author: Zex <top_zlynch@yahoo.com>
#
JM_SERVICE_NAME = "org.juicemachine"
JM_DEV_IFACE = "org.juicemachine.dev.iface"
JM_JSON_IFACE = "org.juicemachine.json.iface"
JM_CONFIG_PATH = "/org/juicemachine/config"
JM_NAME_IFACE = "org.juicemach... | #!/usr/bin/python
# basic.py
# Common definition
#
# Author: Zex <top_zlynch@yahoo.com>
#
JM_SERVICE_NAME = "org.juicemachine"
JM_DEV_IFACE = "org.juicemachine.dev.iface"
JM_JSON_IFACE = "org.juicemachine.json.iface"
JM_CONFIG_PATH = "/org/juicemachine/config"
JM_NAME_IFACE = "org.juicemach... | mit | Python |
30b4245e7fc0ac3160fb33d23a4e6d5c97b5a211 | add alias to toggle sticky mode | petobens/dotfiles,petobens/dotfiles,petobens/dotfiles | python/pdbrc.py | python/pdbrc.py | import pdb
from pygments.formatters import Terminal256Formatter
from pygments.lexers import PythonLexer
from pygments.style import Style
from pygments.token import (
Comment,
Error,
Keyword,
Literal,
Name,
Number,
Operator,
String,
Text,
)
# Palette (onedarkish)
white = '#abb2bf'
m... | import pdb
from pygments.formatters import Terminal256Formatter
from pygments.lexers import PythonLexer
from pygments.style import Style
from pygments.token import (
Comment,
Error,
Keyword,
Literal,
Name,
Number,
Operator,
String,
Text,
)
# Palette (onedarkish)
white = '#abb2bf'
m... | mit | Python |
d1096e17c63e8ba2b315acaf89c535a0703030c7 | Change setup.py to use Cython only if specified by a config variable. | cmcqueen/simplerandom,cmcqueen/simplerandom,cmcqueen/simplerandom,cmcqueen/simplerandom,cmcqueen/simplerandom | python/setup.py | python/setup.py | #!/usr/bin/env python
# Set this to True to enable building extensions using Cython.
# Otherwise, it will build extensions from the C file (that
# was previously created using Cython).
USE_CYTHON = True
import sys
from distutils.core import setup
from distutils.extension import Extension
if USE_CYTHON:
from Cy... | #!/usr/bin/env python
import sys
from distutils.core import setup
from distutils.extension import Extension
try:
from Cython.Distutils import build_ext
except ImportError:
use_cython = False
else:
use_cython = True
cmdclass = { }
ext_modules = [ ]
if sys.version_info[0] == 2:
base_dir = 'python2'
e... | mit | Python |
c2c23564d6938659ff5afe3c2178340b472b2d0b | fix setup for tabulate | relf/WhatsOpt,relf/WhatsOpt,relf/WhatsOpt,relf/WhatsOpt | python/setup.py | python/setup.py | from setuptools import setup
setup(name='whatsopt',
version='0.1.1',
description='Remote client command line tool',
url='http://gitlab.com/relf/WhatsOpt',
author='Remi Lafage',
author_email='remi.lafage@onera.fr',
license='Apache 2.0',
packages=['whatsopt'],
install_requ... | from setuptools import setup
setup(name='whatsopt',
version='0.1.0',
description='Remote client command line tool',
url='http://gitlab.com/relf/WhatsOpt',
author='Remi Lafage',
author_email='remi.lafage@onera.fr',
license='Apache 2.0',
packages=['whatsopt'],
install_requ... | agpl-3.0 | Python |
9a3e000f5e286308a5805fd3565e48fb17f836be | Update proto-google-datastore-v1 dependency to 1.4.0 | eddavisson/google-cloud-datastore,googleapis/google-cloud-datastore,googleapis/google-cloud-datastore,eddavisson/google-cloud-datastore,eddavisson/google-cloud-datastore,googleapis/google-cloud-datastore,eddavisson/google-cloud-datastore | python/setup.py | python/setup.py | #
# Copyright 2013 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 applicable law or... | #
# Copyright 2013 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 applicable law or... | apache-2.0 | Python |
bf0cb4058634cb28450036c296d18185d7d8867a | Add python3 category. | juanrubio/msgpack-c,kou/msgpack-ruby,cosmo0920/msgpack-ruby,cosmo0920/msgpack-ruby,jen20/msgpack-c,kpkhxlgy0/msgpack-c,vashstorm/msgpack-c,nurse/msgpack-ruby,AALEKH/msgpack-c,nobu-k/msgpack-c,kpkhxlgy0/msgpack-c,vashstorm/msgpack-c,soumith/msgpack-c,jpetso/msgpack-c,soumith/msgpack-c,ojundt/msgpack-ruby,GamePad64/msgpa... | python/setup.py | python/setup.py | #!/usr/bin/env python
# coding: utf-8
version = (0, 1, 6, 'final')
import os
from glob import glob
from distutils.core import setup, Extension
from distutils.command.sdist import sdist
try:
from Cython.Distutils import build_ext
import Cython.Compiler.Main as cython_compiler
have_cython = True
except Impo... | #!/usr/bin/env python
# coding: utf-8
version = (0, 1, 6, 'final')
import os
from glob import glob
from distutils.core import setup, Extension
from distutils.command.sdist import sdist
try:
from Cython.Distutils import build_ext
import Cython.Compiler.Main as cython_compiler
have_cython = True
except Impo... | apache-2.0 | Python |
af36511931861aa3582d75da8c5f6dec68f14ed3 | enable permissions in admin | wheelcms/obsolete-do-not-use-wheel-cms,wheelcms/wheel-site,wheelcms/wheel-site | wheel_cms/wheelcms_axle/admin.py | wheel_cms/wheelcms_axle/admin.py | from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from wheelcms_axle import models
class NodeAdmin(GuardedModelAdmin):
model = models.Node
admin.site.register(models.Node, NodeAdmin)
| from django.contrib import admin
from wheelcms_axle import models
class NodeAdmin(admin.ModelAdmin):
model = models.Node
admin.site.register(models.Node, NodeAdmin)
| bsd-2-clause | Python |
d3d90349df59f34068444f285484b4f6c0308eba | Stop processing of non budget data package resources | openspending/ckanext-budgets,openspending/ckanext-budgets | ckanext/budgets/controllers.py | ckanext/budgets/controllers.py | import json
import ckan.plugins.toolkit as toolkit
import ckan.model
import pylons
import dateutil.parser
from budgetdatapackage import BudgetDataPackage, BudgetResource
import logging
log = logging.getLogger(__name__)
class BudgetDataPackageController(toolkit.BaseController):
def descriptor(self, id, resource_... | import json
import ckan.plugins.toolkit as toolkit
import ckan.model
import pylons
import dateutil.parser
from budgetdatapackage import BudgetDataPackage, BudgetResource
import logging
log = logging.getLogger(__name__)
class BudgetDataPackageController(toolkit.BaseController):
def descriptor(self, id, resource_... | agpl-3.0 | Python |
90774410e7420859e667c4cd11880d80fcabb172 | Fix “unknown subcommand” error after successful clone | fenhl/gitdir | gitdir/__main__.py | gitdir/__main__.py | #!/usr/bin/env python3
"""Utility for maintaining gitdirs.
Usage:
gitdir clone <host> <repo_spec>...
gitdir update [<host>]
gitdir -h | --help
gitdir --version
Options:
-h, --help Print this message and exit.
--version Print version info and exit.
"""
import docopt
import pathlib
import subprocess
i... | #!/usr/bin/env python3
"""Utility for maintaining gitdirs.
Usage:
gitdir clone <host> <repo_spec>...
gitdir update [<host>]
gitdir -h | --help
gitdir --version
Options:
-h, --help Print this message and exit.
--version Print version info and exit.
"""
import docopt
import pathlib
import subprocess
i... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.