src
stringlengths
721
1.04M
import datetime import re import xml.sax.saxutils import flask import tumblr def img_tag_from_photo(photo): alt_sizes = photo["alt_sizes"] alt_size = None for size in alt_sizes: if size["width"] > 420 and size["width"] <= 500: alt_size = size if not alt_size: alt_size = al...
# -*- coding: utf-8 -*- # Copyright (c) 2016 Martin Ramsay # # 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, modif...
from astropy.cosmology import FlatLambdaCDM import astropy.units as u cosmoMD = FlatLambdaCDM(H0=67.77*u.km/u.s/u.Mpc, Om0=0.307115, Ob0=0.048206) import glob import astropy.io.fits as fits import os import time import numpy as n import sys # specific functions from scipy.stats import norm from scipy.integrate import...
## # Copyright 2009-2019 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
# matplotlib without any blocking GUI import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np from smst.utils import audio from smst.models import stft (fs, x) = audio.read_wav('../../../sounds/piano.wav') plt.figure(1, figsize=(9.5, 6)) w = np.hamming(256) N = 256 H = 128 mX1, p...
# Copyright 2017 MongoDB, Inc. # # 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 law or agreed to in writing, so...
# -*- coding: utf-8 -*- import numpy as np from shapely.geometry import JOIN_STYLE, Polygon from shapely.ops import cascaded_union __author__ = "Begon Jean-Michel <jm.begon@gmail.com>" __contributor__ = ["Romain Mormont <romainmormont@hotmail.com>"] __version = "0.1" class Graph(object): """A class for represent...
# -*- coding: utf-8 -*- from flask import render_template, request, jsonify from . import main @main.app_errorhandler(403) def forbidden(e): if request.accept_mimetypes.accept_json and \ not request.accept_mimetypes.accept_html: response = jsonify({'error': 'forbidden'}) response.st...
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from django.contrib import messages from django.core.urlresolvers import reverse from .forms import BillForm from .models import Bill @login_required def new(request): context = {} if r...
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this ...
#!/usr/bin/python # -*- coding: utf-8 -*- import logging import time import tempfile from pymongo import MongoClient import gridfs try: import magic except ImportError: pass from utils import get_file, clean_data, get_type, Config JOBNAME = 'FILEMAGIC' SLEEPTIME = 1 # create logger logger = logging.getLo...
import uuid class Task(object): STATUS_QUEUED = 'queued' STATUS_EXECUTING = 'executing' STATUS_FAILED = 'failed' STATUS_SKIPPED = 'skipped' STATUS_COMPLETED = 'completed' def __init__(self, job): self.status = self.STATUS_QUEUED self.id = uuid.uuid4().hex self.type = ...
"""add passwords for users Revision ID: 31d29fbffe44 Revises: 48c578b852fa Create Date: 2016-01-20 23:33:36.893832 """ # revision identifiers, used by Alembic. revision = '31d29fbffe44' down_revision = '48c578b852fa' import random from flask_security.utils import encrypt_password from alembic import op import sqla...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models, migrations GLOBAL_MAILBOX_SIZE_QUOTA = 'global_mailbox_size' USER_COUNT_QUOTA = 'user_count' def convert_mailbox_size_to_mb(apps, schema_e...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, sys from frappe import _ from frappe.utils import cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta from frappe.model import default_fields from...
import math import rospy import numpy as np from tf import transformations as tra from geometry_graph_msgs.msg import Node, geometry_msgs from tub_feasibility_check import srv as kin_check_srv from tub_feasibility_check.msg import BoundingBoxWithPose, AllowedCollision from tub_feasibility_check.srv import CheckKinemat...
import random """ THE GREAT DALMUTI Heikki "Zokol" Juva 2015 - heikki@juva.lu """ ## Exception raised when all players have skipped the round class SkipException(Exception): pass class RestartRound(Exception): pass class Card: def __init__(self, value): self.value = value def __repr__(self): return "Card:...
# Copyright 2011 OpenStack Foundation # 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 requ...
"""Tests for the attribute exchange extension module """ import unittest from openid.extensions import ax from openid.message import NamespaceMap, Message, OPENID2_NS from openid.consumer import Response class BogusAXMessage(ax.AXMessage): mode = 'bogus' getExtensionArgs = ax.AXMessage._newArgs class Dumm...
# This file is part of django-xmpp-server-list # (https://github.com/mathiasertl/django-xmpp-server-list) # # django-xmpp-server-list 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 Lic...
"""Pyblish Endpoint Server""" # Standard library import os import logging import threading # Dependencies import flask import flask.ext.restful # Local library import mocking import resource import service as service_mod log = logging.getLogger("endpoint") prefix = "/pyblish/v1" resource_map = { "/state": reso...
""" Django settings for oervoer project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ bojan: 06 21543084 """ # Build paths inside the project like this: os.path.joi...
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-03-01 09:58 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shared', '0004_trigger_fire_on_create'), ] operations = [ migrations.AlterM...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Main loop for aptdaemon.""" # Copyright (C) 2008-2009 Sebastian Heinlein <devel@glatzor.de> # # 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; eit...
from __future__ import division, print_function from itertools import combinations import numpy as np from joblib import Parallel, delayed from oddt.docking.internal import generate_rotor_vector from oddt import random_seed class GeneticAlgorithm(object): def __init__(self, engine, n_population=100, n_generations...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP module # Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>) # # Italian OpenERP Community (<http://www.openerp-italia.com>) # #####################################################...
#-*- coding: UTF-8 -*- import gzip import re import time import ssl from socket import AF_INET,SOCK_STREAM,socket,getaddrinfo try: from urllib.parse import urlencode # Version: Python 3.x except ImportError: from urllib import urlencode # Version: Python 2.X #import os #import tempfile #impo...
import unittest from autobump.diff import Bump from autobump.common import Semver class TestSemver(unittest.TestCase): """Test representation of a semantic version.""" def test_create(self): ver = Semver(5, 3, 2) self.assertEqual(ver.major, 5) self.assertEqual(ver.minor, 3) s...
import sys from netCDF4 import Dataset def main(): print(extract_cell_from_3d_ioapi(sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), layer=0, var=None)) def extract_cell_from_3d_ioapi(file_path, row, col, layer=0, var=None): '''Extract a single grid cell from a GRIDDED IOAPI NetCDF file. If you don't p...
# -*- coding: utf-8 -*- import os import sys from urllib.parse import urlparse PRJ_TITLE = "Pytigon portal" PRJ_NAME = "schportal" THEMES = ['tablet_modern', 'tablet_modern', 'smartfon_standard'] _lp = os.path.dirname(os.path.abspath(__file__)) if 'PYTIGON_ROOT_PATH' in os.environ: _rp = os.environ['PYTIGON_ROOT...
#!/usr/bin/python -OO # -*- coding: utf8 -*- ############################################################################ # (c) 2005-2010 freenode#rsbac # # 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 Fou...
import json from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import ListView, FormView, View from django.http import Http404, HttpResponseRedirect, HttpResponse, HttpResponseForbidden from django.shortcuts import redirect from django.db.models impo...
# -*- 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 #...
from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs import json from crystal_dashboard.api import controllers as api from crystal_dashboard.dashboards.crystal import exceptions as sdsexception from crystal_dashboard.dashboards.crystal.controllers.controllers i...
from enigma import eServiceCenter, eServiceReference, eTimer, pNavigation, getBestPlayableServiceReference, iPlayableService from Components.ParentalControl import parentalControl from Components.config import config from Tools.BoundFunction import boundFunction from Tools.StbHardware import setFPWakeuptime, getFPWakeu...
#!/usr/bin/env python from scapy.all import * import re, sys, getopt, shutil def pcapsessions(pfile): pssn = rdpcap(pfile) return pssn def fullstrsplit(ipportstr): retlist=[] sssnlist = ipportstr.split() # stack up the list and split out the port values retlist.append(sssnlist[0]) tmpip ...
# -*- coding: utf-8 -*- """ Created on Fri Jul 3 12:04:44 2015 Copyright 2015 Nicolo' Navarin This file is part of scikit-learn-graph. scikit-learn-graph 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 ...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listtransactions API from test_framework.test_framework import BitcoinTestFramework from ...
import types class Query: """ Queries are a way for collectors to collect data. They are one way of getting data from the source. query_name - the name of the query key_column - the name of the key column in the result Does not produces anything but are a field of source. Only contain metada...
#!/usr/bin/env python # coding=utf8 """ Add suite options for overrides and control-suite to DB @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2011 Mark Hymers <mhy@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it and/or ...
from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from ipaddr_func import long2ip from sqlalchemy.exc import IntegrityError engine = create_engine('sqlite:////tmp/ipbucket.db', convert_unicode=True) db_session = scoped_s...
# Copyright 2012-2014 VPAC # # This file is part of pytsm. # # pytsm 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. # # pytsm is distr...
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory # 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/LICEN...
# -*- coding: utf-8 -*- # preprocessor.py - simple preprocessor for plugin template files # This file is part of pluma # # Copyright (C) 2006 - Steve Frécinaux # Copyright (C) 2012-2021 MATE Developers # # pluma is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
from dummy.viewer.formatting import ResultFormatter, Formatter import logging logger = logging.getLogger( __name__ ) try: import pylab import numpy @Formatter.register( 'plot' ) class PlotFormatter( ResultFormatter ): def __init__( self, *args, **kwargs ): super( PlotFormatter, self ).__init__( self, *args...
""" Code to apply quilt patches to files This module enables pysaliency to use quilt patches to patch code from external saliency models. While in Linux, quilt itself could be used to apply the patches, in Windows and Mac quilt might not be available and nontrivial to install for users. It does not support all possib...
#!/usr/bin/env python """ weather.py Copyright 2011 Aaron Goss This file is part of Monitor Toys. Monitor Toys is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opt...
# -*- coding: utf-8 -*- # Copyright 2010 Fabian Moser # Copyright 2011-2014 Jaap Karssenberg import gobject import gtk import pango import logging from zim.plugins import PluginClass, extends, WindowExtension from zim.gui.pageindex import PageTreeStore, PageTreeIter, PageTreeView, \ NAME_COL, PATH_COL, EMPTY_COL,...
""" Django settings for practica project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
#!/usr/bin/env python """ Parser for hhr result files created with hhblits|hhsearch|hhalign -o <hhr_file> """ import sys from collections import namedtuple __author__ = 'Markus Meier (markus.meier@mpibpc.mpg.de)' __version__ = '1.0' __license__ = "GPL-3" hhr_alignment = namedtuple('hhr_alignment', ['query_id', '...
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
from __future__ import unicode_literals import json import jwt import mock from django.conf import settings from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from oscar.core.loading import get_model, get_class from ecommerce.core.constants import ISO_8601_FORMAT from ecommer...
''' Autor: Gurkirt Singh Start data: 15th May 2016 purpose: of this file is read frame level predictions and process them to produce a label per video ''' from sklearn.svm import LinearSVC from sklearn.ensemble import RandomForestClassifier import numpy as np import pickle import os,h5py import time,json #import pylab...
from __future__ import division, absolute_import, print_function import pytest import sys import numpy as np from numpy.core import ( array, arange, atleast_1d, atleast_2d, atleast_3d, block, vstack, hstack, newaxis, concatenate, stack ) from numpy.core.shape_base import (_block_dispatcher, _block_setup, ...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime from odoo import api, fields, models, _ from odoo.exceptions import AccessError, ValidationError import odoo.addons.decimal_precision as dp class LunchOrder(models.Model): """ A lunch order con...
# The Hazard Library # Copyright (C) 2013 GEM 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 option) any later version. # # Th...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import json import markdown import base64 from uuid import uuid4 from PIL import Image from django.shortcuts import render, get_object_or_404 from django.views.decorators.csrf import csrf_exempt from django.views.generic.list import ListView fr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from jinja2 import Markup from flask import url_for from studio.core.engines import db from sqlalchemy.ext.hybrid import hybrid_property from suibe.models.article import ArticleModel __all__ = [ 'NaviChannelModel', 'ChannelModel', 'ChannelSu...
from .PyPolyBoRi import * from .interred import interred def buchberger(l): "calculates a (non minimal) Groebner basis" l = interred(l) #for making sure, that every polynomial has a different leading term #needed for add_generator if not l: return [] g = GroebnerStrategy(l[0].ring()) ...
from BeautifulSoup import BeautifulSoup import mysql.connector import config #Where we keep our passwords and stuff import tldextract import itertools cnx = mysql.connector.connect(user=config.MySQLUsername(), password=config.MySQLPassword(), host=config.MySQLHost(), database=config.MySQLDatabase()) cursor = cnx.curso...
import re import jinja2 from jingo import register, env from langid import classify import mkt from mkt.submit.models import AppSubmissionChecklist def del_by_key(data, delete): """Delete a tuple from a list of tuples based on its first item.""" data = list(data) for idx, item in enumerate(data): ...
#!/usr/bin/env python # coding=utf8 """ Botan CI check installation script This script is used to validate the results of `make install` (C) 2020 Jack Lloyd, René Meusel, Hannes Rantzsch Botan is released under the Simplified BSD License (see license.txt) """ import os import sys import json import re def verify_l...
#! /usr/bin/env python # -*- Python -*- #################################################################################################### import argparse import sys import numpy as np import mupdf as cmupdf from MuPDF import * from PyQt4 import QtCore, QtGui ####################################################...
# # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# This is a template config file for luciddream production. import os import platform HG_SHARE_BASE_DIR = "/builds/hg-shared" if platform.system().lower() == 'darwin': xre_url = "http://tooltool.pvt.build.mozilla.org/build/sha512/4d8d7a37d90c34a2a2fda3066a8fe85c189b183d05389cb957fc6fed31f10a6924e50c1b84488ff61c01...
from sympy import S, symbols, Assume, exp, pi, sqrt, Rational, I, Q, refine, Abs from sympy.utilities.pytest import XFAIL def test_Abs(): x = symbols('x') assert refine(Abs(x), Assume(x, Q.positive)) == x assert refine(1+Abs(x), Assume(x, Q.positive)) == 1+x assert refine(Abs(x), Assume(x, Q.negative))...
""" Solution-Grid definition MIT License Copyright (c) 2017 Gaurav Mathur 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, cop...
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
""" Django settings for app project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import...
from django.test import TestCase from django.contrib.auth.models import User from django.core.urlresolvers import reverse from .models import Question, Answer, Vote from .views import questions, question, answers, answer def make_users(n): return { 'u%s' % i: User(first_name='fn%s' % i, ...
import collections import os import time from abc import abstractmethod import chado ############################################# # BEGIN IMPORT OF CACHING LIBRARY # ############################################# # This code is licensed under the MIT # # License and is a copy of code publicly # # ...
"""Adapter for using Jinja2 with Django.""" import functools import imp import logging import re from django.conf import settings from django.template.base import Origin, TemplateDoesNotExist from django.template.context import get_standard_processors from django.template.loader import BaseLoader from django.utils.imp...
## -*- coding: utf-8 -*- # (C) 2018 Muthiah Annamalai # This file is part of Open-Tamil project # You may use or distribute this file under terms of MIT license ## from __future__ import print_function import codecs import json from solthiruthi import resources from .huffman import huffman, print_huffman_code_cwl de...
import tensorflow as tf #Tensorflow사용을 위한 import from tensorflow.examples.tutorials.mnist import input_data # Dataset loading mnist = input_data.read_data_sets("./samples/MNIST_data/", one_hot=True) # Set up model x = tf.placeholder(tf.float32, [None, 784]) #심볼릭 변수들을 사용하여 상호작용하는 작업들을 기술 W = tf.Variable(tf....
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
import urllib import urllib2 import json import getpass import BaseHTTPServer import os import webbrowser from swiftclient.contrib.federated import federated_exceptions, federated_utils import ssl ## Sends the authentication request to the IdP along # @param idpEndpoint The IdP address # @param idpRequest The authenti...
from server import db class Fuec(db.Model): __table_args__ = {'extend_existing': True} __tablename__ = 'fuec' id = db.Column(db.Integer, primary_key=True) created_at = db.Column(db.DateTime, default=db.func.current_timestamp()) created_by = db.Column(db.Integer, db.ForeignKey('user.id')) no_fu...
from flask import Blueprint, render_template, request, redirect, url_for, \ jsonify from flask_login import login_required, current_user from outline_client.libs.outline import Outline from client.libs.service import Service, Employment from .forms import AddOutlineForm, EditOutlineForm import functools # setup ad...
# coding=utf-8 import traceback import helpers from babelfish.exceptions import LanguageError from support.lib import Plex, get_intent from support.plex_media import get_stream_fps, is_stream_forced, update_stream_info from support.storage import get_subtitle_storage from support.config import config, TEXT_SUBTITLE_EX...
from .base import Base class Payment(Base): @classmethod def get_resource_class(cls, client): from ..resources.payments import Payments return Payments(client) STATUS_OPEN = "open" STATUS_PENDING = "pending" STATUS_CANCELED = "canceled" STATUS_EXPIRED = "expired" STATUS_F...
# # 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 law or agreed to in writing, software # ...
#!/bin/env python """This file contains some utility functions taken from Dan's larger file 'chiffchaffch.py'. Excerpted here are the functions invoked by the main MMRP experiment scripts.""" import os.path import matplotlib.pyplot as plt # User parameters: filteramp = True filtermingap = True doplots = True basepa...
''' _______ | \ \ / @@@; | \ \ / `#....@ | | \ / ,;@.....;,; | | \ / @..@........@` PyWeather Setup | | \ / .............@ version 0.6.3 beta | / \ / .............@ ...
#!/usr/bin/env python3 #Copyright 2018 OSIsoft, LLC # #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 law or agree...
import json import codecs class DRelation(object): """Implicit discourse relation object The object is created from the CoNLL-json formatted data. The format can be a bit clunky to get certain information. So convenient methods should be implemented here mostly to be used by the feature functions ...
from sevenbridges.errors import PaginationError, SbgError from sevenbridges.models.compound.volumes.volume_object import VolumeObject from sevenbridges.models.compound.volumes.volume_prefix import VolumePrefix from sevenbridges.models.link import Link, VolumeLink class Collection(list): """ Wrapper for SevenB...
import sys import os import struct import array from enum import Enum def bytes_to_uint16(byte_list): return struct.unpack('>H', byte_list[:4])[0] def uint16_to_bytes(value): return struct.pack('>H', value) def bytes_to_uint24(byte_list): return struct.unpack('>I', b'\x00' + byte_list[:3])[0] def uint2...
"""Visualization routines.""" from .topomap import (plot_evoked_topomap, plot_projs_topomap, plot_arrowmap, plot_ica_components, plot_tfr_topomap, plot_topomap, plot_epochs_psd_topomap, plot_layout) from .topo import plot_topo_image_epochs, iter_topography from .utils import...
#!/usr/bin/env python3 # vim: set fileencoding=utf-8 : # make.py # An Arma 3 addon build system # Created by ACE 3 team, modified by BC: https://github.com/acemod/ACE3 ############################################################################### # The MIT License (MIT) # Copyright (c) 2013-2014 Ryan Schultz # Per...
from UnitCommands import * from Landing import * deg_to_rad = 0.01745329252 def AddWaypointOrderGroup(GI, lon, lat): unit_count = GI.GetUnitCount() for n in range(0, unit_count): UnitInfo = GI.GetPlatformInterface(n) AddWaypointOrder(UnitInfo, lon, lat) def AddPatrolOrderGroup(GI): ...
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 1997-2015 California Institute of Technology. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE """ Testing the polynomial fi...
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017 Marco Aceti <dev@marcoaceti.it> # # 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 right...
import requests from django.contrib.auth.decorators import login_required from subdomains.utils import reverse from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator from django.views.generic import TemplateView, CreateView, Det...
import json import os from io import open import sys import jsone import mock import pytest import requests import yaml from jsonschema import validate here = os.path.dirname(__file__) root = os.path.abspath(os.path.join(here, "..", "..", "..", "..")) sys.path.insert(0, root) from tools.ci.tc import decision def d...
from libs import db from libs import config from rainwave.playlist_objects.metadata import ( AssociatedMetadata, MetadataUpdateError, make_searchable_string, ) class Artist(AssociatedMetadata): select_by_name_query = "SELECT artist_id AS id, artist_name AS name FROM r4_artists WHERE lower(artist_name...
import os import urllib import urlparse import json from django.conf import settings from django.template import (Library, loader, TemplateSyntaxError, Node, Variable, VariableDoesNotExist) from django.template.defaultfilters import escapejs from django.utils.encoding import smart_str from...
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from churchsource.configuration.models import Setting class Migration(DataMigration): def forwards(self, orm): s = Setting(skey='FACE_SEARCH_ENABLE', name='When True, enables check-in...
""" An advancing front grid generator for use with unstructured_grid Largely a port of paver.py. """ from __future__ import print_function import math import numpy as np from collections import defaultdict import time from scipy import optimize as opt import pdb import logging log=logging.getLogger(__name__) from s...