repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
dan1/horizon-proto | refs/heads/master | openstack_dashboard/dashboards/identity/ngusers/panel.py | 38 | # Copyright 2015 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 to in writing, s... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/mover/exceptElse.py | 83 |
try:
print(zoo(1).foo(2))
except:
print<caret>(zoo(0).foo(2)) # <- move statement up here
else:
a = 1 |
RafaelCosman/pybrain | refs/heads/master | examples/rl/environments/cartpole/cart_all.py | 30 | #!/usr/bin/env python
#########################################################################
# Reinforcement Learning with several optimization algorithms
# on the CartPoleEnvironment
#
# Requirements: pylab (for plotting only). If not available, comment the
# last 3 lines out
######################################... |
azureplus/chromium_depot_tools | refs/heads/master | git_cherry_pick_upload.py | 28 | #!/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.
"""Upload a cherry pick CL to rietveld."""
import md5
import optparse
import subprocess2
import sys
import auth
from git_cl import C... |
snarfed/beautifulsoup | refs/heads/master | bs4/tests/test_lxml.py | 115 | """Tests to ensure that the lxml tree builder generates good trees."""
import re
import warnings
try:
import lxml.etree
LXML_PRESENT = True
LXML_VERSION = lxml.etree.LXML_VERSION
except ImportError, e:
LXML_PRESENT = False
LXML_VERSION = (0,)
if LXML_PRESENT:
from bs4.builder import LXMLTreeB... |
mozilla/relman-auto-nag | refs/heads/master | auto_nag/log.py | 2 | # 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/.
import argparse
import os
from libmozdata import utils as lmdutils
from . import mail, utils
def clean():
path =... |
mzizzi/ansible | refs/heads/devel | lib/ansible/modules/commands/shell.py | 13 | # There is no actual shell module source, when you use 'shell' in ansible,
# it runs the 'command' module with special arguments and it behaves differently.
# See the command source and the comment "#USE_SHELL".
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it und... |
sprax/python | refs/heads/master | txt/xdv.py | 1 | #!/usr/bin/env python3
'''
XDV == eXchange (I/O) Depending on Verbosity.
Basic debugging output for Python 3.5+
'''
XDV_VERBOSITY = None
XDV_DEFAULT = 0
def printv(level, verbose, *args, **kwargs):
'''
prints args with kwargs if level < verbose.
Lightweight conditional output.
'''
if level < verb... |
ol-loginov/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/BuiltinsPy3.py | 49 | def test_operators():
print(2 + <warning descr="Expected type 'Number', got 'str' instead">'foo'</warning>)
print(b'foo' + <warning descr="Expected type 'bytes', got 'str' instead">'bar'</warning>)
print(b'foo' + <warning descr="Expected type 'bytes', got 'int' instead">3</warning>)
def test_numerics():
... |
imankulov/sentry | refs/heads/master | src/sentry/db/exceptions.py | 38 | """
sentry.db.exceptions
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
class QueryError(Exception):
pass
class CannotResolveExpression(Exception):
pass
|
SujaySKumar/django | refs/heads/master | django/template/backends/base.py | 584 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
from django.core.exceptions import (
ImproperlyConfigured, SuspiciousFileOperation,
)
from django.template.utils import get_app_template_dirs
from django.utils._os import safe_join
from django.util... |
Kimanicodes/wananchi | refs/heads/master | app/reports/__init__.py | 1 | from flask import Blueprint
reports = Blueprint('reports', __name__)
from . import views
|
gtko/CouchPotatoServer | refs/heads/develop | libs/apscheduler/triggers/cron/__init__.py | 103 | from datetime import date, datetime
from apscheduler.triggers.cron.fields import *
from apscheduler.util import datetime_ceil, convert_to_datetime, iteritems
class CronTrigger(object):
FIELD_NAMES = ('year', 'month', 'day', 'week', 'day_of_week', 'hour',
'minute', 'second')
FIELDS_MAP = {'... |
rjeli/scikit-image | refs/heads/master | skimage/future/setup.py | 48 |
def configuration(parent_package='skimage', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('future', parent_package, top_path)
config.add_subpackage('graph')
return config
if __name__ == "__main__":
from numpy.distutils.core import setup
config = co... |
hassanabidpk/django | refs/heads/master | tests/gis_tests/gdal_tests/test_geom.py | 256 | import json
import unittest
from binascii import b2a_hex
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.utils.six.moves import range
from ..test_data import TestDataMixin
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
if... |
opensourcechipspark/platform_external_chromium_org | refs/heads/master | tools/telemetry/telemetry/core/platform/win_platform_backend.py | 23 | # Copyright (c) 2013 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.
import collections
import ctypes
import os
import re
import subprocess
try:
import pywintypes # pylint: disable=F0401
import win32api # pylint: dis... |
spdx/spdx-github | refs/heads/master | tests/unit_test.py | 1 | # Copyright (c) Anna Buhman.
#
# 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... |
Thielak/program-y | refs/heads/rc | src/test/aiml_tests/datetime_tests/test_datetime_aiml.py | 1 | import unittest
import os
from test.aiml_tests.client import TestClient
from programy.config import BrainFileConfiguration
unittest.util._MAX_LENGTH=2000
class BasicTestClient(TestClient):
def __init__(self):
TestClient.__init__(self, debug=True)
def load_configuration(self, arguments):
supe... |
tahmid-tanzim/youtube-dl | refs/heads/master | youtube_dl/extractor/yourupload.py | 142 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class YourUploadIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:yourupload\.com/watch|
embed\.yourupload\.com|
embed\.yucache\.net
)/(?P<id>[A-Za-z0-9]+)
'''
... |
zhouzhenghui/python-for-android | refs/heads/master | python3-alpha/extra_modules/pyxmpp2/ext/component.py | 46 | #
# (C) Copyright 2003-2010 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... |
fbagirov/scikit-learn | refs/heads/master | sklearn/svm/setup.py | 321 | import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('svm', parent_package, top_path)
config.add_subpackage('tests')
# Section L... |
matrix-static/Triangle | refs/heads/master | _baseline/refer/modules/ionicons/2.0.1/builder/generate.py | 357 | from subprocess import call
import os
import json
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
LESS_FOLDER_... |
fmarczin/simplekv | refs/heads/master | tests/test_azure_store.py | 2 | from uuid import uuid4 as uuid
from simplekv._compat import ConfigParser, pickle
from simplekv.net.azurestore import AzureBlockBlobStore
from simplekv.contrib import ExtendedKeyspaceMixin
from basic_store import BasicStore
from conftest import ExtendedKeyspaceTests
import pytest
pytest.importorskip('azure.storage')
... |
GNOME/gnome-music | refs/heads/master | gnomemusic/views/albumsview.py | 1 | # Copyright 2019 The GNOME Music Developers
#
# GNOME Music is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# GNOME Music is distribu... |
vrv/tensorflow | refs/heads/master | tensorflow/tensorboard/tensorboard.py | 25 | # 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... |
turnkeylinux/tklbam-duplicity | refs/heads/master | duplicity/backends/_boto_single.py | 4 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... |
twisteroidambassador/udpack | refs/heads/master | udpack/packers_base.py | 1 | """Implements plug-in packers and metaclasses used to modify packers."""
import asyncio
import itertools
import random
__all__ = ['make_pack_only_packer', 'make_unpack_only_packer', 'make_reverse_packer',
'NoOpPacker', 'CallSoonPacker', 'ConstDelayPacker', 'DelayPacker',
'RandomDropPacker', 'Shu... |
raurodse/webinterfaces | refs/heads/master | webinterface/application.py | 1 | from flask import Flask
from flask import render_template
from flask import request
import netinterfaces
import os.path
import os
app = Flask(__name__)
@app.route('/')
def principal():
list_interfaces = app.network_interface.get_real_list_interfaces()
for x in app.network_interface.get_list_interfaces():
... |
MiyamotoAkira/kivy | refs/heads/master | kivy/lib/osc/__init__.py | 47 | '''
OSC
===
This is an heavy modified version of PyOSC that Kivy uses internally for TUIO
providers.
'''
__version__ = "0"
__author__ = "www.ixi-software.net"
__license__ = "GNU General Public License"
__all__ = ("oscAPI", "OSC")
from .OSC import *
from .oscAPI import *
|
jswanljung/iris | refs/heads/master | lib/iris/tests/unit/util/test_broadcast_to_shape.py | 17 | # (C) British Crown Copyright 2013 - 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... |
sdsu-its/key-server-admin | refs/heads/master | packages/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
maas/maas | refs/heads/master | setup.py | 1 | # Copyright 2012-2021 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
from setuptools import setup
setup()
|
DougFirErickson/mavlink | refs/heads/master | pymavlink/tools/mavtomfile.py | 45 | #!/usr/bin/env python
'''
convert a MAVLink tlog file to a MATLab mfile
'''
import sys, os
import re
from pymavlink import mavutil
def process_tlog(filename):
'''convert a tlog to a .m file'''
print("Processing %s" % filename)
mlog = mavutil.mavlink_connection(filename, dialect=args.dialect, zero_time_... |
vmarkovtsev/django | refs/heads/master | tests/datatypes/models.py | 449 | """
This is a basic model to test saving and loading boolean and date-related
types, which in the past were problematic for some database backends.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Donut(models.Model):
name = models.... |
asedunov/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/admin/templatetags/log.py | 310 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... |
commtrack/temp-aquatest | refs/heads/master | apps/smsnotifications/forms.py | 2 | from django import forms
from django.forms import ModelForm
from smsnotifications.models import SmsNotification
class SmsNotificationForm(ModelForm):
class Meta:
model = SmsNotification
exclude = ('modified','created',) |
kevinlondon/sentry | refs/heads/master | api-docs/generator.py | 7 | import os
import zlib
import json
import click
import urlparse
import logging
from datetime import datetime
from subprocess import Popen, PIPE
from contextlib import contextmanager
HERE = os.path.abspath(os.path.dirname(__file__))
SENTRY_CONFIG = os.path.join(HERE, 'sentry.conf.py')
# No sentry or django imports bef... |
cognitiveclass/edx-platform | refs/heads/master | common/djangoapps/geoinfo/tests/test_middleware.py | 137 | """
Tests for CountryMiddleware.
"""
from mock import patch
import pygeoip
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
from geoinfo.middleware import CountryMiddleware
from student.tests.factories import UserFactory, A... |
trishnaguha/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_device_ntp.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, 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',
... |
osh/gnuradio | refs/heads/master | gr-blocks/python/blocks/qa_type_conversions.py | 33 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... |
mstana/tuned | refs/heads/master | tuned/plugins/plugin_mounts.py | 4 | import base
from decorators import *
from subprocess import Popen,PIPE
import tuned.logs
import tuned.utils.commands
import glob
log = tuned.logs.get()
class MountsPlugin(base.Plugin):
"""
Plugin for tuning options of mount-points.
"""
@classmethod
def _generate_mountpoint_topology(cls):
"""
Gets the inform... |
Belxjander/Kirito | refs/heads/master | Python-3.5.0-main/Lib/test/test_httplib.py | 7 | import errno
from http import client
import io
import itertools
import os
import array
import socket
import unittest
TestCase = unittest.TestCase
from test import support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.pem')
# Self-signed cert fil... |
was4444/chromium.src | refs/heads/nw15 | third_party/closure_compiler/processor.py | 45 | # 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.
"""Process Chrome resources (HTML/CSS/JS) to handle <include> and <if> tags."""
from collections import defaultdict
import re
import os
class LineNumber(o... |
DebrahR/project2 | refs/heads/master | server/lib/werkzeug/debug/repr.py | 313 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... |
kantel/processingpy | refs/heads/master | sketches/pandemie/proband.py | 1 | # coding=utf-8
from random import randint
class Proband():
def __init__(self, x, y, zustand):
self.x = x
self.y = y
self.sz = 5
self.move = 10
self.zustand = zustand
def update(self):
if self.zustand > 1:
self.zustand -= 1
if self.z... |
MarcosCommunity/odoo | refs/heads/marcos-8.0 | addons/edi/models/res_currency.py | 437 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
dqnykamp/sympy | refs/heads/master | sympy/physics/quantum/tests/test_constants.py | 130 | from sympy import Float
from sympy.physics.quantum.constants import hbar
def test_hbar():
assert hbar.is_commutative is True
assert hbar.is_real is True
assert hbar.is_positive is True
assert hbar.is_negative is False
assert hbar.is_irrational is True
assert hbar.evalf() == Float(1.05457162e... |
signalfire/django-property | refs/heads/master | homes_for_sale/tests/test_models.py | 2 | from django.test import TestCase
from homes_for_sale.factories.sale_factory import SaleFactory
from homes_for_sale.factories.sale_feature_factory import SaleFeatureFactory
from homes_for_sale.factories.sale_picture_factory import SalePictureFactory
from homes_for_sale.factories.sale_media_factory import SaleMediaFacto... |
OpenVolunteeringPlatform/django-ovp-organizations | refs/heads/master | ovp_organizations/migrations/0012_auto_20170109_1332.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-01-09 13:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ovp_organizations', '0011_organization_cover'),
]
operations = [
migrations... |
codegooglecom/jaikuengine | refs/heads/master | common/management/commands/test.py | 31 | # Copyright 2009 Google 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 writing, ... |
OscarBC/romcollectionbrowser | refs/heads/master | resources/lib/pyscraper/descriptionparserfactory.py | 10 | # -*- coding: iso-8859-15 -*-
from xml.etree.ElementTree import *
from descriptionparserxml import *
from descriptionparserflatfile import *
class DescriptionParserFactory:
@classmethod
def getParser(self, descParseInstruction):
fp = open(descParseInstruction, 'r')
tree = fromstring(fp.read(... |
kushalbhola/MyStuff | refs/heads/master | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/api/test_api.py | 2 | import pandas as pd
from pandas import api, compat
from pandas.util import testing as tm
class Base:
def check(self, namespace, expected, ignored=None):
# see which names are in the namespace, minus optional
# ignored ones
# compare vs the expected
result = sorted(f for f in dir(n... |
satovey/heekscnc | refs/heads/master | pycnc/wxProgramWindow.py | 25 | import wx
class ProgramWindow(wx.ScrolledWindow):
def __init__(self, parent):
wx.ScrolledWindow.__init__(self, parent, name = 'Program', style = wx.HSCROLL + wx.VSCROLL + wx.NO_FULL_REPAINT_ON_RESIZE)
self.textCtrl = wx.TextCtrl(self, 100, "", style = wx.TE_MULTILINE + wx.TE_DONTWRAP)
self.... |
the-deep-learners/study-group | refs/heads/master | neural-networks-and-deep-learning/src/old/mnist_autoencoder.py | 4 | """
mnist_autoencoder
~~~~~~~~~~~~~~~~~
Implements an autoencoder for the MNIST data. The program can do two
things: (1) plot the autoencoder's output for the first ten images in
the MNIST test set; and (2) use the autoencoder to build a classifier.
The program is a quick-and-dirty hack --- we'll do things in ... |
grevian/GraphViz-Site | refs/heads/master | requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 315 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from _implementatio... |
oonid/dilingkari | refs/heads/master | lib/pyasn1/compat/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
bnsgeyer/Copter3_4 | refs/heads/master | Tools/autotest/autotest.py | 5 | #!/usr/bin/env python
"""
APM automatic test suite
Andrew Tridgell, October 2011
"""
from __future__ import print_function
import atexit
import fnmatch
import glob
import optparse
import os
import shutil
import signal
import sys
import time
import traceback
import apmrover2
import arducopter
import arduplane
import ... |
mojeto/django | refs/heads/master | django/contrib/messages/apps.py | 130 | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class MessagesConfig(AppConfig):
name = 'django.contrib.messages'
verbose_name = _("Messages")
|
arokem/nipy | refs/heads/master | nipy/algorithms/slicetiming/setup.py | 3 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('slicetiming', parent_package, top_path)
config.add_... |
msiedlarek/wiring | refs/heads/master | tests/scanning/testmodule/ignoredsubmodule/ignored_registers.py | 1 | from wiring.scanning import register
@register.function()
def ignored_function():
pass
@register.factory()
class IgnoredFactory():
pass
|
NeuralEnsemble/python-neo | refs/heads/master | neo/rawio/brainvisionrawio.py | 2 | """
Class for reading data from BrainVision product.
This code was originally made by L. Pezard (2010), modified B. Burle and
S. More.
Author: Samuel Garcia
"""
from .baserawio import (BaseRawIO, _signal_channel_dtype, _signal_stream_dtype,
_spike_channel_dtype, _event_channel_dtype)
import numpy as... |
CodingVault/LeetCodeInPython | refs/heads/master | longest_valid_parentheses.py | 1 | #!/usr/bin/env python
# encoding: utf-8
"""
longest_valid_parentheses.py
Created by Shengwei on 2014-07-08.
"""
# https://oj.leetcode.com/problems/longest-valid-parentheses/
# tags: medium / hard, array, parentheses, stack, longest
"""
Given a string containing just the characters '(' and ')', find the length of the... |
ScreamingUdder/mantid | refs/heads/master | scripts/Interface/ui/sans_isis/run_selector_widget.py | 1 | from __future__ import (absolute_import, division, print_function)
from PyQt4 import QtGui, QtCore
import ui_run_selector_widget
from PyQt4.QtCore import pyqtSignal
from mantidqtpython import MantidQt
class RunSelectorWidget(QtGui.QWidget, ui_run_selector_widget.Ui_RunSelectorWidget):
manageDirectories = pyqtSi... |
ilathid/ilathidEngine | refs/heads/master | setup.py | 1 | # A setup script showing how to extend py2exe.
#
# In this case, the py2exe command is subclassed to create an installation
# script for InnoSetup, which can be compiled with the InnoSetup compiler
# to a single file windows installer.
#
# By default, the installer will be created as dist\Output\setup.exe.
#@PyDevCode... |
imoseyon/leanKernel-d2usc-deprecated | refs/heads/lk-tw | external/webkit/Tools/Scripts/webkitpy/tool/bot/irc_command.py | 15 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
infinit/grpc | refs/heads/master | src/python/grpcio/grpc/framework/foundation/future.py | 28 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
sourtin/igem15-sw | refs/heads/master | img_processing/identificationTesting/contrastImprovement.py | 2 | #FROM COMPUTER SCIENCE LECTURE NOTES
__author__ = 'Ocean'
import cv2
import numpy
"""p328 in Comp. Sci. Graphics Lecture Notes"""
class OutOfBoundsException(Exception):
def __init__(self, val):
super(OutOfBoundsException, self).__init__(val)
self.val = val
self.printError(val)
def p... |
minzhang28/docker-py | refs/heads/master | docker/api/build.py | 3 | import logging
import os
import re
import json
from .. import constants
from .. import errors
from .. import auth
from .. import utils
log = logging.getLogger(__name__)
class BuildApiMixin(object):
def build(self, path=None, tag=None, quiet=False, fileobj=None,
nocache=False, rm=False, stream=Fal... |
HarryRybacki/osf.io | refs/heads/develop | scripts/tests/test_migrate_registration_and_fork_log.py | 19 | from website.models import Node
from framework.auth import Auth
from tests.base import OsfTestCase
from tests.factories import ProjectFactory, UserFactory, NodeFactory
from scripts.migrate_registration_and_fork_log import (
get_parent, get_all_parents
)
class TestMigrateLogs(OsfTestCase):
def tearDown(self):... |
weizhenwei/wireshark | refs/heads/master | tools/dftestlib/tvb.py | 40 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# 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.
#
# Th... |
vikatory/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/multiprocessing/__init__.py | 116 | #
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 't... |
mermi/bedrock | refs/heads/master | bedrock/externalfiles/models.py | 18 | from django.db import models
class ExternalFile(models.Model):
name = models.CharField(max_length=50, primary_key=True)
content = models.TextField()
last_modified = models.DateTimeField(auto_now=True)
|
clumsy/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/it/it_region.py | 437 | # -*- coding: utf-8 -*
REGION_CHOICES = (
('ABR', 'Abruzzo'),
('BAS', 'Basilicata'),
('CAL', 'Calabria'),
('CAM', 'Campania'),
('EMR', 'Emilia-Romagna'),
('FVG', 'Friuli-Venezia Giulia'),
('LAZ', 'Lazio'),
('LIG', 'Liguria'),
('LOM', 'Lombardia'),
('MAR', 'Marche'),
('MOL', ... |
MerleLK/StudentSystem | refs/heads/master | accounts/urls.py | 1 | # coding=utf-8
from django.conf.urls import url
from .views import index, register_view, login_view, logout_view
urlpatterns = [
url(r'^$', index),
url(r'^register', register_view),
url(r'^login', login_view),
url(r'^logout', logout_view),
]
|
thanhacun/odoo | refs/heads/8.0 | addons/association/__init__.py | 886 | # -*- 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... |
dimaleks/uDeviceX | refs/heads/master | tests/walls/analytic/plates.py | 1 | #!/usr/bin/env python
import mirheo as mir
dt = 0.001
ranks = (1, 1, 1)
domain = (8, 16, 8)
force = (1.0, 0, 0)
density = 4
u = mir.Mirheo(ranks, domain, debug_level=3, log_filename='log', no_splash=True)
pv = mir.ParticleVectors.ParticleVector('pv', mass = 1)
ic = mir.InitialConditions.Uniform(number_density=de... |
ltilve/chromium | refs/heads/igalia-sidebar | chrome/test/chromeos/utilities/vm_setup_state.py | 184 | #!/usr/bin/env python
# Copyright (c) 2012 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.
import logging
import pyauto_functional # has to be imported before pyauto
import pyauto
import sys
VM_CHROMEDRIVER_PORT = 4444
i... |
conan-equal-newone/yenten | refs/heads/master | contrib/testgen/base58.py | 99 | # Copyright (c) 2012-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import has... |
2013Commons/HUE-SHARK | refs/heads/master | desktop/core/ext-py/Django-1.2.3/django/contrib/gis/models.py | 624 | from django.db import connection
if (hasattr(connection.ops, 'spatial_version') and
not connection.ops.mysql):
# Getting the `SpatialRefSys` and `GeometryColumns`
# models for the default spatial backend. These
# aliases are provided for backwards-compatibility.
SpatialRefSys = connection.ops.spat... |
Alwnikrotikz/pyicqt | refs/heads/master | src/services/EntityTime.py | 4 | # Copyright 2004-2006 Daniel Henninger <jadestorm@nc.rr.com>
# Licensed for distribution under the GPL version 2, check COPYING for details
import utils
from twisted.words.xish.domish import Element
import config
from debug import LogEvent, INFO, WARN, ERROR
import globals
import time
class EntityTime:
def __init__(... |
e0ne/cinder | refs/heads/master | cinder/tests/fake_notifier.py | 8 | # Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
SilentCircle/sentry | refs/heads/master | tests/sentry/interfaces/template/tests.py | 5 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from sentry.interfaces import Template
from sentry.models import Event
from sentry.testutils import TestCase
class TemplateTest(TestCase):
def test_serialize(self):
interface = Template(
filename='foo.html',
... |
TheTimmy/spack | refs/heads/develop | var/spack/repos/builtin/packages/minigmg/package.py | 3 | ##############################################################################
# Copyright (c) 2013-2017, 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... |
webmasterraj/FogOrNot | refs/heads/master | flask/lib/python2.7/site-packages/docutils/utils/math/tex2unichar.py | 120 | # -*- coding: utf-8 -*-
# LaTeX math to Unicode symbols translation dictionaries.
# Generated with ``write_tex2unichar.py`` from the data in
# http://milde.users.sourceforge.net/LUCR/Math/
# Includes commands from: wasysym, stmaryrd, mathdots, mathabx, esint, bbold, amsxtra, amsmath, amssymb, standard LaTeX
mathacce... |
shuzi0/ss | refs/heads/master | shadowsocks/shell.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... |
patanpp/cobaion | refs/heads/master | themes/lte/dist/ionicons/builder/generate.py | 357 | from subprocess import call
import os
import json
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
LESS_FOLDER_... |
bala4901/odoo | refs/heads/master | addons/stock/procurement.py | 16 | # -*- 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... |
sonaht/ansible | refs/heads/devel | test/units/modules/network/iosxr/iosxr_module.py | 56 | # (c) 2016 Red Hat Inc.
#
# 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 dis... |
pycontw/pycontw2016 | refs/heads/master | src/proposals/tests/test_management.py | 1 | import collections
import datetime
import json
import re
import unittest.mock
import pytest
import pytz
from django.utils.timezone import now
from django.conf import settings
from django.core import mail
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from djang... |
openhatch/oh-mainline | refs/heads/master | vendor/packages/Django/django/conf/locale/te/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =... |
hntrmrrs/capnproto | refs/heads/master | mega-test.py | 43 | #! /usr/bin/env python
# MEGA TEST
#
# usage: mega-test.py <config>
#
# This runs several tests in parallel and shows progress bars for each, based on a config file.
#
# <config> is a file containing a list of commands to run along with the expected number of lines
# they will output (to stdout and stderr combined), ... |
florentx/OpenUpgrade | refs/heads/8.0 | addons/payment_paypal/tests/test_paypal.py | 378 | # -*- coding: utf-8 -*-
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_paypal.controllers.main import PaypalController
from openerp.tools import mute_logger
from lxml import objectify
import u... |
jakereps/qiime-workshops | refs/heads/master | payments/migrations/0017_billed_total_charfield.py | 1 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
indrajitr/ansible | refs/heads/devel | test/units/inventory/test_group.py | 53 | # Copyright 2018 Alan Rominger <arominge@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... |
Tigge/openant | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
#
# openant distutils setup script
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, includ... |
saisankargochhayat/algo_quest | refs/heads/master | hackerearth/temp.py | 1 | import math
class segment_tree():
def __init__(self,mini,maxi):
self.root = self.build(mini,maxi)
def build(self,left,right):
if left == right:
node = {}
node['left'] = None
node['right'] = None
node['decrements'] = 0
return node
... |
seshin/namebench | refs/heads/master | nb_third_party/dns/rdtypes/IN/SRV.py | 248 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation 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 ... |
min2209/dwt | refs/heads/master | WTN/lossFunction.py | 1 | import tensorflow as tf
def depthCELoss2(pred, gt, weight, ss, outputChannels=16):
with tf.name_scope("depth_CE_loss"):
pred = tf.reshape(pred, (-1, outputChannels))
epsilon = tf.constant(value=1e-25)
predSoftmax = tf.to_float(tf.nn.softmax(pred))
gt = tf.one_hot(indices=tf.to_int3... |
palaniyappanBala/python-mongor | refs/heads/master | mongor/__init__.py | 2 | from random import randint
from sys import stderr as log_error
import gzip
import datetime
#needed external deps
import pymongo
from pymongo.errors import CollectionInvalid
import bson
class Config(object):
"""
Used to configure the mongodb curator.
Configuration class should only be used directly
wh... |
pkruskal/scikit-learn | refs/heads/master | examples/neighbors/plot_nearest_centroid.py | 264 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.