src
stringlengths
721
1.04M
import json import unittest from unittest.mock import patch import requests_mock from flask import request from frontstage import app from tests.integration.mocked_services import ( business_party, case, collection_instrument_seft, encoded_jwt_token, survey, url_banner_api, ) @requests_mock....
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ High-level objects for fields. """ from collections import defaultdict from datetime import date, datetime, time from operator import attrgetter from xmlrpc.client import MAXINT import itertools import logging impor...
import unittest from mongotsdb import Range, SubRange, RangeSet, MultiRangeWorker, RangeWorker class RangeTestCase(unittest.TestCase): def setUp(self): self.start = 0 self.stop = 7 self.step = self.stop - self.start self.r = Range(self.start, self.stop) def test_instantiation...
# -*- coding: utf-8 -*- # 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...
"""Smoothing a 1d signal """ ############################################################################## # Imports ############################################################################## # library imports import numpy as np from scipy.optimize import leastsq from scipy.signal import lfilter, lfilter_zi, fil...
import json import six from six.moves.urllib.request import urlopen, Request from libqtile.widget import base from libqtile.log_utils import logger class GenPollText(base.ThreadedPollText): """ A generic text widget that polls using poll function to get the text. """ orientations = base.ORIENTATI...
from Comandos.Epson2GenComandos import Epson2GenComandos import ctypes from ctypes import byref, c_int, c_char, c_char_p, c_long, c_short, create_string_buffer from Traductores.TraductoresHandler import TraductoresHandler, TraductorException fullpath = "/lib64/libEpsonFiscalInterface.so" EpsonLibInterface = ctypes.cd...
# Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
import sqlite3 import sys import requests import xml.dom.minidom from os import path con = None artists = {} url_params = {} total_pages = -1 page_no = 0 user_name = sys.argv[1] banshee_db = path.expanduser("~/.config/banshee-1/banshee.db") con = sqlite3.connect(banshee_db) cur = con.cursor() while True: if tot...
from setuptools import setup import os version = '0.0.1.dev0' here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst'), 'rt') as f: README = f.read() setup(name='{{project}}', version=version, author='José Luis Lafuente', author_email='jlesquembre@gmail.com'...
# -*- coding: utf-8 -*- { '!langcode!': 'es', '!langname!': 'Español', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%(nr...
## # Copyright 2015 Bart Oldeman # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish ...
#!/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. """Provides an interface to communicate with the device via the adb command. Assumes adb binary is currently on system path. Usag...
from django.db import models from django.utils import timezone class Buyer(models.Model): brand = models.CharField(max_length=30) address = models.CharField(max_length=200) class Seller(models.Model): brand = models.CharField(max_length=30) address = models.CharField(max_length=200) class Brand(mode...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Category', fields=[ ('id', models.AutoField(ver...
""" Setup file for egg builds @copyright: 2010-2012 @author: Joseph Tallieu <joseph_tallieu@dell.com> @author: Vijay Halaharvi <vijay_halaharvi@dell.com> @organization: Dell Inc. - PG Validation @license: GNU LGLP v2.1 """ # This file is part of WSManAPI. # # WSManAPI is free software: you can redistribute it an...
import json import boto3 from django.core.management.base import BaseCommand, CommandError from moderation_queue.models import QueuedImage # These magic values are because the AWS API crops faces quite tightly by # default, meaning we literally just get the face. These values are about # right or, they are more righ...
#!/usr/bin/env python # -*- mode:python; tab-width:4; c-basic-offset:4; intent-tabs-mode:nil; -*- # ex: filetype=python tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent smartindent # # Universal Password Changer (UPwdChg) # Copyright (C) 2014-2018 Cedric Dufour <http://cedric.dufour.name> # Author: Cedric Duf...
# -*- encoding: utf-8 -*- """Implements Roles UI.""" from robottelo.constants import FILTER from robottelo.ui.base import Base, UIError from robottelo.ui.locators import common_locators, locators, tab_locators from robottelo.ui.navigator import Navigator from selenium.webdriver.support.select import Select class Role...
#!/usr/bin/python # -*- coding: utf-8 -*- import urllib, urllib2 # Change the values to your application id, secret and redirect_uri APP = {'CLIENT_ID': '524fa225e2925ea0d9c700bfda40ec4e833c6e01', 'CLIENT_SECRET': 'acd709c3f403701b875dc224695466ba7ce117ef', 'REDIRECT_URI': 'http://localhost/oauth2/callb...
############################################################################## # Copyright 2010 North Carolina State University # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # ...
import sys import unittest from numpy import * from numpy import max, min from numpy.random import * from pickle import dump, load from tempfile import mkstemp from cmt.models import STM, GLM, Bernoulli, Poisson from cmt.nonlinear import LogisticFunction, ExponentialFunction from scipy.stats import norm class Tests(u...
# 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 ...
"""Script to compute the mapping between PCS and ROME classifications.""" import os import sys from typing import Optional, TextIO, Union import pandas as pd def main( output_csv: Union[str, TextIO], filename: Optional[str] = None, data_folder: str = 'data') \ -> None: """Compute the mapping bet...
# -*- coding: utf-8 -*- """Get the weather from an address using forecast.io.""" from __future__ import division import dave.modules import requests import dave.config import pickle from urllib.parse import quote_plus import arrow from dave.models import Location import socket @dave.module.help("Syntax: weather [loca...
#!/usr/bin/env python 2.7.12 #=======================================================================================================================================================# #title :methods.py #description :This collects KPI data from all relevant API sources #author :Michael Roberts #d...
# -*- coding: utf-8 -*- from model.channel import Channel class DbChannelHelper: def __init__(self, db): self.db = db def get_channels(self): channels = [] cursor = self.db.connection.cursor() try: cursor.execute( "select id, name, service_id, epg_...
# Copyright 2010-2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """XMLRPC APIs for person set.""" __metaclass__ = type __all__ = [ 'SoftwareCenterAgentAPI', ] from zope.component import getUtility from zope.interface import impl...
import sys import logging import os from datetime import datetime from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import numpy as NP import pandas as PD logger = logging.getLogger('pyrsss.mag.fm2iaga') HEADER_TEMPLATE = """\ Format IAGA-2002 | ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2015 Patrick Uiterwijk <patrick@puiterwijk.org> # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v2, or (at your option) any ...
""" Copyright (c) 2017 Genome Research Ltd. Author: Christopher Harrison <ch12@sanger.ac.uk> 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 ...
import logging logging.basicConfig(level=logging.DEBUG) from pymothoa.jit import default_module, function from pymothoa.types import * from pymothoa.dialect import * @function(ret=Int, args=[Int, Int]) def test_bitwise_and(A, B): return A & B @function(ret=Int, args=[Int, Int]) def test_bitwise_or(A, B): ret...
#!/usr/bin/env python # coding=utf-8 import os import time DEFAULT_AUTHOR = "大饼" DEFAULT_SUMMARY = "通过手机上传" URL_PREFIX = "http://www.42kr.com/podcast/" XML_FILE_PATH = "/home/Cake/site/42kr/feed.xml" SUBMIT_FOLDER = "/home/Cake/tool/podcast_submit/submit_folder/" PODCAST_FOLDER = "/home/Cake/site/42kr/podcast/" clas...
#!/usr/bin/env python from __future__ import division, print_function import sys import os from colormath.color_objects import sRGBColor, LabColor from colormath.color_conversions import convert_color from colormath.color_diff import delta_e_cie2000 def get_lab(name, rgb): rgb = sRGBColor(int(rgb[:2], 16), int(rgb[2...
import requests infos = requests.get('https://job.xiyanghui.com/api/q1/json').json() def build(n, parent, dic): dic[n["id"]] = {"name": n["name"], "parent": parent} for i in n.get("children", []): build(i, n["id"], dic) def builds(infos, dic): for i in infos: build(i, -1, dic) def ch...
# -*- coding: utf-8 -*- # # 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. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os...
import sys from functools import wraps __all__ = ('surrogate', ) class surrogate(object): """ Originally Created by Kostia Balitsky Contains Modifications by Griffin Smith See: https://github.com/ikostia/surrogate and https://github.com/glittershark/s...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
# # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
# coding= utf-8 from bs4 import BeautifulSoup import codecs from mongoengine import * from book import Book connect('mydouban') import os os.chdir("book") for filename in os.listdir("."): with codecs.open(filename, "r", "utf-8") as html_file: soup = BeautifulSoup(html_file.read()) for item in sou...
import subprocess from lutris.util.log import logger def get_vidmodes(): xrandr_output = subprocess.Popen(["xrandr"], stdout=subprocess.PIPE).communicate()[0] return list([line for line in xrandr_output.decode().split("\n")]) def get_outputs(): """Return list of tup...
#Задача 10. Вариант 24. #Напишите программу "Генератор персонажей" для игры. #Пользователю должно быть предоставлено 30 пунктов, которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость. #Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но...
import module # unique to module from datetime import datetime class Module(module.Module): def __init__(self, params): module.Module.__init__(self, params, query='SELECT DISTINCT latitude || \',\' || longitude FROM locations WHERE latitude IS NOT NULL AND longitude IS NOT NULL') self.register_opt...
import urllib class AtomOptions(object): """Container for all options that can be sent to AtomHopper.""" def __init__( self, marker=None, direction=None, limit=None, search=None ): self.marker = marker self.direction = direction self.limit ...
from rest_framework import serializers from metaci.api.serializers.cumulusci import OrgSerializer from metaci.api.serializers.cumulusci import ScratchOrgInstanceSerializer from metaci.api.serializers.repository import BranchSerializer from metaci.api.serializers.repository import RepositorySerializer from metaci.api.se...
import logging import datetime from typing import Optional logger = logging.getLogger(__name__) class RunnerContext: """Runner context at strategy level""" def __init__(self, selection_id: int): self.selection_id = selection_id self.invested = False self.datetime_last_placed = None ...
""""Vendoring script, python 3.5 needed""" from pathlib import Path import re import shutil import invoke TASK_NAME = 'update' FILE_WHITE_LIST = ( 'Makefile', 'vendor.txt', '__init__.py', 'README.rst', ) def drop_dir(path): shutil.rmtree(str(path)) def remove_all(paths): for path in path...
#!/usr/bin/env python def get_highest_test_score(test_scores): highest_score = 0 name = None for key, val in test_scores.items(): if val > highest_score: highest_score = val name = key return name, highest_score def exercise1(): test_scores = { 'james': 75...
"""The :mod:`sklearn.kernel_regressor` module implements the Kernel Regressor. """ # Author: Jan Hendrik Metzen <janmetzen@mailbox.de> # Github link: https://github.com/jmetzen/kernel_regression/ # License: BSD 3 clause import numpy as np from sklearn.metrics.pairwise import pairwise_kernels from sklearn.base import ...
#-*- coding: utf-8 -*- from django.conf import settings from django.http import HttpResponse from django.template.context import Context from django.template.loader import get_template from xhtml2pdf import pisa # TODO: Change this when the lib changes. import StringIO import os #=====================================...
import unittest from emva1288.camera.camera import Camera import numpy as np from emva1288.camera import routines class CameraTestCase(unittest.TestCase): def setUp(self): self.cam = Camera() def tearDown(self): del self.cam def test_img(self): img = self.cam.grab(0) self...
#! usr/bin/python # -_- coding:utf-8 -_- ''' @author sugarguo @email sugarguo@live.com @date 2016年04月15日 @version v1.0.0 @copyright Sugarguo File main/views.py ''' import os import json import time from datetime import datetime, date from flask import...
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-07-24 12:02 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_US...
## begin license ## # # "Weightless" is a High Performance Asynchronous Networking Library. See http://weightless.io # # Copyright (C) 2006-2011 Seek You Too (CQ2) http://www.cq2.nl # Copyright (C) 2011-2012, 2015, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl # # This file is part of "Weightless" # # "Weightles...
from rdr_service.model.bq_base import BQTable, BQSchema, BQView, BQField, BQFieldTypeEnum, BQFieldModeEnum, \ BQRecordField class BQWorkspaceRaceEthnicitySchema(BQSchema): race_ethnicity = BQField('race_ethnicity', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE) race_ethnicity_id = BQField('race_ethnic...
from acl.default_roles import DefaultGroups, ALL_PERMISSIONS """ These functions work with anonymous users as well, and therefore are not a part of the OCUser model. """ def load_community_permissions(user, community, committee=None): from users.models import Membership if user.is_authenticated(): tr...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ --------------------------------------------------------------------------------------------------- prc_dir_ponto revision 0.2 2015/nov mlabru pep8 style conventions revision 0.1 2014/nov mlabru initial version (Linux/Python) --------------------------------------...
"""Interface to store lexical scope related information used during semantic analysis.""" import sys from itertools import chain from ..helpers import orderedset class Scope(object): """Parent class for all scopes. Implements generic lexical scoping operations. _parent The parent scope o...
""" Caravel wrapper around pandas.DataFrame. TODO(bkyryliuk): add support for the conventions like: *_dim or dim_* dimensions, *_ts, ts_*, ds_*, *_ds - datetime, etc. TODO(bkyryliuk): recognize integer encoded enums. """ from __future__ import absolute_import from __future__ import division from __fu...
import time, simplejson from nevow import rend, tags as T, inevow from allmydata.web.common import getxmlfile, abbreviate_time, get_arg from allmydata.util.abbreviate import abbreviate_space from allmydata.util import time_format def remove_prefix(s, prefix): if not s.startswith(prefix): return None r...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
# # Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat.org. # # WeeChat.org 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 #...
import subprocess from utop.lib.dataobject import DataObject class CPU: def __init__(self, line): """ Create a new CPU object which parses the data from the output of /proc/stat. """ labels = [ 'user', 'nice', 'system', 'idle', 'iowait', 'irq', 'softirq', 'steal', 'g...
"""empty message Revision ID: 8eba94c1838c Revises: 59b25a9d6e7b Create Date: 2017-02-24 00:38:20.074565 """ # revision identifiers, used by Alembic. revision = '8eba94c1838c' down_revision = '59b25a9d6e7b' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
# -*- coding: UTF-8 -*- #/* # * Copyright (C) 2013 Maros Ondrasek # * # * # * 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, or (at your option) # * any later versi...
#!/usr/bin/env python '''Allows easy moving (with symlinking) of folders to and from the SteamApps folder. Intended for users with an SSD that cannot hold all their Steam games. Allows them to easily move games not currently being played to a slower drive easily. And then move them back at a later date. The symlinkin...
# =============================================================================== # Copyright 2015 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
# -*- coding: utf-8 -*- # 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...
# Copyright 2017 by Bearstech <py@bearstech.com> # # This file is part of nuka. # # nuka 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 pytest from big_future.users.forms import UserCreationForm from big_future.users.tests.factories import UserFactory pytestmark = pytest.mark.django_db class TestUserCreationForm: def test_clean_username(self): # A user with proto_user params does not exist yet. proto_user = UserFactory.bu...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DeDuplicatus: A Deduplication-Enabled Multi-Cloud App Usage: deduplicatus.py [options] FILE Arguments: FILE config file Options: -h --help show this help message and exit --version show version and exit """ import sys imp...
#!/usr/bin/python #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com> # See LICENSE for details. from hashlib import sha512 from .openssl import OpenSSL from .cipher import Cipher from .hash import hmac_sha256, equals from struct import pack, unpack class ECC: ...
from django.shortcuts import render,get_object_or_404, HttpResponseRedirect from .models import Article from .forms import BlogForm def index(request): latest_article_list = Article.objects.order_by('-pub_date')[:20] context = {'latest_article_list': latest_article_list} return render(request, 'index.html'...
## # Copyright (c) 2010-2017 Apple 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 l...
from __future__ import absolute_import, unicode_literals import pstats import traceback import copy from cStringIO import StringIO from django.conf import settings from django.db import transaction from django.utils import timezone, translation from temba.orgs.models import Org from temba.contacts.models import Conta...
# # Copyright (c) 2013-2018 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http:...
from tags.models import Tag import collections, copy, json, re, urllib.parse sample = 'young nia-teppelin with short multicolored hair and cat ears; yoko-littner with flame bikini, pink stockings, and long red hair without gun' DEFAULT_TAG_DICT = {'nouns': collections.OrderedDict({}), 'filters': {}} def format_quer...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'mysite.views.home', name='home'), # url(r'^blog/', include('blog.urls')...
# coding: utf-8 from django.conf import settings from django.test import TestCase from django.core.urlresolvers import reverse from zds.utils import slugify from zds.forum.factories import CategoryFactory, ForumFactory, \ TopicFactory, PostFactory from zds.member.factories import ProfileFactory, StaffProfileFact...
#!/usr/bin/env python # vim: set expandtab: # with thanks to https://github.com/bpennypacker/ec2-check-reserved-instances.git # For the initial idea, and an idea of how to do this. PROJECTNAME = 'ec2-check-reserved-instances' import os import sys import ConfigParser import logging import boto import boto.ec2 from p...
""" Django settings for MediaCollector project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ im...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011 CERN. ## ## Invenio 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) a...
import django.forms as forms import django.db.models as models from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from backend import * class UserConfiguration(models.Model): user = models.OneToOneField(User, related_name="config", primary_key=True) titancert = model...
# -*- coding: UTF-8 -*- # # Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend. # # Authors: Hervé Cauwelier <herve@itaapy.com> # Luis Belmar-Letelier <luis@itaapy.com> # David Versmisse <david.versmisse@itaapy.com> # # This file is part of Lpod (see: http://lpod-project.org). # Lpod is free softw...
#!/usr/bin/env python import os import sys from setuptools import setup # Prepare and send a new release to PyPI if "release" in sys.argv[-1]: os.system("python setup.py sdist") os.system("twine upload dist/*") os.system("rm -rf dist/kadenza*") sys.exit() # Load the __version__ variable without import...
# -*- coding: utf-8 -*- # 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...
# MiniLight Python : minimal global illumination renderer # # Harrison Ainsworth / HXA7241 and Juraj Sukop : 2007-2008, 2013. # http://www.hxa.name/minilight from triangle import Triangle, TOLERANCE from vector3f import Vector3f, MAX MAX_LEVELS = 44 MAX_ITEMS = 8 class SpatialIndex(object): def __init__(s...
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyöstil? ...
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, m...
from django.urls import reverse from django.test import TestCase from oppia.tests.utils import * class PermissionsViewTest(TestCase): fixtures = ['user.json', 'oppia.json', 'quiz.json', 'permissions.json'] def setUp(self): super(PermissionsViewTest, self).setUp() self.login_url = reverse('pr...
# -*- coding: utf-8 -*- # 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 o...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jobs', '0003_auto_20150510_1707'), ] operations = [ migrations.AlterField( model_name='job', name='e...
import time devices_list_response = { "devices": [ { "active": True, "iden": "1", "created": time.time(), "modified": time.time(), "icon": "system", "generated_nickname": False, "nickname": "test dev", "manufact...
import unittest import json import logging from mock import Mock from webob.multidict import MultiDict from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.modulestore import Location from xmodule.tests import get_test_system, get_test_descriptor_system from xmodule.tests.test_u...
import os import time import errno class LockFileError(RuntimeError): pass class LockFile(object): """ Lock file (Unix-only), implemented via symlinks. """ def __init__(self, filename, timeout=0.05, fail_if_active=False): self.filename = filename self.timeout = timeout s...
# # Copyright 2020 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Module to generate AST for the headers and parse it """ import os import re import codecs import logging from ..core.base import BlockToolException, BlockTool from ..core.iosigna...
#============================================================================== # Copyright 2011 Amazon.com, Inc. or its affiliates. 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 ...
from pearce.emulator import OriginalRecipe, ExtraCrispy, SpicyBuffalo from pearce.inference import run_mcmc_iterator import numpy as np from os import path import cPickle as pickle #training_file = '/u/ki/swmclau2/des/xi_cosmo_trainer/PearceRedMagicXiCosmoFixedNd.hdf5' training_file = '/scratch/users/swmclau2/xi_zheng...
import os import fsui from fsbc.paths import Paths from fsgamesys.context import fsgs from fsgamesys.options.option import Option from fsgamesys.platforms import PLATFORM_ATARI from launcher.context import get_config from launcher.helpers.cdmanager import CDManager from launcher.helpers.floppymanager import FloppyMana...