text stringlengths 8.04k 46.5k |
|---|
import copy
import math
import re
import types
import spidermonkey
import instanceactions
import instanceproperties
from validator.decorator import version_range
from jstypes import *
def _get_member_exp_property(traverser, node):
"""Return the string value of a member expression's property."""
if node["pro... |
#!/usr/bin/env python
"""
uptux by initstring (gitlab.com/initstring)
This tool checks for configuration issues on Linux systems that may lead to
privilege escalation.
All functionality is contained in a single file, because installing packages
in restricted shells is a pain.
"""
import os
import sys
import getpas... |
# coding=utf-8
# !/usr/bin/python3.6 ## Please use python 3.6
"""
__synopsis__ : Main file to run Extreme Classification. Spectral Graph
Convolutional Layer
__description__ : Spectral Graph Convolutional Layer
__project__ : XCGCN
__author__ : <NAME> <<EMAIL>>
__version__ : ": 0.1 "
__date__ : "08... |
# -*- coding: utf-8 -*-
'''
This is the python code as a re-implementation of the matlab code from:
http://www.openu.ac.il/home/hassner/projects/frontalize/
<NAME>, <NAME>*, <NAME>* and <NAME>, Effective Face Frontalization in Unconstrained Images, IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), Bos... |
import pandas as pd
import enum
import serial
from serial.serialutil import SerialTimeoutException
from utils.utils import lab_names, lab_default_models
from utils.plotter import Plotter
from crccheck.crc import Crc16
from PySide2.QtCore import QMargins, QTimer, QCoreApplication
from PySide2.QtGui import QPixmap, Qt, ... |
# encoding: utf8
#
# This file is part of the Neurons project.
# Copyright (c), Arskom Ltd. (arskom.com.tr),
# <NAME> <<EMAIL>>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... |
""" The text editor module for pySUMO. The TextEditor widget is the main pySUMO
widget. It contains the textual representation of the currently loaded
Ontologies allowing conventional kif editing with features such as syntax
highlighting and autocompletion.
"""
from PySide.QtCore import Qt, QRegExp, Slot, QRect, QPoint... |
"""Use meta policy mechanism for running the policy."""
import os
import argparse
import h5py
import random
import ast
import init_path
from models.model_utils import safe_cuda
from models.conf_utils import *
from models.torch_utils import *
from skill_discovery.hierarchical_agglomoration_utils import Node, Hierarchi... |
# coding: utf-8
# adapted from the Python tests for the builtin `io` module:
# https://github.com/python/cpython/blob/master/Lib/test/test_memoryio.py
import array
import io
import pickle
import sys
import unittest
import iocursor
class IntLike:
def __init__(self, num):
self._num = num
def __index_... |
# MorfLess v1.0
#
# list functions
#
from libraries import globals as gb
from libraries import constants as ct
from libraries import schematics as sch
from libraries import string_processes as sp
from libraries import meta_defaults as md
from collections import OrderedDict
import os, json, datetime, math
def pcom_o... |
#!/usr/bin/env python
from __future__ import print_function
from datetime import datetime, timedelta
from pathlib import Path
from tempfile import mkstemp
import argparse
import enum
import os
import os.path
import re
import shutil
import sys
# Get the tasks directory that we are going to use
if os.environ.get("TASK... |
from __future__ import print_function
import argparse
from math import log10
from libs.GANet.modules.GANet import MyLoss2
import sys
import numpy as np
import shutil
import os
import time
import skimage.io
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.opt... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 16 11:38:53 2018
@author: Melody
"""
from selenium import webdriver
import wikipedia as wiki
from bs4 import BeautifulSoup
import json, os, re, sys, subprocess, pickle, time, urllib.request, unicodedata, wikipedia
from selenium.webdrive... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from collections import Counter, defaultdict
from io import BytesIO
from urllib.parse import urlencode
import ast
import difflib
import filecmp
import math
import ... |
#!/usr/bin/env python3
"""Linger - Message queue and pubsub service with HTTP API
Copyright 2015-2018 Nephics AB
Licensed under the Apache License, Version 2.0
"""
import logging
import os
import os.path
import platform
import sqlite3
import sys
import time
import uuid
import tornado.concurrent
import tornado.ioloop... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import urllib
import urllib2
import simplejson
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import models
from django.db.models import signals
from django.utils.translation import ugettext_la... |
# Author: <NAME>
"""utility functions for model training and testing"""
import torch
import logging
import numpy as np
PAD_id = 0
SOS_id = 1
SEP_id = 2
EOS_id = 3
UNK_id = 4
PH_PAD_id = 0
PH_SOS_id = 1
PH_EOS_id = 2
setup_configs = {
"oracle": {"src": ["op", "rr_psg_kp", "rr_psg", "tid"], "tgt": ["rr"]},
"sy... |
#!/usr/bin/env python
# Copyright 2016 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.
import math
import json5_generator
import template_expander
import make_style_builder
from name_utilities import (
enum_for_css_k... |
import logging
import jsonpickle
import isodate
import time
from datetime import datetime
from homeassistant.util.dt import now
from custom_components.hasl3.slapi import (
slapi_fp,
slapi_tl2,
slapi_ri4,
slapi_si2,
slapi_rp3,
)
logger = logging.getLogger("custom_components.hasl3.worker")
class ... |
#!/usr/bin/env python3
# Copyright 2012 <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/LICENSE-2.0
#
# Unless required by applicable law or agre... |
"""
Core implementation of :mod:`pytools.api`.
"""
import logging
import re
import warnings
from collections import deque
from functools import wraps
from types import FunctionType
from typing import (
Any,
Callable,
Collection,
Deque,
Dict,
Iterable,
List,
Mapping,
Optional,
Se... |
# -*- coding: utf-8 -*-
"""Models for the flowcells app"""
import uuid
from django.db import models
from django.urls import reverse
from django.core.exceptions import ValidationError
from django.contrib.postgres.fields import ArrayField, JSONField
from django.contrib.contenttypes.fields import GenericRelation
from f... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any, Optional, Tuple
import torch
from torch import nn
import torch.distributed as dist
import torch.nn.functional as F
... |
##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
"""
File: tictactoe.py
Goal: To Create Tic Tac Toe and implement the Minimax Algorithm with Alpha-Beta Pruning
Group: "Tic Tac Toe"
"""
"""
Future Features:
-
"""
import pygame
import random
from enum import Enum
from time import sleep
# Initializing Pygame
pygame.init()
... |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
import numpy as np
import os
from os.path import join
import sklearn
import json
import codecs
import pickle
import _pickle
import nltk
import argparse
from torch.utils.d... |
import tempfile
from pathlib import Path
import shutil
import os
from concurrent.futures import ThreadPoolExecutor
import pytest
import numpy as np
from PyQt5 import QtTest, QtCore, QtGui
import pyperclip
from vtkmodules.vtkRenderingCore import vtkCoordinate
from motmot import geometry
from pangolin import Palmer
impo... |
#!/usr/bin/env python
# This routine establishes the co-ordinates for the new allele from the closest known allele
# The closest known allele is determined using getclosestKnownAllele from closestallele.py
import re
import os
from Bio import SeqIO
from collections import defaultdict
from .closestallele import get_cl... |
from typing import Dict, Any, List, DefaultDict, Optional, Set
from collections import defaultdict
from ..arch.x64 import RegistersX64, CallingConventionX64
class RegisterInputType(object):
Unknown = 0
Value = 1
Memory = 2
possible_for_unknown = [Value, Memory]
_to_str = {
Unknown: "Unkno... |
import os
import numpy as np
import pandas as pd
import geopandas as gpd
import shapefile
from scipy import ndimage
from random import randint
from shapely.geometry import Point, Polygon
import matplotlib.pyplot as plt
from utility import *
###########################################################
# process ris... |
import math
import numpy as np
import torch
import torch.nn.functional as F
from padertorch.base import Module
from padertorch.ops.mappings import ACTIVATION_FN_MAP
from padertorch.utils import to_list
from padertorch.contrib.je.modules.norm import Norm
from torch import nn
from copy import copy
from collections impor... |
import logging as log
import os
from functools import lru_cache
from pathlib import Path
from typing import Any, Dict, List, Tuple
import geopandas as gpd
import pandas as pd
from BaseCM import cm_hddcdd
from BaseCM.cm_output import validate
from resutils import unit
from shapely import geometry
import download
logg... |
# TODO: allow specifying axis limits
# TODO: convert Z magnitude axis to engineering units
# TODO: allow dragging drawn points
# TODO: R / X axes in addition to mag/phase?
# TODO: catch init < min or > max
# TODO: assign space bar to Next button (not last clicked)
# TODO: add percentage option to min/max
# Qt5 binding... |
# Event Handler class.
# --------
# Requires the python libXML wrapper "lxml" to function properly
__author__ = "<NAME> <<EMAIL>>, <NAME> <<EMAIL>>"
import uuid
import logging
from lxml import etree
from lxml.builder import ElementMaker, E
import schedule, database
# Stuff for the 2.0a spec of OpenADR
OADR_XMLNS_A... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import json
from scipy.spatial.transform import Rotation
import matplotlib.ticker as ticker
import os
def convert_to_rot_vector(input):
vect = np.zeros((len(input), 3))
for it, val in enumerate(input):
rot_matrix = val[6:15].reshape((... |
"""Various utilities using the geoprobe format api's
07/2009"""
import numpy as np
import six
from . import volume
from . import horizon
def bbox_intersects(bbox1, bbox2):
"""
Checks whether two bounding boxes overlap or touch.
Input:
bbox1: 4-tuple of (xmin, xmax, ymin, ymax) for the first regio... |
'''
Incore density fitting
Ref:
<NAME>. Phys. 147, 164119 (2017)
'''
import os
import time
import numpy
import scipy.linalg
from pyscf import lib
from pyscf.lib import logger
from pyscf.agf2 import mpi_helper
from pyscf.ao2mo.outcore import balance_partition
from pyscf.pbc.df import incore, ft_ao
from pyscf.pbc.df.df... |
#!/usr/bin/env python3
import os.path
import tensorflow as tf
import helper
import warnings
import argparse
import scipy
import numpy as np
import shutil
import time
from glob import glob
from datetime import datetime
from distutils.version import LooseVersion
from moviepy.editor import VideoFileClip
import project_tes... |
import logging
import sys
import time
import numpy as np
import parmed
import simtk.unit as unit
from mdtraj.reporters import HDF5Reporter
from mdtraj.utils import unitcell
from parmed import unit as u
from parmed.geometry import box_vectors_to_lengths_and_angles
from simtk.openmm import app
import blues._version
imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Audio recording using a microphone.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 <NAME> (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
__all__ = ['Microphone']
import sys
import psychopy.lo... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""This module corresponds to the mangle directory in idlutils.
Mangle_ [1]_ is a software suite that supports the concept of polygons on
a sphere, and is used to, for example, describe the `window function`_ of the
Sloan Digital S... |
# smartmirror.py
# requirements
# requests, feedparser, traceback, Pillow, spotipy
from Tkinter import *
import locale
import threading
import time
import datetime
import requests
import json
import traceback
import spotipy
import spotipy.util as util
from PIL import Image, ImageTk
from contextlib import contextmanage... |
""" Tools to generate awk code to be executed.
awk - the most common and will be found on most Unix-like systems, oldest
version and inferior to newer ones.
mawk - fast AWK implementation which it's code base is based on
a byte-code interpreter.
nawk - while the AWK language was being developed the authors released
... |
#!/usr/bin/env python
# Script Name: QmRLFS-finder.py (version v2)
# Description: QmRLFS-finder.py is program to predict
# R-loop forming regions in any DNA sequences
# (in FASTA file)
# Created By: <NAME> and <NAME>
# e-mail: <EMAIL>
# Update: 29-Aug-2019
########################... |
# Copyright 2014-2019 <NAME> <<EMAIL>>.
#
# 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... |
"""Functions to fit rates in ion channel gating mechanisms"""
import warnings
import numpy as np
import scipy.linalg
import scipy.sparse.csgraph
import scipy.optimize
from .qmatrix import qmatvals, cvals, phi
from .pdf import R, asymptotic_r_vals, chs_vectors
from .utils import _match_hash
def qmatrix_loglik(params... |
# Django imports
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.models import auth
from django.contrib.sites.shortcuts import get_current_site
from django.conf import settings
from django.contrib.auth.forms import PasswordResetForm
from django.template.loader ... |
#! /usr/bin/env python
import pickle
import os
import glob
import shutil
import argparse
import torch as th
import numpy as np
from torch import nn
from torch.nn import functional as F
from plnn.modules import Flatten
import random
'''
Training test file for the deep model transferrability studies
1. added norm weight... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains custom Qt slider widgets
"""
from __future__ import print_function, division, absolute_import
from copy import copy
from Qt.QtCore import Qt, Signal, Property, QPoint, QPointF, QEvent
from Qt.QtWidgets import QSizePolicy, QWidget, QAbstractSpin... |
from __future__ import annotations
import asyncio
import typing
import discord
from discord.ext import commands
from .errors import InvokedMetaCommand
def do_nothing(value):
return value
class SettingsMenuError(commands.CommandError):
pass
class SettingsMenuConverter(object):
__slots__ = ('prompt'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import meep as mp
import numpy as np
# import h5py as h5
#import scipy as sp
from scipy import optimize as op
from scipy import interpolate as itp
from matplotlib import pyplot as plt
# from multiprocessing import Pool
# from mpl_toolkits.mplot3d import Axes3D
im... |
#!/usr/bin/env python3
''' Cardinal - An Open Source Cisco Wireless Access Point Controller
MIT License
Copyright © 2019 falcon78921
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 rest... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import unittest
import aniso8601
from aniso8601.builders import (BaseTimeBuilder, DateTuple, DatetimeTuple,
... |
# coding: utf-8
# version: 0.10a
import sys, re
from PyQt5.QtWidgets import QAction, QApplication, QWidget, QDialog, QTableWidget, QBoxLayout, QTableWidgetItem, QAbstractItemView, QListWidget, QListWidgetItem, QMessageBox, QGroupBox, QLabel, QLineEdit, QPushButton, QComboBox, QVBoxLayout, QInputDialog, QHBoxLayout
fr... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2021 <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, c... |
import os
import pickle
import traceback
from time import sleep, time as ttime
from collections import defaultdict
from threading import Thread
import rlp
from ethereum import utils
from plasma.config import plasma_config
from plasma.utils.utils import send_transaction_sync
from .block import Block
from .exceptions i... |
"""
#####################################################################################################
This module is for determining the coding sequences (CDS) that could be affected by a given mutation
coding sequences can affect
Upstream mutations could affect gene expression
Mutations within a gene could affec... |
import os
import sys
import time
import yaml
import logging
import logging.handlers
import queue
import datetime
import re
from fatsecret import Fatsecret
from PyQt5.QtCore import (QObject, QThread, pyqtSlot, pyqtSignal, Qt)
from PyQt5.QtWidgets import (QWidget, QLabel, QMessageBox, QListWidget,
... |
"""
astromatch module for cross-matching astronomical
catalogues using the ARCHES XMatch server.
Reference: Pineau et al. 2017
@author: A.Ruiz
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import zip, range
from io import open
try:
... |
import argparse
import json
import os
import re
import requests
import time
import tldextract
import urllib
import sys
import threading
import whois
from bs4 import BeautifulSoup
from datetime import datetime
from statistics import mean
from urllib.parse import urlencode, urlparse, urlsplit
def main():
start = t... |
# Copyright 2018 The TensorFlow 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 applica... |
#!/usr/bin/env python
"""
Main Flask python function that manages the server backend
If you just want to try it out, just run this file and connect to
http://localhost:5000 from a browser. Otherwise, read the instructions
in README_DEPLOY.txt to deploy on a Apache server.
"""
from __future__ import unicode_literals
fr... |
# coding=utf-8
import requests
import MySQLdb, sys, os, json, re
import pandas as pd
from datetime import datetime
# MySQL
def validate_string(val):
'''Do validation and checks before insert'''
if val != None:
if type(val) is int:
return str(val).encode('utf-8')
else:
r... |
from pprint import pprint
import numpy as np
from tqdm import tqdm
from script.data_handler.TGS_salt import mask_label_encoder
from script.model.sklearn_like_model.BaseModel import BaseDataCollector
from script.model.sklearn_like_model.SemanticSegmentation import SemanticSegmentation
from script.model.sklearn... |
"""
wraps a CLI around the core functionality (using argparse)
- inherits functionality from `npbc_core.py`
- inherits regex from `npbc_regex.py`, used for validation
- inherits exceptions from `npbc_exceptions.py`, used for error handling
- performs some additional validation
- formats data retrieved from the core for... |
import calendar
import json
import logging
import os
import re
from datetime import datetime, timedelta, timezone
from string import Template
from typing import Any, Callable, Dict, List, Optional
import pendulum
import requests
from airflow.configuration import conf
from airflow.contrib.operators.kubernetes_pod_opera... |
#!/usr/bin/env python
# This file is part of the bumpver project
# https://github.com/mbarkhau/bumpver
#
# Copyright (c) 2018-2021 <NAME> (<EMAIL>) - MIT License
# SPDX-License-Identifier: MIT
"""cli module for BumpVer."""
import io
import re
import sys
import typing as typ
import logging
import datetime as dt
import s... |
#!/usr/bin/python
# (c) 2018, NetApp, Inc
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
... |
import json
import os
import argparse
import shutil
import uuid
import glob
import logging
from typing import Any, Tuple, Union
from Tests.Marketplace.marketplace_services import init_storage_client, Pack, load_json, \
get_content_git_client, get_recent_commits_data
from Tests.Marketplace.marketplace_statistics imp... |
"""Classes to manage credentials."""
import json
import logging
from typing import Mapping, Text, Sequence, Tuple
from .messages.credential_ack import CredentialAck
from .messages.credential_issue import CredentialIssue
from .messages.credential_offer import CredentialOffer
from .messages.credential_proposal import C... |
# Copyright 2018 The TensorFlow 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 applica... |
# coding=utf-8
import datetime
import time
import operator
import traceback
from urllib2 import URLError
from subliminal_patch.score import compute_score
from subliminal_patch.core import download_subtitles
from subliminal import list_subtitles as list_all_subtitles
from babelfish import Language
from missing_subtit... |
from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import utils
from io import StringIO
try:
from io i... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import errno
import os
import shutil
import sys
import tempfile
import threading
import time
import unittest
from datetime import datetime, timedelta
from django.core.cache import cache
from django.core.exceptions import SuspiciousFileOperation, Suspicio... |
import asynchat
import asyncore
import logging
import util
import json
import socket
import collections
import random
import sys
class InternalRequestStage(asyncore.dispatcher):
"""
Listens for internal connections from other nodes and creates an InternalChannel upon accepting.
----------
"""
def ... |
from app import mythic, db_objects
from sanic.response import json
from app.database_models.model import (
Task,
Response,
Callback,
Keylog,
TaskArtifact,
Artifact,
Command,
)
from sanic_jwt.decorators import scoped, inject_user
from app.api.file_api import (
create_filemeta_in_database_... |
# coding=utf-8
# Copyright 2020 Microsoft and the HuggingFace Inc. team.
#
# 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... |
import copy
import json
import logging
import os
import platform
import random
import secrets
import signal
import threading
import time
import traceback
import zipfile
from io import BytesIO
from sys import exit
from urllib.parse import urlparse
import requests
from requests.exceptions import ConnectionError
from ste... |
"""
Tagged block data structure.
.. todo:: Support the following tagged blocks: ``Tag.PATTERN_DATA``,
``Tag.TYPE_TOOL_INFO``, ``Tag.LAYER``,
``Tag.ALPHA``
"""
from __future__ import absolute_import, unicode_literals
import attr
import io
import logging
from warnings import warn
from psd_tools.constants impor... |
import model
import data_utils
import inter_utils
import pickle
import time
import os
import torch
from torch import nn
from torch import optim
from tqdm import tqdm
import argparse
from utils import USE_CUDA
from utils import get_torch_variable_from_np, get_data
from scorer import eval_train_batch, pruning_eval_data... |
from oculus import DsstParameters, DsstTracker, KcfParameters, KcfTracker,\
Line2D, Line2DParameters
import cv2
import os
import numpy as np
from cmt import CMT
from threading import Thread
import time
class Eye:
def __init__(self, source, sequence=False):
self.optogram = None
self.frame = Non... |
#!/usr/bin/env python
# Copyright (C) 2013-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, ... |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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
#
# ... |
""" Helper functions for cci_plot.py.
"""
import sys
import math
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.axes import Axes
from matplotlib.patches import Arc, Wedge
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.path import Path
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018, <NAME>; <NAME>; <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above... |
import numpy as np
import plotly.graph_objects as go
import os
from typing import List, Optional, Dict, Tuple
from pathlib import Path
from algorithms.utils import generate_save_location
PLOTLY_DEFAULT_COLOURS = [
"#1f77b4", # muted blue
"#ff7f0e", # safety orange
"#2ca02c", # cooked asparag... |
import platform
import threading
import time
import traceback
from typing import Any, Dict, List, Optional, Tuple, Union
from ._version import __author__, __version__ # noqa: F401
from .helpers import MONITOR_MANUFACTURER_CODES # noqa: F401
from .helpers import ScreenBrightnessError, flatten_list, logarithmic_range
... |
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import datetime
from dateutil import rrule
from django.conf import settings as django_settings
from django.contrib.contenttypes import fields
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db... |
import os
import subprocess
import re
import json
import time
import pandas as pd
from keyboard import press
from shutil import copy
from distutils.dir_util import copy_tree
def write_log(string, logfile):
"""Writes printed script output to a logfile"""
with open(logfile,'a') as f:
f.write(string + "\... |
import pygame
import os
import random
import csv
import button
import json
from pygame import *
from effect import Fade
pygame.init()
mixer.init()
SCREEN_WIDTH = 800
SCREEN_HEIGHT = int(SCREEN_WIDTH * 0.8)
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('Shooter')
clock ... |
# aponxi
import os
import sys
import locale
import tempfile
import functools
import threading
from os import path
from subprocess import PIPE, Popen
import sublime
import sublime_plugin
from sublime_plugin import TextCommand, WindowCommand
from .sourcemap import load
BABEL_SYNTAX_PATH = os.path.join(
sublime.pac... |
#!/usr/bin/python3
##
# Lightweight MongoDB Python utility used to initiate a high throughput data ingestion or
# transformation workload against a remote MongoDB database (whether self-managed or in MongoDB
# Atlas).
#
# Ensure this '.py' script has executable permissions in your OS.
#
# For a full description of the ... |
"""Test rotations in srctools.vec."""
import copy
import pickle
from pathlib import Path
from typing import NamedTuple, List
import pytest
from srctools.test import *
from srctools import Vec
class RotationData(NamedTuple):
"""Result of the rotation_data fixture."""
angle: Tuple[float, float, float]
fo... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
import ast
import numpy as np
"""
General purpose output parser
"""
__author__ =... |
# ==============================================================================
# Copyright 2019 - <NAME>
#
# NOTICE: 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, ... |
import pandas as pd
import os
import numpy as np
import torch
import datetime as dt
import time
import logging
import seaborn as sns
import re
from torch.utils import data
from torchvision import models, transforms
from PIL import Image
import GPUtil
from sklearn.metrics import average_precision_score
import torch.nn.... |
# Copyright 2008-2020 pydicom authors. See LICENSE file for details.
"""Functions for working with encapsulated (compressed) pixel data."""
from struct import pack
from typing import List, Generator, Optional, Tuple
import warnings
import pydicom.config
from pydicom.filebase import DicomBytesIO, DicomFileLike
from py... |
from vaspvis.unfold import make_kpath,removeDuplicateKpoints, find_K_from_k, save2VaspKPOINTS
from vaspvis.unfold import convert
from vaspvis.passivator_utils import _append_H, _cart2sph, _get_bot_index, _get_neighbors, _get_top_index,_sort_by_z, _sph2cart, _center_slab
from pymatgen.analysis.graphs import StructureGra... |
# Copyright (c) 2017 The Regents of the University of Michigan.
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Job class defined here."""
import errno
import logging
import os
import shutil
from copy import deepcopy
from json import JSONDecodeError
from threading import RLock
fro... |
import collections
import json
import math
import random
import re
import string
import torch
from collections import Counter
from torch.nn.functional import softmax
from typing import List, Callable, Tuple, Any, Optional
try:
from pytorch_pretrained_bert.tokenization import BasicTokenizer
except Impo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.