text stringlengths 2 999k |
|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Common utilities
"""
import configparser
import os
__author__ = "Boris Zhao"
def read_content(path):
"""
Read the content of the file
:param path: Path to the file
:return: Content of the file
:rtype: str
"""
with open(path, "r") as f:... |
####################################
#Nicola Borsari nDeepAutoCrop - 13 August 2018 - v2.2
import nuke
import os
import os.path
import nukescripts
def nDeepAutocrop():
selection = nuke.selectedNodes() #store selection into list
i = 0 #counter for node class test loop
# message variables
dtoimgerr... |
"""Create a Python module, which consists of a class TextContainer.
The class must have a constructor which allow objects to be initialized with a text ala:
tc = TextContainer(my_text). The class must implement the following methods for computing statistics on texts.
Counting the amount of words used in a text.
... |
import pytest
from os import path as osp
from glob import glob
from shutil import which
from subprocess import Popen, PIPE, TimeoutExpired
import time
RANKS = 1
TEST_PATH = osp.dirname(osp.abspath(__file__))
def get_test_names():
"""Obtain test names by globbing for client_test
Add tests manually if necessary... |
"""
Copyright (c) 2018-2022 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 required by applicable law or agreed to in wri... |
import numpy as np
import scipy.sparse as sp
import torch
import sys
import pickle as pkl
import numpy as np
import networkx as nx
def common_loss(emb1, emb2):
emb1 = emb1 - torch.mean(emb1, dim=0, keepdim=True)
emb2 = emb2 - torch.mean(emb2, dim=0, keepdim=True)
emb1 = torch.nn.functional.normalize(emb1, ... |
class ValueParser_ByteWithUnit(object):
# upper case as uper() is invoked on the text to parse
__UNITS = {
"KBYTES": 1024,
"KB": 1024,
"K": 1024,
"MBYTES": 1024*1024,
"MB": 1024*1024,
"M": 1024*1024,
"GBYTES": 1024*1024*1024,
"GB": 1024*1024*1024,
"G": 1024*1024*1024,
"TBYTES": 1024*1024*1024... |
import json
import factories
import unittest
from nose.tools import assert_equal, assert_raises
from nose.plugins.skip import SkipTest
try:
from ckan.tests import factories as ckan_factories
from ckan.tests.helpers import (_get_test_app, reset_db,
FunctionalTestBase, assert_... |
import os
import unittest
from abc import ABC
from glob import glob
from shutil import rmtree
import numpy as np
from batchlib.workflows import run_cell_analysis, cell_analysis_parser
from batchlib.workflows.mean_and_sum_cell_analysis import mean_and_sum_cell_analysis
from batchlib.util import read_table, open_file, ... |
import os
import yaml
import getpass
from pathlib import Path
def initialize():
"""initialize .cfg file
prompt for user input:
1. check ~/.config/otello/otello.cfg if it exists
2. prompt user for HySDS host (Mozart IP or DNS)
- if it exists in config.yml then use existing value if not supplied... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 division, print_function, absolute_import
import multiprocessing
from past.builtins import range
'''
Author : Lyubimov, A.Y.
Created : 01/17/2017
Last Changed: 02/15/2019
Description : IOTA GUI Windows / frames
'''
import os
import numpy as np
import time
import wx
from wx.lib.agw im... |
# Copyright 2010-2017 Google
# 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... |
import os
import math
import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import itertools
import traceback
from .model import Alice, Bob, Eve
from .validation import validate
def train(args, trainloader, valloader, writer, logger, hp, hp_str):
alice = Alice(hp).cuda()
bob = Bob(hp... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... |
import subprocess
try:
import language_check
except ImportError:
pass
__doctest_skip__ = ['GrammarCorrector.correct']
def languagetool_commandline(bad_sentence, executable_path, temp_file='tmp.txt'):
with open(temp_file, 'w') as f:
f.write(bad_sentence)
return subprocess.check_output(['java'... |
VERSION="0.3"
|
__author__ = 'mpetyx'
from .models import OpeniCheckin
from OPENiapp.APIS.OpeniGenericResource import GenericResource
from OPENiapp.APIS.OPENiAuthorization import Authorization
from OPENiapp.APIS.OPENiAuthentication import Authentication
class CheckinResource(GenericResource):
class Meta:
queryset = Op... |
from socless import socless_bootstrap
from slack_sdk.web.client import WebClient
from slack_sdk.web.internal_utils import _parse_web_class_objects
from slack_helpers import SOCLESS_BOT_TOKEN
def handle_state(
api_method: str,
http_verb: str = "POST",
params: dict = None, # type: ignore
json: dict = ... |
''' Download cytometry data from papers'''
import os.path
import urllib.request
files = []
# 1. Download data from: "Single-Cell Mass Cytometry of Differential Immune and
# Drug Responses Across a Human Hematopoietic Continuum"
# Hosted on Cytobank
url = 'http://www.cytobank.org/nolanlab/cytof_bone_marrow_signaling_... |
class Target(object):
def __init__(self,name,ip,mac,port):
self.shortName=name
self.IP=ip
self.macaddress=mac
self.portNum=port
|
#!/usr/bin/env python
import io
from logging import Logger as PythonLogger
import os
import time
import sys
import traceback
from typing import Optional
import pandas as pd
from .application_warning import ApplicationWarning
TESTING_TOOLS = ["nose", "unittest", "pytest"]
# --- Copied from logging module ---
if has... |
# Copyright 2019 Google LLC
#
# 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, ... |
# -*- coding: utf-8 -*-
#
import matplotlib.pyplot as plt
import pytest
import colorio
@pytest.mark.parametrize('observer', [
colorio.observers.cie_1931_2(),
colorio.observers.cie_1964_10(),
])
def test_observers(observer):
lmbda, data = observer
# For plot colors, take the SRGB approximation of... |
from collections import namedtuple
from enum import Enum
class UpdateType(Enum):
MSG = 1
UPD = 2
Update = namedtuple("Update", ("raw", "type"))
class ReceiverType(Enum):
SOLO = 1
MULTI = 2
UNKNOWN = 3
Message = namedtuple("Message", (
"raw", "type", "text", "attachments", "sender_id",
... |
from tests.base import TestCase, assets, main # pylint: disable=import-error,no-name-in-module
from ocrd.resolver import Resolver
from ocrd_validators import PageValidator
from ocrd_validators.page_validator import get_text, set_text, ConsistencyError
from ocrd_models.ocrd_page import parse, TextEquivType
from ocrd_uti... |
# Copyright 2008-2018 pydicom authors. See LICENSE file for details.
"""Define the Dataset and FileDataset classes.
The Dataset class represents the DICOM Dataset while the FileDataset class
adds extra functionality to Dataset when data is read from or written to file.
Overview of DICOM object model
-----------------... |
# Generated by Django 2.0.8 on 2018-08-03 14:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('omis_invoice', '0010_populate_order_ref'),
('core', '0003_rename_read_permissions'),
]
operations = [
migrations.AlterModelOptions(
... |
import numpy as np
from scipy import stats
from ..external.six.moves import range
import numpy.testing as npt
from numpy.testing import assert_array_equal
import nose.tools
from nose.tools import assert_equal, raises
from .. import algorithms as algo
rs = np.random.RandomState(sum(map(ord, "test_algorithms")))
a_nor... |
"""Configuration of proxy to RequestsWebClient."""
from dataclasses import dataclass
@dataclass
class RequestsWebClientProxyConfig:
"""Configuration class of proxy to RequestsWebClient."""
http_proxy: str
https_proxy: str
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('donation', '0020_auto_20170213_1952'),
]
operations = [
migrations.AddField(
mo... |
__author__ = 'Rich Pearce'
# mock from calling: https://erikberg.com/events.json?date=20150614&sport=nba
mock_single_future_event_data = {
'events_date': '2015-06-14T00:00:00-04:00',
'event': [{
'start_date_time': '2015-06-14T03:45:56-04:00',
'event_id': '20150614-cleveland-cavaliers-at-... |
#
# Copyright 2019 The FATE 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 appl... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'Profile', fields ['created_on']
db.create_index('environments_profile', ['created_on'])
... |
#
# Copyright 2022 Logical Clocks AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from pytorch_lightning.utilities.cli import LightningCLI
from src.mnist_data_module import MNISTDataModule
from src.model import Model
if __name__ == "__main__":
LightningCLI(Model, MNISTDataModule)
|
"""Tests for error messages produced by our decompiler.
These error messages are parsed by the decompilation service and shown to the
user (either as-is or modified).
"""
from regression_tests import *
class NoSectionsOrSegmentsErrorTest(Test):
"""Checks that bin2llvmir fails with a proper error message when nei... |
"""Copyright (C) 2011 ESO/Centre de Recherche Astronomique de Lyon (CRAL)
binning : include Voronoi binning and sectors
"""
__version__ = '0.0.1'
__revision__ = '$Revision: 1.00 $'
__date__ = '$Date: 2012/03/04 15:05 $'
#try :
# import matplotlib
# from matplotlib import pylab
#except ImportError:
# print... |
# -*- coding: utf-8 -*-
"""Version-check script."""
import os
import sys
import codecs
Failed = 0
PYCM_VERSION = "3.2"
SETUP_ITEMS = [
"version='{0}'",
'https://github.com/sepandhaghighi/pycm/tarball/v{0}']
README_ITEMS = [
"[Version {0}](https://github.com/sepandhaghighi/pycm/archive/v{0}.zip)",
"pip... |
import asyncio
from collections import defaultdict
from enum import Enum
from typing import Any
from typing import DefaultDict
from typing import Dict
from typing import Iterable
from typing import List
from typing import Mapping
from typing import MutableMapping
from typing import Sequence
import a_sync
import pytz
f... |
import os
import traceback
import threading
class VcdLogger(object):
ACTIVITY_DUR = 1000 # 1000ns=1us
FILENAME = 'debugpins.vcd'
FILENAME_SWAP = 'debugpins.vcd.swap'
ENDVAR_LINE = '$upscope $end\n'
ENDDEF_LINE = '$enddefinitions $end\n'
#======================== singlet... |
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder
from pymodbus.payload import BinaryPayloadBuilder
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from pymodbus.compat import iteritems
from collections import OrderedDict
def linha():
print('=' * 70)
#-------... |
"""
Hashable and ordered collections.
"""
from __future__ import annotations
import functools
from typing import (
AbstractSet,
Dict,
Hashable,
Iterator,
List,
Mapping,
MutableMapping,
Optional,
Sequence,
Set,
TypeVar,
Union,
ValuesView,
)
T = TypeVar("T", covariant... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, NVIDIA CORPORATION. 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 copyright
# notice,... |
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = ... |
# Generated by Django 1.10.1 on 2016-09-07 18:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("institutions", "0004_auto_20160907_1556")]
operations = [
migrations.AlterField(
model_name="tag",
name="name",
field... |
#!/usr/bin/env python
# The number 3797 has an interesting property. Being prime itself,
# it is possible to continuously remove digits from left to right,
# and remain prime at each stage:
# 3797, 797, 97, and 7.
# Similarly we can work from right to left: 3797, 379, 37, and 3.
# Find the sum of the only eleven pri... |
# Lint as: python3
# Copyright 2019 DeepMind Technologies Limited.
#
# 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 ap... |
"""
This example introduces the use of TFLearn functions to easily summarize
variables into tensorboard.
TFLearn can summarize:
- Loss / Accuracy: The model loss and accuracy over training steps.
- Activations: Histogram of operation output values.(Requires to add each
activation to monitor into tf.Graphkeys.ACTIV... |
import unittest
from .user import UserTester
from pyfeatures import Feature, Manager
from pyfeatures.storage import FeatureStorage
from pyfeatures.storage.memory import MemoryStorage
class TestManager(unittest.TestCase):
def test_create_default_manager(self):
man = Manager()
self.assertIsInsta... |
"""This problem was asked by Google.
Determine whether a doubly linked list is a palindrome. What if itโs singly linked?
For example, 1 -> 4 -> 3 -> 4 -> 1 returns true while 1 -> 4 returns false.
""" |
import multiprocessing as mp
import Tkinter as tk
import PIL as pil
import PIL.ImageTk as itk # on fedora 24 needed $ dnf install python-pillow-tk
import numpy as np
import time
class NVMViz:
def __init__(self, pipe_to_nvm, history=512, padding=16):
self.pipe_to_nvm = pipe_to_nvm
self.pipe_to_nvm.s... |
# Generated by Django 2.2.2 on 2019-09-26 09:19
from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
# ('auth',... |
# MIT License
# Copyright (c) 2022 Zenitsu Prjktโข
# 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,... |
from __future__ import print_function, division, absolute_import
import random
import numpy as np
import copy
import numbers
import cv2
import math
from scipy import misc, ndimage
import multiprocessing
import threading
import traceback
import sys
import six
import six.moves as sm
import os
from skimage import draw
imp... |
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Google LLC
#
# 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 ... |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-, LabControl development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -------------------------------------------------... |
# 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 required by applicable law or agreed to in writing, software
# distributed under t... |
"""
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to do with the
labeling information
"""
import collections
fro... |
import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
engine = create_engine("sqlite:///Resources/hawaii.sqlite", connect_args={'check_... |
""" Generator for models based on KBs for random in silico organisms
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2018-06-11
:Copyright: 2018, Karr Lab
:License: MIT
"""
import wc_model_gen
from .initalize_model import InitalizeModel
from .metabolism import MetabolismSubmodelGenerator
from .transcription import Tran... |
# See readme.md for instructions on running this code.
from typing import Any, Dict
from zulip_bots.lib import BotHandler
class HelloWorldHandler:
def usage(self) -> str:
return """
This is a boilerplate bot that responds to a user query with
"beep boop", which is robot for "Hello World"... |
import numpy as np
import itertools as it
class SymbolicArray(np.ndarray):
def __new__(cls, arr, symbolic=None, **kwargs):
if isinstance(arr, cls):
return arr
arr = np.array(arr, copy=False, **kwargs)
obj = arr.view(cls)
obj.symbolic = str(symbolic or np.array2string(ar... |
from abc import (
ABC,
abstractmethod,
)
from enum import Enum
import itertools
from typing import (
TYPE_CHECKING,
Any,
Collection,
Dict,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
cast,
)
from platon_abi import (
grammar,
)
from platon_abi.codec import (... |
from cocotb_test.simulator import Icarus, Ius, run
import pytest
import os
hdl_dir = os.path.dirname(__file__)
class IcarusCustom(Icarus):
def run_command(self):
return ["vvp", "-v", "-l", self.logfile, "-M", self.lib_dir, "-m", "libcocotbvpi_icarus", self.sim_file]
@pytest.fixture(scope="module", auto... |
#
# Copyright (c) 2021 Project CHIP 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
#
# ... |
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.urls import reverse
from giscube.models import DBConnection
from layerserver.models import DataBaseLayer, DBLayerGroup, DBLayerUser
from tests.common import BaseTest
UserModel = ge... |
# coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... |
##
# Copyright 2021 IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
##
from lnn import Model, World, And, Variable, TRUE, UPWARD, Implies, Fact, Join
def test_1():
"""
And(isFather(x,z),isFather(z,y))
Using expanded outer joins
Closed World Assumption on isFather
"""
G... |
import pandas as pd
import psycopg2
import psycopg2.extras
class DBData():
def __init__(self, schema='wage_trust_demo'):
self._CSTR = {
'user' : 'postgres',
'password' : 'docker',
'host' : 'wage_trust_db'
}
self._schema = schema
de... |
import json
import pytest
from kingfisher_scrapy.exceptions import SpiderArgumentError
from kingfisher_scrapy.items import File, PluckedItem
from kingfisher_scrapy.pipelines import Pluck
from tests import spider_with_crawler
releases = [
{"date": "2020-01-01T00:00:00Z"},
{"date": "2020-10-01T00:00:00Z"},
]
r... |
from __future__ import with_statement
from itertools import chain
import datetime
import sys
import warnings
import time
import threading
import time as mod_time
import hashlib
from redis._compat import (b, basestring, bytes, imap, iteritems, iterkeys,
itervalues, izip, long, nativestr, unico... |
# coding=utf-8
# Copyright 2019 The Google AI Language Team 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 ... |
# Copyright 2015 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... |
from docx.shared import Inches, Pt
import csv
import requests
from docx.oxml.ns import qn
from docx.oxml.shared import OxmlElement
def addShadeToTxt(run,color="FFAAAA"):
# Get the XML tag
tag = run._r
#print(run.element.xml)
# Create XML element
shd = OxmlElement('w:shd')
# Add attributes to the element... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Spotify AB
import unittest
if __name__ == '__main__':
import os
import sys
names = [name[:-3]
for name in os.listdir(os.path.dirname(__file__))
if name.endswith('_test.py')]
for name in names: # preload all tes... |
#config_file = 'casia_face_regis_list.txt'
#test_file = 'casia_face_test_list.txt'
config_file = 'ms1m_face_regis_list.txt'
test_file = 'ms1m_face_test_list.txt'
import torch
from torch.utils.data import DataLoader
from torchvision import datasets
import numpy as np
import pandas as pd
import os
def embedding(file_n... |
import requests
import json
from requests.auth import HTTPBasicAuth
from requests import exceptions
class CouchbaseClient:
"""
Couchbase client instance, conforms to following REST API reference:
https://docs.couchbase.com/server/5.1/rest-api
"""
def __init__(self, protocol='http', host='loca... |
# -*- coding: utf-8 -*-
# Usage: main.py inputfilename.ext outputfilename.ext
# Example: main.py zawgyi.txt unicode.txt
import codecs
import win2uni
import uni2zg
import sys
input_file_name = sys.argv[1]
output_file_name = sys.argv[2]
input_file = codecs.open(input_file_name,encoding='utf-8')
output_file = codecs.op... |
#!/usr/bin/env python3
# Copyright 2019 Hitachi, Ltd. (author: Yusuke Fujita)
# Licensed under the MIT license.
#
import os
import numpy as np
import chainer
from chainer import optimizers
from chainer import serializers
from chainer import iterators
from chainer import training
from chainer.training import extensions... |
import responses
from tests.util import random_str
from tests.util import mock_http_response
from binance.spot import Spot as Client
mock_item = {"key_1": "value_1", "key_2": "value_2"}
key = random_str()
secret = random_str()
@mock_http_response(responses.POST, "/sapi/v1/bnbBurn", mock_item, 200)
def test_toggle_... |
a, b = map(int, input().split())
"""s = bin(a)
t = bin(b)
s = s[2:]
t = t[2:]
cri = len(t)
s = (cri - len(s)) * "0" + s
q = 0
for i in reversed(range(len(s))):
if i == len(s) - 1:"""
#F(A, B) = F(0, A โ 1) โ F(0, B),ใชใใชใ n โ n = 0
#ไปปๆใฎๅถๆฐ n ใซใคใใฆ n โ (n + 1) = 1
def F(x):
if x == -1:
return 0
elif x ... |
# coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... |
from corpus_parser import Corpus
from skipgram import skipgram
def train_skipgram(fnames, extn, learning_rate, embedding_size, num_negsample, epochs,
batch_size, arguments): # , output_dir):
'''
:param corpus_dir: folder containing WL kernel relabeled files. All the files in this folder w... |
# test_hashes.py
#
# Copyright (C) 2006-2016 wolfSSL Inc.
#
# This file is part of wolfSSL. (formerly known as CyaSSL)
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licens... |
import glob
import numpy as np
import random as random
import pandas as pd
from math import *
from datetime import datetime
from experiment_helper_functions import *
from pipeline_helper_functions import *
from attachment_model_inference import *
def get_rankscores_search(G, test_params, metrics, subnet_dir, num_to_... |
import difflib
import datetime
import time
import random
import re
import math
import mongoengine as mongo
import zlib
import hashlib
import redis
import pymongo
import HTMLParser
from collections import defaultdict
from operator import itemgetter
from bson.objectid import ObjectId
from BeautifulSoup import BeautifulSo... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0_1
from i... |
# 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 ... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import logging
import os
import random
from io import open
import numpy as np
import math
from tensorboardX import... |
# Copyright 2020 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
__author__ = 'Maxim Dutkin (max@dutkin.ru)'
from m2core import M2Core
from m2core.bases import BaseHandler, http_statuses
from m2core.common import PermissionsEnum, Permission
from m2core.utils.tests import M2CoreAsyncHTTPTestCase
class SamplePermissionsHandler(BaseHandler):
@M2Core.user_can
def get(self, *... |
#!/usr/bin/env python
# coding=utf-8
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="Constrained_GaussianProcess",
version="0.0.5",
author="Liaowang Huang",
author_email="liahuang@student.ethz.ch",
description="Implementation of Python ... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Layer'
db.create_table('maps_layer', (
('id', self.gf('django.db.models.fields.A... |
'''
โโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโ
ZUMBY NSR CC [...]
'''
import os
import time
import discord
from discord.ext import commands
import GoodAnimeMemes
from webserver import keep_alive
bot = commands.Bot(command_prefix='$')
# Server info display in Console when bot runs
@bot.event
async def on_ready... |
import warnings
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
from packaging.version import parse as version
from scipy.ndimage.interpolation import zoom
from tensorflow.python.keras.layers.convolutional import Conv
from tf_keras_vis import ModelVisualization
from tf_keras_vis.utils ... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
from .action import CreateDistributionPlot
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import socket
import socks
import time
import json
import paramiko
import logging
import string
import random
import os
from core.alert import *
from core.targets import target_type
from core.targets import target_to_host
from core.load_modules import load... |
from typing import List, Tuple
import numpy as np
from scipy.special import erfc
from scipy.special import gammaincc
class RandomExcursions:
@staticmethod
def random_excursions_test(
binary_data:str, verbose=False, state=1
) -> List[Tuple[str, float, bool]]:
"""
from the NIST ... |
'''MIT License. Copyright (c) 2020 Ivan Sosnovik, Michaล Szmaja'''
from collections import OrderedDict
def parse_range_tokens(tokens):
'''Convert list of tokens into a list of sorted integers according to special rules.
# Input:
tokens: list of str. [str1, str2, ..., strN]
# Output:
list: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.