code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#### 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 = Ship()
result.template = "object/ship/shared_smuggler_warlord_ship_tier5.iff"
result.attribute_template_id = -1
... | anhstudios/swganh | data/scripts/templates/object/ship/shared_smuggler_warlord_ship_tier5.py | Python | mit | 424 |
class Item(object):
def __init__(self, name, description, location):
self.name = name
self.description = description
self.location = location
location.here.append(self)
actions = ['look']
def look(self, player, noun):
""" Looking at the object """
... | AnthonyBriggs/Python-101 | hello_python_source_py3/chapter 06/3/item.py | Python | mit | 357 |
import ConfigParser
import logging
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.join(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir), "CountryReconciler"))
sys.path.append(os.path.join(os.path.join(os.path.dirname(os.path.realpath(__file... | landportal/landbook-importers | old-importers/TransparencyIntImporter/main.py | Python | mit | 1,934 |
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
# Originally contributed by Check Point Software Technologies, Ltd.
import logging
from lib.api.adb import dump_droidmon_logs, execute_sample, install... | cuckoobox/cuckoo | cuckoo/data/analyzer/android/modules/packages/apk.py | Python | mit | 851 |
import logging
import click
from click.testing import CliRunner
import click_log
import pytest
test_logger = logging.getLogger(__name__)
@pytest.fixture
def runner():
return CliRunner()
def test_basic(runner):
@click.command()
@click_log.init()
def cli():
test_logger.error('damn')
... | pombredanne/click-log | tests/test_basic.py | Python | mit | 448 |
"""
This convenience module is to hard-code some example FASTA files for testing
and development.
"""
| scholer/cadnano2.5 | cadnano/extras/fasta/__init__.py | Python | mit | 102 |
from bs4 import BeautifulSoup
from urllib.parse import quote
from core import models
def get_setting(setting_name, setting_group_name, default=None):
try:
setting = models.Setting.objects.get(
name=setting_name,
group__name=setting_group_name,
)
return setting.valu... | ubiquitypress/rua | src/core/util.py | Python | gpl-2.0 | 1,313 |
# pywws - Python software for USB Wireless Weather Stations
# http://github.com/jim-easterbrook/pywws
# Copyright (C) 2018 pywws contributors
# 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; ei... | jim-easterbrook/pywws | src/pywws/service/pwsweather.py | Python | gpl-2.0 | 3,827 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
#
# 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 you... | beernarrd/gramps | gramps/gen/utils/test/callback_test.py | Python | gpl-2.0 | 8,780 |
#
# Copyright (c) 2005 Red Hat, Inc.
#
# Written by Joel Martin <jmartin@redhat.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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; ei... | dmacvicar/spacewalk | client/solaris/smartpm/smart/backends/solaris/base.py | Python | gpl-2.0 | 3,072 |
# -*- coding: utf-8 -*-
"""
iso.py
======
.. argparse::
:module: iso
:func: create_parser
:prog: iso.py
.. moduleauthor:: Geoff Hutchison <geoffh@pitt.edu>
"""
import argparse
import os
from scipy import misc, ndimage
import numpy as np
desc = """
Generate isotropic two-phase 2D systems using Gaussian n... | LangmuirSim/langmuir | LangmuirPython/ga2d/generators/iso.py | Python | gpl-2.0 | 2,422 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import os, sys
import time
import re
import string
from utility import version
from utility.util import log
from utility.util import LogLevel
class ModuleObj:
_chip_id = ''
_gen_path = ''
def __init__(self, name1, name2):
self.__hName = name1
se... | nik124seleznev/ZC500TG | tools/dct/obj/ModuleObj.py | Python | gpl-2.0 | 4,092 |
import boogietools as bt
import re
import urllib
import urlparse
encoding="utf-8"
def run(id,ref):
type="rtmp"
#provides: http://www.hdmyt.info, http://www.playerhd(n).pw
r_pageurl="http://content.jwplatform.com/players/%s.html"%id
jsurl="http://content.jwplatform.com/players/%s.js"%id
#loop through endless doma... | boogiekodi/script.module.livelib | lib/scrapers/jw.py | Python | gpl-2.0 | 894 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('nodes', '0003_auto_20150320_1929'),
]
operations = [
migrations.AddFie... | CMPUT410W15T02/CMPUT410W15-project | social_distribution/nodes/migrations/0004_auto_20150331_1931.py | Python | gpl-2.0 | 815 |
from subprocess import check_call
import logging
import datetime
def setup(name):
formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(fo... | OSMNames/OSMNames | osmnames/logger.py | Python | gpl-2.0 | 788 |
"""
Update Example
++++++++++++++
It can be useful to perform an action when a property is changed and can be
used to update other properties or synchronize with external data.
All properties define update functions except for CollectionProperty.
"""
import bpy
def update_func(self, context):
print("my test fu... | pawkoz/dyplom | blender/doc/python_api/examples/bpy.props.4.py | Python | gpl-2.0 | 495 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SpatialJoin.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Joshua Arnott
Email : josh at snorfalorpagus dot net
*******************... | ahuarte47/QGIS | python/plugins/processing/algs/qgis/SpatialJoin.py | Python | gpl-2.0 | 12,871 |
import xml.etree.ElementTree as etree
import base64
from struct import unpack, pack
import sys
import io
import os
import time
import itertools
import xbmcaddon
import xbmc
import urllib2,urllib
import traceback
import urlparse
import posixpath
import re
import hmac
import hashlib
import binascii
imp... | pauron/ShaniXBMCWork | script.video.F4mProxy/lib/f4mDownloader.py | Python | gpl-2.0 | 39,022 |
# file send.py
import socket
server = socket.socket()
serverAddr = ("127.0.0.1", 1025, )
server.bind(serverAddr)
server.listen(0)
foo = server.accept()
print(foo)
| ctut-jim/ctut-gitgud | py3-sockets/send.py | Python | gpl-2.0 | 173 |
#!/usr/bin/env python
# Calculate a table of pairwise energies and forces between "INT" atoms
# in the lipid membrane model described in
# Brannigan et al, Phys Rev E, 72, 011915 (2005)
# The energy of this interaction U(r) = eps*(0.4*(sigma/r)^12 - 3.0*(sigma/r)^2)
# I realized later this is not what we want becau... | jcarlson23/lammps | tools/moltemplate/examples/CG_membrane_examples/membrane_BranniganPRE2005/moltemplate_files/version_charmm_cutoff/calc_table.py | Python | gpl-2.0 | 2,403 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
FirstLastReturn.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Niccolo' Marchi
Email : sciurusurbanus at hotmail dot it
***************... | michaelkirk/QGIS | python/plugins/processing/algs/lidar/fusion/FirstLastReturn.py | Python | gpl-2.0 | 2,653 |
def is_teacher(user):
return user.profile.is_teacher()
def is_current_teacher(user):
return user.profile.is_current_teacher()
def newsletter(user):
return user.profile.newsletter
def get_involved(user):
return user.profile.get_involved
def is_board_member(user):
return user.functions.exists()
| tanzquotient/tq_website | groups/definitions/predicates.py | Python | gpl-2.0 | 319 |
"""Wrapper for mod_wsgi, for use as a CherryPy HTTP server.
To autostart modwsgi, the "apache" executable or script must be
on your system path, or you must override the global APACHE_PATH.
On some platforms, "apache" may be called "apachectl" or "apache2ctl"--
create a symlink to them if needed.
KNOWN BUGS
========... | Juanvvc/scfs | webserver/cherrypy/test/modwsgi.py | Python | gpl-2.0 | 4,799 |
# This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# This program 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 Soft... | soellman/copernicus | cpc/util/openssl.py | Python | gpl-2.0 | 10,399 |
#! /usr/bin/env python
# encoding: utf-8
# based on
# example program using ircbot.py by Joel Rosdahl <joel@rosdahl.net>
# ircbot
try:
from irc.bot import SingleServerIRCBot
#from ircbot import SingleServerIRCBot
from irc.client import is_channel, ip_quad_to_numstr, ip_numstr_to_quad, NickMask
from irc... | ChainsAutomation/chains | lib/chains/services/ircbot/__init__.py | Python | gpl-2.0 | 20,436 |
# This file is part of 'NTLM Authorization Proxy Server'
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# NTLM APS 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 Licens... | Vaysman/ntlmaps | ntlmaps/config_affairs.py | Python | gpl-2.0 | 5,763 |
# LibreShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas, TJ
#
# This file is part of LibreShot Video Editor (http://launchpad.net/libreshot/).
#
# LibreShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of t... | XXLRay/libreshot | libreshot/classes/project.py | Python | gpl-3.0 | 13,790 |
"""CLI tests for logging.
:Requirement: Logging
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: logging
:TestType: Functional
:CaseImportance: Medium
:Upstream: No
"""
import re
from fauxfactory import gen_string
from robottelo import (
manifests,
ssh,
)
from robottelo.cli.factory impor... | ldjebran/robottelo | tests/foreman/cli/test_logging.py | Python | gpl-3.0 | 11,539 |
# -*- coding: utf-8 -*-
# +---------------------------------------------------------------------------+
# | 01001110 01100101 01110100 01111010 01101111 01100010 |
# | |
# | Netzob : Inferring communication prot... | lootr/netzob | netzob_web/netzob_web/settings.py | Python | gpl-3.0 | 3,846 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | belokop/indico_bare | indico/web/http_api/metadata/xml.py | Python | gpl-3.0 | 4,167 |
'''
Simple sphinx extension which sets up the necessary translators (html, latex) and other stuff
It is also a collection of trial and errors mostly commented and left here as a reminder in order
Created on Apr 4, 2016
@author: riccardo
'''
import re
import sys
import os
from os import path
from gfzreport.sphinxbuild.... | rizac/gfzreport | gfzreport/sphinxbuild/core/extensions/setup.py | Python | gpl-3.0 | 9,566 |
"""
Classes and functions for management of system-level services.
arkOS Core
(c) 2016 CitizenWeb
Written by Jacob Cook
Licensed under GPLv3, see LICENSE.md
"""
import configparser
import os
import time
from dbus.exceptions import DBusException
from arkos import conns, signals
from arkos.utilities import shell
cl... | pomarec/core | arkos/system/services.py | Python | gpl-3.0 | 12,907 |
# Copyright Aaron Smith 2009
#
# This file is part of Gity.
#
# Gity 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.
#
# Gity is dis... | gngrwzrd/gity | python/__old/tags.py | Python | gpl-3.0 | 1,125 |
"""ninetofiver serializers."""
from django.contrib.auth import models as auth_models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django_countries.serializers import CountryFieldMixin
from django.db.models import Q
from rest_framework import serializers... | BartDeCaluwe/925r | ninetofiver/serializers.py | Python | gpl-3.0 | 422 |
#This is a Nipype generator. Warning, here be dragons.
#!/usr/bin/env python
import sys
import nipype
import nipype.pipeline as pe
#Create a workflow to connect all those nodes
analysisflow = nipype.Workflow('MyWorkflow')
analysisflow.connect(tvm_de... | TimVanMourik/OpenFmriAnalysis | GIRAFFE/code/workflow.py | Python | gpl-3.0 | 4,618 |
from datetime import datetime
import requests
from sqlalchemy import Table, Column, PrimaryKeyConstraint, String
from cloudbot import hook
from cloudbot.util import timeformat, web, database
api_url = "http://ws.audioscrobbler.com/2.0/?format=json"
table = Table(
"lastfm",
database.metadata,
Column('ni... | bharaths/CloudBot | plugins/lastfm.py | Python | gpl-3.0 | 14,226 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
from module.plugins.internal.SimpleHoster import seconds_to_midnight
class HighWayMe(MultiHoster):
__name__ = "HighWayMe"
__type__ = "hoster"
__version__ = "0.15"
__status__ = "testin... | jansohn/pyload | module/plugins/hoster/HighWayMe.py | Python | gpl-3.0 | 2,588 |
#!/usr/bin/env python
'''
decode an stm32 ICSR register value
'''
import sys
import optparse
def num(s):
try:
return int(s)
except ValueError:
return int(s, 16)
parser = optparse.OptionParser(__file__)
opts, args = parser.parse_args()
if len(args) == 0:
print(parser.usage)
sys.exi... | squilter/ardupilot | Tools/scripts/decode-ICSR.py | Python | gpl-3.0 | 2,047 |
#!/usr/bin/env python
"""
@author: delagarza
"""
from CTDopts.CTDopts import ModelError
class CLIError(Exception):
# Generic exception to raise and log different fatal errors.
def __init__(self, msg):
super(CLIError).__init__(type(self))
self.msg = "E: %s" % msg
def __str__(self):
... | WorkflowConversion/CTDConverter | ctdconverter/common/exceptions.py | Python | gpl-3.0 | 884 |
import unittest
import tempfile
import os
from mock import Mock, patch
from gui.controller.customizer import Customizer
class TestCustomizer(unittest.TestCase):
def test_init(self):
customizer = Customizer(Mock(), Mock())
self.assertIsInstance(customizer, Customizer)
@patch("gui.controller.... | Radagast-red/golem | tests/gui/controller/test_customizer.py | Python | gpl-3.0 | 1,855 |
#!/usr/bin/env python
'''
OWASP ZSC | ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
shellcode template used : http://shell-storm.org/shellcode/files/shellcode-57.php
'''
from core import stack
from core import template
def run(dirname):
command = 'mkdir %s' %(str(dirname))
return template.sys(stack.... | Yas3r/OWASP-ZSC | lib/generator/linux_x86/dir_create.py | Python | gpl-3.0 | 378 |
# Copyright (C) 2011 Jason Anderson
#
#
# This file is part of PseudoTV.
#
# PseudoTV 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.... | yolanother/script.pseudotv.live | pseudotv.py | Python | gpl-3.0 | 1,802 |
# encoding: utf-8
import ckan.model as model
import ckan.lib.create_test_data as ctd
CreateTestData = ctd.CreateTestData
class FollowerClassesTests(object):
@classmethod
def teardown_class(cls):
model.repo.rebuild_db()
def test_get(self):
following = self.FOLLOWER_CLASS.get(self.followe... | NicoVarg99/daf-recipes | ckan/ckan/ckan/ckan/tests/legacy/models/test_follower.py | Python | gpl-3.0 | 4,502 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2014 Aurélien Gâteau <agateau@kde.org>
# SPDX-FileCopyrightText: 2014 Anke Boersma <demm@kaosx.us>
# SPDX-FileCopyrightText: 2014 Daniel Hillenbrand <codeworkx@bbqlinux.or... | calamares/calamares | src/modules/bootloader/main.py | Python | gpl-3.0 | 28,413 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) 2017 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE... | hkariti/ansible | lib/ansible/modules/network/enos/enos_config.py | Python | gpl-3.0 | 9,930 |
# Copyright 2012 Dave Hughes.
#
# This file is part of dbsuite.
#
# dbsuite 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.
#
# dbsuite... | waveform80/dbsuite | dbsuite/plugins/xml/__init__.py | Python | gpl-3.0 | 683 |
#!/usr/bin/python
import pickle
import numpy as np
import glob
stems = 'weights.forgiving_1_1 weights.forgiving_0_0'.split();
for s in stems:
files = glob.glob('%s*' % s);
a = np.zeros(0);
for f in files:
w = pickle.load(open(f));
a = np.append(a,w);
h = np.histogram(a,range(-20,20,2))... | gnrhxni/CS542 | weighthistograms.py | Python | gpl-3.0 | 380 |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Terminal emulation tools"""
import os
class ANSIEscapeCodeHandler(object):
"""ANSI Escape sequences handler"""
if os.name == 'nt':
#... | jromang/retina-old | distinclude/spyderlib/widgets/sourcecode/terminal.py | Python | gpl-3.0 | 4,314 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | nortikin/sverchok | nodes/list_struct/shuffle.py | Python | gpl-3.0 | 3,555 |
import gflags
import sys
import os
#Go one directory up and append to path to access the deepdna package
#The following statement is equiv to sys.path.append("../")
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__),os.path.pardir)))
FLAGS = gflags.FLAGS
gflags.DEFINE_string('genome_file',''... | LarsDu/DeepNucDecomp | scripts/ExtractGff3.py | Python | gpl-3.0 | 962 |
"""CPStats, a package for collecting and reporting on program statistics.
Overview
========
Statistics about program operation are an invaluable monitoring and debugging
tool. Unfortunately, the gathering and reporting of these critical values is
usually ad-hoc. This package aims to add a centralized place for gather... | VeNoMouS/Sick-Beard | lib/cherrypy/lib/cpstats.py | Python | gpl-3.0 | 22,932 |
from channels import Group as channelsGroup
from channels.sessions import channel_session
import random
from .models import Group as OtreeGroup, Subsession as OtreeSubsession, Constants
import json
import channels
import logging
from otree import constants_internal
import django.test
from otree.common_internal import ... | anthropo-lab/XP | EPHEMER/EDHEC_Project/both_change_group_en/consumers.py | Python | gpl-3.0 | 13,913 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... | NoctuaNivalis/qutebrowser | tests/unit/completion/test_completer.py | Python | gpl-3.0 | 12,192 |
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import mozdevice
import mozlog
import unittest
from sut import MockAgent
class MkDirsTest(unittest.TestCase):
def test_mkdirs(self):
subTests = [{'cmds': [('isdir /mnt/sdcard/baz/boop', 'FALSE'),
... | michath/ConMonkey | testing/mozbase/mozdevice/tests/sut_mkdir.py | Python | mpl-2.0 | 2,854 |
from django.test import RequestFactory
from kuma.users.auth import logout_url
# TODO: Check which new tests are needed.
def test_logout_url(settings):
request = RequestFactory().get("/some/path")
request.session = {}
url = logout_url(request)
assert url == "/"
request = RequestFactory().get("/so... | escattone/kuma | kuma/users/tests/test_auth.py | Python | mpl-2.0 | 720 |
import os
import unittest
from crashsimilarity.cache import TracesCache, DownloaderCache
from tests.test_utils import StackTraceProcessorTest
class CacheTest(unittest.TestCase):
default_cache_file_name = 'default.pickle'
other_file_name = 'other.pickle'
# don't want to use pyfake or mock os.system calls... | KirillTim/crashsimilarity | tests/test_cache.py | Python | mpl-2.0 | 2,929 |
import unittest
import responses
from treeherder.client.thclient import PerfherderClient
class PerfherderClientTest(unittest.TestCase):
@responses.activate
def test_get_performance_signatures(self):
pc = PerfherderClient()
url = pc._get_endpoint_url(pc.PERFORMANCE_SIGNATURES_ENDPOINT, projec... | jmaher/treeherder | tests/client/test_perfherder_client.py | Python | mpl-2.0 | 1,809 |
"""
Test the sync_hubspot management command
"""
from datetime import datetime, timedelta
from io import StringIO
from django.core.management import call_command
from django.core.management.base import CommandError
from factory.django import get_model
from mock import patch
from slumber.exceptions import HttpClientE... | eduNEXT/edunext-ecommerce | ecommerce/core/management/commands/tests/test_sync_hubspot.py | Python | agpl-3.0 | 9,618 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2016 GEM Foundation
#
# OpenQuake 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 Licen... | vup1120/oq-hazardlib | openquake/hazardlib/gsim/zhao_2006_swiss.py | Python | agpl-3.0 | 6,612 |
# -*- coding: UTF-8 -*-
logger.info("Loading 15 objects to table cal_recurrentevent...")
# fields: id, start_date, start_time, end_date, end_time, name, user, every_unit, every, monday, tuesday, wednesday, thursday, friday, saturday, sunday, max_events, event_type, description
loader.save(create_cal_recurrentevent(1,da... | lino-framework/welfare | lino_welfare/projects/gerd/tests/dumps/18.8.0/cal_recurrentevent.py | Python | agpl-3.0 | 3,162 |
"""
Celery tasks for import module.
"""
from __future__ import unicode_literals
import json
import logging
from django.conf import settings
import requests
from statsd.defaults.django import statsd
from lore.celery import async
from learningresources.api import update_xanalytics
from xanalytics import send_request, ... | mitodl/lore | importer/tasks.py | Python | agpl-3.0 | 2,045 |
"""
Views related to the video upload feature
"""
from boto import s3
import csv
from uuid import uuid4
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseNotFound
from django.utils.translation import ugettext as _
from django.vi... | olexiim/edx-platform | cms/djangoapps/contentstore/views/videos.py | Python | agpl-3.0 | 12,554 |
"""
Defines forms for providing validation of embargo admin details.
"""
import ipaddress
from django import forms
from django.utils.translation import ugettext as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
from .models imp... | eduNEXT/edunext-platform | openedx/core/djangoapps/embargo/forms.py | Python | agpl-3.0 | 3,045 |
# This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2008 Jan Decaluwe
#
# The myhdl 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 t... | gw0/myhdl | myhdl/_traceSignals.py | Python | lgpl-2.1 | 7,071 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import pytest
import spack.installer as inst
import spack.repo
import spack.spec
def test_build_request_errors(install_... | iulian787/spack | lib/spack/spack/test/buildrequest.py | Python | lgpl-2.1 | 1,708 |
import sys
from resources.datatables import Options
from resources.datatables import StateStatus
def addPlanetSpawns(core, planet):
stcSvc = core.staticService
objSvc = core.objectService
#junkdealer
stcSvc.spawnObject('junkdealer', 'naboo', long(0), float(-5694), float(6.5), float(4182), float(0.707), float(... | ProjectSWGCore/NGECore2 | scripts/static_spawns/naboo/theed.py | Python | lgpl-3.0 | 1,499 |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
size = 100
xuniform = Uniform(0.9, 1.1)
x = xuniform.getSample(size)
yuniform = Uniform(1.9, 2.1)
y = yuniform.getSample(size)
w = [1.0] * size
f = Numerical... | aurelieladier/openturns | python/test/t_CorrectedLeaveOneOut_std.py | Python | lgpl-3.0 | 733 |
'''
test usage of MTTextInput widget
'''
from init import test, import_pymt_window
def instance():
import_pymt_window()
from pymt import MTTextInput
from pymt import css_add_sheet, css_reload
try:
t = MTTextInput()
return True
except:
return False
def unittest_mttextinput(... | nuigroup/pymt-widgets | tests/test_textinput.py | Python | lgpl-3.0 | 345 |
import pipes
import os
import string
import unittest
from test.support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit
s_command = 'tr... | theheros/kbengine | kbe/res/scripts/common/Lib/test/test_pipes.py | Python | lgpl-3.0 | 7,386 |
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""email package exception classes."""
class MessageError(Exception):
"""Base class for errors in the email package."""
class MessageParseError(MessageError):
"""Base class for message pa... | Orav/kbengine | kbe/src/lib/python/Lib/email/errors.py | Python | lgpl-3.0 | 3,642 |
# Copyright 2015 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, ... | kawasaki2013/getting-started-python | 7-gce/config.py | Python | apache-2.0 | 4,302 |
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
import utils
import json
from cmudbac.settings import *
EXTRACT_WAIT_TIME = 0
def extract_forms(url, follow = "false", cookie_jar = None, filename = "forms.json"):
utils.remove_file(os.path.join(os.path.dirname(__file__), ... | cmu-db/cmdbac | core/drivers/extract/extract.py | Python | apache-2.0 | 3,075 |
#-*- coding: utf-8 -*-
from copy import deepcopy
# CompetitiveDialogueEU(UA)LotBidderResourceTest
def create_tender_bidder_invalid(self):
request_path = '/tenders/{}/bids'.format(self.tender_id)
response = self.app.post_json(request_path, {'data': {'selfEligible': True, 'selfQualified': True,
... | openprocurement/openprocurement.tender.competitivedialogue | openprocurement/tender/competitivedialogue/tests/stage1/lot_blanks.py | Python | apache-2.0 | 44,808 |
"""
Module for all xblock exception classes
"""
from webob import Response
try:
import simplesjson as json # pylint: disable=F0401
except ImportError:
import json
class XBlockNotFoundError(Exception):
"""
Raised to indicate that an XBlock could not be found with the requested usage_id
"""
def... | open-craft/XBlock | xblock/exceptions.py | Python | apache-2.0 | 3,757 |
# Copyright 2013 NEC Corporation
# 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 ... | queria/my-tempest | tempest/api/compute/admin/test_simple_tenant_usage_negative.py | Python | apache-2.0 | 2,656 |
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 l... | eric-stanley/robotframework | src/robot/result/merger.py | Python | apache-2.0 | 2,998 |
# Copyright 2011 Cloudscaling Group, 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 applicabl... | citrix-openstack-build/oslo.log | oslo/log/openstack/common/rpc/matchmaker.py | Python | apache-2.0 | 9,429 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.db.models.fields import BLANK_CHOICE_DASH
from django.test import TestCase
from django.utils.datastructures import MultiValueDict
from django.utils.translation import ugettext_lazy as _
from rest_framework import se... | noslenfa/tdjangorest | uw/lib/python2.7/site-packages/rest_framework/tests/test_serializer.py | Python | apache-2.0 | 65,306 |
#!/usr/bin/env python3
# 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 "Lic... | liquidm/druid | docs/_bin/generate-license-dependency-reports.py | Python | apache-2.0 | 2,924 |
# Copyright 2015 Cloudbase Solutions Srl
# 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 r... | cloudbase/nova-virtualbox | nova/tests/unit/virt/virtualbox/test_vmops.py | Python | apache-2.0 | 23,357 |
# ===============================================================================
# Copyright 2019 ross
#
# 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/LICE... | USGSDenverPychron/pychron | pychron/pyscripts/contexts.py | Python | apache-2.0 | 1,376 |
#!/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... | epssy/hue | desktop/libs/libzookeeper/src/libzookeeper/models.py | Python | apache-2.0 | 1,274 |
import os
import cPickle as pkl
from matplotlib.pyplot import *
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.grid_search import GridSearchCV
from sklearn.decomposition import PCA
from sklearn.feature_extraction.text import C... | tianhuil/isaac-thedataincubator-project | analysis/models.py | Python | apache-2.0 | 3,132 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
#This works just like /bin/false, but Windows users might not have that
sy... | foursquare/pants | tests/python/pants_test/backend/jvm/tasks/false.py | Python | apache-2.0 | 330 |
import logging, couchdb, oauth2, json, sys
from decorator import decorator
from pylons import config, request as r, response as res, session
from pylons.controllers.util import abort
from functools import wraps
log = logging.getLogger(__name__)
appConfig = config['app_conf']
class Error(RuntimeError):
"""Generic... | jimklo/LearningRegistry | LR/lr/lib/oauth.py | Python | apache-2.0 | 6,907 |
# Задача 2. Вариант 1.
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Еврипид. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Anisimova M.L.
# 02.09.2016
print("Жизнь наша есть борьба.")
print("\t\t Еврипид")
inpu... | Mariaanisimova/pythonintask | BIZa/2015/Anisimova_M_L/task_2_1.py | Python | apache-2.0 | 574 |
"""add slug to risk_assessment
Revision ID: 5b29b4becf8
Revises: cd51533c624
Create Date: 2015-07-16 19:24:42.473531
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5b29b4becf8'
down_revision = 'cd51533c624'
_table_name = "risk_assessments"
_column_name = ... | hyperNURb/ggrc-core | src/ggrc_risk_assessments/migrations/versions/20150716192442_5b29b4becf8_add_slug_to_risk_assessment.py | Python | apache-2.0 | 1,107 |
# 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... | nanditav/15712-TensorFlow | tensorflow/python/kernel_tests/resource_variable_ops_test.py | Python | apache-2.0 | 3,885 |
# 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 u... | tqchen/tvm | vta/tests/python/integration/test_benchmark_topi_conv2d.py | Python | apache-2.0 | 11,274 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import copy
import os
import sys
from argparse import Namespace
from mock import patch
from six import StringIO, text_type
from tzlocal import get_localzone
import six
from djangocms_installer import config
from djangocm... | Venturi/oldcms | env/lib/python2.7/site-packages/tests/config.py | Python | apache-2.0 | 31,993 |
"""The Legrand Home+ Control integration."""
import asyncio
from datetime import timedelta
import logging
import async_timeout
from homepluscontrol.homeplusapi import HomePlusControlApiError
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_CLIENT_ID, C... | w1ll1am23/home-assistant | homeassistant/components/home_plus_control/__init__.py | Python | apache-2.0 | 5,808 |
from itertools import product
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.common.exceptions as com
clickhouse_driver = pytest.importorskip("clickhouse_driver")
@pytest.fixture(scope='module')
def diamonds(con):
return con.table('diamonds')
@pytest.fixture(scope='modu... | cpcloud/ibis | ibis/backends/clickhouse/tests/test_select.py | Python | apache-2.0 | 13,276 |
'''
Test about monitor trigger on vm memory free ratio in five minutes
@author: Songtao,Haochen
'''
import os
import test_stub
import random
import time
import zstacklib.utils.ssh as ssh
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.resource_operations as res_ops
i... | zstackorg/zstack-woodpecker | integrationtest/vm/monitor/5min_alert_vm_mem_free.py | Python | apache-2.0 | 2,881 |
from a10sdk.common.A10BaseClass import A10BaseClass
class Tcp(A10BaseClass):
"""Class Description::
L4 TCP switch config.
Class tcp supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param initial_window_size: {"descriptio... | amwelch/a10sdk-python | a10sdk/core/slb/slb_template_tcp.py | Python | apache-2.0 | 3,902 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.pant... | TansyArron/pants | contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch_integration.py | Python | apache-2.0 | 611 |
# 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/training/optimizer_test.py | Python | apache-2.0 | 12,617 |
from setuptools import setup, Extension
from os.path import join as pjoin
from os.path import dirname
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in bel... | pombredanne/or-tools | tools/setup_py3.py | Python | apache-2.0 | 2,291 |
# 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 t... | ArchiFleKs/magnum | magnum/conductor/handlers/federation_conductor.py | Python | apache-2.0 | 1,155 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for triggers."""
from grr.lib import flags
from grr.lib import test_lib
from grr.lib.checks import checks
from grr.lib.checks import triggers
target_1 = checks.Target({})
target_2 = checks.Target(os=["TermOS"],
cpe=["cpe:/o:cyberdyne:term... | ksmaheshkumar/grr | lib/checks/triggers_test.py | Python | apache-2.0 | 3,871 |
# Copyright 2016 Quantopian, 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... | wilsonkichoi/zipline | zipline/data/minute_bars.py | Python | apache-2.0 | 33,297 |