src stringlengths 721 1.04M |
|---|
# Platforma MUNDO – Dane po Warszawsku http://danepowarszawsku.pl/
# @authors Jaroslaw Legierski, Tomasz Janisiewicz, Henryk Rosa Centrum Badawczo – Rozwojowe/ Orange Labs
# copyright (c) 2014-2015 Orange Polska S.A. niniejszy kod jest otwarty i dystrybuowany
# na licencji: Lesser General Public License v2.1 (LG... |
"""Contain server and client packet IDs"""
client_changeAction = 0
client_sendPublicMessage = 1
client_logout = 2
client_requestStatusUpdate = 3
server_userID = 5
server_sendMessage = 7
server_userStats = 11
server_userLogout = 12
server_spectatorJoined = 13
server_spectatorLeft = 14
server_spectateFrames = 15
client_s... |
"""Menu objects."""
from pyglet.window import key
from .errors import EmptyMenuError
class Menu(object):
"""A menu object. Use window.set_menu(menu) to add it to the window."""
def __init__(self, title):
self.window = None # The window this menu will be attached to.
self.title = title # The title of th... |
from maya import cmds
from pyblish_magenta.vendor import inflection
# (key, value, help)
defaults = [
("name", lambda name, family: name,
"Name of instance"),
("family", lambda name, family: family,
"Which family to associate this instance with"),
("label", lambda name, family: inflection.... |
# Generated by Django 2.2.15 on 2020-09-09 14:31
import simple_history.models
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
migrat... |
# Copyright 2018-2019 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
"""
TODO: provider policy execution initialization for outputs
"""
import datetime
import logging
import time
try:
from google.cloud.storage import Bucket, Client as StorageClient
excep... |
#!/usr/bin/env python
'''
Gimp plugin "Uncrop"
Increase image/canvas size and synthesize outer band from edge of original.
Author:
lloyd konneker, lkk
Version:
1.0 lkk 5/15/2009 Initial version in scheme, released to Gimp Registry.
1.1 lkk 9/21/2009 Translate to python.
License:
This program is free software; you... |
import datetime
import os
import filer
from filer.utils.files import get_valid_filename
from django.core.files.uploadedfile import UploadedFile
from django.utils.encoding import smart_str
def by_date(instance, filename):
datepart = str(datetime.datetime.now().strftime(smart_str("%Y/%m/%d")))
return os.path.... |
#!/usr/bin/python
#
# Author: Jashua R. Cloutier (contact via https://bitbucket.org/senex)
# Project: http://senexcanis.com/open-source/cppheaderparser/
#
# Copyright (C) 2011, Jashua R. Cloutier
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... |
#!/usr/bin/env python
"""
Current from drifter
====================
"""
from datetime import datetime, timedelta
from opendrift.readers import reader_current_from_drifter
from opendrift.models.oceandrift import OceanDrift
o = OceanDrift(loglevel=20)
o.set_config('environment:fallback:land_binary_mask', 0)
#%%
# We ... |
# -*- coding: UTF-8 -*-
import unittest
from outwiker.pages.wiki.actions.childlist import (ChildListDialog,
ChildListDialogController)
from outwiker.gui.tester import Tester
from test.basetestcases import BaseOutWikerGUIMixin
class ChildListDialogTest(unittest.Test... |
from pelican import signals, contents
import os.path
from copy import copy
from itertools import chain
'''
This plugin creates a URL hierarchy for pages that matches the
directory hierarchy of their sources.
'''
class UnexpectedException(Exception): pass
def get_path(page, settings):
''' Return the dirname relat... |
# 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
# d... |
from models import Permission, Role, User, IUCNStatus, OrganismType, GrowthFormRaunkiaer, ReproductiveRepetition, \
DicotMonoc, AngioGymno, SpandExGrowthType, SourceType, Database, Purpose, MissingData, ContentEmail, Ecoregion, Continent, InvasiveStatusStudy, InvasiveStatusElsewhere, StageTypeClass,... |
# -*- encoding: utf-8 -*-
"""Test 'stopwath' module.
"""
import unittest
import time
from datetime import timedelta
from hunittest.stopwatch import StopWatch
class TestStopWatch(unittest.TestCase):
def assertTimedeltaAlmostEqual(self, td1, td2, prec=1e-3):
return abs(td1 - td2).total_seconds <= prec
... |
# -*- coding: utf-8 -*-
import os
import filer
DEBUG = True
PACKAGE_ROOT = os.path.abspath(os.path.join(
os.path.dirname(filer.__file__), '..'))
TMP_ROOT = os.path.abspath(os.path.join(PACKAGE_ROOT, 'tmp'))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.joi... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import collections
import os
import re
import sys
import shutil
import copy
import socket
import six
from ordereddict_ba... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.utils.conf import get_config
from scrapy.exceptions import DropItem
import pika.credentials
import pika
import json
... |
"""
Use serial protocol of acer projector to obtain state of the projector.
This component allows to control almost all projectors from acer using
their RS232 serial communication protocol.
"""
import logging
import re
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import (STATE_ON,... |
#
# Copyright (C) 2016 Basho Technologies, 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 a... |
import random
import util
import sfml
from collections import deque
from models.automata import Automata
from models.algae import Algae
class Simulation():
def __init__(self):
self.global_vars = { "debug": True }
self.fps_enabled = True
settings = sfml.window.ContextSettings(antialiasing=2)
self.win... |
"""Kullback Leibler divergence estimates"""
from collections import namedtuple
from numpy import array, sqrt
class KLEstimate(namedtuple('KLEstimate', ['estimate', 'se'])):
"""Container for return value from kullback_leibler.
`estimate`: The estimated KL divergence, mean of the sampled integrand
values.
... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
__author__ = 'trananhdung'
from openerp import models, fields, api
class extendPickingImportWizard(models.TransientModel):
_inherit = 'picking.import.wizard'
pickings = fields.Many2many(
comodel_name='stock.picking',
relation='distribution_import_picking_rel', column1='wizard_id',
... |
# Lint as: python3
# Copyright 2020 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Batch To Space ND tests."""
from absl import app
from iree.tf.support import tf_... |
import sys
import os
import unittest
import tempfile
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)) + "/../../"))
import utils.errors
# logname = "/tmp/test.log"
# print("-----------------------------")
# print((" current logs in %s" % logname))
# print("-----------------------------")
... |
#!/usr/bin/env python
#
# Copyright (c) 2013 Liu, Yonggang <myidpt@gmail.com>, University of Florida
#
# This software may be used and distributed according to the terms of the
# MIT license: http://www.opensource.org/licenses/mit-license.php
"""
This module implements the data model for the service.
"""
from sqlalchem... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file: experimental.py
# version: 0.1.0
# source: https://github.com/maslinych/linis-scripts/blob/master/rbo_calc.py
# ported to Python 3 and slightly modified by Albin Zehe
def calc_rbo(l1, l2, p=0.98):
"""
Returns RBO indefinite rank similarity metric, as desc... |
import os
from ratuil.layout import Layout
from ratuil.bufferedscreen import BufferedScreen as Screen
#from ratuil.screen import Screen
from ratuil.textstyle import TextStyle
from asciifarm.common.utils import get
from .listselector import ListSelector
SIDEWIDTH = 20
ALPHABET = "!\"#$%&'()*+,-./0123456789:;<=>?@A... |
'''
TelegramAPy
Copyright (C) 2015 Giove Andrea
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 distributed i... |
from __future__ import generators
import sys
from cgi import escape
try:
raise ImportError
import itertools
itertools_takewhile = itertools.takewhile
except ImportError:
# fake it
def takewhile(predicate, iterable):
# takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4
for x in iterable:... |
import json
import os
import re
from emoji import UNICODE_EMOJI
import codecs
import random
class Config:
def __init__(self):
with codecs.open('../config/reactions.json', 'r', 'utf-8') as f:
self.reactions = json.load(f)
self.reaction_chance = self.reactions.pop('chance', 100) / 100... |
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD Style.
import sys
import warnings
import itertools
import operator
from abc import AB... |
# -*- coding: utf-8 -*-
'''
Created on 25.06.2012
@author: bach
'''
from shotgun_replica.connectors import DatabaseModificator, PostgresEntityType
from shotgun_replica.sync.shotgun_to_local import EventProcessor
from shotgun_replica.entities import InOut
from tests_elefant import testProjectID, testShotID, testTaskI... |
#!/usr/bin/python
# Calculates statistics and plots the bag metrics from raw data
from __future__ import print_function
import csv
import os, sys
import numpy as np
import scipy as sp
import scipy.stats as sps
import pandas as pd
import re, shutil, tempfile
import itertools, operator
import subprocess
import Gnuplot
... |
from __future__ import unicode_literals
import unittest
import mock
from mopidy import backend, core
from mopidy.models import Track
class TracklistTest(unittest.TestCase):
def setUp(self):
self.tracks = [
Track(uri='dummy1:a', name='foo'),
Track(uri='dummy1:b', name='foo'),
... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 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 ... |
#!/usr/bin/python
# -*-coding:UTF-8-*-
import sys
import time
import yaml
import pymongo
from hashlib import md5
zone_map = {
'动漫': '一些关于动漫的事情',
'音乐': '一些关于音乐的事情',
'轻小说': '一些关于轻小说的事情'
}
def create_admin(db, setting):
email = raw_input('请输入可用邮箱账号: ')
username = raw_input('请输入管理员用户名: ')
passwo... |
#!/usr/bin/env python
import smach
import rospy
import math
import numpy as np
from std_msgs.msg import Float64
from dynamixel_msgs.msg import JointState
from dynamixel_controllers.srv import SetSpeed
from approach_control_manipulator.utils.arm_mod import Arm3Link
class GoTo(smach.State):
def __init__(self):
... |
#!/usr/bin/python
# Copyright 2003-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
import os
import sys
import gentoolkit.pprinter as pp
from gentoolkit.eclean.pkgindex import PkgIndex
class CleanUp(object):
"""Performs all cleanin... |
import torch
from .Criterion import Criterion
class SpatialClassNLLCriterion(Criterion):
def __init__(self, weights=None, sizeAverage=True):
assert weights is None or weights.dim() == 1
super(SpatialClassNLLCriterion, self).__init__()
self.sizeAverage = sizeAverage
self.weights = ... |
from django.shortcuts import (
render,
render_to_response)
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic import DetailView
from django.core.exceptions import ValidationError
from django.views.decorators.http import require_http_me... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
# This file is part of the Lineage Tree Clustering project.
# Copyright (C) 2014
# Author: Valeriy Khakhutskyy
#
# Lineage Tree Clustering 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... |
# -*- 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... |
import os
config = {
#########################################################################
######## ANDROID GENERIC CONFIG KEYS/VAlUES
# note: overridden by MOZHARNESS_ACTIONS in TaskCluster tasks
'default_actions': [
'clobber',
'clone-tools',
'checkout-sources',
's... |
import enum
import pytest
from msl.equipment import exceptions
from msl.equipment.connection import Connection
from msl.equipment.record_types import EquipmentRecord
class EnumTest1(enum.IntEnum):
A = 1
B = 2
C = 3
class EnumTest2(enum.IntEnum):
data_A = 11
DATA_B = 12
RES_C = 13
class E... |
# TreeLearn
#
# Copyright (C) Capital K Partners
# Author: Alex Rubinsteyn
# Contact: alex [at] capitalkpartners [dot] com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# vers... |
import os
import shutil
from SCons.Script import *
from SCons.Action import CommandAction
def replace_dash(s):
return s.replace('-', '_')
def write_spec_text_section(f, env, name, var):
if var in env:
f.write('%%%s\n%s\n\n' % (name, env.get(var).strip()))
def write_spec_script(f, env, name, var):... |
import discord
from discord.ext import commands
from .utils.dataIO import fileIO
from .utils import checks
from .utils.chat_formatting import box
from __main__ import send_cmd_help, set_cog
import os
from subprocess import call, Popen
from distutils.dir_util import copy_tree
import shutil
import asyncio
class Download... |
import datetime
from http import HTTPStatus
import os
import pytest
import shutil
import tempfile
from pathlib import Path
from posix import stat_result
from stat import ST_MTIME
from pbench.server.api import create_app, get_server_config
from pbench.test.unit.server.test_user_auth import login_user, register_user
fro... |
#!/usr/bin/python
from time import sleep
from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate
class Instrument:
drums = 1
guitar = 2
bass = 3
other = 4
@staticmethod
def instrumentName(num):
if num == 1:
return "drums"
elif num == 2:
return "guitar"
elif num == 3:
return "bass"
... |
#!/Users/terrywong/stock_portfolios_server/venv/bin/python
# $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Fix a word-processor-generated styles.odt for odtwriter use: Drop page size
specifi... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
# Cross-section: Off_Off
# Run:30806
######################################################################
#Python Script Generated by GeneratePythonScript Algorithm
######################################################################
LoadEventNexus(Filename='/SNS/REF_M/IPTS-21391/nexus/REF_M_30794.nxs.h5',
... |
import unittest
from sound.rtttl_parser import RtttlParser
class TestRtttlParser(unittest.TestCase):
SONG = {
'rtttl': 'The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6',
'name': 'The Simpsons',
'defaults': ['d=4', 'o=5', 'b=160']... |
import warnings
from contextlib import contextmanager
from django.contrib.auth import get_user_model
from django.test.testcases import assert_and_parse_html
class WagtailTestUtils:
@staticmethod
def create_test_user():
"""
Override this method to return an instance of your custom user model
... |
import json
import os
from django.test import TestCase
from corehq.apps.commtrack.tests.util import bootstrap_domain as initial_bootstrap
from corehq.apps.locations.models import Location
from custom.ilsgateway.api import Location as Loc
from custom.ilsgateway.commtrack import sync_ilsgateway_location
TEST_DOMAIN = 'i... |
# Test lines
from pygame import draw, rect
def test_rect(test_surf):
"""Draw several rectangles."""
for y in range(10, 200, 45):
x = 10
for width in range(10, 30, 3):
for height in range(10, 40, 7):
r = rect.Rect(x, y, width, height)
x += width + 2
... |
from __future__ import print_function
import fcl
import os
import time
from os.path import abspath, join, dirname, isfile
from fcl import kmeans
from fcl.datasets import load_sector_dataset, load_usps_dataset
from fcl.matrix.csr_matrix import get_csr_matrix_from_object, csr_matrix_to_libsvm_string
from sklearn.decompos... |
#mobile/api.py
#For rest calls to mobile app through TastyPie
from tastypie.resources import ModelResource
from manage import models as mmod
from account import models as amod
from catalog import models as cmod
from tastypie import fields
#Class to give Repair Statuses to mobile app
class Repair_StatusResourc... |
# -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of pyjulius.
#
# pyjulius is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the... |
import math
import re
import json
from github import Github
from PythonGists import PythonGists
from discord.ext import commands
from cogs.utils.checks import cmd_prefix_len, load_config
'''Module for custom commands adding, removing, and viewing.'''
class Customcmds:
def __init__(self, bot):
... |
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
DEBPACKAGES = ['percona-server-server', 'percona-server-test',
'percona-server-dbg', 'percona-server-source',
... |
from datagrowth.exceptions import DGInvalidResource
from sources.models.google.query import GoogleQuery
class GoogleText(GoogleQuery):
URI_TEMPLATE = 'https://www.googleapis.com/customsearch/v1?q={}'
GET_SCHEMA = {
"args": {
"type": "array",
"items": [
{
... |
# -*- coding: utf-8 -*-
# Reverse a linked list from position m to n. Do it in-place and in one-pass.
#
# For example:
# Given 1->2->3->4->5->NULL, m = 2 and n = 4,
#
# return 1->4->3->2->5->NULL.
#
# Note:
# Given m, n satisfy the following condition:
# 1 <= m <= n <= length of list.
# Definition for singly-linked l... |
"""
sentry.models.file
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import os
import six
import mmap
import tempfile
from hashlib import sha1
from uuid import uuid4
from concurre... |
#-*-coding:utf-8-*-
"""
@package bapp.tests.doc.test_examples
@brief See bapp.tests.doc for more information
@author Sebastian Thiel
@copyright [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl.html)
"""
from __future__ import print_function
__all__ = []
import sys
import bapp
from butility.tests... |
# coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import os.path
import re
import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from .subtitles import SubtitlesInfoExtractor
from ..jsinterp import JSInterpreter
from ..swfinterp import SWFInterpreter
... |
"""
SalesReceipt and ItemOrder model classes
"""
import json
def _assign_with_type_check(obj, attr, value, type_info):
if isinstance(value, type_info):
setattr(obj, attr, value)
else:
raise TypeError("Expected type: %s but found: %s" % (type_info, type(value)))
class SalesReceipt(object):
... |
# -*- 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, soft... |
import urllib
from flask import render_template, request, session
from flask_restful import Resource
from app import app, api
from bank import get_bank
from inventory import *
from material import *
from sharedInventory import get_shared_inventory
from wallet import *
@app.route('/')
@app.route('/index')
def index(... |
from pudzu.charts import *
from pudzu.sandbox.bamboo import *
flags = pd.read_csv("datasets/countries.csv")[lambda df: df.code != "EUU"].split_columns(('nationality', 'tld', 'country'), "|").explode('country').set_index('country').drop_duplicates(subset='flag', keep='first')
bg = "#EEEEEE"
def image_flag(c):
... |
# Generated by Django 2.1.11 on 2019-10-18 05:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import editor.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('ed... |
#!/usr/bin/env python
#coding:utf-8
import os.path
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import socket
import struct
import json
from conf import terminal_servers_conf
from tornado.options import define, options
define("port", default=8000, help="run on the given po... |
from datetime import datetime
from flask_admin.contrib.sqla.ajax import QueryAjaxModelLoader
from flask_admin.model.fields import AjaxSelectField
from psi.app.models import Product
from psi.app import service
from psi.app.models import InventoryTransactionLine, InventoryTransaction
from psi.app.utils import security_... |
# -*- coding: utf-8 -*-
import numpy as np
from state_action import StateAction
class StateGeneralizer:
""" Creates the Generalizer.
Args:
updater: object in charge of update the value of actions
"""
def __init__(self, m):
self.Q = {}
self.m = m
def getRepresentation(s... |
# -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2008 Johan Dahlin
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; eithe... |
from __future__ import absolute_import
from __future__ import unicode_literals
from threading import Thread
from six.moves import _thread as thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # Python 3.x
from compose.cli.signals import ShutdownException
STOP = o... |
from zope import component
from zope import interface
import importlib
from hashlib import md5
import mellon
from scrapy.linkextractors import LinkExtractor
import scrapy.spiders
try:
from urllib import parse
except ImportError:
import urlparse as parse # Py2
from sparc.configuration import container
from mell... |
from __future__ import division
from __future__ import print_function
import pytest
import numpy as np
from numpy.polynomial import polynomial
from ..arccalibration import gen_triplets_master
from ..arccalibration import arccalibration_direct
from ..arccalibration import fit_solution
try:
import matplotlib
... |
# 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 ... |
#!/usr/bin/env python
#
# Copyright 2015 Airbus
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# 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
#
# ... |
# Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.layers import Input, Dense, concatenate, Embedding, Reshape
from tensorflow.keras.models import Model
in... |
import numpy as np
from test_generic import *
def train1(y, f, model_manager, number_of_model_parameters, sequence_len):
number_of_sequences = len(y) - sequence_len
x = np.linspace(0, sequence_len, sequence_len)
models = model_manager.optimise_td(x, y, f, sequence_len)
models, arr_min, arr_max = resca... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""FreeBSD platform implementation."""
import errno
import functools
import os
import sys
from collections import namedtuple
from ... |
import urllib2, urllib, sys, os, re, random, copy
from BeautifulSoup import BeautifulSoup, Tag, NavigableString
import xbmc,xbmcplugin,xbmcgui,xbmcaddon
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon
from scrapers import CommonScraper
net = Net()
try:
import json
except:
# pre-frodo and python... |
import os
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SCREENSHOT_PATH = os.path.join(PROJECT_DIR, 'screenshots')
# OpenGL context configuration
# version: (MAJOR, MINOR)
OPENGL = {
"version": (3, 3),
}
# Window / context properties
WINDOW = {
"class": "demosys.context.pyqt.GLFW... |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
# -*- coding: utf-8 -*-
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#
# Contributors: lucas-ca <lucascamp@web.de>
""" This module provides some operators for ... |
# This file is part of the py-boinc-plotter,
# which provides parsing and plotting of boinc statistics and
# badge information.
# Copyright (C) 2013 obtitus@gmail.com
#
# 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 Fr... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... |
# -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import FaxService, PopbillException
faxService = FaxService(testValue.LinkID, testValue.SecretK... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, merge, publish... |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2016 VoltDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at you... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Evernote Corporation
#
# This file is part of Pootle.
#
# 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 L... |
"""Define a class to communicate with configuration database API."""
import json as _json
import datetime as _datetime
from urllib import parse as _parse
from urllib.request import Request as _Request, urlopen as _urlopen
from urllib.error import URLError as _URLError
import dateutil.parser
import numpy as _np
from ... |
# pygame_cffi - a cffi implementation of the pygame library
# Copyright (C) 2013 Neil Muller
# Copyright (C) 2013 Jeremy Thurgood
# Copyright (C) 2013 Maciej Fijalkowski
# Copyright (C) 2014 Rizmari Versfeld
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Les... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 오목
# https://www.acmicpc.net/problem/2615
import sys
import copy
if __name__ == '__main__':
matrix = []
for cnt in range(19):
row_data = [int(x) for x in sys.stdin.readline().strip().replace(' ','')]
matrix.append(row_data)
# 1이 이기는 경우
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.