text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
from dotenv import load_dotenv
load_dotenv('.env')
import logging
logging.basicConfig(filename='logs/process.log', level=logging.INFO)
import os
import sys
sys.path.append(os.getenv('SNAPPY_PATH'))
from snappy import ProductIO
import subprocess
import time
from lxml im... |
import multiprocessing as mp
import numpy as np
import pyfftw
import scipy.ndimage as ndi
def apple_core_3d(shape, res, nm):
r"""Return a binary array with the apple core in 3D
Parameters
----------
shape: list-like, length 3
Shape of the reconstruction volume for which to compute
th... |
import random
from math import ceil
import numpy as np
import torch
from torch import nn
def parse_kernel(kernel_str, platform):
if kernel_str.startswith("arm64simd_mmm_f32_"):
if kernel_str.endswith(f"_{platform}"):
mr, nr = (
kernel_str.replace("arm64simd_mmm_f32_", "")
... |
#### GEOMETRY
#### utility functions for geometric computation
import math
import itertools
import numpy as np
import shapely.geometry
import shapely.ops
import Polygon as PolygonLib # TODO remove dependency (see triangulatePolygon)
from scenic.core.distributions import (needsSampling, distributionFunction,
... |
'''
script_chart.py
'''
from settings import USE_API, MAL_USERNAME, DISPLAY_ANIME_STATS, DISPLAY_MANGA_STATS
from settings import ENABLE_TAG_VALIDATIONS, MUST_BE_TAGGED, MUST_BE_UNTAGGED, APPLY_TAG_RULES
from settings import CHART_STYLE, MANUAL_SORT_ANIME, ENABLE_AUTO_CHART_OPEN
from src.loader import Loader, Pars... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
import numpy as np
from menpo.shape import PointCloud
import cv2
# ===== 68 =====
jaw_indices = np.arange(0, 17)
lbrow_indices = np.arange(17, 22)
rbrow_indices = np.arange(22, 27)
upper_nose_indices = np.arange(27, 31)
lower_nose_indices = np.arange(31, 36)
leye_indices = np.arange(36, 42)
reye_indices = np.arange(42... |
from tree_search import SearchDomain, SearchProblem, SearchTree
from mapa import Map
from consts import Tiles, TILES
import copy
def directions():
return list("wasd")
def inside_range(pos, size):
return pos[0] in range(size[0]) and pos[1] in range(size[1])
#retorna a nova posição a partir de certa ação
def ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#Copyright (c) 2018, Mark "Happy-Ferret" Bauermeister
#
#This software may be modified and distributed under the terms
#of the BSD license. See the LICENSE file for details.
from __future__ import unicode_literals, print_function
import itertools as it, operator as op,... |
from argparse import ArgumentParser
from datetime import datetime
from os import path, listdir
from pyautogui import hotkey, press
from re import compile as regex
from tqdm import tqdm
from lib.rpa import ObjectLocation
from lib import paths
sap_archive = path.join(paths.SAP_SIGMANEST_PRD, "Archive")
timestamp = "Pr... |
# -*- coding:utf-8 -*-
"""
-------------------------------------------------------------------------------
Project Name : ESEP
File Name : spatial.py
Start Date : 2022-03-25 05:16
... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.accounts.party import set_taxes
from erpnext.controllers.selling_controller import SellingController
from frappe import _
fr... |
from bokeh.models.widgets import RadioButtonGroup
from bokeh.models import ColumnDataSource#, Div
from bokeh.layouts import row, column#, Spacer
from bokeh.plotting import figure#, reset_output
from bokeh.models import Legend
from copy import deepcopy
from VibroP_MessageClass import VibroP_Message
from bokeh.models.ann... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: <NAME>
Email: <EMAIL>
Description: Generates a csv with the euclidian distance between the ligand and each ligand in the database
"""
import argparse
import numpy as np
import operator
import subprocess
from os.path import splitext
SEPARATOR = '|'
SE... |
# -*- coding: utf-8 -*-
import os
import gc
import copy
import torch
import pickle
import random
import argparse
import torchvision
import numpy as np
import pandas as pd
import torch.nn as nn
from PIL import Image
import torch.optim as optim
from netcal.metrics import ECE
import torch.nn.functional as F
import matplot... |
# ------------------------------------------------------------------------------------------
# Copyright <NAME> 2021.
#
# Distributed under the MIT License.
# (See accompanying file license.md file or copy at http://opensource.org/licenses/MIT)
#
# -----------------------------------------------------------------------... |
"""
File for studying HOD of different AGN catalogues
"""
# scipy modules
from scipy.spatial import cKDTree
from scipy.interpolate import interp1d
# astropy modules
import astropy.units as u
import astropy.io.fits as fits
from astropy.table import Table, Column
from astropy.coordinates import SkyCoord
from astropy.co... |
#!/usr/bin/env python
import sqlalchemy as db
import sqlalchemy.orm as orm
import pandas as pd
import numpy as np
from io import StringIO
from functools import reduce
import csv
import glob
import os
import sys
import argparse
import configparser
import requests
import json
import logging
'''
Script to ingest OpenQua... |
from __future__ import absolute_import, division, print_function
import os
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from ..exceptions import OverlapError
from ..obsbandpass import ObsBandpass, pixel_range, wave_range
from ..refs import setref
@pytest.mark.remote_data
class TestOb... |
from utils import detector_utils as detector_utils
import cv2
import tensorflow as tf
from multiprocessing import Queue, Pool
from utils.detector_utils_gui import WebcamVideoStream
import datetime
import keyboard
from utils import pose_classification_utils as classifier
import math
import os
import PySimpleGUI as sg
f... |
import collections
import os
import random
import xml.etree.ElementTree as ET
import numpy as np
from dm_control import mujoco
from dm_control.rl import control
from dm_control.suite import base, common
from dm_control.suite.utils import randomizers
from dm_control.utils import containers, rewards
from dmc_remastered... |
# -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# 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.
... |
from stan import StanDict, StanData
from .parser import Parser, ParserError
from tqdm import tqdm
from os import path
from collections import Iterable
# Common operations offsets
TIMESTAMP = 0
START_TIME_AND_PROCESS_ID = 1
THREAD_ID = 2
CONNECTION_ID = 3
OPERATION_CODE = 4
# Specific operations offsets
REQUEST_ID = 5... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 31 11:04:34 2020
@author: aboutet
"""
import pandas as pd
import numpy as np
from elasticsearch import Elasticsearch
def here_before(es, infos, insert):
g_axe = pd.read_csv("Data/GrandsAxesLoiret_pretraite.csv", sep=";")
speed_cat = {
"0":"Non dé... |
# coding: utf-8
from datetime import datetime
from decimal import Decimal
from unittest import TestCase
import httpretty
from pyqiwi import QiwiError, Qiwi
class QiwiErrorTestCase(TestCase):
def test_error_code(self):
error = QiwiError(143)
self.assertEqual(error.code, 143)
@httpretty.activate... |
"""
This module uses models from the Khalil paper.
"""
from __future__ import division
from scipy.special import cbrt
import numpy as np
from lmfit import Parameters
def qi_error(Q,Q_err,Q_e_real,Q_e_real_err,Q_e_imag,Q_e_imag_err):
"""
Compute error on Qi
Khalil et al defines Qi as 1/Qi = 1/Qr - Rea... |
from typing import (Dict,
List,
Optional,
Tuple)
from hypothesis import strategies
from tests.bind_tests.hints import (BoundContour,
BoundEdgeType,
BoundPoint,
... |
from SPARQLWrapper import SPARQLWrapper, CSV, JSON, XML, POSTDIRECTLY, POST, __agent__
import warnings
import pandas as pd
import io
import time
import json
import re
import urllib.request
from rdflib import Graph, util
from ratelimit import limits, sleep_and_retry
from functools import lru_cache
from kgextension.spar... |
import cv2
from enum import Enum
import logging
import threading
import time
import copy
import numpy
from pattern_type import PatternType
from pattern_finder import PatternFinder
from camera_calibrator import CameraCalibrator
from drawing_helpers import draw_vertical_line, draw_corners, draw_grid
from coordinate_map... |
import pickle
import random
from search.rm_search.params import *
import search.rm_search.utils.model_utils as m_util
from search.rm_search.utils.model_utils import set_random_seed
from search.rm_search.model_helpers import BookKeeper
from search.rm_search.predictor.model_perf_predictor import *
from search.rm_search.p... |
# Adapted from the quickstart example at https://developers.google.com/youtube/v3/quickstart/python
import os
import json
import argparse
import google.oauth2.credentials
import youtube_dl
import isodate
import datetime
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from google... |
"""apropos_qt5.py
presentation layer and most of the application logic, Qt5 version
"""
import sys
import PyQt5.QtWidgets as QTW
import PyQt5.QtGui as gui
## import PyQt5.QtCore as core
import apropos.shared as shared
languages = shared.languages
def main(fname='', title=''):
"""starts the applicati... |
# -*- coding: utf-8 -*-
"""The Base DependentVariable class."""
from __future__ import division
from __future__ import print_function
import base64
import warnings
from copy import deepcopy
import numpy as np
from .download import get_relative_url_path
from .sparse import SparseSampling
from csdmpy.units import chec... |
# Demonstrate isometric coordinate mapping
# by KidsCanCode 2015
# For educational purposes only
import pygame
# ptext module for pygame text rendering and formatting
import ptext
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Ortho vs. Iso Coordinates")
clock = pygame.time.Cloc... |
#!/usr/bin/env python
from __future__ import print_function
import sys
from .utils import error
if sys.version_info < (2, 5):
error("Must use python 2.5 or greater.")
import string
from copy import copy
from subprocess import CalledProcessError
from .compiler import load
from .kinetics import read_design, test_kin... |
# No shebang line, this module is meant to be imported
#
# Copyright 2015 Ambient Entertainment GmbH & Co. KG
# Copyright 2015 <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
#
# ht... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from .build import build_server
from . import errors
from . import pilot
from . import db
from .context import Context
from . import tags
from .tags import cookie
from .logtools import LoggerFile
from .... |
# pylint: disable=arguments-differ, redefined-builtin, missing-docstring, no-member, invalid-name, line-too-long, not-callable
import collections
import torch
import torch_geometric as tg
import numpy as np
import ase.neighborlist
from e3nn import o3, rs
from e3nn.tensor import SphericalTensor
class DataNeighbors(t... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 29 2013
@author: <NAME>
Modified: <NAME> (10.03.2017)
- Put functions into corresponding classes
- Introduced compatibility with .eos files
"""
import os
import re
import collections
import numpy as np
from struct import Struct
_uint_from_bytes... |
import json
import os
import pickle
from functools import partial
from typing import List
import tensorflow as tf
from absl import flags
from tqdm import tqdm
from multiprocessing import Pool
from data_utils import get_bin_sizes, create_ordered_tfrecords
from vocabulary_bpe import get_encoder, Encoder
def preproces... |
# -*- coding: utf-8 -*-
import logging
import re
import typing # noqa
import requests # noqa
from google.protobuf.descriptor import Descriptor # noqa
from google.protobuf.message import Message # noqa
from clarifai.rest import http_client
from clarifai.rest.grpc.custom_converters.custom_dict_to_message import dic... |
from contextlib import contextmanager
import pg8000
from translators import sql_translator
from translators.sql_translator import NGSI_ISO8601, NGSI_DATETIME, \
NGSI_GEOJSON, NGSI_TEXT, NGSI_STRUCTURED_VALUE, TIME_INDEX, \
METADATA_TABLE_NAME, FIWARE_SERVICEPATH, TENANT_PREFIX
import geocoding.geojson.wktcodec
... |
import datetime
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponse
from billing import CreditCard, get_gateway
from billing.gateway import CardNotSupported
from app.forms import CreditCardForm
fr... |
# Module: containers.metrics.time_series
# Author: <NAME> (Yard1) <<EMAIL>> and <NAME> <<EMAIL>>
# License: MIT
# The purpose of this module is to serve as a central repository of time series metrics. The `time_series` module will
# call `get_all_metrics_containers()`, which will return instances of all classes in thi... |
#!/usr/bin/python3
"""dynamically configure an HTCondor node from a git repository"""
from typing import Union, List, Iterator, Optional, Dict, Any
import sys
import os
import argparse
import logging
import subprocess
import time
import json
import functools
import re
import random
import filelock
from pathlib import ... |
# import libraries
import sys
print(sys.path)
import fastai
from fastai import *
from fastai.text import (
TextList, language_model_learner, AWD_LSTM, text_classifier_learner, TextLMDataBunch, load_learner,
accuracy, FBeta, Precision, Recall
)
import pandas as pd
import numpy as np
import os
import glob
import ... |
import re
from . import models
from blog import paginatorPage
from .forms import CommentForm
from django.conf import settings
from django.utils import timezone
from django.contrib import messages
from django.http import JsonResponse
from notifications.signals import notify
from django.template import RequestContext
fro... |
def iterative_matrix_multiplication(matrix_1,matrix_2): #Iterative Multiplication O(n^3)
"""
input: (matrix_1, matrix_2) of dimensions lxm and mxn respectively
output (matrix) of dimensions lxn, the product of the two input matrices
"""
product=[[0 for c in range (len(matrix_2[0]))]for r in range(len(matrix_1))]
... |
#!/usr/bin/env python3
"""Generate test data for PSA cryptographic mechanisms.
"""
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0
#
# 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 o... |
#!/usr/bin/env python3
import os
import argparse
import subprocess
import pickle
import time
import datetime
from argparse import RawTextHelpFormatter
kernel_tuning = {
# Increase size of file handles and node cache
"fs.file-max": 2097152,
# Do less swapping
"vm.swappiness": 10,
"vm.dirty_ratio": 6... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class GetClusterResult:
"""
A... |
import os
import pytest
import numpy as np
import PyCosmic
@pytest.fixture()
def array1():
test_array1 = np.ones((6,6),dtype = np.float32) * 4
test_array1[0:3,0:3] = 16.0
return test_array1
@pytest.fixture()
def array2():
test_array2 = np.ones((6,6),dtype = np.float32)*2
return test_array2
@pytes... |
# MIT License
# Copyright (c) 2019 kaiJIN
# 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... |
from main import db,ma
import datetime as d
from flask import current_app
class User(db.Model):
id = db.Column(db.Integer,nullable=False,primary_key=True)
first_name = db.Column(db.String(100))
last_name = db.Column(db.String(100))
email = db.Column(db.String(100))
profile_pic = db.Column(db.String... |
__doc__ = """Core package code for ``touketsu``.
Contains the decorators and decorator factory that are the package's lifeblood.
"""
from abc import ABCMeta
from copy import deepcopy
from inspect import signature
from functools import wraps
import warnings
from .utils import classdocmod
# set up warnin... |
import numpy as np
from tqdm import tqdm
import random
import copy # array-copying convenience
import sys # max float
class particle(object):
"""
fitenessFunction : must be like, and returns a float from 0 to inf, the smaller means the better
result = fitenessFunction(self.Space(self.antsVertice... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: optimizeLearning.py
# Project: NN
#-----
# Created Date: Sunday 17.01.2021, 11:25
# Author: Apop85
#-----
# Last Modified: Sunday 17.01.2021, 13:24
#-----
# Copyright (c) 2021 Apop85
# This software is published under the MIT license.
# Check http://www.ope... |
"""This XBlock provides an HTML page fragment to display a button
allowing the course user to launch an external course container
via Appsembler Virtual Labs (AVL or "Wharf").
"""
import pkg_resources
import logging
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.sites.mod... |
"""
File: blur.py
Author: <NAME>
-------------------------------
This file shows the original image first,
smiley-face.png, and then compare to its
blurred image. The blur algorithm uses the
average RGB values of a pixel's nearest neighbors
"""
from simpleimage import SimpleImage
# Controls the times for blurring im... |
# Copyright 2018 The Fuego Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
from hackdayproject.repo.models import Commit
from django.conf import settings as conf
from django.utils import timezone
import requests
now = timezone.now()
def get_user_data(username):
'''Github 사용자 정보 반환
Args:
username : Github으로 로그인한 사용자 이름
Returns:
값을 가져오는데 성공했을 경우 Dict
값을 ... |
#
#Copyright (c) 2012-2021, NVIDIA CORPORATION.
#SPDX-License-Identifier: Apache-2.0
import gevent
import gevent.pool
import gevent.monkey
gevent.monkey.patch_socket()
gevent.monkey.patch_ssl()
gevent.monkey.patch_time()
import os
import re
import sys
import time
import signal
import logging
import msgpack
import zmq... |
# -*- coding: utf-8 -*-
"""
--Do we need this file?--
Created on Mon Jul 22 13:50:39 2019
@author: nrandle
@co-author: Frankie & Sasha
"""
import os
import sys
import const
from sklearn.model_selection import train_test_split, StratifiedKFold
from sklearn import tree,metrics
from sklearn.svm import SVC
from sklearn.... |
#!/usr/bin/env python
import logging
import time
import base
from kcaa import kcsapi
from kcaa import screens
import organizing
logger = logging.getLogger('kcaa.manipulators.shipyard')
class BuildShip(base.Manipulator):
def run(self, fuel, ammo, steel, bauxite, grand, material):
fuel = int(fuel)
... |
# Copyright (c) 2021 PaddlePaddle 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 app... |
# Copyright (c) 2011, <NAME> [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
# Python 2 to 3 workarounds
import sys
if sys.version_info[0] == 2:
_strobj = str
_xrange = xrange
elif sys.version_info[0] == 3:
_strobj = str
_xrange = range
# std lib
import math
from colle... |
# Copyright 2021-present, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from torch.optim import Adam
from utils.ring_buffer import RingBuffer
from datasets import get_dataset
from u... |
#!/bin/bash
# https://github.com/rishikeshadusumilli/TCP-based-Round-Robin-Load-Balancer/blob/master/loadBalancer13.py
# Code adopted and implemented from Nippon Telegraph and Telephone Corporation.
# Code adopted and implemented from simple_switch_13.py
# Copyright <NAME>
# Licensed under the Apache License, Version... |
import socket,threading,subprocess,json,os,time,base64,random,shutil,uuid,hashlib
from result_name import *
compiler={"pas":["fpc","-O1","-Co","-Cr","-Ct","-Ci"],"c":["gcc","-otemp","-O2","-Wall","-lm","--static","-std=c99","-DONLINE_JUDGE"],"cpp":["g++","-otemp","-O2","-Wall","-lm","--static","-DONLINE_JUDGE"]}
def an... |
import time, threading, json
import json_patch
debug = lambda *a: a
# debug = print
class JavaScriptError(Exception):
pass
# This is the Executor, something that sits in the middle of the Bridge and is the interface for
# Python to JavaScript. This is also used by the bridge to call Python from Node.js.
class ... |
# MIT 6.034 Lab 7: Neural Nets
# Written by 6.034 Staff
from nn_problems import *
from math import e
INF = float('inf')
#### Part 1: Wiring a Neural Net ###############################################
nn_half = [1]
nn_angle = [2,1]
nn_cross = [2,2,1]
nn_stripe = [3,1]
nn_hexagon = [6,1]
nn_grid = [4,2,1]
###... |
"""Message objects that represents HTTP messages."""
__all__ = ['HTTPMessage', 'HTTPRequestMessage', 'HTTPResponseMessage']
import cgi
import codecs
import http.client
import http.cookies
import io
import urllib.parse
import wsgiref.headers
from http import HTTPStatus
from . import exceptions
from . import utils
... |
#!/usr/bin/env python
"""
Root script to run CoCoNet
"""
from pathlib import Path
import numpy as np
import torch
from coconet.log import setup_logger
from coconet.core.config import Configuration
from coconet.parser import parse_args
from coconet.fragmentation import make_pairs
from coconet.dl import load_model, tra... |
from src.tindeq import TindeqProgressor
from src.analysis import analyse_data
import time
import numpy as np
import asyncio
import tornado
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
from bokeh.plotting import figure, ... |
import sys
import glob
import os
import csv
import json
import copy
import random
import code
import networkx as nx
folder = 'input'
output_folder = 'output'
file_type = '*.csv'
class Survey:
conversed_with = []
met_facetoface = []
knowledge_source = []
personal_advice = []
hangout = []
goto... |
# Copyright (C) 2021 <NAME> (ghcollin)
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE.txt file for details.
import struct
import multiprocessing
import threading
from contextlib import contextmanager
import numpy as np
import sys
_PYTHON3 = sys.version_info > ... |
#!/usr/bin/env python
# Generate a Markdown table of all lints, and put it in README.md.
# With -n option, only print the new table to stdout.
# With -c option, print a warning and set exit status to 1 if a file would be
# changed.
import os
import re
import sys
declare_lint_re = re.compile(r'''
declare_lint! \s*... |
import matplotlib.pyplot as plt
import os
from collections import namedtuple
import pandas as pd
import seaborn as sns
import math
DATA_DIRECTORY = "data/"
FIGURE_DIRECTORY = "figures/"
CSV_DIRECTORY = "processed_data/"
def import_csv():
Measurement = namedtuple("Measurement", ['distance', 'phy', 'tx_power', 'rs... |
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, redirect
from pubby.config import getconfig
from SPARQLWrapper import SPARQLWrapper, JSONLD
from rdflib import URIRef, BNode, Literal
from urllib.parse import unquote
import regex as re
# Create your views here.
class Reso... |
# -*- coding: utf-8 -*-
# @Time : 2021/8/25
# @Author : <NAME>
# @GitHub : https://github.com/lartpang
import argparse
import importlib.util
import os
import sys
from itertools import chain
import numpy as np
parser = argparse.ArgumentParser(
description="A useful and convenient tool to convert your .npy re... |
"Parser for endplay formatted JSON files"
from __future__ import annotations
__all__ = ["JSONEncoder", "JSONDecoder", "dump", "dumps", "load", "loads"]
import json as _json
from enum import IntEnum
from collections.abc import Collection, Mapping
from endplay.types import ContractBid, PenaltyBid, Denom, Pena... |
from pathlib import Path
import dask
import dask.array as da
from dask.array.core import normalize_chunks
from dask.base import tokenize
import numcodecs
import numpy as np
import warnings
from daskms.constants import DASKMS_PARTITION_KEY
from daskms.dataset import Dataset, Variable
from daskms.dataset_schema import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This code is under MIT license. See the License.txt file.
This module contains the functions useful to numerically solve the model
<NAME>
<EMAIL>
"""
import numpy as np
from Metabolisme.Energy import *
from Metabolisme.Rates import *
from PBE.Balancefun import *
#fr... |
# General
import matplotlib.pyplot as plt
import numpy as np
# Computer vision library
import cv2
# Scikit Learn
from sklearn.cluster import MiniBatchKMeans
# Others
from PIL import Image
def image_size(image_name, path):
"""
Method used to get the image size
Parameters:
-----------------
... |
from copy import copy
from hstest import StageTest, dynamic_test, TestedProgram, CheckResult
from test.enum import GameState, CellState
from test.grid import Grid
from test.minimax import Minimax
class Test:
def __init__(self, inp, result, state, additional_contains=None):
self.inp = inp
self.re... |
#!/usr/bin/python
import sys
import tensorflow as tf
import numpy as np
# import matplotlib.pyplot as plt
import pandas as pd
import requests
import json
from datetime import datetime
tf.set_random_seed(777) # reproducibility
global_step = tf.Variable(0, trainable=False, name='global_step')
print('========== [Est... |
# -*- coding: utf-8 -*-
from . backend import Backend
from .. message import Message, MessageType
class RunTimeErrorHandler:
def __init__(self):
self.MAX_ERRORS = 5
self.error_count = 0
def get_error_count(self):
return self.error_count
def flag(self, node, error_code, backend):
... |
"""랩 파일에서 출력용 문서 생성."""
import os
from io import StringIO
import textwrap
import shutil
from tabulate import tabulate
from jinja2 import Environment, FileSystemLoader
from wcwidth import wcswidth
from loglab.model import build_model
from loglab.util import explain_rstr, LOGLAB_HOME, absdir_for_html, \
get_object_... |
import json
import graphene
from graphene import resolve_only_args
from datetime import datetime, timedelta
from dateutil.parser import parse as parse_date
from greent.core import GreenT
from greent.translator import Translation
# http://graphql.org/learn/introspection/
'''
class ExposureInterface (graphene.Interface... |
import math
import numpy as np
import torch
from torch import nn
from torch.nn import init
from torch.autograd import Variable
import torch.nn.functional as F
import torch.optim.lr_scheduler as lr_scheduler
import utils
# from utils import pos2id, ner2id, PAD_ID, MAX_LEN
class PositionAwareRNN(nn.Module):
""" A seque... |
import time
from homeassistant.components.climate.const import (
PRESET_AWAY,
PRESET_ECO,
PRESET_HOME,
PRESET_NONE,
PRESET_SLEEP,
)
from homeassistant.core import HomeAssistant
from homeassistant.config_entries import ConfigEntry
from homeassistant.components.climate import ClimateEntity
from homeas... |
#!/usr/local/bin/python3
# Copyright (c) KMG. 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
##
# sbk_charts : Stora... |
import logging
from lumapps.helpers.exceptions import (
NotAuthorizedException,
BadRequestException,
MissingFieldException,
)
from googleapiclient.errors import HttpError
def authorization_decorator(func):
def func_wrapper(api, user, **kwargs):
# type: (ApiClient, User, dict) -> Union[boolean,... |
"""
Cycle decomposition code, adapted from pytorch geometric.
"""
import torch
import torch_geometric.data
import torch_geometric.utils
from itertools import chain
from copy import deepcopy
from autobahn.utils import mol_from_data, bonds, _get_edge_loc
from typing import List
try:
import rdkit.Chem as Chem
f... |
import os
import torch
import numpy as np
from utils import *
from models.initial_mesh import generate_initial_mesh
from models.kaolin_wrapper import load_obj, write_obj_mesh
from torchvision.utils import save_image
from models.encoder import *
from models.rendering import *
from models.loss import *
from kornia.fea... |
from pathlib import Path
from uteis import *
from uteis.textos import *
def bt_armeno():
global bandeira_armeno
bandeira_armeno = PhotoImage(file="img/armenia.png")
janela = JanelaIdioma("Armênio", armeno, bandeira_armeno).criar_janela()
def bt_arabe():
global bandeira_arabe
bandeira_arabe = Ph... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
from pwn import *
context(arch="amd64", os="linux")
if not args["REMOTE"]:
binary = ELF("./aliensVSsamurais-amd64-2.23-0ubuntu10") # https://github.com/integeruser/bowkin
libc = ELF("libs/amd64/2.23/0ubuntu10/libc-2.23.so")
argv = [binary.path]
... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2018 Spotify 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... |
""" modules.dataset.py
Summary
-------
This module contains the MNIST dataset class and related functions.
Classes
-------
MNIST
implements the MNIST dataset class
Functions
---------
is_downloadable()
checks if a url contains downloadable resource
download()
downloads a `.gz` file from a url and saves ... |
import sublime, sublime_plugin
import re
def get_settings():
return sublime.load_settings("DoxyDoc.sublime-settings")
def get_setting(key, default=None):
return get_settings().get(key, default)
setting = get_setting
def get_template_args(templates):
print('Before: {0}'.format(templates))
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.