repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
coodoing/piconv | chardet/big5prober.py | 2931 | 1684 | ######################## 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... | apache-2.0 |
beatrizjesus/my-first-blog | pasta/Lib/site-packages/django/dispatch/dispatcher.py | 66 | 12069 | import sys
import threading
import weakref
from django.utils.six.moves import range
if sys.version_info < (3, 4):
from .weakref_backports import WeakMethod
else:
from weakref import WeakMethod
def _make_id(target):
if hasattr(target, '__func__'):
return (id(target.__self__), id(target.__func__))... | mit |
lindsayad/sympy | sympy/polys/domains/tests/test_polynomialring.py | 99 | 3314 | """Tests for the PolynomialRing classes. """
from sympy.polys.domains import QQ, ZZ
from sympy.polys.polyerrors import ExactQuotientFailed, CoercionFailed, NotReversible
from sympy.abc import x, y
from sympy.utilities.pytest import raises
def test_build_order():
R = QQ.old_poly_ring(x, y, order=(("lex", x), ("... | bsd-3-clause |
minhphung171093/OpenERP_V8 | openerp/addons/mass_mailing/tests/test_mail.py | 388 | 1221 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
Cinntax/home-assistant | homeassistant/components/template/switch.py | 1 | 9058 | """Support for switches which integrates with other components."""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.switch import (
ENTITY_ID_FORMAT,
SwitchDevice,
PLATFORM_SCHEMA,
)
from homeassistant.const import (
ATTR_FRIENDLY_NAME,
... | apache-2.0 |
jamesthechamp/zamboni | mkt/comm/tests/test_utils_.py | 11 | 4275 | from django.core.files.uploadedfile import SimpleUploadedFile
import mock
from nose.tools import eq_
from mkt.comm.forms import CommAttachmentFormSet
from mkt.comm.tests.test_views import AttachmentManagementMixin
from mkt.comm.utils import create_comm_note
from mkt.constants import comm
from mkt.site.tests import Te... | bsd-3-clause |
kiyukuta/chainer | chainer/functions/normalization/batch_normalization.py | 4 | 16382 | import numpy
import chainer
from chainer import configuration
from chainer import cuda
from chainer import function
from chainer.utils import argument
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
def _as4darray(arr):
if arr.ndim == 0:
retu... | mit |
WillianPaiva/1flow | oneflow/core/tasks/reprocess.py | 1 | 4470 | # -*- coding: utf-8 -*-
u"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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... | agpl-3.0 |
beni55/augmented-traffic-control | atc/django-atc-api/setup.py | 16 | 2568 | #!/usr/bin/env python
#
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
#
... | bsd-3-clause |
uniteddiversity/mediadrop | mediadrop/lib/tests/xhtml_normalization_test.py | 7 | 2947 | # -*- coding: utf-8 -*-
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.... | gpl-3.0 |
jkonecny12/anaconda | pyanaconda/modules/storage/partitioning/automatic/automatic_interface.py | 6 | 2643 | #
# DBus interface for the auto partitioning module.
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# Thi... | gpl-2.0 |
gaddman/ansible | lib/ansible/modules/network/avi/avi_networksecuritypolicy.py | 31 | 4317 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
mlperf/training_results_v0.7 | Google/benchmarks/maskrcnn/implementations/maskrcnn-research-TF-tpu-v4-16/spatial_transform.py | 4 | 4912 | # Copyright 2018 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 |
Yonjuni/true-or-false | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## 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... | gpl-3.0 |
harlowja/networkx | networkx/algorithms/bipartite/redundancy.py | 45 | 3946 | # -*- coding: utf-8 -*-
"""Node redundancy for bipartite graphs."""
# Copyright (C) 2011 by
# Jordi Torrents <jtorrents@milnou.net>
# Aric Hagberg <hagberg@lanl.gov>
# All rights reserved.
# BSD license.
from __future__ import division
from itertools import combinations
from networkx import NetworkXErr... | bsd-3-clause |
Linutux/Gourmet | gourmet/plugins/unit_converter/convertGui.py | 1 | 7209 | import gourmet.convert as convert
import gtk
from gourmet.gglobals import *
from gourmet.gdebug import *
from gourmet.gtk_extras.cb_extras import *
import gourmet.GourmetRecipeManager
from gettext import gettext as _
import os
try:
current_path = os.path.split(os.path.join(os.getcwd(),__file__))[0]
except:
cur... | gpl-2.0 |
taktik/account-financial-tools | account_credit_control/wizard/credit_control_marker.py | 39 | 3469 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, Guewen Baconnier
# Copyright 2012-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publi... | agpl-3.0 |
kivarun/libvirt_metadata_api | test/test_arp.py | 2 | 2723 | import unittest
import utils
import mock
class ArpTestCase(unittest.TestCase):
def setUp(self):
self.linux_data = ('IP address HW type Flags HW address Mask Device\n'
'192.168.0.94 0x1 0x2 aa:aa:aa:aa:aa:aa * br0\n'
... | gpl-3.0 |
capriele/crazyflie-clients-python-move | build/lib.linux-i686-2.7/cfclient/utils/singleton.py | 31 | 1499 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
patrickm/chromium.src | chrome/common/extensions/docs/server2/patch_servlet_test.py | 3 | 6647 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from HTMLParser import HTMLParser
import unittest
from fake_fetchers import ConfigureFakeFetchers
from github_file_system_provider imp... | bsd-3-clause |
tbonza/GatherNews | build/lib/gathernews/parse.py | 1 | 2192 | """ Handle parsing the RSS feed. """
from datetime import datetime
import logging
import re
import feedparser
from gathernews.template import ITEM
logger = logging.getLogger(__name__)
def get_source(fp: feedparser.FeedParserDict()) -> str:
try:
return fp['feed']['title_detail']['base']
except Exce... | mit |
martinjina/git-repo | subcmds/rebase.py | 48 | 4130 | #
# Copyright (C) 2010 The Android Open Source Project
#
# 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 la... | apache-2.0 |
rajashreer7/autotest-client-tests | linux-tools/nscd/nscd.py | 3 | 1545 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error, software_manager
sm = software_manager.SoftwareManager()
class nscd(test.test):
"""
Autotest module for testing basic functionality
of nscd
@author
"""
version = 1
... | gpl-2.0 |
syci/OCB | addons/subscription/subscription.py | 26 | 7939 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# TODO:
# Error treatment: exception, request, ... -> send request to user_id
import time
from openerp.osv import fields,osv
from openerp.tools.translate import _
from openerp.exceptions import UserError
class subscr... | agpl-3.0 |
tensorflow/models | official/vision/beta/projects/deepmac_maskrcnn/configs/deep_mask_head_rcnn_config_test.py | 1 | 1045 | # Copyright 2021 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 |
gautam1858/tensorflow | tensorflow/python/kernel_tests/boosted_trees/quantile_ops_test.py | 4 | 9790 | # 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 |
TomBaxter/osf.io | addons/figshare/tests/test_views.py | 23 | 2142 | #!/usr/bin/env python
# encoding: utf-8
import httplib as http
import mock
from nose.tools import assert_equal
import pytest
from addons.base.tests.views import (
OAuthAddonAuthViewsTestCaseMixin, OAuthAddonConfigViewsTestCaseMixin
)
from addons.figshare.tests.utils import FigshareAddonTestCase
from tests.base im... | apache-2.0 |
dwoods/gn-maps | geonode/search/templatetags/search_tags.py | 8 | 1188 | from django import template
register = template.Library()
def raw(parser, token):
# Whatever is between {% raw %} and {% endraw %} will be preserved as
# raw, unrendered template code.
text = []
parse_until = 'endraw'
tag_mapping = {
template.TOKEN_TEXT: ('', ''),
template.TOKEN_VA... | gpl-3.0 |
grimreaper/wolfbot-new | modules/common.py | 2 | 7663 | # The bot commands implemented in here are present no matter which module is loaded
import botconfig
from tools import decorators
import logging
import tools.moduleloader as ld
import traceback
from settings import common as var
from base64 import b64encode
import imp
import sys
import os
def on_privmsg(cli, rawnick,... | bsd-2-clause |
13W/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/encoder.py | 484 | 25695 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
jessstrap/servotk | tests/wpt/web-platform-tests/old-tests/webdriver/navigation/auth_tests.py | 141 | 1389 | import os
import sys
import unittest
import ConfigParser
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
from wptserve import server
from wptserve.router import any_method
from wptserve.handlers import basic_auth_handler
class WebDriverAuthT... | mpl-2.0 |
SavageLearning/Machete | Machete.Util/python/employer_combined.py | 2 | 8342 | import collections
import ConfigParser
import smtplib
import string
from datetime import datetime
import MySQLdb
import requests
DEBUG = True
if DEBUG:
import pprint
NOT_A_FIELD = -1000
fields = {
NOT_A_FIELD: 'sid',
2: 'business',
3: 'name',
4: 'address1',
5: 'address2',
6: 'city',
... | gpl-3.0 |
mitya57/django | tests/admin_docs/models.py | 244 | 1941 | """
Models for testing various aspects of the djang.contrib.admindocs app
"""
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=200)
class Group(models.Model):
name = models.CharField(max_length=200)
class Family(models.Model):
last_name = models.CharField(m... | bsd-3-clause |
TeamExodus/external_chromium_org | third_party/markupsafe/__init__.py | 371 | 8205 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
from markupsafe._compat import text_type, string_types, int_types, \
unichr, PY2
__all__ = ['Markup', 'soft_unicod... | bsd-3-clause |
tuhangdi/django | django/db/models/manager.py | 301 | 10722 | import copy
import inspect
from importlib import import_module
from django.db import router
from django.db.models.query import QuerySet
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
def ensure_default_manager(cls):
"""
Ensures that a Model subclass contains a defa... | bsd-3-clause |
replicatorg/ReplicatorG | skein_engines/skeinforge-50/fabmetheus_utilities/svg_reader.py | 12 | 38714 | """
Svg reader.
"""
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.solids import triangle_mesh
from fabmetheus_util... | gpl-2.0 |
raqqun/tweetcommander | packages/oauthlib/oauth2/ext/django.py | 1 | 5068 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
import functools
import logging
from oauthlib.common import urlencode
from oauthlib.oauth2.draft25 impor... | gpl-3.0 |
MziRintu/kitsune | kitsune/kbforums/feeds.py | 17 | 2176 | from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import Atom1Feed
from django.utils.html import strip_tags, escape
from tower import ugettext as _
from kitsune import forums as constants
from kitsune.kbforums.models import Thread
from kit... | bsd-3-clause |
pgmillon/ansible | lib/ansible/module_utils/network/checkpoint/checkpoint.py | 2 | 9275 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
asadziach/tensorflow | tensorflow/python/framework/test_util_test.py | 10 | 9697 | # Copyright 2015 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 |
ken-saka/docker-registry | scripts/diff-worker.py | 35 | 3389 | #!/usr/bin/env python
import argparse # noqa
import logging
import os
import redis
from docker_registry.lib import layers
from docker_registry.lib import rlock
from docker_registry.lib import rqueue
import docker_registry.storage as storage
store = storage.load()
redis_default_host = os.environ.get(
'DOCKER_... | apache-2.0 |
SEMAFORInformatik/femagtools | examples/model-creation/stator1-magnetIronV.py | 1 | 1583 | import femagtools
def create_fsl():
machine = dict(
name="PM 130 L4",
lfe=0.1,
poles=4,
outer_diam=0.13,
bore_diam=0.07,
inner_diam=0.015,
airgap=0.001,
stator=dict(
num_slots=12,
stator1=dict(
slot_rf1=0.057,... | bsd-2-clause |
Kalyzee/edx-platform | lms/djangoapps/edxnotes/views.py | 72 | 3809 | """
Views related to EdxNotes.
"""
import json
import logging
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseBadRequest, Http404
from django.conf import settings
from django.core.urlresolvers import reverse
from edxmako.shortcuts import render_to_response
fro... | agpl-3.0 |
lseyesl/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py | 119 | 29255 | # Copyright (c) 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 of conditions and the ... | bsd-3-clause |
AkA84/edx-platform | lms/djangoapps/certificates/migrations/0016_change_course_key_fields.py | 103 | 6642 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'GeneratedCertificate.course_id'
db.alter_column('certificates_generatedcertificate', 'cou... | agpl-3.0 |
Erotemic/ibeis | ibeis/algo/graph/tests/test_graph_iden.py | 1 | 5170 | import utool as ut
from ibeis.algo.graph import demo
from ibeis.algo.graph.state import (POSTV, NEGTV, INCMP, UNREV)
def test_incomp_inference():
infr = demo.demodata_infr(num_pccs=0)
# Make 2 consistent and 2 inconsistent CCs
infr.add_feedback(( 1, 2), POSTV)
infr.add_feedback(( 2, 3), POSTV)
i... | apache-2.0 |
ZhaoYonggang198/xpdiff | default_visitor.py | 1 | 1875 | try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
def element_to_string(element):
return ET.tostring(element).replace("\r", "").replace("\n", "").replace("\t", "")
class StdVisitor:
def out(self, path, op, content):
print("\t\t\t".join(["".join([e.tag for e in... | gpl-2.0 |
sauloal/pycluster | pypy-1.9_64/lib-python/2.7/dummy_threading.py | 321 | 2804 | """Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported. Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``thread`` wa... | mit |
40223119/2015w11 | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/colordict.py | 621 | 24077 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | gpl-3.0 |
bluven/eonboard | eoncloud_web/biz/idc/models.py | 4 | 2462 | # -*- encoding:utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
class DataCenter(models.Model):
"""
A data center is a mapper to backend openstack cluster
the config of project/user/password is for cloud-web api
to create project and user
"""
id ... | apache-2.0 |
tyb0807/angr | angr/analyses/datagraph_meta.py | 1 | 3365 |
import logging
from ..sim_procedure import SimProcedure
l = logging.getLogger("angr.analyses.datagraph_meta")
class DataGraphMeta(object):
def __init__(self):
self._p = None
def _irsb(self, in_state):
"""
We expect a VSA state here.
"""
return self._p.factory.success... | bsd-2-clause |
mxjl620/scikit-learn | examples/ensemble/plot_ensemble_oob.py | 259 | 3265 | """
=============================
OOB Errors for Random Forests
=============================
The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where
each new tree is fit from a bootstrap sample of the training observations
:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average er... | bsd-3-clause |
ganeshnalawade/ansible | test/support/windows-integration/plugins/modules/win_whoami.py | 68 | 5621 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
avedaee/DIRAC | DataManagementSystem/DB/TransferDB.py | 2 | 71822 | ########################################################################
# $HeadURL$
# File: TransferDB.py
########################################################################
""" :mod: TransferDB
================
TransferDB is a front end to the TransferDB mysql database, built
on top of RequestDB.
... | gpl-3.0 |
soldag/home-assistant | tests/components/mqtt/test_alarm_control_panel.py | 4 | 24043 | """The tests the MQTT alarm control panel component."""
import copy
import json
import pytest
from homeassistant.components import alarm_control_panel
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_A... | apache-2.0 |
navtejsingh/pychimera | scripts/reduce.py | 2 | 6009 | #!/usr/bin/env python
"""
--------------------------------------------------------------------------
Routine to reduce raw science images from CHIMERA instrument.
Usage: python reduce.py [options] image
Author:
Navtej Saini
Organization:
... | bsd-3-clause |
repotvsupertuga/repo | plugin.video.exodus/resources/lib/modules/cache.py | 12 | 3662 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 3 of the License, or
(at your option) any l... | gpl-2.0 |
Red-M/CloudBot | cloudbot/config.py | 30 | 3100 | import json
import os
import time
import sys
import logging
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
import cloudbot
logger = logging.getLogger("cloudbot")
class Config(dict):
"""
:type filename: str
:type path: str
:type bot: cloudbot.bot.Clou... | gpl-3.0 |
hojel/epubia | scraper/naver_scraper.py | 3 | 3343 | # -*- encoding: utf-8 -*-
# Book Info using Naver OpenAPI
import urllib
from xml.dom.minidom import parseString
import re
MARKUP_PTN = re.compile(r'</?[a-z]+>')
class book_scraper:
key = '' # my key
srch_url = 'http://openapi.naver.com/search?key={0:s}&query={1:s}&display=1&target=book'
is... | mit |
sameerparekh/pants | tests/python/pants_test/python/test_python_run_integration.py | 8 | 2582 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import pytest
from ... | apache-2.0 |
Spleen64/Sick-Beard | sickbeard/clients/requests/packages/urllib3/contrib/ntlmpool.py | 262 | 4740 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... | gpl-3.0 |
timgraham/django-cms | cms/utils/__init__.py | 1 | 3222 | # -*- coding: utf-8 -*-
# TODO: this is just stuff from utils.py - should be splitted / moved
from django.conf import settings
from django.core.files.storage import get_storage_class
from django.utils.functional import LazyObject
from cms import constants
from cms.utils.conf import get_cms_setting
from cms.utils.conf ... | bsd-3-clause |
eyesnears/ardupilot | Tools/autotest/pysim/util.py | 129 | 13700 | import math
from math import sqrt, acos, cos, pi, sin, atan2
import os, sys, time, random
from rotmat import Vector3, Matrix3
from subprocess import call, check_call,Popen, PIPE
def m2ft(x):
'''meters to feet'''
return float(x) / 0.3048
def ft2m(x):
'''feet to meters'''
return float(x) * 0.3048
def k... | gpl-3.0 |
Avanish14/SmartModem | AMrx.py | 1 | 3114 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Amrx
# Generated: Tue Aug 8 20:51:18 2017
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import eng_notatio... | mit |
flgiordano/netcash | +/google-cloud-sdk/lib/surface/bigtable/clusters/create.py | 1 | 2807 | # Copyright 2015 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 ag... | bsd-3-clause |
yannickcr/Sick-Beard | sickbeard/clients/requests/utils.py | 204 | 17497 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import os
import platform
import re
import sys
import zlib
from netrc import netrc, NetrcParseError
from . impor... | gpl-3.0 |
Drooids/odoo | addons/base_import/test_models.py | 399 | 2289 | from openerp.osv import orm, fields
def name(n): return 'base_import.tests.models.%s' % n
class char(orm.Model):
_name = name('char')
_columns = {
'value': fields.char('unknown')
}
class char_required(orm.Model):
_name = name('char.required')
_columns = {
'value': fields.char('u... | agpl-3.0 |
PeterWangIntel/chromium-crosswalk | build/android/pylib/chrome_test_server_spawner.py | 52 | 15678 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A "Test Server Spawner" that handles killing/stopping per-test test servers.
It's used to accept requests from the device to spawn and kill instances of ... | bsd-3-clause |
kybriainfotech/iSocioCRM | addons/product/_common.py | 316 | 1448 | # -*- 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... | agpl-3.0 |
unomena/django-photologue | photologue/management/commands/plcache.py | 25 | 1406 | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from photologue.models import PhotoSize, ImageModel
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--reset', '-r', action='store_true', dest='reset', help='Reset phot... | bsd-3-clause |
shellderp/sublime-robot-plugin | lib/robot/utils/asserts.py | 4 | 9599 | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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 |
NeCTAR-RC/neutron | neutron/plugins/sriovnicagent/sriov_nic_agent.py | 2 | 14524 | # Copyright 2014 Mellanox Technologies, 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 t... | apache-2.0 |
40223244/cdb-1 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py | 824 | 12612 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
from . import handler
from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReade... | gpl-3.0 |
dawnpower/nova | nova/db/sqlalchemy/migrate_repo/versions/227_fix_project_user_quotas_resource_length.py | 52 | 1528 | # Copyright 2013 NEC Corporation
#
# 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 ag... | apache-2.0 |
cristiana214/cristianachavez214-cristianachavez | python/gdata/tests/gdata_tests/auth_test.py | 126 | 26859 | #!/usr/bin/env python
#
# Copyright (C) 2007, 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 require... | apache-2.0 |
JamesShaeffer/QGIS | python/plugins/processing/algs/gdal/polygonize.py | 15 | 5397 | # -*- coding: utf-8 -*-
"""
***************************************************************************
polygonize.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... | gpl-2.0 |
pfnet/chainer | examples/wavenet/train.py | 6 | 5955 | import argparse
import os
import pathlib
import warnings
import numpy
import chainer
from chainer.training import extensions
import chainerx
from net import EncoderDecoderModel
from net import UpsampleNet
from net import WaveNet
from utils import Preprocess
import matplotlib
matplotlib.use('Agg')
parser = argpars... | mit |
R-bob/R-bob.github.io | ardupilot-ArduCopter-3.2.1/Tools/LogAnalyzer/tests/TestBrownout.py | 74 | 1401 | from LogAnalyzer import Test,TestResult
import DataflashLog
import collections
class TestBrownout(Test):
'''test for a log that has been truncated in flight'''
def __init__(self):
Test.__init__(self)
self.name = "Brownout"
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = T... | gpl-2.0 |
borysf/SublimeGerrit | core/change_view.py | 1 | 35778 | """
SublimeGerrit - full-featured Gerrit Code Review for Sublime Text
Copyright (C) 2015 Borys Forytarz <borys.forytarz@gmail.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 version 2
of... | gpl-2.0 |
ionelmc/sphinx-py3doc-enhanced-theme | ci/bootstrap.py | 12 | 2886 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import os
import subprocess
import sys
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
base_pat... | bsd-2-clause |
trafi/djinni | test-suite/generated-src/python/foo_primitives.py | 1 | 7411 | # AUTOGENERATED FILE - DO NOT MODIFY!
# This file generated by Djinni from foo_primitives.djinni
from djinni.support import MultiSet # default imported in all files
from djinni.exception import CPyException # default imported in all files
from djinni.pycffi_marshal import CPyBinary, CPyDate, CPyPrimitive, CPyString
f... | apache-2.0 |
saashimi/code_guild | wk1/scripts/compress/compressor.py | 2 | 3164 |
def groupby_char(lst):
"""Returns a list of strings containing identical characters.
Takes a list of characters produced by running split on a string.
Groups runs (in order sequences) of identical
characters into string elements in the list.
Parameters
---------
Input:
ls... | mit |
Perferom/android_external_chromium_org | chrome/common/extensions/docs/server2/permissions_data_source.py | 23 | 3485 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from itertools import ifilter
from operator import itemgetter
from data_source import DataSource
from extensions_paths import PRIVATE_TEMPLATES
import featu... | bsd-3-clause |
lewisodriscoll/sasview | src/examples/test_copy_print.py | 3 | 3324 | """
Test application that uses plottools
An application required by the REFL group and mainly test copy and print.
The following is a checklist of functionality to look for while testing:
1- Start the application:
the graph should have theory curve, experimental data, chisq
with a white background.
2- Hove... | bsd-3-clause |
lanbing510/GTDWeb | django/views/generic/detail.py | 103 | 6696 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
class SingleObjectMixin(Conte... | gpl-2.0 |
3quarterstack/simple_blog | django/contrib/auth/tests/__init__.py | 101 | 1191 | from django.contrib.auth.tests.custom_user import *
from django.contrib.auth.tests.auth_backends import *
from django.contrib.auth.tests.basic import *
from django.contrib.auth.tests.context_processors import *
from django.contrib.auth.tests.decorators import *
from django.contrib.auth.tests.forms import *
from django.... | mit |
reeshupatel/demo | keystone/contrib/admin_crud/core.py | 13 | 8493 | # Copyright 2012 OpenStack Foundation
#
# 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... | apache-2.0 |
lduarte1991/edx-platform | openedx/core/djangoapps/content/block_structure/block_structure.py | 1 | 30213 | """
Module with family of classes for block structures.
BlockStructure - responsible for block existence and relations.
BlockStructureBlockData - responsible for block & transformer data.
BlockStructureModulestoreData - responsible for xBlock data.
The following internal data structures are implemented:
... | agpl-3.0 |
djtaylor/cloudscape-DEPRECATED | python/cloudscape/engine/api/app/formula/models.py | 2 | 4396 | import json
from django.db import models
class DBFormulaTemplates(models.Model):
"""
Database model for storing formula templates.
"""
# Formula template columns
formula = models.ForeignKey('formula.DBFormulaDetails', to_field='uuid', db_column='formula')
template_name = models.CharF... | gpl-3.0 |
mattclark/osf.io | addons/base/apps.py | 14 | 5534 | import os
import glob
import mimetypes
from django.apps import AppConfig
from mako.lookup import TemplateLookup
from framework.routing import process_rules
from framework.flask import app
from website import settings
from website.util import rubeus
def _is_image(filename):
mtype, _ = mimetypes.guess_type(filena... | apache-2.0 |
udoprog/ontv | ontv/__init__.py | 1 | 9501 | import os
import argparse
import logging
import blessings
import random
import contextlib
import shutil
import datetime
import sys
from .api import TheTVDBApi
from .action.sync import setup as sync_setup, action as sync_action
from .action.search import setup as search_setup
from .action.add import setup as add_setup
... | gpl-3.0 |
achang97/YouTunes | lib/python2.7/site-packages/pyasn1_modules/rfc2459.py | 12 | 49428 | #
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
# X.509 message syntax
#
# ASN.1 source from:
# http://www.trl.ibm.com/projects/xml/xss4j/data/asn1/grammars/x509.asn
# http://www.ietf.org/rfc/rfc2459.txt
#
# S... | mit |
cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/python/lib/python3.3/encodings/iso2022_jp_1.py | 816 | 1061 | #
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_1')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | gpl-3.0 |
uclouvain/osis | webservices/tests/api/serializers/test_auth_token.py | 2 | 2694 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
Limezero/libreoffice | wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py | 6 | 14523 | #
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license noti... | gpl-3.0 |
msmolens/VTK | ThirdParty/Twisted/twisted/test/test_strerror.py | 40 | 5187 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test strerror
"""
import socket
import os
from twisted.trial.unittest import TestCase
from twisted.internet.tcp import ECONNABORTED
from twisted.python.win32 import _ErrorFormatter, formatError
from twisted.python.runtime import platform
c... | bsd-3-clause |
partofthething/home-assistant | homeassistant/components/netgear_lte/binary_sensor.py | 14 | 1321 | """Support for Netgear LTE binary sensors."""
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.exceptions import PlatformNotReady
from . import CONF_MONITORED_CONDITIONS, DATA_KEY, LTEEntity
from .sensor_types import BINARY_SENSOR_CLASSES
async def async_setup_platform... | mit |
MisterRios/python_koans | python3/koans/about_method_bindings.py | 3 | 2842 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
def function():
return "pineapple"
def function2():
return "tractor"
class Class:
def method(self):
return "parrot"
class AboutMethodBindings(Koan):
def test_methods_are_bound_to_an_object(self):
obj = Class()
... | mit |
aktech/sympy | sympy/geometry/tests/test_plane.py | 22 | 6944 | from __future__ import division
from sympy import Dummy, S, Symbol, pi, sqrt, asin
from sympy.geometry import Line, Point, Ray, Segment, Point3D, Line3D, Ray3D, Segment3D, Plane
from sympy.geometry.util import are_coplanar
from sympy.utilities.pytest import raises, slow
@slow
def test_plane():
x = Symbol('x', re... | bsd-3-clause |
chirilo/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/executive_mock.py | 117 | 7106 | # Copyright (C) 2011 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... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.