repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
cloudbase/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_user_data.py | 3 | # Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/LIC... |
home-assistant/home-assistant | refs/heads/dev | tests/components/samsungtv/test_media_player.py | 2 | """Tests for samsungtv component."""
import asyncio
from datetime import timedelta
import logging
from unittest.mock import DEFAULT as DEFAULT_MOCK, Mock, PropertyMock, call, patch
import pytest
from samsungctl import exceptions
from samsungtvws.exceptions import ConnectionFailure
from websocket import WebSocketExcept... |
DazWorrall/ansible | refs/heads/devel | test/units/module_utils/gcp/test_auth.py | 38 | # -*- coding: utf-8 -*-
# (c) 2016, Tom Melendez (@supertom) <tom@supertom.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
... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/host/lib/python3.4/configparser.py | 84 | """Configuration file parser.
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.
class:
ConfigParse... |
maheshakya/scikit-learn | refs/heads/master | sklearn/random_projection.py | 26 | # -*- coding: utf8
"""Random Projection transformers
Random Projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
The dimensions and distribution of Ra... |
levkar/odoo | refs/heads/10.0 | addons/website_partner/models/res_partner.py | 23 | # -*- coding: utf-8 -*-
from odoo import api, fields, models
from odoo.addons.website.models.website import slug
class WebsiteResPartner(models.Model):
_name = 'res.partner'
_inherit = ['res.partner', 'website.seo.metadata', 'website.published.mixin']
website_description = fields.Html('Website Partner F... |
dkodnik/Ant | refs/heads/master | addons/account_cancel/__init__.py | 702 | # -*- 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... |
riquito/richinput | refs/heads/master | setup.py | 1 | from distutils.core import setup
setup(
name = 'richinput',
packages = ['richinput'],
version = '1.0.0',
description = 'Nonblocking text and password reader',
author = 'Riccardo Attilio Galli',
author_email = 'riccardo@sideralis.org',
url = 'https://github.com/riquito/richinput',
download_url = 'https:... |
oe-alliance/AutoBouquetsMaker | refs/heads/master | AutoBouquetsMaker/src/version.py | 1 | PLUGIN_VERSION = "3.2"
|
kkozarev/mwacme | refs/heads/master | src/fits2png_multipanel.py | 2 | #Convert FITS files to PNG - multipanel version
#
#Kamen 10/05/2016
import glob, os, sys
from astropy.io import fits as pyfits
import matplotlib.pyplot as plt
from astropy.io import ascii
import numpy as np
#The new data location
if sys.platform == 'darwin': BASEDIR='/Volumes/MyPassport/MWA_DATA/'
if sys.platform ... |
richardcs/ansible | refs/heads/devel | lib/ansible/modules/windows/win_uri.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Corwin Brown <corwin@corwinbrown.com>
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
alexmogavero/home-assistant | refs/heads/dev | homeassistant/components/switch/tellstick.py | 9 | """
Support for Tellstick switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.tellstick/
"""
import voluptuous as vol
from homeassistant.components.tellstick import (DEFAULT_SIGNAL_REPETITIONS,
... |
hacklab-fi/asylum | refs/heads/master | project/velkoja/migrations/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
CaseyLeask/xen | refs/heads/master | tools/libxl/gentest.py | 7 | #!/usr/bin/python
import os
import sys
import re
import random
import idl
def randomize_char(c):
if random.random() < 0.5:
return str.lower(c)
else:
return str.upper(c)
def randomize_case(s):
r = [randomize_char(c) for c in s]
return "".join(r)
def randomize_enum(e):
return rand... |
philipp-sumo/kitsune | refs/heads/master | kitsune/users/cron.py | 19 | import cronjobs
from datetime import datetime, timedelta
from rest_framework.authtoken.models import Token
from django.conf import settings
from kitsune.questions.models import Answer
from kitsune.search.models import generate_tasks
from kitsune.search.tasks import index_task
from kitsune.users.models import Registr... |
spantaleev/roscraco | refs/heads/master | roscraco/router/tenda/w268r.py | 1 | import base64
import re
from roscraco.router.base import RouterBase
from roscraco.helper import validator, converter, split_in_groups
from roscraco.exception import RouterParseError, RouterIdentityError
from roscraco.response import RouterInfo, TrafficStats, DMZSettings, \
ConnectedClientsListItem, ConnectedClie... |
thepwagner/flotilla | refs/heads/master | src/test/db/test_lock.py | 2 | import time
import unittest
from boto.dynamodb2.exceptions import ConditionalCheckFailedException, \
ItemNotFound
from boto.dynamodb2.items import Item
from boto.dynamodb2.table import Table
from flotilla.db.lock import DynamoDbLocks
from mock import MagicMock, ANY
INSTANCE_ID = 'i-123456'
OTHER_OWNER = 'i-654321'... |
tchernomax/ansible | refs/heads/devel | lib/ansible/plugins/terminal/cnos.py | 86 | # (C) 2017 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for ... |
SUBHAROOP/SNAKEGAME | refs/heads/master | SnakeGame.py | 1 | # snake game
#by roots
#imports
import pygame, sys, random, time
check_errors=pygame.init()
if check_errors[1]>0:
print("(!)Had {0} initializing errors,existing...".format(check_errors[1]))
sys.exit(-1)
else:
print("(+)Pygame successfully intialized!")
# Play surface
playSurface=pygame.display.set_mode... |
robjohnson189/home-assistant | refs/heads/dev | homeassistant/components/media_player/roku.py | 1 | """
Support for the roku media player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.roku/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK, SUPPORT_P... |
tpsatish95/Python-Workshop | refs/heads/master | Python Environment Setup/Alternate/1. Python/1. Installer/Python-3.4.0(Linux)/Lib/test/test_pickletools.py | 161 | import pickle
import pickletools
from test import support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def dumps(self, arg, proto=None):
return pickletools.optimize(pick... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/webapp2-2.3/webapp2_extras/appengine/users.py | 66 | # -*- coding: utf-8 -*-
"""
webapp2_extras.appengine.users
==============================
Helpers for google.appengine.api.users.
:copyright: 2011 tipfy.org.
:license: Apache Sotware License, see LICENSE for details.
"""
from google.appengine.api import users
def login_required(handler_method):
... |
trickv/py_ublox_i2c | refs/heads/master | configure_serial.py | 1 | #!/usr/bin/env python
import serial
# FIXME: Enable flight mode
# TODO: is it possible to read the configuration to verify
# flight mode has actually been enabled?
def _open_serial():
return serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
def configure_for_flight():
gps_serial = _open_serial()
import tim... |
andydude/harlib | refs/heads/master | tests/test_session.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# harlib
# Copyright (c) 2014-2017, Andrew Robbins, All rights reserved.
#
# This library ("it") is free software; it is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; you can redistribute it and/or
# modify it under the terms of LGPLv3 <https... |
w-m/pleonasm | refs/heads/master | python/dict_tree.py | 1 | class word_tree(object):
def __init__(self):
self.d = {}
def insert(self, path, word):
for i in xrange(1, len(path)):
sub_path = path[:i]
if sub_path not in self.d:
self.d[sub_path] = None
self.d[path] = word
def find_longest(self, word):
depth = 0
longest_match = None
for i in xrange... |
dashea/redhat-upgrade-tool | refs/heads/master | redhat_upgrade_tool/upgrade.py | 2 | # upgrade.py - test the upgrade transaction using RPM
#
# Copyright (C) 2012 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option)... |
tremby/vubat | refs/heads/main | vubat.py | 1 | #!/usr/bin/env python
NAME="vubat"
DESCRIPTION="System tray battery status monitor"
AUTHOR = "Simon Ortling, Bart Nagel"
AUTHOR_EMAIL = "krabat@vonuebel.com, bart@tremby.net"
URL = "https://github.com/tremby/vubat"
VERSION = "0.1.1~git"
LICENSE = "GNU GPLv3"
COPYRIGHT_YEAR = "2011"
"""
This program is free software: ... |
tudorvio/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/279_fix_unique_constraint_for_compute_node.py | 81 | # Copyright (c) Intel 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 ... |
t794104/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_devtestlabpolicy.py | 27 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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',
... |
w1ll1am23/home-assistant | refs/heads/dev | tests/components/mqtt/test_state_vacuum.py | 8 | """The tests for the State vacuum Mqtt platform."""
from copy import deepcopy
import json
from unittest.mock import patch
import pytest
from homeassistant.components import vacuum
from homeassistant.components.mqtt import CONF_COMMAND_TOPIC, CONF_STATE_TOPIC
from homeassistant.components.mqtt.vacuum import CONF_SCHEM... |
tmerrick1/spack | refs/heads/develop | var/spack/repos/builtin/packages/icedtea/package.py | 5 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
akirk/youtube-dl | refs/heads/master | youtube_dl/extractor/cnn.py | 114 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
url_basename,
)
class CNNIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:(?:edition|www)\.)?cnn\.com/video/(?:data/.+?|\?)/
(?P<path>.+?/(?P<title>[^/]+?... |
davidzchen/tensorflow | refs/heads/master | tensorflow/compiler/tests/adagrad_da_test.py | 13 | # 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... |
egbertbouman/tribler-g | refs/heads/master | Tribler/Core/Utilities/utilities.py | 1 | # Written by Jie Yang
# see LICENSE.txt for license information
import socket
from time import time, strftime, gmtime
from base64 import encodestring, decodestring
from Tribler.Core.Utilities.Crypto import sha
import sys
import os
import copy
from types import UnicodeType, StringType, LongType, IntType, List... |
Yuudachimoe/HikariChun-RedBot | refs/heads/master | lib/youtube_dl/extractor/commonmistakes.py | 44 | from __future__ import unicode_literals
import sys
from .common import InfoExtractor
from ..utils import ExtractorError
class CommonMistakesIE(InfoExtractor):
IE_DESC = False # Do not list
_VALID_URL = r'''(?x)
(?:url|URL)$
'''
_TESTS = [{
'url': 'url',
'only_matching': Tru... |
denfromufa/PTVS | refs/heads/master | Python/Tests/TestData/VirtualEnv/env/Scripts/pip-script.py | 18 | #!C:\PTVS\Main\Common\Tests\TestData\VirtualEnv\env\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.3.1','console_scripts','pip'
__requires__ = 'pip==1.3.1'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('pip==1.3.1', 'console_scr... |
s20121035/rk3288_android5.1_repo | refs/heads/master | external/chromium_org/chromecast/tools/build/chromecast_repack_locales.py | 57 | #!/usr/bin/env python
# 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.
"""Helper script to repack paks for a list of locales.
Gyp doesn't have any built-in looping capability, so this just provides a way t... |
proudlygeek/proudlygeek-blog | refs/heads/gae-support | jinja2/parser.py | 215 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.utils impo... |
MarcJoan/django | refs/heads/master | tests/template_tests/filter_tests/test_unordered_list.py | 128 | from django.template.defaultfilters import unordered_list
from django.test import SimpleTestCase
from django.utils.encoding import python_2_unicode_compatible
from django.utils.safestring import mark_safe
from ..utils import setup
class UnorderedListTests(SimpleTestCase):
@setup({'unordered_list01': '{{ a|unord... |
janezhango/BigDataMachineLearning | refs/heads/master | R/tests/autoGen/GenUtils.py | 11 | ##
# Helper functions used to auto-generate R unit tests
##
from uuid import uuid4
from random import randrange, uniform, random, choice, sample, randint, seed
from math import floor, ceil
import sys
count = 0
def setup_random_seed(random_seed=None):
if random_seed is not None:
SEED = random_seed
else... |
mrsixw/git-statistics | refs/heads/master | utils/git_commit_file_processor.py | 2 | # Functions to process the git commit data
from CommitData import CommitData
from FileCommitData import FileCommitData
import os
import re
import dateparser
commit_pattern = re.compile('^commit\s*([0-9a-f]*)')
date_pattern = re.compile('^Date:\s(.*)')
author_pattern = re.compile('^Author:\s(.*)')
file_change_pattern... |
fighterCui/L4ReFiascoOC | refs/heads/master | l4/pkg/python/contrib/Lib/plat-mac/Carbon/CarbonEvt.py | 82 | from _CarbonEvt import *
|
jorisvandenbossche/numpy | refs/heads/master | numpy/lib/tests/test_function_base.py | 1 | from __future__ import division, absolute_import, print_function
import operator
import warnings
import sys
import decimal
import types
from fractions import Fraction
import pytest
import numpy as np
from numpy import ma
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_almost_equal,
... |
codemac/servo | refs/heads/master | tests/wpt/harness/wptrunner/hosts.py | 196 | # 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/.
from __future__ import unicode_literals
class HostsLine(object):
def __init__(self, ip_address, canonical_hostname... |
anthonydillon/horizon | refs/heads/master | openstack_dashboard/contrib/sahara/content/data_processing/clusters/tabs.py | 13 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
mgood7123/UPM | refs/heads/master | Tests/PACKAGES/hexchat-2.12.4-6-x86_64/usr/share/doc/libxml2-python-2.9.7/examples/ctxterror.py | 32 | #!/usr/bin/python -u
#
# This test exercise the redirection of error messages with a
# functions defined in Python.
#
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
expect="""--> (3) xmlns: URI foo is not absolute
--> (4) Opening and ending tag mismatch: x line 0 and y
"""
err=""
def callba... |
SergioChan/tornado-TCP | refs/heads/master | Server/Request/Request.py | 3 | # coding=utf-8
__author__ = 'Yuheng Chen'
import json
import time
class Request(object):
'''
`Request` is the basic object type in the IOStream.
Each `Request` is delimited by a delimiter '\n'.
`Request` transported in a serialization mode, using normal json type.
To extend `Request`, define a s... |
vlinhd11/vlinhd11-android-scripting | refs/heads/master | python/src/Demo/tkinter/matt/canvas-moving-or-creating.py | 47 | from Tkinter import *
# this file demonstrates a more sophisticated movement --
# move dots or create new ones if you click outside the dots
class Test(Frame):
###################################################################
###### Event callbacks for THE CANVAS (not the stuff drawn on it)
############... |
Sorsly/subtle | refs/heads/master | google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/__init__.py | 193 | import sys
# http://www.python.org/dev/peps/pep-0396/
__version__ = '0.1.7'
if sys.version_info[:2] < (2, 4):
raise RuntimeError('PyASN1 requires Python 2.4 or later')
|
MartinHjelmare/home-assistant | refs/heads/dev | homeassistant/components/traccar/device_tracker.py | 1 | """Support for Traccar device tracking."""
from datetime import datetime, timedelta
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST, CONF_PORT, CONF_SSL, CONF_VERIFY_SSL,
CONF_PASSWORD, CONF_USERNAME, ATTR_... |
ayepezv/GAD_ERP | refs/heads/master | addons/bus/models/__init__.py | 67 | # -*- coding: utf-8 -*-
import bus
import bus_presence
import res_users
import res_partner
|
suncycheng/intellij-community | refs/heads/master | python/testData/refactoring/changeSignature/fixGoogleDocStringRemoveMultiple.before.py | 45 | def f(a, b, c, d):
"""
Parameters:
a : foo
b : bar
c : baz
d : quux
""" |
whamtet/gae-webstore | refs/heads/master | reset.py | 1 | #reset.py
#contains url endpoints for setting and resetting user password
import webapp2
import re
import os
import my_db
from google.appengine.ext import db
import html
import validate_email
from webapp2_extras import security
import util
import my_email
IS_DEV = os.environ['SERVER_SOFTWARE'].count('Development') > ... |
mbkumar/pymatgen | refs/heads/master | pymatgen/io/tests/test_xyz.py | 1 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
from pymatgen.core.structure import Molecule
from pymatgen.io.xyz import XYZ
from pymatgen.io.vasp.inputs import Poscar
test_dir = os.path.join(os.path.dirname(__file__), "..", "..",... |
michaelray/Iristyle-ChocolateyPackages | refs/heads/master | EthanBrown.SublimeText2.GitPackages/tools/PackageCache/sublime-github/lib/requests/cookies.py | 58 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import collections
from .compat import cookielib, urlparse, Morsel
try:
import threading
# grr, pyflakes: this fixes "redefinition of unused... |
ccnmtl/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/comments/admin.py | 361 | from django.contrib import admin
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _, ungettext
from django.contrib.comments import get_model
from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete
class CommentsAdmin(adm... |
TheNathanBlack/moviepy | refs/heads/master | moviepy/video/tools/drawing.py | 13 | """
This module deals with making images (np arrays). It provides drawing
methods that are difficult to do with the existing Python libraries.
"""
import numpy as np
def blit(im1, im2, pos=[0, 0], mask=None, ismask=False):
""" Blit an image over another.
Blits ``im1`` on ``im2`` as position ``pos=(x,y)``... |
DrOctogon/appscake-rewrite | refs/heads/master | appscake/views.py | 1 | import logging
from appscake import helpers
from django.shortcuts import render
from django.shortcuts import render_to_response
from appscake.forms import CommonFields
from django.http import HttpResponse
from django.http import HttpResponseRedirect
# When deploying on virtual machines without IaaS support.
CLUSTER_... |
tomas-mazak/taipan | refs/heads/master | taipan/tegakigtk/canvas.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2008 The Tegaki project contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later v... |
hasanbanna/partyplaylist | refs/heads/master | main.py | 1 | import requests
import json
import spotipy
import spotipy.util as util
import math
import operator
import config
def main():
playlist_name = "Will squared Playlist"
image_file_name = "will&will.jpg"
maximum = 20
token = util.prompt_for_user_token(
config.username, config.scope, client_id=config.... |
Juniper/contrail-dev-controller | refs/heads/master | src/config/test/utils/mockzoo/setup.py | 21 | #!/usr/bin/env python
from distutils.core import setup
setup(name='mockzoo',
version='1.0',
description='Zookeeper Distribution Utilities for systest',
author='contrail',
author_email='contrail-sw@juniper.net',
url='http://opencontrail.org/',
packages=['mockzoo', ],
)
|
zhuwenping/python-for-android | refs/heads/master | python3-alpha/extra_modules/pyxmpp2/message.py | 46 | #
# (C) Copyright 2003-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 u... |
plissonf/scikit-learn | refs/heads/master | sklearn/metrics/scorer.py | 211 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... |
DGrady/pandas | refs/heads/master | pandas/core/indexes/base.py | 2 | import datetime
import warnings
import operator
import numpy as np
from pandas._libs import (lib, index as libindex, tslib as libts,
algos as libalgos, join as libjoin,
Timestamp, Timedelta, )
from pandas._libs.lib import is_datetime_array
from pandas.compat import ... |
jasonkying/pip | refs/heads/develop | tests/data/packages/SetupPyLatin1/setup.py | 44 | # -*- coding: latin-1 -*-
from distutils.core import setup
setup(name="SetupPyUTF8",
author="Saúl Ibarra Corretgé",
)
|
pongem/python-bot-project | refs/heads/master | appengine/standard/botapp/lib/django/contrib/sessions/backends/db.py | 118 | import logging
from django.contrib.sessions.backends.base import (
CreateError, SessionBase, UpdateError,
)
from django.core.exceptions import SuspiciousOperation
from django.db import DatabaseError, IntegrityError, router, transaction
from django.utils import timezone
from django.utils.encoding import force_text
... |
dims/nova | refs/heads/master | nova/objects/flavor.py | 11 | # Copyright 2013 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
unreal666/outwiker | refs/heads/master | src/outwiker/pages/wiki/parser/tokenalign.py | 2 | # -*- coding: utf-8 -*-
import re
from outwiker.libs.pyparsing import Regex
class AlignFactory (object):
@staticmethod
def make(parser):
return AlignToken(parser).getToken()
class AlignToken (object):
"""
Токен для выравнивания
"""
def __init__(self, parser):
self.parser =... |
haoyunfeix/crosswalk-test-suite | refs/heads/master | apptools/apptools-linux-tests/apptools/manifest_app_version.py | 12 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
ychfan/tensorflow | refs/heads/master | tensorflow/contrib/distributions/__init__.py | 4 | # 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... |
ramitalat/odoo | refs/heads/8.0 | addons/account_asset/wizard/account_asset_change_duration.py | 258 | # -*- encoding: 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 t... |
dydek/django | refs/heads/master | tests/validation/test_unique.py | 337 | from __future__ import unicode_literals
import datetime
import unittest
from django.apps.registry import Apps
from django.core.exceptions import ValidationError
from django.db import models
from django.test import TestCase
from .models import (
CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrors... |
kebugcheckex/radon | refs/heads/master | crawler.py | 1 | #!/usr/bin/python3
# A multi-thread crawler for rebuilding website cache
# Originally written by Tianyang Wen, modified by Xinyu Chen
import argparse
import config
import dbo
import queue
import re
import requests
import time
import threading
def get_url_list(arguments):
if arguments.file is None:
entrie... |
sosuke-k/cornel-movie-dialogs-corpus-storm | refs/heads/master | mdcorpus/examples/parse_line.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from storm.locals import *
from mdcorpus.orm import *
from mdcorpus.parser import *
parser = Parser()
f = open("sample_movie_lines.txt")
line = f.readline()
while line:
print "=== parse this line ==="
print line
list = parser.movie_lines(line)
line = Mov... |
citrix-openstack-build/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 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... |
nitinitprof/odoo | refs/heads/8.0 | addons/website_instantclick/__openerp__.py | 342 | {
'name': 'Website Instantclick',
'category': 'Website',
'summary': 'Preloads and speeds up website on public browsing of the website using Instantclick.',
'version': '1.0',
'description': """
Preloads data on anonymous mode of website
==========================================
""",
'au... |
trunca/enigma2 | refs/heads/6.5 | lib/python/Screens/QuadPiP.py | 11 | from Screens.Screen import Screen
from enigma import ePoint, eSize, eServiceCenter, getBestPlayableServiceReference, eServiceReference
from Components.VideoWindow import VideoWindow
from Components.config import config, ConfigPosition
class QuadPiP(Screen):
def __init__(self, session, decoderIdx = 1, pos = None):
S... |
mdavid/SuperSocket | refs/heads/master | Test/Command/ADD.py | 18 | def execute(session, request):
session.Send(str(int(request[0]) + int(request[1]))) |
graingert/ansible | refs/heads/devel | docsite/build-site.py | 211 | #!/usr/bin/env python
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of the Ansible Documentation
#
# 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 th... |
marcore/edx-platform | refs/heads/master | cms/lib/xblock/tagging/__init__.py | 58 | # -*- coding: utf-8 -*-
"""
Structured Tagging based on XBlockAsides
"""
from .tagging import StructuredTagsAside
|
eeshangarg/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/comments/signals.py | 311 | """
Signals relating to comments.
"""
from django.dispatch import Signal
# Sent just before a comment will be posted (after it's been approved and
# moderated; this can be used to modify the comment (in place) with posting
# details or other such actions. If any receiver returns False the comment will be
# discarded a... |
dracos/django | refs/heads/master | tests/null_fk/tests.py | 133 | from django.db.models import Q
from django.test import TestCase
from .models import (
Comment, Forum, Item, Post, PropertyValue, SystemDetails, SystemInfo,
)
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(details='First details')
s = SystemInfo.objects.... |
beiko-lab/gengis | refs/heads/master | bin/Lib/site-packages/pythonwin/pywin/Demos/ocx/flash.py | 4 | # By Bradley Schatz
# simple flash/python application demonstrating bidirectional
# communicaion between flash and python. Click the sphere to see
# behavior. Uses Bounce.swf from FlashBounce.zip, available from
# http://pages.cpsc.ucalgary.ca/~saul/vb_examples/tutorial12/
# Update to the path of the .swf file (... |
stevegood/filesync-server | refs/heads/master | dev-scripts/run-statsd.py | 6 | #!/usr/bin/env python
# Copyright 2008-2015 Canonical
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This... |
wujuguang/sentry | refs/heads/master | src/sentry/migrations/0049_create_default_project_keys.py | 36 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
from sentry.models import ProjectKey
for project in orm['sentry.Project'].objects.all():
if orm['sentry.Pr... |
siliconsmiley/QGIS | refs/heads/master | python/plugins/processing/tests/ParametersTest.py | 21 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ParametersTest.py
---------------------
Date : March 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*************************... |
phantomxc/flask-admin | refs/heads/master | flask_admin/contrib/fileadmin.py | 6 | import os
import os.path as op
import platform
import re
import shutil
from datetime import datetime
from operator import itemgetter
from werkzeug import secure_filename
from flask import flash, redirect, abort, request, send_file
from wtforms import fields, validators
from flask_admin import form, helpers
from fla... |
bonifaido/zktraffic | refs/heads/master | zktraffic/base/util.py | 3 | # ==================================================================================================
# Copyright 2014 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
nchursin/json2apex | refs/heads/master | helpers/JSON2ApexLib.py | 1 | import json
import re
from .PatternClass import Pattern as Pattern
def __init__():
pass
types = {
float: 'Decimal',
int: 'Integer',
bool: 'Boolean',
str: 'String',
bytes: 'String',
None: 'String',
'int': 'Integer',
'bool': 'Boolean',
'boolean': 'Boolean',
'string': 'String',
'float': 'Decimal'
}
class_... |
rhurkes/chasegame | refs/heads/master | venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/dh.py | 5 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
asajeffrey/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/recwarn.py | 32 | """ recording warnings during test function execution. """
from __future__ import absolute_import, division, print_function
import inspect
import _pytest._code
import py
import sys
import warnings
import re
from _pytest.fixtures import yield_fixture
from _pytest.outcomes import fail
@yield_fixture
def recwarn():
... |
siddhika1889/Pydev-Editor | refs/heads/master | pysrc/_pydev_imps/_pydev_execfile.py | 53 | #We must redefine it in Py3k if it's not already there
def execfile(file, glob=None, loc=None):
if glob is None:
import sys
glob = sys._getframe().f_back.f_globals
if loc is None:
loc = glob
# It seems that the best way is using tokenize.open(): http://code.activestate.com/lists/pyt... |
Alwnikrotikz/pysal | refs/heads/master | pysal/core/__init__.py | 20 | import FileIO
|
hippo91/XVOF | refs/heads/master-new | xfv/src/porosity_model/johnsonmodel.py | 1 | # -*- coding: utf-8 -*-
"""
Interface for the porosity calculation
"""
import numpy as np
from xfv.src.porosity_model.porositymodel_base import PorosityModelBase
class JohnsonModel(PorosityModelBase): # pylint: disable=too-few-public-methods
"""
Abstract class for the porosity model computation
"""
de... |
zouzhberk/ambaridemo | refs/heads/master | demo-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/FALCON/package/scripts/status_params.py | 4 | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
atlefren/newbeercellar | refs/heads/master | newbeercellar/models.py | 1 | # -*- coding: utf-8 -*-
from datetime import datetime
import re
from sqlalchemy import (Column, Integer, String, Numeric, ForeignKey, Text,
Date, DateTime, Boolean)
from sqlalchemy.orm import relationship
from flask_login import UserMixin
from newbeercellar import db
RATEBEER_BASE_URL = "htt... |
Laimiux/mydeatree | refs/heads/master | djangoappengine/management/commands/testserver.py | 13 | from django.core.management.base import BaseCommand
from google.appengine.api import apiproxy_stub_map
from google.appengine.datastore import datastore_stub_util
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput', action='store_f... |
garrettjonesgoogle/api-client-staging | refs/heads/master | generated/python/gapic-google-cloud-logging-v2/test/google/cloud/gapic/logging/v2/test_metrics_service_v2_client.py | 7 | # Copyright 2017, 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 ... |
manishpatell/erpcustomizationssaiimpex123qwe | refs/heads/master | addons/purchase_requisition/wizard/__init__.py | 376 | # -*- 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... |
tillahoffmann/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/gather_op_test.py | 42 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.