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 |
|---|---|---|---|---|---|---|---|
bf8328ff9b020bd3b99268744f86f94db2924011 | Create process.py | process.py | process.py | rm 1_*
rm 21_*
head *error.txt >> info_gg_unpaired.txt
source /mnt/common/epfl/etc/bbcf_bashrc ### para llamar a todos los programas de bbcf
module add UHTS/Analysis/samtools/1.2;
python -c "from bbcflib import mapseq"
for i in {2..48}
do
add_nh_flag "$i"_16S_gg.sam "$i"_SE_gg.bam
samtools sort "$i"_SE_gg.bam "$... | Python | 0.000002 | |
93589c7e139d3af4b0a949f107fc5e20ed69fee4 | add atop stats library | cbagent/collectors/libstats/atopstats.py | cbagent/collectors/libstats/atopstats.py | from uuid import uuid4
from fabric.api import run
from systemstats import SystemStats, multi_task, single_task
uhex = lambda: uuid4().hex
class AtopStats(SystemStats):
def __init__(self, hosts, user, password):
super(AtopStats, self).__init__(hosts, user, password)
self.logfile = "/tmp/{0}.at... | Python | 0 | |
a6c03ff9bc850248999afa3f597f460ee3eadc26 | Add lexer | curly/lexer.py | curly/lexer.py | # -*- coding: utf-8 -*-
import collections
import re
import textwrap
def make_regexp(pattern):
pattern = textwrap.dedent(pattern)
pattern = re.compile(pattern, re.UNICODE | re.VERBOSE)
return pattern
class Token:
__slots__ = "contents", "raw_string"
REGEXP = make_regexp(".+")
def __ini... | Python | 0.000001 | |
8c65226b79ad0f7ac3487a117298498cff4b23be | Update cherry-pickup.py | Python/cherry-pickup.py | Python/cherry-pickup.py | # Time: O(n^3)
# Space: O(n^2)
class Solution(object):
def cherryPickup(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
# dp holds the max # of cherries two k-length paths can pickup.
# The two k-length paths arrive at (i, k - i) and (j, k - j),
... | # Time: O(n^3)
# Space: O(n^2)
class Solution(object):
def cherryPickup(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
# dp holds the max # of cherries two k-length paths can pickup.
# The two k-length paths arrive at (i, k - i) and (j, k - j),
... | Python | 0 |
43f2accb8cd4f63d62f7515bb5633296a7d592f0 | Add setup.py to spm. | nipype/interfaces/spm/setup.py | nipype/interfaces/spm/setup.py | def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('spm', parent_package, top_path)
config.add_data_dir('tests')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(t... | Python | 0.000136 | |
4797918eec0c43ada3f6eb9a63ec2f275eced253 | Add spider for State Farm Agents; closes #519 | locations/spiders/statefarm.py | locations/spiders/statefarm.py | import json
import re
import scrapy
from locations.items import GeojsonPointItem
class StateFarmSpider(scrapy.Spider):
name = "statefarm"
allowed_domains = ["statefarm.com"]
download_delay = 0.2
start_urls = [
'https://www.statefarm.com/agent/us',
]
def parse_location(self, response... | Python | 0 | |
ebec02461bd341d49a499572d56bdef4520a650e | Add a missing migration | Instanssi/store/migrations/0007_storeitem_is_ticket.py | Instanssi/store/migrations/0007_storeitem_is_ticket.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-11 22:21
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0006_auto_20161209_0015'),
]
operations = [
migrations.AddField(
... | Python | 0.00011 | |
cb01c58e0d11999331eb01e33bf970db8742f2f8 | Create VertexGlyphFilter.py | src/Python/Filtering/VertexGlyphFilter.py | src/Python/Filtering/VertexGlyphFilter.py | #!/usr/bin/env python
import vtk
def main():
colors = vtk.vtkNamedColors()
points = vtk.vtkPoints()
points.InsertNextPoint(0,0,0)
points.InsertNextPoint(1,1,1)
points.InsertNextPoint(2,2,2)
polydata = vtk.vtkPolyData()
polydata.SetPoints(points)
vertexGlyphFilter = vtk.vtkVert... | Python | 0.000001 | |
d2536ce3ded4fc2ea5648025f04efa093629b70f | test rapapasswords table | test/rapapasswordstest.py | test/rapapasswordstest.py | #!/usr/bin/python2.4
#
# Copyright (c) 2005-2007 rPath, Inc.
#
import testsuite
testsuite.setup()
import os
import sys
import time
import tempfile
import fixtures
from mint import rapapasswords
class rAPAPasswordsTest(fixtures.FixturedUnitTest):
@fixtures.fixture("Full")
def testPasswords(self, db, data):
... | Python | 0.000008 | |
45e86e49e845ef25df6e1db3bcb336809ffb5f5f | Disable IPv6 on wireless (Extension Attribute for Casper) | ipv6_Checker.py | ipv6_Checker.py | #!/usr/bin/python
#Copyright 2014 Quam Sodji
import subprocess
def getinfo(hardware): #Return network info on select interface
info = subprocess.check_output(["networksetup", "-getinfo", hardware])
return info
wireless = ["Airport", "Wi-Fi"] #The two type of interfaces that refers to wireless
list_network... | Python | 0 | |
c68872453a0c4a28e31d5ee38faf11d8a0486b62 | add drone_setup.py | drone_setup.py | drone_setup.py | import requests
import json
# Open user-account.json and create a json object containing
# user credential fields.
with open('user-account.json', "r") as jsonFile:
jsonUser = json.load(jsonFile)
jsonFile.close()
# Assign user credentials to variables
USER_EMAIL = jsonUser[0]['email']
USER_API_KEY = jsonUser[0][... | Python | 0.000001 | |
a5ff02a696c553dbd4038e1cb1c0fd0668b30006 | Create ets2look.py | FreePIE/ets2look.py | FreePIE/ets2look.py | hSen = 750
vSen = 200
if starting:
lastX = 0
lastY = 0
thisX = xbox360[0].rightStickX * hSen
thisY = xbox360[0].rightStickY * vSen
mouse.deltaX = thisX - lastX
mouse.deltaY = lastY - thisY
lastX = thisX
lastY = thisY
| Python | 0 | |
7bea7133d8b069e784b8e35e045a6411cac8882c | add movielens (#1027) | python/dllib/src/bigdl/dllib/feature/dataset/movielens.py | python/dllib/src/bigdl/dllib/feature/dataset/movielens.py | #
# Copyright 2016 The BigDL 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 ... | Python | 0 | |
89084ad097336dbfd83a6fed364d19eccab75a7d | Add 24 corrections. | loldb/correct.py | loldb/correct.py | import collections
import warnings
def correct_champions(champions):
for champion in champions:
for ability in champion.abilities:
correct_ability(ability)
ABILITY_CORRECTIONS = {
# @f1@ is usually attack damage scaling
# It is also often used for calculated values
# TODO: Aatrox... | import collections
import warnings
def correct_champions(champions):
for champion in champions:
for ability in champion.abilities:
correct_ability(ability)
ABILITY_CORRECTIONS = {
# Ahri
'Fox-Fire': {
# @f1 shows maximum damage to a single target
# Each fox-fire after... | Python | 0 |
46b7dd2c389d2bf020e2c413518e0f960fa28ba4 | Add test for current_locale expression | tests/test_expressions.py | tests/test_expressions.py | from sqlalchemy_i18n.expressions import current_locale
class TestCurrentLocaleExpression(object):
def test_render(self):
assert str(current_locale()) == ':current_locale'
| Python | 0.000003 | |
3d33aeb24018943ffcc1fdc7a537d871f804a3ab | Add test file | tests/test_popen_spawn.py | tests/test_popen_spawn.py | #!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WIT... | Python | 0.000001 | |
633f5ad8064395ec3805e38ea1f73a9aa7475878 | Use the caller's unpickler as well | jsonpickle/_handlers.py | jsonpickle/_handlers.py | import datetime
import jsonpickle
class DatetimeHandler(jsonpickle.handlers.BaseHandler):
"""
Datetime objects use __reduce__, and they generate binary strings encoding
the payload. This handler encodes that payload to reconstruct the
object.
"""
def flatten(self, obj, data):
pickler =... | import datetime
import jsonpickle
class DatetimeHandler(jsonpickle.handlers.BaseHandler):
"""
Datetime objects use __reduce__, and they generate binary strings encoding
the payload. This handler encodes that payload to reconstruct the
object.
"""
def flatten(self, obj, data):
pickler =... | Python | 0.000001 |
f1f654d823ee8454b53f27372bbaab85f4d01631 | add analyzer | performancetest/rec-analyze.py | performancetest/rec-analyze.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
import re
import sys
import os
import json
import numpy as np
def f(n):
return int(round(n))
def report(name, seq):
print '===', name, '[ms] ==='
print "mean:", f(np.mean(seq)), "\tstd dev:", f(np.std(seq))
print "95%:", ... | Python | 0.000001 | |
e7809f307610e98cb8356110eec7e8c1f41e9d46 | Backup script. | management/backup.py | management/backup.py | #!/usr/bin/env python
import sys
import os
import glob
import shutil
import mc_bin_client
def usage():
print >> sys.stderr, """
Usage: %s <dest_dir>
""" % os.path.basename(sys.argv[0])
sys.exit(1)
def main():
if len(sys.argv) != 2:
usage()
cmd_dir = os.path.dirname(sys.argv[0])
dest_dir =... | Python | 0 | |
2945b68d5a8b6505f1a8516dd8b5f7d4b85aac5a | Add tests for storeslice | numba/tests/test_storeslice.py | numba/tests/test_storeslice.py | from __future__ import print_function
import numba.unittest_support as unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
def usecase(obs, nPoints, B, sigB, A, sigA, M, sigM):
center = nPoints / 2
print(center)
obs[0:center] = np.arange(center)
obs[center] = 321
obs[(ce... | Python | 0 | |
c468f49e50b7a55995ef1fc447c04993c2171ca2 | Add lc0242_valid_anagram.py | lc0242_valid_anagram.py | lc0242_valid_anagram.py | """Leetcode 242. Valid Anagram
Easy
URL: https://leetcode.com/problems/valid-anagram/
Given two strings s and t,
write a function to determine if t is an anagram of s.
Example 1:
Input: s = "anagram", t = "nagaram"
Output: true
Example 2:
Input: s = "rat", t = "car"
Output: false
Note:
You may assume the string co... | Python | 0.007833 | |
dbb812621c58d92bc3c2aed6135ddb9b91cd9181 | implement bucket compaction test | perfrunner/tests/compaction.py | perfrunner/tests/compaction.py | from perfrunner.tests import TargetIterator
from perfrunner.tests.kv import KVTest
class DbCompactionTest(KVTest):
def compact(self):
self.reporter.start()
for target_settings in TargetIterator(self.cluster_spec,
self.test_config):
self.re... | Python | 0 | |
39d75bced42331828091ffa1d4e97525cca1c4eb | Create pgRouting_buffered_isochrones.py | pgRouting_buffered_isochrones.py | pgRouting_buffered_isochrones.py | # creates a network graph, then computes isochrones based on a travel distance and buffer length from edges
import psycopg2
import csv
def create_nearby_graph(dms_id):
# sql query to create the graph for the dms_id
query = '''
-- select all edge gids that are 10km radius from the DMS location
... | Python | 0.000001 | |
72558a2ab7dedd9270e2af23d18fe4dfb0b0707b | add expect_column_values_to_be_fibonacci_number (#4629) | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_fibonacci_number.py | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_to_be_fibonacci_number.py | """
This is a template for creating custom ColumnMapExpectations.
For detailed instructions on how to use it, please see:
https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations
"""
import json
import math
from typing import Optional
from... | Python | 0 | |
c2982060ff7ffbbf784a37675f2caec381e9aa48 | Create quicksort.py | Python/quicksort.py | Python/quicksort.py | def quickSort(arr):
less = []
pivotList = []
more = []
if len(arr) <= 1:
return arr
else:
pivot = arr[0]
for i in arr:
if i < pivot:
less.append(i)
elif i > pivot:
more.append(i)
else:
pivotLi... | Python | 0.000004 | |
592f9901f9125534f59efc2cb36bb4fb2bab351e | Fix typo (#8754) | homeassistant/scripts/__init__.py | homeassistant/scripts/__init__.py | """Home Assistant command line scripts."""
import argparse
import importlib
import logging
import os
import sys
from typing import List
from homeassistant.bootstrap import mount_local_lib_path
from homeassistant.config import get_default_config_dir
from homeassistant.const import CONSTRAINT_FILE
from homeassistant.ut... | """Home Assistant command line scripts."""
import argparse
import importlib
import logging
import os
import sys
from typing import List
from homeassistant.bootstrap import mount_local_lib_path
from homeassistant.config import get_default_config_dir
from homeassistant.const import CONSTRAINT_FILE
from homeassistant.ut... | Python | 0.001331 |
0aaed7764d743afe46af503fe5938fa718fe3abc | Set up contextmanager for db cals | teamworkApp/lib/dbCalls.py | teamworkApp/lib/dbCalls.py | # muddersOnRails()
# Sara McAllister November 5, 2-17
# Last updated: 11-5-2017
# library for SQLite database calls for teamwork analysis app
import contextlib
import sqlite3
DB = 'db/development.sqlite3'
def connect(sqlite_file):
""" Make connection to an SQLite database file """
conn = sqlite3.connect(sql... | Python | 0 | |
6e5074cf969f8667e633ab2fa3373e83402e7610 | Add DigitalOcean | agithub/DigitalOcean.py | agithub/DigitalOcean.py | # Copyright 2012-2016 Jonathan Paugh and contributors
# See COPYING for license details
from base import *
class DigitalOcean(API):
'''
Digital Ocean API
'''
def __init__(self, token=None, *args, **kwargs):
props = ConnectionProperties(
api_url = 'api.digitalocean.com',
... | Python | 0.000002 | |
18aeea496175cb73ccf0d9f164359f75f854b512 | add background_helper | portality/background_helper.py | portality/background_helper.py | """ collections of wrapper function for helping you to create BackgroundTask
"""
from typing import Callable, Type
from portality import models
from portality.background import BackgroundApi, BackgroundTask
from portality.core import app
def execute_by_job_id(job_id,
task_factory: Callable[[mo... | Python | 0.000001 | |
c9e08064cd81e2e8da54e1e06857ef31a6b07980 | add expect_column_values_ip_is_not_blacklisted (#4680) | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_ip_is_not_blacklisted.py | contrib/experimental/great_expectations_experimental/expectations/expect_column_values_ip_is_not_blacklisted.py | """
This is a template for creating custom ColumnMapExpectations.
For detailed instructions on how to use it, please see:
https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations
"""
import json
from typing import Optional
import pydnsbl
... | Python | 0 | |
caef73c6d7d9853e32f5a75b321f515f3c138b6d | Create nzbget.py | comandarr/nzbget.py | comandarr/nzbget.py | Python | 0.000004 | ||
853972cac73c3837c37a5682c2057a0aab500961 | Add tests for VAE framework | pylearn2/models/tests/test_vae.py | pylearn2/models/tests/test_vae.py | import numpy
import theano
import theano.tensor as T
from pylearn2.models.mlp import MLP
from pylearn2.models.mlp import Linear, ConvRectifiedLinear
from pylearn2.models.vae import VAE
from pylearn2.models.vae.visible import BinaryVisible
from pylearn2.models.vae.latent import DiagonalGaussianPrior
from pylearn2.space ... | Python | 0 | |
bf1e9434afc03a21cab5b274401a755c3b84196c | add event.brochure migration | migrations/mezzanine_agenda/0014_event_brochure.py | migrations/mezzanine_agenda/0014_event_brochure.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-10 13:56
from __future__ import unicode_literals
from django.db import migrations
import mezzanine.core.fields
class Migration(migrations.Migration):
dependencies = [
('mezzanine_agenda', '0013_auto_20160510_1542'),
]
operations = [... | Python | 0 | |
fa95e31128e7dcfbbbbab5f48675536ba1b5ebf2 | Add amazon/ec2_instance_status_checks | modules/cloud/amazon/ec2_instance_status_checks.py | modules/cloud/amazon/ec2_instance_status_checks.py | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
module: ec2_instance_status_checks
short description: Perform instance status checks with wait option
description:
- Perform instance status checks
- Wait for x seconds for the status ... | Python | 0.000036 | |
cfa474b489bc02307cc4944d30fbb34b57f843f6 | Add base connection tests | pylxd/tests/test_connection.py | pylxd/tests/test_connection.py | # Copyright (c) 2015 Canonical Ltd
#
# 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 ... | Python | 0 | |
ec138c9429edb7069726eaa725c70a5b82467fe0 | add 02indexed_vbo | OpenGL-Examples/02indexed_vbo.py | OpenGL-Examples/02indexed_vbo.py | # -*- coding: utf-8 -*-
# OpenGL example code - Indexed VBO
# same as the "Shader and VBO" example, only with an indexed vbo.
import ctypes
import numpy as np
from OpenGL.GL import *
from OpenGL.GL import shaders
from glfw import *
class Window(object):
def __init__(self, width=640, height=480, title='GLFW o... | Python | 0.000001 | |
d0afa54fa01a2981c10f0bbdbc0f5eab4b5ad710 | test that test fullscreen/resize with 3d actions | test/test_3d_fullscreen.py | test/test_3d_fullscreen.py | # This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import pyglet
import cocos
from cocos.director import director
from cocos.actions import *
from cocos.layer import *
class BackgroundLayer( cocos.layer.La... | Python | 0 | |
7b4a23758e40dbbd131df930b617a5c08659cca9 | Create app.py | app.py | app.py | #!/Users/cu3alibre/anaconda/bin/python
import os, optparse, uuid, urlparse, time
from threading import Lock
from urllib import urlencode
from pymongo import Connection
import tornado.ioloop
from tornado.web import (RequestHandler, StaticFileHandler, Application,asynchronous)
from tornado.websocket import WebSocketHand... | Python | 0.000003 | |
c8be4b5d598238eb437973d21dd329f70c5d6054 | Create ks4.py | ks4.py | ks4.py | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from urllib2 import Request, urlopen, URLError
from time import sleep # we need sleep for a delay between readings
pc='%' # I find defining % as a variable avoids confusion
logging_enabled = 1 # change to 0 to switch off logg... | Python | 0 | |
3ad49c6d2ca7ca5f04302f8ee125741ddb68c879 | decode base64 output string to UTF-8 | liquid_tags/graphviz.py | liquid_tags/graphviz.py | """
GraphViz Tag
---------
This implements a Liquid-style graphviz tag for Pelican. You can use different
Graphviz programs like dot, neato, twopi etc. [1]
[1] http://www.graphviz.org/
Syntax
------
{% graphviz
<program> {
<DOT code>
}
%}
Examples
--------
{% graphviz
dot {
digraph graph... | """
GraphViz Tag
---------
This implements a Liquid-style graphviz tag for Pelican. You can use different
Graphviz programs like dot, neato, twopi etc. [1]
[1] http://www.graphviz.org/
Syntax
------
{% graphviz
<program> {
<DOT code>
}
%}
Examples
--------
{% graphviz
dot {
digraph graph... | Python | 0.999998 |
126af71599e14866501e2e9f479b2658fff56526 | Create ipc_lista2.06.py | lista2/ipc_lista2.06.py | lista2/ipc_lista2.06.py | Python | 0.000001 | ||
dac5f9e406f3c205d6ed212d4414ca55c94b8f15 | Add test for exact search with album query | tests/local/test_search.py | tests/local/test_search.py | from __future__ import unicode_literals
import unittest
from mopidy.local import search
from mopidy.models import Album, Track
class LocalLibrarySearchTest(unittest.TestCase):
def test_find_exact_with_album_query(self):
expected_tracks = [Track(album=Album(name='foo'))]
tracks = [Track(), Track(... | Python | 0 | |
0a4c26d31eceeee5aca5beb98889f48c085b1cd0 | Add tests for the Content-Disposition header | gmn/src/d1_gmn/tests/test_content_disposition.py | gmn/src/d1_gmn/tests/test_content_disposition.py | #!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... | Python | 0 | |
a99e92756a10529ca1e52d1d351bc43fea067b35 | Add fabfile for API | packaging/radar-api/fabfile.py | packaging/radar-api/fabfile.py | import os
import re
from fabric.api import task, put, run, cd
@task
def deploy(archive=None, name='radar-api'):
if archive is None:
# Use the latest archive by default
archive = sorted(x for x in os.listdir('.') if x.endswith('.tar.gz'))[-1]
version = re.search('-([^-]+-[^-]+)\.tar\.gz$', ar... | Python | 0 | |
246ed2ba33f21b696af2a00793a521bc77da2a45 | add excel-sheet-column-title | vol4/excel-sheet-column-title/excel-sheet-column-title.py | vol4/excel-sheet-column-title/excel-sheet-column-title.py | import string
class Solution(object):
def convertToTitle(self, n):
"""
:type n: int
:rtype: str
"""
alphabet = string.uppercase
ret = ''
while n > 0:
ret = alphabet[(n - 1) % 26] + ret
n = (n - 1) / 26
return ret
| Python | 0.000386 | |
2674b886b786086ec62a18b953e80ec6fceaa59d | Bump subminor version (2.0.5 -> 2.0.6) | endpoints/__init__.py | endpoints/__init__.py | #!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | #!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python | 0 |
0ca298f6706706637dccd4f27c56eed6e91c98ba | Rename new test class correctly and flesh out first passing tests | tests/runners.py | tests/runners.py | import sys
from spec import Spec, trap, eq_
from invoke import Local, Context
from _utils import mock_subprocess
class Local_(Spec):
class run:
@trap
@mock_subprocess(out="sup")
def out_stream_defaults_to_sys_stdout(self):
"out_stream defaults to sys.stdout"
Loca... | from spec import Spec
class Runner_(Spec):
class run:
def out_stream_defaults_to_sys_stdout(self):
"out_stream defaults to sys.stdout"
def err_stream_defaults_to_sys_stderr(self):
"err_stream defaults to sys.stderr"
def out_stream_can_be_overridden(self):
... | Python | 0.000002 |
f6bd8bcf45d182e3aa8edd3cf0fef5aa35125e31 | create ccc.py | src/ccc.py | src/ccc.py | #
# ccc.py
# Created by pira on 2017/07/28.
#
| Python | 0 | |
0843eba3476809e833ea52611d9e193bf0872dbd | Add Back Builder Code | tools/Builder.py | tools/Builder.py | import os
import hashlib
import RandomIO
# config vars
my_address = "1CutsncbjcCtZKeRfvQ7bnYFVj28zeU6fo"
my_store_path = "C://Farm/"
my_shard_size = 1024*1024*128 # 128 MB
my_max_size = 1024*1024*640 # 640 MB
class Builder:
def __init__(self, address, shard_size, max_size):
self.address = address
... | Python | 0 | |
8e74d76a96b0b259bf7d8a4022fae8293749f37d | Add module uniprocessing.py | uniprocessing.py | uniprocessing.py | # Copyright (c) 2016 Kirill 'Kolyat' Kiselnikov
# This file is the part of chainsyn, released under modified MIT license
# See the file LICENSE.txt included in this distribution
"""
Module "uniprocessing" with patterns and universal processing function
process() - function that process one chain to another using given... | Python | 0.000002 | |
8b7d1ffb2461e12b5cbce6873e51ca14f9d8cf90 | Revert "Accidentally deleted manage.py" | SnookR/manage.py | SnookR/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "SnookR.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | Python | 0 | |
202c8472298780cbf80bf3253550e4277236c0c9 | add simple noise fitting code | kid_readout/analysis/noise_fit.py | kid_readout/analysis/noise_fit.py | import numpy as np
import lmfit
from kid_readout.analysis import fitter
print "k"
def lorenz(f,fc,a):
return a/(1+(f/fc)**2)
def simple_noise_model(params,f):
A = params['A'].value
fc = params['fc'].value
nw = params['nw'].value
return lorenz(f,fc,A) + nw
def simple_noise_guess(f,S):
params = ... | Python | 0 | |
5879e59f34e31707f207c588143711dbdf18ee8b | remove login_required for register page | app/main/views/index.py | app/main/views/index.py | from flask import render_template
from flask_login import login_required
from app.main import main
@main.route('/')
def index():
return render_template('signedout.html')
@main.route("/govuk")
def govuk():
return render_template('govuk_template.html')
@main.route("/register")
def register():
return re... | from flask import render_template
from flask_login import login_required
from app.main import main
@main.route('/')
def index():
return render_template('signedout.html')
@main.route("/govuk")
def govuk():
return render_template('govuk_template.html')
@main.route("/register")
@login_required
def register(... | Python | 0 |
8c97e6d00cf48472fc4c76b9d89896d5c1807fd4 | Add lite version, without strict error checking. | stringformat_lite.py | stringformat_lite.py | # -*- coding: utf-8 -*-
"""String formatting for Python 2.5.
This is an implementation of the advanced string formatting (PEP 3101).
CAUTION: this module is a stripped version, without strict error checking.
Author: Florent Xicluna
"""
import re
_format_str_re = re.compile(
r'((?<!{)(?:{{)+' ... | Python | 0 | |
42c496c78fe2dcc06df65641ba1df33c02e41533 | Revert "updates" | cvlib_example.py | cvlib_example.py | """Example using cvlib."""
import cvlib as cv
from cvlib.object_detection import draw_bbox
import cv2
img = image = cv2.imread("assets/sv.jpg")
bbox, label, conf = cv.detect_common_objects(img, model="largess")
print(label)
output_image = draw_bbox(img, bbox, label, conf)
cv2.imwrite("cvlib-example-out.jpg", output_i... | Python | 0 | |
5831dee7a6c14c85933658610ae991fbc0af9442 | Add basic tests for stream.me plugin (#391) | tests/test_plugin_streamme.py | tests/test_plugin_streamme.py | import unittest
from streamlink.plugins.streamme import StreamMe
class TestPluginStreamMe(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(StreamMe.can_handle_url("http://www.stream.me/nameofstream"))
# shouldn't match
self.assertFalse(StreamMe.ca... | Python | 0 | |
cb4629fb8133ac8010fce3c679ad096d2581fe9c | test request | tests/test_request_checker.py | tests/test_request_checker.py | #!/usr/bin/env python
import os
import subprocess
# import requests
import time
from unittest import TestCase
from linkcheckerjs.checker import requests_checker
process = None
def setup_module(module):
global process
path = os.path.abspath(__file__)
dir_path = os.path.dirname(path)
server_js = os... | Python | 0.000001 | |
2b9909004a761047fd935ad51b06102032dbe30a | Create __init__.py | src/nupic/research/frameworks/htm/temporal_memory/__init__.py | src/nupic/research/frameworks/htm/temporal_memory/__init__.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2022, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | Python | 0.000429 | |
09ad948086712793cc0bbf81d5515ef31823a085 | test for committee attendance | tests/unit/test_attendance.py | tests/unit/test_attendance.py | from tests import PMGTestCase
from pmg.models import db, CommitteeMeeting, CommitteeMeetingAttendance, Committee, House, Province, Party, Member
class TestCommitteeMeetingAttendance(PMGTestCase):
def setUp(self):
super(TestCommitteeMeetingAttendance, self).setUp()
province = Province(name='Western... | Python | 0 | |
4ebfc2e6ffb21fd55ef1fc4f1fd836153b2da545 | Add tests for all exceptions | tests/unit/test_exceptions.py | tests/unit/test_exceptions.py | # coding: utf-8
import pytest
import responses
import kiteconnect.exceptions as ex
@responses.activate
def test_wrong_json_response(kiteconnect):
responses.add(
responses.GET,
"%s%s" % (kiteconnect.root, kiteconnect._routes["portfolio.positions"]),
body="{a:b}",
content_type="appl... | Python | 0 | |
cec436eba6174fbf52dc7908e1d5218cd9bea1e7 | add tests around internal classes of Vcf class | tests/vcf_tests/file_tests.py | tests/vcf_tests/file_tests.py | from unittest import TestCase, main
from svtools.vcf.file import Vcf
class Test_Format(TestCase):
def test_init(self):
f = Vcf.Format('GT', 1, 'String', '"Genotype"')
self.assertEqual(f.id, 'GT')
self.assertEqual(f.number, '1')
self.assertEqual(f.type, 'String')
self.assertE... | Python | 0 | |
f131cd221b2ce6fc144b2aa9882cb0ad1b116675 | Add (failing) tests for the dashboard | tests/views/test_dashboard.py | tests/views/test_dashboard.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | Python | 0.000001 | |
920870a310a3c32b851dfe5927aad48d7b86b0c0 | Update model verbose names | project/bhs/migrations/0008_auto_20190514_0904.py | project/bhs/migrations/0008_auto_20190514_0904.py | # Generated by Django 2.1.8 on 2019-05-14 16:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('bhs', '0007_auto_20190513_1349'),
]
operations = [
migrations.AlterModelOptions(
name='group',
options={'ordering': ['tree_s... | Python | 0.000001 | |
226c2f36b9cc8257ce99bd15648be4aba2ccb606 | Move utility functions for checking passported benefits into separate module | cla_public/apps/checker/utils.py | cla_public/apps/checker/utils.py | from cla_public.apps.checker.constants import PASSPORTED_BENEFITS, \
NASS_BENEFITS
def passported(benefits):
return bool(set(benefits).intersection(PASSPORTED_BENEFITS))
def nass(benefits):
return bool(set(benefits).intersection(NASS_BENEFITS))
| Python | 0 | |
6185e7bbc12c3bc9aba1efcfd53275cc109f2e91 | Add a snippet. | python/pyqt/pyqt5/widget_QPainter_draw_polygon.py | python/pyqt/pyqt5/widget_QPainter_draw_polygon.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# See https://www.youtube.com/watch?v=96FBrNR3XOY
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QLabel, QVBoxLayout
from PyQt5.QtGui import QPainter, QBrush, QColor, QPen, QPolygon
from PyQt5.QtCore import Qt, QPoint
class MyPaintWidget(QWi... | Python | 0.000002 | |
d56b94ef5acaafcaf11ebcb4ccb5b61390448974 | Update loading to use results.AddValue(...) | tools/perf/metrics/loading.py | tools/perf/metrics/loading.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from metrics import Metric
from telemetry.value import scalar
class LoadingMetric(Metric):
"""A metric for page loading time based entirely on window.perf... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from metrics import Metric
class LoadingMetric(Metric):
"""A metric for page loading time based entirely on window.performance"""
def Start(self, page,... | Python | 0.000001 |
84009965977b9b0508ae5ec50b28acd0c2828ae2 | Add untested script to download fasta files from ncbi with the GI | python/download_fastas_ncbi.py | python/download_fastas_ncbi.py | #!/usr/bin/env python
"""
Download fastas from a list of gi identifiers of the form
gi|xxxx| from a specified NCBI database
Author: Mauricio Barrientos-Somarribas
Email: mauricio.barrientos@ki.se
Copyright 2014 Mauricio Barrientos-Somarribas
Licensed under the Apache License, Version 2.0 (the "License");
you may n... | Python | 0 | |
7d917f7cbf6f00eec93d97adcdb545ae55c5b345 | Add core actions file | opps/core/actions.py | opps/core/actions.py | # coding: utf-8
import csv
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
def export_to_csv(modeladmin, request, queryset):
"""Exporting queryset results and filter into CSV"""
# limit only staff and super_user accounts
if re... | Python | 0.000001 | |
65245e2ef91952f3d9383f520f8e875b8a2a2648 | add translate type | modularodm/fields/BooleanField.py | modularodm/fields/BooleanField.py | from . import Field
from ..validators import validate_boolean
class BooleanField(Field):
# default = False
validate = validate_boolean
translate_type = bool
def __init__(self, *args, **kwargs):
super(BooleanField, self).__init__(*args, **kwargs) | from . import Field
from ..validators import validate_boolean
class BooleanField(Field):
# default = False
validate = validate_boolean
def __init__(self, *args, **kwargs):
super(BooleanField, self).__init__(*args, **kwargs) | Python | 0.000017 |
3fb4146b53c88695a9941b591c22362ccd5b211d | Create Flyweight.py | DesignPatterns/Flyweight.py | DesignPatterns/Flyweight.py | '''
Flyweight. A design pattern used solely for efficiency with
large arrays of nearly indentical objects.
A simple world generator
Written in python for simplicity sake.
For more info >> http://gameprogrammingpatterns.com/command.html
'''
from random import *
class World:
def __init__(self, width, height):
sel... | Python | 0 | |
ef2bad889159941b344808cb88179135d3908f19 | Add missing file | GroupedPurchaseOrder/api.py | GroupedPurchaseOrder/api.py | ####################################################################################################
#
# GroupedPurchaseOrder - A Django Application.
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Li... | Python | 0.000006 | |
7b118afcc96edf335d5c259adc3e2065648ace6f | update site URL | conf.py | conf.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
# Data about this site
BLOG_AUTHOR = "chronodekar"
BLOG_TITLE = "Note To Self"
SITE_URL = "http://note2self.abraham-v.com/"
BLOG_EMAIL = "no@email.here"
BLOG_DESCRIPTION = "Snippets of information"
# Multi-lingual settings (Not used - keepin... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
# Data about this site
BLOG_AUTHOR = "chronodekar"
BLOG_TITLE = "Note To Self"
SITE_URL = "https://note2self-abrahamvarricatt.github.io/"
BLOG_EMAIL = "no@email.here"
BLOG_DESCRIPTION = "Snippets of information"
# Multi-lingual settings (Not... | Python | 0 |
b2dd561322f6f277f470eae425028412a209da93 | Add Repository class and module | morenines/repository.py | morenines/repository.py | import os
from morenines import output
from morenines import util
from morenines.index import Index
from morenines.ignores import Ignores
NAMES = {
'repo_dir': '.morenines',
'index': 'index',
'ignore': 'ignore',
}
class Repository(object):
def __init__(self):
self.path = None
self.... | Python | 0 | |
8273d67aaf74f4f05aa9c9fa86f710a937c708d4 | Test that submitting twice works | mysite/profile/tests.py | mysite/profile/tests.py | import django.test
from search.models import Project
import twill
from twill import commands as tc
from twill.shell import TwillCommandLoop
from django.test import TestCase
from django.core.servers.basehttp import AdminMediaHandler
from django.core.handlers.wsgi import WSGIHandler
from StringIO import StringIO
# FIXM... | import django.test
from search.models import Project
import twill
from twill import commands as tc
from twill.shell import TwillCommandLoop
from django.test import TestCase
from django.core.servers.basehttp import AdminMediaHandler
from django.core.handlers.wsgi import WSGIHandler
from StringIO import StringIO
# FIXM... | Python | 0 |
292b3c99fc294f9855bd7eb26b0089a04a5f93b5 | Create match_x_y_repetitions.py | regex/repetitions/python3/match_x_y_repetitions.py | regex/repetitions/python3/match_x_y_repetitions.py | Regex_Pattern = r'^\d{1,2}[a-zA-z]{3,}\.{0,3}$' # Do not delete 'r'.
| Python | 0.000195 | |
f3c8d092b67ad16bdd0937651ef34e3d84b15e2b | Add coverage for composer's send_email function (#2174) | webapp/tests/test_composer.py | webapp/tests/test_composer.py | import mock
from urllib3.response import HTTPResponse
from graphite.util import BytesIO
from .base import TestCase
try:
from django.urls import reverse
except ImportError: # Django < 1.10
from django.core.urlresolvers import reverse
class ComposerTest(TestCase):
@mock.patch('six.moves.http_client.HTTPC... | Python | 0 | |
c39c8955782c3015f30a9ef7f8e8783ac105ae70 | add harvester for dailyssrn: | scrapi/harvesters/dailyssrn.py | scrapi/harvesters/dailyssrn.py | from __future__ import unicode_literals
from dateutil.parser import parse
# from datetime import date, timedelta
import furl
from lxml import etree
from scrapi import requests
# from scrapi import settings
from scrapi.base import XMLHarvester
from scrapi.linter import RawDocument
from scrapi.util import copy_to_unic... | Python | 0 | |
6780fbbb526b999b967376cf03fc816cfbfe1122 | add is_lat_unit_matters.py | scripts/is_lat_unit_matters.py | scripts/is_lat_unit_matters.py | """
is_lat_unit_matters.py
By Wedward Wei
After I explore the data, I found some interesting detail. Like we have differnt types of "LongitudeUnits"
I am wondering if the latitude data could be presented in differnt ways, so we meed more steps before plot.
So I wrote this code to see if the worry is necessary.
"""
... | Python | 0.998823 | |
118627a170e3ba3cf8863b3bb0cdaf9b5e0441ff | Create monte_carlo_sliced_doughnut.py | monte_carlo_sliced_doughnut.py | monte_carlo_sliced_doughnut.py | #center of mass of a sliced doughnut
from random import random
from math import pi,sin,cos,atan
M=100000000 #number of samples
y_samples = 0 #samples which have been in correct y range
x_samples = 0 #samples which have been in correct x range
#do something random
def rand_r():
return random(... | Python | 0.000314 | |
e74f78a663a8467e19d071d8e68ef11689c0b7ec | Add replay.py | perf/tests/replay.py | perf/tests/replay.py | from __future__ import division, print_function, absolute_import
import os
import perf
import tempfile
def get_raw_values(filename, run_id):
bench = perf.Benchmark.load(filename)
run = bench.get_runs()[run_id]
inner_loops = run._get_inner_loops()
raw_values = [value * (loops * inner_loops)
... | Python | 0.000001 | |
e8561caeb3c95633e99f540965d33a67046df3e5 | Add __init__ module for the `msgpack_rpc` subpackage | neovim/msgpack_rpc/__init__.py | neovim/msgpack_rpc/__init__.py | """Msgpack-rpc subpackage.
This package implements a msgpack-rpc client. While it was designed for
handling some Nvim particularities(server->client requests for example), the
code here should work with other msgpack-rpc servers.
"""
from .async_session import AsyncSession
from .event_loop import EventLoop
from .msgpa... | Python | 0.000009 | |
92cb3088d63ff6fc511c01d1d151f1f1857df496 | create smiles tokenizer unit test | deepchem/feat/tests/test_smiles_tokenizer.py | deepchem/feat/tests/test_smiles_tokenizer.py | # Requriments - transformers, tokenizers
from unittest import TestCase
from deepchem.feat.smiles_tokenizer import SmilesTokenizer
from transformers import RobertaForMaskedLM
class TestSmilesTokenizer(TestCase):
"""Tests the SmilesTokenizer to load the USPTO vocab file and a ChemBERTa Masked LM model with pre-train... | Python | 0 | |
97d455da87d3175c1d5cf2ce3091f26184cf4a10 | Add heos discoverable (#250) | netdisco/discoverables/heos.py | netdisco/discoverables/heos.py | """Discover Heos devices."""
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
"""Add support for discovering DLNA services."""
def get_entries(self):
"""Get all the HEOS devices."""
return self.find_by_st("urn:schemas-denon-com:device:ACT-Denon:1")
| Python | 0 | |
7e02831897baae9206fd2c0d53fc1c313c780074 | Test case fixed | erpnext/accounts/doctype/payment_request/test_payment_request.py | erpnext/accounts/doctype/payment_request/test_payment_request.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.accounts.doctype.payment_request.payment_re... | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.accounts.doctype.payment_request.payment_re... | Python | 0.000001 |
b90e3b0bce680154d7fea8ed071f740db963c402 | fix bug 1458641: fix reports-clean crontabber app | alembic/versions/e70541df7ed7_bug_1458641_fix_reports_clean.py | alembic/versions/e70541df7ed7_bug_1458641_fix_reports_clean.py | """bug 1458641 fix reports clean crontabber app
Revision ID: e70541df7ed7
Revises: 3474e98b321f
Create Date: 2018-05-02 18:20:19.064954
"""
from alembic import op
from socorro.lib.migrations import load_stored_proc
# revision identifiers, used by Alembic.
revision = 'e70541df7ed7'
down_revision = '3474e98b321f'
... | Python | 0 | |
7573a76a05e5c282cdad74b542d191dd8c90d8ab | Add OvfTransportTestCase.py | py/tests/OvfTransportTestCase.py | py/tests/OvfTransportTestCase.py | #!/usr/bin/python
# vi: ts=4 expandtab syntax=python
##############################################################################
# Copyright (c) 2008 IBM Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which acco... | Python | 0 | |
307816d3b6cb5e57f50f80e10eccd0a701c698a9 | Fix syntax errors. | pymatgen/io/abinitio/__init__.py | pymatgen/io/abinitio/__init__.py | from .eos import *
from .pseudos import *
from .netcdf import *
from .events import *
from .tasks import *
from .workflows import *
from .calculations import *
| from .calculations import *
from .eos import *
from .pseudos import *
from .netcdf import *
from .events import *
from .task import *
from .workflow import *
| Python | 0.000017 |
d4e6f44c5257afd02883bd739cf6b3953e398857 | Create auth.py | photonix/photos/auth.py | photonix/photos/auth.py | import os
from django.contrib.auth import get_library_model
import graphene
from graphene_django.types import DjangoObjectType
import graphql_jwt
Library = get_library_model()
class Mutation(graphene.ObjectType):
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
verify_token = graphql_jwt.Verify.Field()
... | Python | 0.000001 | |
fca1765fa57dfe047b74594883048ee2a8f473dc | Create cluster_scoped_custom_object.py | examples/cluster_scoped_custom_object.py | examples/cluster_scoped_custom_object.py | # Copyright 2019 The Kubernetes 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 ... | Python | 0.000002 | |
bda8b764dca26d9dae2d81da630b5e1328a9aa51 | implement simple python helper for ubf and jsf | priv/python/pyubf.py | priv/python/pyubf.py |
##
## $Id: pyubf.py 132283 2009-04-15 14:54:16Z norton $
##
##
## UBF primitives:
##
## integer, float, atom, string, binary, tuple, record, list, term, void
##
def Integer(value):
assert isinstance(value, int) or isinstance(value, long)
return value
def Float(value):
assert isinstance(value, float)
... | Python | 0.000001 | |
ed05755f1f5213cdd95203f51d0097bfbd91e6e1 | Create FindtheDifference_BitandHash.py | leetcode/389-Find-the-Difference/FindtheDifference_BitandHash.py | leetcode/389-Find-the-Difference/FindtheDifference_BitandHash.py | class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
chrs = {}
res = 0
for w in t:
if w not in chrs:
chrs[w] = 1 << (ord(w) - 97)
res += chrs[w]
for w i... | Python | 0.000001 | |
fddcad6de86d8d1dbd37c549b0d4258260c13a3a | Read in sample text file 'proteinGroups.txt' | proteinGroups.py | proteinGroups.py | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 8 20:48:41 2015
@author: student
"""
import pandas as pd
#import numpy as np
# read in file
df = pd.read_table('/Users/student/Desktop/pubs/Sample text files/proteinGroups.txt', index_col=0)
#print df.dtypes
print df['Intensity'] | Python | 0.000001 | |
558d45ed0b9c3d375daa81383125e0c4664df7af | Add adwaita-icon-theme | packages/adwaita-icon-theme.py | packages/adwaita-icon-theme.py | GnomeXzPackage ('adwaita-icon-theme', version_major = '3.16', version_minor = '2.1')
| Python | 0 | |
7a068ebb9a50e7c1c77cada56b96586cb322066c | Add collect tests. | test/test_collect.py | test/test_collect.py | # -*- coding: utf-8 -*-
import os
import mock
import unittest
from rgc.rules import Rule, namehasprefix, namehassuffix
from rgc import collect
class TestCollect(unittest.TestCase):
def setUp(self):
os.environ['user'] = 'john'
os.environ['key'] = '12345abcd'
def test_dryrun_no_rule_true_co... | Python | 0 | |
af2a0a851be91931f96a7e9d44a1e8c460d70918 | Migrate creation date to new casebooks | web/main/migrations/0052_migrate_casebook_dates.py | web/main/migrations/0052_migrate_casebook_dates.py | # Generated by Django 2.2.10 on 2020-04-14 11:38
from django.db import migrations
from main.models import Casebook
def copy_old_dates(app, schema):
update_cbs = []
for casebook in Casebook.objects.select_related('old_casebook').all():
if casebook.old_casebook:
casebook.created_at = caseboo... | Python | 0.000002 | |
7e53ec5de1d094eafa6a0bba6efcdaf845d5a7b8 | Create 0007.py | pylyria/0007/0007.py | pylyria/0007/0007.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
# Copyright By PyLyria
# CreateTime: 2016-03-04 19:36:40
import os
def get_path(root = os.curdir):
root += os.sep
for path, dirs, files in os.walk(root):
for file_name in files:
yield path, file_name
def get_lines(file_name):... | Python | 0.00013 | |
0b4c873ad2d0923e88fbee5b52435ff1ee68d03c | Create PedidoVer.py | backend/Models/Grau/PedidoVer.py | backend/Models/Grau/PedidoVer.py | from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoVer(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoVer, self).__init__(variaveis_do_ambiente)
try:
self.id = self.corpo['id']
except:
raise ErroNoHTTP(400)
def getId(self):
return self.id
| Python | 0 | |
d72f6c0d989c3f40d460b1ce5d45b7ebf27ec295 | create tests for kornia | tests/test_kornia.py | tests/test_kornia.py | import unittest
import cv2
import torch
import kornia
class TestOpenCV(unittest.TestCase):
def test_imread_opencv(self):
img = cv2.imread('/input/tests/data/dot.png')
img_t = kornia.image_to_tensor(img)
self.assertEqual(img.shape, (1, 1, 3))
self.assertEqual(img_t.shape, (3, 1, 1)... | Python | 0 | |
e3d0681cf2e449b06abebabb7e8726079997eb01 | Add reflex game | reflex/reflex.py | reflex/reflex.py | from microbit import *
import random
score = 0
pixel = None
fade_step = 300
clicked = False
MAX_PAUSE = 3000
def get_rand_coord(limit=4):
return random.randint(0, limit)
def get_rand_side():
return random.choice([-1, 1])
def handle_correct_click(i):
global score, clicked
clicked = True
score ... | Python | 0.000021 | |
998e7ac87ef6e96bb5d421860683f87e8b373428 | Create view.py | blobstore-python/src/app/view.py | blobstore-python/src/app/view.py | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.