code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eith... | lem9/weblate | weblate/permissions/tests.py | Python | gpl-3.0 | 15,824 |
# -*- coding: utf-8 -*-
"""
聚类和EM算法
~~~~~~~~~~~~~~~~
聚类
:copyright: (c) 2016 by the huaxz1986.
:license: lgpl-3.0, see LICENSE for more details.
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
# from .agglomerative_clustering impor... | huaxz1986/git_book | chapters/Cluster_EM/cluster.py | Python | gpl-3.0 | 3,182 |
from scapy.all import *
from scapy.layers import dhcp6
from time import time
def duid(ll_addr):
return DUID_LLT(lladdr=ll_addr, timeval=time())
def ias(requested, iface, T1=None, T2=None):
return map(lambda r: __build_ia(r, iface, T1, T2), requested)
def options(requested):
return map(__build_option_by_... | mwrlabs/veripy | contrib/rfc3736/builder.py | Python | gpl-3.0 | 1,149 |
#!/usr/bin/env python
'''
@file freq_scale.py
@brief Sandbox for various frequency scale generators
@author gm
@copyright gm 2014
This file is part of Chartreuse
Chartreuse 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 Fo... | G4m4/chartreuse | scripts/freq_scale.py | Python | gpl-3.0 | 2,022 |
#=======================================================================
# Author: Donovan Parks
#
# Extended error bar plot.
#
# Copyright 2011 Donovan Parks
#
# This file is part of STAMP.
#
# STAMP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | dparks1134/STAMP | stamp/plugins/groups/plots/ExtendedErrorBar.py | Python | gpl-3.0 | 19,288 |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from loadcell_calibration/GetFactorRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class GetFactorRequest(genpy.Message):
_md5sum = "36d09b846be0b371c5f190354dd... | fioreinc/ipp-15-16 | deprecated/catkin_ws/install/lib/python2.7/dist-packages/loadcell_calibration/srv/_GetFactor.py | Python | gpl-3.0 | 6,807 |
# ---------------------------------------------------------------------------
# OrmapLayersConfig.py
# Created by: Shad Campbell
# Date: 3/11/2011
# Updated by:
# Description: This is a configuration file to be customized by each county.
# Do not delete any of the items in this file. If they are not in use then... | ORMAPtools/MapProduction | Config File Templates/ORMAP_LayersConfig.py | Python | gpl-3.0 | 5,573 |
'''
Rigidity is a simple wrapper to the built-in csv module that allows for
validation and correction of data being read/written from/to CSV files.
This module allows you to easily construct validation and correction
rulesets to be applied automatically while preserving the csv interface.
This allows you to easily upg... | austinhartzheim/rigidity | rigidity/__init__.py | Python | gpl-3.0 | 8,662 |
#!/usr/bin/env python
'''enable run-time addition and removal of master link, just like --master on the cnd line'''
''' TO USE:
link add 10.11.12.13:14550
link list
link remove 3 # to remove 3rd output
'''
from pymavlink import mavutil
import time, struct, math, sys, fnmatch, traceback, json, os
from... | AndKe/MAVProxy | MAVProxy/modules/mavproxy_link.py | Python | gpl-3.0 | 44,637 |
#!/usr/bin/env python
# coding=utf-8
"""572. Idempotent matrices
https://projecteuler.net/problem=572
A matrix $M$ is called idempotent if $M^2 = M$.
Let $M$ be a three by three matrix : $M=\begin{pmatrix} a & b & c\\\ d & e &
f\\\ g &h &i\\\ \end{pmatrix}$.
Let C(n) be the number of idempotent three by three mat... | openqt/algorithms | projecteuler/pe572-idempotent-matrices.py | Python | gpl-3.0 | 441 |
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
from keras.datasets import mnist, cifar10, cifar100
from sklearn.preprocessing import LabelBinarizer
from nets import LeNet, LeNetVarDropout, VGG, VGGVarDropout
sess = tf.Session()
def main():
dataset ... | cjratcliff/variational-dropout | main.py | Python | gpl-3.0 | 1,649 |
# This file is part of Osgende
# Copyright (C) 2017 Sarah Hoffmann
#
# This 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 any later version.
#
# This program is distribu... | lonvia/osgende | osgende/common/sqlalchemy/column_function.py | Python | gpl-3.0 | 2,328 |
import discord
from discord.ext import commands
from .utils.chat_formatting import escape_mass_mentions, italics, pagify
from random import randint
from random import choice
from enum import Enum
from urllib.parse import quote_plus
import datetime
import time
import aiohttp
import asyncio
settings = {"POLL... | jicruz/heroku-bot | cogs/general.py | Python | gpl-3.0 | 17,226 |
#!/usr/bin/python3
import _thread
import RPi.GPIO as GPIO
import socket
import time
from time import sleep
from sys import exit
import datetime
#import MySQLdb
# Start task command
# sleep 30 && python /home/pi/Scripts/Sprinkler/Sprinkler.py > /home/pi/Scripts/Sprinkler/log.txt 2>&1
# Set GPIO output poi... | Makerblaker/Sprinkler | server.py | Python | gpl-3.0 | 4,160 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | Inspq/ansible | lib/ansible/module_utils/ec2.py | Python | gpl-3.0 | 21,973 |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
def readfile(fn):
"""Read fn and return the contents."""
with open(path.join(here, fn), "r", encoding="utf-8") as f:
return f.read()
setup(
name="usfm2osis",
... | chrislit/usfm2osis | setup.py | Python | gpl-3.0 | 1,809 |
import unittest
from tempfile import NamedTemporaryFile
import os
import numpy as np
from Orange.data import ContinuousVariable, DiscreteVariable
from Orange.data.io import CSVFormat
tab_file = """\
Feature 1\tFeature 2\tFeature 3
1.0 \t1.3 \t5
2.0 \t42 \t7
"""
csv_file = """\
Feature 1, F... | PythonCharmers/orange3 | Orange/tests/test_txt_reader.py | Python | gpl-3.0 | 1,539 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Created on 2013-10-11
#
# @author: Bartosz Nowak sztosz@gmail.com
#
# This file is licensed GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
from __future__ import unicode_literals
import unicodecsv
from datetime import datetime, timedelta
from pytz import timezone
from... | sztosz/neonet | DamageReports/views.py | Python | gpl-3.0 | 4,758 |
'''
Scheduler essential class
'''
import types, socket
# vim: ft=python ts=4 sw=4 sta et sts=4 ai:
job_state = ['waiting','running','error','finished']
queue_state = ['active', 'hold']
host_state = ['up', 'down', 'error']
class BaseScheduler(object) :
'''
Base scheduler class
'''
def __init__(self, c... | somsak/rocks-solid | rocks_solid/scheduler/__init__.py | Python | gpl-3.0 | 6,356 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | MingLin-home/Ming_slim | preprocessing/cifarnet_preprocessing.py | Python | gpl-3.0 | 4,252 |
# Copyright (c) 2007 RADLogic
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distr... | griddynamics/bunch | lettuce_bunch/rad_util.py | Python | gpl-3.0 | 26,792 |
"""
Copyright 2017 Ryan Wick (rrwick@gmail.com)
https://github.com/rrwick/Unicycler
This module contains functions relating to BLAST, which Unicycler uses to rotate completed circular
replicons to a standard starting point.
This file is part of Unicycler. Unicycler is free software: you can redistribute it and/or mod... | rrwick/Unicycler | unicycler/blast_func.py | Python | gpl-3.0 | 5,533 |
import sys
import os
import re
def human_size_to_byte(number):
"""
Convert number of these units to bytes, ignore case:
b : 512
kB : 1000
K : 1024
mB : 1000*1000
m : 1024*1024
MB : 1000*1000
M : 1024*1024
GB : 1000*1000*1000
G : 1024*1024*1024
TB : 1000*... | iesugrace/pycmd | lib.py | Python | gpl-3.0 | 24,434 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0008_auto_20150405_1435'),
]
operations = [
migrations.AddField(
model_name='brewpispark',
na... | thomast74/oinkbrew_webapp | api/migrations/0009_brewpispark_spark_time.py | Python | gpl-3.0 | 470 |
import logging
from mimeprovider.documenttype import get_default_document_types
from mimeprovider.client import get_default_client
from mimeprovider.exceptions import MimeException
from mimeprovider.exceptions import MimeBadRequest
from mimeprovider.mimerenderer import MimeRenderer
from mimeprovider.validators impor... | udoprog/mimeprovider | mimeprovider/__init__.py | Python | gpl-3.0 | 5,322 |
import zmq
from crpropa import Module
class SendCandidateProperties( Module ):
""" Sends candidate proporties given by the function
```extract_func( candidate )``` over the network
to the server on ```ip_port```
"""
def __init__( self, ip_port, extract_func ):
Module.__init__( self... | adundovi/CRPropa3-scripts | python_modules/network.py | Python | gpl-3.0 | 1,236 |
#!/usr/bin/env python
"""
A basic example of loading YAML
Make sure you use the "safe_load" method and not the "load" method
that will give you warnings.
References:
- https://stackoverflow.com/questions/1773805/how-can-i-parse-a-yaml-file-in-python
"""
import yaml
with open("data_samples/basic.yaml", 'r') as strea... | veltzer/demos-python | src/examples/short/yaml/yaml_load.py | Python | gpl-3.0 | 455 |
#!/usr/bin/python2
import threading
from systemd import journal
from threading import Thread
import smtplib
import email.utils
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
class Mailer(threading.Thread):
"""
Mailer
:desc: Class that sends an email
Extends Thread
... | gkarakou/systemd-denotify | denotify/mailer.py | Python | gpl-3.0 | 8,509 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 12 13:45:31 2018
@author: huyn
"""
| nguyenngochuy91/Ancestral-Blocks-Reconstruction | checkGGPS2.py | Python | gpl-3.0 | 107 |
"""
A test script for the `indextable` module
"""
from random import randrange
import pytest
from HamiltonianPy.indextable import IndexTable
class TestIndexTable:
def test_init(self):
match0 = r"unhashable type"
match1 = r"The .* has different type from the previous ones"
match2 = r"Th... | wangshiphys/HamiltonianPy | HamiltonianPy/tests/unit/test_indextable.py | Python | gpl-3.0 | 1,978 |
__author__ = "Laura Martinez Sanchez"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "lmartisa@gmail.com"
from osgeo import gdal, gdalnumeric, ogr, osr
import numpy as np
from PIL import Image, ImageDraw
from collections import defaultdict
import pickle
import time
from texture_common import *
#Uses a gdal ge... | madi/DeadTrees-BDEOSS | clipshape.py | Python | gpl-3.0 | 4,289 |
#!/usr/bin/env python3
import sys
import subprocess
import urllib.request
import copy
def main(argv):
cookie = urllib.request.HTTPCookieProcessor()
oc = copy.deepcopy(cookie)
if __name__ == '__main__':
sys.exit(main(sys.argv))
| munhyunsu/Hobby | Pickle/pickle_example.py | Python | gpl-3.0 | 242 |
"""
Playlist Generation
"""
from os import path
from random import choice
import string
import pafy
from .. import content, g, playlists, screen, util, listview
from ..playlist import Playlist
from . import command, search, album_search
@command(r'mkp\s*(.{1,100})')
def generate_playlist(sourcefile):
"""Gene... | np1/mps-youtube | mps_youtube/commands/generate_playlist.py | Python | gpl-3.0 | 4,048 |
import sys,os
os.environ["EPICS_CA_ADDR_LIST"] = "192.168.82.10"
os.environ["EPICS_CA_MAX_ARRAY_BYTES"] = "100000000"
import velaINJMagnetControl as VIMC
a = VIMC.velaINJMagnetController(True,False)
a.switchONpsu('SOL')
#print(a.isON('HVCOR'))
print(a.getRI('SOL'))
#print(a.getILockStates('HVxhfjsfhk01'))
a.switchO... | adb-xkc85723/VELA-CLARA-Controllers | Controllers/VELA/INJECTOR/velaINJMagnets/bin/Release/test.py | Python | gpl-3.0 | 377 |
from openstates.utils import LXMLMixin
import datetime as dt
from pupa.scrape import Scraper, Event
from .utils import get_short_codes
from requests import HTTPError
import pytz
URL = "http://www.capitol.hawaii.gov/upcominghearings.aspx"
class HIEventScraper(Scraper, LXMLMixin):
def get_related_bills(self, hre... | cliftonmcintosh/openstates | openstates/hi/events.py | Python | gpl-3.0 | 3,151 |
# -*- coding: utf-8 -*-
from oauth2 import Consumer, Client, Token
from httplib2 import ProxyInfo
from httplib2.socks import PROXY_TYPE_HTTP
from django.conf import settings
class Authentication(object):
def __init__(self, consumer_key, consumer_secret, token_key, token_secret):
consumer = Consumer(key... | Gandi/baobab | baobab/utils/authentication.py | Python | gpl-3.0 | 950 |
# -*- coding: utf-8 -*-
def classeq(x, y):
return x.__class__==y.__class__
class Element(object): pass
| chaosim/dao | dao/base.py | Python | gpl-3.0 | 113 |
import json
import time
class TaskQueueInputError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args, **kwargs)
class TaskQueueSystemError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args, **kwargs)
class TaskQueueEmptyError(Excep... | weijuly/dist-sched-tasks | taskq/taskq/utils/common.py | Python | gpl-3.0 | 613 |
"""
Conversion pack for October 2021 release
"""
CONVERSIONS = {
# Renamed items
"Quafe Zero": "Quafe Zero Classic",
"Exigent Sentry Drone Navigation Mutaplasmid": "Exigent Sentry Drone Precision Mutaplasmid",
}
| pyfa-org/Pyfa | service/conversions/releaseOct2021.py | Python | gpl-3.0 | 225 |
ROOT = '/.well-known/acme-challenge'
ENDPOINT = '/k9s7WeOPg3HdSjwlAqEVRxnezsGGe-CFOwPfOcU3VgU'
RESPONSE = 'k9s7WeOPg3HdSjwlAqEVRxnezsGGe-CFOwPfOcU3VgU.QBkCfzPq0mKXIJSktgl4_b7psKazh3MSZ8juWnZbJbg'
| zejacobi/DeltaGreen | LetsEncryptConfig.py | Python | gpl-3.0 | 196 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2018 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 ... | sergiusens/snapcraft | tests/unit/__init__.py | Python | gpl-3.0 | 10,138 |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2015, Philipp Klaus. All rights reserved.
License: GPLv3
"""
from distutils.core import setup
setup(name='netio230a',
version = '1.1.9',
description = 'Python package to control the Koukaam NETIO-230A',
long_description = 'Python software to access the Kou... | pklaus/netio230a | setup.py | Python | gpl-3.0 | 1,135 |
import actor
class Oxygen(actor.Actor):
extra_keys = ['capacity', 'pipe_length', 'is_initial']
def __init__(self, *args, **kwargs):
super(Oxygen, self).__init__(*args, **kwargs)
self.capacity = kwargs.get('capacity', 3000)
self.contained = self.capacity
self.pipe_length = kwargs... | italomaia/turtle-linux | games/DigbyMarshmallow/lib/oxygen.py | Python | gpl-3.0 | 510 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.stdio}.
@var properEnv: A copy of L{os.environ} which has L{bytes} keys/values on POSIX
platforms and native L{str} keys/values on Windows.
"""
from __future__ import absolute_import, division
import os
impo... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/test/test_stdio.py | Python | gpl-3.0 | 13,157 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains expectations."""
import inquisition
FISHY = inquisition.SPANISH
FISHY = FISHY.replace('surprise', 'haddock')
print FISHY
| aedoler/is210-week-03-synthesizing | task_01.py | Python | mpl-2.0 | 183 |
import csv
from datetime import datetime
from django.conf import settings
from django.core.management import BaseCommand
from bustimes.utils import download_if_changed
from ...models import Licence, Registration, Variation
def parse_date(date_string):
if date_string:
return datetime.strptime(date_string, ... | jclgoodwin/bustimes.org.uk | vosa/management/commands/import_vosa.py | Python | mpl-2.0 | 11,021 |
from unittest import TestCase
from MyCapytain.resources.collections.cts import XmlCtsTextInventoryMetadata, XmlCtsTextgroupMetadata, XmlCtsWorkMetadata, XmlCtsEditionMetadata, XmlCtsTranslationMetadata
from MyCapytain.resources.prototypes.cts.inventory import CtsTextgroupMetadata
with open("tests/testing_data/examples... | Capitains/MyCapytain | tests/resources/collections/test_cts_collection_inheritance.py | Python | mpl-2.0 | 2,461 |
from urllib.parse import urlparse
import subprocess
import logging
import boto3
import airflow.hooks.base_hook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
import utils.helpers as helpers
class PostgresToS3Transfer(BaseOperator):
'''Dumps a Postgres database to a S3... | opentrials/opentrials-airflow | dags/operators/postgres_to_s3_transfer.py | Python | mpl-2.0 | 3,091 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# 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 op... | blckshrk/Weboob | modules/750g/backend.py | Python | agpl-3.0 | 2,151 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-22 16:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0007_auto_20170422_1622'),
]
operations = [
migrations.AlterFiel... | NotAGameDev/website | website/migrations/0008_auto_20170422_1629.py | Python | agpl-3.0 | 448 |
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# 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 ... | Micronaet/micronaet-bom | order_bom_explode_report/__openerp__.py | Python | agpl-3.0 | 2,240 |
from django.apps import AppConfig
class PhotosAppConfig(AppConfig):
name = 'livinglots_usercontent.photos'
def ready(self):
try:
from actstream import registry
from . import signals
registry.register(self.get_model('Photo'))
except ImportError:
... | 596acres/django-livinglots-usercontent | livinglots_usercontent/photos/apps.py | Python | agpl-3.0 | 396 |
{
"name" : "GII",
"version" : "1.0",
"depends" : ['sale','product'],
"author" : "Novasoft Consultancy Services Pvt. Ltd.",
'category' : 'Generic Modules/Others',
"description": """ GII - Management Module
""",
'website': 'http://www.novasoftindia.com',
'data': ['giisa.... | Novasoft-India/OperERP-AM-Motors | openerp/addons/giicourse/__openerp__.py | Python | agpl-3.0 | 444 |
# -*- coding: utf8 -*-
# Author: Adrien Bibal
# Date: 2014
# Insert the student answer in the correction framework file.
import sys
import codecs
input_file = sys.stdin # input = file containing the student answer.
oz_file = codecs.open("/task/task.oz", "r", "utf8") # Open the "correction framework file".
new_file =... | GuillaumeDerval/INGInious | tests/tasks/edx/HelloWorld/insert_input.py | Python | agpl-3.0 | 891 |
import numpy as np
class PriceHistoryPack(object):
def __init__(self, input_seq_len, num_features, target_seq_len):
super(PriceHistoryPack, self).__init__()
self.sku_ids = []
self.XX = np.empty((0, input_seq_len, num_features))
self.YY = np.empty((0, target_seq_len))
self.s... | pligor/predicting-future-product-prices | 04_time_series_prediction/data_providers/price_history_pack.py | Python | agpl-3.0 | 2,640 |
# -*- coding: utf-8 -*-
"""
Unit tests covering the program listing and detail pages.
"""
import json
import re
from urlparse import urljoin
from uuid import uuid4
import mock
from bs4 import BeautifulSoup
from django.conf import settings
from django.urls import reverse, reverse_lazy
from django.test import override_s... | gsehub/edx-platform | lms/djangoapps/learner_dashboard/tests/test_programs.py | Python | agpl-3.0 | 9,854 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis_louvain | assessments/business/score_encoding_export.py | Python | agpl-3.0 | 7,914 |
from odoo.osv import expression
from odoo.addons.sale_timesheet.models.account import AccountAnalyticLine
def _timesheet_get_portal_domain(self):
""" WE revert this functionality of odoo. We want to show details of ordered quantities also
Only the timesheets with a product invoiced on delivered quantity a... | ingadhoc/sale | sale_timesheet_ux/models/account_analytic_line.py | Python | agpl-3.0 | 785 |
class Backstab:
pass
| etkirsch/legends-of-erukar | erukar/content/skills/thievery/Backstab.py | Python | agpl-3.0 | 25 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | OpusVL/odoo | addons/share/wizard/share_wizard.py | Python | agpl-3.0 | 50,754 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-01-16 10:12
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('patients', '0026_clinician... | muccg/rdrf | rdrf/registry/patients/migrations/0027_auto_20180116_1012.py | Python | agpl-3.0 | 836 |
from . import slide_channel_technology_category
from . import slide_channel_technology
from . import slide_channel
| avanzosc/odoo-addons | slide_channel_technology/models/__init__.py | Python | agpl-3.0 | 115 |
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | bdang2012/taiga-back-casting | taiga/projects/custom_attributes/services.py | Python | agpl-3.0 | 2,749 |
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import models
from odoo.tests.common import SavepointCase
class BaseKanbanAbstractTester(models.TransientModel):
_name = 'base.kanban.abstract.tester'
_inherit = 'base.kanban.a... | thinkopensolutions/server-tools | base_kanban_stage/tests/test_base_kanban_abstract.py | Python | agpl-3.0 | 2,793 |
"""
Tests for users API
"""
import datetime
import ddt
import pytz
from django.conf import settings
from django.template import defaultfilters
from django.test import RequestFactory, override_settings
from django.utils import timezone
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import patch
f... | teltek/edx-platform | lms/djangoapps/mobile_api/users/tests.py | Python | agpl-3.0 | 20,030 |
from .MaterialModifier import *
class MagicOre(MaterialModifier):
pass
| etkirsch/legends-of-erukar | erukar/content/modifiers/material/base/MagicOre.py | Python | agpl-3.0 | 76 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, _
from odoo.addons.http_routing.models.ir_http import slug
class EventEvent(models.Model):
_inherit = "event.event"
community_menu = fields.Boolean(
"Community Men... | ygol/odoo | addons/website_event_track_online/models/event_event.py | Python | agpl-3.0 | 2,962 |
# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "Absence Management",
'summary': """Create time based absence notifications""",
'author': 'Onestein',
'website': 'http://www.onestein.eu',
'ima... | VitalPet/addons-onestein | hr_absenteeism/__manifest__.py | Python | agpl-3.0 | 776 |
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Invoice Payment Retention",
"version": "14.0.1.0.1",
"category": "Accounting & Finance",
"author": "Ecosoft, Odoo Community Association (OCA)",
"license": "AG... | OCA/account-invoicing | account_invoice_payment_retention/__manifest__.py | Python | agpl-3.0 | 700 |
# -*- coding: utf-8 -*-
import unittest
import doctest
import sys
import time
import timeside.core
class _TextTestResult(unittest.TestResult):
"""A test result class that can print formatted text results to a stream.
Used by TextTestRunner.
"""
separator1 = '=' * 70
separator2 = '-' * 70
de... | Parisson/TimeSide | tests/unit_timeside.py | Python | agpl-3.0 | 5,327 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##############################################################################
#
# sci.AI EXE
# Copyright(C) 2017 sci.AI
#
# This program is free software: you can redistribute it and / or modify
# it under the terms of the GNU Affero General Public License... | sciAI/exe | validator/__init__.py | Python | agpl-3.0 | 1,545 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import autoslug.fields
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ProjectPodcast',
... | GISAElkartea/amv2 | antxetamedia/projects/migrations/0001_initial.py | Python | agpl-3.0 | 2,923 |
#!env/python3
# coding: utf-8
from core.managers.containers import *
from core.managers.imports import *
from core.managers.analysis_manager import AnalysisManager
from core.managers.annotation_manager import AnnotationManager
from core.managers.file_manager import FileManager
from core.managers.filter_manager... | REGOVAR/Regovar | regovar/core/managers/__init__.py | Python | agpl-3.0 | 954 |
#####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... | NinjaMSP/crossbar | crossbar/controller/test/test_run.py | Python | agpl-3.0 | 42,995 |
# Copyright 2018 Tecnativa - Vicent Cubells <vicent.cubells@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3
from odoo import fields, models
SORTING_CRITERIA = [
("name", "By name"),
("product_id.name", "By product name"),
("product_id.default_code", "By product reference"),
("... | OCA/purchase-workflow | purchase_order_line_deep_sort/models/res_company.py | Python | agpl-3.0 | 948 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# © 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Skarphed.
#
# Skarphed is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as ... | skarphed/skarphed | admin/installer/debian7_nginx/__init__.py | Python | agpl-3.0 | 6,232 |
from documents.models import Document
from categories.models import Category
import os
def move_doc(doc_id, cat_id):
doc = Document.objects.get(pk=int(doc_id))
old_cat = doc.refer_category
new_cat = Category.objects.get(pk=int(cat_id))
for p in doc.pages.all():
cmd = "mv " + p.get_absolute_pat... | Foxugly/MyTaxAccountant | scripts/move_document.py | Python | agpl-3.0 | 504 |
# -*- coding: utf-8 -*-
from pyramid.view import view_config
import logging
import pysite.resmgr
L = logging.getLogger('PySite')
@view_config(
name='',
context=pysite.plugins.models.Node,
renderer='pysite:plugins/templates/index.mako',
permission='admin'
)
def index(context, request):
return di... | dmdm/PySite | pysite/plugins/views.py | Python | agpl-3.0 | 327 |
# Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
_allowed_inactive_link_models = ["res.partner"]
_inactive_cascade = True
sta_mandate_ids = fields.One2many(
... | mozaik-association/mozaik | mozaik_mandate/models/res_partner.py | Python | agpl-3.0 | 3,660 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... | stefanhahmann/pybossa | test/test_api/__init__.py | Python | agpl-3.0 | 904 |
# Copyright 2021 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
class AccountGroup(models.Model):
_inherit = 'account.group'
length_account = fields.Integer(
string='Length account', compute='_compute_length_a... | avanzosc/odoo-addons | account_headquarter/models/account_group.py | Python | agpl-3.0 | 1,098 |
# -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields, models, api
from openerp.addons.event_track_assistant._common import\
_convert_to_utc_date, _convert_to_local_date, _convert_time_to_float
date2string = fi... | avanzosc/event-wip | sale_order_create_event_hour/wizard/wiz_event_append_assistant.py | Python | agpl-3.0 | 3,966 |
# -*- coding: utf-8 -*-
# @copyright (C) 2014-2015
#Developpeurs 'BARDOU AUGUSTIN - BREZILLON ANTOINE - EUZEN DAVID - FRANCOIS SEBASTIEN - JOUNEAU NICOLAS - KIBEYA AISHA - LE CONG SEBASTIEN -
# MAGREZ VALENTIN - NGASSAM NOUMI PAOLA JOVANY - OUHAMMOUCH SALMA - RIAND MORGAN - TREIMOLEIRO ALEX - TRULLA AUREL... | ehopsolidaires/ehop-solidaires.fr | ehop/ehopSolidaire_providers_register/forms.py | Python | agpl-3.0 | 10,906 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | runt18/nupic | src/nupic/frameworks/opf/metrics.py | Python | agpl-3.0 | 54,801 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-15 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or m... | mohamedhagag/community-addons | hr_attendance_analysis/wizard/__init__.py | Python | agpl-3.0 | 1,055 |
import datetime
from django.db.models import Q
from django.http import HttpResponse, HttpResponseServerError, Http404, HttpResponseNotFound, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
f... | django-rea/nrp | django_rea/board/views.py | Python | agpl-3.0 | 46,450 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import ckeditor.fields
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('meinberlin_budgeting', '0007_update-strings'),
]
operations = [
migrations.Alter... | liqd/a4-meinberlin | meinberlin/apps/budgeting/migrations/0008_auto_20170529_1302.py | Python | agpl-3.0 | 663 |
import string
import random
import json
from collections import defaultdict
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from catmaid.fields import Double3D
from catmaid.models import Log, NeuronSearch, CELL_BODY_CHOICES, \
... | htem/CATMAID | django/applications/catmaid/control/common.py | Python | agpl-3.0 | 8,243 |
# -*- coding: utf-8 -*-
# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# © 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
import openerp.addons.dec... | SerpentCS/purchase-workflow | product_supplierinfo_discount/models/product_supplierinfo.py | Python | agpl-3.0 | 753 |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2017 VoltDB Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... | deerwalk/voltdb | tests/sqlcoverage/sql_coverage_test.py | Python | agpl-3.0 | 38,815 |
import logging
from openfisca_core.tools import assert_near
from openfisca_country_template import CountryTaxBenefitSystem
from openfisca_survey_manager.tests.test_scenario import (
create_randomly_initialized_survey_scenario
)
log = logging.getLogger(__name__)
tax_benefit_system = CountryTaxBenefitSyste... | openfisca/openfisca-survey-manager | openfisca_survey_manager/tests/test_marginal_tax_rate.py | Python | agpl-3.0 | 989 |
#!/usr/bin/env python
# "convertor" - converts ODF files from a YUSCII font-encoding to proper UTF-8.
# Copyright (C) 2009 Damjan Georgievski
#
# 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 S... | gdamjan/convertor | setup.py | Python | agpl-3.0 | 1,692 |
from django.core.management.base import BaseCommand, CommandError
from quotes_app.tasks import rank_all
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Runs reranking algorithms on the Quotes.'
def handle(self, *args, **options):
logger.info('Running {0} m... | podcastquotes/podcastquotes | django_project/quotes_app/management/commands/rank_quotes.py | Python | agpl-3.0 | 387 |
from collections import defaultdict
from django.core.files.storage import DefaultStorage
from django.core.management.base import BaseCommand, CommandError
from candidates.csv_helpers import list_to_csv, memberships_dicts_for_csv
from elections.models import Election
def safely_write(output_filename, memberships_lis... | DemocracyClub/yournextrepresentative | ynr/apps/candidates/management/commands/candidates_create_csv.py | Python | agpl-3.0 | 3,846 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import add_days, cstr, getdate
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
f... | gangadhar-kadam/nassimapp | support/doctype/maintenance_schedule/maintenance_schedule.py | Python | agpl-3.0 | 10,225 |
class Year(object):
def __init__(self, year):
self.year = year
def is_leap_year(self):
return (self._by_4() and not self._by_100()) \
or self._by_400()
def _by_4(self):
return self.year % 4 == 0
def _by_100(self):
return self.year % 100 == 0
def _by... | mscoutermarsh/exercism_coveralls | assignments/python/leap/example.py | Python | agpl-3.0 | 368 |
# -*- coding: utf-8 -*-
from openerp import fields, models, api
import re
class res_partner(models.Model):
_inherit = 'res.partner'
#def _get_default_tp_type(self):
# return self.env.ref('l10n_cl_invoice.res_IVARI').id
# todo: pasar los valores por defecto a un nuevo módulo
# por ejemplo "l10n... | odoo-chile/l10n_cl_invoice | models/partner.py | Python | agpl-3.0 | 2,394 |
""""""
from __future__ import annotations
from flask import Flask
from .criterion import TagCriterion
from .extension import TagsExtension
__all__ = ["TagsExtension", "TagCriterion"]
def register_plugin(app: Flask):
TagsExtension(app)
| abilian/abilian-core | src/abilian/web/tags/__init__.py | Python | lgpl-2.1 | 244 |
# coding: utf-8
import os
import sys
from nxdrive.logging_config import get_logger
from nxdrive.utils import safe_long_path
from tests.common_unit_test import UnitTestCase
if sys.platform == 'win32':
import win32api
log = get_logger(__name__)
# Number of chars in path c://.../Nuxeo.. is approx 96 chars
FOLDER_... | ssdi-drive/nuxeo-drive | nuxeo-drive-client/tests/test_long_path.py | Python | lgpl-2.1 | 3,664 |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2019 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | fifengine/fifengine | engine/python/fife/extensions/pychan/widgets/slider.py | Python | lgpl-2.1 | 7,472 |