src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- ''' #------------------------------------------------------------------------------ # Name: util.py # Purpose: Various utility functions for npa_nonlocal. # # Author: Vincent Russo (vrusso@cs.uwaterloo.ca) # # Created: 1/13/2015 # Copyright: (c) Vincent Russo 2015 # Licence...
#this script is used to add rBC mass to the database import sys import os import datetime import pickle import numpy as np import matplotlib.pyplot as plt from pprint import pprint from scipy.optimize import curve_fit from scipy import stats from SP2_particle_record_UTC import ParticleRecord from struct import * impor...
import numpy as np import tensorflow as tf from PIL import Image def save_img(sess, tensor, name): tensor0 = tf.transpose(tensor, perm=[1, 2, 0]) res = sess.run(tensor0) tensor1 = tensor0.eval() im = Image.fromarray(tensor1.astype('uint8')) im.save(name) ''' im = Image.open("example_im...
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
# -*- 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 2016, VIXL authors # 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 ...
from decimal import Decimal from string import digits from itertools import takewhile class Iterator: def __init__(self, seq): self.seq = seq self.index = -1 def __iter__(self): return self def _next(self): try: return self.seq[self.index + 1]...
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import uuid from azure.keyvault.keys.aio import KeyClient from key_vault_base_async import KeyVaultBaseAsync class KeyVaultKeys(KeyVaultBaseAsync): def __init__(se...
#!/usr/bin/python # -*- coding: utf-8 -*- ### # Copyright (2016-2021) Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
### Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org> ### Copyright (C) 2009-2012 Kai Willadsen <kai.willadsen@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 Free Software Foundation; either v...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import argparse import logging from pprint import pprint from ArubaCloud.PyArubaAPI import CloudInterface if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-d', '--datacenter', help='Specify datacenter to login.', action='store', type=int, dest='dc') parser.add_argument('-...
from pylayers.util import project from pylayers.signal.bsignal import * import pylayers.util.pyutil as pyu import ConfigParser import matplotlib.pylab as plt import itertools import pdb r""" .. currentmodule:: pylayers.simul.exploit This module Class Exploit ============= .. autosummary:: :toctree: generated...
# Tree is an organizational relationship that is richer than the simple "before" # and "after" relationships between objects in sequences. # We define a tree T as a set of nodes storing elements such that the nodes have # a parent-child relationship that satisfies the following properties: # 1. If T is nonempty, it ha...
import operator import pandas as pd import numpy as np from numpy import ma from scipy.misc import imresize import scipy.ndimage as ndimage from skimage.morphology import disk, dilation def get_truth(input_one, input_two, comparison): # too much abstraction ops = {'>': operator.gt, '<': operator.lt, ...
from vector import * import unittest import types from math import sqrt def create_vector(): return Vector(1,2,3) class testVector(unittest.TestCase): def test_creation(self): with self.assertRaises(NoComponents): Vector() self.assertIsInstance(create_vector(), Vector) com...
# -*- coding: utf-8 -*- import os import re import config import zipfile import crypto_util import uuid import tempfile import subprocess from cStringIO import StringIO import gzip from werkzeug import secure_filename from secure_tempfile import SecureTemporaryFile import logging log = logging.getLogger(__name__) VA...
from decimal import Decimal from django.test import TestCase from ccgallery.models import Item, Category class ManagerTestCases(TestCase): def test_item_for_category(self): """the for item manager method""" c1 = Category() c1.slug = '1' c1.title = '1' c1.description = '1' ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
#!/usr/bin/env python import unittest from geometry_msgs.msg import Point from trajectory.circular_trajectory import CircularTrajectory class CircularTrajectoryTest(unittest.TestCase): def setUp(self): self.trajectory = CircularTrajectory(5, 4) self.expected_position = Point() def test_whe...
from collections import deque, defaultdict from torch._C import _ImperativeEngine as ImperativeEngine from .variable import Variable class BasicEngine(object): def _compute_dependencies(self, function): dependencies = defaultdict(int) seen = {function} queue = [function] while len...
#!/usr/bin/env python from __future__ import print_function import os import re import sys fortran = re.compile("\.([Ff]|[Ff]90)$") cppline = re.compile("^#") cppkeys = ("define .*","include.*","ifdef","ifndef","elif","^if ","else","endif","defined","undef","!","&&","\|\|","\(","\)") def main(top): cppopts = dict(...
# -*- coding: utf-8 -*- from . import NERPipeline import unittest import os class NERPipelineTestCase(unittest.TestCase): pipeline = None name = "NER Pipeline tests" def setUp(self): self.pipeline = None def tearDown(self): self.pipeline = None def test_pipeline_execute_with_inv...
import numpy as np # This function takes the prediction and label of a single image, returns intersection and union areas for each class # To compute over many images do: # for i in range(Nimages): # (area_intersection[:,i], area_union[:,i]) = intersectionAndUnion(imPred[i], imLab[i]) # IoU = 1.0 * np.sum(area_inters...
import os from botty_mcbotface import log from sqlalchemy import create_engine, insert from sqlalchemy.orm import Query, scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.schema import MetaData DB_NAME = 'botty_db' DB_URI = 'sqlite:///botty_db' class BottyDB: ""...
#!/usr/bin/env python # Copyright (c) 2011, The University of York # All rights reserved. # Author(s): # James Arnold <jarnie@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of sourc...
#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # 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 y...
from DemoFramework import DemoFramework from LUILabel import LUILabel from LUIBlockText import LUIBlockText from LUIScrollableRegion import LUIScrollableRegion import random f = DemoFramework() f.prepare_demo("LUIBlockText") # Constructor f.add_constructor_parameter("text", "u'Label'") f.add_constructor_parameter...
'''URL parsing based on WHATWG URL living standard.''' import collections import fnmatch import functools import gettext import logging import re import string import urllib.parse import posixpath from wpull.backport.logging import BraceMessage as __ import wpull.string _logger = logging.getLogger(__name__) _ = gett...
#!/usr/bin/env python3 import argparse import requests import logging import sys __format = '%(asctime)s %(module)-10s::%(funcName)-20s - [%(lineno)-3d]%(message)s' logging.basicConfig(stream=sys.stdout, level=logging.INFO, format=__format, datefmt='%Y-%m-%d ...
import platform import pkg_resources # load data from a subdirectory if platform.system() == "Windows": path_tok_file = '\\'.join(('tests_load_folder', 'demo_text.xml')) path_parse_load = 'parse_loader\\' tok_write = pkg_resources.resource_filename('test', 'tests_save_folder\\') ...
#!/usr/bin/env python # encoding=utf8 # The dead channel applicationn import sys reload(sys) sys.setdefaultencoding('utf8') from uuid import uuid4 from time import time, sleep from haigha.connections.rabbit_connection import RabbitConnection from haigha.message import Message class Client(object): """The RPC Cl...
#!C:\Python26\python.exe ############################################################################### # # genmake.py # Component of Contexo commandline tools - (c) Scalado AB 2010 # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ hecuba setup script ~~~~~~~~~~~~~~~~~~~ Setup script for packaging hecuba :copyright: (c) 2016 by Hugo Cisneiros. :license: GPLv2, see LICENSE for more details. """ import io from hecuba import __version__ from os.path import abspath, dirname, join...
# Script to draw world countries as patches. import numpy as np import matplotlib.pyplot as plt from matplotlib.path import Path import matplotlib.patches as patches from osgeo import ogr def order_coords(coords, clockwise): """Orders coordinates.""" total = 0 x1, y1 = coords[0] for x, y in coords[1:...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions ...
import sys import codecs import os.path import warnings from browsepy.compat import range, PY_LEGACY # noqa from browsepy.file import Node, File, Directory, \ underscore_replace, check_under_base if PY_LEGACY: import ConfigParser as configparser else: import configparser ConfigPa...
# Projection import salome salome.salome_init() import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) # create a cylindric face and a curve(edge) cylinder = geompy.MakeCylinderRH(100, 300) [face_cyl] = geompy.SubShapes(cylinder, [3]) p1 = geompy.MakeVertex(200, 0, 100) p2 = geompy....
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json from frappe import _ from frappe.model.mapper import get_mapped_doc from frappe.utils import flt, cstr from frappe.email...
from porcupy.compiler import compile as compile_ def test_optimized_if(): assert compile_('if 0: x = 11') == '' assert compile_('if 1: x = 11') == 'p1z 11' assert compile_("if '': x = 11") == '' assert compile_("if 'beep': x = 11") == 'p1z 11' assert compile_('if None: x = 11') == '' assert ...
# # Authors: Ma He <mahe.itsec@gmail.com> # Robert Abram <robert.abram@entpack.com> # Copyright (C) 2015-2017 EntPack # see file 'LICENSE' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
# coding: utf-8 """ Evolution to try new engine solution. """ from nxdrive.client.remote_document_client import RemoteDocumentClient from nxdrive.client.remote_file_system_client import RemoteFileSystemClient from nxdrive.client.remote_filtered_file_system_client import \ RemoteFilteredFileSystemClient from nxdriv...
# ------------------------------------------------------------------------------------------------ # Copyright (c) 2016 Microsoft Corporation # # 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 Softw...
# -*- coding: utf-8 ; test-case-name: bridgedb.test.test_email_server -*- #_____________________________________________________________________________ # # This file is part of BridgeDB, a Tor bridge distribution system. # # :authors: Nick Mathewson <nickm@torproject.org> # Isis Lovecruft <isis@torproject.or...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2013 Zuza Software Foundation # # This file is part of Pootle. # # Pootle 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 th...
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg class KApplication(__PyQt4_Qt...
# _*_ encoding:utf-8 _*_ # import win32com.client # # class Caculator(object): def __check_num_zsq(func): def inner(self, n): if not isinstance(n, int): raise TypeError("当前这个数据的类型有问题, 应该是一个整型数据") return func(self, n) return inner def __say(self, word): ...
from header_sounds import * # Many of these sound entries are hard coded into the engine, and should not be removed; to disable them, empty the sound file list. # Add your own sounds just before the animation sounds group, or before sounds_end. sounds = [ ("click", sf_2d|sf_priority_9|sf_vol_3, ["drum_3.ogg"]), ("t...
""" test_contracts.py Wilberto Morales wilbertomorales777@gmail.com This was my first project developed using somewhat TDD(thanks to @nwinklareth). """ import unittest from .contracts import require, ensure, RequirementBreached, \ ContractParamsError, EnsuranceBreached from .conditions import is_int, is_string, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). """Converting code parameters and components from python (PsychoPy) to JS (ES6/PsychoJS) "...
#!/usr/bin/env python from __future__ import with_statement import os from distutils.core import setup import imp def get_version(): " Get version & version_info without importing markdown.__init__ " path = os.path.join(os.path.dirname(__file__), 'zmarkdown') fp, pathname, desc = imp.find_module('__versi...
import logging from functools import wraps LOGGER = logging.getLogger(__name__) def print_stack(func): @wraps(func) def tmp(*args, **kwargs): print(func.__name__) return func(*args, **kwargs) return tmp def print_caller_name(stack_size=3): def wrapper(fn): def inner(*args, **k...
# -*- coding: utf-8 -*- # # Pyplis is a Python library for the analysis of UV SO2 camera data # Copyright (C) 2017 Jonas Gliss (jonasgliss@gmail.com) # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License a # published by the Free Software Foundat...
class RegisterBank(object): def __init__(self, registers: list, size: int): self._registers = [None]*size self._size = size self._nameMap = {} # str -> index for i in range(min(len(registers), size)): self.registers[i] = registers[i] ...
# -*- coding: utf-8 -*- """ Created on Thu Jan 28 16:32:48 2016 @author: jclark this code uses the Ghosh method to determine the apparent resistivities for a layered earth model. Either schlumberger or Wenner configurations can be used """ import numpy as np import random import matplotlib matplotlib...
""" example_a.py by Ted Morin contains example code for model a from 10.1007/s11606-007-0498-4 2008 Prediction of One-Year Survival in High-Risk Patients with Acute Coronary Syndromes: Results from the SYNERGY Trial """ from model_a import model # inputs: [ 'Age', 'Heart Rate', 'Weight', 'Creatin Cleara...
# -*- coding: utf-8 -*- """ @author: Satoshi Hara """ import sys import os sys.path.append(os.path.abspath('./')) sys.path.append(os.path.abspath('./baselines/')) sys.path.append(os.path.abspath('../')) import numpy as np import paper_sub from RForest import RForest import matplotlib matplotlib.use('Agg') import mat...
""" Supports flushing metrics to graphite """ import re import sys import socket import logging import pickle import struct # Initialize the logger logging.basicConfig() SPACES = re.compile(r"\s+") SLASHES = re.compile(r"\/+") NON_ALNUM = re.compile(r"[^a-zA-Z_\-0-9\.]") class GraphiteStore(object): def __init...
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundatio...
# Flexlay - A Generic 2D Game Editor # Copyright (C) 2014 Ingo Ruhnke <grumbel@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 Free Software Foundation, either version 3 of the License, or # (at your option)...
import numpy as np import scipy import re import os import hashlib import csb from csb.bio.io.wwpdb import StructureParser def chunks(l, n): """ Yield successive n-sized chunks from l. """ for i in xrange(0, len(l), n): yield l[i:i+n] class ScatteringFactor(object): """ Cacluates the ...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: anote.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) ...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest import os from ...workbook import Workbook from ..helperfunctions import _compare_xlsx_files class TestCompareXLSXFiles(unittest.TestC...
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/> # # EventGhost 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 versio...
""" Stores jobs in a database table using SQLAlchemy. """ import pickle import logging from lib.apscheduler.jobstores.base import JobStore from lib.apscheduler.job import Job try: from sqlalchemy import * except ImportError: # pragma: nocover raise ImportError('SQLAlchemyJobStore requires SQLAlchemy installe...
# coding:utf-8 html_tpl = ''' <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .nav{ margin: 10px 0; font-size: 12px; font-family: "Helvetica", "Arial", sans-serif; } .nav a{ text-decoration: none; color: #000...
class Connection(object): def __init__(self, method, status, url, timestamp): self.method = method self.status = status self.url = url self.timestamp = timestamp self.label = self.assign_label() def assign_label(self): parameter_url_split = self.url.split('?') if len(parameter_url_spli...
from __future__ import division import numpy as np import os import pickle import glob import Image from skimage.io import imread from sklearn.cross_validation import train_test_split dataset_dir = "../../data/samples" def load(): tps = glob.glob(dataset_dir+"/*true.jpg") fps_2 = glob.glob(dataset_dir+"/*fal...
""" Various header classes to be part of the asciidata class @author: Martin Kuemmel, Jonas Haase @organization: Space Telescope - European Coordinating Facility (ST-ECF) @license: Gnu Public Licence @contact: mkuemmel@eso.org @since: 2005/09/13 $LastChangedBy: mkuemmel $ $LastChangedDate: 2008-01-08 18:13:38 +0100 (...
# -*- coding: utf-8 -*- """ Django settings for tango_with_django_project project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project...
"""ML-ENSEMBLE :author: Sebastian Flennerhag :copyright: 2017-2018 :licence: MIT Base classes for partitioning training data. """ from __future__ import division from abc import abstractmethod import numpy as np from ..externals.sklearn.base import BaseEstimator def prune_train(start_below, stop_below, start_abo...
#!/usr/bin/env python # -*- coding: utf-8 -*- import imp import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('readme.txt').read() history = open('history.txt').read().replace('.. :changelog:', '') curr_path = os.path.dirname(os.path.realpa...
#!/usr/bin/env python # -*- coding: utf-8 -*- from f6a_tw_crawler.constants import * import gevent.monkey; gevent.monkey.patch_all() from bottle import Bottle, request, response, route, run, post, get, static_file, redirect, HTTPError, view, template import random import math import base64 import time import ujson ...
import argparse import json import sys import urllib.request from argparse import RawTextHelpFormatter DESCRIPTION = """ Mark a new deployment in New Relic Example: python ./lib/mark_deployment.py \\ --api_key API_KEY_GOES_HERE \\ --app_id APP_ID_GOES_HERE \\ --version VERSION_STRING_GO...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from interfaces.abstract import AbstractSlice import numpy as np class DenseSlice(AbstractSlice): """ Uninspired dense slice """ def __init__(self, shape, op=None): self.shape = shape self.op = op if self.op is 'int' or self.op is None: self.op = np.add if self.op is np.maximum: se...
import sys from setuptools import setup, find_packages #next time: #python setup.py register #python setup.py sdist upload version = open('thunderdome_logging/VERSION', 'r').readline().strip() long_desc = """ Extension for thunderdome which allows error logging in the graph. """ setup( name='thunderdome-logging...
# Copyright 2015 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...
#!/usr/bin/env python # Copyright (c) 2013, Carnegie Mellon University # All rights reserved. # Authors: Michael Koval <mkoval@cs.cmu.edu> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of source...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'pordb_bilddatei_umbenennen.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): ...
class Skin(object): id = -1 name = '' portrait_path = '' splash_path = '' is_base = False champion_id = -1 rank = -1 def __init__(self, internal_name): self.internal_name = internal_name def __lt__(self, other): return self.rank < other.rank def __repr__(self):...
"""Classes and utilities for mutliple alignments from the EPO pipeline""" import logging import os import pickle as cPickle import re from collections import namedtuple from ._epo import ( # noqa: F401 bed_union, cummulative_intervals, fastLoadChain, rem_dash ) log = logging.getLogger(__name__) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import socket import fileinput import thread import json TCP_IP = '127.0.0.1' TCP_PORT = 3000 BUFFER_SIZE = 1024 user = '' user_to = '' def receive(): #print ("home") while True: #print("waiting to receive") received...
""" EDSM-RSE a plugin for EDMC Copyright (C) 2019 Sebastian Bauer 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. Thi...
""" Copyright 2012, July 31 Written by Pattarapol (Cheer) Iamngamsup E-mail: IAM.PATTARAPOL@GMAIL.COM Largest product in a grid Problem 11 In the 20 X 20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 ...
#!/usr/bin/python # 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 later version. # # Ansible is distributed...
# -*- coding: utf-8 -*- from django.shortcuts import render from django.core.urlresolvers import reverse from django.http import (HttpResponse,) from django.contrib import messages from django.contrib.auth.decorators import login_required from .models import ParTable from .models import ParLine from .forms import Sea...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import logging import os import pycbc import numpy import lal from pycbc_glue.ligolw import ligolw from pycbc_glue.ligolw import lsctables from pycbc_glue.ligolw import utils as ligolw_utils from pycbc_glue.ligolw.utils import process as ligolw_process from pycbc_glue.ligolw import param as ligolw_param from pycbc impo...
# # 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...
# -*- coding: utf-8 -*- import sys,os import codecs import glob import time import datetime import traceback import keyboard # pip install keyboard 同时支持 windows linux if sys.version_info.major==2: #python2 import HTMLParser #pip install HTMLParser if sys.version_info.major==3: #python3 fr...
# To use this plugin, you need to set up the Giphy API key for this bot in # ~/.giphy_config from __future__ import absolute_import from __future__ import print_function from six.moves.configparser import SafeConfigParser import requests import logging import sys import os import re GIPHY_TRANSLATE_API = 'http://api....
import logging from collections import OrderedDict from .signal import (EpicsSignal, EpicsSignalRO) from .device import Device from .device import Component as C, DynamicDeviceComponent as DDC from .areadetector import EpicsSignalWithRBV as SignalWithRBV logger = logging.getLogger(__name__) class ROI(Device): ...
# distance check import numpy as np import cv2 import glob # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((6*7,3), np.float32) objp[:,:2] = np.mgrid[0:7,0:6].T.reshape(-1,2) # Ar...
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2017 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantid workbenc...
# Copyright 2017 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...
# 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. # # This program is distributed in the hope that it will be useful, # bu...
# =============================================================================== # 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import time from datetime import datetime, timedelta from tzlocal import get_localzone import pytz import requests from PyQt5.QtCore import QObject, QSettings, QThread, pyqtSignal, pyqtSlot from PyQt5.QtWidgets import QMessageBox, qApp from bs4 imp...