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 |
|---|---|---|---|---|---|---|---|
de65724abf0a01660e413189d1738a72d5afd297 | add simple test for create_wininst. | bento/commands/tests/test_wininst.py | bento/commands/tests/test_wininst.py | import os
import shutil
import tempfile
import zipfile
import os.path as op
import mock
import bento.commands.build_wininst
from bento.commands.build_wininst \
import \
create_wininst
from bento.compat.api.moves \
import \
unittest
from bento.core.node \
import \
create_base_node... | Python | 0 | |
edfd6ddf8e7af41a8b5ed228360b92377bfc8964 | add 167. First 200 problems have been finished! | vol4/167.py | vol4/167.py | import time
def ulam(a, b):
yield a
yield b
u = [a, b]
even_element = 0
while even_element == 0 or u[-1] < 2 * even_element:
sums = {}
for i in range(len(u)):
for j in range(i + 1, len(u)):
sums[u[i] + u[j]] = sums.get(u[i] + u[j], 0) + 1
u.append(min(k for k, v in sums.iteritems() if v == 1 and k > ... | Python | 0 | |
a7db805db727fbe1c6e9f37152e6c3c2f94d406d | add require internet | i3pystatus/external_ip.py | i3pystatus/external_ip.py | from i3pystatus import IntervalModule, formatp
from i3pystatus.core.util import internet, require
import GeoIP
import urllib.request
class ExternalIP(IntervalModule):
"""
Shows the external IP with the country code/name.
Requires the PyPI package `GeoIP`.
.. rubric:: Available formatters
* {co... | from i3pystatus import IntervalModule, formatp
import GeoIP
import urllib.request
class ExternalIP(IntervalModule):
"""
Shows the external IP with the country code/name.
Requires the PyPI package `GeoIP`.
.. rubric:: Available formatters
* {country_name} the full name of the country from the I... | Python | 0.000013 |
e4d222c4e1b05f8d34b2236d05269827c345b0c7 | Handle also running rebot | src/robot/jarrunner.py | src/robot/jarrunner.py | # Copyright 2008-2010 Nokia Siemens Networks Oyj
#
# 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 2008-2010 Nokia Siemens Networks Oyj
#
# 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... | Python | 0 |
76399574b7fb914d1baa2719a0e493d4b22bb730 | Create PedidoEditar.py | backend/Models/Grau/PedidoEditar.py | backend/Models/Grau/PedidoEditar.py | from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoEditar(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoEditar, self).__init__(variaveis_do_ambiente)
try:
self.nome = self.corpo['nome']
except:
raise ErroNoHTTP(400)
def getNome(self):
... | Python | 0 | |
df146818d004e65102cc6647373b0fddb0d383fd | add basic integration tests | integration-tests/test_builder.py | integration-tests/test_builder.py | import os
import subprocess
import tempfile
from vdist.builder import Builder
from vdist.source import git, git_directory, directory
def test_generate_deb_from_git():
builder = Builder()
builder.add_build(
app='vdist-test-generate-deb-from-git',
version='1.0',
source=git(
... | Python | 0 | |
dc0ecffd6c4115019cfcbcc13b17a20511888c9b | Add ut for fused ops | python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py | python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py | # Copyright (c) 2018 PaddlePaddle 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 app... | Python | 0 | |
a852de81afdf8426cb243115a87856e2767a8d40 | Add construct test for known bad inplace string operations. | tests/benchmarks/constructs/InplaceOperationStringAdd.py | tests/benchmarks/constructs/InplaceOperationStringAdd.py | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Softwar where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# Li... | Python | 0.000001 | |
40ee2fd436afb7bc459ee8cef563cd4d6f97a30e | extract QMCPACK scalars | static_twists.py | static_twists.py | #!/usr/bin/env python
import os
import numpy as np
import pandas as pd
import subprocess as sp
import nexus_addon as na
def locate_bundle_input(path):
# locate bunled QMCPACK input
fidx = 0
out_tokens = sp.check_output('ls %s/*.in' %path
,shell=True).split('\n')[:-1]
good_in = 0
if len... | Python | 0.998553 | |
cff31f87a57d6e95e9cee848663ef4d5becc97b1 | add sharder.py file | storj/sharder.py | storj/sharder.py | import math
import os
# global SHARD_MULTIPLES_BACK, MAX_SHARD_SIZE
# MAX_SHARD_SIZE = 4294967296 # 4Gb
# SHARD_MULTIPLES_BACK = 4
class ShardingTools():
def __init__(self):
self.MAX_SHARD_SIZE = 4294967296 # 4Gb
self.SHARD_MULTIPLES_BACK = 4
def get_optimal_shard_parametrs(self, file_si... | Python | 0.000001 | |
60880e780d611f32a3358bcae76f4eed22feb2d7 | Create a module to add "Basic string search algorithms" | string_search.py | string_search.py | '''String search algorithms'''
_naive_iterations = 0
def naive_search(string, pattern):
'''Naïve string search algorithm
Pseudo code:
string[1..n] and pattern[1..m]
for i from 1 to n-m+1
for j from 1 to m
if s[i+j-1] ≠ pattern[j]
... | Python | 0 | |
28df83848a04e45059f4c672fde53f4f84dbd28d | Add module module_pubivisat.py | module_pubivisat.py | module_pubivisat.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
from bs4 import BeautifulSoup
def command_pubivisat(bot, user, channel, args):
"""Fetches todays pub quizzes for Tampere from pubivisat.fi"""
url = "http://pubivisat.fi/tampere"
f = urllib2.urlopen(url)
d = f.read()
f.close()
bs = BeautifulSoup(d)
d... | Python | 0.000003 | |
e5736370568adab1334f653c44dd060c06093fae | add basic twisted soap server. | src/rpclib/test/interop/server/soap_http_basic_twisted.py | src/rpclib/test/interop/server/soap_http_basic_twisted.py | #!/usr/bin/env python
#
# rpclib - Copyright (C) Rpclib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ... | Python | 0 | |
e83edea432f16ed6a2c9edcaa6da70c928d75eb5 | Create module containing constants | export_layers/pygimplib/constants.py | export_layers/pygimplib/constants.py | #
# This file is part of pygimplib.
#
# Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com>
#
# pygimplib is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | Python | 0 | |
0421adb2eb391c57d02dfa0b1b14e3c620c53dfc | Create tarea7.py | tareas/tarea7.py | tareas/tarea7.py | #josue de leon
# Tarea 7
#8-876-2357
'''1.Crear una aplicacion en Kivy que maneje un registro de asistencia. Basicamente la aplicacion debe contener una
etiqueta que diga "Nombre: ", un campo para ingresar cadenas de texto, un boton que diga "Guardar" y otro botin
que diga "Exportar". El botn para guardar agrega el... | Python | 0.000001 | |
b260040bc3ca48b4e76d73c6efe60b964fa5c108 | Add test of removing unreachable terminals | tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py | tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 17.08.2017 14:23
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import main, TestCase
from grammpy import *
from grammpy_transforms import *
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): pass
class D(Nonterminal):... | Python | 0.000001 | |
c82473efdeb7b1713f44370de761ec9022d02b5e | Add management command to fill and clear cache | akvo/rsr/management/commands/populate_project_directory_cache.py | akvo/rsr/management/commands/populate_project_directory_cache.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Akvo Reporting is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
"""Popula... | Python | 0 | |
4e6f2ede0a8a9291befe262cbec77d3e7cd873b0 | add new package (#26514) | var/spack/repos/builtin/packages/py-rsatoolbox/package.py | var/spack/repos/builtin/packages/py-rsatoolbox/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 PyRsatoolbox(PythonPackage):
"""Representational Similarity Analysis (RSA) in Python."""
... | Python | 0 | |
0ac0c81a3427f35447f52c1643229f5dbe607002 | Add a merge migration and bring up to date | osf/migrations/0099_merge_20180426_0930.py | osf/migrations/0099_merge_20180426_0930.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-26 14:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0098_merge_20180416_1807'),
('osf', '0096_add_provider_doi_prefixes'),
]
op... | Python | 0 | |
2731aba68f86c0adcb26f4105c7418ffa35e3d09 | add first auto-test | test/run_test.py | test/run_test.py | #!/usr/bin/env python
import sys
import os
from subprocess import Popen, PIPE
import re
class TestFailure(Exception):
pass
def do_bgrep(pattern, paths, options=[], retcode=0):
bgrep_path = '../bgrep'
args = [bgrep_path]
args += list(options)
args.append(pattern.encode('hex'))
args += list(pat... | Python | 0.000382 | |
d6315d28ed55b76f3caa3fff26141815f7da7dec | add migration | accelerator/migrations/0027_modify_video_url_help_text.py | accelerator/migrations/0027_modify_video_url_help_text.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-12-05 16:27
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import embed_video.fields
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0026_startup_ackn... | Python | 0.000001 | |
d573d33cc37ad666d3a4f47a5ac9dfec5a9b5fc5 | add app config | app/appconfig.py | app/appconfig.py | # -*- coding:utf8 -*-
# Author: shizhenyu96@gamil.com
# github: https://github.com/imndszy
HOST = "https://www.njuszy.cn/"
| Python | 0.000002 | |
063512ec551c4ae156ebe26d607c844973d109c8 | Test coverage for network v2 security groups client | tempest/tests/lib/services/network/test_security_groups_client.py | tempest/tests/lib/services/network/test_security_groups_client.py | # Copyright 2017 AT&T Corporation.
# 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 require... | Python | 0.003763 | |
592145cf644262a21d9f5ac8850c1d59eeac83fe | bring over from other repo | GrammarParser.py | GrammarParser.py | ''' https://gist.github.com/alexbowe/879414#file-nltk-intro-py-L34'''
from nltk.corpus import stopwords
import nltk
stopwords = stopwords.words('english')
lemmatizer = nltk.WordNetLemmatizer()
stemmer_alt = nltk.stem.porter.PorterStemmer()
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow v... | Python | 0 | |
ffc32773953da2cf9e1d6e84aed1b53debc2c7c7 | Create __init__.py | cltk/stem/middle_english/__init__.py | cltk/stem/middle_english/__init__.py | Python | 0.000429 | ||
c7529927174b1626a0dc34f635b1d5939f565add | Add problem77.py | euler_python/problem77.py | euler_python/problem77.py | """
problem77.py
It is possible to write ten as the sum of primes in exactly five different ways:
7 + 3
5 + 5
5 + 3 + 2
3 + 3 + 2 + 2
2 + 2 + 2 + 2 + 2
What is the first value which can be written as the sum of primes in over five
thousand different ways? """
from itertools import count, takewhi... | Python | 0.000164 | |
f93a79aedde8883241b247244b4d15311ed2967a | Add explanation of url encoding | elasticsearch/connection/http_urllib3.py | elasticsearch/connection/http_urllib3.py | import time
import urllib3
from .base import Connection
from ..exceptions import ConnectionError
from ..compat import urlencode
class Urllib3HttpConnection(Connection):
"""
Default connection class using the `urllib3` library and the http protocol.
:arg http_auth: optional http auth information as either... | import time
import urllib3
from .base import Connection
from ..exceptions import ConnectionError
from ..compat import urlencode
class Urllib3HttpConnection(Connection):
"""
Default connection class using the `urllib3` library and the http protocol.
:arg http_auth: optional http auth information as either... | Python | 0.000007 |
11cbc92e292a54b219f8b5ec64ae8ab58577362d | add standalone davidson test w/ near-degeneracies | tests/test021.py | tests/test021.py | import numpy as np
from mmd.utils.davidson import davidson
def test_davidson():
np.random.seed(0)
dim = 1000
A = np.diag(np.arange(dim,dtype=np.float64))
A[1:3,1:3] = 0
M = np.random.randn(dim,dim)
M += M.T
A += 1e-4*M
roots = 5
E, C = davidson(A, roots)
E_true, C_true = np.... | Python | 0.000001 | |
781d43e48e83f00e4cd18e805efed7558b570adf | introduce btc select command | btc/btc_select.py | btc/btc_select.py | import argparse
import fnmatch
import sys
import os
import re
from .btc import encoder, decoder, error, ordered_dict
_description = 'select some values'
def main():
parser = argparse.ArgumentParser()
parser.add_argument('keys', metavar='KEY', nargs='+', default=None,
help='keys associa... | Python | 0.000002 | |
f947e6766c77f58a6cc1bd0d97758e43d6750c7f | add barycentric coordinates | src/compas/geometry/interpolation/barycentric.py | src/compas/geometry/interpolation/barycentric.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import subtract_vectors
from compas.geometry import dot_vectors
__all__ = [
'barycentric_coordinates'
]
def barycentric_coordinates(point, triangle):
"""Compute the barycentric ... | Python | 0.000011 | |
ab946575b1050e67e2e6b4fdda237faa2dc342f5 | add conversion script for BDDMPipeline | scripts/conversion_bddm.py | scripts/conversion_bddm.py |
import argparse
import torch
from diffusers.pipelines.bddm import DiffWave, BDDMPipeline
from diffusers import DDPMScheduler
def convert_bddm_orginal(checkpoint_path, noise_scheduler_checkpoint_path, output_path):
sd = torch.load(checkpoint_path, map_location="cpu")["model_state_dict"]
noise_scheduler_sd = ... | Python | 0 | |
271b042c4dfa2d599e1e5b6920fb996798eac631 | Fix port picking logic in Python tests | src/python/grpcio_tests/tests/unit/_reconnect_test.py | src/python/grpcio_tests/tests/unit/_reconnect_test.py | # Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2017 gRPC authors.
#
# 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.00001 |
67d409b6be5f90c33e73ddf73ba2966d8f2c44f4 | Find max function in python | Maths/FindMax.py | Maths/FindMax.py | # NguyenU
import math
def find_max(nums):
max = 0
for x in nums:
if x > max:
max = x
print max
| Python | 0.999997 | |
922513b2e0e26432fd4e4addfe83e2b84d631d4f | Create change_function_signature.py | change_function_signature.py | change_function_signature.py | def foo(a):
print(a)
def bar(a, b):
print(a, b)
func = foo
func(10)
func.__code__ = bar.__code__
func(10, 20)
| Python | 0.000006 | |
2047de88e50ad814cc2ebdae48dc387fb2ab78d7 | add migration to add not null constraint to cb | fixcity/bmabr/migrations/0006_constrainnotnull_communityboard.py | fixcity/bmabr/migrations/0006_constrainnotnull_communityboard.py |
from south.db import db
from django.db import models
from fixcity.bmabr.models import *
class Migration:
def forwards(self, orm):
db.alter_column(u'gis_community_board', 'borocd',
models.IntegerField(null=False))
# for some reason, south doesn't like altering geometry ... | Python | 0 | |
a3b31137ac96bf3480aaecadd5faf3ca051fc4b0 | Add bare ConnectionState | litecord/gateway/state.py | litecord/gateway/state.py |
class ConnectionState:
"""State of a connection to the gateway over websockets
Attributes
----------
session_id: str
Session ID this state refers to.
events: `collections.deque`[dict]
Deque of sent events to the connection. Used for resuming
This is filled up when the ... | Python | 0.000002 | |
83f2e11d63168e022d99075d2f35c6c813c4d37d | add a simple linear regression model | gnt_model.py | gnt_model.py | import tensorflow as tf
from utils.gnt_record import read_and_decode, BATCH_SIZE
with open('label_keys.list') as f:
labels = f.readlines()
tfrecords_filename = "hwdb1.1.tfrecords"
filename_queue = tf.train.string_input_producer(
[tfrecords_filename], num_epochs=10)
# Even when reading in multiple threads, s... | Python | 0.055082 | |
15970841d53e14d3739d8f512f815e8e3c19bf02 | Create Opcao.py | backend/Database/Models/Opcao.py | backend/Database/Models/Opcao.py | from Database.Controllers.Curso import Curso
class Opcao(object):
def __init__(self,dados=None):
if dados is not None:
self.id = dados ['id']
self.nome = dados ['nome']
self.id_curso = dados ['id_curso']
def getId(self):
return self.id
def setNome(self,nome):
self.nome = nome
def getNome(self... | Python | 0 | |
95f07b0b7790c1bdff53389089f5b428e4916e08 | add initial version of balancing tree | boltons/treeutils.py | boltons/treeutils.py | # 0 = item
# 1 = left
# 2 = right
# 3 = height
"""
maintains insertion order on equal values by going right when equal.
"""
class Tree(object):
def __init__(self):
self.root = None
self.node_count = 0
def insert(self, item):
hash(item)
cur = self.root
if not cur:
... | Python | 0 | |
3f50dcf6d91192253af320aaf72fcb13d307e137 | add new package | var/spack/repos/builtin/packages/memsurfer/package.py | var/spack/repos/builtin/packages/memsurfer/package.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Memsurfer(PythonPackage):
"""MemSurfer is a tool to compute and analyze membrane surfaces... | Python | 0.000001 | |
76cfd2931f3aaacf37e39218833d2307233ddd04 | Add tests for bson serialization functions | tests/test_serialization_bson.py | tests/test_serialization_bson.py | import unittest
import dimod
from dimod.serialization.bson import bqm_bson_decoder, bqm_bson_encoder
import numpy as np
try:
import bson
_bson_imported = True
except ImportError:
_bson_imported = False
class TestBSONSerialization(unittest.TestCase):
def test_empty_bqm(self):
bqm = dimod.Bina... | Python | 0 | |
b5db8d8b0620491169d54eaf05bb57e5a61903e1 | add bash8 tool (like pep8, but way hackier) | bash8.py | bash8.py | #!/usr/bin/env python
#
# 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, software... | Python | 0.000002 | |
db4ba2ca4e0ea96c9bc3f7e9d3eb61e7c7c3bc23 | Create softmax | softmax.py | softmax.py | #! /usr/bin/env python
"""
Author: Umut Eser
Program: softmax.py
Date: Friday, September 30 2016
Description: Softmax applied over rows of a matrix
"""
import numpy as np
def softmax(X):
"""
Calculates softmax of the rows of a matrix X.
Parameters
----------
X : 2D numpy array
Return
--... | Python | 0.000001 | |
28696b671a5f80f781c67f35ae5abb30efd6379c | Solve Time Conversion in python | solutions/uri/1019/1019.py | solutions/uri/1019/1019.py | import sys
h = 0
m = 0
for t in sys.stdin:
t = int(t)
if t >= 60 * 60:
h = t // (60 * 60)
t %= 60 * 60
if t >= 60:
m = t // 60
t %= 60
print(f"{h}:{m}:{t}")
h = 0
m = 0
| Python | 0.999882 | |
9876f372100bbc4c272378fe9a06f7d7ddd90308 | Add twitter daily backup script | twitter/daily.py | twitter/daily.py | #!/usr/bin/env python3
import json
from datetime import datetime
import pymysql
from requests_oauthlib import OAuth1Session
class Twitter():
def __init__(self):
self.session = OAuth1Session(
client_key="{consumer_key}",
client_secret="{consumer_secret}",
resource_owne... | Python | 0.000001 | |
69005d995aa0e6d291216101253197c6b2d8260a | Add module for command-line interface | husc/main.py | husc/main.py | import argparse
parser = argparse.ArgumentParser(description="Run the HUSC functions.")
subpar = parser.add_subparsers()
stitch = subpar.add_parser('stitch',
help="Stitch four quadrants into one image.")
stitch.add_argument('quadrant_image', nargs=4,
help="The images ... | Python | 0.000001 | |
10440cbcde68ecf16c8b8b326ec96d1d7f8c6d6d | add basic PID for sial position | src/boat_pid_control/src/boat_pid_control/sailPID.py | src/boat_pid_control/src/boat_pid_control/sailPID.py | """
PID control for the sailing robot
controling sail position
based on goal sail direction
Inputs:
- current heading
- goal heading
Output:
- Change in motor position/motor position
TODO:
consider tack and jibe
"""
import rospy
PROPORTIONAL_GAIN = 0.1
INTEGRAL_GAIN = 0
DERIVATIVE_GAIN = 0
currentHeading = 23
... | Python | 0 | |
ea0087970b0c0adfd8942123899ff0ec231afa03 | Handle stealable element with utils | test/selenium/src/lib/page/extended_info.py | test/selenium/src/lib/page/extended_info.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""A module for extended info page models (visible in LHN on hover over
obje... | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""A module for extended info page models (visible in LHN on hover over
obje... | Python | 0 |
1f47c575cfd310fd4bee18673f7cbb69eb622959 | Create block_params.py | block_params.py | block_params.py | # block_params.py
# Demonstration of a blockchain 2 of 3 components
GENESIS_INDEX = 0
GENESIS_PREVIOUS_HASH = '0'
GENESIS_TIMESTAMP = 1495851743
GENESIS_DATA = 'first block'
class BlockParams():
def __init__(self, index, previous_hash, timestamp, data):
self.index = index
self.previous_hash = pr... | Python | 0.000004 | |
aa4f01690c4db950144e520cf11466d7d92de291 | Fix for output ports | migrations/versions/910243d8f820_fix_output_ports_with_models.py | migrations/versions/910243d8f820_fix_output_ports_with_models.py | """fix output ports with models
Revision ID: 910243d8f820
Revises: 500f09c2325d
Create Date: 2017-12-19 16:19:33.927563
"""
import json
from alembic import context
from alembic import op
from sqlalchemy import String, Integer
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql import table, column
# revisio... | Python | 0.000005 | |
65dc2f12d8540d3aa494447033e022fe3995701b | correct language mistake | btc_download.py | btc_download.py | #! /usr/bin/env python
import argparse
import sys
import os
from btc import encoder, decoder, error, warning, list_to_dict, dict_to_list, client
_description = 'download torrent file locally'
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--directory', default='.')
parser.add_a... | #! /usr/bin/env python
import argparse
import sys
import os
from btc import encoder, decoder, error, warning, list_to_dict, dict_to_list, client
_description = 'download torrent file locally'
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--directory', default='.')
parser.add_a... | Python | 0.999994 |
7922b24882894cbc83bd4247c11d8c4a66b4b218 | Add utility script for database setup | _setup_database.py | _setup_database.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setup.create_teams import migrate_teams
from setup.create_divisions import create_divisions
if __name__ == '__main__':
# migrating teams from json file to database
migrate_teams(simulation=True)
# creating divisions from division configuration file
c... | Python | 0 | |
af436dd269a959324b495885b9406610f3737a7a | Create addtoindex.py | udacity/webcrawler/addtoindex.py | udacity/webcrawler/addtoindex.py | # Define a procedure, add_to_index,
# that takes 3 inputs:
# - an index: [[<keyword>,[<url>,...]],...]
# - a keyword: String
# - a url: String
# If the keyword is already
# in the index, add the url
# to the list of urls associated
# with that keyword.
# If the keyword is not in the index,
# add an entry to the inde... | Python | 0.000001 | |
01c4554123cbf1d37fe73fdb51ccacdedf870635 | 1. Two Sum. Brute-force | p001_brute_force.py | p001_brute_force.py | import unittest
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for i, a in enumerate(nums):
for j, b in enumerate(nums[i + 1:]):
if a + b == target:
... | Python | 0.999581 | |
93621f9441af4df77c8364050d7cc3dc2b1b43b2 | Add tests for `check` command | tests/functional/registration/test_check.py | tests/functional/registration/test_check.py | """
Test check/validation command.
"""
import os
import subprocess
this_folder = os.path.abspath(os.path.dirname(__file__))
def test_check_metamodel():
"""
Meta-model is also a model
"""
metamodel_file = os.path.join(this_folder,
'projects', 'flow_dsl', 'flow_dsl', ... | Python | 0.000003 | |
720e288aba61ecc2214c8074e33d181c0d4584f5 | Add do_datasets module | carto/do_datasets.py | carto/do_datasets.py | """
Module for working with Data Observatory Datasets
.. module:: carto.do_datasets
:platform: Unix, Windows
:synopsis: Module for working with Data Observatory Datasets
.. moduleauthor:: Jesús Arroyo <jarroyo@carto.com>
"""
from pyrestcli.fields import CharField
from .resources import Resource, Manager
fro... | Python | 0.000001 | |
69939f351cd9c9d555fa1cd091b67314558e862b | Add __future__ import | powerline/segments/tmux.py | powerline/segments/tmux.py | # vim:fileencoding=utf-8:noet
from __future__ import absolute_import, unicode_literals, division, print_function
from powerline.bindings.tmux import get_tmux_output
def attached_clients(pl, minimum=1):
'''Return the number of tmux clients attached to the currently active session
:param int minimum:
The minimum ... | # vim:fileencoding=utf-8:noet
from powerline.bindings.tmux import get_tmux_output
def attached_clients(pl, minimum=1):
'''Return the number of tmux clients attached to the currently active session
:param int minimum:
The minimum number of attached clients that must be present for this
segment to be visible.
... | Python | 0.999979 |
6e8c3147938c72114b2fd18db47cca8a23fd147e | fix tests | test/mutations_test.py | test/mutations_test.py | import unittest
from exporter.mutations import TerraformMutation, ManifestMutation
from exporter.exceptions import FieldNotOptionalException
cf_dict = {
"cf_orgs":[{
"name": "first_org",
"spaces": [
{
"name": "first_space",
"org": "first_org",
"quota": "m",
"allow_ssh": True,
"asgs": [],
"m... | Python | 0.000001 | |
ba76ae145c570fce671f0ab115d4a0740a29cde4 | add hadoop | conpaas-client/cps/hadoop.py | conpaas-client/cps/hadoop.py | import sys
from cps.base import BaseClient
class Client(BaseClient):
def info(self, service_id):
service = BaseClient.info(self, service_id)
def usage(self, cmdname):
BaseClient.usage(self, cmdname)
| Python | 0.000001 | |
2476e7202933c197004688d32994d3b24a7ce74f | Add missing fulltoc for Sphinx documentation. | docs/vendor/sphinxcontrib/fulltoc.py | docs/vendor/sphinxcontrib/fulltoc.py | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# 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
#
# ... | Python | 0 | |
0822547f3fcd79a5332c450d78cd24999e5e81d0 | Migrate huts | c2corg_api/scripts/migration/documents/waypoints/huts.py | c2corg_api/scripts/migration/documents/waypoints/huts.py | from c2corg_api.scripts.migration.documents.waypoints.waypoint import \
MigrateWaypoints
class MigrateHuts(MigrateWaypoints):
def get_name(self):
return 'huts'
def get_count_query(self):
return (
'select count(*) from app_huts_archives;'
)
def get_query(self):
... | Python | 0.000001 | |
c994c1c86df7e6698ccef342b1b2101f03c01587 | Add daily stats | tpt/ppatrigger/management/commands/dailystats.py | tpt/ppatrigger/management/commands/dailystats.py | import traceback
import pytz
from datetime import datetime, timedelta
from django.core.management.base import BaseCommand
from ppatrigger.models import Package
from ppatrigger.models import DailyStats
from ppatrigger.models import Build
class Command(BaseCommand):
args = ''
help = 'Compile daily stats for all ... | Python | 0.000012 | |
7c2095c0330d14382db76bef944efae5f8d76faf | Add file with tests from rainbow categorical type example | dynd/tests/test_types_categorical.py | dynd/tests/test_types_categorical.py | import sys
import unittest
from dynd import nd, ndt
class TestDType(unittest.TestCase):
def test_make_categorical(self):
# Create categorical type with 256 values
tp = ndt.make_categorical(nd.range(0, 512, 2))
self.assertEqual(tp.type_id, 'categorical')
self.assertEqual(tp.storage_t... | Python | 0 | |
9f73e60ba9d3775ef4dda9c815412f28ed80b518 | Add new package: lzop (#17098) | var/spack/repos/builtin/packages/lzop/package.py | var/spack/repos/builtin/packages/lzop/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Lzop(CMakePackage):
"""lzop is a file compressor which is very similar to gzip. lzop uses
... | Python | 0 | |
1f5158d7c24e304b1b2ed2c374cd05aa662aa333 | Add LruCache object. | statbot/cache.py | statbot/cache.py | #
# cache.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT ANY W... | Python | 0 | |
20b8f5c5d390d8449e4dc18cf98291486aeb7153 | [151. Reverse Words in a String][Accepted]committed by Victor | 151-Reverse-Words-in-a-String/solution.py | 151-Reverse-Words-in-a-String/solution.py | class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
if not s:
return ""
words=s.split()
print words
i,j=0,len(words)-1
while i<j:
words[i],words[j]=words[j],words[i]
i... | Python | 0.999993 | |
0eb573afa067e23422c5a5495563a6f4d87a549d | Create soundcloud.py | apis/soundcloud.py | apis/soundcloud.py | """ Contains functions to fetch info from api.soundcloud.com """
from utilities import web
# Soundcloud API key.
SOUNDCLOUD_API_KEY = '4ce43a6430270a1eea977ff8357a25a3'
def soundcloud_search(search):
"""
Searches soundcloud's API for a given search term.
:param search: str the search term to search for.... | Python | 0.000009 | |
cc55fc564e84718710e1c29ca7e29be522aa70c5 | Create OutputNeuronGroup_Liquid.py | examples/OutputNeuronGroup_Liquid.py | examples/OutputNeuronGroup_Liquid.py | '''
Example of a spike receptor (only receives spikes)
In this example spikes are received and processed creating a raster plot at the end of the simulation.
'''
from brian import *
import numpy
from brian_multiprocess_udp import BrianConnectUDP
# The main function with the NeuronGroup(s) and Synapse(s) must be na... | Python | 0 | |
5feef18ca3dda099f33568bf0f2b189fe297a3e0 | add test function rosenbrock | pyea/functions/__init__.py | pyea/functions/__init__.py | #TODO: Add documentation
import numpy as np
def func_rosenbrock(pop, a=1, b=100):
# http://en.wikipedia.org/wiki/Rosenbrock_function
x = pop[:, 0]
y = pop[:, 1]
return (a - x)**2 + b * (y - x**2)**2
def print_func(func, **kwargs):
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.py... | Python | 0.000002 | |
378bd7f4d647243a1e736f4dc0bfd0742d5f3d0b | Create Combinations.py | Array/Combinations.py | Array/Combinations.py | ```
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3],
[1,4],
]
```
class Solution:
# @return a list of lists of integers
def combine(self, n, k):
def combine_helper... | Python | 0.000001 | |
be9a1afc61be483e8c585cef247f62071809c894 | add BuildWorktree.set_default_config | python/qibuild/worktree.py | python/qibuild/worktree.py | import os
import qisys.command
import qisys.worktree
from qibuild.dependencies_solver import topological_sort
import qibuild.build
import qibuild.build_config
import qibuild.project
class BuildWorkTreeError(Exception):
pass
class BuildWorkTree(qisys.worktree.WorkTreeObserver):
""" Stores a list of projects t... | import os
import qisys.command
import qisys.worktree
from qibuild.dependencies_solver import topological_sort
import qibuild.build
import qibuild.build_config
import qibuild.project
class BuildWorkTreeError(Exception):
pass
class BuildWorkTree(qisys.worktree.WorkTreeObserver):
"""
"""
def __init__(s... | Python | 0.000001 |
c042f640b1d841b6779cd69393b47ef65cfedfea | add problem 11 | python/problem_11.py | python/problem_11.py | # -*- coding: utf-8 -*-
"""
Largest product in a grid
https://projecteuler.net/problem=11
"""
GRID = """
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
52 70 95 23 04 60 11 42 69 24 68 56... | Python | 0.002707 | |
474c5f977ab5b035567f0107c457622c51189ac6 | Add new topics migration file | csunplugged/topics/migrations/0086_auto_20171108_0840.py | csunplugged/topics/migrations/0086_auto_20171108_0840.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-08 08:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topics', '0085_auto_20171030_0035'),
]
operations = [
migrations.AddField(
... | Python | 0 | |
afe0f8fc731639cbe28798bb2a554c84ccbd8b2a | Create test_script.py | test_script.py | test_script.py | print "hello world"
| Python | 0.000004 | |
a2bc05454ba166e3931fba130e44f49f66a79080 | Add virtualshackles crawler | comics/comics/virtualshackles.py | comics/comics/virtualshackles.py | import re
from comics.aggregator.crawler import CrawlerBase, CrawlerResult
from comics.meta.base import MetaBase
class Meta(MetaBase):
name = 'Virtual Shackles'
language = 'en'
url = 'http://www.virtualshackles.com/'
start_date = '2009-03-27'
rights = 'Jeremy Vinar and Mike Fahmie'
class Crawler(... | Python | 0 | |
c13014c18496f35c4c94f156a18d442d3859f73b | Add assembly testing module | testing_ops.py | testing_ops.py | from __future__ import absolute_import, print_function, division
from firedrake import *
mesh = UnitSquareMesh(2, 2, quadrilateral=False)
n = FacetNormal(mesh)
degree = 1
V = FunctionSpace(mesh, "RT", degree)
U = FunctionSpace(mesh, "DG", degree - 1)
W = V * U
u, p = TrialFunctions(W)
v, q = TestFunctions(W)
a = (... | Python | 0 | |
263cb3990c9e4e387ab409a982e477958fef6f55 | Add tests for the coordination number filter. | CDJSVis/filtering/filters/tests/test_coordinationNumber.py | CDJSVis/filtering/filters/tests/test_coordinationNumber.py |
"""
Unit tests for the coordination number filter
"""
import unittest
import numpy as np
from ....lattice_gen import lattice_gen_fcc, lattice_gen_bcc
from .. import coordinationNumberFilter
from .. import base
from ....state.atoms import elements
###################################################################... | Python | 0 | |
71afe426a84789b65953ccd057014d17a11de859 | Add a command to extend the generation_high from generation 1 to 2 | mzalendo/core/management/commands/core_extend_areas_to_generation_2.py | mzalendo/core/management/commands/core_extend_areas_to_generation_2.py | # The import of data into Kenyan MapIt had the constituencies in
# generation 2, while all the other area types were in generation 1.
# This is unfortunate since it makes it appear to later import scripts
# that the district type disappeared between generation 1 and 3.
#
# This script just extends the generation_high t... | Python | 0.002458 | |
17fddbb1df78420aaebb811785b8e99769b45fa9 | Create keyradius.py | bin/keyradius.py | bin/keyradius.py |
import csv
from numpy import sqrt
# Midpoint for Key Bridge
x1 = 38.902543
y1 = -77.069830
# Threshold marker
x2 = 38.900122
y2 = -77.071176
radius_squared = (x2 - x1)**2 + (y2 - y1)**2
radius = sqrt(radius_squared)
data_file = open("IncidentData_24OCT14.csv", "rU")
data = csv.DictReader(data_file)
results = []... | Python | 0 | |
fbc92f8400d4565a86b81329053a1302ce21c2f8 | Add English Unique Pupil Number (UPN) | stdnum/gb/upn.py | stdnum/gb/upn.py | # upn.py - functions for handling English UPNs
#
# Copyright (C) 2017 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your opt... | Python | 0.00001 | |
c27e97ea959a9863e57ce12b0afc5fa092562548 | Create Character.py | Character.py | Character.py | import untangle
class Character(object):
def __init__(self, data):
assert isinstance(data, dict)
self.__dict__ = data
def get_data(character):
'''
:param character: String, character name
:return: Dictionary, character data
'''
path = 'tests\\'
filepath = path + ch... | Python | 0 | |
983d6b12db4050ff7d252e1717adbfe39add2f49 | Add missing file | Allura/allura/lib/widgets/auth_widgets.py | Allura/allura/lib/widgets/auth_widgets.py | import ew as ew_core
import ew.jinja2_ew as ew
from ew.core import validator
from pylons import request
from formencode import Invalid
from webob import exc
from .forms import ForgeForm
from allura.lib import plugin
class LoginForm(ForgeForm):
submit_text='Login'
style='wide'
class fields(ew_core.NameLi... | Python | 0 | |
c349e8df72c09a98fe6b038c763c41008bef70a2 | add migration for reimporting universities | hs_dictionary/migrations/0005_reimport_universities.py | hs_dictionary/migrations/0005_reimport_universities.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import csv
import os
from django.db import migrations, models
from hs_dictionary.models import University
def forwards(apps, schema_editor):
University.objects.all().delete()
with open(os.path.dirname(__file__) + "/world-universities.csv") as ... | Python | 0 | |
d77e8df3fa913e7a60c1870e49a6b6197d7a9125 | Add tests for zerver/views/realm_emoji.py. | zerver/tests/test_realm_emoji.py | zerver/tests/test_realm_emoji.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from zerver.lib.actions import get_realm, check_add_realm_emoji
from zerver.lib.test_helpers import AuthedTestCase
import ujson
class RealmEmojiTest(AuthedTestCase):
def test_list(self):
self.login("iago@zulip.com")
realm = get_realm(... | Python | 0 | |
6cb66978e44d447fd210dd92de194659b5f33fb3 | Add debug util for WORKSPACE. | bazel/debug_repository.bzl | bazel/debug_repository.bzl | """Debug util for repository definitions."""
def debug_repository(repo, *fields):
"""debug_repository(repo) identifies which version of a repository has been
defined in the WORKSPACE by printing some of its fields. Example:
# at the bottom of the WORKSPACE file
load("//bazel:debug_repository.bzl", "de... | Python | 0.000433 | |
316bef330c0770739e95f9c1108e07697655d27e | fix when multi python version bug | cobra/__version__.py | cobra/__version__.py | import sys
import platform
__title__ = 'cobra'
__description__ = 'Code Security Audit'
__url__ = 'https://github.com/wufeifei/cobra'
__issue_page__ = 'https://github.com/wufeifei/cobra/issues/new'
__python_version__ = sys.version.split()[0]
__platform__ = platform.platform()
__version__ = '2.0.0-alpha'
__author__ = 'F... | import sys
import platform
__title__ = 'cobra'
__description__ = 'Code Security Audit'
__url__ = 'https://github.com/wufeifei/cobra'
__issue_page__ = 'https://github.com/wufeifei/cobra/issues/new'
__python_version__ = sys.version.split()[0]
__platform__ = platform.platform()
__version__ = '2.0.0-alpha'
__author__ = 'F... | Python | 0.000001 |
b67041367fcc10da7879c123ab44671f258ef649 | support script in python for bootstrapping erlang on a new erts | support/build.py | support/build.py | #! /bin/python
"""Support for building sinan, bootstraping it on a new version of erlang"""
import sys
import os
import commands
from optparse import OptionParser
class BuildError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
ERTS_VERSI... | Python | 0 | |
1483b352683ecf126e1063c3a6fa2f07dcdb7720 | add new module.wq | cno/core/gtt.py | cno/core/gtt.py | import numpy as np
import pylab
import pandas as pd
from biokit.rtools import RSession
from cno.core import CNORBase
from easydev import TempFile
__all__ = ['GTTBool']
class GTTBool(CNORBase):
"""
::
from cno import *
c = cnorbool.CNORbool(cnodata("PKN-ToyMMB.sif"), cnodata("MD-ToyMMB.csv")... | Python | 0.000001 | |
e307bf72a8aa21088d491c90efd9a731014e63f1 | move states into separate file | stacks/states.py | stacks/states.py | FAILED_STACK_STATES = [
'CREATE_FAILED',
'ROLLBACK_FAILED',
'DELETE_FAILED',
'UPDATE_ROLLBACK_FAILED'
]
COMPLETE_STACK_STATES = [
'CREATE_COMPLETE',
'UPDATE_COMPLETE',
]
ROLLBACK_STACK_STATES = [
'ROLLBACK_COMPLETE',
'UPDATE_ROLLBACK_COMPLETE',
]
IN_PROGRESS_STACK_STATES = [
'CREATE_... | Python | 0.000004 | |
13dfb4f7d4972edbc7ccc0e4f62ea3db1a5b16f4 | Add ctx module | srw/ctx.py | srw/ctx.py | def wd2jd(wd):
jd_ref = 2453005.5
return (wd / 86400.) + jd_ref
| Python | 0.000001 | |
19acf7ad2a14b71f672d02cb8cb47a4393665bc7 | Add benchmarks | bin/serialize.py | bin/serialize.py | """Timing serializtion of deeply nested geometry collections.
To and from JSON using dumps and loads from Python's json module. I'm
happy to report that writing such GeoJSON geometry collections is more
expensive than parsing them and, at least for Python, deeply nested
geometry collections aren't an asymmetric attack... | Python | 0.00001 | |
7c9b97a81d4c8e41ce81cc881d30323dfb1f9c72 | Add layer normalization | chainer/links/normalization/layer_normalization.py | chainer/links/normalization/layer_normalization.py | from chainer import functions
from chainer import initializers
from chainer import link
from chainer import links
class LayerNormalization(link.Chain):
"""Layer normalization layer on outputs of linear functions.
This is a link of "Layer Normalization". This layer
normalizes, scales and shifts input uni... | Python | 0.000001 | |
b88b97c7d56506804fc9eb93ce7074454fc492f3 | Add the migration for designations. | base/apps/people/migrations/0002_auto_20141223_0316.py | base/apps/people/migrations/0002_auto_20141223_0316.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('people', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Designation',
fields=[
... | Python | 0.000001 | |
3b23e35e58c9269a7fb9275aafadb276ba2b30d0 | Problem 12 Completed | project_euler_12.py | project_euler_12.py | '''
Shayne Hodge
2/15/2014
Project Euler Problem 12
n -> n/2 (n is even)
n -> 3n + 1 (n is odd)
Longest sequence under one million?
'''
#currently a brute force implementation with no niceities
# including, apparently, spell check in the comments
import numpy as np
import matplotlib.pyplot as plt
def make_hist(resu... | Python | 0.999244 | |
f3dbe9bb2aa627b3485c2ed44f889a1bc5463081 | Bump to version 3.1.3 | rest_framework/__init__.py | rest_framework/__init__.py | """
______ _____ _____ _____ __
| ___ \ ___/ ___|_ _| / _| | |
| |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__
| /| __| `--. \ | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /
| |\ \| |___/\__/ / | | | | | | | (_| | | | ... | """
______ _____ _____ _____ __
| ___ \ ___/ ___|_ _| / _| | |
| |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__
| /| __| `--. \ | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /
| |\ \| |___/\__/ / | | | | | | | (_| | | | ... | Python | 0 |
57714fd6838f48920f7093a24ec4d85abf4278ee | Fix merge issue | src/naarad/naarad_imports.py | src/naarad/naarad_imports.py | # coding=utf-8
"""
© 2013 LinkedIn Corp. 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... | # coding=utf-8
"""
© 2013 LinkedIn Corp. 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... | Python | 0.000001 |
6de41e5acfe55b6cb7698f81e3031079a530b1af | test for cli mode | tests/test_cli_mode.py | tests/test_cli_mode.py | import unittest
from unittest.mock import Mock
from rawdisk.ui.cli.cli_mode import CliMode, CliShell
class CliModeTest(unittest.TestCase):
def test_initialize_loads_fs_plugins(self):
session = Mock()
cli = CliShell(session=session)
cli.initialize()
session.load_plugins.assert_call... | Python | 0.000001 | |
f007cacdba7bb3e46a6c4c730dde50dc495d9c64 | Add hypothesis test for metasync | tests/test_metasync.py | tests/test_metasync.py | # -*- coding: utf-8 -*-
from hypothesis import given
import hypothesis.strategies as st
import pytest
from vdirsyncer.metasync import MetaSyncConflict, metasync
from vdirsyncer.storage.memory import MemoryStorage
from . import blow_up
def test_irrelevant_status():
a = MemoryStorage()
b = MemoryStorage()
... | # -*- coding: utf-8 -*-
import pytest
from vdirsyncer.metasync import MetaSyncConflict, metasync
from vdirsyncer.storage.memory import MemoryStorage
from . import blow_up
def test_irrelevant_status():
a = MemoryStorage()
b = MemoryStorage()
status = {'foo': 'bar'}
metasync(a, b, status, keys=())
... | Python | 0.000074 |
be0cb304047c7a410eac577b8aa2765747991100 | add script to summarise output | summary.py | summary.py |
import string, sys, glob
idir = sys.argv[1]
fl = glob.glob( '%s/*.txt' % idir )
ee = {}
for f in fl:
for l in open(f).readlines():
if string.find(l, 'FAILED') != -1:
bits = string.split(l, ':' )
if len(bits) > 3:
code = bits[0]
msg = bits[3]
if code not in ee.keys():
... | Python | 0.000002 | |
6d90ccd7d6f03630106f78ec7d75666429e26e45 | Add an example workloads module | configs/example/arm/workloads.py | configs/example/arm/workloads.py | # Copyright (c) 2020 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | Python | 0.000003 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.