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 |
|---|---|---|---|---|---|
AndrewGrossman/django | tests/gis_tests/geoapp/tests.py | 189 | 41436 | from __future__ import unicode_literals
import re
import tempfile
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union
from django.contrib.gis.geos import (
GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon,
fromstr,
)
from django.core.man... | bsd-3-clause |
brendandahl/servo | tests/wpt/css-tests/tools/html5lib/html5lib/filters/optionaltags.py | 1727 | 10500 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2... | mpl-2.0 |
drtuxwang/system-config | bin/fpeek.py | 1 | 4731 | #!/usr/bin/env python3
"""
Dump the first and last few bytes of a binary file.
"""
import argparse
import glob
import os
import signal
import sys
from typing import List
import file_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
... | gpl-2.0 |
b-cuts/airflow | airflow/operators/mysql_operator.py | 14 | 1063 | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... | apache-2.0 |
benjaminbrinkman/open-ad-platform | .venv/lib/python3.4/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py | 80 | 14980 | # sqlite/pysqlite.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite+pysqlite
:name: pysqlite
:dbapi: sqlite3
:con... | mit |
slevenhagen/odoo-npg | addons/payment/tests/common.py | 392 | 1822 | # -*- coding: utf-8 -*-
from openerp.tests import common
class PaymentAcquirerCommon(common.TransactionCase):
def setUp(self):
super(PaymentAcquirerCommon, self).setUp()
self.payment_acquirer = self.registry('payment.acquirer')
self.payment_transaction = self.registry('payment.transactio... | agpl-3.0 |
flohorovicic/pynoddy | pynoddy/experiment/uncertainty_analysis_bak.py | 1 | 12689 | import sys, os
import pynoddy
from pynoddy.experiment.monte_carlo import MonteCarlo
from pynoddy.output import NoddyOutput
import numpy as np
import math
class UncertaintyAnalysis(MonteCarlo):
"""Perform uncertainty analysis experiments for kinematic models
"""
def __init__(self, history, parameters, ... | gpl-2.0 |
Kalyzee/edx-platform | common/djangoapps/embargo/tests/test_forms.py | 132 | 4829 | # -*- coding: utf-8 -*-
"""
Unit tests for embargo app admin forms.
"""
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
# Explicitly import the cache from ConfigurationModel so we can reset it after each test
from config_models.models import cache
from embargo.models import IPFilte... | agpl-3.0 |
pypingou/pagure | alembic/versions/d4d2c5aa8a0_add_granularity_to_watching_repos.py | 1 | 2377 | """Add granularity to watching repos
Revision ID: d4d2c5aa8a0
Revises: 4255158a6913
Create Date: 2017-04-28 14:39:09.746953
"""
# revision identifiers, used by Alembic.
revision = 'd4d2c5aa8a0'
down_revision = '4255158a6913'
from alembic import op
import sqlalchemy as sa
# A helper table that is a hybrid with both... | gpl-2.0 |
hosseinmh/Django_learning | djmod/.venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py | 326 | 6536 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def ... | mit |
aurora-pro/apex-sigma | sigma/plugins/moderation/punish/textmute.py | 2 | 2873 | import arrow
import discord
from sigma.core.permission import check_man_msg, check_admin
from sigma.core.utils import user_avatar
async def textmute(cmd, message, args):
if not check_man_msg(message.author, message.channel):
response = discord.Embed(title='⛔ Unpermitted. Manage Messages Permission Needed.... | gpl-3.0 |
isc-projects/forge | tests/dhcpv6/classification/test_v6_classification_request.py | 1 | 13338 | """DHCPv6 Client Classification request process"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_control
import srv_msg
import misc
@pytest.mark.v6
@pytest.mark.kea_only
@pytest.mark.classification
def test_v6_client_classification_onesubnet_advertise_success():
misc.test_setup()
s... | isc |
TennyZhuang/alfred-workflow-thu | src/lib/markupsafe/_constants.py | 1535 | 4795 | # -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 1... | mit |
diorcety/intellij-community | plugins/hg4idea/testData/bin/mercurial/hook.py | 93 | 7881 | # hook.py - hook support for mercurial
#
# Copyright 2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import os, sys, time, types
import extensions, util, demandimport
def _py... | apache-2.0 |
philanthropy-u/edx-platform | lms/djangoapps/bulk_email/migrations/0001_initial.py | 14 | 2989 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
from opaque_keys.edx.django.models import CourseKeyField
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MO... | agpl-3.0 |
jgbarah/GrimoireLib | vizgrimoire/analysis/companies_activity.py | 3 | 19424 | #!/usr/bin/env python
# Copyright (C) 2014 Bitergia
#
# 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 later version.
#
# This program... | gpl-3.0 |
icaicai/scoop | examples/sum_multiples.py | 5 | 1359 | #
# This file is part of Scalable COncurrent Operations in Python (SCOOP).
#
# SCOOP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option)... | lgpl-3.0 |
grantvk/aima-python | submissions/Fritz/c4-11-28/GUI.py | 10 | 7839 | from tkinter import *
import ConnectFour
from ConnectFour import C4Game
from random import randint
import games
g = C4Game
# class GameState:
# def __init__(self, to_move, board, label=None, depth=8):
# self.to_move= to_move
# self.board = board
# self.label = label
# self.maxDepth... | mit |
wangming28/syzygy | syzygy/scripts/benchmark/zip_http_server.py | 8 | 3920 | #!python
# Copyright 2012 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... | apache-2.0 |
awkspace/ansible | lib/ansible/modules/notification/bearychat.py | 52 | 5908 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jiangge Zhang <tonyseek@gmail.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 Li... | gpl-3.0 |
Sorsly/subtle | google-cloud-sdk/lib/surface/functions/delete.py | 3 | 2542 | # 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... | mit |
h2oai/h2o | py/testdir_single_jvm/test_summary2_NY0.py | 9 | 4827 | import unittest, time, sys, random, math, getpass
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_util, h2o_print as h2p
def write_syn_dataset(csvPathname, rowCount, colCount, SEED, choices):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
naCnt = [0 for j in ra... | apache-2.0 |
Sannis/tarantool | doc/sphinx/ext/lua.py | 8 | 30798 | # 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 following disclaimer.
#
# * Redistributions in binary form... | bsd-2-clause |
probml/pyprobml | scripts/rvm_regressor.py | 1 | 3330 | """
code taken from
https://github.com/ctgk/PRML/blob/master/prml/kernel/relevance_vector_regressor.py
"""
import numpy as np
class RelevanceVectorRegressor(object):
def __init__(self, kernel, alpha=1., beta=1.):
"""
construct relevance vector regressor
Parameters
----------
... | mit |
darius/tailbiter | compiler.py | 1 | 18674 | import ast, collections, dis, types, sys
from functools import reduce
from itertools import chain
from check_subset import check_conformity
def assemble(assembly):
return bytes(iter(assembly.encode(0, dict(assembly.resolve(0)))))
def plumb_depths(assembly):
depths = [0]
assembly.plumb(depths)
return m... | mit |
40323230/Pyslvs-PyQt5 | pyslvs_ui/entities/edit_point_ui.py | 1 | 9330 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyslvs_ui/entities/edit_point.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from qtp... | agpl-3.0 |
blademainer/intellij-community | python/lib/Lib/site-packages/django/contrib/admin/views/decorators.py | 78 | 1458 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django import template
from django.shortcuts import render_to_response
from django.utils.translation import ugettext as _
from django.contrib.admin.forms import AdminAuthenticationForm
f... | apache-2.0 |
kakunbsc/bb | lib/bb/runqueue.py | 5 | 44605 | #!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'RunQueue' implementation
Handles preparation and execution of a queue of tasks
"""
# Copyright (C) 2006-2007 Richard Purdie
#
# This program is free software; you can redistribute it and/or mod... | gpl-2.0 |
laurmurclar/mitmproxy | mitmproxy/proxy/protocol/base.py | 2 | 6120 | from mitmproxy import exceptions
from mitmproxy import connections
class _LayerCodeCompletion:
"""
Dummy class that provides type hinting in PyCharm, which simplifies development a lot.
"""
def __init__(self, **mixin_args): # pragma: no cover
super().__init__(**mixin_args)
if True:
... | mit |
mjuenema/python-TSIP | tests/test_structs.py | 1 | 1799 | from struct import Struct
from nose.tools import raises
from tsip import *
def test_endianess():
for (key, value) in PACKET_STRUCTURES.items():
for struct_ in value:
try:
assert struct_.format[0] == '>' or struct_.format[0] == 62 # Python 2 / Python 3
except Att... | bsd-2-clause |
shhui/nova | nova/openstack/common/network_utils.py | 57 | 2690 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation.
# 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.apac... | apache-2.0 |
BaconPancakes/valor | lib/pip/_vendor/requests/packages/urllib3/exceptions.py | 515 | 5599 | from __future__ import absolute_import
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(se... | gpl-3.0 |
ppanczyk/ansible | lib/ansible/modules/network/dellos6/dellos6_config.py | 23 | 9791 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2016 Dell Inc.
# 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_versio... | gpl-3.0 |
bussiere/pypyjs | website/demo/home/rfk/repos/pypy/lib_pypy/cffi/_pycparser/lextab.py | 4 | 7021 | # pycparser.lextab.py. This file automatically created by PLY (version 3.4). Don't edit!
_tabversion = '3.4'
_lextokens = {'VOID': 1, 'LBRACKET': 1, 'WCHAR_CONST': 1, 'FLOAT_CONST': 1, 'MINUS': 1, 'RPAREN': 1, 'LONG': 1, 'PLUS': 1, 'ELLIPSIS': 1, 'GT': 1, 'GOTO': 1, 'ENUM': 1, 'PERIOD': 1, 'GE': 1, 'INT_CONST_DEC'... | mit |
codemac/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/base.py | 293 | 1831 | import base64
import logging
import os
import unittest
import urllib
import urllib2
import urlparse
import wptserve
logging.basicConfig()
here = os.path.split(__file__)[0]
doc_root = os.path.join(here, "docroot")
class Request(urllib2.Request):
def __init__(self, *args, **kwargs):
urllib2.Request.__init... | mpl-2.0 |
trabacus-softapps/openerp-8.0-cc | openerp/addons/gamification/models/challenge.py | 1 | 39300 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
bleib1dj/boto | boto/support/__init__.py | 145 | 1652 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
jhawkesworth/ansible | lib/ansible/modules/storage/purestorage/purefb_s3user.py | 15 | 6451 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# 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',... | gpl-3.0 |
guilherme-pg/citationhunt | handlers/stats.py | 2 | 6320 | import flask
import chdb
import utils
from .common import *
import datetime
import os
import json
import re
import itertools
crawler_user_agents_regexps = [
re.compile(obj['pattern'], re.IGNORECASE)
for obj in json.load(
open(os.path.join(os.path.dirname(__file__),
'crawler-user-agents', ... | mit |
ravindrapanda/tensorflow | tensorflow/contrib/training/python/training/bucket_ops.py | 48 | 18717 | # 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 |
shabiel/VistA | Scripts/FOIAExcel2Csv.py | 5 | 4263 | #---------------------------------------------------------------------------
# Copyright 2014 The Open Source Electronic Health Record Agent
#
# 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
#
... | apache-2.0 |
silky/sms-tools | lectures/05-Sinusoidal-model/plots-code/synthesis-window-2.py | 22 | 2038 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import sys, os, functools, time
from scipy.fftpack import fft, ifft, fftshift
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DFT
import ... | agpl-3.0 |
burakbayramli/dersblog | sk/2019/07/test_rocket1.py | 2 | 1843 | from rocketlander import RocketLander
from constants import LEFT_GROUND_CONTACT, RIGHT_GROUND_CONTACT
import numpy as np
import pyglet
if __name__ == "__main__":
# Settings holds all the settings for the rocket lander environment.
settings = {'Side Engines': True,
'Clouds': True,
... | gpl-3.0 |
75651/kbengine_cloud | kbe/src/lib/python/Lib/tabnanny.py | 101 | 11399 | #! /usr/bin/env python3
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The... | lgpl-3.0 |
sdopoku/flask-hello-world | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/euckrfreq.py | 3121 | 45978 | ######################## 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-2.0 |
DuCorey/bokeh | sphinx/source/docs/user_guide/examples/extensions_example_latex.py | 5 | 2681 | """ The LaTex example was derived from: http://matplotlib.org/users/usetex.html
"""
import numpy as np
from bokeh.models import Label
from bokeh.plotting import figure, show
JS_CODE = """
import {Label, LabelView} from "models/annotations/label"
export class LatexLabelView extends LabelView
render: () ->
#--... | bsd-3-clause |
weimingtom/python-for-android | python3-alpha/python3-src/Tools/scripts/byext.py | 49 | 3917 | #! /usr/bin/env python3
"""Show file statistics by extension."""
import os
import sys
class Stats:
def __init__(self):
self.stats = {}
def statargs(self, args):
for arg in args:
if os.path.isdir(arg):
self.statdir(arg)
elif os.path.isfile(arg):
... | apache-2.0 |
amisrs/angular-flask | angular_flask/lib/python2.7/site-packages/jinja2/meta.py | 659 | 4190 | # -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... | mit |
spasovski/zamboni | migrations/503-gaia-device-type.py | 23 | 1455 | #!/usr/bin/env python
from celeryutils import task
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Count
import amo
from addons.models import AddonDeviceType as ADT
from amo.decorators import write
from amo.utils import chunked
@task
@write
def _task(**kw):
# Remove any dupes... | bsd-3-clause |
cyphactor/lifecyclemanager | testenv/trac-0.10.4/trac/db_default.py | 1 | 14164 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2006 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http... | gpl-3.0 |
swdream/neutron | neutron/tests/fullstack/resources/machine.py | 12 | 2713 | # 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 agre... | apache-2.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/IPython/core/tests/test_interactiveshell.py | 7 | 33042 | # -*- coding: utf-8 -*-
"""Tests for the key interactiveshell module.
Historically the main classes in interactiveshell have been under-tested. This
module should grow as many single-method tests as possible to trap many of the
recurring bugs we seem to encounter with high-level interaction.
"""
# Copyright (c) IPyt... | gpl-3.0 |
listyque/TACTIC-Handler | thlib/side/client/tactic_client_lib/tactic_server_stub.py | 1 | 158824 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
tchx84/sugar | src/jarabe/desktop/meshbox.py | 1 | 23416 | # Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2009 Tomeu Vizoso, Simon Schampijer
# Copyright (C) 2009-2010 One Laptop per Child
# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | gpl-2.0 |
ktan2020/legacy-automation | win/Lib/site-packages/robot/model/visitor.py | 2 | 1993 | # Copyright 2008-2013 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... | mit |
Lujeni/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py | 13 | 30979 | #!/usr/bin/python
# Copyright (c) 2017 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': ['pre... | gpl-3.0 |
chtq/gitbook-1.5.0 | gitbook/node_modules/npmi/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | apache-2.0 |
jeasoft/odoo | addons/claim_from_delivery/__init__.py | 374 | 1053 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
bensternthal/bedrock | bedrock/base/tests/test_urlresolvers.py | 26 | 6395 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, url
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from bedrock.base.urlresolvers import reverse, split_path, Prefixer
from mock import patch, ... | mpl-2.0 |
raoulbq/scipy | scipy/special/utils/convert.py | 77 | 5554 | # This script is used to parse BOOST special function test data into something
# we can easily import in numpy. It is ugly as hell, but it works.
from __future__ import division, print_function, absolute_import
import re
import os
from numpy import arccosh, log1p, expm1, arcsinh, arctanh
from scipy.special import dig... | bsd-3-clause |
edxzw/edx-platform | 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 |
syin2/RIOT | dist/tools/cc2538-bsl/cc2538-bsl.py | 48 | 44987 | #!/usr/bin/env python
# Copyright (c) 2014, Jelmer Tiete <jelmer@tiete.be>.
# 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
#... | lgpl-2.1 |
will-Do/virt-test | virttest/libvirt_xml/nwfilter_protocols/tcp_ipv6.py | 26 | 6593 | """
tcp-ipv6 protocl support class(es)
http://libvirt.org/formatnwfilter.html#nwfelemsRulesProtoTCP-ipv6
"""
from virttest.libvirt_xml import accessors, xcepts
from virttest.libvirt_xml.nwfilter_protocols import base
class Tcp_ipv6(base.TypedDeviceBase):
"""
Create new Tcp_ipv6 xml instances
Propertie... | gpl-2.0 |
whereismyjetpack/ansible | lib/ansible/plugins/action/debug.py | 54 | 3413 | # Copyright 2012, Dag Wieers <dag@wieers.com>
# Copyright 2016, Toshio Kuratomi <tkuratomi@ansible.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 versi... | gpl-3.0 |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/idlelib/idle_test/test_config_name.py | 93 | 2399 | """Unit tests for idlelib.configSectionNameDialog"""
import unittest
from idlelib.idle_test.mock_tk import Var, Mbox
from idlelib import configSectionNameDialog as name_dialog_module
name_dialog = name_dialog_module.GetCfgSectionNameDialog
class Dummy_name_dialog:
# Mock for testing the following methods of name_... | gpl-2.0 |
ONSdigital/ras-frontstage | tests/unit/test_account.py | 1 | 3398 | import unittest
from werkzeug.datastructures import ImmutableMultiDict
from frontstage.views.account.account import (
check_attribute_change,
create_success_message,
)
class TestAccount(unittest.TestCase):
def test_message_success_with_three_attributes(self):
attr = ["first_name", "second_name",... | mit |
leftbrainstrain/Arduino-ESP8266 | arduino-core/src/processing/app/i18n/python/requests/models.py | 151 | 21105 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import logging
import datetime
from io import BytesIO
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
from .c... | lgpl-2.1 |
algoo/python-antidot | pyantidot/manager.py | 1 | 4125 | # -*- coding: utf-8 -*-
import json
import logging
import re
from werkzeug.datastructures import MultiDict
from pyantidot.request import SearchRequest
from pyantidot.request import ACPRequest
from pyantidot.request import ACPResponse
from pyantidot.response import SearchResponse
logger = logging.getLogger('pyantido... | agpl-3.0 |
michalliu/chromium-depot_tools | third_party/simplejson/scanner.py | 674 | 2560 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | bsd-3-clause |
indevgr/django | tests/i18n/test_compilation.py | 9 | 9555 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gettext as gettext_module
import os
import shutil
import stat
import unittest
from subprocess import Popen
from django.core.management import (
CommandError, call_command, execute_from_command_line,
)
from django.core.management.commands.makem... | bsd-3-clause |
scipy/scipy-svn | scipy/sparse/dia.py | 5 | 6602 | """Sparse DIAgonal format"""
__docformat__ = "restructuredtext en"
__all__ = ['dia_matrix', 'isspmatrix_dia']
import numpy as np
from base import isspmatrix, _formats
from data import _data_matrix
from sputils import isshape, upcast, getdtype
from sparsetools import dia_matvec
class dia_matrix(_data_matrix):
"... | bsd-3-clause |
mgedmin/socketpool | examples/test_eventlet.py | 2 | 1996 | # -*- coding: utf-8 -
#
# This file is part of socketpool.
# See the NOTICE for more information.
import eventlet
from socketpool.pool import ConnectionPool
from socketpool.conn import TcpConnector
# this handler will be run for each incoming connection in a dedicated greenlet
class EchoServer(object):
def __... | mit |
qvazzler/Flexget | flexget/plugins/input/sonarr_emit.py | 1 | 5121 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import urlparse
import logging
import math
from requests import RequestException
from flexget import plugin
from flexget.event import event
from... | mit |
evanscottgray/ryu | ryu/ofproto/ofproto_v1_4.py | 1 | 60893 | # Copyright (C) 2012,2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# ht... | apache-2.0 |
neilpelow/wmap-django | venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## 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 |
bdelbosc/benchbase | benchbase/sar.py | 1 | 3093 | #!/usr/bin/env python
# -*- coding: utf_8 -*
# (C) Copyright 2008-2011 Nuxeo SAS <http://nuxeo.com>
# Authors: Benoit Delbosc <ben@nuxeo.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foun... | gpl-2.0 |
jank3/django | tests/backends/tests.py | 27 | 46941 | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import datetime
import re
import threading
import unittest
import warnings
from decimal import Decimal, Rounded
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color ... | bsd-3-clause |
TripleDogDare/RadioWCSpy | env/lib/python2.7/site-packages/pip/utils/outdated.py | 102 | 4954 | from __future__ import absolute_import
import datetime
import errno
import json
import logging
import os.path
import sys
from pip._vendor import lockfile
from pip._vendor import pkg_resources
from pip.compat import total_seconds
from pip.index import PyPI
from pip.locations import USER_CACHE_DIR, running_under_virtu... | mit |
googleapis/python-dialogflow | google/cloud/dialogflow_v2/types/entity_type.py | 1 | 17376 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/pegasus/externals/python/boto/support/__init__.py | 145 | 1652 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | gpl-3.0 |
weijia/django-yarr | yarr/south_migrations/0011_auto__chg_field_feed_count_unread__chg_field_feed_count_total.py | 2 | 6650 | # -*- 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):
# Changing field 'Feed.count_unread'
db.alter_column(u'yarr_feed', 'coun... | bsd-3-clause |
marcinsiwicki/ThinkStats2 | code/chap01soln.py | 67 | 1859 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import numpy as np
import sys
import nsfg
import thinkstats2
def ReadFemResp(... | gpl-3.0 |
lightcn/odoo | addons/portal_project/tests/test_access_rights.py | 197 | 15444 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
DylanMcCall/gnome-clocks-time-slider | gnomeclocks/alarm.py | 1 | 17663 | # Copyright (c) 2011-2012 Collabora, Ltd.
#
# Gnome Clocks 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.
#
# Gnome Clocks is distribu... | gpl-2.0 |
Shaffi08/yowsup | yowsup/layers/protocol_messages/protocolentities/message_text_broadcast.py | 64 | 1185 | from .message_text import TextMessageProtocolEntity
from yowsup.structs import ProtocolTreeNode
import time
class BroadcastTextMessage(TextMessageProtocolEntity):
def __init__(self, jids, body):
broadcastTime = int(time.time() * 1000)
super(BroadcastTextMessage, self).__init__(body, to = "%s@broadca... | gpl-3.0 |
hocinebendou/bika.gsoc | bika/lims/browser/widgets/recordswidget.py | 3 | 1785 | from AccessControl import ClassSecurityInfo
from Products.ATExtensions.widget import RecordsWidget as ATRecordsWidget
from Products.Archetypes.Registry import registerWidget
import json
class RecordsWidget(ATRecordsWidget):
security = ClassSecurityInfo()
_properties = ATRecordsWidget._properties.copy()
_pr... | mit |
jbzdak/edx-platform | lms/djangoapps/courseware/management/commands/dump_course_ids.py | 30 | 1292 | # pylint: disable=missing-docstring
from optparse import make_option
from textwrap import dedent
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.django import modulestore
class Command(BaseCommand):
"""
Simple command to dump the course_ids available to the lms.
... | agpl-3.0 |
johndpope/tensorflow | tensorflow/compiler/tests/spacetobatch_op_test.py | 31 | 10234 | # 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 |
philippj/delta | server.py | 1 | 15471 | import sys
import socket as socketlib
import threading
import thread
import json
import time
import uuid
import inspect
import hashlib
import zlib
from enum import Enum
from enums import tags
from crypt import DeltaCrypt
from cexceptions import *
DEFAULT_HOST = ''
DEFAULT_PORT = 34443
class DeltaServer(threading.Thr... | mit |
cherusk/ansible | lib/ansible/modules/cloud/openstack/os_user.py | 26 | 9043 | #!/usr/bin/python
# Copyright (c) 2015 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 option) any later... | gpl-3.0 |
blacklin/kbengine | kbe/res/scripts/common/Lib/importlib/_bootstrap.py | 76 | 86787 | """Core implementation of import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing ver... | lgpl-3.0 |
isralopez/geonode | geonode/catalogue/backends/pycsw_local_mappings.py | 8 | 3562 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
selective-inference/selective-inference | sandbox/bayesian/mixed_model.py | 3 | 1152 | import numpy as np
class instance_mixed(object):
def __init__(self, n, p, s, sigma=1., rho=0, random_signs=False, scale =True, center=True):
(self.n, self.p, self.s,
self.sigma,
self.rho) = (n, p, s,
sigma,
rho)
self.X = (np.sqrt(1 - s... | bsd-3-clause |
fhe-odoo/odoo | addons/website_forum_doc/models/documentation.py | 368 | 3222 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class Documentation(osv.Model):
_name = 'forum.documentation.toc'
_description = 'Documentation ToC'
_inherit = ['website.seo.metadata']
_order = "parent_left"
_parent_order = "sequence, name"
_parent_store = True
def name_get(s... | agpl-3.0 |
kk71/kkblog | kkblog/blog/managers.py | 1 | 4478 | from django.db.models import Manager
from django.db.models import Count
from django.core.paginator import Paginator
class commentManager(Manager):
def list(self,
articleId,
includeHide=False,
commentPerResult=999,
orphans=0):
'''
列出评论
arg... | mit |
cfehring/slack-onnow | requests/packages/urllib3/util/connection.py | 353 | 3380 | from __future__ import absolute_import
import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is... | gpl-3.0 |
gquirozbogner/contentbox-master | third_party/django/contrib/gis/tests/inspectapp/tests.py | 109 | 5566 | from __future__ import absolute_import
import os
from django.db import connections
from django.test import TestCase
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TEST_DATA
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.utils.unittest import skipU... | apache-2.0 |
mhbu50/frappe | frappe/integrations/doctype/paypal_settings/paypal_settings.py | 9 | 8462 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
"""
# Integrating PayPal
### 1. Validate Currency Support
Example:
from frappe.integrations.utils import get_payment_gateway_controller
controller = get_payment_gateway_controller(... | mit |
Pluto-tv/chromium-crosswalk | third_party/jinja2/visitor.py | 1401 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/test/test_operator.py | 84 | 18608 | import unittest
from test import support
py_operator = support.import_fresh_module('operator', blocked=['_operator'])
c_operator = support.import_fresh_module('operator', fresh=['_operator'])
class Seq1:
def __init__(self, lst):
self.lst = lst
def __len__(self):
return len(self.lst)
def _... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.