code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import unittest
from common import TestCase
import pyuv
class UtilTest(TestCase):
def test_hrtime(self):
r = pyuv.util.hrtime()
self.assertTrue(r)
def test_freemem(self):
r = pyuv.util.get_free_memory()
self.assertTrue(r)
def test_totalmem(self):
r = pyuv.util.... | fivejjs/pyuv | tests/test_util.py | Python | mit | 914 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/pants/shared_pants_s14.iff"
result.attribute_template_id =... | anhstudios/swganh | data/scripts/templates/object/tangible/wearables/pants/shared_pants_s14.py | Python | mit | 478 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/attachment/engine/shared_hutt_medium_engine_s02.iff"
result.at... | obi-two/Rebelion | data/scripts/templates/object/tangible/ship/attachment/engine/shared_hutt_medium_engine_s02.py | Python | mit | 470 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import t... | duyet-website/api.duyet.net | lib/gensim/test/test_word2vec.py | Python | mit | 34,696 |
from protocols.forms import forms
from core.utils import SPEED_UNITS
class CentrifugeForm(forms.VerbForm):
name = "Centrifuge"
slug = "centrifuge"
has_machine = True
# duration = forms.IntegerField(help_text='this is the minimal time this should take', initial = 'sec')
# min_speed = forms.Integer... | Bionetbook/bionetbook | bnbapp/protocols/forms/verbs/centrifuge.py | Python | mit | 585 |
# -*- coding:utf-8 -*-
import scrapy
from report_crawler.spiders.__Global_function import get_localtime
from report_crawler.spiders.__Global_variable import now_time, end_time
class HNU001_Spider(scrapy.Spider):
name = 'HNU001'
start_urls = ['http://csee.hnu.edu.cn/Front/TZXX_List?LMXX_BH=20130728174138ec48068e-48b... | AnselCmy/ARPS | report_crawler/report_crawler/spiders/spiders_001/_H/HNU001.py | Python | mit | 1,423 |
"""
This file contains the unit tests for the :mod:`communication` app.
Since this app has no models there is model and view tests:
* :class:`~communication.tests.CommunicationModelTests`
* :class:`~communication.tests.CommunicationViewTests`
"""
from lab_website.tests import BasicTests
from communication.models ... | davebridges/Lab-Website | communication/tests.py | Python | mit | 14,526 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/deployment.py | Python | mit | 3,290 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_commoner_naboo_human_female_07.iff"
result.attribute_t... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_commoner_naboo_human_female_07.py | Python | mit | 465 |
"""
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
"""
class Solution:
# @return a string
def intToRoman(self, num):
digits = [(1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD' ),
(100, 'C'), (90, 'XC'), (50, 'L'), (40, 'XL'... | cyandterry/Python-Study | Ninja/Leetcode/12_Integer_to_Roman.py | Python | mit | 614 |
from django.db import models
from django.conf import settings
from django.core.exceptions import ValidationError
from polymorphic import PolymorphicModel
from django.db.models import F
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from celery.exceptions import SoftTimeLimitExc... | dever860/cabot | cabot/cabotapp/models.py | Python | mit | 30,857 |
'''MobileNetV2 in PyTorch.
See the paper "Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation" for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Module):
'''expand + depthwise + pointwise'''
def __init... | kuangliu/pytorch-cifar | models/mobilenetv2.py | Python | mit | 3,092 |
#Written by: Karim shoair - D4Vinci ( Dr0p1t-Framework )
import sys
from os.path import *
global G, Y, B, R, W , M , C , end
def set_colors():
global G, Y, B, R, W , M , C , end
if sys.platform.startswith('win'):
# Windows deserve coloring too :D
try:
import win_unicode_console , colorama
win_unicode_conso... | D4Vinci/Dr0p1t-Framework | core/color.py | Python | mit | 3,614 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_swoop_large4.iff"
result.attribute_template_id ... | obi-two/Rebelion | data/scripts/templates/object/building/poi/shared_tatooine_swoop_large4.py | Python | mit | 452 |
"""
Django settings for lwc project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | codingforentrepreneurs/launch-with-code | lwc/settings/base.py | Python | mit | 2,800 |
#!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from sensor_msgs.msg import PointCloud2
class StorePointcloudState(EventState):
'''
Stores the latest pointcloud of the given topic.
-- topic string The topic on which to listen... | pschillinger/lamor15 | lamor_flexbe_states/src/lamor_flexbe_states/store_pointcloud_state.py | Python | mit | 847 |
import sublime
HOST_PLATFORM = sublime.platform()
WINDOWS = 'windows'
LINUX = 'linux'
OSX = 'osx'
| SublimeText/VintageEx | plat/__init__.py | Python | mit | 109 |
# file openpyxl/writer/straight_worksheet.py
# Copyright (c) 2010-2011 openpyxl
#
# 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, including without limitation the rights... | Jian-Zhan/customarrayformatter | openpyxl/writer/dump_worksheet.py | Python | mit | 10,418 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe, unittest
from frappe.defaults import *
class TestDefaults(unittest.TestCase):
def test_global(self):
clear_user_default("key1")
set_global_default("key1", "value1")
self.assertEqual(get_global_defaul... | frappe/frappe | frappe/tests/test_defaults.py | Python | mit | 2,355 |
# -*- coding: utf-8 -*-
from gluon import current
from s3 import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
red_cross_filter = {"organisation.organisation_type_id$name" : "Red Cross / Red Crescent"}
# ==============================================... | flavour/tldrmp | private/templates/IFRC/menus.py | Python | mit | 31,780 |
# -*- coding: utf-8 -*-
# 자세한 설명은 상위 폴더의 03 - Seq2Seq.py 등에서 찾으실 수 있습니다.
import tensorflow as tf
# Seq2Seq 기본 클래스
class Seq2Seq:
logits = None
outputs = None
cost = None
train_op = None
def __init__(self, vocab_size, n_hidden=128, n_layers=3):
self.learning_late = 0.001
self.vo... | junsooo/Fake_love | chatbot/model.py | Python | mit | 4,248 |
from __future__ import unicode_literals
from django.apps import AppConfig
class ScannerEngineConfig(AppConfig):
name = 'scanner_engine'
| Josowsky/Simple-Site-Monitor | scanner_engine/apps.py | Python | mit | 143 |
place_time = {
"1" : "United Kingdom, London, MI6 / fri 28 august, 3:50 a.m.",
"2" : "London, agent Harry's House / fri 28 august, 3:55 a.m.",
"3" : "Ireland, Dublin, agent Patrick's House / fri 28 august, 9:45 a.m.",
"4" : "Ireland, Dublin, agent Patrick's House / fri 28 august, 11:30 a.m.",
"5" : "Ireland, Dubli... | L-yCoyote/web-quest | site/text_data.py | Python | mit | 9,734 |
import datetime
import time
from random import choice
import discord
import lifesaver
from discord.ext import commands
from lifesaver.bot.storage import AsyncJSONStorage
from lifesaver.utils import (
ListPaginator,
clean_mentions,
human_delta,
pluralize,
truncate,
)
from .converters import Message... | slice/dogbot | dog/ext/quoting/cog.py | Python | mit | 7,284 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku.py | Python | mit | 1,696 |
#-*- coding: utf-8 -*-
"""
@author: Rinze de Laat
Copyright © 2013 Rinze de Laat, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License version 2 as published by the Free Software
Foundation.
Odemis is distributed in ... | gstiebler/odemis | src/odemis/util/test/util_test.py | Python | gpl-2.0 | 8,569 |
from django.test import TestCase
from django.test.utils import override_settings
from rest_framework import status
from rest_framework.test import APIClient
from axes.signals import user_locked_out
import json
import time
from family_tree.models.family import Family
from family_tree.models.person import Person
from cu... | JustinWingChungHui/MyFamilyRoot | auth_api/tests.py | Python | gpl-2.0 | 5,613 |
# -*- coding: iso-8859-1 -*-
# Author: Andrew Jewett (jewett.aij at g mail)
# http://www.chem.ucsb.edu/~sheagroup
# License: 3-clause BSD License (See LICENSE.TXT)
# Copyright (c) 2012, Regents of the University of California
# All rights reserved.
"""A lexical analyzer class for simple shell-like syntaxes.
... | CFDEMproject/LAMMPS | tools/moltemplate/src/ttree_lex.py | Python | gpl-2.0 | 82,841 |
#
# Copyright (c) 2010 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 copy of... | hustodemon/spacewalk | backend/wsgi/__init__.py | Python | gpl-2.0 | 609 |
# ICE Revision: $Id$
"""Read a STL file and do simple manipulations"""
from os import path
from PyFoam.Error import error
from PyFoam.ThirdParty.six import next as iterNext
class STLFile(object):
"""Store a complete STL-file and do simple manipulations with it"""
noName="<no name given>"
def __init__(... | mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | PyFoam/Basics/STLFile.py | Python | gpl-2.0 | 6,542 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2005-2006 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2007-2008 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... | billiob/papyon | papyon/profile.py | Python | gpl-2.0 | 31,976 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio 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) a... | lnielsen/invenio | invenio/ext/fixtures/registry.py | Python | gpl-2.0 | 1,433 |
# -*- coding: utf-8 -*-
"""
Created on 17 Aug 2012
@author: Éric Piel
Copyright © 2012 Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License version 2 as published by the Free Software
Foundation.
Odemis is... | gstiebler/odemis | src/odemis/dataio/__init__.py | Python | gpl-2.0 | 4,684 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: tdAddBasic1.py $
"""
VirtualBox Validation Kit - Additions Basics #1.
"""
__copyright__ = \
"""
Copyright (C) 2010-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free sof... | sobomax/virtualbox_64bit_edd | src/VBox/ValidationKit/tests/additions/tdAddBasic1.py | Python | gpl-2.0 | 11,512 |
# -*- coding: utf-8 -*-
"""
Script to cache anonymous houseprint data into hp_anonymous.pkl
Created on 05/07/2014 by Roel De Coninck
"""
import os, sys
import inspect
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
# add the path to opengrid to sys.path
sys.path.a... | EnergyID/opengrid | scripts/job_cache_anonymous_houseprint.py | Python | gpl-2.0 | 730 |
#!/usr/bin/env python3
import dis
def myFunc():
x = 1
y = 2
z = 'abc' # noqa
return x + y
print(myFunc.__name__)
print(myFunc.__code__.co_varnames)
print(myFunc.__code__.co_consts)
print(myFunc.__code__.co_code)
dis.disassemble(myFunc.__code__)
| jeremyprice/RU_Python_II | examples/example_function_obj.py | Python | gpl-2.0 | 269 |
# -*- coding: utf-8 -*-
"""
sphinx.directives
~~~~~~~~~~~~~~~~~
Handlers for additional ReST directives.
:copyright: 2007-2008 by Georg Brandl.
:license: BSD.
"""
import re
import sys
import string
import posixpath
from os import path
from docutils import nodes
from docutils.parsers.rst import d... | creasyw/IMTAphy | documentation/doctools/tags/0.2/sphinx/directives.py | Python | gpl-2.0 | 31,058 |
#
# Copyright (c) 2008--2016 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... | lhellebr/spacewalk | backend/server/importlib/backend.py | Python | gpl-2.0 | 74,266 |
# Testing the line trace facility.
from test import test_support
import unittest
import sys
import difflib
import gc
# A very basic example. If this fails, we're in deep trouble.
def basic():
return 1
basic.events = [(0, 'call'),
(1, 'line'),
(1, 'return')]
# Man... | j5shi/Thruster | pylibs/test/test_sys_settrace.py | Python | gpl-2.0 | 24,801 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# --... | MoRgUiJu/morguiju.repo | plugin.video.pelisalacarta/platformcode/mct.py | Python | gpl-2.0 | 29,761 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio 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... | cjhak/b2share | invenio/modules/records/views.py | Python | gpl-2.0 | 13,449 |
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
"""
Edit metadata in RTF files.
"""
import re, cStringIO, codecs
from calibre import force_unicode
from calibre.ebooks.metadata import MetaInformation, string_to_authors
title_pat = re.compile(r'\{\\info.*?\{\\title(.*?)(?<!\\)... | jelly/calibre | src/calibre/ebooks/metadata/rtf.py | Python | gpl-3.0 | 7,633 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------------------------------------
# Program Name: holy_orders
# Program Description: Update program for the Abbot Cantus API server.
#
# Filename: holy_orders/current.py
# Purpose:... | CANTUS-Project/abbot | holy_orders/current.py | Python | gpl-3.0 | 6,147 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... | SickGear/SickGear | lib/apprise/plugins/NotifyD7Networks.py | Python | gpl-3.0 | 16,906 |
# shipSPTOptimalBonusMF
#
# Used by:
# Ship: Chremoas
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Small Projectile Turret"),
"maxRange", ship.getModifiedItemAttr("shipBonusMF"), skill="Minmatar Frigate")
| Ebag333/Pyfa | eos/effects/shipsptoptimalbonusmf.py | Python | gpl-3.0 | 316 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing M2M table for field followed_by on 'Exercise'
db.delete_table('exercise_followed_by')
def... | maxwward/SCOPEBak | askbot/migrations/0076_transplant_followed_by_2.py | Python | gpl-3.0 | 27,054 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Adam.Dybbroe
# Author(s):
# Adam.Dybbroe <a000680@c14526.ad.smhi.se>
# 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, eith... | adybbroe/pypps_reader | test/test_ppsread.py | Python | gpl-3.0 | 1,228 |
import os
import sys
import signal
import logging
import pytest
import latus.logger
import test_latus.tstutil
os.environ["PYTHONPATH"] = '.'
g_keep_running = True
def control_key_handler(signal, frame):
global g_keep_running
print('%s : ctrl-c detected - exiting' % __file__)
g_keep_running = False
... | latusrepo/latus | run_pytest_until_error.py | Python | gpl-3.0 | 1,334 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import babelfish
import requests
from . import Provider
from .. import __version__
from ..exceptions import InvalidSubtitle, ProviderNotAvailable, ProviderError
from ..subtitle import Subtitle, is_valid_subtitle, detect
logger = logging.ge... | caronc/nzb-subliminal | Subliminal/subliminal/providers/thesubdb.py | Python | gpl-3.0 | 3,140 |
del x
| pyta-uoft/pyta | examples/ending_locations/del_name.py | Python | gpl-3.0 | 6 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, _
class ResCompany(models.Model):
_inherit = "res.company"
@api.model
def create(self, vals):
new_company = super(ResCompany, self).create(vals)
ProductPriceli... | ChawalitK/odoo | addons/product/res_company.py | Python | gpl-3.0 | 1,090 |
from __future__ import absolute_import
from django.contrib.auth.models import User, Group
from navigation.api import register_multi_item_links
from navigation.classes import Link
from project_setup.api import register_setup
from .links import (user_list, user_setup, user_edit, user_add, user_delete,
user_multipl... | commonwealth-of-puerto-rico/lean | paart/apps/user_management/__init__.py | Python | gpl-3.0 | 1,463 |
#!/usr/bin/env python
#-*- coding: utf-8 -
import keystoneclient.v2_0.client as keystone
from keystoneauth1.identity import v2
from keystoneauth1 import session
import novaclient.client as nova
import cinderclient.client as cinder
from glanceclient.v1 import client as glance
import neutronclient.v2_0.client as neutron
... | juliend88/os_image_factory | test-tools/pytesting_os/openstackutils.py | Python | gpl-3.0 | 8,608 |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... | SUSE/kiwi | kiwi/system/kernel.py | Python | gpl-3.0 | 5,997 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import csv
from copy import copy
from typing import List, Dict
import typesystem
from .types import PartialActor, ActorIssue, PartialIssue, IssuePosition, IssueDescription, Comment
types = {
PartialActor.starts_with: PartialActor,
ActorIssue.sta... | foarsitter/equal-gain-python | decide/data/reader.py | Python | gpl-3.0 | 6,159 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 30 09:53:39 2018
@author: mayank
"""
from forms import SignupForm
from flask import Flask, request, render_template
from flask_login import LoginManager, login_user, login_required, logout_user
app = Flask(__name__)
app.secret_key = 'gMALVWEuxBSx... | mayankjohri/LetsExplorePython | Section 2 - Advance Python/Chapter S2.06 - Web Development/code/flask/flask_login/sample_2/app.py | Python | gpl-3.0 | 2,215 |
import unittest
import numpy as np
from numpy.testing import assert_array_equal
from dgw.evaluation.resampling import extend_point, shrink_to_a_single_point
class TestExtending(unittest.TestCase):
def test_extend_point(self):
a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
ans = np.array([0, 1, ... | lukauskas/dgw | dgw/evaluation/tests/test_resampling.py | Python | gpl-3.0 | 1,877 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a dialog for editing IRC network definitions.
"""
from __future__ import unicode_literals
import copy
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QT... | testmana2/test | Network/IRC/IrcNetworkEditDialog.py | Python | gpl-3.0 | 9,059 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public Licen... | bendykst/deluge | deluge/plugins/WebUi/setup.py | Python | gpl-3.0 | 1,489 |
__doc__ = """External interface to the BeautifulSoup HTML parser.
"""
__all__ = ["fromstring", "parse", "convert_tree"]
from lxml import etree, html
from calibre.ebooks.BeautifulSoup import \
BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString
def fromstring(data, beautifulsoup=None, makeelemen... | jelly/calibre | src/calibre/utils/soupparser.py | Python | gpl-3.0 | 4,507 |
#!/usr/bin/env python
# encoding:utf-8
"""
Filter Xroar trace files.
see README for more information.
:created: 2014 by Jens Diemer - www.jensdiemer.de
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
import os
import time
import sys
import argparse
class XroarTraceFilter(object):
... | JuhaniImberg/DragonPy | misc/filter_xroar_trace.py | Python | gpl-3.0 | 10,452 |
#
#
# Copyright 2011,2013 Luis Ariel Vega Soliz, Uremix (http://www.uremix.org) and contributors.
#
#
# This file is part of UADH (Uremix App Developer Helper).
#
# UADH 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 Sof... | arielvega/uremix-app-developer-helper | src/uadh/gui/tkinter/__init__.py | Python | gpl-3.0 | 936 |
../../../../../../share/pyshared/mx/DateTime/mxDateTime/test.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/test.py | Python | gpl-3.0 | 63 |
from spec.python import db_connection
import sam.common
import sam.constants
import web
app = web.application(sam.constants.urls, globals(), autoreload=False)
sam.common.session_store = web.session.DBStore(db_connection.db, 'sessions')
sam.common.session = web.session.Session(app, sam.common.session_store)
# TODO: th... | riolet/SAM | spec/python/test_server.py | Python | gpl-3.0 | 3,851 |
async def ev_mention(ev, message):
def_stat_data = {
'event': 'mention',
'count': 0
}
collection = 'EventStats'
database = ev.bot.cfg.db.database
check = ev.db[database][collection].find_one({"event": 'mention'})
if not check:
ev.db[database][collection].insert_one(def_st... | lu-ci/apex-sigma-plugins | core_functions/stats/ev_mention.py | Python | gpl-3.0 | 572 |
# 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/.
from setuptools import setup
PACKAGE_NAME = 'mozdevice'
PACKAGE_VERSION = '0.44'
deps = ['mozfile >= 1.0',
'mo... | kostaspl/SpiderMonkey38 | testing/mozbase/mozdevice/setup.py | Python | mpl-2.0 | 1,156 |
# 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/.
"""
By default, this module uses the pre-built Ember model from
https://pubdata.endgame.com/ember/ember_dataset.tar.bz2.... | mitre/multiscanner | multiscanner/modules/MachineLearning/EndgameEmber.py | Python | mpl-2.0 | 2,656 |
# -*- coding: utf-8 -*-
import json
from . import check_input_attribute, standard_error_message
from pyipasnhistory import IPASNHistory
from pymisp import MISPAttribute, MISPEvent, MISPObject
misperrors = {'error': 'Error'}
mispattributes = {'input': ['ip-src', 'ip-dst'], 'format': 'misp_standard'}
moduleinfo = {'ver... | VirusTotal/misp-modules | misp_modules/modules/expansion/ipasn.py | Python | agpl-3.0 | 2,208 |
# Generated by Django 2.2.13 on 2020-07-30 15:02
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0526_unique_together_groupelementyear'),
]
operations = [
migrations.AlterField(
model_... | uclouvain/OSIS-Louvain | base/migrations/0527_auto_20200730_1502.py | Python | agpl-3.0 | 560 |
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your... | Comunitea/CMNT_004_15 | project-addons/prepaid_order_discount/__init__.py | Python | agpl-3.0 | 867 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import re
fr... | petrjasek/superdesk-core | superdesk/macros/imperial/length_feet_and_inches_to_metric.py | Python | agpl-3.0 | 4,093 |
from yaml import dump
from twisted.internet.defer import succeed, fail
from txaws.s3.exception import S3Error
from juju.lib.testing import TestCase
from juju.providers.ec2.tests.common import EC2TestMixin
class EC2StateTest(TestCase, EC2TestMixin):
def setUp(self):
EC2TestMixin.setUp(self)
sup... | anbangr/trusted-juju | juju/providers/ec2/tests/test_state.py | Python | agpl-3.0 | 4,134 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | scottpurdy/nupic.core | bindings/py/tests/network_test.py | Python | agpl-3.0 | 3,782 |
#Parsing program to sort through Investopedia
import urllib2
import re
#This is the code to parse the List of Terms
def get_glossary(res_num):
html_lowered = res_num.lower();
begin = html_lowered.find('<!-- .alphabet -->')
end = html_lowered.find('<!-- .idx-1 -->')
if begin == -1 or end == -1:
return None
else:... | secondfoundation/Second-Foundation-Src | src/haruspex/python/echelon/investopedia_generator.py | Python | lgpl-2.1 | 2,630 |
# ***************************************************************************
# * *
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... | bblacey/FreeCAD-MacOS-CI | src/Mod/Fem/PyGui/_CommandFemMeshGmshFromShape.py | Python | lgpl-2.1 | 3,534 |
#!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
if len(sys.argv) > 1:
builddir = sys.argv[1]
no_import_hooks = True
else:
builddir = '..'
no_import_hooks = False
common.run_import_tests(builddir, no_import_hooks)
SKIP_FILES = ['common', 'runtests']
dir = os.path.... | mate-desktop/python-mate-desktop | tests/runtests.py | Python | lgpl-2.1 | 722 |
from yandextank.plugins.Aggregator import SecondAggregateData
from yandextank.plugins.Autostop import AutostopPlugin
from Tank_Test import TankTestCase
import tempfile
import unittest
class AutostopTestCase(TankTestCase):
def setUp(self):
core = self.get_core()
core.load_configs(['config/autostop.... | asekretenko/yandex-tank | tests/Autostop_Test.py | Python | lgpl-2.1 | 3,041 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2007 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program 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 F... | Vauxoo/stoqdrivers | stoqdrivers/escp.py | Python | lgpl-2.1 | 2,767 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | agry/NGECore2 | scripts/mobiles/corellia/slice_hound.py | Python | lgpl-3.0 | 1,618 |
import sys
# Project SWG: Jabba TP Romo Vax Bunker: Static Spawns
# (C)2014 ProjectSWG
from resources.datatables import Options
from resources.datatables import State
def addPlanetSpawns(core, planet):
stcSvc = core.staticService
objSvc = core.objectService
stcSvc.spawnObject('romovax_henchman', 'tatooin... | agry/NGECore2 | scripts/static_spawns/tatooine/jabba_tp_romo_vax_bunker.py | Python | lgpl-3.0 | 4,612 |
# Copyright 2009-2014 Justin Riley
#
# This file is part of TethysCluster.
#
# TethysCluster 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
# la... | tethysplatform/TethysCluster | tethyscluster/azureutils.py | Python | lgpl-3.0 | 56,078 |
import logging
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import connection
from django_pgviews.view import clear_view, View, MaterializedView
log = logging.getLogger('django_pgviews.sync_pgviews')
class Command(BaseCommand):
help = """Clear Postgres views.... | kennydude/django-pgviews | django_pgviews/management/commands/clear_pgviews.py | Python | unlicense | 1,195 |
import numpy as np
import pylab
# elephant parameters
p1, p2, p3, p4 = (50 - 30j, 18 + 8j, 12 - 10j, -14 - 60j )
p5 = 40 + 20j # eyepiece
def fourier(t, C):
f = np.zeros(t.shape)
A, B = C.real, C.imag
for k in range(len(C)):
f = f + A[k]*np.cos(k*t) + B[k]*np.sin(k*t)
return f
def elephan... | tejaskhot/How-to-fit-an-elephant | elephant.py | Python | unlicense | 824 |
# 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... | hehongliang/tensorflow | tensorflow/python/kernel_tests/conv_ops_test.py | Python | apache-2.0 | 73,074 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.LOW
def dependencies():
pass
def tamper(payload, **kwargs):
"""
Replaces space character (' ') with ... | glaudsonml/kurgan-ai | tools/sqlmap/tamper/space2comment.py | Python | apache-2.0 | 1,319 |
# -*- coding: utf-8 -*-
# Copyright 2015 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 requi... | huntxu/fuel-web | nailgun/nailgun/test/integration/test_cluster_plugin_links_handler.py | Python | apache-2.0 | 4,662 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | hehongliang/tensorflow | tensorflow/python/kernel_tests/scatter_nd_ops_test.py | Python | apache-2.0 | 28,025 |
from luigi_bigquery import ResultProxy
import os
import shutil
import tempfile
class MockClient(object):
def __init__(self, datasets, tables, jobs):
self._datasets = datasets
self._tables = tables
self._jobs = jobs
def create_dataset(self, dataset_id, friendly_name=None, description=N... | kamatama41/luigi-bigquery | luigi_bigquery/tests/test_helper.py | Python | apache-2.0 | 3,217 |
# -*- coding: utf-8 -*-
'''
Wheel system wrapper for key system
'''
from __future__ import absolute_import
# Import python libs
import os
import hashlib
# Import salt libs
import salt.key
import salt.crypt
__func_alias__ = {
'list_': 'list'
}
def list_(match):
'''
List all the keys under a named status... | stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/wheel/key.py | Python | apache-2.0 | 3,278 |
# -*- coding: utf-8 -*-
import os
import time
import json
import Image, StringIO
import allura
from mock import patch
from nose.tools import assert_true, assert_false, assert_equal, assert_in
from formencode.variabledecode import variable_encode
from alluratest.controller import TestController
from allura import mode... | pombredanne/SourceForge-Allura | ForgeTracker/forgetracker/tests/functional/test_root.py | Python | apache-2.0 | 50,244 |
# 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... | TakayukiSakai/tensorflow | tensorflow/contrib/learn/python/learn/estimators/tensor_signature_test.py | Python | apache-2.0 | 5,029 |
import os
import re
import cx_Oracle
import collections
import datetime
earContentionCode = [2200,2210,2220,3140,3150,4130,4210,4700,4920,5000,5010,5710,6850]
#Primary query, Look for all claims/contentions where the participant has at least one contention with an ear-related contention code.
#Organize them based fir... | VHAINNOVATIONS/BCDS | Model/scripts/ear_validation/python/aggregateContention.py | Python | apache-2.0 | 9,448 |
import logging
from xml.dom.minidom import *
from jinja2 import Environment, Template
from edge.dateutility import DateUtility
from edge.opensearch.response import Response
class TemplateResponse(Response):
def __init__(self):
super(TemplateResponse, self).__init__()
self.env = Environment()
... | dataplumber/edge | src/main/python/libraries/edge/opensearch/templateresponse.py | Python | apache-2.0 | 1,202 |
# Copyright 2017 IBM Corp.
# 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 app... | rajalokan/nova | nova/tests/unit/test_identity.py | Python | apache-2.0 | 3,137 |
#!/usr/bin/env python3
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
import unittest
from framework import VppTestCase, VppTestRunner
from vpp_ip import DpoProto
from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsLabel, \
VppIpTable, FibPathProto
from vpp_acl import AclRule, VppAcl
from scapy... | FDio/vpp | test/test_abf.py | Python | apache-2.0 | 10,057 |
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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 re... | cisco-openstack/tempest | tempest/common/utils/__init__.py | Python | apache-2.0 | 4,477 |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Gathers components according to their history.
This algorithm is a test: it can be a memory hog
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 3.0.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0... | isandlaTech/cohorte-devtools | qualifier/deploy/cohorte-home/repo/cohorte/composer/node/criteria/distance/history.py | Python | apache-2.0 | 7,358 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Locaweb.
# 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/license... | subramani95/neutron | neutron/agent/linux/iptables_manager.py | Python | apache-2.0 | 24,792 |
import time
import sqlalchemy as SA
import pushmanager.core.db as db
import pushmanager.core.util
from pushmanager.core.mail import MailQueue
from pushmanager.core.rb import RBQueue
from pushmanager.core.requesthandler import RequestHandler
class LivePushServlet(RequestHandler):
def _arg(self, key):
re... | Yelp/pushmanager | pushmanager/servlets/livepush.py | Python | apache-2.0 | 3,789 |
import os
from pathlib import Path
import gi
import logging
from gi.repository import Gtk
import json_config
from .login_window import LoginWindow
TOP_DIR = os.path.dirname(os.path.abspath(__file__))
config = json_config.connect('config.json')
gi.require_version('Gtk', '3.0')
class WatsonCredentialsDialog(Gtk.Dia... | betterclever/susi_linux | main/renderer/configuration_window.py | Python | apache-2.0 | 8,711 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.