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
88ec4243ff78fe511331461b7563bd49f7124fe2
Add tuple.
tuple/tuple.py
tuple/tuple.py
#!/usr/local/bin/python x=(42,) print x y=3*(3,) print y z=tuple("hello") i=1,2,3 print i[2] print i[0:2]
Python
0.000014
24788b106b9cdd70e7240dc3eccac82fba290c85
Add test for yaml enviroment
tests/util/test_yaml.py
tests/util/test_yaml.py
"""Test Home Assistant yaml loader.""" import io import unittest import os from homeassistant.util import yaml class TestYaml(unittest.TestCase): """Test util.yaml loader.""" def test_simple_list(self): """Test simple list.""" conf = "config:\n - simple\n - list" with io.StringIO(c...
"""Test Home Assistant yaml loader.""" import io import unittest from homeassistant.util import yaml class TestYaml(unittest.TestCase): """Test util.yaml loader.""" def test_simple_list(self): """Test simple list.""" conf = "config:\n - simple\n - list" with io.StringIO(conf) as f:...
Python
0
2b0a96791ad43ef1f27b610233dd34027cf83c75
Create currency-style.py
CiO/currency-style.py
CiO/currency-style.py
import re def checkio(text): numbers = re.findall('(?<=\$)[^ ]*\d', text) for old in numbers: new = old.replace('.', ',') if ',' in new and len(new.split(',')[-1]) == 2: new = '.'.join(new.rsplit(',', 1)) text = text.replace(old, new) return text
Python
0.000003
a46f960e811123a137e4e5fe4350f6a850e9b33e
Create average-of-levels-in-binary-tree.py
Python/average-of-levels-in-binary-tree.py
Python/average-of-levels-in-binary-tree.py
# Time: O(n) # Space: O(h) # Given a non-empty binary tree, # return the average value of the nodes on each level in the form of an array. # # Example 1: # Input: # 3 # / \ # 9 20 # / \ # 15 7 # Output: [3, 14.5, 11] # Explanation: # The average value of nodes on level 0 is 3, # on level 1 is 14.5...
Python
0.004195
2131eb1da8b221bfbce08bc9cac30123f08460ca
Add cron module to contrib
kitnirc/contrib/cron.py
kitnirc/contrib/cron.py
import datetime import logging import random import threading import time from kitnirc.modular import Module _log = logging.getLogger(__name__) class Cron(object): """An individual cron entry.""" def __init__(self, event, seconds, minutes, hours): self.event = event self.seconds = self.par...
Python
0.000001
ee076055f11638b8711658972dda8c4d4b40f666
Enforce max length on project name (#3982)
src/sentry/web/forms/add_project.py
src/sentry/web/forms/add_project.py
from __future__ import absolute_import from django import forms from django.utils.translation import ugettext_lazy as _ from sentry.models import AuditLogEntry, AuditLogEntryEvent, Project from sentry.signals import project_created from sentry.utils.samples import create_sample_event BLANK_CHOICE = [("", "")] cla...
from __future__ import absolute_import from django import forms from django.utils.translation import ugettext_lazy as _ from sentry.models import AuditLogEntry, AuditLogEntryEvent, Project from sentry.signals import project_created from sentry.utils.samples import create_sample_event BLANK_CHOICE = [("", "")] cla...
Python
0
96f224a6b80720a88fefc8530aea113f975ef110
Add new layout window command
new_layout.py
new_layout.py
import sublime, sublime_plugin class NewLayoutCommand(sublime_plugin.TextCommand): def run(self, edit, **args): self.view.window().run_command("set_layout", args) self.view.window().run_command("focus_group", { "group": 0 }) self.view.window().run_command("move_to_group", { "group": 1 } )
Python
0
62ff128888bce33cf87e083a921ddac65a2f1879
Add regression test for #3951
spacy/tests/regression/test_issue3951.py
spacy/tests/regression/test_issue3951.py
# coding: utf8 from __future__ import unicode_literals import pytest from spacy.matcher import Matcher from spacy.tokens import Doc @pytest.mark.xfail def test_issue3951(en_vocab): """Test that combinations of optional rules are matched correctly.""" matcher = Matcher(en_vocab) pattern = [ {"LOWE...
Python
0.000001
bec4e467d3d00d8195e4abaf95f3043c6f5e2b95
Set up ChaNGa command in velocity calc to use MPI
calc_velocity_mpi.py
calc_velocity_mpi.py
# -*- coding: utf-8 -*- """ Same as calc_velocity.py, but calls mpi with changa to allow many nodes Created on Wed Apr 9 15:39:28 2014 @author: ibackus """ import numpy as np import pynbody SimArray = pynbody.array.SimArray import isaac import subprocess import os import glob import time def v_xy(f, param, chan...
Python
0
8436253648c67205de23db8797c9fcc7c2172b3e
add the actual test
test/test_slice.py
test/test_slice.py
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 ''' Tests related to slices. ''' import unittest import common class SliceTestCase:#(common.TestCase): ''' test that slices work. ''' def test_slice(self): self.check('test_slice') if __name__ == '__main__': unittest.main()
Python
0.001366
8ca0e88b7df79461f401e7c46c822f16223ddd0b
Create solution.py
hackerrank/algorithms/implementation/easy/between_two_sets/py/solution.py
hackerrank/algorithms/implementation/easy/between_two_sets/py/solution.py
#!/bin/python3 import sys # Hackerrank Python3 environment does not provide math.gcd # as of the time of writing. We define it ourselves. def gcd(n, m): while m > 0: n, m = m, n % m return n def lcm(x, y): return (x * y) // gcd(x, y) def between(s1, s2): import functools cd = functools....
Python
0.000018
325465d18e963400b427f259547d4292a47368c9
Use Django nose for tests.
oneflow/settings/snippets/common_development.py
oneflow/settings/snippets/common_development.py
# # Include your development machines hostnames here. # # NOTE: this is not strictly needed, as Django doesn't enforce # the check if DEBUG==True. But Just in case you wanted to disable # it temporarily, this could be a good thing to have your hostname # here. # # If you connect via http://localhost:8000/, everything i...
# # Include your development machines hostnames here. # # NOTE: this is not strictly needed, as Django doesn't enforce # the check if DEBUG==True. But Just in case you wanted to disable # it temporarily, this could be a good thing to have your hostname # here. # # If you connect via http://localhost:8000/, everything i...
Python
0
1f9c24f54047b616f1162500a053031adaf7b7d3
add basic uci implementation
testWrt/lib/uci.py
testWrt/lib/uci.py
""" uci parsing """ import logging import re class UciError(RuntimeError): pass class UciWrongTypeError(UciError): pass class UciNotFoundError(UciError): pass class UciParseError(UciError): pass class Config(object): def __init__(self, uci_type, name=None): self.uci_type = uci_type ...
Python
0.000001
df69df55cdf51da60e62226c16b30c76e2836c20
Add initial test suite
test_fiscalyear.py
test_fiscalyear.py
import fiscalyear import pytest class TestFiscalYear: @pytest.fixture(scope='class') def a(self): return fiscalyear.FiscalYear(2016) @pytest.fixture(scope='class') def b(self): return fiscalyear.FiscalYear(2017) @pytest.fixture(scope='class') def c(self): return fisc...
Python
0
3e9289f142efd0769beff97cddfcbcbede40f85a
add a half written Qkkk
pacfiles/Qkkk.py
pacfiles/Qkkk.py
#!/usr/bin/env python3 import pyalpm import pycman import tarfile import sys, os, os.path pacmanconf = pycman.config.init_with_config("/etc/pacman.conf") rootdir = pacmanconf.rootdir def local_database(): handle = pacmanconf localdb = handle.get_localdb() packages = localdb.pkgcache syncdbs = handle.get_syncdbs()...
Python
0.999936
701acbccc764101e00eef35dfff81dda5c5437a3
Create pages_in_dict.py
pages_in_dict.py
pages_in_dict.py
import codecs import os import re letters = [] no_letters = [] number_of = {} pages = os.listdir(".") for page in pages: if page.endswith('.html'): if page[0:3] not in letters: letters.append(page[0:3]) f = codecs.open(page, 'r', 'utf-8-sig') text = f.read() #n = re.f...
Python
0.000001
39bf0b2ab6f89cfe3450102699a5bbeaf235011a
Create 4.py
4.py
4.py
#!/usr/bin/env python MAX_TRI = 999999L triangles = [] def next_pos(mn, pos): if mn > triangles[MAX_TRI - 1]: return -1 else: maxv = MAX_TRI - 1 minv = 0 mid = minv + (maxv - minv) / 2 while triangles[mid] != mn and minv < maxv: if triangles[mid] < mn : minv = mid + 1 else...
Python
0.000001
ac357bc1ccefe55e25bb34021772301726ceec0e
Complete P4
Quiz/Problem4_defMyLog.py
Quiz/Problem4_defMyLog.py
def myLog(x, b): ''' x: a positive integer b: a positive integer; b >= 2 returns: log_b(x), or, the logarithm of x relative to a base b. ''' if x < b: return 0 else: return 1 + myLog(x / b, b)
Python
0.000001
e6ea8ad5b94b51d8b07dea238f2545eacba3abfe
Create Elentirmo_GUI_V0.1.py
Elentirmo_GUI_V0.1.py
Elentirmo_GUI_V0.1.py
#!/usr/bin/python from Tkinter import * root = Tk() root.title("Elentirmo Observatory Controller v0.1") dust_cover_text = StringVar() dust_cover_text.set('Cover Closed') flat_box_text = StringVar() flat_box_text.set('Flat Box Off') def dust_cover_open(): print "Opening" ## Open a serial connection with Ardu...
Python
0
51feabbc27821c5acb7f0ceb932d19c0d79f16d1
test ssl version check functions as expected in python 2.6
tests/test_help.py
tests/test_help.py
# -*- encoding: utf-8 import sys import pytest from requests.help import info @pytest.mark.skipif(sys.version_info[:2] != (2,6), reason="Only run on Python 2.6") def test_system_ssl_py26(): """OPENSSL_VERSION_NUMBER isn't provided in Python 2.6, verify we don't blow up in this case. """ assert info...
Python
0
ca27dc71bd814fe42282521edd97ae444d6c714b
Add test of PlotData
tests/test_plot.py
tests/test_plot.py
from maflib.plot import * import unittest class TestPlotData(unittest.TestCase): inputs = [ { 'x': 1, 'y': 2, 'z': 50, 'k': 'p' }, { 'x': 5, 'y': 3, 'z': 25, 'k': 'q' }, { 'x': 3, 'y': 5, 'z': 10, 'k': 'q' }, { 'x': 7, 'y': 4, 'z': 85, 'k': 'p' } ] def test_empty_inputs(sel...
Python
0
63804c534f23ffbe16ff539087048d99f9fcaf17
Implement test_encoder_decoder
test_encoder_decoder.py
test_encoder_decoder.py
#! /usr/bin/env python # coding:utf-8 if __name__ == "__main__": import sys import argparse from seq2seq import decode from util import load_dictionary import configparser import os from chainer import serializers # GPU config parser = argparse.ArgumentParser() parser.add_arg...
Python
0.003162
8eeb4c2db613c1354c38696ac6691cf79f66a383
Add spider for Brookdale Senior Living
locations/spiders/brookdale.py
locations/spiders/brookdale.py
# -*- coding: utf-8 -*- import scrapy import json from locations.items import GeojsonPointItem URL = 'https://www.brookdale.com/bin/brookdale/community-search?care_type_category=resident&loc=&finrpt=&state=' US_STATES = ( "AL", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "ID", "IL", "IN", "IA", "KS"...
Python
0
47893c708f3b63f79a01d5ee927f4c7d3f6dff27
Create script to delete untitled and unpublished projects
akvo/rsr/management/commands/delete_untitled_and_unpublished_projects.py
akvo/rsr/management/commands/delete_untitled_and_unpublished_projects.py
# -*- 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 >. import datetime from tablib imp...
Python
0
03c837b0da9d7f7a6c6c54286631e9a403da3e60
Add network scan python script - Closes #7
backend/net_scan.py
backend/net_scan.py
#!/usr/bin/python import sys, getopt, nmap def usage(): print 'sword_nmap.py -t <target> -p <port range>' def main(argv): target='' port_range='' try: opts, args = getopt.getopt(argv,'ht:p:',['target=','ports=']) except getopt.GetoptError: usage() sys.exit(2) for opt, ...
Python
0
24e4ed9f26f9803d54d37202d0d71e8f47b18aa3
Add swix create functionality and make verifyswix test use it
swixtools/create.py
swixtools/create.py
#!/usr/bin/env python3 # Copyright ( c ) 2021 Arista Networks, Inc. # Use of this source code is governed by the Apache License 2.0 # that can be found in the LICENSE file. ''' This module is responsible for packaging a SWIX file. ''' import argparse import hashlib import os import shutil import subprocess import sys...
Python
0
4699c1c301f1cb99f6c9e616b31769c01bc291d5
change datafiles in v1.* to make it work in v2.*
v1_to_v2.py
v1_to_v2.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import optparse, pickle, exam def main(): opt = optparse.OptionParser() (options, args) = opt.parse_args() for i in args: with open(i,'rb') as f: data = pickle.load(f) data = exam.QuestForm(data) with open('v3.'.join(i.split('.')),'wb...
Python
0.000001
0403d6f78189be3f3b22f068dad1db0c53687ef7
Add ptch module and base PatchFile class. This class can unpack RLE-compressed patchfiles.
ptch/__init__.py
ptch/__init__.py
# -*- coding: utf-8 -*- """ PTCH files are a container format for Blizzard patch files. They begin with a 72 byte header containing some metadata, immediately followed by a RLE-packed BSDIFF40. The original BSDIFF40 format is compressed with bzip2 instead of RLE. """ #from hashlib import md5 from struct import unpack ...
Python
0
8533c93505a733980406ce655372c7742dfcfdfc
Add update policy that allows for in place upgrade of ES cluster (#1537)
troposphere/policies.py
troposphere/policies.py
from . import AWSProperty, AWSAttribute, validate_pausetime from .validators import positive_integer, integer, boolean class AutoScalingRollingUpdate(AWSProperty): props = { 'MaxBatchSize': (positive_integer, False), 'MinInstancesInService': (integer, False), 'MinSuccessfulInstancesPercent...
from . import AWSProperty, AWSAttribute, validate_pausetime from .validators import positive_integer, integer, boolean class AutoScalingRollingUpdate(AWSProperty): props = { 'MaxBatchSize': (positive_integer, False), 'MinInstancesInService': (integer, False), 'MinSuccessfulInstancesPercent...
Python
0
2a6527c60d09c0cbb2f1902b57ae02ddade213eb
Create communicati.py
libs/communicati.py
libs/communicati.py
# communications.py # Mónica Milán (@mncmilan) # mncmilan@gmail.com # http://steelhummingbird.blogspot.com.es/ # Library that contains all necessary methods in order to enable communications between PC and eZ430-Chronos. import serial s = serial.Serial('COM4', baudrate=115200,timeout=None) # open serial port clas...
Python
0.000001
e5293f7e33740f210ab58c3c05db18829db1474d
add docstrings [skip ci]
mailthon/helpers.py
mailthon/helpers.py
""" mailthon.helpers ~~~~~~~~~~~~~~~~ Implements various helper functions/utilities. :copyright: (c) 2015 by Eeo Jun :license: MIT, see LICENSE for details. """ import sys import mimetypes from collections import MutableMapping from email.utils import formataddr if sys.version_info[0] == 3: ...
""" mailthon.helpers ~~~~~~~~~~~~~~~~ Implements various helper functions/utilities. :copyright: (c) 2015 by Eeo Jun :license: MIT, see LICENSE for details. """ import sys import mimetypes from collections import MutableMapping from email.utils import formataddr if sys.version_info[0] == 3: ...
Python
0
ea652c892219d1ed08a0453a3b2ede3efb452e23
Create __init__.py
ui_techmenu/__init__.py
ui_techmenu/__init__.py
# -*- coding: utf-8 -*- ###################################################################### # # ui_techmenu - Explode Technical Menu for Odoo # Copyright (C) 2012 - TODAY, Ursa Information Systems (<http://ursainfosystems.com>) # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>) # contact@ursainfosystems.co...
Python
0.000429
841e8fe236eab35b803cb9d8bec201306ce4642e
Add script to generate big RUM_* files
util/repeat_rum_file.py
util/repeat_rum_file.py
from rum_mapping_stats import aln_iter import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('--times', type=int) parser.add_argument('--max-seq', type=int) parser.add_argument('rum_file', type=file) args = parser.parse_args() alns = list(aln_iter(args.rum_file)) for t in range(args.tim...
Python
0
3ab98baaf2b81ffa1afef808f27608f06bc946d3
Create commands.py
web/commands.py
web/commands.py
# # Commands for RPC interface # from twisted.protocols.amp import AMP, Boolean, Integer, String, Float, Command class Sum(Command): arguments = [('a', Integer()), ('b', Integer())] response = [('status', Integer())] class HeartbeatCmd(Command): arguments = [('enabled', Boolean())] r...
Python
0.000011
b5f8299cbe539cf2a01988ca25e0c7638400bc8c
Create stuff.py
bottomline/stuff.py
bottomline/stuff.py
# Testing print 'heck yeah!'
Python
0.000001
5777877d1ed71ed21f67e096b08ad495ff844ed8
add testexample/simpleTestwithPython.py
testexample/simpleTestwithPython.py
testexample/simpleTestwithPython.py
import os import re import json import sys import getopt import argparse from docopt import docopt from urllib2 import urlopen, Request import urllib import urllib2 import requests url_phenotypes = 'http://localhost:9000/api/phenotypes' url_genotypes = 'http://localhost:9000/api/genotypes' token = 'Bearer eyJhbGciOiJI...
Python
0.000001
606020fbb7c3e608c8eab19ca143919003ea4f7d
add some first tests.
test_triptan.py
test_triptan.py
import os from unittest import TestCase from tempfile import TemporaryDirectory from triptan.core import Triptan class TriptanInitializationTest(TestCase): """ Asserts that triptan can setup the necessary data correctly. """ def test_init_file_structure(self): """ Assert the ...
Python
0
67219e743f224cc82b6d17b167c9c9a16540d5e7
Add a test that we are including proper license files for all requirements.
awx/main/tests/functional/test_licenses.py
awx/main/tests/functional/test_licenses.py
import glob import json import os from django.conf import settings from pip._internal.req import parse_requirements def test_python_and_js_licenses(): def index_licenses(path): # Check for GPL (forbidden) and LGPL (need to ship source) # This is not meant to be an exhaustive check. def ...
Python
0
1803ec42e2eaad689dd51d3afb0b943e411f10d5
Add breath first search algorithm
breath_first_search/breath_first_search.py
breath_first_search/breath_first_search.py
#!/usr/bin/env python from collections import deque class BreathFirstSearchGame(object): def __init__(self): # The node index are from 0 to 7, such as 0, 1, 2, 3, 4 self.node_number = 8 # The edges to connect each node self.edges = [(0, 1), (0, 3), (1, 2), (1, 5), (2, 7), (3, 4), (3, 6), ...
Python
0.000049
c98eff8545c90563246a53994fe8f65faaf76b0a
Add fetch recipe for the open source infra repo.
recipes/infra.py
recipes/infra.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232 cla...
Python
0.00002
5b3b5bb145eea8a71c81a383d2bdac7ecf13f98e
Add sys module tests
tests/integration/modules/sysmod.py
tests/integration/modules/sysmod.py
# Import python libs import os # Import salt libs import integration class SysModuleTest(integration.ModuleCase): ''' Validate the sys module ''' def test_list_functions(self): ''' sys.list_functions ''' funcs = self.run_function('sys.list_functions') self.asser...
Python
0.000001
7d800a0fc2d94cad14e825faa27e1f5b2d2cbed8
Create new package (#6648)
var/spack/repos/builtin/packages/breseq/package.py
var/spack/repos/builtin/packages/breseq/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
19cf7a2833ba2ffcff46bd4543ed93fd80c1d8ea
fix trying to run configure on an already configured directory fixes #2959 (#2961)
var/spack/repos/builtin/packages/libmng/package.py
var/spack/repos/builtin/packages/libmng/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
94f2ea927d9e218f2b5065456275d407164ddf0a
Add anidub.com tracker support
updatorr/tracker_handlers/handler_anidub.py
updatorr/tracker_handlers/handler_anidub.py
from updatorr.handler_base import BaseTrackerHandler from updatorr.utils import register_tracker_handler import urllib2 class AnidubHandler(BaseTrackerHandler): """This class implements .torrent files downloads for http://tr.anidub.com tracker.""" logged_in = False # Stores a number of login attempts...
Python
0
24e3064002656ae649e8ddb931ee2370037812a0
image.regression was missing
lib/image/regression.py
lib/image/regression.py
import copy, os, csv, string, fpformat import numpy as N import enthought.traits as traits import neuroimaging.image as image from neuroimaging.reference import grid from neuroimaging.statistics.regression import RegressionOutput from neuroimaging.statistics import utils class ImageRegressionOutput(RegressionOutput):...
Python
0.999999
b02ec9a16689bf2814e85f0edb01c7f4a5926214
Add pre-migration script for account module.
addons/account/migrations/8.0.1.1/pre-migration.py
addons/account/migrations/8.0.1.1/pre-migration.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Akretion (http://www.akretion.com/) # @author: Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you can redistribute it and/or modify # it under the...
Python
0
07841312d062fd0dd48baa0d3bc0d92989e05841
add script mp3-file-renamer.py
mp3-file-renamer.py
mp3-file-renamer.py
#!/usr/bin/python #Python script to rename mp3 files according to the format #"Track-number Track-name.mp3", for example: 02 Self Control.mp3 #Note: Tracks must have valid ID3 data for this to work - python-mutagen is required. #By Charles Bos import os import sys from mutagen.id3 import ID3, ID3NoHeaderError def usa...
Python
0.000001
cc76c00efa919f8532e21365606f38431093cc22
Write inversion counting algorithm
count_inversions.py
count_inversions.py
def count_inversions(list, inversion_count = 0): """ recursively counts inversions of halved lists where inversions are instances where a larger el occurs before a smaller el merges the halved lists and increments the inversion count at each level :param list list: list containing comparable elements :para...
Python
0.0007
3331a9a6b8ada075aaefef021a8ad24a49995931
Add test for prepare_instance_slug #92
derrida/books/tests/test_search_indexes.py
derrida/books/tests/test_search_indexes.py
from unittest.mock import patch from django.test import TestCase from derrida.books.models import Reference, Instance from derrida.books.search_indexes import ReferenceIndex class TestReferenceIndex(TestCase): fixtures = ['test_references.json'] def setUp(self): '''None of the Instacefixtures have sl...
Python
0
451799f126afcdda70138dc348b9e1f276b1f86f
Add setting file for later use.
ox_herd/settings.py
ox_herd/settings.py
"""Module to represent basic settings for ox_herd package. """
Python
0
ec5136b86cce92a49cf2eea852f1d8f2d7110cf0
Create element_search.py
09-revisao/practice_python/element_search.py
09-revisao/practice_python/element_search.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Exercise 20: Element Search Write a function that takes an ordered list of numbers (a list where the elements are in order from smallest to largest) and another number. The function decides whether or not the given number is inside the list and returns (then prints) an...
Python
0.000002
cc06421fb4250640b2c9eef75480a3627a339473
Add a script to normalize Gerrit ACLs
tools/normalize_acl.py
tools/normalize_acl.py
#!/usr/bin/env python # Usage: normalize_acl.py acl.config [transformation [transformation [...]]] # # Transformations: # 0 - dry run (default, print to stdout rather than modifying file in place) # 1 - strip/condense whitespace and sort (implied by any other transformation) # 2 - get rid of unneeded create on refs/ta...
Python
0.000003
7060b82030d719cdcbdcecdb5eb7d34b405aa805
Make the migration for previous commit
platforms/migrations/0003_auto_20150718_0050.py
platforms/migrations/0003_auto_20150718_0050.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('platforms', '0002_auto_20150718_0042'), ] operations = [ migrations.AlterField( model_na...
Python
0.000013
3b42e348987294602440c3c1d4aa4361afcdc298
Add problem 14
problem_14.py
problem_14.py
from problem_12 import new_encryption_oracle, find_blocksize import random from string import printable RANDOM_PREFIX = ''.join(random.choice(printable) for _ in range(random.randrange(0, 20))) # print len(RANDOM_PREFIX) def oracle(adversary_input): return new_encryption_oracle(RANDOM_PREFIX + adversary_input) ...
Python
0
49b1de4a68133e618723f96f2dc922b311bdd982
Add Script to encode raw RGB565
util/encode_raw.py
util/encode_raw.py
#!/usr/bin/env python # Converts raw RGB565 video to MP4/AVI from sys import argv, exit from array import array from subprocess import call buf=None TMP_FILE = "/tmp/video.raw" if (len(argv) != 4): print("Usage: encode_raw input.raw output.avi fps") exit(1) with open(argv[1], "rb") as f: buf = array("H"...
Python
0
74354263acb3399295e7fde18d6aeed4b7bb7397
Fix maybe all flake8 errors. Add first test.
what_transcode/tests.py
what_transcode/tests.py
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase from what_transcode.utils import get_mp3_ids class UtilsTests(TestCase): def test_get_mp3_ids(se...
Python
0
5dba86b3a68c27a01eb143a6dfdb35d01c3c99e8
add app_test
turbo/test/app_test.py
turbo/test/app_test.py
from __future__ import absolute_import, division, print_function, with_statement import os import signal import sys import unittest import random import time import threading import logging import requests import multiprocessing from turbo import app from turbo.conf import app_config from turbo import register app_c...
Python
0.000003
be0331e64726d659b824187fbc91b54ce0405615
add initial implementation of weighted EM PCA
wpca/test/test_empca.py
wpca/test/test_empca.py
import numpy as np from numpy.testing import assert_allclose from ..empca import orthonormalize, random_orthonormal, pca, empca def norm_sign(X): i_max_abs = np.argmax(abs(X), 0) sgn = np.sign(X[i_max_abs, range(X.shape[1])]) return X * sgn def assert_columns_allclose_upto_sign(A, B, *args, **kwargs): ...
Python
0
7ccfc89a51a76764c36b009dd9b5fc55570e3f56
Add forgot password test
api/radar_api/tests/test_forgot_password.py
api/radar_api/tests/test_forgot_password.py
import json from radar_api.tests.fixtures import get_user from radar.database import db def test_forgot_password(app): user = get_user('admin') client = app.test_client() assert user.reset_password_token is None assert user.reset_password_date is None response = client.post('/forgot-password',...
Python
0.000001
b4bf757a15c404080679335bcce04ba45a7e4eae
Update fix_nonwarehouse_ledger_gl_entries_for_transactions.py
erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py
erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): if not frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock"): return frappe.reload_doctype("A...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): if not frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock"): return frappe.reload_doctype("A...
Python
0.000001
ae52e3e4dc1fc254b7e1c258caa1fe00317bb9a5
Add migrate script.
disqus_converter.py
disqus_converter.py
'''Convert disquls XML comments to YAML.''' import os import copy import pathlib import hashlib import yaml import iso8601 import xmltodict from postsinfo import mapping from rebuild_comments import encrypt COMMENT_DIR = os.environ.get('COMMENT_DIR', './_data/comments') def get_disqus_threads(infile): with open...
Python
0
588d49ef47cb4fa0848e44775a0102a7bd3f492a
add hdfs utils to distributed
distributed/hdfs.py
distributed/hdfs.py
import os from .utils import ignoring with ignoring(ImportError): import snakebite.protobuf.ClientNamenodeProtocol_pb2 as client_proto from snakebite.client import Client def get_locations(filename, name_host, name_port): client = Client(name_host, name_port, use_trash=False) files = list(client.ls(...
Python
0
c8ae682ff98f2c5b5733ae4b299970c820e46630
Add regression test for #636
spacy/tests/regression/test_issue636.py
spacy/tests/regression/test_issue636.py
# coding: utf8 from __future__ import unicode_literals from ...tokens.doc import Doc import pytest @pytest.mark.xfail @pytest.mark.models @pytest.mark.parametrize('text', ["I cant do this."]) def test_issue636(EN, text): """Test that to_bytes and from_bytes don't change the token lemma.""" doc1 = EN(text) ...
Python
0.000001
423707ea25e88b2454a9541eb52f900da87e95b2
allow external backends, specified via ZMQ_BACKEND env
zmq/backend/__init__.py
zmq/backend/__init__.py
"""Import basic exposure of libzmq C API as a backend""" #----------------------------------------------------------------------------- # Copyright (C) 2013 Brian Granger, Min Ragan-Kelley # # This file is part of pyzmq # # Distributed under the terms of the New BSD License. The full license is in # the file COPY...
"""Import basic exposure of libzmq C API as a backend""" #----------------------------------------------------------------------------- # Copyright (C) 2013 Brian Granger, Min Ragan-Kelley # # This file is part of pyzmq # # Distributed under the terms of the New BSD License. The full license is in # the file COPY...
Python
0
6e501f2cbfe6b53eca72389c9a1c98a3c3d098c9
Add redhat official helper
bin/helpers/redhatofficial/redhatoffical.py
bin/helpers/redhatofficial/redhatoffical.py
#!/usr/bin/env python # Copyright 2018, Red Hat # Copyright 2018, Fabien Boucher # # 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...
Python
0.000001
cb9166c4564c4e763e1214355dc76cbe6d466258
Add data migration for section
books/migrations/0009_auto_20141127_1718.py
books/migrations/0009_auto_20141127_1718.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def add_sections(apps, schema_editor): # Don't just use books.models.Section, that could be out of date Section = apps.get_model('books', 'Section') FRONT_MATTER_CHOICES = [ #('db_value', 'hum...
Python
0
161feec0d3764c7cdeebfdc7cd62e5901a89666a
Add initial implementation
runtracker.py
runtracker.py
import cv2 import numpy as np import imutils PI = 3.141592654 AREA_ERROR_THRESH = 0.05 # Error away from the mean area # Color ranges #CALIB_COLOR_MIN = ( 70, 40, 61) #CALIB_COLOR_MAX = (110, 175, 255) CALIB_COLOR_MIN = ( 52, 24, 56) CALIB_COLOR_MAX = ( 98, 169, 178) TRACK_COLOR_MIN = ( 0, 0, 0) TRACK_CO...
Python
0.000001
07825b7f80a12619c847de49f0f2b991faeea7b4
Add a simple handler cookie_wsh.py useful for cookie test
example/cookie_wsh.py
example/cookie_wsh.py
# Copyright 2014 Google Inc. All rights reserved. # # Use of this source code is governed by a BSD-style # license that can be found in the COPYING file or at # https://developers.google.com/open-source/licenses/bsd import urlparse def _add_set_cookie(request, value): request.extra_headers.append(('Set-Cookie',...
Python
0.000004
39019e998da2c1f73f82e0eb446df78ffc95c134
Create safe_steps.py
safe_steps.py
safe_steps.py
import mcpi.minecraft as minecraft import mcpi.block as block mc = minecraft.Minecraft.create() while True: p = mc.player.getTilePos() b = mc.getBlock(p.x, p.y-1, p.z) if b == block.AIR.id or b == block.WATER_FLOWING.id or b==block.WATER_STATIONARY.id: mc.setBlock(pos.x, pos.y-1, pos.z, block.WOOD_PLANKS.id)
Python
0.000459
c78480fc1f566bb6d266705336dbe9cd90d07996
Create 476_number_complement.py
476_number_complement.py
476_number_complement.py
""" https://leetcode.com/problems/number-complement/description/ Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of a 32-bit signed integer. You could assume no leading zero b...
Python
0.998761
0104600fe32b2b676974f29df37d10cc86a7441a
enable CMake build (with HTTP/3) -- take 2
build/fbcode_builder/specs/proxygen_quic.py
build/fbcode_builder/specs/proxygen_quic.py
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import specs.folly as folly import specs.fizz as fizz import specs.mvfst as mvfst import specs.so...
Python
0.000001
37e74416a090342c18cfad87df74dd958400145d
Add 'Others' category.
bulb/migrations/0009_add_others_category.py
bulb/migrations/0009_add_others_category.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def add_categories(apps, schema_editor): Category = apps.get_model('bulb', 'Category') Category.objects.create(code_name="others", name="أخرى") def remove_categories(apps, schema_editor): Category = a...
Python
0.998649
317160665a58a2e0433202e4605710b09a71de9d
add scrub script to remove solution tags, thanks https://gist.github.com/minrk/3836889
scrub_sols.py
scrub_sols.py
#!/usr/bin/env python """ simple example script for scrubping solution code cells from IPython notebooks Usage: `scrub_code.py foo.ipynb [bar.ipynb [...]]` Marked code cells are scrubbed from the notebook """ import io import os import sys from IPython.nbformat.current import read, write def scrub_code_cells(nb): ...
Python
0
3bafceba383125475d5edb895bc9d88b0dfc5042
Add status to Role
project/apps/api/migrations/0093_role_status.py
project/apps/api/migrations/0093_role_status.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-05 23:28 from __future__ import unicode_literals from django.db import migrations import django_fsm class Migration(migrations.Migration): dependencies = [ ('api', '0092_auto_20160305_1514'), ] operations = [ migrations.AddF...
Python
0.000001
4735ee97aa36920e811edc450d8b6e8a09b5caf5
add utility for explode bam
iron/utilities/explode_bam.py
iron/utilities/explode_bam.py
#!/usr/bin/python import sys, argparse from subprocess import Popen, PIPE from SamBasics import SamStream from multiprocessing import cpu_count, Pool def main(): parser = argparse.ArgumentParser(description="Break a bam into evenly sized chunks print the number of chunks",formatter_class=argparse.ArgumentDefaultsHelp...
Python
0.000001
77a031fd34d73047a529fe9e06d7781ba0d4c56d
add basic structure of python ui
models/synthetic/ui/synthetic.py
models/synthetic/ui/synthetic.py
from Tkinter import * # initial root = Tk() root.title("Synthetic Model") label = Label(root, text = 'Synthetic Model', font = (None, 20)) label.pack() m1 = PanedWindow() m1.pack(fill = BOTH, expand = 1) m2 = PanedWindow(m1, orient = VERTICAL) m1.add(m2) m3 = PanedWindow(m1, orient = VERTICAL) m1.add(m3) m4 = Pa...
Python
0.000032
406420f0686cdfbd56090a2f0bf8c623b9216461
Create DQN_Agent_LSTM.py
Agents/DQN_Agent_LSTM.py
Agents/DQN_Agent_LSTM.py
#SC2-pySC2 agent for HallucinIce mini-game #@SoyGema #Thanks to @DavSuCar import numpy as np import sys import random from keras.models import Sequential from keras.layers import Dense, Flatten, Conv2D, Activation, MaxPooling2D, TimeDistributed, LSTM, Reshape from keras.optimizers import Adam, Adamax, Nadam from ker...
Python
0.000001
ebd62eac70d5589b0b7f593009024868f981e658
Add actor with behavior similar to old-style Delay
calvin/actorstore/systemactors/std/ClassicDelay.py
calvin/actorstore/systemactors/std/ClassicDelay.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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 ...
Python
0.000002
a88cf930a5c0e67a7aef93ab5c4eb705ad7aad32
Fix ‘permissions_classes’ typos
kolibri/core/lessons/tests.py
kolibri/core/lessons/tests.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase # Create your tests here.
Python
0.999755
4bbd622921fcef6a07d5d87c0640a9eb4e48cf12
Add nurseryTherm python file
nurseryTherm.py
nurseryTherm.py
#!/usr/bin/python #CamJam Edukit 2 - Sensors # Worksheet 3 - Temperature # Import Libraries import os import glob import time import paho.mqtt.client as paho import json # Initialize the GPIO Pins os.system('modprobe w1-gpio') # Turns on the GPIO module os.system('modprobe w1-therm') # Turns on the Temperature module ...
Python
0.000002
4f921177ae5f8f0dac2b30233c2723cadfffbe45
add a waveform generator
waveform.py
waveform.py
#!/usr/bin/env python """A Waveform or Signal Generator Library for creating audio waveforms.""" import sys import argparse import math import numpy VERSION = "0.1" class Generator(object): def __init__(self, length=1.0, framerate=44100, verbose=False): self.length = length self.framerate = fra...
Python
0
8e067196b44d78f60cdf904eb05ebdaaf27b0c64
Add module for quick diagnostic plots of profiles.
diagnostic_plots.py
diagnostic_plots.py
""" Created on Tue Nov 22 11:12:58 2016 @author: Jens von der Linden """ from __future__ import print_function from __future__ import division from __future__ import absolute_import from future.builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, r...
Python
0
e363aac46c9a5b607c7b32bcc5546c5a2728d750
Add migration which fixes missing message IDs.
climate_data/migrations/0029_auto_20170628_1527.py
climate_data/migrations/0029_auto_20170628_1527.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-28 15:27 from __future__ import unicode_literals from django.db import migrations from datetime import timedelta # noinspection PyUnusedLocal def add_message_id_to_reading(apps, schema_editor): # noinspection PyPep8Naming Reading = apps.get_mod...
Python
0
840bc57e7120ae67e84c1c7bca94cfef34c8d2a8
Copy old script from @erinspace which added identifiers to existing preprints.
scripts/add_missing_identifiers_to_preprints.py
scripts/add_missing_identifiers_to_preprints.py
import sys import time import logging from scripts import utils as script_utils from django.db import transaction from website.app import setup_django from website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers setup_django() logger = logging.getLogger(__name__) def add_identifiers_to_pre...
Python
0
07e94e2bd2630dbff87d785cc5d6e67d78944e3f
add a script to help run salmon on transcriptomes
seqtools/cli/utilities/fastq_to_salmon_quant.py
seqtools/cli/utilities/fastq_to_salmon_quant.py
#!/usr/bin/env python """Take a fastq/fasta and make a transcriptome quantification""" import argparse, sys, os, gzip from shutil import rmtree, copy from multiprocessing import cpu_count, Pool from tempfile import mkdtemp, gettempdir from seqtools.format.fasta import FASTAData from seqtools.format.gpd import GPDStream...
Python
0.000001
c54a09765c409698f058e706a0688e1870f8bc22
Add execution module for RallyDev
salt/modules/rallydev.py
salt/modules/rallydev.py
# -*- coding: utf-8 -*- ''' Support for RallyDev Requires a ``username`` and a ``password`` in ``/etc/salt/minion``: .. code-block: yaml rallydev: username: myuser@example.com password: 123pass ''' # Import python libs from __future__ import absolute_import, print_function import json import logging...
Python
0
3a9ec86e4b996912b1a47abe07c70116be14b3f8
Create hello.py
hello.py
hello.py
print "Hello all"
Python
0.999503
d73b2108358c8aa43509b6def6879fc70b138fb5
add objects
nefi2_main/nefi2/view/test2.py
nefi2_main/nefi2/view/test2.py
from PyQt4 import QtGui, QtCore import sys class Main(QtGui.QMainWindow): def __init__(self, parent = None): super(Main, self).__init__(parent) # main button self.addButton = QtGui.QPushButton('button to add other widgets') self.addButton.clicked.connect(self.addWidget) # ...
Python
0.000006
98bf1c67b95d40888e26068015e4abf1b94d0640
add ddns state module
salt/states/ddns.py
salt/states/ddns.py
''' Dynamic DNS updates. ==================== Ensure a DNS record is present or absent utilizing RFC 2136 type dynamic updates. Requires dnspython module. .. code-block:: yaml webserver: ddns.present: - zone: example.com - ttl: 60 ''' def __virtual__(): return 'ddns' if 'ddns.update' ...
Python
0
4ea54e24948356b039ad961c857e685c30bb0737
Solve task #500
500.py
500.py
class Solution(object): def findWords(self, words): """ :type words: List[str] :rtype: List[str] """ rows = ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'] def inOneRow(word): mask = [0, 0, 0] for i in range(len(rows)): for ch in word: ...
Python
0.999999
ce3eef2c749f7d9f7bcd1d439497121e89e3727b
Add notification
devicehive/notification.py
devicehive/notification.py
from devicehive.api_object import ApiObject class Notification(ApiObject): """Notification class.""" DEVICE_ID_KEY = 'deviceId' ID_KEY = 'id' NOTIFICATION_KEY = 'notification' PARAMETERS_KEY = 'parameters' TIMESTAMP_KEY = 'timestamp' def __init__(self, transport, token, notification): ...
Python
0.000001
f26afa19a06b02c668073785bbf5f248ac8072f6
Rename test runs, to prep for real tests.
colr_test_run.py
colr_test_run.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ test_colr.py Run a few tests for the Colr library. I know these are not good tests. They do catch bugs though. Actual unit tests are coming, but for now just try all the methods and see if anything breaks. -Christopher Welborn 08-30-2015 """ from ...
Python
0
a02a46752d954c29a65bf8bc5b88fa3545315175
Add unit tests for timestr()
lib/svtplay_dl/tests/utils.py
lib/svtplay_dl/tests/utils.py
#!/usr/bin/python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # The unittest framwork doesn't play nice with pylint: # pylint: disable-msg=C0103 from __future__ import absolute_import import unittest import svtplay_dl.utils class timestrTest(unittest.TestCase): def ...
Python
0
46c036cad1323d55c61f546b5cd6174739ab1b42
add helper functions for data persistence
ws/data_persistence.py
ws/data_persistence.py
# https://github.com/usc-isi-i2/dig-etl-engine/issues/92 import json import threading import os import codecs # 1.acquire file write lock # 2.write to file.new # 3.acquire replace lock # 4.rename file to file.old # 5.rename file.new to file # 6.release replace lock and write lock # 7.remove file.old def dump_data(da...
Python
0.000001
1f94d2a6597f8ddf5d544afc52f6d627085deaad
Add script school-exclusion.py
school-exclusion.py
school-exclusion.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from time import time from codecs import open from argparse import ArgumentParser EXCLUEDE_FLAG = False def duration(start, end): second = (end - start) % 60 minute = (end - start) % 3600 / 60 hour = (end - start) / 3600 return "%d:%02d:%02d" % (hour, mi...
Python
0.000002
327b74d5e0328e6415520b907e4c43ed8cb54cf2
add sample that fetches the graph and renders it as an ascii tree
examples/fetchDebianDependencyGraph.py
examples/fetchDebianDependencyGraph.py
#!/usr/bin/python import sys from pyArango.connection import * from pyArango.graph import * from asciitree import * conn = Connection(username="root", password="") db = conn["ddependencyGrahp"] if not db.hasGraph('debian_dependency_graph'): raise Exception("didn't find the debian dependency graph, please import ...
Python
0
8e73752e9242796a933d3566eb4a5e4470f13d5e
Create sequences.py
sequences.py
sequences.py
import random import sys import os # User input user_input = input("Type in 5 integers of any sequence separated by commas. Example: 1,2,3,4,5: ") list_input = user_input.split(",") # Convert numbered strings into integers in list list_int = list(map(int, list_input)) # Check Arithmetic Sequence list_arith = list_int...
Python
0.000009
d6db1d0b81211a80884131b10212195ab38f99ad
Fix a conflict with IPython.
dosagelib/output.py
dosagelib/output.py
# -*- coding: utf-8 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2005-2016 Tobias Gruetzmacher import time import sys import os import threading import traceback import codecs from .ansicolor import Colorizer lock = threading.Lock() ...
# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam import time import sys import os import threading import traceback import codecs from .ansicolor import Colorizer lock = threading.Lock() def get_threadname(): """Return name o...
Python
0.00166
ea40075f8924c2d61da8f92fe9ecf74045bbe6cc
add script to convert Tandem Repeats Finder dat format to bed format required for STRetch
scripts/TRFdat_to_bed.py
scripts/TRFdat_to_bed.py
#!/usr/bin/env python from argparse import (ArgumentParser, FileType) def parse_args(): "Parse the input arguments, use '-h' for help" parser = ArgumentParser(description='Convert Tandem Repeat Finder (TRF) dat file to bed format with repeat units for microsatellite genotyping') parser.add_argument( ...
Python
0
272eceebbc44bd7dc44498233a7dca5ab9c2bdd8
add iplookup
scripts/iplookup.py
scripts/iplookup.py
import sys import json import numpy as np import pandas as pd import geoip2.database if len(sys.argv) != 3: sys.exit('Please specify a GeoLite DB and an ip table.') reader = geoip2.database.Reader(sys.argv[1]) def get_name(entry, lang): if hasattr(entry, 'names') and lang in entry.names: return ent...
Python
0.000001