text stringlengths 957 885k |
|---|
from __future__ import division
import Test_internal_clashscore
import os,sys
'''
Collect clash information from PROBE in resraints_manager
and compare them
'''
def get_files_data():
'''() -> list,list
reads files
RM_clash_results
PROBE_clash_results
in folder: C:\Phenix\Dev\Work\work\Clashes\junk
R... |
<gh_stars>0
import os
import json
import argparse
import logging
import datetime
import shutil
import sys
import six
from colorlog import ColoredFormatter
def _setup_logging(verbosity):
"""
Setup logging with desired verbosity
:param verbosity:
:return:
"""
logging.getL... |
"""
Copyright 2010 IO Rodeo 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 writing, software... |
<filename>TD3.py
import gym
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import collections
import random
import numpy as np
import copy
class ReplayBuffer():
def __init__(self):
self.buffer = collections.deque(maxlen=buffer_limit)
def put(self, tran... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from unittest import TestCase
try:
import numpy as np
from scipy.sparse import csr_matrix
except ImportError:
pass
from jubakit.classifier import Schema, Dataset, Classifier, Config
from jubakit.compat i... |
<filename>src/metanetx_post/cli/reaction/expasy.py
# Copyright (c) 2020, <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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import random
import Convergence
from labellines import labelLines
matplotlib.use('TkAgg')
H0 = 70.0
c = 2.998E5
RADII = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7,
0.8, 0.9, 1.0, 1.25, 1.5, 1.75, 2.0,
2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75,... |
#!/usr/bin/env python3
"""
This is a script to append an Archivematica UUID as
an Internal-Sender-Identifier to existing born-digital bags.
When run this will create a "target" folder in the same directory
to work within. It will leave "some_bag_id.log" files for each
bag it migrates.
"""
import datetime
import hashl... |
import unittest
import numpy as np
import scipy.signal
import ibllib.dsp.fourier as ft
from ibllib.dsp import WindowGenerator, rms, rises, falls, fronts, smooth, shift, fit_phase,\
fcn_cosine
class TestDspMisc(unittest.TestCase):
def test_dsp_cosine_func(self):
x = np.linspace(0, 40)
fcn = f... |
# built-in
from itertools import islice, permutations, repeat
from math import log
# app
from .base import Base as _Base, BaseSimilarity as _BaseSimilarity
from .edit_based import DamerauLevenshtein
# python3
try:
from functools import reduce
except ImportError:
pass
__all__ = [
'Jaccard', 'Sorensen', ... |
<reponame>mahen92/Hyperledger-Cookbook
# Copyright 2017 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 require... |
<reponame>shyams2/pychebfun
#!/usr/bin/env python
# coding: UTF-8
from __future__ import division
import os
import sys
import unittest
import numpy as np
import numpy.testing as npt
import pychebfun
from pychebfun import Chebfun, chebfun
from . import tools
import pytest
np.seterr(all='raise')
def segment(x):
... |
import sys
import os
import json
import unittest
import bs4
import re
sys.path.append(os.path.abspath('../'))
import r2api.converter.allacciate_il_grembiule as ag
file_path = os.path.abspath(os.path.dirname(__file__))
path_to_soup1 = os.path.join(file_path, "soups/AGSoup1.html")
path_to_json1 = os.path.join(file_pat... |
<reponame>bpsinc-native/src_third_party_chromite<filename>cbuildbot/commands.py
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing the various individual commands a builder can run... |
<reponame>AllynH/Destiny_Read_Characters_Inventory_Vault
###################################################################################################
# Introduction: This program starts the foundation for an inventory management system - by doing 2 things:
# 1. Reads a characters equipped items and prints the... |
from os.path import abspath, basename, dirname, join
from firedrake import *
from incflow import *
import numpy as np
import pytest
set_log_level(DEBUG)
cwd = abspath(dirname(__file__))
data_dir = join(cwd, "data")
k = 0.02537 # W/(m*K)
rho = 1.225 # kg/m^3
cp = 1005.0 # J/(kg*K)
nu = 1.789 / rho * 1e-5 # m^2/s
g = ... |
#!/usr/sbin/env python
import click
import ipaddress
import json
import jsonpatch
import netaddr
import netifaces
import os
import re
import subprocess
import sys
import time
import itertools
from collections import OrderedDict
from generic_config_updater.generic_updater import GenericUpdater, ConfigFormat
from minig... |
<reponame>NickHerrig/bronzebeard<gh_stars>0
import argparse
from collections import namedtuple
from ctypes import c_uint32
from functools import partial
import re
import struct
import sys
REGISTERS = {
'x0': 0, 'zero': 0,
'x1': 1, 'ra': 1,
'x2': 2, 'sp': 2,
'x3': 3, 'gp': 3,
'x4': 4, 'tp': 4,
... |
<reponame>cuauv/software<gh_stars>10-100
from mission.framework.primitive import (
Zero,
Log,
AlwaysLog,
Succeed,
Fail,
FunctionTask,
NoOp
)
from mission.framework.combinators import (
Sequential,
Concurrent,
MasterConcurrent,
Retry... |
# -*- coding: utf-8 -*-
"""! OPM Config library.
@author zer0
@date 2015-12-16
"""
import xml.etree.ElementTree as ET
import xml.dom.minidom
import version as VER
TAG_ROOT = 'opm'
TAG_REMOTE = 'remote'
TAG_PROTOCOL = 'protocol'
TAG_USER = 'user'
TAG_HOST = 'host'
TAG_PORT = 'port'
TAG_PATH = ... |
<gh_stars>0
import os
from moviepy.video.io.VideoFileClip import VideoFileClip
import numpy as np
from typing import Union
from django.conf import settings
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import InMemoryUploadedFile... |
<reponame>fantomnotabene/pyatv
"""Implementation of the MediaRemoteTV Protocol used by ATV4 and later."""
import logging
from .. import (const, exceptions)
from . import (messages, protobuf)
from .srp import SRPAuthHandler
from .connection import MrpConnection
from .protocol import MrpProtocol
from .pairing import Mr... |
from typing import *
from gym import Env, spaces
import numpy as np
from numba import njit
import ray
from ray.tune.logger import pretty_print
from ray.rllib.env import BaseEnv
from ray.rllib.agents.trainer import Trainer
from ray.rllib.agents.callbacks import DefaultCallbacks
from ray.rllib.models import Mo... |
#!/usr/bin/env python
import rospy
from time import sleep
from smach import State, StateMachine
from nav_msgs.msg import Odometry
from smach_ros import SimpleActionState, IntrospectionServer
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from vortex_msgs.msg import LosPathFollowingAct... |
import os
from ctypes import (
addressof,
byref,
c_char,
c_double,
c_int,
c_long,
c_longlong,
c_ubyte,
c_ushort,
create_string_buffer,
pointer,
string_at,
)
from assertpy import assert_that, soft_assertions
import gsfpy3_09.bindings
import gsfpy3_09.enums
from gsfpy3_09... |
<reponame>Jumpscale/sandbox_linux
from js9 import j
from .MarkdownComponents import *
JSBASE = j.application.jsbase_get_class()
class MarkdownDocument(JSBASE):
def __init__(self, content="", path=""):
JSBASE.__init__(self)
if path != "":
content = j.sal.fs.fileGetContents(path)
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import balanced
from braintree.test.nonces import Nonces
import mock
from gratipay.testing.billing import BillingHarness
from gratipay.models.exchange_route import ExchangeRoute
from gratipay.models.participant import Participant
cla... |
<filename>anasymod/plugins.py<gh_stars>10-100
import os
from anasymod.sources import Sources, VerilogHeader, VerilogSource, VHDLSource
from anasymod.defines import Define
from anasymod.enums import ConfigSections
from anasymod.base_config import BaseConfig
class Plugin():
def __init__(self, cfg_file, prj_... |
# coding=utf-8
# Copyright (C) 2020-2021 PowerLZY.
# This file is part of Bold-Falcon - https://github.com/PowerLZY/Bold-Falcon
# See the file 'docs/LICENSE' for copying permission.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset
class MalConv... |
##############################
# Import necessary libraries #
##############################
import numpy as np
from scipy.optimize import fsolve
##################################
# Define various math functions. #
##################################
def norm(v):
return np.sqrt(np.dot(v,v))
def S(z):
re... |
<reponame>eigenphi/gcommon
# -*- coding: utf-8 -*-
# created: 2021-07-29
# creator: <EMAIL>
import collections
import logging
from copy import copy
from datetime import datetime
from types import TracebackType
from typing import (
Any,
AnyStr,
AsyncContextManager,
AsyncGenerator,
Awaitable,
Cal... |
# -*- coding: utf-8 -*-
"""
Created on Tue May 25 14:29:04 2021
@author: alankar
"""
import numpy as np
import matplotlib.pyplot as plt
import h5py
from operator import itemgetter
from decimal import Decimal
def fexp(number):
(sign, digits, exponent) = Decimal(number).as_tuple()
return len(dig... |
import inspect
from operator import methodcaller
from typing import (
TYPE_CHECKING,
Type,
Mapping,
Tuple,
Optional,
Set,
Dict,
Any,
)
from typic.checks import ismappingtype, isiterabletype, isliteral
from typic.compat import lru_cache
from typic.gen import Block, Keyword, ParameterKind... |
# -*- coding: utf-8 -*-
from django.middleware.cache import UpdateCacheMiddleware, FetchFromCacheMiddleware
from django.core.cache import cache
from django.conf import settings
from django.utils.encoding import iri_to_uri
from django.utils.cache import get_max_age, patch_response_headers
from django.utils.translation i... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2022, <NAME>"
__credits__ = ["<NAME>"]
__license__ = "mit"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
from ..token.PDFToken import PDFToken
from .PDFItem import PDFItem
from .PDFNull import PDFNull
# Hints when there is no need to insert a space between two items... |
<filename>web/core/models.py
import datetime
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.contrib.auth import get_user_model
import hashlib
usermodel = get_user_model()
class Entity(models.Model):
PRODUCER = 'Producteur'
OPERATOR = 'Opérateur'
... |
<filename>Bonus-materials/Anomaly/train.py
import numpy as np
import mxnet as mx
from mxnet import gluon
import glob
import argparse
import os
from six import BytesIO, StringIO
out = 10
class ConvolutionalAutoencoder(gluon.nn.HybridBlock):
def __init__(self):
super(ConvolutionalAutoencoder, ... |
<reponame>MChaus/NeoRender_test_task<gh_stars>1-10
import os
import zipfile
import urllib.request
import torch
import skimage.measure
from .deep_sdf import Decoder
def marching_cubes(
decoder,
latent_vec,
level =0.0,
N=256,
max_batch=32 ** 3
):
''' Return verts, faces, normals, values for g... |
import asynctest
import pytest
from dbdaora import Query
from dbdaora.exceptions import EntityNotFoundError
@pytest.mark.asyncio
async def test_should_get_from_memory(
repository, serialized_fake_entity, fake_entity
):
await repository.memory_data_source.set(
'fake:fake', serialized_fake_entity
)... |
import constant
import utils
import os
import sys
import subprocess
import json
import argparse
import time
import copy
from optparse import OptionParser
class Collector:
def __init__(self, module):
self.module = module
self.getter_record_file = "results/%s/logs/getter-record" % (module)
s... |
from IPython.display import display
import json
import pandas as pd
import requests
import time
NAVERSHOPPING_CATEGORY_URL = "https://search.shopping.naver.com/api/category/"
KAKAOSHOPPING_CATEGORY_URL = "https://shoppinghow.kakao.com/v1.0/category.json"
AUCTION_CATEGORY_URL = "http://script.auction.co.kr/common/heade... |
"""
Parse raw file content into workable streams.
"""
from __future__ import annotations
from functools import singledispatch
from pathlib import Path
from typing import Final, Iterable, Iterator, List, Optional
from loguru import logger
from music21 import converter, exceptions21, instrument
from sarada import musi... |
from xnas.search_space.mb_layers import *
import numpy as np
def int2list(val, repeat_time=1):
if isinstance(val, list) or isinstance(val, np.ndarray):
return val
elif isinstance(val, tuple):
return list(val)
else:
return [val for _ in range(repeat_time)]
def build_candidate_ops(... |
from pathlib import Path
import io
import os
import numpy as np
import cv2
import hashlib
import urllib
import shutil
import gzip
import tarfile
import zipfile
import warnings
import inspect
from abc import ABCMeta, abstractmethod
from cv2 import IMREAD_COLOR, IMREAD_GRAYSCALE, IMREAD_UNCHANGED
from lxml.etree import E... |
"""Determine quadcopter's pose using a pair of Aruco fiducial makers."""
__author__ = "<NAME>"
__copyright__ = "Copyright 2019, <NAME>"
__credits__ = ["<NAME>"]
__license__ = "BSD 3-Clause License"
__version__ = "1.0.0"
__status__ = "Development"
import math
import numpy as np
import cv2
from cv2 import aruco
class ... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pickle
from sklearn.linear_model import LinearRegression, LassoCV, ElasticNetCV, RidgeCV
from scipy.stats.stats import pearsonr
from scipy.stats import truncnorm
from scipy import st... |
<reponame>grossmann-group/pyomo-MINLP-benchmarking
# MINLP written by GAMS Convert at 05/15/20 00:50:53
#
# Equation counts
# Total E G L N X C B
# 3081 447 0 2634 0 0 0 0
#
# Variable counts
# ... |
<reponame>phil65/PrettyQt
from __future__ import annotations
from typing import Literal
from prettyqt.qt import QtGui
from prettyqt.utils import InvalidParamError, bidict, mappers, types
mod = QtGui.QImageIOHandler
IMAGE_OPTION = bidict(
size=mod.ImageOption.Size,
clip_rect=mod.ImageOption.ClipRect,
sc... |
from django.conf.urls import url, include
from django.views.generic import RedirectView
from . import views
app_name = 'administrator'
urlpatterns = [
#Regular Expression r'regularExprsHere'
# /login/
url(r'^$', views.loginindex, name='loginindex'),
url(r'^blog/$', views.viewlogin, name='viewlogin'),
... |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online # noqa: E501
OpenAPI spec version: 0.8.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
impo... |
<gh_stars>100-1000
import pytest
@pytest.fixture(scope="module")
def setup_fpm_fixture(host, request):
print('Backing up current fpm configuration')
host.run("cp /usr/local/etc/php-fpm.d/zz-docker.conf /tmp/zz-docker.conf")
yield 1
print('Recovering fpm configuration and reloading after module')
ho... |
import zborderframe
import zlabel
import zcheckbox
import zlineedit
import zwall
import zutils
class findingbot:
def __init__(self, ignore_case, is_regex, lines, cursor, search_for ):
self.ignore_case = ignore_case
self.is_regex = is_regex
self.text = "\n".join(lines)
cx = cursor[0]
cy = cursor[1]
self.c ... |
import sqlite3
import requests
import time
import json
from bs4 import BeautifulSoup
import regex
from helper_class.chrome_driver import create_driver, quit_driver
from helper_class.country_names import find_all_iso
from helper_class.wiki_visa_parser import wiki_visa_parser
from lib.database import Database
from helper... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016-2018
# Author: <NAME> (<EMAIL>)
# file: io_gml_format.py
"""
Reading and writing graphs in LEDA format (.gw, .lgr).
The Library of Efficient Data types and Algorithms (LEDA) is a propitiatory
licensed software library providing C++ implementations of a br... |
"""
playing around with fbprophet
"""
import datetime as dt
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from fbprophet import Prophet
from scipy.stats import boxcox
from scipy.special import inv_boxcox
from rich import print
columns = ["created_at", "id"]
tic = dt.datetime.now()
_df = pd.re... |
<reponame>Delay-Xili/F-Clip<filename>FClip/models/__init__.py
# flake8: noqa
from .hourglass_pose import hg
from .pose_hrnet import get_pose_net as hr
from .hourglass_line import hg as hgl
from FClip.config import M
import torch.nn as nn
import torch
# from torchvision.ops.deform_conv import DeformConv2d
class LineHe... |
<gh_stars>0
"""
CANNR TM analytics container building tool example showing Python function that
decides whether someone can be scheduled for a hypothetical vaccine for a
hypothetical disease, based on risk factors.
Copyright 2021 <NAME> <EMAIL>
All rights reserved
Maintainer <NAME> <EMAIL>
"""
import numpy
import math... |
<gh_stars>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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... |
<reponame>bsimons/django-fiber
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase, SimpleTestCase
from fiber.models import Page, ContentItem, PageContentItem
from ...test_util impor... |
#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Converts profile datasets to dictionary list for Autofill profiles.
Used for test autofill.AutofillTest.testMergeDuplicate... |
"""
Tests scripts in the DBM folder
"""
import os
import pylearn2.scripts.dbm.show_negative_chains as negative_chains
import pylearn2.scripts.dbm.show_reconstructions as show_reconstruct
import pylearn2.scripts.dbm.show_samples as show_samples
import pylearn2.scripts.dbm.top_filters as top_filters
from pylearn2.config... |
"""
Description: This script generates ASYMP for baselines
# NOTE: For this, we're not sharing the actual patient data, so comment out Strategy3
"""
from utils.networkx_operations import *
from utils.pandas_operations import *
from utils.time_operations import *
import pandas as pd
import numpy as np
import argparse
... |
<filename>util.py<gh_stars>1-10
#!/usr/bin/python
import numpy as np
import mido
import itertools
import math
import sys
#np.set_printoptions(formatter={'float': lambda x: str(x)+ '\t'})
NUM_FEATURES = 12
NUM_NOTES = 128
segmentedBeatsMidiFileCache = {}
# IMPORTANT: we assume the midi file has only one track!
# (... |
from game import Game
import random
import sys
import time
class RandomPlayer:
def __init__(self):
data = sys.stdin.readline().strip().split() # Initialize Environment
self.player = int(data[0]) - 1 # player can have values 0 and 1
self.n = int(data[1]) # n can have values 5, 6, or 7
self.time_left = int(dat... |
<gh_stars>0
import psycopg2
from datetime import datetime
class Funcionario:
def __init__(self,nome,email,senha,login):
self._nome = nome
self._email = email
self._login = login
self._senha = senha
def _get_nome(self):
return self._nome
def _get_email(self):
... |
# Copyright (C) 2016 maxn <EMAIL>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
author: Unknown (!UNKNOWN)
name: jabbe... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\socials\jigs\jig_utils.py
# Compiled at: 2019-01-17 04:01:59
# Size of source mod 2**32: 13821 bytes... |
<filename>saltred/saltarith.py
#! /usr/bin/env python
"""
saltarith is a copy of IRAF's imarith routine
but designed to deal with SALT's multi extension
data in a smart way.
Author Version Date
-----------------------------------------------
<NAME> (Madison) 1.0 16 July 2012
... |
import random
try:
import network
except ImportError:
from back import entity
try:
from ai import network
except ImportError:
from back.ai import network
VERBOSE = __name__ == '__main__'
class GenericAI:
def __init__(self, captors=4, neurones=4, choices=5, layer=2):
self.score = 0
... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 1 17:41:15 2019
@author: Asus
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
dist_g_fn = lambda x,G_total: 1.0*(x.sum()+0.5) / G_total
dist_b_fn = lambda x,B_total: 1.0*(x.sum()+0.5) / B_total
n_fn = lambda x: x.sum()
def cal... |
<filename>sktime/forecasting/base/tests/test_fh.py
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Tests for ForecastingHorizon object."""
__author__ = ["mloning"]
import numpy as np
import pandas as pd
import pytest
from pytest import raises
from sktime.forecasting... |
import logging
import sys
import traceback
from pycollisionavoidance.raycast.Point import LineSegment, Dot
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler('/tmp/walkgen.log')
handler.setLevel(logging.ERROR)
formatter = logging.Formatter('%(levelname)-8s-[%(filename)s:%... |
<filename>ML_functions.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 28 2020
@author: <NAME>
"""
import numpy as np
import joblib
import pickle
from scipy import linalg
from scipy import sparse
import pyfftw
def create_HP_filt(flength,cutoff,TR):
cut=cutoff/TR
sigN2=(cut/np.sqrt(2)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Spoony'
SITENAME = 'Full Stack Troubles'
SITESUBTITLE = 'Notes and descriptions in my day by day job issues'
SITEURL = ''
PATH = 'content'
DEFAULT_DATE = 'fs'
TIMEZONE = 'Europe/Madrid'
DEFAULT_LANG = 'en'
# Feed gen... |
#!/usr/bin/env python3
import os
import sys
from datetime import datetime, timedelta
from math import acos, sin, cos, radians
from operator import attrgetter
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
from shutil import copyfile
class ImageMeta():
def __init__(self, file_path, file_dir, file_na... |
################################################################################
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your op... |
<gh_stars>0
"""
Test epsagon init
"""
import mock
import epsagon
import os
from imp import reload
from epsagon.trace_transports import HTTPTransport
@mock.patch('epsagon.patcher.patch_all')
@mock.patch('os.getenv', side_effect=(lambda x: {
'EPSAGON_HANDLER': None,
'DISABLE_EPSAGON': 'FALSE',
'DISABLE_EPSA... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... |
<reponame>philip-dds/atst
import datetime
from sqlalchemy.orm.exc import NoResultFound
from atst.database import db
from atst.models import ApplicationInvitation, InvitationStatus, PortfolioInvitation
from atst.domain.portfolio_roles import PortfolioRoles
from atst.domain.application_roles import ApplicationRoles
fro... |
<filename>pylbm/generator/ast.py<gh_stars>0
# FIXME: make pylint happy !
#pylint: disable=all
from sympy.core import Symbol, Expr, Tuple
from sympy.core.sympify import _sympify, sympify
from sympy.tensor import Idx, IndexedBase, Indexed
from sympy.core.basic import Basic
from sympy.core.relational import Relational
fr... |
<reponame>cedriczirtacic/avr_instruction_set<gh_stars>0
#!/usr/bin/env python
import requests
import sys
import re
from bs4 import BeautifulSoup as BS
from jinja2 import Template, Environment, PackageLoader
index_url = 'https://www.microchip.com/webdoc/avrassembler/' + \
'avrassembler.wb_instruction_list.html'... |
import HTMLParser
import base64
from contextlib import contextmanager
from functools import wraps
import hashlib
import hmac
import ujson
import re
import urllib
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http.response import HttpResponse
from django.shortcuts ... |
import collections
import gc
import os
from typing import List, Optional, Union, Tuple, Dict, Any
import albumentations
import numpy as np
import pandas as pd
import torch
from hydra.utils import instantiate
from pytorch_toolbelt.inference import (
ApplySigmoidTo,
ApplySoftmaxTo,
Ensembler,
Generalized... |
from collections import defaultdict
from .utils import fix_dataclass_init_docs
from .sim import SimGrid
from .typing import Optional, Callable, Union, List, Tuple, Dict
import jax
import jax.numpy as jnp
from jax.config import config
from jax.experimental.optimizers import adam
import numpy as np
import dataclasses
i... |
import os
import directory
from STAPLERerror import STAPLERerror
from STAPLERerror import VirtualIOError
from GenericBase import GenericBase
import utils
class fastx_toolkit_generic_compressable(GenericBase):
"""Generic class with method for parsing fastx toolkit IO parameters.
Only single type ... |
<reponame>Undo1/Smokey-McSmokeface
import random
from threading import Thread, Lock
from parsing import *
from datahandling import *
from metasmoke import Metasmoke
from globalvars import GlobalVars
import os
import re
import requests
from datetime import datetime
from utcdate import UtcDate
from apigetpost import api_... |
<filename>cvnet/models/cls/googlenet.py
# -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description: GoogLeNet model
Inception块相当于一个有4条线路的子网络。它通过不同窗口形状的卷积层和最大池化层来并行抽取信息,并使用1×11×1卷积层减少通道数从而降低模型复杂度。
GoogLeNet将多个设计精细的Inception块和其他层串联起来。其中Inception块的通道数分配之比是在ImageNet数据集上通过大量的实验得来的。
GoogLeNet和它的后继者们一度是ImageNet上最高效的模型之... |
from functools import update_wrapper
import os
import os.path
import shutil
import tempfile
import unittest # noqa
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst import roles
from sphinx.application import Sphinx
# pylint:disable=no-self-use,protected-access,too-few-... |
<filename>src/fp16/fp16util.py
# coding=utf-8
# Copyright (c) 2020, Sber. 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-... |
#!/usr/bin/python3
#
import struct
import os
import sys
import math
def readshort():
return struct.unpack("<H", rom.read(2))[0]
def readbyte():
return struct.unpack("<B", rom.read(1))[0]
def abspointer(bank, offset):
return bank*0x4000+offset-0x4000
def readfarpointers(offse... |
from asyncio.log import logger
from unittest import result
import eventlet
from numpy import broadcast
# from https://github.com/eventlet/eventlet/issues/670
eventlet.monkey_patch(select=False)
import sys
from flask import (
Flask,
request,
render_template,
session,
send_file,
send_from_direct... |
import os
import subprocess
import re
import sys
import requests
from bs4 import BeautifulSoup
import urllib
from ohno.gui import *
import tkinter as tk
from tkinter import ttk
import json
GREEN = '\033[92m'
GRAY = '\033[90m'
CYAN = '\033[36m'
RED = '\033[31m'
YELLOW = '\033[33m'
END = '\033[0m'
UNDERLINE = '\033[4m'... |
import os
from tempfile import TemporaryDirectory
import pystac
from stactools.testing import CliTestCase
from stactools.aafc_landuse.commands import create_aafclanduse_command
from tests import test_data
class CreateItemTest(CliTestCase):
def create_subcommand_functions(self):
return [create_aafclandus... |
from collections import defaultdict
from contextlib import closing
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Optional
import numpy as np # type: ignore
import pandas as pd # type: ignore
from tables import Filters # type: ignore
from tables import open_file
from pullfram... |
# %% [markdown]
'''
# Fit a line with Singular Value Decomposition
'''
# %% [markdown]
'''
Singular value decomposition (SVD) is a widely used method that plays a huge role in data preprocessing for machine learning.
It is mostly used to filter out noise from the data, reduce its dimensionnality/complexity and to have ... |
<filename>tests/parsers/test_jsonstring.py
import os
from langumo.parsers import EscapedJSONStringParser
from langumo.utils import AuxiliaryFile
def _get_resource_path(name: str) -> str:
return os.path.join(os.path.dirname(__file__), 'resources', name)
def test_json_string_parser_extraction():
parser = Esca... |
<filename>fastmri/pl_modules/singlecoil_varnet_module.py
"""
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.
"""
from argparse import ArgumentParser
import fastmri
import torch
from fastmri.data i... |
<gh_stars>0
import datetime
from collections import OrderedDict
from Poem.api import views_internal as views
from Poem.poem import models as poem_models
from Poem.tenants.models import Tenant
from Poem.users.models import CustUser
from django_tenants.test.cases import TenantTestCase
from django_tenants.test.client imp... |
# -*- coding: utf-8 -*-
from os.path import join
import pytest
import matplotlib.pyplot as plt
from numpy import pi
from pyleecan.Classes.Frame import Frame
from pyleecan.Classes.LamHole import LamHole
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.MachineIPMSM import MachineIPMSM
from py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.