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
""" @author: Silvian Dragan @Date: 12/12/2017 @Copyright: Copyright 2017, Samaritan CMA - Published under GNU General Public Licence v3 @Details: https://github.com/Silvian/samaritan Celery tasks. """ from datetime import date from celery.utils.log import get_task_logger from samaritan.celery import app from samari...
Silvian/samaritan
emailservice/tasks.py
Python
gpl-3.0
5,053
import os import logging import select import socket from subprocess import check_call import tempfile import unittest import gi gi.require_version('Gtk', '3.0') from nose.twistedtools import deferred from nose.tools import * from twisted.internet import threads from twisted.internet.defer import inlineCallbacks try:...
gnome-keysign/gnome-keysign
tests/test_bluetooth.py
Python
gpl-3.0
6,199
# -*- coding: utf-8 -*- """Testsuite for package bots""" import pytest from qacode.core.bots.bot_base import BotBase from qacode.core.exceptions.core_exception import CoreException from qacode.core.loggers.logger_manager import Log from qacode.core.testing.asserts import Assert from qacode.core.testing.test_...
netzulo/qacode
tests/001_functionals/suite_001_botbase.py
Python
gpl-3.0
5,673
import random as rand import sys MAXDOCK=100 MAXSHIP=500 MAXCARG=10000 MAXTIME=100 MSHPCAP=100 MAXRLEN=100 if len(sys.argv)>1: MAXDOCK = sys.argv[1] if len(sys.argv)>2: MAXSHIP = sys.argv[2] if len(sys.argv)>3: MAXCARG = sys.argv[3] Nd = rand.randint(2,MAXDOCK) Ns = rand.randint(1,MAXSHIP) Nc = rand.randin...
kadircet/CENG
334/the2t/generator.py
Python
gpl-3.0
1,322
from datetime import datetime class store: def __init__(self, delta): self.delta = delta self.dataDict = {} self.ordList = [] def store(self, data, info): ob2store = [data,info] if data in self.dataDict: try: self.ordList.remove(self.dataDict[data]) e...
jlzirani/cache-storing
store.py
Python
gpl-3.0
1,439
#!/usr/bin/env python3 # Copyright (C) 2012,2013,2014,2015,2016,2017,2018,2019,2020 Seven Watt <info@sevenwatt.com> # <http://www.sevenwatt.com> # # This file is part of Plugwise-2-py. # # Plugwise-2-py is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
SevenW/Plugwise-2-py
devtools/Join-2.py
Python
gpl-3.0
58,244
# -*- coding: utf-8 -*- import fixed_size_text as ft nu = ft.Num() it = ft.Int() ymd = ft.DatYYYMMDD() ah1 = [ft.col(8), # Ονομα Αρχείου ft.col(8, 0, ' ', ymd), # Ημερομηνία δημιουργίας ft.col(4), # Αρ.Κύκλου τρεξίματος ft.col(127) # Filler ] h1 = ft.row(0, ah1) ah2 = [ft.col(4), # ...
tedlaz/pyted
pykoinoxrista/koinoxrista/fmy2015.py
Python
gpl-3.0
3,312
import gpi class ExternalNode(gpi.NodeAPI): """This Node provides allows the user to make a DelaySequence for Jemris.""" def initUI(self): # Widgets self.delay_labels = ['Name', 'Observe', 'ADCs', 'Aux1', 'Aux2', 'Aux3', 'Delay', 'DelayType', 'HardwareMode', 'Phas...
sravan953/pulseq-gpi
pulseq2jemris/jemris_nodes/JMakeDelaySequence_GPI.py
Python
gpl-3.0
990
from __future__ import absolute_import, print_function, division """ """ def stripDown(str, final='', args=['_', '-']): """ Auxiliar function to strip down keywords from symbols """ for arg in args: str=str.replace(arg,final) return str def lenYear(year): """ Calculates th...
tomchor/pymicra
pymicra/algs/auxiliar.py
Python
gpl-3.0
3,396
import tempfile import shutil import os import pytest from errbot import repo_manager from errbot.storage.memory import MemoryStoragePlugin assets = os.path.join(os.path.dirname(__file__), 'assets') @pytest.fixture def plugdir_and_storage(request): plugins_dir = tempfile.mkdtemp() storage_plugin = MemorySt...
mrshu/err
tests/repo_manager_tests.py
Python
gpl-3.0
4,299
from django.http import HttpResponse from django.views.generic import TemplateView from django.conf import settings class CatalogView(TemplateView): template_name = "base_catalog.html"
IVaN4B/maugli
maugli/store/views.py
Python
gpl-3.0
190
# From Python 3.6 functools.py # Bug was in detecting "nonlocal" access def not_bug(): cache_token = 5 def register(): nonlocal cache_token return cache_token == 5 return register() assert not_bug()
rocky/python-uncompyle6
test/simple_source/bug33/05_nonlocal.py
Python
gpl-3.0
230
"""Manipulate release notes from Github commits to make them more compact. Gets its input from stdin, assumed in the following format: 1 line per commit, starting with "[Some subject]" and ending with "(#123456)" Lines with the same subject will be grouped together, sorted by increasing PR number. Commits not starti...
bayesimpact/bob-emploi
frontend/release/compress_notes.py
Python
gpl-3.0
1,668
#!/usr/bin/env python from distutils.core import setup setup(name = "comic-utils", version = "0.4", description = "Comic Utils", author = "Milan Nikolic", author_email = "gen2brain@gmail.com", license = "GNU GPLv3", url = "https://github.com/gen2brain/comic-utils", ...
gen2brain/comic-utils
setup.py
Python
gpl-3.0
576
# -*- coding: utf-8 -*- #!/usr/bin/env python # ============================================================================= # # Dialog implementation generated from a XDL file. # # Created: Sat Jul 9 15:14:39 2016 # by: unodit 0.5 # # WARNING! All changes made in this file will be overwritten # if the...
kelsa-pi/unodit
examples/embed dialog/src/Test_embed.py
Python
gpl-3.0
27,471
import unittest from literoticapi.author import * class testStory(unittest.TestCase): def setUp(self): self.author = Author(868670) def testGetSeriesAndNonSeries(self): assert len(self.author.get_stories()) >= 132 if __name__ == "__main__": unittest.main()
hrroon/literoticapi
test/author_test.py
Python
gpl-3.0
290
""" QuarkPlayer, a Phonon media player Copyright (C) 2008-2009 Tanguy Krotoff <tkrotoff@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...
tkrotoff/QuarkPlayer
buildbot/upload_package.py
Python
gpl-3.0
2,173
#!/usr/bin/python3 # -*- coding: utf-8 -*- # url_read.py file is part of slpkg. # Copyright 2014-2021 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # All rights reserved. # Slpkg is a user-friendly package manager for Slackware installations # https://gitlab.com/dslackw/slpkg # Slpkg is free software: you can redis...
dslackw/slpkg
slpkg/url_read.py
Python
gpl-3.0
1,692
#!/usr/bin/env python import base64 from os import urandom from sys import argv _XOR_KEY_SIZE=8 #xor two strings def xor_str(s1,s2): #print([a for a in s2]); return bytearray(s1[i]^s2[i%_XOR_KEY_SIZE] for i in range(len(s1))) #xor msg with random key, encode in b64 def encrypt(msg): msg+=bytearray([msg[0]^msg[len...
Property404/OSIR
server/admin/xcrypt.py
Python
gpl-3.0
1,528
# -*- coding: utf-8 -*- # Copyright (C) 2006-2010 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
walterbender/portfolio
odf/grammar.py
Python
gpl-3.0
248,216
import numpy, math def kernel(name, k = 3): return { 'sobel': numpy.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]])/8, 'gauss': gauss_kernel(k) }.get(name) def convolution(img, kernel): kernel = numpy.array(kernel) rowk = kernel[0] colk = kernel.transpose()[0] / kernel[0,0] if not (abs(colk.reshape(-1,1).dot...
The-BFG/GenericCV
src/neighborhoodOperators.py
Python
gpl-3.0
2,307
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from collect_filenames import collect from action.prepare_files import prepare def restore(config, debug): """ Restores all the ownerships and permissions on all files """ filenames = collect(config) for item in filenames[0]: prepare(item, 'R...
open-dynaMIX/experms
src/experms/restore.py
Python
gpl-3.0
435
# python-pgp A Python OpenPGP implementation # Copyright (C) 2014 Richard Mitchell # # 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 la...
omar-AM/python-pgp
pgp/cipher/__init__.py
Python
gpl-3.0
1,228
#!/usr/bin/env python # Clay Wells # Hoang Bui # Purpose: # # Identify code fragments that we deem both dangerous and helpful. # This is the first step when doing a code review of a Drupal7 contrib module. # # Output: # # Text file reporting all identified code fragments. import sys import os import yaml import m...
clayball/drupal7-static-review
archive/drupal7-module-check.py
Python
gpl-3.0
5,705
# Natural Language Toolkit: Stemmers # # Copyright (C) 2001-2016 NLTK Project # Author: Steven Tomcavage <stomcava@law.upenn.edu> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ A word stemmer based on the Lancaster stemming algorithm. Paice, Chris D. "Another Stemmer." ACM SIGIR Foru...
adazey/Muzez
libs/nltk/stem/lancaster.py
Python
gpl-3.0
11,544
# -*- coding: utf-8 -*- #!/usr/bin/env python3 def fib(n): """This a simple fibonacci function""" result = [] a, b = 0, 1 while a < n: result.append(a) # print(a, end=' ') a, b = b, a+b return result if __name__ == "__main__": import sys print(fib(int(sys.argv[1]))) #...
qilicun/python
python3/tutorials/fibonacci.py
Python
gpl-3.0
355
import time from core import logger from core.auto_process.common import ProcessResult from core.auto_process.managers.sickbeard import SickBeard import requests class PyMedusa(SickBeard): """PyMedusa class.""" def __init__(self, sb_init): super(PyMedusa, self).__init__(sb_init) def _create_ur...
clinton-hall/nzbToMedia
core/auto_process/managers/pymedusa.py
Python
gpl-3.0
6,117
from Utility.Utility import DoesntHaveMethod ################################################################################ ################################################################################ class Drawable(object): ############################################################################## def __...
dloman/FiestaMonsterz
Drawing/Drawable.py
Python
gpl-3.0
1,861
#类 python
GLPJJ/PL
py/g.py
Python
gpl-3.0
11
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWSumm. # # GWSumm 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) ...
maxisi/gwsumm
gwsumm/plot/builtin.py
Python
gpl-3.0
33,208
#!/usr/bin/env python import sys import os import re import json import sqlite3 from psrd.options import load_option_parser, exec_load_main from psrd.loader import load_documents def main(): usage = "usage: %prog [options] [filenames]\nImports sections into psrd db from feat json files." parser = load_option_parser(...
devonjones/PSRD-Parser
src/json_loader.py
Python
gpl-3.0
414
# -*- coding: utf-8 -*- # Copyright (C) 2012 VT SuperDARN Lab # Full license can be found in LICENSE.txt # # 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 # ...
aburrell/davitpy
davitpy/pydarn/plotting/fan.py
Python
gpl-3.0
29,354
# dataframe: a data-frame implementation using method piping # # Copyright (C) 2016 Simon Dirmeier # # This file is part of dataframe. # # dataframe 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 versi...
dirmeier/dataframe
dataframe/callable.py
Python
gpl-3.0
1,564
from django.db import models class SpectralTemplate(models.Model): name = models.CharField(max_length=10) path = models.CharField(max_length=100) def __str__(self): return self.name class PhotometricFilter(models.Model): name = models.CharField(max_length=10) path = models.CharField(max...
sergiopasra/django-megaraetc
etc/models.py
Python
gpl-3.0
1,005
#! /usr/bin/env python # This will run as a production ready server if something like eventlet is installed import argparse import json import os import threading import time import sys from gevent import ssl from geventwebsocket import WebSocketServer, WebSocketApplication, Resource from readscale import set_scale...
sparkfun/usb-scale
scaleServer.py
Python
gpl-3.0
3,755
from modules.tools import GetHtml from bs4 import BeautifulSoup as bs def search(query): url = 'https://www.filmaffinity.com/es/search.php?stext=%s' % (query.replace(" ", "+").lower()) html = GetHtml(url).content soup = bs(html, "html.parser") list_pelis = soup.findAll("div", {"class": "movie-card mov...
awuth/bot-mv-telegram
modules/fa.py
Python
gpl-3.0
3,863
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('agentex', '0007_datapoint_coordsource'), ] operations = [ migrations.RemoveField( model_name='datapoint', ...
tomasjames/citsciportal
app/agentex/migrations/0008_remove_datapoint_coordsource.py
Python
gpl-3.0
363
""" WSGI config for DeepRobSite 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_S...
MediffRobotics/DeepRobotics
DeepRobSite/DeepRobSite/wsgi.py
Python
gpl-3.0
399
# vim: tabstop=4 expandtab shiftwidth=4 fileencoding=utf8 # (c) 2008 Peter Todd <pete@petertodd.org> # # This program is made available under the GNU GPL version 3.0 or # greater. See the accompanying file COPYING for details. # # This program is distributed WITHOUT ANY WARRANTY; without even the # implied warranty of ...
petertodd/tuke
Tuke/tests/geometry/layer.py
Python
gpl-3.0
1,600
# Copyright 2017 by Notmail Bot contributors. All rights reserved. # # This file is part of Notmail Bot. # # Notmail Bot 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 Lice...
ManuelLR/Notmail_Bot
repository/repository.py
Python
gpl-3.0
4,697
# -*- coding: utf-8 -*- """Generate markdown file of Input information to be inserted into the manual.""" import os import sys sys.path.append(os.path.abspath(os.path.join(__file__, "../../.."))) from collections import OrderedDict from mycodo.utils.system_pi import add_custom_measurements from mycodo.utils.system_pi...
kizniche/Mycodo
mycodo/scripts/generate_manual_inputs_by_measure.py
Python
gpl-3.0
4,380
# -*- coding: utf-8 -*- # from pytest import raises # The parametrize function is generated, so this doesn't work: # # from pytest.mark import parametrize # import pytest parametrize = pytest.mark.parametrize # from duckomatic import metadata # TODO: Importing this is broken because six.moves.urllib gives # an im...
morgangalpin/duckomatic
tests/test_main.py
Python
gpl-3.0
1,476
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging logger = logging.getLogger(__name__) def print_disclaimer(with_logger = False): # disclaimer message disclaimer_message = "\n" disclaimer_message ...
UU-Hydro/PCR-GLOBWB_model
modflow/scripts/disclaimer.py
Python
gpl-3.0
2,094
# Deb-o-Matic # # Copyright (C) 2011-2021 Luca Falavigna # # Author: Luca Falavigna <dktrkranz@debian.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; version 3 of the License. # # This pr...
debomatic/debomatic
Debomatic/process.py
Python
gpl-3.0
6,727
#!/usr/bin/python ############################################################################### # # # ddns - A dynamic DNS client for IPFire # # Copyright (C) 2012 IPFire development team ...
nils-wisiol/ddns
src/ddns/providers.py
Python
gpl-3.0
43,963
#!/usr/bin/env python3 # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # # Copyright (c) 2015, Colorado State University. # # This file is part of ndn-atmos. # # ndn-atmos is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as publish...
named-data/ndn-atmos
lib/ndn_cmmap_translators/atmos2ndn_parser/conf_file_parser.py
Python
gpl-3.0
4,328
from __future__ import division import math as m import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as pl from scipy.optimize import fmin, fmin_powell, minimize from numpy import (any, array, asarray, ones, ones_like, zeros, isfinite, inf, concatenate, arange, unique, delete, ...
OxES/k2sc
src/detrender.py
Python
gpl-3.0
7,258
# -*- coding: utf-8 -*- import logging logger = logging.getLogger(__name__) from django.core.management.base import BaseCommand, CommandError from catmaid.models import Project, User from catmaid.control.project import validate_project_setup from catmaid.apps import get_system_user from .common import set_log_level ...
catmaid/CATMAID
django/applications/catmaid/management/commands/catmaid_update_project_configuration.py
Python
gpl-3.0
1,566
#################################################################################################### # sco/impl/benson17/__init__.py # Implementation details of the SCO specific to the Benson et al. 2017 publications. # by Noah C. Benson ''' The sco.impl.benson17 namespace contains default values for all of the option...
WinawerLab/sco
sco/impl/benson17/__init__.py
Python
gpl-3.0
14,418
# -*- coding: utf-8 -*- # This module contains classes to manage EL1USB device # This class reads the content of the EL-USB-1 thermometer import sys import datetime import time class el1_input: "Doc ..." def __init__(self): self.fake = 0 def request(self, text, base_value, min_value, max_value): ...
eltuxusb/eltuxusb
eltuxusb/el_input.py
Python
gpl-3.0
981
# coding=utf-8 """Resources test. .. note:: 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 later version. """ __author__ = '...
jorgegil/kpo-pilot
KPOpilot/test/test_resources.py
Python
gpl-3.0
1,017
#!/usr/bin/python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012 Sigurd Gartmann sigurdga-ubuntu@sigurdga.no # 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 pub...
sigurdga/maps
tests/test_example.py
Python
gpl-3.0
1,448
# -*- coding: utf-8 -*- import sys import os import atexit from ConfigParser import NoSectionError from flask import Flask, url_for from flask.ext.cors import CORS from src.core.cmstiser import Csmtiser from src.core.ner_tagger import NerTagger from src.di import DependencyContainer from src.core.lexicon import Lexi...
clarinsi/reldi-api
index.py
Python
gpl-3.0
3,105
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
priyaganti/rockstor-core
src/rockstor/storageadmin/views/network.py
Python
gpl-3.0
16,309
from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder from electrum.i18n import _ from electrum.util import base_units import os from label_dialog import LabelDialog Builder.load_string(''' #:import os os <WalletDialog@Popup>: title: _(...
valesi/electrum
gui/kivy/uix/dialogs/wallets.py
Python
gpl-3.0
1,677
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import copy import locale import logging import re import reportlab import openerp.tools as tools from openerp.tools.safe_eval import safe_eval from openerp.tools.misc import ustr _logger = logging.getLogger(__name__)...
ayepezv/GAD_ERP
openerp/report/render/rml2pdf/utils.py
Python
gpl-3.0
6,163
from django.template import Library from website.settings import OSU_IMAGE_FORMAT_LARGE, OSU_IMAGE_FORMAT_SMALL register = Library() @register.filter(name='split_difficulties') def split_difficulties(value, splitter=','): return value.split(splitter) @register.filter(name='osu_thumb_small') def osu_thumb_sma...
IndeedPlusPlus/osubeatmaps
website/templatetags/osu_images.py
Python
gpl-3.0
516
# -*- coding: utf-8 -*- # # live-magic - GUI frontend to create Debian LiveCDs, etc. # Copyright (C) 2007-2010 Chris Lamb <lamby@debian.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 Found...
debian-live/live-magic
LiveMagic/controllers/wizard.py
Python
gpl-3.0
3,487
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from mini_fiction.validation.utils import bool_coerce, safe_string_coerce, safe_string_multiline_coerce NEWS_ITEM = { 'name': { 'type': 'string', 'coerce': safe_string_coerce, 'required': True, 'minlength': 1, 'maxlength': 64,...
andreymal/mini_fiction
mini_fiction/validation/news.py
Python
gpl-3.0
1,013
''' Usage: dbInputData.py dbInputData.py -h | --help dbInputData.py [--debug] [-i INPUT] [-o FILE] Options: -h, --help Shows this menu. -d, --debug Print debug information. This is the most verbose option. -i INPUT Input fi...
admiralspark/NetSpark-Scripts
Example_Scripts/TinyDB/dbInputData.py
Python
gpl-3.0
2,573
import re import array from seal.lib.aligner.mapping import Mapping class SAMMapping(Mapping): """ A mapping implementation for storing SAM data. A SAMMapping object is constructed from a list of SAM fields -- see http://samtools.sourceforge.net """ CIGAR_PATTERN = re.compile(r"(\d+)([MIDNSHP])") REFID_PATT...
QwertyManiac/seal-cdh4
seal/lib/aligner/sam_mapping.py
Python
gpl-3.0
1,761
from benchmarker.kernels.helpers_torch import Regression from torch_geometric.nn import DimeNet def get_kernel(params): # TODO: make these parameters net = DimeNet( hidden_channels=params["problem"]["hidden_channels"], out_channels=1, num_blocks=6, num_bilinear=8, num_s...
undertherain/benchmarker
benchmarker/kernels/dimenet/pytorch.py
Python
mpl-2.0
528
x: int = int(input()) # STATE: L -> [-inf, inf]; len(L) -> [0, inf]; x -> [-inf, inf]; z -> [-inf, inf] L: List[List[int]] = [[0], [1], [x]] # STATE: L -> [-inf, inf]; len(L) -> [3, inf]; x -> [-inf, inf]; z -> [-inf, inf] z: int = L[2][0] # STATE: L -> [-inf, inf]; len(L) -> [0, inf]; x -> [-inf, inf]; z -> [2, 2] if...
caterinaurban/Lyra
src/lyra/unittests/numerical/interval/backward/summarization/subscriptions1b.py
Python
mpl-2.0
350
import json import time from datetime import date, datetime, timedelta from xml.sax.saxutils import escape import mock import pytest from constance import config from constance.test import override_config from waffle.models import Switch from django.conf import settings from django.core.exceptions import ValidationEr...
safwanrahman/kuma
kuma/wiki/tests/test_models.py
Python
mpl-2.0
71,294
import ast from frontend.context import Context from frontend.stubs.stubs_paths import libraries class ImportHandler: """Handler for importing other modules during the type inference""" @staticmethod def get_ast(path, module_name): """Get the AST of a python module :param path: t...
gitsimon/spadup-lyra
frontend/import_handler.py
Python
mpl-2.0
1,952
#!/usr/bin/env python # # Copyright (c) 2011-2013, Shopkick Inc. # All rights reserved. # # 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/. # # --- # Author: John Egan <jw...
shopkick/flawless
flawless/client/client.py
Python
mpl-2.0
9,588
from abc import ABCMeta, abstractmethod class Observer(object): __metaclass__ = ABCMeta @abstractmethod def update(self, *args, **kwargs): pass class Observable(object): def __init__(self): self.observers = [] def add_observer(self, observer): if not observer in self.observers: sel...
h3ct0rjs/ProgrammingIVassignments
Lab5Sudoku/src/util.py
Python
mpl-2.0
671
import base64 from odoo import _, exceptions, fields, models class ComunicazioneDatiIvaExportFile(models.TransientModel): _name = "comunicazione.dati.iva.export.file" _description = "Export XML of invoices data communication" file_export = fields.Binary("File", readonly=True) filename = fields.Char(...
OCA/l10n-italy
l10n_it_invoices_data_communication/wizard/export_file.py
Python
agpl-3.0
1,682
""" ARCHES - a program developed to inventory and manage immovable cultural heritage. Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund 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 Founda...
archesproject/arches
tests/models/mapped_csv_import_tests.py
Python
agpl-3.0
6,782
from mitxmako.shortcuts import render_to_response from courseware.courses import (get_courses, get_course_with_access, get_courses_by_university, sort_by_announcement) from django.contrib.auth.decorators import login_required @login_required def index(request,course_id): course=get...
EduPepperPDTesting/pepper2013-testing
lms/djangoapps/chat/views.py
Python
agpl-3.0
443
import os import shutil from pombola.config import config IN_TEST_MODE = True base_dir = os.path.abspath( os.path.join( os.path.split(__file__)[0], '..', '..' ) ) # Change the data dir in testing, and delete it to ensure that we have a clean # slate. Also print out a little warning - adds clutter to the test output b...
mysociety/pombola
pombola/settings/tests_base.py
Python
agpl-3.0
1,485
import json from coalib.bearlib.abstractions.Linter import linter from dependency_management.requirements.NpmRequirement import NpmRequirement from coalib.results.Diff import Diff from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY from coalib.results.Result import Result @linter(executable='eslint', ...
vijeth-aradhya/coala-bears
bears/js/ESLintBear.py
Python
agpl-3.0
2,949
""" Unit tests for REST api """ from __future__ import unicode_literals from rest_framework.status import ( HTTP_200_OK, HTTP_404_NOT_FOUND, ) from learningresources.models import LearningResourceType from rest.tests.base import ( RESTTestCase, API_BASE, as_json, ) from rest.pagination import Lore...
amir-qayyum-khan/lore
rest/tests/test_misc.py
Python
agpl-3.0
3,684
from __future__ import division import os import sys import glob import shutil import argparse import multiprocessing import subprocess as sb from haystack_common import check_file, HAYSTACK_VERSION import logging logging.basicConfig(level=logging.INFO, format='%(levelname)-5s @ %(asctime)s:\n\t ...
pinellolab/haystack_bio
haystack/run_pipeline.py
Python
agpl-3.0
14,360
delivery_head = [ { "seq": 1, "len": 5, "type": "A", "col": "codenr", "req": True, "def": "E", "allowed": ["E"], "comment": "Code enregistrement", }, { "seq": 2, "len": 20, "type": "A", "col": "cmdcli", "...
akretion/logistics-center
stef_logistics/data/flow_delivery.py
Python
agpl-3.0
1,924
import shutil import tempfile from django.test import override_settings from django.test.runner import DiscoverRunner from .celery import app class TempMediaMixin(object): "Mixin to create MEDIA_ROOT in temp and tear down when complete." def setup_test_environment(self): "Create temp directory and u...
lafranceinsoumise/api-django
agir/api/test_runner.py
Python
agpl-3.0
1,140
# Copyright 2018 - TODAY Serpent Consulting Services Pvt. Ltd. # (<http://www.serpentcs.com>) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { 'name': 'Search Partner Phone/Mobile/Email', 'version': '11.0.1.0.1', 'category': 'Extra Tools', 'summary': 'Partner Search by Phone/Mo...
brain-tec/partner-contact
partner_phone_search/__manifest__.py
Python
agpl-3.0
616
# -*- coding: utf-8 -*- """ End-to-end tests for Student's Profile Page. """ from contextlib import contextmanager from datetime import datetime from nose.plugins.attrib import attr from common.test.acceptance.pages.common.logout import LogoutPage from common.test.acceptance.pages.lms.account_settings import AccountS...
caesar2164/edx-platform
common/test/acceptance/tests/lms/test_learner_profile.py
Python
agpl-3.0
34,815
# -*- encoding: utf-8 -*- { 'name': 'Account Bank Statement Import', 'category': 'Banking addons', 'version': '8.0.1.0.1', 'author': 'OpenERP SA,' 'Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/bank-statement-import', 'depends': ['account'], 'data': [ ...
VitalPet/bank-statement-import
account_bank_statement_import/__openerp__.py
Python
agpl-3.0
573
#!/usr/bin/env python # portable serial port access with python # this is a wrapper module for different platform implementations # # (C) 2001-2010 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt #this variable is kept for backwards compatability VERSION = '2.7-m...
StealthMicro/OctoPi-Makerbot
env/Lib/site-packages/serial/__init__.py
Python
agpl-3.0
2,971
import datetime import functools import os import random import shutil import tempfile import time from urllib import request import faker import magic import pendulum from django.conf import settings from django.contrib.auth.models import Group, Permission from django.contrib.staticfiles.testing import StaticLiveServ...
uclouvain/osis_louvain
assessments/tests/functionals/test_score_encoding.py
Python
agpl-3.0
57,982
from ..utils import * ## # Minions class UNG_058: """Razorpetal Lasher""" pass class UNG_063: """Biteweed""" pass class UNG_064: """Vilespine Slayer""" requirements = {PlayReq.REQ_MINION_TARGET: 0, PlayReq.REQ_TARGET_FOR_COMBO: 0} pass class UNG_065: """Sherazin, Corpse Flower""" pass ## # Spells c...
jleclanche/fireplace
fireplace/cards/ungoro/rogue.py
Python
agpl-3.0
697
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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 F...
sevein/archivematica
src/dashboard/src/components/ingest/views_NormalizationReport.py
Python
agpl-3.0
4,152
""" This module provides date summary blocks for the Course Info page. Each block gives information about a particular course-run-specific date which will be displayed to the user. """ from __future__ import absolute_import import datetime import crum from babel.dates import format_timedelta from django.conf import s...
ESOedX/edx-platform
lms/djangoapps/courseware/date_summary.py
Python
agpl-3.0
22,031
# encoding: utf-8 from ..docker import docker_exec from ..utils import filter_column, python_requirements_compare from ..test_common import skipifdev # @skipifdev def test_update_tyr_config_file(distributed_undeployed): platform, fabric = distributed_undeployed # create empty directory for task under test ...
Hoshiyo/fabric_navitia
integration_tests/test_tyr/test_setup.py
Python
agpl-3.0
5,824
""" Views used by XQueue certificate generation. """ import json import logging from django.conf import settings from django.contrib.auth.models import User from django.http import HttpResponse, Http404, HttpResponseForbidden from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import...
jbassen/edx-platform
lms/djangoapps/certificates/views/xqueue.py
Python
agpl-3.0
10,063
from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext as _ from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist from blogapp.models import * from blogapp.utilities import * from ...
DraXus/andaluciapeople
blogapp/views.py
Python
agpl-3.0
5,160
# -*- coding: utf-8 -*- #/############################################################################# # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2004-TODAY Tech-Receptives(<http://www.tech-receptives.com>). # # This program is free software: you can redistribute it and/or modify # it under th...
bakhtout/odoo-educ
addons/openeducat_erp/op_faculty/op_faculty.py
Python
agpl-3.0
6,048
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2012 Associazione OpenERP Italia # (<http://www.openerp-italia.org>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
iw3hxn/LibrERP
l10n_it_sale/models/inherit_sale_order.py
Python
agpl-3.0
2,854
import bson import bson.errors import superdesk from .update_topics import UpdateTopicsScript from .update_places import UpdatePlacesScript RESOURCES = ('events', 'planning', 'archive', 'published', 'archived') SCRIPTS = [ ("topics", UpdateTopicsScript()), ("places", UpdatePlacesScript()), ] def get_id(i...
superdesk/superdesk-ntb
server/ntb/commands/update_items.py
Python
agpl-3.0
2,412
# -*- coding: utf-8 -*- # Copyright 2017 Ainara Galdona - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api from openerp.addons import decimal_precision as dp class ProductTemplate(models.Model): _inherit = 'product.template' @api.depends('pro...
Daniel-CA/odoo-addons
product_stock_on_hand/models/product.py
Python
agpl-3.0
1,953
""" Segregation of pymongo functions from the data modeling mechanisms for split modulestore. """ import datetime import logging import math import re import zlib from contextlib import contextmanager from time import time import pymongo import pytz import six from six.moves import cPickle as pickle from contracts i...
stvstnfrd/edx-platform
common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py
Python
agpl-3.0
23,649
#!/usr/bin/env python2 # # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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,...
eckardm/archivematica
src/MCPClient/lib/clientScripts/archivematicaCreateMETSRightsDspaceMDRef.py
Python
agpl-3.0
3,954
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
wevoice/wesub
apps/videos/rpc.py
Python
agpl-3.0
11,527
#!/usr/bin/env python # encoding: utf-8 import datetime import unittest import mock import pandas as pd import pandas_finance from pandas.util.testing import assert_frame_equal from nose.tools import assert_equal from freezegun import freeze_time class GetStockTestCase(unittest.TestCase): @mock.patch('pandas_fi...
scraperwiki/stock-tool
tests.py
Python
agpl-3.0
5,818
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import pytest from django.contrib.auth import get_user_model from shoop.adm...
taedori81/shoop
shoop_tests/admin/test_contact_edit.py
Python
agpl-3.0
1,225
"""empty message Revision ID: 2728b7328b78 Revises: d7c7f3be40a Create Date: 2015-10-20 13:44:12.129389 """ # revision identifiers, used by Alembic. revision = '2728b7328b78' down_revision = 'd7c7f3be40a' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - pl...
litnimax/astconfman
astconfman/migrations/versions/2728b7328b78_.py
Python
agpl-3.0
724
""" Platform support for Programs. This package is a thin wrapper around interactions with the Programs service, supporting learner- and author-facing features involving that service if and only if the service is deployed in the Open edX installation. To ensure maximum separation of concerns, and a minimum of interde...
ESOedX/edx-platform
openedx/core/djangoapps/programs/__init__.py
Python
agpl-3.0
855
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'pasportaservo', 'USER': 'guillaume', } } LANGUAGE_CODE = 'en' INSTALLED_APPS = ( 'grappelli', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'dja...
LaPingvino/pasportaservo
pasportaservo/settings/dev_etenil.py
Python
agpl-3.0
652
# 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> # Copyright (C) 2014-2017 Andrea Stagi <stagi.andrea@gmail.com> # ...
taigaio/taiga-contrib-letschat
back/taiga_contrib_letschat/tasks.py
Python
agpl-3.0
5,188