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 |
|---|---|---|---|---|---|
from sympy.core import Basic, S, Function, diff, Tuple, Expr
from sympy.core.relational import Equality, Relational
from sympy.core.symbol import Dummy
from sympy.functions.elementary.miscellaneous import Max, Min
from sympy.logic.boolalg import And, Boolean, distribute_and_over_or, Not, Or
from sympy.core.compatibilit... | lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/functions/elementary/piecewise.py | Python | gpl-3.0 | 22,285 |
#
# Copyright 2003-2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | Gabotero/GNURadioNext | gnuradio-runtime/python/gnuradio/gr/tag_utils.py | Python | gpl-3.0 | 1,719 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Time-stamp: <2019-11-06 15:23:39 vk>
import logging
import os
import sys
import time
from orgformat import OrgFormat
from memacs.lib.memacs import Memacs
from memacs.lib.orgproperty import OrgProperties
class Commit(object):
"""
class for representing one co... | novoid/Memacs | memacs/git.py | Python | gpl-3.0 | 7,503 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# config.py
#
# Copyright 2013 Cinnarch
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your... | axaxs/Cnchi | src/config.py | Python | gpl-3.0 | 1,966 |
# -*- coding: utf-8 -*-
# Copyright (c) 2007 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the QMessageBox wizard plugin.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import QObject
from PyQt5.QtWidgets import QDialog
from E5Gui.E5Application import e5App
from E5Gui.... | paulmadore/Eric-IDE | 6-6.0.9/eric/Plugins/PluginWizardQMessageBox.py | Python | gpl-3.0 | 4,158 |
# -*- coding: cp936 -*-
import sys
default_encoding = 'utf-8'
if sys.getdefaultencoding() != default_encoding:
reload(sys)
sys.setdefaultencoding(default_encoding)
inf = open("F:/workspace/kancolle/log.txt",'r')
dahe=open("F:/workspace/kancolle/5-13-dahe.txt",'w')
dafeng=open("F:/workspace/kancolle/5-13-da... | misaki-nyanya/MyPieces | kancolle/buildCalc/run.py | Python | gpl-3.0 | 840 |
# Copyright (c) 2008-2009 Junior (Frederic) FLEURIAL MONFILS
#
# This file is part of PyAnalyzer.
#
# PyAnalyzer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | jffm/pyanalyzer | metrics/NumberOfReturns.py | Python | gpl-3.0 | 1,602 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, shutil, subprocess, glob
from setup import Command, __appname__, __versio... | yeyanchao/calibre | setup/publish.py | Python | gpl-3.0 | 3,819 |
"модуль із класом Core що включає в собі деякі методи комбінаторики, які використовуються в програмі"
import itertools
from math import factorial as fact
class Core:
# Методи-генератори комбінацій/перестановок
#perm = itertools.permutations # перестановки
comb = ite... | bodik10/Combinatorics | core.py | Python | gpl-3.0 | 3,143 |
import gtk
import os
import gobject
import class_subject
import upgrade
import database
import dbconfig
import subjects
from share import share
from helpers import get_builder, comboInsertItems
config = share.config
class Setting(gobject.GObject):
def __init__(self):
gobject.GObject.__init__(self)
... | AhmadHamzeei/Amir-Accounting | amir/setting.py | Python | gpl-3.0 | 27,685 |
"""
arc - dead simple chat
Copyright (C) 2017 Jewel Mahanta <jewelmahanta@gmail.com>
This file is part of arc.
arc 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 opt... | lap00zza/arc | api_server/arc_api/snowflake.py | Python | gpl-3.0 | 2,140 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-11 03:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('bill', '0001_initial'),
]
... | Yellowpal/django | life/bill/migrations/0002_auto_20161111_1113.py | Python | gpl-3.0 | 1,237 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2020 Richard Li <richard.li@ces.hk>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Lice... | DreamSourceLab/DSView | libsigrokdecode4DSL/decoders/a7105/pd.py | Python | gpl-3.0 | 12,297 |
from django.urls import reverse
from oppia.test import OppiaTestCase
class CompletionRatesViewTest(OppiaTestCase):
fixtures = ['tests/test_user.json',
'tests/test_oppia.json',
'tests/test_quiz.json',
'tests/test_permissions.json',
'tests/test_cohort.... | DigitalCampus/django-oppia | tests/reports/views/test_completion_rates.py | Python | gpl-3.0 | 1,385 |
"""Users tests."""
from django.contrib.auth import get_user_model, authenticate
from django.test import TestCase
from django.test import RequestFactory
from tests.utils import ModelTestCase
from users.factory import UserFactory
User = get_user_model()
class EmailAuthenticationTest(TestCase):
"""Tests to make s... | oser-cs/oser-website | tests/test_users/test_user.py | Python | gpl-3.0 | 2,826 |
import logging
from emitter import Send
"""
log.io logging handler
======================
Handler for the python logging framework for log.io stateless TCP API
http://logio.org/
Usage:
::
from log_io_handler import LogIOHandler
Logger.addHandler(LogIOHandler)
#or dict_config
'handlers'
'log_io': {
... | Level-Up/python_log_io | log_io_handler/__init__.py | Python | gpl-3.0 | 1,702 |
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2014 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Gene... | getting-things-gnome/gtg | tests/core/test_search_filter.py | Python | gpl-3.0 | 9,498 |
# -*- coding: utf-8 -*-
"""
Éditeur de Spyder
Ce script temporaire est sauvegardé ici :
/home/poppy/.spyder2/.temp.py
"""
# bibliothèques nécessaires au fonctionnement de Poppy humanoide
import pypot
from poppy.creatures import PoppyHumanoid
import kinematics as kin
# démmarrer la simulation poppy dans vrep. Il f... | cjlux/Poppy-ENSAM-Talence | Environnement_programmation/Codes Xavier Mariot/codes test.py | Python | gpl-3.0 | 1,215 |
#!/usr/bin/python3
import sys
def process_import(filename, statement):
statement = statement.replace(",", " ")
modules = statement.split()
for module in modules[1:]:
print('"%s" -> "%s"' % (filename, module))
def process_from(filename, statement):
statement = statement.replace(",", " ")
m... | WeCase/WeCase | utils/depgraph.py | Python | gpl-3.0 | 898 |
from distutils.core import setup
setup(
name = 'ml_easy_peer_grade',
packages = ['ml_easy_peer_grade'],
version = '0.18',
scripts=['bin/ml_easy_peer_grade'],
description = 'Ez peer grade your project members, exclusive to privileged Bilkent students',
author = 'Cuklahan Dorum',
author_email = 'badass@alu... | cagdass/ml-easy-peer-grade | setup.py | Python | gpl-3.0 | 525 |
# -*- encoding: utf-8 -*-
# pilas engine - a video game framework.
#
# copyright 2010 - hugo ruscitti
# license: lgplv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# website - http://www.pilas-engine.com.ar
import pilas
from pilas import colores
try:
import Box2D as box2d
except ImportError:
print "No esta... | cristian99garcia/pilas-activity | pilas/fisica.py | Python | gpl-3.0 | 14,319 |
#========================================================================
#GECCO - Generic Enviroment for Context-Aware Correction of Orthography
# Maarten van Gompel, Wessel Stoop, Antal van den Bosch
# Centre for Language and Speech Technology
# Radboud University Nijmegen
#
# Sponsored by Revisely (http://revise.ly)... | proycon/gecco | gecco/modules/spacing.py | Python | gpl-3.0 | 10,310 |
from vsg import token
from vsg.rules import token_suffix
lTokens = []
lTokens.append(token.package_declaration.identifier)
lTokens.append(token.package_declaration.end_package_simple_name)
class rule_016(token_suffix):
'''
This rule checks for valid suffixes on package identifiers.
The default package ... | jeremiah-c-leary/vhdl-style-guide | vsg/rules/package/rule_016.py | Python | gpl-3.0 | 649 |
#!/usr/bin/python
import sys
import os
import getopt
from textwrap import wrap
def main():
params = parseArgs()
if params.many2one:
seqs=dict()
for f in read_fasta(params.many2one):
seqs[f[0]] = f[1]
write_fasta(params.out, seqs)
elif params.one2many:
seqs=dict()
for f in read_fasta(params.one2many)... | tkchafin/scripts | fastaFormatter.py | Python | gpl-3.0 | 3,828 |
# shtub - shell command stub
# Copyright (C) 2012-2013 Immobilien Scout GmbH
#
# 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) ... | yadt/shtub | src/unittest/python/commandinput_tests.py | Python | gpl-3.0 | 8,253 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | muravjov/ansible | lib/ansible/utils/__init__.py | Python | gpl-3.0 | 60,718 |
from dataclasses import dataclass
from enum import unique, Enum
from typing import Iterator
from frozendict import frozendict
from randovania.game_description.requirements import Requirement
@unique
class DockLockType(Enum):
FRONT_ALWAYS_BACK_FREE = 0
FRONT_BLAST_BACK_FREE_UNLOCK = 1
FRONT_BLAST_BACK_BL... | henriquegemignani/randovania | randovania/game_description/world/dock.py | Python | gpl-3.0 | 1,738 |
#
# Copyright (C) 2014 Alexandre Viau <alexandre@alexandreviau.net>
#
# This file is part of python-pass.
#
# python-pass 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 ... | aviau/python-pass | pypass/command.py | Python | gpl-3.0 | 13,445 |
from django.contrib.auth.models import Group, User
from rest_framework import serializers
from delft3dworker.models import Scenario, Scene, SearchForm, Template, Version_Docker
class VersionSerializer(serializers.ModelSerializer):
"""
A default REST Framework ModelSerializer for the Version_Docker model
... | openearth/delft3d-gt-server | delft3dworker/serializers.py | Python | gpl-3.0 | 5,793 |
import re
import lib.slack.config as config
import lib.slack.util as util
def nick_tracker(log_dict):
"""
Tracks all nicks and the identifies nicks which point to same user
Args:
log_dict(dictionary): with key as dateTime.date object and value as {"data":datalist,"channel_name":channels name... | prasadtalasila/IRCLogParser | lib/slack/nickTracker.py | Python | gpl-3.0 | 2,925 |
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import warnings
from flask_wtf import Form
from wtforms import TextField, IntegerField, SelectField, validators
from werkzeug import redirect, abort
from jinja2 import Template... | PritishC/nereid | trytond_nereid/party.py | Python | gpl-3.0 | 12,239 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010 Romain Bignon
#
# 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, version 3 of the License.
#
# This program is distributed in the hope that it will b... | jocelynj/weboob | weboob/applications/webcontentedit/webcontentedit.py | Python | gpl-3.0 | 3,817 |
#! /usr/bin/env python
import vcsn
from test import *
algos = ['distance', 'inplace', 'separate']
# check INPUT EXP ALGORITHM
# -------------------------
def check_algo(i, o, algo):
i = vcsn.automaton(i)
o = vcsn.automaton(o)
print("using algorithm: ", algo)
print("checking proper")
# We call sort().stri... | pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | tests/python/proper.py | Python | gpl-3.0 | 11,408 |
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_A_SUBJECT_D003025').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.... | cysuncn/python | spark/crm/PROC_A_SUBJECT_D003025.py | Python | gpl-3.0 | 2,560 |
# -*- coding: utf-8 -*-
"""
Copyright © 2017 - Alexandre Machado <axmachado@gmail.com>
This file is part of Simple POS Compiler.
Simnple POS Compiler 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 Found... | axmachado/simplepos | simplepos/codegen/boolean.py | Python | gpl-3.0 | 15,374 |
import pandas as pd
from syscore.algos import calculate_weighted_average_with_nans
from syscore.genutils import str2Bool
from syscore.dateutils import ROOT_BDAYS_INYEAR
from syscore.pdutils import turnover
from sysquant.estimators.turnover import turnoverDataForTradingRule
from systems.system_cache import diagnostic... | robcarver17/pysystemtrade | systems/accounts/account_costs.py | Python | gpl-3.0 | 12,395 |
#!/usr/bin/python3
from sockets import Socket
sck = Socket()
while(1):
cmd = input(" >> ")
sck.send(cmd)
data = sck.recv()
print(" >>> Server: \n{}".format(data))
| AlessandroSpallina/JASM | testclient/cli.py | Python | gpl-3.0 | 183 |
#!/usr/bin/env python
from __future__ import division
import krpc
import vlc
import time
import random
import yaml
import os
import socket
import math
import logging
import sys
from collections import deque
import argparse
class Player(object):
def __init__(self, path, preload=True):
self.instance = vlc.In... | FenixFeather/ksp-music-hack | music_hack.py | Python | gpl-3.0 | 12,698 |
import numpy as np
def speak_to_me(model, csxframe, stochastic=False, ngrams=50):
pred = csxframe.primer()
human = csxframe.translate(pred)
chain = "[{}]".format("".join(human))
for _ in range(ngrams):
inputs = pred[:, -(csxframe.timestep - 1):, :]
nextpred = model.feedforward(inputs)
... | csxeba/brainforge | brainforge/util/rnn_util.py | Python | gpl-3.0 | 978 |
# grid.py
#
# Copyright 2009 danc <quaninux@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 2 of the License, or
# (at... | badbytes/pymeg | meg/grid.py | Python | gpl-3.0 | 2,412 |
#!/usr/bin/python3
#
# Polychromatic is licensed under the GPLv3.
# Copyright (C) 2020-2021 Luke Horwell <code@horwell.me>
#
"""
This module controls the 'Preferences' window of the Controller GUI.
"""
from .. import common
from .. import effects
from .. import locales
from .. import middleman
from .. import procpid
f... | lah7/polychromatic | pylib/controller/preferences.py | Python | gpl-3.0 | 23,790 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2020 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 the h... | chipaca/snapcraft | snapcraft/internal/db/datastore.py | Python | gpl-3.0 | 4,171 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/krl1to5/Work/FULL/Sequence-ToolKit/2016/resources/ui/genrep/dialogs/apply_this_to.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
c... | carlos-ferras/Sequence-ToolKit | view/genrep/dialogs/ui_apply_this_to.py | Python | gpl-3.0 | 11,221 |
#!/usr/bin/python
# Copyright (C) 2013 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
import urwid
import os
from example1 import palette # example data
from widgets import TreeBox
from tree import Tree
from decoration import CollapsibleArrowTree
... | audebert/alot | alot/foreign/urwidtrees/example4.filesystem.py | Python | gpl-3.0 | 4,462 |
import sys
folder_loc = sys.argv[1]
filename =sys.argv[2]
fileobj = open(folder_loc + filename);
flag=0
real_rev = open(folder_loc + "real_"+filename,"w+")
fake_rev = open(folder_loc + "fake_"+filename,"w+")
for line in fileobj:
for i in range(len(line)):
if (line[i] == '[' and flag == 0): #fo... | JoshuaEbenezer/SNLP-reviews | SNLP/src/read_file.py | Python | gpl-3.0 | 795 |
import logging
logger = logging.getLogger('sci-wms')
__version__ = '1.0.0'
| ayan-usgs/sci-wms | sciwms/__init__.py | Python | gpl-3.0 | 76 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Osmo Salomaa
#
# 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 pr... | otsaloma/poor-maps | guides/foursquare.py | Python | gpl-3.0 | 4,437 |
#!/usr/bin/env python
# wikid, Copyright (c) 2010, R. P. Dillon <rpdillon@etherplex.org>
# This file is part of wikid.
#
# wikid 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... | rpdillon/wikid | wikid/wikid.py | Python | gpl-3.0 | 13,569 |
from scapy.layers.inet import IP
from scapy.layers.l2 import GRE_PPTP
from scapy.automaton import Automaton, ATMT
from scapy.packet import NoPayload
from scapy.config import conf
class GREPPTPConnection(Automaton):
def __init__(self, *args, **kargs):
self.last_seq_received = None
Automaton.__init... | jsebechlebsky/pptp_auditor | scapy_pptp/gre.py | Python | gpl-3.0 | 3,166 |
#!/usr/bin/python
###################################
# Author: Julien Peloton, j.peloton@sussex.ac.uk
# Pointing module: thanks Neil Goeckner-Wald!
###################################
import ConfigParser
import sys
import ephem
import copy
import os
import numpy as np
import healpy as hp
from . import util_CMB
from .... | JulienPeloton/LaFabrique | LaFabrique/scanning_strategy.py | Python | gpl-3.0 | 20,922 |
#!/usr/bin/env python
__author__ = 'Bart Otten'
__copyright__ = 'Copyright 2014, Threatrecon Project'
__credits__ = []
__license__ = 'GPL'
__version__ = '0.1'
__maintainer__ = 'Bart Otten'
__email__ = 'bartotten@gmail.com'
__status__ = 'Development'
__all__ = [
'entities'
] | Bart-o/ThreatRecon | src/threatrecon/transforms/common/__init__.py | Python | gpl-3.0 | 281 |
#!/usr/bin/env python
'''
Solves Constrainted Toy Problem Storing Optimization History.
min x1^2 + x2^2
s.t.: 3 - x1 <= 0
2 - x2 <= 0
-10 <= x1 <= 10
-10 <= x2 <= 10
'''
# =============================================================================
# Standard Python modules
# ===========================... | hschilling/pyOpt | examples/history.py | Python | gpl-3.0 | 1,731 |
from Stimulant import *
import pandas as pd
class Cell(object):
"""docstring for Cell"""
def __init__(self):
self.stimulants = {}
self.stimulant = Stimulant()
self.p1 = Point()
self.p2 = Point()
self.p1.x = 0
self.p1.y = 0
self.p2.x = 0
self.... | iamgp/pyCa | pyCa/Cell.py | Python | gpl-3.0 | 1,577 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "strecklista.settings.production")
application = get_wsgi_application()
| Majsvaffla/strecklista | strecklista/wsgi.py | Python | gpl-3.0 | 183 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
def _l10n_ar_prices_and_taxes(self):
self.ensure_one()
invoice = self.move_id
included_taxes = self.tax_ids.filtered(... | jeremiahyan/odoo | addons/l10n_ar/models/account_move_line.py | Python | gpl-3.0 | 1,367 |
#from vsg.vhdlFile import utils
from vsg.vhdlFile.classify import assertion_statement
from vsg.vhdlFile.classify import case_statement
from vsg.vhdlFile.classify import exit_statement
from vsg.vhdlFile.classify import if_statement
from vsg.vhdlFile.classify import loop_statement
from vsg.vhdlFile.classify import next... | jeremiah-c-leary/vhdl-style-guide | vsg/vhdlFile/classify/sequential_statement.py | Python | gpl-3.0 | 3,197 |
from django.conf.urls import url
from flashcards.views import main, new_quiz
urlpatterns = [
url(r'^$', main),
url(r'^api/new_quiz$', new_quiz),
]
| domino14/Webolith | djAerolith/flashcards/urls.py | Python | gpl-3.0 | 157 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | shaggytwodope/qutebrowser | tests/end2end/features/test_prompts_bdd.py | Python | gpl-3.0 | 1,715 |
# MaxCalester Program - Chipotle
# Developed By: Andy Han
# Data Provided By: Ibrahima Dieye and Lang Li
# April 26th, 2017
# Macalester College
# COMP 221 - Algorithm Design and Analysis
# Questions? Contact us at dhan@macalester.edu
import csv
chipotle_best_combo = {}
chipotle_best_combo_price_calorie... | greenteaphd/MaxCalester | MaxCalesterChipotleGreedy.py | Python | gpl-3.0 | 5,182 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^new', views.add_post_form, name='add'),
url(r'^post/(?P<slug>[\w-]+)/$', views.post_view, name='post'),
]
| CallMeMhz/megablog | src/blog/urls.py | Python | gpl-3.0 | 235 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import paramiko
import threading
import sys
import re
import time
import os
def start_shell(h, u, p):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(h, 22, u, p)
s = ssh.invoke_shell()
w = threading.Th... | fangdingjun/example1 | python/ssh_c.py | Python | gpl-3.0 | 1,479 |
"""
WSGI config for elixirapp 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, sys
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | bio-tools/biotoolsregistry | backend/elixirapp/wsgi.py | Python | gpl-3.0 | 487 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2017-03-08 02:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userlinks', '0003_auto_20170203_1130'),
]
operations = [
migrations.AlterFie... | cgthayer/test | django-userlinks/userlinks/migrations/0004_auto_20170307_1838.py | Python | gpl-3.0 | 562 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | mekanix/geonode | geonode/base/management/commands/restore.py | Python | gpl-3.0 | 15,906 |
# -*- coding: utf-8 -*-
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from .models import *
@login_required
def inicio(request):
if not request.user.perfil.es_joven and not request.user.is_superuser:
return redirect('mesa:inicio')
if request.POS... | corumcorp/redsentir | redsentir/lineatiempo/views.py | Python | gpl-3.0 | 2,842 |
#!/usr/bin/env python2
import wx
import time
TRAY_TOOLTIP = 'Personal Legend'
TRAY_ICONS = {
'main': 'icon-main.png',
'c1': 'icon-1card.png',
'c2': 'icon-2cards.png',
'c3': 'icon-3cards.png',
'timer': 'icon-zero.png'
}
TRAY_TIMER = 30 * 60
def create_menu_item(menu, label, func):
item = wx.Me... | carlisson/legend | legend.py | Python | gpl-3.0 | 2,150 |
#!/usr/bin/env python
# This is a demonstration of how to compute S2 order parameters from bond vector correlation functions.
# The S2 estimation is done with the method described in:
# Trbovic et al. Proteins (2008). doi:10.1002/prot.21750
from __future__ import print_function, division
import sys, os, glob
import M... | schilli/MOPS | MOPS/demo/demo_mean.py | Python | gpl-3.0 | 1,694 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_compare, float_is_zero
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
sale_line_ids = ... | jeremiahyan/odoo | addons/sale/models/account_move_line.py | Python | gpl-3.0 | 11,377 |
#!/home/mharris/Projects/DevOpsDays/venv/bin/python2
# $Id: rst2pseudoxml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing pseudo-XML.
"""
try:
import loc... | morissette/devopsdays-hackathon-2016 | venv/bin/rst2pseudoxml.py | Python | gpl-3.0 | 635 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'new_world.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjec... | lsommerer/worms | ui_new_world_dialog.py | Python | gpl-3.0 | 6,133 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-28 13:41
# flake8: noqa
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import normandy.recipes.validators
class Migration(mi... | Osmose/normandy | recipe-server/normandy/recipes/migrations/0034_recipe_revisions.py | Python | mpl-2.0 | 3,780 |
from functools import wraps
def mentioned(bot_command):
"""Only execute the decorated bot command if the bot was mentioned."""
@wraps(bot_command)
def _func(bot, message, *args, **kwargs):
if bot.mentioned(message):
return bot_command(bot, message, *args, **kwargs)
return _func
d... | SpiderOak/flowbot | src/decorators.py | Python | mpl-2.0 | 1,211 |
import os.path
from typing import *
from click import Context, get_current_context
from pros.common import ui
from pros.common.ui.interactive import application, components, parameters
from pros.conductor import Conductor
from .parameters import NonExistentProjectParameter
class NewProjectModal(application.Modal[No... | purduesigbots/pros-cli | pros/conductor/interactive/NewProjectModal.py | Python | mpl-2.0 | 2,998 |
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | bheesham/servo | python/servo/bootstrap_commands.py | Python | mpl-2.0 | 12,893 |
from autopush.tests import setUp, tearDown
def pytest_configure(config):
"""Called before testing begins"""
setUp()
def pytest_unconfigure(config):
"""Called after all tests run and warnings displayed"""
tearDown()
| mozilla-services/autopush | autopush/tests/conftest.py | Python | mpl-2.0 | 235 |
# 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/.
from django import forms
from lib.l10n_utils.dotlang import _, _lazy
from bedrock.mozorg.forms import... | mmmavis/lightbeam-bedrock-website | bedrock/legal/forms.py | Python | mpl-2.0 | 4,294 |
# encoding: 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | klahnakoski/jx-sqlite | jx_sqlite/expressions/unix_op.py | Python | mpl-2.0 | 696 |
#!/usr/bin/env python
# coding=utf-8
"""Test scriptworker.utils
"""
import asyncio
import os
import re
import shutil
import tempfile
import time
import mock
import pytest
import scriptworker.utils as utils
from scriptworker.exceptions import Download404, DownloadError, ScriptWorkerException, ScriptWorkerRetryExceptio... | mozilla-releng/scriptworker | tests/test_utils.py | Python | mpl-2.0 | 23,947 |
"""
Deployment for Bedrock in production.
Requires commander (https://github.com/oremj/commander) which is installed on
the systems that need it.
"""
import os
import random
import re
import urllib
import urllib2
from commander.deploy import commands, task, hostgroups
import commander_settings as settings
NEW_RELI... | waseem18/bedrock | bin/update/deploy_base.py | Python | mpl-2.0 | 5,260 |
import datetime
from nose.tools import eq_, ok_
from django.conf import settings
from django.test import TestCase
from crashstats.crashstats import forms
class TestForms(TestCase):
def setUp(self):
# Mocking models needed for form validation
self.current_products = {
'Firefox': [],
... | AdrianGaudebert/socorro-crashstats | crashstats/crashstats/tests/test_forms.py | Python | mpl-2.0 | 12,838 |
"""Provides the options command."""
from functools import partial
from gsb.intercept import Menu
from forms import set_value
from parsers import parser
from options import options
from util import done
def show_section(section, caller):
"""Show the player an instance of OptionsMenu."""
caller.con... | chrisnorman7/game | commands/options.py | Python | mpl-2.0 | 2,845 |
#coding:utf-8
from setuptools import setup, find_packages
setup(
name='f42',
version="0.1.3",
description="Some common use functions",
author="Lerry",
author_email="lvdachao@gmail.com",
packages = ['f42'],
zip_safe=False,
include_package_data=True,
install_requires = [
],
... | noman798/dcny | lib/f42/setup.py | Python | mpl-2.0 | 368 |
SECRET_KEY = 'asdf'
DATABASES = {
'default': {
'NAME': 'test.db',
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.staticfiles',
'revproxy',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sess... | TracyWebTech/django-revproxy | tests/settings.py | Python | mpl-2.0 | 1,241 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from mock import patch, Mock
from datetime import date, timedelta
from django.conf import settings
from django.utils.six.moves.urllib_parse import urljoin
from nose.plugins.attrib import attr
from django_webtest import WebTest
from candidates.tests.f... | neavouli/yournextrepresentative | candidates/tests/test_upcoming_elections_api.py | Python | agpl-3.0 | 5,501 |
def loop():
a = [0]*10000
for i in range(10000):
a[i] = 2*3 + 45
print(a)
loop()
| magnusmorton/nest | test_files/simple.py | Python | agpl-3.0 | 103 |
# -*- coding: utf-8 -*-
# Copyright 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
from openerp.tools.translate import _
from openerp.exceptions import Warning as UserError
class ResPartner(models.Model):
_inherit = "res.partner"... | open-synergy/opnsynid-partner-contact | partner_single_sale_risk_policy/models/res_partner.py | Python | agpl-3.0 | 2,591 |
# -*- 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.core.urlresolvers import reverse
from s... | suutari/shoop | shuup_tests/admin/test_home.py | Python | agpl-3.0 | 3,871 |
# Copyright 2017 onwards LabsLand Experimentia S.L.
# This software is licensed under the GNU AGPL v3:
# GNU Affero General Public License version 3 (see the file LICENSE)
# Read in the documentation about the license
from __future__ import unicode_literals, print_function, division
from .redis_manager import RedisMa... | weblabdeusto/weblablib | weblablib/backends/__init__.py | Python | agpl-3.0 | 326 |
# -*- coding: utf-8 -*-
##############################################################################
#
# 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 L... | odoo-arg/odoo_l10n_ar | l10n_ar_account_check_sale/wizard/__init__.py | Python | agpl-3.0 | 964 |
# -*- coding: utf-8 -*-
#
# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for
# more information about the licensing of this file.
""" Displyable problems """
import gettext
import json
from abc import ABCMeta, abstractmethod
from random import Random
from inginious.common.tasks_problems i... | UCL-INGI/INGInious | inginious/frontend/task_problems.py | Python | agpl-3.0 | 9,078 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | florian-dacosta/stock-logistics-warehouse | stock_reserve/__openerp__.py | Python | agpl-3.0 | 2,185 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 opt... | laurent-george/weboob | modules/feedly/browser.py | Python | agpl-3.0 | 4,193 |
# -*- coding: utf-8 -*-
__author__ = 'Pulimootil'
"""
This class will handle all the file related operations
"""
import os
import cv2
class FileOperatoins(object):
def __init__(self, filename, xmlFile):
self.checkFile(filename, xmlFile)
''' Set the output folder '''
def setOutput(self, outpu... | Audiveris/omr-dataset-tools | tools/addNoise/FileOperations.py | Python | agpl-3.0 | 2,085 |
""" Initialization code related to Commotion Router UI unit tests"""
| opentechinstitute/commotion-router-test-suite | tests/__init__.py | Python | agpl-3.0 | 69 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Markus Schneider
# Copyright 2014 initOS GmbH & Co. KG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
... | vitasoa/OpenERP-7.0-Magento | magentoerpconnect_options_active/__openerp__.py | Python | agpl-3.0 | 1,388 |
# This example runs the same momentum play as the first sample
# (https://www.quantopian.com/help#sample-basic), but this time it uses more
# securities during the backtest.
# Important note: All securities in an algorithm must be traded for the
# entire length of the backtest. For instance, if you try to backtest bo... | mequanta/z-runner | examples/quanto/multiple_security_example.py | Python | agpl-3.0 | 2,391 |
# Copyright (C) 2021 Sebastian Pipping <sebastian@pipping.org>
# Licensed under GNU Affero GPL v3 or later
from django.utils.timezone import now
from factory import LazyFunction, Sequence
from factory.django import DjangoModelFactory
from ..models import DebianLogIndex, DebianLogMods, DebianPopcon, DebianWnpp, IssueK... | hartwork/wnpp.debian.net | wnpp_debian_net/tests/factories.py | Python | agpl-3.0 | 984 |
import functools
import threading
from concurrent.futures import ThreadPoolExecutor
import traceback
NUMBER_OF_THREADS = 100
def unique_step(parallel, numer_of_threads=NUMBER_OF_THREADS):
"""Shorten the call for calling a function after the other is completed.
@serial_step
def get(self, url):... | niccokunzmann/first_timer_scraper | first_timer_scraper/concurrency.py | Python | agpl-3.0 | 1,783 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2012 Camptocamp (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Vincent Renaville (Camptocamp)
#
# This program is free software: you can redistribute it and/or modify
# it under ... | savoirfairelinux/account-financial-tools | account_cancel_invoice_check_voucher/account_invoice.py | Python | agpl-3.0 | 2,758 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggi... | vied12/superdesk | server/apps/archive/archive_media.py | Python | agpl-3.0 | 3,616 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.