filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_106_29496
import pytest import approvaltests pytest_plugins = 'pytester' _DEFAULT_REPORTER = approvaltests.get_default_reporter() @pytest.fixture(autouse=True) def reset_approvaltests_config(request): approvaltests.set_default_reporter(_DEFAULT_REPORTER) for option_name in [o for o in vars(request.config.option) if ...
the-stack_106_29497
# # 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...
the-stack_106_29499
import json from json.decoder import JSONDecodeError import requests from .Device import Device from .Spotify_auth import Spotify_Auth spotify_token, spotify = Spotify_Auth() class CurrentTrack: def __init__(self): pass def get_track_info(self) -> json: """Will return the currently playing t...
the-stack_106_29500
# Step 1 & 2 are borrowed from View-Adaptive-Neural-Networks-for-Skeleton-based-Human-Action-Recognition repo # Step 1: Get raw skeleton data import logging import os import os.path as osp import pickle import numpy as np from tqdm import tqdm def get_raw_bodies_data(skes_path, ske_name, frames_drop_skes, frames_dro...
the-stack_106_29502
# -*- coding: utf-8 -*- import pprint import requests from argh.decorators import arg from lain_cli.auth import SSOAccess, authorize_and_check, get_auth_header from lain_cli.utils import (TwoLevelCommandBase, check_phase, get_domain, lain_yaml) from lain_sdk.util import error, info class...
the-stack_106_29503
from enum import Enum, auto from BoschShcPy.base import Base from BoschShcPy.base_list import BaseList from BoschShcPy.client import ErrorException from BoschShcPy.device import Device, status_rx class operation_state(Enum): SYSTEM_DISARMED = auto() SYSTEM_ARMING = auto() SYSTEM_ARMED = auto() MUTE_AL...
the-stack_106_29505
class Win: ''' This class defines a type of win the game. This is the list of be parsed when running the AI in order to find the win that is most probable for the player. The characteristics of the class are similar to that of the player class ''' def __init__(self): #I haven't included monoplie...
the-stack_106_29507
import requests from lxml import etree url="https://www.w3schools.com/xml/simple.xml" response = requests.get(url).content tree = etree.XML(response) print(tree) print(type(tree)) #iter through all elements found in Tree for element in tree.iter(): print("%s - %s" % (element.tag, element.text)) #iter through selec...
the-stack_106_29508
# -*- 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...
the-stack_106_29510
# -*- coding: utf-8 -*- # Copyright (c) 2018 Ericsson AB # # 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 ...
the-stack_106_29513
''' lookup_tab.py: implementation of the "Look up records" tab Copyright --------- Copyright (c) 2021-2022 by the California Institute of Technology. This code is open-source software released under a 3-clause BSD license. Please see the file "LICENSE" for more information. ''' from commonpy.data_utils import un...
the-stack_106_29515
import flask from flask import request, jsonify app = flask.Flask(__name__) app.config["DEBUG"] = True # Create some test data for our catalog in the form of a list of dictionaries. books = [ {'id': 0, 'title': 'A Fire Upon the Deep', 'author': 'Vernor Vinge', 'first_sentence': 'The coldsleep itsel...
the-stack_106_29516
"""Platform for interfacing to Tentalux lighting fixtures. light, scene, camera For more details about this component, please refer to the documentation at https://home-assistant.io/components/tentalux/ """ import logging import voluptuous as vol import requests import json import time from threading import Thread fr...
the-stack_106_29518
#-*- coding:utf-8 -*- import os import time import threading import tkinter as tk from tkinter import ttk from tc_ui_front import * import tkinter.filedialog as tkf import tkinter.messagebox as tkm def func_thrd_ExecuteCommand(): time.sleep(0.01) text.delete(0.0,tk.END) def handle_Input(event): ...
the-stack_106_29520
# Copyright 2021 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...
the-stack_106_29522
########################################################## # pytorch-kaldi v.0.1 # Mirco Ravanelli, Titouan Parcollet # Mila, University of Montreal # October 2018 ########################################################## import torch import torch.nn.functional as F import torch.nn as nn import numpy as np from dist...
the-stack_106_29523
"""Stores Research Object including provenance.""" import copy import datetime import hashlib import logging import os import re import shutil import tempfile import urllib import uuid from collections import OrderedDict from getpass import getuser from io import BytesIO, FileIO, TextIOWrapper, open from socket import...
the-stack_106_29525
####################################################################### # Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) # # Permission given to modify the code as long as you keep this # # declaration at the top # ################################...
the-stack_106_29526
import re import json import itertools import urlparse from datetime import datetime from .feed import Feed from ..timeline import Timeline, Tag, PullRequest class GithubFeed(Feed): API_ROOT_URL = 'https://api.github.com' UI_ROOT_URL = 'https://github.com' def __init__(self, project, token=None): ...
the-stack_106_29531
""" 本程序是实现利用OpenCV来调用已经训练好的YOLO模型 来进行目标检测,opencv的版本最好为3.4以上。 2019/1/24_Zjh_于学科二楼 """ import numpy as np import cv2 import os import time #加载已经训练好的模型 weightsPath="yolov3.weights" configPath="yolov3.cfg" labelsPath = "coco.names" #初始化一些参数 LABELS = open(labelsPath).read().strip().split("\n") #物体类别 COLORS =...
the-stack_106_29532
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Vincent<vincent8280@outlook.com> # http://blog.vincentzhong.cn # Created on 2017/3/28 13:29 import os import aiofiles from pyquery import PyQuery from catty.parser import BaseParser from catty.spider imp...
the-stack_106_29533
import inspect import PREFS from types import ModuleType def prefs(func: callable): """This decorator will pass the result of the given func to PREFS.convert_to_prefs, to print a dictionary using PREFS format. Example: # Without prefs decorator def dictionary(): return {'keybindings': {'Ct...
the-stack_106_29534
# -*- coding: utf-8 -*- # Copyright (c) 2018 SMHI, Swedish Meteorological and Hydrological Institute # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). """ Created on Tue Sep 12 14:38:54 2017 @author: a001985 """ try: import pandas as pd import numpy as np except: pass import ...
the-stack_106_29537
from django.conf.urls import patterns, include, url from django.conf import settings # Uncomment the next two lines to enable the admin: from django.contrib.gis import admin admin.autodiscover() urlpatterns = patterns('', url(r'^dashboard/', include('dashboard.urls')), # remove after 1.2.2013 url(r'^', includ...
the-stack_106_29544
""" MPEG audio file parser. Creation: 12 decembre 2005 Author: Victor Stinner """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, MissingField, ParserError, createOrphanField, Bit, Bits, Enum, PaddingBits, PaddingBytes, RawBytes) from hachoir_parser.audio.id3 import ID3v1, ...
the-stack_106_29545
import sqlite3 from flask import g DATABASE = 'ahoy.db' def row_to_dictionary(cursor, row): return dict((cursor.description[idx][0], value) for idx, value in enumerate(row) ) def get_db(): db = getattr(g, '_database', None) if db is None: db = g._database = sqlite3.connect(DATABASE) ...
the-stack_106_29546
# -*- coding: utf-8 -*- """ Created on Thu Jun 6 00:55:03 2019 Equipment from the Humbird 2011 Report. Humbird, D., Davis, R., Tao, L., Kinchin, C., Hsu, D., Aden, A., Dudgeon, D. (2011). Process Design and Economics for Biochemical Conversion of Lignocellulosic Biomass to Ethanol: Dilute-Acid Pretreatment and E...
the-stack_106_29548
import numpy as np from .grid import Grid, CachedData class UnstructuredGrid(Grid): """ Class for an unstructured model grid Parameters ---------- vertices list of vertices that make up the grid cell2d list of cells and their vertices Properties ---------- vertice...
the-stack_106_29550
# Copyright 2012 Red Hat, 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 agre...
the-stack_106_29551
####################################################################################### # # ObjectID network (based on FaceId) # https://github.com/albertogaspar/keras-face-id/blob/master/models/facenet.py # ####################################################################################### from tensorflow.pytho...
the-stack_106_29552
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """ Conve...
the-stack_106_29554
# # 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...
the-stack_106_29556
# -*- coding: utf-8 -*- __author__ = 'gzp' from typing import Optional from jinja2 import Environment, PackageLoader from urllib.parse import urlunparse from rimuru.utils.jinja2 import filters from rimuru.core.doc_generator import ( MarkdownGenerator ) from .base import APIDocWorkshop template_env = Environmen...
the-stack_106_29557
import tensorflow as tf import glob import numpy as np from tqdm import tqdm from utils.utils import SentenceEmbedding class BirdDataset(tf.keras.utils.Sequence): def __init__(self, path: str = 'dataset/Bird_dataset_text2image/images_crop', size: int = (64, 64), ...
the-stack_106_29558
import glob import os import pickle from math import floor from random import shuffle from urllib.request import urlopen from zipfile import ZipFile from data_utils import read_off_file_into_nparray def download_datasets(args): model_net10_url = 'http://vision.princeton.edu/projects/2014/3DShapeNets/ModelNet10.z...
the-stack_106_29562
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: Daniel E. Cook Script/Tools for working with a VCF in python. Used for generating the interval summary. """ import json import re import pandas as pd import numpy as np import itertools from collections import defaultdict, Counter from cyvcf2 import VCF from ...
the-stack_106_29566
""" A class for creating a satellite object, describing the characteristics of it. """ from math import pi from .utils import heavenly_body_radius import warnings class Satellite(object): def __init__(self, name, altitude, eccentricity, inclination, right_ascension, perigee, ta, beam, focus="ea...
the-stack_106_29569
# coding: utf-8 import os import re import time import signal import shutil import logging import tempfile import subprocess import errno import distutils.version import six try: # yatest.common should try to be hermetic, otherwise, PYTEST_SCRIPT (aka USE_ARCADIA_PYTHON=no) won't work. import library.python....
the-stack_106_29571
from ..utils import docval, getargs from ..spec.spec import DtypeHelper from numpy import dtype __all__ = [ "Error", "DtypeError", "MissingError", "ExpectedArrayError", "ShapeError", "MissingDataType", "IllegalLinkError", "IncorrectDataType" ] class Error(object): @docval({'nam...
the-stack_106_29579
from model.group import Group import random def test_delete_some_group(app, db, check_ui): if len(db.get_group_list()) == 0: app.group.create(Group(name="NewTest000001")) old_groups = db.get_group_list() group = random.choice(old_groups) app.group.delete_group_by_id(group.id) new_groups = d...
the-stack_106_29582
# python3 # Copyright 2021 InstaDeep Ltd. 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...
the-stack_106_29583
# global import mxnet as mx import math import numpy as np from typing import Union, Tuple, Optional, List from ivy.functional.backends.mxnet import _flat_array_to_1_dim_array, _handle_flat_arrays_in_out def flip(x: mx.ndarray.ndarray.NDArray, axis: Optional[Union[int, Tuple[int], List[int]]] = None)\ ...
the-stack_106_29585
# Copyright 2018 Gaëtan Cassiers # # 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 writi...
the-stack_106_29586
#! /usr/local/bin/python # script.py -- Make typescript of terminal session. # Usage: # -a Append to typescript. # -p Use Python as shell. # Author: Steen Lumholt. import os, time, sys import pty def read(fd): data = os.read(fd, 1024) file.write(data) return data shell = 'sh' filename = 'typescript' mode = 'w' i...
the-stack_106_29587
""" In Bookmark Archiver, a Link represents a single entry that we track in the json index. All links pass through all archiver functions and the latest, most up-to-date canonical output for each is stored in "latest". Link { timestamp: str, (how we uniquely id links) _ _ _ _ ___ url: str, ...
the-stack_106_29588
import time from collections import OrderedDict from ignite.engine import Engine, Events from ignite._utils import _to_hours_mins_secs class RunningState(object): """An object that is used to pass internal and user-defined state between event handlers""" def __init__(self, **kwargs): # state, add epoc...
the-stack_106_29589
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from wolframclient.serializers import export from wolframclient.utils.api import PIL, numpy from wolframclient.utils.tests import TestCase as BaseTestCase from wolframclient.utils.tests import path_to_file_in_data_dir c...
the-stack_106_29591
# !usr/bin/env python # coding:utf-8 """ 房价预测 author: prucehuang email: 1756983926@qq.com date: 2018/12/15 """ import numpy as np import os import sys import pandas as pd import matplotlib.pyplot as plot from pandas.plotting import scatter_matrix from sklearn.preprocessing import LabelBinarizer from sklearn.preproc...
the-stack_106_29594
import ci.util import container.registry import container.util def filter_image_file( in_file:str, out_file:str, remove_files:[str]=[], ): ''' processes an OCI container image [0] (from a local tar file) and writes a modified copy to the specified `out_file`. All files (specified as absol...
the-stack_106_29597
''' Created on 02.05.2016 @author: lemmerfn ''' import itertools from functools import partial from heapq import heappush, heappop from collections.abc import Iterable import numpy as np import pandas as pd import pysubgroup as ps def add_if_required(result, sg, quality, task, check_for_duplicates=False, statistics...
the-stack_106_29598
import os import requests import json from flask import Flask, render_template, request from twilio.rest import Client app = Flask(__name__) account_sid = os.environ.get('account_sid') auth_token = os.environ.get('auth_token') my_number = os.environ.get('my_number') client = Client(account_sid, auth_token) @app.rou...
the-stack_106_29599
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM Corp. 2017 and later. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2....
the-stack_106_29603
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Copyright 2020 Ross Wightman # Modified Model definition import torch import torch.nn as nn from functools import partial import math import warnings import torch.nn.functional as F import numpy as np import torch.utils import torch.utils.check...
the-stack_106_29605
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020 # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivati...
the-stack_106_29606
######## #### setup.py: script to build and help development of the Vulnerability catalog. #### Date: 2018-02-18 #### Version: 1.0 #### Author: Daniel Avelino https://daavelino.github.io ######## import platform import sys import shutil import os import subprocess # import secrets # Will be imported after check if pyt...
the-stack_106_29607
from argparse import ArgumentParser from copy import deepcopy from typing import Any import pytorch_lightning as pl import torch import torch.nn.functional as F from pytorch_lightning import seed_everything from torch.optim import Adam from pl_bolts.callbacks.self_supervised import BYOLMAWeightUpdate from pl_bolts.mo...
the-stack_106_29609
SrvGroup = libstarpy._GetSrvGroup() Service = SrvGroup._GetService("","") #Create objects Obj=Service._New("TestClass"); #Define functions def Obj_PythonAdd(self,x,y) : print("Call python function..."); return x+y; Obj.PythonAdd = Obj_PythonAdd; #Call java functions def Obj_PythonPrint(self,x,y) : print...
the-stack_106_29611
# Copyright 2020. ThingsBoard # # # 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 ...
the-stack_106_29612
from enum import Enum from itertools import permutations from collections import defaultdict with open("input1.txt","r") as f: data = f.readlines() dataDict = {} for line in data: line=line.split("=>") line[0]=line[0].split(",") for value in line[0]: value = value.split(" ") for line in data...
the-stack_106_29613
# https://deeplearningcourses.com/c/support-vector-machines-in-python # https://www.udemy.com/support-vector-machines-in-python from __future__ import print_function, division from builtins import range # Note: you may need to update your version of future # sudo pip install -U future import numpy as np import pandas ...
the-stack_106_29615
import re import codecs import nltk import pymorphy2 s = ''' BEGIN:VCARD VERSION:2.1 N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=D0=A1=D0=B0=D0=BD=D1=82=D0=B5=D1=85=D0=BD=D0=B8=D0=BA;=D0=96=D0=B5=D0=BD=D1=8F;;; FN;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=D0=96=D0=B5=D0=BD=D1=8F=20=D0=A1=D0=B0=D0=BD=D1=82=D0=B5=D1=85=D0=...
the-stack_106_29616
from PyQt5 import Qt from PyQt5.QtWidgets import QDialog, QTabWidget, QVBoxLayout, QPushButton, QHBoxLayout, QWidget from PyQt5.QtCore import Qt from pyqt_transparent_timer.settingsDialog.timerSettingsWidget.timerSettingsWidget import TimerSettingsWidget class SettingsDialog(QDialog): def __init__(self): ...
the-stack_106_29618
import json import uuid import pytest from app.api.mines.mine.models.mine import Mine from app.api.permits.permit.models.permit import Permit from app.api.permits.permit_amendment.models.permit_amendment import PermitAmendment from app.extensions import db from tests.constants import DUMMY_USER_KWARGS @pytest.fixtur...
the-stack_106_29620
import os import sys from pathlib import Path from typing import Optional, Union, Tuple import sumo_rl if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) else: sys.exit("Please declare the environment variable 'SUMO_HOME'") import traci import sumolib...
the-stack_106_29621
from django.shortcuts import render,redirect from django.http import HttpResponse from .models import Signup1 from .models import Intern from django.contrib import messages from django.contrib.auth.decorators import login_required import tablib # Create your views here. @login_required def home(request): ...
the-stack_106_29623
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from aws import Action as BaseAction from aws import BaseARN service_name = 'AWS XRay' prefix = 'xray' class Action(BaseAction): def __init__(self, action=None): sup = super(Action, self) ...
the-stack_106_29626
#! /usr/bin/env python # Copyright (C) 2016, Michael F. Plass from __future__ import print_function A = 10 B = 11 C = 12 D = 13 E = 14 F = 15 class Assembly: inst = None cur = 0 passno = 0 changed = False symtab = None commenton = 0 comments = None def __init__(self): self.ins...
the-stack_106_29627
import json from pathlib import Path lines = Path('input').open().readlines() max_id = 0 seats = dict() for line in lines: row = int(line[:7].replace('B', '1').replace('F', '0'), 2) col = int(line[7:].replace('R', '1').replace('L', '0'), 2) seat_id = row * 8 + col if row not in seats: seats[...
the-stack_106_29628
from __future__ import print_function from six.moves import range import sys import shutil import numpy as np import os import random import time from PIL import Image from copy import deepcopy import torch.backends.cudnn as cudnn import torch import torch.nn as nn from torch.autograd import Variable ...
the-stack_106_29630
"""TODO(fquad): Add a description here.""" import json import os import datasets # TODO(fquad): BibTeX citation _CITATION = """\ @ARTICLE{2020arXiv200206071 author = {Martin, d'Hoffschmidt and Maxime, Vidal and Wacim, Belblidia and Tom, Brendlé}, title = "{FQuAD: French Question Answering D...
the-stack_106_29631
#!/usr/bin/env python3 # Copyright (2021-) Shahruk Hossain <shahruk10@gmail.com> # # 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...
the-stack_106_29633
# Copyright (c) 2017-2018 {Flair Inc.} WESLEY PENG # # 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 agre...
the-stack_106_29634
from __future__ import absolute_import, print_function from django.conf import settings CLIENT_ID = getattr(settings, 'OAUTH2_APP_ID', None) CLIENT_SECRET = getattr(settings, 'OAUTH2_API_SECRET', None) REQUIRE_VERIFIED_EMAIL = getattr(settings, 'OAUTH2_REQUIRE_VERIFIED_EMAIL', False) UNIQUE_USERID_FIELD = getattr(...
the-stack_106_29637
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd from sklearn.metrics import r2_score from quant_benchmark.model_train.models import skols, enet_model, lasso, ridge def _sklearn_train(X, y): lr = skols() ls = lasso() rr = ridge() en = enet_model(alpha=0.1, l1_ratio=0.7) # ...
the-stack_106_29638
import utils.data as du import tensorflow as tf from sequence_labeler import SequenceLabeler import configparser import numpy as np import random np.random.seed(1337) random.seed = 1337 def test(test_path, data_save_path, conf_path, model_save_path, model_name, embedding_path, out_file_path): ow = open(out_file_...
the-stack_106_29641
import os import sys print("Print running a script from a script", sys.argv[1]) import scribus if len(sys.argv) < 2 : print("Not enough argumemnts") else: if scribus.haveDoc(): filename = sys.argv[1] pdf = scribus.PDFfile() pdf.file = filename + ".pdf" pdf.save() else : ...
the-stack_106_29642
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # medallion documentation build configuration file, created by # sphinx-quickstart on Tue Nov 28 20:47:27 2017. # # 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 # ...
the-stack_106_29644
#!/usr/bin/env python3 """RAK811 balena.io demo. Minimalistic Balena / OTAA demo: send the CPU temperature every 5 minutes in Cayenne LPP format. Copyright 2019 Philippe Vanhaesendonck Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You...
the-stack_106_29645
GRAINS_EXPECTATIONS = { 'ubuntu1604': { 'os': 'Ubuntu', 'oscodename': 'xenial', 'os_family': 'Debian', 'osfullname': 'Ubuntu', 'osarch': 'amd64', 'osrelease': '16.04', 'osrelease_info': [16, 4], }, 'ubuntu1804': { 'os': 'Ubuntu', 'oscod...
the-stack_106_29647
from rest_framework import serializers from core.models import Tag, Ingridient, Recipe class TagSerializer(serializers.ModelSerializer): """Serializer for tag object""" class Meta: model = Tag fields = ('id', 'name') read_only_fields = ('id',) class IngridientSerializer(serializers....
the-stack_106_29648
# Copyright (C) 2013 Yahoo! 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 ...
the-stack_106_29649
""" A manager for multiple workers. -- kandasamy@cs.cmu.edu """ from __future__ import print_function from __future__ import division # pylint: disable=invalid-name # pylint: disable=abstract-class-not-used # pylint: disable=abstract-class-little-used from argparse import Namespace from multiprocessing import Pro...
the-stack_106_29651
# boudoir - decadence de la marotte # https://www.youtube.com/watch?v=EnVdmTRvllw # https://gist.github.com/jf-parent/17abfe962599eca3bdb2982fbef047c5 Scale.default = Scale.major Root.default = 0 Clock.bpm = 120 chords = [[0, 1], [(1, 2), (2, 3)]] Clock.stop() def main(): print('main') ~p1 >> sawbass(chords, ...
the-stack_106_29652
# Copyright 2013-2021 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.package import * class BigdftPsolver(AutotoolsPackage, CudaPackage): """BigDFT-Psolver: a flexible real-s...
the-stack_106_29653
#!/usr/bin/env python import os import warnings import open3d as o3 import matplotlib.pyplot as plt import numpy as np import progressbar import pyquaternion as pq import transforms3d as t3 import util import time T_w_o = np.identity(4) T_w_o[:3, :3] = [[0, 1, 0], [1, 0, 0], [0, 0, -1]] T_o_w = util.invert_ht(T_w_...
the-stack_106_29654
import uuid import requests import time import json import pandas as pd from lxml import etree import re import random positionName_list, salary_list, city_list,district_list, companyShortName_list, education_list,workYear_list ,industryField_list,financeStage_list,companySize_list,job_desc_list= [], [], [],[], [], [...
the-stack_106_29655
from direct.showbase.DirectObject import DirectObject from direct.showbase.TkGlobal import * from .Tree import * import Pmw #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- DEFAULT_BT_WIDTH = 50.0 #-----------------...
the-stack_106_29659
# dale from default.sets import InitialSetting from default.webdriver_utilities.pre_drivers import pgdas_driver from default.webdriver_utilities.wbs import WDShorcuts from default.interact import * from default.interact import _contmatic_select_by_name from selenium.webdriver.support import expected_conditions from se...
the-stack_106_29661
# coding=utf-8 # Copyright 2022 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...
the-stack_106_29662
from Modelo import sistema from Vista import Ventanappal from PyQt5.QtWidgets import QApplication import sys class Controlador(): def __init__(self, vista, modelo): self.__mivista= vista self.__mimodelo=modelo def mostrarimg(self,nimagen): return self.__mimodelo.most...
the-stack_106_29664
from decimal import Decimal from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField from django.contrib.gis.db.models.sql import AreaField from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import ( Area as AreaMeasure, Distance as DistanceMeasure, ) fr...
the-stack_106_29666
import logging import os.path import sys import datetime def initialize_logger(output_dir, stream_loglevel = logging.INFO, all_loglevel=logging.DEBUG): try: if not os.path.exists(output_dir): os.makedirs(output_dir) except: sys.exit("Error happened in create log folder:%s" % output_...
the-stack_106_29668
# coding: utf-8 # Modified Work: Copyright (c) 2018, 2022, 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...
the-stack_106_29672
""" sphinx.domains.std ~~~~~~~~~~~~~~~~~~ The standard domain. :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import unicodedata import warnings from copy import copy from typing import cast from docutils import nodes from d...
the-stack_106_29673
""" Test cases for the metadata reading/writing of pyslim. """ from __future__ import print_function from __future__ import division import pyslim import msprime import tests import unittest import random import json def get_msprime_examples(): demographic_events = [ msprime.MassMigration( time=5...
the-stack_106_29674
#!/bin/env python # -*- coding: utf-8 -*- ## # test_azure.py: Tests Azure Quantum functionality against a mock workspace. ## # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## ## IMPORTS ## import importlib import os import pytest import qsharp from qsharp.azure import AzureError, AzureJob, A...
the-stack_106_29676
import datetime import discord from discord import TextChannel, Message from discord.ext import commands import utils.json_loader class Modlog(commands.Cog): """Logging""" def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print(f"{self.__cla...
the-stack_106_29679
# -*- encoding: utf-8 -*- """ 构建参数列表以及根据value反向获取key方法 Author: zsyoung Date: 2019/01/09 15:00 """ from stationcrawl.Constants import STATION_DICT import datetime def build_all_list(): """ 构建参数列表 :return: [[出发日期,出发车站,到达车站]] 示例:[['2019-01-20','CUW','CQW'],['2019-01-20','CUW','CXW']] """ all_li...
the-stack_106_29680
from __future__ import absolute_import from setuptools import setup, find_packages from codecs import open with open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='pypsa', version='0.18.0', author='PyPSA Developers, see https://pypsa.readthedocs.io/en/latest/develop...
the-stack_106_29681
import ast import os import zipfile import subprocess import shutil from django.http import JsonResponse from .charts import newchart from .app import Gldas as App def getchart(request): data = ast.literal_eval(request.body.decode('utf-8')) data['instance_id'] = request.META['HTTP_COOKIE'].split('instance_i...