text stringlengths 3.07k 22.1k |
|---|
import os
import json
import cv2
import numpy as np
import pandas as pd
from tqdm import tqdm
import matplotlib.pylab as plt
from sklearn.model_selection import train_test_split
import keras
import tensorflow as tf
from keras import backend as K
from keras.models import Model
from keras.layers import Input
from ker... |
import torch as ch
import os.path
from torch import optim
from torch import nn
from torch.utils import data
import torch.autograd as autograd
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from models import Classifier
ch.set_default_tensor_type('to... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 3 14:10:12 2019
@author: Dominic
"""
from numba import njit, float64, int64
from scipy import integrate
from math import exp, log, pi
import numpy as np # I USE NUMPY FOR EXP, LOG AND SQRT AS THEY HANDLE IMAGINARY PARTS
from ..finutils.FinGlobalVariables import gDaysI... |
import calendar
from datetime import date, timedelta
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
import bleach
from autoslug import AutoSlugField
from djchoices import ChoiceItem... |
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
import csv
import time
import math
import threading
import numpy as np
from picamera import PiCamera
from lib_utils import *
from lib_camera import Camera
from lib_blob import Blob
from lib_fin import Fin
from lib_leds import LEDS
status = ['ho... |
"""
Class for holding Photometry Tables
"""
from __future__ import absolute_import, print_function, division
from future.utils import with_metaclass
__all__ = ['PhotTables']
import abc
import numpy as np
import pandas as pd
from astropy.table import Table
from .aliases import aliasDictionary
from .lightcurve import L... |
"""
This test module verifies all conftest fixtures work as intended.
The BQSKit root conftest defines the following circuit fixtures that
need to be verified:
gen_random_utry_np
gen_invalid_utry_np
gen_random_circuit
There are four sets of randomly-generated circuits that are used to test
`gen_random_cir... |
# Copyright 2015 Infoblox 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 by ap... |
import argparse
import glob
from pathlib import Path
import numpy as np
import torch
from torch.utils.data import DataLoader
import onnx
from onnx import helper
from pcdet.config import cfg, cfg_from_yaml_file
from pcdet.datasets import DatasetTemplate
from pcdet.models import build_network, load_data_to_gpu
from pcd... |
"""Module to handle book keeping of data
Author(s):
<NAME> (<EMAIL>)
"""
import os
from collections import defaultdict
import logging
from enum import Enum
import dill
class DataObjectResponseType(Enum):
"""Type of object when getting data from DataObject
INSTANCE_KEY_VALUE = dictionary of instance_nam... |
from datetime import *
import datetime
from numpy import *
import statsmodels.api as sm
import statsmodels.tsa.stattools as ts
import scipy.io as sio
import pandas as pd
def normcdf(X):
(a1,a2,a3,a4,a5) = (0.31938153, -0.356563782, 1.781477937, -1.821255978, 1.330274429)
L = abs(X)
K = 1.0 ... |
import magma as m
import shutil
import json
import os
import sys
from fault import Tester
import glob
def copy_file(src_filename, dst_filename, override=False):
if not override and os.path.isfile(dst_filename):
return
shutil.copy(src_filename, dst_filename)
class BasicTester(Tester):
def __init_... |
##############################################################################
#
# Copyright (c) 2001-2012 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... |
#!/usr/bin/env python
import os
import sys
import random
# ========
# global variables
# ========
RT = None
N_VARS = None
INPUT_FILE = None
EXE_LP = None
OUTPUT_LP = None
EXE_HP = None
OUTPUT_HP = None
TIMEOUT = None
RESOURCE ... |
import math
import unittest
from random import randint
from pythagorean_tuples import pythagorean_triples
def is_pythagorean_triple(t):
return t[0] ** 2 + t[1] ** 2 == t[2] ** 2
def is_primitive(t):
return math.gcd(t[0], t[1]) == 1 and math.gcd(t[1], t[2]) == 1 and math.gcd(t[2], t[0]) == 1
class TestPyt... |
"""
Script calculates trends for temperature profiles over the polar cap. We
assess warming contributions from SST and sea ice compared to reanalysis.
Notes
-----
Author : <NAME>
Date : 17 July 2019
"""
### Import modules
import datetime
import numpy as np
import matplotlib.pyplot as plt
import cmocean
from... |
from itertools import chain, combinations
from typing import List, Tuple
from numpy import linalg
from scipy import stats
from scipy.stats import chi2
from src.regressions import least_squares, ridge_regression
from src.evaluation_metrics import *
from src.helpers import *
import math
import copy
def confidence_in... |
"""Generation of random-valued GraphTensor instances for testing.
"""
import string
from typing import Any, Dict, List, Optional, Text, Tuple, Union
import tensorflow as tf
from tensorflow_gnn.graph import adjacency as adj
from tensorflow_gnn.graph import graph_constants as gc
from tensorflow_gnn.graph import graph_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
progVersion = "0.3.3"
import optparse
import socket
from socket import *
import requests
import colorama
from colorama import Fore, Back, Style
colorama.init(autoreset=True)
from re import sub
import csv
import logging
from threading import Thread, Semaphore
from time imp... |
import random
from typing import Dict, List, Optional, Sequence
import matplotlib.colors as mplc
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from matplotlib.colors import cnames
from matplotlib.patches import Rectangle
from easy_efficientdet.utils import (
LabelMapType,
convert_... |
#!/usr/bin/env python
"""
A headless open source tool for synchronizing users' name and emails between a
MySQL database and mailman server. Correct login credentials for the database
and mailman server must be provided in a '.env' file.
Python2 & Python3 compatible.
Author: <NAME>
"""
from __future__ import print_f... |
import argparse
import numpy as np
import pickle
import torch
import os
import json
import time
from continual_learning.models.PartialReplayUtils import fill_replay_buffer
from continual_learning.models.PartialReplay import PartialReplay
from continual_learning.models.FineTuneModel import FineTune
from continual_learn... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 1 13:22:21 2021
@author: mike
"""
import os
import socket
import numpy as np
import zstandard as zstd
import pickle
import pandas as pd
import smtplib
import ssl
import requests
import orjson
from email.message import EmailMessage
from glob import ... |
# -*- coding: UTF-8 -*-
# @yasinkuyu
# Define Python imports
import os
import sys
import time
import config
import argparse
import threading
import sqlite3
# Define Custom imports
from BinanceAPI import *
# Define Custom import vars
client = BinanceAPI(config.api_key, config.api_secret)
conn = sqlite3.connect('order... |
from unicodedata import category
from neigbouhood.models import BussinessClass, Category, NeigbourHood, News,Profile
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django... |
import time
import asyncio
import logging
try:
import websockets
except ImportError:
websockets = None
from .message import Prefix
from .message import IRCMessage, TERMINATOR
PING_INTERVAL = 30
PING_GRACE = 5
IDENT_TIMEOUT = 10
QUIT_MESSAGE = "goodbye"
log = logging.getLogger(__name__)
class Client:
... |
import pickle
import matplotlib.pyplot as plt
import numpy as np
from layers import *
from Multilayer import Dropout
class DeepConvNet:
"""
网络结构如下所示
conv - relu - conv- relu - pool - conv - relu - conv- relu - pool -
conv - relu - conv- relu - pool - affine - relu - dropout - affine - dropout ... |
# HT10 Estructuras de Datos
# <NAME> 18049
# <NAME> 18676
# Programa de recomendacion de medicos
from neo4j import GraphDatabase
#Se inicia un servidor y se conecta
driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "admin123"))
#Al iniciar el programa, borra la base de datos que esta en el localh... |
# coding=utf-8
"""
Discord chat commands parser
"""
import argparse
import inspect
import sys
from types import GeneratorType
import argh
from argh import compat
from argh.constants import (
ATTR_EXPECTS_NAMESPACE_OBJECT, ATTR_WRAPPED_EXCEPTIONS, ATTR_WRAPPED_EXCEPTIONS_PROCESSOR,
DEST_FUNCTION,
)
# noinspect... |
#!/usr/bin/env python3
import argparse
import base64
import csv
import json
import mimetypes
import pathlib
import subprocess
import sys
import pystache
import yaml
import ci.util
from asq.initiators import query
from asq.record import new
DEFAULT_BUILD_URL = 'https://buildkite.com/plaidml'
PLAN_PATH = pathlib.Path... |
"""
NEB的振动分析
程序运行在NEB目录,需要NEB完成
读取ini/CONTCAR fin/CONTCAR 鞍点(一般02)/CONTCAR
对比ini/CONTCAR fin/CONTCAR 的原子位置,确定是第几个是扩散元素。
对ini/CONTCAR saddle/CONTCAR 扩散元素T T T,非扩散元素F F F
修改INCAR进行振动分析
"""
import os, sys
import subprocess
import zzdlib
import argparse
import numpy as np
python = sys.executable
current_py_folder = os.p... |
# Copyright (C) 2020 <NAME>.
# All rights reserved.
# Ported by @mrismanaziz
# FROM Man-Userbot
# Recode by @greyyvbss
# Recode2 by @BukanBdrl
"""
Heroku manager for your userbot
"""
import math
import os
import aiohttp
import heroku3
import urllib3
from userbot import BOTLOG, BOTLOG_CHATID
from... |
# Copyright 2016 Open Source Robotics Foundation, 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... |
#!/usr/bin/env python3
"""CLIP guided sampling from a diffusion model."""
import argparse
from functools import partial
from pathlib import Path
from PIL import Image
import torch
from torch import nn
from torch.nn import functional as F
from torchvision import transforms
from torchvision.transforms import functiona... |
# Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
from __future__ import print_function
import errno
import itertools
import math
import numbers
import os
import platform
import signal
import subprocess
import sys
import threading
def is_string(value):
try:
# Python 2 and Python 3 are different here.
return isinstance(value, basestring)
exce... |
import datetime
import glob
import numpy as np
import os, os.path as osp
import pickle
import time
import torch
try:
from torch.cuda.amp import GradScaler, autocast
except ImportError:
print('PyTorch automatic mixed precision unavailable !')
print('Set train.params.amp to False')
from collections import d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import json
import os
from io import StringIO
from urllib.parse import urljoin
import wget
import xlrd
import requests
from lxml import etree
from twisted.internet import reactor, defer
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import confi... |
from .conv import *
import numpy as np
from gensim.parsing.preprocessing import *
class GPT_GNN(nn.Module):
def __init__(self, gnn, rem_edge_list, attr_decoder, types, neg_samp_num, device, neg_queue_size = 0):
super(GPT_GNN, self).__init__()
if gnn is None:
return
self.types =... |
#!/usr/bin/env python
# coding: utf-8
# # 8. Interactivity in Python
# ### Announcements
# - Lab 7 due Wednesday
# - Interview with <NAME> on Friday
# - Code Review I for final projects due on November 19 (50% complete, working examples)
# So far this semester, our interaction with Python has been primarily based ... |
# built-in modules
from pathlib import Path
import re
from typing import List, Union
# third-party modules
import pandas as pd
# local modules
from bitome.features import Gene, TranscriptionFactor, TFBindingSite, IModulon
DATA_DIR = Path(Path(__file__).parent.parent, 'data')
def load_locus_tag_yome_lookup() -> dic... |
import numpy as np
from utils import utility as u
from utils import param as p
from utils import cond as c
from utils import mesh as m
def println(Q):
''' print for debug '''
for i in Q:
for j in i:
print(j, end=' ')
print()
print()
""" transform n and S into Q """
def Q_tens... |
# -*- coding: utf-8 -*-
from django.db import models
import os
#def get_upload_path_saidaRef(instance, filename):
# """
# Retorna o caminho para o arquivo de saidaRef de uma questao
# saidaRef/questaoID/filename
# """
# return joinPath("saidaRef",str(instance.slug),filename)
#
#def get_... |
__copyright__ = "Copyright (c) Microsoft Corporation and Mila - Quebec AI Institute"
__license__ = "MIT"
"""Module for observation space components
"""
__all__ = (
"Observation",
"ObjectStateObservation",
"TileStateObservation",
"AllObjectsStateObservation",
"AllTilesStateObservation",
"AllSta... |
'''
Custom widgets for use in forms.
'''
from django import forms
from django.core.exceptions import ValidationError
from django.templatetags.static import static
from django.utils.translation import ugettext as _
from ngw.core import perms
#######################################################################
#
# ... |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# 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, c... |
"""
Copyright (c) 2015-present, Philippine-California Advanced Research Institutes-
The Village Base Station Project (PCARI-VBTS). All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
-
Credit management utilities.
Note that... |
#
# Copyright 2014 Quantopian, 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 agreed to in wr... |
# -*- coding: utf-8 -*-
"""
The analysis module provides the function to analyse the data generated by
pyDentate. Data files generated by pyDentate have the .pydd extension.
This extension simply allows to identify files that contain the raw data
as opposed to files that contain for example plots. All data files are py... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#--------------------------------------------------------------------------------
# Authors:
# - <NAME>: <EMAIL>
# - <NAME>: <EMAIL>
#
# MIT License
# Copyright (c) 2021 CORSMAL
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (t... |
import demistomock as demisto # noqa
from typing import Tuple, List
from math import floor
from functools import reduce
import ExpanseGenerateIssueMapWidgetScript
# taken from demistomock with only the relevant
# fields changed
EXAMPLE_INCIDENT = [
{
"Brand": "Builtin",
"Category": "Builtin",
... |
import os
import time
import joblib
import numpy as np
import os.path as osp
import tensorflow as tf
from baselines import logger
from collections import deque
from baselines.common import explained_variance
from gym.spaces.box import Box
from gym.spaces.discrete import Discrete
class Model(object):
def __init__(s... |
"""
Extensions to SQLAlchemy for altering existing tables.
At the moment, this isn't so much based off of ANSI as much as
things that just happen to work with multiple databases.
"""
import sqlalchemy as sa
from sqlalchemy.schema import SchemaVisitor
from sqlalchemy.engine.default import DefaultDialect
from ... |
"""
Support for MQTT sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mqtt/
"""
from datetime import timedelta
import json
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.components import mqtt, sens... |
import datetime
import debian.deb822
import email.headerregistry
import email.utils
import html
import html.parser
import re
from urllib.parse import urljoin
class DateIndexPageParser(html.parser.HTMLParser):
def error(self, message):
pass
def __init__(self, url):
super().__init__()
... |
from __future__ import absolute_import
import sys
import jsonschema
import logging
import six
import time
from django.conf import settings
from django.core.urlresolvers import reverse
from requests.exceptions import RequestException
from six.moves.urllib.parse import urljoin
from sentry import options
from sentry.a... |
'''
Compendium of generic DNS utilities
'''
# Import salt libs
import salt.utils
# Import python libs
import logging
import re
log = logging.getLogger(__name__)
def __virtual__():
'''
Generic, should work on any platform
'''
if not salt.utils.which('dig'):
return False
return 'dnsutil'
... |
import os
import math
from datetime import datetime
import numpy as np
from PIL import Image
import cv2
####################
# miscellaneous
####################
def get_timestamp():
return datetime.now().strftime('%y%m%d-%H%M%S')
def mkdir(path):
if not os.path.exists(path):
os.makedirs(path)
de... |
# vim:ts=4:sts=4:sw=4:expandtab
import glob
import os
import tempfile
from satori.client.common import want_import
want_import(globals(), '*')
from satori.web.utils.decorators import contest_view
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.shortcuts import rende... |
# 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... |
# Copyright (C) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
"""
.. module: dispatch.plugins.dispatch_core.plugin
:platform: Unix
:copyright: (c) 2019 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
import base64
import json
import logging
import requests
from fastapi import HTTPException
from fastapi.security.utils import g... |
import inspect
import io
import json
import logging
import os
import os.path
import pathlib
import shutil
import tarfile
import tempfile
from django.conf import settings
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.timezone import now, timedelta
from rest_framework.exceptions import Per... |
##
## Licensed to the .NET Foundation under one or more agreements.
## The .NET Foundation licenses this file to you under the MIT license.
## See the LICENSE file in the project root for more information.
##
## This script generates the interface to ETW using MC.exe
import sys, os
sys.path.append(os.path.dirname(os.p... |
import datetime
from peewee import SqliteDatabase, Model, CharField, IntegerField, DateTimeField
import os
db = SqliteDatabase(os.getenv('DB_PATH', 'discord.db'))
### Logic
def meme_exists(url):
return Meme.select().where(Meme.url == url).count() > 0
def pup_exists(url):
return Pup.select().where(Pup.url == ... |
from plex import Plex
from plex.lib.six.moves.urllib_parse import urlencode
from plex_activity.sources.base import Source
import json
import logging
import re
import sys
import time
import websocket
log = logging.getLogger(__name__)
SCANNING_REGEX = re.compile('Scanning the "(?P<section>.*?)" section', re.IGNORECASE... |
from dataclasses import dataclass
from functools import partial
from typing import List
from jax import grad, jit, nn
import jax.numpy as np
import numpy as onp
import scipy as oscipy
from . import conditions, distribution, scale
@dataclass
class HistogramDist(distribution.Distribution):
logps: np.DeviceArray
... |
import pytest
from config import genes, with_sm, no_sm, with_unique_sm
from lib.networks import create_pathway_interaction_network
@pytest.fixture(scope="session")
def glycolysis_graph_with_sm(tmpdir_factory):
# Pathway "Regulation of glycolysis by fructose" R-HSA-9634600
graphs_path = tmpdir_factory.mktemp(... |
#!/usr/bin/env python
''' Installation script for dipy package '''
import numpy as np
import os
import sys
from copy import deepcopy
from os.path import join as pjoin, dirname
from glob import glob
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories c... |
""" Original Author: <NAME> """
import numpy as np
import ctypes as ct
import cv2
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
showsz = 800
mousex, mousey = 0.5, 0.5
zoom = 1.0
changed = True
def onmouse(*args):
global mousex, mousey, changed
y = args[1]
x = args[2]
mouse... |
# -*- 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 o... |
#!/usr/bin/env python
#
#===- add_new_check.py - clang-tidy check generator ----------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===---------... |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, <NAME> and <NAME>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistribut... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
import logging
import os
from pathlib import Path
import pkg_resources
import pytest
import yaml
from ambianic.configuration import (
__version__,
get_root_config,
init_config,
reload_config,
)
from ambianic.notification import NotificationHandler
from ambianic.webapp.fastapi_app import app, set_data_d... |
import math
import calendar
import datetime
import threading
import cachetools
import cachecontrol
from data import constants
def current_cycle():
year = datetime.datetime.now().year
return year + year % 2
class LRUCache(cachecontrol.cache.BaseCache):
"""A thread-safe least recently updated cache adapt... |
'''
Created on 07/08/2016
@author: garet
'''
import queue
import re
from io import BytesIO
import pycurl
import chardet
from email.base64mime import body_encode
import Parser
class MultiSpider:
def __init__(self, params=None):
if not hasattr(self, 'max_conn'):
self.max_co... |
# Copyright 2016 The Oppia 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 applicable ... |
# delong_classes.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
class solow:
"""
Implements the Solow growth model calculation of the
capital-output ratio κ and other model variables
using the update rule:
κ_{t+1} = κ_t + ( 1 - α) ( s - (n+g+δ)κ_t )
... |
#
# 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 agreed to in writing... |
import traceback
from submissions.LaMartina import state_crime
#from sklearn.neural_network import MLPClassifier
from sklearn.cluster import KMeans
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
crimes = DataFrame()
larcenycr = DataFrame()
'''
Extract data from the CORGI... |
"""Cython.Distutils.old_build_ext
Implements a version of the Distutils 'build_ext' command, for
building Cython extension modules.
Note that this module is deprecated. Use cythonize() instead.
"""
__revision__ = "$Id:$"
import inspect
import sys
import os
from distutils.errors import DistutilsPlatformError
from d... |
from __future__ import absolute_import, print_function, division
import operator
from petl.compat import OrderedDict, next, string_types, text_type
from petl.errors import ArgumentError
from petl.util.base import Table, expr, rowgroupby, Record
from petl.transform.sorts import sort
def fieldmap(table, mappings=No... |
import os
import subprocess
import functools
from leapp.models import StorageInfo, PartitionEntry, FstabEntry, MountEntry, LsblkEntry, \
PvsEntry, VgsEntry, LvdisplayEntry, SystemdMountEntry
from leapp import reporting
from leapp.libraries.stdlib import api
def aslist(f):
''' Decorator used to convert gener... |
#!/usr/bin/env python
# Copyright (c) 2009 <NAME>'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""psutil is a cross-platform library for retrieving information on
running processes and system utilization (CPU, memory, disks, network)
in P... |
#!/usr/bin/env python
# coding: utf-8
"""
This script applies the the Isolation Forest anomaly detection
algorithm to the property data and then return both visualizations and
performance metrics.
"""
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn import preprocessing
from sklearn.met... |
"""
:codeauthor: <NAME> (<EMAIL>)
tests.unit.utils.cloud_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test the salt-cloud utilities module.
"""
import os
import tempfile
import pytest
import salt.utils.cloud as cloud
from tests.support.mock import MagicMock, patch
@pytest.fixture()
def configure_loader_module... |
import discord
from discord.ext import commands
from discord.embeds import Embed
from datetime import date,datetime
import time
import pytz
from pytz import timezone
import requests
import json
#Very repetitive to include this in every cog: maybe find a way to make this available to all cogs by overwriting commands.... |
# Copyright (c) 2015 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
# Copyright 2019 The Texar Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#!/usr/bin/env python3
# Copyright (c) 2014 <NAME>
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that release executables only contain certain symbols
and are only linked against allowed libraries.
Example ... |
import contextlib
from pathlib import Path
import re
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
from pandas.io.excel import (
ExcelWriter,
_OpenpyxlWriter,
)
openpyxl = pytest.importorskip("openpyxl")
pytestmark = pytest.mark.parametrize("... |
import json
import os
import shutil
import subprocess
import sys
from pathlib import Path
import numpy as np
import pandas as pd
from asreview import __version__ as asreview_version
from asreview.config import LABEL_NA
from asreview.webapp.sqlock import SQLiteLock
from asreview.webapp.utils.io import read_current_lab... |
# Copyright (c) 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
#
# Unless required by applica... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Utility functions for the Spyder application."""
# Standard library imports
import glob
import logging
import os
import os.path as osp
import re
import sys
# Thi... |
"""
@author: <NAME>
This file is the Fourier Neural Operator for 1D problem such as the (time-independent) Burgers equation discussed in Section 5.1 in the [paper](https://arxiv.org/pdf/2010.08895.pdf).
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter im... |
"""
This module contains all the functions required to do the signal to noise calculations. Allows you
to calculate the signal-to-noise ratio for a star observed with a telescope and CCD. You can vary
the parameters and find out what sort of results to expect. Code adapted from original perl code
here: http://stupendou... |
# Copyright 2019 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, ... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.