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 |
|---|---|---|---|---|---|
# Copyright (C) 2017 Roman Samoilenko <ttahabatt@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) any later version.
# This pr... | johnnykv/heralding | heralding/capabilities/ssh.py | Python | gpl-3.0 | 3,627 |
"""checker for unnecessary indexing in a loop.
"""
from typing import List, Optional, Tuple, Union
import astroid
from astroid import nodes
from pylint.checkers import BaseChecker
from pylint.checkers.utils import check_messages
from pylint.interfaces import IAstroidChecker
class UnnecessaryIndexingChecker(BaseCheck... | pyta-uoft/pyta | python_ta/checkers/unnecessary_indexing_checker.py | Python | gpl-3.0 | 5,590 |
#! /usr/bin/env python
import os
import argparse
from pymsbayes.fileio import expand_path
from pymsbayes.config import MsBayesConfig
from pymsbayes.utils.functions import is_file, is_dir, is_executable
class SmartHelpFormatter(argparse.HelpFormatter):
'''
A class to allow customizable line breaks for an argu... | joaks1/PyMsBayes | pymsbayes/utils/argparse_utils.py | Python | gpl-3.0 | 4,193 |
/*
* stereographic projection
*
* Copyright 2010 dan collins <danc@badbytes.net>
*
* 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... | badbytes/pymeg | meg/stereographicprojection.py | Python | gpl-3.0 | 1,056 |
#!/usr/bin/env python
import asyncio
import json
from bson import json_util
from pymongo import MongoClient
from .search import Query
from .crawl import Spider
class ClientSpider(Spider):
"""
Indexes the client website and saves all pages to a mongodb collection
"""
def __init__(self, client):
... | apt-helion/viperidae | api/developer.py | Python | gpl-3.0 | 1,525 |
# -*- coding: utf-8 -*-
# * Authors:
# * TJEBBES Gaston <g.t@majerti.fr>
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
import os
from autonomie.models.user.userdatas import (
ZoneOption,
ZoneQualificationOption,
StudyLevelOption,
SocialStatusOption,
Activit... | CroissanceCommune/autonomie | autonomie/views/admin/userdatas/options.py | Python | gpl-3.0 | 1,533 |
# -*- coding: utf8 -*-
"""Configuration params for sherlock."""
import os
basedir = os.path.abspath(os.path.dirname(__file__))
CORS_HEADER = 'Content-Type'
TOKEN_TIMEOUT = 9999
SECRET_KEY = os.urandom(25)
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_TRACK_MODIFICATIONS = True
| leoGalani/sherlock | config.py | Python | gpl-3.0 | 309 |
# #############################################################################
#
# buckshot.py - given a set of numbers and a marker name, make sarsoft markers
# corresponding to all three lat-lon coordinate systems
#
#
# developed for Nevada County Sheriff's Search and Rescue
# Copyright (c) 2015 Tom Grundy
#... | ncssar/buckshot | buckshot.py | Python | gpl-3.0 | 30,547 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-01-09 11:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tmv_app', '0072_runstats_dyn_win_threshold'),
]
operations = [
migrations.A... | mcallaghan/tmv | BasicBrowser/tmv_app/migrations/0073_auto_20180109_1124.py | Python | gpl-3.0 | 471 |
# smallest number 2^500500 divisors , modulo 500500507
# 单调递减
# (2^a0)(2^a1)(2^a2) = 2^500500
# (2^ai)(2^aj) -> (2^{ai-1})(2^{aj+1}) : p_j^(2^{aj})/p_i^(2^{ai-1}) < 1 , (a > b)
# (2^aj)ln(p_j) < (2^{ai-1})ln(p_i)
# if 2^{a_i-a_j-1} > ln(p_j)/ln(p_i), then a_i-=1,a_j-=1
#
# i < j
# p_j^(2^(a_j-1)) < p_i^(2^a_i)
# p_i^(2... | CroMarmot/MyOICode | ProjectEuler/unsolved/p500.py | Python | gpl-3.0 | 3,132 |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 29 18:02:06 2015
"""
#####################################################################################################
# Groupe d'Étude pour la Traduction/le Traitement Automatique des Langues et de la Parole (GETALP)
# Homepage: http://getalp.imag.fr
#
# Author: Tien... | besacier/WCE-LIG | wce_system/preprocessing/measure_performance_system.py | Python | gpl-3.0 | 3,171 |
from setuptools import setup
setup(name="waterworks",
version="0.0.0",
description="Message agregation daemon.",
url="https://github.com/Aeva/waterworks",
author="Aeva Palecek",
author_email="aeva.ntsc@gmail.com",
license="GPLv3",
packages=["waterworks"],
zip_safe=False,... | Aeva/waterworks | setup.py | Python | gpl-3.0 | 508 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def invertTree(self, root):
"""
:type root: TreeNode
:rtype: TreeNode
"""
if not ... | zqfan/leetcode | algorithms/226. Invert Binary Tree/solution.py | Python | gpl-3.0 | 490 |
# Copyright (C) 2011 Pierre de Buyl
# This file is part of pyMPCD
# pyMPCD 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.
# pyMPCD ... | pdebuyl/pyMPCD | pyMPCD/MPCD.py | Python | gpl-3.0 | 21,970 |
# -*- test-case-name: twisted.web.test.test_web -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.static}.
"""
import os, re, StringIO
from zope.interface.verify import verifyObject
from twisted.internet import abstract, interfaces
from twisted.python.... | Donkyhotay/MoonPy | twisted/web/test/test_static.py | Python | gpl-3.0 | 53,951 |
"""
============================
``ctypes`` Utility Functions
============================
See Also
---------
load_library : Load a C library.
ndpointer : Array restype/argtype with verification.
as_ctypes : Create a ctypes array from an ndarray.
as_array : Create an ndarray from a ctypes array.
References
----------... | ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/numpy/ctypeslib.py | Python | gpl-3.0 | 14,076 |
'''
TypeString is a core class that extends mimetypes
'''
import re
import os
import mimetypes
import magic
UNKNOWN_MIMETYPE = ('application/x-empty', 'application/octet-stream', 'text/plain')
class TypeString:
def __init__(self, s):
self.str = s
# Extract arguments
if ':' in s:
... | michaelpb/omnithumb | omnithumb/types/typestring.py | Python | gpl-3.0 | 2,012 |
#!/usr/bin/env python
# encoding: utf-8
from lewei import Cloud as lewei
CLOUDS = {
"lewei": lewei,
} | jt6562/mytvoc | clouds/__init__.py | Python | gpl-3.0 | 110 |
# -*- coding: utf-8 -*-
# home made test
# Sign convention for fiber sections.
from __future__ import division
import xc_base
import geom
import xc
from solution import predefined_solutions
from model import predefined_spaces
from materials import typical_materials
from postprocess import prop_statistics
import math
... | lcpt/xc | verif/tests/materials/fiber_section/test_fiber_section_sign_convention01.py | Python | gpl-3.0 | 7,833 |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from actionlib/TestRequestActionGoal.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import actionlib.msg
import genpy
import actionlib_msgs.msg
import std_msgs.msg
class... | UnbDroid/robomagellan | Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/actionlib/msg/_TestRequestActionGoal.py | Python | gpl-3.0 | 12,401 |
#
# Copyright (C) 2018, 2020
# Smithsonian Astrophysical Observatory
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any ... | cxcsds/ciao-contrib | ciao_contrib/downloadutils.py | Python | gpl-3.0 | 22,858 |
# coding=utf-8
import random
def consumer():
r = None
while 1:
data = yield r
print 'Consuming: {}'.format(data)
r = data + 1
def producer(consumer):
n = 3
consumer.send(None)
while n:
data = random.choice(range(10))
print('Producing: {}'.format(data))
... | dongweiming/web_develop | chapter13/section5/use_yield.py | Python | gpl-3.0 | 462 |
import unittest
from decimal import Decimal
from itertools import product
from .riemann import riemann_sum as riemann, RiemannMethod
# Test functions
# lowercase are functions, uppercase are their antiderivatives assuming C = 0.
def f1(x):
return 0
def F1(x):
return 0
def f2(x):
return 3
def F2(x):
return 3 * x... | BayMinimum/Hacktoberfest-Mathematics | calculus/riemann_sum/python/riemann_sum_test.py | Python | gpl-3.0 | 2,960 |
# 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 unittest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import ModuleTestCase
class WebdavTestCase(ModuleTestCase):
'Test Webdav module'
modul... | tryton/webdav | tests/test_webdav.py | Python | gpl-3.0 | 504 |
# -*- 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)
from PyQt4.QtGui import (
QGraphicsOpacityEffect,
QFrame
)
from PyQt4.QtCore impo... | centaurialpha/edis | src/ui/editor/minimap.py | Python | gpl-3.0 | 3,836 |
#!/usr/bin/env python
# coding: utf-8
"""setuptools based setup module"""
from setuptools import setup
# from setuptools import find_packages
# To use a consistent encoding
import codecs
from os import path
import osvcad
here = path.abspath(path.dirname(__file__))
# Get the long description from the README_SHORT f... | osv-team/osvcad | setup.py | Python | gpl-3.0 | 2,202 |
# Copyright (C) 2011 Pawel Stiasny
# 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 distributed in t... | pstiasny/VITABS | vitabs/editor.py | Python | gpl-3.0 | 20,458 |
"""
Updates the version in the binary executable of the Forged Alliance game. Will write a new ForgedAlliance.version.exe
file.
Usage:
update_version <version> [--file=<file>] [--dest=<dest>]
Options:
--file=<file> The binary file to update [default: ForgedAlliance.exe]
--dest=<dest> The folder path wher... | FAForever/faftools | faf/tools/fa/update_version.py | Python | gpl-3.0 | 1,436 |
from django.views.generic import CreateView, DetailView, UpdateView, ListView
from django.views.generic import DeleteView
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django import http
from django.contrib import messages
from .. import forms
from .. im... | jizdoteka/jizdoteka-web | apps/web/views/car.py | Python | gpl-3.0 | 1,433 |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 13 23:48:22 2015
@author: thorsten
"""
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import os, sys
ROOT_DIR = os.path.dirname(__file__)
sys.path.append(os.path.join(ROOT_DIR,'..','..','CSXCAD','python'))
... | georgmichel/openEMS | python/setup.py | Python | gpl-3.0 | 1,466 |
#!/usr/bin/env python3
import gi
import os
import webbrowser
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class ButtonWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Hall Launcher")
self.set_border_width(10)
hbox = Gtk.Box(spacing=100)
h... | HallLinux/Hall_Launcher | hall_launcher.py | Python | gpl-3.0 | 3,662 |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | Donkyhotay/MoonPy | zope/app/dtmlpage/tests/test_dtmlpage.py | Python | gpl-3.0 | 2,514 |
class LogisticRegression():
def __init__(self, input_size, output_size):
self.W = np.random.uniform(size=(input_size, output_size),
high=0.1, low=-0.1)
self.b = np.random.uniform(size=output_size,
high=0.1, low=-0.1)
self... | wikistat/Apprentissage | BackPropagation/solutions/lr_class.py | Python | gpl-3.0 | 1,424 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-14 14:30
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('barbadosdb', '0007_club_users'),
]
operations = [
migrations.RenameField(
... | codento/barbados | barbados/barbadosdb/migrations/0008_club_users2.py | Python | gpl-3.0 | 415 |
from argparse import ArgumentParser, ArgumentTypeError
from locale import getdefaultlocale
from multiprocessing import Pool
from contextlib import redirect_stdout
from io import StringIO
from zdict import constants, utils, easter_eggs
from zdict.api import dump
from zdict.completer import DictCompleter
from zdict.load... | zdict/zdict | zdict/zdict.py | Python | gpl-3.0 | 8,711 |
# Generated by Django 2.0.9 on 2019-01-25 03:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0009_auto_20170824_0722'),
]
operations = [
migrations.AlterField(
model_name='alphagramtag',
name='tag',
... | domino14/Webolith | djAerolith/base/migrations/0010_auto_20190124_1902.py | Python | gpl-3.0 | 488 |
# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, ei... | cluck/freeipa | ipatests/test_ipalib/test_crud.py | Python | gpl-3.0 | 7,084 |
# -*- coding: utf-8 -*-
#
# 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.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import json
... | malept/gmusicprocurator | docs/conf.py | Python | gpl-3.0 | 12,282 |
#!python3
import os
import sys
import fnmatch
import re
import shutil
import subprocess
PYTEST = "pytest"
FLAKE8 = "flake8"
BLACK = "black"
BLACK_FLAGS = ["-l", "79"]
PYGETTEXT = os.path.join(sys.base_prefix, "tools", "i18n", "pygettext.py")
INCLUDE_PATTERNS = {"*.py"}
EXCLUDE_PATTERNS = {
"build/*",
"docs/*"... | mu-editor/mu | make.py | Python | gpl-3.0 | 12,681 |
# Generated by Django 2.0 on 2018-02-26 22:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('CreateYourLaws', '0012_codeblock_is_cdp'),
]
operations = [
migrations.RenameField(
model_name='codeblock',
old_name='is_cdp',... | denisjul/democratos | democratos/CreateYourLaws/migrations/0013_auto_20180226_2211.py | Python | gpl-3.0 | 369 |
import json
import socket
import sys
attackSocket = socket.socket()
attackSocket.connect(('localhost', 8080))
attackSocket.send("{0}\r\n".format(
json.dumps(
{'membership': "full", 'channel': sys.argv[1], 'message': ' '.join(sys.argv[3:]), 'type': "start", 'which': sys.argv[2]}
)).encode('utf-8'))
attackSocket.clo... | randomrandomlol123/fewgewgewgewhg | sender.py | Python | gpl-3.0 | 325 |
import os
import unittest
from vsg.rules import process
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_035_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sTestDir, ... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/process/test_rule_035.py | Python | gpl-3.0 | 2,131 |
"""
Indivo Model for VideoMessage
"""
from fact import Fact
from django.db import models
from django.conf import settings
class VideoMessage(Fact):
file_id=models.CharField(max_length=200)
storage_type=models.CharField(max_length=200)
subject=models.CharField(max_length=200)
from_str=models.CharField(max_... | newmediamedicine/indivo_server_1_0 | indivo/models/fact_objects/videomessage.py | Python | gpl-3.0 | 489 |
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2010 Toms Bauģis <toms.baugis at gmail.com>
# This file is part of Project Hamster.
# Project Hamster 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 vers... | landonb/hamster-applet | src/hamster/widgets/dayline.py | Python | gpl-3.0 | 13,958 |
import simplejson
import traceback
import logging
import os
import requests
from collections import OrderedDict
from string import ascii_letters, digits
ID = "nem"
permission = 1
nem_logger = logging.getLogger("NEM_Tools")
# Colour Constants for List and Multilist command
COLOURPREFIX = unichr(3)
COLOUREND = COLOUR... | NotEnoughMods/NotEnoughModPolling | NotEnoughMods_Tools.py | Python | gpl-3.0 | 19,543 |
def __load():
import imp, os, sys
ext = 'pygame/imageext.so'
for path in sys.path:
if not path.endswith('lib-dynload'):
continue
ext_path = os.path.join(path, ext)
if os.path.exists(ext_path):
mod = imp.load_dynamic(__name__, ext_path)
break
e... | mokuki082/EggDrop | code/build/bdist.macosx-10.6-intel/python3.4-standalone/app/temp/pygame/imageext.py | Python | gpl-3.0 | 397 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-02-01 20:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djreceive', '0024_auto_20170131_1732'),
]
operations = [
migrations.RemoveFiel... | rivasd/djPsych | djreceive/migrations/0025_auto_20170201_1516.py | Python | gpl-3.0 | 1,227 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import *
from unittest import TestCase
__author__ = 'nicolas'
import os
class TestTauPyModel(TestCase):
def test_create_taup_model(self):... | obspy/TauPy | taupy/tests/test_tauPyModel.py | Python | gpl-3.0 | 645 |
# GNU Solfege - free ear training software
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011,
# 2013 Tom Cato Amundsen
# Copyright (C) 2013 Jan Baumgart (Folkwang Universitaet der Kuenste)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | RannyeriDev/Solfege | solfege/exercises/solmisation.py | Python | gpl-3.0 | 16,440 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-02-15 11:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sigad', '0033_auto_20180207_1028'),
]
operations = [
migrations.AddField(
... | cmjatai/cmj | cmj/sigad/migrations/0034_auto_20180215_0953.py | Python | gpl-3.0 | 1,088 |
import libtcodpy as libtcod
#globs are imported almost everywhere, so unnecessary libtcod imports should be omitted
##########################################################
# Options
##########################################################
#it's better to pack them into separate file
LIMIT_FPS = 20
#size of the ... | MaxGavr/breakdown_game | globs.py | Python | gpl-3.0 | 3,049 |
from .main import create_random_key, vigenere, otp
| D-Vaillant/julius | julius/__init__.py | Python | gpl-3.0 | 51 |
# Tests of triangular lattices
#
# Copyright (C) 2017--2019 Simon Dobson
#
# This file is part of simplicial, simplicial topology in Python.
#
# Simplicial 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... | simoninireland/simplicial | test/test_triangularlattice.py | Python | gpl-3.0 | 4,117 |
# Rewritten by RayzoR
import sys
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
qn = "112_WalkOfFate"
# ~~~~~ npcId list: ~~~~~
Livina = 30572
Karuda = ... | zenn1989/scoria-interlude | L2Jscoria-Game/data/scripts/quests/112_WalkOfFate/__init__.py | Python | gpl-3.0 | 2,208 |
from django.urls import path
from .views import redirect_to_archive
urlpatterns = [path("<str:media_id>/", redirect_to_archive)]
| whav/hav | src/hav/apps/media/urls.py | Python | gpl-3.0 | 130 |
# -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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 opti... | joaduo/mepinta | core/python_core/mepinta/testing/plugins_testing/TestDiscoveryManager.py | Python | gpl-3.0 | 1,427 |
import numpy as np
from scipy import constants
from scipy.integrate import quad
# Boltzmann constant in eV/K
k = constants.value('Boltzmann constant in eV/K')
class Flux() :
"""
This class evaluates the neutron spectrum. The thermal cutoff is treated
as a variable parameter to ensure a specific fast-to-t... | corps-g/flux_spectrum | flux_spectrum.py | Python | gpl-3.0 | 3,697 |
#! python3
# coding: utf-8
# todo
# multithreader par machine
# nettoyer le code
import os
import sys
import configparser
import logging
import re
import gc
import traceback
import getpass
from logging import FileHandler
from colorama import Fore
import colorama
colorama.init()
#logger = logging.getLogger('Magret... | bbmt-bbmt/MagretUtil | source/MagretUtil.py | Python | gpl-3.0 | 9,880 |
#!/usr/bin/env python
'''
THIS APP IS NOT PRODUCTION READY!! DO NOT USE!
Flask app that provides a RESTful API to MultiScanner.
Supported operations:
GET / ---> Test functionality. {'Message': 'True'}
GET /api/v1/files/<sha256>?raw={t|f} ----> download sample, defaults to passwd protected zip
GET /api/v1/modules --->... | awest1339/multiscanner | utils/api.py | Python | mpl-2.0 | 30,509 |
#!/usr/bin/python3
from lxml import etree
import sys
class Word:
def __init__(self):
self.word = ''
self.pos = ''
self.props = []
def __hash__(self):
return (self.word + self.pos).__hash__()
def __cmp__(self, other):
n = cmp(self.word, other.word)
if n != 0:... | changwoo/hunspell-dict-ko | utils/findduplicates.py | Python | mpl-2.0 | 1,426 |
# 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/.
# Future Modules:
from __future__ import annotations
# Built-in Modules:
import threading
from collections.abc import ... | nstockton/mapperproxy-mume | mapper/delays.py | Python | mpl-2.0 | 3,316 |
from tqdm import tqdm
from django.core.management.base import BaseCommand
from django.db.models import Exists, OuterRef
from ...models import Locality, Operator, Service
class Command(BaseCommand):
def handle(self, *args, **options):
for locality in tqdm(Locality.objects.with_documents()):
loc... | jclgoodwin/bustimes.org.uk | busstops/management/commands/update_search_indexes.py | Python | mpl-2.0 | 1,072 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-05-01 08:10
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('os2webscanner', '0013_auto_20180501_1006'),
]
operations = [
migrations.AlterModelT... | os2webscanner/os2webscanner | django-os2webscanner/os2webscanner/migrations/0014_auto_20180501_1010.py | Python | mpl-2.0 | 408 |
class A(object):
def something(self):
return 3 | caterinaurban/Typpete | typpete/unittests/inference/explicit_object_superclass.py | Python | mpl-2.0 | 58 |
# -*- coding: utf-8 -*-
# (c) 2015 Incaser Informatica S.L. - Sergio Teruel
# (c) 2015 Incaser Informatica S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
from openerp.tools.float_utils import float_round
import decimal
tipo_articulo = {'pr... | incaser/incaser-odoo-addons | export_sagelc/models/account_invoice.py | Python | agpl-3.0 | 10,115 |
from .sources import TestSources
__all__ = ["TestSources"]
| kaini/newslist | server/newslist/tests/__init__.py | Python | agpl-3.0 | 60 |
from django.apps import AppConfig
class ClassifConfig(AppConfig):
name = 'classif'
| bricaud/wevia | classif/apps.py | Python | agpl-3.0 | 89 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Product GTIN module for Odoo
# Copyright (C) 2004-2011 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 Camptocamp (<http://www.camptocamp.at>)
#
# This program is free software: you can redistr... | cgstudiomap/cgstudiomap | main/parts/product-attribute/product_gtin/product_gtin.py | Python | agpl-3.0 | 5,465 |
from LiSE import Engine
from LiSE.examples import kobold
from .util import ELiDEAppTest, window_with_widget, idle_until
class TestPythonEditor(ELiDEAppTest):
def setUp(self):
super().setUp()
with Engine(self.prefix) as eng:
kobold.inittest(eng)
def _get_actions_box(self):
... | LogicalDash/LiSE | ELiDE/ELiDE/tests/test_python_editor.py | Python | agpl-3.0 | 1,944 |
# -*- coding: utf-8 -*-
import minimongo
import osm
import pymongo.collection
import logging
import re
import stitch
def is_area(way):
return len(way.nodes)\
and way.nodes[0] == way.nodes[-1]\
and ('area' in way.tags and way.tags['area'] == 'yes'\
or (not 'highway' in way.tags\
... | larroy/osmtransform | planet/__init__.py | Python | agpl-3.0 | 7,567 |
# -*- coding: utf-8 -*-
#
#
# Copyright 2015 Camptocamp SA
# Author: Alexandre Fayolle
#
# 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
# Licens... | jorsea/vertical-ngo | logistic_order_donation_budget/model/sale_order.py | Python | agpl-3.0 | 1,300 |
from fabric.api import run, cd, env
from fabric import state
DISTANT_PATH = '/www-data/click-and-deploy'
def pull():
with cd(DISTANT_PATH):
run('git pull')
def restart_services():
run('sudo supervisorctl restart click-and-deploy')
def deploy():
pull()
restart_services()
| Cerkinfo/click-and-deploy | apps/recipies/self.py | Python | agpl-3.0 | 299 |
"""Offer Utility Methods. """
import logging
import string # pylint: disable=W0402
from decimal import Decimal
from urllib.parse import urlencode
import bleach
import waffle
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from e... | eduNEXT/edunext-ecommerce | ecommerce/extensions/offer/utils.py | Python | agpl-3.0 | 12,022 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Alessandro Camilli (a.camilli@yahoo.it)
# Copyright (C) 2014
# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
#
# This program is free software: you can redistribute it and/o... | dhp-denero/LibrERP | l10n_it_spesometro/spesometro.py | Python | agpl-3.0 | 75,593 |
# coding: utf-8
import sys
sys.path.append(".")
from workshop.en.i import *
DISCLOSE_SECRET_WORD = TRUE
"""
Some variables are now handled by the student. Names are free.
"""
"""
Can be omitted, as 'reset(…)' will be call before the variables
will be used.
"""
goodGuesses = ""
errorsAmount = 0
... | epeios-q37/epeios | other/exercises/Hangman/en/i.py | Python | agpl-3.0 | 1,604 |
#!/usr/bin/env python
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from infomap import infomap
"""
Generate and draw a network with NetworkX, colored
according to the community structure found by Infomap.
"""
def findCommunities(G):
"""
Partition network with the Infoma... | nicktimko/infomap | examples/python/example-networkx.py | Python | agpl-3.0 | 2,366 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... | Micronaet/micronaet-migration | label_easy/__openerp__.py | Python | agpl-3.0 | 1,694 |
#!/usr/bin/python3
###### Памятка по статусам #####
# OK -- сервис онлайн, обрабатывает запросы, получает и отдает флаги.
# MUMBLE -- сервис онлайн, но некорректно работает
# CORRUPT -- сервис онлайн, но установленные флаги невозможно получить.
# DOWN -- сервис оффлайн.
from sys import argv
from socket import socket, ... | jollheef/tin_foil_hat | checker/python-api/dummy_checker.py | Python | agpl-3.0 | 4,904 |
from django.db import models
from submissions.models.utils import strip_punc
from django.contrib.auth.models import User
from submissions.models.album import Album
from django.contrib.contenttypes.models import ContentType
class Track(models.Model):
"""
A single track(song) for an album.
"""
URL_CHOICE... | tsoporan/tehorng | submissions/models/track.py | Python | agpl-3.0 | 1,835 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Deck'
db.create_table(u'djecks_anki_deck', (
... | bdunnette/djecks_anki | migrations/0002_auto__add_deck.py | Python | agpl-3.0 | 1,388 |
from bottle import request
class BottleHelper:
"""map Apify methods to Bottle magic
and other helpers"""
def __init__(self, app):
self.app = app
def route(self, path, function, methods=['GET']):
self.app.route(path, method=methods, callback=function)
def request(self, items=None)... | abondis/api-hi | api_hi/helpers/bottle.py | Python | agpl-3.0 | 816 |
from django.core.management.base import BaseCommand, CommandError
from voty.initproc.models import Quorum, IssueSupportersQuorum, IssueVotersQuorum
from django.contrib.auth import get_user_model
from django.utils import timezone
from datetime import date
from math import ceil
"""
- Bis 99 Abstimmungsberechtigten 10 Pe... | DemokratieInBewegung/abstimmungstool | voty/initproc/management/commands/set_quorum.py | Python | agpl-3.0 | 2,590 |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Scene.SceneNode import SceneNode
from UM.Resources import Resources
from UM.Math.Color import Color
from UM.Math.Vector import Vector
from UM.Mesh.MeshData import MeshData
import numpy
class ConvexHullNode(SceneNo... | quillford/Cura | cura/ConvexHullNode.py | Python | agpl-3.0 | 2,406 |
# Copyright (C) 2015 Linaro Limited
#
# Author: Stevan Radakovic <stevan.radakovic@linaro.org>
#
# This file is part of Lava Server.
#
# Lava Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License version 3
# as published by the Free Software Foundat... | Linaro/lava-server | lava_results_app/views/chart/forms.py | Python | agpl-3.0 | 2,583 |
# coding: utf-8
from django.contrib.auth.models import User, Permission
from django.urls import reverse
from django.utils import timezone
from rest_framework import status
from kpi.constants import (
ASSET_TYPE_COLLECTION,
PERM_CHANGE_ASSET,
PERM_MANAGE_ASSET,
PERM_VIEW_ASSET,
)
from kpi.models import ... | kobotoolbox/kpi | kpi/tests/api/v2/test_api_permissions.py | Python | agpl-3.0 | 34,731 |
__author__ = 'c.brett'
| Spycho/aimmo | aimmo-game/simulation/test/__init__.py | Python | agpl-3.0 | 23 |
# -*- coding: utf-8 -*-
# setup.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | kalikaneko/leap_mx | setup.py | Python | agpl-3.0 | 2,678 |
from django import template
register = template.Library()
@register.simple_tag
def keyvalue(dict, key):
return dict[key]
| routetopa/tet | tet/browser/templatetags/keyvalue.py | Python | agpl-3.0 | 127 |
# 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 re
def camelcase_to_snakecase(string_to_convert):
"""
Convert CamelCase st... | suutari/shoop | shuup/admin/utils/str_utils.py | Python | agpl-3.0 | 605 |
# -*- coding: utf-8 -*-
import os.path
import posixpath
import re
import urllib
from docutils import nodes
from sphinx import addnodes, util
from sphinx.locale import admonitionlabels
def _parents(node):
while node.parent:
node = node.parent
yield node
class BootstrapTranslator(nodes.NodeVisitor... | xujb/odoo | doc/_extensions/odoo/translator.py | Python | agpl-3.0 | 26,143 |
"""Laposte XML -> Python."""
from datetime import datetime
from lxml import objectify
from ...codec import DecoderGetLabel
from ...codec import DecoderGetPackingSlip
import base64
class _UNSPECIFIED:
pass
def _get_text(xml, tag, default=_UNSPECIFIED):
"""
Returns the text content of a tag to avoid retu... | akretion/roulier | roulier/carriers/laposte_fr/decoder.py | Python | agpl-3.0 | 4,729 |
"""alloccli subcommand for editing alloc reminders."""
from alloc import alloc
import re
class reminder(alloc):
"""Add or edit a reminder."""
# Setup the options that this cli can accept
ops = []
ops.append(('', 'help ', 'Show this help.'))
ops.append(('q', 'quiet ', 'Run with... | mattcen/alloc | bin/alloccli/reminder.py | Python | agpl-3.0 | 3,917 |
# -*- coding: utf-8 -*-
# (c) 2017 Daniel Campos - AvanzOSC
# (c) 2017 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields, models, api, exceptions, _
import base64
import cStringIO
import tempfile
import csv
class ImportPriceFile(models.Transien... | esthermm/odoo-addons | product_supplierinfo_import/wizard/import_price_files.py | Python | agpl-3.0 | 6,282 |
""" IMAPClient wrapper for the Nilas Sync Engine. """
import contextlib
import re
import time
import imaplib
import imapclient
# Even though RFC 2060 says that the date component must have two characters
# (either two digits or space+digit), it seems that some IMAP servers only
# return one digit. Fun times.
imaplib.I... | gale320/sync-engine | inbox/crispin.py | Python | agpl-3.0 | 34,132 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# 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
#... | MostlyOpen/odoo_addons | myo_pharmacy/models/tag.py | Python | agpl-3.0 | 1,365 |
# encoding: utf-8
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import logging
import os.path
import sys
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckan.lib.plugins import DefaultTranslation
from . import get_config
log... | stadt-karlsruhe/ckanext-discovery | ckanext/discovery/plugins/discovery.py | Python | agpl-3.0 | 999 |
# - 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
# ... | odoo-arg/odoo_l10n_ar | l10n_ar/wizard/__init__.py | Python | agpl-3.0 | 951 |
# encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility ... | antoine-de/navitia | source/jormungandr/tests/ptref_tests.py | Python | agpl-3.0 | 38,313 |
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.core.urlresolvers import reverse
from mitxmako.shortcuts import render_to_response
from courseware.access import has_access
from courseware.courses import get_course_with_access
from notes.utils import notes_enabled_f... | elimence/edx-platform | lms/djangoapps/staticbook/views.py | Python | agpl-3.0 | 5,555 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 v... | rockneurotiko/wirecloud | src/wirecloud/catalogue/management/commands/addtocatalogue.py | Python | agpl-3.0 | 5,256 |