text
stringlengths
957
885k
import sys from PySide2 import QtWidgets, QtGui from auto_assistant.controller import actions_controller, action_execution from auto_assistant.view import action_list_widgit class MainWindow(QtWidgets.QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.__configure_menu_bar(...
<filename>src/Models/UNet/DualAttentionUNet.py from tensorflow.python.keras.layers import Input, Dense, Convolution2D, MaxPooling2D, Dropout, Flatten, SpatialDropout2D, \ ZeroPadding2D, Activation, AveragePooling2D, UpSampling2D, BatchNormalization, ConvLSTM2D, \ TimeDistributed, Concatenate, Lambda, Reshape, U...
#! /usr/bin/env python import sys import time import json import socket import threading try: import weaver.client as client except ImportError: import client global eventTime data = [] eventTime = 0 eventCount = 0 eventInterval = 0 finished = False def addVertex(weaver, vertex, state): try: wea...
""" PySpark ALS Recommendation Alternate Least Squared matrix representation of Users and Items matrix, not suitable for high ColdStart ratio of users at inference. """ import json import itertools from pathlib import Path import pandas as pd from sklearn.neighbors import NearestNeighbors from pyspark.ml.e...
<reponame>itsShnik/visual-relationship-classifier import _init_paths import numpy as np import json import base64 import copy import glob import time import random import matplotlib.pyplot as plt import pickle import torch.nn as nn import torch import torch.utils.data as Data from PIL import Image from torchvision imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from django.test import TestCase from moneyed import Money from bazaar.goods.models import Product, CompositeProduct from bazaar.listings.models import Listing from bazaar.settings import bazaa...
from expedition import Expedition from fleet import Fleet from quests import Quests from config import Config from fight_runner import FightRunner from expedition_runner import ExpeditionRunner from return_fleet_checker import ReturnFleetChecker from resupply_runner import ResupplyRunner from fight_checker import Figh...
<reponame>nataliemcmullen/WikiMiney urls = [ "pagecounts-20121201-000000.gz", "pagecounts-20121201-010000.gz", "pagecounts-20121201-020001.gz", "pagecounts-20121201-030000.gz", "pagecounts-20121201-040000.gz", "pagecounts-20121201-050000.gz", "pagecounts-20121201-060000.gz", "pagecounts-20121201-070000.gz", "pagecounts...
<gh_stars>0 # test_unpacker.py """Unit tests for lta/unpacker.py.""" from unittest.mock import call, mock_open, patch import pytest # type: ignore from tornado.web import HTTPError # type: ignore from lta.unpacker import Unpacker, main from .test_util import AsyncMock @pytest.fixture def config(): """Supply ...
import unittest import os import gzip import tempfile import target_snowflake.file_formats.csv as csv def _mock_record_to_csv_line(record, schema, data_flattening_max_level=0): return record class TestCsv(unittest.TestCase): def setUp(self): self.maxDiff = None self.config = {} def te...
<gh_stars>0 #!/usr/bin/env python # # Modified work Copyright (c) 2019 by VMware, Inc. ("VMware") # Original work Copyright (c) 2018 by Network Device Education # Foundation, Inc. ("NetDEF") # # Permission to use, copy, modify, and/or distribute this software # for any purpose with or without fee is hereby granted, pr...
<gh_stars>10-100 import unittest from nose.tools import assert_equal from mock import Mock, patch, ANY from tests.tools import create_mock_json from twilio.rest.resources import Call, Calls AUTH = ('foo', 'bar') class CallFeedbackTest(unittest.TestCase): @patch('twilio.rest.resources.base.make_twilio_request')...
""" main.py Handles all accessible URI's for flask """ from flask import Flask, render_template, request, g from darkweb.modules.base.crawlerconfig import CrawlerConfig from darkweb.modules.irc.irc import IRC from darkweb.modules.web.WebCrawler import WebCrawler from darkweb.modules.parser.search import search from dar...
import duckdb try: import pyarrow as pa import pyarrow.parquet import numpy as np import pandas as pd import pytest can_run = True except: can_run = False def compare_results(query): true_answer = duckdb.query(query).fetchall() from_arrow = duckdb.from_arrow(duckdb.query(query).arro...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 2 14:07:44 2021 @author: fa19 """ import numpy as np import matplotlib.pyplot as plt ds_arr = np.load('/home/fa19/Documents/Benchmarking/data/bayley/full.npy', allow_pickle=True) import numpy as np import torch import random from scipy.interpo...
print('\n' * 100 + '@ TelegramBackup is loading...') import os.path from tgback_utils import ( TelegramAccount, TgbackAES, restore, VERSION, qr_available, image_error, scanqrcode ) from getpass import getpass from sys import platform from traceback import print_exc from time import ctime, strftime from reeds...
""" Catalog Receptor Plugin Forwards HTTP GET and POST requests to the Ansible Tower The plugin is invoked by the receptor when it gets requests from the platform controller. """ from urllib.parse import urlparse from urllib.parse import parse_qsl from urllib.parse import urljoin from distutils.util import strt...
<filename>pareto.py __author__ = "jeanlouis.mbaka" import csv import sys import pandas as pd import numpy as np class Pareto(): def __init__(self): pass def read_data(self, filename): """ Read data from filename """ results = read_csv(filename) self.header = results[0] self.raw_data = results[1] ...
import pprint # Get the html end. def get_html_begin(): return "<!DOCTYPE html> \n" + " <html> \n" # Get the html end. def get_html_end(): return "\n </html>" def writeErrorMessageHtml(error_message): html_code = "" html_code = html_code + get_html_begin() html_code = html_code + "<body>" ...
#!/usr/bin/env python # import argparse import os from souvenir_utils import * parser = argparse.ArgumentParser() parser.add_argument('source_dir', help='source root directory') parser.add_argument('target_dir', help='backup root directory') parser.add_argument('-p', '--path', help='display full path', action='store...
import bottleneck as bn import numpy as np from scipy import sparse def NDCG_binary_at_k_batch(X_pred, heldout_batch, k=100, input_batch=None, normalize=True): ''' normalized discounted cumulative gain@k for binary relevance ASSUMPTIONS: all the 0's in heldout_data indicate 0 relevance If normalize is...
<reponame>betochimas/cugraph<filename>python/cugraph/cugraph/gnn/graph_store.py # Copyright (c) 2022, <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/licen...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # GNU General Public License v3.0 # # Permissions of this strong copyleft license are conditioned on making available # complete source code of licensed works and modifications, which include larger works # using a licensed work, under the same license. Copyright and license...
# -*- coding: utf-8 -*- import json import math class RasterStatsError(Exception): pass class OGRError(Exception): pass def bbox_to_pixel_offsets(gt, bbox): originX = gt[0] originY = gt[3] pixel_width = gt[1] pixel_height = gt[5] x1 = int(math.floor((bbox[0] - originX) / pixel_width)) ...
# -*- coding: utf-8 -*- """ Created on Thu Feb 1 11:34:39 2018 @author: MaggieYC_Pang """ import sys sys.path.append("../") from mongodb_api import mongodb_api import numpy as np import pandas as pd import matplotlib.pyplot as plt def moving_func(ip_list, step, func=np.mean, arg=None): op_list=...
<filename>salt/transport/table/public/pycrypto_rsa.py # -*- coding: utf-8 -*- ''' Manage RSA encryption via pycrypto The keydata consists of the following: pub: PEM encoded public key priv: PEM encoded private key ''' SEC_BACKEND = 'pycrypto_aes' # Import pycrypto libs import Crypto.Cipher import Crypto.Pub...
import copy import pickle import torch import torch.nn as nn import torch.optim as optim from torchvision.utils import save_image import numpy as np from Evaluation.Reviewer import * from Generative_Models.discriminator import Discriminator, Discriminator_Cifar from Generative_Models.generator import Generator, Gener...
<filename>src/beanmachine/graph/tests/graph_test.py # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest import numpy as np from beanmachine import graph class TestBayesNet(u...
from bika.lims import bikaMessageFactory as _ from bika.lims.browser import BrowserView from bika.lims.browser.bika_listing import BikaListingView from bika.lims.permissions import * from bika.lims.utils import isActive from bika.lims.utils import tmpID from plone.app.layout.globals.interfaces import IViewView from Pro...
#!/usr/bin/env python import yaml import json import oauth2 as oauth import feedparser import datetime from dateutil import parser from feedgen.feed import FeedGenerator import subprocess import os.path import requests import tldextract def unshorten(url): if len(tldextract.extract(url).suffix) > 2: return...
<gh_stars>0 import json, argparse, pickle import sqlite3 as lite import numpy as np import networkx as nx import matplotlib.pyplot as plt class EgoGraphs(object): def __init__(self, database="../database.db"): self.database = str(database) #self.readDatabase() #self.makeGraph() #se...
from datetime import datetime from unittest import TestCase, main from unittest.mock import Mock, patch from dateutil import relativedelta from MySQLdb import DatabaseError from spectacles_xix.db_ops import( NOT_TWEETED_CONDITION, PLAY_SELECT, abbreviation_db, play_db, query_by_wicks_id, query...
<reponame>COHRINT/cops_and_robots #!/usr/bin/env python """Provides a common base class for all map layers. Since many layers share parameters and functions, the ``layer`` module defines these in one place, allowing all layers to use it as a superclass. """ __author__ = "<NAME>" __copyright__ = "Copyright 2015, Cohri...
<gh_stars>0 #! coding:utf-8 """ The bottle module defines the Bottle class that is one element in a water sort puzzle. """ # Import to do typing :Bottle inside class Bottle from __future__ import annotations from typing import Sequence, Optional, Set, Any class BottleError(Exception): """Exception from the Bot...
<reponame>Rasools/CancerProteinSecretionML #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 20 09:50:10 2017 @author: azams Updated by <NAME> """ #print(__doc__) import os import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt # from sklearn.preprocess...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import operator import collections import math import os import random import zipfile import time import numpy as np from six.moves import urllib from six.moves import xrange # pylint: disable=redefined-builtin...
<filename>OffTarget.py import os, platform from PyQt5 import QtWidgets, uic, QtCore, QtGui from functools import partial import GlobalSettings import gzip import traceback #global logger logger = GlobalSettings.logger class OffTarget(QtWidgets.QDialog): def __init__(self): try: super(OffTarge...
<filename>inpainting/model/model_parsers.py import numpy as np import scipy import scipy.spatial import string import os,re import random import torch from ffindex import * to1letter = { "ALA":'A', "ARG":'R', "ASN":'N', "ASP":'D', "CYS":'C', "GLN":'Q', "GLU":'E', "GLY":'G', "HIS":'H', "ILE":'I', "LEU":'L',...
import json import os import logging import boto3 from botocore.exceptions import ClientError import pandas as pd import openpyxl import numpy as np # Handle logger logger = logging.getLogger() logger.setLevel(logging.os.environ['LOG_LEVEL']) dynamodb = boto3.resource('dynamodb') aws_environment = os.environ['AWSENV'...
<reponame>seahorn/crab-llvm #!/usr/bin/env python3 import sys import os import os.path import re #------------------------------------------------------------------------# # Process a *.crabir file generated by the Clam option --ocrab and print # information about how many assertions were proven by Clam. #-----------...
#------------------------------------------------------------------------------- # Name: mfapy Example_4_Simulation.py # Simulation of 13C-MFA using artificial observed MDVs to select effective carbon source. # Toy model used in this code in modified from Antoniewicz et al Metab. Eng. ...
<filename>alexnet/src/inference.py import json import os import time import torch import torchvision.transforms as transforms import torchvision.models as models from PIL import Image from matplotlib import pyplot as plt BASE_DIR = os.path.dirname(os.path.abspath(__file__)) device = torch.device("cuda" if torch.cuda.i...
#!/usr/bin/env python3 import discord from discord.ext import tasks, commands from RadarrAPI import RadarrAPI as radarr from getSubs import get_subs from ZoomPy import ZoomUs import csv import pandas as pd import requests import shutil import logging client = discord.Client() file2write=open("last_movie_id.txt",'w') f...
<gh_stars>0 import numpy as np from sklearn.model_selection import train_test_split from .formula import Formula from .plot import hist_two class VarLearning(): def __init__(self, name='test', data=None, n_target=1, test_size=0.2, var_labels=None, fix_dim=False, n_value=3, min_us...
<gh_stars>0 import shutil import subprocess import os import sys import requests import yaml import pystache import knightos.util as util from knightos.workspace import Workspace from knightos.kernels import ensure_kernel def execute(project_name=None, emulator=None, debugger=None, assembler=None, platform=None, vcs=N...
<gh_stars>0 """ @Author: <NAME> @Date: 22 Nov, 2021 @Description: Discriminator and Generator from DCGAN paper """ import torch import torch.nn as nn class Discriminator(nn.Module): def __init__(self, channel_img, features_d): super(Discriminator, self).__init__() self.disc = nn.Sequential( ...
<reponame>Panda4817/MySousChef from django import forms from django.forms import modelformset_factory from .models import * # Form for gathering recipe information when creating own recipe class MyRecipeInfoForm(forms.ModelForm): title = forms.CharField(widget=forms.TextInput(attrs={ 'class': 'form-...
<reponame>DanielMontecino/NeuroEvolution<filename>utils/codifications.py from time import time import numpy as np import random import pickle class Layer(object): def cross(self, other_layer): raise NotImplementedError def mutate(self): raise NotImplementedError def compare(self, other_...
<filename>extractors.py from functools import cached_property from typing import List from krysalid.html_tags import Tag from krysalid.parsers import Extractor from krysalid.queryset import QuerySet from krysalid.utils.iteration import break_when, keep_while TABLE_TAGS = ['table', 'thead', 'tr', 'th', 'td', 'tbody', ...
<filename>saves_bot/data.py<gh_stars>0 import asyncio import json import logging import time from pathlib import Path from typing import Optional, TypedDict, TypeVar import aiofiles from saves_bot.utils import WrappingLock _T = TypeVar('_T') class UserData(TypedDict): saves: float class GuildData(TypedDict):...
# -*- coding: utf-8 -*- import mltk from mltk.data import ArraysDataStream, DataStream import tensorkit as tk from tensorkit import tensor as T import sys import torch import numpy as np from flow_next.common import TrainConfig, DataSetConfig, make_dataset, train_model, ImageAugmentationMapper, get_mapper from flow_ne...
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the Google Analytics cookies.""" import unittest from plaso.formatters import ganalytics as _ # pylint: disable=unused-import from plaso.lib import eventdata from plaso.lib import timelib from plaso.parsers.cookie_plugins import ganalytics from plaso.parsers.sql...
<gh_stars>0 # Copyright 2014 - Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "<NAME>" at 20:22, 12/06/2020 % # ...
# -*- coding: utf-8 -*- # Copyright 2018 Moarri Project # # 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 o...
import numpy as np from keras.models import Sequential from keras.optimizers import SGD from keras.utils import np_utils #from matplotlib.pyplot import imshow from utils import * ######################## # Import the layer types needed from keras.layers.core import Dense, Activation, Dropout,Flatten from keras.layers....
<reponame>bio2bel/complexportal<filename>src/bio2bel_complexportal/export_belns.py # -*- coding: utf-8 -*- """Export Complex Portal as a BEL namespace.""" import sys from hashlib import sha256 from pathlib import Path from typing import Optional, Union from bel_resources import parse_bel_resource, write_namespace f...
# Copyright (c) 2019 Horizon Robotics. 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 applicab...
from selenium.webdriver.common.keys import Keys from selenium import webdriver import time import csv # SaveTable def SaveTable (DataTable): # Open File And set mode Write with open('mrudTables.csv', 'w',encoding='utf-8', newline='') as csvfile: # Head fieldnames = ['مشخصه', 'نام درس',...
from collections import defaultdict import numpy as np import unicodedata import torch from torch.utils.data import Dataset, DataLoader class Dictionary(object): NULL = '<NULL>' NO_OP = 'NO_OP' START = 2 @staticmethod def normalize(token): return unicodedata.normalize('NFD', token) ...
from typing import Iterable, List from spacy.language import Language from spacy.tokens import Doc, Span, Token __all__ = [ "bunsetu_available", "bunsetu_span", "bunsetu_spans", "bunsetu_phrase_span", "bunsetu_phrase_spans", "bunsetu_head_list", "bunsetu_head_tokens", "bunsetu_bi_label...
<reponame>berkeley-dsep-infra/data8xhub<filename>images/hwuploader/app.py #!/usr/bin/env python3 import os import sys import base64 import json from jinja2 import Environment, FileSystemLoader from tornado import httpserver, ioloop, web, log from ltivalidator import LTILaunchValidator, LTILaunchValidationError class ...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 29 11:37:07 2019 @author: deborahkhider """ import xarray as xr import cartopy.crs as ccrs import cartopy.feature as cfeature import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import image...
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np PROHIBITED_ID = 0 # Prohibited (non-walkway) WALKWAY_ID = 1 # Designated walkway STREET_ID = 2 # Street (prohibited for walking) CROSSING_ID = 3 # Transient walkway (e.g., street crossing) EXIT_ID = 4 # Cells represen...
import os import re import unittest import helpers class _StartTypeAnnotationsSentinel(object): pass class _EndTypeAnnotationsSentinel(object): pass _START_SENTINEL = _StartTypeAnnotationsSentinel() _END_SENTINEL = _EndTypeAnnotationsSentinel() def return_start_sentinel(): return _START_SENTINEL ...
<reponame>eserie/wax-ml<gh_stars>10-100 # Copyright 2021 The WAX-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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
<reponame>upciti/debops<gh_stars>0 import asyncio import itertools import os import re from collections import defaultdict from dataclasses import dataclass from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union, cast import httpx import ruamel.yaml from ruamel.yaml.emitter import Emitter ...
from inflection import camelize from jsonclasses.cdef import Cdef from jsonclasses.jfield import JField from jsonclasses.fdef import ( Fdef, ReadRule, WriteRule, Queryability, FType, FStore, Nullability ) from jsonclasses.modifiers.required_modifier import RequiredModifier from jsonclasses.modifiers.default_modifie...
<reponame>stevencdang/AutoML-DS-Components # Author: <NAME> # Class encapsulating a remote dataset with addional model prediction results import logging import os.path as path import os from io import IOBase import json from ls_dataset.d3m_dataset import D3MDataset from ls_dataset.ls_prediction import LSPrediction ...
<filename>questions/60742/main.py from urllib.request import Request, urlopen import pandas as pd import geopandas as gpd from matplotlib import pyplot as plt import seaborn as sns import matplotlib.colors as mcol plt.style.use("seaborn") req = Request( "https://vote.nyc/sites/default/files/pdf/election_results/2...
<filename>api/conftest.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import os import pytest from passlib.hash import bcrypt from starlette.testclient import TestClient from apit import app from app.db import DBPrediction, DBUser client = TestClient(app) API_USER_NAME = os.environ.get("API_NEW_USE...
<reponame>juiceinc/recipe """Test Recipe against multiple database engines""" import os from datetime import date, datetime from sqlalchemy import Column, Date, DateTime, Integer, MetaData, String, Table, insert from recipe import Recipe, Shelf, get_oven def str_dedent(s): return "\n".join([x.lstrip() for x in...
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import os import sys import re import time import subprocess from fabric.api import * from contrail_provisioning.database.base import DatabaseCommon from contrail_provisioning.database.templates import cassandra_create_user_templa...
from pyrosetta import * from pyrosetta.rosetta import * from rosetta.protocols.rosetta_scripts import * from rosetta.protocols.antibody import * from rosetta.protocols.antibody.design import * from pyrosetta.rosetta.core.scoring import * import pandas_anarci_numberer from rosetta.utility import * import os import sys i...
<reponame>reuvenperetz/model_optimization<gh_stars>10-100 # Copyright 2022 Sony Semiconductors Israel, 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:/...
# Copyright 2009-2012 10gen, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
#!/usr/bin/env python3 import pytest from itertools import cycle DAY='13' VERT='|' HORIZ='-' DIAGDU='/' DIAGUD='\\' INTER='+' CARTUP='^' CARTDOWN='v' CARTLEFT='<' CARTRIGHT='>' CARTS =(CARTUP, CARTDOWN, CARTLEFT, CARTRIGHT) CARTSL='L' CARTSS='S' CARTSR='R' CARTSEQUENCE=(CARTSL, CARTSS, CARTSR) CRASH='X' class Cart()...
<filename>gql/transport/requests.py import io import json import logging from typing import Any, Dict, Optional, Tuple, Type, Union import requests from graphql import DocumentNode, ExecutionResult, print_ast from requests.adapters import HTTPAdapter, Retry from requests.auth import AuthBase from requests.cookies impo...
<reponame>Gabrideg/Recognizers-Text<filename>Python/libraries/recognizers-date-time/recognizers_date_time/resources/portuguese_date_time.py # ------------------------------------------------------------------------------ # <auto-generated> # This code was generated by a tool. # Changes to this file may cause in...
import wx import re import os import sys import Model import Utils import ColGrid from collections import defaultdict from FixCategories import FixCategories, SetCategory from GetResults import GetResults, RidersCanSwap from ExportGrid import ExportGrid from RiderDetail import ShowRiderDetailDialog from EditEntry impor...
<gh_stars>1-10 from chainer.functions.array import broadcast from chainer.functions.array import concat from chainer.functions.array import reshape from chainer.functions.array import select_item from chainer.functions.array import split_axis from chainer.functions.connection import embed_id from chainer.functions.math...
<reponame>diogo1790team/inphinity_DM # -*- coding: utf-8 -*- """ Created on Tue Sep 26 15:24:17 2017 @author: Stage """ from SQL_obj_old.Bacterium_sql_old import Bacterium_sql_old from Bio import SeqIO from objects_new.Proteins_new import Protein from objects_new.WholeDNA_new import WholeDNA from files_treatment.fa...
<filename>improver/precipitation_type/shower_condition_probability.py<gh_stars>0 # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown copyright. The Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or wi...
<filename>interfaces/libreasr_pb2.py # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: libreasr.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protob...
<filename>models2df.py from PIL import Image import pandas as pd import os import sys import numpy as np import shutil import tensorflow as tf import pdb sys.path.append('./') sys.path.append('../') sys.path.append('../EIG_body_perception') from config import Options from demo import main def make_path(path): i...
<filename>fastrk/bt_8_9_16.py '''Butcher Table for Verner's RK8(9)16 algorithm. Original matlab code at: https://github.com/USNavalResearchLaboratory/TrackerComponentLibrary/blob/master/Mathematical_Functions/Differential_Equations/RungeKStep.m ''' def vf(a, b): return a + b * 6**0.5 A = [ [0, 0, 0, 0, 0,...
<filename>Titanic-Analysis.py # coding: utf-8 # # Investigation- Titanic Disaster # # by **_<NAME>_** (June, 2017) # ### Description: # # _The sinking of the RMS Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg...
<gh_stars>0 from __future__ import division __copyright__ = "Copyright (C) 2009-2013 <NAME>" __license__ = """ 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 witho...
import re import numpy as np from numpy.core.defchararray import array from numpy.core.numeric import flatnonzero from pyRBDL.Dynamics.CompositeRigidBodyAlgorithm import CompositeRigidBodyAlgorithm from pyRBDL.Dynamics.InverseDynamics import InverseDynamics from numpy.linalg import inv from pyRBDL.Contact.DetectContact...
# python常用扩展库 numpy和pandas import numpy as np import pandas as pd # 1 Pandas数据结构-Series # 主要的数据结构为Series(存储)和DataFrame(分析) # 1.1 Series-由索引和值组成,索引在左侧,值在右侧 s1 = pd.Series([1, 2, 3, 4, 5]) print('s1= ', s1) # 还可以设置索引 s2 = pd.Series([1, 2, 3, 4, 5], index=['第一', '第二', '第三', '第四', '第五']) print('s2= ', s2) # 通过values和index...
from io import BytesIO from PIL import Image import shutil import arrow from bs4 import BeautifulSoup import requests def get_stream_url(flickr_link): '''Processes a long flickr link to the main stream page''' parsed = flickr_link.replace('https://', '').split('/') url = '/'.join(parsed[:parsed.index('n...
<reponame>select766/neneshogi """ 教師AIと評価対象AIの指し手を比較する。 USIエンジン対応。 エンジンの設定ファイルは、やねうら王自動対局フレームワークのフォーマットに準拠。以下引用: 1行目にengineの実行ファイル名(同じフォルダに配置) 2行目に思考時のコマンド 3行目以降にsetoption等、初期化時に思考エンジンに送りたいコマンドを書く。 例) test.exe go btime 100 wtime 100 byoyomi 0 setoption name Threads value 1 setoption nam...
<gh_stars>1-10 import numpy as np from PyQt5 import QtWidgets as widgets from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA from sklearn.decomposition import PCA from suss.gui....
<reponame>cblades-tc/dendrol from typing import Iterable, Tuple import pytest import yaml from dendrol import Pattern, PatternTree from dendrol.debug import PatternTreeLoader TESTS = yaml.load(''' simple-comparison: expression: > [ipv4-addr:value = '1.2.3.4'] pattern: observation: objects: {ipv4...
import pytest import asyncio from system.utils import * import logging logger = logging.getLogger(__name__) @pytest.mark.usefixtures('docker_setup_and_teardown') class TestAuditSuite: @pytest.mark.asyncio async def test_case_restart_one_node( self, pool_handler, wallet_handler, get_...
<filename>tensorflow/python/eager/wrap_function.py # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Ekta Space PS 5 Colourspace =========================== Defines the *Ekta Space PS 5* colourspace: - :attr:`EKTA_SPACE_PS_5_COLOURSPACE`. See Also -------- `RGB Colourspaces IPython Notebook <http://nbviewer.ipython.org/github/colour-science/colour-ipython/blob/ma...
<reponame>Vultaire/charm-ceilometer # Copyright 2016 Canonical 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 appli...
# 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...
<gh_stars>1-10 import chess import chess.pgn import chess.polyglot MAX_BOOK_PLIES = 60 MAX_BOOK_WEIGHT = 10000 def format_zobrist_key_hex(zobrist_key): return "%0.16x" % zobrist_key def get_zobrist_key_hex(board): return format_zobrist_key_hex(chess.polyglot.zobrist_hash(board)) class BookMove(): def __init__(s...