src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- from __future__ import division import sys sys.path.append('../../') import re import time import random import urlparse as up from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.exceptions import CloseSpider from scra...
############################################################################### # # Copyright (c) 2011 Ruslan Spivak # # 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, inc...
import pysam def open_samfile_for_read(filename): # This check_sq=False is to disable header check so when a bam file is # generated by sambamba view | head, # It can be read by pysam. See more here: # https://github.com/pysam-developers/pysam/issues/51 return pysam.Samfile(filename, "rb", check_...
# -*- coding: utf-8 -*- from django.contrib import messages from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView from django.contrib.auth.mixins import LoginRequiredMixin from base.viewmixins import MenuItemMixin from ..viewmixins import Org...
"""Unit tests for FrameGetProtocolVersionRequest.""" import unittest from pyvlx.api.frame_creation import frame_from_raw from pyvlx.api.frames import FrameGetProtocolVersionRequest class TestFrameGetProtocolVersionRequest(unittest.TestCase): """Test class FrameGetProtocolVersionRequest.""" # pylint: disable...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Authors : Luis Galdos <luisgaldos@gmail.com> # # Copyright (c) 2011, Telefonica Móviles España S.A.U. # # This program 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 F...
from plotly.basedatatypes import BaseTraceType as _BaseTraceType import copy as _copy class Ohlc(_BaseTraceType): # class properties # -------------------- _parent_path_str = "" _path_str = "ohlc" _valid_props = { "close", "closesrc", "customdata", "customdatasrc",...
import couchdb from couchdb.design import ViewDefinition """ This module defines a collection of functions which accept a CouchDB database as an argument, are named with a 'make_views_*' convention, and return a list of generated CouchDB ViewDefinitions. The 'syncviews' management command dynamically executes each me...
#!/usr/bin/env python3 from collections import defaultdict import math from pathlib import Path import re import sys import urllib.request import numpy as np from PIL import Image import spectra from ck2parser import rootpath, csv_rows, SimpleParser, Obj from localpaths import eu4dir from print_time import print_time ...
import sys,os qspin_path = os.path.join(os.getcwd(),"../") sys.path.insert(0,qspin_path) from quspin.operators import hamiltonian from quspin.basis import spin_basis_1d import numpy as np from itertools import product try: from functools import reduce except ImportError: pass dtypes = [(np.float32,np.complex64),(...
# Copyright 2016 PerfKitBenchmarker 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 appli...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 Ericsson AB # # 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 applic...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/framework/tensor_slice.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.proto...
# -*- coding: utf-8 -*- """ test_errors ~~~~~~~~~~~~~ Test errors. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pytest from pubchempy import * def test_invalid_identifier(): """BadRequestError s...
import pytest from thefuck.rules.remove_shell_prompt_literal import match, get_new_command from thefuck.types import Command @pytest.fixture def output(): return "$: command not found" @pytest.mark.parametrize( "script", [ "$ cd newdir", " $ cd newdir", "$ $ cd newdir" " ...
import os from flask import Flask from flask.ext.login import LoginManager, current_user from fundfind import default_settings login_manager = LoginManager() def create_app(): app = Flask(__name__) configure_app(app) configure_jinja(app) setup_error_email(app) login_manager.setup_app(app) ret...
# -*- coding: utf-8 -*- from __future__ import division from numpy import round, maximum as max_, logical_not as not_, logical_or as or_, vectorize, where from ...base import * # noqa analysis:ignore from .base_ressource import nb_enf class af_enfant_a_charge(Variable): column = BoolCol entity_class = In...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('ingest', '0008_auto_20170127_1332'), ('product', '0006_auto_20170127_1348'), ('source', '000...
# -*- coding: utf-8 -*- # Copyright © 2012-2017 Roberto Alsina and others. # 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 t...
"""Monkey patch Python to work around issues causing segfaults. Under heavy threading operations that schedule calls into the asyncio event loop, Task objects are created. Due to a bug in Python, GC may have an issue when switching between the threads and objects with __del__ (which various components in HASS have). ...
# coding=utf-8 from __future__ import absolute_import, unicode_literals, division from puls.models import Manufacturer, ManufacturerForm from puls.compat import unquote_plus from puls import app, paginate import flask @app.route("/admin/manufacturers/", methods=["GET", "POST"], endpoint="manage_manufactur...
from django.conf.urls import include, url from django.contrib import admin from django.views.generic import TemplateView from . import views from wunderlist import urls as wunderlist_urls from wh_habitica import urls as habitica_urls urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', views.index, n...
import struct from Crypto.Cipher import AES """ http://www.ietf.org/rfc/rfc3394.txt quick'n'dirty AES wrap implementation used by iOS 4 KeyStore kernel extension for wrapping/unwrapping encryption keys """ def unpack64bit(s): return struct.unpack(">Q",s)[0] def pack64bit(s): return struc...
# Copyright (c) 2014 Rackspace, 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 wr...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2008 Jerome Rapinat # Copyright (C) 2008 Benny Malengier # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publ...
# The MIT License (MIT) # # Copyright (c) 2015-2016 Massachusetts Institute of Technology. # # 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 ...
import json import os from django.http import JsonResponse, StreamingHttpResponse from django.views.decorators.http import require_http_methods from authentication import authenticator from machine import machine_controller from virtualbox import virtualbox_controller GUEST_ADDITIONS_DIR = '/var/tinymakecloud/additi...
# -*- coding: utf-8 -*- """ Created on Tue Jun 23 06:53:32 2015 @author: chaojun """ from pyminer_cos_model import lcdm from pyminer_residual import JLAresiCal, CMBresiCal, BAOresiCal # Genearl setting divMax = 15 # for romberg integral ogh2 = 2.469e-5 JLA_DIR = '/Users/chaojun/Documents/Research/2015/grb/pyc...
from toee import * import char_class_utils import char_editor ################################################### def GetConditionName(): # used by API return "Ranger" # def GetSpellCasterConditionName(): # return "Ranger Spellcasting" def GetCategory(): return "Core 3.5 Ed Classes" def GetClassDefinitionFlags(...
#-*- coding: utf-8 -*- def factorial(n): """Return the factorial of n""" if n < 2: return 1 return n * factorial(n - 1) def fibonacci(n): """Return the nth fibonacci number""" if n < 2: return n return fibonacci(n - 1) + fibonacci(n - 2) def fib_fac(x=30, y=900): fib = ...
#!/usr/bin/env python2 """Display multi-page text with simultaneous auditory distractions, recording eye position data using the EyeLink eye tracker.""" # DistractionTask_eyelink_d6.py # Created 3/16/15 by DJ based on VidLecTask.py # Updated 3/31/15 by DJ - renamed from ReadingTask_dict_d2.py. # Updated 4/1-16/15 by D...
from time import time from math import sqrt # Time some code def timeIt(code): start = time() exec code return time()-start # Find primes up to a certain number and output a dictionary with them as keys def primes(top): sieve = [0]*top for m in range(2, top+1): if sieve[m-1] == 0: # if m prime for n in rang...
from copy import deepcopy from typing import Any, Dict from keras import backend as K from overrides import overrides from ..masked_layer import MaskedLayer from ...common.params import get_choice_with_default from ...tensors.masked_operations import masked_softmax from ...tensors.similarity_functions import similari...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import numpy as np from scipy.fftpack import dct, idct import sys ''' ---------- FUNCTIONS ---------- ''' def get_config(): config = {} config['sound_file'] = "harvestmoon-mono-hp500.wav" config['save_file'] = config['sound_file'] + "_modelsave_" config['blocksize']=13000 config['comp...
#!/usr/bin/env python import sys import os from flask import Flask, redirect, url_for # ensure lpm is found and can be directly imported from this file sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import lpm app = Flask(__name__) app.config.update( DEBUG=True, S...
#! /usr/bin/env python import sys import time import logging import configpi import os file_path = os.path.dirname(__file__) sys.path.insert(0, file_path) from flask import Flask, render_template, jsonify, Response from backend import Backend app = Flask(__name__) backend = Backend() @app.route('/', strict_slashe...
#!/usr/bin/python3 import argparse import os import icon_lib parser = argparse.ArgumentParser(description='iconograph persistent') parser.add_argument( '--chroot-path', dest='chroot_path', action='store', required=True) FLAGS = parser.parse_args() def main(): module = icon_lib.IconModule(FLAGS.c...
# Copyright (c) 2018 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
# importing existing friend, steganography library, and datetime. from select_friend import select_friend from steganography.steganography import Steganography from datetime import datetime from spy_details import friends, ChatMessage #importing regular expression for proper validation import re # importing termcolor...
# -*- coding: utf-8 -*- ''' Tulip routine libraries, based on lambda's lamlib Url dispatcher module thanks to tknorris Author Twilight0 License summary below, for more details please read license.txt file This program is free software: you can redistribute it and/or modify it unde...
# Example backend, which performs simple calculations. It implements # simple_graph_engine API from earlpipeline.backends.base_simple_engine import Pipeline, Unit, InPort, OutPort, Parameter import time class Number(Unit): out = OutPort('out') value = Parameter('value', 'input', float, 5.9, datatype='number')...
import os import fabric.api as fab import jinja2 import json from fabric.context_managers import path from fabric.decorators import roles from pyramid.settings import aslist from stiny.gutil import normalize_email fab.env.roledefs = { 'door': ['pi@192.168.86.200'], 'web': ['stevearc@stevearc.com'], } def _...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division """ TR-55 tables """ # For the different land uses, this describes the NLCD class value, the landscape factor (ki) and the Curve # Numbers for each hydrologic soil group for that use ...
# coding: utf-8 """ File ID: 3ngd7IH """ from __future__ import absolute_import import imp import os.path import sys try: from urllib.request import urlopen ## Py3 except ImportError: from urllib2 import urlopen ## Py2 #/ __version__ = '0.2.2' #/ define |exec_| and |raise_| that are 2*3 compatible. ## ## Mod...
import datetime as dt from functools import partial import inspect import pytest import numpy as np import pandas as pd from pandas.util.testing import assert_index_equal, assert_series_equal, assert_frame_equal from numpy.testing import assert_equal assert_series_equal_strict = partial(assert_series_equal, check_dty...
# Copyright (c) 2015-2016 Tigera, Inc. 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 applicabl...
""" DATA,Chuva,Chuva_min,Chuva_max,VVE,VVE_min,VVE_max,DVE,DVE_min,DVE_max,Temp.,Temp._min,Temp._max,Umidade,Umidade_min,Umidade_max,Rad.,Rad._min,Rad._max,Pres.Atm.,Pres.Atm._min,Pres.Atm._max,Temp.Int.,Temp.Int._min,Temp.Int._max,CH4,CH4_min,CH4_max,HCnM,HCnM_min,HCnM_max,HCT,HCT_min,HCT_max,SO2,SO2_min,SO2_max,O3,O3...
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101 # Smartsheet Python SDK. # # Copyright 2018 Smartsheet.com, 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....
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://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, eithe...
# Copyright 2013 IBM Corp # 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 appl...
import pytest from libpagure import Pagure @pytest.fixture(scope='module') def simple_pg(): """ Create a simple Pagure object to be used in test """ pg = Pagure(pagure_repository="testrepo") return pg def test_pagure_object(): """ Test the pagure object creation """ pg = Pagure(pagure_...
from PyQt5.QtWidgets import QWidget, QSplitter, QVBoxLayout, QFrame, QFileDialog, QScrollArea, QMenuBar, QAction, QToolBar from PyQt5.QtCore import Qt from PyQt5.QtGui import QIcon from JamSpace.Views.LaneSpaceView import LaneSpaceView from JamSpace.Views.ControlBar import ControlBar class MainView(QWidget): ...
""" Tests the models of the organization application """ # Django from django.test import TestCase # Standard Library from datetime import date # Third Party from nose.tools import assert_false, assert_raises, assert_true, eq_ # MuckRock from muckrock.core.factories import UserFactory from muckrock.foia.exceptions ...
__author__ = 'cerias2' import ConfigParser class Singleton(type): _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) return cls._instances[cls] class ConfigMonitor(object): __...
import gocept.testing.mock import lxml.etree import mock import unittest import zeit.content.article.testing import zope.schema class EditableBodyTest(zeit.content.article.testing.FunctionalTestCase): def setUp(self): super(EditableBodyTest, self).setUp() self.patches = gocept.testing.mock.Patche...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Filename: Music.py # Description: Functions for Music # Author: Simon L. J. Robin | https://sljrobin.org # Created: 2016-09-11 22:50:11 # Modified: 2016-09-25 23:50:25 # #################################################################...
# Copyright 2017 Google 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, s...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """Scikit learn interface for :class:`~gensim.models.tfidfmodel.TfidfModel`. Follows scikit-learn API conventions to facilitate using g...
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os from builtins import object, str import mock from pants.base.specs import Sib...
from __future__ import print_function, division from sympy.core.compatibility import reduce from operator import add from sympy.core import Add, Basic, sympify from sympy.functions import adjoint from sympy.matrices.matrices import MatrixBase from sympy.matrices.expressions.transpose import transpose from sympy.strat...
# -*- encoding: utf-8 -*- __author__ = 'kotaimen' __date__ = '2/19/15' import unittest from stonemason.formatbundle import TileFormat, InvalidTileFormat class TestTileFormat(unittest.TestCase): def test_init(self): fmt = TileFormat(format='JPEG') self.assertEqual(fmt.format, 'JPEG') sel...
from django.db import models from django.contrib.auth.models import User # Create your models here. class Restaurant(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='restaurant') name = models.CharField(max_length=500) phone = models.CharField(max_length=500) add...
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" import unittest from code_reflector import html_reflector class SelectorOutputTestCase(unittest.TestCase): def setUp(self): self.ref = html_reflector.HTMLReflector() def test_single_class(self): res = self.ref.pro...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ # import salt # # <Salt ID>: # The id to reference the target system with # host: # The IP address or DNS name of the remote host # user: # The user to log in as # passwd: # The password to log in with # # ...
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from collections import d...
from sqlalchemy import create_engine,Table import warnings import sys warnings.filterwarnings('ignore', '^Unicode type received non-unicode bind param value') if len(sys.argv)<2: print "Load.py destination" exit() database=sys.argv[1] if len(sys.argv)==3: language=sys.argv[2] else: language='...
# -*- coding: UTF-8 -*- ## Copyright 2012-2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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 y...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
# coding=utf-8 import unittest """688. Knight Probability in Chessboard https://leetcode.com/problems/knight-probability-in-chessboard/description/ On an `N`x`N` chessboard, a knight starts at the `r`-th row and `c`-th column and attempts to make exactly `K` moves. The rows and columns are 0 indexed, so the top-left ...
import uuid import time from functools import partial from collections import Counter from threading import Thread from queue import Queue, Empty class TaskManager: @staticmethod def hash_task(task): return hash(''.join(str(task.get(key, '')) for key in ('package', 'version', 'function'))) def __...
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard(object): # This context manager registers itself in the current iterators of the # weak containe...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 Paul Durivage <pauldurivage@gmail.com> # # This file is part of linky. # # 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...
"""Defines IntegrityChecker.""" import re import concurrent.futures from typing import ( # noqa: F401 Any, cast, List, Optional, Set, ) from .function_description import ( # noqa: F401 FunctionDescription, ) from .docstring.base import BaseDocstring from .docstring.docstring import Docstring...
import numpy as np import pickle import os from numpy.testing import assert_array_almost_equal from skcv import data_dir from skcv.multiview.two_views.fundamental_matrix import * from skcv.multiview.util.points_functions import * from skcv.multiview.util.camera import * from skcv.multiview.two_views import triangulat...
import unittest class PlayerStrings(object): Name = 'name' Position = 'position' Team = 'team' FantasyOwner = 'owner' Link = 'link' Stats = 'stats' GamesPlayed = 'GamesPlayed' ProjectedPrefix = 'Projected' def __init__(self, prefix=None): if prefix is None: se...
# -*- coding: utf-8 -*- """ Created on Fri Dec 18 14:11:31 2015 @author: Martin Friedl """ import itertools from datetime import date from random import choice as random_choice import numpy as np from Patterns.GrowthTheoryCell import make_theory_cell from Patterns.GrowthTheoryCell_100_3BranchDevices import make_the...
import re from datetime import datetime import logging from ubr.utils import group_by_many, visit from ubr import conf, s3 from ubr.descriptions import load_descriptor, find_descriptors, pname LOG = logging.getLogger(__name__) def bucket_contents(bucket): "returns a list of all keys in the given bucket" pagi...
#!/usr/bin/env python """ Actions allow you to write code that looks like:: class RandomController(BaseController): def GET(self): return Redirect("/") which I think looks a lot nicer than:: class RandomController(BaseController): def GET(self): self.head.status = "303 SEE OTHER" ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from configman import RequiredConfig, Namespace, class_converter from datetime import datetime #----------------------...
#!/usr/bin/env python from setuptools import setup, find_packages # TODO: read README and LICENSE files to compose "long description" # # This might be useful: # http://stackoverflow.com/questions/1192632/how-to-convert-restructuredtext-to-plain-text # http://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-p...
#!/usr/bin/env python """ JobsApi.py Copyright 2015 SmartBear Software 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...
# -*- coding: utf-8 -*- from .commands import * # Мапа соответствий: строковое представление команды VM - класс команды VM commands_map = { 'PUSH': Push, 'POP': Pop, 'NOP': Nop, 'DUP': Dup, 'LOAD': Load, 'PLOAD': PLoad, 'BLOAD': BLoad, 'BPLOAD': BPLoad, 'DLOAD': DLoad, 'DBLOAD...
from django.test import TransactionTestCase from django.db.models import Q from django.test.client import RequestFactory from django.utils.text import slugify from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, Permission from mc2.organizations.models import Organization, Organ...
# -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) { 'name': 'Stock Pack Wizard', 'version': '7.0.1.0.0', 'author': 'Elico Corp', 'website': 'https://www.elico-corp.com', 'summary': '', 'description' : """ ...
"""Define imports.""" from PIL import ImageFilter, ImageOps, ImageEnhance def grayscale(image, name, temp_url): """Return an image with a contrast of grey.""" image.seek(0) photo = ImageOps.grayscale(image) photo.save(temp_url + "GRAYSCALE" + name) return temp_url + "GRAYSCALE" + name def smooth...
from django.conf import settings from django.contrib.auth.decorators import login_required from commoner.broadcast.models import Message, Log def messages(request): if request.user.is_authenticated(): messages = Message.active.all() site_messages = [] for message in m...
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
#!/usr/bin/env python2 # References: # https://fedoraproject.org/wiki/Koji/ServerHowTo # https://github.com/sbadakhc/kojak/blob/master/scripts/install/install import util.cfg as cfg import util.pkg as pkg import util.cred as cred from util.log import log # # Setup # log.info("General update") pkg.clean() pkg.update...
import collections import itertools import logging from archinfo import ArchSoot from claripy import BVV, StrSubstr from ...calling_conventions import DefaultCC from ...sim_procedure import SimProcedure from ...sim_type import SimTypeFunction from ...state_plugins.sim_action_object import SimActionObject l = loggin...
from io import StringIO from flask import Blueprint, current_app, jsonify, request, send_file from sqlalchemy.orm.exc import NoResultFound from app.dao.events_dao import dao_get_event_by_old_id from app.dao.magazines_dao import dao_get_magazine_by_old_id from app.errors import register_errors, InvalidRequest from app....
import parser import random result = '' symbol = {} cnt = 0 def Translator(ast): def PrintError(x): print(x) exit(1) def PrintMsg(x): print(x) def Output(x): global result result += str(x) + ' ' def GetRandomInt(interval): if isinstance(interval, str)...
from json import dumps # pragma: no cover from sqlalchemy.orm import class_mapper # pragma: no cover from app.models import User, Group # pragma: no cover def serialize(obj, columns): # then we return their values in a dict return dict((c, getattr(obj, c)) for c in columns) def queryAllToJson(model,conditions): # ...
""" Work in progress. Bayes network classes that will convert a network specification into a set of TensorFlow ops and a computation graph. The main work of the classes is to move from a directed graph to a set of formulas expressing what's known about the probability distribution of the events represented in the gra...
# Copyright 2019 Google 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 agreed to in writing, s...
#MenuTitle: Merge Suffixed Glyphs into Color Layers # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Takes the master layer of suffixed glyphs (e.g., x.shadow, x.body, x.front) and turns them in a specified order into CPAL Color layers of the unsuffixed glyph (e.g., ...
#!/usr/bin/env python3 # # Copyright {{ cookiecutter.author_name }}, {{ cookiecutter.initial_year_to_release }} # # 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/licen...
# -*- coding: utf-8 -*- ''' Methods for scoring the relative goodness of strings. Note that scores are relative to other scores *from the same method*. Score from one method have no relation to scores from a different method. Created on Feb 10, 2015 @author: Chris ''' from __future__ import absolute_im...
import wx import wx.html2 import wx.lib.agw.aui as aui from wx.lib.newevent import NewEvent from LowerPanelView import ViewLowerPanel from gui.controller.CanvasCtrl import CanvasCtrl from gui.controller.ToolboxCtrl import ToolboxCtrl from gui.controller.ModelCtrl import ModelDetailsCtrl # create custom events wxCreate...
# Topydo - A todo.txt client written in Python. # Copyright (C) 2014 Bram Schoenmakers <me@bramschoenmakers.nl> # # 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,...