repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
potfit/potfit | refs/heads/master | tests/apot/pair/test_apot_pair.py | 3 | import pytest
def test_apot_pair_basic(potfit):
potfit.create_param_file()
potfit.create_potential_file('''
#F 0 1
#T PAIR
#I 0
#E
type lj
cutoff 6.0
epsilon 0.1 0 1
sigma 2.5 1 4
''')
potfit.create_config_file()
potfit.run()
assert potfit.has_no_error()
assert potfit.has_correct_atom_count()
... |
walteryang47/ovirt-engine | refs/heads/eayunos-4.2 | packaging/setup/plugins/ovirt-engine-setup/vmconsole_proxy_helper/system.py | 7 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
emergebtc/muddery | refs/heads/master | muddery/game_template/server/conf/at_initial_setup.py | 1 | """
At_initial_setup module template
Custom at_initial_setup method. This allows you to hook special
modifications to the initial server startup process. Note that this
will only be run once - when the server starts up for the very first
time! It is called last in the startup process and can thus be used to
overload t... |
marcoscaceres/bedrock | refs/heads/master | bin/update/deploy-demo5.py | 23 | """
Deployment for Bedrock on www-demo5.allizom.org.
Requires commander (https://github.com/oremj/commander) which is installed on
the systems that need it.
"""
import os
import sys
# these files are symlinked as 'update.py' in the project root.
ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.append(ROOT)
... |
delitamakanda/BukkakeGram | refs/heads/master | actions/models.py | 1 | from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
# Create your models here.
class Action(models.Model):
user = models.ForeignKey(User, related_name='actions', db_inde... |
ifduyue/sentry | refs/heads/master | src/sentry/eventstream/base.py | 2 | from __future__ import absolute_import
import logging
from sentry.utils.services import Service
from sentry.tasks.post_process import post_process_group
logger = logging.getLogger(__name__)
class EventStream(Service):
__all__ = (
'publish',
)
def publish(self, group, event, is_new, is_sample,... |
stephawe/kerrokantasi | refs/heads/master | democracy/views/__init__.py | 2 | from .contact_person import ContactPersonViewSet
from .hearing import HearingViewSet
from .label import LabelViewSet
from .section import ImageViewSet, SectionViewSet, RootSectionViewSet
from .section_comment import SectionCommentViewSet, CommentViewSet
from .user import UserDataViewSet
__all__ = [
"ContactPersonV... |
suutari-ai/shoop | refs/heads/master | shuup/front/admin_module/carts/views/__init__.py | 3 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from ._list import CartListView
__all__ = ["CartListView"]
|
aldebaran/qibuild | refs/heads/master | python/qitest/test/test_qitest_run.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test QiTest Run """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ impo... |
jreese/pyranha | refs/heads/master | pyranha/engine/channel.py | 1 | # Copyright (c) 2012 John Reese
# Licensed under the MIT License
from __future__ import absolute_import, division
import time
from pyranha import async_ui_message
from pyranha.engine.listener import Listener
from pyranha.logging import log
class Channel(Listener):
def __init__(self, network, name):
self... |
janek-warchol/lilypond | refs/heads/master | scripts/build/html-to-texi.py | 9 | #! @PYTHON@
import re
import sys
header = '''
'''
print header
body = sys.stdin.read ()
body = re.sub ('(?ms)<!--\s*\n*(.*?)FILL-IN(.*?)\s*\n*!?-->', '', body)
body = re.sub ('(?ms)\n*\s*<!--\s*\n*(.*?)\s*\n*!?-->', r'@ignore\n\1\n@end ignore', body)
body = re.sub ('(?ms)<a(?:\s|\n)*href="([^"]*)"\s*>(.*?)</a>', r'... |
GuillaumeSeren/alot | refs/heads/master | alot/widgets/globals.py | 2 | # Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
"""
This contains alot-specific :class:`urwid.Widget` used in more than one mode.
"""
import re
import operator
import urwid
from ..h... |
incaser/bank-payment | refs/heads/8.0 | account_banking_sepa_direct_debit/migrations/8.0.0.2/post-migration.py | 15 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Akretion (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
JackDandy/SickGear | refs/heads/master | lib/hachoir_py2/parser/image/exif.py | 2 | """
EXIF metadata parser; also parses TIFF file headers.
Author: Victor Stinner, Robert Xiao
References:
- Exif 2.2 Specification (JEITA CP-3451)
http://www.exif.org/Exif2-2.PDF
- TIFF 6.0 Specification
http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
"""
from hachoir_py2.field import (FieldSet, ... |
lxneng/incubator-airflow | refs/heads/master | tests/contrib/sensors/__init__.py | 353 | # -*- coding: utf-8 -*-
#
# 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
#... |
spring-week-topos/nova-week | refs/heads/spring-week | nova/virt/xenapi/image/vdi_through_dev.py | 14 | # Copyright 2013 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 requ... |
Nicop06/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_recordset.py | 19 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise
#
# 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.
#
# T... |
alsrgv/tensorflow | refs/heads/master | tensorflow/contrib/slim/python/slim/data/dataset.py | 163 | # 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... |
amenonsen/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_pim_interface.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = r'''
---
module: nxos_pim_int... |
xbmc/atv2 | refs/heads/atv2 | xbmc/lib/libPython/Python/Lib/idlelib/run.py | 9 | import sys
import os
import linecache
import time
import socket
import traceback
import thread
import threading
import Queue
import CallTips
import RemoteDebugger
import RemoteObjectBrowser
import StackViewer
import rpc
import __main__
LOCALHOST = '127.0.0.1'
try:
import warnings
except ImportError:
pass
el... |
cytec/SickRage | refs/heads/master | lib/html5lib/treewalkers/etree.py | 658 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from six import text_type
from . im... |
cchamberlain/gyp | refs/heads/master | test/rules-rebuild/src/make-sources.py | 337 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
assert len(sys.argv) == 4, sys.argv
(in_file, c_file, h_file) = sys.argv[1:]
def write_file(filename, contents):
open(filenam... |
GIC-de/ncclient | refs/heads/master | test/unit/devices/test_junos.py | 2 | import unittest
from ncclient.devices.junos import *
import ncclient.transport
from mock import patch
import paramiko
import sys
xml = '''<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="no"/>
<xsl:template match="/|comment()|processing-i... |
adrienbrault/home-assistant | refs/heads/dev | homeassistant/components/sonos/exception.py | 6 | """Sonos specific exceptions."""
from homeassistant.components.media_player.errors import BrowseError
class UnknownMediaType(BrowseError):
"""Unknown media type."""
|
PlayUAV/MissionPlanner | refs/heads/master | Lib/cgi.py | 50 | #! /usr/local/bin/python
# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin... |
wilsoncampusano/gae-boilerplate | refs/heads/master | bp_includes/external/httplib2/socks.py | 91 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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 notice, this
... |
vFense/vFenseAgent-nix | refs/heads/development | agent/deps/mac/Python-2.7.5/lib/python2.7/test/test_slice.py | 114 | # tests for slice objects; in particular the indices method.
import unittest
from test import test_support
from cPickle import loads, dumps
import sys
class SliceTest(unittest.TestCase):
def test_constructor(self):
self.assertRaises(TypeError, slice)
self.assertRaises(TypeError, slice, 1, 2, 3, ... |
cynicaldevil/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/genscript.py | 191 | """ (deprecated) generate a single-file self-contained version of pytest """
import os
import sys
import pkgutil
import py
import _pytest
def find_toplevel(name):
for syspath in sys.path:
base = py.path.local(syspath)
lib = base/name
if lib.check(dir=1):
return lib
mo... |
jamielennox/tempest | refs/heads/master | tempest/api/compute/admin/test_servers.py | 1 | # Copyright 2013 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
#
# Unless required by applicable law or agreed t... |
nuuuboo/odoo | refs/heads/8.0 | addons/website_report/report.py | 257 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
Lh4cKg/sl4a | refs/heads/master | python/src/Lib/curses/ascii.py | 396 | """Constants and membership tests for ASCII characters"""
NUL = 0x00 # ^@
SOH = 0x01 # ^A
STX = 0x02 # ^B
ETX = 0x03 # ^C
EOT = 0x04 # ^D
ENQ = 0x05 # ^E
ACK = 0x06 # ^F
BEL = 0x07 # ^G
BS = 0x08 # ^H
TAB = 0x09 # ^I
HT = 0x09 # ^I
LF = 0x0a # ^J
NL =... |
Aloomaio/googleads-python-lib | refs/heads/master | examples/ad_manager/v201805/company_service/update_companies.py | 1 | #!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
LarsFronius/ansible | refs/heads/devel | lib/ansible/modules/cloud/misc/proxmox_kvm.py | 41 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Abdoul Bah (@helldorado) <bahabdoul at gmail.com>
"""
Ansible module to manage Qemu(KVM) instance in Proxmox VE cluster.
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 Fr... |
MihaiMoldovanu/ansible | refs/heads/devel | lib/ansible/modules/messaging/rabbitmq_queue.py | 39 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1'... |
tendant/ansible-modules-core | refs/heads/devel | packaging/os/rhn_register.py | 77 | #!/usr/bin/python
# (c) James Laska
#
# 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.
#
# A... |
esikachev/scenario | refs/heads/test_cases | sahara/tests/unit/plugins/vanilla/hadoop2/test_plugin.py | 9 | # Copyright (c) 2014 Mirantis 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 agreed to in writ... |
benhc123/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/win/gyptest-cl-character-set.py | 344 | #!/usr/bin/env python
# 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.
"""
Make sure character set setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.Tes... |
tboyce021/home-assistant | refs/heads/dev | tests/testing_config/custom_components/test/binary_sensor.py | 21 | """
Provide a mock binary sensor platform.
Call init before using it in your tests to ensure clean test data.
"""
from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity
from tests.common import MockEntity
ENTITIES = {}
def init(empty=False):
"""Initialize the platform with entiti... |
decvalts/iris | refs/heads/master | lib/iris/tests/unit/quickplot/test_plot.py | 15 | # (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
gmuraleekrishna/rails-workshop-presentation | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py | 2687 | #!/usr/bin/env python
# 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.
""" Unit tests for the msvs.py file. """
import gyp.generator.msvs as msvs
import unittest
import StringIO
class TestSequenceFunctions(uni... |
chen0031/nupic | refs/heads/master | nupic/data/generators/distributions.py | 49 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... |
lukeWoodbury/SeniorDesignGroup3 | refs/heads/master | fileupdate.py | 1 | def returnsequences(file, val):
newline = None
with open(file,"r") as json_file:
line = json_file.readline()
wordlist = line.split()
for i in range(len(wordlist)):
if wordlist[i] == '"return_sequences":':
wordlist[i + 1] = val + ','
newline = ' '.join(... |
aerissecure/rdpy | refs/heads/master | pyasn1/v1/type/tag.py | 5 | # ASN.1 types tags
try:
from sys import version_info
except ImportError:
version_info = (0, 0) # a really early version
from operator import getslice
from types import SliceType
from string import join
from pyasn1 import error
tagClassUniversal = 0x00
tagClassApplication = 0x40
tagClassContext = 0x80
tagClas... |
svleeuwen/dont-be-late-appengine | refs/heads/master | third_party/py/lib/pytz/exceptions.py | 657 | '''
Custom exceptions raised by pytz.
'''
__all__ = [
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
'NonExistentTimeError',
]
class UnknownTimeZoneError(KeyError):
'''Exception raised when pytz is passed an unknown timezone.
>>> isinstance(UnknownTimeZoneError(), LookupError)... |
fabioz/PyDev.Debugger | refs/heads/master | pydevd_attach_to_process/winappdbg/compat.py | 102 | # Partial copy of https://bitbucket.org/gutworth/six/src/8e634686c53a35092dd705172440a9231c90ddd1/six.py?at=default
# With some differences to take into account that the iterXXX version may be defined in user code.
# Original __author__ = "Benjamin Peterson <benjamin@python.org>"
# Base __version__ = "1.7.3"
# Copyri... |
romain-intel/bcc | refs/heads/master | tools/runqlat.py | 2 | #!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# runqlat Run queue (scheduler) latency as a histogram.
# For Linux, uses BCC, eBPF.
#
# USAGE: runqlat [-h] [-T] [-m] [-P] [-L] [-p PID] [interval] [count]
#
# This measures the time a task spends waiting on a run queue for a turn
# on-CPU, a... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.2/tests/regressiontests/dispatch/tests/test_saferef.py | 70 | from django.dispatch.saferef import *
import unittest
class Test1(object):
def x(self):
pass
def test2(obj):
pass
class Test2(object):
def __call__(self, obj):
pass
class Tester(unittest.TestCase):
def setUp(self):
ts = []
ss = []
for x in xrange(5000):
... |
sirpercival/fourdtictactoe | refs/heads/master | main.py | 1 | import numpy as np
from functools import partial
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.modalview import ModalView
from kivy.properties import ObjectProperty, NumericProperty, ListProperty, DictProperty
from k... |
yawnosnorous/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_winreg.py | 51 | # Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys
import unittest
from test import support
threading = support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module doesn't exist
support... |
jonahbull/rabbitpy | refs/heads/master | rabbitpy/heartbeat.py | 1 | """
The heartbeat checker implements heartbeat check behavior and is non-client
facing.
"""
import logging
import threading
import time
from rabbitpy import exceptions
LOGGER = logging.getLogger(__name__)
class Checker(object):
MAX_MISSED_HEARTBEATS = 2
def __init__(self, io, exception_queue):
se... |
damiansoriano/odoo | refs/heads/master | addons/point_of_sale/report/pos_users_product.py | 380 | # -*- 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... |
blrm/openshift-tools | refs/heads/stg | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/src/lib/rolebinding.py | 84 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class RoleBindingConfig(object):
''' Handle rolebinding config '''
# pylint: disable=too-many-arguments
def __init__(self,
name,
namespace,
kubeconfig,
group... |
sebcourtois/pypeline-tool-devkit | refs/heads/master | pytd/core/metaobject.py | 1 |
from pytd.util.logutils import logMsg
from pytd.util.sysutils import argToTuple, getCaller
from pytd.util.sysutils import toStr
# from pytd.util.sysutils import getCaller
from pytd.util.strutils import upperFirst, lowerFirst
from .metaproperty import BasePropertyFactory
class MetaObject(object):
classReprAttr =... |
relic7/prodimages | refs/heads/master | consolidated_modules/jb_serverops.py | 1 | # -*- coding: utf-8 -*-
"""
Created on WED JUL 24 11:23:55 2013
Functions for HTTP Server Starting and Get/Receive Request - POST,PUT,GET, etc.
@author: jb
"""
|
fxia22/ASM_xf | refs/heads/master | PythonD/site_python/mx/DateTime/DateTime.py | 2 | """ Python part of the low-level DateTime[Delta] type implementation.
Copyright (c) 1998-2001, Marc-Andre Lemburg; mailto:mal@lemburg.com
Copyright (c) 2000-2001, eGenix.com Software GmbH; mailto:info@egenix.com
See the documentation for further information on copyrights,
or contact the author. All Rig... |
broferek/ansible | refs/heads/devel | test/lib/ansible_test/_data/sanity/code-smell/action-plugin-docs.py | 66 | #!/usr/bin/env python
"""Test to verify action plugins have an associated module to provide documentation."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import sys
def main():
"""Main entry point."""
paths = sys.argv[1:] or sys.stdin.read().splitlines()
... |
sunqb/oa_qian | refs/heads/master | flask/Lib/encodings/iso2022_jp.py | 816 | #
# iso2022_jp.py: Python Unicode Codec for ISO2022_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... |
JioCloud/tempest | refs/heads/master | tempest/common/generator/valid_generator.py | 28 | # Copyright 2014 Deutsche Telekom AG
# 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 requi... |
lorenzo-desantis/mne-python | refs/heads/master | examples/io/plot_objects_from_arrays.py | 18 | """
=====================================
Creating MNE objects from data arrays
=====================================
In this simple example, the creation of MNE objects from
numpy arrays is demonstrated. In the last example case, a
NEO file format is used as a source for the data.
"""
# Author: Jaakko Leppakangas <ja... |
f4fhh/mchf-github | refs/heads/active-devel | mchf-eclipse/support/ui/menu/ui_menu_structure_mdtable.py | 4 | #!/usr/bin/python
"""
2016-12-24 HB9ocq, DB4ple - support program to document the menu structure of uhsdr amateur radio firmware
2017-01-01 HB9ocq - refinement
2017-01-06 HB9ocq - following change in definition of MenuDescriptor
relies upon module ui_menu_structure_c2py.py in the same directory
"""
from ui_menu_s... |
likexx/riftwarrior | refs/heads/master | code/external/emscripten/third_party/ply/test/lex_optimize2.py | 174 | # -----------------------------------------------------------------------------
# lex_optimize2.py
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = (
'NAME','NUMBER',
'PLUS','MINUS','TIMES... |
klmitch/nova | refs/heads/master | nova/api/openstack/compute/keypairs.py | 3 | # Copyright 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 requ... |
fevxie/odoo | refs/heads/8.0 | addons/portal_project_issue/tests/test_access_rights.py | 338 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
kxliugang/edx-platform | refs/heads/master | lms/djangoapps/courseware/model_data.py | 42 | """
Classes to provide the LMS runtime data storage to XBlocks.
:class:`DjangoKeyValueStore`: An XBlock :class:`~KeyValueStore` which
stores a subset of xblocks scopes as Django ORM objects. It wraps
:class:`~FieldDataCache` to provide an XBlock-friendly interface.
:class:`FieldDataCache`: A object which pro... |
dturner-tw/pants | refs/heads/master | src/python/pants/backend/jvm/targets/credentials.py | 2 | # 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)
from pants.build_gra... |
ossdemura/django-miniblog | refs/heads/dev | src/Lib/site-packages/pip/utils/build.py | 899 | from __future__ import absolute_import
import os.path
import tempfile
from pip.utils import rmtree
class BuildDirectory(object):
def __init__(self, name=None, delete=None):
# If we were not given an explicit directory, and we were not given an
# explicit delete option, then we'll default to del... |
hourchallenge/zot | refs/heads/master | zot.py | 1 | import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import sqlalchemy as sql
from item import Item
class Zotero:
def __init__(self, zotero_dir):
self.zotero_dir = zotero_dir
self.zotero_db_path = os.path.abspath(os.path.join(zotero_dir, 'zotero.sqlite'))
self.zotero_storage_pa... |
awerner/pymime | refs/heads/newstyle | pymime/django_app/pymime_attachmentservice/views.py | 1 | from django.shortcuts import get_object_or_404, render_to_response
from pymime.django_app.pymime_attachmentservice.models import Mail, Problem_Report
from pymime.django_app.pymime_attachmentservice.forms import ReportForm
from django.template.context import RequestContext
def show_mail(request, uuid):
m = get_objec... |
coedfetr/STTP-python | refs/heads/master | PyPractice/Q2.py | 1 | def vow(char):
vowels = ('a', 'e', 'i', 'o', 'u')
if char not in vowels:
return False
return True
def translate(string):
results = []
for word in string.split():
result = ''
for char in word:
if not vow(char):
result += char + 'o' + char
... |
davidyezsetz/kuma | refs/heads/master | vendor/packages/nose/unit_tests/support/foo/test_foo.py | 1307 | pass
|
NL66278/OCB | refs/heads/8.0 | openerp/report/render/rml2pdf/color.py | 443 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
imsally/redash | refs/heads/master | old_migrations/0007_add_schedule_to_queries.py | 20 | from playhouse.migrate import PostgresqlMigrator, migrate
from redash.models import db
from redash import models
if __name__ == '__main__':
db.connect_db()
migrator = PostgresqlMigrator(db.database)
with db.database.transaction():
migrate(
migrator.add_column('queries', 'schedule', mo... |
firebitsbr/powerline | refs/heads/develop | tests/test_provided_config_files.py | 3 | # vim:fileencoding=utf-8:noet
'''Dynamic configuration files tests.'''
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import os
import json
import logging
import tests.vim as vim_module
from tests.lib import Args, urllib_read, replace_attr
from tests import TestCase... |
ax003d/django-diet | refs/heads/master | diet/migrations/0002_auto_20150315_1202.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('diet', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='diet',
name='deleted',
... |
Crescent-Saturn/Hello_Python | refs/heads/master | Week5/Exercises/ exercises_mouse_day_template.py | 1 | # Day to number problem
###################################################
# Student should enter code below
day_list = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
def day_to_number(day):
pos = 0
for i in range(len(day_list)):
if day_list[i] == day:
pos... |
vmindru/ansible | refs/heads/devel | test/runner/lib/diff.py | 203 | """Diff parsing functions and classes."""
from __future__ import absolute_import, print_function
import re
import textwrap
import traceback
from lib.util import (
ApplicationError,
)
def parse_diff(lines):
"""
:type lines: list[str]
:rtype: list[FileDiff]
"""
return DiffParser(lines).files
... |
wfarner/aurora | refs/heads/master | src/main/python/apache/thermos/runner/thermos_runner.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 ... |
whitmo/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes/hooks/kubernetes_installer.py | 213 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
40223222/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/color.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
DiegusMiestro/DokSys | refs/heads/master | app/doksys/settings.py | 1 | """
Django settings for doksys project.
Generated by 'django-admin startproject' using Django 1.11.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... |
bt3gl/My-Gray-Hacker-Resources | refs/heads/master | Network_and_802.11/scanner/IPHeader.py | 4 | #!/usr/bin/env python
__author__ = "bt3"
''' A class for the IP header'''
import os
import struct
import socket
import ctypes
class IP(ctypes.Structure):
_fields_ = [
('ihl', ctypes.c_ubyte, 4),
('version', ctypes.c_ubyte, 4),
('tos', ctypes.c_ubyte),
('len',... |
umitproject/openmonitor-aggregator | refs/heads/master | django/utils/crypto.py | 61 | """
Django's standard crypto functions and utilities.
"""
import hmac
import struct
import hashlib
import binascii
import operator
import time
# Use the system PRNG if possible
import random
try:
random = random.SystemRandom()
using_sysrandom = True
except NotImplementedError:
import warnings
warnings... |
brinbois/Sick-Beard | refs/heads/development | lib/hachoir_core/version.py | 93 | PACKAGE = "hachoir-core"
VERSION = "1.3.3"
WEBSITE = 'http://bitbucket.org/haypo/hachoir/wiki/hachoir-core'
LICENSE = 'GNU GPL v2'
|
fniephaus/alfred-pocket | refs/heads/master | src/pocket_launcher.py | 1 | import argparse
import os
import subprocess
from pocket_api import Pocket, PocketException
from pocket import refresh_list
from workflow import Workflow
import config
WF = Workflow()
POCKET_URL = 'https://app.getpocket.com/read/%s'
def execute():
args = parse_args(WF.args)
if args.query is None:
pr... |
ArthurPBressan/sisgep1 | refs/heads/master | migrations/versions/42b434e7a1e3_conn_email.py | 2 | """conn email
Revision ID: 42b434e7a1e3
Revises: e1855559096
Create Date: 2015-09-27 15:45:45.647993
"""
# revision identifiers, used by Alembic.
revision = '42b434e7a1e3'
down_revision = 'e1855559096'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pleas... |
tmenjo/cinder-2015.1.0 | refs/heads/master | cinder/tests/scheduler/test_capacity_weigher.py | 4 | # Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
trynd/wren-gui | refs/heads/master | lib/paths.py | 1 | #
# NAME
#
# paths.py
#
# DESCRIPTION
#
# Wren GUI application's system path constants file.
#
# AUTHOR
#
# Originally written by Michael Spencer.
# Maintained by the Wren GUI project developers.
#
#
# The Wren GUI project; Copyright 2015 the Wren GUI project developers.
# See the COPYRIGHT file in the top-leve... |
openhdf/enigma2-wetek | refs/heads/master | lib/python/Plugins/SystemPlugins/DeviceManager/HddMount.py | 16 | # for localized messages
from . import _
from enigma import *
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
from Components.GUIComponent import GUIComp... |
elkingtonmcb/shogun | refs/heads/develop | examples/undocumented/python_modular/structure_plif_hmsvm_mosek.py | 24 | #!/usr/bin/env python
parameter_list=[[100, 250, 10, 2]]
def structure_plif_hmsvm_mosek (num_examples, example_length, num_features, num_noise_features):
from modshogun import RealMatrixFeatures, TwoStateModel, StructuredAccuracy
try:
from modshogun import PrimalMosekSOSVM
except ImportError:
print("Mosek not... |
bbbenja/SickRage | refs/heads/master | lib/sqlalchemy/dialects/postgresql/ranges.py | 79 | # Copyright (C) 2013-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .base import ischema_names
from ... import types as sqltypes
__all__ = ('INT4RANGE', 'INT8RANGE', ... |
knkinnard/kkinnard-byte3 | refs/heads/master | lib/oauth2client/_pycrypto_crypt.py | 40 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
leotrubach/sourceforge-allura | refs/heads/dev | Allura/allura/tests/unit/test_helpers/test_ago.py | 3 | from mock import patch
from datetime import datetime
from allura.lib import helpers
class TestAgo:
def setUp(self):
self.start_time = datetime(2010, 1, 1, 0, 0, 0)
def test_that_empty_times_are_phrased_in_minutes(self):
self.assertTimeSince('0 minutes ago', 2010, 1, 1, 0, 0, 0)
def test... |
codemasteroy/py-finvoice | refs/heads/master | generators/__init__.py | 1 | ###
# Copyright 2014 Code Master Oy (http://www.codemaster.fi/)
#
# This file is part of py-finvoice.
#
# py-finvoice 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 y... |
Sing-Li/go-buildpack | refs/heads/master | builds/runtimes/python-2.7.6/lib/python2.7/test/test_zipfile64.py | 159 | # Tests of the full ZIP64 functionality of zipfile
# The test_support.requires call is the only reason for keeping this separate
# from test_zipfile
from test import test_support
# XXX(nnorwitz): disable this test by looking for extra largfile resource
# which doesn't exist. This test takes over 30 minutes to run in ... |
nnit-unix-cn/Janus | refs/heads/master | jumpserver/templatetags/__init__.py | 41 | __author__ = 'Hudie'
|
DrSkippy/Gnacs | refs/heads/master | acscsv/__init__.py | 1 | #__all__ = [
# 'disqus_acs'
# , 'twitter_acs'
# , 'twitter_acs_fields'
# , 'wordpress_acs'
# , 'snowflake'
# , 'acscsv'
# ]
|
Jmeyer1292/robotiq | refs/heads/hydro-devel | robotiq_s_model_control/src/robotiq_s_model_control/baseSModel.py | 7 | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Robotiq, 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 copyr... |
dslomov/intellij-community | refs/heads/master | python/testData/override/staticMethod_after.py | 79 | class A:
@staticmethod
def foo(cls):
cls.k = 3
class B(A):
@staticmethod
def foo(cls):
<selection>A.foo(cls)</selection>
|
LuciusV/ORCA-pyPDOS | refs/heads/master | functions.py | 1 | import numpy as np
def Gaussian(Center, Smear, Norm, Domain):
return Norm * np.exp( - 0.5 * (Domain - Center) ** 2 / Smear ** 2 )
def dump(args, suffix, x, y):
fname = args.filename.split('.out')[0] + suffix
np.savetxt(fname, np.transpose([x,y])) |
coffenbacher/askbot-devel | refs/heads/master | askbot/migrations/0001_initial.py | 15 | # encoding: utf-8
import os
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from askbot.migrations_api import safe_add_column
app_dir_name = os.path.basename(os.path.dirname(os.path.dirname(__file__)))
class Migration(SchemaMigration):
def forwards(se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.