text
stringlengths
17
737k
#!/usr/bin/env python3 # vim:fileencoding=utf-8:ts=8:et:sw=4:sts=4:tw=79 """ command.py Handle commands received on IRC. Copyright (c) 2015 Twisted Pear <pear at twistedpear dot at> See the file LICENSE for copying permission. """ import aiohttp import asyncio import bs4 import datetime import functools import logg...
#!/usr/bin/env python # Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Archives a set of files or directories to an Isolate Server.""" __version__ = '0.9.0' import collections import errno i...
from werkzeug.wrappers import Request, Response from nbconvert.exporters import HTMLExporter import os BASE_PATH = os.environ['BASE_PATH'] URL_PREFIX = os.environ['URL_PREFIX'] def get_extension(path): """ Return the extension of the path, if any """ splits = path.split('.') if len(splits) == 1: ...
# This script is executed in the main console namespace so # that all the variables defined here become console variables. import ddapp import os import sys import vtk import PythonQt from PythonQt import QtCore, QtGui import ddapp.applogic as app from ddapp import matlab from ddapp import jointcontrol from ddapp imp...
### Calculates the net emissions over the study period, with units of Mg CO2e/ha on a pixel-by-pixel basis. ### This only uses gross emissions from biomass+soil (doesn't run with gross emissions from soil_only). import multiprocessing import argparse import os import datetime from functools import partial import sys s...
from pagarme.resources import handler_request from pagarme.resources.routes import subscription_routes def cancel(param): return handler_request.post(subscription_routes.CANCEL_SUBSCRIPTION.format(param)) def create(params): return handler_request.post(subscription_routes.BASE_URL, params) def find_all():...
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import time import string import zlib import struct import __builtin__ FTEXT, FHCRC, FEXTRA...
from cStringIO import StringIO import boto.connection import boto.exception import boto.s3.connection import boto.s3.acl import boto.utils import bunch import nose import operator import random import string import socket import ssl from boto.s3.connection import S3Connection from nose.tools import eq_ as eq from nos...
# Copyright (c) 2011, Jimmy Cao 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 # list of conditions and the following...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
from .utils import _build_new_bid_type, _build_new_bidding_strategy_configuration, _get_selector def adgroup_operation(campaign_id: 'Long' = None, adgroup_id: 'Long' = None, adgroup_name: 'String' = None, status: 'String' = None, ...
# <~> # Employs custom version of pip (awwad/pip:develop) to harvest dependencies and find dependency conflicts for packages in PyPI. # See README.md! import sys # for arguments and exceptions import pip import os import json #import ipdb from distutils.version import StrictVersion, LooseVersion # for use in version p...
import copy import torch from torch.autograd import Variable from torch.nn.utils import clip_grad_norm from torch.optim import Adam, RMSprop from torch.utils.data import DataLoader from .core import Agent from ..util import ReplayBuffer from ..util.common import TensorDataset, preprocessing_state class PPOAgent(Age...
#!/usr/bin/env python3 # Parse the YAML file, start the testrunners in parallel, # and wait for them. import os import sys import time import traceback import threading import subprocess from os.path import dirname, realpath import boto3 import jinja2 from yaml.scanner import ScannerError from pykwalify.errors impor...
#!/usr/bin/env python2 # Copyright 2015 Dejan D. M. Milosavljevic # # 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 # # ...
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: oracle+cx_oracle :name: cx-Oracle :dbapi: cx_oracle :connectstring: orac...
# -*- coding: utf-8 -*- import requests import functools from threading import Timer import datetime from collections import Counter, namedtuple try: from urllib.parse import quote as urlquote except ImportError: from urllib import quote as urlquote import shlex import datetime, re import json, threading impor...
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .compat import cookielib, OrderedDict, urljoin, urlparse, buil...
from django.utils.translation import ugettext as _ from extjs4.views import Extjs4AppView class AppView(Extjs4AppView): template_name = "devilry_subjectadmin/app.django.html" appname = 'devilry_subjectadmin' #css_staticpath = 'devilry_theme/resources/stylesheets/devilry.css' #css_staticpath = 'extjs4...
# -*- coding: utf-8 -*- """Python module for generating fake spectra from an N-body catalogue. Note in Arepo we have GFM_Metals and GFM_Metallicity. GFM_Metallicity is the total mass in species not H or He per unit gas mass (and is used for cooling). GFM_Metals is a 9-component array of species: H, He, C, N, O, Ne, ...
# MIT License # Copyright (c) 2018 MassChallenge, Inc. from __future__ import unicode_literals import logging import swapper from django.conf import settings from django.db import models from django.utils.encoding import python_2_unicode_compatible from accelerator_abstract.models.accelerator_model import Accelerato...
# """ All lookups are in terms of base. Try to look up step, registered by name If not there, try to look up variable pattern, i.e. foo/?. Find a list of matches. For each match, see whether it matches the variables. If so, stop. Once steps have been consumed, look up the model. """ import re VARIABLE = '{}' ...
# Copyright 2021 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, so...
from .base import Component, Entity from .exceptions import NoComponentForEntityError, NotAComponentError class EntityManager(object): """The EntityManager is responsible for creating and maintaining Entities It accomplishes its job by creating monotonically increasing Entity IDs, as well as maintaining ...
# -*- coding: utf-8 -*- from pandasqt.compat import QtCore, QtGui, Qt, Slot, Signal from pandasqt.models.DataFrameModel import DataFrameModel from pandasqt.views.EditDialogs import AddAttributesDialog, RemoveAttributesDialog from pandasqt.views.CustomDelegates import createDelegate from pandasqt.models.mime import Pan...
import atexit import os import tempfile import urllib import webbrowser import datetime import calendar import subprocess import math import qmk class EvalCommand(qmk.Command): '''Pass arguments to Python's eval() builtin.''' def __init__(self): self._name = 'eval' self._help = self.__doc__ def action(self, a...
import os import yaml import panoptes.utils.logger as logger import panoptes.utils.serial as serial import panoptes.utils.error as error @logger.has_logger class AbstractMount(): """ Abstract Base class for controlling a mount Methods to be implemented: - check_coordinates - sync_coor...
""" 查询相关函数 """ from collections import defaultdict from typing import Dict, List, Tuple from ddtrace import tracer from flask import Blueprint, current_app as app, escape, flash, redirect, render_template, request, session, url_for from everyclass.common.format import contains_chinese from everyclass.common.time impo...
import logging from .base import BaseAction from .. import exceptions logger = logging.getLogger(__name__) class Action(BaseAction): """Get information on CloudFormation stacks. Displays the outputs for the set of CloudFormation stacks. """ def run(self, *args, **kwargs): logger.info('Out...
#!/usr/bin/python import os, sys from glob import glob os.chdir(os.path.dirname(__file__)) def sysExec(cmd): print " ".join(cmd) r = os.system(" ".join(cmd)) if r != 0: sys.exit(r) LinkPython = False UsePyPy = False def link(outfile, infiles, options): if not LinkPython: options += ["-undefined", "dy...
#!/usr/env/python from __future__ import division, print_function # Import General Tools import sys import os import argparse import ephem import datetime import time import importlib # from panoptes import Panoptes import panoptes import panoptes.mount as mount import panoptes.camera as camera import panoptes.wea...
#!/usr/bin/python import sys import subprocess import urllib2 import httplib import os import errno from frontend import models import re from datetime import datetime, timedelta import traceback import sqlalchemy # Different versions of BeautifulSoup have different properties. # Some work with one site, some with an...
"""Get example scripts, notebooks, and data files.""" import argparse import os from datetime import datetime from datetime import timedelta import shutil import pkg_resources from progressbar import ProgressBar try: # For Python 3.0 and later from urllib.request import urlopen except ImportError: # Fall ...
# Copyright 2015, 2016 Reahl Software Services (Pty) Ltd. All rights reserved. # -*- encoding: utf-8 -*- # # This file is part of Reahl. # # Reahl 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 Foundat...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import a...
# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4: # conveyor/src/main/python/conveyor/toolpath/skeinforge.py # # conveyor - Printing dispatch engine for 3D objects and their friends. # Copyright © 2012 Matthew W. Samsonoff <matthew.samsonoff@makerbot.com> # # This program is free software: you can redistribute it and/o...
import copy import re import util from util import attrsearch, keysearch from error import err_add import types import syntax import grammar import xpath ### Exceptions class NotFound(Exception): """used when a referenced item is not found""" pass class Abort(Exception): """used to abort an iteration"""...
#!/usr/bin/env python # coding: utf-8 try: import settings DEBUG = settings.DEBUG except ImportError: DEBUG = False import os from const import * try: from rpython.rlib.listsort import TimSort except ImportError: class TimSort(object): def __init__(self, list): self.list = list...
"""Parsers of StagYY output files. Note: These functions are low level utilities. You should not use these unless you know what you are doing. To access StagYY output data, use an instance of :class:`~stagpy.stagyydata.StagyyData`. """ from functools import partial from itertools import product, repeat fro...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import abc import importlib import pkgutil from typing import Optional, Iterable, T...
# -*- coding: utf-8 -*- # Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. """ pycroft.lib.user ~~~~~~~~~~~~~~ This module contains. :copyright: (c) 2012 by AG D...
#!/usr/bin/python import re import sys input = "\n".join([l for l in open(sys.argv[1])]) class Node: known_macros = [] def __init__(self, name, args): assert isinstance(args, list) self.name = name self.args = args def tostr(self, indent): indentation = indent * " " result = "" resul...
# -*- coding: utf-8 -*- # 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ grepoinit: GitHub Repository INIT; to start your next python3 project. Note: it requires libraries $ pip3 install --upgrade plumbum mkdocs pyscaffold """ ######################### import os import argparse import shutil # import sys from plumbum import local from pl...
import getpass __author__ = 'elip' import os import tempfile from celery import Celery from worker_installer.tasks import install from worker_installer.tasks import create_namespace_path from worker_installer.tests import get_remote_runner, get_local_runner, VAGRANT_MACHINE_IP PLUGIN_INSTALLER = 'cloudify.tosca.a...
# -*- coding: utf-8 -*- # # nosedbreport documentation build configuration file, created by # sphinx-quickstart on Thu Jun 30 09:57:39 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
import pandas as pd import numpy as np import os import sys import gzip import argparse try: import configparser except ImportError: import ConfigParser as configparser from keras import backend as K from keras.layers import Input, Dense, Dropout, Activation, Conv1D, MaxPooling1D, Flatten, LocallyConnected1D ...
# 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 python3 """ geolocate Programmed by: Dante Signal31 email: dante.signal31@gmail.com This scripts scan given text to find urls and IP addresses. The output is the same text but every url and IP address is going to have its geolocation appended. Geolocate is possible thanks to `Maxmind GeoIP databas...
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Roman Zoller, Emanuel Cino, Michael Sandoz # # The licence is in the file __ope...
import os from django.conf import settings from django.db import models from django.template.defaultfilters import slugify from .tasks import update_posts_for_feed # If we can import caching (IE, CacheMachine is installed) then use it try: from caching.base import CachingManager as Manager, CachingMixin as Mixin...
# Copyright (c) 2008-2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Utilities for use in making plots.""" from datetime import datetime import posixpath from matplotlib.collections import LineCollection from matplotlib.pyplot import imread ...
import logger as mylog import os from seqcluster.libs.classes import annotation, dbannotation logger = mylog.getLogger("run") def read_gtf_line(cols): """parse gtf line to get class/name information""" try: group = cols[2] attrs = cols[8].split(";") name = [attr.strip().split(" ")[1]...
# 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 to in...
""" Copyright [2009-2014] EMBL-European Bioinformatics Institute 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 a...
## Copyright 2015-2016 Tom Brown (FIAS), Jonas Hoersch (FIAS) ## 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. ##...
import inspect import os import sys import ply.yacc as yacc from pysmi.lexer.smi import SmiV2Lexer, SmiV1Lexer, SmiV1CompatLexer from pysmi.parser.base import AbstractParser from pysmi import error from pysmi import debug class SmiV2Parser(AbstractParser): defaultLexer = SmiV2Lexer def __init__(self, startSym='mib...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
""" API relating to User model objects """ from flask import abort from flask_restful import abort as rest_abort from flask_restful import fields, inputs, marshal_with, Resource from flask_security import current_user, login_required from .base import BaseDetailResource, BaseRequestParser from .fields import GravatarU...
import logging import os from unicodedata import category from urllib.request import pathname2url from urllib.parse import urldefrag from urllib.parse import urljoin from rdflib.term import URIRef, Variable, _XSD_PFX, _is_valid_uri __doc__ = """ =================== Namespace Utilities =================== RDFLib p...
#!/usr/bin/env python # encoding: utf-8 """ Example of data passed:: { 'params': {'measurement_and_reporting': {'NAME': 'default'}}, 'fixed_labels': [ { 'modification': { 'unimodID': '4', 'specificity_sites': ['C'], ...
# Software License Agreement (BSD License) # # Copyright (c) 2009-2011, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistributions of source ...
""" Limited dependent variable and qualitative variables. Includes binary outcomes, count data, (ordered) ordinal data and limited dependent variables. General References -------------------- A.C. Cameron and P.K. Trivedi. `Regression Analysis of Count Data`. Cambridge, 1998 G.S. Madalla. `Limited-Dependent a...
#!/usr/bin/env python import roslib; roslib.load_manifest('hanse_navigation') import rospy import smach import smach_ros import math import numpy import collections import actionlib import tf from tf.transformations import euler_from_quaternion from hanse_navigation.msg import NavigateAction, NavigateFeedback, Navigat...
# -*- coding: utf-8 -*- """ Created on Thu Oct 13 17:29:27 2011 @author: Ashley Milsted """ import numpy as np import scipy as sp import scipy.linalg as la import scipy.sparse.linalg as las import scipy.optimize as opti import nullspace as ns import matmul as m import math as ma try: import tdvp_common as tc ...
import re import collections from rest_framework import exceptions from rest_framework import serializers as ser from django.core.urlresolvers import resolve, reverse from rest_framework.fields import SkipField from framework.auth import core as auth_core from website import settings from website.util.sanitize import...
""":py:mod:`postgres` is a high-value abstraction over `psycopg2`_. Installation ------------ :py:mod:`postgres` is available on `GitHub`_ and on `PyPI`_:: $ pip install postgres Tutorial -------- Instantiate a :py:class:`Postgres` object when your application starts: >>> from postgres import Postgres ...
from flask import Flask from flask import render_template from flask import abort import requests import re import json import yaml import os from reverseproxied import ReverseProxied app = Flask(__name__) app.wsgi_app = ReverseProxied(app.wsgi_app) class Config(object): DEBUG = False TESTING = False w...
import logging from django.shortcuts import render, HttpResponseRedirect, get_object_or_404 from django.contrib.auth import authenticate, login, logout from django.views.generic.base import View from django.contrib import messages from django.utils.decorators import method_decorator from django.contrib.auth.decorators...
""" This contains the base class for the geometry engine, which proposes new positions for each additional atom that must be added. """ from simtk import unit import numpy as np import collections import functools from perses.storage import NetCDFStorage, NetCDFStorageView ###########################################...
from __future__ import absolute_import import re from collections import Counter from optparse import make_option from django.core.management.base import NoArgsCommand, BaseCommand from django.core.management import call_command from herokuapp.management.commands.base import HerokuCommandMixin class Command(Heroku...
# # Executes the alignment process jobs on the cluster (based on Rhoana's driver). # It takes a collection of tilespec files, each describing a montage of a single section, # and performs a 3d alignment of the entire json files. # The input is a directory with tilespec files in json format (each file for a single layer...
"""Support for tracking the proximity of a device.""" import logging import voluptuous as vol from homeassistant.const import ( ATTR_LATITUDE, ATTR_LONGITUDE, CONF_DEVICES, CONF_UNIT_OF_MEASUREMENT, CONF_ZONE, LENGTH_FEET, LENGTH_KILOMETERS, LENGTH_METERS, LENGTH_MILES, LENGTH_...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import ast import re import os import shutil import subprocess import sys from six import string_types from getaddons import get_addons, get_modules, is_installable_module from travis_helpers import success_msg, fail_msg from configpa...
# -*- coding: UTF-8 # config # ****** # # Configuration file do not contain GlobaLeaks Node information, like in the 0.1 # because all those infos are stored in the databased. # Config contains some system variables usable for debug, import os import sys import shutil import traceback import logging import transac...
#! /usr/bin/env python # $Id$ """Gnuplot -- A pipe-based interface to the gnuplot plotting program. This is the main module of the Gnuplot package. Copyright (C) 1998,1999 Michael Haggerty This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
#!/usr/bin/env python from pyon.agent.agent import ResourceAgentClient from pyon.net.endpoint import Subscriber __author__ = 'Stephen P. Henrie, Michael Meisinger' __license__ = 'Apache 2.0' import uuid import json import gevent from pyon.public import log from pyon.core.exception import NotFound, BadRequest from p...
import featurizer HAIR, FACE, BKG = 0, 1, 2 def model_decorator(model_config_func): def wrapper(val=False): d = {} d['booster'] = 'gbtree' d['num_class'] = 3 d['num_round'] = 50 d['objective'] = 'multi:softprob' d['save_period'] = 1 d['eval_train'] = 1 ...
# -*- coding: utf-8 -*- # # Copyright 2020 Data61, CSIRO # # 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 o...
from selenium import webdriver import time import random from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import TimeoutException driver = webdriver.Chrome() url = "https://www.myfitnesspal.com/" user_email = 'user@email.com...
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 lat...
import aiohttp from bs4 import BeautifulSoup session = aiohttp.ClientSession() class NovelUpdatesAPI: def __init__(self): """The base url that we'll be ripping information from""" self.baseurl = 'http://www.novelupdates.com/' async def search_novel_updates(self, term: str): """This f...
import pprint import time import traceback from datetime import datetime, timedelta # import rethinkdb as r from rethinkdb import RethinkDB from api import app from .api_exceptions import Error # import pem # from OpenSSL import crypto # ~ from contextlib import closing r = RethinkDB() # ~ from ..libv1.log impor...
""" Copyright 2019, Institute for Systems Biology 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 w...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
############################################################################ # Copyright 2016 Albin Severinson # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may no...
from threading import Thread import glob import os import shutil import pecan import git import yaml from joulupukki.common.logger import get_logger, get_logger_path from joulupukki.common.carrier import Carrier from docker import Client import time import urlparse """ scheduled clonning dispatching finished """ ...
import logging from django.core.exceptions import ObjectDoesNotExist from django.utils import timezone from django.db.models import Model, IntegerField, ForeignKey, CharField, BigIntegerField, FloatField, NullBooleanField, \ DateTimeField from mii_interface.models import Report logger = logging.getLogger(__name__...
""" A test of the Average kernel used for the Averager. """ from firedrake import (IntervalMesh, Function, RectangleMesh, SpatialCoordinate, VectorFunctionSpace, FiniteElement) from gusto import kernels import numpy as np import pytest @pytest.fixture def mesh(geometry): L = 3.0 n = ...
""" 40. Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ fro...
#!/usr/bin/env python # Copyright (c) 2011 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. """Fetch the latest results for a pre-selected set of builders we care about. If we find a 'good' revision -- based on criteria exp...
from __future__ import print_function import subprocess as sp import shlex import shutil import re import os import glob import time import threading class ModelTestHelper(object): def __init__(self): self.my_path = os.path.dirname(os.path.realpath(__file__)) self.lab_path = os.path.join(self.m...
#!/usr/bin/env python # -*- coding: utf-8 -*- from PIL import ImageDraw from Batiments import Batiment from Carte import Tuile from GraphicsManagement import GraphicsManager from Units import Unit from Civilisations import Civilisation try: from tkinter import * # Python 3 except ImportError: from Tkinter im...
#!/usr/bin/env python import logging from os import mkdir from os.path import dirname from urllib.parse import urljoin from datetime import datetime from bs4 import BeautifulSoup logging.basicConfig( format=( '%(asctime)s\t%(levelname)s\t' #'%(processName)s\t%(threadName)s\t' '%(module)...
from django.shortcuts import get_object_or_404 from django.db import transaction from rest_framework import viewsets, status, exceptions from rest_framework.views import APIView from rest_framework.generics import GenericAPIView from rest_framework.response import Response from rest_framework.reverse import reverse fro...
import logging import os import time import lasagne from lasagne.utils import floatX import numpy as np import theano import theano.tensor as T from tqdm import tqdm from .data import FileSystemData from .util import gpu_free_mem logger = logging.getLogger(__name__) class Solver(object): def __init__(self, ma...
from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from adhocracy4.projects import models as project_models class ProjectContainer(project_models.Project): projects = models.ManyToManyField( project_models.Project, related_name='...
#!/usr/bin/python import os import sys import time from threading import Thread from vlcclient import VLCClient from medialib import mediaLib from ezlogger import ezLogger print ("#######################################################") print ("# _____ _ _ ___ #") print ("# | __...
# -*- coding: utf-8 -*- # 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,...