text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
from flake8_quotes import QuoteChecker
import os
import subprocess
from unittest import TestCase
class TestChecks(TestCase):
def test_get_noqa_lines(self):
checker = QuoteChecker(None, filename=get_absolute_path('data/no_qa.py'))
self.assertEqual(checker.get_noqa_lines(checker.get_file_contents())... | zheller/flake8-quotes | test/test_checks.py | Python | mit | 10,373 | 0.00617 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# TODO: put package requirements... | nbargnesi/proxme | setup.py | Python | mit | 1,716 | 0.001166 |
"""
[2016-11-09] Challenge #291 [Intermediate] Reverse Polish Notation Calculator
https://www.reddit.com/r/dailyprogrammer/comments/5c5jx9/20161109_challenge_291_intermediate_reverse/
A little while back we had a programming
[challenge](https://www.reddit.com/r/dailyprogrammer/comments/2yquvm/20150311_challenge_205_i... | DayGitH/Python-Challenges | DailyProgrammer/DP20161109B.py | Python | mit | 1,742 | 0.004018 |
"""Viessmann ViCare sensor device."""
from __future__ import annotations
from contextlib import suppress
from dataclasses import dataclass
import logging
from PyViCare.PyViCareUtils import (
PyViCareInvalidDataError,
PyViCareNotSupportedFeatureError,
PyViCareRateLimitError,
)
import requests
from homeass... | aronsky/home-assistant | homeassistant/components/vicare/sensor.py | Python | apache-2.0 | 16,333 | 0.000735 |
#!/usr/bin/env python
'''
Generate the main window for the pi-gui program. The interface show the last played
item with cover, title and supllemental informations that is interactive
and two buttons for show up the library screen and exit the porgram itself.
'''
#@author: Philipp Sehnert
#@contact: philipp.sehnert[a... | psikon/pitft-scripts | src/mainscreen.py | Python | mit | 2,347 | 0.007669 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... | vlegoff/tsunami | src/abstraits/obase/__init__.py | Python | bsd-3-clause | 9,968 | 0.002834 |
# Copyright (c) 2007 Enough Project.
# See LICENSE for details.
## /* Copyright 2007, Eyal Lotem, Noam Lewis, enoughmail@googlegroups.com */
## /*
## This file is part of Enough.
## Enough is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as pu... | krfkeith/enough | lib/dot.py | Python | gpl-3.0 | 6,472 | 0.004944 |
# Shared utility functions across monitors scripts.
import fcntl, os, re, select, signal, subprocess, sys, time
TERM_MSG = 'Console connection unexpectedly lost. Terminating monitor.'
class Error(Exception):
pass
class InvalidTimestampFormat(Error):
pass
def prepend_timestamp(msg, format):
"""Prepen... | yochow/autotest | server/hosts/monitors/monitors_util.py | Python | gpl-2.0 | 10,543 | 0.000474 |
import ast
import base64
import itertools
from functools import lru_cache
import cpapilib
from flask import session
from app import app
OBJECTS_DICTIONARY = None
@lru_cache(maxsize=5000)
def uid_name(uid_obj):
for obj in OBJECTS_DICTIONARY:
if uid_obj == obj['uid']:
return obj['name']
... | themadhatterz/cpapi | app/checkpoint.py | Python | mit | 6,936 | 0.001874 |
# -*- coding: utf-8 -*-
'''
Install software from the FreeBSD ``ports(7)`` system
.. versionadded:: 2014.1.0
This module allows you to install ports using ``BATCH=yes`` to bypass
configuration prompts. It is recommended to use the :mod:`ports state
<salt.states.freebsdports>` to install ports, but it it also possible... | smallyear/linuxLearn | salt/salt/modules/freebsdports.py | Python | apache-2.0 | 13,305 | 0 |
# Copyright 2016 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
# This plugin subclasses CurrencyProviderPlugin to provide additional curre... | fokusov/moneyguru | core/plugin/stale_currency_provider.py | Python | gpl-3.0 | 3,715 | 0.004307 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
def function():
return "pineapple"
def function2():
return "tractor"
class Class(object):
def method(self):
return "parrot"
class AboutMethodBindings(Koan):
def test_methods_are_bound_to_an_object(self):
obj... | jpvantuyl/python_koans | python2/koans/about_method_bindings.py | Python | mit | 2,996 | 0.000668 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/SGIX/shadow.py | Python | lgpl-3.0 | 750 | 0.024 |
#!/usr/bin/env python
import csv
import sys
from EPPs.common import StepEPP
class GenerateHamiltonInputUPL(StepEPP):
"""Generate a CSV containing the necessary information to batch up to 9 User Prepared Library receipt plates into
one DCT plate. The Hamilton requires input and output plate containers and well... | EdinburghGenomics/clarity_scripts | scripts/generate_hamilton_input_UPL.py | Python | mit | 4,957 | 0.00585 |
from collections import Counter as C
i,s=lambda:C(input()),lambda t:sum(t.values());a,b,c=i(),i(),i();a,b,N=a&c,b&c,s(c);print('NO'if any((a+b)[k]<v for k,v in c.items())|(s(a)*2<N)|(s(b)*2<N)else'YES')
| knuu/competitive-programming | atcoder/corp/codefes2014qb_c_2.py | Python | mit | 203 | 0.137931 |
"""Add search tokens.
Revision ID: 482338e7a7d6
Revises: 41a7e825d108
Create Date: 2014-03-18 00:16:49.525732
"""
# revision identifiers, used by Alembic.
revision = '482338e7a7d6'
down_revision = 'adc646e1f11'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'searchtoken... | EthanBlackburn/sync-engine | migrations/versions/006_add_search_tokens.py | Python | agpl-3.0 | 797 | 0.002509 |
from pyqrllib.pyqrllib import bin2hstr, QRLHelper
from qrl.core import config
from qrl.core.AddressState import AddressState
from qrl.core.misc import logger
from qrl.core.txs.Transaction import Transaction
class TokenTransaction(Transaction):
"""
TokenTransaction to create new Token.
"""
def __init... | randomshinichi/QRL | src/qrl/core/txs/TokenTransaction.py | Python | mit | 9,390 | 0.002556 |
#!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
"""Action to fingerprint files on the client."""
import hashlib
from grr.parsers import fingerprint
from grr.client import vfs
from grr.client.client_actions import standard
from grr.lib import rdfvalue
class FingerprintFile(standard.ReadBuffe... | ForensicTools/GRREAT-475_2141-Chaigon-Failey-Siebert | client/client_actions/file_fingerprint.py | Python | apache-2.0 | 2,271 | 0.010128 |
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--mat", type=str, help="mat file with observations X and side info", required=True)
parser.add_argument("--epochs", type=int, help="number of epochs", default = 2000)
parser.add_argument("--hsize", type=int, help="size of the hidden layer", ... | jaak-s/chemblnet | models/vaffl.py | Python | mit | 7,837 | 0.016843 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('historias', '0006_auto_20150413_0001'),
]
operations = [
migrations.AlterField(
model_name='hist... | btenaglia/hpc-historias-clinicas | hpc-historias-clinicas/historias/migrations/0007_auto_20150425_1459.py | Python | bsd-3-clause | 1,309 | 0.002292 |
__author__ = 'oskyar'
from django.db import models
from django.utils.translation import ugettext as _
from s3direct.fields import S3DirectField
from smart_selects.db_fields import ChainedManyToManyField
# Manager de Asignatura
class SubjectManager(models.Manager):
def owner(self, pk_subject):
return self... | oskyar/test-TFG | TFG/apps/subject/models.py | Python | gpl-2.0 | 2,996 | 0.000334 |
__author__ = 'ing'
| LowerSilesians/geo-squizzy | tests/gs_socket/__init__.py | Python | mit | 19 | 0 |
# -*- coding: utf-8 -*-
from src.constant import *
import unittest
from src.game import Game
class TestPlayers(unittest.TestCase):
# Init a player
def test_initPlayer(self):
game = Game()
player = game.createPlayer()
self.assertEqual(player._id, 0)
# Get a valid player
def te... | arnaudfr/echec | tests/test_players.py | Python | gpl-3.0 | 1,120 | 0.001786 |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mlperf/training_results_v0.7 | Google/benchmarks/resnet/implementations/resnet-cloud-TF2.0-tpu-v3-32/tf2_common/modeling/activations/swish.py | Python | apache-2.0 | 2,452 | 0.00367 |
__version__ = "0.1.dev0"
| igordejanovic/textx-tools | txtools/templates/lang/copy/pack_name/__init__.py | Python | mit | 25 | 0 |
import unittest
import socket
import os
from shapy.framework.netlink.constants import *
from shapy.framework.netlink.message import *
from shapy.framework.netlink.tc import *
from shapy.framework.netlink.htb import *
from shapy.framework.netlink.connection import Connection
from tests import TCTestCase
class TestClas... | praus/shapy | tests/netlink/test_htb_class.py | Python | mit | 1,941 | 0.014426 |
from django.apps import AppConfig
class PagesConfig(AppConfig):
name = 'precision.pages'
verbose_name = "Pages"
| FreeCodeCampRoma/precision_school-management | precision/pages/apps.py | Python | mit | 122 | 0 |
# coding: utf-8
from sqlalchemy import Column, Float, Integer, Numeric, String, Table, Text
from geoalchemy2.types import Geometry
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class EgoDemandFederalstate(Base):
__tablename__ = 'ego_demand_federalstate... | openego/ego.io | egoio/db_tables/demand.py | Python | agpl-3.0 | 6,745 | 0 |
#! /usr/bin/env python
# This file is part of the dvbobjects library.
#
# Copyright © 2005-2013 Lorenzo Pallara l.pallara@avalpa.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ve... | 0xalen/opencaster_isdb-tb | libs/dvbobjects/dvbobjects/utils/MJD.py | Python | gpl-2.0 | 1,057 | 0.011353 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import binascii
import os
import pytest
from cryptography.ha... | hipnusleo/laserjet | resource/pypi/cryptography-1.7.1/tests/hazmat/primitives/test_idea.py | Python | apache-2.0 | 2,825 | 0 |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
class RegistrationForm(UserCreationForm):
email = forms.EmailField(help_text='Enter a valid email address')
address = forms.CharFi... | agiliq/fundraiser | authentication/forms.py | Python | bsd-3-clause | 626 | 0 |
# -*- coding:utf-8 -*-
import operator
import string
import operator
import itertools
import snowballstemmer
from textblob import TextBlob, Word
LOWER_MAP = {
'tr': {
ord('I'): u'ı'
}
}
STEMMERS = {
'en': snowballstemmer.stemmer('english'),
'tr': snowballstemmer.stemmer('turkish'),
}
def no... | bahattincinic/arguman.org | web/nouns/utils.py | Python | mit | 1,877 | 0 |
#!/usr/bin/python
file = open('prog.txt','r')
s = ""
for b in file.read():
s+="%d," % ord(b)
print(s[:-1])
| rarmknecht/SimpleQuine | mkarray.py | Python | mit | 111 | 0.027027 |
from flask import Flask
from flask.ext.quik import FlaskQuik
from flask.ext.quik import render_template
app = Flask(__name__)
quik = FlaskQuik(app)
@app.route('/', methods=['GET', 'POST'] )
def hello_quik():
return render_template('hello.html', name='quik')
app.run(host='0.0.0.0', debug=True, port=5000)
| avelino/Flask-Quik | tests/example.py | Python | mit | 315 | 0.003175 |
# -*- coding=utf-8 -*-
"""Test LinkedList for random inputs."""
import pytest
def test_linkedlist_tail_default():
"""Test LinkedList contstructor for functionality."""
from linked_list import LinkedList
assert LinkedList.tail is None
def test_linkedlist_construct_empty_list():
"""Test LinkedList ins... | qwergram/data-structures | src/test_linked_list.py | Python | mit | 5,503 | 0 |
active_extensions = []
class Extension(object):
def register(self):
pass
def dispatch(event, *args, **kwargs):
for extension in active_extensions:
if not hasattr(extension, event):
continue
getattr(extension, event)(*args, **kwargs)
def register(extension):
instanc... | marteinn/Skeppa | skeppa/ext/__init__.py | Python | mit | 400 | 0 |
import asyncio
import demjson
from bot import user_steps, sender, get, downloader
from message import Message
client_id = ''#YOUR CLIENT ID
async def search(query):
global guest_client_id
search_url = 'https://api.soundcloud.com/search?q=%s&facet=model&limit=30&offset=0&linked_partitioning=1&client_id='+c... | siyanew/Siarobo | plugins/soundcloud.py | Python | mit | 3,323 | 0.003912 |
from __future__ import absolute_import
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd.util import *
from autograd import grad
npr.seed(1)
def test_real_type():
fun = lambda x: np.sum(np.real(x))
df = grad(fun)
assert type(df(1.0)) == float
assert type(df(1.0j)) == complex... | kcarnold/autograd | tests/test_complex.py | Python | mit | 1,428 | 0.016106 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, serge van Ginderachter <serge@vanginderachter.be>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... | amir343/ansible-modules-extras | network/f5/bigip_monitor_tcp.py | Python | gpl-3.0 | 16,428 | 0.006148 |
from __future__ import print_function
import os.path
import re
import imp
import sys
from shutil import copyfile
import PythonAPI as api
class ValidateFilename(api.PythonAPIRule):
def __init__(self, config):
super(ValidateFilename, self).__init__(config)
def run(self, inputFile, outputFile, encoding):
# NOTE:... | unchartedsoftware/PLUTO | src/rules/validateFilename.py | Python | apache-2.0 | 1,114 | 0.027828 |
# -*- coding: utf-8 -*-
#
# Pinax Symposion documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 5 17:31:13 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | smellman/sotmjp-website | docs/conf.py | Python | bsd-3-clause | 8,580 | 0.007459 |
from qsweepy.instruments import *
from qsweepy import *
from qsweepy import awg_iq_multi
import numpy as np
device_settings = {'vna_address': 'TCPIP0::10.20.61.48::inst0::INSTR',
'lo1_address': 'TCPIP0::10.20.61.59::inst0::INSTR',
'lo1_timeout': 5000, 'rf_switch_address': '10.20... | ooovector/qtlab_replacement | tunable_coupling_transmons/Misis_two_qubit_July_2019_setup.py | Python | gpl-3.0 | 12,967 | 0.003915 |
import sys
def check_args(argv):
if len(argv) != 2:
print ("Help:\n"
"%s filename.log\n"
"filename.log = name of logfile") % argv[0]
sys.exit(1)
| hinnerk/py-djbdnslog | src/djbdnslog/scripts/__init__.py | Python | bsd-3-clause | 197 | 0.015228 |
# -*- coding: UTF-8 -*-
import haystack
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from conference import models
from conference.templatetags.conference import fare_blob
from collections import defaultdict
from datetime import datetime
from xml.sax.saxutils im... | pythonitalia/pycon_site | p3/management/commands/partner_events.py | Python | bsd-2-clause | 1,898 | 0.002634 |
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
from squeezemail.tasks import run_steps
run_steps.delay()
| rorito/django-squeezemail | squeezemail/management/commands/run_steps_task.py | Python | mit | 197 | 0 |
import json
from urllib2 import urlopen, HTTPError
from urllib import urlencode
import logging
class HTTPClient(object):
def __init__(self, host='localhost', port=90):
self.host = host
self.port = port
def get_serv_addr (self):
return 'http://%s:%s/' % ( self.host, self.port, )
... | procool/mygw | globals/utils/server/http_client.py | Python | bsd-2-clause | 1,122 | 0.017825 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | airbnb/airflow | airflow/contrib/hooks/gcp_container_hook.py | Python | apache-2.0 | 1,567 | 0.002553 |
import ntpath
import os
import steam
import zipfile
import shutil
from subprocess import check_call, CalledProcessError
from flask import flash, current_app, abort
from PIL import Image
from io import BytesIO
from werkzeug.utils import secure_filename
from ..tf2.models import all_classes, TF2BodyGroup, TF2EquipRegion
f... | Smashman/mods.tf | app/utils/utils.py | Python | gpl-3.0 | 11,564 | 0.002248 |
# =============================================================================
# 2013+ Copyright (c) Kirill Smorodinnikov <shaitkir@gmail.com>
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fre... | tempbottle/elliptics | tests/pytests/test_session_parameters.py | Python | lgpl-3.0 | 7,542 | 0.000928 |
'''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on Jan 1, 2011
@author:Drew Bratcher
@contact: dbratcher@gatech.edu
@summary: Contains tutorial for backteste... | wogsland/QSTK | build/lib.linux-x86_64-2.7/QSTK/qstkutil/qsdateutil.py | Python | bsd-3-clause | 9,008 | 0.01099 |
'''Custom models for the block_comment app.'''
import difflib
from django.contrib.comments.models import Comment
from django.db import models
from django.utils.translation import ugettext as _
from block_comment.diff_match_patch import diff_match_patch
class BlockComment(Comment):
'''
``BlockComment`` exten... | gabrielhurley/django-block-comment | block_comment/models.py | Python | bsd-3-clause | 2,966 | 0.001011 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 22 07:54:05 2014
@author: charleslelosq
Carnegie Institution for Science
"""
import sys
sys.path.append("/Users/charleslelosq/Documents/RamPy/lib-charles/")
import csv
import numpy as np
import scipy
import matplotlib
import matplotlib.gridspec as gridspec
from pylab ... | charlesll/RamPy | legacy_code/IR_dec_comb.py | Python | gpl-2.0 | 6,585 | 0.027183 |
""" Selective Kernel Networks (ResNet base)
Paper: Selective Kernel Networks (https://arxiv.org/abs/1903.06586)
This was inspired by reading 'Compounding the Performance Improvements...' (https://arxiv.org/abs/2001.06268)
and a streamlined impl at https://github.com/clovaai/assembled-cnn but I ended up building somet... | rwightman/pytorch-image-models | timm/models/sknet.py | Python | apache-2.0 | 8,742 | 0.004004 |
from gitbarry.reasons import start, finish, switch # , switch, publish
REASONS = {
'start': start,
'finish': finish,
'switch': switch,
# 'publish': publish,
}
| a1fred/git-barry | gitbarry/reasons/__init__.py | Python | mit | 177 | 0 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/lazylibrarian/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | theguardian/LazyLibrarian_Old | lazylibrarian/notifiers/tweet.py | Python | gpl-3.0 | 5,477 | 0.012416 |
import urllib
import urllib2
from bs4 import BeautifulSoup
textToSearch = 'gorillaz'
query = urllib.quote(textToSearch)
url = "https://www.youtube.com/results?search_query=" + query
response = urllib2.urlopen(url)
html = response.read()
soup = BeautifulSoup(html)
for vid in soup.findAll(attrs={'class':'yt-uix-tile-lin... | arbakker/yt-daemon | search_yt.py | Python | mit | 380 | 0.005263 |
#!/usr/bin/env python3
import random
import unittest
import networkx
from mininet.topo import Topo
from clib.mininet_test_watcher import TopologyWatcher
from clib.mininet_test_base_topo import FaucetTopoTestBase
class FaucetFaultToleranceBaseTest(FaucetTopoTestBase):
"""
Generate a topology of the given pa... | trungdtbk/faucet | tests/generative/integration/mininet_tests.py | Python | apache-2.0 | 17,678 | 0.001923 |
#!/usr/bin/python
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | denis-vilyuzhanin/selenium-fastview | py/test/selenium/webdriver/common/element_attribute_tests.py | Python | apache-2.0 | 12,180 | 0.00312 |
"""Lists VPC offerings"""
from baseCmd import *
from baseResponse import *
class listVPCOfferingsCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""list VPC offerings by display text"""
self.displaytext = None
self.typeInfo['displaytext'] = 'string'
... | MissionCriticalCloud/marvin | marvin/cloudstackAPI/listVPCOfferings.py | Python | apache-2.0 | 5,265 | 0.002279 |
from managers import sl2gen
from utils.ssh import SSH
from paramiko import SSHException
import sys
import logging
log = logging.getLogger("sl2.ion")
def launch_ion(tsuite):
"""Launch ION daemons.
Args:
tsuite: tsuite runtime."""
gdbcmd_path = tsuite.conf["slash2"]["ion_gdb"]
sl2gen.launch_gdb_sl(tsuite,... | pscedu/slash2-stable | slash2/utils/tsuite2/managers/ion.py | Python | isc | 1,513 | 0.017184 |
import unittest
from constants import *
from wow import *
from util import *
class BaseTest(unittest.TestCase):
def test_for_normal_query_split(self):
# Tests to ensure that the query gets split properly when the bot gets a message.
# Example query: '!armory pve/pvp <name> <realm> <region>'
... | remond-andre/discord-wow-armory-bot-modified | tests.py | Python | mit | 12,125 | 0.00833 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | superstack/nova | nova/db/sqlalchemy/migration.py | Python | apache-2.0 | 3,168 | 0 |
# --------------------------------------------------------------------------- #
# AUI Library wxPython IMPLEMENTATION
#
# Original C++ Code From Kirix (wxAUI). You Can Find It At:
#
# License: wxWidgets license
#
# http:#www.kirix.com/en/community/opensource/wxaui/about_wxaui.html
#
# Current wxAUI Version Tracked: ... | robmcmullen/peppy | peppy/third_party/aui/framemanager.py | Python | gpl-2.0 | 360,518 | 0.00593 |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 29 15:52:33 2014
@author: raffaelerainone
"""
from time import clock
from math import sqrt
def is_prime(n):
check=True
i=2
while check and i<=sqrt(n):
if n%i==0:
check=False
i+=1
return check
start = clock()
lim=50*(10**6)... | raffo85h/projecteuler | 87. Prime power triples.py | Python | gpl-2.0 | 692 | 0.027457 |
# This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from xdrlib import Packer, Unpacker
from ..type_checked import type_checked
from .int64 import Int64
from .transaction_result_ext import TransactionResultExt
from .transaction_result_result import TransactionResul... | StellarCN/py-stellar-base | stellar_sdk/xdr/transaction_result.py | Python | apache-2.0 | 2,928 | 0 |
import os
from .ruby import RubyExecutor
class Executor(RubyExecutor):
name = 'RUBY19'
def get_nproc(self):
return [-1, 1][os.name == 'nt']
def get_security(self):
from cptbox.syscalls import sys_write
sec = super(Executor, self).get_security()
sec[sys_write] = lambda deb... | buhe/judge | executors/RUBY19.py | Python | agpl-3.0 | 407 | 0.002457 |
import pytest
from gosa.common import Environment
from gosa.common.components import PluginRegistry, ObjectRegistry
import os
def pytest_unconfigure(config):
PluginRegistry.getInstance('HTTPService').srv.stop()
PluginRegistry.shutdown()
@pytest.fixture(scope="session", autouse=True)
def use_test_config():
... | gonicus/gosa | plugins/goto/conftest.py | Python | lgpl-2.1 | 496 | 0.002016 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Gestión de parámetros de configuración - xbmc
#------------------------------------------------------------
# tvalacarta
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#--------------------------------------------------------... | conejoninja/pelisalacarta | python/version-xbmc-09-plugin/core/config.py | Python | gpl-3.0 | 5,454 | 0.018532 |
import plog.plog as plg
PLOG = plg.PLOG
plog_color = plg.plog_color
plog = plg.plog
def perr(*msg, delim=" "):
plog(*msg, type=PLOG.err, delim=delim)
def pwrn(*msg, delim=" "):
plog(*msg, type=PLOG.warn, delim=delim)
__all__ = ["PLOG", "plog_color", "plog", "perr", "pwrn"]
| KonradMagnusson/PyPLOG | __init__.py | Python | mit | 285 | 0.010526 |
#-*- coding: iso-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for ... | j5shi/Thruster | pylibs/sqlite3/test/regression.py | Python | gpl-2.0 | 12,067 | 0.001243 |
# -*- coding: utf-8 -*-
#
# Kurt documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 29 16:09:55 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | UnknownStudio/Codeic | ScratchPlus/kurt/doc/conf.py | Python | mpl-2.0 | 10,130 | 0.00849 |
# coding: utf-8
try:
from django.conf.urls import patterns, url, include
except ImportError:
from django.conf.urls.defaults import patterns, url, include
from django.http import HttpResponse
def dummy(request):
return HttpResponse()
urlpatterns = patterns('',
url('^api/.+/$', dummy, name='dummy'),
... | anmekin/django-httplog | test_app/urls.py | Python | bsd-3-clause | 405 | 0.004938 |
#
# usage: python k44.py {file name} {number}
#
import sys
import pydot
from k41 import *
from k42 import get_relation_pairs
if __name__ == '__main__':
fn, nos = sys.argv[1], int(sys.argv[2])
sl = load_cabocha(fn)
pl = get_relation_pairs([sl[nos-1]])
g = pydot.graph_from_edges(pl)
g.write_png('re... | WatsonDNA/nlp100 | chap05/k44.py | Python | unlicense | 343 | 0 |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
from pants.option.option_types import DictOption
from pants.option.subsystem import Subsystem
DEFAULT_SCALA_VERSION = "2.13.6"
_logger... | pantsbuild/pants | src/python/pants/backend/scala/subsystems/scala.py | Python | apache-2.0 | 1,433 | 0.004187 |
"""
File Allocation Table (FAT) / 12 bit version
Used primarily for diskettes
"""
| larsks/pydonet | lib/pydonet/construct/formats/filesystem/fat12.py | Python | gpl-2.0 | 86 | 0 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2020 Richard Li <richard.li@ces.hk>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Lice... | DreamSourceLab/DSView | libsigrokdecode4DSL/decoders/a7105/pd.py | Python | gpl-3.0 | 12,297 | 0.002114 |
#This script is for produsing a new list of sites extracted from alexa top site list
import re
prefix = 'http://'
#suffix = '</td><td></td></tr><tr><td>waitForPageToLoad</td><td></td><td>3000</td></tr>'
with open('top100_alexa.txt','r') as f:
newlines = []
for line in f.readlines():
found=re.sub(r'\d+... | gizas/CSS_Extractor | replace.py | Python | mit | 580 | 0.017241 |
__author__ = "Konstantin Osipov <kostja.osipov@gmail.com>"
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | nvoron23/tarantool | test/lib/admin_connection.py | Python | bsd-2-clause | 2,482 | 0.000403 |
import lms_code.lib.rep2 as rep2
from lms_code.analysis.run_bem import bemify, boundary_conditions,\
assemble, constrain, solve, evaluate_surface_disp
from lms_code.analysis.simplified_bem import create_surface_mesh, \
set_params
from codim1.core import simple_line_mesh, combine_meshes, ray_mesh
def create_fau... | tbenthompson/LMS_public | lms_code/analysis/just_detach_bem.py | Python | mit | 846 | 0.002364 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import sys
log_level_index = sys.argv.index('--log_level') + 1 if '--log_level' in sys.argv else 0
os.environ['TF_CPP_MIN_LOG_LEVEL'] = sys.argv[log_level_index] if log_level_index > 0 and log_leve... | pandeydivesh15/AVSR-Deep-Speech | DeepSpeech_RHL.py | Python | gpl-2.0 | 72,056 | 0.005551 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | sam-m888/gramps | gramps/gen/filters/rules/place/_hasnolatorlon.py | Python | gpl-2.0 | 1,902 | 0.005783 |
import os
import numpy as np
import nibabel as nb
import nighresjava
from ..io import load_volume, save_volume
from ..utils import _output_dir_4saving, _fname_4saving
def levelset_curvature(levelset_image, distance=1.0,
save_data=False, overwrite=False, output_dir=None,
... | nighres/nighres | nighres/surface/levelset_curvature.py | Python | apache-2.0 | 4,723 | 0.002117 |
# based on killer algo found here:
# http://codereview.stackexchange.com/questions/12922/inversion-count-using-merge-sort
import sys, bisect
input_list = map(int,open(sys.argv[1]))
sorted_list = sorted(input_list)
inversions = 0
# we compare the unsorted list to the sorted list
# to compute inversion count, neat!
for... | zmcartor/Algorithms | Python/better_inversion_count.py | Python | mit | 485 | 0.012371 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class UnitDialogue:
"""
Unit dialogue model
"""
def __init__(self, **kwargs):
self.db = kwargs["db"]
self.dialogue = {}
def _get_unit_dialogue_map(self, dialogue):
unit_dialogue_map = {}
for unit_dialogue in dialogue... | butterscotchstallion/SpiffyRPG | SpiffyRPG/SpiffyWorld/models/unit_dialogue.py | Python | mit | 1,421 | 0 |
from django.conf import settings
from django.contrib import messages
from django.forms import Form
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators.csrf import csrf_exempt
from django.utils import timezone... | marceloomens/appointments | appointments/apps/common/views.py | Python | mit | 7,355 | 0.007886 |
'''
superstring
a collection of functions to manipulate strings
general purpose
next_visible_character
remove_whitespace
shrink_whitespace
var2string
string2array
is_string
stringmap
stringbreak
find_matching_brace
remove_comment_lines
contains_any
contains_all
... | habanero-rice/hclib | test/performance-regression/full-apps/qmcpack/nexus/library/superstring.py | Python | bsd-3-clause | 11,640 | 0.029639 |
"""
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as t... | Solid-Mechanics/matplotlib-4-abaqus | matplotlib/sphinxext/plot_directive.py | Python | mit | 27,667 | 0.002205 |
# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to u... | jonparrott/botocore | botocore/hooks.py | Python | mit | 10,052 | 0 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from nltk import download
TOKENIZER_MODEL = "punkt"
POS_TAGGER = "maxent_treebank_pos_tagger"
def downloadDependencies():
download(TOKENIZER_MODEL)
download(POS_TAGGER)
if __name__ == '__main__':
downloadDependencies()
| kbuschme/irony-detection | setup.py | Python | gpl-3.0 | 301 | 0.009967 |
# Copyright 2019 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 agreed to in writing, s... | coreycb/charms.openstack | charms_openstack/plugins/__init__.py | Python | apache-2.0 | 1,179 | 0 |
import numpy as np
import warnings
from scipy._lib._util import check_random_state
def rvs_ratio_uniforms(pdf, umax, vmin, vmax, size=1, c=0, random_state=None):
"""
Generate random samples from a probability density function using the
ratio-of-uniforms method.
Parameters
----------
pdf : cal... | aeklant/scipy | scipy/stats/_rvs_sampling.py | Python | bsd-3-clause | 7,080 | 0.000141 |
#!/usr/bin/env python
#
# GrovePi Example for using the Grove Thumb Joystick (http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? Ask... | karan259/GrovePi | Software/Python/grove_thumb_joystick.py | Python | mit | 3,278 | 0.003661 |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | google/upvote_py2 | common/ng_template.py | Python | apache-2.0 | 1,657 | 0.01026 |
from amitools.vamos.astructs import LibraryStruct
from amitools.vamos.atypes import Library, NodeType
from amitools.fd import read_lib_fd, generate_fd
from .vlib import VLib
from .stub import LibStubGen
from .patch import LibPatcherMultiTrap
from .impl import LibImplScanner
class LibCreator(object):
"""create a vam... | FrodeSolheim/fs-uae-launcher | amitools/vamos/libcore/create.py | Python | gpl-2.0 | 3,188 | 0.008783 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | akhilaananthram/nupic.research | sound_encoder/live_sound_encoding_demo.py | Python | gpl-3.0 | 2,476 | 0.011712 |
"""Integration tests for client-server interaction."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from multiprocessing import Process
import os
import shutil
import tempfile
import time
import unittest
from filetracker.client import Client, Filetracke... | sio2project/filetracker | filetracker/tests/interaction_test.py | Python | gpl-3.0 | 7,181 | 0.000418 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | zozo123/buildbot | master/buildbot/test/unit/test_db_migrate_versions_021_fix_postgres_sequences.py | Python | gpl-3.0 | 2,676 | 0.000747 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | dmlc/tvm | tests/python/topi/python/test_topi_qnn.py | Python | apache-2.0 | 6,744 | 0.001779 |
"""Tests for registry module - datasets method"""
import vcr
from pygbif import registry
@vcr.use_cassette("test/vcr_cassettes/test_datasets.yaml")
def test_datasets():
"registry.datasets - basic test"
res = registry.datasets()
assert dict == res.__class__
@vcr.use_cassette("test/vcr_cassettes/test_data... | sckott/pygbif | test/test-registry-datasets.py | Python | mit | 952 | 0 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | seankelly/buildbot | master/buildbot/test/integration/test_configs.py | Python | gpl-2.0 | 9,493 | 0.000316 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.