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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
import pygame
import sys
from pgu import gui
import threading
from time import sleep
import argparse
from engine import SimulationEngine
from UI import game, endgame, start_screen
from global_config import config
setup_finished = False
#to avoid screen flickering
def enable_vsync():
if s... | ianfhunter/TeamCrab | src/SESimulator.py | Python | mit | 2,738 |
# CONST
LONG_STANDARD_SIZE = 4
############################
# VARIABLES #
############################
APP_NAME = "Brass Golem"
APP_VERSION = "0.6.0"
PRIVATE_KEY = "golem_private_key.peb"
PUBLIC_KEY = "golem_public_key.pubkey"
DEFAULT_PROC_FILE = "node_processes.ctl"
MAX_PROC_FILE_SIZE = 1024 * 1024
##... | scorpilix/Golemtest | golem/core/variables.py | Python | gpl-3.0 | 871 |
# -*- coding: utf-8 -*-
class Log:
def __init__(self):
Log.LogFile = open("Log.txt","a+")
@staticmethod
def Record(content, level = 0):
Log.LogFile = open("Log.txt","a+")
Log.LogFile.write(content+"\n")
Log.LogFile.close() | after1990s/little_utils | EveRobot/Log.py | Python | apache-2.0 | 269 |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | gregbdunn/aws-ec2rescue-linux | lib/botocore/monitoring.py | Python | apache-2.0 | 20,586 |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the L... | pypa/twine | tests/test_main.py | Python | apache-2.0 | 2,736 |
import collections
import inspect
class exportRPC(object):
"""
Decorator to indicate a method should be exported via RPC.
To export with the method's name, use as @exportRPC().
Optionally, provde an argument to indicate the name to export as:
@exportRPC("foo").
"""
def __init__(self, name=... | joehillen/txjason | txjason/handler.py | Python | mit | 1,847 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ScheduleNewsletterDelivery
# Schedule a delivery time for an existing Newsletter.
#
# Python version 2.6
#
###############################################################################
from temboo.core.choreo... | egetzel/wecrow | truehand2014/temboo/Library/SendGrid/NewsletterAPI/Schedule/ScheduleNewsletterDelivery.py | Python | apache-2.0 | 3,972 |
from gi.repository import GLib
import time, thread
from gettext import gettext as _
from xl import player
from xl.plugins import PluginsManager
import acprefs
from xl import settings
class VolumeControl:
def __init__(self):
self.thread = thread
def print_debug( self ):
print(self.min_volume... | Zarokka/exaile | plugins/alarmclock/__init__.py | Python | gpl-2.0 | 4,395 |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | sadanandb/pmt | src/pyasm/biz/code_naming.py | Python | epl-1.0 | 1,703 |
"""Wrapper class for WPWithin Service."""
import os
import time
import sys
import threading
from pkg_resources import resource_filename
import thriftpy
from thriftpy.rpc import make_client
from thriftpy.protocol.binary import TBinaryProtocolFactory
from thriftpy.transport.buffered import TBufferedTransportFactory
fro... | WPTechInnovation/worldpay-within-sdk | wrappers/python/wpwithin_python/wpwithin_python/wpwithin.py | Python | mit | 10,244 |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
class AAFError(Exception):
pass
class AAFAttachError(AAFError):
pass
class AAFPropertyError(AAFError):
pass
class CompoundFileBinaryError(AAFError):
pass
| markreidvfx/pyaaf2 | aaf2/exceptions.py | Python | mit | 282 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms
from djang... | jorge-marques/shoop | shoop/discount_pricing/admin_form_part.py | Python | agpl-3.0 | 2,820 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2015-2019 by Inteos Sp. z o.o.
# All rights reserved. See LICENSE file for details.
#
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.defined, name='storagedefined'),
url(r'^info/$', views.info, name='storageinfo_rel'),
url(... | inteos/IBAdmin | storages/urls.py | Python | agpl-3.0 | 4,406 |
import numpy as np
import pandas as pd
from .common import _contains_datetime_like_objects, is_np_datetime_like
from .pycompat import dask_array_type
def _season_from_months(months):
"""Compute season (DJF, MAM, JJA, SON) from month ordinal
"""
# TODO: Move "season" accessor upstream into pandas
seas... | jhamman/xarray | xarray/core/accessor_dt.py | Python | apache-2.0 | 10,878 |
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# 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 la... | adityacs/ansible | lib/ansible/modules/cloud/docker/docker_image.py | Python | gpl-3.0 | 21,881 |
import numpy as np
from scipy.ndimage import map_coordinates
from skimage.transform._warps import _stackcopy
from skimage.transform import (warp, warp_coords, rotate, resize, rescale,
AffineTransform,
ProjectiveTransform,
Simi... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/skimage/transform/tests/test_warps.py | Python | gpl-3.0 | 15,627 |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | adviti/melange | app/soc/modules/gsoc/tasks/slot_assignment.py | Python | apache-2.0 | 4,317 |
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU Lesser General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (LGPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# includin... | jortel/gofer | test/unit/rmi/model/test_parent.py | Python | lgpl-2.1 | 4,318 |
# -*- coding: utf-8 -*-
from pymiles.sqlite.db_create import createmeta
if __name__ == '__main__':
createmeta()
| tedlaz/pyted | pykoinoxrista/koinoxrista/create_meta_db.py | Python | gpl-3.0 | 117 |
# Author: Thomas Dimson [tdimson@gmail.com]
# Date: January 2011
# For distribution details, see LICENSE
"""Module containing the main superclass for all models."""
import os
import sys
import uuid
import random
import string
import logging
import subprocess
from email_manager import Email
import shutil
from config ... | cosbynator/NPSGD | npsgd/model_task.py | Python | bsd-3-clause | 6,866 |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | TribeMedia/synapse | synapse/rest/client/v1/admin.py | Python | apache-2.0 | 4,639 |
# -*- coding: utf-8 -*-
"""
Tests for the student training step in the Open Assessment XBlock.
"""
import datetime
import ddt
import json
import pprint
from mock import Mock, patch
import pytz
from django.db import DatabaseError
from openassessment.assessment.models import StudentTrainingWorkflow
from openassessment.wo... | vasyarv/edx-ora2 | openassessment/xblock/test/test_student_training.py | Python | agpl-3.0 | 14,497 |
from __future__ import unicode_literals
from daydreamer.views.core import http
from . import base
class HttpMethodAllowTestCase(base.TestCase):
"""
Tests for the HttpMethodAllow view base class.
"""
view_classes = http.HttpMethodAllow
def test_included_present_allowed(self):
""... | skibblenybbles/django-daydreamer | daydreamer/tests/views/core/http/tests.py | Python | mit | 2,924 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import json
import pytest
from flexget.api.app import base_message
from flexget.api.core.database import ObjectsContainer as OC
class TestDatabaseAPI(object):
confi... | gazpachoking/Flexget | flexget/tests/api_tests/test_database_api.py | Python | mit | 1,464 |
# -*- coding: utf-8 -*-
#
# Copyright 2007-2011 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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
# ... | phlax/translate | translate/lang/data.py | Python | gpl-2.0 | 21,385 |
import re
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
from flask_babel import gettext
from mpl_toolkits.axes_grid1 import make_axes_locatable
# Silence a FutureWarning
from pandas.plotting import register_matplotlib_converters
import plotting.colormap as colormap
import ... | DFO-Ocean-Navigator/Ocean-Data-Map-Project | plotting/hovmoller.py | Python | gpl-3.0 | 11,496 |
import sys
import time
import ftplib
import logging
import csv
from functools import wraps
import yaml
import requests
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
"""Retry calling the decorated function using an exponential backoff.
http://www.saltycrane.com/blog/2009/11/trying-ou... | pacificclimate/crmprtd | crmprtd/download.py | Python | gpl-3.0 | 5,068 |
# -*- coding: utf-8 -*-
# account.py
# Copyright (C) 2013-2015 LEAP
#
# 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
# (at your option) any later version.
#
... | kalikaneko/bitmask-dev | src/leap/bitmask/mail/imap/account.py | Python | gpl-3.0 | 15,338 |
##########################################################################
#
# Copyright (c) 2011-2012, 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:
#
# * Redi... | lucienfostier/gaffer | python/GafferUI/ProgressBar.py | Python | bsd-3-clause | 2,615 |
import sys
import os
import os.path
import logging
import time
import ConfigParser
import subprocess
from vimpdb import bbbconfig
from vimpdb import errors
RCNAME = os.path.expanduser('~/.vimpdbrc')
CLIENT = 'CLIENT'
SERVER = 'SERVER'
logger = logging.getLogger('vimpdb')
logger.setLevel(logging.DEBUG)
handler = lo... | gotcha/vimpdb | src/vimpdb/config.py | Python | mit | 13,011 |
# -*- coding: utf-8 -*-
import functools
import hashlib
import json
import os
import tempfile
import unittest
import uuid
import zipfile
from contextlib import nested
from datetime import datetime, timedelta
from decimal import Decimal
from django import forms
from django.conf import settings
from django.contrib.auth.... | tsl143/zamboni | mkt/webapps/tests/test_models.py | Python | bsd-3-clause | 97,405 |
# -*- coding: utf-8 -*-
"""
Display X selection.
Configuration parameters:
cache_timeout: refresh interval for this module (default 0.5)
command: the clipboard command to run (default 'xsel -o')
format: display format for this module (default '{selection}')
max_size: strip the selection to this value (... | docwalter/py3status | py3status/modules/xsel.py | Python | bsd-3-clause | 1,642 |
"""The tests for the hassio component."""
import os
import pytest
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components import frontend
from homeassistant.components.hassio import STORAGE_KEY
from homeassistant.setup import async_setup_component
from tests.async_mock import patch
MOCK_EN... | titilambert/home-assistant | tests/components/hassio/test_init.py | Python | apache-2.0 | 12,652 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import add_days, getdate, cint, cstr
from frappe import throw, _
from erpnext.utilities.transaction_base import Transa... | gsnbng/erpnext | erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py | Python | agpl-3.0 | 9,346 |
#!/usr/bin/env python
import sys
from pwn import *
####################################################
##################### EXPLOIT ######################
####################################################
#CHANGE THESE PARAMS
FILE = './pwn1'
HOST = 'problems2.2016q1.sctf.io'
PORT = '1337'
GET_FLAG_MEM_ADDR = ... | b0tchsec/CTF-Fanny-Pack | solutions/sctf_2016_q1/pwn1/pwner.py | Python | gpl-3.0 | 1,758 |
from common.models import Tag
from .client import SalesforceClient
import json
import requests
import threading
''' Contributor model maps to the Contact object in Salesforce '''
client = SalesforceClient()
def run(request):
response = SalesforceClient().send(request)
def save(contributor: object):
data = {... | DemocracyLab/CivicTechExchange | salesforce/contact.py | Python | mit | 1,381 |
# -*- coding: utf-8 -*-
""" Sahana Eden Organisation Model
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
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 ... | bhavin04890/finaldashboard | modules/eden/org.py | Python | mit | 125,149 |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Module for base classes"""
import re
from selenium import webdriver
from selenium.webdriver.common import keys
from selenium.webdriver.common.by import By
from lib import constants
from lib import excep... | selahssea/ggrc-core | test/selenium/src/lib/base.py | Python | apache-2.0 | 18,031 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2012 Dennis Gosnell
#
# 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
# (at your option) any later version.
#
# This... | cdepillabout/dict-scrape | dictscrape/example_sentence.py | Python | gpl-3.0 | 3,094 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | ZenHarbinger/snapcraft | snapcraft/internal/project_loader.py | Python | gpl-3.0 | 15,783 |
from django.contrib import admin
from .models import Photo
from .models import Slide
class PhotoAdmin(admin.ModelAdmin):
class Meta:
model = Photo
class SlideAdmin(admin.ModelAdmin):
class Meta:
model = Slide
admin.site.register(Photo, PhotoAdmin)
admin.site.register(Slide, SlideAdmin) | Batyar/makeup | makeup/admin.py | Python | mit | 313 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/is_reachability/neighbors/neighbors_/error_metric/__init__.py | Python | apache-2.0 | 12,138 |
'''
Solve a bunch of problems. Make em functions, might use it later.
'''
def diff_seq(seq):
'''1) Write a Python function that takes a sequence of numbers
and determines if all the numbers are different from each other.
if so, return "all are different"
else, return "FAKE NEWS"
'''
for i i... | Am3ra/CS | CS101/Python/problems.py | Python | mit | 638 |
#!/usr/bin/python
'''Launches cassandra-stress instances in Marathon.'''
import json
import logging
import pprint
import random
import string
import sys
import urllib
# non-stdlib libs:
try:
import click
import requests
from requests.exceptions import HTTPError
except ImportError:
print("Failed to lo... | adobe-mds/dcos-cassandra-service | cassandra-test-client/launcher.py | Python | apache-2.0 | 8,836 |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Document Server.
# Copyright (C) 2016 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 opti... | drjova/cds-demosite | cds/modules/deposit/loaders/__init__.py | Python | gpl-2.0 | 1,217 |
# 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... | mufaddalq/cloudstack-datera-driver | python/lib/cloudutils/globalEnv.py | Python | apache-2.0 | 1,605 |
#! /usr/bin/env python
import ConfigParser
import csv
import datetime as dt
import dnsdb_query
import json
import pygeoip
import re
import sys
import os
from netaddr import IPAddress, IPRange, IPSet
from sortedcontainers import SortedDict
from logger import get_logger
logger = get_logger('winnower')
# from http://e... | jfalken/combine | winnower.py | Python | gpl-3.0 | 7,297 |
import unittest
import os
import pandas as pd
from oplus.configuration import CONF
from oplus import WeatherData
from tests.util import assert_epw_equal, iter_eplus_versions
from pandas.util.testing import assert_frame_equal
class EPlusWeatherData(unittest.TestCase):
# todo: make better checks
def test_wea... | Openergy/oplus | tests/test_weather_data.py | Python | mpl-2.0 | 1,719 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\christian\Documents\GitHub\triscan\gui\about.ui'
#
# Created: Mon Mar 10 21:26:59 2014
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fro... | leramleram/triscan | src/about_ui.py | Python | gpl-2.0 | 2,090 |
from PythonQt import QtGui, Qt
import KnossosModule
import numpy, traceback, re, time
from scipy import ndimage
from skimage.morphology import watershed
class watershedSplitterHybridModeWidget(QtGui.QWidget):
SUBOBJECT_TABLE_GROUP_STR = "Subobject Table"
SUBOBJECT_ID_COLUMN_STR = "ID"
SUBOBJECT_COORD_COLUM... | knossos-project/knossos | resources/plugins/startup/watershedSplitterHybridModeWidget.py | Python | gpl-2.0 | 20,602 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-03 08:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("billing", "0010_invoice_amount")]
operations = [
migrations.AddField(
model... | dontnod/weblate | weblate/billing/migrations/0011_billing_grace_period.py | Python | gpl-3.0 | 508 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import djangobmf.fields.file
class Migration(migrations.Migration):
dependencies = [
('djangobmf', '0007_update_renderer'),
]
operations = [
migrations.AlterField(
model_... | django-bmf/django-bmf | djangobmf/migrations/0008_renderer_filefields.py | Python | bsd-3-clause | 805 |
# Copyright 2012, Julius Seporaitis
#
# 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 wr... | henrysher/yum-s3-tools | test/tests.py | Python | apache-2.0 | 1,566 |
import YtelAPI
import YtelConstant
message360Credential = YtelAPI.Message360API(auth_id=YtelConstant.Constant.ACCOUNT_SID,auth_token=YtelConstant.Constant.AUTH_TOKEN)
params = {
'smssid':'XXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'#Message SID
}
response = message360Credential.view_sms(params)
print response
| Ytel-Inc/Message360-Python-Helper-Library | SMS/view_sms.py | Python | gpl-2.0 | 320 |
from unittest.mock import Mock
from ipv8.messaging.anonymization.tunnel import CIRCUIT_STATE_EXTENDING, CIRCUIT_STATE_READY, CIRCUIT_TYPE_DATA
from ipv8.util import succeed
from tribler_core.modules.tunnel.community.dispatcher import TunnelDispatcher
from tribler_core.tests.tools.base_test import MockObject
from trib... | hbiyik/tribler | src/tribler-core/tribler_core/modules/tunnel/tests/test_dispatcher.py | Python | lgpl-3.0 | 4,771 |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
def google_analytics(request):
"""
Add the Google Analytics tracking ID and domain to the context for use when
rendering tracking code.
"""
ga_id = None
if not settings.DEBUG:
if get_current_si... | Code4SA/municipal-data | municipal_finance/context_processors.py | Python | mit | 869 |
from datetime import datetime
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from questions.models import Question
from voting.models import Vote
class AnswerManager(models.Manag... | alon/polinax | projects/polinax/apps/answers/models.py | Python | gpl-2.0 | 2,027 |
from django.contrib.sitemaps import Sitemap
from bambu_blog.models import Post
class BlogSitemap(Sitemap):
changefreq = 'daily'
priority = 0.5
def items(self):
return Post.objects.live()
def lastmod(self, obj):
return obj.date | iamsteadman/bambu-blog | bambu_blog/sitemaps.py | Python | apache-2.0 | 269 |
import pickle
import os
import sys
import types
import cert
import user
import tools.openssl as openssl
import tools.log as log
import tools.configuration as configuration
import tools.misc as tools
"""Organisation mode, contains Organisation and Organisation unit classes"""
class OrganisationError(Exception):
p... | RemiBauzac/easyPKI | backend/easypki/organisation.py | Python | mpl-2.0 | 3,836 |
import os
import unittest
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.optaa_dj.cspp.optaa_dj_cspp_recovered_driver import parse
from mi.dataset.driver.optaa_dj.cspp.resource import RESOURCE_PATH
__author__ = 'Joe Padula'
log = get_logger()
clas... | janeen666/mi-instrument | mi/dataset/driver/optaa_dj/cspp/test/test_optaa_dj_cspp_recovered_driver.py | Python | bsd-2-clause | 895 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... | trac-ja/trac-ja | tracopt/perm/config_perm_provider.py | Python | bsd-3-clause | 2,233 |
#!/usr/bin/python
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--source", help="Data in a csv file arranged in rows of duplicates with the standards first")
args = parser.parse_args()
if args.source:
print "Hello!"
| exark/welchs | welchs.py | Python | gpl-2.0 | 246 |
"""Add plural base string.
Revision ID: 71f4f6391672
Revises: 4ce05ae50d01
Create Date: 2017-05-12 09:14:24.296708
"""
# revision identifiers, used by Alembic.
revision = '71f4f6391672'
down_revision = '4ce05ae50d01'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade... | socialwifi/dila | dila/data/alembic/versions/71f4f6391672_add_plural_base_string.py | Python | bsd-3-clause | 665 |
from importlib import import_module
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import no_style
from django.core.management.sql import emit_post_migrate_signal, sql_flush
from django.db import DEFAULT_DB_ALIAS, connections, transactio... | camilonova/django | django/core/management/commands/flush.py | Python | bsd-3-clause | 3,771 |
"""
Support for manual alarms.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.manual/
"""
import copy
import datetime
import logging
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
import homeas... | ewandor/home-assistant | homeassistant/components/alarm_control_panel/manual.py | Python | apache-2.0 | 10,887 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
| Nerucius/tutor-ecosystem | endpoint/views.py | Python | mit | 105 |
#!/usr/bin/env python
import os
import rospy
import rospkg
import actionlib
from python_qt_binding import loadUi
from python_qt_binding.QtCore import Signal
from python_qt_binding.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QPushButton, QComboBox
from vigir_footstep_planning_msgs.footstep_planning_msgs impo... | team-vigir/vigir_footstep_planning_basics | vigir_footstep_planning_lib/src/vigir_footstep_planning_lib/execute_step_plan_widget.py | Python | gpl-3.0 | 8,533 |
#!/usr/bin/python
# -*- coding: UTF-8
# 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/. */
# Authors:
# Michael Berg-Mohnicke <michael.berg@zalf.de>
#
# Maintainers:
# C... | zalf-lsa/monica | installer/Hohenfinow2/python3/run-consumer.py | Python | mpl-2.0 | 4,104 |
__author__ = 'perkins'
from zope.interface import implements
from scheme.macro import Macro
from scheme.Globals import Globals
from utils import copy_with_quote
class quote(object):
implements(Macro)
def __init__(self):
pass
def __call__(self, processer, params):
if len(params) > 1:
... | lperkin1/schemepy | scheme/quote.py | Python | lgpl-2.1 | 518 |
import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="visible", parent_name="cone", **kwargs):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/cone/_visible.py | Python | mit | 467 |
# 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 eve... | anish/buildbot | master/buildbot/test/unit/test_steps_source_cvs.py | Python | gpl-2.0 | 61,382 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | jrha/aquilon | lib/python2.6/aquilon/worker/commands/show_vlan_all.py | Python | apache-2.0 | 1,057 |
# HEAP SORT
# WORKS
class Heap:
count = 0
def __init__(self, a, typ):
self.elements = [0 for k in range(len(a)+1)]
self.typ = typ
for j in a:
self.add(j)
def add(self, element):
self.count += 1
insert_position = self.count
while insert_positio... | OpenWeavers/OpenAlgorithm | Python/HeapSort2.py | Python | gpl-3.0 | 2,119 |
from setuptools import setup
import os
import re
def read(*names):
values = dict()
for name in names:
filename = name + '.rst'
if os.path.isfile(filename):
fd = open(filename)
value = fd.read()
fd.close()
else:
value = ''
values[na... | elapouya/python-nagios-helpers | setup.py | Python | lgpl-2.1 | 1,747 |
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from toontown.ai import DistributedPhaseEventMgr
class DistributedHydrantZeroMgr(DistributedPhaseEventMgr.DistributedPhaseEventMgr):
neverDisable = 1
notify = DirectNotifyGlobal.directNotify.newCategory('Distrib... | silly-wacky-3-town-toon/SOURCE-COD | toontown/ai/DistributedHydrantZeroMgr.py | Python | apache-2.0 | 1,262 |
"""
DemoFour GameState
"""
import RoguePy.State.GameState as GameState
from RoguePy.Input import Keys
from RoguePy.UI import Colors
from RoguePy.UI import Elements
class Demo4(GameState):
def __init__(self,name, manager):
super(self.__class__, self).__init__(name, manager)
self._initPlayer()
def before... | v4nz666/7drl2017 | RoguePy/Demo/GameStates/Demo4.py | Python | gpl-3.0 | 3,465 |
from django.contrib import admin
from .models import Crash
admin.site.register(Crash)
| hax0rs/SafeRoad | api/sr_api/sr_data/admin.py | Python | gpl-2.0 | 87 |
# -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'
| cherry-hyx/gxs | src/github.com/open-falcon/portal/frame/api/__init__.py | Python | apache-2.0 | 48 |
import glob
import os
import numpy as np
from chainer.dataset import download
from chainercv.chainer_experimental.datasets.sliceable import GetterDataset
from chainercv.datasets.cityscapes.cityscapes_utils import cityscapes_labels
from chainercv.utils import read_image
from chainercv.utils import read_label
class ... | yuyu2172/chainercv | chainercv/datasets/cityscapes/cityscapes_semantic_segmentation_dataset.py | Python | mit | 4,521 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests lesson 04 task 01."""
# Import Python libs
import unittest
import mock
import random
class Lesson04Task01TestCase(unittest.TestCase):
"""
Test cases for lesson 04 task 01.
"""
def test_color_choices(self):
"""
Tests that the us... | eliz79/is210-week-04-synthesizing | tests/test_task_01.py | Python | mpl-2.0 | 1,566 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
import caching.base
class Migration(migrations.Migration):
dependencies = [
('events', '0001_initial'),
migrations.swappable_... | flamingspaz/remo | remo/reports/migrations/0001_initial.py | Python | bsd-3-clause | 4,125 |
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | noironetworks/neutron | neutron/db/l3_hascheduler_db.py | Python | apache-2.0 | 3,074 |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | dbckz/ansible | lib/ansible/modules/network/nxos/nxos_snmp_community.py | Python | gpl-3.0 | 8,286 |
from flexget import plugin
from flexget.entry import Entry
class OneEntryInput:
"""Fake input plugin, fails if second entry is grabbed."""
def on_task_input(self, task, config):
yield Entry(title='Test', url='http://test.com')
raise Exception('Should not have tried to get second entry.')
pl... | Flexget/Flexget | flexget/tests/test_limit.py | Python | mit | 1,046 |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from wagtail.search.signal_handlers import register_signal_handlers
class WagtailSearchAppConfig(AppConfig):
name = 'wagtail.search'
label = 'wagtailsearch'
verbose_name = _("Wagtail search")
def ready(self):
... | mikedingjan/wagtail | wagtail/search/apps.py | Python | bsd-3-clause | 354 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ardicfilter.py
# Used to create the database from another which contains only the words vocalised and not vocalized
#
# Copyright 2015 Abdelkrime Aries <kariminfo0@gmail.com>
#
# ---- AUTHORS ----
# 2015 Abdelkrime Aries <kariminfo0@gmail.com>
#
# Licensed... | kariminf/ArArud | aruudy/tools/ardicfilter.py | Python | apache-2.0 | 2,454 |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2021 BigML
#
# 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 ... | jaor/python | bigml/tests/test_09_ensemble_prediction.py | Python | apache-2.0 | 4,365 |
#!/usr/bin/env python
from tools.load import LoadMatrix
import numpy as np
lm=LoadMatrix()
traindat = lm.load_dna('../data/fm_train_dna.dat')
testdat = lm.load_dna('../data/fm_test_dna.dat')
label_traindat = lm.load_labels('../data/label_train_dna.dat')
fm_hmm_pos=[traindat[i] for i in np.where([label_traindat==1])[1... | lambday/shogun | examples/undocumented/python/kernel_top.py | Python | bsd-3-clause | 2,523 |
import tensorflow as tf
sess = tf.Session()
W = tf.Variable([.3], tf.float32)
b = tf.Variable([-.3], tf.float32)
x = tf.placeholder(tf.float32)
linear_model = W * x + b
init = tf.global_variables_initializer()
sess.run(init)
# print (sess.run(linear_model, {x: [9, 2, 4, 8]}))
y = tf.placeholder(tf.float32)
squared... | menghsuann/Tensorflow-Study-Group | build_network/training.py | Python | gpl-3.0 | 743 |
"""This module defines a widget used to display a graphical overview of the
scene graph using the tkinter GUI system.
Requires Pmw."""
__all__ = ['SceneGraphExplorer', 'SceneGraphExplorerItem', 'explore']
from direct.showbase.DirectObject import DirectObject
from direct.showbase.TkGlobal import *
from .Tree import *... | chandler14362/panda3d | direct/src/tkwidgets/SceneGraphExplorer.py | Python | bsd-3-clause | 6,784 |
"""The tests for Vacuum device triggers."""
import pytest
from homeassistant.components.vacuum import DOMAIN, STATE_DOCKED, STATE_CLEANING
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation
from homeassistant.helpers import device_registry
from tests.common ... | joopert/home-assistant | tests/components/vacuum/test_device_trigger.py | Python | apache-2.0 | 4,385 |
# coding=utf-8
# Copyright © 2018 Computational Molecular Biology Group,
# Freie Universität Berlin (GER)
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must ret... | readdy/readdy | wrappers/python/src/python/readdy/examples/min-e_min-d.py | Python | bsd-3-clause | 16,169 |
"""Test date/time type.
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
from __future__ import division
import sys
import pickle
import cPickle
import unittest
from test import test_support
from datetime import MINYEAR, MAXYEAR
from datetime import timedelta
from datetime import tzinf... | Jeff-Tian/mybnb | Python27/Lib/test/test_datetime.py | Python | apache-2.0 | 138,066 |
# Copyright 2017, David Wilson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... | edwinsteele/biblebox-pi | ansible/plugins/mitogen-0.2.2/ansible_mitogen/plugins/strategy/mitogen_free.py | Python | apache-2.0 | 2,761 |
import os
import sys
os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))
l1 = ['Ànec', 'Barca', 'Coala', 'Calçat', 'Dofí', 'Elefant', 'Formiga', 'Gat', 'Hipopotam', 'Iglú', 'Joguina', 'Kiwi',
'Lleó', 'Mússol', 'Nit', 'Oceà', 'Poma', 'Quadern', 'Ratolí', 'Síndria', 'Tomàquet', 'Ull', 'Violí', 'Windsurf',
... | imiolek-ireneusz/pysiogame | i18n/custom/fmt.py | Python | gpl-3.0 | 458 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-retail | samples/generated_samples/retail_v2_generated_product_service_update_product_sync.py | Python | apache-2.0 | 1,504 |
#coding: utf-8
import unittest
from django.test import RequestFactory
from mongonaut.sites import BaseMongoAdmin
from common.utils import DummyUser
class BaseMongoAdminTests(unittest.TestCase):
def setUp(self):
self.req = RequestFactory().get('/')
def testHasViewPermissions(self):
self.req... | jazzband/django-mongonaut | tests/sites_tests.py | Python | mit | 3,047 |
"""
NLTK DRT module extended with presuppositions
"""
__author__ = "Alex Kislev, Emma Li, Peter Makarov"
__version__ = "1.0"
__date__ = "Tue, 24 Aug 2010"
import random
from test import BK
from util import Tester, UngrammaticalException
from temporaldrt import DrtParser
from inference import AdmissibilityError, Con... | napsternxg/nltk-drt | nltk-drt/src/curt.py | Python | apache-2.0 | 5,028 |
# This program first converts birthday wish, which is string to ascii and then that ascii to binary
print('Enter the birthday wish you want to encode:')
wish=input()
print('Enter 1 to encode to ASCII and 2 to encode to binary:')
decision=int(input())
wish_list=list(wish) #breaks the birthday string into list of char... | imox2/Binary_Birthday | birthday_wish.py | Python | mit | 1,161 |
# Authors:
# Rob Crittenden <rcritten@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | tbabej/freeipa | ipatests/test_xmlrpc/test_old_permission_plugin.py | Python | gpl-3.0 | 41,582 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.