code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
"""SMTP email backend class."""
import smtplib
import socket
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.core.mail.utils import DNS_NAME
from django.utils.encoding import force... | frishberg/django | django/core/mail/backends/smtp.py | Python | bsd-3-clause | 5,467 |
import bge
bge.logic.mirrors = {}
pi = 3.14159
def mirror_init():
cont = bge.logic.getCurrentController()
owner = cont.owner
scene = bge.logic.getCurrentScene()
#cam = scene.active_camera
cam = scene.objects['Camera']
matId = bge.texture.materialID(owner, 'MAstreet junction floor')
channel = 4
bge.logic.mirro... | jimy-byerley/Tron-R-reboot-reloaded- | sys/street/street.py | Python | gpl-3.0 | 891 |
#!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... | lbryio/lbrycrd | test/functional/wallet_bumpfee.py | Python | mit | 14,117 |
# -*- 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 ... | jacquerie/inspire-next | tests/integration/migrator/test_migrator_tasks.py | Python | gpl-3.0 | 7,203 |
from asyncio import Future, sleep
from unittest.mock import Mock
import libtorrent as lt
from libtorrent import bencode
from tribler_core.exceptions import SaveResumeDataError
from tribler_core.modules.libtorrent.download import Download
from tribler_core.modules.libtorrent.download_config import DownloadConfig
from ... | hbiyik/tribler | src/tribler-core/tribler_core/modules/libtorrent/tests/test_download.py | Python | lgpl-3.0 | 22,482 |
from CGATReport.Tracker import *
##########################################################################
##########################################################################
##########################################################################
class h3k4me3ProfileTracker(TrackerImages):
"""Chroma... | CGATOxford/CGATPipelines | CGATPipelines/pipeline_docs/pipeline_proj007/trackers/macs_replicated_unique_interval_chromatin_profile.py | Python | mit | 345 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: ogr_bna.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test BNA driver functionality.
# Author: Even Rouault <even dot rouault at mines dash paris... | nextgis-extra/tests | lib_gdal/ogr/ogr_bna.py | Python | gpl-2.0 | 8,057 |
# Copyright (c) 2016, Herman Bergwerf. All rights reserved.
# Use of this source code is governed by an AGPL-3.0-style license
# that can be found in the LICENSE file.
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
set... | equations/backend | setup.py | Python | agpl-3.0 | 651 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | imajes/Sick-Beard | sickbeard/generic_queue.py | Python | gpl-3.0 | 3,916 |
import logging
import logging.config
import os
import sys
import constants
logcfg = 'logger.ini'
logcfg_path = None
try:
logcfg_path = os.path.join('/etc/' % constants.get_name(), logcfg)
assert os.path.exists(logcfg_path)
except AssertionError:
logcfg_path = None
if not logcfg_path:
try:
lo... | xbcsmith/frell | src/__init__.py | Python | apache-2.0 | 1,389 |
from django.db.models.signals import post_save, post_delete, pre_save, pre_delete
from django.dispatch import receiver
from django.core.cache import cache
from django.template.defaultfilters import force_escape
from helpers.decorators import signal_ignore_fixture
from notifications.models import Notification
from .mo... | AlexandreDecan/Lexpage | app/minichat/signals.py | Python | gpl-3.0 | 3,497 |
# Generated by Django 1.11.15 on 2018-08-15 19:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import opaque_keys.edx.django.models
class Migration(migrations.Migration):
dependencies = [
... | edx/edx-platform | openedx/core/djangoapps/video_config/migrations/0006_videothumbnailetting_updatedcoursevideos.py | Python | agpl-3.0 | 2,684 |
#encoding:utf-8
from utils import get_url
from utils import SupplyResult
# Subreddit that will be a source of content
subreddit = 'anime_irl'
# Telegram channel with @reddit2telegram_bot as an admin
t_channel = '@r_animeirl'
def send_post(submission, r2t):
what, url = get_url(submission)
# If this func re... | Fillll/reddit2telegram | reddit2telegram/channels/r_anime_irl/app.py | Python | mit | 1,867 |
# -*- coding: utf-8 -*-
import redis
import traceback
import time
import urlparse
from beaver.transports.base_transport import BaseTransport
from beaver.transports.exception import TransportException
class RedisTransport(BaseTransport):
def __init__(self, beaver_config, logger=None):
super(RedisTranspor... | thomasalrin/beaver | beaver/transports/redis_transport.py | Python | mit | 2,225 |
# Copyright 2019 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... | tombstone/models | research/lstm_object_detection/export_tflite_lstd_graph.py | Python | apache-2.0 | 5,337 |
#!/usr/bin/python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import lldb
i... | njiang1987/msichisel | commands/FBDisplayCommands.py | Python | bsd-3-clause | 4,448 |
from __future__ import annotations
from collections import (
abc,
defaultdict,
)
import csv
from io import StringIO
import re
import sys
from typing import (
IO,
DefaultDict,
Hashable,
Iterator,
List,
Literal,
Mapping,
Sequence,
cast,
)
import warnings
import numpy as np
i... | pandas-dev/pandas | pandas/io/parsers/python_parser.py | Python | bsd-3-clause | 46,632 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/synapse/azure-synapse-managedprivateendpoints/azure/synapse/managedprivateendpoints/v2021_06_01_preview/models/_models_py3.py | Python | mit | 6,853 |
#!/usr/bin/env python
# coding:utf-8
# Contributor:
# fffonion <fffonion@gmail.com>
import re
import time
import json
import traceback
from threading import Thread
from .const import *
from .const import __version__
from .i18n import i18n
if PY3K:
from socketserver import ThreadingMixIn
from http.s... | ChristophorusX/ehentai-downloader | xeHentai/rpc.py | Python | mit | 6,354 |
# Copyright 2014 Florian Ludwig
#
# 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 writin... | FlorianLudwig/nginc | nginc/__init__.py | Python | apache-2.0 | 2,237 |
#
# (c) 2015, Peter Sprygada <psprygada@ansible.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... | skg-net/ansible | lib/ansible/utils/module_docs_fragments/openswitch.py | Python | gpl-3.0 | 3,815 |
from . import partner_academic_title
from . import res_partner
| brain-tec/partner-contact | partner_academic_title/models/__init__.py | Python | agpl-3.0 | 63 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-03-15 00:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('membership', '0003_coordinator_coordinator_image'),
]
operations = [
migratio... | gatortechuf/gatortechuf.com | src/membership/migrations/0004_coordinator_coordinator_bio.py | Python | mit | 512 |
#!/usr/bin/python
#
# Load the mail graph and try to filter the messages
# by count of target addresses
import string
import re
from traceparser import traceparser
class SendRecvFilter:
def __init__( self, filename ) :
self.parser = traceparser(filename)
self.senders = set()
self.... | ShoufuLuo/csaw | 3rd/byzauth/tools/mail_trace_scripts/filter_by_sendrecv.py | Python | apache-2.0 | 941 |
# RUN: %PYTHON %s
# XFAIL: *
import absl.testing
import test_util
model_path = "https://tfhub.dev/tulasiram58827/lite-model/craft-text-detector/dr/1?lite-format=tflite"
# Failure: Resize lowering does not handle inferred dynamic shapes. Furthermore, the entire model
# requires dynamic shape support.
class CraftTextT... | google/iree-samples | tflitehub/craft_text_test.py | Python | apache-2.0 | 741 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
## v # Copyright INRIA, CNRS and contributors ##
## <O___,, # (see version control and CREDITS fi... | JasonGross/coq | doc/tools/coqrst/notations/fontsupport.py | Python | lgpl-2.1 | 3,069 |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch
)
fro... | stephane-martin/salt-debian-packaging | salt-2016.3.2/tests/unit/states/saltmod_test.py | Python | apache-2.0 | 6,536 |
# xiaolongdolly 2017.8.19
message = "Hello Bilibili!"
print(message)
| xiaolongdolly/Python_Course | chapter_2/simple_message/simple_message.py | Python | gpl-3.0 | 69 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | mindriot101/bokeh | bokeh/embed/wrappers.py | Python | bsd-3-clause | 2,494 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.forms.models import ModelForm
from .models import AceEditorPluginModel
from django.utils.translation import ugettext_lazy as _
class AceEditorPluginAdminForm(ModelForm):
class Meta:
model = AceEditorPl... | TigerND/djangocms-ace | djangocms_ace/forms.py | Python | mit | 465 |
import wx
class simpleapp_wx(wx.Frame):
def __init__(self,parent,id,title,device,queue):
wx.Frame.__init__(self,parent,id,title)
self.parent = parent
self.device=device
self.returnQueue=queue
self.initialize()
def initialize(self):
sizer = wx.GridBagSizer()
... | bwhitelock/elmsim | src/wxpython/elmsim_wx.py | Python | gpl-3.0 | 1,981 |
import os
baseDir = os.path.abspath(os.path.dirname(__file__))
class Config:
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
DATABASE_URI = 'sqlite:///' + os.path.join(baseDir, 'dev_artwork.sqlite')
class ProductionConfig(Config):
# DATABASE_URI = os.env... | Assassinss/daily-artwork | config.py | Python | gpl-3.0 | 670 |
from StringIO import StringIO
from flexmock import flexmock
import flask_uploads.functions as funcs
from flask_uploads import save, save_file, save_images, init
from . import TestCase
save, save_file, save_images
class FakeImage(object):
def __init__(self, name, ext):
self.name = name
self.ext = ... | FelixLoether/flask-uploads | tests/test_save.py | Python | mit | 4,945 |
def f(a, b, c, **kwargs):
pass
f(a, <arg1>[1, 2, 3], <arg2>)
| idea4bsd/idea4bsd | python/testData/paramInfo/PartialWithList.py | Python | apache-2.0 | 64 |
from django import http
from django.views.decorators.csrf import csrf_exempt
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.contrib import messages
from django.core.urlresolvers import reverse
from mailgun import utils
from signup import models as signup_model
fr... | p2pu/mechanical-mooc | unsubscribe/views.py | Python | mit | 1,671 |
from __future__ import unicode_literals
from django.forms.models import inlineformset_factory
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from .models import Poet, Poem, School, Parent, Child
class DeletionTests(TestCase):
def test_deletion(self):
PoemFormSet = in... | rogerhu/django | tests/inline_formsets/tests.py | Python | bsd-3-clause | 6,648 |
#!/usr/bin/env python
"""A simple web server using CherryPy. It's good for prototyping REST API.
Synopsis:
cherrypy_web_server.py
Copyright 2017 Heung Ming Tai
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | hermantai/samples | python/cherrypy_web_server.py | Python | apache-2.0 | 1,672 |
from django.contrib import admin
from article.models import *
from embed_video.admin import AdminVideoMixin
from mptt.admin import MPTTModelAdmin
from article.fields import AdminImageWidget
from easy_thumbnails.fields import ThumbnailerImageField
# Register your models here.
class ArticleAdmin(AdminVideoMixin, ad... | skylifewww/pangolinland | article/admin.py | Python | mit | 3,280 |
# Orca
#
# Copyright 2006-2009 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/orca/scripts/apps/nautilus/__init__.py | Python | gpl-3.0 | 843 |
# -*- coding: utf-8 -*-
from django.test import TestCase
from django.test.client import RequestFactory
from djangular.core.urlresolvers import get_all_remote_methods, get_current_remote_methods
from .urls import RemoteMethodsView
class TemplateRemoteMethods(TestCase):
urls = 'server.tests.urls'
def setUp(sel... | dongguangming/django-angular | examples/server/tests/test_urlresolvers.py | Python | mit | 1,346 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | rdo-management/ahc-tools | ahc_tools/exc.py | Python | apache-2.0 | 1,883 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import py_privatekonomi.core.model
import py_privatekonomi.utilities.common
class BaseModel(py_privatekonomi.core.model.Model):
def __init__(self, ref, context):
super(BaseModel, self).__init__(context)
self.ref = r... | nilsFK/py-privatekonomi | py_privatekonomi/core/models/base_model.py | Python | mit | 1,562 |
# -*- coding: utf-8 -*-
'''The app module, containing the app factory function.'''
from flask import Flask, render_template
from cheapr.settings import ProdConfig
from cheapr.assets import assets
from cheapr.extensions import (
bcrypt,
cache,
db,
login_manager,
migrate,
debug_toolbar,
)
from ch... | antani/cheapr | cheapr/app.py | Python | bsd-3-clause | 1,780 |
"""
Content template tags
=====================
To use
.. code-block:: html
{% load webpack_tags %}
<!-- Render on-demand async inclusion tag for content renderers -->
{% content_renderer_assets %}
"""
from __future__ import absolute_import, print_function, unicode_literals
from django import template... | christianmemije/kolibri | kolibri/content/templatetags/content_tags.py | Python | mit | 895 |
# -*- coding: utf-8 -*-
from datetime import date
import json
from operator import itemgetter
import os
import warnings
from django.core.urlresolvers import NoReverseMatch
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db import models
from django.db.models import signals, Model
fro... | donce/django-cms | cms/models/pluginmodel.py | Python | bsd-3-clause | 18,262 |
#!/usr/bin/env python
"""
pycallgraph
U{http://pycallgraph.slowchop.com/}
Copyright Gerald Kaszuba 2007
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 ... | shanot/imp | tools/imppycallgraph.py | Python | gpl-3.0 | 13,024 |
# Copyright (c) Mathias Kaerlev 2012.
# This file is part of Anaconda.
# Anaconda 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.
# ... | joaormatos/anaconda | mmfparser/player/extensions/kcdirect.py | Python | gpl-3.0 | 9,716 |
import os
import simplejson as json
from django.core.management.base import BaseCommand, CommandError
from tendenci.apps.site_settings.models import Setting
class Command(BaseCommand):
"""
Use this command to add a settings to the database
Reads from the json file located in the same
directory as t... | alirizakeles/tendenci | tendenci/apps/site_settings/management/commands/add_settings.py | Python | gpl-3.0 | 4,051 |
#!/usr/bin/env vpython3
# 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.
import unittest
from pylib.base import base_test_result
from pylib.gtest import gtest_test_instance
class GtestTestInstanceTests(... | ric2b/Vivaldi-browser | chromium/build/android/pylib/gtest/gtest_test_instance_test.py | Python | bsd-3-clause | 11,655 |
import os
import time
import cPickle as pickle
from enigma import eServiceReference, eServiceCenter, eTimer, eSize, iPlayableService, iServiceInformation, getPrevAsciiCode, eRCInput
from Screen import Screen
from Components.Button import Button
from Components.ActionMap import HelpableActionMap, ActionMap, NumberActi... | mrnamingo/vix4-34-enigma2-bcm | lib/python/Screens/MovieSelection.py | Python | gpl-2.0 | 79,794 |
import os
import sys
from distutils.core import Command, setup
from distutils.command.build_ext import build_ext
from traceback import print_exc
cython_available = False
try:
from Cython.Distutils import build_ext
from Cython.Distutils.extension import Extension
cython_available = True
except ImportError,... | methane/meinheld-zeromq | setup.py | Python | bsd-3-clause | 1,538 |
"""Support for Volvo On Call sensors."""
import logging
from homeassistant.components.volvooncall import VolvoEntity, DATA_KEY
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Set up the Volvo sensors."""
if discovery_in... | HydrelioxGitHub/home-assistant | homeassistant/components/volvooncall/sensor.py | Python | apache-2.0 | 738 |
def solve():
s = map(int, raw_input())
n = len(s) / 2
ans = 6
for i in xrange(10):
for j in xrange(10):
for k in xrange(10):
for l in xrange(10):
for m in xrange(10):
for n in xrange(10):
if ... | EdisonAlgorithms/CodeForces | contest/845/B.py | Python | mit | 673 |
# encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Scalendar',
fields=[
('id', models.AutoField(verbose_n... | a115/scalendar | scalendar/migrations/0001_initial.py | Python | lgpl-3.0 | 1,890 |
#!/usr/bin/env python
#
# covers.py
#
# Copyright 2009 Chris Seickel
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (... | jeromeLB/client175 | covers.py | Python | gpl-3.0 | 7,145 |
# Library imports.
from flask import Flask
from json import dumps, loads
from re import escape
from uuid import uuid4, UUID
# Reactive imports
import reactive
from classes import Game
from assassins import Assassins
# Because we need an app.
app = Flask(__name__)
# Game States
PREGAME = 0
PLAYING = 1
ENDGAME = 2
# ... | Celdir/Reactive | game/server.py | Python | mit | 3,578 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Project : Tissu - Functions to handle settings with Fabric
# -----------------------------------------------------------------------------
# License : BSD License
# -----------------------... | thierrystiegler/tissu | sample.py | Python | bsd-2-clause | 780 |
import mock
import unittest
from cors import (
errors,
preflight,
)
from cors.utils import (
HeadersDict,
Request,
)
def _request(url="http://example.com", method="GET", headers=None, origin="http://example.com", **kwargs):
request = mock.MagicMock(name="mock_request")
request._response = mock... | synacorinc/python-cors | cors/tests/preflight_tests.py | Python | gpl-3.0 | 11,630 |
#!/usr/bin/python
import os
import selinux
import tempfile
import unittest
import blivet
from tests import loopbackedtestcase
import blivet.formats.fs as fs
from blivet.size import Size
@unittest.skipUnless(selinux.is_selinux_enabled() == 1, "SELinux is disabled")
class SELinuxContextTestCase(loopbackedtestcase.LoopB... | vojtechtrefny/blivet | tests/formats_test/selinux_test.py | Python | lgpl-2.1 | 2,792 |
from SloppyCell.ReactionNetworks import *
net = IO.from_SBML_file('BIOMD0000000015.xml')
prpp = net.copy('prpp')
prpp.set_var_ic('PRPP', net.get_var_ic('PRPP') * 10)
networks = [prpp]
int_times = [(0,70)]
| GutenkunstLab/SloppyCell | Example/Gutenkunst2007/Curto_1998/Nets.py | Python | bsd-3-clause | 208 |
class Employee:
"""A sample Employee Class"""
def __init__(self, first, last, pay):
self.first = first
self.last = last
self.pay = pay
@property
def email(self):
return '{}.{}@email.com'.format(self.first, self.last)
@property
def fullname(self):... | dariosena/LearningPython | general/sqlite/employee.py | Python | gpl-3.0 | 488 |
"""Add same_tool and tool_id
Revision ID: 16f121110a0f
Revises: 2c58f1b857f1
Create Date: 2015-11-09 12:28:43.019410
"""
# revision identifiers, used by Alembic.
revision = '16f121110a0f'
down_revision = '2c58f1b857f1'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | go-lab/appcomposer | alembic/versions/16f121110a0f_add_same_tool_and_tool_id.py | Python | bsd-2-clause | 1,266 |
import attr
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic_patternfly import Input, BootstrapSelect, Button, Dropdown
from widgetastic_manageiq import SummaryFormItem, Table
from widgetastic.exceptions import RowNotFound
from widgetastic.widget import View, Text
from cfme.base.ui import... | anurag03/integration_tests | cfme/configure/configuration/diagnostics_settings.py | Python | gpl-2.0 | 18,169 |
def get_fp_addsub(f):
return f["addpd"] + f["addsd"] + f["addss"] + f["addps"] + f["subpd"] + f["subsd"] + f["subss"] + f["subps"]
def get_fp_muldiv(f):
return f["mulpd"] + f["mulsd"] + f["mulss"] + f["mulps"] + f["divpd"] + f["divsd"] + f["divss"] + f["divps"]
| yonggang985/Sniper | tools/viz/asohelper.py | Python | mit | 267 |
#!/usr/bin/env python
#-*-coding:utf-8-*-
'''
Starting with the number 1 and moving to the right
in a clockwise direction a 5 by 5 spiral is formed as follows:
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
It can be verified that the sum of the numbers on the diagonals is 101.
What is th... | smrmkt/project_euler | problem_028.py | Python | mit | 776 |
# 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... | citrix-openstack-build/sahara | sahara/tests/unit/utils/notification/test_sender.py | Python | apache-2.0 | 2,181 |
#!/usr/bin/python
# coding: utf-8
import os
import re
import time
import psutil
from datetime import datetime
os.environ['DJANGO_SETTINGS_MODULE'] = 'jumpserver.settings'
import django
#django.setup()
from jlog.models import Log
def log_hanler(id):
log = Log.objects.get(id=id)
pattern = re.compile(r'([\[.*... | tomzhang/jumpserver | log_handler.py | Python | gpl-2.0 | 2,095 |
"""Tests for declarative JSONAPISerializer serialize method."""
import unittest
import datetime
from sqlalchemy import (
create_engine, Column, String, Integer, ForeignKey, Boolean, DateTime)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import backref, relationship, sessionmaker
fr... | ColtonProvias/sqlalchemy-jsonapi | sqlalchemy_jsonapi/unittests/declarative_tests/test_serialize.py | Python | mit | 20,770 |
from django import forms
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from .models import User
class UserCreationForm(forms.ModelForm):
"""
Form for creating new users.
Includes all the required fields, plus a repeated password.
"""
PASSWORDS_DONT_MATCH = "Passwords don't ma... | FreeMusicNinja/api.freemusic.ninja | users/forms.py | Python | bsd-3-clause | 1,661 |
from pytube import YouTube
from rest_framework import viewsets, response
from rest_framework_extensions.mixins import NestedViewSetMixin
from rest_framework.decorators import detail_route
from .models import Source, Video
from .serializers import SourceSerializer, VideoSerializer
class ContentSourceViewset(viewsets... | zee93/yt_lab | yt_lab/content/views.py | Python | mit | 831 |
import pytest
from dotmailer.transactional_emails import TransactionEmail
def test_valid_send(connection):
test_data = dict(
to_addresses='mr-f@mr-f.org',
subject='Hello, world!',
from_address='demo@apiconnector.com',
html_content='<div>Hello, world!<a href="http://$UNSUB$"> Unsu... | Mr-F/dotmailer | tests/transaction_emails/test_send.py | Python | mit | 1,110 |
from __future__ import absolute_import
from .algorithms import *
from .upi import *
from .io import *
import warnings
from astropy.utils.exceptions import AstropyWarning
warnings.simplefilter('ignore', category=AstropyWarning )
warnings.filterwarnings('ignore', category=UserWarning, append=True)
| GasparCorrea/acalib | acalib/__init__.py | Python | gpl-3.0 | 300 |
# Copyright 2020 Oihane Crucelaegui - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
from openupgradelib import openupgrade
_logger = logging.getLogger(__name__)
@openupgrade.migrate()
def migrate(env, version):
cr = env.cr
cr.execute("""
DELETE FROM hr... | avanzosc/hr-addons | hr_school/migrations/12.0.4.0.0/pre-migrations.py | Python | agpl-3.0 | 1,971 |
import os, sys, re
import ConfigParser
import optparse
import shutil
import subprocess
import difflib
import collections
#import numpy as np
# Alberto Meseguer file; 18/11/2016
# Modified by Quim Aguirre; 13/03/2017
# This file is the master coordinator of the DIANA project. It is used to run multiple DIANA commands... | quimaguirre/diana | scripts/old_scripts/run_experiment_cluster.py | Python | mit | 5,102 |
#%%
import time
import math
import sys
import argparse
import cPickle as pickle
import copy
import os
import codecs
import numpy as np
from chainer import cuda, Variable, FunctionSet, optimizers
import chainer.functions as F
from CharRNN import CharRNN, make_initial_state
# input data
def load_data(args):
vocab =... | yusuketomoto/chainer-char-rnn | train.py | Python | mit | 4,700 |
#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo 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... | ApolloAuto/apollo | modules/tools/ota/create_sec_package.py | Python | apache-2.0 | 1,573 |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | appleseedhq/gaffer | python/GafferImageTest/ImageStatsTest.py | Python | bsd-3-clause | 6,974 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | polyaxon/polyaxon | core/polyaxon/connections/gcp/service.py | Python | apache-2.0 | 3,117 |
# imports
import h2o
import numpy as np
import pandas as pd
from h2o.estimators.gbm import H2OGradientBoostingEstimator
from h2o.estimators.random_forest import H2ORandomForestEstimator
from h2o.grid.grid_search import H2OGridSearch
import sys
from operator import add
from pyspark import SparkContext
from pyspark.sql... | kcrandall/Kaggle_Mercedes_Manufacturing | spark/experiements/reza/random_forest.py | Python | mit | 5,051 |
"""Main part of application"""
from flask import Flask, make_response
from image.ImageAPI import image_api
app = Flask(__name__)
app.register_blueprint(image_api)
IMAGE_FILES_ROOT = './uploads'
@app.route("/")
def main():
return "Image Captivate"
if __name__ == "__main__":
app.debug = True
app.run()
... | vandersson/captivate | main.py | Python | gpl-2.0 | 362 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even... | anish/buildbot | master/buildbot/db/migrate/versions/049_add_schedulers_enabled.py | Python | gpl-2.0 | 1,084 |
"""Support for monitoring the Transmission BitTorrent client API."""
from typing import List
from transmissionrpc.torrent import Torrent
from homeassistant.const import CONF_NAME, DATA_RATE_MEGABYTES_PER_SECOND, STATE_IDLE
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_disp... | partofthething/home-assistant | homeassistant/components/transmission/sensor.py | Python | apache-2.0 | 6,263 |
fa_strings = set(['fa-glass',
'fa-music',
'fa-search',
'fa-envelope-o',
'fa-heart',
'fa-star',
'fa-star-o',
'fa-user',
'fa-film',
'fa-th-large',
'fa-th',
'fa-th-list',
'fa-check',
'fa-times',
'f... | craigmbooth/markdown_resume | src/fa_list.py | Python | gpl-2.0 | 9,203 |
from corehq.util.workbook_reading import Cell, Worksheet
from corehq.util.workbook_reading.exceptions import SpreadsheetFileInvalidError
def make_worksheet(rows=None, title=None):
rows = rows or []
row_lengths = [len(row) for row in rows]
if any(row_length != row_lengths[0] for row_length in row_lengths):... | dimagi/commcare-hq | corehq/util/workbook_reading/adapters/raw_data.py | Python | bsd-3-clause | 570 |
"""
Feature flags
"""
import logging
log = logging.getLogger(__name__)
class Features:
def __init__(self, _features=None):
if _features is None:
self.features = {}
else:
self.features = _features
self.setup = False
def setup_features(self, opts):
if no... | saltstack/salt | salt/features.py | Python | apache-2.0 | 605 |
# -*- coding: utf-8 -*-
'''
This file contains Music21's version number information.
As of v.2.0.0, Music21 uses something close to the principles of Semantic Versioning, we'll
try very hard so that X.Y.Z have meanings about changes to the system.
Changes in X represent changes that will break old features.
New Y nu... | arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/music21/_version.py | Python | mit | 2,238 |
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def mergeOneEmptyFrame():
# PUBDEV-6987: merge with one empty frame and one normal frame.
file1 = h2o.H2OFrame({"A1":[1], "A2":[0]})
file2 = h2o.H2OFrame({"A1":[], "A2":[]})
f1Mergef2 ... | michalkurka/h2o-3 | h2o-py/tests/testdir_munging/pyunit_6987_merge_one_empty.py | Python | apache-2.0 | 2,598 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-09 22:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('magazine', '0003_auto_20160509_2041'),
]
operations = [
migrations.RemoveFie... | tompreston/generationzero | magazine/migrations/0004_auto_20160509_2244.py | Python | gpl-3.0 | 569 |
#!/usr/bin/env python2
# Copyright 2015 Dejan D. M. Milosavljevic
#
# 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
#
# ... | dmilos/nucleotide | src/nucleotide/component/windows/msvc/atom/module/python.py | Python | apache-2.0 | 2,645 |
# coding: utf-8
import sys
import json
import os
from datetime import datetime
from traceback import format_exc
from contesto import config
from contesto.globals import current_test
from contesto.utils.log import log
class ContestoJSONEncoder(json.JSONEncoder):
def default(self, obj):
try:
re... | 2gis/contesto | contesto/utils/collect.py | Python | mit | 2,378 |
from __future__ import annotations
import pytest
from yarl import URL
from instawow.manager import Manager
from instawow.models import Pkg
from instawow.resolvers import Defn
from instawow.wa_updater import WaCompanionBuilder, WeakAura, WeakAuras
@pytest.fixture
def wa_saved_vars(iw_manager: Manager):
saved_var... | layday/instawow | tests/test_wa_updater.py | Python | gpl-3.0 | 3,455 |
# Copyright 2020 Red Hat, 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... | mahak/neutron | neutron/db/models/port_device_profile.py | Python | apache-2.0 | 1,350 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Chaoliang Zhong'
import time, uuid, datetime, math
from orm import Model, StringField, BooleanField, FloatField, IntegerField
from decimal import Decimal as D
def next_id():
return '%015d%s000' % (int(time.time() * 1000), uuid.uuid4().hex)
def ... | charliezon/stock | www/models.py | Python | mit | 7,530 |
import pytest
import pandas as pd
import numpy as np
from pandas.util.testing import assert_frame_equal, assert_series_equal
import pandas.util.testing as tm
@pytest.fixture(params=[['inner'], ['inner', 'outer']])
def frame(request):
levels = request.param
df = pd.DataFrame({'outer': ['a', 'a', 'a', 'b', 'b'... | NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/groupby/test_index_as_string.py | Python | apache-2.0 | 3,760 |
from django.conf.urls import url, patterns
from newswall.feeds import StoryFeed
from newswall import views
urlpatterns = patterns(
'',
url(r'^feed/$', StoryFeed()),
url(r'^$',
views.ArchiveIndexView.as_view(),
name='newswall_entry_archive'),
url(r'^index/$',
views.ArchiveIndexV... | registerguard/django-newswall | newswall/urls.py | Python | bsd-3-clause | 1,365 |
# coding=utf-8
# -----------------
# file : diagram.py
# date : 2015/05/19
# author : Victor Zarubkin
# contact : victor.zarubkin@gmail.com
# copyright : Copyright (C) 2015 Victor Zarubkin
# license : This file is part of GraphTutorial.
# :
# : GraphTutorial is free software: you c... | cas4ey/graph_test | diagram.py | Python | gpl-3.0 | 9,274 |
# -*- coding: utf-8 -*-
'''
canteen RPC: exceptions
~~~~~~~~~~~~~~~~~~~~~~~
:author: Sam Gammon <sam@keen.io>
:copyright: (c) Keen IO, 2013
:license: This software makes use of the MIT Open Source License.
A copy of this license is included as ``LICENSE.md`` in
the root of the proje... | mindis/canteen | canteen/rpc/exceptions.py | Python | mit | 672 |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Port(o... | kubevirt/client-python | kubevirt/models/v1_port.py | Python | apache-2.0 | 4,770 |
import networkx
import logging
from ..errors import AngrCFGError
l = logging.getLogger(name="angr.cfg_base")
class CFGBase(object):
def __init__(self, project, context_sensitivity_level):
self._project = project
# Initialization
self._graph = None
self._nodes = None
self.... | avain/angr | angr/analyses/cfg_base.py | Python | bsd-2-clause | 7,560 |
from __future__ import print_function
from acq4.util import Qt
import math
from acq4.util.HelpfulException import HelpfulException
import numpy as np
import pyqtgraph as pg
import acq4.analysis.tools.functions as fn
import scipy
Ui_Form = Qt.importTemplate('.SpatialCorrelatorCtrlTemplate')
class SpatialCorrelator(Qt... | acq4/acq4 | acq4/analysis/modules/MapImager/SpatialCorrelator.py | Python | mit | 8,758 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.