text
stringlengths
957
885k
import sys, os, pickle import pandas as pd from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from sklearn.metrics import classification_report, confusion_matrix, roc_curve, auc, accuracy_score, precision_score, recall_score, f1_score from sklearn.linear_model import LogisticRegression from ...
import random import math import copy import itertools class mReasoner(): """ mReasoner implementation based on <NAME>. and <NAME>. (2013). Some functions are directly translated from the source. For original code see http://www.modeltheory.org/models/mreasoner/ """ def __init__(self): se...
# -*- coding: utf-8 -*- from duckietown_utils import DuckietownConstants from duckietown_utils import get_list_of_packages_in_catkin_ws from duckietown_utils import on_circle, on_laptop from duckietown_utils import on_duckiebot from .checks import * # @UnusedWildImport from .entry import Diagnosis, Entry, SeeDocs fro...
# coding = utf-8 import numbers from typing import Union, List import torch from torch import Tensor, Size from torch.nn import Module, init from torch.nn.parameter import Parameter from torch.autograd import Variable from torch.nn.functional import normalize # cite: https://github.com/lancopku/AdaNorms # cite: Neu...
<filename>Menu.py from Record import Record # Menu class to store record class class Menu(Record): menu_dict = {} lastIndex = 0 def add_record(self, prod_name, prod_code, unit_price, quantity, salesperson_id): if len(self.menu_dict) == 0: index = 1 else: index = in...
<gh_stars>0 # Copyright (c) 2016, 2017, 2018, 2019 <NAME>. # # clgen 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 the License, or # (at your option) any later version. # # clgen is distr...
<reponame>dwlcreat/dsf ''' Function: 乒乓球小游戏-主函数 Author: Charles 微信公众号: Charles的皮卡丘 ''' import sys import config import pygame from sprites import * '''定义按钮''' def Button(screen, position, text, button_size=(200, 50)): left, top = position bwidth, bheight = button_size pygame.draw.line(screen, (150, 150, 150), (...
<gh_stars>1-10 #!usr/bin/env/python3 # -*- coding: utf-8 -*- # 1. Test with no Minitrino directory # 2. Test with no Minitrino config file (ensure template is created) # 3. Test reset w/ existing config dir and file (ensure template is created) # 4. Test editing an invalid config file import os import subprocess impo...
<filename>tripleoclient/tests/v1/overcloud_deploy/fakes.py<gh_stars>0 # Copyright 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/l...
<gh_stars>0 import collections, datetime, functools, itertools import json, logging, pathlib, random, re import unittest import heapq from logging import DEBUG, INFO, WARNING, ERROR, FATAL import sds_ml.tree_search as tree_search log = logging.getLogger(__name__) class TestTreeSearch(unittest.TestCase): def setU...
<filename>src/WinEoP/api_scanner.py #------------------------------------------------------------------------------- # Name: api_scanner.py # Purpose: auto generate code for WinEoP # Author: quangnh89 # Created: 2015 #------------------------------------------------------------------------------- i...
<reponame>softwarefactory-project/rdopkg # -*- encoding: utf-8 -*- from __future__ import print_function import json import os from six.moves import input from rdopkg import action as _action from rdopkg import actions from rdopkg import const from rdopkg import exception from rdopkg import helpers from rdopkg.utils i...
from functools import partial import numpy as np from scipy.interpolate import BSpline import torch from itertools import product class AbstractBasis(object): def __init__(self): self.basis_functions = [] self.is_setup = False def get_basis_functions(self): if not self.is_setup: ...
''' stemdiff.radial --------------- Convert a 2D powder diffraction pattern to a 1D radially averaged distribution profile. ''' import numpy as np import matplotlib.pyplot as plt from skimage import measure def calc_radial_distribution(arr): """ Calculate 1D-radially averaged distrubution profile...
#!/usr/local/bin/python3.4 import os, sys, logging, json, argparse, time, datetime, requests, uuid from concurrent.futures import ThreadPoolExecutor from web3 import Web3 from sdn_mapper import sdn_mapper from vl_computation import vl_computation from database import database as db from config_files import settings ...
<gh_stars>0 import selenium from selenium import webdriver import numpy as np import pandas as pd import bs4 from bs4 import BeautifulSoup import time """ This code is used to scrape ScienceDirect of publication urls and write them to a text file in the current directory for later use. To use this code, go to Science...
import click import os from pathlib import Path @click.command() @click.argument('name') # @click.argument('path') def createbot(name): path='.' if os.path.isdir(os.path.join(name,path)): click.echo(f"\u001b[31mError\u001b[0m : '{name}' folder already exists in the current directory.") retur...
# 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 gae_ts_mon swarming_tasks = gae_ts_mon.CounterMetric( 'findit/swarmingtasks', 'Swarming tasks triggered', [gae_ts_mon.StringField('category')...
<reponame>b-bold/ThreatExchange<filename>hasher-matcher-actioner/tests/scripts/check_deployed_instance.py #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ Utility script to confirm the basic functionally of a deployed hma instance """ import typing as t import os impor...
""" Module Source: https://github.com/eladhoffer/quantized.pytorch """ import torch from torch.autograd.function import InplaceFunction, Function import torch.nn as nn import torch.nn.functional as F import math import numpy as np class UniformQuantize(InplaceFunction): """! Perform uniform-quantization on i...
<filename>src/timessquare/config.py<gh_stars>0 """Configuration definition.""" from __future__ import annotations from enum import Enum from typing import Any, Mapping, Optional from urllib.parse import urlparse from arq.connections import RedisSettings from pydantic import ( BaseSettings, Field, HttpUr...
<filename>custom_loops/ICELoops.py import time import os from QTMtoolbox_master.functions import qtmlab class ICELoops(): def __init__(self): print('Running measurement using ICELoops class.') def RT_Field(self,instruments_dict, meas_list, dtw, magnet_instrument, variable, setpoint, ...
<reponame>bear/palala #!/usr/bin/env python2.6 __author__ = "<NAME> (<EMAIL>)" __copyright__ = "Copyright 2009-2010, <NAME>" __license__ = "Apache v2" __version__ = "0.1" __contributors__ = [] """ bSwitch - input bot switch Loads a process per account to pull down each defined list """ import os, sys import time im...
<reponame>Cylon-bot/toolbox-for-trading-bot from typing import List, Optional, Union, Dict import pandas as pd __author__ = "<NAME>" __copyright__ = "Copyright 2021, Thibault Delrieu" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Production" class Candle: """ ...
<filename>hdtscraper/main.py import requests from bs4 import BeautifulSoup import re import time import os class hdtscraper: page_url = 'https://hdtorrents.xyz/index.php?page={}' session = None session_start = None login_url = 'https://hdtorrents.xyz/takelogin.php' home_url = 'https://hdtorrents.xyz' session_len...
import pandas as pd import matplotlib.pyplot as plt import numpy as np import pickle import argparse import random import copy from transformers import AutoTokenizer import torch import torch.nn as nn from eval import get_token_segments, confusion_matrix_tokens, evaluate_model_answer_spans, get_jaccard_score CRA_TOKEN...
"""Perform integration tests for `orion.algo.ax`.""" import statistics as stats from typing import ClassVar, List import pytest from orion.algo.axoptimizer import has_Ax from orion.benchmark.task.base import BenchmarkTask from orion.core.utils import backward from orion.testing.algo import BaseAlgoTests, TestPhase, f...
<reponame>pochiel/mitsune_3_bot import sqlite3 from contextlib import closing import pickle import bz2 from athreat import athreat import datetime class data_manager(object): def set_team(self, t_name, t_symbol, owner_id): team = (t_symbol, t_name, owner_id) try: with closing...
<gh_stars>0 class Node: def __init__(self, value): self.value = value self.next = None def __repr__(self): return str(self.value) class LinkedList: def __init__(self): self.head = None def __str__(self): cur_head = self.head out_string = "" whi...
import sys import os.path import torch import visdom import argparse import random import time import math from PIL import Image import numpy as np import torch.nn as nn import torch.backends.cudnn as cudnn import torch.nn.functional as F import torchvision.models as models from torch.autograd import Variable from tor...
<gh_stars>0 import sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from awsglue.context import GlueContext from awsglue.job import Job from awsglue.dynamicframe import DynamicFrame import pyspark.sql.functions as F ## @params: [JOB_NAME] args =...
# TensorFlow and tf.keras import tensorflow as tf from tensorflow import keras from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt # Helper libraries from pandas import read_csv import numpy as np import pandas as pd import cv2 print(tf.__version__) array_of_img = [] # this if for st...
<reponame>fran-f/keypirinha-terminal-profiles<filename>src/terminal_profiles.py """ Windows Terminal Profiles plugin More info at https://github.com/fran-f/keypirinha-terminal-profiles """ # Disable warning for relative import statements # pylint: disable=import-error, relative-beyond-top-level import os imp...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2016 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
# Copyright (c) 2016 The UUV Simulator 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 b...
<reponame>nccgroup/libptmalloc<gh_stars>10-100 # -*- coding: future_fstrings -*- from __future__ import print_function import argparse import binascii import struct import sys import logging import pprint import re from libptmalloc.frontend import printutils as pu from libptmalloc.frontend import helpers as h from li...
"""Helper utility functions.""" import collections def deep_update(source, overrides): """Update a nested dictionary or similar mapping. Modify ``source`` in place. """ for key, value in overrides.iteritems(): if isinstance(value, collections.Mapping) and value: returned = deep_up...
import frappe from dateutil import parser from frappe.model.rename_doc import rename_doc from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice from dcl.inflow_import.stock import make_stock_entry def truncate(f, n): '''Truncates/pads a float f to n decimal places without rounding'...
#!/usr/bin/env python """ .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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 ...
"""Utils for loading and adding annotations to the data""" import ast import logging import msgpack import os import pandas as pd from functools import lru_cache from gensim.corpora import Dictionary from gensim.matutils import corpus2csc from spacy.tokens import Doc from tqdm import tqdm from src import HOME_DIR from...
<gh_stars>10-100 import json import pandas as pd import hashlib import os # mapping from: https://pbpython.com/pandas_dtypes.html # -> https://gitlab.datadrivendiscovery.org/MIT-LL/d3m_data_supply/blob/shared/schemas/datasetSchema.json DTYPES = { 'int64': 'integer', 'float64': 'real', 'bool': 'boolean', ...
<filename>lib/utils/net_utils.py<gh_stars>100-1000 import torch from torch import nn from easydict import EasyDict import os from tensorboardX import SummaryWriter import torchvision.utils as vutils import numpy as np class History: def load_dict(self, *args): raise NotImplementedError() def plot(s...
""" # -*- coding: utf-8 -*- ----------------------------------------------------------------------------------- # Author: <NAME> # DoC: 2020.08.09 # email: <EMAIL> ----------------------------------------------------------------------------------- # Description: The utils of the kitti dataset # Modified: <NAME> # email...
<reponame>omari-funzone/commcare-hq from collections import namedtuple from itertools import groupby import itertools from django.db.models import Q from casexml.apps.case.const import UNOWNED_EXTENSION_OWNER_ID, CASE_INDEX_EXTENSION from casexml.apps.case.signals import cases_received from casexml.apps.case.util impo...
<gh_stars>10-100 # -*- coding: utf-8 -*- # Copyright (C) 2019 - 2020 by <NAME>, Rector and Visitors of the # University of Virginia, University of Heidelberg, and University # of Connecticut School of Medicine. # All rights reserved. # Copyright (C) 2017 - 2018 by <NAME>, Virginia Tech Intellectual # Properties, ...
<filename>entailment/data.py import json import os from typing import List, Dict from torch.utils.data import Dataset def make_jsonl_data(bbc_summary_data_dir: str, split_file_path: str, output_dir: str): with open(split_file_path) as fin: ds_split = json.load(fin) ...
""" ********************************************************************************** * Project: HistFitter - A ROOT-based package for statistical data analysis * * Package: HistFitter * * ...
import copy # import json import requests class ApiError(Exception): pass class ApiValidationError(ApiError): pass class SectionStatus: PRIVATE = 1 PUBLIC = 2 UNLISTED = 3 class ApiBase: API_VERSION = '1.3' def __init__(self, domain, api_key, http_auth_user=None, http_auth_pwd=None...
<filename>research/cv/VehicleNet/eval.py # Copyright 2021 Huawei Technologies Co., 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 # # Unles...
<filename>openerp/addons/l10n_in_hr_payroll/report/payslip_report.py # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free sof...
from eyed3.utils.log import log as eyed3_log from discogs_client.exceptions import HTTPError from eyed3.id3 import Genre from difflib import SequenceMatcher import genre.config as config import eyed3 import click import discogs_client import pathlib import colorama import pickle import logging import time # quiet abou...
<filename>tests/test_geometry.py from math import hypot, isclose, sqrt from hypothesis import given from hypothesis.strategies import floats, integers, tuples from algorithms.geometry import ( Line2, Vec2, Vec3, angle_cmp, circle_intersection, circle_line_intersection, convex_hull, con...
<gh_stars>0 """BuiltinLED channels of board protocol.""" # Standard imports import logging from abc import abstractmethod from typing import Iterable, List, Optional # Local package imports from lhrhost.messaging.presentation import Message from lhrhost.protocol import Command, ProtocolHandlerNode from lhrhost.util.i...
""" @brief test tree node (time=2s) """ import unittest import numpy from sklearn.cluster import KMeans, MiniBatchKMeans from sklearn.datasets import load_digits, load_iris from pyquickhelper.pycode import ExtTestCase from skl2onnx import convert_sklearn from skl2onnx.common.data_types import FloatTensorType, Int6...
import pytest from fenChecker import Fen, WarningMsg import mock startingFen = 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1' # -------------------- Fixtures ----------------------------------------------- @pytest.fixture def good_fen(): # sets up a Fen object with a valid fen # postion after 1 e...
<gh_stars>1-10 #------------------------------------------------------------------------------- # # Project: ngEO Browse Server <http://ngeo.eox.at> # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # #------------------------------------------------------------------------------- # Co...
import os import numpy as np import pandas as pd from scipy.misc import imread import tensorflow as tf from six.moves import urllib import keras from keras.models import Sequential from keras.layers import Dense, Flatten, Reshape, InputLayer from keras.regularizers import L1L2 from scipy.misc import imsave import gz...
<gh_stars>1-10 import os import sys import numpy as np from bokeh.io import curdoc from bokeh.models import ColumnDataSource, Span, Label, Slider from bokeh.models.widgets import Div from bokeh.models.glyphs import Circle from bokeh.plotting import figure from bokeh.layouts import row, column, widgetbox BOKEH_BASE_DI...
from jumpscale.sals.chatflows.chatflows import chatflow_step from jumpscale.sals.marketplace import MarketPlaceAppsChatflow, deployer from jumpscale.loader import j import nacl from jumpscale.sals.reservation_chatflow import deployment_context, DeploymentFailed class Discourse(MarketPlaceAppsChatflow): FLIST_URL ...
# -*- coding: utf-8 -*- """ ===========================================# # Title: Review Analysis using NLP and Naive Bayes # Date: 7 Jan 2020 @author: <NAME> #==========================================# """ ############################### Natural Language Processing ####################### # Import...
<gh_stars>1000+ # -*- coding: utf-8 -*- class colors: """Colors class: reset all colors with colors.reset two subclasses fg for foreground and bg for background. use as colors.subclass.colorname. i.e. colors.fg.red or colors.bg.green also, the generic bold, disable, underline, reverse, striket...
<filename>src/parser_util.py # coding=utf-8 import os import argparse def get_parser(): parser = argparse.ArgumentParser() parser.add_argument('-root', '--dataset_root', type=str, help='path to dataset', default='..' + os.sep + ...
<filename>neutron_tempest_plugin/scenario/test_dhcp.py # 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 #...
<gh_stars>10-100 import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch from utils import weights_init class CNN_simple(nn.Module): def __init__(self, obs_shape, stack_frames): super(CNN_simple, self).__init__() self.conv1 = nn.Conv2d(obs_shape[0], 3...
<reponame>Rutherford-sudo/PigTelegramBot import logging import requests import telebot import json import os from flask import Flask, request import random from textwrap import wrap from translate import Translator server = Flask(__name__) TOKEN = "YOUR TELEGRAM TOKEN" bot = telebot.TeleBot(TOKEN,parse_mode=None) GR...
<gh_stars>0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distrib...
#!/usr/bin/env python import os import json from subprocess import check_output from collections import OrderedDict, defaultdict from collections.abc import Mapping import glob from contextlib import contextmanager import requests from requests_oauthlib import OAuth2 def main(version, push=None): """ WARNIN...
import pygame from player import Player from image import Image from wall import Wall from spike import Spike from grass import Grass import config as cfg class Level: def __init__(self): self.player = Player() self.lifeImage = Image("media/heart.png", alpha=True) # Set number of lifes ba...
<reponame>anubav/edl<gh_stars>0 import numpy as np from .activations import IDENTITY class Dataset: """Target for data analysis by a neural network""" def __init__(self, inputs, targets) -> None: self.inputs = inputs self.targets = targets self.size = len(inputs) class ...
from unittest.mock import patch import numpy as np import pandas as pd import pytest from sklearn.model_selection import GroupKFold, KFold from tests.test_pipelines.conftest import ( DummyDataset, DummyGroupedDataset, DummyOptimizablePipeline, dummy_single_score_func, ) from tpcp.optimize import Optim...
from seqeval.metrics import ( accuracy_score, f1_score, precision_score, recall_score, classification_report ) from transformers import EvalPrediction import numpy as np from typing import List, Dict # https://huggingface.co/metrics/seqeval # https://github.com/huggingface/transformers/blob/master/examples/toke...
import traceback import hues from plugin_system import PluginSystem from vkplus import Message try: import settings except ImportError: pass class Command(object): __slots__ = ('has_prefix', 'text', 'bot', 'command', 'args', "msg") def __init__(self, msg: Message): self.ha...
<reponame>jeisenma/traceSelectionInMaya ## Vector class ## <NAME> ## ACCAD, The Ohio State University ## 2012 from random import uniform as _VectorUniform # be careful here to not import on top of from math import sqrt as _VectorSqrt # other imports that may already exist from math import acos as _Vec...
import io import csv import datetime as dt from collections import defaultdict from sqlalchemy import func from server import jobs from server.models import Course, Enrollment, ExternalFile, db, GroupMember, Score from server.utils import encode_id, local_time from server.constants import STUDENT_ROLE TOTAL_KINDS = ...
<reponame>mqtthiqs/mutable<filename>tides/resources/waveforms.py #!/usr/bin/python2.5 # # Copyright 2014 <NAME>. # # Author: <NAME> (<EMAIL>) # # 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...
<filename>tests/du_test.py # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use du_test 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, soft...
from flask.ext.testing import TestCase from flask import url_for import unittest import json import httpretty from orcid_service import app from orcid_service.models import db, User from stubdata import orcid_profile class TestServices(TestCase): def create_app(self): '''Start the wsgi application''' ...
<filename>pyvision/detection/efficientdet/train.py import os import argparse import time from tqdm.auto import tqdm import shutil import numpy as np import sys import torch.nn as nn import torch from torch.utils.data import DataLoader from torchvision import transforms from tensorboardX import SummaryWriter sys...
from __future__ import unicode_literals from pytest import fixture from tcg.ast.lexer import create_lexer @fixture def lexer(): return create_lexer() def get_types_and_values(lexer, doc): extract_types = lambda tokens: [t.type for t in tokens] extract_values = lambda tokens: [t.value for t in tokens] ...
<reponame>preym17/csit #!/usr/bin/env python2 # Copyright (c) 2019 Cisco and/or its affiliates. # 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-...
<filename>Params4Buttai.py """ Assuming the original model looks like this: model = Sequential() model.add(Dense(2, input_dim=3, name='dense_1')) model.add(Dense(3, name='dense_2')) ... model.save_weights(fname) # new model model = Sequential() model.add(Dense(2, input_dim=3, name='dense_1')) # w...
import argparse import collections from io import StringIO from copy import deepcopy import difflib from pathlib import Path import six import yaml try: from colorama import Fore, Back, Style, init init() except ImportError: # fallback so that the imported classes always exist class ColorFallback: ...
######################################## ## Adventure Bot "Dennis" ## ## commands/item.py ## ## Copyright 2012-2013 PariahSoft LLC ## ######################################## ## ********** ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software...
<reponame>yinghai/benchmark import torch import argparse from torchbenchmark.util.model import BenchmarkModel from typing import List, Tuple def parse_args(model: BenchmarkModel, extra_args: List[str]) -> argparse.Namespace: parser = argparse.ArgumentParser() # by default, enable half precision for inference ...
<gh_stars>1-10 ''' A test set to check whether the Weisfeiler-Leman Algorithm has been implemented as expected ''' from WL_Wrapper import WL_Wrapper from compression_schemes import StringCompressionScheme from compression_schemes import IteratorScheme import networkx as nx test_status = ''' Test Name: {Name} Result: {r...
#!/usr/bin/env nix-shell #!nix-shell -i python -p python3 nix gitRepo nix-prefetch-git -I nixpkgs=./pkgs from typing import Optional, Dict from enum import Enum import argparse import json import os import subprocess import tempfile REPO_FLAGS = [ "--quiet", "--repo-url=https://github.com/danielfullmer/tools...
<reponame>kidist-amde/birth-monitor<filename>flaskApp.py<gh_stars>0 from flask import Flask from flask import render_template from flask import redirect, url_for, request from get_old_tweets import get_tweets from tweet_collection import get_recent_tweets from birth_prediction import build_dataset,train_estimator,comp...
import torch from .common import front, safeSign from ..device import device import warnings warnings.simplefilter("always",DeprecationWarning) """ Implementation from ternary connect : https://arxiv.org/pdf/1510.03009.pdf """ class TernaryConnectDeterministic(torch.autograd.Function): r""" Ternary determinis...
<filename>phconvert/smreader.py<gh_stars>10-100 # # phconvert - Reference library to read and save Photon-HDF5 files # # Copyright (C) 2014-2015 <NAME> <<EMAIL>> # """ SM Format written by <NAME>'s LabVIEW program in WeissLab us-ALEX setup ----------------------------------------------------------------------------- A...
# -*- coding: utf-8 -*- # Copyright (C) 2019 - TODAY <NAME> - Akretion import os import sys from os import path from xmldiff import main sys.path.append(path.join(path.dirname(__file__), '..', 'nfelib')) from nfelib.v4_00 import leiauteNFe_sub as nfe_sub from nfelib.v4_00 import retEnviNFe as nfe from nfelib.v4_00 imp...
# author: WatchDogOblivion # description: TODO # WatchDogs SMTP Service import os import smtplib import mimetypes from email import encoders from email import message # pylint: disable=unused-import from email.header import Header from email.mime.text import MIMEText from email.mime.audio import MIMEAudio from email...
import sublime import sublime_plugin import re import sys from time import time # Ideas taken from C0D312, nizur & tito in http://www.sublimetext.com/forum/viewtopic.php?f=2&t=4589 # Also, from https://github.com/SublimeText/WordHighlight/blob/master/word_highlight.py def plugin_loaded(): global Pref class ...
<reponame>AuroreBussalb/meta-analysis-statistical-tools<gh_stars>1-10 # -*- coding: utf-8 -*- """ .. module:: perform_meta_analysis :synopsis: module performing a meta-analysis .. moduleauthor:: <NAME> <<EMAIL>> """ import numpy as np import scipy.stats as scp import pandas as pd import warnings import matplotl...
<reponame>bogdanova1/stepik_ui<filename>HomeWork3.py from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import random import string import sys import traceback import locators...
<filename>federaciones/models.py from django.db import models from django.utils.text import slugify import os import random # from gauss.funciones import pass_generator from autenticar.models import Gauser from entidades.models import Entidad # Generador de contraseñas def pass_generator(size=15, chars='ABCDEFGHJKLMN...
<reponame>Gunbard/FindFrame # FindFrame # Author: Gunbard from posixpath import join import cv2, json, math, os, subprocess, asyncio, qasync, sys from datetime import datetime from enum import Enum from mainWindow import Ui_MainWindow from resultsWindow import Ui_ResultsWindow from PyQt5 import QtCore, QtWidgets from ...
#!/usr/bin/env python3 import argparse from collections import OrderedDict import matplotlib matplotlib.use('Agg') from matplotlib import pyplot import pandas import numpy import logging from woldrnaseq import models from woldrnaseq.common import save_fixed_height logger = logging.getLogger(__name__) def main(cmd...
<filename>examples/deebert/src/modeling_highway_bert.py import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from transformers.file_utils import add_start_docstrings, add_start_docstrings_to_callable from transformers.modeling_bert import ( BERT_INPUTS_DOCSTRING, BERT_START_DOCSTRIN...
<filename>tests/functional/test_path_encodings.py # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for di...
<gh_stars>1-10 # this file to create a sql-dump file for anduin _indent = ' ' _change_line = '\n' _func_define = 'def ' _func_return = 'return' class frame_constructor(object): def __init__(self, db_name, table_struct, file_path, file_name): self.table_struct = table_struct self.db_name = db_na...