text stringlengths 3.07k 12.6k |
|---|
import asyncio
from datetime import datetime, timezone, timedelta
import pytz
from openleadr import OpenADRServer, enable_default_logging
from functools import partial
import time
from aiohttp import web
import logging
import os
enable_default_logging(logging.DEBUG)
#enable_default_logging()
tz_local = pytz.timezo... |
#!/usr/bin/env python
import gzip
import pandas as pd
from fact.io import write_data
import click
import logging
import numpy as np
import os
from tqdm import tqdm
from gridmap import Job, process_jobs
logging.basicConfig(format='%(asctime)s|%(levelname)s|%(message)s',
datefmt='%m/%d/%Y %I:%M:%S %... |
from unittest import TestCase, skipIf
import os
from traits.api import HasTraits, Instance
from traitsui.api import Item, View
try:
from scimath.units.api import UnitScalar
from scimath.units.dimensionless import dimensionless
from app_common.traitsui.unit_scalar_editor import \
UnitScalarEditor, st... |
# -*- coding: utf-8 -*-
import tensorflow_decision_forests as tfdf
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import pandas as pd
import gradio as gr
import urllib
input_path = "https://archive.ics.uci.edu/ml/machine-learning-databases/census-income-mld/census-income"
inpu... |
# Copyright 2019 The Bazel 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 la... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import random
from egg.zoo.compositional_efficiency.dataset import AttributeValueData
from egg.zoo.compositional_efficiency.archs import (
... |
"""
The MIT License (MIT)
Copyright (c) 2017 <NAME>
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, publi... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse_lazy
from django.db.models import Q
from django.http import Http... |
from uuid import uuid4
from flask_cors import CORS
import requests
from flask import Flask, jsonify, request
import json
import datetime
from blockchain import Blockchain
# Instantiate the Node
app = Flask(__name__)
CORS(app)
# Generate a globally unique address for this node
node_identifier = str(uuid4()).replace('-... |
# Copyright (c) 2015 dmpayton
#
# 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, distribute... |
"""
Helper functions for testing.
"""
import inspect
import os
import string
from matplotlib.testing.compare import compare_images
from pygmt.exceptions import GMTImageComparisonFailure
from pygmt.src import which
def check_figures_equal(*, extensions=("png",), tol=0.0, result_dir="result_images"):
"""
Decor... |
# Copyright 2015 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 applicabl... |
# ------------------------------------------------------------------------------------------
# Copyright (c) 2017 hysts.
# Licensed under the MIT License (MIT). See LICENSE in the PytrochImageClassification folder for license information.
# ---------------------------------------------------------------------------... |
import numpy as np
from inferelator.utils import Validator as check
from inferelator import utils
from inferelator.regression import base_regression
from inferelator.distributed.inferelator_mp import MPControl
from sklearn.base import BaseEstimator
from inferelator.regression.base_regression import _MultitaskRegression... |
# search.py
# ---------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# <NAME> (<EMAIL>) and <NAME> (<EMAIL>).
# For more info, see htt... |
# coding: utf-8
#
# Copyright 2020 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 requi... |
"""
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 use this ... |
import copy
from zeep import xsd
from .base.custom_fields import CustomFields
from .factory import createFromUri, Creator
class Document(CustomFields):
def __init__(self, polarion, project, uri=None, location=None):
"""
Create a Document.
:param polarion: Polarion client object
:... |
"""
This class is used to create the following OpenSees TCL Commands:
This command is used to construct a SolutionAlgorithm object, which determines the sequence of steps taken to solve the non-linear equation.
algorithm algorithmType? arg1? ...
The type of solution algorithm created and the additional arguments requi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## Full credit to https://github.com/kelvins/steganography/blob/master/steganography.py
## for putting this together.
import click
from PIL import Image
class Steganography(object):
@staticmethod
def __int_to_bin(rgb):
"""Convert an integer ... |
import os
import re
import traceback
import importlib
from shlex import split
from types import ModuleType
from typing import TYPE_CHECKING, Dict, Optional, Tuple, Set, Pattern
import discord
from . import log
from .command import BaseCommand, CommandResult
from .context import Context
from .arguments import Argumen... |
# -*- coding: utf-8 -*-
"""
Detect CV (consonant-vowel) pair events in speaker and microphone channels.
"""
# Third party libraries
import numpy as np
import scipy.signal as sgn
from ecogvis.signal_processing.resample import resample
def detect_events(speaker_data, mic_data=None, interval=None, dfact=30,
... |
import numpy as np
import mxnet as mx
from mxnet import nd, autograd, gluon
from mxnet.gluon import nn, Block
from mxnet.gluon.loss import Loss
class InnerEncoderBlock(Block):
def __init__(self, num_filters, **kwargs):
super(InnerEncoderBlock, self).__init__(**kwargs)
with self.name_scope():
... |
from io import BytesIO
import pytest
from thefrick.types import Command
from thefrick.rules.dnf_no_such_command import match, get_new_command, _get_operations
help_text = b'''usage: dnf [options] COMMAND
List of Main Commands:
autoremove remove all unneeded packages that were originally installed as ... |
import os
from .base import BaseExpConfig
class ExpConfig(BaseExpConfig):
"""
将众多的参数从args中取出来放到一个参数类中 方便直观调整
"""
def __init__(self):
super(ExpConfig, self).__init__()
# 实验配置
# ============================================
self.dataset = "pre-det" ... |
import math
from typing import Dict, Optional, Tuple
import numpy as np
import networkx as nx
def GetRecvWeights(topo: nx.DiGraph, rank: int) -> Tuple[float, Dict[int, float]]:
"""Return a Tuple of self_weight and neighbor_weights for receiving dictionary."""
weight_matrix = nx.to_numpy_array(topo)
self_... |
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
# FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHET... |
# ===============================================================================
# Copyright 2011 <NAME>
#
# 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/LI... |
# -*- coding: utf-8 -*-
"""
file: smartcyp_run.py
Defines the SmartCypRunner class responsible for running the SMARTCyp
Java code and parsing the output to structured JSON.
"""
import glob
import pandas
import os
import logging
import base64
from mdstudio_smartcyp import (__smartcyp_version__, __smartcyp_citation__... |
import datetime as dt
from RecordClasses import Record
import fitbitWrapper
ss_duration = dt.timedelta(minutes=2) # minutes
# returns the score level and a timestamp of the last avalible result
def get_last_score():
today = dt.datetime.now().date()
# get the info of the last sync time
heartrate_stats = ... |
#!/usr/bin/env python
# encoding: utf-8
#| Copyright Inria May 2015
#| This project has received funding from the European Research Council (ERC) under
#| the European Union's Horizon 2020 research and innovation programme (grant
#| agreement No 637972) - see http://www.resibots.eu
#|
#| Contributor(s):
#| - <NAME> (... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by <NAME> <<EMAIL>>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Support for smart import syntax for web2py applications
-------------------------------------------------------
"""
from gluon._c... |
# Copyright 2017, Google 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 applicable law or ... |
from social_core.storage import UserMixin, BaseStorage, NonceMixin, AssociationMixin
from gluon.globals import current
import base64
import six
class User(object):
"""Social Auth user model"""
def __init__(self, row):
self.row = row
self.id = row.id
self.__dict__.update(self... |
# Copyright 2014 Cisco Systems, 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 requir... |
from typing import DefaultDict
from operator import itemgetter
import requests
import random
import json
from requests.api import request
from requests.models import RequestEncodingMixin
#현재 대기열에서 매칭을 대기 중인 유저들의 정보를 반환한다.
#"waiting_line": [
#{ "id": 1, "from": 3 },
def waitingLine(url,headers,path,userLevel):
wai... |
import argparse
import torch
from collections import OrderedDict
from os.path import isdir
from torch import nn
from torch import optim
from torchvision import datasets, transforms, models
def arg_parser():
parser = argparse.ArgumentParser(description="Neural Network Settings")
parser.add_argument('--arc... |
import struct
import xml.etree.ElementTree as ETree
from collections import defaultdict
import mne
import numpy as np
from pyxdf import load_xdf, match_streaminfos, resolve_streams
from pyxdf.pyxdf import open_xdf, _read_varlen_int
def read_raw_xdf(fname, stream_id, srate="effective", prefix_markers=False, *args,
... |
"""Kytos utils configuration."""
# This file is part of kytos-utils.
#
# Copyright (c) 2016 Kytos Team
#
# Authors:
# <NAME> <beraldo AT ncc DOT unesp DOT br>
import json
import logging
import os
import re
import shutil
from collections import namedtuple
from configparser import ConfigParser
from pathlib import Pat... |
#!/usr/bin/env python
import bs4
import logging
import jinja2
import os
import shutil
import toml
import typing
from datetime import datetime
from jinja2.environment import Template, Environment
from nbcollection.ci.constants import ENCODING
from nbcollection.ci.merge_artifacts.datatypes import MergeContext, Artifa... |
import tensorflow as tf
from const import *
def decode(serialized_example):
features = tf.io.parse_single_example(serialized=serialized_example,
features={
'dims': tf.io.FixedLenFeature([3], tf.int64),
... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import optimizee
import os
get_path = os.getcwd()
parent_directory = os.path.split(get_path)[0]
datasets = os.path.join(parent_directory, "datasets")
class MnistLinearModel(optimizee.Optimizee):
'''A MLP on data... |
import os
import dataset
import util.tree_model
import uic.view_dataset
import numpy as np
import dataset.budgetary_consistency
from core import Core
from dataset import Dataset, Analysis, ExportVariant, DatasetHeaderC
from dataset.budgetary_consistency import BudgetaryConsistency
from typing import Sequence, NamedTup... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gdb
import operator
cs_instances = []
# This module helps generate a complete log of the call stack of a breakpoint.
# It can also record the value of some variables.
# Get a table horizontal line
def get_hline(length):
s = ''
for x in range(0, length):
... |
from flask import Flask, Response
from flask_cors import CORS
from flask_restplus import Resource, Api
import json
import atexit
import managing
import database
import logger
from Models import Models
# app init
import request_handling
app = Flask(__name__, template_folder='templates')
cors = CORS(app)
app.config['... |
import pandas as pd
import numpy as np
import os
import torch
import torch.nn as nn
from dataset import Dataset, to_device
from model import NNModel, NNModelEx, CNNModel
from time import time
from tqdm import tqdm_notebook as tqdm
def load_model_with_config(config, training_set=None, force_train=False):
# a bit ha... |
"""
demo.helpers
~~~~~~~~~~~~
flask-demo helpers module
:copyright: (c) 2016 by codeif.
:license: MIT, see LICENSE for more details.
"""
import decimal
import importlib
import json
import re
import uuid
from datetime import date, datetime, time
import requests
from flask import Blueprint, Flask,... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#############################################################
# File: LoadSpecifiedImagesCelebAforNoDiff.py
# Created Date: Saturday October 5th 2019
# Author: <NAME>
# Email: <EMAIL>
# Last Modified: Sunday, 3rd November 2019 8:34:25 pm
# Modified By: <NAME>
# Copyright (... |
# Copyright (c) 2020, <NAME>. 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 law or ... |
# Copyright: 2005-2011 <NAME> <<EMAIL>>
# License: GPL2/BSD
"""
interaction with the livefs: generating fs objects to represent the livefs.
"""
import collections
import errno
import os
from stat import S_IMODE, S_ISDIR, S_ISREG, S_ISLNK, S_ISFIFO
from snakeoil.chksum import get_handlers
from snakeoil.data_source im... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Module
from typing import Tuple
from ProcessData.NormData import norm_feature
from ProcessData.NormData import *
class LSTMCell(nn.Module):
def __init__(self, input_size, hidden_size):
super(LSTMCell, self).__init__(... |
# Copyright 2020 Adap GmbH. 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 law or ag... |
# logistic_regression_kfold.py
# python 2.7.14
# logistic-regression with ROC Curve
# MNIST classify between 6 and 8
# <NAME>
from sklearn.model_selection import KFold
import numpy as np
import matplotlib.pyplot as plt
def logistic_regression(x, y, steps, lr):
w = initialize_weights(x.shape[1])
costs = []
... |
#!/usr/bin/env python3
"""Process raw messages from FlightAware's dump978.
The majority of the code in this module is in the actual
script part of this file, not in a function.
"""
import os, io, sys, json, argparse, traceback
import fisb.level0.level0Config as cfg
import fisb.level0.level0Exceptions as ex
import f... |
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... |
"""
This file implements the `qrint` encoding of binary data to a string of decimal digits.
QR codes support different encoding modes, and generation tools typically choose them
automatically. There is a binary QR code encoding, but it doesn't work well with hand-scanners
since they act like keyboards, and most bytes ... |
import numpy as np
from preprocess.hierarchical import TreeNodes
from preprocess import utils
from evaluation.metrics import compute_level_loss
from algorithms.MinT import recon_base_forecast
from algorithms.ERM import unbiased_recon
from algorithms import LSTNet, Optim
import torch
import torch.nn as nn
import math
im... |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import torch
import math
from torch import nn
from torch.nn import init
from torch.nn.modules.utils import _pair
from ..functions.deform_conv2d_func import DeformConv2dFunction
class Def... |
import csv
import os
import time
import requests
from tkinter import filedialog
from tkinter import ttk
from tkinter import *
import xmltodict
####################################################################################
# Create GUI for getting user input
window = Tk()
window.title('Get record IDs in OAI-PMH... |
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.template.response import TemplateResponse
from wagtail.contrib.routable_page.models import RoutablePageMixin, route
from flags.state import flag_enabled
from v1.documents import FilterablePagesDocumentSearch
from v1.feeds import Fil... |
# -*- coding: utf-8 -*-
# test_index.py -- Tests for merge
# encoding: utf-8
# Copyright (c) 2020 <NAME>, Stratford Ontario Canada
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any late... |
"""The motionEye integration."""
from __future__ import annotations
import asyncio
import logging
from typing import Any, Callable
from motioneye_client.client import (
MotionEyeClient,
MotionEyeClientError,
MotionEyeClientInvalidAuthError,
)
from motioneye_client.const import KEY_CAMERAS, KEY_ID, KEY_NAM... |
import os
import cv2
import numpy as np
def find_image_files(input_dir):
"""
Recursively searches for .jpg/.png images.
"""
for root_dir, found_dirs, found_files in os.walk(input_dir):
for found_file in found_files:
if os.path.splitext(found_file)[-1].lower() in ['.jpg', '.png']:
... |
"""
Context information passed to each CLI command
"""
import logging
import uuid
from typing import Optional, cast, List
import boto3
import botocore
import botocore.session
from botocore import credentials
import click
from samcli.commands.exceptions import CredentialsError
from samcli.lib.utils.sam_logging import... |
import dill as pickle
import os
import numpy as np
from lenstronomywrapper.Utilities.data_util import write_data_to_file
from lenstronomywrapper.Utilities.misc import create_directory
import sys
from lenstronomywrapper.ModelingWorkflow.time_delays_extended_project.MCMCchain import MCMCchainNew
def flux_ratio_anomaly(f... |
"""
All the functions to calculate the diffs of the dicts.
"""
import collections.abc
import enum
from typing import Any, Iterable, Iterator, NamedTuple, Sequence, Union, overload
from kopf.structs import dicts
class DiffScope(enum.Flag):
"""
Scope limitation for the diffs' fields to be noticed or ignored.
... |
import argparse
import functools
import platform
import warnings
import torch
import torch.nn.functional as F
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv2d') != -1:
torch.nn.init.xavier_uniform_(m.weight)
torch.nn.init.zeros_(m.bias)
elif classname.find('... |
#!/usr/bin/env python
import json
import serial
import time
import csv
import os
import sys
import argparse
import logging
import atexit
from database_logger import DatabaseLogger
from mqtt_logger import LogToMQtt
from remeha_core import Frame
FORMAT = ('%(asctime)-15s %(threadName)-15s '
'%(levelname)-8s ... |
"""
.. module: dispatch.plugins.google_drive.plugin
:platform: Unix
:copyright: (c) 2019 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from typing import List
from dispatch.decorators import apply, counter, timer
from dispatch.p... |
import random
import unittest
from enum import Enum
def merge_sort(arr, start=None, end=None):
"""
Merge sort the input list and return sorted list.
:param start: The start index of the list to be sorted.
:param end: The end index of the list to be sorted.
:param arr: The list to sort.
"""
... |
# Imports here
import pandas as pd
import numpy as np
import time
import matplotlib.pyplot as plt
import torch
from torch import nn, optim
from torchvision import datasets, transforms, models, utils
import json
import scipy.io
from pprint import pprint
from collections import OrderedDict
from PIL import Image
import wa... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pickle
import gzip
np.set_printoptions(threshold=np.inf)
f = open('data/ACML_Movies.csv', 'r')
movie_strngs = f.read()
movie_strngs = movie_strngs.split('\n')
movie_strngs = movie_strngs[1:]
movie_strngs = movie_strngs[:-1]
ratings =... |
import numpy as np
import pandas as pd
import math
import scipy.linalg as la
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.spatial import distance
import numba
from numba import jit, int32, int64, float32, float64
import pstats
@jit(nopython = True)
def p_ij(d_matrix, perplexity = 40.0, tol = 1e-6):... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#**
#
#########
# trape #
#########
#
# trape depends of this file
# For full copyright information this visit: https://github.com/jofpin/trape
#
# Copyright 2018 by <NAME> (@jofpin) / <<EMAIL>>
#**
from core.dependence import urllib2
import sys
import os
from flask import ... |
# -*- coding: utf-8 -*-
"""
Provide authentication using Django Web Framework
:depends: - Django Web Framework
Django authentication depends on the presence of the django framework in the
``PYTHONPATH``, the Django project's ``settings.py`` file being in the
``PYTHONPATH`` and accessible via the ``DJANGO_SETTINGS_M... |
"""
(C) 2017 <NAME>
[London Machine Learning Study Group](http://www.meetup.com/London-Machine-Learning-Study-Group/members/)
This work is licensed under the Creative Commons Attribution 4.0 International
License. To view a copy of this license, visit
http://creativecommons.org/licenses/by/4.0/.
"""
import numpy as n... |
from django.db import models
from django.core.urlresolvers import reverse
from django.core.validators import validate_email
from serp.validators import validate_bic, validate_iban, validate_nif, validate_codpostal
# Create your models here.
TIPO_COBRO = (
('I', 'Ingreso'),
('G', 'Gasto'),
)
TIPO_PRESENTADOR ... |
import logging
import math
from collections import defaultdict
from enum import Enum
from itertools import chain
from random import randint, random
from typing import List
import numpy as np
from scipy import optimize
import util.optimizer_utils as utils
class Algorithm(Enum):
"""The currently possible algorithm... |
# import requests
import json
import getpass
import urllib.request
import csv
import re
import sys
import os
import pandas as pd
import numpy as np
import pickle
from random import randint
# ----------------------------------------------------------------------------
# load csv into list of list
def load_csv(csv_file_... |
"""Module responsible for storing and handling nbqa configuration."""
import collections
from shlex import split
from textwrap import dedent
from typing import Any, Callable, ClassVar, Dict, Mapping, Optional, Sequence, Union
import toml
from pkg_resources import resource_filename
from nbqa.cmdline import CLIArgs
C... |
import contextlib
import json
import os
import sys
import urllib
import urllib2
from google.appengine.api import users
from google.appengine.ext import ndb
import jinja2
import webapp2
# ------------------------------------------------------------------------- #
API_KEY = "<KEY>"
JINJA_ENVIRONMENT = jinja2.Enviro... |
from abc import abstractmethod
import logging
from hampel import hampel
import mlflow
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_error
from sklearn.svm import SVR
from xgboost im... |
#!/usr/bin/env python
"""
This script provides the command-line interface (CLI) to the PyReshaper
This script is used to generate Specifier object files ("specfiles") that
can then be run directly from the command-line with the corresponding
"runs2sspec" tool.
Copyright 2020 University Corporation for Atmospheric Re... |
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as func
from torch.distributions import OneHotCategorical
from torchsupport.training.state import (
NetNameListState, TrainingState
)
from torchsupport.training.multistep_training import MultistepTraining, step_descriptor
from t... |
import os
import re
import requests
import time
from bs4 import BeautifulSoup as BS
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
# Creates a new exception which can be thrown if the status code is not 200.
class RequestError(Exception):
pass
class Fetch:
def __init... |
import atexit
import os
import pickle
import shutil
import tempfile
from contextlib import contextmanager
from datetime import timedelta, datetime
from distutils.errors import DistutilsFileError
from pathlib import Path
from types import FunctionType
from typing import Callable, Any
from lztools import lzglobal
from lz... |
import numpy as np
from scipy.signal import convolve2d
from dataclasses import dataclass, field
from copy import deepcopy
from typing import List, Tuple
import os
from environments.environment_abc import Environment, State, Action
@dataclass
class HomebrewConnect4State(State):
board: np.ndarray = field(default_fa... |
import frida
import base64
import time
import os
import sys
import time
import signal
output_folder = sys.argv[1]
if not os.path.exists(output_folder):
os.mkdir(output_folder)
pid = (sys.argv[2])
mypid = os.getpid()
class QEntry(object):
def __init__(self):
self.filename = ""
self.size = 0
... |
import re
import time
import secrets.credentials as credentials
from http_status_codes import HttpStatusCode
import posixpath
from api.commands import ALL_COMMANDS, CONFIG_COMMANDS
def _print_formatted_commands(cmds, ms_version=None, has_statuscode=False):
print("#### {} new commands ####".format(len(cmds)))
... |
"""
Compatible with py2 and py3, inspired by jinjin2, future, etc
common types & functions:
name 2.x 3.x
------------ ----------- -----------
unichr unichr chr
unicode unicode str
range xrange range
string_types (str, unicode)... |
from argparse import ArgumentParser
import typing
import time
from benchmark.apigeneration.counter import Counter
from benchmark.codeline.line_counter import LineCounter
from dottygen.automata import parser as automata_parser
from dottygen.utils import logger, scribble, type_declaration_parser, role_parser
from dottyg... |
import codecs
# 类文件开头的固定代码
def getAutoCode(newLine):
extraStr = \
'''
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* SDP AutoR tool .
* It should not be modif... |
from math import sqrt
import math
from math import atan2, degrees
from skimage import data
from skimage.feature import blob_dog, blob_log, blob_doh
from skimage.color import rgb2gray
from skimage import io
import matplotlib.pyplot as plt
from scipy import stats
from scipy import spatial
import numpy as np
from scipy ... |
import unittest
from WorkTimeSaver.salary import Salary
from WorkTimeSaver.document import Record, Document
from datetime import datetime
from os import remove
class TestSalary(unittest.TestCase):
def test_days_add(self):
salary = Salary()
for _ in range(20):
salary.update_work(480)
... |
#!/usr/bin/env python
# Copyright 2019 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Author: <NAME>
# Mail: <EMAIL>
# description: Utils for board reboot. Describe sequences for reboot/power cycle
import sys
import serial
from lib.utils import fileOp
sys.path.insert(0, '../../')
import escapesh
import six
from li... |
from action import *
from planner import Planner
from state import StateMA
import sys
class MergeState(object):
def __init__(self, game_state, agent_id, agent_plan, master_plan, master_plan_index, agent_plan_index=None, g_value=0):
self.game_state = game_state
self.agent_id = agent_id
self... |
import requests
import datetime
server = "http://foo.bar:666"
username = "ernie"
password = "<PASSWORD>"
liveType = "Live"
vodType = "VOD"
seriesType = "Series"
class XCCache:
authData = {}
cc = XCCache()
# Note: The API Does not provide Full links to the requested stream. You have to build the url to the ... |
# -*- coding: utf-8 -*-
"""
BallotAPI - https://ballotapi.org - This code is released to the public domain.
This file is where the BallotAPI command line functionality lives. All the command
and subcommand options are defined here. This is the file that is used when you
run the basic `ballotapi ...` command. Alternati... |
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
"""
import ray
import ray.rllib.agents.pg as pg
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.models import ModelCatalog
from ray.rllib.utils.annotations import override
from ray.tune.registry ... |
from os import kill, sep
from os.path import join
from shutil import move
from signal import SIGHUP
from subprocess import check_output
import json
import re
import yaml
from jinja2 import Template
from tempfile import NamedTemporaryFile
from cloudify.utils import setup_logger
logger = setup_logger('cloudify.monito... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.