repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
renpy/python-for-android | src/buildlib/jinja2.egg/jinja2/constants.py | 220 | 6229 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | mit |
punchagan/zulip | zerver/webhooks/pagerduty/view.py | 1 | 7008 | # Webhooks for external integrations.
from typing import Any, Dict, Sequence
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response impo... | apache-2.0 |
peterkuma/tjrapid | ob/views.py | 1 | 1560 | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.template import RequestContext
from django.utils import translation
from django.shortcuts import get_object_or_404
from django.http import Http404, HttpResponseRedirect
from main.models import *
from ob.models import *
def events(request, categ... | mit |
fiji-flo/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/parser.py | 22 | 23419 | #default_value:foo
#include: other.manifest
#
#[test_name.js]
# expected: ERROR
#
# [subtest 1]
# expected:
# os == win: FAIL #This is a comment
# PASS
#
# TODO: keep comments in the tree
from __future__ import unicode_literals
import types
from cStringIO import StringIO
from node import *
class Pa... | mpl-2.0 |
fkolacek/FIT-VUT | bp-revok/python/lib/python2.7/test/test_ntpath.py | 3 | 8404 | import ntpath
import os
from test.test_support import TestFailed
from test import test_support, test_genericpath
import unittest
def tester(fn, wantResult):
fn = fn.replace("\\", "\\\\")
gotResult = eval(fn)
if wantResult != gotResult:
raise TestFailed, "%s should return: %s but returned: %s" \
... | apache-2.0 |
epssy/hue | desktop/core/ext-py/markdown/markdown/etree_loader.py | 136 | 1287 |
from markdown import message, CRITICAL
import sys
## Import
def importETree():
"""Import the best implementation of ElementTree, return a module object."""
etree_in_c = None
try: # Is it Python 2.5+ with C implemenation of ElementTree installed?
import xml.etree.cElementTree as etree_in_c
exce... | apache-2.0 |
alextruberg/custom_django | django/contrib/comments/__init__.py | 112 | 3485 | import warnings
from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import ImproperlyConfigured
from django.contrib.comments.models import Comment
from django.contrib.comments.forms import CommentForm
from django.utils.importlib import import_module
warnings.warn("django.c... | bsd-3-clause |
eaplatanios/tensorflow | tensorflow/python/training/training_util_test.py | 44 | 5106 | # 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... | apache-2.0 |
fishky/django-rest-framework | tests/test_throttling.py | 82 | 11202 | """
Tests for the throttling implementations in the permissions module.
"""
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.cache import cache
from django.test import TestCase
from rest_framework.response import Response
from rest_framework.settings import api_sett... | bsd-2-clause |
thaumos/ansible | test/units/modules/network/nxos/test_nxos_vxlan_vtep_vni.py | 68 | 2559 | # (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... | gpl-3.0 |
sorenh/python-django-repomgmt | repomgmt/admin.py | 1 | 1108 | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | apache-2.0 |
jss-emr/openerp-7-src | openerp/addons/hr_attendance/__openerp__.py | 57 | 2163 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/Django-1.6.10/tests/dates/tests.py | 59 | 2508 | from __future__ import absolute_import
import datetime
from django.test import TestCase
from .models import Article, Comment, Category
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.create(
title="First one",
pub_date=datetime.date(2005, ... | apache-2.0 |
amiguez/youtube-dl | youtube_dl/extractor/vk.py | 79 | 12166 | # encoding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
orderedSet,
str_to_int,
unescapeHTML,
unified_strdate... | unlicense |
iut-ibk/Calimero | site-packages/pybrain/supervised/trainers/evolino.py | 3 | 6327 | __author__ = 'Michael Isik'
from numpy import Infinity
from trainer import Trainer
from pybrain.supervised.evolino.population import EvolinoPopulation
from pybrain.supervised.evolino.individual import EvolinoSubIndividual
from pybrain.supervised.evolino.filter import EvolinoEvaluation, EvolinoSelection, EvolinoRepro... | gpl-2.0 |
micropython/micropython | examples/rp2/pio_uart_rx.py | 6 | 2799 | # Example using PIO to create a UART RX interface.
#
# To make it work you'll need a wire connecting GPIO4 and GPIO3.
#
# Demonstrates:
# - PIO shifting in data on a pin
# - PIO jmp(pin) instruction
# - PIO irq handler
# - using the second core via _thread
import _thread
from machine import Pin, UART
from rp2 ... | mit |
wuga214/Django-Wuga | env/lib/python2.7/site-packages/PIL/WalImageFile.py | 16 | 5557 | # encoding: utf-8
#
# The Python Imaging Library.
# $Id$
#
# WAL file handling
#
# History:
# 2003-04-23 fl created
#
# Copyright (c) 2003 by Fredrik Lundh.
#
# See the README file for information on usage and redistribution.
#
# NOTE: This format cannot be automatically recognized, so the reader
# is not registered... | apache-2.0 |
amarouni/incubator-beam | sdks/python/apache_beam/io/gcp/gcsio.py | 7 | 30935 | #
# 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... | apache-2.0 |
rlbabyuk/integration_tests | cfme/scripting/ipyshell.py | 1 | 1483 | # -*- coding: utf-8 -*-
import sys
from . import quickstart
from IPython.terminal.interactiveshell import TerminalInteractiveShell
IMPORTS = [
'from utils import conf',
'from fixtures.pytest_store import store',
'from utils.appliance.implementations.ui import navigate_to',
'from utils import providers... | gpl-2.0 |
LaoZhongGu/kbengine | kbe/res/scripts/common/Lib/encodings/koi8_u.py | 272 | 13762 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='stri... | lgpl-3.0 |
cedias/NNPy | NNPy.py | 1 | 14499 | #-*- coding: utf-8 -*-
import numpy as np
# ############ #
# Abstractions #
# ############ #
# Losses
class Loss:
#Calcule la valeur du loss étant données les valeurs prédites et désirées
def getLossValue(self,predicted_output,desired_output):
pass
#Calcule le gradient (pour chaq... | mit |
kimjaejoong/nova | nova/tests/unit/virt/vmwareapi/fake.py | 25 | 57473 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | apache-2.0 |
AlCutter/googletest-fbsd | test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
openstack-ja/horizon | openstack_dashboard/dashboards/admin/defaults/tests.py | 4 | 6223 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Kylin, 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
#
# ... | apache-2.0 |
whn09/tensorflow | tensorflow/tensorboard/backend/event_processing/event_file_loader.py | 68 | 2971 | # 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... | apache-2.0 |
onlyjus/pyqtgraph | pyqtgraph/graphicsItems/GradientEditorItem.py | 11 | 36682 | import weakref
import numpy as np
from ..Qt import QtGui, QtCore
from ..python2_3 import sortList
from .. import functions as fn
from .GraphicsObject import GraphicsObject
from .GraphicsWidget import GraphicsWidget
from ..widgets.SpinBox import SpinBox
from ..pgcollections import OrderedDict
from ..colormap import Colo... | mit |
ville-k/tensorflow | tensorflow/python/kernel_tests/multinomial_op_test.py | 35 | 9578 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
valefranz/AI-Project-VacuumEnvironment | agent_dir/hudrobot.py | 2 | 7137 |
# coding=utf-8
from . agents import *
from random import randint
class hudrobotClass(Agent):
def __init__(self, noCleans=10):
Agent.__init__(self)
self.name = 'Hudrobot'
#self.img = 'minion' ## Immagine in base all'ID dell'agente
self.actions = ['GoNorth', 'GoEast', 'GoSouth... | apache-2.0 |
dibaunaumh/tikal-corp-website | cms/migrations/0018_site_permissions.py | 3 | 18231 |
from south.db import db
from django.db import models
from cms.models import *
class Migration:
def forwards(self, orm):
# Adding ManyToManyField 'GlobalPagePermission.sites'
db.create_table('cms_globalpagepermission_sites', (
('id', models.AutoField(verbose_name='ID', pri... | bsd-3-clause |
quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/sqlalchemy/util/__init__.py | 23 | 2358 | # util/__init__.py
# Copyright (C) 2005-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 .compat import callable, cmp, reduce, \
threading, py3k, py33, py2k, jyth... | mit |
g761007/simple_chat | simple_chat/utils.py | 2 | 1901 | from __future__ import unicode_literals
import os
import hmac
import uuid
import hashlib
B58_CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
B58_BASE = len(B58_CHARS)
def b58encode(s):
"""Do a base 58 encoding (alike base 64, but in 58 char only)
From https://bitcointalk.org/index.php?... | mit |
google-research/google-research | enas_lm/src/tpu/data_utils.py | 1 | 3091 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
PVirie/aknowthai | src/test.py | 1 | 1728 | import gen
import network as ann
import numpy as np
import util
def eval(neural_net, data, labels):
classes, alphas = neural_net.scan(data, gen.get_default_total_code())
data3ch = util.cvtColorGrey2RGB(data)
red = np.array([1.0, 0.0, 0.0], dtype=np.float32)
for b in xrange(alphas.shape[0]):
f... | mit |
daxxi13/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/muenchentv.py | 160 | 2133 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
)
class MuenchenTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?muenchen\.tv/livestream'
IE_DESC = 'münchen.tv'
_TEST = {... | gpl-3.0 |
xingnix/learning | machinelearning/python/computationallearningtheory/weightedmajority.py | 1 | 2790 | import re
import numpy as np
input_string = """
Example Sky AirTemp Humidity Wind Water Forecast EnjoySport
1 Sunny Warm Normal Strong Warm Same Yes
2 Sunny Warm High Strong Warm Same Yes
3 Rainy Cold High Strong Warm Change No
4 Sunny Warm High Strong Cool Change... | gpl-3.0 |
GustavoHennig/ansible | lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py | 27 | 9618 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Dimension Data
#
# 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 ... | gpl-3.0 |
leoc/home-assistant | homeassistant/components/switch/transmission.py | 29 | 3112 | """
Support for setting the Transmission BitTorrent client Turtle Mode.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.transmission/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA
from hom... | mit |
rdobson94/python_koans | python3/koans/about_exceptions.py | 98 | 1767 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutExceptions(Koan):
class MySpecialError(RuntimeError):
pass
def test_exceptions_inherit_from_exception(self):
mro = self.MySpecialError.mro()
self.assertEqual(__, mro[1].__name__)
self.assertEqu... | mit |
cpbl/cpblUtilities | matplotlib_utils.py | 1 | 7242 | #!/usr/bin/python
import matplotlib.pyplot as plt
def prepare_figure_for_publication(ax=None,
width_cm=None,
width_inches=None,
height_cm=None,
height_inches=None,
fontsize=None,
fontsize_labels=None,
fontsiz... | gpl-3.0 |
sarrionandia/taber | data/views.py | 1 | 4616 | from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.utils.decorators import method_decorator
from django.views.generic import View
from django.template import RequestContext, loader
from models import Institution, Judge, Team, Venue
from django.views.decorator... | gpl-2.0 |
efforia/django-socialize | socialize/urls.py | 1 | 1668 | #!/usr/bin/python
#
# This file is part of django-socialize project.
#
# Copyright (C) 2011-2020 William Oliveira de Lagos <william.lagos@icloud.com>
#
# Socialize is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as published by
# the Free Software Fo... | lgpl-3.0 |
kvar/ansible | lib/ansible/modules/packaging/os/dnf.py | 10 | 51793 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015 Cristian van Ee <cristian at cvee.org>
# Copyright 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com>
# Copyright 2018 Adam Miller <admiller@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future_... | gpl-3.0 |
LiZimo/FuncFlow | external/gop_1.3/external/Boost.NumPy/libs/numpy/test/dtype.py | 5 | 2652 | #!/usr/bin/env python
# Copyright Jim Bosch & Ankit Daftery 2010-2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import dtype_mod
import unittest
import numpy
class DtypeTestCase(unittest.TestCa... | bsd-2-clause |
Sorsly/subtle | google-cloud-sdk/lib/third_party/google/protobuf/internal/json_format_test.py | 42 | 34561 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | mit |
hayd/SimpleCV | SimpleCV/Features/Features.py | 10 | 68992 | # SimpleCV Feature library
#
# Tools return basic features in feature sets
# # x = 0.00
# y = 0.00
# _mMaxX = None
# _mMaxY = None
# _mMinX = None
# _mMinY = None
# _mWidth = None
# _mHeight = None
# _mSrcImgW = None
# mSrcImgH = None
#load system libraries
from SimpleCV.base im... | bsd-3-clause |
martinbede/second-sight | tensorflow/python/ops/op_def_library.py | 10 | 26410 | # 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 a... | apache-2.0 |
binken/robotframework-selenium2library | src/Selenium2Library/utils/__init__.py | 65 | 3683 | import os
from fnmatch import fnmatch
from browsercache import BrowserCache
__all__ = [
"get_child_packages_in",
"get_module_names_under",
"import_modules_under",
"escape_xpath_value",
"BrowserCache"
]
# Public
def get_child_packages_in(root_dir, include_root_package_name=True, exclusions=None):
... | apache-2.0 |
xkollar/spacewalk | client/tools/rhncfg/config_management/rhncfg_create_channel.py | 7 | 1320 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
googleapis/googleapis-gen | google/cloud/essentialcontacts/v1/essentialcontacts-v1-py/google/cloud/essential_contacts_v1/services/essential_contacts_service/transports/grpc_asyncio.py | 1 | 18910 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
diego-d5000/MisValesMd | env/lib/site-packages/pip/_vendor/lockfile/pidlockfile.py | 488 | 6221 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | mit |
msimacek/freeipa | ipatests/pytest_plugins/declarative.py | 6 | 1823 | # Authors:
# Petr Viktorin <pviktori@redhat.com>
#
# Copyright (C) 2014 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 ... | gpl-3.0 |
xzhang2016/tfagent | tfta/test/test2_json.py | 1 | 40826 | from kqml import KQMLList, KQMLString
from tfta.tfta import TFTA
from tfta.tfta_module import TFTA_Module
from bioagents.tests.util import ekb_from_text, ekb_kstring_from_text, \
get_request, agent_clj_from_text
from bioagents.tests.integration import _IntegrationTest, _FailureTest
from... | bsd-2-clause |
nikhilprathapani/python-for-android | python3-alpha/python3-src/Lib/wsgiref/util.py | 55 | 5595 | """Miscellaneous WSGI-related Utilities"""
import posixpath
__all__ = [
'FileWrapper', 'guess_scheme', 'application_uri', 'request_uri',
'shift_path_info', 'setup_testing_defaults',
]
class FileWrapper:
"""Wrapper to convert file-like objects to iterables"""
def __init__(self, filelike, blksize=819... | apache-2.0 |
tseaver/google-cloud-python | logging/google/cloud/logging/logger.py | 2 | 13563 | # Copyright 2016 Google LLC
#
# 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... | apache-2.0 |
zhjunlang/kbengine | kbe/src/lib/python/Lib/distutils/command/build_clib.py | 204 | 8022 | """distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly really, as the work req... | lgpl-3.0 |
nichung/wwwflaskBlogrevA | venv/lib/python2.7/site-packages/pip/vendor/html5lib/trie/py.py | 80 | 1774 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError(... | mit |
cajone/pychess | lib/pychess/widgets/ChatWindow.py | 1 | 3808 | import re
from gi.repository import Gtk
from pychess.widgets.ChatView import ChatView
from pychess.widgets.ViewsPanel import ViewsPanel
from pychess.widgets.InfoPanel import InfoPanel
from pychess.widgets.ChannelsPanel import ChannelsPanel
TYPE_PERSONAL, TYPE_CHANNEL, TYPE_GUEST, \
TYPE_ADMIN, TYPE_COMP, TYPE_BL... | gpl-3.0 |
diox/olympia | src/olympia/devhub/tests/test_tasks.py | 3 | 46814 | # -*- coding: utf-8 -*-
import json
import os
import shutil
import tempfile
from contextlib import contextmanager
from datetime import datetime, timedelta
from decimal import Decimal
from django.conf import settings
from django.core import mail
from django.core.files.storage import default_storage as storage
from un... | bsd-3-clause |
rubikloud/scikit-learn | sklearn/cluster/__init__.py | 364 | 1228 | """
The :mod:`sklearn.cluster` module gathers popular unsupervised clustering
algorithms.
"""
from .spectral import spectral_clustering, SpectralClustering
from .mean_shift_ import (mean_shift, MeanShift,
estimate_bandwidth, get_bin_seeds)
from .affinity_propagation_ import affinity_propagati... | bsd-3-clause |
klim-iv/phantomjs-qt5 | src/webkit/Tools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py | 125 | 2205 | # 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 th... | bsd-3-clause |
acfogarty/espressopp | src/tools/replicate.py | 7 | 2830 | # Copyright (C) 2012,2013,2016
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms... | gpl-3.0 |
yksalun/hugula | Client/tools/site-packages/pyExcelerator/Utils.py | 15 | 5303 | # pyXLWriter: A library for generating Excel Spreadsheets
# Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Publi... | mit |
RobAltena/deeplearning4j | libnd4j/include/graph/generated/nd4j/graph/FrameIteration.py | 2 | 1317 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: graph
import flatbuffers
class FrameIteration(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFrameIteration(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x ... | apache-2.0 |
victorkeophila/alien4cloud-cloudify3-provider | src/test/resources/outputs/blueprints/openstack/storage/wrapper/LinuxFileSystem_4__a4c_CBS4/linuxPartitionCBS4/artifacts/alien-extended-storage-types/scripts/_a4c_mkfs.py | 6 | 15419 |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify impo... | apache-2.0 |
motine/Ohouse | src/vendor/geniv3rpc/ext/sfa/trust/rights.py | 7 | 9480 | #----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, i... | bsd-3-clause |
calpeyser/google-cloud-python | monitoring/google/cloud/monitoring/client.py | 2 | 23539 | # Copyright 2016 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, ... | apache-2.0 |
fitermay/intellij-community | python/helpers/py3only/docutils/readers/standalone.py | 49 | 2328 | # $Id: standalone.py 4802 2006-11-12 18:02:17Z goodger $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Standalone file Reader for the reStructuredText markup syntax.
"""
__docformat__ = 'reStructuredText'
from docutils import frontend, readers
from do... | apache-2.0 |
dowjones/respawn | respawn/autoscaling.py | 1 | 15011 | from cfn_pyplates import core, functions
from ec2 import BlockDevice, BlockDeviceMapping
from errors import RespawnResourceError
class MetricsCollection(core.JSONableDict):
"""
Creates a Metrics Collection
:param granularity: String
:param kwargs: metrics - [ String, ... ]
"""
... | isc |
cebrusfs/217gdb | pwndbg/commands/radare2.py | 2 | 1221 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import pwndbg.commands
parser = argparse.ArgumentParser(description='Launches radare2',
... | mit |
gitromand/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/watchlist/amountchangedpattern.py | 134 | 3279 | # Copyright (C) 2011 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 ... | bsd-3-clause |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/matplotlib/backends/backend_gtkcairo.py | 3 | 2079 | """
GTK+ Matplotlib interface using cairo (not GDK) drawing operations.
Author: Steve Chaplin
"""
import gtk
if gtk.pygtk_version < (2,7,0):
import cairo.gtk
from matplotlib.backends import backend_cairo
from matplotlib.backends.backend_gtk import *
backend_version = 'PyGTK(%d.%d.%d) ' % gtk.pygtk_version + \
... | gpl-3.0 |
ClusterLabs/booth | test/assertions.py | 1 | 2281 | import re
class BoothAssertions:
def configFileMissingMyIP(self, config_file=None, lock_file=None):
(pid, ret, stdout, stderr, runner) = \
self.run_booth(config_file=config_file, lock_file=lock_file,
expected_exitcode=1, expected_daemon=False)
expected_error ... | gpl-2.0 |
jdanbrown/pydatalab | solutionbox/structured_data/test_mltoolbox/test_datalab_e2e.py | 5 | 7533 | # Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 |
shakamunyi/neutron-dvr | neutron/openstack/common/log.py | 11 | 26752 | # Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... | apache-2.0 |
ideamonk/Web2Hunter-GAE | web2hunter.py | 1 | 2098 | #!/usr/bin/env python
# Web2Hunter -- Abhishek Mishra <ideamonk at gmail.com>
#
# a web 2.0 name generator extension to domainhunter.py
#
# usage -
# $ python web2hunter.py
import domainhunter as DH
import random
A = ["Anti", "Aero", "Babble", "Buzz", "Blog", "Blue", "Brain", "Bright", "Browse", "Bubbl... | bsd-3-clause |
buzzz321/SerMan | server.py | 1 | 4112 | #!/usr/bin/env python3
# found some where on internet and added my own stuff to it.
import logging
import socket
import select
import subprocess
HOSTNAME = 'localhost'
PORT = '4000'
MAXIMUM_QUEUED_CONNECTIONS = 5
RECEIVING_BUFFER_SIZE = 4096
logger = logging.getLogger(__name__)
def start_server(hostname, port):
... | bsd-2-clause |
keedio/hue | desktop/core/src/desktop/lib/django_forms_test.py | 40 | 2055 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
zibraproject/zika-pipeline | scripts/extract.py | 1 | 1704 | from poretools.Fast5File import Fast5FileSet
import sys
# extract with constraints:
# -- only one group ever
# -- only one flowcell ID ever
# -- always unique read ID
def run(parser, args):
flowcells = set()
reads = set()
i = 0
basecaller_version = None
for fast5 in Fast5FileSet(args.directory, None, args... | mit |
jklenzing/pysat | docs/conf.py | 2 | 9834 | # -*- coding: utf-8 -*-
#
# pysat documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 27 10:34:46 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | bsd-3-clause |
ShineFan/odoo | addons/stock_account/wizard/stock_valuation_history.py | 91 | 9803 |
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.translate import _
class wizard_valuation_history(osv.osv_memory):
_name = 'wizard.valuation.history'
_description = 'Wizard that opens the stock valuation history table'
_columns = {
'choose_date': fields.boolean('C... | agpl-3.0 |
bjwbell/servo | components/script/dom/bindings/codegen/parser/tests/test_union_nullable.py | 276 | 1292 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface OneNullableInUnion {
void foo((object? or DOMString?) arg);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Two ... | mpl-2.0 |
mikeckennedy/python-for-entrepreneurs-course-demos | 15-deployment/blue_yellow_app_deployment/blue_yellow_app/services/albums_service.py | 9 | 2625 | from sqlalchemy.orm import joinedload
from blue_yellow_app.data.album import Album
from blue_yellow_app.data.dbsession import DbSessionFactory
from blue_yellow_app.data.track import Track
class AlbumsService:
@staticmethod
def get_albums():
session = DbSessionFactory.create_session()
albums ... | mit |
jptomo/rpython-lang-scheme | py/_process/cmdexec.py | 273 | 1814 | import sys
import subprocess
import py
from subprocess import Popen, PIPE
def cmdexec(cmd):
""" return unicode output of executing 'cmd' in a separate process.
raise cmdexec.Error exeception if the command failed.
the exception will provide an 'err' attribute containing
the error-output from the comma... | mit |
EthanBlackburn/flanker | tests/addresslib/plugins/google_test.py | 9 | 5623 | # coding:utf-8
import random
import string
from flanker.addresslib import address
from flanker.addresslib import validate
from mock import patch
from nose.tools import assert_equal, assert_not_equal
from nose.tools import nottest
from ... import skip_if_asked
DOMAIN = '@google.com'
SAMPLE_MX = 'sample.aspmx.l.goog... | apache-2.0 |
codervince/flashingredlight | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
TeamExodus/external_chromium_org | build/config/linux/pkg-config.py | 26 | 5706 | # 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 json
import os
import subprocess
import sys
import re
from optparse import OptionParser
# This script runs pkg-config, optionally filtering out s... | bsd-3-clause |
inspirehep/inspire-next | inspirehep/factory.py | 1 | 2892 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | gpl-3.0 |
orion1024/Sick-Beard | cherrypy/lib/sessions.py | 39 | 25936 | """Session implementation for CherryPy.
We use cherrypy.request to store some convenient variables as
well as data about the session for the current request. Instead of
polluting cherrypy.request we use a Session object bound to
cherrypy.session to store these variables.
"""
import datetime
import os
try:
import ... | gpl-3.0 |
GeoMatDigital/django-geomat | geomat/feedback/views.py | 1 | 1251 | from django.shortcuts import render
from rest_framework import generics
from rest_framework.response import Response
from rest_framework import views
from geomat.feedback.serializers import FeedBackSerializer
from django.core.mail import send_mail
from rest_framework import status
from drf_yasg.utils import swagger_aut... | bsd-3-clause |
xmendez/wfuzz | tests/server_dir/simple_server.py | 1 | 3589 | # slightly modified from
# https://gist.github.com/trungly/5889154
from http.server import HTTPServer
from http.server import SimpleHTTPRequestHandler
import urllib.parse
class GetHandler(SimpleHTTPRequestHandler):
def do_HEAD(self):
parsed_path = urllib.parse.urlparse(self.path)
if parsed_path.p... | gpl-2.0 |
ASOdesk/selenium-pytest-fix | py/test/selenium/webdriver/common/text_handling_tests.py | 31 | 6722 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
40023247/W17test | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_discovery.py | 785 | 13838 | import os
import re
import sys
import unittest
class TestableTestProgram(unittest.TestProgram):
module = '__main__'
exit = True
defaultTest = failfast = catchbreak = buffer = None
verbosity = 1
progName = ''
testRunner = testLoader = None
def __init__(self):
pass
class TestDisc... | agpl-3.0 |
wndias/bc.repository | plugin.video.superlistamilton/plugintools.py | 56 | 18861 | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Plugin Tools v1.0.8
#---------------------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Based on code from youtube, parsedom and pelisalacarta addon... | gpl-2.0 |
HyukjinKwon/spark | examples/src/main/python/ml/prefixspan_example.py | 59 | 1685 | #
# 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... | apache-2.0 |
thnee/ansible | lib/ansible/modules/network/junos/junos_system.py | 52 | 6186 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
bjwbell/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treebuilders/etree.py | 721 | 12609 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBuilder(Elemen... | mpl-2.0 |
josefmonje/Django_demo | main/migrations/0001_initial.py | 1 | 1096 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-01 10:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | mit |
rnixx/kivy | kivy/tests/test_uix_actionbar.py | 2 | 12169 | from kivy.tests.common import GraphicUnitTest
from kivy.lang import Builder
from kivy.base import EventLoop
from kivy.weakproxy import WeakProxy
from kivy.input.motionevent import MotionEvent
from time import sleep
DropDown = None
KV = '''
# +/- copied from ActionBar example + edited for the test
FloatLayout:
A... | mit |
ibinti/intellij-community | python/helpers/profiler/ply/ygen.py | 188 | 2251 | # ply: ygen.py
#
# This is a support program that auto-generates different versions of the YACC parsing
# function with different features removed for the purposes of performance.
#
# Users should edit the method LParser.parsedebug() in yacc.py. The source code
# for that method is then used to create the other meth... | apache-2.0 |
dgzurita/odoo | addons/stock_account/res_config.py | 315 | 2277 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.