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 |
|---|---|---|---|---|---|
imsplitbit/nova | nova/tests/objects/test_objects.py | 1 | 27776 | # Copyright 2013 IBM Corp.
#
# 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 agree... | apache-2.0 |
jeremiahmarks/sl4a | python/src/Lib/nntplib.py | 156 | 21196 | """An NNTP client class based on RFC 977: Network News Transfer Protocol.
Example:
>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
Group comp.lang.python has 51 articles, rang... | apache-2.0 |
axtra/ansible | test/units/TestFilters.py | 107 | 5974 | '''
Test bundled filters
'''
import os.path
import unittest, tempfile, shutil
from ansible import playbook, inventory, callbacks
import ansible.runner.filter_plugins.core
import ansible.runner.filter_plugins.mathstuff
INVENTORY = inventory.Inventory(['localhost'])
BOOK = '''
- hosts: localhost
vars:
var: { a: ... | gpl-3.0 |
beiko-lab/gengis | bin/Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/ebmlib/backupmgr.py | 3 | 5844 | ###############################################################################
# Name: backupmgr.py #
# Purpose: File Backup Manager #
# Author: Cody Precord <cprecord@editra.org> #
... | gpl-3.0 |
saikia81/the-number-game | 3.3/number_game.py | 1 | 6006 | #import random, system and operating system possibilities.
import random, time, os
print 'welcome to the guess my number game V3.3'
print "I'll think of a number and you have to guess it"
print ''
list_easy = []
list_medium = []
list_hard = []
for n in range(1,101):
list_easy.append(n)
list_medium.append(n)
... | gpl-3.0 |
AlexeyKruglov/Skeinforge-fabmetheus | fabmetheus_utilities/geometry/solids/cylinder.py | 12 | 4690 | """
Boolean geometry cylinder.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.creation import lineation
from fa... | agpl-3.0 |
jfmartinez64/test | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/snotr.py | 158 | 2272 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
float_or_none,
str_to_int,
parse_duration,
)
class SnotrIE(InfoExtractor):
_VALID_URL = r'http?://(?:www\.)?snotr\.com/video/(?P<id>\d+)/([\w]+)'
_TESTS = [{
'url': '... | gpl-3.0 |
gojira/tensorflow | tensorflow/contrib/tensor_forest/python/ops/model_ops.py | 68 | 4851 | # Copyright 2017 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 |
chrislyon/dj_ds1 | dj_ds1/settings.py | 1 | 2812 | """
Django settings for dj_ds1 project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... | gpl-2.0 |
alexston/calibre-webserver | src/calibre/utils/magick/generate.py | 5 | 2241 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, textwrap, re, subprocess
INC = '/usr/include/ImageMagick-6'
'''
Various constants defined in the ImageMagick h... | gpl-3.0 |
starlocke/pidgin-2.10.9-custom | finch/plugins/pietray.py | 12 | 6332 | #!/usr/bin/env python
# This is a dbus script to show a docklet for Finch. This should work
# for any 'compatible' purple client.
#
# By 'compatible', I mean any client that sets and updates the
# "unseen-count" data on the conversations.
#
# It allows doing the following things:
# - It allows changing status.
# ... | gpl-2.0 |
egbertbouman/tribler-g | Tribler/Core/exceptions.py | 1 | 2991 | # Written by Arno Bakker
# see LICENSE.txt for license information
""" The Tribler-specifc Exceptions the Core may throw. """
#
# Exceptions
#
class TriblerException(Exception):
""" Super class for all Tribler-specific Exceptions the Tribler Core
throws.
"""
def __init__(self,msg=None):
... | lgpl-2.1 |
stemount/taylettings | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
bitesofcode/projexui | projexui/widgets/xlabel.py | 2 | 5203 | """ Defines some additional features for a basic QLabel """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software, LLC'
__license__ = 'LGPL'
__maintainer__ = 'Pr... | lgpl-3.0 |
cobalys/django | django/core/management/commands/testserver.py | 307 | 2006 | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput', action='store_false', dest='interactive', default=True,
help='Tells Django to NOT prompt the user for input of any... | bsd-3-clause |
Emergya/icm-openedx-educamadrid-platform-basic | common/djangoapps/terrain/course_helpers.py | 60 | 2482 | # pylint: disable=missing-docstring
import urllib
from lettuce import world
from django.contrib.auth.models import User
from student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore, clear_existing_modulestores
from xmodule.contentstore.django import _CONTENTSTORE
@world.absorb
def c... | agpl-3.0 |
ChenJunor/hue | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/store.py | 45 | 4822 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | apache-2.0 |
yukoba/sympy | sympy/strategies/branch/tests/test_core.py | 58 | 2416 | from sympy.strategies.branch.core import (exhaust, debug, multiplex,
condition, notempty, chain, onaction, sfilter, yieldify, do_one,
identity)
from sympy.core.compatibility import get_function_name, range
def posdec(x):
if x > 0:
yield x-1
else:
yield x
def branch5(x):
if ... | bsd-3-clause |
manics/openmicroscopy | components/tools/OmeroCpp/ext/gtest-1.7.0/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | gpl-2.0 |
Boussadia/weboob | modules/regionsjob/browser.py | 1 | 2000 | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# 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 3 of the License, or
# (at your opt... | agpl-3.0 |
erja-gp/openthread | tools/harness-automation/cases/leader_5_2_3.py | 16 | 1876 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# 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
# notic... | bsd-3-clause |
krafczyk/spack | var/spack/repos/builtin/packages/r-ttr/package.py | 5 | 1703 | ##############################################################################
# Copyright (c) 2013-2018, 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... | lgpl-2.1 |
ZihengJiang/mxnet | example/neural-style/end_to_end/model_vgg19.py | 43 | 6553 | # 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 |
repotvsupertuga/tvsupertuga.repository | script.module.cryptolib/lib/binascii_plus.py | 5 | 2575 | """ binascii_plus
Enhanced hex packet input and display
Copyright (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
"""
from binascii import a2b_hex, b2a_hex
import string
viewable = string.letters+string.digits+string.punctuation+' '
def a2b_p(s):
""" Convert ascii string of h... | gpl-2.0 |
3th3l/bc-8-group5 | agile_exercise.py | 1 | 1067 | class Employee(object):
def __init__(self, id, name, gender, num_transaction, salary):
self.name = name
self.gender = gender
self.num_transaction = num_transaction
self.salary = salary
def track_tran(self, id):
self.num_transaction += num
def review_sal(self, num_tran):
self.salary *= num_tran/10
clas... | mit |
cuongthai/cuongthai-s-blog | django/contrib/comments/admin.py | 361 | 3299 | from django.contrib import admin
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _, ungettext
from django.contrib.comments import get_model
from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete
class CommentsAdmin(adm... | bsd-3-clause |
gbenson/i8c | tests/test_comparisons.py | 1 | 2443 | # -*- coding: utf-8 -*-
# Copyright (C) 2015-16 Red Hat, Inc.
# This file is part of the Infinity Note Compiler.
#
# The Infinity Note Compiler 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 ... | lgpl-2.1 |
suyashphadtare/vestasi-erp-final | erpnext/accounts/report/budget_variance_report/budget_variance_report.py | 4 | 4649 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt
import time
from erpnext.accounts.utils import get_fiscal_year
from erpnext... | agpl-3.0 |
sigmavirus24/pip | pip/_vendor/requests/packages/chardet/chardetect.py | 1786 | 2504 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | mit |
okfish/django-kladr-api | kladr_api/widgets.py | 1 | 4946 | import json
from django import forms
from django.utils.safestring import mark_safe
from .settings import KLADR_API_URL, KLADR_API_TOKEN
class KladrWidget(forms.TextInput):
"""
Base class for kladr widgets
Subclass and define widget_type. It can be ('city', 'region', 'zip' etc)
see https://kladr-... | gpl-2.0 |
jbuchbinder/youtube-dl | youtube_dl/extractor/rice.py | 90 | 4580 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_parse_qs
from ..utils import (
xpath_text,
xpath_element,
int_or_none,
parse_iso8601,
ExtractorError,
)
class RICEIE(InfoExtractor):
_VALID_URL = r'https?://mediahu... | unlicense |
openstack/oslo.service | releasenotes/source/conf.py | 1 | 9062 | # -*- coding: utf-8 -*-
# Copyright (C) 2020 Red Hat, 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 ... | apache-2.0 |
nullishzero/Portage | pym/_emerge/create_world_atom.py | 7 | 4396 | # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import sys
from portage.dep import _repo_separator
from portage.exception import InvalidData
if sys.hexversion >= 0x3000000:
_unicode = str
else:
_unicode = unicode
def create_world_atom(pkg, args_set, root_... | gpl-2.0 |
msgfromside3/TeslaTelemetryPullerService | python_service/tesla_telemetry.py | 1 | 5658 | import getopt
import time
import teslajson
import sys
import datetime
from azure.storage.table import TableService, Entity
def log(connection, message):
currentTime = time.gmtime();
entry = Entity();
entry.PartitionKey = '{0}{1:02d}{2:02d}'.format(currentTime.tm_year, currentTime.tm_mon, currentTime.tm_mday);
entr... | apache-2.0 |
ljgabc/lfs | usr/lib/python2.7/test/test_weakset.py | 29 | 12838 | import unittest
from test import test_support
from weakref import proxy, ref, WeakSet
import operator
import copy
import string
import os
from random import randrange, shuffle
import sys
import warnings
import collections
import gc
import contextlib
class Foo:
pass
class SomeClass(object):
def __init__(self,... | gpl-2.0 |
raajitr/django_hangman | env/lib/python2.7/site-packages/django/core/handlers/base.py | 96 | 10769 | from __future__ import unicode_literals
import logging
import sys
import types
import warnings
from django.conf import settings
from django.core import signals
from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed
from django.db import connections, transaction
from django.urls import get_resolver... | mit |
moneta-dev/moneta | contrib/pyminer/pyminer.py | 766 | 6434 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
willworth/thermos | thermos/Lib/site-packages/pip/commands/download.py | 340 | 7810 | from __future__ import absolute_import
import logging
import os
from pip.exceptions import CommandError
from pip.index import FormatControl
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip import cmdoptions
from pip.utils import ensure_dir, normalize_path
from pip.utils.build... | mit |
eXistenZNL/SickRage | lib/github/tests/PullRequestFile.py | 39 | 3313 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
cgstudiomap/cgstudiomap | main/parts/odoo/addons/hr_payroll_account/hr_payroll_account.py | 240 | 10840 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
mohsinjuni/androguard | androguard/decompiler/dad/ast.py | 14 | 24090 | # This file is part of Androguard.
#
# Copyright (C) 2014 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
... | apache-2.0 |
jmckaskill/subversion | subversion/bindings/ctypes-python/csvn/auth.py | 7 | 3000 | # 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
# "Licens... | apache-2.0 |
sinbazhou/odoo | addons/account/account_invoice.py | 93 | 79585 | # -*- 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 |
JesseLivezey/sklearn-theano | examples/plot_cifar_fully_connected_generator.py | 9 | 1462 | """
===========================================
Generative networks for random CIFAR images
===========================================
This demo of a CIFAR generator is based on the work of
I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair,
A. Courville, Y.Bengio. *Generative Adversarial Net... | bsd-3-clause |
sidartaoliveira/ansible | lib/ansible/modules/identity/ipa/ipa_user.py | 71 | 11554 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 version.
#
... | gpl-3.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/django/core/paginator.py | 94 | 5058 | from math import ceil
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True):
self.object_list = object_list
self.per_pa... | mit |
iismd17/scikit-learn | examples/linear_model/plot_lasso_model_selection.py | 311 | 5431 | """
===================================================
Lasso model selection: Cross-Validation / AIC / BIC
===================================================
Use the Akaike information criterion (AIC), the Bayes Information
criterion (BIC) and cross-validation to select an optimal value
of the regularization paramet... | bsd-3-clause |
a-parhom/edx-platform | common/lib/xmodule/xmodule/modulestore/edit_info.py | 14 | 2841 | """
Access methods to get EditInfo for xblocks
"""
from xblock.core import XBlockMixin
from abc import ABCMeta, abstractmethod
class EditInfoMixin(XBlockMixin):
"""
Provides the interfaces for getting the edit info from XBlocks
"""
@property
def edited_by(self):
"""
The user id of ... | agpl-3.0 |
dasmith/IsisWorld | src/physics/panda/manager.py | 1 | 7798 | from direct.showbase import DirectObject
from pandac.PandaModules import * # TODO: specialize
# initialize collision mask constants
FLOORMASK = BitMask32.bit(1)
WALLMASK = BitMask32.bit(2)
PICKMASK = BitMask32.bit(3)
AGENTMASK = BitMask32.bit(4)
OBJMASK= BitMask32.bit(5)
OBJFLOOR = BitMask32.bit(6)
OBJPICK = Bi... | gpl-3.0 |
AuyaJackie/odoo | openerp/addons/base/res/res_font.py | 322 | 7559 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
pilou-/ansible | lib/ansible/plugins/lookup/sequence.py | 48 | 8969 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
# (c) 2012-17 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
DOCUMENTATION = """
lookup: sequence
author: Jayso... | gpl-3.0 |
KyleJamesWalker/ansible | lib/ansible/modules/windows/win_domain_controller.py | 8 | 3410 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Red Hat, Inc.
#
# 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 ... | gpl-3.0 |
asermax/todo-graphql | api-django/todo/schema.py | 1 | 2840 | import graphene
from graphene_django.types import DjangoObjectType
from . import models
class ListType(DjangoObjectType):
class Meta:
model = models.List
class ItemType(DjangoObjectType):
class Meta:
model = models.Item
class Query(object):
list = graphene.Field(ListType, id=graphene.... | mit |
Cinntax/home-assistant | homeassistant/components/cover/__init__.py | 1 | 11186 | """Support for Cover devices."""
from datetime import timedelta
import functools as ft
import logging
from typing import Any
import voluptuous as vol
from homeassistant.loader import bind_hass
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.entity import Entity
from homea... | apache-2.0 |
miguelpalacio/python-for-android | python-modules/twisted/twisted/conch/recvline.py | 61 | 11219 | # -*- test-case-name: twisted.conch.test.test_recvline -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Basic line editing support.
@author: Jp Calderone
"""
import string
from zope.interface import implements
from twisted.conch.insults import insults, helper
from twisted.... | apache-2.0 |
wellenreiter01/Feathercoin | test/functional/rpc_users.py | 7 | 7858 | #!/usr/bin/env python3
# Copyright (c) 2015-2017 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 multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | mit |
fuzzyhandle/awslambdas | garden-irrigation-tweets/tweepy/streaming.py | 11 | 17030 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import, print_function
import logging
import re
import requests
from requests.exceptions import Timeout... | mit |
mawentao007/reading_grab | grab/script/crawl.py | 1 | 5336 | #coding:utf-8
import logging
import os
from argparse import ArgumentParser
import six
from grab.util.config import build_spider_config, build_root_config
from grab.util.module import load_spider_class
from weblib.logs import default_logging
from weblib.files import clear_directory
from weblib.encoding import make_str
... | mit |
tanderegg/ansible-modules-core | cloud/openstack/os_ironic.py | 9 | 12668 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2014, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | gpl-3.0 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/LastFm/Album/GetTags.py | 5 | 4193 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetTags
# Retrieves the tags applied by an individual user to an album on Last.fm.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | gpl-2.0 |
Darkdadaah/pywikibot-core | scripts/fixing_redirects.py | 3 | 7899 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Correct all redirect links in featured pages or only one page of each wiki.
Can be using with:
¶ms;
-featured Run over featured pages (for some wikimedia wikis only)
Run fixing_redirects.py -help to see all the command-line
options -file, -ref, -links, ...
"... | mit |
bsmrstu-warriors/Moytri--The-Drone-Aider | Lib/linecache.py | 299 | 3964 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globals=None):
li... | gpl-3.0 |
joyxu/autotest | database_legacy/migrate.py | 4 | 13658 | #!/usr/bin/python -u
import os
import sys
import re
import tempfile
import optparse
import logging
try:
import autotest.common as common
except ImportError:
import common
from autotest.client.shared import utils
from autotest.database_legacy import database_connection
from autotest.client.shared import loggi... | gpl-2.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/lib2to3/fixes/fix_metaclass.py | 153 | 8214 | """Fixer for __metaclass__ = X -> (metaclass=X) methods.
The various forms of classef (inherits nothing, inherits once, inherints
many) don't parse the same in the CST so we look at ALL classes for
a __metaclass__ and if we find one normalize the inherits to all be
an arglist.
For one-liner classes ('c... | gpl-2.0 |
l33tdaima/l33tdaima | unindexed/challenge_apr_20/string_shift.py | 1 | 1070 | from typing import List
from functools import reduce
class Solution:
def stringShift(self, s: str, shift: List[List[int]]) -> str:
# shift right is negative, shift left is positive
netshift = reduce(
lambda x, y: x - y[1] if y[0] else x + y[1], shift, 0
) % len(s)
# or ... | mit |
gevorgmo/praxis-granite-119520 | src/base/models_test.py | 9 | 1150 | # Copyright 2014 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 ... | apache-2.0 |
Pexego/odoo | addons/note_pad/note_pad.py | 441 | 1301 | # -*- 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 |
HarmonyEnterpriseSolutions/toolib | toolib/event/Event.py | 2 | 1923 | ###############################################################################
# Program: toolib.event
'''
'''
__author__ = "Oleg Noga"
__date__ = "$Date: 2010/03/03 15:05:36 $"
__version__ = "$Revision: 1.10 $"
# $Source: D:/HOME/cvs/toolib/event/Event.py,v $
#########################################################... | gpl-2.0 |
petrutlucian94/nova | nova/objects/security_group_rule.py | 9 | 4083 | # Copyright 2013 Red Hat, 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 a... | apache-2.0 |
gylian/sickbeard | lib/imdb/linguistics.py | 50 | 9220 | """
linguistics module (imdb package).
This module provides functions and data to handle in a smart way
languages and articles (in various languages) at the beginning of movie titles.
Copyright 2009-2012 Davide Alberani <da@erlug.linux.it>
2012 Alberto Malagoli <albemala AT gmail.com>
2009 H. Turg... | gpl-3.0 |
codedbyjay/django-deployment | deployment/bb.py | 1 | 1417 | from bitbucket.bitbucket import Bitbucket
from deployment.utils import red_text
def get_bitbucket():
from django.conf import settings as django_settings
from deployment.fabfile import get_config
username = get_config("bitbucket", "username")
client_key = get_config("bitbucket", "client_key")
clien... | gpl-3.0 |
WamanAvadhani/Rammbock | utest/test_networking.py | 3 | 10143 | from contextlib import contextmanager
from unittest import TestCase, main
import time
import socket
from threading import Timer, Semaphore
from Rammbock.networking import UDPServer, TCPServer, UDPClient, TCPClient, BufferedStream
from Rammbock.templates.containers import Protocol
from Rammbock.templates.primitives impo... | apache-2.0 |
daveferrara1/linkchecker | linkcheck/gui/logger.py | 7 | 2528 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2009-2014 Bastian Kleineidam
#
# 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 versi... | gpl-2.0 |
surligas/cs436-gnuradio | gnuradio-runtime/python/pmt/qa_pmt_to_python.py | 48 | 1554 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
jeromekelleher/server | tests/test_cli.py | 1 | 4483 | """
Tests the cli
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import argparse
import ga4gh.cli as cli
import ga4gh.protocol as protocol
import ga4gh.client as client
class TestNoInput(unittest.TestCase):
"""
Test the cli a... | apache-2.0 |
KiChjang/servo | tests/wpt/web-platform-tests/tools/ci/tc/tests/test_decision.py | 3 | 1978 | import mock
import pytest
from tools.ci.tc import decision
@pytest.mark.parametrize("run_jobs,tasks,expected", [
([], {"task-no-schedule-if": {}}, ["task-no-schedule-if"]),
([], {"task-schedule-if-no-run-job": {"schedule-if": {}}}, []),
(["job"],
{"job-present": {"schedule-if": {"run-job": ["other-j... | mpl-2.0 |
jean/sentry | src/sentry/south_migrations/0158_auto__add_unique_authidentity_auth_provider_user.py | 5 | 51983 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'AuthIdentity', fields ['auth_provider', 'user']
... | bsd-3-clause |
rdo-management/python-rdomanager-oscplugin | rdomanager_oscplugin/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py | 1 | 8888 | # Copyright 2015 Red Hat, 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 ... | apache-2.0 |
Baughn/hymmnoserver | common/lookup.py | 1 | 5527 | # -*- coding: utf-8 -*-
"""
Hymmnoserver module: common.lookup
Purpose
=======
Reads words from the database, applying class-inference and
structure-processing as required.
Legal
=====
All code, unless otherwise indicated, is original, and subject to the terms of
the GNU GPLv3 or, at your option, any later versi... | gpl-3.0 |
gvb/odoo | openerp/report/render/__init__.py | 381 | 1374 | # -*- 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 |
yjacolin/qgis-geoserver-plugin | src/geoserverexplorer/geoserver/wps.py | 2 | 1496 | import httplib2
from xml.etree.ElementTree import XML
from urlparse import urlparse
from geoserverexplorer.geoserver.pki import PKICatalog
class Wps():
def __init__(self, catalog):
self.catalog = catalog
self.url = catalog.gs_base_url + 'wps'
if isinstance(catalog, PKICatalog):
... | gpl-2.0 |
DJMelonz/basic-blog | django/contrib/gis/db/backends/oracle/compiler.py | 360 | 1756 | from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler
from django.db.backends.oracle import compiler
SQLCompiler = compiler.SQLCompiler
class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler):
pass
class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler):
def pla... | bsd-3-clause |
katrid/django | django/contrib/gis/db/models/sql/conversion.py | 308 | 2015 | """
This module holds simple classes to convert geospatial values from the
database.
"""
from django.contrib.gis.db.models.fields import GeoSelectFormatMixin
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.measure import Area, Distance
class BaseField(object):
empty_strings_allow... | bsd-3-clause |
rimbalinux/MSISDNArea | django/contrib/messages/storage/cookie.py | 12 | 6023 | from django.conf import settings
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.http import CompatCookie
from django.utils import simplejson as json
from django.utils.crypto import salted_hmac, constant_time_compare
class Message... | bsd-3-clause |
catapult-project/catapult-csm | telemetry/telemetry/core/android_action_runner_unittest.py | 3 | 3605 | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import decorators
from telemetry.internal.actions import action_runner as action_runner_module
from telemetry.testing import tab_test_case
c... | bsd-3-clause |
tdhopper/scikit-learn | sklearn/datasets/tests/test_mldata.py | 384 | 5221 | """Test functionality of mldata fetching utilities."""
import os
import shutil
import tempfile
import scipy as sp
from sklearn import datasets
from sklearn.datasets import mldata_filename, fetch_mldata
from sklearn.utils.testing import assert_in
from sklearn.utils.testing import assert_not_in
from sklearn.utils.test... | bsd-3-clause |
directactioneverywhere/server | airtable/test_airtable_to_mailing_list.py | 1 | 2570 | """Test airtable_to_mailing_list.py"""
from airtable_to_mailing_list import *
import unittest
class TestAirtableToMailinglist(unittest.TestCase):
def test_create_chapter_to_mailing_list(self):
chapters = [{"id": "one", "fields": {"Mailing List Email": "one@email.com"}},
{"id": "two"}]
... | gpl-3.0 |
jaggu303619/asylum-v2.0 | openerp/addons/lunch/report/order.py | 54 | 2573 | # -*- encoding: 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 G... | agpl-3.0 |
shyamalschandra/scikit-learn | sklearn/tests/test_base.py | 45 | 7049 | # Author: Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing impo... | bsd-3-clause |
shanot/imp | modules/misc/test/test_freely_jointed_chain.py | 2 | 3462 | import math
import random
import numpy as np
import IMP
import IMP.misc
import IMP.test
def _get_beta(N, b):
return 3. / (2. * N * b**2)
def _get_score(z, N, b):
beta = _get_beta(N, b)
return beta * z**2 + .5 * math.log(math.pi / (16. * beta**3 * z**4))
def _get_derv(z, N, b):
beta = _get_beta(N,... | gpl-3.0 |
borjam/exabgp | src/exabgp/cli/command.py | 3 | 3662 | import sys
import argparse
import os
from vyos.xml import kw
from vyos.util import call
from vyos.util import popen
def _nop(config, path):
order = path[0]
print(f'command {order} not implemented ({path})')
def _run(config, path):
order, more = path.split(' ', 1) if ' ' in path else (path, '')
com... | bsd-3-clause |
kmonsoor/python-for-android | python3-alpha/extra_modules/atom/token_store.py | 48 | 4029 | #!/usr/bin/python
#
# Copyright (C) 2008 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
#
# Unless required by applicable law ... | apache-2.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/sqlite3/__init__.py | 239 | 1037 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/__init__.py: the pysqlite2 package.
#
# Copyright (C) 2005 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 any damages
# arising f... | gpl-2.0 |
shivaenigma/pycoin | tests/cmds/ToolTest.py | 2 | 1357 | import os
import shlex
import sys
import tempfile
import unittest
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from pycoin.cmds import block, ku, msg, tx
DEFAULT_ENV = {
"PYCOIN_BTC_PROVIDERS": "blockchain.info blockexplorer.com",
"PATH": os.environ.get("PATH")
}
... | mit |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/scipy/linalg/matfuncs.py | 39 | 19939 | #
# Author: Travis Oliphant, March 2002
#
from __future__ import division, print_function, absolute_import
__all__ = ['expm','expm2','expm3','cosm','sinm','tanm','coshm','sinhm',
'tanhm','logm','funm','signm','sqrtm',
'expm_frechet', 'expm_cond', 'fractional_matrix_power']
from numpy import (In... | gpl-3.0 |
SSSD/sssd | src/tests/multihost/alltests/test_services.py | 1 | 6497 | """ Automation of sanity/services suite
:requirement: IDM-SSSD-REQ : Configuration and Service Management
:casecomponent: sssd
:subsystemteam: sst_idm_sssd
:upstream: yes
"""
from __future__ import print_function
import pytest
import paramiko
import re
from sssd.testlib.common.utils import sssdTools
from sssd.testlib.... | gpl-3.0 |
Scemoon/lpts | api/tests/pingpong/pingpong.py | 2 | 5436 | # -*- coding:utf-8 -*-
import os,sys
import re
import shutil
from autotest.client import test, utils
from autotest.client.shared import error
# lpt env set
from autotest.client.shared.settings import settings
try:
autodir = os.path.abspath(os.environ['AUTODIR'])
except KeyError:
autodir = settings.get_value('... | gpl-2.0 |
Kaisuke5/chainer | tests/chainer_tests/functions_tests/pooling_tests/test_max_pooling_2d.py | 12 | 3797 | import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
class TestMaxPooling2D(unittest.TestCase):
cover_all = False
de... | mit |
hubsaysnuaa/odoo | addons/document/__init__.py | 434 | 1128 | # -*- 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 |
persandstrom/home-assistant | homeassistant/components/switch/insteon.py | 1 | 2277 | """
Support for INSTEON dimmers via PowerLinc Modem.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.insteon/
"""
import asyncio
import logging
from homeassistant.components.insteon import InsteonEntity
from homeassistant.components.switch import... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.