text stringlengths 3.07k 22.1k |
|---|
import numpy as np
import cv2
import matplotlib.pyplot as plt
#%matplotlib inline
#from __future__ import print_function
import keras
from keras.models import Sequential, Model
from keras import optimizers
from keras.layers import Dense, Conv2D, MaxPooling2D, Dropout, Flatten, ZeroPadding2D, Convolution2D
from... |
'''
Classes related to displaying stuff in terminal console via curses
'''
import curses
from _curses import A_NORMAL, A_REVERSE, A_BOLD
from exactly.hitline import HitLineLayout
from . import get_logger
from exactly.safestring import LimitedSafeString
class ExactlyView(object):
'''
The view is supposed to ma... |
import time
import torch
import torch.nn as nn
from torchvision import transforms as T
import numpy as np
from PIL import Image
#from turbojpeg import TurboJPEG, TJPF, TJSAMP
from turbojpeg import TurboJPEG #VLAD edited this
from urllib.request import urlopen
import matplotlib.pyplot as plt
import cv2
from IPython.core... |
"""Support for Dyson Pure Cool link fan.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/fan.dyson/
"""
import asyncio
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.dyson impor... |
# 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 u... |
from notescribe import settings, UPLOAD_FOLDER, WAV_FOLDER, MIDI_FOLDER, LILYPOND_FOLDER, IMAGES_FOLDER, PDF_FOLDER, JSON_FOLDER
from notescribe.s3_upload import upload_file, get_url
from notescribe.ml import wavfile2midifile
from pydub import AudioSegment
import subprocess
import os.path
import os
import json
import h... |
# Name : <NAME>
# Student ID: 1001551132
# Date : 09/28/2020
import sys, random, math, numpy as np
def sigmoid(x):
try:
return 1 / (1 + math.exp(-x))
except:
print("Oops: Sigmoid Failed!")
return 0
def convertToOneHotVectors(data):
# The following code maps class l... |
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from django.utils import timezone
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import Gener... |
from time import gmtime, strftime, sleep
import logging, gensim
import pandas as pd
import numpy as np
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Pango, Gio
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title='Simple Word2Vec')
self.se... |
# -*- coding: utf-8 -*-
import copy
from datetime import timedelta
import json
import os.path
import time
from elastalert.util import dt_to_ts
from elastalert.util import EAException
from elastalert.util import elastalert_logger
from elastalert.util import hashable
from elastalert.util import lookup_es_key
from elasta... |
#!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import re
import shutil
from glob import glob
from invoke import task
from invoke.util import log
#------------------------------------------------------------------------------
slurp = lambda fname : [(f.read(), f.close()) for f in... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#### mk_microannot.py
#### made by <NAME>
#### 2019-12-17 12:44:18
#########################
import sys
import os
SVRNAME = os.uname()[1]
if "MBI" in SVRNAME.upper():
sys_path="/Users/pcaso/bin/python_lib"
elif SVRNAME == "T7":
sys_path="/ms1/bin/python_lib"
else:
... |
#!/usr/bin/python
"""
* JZEN Virtual Machine in Python
* Limitation: assignment to variables need to be done by jsen_assign()
*
* Copyright (c) Honda Research Institute Europe GmbH
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the followin... |
'''
Layers for NN-models (forward+backward pass).
Written by <NAME> (https://github.com/SLotAbr).
BSD License
'''
# from multiprocessing import Process
import numpy as np
import pickle
from tools.functions import string_softmax
from tools.optimizers import AdaM as AdaM
class token_embedding:
def __init__(self, vocab... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
from pandas.api.types import CategoricalDtype
from sklearn.model_selection import train_test_split
pd.set_option('display.max_columns', 500)
pd.set_option('display.max_colwidth', -1)
pd.set_op... |
import os, math, itertools
from statistics import mean
from argparse import ArgumentParser, Namespace
from typing import List, Callable, Dict, Tuple
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
from torch.nn.modules.lo... |
#******************************************************************************
# (C) 2018, <NAME>, Austria *
# *
# The Space Python Library is free software; you can redistribute it and/or *
# modif... |
# implementation of a NN class as exposed in M. Nielsen tutorial:
# Neural Networks and Deep Learning
# emphasis:
# - implementation of backpropagation algorithm
# - activation function
# - cost function
# - hyper-parameters tuning
# tools
import random
import numpy as np
# reproducibility
np.random.seed(123) # seed ... |
#
# peepdf is a tool to analyse and modify PDF files
# http://peepdf.eternal-todo.com
# By <NAME> <jesparza AT eternal-todo.com>
#
# Copyright (C) 2011-2017 <NAME>
#
# This file is part of peepdf.
#
# peepdf is free software: you can redistribute it and/or modify
# it under the terms of the... |
from __future__ import print_function
import sys
import imaplib
import getpass
import email
import email.header
import datetime
import os
import json
import csv
import hone
import ast
import pymongo
import gspread
import uuid
import smtplib
from apiclient import discovery
from httplib2 import Http
from oauth2client im... |
# encoding: utf-8
"""
Methods to compute dissimilarity matrices (DSMs).
"""
import numpy as np
from scipy.spatial import distance
from mne.utils import logger
from .folds import _create_folds
from .searchlight import searchlight
def compute_dsm(data, metric='correlation', **kwargs):
"""Compute a dissimilarity m... |
import typing as t
from .config import Config
import multiprocessing as mp
from tqdm import tqdm
from .neo4j_publisher import Neo4jPublisher
import os
import sys
import math
from pathlib import Path
import pandas as pd
from dataPipelines.gc_neo4j_publisher import wiki_utils as wu
import json
def only_write_infobox(c... |
"""Traffic Light Grid example."""
from flow.core.params import SumoParams, EnvParams, InitialConfig, NetParams, \
InFlows, SumoCarFollowingParams
from flow.core.params import VehicleParams
from flow.core.params import TrafficLightParams, SumoLaneChangeParams
from flow.controllers import SimCarFollowingController, G... |
"""
Simulation module for the Lidars. Creates fake ROS publications that
match the publications made by a Lidar driver.
"""
import rospy
import numpy as np
from copy import deepcopy
from math import cos, sin, sqrt, radians
from threading import Thread
from multiprocessing import Pool
from sensor_msgs.msg import Laser... |
# helper.py
# Copyright (C) 2008, 2009 <NAME> (<EMAIL>) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from __future__ import print_function
import os
import sys
from unittest import TestCase
import time
import tempfile
i... |
""" Pricing Controller Module """
__docformat__ = "numpy"
import argparse
import difflib
from typing import List, Union
import pandas as pd
from tabulate import tabulate
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.helper_funcs impo... |
# -*- coding: utf-8 -*-
import logging
import os
from typing import Union
import yaml
from bson import DBRef
from marshmallow.exceptions import ValidationError as SchemaValidationError
from mongoengine.connection import get_db
from mongoengine.errors import (
DoesNotExist,
FieldDoesNotExist,
InvalidDocumen... |
import logging
import telegram
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils.translation import activate
from telegram import ParseMode, Update
from telegram.error import BadRequest, ChatMigrated, NetworkError, TelegramError, Timed... |
import os
import sys
import base64
import yaml
import tensorflow as tf
from docopt import docopt
from mayo.log import log
from mayo.config import Config
from mayo.session import Test, Evaluate, Train, Search, Profile
_root = os.path.dirname(__file__)
def _vigenere(key, string, decode=False):
if decode:
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import pandas as pd
# =============================================================================
# VARS
# Output reports
#CITY_OUT = "data/city_permits/processed/city_res{}.csv"
OUTPUT_NAME = "data/{year}/{name}_processed.csv"
# com_report = "com{... |
import os
import random
import networkx as nx
import numpy as np
from gensim.models import Word2Vec
from libcity.data.dataset import TrafficStatePointDataset
class Graph():
def __init__(self, nx_G, is_directed, p, q):
self.G = nx_G
self.is_directed = is_directed
self.p = p
self.q... |
import os
import logging
from notion.client import NotionClient
import numpy as np
import pandas as pd
import yfinance as yf
from datetime import datetime
import matplotlib.pyplot as plt
import seaborn as sns
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from telegram import ParseMode, Repl... |
# Copyright 2018, Erlang Solutions Ltd, and S2HC Sweden 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 law... |
#!/usr/bin/env python3
import stepwise
import appcli
import autoprop
import textwrap
from inform import plural
from fractions import Fraction
from operator import not_
from appcli import Key, DocoptConfig
from stepwise import StepwiseConfig, PresetConfig, pl, ul, pre
from stepwise_mol_bio import Main
def by_solvent(o... |
# Copyright (c) 2018 <NAME> at the University of Rochester
# This file is part of the Hoomd-Tensorflow plugin developed by <NAME>
import tensorflow as tf
import numpy as np
from os import path
import pickle
import hoomd
## \internal
# \brief load the TensorFlow variables from a checkpoint
#
# Adds variables from mod... |
import asyncio
import logging
import os
import rustsgxgen
from .base import Module
from ..nodes import SGXNode
from .. import tools
from .. import glob
from ..crypto import Encryption
from ..dumpers import *
from ..loaders import *
from ..manager import get_manager
from ..descriptor import DescriptorType
# Apps
ATTE... |
# Copyright (c) 2011-2020, <NAME>
# License: MIT License
import pytest
from ezdxf.lldxf.const import VTX_3D_POLYLINE_VERTEX
from ezdxf import DXFIndexError
from ezdxf.layouts import VirtualLayout
@pytest.fixture
def msp():
return VirtualLayout()
def test_create_polyline2D(msp):
polyline = msp.add_polyline2... |
from esper.prelude import *
from esper.stdlib import *
from sklearn import metrics
gender_names = {g.id: g.name for g in Gender.objects.all()}
gender_ids = {v: k for k, v in list(gender_names.items())}
def bootstrap(pred_statistic, pred_sample, true_statistic, true_sample, k=500, trials=10000):
def invert(l):
... |
#!/usr/bin/env python
"""
Functions for writing PolyChord-format output files given a nested sampling run
dictionary stored in the nestcheck format.
"""
import copy
import functools
import os
import numpy as np
import nestcheck.estimators as e
import nestcheck.error_analysis
import nestcheck.ns_run_utils
def write_r... |
from __future__ import division
from builtins import bytes
from threading import Thread
import sys
import socket
import struct
from binascii import crc32
from time import time
class Message(list):
Types = dict(version=bytes([0x00, 0x00, 0x10, 0x00]),
ports=bytes([0x01, 0x00, 0x10, 0x00]),
... |
from django.conf import settings
from django.utils import timezone
from django.db.models import (
Model,
CASCADE,
SET_NULL,
CharField,
BooleanField,
DateTimeField,
ForeignKey,
ManyToManyField,
FloatField,
QuerySet,
TextField,
DateField,
PositiveIntegerField,
Q,
)
... |
# Copyright (c) 2020, The InferLO authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 - see LICENSE file.
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
import numpy as np
from networkx.algorithms.approximation.treewidth import (treewid... |
from __future__ import print_function
from collections import OrderedDict
import sys
import json
from datetime import datetime
from .perlconv import schemaconv
class ResultSet(object):
filter = [], {}
def __init__(self, schema, name, select_columns=None, dict_record=False):
self.schema = schema
self.entity... |
import jax
from jax import jit, grad, tree_flatten
from jax._src.api import make_jaxpr
from jax.core import DropVar, jaxpr_as_fun, gensym
import jax.numpy as jnp
import numpy as np
import alpa
from alpa.pipeline_parallel.manual_layer_slicing import manual_layer_slicing
from alpa.pipeline_parallel.computation import (
... |
# Transcrypt runtime module
# __pragma__ ('js', 'export var __envir__ = {{}};\n{}', __include__ ('org/transcrypt/__envir__.js'))
# __pragma__ ('js', '{}', __include__ ('org/transcrypt/__core__.js'))
# __pragma__ ('js', '{}', __include__ ('org/transcrypt/__builtin__.js'))
# __pragma__ ('skip')
copy = Math = __typeof__... |
# Standard Libraries
import time
import sys
import numpy as np
import signal
# Pytentiostat function files
from pytentiostat.plotter import plot_initializer, plot_updater
import pytentiostat.config_reader as cr
Interrupt = False
Exp_running = False
def _signal_handler(signum, frame):
"""
... |
import logging
import re
import typing
import discord
import discord.errors
from discord.ext import commands
from modmail.bot import ModmailBot
from modmail.log import ModmailLogger
from modmail.utils import responses
from modmail.utils.cogs import BotModes, ExtMetadata, ModmailCog
from modmail.utils.extensions impor... |
"""
Functions to apply the fitting in an MCMC manner.
"""
import numpy as np
from tqdm import tqdm
from .profiles import free_params
# -- MCMC Functions -- #
def lnprior(params, priors):
"""Log-prior function."""
lnp = 0.0
for param, prior in zip(params, priors):
lnp += parse_prior(param, prior)... |
import os
import pickle
import random
import statistics
import sys
from datetime import datetime
import click
import numpy as np
from tensorflow import logging
from tensorflow.python.keras.callbacks import EarlyStopping
from tensorflow.python.keras.models import load_model
from tensorflow.python.keras.optimizers impor... |
# -*- coding: utf-8 -*-
"""Collection of functions for the manipulation of time series."""
from __future__ import absolute_import, division, print_function
import warnings
from typing import List
import mando
import pandas as pd
import typic
from mando.rst_text_formatter import RSTHelpFormatter
from .. import tsuti... |
import os
import subprocess
import os
import shlex
#CPU'S List
ISOLCPU_LIST = "4,5,6,7,48,49,50,51"
#Various Grubs
grubs = { "/mnt/etc/default/grub.ucf-dist",
"/mnt/etc/default/grub",
"/mnt/etc/default/grub.d/50-curtin-settings.cfg"
}
DOCUMENTATION = '''
module: grubconf
version_added: ... |
'''
Created on May 16, 2018
@author: kjnether
'''
# Add these imports at the top
from rest_framework.test import APIClient
from rest_framework import status
from django.core.urlresolvers import reverse
from django.test import TestCase
from api.models.ReplicationJobs import ReplicationJobs
from api.models.... |
from pwd import getpwnam
from grp import getgrnam
import logging
import os.path
from typing import Union # noqa
from typing import List, Optional, Any, Dict, NewType, Tuple
import datetime
import pytz
import strictyaml
from strictyaml import Optional as Opt, EmptyDict
from strictyaml import (
Bool,
EmptyNone,... |
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from sqlalchemy import Table
from sqlalchemy.dialects.postgresql import ARRAY, UUID
from sqlalchemy.orm.collections import attribute_mapped_collection
db = SQLAlchemy()
migrate = Migrate()
class Developer(db.Model):
__tablename__ = "develo... |
import io
import os
import datetime
import posixpath
try:
import six
from six.moves.urllib_parse import urljoin
except:
pass
import urllib.parse
import logging
from django.core.files.base import File
from django.utils.encoding import force_text, force_bytes, filepath_to_uri
from django.core.files.storage ... |
from json import JSONEncoder, dump
import requests
from bs4 import BeautifulSoup
BASE_URI = 'https://www.felixcloutier.com/x86/'
SUPPORTED_CATEGORIES = ['Core Instructions']
class Instruction:
opcode: str
instruction: str
operand_encoding: str
available_64: bool
available_legacy: bool
descr... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
BOX_IDX_X = 0
BOX_IDX_Y = 1
BOX_IDX_W = 2
BOX_IDX_H = 3
BOX_IDX_CONFIDENCE = 4
BOX_IDX_CLASS_START = 5
class YoloLoss(object):
def __init__(self,
grid_size=13,
nb_class=1,
a... |
'''OpenGL extension ARB.framebuffer_object
This module customises the behaviour of the
OpenGL.raw.GL.ARB.framebuffer_object to provide a more
Python-friendly API
Overview (from the spec)
ARB_framebuffer_object is an extension intended to address the following
goals:
- Reflect FBO-related functionality found ... |
#! /usr/bin/env python
'''
python3 -m unittest tests.consensusSeqTest
in CIAlign folder
'''
import unittest
from unittest import mock
from mock import patch
from parameterized import parameterized, parameterized_class
import sys
import logging
import numpy as np
from Bio import AlignIO
import os
from os import path
... |
'''
MIT License
Copyright (c) 2021 Qualichat
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, dis... |
# -*- coding: utf-8 -*-
import cutter
import json
import CutterBindings
import collections
from . import capa_constants, util
import sys, os
from .model import CapaExplorerDataModel
from .view import CapaExplorerQtreeView
from .proxy import CapaExplorerRangeProxyModel, CapaExplorerSearchProxyModel
from PySide2.QtCore... |
# Copyright (c) 2019, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the fo... |
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... |
from typing import Tuple
import numpy as np
import sklearn
import sklearn.utils.multiclass
import sklearn.linear_model
from sklearn.preprocessing import StandardScaler
def diag_indices_with_offset(p, offset):
idxdiag = np.diag_indices(p)
idxdiag_with_offset = list()
idxdiag_with_offset.append(np.array([i... |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
Project-wide :pep:`484`- and :pep:`585`-compliant **dual type hint utilities**
(i.e., callables generically applicable to both :pep... |
from jinja2 import Environment, FileSystemLoader, select_autoescape
import yaml
import os
import sys
import argparse
import glob
import shutil
# generate_csv creates __init__.py file which helps python to find the corresponding module
def generate_init(init_path):
init_path = init_path + '/' + '__init__.py'
o... |
# -*- coding: utf-8 -*-
#
# DWaveNetworkX documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 26 10:55:26 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
# autogenerated file.... |
"""
Max-p regions algorithm
Source: <NAME>, <NAME>, and <NAME> (2020) "Efficient
regionalization for spatially explicit neighborhood delineation." International
Journal of Geographical Information Science. Accepted 2020-04-12.
"""
from ..BaseClass import BaseSpOptHeuristicSolver
from .base import (w_to_g, mo... |
import os
from typing import Union
import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset
from torchvision import transforms
from particle.utils.log import setLogger
from particle.utils.config import parseConfig, constructOneLayer
from particle.utils.dirty import loadNnData, project
from p... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import tkinter as tk
from tkinter import ttk
def point_on_line_check(la, lb, p):
if np.array_equal(la, lb):
print('There is no line. Two end points are the same!')
return False
ap = p - la # v... |
import pygame
import neat
import time
import os
import random
pygame.font.init()
GEN = 0
WIN_WIDTH = 500
WIN_HEIGHT = 800
# load images and makes them 2 times bigger using scale2x
BIRD_IMGS = [pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'bird1.png'))),
pygame.transform.scale2x(pygame.... |
import numpy as np
import sys
sys.path.append('../')
from scipy.io import savemat
import os
import matplotlib.pyplot as plt
import scipy
from skimage.measure import compare_ssim
def removeFEOversampling(src):
""" Remove Frequency Encoding (FE) oversampling.
This is implemented such that they match with th... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from .utils import modal_assurance_criterion
__all__ = ["StabilizationDiagram", ]
class ModePicker(object):
"""Class to pick modes (poles) from stabilization diagrams in matplotlib.
The class alters the marker size of the picked arti... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 10 14:27:10 2021
@author: <NAME> from the Bioimaging Facility of the John Innes Centre.
"""
# Imports the necessary libraries.
from ncempy.io import dm
import numpy as np
import matplotlib.pyplot as plt
from skimage import filters, morphology, segmentation, me... |
import tensorflow as tf
import os
import joblib
import numpy as np
from mpi4py import MPI
from baselines.common.vec_env.vec_frame_stack import VecFrameStack
# from coinrun.config import Config
from coinrun.config_dqn import Config
from coinrun import setup_utils, wrappers
import platform
import gym
class Scalarize:... |
# This callback plugin will:
# 1) create a logfile (/var/log/ansible/<uuid>.log) for the entire run
# 2) log audit information to that file in JSON-format
#
# For available settings, see CallbackModule below
import os
import tempfile
import errno
import datetime
import socket
import json
import uuid
import re
im... |
import base64
import json
import numpy as np
import os, sys
import pandas as pd
from PIL import Image
import streamlit as st
# Checkpoint for XGBoost
xgboost_installed = False
try:
import xgboost
from xgboost import XGBClassifier
xgboost_installed = True
except ModuleNotFoundError:
pass
# Object for d... |
from django.conf import settings
import subprocess,sys,shlex
import os,traceback
import logging
from JobErrorCode import JobErrorCode
from datetime import datetime
logger = logging.getLogger(__name__)
def presubmit(job):
# - should catch errors that occur during execution
if job.preprocess is not None:
... |
# --------------------------------------------------------
# Written by <NAME> at 10:50 AM 5/9/2020
# --------------------------------------------------------
from torch import nn
from utils.utils import *
class ProposalTargetCreator:
def __init__(self,
n_sample=128,
pos_iou_t... |
import warnings
from typing import Optional, Tuple, Any, Literal
from pandas.core.dtypes.common import is_numeric_dtype
from statsmodels.api import stats
from statsmodels.formula.api import ols
import numpy as np
import pandas as pd
import scipy.stats as sp
import seaborn as sns
import matplotlib.pyplot as plt
__all_... |
import requests
import re
import json
import asyncio
import urllib3
import os
import shutil
import click
import subprocess
import time
import math
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver import Chrome
from selenium.webdriver import ChromeOptions
from selenium.webdriver.commo... |
# Copyright (c) 2017, <NAME> [coldfusion]
#
# 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... |
# coding=utf-8
# Copyright 2019 The SEED 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 agre... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class ProjectCreateSalesOrder(models.TransientModel):
_name = 'project.create.sale.order'
_description = "Create SO from project"
... |
try:
import trimesh
TRIMESH = True
except ImportError:
TRIMESH = False
try:
from vedo import trimesh2vedo, Lines, Sphere
VEDO = True
except ImportError:
VEDO = False
import numpy as np
try:
import plotly.graph_objects as go
PLOTLY = True
except ImportError:
PLOTLY = False
from vtk ... |
from troposphere import Ref, GetAtt
from troposphere.ec2 import VPC, RouteTable, Route, InternetGateway, NatGateway, \
EIP, Subnet, SubnetRouteTableAssociation, VPCGatewayAttachment, VPCPeeringConnection
from troposphere.rds import DBSubnetGroup
import troposphere.elasticloadbalancing as elb
import troposphere.elastic... |
# Author of Aqsa: <NAME>
from django.contrib.auth.mixins import LoginRequiredMixin
from aqsa_apps import mixins as mix
from django.views.generic.edit import FormView
from . import forms as f
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse_lazy
from . import models as m
from djang... |
#!/usr/bin/env python3
"""
This software was sourced from Just-Some-Bots/MusicBot
https://github.com/Just-Some-Bots
The MIT License
Copyright (c) 2015-2019 Just-Some-Bots (https://github.com/Just-Some-Bots)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated ... |
# -*- coding: utf-8 -*-
import sys
import os
import glob
import errno
import struct
from contextlib import contextmanager
import collections
__all__ = ("INITCPUINFO getCPUSet parseCpuinfo findCpuinfo expandCpuinfo "
"parseRange strRange CPUBase NehalemCPU UnknownCPU "
"getCPUClass".split())
INI... |
import asyncio
from typing import Callable, Dict, List, Tuple
import numpy
from fragile.core.env import Environment as CoreEnv
from fragile.core.states import StatesEnv, StatesModel
from fragile.core.utils import split_args_in_chunks, split_kwargs_in_chunks, StateDict
from fragile.distributed.ray import ray
# The ty... |
''' Return the total cost '''
def fun_function(n_items, cost_per_item, discount_percent, discount_threshold):
''' Calculate the cost '''
cost = n_items * cost_per_item # line 1
if n_items > discount_threshold: # line 2
cost = cost * (1 - discount_percent / 100)... |
"""A module for TurbidityCurrent2D to produce a grid object from a geotiff
file or from scratch.
codeauthor: : <NAME>
"""
from landlab import RasterModelGrid
import numpy as np
from osgeo import gdal, gdalconst
from scipy.ndimage import median_filter
from landlab import FieldError
def create_topography(
l... |
# small demo for sinogram TOF OS-MLEM
import os
import matplotlib.pyplot as plt
import pyparallelproj as ppp
from pyparallelproj.phantoms import ellipse2d_phantom, brain2d_phantom
from pyparallelproj.models import pet_fwd_model, pet_back_model
from scipy.ndimage import gaussian_filter
import numpy as np
import argpar... |
'''
Created on Jul 20, 2012
@author: Chris
'''
import core.event_manager as event_manager
import pygame
from core.event_manager import Event
import core.options as options
from util.tools import Rect, inside
from button import Button, Toggle, ToggleGroup
from label import Label
import render.image as image
import rend... |
import tensorflow as tf
def single_cell(mode, keep_prob, hidden_size):
if mode == 'train':
keep_prob_ = keep_prob
else:
keep_prob_ = 1.0
cell = tf.nn.rnn_cell.BasicLSTMCell(hidden_size)
cell = tf.nn.rnn_cell.DropoutWrapper(cell, input_keep_prob=keep_prob_)
return cell
... |
"""Suite Window classes: Classes representing windows
Level 1, version 1
Generated from /System/Library/CoreServices/Finder.app
AETE/AEUT resource version 0/144, language 0, script 0
"""
import aetools
import MacOS
_code = 'fndr'
class Window_classes_Events:
pass
class Finder_window(aetools.ComponentItem):
... |
'''
This module provides a base class that can be used to perform EMA on
Excel models. It relies on `win32com <http://python.net/crew/mhammond/win32/Downloads.html>`_
'''
from __future__ import (absolute_import, print_function, division,
unicode_literals)
import os
try:
import win32com.c... |
#!/usr/bin/env python3
import os
import argparse
from multiprocessing import Pool
import pandas as pd
import json
import rasterio
from rasterio.merge import merge
from rasterio.warp import calculate_default_transform, reproject, Resampling
import shutil
import csv
from utils.shared_variables import PREP_PROJECTION,VIZ... |
"""Test routines for the mask_centroid_heuristic functions."""
# Copyright (c) 2022, ABB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with
# or without modification, are permitted provided that
# the following conditions are met:
#
# * Redistributions of source code must retain the
#... |
# -*- coding: utf-8 -*-
import os
from typing import Optional, Any, Dict, Tuple, Iterable, List, Mapping, Text
from inspect import iscoroutinefunction
from copy import deepcopy
from aiohttp.web_urldispatcher import DynamicResource
from recc.compile.future import get_annotations_compiler_flag
from recc.typing.annotatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.