text
stringlengths
1
927k
from autobahn.twisted import websocket import logging import numpy as np import threading import time from twisted.python import failure from twisted.internet import defer, endpoints import twisted.internet.error from universe import utils from universe.twisty import reactor from universe.rewarder import connection_t...
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz Copyright (c) 2021-present tag-epic 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 t...
#!/usr/bin/env python2 # -*- mode: python -*- # # Electrum - lightweight Futurocoin client # Copyright (C) 2016 The Electrum developers # # 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 with...
"""Module providing generic sequences that are used throught Embiggen.""" from embiggen.sequences.generic_sequences.edge_prediction_sequence import EdgePredictionSequence __all__ = [ "EdgePredictionSequence" ]
#!/usr/bin/env python3 # Copyright 2021 Christian Henning # # 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...
# # @lc app=leetcode.cn id=173 lang=python3 # # [173] 二叉搜索树迭代器 # class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class BSTIterator: def __init__(self, root: TreeNode): self.stack = [] if root is not None: self.stack.ap...
from pyradioconfig.calculator_model_framework.interfaces.itarget import ITarget class Target_IC_Nixi(ITarget): _targetName = ITarget.IC_str _description = "" _store_config_output = True _cfg_location = "nixi" _tag = ITarget.IC_str def target_calculate(self, model): pass
"""Tests for Job Scheduler""" from __future__ import generator_stop import time import pytest from sopel import loader, plugin from sopel.tools import jobs TMP_CONFIG = """ [core] owner = Bar nick = Sopel enable = coretasks """ class WithJobMockException(Exception): pass @pytest.fixture def mockconfig(conf...
#!/usr/bin/env python # -*- coding:utf-8 -*- """Arco CLI Usage: arco (new | n) -t <title> -g <category> -f <filename> arco (generate | g) arco (deploy | d) arco -h | --help arco -v | --version Subcommands: new Create a new blank page generate Generate pages deploy ...
import sys import typing import colorama def exit_failure() -> typing.NoReturn: colorama.deinit() sys.exit(1)
# Copyright 2018 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. """Quest for running a Telemetry benchmark in Swarming.""" import copy from dashboard.pinpoint.models.quest import run_test _DEFAULT_EXTRA_ARGS = [ '...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from .. import _utilities import typing # Export this package's modules as members: from .customer_gateway_association import * from .device import * f...
from getpass import getuser from shlex import quote from typing import Dict import click import hashlib import json import logging import os import subprocess import sys import time import warnings from ray.autoscaler.command_runner import CommandRunnerInterface from ray.autoscaler._private.docker import check_bind_mo...
# Copyright (c) 2021 PaddlePaddle 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 appli...
import torch import torch.nn as nn import torchvision __all__ = ["linear"] class LinearHead(nn.Module): def __init__(self, width, roi_spatial=7, num_classes=60, dropout=0.0, bias=False): super().__init__() self.roi_spatial = roi_spatial self.roi_maxpool = nn.MaxPool2d(roi_spatial) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 by Murray Altheim. All rights reserved. This file is part of # the Robot OS project and is released under the "Apache Licence, Version 2.0". # Please see the LICENSE file included as part of this package. # # author: altheim # created: 2020-03-31 # mo...
# TABUADA #Mostra a tabuada de vários números, um de cada vez #O programa encerra quando o número digitado é negativo while True: num = int(input('Número? ')) print('=' * 10) if num < 0: break for i in range(1, 11): print(f'{num} x {i} = {num * i}') print('='*10) print('Fim')
# -*- coding: utf-8 -*- """ Created on Fri Apr 27 14:45:24 2012 @author: proto """ ''' this method classifies reactants according to the rdf information, and gives us information on which reactants are the same, and how do they differ (compartment etc) ''' from sbml2bngl import SBML2BNGL import libsbml import collec...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
#!/usr/bin/env python3 from collections import deque import random SETS = 3 # Cantidad de sets generados TASKS_CREATED = 10 # Cantidad de tareas creadas por cada set MAX_SERVICETIME = 100 # Maximo Tiempo de Servicio de una tarea. 28800 = 8h MAX_SERVICELIST_SIZE = 4 # Maxima canitad de...
# Copyright (c) 2019, DjaoDjin inc. # 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 of source code must retain the above copyright notice, # this list of conditions and t...
from typing import List, Dict, Optional, Any, Mapping from pydantic import BaseModel from fastapi import Query from monty.json import MSONable from maggma.core import Store from maggma.api.util import STORE_PARAMS, dynamic_import from pydantic.fields import ModelField import inspect import warnings class QueryOperato...
from bika.lims.interfaces import IJSONReadExtender, IARTemplate from zope.component import adapts from zope.interface import implements class JSONReadExtender(object): """- Place additional information about profile services into the returned records. Used in AR Add to prevent extra requests """ ...
#!/usr/bin/python # -*- coding: utf-8 -*- from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException DOCUMENTATION = ''' module: openshift_v1_group_list short_description: OpenShift GroupList description: - Retrieve a list of groups. List operations provide a snapshot read of ...
# Copyright 2019 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 applicab...
import os import utils.log as log import time class EnableRepos(object): def __init__(self,host, qa_username, qa_password, pool_id): self.username = qa_username self.password = qa_password self.poolid = pool_id self.host = host self.ssh = 'ssh %s ' %host.hostname # do no...
#imports import cleaning_modules as cm import os #BE SURE TO CHOOSE OR AMEND THE 'rawdatapath' & 'filename_danielle' paths for your computer!! # our inputs tic_list = [7582594, 7582633, 7620704, 7618785, 7584049] sectornumber = 14 rawdatapath = '/Users/helenfellow/Desktop/sec14_rawdata_subsample/' rawdatapath_danie...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'elk_project.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise Im...
#!/usr/bin/env python # coding: utf-8 # In[4]: def heapify(arr, n, i): largest = i # Initialize largest as root l = 2 * i + 1 # left = 2*i + 1 r = 2 * i + 2 # right = 2*i + 2 if l < n and arr[i] < arr[l]: largest = l if r < n and arr[largest] < arr[r]: largest = r if largest != i: arr[i],ar...
#!/usr/bin/env python3 # (C) Copyright 2020 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its statu...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # # P A G E B O T E X A M P L E S # # Copyright (c) 2017 Thom Janssen <https://github.com/thomgb> # www.pagebot.io # Licensed under MIT conditions # # Supporting DrawBot, w...
# -*- coding: utf-8 -*- # import rdflib from urllib.request import Request, urlopen from flask import render_template, url_for from lxml.etree import ParseError from rdflib import URIRef, Literal, BNode from lxml import etree from geofabric import _config as config from geofabric.helpers import gml_extract_geom_to_geoj...
import torch import torch.nn as nn from torch.distributions import Bernoulli from src.modules.attn import MAB, PMA, SAB, ISAB, ISABStack from src.utils import * from src.modules.mlp import * class EdgePredictor(nn.Module): def __init__(self, embedding_dim, device): super().__init__() self.pairwi...
# These tests check that the Blue Monitor action is working vs Abstract Red Actions. # tests need to check that a range of inputs result in the correct changes to the state and return the correct obs # tests should establish varying environmental states that results in these actions performing differently import ...
# Run `init_train_idxs.py <int: dataset size> <int: initial training set size>`: # Creates a `train_idxs.npz` file with the initial set of training indices. # e.g `python init_train_idxs.py 64000 1000` import sys import numpy as np from sklearn.model_selection import train_test_split dataset_size = int(sys.argv[1])...
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import argparse import json import numpy as np import os from collections import defaultdict import cv2 import tqdm from fvcore.common.file_io import PathManager from detectron2.data import DatasetCatalog, MetadataCatalog fro...
import sys import django PY3 = (sys.version_info >= (3,)) try: # Django 1.5+ from django.utils.encoding import smart_text, smart_bytes except ImportError: # older Django, thus definitely Python 2 from django.utils.encoding import smart_unicode, smart_str smart_text = smart_unicode smart_bytes ...
# # Copyright (C) 2012-2019 Ben Kurtovic <ben.kurtovic@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy...
#!/usr/bin/env python import aselite from sys import argv, exit if len(argv) < 2 or len(argv) > 3 or '-h' in argv: print 'usage: center.py FILE [DISTANCE]' print ' centers the structure in the current box and' print ' optionally adds DISTANCE amount of vacuum to FILE' print exit(0) ...
from .camera import * from .obj_file import * from .obj_parser import * from .ray_tracer import * from .scene_parser import * from .world import *
# coding: utf-8 # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# coding: utf-8 """ Unofficial python library for the SmartRecruiters API The SmartRecruiters API provides a platform to integrate services or applications, build apps and create fully customizable career sites. It exposes SmartRecruiters functionality and allows to connect and build software enhancing it. ...
#coding:utf-8 from flask import request, Flask import time import os app = Flask(__name__) @app.route("/", methods=['POST']) def get_frame(): start_time = time.time() upload_file = request.files['file'] old_file_name = upload_file.filename if upload_file: file_path = os.path.join('./imgtest/', ...
#!/usr/bin/env python """ Test audio file splitter """ import os from asrtoolkit.split_audio_file import split_audio_file from utils import get_test_dir test_dir = get_test_dir(__file__) def test_split_audio_file(): """ Test audio file splitter """ split_audio_file( f"{test_dir}/small-test-f...
from dmppl.scripts.parvec import entryPoint from dmppl.base import rdTxt from dmppl.test import runEntryPoint import os import tempfile import shutil import sys import unittest class Test_Parvec(unittest.TestCase): # {{{ def setUp(self): # Different PRNGs between CPython versions. # Check against...
{ 'targets': [ { 'target_name': 'freetype', 'type': 'static_library', 'standalone_static_library': 1, 'sources': [ # base components (required) '../third_party/externals/freetype/src/base/ftsystem.c', '../third_party/externals/freetype/src/base/ftinit.c', '....
#Copyright 2018 Google LLC # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in writing, softwa...
"""Unit test package for app."""
from .gaussian_target import gaussian_radius, gen_gaussian_target from .res_layer import ResLayer from .position_embedding_2d import PositionEmbeddingSine from .sampling import topktopp __all__ = ['ResLayer', 'gaussian_radius', 'gen_gaussian_target', 'PositionEmbeddingSine', 'topktopp...
''' Decision Tree Predict if it is possible to default on the loan ''' import numpy as np from sklearn import tree data = np.genfromtxt("exercise.csv", delimiter=",") # get train data set x_data = data[1:, 1:-1] # get test data set y_data = data[1:, -1] print(x_data) print(y_data) # Create decision tree dtree = tree...
import copy import pathlib import sys import helpers import numpy import pytest import meshio @pytest.mark.parametrize( "mesh, binary, data", [ (helpers.tet_mesh, False, []), (helpers.hex_mesh, False, []), (helpers.tet_mesh, False, [1, 2]), (helpers.tet_mesh, True, []), ...
"""Find files with a given list of filename extensions. Construct a list _L that contains all filenames that have the extension ".jpg" , ".jpeg" or ".png" in directory _D and all it's subdirectories. Source: Bart """ # Implementation author: charlax # Created on 2019-09-27T11:33:27.420533Z # Last modified on 2019-09...
class Battery: def __init__(self, evaluator): raise NotImplementedError def get_action(self, current_state): raise NotImplementedError
import time import unittest from cache_dependencies import interfaces, transaction try: from unittest import mock except ImportError: import mock try: str = unicode # Python 2.* compatible string_types = (basestring,) integer_types = (int, long) except NameError: string_types = (str,) in...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# See LICENSE for licensing information. # # Copyright (c) 2016-2021 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # import sys,re,shutil import debug import tech im...
#!/usr/bin/python import mininet.util; from mininet.util import quietRun, moveIntf; def _makeIntfPair( intf1, intf2, addr1=None, addr2=None, node1=None, node2=None, deleteIntfs=True, runCmd=None ): """Make a veth pair connnecting new interfaces intf1 and intf2 intf1: name for interface 1 i...
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
from MiniAmazon.models import db def search_by_name(query): #Search for the product here db_query = {'name': query} matchingproducts = db['products'].find(db_query) # Products is the table/collection. It returns a cursor(pointer).Cursor is a type of Generator. if matchingproducts: return list(...
#!/usr/bin/python ##### ~ http://stackoverflow.com/questions/7960600/python-tkinter-display-animated-gif-using-pil ~ ## source of code can be found at the above web page, I have modified the code to suit my needs. from Tkinter import * from PIL import Image, ImageTk class MyLabel(Label): def __init__(self, mas...
""" WSGI config for maillerApp project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SE...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # 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 # # ...
# Generated by Django 2.2.15 on 2020-08-14 21:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bbb', '0006_auto_20200813_1954'), ] operations = [ migrations.AddField( model_name='room', name='hangout_room', ...
# Copyright 2013-2022 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) from spack import * class RBiocversion(RPackage): """Set the appropriate version of Bioconductor packages. This...
import copy import datetime import functools import inspect import sys import warnings from collections import defaultdict from distutils.version import LooseVersion from html import escape from numbers import Number from operator import methodcaller from pathlib import Path from typing import ( TYPE_CHECKING, ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-09-13 23:27 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("plan", "0016_auto_20180904_1457")] operations = [ migrations.AddField( mode...
# -*- coding: utf-8 -*- """ The static grains, these are the core, or built in grains. When grains are loaded they are not loaded in the same way that modules are loaded, grain functions are detected and executed, the functions MUST return a dict which will be applied to the main grains dict. This module will always b...
from django import template register = template.Library() def fontawesome(icon_name, size=""): """ Generate fontawesome syntax for HTML. Usage: {% fontawesome "iconname" %} {% fontawesome "iconname" "size" %} Size values are: lg, 2x, 3x, 4x, 5x """ if len(size) > 0: ...
from symarray.calculus.integers import Integer from symarray.calculus.arrays import Array from symarray.shape import NDShape def test_basic(): a = Array('a') b = Array('b', shape=NDShape((Integer('n1'), Integer('n2')))) n = Integer('n') expr = a+n*a+2+b print(expr.shape) print(expr[1])
import math def load_image(filename, append_index=False): content = [line.strip().split(' ') for line in open(filename)][0] r = list(map(int, content[0::3])) g = list(map(int, content[1::3])) b = list(map(int, content[2::3])) if append_index: return list(zip(r,g,b,range(len(r)))) else: ...
from __future__ import division # pylint: disable-msg=W0402 import re import string import sys import tempfile import warnings import inspect import os import subprocess import locale import traceback from datetime import datetime from functools import wraps from contextlib import contextmanager from numpy.random im...
""" Support code for building Python extensions on Windows. # NT stuff # 1. Make sure libpython<version>.a exists for gcc. If not, build it. # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) # 3. Force windows to use g77 """ from __future__ import division, absolute_import, p...
# -*- coding: utf-8 -*- from .encoding import DataEncoder from .rand import Rand from .singleton import singleton from .storage import Storage __all__ = ["singleton", "Storage", "DataEncoder", "Rand"]
""" An end-to-end test which performs the following: 1. creates a ChRIS user account. 2. caw login 3. caw search 4. caw upload --pipeline ... 5. caw download 6. caw logout """ import os import unittest import random import string import requests import subprocess as sp from tempfile import NamedTemporaryFile, Tempor...
import sys import json from time import sleep from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptio...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource f...
import _plotly_utils.basevalidators class PointsValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="points", parent_name="violin", **kwargs): super(PointsValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
from plotly.basedatatypes import BaseLayoutHierarchyType import copy class Domain(BaseLayoutHierarchyType): # column # ------ @property def column(self): """ If there is a layout grid, use the domain for this column in the grid for this scene subplot . The 'column...
"""test_algo_api.py module.""" # from datetime import datetime, timedelta import pytest # import sys # from pathlib import Path import numpy as np import pandas as pd # type: ignore import string import math from typing import Any, List, NamedTuple # from typing_extensions import Final from ibapi.tag_value import T...
""" CryptoAPIs Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei...
from tqdm import tqdm,trange from time import sleep for i in trange(20): sleep(0.1) pass raise SystemExit
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "second_project.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Djang...
# -*- coding: utf-8 -*- # Copyright (c) 2021 Intel Corporation # # 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...
""" test the following: model + scene understanding + interface """ import os import sys PATH = os.path.join(os.getcwd(), '..') sys.path.append(PATH) import cv2 from PyQt5.QtGui import QImage, QColor, QPixmap from PyQt5.QtWidgets import QApplication import qtmodern.styles import qtmodern.windows from layout import La...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # """ Userbot initialization. """ import os from sys import version_info from logging import basicConfig, getLogger, IN...
import os import subprocess from abc import ABC from jinja2 import Environment from jinja2 import FileSystemLoader from jinja2 import StrictUndefined from jinja2.exceptions import UndefinedError from argparse import ArgumentParser from rkd.api.contract import ExecutionContext from rkd.yaml_parser import YamlFileLoader ...
from .mode_actions_sampler import ModeActionSampler from .disentangling_test import DisentanglingTester
# openWindAcComponent.py # 2014 04 08 ''' Execute OpenWindAcademic as an OpenMDAO Component After execute(), the following variables have been updated: nTurbs net_aep gross_aep They can be accessed through appropriate connections. NOTE: Script file must contain an Optimize/Optimise...
from algotrader import Context from algotrader.model.model_factory import ModelFactory from algotrader.provider import ProviderManager from algotrader.provider.broker import Broker from algotrader.provider.datastore import DataStore from algotrader.provider.feed import Feed from algotrader.strategy import StrategyManag...
import math import operator as op from collections import ChainMap as Environment Symbol = str List = list Number = (int, float) def parse(program: str): return read_from_tokens(tokenize(program)) def tokenize(raw): return raw.replace('(', ' ( ').replace(')', ' ) ').split() def read_from_tokens(tokens: l...
import csv import glob import os import pycurl import re import ldap3 from datetime import date, timedelta, datetime from dateutil.parser import parse from django.core.management.base import BaseCommand, CommandError from django.db import connection from django.db.models import Max from django.utils.text import slugify...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # 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...
def f<caret>(*, param1, param2): pass f(param1=1, param2=2)
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields from odoo.addons.product.tests.test_product_attribute_value_config import TestProductAttributeValueSetup from odoo.tests import tagged class TestSaleProductAttributeValueSetup(TestProductAttribu...
# (c) 2009-2019 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Implementation of a domain controller that allows users to authenticate via the Google Identity Platform - based on Firebase Authentication...
""" This script is executed in each job on the server to run simulation studies on all the parameters that are passed to it """ import sys import ast import numpy as np from scdcdm.util import multi_parameter_sampling as mult # Convert string parameters to lists cases = ast.literal_eval(sys.argv[1]) print("cases:", c...
# Interval class which converts class Interval: def __init__(self, interval_=[0, 0]): self.start = interval_[0] self.end = interval_[1] def __repr__(self): return '[{}, {}]'.format(self.start, self.end) class Solution: def merge(self, intervals): intervals = [Interval(i) f...
# coding:=utf-8 # Copyright 2021 Tencent. 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 applic...
def custom_range(min, max): index = min while index <= max: yield index index += 1 it = custom_range(1, 2) print(next(it)) print(next(it)) print((x for x in range(3))) even = filter(lambda x: x % 2 == 0, range(10)) for x in even: print(x)