repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
juanyaw/PTVS | refs/heads/master | Python/Product/Pyvot/Pyvot/xl/shell.py | 18 | # Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the LICENSE.txt file at the root of this distribution. If
# you cannot locate the Apache License, Version 2.0, please send an email to
# vsp... |
agrista/odoo-saas | refs/heads/master | 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... |
jaantollander/CrowdDynamics | refs/heads/master | crowddynamics/io.py | 1 | """Crowddynamics IO operations for storing simulation data into disk
Data flow ::
data (ndarray) -> buffer (list) -> file (.npy)
"""
import os
from collections import Iterable, Mapping
from io import StringIO
import csv
import json
import numpy as np
# NPY : Array data
def save_npy(directory, basename):
... |
glovebx/odoo | refs/heads/8.0 | addons/resource/faces/utils.py | 433 | ############################################################################
# Copyright (C) 2005 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces is free software; you can redistribute it and/or modify
# ... |
hand-iemura/lightpng | refs/heads/master | boost_1_53_0/tools/build/v2/test/inline.py | 20 | #!/usr/bin/python
# Copyright 2003, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.jam", """
project : requirements <link>static ;
exe a : a.c... |
carolineLe/miasm | refs/heads/master | miasm/os_dep/linux/syscall.py | 2 | from builtins import range
import fcntl
import functools
import logging
import struct
import termios
from miasm.jitter.csts import EXCEPT_INT_XX, EXCEPT_SYSCALL
from miasm.core.utils import pck64
log = logging.getLogger('syscalls')
hnd = logging.StreamHandler()
hnd.setFormatter(logging.Formatter("[%(levelname)-8s]: %... |
WaveBlocks/WaveBlocksND | refs/heads/master | examples/quartic/quartic_1D_f_cc.py | 1 | algorithm = "fourier"
propagator = "chinchen"
T = 2 * 4.4
dt = 0.05
dimension = 1
ncomponents = 1
eps = 0.1
potential = "quartic"
sigma = 4.0
# The grid of our simulation domain
limits = [(-6.283185307179586, 6.283185307179586)]
number_nodes = [8192]
# The parameter set of the initial wavepacket
Q = [[1.0 ]]
P = ... |
hgn/hippod | refs/heads/master | hippod/cache_categories.py | 1 | import os
import json
class Cache(object):
def __init__(self, app, frequency):
self.app = app
self.frequency = frequency
self.data = self.init_data()
def init_data(self):
d = dict()
d['categories-full'] = list()
d['categories-single'] = list()
return d... |
smmbllsm/aleph | refs/heads/master | aleph/search/facet.py | 1 | import six
from aleph.core import datasets, schemata
from aleph.model import Entity, Collection
from aleph.data.reference import COUNTRY_NAMES, LANGUAGE_NAMES
class Facet(object):
def __init__(self, state, name, aggs):
self.state = state
self.name = name
self.aggs = aggs
def get_dat... |
PennyDreadfulMTG/Penny-Dreadful-Tools | refs/heads/master | generate_readme.py | 1 | import subprocess
import sys
try:
from discordbot import generate_readme as bot_readme
except ImportError:
pass
HEADER = """
# Penny Dreadful Tools
Repository for the tools used by the Penny Dreadful Community.
View individual subdirectories for details
[ 2012 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
#
# http://... |
kelvan/freieit | refs/heads/master | freieit/admin.py | 1 | from django.contrib import admin
from .models import Tag, Link, ExpertProfile
@admin.register(Tag)
class TagAdmin(admin.ModelAdmin):
list_display = ['name']
list_filter = ['parent__name']
class LinkInline(admin.TabularInline):
model = Link
@admin.register(ExpertProfile)
class ExpertProfileAdmin(admin.... |
shakamunyi/nova | refs/heads/master | nova/scheduler/host_manager.py | 4 | # Copyright (c) 2011 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.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
Klaudit/livestreamer | refs/heads/develop | src/livestreamer/plugins/dailymotion.py | 17 | import re
from functools import reduce
from livestreamer.compat import urlparse, range
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HDSStream, HTTPStream, RTMPStream
from livestreamer.stream.playlist import FLVPlaylist
COOKIES = {
"fami... |
jacques/connector | refs/heads/master | test/feedvalidator/feedvalidator/mediaTypes.py | 2 | """
$Id: mediaTypes.py 616 2006-05-02 14:10:24Z rubys $
This module deals with valid internet media types for feeds.
"""
__author__ = "Joseph Walton <http://www.kafsemo.org/>"
__version__ = "$Revision: 616 $"
__date__ = "$Date: 2006-05-03 02:10:24 +1200 (Wed, 03 May 2006) $"
__copyright__ = "Copyright (c) 2004 Joseph ... |
nicholasbs/zulip | refs/heads/master | zerver/lib/actions.py | 114 | from __future__ import absolute_import
from django.conf import settings
from django.core import validators
from django.contrib.sessions.models import Session
from zerver.lib.cache import flush_user_profile
from zerver.lib.context_managers import lockfile
from zerver.models import Realm, RealmEmoji, Stream, UserProfile... |
dennis-sheil/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/test/test_dis.py | 58 | # Minimal tests for dis module
from test.test_support import run_unittest
import unittest
import sys
import dis
import StringIO
def _f(a):
print a
return 1
dis_f = """\
%-4d 0 LOAD_FAST 0 (a)
3 PRINT_ITEM
4 PRINT_NEWLINE
%-4d 5 LOAD_CONST ... |
boakley/robotframework-workbench | refs/heads/master | rwb/widgets/gradient_canvas.py | 1 | '''GradientCanvas
This creates a canvas with a gradient background. The colors
of the gradient can be set with the set_colors method. The
axis can be set with set_axis, and must be "x" or "y".
I'm not presently using this, but thought it might be useful
for tooltips or the window background or something.
'''
import ... |
Aloomaio/googleads-python-lib | refs/heads/master | examples/adwords/v201802/advanced_operations/add_dynamic_search_ads_campaign.py | 1 | #!/usr/bin/env python
#
# Copyright 2016 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 requir... |
neilLasrado/frappe | refs/heads/develop | frappe/patches/v4_0/update_datetime.py | 75 | from __future__ import unicode_literals
import frappe
def execute():
for table in frappe.db.sql_list("show tables"):
for field in frappe.db.sql("desc `%s`" % table):
if field[1]=="datetime":
frappe.db.sql("alter table `%s` change `%s` `%s` datetime(6)" % \
(table, field[0], field[0]))
elif field[1]=... |
kirca/OpenUpgrade | refs/heads/8.0 | addons/calendar/migrations/8.0.1.0/post-migration.py | 11 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
alobbs/qvm | refs/heads/master | qvm/qvm-rm.py | 1 | import os
import cmd
import sys
import util
host = sys.argv[1]
cmd.run ("virsh destroy %s"%(host))
cmd.run ("virsh undefine %s"%(host))
cmd.run ("virsh pool-destroy %s"%(host))
vm_dir = util.get_vm_install_dir(host)
cmd.run ("rm -rfv '%s'"%(vm_dir))
cmd.run ("virsh pool-undefine %s"%(host))
|
benmccann/dd-agent | refs/heads/master | checks.d/directory.py | 34 | # stdlib
from fnmatch import fnmatch
from os import stat, walk
from os.path import abspath, exists, join
import time
# project
from checks import AgentCheck
from config import _is_affirmative
class DirectoryCheck(AgentCheck):
"""This check is for monitoring and reporting metrics on the files for a provided direc... |
ratoaq2/Flexget | refs/heads/develop | tests/test_content_filter.py | 22 | from __future__ import unicode_literals, division, absolute_import
from tests import FlexGetBase, with_filecopy
class TestContentFilter(FlexGetBase):
__yaml__ = """
tasks:
test_reject1:
mock:
- {title: 'test', file: 'test_reject1.torrent'}
accept_all: yes
... |
ClearCorp/server-tools | refs/heads/9.0 | email_template_template/model/__init__.py | 67 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
enikesha/yos-social-python | refs/heads/master | test/unit/openid/storetest.py | 77 | from openid.association import Association
from openid.cryptutil import randomString
from openid.store.nonce import mkNonce, split
import unittest
import string
import time
import socket
import random
import os
db_host = 'dbtest'
allowed_handle = []
for c in string.printable:
if c not in string.whitespace:
... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/mobile_app/const.py | 23 | """Constants for mobile_app tests."""
CALL_SERVICE = {
"type": "call_service",
"data": {"domain": "test", "service": "mobile_app", "service_data": {"foo": "bar"}},
}
FIRE_EVENT = {
"type": "fire_event",
"data": {"event_type": "test_event", "event_data": {"hello": "yo world"}},
}
REGISTER = {
"app_... |
beni55/django-haystack | refs/heads/master | tests/solr_settings.py | 4 | from settings import *
INSTALLED_APPS += [
'solr_tests',
]
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': 'http://localhost:9001/solr/test_default',
'INCLUDE_SPELLING': True,
},
}
|
Labgoo/google-analytics-for-python | refs/heads/master | gap_test/test_utility.py | 1 | __author__ = 'minhtule'
from unittest import TestCase
from gap.utility import *
class TestUtility(TestCase):
def test_is_empty_string(self):
self.assertTrue(is_empty_string(""))
self.assertTrue(is_empty_string(" "))
self.assertTrue(is_empty_string(" \t "))
self.assertFalse(is_e... |
staranjeet/fjord | refs/heads/master | vendor/packages/Babel/tests/messages/test_plurals.py | 35 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2011 Edgewall Software
# 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://babel.edgewall.org/wiki/License.
#
# This software consists... |
demarle/VTK | refs/heads/master | ThirdParty/Twisted/twisted/trial/test/test_loader.py | 31 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for loading tests by name.
"""
import os
import sys
import unittest as pyunit
from hashlib import md5
from twisted.python import util, filepath
from twisted.trial.test import packages
from twisted.trial import runner, reporter, unitte... |
abhikumar22/MYBLOG | refs/heads/master | blg/Lib/site-packages/requests_oauthlib/compliance_fixes/fitbit.py | 27 | """
The Fitbit API breaks from the OAuth2 RFC standard by returning an "errors"
object list, rather than a single "error" string. This puts hooks in place so
that oauthlib can process an error in the results from access token and refresh
token responses. This is necessary to prevent getting the generic red herring
Miss... |
jiangzhonghui/viewfinder | refs/heads/master | marketing/tornado/process.py | 18 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
frankrousseau/weboob | refs/heads/master | modules/somafm/__init__.py | 7 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Roger Philibert
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... |
ProfessionalIT/professionalit-webiste | refs/heads/master | sdk/google_appengine/lib/django-1.4/django/core/mail/backends/dummy.py | 634 | """
Dummy email backend that does nothing.
"""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(email_messages)
|
RalphBariz/RalphsDotNet | refs/heads/master | Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/numpy/ma/setupscons.py | 99 | #!/usr/bin/env python
__author__ = "Pierre GF Gerard-Marchant ($Author: jarrod.millman $)"
__version__ = '1.0'
__revision__ = "$Revision: 3473 $"
__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $'
import os
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util impo... |
GovReady/readthedocs.org | refs/heads/master | deploy/nginx-smoke-test.py | 45 | #!/usr/bin/env python
"""Check Nginx config on readthedocs.org."""
import sys
import requests
# Globals to keep count of test results
TESTS = 0
FAILS = 0
def served_by_nginx(url):
"""Return True if url returns 200 and is served by Nginx."""
r = requests.get(url, allow_redirects=False)
status = (r.stat... |
sysalexis/kbengine | refs/heads/master | kbe/src/lib/python/Lib/encodings/hex_codec.py | 202 | """Python 'hex_codec' Codec - 2-digit hex content transfer encoding.
This codec de/encodes from bytes to bytes.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import binascii
### Codec APIs
def hex_encode(input, errors='strict'):
assert errors == 'strict'
return (binascii.b2a_hex(input)... |
yqm/sl4a | refs/heads/master | python-build/python-libs/python-twitter/twitter.py | 89 | #!/usr/bin/python2.4
#
# Copyright 2007 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... |
ernesto-g/micropython | refs/heads/master | tests/basics/lambda1.py | 119 | # lambda
f = lambda x, y: x + 3 * y
print(f(3, 5))
|
LarsFronius/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_server_volume.py | 49 | #!/usr/bin/python
#coding: utf-8 -*-
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
russel1237/scikit-learn | refs/heads/master | examples/model_selection/grid_search_digits.py | 227 | """
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.grid_search.GridSearc... |
liuzzfnst/tp-libvirt | refs/heads/master | libvirt/tests/src/virsh_cmd/host/virsh_sysinfo.py | 7 | import logging
from autotest.client import utils
from autotest.client.shared import error
from virttest import libvirt_xml
from virttest import virsh
def get_processor_version():
"""
Get host processor version from dmidecode output, return empty list
if dmidecode command fail.
:return: the host proce... |
diagramsoftware/odoo | refs/heads/8.0 | addons/auth_crypt/__openerp__.py | 310 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://odoo.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
dulems/hue | refs/heads/master | apps/oozie/src/oozie/migrations/0022_change_examples_path_format.py | 35 | # encoding: utf-8
import datetime
import json
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""No-op to help upgrading from CDH 4.7.0 to CDH 5.x"""
def backwards(self, orm):
"""No-op to help dow... |
pronix/spark | refs/heads/master | examples/src/main/python/ml/random_forest_example.py | 5 | #
# 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 us... |
lrq3000/pyFileFixity | refs/heads/master | pyFileFixity/lib/profilers/visual/runsnakerun/pstatsloader.py | 2 | """Module to load cProfile/profile records as a tree of records"""
import pstats, os, logging
log = logging.getLogger(__name__)
from gettext import gettext as _
TREE_CALLS, TREE_FILES = range( 2 )
class PStatsLoader( object ):
"""Load profiler statistics from PStats (cProfile) files"""
def __init__( self, *fi... |
fnordahl/nova | refs/heads/master | nova/baserpc.py | 70 | #
# 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... |
terencehonles/mailman | refs/heads/master | src/mailman/rest/members.py | 2 | # Copyright (C) 2010-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... |
LordDamionDevil/Lony | refs/heads/master | lib/chardet/__init__.py | 1777 | ######################## BEGIN LICENSE BLOCK ########################
# 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; either
# version 2.1 of the License, or (at your option) any later ve... |
maria/PyGithub | refs/heads/master | github/tests/Issue131.py | 39 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... |
sanjeevtripurari/hue | refs/heads/master | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/shells.py | 37 | import six
import traceback
class ObjectImportError(Exception):
pass
def import_items(import_directives, style, quiet_load=False):
"""
Import the items in import_directives and return a list of the imported items
Each item in import_directives should be one of the following forms
* a tuple ... |
jessfraz/test-infra | refs/heads/master | experiment/migrate_testgrid_tabs.py | 10 | #!/usr/bin/env python3
# Copyright 2019 The Kubernetes 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 appl... |
adamelso/beets | refs/heads/master | beetsplug/mbcollection.py | 9 | #Copyright (c) 2011, Jeffrey Aylesworth <jeffrey@aylesworth.ca>
#
#Permission to use, copy, modify, and/or distribute this software for any
#purpose with or without fee is hereby granted, provided that the above
#copyright notice and this permission notice appear in all copies.
#
#THE SOFTWARE IS PROVIDED "AS IS" AND T... |
clearpathrobotics/ros_buildfarm | refs/heads/master | scripts/release/run_binarydeb_job.py | 3 | #!/usr/bin/env python3
import argparse
import copy
import sys
from ros_buildfarm.argument import add_argument_append_timestamp
from ros_buildfarm.argument import add_argument_binarydeb_dir
from ros_buildfarm.argument import \
add_argument_distribution_repository_key_files
from ros_buildfarm.argument import add_ar... |
tomsilver/nupic | refs/heads/master | tests/integration/nupic/opf/expgenerator_test.py | 1 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
hrayr-artunyan/shuup | refs/heads/master | shuup_tests/core/test_price_display_options.py | 1 | from shuup.core.pricing import PriceDisplayOptions
def test_price_display_options_default():
options = PriceDisplayOptions()
assert options.show_prices is True
assert options.hide_prices is False
assert options.include_taxes is None
def test_price_display_options_more():
options = PriceDisplayOp... |
jorgeluis11/tpinterview | refs/heads/master | restapi/models.py | 10644 | from django.db import models
# Create your models here.
|
spoqa/geofront | refs/heads/master | tests/keystore_test.py | 1 | import collections.abc
from paramiko.dsskey import DSSKey
from paramiko.ecdsakey import ECDSAKey
from paramiko.ed25519key import Ed25519Key
from paramiko.rsakey import RSAKey
from pytest import fixture, raises
from geofront.keystore import (DuplicatePublicKeyError, KeyTypeError,
format_... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/lib/Lib/tempfile.py | 86 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... |
kawasaki2013/python-for-android-x86 | refs/heads/master | python3-alpha/extra_modules/pyxmpp2/xmppserializer.py | 46 | #
# (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... |
riccardomc/moto | refs/heads/master | moto/cloudformation/responses.py | 3 | from __future__ import unicode_literals
import json
from six.moves.urllib.parse import urlparse
from moto.core.responses import BaseResponse
from moto.s3 import s3_backend
from .models import cloudformation_backends
from .exceptions import ValidationError
class CloudFormationResponse(BaseResponse):
@property
... |
mkieszek/odoo | refs/heads/master | openerp/cli/server.py | 16 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
OpenERP - Server
OpenERP is an ERP+CRM program for small and medium businesses.
The whole source code is distributed under the terms of the
GNU Public Licence.
(c) 2003-TODAY, Fabien Pinckaers - OpenERP SA
"""
imp... |
linjoahow/2015cda_lego | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/support.py | 770 | import unittest
class TestEquality(object):
"""Used as a mixin for TestCase"""
# Check for a valid __eq__ implementation
def test_eq(self):
for obj_1, obj_2 in self.eq_pairs:
self.assertEqual(obj_1, obj_2)
self.assertEqual(obj_2, obj_1)
# Check for a valid __ne__ impl... |
digidudeofdw/enigma2 | refs/heads/master | lib/python/Screens/ConfigMenu.py | 33 | from Screen import Screen
from Components.ConfigList import ConfigList
from Components.config import config
from Components.ActionMap import ActionMap
class ConfigMenu(Screen):
#create a generic class for view/edit settings
#all stuff come from xml file
#configtype / datasource / validate-call / ...
def __init__(... |
NicolWolf1/Nicole | refs/heads/master | py/openage/convert/__main__.py | 46 | #!/usr/bin/env python3
from . import datafile
from . import mediafile
from .util import set_verbosity
import argparse
def main():
# the convert script has 1 mode:
# mode 0: generate media files
# this requires the aoe installation
# database files as csv will be generated, as well as us... |
StackPointCloud/libcloud | refs/heads/trunk | docs/examples/compute/vsphere/connect_url_custom_port.py | 56 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.VSPHERE)
driver = cls(url='https://192.168.1.100:8080/sdk/',
username='admin', password='admin')
print(driver.list_nodes())
# ...
|
robert-kisteleki/ripe.atlas.sagan | refs/heads/master | ripe/atlas/sagan/wifi.py | 3 | # Copyright (c) 2016 RIPE NCC
#
# 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 is distributed in the h... |
punchagan/zulip | refs/heads/master | zerver/views/development/registration.py | 5 | from typing import Any
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from confirmation.models import Confirmation, create_confirmation_link
from zerver.lib.response import json_success
from zerver.lib.subdomains import get_subdo... |
inonit/django-faqflow | refs/heads/master | faqflow/models.py | 1 | from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.contrib.auth import get_user_model
class Comment(models.Model):
author = models.ForeignKey(get_user_model(), verbose_name=_('author'))
body = models.TextField(_('body'))
... |
xorstream/unicorn | refs/heads/master | tests/regress/tcg_liveness_analysis_bug_issue-287.py | 9 | from unicorn import *
from unicorn.arm_const import *
import binascii
MB = 1024 * 1024
PAGE = 4 * 1024
def PrintArmRegisters(uc_emu):
print 'R0 : '+hex(uc_emu.reg_read(UC_ARM_REG_R0))
print 'R1 : '+hex(uc_emu.reg_read(UC_ARM_REG_R1))
print 'R2 : '+hex(uc_emu.reg_read(UC_ARM_REG_R2))
print 'R3 : '+hex... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/building/poi/shared_naboo_tuskcattam_medium.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_naboo_tuskcattam_medium.iff"
result.attribute_template_i... |
mistio/libcloud | refs/heads/trunk | docs/examples/loadbalancer/nttcis/create_ssl_offload_profile.py | 7 | # Create an SSL Offload Profile
import libcloud
def create_ssl_profile(lbdriver):
# Identify the network domain to insert the profile into
net_domain_id = "6aafcf08-cb0b-432c-9c64-7371265db086"
name = "ssl_offload"
# Retrieve the domain certificate to be used int the profile
domain_cert = lbdrive... |
adeepkit01/networks | refs/heads/master | .waf-1.8.13-4da49748f68a49832130c7ef124357f6/waflib/Tools/glib2.py | 11 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os
from waflib import Context,Task,Utils,Options,Errors,Logs
from waflib.TaskGen import taskgen_method,before_method,after_method,feature,extension
from waflib.Configure import conf
@taskgen_m... |
UstadMobile/exelearning-extjs5-mirror | refs/heads/master | twisted/web/woven/controller.py | 14 | # -*- test-case-name: twisted.test.test_woven -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import nested_scopes
__version__ = "$Revision: 1.67 $"[11:-2]
import os
import cgi
import types
from twisted.python import log
from twisted.python import components
... |
maurizioandreotti/D-Rats-0.3.ev | refs/heads/master | ENV/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2930 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
3dfxmadscientist/cbss-server | refs/heads/master | addons/account/wizard/account_period_close.py | 56 | # -*- 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... |
juanpabloaj/pyipinfo | refs/heads/master | setup.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(*paths):
""" read files """
with open(os.path.join(*paths), 'r') as filename:
return filename.read()
setup(
name="pyipinfo",
version="0.1.2",
description="ipinfo.io in the command line",
long_d... |
kutenai/django | refs/heads/master | tests/bash_completion/management/commands/test_command.py | 102 | from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("--list", action="store_true", dest="list", help="Print all options")
def handle(self, *args, **options):
pass
|
kawamon/hue | refs/heads/master | desktop/core/ext-py/pycparser-2.18/pycparser/yacctab.py | 20 |
# yacctab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUB... |
icereval/osf.io | refs/heads/develop | osf/models/validators.py | 2 | # -*- coding: utf-8 -*-
import re
from django.core.validators import URLValidator, validate_email as django_validate_email
from django.core.exceptions import ValidationError as DjangoValidationError
from django.utils.deconstruct import deconstructible
from website.notifications.constants import NOTIFICATION_TYPES
fro... |
dermoth/gramps | refs/heads/master | gramps/gen/lib/styledtexttagtype.py | 10 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Zsolt Foldvari
#
# 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) ... |
wrouesnel/ansible-modules-extras | refs/heads/devel | cloud/amazon/ec2_ami_copy.py | 63 | #!/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... |
Mistobaan/tensorflow | refs/heads/master | tensorflow/contrib/model_pruning/__init__.py | 34 | # 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... |
odejesush/tensorflow | refs/heads/master | venv/lib/python2.7/site-packages/flask/__init__.py | 46 | # -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.12'
# utilities we import from Werkzeug and J... |
sqlobject/sqlobject | refs/heads/master | sqlobject/tests/test_string_id.py | 2 | from sqlobject import SQLObject, StringCol, sqlmeta
from sqlobject.tests.dbtest import setupClass
########################################
# String ID test
########################################
class SOStringID(SQLObject):
class sqlmeta(sqlmeta):
table = 'so_string_id'
idType = str
val =... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/veteran_reward/data_terminal_s2.py | 85615 | import sys
def setup(core, object):
return |
Eraldo/django-autocomplete-light | refs/heads/master | test_project/select2_tagulous/models.py | 2 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from tagulous.models import TagField
@python_2_unicode_compatible
class TestModel(models.Model):
name = models.CharField(max_length=200)
test = TagField()
for_inline = models.ForeignKey(
'self',
n... |
TeamEOS/external_chromium_org | refs/heads/lp5.0 | tools/export_tarball/export_v8_tarball.py | 118 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Creates a tarball with V8 sources, but without .svn directories.
This allows easy packaging of V8, synchronized with browser re... |
frivoal/presto-testo | refs/heads/master | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/demo/streaming/frame_based_client.py | 5 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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... |
chubbymaggie/Mobile-Security-Framework-MobSF | refs/heads/master | DynamicAnalyzer/tools/adb/mac/systrace/systrace-legacy.py | 162 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Android system-wide tracing utility.
This is a tool for capturing a trace that includes data from both userland and
the kernel... |
ricardogsilva/QGIS | refs/heads/master | tests/src/python/test_qgscore.py | 45 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for core functions
.. note:: 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 version.
"""
__a... |
FranManre/PokeMap | refs/heads/develop | pogom/customLog.py | 2 | from .utils import get_pokemon_rarity, get_pokemon_name
from pogom.utils import get_args
from datetime import datetime
args = get_args()
# temporarily disabling because -o and -i is removed from 51f651228c00a96b86f5c38d1a2d53b32e5d9862
# IGNORE = None
# ONLY = None
# if args.ignore:
# IGNORE = [i.lower().strip() ... |
ar7z1/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_selfip.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 F5 Networks 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',
... |
aninternetof/bremen | refs/heads/master | bremenenv/lib/python3.5/site-packages/django/core/validators.py | 32 | from __future__ import unicode_literals
import re
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 import is_vali... |
bartvm/powerline | refs/heads/develop | powerline/lib/watcher/tree.py | 38 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
from powerline.lib.monotonic import monotonic
from powerline.lib.inotify import INotifyError
from powerline.lib.path import realpath
from powerline.lib.watcher.inotify import INotifyTreeWatche... |
infinit/drake | refs/heads/master | src/drake/cxx/flex.py | 1 | # Copyright (C) 2009-2016, Quentin "mefyl" Hocquet
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
from .. import Builder, Node, P... |
s-hertel/ansible | refs/heads/devel | test/lib/ansible_test/_data/quiet_pip.py | 3 | """Custom entry-point for pip that filters out unwanted logging and warnings."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import logging
import re
import runpy
import warnings
BUILTIN_FILTERER_FILTER = logging.Filterer.filter
LOGGING_MESSAGE_FILTER = re.compile("^("
... |
romarcha/cantin_bo | refs/heads/master | python/demo_multiprocess.py | 2 | #!/usr/bin/env python
# -------------------------------------------------------------------------
# This file is part of BayesOpt, an efficient C++ library for
# Bayesian optimization.
#
# Copyright (C) 2011-2014 Ruben Martinez-Cantin <rmcantin@unizar.es>
#
# BayesOpt is free software: you can redistribut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.