text stringlengths 3.07k 22.1k |
|---|
# coding: utf-8
#
# Copyright 2020 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
# Copyright (c) 2015 Mellanox Technologies, Ltd
# 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
#
# U... |
"""
MIT License
Copyright (c) 2020 GamingGeek
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, dis... |
#!/usr/bin/python
import os, sys
import json
import numpy as np
import re
### YOUR CODE HERE: write at least three functions which solve
### specific tasks by transforming the input x and returning the
### result. Name them according to the task ID as in the three
### examples below. Delete the three examples. The ta... |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# 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 SOFTWARE IS PROVIDED "AS I... |
# This program has been developed by students from the bachelor Computer Science at Utrecht University within the
# Software and Game project course
# ©Copyright Utrecht University Department of Information and Computing Sciences.
"""This file contains all communication from and to Learning Locker."""
import requests
... |
"""
"""
import numpy as np
import pandas as pd
import cv2
from os import listdir
import queue
import copy
import itertools
def rect_list_center(rect_list):
# give a list of rectangles and return a list of the center points
res = [((x[0] + x[2]) / 2, (x[1] + x[3]) / 2) for x in rect_list]
return res
def ... |
#!/usr/bin/python3
import errno
import json
import os
import os.path
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
if any(s == "--help" for s in sys.argv):
print("""Usage:
GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir
This generates test cases exercising function... |
import sys
from collections import OrderedDict
import pandas as pd
import numpy as np
import operator as op
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
from nnExplain.utils import Timeout
import tensorflow as tf
from .common import constructNetwork
from .common import constructNetworkWithoutDropout
from .commo... |
import paddle
import paddle.nn.functional as F
from paddle.nn import Conv2D, ReLU, Linear, Layer
import gym_super_mario_bros
from gym.spaces import Box
from gym import Wrapper
from nes_py.wrappers import JoypadSpace
from gym_super_mario_bros.actions import SIMPLE_MOVEMENT
import cv2
import math
import numpy a... |
from abc import abstractmethod
from copy import deepcopy
from dataclasses import dataclass
from typing import List, Iterator, Dict, Any, TypeVar, Generic
from dbt.config import RuntimeConfig, Project, IsFQNResource
from dbt.contracts.graph.model_config import BaseConfig, get_config_for
from dbt.exceptions import Inter... |
#
# Copyright 2020 Autodesk
#
# 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, so... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
#!/bin/env python2.7
# ------------------------------------------------------------------------------
# Copyright 2014-2015 Esri
# 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... |
import os
import sys
import json
import glob
# sys.path.insert(0, os.getcwd() + '/../../tfcode/')
from base import *
def get_train_text(datadir, fwrite, num):
print('write word:', fwrite)
a = os.listdir(datadir)
files = sorted([datadir + x for x in a if os.path.isfile(datadir + x)])
with open(fwrite... |
import random
from collections import defaultdict, namedtuple
from enum import Enum
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from itertools import product
class Action(Enum):
UP = 0
DOWN = 1
LEFT = 2
RIGHT = 3
GridState = namedtuple('GridState', ['x', 'y', 'cows... |
import pytest
from pytest import raises
from ..utils import staticmethods
skip = pytest.mark.skip
xfail = pytest.mark.xfail
from markup.src.nodes import table
@staticmethods
class Test_TableNode:
def test_headers_data_arg_can_only_have_rows_and_cols():
with raises(table.InvalidData):
table.Ta... |
import base64
import enum
import json
import threading
import time
import urllib.parse as parse
from dataclasses import dataclass
from typing import List, Tuple, Union
from urllib.parse import urlparse
import requests
from author.models import Author
from backend.settings import NETLOC
from comment.models import Comme... |
import math
from heapq import heappush, heappop, heapify
from core.model.graph import (Edge, Node, Graph)
from core.model.path import Path
from core.model.impl.list_path import ListPath
import core.exceptions.algorithm_dijkstra as exception
from typing import TypeVar, Generic, Callable, Dict, List, Set
N = TypeVar... |
from django.db import models
# Klasa tłumaczeniowa dla "core"
class PageNames(models.Model):
lang_flag = models.ImageField(upload_to='images') # Mały obrazek języka
lang_flag_id = models.CharField(max_length=20, blank=True, null=True)
headtitle = models.CharField(max_length=200) # Nagłówek strony w tym ... |
# This code belongs to the paper
#
# <NAME> and <NAME>.
# WPPNets and WPPFlows: The Power of Wasserstein Patch Priors for Superresolution.
# ArXiv Preprint#2201.08157
#
# Please cite the paper, if you use the code.
#
# The script reproduces the numerical example with the material 'SiC Diamonds - WPPFlow'
# in the pap... |
# -*- coding: utf-8 -*-
"""
Created on 2021/12/14 21:10:08
@File -> mutual_info.py
@Author: luolei
@Email: <EMAIL>
@Describe: 互信息和条件互信息计算
"""
from scipy.special import psi
import pandas as pd
import numpy as np
from . import DTYPES
from . import preprocess_values, deter_k, build_tree, query_neighbors_dist
from .e... |
import re
import os
import queue
import requests
from requests.auth import HTTPProxyAuth
import time
import threading
from PyQt4.QtCore import QThread, pyqtSignal, pyqtSlot
from PyQt4 import QtCore , QtGui
import CusLog
from pypac import PACSession
log = CusLog.CusLog(CusLog.LOG_INFO,"logs.txt")
class... |
"""Fluxnet data loaders."""
from torch.utils.data import Dataset, DataLoader
from torch import Tensor
from pytorch_lightning import LightningDataModule
import xarray as xr
import numpy as np
from typing import List, Tuple, Dict, Union, Iterable
from joblib.externals.loky.backend.context import get_context
from uti... |
# -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
import babel
import logging
import sys
import datetime as dt
from datetime import timedelta
from flask import Flask, render_template
from flask_admin.contrib.sqla import ModelView
from hackzurich import commands, public, user, challenge... |
# metal_binding_classifier
import os
#os.environ['CUDA_VISIBLE_DEVICES'] = '0'
#import the tools
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader, Wei... |
import random
import logging
import numpy as np
import scipy
import scipy.ndimage
import scipy.interpolate
import torch
# A sparse tensor consists of coordinates and associated features.
# You must apply augmentation to both.
# In 2D, flip, shear, scale, and rotation of images are coordinate transformation
# color j... |
# Copyright (c) 2021, Yamagishi Laboratory, National Institute of Informatics
# Author: <NAME> (<EMAIL>)
# All rights reserved.
import io
import numpy as np
import unicodedata
import re
from dataclasses import dataclass
from functools import partial
from multiprocessing import Pool, cpu_count
from sklearn.metrics impo... |
# Copied from the Requests library by <NAME> et al.
#
# Copyright 2013 <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
#
... |
"""Support to select a date and/or a time."""
from __future__ import annotations
import datetime as py_datetime
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_DATE,
ATTR_EDITABLE,
ATTR_TIME,
CONF_ICON,
CONF_ID,
CONF_NAME,
SERVICE_RELOAD,
)
from homeassistan... |
import os
import shutil
import subprocess
import sys
import tempfile
import threading
_g_failed = []
def this_location():
return os.path.abspath(os.path.dirname(__file__))
def checkenv(sd_license, release, ssh_key_path):
required_vars = ['AWS_ACCESS_KEY_ID',
'AWS_SECRET_ACCESS_KEY',... |
"""Sleep As Android integration"""
import logging
from typing import Dict, Callable
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers import entity_registry as er
from homeassistant.core import HomeAssistant, callback
from homeassistant.components.mqtt import subscription
from homeassist... |
import datetime
import importlib
import time
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission
from django.db import models
from django.utils.functional import cached_property
from django.db.models import Count
from django.dispatch import Signal
# from django.db.models.sig... |
"""Test the API with the EMMO ontology."""
import itertools
import unittest2 as unittest
import rdflib
from osp.core.ontology import OntologyEntity
from osp.core.ontology.relationship import OntologyRelationship
from osp.core.ontology.attribute import OntologyAttribute
from osp.core.ontology.oclass_restriction import ... |
import logging
import time
from tornado.gen import coroutine, sleep, Return
from tornado.ioloop import IOLoop
from katcp import KATCPClientResource
log = logging.getLogger("mpikat.edd_digpack_client")
class DigitiserPacketiserError(Exception):
pass
class PacketiserInterfaceError(Exception):
pass
class Digit... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import pytest
from pants.backend.python.lint.yapf.rules import YapfFieldSet, YapfRequest
from pants.backend.python.lint.yapf.rules import rules as yapf... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2022-present MagicStack Inc. and the EdgeDB 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... |
from functools import wraps
from pathlib import Path
from typing import Union
import numpy as np
from spikeextractors.extraction_tools import cast_start_end_frame
from tqdm import tqdm
try:
import h5py
HAVE_H5 = True
except ImportError:
HAVE_H5 = False
try:
import scipy.io as spio
HAVE_Scipy = ... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
import argparse
import hail as hl
import logging
import os
import time
from hail_scripts.v02.utils.elasticsearch_client import ElasticsearchClient
from sv_pipeline.utils.common import get_sample_subset, get_sample_remap, get_es_index_name, CHROM_TO_XPOS_OFFSET
from sv_pipeline.genome.utils.mapping_gene_ids import loa... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
#!/usr/bin/env python3
import tkinter as tkint
# Parent View
class View_1:
def __init__(self, win_manager, Class_Name):
self.win_manager = win_manager
self.App_Name = Class_Name
self.MVC_App = win_manager.MVC_App
self.tk = tkint
self.row_count = 1
self.column_cou... |
import datetime
from typing import Any, Dict, List, Tuple
from dateutil.relativedelta import relativedelta
from django.db import connection
from django.db.models import F, Q, QuerySet
from django.db.models.expressions import Window
from django.db.models.functions import Lag
from django.utils.timezone import now
from ... |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Workflow Controller MQ Consumer."""
from __future__ import absolute_import
import j... |
from datetime import datetime
import re
from pytz import timezone
from discord.ext import commands
from typing import List, Dict, Optional, Union
import discord
async def get_timestamp(tz: str = 'Etc/GMT') -> int:
""" Gets the current timestamp.
:param tz: The timezone to get the timstamp from. Default = Etc/G... |
import pytest
from astropy import constants as c, units as u
from astropy.tests.helper import assert_quantity_allclose
from poliastro.bodies import Earth
from poliastro.core import iod
from poliastro.iod import izzo, vallado
@pytest.mark.parametrize("lambert", [vallado.lambert, izzo.lambert])
def test_vallado75(lamb... |
from __future__ import print_function
import os
import sys
import time
import argparse
import datetime
import math
import pickle
import numpy as np
import torchvision
import torchvision.transforms as transforms
import torch
import torch.utils.data as data
import torch.nn as nn
import torch.optim as optim
import tor... |
#**************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
#... |
import os
from time import sleep
from src.views import Logger
from src.models import CollabWebService as Ws
from src.models import Courses, Downloads, Utilities
from src.models.Uploads import Uploads
from src.views import Reports
from src.models import Emails
from src.models import Blacklist
import time
import tracebac... |
import operator
import numpy as np
import pytest
from pandas import (
DataFrame,
MultiIndex,
Series,
)
import pandas._testing as tm
from pandas.tests.apply.common import frame_transform_kernels
from pandas.tests.frame.common import zip_frames
def unpack_obj(obj, klass, axis):
"""
Helper to ensur... |
# -*- coding: utf-8 -*-
"""'Current Source Density analysis (CSD) is a class of methods of analysis of
extracellular electric potentials recorded at multiple sites leading to
estimates of current sources generating the measured potentials. It is usually
applied to low-frequency part of the potential (called the Local F... |
"""Generate intial word embedding for headlines and description.
The embedding is limited to a fixed vocabulary size (`vocab_size`) but
a vocabulary of all the words that appeared in the data is built.
"""
from os import path
import config
import _pickle as pickle
from collections import Counter
import numpy as np
fr... |
# Lint as: python3
# Copyright 2019 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 r... |
import os
from django.conf import settings
from django.core.validators import RegexValidator
from django.db import models
from django.urls import reverse
from django_cleanup import cleanup
from model_utils.models import TimeStampedModel
from ordered_model.models import OrderedModel
from softdelete.models import SoftD... |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... |
import pandas as pd
import random
from sklearn import preprocessing
from sklearn import decomposition
from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn import svm
from sklearn import feature_selection
from sklearn import model_selection
from sklearn im... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities
fro... |
#
# Copyright 2018 the original author or 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... |
from __future__ import print_function
import numpy as np
import random
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from sklearn.linear_model import LogisticRegression
from .graph import *
from . import node2vec
from .classify import Classifier, read_node_label
from . import line
from . import tad... |
# Copyright 1999 by <NAME>. All rights reserved.
# Copyright 2000 by <NAME>. All rights reserved.
# Revisions Copyright 2007 by <NAME>. All rights reserved.
# Revisions Copyright 2009 by <NAME>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LIC... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2019 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import logging
import os.path
import string
import sys
import unicodedata
import pkg_resources
import regex as re
import panphon
import unicodecsv as csv
from epitran.ligaturize import... |
import sys
import pysam
import configparser
import argparse
import operator
import functools
from src.umi_error_correct import UMIGroup
from src.get_consensus_seq import get_consensus_seq, get_uncollapsed_seq
from src.handle_args import handle_arg
from src.get_ref_seq import get_ref_seq
class ConsDataRow:
"""Hold... |
"""
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
import sys
sys.path.insert(0, "./../../../")
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import torch.utils.data as data_utils
from torch.utils.data.dataset import random_split
from torchvision import datasets, transforms
from pape... |
import numpy as np
import tensorflow as tf
import tflearn
GAMMA = 0.99
A_DIM = 6
ENTROPY_WEIGHT = 0.5
ENTROPY_EPS = 1e-6
S_INFO = 4
class ActorNetwork(object):
"""
Input to the network is the state, output is the distribution
of all actions.
"""
def __init__(self, sess, state_dim, action_dim, le... |
################################################################################
# Copyright 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in t... |
from django.db import models
from django.contrib.auth.models import AbstractUser, Group
from django.utils import timezone
from django.core.exceptions import ValidationError
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoke... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
from logger import setup_logger
from models.model_stages import BiSeNet
from cityscapes import CityScapes
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torch.nn.functional as F
import torch.distributed as dist
import os
import os.path as... |
import asyncio
import datetime
import json
import logging
import sys
import time
from typing import Tuple, List
from dataclasses import dataclass
from newspaper import Article, ArticleException
# from app.store import es
log = logging.getLogger(__name__)
log.addHandler(logging.StreamHandler(sys.stdout))
def parse(... |
import numpy as np
from tqdm import tqdm
from ops import tensor_product, quantum_one, quantum_zero, quantum_eye, quantum_flip, MakeR, EPS, Fidelity, NormalizeAngle
class EnumAllCNOT(object):
def __init__(self, quantum_count, layer_count):
self.quantum_count = quantum_count
self.layer_count... |
# -*- coding: utf-8 -*-
from glob import glob
import os
from collections import OrderedDict
from mne import create_info, concatenate_raws
from mne.io import RawArray
from mne.channels import make_standard_montage
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
sns.s... |
from plasma_core.child_chain import ChildChain
from plasma_core.account import EthereumAccount
from plasma_core.block import Block
from plasma_core.transaction import Transaction
from plasma_core.constants import NULL_ADDRESS
from plasma_core.utils.signatures import sign
from plasma_core.utils.transactions import decod... |
################################################################################
# Copyright (C) 2014 <NAME>
#
# This file is licensed under the MIT License.
################################################################################
"""
Module for the multinomial distribution node.
"""
import numpy as np
from ... |
# Copyright 2016-2019 The <NAME> at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");
# you ... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2014, 2015, 2017 <NAME>
# (kevin 'period' thibedeau 'at' gmail 'punto' com)
#
# 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 ... |
import string
import numpy as np
from typing import Optional, List
from dataclasses import dataclass
@dataclass
class Function:
name: str
obj: Optional[str]
args: List[List[str]]
return_type: List[str]
@dataclass
class Operator:
name: str
name_str: str
args: List[List[str]]
return_ty... |
import json
from django.utils.crypto import get_random_string
from copy import deepcopy
from social.models import Login
from customer.models import Customer
from social_service import SocialProfile
from social import models
def get_opposite_platform(platform):
platform_opposites = {
'facebook': 'google'... |
"""
tests.components.tests_links.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Links object test coverage
:copyright: (c) 2019 by <NAME>.
:license: Apache2, see LICENSE for more details.
"""
# pylint: disable=redefined-outer-name
# -- Imports -------------------------------------------------------------------
import pytest... |
from __future__ import absolute_import
import os
import pickle
import re
import shutil
import tempfile
from netranger import Vim
from netranger.config import file_sz_display_wid
from netranger.enum import Enum
from netranger.shell import Shell
FType = Enum('FileType', 'SOCK, LNK, REG, BLK, DIR, CHR, FIFO')
def do_... |
from __future__ import print_function
import io
import urllib3 # type: ignore
import certifi
import gzip
import time
from datetime import datetime, timedelta
from collections import defaultdict
from sentry_sdk.utils import Dsn, logger, capture_internal_exceptions, json_dumps
from sentry_sdk.worker import Background... |
# LICENSE
#
# Copyright (C) 2010-2018 GEM Foundation, <NAME>, <NAME>,
# <NAME>.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (a... |
import logging
import pyvex
from angr.utils.constants import DEFAULT_STATEMENT
from angr.engines.vex.claripy.irop import vexop_to_simop
from .block import Block
from .statement import Assignment, Store, Jump, Call, ConditionalJump, DirtyStatement, Return
from .expression import Const, Register, Tmp, DirtyExpression, ... |
#!/usr/bin/python3
import asyncio
import ksppynet.flight_plan as flight_plan
from threading import Thread
import krpc
import queue
import traceback
import os
__all__ = (
"Pynet",
)
testing_ui_on = False
class PynetException(Exception):
pass
class PynetHandler(object):
# Main thread
def __init__(self... |
#!/usr/bin/env python
"""Used to Reverse/Test ELM protocol auto detect and OBD message response without a car."""
from __future__ import print_function
import sys
import os
import struct
import binascii
import time
import threading
from collections import deque
sys.path.append(os.path.join(os.path.dirname(os.path.real... |
from argparse import ArgumentParser
# Add learning rate / training parameters
def add_learning_args(parser):
# Default training options
parser.add_argument("--training_steps", default=100000, type=int, help="Total number of training steps")
parser.add_argument("--batch_size", default=64, type=int, help="T... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==================================================
# @Time : 2019-05-30 17:12
# @Author : ryuchen
# @File : GuestManager.py
# @Desc : We abandon the old agent, only adapt for new guest agent
# ==================================================
import io
import os
import j... |
#!/usr/bin/env python
import os.path
from PySide import QtCore, QtGui, QtOpenGL
from PySide.QtCore import Qt, QSize
from juma.core import *
from juma.qt.controls.Menu import MenuManager
from juma.qt.controls.PropertyEditor import PropertyEditor
from juma.qt.helpers import addWidgetWithLayou... |
import logging
import numpy as np
import xarray as xr
import pandas as pd
def detect_events(ds):
"""Transform ds.song_events into dict of event (on/offset) times.
Args:
ds ([xarray.Dataset]): dataset with song_events
Returns:
dict: with event times or segment on/offsets.
"""
event_... |
import os
import numpy as np
from scipy.spatial.transform import Rotation as R
def read_kitti_calibration_file(file_path):
calib = dict()
with open(file_path, 'r') as f:
for line in f:
if len(line) < 5:
continue
key, val = line.rstrip().split(': ')
... |
#!/usr/bin/env python3.6
# coding=utf-8
'''
Deep Learning Models for relation identification
@author: <NAME> (<EMAIL>)
@since: 2018-05-30
'''
import torch
import torch.nn as nn
from parser.modules.helper_module import mypack ,myunpack,MyPackedSequence,MyDoublePackedSequence,mydoubleunpack,mydoublepack,DoublePackedSe... |
# Copyright 2018 The Exoplanet ML 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 t... |
from collections import defaultdict
from collections.abc import Mapping, Sequence
from typing import Any, List, Optional, Tuple, Union
import numpy as np
import tensorlayerx as tlx
from gammagl.data import BaseGraph
from gammagl.data.storage import BaseStorage, NodeStorage
from gammagl.utils.check import check_is_numpy... |
import requests
import json
import re
# PLUGIN_CONFIG variables
from ..plugins_config import (
PROXMOX,
PROXMOX_PORT,
PROXMOX_USER,
PROXMOX_PASSWORD,
PROXMOX_SSL,
NETBOX,
NETBOX_TOKEN,
PROXMOX_SESSION as proxmox,
NETBOX_SESSION as nb,
)
from .. import (
create,
)
# Update "st... |
#!/usr/bin/env python
#
# Copyright 2018 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.
"""From a dump generated by dump_process.cc dump, prints statistics about
its content.
"""
from __future__ import print_function
im... |
from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import IntegrityError
from django.test import TestCase
from spaces.models import Space, Document, Revision
class SpaceTestCase(TestCase):
""" Test Space Models """
def setUp(s... |
import sys
import os
import getopt
import threading
import subprocess
from datetime import datetime
known_tcp_ports = []
known_udp_ports = []
known_http_ports = []
known_nfs_ports = []
enum4linux_scanned = False
smbclient_scanned = False
nmap_pn_warning_shown = False
null_write = open(os.devnull, 'w')
class TextColo... |
#!/usr/bin/env python
"""
Written by <NAME>
Github: https://github.com/prziborowski
This code is released under the terms of the Apache 2
http://www.apache.org/licenses/LICENSE-2.0.html
Deploy an ova file either from a local path or a URL.
Most of the functionality is similar to ovf except that
that an OVA file is a ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.