src
stringlengths
721
1.04M
import copy import logging import os import re from importlib.util import find_spec from deoplete.base.source import Base from deoplete.util import bytepos2charpos, getlines, load_external_module load_external_module(__file__, 'sources') from deoplete_jedi import profiler # isort:skip # noqa: E402 # Type mapping....
import sys from PyQt4 import QtCore from PyQt4.QtCore import pyqtSlot from PyQt4.QtGui import * import os class MyStream(object): def write(self, text): # Add text to a QTextEdit... sys.stdout = MyStream() class EmittingStream(QtCore.QObject): textWritten = QtCore.pyqtSignal(str) def write(self, ...
#! /usr/local/bin/python """Script for designing a set of non-contiguous recombination libraries for site-directed, structure-guided homologous recombination. ****************************************************************** Copyright (C) 2011 Matt Smith, California Institute of Technology This program ...
from conans import ConanFile, CMake from conans import tools import os class freetypeConan(ConanFile): name = "freetype" version = "2.6.2" url = "https://github.com/Kaosumaru/conan-freetype" settings = "os", "compiler", "build_type", "arch" exports = "freetype/*" freetype_name = "freetype-%s" ...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import socket from .._ffi import ( buffer_from_bytes, bytes_from_buffer, cast_void_p, FFIEngineError, is_null, string_from_buffer, unicode_buffer, ) try: from ._ws2_32_cffi import ws2_32...
from __future__ import absolute_import, print_function import itertools import logging import time import traceback import uuid from datetime import datetime, timedelta from random import Random import six from django.contrib.webdesign.lorem_ipsum import WORDS from django.core.urlresolvers import reverse from django....
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_M_R_RET_CUST_FLOW').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) sc....
# -*- coding: utf-8 -*- # Adapted from a contribution of Johan Dahlin import collections import sys try: import multiprocessing except ImportError: # Python 2.5 multiprocessing = None import pep8 __all__ = ['multiprocessing', 'BaseQReport', 'QueueReport'] class BaseQReport(pep8.BaseReport): """Base...
# Copyright (c) 2014 Red Hat, 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 require...
# No shebang line, this module is meant to be imported # # Copyright 2013 Oliver Palmer # # 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 # # U...
# -*- coding: utf-8 -*- # # Copyright 2011-2018 Matt Austin # # 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...
import re, os,sys import numpy as N from tables import * import scipy.odr import pylab as P conv = 6.36e-5 gamma = 2.67522e8 start = 50 stop = 250 def diffusion(p,x): sig = N.exp(-p[0]*x)+p[1] return sig hdf = openFile(sys.argv[1]) temperature_runs = [run for run in hdf.root.data_pool if run._v_name.startswith(...
from flask_dance.consumer.storage import BaseStorage import flask class SessionStorage(BaseStorage): """ The default storage backend. Stores and retrieves OAuth tokens using the :ref:`Flask session <flask:sessions>`. """ def __init__(self, key="{bp.name}_oauth_token"): """ Args: ...
from PyQt5.QtCore import pyqtSignal, Qt from PyQt5.QtWidgets import QWidget, QVBoxLayout, QTextEdit, QHBoxLayout, QPushButton class TextInput(QWidget): # used when input text inputChanged = pyqtSignal() okPressed = pyqtSignal() cancelPressed = pyqtSignal() def __init__(self, parent=None): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Packaging setup for dsh-orderwrt-bug.""" from sample import __version__ as version try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :chan...
"""Unit-tests for the `sniff_and_cast` processor.""" from datetime import date, datetime from decimal import Decimal from math import floor from jsontableschema.types import DateType, NumberType from pytest import fixture, mark, raises from collections import UserList from common.config import ( NUMBER_FORMATS, ...
# -*- coding: utf-8 -*- """ urlresolver XBMC Addon Copyright (C) 2013 Bstrdsmkr This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at y...
# django-cardbox -- A collection manager for Magic: The Gathering # Copyright (C) 2016 Benedikt Rascher-Friesenhausen # 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 Lice...
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
from django.views import View from django.conf import settings from datetime import datetime from api.helpers.mixins import AuthRequiredMixin from api.helpers.http.jsend import JSENDSuccess, JSENDError from api.models.resources import Membership, Stage from libs.utils.model_ext import model_to_dict from worker.tasks...
#!/usr/bin/env python """Base classes for artifacts.""" import logging from grr.lib import aff4 from grr.lib import artifact_lib from grr.lib import config_lib from grr.lib import flow from grr.lib import rdfvalue from grr.lib import registry from grr.lib import utils class AFF4ResultWriter(object): """A wrapper ...
from copy import copy from inspect import signature, _empty import re from collections.abc import Iterable from collections import defaultdict from itertools import product from six import string_types def isiter(obj): try: iter(obj) except TypeError: return False else: return True...
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2012 Carlos Eduardo Vercelino - CLVsol # # ...
from models.album import Album def test_instance(database): album = Album(database, 1) assert album.id == 1 assert album.name == "Album 1" assert album.date == "1999-02-04" def test_artists(database): album = Album(database, 1) assert len(album.artists) == 1 assert album.artists[0].name ...
import re MEMENTO_DATETIME = 'Memento-Datetime' ACCEPT_DATETIME = 'Accept-Datetime' LINK = 'Link' VARY = 'Vary' LINK_FORMAT = 'application/link-format' class MementoMixin(object): def _timemap_get(self, url, fmod=True, **kwargs): app = self.testapp if fmod else self.testapp_non_frame return app.ge...
from django.conf import settings from . import SentryCommand from ...models import enqueue_favicon, Feed, UniqueFeed class Command(SentryCommand): """Updates the users' feeds""" def handle_sentry(self, *args, **kwargs): missing = Feed.objects.raw( """ select f.id, f.url ...
__author__ = 'TOSUKUi' from requests.exceptions import * class APIException(Exception): """ Base class for all API exception """ pass class ProjectPageEndException(APIException): """ An error caused by crawl ended and hided project page """ pass class ProjectPageNotPublishedExcepti...
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2018-01-12 15:39 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0040_page_draft_t...
# -*- coding: utf-8 -*- # # Akamatsu CMS # https://github.com/rmed/akamatsu # # MIT License # # Copyright (c) 2020 Rafael Medina García <rafamedgar@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'GeneratedReport.dataset' db.delete_column('lizard_htmlreport_generatedreport', 'dataset_...
# -*- coding: utf-8 -*- """ Modulo per la gestione della connessione al gioco con tecnologia simil-comet. """ #= IMPORT ====================================================================== from twisted.web.server import NOT_DONE_YET from src.web_resource import WebResource #= CLASSI ==========================...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from benchmarks import startup2 import page_sets from telemetry import benchmark # TODO(gabadie): Replaces start_with_url.* by start_with_url2.* after con...
import decimal import inspect import time from zope.interface import implements, classProvides from feat.common import serialization, enum, first, defer, annotate, error from feat.common import container from feat.database.interface import IPlanBuilder, IQueryField, IQueryFactory from feat.database.interface import ...
# -*- coding: utf-8 -*- """ Created on Sat Sep 10 15:25:02 2016 @author: jessime """ import pygame import minesweeper_game.events as events class Controller(): def __init__(self, ev_manager, model): self.ev_manager = ev_manager self.model = model self.ev_manager.register(self) s...
# Copyright 2011 Google 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 applicable law or agreed t...
#!/usr/bin/env python from __future__ import print_function import time import argparse import cv2 import os from operator import itemgetter from collections import defaultdict from scipy.cluster.hierarchy import linkage, fcluster from scipy.spatial.distance import pdist import numpy as np import caffe from classif...
#!/usr/bin/env python # 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 ...
# -*- coding: utf-8 -*- ''' BEGIN OF PROGRAM ---------------------------------------------------------------------------- AUTHOR : Alex Gamas MAIN GOAL : Open an Image file and display this! VERSION : 0.1.2 USAGE TIPS : ---------------------------------------------------------------------------- ''' from PyQ...
from __future__ import unicode_literals from django.contrib.auth.models import User from djblets.testing.decorators import add_fixtures from reviewboard.diffviewer.models import DiffSetHistory from reviewboard.reviews.models import (DefaultReviewer, ReviewRequest, ReviewRequest...
# -- coding: utf-8 -- # Das Modul argv aus Packet sys wird importiert from sys import argv # Die Variablen script und filename werden entpackt # sie müssen dem Script als Argumente mitgegeben werden beim ausführen # z.B so: python ex15_reading_files.py ex15_sample.txt script, filename = argv # Der Inhalt der Datei e...
import random import factory import factory.django import factory.fuzzy from django.contrib.auth import models as auth from pycon.models import PyConProposalCategory, PyConProposal, \ PyConTalkProposal, PyConTutorialProposal, ThunderdomeGroup from symposion.proposals.tests.factories import ProposalKindFactory, ...
try: import __builtin__ except: import builtins try: import gdb except: pass import os import os.path import sys import struct import types def warn(message): print("XXX: %s\n" % message.encode("latin1")) from dumper import * ####################################################################...
# -*- coding: utf-8 -*- from mock import Mock from rest_framework.test import APIRequestFactory from olympia.amo.templatetags.jinja_helpers import absolutify from olympia.amo.tests import TestCase, addon_factory, user_factory from olympia.ratings.models import Rating from olympia.ratings.serializers import RatingSeria...
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
import random import pickle import numpy as np from pygmin.potentials.gminpotential import GMINPotential from pygmin.optimize.quench import mylbfgs, fire import oxdnagmin_ as GMIN import time from pygmin.systems import oxdna from optparse import OptionParser parser = OptionParser() parser.add_option("--tol", dest="tol...
#Defines a student class capable of storing 2 names and a dictionary of courses/marks #can compute the arithmetic mean average of a student's grades class Student: name= "" family= "" courseMarks={} def __init__(self, name, family): self.name = name self.family = family def addCourseMark(self, course, mark): ...
#! /usr/bin/env python # -*- coding: utf-8 -*- from loguru import logger import glob import numpy as np import os # TODO remove cv2 - done import matplotlib.pyplot as plt from fnmatch import fnmatch try: import pydicom as pdicom except ImportError: import warnings with warnings.catch_warnings(): ...
# # 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...
import logging import json import re class IAMPolicy: def __init__(self, logging_level = logging.DEBUG): logging.basicConfig(level=logging_level) self.statements = [] self.service_actions = {} self.max_policy_size = { 'user' : 2048, # User policy size c...
#!/usr/bin/env python import modes import GoogleMaps import RATP import time import re import sys lastError = "" unrecognizedAddresses = [] def getDist(mode, origins, destinations, timestamp = None, isArrivalTime = True, googleApiKey = None, useSuggestions = True, optimistic = 0, avoidTolls = False, useRATP ...
import os import shutil import subprocess import sys # find_library(name) returns the pathname of a library, or None. if os.name == "nt": def _get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 23 07:24:21 2017 @author: Bob Anderson """ import os tangraNeedsBackgroundSubtraction = True pymovieSignalColumnCount = 0 def readLightCurve(filepath): """ Reads the intensities and timestamps from Limovie, Tangra, PYOTE, or R-OTE c...
# -*- coding: utf-8 -*- import re import sys from subprocess import CalledProcessError from testtools import ExpectedException from testtools.assertions import assert_that from testtools.matchers import Equals, MatchesRegex, MatchesStructure from docker_ci_deploy.__main__ import ( cmd, DockerCiDeployRunner, join_...
# Copyright (c) 2011 Rackspace US, 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...
# Python 2.7 """ An Application of Genetic Algorithms Task: Inscribe a triangle of the maximum area in a given ellipse. Ellipse is defined as: (x/a)^2 + (y/b)^2 = 1 """ import math import matplotlib.pyplot as plt import numpy as np import random from timeit import default_timer as timer tstart = ti...
# Copyright 2015 Google 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 applicable law ...
#!/usr/bin/python # -*- coding: utf-8 -*- #Author: Bruno Expósito #Contact: bruno.exposito@openmailbox.org #License: GPL 3 #Original design: http://hxmarius.deviantart.com/art/Elementary-Shutdown-Dialog-Mockup-V2-359472999 import sys, os from PyQt4 import QtCore from PyQt4.QtGui import * class HoverButton(QToolButto...
####<i>This sample will show how to use <b>MoveFile</b> method from Storage Api to copy/move a file in GroupDocs Storage </i> #Import of classes from libraries import base64 import os from pyramid.renderers import render_to_response from groupdocs.ApiClient import ApiClient from groupdocs.StorageApi import StorageAp...
# Copyright 2020 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
# # edittrackersdialog.py # # Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may 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) ...
# This file is subject to the terms and conditions defined in LICENSE. # (c) 2011-2013, ReportGrid Inc. All rights reserved. import json import logging import posixpath import time import datetime import sys from httplib import HTTPSConnection, HTTPConnection from urllib import urlencode, quote_plus, pathname2url fro...
from docstore import connect as docstore_connect from pika import BlockingConnection, ConnectionParameters from re import match from time import time as now from urllib2 import build_opener, HTTPHandler, Request, urlopen EXCHANGE = 'alexandra' HTTP_PATIENCE_SEC = 1 class AMQPConnection: def __init__(self, url, co...
#!/usr/bin/env python # # Tests the Gaussian logpdf toy distribution. # # This file is part of PINTS. # Copyright (c) 2017-2019, University of Oxford. # For licensing information, see the LICENSE file distributed with the PINTS # software package. # import pints import pints.toy import unittest import numpy as np ...
#!/usr/local/bin/python3 # ############################################################################### # Copyright 2015 Natural Message, LLC. # Author: Robert Hoot (naturalmessage@fastmail.fm) # # This file is part of the Natural Message Shard Server. # # The Natural Message Shard Server is free software: you can r...
""" Copyright (c) 2014-2015-2015, The University of Texas at Austin. All rights reserved. This file is part of BLASpy and is available under the 3-Clause BSD License, which can be found in the LICENSE file at the top-level directory or at http://opensource.org/licenses/BSD-3-Clause """ from ..he...
# -*- coding: utf-8 -*- """ werkzeug.formparser ~~~~~~~~~~~~~~~~~~~ This module implements the form parsing. It supports url-encoded forms as well as non-nested multipart uploads. :copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more deta...
# Author: Jason Lu import _thread as thread, time import threading from MyWindow import Ui_MainWindow as MainWindow from PyQt5.QtCore import QThread, pyqtSignal, QObject, QDateTime import LYUtils as utils # 单例模式 # 使用__new__方法 class Singleton(object): def __new__(cls, *args, **kwargs): if not hasattr(cls, ...
import pandas as pd import os, sys import glob # dataframe of input file df = pd.read_csv('/Users/michelle/surfdrive/Shared/trichome_team/06.results_from_xp/sRNA-Seq/20170117_srnadesc/shortstack/concat_miRNA.txt', sep="\t") # An extra column named "Present in accessions" with the value "unique" is created next to Acc...
# -*- coding: utf-8 -*- import sys, os sys.path.insert(0, os.path.abspath('../..')) import unittest, pandas, numpy, datetime, itertools, rnn from sklearn import cross_validation, preprocessing class ExternalRNN(unittest.TestCase): """Test cases for Ibovespa tendency problem.""" grid_search = True def te...
# Copyright 2006-2007 Lukas Lalinsky # Copyright 2005-2006 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # $Id: asf.py 4153 2007-08-05 07:07:49Z piman $ """Read an...
# 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 may ...
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: May 26, 2003 # Author: Francesc Alted - faltet@pytables.com # # $Id$ # ######################################################################## """Here is defined the AttributeSet class.""" im...
# Authors: Daichi Yoshikawa <daichi.yoshikawa@gmail.com> # License: BSD 3 clause import sys sys.path.append('../..') import json import numpy as np """Configure logger before importing dnnet.""" import logging.config with open('../common/logging.json') as f: data = json.load(f) logging.config.dictConfig(data...
import requests class RequestsClient: def __init__(self, base_url, tls_enabled, **kwargs): if tls_enabled: self.base_url = f'https://{base_url}' else: self.base_url = f'http://{base_url}' self.session = requests.Session() for arg in kwargs: if is...
import json try: from urllib.parse import quote_plus except ImportError: from urllib import quote_plus from py_splash.static import ( LUA_SOURCE, GET_HTML_ONLY, GET_ALL_DATA, RETURN_HTML_ONLY, RETURN_ALL_DATA, PREPARE_COOKIES, JS_PIECE, SET_PROXY, USER_AGENT, GO ) from...
# VISUALIZATION ---------------------- import networkx as nx from networkx.drawing.nx_agraph import write_dot, graphviz_layout import matplotlib.pyplot as plt def draw_graph(G): plt.rcParams["figure.figsize"] = [10., 5.] pos = graphviz_layout(G, prog='dot') node_labels = nx.get_node_attributes(G, 'name'...
# -*- coding: utf-8 -*- """ proxy.py ~~~~~~~~ ⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging. :copyright: (c) 2013-present by Abhinav Singh and contributors. :license: BSD, see LICENSE...
from collections import defaultdict import pymongo import requests from bs4 import BeautifulSoup import numpy as np import newspaper def in_clean_db(title, database): ''' PURPOSE: check if article is in given database INPUT: title (str) - article headline database (pymongo obj) - c...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'TeeTime.people' db.delete_column('tracker_teetime', 'pe...
# -*- coding:utf-8 -*- """ PyHdust *input* module: Hdust input tools. :co-author: Rodrigo Vieira :license: GNU GPL v3.0 (https://github.com/danmoser/pyhdust/blob/master/LICENSE) """ import os as _os import numpy as _np from glob import glob as _glob from itertools import product as _product import pyhdust.phc as _phc...
''' Functions for parsing the toplevel mets file that contains metadata on an issue. Use the main() function. TO DO - I've seen that <typeOfResource>still image</> can be <genre>Music</genre> I don't know if this distinction is important and should I record genre ''' import bs4 import logging import os import re...
""" ethernetad.py Created by Thomas Mangin on 2014-06-27. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ # from struct import pack # from struct import unpack # from exabgp.protocol.family import AFI # from exabgp.protocol.family import SAFI # from exabgp.bgp.message.update.nlri.qualifier.esi import ...
############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contract 89233218CNA000001 # ...
# -*- coding: utf-8 -*- ###################################################################### # # Note: Program metadata is available in /__init__.py # ###################################################################### from openerp.osv import fields, osv from openerp import tools class partner_aging_supplier(o...
from .constants import * from .exceptions import * import steam_vr_wheel.pyvjoy._sdk as _sdk class VJoyDevice(object): """Object-oriented API for a vJoy Device""" def __init__(self,rID=None, data=None): """Constructor""" self.rID=rID self._sdk= _sdk self._vj=self._sdk._vj if data: ...
# encoding: utf-8 # module PyQt4.QtCore # from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import sip as __sip class QReadWriteLock(): # skipped bases: <class 'sip.simplewrapper'> """ QReadWriteLock() QReadWriteLock(QReadWriteLock.Re...
# -*- coding: utf-8 -*- import mock import unittest import logic.email class EmailTest(unittest.TestCase): """We really just want to test that configuration is honored here.""" sender = 'test@example.com' recipient = 'test@example.com' subject = 'test subject' html = '<p>hello test</p>' text...
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import pickle import pytest from jax import random, test_util import jax.numpy as jnp import numpyro import numpyro.distributions as dist from numpyro.infer import ( HMC, HMCECS, MCMC, NUTS, SA, BarkerMH, ...
from os import environ from random import random import json import tweepy import requests from requests.exceptions import ConnectionError from flask import render_template, request, jsonify from flask.ext.mail import Message from tweetTrack.app import app, mail, db from tweetTrack.app.forms import TwitterForm, Contact...
#!/usr/bin/env python #coding=utf8 # Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version...
from typing import Optional import pandas as pd import pytest from pybaseball.standings import standings from pybaseball.utils import most_recent_season def get_division_counts_by_season(season: Optional[int]) -> int: if season is None: season = most_recent_season() - 1 if season >= 1994: r...
# -*- coding: utf-8 -*- from rest_framework import permissions from ..base import (BasePermissionComponent, BaseComposedPermision, And, Or) class AllowAll(BasePermissionComponent): """ Always allow all requests without any constraints. """ def has_permissi...
""" program.py: Program structures for worldview solving Copyright (C) 2014 Michael Kelly This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or ...
from direct.task import Task from direct.fsm import FSM, ClassicFSM, State from toontown.toonbase.ToonPythonUtil import randFloat, Functor from direct.directnotify import DirectNotifyGlobal from toontown.pets import PetConstants from toontown.toon import DistributedToonAI class PetGoal(FSM.FSM): notify = DirectNot...
# # Copyright 2013 Simone Campagna # # 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 wri...
from xbahn.connection import ( register, Poller as BasePoller, Receiver as BaseReceiver, Sender as BaseSender ) receivers = {} senders = {} class Poller(BasePoller): def __init__(self, name): super(Poller, self).__init__() self.name = name class Receiver(BaseReceiver): can_sen...
# -*- coding: utf-8 -*- from django import conf from django.core.cache import cache from importpath import importpath METHODS = ( 'replace', # Указывает, что объект point следует заменить объектом object 'insert', # Указывает, что к списку дочерних элементов inside-правила нужно добавить элемент object 'c...
""" Get public statistics for current hackathon """ from django import forms from django.http.request import HttpRequest from hackfsu_com.views.generic import ApiView from hackfsu_com.util import acl from api.models import Hackathon, HackerInfo, MentorInfo, JudgeInfo, OrganizerInfo, AttendeeStatus from django.utils...
from django.shortcuts import render from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User, Group from django.http import HttpResponseRedirect, HttpResponseForbidden, \ Http404, HttpResponseBadRequest, HttpResponse from django.core.urlresolvers import reverse from dj...
#!/usr/bin/python3 import subprocess import os import json import shutil maxlevel = 1 def CheckRarComplete( path, file, associatedFiles ): plsar = subprocess.Popen(['lsar', '-j', os.path.join(path, file)], stdout=subprocess.PIPE) lsarout, lsarerr = plsar.communicate() jsonObject = json.loads(lsarout.decode("utf...