text
string
size
int64
token_count
int64
#DATOS DE ENTRADA ANIMAL= int(input("¿De cual animal quiere conocer la caracteristicas? 1.Leon 2.Ballena 3.Tucan? ")) class Animal: def __init__(self, ANIMAL): self.ANIMAL = ANIMAL def acciones_comun(): comun = "Comer" return comun def sentido_vista(): vista = ...
1,279
461
# Copyright 2020 OpenRCA 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 or agreed to in writi...
8,249
2,202
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Utilities to create/drop views. Based on a recipe published in: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Views """ from sqlalchemy.sql import table...
2,616
865
from django.db import models from datetime import datetime import string, random import uuid # Create your models here. class HeaderNavs(models.Model): title = models.CharField(max_length = 50) url = models.CharField(max_length = 50) def __str__(self): return self.title class Meta: ...
960
296
import colour import matplotlib.pyplot as plt import numpy as np COLOUR_STYLE = colour.plotting.colour_style() COLOUR_STYLE.update( { "figure.figsize": (11, 11), "legend.framealpha": colour.plotting.COLOUR_STYLE_CONSTANTS.opacity.low, } ) plt.style.use(COLOUR_STYLE) plt.style.use("dark_backgrou...
1,281
542
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'eugene' ''' MIT License Copyright (c) 2015 Eugene Grobbelaar (email : koh.jaen@yahoo.de) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to d...
40,090
12,611
""" Code adapted from Dan Krause. https://gist.github.com/dankrause/6000248 http://github.com/dankrause """ import socket from http.client import HTTPResponse from io import BytesIO ST_DIAL = 'urn:dial-multiscreen-org:service:dial:1' ST_ECP = 'roku:ecp' class _FakeSocket(BytesIO): def makefile(self, *args, **kw)...
1,744
631
import os, sys from argparse import ArgumentParser from datetime import datetime as dt from pprint import pprint as pp import shutil, glob #from pyfiglet import figlet_format, Figlet import datetime ''' python run_gem5_gl.py -a radix -l inst python run_gem5_gl.py -a radix -l bit ''' def app(args): if not a...
4,113
1,490
from onnxsim.onnx_simplifier import simplify __version__ = '0.0.0'
68
28
from quit import Quit from set_name import SetName from who import Who from say import Say from look import Look from go import Go from take import Take from inventory import Inventory from drop import Drop from make import Make from landfill import Landfill from item_info import ItemInfo from script import...
534
158
import Common import pandas as pd import numpy as np import matplotlib.pyplot as plt RATIO = 0.8 EPOCHS = 500 LEARN_RATE = 0.01 INDENTIFICATION_RATE = 0.6 # Read training data X_train, Y_train, X_test, Y_test,scale_train,scale_test = Common.process(RATIO) def preprocessing (X_train,Y_train ,X_test ,Y_test): X_tra...
2,141
928
import ctypes import os import time from pynput.keyboard import Key,Controller import Bing def closeTerminal(): keyboard=Controller() keyboard.press(Key.alt) keyboard.press(Key.f4) keyboard.release(Key.alt) keyboard.release(Key.f4) def changeWallpaper(image_path): start=time.time() end=ti...
1,343
436
# Import statements import subprocess from os import system # Variable declarations np = "10" cexe = "./Boids" nboids = "50" nloops = "500" k = "7" maxv = "10" acc = "1.25" width = "1000" height = "1000" sf1 = "1" sf2 = "32" min = "50" sf3 = "8" sf4 = "10" dataPath = "./data/" jexe = "BoidModelTest" ...
968
498
from flask_mail import Message from flask import render_template from flask_start.extensions import mail ''' from threading import Thread def send_async_email(app, msg): with app.app_context(): mail.send(msg) ''' def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject...
976
274
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from __future__ import division import os import numpy from io import BytesIO from matplotlib import pyplot import requests import torch from PIL import Image from maskrcnn_benchmark.config import cfg from predictor import COCODemo from maskrcnn...
7,784
3,000
"""Simple water flow example using ANUGA Water driven up a linear slope and time varying boundary, similar to a beach environment """ #------------------------------------------------------------------------------ # Import necessary modules #----------------------------------------------------------------------------...
5,211
1,540
from django.conf.urls import patterns, url from temperature import views urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^save_temp_reading$', views.save_temp_reading, name='save_temp_reading'), )
253
82
from amitools.binfmt.BinImage import * from .ELFFile import * from .ELF import * from .ELFReader import ELFReader from .DwarfDebugLine import DwarfDebugLine class BinFmtELF: """Handle Amiga m68k binaries in ELF format (usually from AROS)""" def is_image(self, path): """check if a given file is a supp...
5,767
1,780
import pyaudio import wave import matplotlib.pyplot as plt import numpy as np import matplotlib.pylab as plt from scipy.io import wavfile import cmath as cm from scipy.fftpack import fft from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter fro...
11,532
4,505
from bs4 import BeautifulSoup import requests from communityFeedback import * from time import sleep from rich.progress import track import json page = [ 'https://www.allsides.com/media-bias/media-bias-ratings', ] def table(full_table): # The main table print('Web scraper is parsing the table!') for...
2,994
906
""" File: commands/calc.py Purpose: Performs calculations in response to user input, and outputs the result """ from sys import argv import click from calculator import * from models import History from models.Config import Config from help_menus import calc_help @click.group("calc", invoke_without_command=True) @...
1,068
325
from aot import * from aot.model.trigger import * from aot.model.condition import * from aot.model.effect import * from aot.meta_triggers.metatrigger import MetaTrigger from aot.model.enums.resource import EnumResource from aot.model.enums.player import PlayerEnum from aot.model.enums.unit import UnitConstant, UnitType...
3,271
1,028
"""LS-Dyna license server interface.""" import typing from lm_agent.config import settings from lm_agent.exceptions import LicenseManagerBadServerOutput from lm_agent.parsing import lsdyna from lm_agent.server_interfaces.license_server_interface import LicenseReportItem, LicenseServerInterface from lm_agent.server_int...
2,625
698
#!/usr/bin/env python3 # Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. import argparse import os import pickle import shutil import numpy as np import PIL.Image import tensorflow as tf from tensorflow.contrib.tensorboard.plugins import projector TB_DIR = os.path.join(os.getcwd(), "gan-tb") SPRITE_IMA...
2,634
894
major = 1 minor = 4 patch = 5
30
17
from datetime import date now = date.today() print('The date today is', now, now.strftime("%A"))
97
31
from pyxtal.molecule import * from ase.build import molecule from pymatgen.core import Molecule def get_ase_mol(molname): """convert ase molecule to pymatgen style""" ase_mol = molecule(molname) pos = ase_mol.get_positions() symbols = ase_mol.get_chemical_symbols() return Molecule(symbols, pos) ...
4,613
1,388
from manimlib.imports import * """ TODO: [ ] fix arrow head size auto scale according to size? have a default size, but, if the arrow size is too short, then shrink the head [ ] slide the point according to the gradient """ class ParaboloidPlot(SpecialThreeDScene): CONFIG = { "three_d_axes_config": { "num_...
2,650
1,266
import tvm import sys import time import numpy as np from tvm.tensor_graph.testing.models import resnet from tvm.tensor_graph.core import ForwardGraph, BackwardGraph, compute, \ GraphTensor, GraphOp, PyTIRGraph from tvm.tensor_graph.nn import CELoss, SGD from tvm.tensor_graph.core.schedul...
13,056
4,829
from time import sleep import xpc def ex(): print("X-Plane Connect example script") print("Setting up simulation") with xpc.XPlaneConnect() as client: # Verify connection try: # If X-Plane does not respond to the request, a timeout error # will be raised. ...
2,300
797
import datetime import logging import os import re from collections import OrderedDict from html import escape from html.parser import HTMLParser from io import StringIO import docutils import docutils.core import docutils.io from docutils.parsers.rst.languages import get_language as get_docutils_lang from docutils.wr...
27,419
7,571
import torch import torch.nn as nn import torch.nn.functional as F from xmuda.models.DDR import Bottleneck3D from xmuda.models.LMSCNet import SegmentationHead, ASPP import numpy as np from xmuda.models.modules import Process, Upsample, Downsample import math from xmuda.data.utils.preprocess import create_voxel_position...
4,017
1,572
# coding: utf-8 from __future__ import division, print_function # Standard library import time # Third-party import matplotlib.pyplot as plt import numpy as np from scipy.misc import derivative from astropy.extern.six.moves import cPickle as pickle import pytest # Project from ..io import load from ..core import C...
10,511
3,656
# -*- coding: utf-8 -*- from argparse import ArgumentParser import json import time import pandas as pd import tensorflow as tf import numpy as np import math from decimal import Decimal import matplotlib.pyplot as plt from agents.ornstein_uhlenbeck import OrnsteinUhlenbeckActionNoise eps=10e-8 epochs=0...
9,677
3,300
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: oesteban # @Date: 2016-03-16 11:28:27 # @Last Modified by: oesteban # @Last Modified time: 2016-04-04 13:50:50 """ Batch export freesurfer results to animated gifs """ from __future__ import absolute_import from __future__ import division from __future__ im...
7,365
2,652
import os import sqlite3 as sq3 import cx_Oracle as ora import pandas as pd import psycopg2 as ps2 import mysql.connector as mysql import sqlalchemy # Reponsabilidades desta classe: # Apenas se conectar a uma das bases de dados abaixo especificadas # Bases conhecidas: SQLITE, ORACLE, MYSQL, POSTGRES class DATABASE: ...
10,751
2,974
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import PermissionRequiredMixin from django.views.generic import ( ListView, DetailView, CreateView, UpdateView, DeleteView, ) from django.shortcuts import render from django.db.models import Count from django.d...
3,301
1,068
import sys from typing import Generator from typing import List from typing import Optional import pytest from _pytest.pytester import Pytester def test_one_dir_pythonpath(pytester: Pytester, file_structure) -> None: pytester.makefile(".ini", pytest="[pytest]\npythonpath=sub\n") result = pytester.runpytest("...
1,992
668
#!/usr/bin/env python2 import paho.mqtt.client as mqtt import time import Adafruit_DHT from configparser import ConfigParser import json config = ConfigParser(delimiters=('=', )) config.read('config.ini') sensor_type = config['sensor'].get('type', 'dht22').lower() if sensor_type == 'dht22': sensor = Adafruit_DH...
1,735
606
"""This module contains utility functions for the Mythril support package.""" from typing import Dict class Singleton(type): """A metaclass type implementing the singleton pattern.""" _instances = {} # type: Dict def __call__(cls, *args, **kwargs): """Delegate the call to an existing resource o...
663
190
import unittest import mplisp.evaluator as evaluator class TestListMap(unittest.TestCase): def map_test(self): input1 = """ (map (lambda (x) (* 2 x)) (list 1 2 3)) """ output1 = list(evaluator.evaluate(input1)) self.assertEqual(output1[0], [2, 4, 6]) def map_test_2(...
554
212
import argparse from __init__ import insert_code def main(): parser = argparse.ArgumentParser(description="Inject code into pickle files") parser.add_argument("pickle_file", help="The pickle file to inject code into") parser.add_argument("code_file", help="The shell script to inject") #parser.add_argu...
1,210
408
from django.core.cache.backends.base import DEFAULT_TIMEOUT from django_redis.cache import RedisCache as PlainRedisCache from redis_lock import Lock from redis_lock import reset_all class RedisCache(PlainRedisCache): @property def __client(self): try: return self.client.get_client() ...
1,923
543
import torch import torch.nn as nn from torch.nn import functional as F from torchvision.models.utils import load_state_dict_from_url from nets.inception_resnetv1 import InceptionResnetV1 from nets.mobilenet import MobileNetV1 class mobilenet(nn.Module): def __init__(self, pretrained): super(mobilenet, s...
3,510
1,285
# Generated by Django 2.1.7 on 2019-03-08 20:55 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('posts', '0002_auto_20190221_0234'), ] operations = [ migrations.RenameField( model_name='post', old_name='visiblilty', ...
367
137
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'URLMinify', fields ['short_url'] db.dele...
2,260
743
import FWCore.ParameterSet.Config as cms process = cms.Process("h4ValidData") # initialize MessageLogger process.load("FWCore.MessageLogger.MessageLogger_cfi") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring...
1,182
444
import asyncio from query_graphql import query_artifact_domains, query_weapon_materials_book class Domains: leylines = { "Blossom of Revelation": "Character EXP Materials", "Blossom of Wealth": "Mora" } weapon_domains = {} talent_domains = {} artifact_domains = {} trounce_doma...
1,948
660
""" -- Policy Network for decision making [more general] """ from nmt_uni import * from layers import _p import os import time, datetime import cPickle as pkl # hyper params TINY = 1e-7 PI = numpy.pi E = numpy.e A = 0.2 B = 1 class Controller(object): def __init__(self, trng, option...
23,644
7,151
from app.drivers.pycolator import base from app.actions.pycolator import splitmerge as preparation from app.readers import pycolator as readers from app.drivers.options import pycolator_options class SplitDriver(base.PycolatorDriver): outfile = None def run(self): self.set_filter_types() for ...
3,637
1,069
""" Entradas: lectura actual--->float--->lect2 lectura anterior--->float--->lect1 valor kw--->float--->valorkw Salidas: consumo--->float--->consumo total factura-->flotante--->total """ lect2 = float ( entrada ( "Digite lectura real:" )) lect1 = float ( entrada ( "Digite lectura anterior:" )) valorkw = float ( input ( ...
453
165
# __author__ = 'Dave' import cv2 from skimage import io from skimage.transform import probabilistic_hough_line import matplotlib.pyplot as plt import os import warnings import random import numpy as np warnings.filterwarnings('ignore', category=RuntimeWarning) class CorrectImage(object): def __init__(self): ...
4,955
1,534
""" This code is used for plotting induvidual timelines of seasonal CC for each CMIP5 and CMIP6 model """ import matplotlib.pyplot as plt import xarray as xr import numpy as np import seaborn as sns import pandas as pd #=== Import SEB Anomalies ==== #from seasonal_SEB_components import * ACCESS = xr.open_dataset('/p...
2,469
1,273
# manage.py import unittest from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from skeleton.server import app, db from skeleton.server.models import User migrate = Migrate(app, db) manager = Manager(app) # migrations manager.add_command('db', MigrateCommand) @manager.command def...
1,059
348
import sigauth.middleware import sigauth.helpers from client import helpers class SignatureCheckMiddleware(sigauth.middleware.SignatureCheckMiddlewareBase): secret = None def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.request_checker = helpers.RequestSignatureChe...
610
174
import os import subprocess import errno import shutil import re import sys kernel_path = '' install_path = '' patch_rules = [] arch = '' def mkdir_p(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: ...
3,867
1,305
# -*- coding: utf-8 -*- # @Time : 2021/9/18 下午11:19 # @Author : DaiPuWei # @Email : 771830171@qq.com # @File : loss.py # @Software: PyCharm """ 这是YOLO模型的损失函数的定义脚本,目前目标分类损失支持smooth Label; 目标定位损失支持均方差损失、GIOU Loss、DIOU Loss和CIOU Loss; """ import math import tensorflow as tf from tensorflow.keras import ...
18,912
8,010
import asyncio import tempfile from decimal import Decimal import os from contextlib import contextmanager from collections import defaultdict import logging import concurrent from concurrent import futures import unittest from typing import Iterable, NamedTuple, Tuple, List, Dict from aiorpcx import TaskGroup, timeou...
59,405
19,838
data = input() courses = {} while ":" in data: student_name, id, course_name = data.split(":") if course_name not in courses: courses[course_name] = {} courses[course_name][id] = student_name data = input() searched_course = data searched_course_name_as_list = searched_course.split("_") se...
533
178
from cytoolz.functoolz import ( curry, ) from eth_utils import ( to_dict, to_tuple, ) @curry @to_dict def normalize_dict(value, normalizers): for key, item in value.items(): normalizer = normalizers[key] yield key, normalizer(item) @curry @to_tuple def normalize_array(value, normali...
637
213
import cv2 ''' 基本圖像處理用 ''' # 取得圖像 行 列 通道數 def get_image_properties(image): total = [image.shape, image.size, image.dtype] return total def get_image_shape(image): return image.shape # 取得 圖片大小 def get_image_size(image): return image.size # 取得圖片類型 def get_image_type(image): return image.dtype...
1,030
431
#!/usr/bin/env python """Virtual filesystem module based on pyfsntfs.""" import stat from typing import Any, Callable, Dict, Iterable, Optional, Text, Type import pyfsntfs from grr_response_client import client_utils from grr_response_client.vfs_handlers import base as vfs_base from grr_response_core.lib import rdfv...
9,124
2,996
from encapsulation_04.exe.pizza_maker.project.dough import Dough from encapsulation_04.exe.pizza_maker.project.pizza import Pizza from encapsulation_04.exe.pizza_maker.project.topping import Topping tomato_topping = Topping("Tomato", 60) print(tomato_topping.topping_type) print(tomato_topping.weight) mushrooms_toppin...
1,184
509
""" cat9k IOS-XE connection implementation. """ __author__ = "Rob Trotter <rlt@cisco.com>" from unicon.plugins.iosxe import ( IosXESingleRpConnection, IosXEDualRPConnection, IosXEServiceList, HAIosXEServiceList) from .statemachine import IosXECat9kSingleRpStateMachine, IosXECat9kDualRpStateMachine fr...
1,158
432
# -*- coding: utf-8 -*- from lxml import html from time import sleep from datetime import datetime import requests import os import sqlite3 import sys # No terminal usar ~: python ludopedia.py [idIni] [regs] # por ex. ~: python ludopedia.py 451 3000 con = sqlite3.connect('ludopedia.db') cursor = con.cursor() cursor....
4,875
2,210
import cv2 import numpy as np import os import torch import torch.nn as nn import torch.nn.functional as F def to_cpu(tensor): return tensor.detach().cpu() def xywh2xyxy(x): ''' Convert bounding box from [x, y, w, h] to [x1, y1, x2, y2] :param x: bounding boxes array :return: Converted bounding box array '...
18,334
8,045
import torch.nn as nn import torch.optim as optim from ltr.dataset import Lasot, TrackingNet, MSCOCOSeq, Got10k from ltr.data import processing, sampler, LTRLoader import ltr.models.bbreg.atom as atom_models from ltr import actors from ltr.trainers import LTRTrainer import ltr.data.transforms as tfm def run(settings)...
5,557
1,698
nums = list() while True: nStr = input('Enter a number: ') try: if nStr == 'done': break n = float(nStr) nums.append(n) except: print('Invalid input') continue print('Maximum: ',max(nums)) print('Minimum: ',min(nums))
281
94
""" Activity list window """ import tkinter import tkinter.ttk from model import activity, invoice from model.activity import Activity from model.company import Company from gui.activity import ActivityWindow from gui.activity_split import ActivitySplit from gui.invoice import InvoiceWindow from gui.popup_file import p...
5,899
1,781
import os import shutil import unittest from base64 import b64encode from sonLib.bioio import TestStatus from sonLib.bioio import getTempFile from sonLib.bioio import getTempDirectory from sonLib.bioio import system from toil.job import Job from toil.common import Toil from cactus.shared.common import cactus_call, Chi...
3,551
1,077
import sys import numpy as np import openpnm as op from tqdm import tqdm import scipy.ndimage as spim from porespy.tools import extend_slice import openpnm.models.geometry as op_gm def regions_to_network(im, dt=None, voxel_size=1): r""" Analyzes an image that has been partitioned into pore regions and extract...
7,185
2,825
import itertools from datetime import datetime from numpy import nan import numpy as np from pandas.core.common import _possibly_downcast_to_dtype, isnull from pandas.core.index import Index, MultiIndex, _ensure_index, _handle_legacy_indexes from pandas.core.indexing import _check_slice_bounds, _maybe_convert_indices...
67,560
20,522
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ve...
4,919
1,400
""" Example of usage of the AVB framework to infer a single exponential decay model. This uses the Python classes directly to infer the parameters for a single instance of noisy data constructed as a Numpy array. """ import sys import logging import numpy as np from vaby_avb import Avb import vaby # Uncomment line ...
2,076
781
from dialog_api.users_pb2 import RequestLoadFullUsers, ResponseLoadFullUsers, FullUser class Users: def LoadFullUsers(self, request: RequestLoadFullUsers) -> ResponseLoadFullUsers: return ResponseLoadFullUsers(full_users=[FullUser(id=1, contact_info=[], about=None)])
282
81
import json class TrainingSpecification: template = """ { "TrainingSpecification": { "TrainingImage": "IMAGE_REPLACE_ME", "SupportedHyperParameters": [ { "Description": "Grow a tree with max_leaf_nodes in best-first fashion. Best nodes are defined as relative reduction in impu...
3,965
1,254
#Python's random module includes a function choice(data) that returns a #random element from a non-empty sequence. The random modul includes a #more basic function randrange,with parameterization similar to the #built-in range function , that return a random choice from the given #range.Using only the randrange func...
483
137
#!/usr/bin/env python3 """Tables: data: pk timestamp field_name field_value source_record We don't know what type each value will have, so have a column for int, float, str and bool and leave all but the appropriate value type NULL. Docs claim that NULL values take no space, so... Still so many ways we could make ...
10,093
3,061
# ============================================================================= # Inicialización de la aplicación: __init__.py # ============================================================================= """ Este archivo tendrá la función de crear la aplicación, que iniciará la base de datos y registrará los molo...
10,204
1,198
from store.cifar10 import Cifar10 import torchvision.transforms as transforms import time import matplotlib.pyplot as plt batch_size = 1 rel_sample_size = 10000 ds = Cifar10(input_data_folder="/home/aarati/datasets/cifar-10-batches-py", \ max_batches=2, batch_size=batch_size, rel_sample_size=rel_sample_size, \ ...
1,822
999
"""Plugin that invokes the built-in template renderer.""" __all__ = [ "RenderOptions", "render", ] from typing import Dict, List from pydantic import BaseModel from beet import Context, configurable class RenderOptions(BaseModel): resource_pack: Dict[str, List[str]] = {} data_pack: Dict[str, Lis...
1,095
312
import sys import tkinter from .customtkinter_tk import CTk from .customtkinter_frame import CTkFrame from .appearance_mode_tracker import AppearanceModeTracker from .customtkinter_color_manager import CTkColorManager class CTkProgressBar(tkinter.Frame): """ tkinter custom progressbar, always horizontal, values ...
15,269
4,234
import pytest from backtest.strategy import BuyAndHoldEqualAllocation @pytest.fixture def strategy(): symbols = ('AAPL', 'GOOG') strategy = BuyAndHoldEqualAllocation(relevant_symbols=symbols) return strategy def test_strategy_execute(strategy): strategy.execute() assert len(strategy.holdings) > 0...
694
289
# SPDX-License-Identifier: Apache-2.0 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import onnx from ..base import Base from . import expect class Constant(Base): @staticmethod def exp...
853
253
#!/usr/bin/python # -*- coding: utf-8 -*- """ Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from .NVD3Chart import NVD...
4,337
1,555
""" Date: 2021/09/23 Target: config utilities for yml file. implementation adapted from Slimmable: https://github.com/JiahuiYu/slimmable_networks.git """ import os import yaml class LoaderMeta(type): """ Constructor for supporting `!include`. """ def __new__(mcs, __name__, __bases__, __dict__): ...
4,114
1,191
from marshmallow import Schema, fields, validate from sqlalchemy import Column, String, Integer, Float, Date, ForeignKey from sqlalchemy.orm import relationship from ..funders.entities import Funder, FunderSchema from src.api import db from src.shared.entity import Base class Funding(Base, db.Model): __tablename...
2,798
1,023
### # Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-utility/blob/master/LICENSE.md ### """ Commit Command for RDMC """ import sys from optparse import OptionPars...
2,817
795
from django.conf import settings from django.contrib.auth.decorators import user_passes_test from django.core.paginator import Paginator from django.core.urlresolvers import reverse from django.http import Http404, HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response from django.template i...
16,721
5,424
# to run this, add code from experiments_HSCC2021.py def time_series_pulse(): path = Path(__file__).parent.parent / "data" / "real_data" / "datasets" / "basic_data" filename1 = path / "pulse1-1.csv" filename2 = path / "pulse1-2.csv" filename3 = path / "pulse1-3.csv" f1 = load_time_series(filename1,...
937
379
# -*- coding: utf-8 -*- # # Copyright 2014 Red Hat, 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...
13,813
3,902
import numpy as np import matplotlib.pyplot as plt #grid number on half space (without the origin) N=150 #total grid number = 2*N + 1 (with origin) N_g=2*N+1 #finite barrier potential value = 300 (meV) potential_value=300 #building potential: def potential(potential_value): V=np.zeros((1,N_g),dtype=float) V[0...
2,037
957
from .BaseSVDD import BaseSVDD
30
10
import setuptools import glob import os required = [ "requests", "pandas", "arrow", "socketIO-client-nexus" ] setuptools.setup(name='iex-api-python', version="0.0.5", description='Fetch data from the IEX API', long_description=open('README.md').read()...
739
208
import os import click import logging from pathlib import Path from dotenv import find_dotenv, load_dotenv from keras.callbacks import ModelCheckpoint, EarlyStopping import src.utils.utils as ut import src.utils.model_utils as mu import src.models.model as md import src.models.data_generator as dg import src.data.da...
3,825
1,071
""" MIT License Copyright (c) 2020 Shantanu Ghosh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish...
3,412
1,329
# Copyright (c) 2016-2019. Mount Sinai School of Medicine # # 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 ...
15,182
4,416
# OS-Level Imports import os import sys import multiprocessing from multiprocessing import cpu_count # Library Imports import tensorflow as tf from tensorflow.keras import mixed_precision from tensorflow.python.distribute.distribute_lib import Strategy # Internal Imports from Utils.enums import Environme...
8,244
2,466
from power_audit import PowerAudit def main(): local = PowerAudit() local.full_audit() if __name__ == '__main__': main()
136
52
from turbo.flux import Mutation, register, dispatch, register_dispatch import mutation_types @register_dispatch('user', mutation_types.INCREASE) def increase(rank): pass def decrease(rank): return dispatch('user', mutation_types.DECREASE, rank)
258
80