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 |
|---|---|---|---|---|---|
lanselin/pysal | pysal/contrib/handler/tests/test_error_sp.py | 6 | 7995 | import unittest
import scipy
import pysal
import numpy as np
from pysal.spreg import error_sp as SP
from pysal.contrib.handler import Model
from functools import partial
GM_Error = partial(Model, mtype='GM_Error')
GM_Endog_Error = partial(Model, mtype='GM_Endog_Error')
GM_Combo = partial(Model, mtype='GM_Combo')
cla... | bsd-3-clause |
40223145c2g18/40223145 | static/Brython3.1.0-20150301-090019/Lib/pydoc.py | 637 | 102017 | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation ... | gpl-3.0 |
kobejean/tensorflow | tensorflow/contrib/metrics/python/ops/metric_ops.py | 5 | 178391 | # 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 |
k3nnyfr/s2a_fr-nsis | s2a/Python/Lib/distutils/tests/test_unixccompiler.py | 8 | 5057 | """Tests for distutils.unixccompiler."""
import os
import sys
import unittest
from test.test_support import EnvironmentVarGuard, run_unittest
from distutils import sysconfig
from distutils.unixccompiler import UnixCCompiler
class UnixCCompilerTestCase(unittest.TestCase):
def setUp(self):
self._backup_pla... | gpl-3.0 |
jonboiser/kolibri | kolibri/logger/serializers.py | 1 | 5206 | from django.db.models import Sum
from django.utils.timezone import now
from kolibri.auth.models import FacilityUser
from kolibri.core.serializers import KolibriModelSerializer
from kolibri.logger.models import AttemptLog, ContentSessionLog, ContentSummaryLog, ExamAttemptLog, ExamLog, MasteryLog, UserSessionLog
from res... | mit |
wimnat/ansible-modules-core | web_infrastructure/django_manage.py | 10 | 11548 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Scott Anderson <scottanderson42@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 o... | gpl-3.0 |
sdague/home-assistant | homeassistant/components/dynalite/switch.py | 14 | 1153 | """Support for the Dynalite channels and presets as switches."""
from typing import Callable
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .dynalitebase import DynaliteBase, async_setup_entry_base
async... | apache-2.0 |
SerpentCS/odoo | addons/account/res_currency.py | 340 | 2267 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
damirda/ansible-modules-core | cloud/amazon/ec2_vol.py | 42 | 19238 | #!/usr/bin/python
# 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.
#
# Ansible is distributed... | gpl-3.0 |
libvirt/autotest | frontend/afe/rpc_handler.py | 4 | 4666 | """\
RPC request handler Django. Exposed RPC interface functions should be
defined in rpc_interface.py.
"""
__author__ = 'showard@google.com (Steve Howard)'
import traceback, pydoc, re, urllib, logging, logging.handlers, inspect
from autotest_lib.frontend.afe.json_rpc import serviceHandler
from autotest_lib.frontend... | gpl-2.0 |
zahanm/foodpedia | django/contrib/localflavor/se/utils.py | 202 | 2398 | import re
import datetime
def id_number_checksum(gd):
"""
Calculates a Swedish ID number checksum, using the
"Luhn"-algoritm
"""
n = s = 0
for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']):
tmp = ((n % 2) and 1 or 2) * int(c)
if tmp > 9:
tmp = sum([int(... | bsd-3-clause |
jazzband/silk | silk/auth.py | 1 | 1060 | from functools import wraps, WRAPPER_ASSIGNMENTS
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from silk.config import SilkyConfig
def login_possibly_required(function=None, **kwargs):
if SilkyConfig().SILKY_AUTHENTICATION:
return login_req... | mit |
hellofreedom/ansible-modules-core | files/replace.py | 103 | 5341 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Evan Kaufman <evan@digitalflophouse.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 t... | gpl-3.0 |
mattnenterprise/servo | tests/wpt/web-platform-tests/xhr/resources/access-control-preflight-denied.py | 20 | 1609 | def main(request, response):
def fail(message):
response.content = "FAIL: " + str(message)
response.status = 400
def getState(token):
server_state = request.server.stash.take(token)
if not server_state:
return "Uninitialized"
return server_state
def setS... | mpl-2.0 |
team-xue/xue | xue/classes/migrations/0001_initial.py | 1 | 2157 | # encoding: 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):
# Adding model 'Major'
db.create_table('classes_major', (
('id', self.gf('django.d... | bsd-3-clause |
DayGitH/Python-Challenges | DailyProgrammer/DP20140709B.py | 1 | 2282 | """
[7/9/2014] Challenge #170 [Intermediate] Rummy Checker
https://www.reddit.com/r/dailyprogrammer/comments/2a9u0a/792014_challenge_170_intermediate_rummy_checker/
# [](#IntermediateIcon) _(Intermediate)_: Rummy Checker
[Rummy](http://en.wikipedia.org/wiki/Rummy) is another very common card game. This time, the aim ... | mit |
Distrotech/intellij-community | python/lib/Lib/site-packages/django/contrib/sessions/models.py | 231 | 2034 | import base64
import cPickle as pickle
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the given session dictionary pickled and encoded as a string.
"""
return Se... | apache-2.0 |
zero-rp/miniblink49 | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py | 27 | 6482 | # 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 f... | apache-2.0 |
olitheolix/qtmacs | qtmacs/auxiliary.py | 1 | 49418 | # Copyright 2012, Oliver Nagy <olitheolix@gmail.com>
#
# This file is part of Qtmacs.
#
# Qtmacs 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 |
wziard/autokey | src/lib/qtui/folderpage.py | 48 | 2524 | #!/usr/bin/env python
# coding=UTF-8
#
# Generated by pykdeuic4 from folderpage.ui on Sun Mar 4 11:39:39 2012
#
# WARNING! All changes to this file will be lost.
from PyKDE4 import kdecore
from PyKDE4 import kdeui
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
... | gpl-3.0 |
SUSE-Cloud/nova | nova/api/openstack/compute/contrib/cloudpipe_update.py | 12 | 2603 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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
#
# ... | apache-2.0 |
ddd332/presto | presto-docs/target/sphinx/sphinx/versioning.py | 5 | 4264 | # -*- coding: utf-8 -*-
"""
sphinx.versioning
~~~~~~~~~~~~~~~~~
Implements the low-level algorithms Sphinx uses for the versioning of
doctrees.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from uuid import uuid4
from operator impo... | apache-2.0 |
Magicking/pycoin | pycoin/key/bip32.py | 14 | 5602 | # -*- coding: utf-8 -*-
"""
A BIP0032-style hierarchical wallet.
Implement a BIP0032-style hierarchical wallet which can create public
or private wallet keys. Each key can create many child nodes. Each node
has a wallet key and a corresponding private & public key, which can
be used to generate Bitcoin addresses or WI... | mit |
alaski/nova | nova/tests/unit/test_metadata.py | 3 | 63631 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | apache-2.0 |
yongtang/tensorflow | tensorflow/python/keras/utils/vis_utils.py | 6 | 12161 | # 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 |
elkingtonmcb/django | django/template/loaders/locmem.py | 464 | 1194 | """
Wrapper for loading templates from a plain Python dict.
"""
import warnings
from django.template import Origin, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from .base import Loader as BaseLoader
class Loader(BaseLoader):
def __init__(self, engine, templates_dict):
... | bsd-3-clause |
bxshi/gem5 | src/mem/ruby/system/DirectoryMemory.py | 16 | 2226 | # Copyright (c) 2009 Advanced Micro Devices, 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... | bsd-3-clause |
fyndsi/Django-facebook | docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/log.py | 33 | 6246 | """Logging
"""
import sys
import logging
class Logger(object):
"""
Logging object for use in command-line script. Allows ranges of
levels, to avoid some redundancy of displayed information.
"""
VERBOSE_DEBUG = logging.DEBUG-1
DEBUG = logging.DEBUG
INFO = logging.INFO
NOTIFY = (logg... | bsd-3-clause |
ric2b/Vivaldi-browser | chromium/third_party/blink/tools/blinkpy/style/patchreader.py | 2 | 2840 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
# Copyright (C) 2010 ProFUSION embedded systems
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
thedep2/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/myspass.py | 40 | 2670 | from __future__ import unicode_literals
import os.path
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
)
class MySpassIE(InfoExtractor):
_VALID_URL = r'http://www\.myspass\.de/.*'
_TEST = {
'url': 'http://www.myspa... | gpl-3.0 |
ivandeex/dz | inst/hooks/pre_find_module_path/hook-queue.py | 1 | 1230 | # -----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this ... | mit |
cold-brew-coding/protagonist | drafter/ext/snowcrash/tools/gyp/pylib/gyp/xcode_emulation.py | 428 | 57360 | # Copyright (c) 2012 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... | mit |
gale320/sync-engine | migrations/versions/094_eas_passwords.py | 8 | 2164 | """EAS passwords
Revision ID: 427812c1e849
Revises:159607944f52
Create Date: 2014-09-14 22:15:51.225342
"""
# revision identifiers, used by Alembic.
revision = '427812c1e849'
down_revision = '159607944f52'
from datetime import datetime
from alembic import op
import sqlalchemy as sa
def upgrade():
from inbox.i... | agpl-3.0 |
chungjjang80/FRETBursts | fretbursts/burst_plot_attic.py | 2 | 2650 | # encoding: utf-8
#
# FRETBursts - A single-molecule FRET burst analysis toolkit.
#
# Copyright (C) 2014 Antonino Ingargiola <tritemio@gmail.com>
#
"""
WARNING: Plot function ATTIC! Functions here are broken!
Here there are function originally placed in burst_plot.py that became
broken and I didn't had the time or the... | gpl-2.0 |
dan-blanchard/conda-env | conda_env/cli/main_attach.py | 4 | 2010 | from argparse import RawDescriptionHelpFormatter
from ..utils.notebooks import current_env, Notebook
from conda.cli import common
from ..env import from_environment
description = """
Embeds information describing your conda environment
into the notebook metadata
"""
example = """
examples:
conda env attach -n ro... | bsd-3-clause |
krapivchenkon/udacity-gae-demo | ConferenceCentral_Complete/models.py | 11 | 3885 | #!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... | gpl-3.0 |
bmya/odoo-addons | report_extended_purchase/__openerp__.py | 4 | 1664 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 |
FrankBian/kuma | vendor/packages/translate-toolkit/translate/convert/test_po2tiki.py | 7 | 1034 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# po2tiki unit tests
# Author: Wil Clouser <wclouser@mozilla.com>
# Date: 2008-12-01
from translate.convert import po2tiki
from translate.storage import tiki
from translate.convert import test_convert
from translate.misc import wStringIO
class TestPo2Tiki:
def test_c... | mpl-2.0 |
YangChihWei/2015cdb_g1_0623 | static/Brython3.1.1-20150328-091302/Lib/fnmatch.py | 894 | 3163 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | gpl-3.0 |
littlstar/chromium.src | components/test/data/password_manager/run_tests.py | 43 | 4038 | # -*- coding: utf-8 -*-
# Copyright 2014 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.
"""This file allows the bots to be easily configure and run the tests."""
import argparse
import os
import tempfile
from environmen... | bsd-3-clause |
elelsee/pycfn-elasticsearch | pycfn_elasticsearch/vendored/docutils/core.py | 117 | 29426 | # $Id: core.py 7466 2012-06-25 14:56:51Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Calling the ``publish_*`` convenience functions (or instantiating a
`Publisher` object) with component names will result in default
behavior. For custom beha... | apache-2.0 |
alfa-jor/addon | plugin.video.alfa/lib/sambatools/smb/utils/U32.py | 2 | 5139 | # U32.py implements 32-bit unsigned int class for Python
# Version 1.0
# Copyright (C) 2001-2002 Dmitry Rozmanov
#
# This library 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;... | gpl-3.0 |
bloodes/python | fixture/address.py | 1 | 9007 |
from model.address import Adress
import re
class Address:
def __init__(self, app):
self.app = app
def create_new_address(self, address):
wd = self.app.wd
# open home page
self.app.open_home_page_address()
# add_new_address
wd.find_element_by_link_text("add ne... | apache-2.0 |
maurofaccenda/ansible | lib/ansible/modules/cloud/openstack/os_user_role.py | 49 | 6456 | #!/usr/bin/python
# Copyright (c) 2016 IBM
#
# 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 version.
#
# This software is distrib... | gpl-3.0 |
jfarcher/checkinapi | flask/lib/python2.7/site-packages/click/parser.py | 199 | 15510 | # -*- coding: utf-8 -*-
"""
click.parser
~~~~~~~~~~~~
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting a... | gpl-3.0 |
konne88/MediaCMN | filter/options.py | 1 | 3243 | # MediaCMN - Tools to create a consistent music library.
# Copyright (C) 2009 Konstantin Weitz
#
# 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 op... | gpl-3.0 |
mitodl/micromasters | grades/management/commands/complete_course_run_freeze.py | 1 | 2627 | """
Sets the global freeze status for the course run to "complete"
"""
from celery.result import GroupResult
from django.core.cache import caches
from django.core.management import BaseCommand, CommandError
from courses.models import CourseRun
from grades.models import CourseRunGradingStatus
from grades.tasks import C... | bsd-3-clause |
mtagle/airflow | airflow/contrib/utils/log/task_handler_with_custom_formatter.py | 5 | 2216 | #
# 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... | apache-2.0 |
andymckay/django | django/conf/locale/sl/formats.py | 257 | 1834 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd. F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_... | bsd-3-clause |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_4_0_0/models/account_tests.py | 1 | 4654 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import account
from .fhirdate import FHIRDate
class AccountTests(unittest.TestCase):
def instantiate_from(self, filename):
... | bsd-3-clause |
hobson/pug-nlp | pug/nlp/tests.py | 1 | 1514 | #!/usr/bin/env python
"""
Uses the python unittest module to test this app with `python -m unittest pug.nlp`.
"""
# from django.test import TestCase
from unittest import TestCase, main
import doctest
from pug.nlp import util, http, penn_treebank_tokenizer, detector_morse
class NLPDocTest(TestCase):
def test_mod... | mit |
jeasoft/odoo | addons/website/models/res_config.py | 240 | 2660 |
from openerp.osv import fields, osv
class website_config_settings(osv.osv_memory):
_name = 'website.config.settings'
_inherit = 'res.config.settings'
_columns = {
'website_id': fields.many2one('website', string="website", required=True),
'website_name': fields.related('website_id', 'name'... | agpl-3.0 |
rubencabrera/odoo | addons/account_budget/report/analytic_account_budget_report.py | 360 | 7589 | # -*- 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 |
druuu/django | tests/migrations/test_optimizer.py | 108 | 22542 | # -*- coding: utf-8 -*-
from django.db import migrations, models
from django.db.migrations.optimizer import MigrationOptimizer
from django.test import SimpleTestCase
from .models import CustomModelBase, EmptyManager
class OptimizerTests(SimpleTestCase):
"""
Tests the migration autodetector.
"""
def... | bsd-3-clause |
imsparsh/python-for-android | python3-alpha/extra_modules/pyxmpp2/etree.py | 46 | 2735 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | apache-2.0 |
jakev/dtf | python-dtf/dtf/core/cmds/client.py | 2 | 11429 | # Android Device Testing Framework ("dtf")
# Copyright 2013-2015 Jake Valletta (@jake_valletta)
#
# 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 |
peiyuwang/pants | tests/python/pants_test/backend/jvm/tasks/test_export_classpath_integration.py | 11 | 1178 | # 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 os
import tim... | apache-2.0 |
FHannes/intellij-community | python/lib/Lib/site-packages/django/core/files/temp.py | 536 | 1819 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | apache-2.0 |
jimi-c/ansible | lib/ansible/modules/network/junos/junos_system.py | 27 | 6189 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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_version': '1.1',
... | gpl-3.0 |
damonkohler/sl4a | python/src/Mac/IDLE/idlemain.py | 71 | 2786 | """
Bootstrap script for IDLE as an application bundle.
"""
import sys, os
# Change the current directory the user's home directory, that way we'll get
# a more useful default location in the open/save dialogs.
os.chdir(os.path.expanduser('~/Documents'))
# Make sure sys.executable points to the python interpreter in... | apache-2.0 |
cloudmesh/sp17-i524 | project/S17-IR-P013/code/weather_data_analysis/run/wda_mapper.py | 19 | 2000 | #!/usr/bin/env python
import sys
import logging
import iu.i524.S17IRP013.hadoop.hbase_to_hdfs as h2h
DEFAULT_STATION_ID = 'DST:IND000DEF'
logging.basicConfig(format = '%(asctime)s %(message)s',\
datefmt = '%m/%d/%Y %I:%M:%S %p',\
filename = 'wda_app.log',\
... | apache-2.0 |
kaushik94/boto | tests/unit/dynamodb/test_types.py | 9 | 4007 | #!/usr/bin/env python
# Copyright (c) 2012 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 ... | mit |
yangming85/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/unmanaged_models/models.py | 91 | 3475 | """
Models can have a ``managed`` attribute, which specifies whether the SQL code
is generated for the table on various manage.py operations.
"""
from django.db import models
# All of these models are creatd in the database by Django.
class A01(models.Model):
f_a = models.CharField(max_length=10, db_index=True)... | gpl-3.0 |
aaltinisik/OCBAltinkaya | addons/l10n_in_hr_payroll/report/report_payroll_advice.py | 374 | 3442 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
meizhan/SVMelegans | Common/libsvm-3.17/tools/grid.py | 49 | 15304 | #!/usr/bin/env python
__all__ = ['find_parameters']
import os, sys, traceback, getpass, time, re
from threading import Thread
from subprocess import *
if sys.version_info[0] < 3:
from Queue import Queue
else:
from queue import Queue
telnet_workers = []
ssh_workers = []
nr_local_worker = 1
class GridOption:
def _... | mit |
dimara/ganeti | lib/hypervisor/hv_xen.py | 1 | 51356 | #
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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:
#
# 1. Redistributions of source code must retain the above copyright no... | bsd-2-clause |
sshleifer/object_detection_kitti | attention_ocr/python/metrics_test.py | 15 | 3393 | # 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 applicab... | apache-2.0 |
benthomasson/ansible | lib/ansible/plugins/connection/winrm.py | 12 | 25694 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
adrianschlatter/python-ivi | ivi/agilent/agilentDSOX3032A.py | 7 | 1694 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | mit |
prepare/TestWeasyPrint | weasyprint/html.py | 4 | 11779 |
# coding: utf8
"""
weasyprint.html
---------------
Specific handling for some HTML elements, especially replaced elements.
Replaced elements (eg. <img> elements) are rendered externally and
behave as an atomic opaque box in CSS. In general, they may or may not
have intrinsic dimensions. But t... | bsd-3-clause |
jkthompson/nupic | tests/unit/py2/nupic/algorithms/fast_cla_classifier_test.py | 17 | 1609 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
Arcanemagus/SickRage | lib/unidecode/x07a.py | 252 | 4669 | data = (
'Xi ', # 0x00
'Kao ', # 0x01
'Lang ', # 0x02
'Fu ', # 0x03
'Ze ', # 0x04
'Shui ', # 0x05
'Lu ', # 0x06
'Kun ', # 0x07
'Gan ', # 0x08
'Geng ', # 0x09
'Ti ', # 0x0a
'Cheng ', # 0x0b
'Tu ', # 0x0c
'Shao ', # 0x0d
'Shui ', # 0x0e
'Ya ', # 0x0f
'Lun ', # 0x10
'Lu '... | gpl-3.0 |
luthfii/xsched | tools/python/xen/xend/XendVnet.py | 52 | 5488 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
froch/kubernetes-py | kubernetes_py/models/v1beta1/CronJobTemplate.py | 6 | 1863 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes_py.models.v1.JobSpec import JobSpec
from kubernetes_py.models.v1.ObjectMeta import ObjectMeta
class CronJobTemplate(object):... | apache-2.0 |
tensorflow/mesh | mesh_tensorflow/transformer/transformer_layers.py | 1 | 85747 | # coding=utf-8
# Copyright 2021 The Mesh TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
Alwnikrotikz/marinemap | lingcod/common/registration_backend/__init__.py | 3 | 1718 | from registration.backends.default import DefaultBackend
from django.db import transaction
from django import forms
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User, Group
from registration.models import RegistrationManager, RegistrationProfile
from registration.form... | bsd-3-clause |
tarunbhardwaj/trytond-magento | wizard.py | 3 | 14359 | # -*- coding: utf-8 -*-
import magento
import json
from .api import Core
from trytond.model import ModelView, fields
from trytond.pool import PoolMeta, Pool
from trytond.transaction import Transaction
from trytond.pyson import PYSONEncoder, Eval
from trytond.wizard import (
Wizard, StateView, Button, StateAction, ... | bsd-3-clause |
c2g14/2015cd_0512 | static/Brython3.1.1-20150328-091302/Lib/_thread.py | 740 | 4879 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | agpl-3.0 |
artifacts/AFCache | src/python/afcpkg.py | 2 | 8835 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2008 Artifacts - Fine Software Development
# http://www.artifacts.de
# Author: Martin Borho (martin@borho.net)
#
# 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... | apache-2.0 |
ujenmr/ansible | lib/ansible/module_utils/aws/elb_utils.py | 74 | 3399 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.module_utils.ec2 import AWSRetry
# Non-ansible imports
try:
from botocore.exceptions import BotoCoreError, ClientError
except ImportError:
pass
def get_elb(connectio... | gpl-3.0 |
eugena/django | tests/foreign_object/test_empty_join.py | 232 | 1498 | from django.test import TestCase
from .models import SlugPage
class RestrictedConditionsTests(TestCase):
def setUp(self):
slugs = [
'a',
'a/a',
'a/b',
'a/b/a',
'x',
'x/y/z',
]
SlugPage.objects.bulk_create([SlugPage(sl... | bsd-3-clause |
jenalgit/django | django/contrib/gis/geos/collections.py | 47 | 4542 | """
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
from ctypes import byref, c_int, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.geometry import (
GEOSGeometry, ProjectInterpolateMixin,
)
from... | bsd-3-clause |
MobinRanjbar/hue | apps/proxy/src/proxy/views.py | 33 | 4641 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
r-kitaev/lucid-python-werkzeug | examples/upload.py | 44 | 1273 | #!/usr/bin/env python
"""
Simple Upload Application
~~~~~~~~~~~~~~~~~~~~~~~~~
All uploaded files are directly send back to the client.
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.serving import run_simple
f... | bsd-3-clause |
followloda/PornGuys | FlaskServer/venv/Lib/encodings/rot_13.py | 497 | 2579 | #!/usr/bin/env python
""" Python Character Mapping Codec for ROT13.
See http://ucsub.colorado.edu/~kominek/rot13/ for details.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.c... | gpl-3.0 |
TomHeatwole/osf.io | api_tests/registrations/views/test_registration_embeds.py | 15 | 2612 | from nose.tools import * # flake8: noqa
import functools
from framework.auth.core import Auth
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
AuthUserFactory,
RegistrationFactory
)
class TestRegistrationEmbeds(ApiTestCase):... | apache-2.0 |
AthinaB/synnefo | snf-cyclades-gtools/docs/conf.py | 9 | 2020 | import sys, os
sys.path.insert(0, os.path.abspath('../'))
from synnefo.versions.ganeti import __version__
project = u'snf-cyclades-gtools'
copyright = u'2012-2013, GRNET'
version = __version__
release = __version__
html_title = 'synnefo ' + version
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = ... | gpl-3.0 |
ViralLeadership/numpy | numpy/core/_methods.py | 103 | 4308 | """
Array methods which are called by both the C-code for the method
and the Python code for the NumPy-namespace function
"""
from __future__ import division, absolute_import, print_function
import warnings
from numpy.core import multiarray as mu
from numpy.core import umath as um
from numpy.core.numeric import asan... | bsd-3-clause |
edx/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/httpwrappers/tests.py | 47 | 11505 | import copy
import pickle
from django.http import (QueryDict, HttpResponse, SimpleCookie, BadHeaderError,
parse_cookie)
from django.utils import unittest
class QueryDictTests(unittest.TestCase):
def test_missing_key(self):
q = QueryDict('')
self.assertRaises(KeyError, q.__getitem__, 'foo')... | gpl-3.0 |
apavlo/h-store | third_party/python/boto/cloudfront/identity.py | 47 | 4489 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | gpl-3.0 |
thirdwing/mxnet | example/gluon/tree_lstm/scripts/preprocess-sick.py | 61 | 4765 | # 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 |
ahhda/sympy | sympy/physics/hep/gamma_matrices.py | 77 | 31065 | from sympy import S
from sympy.tensor.tensor import TensorIndexType, TensorIndex,\
TensMul, TensorHead, tensorsymmetry, TensorType,\
TensAdd, tensor_mul, get_lines, Tensor
from sympy.core.containers import Tuple
from sympy.core.compatibility import range
DiracSpinorIndex = TensorIndexType('DiracSpinorIndex', ... | bsd-3-clause |
fhaoquan/kbengine | kbe/src/lib/python/Lib/tkinter/simpledialog.py | 94 | 11407 | #
# An Introduction to Tkinter
#
# Copyright (c) 1997 by Fredrik Lundh
#
# This copyright applies to Dialog, askinteger, askfloat and asktring
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
"""This modules handles dialog boxes.
It contains the following public symbols:
SimpleDialog -- A simple but flexible ... | lgpl-3.0 |
alirizakeles/zato | code/zato-server/src/zato/server/service/internal/email/smtp.py | 1 | 2958 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from contextlib import closing
from time import time
# Zato
from zato.c... | gpl-3.0 |
Cinntax/home-assistant | homeassistant/components/tellduslive/config_flow.py | 4 | 5271 | """Config flow for Tellduslive."""
import asyncio
import logging
import os
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
from homeassistant.util.json import load_json
from .const import (
APPLICATION_NAME,
CLOUD_NAME,
DOMA... | apache-2.0 |
firelab/windninja-mobile | WindNinja-Server/windninja_server/windninjaqueue/manager.py | 1 | 3293 | import sys
import time
import datetime
from operator import itemgetter
import subprocess
import windninja_server.windninjaqueue.windninja as wn
import windninja_server.windninjaqueue.queue as wnqueue
VERBOSE = False
CANCEL = False
LOOP_PAUSE = 5
MAX_RUNNING_JOBS = 5
# NOTES: this is a simple 'max' processes queue m... | unlicense |
sjlehtin/django | django/db/backends/postgresql/base.py | 12 | 10558 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import threading
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends.base.base import BaseDatabase... | bsd-3-clause |
bjolivot/ansible | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 15 | 14347 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
saisankargochhayat/algo_quest | techdevguide/longestsubsequence.py | 1 | 3538 | # The Challenge
# Given a string S and a set of words D, find the longest word in D that is a subsequence of S.
# Word W is a subsequence of S if some number of characters, possibly zero, can be deleted from S to form W, without reordering the remaining characters.
# Note: D can appear in any format (list, hash table... | apache-2.0 |
rushiagr/keystone | keystone/common/models.py | 20 | 3286 | # Copyright (C) 2011 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.