text
stringlengths
2
999k
# Copyright 2016 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...
print(2*5)
from app.models.review import Review from .db import db class Spot(db.Model): __tablename__ = 'spots' id = db.Column(db.Integer, primary_key=True) userId = db.Column(db.Integer, db.ForeignKey("users.id"), nullable=False) address = db.Column(db.String(255), nullable=False) city = db.Column(db.Strin...
__author__ = 'scott'
#coding=utf-8 from django.conf.urls import patterns, url, include from cmdb.views import ip_record urlpatterns = patterns('', url(r'^$', ip_record.list_ip_record, name='ip_record_index'), url(r'add/$', ip_record.add_ip_record, name='add_ip_record'), url(r'del/(?P<ip_record_id>\d+)/$', ip_record.del_ip_...
### MPO Drone Delivery Config ### env = {"name": "drone_delivery_mlagent", "time_scale": 12.0} agent = { "name": "mpo", "actor": "continuous_policy", "critic": "continuous_q_network", "critic_loss_type": "1step_TD", # one of ['1step_TD', 'retrace'] "gamma": 0.99, "buffer_size": 50000, "ba...
from django.shortcuts import render from mobility.decorators import mobile_template from kitsune.products.models import Product from kitsune.sumo.decorators import ssl_required from kitsune.wiki.decorators import check_simple_wiki_locale @check_simple_wiki_locale def home(request): """The home page.""" retu...
#!/usr/bin/env python import json import logging import pymysql def main(): """ Add system modules. Please run 'build_datastructure.py' before. """ with open("secret.json") as f: mysql = json.load(f) sys_modules = get_system_modules() connection = pymysql.connect(host=mysql['host'], ...
import rigorwebapp.plugin class DocsPlugin(rigorwebapp.plugin.BasePlugin): def __init__(self, backend, config): kConfigParam = ("webapp", "documentation_root") self.plugin_enabled = True if kConfigParam in config: self.documentation_root = config.get(kConfigParam[0], kConfigParam[1]) else: self.plugin_e...
''' Description: Exercise 8 (Tkinter GUI) Version: 1.0.2.20210124 Author: Arvin Zhao Date: 2021-01-18 21:27:18 Last Editors: Arvin Zhao LastEditTime: 2021-01-24 18:03:49 ''' from tkinter import Tk, Label, Entry, Button, Listbox from tkinter.constants import END class Home: ''' The home window. ''' d...
# pylint: disable=redefined-outer-name import os import tempfile import pytest from config import TestConfig from todo_list.app import create_app, db @pytest.fixture(scope='session') def app(): db_fd, database_file = tempfile.mkstemp() TestConfig.SQLALCHEMY_DATABASE_URI = f'sqlite:///{database_file}' a...
import FWCore.ParameterSet.Config as cms etaRangeCaloJetSelector = cms.EDFilter( "EtaRangeCaloJetSelector", src = cms.InputTag("hltCaloJetL1FastJetCorrected"), etaMin = cms.double( -99.9 ), #2.4 etaMax = cms.double( +99.9 ), #2.4 )
from models import * from helpers import * import create_world player = session.query(Player).first() def make_move(player, move_id, prev_id): # get current move move = session.query(Move).filter_by(id=move_id).first() # check move status if not check_move_status(player, move): # check access if check_acc...
import ttkbootstrap as ttk from ttkbootstrap.constants import * from ttkbootstrap import utility class ToolTip: """A semi-transparent tooltip popup window that shows text when the mouse is hovering over the widget and closes when the mouse is no longer hovering over the widget. Clicking a mouse button wil...
# Copyright 2022 Cisco Systems, Inc. and its affiliates # # 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...
import re class Slides_Slide_Navegator(): ##! ##! Sandwich contents between upper and lower navigator menu (identical). ##! def Slide_Cell_Navigator_Menues(self,paths,contents): nav_menu=self.Slide_Cell_Navigator_Menu(paths) return nav_menu+[contents]+nav_menu ##! ...
import asyncio import logging import discord from io import BytesIO from redbot.core import checks, commands from redbot.core.utils.chat_formatting import box, pagify from typing import TYPE_CHECKING from tsutils.cog_settings import CogSettings from tsutils.formatting import contains_ja logger = logging.getLogger(...
import torch.nn as nn import config as c # custom weights initialization called on netG and netD # based on Neff et al. 2017 parameters def weights_init(model): classname = model.__class__.__name__ if classname.find('Conv') != -1: mean = 0.0 std = 0.05 nn.init.normal_(model.weight.dat...
#!/usr/bin/python import sys import datetime as dt from dpaygo.amount import Amount from dpaygo.utils import parse_time, formatTimeString, addTzInfo from dpaygo.instance import set_shared_dpay_instance from dpaygo import DPay from dpaygo.snapshot import AccountSnapshot import matplotlib as mpl # mpl.use('Agg') # mpl.us...
from app.api.v2.managers.base_api_manager import BaseApiManager class StubDataService: def __init__(self): self.ram = {} def test_dump(data_svc, agent): test_agent = agent(sleep_min=2, sleep_max=5, watchdog=0) dumped_agent = test_agent.schema.dump(test_agent) manager = BaseApiManager(data_s...
"""LOOP STATE MACHINES A 'loop state machine' has a core state machine that loops on incoming lexatoms 'i' as long as they fall into the set 'L' which it treats. The first lexatom that does NOT fit 'L' causes an exit from the loop, as shown below. .--<-( next i...
from os.path import join, dirname import boto3 from dotenv import load_dotenv class Lex(object): def __init__(self, credential_path): dotenv_path = join(dirname(__file__), credential_path) load_dotenv(dotenv_path) self.client = boto3.client('lex-runtime', ...
# -*- coding: utf-8 -*- """ Created on Wed Jun 6 13:03:57 2018 @author: kosterse """ import json from horseModuleCore.horse_communication import HorseMessageClient import datetime import horseModuleCore from horseModuleCore.horse_module import HorseWorkerModule from collections import deque class AR...
""" aws-cspm-benchmark.py Assists with provisioning calculations by retrieving a count of all billable resources attached to an AWS account. Author: Joshua Hiller @ CrowdStrike Creation date: 03.23.21 """ import boto3 # pylint: disable=E0401 from tabulate import tabulate # pylint: disable=E0401 ...
import logging import threading import queue from collections import namedtuple from types import FunctionType from typing import ( Mapping, Any, Optional, TypeVar, Generic, Tuple, Union, Callable, Iterator, ) from happyly.utils import generator_check from happyly.exceptions import ...
from p5 import * from walker import Walker w = Walker() def setup(): size(800, 200) frameRate(30) def draw(): background(255); w.walk() w.display() run()
import glob from copy import deepcopy import networkx as nx import numpy as np import pandapower as pp import pandapower.networks import pandapower.topology import pandas as pd from pandapower.converter.matpower.to_mpc import _ppc2mpc from pandapower.converter.powermodels.to_pm import convert_pp_to_pm from pandapower....
# FUNCTION - CALL XFOIL AND GET AIRFOIL DATA # Written by: JoshTheEngineer # YouTube : www.youtube.com/joshtheengineer # Website : www.joshtheengineer.com # Started : 02/17/20 - Transferred from MATLAB to Python # - Works as expected # # PUROSE # - Create or load airfoil based on flag...
import torch import torch.nn.functional as F from torch import nn from torch import Tensor # from .utils import load_state_dict_from_url from typing import Callable, Any, Optional, List import torchvision # 导入arcface from loss.arcface import ArcMarginProduct,AddMarginProduct,SphereProduct # 导入center loss from loss.ce...
from .src import nocode
"""Script for the streamlabs chatbot to select a random Overwatch hero. It can select from all heroes, from a specific class or from favourites.""" # pylint: disable=invalid-name import os import re import json import codecs import datetime # pylint: disable=invalid-name ScriptName = "Random Hero Selector - Overwatc...
"""Faça um programa que tenha uma função chamada ficha(), que receba dois parâmetros opcionais: o nome de um jogador e quantos gols ele marcou. O programa deverá ser capaz de mostrar a ficha do jogador, mesmo que algum dado não tenha sido informado corretamente.""" def ficha(nome='', gols=''): if nome == '' or no...
import datetime from django.views import generic from django.db.models import get_model, Q from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from oscar.views.generic import BulkEditMixin from oscar.apps.dashboard.reviews i...
from django.conf.urls import include, url from django.urls import path from accounts import views, views_profile app_name = 'accounts' passwordpatterns = [ url(r'^forgot-password/confirm/(?P<uidb64>[A-Z]+)/(?P<token>\w+\-\w+)$', views.UnauthenticatedPasswordResetView.as_view(), name='reset'), ...
# Generated by Django 2.1.dev20180125184051 on 2018-01-31 07:26 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Article', fields=[ ('id', m...
from django.test import TestCase from .factories import EncodeProfileFactory class EncodeProfileTests(TestCase): """ Test the EncodeProfile model. """ def setUp(self): self.profile = EncodeProfileFactory() def test_shell_command(self): cmd = self.profile.shell_command('/dir/from...
#!/usr/bin/python #Written by CHAOYI HUANG in Python 3.7.0 from socket import * msg = "\r\n I love computer networks!" endmsg = "\r\n.\r\n" # Choose a mail server (e.g. Google mail server) and call it mailserver mailserver = '192.168.3.68' #the internal IP address of an internal SMTP server # Create socke...
"""empty message Revision ID: 61949ea5a5ac Revises: Create Date: 2020-02-20 13:38:00.065226 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '61949ea5a5ac' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
#!/usr/bin/python3 import sys sys.path.extend(('lib', 'db')) from kleros import db, Dispute, Round, Vote, Config, Court, JurorStake, Deposit, Juror eth_price = float(Config.get('eth_price')) round_price = round(eth_price, 2) total_ETH = Deposit.total() round_eth = round(total_ETH, 2) total_USD = total_ETH * eth_pric...
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2015 Caian Benedicto <caian@ggaunicamp.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...
# Import modules from subprocess import Popen from ctypes.wintypes import DWORD from ctypes import byref, c_bool, windll # Puts the computer to sleep def Hibernate(): Popen('shutdown -h /f', shell=True) # Turns off the computer def Shutdown(): Popen('shutdown -s /t 0 /f', shell=True) # Restarts computer def...
from abc import ABC, abstractmethod from collections import Iterator, OrderedDict from functools import reduce import os import math import torch from torch.utils.data import ( Dataset, ConcatDataset, Subset, DataLoader, RandomSampler, ) from torch.utils.data.dataloader import default_collate import...
# The opposite of casting. See lightbus.utilities.casting from collections import OrderedDict from datetime import datetime, date from decimal import Decimal from enum import Enum from uuid import UUID from base64 import b64encode from lightbus.exceptions import DeformError from lightbus.utilities.frozendict import fr...
"""128. Longest Consecutive Sequence https://leetcode.com/problems/longest-consecutive-sequence/ Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. Follow up: Could you implement the O(n) solution? Example 1: Input: nums = [100,4,200,1,3,2] Output: 4 Explanatio...
#!/usr/bin/python import time from duckiebot_driver.serial_interface import DuckietownSerial from duckiebot_driver.message import DuckietownCommand, DuckietownStatus def test_blink(duck): cmd = DuckietownCommand() status = DuckietownStatus() for i in range(20): cmd.led = not cmd.led cmd.pw...
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
# -*- coding:utf-8 -*- import math import torch import torch.nn as nn import torch.nn.functional as F class BertLM(nn.Module): def __init__(self, bert, n_hidden, vocab_size): super().__init__() self.bert = bert self.mask_lm = nn.Linear(n_hidden, vocab_size) def forwar...
import os from concurrent.futures import ThreadPoolExecutor from copy import deepcopy from dataclasses import dataclass from functools import partial from pathlib import Path from typing import ( Any, Callable, Hashable, Iterator, List, Mapping, MutableMapping, MutableSequence, Optio...
# -*- coding: utf-8 -*- class MacroRuntime(object): # nodejs 6.10 node610 = "nodejs6.10" cmd_node610 = "node" # nodejs 8.9 node89 = "nodejs8.9" cmd_node89 = "node" # nodejs 8.9 -service node89_s = "nodejs8.9-service" cmd_node89_s = "node" # python3.6 python36 = "python3....
from django.shortcuts import render,redirect import datetime as dt from django.http import HttpResponse,Http404 from .models import Image def welcome(request): images=Image.objects.all() return render(request,'welcome.html',{"images":images}) def search_results(request): if 'image' in request.GET...
from contextlib import contextmanager import os from tempfile import NamedTemporaryFile @contextmanager def temporary_file(suffix=""): """Yield a writable temporary filename that is deleted on context exit. Parameters ---------- suffix : string, optional The suffix for the file. Examples ...
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from ossec import OssecCollector class TestOssecCollector(CollectorTestCase): def setUp(self, allowed_names=None): if...
#!/usr/bin/env python # -*- coding: latin-1; -*- ''' Copyright 2018 University of Liège 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 req...
"""Users URLs.""" # Django from django.urls import path from django.views.generic import TemplateView # View from users import views urlpatterns = [ # Management path( route='login/', view=views.LoginView.as_view(), name='login' ), path( route = 'logout/', v...
""" Copyright 2018 Waller Lab The University of California, Berkeley 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 the ...
#!/usr/bin/env python # Copyright 2013 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. """Wrapper script for launching application within the sel_ldr. """ import optparse import os import subprocess import sys import cre...
# # # from __future__ import absolute_import, division, print_function, \ unicode_literals from dyn.tm.errors import DynectGetError from dyn.tm.services.dsf import DSFResponsePool from json import loads from mock import MagicMock, call, patch from unittest import TestCase from octodns.record import Create, Delet...
import torch from torch.nn import ( Conv2d,BatchNorm2d,MaxPool2d,#AvgPool2d, ConvTranspose2d,Upsample, Linear,LayerNorm, Module, ) import os import random from .config import config from typing import Union,Tuple class ResBlock2d(torch.nn.Module): def __init__( self,in_channels:int,out_ch...
# -*- test-case-name: twisted.internet.test.test_endpoints -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces. This also implements an exten...
# coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ShowPolicyRequest: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key ...
# Generated by Django 3.1.7 on 2021-04-19 07:56 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('website', '0007_auto_20210329_1156'), ] operations = [ migrations.AddField( model_name='station...
version = '0.2.0.dev-b9bd653' short_version = '0.2.0'
#!/usr/bin/env python '''Script to output a chunk of JSON showing CN state. This should be run as a cron job on CNs, every 5 min or so. It needs to be privileged to determine service statuses. TODO: Replace most of this with psutil https://pythonhosted.org/psutil/ Run as d1_service_status.py - to get outout...
# MINLP written by GAMS Convert at 04/21/18 13:54:54 # # Equation counts # Total E G L N X C B # 31 1 0 30 0 0 0 0 # # Variable counts # x b i s1s s2s sc ...
from fastapi import APIRouter from uaber.models import Driver from uaber.services import driver as driver_service router = APIRouter( prefix='/drivers', tags=['status'], responses={404: {'description': 'Not found'}} ) @router.get('/') async def get_drivers(): return await driver_service.find_drivers...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import pytest import itertools import numpy as np import pandas as pd from reco_utils.common.constants import PREDICTION_COL from reco_utils.recommender.sar.sar_singlenode import SARSingleNode from reco_utils.recommender.sar ...
# -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2010, 2021. All Rights Reserved. # pragma pylint: disable=unused-argument, no-self-use """ Functions accessing Resilient """ import logging import re import resilient from resilient_circuits import ResilientComponent from resilient import SimpleHTTPException from fn_aw...
import torch from ignite.contrib.metrics.regression._base import _BaseRegression from ignite.exceptions import NotComputableError class GeometricMeanAbsoluteError(_BaseRegression): r""" Calculates the Geometric Mean Absolute Error. :math:`\text{GMAE} = \exp(\frac{1}{n}\sum_{j=1}^n\ln(|A_j - P_j|))` ...
from collections import defaultdict import itertools import math from typing import Dict, List, Iterable, Set, Tuple, Union from talon import Module, Context, actions, imgui, Module, registry, ui, app from talon.grammar import Phrase from itertools import islice mod = Module() mod.list("help_contexts", desc="list of...
# -*- coding: utf-8 -*- """ Keys with leading underscore are our custom provider-specific data. """ from authomatic.providers import oauth2, oauth1, openid, gaeopenid import authomatic import copy DEFAULT_MESSAGE = 'Have you got a bandage?' SECRET = '##########' DEFAULTS = { 'popup': True, } A...
from __future__ import division, print_function import os import genapi from genapi import \ TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi import numpy_api # use annotated api when running under cpychecker h_template = r""" #if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_AR...
# ======================== # Information # ======================== # Direct Link: https://www.hackerrank.com/challenges/s10-the-central-limit-theorem-3/problem # Difficulty: Easy # Max Score: 30 # Language: Python # ======================== # Solution # ======================== import math SAMPLE = 1...
import requests, json #Buscar estudiantes por ID url = 'http://school.labs.com.es/api/students/' #Ingresar el ID con input id_ = input("Digame el ID: ") data = None headers = { 'Content-Type' : 'application/json' } response = requests.get(url + str(id_)) if (response.status_code == 200): data = response.json() ...
""" Copyright (c) 2013 Digital District ---------------------------------------------------- Nose tests for Node class authors: sylvain delhomme <sylvain.delhomme@digital-district.ca> """ from pyGuerilla import Document, Node, Camera, toLua from nose.tools import raises class TestNode(object): @classmethod def s...
# Generated by Django 2.2.10 on 2021-08-12 08:14 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mindapp', '0071_auto_20210811_1952'), ] operations = [ migrations.AlterField( model_name='play...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------- # AppConfig configuration made easy. Look inside private/appconfig.ini # Auth is for authenticaiton and access control # ------------------------------------------------------------------------- from gluon.contrib.appco...
try: from django.conf.urls import patterns, url except ImportError: from django.conf.urls.defaults import patterns, url from admin_utils import make_admin_class make_admin_class("Test1", patterns("test_app.views", url(r'^$', 'root', name='test_app_test1_changelist'), url(r'^level1/$', 'level1', name='l...
import gunicorn gunicorn.SERVER_SOFTWARE = "MetaCI"
# Generated by Django 2.1.7 on 2019-05-15 20:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("users", "0005_profile")] operations = [ migrations.AlterField( model_name="user", name="is_active", field=models.Bool...
# mostrais quais numeros são primos numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 7...
from __future__ import unicode_literals import unittest import mock import pykka from mopidy.core import Core from mopidy.utils import versioning class CoreActorTest(unittest.TestCase): def setUp(self): self.backend1 = mock.Mock() self.backend1.uri_schemes.get.return_value = ['dummy1'] ...
# Generated by Django 2.2.1 on 2019-07-08 09:23 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('shoppinglist', '0024_auto_20190707_1127'), ] operations = [ migrations.AlterField( ...
# -*- coding: utf-8 -*- """Asherah Server gRPC - Python client A simple Python application that demonstrates integrating with Asherah Server via a generated gRPC client. """ import argparse import asyncio import logging import queue import random import signal import string import sys from types import FrameType, Tr...
# -*- coding: utf-8 -*- import json import os import api_controller import rest def get_api_controller(): bucket_name = os.environ.get("BUCKET_NAME") region_name = os.environ.get("REGION_NAME") return api_controller.ApiController(bucket_name, region_name) def format_response(status_code, content_type,...
#!/usr/bin/env python3.6 import dask.dataframe as dd import pandas as pd import sys import pickle from sklearn.model_selection import train_test_split def dataFrameNames(): return [ "x1", # 1 gamma detected x position [cm] "y1", # 1 gamma detected y position [cm] "z1", # 1 gamm...
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process from utils import...
"""Assets."""
# -*- coding: utf-8 -*- """rackio/dbmodels.py This module implements classes for modelling the trending process. """ from datetime import datetime, date from io import BytesIO from peewee import Proxy, Model, CharField, TextField, DateField, DateTimeField from peewee import IntegerField, FloatField, BlobField, Forei...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# sweep_plotting.py # # This file is part of scqubits: a Python package for superconducting qubits, # arXiv:2107.08552 (2021). https://arxiv.org/abs/2107.08552 # # Copyright (c) 2019 and later, Jens Koch and Peter Groszkowski # All rights reserved. # # This source code is licensed under the BSD-style license f...
# Defining imports import cv2 import video as vid import thresholding as thresh import person as p print(cv2.__version__) # Defining video paths lengthsVideoPath = "../media/video/edited/lengths.avi" lengthsVideoPath2 = "../media/video/edited/lengths2.avi" splashingVideoPath = "../media/video/edited/splashing.avi" co...
import tensorflow as tf import numpy as np class VariableData: def __init__(self): self.name = None self.shape = None self.values = None class ModelLoader: def __init__(self, folder_path): """ :param folder_path: string """ self.folder_path = fold...
# 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 ...
# -*- coding:utf-8 -*- # # Copyright 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
#!/bin/env python import os import pandas as pd import pybedtools as bedtools # configuration output = snakemake.output[0] chrom_file = snakemake.params["chrom_file"] sample=snakemake.wildcards["sample"] consensus_peaks = bedtools.BedTool(snakemake.input[0]) consensus_peaks_df = bedtools.BedTool(snakemake.input[0])....
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'qt\configuredialog.ui' # # Created: Thu Dec 13 13:25:16 2018 # by: pyside-uic 0.2.15 running on PySide 1.2.4 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_ConfigureDialog(object): ...
import fileinput info = { "children": "3", "cats": "7", "samoyeds": "2", "pomeranians": "3", "akitas": "0", "vizslas": "0", "goldfish": "5", "trees": "3", "cars": "2", "perfumes": "1" } winner = 0 for line in fileinput.input()...
from translate import translate print("Welcome in word reference\n") while(True): word = raw_input("Enter a word or press X for exit: ") if word == "X" or word == "x": break elif type(word) != str: continue else: result = translate(word) if type(result) == str: ...
import enum import json from server.handler_base import AbstractHandlerBase # This code is deprecated in new futures. def encode(amfs: any) -> str: return json.JSONEncoder().encode(amfs) def write(handler, code: int, txt: str, content_type: str = "application/json") -> None: handler.send_response(code) ...
################################################################################ # Define package composition ################################################################################ __all__ = ["gcloud"] #__all__ = ["security", "datastore"] # ZX: There's a better way to do this; see other source code from el...