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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# streamondemand - XBMC Plugin
# Conector para tutele
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... | Zanzibar82/streamondemand.test | servers_sports/tutele.py | Python | gpl-3.0 | 3,586 |
import logging
import ssl
import sys
import threading
from typing import List
import websocket
from homematicip.base.enums import *
from homematicip.base.helpers import bytes2str
from homematicip.class_maps import *
from homematicip.connection import Connection
from homematicip.device import *
from homem... | coreGreenberet/homematicip-rest-api | homematicip/home.py | Python | gpl-3.0 | 33,503 |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from consultas.views import *
urlpatterns = [
url(r'confirmar/crear/$',login_required(ConfirmacionesCrearView.as_view()), name="confirmaciones_crear"),
url(r'confirmar/lista/$',(ConfirmacionListView.as_view()), name="co... | Etxea/gestioneide | consultas/urls.py | Python | gpl-3.0 | 1,772 |
#!/usr/bin/python
version=1.0
# orangen.py: simplified default pin generator for livebox 2.1 and livebox next
# usage: python orangen.py <4 last digits from wan mac> <4 last digits from serial>
# It will just return the PIN
# Algorithm and vulnerability by wifi-libre. For more details check https://www.wifi-libre.com... | kcdtv/nmk | orangen.py | Python | gpl-3.0 | 1,843 |
notes = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]
def chords(root):
n = notes + notes
i = n.index(root)
return [[n[i], n[i + 4], n[i + 7]], [n[i], n[i + 3], n[i + 7]]]
| VladKha/CodeWars | 7 kyu/Chords/solve.py | Python | gpl-3.0 | 206 |
from opc.colormap import Colormap
from opc.colors import BLACK, BLUE, YELLOW, RED, GREEN
from .baseclasses.diamondsquare import DiamondSquare
class Art(DiamondSquare):
description = "Thin plasma using DiamondSquare and colormap rotation"
def __init__(self, matrix, config):
super(Art, self).__init__... | ak15199/rop | art/plasma2.py | Python | gpl-3.0 | 861 |
from django.conf.urls.defaults import *
urlpatterns = patterns('imaging.views',
(r'^iframe_form/$', 'iframe_form'),
(r'^ajax_delete/$', 'ajax_image_removal'),
)
| pielgrzym/django-minishop | imaging/urls.py | Python | gpl-3.0 | 174 |
from django.apps import AppConfig
class ProblemsAppConfig(AppConfig):
name = "oioioi.problems"
| sio2project/oioioi | oioioi/problems/apps.py | Python | gpl-3.0 | 101 |
#-*- coding:utf-8 -*-
#
# nngt_graph.py
#
# This file is part of the NNGT project to generate and analyze
# neuronal networks and their activity.
# Copyright (C) 2015-2019 Tanguy Fardet
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | Silmathoron/NNGT | nngt/core/nngt_graph.py | Python | gpl-3.0 | 32,443 |
from setuptools import setup
version = '2.2.dev0'
long_description = '\n\n'.join([
open('README.rst').read(),
open('TODO.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
'Django >= 1.6',
'django-extensions',
'lizard-ui >= 5.0',
'lizard-... | lizardsystem/lizard-maptree | setup.py | Python | gpl-3.0 | 1,230 |
# Copyright (C) 2012 David Morton
#
# 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 program is distribut... | davidlmorton/spikepy | spikepy/plotting_utils/sampler.py | Python | gpl-3.0 | 2,180 |
from django.conf import settings
from django.db import models
from django.forms.models import model_to_dict
import json
import requests
class Character(models.Model):
name = models.CharField(max_length=250)
server_name = models.CharField(max_length=250)
head = models.TextField(blank=True, null=True)
... | tinyx/crabfactory | wow_monitor/models.py | Python | gpl-3.0 | 2,497 |
# Flexlay - A Generic 2D Game Editor
# Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com>
#
# 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)... | SuperTux/flexlay | supertux/menubar.py | Python | gpl-3.0 | 4,310 |
# coding=utf-8
import flask_pymongo
from app import mongo
from .tags import Tag
class PostsTags(object):
"""
标签文章关系模型
:_id 自动 id
:post_id 文章 id
:tag_id 标签 id
"""
def __init__(self):
pass
@staticmethod
def get_post_tags(post_id):
"""
获取文章的标签列表
:pa... | thundernet8/Plog | app/core/models/posts_tags.py | Python | gpl-3.0 | 1,897 |
import socket as _socket
import os
import types
import _lightbluecommon
from _obexcommon import OBEXError
# public attributes
__all__ = ("sendfile", "recvfile")
def sendfile(address, channel, source):
if not isinstance(source, (types.StringTypes, types.FileType)):
raise TypeError("source must be string o... | hfeeki/python-lightblue | src/series60/_obex.py | Python | gpl-3.0 | 3,871 |
#! /usr/bin/env python
from state_ai import StateAi
import rospy
from math import pi
from std_msgs.msg import Bool
class Practice(StateAi):
def __init__(self):
super(Practice, self).__init__("practice")
def on_start(self):
self.generate_circle(1.8, pi/4, 2 * pi - pi/4, pi/270.0, -1)
de... | clubcapra/Ibex | src/capra_ai/scripts/practice.py | Python | gpl-3.0 | 536 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 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; eith... | pferreir/indico-backup | indico/tests/python/unit/db.py | Python | gpl-3.0 | 4,383 |
# Copyright 2008-2010, Red Hat, Inc
# Dan Radez <dradez@redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 6... | oppianmatt/django-loki | src/loki/__init__.py | Python | gpl-3.0 | 429 |
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from restorepoint import RestorePoint
import argparse
import logging
import os
import shutil
import sys
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def parse_ar... | pschmitt/python-restorepoint | restorepoint/rp.py | Python | gpl-3.0 | 8,649 |
class Solution:
def simplifyPath(self, path: str) -> str:
path_components = path.split('/')
starting_path = []
for path_component in path_components:
if not path_component: # '//'
continue
if path_component == '.':
continue
... | 1337/yesterday-i-learned | leetcode/71m.py | Python | gpl-3.0 | 518 |
"""
A binary gap within a positive integer N is any maximal sequence of
consecutive zeros that is surrounded by ones at both ends in the binary
representation of N.
For example, number 9 has binary representation 1001 and contains a binary gap
of length 2. The number 529 has binary representation 1000010001 and con... | Dineshkarthik/codility_training | Lesson 01 - Iterations/binary_gap.py | Python | gpl-3.0 | 1,391 |
#!/usr/bin/env python
from __future__ import absolute_import, unicode_literals
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "_3caassurance.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| madicorp/3caassurance | manage.py | Python | gpl-3.0 | 320 |
import json
import random
import string
import logging
import requests
from collections import namedtuple
from os import path
logger = logging.getLogger()
config_file = path.join(path.dirname(path.dirname(__file__)), "config.json")
requests_timeout = 10
titles = [
"dr",
"mr",
"cheeky",
"duchess",
... | SimonStJG/TheDailyWhiskers | thedailywhiskers/dailywhiskers.py | Python | gpl-3.0 | 6,491 |
from unittest import TestCase, main
from requests import HTTPError, Response
from mock import patch
from ntfy.backends.notifico import notify
class TestNotifico(TestCase):
def setUp(self):
self.webhook = 'https://n.tkte.ch/h/1234/testing_webhook'
@patch('requests.get')
def test_basic(self, mock... | dschep/ntfy | tests/test_notifico.py | Python | gpl-3.0 | 1,153 |
from __future__ import unicode_literals
import socket
from django.conf import settings
try:
HOSTNAME = socket.gethostname()
except:
HOSTNAME = 'localhost'
def common_settings(request):
"""Passing custom CONSTANT in Settings into RequestContext."""
from django.contrib.sites.models import get_current_... | thetoine/eruditorg | erudit/base/context_processors.py | Python | gpl-3.0 | 753 |
from . import models
from . import materialized_views | sumihai-tekindo/account_sicepat | customer_classification/__init__.py | Python | gpl-3.0 | 54 |
# -*- coding: utf-8 -*-
#
# cosmic documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 21 14:05:08 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | aCOSMIC/aCOSMIC | docs/conf.py | Python | gpl-3.0 | 12,863 |
from token import *
from network import *
from logical_node import *
from role_criteria import *
##################################################################################
# Example code that roughly shows how the framework is to be used. Note: the
# relationship between the network and the logical nodes will ... | triskadecaepyon/DF_RoleMatrix | example_simple.py | Python | gpl-3.0 | 1,926 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ReactorConfig(AppConfig):
name = 'reactor'
| cholarajaa/cold-temperature | hotorcold/reactor/apps.py | Python | gpl-3.0 | 154 |
#!/usr/bin/env python
#
# test_copy_residue.py
#
# unit tests for residue duplication functionality
#
__author__ = "Magdalena Musielak, Tomasz Puton, Kristian Rother"
__copyright__ = "Copyright 2008, The Moderna Project"
__credits__ = ["Janusz Bujnicki"]
__license__ = "GPL"
__maintainer__ = "Magdalena Musielak"
__email... | lenarother/moderna | tests/test_rna_residue.py | Python | gpl-3.0 | 4,920 |
from lettuce import step, world
from nose.tools import assert_equals, assert_true, assert_false
import utils
import os
import bunch.special
path = os.path.abspath(__file__)
dir_path = os.path.dirname(path)
utils.init(dir_path)
config_file = os.path.join(dir_path, "config.yaml")
config = utils.load_yaml_config(config_f... | griddynamics/bunch | samples/openstack-smoke/__init__.py | Python | gpl-3.0 | 10,675 |
import sys
from PIL import Image, ImageStat
# Covert image to greyscale, return average pixel brightness.
def brightness_method1( im_file ):
im = Image.open(im_file).convert('L')
stat = ImageStat.Stat(im)
return stat.mean[0]
# Covert image to greyscale, return RMS pixel brightness.
def brightness_method2( im... | mikehankey/fireball_camera | img/get_brightness.py | Python | gpl-3.0 | 669 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | mementum/backtrader | backtrader/filters/datafilter.py | Python | gpl-3.0 | 2,743 |
# -*- coding: utf-8 -*-
from gettext import gettext as _
ACTIVITY_NAME = _('I know America')
PRESENTATION = [
_('Hello friends...'),
_('...tomorrow I have a\ntest about America...'),
_('...and I know nothing!!!'),
_('...what do I do???'),
_('Can I ask you something?'),
_('Will you help me?')
... | AlanJAS/iknowAmerica | recursos/comun/datos/commons.py | Python | gpl-3.0 | 1,689 |
from hashlib import sha256
from django.test import Client
from requests.auth import AuthBase
SIG_KEY = "HTTP_X_SIGNATURE"
def _generate_signature(secret, path, post_data):
path = bytes(path, "utf-8")
body = post_data
secret = bytes(secret, "utf-8")
if isinstance(body, str):
body = bytes(body... | UKTradeInvestment/export-wins-data | alice/tests/client.py | Python | gpl-3.0 | 1,802 |
########################################################################
# File : PilotStatusAgent.py
# Author : Stuart Paterson
########################################################################
""" The Pilot Status Agent updates the status of the pilot jobs in the
PilotAgents database.
"""
__RCSID__ ... | andresailer/DIRAC | WorkloadManagementSystem/Agent/PilotStatusAgent.py | Python | gpl-3.0 | 12,315 |
#!/usr/bin/env python3
goblin_attack = 40
goblin1_alive = True
goblin2_alive = True
goblins_alive = 2
goblin1_stunned = False
goblin2_stunned = False
goblin1_health = 30
goblin2_health = 30
rat_alive = True
rat_health = 15
fists = True
sword = False
shield = False
armor = False
end = False
room = 1
defense = 0
health ... | CoderLune/First-projects | dungeon.py | Python | gpl-3.0 | 50,140 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ********************************************************************************
# Copyright © 2019 jianglin
# File Name: __init__.py
# Author: jianglin
# Email: mail@honmaple.com
# Created: 2019-05-13 16:36:40 (CST)
# Last Update: Wednesday 2019-07-10 19:22:40 (CST)
# ... | honmaple/maple-blog | maple/storage/__init__.py | Python | gpl-3.0 | 1,001 |
# Visualisation tools
#
# Copyright (C) Andrew Bartlett 2015, 2018
#
# by Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
#
# 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 ... | sathieu/samba | python/samba/netcmd/visualize.py | Python | gpl-3.0 | 23,538 |
# =======================================================================
# Copyright 2013 Christos Sioutis <christos.sioutis@gmail.com>
# =======================================================================
# This file is part of indicator-internode.
#
# indicator-internode is free software: you can redistribute it... | sioutisc/indicator-internode | src/pynode/indicatorbase.py | Python | gpl-3.0 | 3,516 |
""" DIRAC FileCatalog Security Manager mix-in class
"""
__RCSID__ = "$Id$"
import os
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Security.Properties import FC_MANAGEMENT
_readMethods = ['exists', 'isFile', 'getFileSize', 'getFileMetadata',
'getReplicas','getReplicaStatus','getFileAncestors',
... | marcelovilaca/DIRAC | DataManagementSystem/DB/FileCatalogComponents/SecurityManager.py | Python | gpl-3.0 | 12,106 |
import asyncio
class MyProtocol(asyncio.Protocol):
def __init__(self, loop):
self.loop = loop
def connection_made(self, transport):
self.transport = transport
self.transport.write(b"Ciao!")
def data_received(self, data):
print(data.decode())
self.transport.close()... | DavideCanton/Python3 | prove_aio/prova_client.py | Python | gpl-3.0 | 626 |
#!/usr/bin/python
"""Run a Machination update cycle
"""
import sys
import itertools
from machination import utils, xmltools, fetcher, hierarchy, context
import topsort
from lxml import etree
workers = {}
class OLWorker:
def __init__(self, wid):
self.wid = wid
self.progdir = context.config.xpa... | machination/machination | bin/update.py | Python | gpl-3.0 | 3,871 |
# -*- coding: utf-8 -*-
from __future__ import division
from otree.common import Currency as c, currency_range, safe_json
from . import models
from ._builtin import Page, WaitPage
from .models import Constants
class FinalPage(Page):
def is_displayed(self):
return self.round_number == Constants.num_round... | anthropo-lab/XP | UIMM_project/atl_Survey/views.py | Python | gpl-3.0 | 1,142 |
from django.contrib import admin
from sentences.models import Sentence
from .models import Tweet
admin.site.register(Tweet)
# class SentenceInline(admin.TabularInline):
# model = Sentence
# readonly_fields = ('content', 'question',)
# max_num = 0
# can_delete = False
#
#
# class TweetAdmin(admin.Mod... | efe/lesib | twitter/admin.py | Python | gpl-3.0 | 425 |
# -*- coding: utf-8 -*-
from models.user import User
class Authenticator(object):
def __init__(self, username, password):
self.username = username
self.password = password
def authenticate(self):
return True
class StudentAuthenticator(Authenticator):
def __init__(self,
... | lyshie/afc-github | app/authenticator.py | Python | gpl-3.0 | 1,848 |
"""Collection of function that may be used by JCM template files (*.jcmt) to
create the project or that may be useful/necessary to process the results.
Contains a default processing function (`processing_default`).
Authors : Carlo Barth
Credit: Partly based on MATLAB-versions written by Sven Burger and Martin
... | cbpygit/pypmj | projects/scattering/mie/mie3D/project_utils.py | Python | gpl-3.0 | 3,547 |
from tests.base_widget_testcase import BaseWidgetTest
| RedFantom/ttkwidgets | tests/__init__.py | Python | gpl-3.0 | 54 |
# -*- coding: utf-8 -*-
# EDIS - a simple cross-platform IDE for C
#
# This file is part of Edis
# Copyright 2014-2015 - Gabriel Acosta <acostadariogabriel at gmail>
# License: GPLv3 (see http://www.gnu.org/licenses/gpl.html)
"""
Éste módulo tiene información acerca de los directorios necesarios para
la aplicación.
""... | centaurialpha/edis | src/core/paths.py | Python | gpl-3.0 | 927 |
from collections import namedtuple
ScoredObject = namedtuple('ScoredObject',
['key', 'score', 'variable1', 'variable2', 'rounds', 'opponents', 'wins', 'loses']
) | ubc/compair | compair/algorithms/scored_object.py | Python | gpl-3.0 | 165 |
'''
Created on 05.01.2018
@author: michael
'''
from alexplugins.systematic.tkgui import SystematicPointSelectionPresenter,\
SystematicPointSelectionDialog
from tkinter.ttk import Button
from alexplugins.systematic.base import SystematicIdentifier, SystematicPoint
from alexandriabase.domain import Tree
from manual.... | archivsozialebewegungen/AlexandriaPlugins | manualtests/manual/dialogs_test.py | Python | gpl-3.0 | 3,944 |
"""Abstract base audio mixer."""
from abc import ABCMeta, abstractmethod
import smokesignal
from volcorner import signals
__all__ = ['Mixer']
class Mixer(metaclass=ABCMeta):
@abstractmethod
def open(self):
"""Open the mixer and start monitoring for volume changes."""
@abstractmethod
def cl... | cknave/volcorner | volcorner/mixer.py | Python | gpl-3.0 | 1,024 |
import unittest
import os.path
from math import pi
from sapphire import corsika
data_file_dir = os.path.dirname(__file__)
DATA_FILE = os.path.join(data_file_dir, 'test_data/1_2/DAT000000')
class CorsikaFileTests(unittest.TestCase):
def setUp(self):
self.file = corsika.reader.CorsikaFile(DATA_FILE)
... | tomkooij/sapphire | sapphire/tests/corsika/test_corsika.py | Python | gpl-3.0 | 3,194 |
"""
Abstract base classes define the primitives that renderers and
graphics contexts must implement to serve as a matplotlib backend
:class:`RendererBase`
An abstract base class to handle drawing/rendering operations.
:class:`FigureCanvasBase`
The abstraction layer that separates the
:class:`matplotlib.fi... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/matplotlib/backend_bases.py | Python | gpl-3.0 | 106,921 |
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import datetime
import decimal
import httplib
import json
import threading
import time
import re
from decimal import Decimal
from electrum_myr.plugins import BasePlugin, hook
from electrum_myr.i18n import _
from electrum_myr_gui.qt.util import *
from electrum_myr_gu... | wozz/electrum-myr | plugins/exchange_rate.py | Python | gpl-3.0 | 13,200 |
# Copyright (c) 2019 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... | dirkmueller/kiwi | kiwi/storage/subformat/vagrant_virtualbox.py | Python | gpl-3.0 | 3,951 |
# -*- coding: utf-8 -*-
#
# SpamFighter, Copyright 2008, 2009 NetStream LLC (http://netstream.ru/, we@netstream.ru)
#
# This file is part of SpamFighter.
#
# SpamFighter 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 Fou... | smira/spamfighter | spamfighter/core/commands/dispatcher.py | Python | gpl-3.0 | 2,984 |
from ..schema import default_radio_driver
from .base import OpenWrtConverter
class Radios(OpenWrtConverter):
netjson_key = 'radios'
intermediate_key = 'wireless'
_uci_types = ['wifi-device']
def to_intermediate_loop(self, block, result, index=None):
radio = self.__intermediate_radio(block)
... | openwisp/netjsonconfig | netjsonconfig/backends/openwrt/converters/radios.py | Python | gpl-3.0 | 4,636 |
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | cs-au-dk/Artemis | WebKit/Tools/Scripts/webkitpy/common/config/urls_unittest.py | Python | gpl-3.0 | 3,141 |
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from form_utils.forms import BetterForm
import form_utils.fields as bf_fields
from tao.widgets import ChoiceFieldWithOtherAttrs, SelectWithOtherAttrs, TwoSidedSelectWidget, SpinnerWidget
from tao import d... | IntersectAustralia/asvo-tao | web/tao/sql_job_form.py | Python | gpl-3.0 | 4,293 |
import szurubooru.model.util
from szurubooru.model.base import Base
from szurubooru.model.comment import Comment, CommentScore
from szurubooru.model.pool import Pool, PoolName, PoolPost
from szurubooru.model.pool_category import PoolCategory
from szurubooru.model.post import (
Post,
PostFavorite,
PostFeatur... | rr-/szurubooru | server/szurubooru/model/__init__.py | Python | gpl-3.0 | 632 |
import curses
import datetime
import itertools
import sys
import time
from tabulate import tabulate
from Brick.sockserver import SockClient
def build_info(client):
headers = ["SID", "CONF", "BOOT", "TERM", "TIME", "STATE", "CPU%", "MEM%", "TASK", "NQ", "QUEUE"]
table = []
res = []
for status in clie... | Tefx/Brick | Brick/tools.py | Python | gpl-3.0 | 1,716 |
from .conftest import decode_response
YARA_TEST_RULE = 'rule rulename {strings: $a = "foobar" condition: $a}'
def test_no_data(test_app):
result = decode_response(test_app.post('/rest/binary_search'))
assert 'Input payload validation failed' in result['message']
assert 'errors' in result
assert 'is a... | fkie-cad/FACT_core | src/test/unit/web_interface/rest/test_rest_binary_search.py | Python | gpl-3.0 | 1,968 |
# Author: medariox <dariox@gmx.com>,
# based on Antoine Bertin's <diaoulael@gmail.com> work
# and originally written by Nyaran <nyayukko@gmail.com>
# URL: https://github.com/SickRage/SickRage/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of... | hernandito/SickRage | sickbeard/subtitles.py | Python | gpl-3.0 | 24,581 |
import numpy as np
import matplotlib.pyplot as plt
from asteroseismology_model import *
keep = np.loadtxt('keep.txt')
# Trace plot of the number of peaks
plt.plot(keep[:,0].astype('int'))
plt.xlabel('Iteration', fontsize=18)
plt.ylabel('Number of Peaks', fontsize=18)
plt.show()
# Histogram of the number of peaks
pl... | eggplantbren/WinterSchool | Code/asteroseismology_results.py | Python | gpl-3.0 | 2,064 |
#!/usr/bin/env python
from Media import Media
class Movie(Media):
"""Inherits Media.
Attributes:
section_type: The type of library this is (i.e. "TV Shows")
title: The title of the media item
natural_start_time: The scheduled start time before any shifting happens.
natural_en... | justinemter/pseudo-channel | src/Movie.py | Python | gpl-3.0 | 1,306 |
#---LICENSE----------------------
'''
Copyright 2014 Travel Modelling Group, Department of Civil Engineering, University of Toronto
This file is part of the TMG Toolbox.
The TMG Toolbox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | TravelModellingGroup/TMGToolbox | TMGToolbox/src/XTMF_internal/return_boardings.py | Python | gpl-3.0 | 6,999 |
class Solution(object):
def intersection(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
result = []
for i in nums1:
if i in nums2 and i not in result:
result.append(i)
return res... | CharlotteLock/LeetCode | 349. Intersection of Two Arrays.py | Python | gpl-3.0 | 324 |
#!/usr/bin/python
# BSD Licensed, Copyright (c) 2006-2008 MetaCarta, Inc.
import sys, os, traceback
import cgi as cgimod
from web_request.response import Response
import urllib
import StringIO
class ApplicationException(Exception):
"""Any application exception should be subclassed from here. """
status_cod... | guolivar/totus-niwa | service/thirdparty/featureserver/web_request/handlers.py | Python | gpl-3.0 | 10,134 |
"""
Mopaq archive format found in Blizzard titles Diablo 1.0 and later
Implemented according to info from http://www.zezula.net
"""
import struct, hashlib, sys
from collections import namedtuple
USERDATA_MAGIC = b'MPQ\x1A'
FILEHEADER_MAGIC = b'MPQ\x1B'
HET_MAGIC = b'HET\x1A'
BET_MAGIC = b'BET\x1A'
BITMAP_MAGIC = b'p... | Schala/format-scripts | mpq.py | Python | gpl-3.0 | 5,804 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "./etc/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "./lib/"))
from sheepsense.webapp import app as application
if __name__ == "__main__":
application.run()
| basbloemsaat/sheepsense_v2 | wsgi.py | Python | gpl-3.0 | 255 |
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2021 Andrew Ziem
# https://www.bleachbit.org
#
# 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
# ... | bleachbit/bleachbit | tests/TestWorker.py | Python | gpl-3.0 | 11,675 |
from setuptools import setup, find_packages
version = {}
with open('swk_casp/version.py') as f:
exec(f.read(), version)
url = 'https://github.com/trueneu/swiss-knife'
setup(name='swk_casp',
version=version['__version__'],
packages=find_packages(),
install_requires=[
'swk>=0.0.4a4',
... | trueneu/swiss-knife | swk_plugins/swk_casp/setup.py | Python | gpl-3.0 | 1,746 |
"""Experiment to test the correction of calculation of income from
agriculture and ecosystem services.
This experiment tests the influence of prefactors in income
calculation (r_bca and r_es) for two scenarios:
1) for income calculated as **mean** over income from cells
2) for income calculated as **sum** over income ... | jakobkolb/MayaSim | Experiments/mayasim_X2_scan_r_es_and_r_agg.py | Python | gpl-3.0 | 8,304 |
# -*- coding: utf-8 -*-
#
# forms_function.py - Function Flask Forms
#
from flask_babel import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import BooleanField
from wtforms import DecimalField
from wtforms import SelectField
from wtforms import StringField
from wtforms import SubmitField
from wtforms impor... | kizniche/Mycodo | mycodo/mycodo_flask/forms/forms_function.py | Python | gpl-3.0 | 3,125 |
#!/usr/bin/env python3
# encoding: utf-8
# Copyright (C) 2020 Space Science and Engineering Center (SSEC),
# University of Wisconsin-Madison.
#
# 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 F... | davidh-ssec/polar2grid | polar2grid/readers/viirs_sdr.py | Python | gpl-3.0 | 21,308 |
# -*- coding: utf-8 -*-
from django.db.models import Q
from django.conf import settings
from django.contrib.auth.models import Permission, Group
from django.utils.html import escape
from ajax_select import register, LookupChannel
from .models import (
Attribute,
ServerAttribute,
Package,
Property,
... | migasfree/migasfree | migasfree/server/lookups.py | Python | gpl-3.0 | 7,455 |
# Maked by Mr. Have fun! Version 0.2
# Shadow Weapon Coupons contributed by BiTi for the Official L2J Datapack Project
# Visit http://forum.l2jdp.com for more details
import sys
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.... | zenn1989/scoria-interlude | L2Jscoria-Game/data/scripts/quests/408_PathToElvenwizard/__init__.py | Python | gpl-3.0 | 12,096 |
class Foo(object):
def __init__(self):
self.frotz = {'ping':'pong'}
class Bar(Foo):
def __init__(self, frob, frizzle):
Foo.__init__(self)
self.frotz['foo'] = 'bar'
self.frazzle = frizzle
bar = Bar(1,2)
print("frotz:", bar.frotz)
print("frazzle:", bar.frazzle) | ozzmeister00/textAdventureA | sandbox.py | Python | gpl-3.0 | 312 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from mock import patch
from django.test import TestCase as DjangoTestCase
from tastypie.test import ResourceTestCase as TastypieResourceTestCase
from baobab.utils.mock import MockSN, MockLOG
class TestCase(DjangoTestCase):
def setUp(self, *args, *... | Gandi/baobab | baobab/utils/test.py | Python | gpl-3.0 | 1,573 |
# -*- encoding: utf-8 -*-
"""Implements System Groups UI"""
from robottelo.ui.base import Base
from robottelo.ui.locators import common_locators, locators
class SystemGroup(Base):
def create(self, name, description=None, limit=None):
"""Creates new System Group from UI"""
if self.wait_until_ele... | abalakh/robottelo | robottelo/ui/systemgroup.py | Python | gpl-3.0 | 3,072 |
# -*- coding: utf-8 -*-
# This package and all its sub-packages are part of django-wiki,
# except where otherwise stated.
#
# django-wiki 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... | Attorney-Fee/django-wiki | wiki/__init__.py | Python | gpl-3.0 | 773 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^login/$', views.login, name='login'),
url(r'^logout/$', views.logout, name='logout'),
url(r'^register/$', views.register, name='register'),
url(r'^register/mail/$', views.register_mail, name='register_mail'),
url(r'^regist... | enfancemill/baobaocloud | app/account/urls.py | Python | gpl-3.0 | 390 |
import os
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"
from collections import namedtuple
from django.conf import settings
from django.contrib.auth.models import User
from django.db import connection
from djsopnet.control.assembly import \
generate_assembly_equivalences, \
generate_compatible_assemblies_betw... | catsop/CATMAID | django/projects/mysite/scripts/test_assembly_mapping.py | Python | gpl-3.0 | 3,648 |
"""
Transducer predicate class and parser
has input and output predicate and defines operations with them
Copyright (c) 2017 Michaela Bielikova <xbieli06@stud.fit.vutbr.cz>
"""
import abc
import random
from predicate_interface import PredicateInterface
class TransPred(PredicateInterface):
"""
Transducer pre... | Miskaaa/symboliclib | symboliclib/transducer_predicate.py | Python | gpl-3.0 | 7,134 |
from django.db import models
from pygments.lexers import get_all_lexers
from pygments.styles import get_all_styles
LEXERS=[item for item in get_all_lexers() if item[1]]
LANGUAGE_CHOICES=sorted([(item[1][0],item[0]) for item in LEXERS])
STYLE_CHOICES=sorted((item,item) for item in get_all_styles())
# Create your mode... | DataDrivenExperiences/Server | interest/models.py | Python | mpl-2.0 | 891 |
from configparser import SafeConfigParser
import os
import sys
from collections import OrderedDict
here = os.path.dirname(__file__)
class ConfigDict(dict):
def __init__(self, base_path, *args, **kwargs):
self.base_path = base_path
dict.__init__(self, *args, **kwargs)
def get_path(self, key, d... | KiChjang/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/config.py | Python | mpl-2.0 | 1,667 |
# Generated by Django 3.1.6 on 2021-02-02 19:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('busstops', '0006_auto_20201225_0004'),
('vehicles', '0009_livery_text_colour'),
]
operations = [
mi... | jclgoodwin/bustimes.org.uk | vehicles/migrations/0010_auto_20210202_1951.py | Python | mpl-2.0 | 819 |
import datetime
from dataclasses import dataclass
from typing import List, Dict, Optional
from everyclass.server.entity import domain
from everyclass.server.utils import JSONSerializable
from everyclass.server.utils.encryption import encrypt, RTYPE_STUDENT, RTYPE_TEACHER
@dataclass
class Event(JSONSerializable):
... | fr0der1c/EveryClass-server | everyclass/server/entity/model/multi_people_schedule.py | Python | mpl-2.0 | 3,857 |
# 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 io import BytesIO
from gzip import GzipFile
import pytest
from botocore.exceptions import ClientError
from request... | mozilla-services/tecken | tecken/tests/test_symboldownloader.py | Python | mpl-2.0 | 24,201 |
# 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 __future__ import absolute_import
from __future__ import unicode_literals
from .models import Tree, Repository, Loc... | mozilla/elmo | apps/life/admin.py | Python | mpl-2.0 | 636 |
from Tkinter import *
class Interface:
def __init__(self, contenedor):
self.textoE3 = StringVar()
self.e1 = Label(contenedor, text = "Convertir Celsius a Farenheit", fg = "black")
self.e2 = Label(contenedor, text = "Celsius", fg = "black")
self.e3 = Label(contenedor, text = "Farenh... | heliogabalo/The-side-of-the-source | Codigo/Python/ventana5.py | Python | mpl-2.0 | 1,053 |
from __future__ import unicode_literals
import pytest
from django.core.exceptions import MiddlewareNotUsed
from django.http import HttpResponse
from django.test import RequestFactory
from mock import MagicMock, patch
from ..middleware import (
ForceAnonymousSessionMiddleware,
RestrictedEndpointsMiddleware,
... | SphinxKnight/kuma | kuma/core/tests/test_middleware.py | Python | mpl-2.0 | 5,154 |
# coding: utf-8
"""
MIT License
Copyright (c) 2019 Claude SIMON (https://q37.info/s/rmnmqd49)
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 limit... | epeios-q37/epeios | other/exercises/basics/workshop/fr/z_2a.py | Python | agpl-3.0 | 1,301 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today INECO LTD,. PART. (<http://www.ineco.co.th>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | jeffery9/mixprint_addons | ineco_sale_make_purchase/__init__.py | Python | agpl-3.0 | 1,105 |
# The Hazard Library
# Copyright (C) 2012-2016 GEM Foundation
#
# 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 option) any later version.
#... | vup1120/oq-hazardlib | openquake/hazardlib/source/base.py | Python | agpl-3.0 | 10,755 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from datetime import timedelta
from functools import partial
import psycopg2
import pytz
from odoo import api, fields, models, tools, _
from odoo.tools import float_is_zero
from odoo.exceptions import Use... | maxive/erp | addons/point_of_sale/models/pos_order.py | Python | agpl-3.0 | 56,888 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2022 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... | gem/oq-engine | openquake/hazardlib/tests/gsim/ghofrani_atkinson_test.py | Python | agpl-3.0 | 4,595 |
"""add column automatic_crawling to the user table
Revision ID: 8bf5694c0b9e
Revises: 5553a6c05fa7
Create Date: 2016-10-06 13:47:32.784711
"""
# revision identifiers, used by Alembic.
revision = '8bf5694c0b9e'
down_revision = '5553a6c05fa7'
branch_labels = None
depends_on = None
from alembic import op
import sqlalc... | JARR/JARR | migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py | Python | agpl-3.0 | 543 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce 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.
import pytest
from django.test import override_settings
from shuu... | suutari/shoop | shuup_tests/core/test_order_languages.py | Python | agpl-3.0 | 3,168 |