code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import kolabformat
from pykolab.translate import _
from pykolab.translate import N_
from contact_reference import ContactReference
participant_status_labels = {
"NEEDS-ACTION": N_("Needs Action"),
"ACCEPTED": N_("Accepted"),
"DECLINED": N_("Declined"),
"TENTATIVE": N_("Tentatively Acc... | tpokorra/pykolab | pykolab/xml/attendee.py | Python | gpl-3.0 | 9,223 |
# Licensed under GPL version 3 - see LICENSE.rst
import numpy as np
import transforms3d
from astropy.table import Table
from astropy.coordinates import SkyCoord
import astropy.units as u
from ..analysis import (find_best_detector_position,
resolvingpower_per_order)
from ..math.utils import e2h
... | Chandra-MARX/marxs | marxs/tests/test_analysis.py | Python | gpl-3.0 | 4,162 |
#!/usr/bin/env python
import os
def create_asm(instruction):
if instruction.startswith("main:"):
if "ja" in instruction:
instruction = "." + instruction
#print instruction
out = open("temp.asm", "wb")
out.write(" " + instruction + "\n")
out.close()
# --------------------------------- fold her... | mikeakohn/naken_asm | tests/comparison/scripts/gen_riscv.py | Python | gpl-3.0 | 1,166 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Athanasios Theocharis <athatheoc@gmail.com>
# This was made under ESA Summer of Code in Space 2019
# by Athanasios Theocharis, mentored by Daniel Estevez
#
# This file is part of gr-satellites
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
from gnuradio... | daniestevez/gr-satellites | python/ccsds/telemetry_packet_reconstruction.py | Python | gpl-3.0 | 2,817 |
import pygame, sys
def lineleft():
plotpoints = []
for x in range(0, 640):
y = -5 * x + 1000
plotpoints.append([x, y])
pygame.draw.lines(screen, [0, 0, 0], False, plotpoints, 5)
pygame.display.flip()
def lineright():
plotpoints = []
for x in range(0, 640):
y = 5 * x -... | cysuncn/python | study/test/Test-9-1.py | Python | gpl-3.0 | 2,116 |
import json
import os
import re
import uuid
import zipfile
import itertools
from urllib.parse import unquote
import tempfile
from collections import OrderedDict
from datetime import datetime, date, time
from osgeo import ogr, gdal
from pyramid.response import Response, FileResponse
from pyramid.httpexceptions import ... | nextgis/nextgisweb | nextgisweb/feature_layer/api.py | Python | gpl-3.0 | 25,791 |
from .nanoplotter_main import *
| wdecoster/NanoPlot | nanoplotter/__init__.py | Python | gpl-3.0 | 32 |
"""
Setup/build script for MasterChess
For usage info, see readme.md
"""
import os, sys, subprocess
from distutils.dir_util import copy_tree
from setuptools import setup
from MasterChessGUI import __description__, __copyright__, __version__
def get_folder(path):
if isinstance(path, list):
return [get_fo... | jhartz/masterchess | setup.py | Python | gpl-3.0 | 5,318 |
# encoding: utf-8
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.http import HttpResponse
from django.shortcuts import render
from django.contrib import admin
from data import get_ingredients, get_cocktails
admin.autodiscover()
def ingredients(request):
... | Psycojoker/cocktailator | cocktails/urls.py | Python | gpl-3.0 | 1,074 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Vertice:
def __init__(self, id, latitude, longitude):
self.id = id
self.latitude = latitude
self.longitude = longitude | Raul3212/TopicosAvancadosBD | dev/model/Vertice.py | Python | gpl-3.0 | 198 |
""" Email limiter """
import logging
from sqlalchemy import Column, BigInteger, DateTime, func
from sqlalchemy.schema import ForeignKey
import akiri.framework.sqlalchemy as meta
from event_control import EventControl
from manager import Manager
from system import SystemKeys
logger = logging.getLogger()
class Email... | palette-software/palette | controller/controller/email_limit.py | Python | gpl-3.0 | 4,376 |
#!/usr/bin/env python
"""
This example shows that two activations of the gzip library to compress files
actually produce files with different md5 signatures.
The reason for this is the filename, date and compression levels.
You can control this by uding the GzipFile object which has more
parameters. This is not yet d... | veltzer/demos-python | src/examples/short/gzip/same_content_different_files.py | Python | gpl-3.0 | 1,827 |
#!/usr/bin/python
################################################################################
##3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
## 10 20 30 40 50 60 70 80
##
## Info:
## Example of how to use libnotify correctl... | dkasak/notify-osd-customizable | examples/summary-body.py | Python | gpl-3.0 | 3,917 |
import json
import time
def parseSearches(searchesFile, begintimeframe = 0, endtimeframe = int(time.time())) :
searches = json.load(open(searchesFile, 'r'))
listOfsearches = []
for search in searches["event"]:
#a query can contain several timestap so special measurments need te be implemented in... | LeanVel/TakeoutsTimelining | SearchesParser.py | Python | gpl-3.0 | 857 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: TFG
# Author: David Candal
# Description: SDR ZigBee
# Generated: Mon Sep 19 21:01:18 2016
##################################################
if __name__ == '__main__':
import ct... | davidcandal/gr-tfg | examples/testNWK.py | Python | gpl-3.0 | 4,815 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | whitepyro/debian_server_setup | sickbeard/scene_numbering.py | Python | gpl-3.0 | 25,288 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from Tkinter import *
from ttk import *
class URLDialogView(object):
_LABEL_CONF = {'column': 0, 'padx': 5, 'pady': 5, 'sticky': W}
_ENTRY_CONF = {'padx': 5, 'pady': 5, 'sticky': E+W}
def __init__(self, parent, controller, data=N... | fzuellich/urlmonitor | view.py | Python | gpl-3.0 | 4,690 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from trifle.managers.command import Command
from trifle.managers.option import Option
from trifle.managers.group import Group
class Server(Command):
"""
Runs the Flask development server i.e. app.run()
:param host: server host
:param p... | gloaec/trifle | src/trifle/managers/server.py | Python | gpl-3.0 | 3,973 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ... | Mhynlo/SickRage | sickbeard/versionChecker.py | Python | gpl-3.0 | 34,840 |
"""Add two new columns for Person.
Revision ID: 3c7fd5b4e2c2
Revises: 24282792d72a
Create Date: 2013-06-26 14:46:28.361709
"""
# revision identifiers, used by Alembic.
revision = "3c7fd5b4e2c2"
down_revision = "16943d9088cf"
import tahrir_api
from alembic import op
import sqlalchemy as sa
import datetime
def upgr... | fedora-infra/tahrir-api | alembic/versions/3c7fd5b4e2c2_add_two_new_columns_.py | Python | gpl-3.0 | 1,034 |
from queue import Queue
seed = 1362
seen = set()
def is_empty(x, y):
n = x*x + 3*x + 2*x*y + y + y*y + seed
return bin(n).count('1') % 2 == 0
def valid_moves(x, y):
result = []
actions = [-1, 1]
for action in actions:
new_x = x + action
if x > 0 and is_empty(new_x, y) and (new_x... | DzinVision/adventofcode-2016 | day_13.py | Python | gpl-3.0 | 1,232 |
#!/usr/bin/python
# continue :will skip an iteration
for student in ['naren','sandy','kumar','shalini','sushma']:
if student == 'kumar':
continue
#break
#pass
print "results of student - {}".format(student) | tuxfux-hlp-notes/python-batches | archieves/batch-59/result.py | Python | gpl-3.0 | 215 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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, eith... | lem9/weblate | weblate/trans/data.py | Python | gpl-3.0 | 1,577 |
import sys
from spoac import SymbolicExecutionSlice
from spoac import PlanningSlice
from spoac.util.IceApplication import IceApplication
class PlanTesterApp(IceApplication):
def run(self, args):
planner = self.stormGetTopic("PlanController",
PlanningSlice.PlanControllerTopicPrx)
symb... | naderman/spoac | src/examples/python/PlanTester.py | Python | gpl-3.0 | 2,580 |
# -*- coding: utf-8 -*-
#
# Authors: Manuel de la Pena <manuel@canonical.com>
# Alejandro J. Cura <alecu@canonical.com>
#
# Copyright 2011 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 ... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/ubuntuone-client/ubuntuone/platform/windows/ipc_client.py | Python | gpl-3.0 | 23,763 |
# -*- coding: utf-8 -*-
# Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
#
# This file is part of HyperKitty.
#
# HyperKitty is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of t... | khushboo9293/Hyperkitty | hyperkitty/tests/views/test_accounts.py | Python | gpl-3.0 | 11,941 |
from expremigen.io.constants import PhraseProperty as PP
from expremigen.io.pat2midi import Pat2Midi
from expremigen.io.phrase import Phrase
from expremigen.musicalmappings.durations import Durations as Dur
from expremigen.musicalmappings.dynamics import Dynamics as Dyn
from expremigen.musicalmappings.note2midi import ... | shimpe/expremigen | examples/twovoicewithchords.py | Python | gpl-3.0 | 2,485 |
""" KeystoneClient class encapsulates the work with the keystone service interface
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import requests
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.Utilities.Time import fromString, dateTime
__RC... | DIRACGrid/VMDIRAC | VMDIRAC/Resources/Cloud/KeystoneClient.py | Python | gpl-3.0 | 9,771 |
import OZ.Potentials as Potentials
import OZ.OZ_Functions as OZF
import OZ.PP_Functions as PP_Functions
#import FigFuncs
#import HNC
import OZ.RHNC as RHNC
import numpy as np
def SinglePointCalculation(r, k, Ur, Ur_ref, rho, T=1.0, OutFile=None, cr_guess=None, tol=1e-8):
#RHNC Solver
print "Function = Sin... | sumanthjamadagni/OZ | SinglePointCalculation.py | Python | gpl-3.0 | 1,299 |
'''
Normality tests for 1D data
'''
# Copyright (C) 2016 Todd Pataky
from . import k2,sw
def dagostinoK2(x):
return k2.residuals(x)
def shapirowilk(x):
return sw.residuals(x)
residuals = k2.residuals
anova1 = k2.anova1
anova1rm = k2.anova1rm
anova2 = k2.anova2
anova2nested = k2.anova2... | 0todd0000/spm1d | spm1d/stats/normality/__init__.py | Python | gpl-3.0 | 637 |
from django.conf import settings
from django.contrib import messages
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth i... | ekesken/istatistikciadamlazim | allauth/socialaccount/helpers.py | Python | gpl-3.0 | 7,010 |
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class CBondSpecialConditions(BaseModel):
"""
4.127 中国债券特殊条款
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
Win... | SnowWalkerJ/quantlib | quant/data/wind/tables/cbondspecialconditions.py | Python | gpl-3.0 | 1,754 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from xbmctorrent import plugin
from xbmctorrent.scrapers import scraper
from xbmctorrent.ga import tracked
from xbmctorrent.caching import cached_route
from xbmctorrent.utils import ensure_fanart
from xbmctorrent.library import library_context
BASE_URL = plugin.get_setti... | skipmodea1/plugin.video.xbmctorrent | resources/site-packages/xbmctorrent/scrapers/btdigg.py | Python | gpl-3.0 | 2,061 |
#!/usr/bin/env python
import os
import subprocess
import argparse
from utils import *
from parser import *
RESULTS = 'results'
EXPERIMENTS = [
('1x1', 'cpu'),
('1x1', 'gpu'),
('2x1', 'gpu'), ('1x2', 'gpu'),
('2x2', 'gpu'), ('4x1', 'gpu'), ('1x4', 'gpu'),
('4x2', 'gpu'), ('8x1', 'gpu'), ('1x8'... | acopar/crow-plot | crowpl/benchmark.py | Python | gpl-3.0 | 6,999 |
# -*- coding: UTF-8 -*-
## Copyright 2009-2013 Luc Saffre
## This file is part of the Lino project.
## Lino 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 y... | MaxTyutyunnikov/lino | lino/utils/config.py | Python | gpl-3.0 | 11,277 |
import numpy as np
from matplotlib import pyplot as plt
from random import *
def transpose_shape(x):
n = []
for i in x: n.append(i.T)
return np.array(n)
def flip_bits(x):
n = []
for idx, i in enumerate(x):
m = []
for j in i:
ch = choice([0,1])
if ch and j.s... | flag0010/pop_gen_cnn | introgression/old/plot.input.image.py | Python | gpl-3.0 | 2,054 |
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import re
import networkx as nx
from networkx.algorithms.components.connected import connected_components
from datetime import date
import lib.util as util
import csv
import numpy as np
import lib.config as config
from it... | prasadtalasila/IRCLogParser | lib/analysis/network.py | Python | gpl-3.0 | 39,848 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
# Romain Gauthier <romain@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or m... | kiniou/blender-smooth-slides | tools/lpod/scripts/lpod-style.py | Python | gpl-3.0 | 3,854 |
#!/usr/bin/env python
'''
2D Group Members:
> Charlotte Phang
> Lau Wenkie
> Mok Jun Neng
> Martin Tan
> Dicson Candra
'''
#Import relevant modules
import RPi.GPIO as GPIO
import os
import glob
import time
from PIDsm import PID_ControllerSM
### PIN NUMBERS ###
tempPin = 4
motorPin = 12
fanPin = 1... | tgymartin/green-fingers-2d | DW/part2_and_part3/Cohort_6_Team_6/part3_code/prototype.py | Python | gpl-3.0 | 3,524 |
import teneto
import matplotlib.pyplot as plt
def test_sliceplot():
G = teneto.generatenetwork.rand_binomial([4, 2], 0.5, 'graphlet', 'wu')
fig, ax = plt.subplots(1)
ax = teneto.plot.slice_plot(G, ax)
plt.close(fig)
def test_circleplot():
G = teneto.generatenetwork.rand_binomial([4, 2], 0.5, 'g... | wiheto/teneto | test/plot/test_plot.py | Python | gpl-3.0 | 640 |
def anagrams(A):
mapper = dict()
for index, string in enumerate(A):
string = "".join(sorted(string))
print mapper
if not mapper.get(string, 0):
mapper[string] = [index + 1]
else:
mapper[string].append(index + 1)
result = []
for key, val in mapper.i... | purushothamc/myibitsolutions | hashing/list_anagrams.py | Python | gpl-3.0 | 430 |
#
# (c) 2017 Red Hat Inc.
#
# 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 d... | tdtrask/ansible | lib/ansible/plugins/action/enos.py | Python | gpl-3.0 | 3,638 |
#!/usr/bin/env python3
"""Convert FASTA to PHYLIP"""
import sys
from Bio import SeqIO
print("Convert FASTA to PHYLIP")
infile = sys.argv[1]
outfile = sys.argv[2]
sequence_list = [] # To keep order of sequence
sequence_dict = {}
for record in SeqIO.parse(open(infile, "rU"), "fasta"):
tab = record.id.split(" "... | romainstuder/evosite3d | convert_fasta2phylip.py | Python | gpl-3.0 | 1,829 |
# -*- coding: utf-8 -*-
'''
Created on May 3, 2014
@author: andy
'''
#list Tuple
if __name__ == '__main__':
pass | goday-org/learnPython | src/Arrays.py | Python | gpl-3.0 | 119 |
"""
WSGI config for roleplaying project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | svamp/rp_management | roleplaying/wsgi.py | Python | gpl-3.0 | 399 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__authors__ = 'Bruno Adelé <bruno@adele.im>'
__copyright__ = 'Copyright (C) 2013 Bruno Adelé'
__description__ = """A plugins for serialkiller project"""
__license__ = 'GPL'
__version__ = '0.0.2'
__apiversion__ = '1.0'
import os
import sys
import json
import time
import lo... | badele/serialkiller-plugins | skplugins/checker/__init__.py | Python | gpl-3.0 | 4,974 |
#!/usr/bin/env python
class configuracion():
"""
Esta clase cumple la función de una base de datos o fichero de configuración, donde se almacenan de
manera temporal las preferencias de uso del ReDA.
"""
color = 0
"""Indica el color de la camisa del interprete, sus posibles valores son 0... | joseguerrero/sembrando | src/presentacion/librerias/configuracion.py | Python | gpl-3.0 | 4,541 |
from rainmaker.tests import test_helper
def test_manager_can():
pass
| hattwj/rainmaker | rainmaker/tests/unit/sync_manager/tox_manager_tests.py | Python | gpl-3.0 | 74 |
from PyQt5.QtDesigner import * | ales-erjavec/anyqt | AnyQt/_backport/QtDesigner.py | Python | gpl-3.0 | 30 |
#!/usr/bin/env python
#
# Beautiful Capi generates beautiful C API wrappers for your C++ classes
# Copyright (C) 2015 Petr Petrovich Petrov
#
# This file is part of Beautiful Capi.
#
# Beautiful Capi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | PetrPPetrov/beautiful-capi | source/ExtensionSemantic.py | Python | gpl-3.0 | 2,815 |
#from matplotlib.backends.backend_gtk import NavigationToolbar2GTK as NavigationToolbar2
from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar2
import subprocess
import shlex
import re
import posixpath
from anmr_common import *
# use hub4com ?
USE_SERIAL_PIPE=False
#external hel... | brandoncurtis/Anmr | bin/anmr_platform_win.py | Python | gpl-3.0 | 6,305 |
__all__ = ['stack']
| Sriee/epi | data_structures/lib/__init__.py | Python | gpl-3.0 | 21 |
# -*- coding: utf-8 -*-
from __future__ import division
from materials.ec2 import EC2_materials
import os
from miscUtils import LogMessages as lmsg
__author__= "Ana Ortega (AO_O) "
__copyright__= "Copyright 2015, AO_O"
__license__= "GPL"
__version__= "3.0"
__email__= "ana.ortega@ciccp.es "
fckDat=[12,16,20,25,30,35,... | lcpt/xc | verif/tests/materials/ec2/test_EC2Concrete.py | Python | gpl-3.0 | 5,205 |
# -*- coding: utf-8 -*-
# entry.py, part for evparse : EisF Video Parse, evdh Video Parse.
# entry: evparse/lib/hunantv
# version 0.1.0.0 test201505151816
# author sceext <sceext@foxmail.com> 2009EisF2015, 2015.05.
# copyright 2015 sceext
#
# This is FREE SOFTWARE, released under GNU GPLv3+
# please see README.md an... | liuguanyu/evparse | lib/hunantv/entry.py | Python | gpl-3.0 | 3,213 |
import unittest
import nltk
from bard.generators import markov
class TestMarkov(unittest.TestCase):
def setUp(self):
self.tokens = nltk.corpus.brown.words(categories='science_fiction')
self.tagged_tokens = nltk.corpus.brown.tagged_words(categories='science_fiction')
self.generator = markov... | zacharydenton/bard | tests/test_generators_markov.py | Python | gpl-3.0 | 1,503 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ... | gylian/sickrage | sickbeard/providers/generic.py | Python | gpl-3.0 | 20,287 |
import logging
from anubis.model import builtin
from anubis.model import domain
from anubis.util import argmethod
_logger = logging.getLogger(__name__)
def wrap(method):
async def run():
_logger.info('Built in domains')
for ddoc in builtin.DOMAINS:
_logger.info('Domain: {0}'.format(... | KawashiroNitori/Anubis | anubis/util/domainjob.py | Python | gpl-3.0 | 765 |
"""
WSGI config for godown project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | sodhancha/Godown | godown/wsgi.py | Python | gpl-3.0 | 390 |
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError
MAP_INVOICE_TYPE_PARTNER_TYPE = {
'out_invoice': 'customer',
'out_refund': 'customer',
'in_invoice': 'supplier',
'in_refund': 'supplier',
}
# Since invoice amounts are unsigned, this ... | richard-willowit/odoo | addons/account/models/account_payment.py | Python | gpl-3.0 | 35,920 |
import discord
import re
import urllib.request
import xml.etree.ElementTree as ET
radio = {}
radioNames = {}
radioWhosPlaying = {}
radioNowPlaying = ''
playerStatus = 0
defaultChannel = ''
voice = ''
async def botWhatIsPlaying(client, message):
if playerStatus is 0:
await client.send_message(message.chann... | mephasor/mephaBot | addons/onlineRadio.py | Python | gpl-3.0 | 5,202 |
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 7 18:08:41 2011
@author: steven
"""
# word = 'banana'
# count = 0
# for letter in word:
# if letter == 'a':
# count = count + 1
# print count
# Rewrite this function so that instead of traversing the string, it uses the
# three-parameter version of find from ... | epequeno/ThinkPy-Solutions | ch08/8.06.py | Python | gpl-3.0 | 828 |
import urllib
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
@register.tag
def query_string(parser, token):
"""
Allows to manipulate the query string of a page by adding and removing keywords.
If a given value is a context variable it will resolve... | DigitalCampus/django-nurhi-oppia | oppia/templatetags/query_string.py | Python | gpl-3.0 | 2,788 |
##########################################################################
#This file is part of WTFramework.
#
# WTFramework 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 L... | LeXuZZ/localway_tests | wtframework/wtf/tests/test_config_reader.py | Python | gpl-3.0 | 3,596 |
import sys
import os
import pandas as pd
import multiprocessing as mp
import csv
# this code is written for the merged file with combined pval & fdr. although it could have been written for the file without comb fisher and fdr,
# it is easier to have the output with the comb pval and fdr and use what we need rather t... | richrr/scripts | python/merging-python-script.py | Python | gpl-3.0 | 5,595 |
from datetime import timedelta
from django.conf import settings
from django.core.management import BaseCommand, CommandError # noqa
from django.db.models.aggregates import Count
from django.utils import timezone
from crashmanager.models import CrashEntry, Bucket, Bug
class Command(BaseCommand):
help = "Cleanup... | MozillaSecurity/FuzzManager | server/crashmanager/management/commands/cleanup_old_crashes.py | Python | mpl-2.0 | 3,783 |
# 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 firefox_puppeteer import PuppeteerMixin
from firefox_puppeteer.errors import NoCertificateError
from marionette_har... | Yukarumya/Yukarum-Redfoxes | testing/firefox-ui/tests/puppeteer/test_security.py | Python | mpl-2.0 | 1,926 |
# 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/_/display.py | Python | agpl-3.0 | 1,654 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | rschnapka/odoo | addons/account_asset/account_asset.py | Python | agpl-3.0 | 29,456 |
from django import forms
from django.forms import fields
from phonenumbers import phonenumberutil, PhoneNumberType
from agir.lib.utils import front_url_lazy
from agir.system_pay.utils import get_trans_id_from_order_id, get_recurrence_rule
from .crypto import get_signature
class SystempayBaseForm(forms.Form):
for... | lafranceinsoumise/api-django | agir/system_pay/forms.py | Python | agpl-3.0 | 9,006 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
class HelperShift(models.Model):
"""
n-m relation between helper and shift.
This model then can be used by other apps to "attach" more data with OneToOne fields and signals.
The fields `present` and `manual_presence... | helfertool/helfertool | src/registration/models/helpershift.py | Python | agpl-3.0 | 1,614 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
def indicator_links(apps, schema_editor):
""" Migration generating foreign keys from indicators and indicator periods in child results
frameworks to parents of the same object type in the parent results framework
"""
Result = apps.get_... | akvo/akvo-rsr | akvo/rsr/migrations/0091_auto_20170208_1035.py | Python | agpl-3.0 | 2,382 |
from pylm.servers import Worker
from uuid import uuid4
import sys
class MyWorker(Worker):
def foo(self, message):
return self.name.encode('utf-8') + b' processed ' + message
server = MyWorker(str(uuid4()), 'tcp://127.0.0.1:5559')
if __name__ == '__main__':
server.start()
| nfqsolutions/pylm | examples/parallel/worker.py | Python | agpl-3.0 | 297 |
from mediawords.languages import SpaceSeparatedWordsMixIn, SentenceSplitterMixIn, PyStemmerMixIn, StopWordsFromFileMixIn
class DanishLanguage(SpaceSeparatedWordsMixIn, SentenceSplitterMixIn, PyStemmerMixIn, StopWordsFromFileMixIn):
"""Danish language support module."""
@staticmethod
def language_code() -... | berkmancenter/mediacloud | apps/common/src/python/mediawords/languages/da/__init__.py | Python | agpl-3.0 | 509 |
# -*- 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
import six
from django.core.exceptions import Validat... | suutari/shoop | shuup_tests/core/test_addresses.py | Python | agpl-3.0 | 5,067 |
from django.core.management.base import BaseCommand
from edx_solutions_api_integration.courseware_access import get_course_key
from openedx.core.djangoapps.course_groups.models import CourseUserGroup, CohortMembership
class Command(BaseCommand):
help = "Cohort fixation of specific courses"
def add_arguments... | edx-solutions/projects-edx-platform-extensions | edx_solutions_projects/management/commands/fix_existing_groups_cohorts.py | Python | agpl-3.0 | 2,252 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | dayatz/taiga-back | taiga/feedback/models.py | Python | agpl-3.0 | 1,747 |
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Teh Gladiators"
language = "en"
url = "http://www.tehgladiators.com/"
start_date = "2008-03-18"
rights = "Uros Jojic & Borislav Grabovic"
class... | jodal/comics | comics/comics/tehgladiators.py | Python | agpl-3.0 | 765 |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of fiware-cygnus (FI-WARE project).
#
# fiware-cygnus 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 Foun... | jmcanterafonseca/fiware-cygnus | test/acceptance/tools/mysql_utils.py | Python | agpl-3.0 | 7,640 |
# -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | lduarte1991/edx-platform | cms/envs/common.py | Python | agpl-3.0 | 49,179 |
"""Utility functions for sending slack messages"""
# Django
from django.conf import settings
def format_user(user):
"""Format a user for inclusion in a Slack notification"""
return "<%(url)s|%(name)s>" % {
"url": settings.MUCKROCK_URL + user.get_absolute_url(),
"name": user.profile.full_name,... | MuckRock/muckrock | muckrock/message/utils.py | Python | agpl-3.0 | 793 |
# -*- coding: utf-8 -*-
#
# license: AGPLv3, see LICENSE for details. In addition we strongly encourage
# you to buy us beer if we meet and you like the software.
"""Tests for studydocuments summaries."""
import json
from amivapi.tests.utils import WebTestNoAuth
class StudydocsSummaryTest(WebTestNoAuth):
... | amiv-eth/amivapi | amivapi/tests/studydocs/test_summary.py | Python | agpl-3.0 | 1,869 |
"""
Views related to operations on course objects
"""
import copy
import json
import logging
import random
import string # pylint: disable=deprecated-module
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.core.u... | longmen21/edx-platform | cms/djangoapps/contentstore/views/course.py | Python | agpl-3.0 | 71,331 |
"""
Utilities for view tests.
"""
from __future__ import absolute_import
import json
from contentstore.tests.utils import CourseTestCase
from contentstore.views.helpers import xblock_studio_url
from xmodule.modulestore.tests.factories import ItemFactory
class StudioPageTestCase(CourseTestCase):
"""
Base cl... | ESOedX/edx-platform | cms/djangoapps/contentstore/views/tests/utils.py | Python | agpl-3.0 | 3,337 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, 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.
import datetime
import pytest
from django.contrib.auth import get_user_mode... | akx/shoop | shoop_tests/admin/test_picotable.py | Python | agpl-3.0 | 4,680 |
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# Copyright 2022 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Employee Identification From Home Address",
"version": "8.0.1.1.0"... | open-synergy/opnsynid-hr | hr_employee_identification_from_home_address/__openerp__.py | Python | agpl-3.0 | 655 |
#################################################################################
#
# Copyright (c) 2013 Genome Research Ltd.
#
# Author: Irina Colgiu <ic4@sanger.ac.uk>
#
# 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 ... | wtsi-hgi/serapis | serapis/controller/logic/serapis_models.py | Python | agpl-3.0 | 13,059 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizations', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='logo',
field=models.ImageField(help_text='Pleas... | edx/edx-organizations | organizations/migrations/0002_auto_20170117_1434.py | Python | agpl-3.0 | 490 |
import pytest
from test.testexception import AuthenticationError, UnprocessableError
class TestDeviceQuery:
def test_query(self, helper):
admin_user = helper.admin_user()
clare = helper.given_new_user(self, "clare")
clares_group = helper.make_unique_group_name(self, "clares_group")
... | TheCacophonyProject/Full_Noise | test/test_device_query.py | Python | agpl-3.0 | 3,489 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Unit tests for ``octoprint.settings``.
"""
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2... | foosel/OctoPrint | tests/settings/__init__.py | Python | agpl-3.0 | 394 |
# -*- coding: utf-8 -*-
"""
Certificates are created for a student and an offering of a course.
When a certificate is generated, a unique ID is generated so that
the certificate can be verified later. The ID is a UUID4, so that
it can't be easily guessed and so that it is unique.
Certificates are generated in batches... | jazkarta/edx-platform-for-isc | lms/djangoapps/certificates/models.py | Python | agpl-3.0 | 17,158 |
"""
Models used by the block structure framework.
"""
from __future__ import absolute_import
import errno
from contextlib import contextmanager
from datetime import datetime
from logging import getLogger
import six
from six.moves import map
from django.conf import settings
from django.core.exceptions import Suspicio... | ESOedX/edx-platform | openedx/core/djangoapps/content/block_structure/models.py | Python | agpl-3.0 | 9,770 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'EmailShareStatistic'
db.create_table('statistic_emailsharestatistic', (
('... | ujdhesa/unisubs | apps/statistic/migrations/0001_initial.py | Python | agpl-3.0 | 10,707 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-06 22:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('journal', '0003_journal_version'),
]
operations = [
migrations.AddField(
... | etesync/journal-manager | journal/migrations/0004_journal_modified.py | Python | agpl-3.0 | 451 |
# import python.gau as gau
import fortran as fgau
import numpy as np
class GAU(object):
# The different versions and their respective inputs
inputs = {
# 'py0': ['WF', 'WS', 'WD', 'K'],
'fort_gau_av': ['x_g', 'y_g', 'z_g', 'dt', 'p_c', 'ct_c', 'ws', 'wd', 'ks','ng',
'av', 'rh... | rethore/FUSED-Wake | fusedwake/gau/__init__.py | Python | agpl-3.0 | 6,002 |
from django.contrib import admin
from django.forms import ModelForm
from django.urls import reverse
from .models import Ballot, LoggedAction, PartySet
class LoggedActionAdminForm(ModelForm):
pass
@admin.register(LoggedAction)
class LoggedActionAdmin(admin.ModelAdmin):
form = LoggedActionAdminForm
searc... | DemocracyClub/yournextrepresentative | ynr/apps/candidates/admin.py | Python | agpl-3.0 | 1,386 |
# -*- coding: utf-8 -*-
#
#
# Website Marketplace
# Copyright (C) 2014 Valeureux Group (<http://Valeureux.com>).
#
# 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 ve... | Valeureux/wezer-exchange | __unreviewed__/website_community_template/__openerp__.py | Python | agpl-3.0 | 1,583 |
"""
Fixture to create a course and course components (XBlocks).
"""
import datetime
import json
import mimetypes
from collections import namedtuple
from textwrap import dedent
from opaque_keys.edx.keys import CourseKey
from path import Path
from common.test.acceptance.fixtures import STUDIO_BASE_URL
from common.test... | jolyonb/edx-platform | common/test/acceptance/fixtures/course.py | Python | agpl-3.0 | 15,531 |
from django.core.management import call_command
import pytest
from ideascube.mediacenter.tests.factories import DocumentFactory
from taggit.models import Tag
pytestmark = pytest.mark.django_db
def test_count_should_count_usage(capsys):
DocumentFactory.create_batch(size=4, tags=['tag1'])
call_command('tags'... | ideascube/ideascube | ideascube/tests/test_tags_command.py | Python | agpl-3.0 | 4,017 |
# SPDX-FileCopyrightText: 2014, Mangaki Authors
# SPDX-License-Identifier: AGPL-3.0-only
from time import sleep
import json
from django.core.management.base import BaseCommand
from mangaki.wrappers.anilist import AniList
from mangaki.models import Work
MAX_ATTEMPTS = 5
BACKOFF_DELAY = 2
class Command(BaseCommand)... | mangaki/mangaki | mangaki/mangaki/management/commands/anilist_tags_to_json.py | Python | agpl-3.0 | 3,990 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-24 19:13
from __future__ import unicode_literals
from django.db import migrations
def add_theme(apps, schema_editor):
SessionTheme = apps.get_model('exams', 'SessionTheme')
SessionTheme.objects.get_or_create(name="Ocean",
... | Zahajamaan/Fudulbank | exams/migrations/0083_add_default_theme.py | Python | agpl-3.0 | 1,500 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.