commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
2ce83fbdef3a139dfb5618e9dc7fde4f2c8249ec | add method params. | exadmin/views/website.py | exadmin/views/website.py | from django.utils.translation import ugettext as _
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.cache import never_cache
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from django.http import HttpResponse
from base import BaseAdminView
from ... | from django.utils.translation import ugettext as _
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.cache import never_cache
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from django.http import HttpResponse
from base import BaseAdminView
from ... | Python | 0 |
3419aa3dc2d14718c050e17f6ecc1a76844b5d26 | Add sfirah generator | sfirah.py | sfirah.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import hebcalendar
import sys
import codecs
import uuid
numbers = ['', u'ืืื', u'ืฉื ืื', u'ืฉืืืฉื', u'ืืจืืขื', u'ืืืฉื', u'ืฉืฉื', u'ืฉืืขื', u'ืฉืืื ื', u'ืชืฉืขื']
numbersTen = ['', u'ืขืฉืจ', u'ืขืฉืจืื', u'ืฉืืืฉืื', u'ืืจืืขืื']
def getSfirahText(day):
text = u"ืึผึธืจืึผืึฐ ืึทืชึผึธื ื' ืึฑืืึตืื ืึผ ื... | Python | 0.000001 | |
807a87ef5bfe1f34a072e3de0e1d60c07cefb5fb | Add test_pypy | unnaturalcode/test_pypy.py | unnaturalcode/test_pypy.py | #!/usr/bin/python
# Copyright 2017 Dhvani Patel
#
# This file is part of UnnaturalCode.
#
# UnnaturalCode 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 Licen... | Python | 0.000132 | |
4e0f9d8630847c92f02b0481fc0770cec68dadf7 | Implement auth tests | messente/verigator/test/test_auth.py | messente/verigator/test/test_auth.py | from unittest import TestCase
from mock import MagicMock
from messente.verigator.client import RestClient
from messente.verigator.controllers import Auth
from verigator import routes
# noinspection PyUnresolvedReferences
class TestAuth(TestCase):
def setUp(self):
self.client = RestClient("http://test", ... | Python | 0.000006 | |
3d32b633904316b077c5d3c3b3444154785f9fd3 | Create utils.py | utils.py | utils.py | import math
import numpy as np
import tensorflow as tf
import scipy
from tensorflow.python.framework import ops
image_summary = tf.summary.image
scalar_summary = tf.summary.scalar
histogram_summary = tf.summary.histogram
merge_summary = tf.summary.merge
SummaryWriter = tf.summary.FileWriter
class batch_norm(object):... | Python | 0.000001 | |
464d55d687a664a5ed7da4f7ddafce1f647d5efc | add templation url.templation_static to manage statics in dev stage | templation/urls.py | templation/urls.py | from django.conf.urls import patterns, url
from .settings import DAV_ROOT, DAV_STATIC_URL
from .views import static_view
def templation_static(**kwargs):
"""
Helper function to return a URL pattern for serving files in debug mode.
Mostly cloned from django.conf.urls.static function.
from templation.u... | Python | 0 | |
89daaaf631258595577dfc1c24dfdde8425f9efc | add migration | migrations/versions/2d696cdd68df_.py | migrations/versions/2d696cdd68df_.py | """empty message
Revision ID: 2d696cdd68df
Revises: 388d0cc48e7c
Create Date: 2014-11-14 00:27:32.062569
"""
# revision identifiers, used by Alembic.
revision = '2d696cdd68df'
down_revision = '388d0cc48e7c'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | Python | 0.000001 | |
adc96ec2e3d37c8f838fa67cf39b8e9748670539 | Change init to reflect changes in version 1.3.0 of pinry | pinry/settings/__init__.py | pinry/settings/__init__.py | import os
from django.contrib.messages import constants as messages
SITE_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../')
# Set to False to disable people from creating new accounts.
ALLOW_NEW_REGISTRATIONS = False
# Set to False to force users to login before seeing any pins.
PUBLIC = ... | import os
from django.contrib.messages import constants as messages
SITE_ROOT = os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../')
# Changes the naming on the front-end of the website.
SITE_NAME = 'Pinry'
# Set to False to disable people from creating new accounts.
ALLOW_NEW_REGISTRATIONS = True
... | Python | 0 |
c779a68f1cf97693e09f116237c38efa1d791186 | add a module working with http connections | http.py | http.py | '''
working with HTTP requests & responces
'''
import config
import httplib
import urlparse
'''
make a connection to URL
'''
def mkConn(url):
pars = urlparse.urlparse(url)
conCls = pars.scheme == 'https' and httplib.HTTPSConnection or httplib.HTTPConnection
return conCls(pars.netloc)
'''
send request to a system ... | Python | 0.000006 | |
6bd522ea91c066537c2f71d2fee9890556e48fc3 | Create lindenmayer.py | lindenmayer.py | lindenmayer.py | #!/usr/bin/env python
#
# Joey Navarro
#
# This is a test of a Lindenmayer grammar that generates
# rather realistic-looking plant shrubbery. You can go to
# http://en.wikipedia.org/wiki/L-system for more information.
# This script requires the python-pygame dependency.
#
# I don't know jack about licensing so this is ... | Python | 0.000022 | |
bcd2cdae3176dddca06b0e09774b7c9cd641ce7b | Define custom exceptions | aggregator/exceptions.py | aggregator/exceptions.py |
class WebCrawlException(Exception):
pass
class AuthorNotFoundException(WebCrawlException):
pass
class DatePublishedNotFoundException(WebCrawlException):
pass
class TitleNotFoundException(WebCrawlException):
pass
| Python | 0.00025 | |
06dbbfd7a8876f7db14f80e13d45eacd369501ab | add SocketServer | aioworkers/net/server.py | aioworkers/net/server.py | import socket
from ..core.base import LoggingEntity
class SocketServer(LoggingEntity):
def __init__(self, *args, **kwargs):
self._sockets = []
super().__init__(*args, **kwargs)
def set_config(self, config):
super().set_config(config)
port = self.config.get_int('port', null=Tr... | Python | 0.000001 | |
de250e5e63e4b0a36d06f8187644f91157265218 | Remove Privacy stubs | modules/installed/privacy/privacy.py | modules/installed/privacy/privacy.py | import cherrypy
from gettext import gettext as _
from plugin_mount import PagePlugin
from modules.auth import require
import cfg
import util
class Privacy(PagePlugin):
order = 20 # order of running init in PagePlugins
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
... | import cherrypy
from gettext import gettext as _
from plugin_mount import PagePlugin
from modules.auth import require
import cfg
import util
class Privacy(PagePlugin):
order = 20 # order of running init in PagePlugins
def __init__(self, *args, **kwargs):
PagePlugin.__init__(self, *args, **kwargs)
... | Python | 0 |
2ed36e44c80e4b2d059c77fcda741656200f9876 | Add tests/test-muc-invitation.py [re-recorded] | tests/test-muc-invitation.py | tests/test-muc-invitation.py | """
Test MUC invitations.
"""
import dbus
from twisted.words.xish import domish, xpath
from gabbletest import go, make_result_iq
from servicetest import call_async, lazy, match
@match('dbus-signal', signal='StatusChanged', args=[0, 1])
def expect_connected(event, data):
# Bob has invited us to an activity.
... | Python | 0 | |
e6501592303e2345e1262177a11f96e91f371024 | Add a state reading all about the room of a selected entity | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Get_Entity_Room.py | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Get_Entity_Room.py | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Get_Entity_Room(EventState):
'''
Read the position of a room in a json string
-- index_function function index of the
># json_text string command to read
># input_value object Input to the ... | Python | 0.000003 | |
d813f07e85b070e7ad60e8d9102ff148cc4734b8 | Create index.py | SourceCode/index.py | SourceCode/index.py | #
| Python | 0.000016 | |
e90ceebda79f710f83e92869d988057367ee6e9b | Remove unused import | tests/unit/py2/nupic/support/consoleprinter_test/consoleprinter_test.py | tests/unit/py2/nupic/support/consoleprinter_test/consoleprinter_test.py | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | Python | 0.000001 |
dab9a2a596151b6fb2127319cacf264cfa7ae4f2 | add an example | examples/example.py | examples/example.py | import django
from django.conf import settings
from cerebral import forms
settings.configure()
django.setup()
class ExampleForm(forms.Form):
first_name = forms.CharField(
fill=True, hide=False, requires=[])
last_name = forms.CharField(
fill=True, hide=False, requires=[])
email = forms.Ch... | Python | 0.00017 | |
21bee0c5b92d03a4803baf237c460223308ebb9f | Add a fake source code so you can embed it in the example | examples/fakecode.py | examples/fakecode.py | # Get the hash
# 01/07/2017
# Melissa Hoffman
# Get the current repo
import os
import subprocess
testdir='/Users/melissahoffman1/'
repo = testdir
# Check if the repo is a git repo and get githash
def get_git_hash(path):
os.chdir(path)
try:
sha = subprocess.check_output(['git','rev-parse','HEAD'],... | Python | 0.000001 | |
077170874e3a08825e00f2b3cba68cc8f6e987ce | Prepare v1.2.509.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000002 |
210f9c6acefdf2f51d33baa1ed7a2c131729fb93 | Update migrations to use lms.yml in the help text | common/djangoapps/third_party_auth/migrations/0004_auto_20200919_0955.py | common/djangoapps/third_party_auth/migrations/0004_auto_20200919_0955.py | # Generated by Django 2.2.16 on 2020-09-19 09:55
from django.db import migrations, models
import openedx.core.lib.hash_utils
class Migration(migrations.Migration):
dependencies = [
('third_party_auth', '0003_samlconfiguration_is_public'),
]
operations = [
migrations.AlterField(
... | Python | 0.000001 | |
39a94674714dc3d8b83af2c3dcfe927306cbc0df | Fix Pooch getting data added in a PR | metpy/cbook.py | metpy/cbook.py | # Copyright (c) 2008,2015,2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Collection of generally useful utility code from the cookbook."""
import os
import numpy as np
import pooch
from . import __version__
try:
string_type = basestri... | # Copyright (c) 2008,2015,2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Collection of generally useful utility code from the cookbook."""
import os
import numpy as np
import pooch
from . import __version__
try:
string_type = basestri... | Python | 0 |
18f6bf1b7862546a56c9bb7658c9bec41f19eea0 | Disable testDispatchNotification.testDispatchNotification on Mac | tools/telemetry/telemetry/core/backends/chrome_inspector/inspector_websocket_unittest.py | tools/telemetry/telemetry/core/backends/chrome_inspector/inspector_websocket_unittest.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry import decorators
from telemetry.core.backends.chrome_inspector import inspector_websocket
from telemetry.core.backends.chrom... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry import decorators
from telemetry.core.backends.chrome_inspector import inspector_websocket
from telemetry.core.backends.chrom... | Python | 0 |
19c0093e508923ff0d682fc4eb5764e4c93bfe8e | fix images pipeline tests | scrapy/tests/test_pipeline_images.py | scrapy/tests/test_pipeline_images.py | from twisted.trial import unittest
from scrapy.conf import settings
from tempfile import mkdtemp
from shutil import rmtree
SETTINGS_DISABLED = settings.disabled
class ImagesPipelineTestCase(unittest.TestCase):
def setUp(self):
try:
import Image
except ImportError, e:
raise ... | from twisted.trial import unittest
class ImagesPipelineTestCase(unittest.TestCase):
def setUp(self):
try:
import Image
except ImportError, e:
raise unittest.SkipTest(e)
from scrapy.contrib.pipeline.images import BaseImagesPipeline
self.pipeline = BaseImagesP... | Python | 0.000001 |
dc042aea1bb977984fb69a1da9c958f855d479ea | add util plot of precip cells | scripts/cligen/map_clifile_points.py | scripts/cligen/map_clifile_points.py | """Create a map of where we have climate files!"""
import psycopg2
import numpy as np
import os
import glob
from pyiem.plot import MapPlot
def get_domain():
pgconn = psycopg2.connect(database='idep', host='iemdb', user='nobody')
cursor = pgconn.cursor()
cursor.execute("""with ext as (
SELECT ST_Ex... | Python | 0 | |
68d3107c9b7e71c185b2f0b926af0057d96cdc5a | add script that gives invalid output and writes stderr | scripts/empty/invalid_plus_stderr.py | scripts/empty/invalid_plus_stderr.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
# Write to standard error
print('TEST', file=sys.stderr)
print('{"_meta": {"hostvars": {}}') | Python | 0.000001 | |
52ae438ada955209e14c9c86ba56e3c81347930e | Make p-value calculations more numpythonic | skbio/math/stats/distance/_mantel.py | skbio/math/stats/distance/_mantel.py | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | Python | 0 |
504a5390a78811393e011f01e5b6ddf2a3aae8e8 | Create ubuntu-monolith.py | ubuntu-monolith.py | ubuntu-monolith.py | #!/usr/bin/env python
import subprocess
import os
def apt_install(packages):
env = os.environ.copy()
env[DEBIAN_FRONTEND] = "noninteractive"
subprocess.call('sudo -E apt-get update')
subprocess.call('sudo -E apt-get install -y ' + ' '.join(packages))
packages = """
- ack-grep
- ant
- atop
- bastet
- binclo... | Python | 0.000727 | |
96c873da602bf34fb129b3d86378e729d7d94d72 | Create BoofCv.py | home/Mats/BoofCv.py | home/Mats/BoofCv.py | boof = Runtime.createAndStart("boof","BoofCv")
args = ["Test"]
boof.main(args)
| Python | 0 | |
fcfb2b768f07bab8c94d83d9d53d70263d078b75 | Create MAP_loader.py | eduextractor/MAP_loader.py | eduextractor/MAP_loader.py | import requests
import pandas as pd
from zipfile import ZipFile
from StringIO import StringIO
from nweaconfig import NWEA_USERNAME, NWEA_PASSWORD
## import database configuration from parent directory
## config contains SQLalchemy engine and a few DB functions
import sys
sys.path.append('../config')
import databasecon... | Python | 0 | |
feb7dbeeb055696bf6646dba0bf3bb224d70b283 | Add separate text manipulation class | ir/text.py | ir/text.py | from collections import defaultdict
from anki.notes import Note
from aqt import mw
from aqt.addcards import AddCards
from aqt.editcurrent import EditCurrent
from aqt.utils import showInfo, tooltip
from .util import fixImages, getField, getInput, setField
class TextManager:
def __init__(self, setting... | Python | 0.000004 | |
b044ba312b126cb17bf906b1984e7b407509fcc6 | Add script to assist in packaging. | Geneagrapher/makedist.py | Geneagrapher/makedist.py | """This tool sets up a distribution of the software by automating
several tasks that need to be done.
The directory should be in pristine condition when this is run (i.e.,
devoid of files that need to be removed before packaging begins). It
is best to run this on a fresh check out of the repository."""
import os
impo... | Python | 0 | |
410b354cb0e72ba741439a337aba4ef4c3cda8b1 | Add existing python file for performing a very crude analysis on a set of lsl files (as taken from an untarred OAR, for example) | src/ossa.py | src/ossa.py | #!/usr/bin/python
import re
import sys
""" Taken from http://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python"""
def sorted_nicely(l):
""" Sort the given iterable in the way that humans expect."""
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lam... | Python | 0 | |
1f9849b0f90ccca2b543b76ab3f02aab80523dab | task 13 | IVTa/2014/SHCHUKIN_F_O/task_13_30.py | IVTa/2014/SHCHUKIN_F_O/task_13_30.py | # ะะฐะดะฐัะฐ 13. ะะฐัะธะฐะฝั 30
# ะ ะฐะทัะฐะฑะพัะฐะนัะต ะธัะบัััะฒะตะฝะฝัะน ะธะฝัะตะปะปะตะบั ะดะปั ะธะณัั "ะัะตััะธะบะธ-ะฝะพะปะธะบะธ"
# Shchuckin F. O.
# 11.04.2016
from random import randint
# change size of board
size = 4
board = [ 0 ] * size * size
pics = [' . ', ' x ', ' o ']
def print_board (board):
print()
# upper numbers
for num in range(size):... | Python | 0.999999 | |
252ab143b139e39a1ef87150d8008704107fe1d8 | Create Database.py | database/Database.py | database/Database.py | __author__ = 'albert cuesta'
import os.path
class database:
def listaraplicaiones(self):
result = []
with open("database/data/aplicaciones.txt", mode='r+', encoding='utf-8') as file:
resultado = file.read()
texto = resultado.split("\n")
for linea in texto:
result.... | Python | 0.000001 | |
71d8ef8a872656df8a2319032855cb2b5ea5ed4b | Add a new benchmark - readline server | examples/bench/rlserver.py | examples/bench/rlserver.py | import argparse
import asyncio
import gc
import uvloop
import os.path
import socket as socket_module
from socket import *
PRINT = 0
async def echo_client_streams(reader, writer):
sock = writer.get_extra_info('socket')
try:
sock.setsockopt(IPPROTO_TCP, TCP_NODELAY, 1)
except (OSError, NameError)... | Python | 0 | |
af2303062c7d4bbbcbe92df3d0c01d7729b910f2 | add swap example | examples/py/huobi-swaps.py | examples/py/huobi-swaps.py | # -*- coding: utf-8 -*-
import os
from random import randint
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
print('CCXT Version:', ccxt.__version__)
exchange = ccxt.huobi({
'ap... | Python | 0 | |
1ac4dd4438dd054f32e23c6db01d2382507ed4c7 | break out shapefile tests | tests/python_tests/shapefile_test.py | tests/python_tests/shapefile_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from utilities import execution_path
import os, mapnik2
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
if 'shape' in mapnik2.Datasource... | Python | 0.000001 | |
64dac000cd4edb3a461918f8253e43bc47d6b594 | Create editUtils.py | utils/editUtils.py | utils/editUtils.py | # new_data = {'max_iter': 5000, 'snapshot': 500}
def createSolverPrototxt(new_data, save_loc):
f = open('solverToy.prototxt')
def_text = f.read().split('\n')
def_text.remove('')
solver_default_dict = {module.split(': ')[0]: module.split(': ')[1] for module in def_text}
new_dictionary = solver_defaul... | Python | 0 | |
b41776096e6982e6ef0faef1fc95b550bebed9e8 | add script to calculate average oil price | oil_price/average_oil_price.py | oil_price/average_oil_price.py | #!/usr/bin/env python
import urllib
import paho.mqtt.publish as publish
from bs4 import BeautifulSoup as bs
newenglandoil = urllib.urlopen("http://www.newenglandoil.com/massachusetts/zone10.asp?x=0").read()
soup = bs(newenglandoil, 'lxml')
oil_table = soup.find('table')
tbody = oil_table.find('tbody')
rows = tbody.f... | Python | 0 | |
a7a8cee70ffee9446aad19c9775d13c2b608c397 | Add RungeKuttaEvolver class. | new/evolvers.py | new/evolvers.py | class RungeKuttaEvolve(object):
def __init__(self, alpha, gamma_G=2.210173e5, start_dm=0.01):
if not isinstance(alpha, (int, float)) or alpha < 0:
raise ValueError('alpha must be a positive float or int.')
else:
self.alpha = alpha
if not isinstance(gamma_G, (float, i... | Python | 0 | |
39c853f64b837d257333c5731067c811344f9dfd | Add highlight.py (Python syntax highlighting) | src/Lib/site-packages/highlight.py | src/Lib/site-packages/highlight.py | import keyword
import _jsre as re
from browser import html
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'_'
digits = '0123456789'
builtin_funcs = ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
"eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +... | Python | 0.000003 | |
d5bf180394233a165f4b5ad8c6561509a4e465ca | add goliad health check | plugins/bongo/check-goliad-health.py | plugins/bongo/check-goliad-health.py | #!/usr/bin/env python
from optparse import OptionParser
import socket
import sys
import httplib
import json
PASS = 0
WARNING = 1
FAIL = 2
def get_bongo_host(server, app):
try:
con = httplib.HTTPConnection(server, timeout=45)
con.request("GET","/v2/apps/" + app)
data = con.getresponse()
... | Python | 0 | |
ce68b7f025d1ee25a58a093adf462b4b77fb0ad4 | remove duplicate calls to cfg.get() | nova/version.py | nova/version.py | # Copyright 2011 OpenStack Foundation
#
# 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 l... | # Copyright 2011 OpenStack Foundation
#
# 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 l... | Python | 0.001196 |
02de60c0157aaa52d8f31fe623902a32c734d248 | add generic A&A make script | tex/make.py | tex/make.py | #!/bin/env python
import subprocess
import shutil
import glob
import argparse
import os
name = 'apex_cmz_h2co'
parser = argparse.ArgumentParser(description='Make latex files.')
parser.add_argument('--referee', default=False,
action='store_true', help='referee style?')
parser.add_argument('--texpat... | Python | 0 | |
c1fb3eb548b15ab8049841696b7ae74604c8ed89 | Test for pytest.ini as session-scoped fixture | tests/conftest.py | tests/conftest.py | """
Config instructions and test fixtures
"""
import pytest
import os
import sys
# # these are just some fun dividiers to make the output pretty
# # completely unnecessary, I was just playing with autouse fixtures
# @pytest.fixture(scope="function", autouse=True)
# def divider_function(request):
# print('\n ... | Python | 0 | |
427c0a7afb9cb1ed796048fa32367897d705d49a | use disconnect.me | disconnect_search.py | disconnect_search.py | #!/usr/bin/env python
# encoding: utf-8
import gtaskpool
from proxymanager.downloadproxylist import get_http_proxies
from proxymanager.downloadualist import get_useragents
from proxymanager.proxymanager import ProxyManager
from bs4 import BeautifulSoup
import logging
import sys
reload(sys)
sys.setdefaultencoding('utf-8... | Python | 0.000002 | |
5da51f9ac93487d144f53de30fed69484b9b64dd | add setup script | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
import xmlcompare
setup(name="XMLCompare",
version=xmlcompare.__version__,
description="XMLCompare checks XML documents/elements for semantic equality",
author="Jan Brohl",
author_email="janbrohl@t-online.de",
url="https://github.com... | Python | 0.000001 | |
ab22712aa4dc628e257b592c56319871b6ed8f18 | Add setup.py file. | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
import traceview
packages = []
requires = []
setup(
name="python-traceview",
version=traceview.__version__,
description="TraceView API Client",
#long_description=long_description,
# The project URL.
url='https://github.com/danriti/python-t... | Python | 0 | |
43bdadcad33751b2ddbdac332106127a938f3492 | Add setuptools-based setup.py file | setup.py | setup.py | #!/usr/bin/env python
from setuptools import find_packages, setup
setup(name='txampext',
version='20121226',
description="Extensions to Twisted's AMP implementation",
url='https://github.com/lvh/txampext',
author='Laurens Van Houtven',
author_email='_@lvh.cc',
packages=find_packag... | Python | 0 | |
4a42116d0858089dbf2ac2fd8efdcb5ef9226b90 | bump version to 1.0.2 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup, Command
from unittest import TextTestRunner, TestLoader
import os
import os.path
class TestCommand(Command):
user_options = []
def initialize_options(self):
self._testdir = os.path.join(os.getcwd(), 'test')
def finalize_options(self):
... | #!/usr/bin/env python
from distutils.core import setup, Command
from unittest import TextTestRunner, TestLoader
import os
import os.path
class TestCommand(Command):
user_options = []
def initialize_options(self):
self._testdir = os.path.join(os.getcwd(), 'test')
def finalize_options(self):
... | Python | 0 |
33427521617e45e3227ff7320362c14a6588ea5b | Remove extensions. | setup.py | setup.py | import os
from distribute_setup import use_setuptools
use_setuptools(version='0.6.10')
from setuptools import setup, find_packages
with open("README.rst") as f:
long_desc = f.read()
setup(
name="custodian",
packages=find_packages(),
version="0.1.0a",
install_requires=[],
extras_require={"vasp... | import os
from distribute_setup import use_setuptools
use_setuptools(version='0.6.10')
from setuptools import setup, find_packages, Extension
with open("README.rst") as f:
long_desc = f.read()
setup(
name="custodian",
packages=find_packages(),
version="0.1.0a",
install_requires=[],
extras... | Python | 0 |
048f643921fd291b262cac80fbc68531805419cf | Create setup.py | setup.py | setup.py | from distutils.core import setup
setup(
name='AdxSuds',
version='1.0',
packages=[''],
url='https://github.com/Flexin1981/AdxSuds',
license='',
author='John Dowling',
author_email='johndowling01@live.co.uk',
description='Brocade Adx Suds Module for the XML Api'
)
| Python | 0.000001 | |
7ec768f50d5d0e8537fac23a2b819965374ce582 | Use version of zope.interface we have available. | setup.py | setup.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
#
# Generate a Flocker package that can be deployed onto cluster nodes.
#
import os.path
from setuptools import setup
path = os.path.join(os.path.dirname(__file__), b"flocker/version")
with open(path) as fObj:
version = fObj.read().strip()
del path
se... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
#
# Generate a Flocker package that can be deployed onto cluster nodes.
#
import os.path
from setuptools import setup
path = os.path.join(os.path.dirname(__file__), b"flocker/version")
with open(path) as fObj:
version = fObj.read().strip()
del path
se... | Python | 0 |
e5175894d49afe8205f0f969ffc4ea9eecec0f72 | add setup.py file | setup.py | setup.py | from distutils.core import setup
setup(
name='pynvd3',
version='0.01',
description='A Python wrapper for NVD3.js',
url='http://github.com/jephdo/pynvd3/',
author='Jeph Do',
author_email='jephdo@gmail.com',
packages=[
'pynvd3',
],
classifiers=[
'Development Status ::... | Python | 0.000001 | |
d38554332872c1b8f4a3a44bf4c18dda68752d04 | add setup.py file | setup.py | setup.py | ๏ปฟimport os
from setuptools import setup, find_packages
from pmll import version
# Import multiprocessing to prevent test run problem. In case of nosetests
# (not nose2) there is probles, for details see:
# https://groups.google.com/forum/#!msg/nose-users/fnJ-kAUbYHQ/_UsLN786ygcJ
# http://bugs.python.org/issue15881#msg... | Python | 0.000001 | |
340baa5f077b0ae3cb1ab6de736d67be89319c35 | Create setup.py | setup.py | setup.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup
setup(
name="python-usernames",
description="Python library to validate usernames suitable for use in public facing applications.",
version="0.0.1",
author="Saurabh Kumar",
author_email="me+github@saurabh-... | Python | 0.000001 | |
c3b44b012ddc18f7a6711609f04060f65bd36846 | include history with readme for setup.py | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
import re
#This hack is from http://stackoverflow.com/a/7071358/1231454;
# the version is kept in a seperate file and gets parsed - this
# way, setup.py doesn't have to import the package.
VERSIONFILE = 'gmusicapi/version.py'... | #!/usr/bin/env python
from distutils.core import setup
from setuptools import find_packages
import re
VERSIONFILE = 'gmusicapi/version.py'
version_line = open(VERSIONFILE).read()
version_re = r"^__version__ = ['\"]([^'\"]*)['\"]"
match = re.search(version_re, version_line, re.M)
if match:
version = match.group(... | Python | 0 |
91dca4294beccd4b7ff4ff9e1f029c7d63273928 | Create setup.py | setup.py | setup.py | from setuptools import setup
setup(name='track-class-availability',
version='1.0',
install_requires=['BeautifulSoup >= 4.3.2', 'schedule >= 0.3.1']
)
| Python | 0.000001 | |
eb12d44dffadf0c62fe231926a5004e5ef58d1a4 | Add the setup script | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "ccpoviz",
version = "0.0.1",
packages = find_packages(),
scripts = [],
install_requires = [
'docutils>=0.3',
'pystache>=0.5',
],
package_data = {
'ccpoviz': ['data/*.json', 'data/*.dat'],
},
# ... | Python | 0 | |
d3e1957915ed9d385742232475ac8992b17c6e7e | bump up version to 1.0.0 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import os
import sys
# minimum required version is 2.6; py3k not supported yet
if not ((2, 6) <= sys.version_info < (3, 0)... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import os
import sys
# minimum required version is 2.6; py3k not supported yet
if not ((2, 6) <= sys.version_info < (3, 0)... | Python | 0.000002 |
7f63c5b2a624870667d62ff21cbfb28c7cf2a189 | add setup script | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(name='FileWatcher',
version='1.00',
description='File watching framework',
packages=['filewatcher', ],
package_dir={'': 'lib'},
requires=['PyYAML (>=3.09)', ],
install_requires=['PyYAML >= 3.09', ],
classifiers=['Dev... | Python | 0.000001 | |
58b92617e03742658a6362f66664109de8993038 | Create setup.py | setup.py | setup.py | from setuptools import setup
setup(
name='cvrminer',
author='Finn Aarup Nielsen',
author_email='faan@dtu.dk',
license='Apache License',
url='https://github.com/fnielsen/cvrminer',
packages=['cvrminer'],
test_requires=['flake8'],
)
| Python | 0.000001 | |
9abae470ce9cf9d255921d7c4306ee7daadcd6f2 | Add setup.py | setup.py | setup.py | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='telezombie',
vers... | Python | 0.000001 | |
54ec15fa8985a1eb8782643d84afba7e1506536f | Fix mixed-line-endings entrypoint | setup.py | setup.py | from setuptools import find_packages
from setuptools import setup
setup(
name='pre_commit_hooks',
description='Some out-of-the-box hooks for pre-commit.',
url='https://github.com/pre-commit/pre-commit-hooks',
version='0.9.3',
author='Anthony Sottile',
author_email='asottile@umich.edu',
c... | from setuptools import find_packages
from setuptools import setup
setup(
name='pre_commit_hooks',
description='Some out-of-the-box hooks for pre-commit.',
url='https://github.com/pre-commit/pre-commit-hooks',
version='0.9.3',
author='Anthony Sottile',
author_email='asottile@umich.edu',
c... | Python | 0.00108 |
fcf000ee1b6834b5eabc106f6b617157443ed94d | Create sezar.py | sezar.py | sezar.py | password = [7,29,12,21,5,19,2,11,28,16,10,1,15,24,8,25,4,13,20,18,14,3,17,22,9,23,26,27,6]
def encrypt(a):
cipher = []
i = 0
n = 0
while i < len(a):
while n < len(password):
if int(a[i]) == (n+1):
cipher = cipher + [password[n]]
i += 1
... | Python | 0.000002 | |
f1334c006f07b2b1494d4b92a3ecb4186d8e3954 | add stack.py to branch | stack.py | stack.py | from linked_list import LinkedList
#Stack inherits from LinkedList class
class Stack(object):
def __init__(self, iterable=None):
if iterable != None:
self._linkedList = LinkedList(iterable)
else:
self._linkedList = LinkedList()
def push(self, value):
self._link... | Python | 0.000001 | |
785a1962c910a722f218bc814d1868f2b4bc7033 | Add interfaces: Parmeterizer, Converter, Analyzer and Synthesizer (and some thier subclasses) | vctk/interface.py | vctk/interface.py | # coding: utf-8
import numpy as np
"""
Interfaces
"""
class Analyzer(object):
"""
Speech analyzer interface
All of analyzer must implement this interface.
"""
def __init__(self):
pass
def analyze(self, x):
"""
Paramters
---------
x: array, shape (`t... | Python | 0 | |
ab7d1b230a5ef1c0763da1d150488add0b75ce31 | Add test file | tests.py | tests.py | import unittest
class MyappTestCase(unittest.TestCase):
def setUp(self):
myapp.app.config['DEBUG'] = tempfile.mkstemp()
self.app = myapp.app.test_client()
def tearDown(self):
pass
def test_index(self):
rv = self.app.get('/')
assert '<h2>Posts</h2>' ... | Python | 0.000001 | |
4029f604a4c809a201d0334946d680fb53b467dd | add initial pygame prototype | Python_Data/multimedia/pygameTest.py | Python_Data/multimedia/pygameTest.py | import random as rnd
import pygame
import sys
def generateObj():
objPos = (rnd.randint(50, 950), rnd.randint(50, 950))
objColor = (0, 0, 0)
return list([objColor, objPos])
pygame.init()
bgcolor = (255, 255, 204)
surf = pygame.display.set_mode((1000,1000))
circleColor = (255, 51, 51)
x, y = 500, 500
circ... | Python | 0 | |
b6ee1301075bcd391ce86d54075bf853f4ee6b2d | Add version.py | lantz_drivers/version.py | lantz_drivers/version.py | __version__ = '0.0.1'
| Python | 0.000001 | |
9387fb8ee3865fdc00b0b96fd8db77ef1b2f13a8 | Create watchingthestuffoverhere.py | python/watchingthestuffoverhere.py | python/watchingthestuffoverhere.py | #!/usr/bin/env python
# coding=utf-8
import string
import re
import csv
from selenium import webdriver
from datetime import datetime
#avaaz url to watch
tehURL = "somethingsomething"
ignores = re.compile('(seconds|minute|minutes|just)\s(ago|now)')
lst = []
while True:
try:
driver = webdriver.PhantomJS()
... | Python | 0 | |
fbbb65524a3b8f5486594d89f6cf885663ac7f3d | Support ubuntu variable for DESKTOP_SESSION | pythonpath/bookmarks/env/ubuntu.py | pythonpath/bookmarks/env/ubuntu.py |
OPEN = "xdg-open"
FILE_MANAGER = "nautilus"
| Python | 0 | |
c4f541b1bf6dac406e8849e528dbe7f5b954980e | Clean up & Fixes | qrl/core/StakeValidatorsTracker.py | qrl/core/StakeValidatorsTracker.py | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from collections import OrderedDict, defaultdict
from qrl.core import config
from qrl.core.StakeValidator import StakeValidator
from qrl.core.formulas import calc_seed... | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from collections import OrderedDict, defaultdict
from qrl.core import config
from qrl.core.StakeValidator import StakeValidator
from qrl.core.formulas import calc_seed... | Python | 0 |
ab52a21b1d4c1260f2f225a4c49f46251bbecd27 | Add script for generating jamendo rewrite rules | scripts/jamendo-rewrite.py | scripts/jamendo-rewrite.py | #!/usr/bin/env python
# Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz
import xml.etree.cElementTree as ElementTree
import sys, gzip, time, os, os.path, urllib, threading
class JamendoRewrite:
def __init__(self, path):
self.music_path = path
print "Rewrit... | Python | 0 | |
a004747df945f3361b53106339dab43e652fce74 | Fix dependencies for weborigin_unittests | Source/weborigin/weborigin_tests.gyp | Source/weborigin/weborigin_tests.gyp | #
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | #
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | Python | 0.999975 |
abd70f40aaa026844f9b088a4a648ce58e469839 | add preliminary measure script | measure.py | measure.py | from __future__ import absolute_import, division, print_function
from six.moves import filter, intern, map, range, zip
from functools import reduce
from numpy import cbrt, floor, sqrt
from firedrake.petsc import PETSc
from firedrake import ExtrudedMesh, UnitSquareMesh, assemble
import form
num_matvecs = 20
PETS... | Python | 0 | |
462f9a651eb93aca3c8ff980345e40429e6f3fe9 | add migrate script | migrate.py | migrate.py | # -*- coding: utf-8 -*-
import os
from boto.s3.connection import S3Connection
from boto.s3.key import Key
connection = S3Connection(
host = 's3.amazonaws.com', # S3 Compatible Services
is_secure = True,
aws_access_key_id = 'access_key_id', # Add your access key
aws_secret_access_key = 'secret_acce... | Python | 0.000001 | |
feb4e40afa8b589d9dc90652099202d07921f4b8 | add 0021 | llluiop/0021/password.py | llluiop/0021/password.py | #!/usr/bin/env python
#-*- coding: utf-8-*-
import os
from hashlib import sha256
from hmac import HMAC
def encode(password):
salt = os.urandom(8)
print salt
result = password.encode("utf-8")
for i in range(10):
result = HMAC(result, salt, sha256).digest()
return result
if __name__ ==... | Python | 0.999997 | |
debaa1f32b6b2dcbc7a7e8a02de19afc2c86a29f | add asgi file | django_react/asgi.py | django_react/asgi.py | import os
import channels.asgi
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_react.settings")
channel_layer = channels.asgi.get_channel_layer()
| Python | 0.000001 | |
002e903c978a30f27ed24316bb85958e5c69a259 | Solve Code Fights count visitors problem | CodeFights/countVisitors.py | CodeFights/countVisitors.py | #!/usr/local/bin/python
# Code Fights Count Visitors Problem
class Counter(object):
def __init__(self, value):
self.value = value
def inc(self):
self.value += 1
def get(self):
return self.value
def countVisitors(beta, k, visitors):
counter = Counter(beta)
for visitor in... | Python | 0.000022 | |
f53aef9fdcd01fdb8607984e38b4fb8c5813aacf | Solve Code Fights fibonacci list problem | CodeFights/fibonacciList.py | CodeFights/fibonacciList.py | #!/usr/local/bin/python
# Code Fights Fibonacci List Problem
from functools import reduce
def fibonacciList(n):
return [[0] * x for x in reduce(lambda x, n: x + [sum(x[-2:])],
range(n - 2), [0, 1])]
def main():
tests = [
[
6,
[[],
... | Python | 0.998522 | |
93a9ba6bacf6c1f32b8601c6de6153048c5d9feb | Create Keithley_autoprobefilter.py | Keithley_autoprobefilter.py | Keithley_autoprobefilter.py | # Reads Keithley .xls and filters data from autoprober
# Jeremy Smith
# Northwestern University
# Version 1.1
from numpy import *
import xlrd
import os
import sys
from myfunctions import *
from scipy import stats
data_path = os.path.dirname(__file__) # Path name for location of script
print "\n"
print data_path... | Python | 0 | |
902cf7f0b167847a96e1db0cd523878c5abb9032 | add addlc.py: add 2 lightcurves (to be used to crate EPIC combined lightcurves) | addlcs.py | addlcs.py | #!/usr/env python
import myscitools
import glob
if __name__ == '__main__':
'''
Add lightcurves
MOS1 + MOS2 = MOSS
PN + MOSS = EPIC
'''
mos1files = glob.glob('MOS1_lc_net*')
mos2files = glob.glob('MOS2_lc_net*')
pnfiles = glob.glob('PN_lc_net*')
mos1files.sort()
mos2files.sort(... | Python | 0 | |
0116701a64748efe1348686c2c52069d8d94c5f9 | Add migration | cms_lab_carousel/migrations/0004_auto_20151207_0015.py | cms_lab_carousel/migrations/0004_auto_20151207_0015.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('cms_lab_carousel', '0003_auto_20150827_0111'),
]
operations = [
... | Python | 0.000002 | |
81a33445be7f48bdbe95f79c42d09332303f2d42 | Revert "Bugfix for displaying correctly the plugins in the event view." | sentry/plugins/__init__.py | sentry/plugins/__init__.py | """
sentry.plugins
~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from sentry.web.helpers import render_to_response
class Response(object)... | """
sentry.plugins
~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from sentry.web.helpers import render_to_response
class Response(object)... | Python | 0 |
5b1782ad41d738bce01f20b4cef5242420e83931 | Add a snippet. | python/matplotlib/colour_map_list.py | python/matplotlib/colour_map_list.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# See: http://matplotlib.org/1.2.1/examples/pylab_examples/show_colormaps.html
# See also:
# - http://matplotlib.org/examples/color/colormaps_reference.html (the list of all colormaps)
# - http://matplotlib.org/users/colormaps.html?highlight=colormap#mycarta-banding (wha... | Python | 0.000002 | |
ad47e008ec61772c8c169742f0ab944f0f426a7a | Add solution to 97. | 097/97.py | 097/97.py |
def two_to_n_mod_10_to_m(n, m):
"""Successive squaring. Very fast and handles very large numbers.
1. Rewrite 2^n so that n is a sum of powers of two.
2. Create a list of powers 2^(2^i) mod 10^m, by repeatedly squaring the prior result.
3. Combine, with multiplication mod 10^m, the powers in the list ... | Python | 0.000025 | |
644ada5f8afcfe791299eea72efda1b0475040aa | Add benchmark for parsing vs. serializing. | python/bench.py | python/bench.py | from ndtypes import *
import time
# =============================================================================
# Type with huge number of offsets
# =============================================================================
s = "var(offsets=[0,10000000]) * var(offsets=%s) * int64" % list(ra... | Python | 0 | |
bf744e472209162ce83b2759c9240cb3018cb0bf | Fix find_packages | henson/contrib/__init__.py | henson/contrib/__init__.py | """Henson's contrib packages."""
| Python | 0 | |
ef15821bc7114a7c76b3ca2a7b178bd1d556cff4 | Add xarray IO example | IO/read_netCDF_with_xarray.py | IO/read_netCDF_with_xarray.py | #
# PyEarthScience: read_netCDF_with_xarray.py
#
# Description:
# Demonstrate the use of xarray to open and read the content of
# a netCDF file.
#
# Author:
# Karin Meier-Fleischer
#
# Date of initial publication:
# April, 2019
#
'''
PyEarthScience: read_netCDF_with_xarray.py
Description:
... | Python | 0.000022 | |
11296e24228ee10be009b04a9909504a8e8d5ace | Test for the save_character() function | tests/models/character/test_saver.py | tests/models/character/test_saver.py | import unittest
import database.main
from tests.create_test_db import engine, session, Base
database.main.engine = engine
database.main.session = session
database.main.Base = Base
import models.main
from classes import Paladin
from models.characters.saved_character import SavedCharacterSchema
from models.items.item_t... | Python | 0.00001 | |
617fc7564685731daee309dd1478856395dc62dc | Make the documentation for the general class non-specific. | src/stratisd_client_dbus/_stratisd_constants.py | src/stratisd_client_dbus/_stratisd_constants.py | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 0.997368 |
b329688792d65555ab7169d0ff625f2b4bddd7f2 | Add initial API integration tests | tests/test_integration_pyusesthis.py | tests/test_integration_pyusesthis.py | from pyusesthis import pyusesthis
class TestClass:
def test_get_hardware_all(self):
response = pyusesthis.get_hardware('all')
assert isinstance(response, str)
assert 'thinkpad-x220' in response
assert 'Xeon E5-2680' in response
def test_get_hardware(self):
response = ... | Python | 0 | |
dcb4a8ae0732b78afa4385988714f19b78fb3312 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ff451b346ffc6061369b7712da787ceb2b5becf7. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ff451b346ffc6061369b7712da787ceb2b5becf7"
TFRT_SHA256 = "333151d184baf3b8b384615ea20c9ab14efab635f096b3... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "94a9cc13caf5aa8e2ba54937ed837279c11c78e4"
TFRT_SHA256 = "8a9257aaf2b0042824659be7b2fd8335f37b98a4f57f76... | Python | 0.000001 |
5568f30f2bcb83eb8f4dd250d8c817aaea3815f5 | Create chalkboard-xor-game.py | Python/chalkboard-xor-game.py | Python/chalkboard-xor-game.py | # Time: O(n)
# Space: O(1)
# We are given non-negative integers nums[i] which are written on a chalkboard.
# Alice and Bob take turns erasing exactly one number from the chalkboard,
# with Alice starting first. If erasing a number causes the bitwise XOR of
# all the elements of the chalkboard to become 0, then that ... | Python | 0.000252 | |
c9294cbc743923c8898b7775392e93313c1ba171 | Create FindMininRSA2_001.py | leetcode/154-Find-Minimum-in-Rotated-Sorted-Array-II/FindMininRSA2_001.py | leetcode/154-Find-Minimum-in-Rotated-Sorted-Array-II/FindMininRSA2_001.py | class Solution:
# @param num, a list of integer
# @return an integer
def findMin(self, num):
L = 0; R = len(num)-1
while L < R and num[L] >= num[R]:
M = (L+R)/2
if num[M] > num[L]:
L = M + 1
elif num[M] < num[R]:
R = M
... | Python | 0.000002 | |
a78d93dbc23d832ca5eaae6535a45bfa478e4e56 | Add US state capitals from vega-lite. | altair/vegalite/v2/examples/us_state_capitals.py | altair/vegalite/v2/examples/us_state_capitals.py | """
U.S. state capitals overlayed on a map of the U.S
================================================-
This is a geographic visualization that shows US capitals
overlayed on a map.
"""
import altair as alt
from vega_datasets import data
states = alt.UrlData(data.us_10m.url,
format=alt.TopoDataFo... | Python | 0.001902 | |
3084f47374e3f52516d31fed69d18bca58706be0 | Add sandboxing draft, close #2. | law/task/sandbox.py | law/task/sandbox.py | # -*- coding: utf-8 -*-
"""
Abstract defintions that enable task sandboxing.
"""
__all__ = ["Sandbox", "SandboxTask"]
import sys
import os
from abc import abstractmethod
from subprocess import PIPE
from law.task.base import Task, ProxyTask
import law.util
_current_sandbox = os.environ.get("LAW_SANDBOX", "")
_sw... | Python | 0 | |
301a506aa21d4439448508ed80844d402c574e97 | Add version 1.7 (#26712) | var/spack/repos/builtin/packages/py-pygraphviz/package.py | var/spack/repos/builtin/packages/py-pygraphviz/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPygraphviz(PythonPackage):
"""Python interface to Graphviz"""
homepage = "https://p... | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.