repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
dstftw/youtube-dl | youtube_dl/extractor/tv2hu.py | 56 | 2411 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class TV2HuIE(InfoExtractor):
IE_NAME = 'tv2.hu'
_VALID_URL = r'https?://(?:www\.)?tv2\.hu/(?:[^/]+/)+(?P<id>\d+)_[^/?#]+?\.html'
_TESTS = [{
'url': 'http://tv2.hu/ezek_mego... | unlicense |
dmsul/econtools | econtools/metrics/tests/test_colinear.py | 1 | 2139 | from os import path
import pandas as pd
import numpy as np
import pytest
from econtools.metrics.api import reg
from econtools.metrics.core import _get_colinear_cols
class TestCheckColinear(object):
def setup(self):
"""Stata reg output from `sysuse auto; reg price mpg`"""
test_path = path.split(... | bsd-3-clause |
ruibarreira/linuxtrail | usr/lib/python2.7/imaplib.py | 45 | 48348 | """IMAP4 client.
Based on RFC 2060.
Public class: IMAP4
Public variable: Debug
Public functions: Internaldate2tuple
Int2AP
ParseFlags
Time2Internaldate
"""
# Author: Piers Lauder <piers@cs.su.oz.au> December 1997.
#
# Auth... | gpl-3.0 |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/lib/galaxy/model/migrate/versions/0069_rename_sequencer_form_type.py | 1 | 1102 | """
Migration script to rename the sequencer information form type to external service information form
"""
from sqlalchemy import *
from sqlalchemy.orm import *
from migrate import *
from migrate.changeset import *
from sqlalchemy.exc import *
from galaxy.model.custom_types import *
import datetime
now = datetime.d... | gpl-3.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/tornado/locks.py | 20 | 15218 | # Copyright 2015 The Tornado 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 w... | bsd-2-clause |
fyhtea/squeezeDet-hand | src/dataset/imdb.py | 2 | 9954 | # Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016
"""The data base wrapper class"""
import os
import random
import shutil
from PIL import Image, ImageFont, ImageDraw
import cv2
import numpy as np
from utils.util import iou, batch_iou
class imdb(object):
"""Image database."""
def __init__(self, name, mc):
... | bsd-2-clause |
fengxiaoiie/volatility | volatility/plugins/mac/apihooks_kernel.py | 12 | 26839 | # Volatility
#
# 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
# your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-2.0 |
jimi-c/ansible | lib/ansible/modules/cloud/rackspace/rax_cdb_database.py | 102 | 4470 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
epage/The-One-Ring | hand_tests/gv_load_csv.py | 1 | 1063 | #!/usr/bin/env python
from __future__ import with_statement
from __future__ import division
import sys
sys.path.insert(0,"../src")
import csv
import logging
try:
import cStringIO as StringIO
except ImportError:
import StringIO
import gvoice.backend as backend
_moduleLogger = logging.getLogger(__name__)
if __... | lgpl-2.1 |
babble/babble | include/jython/Lib/encodings/iso2022_jp_2.py | 816 | 1061 | #
# iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
cloudControl/libcloud | libcloud/utils/py3.py | 26 | 6285 | # 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 use ... | apache-2.0 |
arpith/zulip | zerver/tests/test_narrow.py | 7 | 58879 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from django.db import connection
from django.test import override_settings
from sqlalchemy.sql import (
and_, select, column,
)
from sqlalchemy.sql import compiler # type: ignore
from zerver.models import (
R... | apache-2.0 |
dslackw/slpkg | slpkg/sbo/slack_find.py | 1 | 1830 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# slack_find.py file is part of slpkg.
# Copyright 2014-2021 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
# https://gitlab.com/dslackw/slpkg
# Slpkg is free software: you can red... | gpl-3.0 |
captiosus/treadmill | tests/api/instance_test.py | 1 | 6899 | """Instance API tests.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import mock
import jsonschema
import six
from treadmill import admin
from treadmill import exc
from treadmill import master... | apache-2.0 |
dancingdan/tensorflow | tensorflow/contrib/distributions/python/ops/bijectors/softplus.py | 35 | 5563 | # Copyright 2016 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... | apache-2.0 |
alexcuellar/odoo | addons/sale_crm/wizard/crm_make_sale.py | 223 | 7199 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
vietanh85/mongo-connector | mongo_connector/connector.py | 7 | 42035 | # Copyright 2013-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
ctrlaltdylan/CouchPotato | library/git/__init__.py | 121 | 1673 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
fishscene/streamlink | src/streamlink_cli/console.py | 3 | 1749 | import json
import sys
from getpass import getpass
from .compat import input
from .utils import JSONEncoder
class ConsoleOutput(object):
def __init__(self, output, streamlink, json=False):
self.streamlink = streamlink
self.logger = streamlink.logger.new_module("cli")
self.json = json
... | bsd-2-clause |
andrewmoses/ssquiz | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/jpcntx.py | 200 | 19109 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | bsd-3-clause |
0x46616c6b/ansible-modules-core | database/mysql_variables.py | 23 | 7691 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql variables
(c) 2013, Balazs Pocze <banyek@gawker.com>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU G... | gpl-3.0 |
xuewei4d/scikit-learn | sklearn/preprocessing/tests/test_label.py | 8 | 22347 | import numpy as np
import pytest
from scipy.sparse import issparse
from scipy.sparse import coo_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
from sklearn.utils.multiclass import type_of_target
from sklearn.util... | bsd-3-clause |
rnapoles/ADSBrowser | adsbrowser/controllers/User.py | 1 | 3375 | import logging
from adsbrowser.lib.base import *
from adsbrowser.model.UserModel import UserModel;
log = logging.getLogger(__name__)
class UserController(BaseController):
def __init__(self):
#super(BaseController,self).__init__()
BaseController.__init__(self)
#response.write('__init__');
if self._check_ses... | gpl-3.0 |
rainest/dance-partner-matching | networkx/readwrite/tests/test_pajek.py | 2 | 2563 | #!/usr/bin/env python
"""
Pajek tests
"""
from nose.tools import assert_equal, assert_almost_equal
from networkx import *
import os,tempfile
from io import open
class TestPajek(object):
def setUp(self):
self.data="""*network Tralala\n*vertices 4\n 1 "A1" 0.0938 0.0896 ellipse x_fact 1 y_fact 1... | bsd-2-clause |
gavin-feng/odoo | addons/account/wizard/account_tax_chart.py | 385 | 3247 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
modelbrouwers/modelbouwdag.nl | src/modelbouwdag/accounts/migrations/0001_initial.py | 1 | 2459 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import modelbouwdag.accounts.models
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
operations = [
... | mit |
dsemi/Flexget | flexget/tests/test_content_size.py | 3 | 4344 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import pytest
@pytest.mark.usefixtures('tmpdir')
class TestTorrentSize(object):
config = """
tasks:
test_min:
mock:
- {title: '... | mit |
crawfordsm/pysalt | saltspec/specidentify.py | 1 | 15216 | #!/usr/bin/env python
################################# LICENSE ##################################
# Copyright (c) 2009, South African Astronomical Observatory (SAAO) #
# All rights reserved. See LICENSE file for more details #
###################################################################... | bsd-3-clause |
jeremysanders/veusz | veusz/widgets/vectorfield.py | 3 | 9168 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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... | gpl-2.0 |
silly-wacky-3-town-toon/SOURCE-COD | toontown/estate/DistributedFireworksCannon.py | 1 | 4342 | from toontown.toonbase.ToontownGlobals import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from HouseGlobals import *
from toontown.effects import DistributedFireworkShow
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from pandac.Pan... | apache-2.0 |
pjsip/pjproject | pjsip-apps/src/py_pjsua/pjsua_app.py | 33 | 21600 | # $Id$
#
# Sample and simple Python script to make and receive calls, and do
# presence and instant messaging/IM using PJSUA-API binding for Python.
#
# Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
#
import py_pjsua
import sys
import thread
#
# Configurations
#
THIS_FILE = "pjsua_app.py"
C_QUIT = 0
C_LOG_... | gpl-2.0 |
meduz/scikit-learn | examples/decomposition/plot_incremental_pca.py | 175 | 1974 | """
===============
Incremental PCA
===============
Incremental principal component analysis (IPCA) is typically used as a
replacement for principal component analysis (PCA) when the dataset to be
decomposed is too large to fit in memory. IPCA builds a low-rank approximation
for the input data using an amount of memo... | bsd-3-clause |
matt-gardner/deep_qa | deep_qa/data/instances/reading_comprehension/question_passage_instance.py | 3 | 4862 | from typing import Dict, List, Any
import numpy as np
from overrides import overrides
from ..instance import TextInstance, IndexedInstance
from ...data_indexer import DataIndexer
class QuestionPassageInstance(TextInstance):
"""
A QuestionPassageInstance is a base class for datasets that consist primarily of... | apache-2.0 |
tquizzle/Sick-Beard | lib/guessit/__init__.py | 37 | 8748 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
gameduell/kythe | third_party/grpc/src/python/src/grpc/framework/face/testing/coverage.py | 41 | 3994 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | apache-2.0 |
justinlynn/boinc-v2 | py/Boinc/configxml.py | 20 | 3801 | #!/usr/bin/env python
# $Id$
# configxml.py - module to read and parse config.xml, run_state.xml
'''
SYNOPSIS: parses and writes config.xml and run_state.xml
USAGE: from Boinc import configxml
config = configxml.ConfigFile().read()
run_state = configxml.RunStateFile().read()
pr... | gpl-3.0 |
tempbottle/kbengine | kbe/src/lib/python/Tools/pynche/DetailsViewer.py | 68 | 10116 | """DetailsViewer class.
This class implements a pure input window which allows you to meticulously
edit the current color. You have both mouse control of the color (via the
buttons along the bottom row), and there are keyboard bindings for each of the
increment/decrement buttons.
The top three check buttons allow yo... | lgpl-3.0 |
CDE-UNIBE/qcat | apps/configuration/conf.py | 1 | 5525 | from django.conf import settings # noqa
from appconf import AppConf
class ConfigurationConf(AppConf):
"""
Custom settings for the configuration module.
"""
# Value-User relations
VALUEUSER_UNCCD = 'unccd_fp'
# Map country ISO codes 3 to 2
COUNTRY_ISO_MAPPING = {
'AFG': 'AF',
... | apache-2.0 |
frnhr/django-stdnumfield | stdnumfield/_formats.py | 1 | 11817 | # coding=utf-8
"""
This file is auto-generated via `bin/update_formats.py`.
"""
# fmt: off
formats = {
"al.nipt": u"NIPT (Numri i Identifikimit për Personin e Tatueshëm, Albanian VAT number)",
"ar.cbu": u"CBU (Clave Bancaria Uniforme, Argentine bank account number)",
"ar.cuit": u"CUIT (Código Único de Iden... | unlicense |
boland1992/SeisSuite | seissuite/misc/convex.py | 8 | 2925 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 3 08:48:56 2015
@author: boland
"""
import matplotlib.pylot as plt
from scipy.spatial import ConvexHull
import numpy as np
class Convex:
"""
CLASS CURRENTLY NOT WORKING!
Class defined in order to create a convex hull around an array of points
and then p... | gpl-3.0 |
jmflinuxtx/kerneltest-harness | setup.py | 1 | 2861 | #!/usr/bin/env python
import os
import re
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.md")) as fd:
README = fd.read()
with open(os.path.join(here, "kerneltest", "__init__.py")) as fd:
match = re.search('^__version__ = "(... | gpl-2.0 |
mcfletch/webassets | src/webassets/filter/cssrewrite/base.py | 20 | 3650 | import os
import re
from os.path import join, normpath
from webassets.filter import Filter
from webassets.utils import common_path_prefix
__all__ = ()
def addsep(path):
"""Add a trailing path separator."""
if path and path[-1] != os.path.sep:
return path + os.path.sep
return path
def path2url(... | bsd-2-clause |
mglukhikh/intellij-community | plugins/hg4idea/testData/bin/mercurial/util.py | 90 | 61353 | # util.py - Mercurial utility functions and platform specific implementations
#
# Copyright 2005 K. Thananchayan <thananck@yahoo.com>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the... | apache-2.0 |
brython-dev/brython | www/src/Lib/formatter.py | 50 | 15143 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... | bsd-3-clause |
ghedsouza/django | django/core/management/commands/inspectdb.py | 17 | 12808 | import keyword
import re
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.models.constants import LOOKUP_SEP
class Command(BaseCommand):
help = "Introspects the database tables in the given dat... | bsd-3-clause |
mkminer/p2pool | p2pool/test/util/test_forest.py | 283 | 6804 | import random
import unittest
from p2pool.util import forest, math
class DumbTracker(object):
def __init__(self, items=[]):
self.items = {} # hash -> item
self.reverse = {} # previous_hash -> set of item_hashes
for item in items:
self.add(item)
def add(self, i... | gpl-3.0 |
sklnet/openatv-enigma2 | lib/python/Plugins/Extensions/DVDBurn/Bludisc.py | 48 | 31394 | from Components.Task import Task, Job, DiskspacePrecondition, Condition
from Components.Harddisk import harddiskmanager
from Tools.Directories import SCOPE_HDD, resolveFilename, createDir
from time import strftime
from Process import CheckDiskspaceTask, getISOfilename, BurnTask, RemoveWorkspaceFolder
from Project impor... | gpl-2.0 |
goyalankit/po-compiler | object_files/networkx-1.8.1/build/lib.linux-i686-2.7/networkx/readwrite/tests/test_pajek.py | 22 | 2633 | #!/usr/bin/env python
"""
Pajek tests
"""
from nose.tools import assert_equal
from networkx import *
import os,tempfile
from io import open
from networkx.testing import *
class TestPajek(object):
def setUp(self):
self.data="""*network Tralala\n*vertices 4\n 1 "A1" 0.0938 0.0896 ellipse x_fact 1... | apache-2.0 |
arangodb/arangodb | 3rdParty/V8/v7.9.317/third_party/jinja2/loaders.py | 222 | 17382 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... | apache-2.0 |
janebeckman/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/dispatch/interconnect/udp/test_gp_interconnect_ard_regression.py | 11 | 6824 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | apache-2.0 |
tboyce021/home-assistant | homeassistant/components/rachio/__init__.py | 6 | 3980 | """Integration with the Rachio Iro sprinkler system controller."""
import asyncio
import logging
import secrets
from rachiopy import Rachio
from requests.exceptions import ConnectTimeout
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_A... | apache-2.0 |
pauloschilling/sentry | tests/sentry/utils/models/tests.py | 29 | 1711 | from __future__ import absolute_import
from django.db import models
from sentry.db.models import (
Model, BoundedIntegerField, BoundedBigIntegerField,
BoundedPositiveIntegerField)
from sentry.testutils import TestCase
# There's a good chance this model wont get created in the db, so avoid
# assuming it exist... | bsd-3-clause |
spaceone/pyjs | pygtkweb/demos/020-statusbar.py | 6 | 1528 | #!/usr/bin/env python
# example statusbar.py
import pygtk
pygtk.require('2.0')
import gtk
class StatusbarExample:
def push_item(self, widget, data):
buff = " Item %d" % self.count
self.count = self.count + 1
self.status_bar.push(data, buff)
return
def pop_item(self, widget, d... | apache-2.0 |
coloft/qemu | scripts/qemugdb/mtree.py | 8 | 2610 | #!/usr/bin/python
# GDB debugging support
#
# Copyright 2012 Red Hat, Inc. and/or its affiliates
#
# Authors:
# Avi Kivity <avi@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# Contributions after 2012-01-13 are licensed under the... | gpl-2.0 |
yesudeep/cmc | app/jinja2/tests/test_old_bugs.py | 6 | 2707 | # -*- coding: utf-8 -*-
"""
Tests for old bugs
~~~~~~~~~~~~~~~~~~
Unittest that test situations caused by various older bugs.
:copyright: (c) 2009 by the Jinja Team.
:license: BSD.
"""
from jinja2 import Environment, DictLoader, TemplateSyntaxError
env = Environment()
from nose import SkipTest
f... | mit |
lucidmotifs/auto-aoc | .venv/lib/python3.5/site-packages/pylint/checkers/similar.py | 1 | 14142 | # Copyright (c) 2006, 2008-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2012 Ry4an Brase <ry4an-hg@ry4an.org>
# Copyright (c) 2012 Google, Inc.
# Copyright (c) 2012 Anthony VEREZ <anthony.verez.external@cassidian.com>
# Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (... | mit |
phaustin/pyman | Book/chap8/Problems/FitPwrLaw.py | 3 | 2545 | # Routine FitPwrLaw
import numpy as np
import matplotlib.pyplot as plt
def LineFitWt(x, y, sig):
"""
Returns slope and y-intercept of weighted linear fit to
(x,y) data set.
Inputs: x and y data array and uncertainty array (unc)
for y data set.
Outputs: slope and y-intercept of best fit... | cc0-1.0 |
OmarElsayed2014/saudi-management | vendor/doctrine/orm/docs/en/conf.py | 2448 | 6497 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# 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.
... | apache-2.0 |
djgagne/scikit-learn | sklearn/utils/tests/test_fixes.py | 281 | 1829 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from numpy.testing import (assert_almost_equal,
... | bsd-3-clause |
gnowxilef/plexpy | lib/unidecode/x016.py | 252 | 4140 | data = (
'kka', # 0x00
'kk', # 0x01
'nu', # 0x02
'no', # 0x03
'ne', # 0x04
'nee', # 0x05
'ni', # 0x06
'na', # 0x07
'mu', # 0x08
'mo', # 0x09
'me', # 0x0a
'mee', # 0x0b
'mi', # 0x0c
'ma', # 0x0d
'yu', # 0x0e
'yo', # 0x0f
'ye', # 0x10
'yee', # 0x11
'yi', # 0x12
'ya... | gpl-3.0 |
Voluntarynet/BitmessageKit | BitmessageKit/Vendor/static-python/Lib/filecmp.py | 110 | 9588 | """Utilities for comparing files and directories.
Classes:
dircmp
Functions:
cmp(f1, f2, shallow=1) -> int
cmpfiles(a, b, common) -> ([], [], [])
"""
import os
import stat
from itertools import ifilter, ifilterfalse, imap, izip
__all__ = ["cmp","dircmp","cmpfiles"]
_cache = {}
BUFSIZE=8*1024
def cmp(... | mit |
oaelhara/numbbo | code-postprocessing/bbob_pproc/comp2/ppscatter.py | 1 | 17703 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Scatter Plots.
For two algorithms, this generates the scatter plot of log(ERT1(df)) vs.
log(ERT0(df)), where ERT0(df) is the ERT of the reference algorithm,
ERT1(df) is the ERT of the algorithm of concern, both for target
precision df.
Different symbols are used for d... | bsd-3-clause |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_cookielib.py | 74 | 72202 | # -*- coding: latin-1 -*-
"""Tests for cookielib.py."""
import cookielib
import os
import re
import time
from unittest import TestCase
from test import test_support
class DateTimeTests(TestCase):
def test_time2isoz(self):
from cookielib import time2isoz
base = 1019227000
day = 24*3600... | gpl-2.0 |
andrewleech/SickRage | sickrage/show/recommendations/recommended.py | 3 | 2983 | # coding=utf-8
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
andreparames/odoo | openerp/loglevels.py | 380 | 3930 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
xindus40223115/w17_test | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/surface.py | 603 | 3844 | from browser import document, html, window
from javascript import console, JSConstructor
from .rect import Rect
#import pygame.rect
canvas_ID=1
_canvas_id=None
class Surface:
def __init__(self, dim=[], depth=16, surf=None):
if surf is None:
self._depth=depth
self._canvas=html.CANVAS(width=... | gpl-3.0 |
BioroboticsLab/deeppipeline | test/conftest.py | 2 | 1885 | import os
import pickle
import pytest
from pipeline import Pipeline
from pipeline.objects import (
Filename,
IDs,
Image,
LocalizerPositions,
Orientations,
Saliencies,
SaliencyImage,
)
from pipeline.pipeline import get_auto_config
def get_test_fname(name):
test_dir = os.path.dirname(_... | apache-2.0 |
SeanNaren/deepspeech.pytorch | tests/smoke_test.py | 1 | 8559 | import json
import os
import shutil
import tempfile
import unittest
from dataclasses import dataclass
from pathlib import Path
from data.an4 import download_an4
from deepspeech_pytorch.configs.inference_config import EvalConfig, ModelConfig, TranscribeConfig, LMConfig
from deepspeech_pytorch.configs.train_config impor... | mit |
UdjinM6/dash | test/functional/feature_bip68_sequence.py | 2 | 17835 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP68 implementation."""
from test_framework.test_framework import BitcoinTestFramework
from test... | mit |
MichiMaestre/Lane-Detection-for-Autonomous-Cars | vendor/googletest/googlemock/scripts/generator/cpp/keywords.py | 1157 | 2004 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | mit |
nprapps/waterbug | etc/github.py | 18 | 4361 | #!/usr/bin/env python
import csv
import getpass
import json
import os
import re
import requests
from requests.auth import HTTPBasicAuth
from time import sleep
def get_auth():
"""
Construct a basic auth object from a username and password
"""
username = raw_input('Username: ')
password = getpass.g... | mit |
dhananjay92/servo | tests/wpt/css-tests/css-fonts-3_dev/xhtml1/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
rihardsk/rl-glue-ext | projects/codecs/Python/src/rlglue/utils/TaskSpecVRLGLUE3.py | 8 | 8897 | #
# Copyright (C) 2009, Jose Antonio Martin H.
#
#http://rl-glue-ext.googlecode.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
singer-io/singer-python | singer/transform.py | 1 | 14947 | import datetime
import decimal
import logging
import re
from jsonschema import RefResolver
import singer.metadata
from singer.logger import get_logger
from singer.utils import (strftime, strptime_to_utc)
LOGGER = get_logger()
NO_INTEGER_DATETIME_PARSING = "no-integer-datetime-parsing"
UNIX_SECONDS_INTEGER_DATETIME_P... | apache-2.0 |
jfmartinez64/test | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ivi.py | 21 | 7272 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class IviIE(InfoExtractor):
IE_DESC = 'ivi.ru'
IE_NAME = 'ivi'
_VALID_URL = r'https?://(?:www\... | gpl-3.0 |
naves-thiago/mbed-midi | workspace_tools/host_tests/host_tests_plugins/module_copy_silabs.py | 29 | 2230 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
kartverket/openlayers | tools/closure_library_jscompiler.py | 285 | 2337 | # Copyright 2010 The Closure Library 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 a... | bsd-2-clause |
hwaf/hwaf | py-hwaftools/find_boost.py | 1 | 6211 | # -*- python -*-
# stdlib imports ---
import os
import os.path as osp
import subprocess
# waf imports ---
import waflib.Utils
import waflib.Logs as msg
from waflib.Configure import conf
#
_heptooldir = osp.dirname(osp.abspath(__file__))
def options(ctx):
ctx.load('hwaf-base', tooldir=_heptooldir)
ctx.load... | bsd-3-clause |
timonwong/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/python3/docutils/languages/__init__.py | 4 | 1580 | # $Id$
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# Internationalization details are documented in
# <http://docutils.sf.net/docs/howto/i18n.html>.
"""
This package contains modules for language-dependent features of Docutils.
"""
__docformat__ = 'reSt... | mit |
laosiaudi/tensorflow | tensorflow/python/kernel_tests/depthtospace_op_test.py | 21 | 7765 | # Copyright 2016 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... | apache-2.0 |
ruibarreira/linuxtrail | usr/lib/python2.7/DocXMLRPCServer.py | 250 | 10500 | """Self documenting XML-RPC Server.
This module can be used to create XML-RPC servers that
serve pydoc-style documentation in response to HTTP
GET requests. This documentation is dynamically generated
based on the functions and methods registered with the
server.
This module is built upon the pydoc and SimpleXMLRPCSe... | gpl-3.0 |
kazuki/embedded-jubatus-python | tests/test_weight.py | 1 | 1850 | import json
import math
import unittest
from embedded_jubatus import Weight
from jubatus.common import Datum
from jubatus.weight.types import Feature
CONFIG = {
"converter": {
"num_filter_types": {},
"num_filter_rules": [],
"string_filter_types": {},
"string_filter_rules": [],
... | lgpl-2.1 |
shirou/ansible | lib/ansible/runner/action_plugins/fail.py | 161 | 1472 | # Copyright 2012, Dag Wieers <dag@wieers.com>
#
# 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 version 3 of the License, or
# (at your option) any later versi... | gpl-3.0 |
indhub/mxnet | tools/caffe_converter/caffe_proto_utils.py | 53 | 8298 | # 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... | apache-2.0 |
ge0rgi/cinder | cinder/volume/targets/fake.py | 13 | 1063 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
JosephMcc/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/bin/eyedropper.py | 18 | 4236 | from gi.repository import Gtk, Gdk, GObject, GdkPixbuf
from PIL import Image
class EyeDropper(Gtk.HBox):
__gsignals__ = {
'color-picked': (GObject.SignalFlags.RUN_LAST, None, (GObject.TYPE_STRING,))
}
def __init__(self):
Gtk.HBox.__init__ (self)
self.button = Gtk.Button("")
... | gpl-2.0 |
square/pants | src/python/pants/backend/jvm/tasks/idea_gen.py | 2 | 13144 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import os
import pkg... | apache-2.0 |
lin-credible/scikit-learn | benchmarks/bench_plot_omp_lars.py | 266 | 4447 | """Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle
regression (:ref:`least_angle_regression`)
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model impo... | bsd-3-clause |
robin-lai/scikit-learn | examples/applications/svm_gui.py | 287 | 11161 | """
==========
Libsvm GUI
==========
A simple graphical frontend for Libsvm mainly intended for didactic
purposes. You can create data points by point and click and visualize
the decision region induced by different kernels and parameter settings.
To create positive examples click the left mouse button; to create
neg... | bsd-3-clause |
zxxfog/Python_Basic | src/function.py | 1 | 1587 | # python 中函数的定义与使用
print("Usage of function.")
# 函数的的定义
def say_hello():
# 函数块
# 尝试文档字符串
"""This is a python function
output hello world in screen"""
print("Hello Python")
# 函数结束
# 函数调用
say_hello()
# 文档字符串的使用
print(say_hello.__doc__)
# 带参数的函数
def print_max(a,b):
if a>b:
print(a,"is larger than",b)
elif... | gpl-3.0 |
candrews/portage | pym/portage/tests/dep/test_best_match_to_list.py | 16 | 2774 | # test_best_match_to_list.py -- Portage Unit Testing Functionality
# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from itertools import permutations
from portage.tests import TestCase
from portage.dep import Atom, best_match_to_list
class Test_best_match_to... | gpl-2.0 |
Korkki/django | tests/check_framework/test_multi_db.py | 191 | 1682 | from django.db import connections, models
from django.test import TestCase, mock
from django.test.utils import override_settings
from .tests import IsolateModelsMixin
class TestRouter(object):
"""
Routes to the 'other' database if the model name starts with 'Other'.
"""
def allow_migrate(self, db, ap... | bsd-3-clause |
nojhan/weboob-devel | modules/presseurop/browser.py | 7 | 2180 | "browser for presseurop website"
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version ... | agpl-3.0 |
tessonec/PySPG | spg/simulation/paramdb.py | 1 | 8694 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 11 11:23:41 2011
@author: Claudio Tessone <claudio.tessone@uzh.ch>
Implementation of the paramaters.dat in the form of a database
"""
import spg.utils as utils
import spg.utils.check_params as check_params
from spg.base import MultIteratorParser, IterConstant
#from bas... | gpl-3.0 |
tidatida/linux-stable-grsec | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
metaodi/ckanapi | ckanapi/tests/test_remote.py | 3 | 3873 | import subprocess
import time
import os
import atexit
import socket
import requests
import ckanapi
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
from subprocess import DEVNULL
except ImportError:
DEVNULL = open(os.devnull, 'wb')
try:
from urllib2 import urlopen, URLErro... | mit |
appsembler/edx-platform | openedx/core/lib/log_utils.py | 33 | 1291 | """
Helper functions for logging.
"""
import logging
log = logging.getLogger(__name__)
def audit_log(name, **kwargs):
"""
DRY helper used to emit an INFO-level log message.
Messages logged with this function are used to construct an audit trail. Log messages
should be emitted immediately after the e... | agpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/third_party/rsa/rsa/prime.py | 194 | 3905 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | apache-2.0 |
leighpauls/k2cro4 | third_party/python_26/Lib/Bastion.py | 298 | 5744 | """Bastionification utility.
A bastion (for another object -- the 'original') is an object that has
the same methods as the original but does not give access to its
instance variables. Bastions have a number of uses, but the most
obvious one is to provide code executing in restricted mode with a
safe interface to an ... | bsd-3-clause |
rhdekker/collatex | collatex-pythonport/tests/test_suffix_edit_graph_aligner.py | 1 | 1982 | '''
Created on Sep 12, 2014
@author: Ronald Haentjens Dekker
'''
import unittest
from collatex import Collation, collate
class Test(unittest.TestCase):
def test_hermans_witness_order_independence_case_two_witnesses(self):
collation = Collation()
collation.add_plain_witness("A", "a b c d F g h i ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.